@unifold/ui-react 0.1.81 → 0.1.82

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -30,6 +30,7 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
30
30
  // src/index.ts
31
31
  var index_exports = {};
32
32
  __export(index_exports, {
33
+ ALL_COUNTRIES: () => ALL_COUNTRIES,
33
34
  AnalyticsProvider: () => AnalyticsProvider,
34
35
  BankTransfer: () => BankTransfer,
35
36
  BankTransferButton: () => BankTransferButton,
@@ -38,11 +39,14 @@ __export(index_exports, {
38
39
  BuyWithCard: () => BuyWithCard,
39
40
  BuyWithGooglePay: () => BuyWithGooglePay,
40
41
  BuyWithWalletPay: () => BuyWithWalletPay,
42
+ COUNTRIES: () => COUNTRIES,
43
+ COUNTRY_GROUPS: () => COUNTRY_GROUPS,
41
44
  CheckingForDepositIndicator: () => CheckingForDepositIndicator,
42
45
  CheckoutModal: () => CheckoutModal,
43
46
  CoinbaseConnect: () => CoinbaseConnect,
44
47
  ConfirmingView: () => ConfirmingView,
45
48
  ConnectExchangeButton: () => ConnectExchangeButton,
49
+ CountryFlag: () => CountryFlag,
46
50
  CurrencyListItem: () => CurrencyListItem,
47
51
  CurrencyListSection: () => CurrencyListSection,
48
52
  CurrencyModal: () => CurrencyModal,
@@ -70,6 +74,9 @@ __export(index_exports, {
70
74
  ManualDepositButton: () => ManualDepositButton,
71
75
  PayWithStripeLink: () => PayWithStripeLink,
72
76
  QRCodeSkeleton: () => QRCodeSkeleton,
77
+ REGION_SHEET_ANCHOR_ATTR: () => REGION_SHEET_ANCHOR_ATTR,
78
+ RegionPickerButton: () => RegionPickerButton,
79
+ RegionSelectorSheet: () => RegionSelectorSheet,
73
80
  SUPPORTED_LOCALES: () => SUPPORTED_LOCALES,
74
81
  Select: () => Select,
75
82
  SelectContent: () => SelectContent,
@@ -92,6 +99,7 @@ __export(index_exports, {
92
99
  TransferCryptoDoubleInput: () => TransferCryptoDoubleInput,
93
100
  TransferCryptoSingleInput: () => TransferCryptoSingleInput,
94
101
  TransferQrCode: () => TransferQrCode,
102
+ US_STATES: () => US_STATES,
95
103
  WalletPayQrCheckout: () => WalletPayQrCheckout,
96
104
  WithdrawConfirmingView: () => WithdrawConfirmingView,
97
105
  WithdrawDoubleInput: () => WithdrawDoubleInput,
@@ -106,10 +114,17 @@ __export(index_exports, {
106
114
  cn: () => cn,
107
115
  colors: () => colors,
108
116
  connectSolanaStandardWallet: () => connectSolanaStandardWallet,
117
+ countryFlag: () => countryFlag,
118
+ countryFlagIconPath: () => countryFlagIconPath,
119
+ countryFlagPngPath: () => countryFlagPngPath,
120
+ countryName: () => countryName,
109
121
  defaultColors: () => defaultColors,
110
122
  detectBrowserLocale: () => detectBrowserLocale,
111
123
  detectBrowserWallet: () => detectBrowserWallet,
112
124
  detectConnectedBrowserWallet: () => detectConnectedBrowserWallet,
125
+ dialCode: () => dialCode,
126
+ filterRegions: () => filterRegions,
127
+ findCountry: () => findCountry,
113
128
  findSolanaStandardWallet: () => findSolanaStandardWallet,
114
129
  formatCryptoAmount: () => formatCryptoAmount,
115
130
  formatFiat: () => formatFiat,
@@ -117,6 +132,7 @@ __export(index_exports, {
117
132
  getActiveStrings: () => getActiveStrings,
118
133
  getAuthorizedSolanaStandardAccounts: () => getAuthorizedSolanaStandardAccounts,
119
134
  getColors: () => getColors,
135
+ getKycCountryList: () => getKycCountryList,
120
136
  getSolanaStandardWallets: () => getSolanaStandardWallets,
121
137
  getStoredApplePaySession: () => getStoredWalletPaySession,
122
138
  getStoredWalletPaySession: () => getStoredWalletPaySession,
@@ -124,6 +140,7 @@ __export(index_exports, {
124
140
  i18n: () => i18n,
125
141
  interpolate: () => interpolate,
126
142
  isHypercoreChain: () => isHypercoreChain,
143
+ isInGroup: () => isInGroup,
127
144
  isOnrampTokenFresh: () => isOnrampTokenFresh,
128
145
  isSolanaWalletDetectedViaWalletStandard: () => isSolanaWalletDetectedViaWalletStandard,
129
146
  mergeColors: () => mergeColors,
@@ -142,7 +159,9 @@ __export(index_exports, {
142
159
  startBrowserWalletDiscovery: () => startBrowserWalletDiscovery,
143
160
  subscribeSolanaStandardAccountChanges: () => subscribeSolanaStandardAccountChanges,
144
161
  subscribeSolanaStandardWallets: () => subscribeSolanaStandardWallets,
162
+ toAlpha2: () => toAlpha2,
145
163
  truncateAddress: () => truncateAddress,
164
+ usStateName: () => usStateName,
146
165
  useAddressBalance: () => useAddressBalance,
147
166
  useAllowedCountry: () => useAllowedCountry,
148
167
  useAnalytics: () => useAnalytics,
@@ -185,6 +204,9 @@ var en_default = {
185
204
  loading: "Loading...",
186
205
  search: "Search",
187
206
  close: "Close",
207
+ noResults: "No matches found",
208
+ selectCountry: "Select country",
209
+ selectState: "Select state",
188
210
  review: "Review",
189
211
  tryAgain: "Try Again",
190
212
  somethingWentWrong: "Something went wrong",
@@ -407,6 +429,7 @@ var en_default = {
407
429
  not_opted_in: "Please make sure you opt-in {{token_symbol}}({{chain_name}}) before receiving funds",
408
430
  insufficient_balance: "Recipient account does not meet the minimum balance requirement",
409
431
  account_not_found: "Recipient account does not exist on {{chain_name}}",
432
+ destination_tag_required: "This {{chain_name}} address requires a memo tag. Please provide your memo tag as well, in the format address:memotag",
410
433
  validation_error: "Unable to verify recipient address on {{chain_name}}"
411
434
  },
412
435
  defaultError: "The recipient address cannot receive funds for the selected token"
@@ -985,12 +1008,18 @@ var en_default = {
985
1008
  receiveChain: "Receive chain",
986
1009
  recipientAddress: "Recipient address",
987
1010
  recipientAddressPlaceholder: "Enter wallet address",
1011
+ recipientAddressPlaceholderXrpl: "Enter wallet address, or address:memotag",
988
1012
  amount: "Amount",
989
1013
  amountPlaceholder: "0.00",
990
1014
  balance: "Balance",
991
1015
  minimum: "min",
992
1016
  withdraw: "Withdraw",
993
1017
  invalidAddress: "Please enter a valid address",
1018
+ invalidXrplAddress: "Please enter a valid {{chain_name}} address. If your recipient requires a memo tag, please provide it as well, in the format address:memotag",
1019
+ memoTag: "Memo tag",
1020
+ memoTagPlaceholder: "e.g. 12345",
1021
+ memoTagRequiredHint: "This {{chain_name}} address requires a memo tag before it can receive funds",
1022
+ invalidMemoTag: "Memo tag must be a whole number between 0 and 4294967295",
994
1023
  invalidAmount: "Please enter a valid amount",
995
1024
  verifyingAddress: "Verifying address...",
996
1025
  loading: "Loading...",
@@ -1040,6 +1069,9 @@ var zh_default = {
1040
1069
  loading: "\u52A0\u8F7D\u4E2D...",
1041
1070
  search: "\u641C\u7D22",
1042
1071
  close: "\u5173\u95ED",
1072
+ noResults: "\u6CA1\u6709\u5339\u914D\u7684\u7ED3\u679C",
1073
+ selectCountry: "\u9009\u62E9\u56FD\u5BB6",
1074
+ selectState: "\u9009\u62E9\u5DDE",
1043
1075
  review: "\u786E\u8BA4\u4FE1\u606F",
1044
1076
  tryAgain: "\u91CD\u8BD5",
1045
1077
  somethingWentWrong: "\u51FA\u73B0\u9519\u8BEF",
@@ -1262,6 +1294,7 @@ var zh_default = {
1262
1294
  not_opted_in: "\u8BF7\u5148\u5728 {{chain_name}} \u4E0A\u5F00\u901A {{token_symbol}}\uFF0C\u7136\u540E\u518D\u63A5\u6536\u8D44\u91D1",
1263
1295
  insufficient_balance: "\u6536\u6B3E\u8D26\u6237\u672A\u6EE1\u8DB3\u6700\u4F4E\u4F59\u989D\u8981\u6C42",
1264
1296
  account_not_found: "\u6536\u6B3E\u8D26\u6237\u5728 {{chain_name}} \u4E0A\u4E0D\u5B58\u5728",
1297
+ destination_tag_required: "\u8BE5 {{chain_name}} \u5730\u5740\u9700\u8981\u76EE\u6807\u6807\u7B7E\uFF08Destination Tag\uFF09\uFF0C\u8BF7\u4E00\u5E76\u586B\u5199\u6807\u7B7E\uFF0C\u683C\u5F0F\u4E3A \u5730\u5740:\u6807\u7B7E",
1265
1298
  validation_error: "\u65E0\u6CD5\u5728 {{chain_name}} \u4E0A\u9A8C\u8BC1\u6536\u6B3E\u5730\u5740"
1266
1299
  },
1267
1300
  defaultError: "\u8BE5\u6536\u6B3E\u5730\u5740\u65E0\u6CD5\u63A5\u6536\u6240\u9009\u4EE3\u5E01\u7684\u8D44\u91D1"
@@ -1840,12 +1873,18 @@ var zh_default = {
1840
1873
  receiveChain: "\u63A5\u6536\u7F51\u7EDC",
1841
1874
  recipientAddress: "\u6536\u6B3E\u5730\u5740",
1842
1875
  recipientAddressPlaceholder: "\u8F93\u5165\u94B1\u5305\u5730\u5740",
1876
+ recipientAddressPlaceholderXrpl: "\u8F93\u5165\u5730\u5740\uFF0C\u6216 \u5730\u5740:\u6807\u7B7E",
1843
1877
  amount: "\u91D1\u989D",
1844
1878
  amountPlaceholder: "0.00",
1845
1879
  balance: "\u4F59\u989D",
1846
1880
  minimum: "\u6700\u4F4E",
1847
1881
  withdraw: "\u63D0\u73B0",
1848
1882
  invalidAddress: "\u8BF7\u8F93\u5165\u6709\u6548\u5730\u5740",
1883
+ invalidXrplAddress: "\u8BF7\u8F93\u5165\u6709\u6548\u7684 {{chain_name}} \u5730\u5740\u3002\u5982\u679C\u6536\u6B3E\u65B9\u9700\u8981\u76EE\u6807\u6807\u7B7E\uFF0C\u8BF7\u4E00\u5E76\u586B\u5199\uFF0C\u683C\u5F0F\u4E3A \u5730\u5740:\u6807\u7B7E",
1884
+ memoTag: "\u76EE\u6807\u6807\u7B7E",
1885
+ memoTagPlaceholder: "\u4F8B\u5982 12345",
1886
+ memoTagRequiredHint: "\u8BE5 {{chain_name}} \u5730\u5740\u9700\u8981\u586B\u5199\u76EE\u6807\u6807\u7B7E\u624D\u80FD\u6536\u6B3E",
1887
+ invalidMemoTag: "\u76EE\u6807\u6807\u7B7E\u5FC5\u987B\u662F 0 \u5230 4294967295 \u4E4B\u95F4\u7684\u6574\u6570",
1849
1888
  invalidAmount: "\u8BF7\u8F93\u5165\u6709\u6548\u91D1\u989D",
1850
1889
  verifyingAddress: "\u6B63\u5728\u9A8C\u8BC1\u5730\u5740...",
1851
1890
  loading: "\u52A0\u8F7D\u4E2D...",
@@ -1895,6 +1934,9 @@ var zh_TW_default = {
1895
1934
  loading: "\u8F09\u5165\u4E2D...",
1896
1935
  search: "\u641C\u5C0B",
1897
1936
  close: "\u95DC\u9589",
1937
+ noResults: "\u6C92\u6709\u7B26\u5408\u7684\u7D50\u679C",
1938
+ selectCountry: "\u9078\u64C7\u570B\u5BB6",
1939
+ selectState: "\u9078\u64C7\u5DDE",
1898
1940
  review: "\u78BA\u8A8D\u8CC7\u8A0A",
1899
1941
  tryAgain: "\u91CD\u8A66",
1900
1942
  somethingWentWrong: "\u767C\u751F\u932F\u8AA4",
@@ -2117,6 +2159,7 @@ var zh_TW_default = {
2117
2159
  not_opted_in: "\u8ACB\u5148\u5728 {{chain_name}} \u4E0A\u958B\u901A {{token_symbol}}\uFF0C\u7136\u5F8C\u518D\u63A5\u6536\u8CC7\u91D1",
2118
2160
  insufficient_balance: "\u6536\u6B3E\u5E33\u6236\u672A\u9054\u6700\u4F4E\u9918\u984D\u8981\u6C42",
2119
2161
  account_not_found: "\u6536\u6B3E\u5E33\u6236\u5728 {{chain_name}} \u4E0A\u4E0D\u5B58\u5728",
2162
+ destination_tag_required: "\u8A72 {{chain_name}} \u5730\u5740\u9700\u8981\u76EE\u7684\u5730\u6A19\u7C64\uFF08Destination Tag\uFF09\uFF0C\u8ACB\u4E00\u4F75\u586B\u5BEB\u6A19\u7C64\uFF0C\u683C\u5F0F\u70BA \u5730\u5740:\u6A19\u7C64",
2120
2163
  validation_error: "\u7121\u6CD5\u5728 {{chain_name}} \u4E0A\u9A57\u8B49\u6536\u6B3E\u5730\u5740"
2121
2164
  },
2122
2165
  defaultError: "\u8A72\u6536\u6B3E\u5730\u5740\u7121\u6CD5\u63A5\u6536\u6240\u9078\u4EE3\u5E63\u7684\u8CC7\u91D1"
@@ -2695,12 +2738,18 @@ var zh_TW_default = {
2695
2738
  receiveChain: "\u63A5\u6536\u7DB2\u8DEF",
2696
2739
  recipientAddress: "\u6536\u6B3E\u5730\u5740",
2697
2740
  recipientAddressPlaceholder: "\u8F38\u5165\u9322\u5305\u5730\u5740",
2741
+ recipientAddressPlaceholderXrpl: "\u8F38\u5165\u5730\u5740\uFF0C\u6216 \u5730\u5740:\u6A19\u7C64",
2698
2742
  amount: "\u91D1\u984D",
2699
2743
  amountPlaceholder: "0.00",
2700
2744
  balance: "\u9918\u984D",
2701
2745
  minimum: "\u6700\u4F4E",
2702
2746
  withdraw: "\u63D0\u9818",
2703
2747
  invalidAddress: "\u8ACB\u8F38\u5165\u6709\u6548\u5730\u5740",
2748
+ invalidXrplAddress: "\u8ACB\u8F38\u5165\u6709\u6548\u7684 {{chain_name}} \u5730\u5740\u3002\u82E5\u6536\u6B3E\u65B9\u9700\u8981\u76EE\u7684\u5730\u6A19\u7C64\uFF0C\u8ACB\u4E00\u4F75\u586B\u5BEB\uFF0C\u683C\u5F0F\u70BA \u5730\u5740:\u6A19\u7C64",
2749
+ memoTag: "\u76EE\u7684\u5730\u6A19\u7C64",
2750
+ memoTagPlaceholder: "\u4F8B\u5982 12345",
2751
+ memoTagRequiredHint: "\u8A72 {{chain_name}} \u5730\u5740\u9700\u8981\u586B\u5BEB\u76EE\u7684\u5730\u6A19\u7C64\u624D\u80FD\u6536\u6B3E",
2752
+ invalidMemoTag: "\u76EE\u7684\u5730\u6A19\u7C64\u5FC5\u9808\u662F 0 \u5230 4294967295 \u4E4B\u9593\u7684\u6574\u6578",
2704
2753
  invalidAmount: "\u8ACB\u8F38\u5165\u6709\u6548\u91D1\u984D",
2705
2754
  verifyingAddress: "\u6B63\u5728\u9A57\u8B49\u5730\u5740...",
2706
2755
  loading: "\u8F09\u5165\u4E2D...",
@@ -2750,6 +2799,9 @@ var fr_default = {
2750
2799
  loading: "Chargement...",
2751
2800
  search: "Rechercher",
2752
2801
  close: "Fermer",
2802
+ noResults: "Aucun r\xE9sultat",
2803
+ selectCountry: "S\xE9lectionner un pays",
2804
+ selectState: "S\xE9lectionner un \xC9tat",
2753
2805
  review: "V\xE9rifier",
2754
2806
  tryAgain: "R\xE9essayer",
2755
2807
  somethingWentWrong: "Une erreur s'est produite",
@@ -2972,6 +3024,7 @@ var fr_default = {
2972
3024
  not_opted_in: "Veuillez d'abord activer {{token_symbol}} ({{chain_name}}) avant de recevoir des fonds",
2973
3025
  insufficient_balance: "Le compte destinataire ne respecte pas le solde minimum requis",
2974
3026
  account_not_found: "Le compte destinataire n'existe pas sur {{chain_name}}",
3027
+ destination_tag_required: "Cette adresse {{chain_name}} n\xE9cessite un tag de destination. Veuillez \xE9galement indiquer votre tag, au format adresse:tag",
2975
3028
  validation_error: "Impossible de v\xE9rifier l'adresse du destinataire sur {{chain_name}}"
2976
3029
  },
2977
3030
  defaultError: "L'adresse du destinataire ne peut pas recevoir de fonds pour le jeton s\xE9lectionn\xE9"
@@ -3550,12 +3603,18 @@ var fr_default = {
3550
3603
  receiveChain: "R\xE9seau de r\xE9ception",
3551
3604
  recipientAddress: "Adresse du destinataire",
3552
3605
  recipientAddressPlaceholder: "Saisir l'adresse du portefeuille",
3606
+ recipientAddressPlaceholderXrpl: "Saisir l'adresse, ou adresse:tag",
3553
3607
  amount: "Montant",
3554
3608
  amountPlaceholder: "0,00",
3555
3609
  balance: "Solde",
3556
3610
  minimum: "min.",
3557
3611
  withdraw: "Retirer",
3558
3612
  invalidAddress: "Veuillez saisir une adresse valide",
3613
+ invalidXrplAddress: "Veuillez saisir une adresse {{chain_name}} valide. Si votre destinataire n\xE9cessite un tag de destination, indiquez-le \xE9galement, au format adresse:tag",
3614
+ memoTag: "Tag de destination",
3615
+ memoTagPlaceholder: "ex. 12345",
3616
+ memoTagRequiredHint: "Cette adresse {{chain_name}} n\xE9cessite un tag de destination pour recevoir des fonds",
3617
+ invalidMemoTag: "Le tag de destination doit \xEAtre un nombre entier entre 0 et 4294967295",
3559
3618
  invalidAmount: "Veuillez saisir un montant valide",
3560
3619
  verifyingAddress: "V\xE9rification de l'adresse...",
3561
3620
  loading: "Chargement...",
@@ -3605,6 +3664,9 @@ var th_default = {
3605
3664
  loading: "\u0E01\u0E33\u0E25\u0E31\u0E07\u0E42\u0E2B\u0E25\u0E14...",
3606
3665
  search: "\u0E04\u0E49\u0E19\u0E2B\u0E32",
3607
3666
  close: "\u0E1B\u0E34\u0E14",
3667
+ noResults: "\u0E44\u0E21\u0E48\u0E1E\u0E1A\u0E23\u0E32\u0E22\u0E01\u0E32\u0E23\u0E17\u0E35\u0E48\u0E15\u0E23\u0E07\u0E01\u0E31\u0E19",
3668
+ selectCountry: "\u0E40\u0E25\u0E37\u0E2D\u0E01\u0E1B\u0E23\u0E30\u0E40\u0E17\u0E28",
3669
+ selectState: "\u0E40\u0E25\u0E37\u0E2D\u0E01\u0E23\u0E31\u0E10",
3608
3670
  review: "\u0E15\u0E23\u0E27\u0E08\u0E2A\u0E2D\u0E1A",
3609
3671
  tryAgain: "\u0E25\u0E2D\u0E07\u0E2D\u0E35\u0E01\u0E04\u0E23\u0E31\u0E49\u0E07",
3610
3672
  somethingWentWrong: "\u0E40\u0E01\u0E34\u0E14\u0E02\u0E49\u0E2D\u0E1C\u0E34\u0E14\u0E1E\u0E25\u0E32\u0E14",
@@ -3827,6 +3889,7 @@ var th_default = {
3827
3889
  not_opted_in: "\u0E42\u0E1B\u0E23\u0E14\u0E40\u0E1B\u0E34\u0E14\u0E43\u0E0A\u0E49 {{token_symbol}} ({{chain_name}}) \u0E01\u0E48\u0E2D\u0E19\u0E23\u0E31\u0E1A\u0E40\u0E07\u0E34\u0E19",
3828
3890
  insufficient_balance: "\u0E1A\u0E31\u0E0D\u0E0A\u0E35\u0E1C\u0E39\u0E49\u0E23\u0E31\u0E1A\u0E44\u0E21\u0E48\u0E21\u0E35\u0E22\u0E2D\u0E14\u0E04\u0E07\u0E40\u0E2B\u0E25\u0E37\u0E2D\u0E02\u0E31\u0E49\u0E19\u0E15\u0E48\u0E33\u0E15\u0E32\u0E21\u0E17\u0E35\u0E48\u0E01\u0E33\u0E2B\u0E19\u0E14",
3829
3891
  account_not_found: "\u0E44\u0E21\u0E48\u0E21\u0E35\u0E1A\u0E31\u0E0D\u0E0A\u0E35\u0E1C\u0E39\u0E49\u0E23\u0E31\u0E1A\u0E1A\u0E19 {{chain_name}}",
3892
+ destination_tag_required: "\u0E17\u0E35\u0E48\u0E2D\u0E22\u0E39\u0E48 {{chain_name}} \u0E19\u0E35\u0E49\u0E15\u0E49\u0E2D\u0E07\u0E21\u0E35 destination tag \u0E01\u0E23\u0E38\u0E13\u0E32\u0E23\u0E30\u0E1A\u0E38\u0E41\u0E17\u0E47\u0E01\u0E02\u0E2D\u0E07\u0E04\u0E38\u0E13\u0E14\u0E49\u0E27\u0E22 \u0E43\u0E19\u0E23\u0E39\u0E1B\u0E41\u0E1A\u0E1A \u0E17\u0E35\u0E48\u0E2D\u0E22\u0E39\u0E48:\u0E41\u0E17\u0E47\u0E01",
3830
3893
  validation_error: "\u0E44\u0E21\u0E48\u0E2A\u0E32\u0E21\u0E32\u0E23\u0E16\u0E15\u0E23\u0E27\u0E08\u0E2A\u0E2D\u0E1A\u0E17\u0E35\u0E48\u0E2D\u0E22\u0E39\u0E48\u0E1C\u0E39\u0E49\u0E23\u0E31\u0E1A\u0E1A\u0E19 {{chain_name}} \u0E44\u0E14\u0E49"
3831
3894
  },
3832
3895
  defaultError: "\u0E17\u0E35\u0E48\u0E2D\u0E22\u0E39\u0E48\u0E1C\u0E39\u0E49\u0E23\u0E31\u0E1A\u0E44\u0E21\u0E48\u0E2A\u0E32\u0E21\u0E32\u0E23\u0E16\u0E23\u0E31\u0E1A\u0E40\u0E07\u0E34\u0E19\u0E2A\u0E33\u0E2B\u0E23\u0E31\u0E1A\u0E42\u0E17\u0E40\u0E04\u0E19\u0E17\u0E35\u0E48\u0E40\u0E25\u0E37\u0E2D\u0E01\u0E44\u0E14\u0E49"
@@ -4405,12 +4468,18 @@ var th_default = {
4405
4468
  receiveChain: "\u0E40\u0E04\u0E23\u0E37\u0E2D\u0E02\u0E48\u0E32\u0E22\u0E17\u0E35\u0E48\u0E44\u0E14\u0E49\u0E23\u0E31\u0E1A",
4406
4469
  recipientAddress: "\u0E17\u0E35\u0E48\u0E2D\u0E22\u0E39\u0E48\u0E1C\u0E39\u0E49\u0E23\u0E31\u0E1A",
4407
4470
  recipientAddressPlaceholder: "\u0E01\u0E23\u0E2D\u0E01\u0E17\u0E35\u0E48\u0E2D\u0E22\u0E39\u0E48\u0E01\u0E23\u0E30\u0E40\u0E1B\u0E4B\u0E32\u0E40\u0E07\u0E34\u0E19",
4471
+ recipientAddressPlaceholderXrpl: "\u0E01\u0E23\u0E2D\u0E01\u0E17\u0E35\u0E48\u0E2D\u0E22\u0E39\u0E48 \u0E2B\u0E23\u0E37\u0E2D \u0E17\u0E35\u0E48\u0E2D\u0E22\u0E39\u0E48:\u0E41\u0E17\u0E47\u0E01",
4408
4472
  amount: "\u0E08\u0E33\u0E19\u0E27\u0E19",
4409
4473
  amountPlaceholder: "0.00",
4410
4474
  balance: "\u0E22\u0E2D\u0E14\u0E04\u0E07\u0E40\u0E2B\u0E25\u0E37\u0E2D",
4411
4475
  minimum: "\u0E02\u0E31\u0E49\u0E19\u0E15\u0E48\u0E33",
4412
4476
  withdraw: "\u0E16\u0E2D\u0E19",
4413
4477
  invalidAddress: "\u0E42\u0E1B\u0E23\u0E14\u0E01\u0E23\u0E2D\u0E01\u0E17\u0E35\u0E48\u0E2D\u0E22\u0E39\u0E48\u0E17\u0E35\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07",
4478
+ invalidXrplAddress: "\u0E42\u0E1B\u0E23\u0E14\u0E01\u0E23\u0E2D\u0E01\u0E17\u0E35\u0E48\u0E2D\u0E22\u0E39\u0E48 {{chain_name}} \u0E17\u0E35\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07 \u0E2B\u0E32\u0E01\u0E1C\u0E39\u0E49\u0E23\u0E31\u0E1A\u0E15\u0E49\u0E2D\u0E07\u0E43\u0E0A\u0E49 destination tag \u0E01\u0E23\u0E38\u0E13\u0E32\u0E23\u0E30\u0E1A\u0E38\u0E14\u0E49\u0E27\u0E22\u0E43\u0E19\u0E23\u0E39\u0E1B\u0E41\u0E1A\u0E1A \u0E17\u0E35\u0E48\u0E2D\u0E22\u0E39\u0E48:\u0E41\u0E17\u0E47\u0E01",
4479
+ memoTag: "Destination tag",
4480
+ memoTagPlaceholder: "\u0E40\u0E0A\u0E48\u0E19 12345",
4481
+ memoTagRequiredHint: "\u0E17\u0E35\u0E48\u0E2D\u0E22\u0E39\u0E48 {{chain_name}} \u0E19\u0E35\u0E49\u0E15\u0E49\u0E2D\u0E07\u0E21\u0E35 destination tag \u0E08\u0E36\u0E07\u0E08\u0E30\u0E23\u0E31\u0E1A\u0E40\u0E07\u0E34\u0E19\u0E44\u0E14\u0E49",
4482
+ invalidMemoTag: "Destination tag \u0E15\u0E49\u0E2D\u0E07\u0E40\u0E1B\u0E47\u0E19\u0E08\u0E33\u0E19\u0E27\u0E19\u0E40\u0E15\u0E47\u0E21\u0E23\u0E30\u0E2B\u0E27\u0E48\u0E32\u0E07 0 \u0E16\u0E36\u0E07 4294967295",
4414
4483
  invalidAmount: "\u0E42\u0E1B\u0E23\u0E14\u0E01\u0E23\u0E2D\u0E01\u0E08\u0E33\u0E19\u0E27\u0E19\u0E17\u0E35\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07",
4415
4484
  verifyingAddress: "\u0E01\u0E33\u0E25\u0E31\u0E07\u0E15\u0E23\u0E27\u0E08\u0E2A\u0E2D\u0E1A\u0E17\u0E35\u0E48\u0E2D\u0E22\u0E39\u0E48...",
4416
4485
  loading: "\u0E01\u0E33\u0E25\u0E31\u0E07\u0E42\u0E2B\u0E25\u0E14...",
@@ -4460,6 +4529,9 @@ var ja_default = {
4460
4529
  loading: "\u8AAD\u307F\u8FBC\u307F\u4E2D...",
4461
4530
  search: "\u691C\u7D22",
4462
4531
  close: "\u9589\u3058\u308B",
4532
+ noResults: "\u4E00\u81F4\u3059\u308B\u9805\u76EE\u304C\u3042\u308A\u307E\u305B\u3093",
4533
+ selectCountry: "\u56FD\u3092\u9078\u629E",
4534
+ selectState: "\u5DDE\u3092\u9078\u629E",
4463
4535
  review: "\u78BA\u8A8D",
4464
4536
  tryAgain: "\u518D\u8A66\u884C",
4465
4537
  somethingWentWrong: "\u554F\u984C\u304C\u767A\u751F\u3057\u307E\u3057\u305F",
@@ -4682,6 +4754,7 @@ var ja_default = {
4682
4754
  not_opted_in: "\u8CC7\u91D1\u3092\u53D7\u3051\u53D6\u308B\u524D\u306B\u3001{{chain_name}}\u3067{{token_symbol}}\u3092\u30AA\u30D7\u30C8\u30A4\u30F3\u3057\u3066\u304F\u3060\u3055\u3044",
4683
4755
  insufficient_balance: "\u53D7\u53D6\u53E3\u5EA7\u304C\u6700\u4F4E\u6B8B\u9AD8\u306E\u8981\u4EF6\u3092\u6E80\u305F\u3057\u3066\u3044\u307E\u305B\u3093",
4684
4756
  account_not_found: "{{chain_name}}\u4E0A\u306B\u53D7\u53D6\u53E3\u5EA7\u304C\u5B58\u5728\u3057\u307E\u305B\u3093",
4757
+ destination_tag_required: "\u3053\u306E{{chain_name}}\u30A2\u30C9\u30EC\u30B9\u306B\u306F\u5B9B\u5148\u30BF\u30B0\u304C\u5FC5\u8981\u3067\u3059\u3002\u5B9B\u5148\u30BF\u30B0\u3082\u300C\u30A2\u30C9\u30EC\u30B9:\u30BF\u30B0\u300D\u306E\u5F62\u5F0F\u3067\u5165\u529B\u3057\u3066\u304F\u3060\u3055\u3044",
4685
4758
  validation_error: "{{chain_name}}\u4E0A\u306E\u53D7\u53D6\u30A2\u30C9\u30EC\u30B9\u3092\u78BA\u8A8D\u3067\u304D\u307E\u305B\u3093"
4686
4759
  },
4687
4760
  defaultError: "\u9078\u629E\u3057\u305F\u30C8\u30FC\u30AF\u30F3\u3067\u306F\u3001\u3053\u306E\u53D7\u53D6\u30A2\u30C9\u30EC\u30B9\u306B\u8CC7\u91D1\u3092\u9001\u308C\u307E\u305B\u3093"
@@ -5260,12 +5333,18 @@ var ja_default = {
5260
5333
  receiveChain: "\u53D7\u53D6\u30C1\u30A7\u30FC\u30F3",
5261
5334
  recipientAddress: "\u53D7\u53D6\u30A2\u30C9\u30EC\u30B9",
5262
5335
  recipientAddressPlaceholder: "\u30A6\u30A9\u30EC\u30C3\u30C8\u30A2\u30C9\u30EC\u30B9\u3092\u5165\u529B",
5336
+ recipientAddressPlaceholderXrpl: "\u30A2\u30C9\u30EC\u30B9\u3001\u307E\u305F\u306F \u30A2\u30C9\u30EC\u30B9:\u30BF\u30B0 \u3092\u5165\u529B",
5263
5337
  amount: "\u91D1\u984D",
5264
5338
  amountPlaceholder: "0.00",
5265
5339
  balance: "\u6B8B\u9AD8",
5266
5340
  minimum: "\u6700\u4F4E",
5267
5341
  withdraw: "\u51FA\u91D1",
5268
5342
  invalidAddress: "\u6709\u52B9\u306A\u30A2\u30C9\u30EC\u30B9\u3092\u5165\u529B\u3057\u3066\u304F\u3060\u3055\u3044",
5343
+ invalidXrplAddress: "\u6709\u52B9\u306A{{chain_name}}\u30A2\u30C9\u30EC\u30B9\u3092\u5165\u529B\u3057\u3066\u304F\u3060\u3055\u3044\u3002\u53D7\u53D6\u5148\u3067\u5B9B\u5148\u30BF\u30B0\u304C\u5FC5\u8981\u306A\u5834\u5408\u306F\u3001\u300C\u30A2\u30C9\u30EC\u30B9:\u30BF\u30B0\u300D\u306E\u5F62\u5F0F\u3067\u5165\u529B\u3057\u3066\u304F\u3060\u3055\u3044",
5344
+ memoTag: "\u5B9B\u5148\u30BF\u30B0",
5345
+ memoTagPlaceholder: "\u4F8B: 12345",
5346
+ memoTagRequiredHint: "\u3053\u306E{{chain_name}}\u30A2\u30C9\u30EC\u30B9\u306F\u3001\u8CC7\u91D1\u3092\u53D7\u3051\u53D6\u308B\u305F\u3081\u306B\u5B9B\u5148\u30BF\u30B0\u304C\u5FC5\u8981\u3067\u3059",
5347
+ invalidMemoTag: "\u5B9B\u5148\u30BF\u30B0\u306F 0\u301C4294967295 \u306E\u6574\u6570\u3067\u5165\u529B\u3057\u3066\u304F\u3060\u3055\u3044",
5269
5348
  invalidAmount: "\u6709\u52B9\u306A\u91D1\u984D\u3092\u5165\u529B\u3057\u3066\u304F\u3060\u3055\u3044",
5270
5349
  verifyingAddress: "\u30A2\u30C9\u30EC\u30B9\u3092\u78BA\u8A8D\u3057\u3066\u3044\u307E\u3059...",
5271
5350
  loading: "\u8AAD\u307F\u8FBC\u307F\u4E2D...",
@@ -5315,6 +5394,9 @@ var ko_default = {
5315
5394
  loading: "\uB85C\uB529 \uC911...",
5316
5395
  search: "\uAC80\uC0C9",
5317
5396
  close: "\uB2EB\uAE30",
5397
+ noResults: "\uC77C\uCE58\uD558\uB294 \uD56D\uBAA9\uC774 \uC5C6\uC2B5\uB2C8\uB2E4",
5398
+ selectCountry: "\uAD6D\uAC00 \uC120\uD0DD",
5399
+ selectState: "\uC8FC \uC120\uD0DD",
5318
5400
  review: "\uD655\uC778",
5319
5401
  tryAgain: "\uB2E4\uC2DC \uC2DC\uB3C4",
5320
5402
  somethingWentWrong: "\uBB38\uC81C\uAC00 \uBC1C\uC0DD\uD588\uC2B5\uB2C8\uB2E4",
@@ -5537,6 +5619,7 @@ var ko_default = {
5537
5619
  not_opted_in: "\uC790\uAE08\uC744 \uBC1B\uAE30 \uC804\uC5D0 {{chain_name}}\uC5D0\uC11C {{token_symbol}}\uC744(\uB97C) \uC635\uD2B8\uC778\uD558\uC138\uC694",
5538
5620
  insufficient_balance: "\uBC1B\uB294 \uACC4\uC815\uC774 \uCD5C\uC18C \uC794\uC561 \uC694\uAC74\uC744 \uCDA9\uC871\uD558\uC9C0 \uC54A\uC2B5\uB2C8\uB2E4",
5539
5621
  account_not_found: "{{chain_name}}\uC5D0 \uBC1B\uB294 \uACC4\uC815\uC774 \uC5C6\uC2B5\uB2C8\uB2E4",
5622
+ destination_tag_required: "\uC774 {{chain_name}} \uC8FC\uC18C\uC5D0\uB294 \uB370\uC2A4\uD2F0\uB124\uC774\uC158 \uD0DC\uADF8\uAC00 \uD544\uC694\uD569\uB2C8\uB2E4. \uD0DC\uADF8\uB3C4 \uD568\uAED8 \uC8FC\uC18C:\uD0DC\uADF8 \uD615\uC2DD\uC73C\uB85C \uC785\uB825\uD558\uC138\uC694",
5540
5623
  validation_error: "{{chain_name}}\uC5D0\uC11C \uBC1B\uB294 \uC8FC\uC18C\uB97C \uD655\uC778\uD560 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4"
5541
5624
  },
5542
5625
  defaultError: "\uC120\uD0DD\uD55C \uD1A0\uD070\uC73C\uB85C\uB294 \uC774 \uBC1B\uB294 \uC8FC\uC18C\uC5D0 \uC790\uAE08\uC744 \uBCF4\uB0BC \uC218 \uC5C6\uC2B5\uB2C8\uB2E4"
@@ -6115,12 +6198,18 @@ var ko_default = {
6115
6198
  receiveChain: "\uBC1B\uC744 \uCCB4\uC778",
6116
6199
  recipientAddress: "\uBC1B\uB294 \uC8FC\uC18C",
6117
6200
  recipientAddressPlaceholder: "\uC9C0\uAC11 \uC8FC\uC18C\uB97C \uC785\uB825\uD558\uC138\uC694",
6201
+ recipientAddressPlaceholderXrpl: "\uC8FC\uC18C \uB610\uB294 \uC8FC\uC18C:\uD0DC\uADF8 \uB97C \uC785\uB825\uD558\uC138\uC694",
6118
6202
  amount: "\uAE08\uC561",
6119
6203
  amountPlaceholder: "0.00",
6120
6204
  balance: "\uC794\uC561",
6121
6205
  minimum: "\uCD5C\uC18C",
6122
6206
  withdraw: "\uCD9C\uAE08",
6123
6207
  invalidAddress: "\uC720\uD6A8\uD55C \uC8FC\uC18C\uB97C \uC785\uB825\uD574 \uC8FC\uC138\uC694",
6208
+ invalidXrplAddress: "\uC720\uD6A8\uD55C {{chain_name}} \uC8FC\uC18C\uB97C \uC785\uB825\uD574 \uC8FC\uC138\uC694. \uC218\uCDE8\uC778\uC774 \uB370\uC2A4\uD2F0\uB124\uC774\uC158 \uD0DC\uADF8\uB97C \uC694\uAD6C\uD558\uB294 \uACBD\uC6B0 \uC8FC\uC18C:\uD0DC\uADF8 \uD615\uC2DD\uC73C\uB85C \uD568\uAED8 \uC785\uB825\uD558\uC138\uC694",
6209
+ memoTag: "\uB370\uC2A4\uD2F0\uB124\uC774\uC158 \uD0DC\uADF8",
6210
+ memoTagPlaceholder: "\uC608: 12345",
6211
+ memoTagRequiredHint: "\uC774 {{chain_name}} \uC8FC\uC18C\uB294 \uC790\uAE08\uC744 \uBC1B\uAE30 \uC704\uD574 \uB370\uC2A4\uD2F0\uB124\uC774\uC158 \uD0DC\uADF8\uAC00 \uD544\uC694\uD569\uB2C8\uB2E4",
6212
+ invalidMemoTag: "\uB370\uC2A4\uD2F0\uB124\uC774\uC158 \uD0DC\uADF8\uB294 0\uC5D0\uC11C 4294967295 \uC0AC\uC774\uC758 \uC815\uC218\uC5EC\uC57C \uD569\uB2C8\uB2E4",
6124
6213
  invalidAmount: "\uC720\uD6A8\uD55C \uAE08\uC561\uC744 \uC785\uB825\uD574 \uC8FC\uC138\uC694",
6125
6214
  verifyingAddress: "\uC8FC\uC18C\uB97C \uD655\uC778\uD558\uB294 \uC911...",
6126
6215
  loading: "\uB85C\uB529 \uC911...",
@@ -9110,6 +9199,19 @@ function DepositPollingToasts({
9110
9199
  );
9111
9200
  }
9112
9201
 
9202
+ // src/components/deposits/card-onramp-session.ts
9203
+ var initialCardOnrampSessionState = {
9204
+ active: null,
9205
+ started: false
9206
+ };
9207
+ function startCardOnrampSession(session) {
9208
+ return { active: session, started: true };
9209
+ }
9210
+ function cardOnrampSessionForView(state, view) {
9211
+ if (view === "review" || state.active === null) return state;
9212
+ return { active: null, started: state.started };
9213
+ }
9214
+
9113
9215
  // src/components/deposits/BuyWithCard.tsx
9114
9216
  var import_jsx_runtime17 = require("react/jsx-runtime");
9115
9217
  function formatFiatAmount(value, symbol) {
@@ -9190,10 +9292,13 @@ function BuyWithCard({
9190
9292
  const [defaultToken, setDefaultToken] = (0, import_react9.useState)(null);
9191
9293
  const [defaultTokenLoading, setDefaultTokenLoading] = (0, import_react9.useState)(false);
9192
9294
  const { userIpInfo, isLoading: isLoadingIp } = useUserIp();
9193
- const [onrampSession, setOnrampSession] = (0, import_react9.useState)(null);
9295
+ const [onrampSession, setOnrampSession] = (0, import_react9.useState)(initialCardOnrampSessionState);
9194
9296
  const currentView = externalView ?? internalView;
9195
9297
  const showQuotesView = currentView === "quotes";
9196
9298
  const showReviewView = currentView === "review";
9299
+ (0, import_react9.useEffect)(() => {
9300
+ setOnrampSession((prev) => cardOnrampSessionForView(prev, currentView));
9301
+ }, [currentView]);
9197
9302
  (0, import_react9.useEffect)(() => {
9198
9303
  if (externalView) {
9199
9304
  setInternalView(externalView);
@@ -9345,7 +9450,7 @@ function BuyWithCard({
9345
9450
  const { executions, isPolling } = useDepositPolling({
9346
9451
  userId,
9347
9452
  publishableKey,
9348
- enabled: !!onrampSession,
9453
+ enabled: onrampSession.started,
9349
9454
  depositWalletId,
9350
9455
  onDepositSuccess,
9351
9456
  onDepositError
@@ -9638,13 +9743,15 @@ function BuyWithCard({
9638
9743
  ...isDestinationMode ? { destination_amount: destinationAmount } : { source_amount: amount }
9639
9744
  };
9640
9745
  const sessionStartUrl = (0, import_core11.getOnrampSessionStartUrl)(sessionRequest, publishableKey);
9641
- setOnrampSession({
9642
- provider: selectedProvider,
9643
- sourceCurrency: currency,
9644
- sourceAmount: amount,
9645
- sessionUrl: sessionStartUrl,
9646
- externalId
9647
- });
9746
+ setOnrampSession(
9747
+ startCardOnrampSession({
9748
+ provider: selectedProvider,
9749
+ sourceCurrency: currency,
9750
+ sourceAmount: amount,
9751
+ sessionUrl: sessionStartUrl,
9752
+ externalId
9753
+ })
9754
+ );
9648
9755
  track("flow_started", {
9649
9756
  method: "card",
9650
9757
  flow_type: "deposit",
@@ -10100,8 +10207,8 @@ function BuyWithCard({
10100
10207
  onToggleDetails: () => setShowReviewDetails((prev) => !prev),
10101
10208
  onContinue: handleStartOnramp,
10102
10209
  continueLabel: strings.common.confirm,
10103
- continueDisabled: !selectedProvider || !!onrampSession,
10104
- checking: !!onrampSession,
10210
+ continueDisabled: !selectedProvider || !!onrampSession.active,
10211
+ checking: !!onrampSession.active,
10105
10212
  disclaimer: strings.common.intentAddressDisclaimer
10106
10213
  }
10107
10214
  )
@@ -19089,6 +19196,11 @@ function useStripeOnramp(stripePublishableKey, isDark = false) {
19089
19196
  return { coordinator, isLoading, error, initialize };
19090
19197
  }
19091
19198
 
19199
+ // src/components/deposits/stripe-link/normalize-kyc-address.ts
19200
+ function normalizeStripeStateCode(raw) {
19201
+ return raw.replace(/[^a-zA-Z]/g, "").slice(0, 2).toUpperCase();
19202
+ }
19203
+
19092
19204
  // src/components/deposits/stripe-link/stripe-session-storage.ts
19093
19205
  var STORAGE_PREFIX = "unifold:stripe-link:session";
19094
19206
  function storageKey(externalUserId) {
@@ -20159,7 +20271,7 @@ function PayWithStripeLink({
20159
20271
  setKycFormMode("name");
20160
20272
  return;
20161
20273
  }
20162
- if (!kycForm.addressLine1.trim() || !kycForm.addressCity.trim() || !kycForm.addressState.trim() || !kycForm.addressPostalCode.trim()) {
20274
+ if (!kycForm.addressLine1.trim() || !kycForm.addressCity.trim() || normalizeStripeStateCode(kycForm.addressState).length !== 2 || !kycForm.addressPostalCode.trim()) {
20163
20275
  setError(t.formErrors.enterFullAddress);
20164
20276
  return;
20165
20277
  }
@@ -20170,7 +20282,8 @@ function PayWithStripeLink({
20170
20282
  line1: kycForm.addressLine1,
20171
20283
  ...kycForm.addressLine2.trim() && { line2: kycForm.addressLine2 },
20172
20284
  city: kycForm.addressCity,
20173
- state: kycForm.addressState,
20285
+ // Stripe requires a 2-letter uppercase code for US/CA (`TX`, not `Tx`).
20286
+ state: normalizeStripeStateCode(kycForm.addressState),
20174
20287
  postal_code: kycForm.addressPostalCode,
20175
20288
  country: kycForm.addressCountry
20176
20289
  }
@@ -21434,9 +21547,14 @@ function PayWithStripeLink({
21434
21547
  ...NO_AUTOFILL,
21435
21548
  type: "text",
21436
21549
  value: kycForm.addressState,
21437
- onChange: (e) => setKycForm((f) => ({ ...f, addressState: e.target.value })),
21550
+ onChange: (e) => setKycForm((f) => ({
21551
+ ...f,
21552
+ addressState: normalizeStripeStateCode(e.target.value)
21553
+ })),
21438
21554
  placeholder: "CA",
21439
21555
  maxLength: 2,
21556
+ autoCapitalize: "characters",
21557
+ spellCheck: false,
21440
21558
  className: "uf-w-full uf-py-2.5 uf-px-3 uf-bg-transparent uf-outline-none uf-text-sm",
21441
21559
  style: inputStyle
21442
21560
  }
@@ -21542,7 +21660,7 @@ function PayWithStripeLink({
21542
21660
  DepositFooterButton,
21543
21661
  {
21544
21662
  onClick: kycFormMode === "name" ? handleNameNext : handleKycSubmit,
21545
- disabled: loading || (kycFormMode === "name" ? !kycForm.givenName || !kycForm.surname : kycFormMode === "address" ? !kycForm.addressLine1 || !kycForm.addressCity || !kycForm.addressState || !kycForm.addressPostalCode : !kycForm.ssn || !kycForm.dob.day || !kycForm.dob.month || !kycForm.dob.year),
21663
+ disabled: loading || (kycFormMode === "name" ? !kycForm.givenName || !kycForm.surname : kycFormMode === "address" ? !kycForm.addressLine1 || !kycForm.addressCity || kycForm.addressState.length !== 2 || !kycForm.addressPostalCode : !kycForm.ssn || !kycForm.dob.day || !kycForm.dob.month || !kycForm.dob.year),
21546
21664
  loading,
21547
21665
  className: "uf-flex-1",
21548
21666
  children: loading ? t.submitting : strings.common.review
@@ -35545,6 +35663,32 @@ async function detectBrowserWallet(chainType, senderAddress) {
35545
35663
  return null;
35546
35664
  }
35547
35665
 
35666
+ // src/lib/xrpl-address.ts
35667
+ var XRPL_BASE58 = "rpshnaf39wBUDNEGHJKLM4PQRST7VWXYZ2bcdeCg65jkm8oFqi1tuvAxyz";
35668
+ var CLASSIC_ADDRESS = new RegExp(`^r[${XRPL_BASE58}]{24,34}$`);
35669
+ var X_ADDRESS = new RegExp(`^[XT][${XRPL_BASE58}]{40,50}$`);
35670
+ var MAX_DESTINATION_TAG = 4294967295;
35671
+ function isXrplRecipientShapeValid(input) {
35672
+ const trimmed = input.trim();
35673
+ if (trimmed.length === 0) {
35674
+ return false;
35675
+ }
35676
+ const separatorIndex = trimmed.indexOf(":");
35677
+ if (separatorIndex === -1) {
35678
+ return CLASSIC_ADDRESS.test(trimmed) || X_ADDRESS.test(trimmed);
35679
+ }
35680
+ const address = trimmed.slice(0, separatorIndex);
35681
+ const tag = trimmed.slice(separatorIndex + 1);
35682
+ return isDestinationTagValid(tag) && (CLASSIC_ADDRESS.test(address) || X_ADDRESS.test(address));
35683
+ }
35684
+ function isDestinationTagValid(tag) {
35685
+ if (!/^\d+$/.test(tag)) {
35686
+ return false;
35687
+ }
35688
+ const parsed = Number(tag);
35689
+ return parsed <= MAX_DESTINATION_TAG;
35690
+ }
35691
+
35548
35692
  // src/hooks/use-hypercore-withdraw-activation.ts
35549
35693
  var import_react36 = require("react");
35550
35694
  var import_core56 = require("@unifold/core");
@@ -35719,6 +35863,8 @@ function WithdrawForm({
35719
35863
  const t = strings.withdrawModal;
35720
35864
  const tCrypto = strings.transferCrypto;
35721
35865
  const [recipientAddress, setRecipientAddress] = (0, import_react37.useState)(recipientAddressProp || "");
35866
+ const [memoTag, setMemoTag] = (0, import_react37.useState)("");
35867
+ const [memoTagRequiredFor, setMemoTagRequiredFor] = (0, import_react37.useState)(null);
35722
35868
  const [amount, setAmount] = (0, import_react37.useState)("");
35723
35869
  const [inputUnit, setInputUnit] = (0, import_react37.useState)("fiat");
35724
35870
  const [isSubmitting, setIsSubmitting] = (0, import_react37.useState)(false);
@@ -35737,7 +35883,16 @@ function WithdrawForm({
35737
35883
  setIsMaxed(false);
35738
35884
  }, [balanceData?.balanceBaseUnit]);
35739
35885
  const trimmedAddress = recipientAddress.trim();
35740
- const debouncedAddress = useDebounce(trimmedAddress, 500);
35886
+ const trimmedMemoTag = memoTag.trim();
35887
+ const isMemoTagValid = isDestinationTagValid(trimmedMemoTag);
35888
+ const destinationKey = `${selectedChain?.chain_type ?? ""}:${selectedChain?.chain_id ?? ""}:${selectedChain?.token_address ?? ""}`;
35889
+ const recipientKey = `${destinationKey}:${trimmedAddress}`;
35890
+ const memoTagRequired = trimmedAddress.length > 0 && memoTagRequiredFor === recipientKey;
35891
+ const effectiveRecipient = memoTagRequired && isMemoTagValid ? `${trimmedAddress}:${trimmedMemoTag}` : trimmedAddress;
35892
+ const debouncedRecipient = useDebounce(effectiveRecipient, 500);
35893
+ const isXrplDestination = selectedChain?.chain_type === "xrpl";
35894
+ const isXrplRecipientMalformed = isXrplDestination && trimmedAddress.length > 5 && !isXrplRecipientShapeValid(effectiveRecipient);
35895
+ const canVerifyXrplRecipient = !isXrplDestination || isXrplRecipientShapeValid(debouncedRecipient);
35741
35896
  const {
35742
35897
  data: addressVerification,
35743
35898
  isLoading: isVerifyingAddress,
@@ -35746,16 +35901,36 @@ function WithdrawForm({
35746
35901
  chainType: selectedChain?.chain_type,
35747
35902
  chainId: selectedChain?.chain_id,
35748
35903
  tokenAddress: selectedChain?.token_address,
35749
- recipientAddress: debouncedAddress,
35904
+ recipientAddress: debouncedRecipient,
35750
35905
  publishableKey,
35751
- enabled: debouncedAddress.length > 5 && !!selectedChain
35906
+ enabled: debouncedRecipient.length > 5 && !!selectedChain && canVerifyXrplRecipient
35752
35907
  });
35753
- const isDebouncing = trimmedAddress !== debouncedAddress;
35908
+ const isDebouncing = effectiveRecipient !== debouncedRecipient;
35909
+ const verifiedRecipientKey = `${destinationKey}:${debouncedRecipient}`;
35910
+ (0, import_react37.useEffect)(() => {
35911
+ if (addressVerification?.failure_code === "destination_tag_required") {
35912
+ setMemoTagRequiredFor(verifiedRecipientKey);
35913
+ }
35914
+ }, [addressVerification, verifiedRecipientKey]);
35915
+ (0, import_react37.useEffect)(() => {
35916
+ setMemoTag("");
35917
+ }, [recipientKey]);
35918
+ const xrplFormatHint = (0, import_react37.useMemo)(
35919
+ () => interpolate(t.invalidXrplAddress, {
35920
+ chain_name: selectedChain?.chain_name ?? "XRP Ledger"
35921
+ }),
35922
+ [t, selectedChain]
35923
+ );
35754
35924
  const addressError = (0, import_react37.useMemo)(() => {
35755
35925
  if (!trimmedAddress || trimmedAddress.length <= 5) return null;
35926
+ if (isXrplRecipientMalformed) return xrplFormatHint;
35756
35927
  if (isDebouncing || isVerifyingAddress) return null;
35757
- if (verifyError) return t.invalidAddress;
35928
+ if (verifyError) return isXrplDestination ? xrplFormatHint : t.invalidAddress;
35758
35929
  if (addressVerification && !addressVerification.valid) {
35930
+ if (addressVerification.failure_code === "destination_tag_required")
35931
+ return memoTagRequired ? null : interpolate(tCrypto.addressValidation.errors.destination_tag_required, {
35932
+ chain_name: selectedChain?.chain_name ?? ""
35933
+ });
35759
35934
  if (addressVerification.message && addressVerification.message.trim().length > 0) {
35760
35935
  return addressVerification.message;
35761
35936
  }
@@ -35768,13 +35943,17 @@ function WithdrawForm({
35768
35943
  token_symbol: selectedToken?.symbol ?? "",
35769
35944
  chain_name: selectedChain?.chain_name ?? ""
35770
35945
  });
35771
- return t.invalidAddress;
35946
+ return isXrplDestination ? xrplFormatHint : t.invalidAddress;
35772
35947
  }
35773
35948
  return null;
35774
35949
  }, [
35775
35950
  trimmedAddress,
35776
35951
  isDebouncing,
35777
35952
  isVerifyingAddress,
35953
+ isXrplDestination,
35954
+ isXrplRecipientMalformed,
35955
+ memoTagRequired,
35956
+ xrplFormatHint,
35778
35957
  verifyError,
35779
35958
  addressVerification,
35780
35959
  selectedChain,
@@ -35782,6 +35961,7 @@ function WithdrawForm({
35782
35961
  t,
35783
35962
  tCrypto
35784
35963
  ]);
35964
+ const memoTagError = memoTagRequired && trimmedMemoTag.length > 0 && !isMemoTagValid ? t.invalidMemoTag : null;
35785
35965
  const isAddressValid = !isDebouncing && !!addressVerification?.valid && !addressError;
35786
35966
  const { showWarning: showActivationWarning, activationFee: effectiveActivationFee } = useHypercoreWithdrawActivation({
35787
35967
  userId: externalUserId,
@@ -35789,7 +35969,7 @@ function WithdrawForm({
35789
35969
  senderAddress,
35790
35970
  sourceChainId,
35791
35971
  sourceChainType,
35792
- recipientAddress: debouncedAddress,
35972
+ recipientAddress: debouncedRecipient,
35793
35973
  destinationChainType: selectedChain?.chain_type,
35794
35974
  destinationChainId: selectedChain?.chain_id,
35795
35975
  destinationTokenAddress: selectedChain?.token_address,
@@ -35903,7 +36083,7 @@ function WithdrawForm({
35903
36083
  const isBalanceBelowMinimum = !isLoadingBalance && minimumWithdrawAmountUsd !== null && Math.round(balanceUsdNum * 100) / 100 < minimumWithdrawAmountUsd;
35904
36084
  const isBelowMinimum = minimumWithdrawAmountUsd !== null && fiatAmountFromInput > 0 && Math.round(fiatAmountFromInput * 100) / 100 < minimumWithdrawAmountUsd;
35905
36085
  const isOverBalance = inputUnit === "crypto" ? cryptoAmountFromInput > 0 && balanceCrypto > 0 && cryptoAmountFromInput > balanceCrypto : fiatAmountFromInput > 0 && balanceUsdNum > 0 && Math.round(fiatAmountFromInput * 100) / 100 > Math.round(balanceUsdNum * 100) / 100;
35906
- const isFormValid = trimmedAddress.length > 0 && amount.trim().length > 0 && cryptoAmountFromInput > 0 && isAddressValid && !isBelowMinimum && !isOverBalance && !isBalanceBelowMinimum && !!balanceData;
36086
+ const isFormValid = trimmedAddress.length > 0 && amount.trim().length > 0 && cryptoAmountFromInput > 0 && isAddressValid && !(memoTagRequired && !isMemoTagValid) && !isBelowMinimum && !isOverBalance && !isBalanceBelowMinimum && !!balanceData;
35907
36087
  const handleWithdraw = (0, import_react37.useCallback)(async () => {
35908
36088
  if (!selectedToken || !selectedChain) return;
35909
36089
  if (!isFormValid) return;
@@ -35917,7 +36097,7 @@ function WithdrawForm({
35917
36097
  destinationChainType: selectedChain.chain_type,
35918
36098
  destinationChainId: selectedChain.chain_id,
35919
36099
  destinationTokenAddress: selectedChain.token_address,
35920
- recipientAddress: trimmedAddress
36100
+ recipientAddress: effectiveRecipient
35921
36101
  });
35922
36102
  let amountBaseUnit = isMaxed ? balanceData.balanceBaseUnit : computeBaseUnit(
35923
36103
  balanceData.balanceBaseUnit,
@@ -35966,7 +36146,7 @@ function WithdrawForm({
35966
36146
  amount: humanAmount,
35967
36147
  amountBaseUnit,
35968
36148
  withdrawIntentAddress: depositWallet.address,
35969
- recipientAddress: trimmedAddress
36149
+ recipientAddress: effectiveRecipient
35970
36150
  };
35971
36151
  const usdValue = isMaxed ? balanceUsdNum : fiatAmountFromInput;
35972
36152
  onWithdrawStarted?.({
@@ -36003,7 +36183,7 @@ function WithdrawForm({
36003
36183
  isFormValid,
36004
36184
  cryptoAmountFromInput,
36005
36185
  sourceDecimals,
36006
- trimmedAddress,
36186
+ effectiveRecipient,
36007
36187
  publishableKey,
36008
36188
  onWithdraw,
36009
36189
  sourceChainType,
@@ -36054,7 +36234,7 @@ function WithdrawForm({
36054
36234
  "input",
36055
36235
  {
36056
36236
  type: "text",
36057
- placeholder: t.recipientAddressPlaceholder,
36237
+ placeholder: isXrplDestination ? t.recipientAddressPlaceholderXrpl : t.recipientAddressPlaceholder,
36058
36238
  value: recipientAddress,
36059
36239
  onChange: (e) => {
36060
36240
  setRecipientAddress(e.target.value);
@@ -36090,7 +36270,7 @@ function WithdrawForm({
36090
36270
  ]
36091
36271
  }
36092
36272
  ),
36093
- (isDebouncing || isVerifyingAddress) && trimmedAddress.length > 5 && /* @__PURE__ */ (0, import_jsx_runtime79.jsxs)("div", { className: "uf-flex uf-items-center uf-gap-1.5 uf-mt-1.5", children: [
36273
+ (isDebouncing || isVerifyingAddress) && trimmedAddress.length > 5 && !addressError && /* @__PURE__ */ (0, import_jsx_runtime79.jsxs)("div", { className: "uf-flex uf-items-center uf-gap-1.5 uf-mt-1.5", children: [
36094
36274
  /* @__PURE__ */ (0, import_jsx_runtime79.jsx)(
36095
36275
  import_lucide_react46.Loader2,
36096
36276
  {
@@ -36112,6 +36292,61 @@ function WithdrawForm({
36112
36292
  /* @__PURE__ */ (0, import_jsx_runtime79.jsx)("span", { className: "uf-text-xs", style: { color: colors2.error, fontFamily: fonts.regular }, children: addressError })
36113
36293
  ] })
36114
36294
  ] }),
36295
+ memoTagRequired && /* @__PURE__ */ (0, import_jsx_runtime79.jsxs)("div", { children: [
36296
+ /* @__PURE__ */ (0, import_jsx_runtime79.jsx)(
36297
+ "div",
36298
+ {
36299
+ className: "uf-text-xs uf-mb-1.5",
36300
+ style: { color: components.card.labelColor, fontFamily: fonts.medium },
36301
+ children: t.memoTag
36302
+ }
36303
+ ),
36304
+ /* @__PURE__ */ (0, import_jsx_runtime79.jsx)(
36305
+ "style",
36306
+ {
36307
+ dangerouslySetInnerHTML: {
36308
+ __html: `.uf-withdraw-memo::placeholder { color: ${components.search.placeholderColor}; }`
36309
+ }
36310
+ }
36311
+ ),
36312
+ /* @__PURE__ */ (0, import_jsx_runtime79.jsx)(
36313
+ "input",
36314
+ {
36315
+ type: "text",
36316
+ inputMode: "numeric",
36317
+ placeholder: t.memoTagPlaceholder,
36318
+ value: memoTag,
36319
+ onChange: (e) => {
36320
+ setMemoTag(e.target.value);
36321
+ setSubmitError(null);
36322
+ },
36323
+ className: "uf-withdraw-memo uf-w-full uf-px-3 uf-py-2.5 uf-text-sm uf-outline-none",
36324
+ style: {
36325
+ backgroundColor: components.search.backgroundColor,
36326
+ borderRadius: components.input.borderRadius,
36327
+ border: `${components.input.borderWidth}px solid ${memoTagError ? colors2.error : components.input.borderColor}`,
36328
+ color: components.search.inputColor,
36329
+ fontFamily: fonts.regular
36330
+ }
36331
+ }
36332
+ ),
36333
+ /* @__PURE__ */ (0, import_jsx_runtime79.jsxs)("div", { className: "uf-flex uf-items-center uf-gap-1.5 uf-mt-1.5", children: [
36334
+ memoTagError && /* @__PURE__ */ (0, import_jsx_runtime79.jsx)(import_lucide_react46.AlertTriangle, { className: "uf-w-3 uf-h-3", style: { color: colors2.error } }),
36335
+ /* @__PURE__ */ (0, import_jsx_runtime79.jsx)(
36336
+ "span",
36337
+ {
36338
+ className: "uf-text-xs",
36339
+ style: {
36340
+ color: memoTagError ? colors2.error : colors2.foregroundMuted,
36341
+ fontFamily: fonts.regular
36342
+ },
36343
+ children: memoTagError ?? interpolate(t.memoTagRequiredHint, {
36344
+ chain_name: selectedChain?.chain_name ?? "XRP Ledger"
36345
+ })
36346
+ }
36347
+ )
36348
+ ] })
36349
+ ] }),
36115
36350
  /* @__PURE__ */ (0, import_jsx_runtime79.jsxs)("div", { children: [
36116
36351
  /* @__PURE__ */ (0, import_jsx_runtime79.jsxs)(
36117
36352
  "div",
@@ -37424,8 +37659,1063 @@ function WithdrawTokenSelector({ tokens, onSelect, onBack }) {
37424
37659
  ) })
37425
37660
  ] });
37426
37661
  }
37662
+
37663
+ // src/lib/countries/countries.ts
37664
+ var COUNTRIES = [
37665
+ { alpha2: "AD", name: "Andorra", dialCode: "376" },
37666
+ { alpha2: "AE", name: "United Arab Emirates", dialCode: "971" },
37667
+ { alpha2: "AF", name: "Afghanistan", dialCode: "93" },
37668
+ { alpha2: "AG", name: "Antigua and Barbuda", dialCode: "1" },
37669
+ { alpha2: "AI", name: "Anguilla", dialCode: "1" },
37670
+ { alpha2: "AL", name: "Albania", dialCode: "355" },
37671
+ { alpha2: "AM", name: "Armenia", dialCode: "374" },
37672
+ { alpha2: "AO", name: "Angola", dialCode: "244" },
37673
+ { alpha2: "AQ", name: "Antarctica" },
37674
+ { alpha2: "AR", name: "Argentina", dialCode: "54" },
37675
+ { alpha2: "AS", name: "American Samoa", dialCode: "1" },
37676
+ { alpha2: "AT", name: "Austria", dialCode: "43" },
37677
+ { alpha2: "AU", name: "Australia", dialCode: "61" },
37678
+ { alpha2: "AW", name: "Aruba", dialCode: "297" },
37679
+ { alpha2: "AX", name: "\xC5land Islands", dialCode: "358" },
37680
+ { alpha2: "AZ", name: "Azerbaijan", dialCode: "994" },
37681
+ { alpha2: "BA", name: "Bosnia and Herzegovina", dialCode: "387" },
37682
+ { alpha2: "BB", name: "Barbados", dialCode: "1" },
37683
+ { alpha2: "BD", name: "Bangladesh", dialCode: "880" },
37684
+ { alpha2: "BE", name: "Belgium", dialCode: "32" },
37685
+ { alpha2: "BF", name: "Burkina Faso", dialCode: "226" },
37686
+ { alpha2: "BG", name: "Bulgaria", dialCode: "359" },
37687
+ { alpha2: "BH", name: "Bahrain", dialCode: "973" },
37688
+ { alpha2: "BI", name: "Burundi", dialCode: "257" },
37689
+ { alpha2: "BJ", name: "Benin", dialCode: "229" },
37690
+ { alpha2: "BL", name: "Saint Barth\xE9lemy", dialCode: "590" },
37691
+ { alpha2: "BM", name: "Bermuda", dialCode: "1" },
37692
+ { alpha2: "BN", name: "Brunei", dialCode: "673" },
37693
+ { alpha2: "BO", name: "Bolivia", dialCode: "591" },
37694
+ { alpha2: "BQ", name: "Bonaire, Sint Eustatius and Saba", dialCode: "599" },
37695
+ { alpha2: "BR", name: "Brazil", dialCode: "55" },
37696
+ { alpha2: "BS", name: "Bahamas", dialCode: "1" },
37697
+ { alpha2: "BT", name: "Bhutan", dialCode: "975" },
37698
+ { alpha2: "BV", name: "Bouvet Island" },
37699
+ { alpha2: "BW", name: "Botswana", dialCode: "267" },
37700
+ { alpha2: "BY", name: "Belarus", dialCode: "375" },
37701
+ { alpha2: "BZ", name: "Belize", dialCode: "501" },
37702
+ { alpha2: "CA", name: "Canada", dialCode: "1" },
37703
+ { alpha2: "CC", name: "Cocos (Keeling) Islands", dialCode: "61" },
37704
+ { alpha2: "CD", name: "Congo (Democratic Republic)", dialCode: "243" },
37705
+ { alpha2: "CF", name: "Central African Republic", dialCode: "236" },
37706
+ { alpha2: "CG", name: "Congo (Republic)", dialCode: "242" },
37707
+ { alpha2: "CH", name: "Switzerland", dialCode: "41" },
37708
+ { alpha2: "CI", name: "C\xF4te d'Ivoire", dialCode: "225" },
37709
+ { alpha2: "CK", name: "Cook Islands", dialCode: "682" },
37710
+ { alpha2: "CL", name: "Chile", dialCode: "56" },
37711
+ { alpha2: "CM", name: "Cameroon", dialCode: "237" },
37712
+ { alpha2: "CN", name: "China", dialCode: "86" },
37713
+ { alpha2: "CO", name: "Colombia", dialCode: "57" },
37714
+ { alpha2: "CR", name: "Costa Rica", dialCode: "506" },
37715
+ { alpha2: "CU", name: "Cuba", dialCode: "53" },
37716
+ { alpha2: "CV", name: "Cabo Verde", dialCode: "238" },
37717
+ { alpha2: "CW", name: "Cura\xE7ao", dialCode: "599" },
37718
+ { alpha2: "CX", name: "Christmas Island", dialCode: "61" },
37719
+ { alpha2: "CY", name: "Cyprus", dialCode: "357" },
37720
+ { alpha2: "CZ", name: "Czech Republic", dialCode: "420" },
37721
+ { alpha2: "DE", name: "Germany", dialCode: "49" },
37722
+ { alpha2: "DJ", name: "Djibouti", dialCode: "253" },
37723
+ { alpha2: "DK", name: "Denmark", dialCode: "45" },
37724
+ { alpha2: "DM", name: "Dominica", dialCode: "1" },
37725
+ { alpha2: "DO", name: "Dominican Republic", dialCode: "1" },
37726
+ { alpha2: "DZ", name: "Algeria", dialCode: "213" },
37727
+ { alpha2: "EC", name: "Ecuador", dialCode: "593" },
37728
+ { alpha2: "EE", name: "Estonia", dialCode: "372" },
37729
+ { alpha2: "EG", name: "Egypt", dialCode: "20" },
37730
+ { alpha2: "EH", name: "Western Sahara", dialCode: "212" },
37731
+ { alpha2: "ER", name: "Eritrea", dialCode: "291" },
37732
+ { alpha2: "ES", name: "Spain", dialCode: "34" },
37733
+ { alpha2: "ET", name: "Ethiopia", dialCode: "251" },
37734
+ { alpha2: "FI", name: "Finland", dialCode: "358" },
37735
+ { alpha2: "FJ", name: "Fiji", dialCode: "679" },
37736
+ { alpha2: "FK", name: "Falkland Islands", dialCode: "500" },
37737
+ { alpha2: "FM", name: "Micronesia", dialCode: "691" },
37738
+ { alpha2: "FO", name: "Faroe Islands", dialCode: "298" },
37739
+ { alpha2: "FR", name: "France", dialCode: "33" },
37740
+ { alpha2: "GA", name: "Gabon", dialCode: "241" },
37741
+ { alpha2: "GB", name: "United Kingdom", dialCode: "44" },
37742
+ { alpha2: "GD", name: "Grenada", dialCode: "1" },
37743
+ { alpha2: "GE", name: "Georgia", dialCode: "995" },
37744
+ { alpha2: "GF", name: "French Guiana", dialCode: "594" },
37745
+ { alpha2: "GG", name: "Guernsey", dialCode: "44" },
37746
+ { alpha2: "GH", name: "Ghana", dialCode: "233" },
37747
+ { alpha2: "GI", name: "Gibraltar", dialCode: "350" },
37748
+ { alpha2: "GL", name: "Greenland", dialCode: "299" },
37749
+ { alpha2: "GM", name: "Gambia", dialCode: "220" },
37750
+ { alpha2: "GN", name: "Guinea", dialCode: "224" },
37751
+ { alpha2: "GP", name: "Guadeloupe", dialCode: "590" },
37752
+ { alpha2: "GQ", name: "Equatorial Guinea", dialCode: "240" },
37753
+ { alpha2: "GR", name: "Greece", dialCode: "30" },
37754
+ { alpha2: "GS", name: "South Georgia and the South Sandwich Islands" },
37755
+ { alpha2: "GT", name: "Guatemala", dialCode: "502" },
37756
+ { alpha2: "GU", name: "Guam", dialCode: "1" },
37757
+ { alpha2: "GW", name: "Guinea-Bissau", dialCode: "245" },
37758
+ { alpha2: "GY", name: "Guyana", dialCode: "592" },
37759
+ { alpha2: "HK", name: "Hong Kong", dialCode: "852" },
37760
+ { alpha2: "HM", name: "Heard Island and McDonald Islands" },
37761
+ { alpha2: "HN", name: "Honduras", dialCode: "504" },
37762
+ { alpha2: "HR", name: "Croatia", dialCode: "385" },
37763
+ { alpha2: "HT", name: "Haiti", dialCode: "509" },
37764
+ { alpha2: "HU", name: "Hungary", dialCode: "36" },
37765
+ { alpha2: "ID", name: "Indonesia", dialCode: "62" },
37766
+ { alpha2: "IE", name: "Ireland", dialCode: "353" },
37767
+ { alpha2: "IL", name: "Israel", dialCode: "972" },
37768
+ { alpha2: "IM", name: "Isle of Man", dialCode: "44" },
37769
+ { alpha2: "IN", name: "India", dialCode: "91" },
37770
+ { alpha2: "IO", name: "British Indian Ocean Territory", dialCode: "246" },
37771
+ { alpha2: "IQ", name: "Iraq", dialCode: "964" },
37772
+ { alpha2: "IR", name: "Iran", dialCode: "98" },
37773
+ { alpha2: "IS", name: "Iceland", dialCode: "354" },
37774
+ { alpha2: "IT", name: "Italy", dialCode: "39" },
37775
+ { alpha2: "JE", name: "Jersey", dialCode: "44" },
37776
+ { alpha2: "JM", name: "Jamaica", dialCode: "1" },
37777
+ { alpha2: "JO", name: "Jordan", dialCode: "962" },
37778
+ { alpha2: "JP", name: "Japan", dialCode: "81" },
37779
+ { alpha2: "KE", name: "Kenya", dialCode: "254" },
37780
+ { alpha2: "KG", name: "Kyrgyzstan", dialCode: "996" },
37781
+ { alpha2: "KH", name: "Cambodia", dialCode: "855" },
37782
+ { alpha2: "KI", name: "Kiribati", dialCode: "686" },
37783
+ { alpha2: "KM", name: "Comoros", dialCode: "269" },
37784
+ { alpha2: "KN", name: "Saint Kitts and Nevis", dialCode: "1" },
37785
+ { alpha2: "KP", name: "North Korea", dialCode: "850" },
37786
+ { alpha2: "KR", name: "South Korea", dialCode: "82" },
37787
+ { alpha2: "KW", name: "Kuwait", dialCode: "965" },
37788
+ { alpha2: "KY", name: "Cayman Islands", dialCode: "1" },
37789
+ { alpha2: "KZ", name: "Kazakhstan", dialCode: "7" },
37790
+ { alpha2: "LA", name: "Laos", dialCode: "856" },
37791
+ { alpha2: "LB", name: "Lebanon", dialCode: "961" },
37792
+ { alpha2: "LC", name: "Saint Lucia", dialCode: "1" },
37793
+ { alpha2: "LI", name: "Liechtenstein", dialCode: "423" },
37794
+ { alpha2: "LK", name: "Sri Lanka", dialCode: "94" },
37795
+ { alpha2: "LR", name: "Liberia", dialCode: "231" },
37796
+ { alpha2: "LS", name: "Lesotho", dialCode: "266" },
37797
+ { alpha2: "LT", name: "Lithuania", dialCode: "370" },
37798
+ { alpha2: "LU", name: "Luxembourg", dialCode: "352" },
37799
+ { alpha2: "LV", name: "Latvia", dialCode: "371" },
37800
+ { alpha2: "LY", name: "Libya", dialCode: "218" },
37801
+ { alpha2: "MA", name: "Morocco", dialCode: "212" },
37802
+ { alpha2: "MC", name: "Monaco", dialCode: "377" },
37803
+ { alpha2: "MD", name: "Moldova", dialCode: "373" },
37804
+ { alpha2: "ME", name: "Montenegro", dialCode: "382" },
37805
+ { alpha2: "MF", name: "Saint Martin (French part)", dialCode: "590" },
37806
+ { alpha2: "MG", name: "Madagascar", dialCode: "261" },
37807
+ { alpha2: "MH", name: "Marshall Islands", dialCode: "692" },
37808
+ { alpha2: "MK", name: "North Macedonia", dialCode: "389" },
37809
+ { alpha2: "ML", name: "Mali", dialCode: "223" },
37810
+ { alpha2: "MM", name: "Myanmar", dialCode: "95" },
37811
+ { alpha2: "MN", name: "Mongolia", dialCode: "976" },
37812
+ { alpha2: "MO", name: "Macao", dialCode: "853" },
37813
+ { alpha2: "MP", name: "Northern Mariana Islands", dialCode: "1" },
37814
+ { alpha2: "MQ", name: "Martinique", dialCode: "596" },
37815
+ { alpha2: "MR", name: "Mauritania", dialCode: "222" },
37816
+ { alpha2: "MS", name: "Montserrat", dialCode: "1" },
37817
+ { alpha2: "MT", name: "Malta", dialCode: "356" },
37818
+ { alpha2: "MU", name: "Mauritius", dialCode: "230" },
37819
+ { alpha2: "MV", name: "Maldives", dialCode: "960" },
37820
+ { alpha2: "MW", name: "Malawi", dialCode: "265" },
37821
+ { alpha2: "MX", name: "Mexico", dialCode: "52" },
37822
+ { alpha2: "MY", name: "Malaysia", dialCode: "60" },
37823
+ { alpha2: "MZ", name: "Mozambique", dialCode: "258" },
37824
+ { alpha2: "NA", name: "Namibia", dialCode: "264" },
37825
+ { alpha2: "NC", name: "New Caledonia", dialCode: "687" },
37826
+ { alpha2: "NE", name: "Niger", dialCode: "227" },
37827
+ { alpha2: "NF", name: "Norfolk Island", dialCode: "672" },
37828
+ { alpha2: "NG", name: "Nigeria", dialCode: "234" },
37829
+ { alpha2: "NI", name: "Nicaragua", dialCode: "505" },
37830
+ { alpha2: "NL", name: "Netherlands", dialCode: "31" },
37831
+ { alpha2: "NO", name: "Norway", dialCode: "47" },
37832
+ { alpha2: "NP", name: "Nepal", dialCode: "977" },
37833
+ { alpha2: "NR", name: "Nauru", dialCode: "674" },
37834
+ { alpha2: "NU", name: "Niue", dialCode: "683" },
37835
+ { alpha2: "NZ", name: "New Zealand", dialCode: "64" },
37836
+ { alpha2: "OM", name: "Oman", dialCode: "968" },
37837
+ { alpha2: "PA", name: "Panama", dialCode: "507" },
37838
+ { alpha2: "PE", name: "Peru", dialCode: "51" },
37839
+ { alpha2: "PF", name: "French Polynesia", dialCode: "689" },
37840
+ { alpha2: "PG", name: "Papua New Guinea", dialCode: "675" },
37841
+ { alpha2: "PH", name: "Philippines", dialCode: "63" },
37842
+ { alpha2: "PK", name: "Pakistan", dialCode: "92" },
37843
+ { alpha2: "PL", name: "Poland", dialCode: "48" },
37844
+ { alpha2: "PM", name: "Saint Pierre and Miquelon", dialCode: "508" },
37845
+ { alpha2: "PN", name: "Pitcairn", dialCode: "64" },
37846
+ { alpha2: "PR", name: "Puerto Rico", dialCode: "1" },
37847
+ { alpha2: "PS", name: "Palestine", dialCode: "970" },
37848
+ { alpha2: "PT", name: "Portugal", dialCode: "351" },
37849
+ { alpha2: "PW", name: "Palau", dialCode: "680" },
37850
+ { alpha2: "PY", name: "Paraguay", dialCode: "595" },
37851
+ { alpha2: "QA", name: "Qatar", dialCode: "974" },
37852
+ { alpha2: "RE", name: "R\xE9union", dialCode: "262" },
37853
+ { alpha2: "RO", name: "Romania", dialCode: "40" },
37854
+ { alpha2: "RS", name: "Serbia", dialCode: "381" },
37855
+ { alpha2: "RU", name: "Russia", dialCode: "7" },
37856
+ { alpha2: "RW", name: "Rwanda", dialCode: "250" },
37857
+ { alpha2: "SA", name: "Saudi Arabia", dialCode: "966" },
37858
+ { alpha2: "SB", name: "Solomon Islands", dialCode: "677" },
37859
+ { alpha2: "SC", name: "Seychelles", dialCode: "248" },
37860
+ { alpha2: "SD", name: "Sudan", dialCode: "249" },
37861
+ { alpha2: "SE", name: "Sweden", dialCode: "46" },
37862
+ { alpha2: "SG", name: "Singapore", dialCode: "65" },
37863
+ { alpha2: "SH", name: "Saint Helena, Ascension and Tristan da Cunha", dialCode: "290" },
37864
+ { alpha2: "SI", name: "Slovenia", dialCode: "386" },
37865
+ { alpha2: "SJ", name: "Svalbard and Jan Mayen", dialCode: "47" },
37866
+ { alpha2: "SK", name: "Slovakia", dialCode: "421" },
37867
+ { alpha2: "SL", name: "Sierra Leone", dialCode: "232" },
37868
+ { alpha2: "SM", name: "San Marino", dialCode: "378" },
37869
+ { alpha2: "SN", name: "Senegal", dialCode: "221" },
37870
+ { alpha2: "SO", name: "Somalia", dialCode: "252" },
37871
+ { alpha2: "SR", name: "Suriname", dialCode: "597" },
37872
+ { alpha2: "SS", name: "South Sudan", dialCode: "211" },
37873
+ { alpha2: "ST", name: "Sao Tome and Principe", dialCode: "239" },
37874
+ { alpha2: "SV", name: "El Salvador", dialCode: "503" },
37875
+ { alpha2: "SX", name: "Sint Maarten (Dutch part)", dialCode: "1" },
37876
+ { alpha2: "SY", name: "Syria", dialCode: "963" },
37877
+ { alpha2: "SZ", name: "Eswatini", dialCode: "268" },
37878
+ { alpha2: "TC", name: "Turks and Caicos Islands", dialCode: "1" },
37879
+ { alpha2: "TD", name: "Chad", dialCode: "235" },
37880
+ { alpha2: "TF", name: "French Southern Territories" },
37881
+ { alpha2: "TG", name: "Togo", dialCode: "228" },
37882
+ { alpha2: "TH", name: "Thailand", dialCode: "66" },
37883
+ { alpha2: "TJ", name: "Tajikistan", dialCode: "992" },
37884
+ { alpha2: "TK", name: "Tokelau", dialCode: "690" },
37885
+ { alpha2: "TL", name: "Timor-Leste", dialCode: "670" },
37886
+ { alpha2: "TM", name: "Turkmenistan", dialCode: "993" },
37887
+ { alpha2: "TN", name: "Tunisia", dialCode: "216" },
37888
+ { alpha2: "TO", name: "Tonga", dialCode: "676" },
37889
+ { alpha2: "TR", name: "T\xFCrkiye", dialCode: "90" },
37890
+ { alpha2: "TT", name: "Trinidad and Tobago", dialCode: "1" },
37891
+ { alpha2: "TV", name: "Tuvalu", dialCode: "688" },
37892
+ { alpha2: "TW", name: "Taiwan", dialCode: "886" },
37893
+ { alpha2: "TZ", name: "Tanzania", dialCode: "255" },
37894
+ { alpha2: "UA", name: "Ukraine", dialCode: "380" },
37895
+ { alpha2: "UG", name: "Uganda", dialCode: "256" },
37896
+ { alpha2: "UM", name: "U.S. Minor Outlying Islands" },
37897
+ { alpha2: "US", name: "United States", dialCode: "1" },
37898
+ { alpha2: "UY", name: "Uruguay", dialCode: "598" },
37899
+ { alpha2: "UZ", name: "Uzbekistan", dialCode: "998" },
37900
+ { alpha2: "VA", name: "Vatican City", dialCode: "39" },
37901
+ { alpha2: "VC", name: "Saint Vincent and the Grenadines", dialCode: "1" },
37902
+ { alpha2: "VE", name: "Venezuela", dialCode: "58" },
37903
+ { alpha2: "VG", name: "British Virgin Islands", dialCode: "1" },
37904
+ { alpha2: "VI", name: "U.S. Virgin Islands", dialCode: "1" },
37905
+ { alpha2: "VN", name: "Vietnam", dialCode: "84" },
37906
+ { alpha2: "VU", name: "Vanuatu", dialCode: "678" },
37907
+ { alpha2: "WF", name: "Wallis and Futuna", dialCode: "681" },
37908
+ { alpha2: "WS", name: "Samoa", dialCode: "685" },
37909
+ { alpha2: "YE", name: "Yemen", dialCode: "967" },
37910
+ { alpha2: "YT", name: "Mayotte", dialCode: "262" },
37911
+ { alpha2: "ZA", name: "South Africa", dialCode: "27" },
37912
+ { alpha2: "ZM", name: "Zambia", dialCode: "260" },
37913
+ { alpha2: "ZW", name: "Zimbabwe", dialCode: "263" }
37914
+ ];
37915
+ var BY_ALPHA2 = new Map(COUNTRIES.map((c) => [c.alpha2, c]));
37916
+ var ALL_COUNTRIES = [...COUNTRIES].sort(
37917
+ (a, b) => a.name.localeCompare(b.name)
37918
+ );
37919
+ function findCountry(code) {
37920
+ const upper = (code ?? "").trim().toUpperCase();
37921
+ return upper.length === 2 ? BY_ALPHA2.get(upper) : void 0;
37922
+ }
37923
+ function toAlpha2(code) {
37924
+ return findCountry(code)?.alpha2;
37925
+ }
37926
+ function countryName(code) {
37927
+ return findCountry(code)?.name ?? code;
37928
+ }
37929
+ function dialCode(code) {
37930
+ return findCountry(code)?.dialCode;
37931
+ }
37932
+
37933
+ // src/lib/countries/groups.ts
37934
+ var US = ["US"];
37935
+ var CANADA = ["CA"];
37936
+ var UK = ["GB"];
37937
+ var EU = [
37938
+ "AT",
37939
+ "BE",
37940
+ "BG",
37941
+ "HR",
37942
+ "CY",
37943
+ "CZ",
37944
+ "DK",
37945
+ "EE",
37946
+ "FI",
37947
+ "FR",
37948
+ "DE",
37949
+ "GR",
37950
+ "HU",
37951
+ "IE",
37952
+ "IT",
37953
+ "LV",
37954
+ "LT",
37955
+ "LU",
37956
+ "MT",
37957
+ "NL",
37958
+ "PL",
37959
+ "PT",
37960
+ "RO",
37961
+ "SK",
37962
+ "SI",
37963
+ "ES",
37964
+ "SE"
37965
+ ];
37966
+ var EEA = [...EU, "IS", "LI", "NO"];
37967
+ var EUROPE = [
37968
+ ...EEA,
37969
+ ...UK,
37970
+ "CH",
37971
+ "AD",
37972
+ "MC",
37973
+ "SM",
37974
+ "VA",
37975
+ "GI",
37976
+ "GG",
37977
+ "JE",
37978
+ "IM",
37979
+ "FO",
37980
+ "AX",
37981
+ "SJ",
37982
+ "GL",
37983
+ "PM",
37984
+ "AL",
37985
+ "BA",
37986
+ "ME",
37987
+ "MK",
37988
+ "RS",
37989
+ "MD",
37990
+ "UA",
37991
+ "BY",
37992
+ "RU",
37993
+ "GE",
37994
+ "AM",
37995
+ "AZ",
37996
+ "TR"
37997
+ ];
37998
+ var INDIA = ["IN"];
37999
+ var SEA = ["BN", "KH", "ID", "LA", "MY", "MM", "PH", "SG", "TH", "VN", "TL"];
38000
+ var ASIA = [
38001
+ ...SEA,
38002
+ ...INDIA,
38003
+ "CN",
38004
+ "HK",
38005
+ "MO",
38006
+ "TW",
38007
+ "JP",
38008
+ "KR",
38009
+ "KP",
38010
+ "MN",
38011
+ "PK",
38012
+ "BD",
38013
+ "LK",
38014
+ "NP",
38015
+ "BT",
38016
+ "MV",
38017
+ "AF",
38018
+ "KZ",
38019
+ "KG",
38020
+ "TJ",
38021
+ "TM",
38022
+ "UZ"
38023
+ ];
38024
+ var MENA = [
38025
+ "AE",
38026
+ "SA",
38027
+ "QA",
38028
+ "KW",
38029
+ "BH",
38030
+ "OM",
38031
+ "YE",
38032
+ "IQ",
38033
+ "IR",
38034
+ "IL",
38035
+ "PS",
38036
+ "JO",
38037
+ "LB",
38038
+ "SY",
38039
+ "EG",
38040
+ "LY",
38041
+ "TN",
38042
+ "DZ",
38043
+ "MA",
38044
+ "EH"
38045
+ ];
38046
+ var AFRICA = [
38047
+ "AO",
38048
+ "BJ",
38049
+ "BW",
38050
+ "BF",
38051
+ "BI",
38052
+ "CV",
38053
+ "CM",
38054
+ "CF",
38055
+ "TD",
38056
+ "KM",
38057
+ "CD",
38058
+ "CG",
38059
+ "CI",
38060
+ "DJ",
38061
+ "GQ",
38062
+ "ER",
38063
+ "SZ",
38064
+ "ET",
38065
+ "GA",
38066
+ "GM",
38067
+ "GH",
38068
+ "GN",
38069
+ "GW",
38070
+ "KE",
38071
+ "LS",
38072
+ "LR",
38073
+ "MG",
38074
+ "MW",
38075
+ "ML",
38076
+ "MR",
38077
+ "MU",
38078
+ "YT",
38079
+ "MZ",
38080
+ "NA",
38081
+ "NE",
38082
+ "NG",
38083
+ "RE",
38084
+ "RW",
38085
+ "SH",
38086
+ "ST",
38087
+ "SN",
38088
+ "SC",
38089
+ "SL",
38090
+ "SO",
38091
+ "ZA",
38092
+ "SS",
38093
+ "SD",
38094
+ "TZ",
38095
+ "TG",
38096
+ "UG",
38097
+ "ZM",
38098
+ "ZW",
38099
+ "IO",
38100
+ "TF"
38101
+ ];
38102
+ var CARIBBEAN = [
38103
+ "AI",
38104
+ "AG",
38105
+ "AW",
38106
+ "BS",
38107
+ "BB",
38108
+ "BM",
38109
+ "BQ",
38110
+ "VG",
38111
+ "KY",
38112
+ "CU",
38113
+ "CW",
38114
+ "DM",
38115
+ "DO",
38116
+ "GD",
38117
+ "GP",
38118
+ "HT",
38119
+ "JM",
38120
+ "MQ",
38121
+ "MS",
38122
+ "PR",
38123
+ "BL",
38124
+ "KN",
38125
+ "LC",
38126
+ "MF",
38127
+ "VC",
38128
+ "SX",
38129
+ "TT",
38130
+ "TC",
38131
+ "VI"
38132
+ ];
38133
+ var LATAM = [
38134
+ ...CARIBBEAN,
38135
+ "MX",
38136
+ "BZ",
38137
+ "CR",
38138
+ "SV",
38139
+ "GT",
38140
+ "HN",
38141
+ "NI",
38142
+ "PA",
38143
+ "AR",
38144
+ "BO",
38145
+ "BR",
38146
+ "CL",
38147
+ "CO",
38148
+ "EC",
38149
+ "FK",
38150
+ "GF",
38151
+ "GY",
38152
+ "PY",
38153
+ "PE",
38154
+ "GS",
38155
+ "SR",
38156
+ "UY",
38157
+ "VE"
38158
+ ];
38159
+ var OCEANIA = [
38160
+ "AU",
38161
+ "NZ",
38162
+ "FJ",
38163
+ "PG",
38164
+ "SB",
38165
+ "VU",
38166
+ "NC",
38167
+ "PF",
38168
+ "WS",
38169
+ "AS",
38170
+ "TO",
38171
+ "KI",
38172
+ "FM",
38173
+ "MH",
38174
+ "PW",
38175
+ "NR",
38176
+ "TV",
38177
+ "CK",
38178
+ "NU",
38179
+ "TK",
38180
+ "WF",
38181
+ "GU",
38182
+ "MP",
38183
+ "UM",
38184
+ "PN",
38185
+ "NF",
38186
+ "CX",
38187
+ "CC",
38188
+ "HM",
38189
+ "AQ",
38190
+ "BV"
38191
+ ];
38192
+ var COUNTRY_GROUPS = {
38193
+ US,
38194
+ CANADA,
38195
+ UK,
38196
+ EU,
38197
+ EEA,
38198
+ EUROPE,
38199
+ INDIA,
38200
+ SEA,
38201
+ ASIA,
38202
+ MENA,
38203
+ AFRICA,
38204
+ CARIBBEAN,
38205
+ LATAM,
38206
+ OCEANIA
38207
+ };
38208
+ function isInGroup(code, group) {
38209
+ const alpha2 = toAlpha2(code);
38210
+ return !!alpha2 && COUNTRY_GROUPS[group].includes(alpha2);
38211
+ }
38212
+ function getKycCountryList(options = {}) {
38213
+ const { group, whitelisted, blacklisted } = options;
38214
+ const scoped = !!group?.length || !!whitelisted?.length;
38215
+ const include = /* @__PURE__ */ new Set();
38216
+ if (scoped) {
38217
+ for (const g of group ?? []) for (const code of COUNTRY_GROUPS[g]) include.add(code);
38218
+ for (const code of whitelisted ?? []) {
38219
+ const alpha2 = toAlpha2(code);
38220
+ if (alpha2) include.add(alpha2);
38221
+ }
38222
+ }
38223
+ const exclude = /* @__PURE__ */ new Set();
38224
+ for (const code of blacklisted ?? []) {
38225
+ const alpha2 = toAlpha2(code);
38226
+ if (alpha2) exclude.add(alpha2);
38227
+ }
38228
+ return ALL_COUNTRIES.filter((c) => (!scoped || include.has(c.alpha2)) && !exclude.has(c.alpha2));
38229
+ }
38230
+
38231
+ // src/lib/countries/us-states.ts
38232
+ var US_STATES = [
38233
+ { code: "AL", name: "Alabama" },
38234
+ { code: "AK", name: "Alaska" },
38235
+ { code: "AS", name: "American Samoa" },
38236
+ { code: "AZ", name: "Arizona" },
38237
+ { code: "AR", name: "Arkansas" },
38238
+ { code: "CA", name: "California" },
38239
+ { code: "CO", name: "Colorado" },
38240
+ { code: "CT", name: "Connecticut" },
38241
+ { code: "DE", name: "Delaware" },
38242
+ { code: "DC", name: "District of Columbia" },
38243
+ { code: "FL", name: "Florida" },
38244
+ { code: "GA", name: "Georgia" },
38245
+ { code: "GU", name: "Guam" },
38246
+ { code: "HI", name: "Hawaii" },
38247
+ { code: "ID", name: "Idaho" },
38248
+ { code: "IL", name: "Illinois" },
38249
+ { code: "IN", name: "Indiana" },
38250
+ { code: "IA", name: "Iowa" },
38251
+ { code: "KS", name: "Kansas" },
38252
+ { code: "KY", name: "Kentucky" },
38253
+ { code: "LA", name: "Louisiana" },
38254
+ { code: "ME", name: "Maine" },
38255
+ { code: "MD", name: "Maryland" },
38256
+ { code: "MA", name: "Massachusetts" },
38257
+ { code: "MI", name: "Michigan" },
38258
+ { code: "MN", name: "Minnesota" },
38259
+ { code: "MS", name: "Mississippi" },
38260
+ { code: "MO", name: "Missouri" },
38261
+ { code: "MT", name: "Montana" },
38262
+ { code: "NE", name: "Nebraska" },
38263
+ { code: "NV", name: "Nevada" },
38264
+ { code: "NH", name: "New Hampshire" },
38265
+ { code: "NJ", name: "New Jersey" },
38266
+ { code: "NM", name: "New Mexico" },
38267
+ { code: "NY", name: "New York" },
38268
+ { code: "NC", name: "North Carolina" },
38269
+ { code: "ND", name: "North Dakota" },
38270
+ { code: "MP", name: "Northern Mariana Islands" },
38271
+ { code: "OH", name: "Ohio" },
38272
+ { code: "OK", name: "Oklahoma" },
38273
+ { code: "OR", name: "Oregon" },
38274
+ { code: "PA", name: "Pennsylvania" },
38275
+ { code: "PR", name: "Puerto Rico" },
38276
+ { code: "RI", name: "Rhode Island" },
38277
+ { code: "SC", name: "South Carolina" },
38278
+ { code: "SD", name: "South Dakota" },
38279
+ { code: "TN", name: "Tennessee" },
38280
+ { code: "TX", name: "Texas" },
38281
+ { code: "UT", name: "Utah" },
38282
+ { code: "VT", name: "Vermont" },
38283
+ { code: "VA", name: "Virginia" },
38284
+ { code: "VI", name: "U.S. Virgin Islands" },
38285
+ { code: "WA", name: "Washington" },
38286
+ { code: "WV", name: "West Virginia" },
38287
+ { code: "WI", name: "Wisconsin" },
38288
+ { code: "WY", name: "Wyoming" }
38289
+ ];
38290
+ function usStateName(code) {
38291
+ return US_STATES.find((s) => s.code === code)?.name ?? code;
38292
+ }
38293
+
38294
+ // src/lib/countries/flags.tsx
38295
+ var import_core60 = require("@unifold/core");
38296
+ var import_jsx_runtime84 = require("react/jsx-runtime");
38297
+ function countryFlagIconPath(alpha2) {
38298
+ return `/icons/countries/svg/${alpha2.toLowerCase()}.svg`;
38299
+ }
38300
+ function countryFlagPngPath(alpha2) {
38301
+ return `/icons/countries/png/${alpha2.toLowerCase()}.png`;
38302
+ }
38303
+ function countryFlag(code) {
38304
+ const upper = toAlpha2(code) ?? "";
38305
+ if (!/^[A-Z]{2}$/.test(upper)) return "";
38306
+ const REGIONAL_INDICATOR_A = 127462;
38307
+ return String.fromCodePoint(
38308
+ ...[...upper].map((char) => REGIONAL_INDICATOR_A + char.charCodeAt(0) - "A".charCodeAt(0))
38309
+ );
38310
+ }
38311
+ function CountryFlag({
38312
+ code,
38313
+ assetCdnUrl,
38314
+ size = 20,
38315
+ className
38316
+ }) {
38317
+ const alpha2 = toAlpha2(code);
38318
+ if (!alpha2) return null;
38319
+ return /* @__PURE__ */ (0, import_jsx_runtime84.jsx)(
38320
+ "img",
38321
+ {
38322
+ src: (0, import_core60.getIconUrlWithCdn)(countryFlagIconPath(alpha2), assetCdnUrl),
38323
+ alt: "",
38324
+ "aria-hidden": true,
38325
+ loading: "lazy",
38326
+ width: size,
38327
+ height: Math.round(size * 0.7),
38328
+ className: className ?? "uf-rounded-sm uf-flex-shrink-0",
38329
+ style: { width: size, height: "auto" },
38330
+ onError: (e) => {
38331
+ e.currentTarget.style.visibility = "hidden";
38332
+ }
38333
+ }
38334
+ );
38335
+ }
38336
+
38337
+ // src/components/shared/region-picker/RegionSelectorSheet.tsx
38338
+ var import_react41 = require("react");
38339
+ var import_react_dom = require("react-dom");
38340
+ var import_lucide_react50 = require("lucide-react");
38341
+ var import_jsx_runtime85 = require("react/jsx-runtime");
38342
+ var REGION_SHEET_ANCHOR_ATTR = "data-uf-sheet-anchor";
38343
+ var REGION_LIST_MAX_HEIGHT = 350;
38344
+ var MODAL_GUTTER = "1.5rem";
38345
+ var ROW_STYLE = {
38346
+ paddingTop: "0.875rem",
38347
+ paddingBottom: "0.875rem",
38348
+ paddingLeft: "0.75rem",
38349
+ paddingRight: "0.75rem"
38350
+ };
38351
+ var ROW_NAME_FONT_SIZE = "1rem";
38352
+ var ROW_CODE_FONT_SIZE = "0.875rem";
38353
+ var ROW_FLAG_SIZE = 24;
38354
+ function filterRegions(options, query, matchDialCode = false) {
38355
+ const q = query.trim().toLowerCase().replace(/^\+/, "");
38356
+ if (!q) return [...options];
38357
+ const numeric = matchDialCode && /^\d+$/.test(q);
38358
+ return options.filter((c) => {
38359
+ if (c.name.toLowerCase().includes(q)) return true;
38360
+ if (c.code.toLowerCase().startsWith(q)) return true;
38361
+ if (!numeric) return false;
38362
+ const dial = dialCode(c.flagCode ?? c.code);
38363
+ return !!dial && dial.startsWith(q);
38364
+ });
38365
+ }
38366
+ function RegionSelectorSheet({
38367
+ open,
38368
+ onOpenChange,
38369
+ options,
38370
+ selectedCode,
38371
+ onSelect,
38372
+ title,
38373
+ showDialCode,
38374
+ showFlags = true,
38375
+ assetCdnUrl
38376
+ }) {
38377
+ const { colors: colors2, fonts, components } = useTheme();
38378
+ const { t: strings } = useI18n();
38379
+ const [query, setQuery] = (0, import_react41.useState)("");
38380
+ const [hovered, setHovered] = (0, import_react41.useState)(null);
38381
+ const searchRef = (0, import_react41.useRef)(null);
38382
+ const probeRef = (0, import_react41.useRef)(null);
38383
+ const [anchor, setAnchor] = (0, import_react41.useState)(void 0);
38384
+ (0, import_react41.useEffect)(() => {
38385
+ if (!open) {
38386
+ setAnchor(void 0);
38387
+ setQuery("");
38388
+ return;
38389
+ }
38390
+ setAnchor(probeRef.current?.closest(`[${REGION_SHEET_ANCHOR_ATTR}]`) ?? null);
38391
+ }, [open]);
38392
+ (0, import_react41.useEffect)(() => {
38393
+ if (!open || anchor === void 0) return;
38394
+ searchRef.current?.focus({ preventScroll: true });
38395
+ }, [open, anchor]);
38396
+ const filtered = (0, import_react41.useMemo)(
38397
+ () => filterRegions(options, query, showDialCode),
38398
+ [options, query, showDialCode]
38399
+ );
38400
+ (0, import_react41.useEffect)(() => {
38401
+ if (!open) return;
38402
+ const onKeyDown = (event) => {
38403
+ if (event.key !== "Escape") return;
38404
+ event.preventDefault();
38405
+ event.stopPropagation();
38406
+ onOpenChange(false);
38407
+ };
38408
+ window.addEventListener("keydown", onKeyDown, true);
38409
+ return () => window.removeEventListener("keydown", onKeyDown, true);
38410
+ }, [open, onOpenChange]);
38411
+ if (!open) return null;
38412
+ const close = () => {
38413
+ onOpenChange(false);
38414
+ };
38415
+ const pick = (code) => {
38416
+ onSelect(code);
38417
+ close();
38418
+ };
38419
+ const panel = (
38420
+ // Absolutely positioned so it covers the whole modal body including the
38421
+ // "Powered by" footer, which is a sibling of this flow and so can't be
38422
+ // covered from normal flow. `absolute` rather than `fixed` because the modal
38423
+ // can be portaled into a host container, which a fixed layer would escape.
38424
+ // The anchor is the positioned wrapper in DepositModal.
38425
+ /* @__PURE__ */ (0, import_jsx_runtime85.jsxs)(
38426
+ "div",
38427
+ {
38428
+ style: {
38429
+ position: "absolute",
38430
+ top: 0,
38431
+ bottom: 0,
38432
+ // Reaches past the gutter DialogContent puts around the modal body so
38433
+ // the sheet meets the modal's edges.
38434
+ left: `-${MODAL_GUTTER}`,
38435
+ right: `-${MODAL_GUTTER}`,
38436
+ zIndex: 20,
38437
+ display: "flex",
38438
+ flexDirection: "column",
38439
+ justifyContent: "flex-end",
38440
+ overflow: "hidden"
38441
+ },
38442
+ children: [
38443
+ /* @__PURE__ */ (0, import_jsx_runtime85.jsx)(
38444
+ "style",
38445
+ {
38446
+ dangerouslySetInnerHTML: {
38447
+ __html: `
38448
+ .uf-region-sheet-search::placeholder { color: ${components.search.placeholderColor}; }
38449
+ .uf-region-sheet-list::-webkit-scrollbar { display: none; }
38450
+ @keyframes uf-region-sheet-rise {
38451
+ from { transform: translateY(100%); }
38452
+ to { transform: translateY(0); }
38453
+ }
38454
+ .uf-region-sheet-panel {
38455
+ animation: uf-region-sheet-rise 260ms cubic-bezier(0.32, 0.72, 0, 1) both;
38456
+ }
38457
+ @media (prefers-reduced-motion: reduce) {
38458
+ .uf-region-sheet-panel { animation: none; }
38459
+ }
38460
+ `
38461
+ }
38462
+ }
38463
+ ),
38464
+ /* @__PURE__ */ (0, import_jsx_runtime85.jsx)(
38465
+ "div",
38466
+ {
38467
+ role: "presentation",
38468
+ onClick: close,
38469
+ style: { position: "absolute", inset: 0, backgroundColor: "rgba(0, 0, 0, 0.45)" }
38470
+ }
38471
+ ),
38472
+ /* @__PURE__ */ (0, import_jsx_runtime85.jsxs)(
38473
+ "div",
38474
+ {
38475
+ role: "dialog",
38476
+ "aria-modal": "true",
38477
+ "aria-label": title,
38478
+ onClick: (event) => event.stopPropagation(),
38479
+ className: "uf-region-sheet-panel uf-flex uf-flex-col",
38480
+ style: {
38481
+ position: "relative",
38482
+ // Never taller than the area it covers: the list shrinks rather than
38483
+ // the panel spilling out over the modal header.
38484
+ maxHeight: "100%",
38485
+ // Restores the gutter the wrapper cancelled, so content keeps its
38486
+ // alignment with the rest of the modal while the sheet spans the edges.
38487
+ padding: `0.75rem ${MODAL_GUTTER}`,
38488
+ // Same surface as the modal it sits in, rather than the card tone.
38489
+ backgroundColor: colors2.background,
38490
+ // Docked to the bottom edge to edge, so only the top corners are
38491
+ // rounded and only the top edge is drawn — side borders against the
38492
+ // modal's own edges would read as a seam.
38493
+ borderTop: `${components.card.borderWidth}px solid ${components.card.borderColor}`,
38494
+ borderTopLeftRadius: components.card.borderRadius,
38495
+ borderTopRightRadius: components.card.borderRadius,
38496
+ boxShadow: "0 -8px 28px rgba(0, 0, 0, 0.32)"
38497
+ },
38498
+ children: [
38499
+ /* @__PURE__ */ (0, import_jsx_runtime85.jsxs)("div", { className: "uf-relative", children: [
38500
+ /* @__PURE__ */ (0, import_jsx_runtime85.jsx)(
38501
+ "h3",
38502
+ {
38503
+ className: "uf-text-center",
38504
+ style: {
38505
+ color: components.container.titleColor,
38506
+ fontFamily: fonts.medium,
38507
+ fontSize: "1rem"
38508
+ },
38509
+ children: title
38510
+ }
38511
+ ),
38512
+ /* @__PURE__ */ (0, import_jsx_runtime85.jsxs)(
38513
+ "button",
38514
+ {
38515
+ type: "button",
38516
+ onClick: close,
38517
+ className: "uf-opacity-70 uf-transition-opacity hover:uf-opacity-100",
38518
+ style: {
38519
+ position: "absolute",
38520
+ // Padded out to a finger-sized target, then pulled back into the
38521
+ // gutter by the same amount so the glyph still lines up with the
38522
+ // right edge of the rows below.
38523
+ padding: "0.5rem",
38524
+ right: "-0.5rem",
38525
+ top: "50%",
38526
+ transform: "translateY(-50%)",
38527
+ // Centres the glyph in its box rather than on the text baseline.
38528
+ lineHeight: 0,
38529
+ color: components.container.titleColor
38530
+ },
38531
+ children: [
38532
+ /* @__PURE__ */ (0, import_jsx_runtime85.jsx)(import_lucide_react50.X, { style: { width: "1.25rem", height: "1.25rem" } }),
38533
+ /* @__PURE__ */ (0, import_jsx_runtime85.jsx)("span", { className: "uf-sr-only", children: strings.common.close })
38534
+ ]
38535
+ }
38536
+ )
38537
+ ] }),
38538
+ /* @__PURE__ */ (0, import_jsx_runtime85.jsx)("div", { className: "uf-pt-3 uf-pb-3", children: /* @__PURE__ */ (0, import_jsx_runtime85.jsx)(
38539
+ "input",
38540
+ {
38541
+ ref: searchRef,
38542
+ type: "text",
38543
+ value: query,
38544
+ onChange: (e) => setQuery(e.target.value),
38545
+ onKeyDown: (e) => {
38546
+ if (e.key !== "Enter") return;
38547
+ e.preventDefault();
38548
+ if (filtered[0]) pick(filtered[0].code);
38549
+ },
38550
+ placeholder: strings.common.search,
38551
+ className: "uf-region-sheet-search uf-w-full uf-px-4 uf-py-3 uf-outline-none",
38552
+ style: {
38553
+ backgroundColor: components.search.backgroundColor,
38554
+ color: components.search.inputColor,
38555
+ fontFamily: fonts.regular,
38556
+ // 16px: anything smaller makes iOS Safari zoom the page on focus.
38557
+ fontSize: "1rem",
38558
+ borderRadius: components.input.borderRadius,
38559
+ border: `${components.input.borderWidth}px solid ${components.input.borderColor}`
38560
+ }
38561
+ }
38562
+ ) }),
38563
+ /* @__PURE__ */ (0, import_jsx_runtime85.jsx)(
38564
+ "div",
38565
+ {
38566
+ className: "uf-region-sheet-list",
38567
+ style: {
38568
+ maxHeight: REGION_LIST_MAX_HEIGHT,
38569
+ minHeight: 0,
38570
+ overflowY: "auto",
38571
+ scrollbarWidth: "none",
38572
+ msOverflowStyle: "none"
38573
+ },
38574
+ children: filtered.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime85.jsx)(
38575
+ "p",
38576
+ {
38577
+ className: "uf-text-center uf-py-8",
38578
+ style: {
38579
+ color: components.container.subtitleColor,
38580
+ fontFamily: fonts.regular,
38581
+ fontSize: ROW_NAME_FONT_SIZE
38582
+ },
38583
+ children: strings.common.noResults
38584
+ }
38585
+ ) : /* @__PURE__ */ (0, import_jsx_runtime85.jsx)("div", { className: "uf-flex uf-flex-col uf-gap-1", children: filtered.map((c) => {
38586
+ const isSelected = c.code === selectedCode;
38587
+ const flagCode = c.flagCode ?? c.code;
38588
+ return /* @__PURE__ */ (0, import_jsx_runtime85.jsxs)(
38589
+ "button",
38590
+ {
38591
+ type: "button",
38592
+ onClick: () => pick(c.code),
38593
+ onMouseEnter: () => setHovered(c.code),
38594
+ onMouseLeave: () => setHovered(null),
38595
+ "aria-current": isSelected,
38596
+ className: "uf-w-full uf-flex uf-items-center uf-gap-3 uf-text-left uf-transition-colors",
38597
+ style: {
38598
+ ...ROW_STYLE,
38599
+ borderRadius: components.card.borderRadius,
38600
+ // The selection is carried by a tinted row rather than a
38601
+ // trailing check, so it has to read as clearly distinct from
38602
+ // the plain hover state.
38603
+ backgroundColor: isSelected ? `${colors2.primary}24` : hovered === c.code ? colors2.cardHover : "transparent"
38604
+ },
38605
+ children: [
38606
+ showFlags && /* @__PURE__ */ (0, import_jsx_runtime85.jsx)(CountryFlag, { code: flagCode, assetCdnUrl, size: ROW_FLAG_SIZE }),
38607
+ /* @__PURE__ */ (0, import_jsx_runtime85.jsx)(
38608
+ "span",
38609
+ {
38610
+ className: "uf-flex-1 uf-truncate",
38611
+ style: {
38612
+ color: colors2.foreground,
38613
+ fontFamily: isSelected ? fonts.medium : fonts.regular,
38614
+ fontSize: ROW_NAME_FONT_SIZE
38615
+ },
38616
+ children: c.name
38617
+ }
38618
+ ),
38619
+ /* @__PURE__ */ (0, import_jsx_runtime85.jsx)(
38620
+ "span",
38621
+ {
38622
+ className: "uf-shrink-0",
38623
+ style: {
38624
+ color: isSelected ? colors2.primary : components.container.subtitleColor,
38625
+ fontFamily: isSelected ? fonts.medium : fonts.regular,
38626
+ fontSize: ROW_CODE_FONT_SIZE
38627
+ },
38628
+ children: showDialCode ? `+${dialCode(flagCode) ?? ""}` : c.code
38629
+ }
38630
+ )
38631
+ ]
38632
+ },
38633
+ c.code
38634
+ );
38635
+ }) })
38636
+ }
38637
+ )
38638
+ ]
38639
+ }
38640
+ )
38641
+ ]
38642
+ }
38643
+ )
38644
+ );
38645
+ return /* @__PURE__ */ (0, import_jsx_runtime85.jsxs)(import_jsx_runtime85.Fragment, { children: [
38646
+ /* @__PURE__ */ (0, import_jsx_runtime85.jsx)("span", { ref: probeRef, hidden: true }),
38647
+ anchor === void 0 ? null : anchor ? (0, import_react_dom.createPortal)(panel, anchor) : panel
38648
+ ] });
38649
+ }
38650
+
38651
+ // src/components/shared/region-picker/RegionPickerButton.tsx
38652
+ var import_lucide_react51 = require("lucide-react");
38653
+ var import_jsx_runtime86 = require("react/jsx-runtime");
38654
+ function RegionPickerButton({
38655
+ label,
38656
+ placeholder,
38657
+ flagCode,
38658
+ assetCdnUrl,
38659
+ onClick,
38660
+ fitContent,
38661
+ dense,
38662
+ locked,
38663
+ style: styleOverride
38664
+ }) {
38665
+ const { colors: colors2, fonts, components } = useTheme();
38666
+ const className = "uf-flex uf-items-center uf-justify-between uf-gap-1 uf-px-3 uf-text-sm uf-transition-colors";
38667
+ const style = {
38668
+ // Inline so it can't be lost to a stale stylesheet, and so it matches the
38669
+ // neighbouring input's padding exactly.
38670
+ paddingTop: dense ? "0.625rem" : "0.75rem",
38671
+ paddingBottom: dense ? "0.625rem" : "0.75rem",
38672
+ width: fitContent ? "auto" : "100%",
38673
+ // A floor so the control doesn't visibly resize as the user switches
38674
+ // between a one- and a three-digit dial code.
38675
+ minWidth: fitContent ? "6rem" : void 0,
38676
+ // Hold that width in the flex row it shares with the phone input, and
38677
+ // let the input give up the space instead.
38678
+ flexShrink: fitContent ? 0 : void 0,
38679
+ color: placeholder ? components.container.subtitleColor : colors2.foreground,
38680
+ backgroundColor: components.input.backgroundColor,
38681
+ borderRadius: components.input.borderRadius,
38682
+ border: `${components.input.borderWidth}px solid ${components.input.borderColor}`,
38683
+ fontFamily: fonts.regular,
38684
+ ...styleOverride,
38685
+ // A placeholder stays dimmed even when the override sets a text colour.
38686
+ ...placeholder ? { color: components.container.subtitleColor } : {}
38687
+ };
38688
+ const content = /* @__PURE__ */ (0, import_jsx_runtime86.jsxs)(import_jsx_runtime86.Fragment, { children: [
38689
+ /* @__PURE__ */ (0, import_jsx_runtime86.jsxs)("span", { className: "uf-flex uf-items-center uf-gap-2 uf-min-w-0", children: [
38690
+ flagCode && /* @__PURE__ */ (0, import_jsx_runtime86.jsx)(CountryFlag, { code: flagCode, assetCdnUrl, size: 20 }),
38691
+ /* @__PURE__ */ (0, import_jsx_runtime86.jsx)("span", { className: "uf-truncate", children: label })
38692
+ ] }),
38693
+ !locked && /* @__PURE__ */ (0, import_jsx_runtime86.jsx)(
38694
+ import_lucide_react51.ChevronDown,
38695
+ {
38696
+ className: "uf-w-4 uf-h-4 uf-shrink-0",
38697
+ style: { color: components.container.subtitleColor }
38698
+ }
38699
+ )
38700
+ ] });
38701
+ if (locked) {
38702
+ return /* @__PURE__ */ (0, import_jsx_runtime86.jsx)("div", { className, style, children: content });
38703
+ }
38704
+ return /* @__PURE__ */ (0, import_jsx_runtime86.jsx)(
38705
+ "button",
38706
+ {
38707
+ type: "button",
38708
+ onClick,
38709
+ className,
38710
+ style,
38711
+ "aria-haspopup": "dialog",
38712
+ children: content
38713
+ }
38714
+ );
38715
+ }
37427
38716
  // Annotate the CommonJS export names for ESM import in node:
37428
38717
  0 && (module.exports = {
38718
+ ALL_COUNTRIES,
37429
38719
  AnalyticsProvider,
37430
38720
  BankTransfer,
37431
38721
  BankTransferButton,
@@ -37434,11 +38724,14 @@ function WithdrawTokenSelector({ tokens, onSelect, onBack }) {
37434
38724
  BuyWithCard,
37435
38725
  BuyWithGooglePay,
37436
38726
  BuyWithWalletPay,
38727
+ COUNTRIES,
38728
+ COUNTRY_GROUPS,
37437
38729
  CheckingForDepositIndicator,
37438
38730
  CheckoutModal,
37439
38731
  CoinbaseConnect,
37440
38732
  ConfirmingView,
37441
38733
  ConnectExchangeButton,
38734
+ CountryFlag,
37442
38735
  CurrencyListItem,
37443
38736
  CurrencyListSection,
37444
38737
  CurrencyModal,
@@ -37466,6 +38759,9 @@ function WithdrawTokenSelector({ tokens, onSelect, onBack }) {
37466
38759
  ManualDepositButton,
37467
38760
  PayWithStripeLink,
37468
38761
  QRCodeSkeleton,
38762
+ REGION_SHEET_ANCHOR_ATTR,
38763
+ RegionPickerButton,
38764
+ RegionSelectorSheet,
37469
38765
  SUPPORTED_LOCALES,
37470
38766
  Select,
37471
38767
  SelectContent,
@@ -37488,6 +38784,7 @@ function WithdrawTokenSelector({ tokens, onSelect, onBack }) {
37488
38784
  TransferCryptoDoubleInput,
37489
38785
  TransferCryptoSingleInput,
37490
38786
  TransferQrCode,
38787
+ US_STATES,
37491
38788
  WalletPayQrCheckout,
37492
38789
  WithdrawConfirmingView,
37493
38790
  WithdrawDoubleInput,
@@ -37502,10 +38799,17 @@ function WithdrawTokenSelector({ tokens, onSelect, onBack }) {
37502
38799
  cn,
37503
38800
  colors,
37504
38801
  connectSolanaStandardWallet,
38802
+ countryFlag,
38803
+ countryFlagIconPath,
38804
+ countryFlagPngPath,
38805
+ countryName,
37505
38806
  defaultColors,
37506
38807
  detectBrowserLocale,
37507
38808
  detectBrowserWallet,
37508
38809
  detectConnectedBrowserWallet,
38810
+ dialCode,
38811
+ filterRegions,
38812
+ findCountry,
37509
38813
  findSolanaStandardWallet,
37510
38814
  formatCryptoAmount,
37511
38815
  formatFiat,
@@ -37513,6 +38817,7 @@ function WithdrawTokenSelector({ tokens, onSelect, onBack }) {
37513
38817
  getActiveStrings,
37514
38818
  getAuthorizedSolanaStandardAccounts,
37515
38819
  getColors,
38820
+ getKycCountryList,
37516
38821
  getSolanaStandardWallets,
37517
38822
  getStoredApplePaySession,
37518
38823
  getStoredWalletPaySession,
@@ -37520,6 +38825,7 @@ function WithdrawTokenSelector({ tokens, onSelect, onBack }) {
37520
38825
  i18n,
37521
38826
  interpolate,
37522
38827
  isHypercoreChain,
38828
+ isInGroup,
37523
38829
  isOnrampTokenFresh,
37524
38830
  isSolanaWalletDetectedViaWalletStandard,
37525
38831
  mergeColors,
@@ -37538,7 +38844,9 @@ function WithdrawTokenSelector({ tokens, onSelect, onBack }) {
37538
38844
  startBrowserWalletDiscovery,
37539
38845
  subscribeSolanaStandardAccountChanges,
37540
38846
  subscribeSolanaStandardWallets,
38847
+ toAlpha2,
37541
38848
  truncateAddress,
38849
+ usStateName,
37542
38850
  useAddressBalance,
37543
38851
  useAllowedCountry,
37544
38852
  useAnalytics,