@privy-io/react-auth 3.7.0 → 3.8.0

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.
Files changed (361) hide show
  1. package/dist/cjs/AccountNotFoundScreen-jSbfPu_e.js +1 -0
  2. package/dist/cjs/Address-CZQd_MIA.js +1 -0
  3. package/dist/cjs/AffirmativeConsentScreen-7a4hl59A.js +1 -0
  4. package/dist/cjs/AllowlistRejectionScreen-B6roj0JU.js +1 -0
  5. package/dist/cjs/AuthenticateWithWalletScreen-BcBapHrq.js +1 -0
  6. package/dist/cjs/AwaitingEvmToSolBridgingScreen-D1Xd83Hp.js +2 -0
  7. package/dist/cjs/AwaitingExternalEthereumTransferScreen-COL0WYkT.js +2 -0
  8. package/dist/cjs/AwaitingPasswordlessCodeScreen-Cx5fqGf6.js +1 -0
  9. package/dist/cjs/AwaitingSolToEvmBridgingScreen-DYS3lDs0.js +2 -0
  10. package/dist/cjs/BridgeNetworkSelectionView-uivzU_Y9.js +1 -0
  11. package/dist/cjs/Button-nXApC2Jy.js +2 -0
  12. package/dist/cjs/CaptchaScreen-025syTLo.js +1 -0
  13. package/dist/cjs/Checkbox-DXPQZFlQ.js +1 -0
  14. package/dist/cjs/Chip-ChrHHazc.js +1 -0
  15. package/dist/cjs/CoinbaseOnrampStatusScreen-ORl8wt4H.js +1 -0
  16. package/dist/cjs/Column-C2bAbJE0.js +1 -0
  17. package/dist/cjs/ConnectEmailForm-BEv-7qU9.js +1 -0
  18. package/dist/cjs/ConnectLedgerScreen-DBYExlWR.js +1 -0
  19. package/dist/cjs/ConnectOnlyLandingScreen-bOhkl0xJ.js +1 -0
  20. package/dist/cjs/ConnectOnlyStatusScreen-DvTrLHyY.js +1 -0
  21. package/dist/cjs/ConnectOrCreateScreen-Dh4EFU5N.js +1 -0
  22. package/dist/cjs/ConnectPhoneForm-DK-bg2D5.js +1 -0
  23. package/dist/cjs/ConnectWalletView-4vj7Sq7-.js +1 -0
  24. package/dist/cjs/ConnectionStatusScreen-Ct-KTCXS.js +1 -0
  25. package/dist/cjs/CopyToClipboard-fd8Z3kQX.js +1 -0
  26. package/dist/cjs/CrossAppAuthScreen-B-DtA7IH.js +1 -0
  27. package/dist/cjs/CustomLandingScreenView-tt_NEfU6.js +2 -0
  28. package/dist/cjs/DelegatedActionsConsentScreen-B5WlYn7z.js +1 -0
  29. package/dist/cjs/DelegatedActionsRevokeScreen-2g_ydX-Y.js +1 -0
  30. package/dist/cjs/EmailInputForm-tjrhBacA.js +1 -0
  31. package/dist/cjs/EmbeddedWalletConnectingScreen-9seYvsTF.js +1 -0
  32. package/dist/cjs/EmbeddedWalletCreatedScreen-PycFyIz6.js +1 -0
  33. package/dist/cjs/EmbeddedWalletKeyExportScreen-BDTDQY1f.js +2 -0
  34. package/dist/cjs/EmbeddedWalletOnAccountCreateScreen-B0tXEtG9.js +1 -0
  35. package/dist/cjs/EmbeddedWalletPasswordUpdateScreen-ZfgU86hx.js +1 -0
  36. package/dist/cjs/EmbeddedWalletPasswordUpdateSplashScreen-tP8rSVUL.js +1 -0
  37. package/dist/cjs/EnrollTotp-DZ5fIrXr.js +1 -0
  38. package/dist/cjs/ErrorBanner-CMjaobRI.js +1 -0
  39. package/dist/cjs/ErrorMessage-f0cRWc29.js +1 -0
  40. package/dist/cjs/ErrorScreen-Cob9AO30.js +1 -0
  41. package/dist/cjs/FarcasterConnectStatusScreen-C5FoWA6N.js +2 -0
  42. package/dist/cjs/FarcasterSignerStatusScreen-CDYkqsxz.js +2 -0
  43. package/dist/cjs/FundSolWalletWithExternalSolanaWallet-DC_xoE6W.js +2 -0
  44. package/dist/cjs/FundWalletMethodHeader-zYWhBIiS.js +1 -0
  45. package/dist/cjs/FundingEditAmountScreen-BB7-k00c.js +1 -0
  46. package/dist/cjs/FundingMethodSelectionScreen-BrV94GD2.js +1 -0
  47. package/dist/cjs/InAppBrowserLoginNotPossible-y8g07-kU.js +1 -0
  48. package/dist/cjs/InfoBanner-CTx1eRnV.js +1 -0
  49. package/dist/cjs/InjectedWalletIcon-UY3nMvZo.js +1 -0
  50. package/dist/cjs/InstallWalletScreen-CmGi6mS1.js +1 -0
  51. package/dist/cjs/JsonTree-xaeo0q6z.js +1 -0
  52. package/dist/cjs/LabelXs-CYMv6rOZ.js +1 -0
  53. package/dist/cjs/LandingScreen-B9jb8n_d.js +1 -0
  54. package/dist/cjs/Layouts-dRL0OSpp.js +1 -0
  55. package/dist/cjs/Link-DmzPZ_M7.js +1 -0
  56. package/dist/cjs/LinkConflictScreen-BJXyOu2J.js +1 -0
  57. package/dist/cjs/LinkEmailScreen-zyJFrvy-.js +1 -0
  58. package/dist/cjs/LinkPasskeyScreen-Bw7Xs741.js +1 -0
  59. package/dist/cjs/LinkPhoneScreen-C4JQblY3.js +1 -0
  60. package/dist/cjs/LoadingSkeleton-DoCrfGnl.js +1 -0
  61. package/dist/cjs/LoginFailedScreen-CGT-2B2h.js +1 -0
  62. package/dist/cjs/ManualTransferScreen-DPz98CSt.js +1 -0
  63. package/dist/cjs/MfaAuthEnrollmentFlowScreen-BBKMKDGR.js +1 -0
  64. package/dist/cjs/MfaAuthVerifyFlowScreen-3LKUo_xV.js +1 -0
  65. package/dist/cjs/MfaEnrollmentFlowScreen-B2YgNRCC.js +1 -0
  66. package/dist/cjs/MfaVerifyFlowScreen-BhVqkM2f.js +1 -0
  67. package/dist/cjs/ModalHeader-DbV81e3m.js +3 -0
  68. package/dist/cjs/MoonpayStatusScreen-yghPhz7v.js +1 -0
  69. package/dist/cjs/NetworkIcon-BZ9Mj6vV.js +1 -0
  70. package/dist/cjs/OAuthStatusScreen-q9MFItPT.js +1 -0
  71. package/dist/cjs/OpenLink-BpCUf9iR.js +1 -0
  72. package/dist/cjs/PasskeySelectSignupOrLogin-BKBH0QxK.js +1 -0
  73. package/dist/cjs/PasskeyStatusScreen-DVx4lzwq.js +1 -0
  74. package/dist/cjs/PasswordRecoveryScreen-BmGdXVfh.js +1 -0
  75. package/dist/cjs/PinInput-DSI6rjOn.js +1 -0
  76. package/dist/cjs/QrCode-Ua_0cVUP.js +2 -0
  77. package/dist/cjs/RecoveryOAuthStatusScreen-DUobwBXF.js +1 -0
  78. package/dist/cjs/RecoveryPasswordCreateScreen-vQG4ErlF.js +1 -0
  79. package/dist/cjs/RecoverySelectionScreen-E2l_NO8y.js +1 -0
  80. package/dist/cjs/Row-CxDF-VMy.js +1 -0
  81. package/dist/cjs/Screen-65eQbiHD.js +9 -0
  82. package/dist/cjs/ScreenHeader-CyURV6Ti.js +2 -0
  83. package/dist/cjs/ScreenLayout-B_60rKhZ.js +1 -0
  84. package/dist/cjs/SetAutomaticRecoveryScreen-DQolobOz.js +1 -0
  85. package/dist/cjs/SetWalletPasswordForm-8g-lawop.js +2 -0
  86. package/dist/cjs/SignRequestScreen-BAgmmVVW.js +1 -0
  87. package/dist/cjs/StackedContainer-ByB6Mdu0.js +1 -0
  88. package/dist/cjs/StandardSignAndSendTransactionScreen-BUB57iWU.js +1 -0
  89. package/dist/cjs/Subtitle-Dtmrw8l5.js +1 -0
  90. package/dist/cjs/TelegramAuthScreen-D5uhx6WN.js +1 -0
  91. package/dist/cjs/Title-C-tHJvrb.js +1 -0
  92. package/dist/cjs/TodoList-Cm_a93ef.js +2 -0
  93. package/dist/cjs/TransactionDetails-BefABtVQ.js +3 -0
  94. package/dist/cjs/TransactionErrorView-QKWh4urc.js +2 -0
  95. package/dist/cjs/TransferFromWalletScreen-C_0IpL-A.js +1 -0
  96. package/dist/cjs/TransferOrBridgeLoadingScreen-C6t1_cTP.js +1 -0
  97. package/dist/cjs/UpdateEmailScreen-BUAgWudx.js +1 -0
  98. package/dist/cjs/UpdatePhoneScreen-DefnuTEZ.js +1 -0
  99. package/dist/cjs/UserLimitReachedScreen-B76r_-LC.js +1 -0
  100. package/dist/cjs/Value-C-XtZyFa.js +1 -0
  101. package/dist/cjs/WalletButtonList-bICzXZXM.js +1 -0
  102. package/dist/cjs/WalletCards-BfpeHH5n.js +1 -0
  103. package/dist/cjs/WalletInfoCard-CscdnrUV.js +1 -0
  104. package/dist/cjs/WalletInterstitialScreen-CG1k3EvV.js +1 -0
  105. package/dist/cjs/WalletLink-DF6dDjkz.js +3 -0
  106. package/dist/cjs/WarningBanner-B_Gs_15p.js +1 -0
  107. package/dist/cjs/abstract-smart-wallets.js +1 -1
  108. package/dist/cjs/analytics-C6C_4JmG.js +1 -0
  109. package/dist/cjs/capitalizeFirstLetter-D-K8mqBm.js +1 -0
  110. package/dist/cjs/context-JUEgi5-6.js +1 -0
  111. package/dist/cjs/copy-BiZ7dtqy.js +1 -0
  112. package/dist/cjs/ethers-uj8IknV_.js +1 -0
  113. package/dist/cjs/events-context-Di6--rDg.js +1 -0
  114. package/dist/cjs/extended-chains.js +1 -1
  115. package/dist/cjs/farcaster-CWHXGAib.js +1 -0
  116. package/dist/cjs/farcaster.js +1 -1
  117. package/dist/cjs/formatErc20TokenAmount-DxwoWe7e.js +1 -0
  118. package/dist/cjs/frame-bPqBJ8fS.js +1 -0
  119. package/dist/cjs/get-is-unified-wallet-DmiciSes.js +1 -0
  120. package/dist/cjs/getChainName-C4rO8-3n.js +1 -0
  121. package/dist/cjs/getErc20Balance-BZ5-OGfD.js +1 -0
  122. package/dist/cjs/getErc20TokenInfo-HX7DgcWx.js +1 -0
  123. package/dist/cjs/getFormattedUsdFromLamports-Mu2fqwL2.js +1 -0
  124. package/dist/cjs/getPublicClient-EjAv8R2z.js +1 -0
  125. package/dist/cjs/getUsdcMintAddress-REYZSOb9.js +1 -0
  126. package/dist/cjs/index-BNNk54gK.js +1 -0
  127. package/dist/cjs/index-CRFXS9pP.js +1 -0
  128. package/dist/cjs/index-Cuv6j_Y0.js +1 -0
  129. package/dist/cjs/index-DvDeCr_m.js +5 -0
  130. package/dist/cjs/index.js +1 -6
  131. package/dist/cjs/internal-context-VDPFkIXN.js +1 -0
  132. package/dist/cjs/internal.js +1 -1
  133. package/dist/cjs/paths-DizMb-lU.js +1 -0
  134. package/dist/cjs/prepareFundingModalData-BVlyr8l5.js +1 -0
  135. package/dist/cjs/reservoir-3I-Vkf2B.js +1 -0
  136. package/dist/cjs/shared-BPGwTh8c.js +1 -0
  137. package/dist/cjs/shared-CT5ocsPG.js +1 -0
  138. package/dist/cjs/shouldProceedtoEmbeddedWalletCreationFlow-DcjqezwI.js +1 -0
  139. package/dist/cjs/smart-wallets-B7vHjGAW.js +1 -0
  140. package/dist/cjs/smart-wallets.js +1 -1
  141. package/dist/cjs/solana.js +1 -1
  142. package/dist/cjs/styles-Ca_DS00a.js +1 -0
  143. package/dist/cjs/styles-D4VeJNv1.js +1 -0
  144. package/dist/cjs/telegram-D3O0_F1a.js +1 -0
  145. package/dist/cjs/to-ui-error-a-xwbRKZ.js +1 -0
  146. package/dist/cjs/transaction-DjF5X-by.js +1 -0
  147. package/dist/cjs/transfer-Cit146vy.js +1 -0
  148. package/dist/cjs/twitch-BNvhZb2Y.js +1 -0
  149. package/dist/cjs/twitter-BVVRWkcG.js +1 -0
  150. package/dist/cjs/ui.js +2 -2
  151. package/dist/cjs/use-create-wallet-without-fallback-DSOJS4h0.js +1 -0
  152. package/dist/cjs/use-export-wallet-BRFTskbr.js +1 -0
  153. package/dist/cjs/{use-sign-with-user-signer-BtJVKMQr.js → use-sign-with-user-signer-On9f1Fag.js} +1 -1
  154. package/dist/cjs/useActiveWallet-DcxqWAsq.js +1 -0
  155. package/dist/cjs/useGetSolPrice-eOpcFeNE.js +1 -0
  156. package/dist/cjs/useGetTokenPrice-EcT0H5rf.js +1 -0
  157. package/dist/cjs/useI18n-hYSvbQCq.js +1 -0
  158. package/dist/cjs/usePrivy-CXPeoT5g.js +1 -0
  159. package/dist/cjs/useSolanaRpcClient-mfV88iJm.js +1 -0
  160. package/dist/cjs/useWalletBalance-CQAgfkRc.js +1 -0
  161. package/dist/cjs/useWallets-TxPVNWGS.js +1 -0
  162. package/dist/cjs/useWallets-h2xCj02C.js +1 -0
  163. package/dist/dts/{events-context-CCElA92Y.d.mts → events-context-CkFXl3uc.d.mts} +1 -1
  164. package/dist/dts/{events-context-CCElA92Y.d.ts → events-context-CkFXl3uc.d.ts} +1 -1
  165. package/dist/dts/extended-chains.d.mts +1 -1
  166. package/dist/dts/extended-chains.d.ts +1 -1
  167. package/dist/dts/farcaster.d.mts +1 -1
  168. package/dist/dts/farcaster.d.ts +1 -1
  169. package/dist/dts/index.d.mts +11 -9
  170. package/dist/dts/index.d.ts +11 -9
  171. package/dist/dts/internal.d.mts +1 -1
  172. package/dist/dts/internal.d.ts +1 -1
  173. package/dist/dts/smart-wallets.d.mts +1 -1
  174. package/dist/dts/smart-wallets.d.ts +1 -1
  175. package/dist/dts/solana.d.mts +3 -3
  176. package/dist/dts/solana.d.ts +3 -3
  177. package/dist/dts/ui.d.mts +1 -1
  178. package/dist/dts/ui.d.ts +1 -1
  179. package/dist/esm/AccountNotFoundScreen-CmhSsknC.mjs +1 -0
  180. package/dist/esm/Address-DtXA0OPS.mjs +1 -0
  181. package/dist/esm/AffirmativeConsentScreen-C6AcYU94.mjs +1 -0
  182. package/dist/esm/AllowlistRejectionScreen-BuH5iBJ3.mjs +1 -0
  183. package/dist/esm/AuthenticateWithWalletScreen-CKJqrLEm.mjs +1 -0
  184. package/dist/esm/AwaitingEvmToSolBridgingScreen-DuO5iRV2.mjs +2 -0
  185. package/dist/esm/AwaitingExternalEthereumTransferScreen-C50_Dj-N.mjs +2 -0
  186. package/dist/esm/AwaitingPasswordlessCodeScreen-Bb0UxW46.mjs +1 -0
  187. package/dist/esm/AwaitingSolToEvmBridgingScreen-YsM6M4T9.mjs +2 -0
  188. package/dist/esm/BridgeNetworkSelectionView-Bu0vi9_a.mjs +1 -0
  189. package/dist/esm/Button-DJ-mtuuD.mjs +2 -0
  190. package/dist/esm/CaptchaScreen-CWQAXaCK.mjs +1 -0
  191. package/dist/esm/Checkbox-NmGCZeKL.mjs +1 -0
  192. package/dist/esm/Chip-Bsgj4Yc-.mjs +1 -0
  193. package/dist/esm/CoinbaseOnrampStatusScreen-NdySyA5D.mjs +1 -0
  194. package/dist/esm/Column-DQ5Vw9t1.mjs +1 -0
  195. package/dist/esm/ConnectEmailForm-DUgOCS2V.mjs +1 -0
  196. package/dist/esm/ConnectLedgerScreen-3wp1wuP2.mjs +1 -0
  197. package/dist/esm/ConnectOnlyLandingScreen-BVkcUaO6.mjs +1 -0
  198. package/dist/esm/ConnectOnlyStatusScreen-CyT_IEgy.mjs +1 -0
  199. package/dist/esm/ConnectOrCreateScreen-BlIxCxVJ.mjs +1 -0
  200. package/dist/esm/ConnectPhoneForm-CbuSfwAI.mjs +1 -0
  201. package/dist/esm/ConnectWalletView-DVDOSzi0.mjs +1 -0
  202. package/dist/esm/ConnectionStatusScreen-DNdZyKcL.mjs +1 -0
  203. package/dist/esm/CopyToClipboard-DatKc59_.mjs +1 -0
  204. package/dist/esm/CrossAppAuthScreen-DEF_slEx.mjs +1 -0
  205. package/dist/esm/CustomLandingScreenView-DWt9lv8W.mjs +2 -0
  206. package/dist/esm/DelegatedActionsConsentScreen-DqeBCJkz.mjs +1 -0
  207. package/dist/esm/DelegatedActionsRevokeScreen-B-xLCB1j.mjs +1 -0
  208. package/dist/esm/EmailInputForm-B4hjCxRU.mjs +1 -0
  209. package/dist/esm/EmbeddedWalletConnectingScreen-BCg7qeI6.mjs +1 -0
  210. package/dist/esm/EmbeddedWalletCreatedScreen-jGepSDyo.mjs +1 -0
  211. package/dist/esm/EmbeddedWalletKeyExportScreen-DX22sVNh.mjs +2 -0
  212. package/dist/esm/EmbeddedWalletOnAccountCreateScreen-hkifQ988.mjs +1 -0
  213. package/dist/esm/EmbeddedWalletPasswordUpdateScreen-CezgHp88.mjs +1 -0
  214. package/dist/esm/EmbeddedWalletPasswordUpdateSplashScreen-BFamfPb_.mjs +1 -0
  215. package/dist/esm/EnrollTotp-BzAm1Ya4.mjs +1 -0
  216. package/dist/esm/ErrorBanner-BdiArMwu.mjs +1 -0
  217. package/dist/esm/ErrorMessage-Cx8GKGhL.mjs +1 -0
  218. package/dist/esm/ErrorScreen-DFAo4S7A.mjs +1 -0
  219. package/dist/esm/FarcasterConnectStatusScreen-Ys1uAk-s.mjs +1 -0
  220. package/dist/esm/FarcasterSignerStatusScreen-DIfmv7Ft.mjs +1 -0
  221. package/dist/esm/FundSolWalletWithExternalSolanaWallet-CkEgl8wO.mjs +1 -0
  222. package/dist/esm/FundWalletMethodHeader-CbTaIDLQ.mjs +1 -0
  223. package/dist/esm/FundingEditAmountScreen-Cz4tmsMX.mjs +1 -0
  224. package/dist/esm/FundingMethodSelectionScreen-fBauGI0K.mjs +1 -0
  225. package/dist/esm/InAppBrowserLoginNotPossible-DBhsoAkw.mjs +1 -0
  226. package/dist/esm/InfoBanner-D6C6Bt8L.mjs +1 -0
  227. package/dist/esm/InjectedWalletIcon-DLcYOGDj.mjs +1 -0
  228. package/dist/esm/InstallWalletScreen-CEcl2LHj.mjs +1 -0
  229. package/dist/esm/JsonTree-Bvd2C29R.mjs +1 -0
  230. package/dist/esm/LabelXs-BOisBtqT.mjs +1 -0
  231. package/dist/esm/LandingScreen-BvRIrtFN.mjs +1 -0
  232. package/dist/esm/Layouts-Bmf8DxNP.mjs +1 -0
  233. package/dist/esm/Link-DwjLfHwW.mjs +1 -0
  234. package/dist/esm/LinkConflictScreen-Bg9QTrJX.mjs +1 -0
  235. package/dist/esm/LinkEmailScreen-SlCMvM43.mjs +1 -0
  236. package/dist/esm/LinkPasskeyScreen-CNFL2N09.mjs +1 -0
  237. package/dist/esm/LinkPhoneScreen-DnPAvact.mjs +1 -0
  238. package/dist/esm/LoadingSkeleton-CHdaq3pb.mjs +1 -0
  239. package/dist/esm/LoginFailedScreen-CkxfR75o.mjs +1 -0
  240. package/dist/esm/ManualTransferScreen-px_MUbVh.mjs +1 -0
  241. package/dist/esm/MfaAuthEnrollmentFlowScreen-RbHifi_a.mjs +1 -0
  242. package/dist/esm/MfaAuthVerifyFlowScreen-B3SIiFnH.mjs +1 -0
  243. package/dist/esm/MfaEnrollmentFlowScreen-LgmZFVEZ.mjs +1 -0
  244. package/dist/esm/MfaVerifyFlowScreen-DZkVptvz.mjs +1 -0
  245. package/dist/esm/ModalHeader-D7WajfD8.mjs +3 -0
  246. package/dist/esm/MoonpayStatusScreen-CBc4DLDR.mjs +1 -0
  247. package/dist/esm/NetworkIcon-B48ilzF8.mjs +1 -0
  248. package/dist/esm/OAuthStatusScreen-DvD84FHd.mjs +1 -0
  249. package/dist/esm/OpenLink-BpeNYBKs.mjs +1 -0
  250. package/dist/esm/PasskeySelectSignupOrLogin-DZP4Hj5r.mjs +1 -0
  251. package/dist/esm/PasskeyStatusScreen-bP3yfXNt.mjs +1 -0
  252. package/dist/esm/PasswordRecoveryScreen-Bt_Cf8-l.mjs +1 -0
  253. package/dist/esm/PinInput-C3_MNxMt.mjs +1 -0
  254. package/dist/esm/QrCode-zzqjquVm.mjs +2 -0
  255. package/dist/esm/RecoveryOAuthStatusScreen-y6_gmb9s.mjs +1 -0
  256. package/dist/esm/RecoveryPasswordCreateScreen-CloUjFKm.mjs +1 -0
  257. package/dist/esm/RecoverySelectionScreen-FxCwz-PR.mjs +1 -0
  258. package/dist/esm/Row-CG0lSY5Z.mjs +1 -0
  259. package/dist/esm/Screen-dwi2CitY.mjs +8 -0
  260. package/dist/esm/ScreenHeader-Biz1wq02.mjs +2 -0
  261. package/dist/esm/ScreenLayout-Dmrhdwtt.mjs +1 -0
  262. package/dist/esm/SetAutomaticRecoveryScreen-Db5Xg_sQ.mjs +1 -0
  263. package/dist/esm/SetWalletPasswordForm-ZtRqoZYj.mjs +2 -0
  264. package/dist/esm/SignRequestScreen-DdAK4SlJ.mjs +1 -0
  265. package/dist/esm/StackedContainer-BrIQsdas.mjs +1 -0
  266. package/dist/esm/StandardSignAndSendTransactionScreen-C0IrbkCx.mjs +1 -0
  267. package/dist/esm/Subtitle-DkvfP2Ev.mjs +1 -0
  268. package/dist/esm/TelegramAuthScreen-vp2lrJFZ.mjs +1 -0
  269. package/dist/esm/Title-D0pfZff-.mjs +1 -0
  270. package/dist/esm/TodoList-Dn0Qu-vv.mjs +2 -0
  271. package/dist/esm/TransactionDetails-fgHkAnf9.mjs +3 -0
  272. package/dist/esm/TransactionErrorView-Dgp1KSy5.mjs +2 -0
  273. package/dist/esm/TransferFromWalletScreen-CTAGaF9C.mjs +1 -0
  274. package/dist/esm/TransferOrBridgeLoadingScreen-D3vBwM_o.mjs +1 -0
  275. package/dist/esm/UpdateEmailScreen-BBtChP9Q.mjs +1 -0
  276. package/dist/esm/UpdatePhoneScreen-Byn7UW7u.mjs +1 -0
  277. package/dist/esm/UserLimitReachedScreen-DXDqdBpt.mjs +1 -0
  278. package/dist/esm/Value-B4M62ove.mjs +1 -0
  279. package/dist/esm/WalletButtonList-CGloXTN0.mjs +1 -0
  280. package/dist/esm/WalletCards-DH1rqayz.mjs +1 -0
  281. package/dist/esm/WalletInfoCard-DAv0WFcc.mjs +1 -0
  282. package/dist/esm/WalletInterstitialScreen-CKiSWjpa.mjs +1 -0
  283. package/dist/esm/WalletLink-CjuEskpb.mjs +3 -0
  284. package/dist/esm/WarningBanner-BDp-QC9i.mjs +1 -0
  285. package/dist/esm/abstract-smart-wallets.mjs +1 -1
  286. package/dist/esm/analytics-mkkvFRju.mjs +1 -0
  287. package/dist/esm/capitalizeFirstLetter-DmLYqXsO.mjs +1 -0
  288. package/dist/esm/{events-context-ClaboIDc.mjs → context-Cb5MFcME.mjs} +1 -1
  289. package/dist/esm/copy-Bx2Jwc5_.mjs +1 -0
  290. package/dist/esm/ethers-CpMSCMOg.mjs +1 -0
  291. package/dist/esm/events-context-CI0iqAXA.mjs +1 -0
  292. package/dist/esm/extended-chains.mjs +1 -1
  293. package/dist/esm/farcaster-DPlSjvF5.mjs +1 -0
  294. package/dist/esm/farcaster.mjs +1 -1
  295. package/dist/esm/formatErc20TokenAmount-BuPk9xcy.mjs +1 -0
  296. package/dist/esm/frame-BMa3kyjk.mjs +1 -0
  297. package/dist/esm/get-is-unified-wallet-DymQMSJy.mjs +1 -0
  298. package/dist/esm/getChainName-DjpPdUSc.mjs +1 -0
  299. package/dist/esm/getErc20Balance-Dtau1386.mjs +1 -0
  300. package/dist/esm/getErc20TokenInfo-CKA_MDcy.mjs +1 -0
  301. package/dist/esm/getFormattedUsdFromLamports-B6EqSEho.mjs +1 -0
  302. package/dist/esm/getPublicClient-IxRndou_.mjs +1 -0
  303. package/dist/esm/getUsdcMintAddress-DFI1hv05.mjs +1 -0
  304. package/dist/esm/index-B_e8abKi.mjs +1 -0
  305. package/dist/esm/index-CI666IP9.mjs +5 -0
  306. package/dist/esm/index-CJMgUOnw.mjs +1 -0
  307. package/dist/esm/index-DdlRJsoj.mjs +1 -0
  308. package/dist/esm/index.mjs +1 -5
  309. package/dist/esm/internal-context-Cvo1WmWN.mjs +1 -0
  310. package/dist/esm/internal.mjs +1 -1
  311. package/dist/esm/paths-3HW55qZg.mjs +1 -0
  312. package/dist/esm/prepareFundingModalData-BUyu5Vhr.mjs +1 -0
  313. package/dist/esm/reservoir-B0V48m2I.mjs +1 -0
  314. package/dist/esm/shared-CtYf3O54.mjs +1 -0
  315. package/dist/esm/shared-DsP7M4P5.mjs +1 -0
  316. package/dist/esm/shouldProceedtoEmbeddedWalletCreationFlow-CxerhsH3.mjs +1 -0
  317. package/dist/esm/smart-wallets-Cbhn7qlU.mjs +1 -0
  318. package/dist/esm/smart-wallets.mjs +1 -1
  319. package/dist/esm/solana.mjs +1 -1
  320. package/dist/esm/styles-BxA7nKxI.mjs +1 -0
  321. package/dist/esm/styles-DY17fuAX.mjs +1 -0
  322. package/dist/esm/telegram-B-JqnkqZ.mjs +1 -0
  323. package/dist/esm/to-ui-error-B3m2hl6e.mjs +1 -0
  324. package/dist/esm/transaction-CnfuREWo.mjs +1 -0
  325. package/dist/esm/transfer-CMPmjPsM.mjs +1 -0
  326. package/dist/esm/twitch-5IOe4sIQ.mjs +1 -0
  327. package/dist/esm/twitter-6jomarO4.mjs +1 -0
  328. package/dist/esm/ui.mjs +2 -2
  329. package/dist/esm/use-create-wallet-without-fallback-DodUf3VP.mjs +1 -0
  330. package/dist/esm/use-export-wallet-CWslDKqf.mjs +1 -0
  331. package/dist/esm/use-sign-with-user-signer-LJ6ROduD.mjs +1 -0
  332. package/dist/esm/useActiveWallet-hrZcON-K.mjs +1 -0
  333. package/dist/esm/useGetSolPrice-Bi0pPiUW.mjs +1 -0
  334. package/dist/esm/useGetTokenPrice-B4XVfxeD.mjs +1 -0
  335. package/dist/esm/useI18n-ByKvnaXP.mjs +1 -0
  336. package/dist/esm/usePrivy-D3OPY7tm.mjs +1 -0
  337. package/dist/esm/useSolanaRpcClient-DjD2ma5c.mjs +1 -0
  338. package/dist/esm/useWalletBalance-Xca4-c_r.mjs +1 -0
  339. package/dist/esm/useWallets-BplPx0Pz.mjs +1 -0
  340. package/dist/esm/useWallets-CQMJYOF9.mjs +1 -0
  341. package/package.json +15 -9
  342. package/dist/cjs/EmbeddedWalletConnectingScreen-JRafXI8d.js +0 -27
  343. package/dist/cjs/SignRequestScreen-Dy02euV9.js +0 -1
  344. package/dist/cjs/events-context-7-Gs8c_9.js +0 -1
  345. package/dist/cjs/frame-B2orQ_lK.js +0 -1
  346. package/dist/cjs/internal-context-CeWKmK5u.js +0 -1
  347. package/dist/cjs/smart-wallets-DaqaXBrW.js +0 -1
  348. package/dist/cjs/use-export-wallet-Cz8MVlvJ.js +0 -2
  349. package/dist/cjs/useActiveWallet-C5D3a-je.js +0 -1
  350. package/dist/cjs/usePrivy-BdYU4BZI.js +0 -1
  351. package/dist/esm/EmbeddedWalletConnectingScreen-D50stmJi.mjs +0 -25
  352. package/dist/esm/SignRequestScreen-D9o7VhNz.mjs +0 -1
  353. package/dist/esm/frame-Dj70FEYB.mjs +0 -1
  354. package/dist/esm/internal-context-eGSwROSk.mjs +0 -1
  355. package/dist/esm/smart-wallets-BXT3GZwg.mjs +0 -1
  356. package/dist/esm/use-export-wallet-DTiEdSYz.mjs +0 -1
  357. package/dist/esm/use-sign-with-user-signer-DaTvrd5T.mjs +0 -1
  358. package/dist/esm/useActiveWallet-B8DSbnuu.mjs +0 -1
  359. package/dist/esm/usePrivy-BCcRF869.mjs +0 -1
  360. package/dist/dts/{types-B6UNnZ2P.d.mts → types-BkkvIRg5.d.mts} +134 -134
  361. package/dist/dts/{types-B6UNnZ2P.d.ts → types-BkkvIRg5.d.ts} +134 -134
@@ -1,25 +0,0 @@
1
- import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import{CheckCircle as a,HelpCircle as i,Check as r,Copy as o,AlertTriangle as l,Phone as s,Lock as c,XCircle as d,FileCheck as p,ExternalLink as h,ArrowRightLeft as u,Wallet as m,X as g,FingerprintIcon as y,Smartphone as f,UserCircle as w,Mail as v}from"lucide-react";import b,{useContext as C,createContext as x,useRef as k,useState as T,useMemo as A,useEffect as I,useCallback as S,useReducer as N,forwardRef as E}from"react";import{P as _,f as M,x as W,ab as L,h as P,ad as F,ah as D,ai as R,aa as O,aj as U,ak as B,al as z,G as V,am as H,ac as j,an as $}from"./internal-context-eGSwROSk.mjs";import{C as q,S as G,k as Z,w as Q,x as Y,y as K,l as X,z as J,n as ee,p as te,o as ne,u as ae,v as ie,M as re,A as oe,B as le,E as se}from"./events-context-ClaboIDc.mjs";import{createPublicClient as ce,http as de,getAddress as pe,isAddress as he,formatEther as ue,formatUnits as me,isHex as ge,toHex as ye,decodeFunctionData as fe,decodeAbiParameters as we,createWalletClient as ve,custom as be,publicActions as Ce,parseEther as xe,encodeFunctionData as ke}from"viem";import Te from"fast-password-entropy";import*as Ae from"secure-password-utilities";import{DEFAULT_WORDLIST as Ie}from"secure-password-utilities/wordlists";import Se from"@heroicons/react/24/outline/UserCircleIcon";import{styled as Ne,css as Ee,keyframes as _e}from"styled-components";import Me from"@heroicons/react/24/outline/ArrowLeftIcon";import"@heroicons/react/24/outline/ArrowRightIcon";import We from"@heroicons/react/24/outline/QuestionMarkCircleIcon";import Le from"@heroicons/react/24/outline/XMarkIcon";import Pe from"@heroicons/react/20/solid/CheckIcon";import Fe from"@heroicons/react/24/outline/EnvelopeIcon";import De from"@heroicons/react/24/outline/PhoneIcon";import*as Re from"react-device-detect";import{isMobile as Oe,isIOS as Ue}from"react-device-detect";import Be from"@heroicons/react/24/outline/ExclamationTriangleIcon";import ze from"@heroicons/react/24/outline/WalletIcon";import Ve from"@heroicons/react/24/outline/ExclamationCircleIcon";import He from"@heroicons/react/24/outline/Square2StackIcon";import{ProviderErrors as je,ConnectedStandardSolanaWallet as $e,addToDefaultChains as qe,create as Ge,formatTokenAmount as Ze,formatWeiAmount as Qe,getJsonRpcEndpointFromChain as Ye,UsdcAddressMap as Ke,zora as Xe,polygon as Je,optimism as et,mainnet as tt,linea as nt,celo as at,base as it,avalanche as rt,arbitrum as ot,formatWalletAddress as lt,toCoinbaseAssetId as st,getCoinbaseOnRampUrl as ct,chainToMoonpayCurrency as dt,isSupportedChainIdForMoonpay as pt,isSupportedChainIdForCoinbaseOnramp as ht,countryCodesAndNumbers as ut,validatePhoneNumber as mt,phoneNumberTypingFormatter as gt,getPlaceholderPhoneNumber as yt,getCountryCallingCode as ft,getPhoneCountryCodeAndNumber as wt,formatPhoneNumber as vt,toObjectKeys as bt}from"@privy-io/js-sdk-core";import{create as Ct}from"zustand";import{MagnifyingGlassIcon as xt,BoltIcon as kt,ArrowRightIcon as Tt,ChevronDownIcon as At}from"@heroicons/react/24/outline";import{useVirtualizer as It}from"@tanstack/react-virtual";import St from"@heroicons/react/24/outline/CheckIcon";import Nt from"qrcode";import{getAddress as Et,toHex as _t}from"viem/utils";import Mt from"eventemitter3";import{base64 as Wt}from"@scure/base";import{EthereumProvider as Lt,OPTIONAL_METHODS as Pt,OPTIONAL_EVENTS as Ft}from"@walletconnect/ethereum-provider";import Dt from"@heroicons/react/24/outline/CreditCardIcon";import Rt from"@heroicons/react/24/outline/QrCodeIcon";import Ot from"@heroicons/react/24/solid/ArrowsRightLeftIcon";import Ut from"@heroicons/react/24/outline/InformationCircleIcon";import Bt from"@heroicons/react/24/outline/ClipboardDocumentCheckIcon";import zt from"@heroicons/react/24/outline/ClipboardDocumentIcon";import Vt from"@heroicons/react/24/outline/ChevronDownIcon";import{toViemTransactionSerializable as Ht,STRING_TO_NUMBER_TXN_TYPE as jt}from"@privy-io/ethereum";import $t from"@heroicons/react/24/outline/CheckCircleIcon";import qt from"@heroicons/react/24/outline/GlobeAltIcon";import{Menu as Gt,MenuButton as Zt,MenuItems as Qt,MenuItem as Yt}from"@headlessui/react";import{trigger as Kt}from"@privy-io/popup";import Xt from"@heroicons/react/24/solid/CheckCircleIcon";import{ofetch as Jt}from"ofetch";import en from"@heroicons/react/24/outline/FingerPrintIcon";import tn from"@heroicons/react/24/outline/LockClosedIcon";import nn from"@heroicons/react/24/outline/PencilSquareIcon";import{base64url as an}from"jose";import rn from"@heroicons/react/24/outline/ArrowPathIcon";import on from"@heroicons/react/24/outline/EyeIcon";import ln from"@heroicons/react/24/outline/EyeSlashIcon";import sn from"@heroicons/react/24/outline/KeyIcon";import cn from"@heroicons/react/24/outline/ArrowDownTrayIcon";import dn from"@heroicons/react/24/outline/DocumentDuplicateIcon";import pn from"@heroicons/react/24/solid/XCircleIcon";import hn from"@heroicons/react/24/outline/ShieldCheckIcon";import{constructURL as un}from"@privy-io/urls";class mn{get(e){let t=localStorage.getItem(e);return null===t?void 0:JSON.parse(t)}put(e,t){void 0!==t?localStorage.setItem(e,JSON.stringify(t)):this.del(e)}del(e){localStorage.removeItem(e)}getKeys(){return Object.entries(localStorage).map((([e])=>e))}}function gn(){try{let e="privy:__session_storage__test",t=new mn;return t.put(e,"blobby"),t.del(e),!0}catch(e){return!1}}var yn="undefined"!=typeof window&&window.localStorage?new mn:new class{get(e){return this._cache[e]}put(e,t){void 0!==t?this._cache[e]=t:this.del(e)}del(e){delete this._cache[e]}getKeys(){return Object.keys(this._cache)}constructor(){this._cache={}}};function fn(e){return{name:e.metadata?.shortName||e.name||"",universalLink:e.mobile.universal,deepLink:e.mobile.native}}function wn(e,t){let n=fn(t);if(n.universalLink)return xn(n.universalLink,e)}let vn="WALLETCONNECT_DEEPLINK_CHOICE";function bn(e){return e.startsWith("http://")||e.startsWith("https://")}function Cn(e,t){if(bn(e))return xn(e,t);let n=e;return n.includes("://")||(n=e.replaceAll("/","").replaceAll(":",""),n=`${n}://`),n.endsWith("/")||(n=`${n}/`),{redirect:`${n}wc?uri=${encodeURIComponent(t)}`,href:n}}function xn(e,t){if(!bn(e))return Cn(e,t);let n=e;return n.endsWith("/")||(n=`${n}/`),{redirect:`${n}wc?uri=${encodeURIComponent(t)}`,href:n}}function kn(e,t){window.open(e,t,"noreferrer noopener")}class Tn{execute(e){return null===this.promise&&(this.promise=(async()=>{try{return await this.fn(e)}finally{this.promise=null}})()),this.promise}constructor(e){this.promise=null,this.fn=e}}function An(e){return crypto.getRandomValues(new Uint8Array(e))}function In(){return an.encode(An(36))}function Sn(){return In()}async function Nn(e,t="S256"){if("S256"!=t)return e;{let t=await async function(e){let t=(new TextEncoder).encode(e);return new Uint8Array(await crypto.subtle.digest("SHA-256",t))}(e);return an.encode(t)}}function En(){let e=yn.get(q);if(!e)throw new _("Authentication error.");return e}function _n(e){return e.charAt(0).toUpperCase()+e.slice(1)}function Mn(e){return"string"==typeof e&&/^custom:[a-zA-Z0-9_-]+$/i.test(e)}const Wn=({style:n,...a})=>/*#__PURE__*/e("svg",{width:"33",height:"32",viewBox:"0 0 33 32",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:{height:"24px",...n},...a,children:[/*#__PURE__*/t("rect",{x:"0.5",width:"32",height:"32",rx:"4",fill:"#040507"}),/*#__PURE__*/t("path",{d:"M17.2949 6.37537C18.0156 5.44684 19.4671 4.57877 20.4927 4.46512C20.8178 4.42885 20.8581 4.43127 20.9312 4.50139L20.9967 4.56426L20.9816 4.99225C20.9564 5.65963 20.8682 6.12873 20.6716 6.6341C20.4751 7.13705 20.1198 7.71738 19.8426 7.97852C19.7594 8.06074 19.6007 8.22516 19.4948 8.34848C19.0563 8.84901 18.439 9.20205 17.5973 9.4366C17.2823 9.52606 17.2596 9.52848 16.8917 9.52606C16.4482 9.52365 16.3852 9.51156 16.3524 9.43176C16.3398 9.39791 16.3272 9.18996 16.3222 8.9675L16.3171 8.56127L16.423 8.17922C16.6347 7.41512 16.8791 6.90733 17.2949 6.37537Z",fill:"white"}),/*#__PURE__*/t("path",{d:"M17.4512 10.2081C18.4163 9.84541 19.7595 9.48754 20.2584 9.46336C20.6616 9.4416 21.2966 9.49238 21.7225 9.57943C22.1383 9.66164 22.4357 9.76078 22.8666 9.96148C23.5571 10.2831 24.1442 10.7135 24.6104 11.2382C24.9582 11.6299 24.9783 11.6807 24.8397 11.8113C24.7944 11.8548 24.6885 11.9249 24.6054 11.9709C24.4542 12.0507 23.8368 12.5464 23.8368 12.5875C23.8368 12.5971 23.736 12.7108 23.6125 12.8341C23.2068 13.25 23.0279 13.5861 22.7683 14.4252C22.7078 14.6186 22.6448 14.8725 22.6272 14.9934C22.5566 15.4577 22.5919 16.125 22.7154 16.7344C22.7885 17.1044 23.0808 17.7306 23.3706 18.1489C23.7763 18.7317 24.3786 19.2491 24.9909 19.5514C25.316 19.7086 25.5 19.8464 25.5 19.9334C25.5 19.96 25.4773 20.0205 25.4521 20.064C25.4244 20.1075 25.3866 20.2164 25.3639 20.3034C25.311 20.521 25.001 21.244 24.807 21.5971C24.0862 22.9052 23.3731 23.8748 22.6095 24.5833C21.8611 25.2725 21.1606 25.582 20.4348 25.5385C19.9359 25.5094 19.4596 25.3934 18.7842 25.1322C18.2248 24.917 18.0081 24.8493 17.7939 24.8203C17.688 24.8058 17.4915 24.7768 17.3604 24.7574C16.9774 24.697 16.7254 24.6921 16.4533 24.7478C15.5461 24.9267 15.5133 24.9364 15.0144 25.1371C14.2231 25.4562 13.8073 25.5578 13.2907 25.5578C12.8875 25.5602 12.696 25.5143 12.2575 25.3087C11.8694 25.125 11.5948 24.9315 11.2546 24.5978C10.9295 24.2811 10.7052 24.0151 10.2642 23.4323C9.18818 22.0081 9.02187 21.7276 8.49519 20.4582C8.28612 19.9546 8.19971 19.7502 8.13026 19.5402C8.07498 19.373 8.03043 19.2023 7.94332 18.8744C7.73164 18.074 7.70896 17.9869 7.70896 17.8709C7.70896 17.8153 7.68628 17.675 7.66108 17.5565C7.44184 16.5917 7.44688 15.0007 7.67116 14.1713C7.82236 13.6127 8.02648 13.088 8.30367 12.5512C8.92863 11.3325 9.71738 10.5539 10.874 10.0123C11.2571 9.8309 11.5444 9.74627 12.0534 9.65922C12.2903 9.62054 12.5523 9.56976 12.6355 9.54799C12.8421 9.49238 13.3184 9.49963 13.6057 9.56008C14.2911 9.71 14.7548 9.84058 15.2059 10.0123C16.0551 10.3411 16.549 10.4789 16.7506 10.4475C16.7692 10.4444 16.7848 10.4418 16.8002 10.4387C16.8815 10.4225 16.9601 10.3929 17.4512 10.2081Z",fill:"white"})]}),Ln=({style:n,...a})=>/*#__PURE__*/e("svg",{width:"33",height:"32",viewBox:"0 0 33 32",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:{height:"24px",...n},...a,children:[/*#__PURE__*/t("rect",{x:"0.5",width:"32",height:"32",rx:"4",fill:"#5462EB"}),/*#__PURE__*/t("path",{d:"M23.5433 8.87438C22.2479 8.26174 20.8587 7.81038 19.4063 7.55187C19.3799 7.54688 19.3534 7.55934 19.3398 7.58428C19.1612 7.91179 18.9633 8.33905 18.8247 8.67487C17.2625 8.43382 15.7084 8.43382 14.1782 8.67487C14.0396 8.33158 13.8345 7.91179 13.6551 7.58428C13.6414 7.56018 13.615 7.54771 13.5886 7.55187C12.1369 7.80955 10.7478 8.26092 9.45159 8.87438C9.44037 8.87937 9.43075 8.88769 9.42437 8.89849C6.78947 12.9558 6.06766 16.9134 6.42176 20.8219C6.42336 20.841 6.43378 20.8593 6.4482 20.871C8.18663 22.1868 9.87059 22.9857 11.5233 23.5152C11.5497 23.5235 11.5778 23.5135 11.5946 23.491C11.9855 22.9408 12.334 22.3606 12.6328 21.7504C12.6505 21.7147 12.6336 21.6723 12.5976 21.6581C12.0448 21.442 11.5185 21.1785 11.0122 20.8793C10.9721 20.8552 10.9689 20.7961 11.0058 20.7679C11.1123 20.6856 11.2189 20.6 11.3206 20.5135C11.339 20.4977 11.3647 20.4944 11.3863 20.5044C14.7125 22.0696 18.3136 22.0696 21.6006 20.5044C21.6222 20.4936 21.6479 20.4969 21.6671 20.5127C21.7688 20.5991 21.8754 20.6856 21.9827 20.7679C22.0196 20.7961 22.0172 20.8552 21.9771 20.8793C21.4708 21.1843 20.9445 21.442 20.3909 21.6573C20.3548 21.6715 20.3388 21.7147 20.3564 21.7504C20.6617 22.3597 21.0101 22.9399 21.3939 23.4902C21.4099 23.5135 21.4387 23.5235 21.4652 23.5152C23.1259 22.9857 24.8099 22.1868 26.5483 20.871C26.5635 20.8593 26.5731 20.8419 26.5747 20.8228C26.9985 16.3041 25.8649 12.3789 23.5697 8.89931C23.5641 8.88769 23.5545 8.87937 23.5433 8.87438ZM13.1295 18.442C12.1281 18.442 11.303 17.4944 11.303 16.3307C11.303 15.1669 12.1121 14.2193 13.1295 14.2193C14.155 14.2193 14.9721 15.1752 14.9561 16.3307C14.9561 17.4944 14.1469 18.442 13.1295 18.442ZM19.883 18.442C18.8816 18.442 18.0564 17.4944 18.0564 16.3307C18.0564 15.1669 18.8655 14.2193 19.883 14.2193C20.9084 14.2193 21.7255 15.1752 21.7095 16.3307C21.7095 17.4944 20.9084 18.442 19.883 18.442Z",fill:"#F7F7F7"})]}),Pn=({style:n,...a})=>/*#__PURE__*/e("svg",{width:"33",height:"32",viewBox:"0 0 33 32",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:{height:"24px",...n},...a,children:[/*#__PURE__*/t("rect",{x:"0.5",width:"32",height:"32",rx:"4",fill:"black"}),/*#__PURE__*/t("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M16.5083 5.62451C10.8896 5.62451 6.34741 10.2078 6.34741 15.878C6.34741 20.4104 9.25774 24.2471 13.2951 25.605C13.7999 25.7071 13.9848 25.3844 13.9848 25.1129C13.9848 24.8752 13.9682 24.0604 13.9682 23.2115C11.1417 23.8227 10.5531 21.9892 10.5531 21.9892C10.0988 20.8009 9.42579 20.4954 9.42579 20.4954C8.50068 19.8673 9.49318 19.8673 9.49318 19.8673C10.5194 19.9352 11.0578 20.9198 11.0578 20.9198C11.9661 22.4815 13.4297 22.0402 14.0185 21.7686C14.1025 21.1065 14.3719 20.6482 14.6579 20.3936C12.4035 20.1559 10.0317 19.2732 10.0317 15.3347C10.0317 14.2142 10.4351 13.2976 11.0745 12.5847C10.9736 12.3301 10.6202 11.2774 11.1756 9.86844C11.1756 9.86844 12.0335 9.59678 13.968 10.9209C14.7962 10.6965 15.6503 10.5823 16.5083 10.5814C17.3662 10.5814 18.2408 10.7003 19.0484 10.9209C20.9831 9.59678 21.841 9.86844 21.841 9.86844C22.3963 11.2774 22.0428 12.3301 21.9419 12.5847C22.5981 13.2976 22.9849 14.2142 22.9849 15.3347C22.9849 19.2732 20.6131 20.1388 18.3419 20.3936C18.7121 20.7161 19.0316 21.3271 19.0316 22.2948C19.0316 23.6698 19.0149 24.7733 19.0149 25.1127C19.0149 25.3844 19.2 25.7071 19.7046 25.6052C23.742 24.2469 26.6523 20.4104 26.6523 15.878C26.669 10.2078 22.1102 5.62451 16.5083 5.62451Z",fill:"white"})]}),Fn=n=>/*#__PURE__*/e("svg",{width:"33",height:"32",viewBox:"0 0 33 32",fill:"none",xmlns:"http://www.w3.org/2000/svg",...n,children:[/*#__PURE__*/t("rect",{x:"0.5",width:"32",height:"32",rx:"4",fill:"#F1F2F9"}),/*#__PURE__*/t("path",{d:"M26.1001 16.2273C26.1001 15.5182 26.0365 14.8364 25.9183 14.1818H16.5001V18.05H21.8819C21.6501 19.3 20.9456 20.3591 19.8865 21.0682V23.5773H23.1183C25.0092 21.8364 26.1001 19.2727 26.1001 16.2273Z",fill:"#4285F4"}),/*#__PURE__*/t("path",{d:"M16.5001 26C19.2001 26 21.4637 25.1046 23.1182 23.5773L19.8864 21.0682C18.991 21.6682 17.8455 22.0227 16.5001 22.0227C13.8955 22.0227 11.691 20.2637 10.9046 17.9H7.56372V20.4909C9.20917 23.7591 12.591 26 16.5001 26Z",fill:"#34A853"}),/*#__PURE__*/t("path",{d:"M10.9047 17.8999C10.7047 17.2999 10.591 16.659 10.591 15.9999C10.591 15.3408 10.7047 14.6999 10.9047 14.0999V11.509H7.56376C6.86376 12.9025 6.49951 14.4405 6.50012 15.9999C6.50012 17.6136 6.88649 19.1408 7.56376 20.4908L10.9047 17.8999Z",fill:"#FBBC05"}),/*#__PURE__*/t("path",{d:"M16.5001 9.97726C17.9682 9.97726 19.2864 10.4818 20.3228 11.4727L23.191 8.60454C21.4591 6.99091 19.1955 6 16.5001 6C12.591 6 9.20917 8.2409 7.56372 11.5091L10.9046 14.1C11.691 11.7364 13.8955 9.97726 16.5001 9.97726Z",fill:"#EA4335"})]});function Dn(n){/*#__PURE__*/return e("svg",{xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",width:26,height:26,viewBox:"0 0 140 140",x:"0px",y:"0px",fill:"none",...n,children:[/*#__PURE__*/e("defs",{children:[/*#__PURE__*/e("linearGradient",{id:"b",children:[/*#__PURE__*/t("stop",{offset:"0",stopColor:"#3771c8"}),/*#__PURE__*/t("stop",{stopColor:"#3771c8",offset:".128"}),/*#__PURE__*/t("stop",{offset:"1",stopColor:"#60f",stopOpacity:"0"})]}),/*#__PURE__*/e("linearGradient",{id:"a",children:[/*#__PURE__*/t("stop",{offset:"0",stopColor:"#fd5"}),/*#__PURE__*/t("stop",{offset:".1",stopColor:"#fd5"}),/*#__PURE__*/t("stop",{offset:".5",stopColor:"#ff543e"}),/*#__PURE__*/t("stop",{offset:"1",stopColor:"#c837ab"})]}),/*#__PURE__*/t("radialGradient",{id:"c",cx:"158.429",cy:"578.088",r:"65",xlinkHref:"#a",gradientUnits:"userSpaceOnUse",gradientTransform:"matrix(0 -1.98198 1.8439 0 -1031.402 454.004)",fx:"158.429",fy:"578.088"}),/*#__PURE__*/t("radialGradient",{id:"d",cx:"147.694",cy:"473.455",r:"65",xlinkHref:"#b",gradientUnits:"userSpaceOnUse",gradientTransform:"matrix(.17394 .86872 -3.5818 .71718 1648.348 -458.493)",fx:"147.694",fy:"473.455"})]}),/*#__PURE__*/t("path",{fill:"url(#c)",d:"M65.03 0C37.888 0 29.95.028 28.407.156c-5.57.463-9.036 1.34-12.812 3.22-2.91 1.445-5.205 3.12-7.47 5.468C4 13.126 1.5 18.394.595 24.656c-.44 3.04-.568 3.66-.594 19.188-.01 5.176 0 11.988 0 21.125 0 27.12.03 35.05.16 36.59.45 5.42 1.3 8.83 3.1 12.56 3.44 7.14 10.01 12.5 17.75 14.5 2.68.69 5.64 1.07 9.44 1.25 1.61.07 18.02.12 34.44.12 16.42 0 32.84-.02 34.41-.1 4.4-.207 6.955-.55 9.78-1.28 7.79-2.01 14.24-7.29 17.75-14.53 1.765-3.64 2.66-7.18 3.065-12.317.088-1.12.125-18.977.125-36.81 0-17.836-.04-35.66-.128-36.78-.41-5.22-1.305-8.73-3.127-12.44-1.495-3.037-3.155-5.305-5.565-7.624C116.9 4 111.64 1.5 105.372.596 102.335.157 101.73.027 86.19 0H65.03z",transform:"translate(1.004 1)"}),/*#__PURE__*/t("path",{fill:"url(#d)",d:"M65.03 0C37.888 0 29.95.028 28.407.156c-5.57.463-9.036 1.34-12.812 3.22-2.91 1.445-5.205 3.12-7.47 5.468C4 13.126 1.5 18.394.595 24.656c-.44 3.04-.568 3.66-.594 19.188-.01 5.176 0 11.988 0 21.125 0 27.12.03 35.05.16 36.59.45 5.42 1.3 8.83 3.1 12.56 3.44 7.14 10.01 12.5 17.75 14.5 2.68.69 5.64 1.07 9.44 1.25 1.61.07 18.02.12 34.44.12 16.42 0 32.84-.02 34.41-.1 4.4-.207 6.955-.55 9.78-1.28 7.79-2.01 14.24-7.29 17.75-14.53 1.765-3.64 2.66-7.18 3.065-12.317.088-1.12.125-18.977.125-36.81 0-17.836-.04-35.66-.128-36.78-.41-5.22-1.305-8.73-3.127-12.44-1.495-3.037-3.155-5.305-5.565-7.624C116.9 4 111.64 1.5 105.372.596 102.335.157 101.73.027 86.19 0H65.03z",transform:"translate(1.004 1)"}),/*#__PURE__*/t("path",{fill:"#fff",d:"M66.004 18c-13.036 0-14.672.057-19.792.29-5.11.234-8.598 1.043-11.65 2.23-3.157 1.226-5.835 2.866-8.503 5.535-2.67 2.668-4.31 5.346-5.54 8.502-1.19 3.053-2 6.542-2.23 11.65C18.06 51.327 18 52.964 18 66s.058 14.667.29 19.787c.235 5.11 1.044 8.598 2.23 11.65 1.227 3.157 2.867 5.835 5.536 8.503 2.667 2.67 5.345 4.314 8.5 5.54 3.054 1.187 6.543 1.996 11.652 2.23 5.12.233 6.755.29 19.79.29 13.037 0 14.668-.057 19.788-.29 5.11-.234 8.602-1.043 11.656-2.23 3.156-1.226 5.83-2.87 8.497-5.54 2.67-2.668 4.31-5.346 5.54-8.502 1.18-3.053 1.99-6.542 2.23-11.65.23-5.12.29-6.752.29-19.788 0-13.036-.06-14.672-.29-19.792-.24-5.11-1.05-8.598-2.23-11.65-1.23-3.157-2.87-5.835-5.54-8.503-2.67-2.67-5.34-4.31-8.5-5.535-3.06-1.187-6.55-1.996-11.66-2.23-5.12-.233-6.75-.29-19.79-.29zm-4.306 8.65c1.278-.002 2.704 0 4.306 0 12.816 0 14.335.046 19.396.276 4.68.214 7.22.996 8.912 1.653 2.24.87 3.837 1.91 5.516 3.59 1.68 1.68 2.72 3.28 3.592 5.52.657 1.69 1.44 4.23 1.653 8.91.23 5.06.28 6.58.28 19.39s-.05 14.33-.28 19.39c-.214 4.68-.996 7.22-1.653 8.91-.87 2.24-1.912 3.835-3.592 5.514-1.68 1.68-3.275 2.72-5.516 3.59-1.69.66-4.232 1.44-8.912 1.654-5.06.23-6.58.28-19.396.28-12.817 0-14.336-.05-19.396-.28-4.68-.216-7.22-.998-8.913-1.655-2.24-.87-3.84-1.91-5.52-3.59-1.68-1.68-2.72-3.276-3.592-5.517-.657-1.69-1.44-4.23-1.653-8.91-.23-5.06-.276-6.58-.276-19.398s.046-14.33.276-19.39c.214-4.68.996-7.22 1.653-8.912.87-2.24 1.912-3.84 3.592-5.52 1.68-1.68 3.28-2.72 5.52-3.592 1.692-.66 4.233-1.44 8.913-1.655 4.428-.2 6.144-.26 15.09-.27zm29.928 7.97c-3.18 0-5.76 2.577-5.76 5.758 0 3.18 2.58 5.76 5.76 5.76 3.18 0 5.76-2.58 5.76-5.76 0-3.18-2.58-5.76-5.76-5.76zm-25.622 6.73c-13.613 0-24.65 11.037-24.65 24.65 0 13.613 11.037 24.645 24.65 24.645C79.617 90.645 90.65 79.613 90.65 66S79.616 41.35 66.003 41.35zm0 8.65c8.836 0 16 7.163 16 16 0 8.836-7.164 16-16 16-8.837 0-16-7.164-16-16 0-8.837 7.163-16 16-16z"})]})}function Rn(n){/*#__PURE__*/return e("svg",{width:"33",height:"32",viewBox:"0 0 33 32",fill:"none",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",...n,children:[/*#__PURE__*/t("rect",{x:"0.5",width:"32",height:"32",rx:"4",fill:"black"}),/*#__PURE__*/t("rect",{x:"0.5",width:"32",height:"32",rx:"4",fill:"#06C755"}),/*#__PURE__*/t("rect",{x:"0.5",width:"32",height:"32",rx:"4",fill:"url(#pattern0_1769_69)"}),/*#__PURE__*/e("defs",{children:[/*#__PURE__*/t("pattern",{id:"pattern0_1769_69",patternContentUnits:"objectBoundingBox",width:"1",height:"1",children:/*#__PURE__*/t("use",{xlinkHref:"#image0_1769_69",transform:"scale(0.003125)"})}),/*#__PURE__*/t("image",{id:"image0_1769_69",width:"320",height:"320",preserveAspectRatio:"none",xlinkHref:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAUAAAAFACAYAAADNkKWqAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAABpkSURBVHgB7d1fbFTXtcfxdWZs45h7g6lClajoetJIRKIqGKmhTSvF5qEvqUqIitM+XEIikYf+QWlVaF+IACVPBamN0ps8NFL5cx+qmioOVXsf+oCJ1Pg2VMKkKlKRSMZVqlalCiaSHf9hZvesMx5jm/k/58w5Z+/vR3KM8cSAPf55rbX32ccTx/Rf3tO/uNiXWygsDnri5UTMgOd5/UZMTozXX3qU/2vAOl4++K+Y4LUR8V97U5KRyUwxM93bOzc5vWNsWhziicU07GYXeoY9I0P+mzljZJBwA6rzv0emM55MGvEuajD29SyM2xyKVgWgBt7cXO+g8YpP+BXdsASBB6AtfiD63dK4ZzJvzj36i3GxSOoDUENvZq57T0Zkf9EPPM+TfgEQGX9kNFY05s31vYtjaa8OUxuAvRPfGDZSOEroAfHRMDSenF74/C/HJIVSFYDBTG+u53ljzHcJPSBR8hqGfpv8st8m5yUlUhGAWu0VTfF58cweAZB0pzKSPZ6GIEx0AJbbXH+5flgApE3igzCRAdj9+5HBTEZ+TPABVkhsECYqAIMV3fmeo54/4xMAtklcECYmANf9/9efLxaLx1jcAKyW9zu744uPjp6SBIg9AP05X86f8/2cdhdwSt6vBnfFXQ1mJEZa9RVM4TLhBzgnV5TC+z0TTx2VGMVSAVL1AVjmyWTGZJ+MoxrseAXY84ev7aHqA7DMyKBfDV7onhh5RjqsowHY8we/3C1m3mChA8AaOb8d/XmnW+KOtMC6veXjue43qPoA1KOX1N2zbuHZThy0EHkA6ryvKMULnMMHoAkdWSWOtAXWKzoIPwAt0FXiC1pASYQiqwA1/PyPfoF5H4CWeTLdnZFdMztHJyUCkQQg4QcgNBGGYOgBSPgBCF1EIRhqABJ+ACITQQiGFoA6rNQNzoQfgMiEHIKhrAKXt7oQfgAiZaR/sSBvhLU63HYA6iZntroA6KBgi4xmj7Sp7QCc/bjn54QfgA7L6dVl0qa2AjC4tpcbFQGIgV5a2+61wy0vgujJDXrxsgBAnDLFJxc+/6uW7kvcUgByfS+AxPBXhjMmu6OV64ZbaoGLXuENwg9AIvgrw3rAsrSg6QAM5n5GBgUAEkLngeve/nrTd5NsqgUutb6F9wUAkqaFVripCrA09wOABGqhFW44AEvn9TP3A5BczbbCDbXArPoCSA2/Fe5bt/hgI0fqN1QB+nO/o4QfgFTwW+GZj3sa2iBdtwJk4QNAGnVnZUe9U2PqVoCl6g8A0uV2QX5c7zE1K0CqPwBplhGza+7Rc+PV318D1R+ANDPi1cywqhUg1R8AG9SqAqtWgFR/AGxgvMzz1d5XsQKk+gNgk77exY2V9gVWrAAL3u2qiQkAaTM721Px6pCKAeiZDKc8A7BH1lQs6u4KwJ63v7aHqz4AWMVIf+/E3uG1v31XAHqZ7H4BAMtU2hKzehHkwp7+nt7umwIAtqlwSMKqCrC7t5vZHwA76SEJc6szblUAZjzvCQEAS/mBt3/N23cYwz1+AdjLeDLYf3lPf/nt5QDsnfjGsACAzfw2eG6ua/mmbssBWDAFqj8A1jPGW8665QD0l4OHBAAsZ1ZkXWkbDNtfADikfG1wUAH2rMsOCwA4YvbjnmF9XWqBveygAIAjPDHD+rpr6Y0hI0B7+rvWy4bsehlYtyl4CX4v2ycb/N9XuXWfbOjj5Of/Gby+dXtGpguzcqvgv749G7w9tXDD//WMAG3K6X+CADRGBhu7QzBcpgE30LNJtq3PBQGngVYOu3Lgdcq7s/kgFKfmbwSBWX679JqARG3Gk+362mMBBJUM+OH22L1bZbuGnR9625dCLw3KQXjFf3nroz/L1NyN4NfASroQ4ukG6KIULgicpZWdht1j935GtvflZJv/0t/VJzYph+JFPxDf+ugqlSKkO9u9o6toFvvFq3t7YFhEA09DbvcnHpEhP/j017bTQC+F/Nbl3ysF4lU5/+GloFKEWxYKi4NdpRVglkBspy3t7o2f80Nvp5UVXiu2LVW7B+9/PHhbK8OzN8aDUJxaWoiBvTzxcroIkhNYSVtarfD2bRpOzfwuTisrRK0O3/Qrw1/7L8wPLeWZAW/dxMgFv/4bFlhBK72nNw0ReiHSleZX/v4bOX/zj1SGFvGMvEkAWkBnevvuGwra25UzLoSv3Caf8V+QckYmvZ6Jp97nJkjppC2uLmTsu2+YmV6HaVWoCycvfnCOqjC98gRgCmmlp4N7qr1koCpMLQ3AEZaAU0DbXA2979z/Faq9hNKq8KUPRgnCFCEAE47gSx8WTdKDAEwogi/9NAhLrfFFgjChCMCEIfjsQ2ucXARggujevZMDzxB8liIIk4cATADdzvLC5hFWdR1xZSYvI9dO0hYnAAEYI213Twzsl6f9yg/u0fkg+wjjRQDGROd8RzY/RbvrONrieBGAHabX6r7+0Ldod7EK1WA8CMAOoupDLXpA6+Gp01SDHUQAdgBVH5pBNdg5BGDE9LCCn33621R9aIrOBg9cf5WTqiPGWfgROpl7Rka3HCb80DQ9y/F3W48G26MQHSrACGjLe+7hQ07cawPR0yrwwPXXaIkjQAUYMt3UrD+5CT+EpfycGmjwxvJoHAEYIl3lLT1ROYoe4dLn1LUdP12+gRPCQQCGRGc1OvMDoqTPMeaC4ekStEUvZzs5sD84yADohCN+AG7I9smhqdOC9hCAbdDwY96HOBx84CtBW/zce68FG6jRGlrgFulAmvBDnPTeMPoc1B/EaA0B2ALCD0mhz8F3PvsjVohbRAA2qRx+rPQiKcqbpgnB5hGATSD8kFTlEKQdbg4B2CDCD0lHCDaPAGyAPqH00jbCD0mnM8HRLYcEjSEAG/CzT3+LBQ+khl46p8evoT4CsA7dda9HWgFpohvzuWKkPgKwBn0CHeFJhJTS5y7XDtdGAFahbQThh7TTa4e3M76pigCsoHyEPWCD0YcPs0ewCgKwAra7wCb6XH79oW8K7kYArqEtA+EH2+hIR08twmoE4Aq6csbQGLbSE2Q0CHEHAbhEZyRsG4DtdLbNlSJ3EIBLjmzeS+sL6+lz/Min9gpKCEAptb5Pc6IzHEErfIfzAUjrCxfRCpc4H4C0vnARrXCJ0wGoBxzQ+sJV2gq7fpWI0wF47uHDArjsZM7tvYHOBqAufND6wnW6GOLygoizAcjCB1Di8nXvTgYg1R9wh34vuDoLdzIAqf6A1Vw9+s25AKT6A+7mahXoXABS/QGVuVgFOhWAVH9Adfq94dqKsFMBSPUH1PbCZreuDnEmAPUnG9UfUJtr+wKdCcB9m4YEQH0u3QbWiQDUE1+45hdozL77hpw5KcaJAHzs3q0CoDEafo/9pxvfM13igCRUf1PzN2q+P+75ZL2/n0rLDHX69ozcKszWfMyGbB/n4dVw8IHH5fzNS2I76wNQ2984K8Cp+X/Kl68ebygAdR9WHGF94PqrcvbGeN3H6fFhl7b9qOZjzvgf55W//7ZuAOnXJIprUPXzvfNPPwxCsJ7RLYdrzrvenc0HX7tGPlZU9DkRx+4F/VrrD4g4/+2dYH0LHHf7q2HQSHWlj3npg1HptLc+utpQ+CkNhDM1Hqvh85wfpvo4/XWtF/0zD02dlrAdyp9u+Jv2lX/8tub7v9/Ex4qKPiemb89Kp2n4fXWj/Ysh1gdg3O3vdKHzT964TM3/q6nHv/L33/gB/GcJUzOfbw3iWv5a5/2dMl2IJ4SHHJidWx2AwTCXBZBEG7l2sm4QIR5UgCm3zfHjvtNAW8wD118TJE+pgLB7U7TVAejShs400zb4xRjmn6jP9g7K6gB0/YYvaaLD/rDngWif7XNAawOQ+V/66HacOFY8UZ3tYyRrA5D5X/roVqCRaycEyaGFhM2dlMUBOCBIH22D6+3PQ2dtW58TW1kbgEMb3L3VX9odyp9iHrhEr2TKxXwJ4naLA9DaS+H6s1znmWY6D3znsyf8FqxP0kCDKuwj17T93HffsMRtoOc+sZW1AcgMMN10Hvjce6/K6JZDkgZ6LbetJ45vX/+g2MrKFlh/cqalckB15z98h3lgAmi423pyjpUBSPVnD90fqIcrIF79WTsLCmsrQNhBL5Xb+5cT7A+Mma1FhZUB+F8WD21dpPPAQ1OnBPHZQAucHlSA9tHzA5kHxocWOEW4/aWddB7I0VnxsLUCdOKeILCDzgP1iPok7g/UhRrduxgmrbr03hy6xzBucW/GjoqVAUgLbK/g1gF/G5WTA/slSTScG721QDP0xkRp2hCeNnbOALkKJBUOPvCVln5Y6VH6ZyIImyTSwI/rSHwXOHFfYCSTHlhx5FN7pRWHp04zD0TbCEDESqvAVm5cVdofeFKAdhCAiN0Jf57XyqBfFx6iuLUm3GFlAOZpjVJF54DnHm7t0AOdB57/8JIAraACRCLopVatruzqqTHMA6Nl6/2tCUAkhs4DW7kNI7fWjJ5+jm1kZQDq1gGkk57/18o8UE+QZh4YnVsEYHoQgOml88DXH/qmtELngTYenZWEfa20wECHaBvc6jzQplZNfxiczD2TiKtAbC0qrLwU7t3ZKUG66Tzw/M0/pubmSBrav9t6VGxFC5wirAja4fWHvpWIgwAgcsXSU7mtDEBtgzhBOP30WLNW54EIz5WZvNjK2hngXxeoAm2greXB+x8XxOeWpQsgytoAnLT4p5ZrdCGglf2BCIet7a+yNgBtLttdpPNAznmMx1u30rEQ1QprA5CVYLvoPPBnn2YeGAeb99VaeyR+WjfEhv1k25Dts6Zy2v2JncE8MIk3R9I5mY1fO91RYXMLbG0A6kqw7iFL0+xIv4G2XP62hE331CXtCPlW6TzwrY+uJu6b8srM+5F87Y5sHpEX/Je42D5KsvpKkCu0wQHbLhEbffiwM/NAvRNePsYW9Nc3/yg2szoAOSfuDpv2Reo80JaKNumoAFNMqx42RNtp36Zh9gdGzPb5n7I6AHUO+O7s+wI76Xxse19OEA2dtdrO+tNg3qQNtpbOAV2aB3bamRsXxXbWB+D//sv+L6LLdB7Y6q01UZ22v2k5iacd1gdgeTsM7KXbfJgHhsuF9lc5cSAqbbD9dB7I0VnhefGDUXGBEwGobTCrweFI6rytfGvNZv5+/V3/Ibibbn1x5bYSTgSgtsFn/zUucRi6d6vETSsjnZVVsq1voOHKScOl1qqrfqxmAmgo5Kt09NaazcwDd2/8XM33//emYYmbfm1yVb52UflpAi81jIrXMzFixAFxHlmu85SLMc0hNZB2b3ykagAq/Wl/5sZ42x9Hnf/wHXnlH/9X52P1yVf9j/V0RAGjn2/9oVfrHDv9dzzWwA+ns/7nJa4rMfRzvu++4Y7eE0QXP7Zc/o64wpkAVBqAnCsHVKeXTbp0e1Gn7grnwr4moB1JPGknSk4F4K9vXmIxBKhC233X7qntVADqXOiVf/xGANzNla0vKzl3Y3Rd4aIKBFZzsfpTzgUgVSCwmn5PuFj9KecCUFEFAnfowoeL1Z9yMgD1J96hqVMCuE73/b3kaPWnnAxApTMPDkmA61764Jy4zNkAVC86/sWH2/SWEfWuALKd0wGoFaDrTwC4izGQ4wGoDk+dZkEEztFVX1cXPlZyPgB1QeSlv7k7BIZ7XF/4WMn5AFR6ATgLInDFl68eF5QQgEsOXH+VVhjWo/VdjQBcok+K5957VQBb6aovre9qBOAKpcM83ToOCG7QuR+rvncjANd4KWgR/imATfb+5SStbwUE4Bq6KqxDYuaBsIXO/d6dzQvuRgBWwDwQttBLPpn7VUcAVqHzQFePCIIdSnM/d+7v0QoCsAb9ycmiCNJIw680ypkRVEcA1nEof4pN0kgVDT0WPRpDADZg5NpJhshIDZ1f83xtDAHYgNJP1BNsj0Hi6dxaNzyjMQRgg7Sd0JkKIYik0vBjxbc5BGATCEEklS7WEX7NIwCbRAgiabTl1cU6NI8AbAEhiKTQxQ427beOAGxROQRZbUNc9LnHXr/2EIBtKIcgq27oNDY6h4MAbJM+AUeuneCyOXQM4RceAjAkugJHCCJq5fDjKo9wEIAh0hBkcQRR0Znfzj/9kPALEQEYMr1umBBE2FjwiAYBGAH9Cb3l8nc4SQaheOujq4RfRAjACOnmVL3bHNUgWnXmxrgffscIv4gQgBE7GzyBj3OkFpqmi2rPXWeTc5QIwA4o7xdklRiN4mCDzvB6JkaMoGMG1m2Scw8flm19OQEq0dEJ8+POIABjsm/TsLywea8fiJ8UQJU21Z9kXNJBBGCMtBo8snlEnvbDEG5jg3M8CMAE2L4+J6NbDlENOkr3+JVOHCf8Oo1FkAS4MpMP9g2yZcY9Z5Z2CRB+8aACTCDmg25gpTd+BGBC6XxQg/DpTUMEoWV0sUNvWK57RBEvAjDhNAgfu/czVISW0BGH3rOXg3STgQBMEVrjdGOxI3kIwBTa/YmdcvD+x/3KcKsgHXRjMzcuSh4CMMXK+wiH/CCkKkwuruxILgLQEtoe7974iF8dPiJIBuZ9yUcAWqa8aKJXl9Aix0fP8Dtw/X+Y9yUcAWgxwjAe7O9LDwLQEf1d6+WrfousQcjMMBocZpA+BKCj9DguDUKtEDUUNSDROra4pBMBiIAGoh7KoGE46L/mvMLGscUlvQhAVKQVYRCKfQMy0PtJ/7WG4gCV4gra8j733qty/sNLgnQiANGUcjDq6/I80cVqkVVeOxCAaJuuNusexIMPPO7E4gotrz0IQITK5uuVdWPzgeuvscprEQIQodOK8OTAM1ZdlaJzPp33cX9eu3AiNEKnc7GRayesqJSCs/v8dlf/PYSffQhAREYP/Uwz3du3808/4CADixGAiIze6yStBwFo6D3y7g9Y5bVclwARmvRDME3bZFjocAsBiEilqYLSqk8PMWDW5w4CEJFKQwBS9bmLAITTqPrcRgDCSVzHC0UAIlK6KTpp2NSMMgIQkUrS6TFUfViLAESkklIBMutDJQQgItWfjbcCZIUXtRCAiFScm6Cp+lAPAYjIbF//oD8D7JNOo+pDowhARGZDtrPhp5VeueoDGkEAIjJ6D5FO4Yh6tIIARGSGNnxGoqZV3+Gp03LmxrgAzfID0MuLmJwAIYt6BZhFDrQpTwWIyES1Aqzt7ot+8LHIgXZ1iTHT4gkQqihWgLXS04qPE5oRBk8rQC/j5Y0xgwKEKOwVYNpdRKHLGLklQMjCWgFmdRdRMV5pBpgXIGS53vbuC6z3Evl+/jRzPkTHeFNdRkyeESDC1moLzLYWdIyRya6erEwuFgQI1a3CbFOPL1/F8VP/hTkfOiHjFae7ZmYW8z293QKESWd3B+9/vO7jCD7Epbf39mTQ/fZMPPU+m6ERtkvbflR1LyB7+RArT6YXvjC6MdgI7Xky6a8G5wQIkd5YfN+mYRm6t3RJ3HRhJgg+DT2qPcTJ8+d/+joIwGLRTHmshCACZ/3FjLMsaCBhjHgX9XVG/+NJcVwAwBVLFWAQgAvzhXEBAEf03bMwrq+DAJRdY9PlRAQAq/lZN73DzzwpB2Dwe3JRAMBy3oqsWw7ArGfGBAAs563IuuUAnJu7PemXgdMCABabe/TcePnXywGoc0DdDygAYCnPyJsr386sfKMocloAwFJ+kbdq1LcqABfnFsdogwHYqrd3sXoA0gYDsJW2v+XtL2WZux4k5rgAgGWMeKfW/l7FK4B73h656b+nXwDAAnoDpPlHRx9c+/uZyo/2XhYAsETR8yruc64YgAtzCz8RALBE1mQqFnWVK8BgMcTjyhAA6efJqblHf5Gv9K5M1f/HFGmDAaRexmSrLuxWDUC9XMQfHI4LAKRVjepPZWr/v2yJAZBetaq/4P213kkVCCC16lR/qmYAqmJRvicAkDL1qr/gMfUesPil0UnDggiANGmg+lN1A1AtzheOcUgCgDTQqz4aqf5UQwEY7AvMsCACIPn8ADzeSPW39NjGrZsYuWBEhgUAEqjaNb/VNFYBLn/w7LO0wgCSys+oXc08vqkA1LKSVhhAIhVNw61vWVMtcBmtMIAk0YOc578wukOa1FQFuPyH0QoDSAid+3km+6S0oKUALJWZxWcFAGLWzKrvWi0FoFr44q/GhGuFAcQpmPuNnpIWtTQDXIl5IIBYeN7Ywhd+2VLrW9ZyBVg2P7f4pCdeXgCgQ3Tu17duoe0xXNsBGFwlIpldhCCATggWPSS7a+0tLlv8WOHo/v3IoL8UfYG7yQGIjJHpjJfd0eqix1rtV4BLSqfGyC62xwCIhJ8tmjFhhZ8KrQIsoxIEELql8NNCS0IUegAqQhBAaCIKPxVJACpCEEDbIgw/FdoMcC39C+uwktVhAK3Q1d4ow2/pz4hW78Q3ckaKF4yYnABAA8pbXcJc8KgksgqwTP8B83MLO8R4YwIAdeidKO/pXdwRdfgt/Vmd0zOx95j/Rx4VAKikaI4vfOncMemQjgag6p0Yecb4IUhLDGCZv9jRlS0+O/v5X3W0U+x4ACqdCxZN4Q3/Tx8UAE7TllfPGO1Ey7tWLAFYRksMOMyv+jwxx+e/eO4nEpNYA1CxSgy4J86qb83fIxmYDQIOSEDVt1JiAlAFs0G5fcz/a+0XAFbxTPHle+4pHAvjGKuwJCoAywhCwB7a7haL8r0or+hoVSIDsIwgBNKrNOfTe3acG5eESnQAlhGEQHp4njem7W6Sg68sFQFYpkFYMIvfzXjZJ1gsARJED0L2zMt9vbd/kqQZXz2pCsCVet7+2h6R7H7/k75HAHSeruh6Mpn0NreW1AZgWf/lPf1zc917isZ7gjAEIrYUekWR0+t7F8fSVO1VkvoAXKt3Yu+w8bw9pihDXGoHhMD4VV5GLnrGjPX23p5Me+itZF0ArqTV4ezH2WHxsoN+mT5kjB+InFAN1ODlS4FnpkyxON53T2HcpsBby+oArKTUMncNFo3p12D0f7wN+J+EnL7PiJcrPYoFFtho6XR2Y6aDX3vB6yl/QTEvRZlc37eYtznsKvk3kqxyUwkTXfIAAAAASUVORK5CYII="})]})]})}function On(n){/*#__PURE__*/return e("svg",{width:"33",height:"32",viewBox:"0 0 33 32",fill:"none",xmlns:"http://www.w3.org/2000/svg",...n,children:[/*#__PURE__*/e("g",{"clip-path":"url(#clip0_1715_1956)",children:[/*#__PURE__*/t("rect",{x:"0.5",width:"32",height:"32",rx:"4",fill:"#0977B6"}),/*#__PURE__*/t("path",{d:"M9.46878 6.82104C10.6699 6.82104 11.6461 7.79742 11.6461 8.999C11.6461 10.2017 10.6699 11.1782 9.46878 11.1782C8.26447 11.1782 7.28967 10.2017 7.28967 8.999C7.28967 7.79742 8.26447 6.82104 9.46878 6.82104ZM7.58908 12.8309H11.3467V24.9207H7.58908V12.8309Z",fill:"white"}),/*#__PURE__*/t("path",{d:"M13.7032 12.8309H17.3076V14.4827H17.3576C17.8589 13.5322 19.0846 12.53 20.9127 12.53C24.7175 12.53 25.42 15.0341 25.42 18.2891V24.9207H21.6651V19.0415C21.6651 17.6388 21.6394 15.8355 19.7126 15.8355C17.7573 15.8355 17.4579 17.363 17.4579 18.9399V24.9207H13.7032L13.7032 12.8309Z",fill:"white"})]}),/*#__PURE__*/t("defs",{children:/*#__PURE__*/t("clipPath",{id:"clip0_1715_1956",children:/*#__PURE__*/t("rect",{x:"0.5",width:"32",height:"32",rx:"4",fill:"white"})})})]})}function Un(n){/*#__PURE__*/return e("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 496 512",...n,children:[/*#__PURE__*/t("path",{fill:"#1ed760",d:"M248 8C111.1 8 0 119.1 0 256s111.1 248 248 248 248-111.1 248-248S384.9 8 248 8Z"}),/*#__PURE__*/t("path",{d:"M406.6 231.1c-5.2 0-8.4-1.3-12.9-3.9-71.2-42.5-198.5-52.7-280.9-29.7-3.6 1-8.1 2.6-12.9 2.6-13.2 0-23.3-10.3-23.3-23.6 0-13.6 8.4-21.3 17.4-23.9 35.2-10.3 74.6-15.2 117.5-15.2 73 0 149.5 15.2 205.4 47.8 7.8 4.5 12.9 10.7 12.9 22.6 0 13.6-11 23.3-23.2 23.3zm-31 76.2c-5.2 0-8.7-2.3-12.3-4.2-62.5-37-155.7-51.9-238.6-29.4-4.8 1.3-7.4 2.6-11.9 2.6-10.7 0-19.4-8.7-19.4-19.4s5.2-17.8 15.5-20.7c27.8-7.8 56.2-13.6 97.8-13.6 64.9 0 127.6 16.1 177 45.5 8.1 4.8 11.3 11 11.3 19.7-.1 10.8-8.5 19.5-19.4 19.5zm-26.9 65.6c-4.2 0-6.8-1.3-10.7-3.6-62.4-37.6-135-39.2-206.7-24.5-3.9 1-9 2.6-11.9 2.6-9.7 0-15.8-7.7-15.8-15.8 0-10.3 6.1-15.2 13.6-16.8 81.9-18.1 165.6-16.5 237 26.2 6.1 3.9 9.7 7.4 9.7 16.5s-7.1 15.4-15.2 15.4z"})]})}function Bn(e){/*#__PURE__*/return t("svg",{xmlns:"http://www.w3.org/2000/svg","shape-rendering":"geometricPrecision","text-rendering":"geometricPrecision","image-rendering":"optimizeQuality","fill-rule":"evenodd","clip-rule":"evenodd",viewBox:"0 0 1000 1000",...e,children:/*#__PURE__*/t("path",{d:"M906.25 0H93.75C42.19 0 0 42.19 0 93.75v812.49c0 51.57 42.19 93.75 93.75 93.75l812.5.01c51.56 0 93.75-42.19 93.75-93.75V93.75C1000 42.19 957.81 0 906.25 0zM684.02 319.72c-32.42-21.13-55.81-54.96-63.11-94.38-1.57-8.51-2.45-17.28-2.45-26.25H515l-.17 414.65c-1.74 46.43-39.96 83.7-86.8 83.7-14.57 0-28.27-3.63-40.35-9.99-27.68-14.57-46.63-43.58-46.63-76.97 0-47.96 39.02-86.98 86.97-86.98 8.95 0 17.54 1.48 25.66 4.01V421.89c-8.41-1.15-16.95-1.86-25.66-1.86-105.01 0-190.43 85.43-190.43 190.45 0 64.42 32.18 121.44 81.3 155.92 30.93 21.72 68.57 34.51 109.14 34.51 105.01 0 190.43-85.43 190.43-190.43V400.21c40.58 29.12 90.3 46.28 143.95 46.28V343.03c-28.89 0-55.8-8.59-78.39-23.31z"})})}function zn(n){/*#__PURE__*/return t("svg",{xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",viewBox:"0 0 2400 2800",...n,children:/*#__PURE__*/e("g",{children:[/*#__PURE__*/t("polygon",{fill:"#FFFFFF",points:"2200,1300 1800,1700 1400,1700 1050,2050 1050,1700 600,1700 600,200 2200,200"}),/*#__PURE__*/t("g",{children:/*#__PURE__*/e("g",{id:"Layer_1-2",children:[/*#__PURE__*/t("path",{fill:"#9146FF",d:"M500,0L0,500v1800h600v500l500-500h400l900-900V0H500z M2200,1300l-400,400h-400l-350,350v-350H600V200h1600V1300z"}),/*#__PURE__*/t("rect",{x:"1700",y:"550",width:"200",height:"600",fill:"#9146FF"}),/*#__PURE__*/t("rect",{x:"1150",y:"550",width:"200",height:"600",fill:"#9146FF"})]})})]})})}const Vn=n=>/*#__PURE__*/e("svg",{width:"33",height:"32",viewBox:"0 0 33 32",fill:"none",xmlns:"http://www.w3.org/2000/svg",...n,children:[/*#__PURE__*/t("rect",{x:"0.5",width:"32",height:"32",rx:"4",fill:"black"}),/*#__PURE__*/t("path",{d:"M8.53901 8L14.7164 16.2153L8.5 22.8947H9.89907L15.3415 17.0468L19.7389 22.8947H24.5L17.975 14.2173L23.7612 8H22.3621L17.3499 13.3858L13.3001 8H8.53901ZM10.5964 9.02501H12.7837L22.4422 21.8695H20.255L10.5964 9.02501Z",fill:"#F7F7F7"})]});function Hn(){let e=new URL(window.location.href);e.searchParams.delete("privy_oauth_code"),e.searchParams.delete("privy_oauth_provider"),e.searchParams.delete("privy_oauth_state"),yn.del(G),window.history.replaceState({},"",e)}const jn=({address:e,chainId:t,nonce:n})=>`${window.location.host} wants you to sign in with your Ethereum account:\n${e}\n\nBy signing, you are proving you own this wallet and logging in. This does not initiate a transaction or cost any fees.\n\nURI: ${window.location.origin}\nVersion: 1\nChain ID: ${t}\nNonce: ${n}\nIssued At: ${(new Date).toISOString()}\nResources:\n- https://privy.io`;class $n{get meta(){return{connectorType:this.wallet?.connectorType,walletClientType:this.wallet?.walletClientType,chainId:this.wallet?.chainId,address:this.wallet?.address,disableSignup:this._meta.disableSignup}}async authenticate(){if(!this.client)throw new _("SiweFlow has no client instance");try{if(this.preparedMessage&&this.signature)return await this.client.authenticateWithSiweInternal({message:this.preparedMessage,signature:this.signature,chainId:this.wallet?.chainId,walletClientType:this.walletClientType??this.wallet?.walletClientType,connectorType:this.connectorType??this.wallet?.connectorType,mode:this._meta.disableSignup?"no-signup":"login-or-sign-up"});if(!this.wallet)throw new _("SiweFlow has no wallet instance");let{message:e,signature:t}=await this.sign();return await this.client.authenticateWithSiweInternal({message:e,signature:t,chainId:this.wallet.chainId,walletClientType:this.wallet.walletClientType,connectorType:this.wallet.connectorType,mode:this.meta.disableSignup?"no-signup":"login-or-sign-up"})}catch(e){throw M(e)}}async link(){if(!this.client)throw new _("SiweFlow has no client instance");try{if(!this.wallet)throw new _("SiweFlow has no wallet instance");let{message:e,signature:t}=await this.sign();return await this.client.linkWithSiweInternal({message:e,signature:t,chainId:this.wallet.chainId,walletClientType:this.wallet.walletClientType,connectorType:this.wallet.connectorType})}catch(e){throw M(e)}}async sign(){if(!this.client)throw new _("SiweFlow has no client instance");if(await this.buildMessage(),!this.preparedMessage)throw new _("Could not prepare SIWE message");if(!this.wallet)throw new _("SiweFlow has no wallet instance");let e=await this.wallet.sign(this.preparedMessage);return{message:this.preparedMessage,signature:e}}async _getNonceOnce(){if(!this.client)throw new _("SiweFlow has no client instance");if(!this.wallet)throw new _("UI SiweFlow has no wallet instance");return await this.client.generateSiweNonce({address:this.wallet.address,captchaToken:this.captchaToken})}async buildMessage(){if(!this.client)throw new _("SiweFlow has no client instance");if(!this.wallet)throw new _("SiweFlow has no wallet instance");let e=this.wallet.address,t=this.wallet.chainId.replace("eip155:","");return this.nonce||(this.nonce=await this.getNonceOnce.execute()),this.preparedMessage=jn({address:e,chainId:t,nonce:this.nonce}),this.preparedMessage}constructor(e,t,n,a=!1,i){this._meta={disableSignup:!1},this.getNonceOnce=new Tn(this._getNonceOnce.bind(this)),this.wallet=t,this.captchaToken=n,this.client=e,this._meta.disableSignup=a,this.preparedMessage=i?.message,this.signature=i?.signature,this.walletClientType=i?.walletClientType,this.connectorType=i?.connectorType}}const qn=({address:e,nonce:t})=>`${window.location.host} wants you to sign in with your Solana account:\n${e}\n\n${`You are proving you own ${e}.`}\n\nURI: ${window.location.origin}\nVersion: 1\nChain ID: mainnet\nNonce: ${t}\nIssued At: ${(new Date).toISOString()}\nResources:\n- https://privy.io`;class Gn{get meta(){return{connectorType:this.wallet.connectorType,walletClientType:this.wallet.walletClientType,disableSignup:this._meta.disableSignup,messageType:this._meta.messageType,address:this.wallet?.address}}set messageType(e){this._meta.messageType=e}async authenticate(){if(!this.client)throw new _("SiwsFlow has no client instance");try{let{message:e,signature:t}=await this.sign();return await this.client.authenticateWithSiwsInternal({message:e,signature:t,walletClientType:this.wallet.walletClientType,connectorType:this.wallet.connectorType,mode:this.meta.disableSignup?"no-signup":"login-or-sign-up",messageType:this.meta.messageType})}catch(e){throw M(e)}}async link(){if(!this.client)throw new _("SiwsFlow has no client instance");try{let{message:e,signature:t}=await this.sign();return await this.client.linkWithSiwsInternal({message:e,signature:t,walletClientType:this.wallet.walletClientType,connectorType:this.wallet.connectorType,messageType:this.meta.messageType})}catch(e){throw M(e)}}async sign(){let e,t;if(!this.client)throw new _("SiwsFlow has no client instance");await this.buildMessage();let n="transaction"===this.meta.messageType;if(!this.preparedMessage)throw new _("Could not prepare SIWS message");if(!n&&!this.wallet.provider.signMessage||n&&!this.wallet.provider.signTransaction)throw new _("Wallet does not support the necessary signing methods");if(n&&this._plugin){let n=await this.wallet.provider.signTransaction({transaction:Wt.decode(this.preparedMessage)});e=Wt.encode(n.signedTransaction),t=this._plugin.getSignatureFromTransaction(n.signedTransaction,this.wallet.address)}else{e=this.preparedMessage;let n=await this.wallet.provider.signMessage({message:(new TextEncoder).encode(this.preparedMessage)});t=Wt.encode(n.signature)}return{message:e,signature:t}}async _getNonceOnce(){if(!this.client)throw new _("SiwsFlow has no client instance");return await this.client.generateSiwsNonce({address:this.wallet.address,captchaToken:this.captchaToken})}async buildMessage(){if(!this.client)throw new _("SiwsFlow has no client instance");let e=this.wallet.address;return this.nonce||(this.nonce=await this.getNonceOnce.execute()),"transaction"===this.meta.messageType&&this._plugin?this.preparedMessage=this._plugin.createSiwsMemoTransaction({address:e,nonce:this.nonce}):this.preparedMessage=qn({address:e,nonce:this.nonce}),this.preparedMessage}constructor(e,t,n,a=!1,i="plain",r){this._meta={disableSignup:!1,messageType:"plain"},this.getNonceOnce=new Tn(this._getNonceOnce.bind(this)),this.wallet=e,this.captchaToken=n,this.client=t,this._meta.disableSignup=a,this._meta.messageType=i,this._plugin=r}}const Zn=e=>e.isApexWallet?"Apex Wallet":e.isAvalanche?"Core Wallet":e.isBackpack?"Backpack":e.isBifrost?"Bifrost Wallet":e.isBitKeep?"BitKeep":e.isBitski?"Bitski":e.isBlockWallet?"BlockWallet":e.isBraveWallet?"Brave Wallet":e.isClover?"Clover":e.isCoin98?"Coin98 Wallet":e.isCoinbaseWallet?"Coinbase Wallet":e.isDawn?"Dawn Wallet":e.isDefiant?"Defiant":e.isDesig?"Desig Wallet":e.isEnkrypt?"Enkrypt":e.isExodus?"Exodus":e.isFordefi?"Fordefi":e.isFrame?"Frame":e.isFrontier?"Frontier Wallet":e.isGamestop?"GameStop Wallet":e.isHaqqWallet?"HAQQ Wallet":e.isHyperPay?"HyperPay Wallet":e.isImToken?"ImToken":e.isHaloWallet?"Halo Wallet":e.isKuCoinWallet?"KuCoin Wallet":e.isMathWallet?"MathWallet":e.isNovaWallet?"Nova Wallet":e.isOkxWallet||e.isOKExWallet?"OKX Wallet":e.isOneInchIOSWallet||e.isOneInchAndroidWallet?"1inch Wallet":e.isOneKey?"OneKey Wallet":e.isOpera?"Opera":e.isPhantom||"isPhantom"in e?"Phantom":e.isPortal?"Ripio Portal":e.isRabby?"Rabby Wallet":e.isRainbow?"Rainbow":e.isSafePal?"SafePal Wallet":e.isStatus?"Status":e.isSubWallet?"SubWallet":e.isTalisman?"Talisman":e.isTally||e.isTaho?"Taho":e.isTokenPocket?"TokenPocket":e.isTokenary?"Tokenary":e.isTrust||e.isTrustWallet?"Trust Wallet":e.isTTWallet?"TTWallet":e.isXDEFI?"XDEFI Wallet":e.isZeal?"Zeal":e.isZerion?"Zerion":e.isMetaMask?"MetaMask":void 0,Qn=(e,t)=>{if(!e.isMetaMask)return!1;if(e.isMetaMask&&!t)return!0;if(e.isBraveWallet&&!e._events&&!e._state||"MetaMask"!==Zn(e))return!1;if(e.providers)for(let t of e.providers)if(!Qn(t))return!1;return!0},Yn=()=>{let e=window;if(!e.ethereum)return!1;if(e.ethereum.isCoinbaseWallet)return!0;if(e.ethereum.providers)for(let t of e.ethereum.providers)if(t&&t.isCoinbaseWallet)return!0;return!1},Kn=(e,t,n,a)=>{let i=Number(e),r=t.find((e=>e.id===i));if(!r)throw new W(`Unsupported chainId ${e}`,4901);return ce({transport:de(Xn(r,n,a.appId)),chain:r})},Xn=(e,t,n)=>{let a,i=e.id,r=Number(e.id);if(e.rpcUrls.privyWalletOverride&&e.rpcUrls.privyWalletOverride.http[0])a=e.rpcUrls.privyWalletOverride.http[0];else if(t.rpcUrls&&t.rpcUrls[r])a=t.rpcUrls[r];else if(e.rpcUrls.privy?.http[0]){let t=new URL(e.rpcUrls.privy.http[0]);t.searchParams.append("privyAppId",n),a=t.toString()}else a=e.rpcUrls.public?.http[0]?e.rpcUrls.public.http[0]:e.rpcUrls.default?.http[0];if(!a)throw new W(`No RPC url found for ${i}`);return a},Jn=e=>!!String(e).toLowerCase().match(/^(([^<>()[\]\\.,;:\s@"]+(\.[^<>()[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/),ea=(e,t=3,n=4,a="ethereum")=>{if(!e)return"";let i="ethereum"===a?2:0;return t+n+i+3>=e.length?e:`${e.slice(0,i+t)}...${e.slice(e.length-n,e.length)}`},ta=(e,t=3,n=4)=>ea(e,t,n,"solana"),na=e=>new Promise((t=>setTimeout(t,e)));const aa=(e,t={})=>{let n=t.delayMs||150,a=t.maxAttempts||270;return new Promise((async(i,r)=>{let o=!1,l=0;for(;!o&&l<a;){if(t.abortSignal?.aborted)return;e().then((e=>{o=!0,i(e)}),((...e)=>{o=!0,r(...e)})),l+=1,await na(n)}o||r(Error("Exceeded max attempts before resolving function"))}))},ia=e=>e.replace(/([\u2700-\u27BF]|[\uE000-\uF8FF]|\uD83C[\uDC00-\uDFFF]|\uD83D[\uDC00-\uDFFF]|[\u2011-\u26FF]|\uD83E[\uDD10-\uDDFF])/g,""),ra=e=>"string"==typeof e?e:"0x"+e.toString(16);async function oa({store:e,walletList:t,externalWalletConfig:n,walletChainType:a,timeout:i=3e3}){let r=!1,o=window;return new Promise((l=>{function s(){if(r)return;r=!0,window.removeEventListener("ethereum#initialized",s);let i=e.getProviders();console.debug("Detected injected providers:",i.map((e=>e.info)));let o=[];for(let e of i)t.includes("coinbase_wallet")&&"com.coinbase.wallet"===e.info.rdns||"solana-only"===a&&"app.phantom"===e.info.rdns||o.push({type:e.info.name.toLowerCase().replace(/\s/g,"_"),eip6963InjectedProvider:e});if("solana-only"!==a)for(let e of function(){let e=window,t=e.ethereum;if(!t)return[];let n=[];if(t.providers?.length)for(let e of t.providers)e&&n.push(e);return n.push(e.ethereum),n}()){let t=Zn(e);if(!i.some((e=>e.info.name===t))){if(Qn(e,!0)&&!o.find((e=>"metamask"===e.type))){o.push({type:"metamask",legacyInjectedProvider:e});continue}if("Phantom"===t&&!o.find((e=>"phantom"===e.type))){o.push({type:"phantom",legacyInjectedProvider:e});continue}if("Coinbase Wallet"===t&&!o.find((e=>"coinbase_wallet"===e.type&&"smartWalletOnly"!==n.coinbaseWallet?.config?.preference?.options))){o.push({type:"coinbase_wallet",legacyInjectedProvider:e});continue}o.find((e=>"unknown_browser_extension"===e.type))||o.push({type:"unknown_browser_extension",legacyInjectedProvider:e})}}l(o)}o.ethereum?s():(window.addEventListener("ethereum#initialized",s,{once:!0}),setTimeout((()=>{s()}),i))}))}function la(e){return`eip155:${String(Number(e))}`}const sa=(e,t,n,a)=>{let i=Number(e),r=t.find((e=>e.id===i));if(!r)throw new W(`Unsupported chainId ${e}`,4901);return Xn(r,n,a)},ca=e=>{let t={name:"string",version:"string",chainId:"uint256",verifyingContract:"address",salt:"bytes32"},n=e.types.EIP712Domain??Object.entries(e.domain).map((([e,n])=>{if(null!=n&&"string"==typeof e&&e in t)return{name:e,type:t[e]}})).filter((e=>void 0!==e));return{...e,types:{...e.types,EIP712Domain:n}}};const da=e=>e?.map((e=>({signer_id:e.signerId,override_policy_ids:e.policyIds}))),pa=/*#__PURE__*/x({siteKey:"",enabled:!1,appId:void 0,token:void 0,error:void 0,status:"disabled",setToken:F,setError:F,setExecuting:F,waitForResult:()=>Promise.resolve(""),ref:{current:null},remove:F,reset:F,execute:F});class ha extends L{constructor(e,t,n){super(e||"Captcha failed"),this.type="Captcha",t instanceof Error&&(this.cause=t),this.privyErrorCode=n}}const ua=({children:e,id:n,captchaSiteKey:a,captchaEnabled:i})=>{let r=k(null),[o,l]=T(),[s,c]=T(),[d,p]=T(!1),h=A((()=>i?d||o||s?!d||o||s?o&&!s?{status:"success",token:o}:s?{status:"error",error:s}:{status:"ready"}:{status:"loading"}:{status:"ready"}:{status:"disabled"}),[i,o,s,d]);/*#__PURE__*/return t(pa.Provider,{value:{...h,ref:r,enabled:i,siteKey:a,appId:n,setToken:l,setError:c,setExecuting:p,remove(){i&&(r.current?.remove(),p(!1),c(void 0),l(void 0))},reset(){i&&(r.current?.reset(),p(!1),c(void 0),l(void 0))},execute(){i&&(p(!0),r.current?.execute())},async waitForResult(){if(!i)return"";try{return await function(e,{interval:t=100,timeout:n=5e3}={}){return new Promise(((a,i)=>{let r,o=0,l=()=>{o>=n?i("Max attempts reached without result"):(r=e(),o+=t,null==r?setTimeout(l,t):a(r))};l()}))}((()=>r.current?.getResponse()),{interval:200,timeout:2e4})}catch(e){throw new ha("Captcha failed",null,P.CAPTCHA_TIMEOUT)}}},children:e})},ma=()=>C(pa);class ga{async authenticate(){if(!this.api)throw new _("Auth flow has no API instance");try{return await this.api.post(D,{captcha_token:this.meta.captchaToken,telegram_auth_result:this.meta.telegramAuthResult,telegram_web_app_data:this.meta.telegramWebAppData,mode:this.meta.disableSignup?"no-signup":"login-or-sign-up"})}catch(e){throw M(e)}}async link(){if(!this.api)throw new _("Auth flow has no API instance");try{return await this.api.post(R,{telegram_auth_result:this.meta.telegramAuthResult,telegram_web_app_data:this.meta.telegramWebAppData})}catch(e){throw M(e)}}constructor(e,t=!1){this.meta={disableSignup:!1},this.meta={captchaToken:e,disableSignup:!1},this.meta.disableSignup=t}}function ya(e){let t={detail:"",retryable:!1};return e?.privyErrorCode===P.LINKED_TO_ANOTHER_USER&&(t.detail="This account has already been linked to another user."),e?.privyErrorCode===P.DISALLOWED_LOGIN_METHOD&&(t.detail="Login with Telegram not allowed."),e?.privyErrorCode===P.INVALID_DATA&&(t.retryable=!0,t.detail="Something went wrong. Try again."),e?.privyErrorCode===P.CANNOT_LINK_MORE_OF_TYPE&&(t.retryable=!0,t.detail="Something went wrong. Try again."),e?.privyErrorCode===P.INVALID_CREDENTIALS&&(t.retryable=!0,t.detail="Something went wrong. Try again."),e?.privyErrorCode===P.TOO_MANY_REQUESTS&&(t.detail="Too many requests. Please wait before trying again."),e?.privyErrorCode===P.TOO_MANY_REQUESTS&&e.message.includes("rate limit")&&(t.detail="Request limit reached for Telegram. Please wait a moment and try again."),e instanceof ha&&(t.retryable=!0,t.detail="Something went wrong. Try again."),t}function fa(){let e;return(e=function(){let e=new URLSearchParams(window.location.search),t=Number(e.get("id")||""),n=e.get("hash"),a=Number(e.get("auth_date")||""),i=e.get("first_name");if(t&&i&&a&&n)return Object.fromEntries(e.entries())}())?(va(),{flowType:"login-url",authData:e}):(e=function(){let e=window.location.hash;if(!e||!e.startsWith("#tgWebAppData"))return;let t=wa(e.replace("#tgWebAppData=","")),{user:n,auth_date:a,hash:i}=t;return n&&a&&i?t:void 0}())?(va(),{flowType:"web-app",authData:e}):void 0}function wa(e){return Object.fromEntries(decodeURIComponent(e).split("&").map((e=>e.split("=").map(decodeURIComponent))))}function va(){let e=new URL(window.location.href);e.searchParams.delete("id"),e.searchParams.delete("hash"),e.searchParams.delete("auth_date"),e.searchParams.delete("first_name"),e.searchParams.delete("last_name"),e.searchParams.delete("username"),e.searchParams.delete("photo_url"),e.hash="",window.history.replaceState({},"",e)}function ba(e){return e?new Date(1e3*e):null}function Ca(e,t){return e.slice().sort(((e,t)=>(e.firstVerifiedAt?.getTime()??0)-(t.firstVerifiedAt?.getTime()??0))).find((e=>e.type===t))}const xa=e=>e?ka(e).find((e=>0===e.walletIndex))??null:null,ka=e=>e?Ta(e,"ethereum"):[],Ta=(e,t)=>e.linkedAccounts.filter((e=>"wallet"===e.type&&"privy"===e.walletClientType&&!e.imported&&e.chainType===t)),Aa=e=>e?Ta(e,"solana"):[],Ia=e=>e?Aa(e).find((e=>0===e.walletIndex))??null:null,Sa=e=>(e?.linkedAccounts??[]).filter((e=>"wallet"===e.type&&"privy"===e.walletClientType&&e.imported&&"ethereum"===e.chainType)),Na=e=>(e?.linkedAccounts??[]).filter((e=>"wallet"===e.type&&e.imported&&"privy"===e.walletClientType&&"solana"===e.chainType)),Ea=(e,t)=>e===t||!(!e.startsWith("0x")||!t.startsWith("0x"))&&pe(e)===pe(t),_a=(e,t)=>e?.linkedAccounts.find((e=>"wallet"===e.type&&"privy"===e.walletClientType&&Ea(e.address,t)))||null,Ma=(e,t)=>e.find((e=>Ea(e.address,t)))||null,Wa=e=>xa(e)??Ia(e);function La(e){if(!e)return null;let t=function(e){let t=[];for(let n of e){let e=n.type;switch(n.type){case"wallet":let a={id:n.id,address:n.address,type:n.type,imported:n.imported,delegated:n.delegated,firstVerifiedAt:ba(n.first_verified_at),latestVerifiedAt:ba(n.latest_verified_at),chainType:n.chain_type,walletClientType:n.wallet_client_type,connectorType:n.connector_type,recoveryMethod:n.recovery_method,walletIndex:n.wallet_index,publicKey:n.public_key};t.push(a);break;case"smart_wallet":let i={address:n.address,type:n.type,firstVerifiedAt:ba(n.first_verified_at),latestVerifiedAt:ba(n.latest_verified_at),smartWalletType:n.smart_wallet_type,smartWalletVersion:n.smart_wallet_version};t.push(i);break;case"cross_app":let r={type:n.type,subject:n.subject,embeddedWallets:n.embedded_wallets,smartWallets:n.smart_wallets,providerApp:{id:n.provider_app_id},firstVerifiedAt:ba(n.first_verified_at),latestVerifiedAt:ba(n.latest_verified_at)};t.push(r);break;case"email":let o={address:n.address,type:n.type,firstVerifiedAt:ba(n.first_verified_at),latestVerifiedAt:ba(n.latest_verified_at)};t.push(o);break;case"phone":let l={number:n.phoneNumber,type:n.type,firstVerifiedAt:ba(n.first_verified_at),latestVerifiedAt:ba(n.latest_verified_at)};t.push(l);break;case"google_oauth":let s={subject:n.subject,email:n.email,name:n.name,type:n.type,firstVerifiedAt:ba(n.first_verified_at),latestVerifiedAt:ba(n.latest_verified_at)};t.push(s);break;case"spotify_oauth":let c={subject:n.subject,email:n.email,name:n.name,type:n.type,firstVerifiedAt:ba(n.first_verified_at),latestVerifiedAt:ba(n.latest_verified_at)};t.push(c);break;case"instagram_oauth":let d={subject:n.subject,username:n.username,type:n.type,firstVerifiedAt:ba(n.first_verified_at),latestVerifiedAt:ba(n.latest_verified_at)};t.push(d);break;case"twitter_oauth":let p={subject:n.subject,username:n.username,name:n.name,type:n.type,profilePictureUrl:n.profile_picture_url,firstVerifiedAt:ba(n.first_verified_at),latestVerifiedAt:ba(n.latest_verified_at)};t.push(p);break;case"discord_oauth":let h={subject:n.subject,username:n.username,email:n.email,type:n.type,firstVerifiedAt:ba(n.first_verified_at),latestVerifiedAt:ba(n.latest_verified_at)};t.push(h);break;case"github_oauth":let u={subject:n.subject,username:n.username,name:n.name,email:n.email,type:n.type,firstVerifiedAt:ba(n.first_verified_at),latestVerifiedAt:ba(n.latest_verified_at)};t.push(u);break;case"tiktok_oauth":let m={subject:n.subject,username:n.username,name:n.name,type:n.type,firstVerifiedAt:ba(n.first_verified_at),latestVerifiedAt:ba(n.latest_verified_at)};t.push(m);break;case"line_oauth":let g={subject:n.subject,name:n.name,email:n.email,profilePictureUrl:n.profile_picture_url,type:n.type,firstVerifiedAt:ba(n.first_verified_at),latestVerifiedAt:ba(n.latest_verified_at)};t.push(g);break;case"twitch_oauth":let y={subject:n.subject,username:n.username,type:n.type,firstVerifiedAt:ba(n.first_verified_at),latestVerifiedAt:ba(n.latest_verified_at)};t.push(y);break;case"linkedin_oauth":let f={subject:n.subject,name:n.name,email:n.email,vanityName:n.vanity_name,type:n.type,firstVerifiedAt:ba(n.first_verified_at),latestVerifiedAt:ba(n.latest_verified_at)};t.push(f);break;case"apple_oauth":let w={subject:n.subject,email:n.email,type:n.type,firstVerifiedAt:ba(n.first_verified_at),latestVerifiedAt:ba(n.latest_verified_at)};t.push(w);break;case"custom_auth":t.push({type:n.type,customUserId:n.custom_user_id,firstVerifiedAt:ba(n.first_verified_at),latestVerifiedAt:ba(n.latest_verified_at)});break;case"farcaster":let v={type:n.type,fid:n.fid,ownerAddress:n.owner_address,displayName:n.display_name,username:n.username,bio:n.bio,pfp:n.profile_picture_url,url:n.homepage_url,firstVerifiedAt:ba(n.first_verified_at),latestVerifiedAt:ba(n.latest_verified_at),signerPublicKey:n.signer_public_key};t.push(v);break;case"passkey":let b={type:n.type,enrolledInMfa:n.enrolled_in_mfa,credentialId:n.credential_id,publicKey:n.public_key,authenticatorName:n.authenticator_name,createdWithDevice:n.created_with_device,createdWithOs:n.created_with_os,createdWithBrowser:n.created_with_browser,firstVerifiedAt:ba(n.first_verified_at),latestVerifiedAt:ba(n.latest_verified_at)};t.push(b);break;case"telegram":let C={type:n.type,telegramUserId:n.telegram_user_id,firstName:n.first_name,lastName:n.last_name,username:n.username,photoUrl:n.photo_url,firstVerifiedAt:ba(n.first_verified_at),latestVerifiedAt:ba(n.latest_verified_at)};t.push(C);break;default:if(Mn(n.type)){let e={type:n.type,subject:n.subject,name:n.name,username:n.username,email:n.email,profilePictureUrl:n.profile_picture_url,firstVerifiedAt:ba(n.first_verified_at),latestVerifiedAt:ba(n.latest_verified_at)};t.push(e);break}console.warn(`Unrecognized account type: ${e}. Please consider upgrading the Privy SDK.`)}}return t}(e.linked_accounts),n=Ca(t,"wallet"),a=Ca(t,"smart_wallet"),i=Ca(t,"email"),r=Ca(t,"phone"),o=Ca(t,"google_oauth"),l=Ca(t,"twitter_oauth"),s=Ca(t,"discord_oauth"),c=Ca(t,"github_oauth"),d=Ca(t,"spotify_oauth"),p=Ca(t,"instagram_oauth"),h=Ca(t,"tiktok_oauth"),u=Ca(t,"line_oauth"),m=Ca(t,"twitch_oauth"),g=Ca(t,"linkedin_oauth"),y=Ca(t,"apple_oauth"),f=Ca(t,"farcaster"),w=Ca(t,"telegram"),v=e.mfa_methods.map((({type:e,verified_at:t})=>({type:e,verifiedAt:ba(t)})));return{id:e.id,createdAt:ba(e.created_at),linkedAccounts:t,email:i&&{address:i?.address},phone:r&&{number:r?.number},wallet:n&&{id:n.id,address:n.address,chainType:n.chainType,walletClientType:n.walletClientType,connectorType:n.connectorType,recoveryMethod:n.recoveryMethod,imported:n.imported,delegated:n.delegated,walletIndex:n.walletIndex,publicKey:n.publicKey},smartWallet:a&&{address:a.address,smartWalletType:a.smartWalletType,smartWalletVersion:a.smartWalletVersion},google:o&&{subject:o.subject,email:o.email,name:o.name},twitter:l&&{subject:l.subject,username:l.username,name:l.name,profilePictureUrl:l.profilePictureUrl},discord:s&&{subject:s.subject,username:s.username,email:s.email},github:c&&{subject:c.subject,username:c.username,name:c.name,email:c.email},spotify:d&&{subject:d.subject,email:d.email,name:d.name},instagram:p&&{subject:p.subject,username:p.username},tiktok:h&&{subject:h.subject,username:h.username,name:h.name},line:u&&{subject:u.subject,name:u.name,email:u.email,profilePictureUrl:u.profilePictureUrl},twitch:m&&{subject:m.subject,username:m.username},linkedin:g&&{subject:g.subject,name:g.name,email:g.email,vanityName:g.vanityName},apple:y&&{subject:y.subject,email:y.email},farcaster:f&&{fid:f.fid,ownerAddress:f.ownerAddress,displayName:f.displayName,username:f.username,bio:f.bio,pfp:f.pfp,url:f.url,signerPublicKey:f.signerPublicKey},telegram:w&&{telegramUserId:w.telegramUserId,firstName:w.firstName,lastName:w.lastName,username:w.username,photoUrl:w.photoUrl},delegatedWallets:[],mfaMethods:v.map((e=>e.type)),hasAcceptedTerms:e.has_accepted_terms??!1,isGuest:e.is_guest,customMetadata:e.custom_metadata}}const Pa=Ct((()=>({listings:[],loading:!1}))),Fa=Pa.setState,Da=e=>{let t;try{t=new URL(e).hostname}catch(e){return}return Pa.getState().listings.find((({homepage:e})=>{let n;try{n=new URL(e).hostname}catch(e){return!1}return t.includes(n)}))},Ra=(e=!0)=>{let t=Z(),n=Pa((e=>e.listings)),a=Pa((e=>e.loading)),i=!!n.length;return I((()=>{e&&!i&&(Fa({listings:[],loading:!0}),(async e=>{let t=new URL("v3/wallets","https://explorer-api.walletconnect.com");t.searchParams.append("projectId",e);let n=await fetch(t);return n.ok?Object.values((await n.json()).listings).sort((({slug:e},{slug:t})=>"rainbow"===e&&"metamask"===t?1:"metamask"===e||"rainbow"===e?-1:1)):(console.debug(`Failed to fetch WalletConnect listings: ${await n.text().catch((()=>"No response."))}`),[])})(t.walletConnectCloudProjectId).then((e=>Fa({listings:e,loading:!1}))).catch((e=>{console.error(e),Fa({listings:[],loading:!1})})))}),[e,i,t.walletConnectCloudProjectId]),{listings:n,loading:a}},Oa=e=>{let{listings:t}=Ra();return t.find((({slug:t})=>Ua(t)===Ua(e)))};function Ua(e){return"cryptocom"===e?"cryptocom-defi":"binance"===e?"binance-defi":e.replace(/[-_]wallet$/,"")}function Ba(e){return["wallet_connect","backpack","binance","binanceus","bitget_wallet","bybit_wallet","cryptocom","haha_wallet","metamask","okx_wallet","phantom","rabby_wallet","rainbow","ronin_wallet","safe","solflare","uniswap","zerion"].some((t=>e?.includes(t)))}const za=e=>{if("ethereum"===e.chainType)return{entropyId:e.address,entropyIdVerifier:"ethereum-address-verifier"};if("solana"===e.chainType)return{entropyId:e.address,entropyIdVerifier:"solana-address-verifier"};throw Error("Failed to get account entropy details")},Va=(e,t)=>{if(t?.imported)return za(t);let n=Wa(e);if(!n)throw Error("Failed to find primary wallet");return za(n)},Ha=({style:n,...a})=>/*#__PURE__*/e("svg",{viewBox:"0 0 1024 1024",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:{height:"28px",width:"28px",...n},...a,children:[/*#__PURE__*/t("rect",{width:"1024",height:"1024",fill:"#0052FF",rx:100,ry:100}),/*#__PURE__*/t("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M152 512C152 710.823 313.177 872 512 872C710.823 872 872 710.823 872 512C872 313.177 710.823 152 512 152C313.177 152 152 313.177 152 512ZM420 396C406.745 396 396 406.745 396 420V604C396 617.255 406.745 628 420 628H604C617.255 628 628 617.255 628 604V420C628 406.745 617.255 396 604 396H420Z",fill:"white"})]}),ja="data:image/svg+xml;base64,PHN2ZyB2aWV3Qm94PScwIDAgMTAyNCAxMDI0JyBmaWxsPSdub25lJyB4bWxucz0naHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmcnIHN0eWxlPSdoZWlnaHQ6MjhweDt3aWR0aDoyOHB4Jz48cmVjdCB3aWR0aD0nMTAyNCcgaGVpZ2h0PScxMDI0JyBmaWxsPScjMDA1MkZGJyByeD0nMTAwJyByeT0nMTAwJz48L3JlY3Q+PHBhdGggZmlsbC1ydWxlPSdldmVub2RkJyBjbGlwLXJ1bGU9J2V2ZW5vZGQnIGQ9J00xNTIgNTEyQzE1MiA3MTAuODIzIDMxMy4xNzcgODcyIDUxMiA4NzJDNzEwLjgyMyA4NzIgODcyIDcxMC44MjMgODcyIDUxMkM4NzIgMzEzLjE3NyA3MTAuODIzIDE1MiA1MTIgMTUyQzMxMy4xNzcgMTUyIDE1MiAzMTMuMTc3IDE1MiA1MTJaTTQyMCAzOTZDNDA2Ljc0NSAzOTYgMzk2IDQwNi43NDUgMzk2IDQyMFY2MDRDMzk2IDYxNy4yNTUgNDA2Ljc0NSA2MjggNDIwIDYyOEg2MDRDNjE3LjI1NSA2MjggNjI4IDYxNy4yNTUgNjI4IDYwNFY0MjBDNjI4IDQwNi43NDUgNjE3LjI1NSAzOTYgNjA0IDM5Nkg0MjBaJyBmaWxsPSd3aGl0ZSc+PC9wYXRoPjwvc3ZnPg==",$a="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAYAAABXAvmHAAAAAXNSR0IArs4c6QAAALZJREFUaEPtmjEOhDAMBNc/O14GvOzys3CAKK6eAlmaVGl2Zc+kTOU685vkc9/bnD2prZK5/TZY24z9P+g4F5hNh7/GdoG37WlAA5CATwgCxHENYISwQAMQII5rACOEBRqAAHFcAxghLNAABIjjGsAIYYEGIEAc1wBGCAs0AAHiuAYwQligAQgQxzWAEcICDUCAOK4BjBAWaAACxHENYISwQAMQII6fBjr+VHkW3+u+tfyxMpJaDgYzYxb/ALZVAAAAAElFTkSuQmCC";class qa extends W{constructor(){super("Wallet timeout"),this.type="wallet_error"}}const Ga=e=>e instanceof W?e:e?.code?new Qa(e):new W("Unknown connector error",e);class Za extends L{constructor(e,t,n){super(e),this.type="provider_error",this.code=t,this.data=n}}class Qa extends Za{constructor(e){super(e.message,e.code,e.data);let t=Object.values(je).find((t=>t.eipCode===e.code));this.details=t||je.UNKNOWN_ERROR,-32002===e.code&&(e.message?.includes("already pending for origin")?e.message?.includes("wallet_requestPermissions")?this.details=je.E32002_CONNECTION_ALREADY_PENDING:this.details=je.E32002_REQUEST_ALREADY_PENDING:e.message?.includes("Already processing")&&e.message.includes("eth_requestAccounts")&&(this.details=je.E32002_WALLET_LOCKED))}}const Ya={ERROR_USER_EXISTS:{message:"User already exists for this address",detail:"Try another address!",retryable:!1},ERROR_TIMED_OUT:{message:"Wallet request timed out",detail:"Please try connecting again.",retryable:!0},ERROR_WALLET_CONNECTION:{message:"Could not log in with wallet",detail:"Please try connecting again.",retryable:!0},ERROR_USER_LIMIT_REACHED:{message:"Unable to link",detail:"You've reached the maximum number of linked wallets.",retryable:!1},...je};function Ka(e){return"ethereum"===e.type}function Xa(e,t){if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++){let a=e[n],i=t[n];if(a?.address!==i?.address||a&&i&&Ka(a)&&Ka(i)&&a?.chainId!==i?.chainId||a?.connectorType!==i?.connectorType||a?.connectedAt!==i?.connectedAt||a?.walletClientType!==i?.walletClientType||a?.isConnected!==i?.isConnected||a?.linked!==i?.linked)return!1}return!0}class Ja extends Mt{constructor(e){super(),this.walletClientType=e,this.connected=!1,this.initialized=!1}}const ei=(e,t)=>e.rpcTimeouts&&e.rpcTimeouts[t]||Q;function ti(e){return"ethereum"===e.chainType}class ni extends Ja{buildConnectedWallet(e,t,n,a){let i=async()=>!!this.wallets.find((t=>Et(t.address)===Et(e)));return{type:"ethereum",address:Et(e),chainId:t,meta:n,imported:a,switchChain:async n=>{let a,r;if(!i)throw new W("Wallet is not currently connected.");let o=this.wallets.find((t=>Et(t.address)===Et(e)))?.chainId;if(!o)throw new W("Unable to determine current chainId.");if("number"==typeof n?(a=`0x${n.toString(16)}`,r=n):(a=n,r=Number(n)),o===la(a))return;let l=this.chains.find((e=>e.id===r));if(!l)throw new W(`Unsupported chainId: ${n}`);let s=async()=>{await this.proxyProvider.request({method:"wallet_switchEthereumChain",params:[{chainId:a}]})};try{return await s()}catch(e){if(((e,t)=>{switch(t){case"coinbase_wallet":case"base_account":return e.message.includes("addEthereumChain");case"rabby_wallet":return e.message.includes("Unrecognized chain ID");default:return 4902===e.code||e.message?.includes("4902")}})(e,this.walletClientType))return"rabby_wallet"===this.walletClientType&&await na(300),await this.proxyProvider.request({method:"wallet_addEthereumChain",params:[{chainId:a,chainName:l.name,nativeCurrency:l.nativeCurrency,rpcUrls:[l.rpcUrls.default?.http[0]??""],blockExplorerUrls:[l.blockExplorers?.default.url??""]}]}),s();if("rainbow"===this.walletClientType&&e.message?.includes("wallet_switchEthereumChain"))throw new W(`Rainbow does not support the chainId ${t}`);throw e}},connectedAt:Date.now(),walletClientType:this.walletClientType,connectorType:this.connectorType,isConnected:i,getEthereumProvider:async()=>{if(!await i())throw new W("Wallet is not currently connected.");return this.proxyProvider},sign:async e=>{if(!await i())throw new W("Wallet is not currently connected.");return await this.sign(e)},disconnect:()=>{this.disconnect()}}}async syncAccounts(e){let t,n=e;try{if(void 0===n){let e=await aa((()=>this.proxyProvider.request({method:"eth_accounts"})),{maxAttempts:10,delayMs:500});console.debug(`eth_accounts for ${this.walletClientType}:`,e),Array.isArray(e)&&(n=e)}}catch(e){console.debug("Wallet did not respond to eth_accounts. Defaulting to prefetched accounts.",e)}if(!n||!Array.isArray(n)||n.length<=0||!n[0])return;let a=n[0];if(!he(a))return void console.warn(`Invalid ethereum address reported by ${this.walletClientType}: ${a}`);let i=Et(a),r=[];if("privy"===this.walletClientType){let e=yn.get(Y(i));this.chains.find((t=>t.id===Number(e)))||(yn.del(Y(i)),e=null),t=e||`0x${this.defaultChain.id.toString(16)}`;try{await this.proxyProvider.request({method:"wallet_switchEthereumChain",params:[{chainId:t}]})}catch(e){console.warn(`Unable to switch embedded wallet to chain ID ${t} on initialization`)}}else try{let e=await aa((()=>this.proxyProvider.request({method:"eth_chainId"})),{maxAttempts:10,delayMs:500});if(console.debug(`eth_chainId for ${this.walletClientType}:`,e),"string"==typeof e)t=e;else{if("number"!=typeof e)throw Error("Invalid chainId returned from provider");t=`0x${e.toString(16)}`}}catch(e){console.warn(`Failed to get chainId from provider, defaulting to ${K}`,e),t=K}let o=la(t);if(!r.find((e=>Et(e.address)===i))){let e={name:this.walletBranding.name,icon:"string"==typeof this.walletBranding.icon?this.walletBranding.icon:void 0,id:this.walletBranding.id};r.push(this.buildConnectedWallet(Et(a),o,e,"embedded_imported"===this.connectorType))}Xa(r,this.wallets)||(this.wallets=r,this.emit("walletsUpdated"))}async getConnectedWallet(){let e=await this.proxyProvider.request({method:"eth_accounts"});return this.wallets.sort(((e,t)=>t.connectedAt-e.connectedAt)).find((t=>e.find((e=>Et(e)===Et(t.address)))))||null}async isConnected(){let e=await this.proxyProvider.request({method:"eth_accounts"});return Array.isArray(e)&&e.length>0}async sign(e){return await this.connect({showPrompt:!1}),this.proxyProvider.request({method:"personal_sign",params:[_t(e),this.wallets[0]?.address]})}subscribeListeners(){this.proxyProvider.on("accountsChanged",this.onAccountsChanged),this.proxyProvider.on("chainChanged",this.onChainChanged),this.proxyProvider.on("disconnect",this.onDisconnect),this.proxyProvider.on("connect",this.onConnect)}unsubscribeListeners(){this.proxyProvider.removeListener("accountsChanged",this.onAccountsChanged),this.proxyProvider.removeListener("chainChanged",this.onChainChanged),this.proxyProvider.removeListener("disconnect",this.onDisconnect),this.proxyProvider.removeListener("connect",this.onConnect)}constructor(e,t,n,a){super(e),this.chainType="ethereum",this.onAccountsChanged=e=>{0===e.length?this.onDisconnect():this.syncAccounts(e)},this.onChainChanged=e=>{this.wallets.forEach((t=>{t.chainId=la(e),"privy"===this.walletClientType&&yn.put(Y(t.address),e)})),this.emit("walletsUpdated")},this.onDisconnect=()=>{this.connected=!1,this.wallets=[],this.emit("walletsUpdated")},this.onConnect=async()=>{"base_account"===this.connectorType&&this.connected||(this.connected=!0,"coinbase_wallet"===this.connectorType&&await na(500),this.syncAccounts())},this.wallets=[],this.walletClientType=e,this.chains=t,this.defaultChain=n,this.rpcConfig=a,this.rpcTimeoutDuration=ei(a,e),this.connected=!1,this.initialized=!1}}class ai{on(e,t){if(this.walletProvider)return this.walletProvider.on(e,t);this._subscriptions.push({eventName:e,listener:t})}async request(e){if(!this.walletProvider)throw new W(`A wallet request of type ${e.method} was made before setting a wallet provider.`);return Promise.race([this.walletProvider.request(e),this.walletTimeout()]).catch((e=>{throw Ga(e)}))}constructor(e,t){this.removeListener=(e,t)=>{if(this.walletProvider)try{return this.walletProvider.removeListener(e,t)}catch(e){console.warn("Unable to remove wallet provider listener")}},this.walletTimeout=(e=new qa,t=this.rpcTimeoutDuration)=>new Promise(((n,a)=>setTimeout((()=>{a(e)}),t))),this.setWalletProvider=e=>{this.walletProvider&&this._subscriptions.forEach((e=>{this.removeListener(e.eventName,e.listener)})),this.walletProvider=e,this._subscriptions.forEach((e=>{this.walletProvider?.on(e.eventName,e.listener)}))},this.walletProvider=e,this.rpcTimeoutDuration=t||Q,this._subscriptions=[]}}const ii=({...e})=>/*#__PURE__*/t("svg",{width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e,children:/*#__PURE__*/t("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M2.37126 11.0323C2.37126 12.696 3.90598 13.4421 5.40654 13.4468C8.91753 13.4468 12.8021 11.2897 12.7819 7.67984C12.7673 5.07728 10.3748 2.86167 7.54357 2.88296C4.8495 2.88296 2.21821 4.6411 2.21803 7.03628C2.21803 7.67951 2.58722 8.30178 3.55231 8.37184C2.74763 9.16826 2.37126 10.1225 2.37126 11.0323ZM7.55283 8.68012C8.11562 8.68012 8.57186 8.13217 8.57186 7.45624C8.57186 6.78032 8.11562 6.23237 7.55283 6.23237C6.99003 6.23237 6.53379 6.78032 6.53379 7.45624C6.53379 8.13217 6.99003 8.68012 7.55283 8.68012ZM10.4747 8.68012C11.0375 8.68012 11.4937 8.13217 11.4937 7.45625C11.4937 6.78032 11.0375 6.23237 10.4747 6.23237C9.91186 6.23237 9.45562 6.78032 9.45562 7.45625C9.45562 8.13217 9.91186 8.68012 10.4747 8.68012Z",fill:e.color||"var(--privy-color-foreground-3)"})}),ri=e=>!!e.id&&"privy-v2"===e.recoveryMethod;class oi extends ni{get walletBranding(){return{id:this.id,name:this.name,icon:this.icon}}async initialize(){this.initialized=!0,this.emit("initialized")}async connect(){throw Error("connect called for an uninstalled wallet via the EthereumNullConnector")}disconnect(){throw Error("disconnect called for an uninstalled wallet via the EthereumNullConnector")}promptConnection(e){throw Error(`promptConnection called for an uninstalled wallet via the EthereumNullConnector for ${e}`)}constructor({id:e,name:t,icon:n,walletClientType:a,defaultChain:i}){super(a,[],i,{}),this.connectorType="null",this.proxyProvider=new ai(void 0,Q),this.id=e,this.name=t,this.icon=n}}const li=({style:e,...n})=>/*#__PURE__*/t("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",stroke:"currentColor",strokeWidth:1.5,viewBox:"0 0 24 24",style:{...e},...n,children:/*#__PURE__*/t("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M9 17.25v1.007a3 3 0 01-.879 2.122L7.5 21h9l-.621-.621A3 3 0 0115 18.257V17.25m6-12V15a2.25 2.25 0 01-2.25 2.25H5.25A2.25 2.25 0 013 15V5.25m18 0A2.25 2.25 0 0018.75 3H5.25A2.25 2.25 0 003 5.25m18 0V12a2.25 2.25 0 01-2.25 2.25H5.25A2.25 2.25 0 013 12V5.25"})}),si=({...n})=>/*#__PURE__*/e("svg",{xmlns:"http://www.w3.org/2000/svg",width:"32",height:"32",viewBox:"0 0 32 32",fill:"none",...n,children:[/*#__PURE__*/t("rect",{width:"32",height:"32",rx:"6",fill:"#121314"}),/*#__PURE__*/t("g",{transform:"translate(4, 4)",children:/*#__PURE__*/e("svg",{width:"24",height:"24",viewBox:"0 0 318.6 318.6",children:[/*#__PURE__*/t("style",{children:".s1{stroke-linecap:round;stroke-linejoin:round}.s2{fill:#e4761b;stroke:#e4761b}.s3{fill:#f6851b;stroke:#f6851b}"}),/*#__PURE__*/t("path",{fill:"#e2761b",stroke:"#e2761b",className:"s1",d:"m274.1 35.5-99.5 73.9L193 65.8z"}),/*#__PURE__*/t("path",{d:"m44.4 35.5 98.7 74.6-17.5-44.3zm193.9 171.3-26.5 40.6 56.7 15.6 16.3-55.3zm-204.4.9L50.1 263l56.7-15.6-26.5-40.6z",className:"s1 s2"}),/*#__PURE__*/t("path",{d:"m103.6 138.2-15.8 23.9 56.3 2.5-2-60.5zm111.3 0-39-34.8-1.3 61.2 56.2-2.5zM106.8 247.4l33.8-16.5-29.2-22.8zm71.1-16.5 33.9 16.5-4.7-39.3z",className:"s1 s2"}),/*#__PURE__*/t("path",{fill:"#d7c1b3",stroke:"#d7c1b3",className:"s1",d:"m211.8 247.4-33.9-16.5 2.7 22.1-.3 9.3zm-105 0 31.5 14.9-.2-9.3 2.5-22.1z"}),/*#__PURE__*/t("path",{fill:"#233447",stroke:"#233447",className:"s1",d:"m138.8 193.5-28.2-8.3 19.9-9.1zm40.9 0 8.3-17.4 20 9.1z"}),/*#__PURE__*/t("path",{fill:"#cd6116",stroke:"#cd6116",className:"s1",d:"m106.8 247.4 4.8-40.6-31.3.9zM207 206.8l4.8 40.6 26.5-39.7zm23.8-44.7-56.2 2.5 5.2 28.9 8.3-17.4 20 9.1zm-120.2 23.1 20-9.1 8.2 17.4 5.3-28.9-56.3-2.5z"}),/*#__PURE__*/t("path",{fill:"#e4751f",stroke:"#e4751f",className:"s1",d:"m87.8 162.1 23.6 46-.8-22.9zm120.3 23.1-1 22.9 23.7-46zm-64-20.6-5.3 28.9 6.6 34.1 1.5-44.9zm30.5 0-2.7 18 1.2 45 6.7-34.1z"}),/*#__PURE__*/t("path",{d:"m179.8 193.5-6.7 34.1 4.8 3.3 29.2-22.8 1-22.9zm-69.2-8.3.8 22.9 29.2 22.8 4.8-3.3-6.6-34.1z",className:"s3"}),/*#__PURE__*/t("path",{fill:"#c0ad9e",stroke:"#c0ad9e",className:"s1",d:"m180.3 262.3.3-9.3-2.5-2.2h-37.7l-2.3 2.2.2 9.3-31.5-14.9 11 9 22.3 15.5h38.3l22.4-15.5 11-9z"}),/*#__PURE__*/t("path",{fill:"#161616",stroke:"#161616",className:"s1",d:"m177.9 230.9-4.8-3.3h-27.7l-4.8 3.3-2.5 22.1 2.3-2.2h37.7l2.5 2.2z"}),/*#__PURE__*/t("path",{fill:"#763d16",stroke:"#763d16",className:"s1",d:"m278.3 114.2 8.5-40.8-12.7-37.9-96.2 71.4 37 31.3 52.3 15.3 11.6-13.5-5-3.6 8-7.3-6.2-4.8 8-6.1zM31.8 73.4l8.5 40.8-5.4 4 8 6.1-6.1 4.8 8 7.3-5 3.6 11.5 13.5 52.3-15.3 37-31.3-96.2-71.4z"}),/*#__PURE__*/t("path",{d:"m267.2 153.5-52.3-15.3 15.9 23.9-23.7 46 31.2-.4h46.5zm-163.6-15.3-52.3 15.3-17.4 54.2h46.4l31.1.4-23.6-46zm71 26.4 3.3-57.7 15.2-41.1h-67.5l15 41.1 3.5 57.7 1.2 18.2.1 44.8h27.7l.2-44.8z",className:"s3"})]})})]}),ci=({style:n,...a})=>/*#__PURE__*/e("svg",{xmlns:"http://www.w3.org/2000/svg",width:"108",height:"108",viewBox:"0 0 108 108",fill:"none",style:{height:"28px",width:"28px",...n},...a,children:[/*#__PURE__*/t("rect",{width:"108",height:"108",rx:"23",fill:"#AB9FF2"}),/*#__PURE__*/t("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M46.5267 69.9229C42.0054 76.8509 34.4292 85.6182 24.348 85.6182C19.5824 85.6182 15 83.6563 15 75.1342C15 53.4305 44.6326 19.8327 72.1268 19.8327C87.768 19.8327 94 30.6846 94 43.0079C94 58.8258 83.7355 76.9122 73.5321 76.9122C70.2939 76.9122 68.7053 75.1342 68.7053 72.314C68.7053 71.5783 68.8275 70.7812 69.0719 69.9229C65.5893 75.8699 58.8685 81.3878 52.5754 81.3878C47.993 81.3878 45.6713 78.5063 45.6713 74.4598C45.6713 72.9884 45.9768 71.4556 46.5267 69.9229ZM83.6761 42.5794C83.6761 46.1704 81.5575 47.9658 79.1875 47.9658C76.7816 47.9658 74.6989 46.1704 74.6989 42.5794C74.6989 38.9885 76.7816 37.1931 79.1875 37.1931C81.5575 37.1931 83.6761 38.9885 83.6761 42.5794ZM70.2103 42.5795C70.2103 46.1704 68.0916 47.9658 65.7216 47.9658C63.3157 47.9658 61.233 46.1704 61.233 42.5795C61.233 38.9885 63.3157 37.1931 65.7216 37.1931C68.0916 37.1931 70.2103 38.9885 70.2103 42.5795Z",fill:"#FFFDF8"})]}),di=["metamask","phantom","brave_wallet","rainbow","uniswap_wallet_extension","uniswap_extension","rabby_wallet","bybit_wallet","ronin_wallet","haha_wallet","crypto.com_wallet_extension","crypto.com_onchain","binance","bitget_wallet","coinbase_wallet","coinbase_smart_wallet","base_account","metamask","trust","safe","rainbow","uniswap","zerion","argent","spot","omni","cryptocom","blockchain","safepal","bitget_wallet","zengo","1inch","binance","exodus","mew_wallet","alphawallet","keyring_pro","mathwallet","unstoppable","obvious","ambire","internet_money_wallet","coin98","abc_wallet","arculus_wallet","haha","cling_wallet","broearn","copiosa","burrito_wallet","enjin_wallet","plasma_wallet","avacus","bee","pitaka","pltwallet","minerva","kryptogo","prema","slingshot","kriptonio","timeless","secux","bitizen","blocto","okx_wallet","safemoon","rabby_wallet","bybit_wallet","ronin_wallet","haha_wallet","privy","unknown","phantom","solflare","glow","backpack","mobile_wallet_adapter"],pi=Object.freeze({phantom:{client:"phantom",name:"Phantom",installLink:Re.isFirefox?"https://addons.mozilla.org/en-US/firefox/addon/phantom-app/":"https://chrome.google.com/webstore/detail/phantom/bfnaelmomeimhlpmgjnjophhpkkoljpa?hl=en",chainTypes:["ethereum","solana"],get isInstalled(){if("phantom"in window){let e=window;if(e?.phantom?.ethereum?.isPhantom&&e?.phantom?.ethereum?.chainId||e?.phantom?.solana?.isPhantom)return!0}return!1},getMobileRedirect({useUniversalLink:e,isSolana:t,connectOnly:n}){let a=ui({client:this.client,isSolana:t,connectOnly:n});return`${e?"phantom://":"https://phantom.app/ul/"}browse/${a}?ref=${a}`}},solflare:{client:"solflare",name:"Solflare",installLink:Re.isFirefox?"https://addons.mozilla.org/es/firefox/addon/solflare-wallet/":"https://chromewebstore.google.com/detail/solflare-wallet/bhhhlbepdkbapadjdnnojkbgioiodbic",chainTypes:["solana"],get isInstalled(){return"solflare"in window&&!!window?.solflare?.isSolflare},getMobileRedirect({useUniversalLink:e,isSolana:t,connectOnly:n}){let a=ui({client:this.client,isSolana:t,connectOnly:n});return`${e?"solflare://ul/v1/":"https://solflare.com/ul/v1/"}browse/${a}?ref=${a}`}},backpack:{client:"backpack",name:"Backpack",installLink:"https://chromewebstore.google.com/detail/backpack/aflkmfhebedbjioipglgcbcmnbpgliof",chainTypes:["ethereum","solana"],get isInstalled(){return!(!("backpack"in window)||!window?.backpack?.ethereum?.isBackpack&&!window?.backpack?.solana?.isBackpack)},getMobileRedirect({useUniversalLink:e,isSolana:t,connectOnly:n}){let a=ui({client:this.client,isSolana:t,connectOnly:n});return`${e?"backpack://ul/v1/":"https://backpack.app/ul/v1/"}browse/${a}?ref=${a}`}},okx_wallet:{client:"okx_wallet",name:"OKX Wallet",installLink:"https://chromewebstore.google.com/detail/okx-wallet/mcohilncbfahbmgdjkbpemcciiolgcge",chainTypes:["solana"],get isInstalled(){return"okxwallet"in window&&!!window?.okxwallet?.isOkxWallet},getMobileRedirect({isSolana:e,connectOnly:t}){return"https://www.okx.com/download?deeplink="+encodeURIComponent("okx://wallet/dapp/url?dappUrl="+ui({client:this.client,isSolana:e,connectOnly:t}))}}});function hi({connectorType:e,walletClientType:t}){for(let n of di)if(e===n||t===n)return pi[n]}function ui({client:e,isSolana:t,connectOnly:n}){let a=new URL(window.location.href);return a.searchParams.set("privy_connector",t?"solana_adapter":"injected"),a.searchParams.set("privy_wallet_client",e),a.searchParams.set("privy_connect_only",String(n)),encodeURIComponent(a.href.replace(/\/$/g,""))}const mi=()=>{let e=yn.get(X);return e&&Array.isArray(e)&&e.map((e=>(e=>e&&"string"==typeof e.address&&"string"==typeof e.connectorType&&"string"==typeof e.walletClientType&&"number"==typeof e.connectedAt)(e))).every(Boolean)?e:[]};let gi=["phantom","glow","solflare","backpack","okx_wallet","walletconnect","mobile_wallet_adapter","jupiter"];function yi(e){return e.toLowerCase().split(" ").join("_")}class fi extends Ja{get isInstalled(){return!0}get wallet(){return this._wallet}buildConnectedWallet(){return this._wallet.accounts.map((e=>({type:"solana",provider:new $e({wallet:this._wallet,account:e}),address:e.address,connectedAt:Date.now(),walletClientType:this._wallet.name,connectorType:this.connectorType,imported:!1,meta:{name:this._wallet.name,id:this._wallet.name,icon:this._wallet.icon},isConnected:async()=>this._wallet.accounts.length>0,disconnect:async()=>{await this.disconnect()}})))}async syncAccounts(){this.wallets=this.buildConnectedWallet(),this.emit("walletsUpdated")}get walletBranding(){return{id:wi(this.wallet)?"walletconnect_solana":this.wallet.name,name:this.wallet.name,icon:this.wallet.icon}}async initialize(){this.subscribeListeners(),await this.syncAccounts(),this.shouldAttemptAutoConnect()&&(await(this.wallet.features["standard:connect"]?.connect({silent:!0}).catch((()=>{}))),await this.isConnected()&&await this.syncAccounts()),this.initialized=!0,this.emit("initialized")}async connect(e){return e.showPrompt&&await this.promptConnection(),await this.isConnected()?(await this.syncAccounts(),this.getConnectedWallet()):null}async getConnectedWallet(){return this.wallets.sort(((e,t)=>t.connectedAt-e.connectedAt))[0]||null}async isConnected(){return this._wallet.accounts.length>0}subscribeListeners(){this._unsubscribeListeners=this.wallet.features["standard:events"]?.on("change",this.onChange)}unsubscribeListeners(){this._unsubscribeListeners?.()}shouldAttemptAutoConnect(){return!(!this.autoConnectEnabled||!gi.includes(this.walletClientType))&&("phantom"!==this.walletClientType&&"metamask"!==this.walletClientType.toLowerCase()||mi().some((({walletClientType:e})=>"phantom"===e||"metamask"===e.toLowerCase())))}constructor(e,t){super(yi(wi(e)?"walletconnect_solana":e.name)),this.chainType="solana",this.connectorType="solana_adapter",this.disconnect=async()=>{await(this.wallet.features["standard:disconnect"]?.disconnect().catch((e=>console.error("Error disconnecting",e)))),await this.syncAccounts()},this.promptConnection=async()=>{try{await(this.wallet.features["standard:connect"]?.connect())}catch(e){throw Ga(e)}},this.onChange=()=>{this.syncAccounts()},this._wallet=e,this.autoConnectEnabled=t,this.wallets=[]}}function wi(e){return"isWalletConnectSolana"in e&&e.isWalletConnectSolana}class vi extends fi{get walletBranding(){return{id:this.id,name:this.name,icon:this.icon}}async initialize(){this.initialized=!0,this.emit("initialized")}async connect(){throw Error("connect called for an uninstalled wallet via the SolanaNullConnector")}constructor({id:e,name:t,icon:n}){super({name:t},!1),this.connectorType="null",this.proxyProvider=new ai(void 0,Q),this.disconnect=async()=>{throw Error("disconnect called for an uninstalled wallet via the SolanaNullConnector")},this.promptConnection=async()=>{throw Error("promptConnection called for an uninstalled wallet via the SolanaNullConnector")},this.id=e,this.name=t,this.icon=n}}const bi=({style:n,...a})=>{let i=Z();/*#__PURE__*/return e("svg",{width:"28",height:"28",viewBox:"0 0 28 28",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:{height:"28px",width:"28px",...n},...a,children:[/*#__PURE__*/t("rect",{width:"28",height:"28",rx:"3",fill:"dark"===i?.appearance.palette.colorScheme?"#3396ff":"#141414"}),/*#__PURE__*/t("g",{clipPath:"url(#clip0_1765_9946)",children:/*#__PURE__*/t("path",{d:"M8.09448 10.3941C11.3558 7.20196 16.6442 7.20196 19.9055 10.3941L20.2982 10.7782C20.3369 10.8157 20.3677 10.8606 20.3887 10.9102C20.4097 10.9599 20.4206 11.0132 20.4206 11.0671C20.4206 11.121 20.4097 11.1744 20.3887 11.224C20.3677 11.2737 20.3369 11.3186 20.2982 11.3561L18.9554 12.6702C18.9158 12.7086 18.8628 12.7301 18.8077 12.7301C18.7526 12.7301 18.6996 12.7086 18.66 12.6702L18.1198 12.1415C15.8448 9.91503 12.1557 9.91503 9.88015 12.1415L9.30167 12.7075C9.26207 12.7459 9.20909 12.7673 9.15395 12.7673C9.0988 12.7673 9.04582 12.7459 9.00622 12.7075L7.66346 11.3934C7.62475 11.3559 7.59397 11.3109 7.57295 11.2613C7.55193 11.2117 7.5411 11.1583 7.5411 11.1044C7.5411 11.0505 7.55193 10.9971 7.57295 10.9475C7.59397 10.8979 7.62475 10.8529 7.66346 10.8154L8.09448 10.3941ZM22.6829 13.1115L23.8776 14.2814C23.9163 14.319 23.9471 14.3639 23.9681 14.4135C23.9892 14.4632 24 14.5165 24 14.5704C24 14.6243 23.9892 14.6777 23.9681 14.7273C23.9471 14.777 23.9163 14.8219 23.8776 14.8594L18.4893 20.1332C18.4102 20.2101 18.3042 20.2531 18.1938 20.2531C18.0835 20.2531 17.9775 20.2101 17.8984 20.1332L14.0743 16.3901C14.0545 16.3708 14.0279 16.36 14.0003 16.36C13.9726 16.36 13.9461 16.3708 13.9263 16.3901L10.1021 20.1332C10.023 20.2101 9.91703 20.2531 9.8067 20.2531C9.69636 20.2531 9.59038 20.2101 9.51124 20.1332L4.12236 14.8594C4.08365 14.8219 4.05287 14.777 4.03185 14.7273C4.01083 14.6777 4 14.6243 4 14.5704C4 14.5165 4.01083 14.4632 4.03185 14.4135C4.05287 14.3639 4.08365 14.319 4.12236 14.2814L5.31767 13.1115C5.39678 13.0348 5.50265 12.9919 5.61285 12.9919C5.72305 12.9919 5.82892 13.0348 5.90803 13.1115L9.73216 16.8546C9.75194 16.874 9.7785 16.8848 9.80616 16.8848C9.83381 16.8848 9.86037 16.874 9.88015 16.8546L13.7043 13.1115C13.7834 13.0346 13.8894 12.9916 13.9997 12.9916C14.1101 12.9916 14.216 13.0346 14.2952 13.1115L18.1198 16.8546C18.1396 16.874 18.1662 16.8848 18.1938 16.8848C18.2215 16.8848 18.2481 16.874 18.2678 16.8546L22.092 13.1115C22.1711 13.0346 22.2771 12.9916 22.3874 12.9916C22.4977 12.9916 22.6037 13.0346 22.6829 13.1115Z",fill:"white"})}),/*#__PURE__*/t("defs",{children:/*#__PURE__*/t("clipPath",{id:"clip0_1765_9946",children:/*#__PURE__*/t("rect",{width:"20",height:"12.2531",fill:"white",transform:"translate(4 8)"})})})]})},Ci="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAIGNIUk0AAHomAACAhAAA+gAAAIDoAAB1MAAA6mAAADqYAAAXcJy6UTwAAAAGYktHRAD/AP8A/6C9p5MAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAAHdElNRQfoDAIVODUC+w+GAAAGsUlEQVRYw6WXbYwWVxXHf+fOLAtCXYS2QJdIaClipGCTknXXNqBQMVHbfmhItH4Aral+IAEaG03UxJgYKQJGTUxtDWjaxDSNtcZqIGDwpRuW1oYiVqpdpZSlpC3qysu+PHPP3w/3mXnmeXZbPzjJZO7cefn/z/mfe865xlscq3dGDIguGiHLaMQVLja4s87FShcLo5jtApdddnHexUmHIy475JmdUkPRAQMu7gzT4ljnxJpdk0QPmMFkyAKN2OfOFpc2uuh1J3MZDrjAvXmVEQUuoosRxw642FcEG7IoDxiFxNiu8NYE+vcUYIFYRKKs113bXWx2Z34CoQZsVHOiCZ7mopdzdsFhv8NexEgRDHMxUSNREbh1bwNZwBsFblmfu/a4a6AEENYO5i3AOoEWeEUCF4MOOxBDMQAOk99OJALA2u80sBCwWGBZWG/yRwMaCAbBIAsQTJT3gea1OWfNeaPzvjoHEI85rA8ObtB1v7cIdJkIHgkh9AXpocy0LJjIKvB2wPpZB0v3wkrw5jdNEjeYeMhFX3BAyfn2ke9NUrgB9LrrcZcGJFCld4fWNddXbvbWfWzGR6xJFZsBGh0cBh3bBIxIEGTQ3W0h4NuDaSAzyAxCmGq11Vzf5uaa1aG8p+WFtrEYQGwvjICJkAEqvC+YNmcmMlMNvEaCdrcbyUvQAWDTjVuESHObM6cPGWHmzDwLaEtmzG9Z3qF1zUpXmuuZBb1z4bqeNC6f0WE1NtUTwHzEloiy3BvFisy0sYoLlQtT6XW15md2Qf9SY+2Ngfdca/TMSm/9ewz+/Boc/It45h/i4kSTsKw90SQJsPTvjSZbkWemDW7qTRZ0JEYJWSKxZJ7xmf6M224MzMzbX1s8F1YugjtvMg6eErt/4/z1jUrz1rXUKxnZC2zIg2mdBTK1mFUOKC1fOt/48kdzVixIz86Nij+eEacvpJWyZJ5xy7th8VzjjpuMJfMCW58QL73ekXPVlhsyE+vyzFiplJyauEIyrGIquruMq7qTxk+dcB495rzyTzFepCUWLIFv/kBg081Gd55WUk1IDGFTS89K++TDYxddzKnWcbluHd450xgdh7EGrOo1rr868PMTzqWJRGZ2d8oB/xpL33Xnxl2rjeNn4blXRXduzJ4B5y+28kWscAwXl+yeR654FFZPHoUb710YuPeDOUdPO48di1xptKpeEeHqOcYXNwQKGd88EDk3mqxtxPSfGRlsXRtYt8z4ytPOH/7eqpg1Aso7fYKgK4NPrMpYvsC4/poMA34yVJIQC3sCD9yecdsNyaV5yPj6ryJnR1PAvSNP4J+/1cgDfLbfePaMGGtM7Qdyl12WmKOmXgKKAp54vmBRTxfLrjE+tSYjBPjRM5FrrzIeuD2jf2lLzw8vN4JlfPVp581LsO1DgXv7jSzAiXPw/d+JiYLpjsu26Yfjf5O0rF5WoxsNT9G/bX0XKxakmPjlSee6HlizJJXSX7/oRDc+vjKR+f2wODcKd78/gR8/C9uedF44myJxmhh4OY/ipMQyqaWxmjn95TfEroMFOzbkvG+RceeqViPx1Aln1yEnOow1AnffHCpJAJ5/Vex4UvzptZRdY/O/1dJIS/NkcNmR6MTYah6qzseA4TfFtw4UvHBW1bc/O+7sPhwZHYf/jMODh5yfPudVbXj2TAJ/8XxrOZagNamj4Ei2/GNfuyRxh8t6BG2l15up+MIVODEiFr8rcPS0+O6RBF6mrrEGHHtFzOo2Lo7Dl37hvPQ6mNV6R9JYKgnYWcE37K5HlE2OT/5A0udaPUBHH+BQOMzuNsYLuDyZflTW+fTcmJFDHhJhaZqewMuewXDxcDR9IYyPN6Jj+6K4MF2vV8qBtZJScqVRNi6lpGONVJis5mpKi1WbgwsY+zIsBpcR8mzIZfuTRVZrtdu9odrptR/Xx5XONXJqBmCN0P6YMUQq9WJiwt0Je102WHdbpxSqydMObBWYdwDWLVcqcIMYe3NPjg0Ht84od0Ajju1w2XCr9e6QoqM9V23ZtnmI6cfAMMb9AY0YEHdb6oobEh4y3H3Ize6LsmGvN5IdUnhttdQ9UVrfLk/ljWEZ9wXsqAdQk1EA+O22GcgdZTke/bAs3OPY4HSdcB20HhvVtTMu0jmI8ekAhz2IICj2hKpNqI60NcuIRUHEej1quzubXa2tmZhenrfZmv3YYQ9ipDAIgvHptmblccuDjdRcmjFpWbDi/9ycZjZkRbk5jYztai/AUwiUx+qdEQB/m+25i9lxyvbcjrg45Lmd0uT/3p7/Fw6ODf+WO019AAAAJXRFWHRkYXRlOmNyZWF0ZQAyMDI0LTEyLTAyVDIxOjU2OjQ4KzAwOjAwMVpslgAAACV0RVh0ZGF0ZTptb2RpZnkAMjAyNC0xMi0wMlQyMTo1Njo0OCswMDowMEAH1CoAAAAodEVYdGRhdGU6dGltZXN0YW1wADIwMjQtMTItMDJUMjE6NTY6NTMrMDA6MDDZv6GRAAAAAElFTkSuQmCC";function xi(e){return"solana"===e.chainType}function ki(e){return"solana"===e.type}class Ti extends ni{async initialize(){let e=await this.createProvider();this.provider=e,this.proxyProvider.setWalletProvider(e),this.subscribeListeners(),e.session&&(this.walletProvider?.session?.peer.metadata.url&&(this.walletEntry=Da(this.walletProvider?.session?.peer.metadata.url),this.walletClientType=this.walletEntry?.slug||"unknown"),this.connected=!0,await this.syncAccounts()),this.initialized=!0,this.emit("initialized")}async connect(e){return e.showPrompt&&await this.promptConnection(),this.getConnectedWallet()}async isConnected(){return!!this.walletProvider?.connected}get walletBranding(){let e=this.walletProvider?.session?.peer.metadata.icons?.[0];return{name:ia(this.walletProvider?.session?.peer.metadata.name||"")||"WalletConnect",icon:"string"==typeof e?e:Ci,id:this.walletProvider?.session?.peer.metadata.name.toLowerCase()||"wallet_connect_v2"}}async resetConnection(e){this.walletProvider&&this.walletProvider.connected&&(await this.walletProvider.disconnect(),this.walletProvider.signer.session=void 0,this.walletClientType=e,this.redirectUri=void 0,this.fallbackUniversalRedirectUri=void 0,function(){try{localStorage.removeItem(vn)}catch{}}(),this.onDisconnect())}async promptConnection(){if(this.provider)return new Promise(((e,t)=>{(async()=>{let t="",n=await Promise.race([this.walletProvider?.enable(),this.proxyProvider.walletTimeout()]);if(n?.length&&(t=n[0]),!t||""===t)throw new W("Unable to retrieve address");this.walletProvider?.session?.peer.metadata.url&&(this.walletEntry=Da(this.walletProvider?.session?.peer.metadata.url),this.walletClientType=this.walletEntry?.slug||"unknown",this.proxyProvider.rpcTimeoutDuration=ei(this.rpcConfig,this.walletClientType)),this.connected=!0,await this.syncAccounts(n),e()})().catch((e=>{t(e?Ga(e):new W("Unknown error during connection"))}))}))}disconnect(){this.walletProvider?.disconnect().then((()=>this.onDisconnect())).catch((()=>console.warn("Unable to disconnect WalletConnect provider")))}get walletProvider(){return this.proxyProvider.walletProvider}setWalletProvider(e){this.proxyProvider.setWalletProvider(e)}async createProvider(){let e={};for(let t of this.chains){let n=sa(t.id,this.chains,this.rpcConfig,this.privyAppId);n&&(e[t.id]=n)}let t=this.shouldEnforceDefaultChainOnConnect?[this.defaultChain.id]:[],n=this.chains.map((e=>e.id)),a=await Lt.init({projectId:this.walletConnectCloudProjectId,chains:t,optionalChains:n,optionalEvents:Ft,optionalMethods:Pt,rpcMap:e,showQrModal:!1,metadata:{description:this.privyAppName,name:this.privyAppName,url:window.location.origin,icons:[]}});return a.on("display_uri",(e=>{if(a.signer.abortPairingAttempt(),function(){try{localStorage.removeItem(vn)}catch{}}(),!this.showPrivyQrModal)throw new W("WalletConnect modal not available - Privy handles wallet connections through its own UI");if(Oe&&this.walletEntry){let{redirect:t,href:n}=function(e,t){let n=fn(t);if(n.deepLink)return Cn(n.deepLink,e);if(n.universalLink)return xn(n.universalLink,e);throw new _(`Unsupported wallet ${t.id}`)}(e,this.walletEntry);kn(t,"_self"),function({href:e,name:t}){try{localStorage.setItem(vn,JSON.stringify({href:e,name:t}))}catch{}}({href:n,name:this.walletEntry.metadata?.shortName||this.walletEntry.name});let a=wn(e,this.walletEntry);return this.redirectUri=t,this.fallbackUniversalRedirectUri=a?.redirect,this.showPrivyQrModal({native:t,universal:t})}if(this.redirectUri=void 0,this.walletEntry){let t=wn(e,this.walletEntry);this.fallbackUniversalRedirectUri=t?.redirect}this.showPrivyQrModal({native:e,universal:void 0})})),a.on("connect",(()=>{a.session?.peer.metadata.url&&(this.walletEntry=Da(a.session?.peer.metadata.url),this.walletClientType=this.walletEntry?.slug||"unknown")})),a}async enableProvider(){return this.walletProvider?.connected?Promise.resolve(this.walletProvider.accounts):await(this.walletProvider?.enable())}setWalletEntry(e,t){this.walletEntry=e,this.showPrivyQrModal=t}constructor({walletConnectCloudProjectId:e,rpcConfig:t,chains:n,defaultChain:a,shouldEnforceDefaultChainOnConnect:i,privyAppId:r,privyAppName:o,walletClientType:l}){super(l||"unknown",n,a,t),this.connectorType="wallet_connect_v2",this.privyAppId=r,this.privyAppName=o,this.walletConnectCloudProjectId=e,this.rpcConfig=t,this.shouldEnforceDefaultChainOnConnect=i,this.proxyProvider=new ai(void 0,this.rpcTimeoutDuration),l&&(this.walletEntry=(e=>Pa.getState().listings.find((({slug:t})=>Ua(t)===Ua(e))))(l),this.walletClientType=l)}}function Ai({src:e,...n}){/*#__PURE__*/return t("img",{src:e,...n,style:{display:"none"}})}const Ii=/*#__PURE__*/x({currentScreen:null,lastScreen:null,navigate:F,navigateBack:F,resetNavigation:F,setModalData:F,onUserCloseViaDialogOrKeybindRef:void 0}),Si=n=>{let a=Z(),i=n.authenticated,[r,o]=T(n.initialScreen);I((()=>{i||!n.initialScreen||n.initialScreen.isUnauthenticatedScreem||n.setInitialScreen(null)}),[i]);let l=k(null);I((()=>{n.open||(l.current=null)}),[n.open]),I((()=>{l.current=null}),[n.initialScreen]);let s={data:n.data,setModalData:n.setModalData,currentScreen:n.initialScreen,lastScreen:r,navigate:(e,t=!0)=>{n.setInitialScreen(e),t&&o(n.initialScreen)},navigateBack:()=>{n.setInitialScreen(r)},resetNavigation:()=>{n.setInitialScreen(null),o(null)},onUserCloseViaDialogOrKeybindRef:l};/*#__PURE__*/return e(Ii.Provider,{value:s,children:[("string"==typeof a.appearance.logo||"img"===a.appearance.logo?.type)&&/*#__PURE__*/t(Ai,{src:"string"==typeof a.appearance.logo?a.appearance.logo:a.appearance.logo.props.src}),n.children]})},Ni=()=>C(Ii),Ei=/*#__PURE__*/x({ready:!1,authenticated:!1,user:null,walletConnectors:null,connectWallet:F,login:F,connectOrCreateWallet:F,linkEmail:F,linkPhone:F,linkFarcaster:F,linkWallet:F,startCrossAppAuthFlow:F,linkGoogle:F,linkTwitter:F,linkTwitch:F,linkDiscord:F,linkGithub:F,linkSpotify:F,linkInstagram:F,linkTelegram:F,linkTiktok:F,linkLine:F,linkLinkedIn:F,linkApple:F,linkPasskey:F,updateEmail:F,updatePhone:F,logout:F,getAccessToken:F,unlinkEmail:F,unlinkPhone:F,unlinkWallet:F,unlinkGoogle:F,unlinkTwitter:F,unlinkTwitch:F,unlinkDiscord:F,unlinkGithub:F,unlinkSpotify:F,unlinkInstagram:F,unlinkTiktok:F,unlinkLine:F,unlinkLinkedIn:F,unlinkApple:F,unlinkCrossAppAccount:F,unlinkFarcaster:F,unlinkTelegram:F,unlinkPasskey:F,signMessage:F,signTypedData:F,enrollInMfa:F,initEnrollmentWithSms:F,initEnrollmentWithTotp:F,initEnrollmentWithPasskey:F,promptMfa:F,init:F,submitEnrollmentWithSms:F,submitEnrollmentWithTotp:F,submitEnrollmentWithPasskey:F,unenroll:F,submit:F,cancel:F,sendTransaction:F,signTransaction:F,exportWallet:F,setWalletPassword:F,setWalletRecovery:F,requestFarcasterSignerFromWarpcast:F,getFarcasterSignerPublicKey:F,signFarcasterMessage:F,signMessageWithCrossAppWallet:F,signTypedDataWithCrossAppWallet:F,sendTransactionWithCrossAppWallet:F,signTransactionWithCrossAppWallet:F,isModalOpen:!1,mfaMethods:[]}),_i=()=>C(Ei),Mi=/*#__PURE__*/Ne.div.withConfig({displayName:"Grow",componentId:"sc-681ff332-0"})(["text-align:left;flex-grow:1;"]),Wi=/*#__PURE__*/Ne.div.withConfig({displayName:"AlignBottom",componentId:"sc-681ff332-1"})(["display:flex;flex-direction:column;justify-content:flex-end;flex-grow:1;"]),Li=/*#__PURE__*/Ne.div.withConfig({displayName:"LoginMethodContainer",componentId:"sc-681ff332-2"})(["display:flex;flex-direction:column;gap:8px;-ms-overflow-style:none;scrollbar-width:none;&::-webkit-scrollbar{display:none;}"]),Pi=/*#__PURE__*/Ne(Li).withConfig({displayName:"LoginMethodContainerWithScrollShadows",componentId:"sc-681ff332-3"})([""," background-repeat:no-repeat;background-size:100% 32px,100% 16px;background-attachment:local,scroll;max-height:400px;overflow-y:auto;scrollbar-width:none;padding:3px;"],(e=>"light"===e.$colorScheme?"background: linear-gradient(var(--privy-color-background), var(--privy-color-background) 70%) bottom, linear-gradient(rgba(0, 0, 0, 0) 20%, rgba(0, 0, 0, 0.06)) bottom;":"dark"===e.$colorScheme?"background: linear-gradient(var(--privy-color-background), var(--privy-color-background) 70%) bottom, linear-gradient(rgba(255, 255, 255, 0) 20%, rgba(255, 255, 255, 0.06)) bottom;":void 0));let Fi=/*#__PURE__*/Ee(["&&{width:100%;font-size:16px;line-height:24px;min-height:56px;@media (min-width:440px){font-size:14px;}display:flex;gap:12px;align-items:center;color:var(--privy-color-foreground);padding:10px 12px;border:1px solid var(--privy-color-foreground-4) !important;border-radius:var(--privy-border-radius-md);transition:background-color 200ms ease;cursor:pointer;&:hover{background-color:var(--privy-color-background-2);}&:disabled{cursor:pointer;background-color:var(--privy-color-background-2);}}"]);const Di=/*#__PURE__*/Ne.div.withConfig({displayName:"Subtitle",componentId:"sc-681ff332-4"})(["text-align:center;font-size:14px;margin-bottom:24px;"]),Ri=/*#__PURE__*/Ne.button.attrs({className:"login-method-button"}).withConfig({displayName:"LoginMethodButton",componentId:"sc-681ff332-5"})(["",""],Fi),Oi=/*#__PURE__*/Ne.div.withConfig({displayName:"LoginMethodIconWrapper",componentId:"sc-681ff332-7"})(["width:32px;height:32px;border-radius:",";background:",";display:flex;align-items:center;justify-content:center;flex-shrink:0;svg{width:",";height:",";color:",";}"],(e=>e.$fullSize?"0":"4px"),(e=>e.$fullSize?"transparent":"var(--privy-color-background-2)"),(e=>e.$fullSize?"32px":"18px"),(e=>e.$fullSize?"32px":"18px"),(e=>e.$fullSize?"inherit":"var(--privy-color-icon-muted)")),Ui=/*#__PURE__*/Ne.div.withConfig({displayName:"Hide",componentId:"sc-681ff332-8"})(["width:100%;height:100%;min-height:inherit;display:flex;flex-direction:column;",""],(e=>e.$if?"display: none;":"")),Bi=/*#__PURE__*/Ne.div.withConfig({displayName:"EmptyWalletState",componentId:"sc-681ff332-9"})(["width:100%;height:100%;padding:",";"],(e=>e.$withPadding?"64px 0px":"0px")),zi=/*#__PURE__*/Ne.div.withConfig({displayName:"Header",componentId:"sc-681ff332-10"})(["display:flex;flex-direction:column;align-items:center;justify-content:center;margin-bottom:32px;gap:12px;& h3{font-size:18px;font-style:normal;font-weight:600;line-height:24px;}& p{max-width:300px;font-size:14px;font-style:normal;font-weight:400;line-height:20px;}"]);function Vi(e){/*#__PURE__*/return t("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 460 40",...e,children:/*#__PURE__*/t("g",{fill:e.color||"var(--privy-color-foreground)",children:/*#__PURE__*/t("path",{d:"M0 15.4v15.38h4.64V19.96h3.58c2.47 0 3.63-.01 3.77-.02 1-.08 1.49-.15 2.18-.3a9.45 9.45 0 0 0 4.6-2.37c1.66-1.57 2.64-3.87 2.81-6.56.02-.3.02-1.19 0-1.49-.1-1.77-.56-3.35-1.36-4.72A8.84 8.84 0 0 0 15.14.57c-.93-.3-1.75-.43-3.09-.54C11.9.02 10.2 0 5.93 0H0ZM10.85 4c1.85.05 3.1.45 4.16 1.3.22.17.54.49.69.68a5.97 5.97 0 0 1 1.19 3.13c.04.35.04 1.36 0 1.71-.08.68-.23 1.3-.44 1.85a4.8 4.8 0 0 1-1.09 1.68A5.63 5.63 0 0 1 12 15.92c-.6.08-.4.08-4.01.09H4.64V3.98h2.9c1.6 0 3.08 0 3.31.02ZM187.65 5.71v5.72h-.27l-.09-.14a15.9 15.9 0 0 0-1.21-1.73c-.43-.5-1-.95-1.7-1.36-.54-.3-1.05-.5-1.73-.63a8.98 8.98 0 0 0-1.7-.17 8.84 8.84 0 0 0-7.8 4.03 12.95 12.95 0 0 0-2.03 6.39c-.07.98-.06 2.15.02 3.13.2 2.47.87 4.53 2.02 6.25a8.98 8.98 0 0 0 10.22 3.65 6.5 6.5 0 0 0 2.8-1.93c.41-.51.84-1.1 1.1-1.55l.1-.17h.37v3.58h4.38V0h-4.48Zm-5.24 5.54c1.3.14 2.3.6 3.17 1.48.9.9 1.5 2.09 1.85 3.64.36 1.6.39 3.72.06 5.43a8.13 8.13 0 0 1-1.54 3.62 5.1 5.1 0 0 1-3.93 1.96 6.13 6.13 0 0 1-2.32-.31 5.87 5.87 0 0 1-3.33-3.5c-.39-1-.62-2.05-.72-3.32-.03-.32-.04-1.35-.02-1.73.08-1.56.4-2.91.96-4.05a6.2 6.2 0 0 1 1.06-1.58 5.08 5.08 0 0 1 3.6-1.66c.25-.02.9 0 1.16.02ZM210.07 15.39l.01 15.38h4.38l.01-3.57h.37l.09.15c.24.44.84 1.26 1.21 1.7a6.79 6.79 0 0 0 2.57 1.75 9.3 9.3 0 0 0 6.86-.49 9.28 9.28 0 0 0 4.05-4.07A13.05 13.05 0 0 0 231 21.6c.21-1.73.18-3.7-.09-5.32a13.03 13.03 0 0 0-1.5-4.3 9.1 9.1 0 0 0-3.75-3.63 9.15 9.15 0 0 0-4.43-.96 7.46 7.46 0 0 0-2.8.5A7.07 7.07 0 0 0 216 9.7c-.4.52-.82 1.12-1.1 1.59l-.07.14h-.27V0h-4.5Zm11.13-4.14c1.07.1 1.94.44 2.7 1.04a6.1 6.1 0 0 1 1.64 1.98c.43.84.78 2 .94 3.11.15 1.16.16 2.4.02 3.54a9.34 9.34 0 0 1-1.39 4.03 5.33 5.33 0 0 1-2.69 2.15c-.9.3-2.04.38-3.06.2a5.14 5.14 0 0 1-3.45-2.37 6.03 6.03 0 0 1-.45-.8c-.5-1.03-.8-2.2-.92-3.58-.04-.49-.06-.89-.05-1.53.01-.76.05-1.23.13-1.85.38-2.53 1.47-4.38 3.15-5.31a5.46 5.46 0 0 1 2.3-.63 10 10 0 0 1 1.13.02ZM69.05 2.17l-.01 2.77V7.7h-3.36v3.6h3.36v6.8l.01 7.15c.06 1.4.4 2.44 1.1 3.37a5.8 5.8 0 0 0 2.97 2.07c.91.3 1.83.42 2.9.38a8.71 8.71 0 0 0 2.66-.48l-.8-3.7-.38.06a4.96 4.96 0 0 1-2.43-.06c-.33-.1-.56-.25-.8-.49-.4-.41-.6-.88-.7-1.67-.02-.2-.02-.62-.03-6.82v-6.6h4.73V7.7h-4.73V2.16h-4.49ZM133.34 2.17V7.7h-3.39v3.6h3.38v6.9l.01 7.17a5.66 5.66 0 0 0 2.36 4.49c.85.6 2.03 1.03 3.26 1.17.85.1 2.03.05 2.81-.1.3-.06.75-.18 1-.26l.2-.06v-.05l-.81-3.67-.37.06a4.99 4.99 0 0 1-1.8.09c-.85-.13-1.32-.4-1.7-.97a2.63 2.63 0 0 1-.39-1.04c-.06-.4-.06 0-.06-7.1V11.3h4.7V7.7h-4.7l-.01-2.77V2.16h-4.49ZM293.41 2.36a14.56 14.56 0 0 0-13.7 16.07 14.59 14.59 0 0 0 21.86 11.08 14.5 14.5 0 0 0 7.11-14.07 14.61 14.61 0 0 0-6.53-10.73 14.49 14.49 0 0 0-8.74-2.35ZM350.8 2.36a10.17 10.17 0 0 0-7.56 4.2c-.16.2-.45.63-.58.83l-.05.1h-.47l-.01-4.36h-7.36v36.4h7.82V27.27h.49l.05.07a11.3 11.3 0 0 0 7.49 4.15 10.52 10.52 0 0 0 9.38-4.1c1.66-2.1 2.73-4.9 3.07-8.06.1-.87.13-1.4.13-2.37 0-.8 0-1.1-.07-1.76a15.95 15.95 0 0 0-3.23-8.72 12.8 12.8 0 0 0-1.85-1.84 10.49 10.49 0 0 0-7.26-2.28Zm-.94 6.05c1.27.15 2.33.65 3.2 1.5.98.96 1.67 2.31 2.03 4 .34 1.57.38 3.68.12 5.39a9.78 9.78 0 0 1-1.04 3.25c-.14.25-.44.69-.6.89a5.35 5.35 0 0 1-4.31 2.07 5.25 5.25 0 0 1-4.41-1.9 7.35 7.35 0 0 1-1.26-2.32 14.09 14.09 0 0 1-.62-4.83c.05-1.98.38-3.53 1.02-4.85a5.63 5.63 0 0 1 2.5-2.65c.66-.34 1.3-.5 2.14-.58.18-.02 1.04 0 1.23.03ZM363.63 3.1l-.01 3.2v3.16h1.43c1.26.01 1.44.02 1.54.04.42.09.66.28.79.62.08.23.08.08.08 2.96a911.57 911.57 0 0 1 .03 10.18v7.54h7.82v-7.4l.01-7.83c.03-.94.11-1.63.27-2.28.46-1.9 1.54-2.93 3.35-3.23.52-.08.2-.08 5-.08h4.4V3.08h-3.1c-3.48 0-3.91.01-4.67.1-1.83.2-3.04.79-3.96 1.88-.5.6-.9 1.32-1.26 2.26l-.06.17h-.46V3.09h-5.6c-4.46 0-5.6 0-5.6.02ZM390.8 16.95V30.8h3.87l3.86-.01V3.09h-7.73ZM400.6 3.1l-.01.4v.38l4.66 13.4 4.69 13.47.02.05h10.3l.03-.05 4.67-13.45 4.67-13.4V3.1h-7.43l-6.7 19.26h-.5l-3.28-9.5-3.31-9.64-.05-.12h-3.88l-3.88.01ZM430.98 3.1c-.01 0-.02.19-.02.4v.39l5.08 14.59c2.8 8.02 5.08 14.6 5.08 14.61.01.02-.22.02-4.8.02h-4.82v6.42h4.95c5.09 0 5.23 0 5.87-.06 3.15-.28 5.29-1.63 6.63-4.15.28-.55.44-.95.87-2.16L459 6.78l1-2.89v-.8h-7.43l-6.69 19.26h-.5l-3.27-9.46-3.31-9.64-.06-.16h-3.88l-3.88.01ZM36.57 7.36c-1.36.1-2.6.6-3.62 1.45a5.65 5.65 0 0 0-1.67 2.42l-.05.13H31V7.7h-4.35v23.08h4.5v-7.3c0-8 0-7.34.08-7.82a4.89 4.89 0 0 1 2.06-3.18c.83-.58 1.74-.89 2.87-.98a11.87 11.87 0 0 1 2.8.25H39v-4.3l-.21-.02c-.61-.07-1.74-.1-2.22-.07ZM51.08 7.41c-2.33.12-4.3.84-5.95 2.16a9.89 9.89 0 0 0-2.03 2.2 12.5 12.5 0 0 0-2 5.78 18.04 18.04 0 0 0 0 3.65 12.13 12.13 0 0 0 2.26 6.05 9.74 9.74 0 0 0 5 3.52c2.11.64 4.7.64 6.8 0a9.78 9.78 0 0 0 4.88-3.37c1.38-1.78 2.19-4 2.4-6.58.13-1.46.06-3.06-.18-4.42a11.24 11.24 0 0 0-3.58-6.6 10 10 0 0 0-5.75-2.35c-.56-.06-1.31-.07-1.85-.04Zm1.42 3.78c.88.1 1.62.34 2.28.75a6.13 6.13 0 0 1 1.99 2.15 10.31 10.31 0 0 1 1.2 5c.02 1.23-.12 2.44-.42 3.51a7.14 7.14 0 0 1-1.81 3.32c-.61.6-1.2.98-1.95 1.24a6 6 0 0 1-2 .3 5.7 5.7 0 0 1-2.72-.6 5 5 0 0 1-1.28-.94A7.1 7.1 0 0 1 46 22.73c-.57-1.99-.6-4.46-.08-6.5a7.24 7.24 0 0 1 2.03-3.67 5.13 5.13 0 0 1 3.35-1.4 11 11 0 0 1 1.2.03ZM92.05 7.4c-.96.06-1.56.15-2.3.33a9.62 9.62 0 0 0-6.09 4.66 13.5 13.5 0 0 0-1.71 7c0 .83 0 1.04.06 1.6.16 1.77.58 3.32 1.29 4.7A9.72 9.72 0 0 0 90.28 31c1.84.37 4.08.32 5.85-.13a9.07 9.07 0 0 0 5.02-3.1A7.64 7.64 0 0 0 102.5 25l-2.11-.39-2.11-.38-.08.13a4.72 4.72 0 0 1-2.35 2.55 6.3 6.3 0 0 1-2.23.58c-.29.03-1.13.03-1.44 0a6.35 6.35 0 0 1-3.02-1.04 5.93 5.93 0 0 1-2.02-2.43 8.44 8.44 0 0 1-.72-3.18v-.26h16.38v-.81c0-1.83-.06-2.76-.25-3.87-.2-1.22-.53-2.24-1.05-3.28a8.9 8.9 0 0 0-2.66-3.26 10.1 10.1 0 0 0-5.34-1.94 18.3 18.3 0 0 0-1.46-.03Zm1.3 3.75c1.2.13 2.19.55 3.05 1.3a5.8 5.8 0 0 1 1.78 2.96c.13.51.21 1.17.21 1.66v.15H86.43v-.12c.08-.97.3-1.78.72-2.61.5-1 1.2-1.8 2.14-2.42a5.32 5.32 0 0 1 2.9-.95c.2-.01.97 0 1.17.03ZM116.79 7.41c-2 .1-3.73.65-5.22 1.65a10.7 10.7 0 0 0-4.25 6.06 16.1 16.1 0 0 0-.5 5.8c.2 2.17.84 4.13 1.88 5.76.58.9 1.32 1.73 2.15 2.4a9.37 9.37 0 0 0 3.6 1.8 12.06 12.06 0 0 0 3.92.34 10.2 10.2 0 0 0 3.84-.95 8.31 8.31 0 0 0 4.76-6.75l.01-.04h-4.37l-.05.16a4.87 4.87 0 0 1-4.24 3.75c-.59.07-1.32.06-1.93-.05a5.47 5.47 0 0 1-3.5-2.27c-.56-.75-1-1.73-1.26-2.79a13.8 13.8 0 0 1-.16-5.24 7.77 7.77 0 0 1 2.1-4.3 5.48 5.48 0 0 1 2.15-1.3 6.4 6.4 0 0 1 3.89.1c.59.21 1.03.5 1.5.96a5.32 5.32 0 0 1 1.46 2.5l.04.15h4.37v-.06a8.22 8.22 0 0 0-5.31-6.94 10.98 10.98 0 0 0-4.88-.74ZM156.2 7.41a9.87 9.87 0 0 0-6 2.29 11.02 11.02 0 0 0-3.41 5.43c-.52 1.78-.68 3.9-.48 5.97.17 1.8.63 3.38 1.37 4.8a9.68 9.68 0 0 0 5.91 4.86c1.65.48 3.63.61 5.53.36 3.72-.49 6.55-2.62 7.56-5.69.12-.39.13-.42.1-.43-.02 0-4.13-.75-4.19-.75-.03 0-.04 0-.1.16-.18.42-.45.9-.72 1.22-.16.2-.49.53-.7.7-.67.54-1.5.9-2.43 1.08-.48.08-.83.11-1.41.11-.64 0-1.07-.04-1.6-.15a5.76 5.76 0 0 1-3.93-2.83 8 8 0 0 1-.99-3.79v-.16h16.38v-1.11l-.02-1.43c-.1-2.25-.53-4-1.35-5.59a9.24 9.24 0 0 0-6.18-4.75c-1.04-.26-2.2-.36-3.33-.3Zm1.45 3.74a5.35 5.35 0 0 1 3.66 1.94 6.1 6.1 0 0 1 1.38 4.01v.12h-11.97v-.06c0-.02 0-.14.02-.25a6.6 6.6 0 0 1 2.15-4.32 5.73 5.73 0 0 1 3.5-1.46c.25-.02 1 0 1.26.02ZM233.58 7.82l8.37 23.22a49.22 49.22 0 0 1-.67 1.9 5.36 5.36 0 0 1-1.14 1.8c-.41.4-.82.58-1.48.69-.27.04-1.03.03-1.35 0a8.05 8.05 0 0 1-1.1-.23l-1.08 3.67c0 .02.32.14.66.22.83.21 1.57.29 2.56.28.56-.01.8-.03 1.24-.1 2.71-.4 4.66-2.09 5.86-5.08l9.64-26.44c0-.02-4.82-.06-4.83-.05l-2.93 8.96-2.91 8.94h-.24l-.22-.65-2.91-8.95-2.7-8.3H233.53ZM293.05 35.8c-1.18.04-1.93.09-2.8.16-2.52.24-4.53.69-5.43 1.23-.7.41-.76.86-.2 1.28.88.66 3.29 1.19 6.36 1.4a48.55 48.55 0 0 0 5.75.05c3.47-.19 6.24-.78 7.11-1.5.22-.19.3-.34.3-.53 0-.1 0-.12-.04-.22-.35-.69-2.32-1.3-5.25-1.63a41.09 41.09 0 0 0-5.8-.24Zm0 0"})})})}let Hi=/*#__PURE__*/Ne.span.withConfig({displayName:"TermsAndConditionsContainer",componentId:"sc-ff3bd734-0"})(["margin-top:16px;font-size:13px;text-align:center;color:var(--privy-color-foreground-3);display:block;&& > a{color:var(--privy-color-accent);}"]);function ji({app:{legal:{privacyPolicyUrl:n,termsAndConditionsUrl:a,requireUsersAcceptTerms:i}},alwaysShowImplicitConsent:r}){let o=!(!n||!a);return i&&!r||!a&&!n?
2
- /*#__PURE__*/t(Hi,{}):
3
- /*#__PURE__*/ /*#__PURE__*/e(Hi,{children:["By logging in I agree to the"," ",a&&/*#__PURE__*/t("a",{href:a,target:"_blank",children:o?"Terms":"Terms of Service"}),o&&" & ",n&&/*#__PURE__*/t("a",{href:n,target:"_blank",children:"Privacy Policy"})]})}const $i=({className:e})=>{let{appearance:n}=Z();/*#__PURE__*/return t(Gi,{className:e,children:n.footerLogo??/*#__PURE__*/t(qi,{href:"https://www.privy.io/",target:"_blank",id:"protected-by-privy",children:/*#__PURE__*/t(Vi,{color:"currentColor",height:13,width:150})})})};let qi=/*#__PURE__*/Ne.a.withConfig({displayName:"PrivyLink",componentId:"sc-ff3bd734-1"})(["&&{padding:0;color:var(--privy-color-foreground-3);}"]);const Gi=/*#__PURE__*/Ne.div.withConfig({displayName:"ModalFooter",componentId:"sc-ff3bd734-2"})(["display:flex;align-items:center;justify-content:center;padding-top:8px;padding-bottom:12px;gap:8px;font-size:13px;&& a{padding:0.5rem 0;&:hover{text-decoration:none;}}@media all and (display-mode:standalone){padding-bottom:30px;}"]),Zi=({success:n,fail:a})=>/*#__PURE__*/e(Yi,{children:[/*#__PURE__*/t(Qi,{children:/*#__PURE__*/t(Xi,{className:n?"success":a?"fail":""})}),/*#__PURE__*/t(Qi,{children:/*#__PURE__*/t(Ki,{className:n?"success":a?"fail":""})})]});let Qi=/*#__PURE__*/Ne.span.withConfig({displayName:"PositionedAbsoluteLoader",componentId:"sc-aba6339d-0"})(["&&{position:absolute;top:0;left:0;z-index:2;}"]),Yi=/*#__PURE__*/Ne.span.withConfig({displayName:"ConnectionLoaderContainer",componentId:"sc-aba6339d-1"})(["position:relative;width:82px;height:82px;display:inline-block;"]);const Ki=/*#__PURE__*/Ne.span.withConfig({displayName:"Loader",componentId:"sc-aba6339d-2"})(["&&{width:82px;height:82px;border-width:4px;border-style:solid;border-color:",";border-bottom-color:transparent;border-radius:50%;display:inline-block;box-sizing:border-box;animation:rotation 1.2s linear infinite;transition:border-color 800ms;}@keyframes rotation{0%{transform:rotate(0deg);}100%{transform:rotate(360deg);}}&&&.success{border-color:var(--privy-color-icon-success);border-bottom-color:var(--privy-color-icon-success);}&&&.fail{border-color:var(--privy-color-icon-error);border-bottom-color:var(--privy-color-icon-error);}"],(e=>e.color??"var(--privy-color-icon-subtle)")),Xi=/*#__PURE__*/Ne(Ki).withConfig({displayName:"LoaderFaint",componentId:"sc-aba6339d-3"})(["&&{border-bottom-color:",";border-color:",";animation:none;opacity:0.5;}"],(e=>e.color??"var(--privy-color-border-default)"),(e=>e.color??"var(--privy-color-border-default)")),Ji=e=>/*#__PURE__*/t(er,{color:e.color||"var(--privy-color-foreground-3)"});let er=/*#__PURE__*/Ne(Ki).withConfig({displayName:"StyledButtonLoader",componentId:"sc-aba6339d-4"})(["&&{height:1rem;width:1rem;margin:2px 0;border-width:1.5px;transition:border-color 200ms ease;}"]);const tr=({variant:e="primary",size:n="lg",children:a,success:i,...r})=>{switch(e){case"secondary":/*#__PURE__*/return t(lr,{size:n,...r,children:a});case"error":/*#__PURE__*/return t(lr,{$warn:!0,size:n,...r,children:a});case"muted":/*#__PURE__*/return t(sr,{size:n,...r,children:a});default:/*#__PURE__*/return t(ar,{size:n,success:i,...r,children:a})}},nr=/*#__PURE__*/Ne.button.withConfig({displayName:"BaseButton",componentId:"sc-e537b447-0"})(["display:flex;flex-direction:row;align-items:center;justify-content:center;user-select:none;&{width:auto;cursor:pointer;border-radius:",";font-size:14px;font-style:normal;font-weight:500;line-height:22px;letter-spacing:-0.016px;}&&{height:",";padding:0 ",";}"],(({$size:e})=>"sm"===e?"6px":"var(--privy-border-radius-sm)"),(({$size:e})=>"sm"===e?"28px":"48px"),(({$size:e})=>"sm"===e?"10px":"16px")),ar=({children:a,loading:i,disabled:r,success:o,size:l="lg",loadingText:s="Loading...",as:c,onClick:d,...p})=>{let h="a"===c,u=!(!i&&!r);/*#__PURE__*/return t(or,{as:c,disabled:h?void 0:u,"aria-disabled":h?u:void 0,$success:o,$size:l,onClick:e=>{h&&u?e.preventDefault():d?.(e)},...p,children:i?/*#__PURE__*/e(n,{children:[/*#__PURE__*/t(Ji,{}),s?/*#__PURE__*/t("span",{style:{marginLeft:"8px"},children:s}):null]}):a})},ir=({children:e,loading:n,disabled:a,...i})=>/*#__PURE__*/t(rr,{disabled:a,...i,children:n?/*#__PURE__*/t(Ji,{color:"var(--privy-color-foreground-accent)"}):e});let rr=/*#__PURE__*/Ne(nr).withConfig({displayName:"StyledPrimaryButtonWithoutGray",componentId:"sc-e537b447-1"})(["position:relative;&&{background-color:var(--privy-color-accent);color:var(--privy-color-foreground-accent);transition:background-color 200ms ease;}&:hover{background-color:var(--privy-color-accent-dark);}&:active{background-color:var(--privy-color-accent-dark);}&:disabled,&:hover:disabled,&:active:disabled{cursor:not-allowed;color:var(--privy-color-foreground-disabled);background-color:var(--privy-color-accent-dark);}"]),or=/*#__PURE__*/Ne(nr).withConfig({displayName:"StyledPrimaryButton",componentId:"sc-e537b447-2"})(["position:relative;&&{background-color:",";color:var(--privy-color-foreground-accent);transition:background-color 200ms ease;}&:hover{background-color:",";}&:active{background-color:",";}&:focus{outline:none;box-shadow:0 0 0 3px #949df9;}&:disabled{background-color:var(--privy-color-background-2);border:1px solid var(--privy-color-border-default);color:var(--privy-color-foreground-disabled);cursor:not-allowed;}&:hover:disabled,&:active:disabled{background-color:var(--privy-color-background-2);border:1px solid var(--privy-color-border-default);color:var(--privy-color-foreground-disabled);cursor:not-allowed;}",""],(e=>e.$warn?"var(--privy-color-error-dark)":"var(--privy-color-accent)"),(e=>e.$warn?"var(--privy-color-error-dark)":"var(--privy-color-accent-dark)"),(e=>e.$warn?"var(--privy-color-error-dark)":"var(--privy-color-accent-dark)"),(e=>e.disabled&&/*#__PURE__*/Ee(["&&&,&&&:hover,&&&:active{background-color:var(--privy-color-background-2);border:1px solid var(--privy-color-border-default);color:var(--privy-color-foreground-disabled);cursor:not-allowed;}"])));const lr=({children:a,loading:i,disabled:r,size:o="lg",loadingText:l="Loading...",as:s,onClick:c,...d})=>{let p="a"===s,h=!(!i&&!r);/*#__PURE__*/return t(cr,{as:s,disabled:p?void 0:h,"aria-disabled":p?h:void 0,$size:o,onClick:e=>{p&&h?e.preventDefault():c?.(e)},...d,children:i?/*#__PURE__*/e(n,{children:[/*#__PURE__*/t(Ji,{}),l?/*#__PURE__*/t("span",{style:{marginLeft:"8px"},children:l}):null]}):a})},sr=({children:a,loading:i,disabled:r,size:o="lg",loadingText:l="Loading...",as:s,onClick:c,...d})=>{let p="a"===s,h=!(!i&&!r);/*#__PURE__*/return t(dr,{as:s,disabled:p?void 0:h,"aria-disabled":p?h:void 0,$size:o,onClick:e=>{p&&h?e.preventDefault():c?.(e)},...d,children:i?/*#__PURE__*/e(n,{children:[/*#__PURE__*/t(Ji,{}),l?/*#__PURE__*/t("span",{style:{marginLeft:"8px"},children:l}):null]}):a})};let cr=/*#__PURE__*/Ne(nr).withConfig({displayName:"StyledSecondaryButton",componentId:"sc-e537b447-3"})(["&&{border-width:1px;border-style:solid;border-color:",";background-color:var(--privy-color-background);color:",";transition:border-color 200ms ease,color 200ms ease,background-color 200ms ease;}&:hover{border-color:",";background-color:",";color:",";}&:active{border-color:",";background-color:",";color:",";}&:disabled{border-color:var(--privy-color-border-default);background-color:var(--privy-color-background-2);color:var(--privy-color-foreground-disabled);cursor:not-allowed;}&:hover:disabled,&:active:disabled{border-color:var(--privy-color-border-default);background-color:var(--privy-color-background-2);color:var(--privy-color-foreground-disabled);cursor:not-allowed;}",""],(e=>e.$warn?"var(--privy-color-border-error)":"var(--privy-color-accent)"),(e=>e.$warn?"var(--privy-color-error-dark)":"var(--privy-color-accent)"),(e=>e.$warn?"var(--privy-color-border-error)":"var(--privy-color-border-interactive-hover)"),(e=>e.$warn?"var(--privy-color-error-light)":"var(--privy-color-info-bg-hover)"),(e=>e.$warn?"var(--privy-color-error-dark)":"var(--privy-color-accent)"),(e=>e.$warn?"var(--privy-color-border-error)":"var(--privy-color-border-interactive)"),(e=>e.$warn?"var(--privy-color-error-bg-hover)":"var(--privy-color-info-bg)"),(e=>e.$warn?"var(--privy-color-error-dark)":"var(--privy-color-accent)"),(e=>e.disabled&&/*#__PURE__*/Ee(["&&&,&&&:hover,&&&:active{border-color:var(--privy-color-border-default);background-color:var(--privy-color-background-2);color:var(--privy-color-foreground-disabled);cursor:not-allowed;}"]))),dr=/*#__PURE__*/Ne(nr).withConfig({displayName:"StyledMutedButton",componentId:"sc-e537b447-4"})(["&&{border-width:1px;border-style:solid;border-color:var(--privy-color-border-default);background-color:transparent;color:var(--privy-color-text-muted);transition:border-color 200ms ease,color 200ms ease,background-color 200ms ease;}&:hover{border-color:var(--privy-color-border-default);background-color:var(--privy-color-info-bg-hover);color:var(--privy-color-foreground-2);}&:active{border-color:var(--privy-color-border-default);background-color:var(--privy-color-info-bg);color:var(--privy-color-foreground-2);}&:focus{outline:none;box-shadow:0 0 0 3px #949df9;}&:disabled{border-color:var(--privy-color-border-default);background-color:var(--privy-color-background-2);color:var(--privy-color-foreground-disabled);cursor:not-allowed;}&:hover:disabled,&:active:disabled{border-color:var(--privy-color-border-default);background-color:var(--privy-color-background-2);color:var(--privy-color-foreground-disabled);cursor:not-allowed;}",""],(e=>e.disabled&&/*#__PURE__*/Ee(["&&&,&&&:hover,&&&:active{border-color:var(--privy-color-border-default);background-color:var(--privy-color-background-2);color:var(--privy-color-foreground-disabled);cursor:not-allowed;}"])));const pr=({children:n,onClick:a,disabled:i,isSubmitting:r,...o})=>/*#__PURE__*/e(hr,{$isSubmitting:r,onClick:a,disabled:i,...o,children:[/*#__PURE__*/t("span",{children:n}),
4
- /*#__PURE__*/t("span",{children:/*#__PURE__*/t(Ji,{})})]});let hr=/*#__PURE__*/Ne.button.withConfig({displayName:"StyledEmbeddedButton",componentId:"sc-e537b447-7"})(["&&{color:var(--privy-color-accent);font-size:16px;font-style:normal;font-weight:500;line-height:24px;cursor:pointer;border-radius:0px var(--privy-border-radius-mdlg) var(--privy-border-radius-mdlg) 0px;border:none;transition:color 200ms ease;@media (min-width:441px){font-size:14px;}:hover{color:var(--privy-color-accent-dark);}&& > :first-child{opacity:",";}&& > :last-child{position:absolute;display:flex;top:50%;left:50%;transform:translate3d(-50%,-50%,0);opacity:",";}:disabled,:hover:disabled{color:var(--privy-color-foreground-disabled);cursor:not-allowed;}}"],(e=>e.$isSubmitting?0:1),(e=>e.$isSubmitting?1:0));const ur=({backFn:e})=>/*#__PURE__*/t("div",{children:/*#__PURE__*/t(fr,{onClick:e,children:/*#__PURE__*/t(Me,{height:"16px",width:"16px",strokeWidth:2})})}),mr=({infoFn:e})=>/*#__PURE__*/t("div",{children:/*#__PURE__*/t(wr,{"aria-label":"info",onClick:e,children:/*#__PURE__*/t(We,{height:"22px",width:"22px",strokeWidth:2})})}),gr=e=>/*#__PURE__*/t("div",{children:/*#__PURE__*/t(fr,{"aria-label":"close modal",onClick:e.onClose,children:/*#__PURE__*/t(Le,{height:"16px",width:"16px",strokeWidth:2})})}),yr=({backFn:n,infoFn:a,onClose:i,title:r,closeable:o=!0,className:l})=>{let{closePrivyModal:s}=O(),c=Z();/*#__PURE__*/return e(vr,{className:l,children:[/*#__PURE__*/e(br,{children:[n&&/*#__PURE__*/t(ur,{backFn:n}),a&&/*#__PURE__*/t(mr,{infoFn:a})]}),r&&/*#__PURE__*/t(xr,{id:"privy-dialog-title",children:r}),/*#__PURE__*/t(Cr,{children:!c.render.standalone&&o&&/*#__PURE__*/t(gr,{onClose:i||(()=>s())})})]})};let fr=/*#__PURE__*/Ne.button.withConfig({displayName:"StyledButton",componentId:"sc-e033e17a-0"})(["&&{cursor:pointer;display:flex;opacity:0.6;background-color:var(--privy-color-background-2);border-radius:var(--privy-border-radius-full);padding:4px;> svg{margin:auto;color:var(--privy-color-foreground);}:hover{opacity:1;}}"]),wr=/*#__PURE__*/Ne(fr).withConfig({displayName:"TransparentStyledButton",componentId:"sc-e033e17a-1"})(["&&{background-color:transparent;}"]),vr=/*#__PURE__*/Ne.div.withConfig({displayName:"StyledHeader",componentId:"sc-e033e17a-2"})(["padding:16px 0;display:flex;align-items:center;justify-content:space-between;h2{font-size:16px;line-height:24px;font-weight:600;color:var(--privy-color-foreground);}"]),br=/*#__PURE__*/Ne.div.withConfig({displayName:"LeftActionContainer",componentId:"sc-e033e17a-3"})(["flex:1;align-items:center;display:flex;gap:8px;"]),Cr=/*#__PURE__*/Ne.div.withConfig({displayName:"RightActionContainer",componentId:"sc-e033e17a-4"})(["flex:1;display:flex;justify-content:flex-end;"]),xr=/*#__PURE__*/Ne.div.withConfig({displayName:"TitleContainer",componentId:"sc-e033e17a-5"})(["overflow:hidden;white-space:nowrap;max-width:100%;text-overflow:ellipsis;text-align:center;color:var(--privy-color-foreground-2);"]);const kr=({size:n,centerIcon:a})=>/*#__PURE__*/t(Tr,{$size:n,children:/*#__PURE__*/e(Ar,{children:[/*#__PURE__*/t(Sr,{}),/*#__PURE__*/t(Nr,{}),a?/*#__PURE__*/t(Ir,{children:a}):null]})});let Tr=/*#__PURE__*/Ne.div.withConfig({displayName:"LoadingContainer",componentId:"sc-ebc93df8-0"})(["--spinner-size:",";display:inline-flex;justify-content:center;align-items:center;@media all and (display-mode:standalone){margin-bottom:30px;}"],(e=>e.$size?e.$size:"96px")),Ar=/*#__PURE__*/Ne.div.withConfig({displayName:"SpinnerContainer",componentId:"sc-ebc93df8-1"})(["position:relative;height:var(--spinner-size);width:var(--spinner-size);opacity:1;animation:fadein 200ms ease;"]),Ir=/*#__PURE__*/Ne.div.withConfig({displayName:"CenterIconContainer",componentId:"sc-ebc93df8-2"})(["position:absolute;top:0;right:0;bottom:0;left:0;display:flex;align-items:center;justify-content:center;svg,img{width:calc(var(--spinner-size) * 0.4);height:calc(var(--spinner-size) * 0.4);border-radius:var(--privy-border-radius-full);}"]),Sr=/*#__PURE__*/Ne.div.withConfig({displayName:"CircleFixed",componentId:"sc-ebc93df8-3"})(["position:absolute;top:0;right:0;bottom:0;left:0;width:var(--spinner-size);height:var(--spinner-size);&&{border:4px solid var(--privy-color-border-default);border-radius:50%;}"]),Nr=/*#__PURE__*/Ne.div.withConfig({displayName:"CircleRotate",componentId:"sc-ebc93df8-4"})(["position:absolute;top:0;right:0;bottom:0;left:0;width:var(--spinner-size);height:var(--spinner-size);animation:spin 1200ms linear infinite;&&{border:4px solid;border-color:var(--privy-color-icon-subtle) transparent transparent transparent;border-radius:50%;}@keyframes spin{from{transform:rotate(0deg);}to{transform:rotate(360deg);}}"]);const Er=/*#__PURE__*/Ne.div.withConfig({displayName:"ScreenRoot",componentId:"sc-cc9e9a32-0"})(["--screen-space:16px;--screen-space-lg:calc(var(--screen-space) * 1.5);position:relative;overflow:hidden;margin:0 calc(-1 * var(--screen-space));height:100%;border-radius:var(--privy-border-radius-lg);"]),_r=/*#__PURE__*/Ne.div.withConfig({displayName:"ScreenRootInner",componentId:"sc-cc9e9a32-1"})(["display:flex;flex-direction:column;gap:calc(var(--screen-space) * 1.5);width:100%;background:var(--privy-color-background);padding:0 var(--screen-space-lg) var(--screen-space);height:100%;border-radius:var(--privy-border-radius-lg);"]),Mr=/*#__PURE__*/Ne.div.withConfig({displayName:"HeaderContainer",componentId:"sc-cc9e9a32-2"})(["position:relative;display:flex;flex-direction:column;"]),Wr=/*#__PURE__*/Ne(yr).withConfig({displayName:"StyledModalHeader",componentId:"sc-cc9e9a32-3"})(["margin:0 -8px;"]),Lr=/*#__PURE__*/Ne.div.withConfig({displayName:"BodyContainer",componentId:"sc-cc9e9a32-4"})(["flex:1 1 auto;display:flex;flex-direction:column;overflow-y:auto;padding:3px;margin:-3px;&::-webkit-scrollbar{display:none;}scrollbar-gutter:stable both-edges;scrollbar-width:none;-ms-overflow-style:none;"," background-repeat:no-repeat;background-size:100% 32px,100% 16px;background-attachment:local,scroll;"],(({$colorScheme:e})=>"light"===e?"background: linear-gradient(var(--privy-color-background), var(--privy-color-background) 70%) bottom, linear-gradient(rgba(0, 0, 0, 0) 20%, rgba(0, 0, 0, 0.06)) bottom;":"dark"===e?"background: linear-gradient(var(--privy-color-background), var(--privy-color-background) 70%) bottom, linear-gradient(rgba(255, 255, 255, 0) 20%, rgba(255, 255, 255, 0.06)) bottom;":void 0)),Pr=/*#__PURE__*/Ne.div.withConfig({displayName:"FooterContainer",componentId:"sc-cc9e9a32-5"})(["display:flex;flex-direction:column;gap:var(--screen-space-lg);"]);let Fr=/*#__PURE__*/Ne.div.withConfig({displayName:"CenteredHeader",componentId:"sc-cc9e9a32-6"})(["text-align:center;display:flex;flex-direction:column;align-items:center;gap:var(--screen-space);"]),Dr=/*#__PURE__*/Ne.div.withConfig({displayName:"TitleContainer",componentId:"sc-cc9e9a32-7"})(["display:flex;flex-direction:column;gap:4px;"]),Rr=/*#__PURE__*/Ne.h3.withConfig({displayName:"HeaderTitle",componentId:"sc-cc9e9a32-8"})(["&&{font-size:20px;line-height:32px;font-weight:500;color:var(--privy-color-foreground);margin:0;}"]),Or=/*#__PURE__*/Ne.p.withConfig({displayName:"HeaderSubtitle",componentId:"sc-cc9e9a32-9"})(["&&{margin:0;font-size:16px;font-weight:300;line-height:24px;color:var(--privy-color-foreground);}"]),Ur=/*#__PURE__*/Ne.div.withConfig({displayName:"IconContainer",componentId:"sc-cc9e9a32-10"})(["background:",";border-radius:50%;width:64px;height:64px;display:flex;align-items:center;justify-content:center;"],(({$variant:e})=>{switch(e){case"success":return"var(--privy-color-success-bg, #EAFCEF)";case"warning":return"var(--privy-color-warn, #FEF3C7)";case"error":return"var(--privy-color-error-bg, #FEE2E2)";case"loading":case"logo":return"transparent";default:return"var(--privy-color-background-2)"}})),Br=/*#__PURE__*/Ne.div.withConfig({displayName:"LogoContainer",componentId:"sc-cc9e9a32-11"})(["display:flex;align-items:center;justify-content:center;margin-bottom:var(--screen-space);img,svg{max-height:90px;max-width:180px;}"]),zr=/*#__PURE__*/Ne.div.withConfig({displayName:"LoadingWithIconContainer",componentId:"sc-cc9e9a32-12"})(["display:flex;flex-direction:column;justify-content:center;align-items:center;width:100%;height:82px;> div{position:relative;}> div > :first-child{position:relative;}> div > :last-child{position:absolute;left:50%;top:50%;transform:translate(-50%,-50%);}"]);const Vr=({children:e,...n})=>/*#__PURE__*/t(Er,{children:/*#__PURE__*/t(_r,{...n,children:e})});let Hr=/*#__PURE__*/Ne.div.withConfig({displayName:"ProgressBarContainer",componentId:"sc-cc9e9a32-13"})(["position:absolute;top:0;left:calc(-1 * var(--screen-space-lg));width:calc(100% + calc(var(--screen-space-lg) * 2));height:4px;background:var(--privy-color-background-2);border-top-left-radius:inherit;border-top-right-radius:inherit;overflow:hidden;"]),jr=/*#__PURE__*/Ne($i).withConfig({displayName:"StyledBlobbyFooter",componentId:"sc-cc9e9a32-14"})(["padding:0;&& a{padding:0;color:var(--privy-color-foreground-3);}"]),$r=/*#__PURE__*/Ne.div.withConfig({displayName:"ProgressBarFill",componentId:"sc-cc9e9a32-15"})(["height:100%;width:","%;background:var(--privy-color-foreground-3);border-radius:2px;transition:width 300ms ease-in-out;"],(({pct:e})=>e)),qr=({step:e})=>e?/*#__PURE__*/t(Hr,{children:/*#__PURE__*/t($r,{pct:Math.min(100,e.current/e.total*100)})}):null;Vr.Header=({title:n,subtitle:a,icon:i,iconVariant:r,iconLoadingStatus:o,showBack:l,onBack:s,showInfo:c,onInfo:d,showClose:p,onClose:h,step:u,...m})=>/*#__PURE__*/e(Mr,{...m,children:[/*#__PURE__*/t(Wr,{backFn:l?s:void 0,infoFn:c?d:void 0,onClose:p?h:void 0,closeable:p}),(i||r||n||a)&&/*#__PURE__*/e(Fr,{children:[i||r?/*#__PURE__*/t(Vr.Icon,{icon:i,variant:r,loadingStatus:o}):null,/*#__PURE__*/e(Dr,{children:[n&&/*#__PURE__*/t(Rr,{children:n}),a&&/*#__PURE__*/t(Or,{children:a})]})]}),u&&/*#__PURE__*/t(qr,{step:u})]}),Vr.Body=/*#__PURE__*/b.forwardRef((({children:e,...n},a)=>/*#__PURE__*/t(Lr,{ref:a,...n,children:e}))),Vr.Body.displayName="Screen.Body",Vr.Footer=({children:e,...n})=>/*#__PURE__*/t(Pr,{...n,children:e}),Vr.Actions=({children:e,...n})=>/*#__PURE__*/t(Gr,{...n,children:e}),Vr.HelpText=({children:e,...n})=>/*#__PURE__*/t(Zr,{...n,children:e}),Vr.Watermark=()=>/*#__PURE__*/t(jr,{}),Vr.Icon=({icon:n,variant:a="subtle",loadingStatus:i})=>"logo"===a&&n?/*#__PURE__*/t(Br,"string"==typeof n?{children:/*#__PURE__*/t("img",{src:n,alt:""})}:/*#__PURE__*/b.isValidElement(n)?{children:n}:{children:/*#__PURE__*/b.createElement(n)}):"loading"===a?n?
5
- /*#__PURE__*/t(zr,{children:/*#__PURE__*/e("div",{style:{display:"flex",alignItems:"center",justifyContent:"center"},children:[/*#__PURE__*/t(Zi,{success:i?.success,fail:i?.fail}),"string"==typeof n?
6
- /*#__PURE__*/t("span",{style:{background:`url('${n}') 0 0 / contain`,height:"38px",width:"38px",borderRadius:"6px",margin:"auto",backgroundSize:"contain"}}):/*#__PURE__*/b.isValidElement(n)?
7
- /*#__PURE__*/b.cloneElement(n,{style:{width:"38px",height:"38px"}}):
8
- /*#__PURE__*/b.createElement(n,{style:{width:"38px",height:"38px"}})]})}):
9
- /*#__PURE__*/t(Ur,{$variant:a,children:/*#__PURE__*/t(kr,{size:"64px"})}):/*#__PURE__*/t(Ur,{$variant:a,children:n&&("string"==typeof n?
10
- /*#__PURE__*/t("img",{src:n,alt:"",style:{width:"32px",height:"32px",borderRadius:"6px"}}):/*#__PURE__*/b.isValidElement(n)?n:
11
- /*#__PURE__*/b.createElement(n,{width:32,height:32,stroke:(()=>{switch(a){case"success":return"var(--privy-color-icon-success)";case"warning":return"var(--privy-color-icon-warning)";case"error":return"var(--privy-color-icon-error)";default:return"var(--privy-color-icon-muted)"}})(),strokeWidth:2}))});let Gr=/*#__PURE__*/Ne.div.withConfig({displayName:"ActionsContainer",componentId:"sc-cc9e9a32-16"})(["width:100%;display:flex;flex-direction:column;gap:calc(var(--screen-space) / 2);"]),Zr=/*#__PURE__*/Ne.p.withConfig({displayName:"HelpTextContainer",componentId:"sc-cc9e9a32-17"})(["&&{margin:0;width:100%;text-align:center;color:var(--privy-color-foreground-3);font-size:14px;line-height:22px;& a{color:var(--privy-color-accent);}}"]);const Qr=({primaryCta:a,secondaryCta:i,helpText:r,watermark:o=!0,children:l,...s})=>{let c=a||i?/*#__PURE__*/e(n,{children:[a&&(()=>{let{label:e,...n}=a,i=n.variant||"primary";/*#__PURE__*/return t(tr,{...n,variant:i,style:{width:"100%",...n.style},children:e})})(),i&&(()=>{let{label:e,...n}=i,a=n.variant||"secondary";/*#__PURE__*/return t(tr,{...n,variant:a,style:{width:"100%",...n.style},children:e})})()]}):null;/*#__PURE__*/return e(Vr,{id:s.id,className:s.className,children:[/*#__PURE__*/t(Vr.Header,{...s}),l?/*#__PURE__*/t(Vr.Body,{children:l}):null,r||c||o?/*#__PURE__*/e(Vr.Footer,{children:[r?/*#__PURE__*/t(Vr.HelpText,{children:r}):null,c?/*#__PURE__*/t(Vr.Actions,{children:c}):null,o?/*#__PURE__*/t(Vr.Watermark,{}):null]}):null]})},Yr=({label:n,children:a,valueStyles:i})=>/*#__PURE__*/e(Kr,{children:[/*#__PURE__*/t("div",{children:n}),/*#__PURE__*/t(Xr,{style:{...i},children:a})]});let Kr=/*#__PURE__*/Ne.div.withConfig({displayName:"StyledDetailsRow",componentId:"sc-4ebfdd45-0"})(["display:flex;align-items:center;justify-content:space-between;width:100%;> :first-child{color:var(--privy-color-foreground-3);text-align:left;}> :last-child{color:var(--privy-color-foreground-2);text-align:right;}"]),Xr=/*#__PURE__*/Ne.div.withConfig({displayName:"ValueWrapper",componentId:"sc-4ebfdd45-1"})(["font-size:14px;line-height:100%;display:flex;align-items:center;justify-content:center;border-radius:var(--privy-border-radius-full);background-color:var(--privy-color-background-2);padding:4px 8px;"]),Jr=new Intl.NumberFormat(void 0,{style:"currency",currency:"USD",maximumFractionDigits:2}),eo=e=>Jr.format(e);const to=(e,t)=>{let n=eo(t*parseFloat(e));return"$0.00"!==n?n:"<$0.01"},no=(e,t)=>{let n=eo(t*parseFloat(ue(e)));return"$0.00"===n?"<$0.01":n},ao=(e,t,n=6,a=!1)=>`${io(e,n,a)} ${t}`,io=(e,t=6,n=!1)=>{let a=parseFloat(ue(e)).toFixed(t).replace(/0+$/,"").replace(/\.$/,"");return n?a:`${"0"===a?"<0.001":a}`},ro=e=>e.reduce(((e,t)=>e+t),0n),oo=(e,t)=>{let{chains:n}=O(),a=`https://etherscan.io/address/${t}`,i=`${((e,t)=>{let n=Number(e),a=t.find((e=>e.id===n));if(!a)throw new W(`Unsupported chainId ${e}`,4901);return a.blockExplorers?.default.url})(e,n)}/address/${t}`;if(!i)return a;try{new URL(i)}catch{return a}return i},lo=1e9,so="11111111111111111111111111111111",co="TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA",po="TokenzQdBNbLqP5VEhdkAS6EPFLC1PHnBqCXEpPxuEb",ho="ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL",uo=["CPMMoo8L3F4NbTegBCKVNunggL7H1ZpdTHKxQB5qKP1C","CPMDWBwJDtYax9qW7AyRuVC19Cc4L4Vcy4n2BHAbHkCW"],mo=["JUP6LkbZbjS1jKKwapdHNy74zcZ3tLUZoi5QNyVTaV4"],go={"solana:mainnet":{EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v:{symbol:"USDC",decimals:6,address:"EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v"},Es9vMFrzaCERmJfrF4H2FYD4KCoNkY11McCe8BenwNYB:{symbol:"USDT",decimals:6,address:"Es9vMFrzaCERmJfrF4H2FYD4KCoNkY11McCe8BenwNYB"},So11111111111111111111111111111111111111112:{symbol:"SOL",decimals:9,address:"So11111111111111111111111111111111111111112"}},"solana:devnet":{"4zMMC9srt5Ri5X14GAgXhaHii3GnPAEERYPJgZJDncDU":{symbol:"USDC",decimals:6,address:"4zMMC9srt5Ri5X14GAgXhaHii3GnPAEERYPJgZJDncDU"},EJwZgeZrdC8TXTQbQBoL6bfuAnFUUy1PVCMB4DYPzVaS:{symbol:"USDT",decimals:6,address:"EJwZgeZrdC8TXTQbQBoL6bfuAnFUUy1PVCMB4DYPzVaS"},So11111111111111111111111111111111111111112:{symbol:"SOL",decimals:9,address:"So11111111111111111111111111111111111111112"}},"solana:testnet":{}};function yo(e,t){let n=parseFloat(e.toString())/lo,a=fo.format(t*n);return"$0.00"===a?"<$0.01":a}let fo=new Intl.NumberFormat(void 0,{style:"currency",currency:"USD",maximumFractionDigits:2});function wo(e,t=6,n=!1,a=!1){let i=(parseFloat(e.toString())/1e9).toFixed(t).replace(/0+$/,"").replace(/\.$/,""),r=a?"":" SOL";return n?`${i}${r}`:`${"0"===i?"<0.001":i}${r}`}const vo=({weiQuantities:e,tokenPrice:n,tokenSymbol:a})=>{let i=ro(e),r=n?no(i,n):void 0,o=ao(i,a);/*#__PURE__*/return t(xo,{children:r||o})},bo=({weiQuantities:a,tokenPrice:i,tokenSymbol:r})=>{let o=ro(a),l=i?no(o,i):void 0,s=ao(o,r);/*#__PURE__*/return t(xo,{children:l?/*#__PURE__*/e(n,{children:[/*#__PURE__*/t(ko,{children:"USD"}),"<$0.01"===l?
12
- /*#__PURE__*/e(Ao,{children:[/*#__PURE__*/t(To,{children:"<"}),"$0.01"]}):l]}):s})},Co=({quantities:a,tokenPrice:i,tokenSymbol:r="SOL",tokenDecimals:o=9})=>{let l=a.reduce(((e,t)=>e+t),0n),s=i&&"SOL"===r&&9===o?yo(l,i):void 0,c="SOL"===r&&9===o?wo(l):`${me(l,o)} ${r}`;/*#__PURE__*/return t(xo,{children:s?/*#__PURE__*/t(n,{children:"<$0.01"===s?
13
- /*#__PURE__*/e(Ao,{children:[/*#__PURE__*/t(To,{children:"<"}),"$0.01"]}):s}):c})};let xo=/*#__PURE__*/Ne.span.withConfig({displayName:"StyledPriceDisplay",componentId:"sc-3cd56c8a-0"})(["font-size:14px;line-height:140%;display:flex;gap:4px;align-items:center;"]),ko=/*#__PURE__*/Ne.span.withConfig({displayName:"StyledPriceUnit",componentId:"sc-3cd56c8a-1"})(["font-size:12px;line-height:12px;color:var(--privy-color-foreground-3);"]),To=/*#__PURE__*/Ne.span.withConfig({displayName:"TinyLessThan",componentId:"sc-3cd56c8a-2"})(["font-size:10px;"]),Ao=/*#__PURE__*/Ne.span.withConfig({displayName:"FlexCenter",componentId:"sc-3cd56c8a-3"})(["display:flex;align-items:center;"]);const Io=/*#__PURE__*/Ne.div.withConfig({displayName:"BottomPusherContainer",componentId:"sc-cb963810-0"})(["display:flex;flex-direction:column;align-items:flex-start;justify-content:flex-end;margin-top:auto;gap:16px;flex-grow:100;"]),So=/*#__PURE__*/Ne.div.withConfig({displayName:"CenteredItem",componentId:"sc-cb963810-1"})(["display:flex;flex-direction:column;align-items:center;justify-content:center;flex-grow:1;width:100%;"]),No=/*#__PURE__*/Ne.div.withConfig({displayName:"HorizontallyCenteredItem",componentId:"sc-cb963810-2"})(["display:flex;flex-direction:column;align-items:center;width:100%;"]),Eo=/*#__PURE__*/Ne(So).withConfig({displayName:"CenteredItemWithPadding",componentId:"sc-cb963810-3"})(["padding:20px 0;"]),_o=/*#__PURE__*/Ne(So).withConfig({displayName:"CenteredItemWithGap",componentId:"sc-cb963810-4"})(["gap:16px;"]),Mo=/*#__PURE__*/Ne.div.withConfig({displayName:"FlexContainer",componentId:"sc-cb963810-5"})(["display:flex;flex-direction:column;width:100%;"]),Wo=/*#__PURE__*/Ne.div.withConfig({displayName:"FixedGappedContainer",componentId:"sc-cb963810-6"})(["display:flex;flex-direction:column;gap:8px;"]),Lo=/*#__PURE__*/Ne.div.withConfig({displayName:"StyledCalloutSection",componentId:"sc-cb963810-8"})(["display:flex;flex-direction:column;justify-content:flex-start;align-items:flex-start;text-align:left;gap:8px;padding:16px;margin-top:16px;margin-bottom:16px;width:100%;background:var(--privy-color-background-2);border-radius:var(--privy-border-radius-md);&& h4{color:var(--privy-color-foreground-3);font-size:14px;text-decoration:underline;font-weight:medium;}&& p{color:var(--privy-color-foreground-3);font-size:14px;}"]),Po=/*#__PURE__*/Ne.div.withConfig({displayName:"RefactorSpacerTop",componentId:"sc-cb963810-9"})(["height:16px;"]),Fo=/*#__PURE__*/Ne.div.withConfig({displayName:"RefactorSpacerBottom",componentId:"sc-cb963810-10"})(["height:12px;"]),Do=/*#__PURE__*/Ne.div.withConfig({displayName:"ConfigurableSpacer",componentId:"sc-cb963810-12"})(["height:","px;"],(e=>e.height??"12")),Ro=({gas:n,tokenPrice:a,tokenSymbol:i})=>/*#__PURE__*/e(Mo,{style:{paddingBottom:"12px"},children:[/*#__PURE__*/e(Uo,{children:[/*#__PURE__*/t(zo,{children:"Est. Fees"}),/*#__PURE__*/t("div",{children:/*#__PURE__*/t(bo,{weiQuantities:[BigInt(n)],tokenPrice:a,tokenSymbol:i})})]}),a&&/*#__PURE__*/t(Bo,{children:`${ao(BigInt(n),i)}`})]}),Oo=({value:n,gas:a,tokenPrice:i,tokenSymbol:r})=>{let o=BigInt(n??0)+BigInt(a);/*#__PURE__*/return e(Mo,{children:[/*#__PURE__*/e(Uo,{children:[/*#__PURE__*/t(zo,{children:"Total (including fees)"}),/*#__PURE__*/t("div",{children:/*#__PURE__*/t(bo,{weiQuantities:[BigInt(n||0),BigInt(a)],tokenPrice:i,tokenSymbol:r})})]}),i&&/*#__PURE__*/t(Bo,{children:ao(o,r)})]})};let Uo=/*#__PURE__*/Ne.div.withConfig({displayName:"TransactionTotalRow",componentId:"sc-f8ef9b74-0"})(["display:flex;flex-direction:row;justify-content:space-between;align-items:center;padding-top:4px;"]),Bo=/*#__PURE__*/Ne.div.withConfig({displayName:"ValueConversionRow",componentId:"sc-f8ef9b74-1"})(["display:flex;flex-direction:row;height:12px;font-size:12px;line-height:12px;color:var(--privy-color-foreground-3);font-weight:400;"]),zo=/*#__PURE__*/Ne.div.withConfig({displayName:"TotalText",componentId:"sc-f8ef9b74-2"})(["font-size:14px;line-height:22.4px;font-weight:400;"]);const Vo=/*#__PURE__*/x(void 0),Ho=/*#__PURE__*/x(void 0),jo=({defaultValue:e,children:n})=>{let[a,i]=T(e||null);/*#__PURE__*/return t(Vo.Provider,{value:{activePanel:a,togglePanel:e=>{i(a===e?null:e)}},children:/*#__PURE__*/t(Qo,{children:n})})},$o=({value:e,children:n})=>{let{activePanel:a,togglePanel:i}=C(Vo),r=a===e;/*#__PURE__*/return t(Ho.Provider,{value:{onToggle:()=>i(e),value:e},children:/*#__PURE__*/t(Jo,{isActive:r?"true":"false","data-open":String(r),children:n})})},qo=({children:a})=>{let{activePanel:i}=C(Vo),{onToggle:r,value:o}=C(Ho),l=i===o;/*#__PURE__*/
14
- return e(n,{children:[/*#__PURE__*/e(Yo,{onClick:r,"data-open":String(l),children:[/*#__PURE__*/t(Xo,{children:a}),/*#__PURE__*/t(nl,{isactive:l?"true":"false",children:/*#__PURE__*/t(Vt,{height:"16px",width:"16px",strokeWidth:"2"})})]}),/*#__PURE__*/t(Ko,{})]})},Go=({children:e})=>{let{activePanel:n}=C(Vo),{value:a}=C(Ho);/*#__PURE__*/return t(el,{"data-open":String(n===a),children:/*#__PURE__*/t(tl,{children:e})})},Zo=({children:e})=>{let{activePanel:n}=C(Vo),{value:a}=C(Ho);/*#__PURE__*/return t(tl,{children:"function"==typeof e?e({isActive:n===a}):e})};let Qo=/*#__PURE__*/Ne.div.withConfig({displayName:"AccordionRoot",componentId:"sc-d25f9267-0"})(["display:flex;flex-direction:column;width:100%;gap:8px;"]),Yo=/*#__PURE__*/Ne.div.withConfig({displayName:"AccordionTriggerContainer",componentId:"sc-d25f9267-1"})(["display:flex;justify-content:space-between;align-items:center;width:100%;cursor:pointer;padding-bottom:8px;"]),Ko=/*#__PURE__*/Ne.div.withConfig({displayName:"AccordionDivider",componentId:"sc-d25f9267-2"})(["width:100%;&&{border-top:1px solid;border-color:var(--privy-color-foreground-4);}padding-bottom:12px;"]),Xo=/*#__PURE__*/Ne.div.withConfig({displayName:"AccordionTriggerContent",componentId:"sc-d25f9267-3"})(["font-size:14px;font-weight:500;line-height:19.6px;width:100%;padding-right:8px;"]),Jo=/*#__PURE__*/Ne.div.withConfig({displayName:"AccordionPanelContainer",componentId:"sc-d25f9267-4"})(["display:flex;flex-direction:column;width:100%;overflow:hidden;padding:12px;&&{border:1px solid;border-color:var(--privy-color-foreground-4);border-radius:var(--privy-border-radius-md);}"]),el=/*#__PURE__*/Ne.div.withConfig({displayName:"AccordionContentContainer",componentId:"sc-d25f9267-5"})(["position:relative;overflow:hidden;transition:max-height 25ms ease-out;&[data-open='true']{max-height:700px;}&[data-open='false']{max-height:0;}"]),tl=/*#__PURE__*/Ne.div.withConfig({displayName:"ContentWrapper",componentId:"sc-d25f9267-6"})(["display:flex;flex-direction:column;gap:12px;flex:1 1 auto;min-height:1px;"]),nl=/*#__PURE__*/Ne.div.withConfig({displayName:"IconWrapper",componentId:"sc-d25f9267-7"})(["transform:",";"],(e=>"true"===e.isactive?"rotate(180deg)":"rotate(0deg)"));function al(e,t){return`https://explorer.solana.com/account/${e}?chain=${t}`}const il=e=>/*#__PURE__*/t(rl,{href:"ethereum"===e.chainType?oo(e.chainId,e.walletAddress):al(e.walletAddress,e.chainId),target:"_blank",children:ea(e.walletAddress)});let rl=/*#__PURE__*/Ne.a.withConfig({displayName:"StyledLink",componentId:"sc-dd6c0f9f-0"})(["&:hover{text-decoration:underline;}"]);const ol=({from:n,to:a,txn:i,transactionInfo:r,tokenPrice:o,gas:l,tokenSymbol:s})=>{let c=BigInt(i?.value||0);/*#__PURE__*/
15
- return t(jo,{...Z().render.standalone?{defaultValue:"details"}:{},children:/*#__PURE__*/e($o,{value:"details",children:[/*#__PURE__*/t(qo,{children:/*#__PURE__*/e(ll,{children:[/*#__PURE__*/t("div",{children:r?.title||"Details"}),/*#__PURE__*/t(sl,{children:/*#__PURE__*/t(vo,{weiQuantities:[c],tokenPrice:o,tokenSymbol:s})})]})}),/*#__PURE__*/e(Go,{children:[/*#__PURE__*/t(Yr,{label:"From",children:/*#__PURE__*/t(il,{walletAddress:n,chainId:i.chainId||J,chainType:"ethereum"})}),/*#__PURE__*/t(Yr,{label:"To",children:/*#__PURE__*/t(il,{walletAddress:a,chainId:i.chainId||J,chainType:"ethereum"})}),r&&r.action&&/*#__PURE__*/t(Yr,{label:"Action",children:r.action}),l&&/*#__PURE__*/t(Ro,{value:i.value,gas:l,tokenPrice:o,tokenSymbol:s})]}),/*#__PURE__*/t(Zo,{children:({isActive:e})=>/*#__PURE__*/t(Oo,{value:i.value,displayFee:e,gas:l||"0x0",tokenPrice:o,tokenSymbol:s})})]})})};let ll=/*#__PURE__*/Ne.div.withConfig({displayName:"AccordionTriggerContent",componentId:"sc-2eff9f5c-0"})(["display:flex;flex-direction:row;justify-content:space-between;"]),sl=/*#__PURE__*/Ne.div.withConfig({displayName:"TotalText",componentId:"sc-2eff9f5c-1"})(["flex-shrink:0;padding-left:8px;"]);const cl=({enabled:e=!0}={})=>{let{showFiatPrices:t,getUsdPriceForSol:n}=O(),[a,i]=T(!0),[r,o]=T(void 0),[l,s]=T(void 0);return I((()=>{(async()=>{if(t&&e)try{i(!0);let e=await n();e?s(e):o(Error("Unable to fetch SOL price"))}catch(e){o(e)}finally{i(!1)}else i(!1)})()}),[]),{solPrice:l,isSolPriceLoading:a,solPriceError:r}};function dl(e){let{tokenPrice:t,isTokenPriceLoading:n,tokenPriceError:a}=(e=>{let{showFiatPrices:t,getUsdTokenPrice:n,chains:a}=O(),[i,r]=T(!0),[o,l]=T(void 0),[s,c]=T(void 0);return I((()=>{e||=J;let i=qe(a).find((t=>t.id===Number(e)));(async()=>{if(t){if(!i)return r(!1),void l(Error(`Unable to fetch token price on chain id ${e}`));try{r(!0);let e=await n(i);e?c(e):l(Error(`Unable to fetch token price on chain id ${i.id}`))}catch(e){l(e)}finally{r(!1)}}else r(!1)})()}),[e]),{tokenPrice:s,isTokenPriceLoading:i,tokenPriceError:o}})("solana"===e?-1:e),{solPrice:i,isSolPriceLoading:r,solPriceError:o}=cl({enabled:"solana"===e});return"solana"===e?{tokenPrice:i,isTokenPriceLoading:r,tokenPriceError:o}:{tokenPrice:t,isTokenPriceLoading:n,tokenPriceError:a}}const pl=/*#__PURE__*/x(null);function hl(){let e=C(pl);return null===e?(console.warn("`useWallets` was called outside the PrivyProvider component"),{wallets:[],ready:!1}):e}async function ul(e,t,n,a){let i=Ht(e),r=await(async()=>a?await a():await t.prepareTransactionRequest({...i,account:{address:n,type:"json-rpc"}}))();return{...r,type:jt[r.type]}}let ml=/*#__PURE__*/Ne.div.withConfig({displayName:"StackedContainer",componentId:"sc-f7e7d474-0"})(["display:flex;flex-direction:column;justify-content:center;align-items:center;width:100%;height:82px;> div{position:relative;}> div > span{position:absolute;left:-41px;top:-41px;}> div > :last-child{position:absolute;left:-19px;top:-19px;}"]);const gl=["error","invalid_request_arguments","wallet_not_on_device","invalid_recovery_pin","insufficient_funds","missing_or_invalid_mfa","mfa_verification_max_attempts_reached","mfa_timeout","twilio_verification_failed"];class yl extends Error{constructor(e,t){super(t),this.type=e}}function fl(e){let t=e.type;return"string"==typeof t&&gl.includes(t)}function wl(e){return fl(e)&&"wallet_not_on_device"===e.type}function vl(e){return!!fl(e)&&"mfa_timeout"===e.type}function bl(e){return!!fl(e)&&"missing_or_invalid_mfa"===e.type}function Cl(e){return!!fl(e)&&"mfa_verification_max_attempts_reached"===e.type}function xl(e){return!(!fl(e)||!e.message.includes("code 429"))}function kl(e){return!!function(e){let t=e.type;return"string"==typeof t&&"client_error"===t}(e)&&"MFA canceled"===e.message}const Tl=({title:a,description:i,children:r,...o})=>
16
- /*#__PURE__*/t(Il,{...o,children:/*#__PURE__*/e(n,{children:[/*#__PURE__*/t("h3",{children:a}),"string"==typeof i?/*#__PURE__*/t("p",{children:i}):i,r]})}),Al=({title:n,description:a,icon:i,children:r,...o})=>/*#__PURE__*/e(Sl,{...o,children:[i||null,/*#__PURE__*/t("h3",{children:n}),a&&"string"==typeof a?/*#__PURE__*/t("p",{children:a}):a,r]});let Il=/*#__PURE__*/Ne.div.withConfig({displayName:"StyledSection",componentId:"sc-523a75d6-1"})(["display:flex;flex-direction:column;justify-content:flex-start;align-items:flex-start;text-align:left;gap:8px;width:100%;margin-bottom:24px;&& h3{font-size:17px;color:var(--privy-color-foreground);}&& p{color:var(--privy-color-foreground-2);font-size:14px;}"]),Sl=/*#__PURE__*/Ne(Il).withConfig({displayName:"CenteredStyledSection",componentId:"sc-523a75d6-2"})(["align-items:center;text-align:center;gap:16px;h3{margin-bottom:24px;}"]);const Nl=n=>/*#__PURE__*/e("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 21 20",...n,children:[/*#__PURE__*/t("path",{fill:"url(#icloud-gradient)",d:"M12.34 7.315a4.26 4.26 0 0 0-3.707 2.18 2.336 2.336 0 0 0-1.02-.236 2.336 2.336 0 0 0-2.3 1.963 3.217 3.217 0 0 0 1.244 6.181c.135-.001.27-.01.404-.029h8.943c.047.004.094.006.141.007.045-.001.09-.004.135-.007h.214v-.016a2.99 2.99 0 0 0 1.887-.988c.487-.55.757-1.261.757-1.998v-.006a3.017 3.017 0 0 0-.69-1.915 2.992 2.992 0 0 0-1.748-1.034 4.26 4.26 0 0 0-4.26-4.102Z"}),/*#__PURE__*/t("defs",{children:/*#__PURE__*/e("linearGradient",{id:"icloud-gradient",x1:19.086,x2:3.333,y1:14.38,y2:14.163,gradientUnits:"userSpaceOnUse",children:[/*#__PURE__*/t("stop",{stopColor:"#3E82F4"}),/*#__PURE__*/t("stop",{offset:1,stopColor:"#93DCF7"})]})})]}),El=({style:n,...a})=>/*#__PURE__*/e("svg",{width:"16",height:"14",style:n,viewBox:"0 0 16 14",fill:"none",xmlns:"http://www.w3.org/2000/svg",...a,children:[/*#__PURE__*/e("g",{clipPath:"url(#clip0_2115_829)",children:[/*#__PURE__*/t("path",{d:"M2.34709 12.9404L2.3471 12.9404L2.34565 12.938L1.64031 11.7448L1.64004 11.7444L0.651257 10.0677C0.640723 10.0496 0.630746 10.0314 0.621325 10.0129H4.16461L2.39424 13.0139C2.3775 12.9901 2.36178 12.9656 2.34709 12.9404Z",fill:"#0066DA",stroke:"#6366F1"}),/*#__PURE__*/t("path",{d:"M8 4.48713L5.47995 0.215332C5.23253 0.358922 5.02176 0.556358 4.87514 0.80764L0.219931 8.70508C0.076007 8.95094 0.000191627 9.22937 0 9.51277H5.04009L8 4.48713Z",fill:"#00AC47"}),/*#__PURE__*/t("path",{d:"M13.48 13.7847C13.7274 13.6411 13.9382 13.4437 14.0848 13.1924L14.3781 12.6988L15.7801 10.3206C15.9267 10.0693 16.0001 9.79114 16.0001 9.51294H10.9596L12.0321 11.577L13.48 13.7847Z",fill:"#EA4335"}),/*#__PURE__*/t("path",{d:"M8.00003 4.48718L10.5201 0.215385C10.2726 0.0717949 9.98857 0 9.69533 0H6.30472C6.01148 0 5.7274 0.0807692 5.47998 0.215385L8.00003 4.48718Z",fill:"#00832D"}),/*#__PURE__*/t("path",{d:"M10.9599 9.51294H5.04007L2.52002 13.7847C2.76744 13.9283 3.05152 14.0001 3.34476 14.0001H12.6552C12.9484 14.0001 13.2325 13.9194 13.4799 13.7847L10.9599 9.51294Z",fill:"#2684FC"}),/*#__PURE__*/t("path",{d:"M13.4525 4.75636L11.1249 0.80764C10.9782 0.556358 10.7675 0.358922 10.52 0.215332L8 4.48713L10.9599 9.51277H15.9908C15.9908 9.23456 15.9175 8.95636 15.7709 8.70508L13.4525 4.75636Z",fill:"#FFBA00"})]}),/*#__PURE__*/t("defs",{children:/*#__PURE__*/t("clipPath",{id:"clip0_2115_829",children:/*#__PURE__*/t("rect",{width:"16",height:"14",fill:"white"})})})]});async function _l({url:e,popup:t,provider:n}){return t.location=e,new Promise(((e,n)=>{function a(){t?.close(),window.removeEventListener("message",i)}function i(t){t.data&&("PRIVY_OAUTH_RESPONSE"===t.data.type&&t.data.stateCode&&t.data.authorizationCode&&(e(t.data),a()),"https://cdn.apple-cloudkit.com"===t.origin&&t.data.ckSession&&(e({type:"PRIVY_OAUTH_RESPONSE",ckWebAuthToken:t.data.ckSession}),a()),"PRIVY_OAUTH_ERROR"===t.data.type&&(n(t.data.error),a()))}window.addEventListener("message",i)}))}async function Ml({api:e,provider:t,stateCode:n,codeVerifier:a,authorizationCode:i}){if(!i||!n)throw new _("[OAuth AuthFlow] Authorization and state codes code must be set prior to calling authenicate.");if("undefined"===i)throw new _("User denied confirmation during OAuth flow");try{return(await e.post(U,{authorization_code:i,state_code:n,code_verifier:a,provider:t})).access_token}catch(e){let t=M(e);if(t.privyErrorCode)throw new _(t.message||"Invalid code during OAuth flow.",void 0,t.privyErrorCode);if("User denied confirmation during OAuth flow"===t.message)throw new _("Invalid code during oauth flow.",void 0,P.OAUTH_USER_DENIED);throw new _("Invalid code during OAuth flow.",void 0,P.UNKNOWN_AUTH_ERROR)}}async function Wl({api:e,provider:t}){let n=In(),a=Sn(),i=await Nn(n);try{return"icloud"===t?{url:(await e.post(B,{client_type:"web"})).url}:{url:(await e.post(z,{redirect_to:window.location.href,code_challenge:i,state_code:a})).url,codeVerifier:n,stateCode:a,provider:t}}catch(e){throw M(e)}}const Ll=(e,{chainType:t,walletIndex:n}={})=>e?.linkedAccounts.filter((e=>!("wallet"!==e.type||"privy"!==e.walletClientType||void 0!==n&&e.walletIndex!==n||void 0!==t&&e.chainType!==t)))??[],Pl=async({user:e,accessToken:t,proxy:n,refreshSessionAndUser:a,privy:i,appConfig:r,recoverEmbeddedWallet:o,setUser:l,walletIndex:s,chainType:c,recoveryMethod:d,recoveryPassword:p,recoveryAccessToken:h})=>{if(0===s)if("user-controlled-server-wallets-only"===r.embeddedWallets.mode)await Ge(i,{request:{chain_type:c}});else if("ethereum"===c){let a=Ia(e);a&&await o({address:a.address}),await n.create({accessToken:t,solanaAddress:a?.address,recoveryMethod:d,recoveryPassword:p,recoveryAccessToken:h})}else{if("solana"!==c)throw Error("Invalid input to create wallet");{let a=xa(e);a&&await o({address:a.address}),await n.createSolana({accessToken:t,ethereumAddress:a?.address,recoveryMethod:d,recoveryPassword:p,recoveryAccessToken:h})}}else if("user-controlled-server-wallets-only"===r.embeddedWallets.mode)await Ge(i,{request:{chain_type:c}});else{let{entropyId:a,entropyIdVerifier:i}=Va(e);await o(),await n.addWallet({accessToken:t,entropyId:a,entropyIdVerifier:i,chainType:c,hdWalletIndex:s})}let u=await a(),m=Ll(u,{chainType:c,walletIndex:s})[0];return l(u),{user:u,account:m}},Fl=()=>{let{walletProxy:e,recoverEmbeddedWallet:t,setUser:n,refreshSessionAndUser:a,privy:i,client:r}=O(),o=Z();return{create:async({walletIndex:l,chainType:s,latestUser:c,recoveryMethod:d,recoveryPassword:p,recoveryAccessToken:h})=>{let u=c;u||(u=await a());let m=await r.getAccessToken();if(!u||!m||!e)throw Error("User must be authenticated before creating a Privy wallet");return await Pl({appConfig:o,user:u,refreshSessionAndUser:a,privy:i,accessToken:m,proxy:e,recoverEmbeddedWallet:t,setUser:n,walletIndex:l,chainType:s,recoveryMethod:d,recoveryPassword:p,recoveryAccessToken:h})}}},Dl=({title:e,description:n,onClose:i})=>/*#__PURE__*/t(Qr,{title:e,subtitle:n,icon:a,iconVariant:"success",watermark:!0,onBack:i}),Rl={component:()=>{let{user:e}=_i(),{closePrivyModal:n,isNewUserThisSession:a,updateWallets:i}=O(),{data:r,onUserCloseViaDialogOrKeybindRef:o}=Ni(),l=Z(),{onSuccess:s,onFailure:c,callAuthOnSuccessOnClose:d}=r.createWallet,p=()=>{let t=xa(e)??Ia(e);e&&t?(i(),s({user:e,account:t})):c(Error("Failed to create wallet")),n({shouldCallAuthOnSuccess:d})};return I((()=>{let e=setTimeout(p,te);return()=>clearTimeout(e)}),[]),o.current=p,/*#__PURE__*/t(Dl,{title:a?"Welcome"+(l?.name?` to ${l?.name}`:""):"All set!",description:a?"You've successfully created an account.":"Your account is secured.",onClose:p})}},Ol=/*#__PURE__*/Ne.div.withConfig({displayName:"RecoveryContainer",componentId:"sc-12b46968-0"})(["display:flex;flex-direction:column;gap:12px;padding-top:24px;padding-bottom:24px;"]),Ul=/*#__PURE__*/Ne.div.withConfig({displayName:"RecoveryExplainerContainer",componentId:"sc-12b46968-1"})(["padding-bottom:24px;"]);let Bl={"google-drive":{name:"Google Drive",component:El},icloud:{name:"iCloud",component:Nl}};const zl={component:()=>{let{logout:a}=_i(),{navigate:i,setModalData:r,data:o}=Ni(),{closePrivyModal:l,createAnalyticsEvent:s}=O(),{execute:c}=(()=>{let{client:e,walletProxy:t,refreshSessionAndUser:n}=O(),{data:a}=Ni(),{user:i}=_i(),r=ee(),{create:o}=Fl();return{execute:async({provider:l,action:s,popup:c,shouldCreateEth:d,shouldCreateSol:p})=>{let h,u;if(!e)throw new _("Missing client");function m(t){if(!t&&e)throw e.createAnalyticsEvent({eventName:"recovery_oauth_error",payload:{error:"Unable to open recovery OAuth popup",provider:l}}),new _("Recovery OAuth failed")}switch(l){case"google-drive":{let t,n,{url:a,codeVerifier:i,stateCode:r}=await Wl({api:e.api,provider:l});m(a);try{let i=await _l({url:a,popup:c,provider:l});if(t=i.stateCode,n=i.authorizationCode,t!==r)throw e.createAnalyticsEvent({eventName:"possible_phishing_attempt",payload:{provider:l,storedStateCode:r??"",returnedStateCode:t??""}}),new _("Unexpected auth flow. This may be a phishing attempt.",void 0,P.OAUTH_UNEXPECTED)}catch(t){throw e.createAnalyticsEvent({eventName:"recovery_oauth_error",payload:{error:t.toString(),provider:l}}),new _("Recovery OAuth failed")}[h,u]=await Promise.all([e.getAccessToken(),Ml({api:e.api,provider:l,codeVerifier:i,stateCode:t,authorizationCode:n})]);break}case"icloud":{let{url:t}=await Wl({api:e.api,provider:l});m(t);let{ckWebAuthToken:n}=await _l({url:t,popup:c,provider:l});u=n,h=await e.getAccessToken()}}if(!t)throw new _("Cannot connect to wallet proxy");if(!h)throw new _("Unable to authorize user");switch(s){case"recover":{let n=a?.recoverWallet?.entropyId,i=a?.recoverWallet?.entropyIdVerifier;if(!n||!i)throw new _("Recovery OAuth failed");e.createAnalyticsEvent({eventName:"embedded_wallet_recovery_started",payload:{walletAddress:n,recoveryMethod:l}}),await t.recover({accessToken:h,entropyId:n,entropyIdVerifier:i,recoveryAccessToken:u}),e.createAnalyticsEvent({eventName:"embedded_wallet_recovery_completed",payload:{walletAddress:n,recoveryMethod:l}});break}case"create-wallet":{let t;if(e.createAnalyticsEvent({eventName:"embedded_wallet_creation_started"}),d&&p)t=await o({recoveryMethod:l,recoveryAccessToken:u,chainType:"ethereum",walletIndex:0,latestUser:i}),t=await o({chainType:"solana",walletIndex:0,latestUser:t.user});else if(p)t=await o({recoveryMethod:l,recoveryAccessToken:u,chainType:"solana",walletIndex:0,latestUser:i});else{if(!d)throw Error("Invalid args to create wallet");t=await o({recoveryMethod:l,recoveryAccessToken:u,chainType:"ethereum",walletIndex:0,latestUser:i})}if(!t)throw r("createWallet","onError",P.UNKNOWN_EMBEDDED_WALLET_ERROR),Error("Failed to create wallet");e.createAnalyticsEvent({eventName:"embedded_wallet_creation_completed",payload:{walletAddress:t.account.address}}),r("createWallet","onSuccess",{wallet:t.account});break}case"set-recovery":{let a=Wa(i);if(!a)throw r("setWalletRecovery","onError",P.EMBEDDED_WALLET_NOT_FOUND),Error("Embedded wallet not found");e.createAnalyticsEvent({eventName:"embedded_wallet_set_recovery_started",payload:{walletAddress:a.address,existingRecoveryMethod:a.recoveryMethod,targetRecoveryMethod:l}});let{entropyId:o,entropyIdVerifier:s}=Va(i);await t.setRecovery({accessToken:h,entropyId:o,entropyIdVerifier:s,recoveryMethod:l,recoveryAccessToken:u});let c=Wa(await n());if(!c)throw r("createWallet","onError",P.UNKNOWN_EMBEDDED_WALLET_ERROR),Error("Failed to set recovery on wallet");e.createAnalyticsEvent({eventName:"embedded_wallet_set_recovery_completed",payload:{walletAddress:a.address,existingRecoveryMethod:a.recoveryMethod,targetRecoveryMethod:l}}),r("setWalletRecovery","onSuccess",{method:l,wallet:c});break}default:throw new _("Unsupported recovery action")}}}})(),[d,p]=T(!1),{provider:h,action:u,isInAccountCreateFlow:m,shouldCreateEth:g,shouldCreateSol:y}=o?.recoveryOAuthStatus,[f,w]=T(void 0),[v,b]=T("create-wallet"===u);if("user-passcode"===h)throw Error("RecoveryOAuthScreen should never be called with a wallet that specifies recoveryMethod: `user-passcode`");let C=Bl[h].name,x=Bl[h].component,k=o?.recoverWallet?.onCompleteNavigateTo,A=new Tn((async(e="create-wallet")=>(b(!0),new Promise(((t,n)=>{setTimeout((async()=>{try{let n=window.open();await c({provider:h,action:e,popup:n,shouldCreateEth:g,shouldCreateSol:y}),p(!0),t()}catch(t){w({message:`${"recover"===e?"Recovery":"Back up"} with ${C} unsuccessful`,detail:"recover"===u?`Please verify that you are selecting the ${C} account associated with your backup.`:"",retryable:!0}),n()}}),0)})))));I((()=>{"recover"!==u&&A.execute(m?"create-wallet":"set-recovery")}),[]),I((()=>{if(!d)return;let e=setTimeout((()=>{m?(r({createWallet:{onSuccess:()=>{},onFailure:e=>{s({eventName:"embedded_wallet_creation_failure_logout",payload:{error:e,screen:"RecoveryOAuthScreen"}}),a()},callAuthOnSuccessOnClose:!0,shouldCreateEth:!1,shouldCreateSol:!1}}),i(Rl)):l({shouldCallAuthOnSuccess:!1})}),ne);return()=>clearTimeout(e)}),[d]);let N=S((async()=>{await A.execute("recover"),k?i(k):p(!0)}),[]),E="google-drive"===h?"Google Drive":"Apple iCloud",M=d&&`Successfully ${"recover"===u?"recovered":"backed up"} with ${E}.`||f&&f.message||`${"recover"===u?"Recovering":"Backing up"} with ${E}...`,W=f?f.detail:"";/*#__PURE__*/return e(n,{children:[/*#__PURE__*/t(yr,{}),v?/*#__PURE__*/t(n,{children:/*#__PURE__*/e(Ol,{children:[/*#__PURE__*/t(Al,{title:M,icon:/*#__PURE__*/t(x,{style:{width:"38px",height:"38px"}}),description:W}),f&&f?.retryable?/*#__PURE__*/t(ar,{onClick:()=>{Hn(),w(void 0),"create-wallet"===u?A.execute("create-wallet"):N()},disabled:!d&&!f?.retryable,children:"Try again"}):null]})}):/*#__PURE__*/e(Ol,{children:[/*#__PURE__*/t(Al,{title:"Confirm it's really you",icon:/*#__PURE__*/t(x,{style:{height:42,width:48}}),description:`To confirm your identity, please log in to ${E} where your account is backed up.`}),/*#__PURE__*/e(ar,{onClick:N,children:["Confirm with ",E]})]}),/*#__PURE__*/t($i,{})]})}};let Vl=/*#__PURE__*/Ne.div.withConfig({displayName:"IconContainer",componentId:"sc-ccfae04f-0"})(["width:24px;height:24px;display:flex;justify-content:center;align-items:center;"]),Hl={"google-drive":"Google Drive",icloud:"iCloud","user-passcode":"password",privy:"Privy","privy-v2":"Privy"},jl=({onClose:a})=>/*#__PURE__*/e(Ul,{children:[/*#__PURE__*/t(Al,{title:"Why do I need to secure my account?",icon:/*#__PURE__*/t(We,{width:48}),description:/*#__PURE__*/e(n,{children:[/*#__PURE__*/t("p",{children:"Your app uses cryptography to secure your account. App secrets are split and encrypted so only you can access them."}),/*#__PURE__*/t("p",{children:"To use this app on new devices, secure account secrets using a password, your Google or your Apple account. It’s important you don’t lose access to the method you choose."})]})}),/*#__PURE__*/t(ar,{onClick:a,children:"Select backup method"})]});const $l={component:()=>{let[a,i]=T(!1),{navigate:r,lastScreen:o,navigateBack:l,setModalData:s,data:c,onUserCloseViaDialogOrKeybindRef:d}=Ni(),{user:p}=_i(),{embeddedWallets:h}=Z(),{closePrivyModal:u}=O(),m=Wa(p),g=null===m,{isInAccountCreateFlow:y,isResettingPassword:f,shouldCreateEth:w,shouldCreateSol:v}=c.recoverySelection,b=m&&"privy"!==m.recoveryMethod,C=b?/*#__PURE__*/e("span",{children:["Your account is currently secured using"," ",/*#__PURE__*/t("strong",{children:Hl[m?.recoveryMethod||"user-passcode"]}),"."]}):"Select a method for logging in on new devices and recovering your account.";function x(e){s({recoveryOAuthStatus:{provider:e,action:g?"create-wallet":"set-recovery",isInAccountCreateFlow:y,shouldCreateEth:w,shouldCreateSol:v}}),r(zl)}function k(){c?.setWalletPassword?.onFailure(Error("User exited set recovery flow")),u({shouldCallAuthOnSuccess:c?.setWalletPassword?.callAuthOnSuccessOnClose??!1})}return d.current=k,/*#__PURE__*/e(n,{children:[/*#__PURE__*/t(yr,{onClose:k,backFn:a?()=>i(!1):o?l:void 0,infoFn:o||a?void 0:()=>i(!0)},"header"),a?/*#__PURE__*/t(jl,{onClose:()=>i(!1)}):/*#__PURE__*/e(n,{children:[/*#__PURE__*/t(Al,{title:b?"Update backup method":"Secure your account",icon:/*#__PURE__*/t(tn,{width:48}),description:C}),/*#__PURE__*/t(Ol,{children:h.userOwnedRecoveryOptions.filter((e=>!["icloud","google-drive"].includes(m?.recoveryMethod||"")||e!==m?.recoveryMethod)).sort().map((n=>{switch(n){case"google-drive":/*#__PURE__*/return e(Ri,{onClick:()=>x("google-drive"),children:[/*#__PURE__*/t(Vl,{children:/*#__PURE__*/t(El,{style:{width:18}})}),"Back up to Google Drive"]},n);case"icloud":/*#__PURE__*/return e(Ri,{onClick:()=>x("icloud"),children:[/*#__PURE__*/t(Vl,{children:/*#__PURE__*/t(Nl,{style:{width:24}})}),"Back up to Apple iCloud"]},n);case"user-passcode":/*#__PURE__*/return e(Ri,{onClick:()=>{r(my({isCreatingWallet:g,skipSplashScreen:!0}))},children:[/*#__PURE__*/t(Vl,{children:/*#__PURE__*/t(nn,{style:{width:18}})}),f?"Reset your":"Set a"," password"]},n);default:return null}}))})]}),/*#__PURE__*/t($i,{})]})}};let ql=/*#__PURE__*/Ee(["font-size:14px;font-style:normal;font-weight:400;line-height:20px;letter-spacing:-0.008px;text-align:left;transition:color 0.1s ease-in;"]);const Gl=/*#__PURE__*/Ne.span.withConfig({displayName:"StatusText",componentId:"sc-acac4b9-0"})([""," transition:color 0.1s ease-in;color:",";text-transform:",";&[aria-hidden='true']{visibility:hidden;}"],ql,(({error:e})=>e?"var(--privy-color-error)":"var(--privy-color-foreground-3)"),(({error:e})=>e?"":"capitalize")),Zl=/*#__PURE__*/Ne.div.withConfig({displayName:"EmbeddedWalletScreenContainer",componentId:"sc-acac4b9-1"})(["display:flex;flex-direction:column;justify-content:center;flex-grow:1;"]),Ql=/*#__PURE__*/Ne(ar).withConfig({displayName:"NoAnimationPrimaryButton",componentId:"sc-acac4b9-2"})(["",""],(({$hideAnimations:e})=>e&&/*#__PURE__*/Ee(["&&{transition:none;}"])));let Yl=/*#__PURE__*/Ee(["&&{width:100%;border-width:1px;border-radius:var(--privy-border-radius-md);border-color:var(--privy-color-foreground-3);background:var(--privy-color-background);color:var(--privy-color-foreground);padding:12px;font-size:16px;font-style:normal;font-weight:300;line-height:22px;}"]);const Kl=/*#__PURE__*/Ne.input.withConfig({displayName:"PasswordInput",componentId:"sc-acac4b9-3"})([""," &::placeholder{color:var(--privy-color-foreground-3);font-style:italic;font-size:14px;}overflow:hidden;text-overflow:ellipsis;white-space:nowrap;"],Yl),Xl=/*#__PURE__*/Ne.div.withConfig({displayName:"PasswordDisplay",componentId:"sc-acac4b9-4"})(["",""],Yl),Jl=/*#__PURE__*/Ne.div.withConfig({displayName:"PasswordContainer",componentId:"sc-acac4b9-5"})(["position:relative;width:100%;display:flex;align-items:center;justify-content:",";"],(({centered:e})=>e?"center":"space-between")),es=/*#__PURE__*/Ne.div.withConfig({displayName:"Header",componentId:"sc-acac4b9-6"})(["display:flex;flex-direction:column;align-items:center;justify-content:center;margin:32px 0;gap:4px;& h3{font-size:18px;font-style:normal;font-weight:600;line-height:24px;}& p{max-width:300px;font-size:14px;font-style:normal;font-weight:400;line-height:20px;}"]),ts=/*#__PURE__*/Ne.div.withConfig({displayName:"Details",componentId:"sc-acac4b9-7"})(["display:flex;flex-direction:column;gap:10px;padding-bottom:1rem;"]),ns=/*#__PURE__*/Ne.div.withConfig({displayName:"DetailItem",componentId:"sc-acac4b9-8"})(["display:flex;text-align:left;align-items:center;gap:8px;max-width:300px;font-size:14px;font-style:normal;font-weight:400;line-height:20px;letter-spacing:-0.008px;margin:0 8px;color:var(--privy-color-foreground-2);> :first-child{min-width:24px;}"]),as=/*#__PURE__*/Ne(tr).withConfig({displayName:"ExportButton",componentId:"sc-acac4b9-10"})(["display:flex;flex:1;gap:4px;justify-content:center;&&{background:var(--privy-color-background);border-radius:var(--privy-border-radius-md);border-color:var(--privy-color-foreground-3);border-width:1px;}"]),is=/*#__PURE__*/Ne.div.withConfig({displayName:"InputRightIcons",componentId:"sc-acac4b9-11"})(["position:absolute;right:0.5rem;display:flex;flex-direction:row;justify-content:space-around;align-items:center;"]),rs=/*#__PURE__*/Ne(rn).withConfig({displayName:"RegenerateIcon",componentId:"sc-acac4b9-12"})(["height:1.25rem;width:1.25rem;stroke:var(--privy-color-accent);cursor:pointer;:active{stroke:var(--privy-color-accent-light);}"]),os=/*#__PURE__*/Ne(ln).withConfig({displayName:"HiddenIcon",componentId:"sc-acac4b9-13"})(["height:1.25rem;width:1.25rem;stroke:var(--privy-color-accent);cursor:pointer;:active{stroke:var(--privy-color-accent-light);}"]),ls=/*#__PURE__*/Ne(on).withConfig({displayName:"ShownIcon",componentId:"sc-acac4b9-14"})(["height:1.25rem;width:1.25rem;stroke:var(--privy-color-accent);cursor:pointer;:active{stroke:var(--privy-color-accent-light);}"]),ss=/*#__PURE__*/Ne.progress.withConfig({displayName:"StrengthMeter",componentId:"sc-acac4b9-15"})(["height:4px;width:100%;margin:8px 0;::-webkit-progress-bar{border-radius:8px;background:var(--privy-color-foreground-4);}::-webkit-progress-value{border-radius:8px;transition:all 0.1s ease-out;background:",";}"],(({label:e})=>("Strong"===e?"#78dca6":"Medium"===e&&"var(--privy-color-warn)")||"var(--privy-color-error)")),cs=({buttonHideAnimations:a,buttonLoading:i,password:r,onSubmit:o,onBack:l})=>{let[s,c]=T(!0),[d,p]=T(!1),[h,u]=T(""),m=r===h;return I((()=>{h&&!d&&p(!0)}),[h]),/*#__PURE__*/e(n,{children:[/*#__PURE__*/t(yr,{closeable:!1,backFn:l}),/*#__PURE__*/t(Po,{}),/*#__PURE__*/e(Zl,{children:[/*#__PURE__*/e(es,{children:[/*#__PURE__*/t(Be,{height:48,width:48,stroke:"var(--privy-color-background)",fill:"var(--privy-color-accent)"}),/*#__PURE__*/t("h3",{style:{color:"var(--privy-color-foreground)"},children:"Confirm your password"}),/*#__PURE__*/t("p",{style:{color:"var(--privy-color-foreground-2)"},children:"Please re-enter your password below to continue."})]}),/*#__PURE__*/e(Jl,{children:[/*#__PURE__*/t(Kl,{value:h,onChange:e=>u(e.target.value),onKeyUp:e=>{"Enter"===e.key&&o()},onBlur:()=>p(!0),placeholder:"confirm your password",type:s?"password":"text",style:{paddingRight:"2.3rem"}}),/*#__PURE__*/t(is,{style:{right:"0.75rem"},children:s?/*#__PURE__*/t(os,{onClick:()=>c(!1)}):/*#__PURE__*/t(ls,{onClick:()=>c(!0)})})]}),
17
- /*#__PURE__*/t(Gl,{"aria-hidden":!d||m,error:!0,children:"Passwords do not match"})]}),/*#__PURE__*/t(Ql,{onClick:o,loading:i,disabled:!m,$hideAnimations:a,children:"Continue"}),/*#__PURE__*/t(Fo,{}),/*#__PURE__*/t($i,{})]})},ds=({className:n,checked:a,color:i="var(--privy-color-accent)",...r})=>/*#__PURE__*/t("label",{children:/*#__PURE__*/e(ps,{className:n,children:[/*#__PURE__*/t(us,{checked:a,...r}),/*#__PURE__*/t(ms,{color:i,checked:a,children:/*#__PURE__*/t(hs,{viewBox:"0 0 24 24",children:/*#__PURE__*/t("polyline",{points:"20 6 9 17 4 12"})})})]})});let ps=/*#__PURE__*/Ne.div.withConfig({displayName:"CheckboxContainer",componentId:"sc-db51b935-1"})(["display:inline-block;vertical-align:middle;"]),hs=/*#__PURE__*/Ne.svg.withConfig({displayName:"Icon",componentId:"sc-db51b935-2"})(["fill:none;stroke:white;stroke-width:3px;"]),us=/*#__PURE__*/Ne.input.attrs({type:"checkbox"}).withConfig({displayName:"HiddenCheckbox",componentId:"sc-db51b935-3"})(["border:0;clip:rect(0 0 0 0);clippath:inset(50%);height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute;white-space:nowrap;width:1px;"]),ms=/*#__PURE__*/Ne.div.withConfig({displayName:"StyledCheckbox",componentId:"sc-db51b935-4"})(["display:inline-block;width:18px;height:18px;transition:all 150ms;cursor:pointer;border-color:",";border-radius:3px;background:",";&&{border-width:1px;}",":focus + &{box-shadow:0 0 0 1px ",";}","{visibility:",";}"],(e=>e.color),(e=>e.checked?e.color:"var(--privy-color-background)"),us,(e=>e.color),hs,(e=>e.checked?"visible":"hidden"));const gs=({buttonHideAnimations:a,buttonLoading:i,onSubmit:r,onBack:o,config:l})=>{let[s,c]=T(!1);/*#__PURE__*/return e(n,{children:[/*#__PURE__*/t(yr,{closeable:!1,backFn:o}),/*#__PURE__*/t(Po,{}),/*#__PURE__*/e(Zl,{children:[/*#__PURE__*/e(es,{children:[/*#__PURE__*/t(Be,{height:48,width:48,stroke:"var(--privy-color-background)",fill:"var(--privy-color-error)"}),/*#__PURE__*/t("h3",{style:{color:"var(--privy-color-foreground)"},children:"Confirm you have saved"}),/*#__PURE__*/t("p",{style:{color:"var(--privy-color-foreground-2)"},children:"Losing access to your password means you will lose access to your account."})]}),/*#__PURE__*/t(ts,{children:/*#__PURE__*/e(ns,{style:{color:"var(--privy-color-error)",cursor:"pointer"},onClick:e=>{e.preventDefault(),c((e=>!e))},children:[/*#__PURE__*/t(ds,{color:"var(--privy-color-error)",readOnly:!0,checked:s}),/*#__PURE__*/t(n,{children:"I understand that if I lose my password and device, I will lose access to my account and my assets."})]})})]}),/*#__PURE__*/e(ys,{children:["user"===l.initiatedBy&&/*#__PURE__*/t(lr,{onClick:l.onCancel,disabled:i,children:"Cancel"}),/*#__PURE__*/t(Ql,{onClick:r,loading:i,$hideAnimations:a,disabled:!s,children:"Set Password"})]}),/*#__PURE__*/t(Fo,{}),/*#__PURE__*/t($i,{})]})};let ys=/*#__PURE__*/Ne.div.withConfig({displayName:"ButtonsContainer",componentId:"sc-d1659c5f-0"})(["display:flex;gap:10px;"]),fs=/[a-z]/,ws=/[A-Z]/,vs=/[0-9]/,bs="!@#$%^&*()\\-_+.",Cs=`a-zA-Z0-9${bs}`,xs=RegExp(`[${bs}]`),ks=RegExp(`[${Cs}]`);const Ts=RegExp(`^[${Cs}]{6,}$`),As=()=>Ae.generatePassphrase(4,Ie);function Is(e){return e>.9?"Strong":e>.5?"Medium":"Weak"}function Ss(e=""){return(.3*function(e){if(e.length<8)return 0;let t=0;return fs.test(e)&&(t+=1),ws.test(e)&&(t+=1),vs.test(e)&&(t+=1),xs.test(e)&&(t+=1),Math.max(0,Math.min(1,t/3))}(e)+Te(e)/95)/2}const Ns=({buttonHideAnimations:a,buttonLoading:i,password:r="",config:o,isResettingPassword:l,onSubmit:s,onClose:c,onBack:d,onPasswordChange:p,onPasswordGenerate:h})=>{let[u,m]=T(!1),[g,y]=T(!1);I((()=>{r&&!g&&y(!0)}),[r]);let f=A((()=>g?6>(r?.length||0)?"Password must be at least 6 characters":Ts.test(r||"")?null:`Invalid characters used ( ${((e="")=>[...new Set(e.split("").filter((e=>!ks.test(e))).map((e=>e.replace(" ","SPACE"))))])(r).join(" ")} )`:null),[r,g]),w=A((()=>f?{value:0,label:"Weak"}:function(e=""){let t=Ss(e);return{value:t,label:Is(t)}}(r)),[r,f]),v=A((()=>!r?.length||!!f),[f,r]);/*#__PURE__*/return e(n,{children:[/*#__PURE__*/t(yr,{onClose:c,closeable:"user"===o.initiatedBy,backFn:d}),/*#__PURE__*/t(Po,{}),/*#__PURE__*/e(Zl,{children:[/*#__PURE__*/e(es,{children:[/*#__PURE__*/t(sn,{height:48,width:48,stroke:"var(--privy-color-accent)"}),/*#__PURE__*/e("h3",{style:{color:"var(--privy-color-foreground)"},children:[l?"Reset":"Set"," your password"]}),/*#__PURE__*/t("p",{style:{color:"var(--privy-color-foreground-2)"},children:"Select a strong, memorable password to secure your account."})]}),/*#__PURE__*/e(Jl,{children:[/*#__PURE__*/t(Kl,{value:r,onChange:e=>p(e.target.value),onKeyUp:e=>{"Enter"===e.key&&s()},placeholder:"enter or generate a strong password",type:u?"password":"text",style:{paddingRight:"3.8rem"}}),/*#__PURE__*/e(is,{style:{width:"3.5rem"},children:[u?/*#__PURE__*/t(os,{onClick:()=>m(!1)}):/*#__PURE__*/t(ls,{onClick:()=>m(!0)}),/*#__PURE__*/t(rs,{onClick:h})]})]}),/*#__PURE__*/t(ss,{value:0===w.value?.01:w.value,label:w.label}),/*#__PURE__*/t(Gl,{error:!!f,children:f||`Password Strength: ${g?w.label:"--"}`}),/*#__PURE__*/e(_s,{children:[/*#__PURE__*/t(Es,{children:/*#__PURE__*/e(ts,{children:[/*#__PURE__*/e(ns,{children:[/*#__PURE__*/t(Xt,{width:24,height:24,fill:"var(--privy-color-accent)"}),"This password is used to secure your account."]}),/*#__PURE__*/e(ns,{children:[/*#__PURE__*/t(Xt,{width:24,height:24,fill:"var(--privy-color-accent)"}),"Use it to log in on a new environment, like another browser or device."]})]})}),/*#__PURE__*/t(Ql,{onClick:s,loading:i,disabled:v,$hideAnimations:a,children:"Continue"})]})]}),/*#__PURE__*/t(Fo,{}),/*#__PURE__*/t($i,{})]})};let Es=/*#__PURE__*/Ne(ts).withConfig({displayName:"DetailsContainer",componentId:"sc-2da5fe90-0"})(["flex:1;padding-top:1rem;"]),_s=/*#__PURE__*/Ne.div.withConfig({displayName:"LowerContainer",componentId:"sc-2da5fe90-1"})(["display:flex;flex-direction:column;height:100%;"]);const Ms=({buttonHideAnimations:a,buttonLoading:i,appName:r,password:o,onSubmit:l,onBack:s})=>{let[c,d]=T(!1),[p,h]=T(!0),u=S((()=>{d(!0),o&&navigator.clipboard.writeText(o)}),[o]),m=S((()=>{let e=document.createElement("a"),t=r.toLowerCase().replace(/[^a-z\s]/g,"").replace(/\s/g,"-"),n=new Blob([Ws(r,o)],{type:"text/plain"}),a=URL.createObjectURL(n);e.href=a,e.target="_blank",e.download=`${t}-privy-wallet-recovery.txt`,document.body.appendChild(e),e.click(),setTimeout((()=>{e.remove(),URL.revokeObjectURL(a)}),5e3)}),[o]);/*#__PURE__*/return e(n,{children:[/*#__PURE__*/t(yr,{backFn:s,closeable:!1}),/*#__PURE__*/t(Po,{}),/*#__PURE__*/e(Zl,{children:[/*#__PURE__*/e(es,{children:[/*#__PURE__*/t(Be,{height:48,width:48,stroke:"var(--privy-color-background)",fill:"var(--privy-color-accent)"}),/*#__PURE__*/t("h3",{style:{color:"var(--privy-color-foreground)"},children:"Save your password"}),/*#__PURE__*/t("p",{style:{color:"var(--privy-color-foreground-2)"},children:"For your security, this password cannot be reset, so keep it somewhere safe."})]}),/*#__PURE__*/e(Jl,{centered:!0,children:[/*#__PURE__*/t(Xl,{children:p?"•".repeat(o.length):o}),/*#__PURE__*/t(is,{style:{right:"0.75rem"},children:p?/*#__PURE__*/t(os,{onClick:()=>h(!1)}):/*#__PURE__*/t(ls,{onClick:()=>h(!0)})})]}),/*#__PURE__*/e("div",{style:{display:"flex",margin:"12px 0",gap:"12px"},children:[/*#__PURE__*/t(as,{onClick:u,children:/*#__PURE__*/e(n,c?{children:[/*#__PURE__*/t(Bt,{style:{width:24,height:24},stroke:"var(--privy-color-accent)"}),"Copied"]}:{children:[/*#__PURE__*/t(dn,{style:{width:24,height:24},stroke:"var(--privy-color-accent)"}),"Copy"]})}),/*#__PURE__*/e(as,{onClick:m,children:[/*#__PURE__*/t(cn,{style:{width:24,height:24},stroke:"var(--privy-color-accent)"}),"Download"]})]})]}),/*#__PURE__*/t(Ql,{onClick:l,loading:i,$hideAnimations:a,children:"Continue"}),/*#__PURE__*/t(Fo,{}),/*#__PURE__*/t($i,{})]})};let Ws=(e,t)=>`Your wallet recovery password for ${e} is\n\n${t}\n\nYou will need this password to access your ${e} wallet on a new device. Please keep it somewhere safe.`;const Ls=({error:a,onClose:i})=>/*#__PURE__*/e(n,{children:[/*#__PURE__*/t(yr,{closeable:!1}),/*#__PURE__*/t(Po,{}),/*#__PURE__*/e(_o,a?{children:[/*#__PURE__*/t(pn,{fill:"var(--privy-color-error)",width:"64px",height:"64px"}),/*#__PURE__*/t(Al,{title:"Something went wrong",description:a})]}:{children:[/*#__PURE__*/t(Xt,{fill:"var(--privy-color-success)",width:"64px",height:"64px"}),/*#__PURE__*/t(Al,{title:"Success"})]}),/*#__PURE__*/t(ar,{onClick:i,children:"Close"}),/*#__PURE__*/t(Fo,{}),/*#__PURE__*/t($i,{})]});let Ps=(e,t)=>{switch(e){case"creating":return"back"===t?e:"saving";case"saving":return"back"===t?"creating":"confirming";case"confirming":return"back"===t?"saving":"finalizing";case"finalizing":return"back"===t?"confirming":"done";default:return e}};const Fs=({onSubmit:e,...n})=>{let{lastScreen:a,navigate:i}=Ni(),{send:r,state:o}=(()=>{let[e,t]=N(Ps,"creating");return{send:t,state:e}})(),l=S((async()=>{"finalizing"===o&&await e(),r("next")}),[o,r,e]);I((()=>{let e;return"done"===o&&"automatic"===n.config.initiatedBy&&(e=setTimeout((()=>n.onClose?.()),ne)),()=>{e&&clearTimeout(e)}}),[o,n.config.initiatedBy,n.onClose]);let s=S((()=>{r("back")}),[r]),c=S((()=>{i($l)}),[a,i]);return"creating"===o?/*#__PURE__*/t(Ns,{...n,onSubmit:l,onBack:a===$l?c:void 0}):"saving"===o?/*#__PURE__*/t(Ms,{...n,onSubmit:l,onBack:s}):"confirming"===o?/*#__PURE__*/t(cs,{...n,onSubmit:l,onBack:s}):"finalizing"===o?/*#__PURE__*/t(gs,{...n,onSubmit:l,onBack:s}):"done"===o?/*#__PURE__*/t(Ls,{...n,onSubmit:l}):null};let Ds={apple_oauth:"apple",custom_auth:"custom",discord_oauth:"discord",email:"email",farcaster:"farcaster",github_oauth:"github",google_oauth:"google",instagram_oauth:"instagram",linkedin_oauth:"linkedin",passkey:"passkey",phone:"sms",spotify_oauth:"spotify",telegram:"telegram",tiktok_oauth:"tiktok",line_oauth:"line",twitch_oauth:"twitch",twitter_oauth:"twitter",wallet:"siwe",smart_wallet:"siwe",cross_app:"privy:"};const Rs=e=>{if(Mn(e))return{displayName:e.replace("custom:",""),loginMethod:"custom"};let t=Ds[e];return"wallet"===e||"phone"===e?{displayName:e,loginMethod:t}:{displayName:t,loginMethod:t}};let Os=/*#__PURE__*/x({});const Us=({children:e})=>{let n=Z(),[a,i]=T({});return ae("login",{onComplete:({loginAccount:e})=>{e&&"passkey"!==e.type&&"cross_app"!==e.type&&("wallet"!==e.type||"privy"!==e.walletClientType)&&(yn.put(Bs(n.id),e.type),"wallet"===e.type?(yn.put(zs(n.id),e.walletClientType),yn.put(Vs(n.id),e.chainType),i({accountType:e.type,walletClientType:e.walletClientType,chainType:e.chainType})):(yn.del(zs(n.id)),yn.del(Vs(n.id)),i({accountType:e.type})))}}),I((()=>{if(!n.id)return;let e=yn.get(Bs(n.id)),t=yn.get(zs(n.id)),a=yn.get(Vs(n.id));e&&i("wallet"===e?{accountType:e,walletClientType:t,chainType:a}:{accountType:e})}),[n.id]),/*#__PURE__*/t(Os.Provider,{value:a,children:e})};let Bs=e=>`privy:${e}:recent-login-method`,zs=e=>`privy:${e}:recent-login-wallet-client`,Vs=e=>`privy:${e}:recent-login-chain-type`;const Hs=()=>C(Os),js=()=>{let e=Z(),n=e?.appearance?.logo,a=`${e?.name} logo`,i={maxHeight:"90px",maxWidth:"180px"};return n?"string"==typeof n?/*#__PURE__*/t("img",{src:n,alt:a,style:i}):"svg"===n.type||"img"===n.type?/*#__PURE__*/b.cloneElement(n,{alt:a,style:i}):(console.warn("`config.appearance.logo` must be a string, or an SVG / IMG element. Nothing will be rendered."),null):null},$s=e=>{let n=Z();return n?.appearance.logo?/*#__PURE__*/t(qs,{...e,children:/*#__PURE__*/t(js,{})}):null},qs=/*#__PURE__*/Ne.div.withConfig({displayName:"AppLogoContainer",componentId:"sc-b210074-0"})(["display:flex;flex-direction:column;align-items:center;padding:24px 0;flex-grow:1;justify-content:center;"]),Gs=({name:e,logoUrl:n,size:a="38px"})=>"string"==typeof n?/*#__PURE__*/t("img",{src:n,alt:`${e??"Provider app"} logo`,style:{width:a,height:a,maxHeight:"90px",maxWidth:"180px",borderRadius:"8px"}}):
18
- /*#__PURE__*/t("span",{}),Zs=({appId:a})=>{let[i,r]=T(void 0),{startCrossAppAuthFlow:o,authenticated:l}=_i(),{client:s}=O();return I((()=>{(async()=>{s&&r(await s.getCrossAppProviderDetails(a))})()}),[s]),/*#__PURE__*/t(Ri,{onClick:()=>o({appId:a,action:l?"link":"login"}),disabled:!i,children:i?/*#__PURE__*/e(n,{children:[/*#__PURE__*/t(Gs,{name:i.name,logoUrl:i.icon_url||void 0,size:"24px"})," ",i.name]}):/*#__PURE__*/t(Ji,{})})};let Qs=/*#__PURE__*/Ne.a.withConfig({displayName:"StyledLink",componentId:"sc-c8577138-0"})(["&&{color:",";font-weight:400;text-decoration:",";text-underline-offset:4px;text-decoration-thickness:1px;cursor:",";opacity:",";font-size:",";line-height:",";transition:color 200ms ease,text-decoration-color 200ms ease,opacity 200ms ease;&:hover{color:",";text-decoration:",";text-underline-offset:4px;}&:active{color:",";}&:focus{outline:none;box-shadow:0 0 0 3px #949df9;border-radius:2px;}}"],(({$variant:e})=>"underlined"===e?"var(--privy-color-foreground)":"var(--privy-link-navigation-color, var(--privy-color-accent))"),(({$variant:e})=>"underlined"===e?"underline":"var(--privy-link-navigation-decoration, none)"),(({$disabled:e})=>e?"not-allowed":"pointer"),(({$disabled:e})=>e?.5:1),(({$size:e})=>{switch(e){case"xs":return"12px";case"sm":return"14px";default:return"16px"}}),(({$size:e})=>{switch(e){case"xs":return"18px";case"sm":return"22px";default:return"24px"}}),(({$variant:e,$disabled:t})=>"underlined"===e?"var(--privy-color-foreground)":"var(--privy-link-navigation-color, var(--privy-color-accent))"),(({$disabled:e})=>e?"none":"underline"),(({$variant:e,$disabled:t})=>t?"underlined"===e?"var(--privy-color-foreground)":"var(--privy-link-navigation-color, var(--privy-color-accent))":"var(--privy-color-foreground)"));const Ys=({size:e="md",variant:n="navigation",disabled:a=!1,as:i,children:r,onClick:o,...l})=>/*#__PURE__*/t(Qs,{as:i,$size:e,$variant:n,$disabled:a,onClick:e=>{a?e.preventDefault():o?.(e)},...l,children:r}),Ks=(e,t)=>!xa(e)&&("all-users"===t||"users-without-wallets"===t&&!Xs(e).length);let Xs=e=>e.linkedAccounts.filter((e=>"wallet"===e.type&&"ethereum"===e.chainType));const Js=(e,t)=>!Ia(e)&&("all-users"===t||"users-without-wallets"===t&&!ec(e).length);let ec=e=>e.linkedAccounts.filter((e=>"wallet"===e.type&&"solana"===e.chainType));const tc=(e,t)=>Ks(e,t.ethereum.createOnLogin)||Js(e,t.solana.createOnLogin),nc=({title:e="Account not found",subtitle:n,appName:a="this app",ctaText:r="Try logging in again",onRetry:o})=>/*#__PURE__*/t(Qr,{title:e,subtitle:n||`Please try logging in again or go to ${a} to create an account.`,icon:i,iconVariant:"warning",primaryCta:{label:r,onClick:o},watermark:!0}),ac={component:()=>{let{navigate:e,setModalData:n,data:a}=Ni(),i=Z(),{getAuthMeta:r,client:o}=O();/*#__PURE__*/return t(nc,{appName:i?.name,onRetry:()=>{let t=r();n({...a,login:{...a?.login,...t?.disableSignup?{disableSignup:!0}:{}}}),o?.authFlow&&(o.authFlow=void 0),e(ay)}})}},ic=/*#__PURE__*/Ne.span.withConfig({displayName:"CircleBorder",componentId:"sc-9056b8b8-0"})(["&&{width:82px;height:82px;border-width:4px;border-style:solid;border-color:",";border-bottom-color:transparent;border-radius:50%;display:inline-block;box-sizing:border-box;animation:rotation 1.2s linear infinite;transition:border-color 800ms;border-bottom-color:",";}"],(e=>e.color??"var(--privy-color-accent)"),(e=>e.color??"var(--privy-color-accent)")),rc=({address:a,showCopyIcon:i,url:l,className:s})=>{let[c,d]=T(!1);function p(e){e.stopPropagation(),navigator.clipboard.writeText(a).then((()=>d(!0))).catch(console.error)}return I((()=>{if(c){let e=setTimeout((()=>d(!1)),3e3);return()=>clearTimeout(e)}}),[c]),/*#__PURE__*/e(oc,l?{children:[/*#__PURE__*/t(sc,{title:a,className:s,href:`${l}/address/${a}`,target:"_blank",children:ea(a)}),i&&/*#__PURE__*/t(lr,{onClick:p,size:"sm",style:{gap:"0.375rem"},children:/*#__PURE__*/e(n,c?{children:["Copied",/*#__PURE__*/t(r,{size:16})]}:{children:["Copy",/*#__PURE__*/t(o,{size:16})]})})]}:{children:[/*#__PURE__*/t(lc,{title:a,className:s,children:ea(a)}),i&&/*#__PURE__*/t(lr,{onClick:p,size:"sm",style:{gap:"0.375rem",fontSize:"14px"},children:/*#__PURE__*/e(n,c?{children:["Copied",/*#__PURE__*/t(r,{size:14})]}:{children:["Copy",/*#__PURE__*/t(o,{size:14})]})})]})};let oc=/*#__PURE__*/Ne.span.withConfig({displayName:"AddressContainer",componentId:"sc-3a987cc8-0"})(["display:inline-flex;align-items:center;gap:0.5rem;"]),lc=/*#__PURE__*/Ne.span.withConfig({displayName:"AddressText",componentId:"sc-3a987cc8-1"})(["font-size:14px;font-weight:500;color:var(--privy-color-foreground);"]),sc=/*#__PURE__*/Ne.a.withConfig({displayName:"AddressLink",componentId:"sc-3a987cc8-2"})(["font-size:14px;color:var(--privy-color-foreground);text-decoration:none;&:hover{text-decoration:underline;}"]);function cc(n){/*#__PURE__*/return e("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",...n,children:[/*#__PURE__*/t("circle",{cx:"12",cy:"12",r:"10"}),/*#__PURE__*/t("line",{x1:"12",x2:"12",y1:"8",y2:"12"}),/*#__PURE__*/t("line",{x1:"12",x2:"12.01",y1:"16",y2:"16"})]})}const dc=792703809,pc="11111111111111111111111111111111";let hc="0x0000000000000000000000000000000000000000";const uc=({appId:e,originCurrency:t,destinationCurrency:n,...a})=>({tradeType:"EXPECTED_OUTPUT",originCurrency:t??hc,destinationCurrency:n??hc,referrer:`privy|${e}`,...a});let mc="https://api.relay.link",gc="https://api.testnets.relay.link";const yc=async({input:e,isTestnet:t})=>{let n=await fetch((t?gc:mc)+"/quote",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)}),a=await n.json();if(!(n.ok||"string"==typeof a.message&&a.message.startsWith("Invalid address")))throw console.error("Relay error:",a),Error(a.message??"Error fetching quote from relay");return a},fc=e=>{let t=e.steps[0]?.items?.[0];if(t)return{from:t.data.from,to:t.data.to,value:Number(t.data.value),chainId:Number(t.data.chainId),data:t.data.data}};async function wc({transactionHash:e,isTestnet:t}){let n=await fetch((t?gc:mc)+"/requests/v2?hash="+e),a=await n.json();if(!n.ok){if("message"in a&&"string"==typeof a.message)throw Error(a.message);throw Error("Error fetching request from relay")}return a.requests.at(0)?.status??"pending"}function vc({transactionHash:e,isTestnet:t,bridgingStatus:n,setBridgingStatus:a,onSuccess:i,onFailure:r}){I((()=>{if(e&&n){if(["delayed","waiting","pending"].includes(n)){let n=setInterval((async()=>{try{let n=await wc({transactionHash:e,isTestnet:t});a(n)}catch(e){console.error(e)}}),1e3);return()=>clearInterval(n)}"success"===n?i({transactionHash:e}):["refund","failure"].includes(n)&&r({error:new bc(e,t)})}}),[n,e,t])}class bc extends _{constructor(e,t){super("We were unable to complete the bridging transaction. Funds will be refunded on your wallet.",void 0,P.TRANSACTION_FAILURE),this.relayLink=t?`https://testnets.relay.link/transaction/${e}`:`https://relay.link/transaction/${e}`}}const Cc=({error:a,allowlistConfig:i,onRetry:r,onCaptchaReset:o,onBack:d})=>{let p=((a,i)=>{if(a instanceof bc)return{title:"Transaction failed",detail:/*#__PURE__*/e(n,{children:[/*#__PURE__*/t("span",{children:a.message}),/*#__PURE__*/e("span",{children:[" ","Check the"," ",/*#__PURE__*/t(kc,{href:a.relayLink,target:"_blank",children:"refund status"}),"."]})]}),ctaText:"Try again",icon:l};if(a instanceof _)switch(a.privyErrorCode){case P.CLIENT_REQUEST_TIMEOUT:return{title:"Timed out",detail:a.message,ctaText:"Try again",icon:l};case P.INSUFFICIENT_BALANCE:return{title:"Insufficient balance",detail:a.message,ctaText:"Try again",icon:l};case P.TRANSACTION_FAILURE:return{title:"Transaction failure",detail:a.message,ctaText:"Try again",icon:l};default:return{title:"Something went wrong",detail:"Try again later",ctaText:"Try again",icon:l}}else{if(a instanceof yl&&"twilio_verification_failed"===a.type)return{title:"Something went wrong",detail:a.message,ctaText:"Try again",icon:s};if(!(a instanceof L))return a instanceof V&&a.status&&[400,422].includes(a.status)?{title:"Something went wrong",detail:a.message,ctaText:"Try again",icon:l}:{title:"Something went wrong",detail:"Try again later",ctaText:"Try again",icon:l};switch(a.privyErrorCode){case P.INVALID_CAPTCHA:return{title:"Something went wrong",detail:"Please try again.",ctaText:"Try again",icon:l};case P.DISALLOWED_LOGIN_METHOD:return{title:"Not allowed",detail:a.message,ctaText:"Try another method",icon:l};case P.ALLOWLIST_REJECTED:return{title:i.errorTitle||"You don't have access to this app",detail:i.errorDetail||"Have you been invited?",ctaText:i.errorCtaText||"Try another account",icon:c};case P.CAPTCHA_FAILURE:return{title:"Something went wrong",detail:"You did not pass CAPTCHA. Please try again.",ctaText:"Try again",icon:null};case P.CAPTCHA_TIMEOUT:return{title:"Something went wrong",detail:"Something went wrong! Please try again later.",ctaText:"Try again",icon:null};case P.LINKED_TO_ANOTHER_USER:return{title:"Authentication failed",detail:"This account has already been linked to another user.",ctaText:"Try again",icon:l};case P.NOT_SUPPORTED:return{title:"This region is not supported",detail:"SMS authentication from this region is not available",ctaText:"Try another method",icon:l};case P.TOO_MANY_REQUESTS:return{title:"Request failed",detail:"Too many attempts.",ctaText:"Try again later",icon:l};default:return{title:"Something went wrong",detail:"Try again later",ctaText:"Try again",icon:l}}}})(a,i);/*#__PURE__*/return t(Qr,{title:p.title,subtitle:p.detail,icon:p.icon,onBack:d,iconVariant:"error",primaryCta:{label:p.ctaText,onClick:()=>{a instanceof L&&(a.privyErrorCode===P.INVALID_CAPTCHA&&o?.(),a.privyErrorCode===P.ALLOWLIST_REJECTED&&i.errorCtaLink)?window.location.href=i.errorCtaLink:r?.()},variant:"error"},watermark:!0})},xc={component:()=>{let{navigate:e,data:n,lastScreen:a,currentScreen:i}=Ni(),r=Z(),{reset:o}=ma(),l=n?.errorModalData?.previousScreen||(a===i?void 0:a);/*#__PURE__*/return t(Cc,{error:n?.errorModalData?.error||Error(),allowlistConfig:r.allowlistConfig,onRetry:()=>{e(l||ay,!1)},onCaptchaReset:o})}};let kc=/*#__PURE__*/Ne.a.withConfig({displayName:"Link",componentId:"sc-e29a7de8-0"})(["color:var(--privy-color-accent) !important;font-weight:600;"]);const Tc=({onTransfer:e,isTransferring:n,transferSuccess:a})=>/*#__PURE__*/t(ar,{...a?{success:!0,children:"Success!"}:{warn:!0,loading:n,onClick:e,children:"Transfer and delete account"}}),Ac=/*#__PURE__*/Ne.div.withConfig({displayName:"ConnectContainer",componentId:"sc-3505eb4c-0"})(["display:flex;flex-direction:column;align-items:center;justify-content:center;gap:8px;width:100%;padding-bottom:16px;"]),Ic=/*#__PURE__*/Ne.div.withConfig({displayName:"GappedContainer",componentId:"sc-3505eb4c-1"})(["display:flex;flex-direction:column;&& p{font-size:14px;}width:100%;gap:16px;"]),Sc=/*#__PURE__*/Ne.div.withConfig({displayName:"DisclosedAccountContainer",componentId:"sc-3505eb4c-2"})(["display:flex;cursor:pointer;align-items:center;width:100%;border:1px solid var(--privy-color-foreground-4) !important;border-radius:var(--privy-border-radius-md);padding:8px 10px;font-size:14px;font-weight:500;gap:8px;"]),Nc=/*#__PURE__*/Ne(Ve).withConfig({displayName:"StyledExclamationCircleIcon",componentId:"sc-3505eb4c-3"})(["position:relative;width:",";height:",";color:var(--privy-color-foreground-3);margin-left:auto;"],(({$iconSize:e})=>`${e}px`),(({$iconSize:e})=>`${e}px`)),Ec=/*#__PURE__*/Ne(He).withConfig({displayName:"StyledCopyIcon",componentId:"sc-3505eb4c-4"})(["position:relative;width:15px;height:15px;color:var(--privy-color-foreground-3);margin-left:auto;"]),_c=/*#__PURE__*/Ne.ol.withConfig({displayName:"ListContainer",componentId:"sc-3505eb4c-5"})(["display:flex;flex-direction:column;font-size:14px;width:100%;text-align:left;"]),Mc=/*#__PURE__*/Ne.li.withConfig({displayName:"ListItem",componentId:"sc-3505eb4c-6"})(["font-size:14px;list-style-type:auto;list-style-position:outside;margin-left:1rem;margin-bottom:0.5rem;&:last-child{margin-bottom:0;}"]),Wc=/*#__PURE__*/Ne.div.withConfig({displayName:"CircleContainer",componentId:"sc-3505eb4c-7"})(["position:relative;width:60px;height:60px;margin:10px;display:flex;justify-content:center;align-items:center;"]);let Lc=()=>/*#__PURE__*/t(Wc,{children:/*#__PURE__*/t(Nc,{$iconSize:60})});const Pc=({address:a,onClose:i,onRetry:r,onTransfer:o,isTransferring:l,transferSuccess:s})=>{let{defaultChain:c}=Z(),d=c.blockExplorers?.default.url??"https://etherscan.io";/*#__PURE__*/return e(n,{children:[/*#__PURE__*/t(yr,{onClose:i,backFn:r}),/*#__PURE__*/e(Ac,{children:[/*#__PURE__*/t(Lc,{}),/*#__PURE__*/e(Ic,{children:[/*#__PURE__*/t("h3",{children:"Check account assets before transferring"}),/*#__PURE__*/t("p",{children:"Before transferring, ensure there are no assets in the other account. Assets in that account will not transfer automatically and may be lost."}),/*#__PURE__*/e(_c,{children:[/*#__PURE__*/t("p",{children:" To check your balance, you can:"}),/*#__PURE__*/t(Mc,{children:"Log out and log back into the other account, or "}),/*#__PURE__*/e(Mc,{children:["Copy your wallet address and use a"," ",/*#__PURE__*/t("u",{children:/*#__PURE__*/t("a",{target:"_blank",href:d,children:"block explorer"})})," ","to see if the account holds any assets."]})]}),/*#__PURE__*/e(Sc,{onClick:()=>navigator.clipboard.writeText(a).catch(console.error),children:[/*#__PURE__*/t(ze,{color:"var(--privy-color-foreground-1)",strokeWidth:2,height:"28px",width:"28px"}),/*#__PURE__*/t(rc,{address:a,showCopyIcon:!1}),/*#__PURE__*/t(Ec,{})]}),/*#__PURE__*/t(Tc,{onTransfer:o,isTransferring:l,transferSuccess:s})]})]}),/*#__PURE__*/t($i,{})]})},Fc={component:()=>{let{initiateAccountTransfer:e,closePrivyModal:n}=O(),{data:a,navigate:i,lastScreen:r,setModalData:o}=Ni(),[l,s]=T(void 0),[c,d]=T(!1),[p,h]=T(!1),u=async()=>{try{if(!a?.accountTransfer?.nonce||!a?.accountTransfer?.account)throw Error("missing account transfer inputs");h(!0),await e({nonce:a?.accountTransfer?.nonce,account:a?.accountTransfer?.account,accountType:a?.accountTransfer?.linkMethod,externalWalletMetadata:a?.accountTransfer?.externalWalletMetadata,telegramWebAppData:a?.accountTransfer?.telegramWebAppData,telegramAuthResult:a?.accountTransfer?.telegramAuthResult,farcasterEmbeddedAddress:a?.accountTransfer?.farcasterEmbeddedAddress,oAuthUserInfo:a?.accountTransfer?.oAuthUserInfo}),d(!0),h(!1),setTimeout(n,1e3)}catch(e){o({errorModalData:{error:e,previousScreen:r||Fc}}),i(xc,!0)}};return l?/*#__PURE__*/t(Pc,{address:l,onClose:n,onRetry:()=>s(void 0),onTransfer:u,isTransferring:p,transferSuccess:c}):/*#__PURE__*/t(Dc,{onClose:n,onInfo:()=>s(a?.accountTransfer?.embeddedWalletAddress),onContinue:()=>s(a?.accountTransfer?.embeddedWalletAddress),onTransfer:u,isTransferring:p,transferSuccess:c,data:a})}},Dc=({onClose:a,onContinue:i,onInfo:r,onTransfer:o,transferSuccess:l,isTransferring:s,data:c})=>{if(!c?.accountTransfer?.linkMethod||!c?.accountTransfer?.displayName)return;let d={method:c?.accountTransfer?.linkMethod,handle:c?.accountTransfer?.displayName,disclosedAccount:c?.accountTransfer?.embeddedWalletAddress?{type:"wallet",handle:c?.accountTransfer?.embeddedWalletAddress}:void 0};/*#__PURE__*/return e(n,{children:[/*#__PURE__*/t(yr,{closeable:!0}),/*#__PURE__*/e(Ac,{children:[/*#__PURE__*/t(ml,{children:/*#__PURE__*/e("div",{children:[/*#__PURE__*/t(ic,{color:"var(--privy-color-error)"}),/*#__PURE__*/t(Be,{height:38,width:38,stroke:"var(--privy-color-error)"})]})}),/*#__PURE__*/e(Ic,{children:[/*#__PURE__*/e("h3",{children:[function(e){switch(e){case"sms":return"Phone number";case"email":return"Email address";case"siwe":return"Wallet address";case"siws":return"Solana wallet address";case"linkedin":return"LinkedIn profile";case"google":case"apple":case"discord":case"github":case"instagram":case"spotify":case"tiktok":case"line":case"twitch":case"twitter":case"telegram":case"farcaster":return`${_n(e.replace("_oauth",""))} profile`;default:return e.startsWith("privy:")?"Cross-app account":e}}(d.method)," is associated with another account"]}),/*#__PURE__*/e("p",{children:["Do you want to transfer",/*#__PURE__*/t("b",{children:d.handle?` ${d.handle}`:""})," to this account instead? This will delete your other account."]}),/*#__PURE__*/t(Rc,{onClick:r,disclosedAccount:d.disclosedAccount})]}),/*#__PURE__*/e(Ic,{style:{gap:12,marginTop:12},children:[c?.accountTransfer?.embeddedWalletAddress?/*#__PURE__*/t(ar,{onClick:i,children:"Continue"}):/*#__PURE__*/t(Tc,{onTransfer:o,transferSuccess:l,isTransferring:s}),/*#__PURE__*/t(lr,{onClick:a,children:"No thanks"})]})]}),/*#__PURE__*/t($i,{})]})};function Rc({disclosedAccount:n,onClick:a}){return n?/*#__PURE__*/e(Sc,{onClick:a,children:[/*#__PURE__*/t(ze,{color:"var(--privy-color-foreground-1)",strokeWidth:2,height:"28px",width:"28px"}),/*#__PURE__*/t(rc,{address:n.handle,showCopyIcon:!1}),/*#__PURE__*/t(cc,{width:15,height:15,color:"var(--privy-color-foreground-3)",style:{marginLeft:"auto"}})]}):null}const Oc=({errorMessage:e,onClose:n})=>/*#__PURE__*/t(Qr,e?{title:"Something went wrong",subtitle:e,icon:d,iconVariant:"error",primaryCta:{label:"Close",onClick:n},watermark:!0}:{title:"Creating your wallet",subtitle:"Please wait...",iconVariant:"loading",watermark:!1}),Uc={component:()=>{let{setModalData:e,navigate:n,data:a,onUserCloseViaDialogOrKeybindRef:i}=Ni(),r=Z(),[o,l]=T(""),{embeddedWallets:s}=Z(),{authenticated:c,user:d}=_i(),{closePrivyModal:p,walletProxy:h,client:u}=O(),{onSuccess:m,onFailure:g,callAuthOnSuccessOnClose:y,shouldCreateEth:f,shouldCreateSol:w}=a.createWallet,v="legacy-embedded-wallets-only"===r.embeddedWallets.mode&&!0===r?.embeddedWallets.requireUserOwnedRecoveryOnCreate,[b,C]=T(null),{create:x}=Fl(),k=f??(!!d&&Ks(d,r.embeddedWallets.ethereum.createOnLogin)),A=w??(!!d&&Js(d,r.embeddedWallets.solana.createOnLogin)),S=new Tn((async()=>{let e=await u.getAccessToken();if(d&&e&&h)try{let e;if(k&&A)e=await x({chainType:"ethereum",walletIndex:0,latestUser:d}),e=await x({chainType:"solana",walletIndex:0,latestUser:e.user});else if(A)e=await x({chainType:"solana",walletIndex:0,latestUser:d});else{if(!k)return void p({shouldCallAuthOnSuccess:y});e=await x({chainType:"ethereum",walletIndex:0,latestUser:d})}C(e),n(Rl)}catch(e){l(e.message)}}));return I((()=>c&&d?v?(e({...a,createWallet:{...a.createWallet,shouldCreateEth:k,shouldCreateSol:A},recoverySelection:{...a?.recoverySelection,isInAccountCreateFlow:!0,shouldCreateEth:k,shouldCreateSol:A}}),n(gy({walletAction:"create",showAutomaticRecovery:!1,availableRecoveryMethods:s.userOwnedRecoveryOptions,legacySetWalletPasswordFlow:!1,isResettingPassword:!1}))):void S.execute():(n(ay),void g(Error("User must be authenticated before creating a Privy wallet")))),[v,c]),i.current=()=>null/*#__PURE__*/,t(Oc,{errorMessage:o||void 0,onClose:()=>{b?(m(b),p({shouldCallAuthOnSuccess:y})):(g(new H("User wallet creation failed")),p({shouldCallAuthOnSuccess:!1}))}})}},Bc={component:()=>{let{user:e,logout:n}=_i(),{onUserCloseViaDialogOrKeybindRef:a,setModalData:i,navigate:r}=Ni(),o=Z(),{acceptTerms:l,closePrivyModal:s,createAnalyticsEvent:c}=O(),d=e=>{e?.preventDefault(),s({shouldCallAuthOnSuccess:!1}),n()};a.current=d;/*#__PURE__*/return t(zc,{termsAndConditionsUrl:o?.legal.termsAndConditionsUrl,privacyPolicyUrl:o?.legal.privacyPolicyUrl,onAccept:async t=>{t?.preventDefault(),await l(),e&&tc(e,o.embeddedWallets)?(i({createWallet:{onSuccess:()=>{},onFailure:e=>{console.error(e),c({eventName:"embedded_wallet_creation_failure_logout",payload:{error:e,screen:"AffirmativeConsentScreen"}}),n()},callAuthOnSuccessOnClose:!0}}),r(Uc)):s()},onDecline:d})}},zc=({termsAndConditionsUrl:n,privacyPolicyUrl:a,onAccept:i,onDecline:r,title:o="One last step",subtitle:l="By signing up, you agree to our terms and privacy policy."})=>/*#__PURE__*/t(Qr,{title:o,subtitle:l,icon:p,primaryCta:{label:"Accept",onClick:i},secondaryCta:{label:"No thanks",onClick:r},watermark:!0,children:(n||a)&&/*#__PURE__*/e(Vc,{children:[n&&/*#__PURE__*/e(tr,{variant:"muted",href:n,target:"_blank",size:"lg",style:{justifyContent:"space-between"},as:"a",children:["View Terms",/*#__PURE__*/t(h,{width:16,height:16,strokeWidth:2.25})]}),a&&/*#__PURE__*/e(tr,{variant:"muted",href:a,target:"_blank",size:"lg",style:{justifyContent:"space-between"},as:"a",children:["View Privacy Policy",/*#__PURE__*/t(h,{width:16,height:16,strokeWidth:2.25})]})]})});let Vc=/*#__PURE__*/Ne.div.withConfig({displayName:"LinksContainer",componentId:"sc-21e1b98c-0"})(["display:flex;flex-direction:column;gap:12px;margin-top:var(--screen-space);"]);const Hc=({color:e,...n})=>/*#__PURE__*/t("svg",{version:"1.1",id:"Layer_1",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",x:"0px",y:"0px",viewBox:"0 0 115.77 122.88",xmlSpace:"preserve",...n,children:/*#__PURE__*/t("g",{children:/*#__PURE__*/t("path",{fill:e||"currentColor",className:"st0",d:"M89.62,13.96v7.73h12.19h0.01v0.02c3.85,0.01,7.34,1.57,9.86,4.1c2.5,2.51,4.06,5.98,4.07,9.82h0.02v0.02 v73.27v0.01h-0.02c-0.01,3.84-1.57,7.33-4.1,9.86c-2.51,2.5-5.98,4.06-9.82,4.07v0.02h-0.02h-61.7H40.1v-0.02 c-3.84-0.01-7.34-1.57-9.86-4.1c-2.5-2.51-4.06-5.98-4.07-9.82h-0.02v-0.02V92.51H13.96h-0.01v-0.02c-3.84-0.01-7.34-1.57-9.86-4.1 c-2.5-2.51-4.06-5.98-4.07-9.82H0v-0.02V13.96v-0.01h0.02c0.01-3.85,1.58-7.34,4.1-9.86c2.51-2.5,5.98-4.06,9.82-4.07V0h0.02h61.7 h0.01v0.02c3.85,0.01,7.34,1.57,9.86,4.1c2.5,2.51,4.06,5.98,4.07,9.82h0.02V13.96L89.62,13.96z M79.04,21.69v-7.73v-0.02h0.02 c0-0.91-0.39-1.75-1.01-2.37c-0.61-0.61-1.46-1-2.37-1v0.02h-0.01h-61.7h-0.02v-0.02c-0.91,0-1.75,0.39-2.37,1.01 c-0.61,0.61-1,1.46-1,2.37h0.02v0.01v64.59v0.02h-0.02c0,0.91,0.39,1.75,1.01,2.37c0.61,0.61,1.46,1,2.37,1v-0.02h0.01h12.19V35.65 v-0.01h0.02c0.01-3.85,1.58-7.34,4.1-9.86c2.51-2.5,5.98-4.06,9.82-4.07v-0.02h0.02H79.04L79.04,21.69z M105.18,108.92V35.65v-0.02 h0.02c0-0.91-0.39-1.75-1.01-2.37c-0.61-0.61-1.46-1-2.37-1v0.02h-0.01h-61.7h-0.02v-0.02c-0.91,0-1.75,0.39-2.37,1.01 c-0.61,0.61-1,1.46-1,2.37h0.02v0.01v73.27v0.02h-0.02c0,0.91,0.39,1.75,1.01,2.37c0.61,0.61,1.46,1,2.37,1v-0.02h0.01h61.7h0.02 v0.02c0.91,0,1.75-0.39,2.37-1.01c0.61-0.61,1-1.46,1-2.37h-0.02V108.92L105.18,108.92z"})})});let jc=/*#__PURE__*/Ne.button.withConfig({displayName:"CopyTextButton",componentId:"sc-4b0620dc-0"})(["display:flex;align-items:center;gap:0.5rem;&:hover{text-decoration:underline;}svg{width:0.875rem;height:0.875rem;}"]),$c=/*#__PURE__*/Ne.span.withConfig({displayName:"CopiedText",componentId:"sc-4b0620dc-1"})(["display:flex;align-items:center;gap:0.25rem;font-size:0.875rem;color:var(--privy-color-foreground-2);"]),qc=/*#__PURE__*/Ne(St).withConfig({displayName:"GreenCheck",componentId:"sc-4b0620dc-2"})(["color:var(--privy-color-success);"]),Gc=/*#__PURE__*/Ne(Hc).withConfig({displayName:"StyledCopy",componentId:"sc-4b0620dc-3"})(["color:var(--privy-color-foreground-3);opactiy:0.5;"]);function Zc({children:n,iconOnly:a,value:i,hideCopyIcon:r,...o}){let[l,s]=T(!1);/*#__PURE__*/return e(jc,{...o,onClick:()=>{navigator.clipboard.writeText(i||n).catch(console.error),s(!0),setTimeout((()=>s(!1)),1500)},children:[n," ",l?/*#__PURE__*/e($c,{children:[/*#__PURE__*/t(qc,{})," ",!a&&"Copied"]}):!r&&/*#__PURE__*/t(Gc,{})]})}const Qc=()=>/*#__PURE__*/t("svg",{width:"200",height:"200",viewBox:"-77 -77 200 200",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:{height:"28px",width:"28px"},children:/*#__PURE__*/t("rect",{width:"50",height:"50",fill:"black",rx:10,ry:10})});let Yc=(e,t,n,a,i)=>{for(let r=t;r<t+a;r++)for(let t=n;t<n+i;t++){let n=e?.[t];n&&n[r]&&(n[r]=0)}return e},Kc=({x:e,y:a,cellSize:i,bgColor:r,fgColor:o})=>
19
- /*#__PURE__*/t(n,{children:[0,1,2].map((n=>/*#__PURE__*/t("circle",{r:i*(7-2*n)/2,cx:e+7*i/2,cy:a+7*i/2,fill:n%2!=0?r:o},`finder-${e}-${a}-${n}`)))}),Xc=({cellSize:e,matrixSize:a,bgColor:i,fgColor:r})=>/*#__PURE__*/t(n,{children:[[0,0],[(a-7)*e,0],[0,(a-7)*e]].map((([n,a])=>/*#__PURE__*/t(Kc,{x:n,y:a,cellSize:e,bgColor:i,fgColor:r},`finder-${n}-${a}`)))}),Jc=({matrix:e,cellSize:a,color:i})=>/*#__PURE__*/t(n,{children:e.map(((e,n)=>e.map(((e,r)=>e?/*#__PURE__*/t("rect",{height:a-.4,width:a-.4,x:n*a+.1*a,y:r*a+.1*a,rx:.5*a,ry:.5*a,fill:i},`cell-${n}-${r}`):/*#__PURE__*/t(b.Fragment,{},`circle-${n}-${r}`)))))}),ed=({cellSize:a,matrixSize:i,element:r,sizePercentage:o,bgColor:l})=>{if(!r)/*#__PURE__*/return t(n,{});let s=i*(o||.14),c=Math.floor(i/2-s/2),d=Math.floor(i/2+s/2);(d-c)%2!=i%2&&(d+=1);let p=(d-c)*a,h=p-.2*p,u=c*a;/*#__PURE__*/return e(n,{children:[/*#__PURE__*/t("rect",{x:c*a,y:c*a,width:p,height:p,fill:l}),/*#__PURE__*/t(r,{x:u+.1*p,y:u+.1*p,height:h,width:h})]})},td=n=>{let a=n.outputSize,i=((e,t)=>{let n=Nt.create(e,{errorCorrectionLevel:t}).modules,a=((e,t)=>{let n=e.slice(0),a=[];for(;n.length;)a.push(n.splice(0,t));return a})(Array.from(n.data),n.size);return a=Yc(a,0,0,7,7),a=Yc(a,a.length-7,0,7,7),Yc(a,0,a.length-7,7,7)})(n.url,n.errorCorrectionLevel),r=a/i.length,o=function(e,{min:t,max:n}){return Math.min(Math.max(e,t),n)}(2*r,{min:.025*a,max:.036*a});/*#__PURE__*/return e("svg",{height:n.outputSize,width:n.outputSize,viewBox:`0 0 ${n.outputSize} ${n.outputSize}`,style:{height:"100%",width:"100%",padding:`${o}px`},children:[/*#__PURE__*/t(Jc,{matrix:i,cellSize:r,color:n.fgColor}),/*#__PURE__*/t(Xc,{cellSize:r,matrixSize:i.length,fgColor:n.fgColor,bgColor:n.bgColor}),/*#__PURE__*/t(ed,{cellSize:r,element:n.logo?.element,bgColor:n.bgColor,matrixSize:i.length})]})},nd=/*#__PURE__*/Ne.div.attrs({className:"ph-no-capture"}).withConfig({displayName:"QrContainer",componentId:"sc-597e27f3-0"})(["display:flex;justify-content:center;align-items:center;height:",";width:",";margin:auto;background-color:",";&&{border-width:2px;border-color:",";border-radius:var(--privy-border-radius-md);}"],(e=>`${e.$size}px`),(e=>`${e.$size}px`),(e=>e.$bgColor),(e=>e.$borderColor));const ad=e=>{let{appearance:n}=Z(),a=e.bgColor||"#FFFFFF",i=e.fgColor||"#000000",r=e.size||160,o="dark"===n.palette.colorScheme?a:i;/*#__PURE__*/return t(nd,{$size:r,$bgColor:a,$fgColor:i,$borderColor:o,children:/*#__PURE__*/t(td,{url:e.url,logo:{element:e.squareLogoElement??Qc},outputSize:r,bgColor:a,fgColor:i,errorCorrectionLevel:e.errorCorrectionLevel||"Q"})})},id=/*#__PURE__*/Ne.span.withConfig({displayName:"ErrorMessage",componentId:"sc-fcb8cd50-0"})(["text-align:left;font-size:0.75rem;font-weight:500;line-height:1.125rem;color:var(--privy-color-error);"]);let rd=/*#__PURE__*/Ne.label.withConfig({displayName:"BaseEmailForm",componentId:"sc-f34af797-0"})(["display:block;position:relative;width:100%;height:56px;&& > :first-child{position:absolute;left:0.75em;top:50%;transform:translate(0,-50%);}&& > input{font-size:16px;line-height:24px;color:var(--privy-color-foreground);padding:12px 88px 12px 52px;flex-grow:1;background:var(--privy-color-background);border:1px solid ",";border-radius:var(--privy-border-radius-md);width:100%;height:100%;@media (min-width:441px){font-size:14px;padding-right:78px;}:focus{outline:none;border-color:",";box-shadow:",";}:autofill,:-webkit-autofill{background:var(--privy-color-background);}&& > input::placeholder{color:var(--privy-color-foreground-3);}&:disabled{opacity:0.4;cursor:not-allowed;}&:disabled,&:disabled:hover,&:disabled > span{color:var(--privy-color-foreground-3);}}&& > button:last-child{right:0px;line-height:24px;padding:13px 17px;:focus{outline:none;}&:disabled{opacity:0.4;cursor:not-allowed;}&:disabled,&:disabled:hover,&:disabled > span{color:var(--privy-color-foreground-3);}}"],(({$error:e})=>e?"var(--privy-color-error) !important":"var(--privy-color-foreground-4)"),(({$error:e})=>e?"var(--privy-color-error) !important":"var(--privy-color-accent-light)"),(({$error:e})=>e?"none":"0 0 0 1px var(--privy-color-accent-light)"));const od=/*#__PURE__*/Ne(rd).withConfig({displayName:"EmailUpdateForm",componentId:"sc-f34af797-1"})(["background-color:var(--privy-color-background);transition:background-color 200ms ease;&& > button{right:0;line-height:24px;position:absolute;padding:13px 17px;background-color:#090;:focus{outline:none;border-color:var(--privy-color-accent);}}"]),ld=/*#__PURE__*/Ne(rd).withConfig({displayName:"EmailInputForm",componentId:"sc-f34af797-2"})(["&& > input{overflow:hidden;white-space:nowrap;text-overflow:ellipsis;padding-right:",";border:1px solid ",";&& > input::placeholder{color:var(--privy-color-foreground-3);}}&& > :last-child{right:16px;position:absolute;top:50%;transform:translate(0,-50%);}&& > button:last-child{right:0px;line-height:24px;padding:13px 17px;:focus{outline:none;}}"],(e=>e.$stacked?"16px":"88px"),(({$error:e})=>e?"var(--privy-color-error) !important":"var(--privy-color-foreground-4)")),sd=/*#__PURE__*/Ne.div.withConfig({displayName:"InputContainerForm",componentId:"sc-f34af797-3"})(["width:100%;&& > ","{display:block;text-align:left;padding-left:var(--privy-border-radius-md);padding-bottom:5px;}"],id),cd={"connectionStatus.successfullyConnected":"Successfully connected with {walletName}","connectionStatus.errorTitle":"{errorMessage}","connectionStatus.connecting":"Connecting","connectionStatus.connectOneWallet":"For the best experience, connect only one wallet at a time.","connectionStatus.checkOtherWindows":"Don't see your wallet? Check your other browser windows.","connectionStatus.stillHere":"Still here?","connectionStatus.tryConnectingAgain":"Try connecting again","connectionStatus.or":"or","connectionStatus.useDifferentLink":"use this different link","connectWallet.connectYourWallet":"Connect a wallet","connectWallet.waitingForWallet":"Waiting for {walletName}","connectWallet.connectToAccount":"Connect a wallet to your {appName} account","connectWallet.installAndConnect":"To connect to {walletName}, install and open the app. Then confirm the connection when prompted.","connectWallet.tryConnectingAgain":"Please try connecting again.","connectWallet.openInApp":"Open in app","connectWallet.copyLink":"Copy link","connectWallet.retry":"Retry","connectWallet.searchPlaceholder":"Search through {count} wallets","connectWallet.noWalletsFound":"No wallets found. Try another search.","connectWallet.lastUsed":"Last used","connectWallet.selectYourWallet":"Select your wallet","connectWallet.selectNetwork":"Select network","connectWallet.goToWallet":"Go to {walletName} to continue","connectWallet.scanToConnect":"Scan code to connect to {walletName}","connectWallet.openOrInstall":"Open or install {walletName}"};function dd(){let e=Z();return{t:(t,n)=>function(e,t,n){let a=t?.[e]??cd[e];return n&&0!==Object.keys(n).length?a.replace(/\{(\w+)\}/g,((e,t)=>n[t]??e)):a}(t,e.intl.textLocalization,n)}}const pd=({...n})=>/*#__PURE__*/e("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",...n,children:[/*#__PURE__*/t("rect",{width:"18",height:"18",x:"3",y:"3",rx:"2"}),/*#__PURE__*/t("path",{d:"M3 9a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2"}),/*#__PURE__*/t("path",{d:"M3 11h3c.8 0 1.6.3 2.1.9l1.1.9c1.6 1.6 4.1 1.6 5.7 0l1.1-.9c.5-.5 1.3-.9 2.1-.9H21"})]}),hd={phantom:{mobile:{native:"phantom://",universal:"https://phantom.app/ul/"}},solflare:{mobile:{native:void 0,universal:"https://solflare.com/ul/v1/"}},metamask:{image_url:{sm:si,md:si}}};class ud{static normalize(e){return e.replace(/[-_]wallet$/,"").replace(/[-_]extension$/,"").toLowerCase()}isEth(e){return e.chains.some((e=>e.startsWith("eip155:")))}isSol(e){return e.chains.some((e=>e.startsWith("solana:")))}inAllowList(e,t){if(!this.normalizedAllowList||0===this.normalizedAllowList.length||"listing"===t&&this.includeWalletConnect)return!0;let n=ud.normalize(e);return this.normalizedAllowList.some((e=>n===ud.normalize(e)))}inDenyList(e,t){return"listing"===t&&"rabby"===e}chainMatches(e){return"ethereum-only"===this.chainFilter?"ethereum"===e:"solana-only"!==this.chainFilter||"solana"===e}connectorOk(e){return!!("null"!==e.connectorType&&"walletconnect_solana"!==e.walletBranding.id&&this.chainMatches(e.chainType)&&(this.inAllowList(e.walletClientType,"connector")||("injected"===e.connectorType||"solana_adapter"===e.connectorType)&&("ethereum"===e.chainType&&this.detectedEth||"solana"===e.chainType&&this.detectedSol)))}listingOk(e){if(e.slug.includes("coinbase"))return!1;if("ethereum-only"===this.chainFilter){if(!this.isEth(e))return!1}else if("solana-only"===this.chainFilter&&!this.isSol(e))return!1;return!(!this.inAllowList(e.slug,"listing")||this.inDenyList(e.slug,"listing"))}getWallets(e,t){let n=new Map,a=e=>{let t=n.get(e.id);if(t){t.chainType!==e.chainType&&(t.chainType="multi");let n=new Set(t.chains);e.chains.forEach((e=>n.add(e))),t.chains=Array.from(n),!t.icon&&e.icon&&(t.icon=e.icon),!t.url&&e.url&&(t.url=e.url),!t.listing&&e.listing&&(t.listing=e.listing)}else n.set(e.id,e)};e.filter((e=>this.connectorOk(e))).forEach((e=>{let t=ud.normalize(e.walletClientType);a({id:t,label:e.walletBranding?.name??t,source:"connector",connector:e,chainType:e.chainType,icon:e.walletBranding?.icon,url:void 0,chains:["ethereum"===e.chainType?"eip155":"solana"]})}));let i=e.find((e=>"wallet_connect_v2"===e.connectorType)),r=e.find((e=>"walletconnect_solana"===e.walletBranding.id));t.filter((e=>this.listingOk(e))).forEach((t=>{let n=[...t.chains].filter((e=>e.startsWith("eip155")||e.startsWith("solana")));if(e.some((e=>ud.normalize(e.walletClientType)===ud.normalize(t.slug)&&"ethereum"===e.chainType&&"null"!==e.connectorType))||i||t.mobile.native||t.mobile.universal||pi[t.slug]?.chainTypes.includes("ethereum")||(n=n.filter((e=>!e.startsWith("eip155")))),e.some((e=>ud.normalize(e.walletClientType)===ud.normalize(t.slug)&&"solana"===e.chainType&&"null"!==e.connectorType))||r||t.mobile.native||t.mobile.universal||pi[t.slug]?.chainTypes.includes("solana")||(n=n.filter((e=>!e.startsWith("solana")))),!n.length)return;let o=ud.normalize(t.slug),l=hd[t.slug],s=l?.image_url?.sm||t.image_url?.sm;n.some((e=>e.startsWith("eip155")))&&a({id:o,label:t.name||o,source:"listing",listing:t,chainType:"ethereum",icon:s,url:t.homepage,chains:n}),n.some((e=>e.startsWith("solana")))&&a({id:o,label:t.name||o,source:"listing",listing:t,chainType:"solana",icon:s,url:t.homepage,chains:n})})),this.includeWalletConnectQr&&i&&a({id:"wallet_connect_qr",label:"WalletConnect",source:"connector",connector:i,chainType:"ethereum",icon:Ci,url:void 0,chains:["eip155"]}),this.includeWalletConnectQrSolana&&r&&a({id:"wallet_connect_qr_solana",label:"WalletConnect",source:"connector",connector:r,chainType:"solana",icon:Ci,url:void 0,chains:["solana"]});let o=Array.from(n.values());o.forEach((e=>{let t=hd[e.listing?.slug||e.id];t?.image_url?.sm&&(e.icon=t.image_url.sm)}));let l=new Map;return this.normalizedAllowList?.forEach(((e,t)=>{l.set(ud.normalize(e),t)})),{wallets:o.slice().sort(((e,t)=>{let n=ud.normalize(e.id),a=ud.normalize(t.id);"binance-defi"===n?n="binance":"universalprofiles"===n?n="universal_profile":"cryptocom-defi"===n?n="cryptocom":"bitkeep"===n&&(n="bitget_wallet"),"binance-defi"===a?a="binance":"universalprofiles"===a?a="universal_profile":"cryptocom-defi"===a?a="cryptocom":"bitkeep"===a&&(a="bitget_wallet");let i=l.has(n),r=l.has(a);return i&&r?l.get(n)-l.get(a):i?-1:r?1:"connector"===e.source&&"listing"===t.source?-1:"listing"===e.source&&"connector"===t.source?1:e.label.toLowerCase().localeCompare(t.label.toLowerCase())})),walletCount:o.length}}constructor(e,t){this.chainFilter=e,t&&t.length>0&&(this.normalizedAllowList=t.map(String),this.normalizedAllowList.includes("binance")&&this.normalizedAllowList.push("binance-defi-wallet"),this.normalizedAllowList.includes("bitget_wallet")&&this.normalizedAllowList.push("bitkeep")),this.detectedEth=this.normalizedAllowList?.includes("detected_ethereum_wallets")??!1,this.detectedSol=this.normalizedAllowList?.includes("detected_solana_wallets")??!1,this.includeWalletConnect=this.normalizedAllowList?.includes("wallet_connect")??!1,this.includeWalletConnectQr=this.normalizedAllowList?.includes("wallet_connect_qr")??!1,this.includeWalletConnectQrSolana=this.normalizedAllowList?.includes("wallet_connect_qr_solana")??!1}}var md=n=>/*#__PURE__*/e("svg",{viewBox:"0 0 32 32",xmlns:"http://www.w3.org/2000/svg",...n,children:[/*#__PURE__*/t("path",{d:"m0 0h32v32h-32z",fill:"#5469d4"}),/*#__PURE__*/t("path",{d:"m15.997 5.333-.143.486v14.106l.143.143 6.548-3.87z",fill:"#c2ccf4"}),/*#__PURE__*/t("path",{d:"m15.996 5.333-6.548 10.865 6.548 3.87z",fill:"#fff"}),/*#__PURE__*/t("path",{d:"m15.997 21.306-.08.098v5.025l.08.236 6.552-9.227z",fill:"#c2ccf4"}),/*#__PURE__*/t("path",{d:"m15.996 26.665v-5.36l-6.548-3.867z",fill:"#fff"}),/*#__PURE__*/t("path",{d:"m15.995 20.07 6.548-3.87-6.548-2.976v6.847z",fill:"#8698e8"}),/*#__PURE__*/t("path",{d:"m9.448 16.2 6.548 3.87v-6.846z",fill:"#c2ccf4"})]}),gd=n=>/*#__PURE__*/e("svg",{viewBox:"0 0 32 32",xmlns:"http://www.w3.org/2000/svg",...n,children:[/*#__PURE__*/e("linearGradient",{id:"a",gradientUnits:"userSpaceOnUse",x1:"7.233",x2:"24.766",y1:"24.766",y2:"7.234",children:[/*#__PURE__*/t("stop",{offset:"0",stopColor:"#9945ff"}),/*#__PURE__*/t("stop",{offset:".2",stopColor:"#7962e7"}),/*#__PURE__*/t("stop",{offset:"1",stopColor:"#00d18c"})]}),/*#__PURE__*/t("path",{d:"m0 0h32v32h-32z",fill:"#10111a"}),/*#__PURE__*/t("path",{clipRule:"evenodd",d:"m9.873 20.41a.645.645 0 0 1 .476-.21l14.662.012a.323.323 0 0 1 .238.54l-3.123 3.438a.643.643 0 0 1 -.475.21l-14.662-.012a.323.323 0 0 1 -.238-.54zm15.376-2.862a.322.322 0 0 1 -.238.54l-14.662.012a.642.642 0 0 1 -.476-.21l-3.122-3.44a.323.323 0 0 1 .238-.54l14.662-.012a.644.644 0 0 1 .475.21zm-15.376-9.738a.644.644 0 0 1 .476-.21l14.662.012a.322.322 0 0 1 .238.54l-3.123 3.438a.643.643 0 0 1 -.475.21l-14.662-.012a.323.323 0 0 1 -.238-.54z",fill:"url(#a)",fillRule:"evenodd"})]});const yd=/*#__PURE__*/Ne.div.withConfig({displayName:"Header",componentId:"sc-9b65f2b6-0"})(["display:flex;justify-content:space-between;align-items:center;"]),fd=/*#__PURE__*/Ne.button.withConfig({displayName:"CloseButton",componentId:"sc-9b65f2b6-1"})(["padding:0.25rem;height:30px;width:30px;display:flex;align-items:center;justify-content:center;border-radius:var(--privy-border-radius-full);background:var(--privy-color-background-2);"]),wd=/*#__PURE__*/Ne.div.withConfig({displayName:"WalletIconWithActiveIndicator",componentId:"sc-9b65f2b6-2"})(["position:relative;display:inline-flex;align-items:center;&::after{content:' ';border-radius:var(--privy-border-radius-full);height:6px;width:6px;background-color:var(--privy-color-icon-success);position:absolute;right:-3px;top:-3px;}"]),vd=/*#__PURE__*/Ne.img.withConfig({displayName:"WalletIcon",componentId:"sc-9b65f2b6-3"})(["width:32px;height:32px;border-radius:0.25rem;object-fit:contain;"]),bd=/*#__PURE__*/Ne.span.withConfig({displayName:"Chip",componentId:"sc-9b65f2b6-4"})(["display:flex;gap:0.25rem;align-items:center;padding:0.25rem 0.5rem;font-size:0.75rem;font-weight:500;line-height:1.125rem;border-radius:var(--privy-border-radius-sm);background-color:var(--privy-color-background-2);svg{width:100%;max-width:1rem;max-height:1rem;stroke-width:2;}"]),Cd=/*#__PURE__*/Ne.div.withConfig({displayName:"ScrollContainer",componentId:"sc-9b65f2b6-5"})(["display:flex;flex-direction:column;gap:0.5rem;max-height:24rem;overflow-y:scroll;&::-webkit-scrollbar{display:none;}scrollbar-gutter:stable both-edges;scrollbar-width:none;-ms-overflow-style:none;"," background-repeat:no-repeat;background-size:100% 32px,100% 16px;background-attachment:local,scroll;"],(e=>"light"===e.$colorScheme?"background: linear-gradient(var(--privy-color-background), var(--privy-color-background) 70%) bottom, linear-gradient(rgba(0, 0, 0, 0) 20%, rgba(0, 0, 0, 0.06)) bottom;":"dark"===e.$colorScheme?"background: linear-gradient(var(--privy-color-background), var(--privy-color-background) 70%) bottom, linear-gradient(rgba(255, 255, 255, 0) 20%, rgba(255, 255, 255, 0.06)) bottom;":void 0)),xd=Ct((()=>({isModalOpen:!1,resolvers:null})));let kd=Ct((()=>({})));const Td=(e,t)=>kd((n=>n[e]?.[t])),Ad=(e,t,n)=>{kd.setState((a=>({[e]:{...a[e],[t]:n}})))},Id=async()=>{let e,t,n=new Promise(((n,a)=>{e=n,t=a}));return kd.setState({}),xd.setState({isModalOpen:!0,resolvers:{resolve:e,reject:t}}),await n},Sd=()=>{let e=xd.getState().resolvers;e||console.warn("useActiveWalletStore: Called close while modal was not open"),xd.setState({isModalOpen:!1}),e?.resolve({wallet:xd.getState().wallet})},Nd=({address:e,client:t,appId:n})=>{let a=`${t}:${e}`;n&&yn.put(_d(n),a),xd.setState({wallet:a})},Ed=()=>xd((e=>e.isModalOpen)),_d=e=>`privy:${e}:active-wallet-connection`;function Md({enabled:e=!0,walletList:t,walletChainType:n}){let a=Z(),{connectors:i}=O(),{listings:r,loading:o}=Ra(e),l=n??a.appearance.walletChainType,s=t??a.appearance?.walletList,c=A((()=>new ud(l,s)),[l,s]),{wallets:d,walletCount:p}=A((()=>c.getWallets(i,r)),[c,i,r]),[h,u]=T(""),m=A((()=>h?d.filter((e=>e.label.toLowerCase().includes(h.toLowerCase()))):d),[h,d]),[g,y]=T();return{selected:g,setSelected:y,search:h,setSearch:u,loadingListings:o,wallets:m,walletCount:p}}let Wd=e=>!e||"string"!=typeof e&&(e instanceof oi||e instanceof vi);const Ld=({index:a,style:i,data:r,recent:o})=>{let l=r.wallets[a],{walletChainType:s,handleWalletClick:c}=r,{t:d}=dd(),p={...i,boxSizing:"border-box"};return l?/*#__PURE__*/e(Rd,{style:p,onClick:()=>c(l),children:[l.icon&&(l.connector&&!Wd(l.connector)?/*#__PURE__*/t(wd,{children:"string"==typeof l.icon?/*#__PURE__*/t(vd,{src:l.icon}):/*#__PURE__*/t(l.icon,{style:{width:"32px",height:"32px"}})}):"string"==typeof l.icon?/*#__PURE__*/t(vd,{src:l.icon}):/*#__PURE__*/t(l.icon,{style:{width:"32px",height:"32px"}})),/*#__PURE__*/t(Bd,{children:l.label}),o?/*#__PURE__*/e(n,{children:[/*#__PURE__*/t(bd,{children:d("connectWallet.lastUsed")}),/*#__PURE__*/t(Od,{children:/*#__PURE__*/e(n,{children:["ethereum-only"===s&&/*#__PURE__*/t(md,{}),"solana-only"===s&&/*#__PURE__*/t(gd,{})]})})]}):/*#__PURE__*/t(Od,{children:!("ethereum-only"===s||"solana-only"===s)&&/*#__PURE__*/e(n,{children:[l.chains?.some((e=>e.startsWith("eip155")))&&/*#__PURE__*/t(md,{}),l.chains?.some((e=>e.startsWith("solana")))&&/*#__PURE__*/t(gd,{})]})})]}):null};var Pd=({className:a,customDescription:i,connectOnly:r,preSelectedWalletId:o,hideHeader:l,...s})=>{let c=Z(),{t:d}=dd(),{connectors:p}=O(),h=s.walletChainType||c.appearance.walletChainType,u=s.walletList||c.appearance?.walletList,{onBack:m,onClose:g,app:y}=s,{selected:f,setSelected:w,qrUrl:v,setQrUrl:b,connecting:C,uiState:x,wallets:N,walletCount:E,handleConnect:_,handleBack:M,showSearchBar:L,isInitialConnectView:P,title:F,search:D,setSearch:R}=function({onConnect:e,onBack:t,onClose:n,onConnectError:a,walletList:i,walletChainType:r,app:o}){let l=Z(),{connectors:s}=O(),{t:c}=dd(),{wallets:d,walletCount:p,search:h,setSearch:u,selected:m,setSelected:g}=Md({enabled:Ba(i??[]),walletList:i,walletChainType:r}),[y,f]=T(),[w,v]=T(),[b,C]=T(),x=!m&&!w&&!b,k=x&&(p>6||h.length>0),I=s.find((e=>"wallet_connect_v2"===e.connectorType)),N=S((async(t,n)=>{if(t){if(b?.connector===t)return void console.log("Already connecting to this wallet, skipping duplicate attempt");if(f("loading"),"string"==typeof t)return C({connector:t,name:n?.name??"Wallet",icon:n?.icon}),void window.open(t,"_blank");C({connector:t,name:n?.name??t.walletBranding.name??"Wallet",icon:n?.icon??t.walletBranding.icon});try{let n=await t.connect({showPrompt:!0});if(!n)return f("error"),void a?.(new W("Unable to connect wallet"));f("success"),Nd({address:n.address,client:n.walletClientType,appId:l.id}),setTimeout((()=>{e({connector:t,wallet:n})}),ne)}catch(t){if(console.error("ERROR: ",{e:t}),t?.message?.includes("already pending for origin")||t?.message?.includes("wallet_requestPermissions"))return void console.log("Connection request already pending, maintaining loading state");f("error"),a?.(new W("Unable to connect wallet"))}}}),[l.id,e,b]),E=S((()=>w?(f(void 0),C(void 0),void v(void 0)):b?(f(void 0),void C(void 0)):m?(f(void 0),C(void 0),void g(void 0)):"error"===y||"loading"===y?(f(void 0),void C(void 0)):void t?.()),[w,b,m,y,t]),_=A((()=>b?.connector===I&&w&&Oe&&b?.name?c("connectWallet.goToWallet",{walletName:b.name}):b?.connector===I&&w&&b?.name?c("connectWallet.scanToConnect",{walletName:b.name}):w&&b?.name?c(Oe?"connectWallet.goToWallet":"connectWallet.scanToConnect",{walletName:b.name}):"string"==typeof b?.connector?c("connectWallet.openOrInstall",{walletName:b.name}):m&&!b?c("connectWallet.selectNetwork"):b?null:c("connectWallet.selectYourWallet")),[b,w,m,I,c]);return{selected:m,setSelected:g,qrUrl:w,setQrUrl:v,connecting:b,uiState:y,search:h,setSearch:u,wallets:d,walletCount:p,wc:I,isInitialConnectView:x,showSearchBar:k,title:_,handleConnect:N,handleBack:E,onClose:n,onConnect:e,app:o}}({...s,walletList:u,walletChainType:h}),U=p.find((e=>"wallet_connect_v2"===e.connectorType)),B=p.find((e=>"walletconnect_solana"===e.walletBranding.id)),z=k(null),V=It({count:N.length,getScrollElement:()=>z.current,estimateSize:()=>56,overscan:6,gap:5}),H=S((async e=>{let t="solana-only"!==h&&e.chains?.some((e=>e.startsWith("eip155"))),n="ethereum-only"!==h&&e.chains?.some((e=>e.startsWith("solana"))),a=t=>{let n=ud.normalize(e.id);return p.find((e=>ud.normalize(e.walletClientType)===n&&e.chainType===t&&!("ethereum"===e.chainType&&e instanceof oi||"solana"===e.chainType&&e instanceof vi)))},i=async()=>{if(!U||!e.listing)return!1;let t=hd[e.listing.slug]?{...e.listing,...hd[e.listing.slug]}:e.listing;return U.setWalletEntry(t,b),await U.resetConnection(e.id),await _(U,{name:e.label,icon:e.icon}),!0},o=async()=>!!B&&!!e.listing&&(await B.disconnect(),B.wallet.setWalletEntry(e.listing,b),await new Promise((e=>setTimeout(e,100))),await _(B,{name:e.label,icon:e.icon}),!0),l=async t=>{let n=(t=>{let n=pi[e.id];if(n)return n.getMobileRedirect({isSolana:t,connectOnly:!!r,useUniversalLink:!1});let a=e.listing?.mobile?.native;return e.listing?.mobile?.universal||a||e.url})(t);return!!n&&(await _(n,{name:e.label,icon:e.icon}),!0)};if(t&&n)w(e);else{if(t&&!n){let t=a("ethereum");if(t&&!Wd(t))return void await _(t,{name:e.label,icon:e.icon});if(Oe&&"phantom"===e.id){if(await l(!1)||await i())return}else if(await i()||await l(!1))return}if(n&&!t){let t=a("solana");if(t&&!Wd(t))return void await _(t,{name:e.label,icon:e.icon});if(Oe){if(await l(!0)||await o())return}else if(await o()||await l(!0))return}if(!Wd(e.connector)){if(U&&"wallet_connect_v2"===e.connector?.connectorType)if(await U.resetConnection(e.id),"wallet_connect_qr"!==e.id&&e.listing){let t=hd[e.listing.slug]?{...e.listing,...hd[e.listing.slug]}:e.listing;U.setWalletEntry(t,b)}else U.setWalletEntry({id:"wallet_connect_qr",name:"WalletConnect",rdns:"",slug:"wallet-connect",homepage:"",chains:["eip155"],mobile:{native:"",universal:void 0}},b);return B&&"walletconnect_solana"===e.connector?.walletBranding.id&&(await B.disconnect(),"wallet_connect_qr_solana"!==e.id&&e.listing?B.wallet.setWalletEntry(e.listing,b):B.wallet.setWalletEntry({id:"wallet_connect_solana_qr",name:"WalletConnect",rdns:"",slug:"wallet-connect-solana",homepage:"",chains:["solana"],mobile:{native:"",universal:void 0}},b),await new Promise((e=>setTimeout(e,100)))),void await _(e.connector,{name:e.label,icon:e.icon})}e.url&&await _(e.url,{name:e.label,icon:e.icon})}}),[U,B,_,w,b,h,r,p]);return I((()=>{if(!o)return;let e=N.find((({id:e})=>e===o));e&&H(e).catch(console.error)}),[o]),/*#__PURE__*/e(Vr,{className:a,children:[/*#__PURE__*/t(Vr.Header,{icon:l&&P?void 0:C&&!v||v&&Oe&&C?.icon?C.icon:C?void 0:pd,iconVariant:C&&!v||v&&Oe?"loading":void 0,iconLoadingStatus:C&&!v||v&&Oe?{success:"success"===x,fail:"error"===x}:void 0,title:l&&P?void 0:C&&!v?d("connectWallet.waitingForWallet",{walletName:C.name}):v&&Oe?d("connectWallet.waitingForWallet",{walletName:C?.name??"connection"}):F,subtitle:l&&P?void 0:C&&!v&&"string"==typeof C.connector?d("connectWallet.installAndConnect",{walletName:C.name}):C&&!v&&"string"!=typeof C.connector?d("error"===x?"connectWallet.tryConnectingAgain":"connectionStatus.connectOneWallet"):P?i??(y?d("connectWallet.connectToAccount",{appName:y.name}):null):null,showBack:!!m||!P,showClose:!0,onBack:m||M,onClose:g}),/*#__PURE__*/e(Vr.Body,{ref:z,$colorScheme:c.appearance.palette.colorScheme,style:{marginBottom:v?"0.5rem":void 0},children:[L&&/*#__PURE__*/t(Fd,{children:/*#__PURE__*/e(od,{style:{background:"transparent"},children:[/*#__PURE__*/t(Oi,{children:/*#__PURE__*/t(xt,{})}),/*#__PURE__*/t("input",{className:"login-method-button",type:"text",placeholder:d("connectWallet.searchPlaceholder",{count:String(E)}),onChange:e=>R(e.target.value),value:D})]})}),v&&Oe&&"loading"===x&&/*#__PURE__*/e("div",{style:{display:"flex",flexDirection:"column",alignItems:"center",gap:"1rem"},children:[/*#__PURE__*/t(tr,{variant:"primary",onClick:()=>window.open(v.universal??v.native,"_blank"),style:{width:"100%"},children:d("connectWallet.openInApp")}),/*#__PURE__*/t(zd,{value:v.universal??v.native,iconOnly:!0,children:"Copy link"})]}),v&&!Oe&&"loading"===x&&/*#__PURE__*/t("div",{style:{display:"flex",flexDirection:"column",alignItems:"center",gap:"1rem"},children:/*#__PURE__*/t(zd,{value:v.universal??v.native,iconOnly:!0,children:d("connectWallet.copyLink")})}),v&&!Oe&&/*#__PURE__*/t(ad,{size:280,url:v.universal??v.native,squareLogoElement:C?.icon?"string"==typeof C.icon?e=>/*#__PURE__*/t("svg",{...e,children:/*#__PURE__*/t("image",{href:C.icon,height:e.height,width:e.width})}):C.icon:bi}),/*#__PURE__*/e(Dd,{children:[C&&!v&&"string"==typeof C.connector&&/*#__PURE__*/e(Rd,{onClick:()=>window.open(C.connector,"_blank"),children:[C.icon&&("string"==typeof C.icon?/*#__PURE__*/t(vd,{src:C.icon}):/*#__PURE__*/t(C.icon,{})),/*#__PURE__*/t(Bd,{children:C.name})]}),f?.chains.some((e=>e.startsWith("eip155")))&&!C&&/*#__PURE__*/e(Rd,{onClick:()=>H({...f,chains:f.chains.filter((e=>e.startsWith("eip155")))}),children:[f.icon&&("string"==typeof f.icon?/*#__PURE__*/t(vd,{src:f.icon}):/*#__PURE__*/t(f.icon,{})),/*#__PURE__*/t(Bd,{children:f.label}),/*#__PURE__*/t(Od,{children:/*#__PURE__*/t(md,{})})]}),f?.chains.some((e=>e.startsWith("solana")))&&!C&&/*#__PURE__*/e(Rd,{onClick:()=>H({...f,chains:f.chains.filter((e=>e.startsWith("solana")))}),children:[f.icon&&("string"==typeof f.icon?/*#__PURE__*/t(vd,{src:f.icon}):/*#__PURE__*/t(f.icon,{})),/*#__PURE__*/t(Bd,{children:f.label}),/*#__PURE__*/t(Od,{children:/*#__PURE__*/t(gd,{})})]}),P&&/*#__PURE__*/e(n,{children:[!(E>0)&&/*#__PURE__*/t(Ud,{children:d("connectWallet.noWalletsFound")}),E>0&&!v&&/*#__PURE__*/t("div",{style:{maxHeight:56*Math.min(N.length,5)+5,width:"100%"},children:/*#__PURE__*/t("div",{style:{height:`${V.getTotalSize()}px`,width:"100%",position:"relative"},children:V.getVirtualItems().map((e=>/*#__PURE__*/t(Ld,{index:e.index,style:{position:"absolute",top:0,left:0,height:`${e.size}px`,transform:`translateY(${e.start}px)`},data:{wallets:N,walletChainType:h,handleWalletClick:H}},e.key)))})})]})]})]}),/*#__PURE__*/e(Vr.Footer,{children:[C&&!v&&"string"!=typeof C.connector&&"error"===x&&/*#__PURE__*/t(Vr.Actions,{children:/*#__PURE__*/t(tr,{style:{width:"100%",alignItems:"center"},variant:"error",onClick:()=>_(C.connector,{name:C.name,icon:C.icon}),children:d("connectWallet.retry")})}),!!(y&&y.legal.privacyPolicyUrl&&y.legal.termsAndConditionsUrl)&&/*#__PURE__*/t(ji,{app:y,alwaysShowImplicitConsent:!0}),/*#__PURE__*/t(Vr.Watermark,{})]})]})};let Fd=/*#__PURE__*/Ne.div.withConfig({displayName:"StickySearchContainer",componentId:"sc-3f4ad407-0"})(["position:sticky;margin-top:-3px;padding-top:3px;top:-3px;z-index:1;background:var(--privy-color-background);padding-bottom:calc(var(--screen-space) / 2);"]),Dd=/*#__PURE__*/Ne.div.withConfig({displayName:"WalletListContainer",componentId:"sc-3f4ad407-1"})(["display:flex;flex-direction:column;gap:","px;"],5),Rd=/*#__PURE__*/Ne.button.withConfig({displayName:"Button",componentId:"sc-3f4ad407-2"})(["&&{gap:0.5rem;align-items:center;display:flex;position:relative;text-align:left;font-weight:500;transition:background 200ms ease-in;width:calc(100% - 4px);border-radius:var(--privy-border-radius-md);padding:0.75em;border:1px solid var(--privy-color-foreground-4);justify-content:space-between;}&:hover{background:var(--privy-color-background-2);}"]),Od=/*#__PURE__*/Ne.span.withConfig({displayName:"ButtonBadge",componentId:"sc-3f4ad407-3"})(["display:flex;align-items:center;justify-content:end;position:relative;& > svg{border-radius:var(--privy-border-radius-full);stroke-width:2.5;width:100%;max-height:1rem;max-width:1rem;flex-shrink:0;}& > svg:not(:last-child){border-radius:var(--privy-border-radius-full);margin-right:-0.375rem;}"]),Ud=/*#__PURE__*/Ne.div.withConfig({displayName:"EmptyContainer",componentId:"sc-3f4ad407-4"})(["height:60px;display:flex;align-items:center;justify-content:center;text-align:center;"]),Bd=/*#__PURE__*/Ne.span.withConfig({displayName:"WalletName",componentId:"sc-3f4ad407-5"})(["text-overflow:ellipsis;white-space:nowrap;color:var(--privy-color-foreground);font-weight:400;flex:1;"]),zd=/*#__PURE__*/Ne(Zc).withConfig({displayName:"StyledCopyableText",componentId:"sc-3f4ad407-6"})(["&&{margin:0.5rem auto 0 auto;}"]);const Vd=({...n})=>/*#__PURE__*/e("svg",{xmlns:"http://www.w3.org/2000/svg",width:"25",height:"25",viewBox:"0 0 25 25",fill:"none",...n,children:[/*#__PURE__*/e("g",{clipPath:"url(#clip0_2856_1743)",children:[/*#__PURE__*/t("path",{d:"M22.1673 8.24075V16.3642C22.1673 17.3256 21.3421 18.105 20.3241 18.105H17.0028M22.1673 8.24075C22.1673 7.27936 21.3421 6.5 20.3241 6.5H11.5302M22.1673 8.24075V8.42852C22.1673 9.03302 21.8352 9.59423 21.2901 9.91105L15.1463 13.4818C14.5539 13.8261 13.8067 13.8261 13.2143 13.4818L10.1621 11.5401",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"}),/*#__PURE__*/t("path",{d:"M3.12913 6.64816C0.508085 12.9507 3.49251 20.1847 9.79504 22.8057L11.5068 23.5176C12.4522 23.9108 13.7783 23.2222 14.1714 22.2768L14.6054 21.2333C14.7687 20.8406 14.6438 20.3871 14.3024 20.1334L11.2872 17.8927C10.9878 17.6702 10.5843 17.6488 10.2632 17.8384L9.11575 18.5156C8.78274 18.7121 8.3597 18.6844 8.07552 18.4221C5.94293 16.4542 4.77629 13.6264 4.90096 10.7273C4.91757 10.3409 5.19796 10.023 5.57269 9.92753L6.86381 9.59869C7.22522 9.50664 7.49627 9.20696 7.55169 8.83815L8.10986 5.12321C8.17306 4.70259 7.94188 4.29293 7.54915 4.1296L6.50564 3.69564C5.56026 3.30248 4.23416 3.99103 3.84101 4.9364L3.12913 6.64816Z",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})]}),/*#__PURE__*/t("defs",{children:/*#__PURE__*/t("clipPath",{id:"clip0_2856_1743",children:/*#__PURE__*/t("rect",{x:"0.5",y:"0.5",width:"24",height:"24",rx:"6",fill:"white"})})})]}),Hd=e=>{let t=localStorage.getItem("-walletlink:https://www.walletlink.org:Addresses")?.split(" ").filter((e=>ge(e,{strict:!0}))).map((e=>pe(e)));return!!t?.length&&!!e?.linkedAccounts.filter((e=>"wallet"==e.type&&t.includes(e.address))).length};let jd=/*#__PURE__*/x({plugins:{current:{}}});const $d=({children:e})=>{let n=k({});/*#__PURE__*/return t(jd.Provider,{value:{plugins:n},children:e})},qd=(...e)=>{let{plugins:t}=C(jd);I((()=>{for(let n of e)t.current[n.id]=n;return()=>{for(let n of e)delete t.current[n.id]}}),[t])},Gd=()=>{let{plugins:e}=C(jd);return S((t=>e.current[t]),[e])},Zd=Symbol("solana-ledger-plugin"),Qd=({title:e="You don't have access to this app",subtitle:n="Have you been invited?",ctaText:a="Try another account",ctaLink:i,onCtaClick:r})=>/*#__PURE__*/t(Qr,{title:e,subtitle:n,icon:c,iconVariant:"warning",primaryCta:{label:a,onClick:()=>{i?window.open(i,"_blank"):r?.()}},watermark:!0}),Yd={component:()=>{let{navigate:e}=Ni(),n=Z(),a=n?.allowlistConfig.errorTitle||"You don't have access to this app",i=n?.allowlistConfig.errorDetail||"Have you been invited?",r=n?.allowlistConfig.errorCtaText||"Try another account",o=n?.allowlistConfig.errorCtaLink;/*#__PURE__*/return t(Qd,{title:a,subtitle:i,ctaText:r,ctaLink:o??void 0,onCtaClick:()=>{e(ay)}})}},Kd=({status:e,title:n,description:i,userIntentRequired:r,retriesRemaining:o,hasSelectedCta:l,onContinue:s,onRetry:c})=>{let p=A((()=>{switch(e){case"loading":default:return;case"success":return r?{label:l?"Continuing...":"Continue",onClick:s,disabled:l,loading:l}:void 0;case"error":return o>0?{label:"Retry",onClick:c}:void 0}}),[e,l,s,c]),h=A((()=>({loading:"loading",ready:"subtle",disabled:"subtle",success:"success",error:"error"}[e]||"loading")),[e]);/*#__PURE__*/return t(Qr,{icon:"loading"===e||"ready"===e?void 0:"success"===e?a:d,iconVariant:h,title:n,subtitle:i,primaryCta:p,watermark:!0})},Xd={component:()=>{let{lastScreen:e,data:n,navigate:a,setModalData:i}=Ni(),{status:r,token:o,waitForResult:l,reset:s,execute:c}=ma(),d=k([]),p=e=>{d.current=[e,...d.current]},[h,u]=T(!0);I((()=>(p(setTimeout(u,1e3,!1)),()=>{d.current.forEach((e=>clearTimeout(e))),d.current=[]})),[]);let[m,g]=T(""),[y,f]=T("Checking that you are a human..."),[w,v]=T(!1),[b,C]=T(3),x=n?.captchaModalData,A=async t=>{try{await(x?.callback(t)),x?.onSuccessNavigateTo&&a(x?.onSuccessNavigateTo,!1)}catch(t){if(t instanceof ha)return;i({errorModalData:{error:t,previousScreen:e||ay}}),a(x?.onErrorNavigateTo||xc,!1)}};I((()=>{"success"===r?p(setTimeout((async()=>{let e=await l();!e||x?.userIntentRequired||A(e)}),1e3)):"ready"===r&&p(setTimeout((()=>{"ready"===r&&c()}),500))}),[r]),I((()=>{if(!h)switch(r){case"success":g("Success!"),f("CAPTCHA passed successfully."),x?.userIntentRequired||setTimeout((()=>{v(!0),A(o)}),2e3);break;case"loading":g(""),f("Checking that you are a human...");break;case"error":g("Something went wrong"),f(b<=0?"If you use an adblocker or VPN, try disabling and re-attempting.":"You did not pass CAPTCHA. Please try again.")}}),[r,h,w]);/*#__PURE__*/return t(Kd,{status:r,title:m,description:y,userIntentRequired:x?.userIntentRequired,retriesRemaining:b,hasSelectedCta:w,onContinue:()=>{v(!0),A(o)},onRetry:async()=>{if(b<=0)return;C((e=>e-1)),s(),c();let e=await l();!e||x?.userIntentRequired||A(e)}})}},Jd=e=>/*#__PURE__*/t("svg",{id:"Layer_1",xmlns:"http://www.w3.org/2000/svg",viewBox:"-0.625 12.48 397.647 399.546",width:"2500",height:"674",preserveAspectRatio:"none",...e,children:/*#__PURE__*/t("g",{children:/*#__PURE__*/t("path",{fill:"#333745",d:"M 333.9 12.8 L 150.9 12.8 L 150.9 258.4 L 396.5 258.4 L 396.5 76.7 C 396.6 42.2 368.4 12.8 333.9 12.8 Z M 94.7 12.8 L 64 12.8 C 29.5 12.8 0 40.9 0 76.8 L 0 107.5 L 94.7 107.5 L 94.7 12.8 Z M 0 165 L 94.7 165 L 94.7 259.7 L 0 259.7 L 0 165 Z M 301.9 410.6 L 332.6 410.6 C 367.1 410.6 396.6 382.5 396.6 346.6 L 396.6 316 L 301.9 316 L 301.9 410.6 Z M 150.9 316 L 245.6 316 L 245.6 410.7 L 150.9 410.7 L 150.9 316 Z M 0 316 L 0 346.7 C 0 381.2 28.1 410.7 64 410.7 L 94.7 410.7 L 94.7 316 L 0 316 Z"})})}),ep=({onContinueWithLedger:n,onContinueWithoutLedger:a,title:i="Phantom supports Ledger",subtitle:r="Are you using a Ledger hardware wallet?\nContinue to sign with Ledger"})=>/*#__PURE__*/t(Qr,{title:i,subtitle:/*#__PURE__*/t(ap,{children:r}),primaryCta:{label:"Continue with Ledger",onClick:n},secondaryCta:{label:"Continue without Ledger",onClick:a},watermark:!0,children:/*#__PURE__*/e(np,{children:[/*#__PURE__*/t(ci,{style:{width:"48px",height:"48px"}}),/*#__PURE__*/t(u,{strokeWidth:2,color:"var(--privy-color-icon-subtle)",width:22,height:22}),/*#__PURE__*/t(Jd,{style:{width:"48px",height:"48px"}})]})});const tp={component:function(){let{data:e,setModalData:n,navigate:a}=Ni();/*#__PURE__*/return t(ep,{onContinueWithLedger:function(){n({...e,login:{...e?.login,isSigningInWithLedgerSolana:!0}}),a(cp)},onContinueWithoutLedger:function(){n({...e,login:{...e?.login,isSigningInWithLedgerSolana:!1}}),a(cp)}})}};let np=/*#__PURE__*/Ne.div.withConfig({displayName:"IconContainer",componentId:"sc-218811f1-0"})(["display:flex;align-items:center;justify-content:center;gap:8px;margin-bottom:var(--screen-space);"]),ap=/*#__PURE__*/Ne.span.withConfig({displayName:"SubtitleText",componentId:"sc-218811f1-1"})(["white-space:pre-wrap;"]);const ip=({style:e,...n})=>/*#__PURE__*/t("svg",{width:"40",height:"40",viewBox:"0 0 40 40",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:{height:"38px",width:"38px",...e},...n,children:/*#__PURE__*/t("path",{d:"M20 13.6V20M20 26.4H20.016M36 20C36 28.8365 28.8366 36 20 36C11.1635 36 4.00001 28.8365 4.00001 20C4.00001 11.1634 11.1635 3.99999 20 3.99999C28.8366 3.99999 36 11.1634 36 20Z",stroke:"currentColor",strokeWidth:"3.2",strokeLinecap:"round",strokeLinejoin:"round"})}),rp=({title:e="Unable to sign in",subtitle:n="This is a test application that has reached its user limit. To allow more users, this app needs to be upgraded to production.",onGoBack:a})=>/*#__PURE__*/t(Qr,{title:e,subtitle:n,icon:ip,iconVariant:"subtle",primaryCta:{label:"Go back",onClick:a},showBack:!0,onBack:a,watermark:!0}),op={component:()=>{let{navigate:e}=Ni();/*#__PURE__*/return t(rp,{onGoBack:()=>{e(ay)}})}},lp=e=>e?.privyErrorCode===P.LINKED_TO_ANOTHER_USER?Ya.ERROR_USER_EXISTS:e instanceof Qa&&!e.details.default?e.details:e instanceof qa?Ya.ERROR_TIMED_OUT:e?.privyErrorCode===P.CANNOT_LINK_MORE_OF_TYPE?Ya.ERROR_USER_LIMIT_REACHED:Ya.ERROR_WALLET_CONNECTION,sp=({walletLogo:a,title:i,subtitle:r,signSuccess:o,errorMessage:l,connectSuccess:s,separateConnectAndSign:c,signing:d,walletConnectRedirectUri:p,walletConnectFallbackUniversalUri:h,hasTabbedAway:u,showCoinbaseWalletResetCta:m,numRetries:g,onBack:y,onSign:f,onRetry:w,onCoinbaseReset:v,onDifferentWallet:b})=>{let{t:C}=dd(),x=m?{label:"Use a different wallet",onClick:v,disabled:o}:l===Ya.ERROR_USER_EXISTS&&y?{label:"Use a different wallet",onClick:b}:s&&!o&&c?{label:d?"Signing":"Sign with your wallet",onClick:f,disabled:d}:!o&&l?.retryable&&g<2?{label:"Retry",onClick:w,disabled:!1}:o||l?void 0:{label:C("connectionStatus.connecting"),onClick:()=>{},disabled:!0};/*#__PURE__*/return t(Qr,{title:i,subtitle:r,icon:a,iconVariant:"loading",iconLoadingStatus:{success:o,fail:!!l},primaryCta:x,onBack:y,watermark:!0,children:!s&&p&&!u&&/*#__PURE__*/e(dp,{children:[C("connectionStatus.stillHere")," ",/*#__PURE__*/t(Ys,{href:p,target:"_blank",variant:"underlined",size:"sm",children:C("connectionStatus.tryConnectingAgain")}),h&&/*#__PURE__*/e(n,{children:[" ",C("connectionStatus.or")," ",/*#__PURE__*/t(Ys,{href:h,target:"_blank",variant:"underlined",size:"sm",children:C("connectionStatus.useDifferentLink")})]})]})})},cp={component:()=>{let e,[n,a]=T(!1),[i,r]=T(!1),[o,l]=T(void 0),{authenticated:s,logout:c}=_i(),{navigate:d,navigateBack:p,lastScreen:h,currentScreen:u,setModalData:m,data:g}=Ni(),y=Z(),{t:f}=dd(),{getAuthFlow:w,walletConnectionStatus:v,closePrivyModal:b,initLoginWithWallet:C,loginWithWallet:x,updateWallets:A,createAnalyticsEvent:N}=O(),{walletConnectors:E}=_i(),[_,M]=T(0),{user:W}=_i(),L=Gd(),[F]=T(W?.linkedAccounts.length||0),[D,R]=T(""),[U,B]=T(""),[z,V]=T(!1),{hasTabbedAway:H}=function(){let[e,t]=T(!1),n=S((()=>{document.hidden&&t(!0)}),[]);return I((()=>(document.addEventListener("visibilitychange",n),()=>document.removeEventListener("visibilitychange",n))),[n]),{hasTabbedAway:e,reset:()=>t(!1)}}(),{enabled:$,token:q}=ma(),G=Oa(v?.connector?.walletClientType||"unknown"),Q=Oe&&"wallet_connect_v2"===v?.connector?.connectorType||Oe&&"coinbase_wallet"===v?.connector?.connectorType||Oe&&"base_account"===v?.connector?.connectorType||Oe&&"injected"===v?.connector?.connectorType&&"phantom"===v?.connector?.walletClientType||Oe&&"solana_adapter"===v?.connector?.connectorType&&"mobile_wallet_adapter"===v.connector.walletClientType,Y="connected"===v?.status,K="switching_to_supported_chain"===v?.status;I((()=>{let e=w(),t=e instanceof $n||e instanceof Gn?e:void 0;Y&&"solana"===v.connector?.chainType&&"phantom"===v.connector?.walletClientType&&L(Zd)&&void 0===g?.login?.isSigningInWithLedgerSolana?d(tp,!1):(Y&&!t&&(!$||q||s?C(v.connectedWallet,q,g?.login?.disableSignup,g?.login?.isSigningInWithLedgerSolana?"transaction":"plain").then((()=>{V(!0)})):(m({captchaModalData:{callback:e=>C(v.connectedWallet,e,g?.login?.disableSignup,g?.login?.isSigningInWithLedgerSolana?"transaction":"plain").then((()=>{V(!0)})),userIntentRequired:!1,onSuccessNavigateTo:cp,onErrorNavigateTo:xc}}),d(Xd,!1))),t instanceof Gn&&g?.login?.isSigningInWithLedgerSolana&&(t.messageType="transaction"),t&&Q&&Y&&!t.preparedMessage?t.buildMessage():t&&!Q&&Y&&(i||(async()=>{r(!0),l(void 0);try{"wallet_connect_v2"===v?.connector?.connectorType&&"metamask"===v?.connector?.walletClientType&&await na(2500),await J()}catch(e){console.warn("Auto-prompted signature failed",e)}finally{r(!1)}})()))}),[_,Y,z]),I((()=>{if(W&&n){let e=ne-500;if(y?.legal.requireUsersAcceptTerms&&!W.hasAcceptedTerms){let t=setTimeout((()=>{d(Bc)}),e);return()=>clearTimeout(t)}if(tc(W,y.embeddedWallets)){let t=setTimeout((()=>{m({createWallet:{onSuccess:()=>{},onFailure:e=>{console.error(e),N({eventName:"embedded_wallet_creation_failure_logout",payload:{error:e,screen:"ConnectionStatusScreen"}}),c()},callAuthOnSuccessOnClose:!0}}),d(Uc)}),e);return()=>clearTimeout(t)}A();let t=setTimeout((()=>b({shouldCallAuthOnSuccess:!0,isSuccess:!0})),ne);return()=>clearTimeout(t)}}),[W,n]);let X=e=>{if(e?.privyErrorCode!==P.ALLOWLIST_REJECTED){if(e?.privyErrorCode===P.USER_LIMIT_REACHED)return console.error(new j(e).toString()),void d(op);if(e?.privyErrorCode!==P.USER_DOES_NOT_EXIST)return e?.privyErrorCode===P.ACCOUNT_TRANSFER_REQUIRED&&e.data?.data?.nonce?(m({accountTransfer:{nonce:e.data?.data?.nonce,account:w()?.meta.address,displayName:e.data?.data?.account?.displayName,externalWalletMetadata:{walletClientType:w()?.meta.walletClientType,chainId:w()?.meta.chainId,connectorType:w()?.meta.connectorType},linkMethod:w()instanceof $n?"siwe":"siws",embeddedWalletAddress:e.data?.data?.otherUser?.embeddedWalletAddress}}),void d(Fc)):void l(lp(e));d(ac)}else d(Yd)};async function J(){try{await x(),a(!0)}catch(e){X(e)}finally{r(!1)}}I((()=>{v?.connectError&&X(v?.connectError)}),[v]),((e,t)=>{let n=k((()=>{}));I((()=>{n.current=e})),I((()=>{if(null!==t){let e=setInterval((()=>n.current()),t||0);return()=>clearInterval(e)}}),[t])})((()=>{let e="wallet_connect_v2"===ee&&v?.connector instanceof Ti?v.connector.redirectUri:void 0;e&&R(e);let t="wallet_connect_v2"===ee&&v?.connector instanceof Ti?v.connector.fallbackUniversalRedirectUri:void 0;t&&B(t)}),v?.connector instanceof Ti&&!D?500:null);let ee=v?.connector?.connectorType||"injected",te=v?.connector?.walletClientType||"unknown",ae=G?.metadata?.shortName||G?.name||v?.connector?.walletBranding.name||"Browser Extension",ie=G?.image_url?.md||v?.connector?.walletBranding.icon||(e=>/*#__PURE__*/t(li,{...e})),re="Browser Extension"===ae?ae.toLowerCase():ae;e=n?f("connectionStatus.successfullyConnected",{walletName:re}):o?f("connectionStatus.errorTitle",{errorMessage:o.message}):K?"Switching networks":Y?i&&Q?"Signing":"Sign to verify":`Waiting for ${re}`;let oe=f("connectionStatus.checkOtherWindows");n?oe=F===(W?.linkedAccounts.length||0)?"Wallet was already linked.":"You're good to go!":_>=2&&o?oe="Unable to connect wallet":o?oe=o.detail:K?oe="Switch your wallet to the requested network.":Y&&Q?oe="Sign the message in your wallet to verify it belongs to you.":"metamask"===te&&Oe?oe="Click continue to open and connect MetaMask.":"metamask"===te?oe="For the best experience, connect only one wallet at a time.":"wallet_connect"===ee?oe="Open your mobile wallet app to continue":"coinbase_wallet"===ee?Yn()||(oe=Hd(W)?"Continue with the Coinbase app. Not the right wallet? Reset your connection below.":"Confirm in the Coinbase app/popup to continue."):g?.login?.isSigningInWithLedgerSolana&&(oe="Ledger requires a transaction to verify your identity. You'll sign a transaction that performs no onchain action.");let le=E?.walletConnectors?.find((e=>"coinbase_wallet"===e.walletClientType)),se="coinbase_wallet"===te&&(Hd(W)||o===Ya.ERROR_USER_EXISTS);/*#__PURE__*/return t(sp,{walletLogo:ie,title:e,subtitle:oe,signSuccess:n,errorMessage:o,connectSuccess:Y,separateConnectAndSign:Q,signing:i,walletConnectRedirectUri:D,walletConnectFallbackUniversalUri:U,hasTabbedAway:H,showCoinbaseWalletResetCta:se,numRetries:_,onBack:h&&u!==h?p:void 0,onSign:()=>{r(!0),J()},onRetry:()=>{M(_+1),l(void 0),Y?(r(!0),J()):v?.connectRetry()},onCoinbaseReset:()=>{le&&le?.disconnect()},onDifferentWallet:p})}};let dp=/*#__PURE__*/Ne.p.withConfig({displayName:"RedirectLinksContainer",componentId:"sc-29c59393-0"})(["text-align:center;color:var(--privy-color-foreground-2);font-size:14px;line-height:22px;margin:16px 0;"]);const pp={component:()=>{let{setWalletConnectionStatus:e,closePrivyModal:n,inProgressAuthFlowRef:a}=O(),{data:i,navigate:r}=Ni(),o=Z(),l=ee(),s=i?.externalConnectWallet?.description,c=k(i?.externalConnectWallet?.walletList??o.appearance.walletList),d=k(i?.externalConnectWallet?.walletChainType??o.appearance.walletChainType),p=c.current,h=d.current,u="link"===a.current?void 0:()=>r(ay);/*#__PURE__*/return t(Pd,{walletList:p,walletChainType:h,onClose:n,onConnect:S((({connector:t,wallet:n})=>{l("connectWallet","onSuccess",{wallet:n}),e({status:"connected",connectedWallet:n,connector:t,connectError:null,connectRetry:()=>null}),r(cp,!i?.externalConnectWallet?.preSelectedWalletId)}),[e,r,i?.login?.disableSignup,i?.externalConnectWallet?.preSelectedWalletId]),onConnectError:e=>{e instanceof L?(console.warn(e.cause?e.cause:e.message),l("connectWallet","onError",e.privyErrorCode||P.GENERIC_CONNECT_WALLET_ERROR)):(console.warn(e),l("connectWallet","onError",P.UNKNOWN_CONNECT_WALLET_ERROR))},onBack:u,customDescription:s||"",preSelectedWalletId:i?.externalConnectWallet?.preSelectedWalletId,app:o})},isUnauthenticatedScreem:!0},hp=({children:n,theme:a})=>/*#__PURE__*/e(up,{$theme:a,children:[/*#__PURE__*/t(Ut,{width:"20px",height:"20px",color:"var(--privy-color-icon-subtle)",strokeWidth:2,style:{flexShrink:0}}),/*#__PURE__*/t(mp,{$theme:a,children:n})]});let up=/*#__PURE__*/Ne.div.withConfig({displayName:"Container",componentId:"sc-1b5ed8dd-0"})(["display:flex;gap:0.75rem;background-color:var(--privy-color-background-2);align-items:flex-start;padding:1rem;border-radius:0.75rem;"]),mp=/*#__PURE__*/Ne.div.withConfig({displayName:"Content",componentId:"sc-1b5ed8dd-1"})(["color:",";font-size:1rem;font-weight:400;line-height:1.5;flex:1;text-align:left;"],(e=>"dark"===e.$theme?"var(--privy-color-foreground-2)":"var(--privy-color-foreground)"));const gp=/*#__PURE__*/Ne.span.withConfig({displayName:"Subtitle",componentId:"sc-7a11f796-0"})(["margin-top:4px;color:var(--privy-color-foreground);text-align:center;font-size:0.875rem;font-weight:400;line-height:1.375rem;&& a{color:var(--privy-color-accent);}"]),yp=/*#__PURE__*/Ne.span.withConfig({displayName:"Title",componentId:"sc-66de63c-0"})(["color:var(--privy-color-foreground);font-size:1.125rem;font-weight:600;line-height:1.875rem;text-align:center;"]),fp=/*#__PURE__*/Ne.span.withConfig({displayName:"LabelXs",componentId:"sc-4c43f9fd-0"})(["color:var(--privy-color-foreground-3);font-size:0.75rem;font-weight:500;line-height:1.125rem;"]),wp=/*#__PURE__*/Ee(["&&{border-width:1px;padding:0.5rem 1rem;}width:100%;text-align:left;border:solid 1px var(--privy-color-foreground-4);border-radius:var(--privy-border-radius-md);display:flex;justify-content:space-between;align-items:center;",""],(e=>"error"===e.$state?"\n border-color: var(--privy-color-error);\n background: var(--privy-color-error-bg);\n ":"")),vp=/*#__PURE__*/Ne.div.withConfig({displayName:"Box",componentId:"sc-7252360a-0"})(["",""],wp);let bp=/*#__PURE__*/Ne(vp).withConfig({displayName:"StyledBox",componentId:"sc-4010d8f3-0"})(["&&{padding:0.75rem;height:56px;}"]),Cp=/*#__PURE__*/Ne.div.withConfig({displayName:"WalletContent",componentId:"sc-4010d8f3-1"})(["display:flex;align-items:center;justify-content:space-between;width:100%;"]),xp=/*#__PURE__*/Ne.div.withConfig({displayName:"AddressContainer",componentId:"sc-4010d8f3-2"})(["display:flex;flex-direction:column;gap:0;"]),kp=/*#__PURE__*/Ne.div.withConfig({displayName:"BalanceText",componentId:"sc-4010d8f3-3"})(["font-size:12px;line-height:1rem;color:var(--privy-color-foreground-3);"]),Tp=/*#__PURE__*/Ne(fp).withConfig({displayName:"TitleLabel",componentId:"sc-4010d8f3-4"})(["text-align:left;margin-bottom:0.5rem;"]),Ap=/*#__PURE__*/Ne(id).withConfig({displayName:"StyledErrorMessage",componentId:"sc-4010d8f3-5"})(["margin-top:0.25rem;"]),Ip=/*#__PURE__*/Ne(lr).withConfig({displayName:"CopyButton",componentId:"sc-4010d8f3-6"})(["&&{gap:0.375rem;font-size:14px;}"]);const Sp=({errMsg:a,balance:i,address:l,className:s,title:c,showCopyButton:d=!1})=>{let[p,h]=T(!1);return I((()=>{if(p){let e=setTimeout((()=>h(!1)),3e3);return()=>clearTimeout(e)}}),[p]),/*#__PURE__*/e("div",{children:[c&&/*#__PURE__*/t(Tp,{children:c}),/*#__PURE__*/t(bp,{className:s,$state:a?"error":void 0,children:/*#__PURE__*/e(Cp,{children:[/*#__PURE__*/e(xp,{children:[/*#__PURE__*/t(rc,{address:l,showCopyIcon:!1}),void 0!==i&&/*#__PURE__*/t(kp,{children:i})]}),d&&/*#__PURE__*/t(Ip,{onClick:function(e){e.stopPropagation(),navigator.clipboard.writeText(l).then((()=>h(!0))).catch(console.error)},size:"sm",children:/*#__PURE__*/e(n,p?{children:["Copied",/*#__PURE__*/t(r,{size:14})]}:{children:["Copy",/*#__PURE__*/t(o,{size:14})]})})]})}),a&&/*#__PURE__*/t(Ap,{children:a})]})};function Np({rpcConfig:e,appId:t,address:n,chain:a}){let{chains:i}=O(),[r,o]=T(0n),[l,s]=T(!1),c=A((()=>{let n=a||i[0];if(n)return ce({chain:a,transport:de(Xn(n,e,t))})}),[a,e,t]),d=S((async()=>{if(!n||!c)return;s(!0);let e=await c.getBalance({address:n}).catch(console.error);return e?(o(e),s(!1),e):void 0}),[c,n,o]);return I((()=>{d().catch(console.error)}),[]),{balance:r,isLoading:l,reloadBalance:d}}const Ep="sdk_fiat_on_ramp_completed_with_status";async function _p({rpc:e,address:t}){return(await e.getBalance(t,{commitment:"confirmed"}).send()).value??0n}function Mp(e){switch(e){case"solana:mainnet":return"Solana";case"solana:devnet":return"Devnet";case"solana:testnet":return"Testnet"}}function Wp(e){let[t]=Object.entries(go[e]).find((([e,t])=>"USDC"===t.symbol))??[];return t}const Lp=async({chain:e,address:t,appId:n,rpcConfig:a,erc20Address:i})=>{let r=ce({chain:e,transport:de(Xn(e,a,n))});return{balance:await r.readContract({address:i,abi:Pp,functionName:"balanceOf",args:[t]}).catch((()=>0n)),chain:e}};let Pp=[{constant:!0,inputs:[{name:"_owner",type:"address"}],name:"balanceOf",outputs:[{name:"balance",type:"uint256"}],payable:!1,stateMutability:"view",type:"function"}];const Fp={component:()=>{let{wallets:a}=hl(),{connectors:i}=O(),r=i.filter(xi).flatMap((e=>e.wallets)),{data:o,setModalData:l,navigate:s,lastScreen:c}=Ni(),{rpcConfig:d,appId:p,createAnalyticsEvent:h,closePrivyModal:u}=O(),m=Z(),[g,y]=T(void 0),[f,w]=T(!1),v=o?.funding,{reloadBalance:b}=Np({rpcConfig:d,appId:p,address:"ethereum"===v.chainType?v.address:void 0,chain:"ethereum"===v.chainType?v.chain:void 0}),C="solana"===v.chainType,x=C?v.isUSDC?"USDC":"SOL":v.erc20Address?v.erc20ContractInfo?.symbol:v.chain.nativeCurrency.symbol,k=C?r.find((({address:e})=>e===v.address)):a.find((({address:e})=>ea(e)===ea(v.address)));if(!v)return l({errorModalData:{error:Error("Couldn't find funding config"),previousScreen:c||Om},funding:o?.funding,solanaFundingData:o?.solanaFundingData,sendTransaction:o?.sendTransaction}),s(xc),/*#__PURE__*/t(n,{});I((()=>{let e=C?async function(){if("solana"!==v.chainType)return;let e=m.solanaRpcs[v.chain];e?(v.isUSDC?async function({rpc:e,address:t,mintAddress:n}){let a=await e.getTokenAccountsByOwner(t,{mint:n},{encoding:"jsonParsed",commitment:"confirmed"}).send(),i=a.value[0]?.account;return i?BigInt(i.data.parsed.info.tokenAmount.amount):0n}({rpc:e.rpc,address:v.address,mintAddress:Wp(v.chain)}):_p({rpc:e.rpc,address:v.address})).then((e=>{let t=BigInt(e);g&&t>g&&(w(!0),h({eventName:Ep,payload:{provider:"manual",status:"success",chainType:"solana",address:k?.address,value:v.isUSDC?me(t-g,6):me(t-g,9),token:v.isUSDC?"USDC":"SOL"}})),y(t)})):console.warn("Unable to load solana rpc, skipping balance")}:async function(){"ethereum"===v.chainType&&(async()=>{if(!v.erc20Address)return await b()??BigInt(0);{let{balance:e}=await Lp({chain:v.chain,address:v.address,erc20Address:v.erc20Address,rpcConfig:d,appId:p});return e}})().then((e=>{g&&e>g&&(w(!0),h({eventName:Ep,payload:{provider:"manual",status:"success",chainType:"ethereum",address:k?.address,chainId:v.chain.id,value:me(e-g,v.erc20ContractInfo?.decimals??18),token:v.erc20ContractInfo?.symbol??v.erc20Address??"ETH"}})),y(e)})).catch((()=>y(void 0)))},t=setInterval(e,2e3);return e(),()=>clearInterval(t)}),[g]);let S=A((()=>null==g?"":v.isUSDC?Ze({amount:g,decimals:6}):C?wo(g,3,!0,!0):null!=v.erc20ContractInfo?.decimals?Ze({amount:g,decimals:v.erc20ContractInfo.decimals}):Qe({wei:g})),[g,C,v]),N="ethereum"===v.chainType?v.chain.name:Mp(v.chain),E=A((()=>""===v.uiConfig?.receiveFundsTitle?null:/*#__PURE__*/t(yp,{children:v.uiConfig?.receiveFundsTitle??`Receive ${v.amount} ${x??""}`.trim()})),[v.uiConfig?.receiveFundsTitle,v.amount,x]),_=A((()=>""===v.uiConfig?.receiveFundsSubtitle?null:/*#__PURE__*/t(gp,{children:v.uiConfig?.receiveFundsSubtitle??`Scan this code or copy your wallet address to receive funds on ${N}.`})),[v.uiConfig?.receiveFundsSubtitle,N]),M="solana"===v.chainType&&v.isUSDC&&Wp(v.chain)?`?spl-token=${Wp(v.chain)}`:"";/*#__PURE__*/return e(n,{children:[/*#__PURE__*/t(su,{}),E,_,/*#__PURE__*/e(Mo,{style:{gap:"1rem",margin:E||_?"1rem 0":"0"},children:[/*#__PURE__*/t(ad,{url:`${v.chainType}:${v.address}${M}`,size:200,squareLogoElement:Dp}),/*#__PURE__*/e(hp,{theme:m.appearance.palette.colorScheme,children:["Make sure to send funds on ",N,"."]}),/*#__PURE__*/t(Sp,{title:"Your wallet",errMsg:void 0,showCopyButton:!0,balance:`${S} ${x}`,address:v.address}),f&&/*#__PURE__*/t(ar,{onClick:()=>u({shouldCallAuthOnSuccess:!1,isSuccess:!0}),children:"Continue"})]}),/*#__PURE__*/t($i,{})]})}};let Dp=({...e})=>/*#__PURE__*/t(ii,{color:"black",...e});let Rp=[{constant:!0,inputs:[{name:"_owner",type:"address"}],name:"balanceOf",outputs:[{name:"balance",type:"uint256"}],payable:!1,stateMutability:"view",type:"function"}];const Op=async({address:e,chain:t,rpcConfig:n,privyAppId:a})=>{try{let i=ce({chain:t,transport:de(Xn(t,n,a))}),[r,o]=await Promise.all([i.readContract({abi:Up,address:e,functionName:"symbol"}),i.readContract({abi:Up,address:e,functionName:"decimals"})]);return{decimals:o,symbol:r}}catch(e){return console.log(e),null}};let Up=[{inputs:[],name:"decimals",outputs:[{internalType:"uint8",name:"",type:"uint8"}],stateMutability:"view",type:"function"},{inputs:[],name:"symbol",outputs:[{internalType:"string",name:"",type:"string"}],stateMutability:"view",type:"function"}],Bp=2n**256n-1n;const zp=({amount:e,decimals:t})=>e===Bp?"Maximum":Intl.NumberFormat(void 0,{maximumFractionDigits:t}).format(Number(e)/10**t);let Vp=({data:n})=>{let a=n=>"object"==typeof n&&null!==n?/*#__PURE__*/t(jp,{children:Object.entries(n).map((([t,n])=>/*#__PURE__*/e("li",{children:[/*#__PURE__*/e("strong",{children:[t,":"]})," ",a(n)]},t)))}):/*#__PURE__*/t("span",{children:String(n)});/*#__PURE__*/return t("div",{children:a(n)})};const Hp=/*#__PURE__*/Ne.div.withConfig({displayName:"Message",componentId:"sc-70ec2a4f-0"})(["margin-top:1.5rem;background-color:var(--privy-color-background-2);border-radius:var(--privy-border-radius-md);padding:12px;text-align:left;max-height:310px;overflow:scroll;white-space:pre-wrap;width:100%;font-size:0.875rem;font-weight:400;color:var(--privy-color-foreground);line-height:1.5;-ms-overflow-style:none;scrollbar-width:none;&::-webkit-scrollbar{display:none;}"]);let jp=/*#__PURE__*/Ne.ul.withConfig({displayName:"MessageList",componentId:"sc-70ec2a4f-1"})(["margin-left:12px !important;white-space:nowrap;&:first-child{margin-left:0 !important;}strong{font-weight:500 !important;}"]);const $p=({data:e,className:n})=>/*#__PURE__*/t(Hp,{className:n,children:/*#__PURE__*/t(Vp,{data:e})});let qp=/*#__PURE__*/Ne.div.withConfig({displayName:"Container",componentId:"sc-31acb2bc-0"})(["display:flex;flex-direction:column;min-height:72px;"]);var Gp=({onBack:n,details:a})=>/*#__PURE__*/e(qp,{children:[/*#__PURE__*/t(yr,{backFn:n}),/*#__PURE__*/t($p,{data:a}),/*#__PURE__*/t($i,{})]});const Zp=/*#__PURE__*/Ne.span.withConfig({displayName:"LabelSm",componentId:"sc-6c002d6-0"})(["color:var(--privy-color-foreground-3);font-size:0.875rem;font-weight:400;line-height:1.375rem;"]),Qp=/*#__PURE__*/Ne(Zp).withConfig({displayName:"LabelSmPrimary",componentId:"sc-6c002d6-1"})(["color:var(--privy-color-accent);"]),Yp=/*#__PURE__*/Ne(Zp).withConfig({displayName:"InteractiveLabel",componentId:"sc-b57d0824-0"})(["cursor:pointer;display:inline-flex;gap:8px;align-items:center;color:var(--privy-color-accent);svg{fill:var(--privy-color-accent);}"]),Kp=/*#__PURE__*/Ne.span.withConfig({displayName:"Rows",componentId:"sc-b764aab6-0"})(["display:flex;flex-direction:column;gap:0.35rem;width:100%;"]),Xp=/*#__PURE__*/Ne.span.withConfig({displayName:"Row",componentId:"sc-b764aab6-1"})(["display:flex;width:100%;justify-content:space-between;gap:0.5rem;"]);let Jp=/*#__PURE__*/_e(["from,to{background:var(--privy-color-foreground-4);color:var(--privy-color-foreground-4);}50%{background:var(--privy-color-foreground-accent);color:var(--privy-color-foreground-accent);}"]);const eh=/*#__PURE__*/Ee(["",""],(e=>e.$isLoading?/*#__PURE__*/Ee(["width:35%;animation:"," 2s linear infinite;border-radius:var(--privy-border-radius-sm);"],Jp):"")),th=/*#__PURE__*/Ne.span.withConfig({displayName:"Value",componentId:"sc-72aa026-0"})(["color:var(--privy-color-foreground);font-size:0.875rem;font-weight:500;line-height:1.375rem;word-break:break-all;text-align:right;",""],eh);var nh=({iconUrl:n,value:a,symbol:i,usdValue:r,nftName:o,nftCount:l,decimals:s,$isLoading:c})=>{if(c)/*#__PURE__*/return t(ah,{$isLoading:c});let d=a&&r&&s?function(e,t,n){let a=parseFloat(e),i=parseFloat(n);if(0===a||0===i||Number.isNaN(a)||Number.isNaN(i))return e;let r=Math.ceil(-Math.log10(.01/(i/a))),o=Math.pow(10,r=Math.max(r=Math.min(r,t),1)),l=+(Math.floor(a*o)/o).toFixed(r).replace(/\.?0+$/,"");return Intl.NumberFormat(void 0,{maximumFractionDigits:t}).format(l)}(a,s,r):a;/*#__PURE__*/return e("div",{children:[/*#__PURE__*/e(ah,{$isLoading:c,children:[n&&/*#__PURE__*/t(rh,{src:n,alt:"Token icon"}),l&&l>1?l+"x":void 0," ",o,d," ",i]}),r&&/*#__PURE__*/e(ih,{$isLoading:c,children:["$",r]})]})};let ah=/*#__PURE__*/Ne.span.withConfig({displayName:"Value",componentId:"sc-991db279-0"})(["color:var(--privy-color-foreground);font-size:0.875rem;font-weight:500;line-height:1.375rem;word-break:break-all;text-align:right;display:flex;justify-content:flex-end;",""],eh);const ih=/*#__PURE__*/Ne.span.withConfig({displayName:"Subvalue",componentId:"sc-991db279-1"})(["color:var(--privy-color-foreground-2);font-size:12px;font-weight:400;line-height:18px;word-break:break-all;text-align:right;display:flex;justify-content:flex-end;",""],eh);let rh=/*#__PURE__*/Ne.img.withConfig({displayName:"TokenIcon",componentId:"sc-991db279-2"})(["height:14px;width:14px;margin-right:4px;object-fit:contain;"]);const oh=a=>{let{chain:i,transactionDetails:r,isTokenContractInfoLoading:o,symbol:l}=a,{action:s,functionName:c}=r;/*#__PURE__*/return t(vp,{children:/*#__PURE__*/e(Kp,{children:["transaction"!==s&&/*#__PURE__*/e(Xp,{children:[/*#__PURE__*/t(Zp,{children:"Action"}),/*#__PURE__*/t(th,{children:c})]}),"mint"===c&&"args"in r&&r.args.filter((e=>e)).map(((n,a)=>/*#__PURE__*/e(Xp,{children:[/*#__PURE__*/t(Zp,{children:`Param ${a}`}),/*#__PURE__*/t(th,{children:"string"==typeof n&&he(n)?/*#__PURE__*/t(rc,{address:n,url:i?.blockExplorers?.default?.url,showCopyIcon:!1}):n?.toString()})]},a))),"setApprovalForAll"===c&&r.operator&&/*#__PURE__*/e(Xp,{children:[/*#__PURE__*/t(Zp,{children:"Operator"}),/*#__PURE__*/t(th,{children:/*#__PURE__*/t(rc,{address:r.operator,url:i?.blockExplorers?.default?.url,showCopyIcon:!1})})]}),"setApprovalForAll"===c&&void 0!==r.approved&&/*#__PURE__*/e(Xp,{children:[/*#__PURE__*/t(Zp,{children:"Set approval to"}),/*#__PURE__*/t(th,{children:r.approved?"true":"false"})]}),"transfer"===c||"transferFrom"===c||"safeTransferFrom"===c||"approve"===c?/*#__PURE__*/e(n,{children:["formattedAmount"in r&&r.formattedAmount&&/*#__PURE__*/e(Xp,{children:[/*#__PURE__*/t(Zp,{children:"Amount"}),/*#__PURE__*/e(th,{$isLoading:o,children:[r.formattedAmount," ",l]})]}),"tokenId"in r&&r.tokenId&&/*#__PURE__*/e(Xp,{children:[/*#__PURE__*/t(Zp,{children:"Token ID"}),/*#__PURE__*/t(th,{children:r.tokenId.toString()})]})]}):null,"safeBatchTransferFrom"===c&&/*#__PURE__*/e(n,{children:["amounts"in r&&r.amounts&&/*#__PURE__*/e(Xp,{children:[/*#__PURE__*/t(Zp,{children:"Amounts"}),/*#__PURE__*/t(th,{children:r.amounts.join(", ")})]}),"tokenIds"in r&&r.tokenIds&&/*#__PURE__*/e(Xp,{children:[/*#__PURE__*/t(Zp,{children:"Token IDs"}),/*#__PURE__*/t(th,{children:r.tokenIds.join(", ")})]})]}),"approve"===c&&r.spender&&/*#__PURE__*/e(Xp,{children:[/*#__PURE__*/t(Zp,{children:"Spender"}),/*#__PURE__*/t(th,{children:/*#__PURE__*/t(rc,{address:r.spender,url:i?.blockExplorers?.default?.url,showCopyIcon:!1})})]}),("transferFrom"===c||"safeTransferFrom"===c||"safeBatchTransferFrom"===c)&&r.transferFrom&&/*#__PURE__*/e(Xp,{children:[/*#__PURE__*/t(Zp,{children:"Transferring from"}),/*#__PURE__*/t(th,{children:/*#__PURE__*/t(rc,{address:r.transferFrom,url:i?.blockExplorers?.default?.url,showCopyIcon:!1})})]}),("transferFrom"===c||"safeTransferFrom"===c||"safeBatchTransferFrom"===c)&&r.transferTo&&/*#__PURE__*/e(Xp,{children:[/*#__PURE__*/t(Zp,{children:"Transferring to"}),/*#__PURE__*/t(th,{children:/*#__PURE__*/t(rc,{address:r.transferTo,url:i?.blockExplorers?.default?.url,showCopyIcon:!1})})]})]})})},lh=({children:n,theme:a})=>/*#__PURE__*/e(sh,{$theme:a,children:[/*#__PURE__*/t(Ve,{width:"20px",height:"20px",color:"var(--privy-color-icon-error)",strokeWidth:2,style:{flexShrink:0}}),/*#__PURE__*/t(ch,{$theme:a,children:n})]});let sh=/*#__PURE__*/Ne.div.withConfig({displayName:"Container",componentId:"sc-34910fd1-0"})(["display:flex;gap:0.75rem;background-color:var(--privy-color-error-bg);align-items:flex-start;padding:1rem;border-radius:0.75rem;"]),ch=/*#__PURE__*/Ne.div.withConfig({displayName:"Content",componentId:"sc-34910fd1-1"})(["color:",";font-size:1rem;font-weight:400;line-height:1.5;flex:1;text-align:left;"],(e=>"dark"===e.$theme?"var(--privy-color-foreground-2)":"var(--privy-color-foreground)"));const dh=({children:n,theme:a})=>/*#__PURE__*/e(ph,{$theme:a,children:[/*#__PURE__*/t(Be,{width:"20px",height:"20px",color:"var(--privy-color-icon-warning)",strokeWidth:2,style:{flexShrink:0}}),/*#__PURE__*/t(hh,{$theme:a,children:n})]});let ph=/*#__PURE__*/Ne.div.withConfig({displayName:"Container",componentId:"sc-a77c2854-0"})(["display:flex;gap:0.75rem;background-color:var(--privy-color-warn-bg);align-items:flex-start;padding:1rem;border-radius:0.75rem;"]),hh=/*#__PURE__*/Ne.div.withConfig({displayName:"Content",componentId:"sc-a77c2854-1"})(["color:",";font-size:1rem;font-weight:400;line-height:1.5;flex:1;text-align:left;"],(e=>"dark"===e.$theme?"var(--privy-color-foreground-2)":"var(--privy-color-foreground)"));const uh=({variant:a,setPreventMaliciousTransaction:i,colorScheme:r="light",preventMaliciousTransaction:o})=>"warn"===a?/*#__PURE__*/t(mh,{children:/*#__PURE__*/e(dh,{theme:r,children:[/*#__PURE__*/t("span",{style:{fontWeight:"500"},children:"Warning: Suspicious transaction"}),/*#__PURE__*/t("br",{}),"This has been flagged as a potentially deceptive request. Approving could put your assets or funds at risk."]})}):"error"===a?/*#__PURE__*/t(n,{children:/*#__PURE__*/e(mh,{children:[/*#__PURE__*/t(lh,{theme:r,children:/*#__PURE__*/e("div",{children:[/*#__PURE__*/t("strong",{children:"This is a malicious transaction"}),/*#__PURE__*/t("br",{}),"This transaction transfers tokens to a known malicious address. Proceeding may result in the loss of valuable assets."]})}),/*#__PURE__*/e(gh,{children:[/*#__PURE__*/t(ds,{color:"var(--privy-color-error)",checked:!o,readOnly:!0,onClick:()=>i(!o)}),/*#__PURE__*/t("span",{children:"I understand and want to proceed anyways."})]})]})}):null;let mh=/*#__PURE__*/Ne.div.withConfig({displayName:"BannerContainer",componentId:"sc-ab8a5a0b-0"})(["margin-top:1.5rem;"]),gh=/*#__PURE__*/Ne.div.withConfig({displayName:"CheckboxContainer",componentId:"sc-ab8a5a0b-1"})(["display:flex;align-items:center;gap:0.5rem;margin-top:0.75rem;"]);const yh=({transactionIndex:e,maxIndex:t})=>"number"!=typeof e||0===t?"":` (${e+1} / ${t+1})`,fh=({img:a,submitError:i,prepareError:r,onClose:o,action:l,title:s,subtitle:c,to:d,tokenAddress:p,network:h,missingFunds:u,fee:m,from:g,cta:y,disabled:f,chain:w,isSubmitting:v,isPreparing:b,isTokenPriceLoading:C,isTokenContractInfoLoading:x,isSponsored:k,symbol:A,balance:I,onClick:S,transactionDetails:N,transactionIndex:E,maxIndex:_,onBack:M,chainName:W,validation:L,hasScanDetails:P,setIsScanDetailsOpen:F,preventMaliciousTransaction:D,setPreventMaliciousTransaction:R,tokensSent:O,tokensReceived:U,isScanning:B,isCancellable:z,functionName:V})=>{let{showTransactionDetails:H,setShowTransactionDetails:j,hasMoreDetails:$,isErc20Ish:q}=(e=>{let[t,n]=T(!1),a=!0,i=!1;return(!e||e.isErc20Ish||"transaction"===e.action)&&(a=!1),a&&(i=Object.entries(e||{}).some((([e,t])=>t&&!["action","isErc20Ish","isNFTIsh"].includes(e)))),{showTransactionDetails:t,setShowTransactionDetails:n,hasMoreDetails:a&&i,isErc20Ish:e?.isErc20Ish}})(N),G=Z(),Q=q&&x||b||C||B;/*#__PURE__*/return e(n,{children:[/*#__PURE__*/t(yr,{onClose:o,backFn:M}),a&&/*#__PURE__*/t(xh,{children:a}),/*#__PURE__*/e(yp,{style:{marginTop:a?"1.5rem":0},children:[s,/*#__PURE__*/t(yh,{maxIndex:_,transactionIndex:E})]}),/*#__PURE__*/t(gp,{children:c}),/*#__PURE__*/e(Kp,{style:{marginTop:"2rem"},children:[(!!O[0]||Q)&&/*#__PURE__*/e(Xp,{children:[U.length>0?/*#__PURE__*/t(Zp,{children:"Send"}):/*#__PURE__*/t(Zp,{children:"approve"===l?"Approval amount":"Amount"}),/*#__PURE__*/t("div",{className:"flex flex-col",children:O.map(((e,n)=>/*#__PURE__*/t(nh,{iconUrl:e.iconUrl,value:"setApprovalForAll"===V?"All":e.value,usdValue:e.usdValue,symbol:e.symbol,nftName:e.nftName,nftCount:e.nftCount,decimals:e.decimals},n)))})]}),U.length>0&&/*#__PURE__*/e(Xp,{children:[/*#__PURE__*/t(Zp,{children:"Receive"}),/*#__PURE__*/t("div",{className:"flex flex-col",children:U.map(((e,n)=>/*#__PURE__*/t(nh,{iconUrl:e.iconUrl,value:e.value,usdValue:e.usdValue,symbol:e.symbol,nftName:e.nftName,nftCount:e.nftCount,decimals:e.decimals},n)))})]}),N&&"spender"in N&&N?.spender?/*#__PURE__*/e(Xp,{children:[/*#__PURE__*/t(Zp,{children:"Spender"}),/*#__PURE__*/t(th,{children:/*#__PURE__*/t(rc,{address:N.spender,url:w?.blockExplorers?.default?.url})})]}):null,d&&/*#__PURE__*/e(Xp,{children:[/*#__PURE__*/t(Zp,{children:"To"}),/*#__PURE__*/t(th,{children:/*#__PURE__*/t(rc,{address:d,url:w?.blockExplorers?.default?.url,showCopyIcon:!0})})]}),p&&/*#__PURE__*/e(Xp,{children:[/*#__PURE__*/t(Zp,{children:"Token address"}),/*#__PURE__*/t(th,{children:/*#__PURE__*/t(rc,{address:p,url:w?.blockExplorers?.default?.url})})]}),/*#__PURE__*/e(Xp,{children:[/*#__PURE__*/t(Zp,{children:"Network"}),/*#__PURE__*/t(th,{children:h})]}),/*#__PURE__*/e(Xp,{children:[/*#__PURE__*/t(Zp,{children:"Estimated fee"}),/*#__PURE__*/t(th,{$isLoading:b||C||void 0===k,children:k?/*#__PURE__*/e(kh,{children:[/*#__PURE__*/e(Th,{children:["Sponsored by ",G.name]}),/*#__PURE__*/t(kt,{height:16,width:16})]}):m})]}),$&&!P&&/*#__PURE__*/e(n,{children:[/*#__PURE__*/t(Xp,{className:"cursor-pointer",onClick:()=>j(!H),children:/*#__PURE__*/e(Qp,{className:"flex items-center gap-x-1",children:["Details"," ",/*#__PURE__*/t(At,{style:{width:"0.75rem",marginLeft:"0.25rem",transform:H?"rotate(180deg)":void 0}})]})}),H&&N&&/*#__PURE__*/t(oh,{action:l,chain:w,transactionDetails:N,isTokenContractInfoLoading:x,symbol:A})]}),P&&/*#__PURE__*/t(Xp,{children:/*#__PURE__*/e(Yp,{onClick:()=>F(!0),children:[/*#__PURE__*/t("span",{className:"text-color-primary",children:"Details"}),/*#__PURE__*/t(Tt,{height:"14px",width:"14px",strokeWidth:"2"})]})})]}),/*#__PURE__*/t(Mi,{}),i?/*#__PURE__*/t(id,{style:{marginTop:"2rem"},children:i.message}):r&&0===E?
20
- /*#__PURE__*/t(id,{style:{marginTop:"2rem"},children:r.shortMessage??Ch}):null,/*#__PURE__*/t(uh,{variant:L,preventMaliciousTransaction:D,setPreventMaliciousTransaction:R}),/*#__PURE__*/t(vh,{$useSmallMargins:!(!r&&!i&&"warn"!==L&&"error"!==L),address:g,balance:I,errMsg:b||r||i||!u?void 0:`Add funds on ${w?.name??W} to complete transaction.`}),/*#__PURE__*/t(ar,{style:{marginTop:"1rem"},loading:v,disabled:f||b,onClick:S,children:y}),z&&/*#__PURE__*/t(pr,{style:{marginTop:"1rem"},onClick:o,isSubmitting:!1,children:"Not now"}),/*#__PURE__*/t($i,{})]})},wh=({img:a,title:i,subtitle:r,cta:o,instructions:l,network:s,blockExplorerUrl:c,isMissingFunds:d,submitError:p,parseError:h,total:u,swap:m,transactingWalletAddress:g,fee:y,balance:f,disabled:w,isSubmitting:v,isPreparing:b,isTokenPriceLoading:C,onClick:x,onClose:k,onBack:A,isSponsored:I})=>{let S=b||C,[N,E]=T(!1),_=Z();/*#__PURE__*/return e(n,{children:[/*#__PURE__*/t(yr,{onClose:k,backFn:A}),a&&/*#__PURE__*/t(xh,{children:a}),/*#__PURE__*/t(yp,{style:{marginTop:a?"1.5rem":0},children:i}),/*#__PURE__*/t(gp,{children:r}),/*#__PURE__*/e(Kp,{style:{marginTop:"2rem",marginBottom:".5rem"},children:[(u||S)&&/*#__PURE__*/e(Xp,{children:[/*#__PURE__*/t(Zp,{children:"Amount"}),/*#__PURE__*/t(th,{$isLoading:S,children:u})]}),m&&/*#__PURE__*/e(Xp,{children:[/*#__PURE__*/t(Zp,{children:"Swap"}),/*#__PURE__*/t(th,{children:m})]}),s&&/*#__PURE__*/e(Xp,{children:[/*#__PURE__*/t(Zp,{children:"Network"}),/*#__PURE__*/t(th,{children:s})]}),(y||S||void 0!==I)&&/*#__PURE__*/e(Xp,{children:[/*#__PURE__*/t(Zp,{children:"Estimated fee"}),/*#__PURE__*/t(th,{$isLoading:S,children:I&&!S?/*#__PURE__*/e(kh,{children:[/*#__PURE__*/e(Th,{children:["Sponsored by ",_.name]}),/*#__PURE__*/t(kt,{height:16,width:16})]}):y})]})]}),/*#__PURE__*/t(Xp,{children:/*#__PURE__*/e(Yp,{onClick:()=>E((e=>!e)),children:[/*#__PURE__*/t("span",{children:"Advanced"}),/*#__PURE__*/t(At,{height:"16px",width:"16px",strokeWidth:"2",style:{transition:"all 300ms",transform:N?"rotate(180deg)":void 0}})]})}),N&&/*#__PURE__*/t(n,{children:l.map(((n,a)=>"sol-transfer"===n.type?/*#__PURE__*/e(bh,{children:[/*#__PURE__*/t(Xp,{children:/*#__PURE__*/e(fp,{children:["Transfer ",n.withSeed?"with seed":""]})}),/*#__PURE__*/e(Xp,{children:[/*#__PURE__*/t(Zp,{children:"Amount"}),/*#__PURE__*/e(th,{children:[Ze({amount:n.value,decimals:n.token.decimals})," ",n.token.symbol]})]}),!!n.toAccount&&/*#__PURE__*/e(Xp,{children:[/*#__PURE__*/t(Zp,{children:"Destination"}),/*#__PURE__*/t(th,{children:/*#__PURE__*/t(rc,{address:n.toAccount,url:c})})]})]},a):"spl-transfer"===n.type?/*#__PURE__*/e(bh,{children:[/*#__PURE__*/t(Xp,{children:/*#__PURE__*/e(fp,{children:["Transfer ",n.token.symbol]})}),/*#__PURE__*/e(Xp,{children:[/*#__PURE__*/t(Zp,{children:"Amount"}),/*#__PURE__*/t(th,{children:n.value.toString()})]}),!!n.fromAta&&/*#__PURE__*/e(Xp,{children:[/*#__PURE__*/t(Zp,{children:"Source"}),/*#__PURE__*/t(th,{children:/*#__PURE__*/t(rc,{address:n.fromAta,url:c})})]}),!!n.toAta&&/*#__PURE__*/e(Xp,{children:[/*#__PURE__*/t(Zp,{children:"Destination"}),/*#__PURE__*/t(th,{children:/*#__PURE__*/t(rc,{address:n.toAta,url:c})})]}),!!n.token.address&&/*#__PURE__*/e(Xp,{children:[/*#__PURE__*/t(Zp,{children:"Token"}),/*#__PURE__*/t(th,{children:/*#__PURE__*/t(rc,{address:n.token.address,url:c})})]})]},a):"ata-creation"===n.type?/*#__PURE__*/e(bh,{children:[/*#__PURE__*/t(Xp,{children:/*#__PURE__*/t(fp,{children:"Create token account"})}),/*#__PURE__*/e(Xp,{children:[/*#__PURE__*/t(Zp,{children:"Program ID"}),/*#__PURE__*/t(th,{children:/*#__PURE__*/t(rc,{address:n.program,url:c})})]}),!!n.owner&&/*#__PURE__*/e(Xp,{children:[/*#__PURE__*/t(Zp,{children:"Owner"}),/*#__PURE__*/t(th,{children:/*#__PURE__*/t(rc,{address:n.owner,url:c})})]})]},a):"create-account"===n.type?/*#__PURE__*/e(bh,{children:[/*#__PURE__*/t(Xp,{children:/*#__PURE__*/e(fp,{children:["Create account ",n.withSeed?"with seed":""]})}),!!n.account&&/*#__PURE__*/e(Xp,{children:[/*#__PURE__*/t(Zp,{children:"Account"}),/*#__PURE__*/t(th,{children:/*#__PURE__*/t(rc,{address:n.account,url:c})})]}),/*#__PURE__*/e(Xp,{children:[/*#__PURE__*/t(Zp,{children:"Amount"}),/*#__PURE__*/e(th,{children:[Ze({amount:n.value,decimals:9})," SOL"]})]})]},a):"spl-init-account"===n.type?/*#__PURE__*/e(bh,{children:[/*#__PURE__*/t(Xp,{children:/*#__PURE__*/t(fp,{children:"Initialize token account"})}),!!n.account&&/*#__PURE__*/e(Xp,{children:[/*#__PURE__*/t(Zp,{children:"Account"}),/*#__PURE__*/t(th,{children:/*#__PURE__*/t(rc,{address:n.account,url:c})})]}),!!n.mint&&/*#__PURE__*/e(Xp,{children:[/*#__PURE__*/t(Zp,{children:"Mint"}),/*#__PURE__*/t(th,{children:/*#__PURE__*/t(rc,{address:n.mint,url:c})})]}),!!n.owner&&/*#__PURE__*/e(Xp,{children:[/*#__PURE__*/t(Zp,{children:"Owner"}),/*#__PURE__*/t(th,{children:/*#__PURE__*/t(rc,{address:n.owner,url:c})})]})]},a):"spl-close-account"===n.type?/*#__PURE__*/e(bh,{children:[/*#__PURE__*/t(Xp,{children:/*#__PURE__*/t(fp,{children:"Close token account"})}),!!n.source&&/*#__PURE__*/e(Xp,{children:[/*#__PURE__*/t(Zp,{children:"Source"}),/*#__PURE__*/t(th,{children:/*#__PURE__*/t(rc,{address:n.source,url:c})})]}),!!n.destination&&/*#__PURE__*/e(Xp,{children:[/*#__PURE__*/t(Zp,{children:"Destination"}),/*#__PURE__*/t(th,{children:/*#__PURE__*/t(rc,{address:n.destination,url:c})})]}),!!n.owner&&/*#__PURE__*/e(Xp,{children:[/*#__PURE__*/t(Zp,{children:"Owner"}),/*#__PURE__*/t(th,{children:/*#__PURE__*/t(rc,{address:n.owner,url:c})})]})]},a):"spl-sync-native"===n.type?/*#__PURE__*/e(bh,{children:[/*#__PURE__*/t(Xp,{children:/*#__PURE__*/t(fp,{children:"Sync native"})}),/*#__PURE__*/e(Xp,{children:[/*#__PURE__*/t(Zp,{children:"Program ID"}),/*#__PURE__*/t(th,{children:/*#__PURE__*/t(rc,{address:n.program,url:c})})]})]},a):"raydium-swap-base-input"===n.type?/*#__PURE__*/e(bh,{children:[/*#__PURE__*/t(Xp,{children:/*#__PURE__*/e(fp,{children:["Raydium swap"," ",n.tokenIn&&n.tokenOut?`${n.tokenIn.symbol} → ${n.tokenOut.symbol}`:""]})}),/*#__PURE__*/e(Xp,{children:[/*#__PURE__*/t(Zp,{children:"Amount in"}),/*#__PURE__*/t(th,{children:n.amountIn.toString()})]}),/*#__PURE__*/e(Xp,{children:[/*#__PURE__*/t(Zp,{children:"Minimum amount out"}),/*#__PURE__*/t(th,{children:n.minimumAmountOut.toString()})]}),n.mintIn&&/*#__PURE__*/e(Xp,{children:[/*#__PURE__*/t(Zp,{children:"Token in"}),/*#__PURE__*/t(th,{children:/*#__PURE__*/t(rc,{address:n.mintIn,url:c})})]}),n.mintOut&&/*#__PURE__*/e(Xp,{children:[/*#__PURE__*/t(Zp,{children:"Token out"}),/*#__PURE__*/t(th,{children:/*#__PURE__*/t(rc,{address:n.mintOut,url:c})})]})]},a):"raydium-swap-base-output"===n.type?/*#__PURE__*/e(bh,{children:[/*#__PURE__*/t(Xp,{children:/*#__PURE__*/e(fp,{children:["Raydium swap"," ",n.tokenIn&&n.tokenOut?`${n.tokenIn.symbol} → ${n.tokenOut.symbol}`:""]})}),/*#__PURE__*/e(Xp,{children:[/*#__PURE__*/t(Zp,{children:"Max amount in"}),/*#__PURE__*/t(th,{children:n.maxAmountIn.toString()})]}),/*#__PURE__*/e(Xp,{children:[/*#__PURE__*/t(Zp,{children:"Amount out"}),/*#__PURE__*/t(th,{children:n.amountOut.toString()})]}),n.mintIn&&/*#__PURE__*/e(Xp,{children:[/*#__PURE__*/t(Zp,{children:"Token in"}),/*#__PURE__*/t(th,{children:/*#__PURE__*/t(rc,{address:n.mintIn,url:c})})]}),n.mintOut&&/*#__PURE__*/e(Xp,{children:[/*#__PURE__*/t(Zp,{children:"Token out"}),/*#__PURE__*/t(th,{children:/*#__PURE__*/t(rc,{address:n.mintOut,url:c})})]})]},a):"jupiter-swap-shared-accounts-route"===n.type?/*#__PURE__*/e(bh,{children:[/*#__PURE__*/t(Xp,{children:/*#__PURE__*/e(fp,{children:["Jupiter swap"," ",n.tokenIn&&n.tokenOut?`${n.tokenIn.symbol} → ${n.tokenOut.symbol}`:""]})}),/*#__PURE__*/e(Xp,{children:[/*#__PURE__*/t(Zp,{children:"In amount"}),/*#__PURE__*/t(th,{children:n.inAmount.toString()})]}),/*#__PURE__*/e(Xp,{children:[/*#__PURE__*/t(Zp,{children:"Quoted out amount"}),/*#__PURE__*/t(th,{children:n.quotedOutAmount.toString()})]}),n.mintIn&&/*#__PURE__*/e(Xp,{children:[/*#__PURE__*/t(Zp,{children:"Token in"}),/*#__PURE__*/t(th,{children:/*#__PURE__*/t(rc,{address:n.mintIn,url:c})})]}),n.mintOut&&/*#__PURE__*/e(Xp,{children:[/*#__PURE__*/t(Zp,{children:"Token out"}),/*#__PURE__*/t(th,{children:/*#__PURE__*/t(rc,{address:n.mintOut,url:c})})]})]},a):"jupiter-swap-exact-out-route"===n.type?/*#__PURE__*/e(bh,{children:[/*#__PURE__*/t(Xp,{children:/*#__PURE__*/e(fp,{children:["Jupiter swap"," ",n.tokenIn&&n.tokenOut?`${n.tokenIn.symbol} → ${n.tokenOut.symbol}`:""]})}),/*#__PURE__*/e(Xp,{children:[/*#__PURE__*/t(Zp,{children:"Quoted in amount"}),/*#__PURE__*/t(th,{children:n.quotedInAmount.toString()})]}),/*#__PURE__*/e(Xp,{children:[/*#__PURE__*/t(Zp,{children:"Amount out"}),/*#__PURE__*/t(th,{children:n.outAmount.toString()})]}),n.mintIn&&/*#__PURE__*/e(Xp,{children:[/*#__PURE__*/t(Zp,{children:"Token in"}),/*#__PURE__*/t(th,{children:/*#__PURE__*/t(rc,{address:n.mintIn,url:c})})]}),n.mintOut&&/*#__PURE__*/e(Xp,{children:[/*#__PURE__*/t(Zp,{children:"Token out"}),/*#__PURE__*/t(th,{children:/*#__PURE__*/t(rc,{address:n.mintOut,url:c})})]})]},a):/*#__PURE__*/e(bh,{children:[/*#__PURE__*/e(Xp,{children:[/*#__PURE__*/t(Zp,{children:"Program ID"}),/*#__PURE__*/t(th,{children:/*#__PURE__*/t(rc,{address:n.program,url:c})})]}),/*#__PURE__*/e(Xp,{children:[/*#__PURE__*/t(Zp,{children:"Data"}),/*#__PURE__*/t(th,{children:n.discriminator})]})]},a)))}),/*#__PURE__*/t(Mi,{}),p?/*#__PURE__*/t(id,{style:{marginTop:"2rem"},children:p.message}):h?/*#__PURE__*/t(id,{style:{marginTop:"2rem"},children:Ch}):null,/*#__PURE__*/t(vh,{$useSmallMargins:!(!h&&!p),title:"",address:g,balance:f,errMsg:b||h||p||!d?void 0:"Add funds on Solana to complete transaction."}),/*#__PURE__*/t(ar,{style:{marginTop:"1rem"},loading:v,disabled:w||b,onClick:x,children:o}),/*#__PURE__*/t($i,{})]})};let vh=/*#__PURE__*/Ne(Sp).withConfig({displayName:"StyledWalletInfoCard",componentId:"sc-cbe5ab37-0"})(["",""],(e=>e.$useSmallMargins?"margin-top: 0.5rem;":"margin-top: 2rem;")),bh=/*#__PURE__*/Ne(Kp).withConfig({displayName:"InstructionRows",componentId:"sc-cbe5ab37-1"})(["margin-top:0.5rem;border:1px solid var(--privy-color-foreground-4);border-radius:var(--privy-border-radius-sm);padding:0.5rem;"]),Ch="There was an error preparing your transaction. Your transaction request will likely fail.",xh=/*#__PURE__*/Ne.div.withConfig({displayName:"ImageContainer",componentId:"sc-cbe5ab37-2"})(["display:flex;width:100%;justify-content:center;max-height:40px;> img{object-fit:contain;border-radius:var(--privy-border-radius-sm);}"]),kh=/*#__PURE__*/Ne.span.withConfig({displayName:"SponsoredRow",componentId:"sc-cbe5ab37-3"})(["display:inline-flex;align-items:center;gap:0.3rem;"]),Th=/*#__PURE__*/Ne.span.withConfig({displayName:"SponsoredText",componentId:"sc-cbe5ab37-4"})(["font-size:14px;font-weight:500;color:var(--privy-color-foreground);"]);let Ah=()=>/*#__PURE__*/e(_h,{children:[/*#__PURE__*/t(Wh,{}),/*#__PURE__*/t(Mh,{})]});const Ih=({transactionError:a,chainId:i,onClose:r,onRetry:o,chainType:l,transactionHash:s})=>{let{chains:c}=O(),[d,p]=T(!1),{errorCode:h,errorMessage:u}=((e,t)=>{if("ethereum"===t)return{errorCode:e.details??e.message,errorMessage:e.shortMessage};let n=e.txSignature,a=e?.transactionMessage||"Something went wrong.";if(Array.isArray(e.logs)){let t=e.logs.find((e=>/insufficient (lamports|funds)/gi.test(e)));t&&(a=t)}return{transactionHash:n,errorMessage:a}})(a,l),m=(({chains:e,chainId:t,chainType:n,transactionHash:a})=>"ethereum"===n?e.find((e=>e.id===t))?.blockExplorers?.default.url??"https://etherscan.io":function(e,t){return`https://explorer.solana.com/tx/${e}?chain=${t}`}(a||"",t))({chains:c,chainId:i,chainType:l,transactionHash:s});/*#__PURE__*/return e(n,{children:[/*#__PURE__*/t(yr,{onClose:r}),/*#__PURE__*/e(Sh,{children:[/*#__PURE__*/t(Ah,{}),/*#__PURE__*/t(Nh,{children:h}),/*#__PURE__*/t(Eh,{children:"Please try again."}),/*#__PURE__*/e(Fh,{children:[/*#__PURE__*/t(Ph,{children:"Error message"}),/*#__PURE__*/t(Rh,{$clickable:!1,children:u})]}),s&&/*#__PURE__*/e(Fh,{children:[/*#__PURE__*/t(Ph,{children:"Transaction hash"}),/*#__PURE__*/e(Dh,{children:["Copy this hash to view details about the transaction on a"," ",/*#__PURE__*/t("u",{children:/*#__PURE__*/t("a",{href:m,children:"block explorer"})}),"."]}),/*#__PURE__*/e(Rh,{$clickable:!0,onClick:async()=>{await navigator.clipboard.writeText(s),p(!0)},children:[s,/*#__PURE__*/t(Bh,{clicked:d})]})]}),/*#__PURE__*/t(Lh,{onClick:()=>o({resetNonce:!!s}),children:"Retry transaction"})]}),/*#__PURE__*/t(Gi,{})]})};let Sh=/*#__PURE__*/Ne.div.withConfig({displayName:"TransactionErrorScreenContainer",componentId:"sc-d58f10e6-0"})(["display:flex;flex-direction:column;align-items:center;justify-content:center;"]),Nh=/*#__PURE__*/Ne.span.withConfig({displayName:"ErrorCode",componentId:"sc-d58f10e6-1"})(["color:var(--privy-color-foreground);text-align:center;font-size:1.125rem;font-weight:500;line-height:1.25rem;text-align:center;margin:10px;"]),Eh=/*#__PURE__*/Ne.span.withConfig({displayName:"Subtitle",componentId:"sc-d58f10e6-2"})(["margin-top:4px;margin-bottom:10px;color:var(--privy-color-foreground-3);text-align:center;font-size:0.875rem;font-style:normal;font-weight:400;line-height:20px;letter-spacing:-0.008px;"]),_h=/*#__PURE__*/Ne.div.withConfig({displayName:"CircleContainer",componentId:"sc-d58f10e6-3"})(["position:relative;width:60px;height:60px;margin:10px;display:flex;justify-content:center;align-items:center;"]),Mh=/*#__PURE__*/Ne(Ve).withConfig({displayName:"StyledExclamationCircleIcon",componentId:"sc-d58f10e6-4"})(["position:absolute;width:35px;height:35px;color:var(--privy-color-error);"]),Wh=/*#__PURE__*/Ne.div.withConfig({displayName:"StyledRedCircle",componentId:"sc-d58f10e6-5"})(["position:absolute;width:60px;height:60px;border-radius:50%;background-color:var(--privy-color-error);opacity:0.1;"]),Lh=/*#__PURE__*/Ne(ar).withConfig({displayName:"RetryButton",componentId:"sc-d58f10e6-6"})(["&&{margin-top:24px;}transition:color 350ms ease,background-color 350ms ease;"]),Ph=/*#__PURE__*/Ne.span.withConfig({displayName:"TextBoxTitle",componentId:"sc-d58f10e6-7"})(["width:100%;text-align:left;font-size:0.825rem;color:var(--privy-color-foreground);padding:4px;"]),Fh=/*#__PURE__*/Ne.div.withConfig({displayName:"TextBoxContainer",componentId:"sc-d58f10e6-8"})(["width:100%;margin:5px;display:flex;flex-direction:column;justify-content:center;align-items:center;"]),Dh=/*#__PURE__*/Ne.text.withConfig({displayName:"HelperText",componentId:"sc-d58f10e6-9"})(["position:relative;width:100%;padding:5px;font-size:0.8rem;color:var(--privy-color-foreground-3);text-align:left;word-wrap:break-word;"]),Rh=/*#__PURE__*/Ne.span.withConfig({displayName:"TextBox",componentId:"sc-d58f10e6-10"})(["position:relative;width:100%;background-color:var(--privy-color-background-2);padding:8px 12px;border-radius:10px;margin-top:5px;font-size:14px;color:var(--privy-color-foreground-3);text-align:left;word-wrap:break-word;",""],(e=>e.$clickable&&"cursor: pointer;\n transition: background-color 0.3s;\n padding-right: 45px;\n\n &:hover {\n background-color: var(--privy-color-foreground-4);\n }")),Oh=/*#__PURE__*/Ne(zt).withConfig({displayName:"StyledClipboardIcon",componentId:"sc-d58f10e6-11"})(["position:absolute;top:13px;right:13px;width:24px;height:24px;"]),Uh=/*#__PURE__*/Ne(Bt).withConfig({displayName:"StyledClipboardCheckIcon",componentId:"sc-d58f10e6-12"})(["position:absolute;top:13px;right:13px;width:24px;height:24px;"]),Bh=({clicked:e})=>/*#__PURE__*/t(e?Uh:Oh,{}),zh=({gasUsed:e,effectiveGasPrice:t})=>{if(e&&t)try{return ye(e*t)}catch(e){return}};const Vh=({txn:a,receipt:i,transactionInfo:r,onClose:o,tokenPrice:l,tokenSymbol:s,receiptHeader:c,receiptDescription:d})=>/*#__PURE__*/e(n,{children:[/*#__PURE__*/t(yr,{onClose:o}),/*#__PURE__*/t(Tl,{title:c??"Transaction complete!",description:d??"You're all set."}),/*#__PURE__*/t(ol,{tokenPrice:l,from:i.from,to:i.to,gas:zh(i),txn:a,transactionInfo:r,tokenSymbol:s}),/*#__PURE__*/t(Mi,{}),/*#__PURE__*/t(Hh,{loading:!1,onClick:o,children:"All Done"}),/*#__PURE__*/t(Fo,{}),/*#__PURE__*/t($i,{})]});let Hh=/*#__PURE__*/Ne(ar).withConfig({displayName:"SubmitButton",componentId:"sc-f70d0f7a-0"})(["&&{margin-top:24px;}transition:color 350ms ease,background-color 350ms ease;"]);const jh=[{constant:!1,inputs:[{name:"_salt",type:"bytes32"},{name:"_initializer",type:"bytes"}],name:"deployAccount",outputs:[{name:"",type:"bool"}],payable:!1,stateMutability:"nonpayable",type:"function"}],$h=[{name:"from",type:"address"},{name:"param2",type:"address"},{name:"param3",type:"bytes"},{name:"param4",type:"tuple",components:[]},{type:"tuple",components:[{name:"param5",type:"address"},{name:"param6",type:"uint256"},{name:"param7",type:"uint256"},{name:"encodedInitData",type:"bytes"}]}],qh=[{constant:!1,inputs:[{name:"spender",type:"address"},{name:"value",type:"uint256"}],name:"approve",outputs:[{name:"",type:"bool"}],payable:!1,stateMutability:"nonpayable",type:"function"}],Gh=[{constant:!1,inputs:[{name:"_to",type:"address"},{name:"_value",type:"uint256"}],name:"transfer",outputs:[{name:"",type:"bool"}],payable:!1,stateMutability:"nonpayable",type:"function"}],Zh=[{inputs:[{internalType:"address",name:"to",type:"address"},{internalType:"uint256",name:"amount",type:"uint256"}],name:"mint",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"to",type:"address"},{internalType:"uint256",name:"amount",type:"uint256"}],name:"mint",outputs:[],stateMutability:"payable",type:"function"},{inputs:[{internalType:"address",name:"to",type:"address"}],name:"mint",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"to",type:"address"}],name:"mint",outputs:[],stateMutability:"payable",type:"function"},{inputs:[{internalType:"address",name:"to",type:"address"},{internalType:"uint256",name:"tokenId",type:"uint256"},{internalType:"uint256",name:"quantity",type:"uint256"},{internalType:"bytes",name:"data",type:"bytes"}],name:"mint",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"to",type:"address"},{internalType:"uint256",name:"tokenId",type:"uint256"},{internalType:"uint256",name:"quantity",type:"uint256"},{internalType:"bytes",name:"data",type:"bytes"}],name:"mint",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"payable",type:"function"},{inputs:[{internalType:"address",name:"to",type:"address"},{internalType:"uint256[]",name:"tokenIds",type:"uint256[]"},{internalType:"uint256[]",name:"quantities",type:"uint256[]"},{internalType:"bytes",name:"data",type:"bytes"}],name:"mintBatch",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"to",type:"address"},{internalType:"uint256[]",name:"tokenIds",type:"uint256[]"},{internalType:"uint256[]",name:"quantities",type:"uint256[]"},{internalType:"bytes",name:"data",type:"bytes"}],name:"mintBatch",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"payable",type:"function"},{inputs:[{internalType:"uint256",name:"quantity",type:"uint256"}],name:"mint",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"uint256",name:"quantity",type:"uint256"}],name:"mint",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"payable",type:"function"},{inputs:[{internalType:"address",name:"to",type:"address"}],name:"safeMint",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"to",type:"address"}],name:"safeMint",outputs:[],stateMutability:"payable",type:"function"},{inputs:[{internalType:"address",name:"to",type:"address"},{internalType:"string",name:"uri",type:"string"}],name:"safeMint",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"to",type:"address"},{internalType:"string",name:"uri",type:"string"}],name:"safeMint",outputs:[],stateMutability:"payable",type:"function"},{inputs:[{internalType:"address",name:"to",type:"address"},{internalType:"uint256",name:"tokenId",type:"uint256"}],name:"safeMint",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"to",type:"address"},{internalType:"uint256",name:"tokenId",type:"uint256"}],name:"safeMint",outputs:[],stateMutability:"payable",type:"function"},{inputs:[{internalType:"address",name:"to",type:"address"},{internalType:"uint256",name:"tokenId",type:"uint256"},{internalType:"string",name:"uri",type:"string"}],name:"safeMint",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"to",type:"address"},{internalType:"uint256",name:"tokenId",type:"uint256"},{internalType:"string",name:"uri",type:"string"}],name:"safeMint",outputs:[],stateMutability:"payable",type:"function"},{inputs:[{internalType:"address",name:"to",type:"address"},{internalType:"uint256",name:"amount",type:"uint256"}],name:"batchMint",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"to",type:"address"},{internalType:"uint256",name:"amount",type:"uint256"}],name:"batchMint",outputs:[],stateMutability:"payable",type:"function"}],Qh=[{constant:!1,inputs:[{name:"_from",type:"address"},{name:"_to",type:"address"},{name:"_tokenId",type:"uint256"}],name:"safeTransferFrom",outputs:[{name:"",type:"bool"}],payable:!1,stateMutability:"nonpayable",type:"function"}],Yh=[{constant:!1,inputs:[{name:"_operator",type:"address"},{name:"_approved",type:"bool"}],name:"setApprovalForAll",outputs:[{name:"",type:"bool"}],payable:!1,stateMutability:"nonpayable",type:"function"}],Kh=[{constant:!1,inputs:[{name:"_from",type:"address"},{name:"_to",type:"address"},{name:"_tokenId",type:"uint256"}],name:"transferFrom",outputs:[{name:"",type:"bool"}],payable:!1,stateMutability:"nonpayable",type:"function"}],Xh=[{constant:!1,inputs:[{name:"_from",type:"address"},{name:"_to",type:"address"},{name:"_tokenIds",type:"uint256[]"},{name:"_amounts",type:"uint256[]"},{name:"_data",type:"bytes"}],name:"safeBatchTransferFrom",outputs:[{name:"",type:"bool"}],payable:!1,stateMutability:"nonpayable",type:"function"}],Jh=[{constant:!1,inputs:[{name:"_from",type:"address"},{name:"_to",type:"address"},{name:"_tokenId",type:"uint256"},{name:"_amount",type:"uint256"},{name:"_data",type:"bytes"}],name:"safeTransferFrom",outputs:[{name:"",type:"bool"}],payable:!1,stateMutability:"nonpayable",type:"function"}],eu=(e,t)=>{let n=tu(qh,e);if(n)return{action:"approve",functionName:"approve",isErc20Ish:!0,isNFTIsh:!1,spender:n.args[0],amount:n.args[1]};let a=tu(Gh,e);if(a)return{action:"transfer",functionName:"transfer",isErc20Ish:!0,isNFTIsh:!1,transferTo:a.args[0],amount:a.args[1]};if(!t)return{action:"transaction",functionName:"",isErc20Ish:!1,isNFTIsh:!1};let i=tu(jh,e);if(i&&"string"==typeof i.args[1]){let e=nu(i.args[1]);if(e&&e[4].encodedInitData)return eu(e[4].encodedInitData,t)}let r=tu(Yh,e);if(r)return{action:"approve",functionName:"setApprovalForAll",isNFTIsh:!0,isErc20Ish:!1,operator:r.args[0],approved:r.args[1]};let o=tu(Kh,e);if(o)return{action:"transfer",functionName:"transferFrom",isNFTIsh:!0,isErc20Ish:!1,transferFrom:o.args[0],transferTo:o.args[1],tokenId:o.args[2]};let l=tu(Qh,e);if(l)return{action:"transfer",functionName:"safeTransferFrom",isNFTIsh:!0,isErc20Ish:!1,transferFrom:l.args[0],transferTo:l.args[1],tokenId:l.args[2]};let s=tu(Jh,e);if(s)return{action:"transfer",functionName:"safeTransferFrom",isNFTIsh:!0,isErc20Ish:!1,transferFrom:s.args[0],transferTo:s.args[1],tokenId:s.args[2],amount:s.args[3]};let c=tu(Xh,e);if(c)return{action:"batch transfer",functionName:"safeBatchTransferFrom",isNFTIsh:!0,isErc20Ish:!1,transferFrom:c.args[0],transferTo:c.args[1],tokenIds:c.args[2],amounts:c.args[3]};let d=tu(Zh,e);return d?{action:"mint",functionName:d.functionName,isNFTIsh:!0,isErc20Ish:!1,args:d.args}:{action:"transaction",isErc20Ish:!1,isNFTIsh:!1}};let tu=(e,t)=>{try{let n=fe({abi:e,data:t});return{functionName:n.functionName,args:n.args||[]}}catch(e){return null}},nu=e=>{try{if("string"==typeof e)return we($h,`0x${e.slice(10)}`)}catch(e){return null}},au=e=>`${parseFloat(e).toFixed(2)}`;const iu=(e,t,n,a)=>{let[i,r]=T(null),{walletProxy:o}=O();return I((()=>{i&&r(null),(async()=>{if(!o||!t)return null;let i=[],r=!0,l=await ul(e,n,t,a).catch((t=>(t.message&&t.message.includes("Insufficient balance for transaction")||t.details&&t.details.includes("insufficient funds")?r=!1:i.push(t),e)));return{tx:l,totalGasEstimate:l.gas,hasFunds:r,errors:i}})().then(r)}),[e]),i};let ru=new Qa(new Za("There was an issue preparing your transaction",je.E32603_DEFAULT_INTERNAL_ERROR.eipCode)),ou=(e,t)=>e?.sendTransaction?"transactionRequest"in e.sendTransaction?e.sendTransaction.transactionRequest:e.sendTransaction.transactionRequests[t]:void 0;const lu={component:()=>{let{data:a,onUserCloseViaDialogOrKeybindRef:i,setModalData:r,navigate:o}=Ni(),{client:l,rpcConfig:s,chains:c,closePrivyModal:d,walletProxy:p,showFiatPrices:h}=O(),{user:u}=_i(),m=Z(),[g,y]=T(0),[f,w]=T(0),[v,b]=T(ou(a,g)),[C,x]=T(null),[k,N]=T(),[E,_]=T(!1),[M,W]=T(null),[L,P]=T(null),[F,D]=T(null),[R,U]=T(void 0),[B,z]=T(void 0),[V,H]=T(!1),[j,$]=T(!1),[q,G]=T([]),[Q,Y]=T([]),[K,X]=T("uninitiated"),[J,ee]=T(void 0);if(!v||!a?.sendTransaction||!a?.sendTransaction)/*#__PURE__*/return t(Cc,{error:Error("Invalid transaction request"),allowlistConfig:m.allowlistConfig,onRetry:()=>{a?.sendTransaction?.onFailure(ru),d({shouldCallAuthOnSuccess:!1})}});let{transactingWalletAddress:te}=a.sendTransaction,ae=A((()=>c.find((e=>Number(e.id)===Number(v.chainId)))),[v.chainId]),ie=ae?.nativeCurrency.symbol??"ETH",re=A((()=>eu(v.data,!!m.embeddedWallets.extendedCalldataDecoding)),[v.data]),{action:oe,isErc20Ish:le,isNFTIsh:se,functionName:pe}=re,{toAddress:he,tokenAddress:me}=A((()=>({toAddress:re.isErc20Ish?re.transferTo:v.to??void 0,tokenAddress:re.isErc20Ish?v.to:void 0})),[re]);I((()=>{v.to&&ae&&le&&Op({address:v.to,chain:ae,rpcConfig:m.rpcConfig,privyAppId:m.id}).then(x).catch(console.error)}),[v.to,ae]);let{tokenPrice:ge,isTokenPriceLoading:ye}=dl(v.chainId),{balance:fe}=Np({rpcConfig:m.rpcConfig,appId:m.id,address:te,chain:ae}),we=function({rpcConfig:e,appId:t,address:n,chain:a,tokenInfo:i}){let{chains:r}=O(),[o,l]=T(null),[s,c]=T(!1),d=A((()=>{let n=a||r[0];if(n)return ce({chain:a,transport:de(Ye(n,e,t))})}),[a,e,t]),p=S((async()=>{if(n&&d&&i.address)try{return c(!0),await d.readContract({address:i.address,abi:Rp,functionName:"balanceOf",args:[n]})}catch(e){console.error(e)}finally{c(!1)}}),[d,n,i?.address,a]);return I((()=>{p().then((e=>null!=e&&l(e)))}),[p]),{balance:o,isLoading:s&&null==o,formattedBalance:Ze({amount:o??BigInt(0),decimals:i.decimals})}}({rpcConfig:m.rpcConfig,appId:m.id,address:te,tokenInfo:{address:me||"",decimals:C?.decimals??18},chain:ae}),ve=A((()=>Kn(Number(v.chainId),c,s,{appId:m.id})),[v.chainId,s]),be=iu(v,te,ve,a?.sendTransaction?.prepareTransactionRequest);I((()=>{b(ou(a,g))}),[g]),I((()=>{a.sendTransaction?.getIsSponsored?a.sendTransaction.getIsSponsored().then(N).catch(console.error):N(!1)}),[a.sendTransaction.getIsSponsored]);let Ce=()=>{if(!E)return M?a?.sendTransaction?.onSuccess({hash:M}):F||be?.errors[0]?a?.sendTransaction?.onFailure(F??be?.errors[0]??ru):a?.sendTransaction?.onFailure(new Qa(new Za("The user rejected the request",je.E4001_USER_REJECTED_REQUEST.eipCode))),d({shouldCallAuthOnSuccess:!1})};i.current=Ce;let xe=!!(a.funding&&a.funding.supportedOptions.length>0),ke=ao(BigInt(be?.totalGasEstimate??0n),ie),Te=h&&ge?no(BigInt(be?.totalGasEstimate??0n),ge):void 0,Ae=ao(fe??0n,ie,void 0,!0),Ie=h&&ge?no(fe??0n,ge):void 0,Se=C&&!we.isLoading&&le&&"approve"!==oe?`${we.formattedBalance} ${C.symbol}`:void 0,Ne=a.sendTransaction?.uiOptions?.transactionInfo?.title;Ne||(Ne="approve"===oe?le?"Confirm address":"Confirm action":`Approve ${oe}`);let Ee=A((()=>{if(a.sendTransaction?.uiOptions?.description)return a.sendTransaction?.uiOptions?.description;if("approve"===oe&&"setApprovalForAll"===pe&&re.approved){let a=/*#__PURE__*/t(rc,{address:re.operator||"",url:ae?.blockExplorers?.default?.url});/*#__PURE__*/return e(n,{children:[m.name," would like your permission for ",a," to transfer tokens on your behalf."]})}if("approve"===oe&&"setApprovalForAll"===pe&&!re.approved){let a=/*#__PURE__*/t(rc,{address:re.operator||"",url:ae?.blockExplorers?.default?.url});/*#__PURE__*/return e(n,{children:[m.name," would like your permission to revoke permissions of ",a," from transferring tokens on your behalf."]})}return le&&"approve"===oe||le&&"approve"===oe?`${m.name} would like your permission for ${ea(re.spender)} to spend tokens on your behalf.`:`${m.name} wants your permission to approve the following transaction.`}),[m.name,le,re,a.sendTransaction?.uiOptions.description,pe]),_e=a.sendTransaction?.uiOptions?.transactionInfo?.contractInfo?.imgUrl?/*#__PURE__*/t("img",{src:a.sendTransaction.uiOptions.transactionInfo.contractInfo.imgUrl,alt:a.sendTransaction.uiOptions.transactionInfo.contractInfo.imgAltText}):null,Me=!(!be||be.errors[0]||be.hasFunds||!1!==k),We=Me&&xe,Le=We?"Add funds":a.sendTransaction?.uiOptions?.buttonText||(g<f?"Continue":"Approve"),Pe=e=>{if(!e)throw Error("Transaction scan failed");if("Success"===e.validation.status&&("Benign"===e.validation.result_type?z("safe"):"Warning"===e.validation.result_type?z("warn"):"Malicious"===e.validation.result_type&&(z("error"),$(!0))),"Success"!==e.simulation.status)throw Error("Simulation failed");{U(e.simulation.params);let{assetsIn:t,assetsOut:n}=function(e,t){let n=[],a=new Map;if(e)for(let t of e)if(t.in[0]){let e;e="ERC721"===t.asset.type||"approve_for_all"===t.in[0].value?{id:`nft:${t.asset.name}`,nftName:t.asset.name,nftCount:t.in.length}:{id:`token:${t.asset.type}:${t.asset.symbol}:${t.asset.name}`,iconUrl:t.asset.logo_url,value:t.in[0].value,symbol:t.asset.symbol,usdValue:t.in[0].usd_price?au(t.in[0].usd_price):void 0,decimals:t.asset.decimals},n.push(e)}else if(t.out[0]?.value){let e;e="ERC721"===t.asset.type||"approve_for_all"===t.out[0].value?{id:`nft:${t.asset.name}`,nftName:t.asset.name}:{id:`token:${t.asset.type}:${t.asset.symbol}:${t.asset.name}`,iconUrl:t.asset.logo_url,value:t.out[0].value,symbol:t.asset.symbol,usdValue:t.out[0].usd_price?au(t.out[0].usd_price):void 0,decimals:t.asset.decimals},a.has(e.id)||a.set(e.id,e)}for(let e of t)for(let t of Object.keys(e.spenders)){let n;n="ERC721"===e.asset.type||"approve_for_all"===e.spenders[t]?.value?{id:`nft:${e.asset.name}`,nftName:e.asset.name}:{id:`token:${e.asset.type}:${e.asset.symbol}:${e.asset.name}`,iconUrl:e.asset.logo_url,value:e.spenders[t]?.value,symbol:e.asset.symbol,usdValue:e.spenders[t]?.usd_price?au(e.spenders[t]?.usd_price):void 0,decimals:e.asset.decimals},a.has(n.id)||a.set(n.id,n)}return{assetsIn:n,assetsOut:Array.from(a.values())}}(e.simulation.assets_diffs,e.simulation.exposures);if(0===n.length&&0===t.length)throw Error("No tokens found");G(n),Y(t)}};if(I((()=>{a.sendTransaction?.scanTransaction&&m.embeddedWallets.transactionScanning.enabled&&"uninitiated"===K&&(X("in progress"),a.sendTransaction.scanTransaction().then((e=>{Pe(e),X("completed")})).catch((()=>X("failed"))))}),[!!a.sendTransaction?.scanTransaction]),I((()=>{a.sendTransaction?.scanTransaction&&"failed"!==K||((e,t,n)=>{if(w((e=>e?.sendTransaction?"transactionRequest"in e.sendTransaction?0:e.sendTransaction.transactionRequests.length-1:0)(a)),t.isErc20Ish&&t.amount&&n){let e=zp({amount:t.amount,decimals:n.decimals});ee(e),G([{value:e,symbol:n?.symbol,decimals:n?.decimals}])}else if(e.value){let t=BigInt(e.value),n=ge?no(t,ge):void 0;G(h&&n?[{value:n}]:[{value:io(t),symbol:ie,decimals:18,usdValue:n}])}else G(h?[{value:"$0"}]:[{value:"0",symbol:ie,decimals:18}])})(be?.tx??v,re,C)}),[v,be?.tx,re,C,K]),L/*#__PURE__*/)return t(Vh,{txn:be?.tx??v,onClose:Ce,receipt:L,transactionInfo:a.sendTransaction?.uiOptions.transactionInfo,tokenPrice:ge,tokenSymbol:ie,receiptHeader:a.sendTransaction?.uiOptions.successHeader,receiptDescription:a.sendTransaction?.uiOptions.successDescription});if(F)/*#__PURE__*/return t(Ih,{transactionError:F,transactionHash:M??void 0,chainType:"ethereum",chainId:be?.tx.chainId??v.chainId,onClose:Ce,onRetry:({resetNonce:e})=>{D(null);let t={...be?.tx??v};e&&(t.nonce=void 0),b(t)}});let Fe=0!==f&&"number"==typeof g&&0!==g?()=>{y(g-1)}:void 0;return V&&R?/*#__PURE__*/t(Gp,{details:R,onBack:()=>H(!1)}):/*#__PURE__*/t(fh,{transactionIndex:g,onBack:Fe,maxIndex:f,disabled:Me&&!xe||j,isSubmitting:E,submitError:F,isPreparing:!be,isTokenPriceLoading:ye,isTokenContractInfoLoading:!se&&!C,prepareError:be?.errors[0],symbol:C?.symbol,chain:ae,img:_e,title:Ne,subtitle:Ee,txValue:v.value,fee:Te??ke,isSponsored:k,from:te??"",to:he,tokenAddress:me??void 0,network:m.chains.find((e=>e.id===v.chainId))?.name??"",transactionDetails:{...re,formattedAmount:J},cta:Le,missingFunds:Me,action:oe,balance:Se??Ie??Ae,onClose:Ce,onClick:We?async()=>{if(te){if(!xe)throw Error("Funding wallet is not enabled");r({...a,funding:{...a.funding,methodScreen:Om,chainType:"ethereum",amount:ue(BigInt(be?.tx.value??0)+BigInt(be?.totalGasEstimate?.toString()??0)),chain:ae},solanaFundingData:a?.solanaFundingData}),o(Om)}}:async()=>{if(g<f)y(g+1);else{_(!0);try{let e=await l.getAccessToken();if(E||!e||!p||!u)return;let t=await a.sendTransaction.onConfirm({transactionRequest:be?.tx??v});if(W(t),a.sendTransaction?.signOnly)return await new Promise((e=>setTimeout(e,ne))),a?.sendTransaction?.onSuccess({hash:t}),d({shouldCallAuthOnSuccess:!1});let n=await ve.waitForTransactionReceipt({hash:t});if("reverted"===n.status)throw Error("Transaction failed");P(n)}catch(e){console.warn({transaction:be?.tx??v,error:e}),D(e)}finally{_(!1)}}},validation:B,hasScanDetails:!!R,setIsScanDetailsOpen:H,preventMaliciousTransaction:j,setPreventMaliciousTransaction:$,tokensSent:q,tokensReceived:Q,isScanning:"in progress"===K,isCancellable:a.sendTransaction?.uiOptions?.isCancellable??!1,functionName:pe})}};function su({title:e}){let{currentScreen:n,navigateBack:a,navigate:i,data:r,setModalData:o}=Ni();/*#__PURE__*/return t(yr,{title:e,backFn:n===Fp?a:n===r?.funding?.methodScreen?r.funding.comingFromSendTransactionScreen?()=>i(lu):void 0:r?.funding?.methodScreen?()=>{let e=r.funding;e.usingDefaultFundingMethod&&(e.usingDefaultFundingMethod=!1),o({funding:e,solanaFundingData:r?.solanaFundingData}),i(e.methodScreen)}:void 0})}const cu=e=>/*#__PURE__*/t("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 512 210.2",xmlSpace:"preserve",...e,children:/*#__PURE__*/t("path",{d:"M93.6,27.1C87.6,34.2,78,39.8,68.4,39c-1.2-9.6,3.5-19.8,9-26.1c6-7.3,16.5-12.5,25-12.9 C103.4,10,99.5,19.8,93.6,27.1 M102.3,40.9c-13.9-0.8-25.8,7.9-32.4,7.9c-6.7,0-16.8-7.5-27.8-7.3c-14.3,0.2-27.6,8.3-34.9,21.2 c-15,25.8-3.9,64,10.6,85c7.1,10.4,15.6,21.8,26.8,21.4c10.6-0.4,14.8-6.9,27.6-6.9c12.9,0,16.6,6.9,27.8,6.7 c11.6-0.2,18.9-10.4,26-20.8c8.1-11.8,11.4-23.3,11.6-23.9c-0.2-0.2-22.4-8.7-22.6-34.3c-0.2-21.4,17.5-31.6,18.3-32.2 C123.3,42.9,107.7,41.3,102.3,40.9 M182.6,11.9v155.9h24.2v-53.3h33.5c30.6,0,52.1-21,52.1-51.4c0-30.4-21.1-51.2-51.3-51.2H182.6z M206.8,32.3h27.9c21,0,33,11.2,33,30.9c0,19.7-12,31-33.1,31h-27.8V32.3z M336.6,169c15.2,0,29.3-7.7,35.7-19.9h0.5v18.7h22.4V90.2 c0-22.5-18-37-45.7-37c-25.7,0-44.7,14.7-45.4,34.9h21.8c1.8-9.6,10.7-15.9,22.9-15.9c14.8,0,23.1,6.9,23.1,19.6v8.6l-30.2,1.8 c-28.1,1.7-43.3,13.2-43.3,33.2C298.4,155.6,314.1,169,336.6,169z M343.1,150.5c-12.9,0-21.1-6.2-21.1-15.7c0-9.8,7.9-15.5,23-16.4 l26.9-1.7v8.8C371.9,140.1,359.5,150.5,343.1,150.5z M425.1,210.2c23.6,0,34.7-9,44.4-36.3L512,54.7h-24.6l-28.5,92.1h-0.5 l-28.5-92.1h-25.3l41,113.5l-2.2,6.9c-3.7,11.7-9.7,16.2-20.4,16.2c-1.9,0-5.6-0.2-7.1-0.4v18.7C417.3,210,423.3,210.2,425.1,210.2z"})}),du=n=>/*#__PURE__*/e("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 80 38.1",xmlSpace:"preserve",...n,children:[/*#__PURE__*/t("path",{style:{fill:"#5F6368"},d:"M37.8,19.7V29h-3V6h7.8c1.9,0,3.7,0.7,5.1,2c1.4,1.2,2.1,3,2.1,4.9c0,1.9-0.7,3.6-2.1,4.9c-1.4,1.3-3.1,2-5.1,2 L37.8,19.7L37.8,19.7z M37.8,8.8v8h5c1.1,0,2.2-0.4,2.9-1.2c1.6-1.5,1.6-4,0.1-5.5c0,0-0.1-0.1-0.1-0.1c-0.8-0.8-1.8-1.3-2.9-1.2 L37.8,8.8L37.8,8.8z"}),/*#__PURE__*/t("path",{style:{fill:"#5F6368"},d:"M56.7,12.8c2.2,0,3.9,0.6,5.2,1.8s1.9,2.8,1.9,4.8V29H61v-2.2h-0.1c-1.2,1.8-2.9,2.7-4.9,2.7 c-1.7,0-3.2-0.5-4.4-1.5c-1.1-1-1.8-2.4-1.8-3.9c0-1.6,0.6-2.9,1.8-3.9c1.2-1,2.9-1.4,4.9-1.4c1.8,0,3.2,0.3,4.3,1v-0.7 c0-1-0.4-2-1.2-2.6c-0.8-0.7-1.8-1.1-2.9-1.1c-1.7,0-3,0.7-3.9,2.1l-2.6-1.6C51.8,13.8,53.9,12.8,56.7,12.8z M52.9,24.2 c0,0.8,0.4,1.5,1,1.9c0.7,0.5,1.5,0.8,2.3,0.8c1.2,0,2.4-0.5,3.3-1.4c1-0.9,1.5-2,1.5-3.2c-0.9-0.7-2.2-1.1-3.9-1.1 c-1.2,0-2.2,0.3-3,0.9C53.3,22.6,52.9,23.3,52.9,24.2z"}),/*#__PURE__*/t("path",{style:{fill:"#5F6368"},d:"M80,13.3l-9.9,22.7h-3l3.7-7.9l-6.5-14.7h3.2l4.7,11.3h0.1l4.6-11.3H80z"}),/*#__PURE__*/t("path",{style:{fill:"#4285F4"},d:"M25.9,17.7c0-0.9-0.1-1.8-0.2-2.7H13.2v5.1h7.1c-0.3,1.6-1.2,3.1-2.6,4v3.3H22C24.5,25.1,25.9,21.7,25.9,17.7z"}),/*#__PURE__*/t("path",{style:{fill:"#34A853"},d:"M13.2,30.6c3.6,0,6.6-1.2,8.8-3.2l-4.3-3.3c-1.2,0.8-2.7,1.3-4.5,1.3c-3.4,0-6.4-2.3-7.4-5.5H1.4v3.4 C3.7,27.8,8.2,30.6,13.2,30.6z"}),/*#__PURE__*/t("path",{style:{fill:"#FBBC04"},d:"M5.8,19.9c-0.6-1.6-0.6-3.4,0-5.1v-3.4H1.4c-1.9,3.7-1.9,8.1,0,11.9L5.8,19.9z"}),/*#__PURE__*/t("path",{style:{fill:"#EA4335"},d:"M13.2,9.4c1.9,0,3.7,0.7,5.1,2l0,0l3.8-3.8c-2.4-2.2-5.6-3.5-8.8-3.4c-5,0-9.6,2.8-11.8,7.3l4.4,3.4 C6.8,11.7,9.8,9.4,13.2,9.4z"})]}),pu=e=>{let[t,n]=T();return I((()=>{e().then((e=>{n(e)})).catch((()=>{}))}),[]),t},hu=({children:e,color:n,isLoading:a,isPulsing:i,...r})=>/*#__PURE__*/t(uu,{$color:n,$isLoading:a,$isPulsing:i,...r,children:e});let uu=/*#__PURE__*/Ne.span.withConfig({displayName:"StyledSpan",componentId:"sc-80725f4-0"})(["padding:0.25rem;font-size:0.75rem;font-weight:500;line-height:1rem;border-radius:var(--privy-border-radius-xs);display:flex;align-items:center;"," ",""],(e=>{let t,n;"green"===e.$color&&(t="var(--privy-color-success-dark)",n="var(--privy-color-success-light)"),"red"===e.$color&&(t="var(--privy-color-error)",n="var(--privy-color-error-light)"),"gray"===e.$color&&(t="var(--privy-color-foreground-2)",n="var(--privy-color-background-2)");let a=/*#__PURE__*/_e(["from,to{background-color:",";}50%{background-color:rgba(",",0.8);}"],n,n);/*#__PURE__*/return Ee(["color:",";background-color:",";",";"],t,n,e.$isPulsing&&/*#__PURE__*/Ee(["animation:"," 3s linear infinite;"],a))}),eh);const mu=({onClick:n,text:a})=>/*#__PURE__*/e(Ri,{onClick:n,children:[/*#__PURE__*/t(Oi,{children:/*#__PURE__*/t(m,{})}),/*#__PURE__*/t(Mi,{children:a})]}),gu=({chainType:n,withPadding:a})=>{let i="";return i="ethereum-only"===n||"ethereum-and-solana"===n?"Rainbow, Phantom, or Coinbase Wallet":"Phantom or Solflare",/*#__PURE__*/t(Bi,{$withPadding:a,children:/*#__PURE__*/e(zi,{children:[/*#__PURE__*/t(We,{style:{color:"var(--privy-color-warn)",height:48,width:48}}),/*#__PURE__*/t("h3",{children:"No wallets available"}),/*#__PURE__*/e("p",{children:["Please download an external wallet provider, like ",i,"."]})]})},"empty-wallet-state")},yu=({icon:e,name:n})=>"string"==typeof e?/*#__PURE__*/t("img",{alt:`${n||"wallet"} logo`,src:e,style:{height:24,width:24,borderRadius:4}}):void 0===e?/*#__PURE__*/t(ze,{style:{height:24,width:24}}):e?/*#__PURE__*/t(e,{style:{height:24,width:24}}):null;function fu(e){let t=e.toLowerCase();return!!window?.webkit?.messageHandlers?.ReactNativeWebView||!!window?.ReactNativeWebView||["fbav","fban","instagram","snapchat","linkedinapp"].some((e=>t.includes(e)))}const wu=({walletLogo:e,success:n,errorMessage:a,title:i,subtitle:r,onRetry:o,onUseDifferentWallet:l,onBack:s,numRetries:c,maxRetries:d})=>/*#__PURE__*/t(Qr,{title:i,subtitle:r,icon:e,iconVariant:"loading",iconLoadingStatus:{success:n,fail:!!a},primaryCta:a===Ya.ERROR_USER_EXISTS?{label:"Use a different wallet",onClick:l}:!n&&a?.retryable&&c<d?{label:"Retry",onClick:o,disabled:!a?.retryable||c>=d}:!n&&a&&c>=d?{label:"Use a different wallet",onClick:l}:void 0,onBack:s,watermark:!0}),vu={component:()=>{let e,{navigateBack:n,navigate:a,lastScreen:i,currentScreen:r,data:o,setModalData:l}=Ni(),{walletConnectionStatus:s,closePrivyModal:c}=O(),[d,p]=T(void 0),[h,u]=T(0),m=Oa(s?.connector?.walletClientType||"unknown"),g="connected"===s?.status,y="switching_to_supported_chain"===s?.status;I((()=>{if(g){let e;if(o?.externalConnectWallet?.onCompleteNavigateTo){let t=o.externalConnectWallet.onCompleteNavigateTo,n=s.connectedWallet?.address;e=setTimeout((()=>{if(o.funding&&s.connector){let e=s.connector.wallets.find((e=>e.address===n));l({...o,funding:{...o.funding,connectedWallet:e}})}a(t({address:n,walletClientType:s.connector?.walletClientType,walletChainType:s.connector?.chainType}))}),ne)}else e=setTimeout(c,ne);return()=>clearTimeout(e)}}),[g]);I((()=>{s?.connectError&&(e=>{p(lp(e))})(s?.connectError)}),[s]);let f=s?.connector?.connectorType||"injected",w=s?.connector?.walletClientType||"unknown",v=m?.metadata?.shortName||m?.name||s?.connector?.walletBranding.name||"Browser Extension",b=m?.image_url?.md||s?.connector?.walletBranding.icon||(e=>/*#__PURE__*/t(li,{...e})),C="Browser Extension"===v?v.toLowerCase():v;e=g?`Successfully connected with ${C}`:d?d.message:y?"Switching networks":`Waiting for ${C}`;let x="Don’t see your wallet? Check your other browser windows.";return g?x="You’re good to go!":h>=2&&d?x="Unable to connect wallet":d?x=d.detail:y?x="Switch your wallet to the requested network.":"metamask"===w&&Oe?x="Click to continue to open and connect MetaMask.":"metamask"===w?x="For the best experience, connect only one wallet at a time.":"wallet_connect_v2"===f?x="Open your mobile wallet app to continue":"coinbase_wallet"===f&&(x="Confirm in the Coinbase app/popup to continue."),/*#__PURE__*/t(wu,{walletName:v,walletLogo:b,success:g,errorMessage:d,title:e,subtitle:x,onRetry:()=>{u(h+1),p(void 0),s?.connectRetry()},onUseDifferentWallet:n,onBack:r===i?void 0:n,numRetries:h,maxRetries:2})}},bu=/*#__PURE__*/Ne.div.withConfig({displayName:"TodoList",componentId:"sc-bcc78743-0"})(["display:flex;flex-direction:column;justify-content:flex-start;gap:10px;padding-left:8px;"]),Cu=({children:n,variant:a="default",icon:i})=>{let o=()=>{switch(a){case"success":return"var(--privy-color-icon-success)";case"error":return"var(--privy-color-icon-error)";default:return"var(--privy-color-icon-muted)"}};/*#__PURE__*/return e(ku,{children:[/*#__PURE__*/t(xu,{$variant:a,"data-variant":a,children:(()=>{if(i)
21
- /*#__PURE__*/return b.isValidElement(i)?/*#__PURE__*/b.cloneElement(i,{stroke:o(),strokeWidth:2}):i;switch(a){case"success":default:/*#__PURE__*/return t(r,{size:12,stroke:o(),strokeWidth:3});case"error":/*#__PURE__*/return t(g,{size:12,stroke:o(),strokeWidth:3})}})()}),n]})};let xu=/*#__PURE__*/Ne.div.withConfig({displayName:"IconBackground",componentId:"sc-bcc78743-2"})(["display:flex;align-items:center;justify-content:center;width:20px;height:20px;border-radius:50%;background-color:",";flex-shrink:0;"],(({$variant:e})=>{switch(e){case"success":return"var(--privy-color-success-bg, #EAFCEF)";case"error":return"var(--privy-color-error-bg, #FEE2E2)";default:return"var(--privy-color-background-2)"}})),ku=/*#__PURE__*/Ne.div.withConfig({displayName:"TodoItemWrapper",componentId:"sc-bcc78743-3"})(["display:flex;justify-content:flex-start;align-items:flex-start;text-align:left;gap:8px;&&{a{color:var(--privy-color-accent);}}"]);const Tu=({walletName:a,installLink:i,title:r,subtitle:o="Follow the instructions below to get started.",onReload:l,onBack:s})=>{let c=r||`Create a ${a} wallet`.replace(/wallet wallet/gi,"wallet");/*#__PURE__*/return t(Qr,{title:c,subtitle:o,onBack:s,showBack:!0,primaryCta:{label:"Reload the page to use your wallet",onClick:l},helpText:/*#__PURE__*/e(n,{children:[/*#__PURE__*/t("span",{children:"Still not sure? "}),/*#__PURE__*/t(Ys,{size:"sm",target:"_blank",href:"https://solana.com/docs/intro/wallets",children:"Learn more"})]}),watermark:!0,children:/*#__PURE__*/e(bu,{children:[/*#__PURE__*/t(Cu,{children:/*#__PURE__*/e("div",{children:[/*#__PURE__*/t("span",{children:"Install the "})," ",/*#__PURE__*/e(Ys,{href:i,target:"_blank",children:[a," browser extension"]})]})}),/*#__PURE__*/t(Cu,{children:"Set up your first wallet"}),/*#__PURE__*/t(Cu,{children:"Store your recovery phrase in a safe place!"})]})})},Au={component:()=>{let{navigateBack:e,data:n}=Ni();if(!n?.installWalletModalData)throw Error("Wallet data is missing");let{walletConfig:a}=n.installWalletModalData;/*#__PURE__*/return t(Tu,{walletName:a.name,installLink:a.installLink,onReload:()=>{window.location.reload()},onBack:e})}},Iu=({title:e,subtitle:n,buttonText:a,buttonHref:i,isLoading:r=!1,helpText:o,onButtonClick:l})=>/*#__PURE__*/t(Qr,{title:e,subtitle:n,primaryCta:{label:a,onClick:()=>{i&&window.open(i,"_self"),l?.()},disabled:r},helpText:o,watermark:!0}),Su={component:()=>{let{ready:e}=_i(),{data:n}=Ni(),[a,i]=T(!1);if(!n?.installWalletModalData)throw Error("Wallet data is missing");let{walletConfig:r,connectOnly:o,chainType:l}=n.installWalletModalData,s=r.getMobileRedirect({useUniversalLink:!a,isSolana:"solana"===l,connectOnly:o}),c=r.name.replace(/ wallet/gi,""),d={title:`Redirecting to ${c} Mobile Wallet`,description:`We'll take you to the ${c} Mobile Wallet app to continue your login experience.`,footnote:""};return e&&(d.description=`For the best experience, we'll automatically log you into the ${c} Mobile Wallet in-app browser.`,d.footnote="You can always return here to login via other methods."),a&&(d.title="Still here?",d.description=`You may need to install the ${r.name} mobile app.`,d.footnote=`Once you're done, you can connect with ${r.name} wallet to complete the login.`),/*#__PURE__*/t(Iu,{title:d.title,subtitle:d.description,buttonText:a?"Go to App Store":"Continue",buttonHref:s,isLoading:e&&!s,helpText:d.footnote||void 0,onButtonClick:()=>{setTimeout((()=>i(!0)),1e3)}})}},Nu=({provider:n,displayName:a,logo:i,connectOnly:r,connector:o})=>{let l,{navigate:s,setModalData:c}=Ni(),{connectWallet:d}=O(),p=Hs(),h=Oa(n),u="wallet_connect_v2"===o.connectorType?n:o.walletClientType,m=window.matchMedia("(display-mode: standalone)").matches,g=hi({connectorType:o.connectorType,walletClientType:u});l=g&&g.chainTypes.includes(o.chainType)?()=>{g.isInstalled||"solana"===o.chainType&&"isInstalled"in o&&o.isInstalled?(d(o,u),s(r?vu:cp)):Oe?(c({installWalletModalData:{walletConfig:g,chainType:o.chainType,connectOnly:r}}),s(Su)):(c({installWalletModalData:{walletConfig:g,chainType:o.chainType,connectOnly:r}}),s(Au))}:"coinbase_wallet"!==o.connectorType||"eoaOnly"!==o.coinbaseWalletConfig.preference?.options||!Oe||m||Yn()?()=>{(!fu(window.navigator.userAgent)||event?.isTrusted)&&(d(o,u),r?"wallet_connect_v2"===o.connectorType?(c((e=>({...e,externalConnectWallet:{...e?.externalConnectWallet,preSelectedWalletId:"wallet_connect_qr"}}))),s(Um)):s(vu):s(cp))}:()=>{window.location.href=`https://go.cb-w.com/dapp?cb_url=${encodeURI(window.location.href)}`};let y=a||h?.metadata?.shortName||h?.name||o.walletClientType;/*#__PURE__*/return e(Eu,{onClick:l,children:[/*#__PURE__*/t(yu,{icon:i||h?.image_url?.md,name:y}),/*#__PURE__*/t("span",{children:y}),/*#__PURE__*/e(Mu,{id:"chip-container",children:[p?.walletClientType===u&&p?.chainType===o.chainType?/*#__PURE__*/t(_u,{color:"gray",children:"Recent"}):/*#__PURE__*/t("span",{id:"connect-text",children:"Connect"}),"solana"===o.chainType&&/*#__PURE__*/t(_u,{color:"gray",children:"Solana"})]})]})};let Eu=/*#__PURE__*/Ne(Ri).withConfig({displayName:"ConnectWalletButton",componentId:"sc-89605346-0"})(["> span{color:var(--privy-color-foreground);}> #chip-container > #connect-text{font-weight:500;color:var(--privy-color-accent);opacity:0;transition:opacity 0.1s ease-out;}:hover > #chip-container > #connect-text{opacity:1;}@media (max-width:440px){> #chip-container > #connect-text{display:none;}}"]),_u=/*#__PURE__*/Ne(hu).withConfig({displayName:"StyledChip",componentId:"sc-89605346-1"})(["margin-left:auto;"]),Mu=/*#__PURE__*/Ne.div.withConfig({displayName:"ChipContainer",componentId:"sc-89605346-2"})(["display:flex;flex-wrap:wrap;gap:8px;margin-left:auto;"]);const Wu=["coinbase_wallet","base_account"];let Lu=["metamask","okx_wallet","rainbow","uniswap","bybit_wallet","ronin_wallet","haha_wallet","uniswap_extension","zerion","rabby_wallet","cryptocom","binance"];const Pu=["safe"],Fu=["phantom","backpack","solflare","universal_profile"],Du=({walletList:e,walletChainType:n,connectors:a,connectOnly:i,ignore:r,walletConnectEnabled:o,forceWallet:l})=>{let s=[],c=[],d=[],p=a.filter((e=>"ethereum-only"===n?"ethereum"===e.chainType:"solana-only"!==n||"solana"===e.chainType)),h=p.find((e=>"wallet_connect_v2"===e.connectorType));for(let[a,u]of(l?[l.wallet]:e).entries()){if("detected_ethereum_wallets"===u)for(let[e,n]of p.filter((({chainType:e,connectorType:t,walletClientType:n})=>"solana"!==e&&("uniswap_wallet_extension"===n||"uniswap_extension"===n?!r.includes("uniswap"):"crypto.com_wallet_extension"===n||"crypto.com_onchain"===n?!r.includes("cryptocom"):"injected"===t&&!r.includes(n)))).entries()){let{walletClientType:r,walletBranding:o,chainType:l}=n;("unknown"===r?c:s).push(/*#__PURE__*/t(Nu,{connectOnly:i,provider:r,logo:o.icon,displayName:o.name,connector:n},`${a}-${u}-${r}-${l}-${e}`))}if("detected_solana_wallets"===u)for(let[e,o]of p.filter((({chainType:e,walletClientType:t})=>{if("solana"===e)return"ethereum-only"!==n&&!r.includes(t)})).entries()){let{walletClientType:n,walletBranding:r,chainType:l}=o;("unknown"===n?c:s).push(/*#__PURE__*/t(Nu,{connectOnly:i,provider:n,logo:r.icon,displayName:r.name,connector:o},`${a}-${u}-${n}-${l}-${e}`))}if(Fu.includes(u)){let e=p.find((e=>"injected"===e.connectorType&&e.walletClientType===u||e.connectorType===u));if(e&&s.push(/*#__PURE__*/t(Nu,{connectOnly:i,provider:u,connector:e},`${a}-${u}`)),"solana-only"===n||"ethereum-and-solana"===n){let e=p.find((({chainType:e,walletClientType:t})=>"solana"===e&&t===u));e&&s.push(/*#__PURE__*/t(Nu,{connectOnly:i,provider:u,connector:e},`${u}-solana`))}}else if(Lu.includes(u)){let e=p.find((e=>"uniswap"===u?"uniswap_wallet_extension"===e.walletClientType||"uniswap_extension"===e.walletClientType:"cryptocom"===u?"crypto.com_wallet_extension"===e.walletClientType||"crypto.com_onchain"===e.walletClientType:"injected"===e.connectorType&&e.walletClientType===u));if(o&&!e&&(e=h),e&&s.push(/*#__PURE__*/t(Nu,{connectOnly:i,provider:u,connector:e,logo:"injected"===e.connectorType?e.walletBranding.icon:void 0,displayName:"injected"===e.connectorType?e.walletBranding.name:void 0},`${a}-${u}`)),"solana-only"===n||"ethereum-and-solana"===n){let e=p.find((({chainType:e,walletClientType:t})=>"solana"===e&&t===u));e&&s.push(/*#__PURE__*/t(Nu,{connectOnly:i,provider:u,connector:e},`${u}-solana`))}}else if(Wu.includes(u)){let e=p.find((({connectorType:e})=>e===u));e&&s.push(/*#__PURE__*/t(Nu,{connectOnly:i,provider:u,connector:e,displayName:"coinbase_wallet"===e.walletClientType?"Coinbase":"Base",logo:"coinbase_wallet"===e.walletClientType?ja:$a},`${a}-${u}`))}else if(Pu.includes(u))h&&d.push(/*#__PURE__*/t(Nu,{connectOnly:i,provider:u,connector:h},`${a}-${u}`));else if("wallet_connect"===u)h&&d.push(/*#__PURE__*/t(Nu,{connectOnly:i,provider:u,connector:h,logo:h.walletBranding.icon,displayName:"WalletConnect"},`${a}-${u}`));else if(u===l?.wallet){let n="ethereum"===l.chainType&&e.includes("detected_ethereum_wallets"),r="solana"===l.chainType&&e.includes("detected_solana_wallets");if(n||r){let e=p.find((({walletClientType:e})=>e===u));e&&s.push(/*#__PURE__*/t(Nu,{connectOnly:i,provider:u,displayName:e.walletBranding?.name,logo:e.walletBranding?.icon,connector:e},`${a}-${u}`))}}}return[...c,...s,...d]},Ru=({chains:e,appId:t,address:n,rpcConfig:a,includeUsdc:i})=>Promise.all(e.map((async e=>{let r=ce({chain:e,transport:de(Xn(e,a,t))}),o=await r.getBalance({address:n}).catch((()=>0n)),l=null,s=Ke[e.id];if(i&&s){let{balance:i}=await Lp({address:n,chain:e,rpcConfig:a,appId:t,erc20Address:s});l=i}return{balance:o,erc20Balance:l,erc20Address:s,chain:e}}))),Ou=n=>/*#__PURE__*/e("svg",{xmlns:"http://www.w3.org/2000/svg",version:"1.1",id:"Layer_1",x:"0px",y:"0px",viewBox:"0 0 397.7 311.7",enableBackground:"new 0 0 397.7 311.7",xmlSpace:"preserve",...n,children:[/*#__PURE__*/e("linearGradient",{id:"SVGID_1_",gradientUnits:"userSpaceOnUse",x1:"360.8791",y1:"351.4553",x2:"141.213",y2:"-69.2936",gradientTransform:"matrix(1 0 0 -1 0 314)",children:[/*#__PURE__*/t("stop",{offset:"0",stopColor:"#00FFA3"}),/*#__PURE__*/t("stop",{offset:"1",stopColor:"#DC1FFF"})]}),/*#__PURE__*/t("path",{d:"M64.6,237.9c2.4-2.4,5.7-3.8,9.2-3.8h317.4c5.8,0,8.7,7,4.6,11.1l-62.7,62.7c-2.4,2.4-5.7,3.8-9.2,3.8H6.5 c-5.8,0-8.7-7-4.6-11.1L64.6,237.9z",fill:"url(#SVGID_1_)"}),/*#__PURE__*/e("linearGradient",{id:"SVGID_2_",gradientUnits:"userSpaceOnUse",x1:"264.8291",y1:"401.6014",x2:"45.163",y2:"-19.1475",gradientTransform:"matrix(1 0 0 -1 0 314)",children:[/*#__PURE__*/t("stop",{offset:"0",stopColor:"#00FFA3"}),/*#__PURE__*/t("stop",{offset:"1",stopColor:"#DC1FFF"})]}),/*#__PURE__*/t("path",{d:"M64.6,3.8C67.1,1.4,70.4,0,73.8,0h317.4c5.8,0,8.7,7,4.6,11.1l-62.7,62.7c-2.4,2.4-5.7,3.8-9.2,3.8H6.5 c-5.8,0-8.7-7-4.6-11.1L64.6,3.8z",fill:"url(#SVGID_2_)"}),/*#__PURE__*/e("linearGradient",{id:"SVGID_3_",gradientUnits:"userSpaceOnUse",x1:"312.5484",y1:"376.688",x2:"92.8822",y2:"-44.061",gradientTransform:"matrix(1 0 0 -1 0 314)",children:[/*#__PURE__*/t("stop",{offset:"0",stopColor:"#00FFA3"}),/*#__PURE__*/t("stop",{offset:"1",stopColor:"#DC1FFF"})]}),/*#__PURE__*/t("path",{d:"M333.1,120.1c-2.4-2.4-5.7-3.8-9.2-3.8H6.5c-5.8,0-8.7,7-4.6,11.1l62.7,62.7c2.4,2.4,5.7,3.8,9.2,3.8h317.4 c5.8,0,8.7-7,4.6-11.1L333.1,120.1z",fill:"url(#SVGID_3_)"})]});let Uu={[ot.id]:n=>/*#__PURE__*/t("svg",{xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",version:"1.1",id:"Layer_1",x:"0px",y:"0px",viewBox:"0 0 2500 2500",xmlSpace:"preserve",...n,children:/*#__PURE__*/t("g",{id:"Layer_x0020_1",children:/*#__PURE__*/e("g",{id:"_2405588477232",children:[/*#__PURE__*/t("rect",{fill:"none",width:"2500",height:"2500"}),/*#__PURE__*/t("g",{children:/*#__PURE__*/e("g",{children:[/*#__PURE__*/t("path",{fill:"#213147",d:"M226,760v980c0,63,33,120,88,152l849,490c54,31,121,31,175,0l849-490c54-31,88-89,88-152V760 c0-63-33-120-88-152l-849-490c-54-31-121-31-175,0L314,608c-54,31-87,89-87,152H226z"}),/*#__PURE__*/t("g",{children:/*#__PURE__*/e("g",{children:[/*#__PURE__*/t("g",{children:/*#__PURE__*/t("path",{fill:"#12AAFF",d:"M1435,1440l-121,332c-3,9-3,19,0,29l208,571l241-139l-289-793C1467,1422,1442,1422,1435,1440z"})}),/*#__PURE__*/t("g",{children:/*#__PURE__*/t("path",{fill:"#12AAFF",d:"M1678,882c-7-18-32-18-39,0l-121,332c-3,9-3,19,0,29l341,935l241-139L1678,883V882z"})})]})}),/*#__PURE__*/t("g",{children:/*#__PURE__*/t("path",{fill:"#9DCCED",d:"M1250,155c6,0,12,2,17,5l918,530c11,6,17,18,17,30v1060c0,12-7,24-17,30l-918,530c-5,3-11,5-17,5 s-12-2-17-5l-918-530c-11-6-17-18-17-30V719c0-12,7-24,17-30l918-530c5-3,11-5,17-5l0,0V155z M1250,0c-33,0-65,8-95,25L237,555 c-59,34-95,96-95,164v1060c0,68,36,130,95,164l918,530c29,17,62,25,95,25s65-8,95-25l918-530c59-34,95-96,95-164V719 c0-68-36-130-95-164L1344,25c-29-17-62-25-95-25l0,0H1250z"})}),/*#__PURE__*/t("polygon",{fill:"#213147",points:"642,2179 727,1947 897,2088 738,2234 "}),/*#__PURE__*/e("g",{children:[/*#__PURE__*/t("path",{fill:"#FFFFFF",d:"M1172,644H939c-17,0-33,11-39,27L401,2039l241,139l550-1507c5-14-5-28-19-28L1172,644z"}),/*#__PURE__*/t("path",{fill:"#FFFFFF",d:"M1580,644h-233c-17,0-33,11-39,27L738,2233l241,139l620-1701c5-14-5-28-19-28V644z"})]})]})})]})})}),[rt.id]:n=>/*#__PURE__*/e("svg",{width:"1503",height:"1504",viewBox:"0 0 1503 1504",fill:"none",xmlns:"http://www.w3.org/2000/svg",...n,children:[/*#__PURE__*/t("rect",{x:"287",y:"258",width:"928",height:"844",fill:"white"}),/*#__PURE__*/t("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M1502.5 752C1502.5 1166.77 1166.27 1503 751.5 1503C336.734 1503 0.5 1166.77 0.5 752C0.5 337.234 336.734 1 751.5 1C1166.27 1 1502.5 337.234 1502.5 752ZM538.688 1050.86H392.94C362.314 1050.86 347.186 1050.86 337.962 1044.96C327.999 1038.5 321.911 1027.8 321.173 1015.99C320.619 1005.11 328.184 991.822 343.312 965.255L703.182 330.935C718.495 303.999 726.243 290.531 736.021 285.55C746.537 280.2 759.083 280.2 769.599 285.55C779.377 290.531 787.126 303.999 802.438 330.935L876.42 460.079L876.797 460.738C893.336 489.635 901.723 504.289 905.385 519.669C909.443 536.458 909.443 554.169 905.385 570.958C901.695 586.455 893.393 601.215 876.604 630.549L687.573 964.702L687.084 965.558C670.436 994.693 661.999 1009.46 650.306 1020.6C637.576 1032.78 622.263 1041.63 605.474 1046.62C590.161 1050.86 573.004 1050.86 538.688 1050.86ZM906.75 1050.86H1115.59C1146.4 1050.86 1161.9 1050.86 1171.13 1044.78C1181.09 1038.32 1187.36 1027.43 1187.92 1015.63C1188.45 1005.1 1181.05 992.33 1166.55 967.307C1166.05 966.455 1165.55 965.588 1165.04 964.706L1060.43 785.75L1059.24 783.735C1044.54 758.877 1037.12 746.324 1027.59 741.472C1017.08 736.121 1004.71 736.121 994.199 741.472C984.605 746.453 976.857 759.552 961.544 785.934L857.306 964.891L856.949 965.507C841.69 991.847 834.064 1005.01 834.614 1015.81C835.352 1027.62 841.44 1038.5 851.402 1044.96C860.443 1050.86 875.94 1050.86 906.75 1050.86Z",fill:"#E84142"})]}),[it.id]:n=>/*#__PURE__*/e("svg",{width:"146",height:"146",viewBox:"0 0 146 146",fill:"none",xmlns:"http://www.w3.org/2000/svg",...n,children:[/*#__PURE__*/t("circle",{cx:"73",cy:"73",r:"73",fill:"#0052FF"}),/*#__PURE__*/t("path",{d:"M73.323 123.729C101.617 123.729 124.553 100.832 124.553 72.5875C124.553 44.343 101.617 21.4463 73.323 21.4463C46.4795 21.4463 24.4581 42.0558 22.271 68.2887H89.9859V76.8864H22.271C24.4581 103.119 46.4795 123.729 73.323 123.729Z",fill:"white"})]}),[at.id]:n=>/*#__PURE__*/e("svg",{fill:"none",height:"400",viewBox:"0 0 400 400",width:"400",xmlns:"http://www.w3.org/2000/svg",...n,children:[/*#__PURE__*/t("path",{d:"m0 0h400v400h-400z",fill:"#fcff52"}),/*#__PURE__*/t("path",{d:"m300 100h-200v200h199.996v-69.813h-33.191c-11.442 25.468-37.194 43.206-66.665 43.206-40.63 0-73.533-33.187-73.533-73.533s32.903-73.249 73.533-73.249c30.043 0 55.795 18.313 67.24 44.349h32.62z",fill:"#000"})]}),[nt.id]:n=>/*#__PURE__*/e("svg",{width:"200",height:"208",viewBox:"0 0 200 208",fill:"none",xmlns:"http://www.w3.org/2000/svg",...n,children:[/*#__PURE__*/t("rect",{width:"199.4",height:"207.623",fill:"#121212"}),/*#__PURE__*/e("g",{"clip-path":"url(#clip0_2303_643)",children:[/*#__PURE__*/t("path",{d:"M132.369 155.99H49.7001V68.8854H68.6148V139.109H132.369V155.981V155.99Z",fill:"white"}),/*#__PURE__*/t("path",{d:"M132.369 85.7575C141.687 85.7575 149.241 78.2036 149.241 68.8855C149.241 59.5673 141.687 52.0134 132.369 52.0134C123.05 52.0134 115.497 59.5673 115.497 68.8855C115.497 78.2036 123.05 85.7575 132.369 85.7575Z",fill:"white"})]}),/*#__PURE__*/t("defs",{children:/*#__PURE__*/t("clipPath",{id:"clip0_2303_643",children:/*#__PURE__*/t("rect",{width:"99.5407",height:"103.977",fill:"white",transform:"translate(49.7001 52.0134)"})})})]}),[tt.id]:n=>/*#__PURE__*/e("svg",{version:"1.1",id:"Layer_1",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",x:"0px",y:"0px",viewBox:"0 0 327.5 533.3",enableBackground:"new 0 0 327.5 533.3;",xmlSpace:"preserve",...n,children:[/*#__PURE__*/t("path",{fill:"#8492B2",d:"M163.7,197.2V0L0,271.6L163.7,197.2z"}),/*#__PURE__*/t("path",{fill:"#62688F",d:"M163.7,368.4V197.2L0,271.6L163.7,368.4z M163.7,197.2l163.7,74.4L163.7,0V197.2z"}),/*#__PURE__*/t("path",{fill:"#454A75",d:"M163.7,197.2v171.2l163.7-96.8L163.7,197.2z"}),/*#__PURE__*/t("path",{fill:"#8492B2",d:"M163.7,399.4L0,302.7l163.7,230.7V399.4z"}),/*#__PURE__*/t("path",{fill:"#62688F",d:"M327.5,302.7l-163.8,96.7v134L327.5,302.7z"})]}),[et.id]:n=>/*#__PURE__*/e("svg",{width:"500",height:"500",viewBox:"0 0 500 500",fill:"none",xmlns:"http://www.w3.org/2000/svg",...n,children:[/*#__PURE__*/t("circle",{cx:"250",cy:"250",r:"250",fill:"#FF0420"}),/*#__PURE__*/t("path",{d:"M177.133 316.446C162.247 316.446 150.051 312.943 140.544 305.938C131.162 298.808 126.471 288.676 126.471 275.541C126.471 272.789 126.784 269.411 127.409 265.408C129.036 256.402 131.35 245.581 134.352 232.947C142.858 198.547 164.812 181.347 200.213 181.347C209.845 181.347 218.476 182.973 226.107 186.225C233.738 189.352 239.742 194.106 244.12 200.486C248.498 206.74 250.688 214.246 250.688 223.002C250.688 225.629 250.375 228.944 249.749 232.947C247.873 244.08 245.621 254.901 242.994 265.408C238.616 282.546 231.048 295.368 220.29 303.874C209.532 312.255 195.147 316.446 177.133 316.446ZM179.76 289.426C186.766 289.426 192.707 287.362 197.586 283.234C202.59 279.106 206.155 272.789 208.281 264.283C211.158 252.524 213.348 242.266 214.849 233.51C215.349 230.883 215.599 228.194 215.599 225.441C215.599 214.058 209.657 208.366 197.774 208.366C190.768 208.366 184.764 210.43 179.76 214.558C174.882 218.687 171.379 225.004 169.253 233.51C167.001 241.891 164.749 252.149 162.498 264.283C161.997 266.784 161.747 269.411 161.747 272.163C161.747 283.672 167.752 289.426 179.76 289.426Z",fill:"white"}),/*#__PURE__*/t("path",{d:"M259.303 314.57C257.927 314.57 256.863 314.132 256.113 313.256C255.487 312.255 255.3 311.13 255.55 309.879L281.444 187.914C281.694 186.538 282.382 185.412 283.508 184.536C284.634 183.661 285.822 183.223 287.073 183.223H336.985C350.87 183.223 362.003 186.1 370.384 191.854C378.891 197.609 383.144 205.927 383.144 216.81C383.144 219.937 382.769 223.19 382.018 226.567C378.891 240.953 372.574 251.586 363.067 258.466C353.685 265.346 340.8 268.786 324.413 268.786H299.082L290.451 309.879C290.2 311.255 289.512 312.38 288.387 313.256C287.261 314.132 286.072 314.57 284.822 314.57H259.303ZM325.727 242.892C330.98 242.892 335.546 241.453 339.424 238.576C343.427 235.699 346.054 231.571 347.305 226.192C347.68 224.065 347.868 222.189 347.868 220.563C347.868 216.935 346.805 214.183 344.678 212.307C342.551 210.305 338.924 209.305 333.795 209.305H311.278L304.148 242.892H325.727Z",fill:"white"})]}),[Je.id]:n=>/*#__PURE__*/e("svg",{width:"360",height:"360",viewBox:"0 0 360 360",fill:"none",xmlns:"http://www.w3.org/2000/svg",...n,children:[/*#__PURE__*/t("rect",{width:"360",height:"360",rx:"180",fill:"#6C00F6"}),/*#__PURE__*/t("path",{d:"M157.743 154.241L141.052 144.58L90.9766 173.561V231.519L141.052 260.5L191.13 231.519V141.359L218.948 125.26L246.77 141.359V173.561L218.948 189.66L202.257 180.002V205.759L218.948 215.42L269.024 186.439V128.481L218.948 99.5L168.873 128.481V218.641L141.052 234.74L113.233 218.641V186.439L141.052 170.34L157.743 179.998V154.241Z",fill:"white"})]}),[Xe.id]:n=>/*#__PURE__*/e("svg",{xmlns:"http://www.w3.org/2000/svg",width:"30",height:"30",viewBox:"0 0 30 30",fill:"none",...n,children:[/*#__PURE__*/t("g",{clipPath:"url(#clip0)",children:/*#__PURE__*/t("g",{clipPath:"url(#clip1)",children:/*#__PURE__*/t("path",{d:"M14.9188 29.8373C6.67944 29.8373 0.00012207 23.1581 0.00012207 14.9187C0.00012207 6.67931 6.67944 0 14.9188 0C23.1581 0 29.8373 6.67931 29.8373 14.9187C29.8373 23.1581 23.1581 29.8373 14.9188 29.8373Z",fill:"url(#paint0)"})})}),/*#__PURE__*/e("defs",{children:[/*#__PURE__*/e("radialGradient",{id:"paint0",cx:"0",cy:"0",r:"1",gradientUnits:"userSpaceOnUse",gradientTransform:"translate(21.6921 8.02215) rotate(180) scale(25.2008)",children:[/*#__PURE__*/t("stop",{offset:"0.00682297",stopColor:"#F2CEFE"}),/*#__PURE__*/t("stop",{offset:"0.1913",stopColor:"#AFBAF1"}),/*#__PURE__*/t("stop",{offset:"0.4982",stopColor:"#4281D3"}),/*#__PURE__*/t("stop",{offset:"0.666667",stopColor:"#2E427D"}),/*#__PURE__*/t("stop",{offset:"0.822917",stopColor:"#230101"}),/*#__PURE__*/t("stop",{offset:"1",stopColor:"#8F6B40"})]}),/*#__PURE__*/t("clipPath",{id:"clip0",children:/*#__PURE__*/t("rect",{width:"30",height:"30",fill:"white"})}),/*#__PURE__*/t("clipPath",{id:"clip1",children:/*#__PURE__*/t("rect",{width:"30",height:"30",fill:"white"})})]})]})};const Bu=({chainId:e,...n})=>{if("solana"===e)/*#__PURE__*/return t(Ou,{...n});let a=Uu[e];/*#__PURE__*/return t(a||qt,{...n})},zu=({balance:e,className:n,chain:a})=>/*#__PURE__*/t(vp,{className:n,$state:void 0,children:/*#__PURE__*/t(Vu,{balance:e,chain:a})}),Vu=({balance:a,chain:i})=>/*#__PURE__*/e(n,{children:[/*#__PURE__*/e(Hu,{children:[/*#__PURE__*/t($u,{chainId:"object"==typeof i?i.id:"solana"}),/*#__PURE__*/t(th,{children:"object"==typeof i?i.name:Mp(i)})]}),/*#__PURE__*/e(hu,{isLoading:!1,isPulsing:!1,color:"gray",children:[/*#__PURE__*/t(ju,{children:/*#__PURE__*/t(ze,{})}),a]})]});let Hu=/*#__PURE__*/Ne.div.withConfig({displayName:"Container",componentId:"sc-63f80cee-0"})(["display:flex;align-items:center;"]),ju=/*#__PURE__*/Ne.div.withConfig({displayName:"IconContainer",componentId:"sc-63f80cee-1"})(["height:0.75rem;width:0.75rem;margin-right:0.2rem;"]),$u=/*#__PURE__*/Ne(Bu).withConfig({displayName:"StyledNetworkIcon",componentId:"sc-63f80cee-2"})(["height:1.25rem;width:1.25rem;display:inline-block;margin-right:0.5rem;border-radius:4px;"]);const qu=({options:n,onSelect:a,selected:i,className:r})=>/*#__PURE__*/e(Gt,{as:Gu,children:[/*#__PURE__*/e(Zt,{as:Ku,children:[/*#__PURE__*/t(Vu,{balance:i.balance,chain:i.chain}),/*#__PURE__*/t(Yu,{height:16})]}),/*#__PURE__*/t(Qt,{as:Zu,className:r,children:n.map(((e,n)=>/*#__PURE__*/t(Yt,{as:Qu,onClick:()=>a(n),children:/*#__PURE__*/t(Vu,{balance:e.balance,chain:e.chain})},n)))})]});let Gu=/*#__PURE__*/Ne.div.withConfig({displayName:"Wrapper",componentId:"sc-31c00f79-0"})(["width:100%;position:relative;"]),Zu=/*#__PURE__*/Ne.div.withConfig({displayName:"Popover",componentId:"sc-31c00f79-1"})(["width:100%;margin-top:0.5rem;position:absolute;background-color:var(--privy-color-background);border-radius:var(--privy-border-radius-md);overflow-x:hidden;overflow-y:auto;box-shadow:0px 1px 2px 0px rgba(16,24,40,0.05);max-height:11.75rem;&&{border:solid 1px var(--privy-color-foreground-4);}z-index:1;"]),Qu=/*#__PURE__*/Ne.button.withConfig({displayName:"Button",componentId:"sc-31c00f79-2"})(["width:100%;display:flex;justify-content:space-between;&&{padding:1rem;}:not(:last-child){border-bottom:solid 1px var(--privy-color-foreground-4);}:hover{background:var(--privy-color-background-2);}"]),Yu=/*#__PURE__*/Ne(Vt).withConfig({displayName:"StyledChevronIcon",componentId:"sc-31c00f79-3"})(["height:1rem;margin-left:0.5rem;"]),Ku=/*#__PURE__*/Ne.button.withConfig({displayName:"StyledMenuButton",componentId:"sc-31c00f79-4"})([""," span{margin-left:auto;}","{transition:rotate 100ms ease-in;}&[aria-expanded='true']{","{rotate:-180deg;}}"],wp,Yu,Yu);const Xu=/*#__PURE__*/Ne.div.withConfig({displayName:"FundingMethodContainer",componentId:"sc-eaaa12a-0"})(["display:flex;flex-direction:column;gap:12px;padding-top:24px;padding-bottom:24px;"]),Ju=/*#__PURE__*/Ne.div.withConfig({displayName:"IconContainer",componentId:"sc-eaaa12a-1"})(["width:24px;height:24px;display:flex;justify-content:center;align-items:center;svg{border-radius:var(--privy-border-radius-sm);}"]),em=/*#__PURE__*/Ne.div.withConfig({displayName:"FundingQuantityWrapper",componentId:"sc-eaaa12a-2"})(["display:flex;flex-direction:column;justify-content:center;align-items:flex-start;gap:8px;"]),tm=/*#__PURE__*/Ne.div.withConfig({displayName:"FundingQuantity",componentId:"sc-eaaa12a-3"})(["display:flex;align-items:center;gap:4px;width:100%;padding:0 16px;border-width:1px !important;border-radius:12px;cursor:text;&:focus-within{border-color:var(--privy-color-accent);}"]),nm=/*#__PURE__*/Ne.input.withConfig({displayName:"FundingAmountInput",componentId:"sc-eaaa12a-5"})(["background-color:var(--privy-color-background);width:100%;&:focus{outline:none !important;border:none !important;box-shadow:none !important;}&&{font-size:26px;}"]),am=/*#__PURE__*/Ne(nm).withConfig({displayName:"FundingAmountInputLarge",componentId:"sc-eaaa12a-6"})(["&&{font-size:42px;}"]),im=/*#__PURE__*/Ne.div.withConfig({displayName:"FundingCurrency",componentId:"sc-eaaa12a-8"})(["font-size:18px;"]),rm=/*#__PURE__*/Ne.div.withConfig({displayName:"FundingDollars",componentId:"sc-eaaa12a-9"})(["font-size:12px;color:var(--privy-color-foreground-3);height:20px;"]),om=/*#__PURE__*/Ne.div.withConfig({displayName:"InfoButtonText",componentId:"sc-eaaa12a-13"})([""]),lm=/*#__PURE__*/Ne.a.withConfig({displayName:"InfoButtonLink",componentId:"sc-eaaa12a-14"})(["&&{color:var(--privy-color-accent);}cursor:pointer;"]),sm=({displayName:a,errorMessage:i,configuredFundingChain:r,formattedBalance:o,fundingAmount:l,fundingCurrency:s,fundingAmountInUsd:c,options:d,selectedOption:p,isPreparing:h,isSubmitting:u,addressToFund:m,fundingWalletAddress:g,onSubmit:y,onSelect:f,onAmountChange:w,erc20ContractInfo:v})=>{let b=k(null);/*#__PURE__*/return e(n,{children:[/*#__PURE__*/t(su,{}),/*#__PURE__*/t(Po,{}),/*#__PURE__*/t(yp,{children:"Transfer from another network"}),/*#__PURE__*/e(gp,{children:["You need more funds on the"," ","object"==typeof r?r.name:Mp(r)," ","network. Bridge from another blockchain network."]}),/*#__PURE__*/e(em,{style:{marginTop:"2rem"},children:[/*#__PURE__*/e(tm,{onClick:()=>b.current?.focus(),children:[/*#__PURE__*/t(nm,{ref:b,value:l,onChange:e=>{let t=e.target.value;if(/^[0-9.]*$/.test(t)&&t.split(".").length-1<=1){let e=/\.$/.test(t)?".":"",n=Number(t.replace(/\.$/,"")||"0");if(Number.isNaN(n))return void w("0");w(n.toString()+e)}}}),/*#__PURE__*/t(im,{children:s})]}),c&&/*#__PURE__*/t(rm,{children:c})]}),/*#__PURE__*/e(Xp,{style:{marginTop:"1.5rem"},children:[/*#__PURE__*/t(Zp,{children:"From"}),/*#__PURE__*/t(Zp,{children:lt(g)})]}),/*#__PURE__*/t(qu,{selected:{chain:p.chain,balance:p.isErc20Quote?zp({amount:p.erc20Balance??0n,decimals:v?.decimals??6})+` ${v?.symbol||""}`:ao(p.balance,p.chain.nativeCurrency.symbol,3,!0)},options:d.map((({chain:e,balance:t,isErc20Quote:n,erc20Balance:a})=>({chain:e,balance:n?zp({amount:a??0n,decimals:v?.decimals??6})+` ${v?.symbol||""}`:ao(t,e.nativeCurrency.symbol,3,!0)}))),onSelect:f}),/*#__PURE__*/e(Xp,{style:{marginTop:"1.5rem"},children:[/*#__PURE__*/t(Zp,{children:"To"}),/*#__PURE__*/t(Zp,{children:lt(m)})]}),/*#__PURE__*/t(zu,{chain:r,balance:o}),/*#__PURE__*/t(id,{style:{marginTop:"1rem"},children:i}),/*#__PURE__*/e(ir,{style:{marginTop:"1rem"},loading:u||h,disabled:h||u,onClick:y,children:["Confirm with ",a]}),/*#__PURE__*/t(Fo,{}),/*#__PURE__*/t($i,{})]})},cm=({walletClientType:a,displayName:i,addressToFund:r,chainId:o,chainName:l,isBridging:s,isErc20Flow:c,totalPriceInNativeCurrency:d,totalPriceInUsd:p,gasPriceInNativeCurrency:h,gasPriceInUsd:u})=>{let m=Oa(a);/*#__PURE__*/return e(n,{children:[/*#__PURE__*/t(su,{}),/*#__PURE__*/t(kr,{centerIcon:/*#__PURE__*/t(yu,{icon:m?.image_url?.md,name:a})}),/*#__PURE__*/t(Al,{style:{marginTop:"8px",marginBottom:"12px"},title:`${s?"Bridging":"Confirming"} with ${i}`}),!s&&!c&&/*#__PURE__*/e(Kp,{children:[/*#__PURE__*/e(Xp,{children:[/*#__PURE__*/t(Zp,{children:"Total"}),/*#__PURE__*/t(th,{children:p||d})]}),/*#__PURE__*/e(Xp,{children:[/*#__PURE__*/t(Zp,{children:"To"}),/*#__PURE__*/t(th,{children:/*#__PURE__*/t(rc,{address:r,showCopyIcon:!1})})]}),/*#__PURE__*/e(Xp,{children:[/*#__PURE__*/t(Zp,{children:"Network"}),/*#__PURE__*/t(th,{children:/*#__PURE__*/e(dm,{children:[/*#__PURE__*/t(Bu,{chainId:o,height:16,width:16})," ",l]})})]}),h&&/*#__PURE__*/e(Xp,{children:[/*#__PURE__*/t(Zp,{children:"Estimated fee"}),/*#__PURE__*/t(th,{children:u||h})]})]}),/*#__PURE__*/t(Do,{height:24}),/*#__PURE__*/t($i,{})]})};let dm=/*#__PURE__*/Ne.div.withConfig({displayName:"NetworkColumn",componentId:"sc-5bdbf842-0"})(["display:flex;flex-direction:row;align-items:center;gap:4px;"]);const pm={component:()=>{let a=Z(),{rpcConfig:i,appId:r,closePrivyModal:o,createAnalyticsEvent:l}=O(),{navigate:s,setModalData:c,data:d}=Ni(),p=Z(),{wallets:h}=hl(),[u,m]=T(null),[g,y]=T(null),[f,w]=T([]),[v,b]=T(0),[C,x]=T(!1),[k,A]=T(!1),[S,N]=T(!1),[E,M]=T(!1),[W,L]=T(),[F,D]=T();if(!d?.funding||"solana"!==d.funding.chainType)throw Error("Invalid funding data");let{address:R,chain:U,connectedWallet:B}=d.funding,[z,V]=T(d.funding.amount),H=("ethereum"===B?.type?B:void 0)??h[0],j=Oa(H?.walletClientType||"unknown"),$=j?.name||"wallet",[q,G]=T(null);I((()=>{(async()=>{if(!H)return;let e=await H.getEthereumProvider();G(ve({account:H.address,transport:be(e)}).extend(Ce))})().catch(console.error)}),[H]);let[Q,Y]=T(0n),K=wo(Q);I((()=>{let e=a.solanaRpcs[U];e?_p({rpc:e.rpc,address:R}).then((e=>Y(BigInt(e)))).catch(console.error):console.warn("Unable to load solana rpc, skipping balance")}),[]);let[X,J]=T(),{tokenPrice:ee}=dl("solana"),{fundingAmountInBaseUnit:te,fundingAmountInUsd:ne}=function({amount:e,fee:t,tokenPrice:n,isUsdc:a}){let i=BigInt(Math.floor(parseFloat(e)*10**(a?6:9))),r=a?i:i+t;return{fundingAmountInBaseUnit:i,fundingAmountInUsd:n?yo(i,n):void 0,totalPriceInUsd:n?yo(r,n):void 0,totalPriceInNativeCurrency:wo(r),feePriceInNativeCurrency:wo(t),feePriceInUsd:n?yo(t,n):void 0}}({amount:z,fee:0n,tokenPrice:ee,isUsdc:d.funding.isUSDC});if(I((()=>{(async()=>{if(!q||!H)return;let e=["solana:testnet","solana:devnet"].includes(U);e&&console.warn("Solana testnets are not supported for bridging");let t=qe(p.chains).filter((({testnet:t})=>!!t===e)),n=(await Ru({chains:t,address:H.address,appId:r,rpcConfig:i})).filter((e=>e.balance>0n));if(n.length<1)return void m(new _(`Wallet ${ea(H.address)} does not have enough funds.`,void 0,P.INSUFFICIENT_BALANCE));n.sort(((e,t)=>Number(t.balance-e.balance)));let a=(await Promise.allSettled(n.map((async e=>({...e,quote:await yc({isTestnet:!1,input:uc({appId:r,amount:te.toString(),user:H.address,recipient:R,destinationChainId:dc,destinationCurrency:pc,originChainId:e.chain.id})})}))))).filter((e=>"fulfilled"===e.status)).map((e=>e.value));if(a.length<1)return void m(new _(`Unable to fetch quotes for bridging. Wallet ${ea(H.address)} does not have enough funds.`,void 0,P.INSUFFICIENT_BALANCE));let o=a.map((({quote:e,balance:t,chain:n})=>({bridgeTx:fc(e),balance:t,chain:n,isErc20Quote:!1}))).filter((({bridgeTx:e})=>!!e));if(o.length>1)return void w(o);let l=o.at(0);l?(A(!0),J({data:l.bridgeTx.data,to:l.bridgeTx.to,value:l.bridgeTx.value,chain:l.chain})):m(new _(`Unable to select bridge option from quotes. Wallet ${ea(H.address)} does not have enough funds.`,void 0,P.INSUFFICIENT_BALANCE))})().catch(console.error)}),[q]),I((()=>{(async()=>{let e,t;if(!q||!H||C||S||!X)return;x(!0);let n=ce({chain:X.chain,transport:de(Xn(X.chain,i,r))});try{e=await n.prepareTransactionRequest({account:H.address,to:X.to,chain:X.chain,data:X.data,value:BigInt(X.value??0)})}catch(e){console.error(e),f.length>1&&y(e.shortMessage??"Something went wrong")}if(e){x(!1),N(!0);try{await q.switchChain({id:X.chain.id})}catch(e){await q.addChain({chain:X.chain}),await q.switchChain({id:X.chain.id})}try{t=await q.sendTransaction(e)}catch(e){console.error(e),"TransactionExecutionError"===e.name&&(f.length<1?m(new _(e.shortMessage,void 0,P.TRANSACTION_FAILURE)):y(e.shortMessage??"Something went wrong"))}if(t)return await q.waitForTransactionReceipt({hash:t}),k?(D("pending"),void L(t)):(N(!1),M(!0),void l({eventName:Ep,payload:{provider:"external",status:"success",txHash:t,address:H.address,chainId:X.chain.id,chainType:"ethereum",value:X.value?me(BigInt(X.value),18):void 0,token:"ETH",destination:R,destinationClusterName:"mainnet-beta",destinationChainType:"solana",destinationValue:me(te,9),destinationToken:"SOL"}}));N(!1)}else x(!1)})().catch(console.error)}),[q,X]),vc({transactionHash:W,isTestnet:!1,bridgingStatus:F,setBridgingStatus:D,onSuccess({transactionHash:e}){A(!1),M(!0),l({eventName:Ep,payload:{provider:"external",status:"success",txHash:e,address:H?.address,chainId:X?.chain.id,chainType:"ethereum",value:X?.value?me(BigInt(X.value),18):void 0,token:"ETH",destination:R,destinationClusterName:"mainnet-beta",destinationChainType:"solana",destinationValue:me(te,9),destinationToken:"SOL"}})},onFailure({error:e}){A(!1),m(e)}}),I((()=>{u&&(c({funding:d?.funding,solanaFundingData:d?.solanaFundingData,sendTransaction:d?.sendTransaction,errorModalData:{error:u,previousScreen:ym}}),s(xc,!1))}),[u]),I((()=>{if(!E)return;let e=setTimeout(o,ie);return()=>clearTimeout(e)}),[E]),E/*#__PURE__*/)return e(n,{children:[/*#__PURE__*/t(su,{}),/*#__PURE__*/t(Po,{}),/*#__PURE__*/e(_o,{children:[/*#__PURE__*/t($t,{color:"var(--privy-color-success)",width:"64px",height:"64px"}),/*#__PURE__*/t(Al,{title:"Success!",description:`You’ve successfully added ${z} SOL to your ${p.name} wallet. It may take a minute before the funds are available to use.`})]}),/*#__PURE__*/t(Fo,{}),/*#__PURE__*/t($i,{})]});let ae=f[v];return f.length>1&&ae?/*#__PURE__*/t(sm,{displayName:$,configuredFundingChain:U,formattedBalance:K,fundingAmount:z,fundingCurrency:"SOL",fundingAmountInUsd:ne,options:f,selectedOption:ae,isPreparing:C,isSubmitting:S,addressToFund:R,fundingWalletAddress:H?.address||"",errorMessage:g,onSubmit:()=>{d.funding?.amount!==z?async function(){if(H&&ae)try{let e=await yc({isTestnet:!1,input:uc({appId:r,amount:te.toString(),user:H.address,recipient:R,destinationChainId:dc,destinationCurrency:pc,originChainId:ae.chain.id})}),t=fc(e);if(!t)throw Error("Invalid transaction request");A(!0),J({data:t.data,to:t.to,value:t.value,chain:ae.chain})}catch(e){console.error(e),m(new _("Unable to fetch quotes for bridging",e,P.INSUFFICIENT_BALANCE))}}().catch(console.error):J({to:ae.bridgeTx.to,data:ae.bridgeTx.data,value:ae.bridgeTx.value,chain:ae.chain})},onSelect:e=>{e!==v&&(y(null),b(e))},onAmountChange:V}):S&&H?/*#__PURE__*/t(cm,{walletClientType:H?.walletClientType||"unknown",displayName:$,addressToFund:R,isBridging:k,isErc20Flow:!1,chainId:"solana",chainName:Mp(U),totalPriceInUsd:void 0,totalPriceInNativeCurrency:void 0,gasPriceInUsd:void 0,gasPriceInNativeCurrency:void 0}):
22
- /*#__PURE__*/e(n,{children:[/*#__PURE__*/t(su,{}),/*#__PURE__*/t(kr,{}),/*#__PURE__*/t("div",{style:{marginTop:"1rem"}}),/*#__PURE__*/t($i,{})]})}},hm={component:()=>{let{rpcConfig:a,appId:i,closePrivyModal:r,createAnalyticsEvent:o}=O(),{navigate:l,setModalData:s,data:c}=Ni(),d=Z(),{wallets:p}=hl(),[h,u]=T(!1),[m,g]=T(0n),[y,f]=T(!1),[w,v]=T(null),[b,C]=T(null),[x,k]=T([]),[A,S]=T(0),[N,E]=T(!1),[M,W]=T(!1),[L,F]=T(!1),[D,R]=T(!1),[U,B]=T(),[z,V]=T();if(!c?.funding||"ethereum"!==c.funding.chainType)throw Error("Invalid funding data");let{erc20ContractInfo:H,chain:j,connectedWallet:$}=c.funding,q=c.funding.address,G=c.funding.erc20Address,[Q,Y]=T(c.funding.amount);I((()=>{G&&!H&&v(Error("Unable to fetch token details"))}),[]);let K=!!G&&!!H,X=K?BigInt(parseFloat(Q)*10**H.decimals):xe(Q),J=("ethereum"===$?.type?$:void 0)??p[0],ee=Oa(J?.walletClientType||"unknown"),te=ee?.name||"wallet",[ne,ae]=T(null);I((()=>{(async()=>{if(!J)return;let e=await J.getEthereumProvider();ae(ve({account:J.address,transport:be(e)}).extend(Ce))})().catch(console.error)}),[J]);let[re,oe]=T(0n);I((()=>{ce({chain:j,transport:de(Xn(j,a,i))}).getBalance({address:q}).then(oe).catch(console.error)}),[]);let[le,se]=T(0n);I((()=>{K&&Lp({chain:j,address:q,appId:i,rpcConfig:a,erc20Address:G}).then((e=>se(e.balance))).catch(console.error)}),[]);let{tokenPrice:pe}=dl(j.id),[he,ue]=T({to:q,chain:j,value:X,data:void 0});I((()=>{(async()=>{let e,t;if(!ne||!J||N||L)return;E(!0);let n=ce({chain:he.chain,transport:de(Xn(he.chain,a,i))});if(K&&!he.data)return await n.simulateContract({address:G,chain:he.chain,abi:Gh,functionName:"transfer",args:[q,X],account:J.address}).catch((e=>{console.warn("Simulated token transfer failed with error, fetching bridge options.",e)}))?(E(!1),void ue({to:G,chain:he.chain,data:ke({abi:Gh,functionName:"transfer",args:[q,X]}),value:"0x0"})):(E(!1),void f(!0));try{e=await n.prepareTransactionRequest({account:J.address,to:he.to,chain:he.chain,data:he.data,value:BigInt(he.value??0)})}catch(e){if(console.error(e),x.length>1)C(e.shortMessage??"Something went wrong");else if(M&&0===x.length)return void v(new _(`Wallet ${ea(J.address)} does not have enough funds.`,void 0,P.INSUFFICIENT_BALANCE))}if(!e)return E(!1),void f(!0);E(!1),F(!0),u(!0),g(e.gas);try{await ne.switchChain({id:he.chain.id})}catch(e){await ne.addChain({chain:he.chain}),await ne.switchChain({id:he.chain.id})}try{t=await ne.sendTransaction(e)}catch(e){if(console.error(e),"TransactionExecutionError"===e.name)if(x.length<1){let t=e.shortMessage;(e.shortMessage.includes("rejected the request")||e.details.includes("rejected the request"))&&(t="User rejected the request."),v(new _(t,void 0,P.TRANSACTION_FAILURE))}else C(e.shortMessage??"Something went wrong")}if(t)return await ne.waitForTransactionReceipt({hash:t}),F(!1),M?(B(t),void V("pending")):(R(!0),void o({eventName:Ep,payload:{provider:"external",status:"success",txHash:t,address:J.address,chainId:he.chain.id,chainType:"ethereum",value:he.value?me(BigInt(he.value),H?.decimals??18):void 0,token:H?.symbol??G??"ETH",destinationAddress:q,destinationChainId:j.id,destinationChainType:"ethereum",destinationValue:X?me(X,H?.decimals??18):void 0,destinationToken:H?.symbol??G??j.nativeCurrency.name}}));F(!1)})().catch(console.error)}),[ne,he]),I((()=>{(async()=>{if(!y||!ne||!J)return;let e=qe(d.chains).filter((e=>e.id!==j.id&&!!e.testnet==!!j.testnet));K&&e.unshift(j);let t=await Ru({chains:e,address:J.address,appId:i,rpcConfig:a,includeUsdc:c.funding?.isUSDC}),n=K?t.filter((e=>e.balance>0n)):t.filter((e=>e.balance>X)),r=K&&t.every((e=>0n===e.balance));if(n.length<1)return void v(new _(r?`Wallet ${ea(J.address)} doesn't have enough funds to cover gas fees. Top up your wallet and try again.`:`Wallet ${ea(J.address)} does not have enough funds.`,void 0,P.INSUFFICIENT_BALANCE));n.sort(((e,t)=>Number(K?(t.erc20Balance??0n)-(e.erc20Balance??0n):t.balance-e.balance)));let o=n.flatMap((e=>{let t=[{...e,isErc20Quote:!1,isTestnet:!!j.testnet,input:uc({appId:i,amount:X.toString(),user:J.address,recipient:q,destinationChainId:j.id,destinationCurrency:G,originChainId:e.chain.id})}];return K&&G&&(e.erc20Balance??0n)>=X&&t.push({...e,isErc20Quote:!0,isTestnet:!!j.testnet,input:uc({appId:i,amount:X.toString(),user:J.address,recipient:q,destinationChainId:j.id,destinationCurrency:G,originChainId:e.chain.id,originCurrency:e.erc20Address})}),t})),l=(await Promise.allSettled(o.map((async e=>({...e,quote:await yc(e)}))))).filter((e=>"fulfilled"===e.status)).map((e=>e.value));if(l.length<1)return void v(new _(`Wallet ${ea(J.address)} does not have enough funds.`,void 0,P.INSUFFICIENT_BALANCE));let s=l.map((e=>({bridgeTx:fc(e.quote),balance:e.balance,chain:e.chain,erc20Balance:e.erc20Balance,isErc20Quote:e.isErc20Quote}))).filter((e=>!!e.bridgeTx));if(s.length>1)return void k(s);let p=s[0];p?(W(!0),ue({data:p.bridgeTx.data,to:p.bridgeTx.to,value:p.bridgeTx.value,chain:p.chain})):v(new _(`Wallet ${ea(J.address)} does not have enough funds.`,void 0,P.INSUFFICIENT_BALANCE))})().catch(console.error)}),[y]),vc({transactionHash:U,isTestnet:!!j.testnet,bridgingStatus:z,setBridgingStatus:V,onSuccess({transactionHash:e}){W(!1),R(!0),o({eventName:Ep,payload:{provider:"external",status:"success",txHash:e,address:J?.address,chainId:he.chain.id,chainType:"ethereum",value:he.value?me(BigInt(he.value),H?.decimals??18):void 0,token:H?.symbol??G??"ETH",destinationAddress:q,destinationChainId:j.id,destinationChainType:"ethereum",destinationValue:X?me(X,H?.decimals??18):void 0,destinationToken:H?.symbol??G??j.nativeCurrency.name}})},onFailure({error:e}){W(!1),v(e)}}),I((()=>{w&&(s({funding:c?.funding,solanaFundingData:c?.solanaFundingData,sendTransaction:c?.sendTransaction,errorModalData:{error:w,previousScreen:ym}}),l(xc,!1))}),[w]);let ge=!K&&pe?to(Q??"0",pe):void 0,ye=K?m:ro([m,X]),fe=ye&&pe?no(ye,pe):void 0,we=ye?ao(ye,c?.funding?.erc20Address?c?.funding?.erc20ContractInfo?.symbol||"ETH":c?.funding?.chain.nativeCurrency.symbol||"ETH"):void 0,Te=m&&pe?no(m,pe):void 0,Ae=m?ao(m,j?.nativeCurrency?.symbol||"ETH"):void 0;if(I((()=>{if(!D)return;let e=setTimeout(r,ie);return()=>clearTimeout(e)}),[D]),D/*#__PURE__*/)return e(n,{children:[/*#__PURE__*/t(su,{}),/*#__PURE__*/t(Po,{}),/*#__PURE__*/e(_o,{children:[/*#__PURE__*/t($t,{color:"var(--privy-color-success)",width:"64px",height:"64px"}),/*#__PURE__*/t(Al,{title:"Success!",description:`You’ve successfully added ${Q} ${K?H.symbol:j.nativeCurrency.symbol} to your ${d.name} wallet. It may take a minute before the funds are available to use.`})]}),/*#__PURE__*/t(Fo,{}),/*#__PURE__*/t($i,{})]});let Ie=K?`${zp({amount:le,decimals:H.decimals})} ${H.symbol}`:ao(re,j.nativeCurrency.symbol,3,!0),Se=x[A];return x.length>1&&Se?/*#__PURE__*/t(sm,{displayName:te,configuredFundingChain:j,erc20ContractInfo:H,formattedBalance:Ie,fundingAmount:Q,fundingCurrency:K?H.symbol:j.nativeCurrency.symbol,fundingAmountInUsd:ge,options:x,selectedOption:Se,isPreparing:N,isSubmitting:L,addressToFund:q,fundingWalletAddress:J?.address||"",errorMessage:b,onSubmit:()=>{c.funding?.amount!==Q?async function(){if(J&&Se)try{let e=await yc({isTestnet:!!j.testnet,input:uc({appId:i,amount:X.toString(),user:J.address,recipient:q,destinationChainId:j.id,destinationCurrency:G,originChainId:Se.chain.id})}),t=fc(e);if(!t)throw Error("Invalid transaction request");W(!0),ue({data:t.data,to:t.to,value:t.value,chain:Se.chain})}catch(e){console.error(e),v(new _("Unable to fetch quotes for bridging",e,P.INSUFFICIENT_BALANCE))}}().catch(console.error):ue({to:Se.bridgeTx.to,data:Se.bridgeTx.data,value:Se.bridgeTx.value,chain:Se.chain})},onSelect:e=>{e!==A&&(C(null),S(e))},onAmountChange:Y}):h&&m&&J&&c?.funding?/*#__PURE__*/t(cm,{walletClientType:J?.walletClientType||"unknown",displayName:te,addressToFund:q,isBridging:M,isErc20Flow:K,totalPriceInUsd:fe,totalPriceInNativeCurrency:we,gasPriceInUsd:Te,gasPriceInNativeCurrency:Ae,chainId:j.id,chainName:j.name}):
23
- /*#__PURE__*/e(n,{children:[/*#__PURE__*/t(su,{}),/*#__PURE__*/t(kr,{}),/*#__PURE__*/t("div",{style:{marginTop:"1rem"}}),/*#__PURE__*/t($i,{})]})}},um=Symbol("solana-funding-plugin"),mm={component:function(){let a=Z(),{closePrivyModal:i,createAnalyticsEvent:r,connectors:o}=O(),{navigate:l,setModalData:s,data:c}=Ni(),d=Z(),p=k(!1),h=Gd(),[u,m]=T(!1),[g,y]=T(!1),[f,w]=T(null),[v,b]=T(),[C,x]=T();if(!c?.funding||"ethereum"!==c.funding.chainType)throw Error("Invalid funding data");let{amount:S,connectedWallet:N,chain:E,solanaChain:M,isUSDC:W}=c.funding,L=c.funding.address,F=c.funding.erc20Address,D=c.funding.isUSDC?"USDC":E.nativeCurrency.symbol,R=A((()=>"solana"===N?.type?N.provider:function({connectors:e,connectedWalletAddress:t}){let n=e.find((e=>"solana"===e.chainType&&e.wallets.some((e=>e.address===t)))),a=n?.wallet.accounts.find((e=>e.address===t));if(!n||!a)throw new _("Unable to find source wallet connector");return new $e({wallet:n.wallet,account:a})}({connectors:o,connectedWalletAddress:N?.address||""})),[N,o]),U=A((()=>{let e=h(um);if(!e)throw new _("Unable to load solana plugin");let t=a.solanaRpcs["solana:mainnet"];if(!t)throw new _("Unable to load mainnet RPC");return e.getSolanaRpcClient({rpc:t.rpc,rpcSubscriptions:t.rpcSubscriptions,chain:"solana:mainnet",blockExplorerUrl:t.blockExplorerUrl??"https://explorer.solana.com"})}),[]),B=Oa(yi(R?.standardWallet.name||"unknown")),z=B?.name||"wallet";return I((()=>{(async function(){if(!R||!E||p.current)return;let e=h(um);if(!e)return void w(new _("Unable to solana plugin"));p.current=!0,E?.testnet&&console.warn("Solana testnets are not supported for bridging");let t=W?1e6*parseFloat(S):xe(S),n=await yc({isTestnet:!!E.testnet,input:uc({appId:d.id,amount:t.toString(),user:R.address,recipient:L,destinationChainId:E.id,originChainId:dc,originCurrency:W?"EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v":pc,destinationCurrency:W?F:void 0})}).catch(console.error);if(!n)return void w(new _(`Unable to fetch quotes for bridging. Wallet ${ta(R.address)} does not have enough funds.`,void 0,P.INSUFFICIENT_BALANCE));let a=await e.createTransactionFromRelayQuote({quote:n,source:R.address,solanaClient:U});if(a)try{m(!0);let t=await e.simulateTransaction({solanaClient:U,tx:a});if(t.hasError)return t.hasFunds?(console.error("Transaction failed:",t.error),void w(new _("Something went wrong",void 0,P.TRANSACTION_FAILURE))):void w(new _(`Wallet ${ta(R?.address)} does not have enough funds. ${n.details.currencyIn.amountFormatted} ${D} are needed to complete the transaction.`,void 0,P.INSUFFICIENT_BALANCE));let{signature:i}=await R.signAndSendTransaction({chain:"solana:mainnet",transaction:a}),r=e.getAddressFromBuffer(i);b(r),x("pending")}catch(e){if(console.error(e),/user rejected the request/gi.test(e.message||""))return void w(new _("Transaction was rejected by the user",void 0,P.TRANSACTION_FAILURE));w(new _("Something went wrong",void 0,P.TRANSACTION_FAILURE))}else w(new _(`Unable to select bridge option from quotes. Wallet ${ta(R.address)} does not have enough funds.`,void 0,P.INSUFFICIENT_BALANCE))})().catch(console.error)}),[]),vc({transactionHash:v,isTestnet:!1,bridgingStatus:C,setBridgingStatus:x,onSuccess({transactionHash:e}){m(!1),y(!0),r({eventName:Ep,payload:{provider:"external",status:"success",txHash:e,address:R.address,chainType:"solana",clusterName:M,token:"SOL",destinationAddress:L,destinationChainId:E.id,destinationChainType:"ethereum",destinationValue:S,destinationToken:W?"USDC":"ETH"}})},onFailure({error:e}){m(!1),w(e)}}),I((()=>{if(!g)return;let e=setTimeout(i,ie);return()=>clearTimeout(e)}),[g]),I((()=>{f&&(s({funding:c?.funding,solanaFundingData:c?.solanaFundingData,sendTransaction:c?.sendTransaction,errorModalData:{error:f,previousScreen:ym}}),l(xc,!1))}),[f]),g?/*#__PURE__*/e(n,{children:[/*#__PURE__*/t(su,{}),/*#__PURE__*/t(Po,{}),/*#__PURE__*/e(_o,{children:[/*#__PURE__*/t($t,{color:"var(--privy-color-success)",width:"64px",height:"64px"}),/*#__PURE__*/t(Al,{title:"Success!",description:`You’ve successfully added ${S} ${D} to your ${d.name} wallet. It may take a minute before the funds are available to use.`})]}),/*#__PURE__*/t(Fo,{}),/*#__PURE__*/t($i,{})]}):u&&R?/*#__PURE__*/t(cm,{walletClientType:yi(R?.standardWallet.name||"unknown"),displayName:z,addressToFund:L,isBridging:u,isErc20Flow:!1,chainId:E.id,chainName:E.name,totalPriceInUsd:void 0,totalPriceInNativeCurrency:void 0,gasPriceInUsd:void 0,gasPriceInNativeCurrency:void 0}):
24
- /*#__PURE__*/e(n,{children:[/*#__PURE__*/t(su,{}),/*#__PURE__*/t(kr,{}),/*#__PURE__*/t("div",{style:{marginTop:"1rem"}}),/*#__PURE__*/t($i,{})]})}},gm={component:()=>{let{data:a,setModalData:i}=Ni(),r=a?.funding,o="solana"===r.chainType,l=k(null),{tokenPrice:s}=dl(o?"solana":r.chain.id),c=o?void 0:r,d=!(!c?.erc20Address||c?.erc20ContractInfo),p=o?r.isUSDC?"USDC":"SOL":r.erc20Address?r.erc20ContractInfo?.symbol:r.chain.nativeCurrency.symbol||"ETH",h=parseFloat(r.amount),u=!isNaN(h)&&h>0,m=s?to(r.amount,s):void 0;/*#__PURE__*/return e(n,{children:[/*#__PURE__*/t(su,{}),/*#__PURE__*/t(yp,{children:"Confirm or edit amount"}),/*#__PURE__*/e(Mo,{style:{marginTop:"32px"},children:[/*#__PURE__*/t(em,{children:d?/*#__PURE__*/t(kr,{size:"50px"}):/*#__PURE__*/e(n,{children:[/*#__PURE__*/e(tm,{onClick:()=>l.current?.focus(),children:[/*#__PURE__*/t(am,{ref:l,value:r.amount,onChange:e=>{let t=e.target.value;/^[0-9.]*$/.test(t)&&t.split(".").length-1<=1&&i({...a,funding:{...r,amount:t},solanaFundingData:a?.solanaFundingData?{...a.solanaFundingData,amount:t}:void 0})}}),/*#__PURE__*/t(im,{children:p})]}),!c?.erc20Address&&/*#__PURE__*/t(rm,{children:m&&u?`${m} USD`:""})]})}),/*#__PURE__*/t(ir,{style:{marginTop:"1rem"},disabled:!u,onClick:r.onContinueWithExternalWallet,children:"Continue"})]}),/*#__PURE__*/t($i,{})]})}},ym={component:()=>{let a,{connectors:i}=O(),{setModalData:r,data:o,navigate:l}=Ni(),s=Z(),{wallets:c}=hl(),d=i.filter(xi).flatMap((e=>e.wallets)),[p,h]=T("default"),u="solana"===o?.funding?.chainType,m=!!o?.funding?.crossChainBridgingEnabled;a="ethereum"===o?.funding?.chainType?o.funding.erc20Address&&!o.funding.isUSDC?"ethereum-only":m&&!o.funding.chain.testnet?"ethereum-and-solana":"ethereum-only":m&&!o.funding?.isUSDC?"ethereum-and-solana":"solana-only";let g=c.filter((e=>"privy"!==e.walletClientType)),y=g.map((e=>e.walletClientType)),f=d.filter((e=>"privy"!==e.walletClientType)),w=f.map((e=>e.walletClientType)),v=[],b={...o.funding};b.usingDefaultFundingMethod&&(b.usingDefaultFundingMethod=!1);let C=({wallet:e,walletChainType:t})=>{r({...o,funding:{...b,connectedWallet:e,onContinueWithExternalWallet:()=>l(k({destChainType:u?"solana":"ethereum",sourceChainType:t}))},solanaFundingData:o?.solanaFundingData?{...o.solanaFundingData,sourceWalletData:{address:e.address,walletClientType:e.walletClientType}}:void 0}),l(gm)};"solana-only"!==a&&v.push(...g.map(((e,n)=>/*#__PURE__*/t(fm,{onClick:()=>C({wallet:e,walletChainType:"ethereum"}),icon:e.meta.icon,name:e.meta.name,chainType:e.type},n)))),"ethereum-only"!==a&&v.push(...f.map(((e,n)=>/*#__PURE__*/t(fm,{onClick:()=>C({wallet:e,walletChainType:"solana"}),icon:e.meta.icon,name:e.meta.name,chainType:e.type},n)))),v.push(...Du({walletList:s.appearance.walletList.filter((e=>!g.some((t=>t.walletClientType===e))&&!f.some((t=>t.walletClientType===e)))),walletChainType:a,connectors:i,connectOnly:!0,ignore:[...s.appearance.walletList,...y,...w],walletConnectEnabled:s.externalWallets.walletConnect.enabled}));let x=/*#__PURE__*/t(mu,{text:"More wallets",onClick:()=>h("overflow")}),k=({sourceChainType:e,destChainType:t})=>"ethereum"===e&&"solana"===t?pm:"ethereum"===e&&"ethereum"===t?hm:"solana"===e&&"ethereum"===t?mm:b.externalSolanaFundingScreen;return I((()=>{r({...o,externalConnectWallet:{onCompleteNavigateTo:({address:e,walletClientType:t,walletChainType:n})=>{let a=n??"ethereum",i="ethereum"===a?g.find((n=>n.address===e&&n.walletClientType===t)):f.find((n=>n.address===e&&n.walletClientType===t));return r({...o,funding:{...b,connectedWallet:i,onContinueWithExternalWallet:()=>{l(k({destChainType:u?"solana":"ethereum",sourceChainType:a}))}},solanaFundingData:o?.solanaFundingData?{...o.solanaFundingData,sourceWalletData:{address:e||"",walletClientType:t||""}}:void 0}),gm}}})}),[]),/*#__PURE__*/e(n,"overflow"===p?{children:[/*#__PURE__*/t(yr,{backFn:()=>h("default")},"header"),/*#__PURE__*/e(Li,{children:[/*#__PURE__*/t(gp,{style:{color:"var(--privy-color-foreground-3)",textAlign:"left"},children:"More wallets"}),v]}),/*#__PURE__*/t($i,{})]}:{children:[/*#__PURE__*/t(su,{}),/*#__PURE__*/t(Al,{title:"Transfer from wallet",description:"Connect a wallet to deposit funds or send funds manually to your wallet address."}),/*#__PURE__*/e(Li,{children:[v.length>4?v.slice(0,3):v,v.length>4&&x]}),/*#__PURE__*/t($i,{})]})}};let fm=({onClick:n,icon:a,name:i,chainType:r})=>/*#__PURE__*/e(Ri,{onClick:n,children:[/*#__PURE__*/t(Ju,{style:{width:20},children:/*#__PURE__*/t("img",{src:a})}),i,/*#__PURE__*/t(hu,{color:"gray",style:{marginLeft:"auto"},children:"Connected"}),"solana"===r&&/*#__PURE__*/t(hu,{color:"gray",children:"Solana"})]});const wm={component:()=>{let{data:a,setModalData:i,navigate:r,navigateBack:o}=Ni(),{closePrivyModal:l,createAnalyticsEvent:s,client:c}=O(),[d,p]=T("pending-in-flow"),h=k(0),u={...a?.funding,showAlternateFundingMethod:!0};u.usingDefaultFundingMethod&&(u.usingDefaultFundingMethod=!1);let{partnerUserId:m,popup:g}=a?.coinbaseOnrampStatus??{};return I((()=>{if("pending-in-flow"===d||"pending-after-flow"===d){let e=setInterval((async()=>{if(m)try{let{status:e}=await c.getCoinbaseOnRampStatus({partnerUserId:m});if("success"===e)return void p("success");if("failure"===e)throw Error("There was an error completing Coinbase Onramp flow.");if(h.current>=3)return i({funding:u,solanaFundingData:a?.solanaFundingData}),void r(Om);g?.closed&&(h.current=h.current+1,p("pending-after-flow"))}catch(e){console.error(e),p("error"),s({eventName:Ep,payload:{status:"failure",provider:"coinbase-onramp",error:e.message}}),i({funding:{...u,errorMessage:"Something went wrong adding funds. Please try again or use another method."},solanaFundingData:a?.solanaFundingData}),r(Om)}}),1500);return()=>clearInterval(e)}}),[m,g,d]),/*#__PURE__*/e(n,{children:[/*#__PURE__*/t(yr,{title:"Fund account",backFn:()=>{i({funding:u,solanaFundingData:a?.solanaFundingData}),o()}},"header"),/*#__PURE__*/t(vm,{status:d,onClickCta:l}),/*#__PURE__*/t($i,{})]})}};let vm=({status:a,onClickCta:i})=>{let{title:r,body:o,cta:l}=A((()=>(e=>{switch(e){case"success":return{title:"You've funded your account!",body:"It may take a few minutes for the assets to appear.",cta:"Continue"};case"pending-after-flow":return{title:"In Progress",body:"Almost done. Retrieving transaction status from Coinbase",cta:""};case"error":case"pending-in-flow":return{title:"In Progress",body:"Go back to Coinbase Onramp to finish funding your account.",cta:""}}})(a)),[a]);/*#__PURE__*/return e(n,{children:[/*#__PURE__*/e(xm,{children:[/*#__PURE__*/t(bm,{isSucccess:"success"===a}),/*#__PURE__*/e(Wo,{children:[/*#__PURE__*/t("h3",{children:r}),/*#__PURE__*/t(Cm,{children:o})]})]}),l&&/*#__PURE__*/t(ar,{onClick:i,children:l})]})},bm=({isSucccess:n})=>{if(!n){let n="var(--privy-color-foreground-4)";/*#__PURE__*/return e("div",{style:{position:"relative"},children:[/*#__PURE__*/t(Ki,{color:n,style:{position:"absolute"}}),/*#__PURE__*/t(Xi,{color:n}),/*#__PURE__*/t(Ha,{style:{position:"absolute",width:"2.8rem",height:"2.8rem",top:"1.2rem",left:"1.2rem"}})]})}let a=(e=>e?Xt:()=>/*#__PURE__*/t(Ot,{width:"3rem",height:"3rem",style:{backgroundColor:"var(--privy-color-foreground-4)",color:"var(--privy-color-background)",borderRadius:"100%",padding:"0.5rem",margin:"0.5rem"}}))(n),i=(e=>e?"var(--privy-color-success)":"var(--privy-color-foreground-4)")(n);/*#__PURE__*/return t("div",{style:{borderColor:i,display:"flex",justifyContent:"center",alignItems:"center",borderRadius:"100%",borderWidth:2,padding:"0.5rem",marginBottom:"0.5rem"},children:a&&/*#__PURE__*/t(a,{width:"4rem",height:"4rem",color:i})})},Cm=/*#__PURE__*/Ne.p.withConfig({displayName:"StatusBody",componentId:"sc-8428a551-0"})(["font-size:1rem;color:var(--privy-color-foreground-3);margin-bottom:1rem;display:flex;flex-direction:column;gap:1rem;"]),xm=/*#__PURE__*/Ne.div.withConfig({displayName:"ConnectContainer",componentId:"sc-8428a551-1"})(["display:flex;flex-direction:column;align-items:center;justify-content:center;margin-left:1.75rem;margin-right:1.75rem;padding:2rem 0;"]);let km={[tt.id]:"ethereum",[it.id]:"base",[et.id]:"optimism",[Je.id]:"polygon",[ot.id]:"arbitrum",[rt.id]:"avacchain"};const Tm=(e,t,n,a,i,r)=>new Promise((async(o,l)=>{let s=Kt();if(!s)return void l(Error("Unable to initialize flow"));let c="ethereum"===t.chainType?function(e){let t=km[e];if(!t)throw new _(`Unsupported chainId: ${e} for Coinbase Onramp`);return t}(t.chain.id):"solana",d=t.isUSDC?"USDC":"ethereum"===t.chainType?st(t.chain.id,"native-currency"):"SOL",p=await e.initCoinbaseOnRamp({addresses:[{address:t.address,blockchains:[c]}],assets:[d]}),{url:h}=ct({appId:e.getAppId(),input:p,amount:t.amount,blockchain:c,asset:d,experience:r});s.location=h.toString();let u={...i?.funding,showAlternateFundingMethod:!0};t.usingDefaultFundingMethod&&(u.usingDefaultFundingMethod=!1),n({funding:u,solanaFundingData:i?.solanaFundingData,coinbaseOnrampStatus:{popup:s}}),a(wm),e.createAnalyticsEvent({eventName:"sdk_fiat_on_ramp_started",payload:{provider:"coinbase-onramp",value:t.amount,chainType:t.chainType,chainId:"ethereum"===t.chainType?t.chain.id:t.chain}}),setTimeout((()=>{n({funding:u,solanaFundingData:i?.solanaFundingData,coinbaseOnrampStatus:{partnerUserId:p.partner_user_id,popup:s}})}),5e3),o()})),Am="moonpay";function Im(e){return parseFloat(e)}function Sm(e,t=!1){let[n,a]=T(null),{createAnalyticsEvent:i}=O(),{data:r,navigate:o,setModalData:l}=Ni(),s=r?.funding,c=k(0);return I((()=>{let n=setInterval((async()=>{if(e)try{let[c]=await async function(e,t){return Jt(`${t?re:oe}/transactions/ext/${e}`,{query:{apiKey:t?le:se}})}(e,t),d="waitingAuthorization"===c.status&&"credit_debit_card"===c.paymentMethod?"pending":c.status;if(["failed","completed","awaitingAuthorization"].includes(d)&&(i({eventName:Ep,payload:{status:d,provider:Am,paymentMethod:c.paymentMethod,cardPaymentType:c.cardPaymentType,currency:c.currency?.code,baseCurrencyAmount:c.baseCurrencyAmount,quoteCurrencyAmount:c.quoteCurrencyAmount,feeAmount:c.feeAmount,extraFeeAmount:c.extraFeeAmount,networkFeeAmount:c.networkFeeAmount,isSandbox:t}}),clearInterval(n)),"failed"===d||"serviceFailure"===d)return l({funding:{...s,errorMessage:"Something went wrong adding funds from Moonpay. Please try again or use another method to fund your wallet."},solanaFundingData:r?.solanaFundingData}),void o(Om);a(d)}catch(e){404!==e.response?.status&&(c.current+=1),c.current>=3&&(i({eventName:Ep,payload:{status:"serviceFailure",provider:Am}}),clearInterval(n),l({funding:{...s,errorMessage:"Something went wrong adding funds from Moonpay. Please try again or use another method to fund your wallet."},solanaFundingData:r?.solanaFundingData}),o(Om))}}),3e3);return()=>clearInterval(n)}),[e,c]),n}const Nm=({size:n=61,...a})=>/*#__PURE__*/t("svg",{width:n,height:n,viewBox:"0 0 61 61",fill:"none",xmlns:"http://www.w3.org/2000/svg",...a,children:/*#__PURE__*/e("g",{id:"moonpay_symbol_wht 2",children:[/*#__PURE__*/t("rect",{x:"1.3374",y:"1",width:"59",height:"59",rx:"11.5",fill:"#7715F5"}),/*#__PURE__*/t("path",{id:"Vector",d:"M43.8884 23.3258C45.0203 23.3258 46.1268 22.9901 47.068 22.3613C48.0091 21.7324 48.7427 20.8386 49.1759 19.7928C49.6091 18.747 49.7224 17.5962 49.5016 16.4861C49.2807 15.3759 48.7357 14.3561 47.9353 13.5557C47.1349 12.7553 46.1151 12.2102 45.0049 11.9893C43.8947 11.7685 42.7439 11.8819 41.6982 12.3151C40.6524 12.7482 39.7585 13.4818 39.1297 14.423C38.5008 15.3641 38.1651 16.4707 38.1651 17.6026C38.165 18.3542 38.3131 19.0985 38.6007 19.7929C38.8883 20.4873 39.3098 21.1182 39.8413 21.6496C40.3728 22.1811 41.0037 22.6027 41.6981 22.8903C42.3925 23.1778 43.1367 23.3259 43.8884 23.3258ZM26.3395 49.1017C23.5804 49.1017 20.8832 48.2836 18.5891 46.7507C16.295 45.2178 14.5069 43.039 13.4511 40.49C12.3952 37.9409 12.1189 35.1359 12.6572 32.4298C13.1955 29.7237 14.5241 27.238 16.4751 25.287C18.4262 23.336 20.9118 22.0074 23.6179 21.4691C26.324 20.9308 29.129 21.2071 31.6781 22.2629C34.2272 23.3189 36.406 25.1069 37.9389 27.401C39.4717 29.6952 40.2899 32.3923 40.2899 35.1514C40.2899 36.9835 39.9291 38.7975 39.2281 40.49C38.527 42.1826 37.4994 43.7205 36.204 45.0159C34.9086 46.3113 33.3707 47.3389 31.6781 48.04C29.9856 48.741 28.1715 49.1018 26.3395 49.1017Z",fill:"white"})]})});const Em={component:()=>{let{data:a,setModalData:i,navigateBack:r}=Ni(),o=Z(),{closePrivyModal:l}=O(),{externalTransactionId:s}=a?.moonpayStatus,c=Sm(s||null,o.fundingMethodConfig.moonpay.useSandbox??!1);/*#__PURE__*/return e(n,{children:[/*#__PURE__*/t(yr,{title:"Fund account",backFn:()=>{let e={...a?.funding,showAlternateFundingMethod:!0};e.usingDefaultFundingMethod&&(e.usingDefaultFundingMethod=!1),i({funding:e,solanaFundingData:a?.solanaFundingData}),r()}}),/*#__PURE__*/t(_m,{status:c,onClickCta:l}),/*#__PURE__*/t($i,{})]})}};let _m=({status:a,onClickCta:i})=>{let{title:r,body:o,cta:l}=A((()=>(e=>{switch(e){case"completed":return{title:"You've funded your account!",body:"It may take a few minutes for the assets to appear.",cta:"Continue"};case"waitingAuthorization":return{title:"Processing payment",body:"This may take up to a few hours. You will receive an email when the purchase is complete.",cta:"Continue"};default:return{title:"In Progress",body:"Go back to MoonPay to finish funding your account.",cta:""}}})(a)),[a]);/*#__PURE__*/return e(n,{children:[/*#__PURE__*/e(Lm,{children:[/*#__PURE__*/t(Mm,{status:a}),/*#__PURE__*/e(Wo,{children:[/*#__PURE__*/t("h3",{children:r}),/*#__PURE__*/t(Wm,{children:o})]})]}),l&&/*#__PURE__*/t(ar,{onClick:i,children:l})]})},Mm=({status:n})=>{if(!n||"pending"===n){let n="var(--privy-color-foreground-4)";/*#__PURE__*/return e("div",{style:{position:"relative"},children:[/*#__PURE__*/t(Ki,{color:n,style:{position:"absolute"}}),/*#__PURE__*/t(Xi,{color:n}),/*#__PURE__*/t(Nm,{size:"3rem",style:{position:"absolute",top:"1rem",left:"1rem"}})]})}let a=(e=>{switch(e){case"completed":return Xt;case"waitingAuthorization":return()=>/*#__PURE__*/t(Ot,{width:"3rem",height:"3rem",style:{backgroundColor:"var(--privy-color-foreground-4)",color:"var(--privy-color-background)",borderRadius:"100%",padding:"0.5rem",margin:"0.5rem"}});default:return}})(n),i=(e=>e?{completed:"var(--privy-color-success)",failed:"var(--privy-color-error)",serviceFailure:"var(--privy-color-error)",waitingAuthorization:"var(--privy-color-accent)",pending:"var(--privy-color-foreground-4)"}[e]:"var(--privy-color-foreground-4)")(n);/*#__PURE__*/return t("div",{style:{borderColor:i,display:"flex",justifyContent:"center",alignItems:"center",borderRadius:"100%",borderWidth:2,padding:"0.5rem",marginBottom:"0.5rem"},children:a&&/*#__PURE__*/t(a,{width:"4rem",height:"4rem",color:i})})},Wm=/*#__PURE__*/Ne.p.withConfig({displayName:"StatusBody",componentId:"sc-727a5a8d-0"})(["font-size:1rem;color:var(--privy-color-foreground-3);margin-bottom:1rem;display:flex;flex-direction:column;gap:1rem;"]),Lm=/*#__PURE__*/Ne.div.withConfig({displayName:"ConnectContainer",componentId:"sc-727a5a8d-1"})(["display:flex;flex-direction:column;align-items:center;justify-content:center;margin-left:1.75rem;margin-right:1.75rem;padding:2rem 0;"]);const Pm=async(e,t,n,a,i,r,o,l)=>{let s=Kt();if(!s)throw Error("Unable to initialize flow");let c="ethereum"===t.chainType?dt(t.chain.id,a):t.isUSDC?"USDC_SOL":"SOL",{signedUrl:d,externalTransactionId:p}=await e.signMoonpayOnRampUrl({address:t.address,useSandbox:n.fundingMethodConfig.moonpay.useSandbox??!1,config:{uiConfig:{accentColor:n.appearance.palette.accent,theme:n.appearance.palette.colorScheme},paymentMethod:l,currencyCode:c,quoteCurrencyAmount:Im(t.amount)}});e.createAnalyticsEvent({eventName:"sdk_fiat_on_ramp_started",payload:{provider:"moonpay",value:t.amount,chainType:t.chainType,chainId:"ethereum"===t.chainType?t.chain.id:t.chain}}),s.location=d;let h={...o?.funding,showAlternateFundingMethod:!0};t.usingDefaultFundingMethod&&(h.usingDefaultFundingMethod=!1),i({moonpayStatus:{},funding:h,solanaFundingData:o?.solanaFundingData}),r(Em),setTimeout((()=>{i({moonpayStatus:{externalTransactionId:p},funding:h,solanaFundingData:o?.solanaFundingData})}),8e3)};let Fm=async e=>"undefined"!=typeof window&&"PaymentRequest"in window&&await new window.PaymentRequest([{supportedMethods:e}],{id:"0",total:{label:"Item",amount:{currency:"USD",value:"1.00"}}}).canMakePayment();const Dm=()=>Fm("https://apple.com/apple-pay"),Rm=()=>Fm("https://google.com/pay"),Om={component:()=>{let{wallets:a}=hl(),{connectors:i}=O(),r=i.filter(xi).flatMap((e=>e.wallets)),{navigate:o,data:l,setModalData:s}=Ni(),{client:c}=O(),d=Z(),p=l?.funding,h=pu(Dm),u=pu(Rm),m="solana"===p.chainType,g=m?void 0:p,y=A((()=>((e,t,n,a,i,r)=>{let o,l,s="solana"===n.chainType,c=s?void 0:n,d=n.isUSDC?"USDC":c?.erc20Address?void 0:"native-currency",p=!!s||d&&pt(Number(n.chain.id),d),h=!!s||d&&ht(Number(n.chain.id),d),u=[];for(let o of(n.preferredCardProvider&&n.supportedOptions.sort((e=>e.provider===n.preferredCardProvider?-1:1)),n.supportedOptions))"card"===o.method&&"coinbase"===o.provider&&h&&u.push((()=>Tm(t,n,a,i,r,"buy"))),"card"===o.method&&"moonpay"===o.provider&&p&&d&&u.push((()=>Pm(t,n,e,d,a,i,r,"credit_debit_card")));for(let e of n.supportedOptions)"exchange"===e.method&&"coinbase"===e.provider&&h&&(o=()=>Tm(t,n,a,i,r,"buy"));for(let e of r?.funding?.supportedOptions??[])"wallets"===e.method&&(l=()=>i(ym));return{onFundWithCard:u,onFundWithExchange:o,onFundWithWallet:l}})(d,c,p,s,o,l)),[d,c,p,l,s,o]),f=m?r.find((({address:e})=>e===p.address)):a.find((({address:e})=>Et(e)===Et(p.address))),w=Oa(f?.walletClientType||"unknown"),v=w?.name||"wallet",b=f&&"privy"!==f.walletClientType?v:d.name,C=A((()=>p.uiConfig?.landing?.title?p.uiConfig?.landing?.title:`Add funds to your ${b?.toLowerCase().endsWith("wallet")?b:b+" wallet"}`),[p.uiConfig?.landing?.title,b]);I((()=>{if(p?.defaultFundingMethod&&p.usingDefaultFundingMethod)switch(s({funding:{...p,usingDefaultFundingMethod:!1},solanaFundingData:l?.solanaFundingData}),p?.defaultFundingMethod){case"card":y.onFundWithCard[0]&&y.onFundWithCard[0]();break;case"exchange":y.onFundWithExchange&&y.onFundWithExchange();break;case"wallet":y.onFundWithWallet&&y.onFundWithWallet();break;case"manual":o(Fp)}}),[]),I((()=>{g?.erc20Address&&!g.erc20ContractInfo&&Op({address:g.erc20Address,chain:g.chain,rpcConfig:d.rpcConfig,privyAppId:d.id}).then((e=>{s({...l,funding:{...g,erc20ContractInfo:e?{symbol:e.symbol,decimals:e.decimals}:void 0}})})).catch(console.error)}),[g?.erc20Address,g?.chain]);let x=!(!g?.erc20Address||g?.erc20ContractInfo);/*#__PURE__*/return e(n,{children:[/*#__PURE__*/t(su,{}),/*#__PURE__*/t("h3",{children:C}),/*#__PURE__*/e(Xu,{children:[p.errorMessage&&/*#__PURE__*/t(lh,{theme:d.appearance.palette.colorScheme,children:p.errorMessage}),y.onFundWithCard?.[0]&&/*#__PURE__*/e(Ri,{disabled:x,onClick:y.onFundWithCard[0],children:[/*#__PURE__*/t(Ju,{children:/*#__PURE__*/t(Dt,{style:{width:24}})}),"Pay with card",h?/*#__PURE__*/t(cu,{style:{marginLeft:"auto",maxWidth:"100%",width:"auto",height:"0.875rem"}}):u?/*#__PURE__*/t(du,{style:{marginLeft:"auto",maxWidth:"100%",width:"auto",height:"0.875rem"}}):null]}),y.onFundWithExchange&&/*#__PURE__*/e(Ri,{disabled:x,onClick:y.onFundWithExchange,children:[/*#__PURE__*/t(Ju,{children:/*#__PURE__*/t(Ot,{style:{width:24}})}),"Transfer from an exchange"]}),y.onFundWithWallet&&/*#__PURE__*/e(Ri,{disabled:x,onClick:y.onFundWithWallet,children:[/*#__PURE__*/t(Ju,{children:/*#__PURE__*/t(pd,{style:{width:24}})}),"Transfer from wallet"]}),/*#__PURE__*/e(Ri,{disabled:x,onClick:()=>o(Fp),children:[/*#__PURE__*/t(Ju,{children:/*#__PURE__*/t(Rt,{style:{width:24}})}),"Receive funds"]}),p?.showAlternateFundingMethod&&y.onFundWithCard?.[1]&&/*#__PURE__*/t(hp,{theme:d.appearance.palette.colorScheme,children:/*#__PURE__*/e(om,{children:["Having trouble or facing location restrictions?"," ",/*#__PURE__*/t(lm,{onClick:y.onFundWithCard[1],children:"Try a different provider."})]})})]}),/*#__PURE__*/t($i,{})]})}},Um={component:()=>{let{closePrivyModal:e}=O(),{data:n,navigate:a}=Ni(),i=Z(),r=ee(),o=n?.externalConnectWallet?.description,l=k(n?.externalConnectWallet?.walletList??i.appearance.walletList),s=k(n?.externalConnectWallet?.walletChainType??i.appearance.walletChainType);/*#__PURE__*/return t(Pd,{walletList:l.current,walletChainType:s.current,preSelectedWalletId:n?.externalConnectWallet?.preSelectedWalletId,hideHeader:n?.externalConnectWallet?.hideHeader,onBack:n?.funding?()=>a(Om):void 0,onClose:()=>{r("connectWallet","onError",P.GENERIC_CONNECT_WALLET_ERROR),e()},onConnect:({connector:t,wallet:i})=>{r("connectWallet","onSuccess",{wallet:i});let o=n?.externalConnectWallet?.onCompleteNavigateTo;o?a(o({address:i.address,walletClientType:t?.walletClientType,walletChainType:t?.chainType})):e()},onConnectError:e=>{e instanceof L?(console.warn(e.cause?e.cause:e.message),r("connectWallet","onError",e.privyErrorCode||P.GENERIC_CONNECT_WALLET_ERROR)):(console.warn(e),r("connectWallet","onError",P.UNKNOWN_CONNECT_WALLET_ERROR))},customDescription:o,app:i,connectOnly:!0})},isUnauthenticatedScreem:!0},Bm=n=>/*#__PURE__*/e("svg",{width:"33",height:"32",viewBox:"0 0 33 32",fill:"none",xmlns:"http://www.w3.org/2000/svg",...n,children:[/*#__PURE__*/t("rect",{x:"0.5",width:"32",height:"32",rx:"4",fill:"#855DCD"}),/*#__PURE__*/e("g",{"clip-path":"url(#clip0_1715_1960)",children:[/*#__PURE__*/t("path",{d:"M4.5 4H28.5V28H4.5V4Z",fill:"#855DCD"}),/*#__PURE__*/t("path",{d:"M11.1072 8.42105H21.6983V23.5789H20.1437V16.6357H20.1284C19.9566 14.7167 18.3542 13.2129 16.4028 13.2129C14.4514 13.2129 12.849 14.7167 12.6771 16.6357H12.6619V23.5789H11.1072V8.42105Z",fill:"white"}),/*#__PURE__*/t("path",{d:"M8.28943 10.5725L8.92101 12.7239H9.45542V21.4275C9.1871 21.4275 8.96959 21.6464 8.96959 21.9165V22.5032H8.87242C8.60411 22.5032 8.38659 22.7221 8.38659 22.9922V23.5789H13.8279V22.9922C13.8279 22.7221 13.6104 22.5032 13.3421 22.5032H13.2449V21.9165C13.2449 21.6464 13.0274 21.4275 12.7591 21.4275H12.1761V10.5725H8.28943Z",fill:"white"}),/*#__PURE__*/t("path",{d:"M20.2408 21.4275C19.9725 21.4275 19.755 21.6464 19.755 21.9165V22.5032H19.6579C19.3895 22.5032 19.172 22.7221 19.172 22.9922V23.5789H24.6133V22.9922C24.6133 22.7221 24.3958 22.5032 24.1275 22.5032H24.0303V21.9165C24.0303 21.6464 23.8128 21.4275 23.5445 21.4275V12.7239H24.0789L24.7105 10.5725H20.8238V21.4275H20.2408Z",fill:"white"})]}),/*#__PURE__*/t("defs",{children:/*#__PURE__*/t("clipPath",{id:"clip0_1715_1960",children:/*#__PURE__*/t("rect",{width:"24",height:"24",fill:"white",transform:"translate(4.5 4)"})})})]}),zm=e=>{let[n,a]=T(!1);/*#__PURE__*/return t(Vm,{color:e.color,href:e.url,target:"_blank",rel:"noreferrer noopener",onClick:()=>{a(!0),setTimeout((()=>a(!1)),1500)},justOpened:n,children:e.text})};let Vm=/*#__PURE__*/Ne.a.withConfig({displayName:"StyledOpenLinkButton",componentId:"sc-4e695c83-0"})(["display:flex;align-items:center;gap:6px;&&{margin:8px 2px;font-size:14px;color:",";font-weight:",";transition:color 350ms ease;:focus,:active{background-color:transparent;border:none;outline:none;box-shadow:none;}:hover{color:",";}:active{color:'var(--privy-color-foreground)';font-weight:medium;}@media (max-width:440px){margin:12px 2px;}}svg{width:14px;height:14px;}"],(e=>e.justOpened?"var(--privy-color-foreground)":e.color||"var(--privy-color-foreground-3)"),(e=>e.justOpened?"medium":"normal"),(e=>e.justOpened?"var(--privy-color-foreground)":"var(--privy-color-foreground-2)")),Hm=/*#__PURE__*/Ne.div.withConfig({displayName:"Container",componentId:"sc-913deead-0"})(["width:100%;"]),jm=/*#__PURE__*/Ne.div.withConfig({displayName:"InputContainer",componentId:"sc-913deead-1"})(["display:flex;align-items:center;justify-content:space-between;gap:0.75rem;padding:0.75rem;height:56px;background:",";border:1px solid var(--privy-color-foreground-4);border-radius:var(--privy-border-radius-md);&:hover{border-color:",";}"],(e=>e.$disabled?"var(--privy-color-background-2)":"var(--privy-color-background)"),(e=>e.$disabled?"var(--privy-color-foreground-4)":"var(--privy-color-foreground-3)")),$m=/*#__PURE__*/Ne.div.withConfig({displayName:"TextContainer",componentId:"sc-913deead-2"})(["flex:1;min-width:0;display:flex;align-items:center;"]),qm=/*#__PURE__*/Ne.span.withConfig({displayName:"Text",componentId:"sc-913deead-3"})(["display:block;font-size:16px;line-height:24px;color:",";overflow:hidden;text-overflow:ellipsis;display:-webkit-box;-webkit-line-clamp:1;-webkit-box-orient:vertical;word-break:break-all;@media (min-width:441px){font-size:14px;line-height:20px;}"],(e=>e.$disabled?"var(--privy-color-foreground-2)":"var(--privy-color-foreground)")),Gm=/*#__PURE__*/Ne(qm).withConfig({displayName:"PlaceholderText",componentId:"sc-913deead-4"})(["color:var(--privy-color-foreground-3);font-style:italic;"]),Zm=/*#__PURE__*/Ne(fp).withConfig({displayName:"TitleLabel",componentId:"sc-913deead-5"})(["margin-bottom:0.5rem;"]),Qm=/*#__PURE__*/Ne(lr).withConfig({displayName:"CopyButton",componentId:"sc-913deead-6"})(["&&{gap:0.375rem;font-size:14px;flex-shrink:0;}"]);const Ym=({value:a,title:i,placeholder:l,className:s,showCopyButton:c=!0,truncate:d,maxLength:p=40,disabled:h=!1})=>{let[u,m]=T(!1),g=d&&a?((e,t,n)=>{if((e=e.startsWith("https://")?e.slice(8):e).length<=n)return e;if("middle"===t){let t=Math.ceil(n/2)-2,a=Math.floor(n/2)-1;return`${e.slice(0,t)}...${e.slice(-a)}`}return`${e.slice(0,n-3)}...`})(a,d,p):a;return I((()=>{if(u){let e=setTimeout((()=>m(!1)),3e3);return()=>clearTimeout(e)}}),[u]),/*#__PURE__*/e(Hm,{className:s,children:[i&&/*#__PURE__*/t(Zm,{children:i}),/*#__PURE__*/e(jm,{$disabled:h,children:[/*#__PURE__*/t($m,{children:a?/*#__PURE__*/t(qm,{$disabled:h,title:a,children:g}):/*#__PURE__*/t(Gm,{$disabled:h,children:l||"No value"})}),c&&a&&/*#__PURE__*/t(Qm,{onClick:function(e){e.stopPropagation(),navigator.clipboard.writeText(a).then((()=>m(!0))).catch(console.error)},size:"sm",children:/*#__PURE__*/e(n,u?{children:["Copied",/*#__PURE__*/t(r,{size:14})]}:{children:["Copy",/*#__PURE__*/t(o,{size:14})]})})]})]})},Km=({connectUri:n,loading:a,success:i,errorMessage:r,onBack:o,onClose:l,onOpenFarcaster:s})=>/*#__PURE__*/t(Qr,Oe||a?Ue?{title:r?r.message:"Sign in with Farcaster",subtitle:r?r.detail:"To sign in with Farcaster, please open the Farcaster app.",icon:Bm,iconVariant:"loading",iconLoadingStatus:{success:i,fail:!!r},primaryCta:n&&s?{label:"Open Farcaster app",onClick:s}:void 0,onBack:o,onClose:l,watermark:!0}:{title:r?r.message:"Signing in with Farcaster",subtitle:r?r.detail:"This should only take a moment",icon:Bm,iconVariant:"loading",iconLoadingStatus:{success:i,fail:!!r},onBack:o,onClose:l,watermark:!0,children:n&&Oe&&/*#__PURE__*/t(Jm,{children:/*#__PURE__*/t(zm,{text:"Take me to Farcaster",url:n,color:"#8a63d2"})})}:{title:"Sign in with Farcaster",subtitle:"Scan with your phone's camera to continue.",onBack:o,onClose:l,watermark:!0,children:/*#__PURE__*/e(eg,{children:[/*#__PURE__*/t(tg,{children:n?/*#__PURE__*/t(ad,{url:n,size:275,squareLogoElement:Bm}):/*#__PURE__*/t(ig,{children:/*#__PURE__*/t(Ki,{})})}),/*#__PURE__*/e(ng,{children:[/*#__PURE__*/t(ag,{children:"Or copy this link and paste it into a phone browser to open the Farcaster app."}),n&&/*#__PURE__*/t(Ym,{value:n,truncate:"end",maxLength:30,showCopyButton:!0,disabled:!0})]})]})}),Xm={component:()=>{let{authenticated:e,logout:n,ready:a,user:i}=_i(),{lastScreen:r,navigate:o,navigateBack:l,setModalData:s}=Ni(),c=Z(),{getAuthFlow:d,loginWithFarcaster:p,closePrivyModal:h,createAnalyticsEvent:u}=O(),[m,g]=T(void 0),[y,f]=T(!1),[w,v]=T(!1),b=k([]),C=d(),x=C?.meta.connectUri;return I((()=>{let e=Date.now(),t=setInterval((async()=>{let n=await C.pollForReady.execute(),a=Date.now()-e;if(n){clearInterval(t),f(!0);try{await p(),v(!0)}catch(e){let t={retryable:!1,message:"Authentication failed"};if(e?.privyErrorCode===P.ALLOWLIST_REJECTED)return void o(Yd);if(e?.privyErrorCode===P.USER_LIMIT_REACHED)return console.error(new j(e).toString()),void o(op);if(e?.privyErrorCode===P.USER_DOES_NOT_EXIST)return void o(ac);if(e?.privyErrorCode===P.LINKED_TO_ANOTHER_USER)t.detail=e.message??"This account has already been linked to another user.";else{if(e?.privyErrorCode===P.ACCOUNT_TRANSFER_REQUIRED&&e.data?.data?.nonce)return s({accountTransfer:{nonce:e.data?.data?.nonce,account:e.data?.data?.subject,displayName:e.data?.data?.account?.displayName,linkMethod:"farcaster",embeddedWalletAddress:e.data?.data?.otherUser?.embeddedWalletAddress,farcasterEmbeddedAddress:e.data?.data?.otherUser?.farcasterEmbeddedAddress}}),void o(Fc);e?.privyErrorCode===P.INVALID_CREDENTIALS?(t.retryable=!0,t.detail="Something went wrong. Try again."):e?.privyErrorCode===P.TOO_MANY_REQUESTS&&(t.detail="Too many requests. Please wait before trying again.")}g(t)}}else a>12e4&&(clearInterval(t),g({retryable:!0,message:"Authentication failed",detail:"The request timed out. Try again."}))}),2e3);return()=>{clearInterval(t),b.current.forEach((e=>clearTimeout(e)))}}),[]),I((()=>{if(a&&e&&w&&i){if(c?.legal.requireUsersAcceptTerms&&!i.hasAcceptedTerms){let e=setTimeout((()=>{o(Bc)}),ne);return()=>clearTimeout(e)}w&&(tc(i,c.embeddedWallets)?b.current.push(setTimeout((()=>{s({createWallet:{onSuccess:()=>{},onFailure:e=>{console.error(e),u({eventName:"embedded_wallet_creation_failure_logout",payload:{error:e,screen:"FarcasterConnectStatusScreen"}}),n()},callAuthOnSuccessOnClose:!0}}),o(Uc)}),ne)):b.current.push(setTimeout((()=>h({shouldCallAuthOnSuccess:!0,isSuccess:!0})),ne)))}}),[w,a,e,i]),/*#__PURE__*/t(Km,{connectUri:x,loading:y,success:w,errorMessage:m,onBack:r?l:void 0,onClose:h,onOpenFarcaster:()=>{x&&(window.location.href=x)}})}};let Jm=/*#__PURE__*/Ne.div.withConfig({displayName:"MobileLinkContainer",componentId:"sc-6e4b180b-0"})(["margin-top:24px;"]),eg=/*#__PURE__*/Ne.div.withConfig({displayName:"ContentContainer",componentId:"sc-6e4b180b-1"})(["display:flex;flex-direction:column;align-items:center;gap:24px;"]),tg=/*#__PURE__*/Ne.div.withConfig({displayName:"QrContainer",componentId:"sc-6e4b180b-2"})(["display:flex;align-items:center;justify-content:center;min-height:275px;"]),ng=/*#__PURE__*/Ne.div.withConfig({displayName:"InstructionsContainer",componentId:"sc-6e4b180b-3"})(["display:flex;flex-direction:column;align-items:center;gap:16px;"]),ag=/*#__PURE__*/Ne.div.withConfig({displayName:"InstructionText",componentId:"sc-6e4b180b-4"})(["font-size:0.875rem;text-align:center;color:var(--privy-color-foreground-2);"]),ig=/*#__PURE__*/Ne.div.withConfig({displayName:"LoaderWrapper",componentId:"sc-6e4b180b-5"})(["position:relative;width:82px;height:82px;"]);const rg=()=>{let[n,a]=T(!1),{currentScreen:i,navigate:r,setModalData:o,data:l}=Ni(),{enabled:s,token:c}=ma(),{initLoginWithFarcaster:d}=O(),{accountType:p}=Hs();/*#__PURE__*/return e(Ri,{onClick:async()=>{a(!0);try{s&&!c?(o({captchaModalData:{callback:e=>d(e,l?.login?.disableSignup),userIntentRequired:!0,onSuccessNavigateTo:Xm,onErrorNavigateTo:xc}}),r(Xd)):(await d(c,l?.login?.disableSignup),r(Xm))}catch(e){o({errorModalData:{error:e,previousScreen:i||ay}}),r(xc)}finally{a(!1)}},disabled:!1,children:[/*#__PURE__*/t(Bm,{width:32,height:32})," Farcaster",n&&/*#__PURE__*/t(Ji,{}),"farcaster"===p&&/*#__PURE__*/t(og,{color:"gray",children:"Recent"})]})};let og=/*#__PURE__*/Ne(hu).withConfig({displayName:"StyledChip",componentId:"sc-c6317ff9-0"})(["margin-left:auto;"]);const lg=({status:e,passkeySignupFlow:n=!1,error:a,onRetry:i})=>/*#__PURE__*/t(Qr,{title:(()=>{switch(e){case"loading":return"Waiting for passkey";case"success":return"Success";case"error":return"Something went wrong"}})(),subtitle:/*#__PURE__*/t(cg,{children:(()=>{switch(e){case"loading":return n?"Please follow prompts to register your passkey.":"Please follow prompts to verify your passkey.\nYou will have to sign up with another method first to register a passkey for your account.";case"success":return"You've successfully logged in with your passkey.";case"error":if(a instanceof L){if(a.privyErrorCode===P.CANNOT_LINK_MORE_OF_TYPE)return"Cannot link more passkeys to account.";if(a.privyErrorCode===P.PASSKEY_NOT_ALLOWED)return"Passkey request timed out or rejected by user.\nYou will have to sign up with another method first to register a passkey for your account."}return"An unknown error occurred.\nYou will have to sign up with another method first to register a passkey for your account."}})()}),icon:y,iconVariant:"loading",iconLoadingStatus:{success:"success"===e,fail:"error"===e},primaryCta:"error"===e&&i?{label:"Retry",onClick:i}:"success"===e?{label:"Continue",disabled:!0}:void 0,watermark:!0}),sg={component:()=>{let{data:e,setModalData:n,navigate:a}=Ni(),i=Z(),{loginWithPasskey:r,signupWithPasskey:o,closePrivyModal:l,createAnalyticsEvent:s}=O(),{user:c,logout:d}=_i(),{passkeySignupFlow:p}=e?.passkeyAuthModalData??{},h=ne-500,[u,m]=T("loading"),[g,y]=T(null),f=k([]),w=e=>{f.current=[e,...f.current]};I((()=>()=>{f.current.forEach((e=>clearTimeout(e))),f.current=[]}),[]);let v=async()=>{m("loading");try{p?await o():await r(),m("success")}catch(e){y(e),m("error")}};return I((()=>{if("success"===u&&c){if(i?.legal.requireUsersAcceptTerms&&!c.hasAcceptedTerms)return void w(setTimeout((()=>{a(Bc)}),h));if(!tc(c,i?.embeddedWallets))return void w(setTimeout((()=>{l({shouldCallAuthOnSuccess:!0,isSuccess:!0})}),ne));w(setTimeout((()=>{n({createWallet:{onSuccess:()=>{},onFailure:e=>{console.error(e),s({eventName:"embedded_wallet_creation_failure_logout",payload:{error:e,screen:"PasskeyStatusScreen"}}),d()},callAuthOnSuccessOnClose:!0}}),a(Uc)}),h))}}),[c,u]),I((()=>{v()}),[]),/*#__PURE__*/t(lg,{status:u,passkeySignupFlow:p,error:g,onRetry:v})}};let cg=/*#__PURE__*/Ne.span.withConfig({displayName:"SubtitleText",componentId:"sc-7ff4a13e-0"})(["white-space:pre-wrap;"]);const dg=({title:e="Log in or create a new account?",subtitle:n="Create a new account with a passkey or use a passkey to log in to an existing account.",onSignup:a,onLogin:i})=>/*#__PURE__*/t(Qr,{title:e,subtitle:n,icon:y,primaryCta:{label:"Create new account",onClick:a},secondaryCta:{label:"Log in with a passkey",onClick:i},watermark:!0}),pg={component:()=>{let{enabled:e,token:n}=ma(),{navigate:a,setModalData:i}=Ni(),{initSignupWithPasskey:r,initLoginWithPasskey:o}=O();/*#__PURE__*/return t(dg,{onSignup:async()=>{e&&!n?(i({passkeyAuthModalData:{passkeySignupFlow:!0},captchaModalData:{callback:e=>r({captchaToken:e,withPrivyUi:!0}),userIntentRequired:!1,onSuccessNavigateTo:sg,onErrorNavigateTo:xc}}),a(Xd)):(await r({withPrivyUi:!0,captchaToken:n}),i({passkeyAuthModalData:{passkeySignupFlow:!0}}),a(sg))},onLogin:async()=>{e&&!n?(i({passkeyAuthModalData:{passkeySignupFlow:!1},captchaModalData:{callback:e=>o({captchaToken:e,withPrivyUi:!0}),userIntentRequired:!1,onSuccessNavigateTo:sg,onErrorNavigateTo:xc}}),a(Xd)):(await o({withPrivyUi:!0,captchaToken:n}),i({passkeyAuthModalData:{passkeySignupFlow:!1}}),a(sg))}})}},hg=()=>{let{enabled:n,token:a}=ma(),{navigate:i,setModalData:r,data:o}=Ni(),l=Z(),{initLoginWithPasskey:s}=O(),c=()=>{l.loginConfig.passkeysForSignupEnabled?i(pg):(async()=>{n&&!a?(r({passkeyAuthModalData:{passkeySignupFlow:!1},captchaModalData:{callback:e=>s({captchaToken:e,withPrivyUi:!0}),userIntentRequired:!1,onSuccessNavigateTo:sg,onErrorNavigateTo:xc}}),i(Xd)):(await s({withPrivyUi:!0,captchaToken:a}),r({passkeyAuthModalData:{passkeySignupFlow:!1}}),i(sg))})()};return 0===A((()=>{let e=o?.login?.loginMethods;return e?e.filter((e=>"passkey"!==e)).length:Object.entries(l.loginMethods).filter((([e,t])=>t)).filter((([e])=>"passkey"!==e)).length}),[l.loginMethods,o?.login])?/*#__PURE__*/e(Ri,{onClick:c,children:[/*#__PURE__*/t(en,{})," Continue with passkey"]}):/*#__PURE__*/t(Ys,{as:"button",onClick:c,size:"sm",variant:"navigation",style:{width:"100%",justifyContent:"center"},children:"I have a passkey"})},ug=({value:n,onChange:a})=>/*#__PURE__*/t("select",{value:n,onChange:a,children:ut.map((t=>/*#__PURE__*/e("option",{value:t.code,children:[t.code," +",t.callCode]},t.code)))}),mg=/*#__PURE__*/E(((a,i)=>{let r=Z(),[o,l]=T(!1),{accountType:s}=Hs(),[c,d]=T(""),[p,h]=T(r?.intl.defaultCountry??"US"),u=mt(c,p),m=gt(p),g=yt(p),y=ft(p),f=!u,[w,v]=T(!1),b=y.length,C=e=>{let t=e.target.value;h(t),d(""),a.onChange&&a.onChange({rawPhoneNumber:c,qualifiedPhoneNumber:vt(c,t),countryCode:t,isValid:mt(c,p)})},x=(e,t)=>{try{let n=e.replace(/\D/g,"")===c.replace(/\D/g,"")?e:m.input(e);d(n),a.onChange&&a.onChange({rawPhoneNumber:n,qualifiedPhoneNumber:vt(e,t),countryCode:t,isValid:mt(e,t)})}catch(e){console.error("Error processing phone number:",e)}},k=()=>{v(!0);let e=vt(c,p);a.onSubmit({rawPhoneNumber:c,qualifiedPhoneNumber:e,countryCode:p,isValid:mt(c,p)}).finally((()=>v(!1)))};return I((()=>{if(a.defaultValue){let e=wt(a.defaultValue);m.reset(),C({target:{value:e.countryCode}}),x(e.phone,e.countryCode)}}),[a.defaultValue]),/*#__PURE__*/e(n,{children:[/*#__PURE__*/t(gg,{children:/*#__PURE__*/e(yg,{$callingCodeLength:b,$stacked:a.stacked,children:[/*#__PURE__*/t(ug,{value:p,onChange:C}),/*#__PURE__*/t("input",{ref:i,id:"phone-number-input",className:"login-method-button",type:"tel",placeholder:g,onFocus:()=>l(!0),onChange:e=>{x(e.target.value,p)},onKeyUp:e=>{"Enter"===e.key&&k()},value:c,autoComplete:"tel"}),"phone"!==s||o||a.hideRecent?a.stacked||a.noIncludeSubmitButton?/*#__PURE__*/t("span",{}):/*#__PURE__*/t(pr,{isSubmitting:w,onClick:k,disabled:f,children:"Submit"}):/*#__PURE__*/t(hu,{color:"gray",children:"Recent"})]})}),a.stacked&&!a.noIncludeSubmitButton?/*#__PURE__*/t(ar,{loading:w,loadingText:null,onClick:k,disabled:f,children:"Submit"}):null]})}));let gg=/*#__PURE__*/Ne.div.withConfig({displayName:"InputContainer",componentId:"sc-545daacd-0"})(["width:100%;"]),yg=/*#__PURE__*/Ne.label.withConfig({displayName:"PhoneNumberInput",componentId:"sc-545daacd-1"})(["--country-code-dropdown-width:calc(54px + calc(12 * ","px));--phone-input-extra-padding-left:calc(12px + calc(3 * ","px));display:block;position:relative;width:100%;@media (min-width:441px){--country-code-dropdown-width:calc(52px + calc(10 * ","px));}&& > select{font-size:16px;height:24px;position:absolute;margin:13px calc(var(--country-code-dropdown-width) / 4);line-height:24px;width:var(--country-code-dropdown-width);background-color:var(--privy-color-background);background-size:auto;background-position-x:right;cursor:pointer;@media (min-width:441px){font-size:14px;width:var(--country-code-dropdown-width);}:focus{outline:none;box-shadow:none;}}&& > input{font-size:16px;line-height:24px;color:var(--privy-color-foreground);overflow:hidden;white-space:nowrap;text-overflow:ellipsis;width:calc(100% - var(--country-code-dropdown-width));padding:12px 88px 12px calc(var(--country-code-dropdown-width) + var(--phone-input-extra-padding-left));padding-right:",";flex-grow:1;background:var(--privy-color-background);border:1px solid var(--privy-color-foreground-4);border-radius:var(--privy-border-radius-md);width:100%;:focus{outline:none;border-color:var(--privy-color-accent);}:autofill,:-webkit-autofill{background:var(--privy-color-background);}@media (min-width:441px){font-size:14px;padding-right:78px;}}&& > :last-child{right:16px;position:absolute;top:50%;transform:translate(0,-50%);}&& > button:last-child{right:0px;line-height:24px;padding:13px 17px;:focus{outline:none;border-color:var(--privy-color-accent);}}&& > input::placeholder{color:var(--privy-color-foreground-3);}"],(e=>e.$callingCodeLength),(e=>e.$callingCodeLength),(e=>e.$callingCodeLength),(e=>e.$stacked?"16px":"88px"));const fg=({isEditable:a,setIsEditable:i,defaultValue:r})=>{let o=k(null),{authenticated:l}=_i(),{navigate:s,setModalData:c,currentScreen:d,data:p}=Ni(),{initLoginWithSms:h}=O(),{enabled:u,token:m}=ma(),{whatsAppEnabled:g}=Z();/*#__PURE__*/return e(n,{children:[/*#__PURE__*/t(Ui,{$if:!a,children:/*#__PURE__*/t(mg,{ref:o,onSubmit:async function({qualifiedPhoneNumber:e}){if(!u||m||l)try{await h({phoneNumber:e,captchaToken:m,withPrivyUi:!0,disableSignup:p?.login?.disableSignup}),s(Vg)}catch(e){c({errorModalData:{error:e,previousScreen:d||ay}}),s(xc)}else c({captchaModalData:{callback:t=>h({phoneNumber:e,captchaToken:t,withPrivyUi:!0,disableSignup:p?.login?.disableSignup}),userIntentRequired:!1,onSuccessNavigateTo:Vg,onErrorNavigateTo:xc}}),s(Xd)},defaultValue:r})}),/*#__PURE__*/t(Ui,{$if:a,children:/*#__PURE__*/e(Ri,{onClick:()=>{i(),setTimeout((()=>{o.current?.focus()}),0)},children:[/*#__PURE__*/t(Oi,{children:/*#__PURE__*/t(f,{})}),"Continue with ",g?"WhatsApp":"SMS"]})})]})};let wg={apple:{logo:Wn,displayName:"Apple"},discord:{logo:Ln,displayName:"Discord"},github:{logo:Pn,displayName:"GitHub"},google:{logo:Fn,displayName:"Google"},linkedin:{logo:On,displayName:"LinkedIn"},spotify:{logo:Un,displayName:"Spotify"},instagram:{logo:Dn,displayName:"Instagram"},twitter:{logo:Vn,displayName:"Twitter"},tiktok:{logo:Bn,displayName:"TikTok"},line:{logo:Rn,displayName:"LINE"},twitch:{logo:zn,displayName:"Twitch"}};const vg=({provider:n})=>{let{enabled:a,token:i}=ma(),{navigate:r,setModalData:o,data:l}=Ni(),[s,c]=T(!1),d=Z(),{initLoginWithOAuth:p}=O(),{accountType:h}=Hs(),u=A((()=>h&&"guest"!==h&&"authorization_key"!==h&&"cross_app"!==h?Rs(h):null),[h]),{displayName:m,logo:g}=A((()=>{if(Mn(n)){let e=d.customOAuthProviders.find((e=>e.provider===n)),a=e.provider_icon_url,i=e.provider_display_name;return{displayName:i,logo:({style:e})=>/*#__PURE__*/t("img",{alt:`${i} logo`,src:a,style:e})}}return wg[n]}),[n,d.customOAuthProviders]);/*#__PURE__*/return e(Ri,{onClick:()=>{c(!0),setTimeout((()=>{c(!1)}),2e3),a&&!i?(o({captchaModalData:{callback:e=>p(n,e,l?.login?.disableSignup),userIntentRequired:!0,onSuccessNavigateTo:null,onErrorNavigateTo:xc}}),r(Xd)):p(n,void 0,l?.login?.disableSignup)},disabled:s,children:[/*#__PURE__*/t(Oi,{$fullSize:!0,children:/*#__PURE__*/t(g,{style:{width:"32px",height:"32px"}})}),m,u?.loginMethod===n&&/*#__PURE__*/t(bg,{color:"gray",children:"Recent"})]})};let bg=/*#__PURE__*/Ne(hu).withConfig({displayName:"StyledChip",componentId:"sc-45a4e2df-0"})(["margin-left:auto;"]);function Cg(n){/*#__PURE__*/return e("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 512 512",...n,children:[/*#__PURE__*/t("rect",{width:"512",height:"512",rx:"15%",fill:"#37aee2"}),/*#__PURE__*/t("path",{fill:"#c8daea",d:"M199 404c-11 0-10-4-13-14l-32-105 245-144"}),/*#__PURE__*/t("path",{fill:"#a9c9dd",d:"M199 404c7 0 11-4 16-8l45-43-56-34"}),/*#__PURE__*/t("path",{fill:"#f6fbfe",d:"M204 319l135 99c14 9 26 4 30-14l55-258c5-22-9-32-24-25L79 245c-21 8-21 21-4 26l83 26 190-121c9-5 17-3 11 4"})]})}const xg=({success:e,errorMessage:n,onRetry:a})=>{let i=e?"Successfully connected with Telegram":n?n.message:"Verifying connection to Telegram";/*#__PURE__*/return t(Qr,{title:i,subtitle:e?"You're good to go!":n?n.detail:"Just a few moments more",icon:Cg,iconVariant:"loading",iconLoadingStatus:{success:e,fail:!!n},secondaryCta:n?.retryable&&a?{label:"Retry",onClick:a}:void 0,watermark:!0})},kg={component:()=>{let{authenticated:e,logout:n,ready:a,user:i}=_i(),{setModalData:r,navigate:o,resetNavigation:l,data:s}=Ni(),c=Z(),{initLoginWithTelegram:d,loginWithTelegram:p,updateWallets:h,setReadyToTrue:u,closePrivyModal:m,createAnalyticsEvent:g,getAuthMeta:y}=O(),[f,w]=T(!1),[v,b]=T(void 0),C=ma();async function x(){try{let t=await async function(){let t;if(!e){if(C.enabled&&"error"===C.status)throw new ha(C.error,null,P.CAPTCHA_FAILURE);return C.enabled&&"success"!==C.status&&(C.execute(),t=await C.waitForResult()),t}}();await p({captchaToken:t}),w(!0),u(!0)}catch(e){if(e?.privyErrorCode===P.ALLOWLIST_REJECTED)return b(void 0),l(),void o(Yd);if(e?.privyErrorCode===P.USER_LIMIT_REACHED)return console.error(new j(e).toString()),b(void 0),l(),void o(op);if(e?.privyErrorCode===P.USER_DOES_NOT_EXIST)return b(void 0),l(),void o(ac);if(e?.privyErrorCode===P.ACCOUNT_TRANSFER_REQUIRED&&e.data?.data?.nonce)return b(void 0),l(),r({accountTransfer:{nonce:e.data?.data?.nonce,account:e.data?.data?.subject,telegramAuthResult:y()?.telegramAuthResult,telegramWebAppData:y()?.telegramWebAppData,displayName:e.data?.data?.account?.displayName,linkMethod:"telegram",embeddedWalletAddress:e.data?.data?.otherUser?.embeddedWalletAddress}}),void o(Fc);let{retryable:t,detail:n}=ya(e);b({retryable:t,detail:n,message:"Authentication failed"})}}I((()=>{x()}),[]),I((()=>{if(!(a&&e&&f&&i))return;if(c?.legal.requireUsersAcceptTerms&&!i.hasAcceptedTerms){let e=setTimeout((()=>{o(Bc)}),ne);return()=>clearTimeout(e)}if(tc(i,c.embeddedWallets)){let e=setTimeout((()=>{r({createWallet:{onSuccess:()=>{},onFailure:e=>{console.error(e),g({eventName:"embedded_wallet_creation_failure_logout",payload:{error:e,provider:"telegram",screen:"TelegramAuthScreen"}}),n()},callAuthOnSuccessOnClose:!0}}),o(Uc)}),ne);return()=>clearTimeout(e)}h();let t=setTimeout((()=>m({shouldCallAuthOnSuccess:!0,isSuccess:!0})),ne);return()=>clearTimeout(t)}),[a,e,f,i]);/*#__PURE__*/return t(xg,{success:f,errorMessage:v,onRetry:v?.retryable?async()=>{try{b(void 0),s?.telegramAuthModalData?.seamlessAuth||await d(void 0,s?.login?.disableSignup),await x()}catch(e){let{retryable:t,detail:n}=ya(e);b({retryable:t,detail:n,message:"Authentication failed"})}}:void 0})},isCaptchaRequired:!0},Tg=()=>{let{enabled:n,token:a}=ma(),{navigate:i,setModalData:r,data:o}=Ni(),[l,s]=T(!1),{initLoginWithTelegram:c}=O(),{accountType:d}=Hs();async function p(e){try{await c(e,o?.login?.disableSignup),r({telegramAuthModalData:{seamlessAuth:!1}}),i(kg)}catch(e){console.error(e),s(!1)}}/*#__PURE__*/return e(Ri,{onClick:async function(){if(s(!0),n&&!a)return r({captchaModalData:{callback:p,userIntentRequired:!0,onSuccessNavigateTo:null,onErrorNavigateTo:xc}}),void i(Xd);await p(a)},disabled:l,children:[/*#__PURE__*/t(Cg,{width:32,height:32}),"Telegram","telegram"===d&&/*#__PURE__*/t(Ag,{color:"gray",children:"Recent"})]})};let Ag=/*#__PURE__*/Ne(hu).withConfig({displayName:"StyledChip",componentId:"sc-4b233cf1-0"})(["margin-left:auto;"]);const Ig=({onClick:n,text:a,icon:i})=>/*#__PURE__*/e(Ri,{onClick:n,children:[/*#__PURE__*/t(Oi,{children:i}),/*#__PURE__*/t(Mi,{children:a})]}),Sg=({connectOnly:a})=>{let{closePrivyModal:i}=O(),{data:r,setModalData:o,onUserCloseViaDialogOrKeybindRef:l,navigate:s}=Ni(),c=Z(),d=r?.login,p=c.appearance.walletList,h=d?.walletChainType??c.appearance.walletChainType,{accountType:u,walletClientType:m,chainType:g}=Hs(),y=A((()=>u&&"guest"!==u&&"authorization_key"!==u&&"cross_app"!==u?Rs(u):null),[u]),{email:f,sms:w,google:v,twitter:b,discord:C,github:x,spotify:k,instagram:S,tiktok:N,line:E,twitch:_,linkedin:M,apple:W,wallet:L,farcaster:P,telegram:F}=A((()=>d?.loginMethods?bt(d.loginMethods,!0):null),[d])??c.loginMethods,{wallets:D}=Md({enabled:Ba(L?p:[]),walletList:p,walletChainType:h}),R=c.customOAuthProviders,{passkey:U}=c.loginMethods,B=[f&&"email",w&&"sms",v&&"google",b&&"twitter",C&&"discord",x&&"github",k&&"spotify",S&&"instagram",N&&"tiktok",E&&"line",_&&"twitch",M&&"linkedin",W&&"apple",P&&"farcaster",F&&"telegram",...R.map((e=>e.provider))].filter((e=>!!e)),z=B.length>0,V=A((()=>L&&!z?"web3-first":L&&c?.appearance.loginGroupPriority||"web2-first"),[L,z,c?.appearance.loginGroupPriority]),H=c?.appearance.hideDirectWeb2Inputs,[j,$]=T("default"),[q,G]=T(Lg({mostRecentlyUsedAccountType:u,smsAvailable:w,emailAvailable:f,prefilledType:d?.prefill?.type}));I((()=>{G(Lg({mostRecentlyUsedAccountType:u,smsAvailable:w,emailAvailable:f,prefilledType:d?.prefill?.type}))}),[f,w,u]);let Q=()=>{i({shouldCallAuthOnSuccess:!0}),setTimeout((()=>{$("default")}),150)};l.current=Q;let Y=[];m&&L?Y.push(m):y?.loginMethod&&B.includes(y.loginMethod)&&Y.push(y.loginMethod);let K=e=>{if("email"===e)/*#__PURE__*/return t(Jg,{isEditable:"email"===q,setIsEditable:()=>{G("email")},defaultValue:"email"===d?.prefill?.type?d.prefill.value:void 0},e);if("sms"===e)/*#__PURE__*/return t(fg,{isEditable:"sms"===q,setIsEditable:()=>{G("sms")},defaultValue:"phone"===d?.prefill?.type?d.prefill.value:void 0},e);if("apple"===e)/*#__PURE__*/return t(vg,{provider:"apple"},e);if("discord"===e)/*#__PURE__*/return t(vg,{provider:"discord"},e);if("farcaster"===e)/*#__PURE__*/return t(rg,{},e);if("github"===e)/*#__PURE__*/return t(vg,{provider:"github"},e);if("google"===e)/*#__PURE__*/return t(vg,{provider:"google"},e);if("linkedin"===e)/*#__PURE__*/return t(vg,{provider:"linkedin"},e);if("tiktok"===e)/*#__PURE__*/return t(vg,{provider:"tiktok"},e);if("line"===e)/*#__PURE__*/return t(vg,{provider:"line"},e);if("twitch"===e)/*#__PURE__*/return t(vg,{provider:"twitch"},e);if("spotify"===e)/*#__PURE__*/return t(vg,{provider:"spotify"},e);if("instagram"===e)/*#__PURE__*/return t(vg,{provider:"instagram"},e);if("twitter"===e)/*#__PURE__*/return t(vg,{provider:"twitter"},e);if("telegram"===e)/*#__PURE__*/return t(Tg,{},e);if(Mn(e))/*#__PURE__*/return t(vg,{provider:e},e);let n=D.findIndex((({id:t})=>t===ud.normalize(e))),i="solana"===g?"solana-only":"ethereum-only";/*#__PURE__*/return t(Ld,{recent:!0,index:n,data:{wallets:D,walletChainType:i,handleWalletClick(e){o((t=>({...t,externalConnectWallet:{walletList:p,walletChainType:i,preSelectedWalletId:e.id}}))),s(a?Um:pp)}}})},X=D.filter((e=>e.id!==ud.normalize(m||""))),J=X.map(((e,n)=>/*#__PURE__*/t(Ld,{index:n,data:{walletChainType:h,wallets:X,handleWalletClick(e){o((t=>({...t,externalConnectWallet:{walletList:p,walletChainType:h,preSelectedWalletId:e.id}}))),s(a?Um:pp)}}},e.id))),ee=B.filter((e=>e!==y?.loginMethod)).flatMap(K),te=Y.flatMap(K);"web3-first"===V&&"default"===j?J.unshift(...te):"web2-first"===V&&ee.unshift(...te);let ne="web2-overflow"===j?()=>$("default"):void 0,ae=B.filter((e=>"email"!==e&&"sms"!==e)),ie=_g({priority:V,email:f,sms:w,social:ae}),re=Mg({priority:V,email:f,sms:w,social:ae}),oe=/*#__PURE__*/t(mu,{text:Wg({priority:V}),onClick:()=>{o({...r,externalConnectWallet:{walletChainType:d?.walletChainType??c.appearance.walletChainType}}),s(a?Um:pp)}}),le=/*#__PURE__*/t(Ig,{text:ie,icon:re,onClick:()=>$("web2-overflow")}),se=H?0:1,ce=L&&J.length>0,de=0===ee.length&&L&&0===J.length,pe=5-(ce?1:0),he="default"===j&&c?.appearance.logo,ue="default"===j&&c.appearance.loginMessage;/*#__PURE__*/return e(Qr,{title:c.appearance.landingHeader,icon:he?/*#__PURE__*/t(js,{}):void 0,iconVariant:he?"logo":void 0,onClose:Q,showClose:!0,onBack:ne,showBack:!!ne,helpText:c||U&&"default"===j?/*#__PURE__*/e(n,{children:[U&&"default"===j&&/*#__PURE__*/t(hg,{}),c&&/*#__PURE__*/t(ji,{app:c})]}):void 0,watermark:!0,children:[ue&&("string"==typeof c.appearance.loginMessage?/*#__PURE__*/t(Ng,{children:c.appearance.loginMessage}):/*#__PURE__*/t(Eg,{children:c.appearance.loginMessage})),/*#__PURE__*/t(Pi,{$colorScheme:c.appearance.palette.colorScheme,children:"default"===j&&"web2-first"===V?/*#__PURE__*/e(n,{children:[ee.length>pe?ee.slice(0,pe-1):ee,ee.length>pe&&le,ce&&oe,de&&/*#__PURE__*/t(gu,{chainType:c.appearance.walletChainType})]}):"default"===j&&"web3-first"===V?/*#__PURE__*/e(n,{children:[L&&/*#__PURE__*/e(n,{children:[J.length>pe?J.slice(0,pe-1):J,J.length>pe&&oe]}),ee.length>se&&le,ee.length===se&&ee[0],de&&/*#__PURE__*/t(gu,{chainType:c.appearance.walletChainType})]}):"web2-overflow"===j?/*#__PURE__*/t(n,{children:"web3-first"===V?ee:ee.slice(3)}):null})]})};let Ng=/*#__PURE__*/Ne.div.withConfig({displayName:"StyledSubtitle",componentId:"sc-dfd9a95d-0"})(["text-align:center;font-size:14px;margin-bottom:24px;"]),Eg=/*#__PURE__*/Ne.div.withConfig({displayName:"MessageContainer",componentId:"sc-dfd9a95d-1"})(["margin-bottom:24px;"]),_g=({priority:e,email:t,sms:n,social:a})=>"web2-first"===e?"Other socials":t&&n&&a.length>0||t&&a.length>0?"Log in with email or socials":n&&a.length>0?"Log in with sms or socials":t&&n?"Continue with email or sms":t?"Continue with email":n?"Continue with sms":"Log in with a social account",Mg=({priority:e,email:n,sms:a,social:i})=>"web2-first"===e||i.length>0?/*#__PURE__*/t(w,{}):n&&a?/*#__PURE__*/t(Vd,{}):n?/*#__PURE__*/t(v,{}):a?/*#__PURE__*/t(f,{}):null,Wg=({priority:e})=>"web2-first"===e?"Continue with a wallet":"Other wallets";const Lg=({mostRecentlyUsedAccountType:e,smsAvailable:t,emailAvailable:n,prefilledType:a})=>n&&("email"===e&&"phone"!==a||"email"===a)||!t||"phone"!==e&&"phone"!==a?"email":"sms",Pg={component:()=>{let e=Z();return e.loginMethodsAndOrder&&e.loginMethodsAndOrder.primary.length>0?/*#__PURE__*/t(ey,{connectOnly:!0}):/*#__PURE__*/t(Sg,{connectOnly:!0})}},Fg=({contactMethod:n,authFlow:a,appName:i="Privy",whatsAppEnabled:r=!1,onBack:o,onCodeSubmit:l,onResend:s,errorMessage:c,success:d=!1,resendCountdown:p=0,onInvalidInput:h,onClearError:u})=>{let[m,g]=T(Rg);I((()=>{c||g(Rg)}),[c]);let y=async e=>{e.preventDefault();let t=e.currentTarget.value.replace(" ","");if(""===t)return;if(isNaN(Number(t)))return void h?.("Code should be numeric");u?.();let n=Number(e.currentTarget.name?.charAt(5)),a=[...t||[""]].slice(0,Dg-n),i=[...m.slice(0,n),...a,...m.slice(n+a.length)];g(i);let r=Math.min(Math.max(n+a.length,0),Dg-1);if(!isNaN(Number(e.currentTarget.value))){let e=document.querySelector(`input[name=code-${r}]`);e?.focus()}if(i.every((e=>e&&!isNaN(+e)))){let e=document.querySelector(`input[name=code-${r}]`);e?.blur(),await(l?.(i.join("")))}};/*#__PURE__*/return t(Qr,{title:"Enter confirmation code",subtitle:/*#__PURE__*/e("span","email"===a?{children:["Please check ",/*#__PURE__*/t(Zg,{children:n})," for an email from privy.io and enter your code below."]}:{children:["Please check ",/*#__PURE__*/t(Zg,{children:n})," for a",r?" WhatsApp":""," message from ",i," and enter your code below."]}),icon:"email"===a?Fe:De,onBack:o,showBack:!0,helpText:/*#__PURE__*/e(qg,{children:[/*#__PURE__*/e("span",{children:["Didn't get ","email"===a?"an email":"a message","?"]}),p?/*#__PURE__*/e(Gg,{children:[/*#__PURE__*/t(Pe,{color:"var(--privy-color-foreground)",strokeWidth:1.33,height:"12px",width:"12px"}),/*#__PURE__*/t("span",{children:"Code sent"})]}):/*#__PURE__*/t(Ys,{as:"button",size:"sm",onClick:s,children:"Resend code"})]}),children:/*#__PURE__*/t(Hg,{children:/*#__PURE__*/t(No,{children:/*#__PURE__*/e(jg,{children:[/*#__PURE__*/t("div",{children:m.map(((e,n)=>/*#__PURE__*/t("input",{name:`code-${n}`,type:"text",value:m[n],onChange:y,onKeyUp:e=>{"Backspace"===e.key&&(e=>{if(u?.(),g([...m.slice(0,e),"",...m.slice(e+1)]),e>0){let t=document.querySelector(`input[name=code-${e-1}]`);t?.focus()}})(n)},inputMode:"numeric",autoFocus:0===n,pattern:"[0-9]",className:`${d?"success":""} ${c?"fail":""}`,autoComplete:Oe?"one-time-code":"off"},n)))}),/*#__PURE__*/t($g,{$fail:!!c,$success:d,children:/*#__PURE__*/t("span",{children:"Invalid or expired verification code"===c?"Incorrect code":c||(d?"Success!":"")})})]})})})})};let Dg=6,Rg=Array(6).fill("");var Og,Ug,Bg=((Og=Bg||{})[Og.RESET_AFTER_DELAY=0]="RESET_AFTER_DELAY",Og[Og.CLEAR_ON_NEXT_VALID_INPUT=1]="CLEAR_ON_NEXT_VALID_INPUT",Og),zg=((Ug=zg||{})[Ug.EMAIL=0]="EMAIL",Ug[Ug.SMS=1]="SMS",Ug);const Vg={component:()=>{let{navigate:e,lastScreen:n,navigateBack:a,setModalData:i,onUserCloseViaDialogOrKeybindRef:r}=Ni(),o=Z(),{closePrivyModal:l,resendEmailCode:s,resendSmsCode:c,getAuthMeta:d,loginWithCode:p,updateWallets:h,createAnalyticsEvent:u}=O(),{authenticated:m,logout:g,user:y}=_i(),{whatsAppEnabled:f}=Z(),[w,v]=T(!1),[b,C]=T(null),[x,k]=T(null),[A,S]=T(0);r.current=()=>null;let N=d()?.email?0:1,E=0===N?d()?.email||"":d()?.phoneNumber||"",_=ne-500;I((()=>{if(A){let e=setTimeout((()=>{S(A-1)}),1e3);return()=>clearTimeout(e)}}),[A]),I((()=>{if(m&&w&&y){if(o?.legal.requireUsersAcceptTerms&&!y.hasAcceptedTerms){let t=setTimeout((()=>{e(Bc)}),_);return()=>clearTimeout(t)}if(tc(y,o.embeddedWallets)){let t=setTimeout((()=>{i({createWallet:{onSuccess:()=>{},onFailure:e=>{console.error(e),u({eventName:"embedded_wallet_creation_failure_logout",payload:{error:e,screen:"AwaitingPasswordlessCodeScreen"}}),g()},callAuthOnSuccessOnClose:!0}}),e(Uc)}),_);return()=>clearTimeout(t)}{h();let e=setTimeout((()=>l({shouldCallAuthOnSuccess:!0,isSuccess:!0})),ne);return()=>clearTimeout(e)}}}),[m,w,y]),I((()=>{if(b&&0===x){let e=setTimeout((()=>{C(null),k(null);let e=document.querySelector("input[name=code-0]");e?.focus()}),1400);return()=>clearTimeout(e)}}),[b,x]);/*#__PURE__*/return t(Fg,{contactMethod:E,authFlow:0===N?"email":"sms",appName:o?.name,whatsAppEnabled:f,onBack:()=>a(),onCodeSubmit:async t=>{try{await p(t),v(!0)}catch(t){if(t instanceof V&&t.privyErrorCode===P.INVALID_CREDENTIALS)C("Invalid or expired verification code"),k(0);else if(t instanceof V&&t.privyErrorCode===P.CANNOT_LINK_MORE_OF_TYPE)C(t.message);else{if(t instanceof V&&t.privyErrorCode===P.USER_LIMIT_REACHED)return console.error(new j(t).toString()),void e(op);if(t instanceof V&&t.privyErrorCode===P.USER_DOES_NOT_EXIST)return void e(ac);if(t instanceof V&&t.privyErrorCode===P.LINKED_TO_ANOTHER_USER)return i({errorModalData:{error:t,previousScreen:n??Vg}}),void e(xc,!1);if(t instanceof V&&t.privyErrorCode===P.DISALLOWED_PLUS_EMAIL)return i({inlineError:{error:t}}),void e(Pg,!1);if(t instanceof V&&t.privyErrorCode===P.ACCOUNT_TRANSFER_REQUIRED&&t.data?.data?.nonce)return i({accountTransfer:{nonce:t.data?.data?.nonce,account:E,displayName:t.data?.data?.account?.displayName,linkMethod:0===N?"email":"sms",embeddedWalletAddress:t.data?.data?.otherUser?.embeddedWalletAddress}}),void e(Fc);C("Issue verifying code"),k(0)}}},onResend:async()=>{S(30),0===N?await s():await c()},errorMessage:b||void 0,success:w,resendCountdown:A,onInvalidInput:e=>{C(e),k(1)},onClearError:()=>{1===x&&(C(null),k(null))}})}};let Hg=/*#__PURE__*/Ne.div.withConfig({displayName:"PasswordlessCodeContainer",componentId:"sc-63a7dae3-0"})(["display:flex;flex-direction:column;align-items:center;justify-content:center;margin:auto;gap:16px;flex-grow:1;width:100%;"]),jg=/*#__PURE__*/Ne.div.withConfig({displayName:"CodeInput",componentId:"sc-63a7dae3-1"})(["display:flex;flex-direction:column;width:100%;gap:12px;> div:first-child{display:flex;justify-content:center;gap:0.5rem;width:100%;border-radius:var(--privy-border-radius-sm);> input{border:1px solid var(--privy-color-foreground-4);background:var(--privy-color-background);border-radius:var(--privy-border-radius-sm);padding:8px 10px;height:48px;width:40px;text-align:center;font-size:18px;font-weight:600;color:var(--privy-color-foreground);transition:all 0.2s ease;}> input:focus{border:1px solid var(--privy-color-foreground);box-shadow:0 0 0 1px var(--privy-color-foreground);}> input:invalid{border:1px solid var(--privy-color-error);}> input.success{border:1px solid var(--privy-color-border-success);background:var(--privy-color-success-bg);}> input.fail{border:1px solid var(--privy-color-border-error);background:var(--privy-color-error-bg);animation:shake 180ms;animation-iteration-count:2;}}@keyframes shake{0%{transform:translate(1px,0px);}33%{transform:translate(-1px,0px);}67%{transform:translate(-1px,0px);}100%{transform:translate(1px,0px);}}"]),$g=/*#__PURE__*/Ne.div.withConfig({displayName:"InputHelp",componentId:"sc-63a7dae3-2"})(["line-height:20px;min-height:20px;font-size:14px;font-weight:400;color:",";display:flex;justify-content:center;width:100%;text-align:center;"],(e=>e.$success?"var(--privy-color-success-dark)":e.$fail?"var(--privy-color-error-dark)":"transparent")),qg=/*#__PURE__*/Ne.div.withConfig({displayName:"HelpTextContainer",componentId:"sc-63a7dae3-3"})(["display:flex;gap:8px;align-items:center;justify-content:center;width:100%;color:var(--privy-color-foreground-2);"]),Gg=/*#__PURE__*/Ne.div.withConfig({displayName:"Badge",componentId:"sc-63a7dae3-4"})(["display:flex;align-items:center;justify-content:center;border-radius:var(--privy-border-radius-sm);padding:2px 8px;gap:4px;background:var(--privy-color-background-2);color:var(--privy-color-foreground-2);"]),Zg=/*#__PURE__*/Ne.span.withConfig({displayName:"BoldWrappingSpan",componentId:"sc-63a7dae3-5"})(["font-weight:500;word-break:break-all;color:var(--privy-color-foreground);"]);const Qg=/*#__PURE__*/E(((a,i)=>{let[r,o]=T(a.defaultValue||""),[l,s]=T(""),[c,d]=T(!1),{authenticated:p}=_i(),{initLoginWithEmail:h}=O(),{navigate:u,setModalData:m,currentScreen:g,data:y}=Ni(),{enabled:f,token:w}=ma(),[b,C]=T(!1),{accountType:x}=Hs(),k=Z();I((()=>{!r&&k.disablePlusEmails&&y?.inlineError?.error instanceof L&&y?.inlineError?.error.privyErrorCode===P.DISALLOWED_PLUS_EMAIL&&!l&&s("Please enter a valid email address without a '+'."),l&&s("")}),[r]);let A=Jn(r),S=c||!A,N=()=>{m({login:y?.login,inlineError:void 0}),!f||w||p?(e=>{d(!0),h({email:r,captchaToken:e,disableSignup:y?.login?.disableSignup,withPrivyUi:!0}).then((()=>{u(Vg)})).catch((e=>{m({errorModalData:{error:e,previousScreen:g||ay}}),u(xc)})).finally((()=>{d(!1)}))})(w):(m({captchaModalData:{callback:e=>h({email:r,captchaToken:e,withPrivyUi:!0}),userIntentRequired:!1,onSuccessNavigateTo:Vg,onErrorNavigateTo:xc}}),u(Xd))};/*#__PURE__*/return e(n,{children:[/*#__PURE__*/e(Yg,{children:[l&&/*#__PURE__*/t(id,{style:{display:"block",marginTop:"0.25rem",textAlign:"left"},children:l}),/*#__PURE__*/e(Kg,{stacked:a.stacked,$error:!!l,children:[/*#__PURE__*/t(Xg,{children:/*#__PURE__*/t(v,{})}),/*#__PURE__*/t("input",{ref:i,id:"email-input",className:"login-method-button",type:"email",placeholder:"your@email.com",onFocus:()=>C(!0),onChange:e=>o(e.target.value),onKeyUp:e=>{"Enter"===e.key&&N()},value:r,autoComplete:"email"}),"email"!==x||b?a.stacked?/*#__PURE__*/t("span",{}):/*#__PURE__*/t(pr,{isSubmitting:c,onClick:N,disabled:S,children:"Submit"}):/*#__PURE__*/t(hu,{color:"gray",children:"Recent"})]})]}),a.stacked?/*#__PURE__*/t(ar,{loadingText:null,loading:c,disabled:S,onClick:N,style:{width:"100%"},children:"Submit"}):null]})}));let Yg=sd,Kg=ld,Xg=/*#__PURE__*/Ne(Oi).withConfig({displayName:"StyledLoginMethodIconWrapper",componentId:"sc-e33d938a-0"})(["display:inline-flex;"]);const Jg=({isEditable:a,setIsEditable:i,defaultValue:r})=>{let o=k(null);/*#__PURE__*/return e(n,{children:[/*#__PURE__*/t(Ui,{$if:!a,children:/*#__PURE__*/t(Qg,{ref:o,defaultValue:r})}),/*#__PURE__*/t(Ui,{$if:a,children:/*#__PURE__*/e(Ri,{onClick:()=>{i(),setTimeout((()=>{o.current?.focus()}),0)},children:[/*#__PURE__*/t(Oi,{children:/*#__PURE__*/t(v,{})}),"Continue with Email"]})})]})},ey=({connectOnly:a})=>{let{closePrivyModal:i,connectors:r}=O(),{onUserCloseViaDialogOrKeybindRef:o,data:l}=Ni(),s=Z(),{appearance:{palette:{colorScheme:c}}}=Z(),{accountType:d,walletClientType:p,chainType:h}=Hs(),u=A((()=>d&&"guest"!==d&&"authorization_key"!==d&&"cross_app"!==d?Rs(d):null),[d]),m=s.loginMethodsAndOrder?.primary??[],g=s.loginMethodsAndOrder?.overflow??[],y=A((()=>[...m,...g]),[m,g]),f=s.loginMethods.passkey,w=l?.login,v=[];p&&y.includes(p)?v.push(p):d&&y.includes(u?.loginMethod)&&v.push(u?.loginMethod);let[b,C]=T("default"),[x,k]=T(Lg({mostRecentlyUsedAccountType:d,smsAvailable:y.includes("sms"),emailAvailable:y.includes("email"),prefilledType:w?.prefill?.type}));I((()=>{k(Lg({mostRecentlyUsedAccountType:d,smsAvailable:y.includes("sms"),emailAvailable:y.includes("email"),prefilledType:w?.prefill?.type}))}),[y,d]),I((()=>{"phone"===d&&k("sms");let e=y.indexOf("sms"),t=y.indexOf("email");e>-1&&e<t&&k("sms")}),[d,m,g]);let S=()=>{i({shouldCallAuthOnSuccess:!0}),setTimeout((()=>{C("default")}),150)};o.current=S;let N=e=>"email"===e?/*#__PURE__*/t(Jg,{isEditable:"email"===x,setIsEditable:()=>{k("email")},defaultValue:"email"===w?.prefill?.type?w.prefill.value:void 0},e):"sms"===e?/*#__PURE__*/t(fg,{isEditable:"sms"===x,setIsEditable:()=>{k("sms")},defaultValue:"phone"===w?.prefill?.type?w.prefill.value:void 0},e):"apple"===e?/*#__PURE__*/t(vg,{provider:"apple"},e):"discord"===e?/*#__PURE__*/t(vg,{provider:"discord"},e):"farcaster"===e?/*#__PURE__*/t(rg,{},e):"github"===e?/*#__PURE__*/t(vg,{provider:"github"},e):"google"===e?/*#__PURE__*/t(vg,{provider:"google"},e):"linkedin"===e?/*#__PURE__*/t(vg,{provider:"linkedin"},e):"spotify"===e?/*#__PURE__*/t(vg,{provider:"spotify"},e):"instagram"===e?/*#__PURE__*/t(vg,{provider:"instagram"},e):"tiktok"===e?/*#__PURE__*/t(vg,{provider:"tiktok"},e):"line"===e?/*#__PURE__*/t(vg,{provider:"line"},e):"twitch"===e?/*#__PURE__*/t(vg,{provider:"twitch"},e):"twitter"===e?/*#__PURE__*/t(vg,{provider:"twitter"},e):"telegram"===e?/*#__PURE__*/t(Tg,{},e):e.startsWith("privy:")?/*#__PURE__*/t(Zs,{appId:e.replace("privy:","")},e):Du({walletList:s.appearance.walletList,walletChainType:w?.walletChainType??s.appearance.walletChainType,connectors:r,connectOnly:a,ignore:y,walletConnectEnabled:s.externalWallets.walletConnect.enabled,forceWallet:{wallet:e,chainType:h??"ethereum"}}),E=v.flatMap(N),_=m.filter((e=>e!==p&&e!==u?.loginMethod)).flatMap(N),M=g.filter((e=>e!==p&&e!==u?.loginMethod)).flatMap(N),[W,L]=((e,t)=>{let n=[],a=[];for(let[i,r]of e.entries())i<t?n.push(r):a.push(r);return[n,a]})([...E,..._,...M],ty({primary:_.length+E.length,overflow:M.length}));/*#__PURE__*/return e(n,{children:[/*#__PURE__*/t(yr,{title:s.appearance.landingHeader,onClose:S,backFn:"default"===b?void 0:()=>{C("default")}}),"default"===b&&/*#__PURE__*/t(ny,{}),"default"===b&&("string"==typeof s.appearance.loginMessage?/*#__PURE__*/t(Di,{children:s.appearance.loginMessage}):s.appearance.loginMessage),/*#__PURE__*/t(Wi,{style:{overflow:"hidden"},children:/*#__PURE__*/e(Pi,{$colorScheme:c,children:["default"===b&&/*#__PURE__*/e(n,{children:[W,L.length>0&&/*#__PURE__*/t(Ig,{text:"More options",icon:/*#__PURE__*/t(Se,{}),onClick:()=>C("overflow")})]}),"overflow"===b&&/*#__PURE__*/t(n,{children:L}),f&&"default"===b&&/*#__PURE__*/t(hg,{})]})}),s&&/*#__PURE__*/t(ji,{app:s}),/*#__PURE__*/t($i,{})]})};let ty=({primary:e,overflow:t})=>e<5?e:5===e&&0===t?5:4,ny=/*#__PURE__*/Ne($s).withConfig({displayName:"StyledAppLogoHeader",componentId:"sc-7cdadd41-0"})(["margin-bottom:16px;"]);const ay={component:()=>{let e=Z();return e.loginMethodsAndOrder&&e.loginMethodsAndOrder.primary.length>0?/*#__PURE__*/t(ey,{connectOnly:!1}):/*#__PURE__*/t(Sg,{connectOnly:!1})},isCaptchaRequired:!0,isUnauthenticatedScreem:!0},iy={component:()=>{let[e,n]=T(null),[a,i]=T(!1),[r,o]=T(null),[l,s]=T(""),{authenticated:c,user:d}=_i(),{client:p,walletProxy:h,refreshSessionAndUser:u,closePrivyModal:m,createAnalyticsEvent:g}=O(),{navigate:y,data:f,onUserCloseViaDialogOrKeybindRef:w}=Ni(),v=Z(),{onSuccess:b,onFailure:C}=f.setWalletPassword,x=Wa(d),k="user-passcode"===e?.recoveryMethod,A="user-passcode"===x?.recoveryMethod;I((()=>{c||(y(ay),C(new $("User must be authenticated before setting a password on a Privy wallet")))}),[c]);let S=()=>r?(C(r),void m({shouldCallAuthOnSuccess:!1})):k?(b(e),void m({shouldCallAuthOnSuccess:!1})):(C(new H("Exited before password was added to wallet")),void m({shouldCallAuthOnSuccess:!1}));w.current=S;/*#__PURE__*/return t(Fs,{appName:v?.name||"privy",config:{initiatedBy:"user",onCancel:S},error:r?"An error has occurred, please try again.":void 0,buttonLoading:a,buttonHideAnimations:!1,password:l,isResettingPassword:A,onPasswordGenerate:()=>s(As()),onPasswordChange:s,onSubmit:async()=>{k?(b(e),m({shouldCallAuthOnSuccess:!1})):(i(!0),o(null),await(async()=>{let e=await p.getAccessToken();if(e&&d&&x?.address&&l&&h)try{g({eventName:"embedded_wallet_set_recovery_started",payload:{walletAddress:x.address,existingRecoveryMethod:x.recoveryMethod,targetRecoveryMethod:"user-passcode",isResettingPassword:A}});let{entropyId:t,entropyIdVerifier:a}=Va(d);if(!(await h.setRecovery({accessToken:e,entropyId:t,entropyIdVerifier:a,recoveryPassword:l,recoveryMethod:"user-passcode"})).entropyId)return o(new H("Error setting password on privy wallet")),void g({eventName:"embedded_wallet_set_recovery_failed",payload:{walletAddress:x.address,existingRecoveryMethod:x.recoveryMethod,targetRecoveryMethod:"user-passcode",isResettingPassword:A,reason:"error setting password"}});let i=await u(),r=Wa(i);if(!r)return o(new H("Error setting password on privy wallet")),void g({eventName:"embedded_wallet_set_recovery_failed",payload:{walletAddress:x.address,existingRecoveryMethod:x.recoveryMethod,targetRecoveryMethod:"user-passcode",isResettingPassword:A,reason:"wallet disconnected"}});n(r),g({eventName:"embedded_wallet_set_recovery_completed",payload:{walletAddress:x.address,existingRecoveryMethod:x.recoveryMethod,targetRecoveryMethod:"user-passcode",isResettingPassword:A}})}catch(e){console.warn(e),o(e instanceof Error?e:Error("Error setting password on privy wallet")),g({eventName:"embedded_wallet_set_password_failed",payload:{walletAddress:x.address,reason:e}})}})(),i(!1))},onClose:S})}},ry=({onClose:a,onProceed:i})=>/*#__PURE__*/t(Qr,{title:"Secure Your Account",subtitle:/*#__PURE__*/e(n,{children:["Please set a password to secure your account.",/*#__PURE__*/t("br",{}),"Losing access to this password and this device will make your account inaccessible."]}),icon:c,primaryCta:{label:"Add password",onClick:i},onClose:a,watermark:!0}),oy={component:()=>{let{closePrivyModal:e}=O(),{data:n,navigate:a,onUserCloseViaDialogOrKeybindRef:i}=Ni(),{onFailure:r}=n.setWalletPassword,o=()=>{r(new H("Exited before password was added to wallet")),e({shouldCallAuthOnSuccess:!1})};return i.current=o,/*#__PURE__*/t(ry,{onClose:o,onProceed:()=>{a(iy)}})}},ly={component:()=>{let[n,a]=T(!0),{authenticated:i,user:r}=_i(),{walletProxy:o,closePrivyModal:l,createAnalyticsEvent:s,client:c}=O(),{navigate:d,data:p,onUserCloseViaDialogOrKeybindRef:h}=Ni(),[u,m]=T(void 0),[g,y]=T(""),[f,w]=T(!1),{entropyId:v,entropyIdVerifier:b,onCompleteNavigateTo:C,onSuccess:x,onFailure:k}=p.recoverWallet,A=(e="User exited before their wallet could be recovered")=>{l({shouldCallAuthOnSuccess:!1}),k("string"==typeof e?new H(e):e)};h.current=A,I((()=>{if(!i)return A("User must be authenticated and have a Privy wallet before it can be recovered")}),[i]);/*#__PURE__*/return e(Vr,{children:[/*#__PURE__*/t(Vr.Header,{icon:hn,title:"Enter your password",subtitle:"Please provision your account on this new device. To continue, enter your recovery password.",showClose:!0,onClose:A}),/*#__PURE__*/t(Vr.Body,{children:/*#__PURE__*/t(sy,{children:/*#__PURE__*/e("div",{children:[/*#__PURE__*/e(Jl,{children:[/*#__PURE__*/t(Kl,{type:n?"password":"text",onChange:e=>(e=>{e&&m(e)})(e.target.value),disabled:f,style:{paddingRight:"2.3rem"}}),/*#__PURE__*/t(is,{style:{right:"0.75rem"},children:n?/*#__PURE__*/t(os,{onClick:()=>a(!1)}):/*#__PURE__*/t(ls,{onClick:()=>a(!0)})})]}),!!g&&/*#__PURE__*/t(cy,{children:g})]})})}),/*#__PURE__*/e(Vr.Footer,{children:[/*#__PURE__*/t(Vr.HelpText,{children:/*#__PURE__*/e(Lo,{children:[/*#__PURE__*/t("h4",{children:"Why is this necessary?"}),/*#__PURE__*/t("p",{children:"You previously set a password for this wallet. This helps ensure only you can access it"})]})}),/*#__PURE__*/t(Vr.Actions,{children:/*#__PURE__*/t(dy,{loading:f||!o,disabled:!u,onClick:async()=>{w(!0);let e=await c.getAccessToken(),t=_a(r,v);if(!e||!t||null===u)return A("User must be authenticated and have a Privy wallet before it can be recovered");try{s({eventName:"embedded_wallet_recovery_started",payload:{walletAddress:t.address}}),await(o?.recover({accessToken:e,entropyId:v,entropyIdVerifier:b,recoveryPassword:u})),y(""),C?d(C):l({shouldCallAuthOnSuccess:!1}),x?.(t),s({eventName:"embedded_wallet_recovery_completed",payload:{walletAddress:t.address}})}catch(e){!function(e){return fl(e)&&("invalid_recovery_pin"===e.type||"invalid_request_arguments"===e.type)}(e)?y("An error has occurred, please try again."):y("Invalid recovery password, please try again.")}finally{w(!1)}},$hideAnimations:!v&&f,children:"Recover your account"})}),/*#__PURE__*/t(Vr.Watermark,{})]})]})}};let sy=/*#__PURE__*/Ne.div.withConfig({displayName:"Content",componentId:"sc-f366413c-0"})(["display:flex;flex-direction:column;gap:1.5rem;"]),cy=/*#__PURE__*/Ne.div.withConfig({displayName:"ErrorMessage",componentId:"sc-f366413c-1"})(["line-height:20px;height:20px;font-size:13px;color:var(--privy-color-error);text-align:left;margin-top:0.5rem;"]),dy=/*#__PURE__*/Ne(ar).withConfig({displayName:"NoAnimationPrimaryButton",componentId:"sc-f366413c-2"})(["",""],(({$hideAnimations:e})=>e&&/*#__PURE__*/Ee(["&&{transition:none;}"])));const py={component:()=>{let{navigate:e,data:n,onUserCloseViaDialogOrKeybindRef:a}=Ni(),i=Z(),[r,o]=T(""),[l,s]=T(!1),[c,d]=T(),[p,h]=T(null),{create:u}=Fl(),{authenticated:m,user:g}=_i(),{closePrivyModal:y,isNewUserThisSession:f,initializeWalletProxy:w}=O(),{onSuccess:v,onFailure:b,callAuthOnSuccessOnClose:C,shouldCreateEth:x,shouldCreateSol:k}=n.createWallet,[A,S]=T(null),N=new Tn((async()=>{try{let t;if(x&&k)t=await u({recoveryMethod:"user-passcode",recoveryPassword:c,chainType:"ethereum",walletIndex:0,latestUser:g}),t=await u({chainType:"solana",walletIndex:0,latestUser:t.user});else if(k)t=await u({recoveryMethod:"user-passcode",recoveryPassword:c,chainType:"solana",walletIndex:0,latestUser:g});else{if(!x)throw Error("Invalid args to create wallet");t=await u({recoveryMethod:"user-passcode",recoveryPassword:c,chainType:"ethereum",walletIndex:0,latestUser:g})}S(t),f?e(Rl):(v(t),y({shouldCallAuthOnSuccess:C}))}catch(e){o(e.message)}}));I((()=>{p||w(3e4).then((e=>h(e)))}),[p]),I((()=>{if(!m||!g)return e(ay),void b(Error("User must be authenticated before creating a Privy wallet"))}),[m]),a.current=()=>null;/*#__PURE__*/return t(Fs,{config:{initiatedBy:"automatic"},appName:i?.name||"privy",loading:!p,buttonLoading:l,buttonHideAnimations:!A&&l,isResettingPassword:!1,error:r,password:c||"",onClose:()=>{A&&"user-passcode"!==A.account.recoveryMethod?(b(new H("User created a wallet but failed to set a password for it")),y({shouldCallAuthOnSuccess:!1})):A?(v(A),y({shouldCallAuthOnSuccess:C})):(b(new H("User wallet creation failed")),y({shouldCallAuthOnSuccess:!1}))},onPasswordChange:d,onPasswordGenerate:()=>d(As()),onSubmit:async()=>(s(!0),N.execute().then((()=>new Promise((e=>setTimeout(e,250))))).finally((()=>s(!1))))})}},hy=/*#__PURE__*/Ne.div.withConfig({displayName:"WithCircleBorder",componentId:"sc-e4fc5563-0"})(["&&{border-width:4px;}display:flex;justify-content:center;align-items:center;padding:1rem;aspect-ratio:1;border-style:solid;border-color:",";border-radius:50%;"],(e=>e.$color??"var(--privy-color-accent)")),uy={component:()=>{let{user:a}=_i(),{client:i,walletProxy:r,refreshSessionAndUser:o,closePrivyModal:l}=O(),s=Ni(),{entropyId:c,entropyIdVerifier:d}=s.data?.recoverWallet,[p,h]=T(!1),[u,m]=T(null),[g,y]=T(null);function f(){if(!p){if(g)return s.data?.setWalletPassword?.onFailure(g),void l();if(!u)return s.data?.setWalletPassword?.onFailure(Error("User exited set recovery flow")),void l()}}s.onUserCloseViaDialogOrKeybindRef.current=f;let w=!(!p&&!u);/*#__PURE__*/return e(n,g?{children:[/*#__PURE__*/t(yr,{onClose:f},"header"),/*#__PURE__*/t(hy,{$color:"var(--privy-color-error)",style:{alignSelf:"center"},children:/*#__PURE__*/t(Be,{height:38,width:38,stroke:"var(--privy-color-error)"})}),/*#__PURE__*/t(yp,{style:{marginTop:"0.5rem"},children:"Something went wrong"}),/*#__PURE__*/t(Mi,{style:{minHeight:"2rem"}}),/*#__PURE__*/t(ir,{onClick:()=>y(null),children:"Try again"}),/*#__PURE__*/t($i,{})]}:{children:[/*#__PURE__*/t(yr,{onClose:f},"header"),/*#__PURE__*/t(tn,{style:{width:"3rem",height:"3rem",alignSelf:"center"}}),/*#__PURE__*/t(yp,{style:{marginTop:"0.5rem"},children:"Automatically secure your account"}),/*#__PURE__*/t(gp,{style:{marginTop:"1rem"},children:"When you log into a new device, you’ll only need to authenticate to access your account. Never get logged out if you forget your password."}),/*#__PURE__*/t(Mi,{style:{minHeight:"2rem"}}),/*#__PURE__*/t(ir,{loading:p,disabled:w,onClick:()=>async function(){h(!0);try{let e=await i.getAccessToken(),t=_a(a,c);if(!e||!r||!t)return;if(!(await r.setRecovery({accessToken:e,entropyId:c,entropyIdVerifier:d,existingRecoveryMethod:t.recoveryMethod,recoveryMethod:"privy"})).entropyId)throw Error("Unable to set recovery on wallet");let n=await o();if(!n)throw Error("Unable to set recovery on wallet");let p=_a(n,t.address);if(!p)throw Error("Unabled to set recovery on wallet");m(!!n),setTimeout((()=>{s.data?.setWalletPassword?.onSuccess(p),l()}),ne)}catch(e){y(e)}finally{h(!1)}}(),children:u?"Success":"Confirm"}),/*#__PURE__*/t($i,{})]})}};function my({isCreatingWallet:e,skipSplashScreen:t}){return e?py:t?iy:oy}function gy({walletAction:e,availableRecoveryMethods:t,legacySetWalletPasswordFlow:n,isResettingPassword:a,showAutomaticRecovery:i}){return i?uy:n||1===t.length?my({isCreatingWallet:"create"===e,skipSplashScreen:a}):$l}function yy(e){switch(e){case"user-passcode":return ly;case"google-drive":case"icloud":return zl;default:throw Error("Recovery method not supported")}}const fy=({address:a,accessToken:i,appConfigTheme:r,onClose:o,isLoading:l=!1,exportButtonProps:s})=>/*#__PURE__*/t(Qr,{title:"Export wallet",subtitle:/*#__PURE__*/e(n,{children:["Copy either your private key or seed phrase to export your wallet."," ",/*#__PURE__*/t("a",{href:"https://privy-io.notion.site/Transferring-your-account-9dab9e16c6034a7ab1ff7fa479b02828",target:"blank",rel:"noopener noreferrer",children:"Learn more"})]}),onClose:o,watermark:!0,children:/*#__PURE__*/e(wy,{children:[/*#__PURE__*/t(dh,{theme:r,children:"Never share your private key or seed phrase with anyone."}),/*#__PURE__*/t(Sp,{title:"Your wallet",address:a,showCopyButton:!0}),/*#__PURE__*/t("div",{style:{width:"100%"},children:l?/*#__PURE__*/t(vy,{}):i&&s&&/*#__PURE__*/t(xy,{accessToken:i,dimensions:{height:"44px"},...s})})]})});let wy=/*#__PURE__*/Ne.div.withConfig({displayName:"ContentContainer",componentId:"sc-a47f8be6-0"})(["display:flex;flex-direction:column;gap:1.25rem;text-align:left;"]),vy=()=>/*#__PURE__*/t(by,{children:/*#__PURE__*/t(Cy,{children:"Loading..."})}),by=/*#__PURE__*/Ne.div.withConfig({displayName:"PlaceholderContainer",componentId:"sc-a47f8be6-1"})(["display:flex;gap:12px;height:44px;"]),Cy=/*#__PURE__*/Ne.div.withConfig({displayName:"PlaceholderButton",componentId:"sc-a47f8be6-2"})(["display:flex;align-items:center;justify-content:center;width:100%;height:100%;font-size:16px;font-weight:500;border-radius:var(--privy-border-radius-md);background-color:var(--privy-color-background-2);color:var(--privy-color-foreground-3);"]);function xy(n){let[a,i]=T(n.dimensions.width),[r,o]=T(void 0),l=k(null);I((()=>{if(l.current&&void 0===a){let{width:e}=l.current.getBoundingClientRect();i(e)}let e=getComputedStyle(document.documentElement);o({background:e.getPropertyValue("--privy-color-background"),background2:e.getPropertyValue("--privy-color-background-2"),foreground3:e.getPropertyValue("--privy-color-foreground-3"),foregroundAccent:e.getPropertyValue("--privy-color-foreground-accent"),accent:e.getPropertyValue("--privy-color-accent"),accentDark:e.getPropertyValue("--privy-color-accent-dark"),success:e.getPropertyValue("--privy-color-success"),colorScheme:e.getPropertyValue("color-scheme")})}),[]);let s="ethereum"===n.chainType&&!n.imported&&!n.isUnifiedWallet;/*#__PURE__*/return t("div",{ref:l,children:a&&
25
- /*#__PURE__*/e(Ty,{children:[/*#__PURE__*/t("iframe",{style:{position:"absolute",zIndex:1},width:a,height:n.dimensions.height,allow:"clipboard-write self *",src:un({origin:n.origin,path:`/apps/${n.appId}/embedded-wallets/export`,query:n.isUnifiedWallet?{v:"1-unified",wallet_id:n.walletId,client_id:n.appClientId,width:`${a}px`,caid:n.clientAnalyticsId,phrase_export:s,...r}:{v:"1",entropy_id:n.entropyId,entropy_id_verifier:n.entropyIdVerifier,hd_wallet_index:n.hdWalletIndex,chain_type:n.chainType,client_id:n.appClientId,width:`${a}px`,caid:n.clientAnalyticsId,phrase_export:s,...r},hash:{token:n.accessToken}})}),/*#__PURE__*/t(Ay,{children:"Loading..."}),s&&/*#__PURE__*/t(Ay,{children:"Loading..."})]})})}const ky={component:()=>{let[e,n]=T(null),{authenticated:a,user:i}=_i(),{closePrivyModal:r,createAnalyticsEvent:o,clientAnalyticsId:l,client:s}=O(),c=Z(),{data:d,onUserCloseViaDialogOrKeybindRef:p}=Ni(),{onFailure:h,onSuccess:u,origin:m,appId:g,appClientId:y,entropyId:f,entropyIdVerifier:w,walletId:v,hdWalletIndex:b,chainType:C,address:x,isUnifiedWallet:k,imported:A}=d.keyExport,S=e=>{r({shouldCallAuthOnSuccess:!1}),h("string"==typeof e?Error(e):e)},N=()=>{r({shouldCallAuthOnSuccess:!1}),u(),o({eventName:"embedded_wallet_key_export_completed",payload:{walletAddress:x}})};return I((()=>{if(!a)return S("User must be authenticated before exporting their wallet");s.getAccessToken().then(n).catch(S)}),[a,i]),p.current=N,/*#__PURE__*/t(fy,{address:x,accessToken:e,appConfigTheme:c.appearance.palette.colorScheme,onClose:N,isLoading:!e,exportButtonProps:e?{origin:m,appId:g,appClientId:y,clientAnalyticsId:l,entropyId:f,entropyIdVerifier:w,walletId:v,hdWalletIndex:b,isUnifiedWallet:k,imported:A,chainType:C}:void 0})}};let Ty=/*#__PURE__*/Ne.div.withConfig({displayName:"ButtonContainer",componentId:"sc-a47f8be6-3"})(["overflow:visible;position:relative;overflow:none;height:44px;display:flex;gap:12px;"]),Ay=/*#__PURE__*/Ne.div.withConfig({displayName:"LoadingButton",componentId:"sc-a47f8be6-4"})(["display:flex;align-items:center;justify-content:center;width:100%;height:100%;font-size:16px;font-weight:500;border-radius:var(--privy-border-radius-md);background-color:var(--privy-color-background-2);color:var(--privy-color-foreground-3);"]);const Iy=({connectionFailed:e,onClose:n})=>/*#__PURE__*/t(Qr,e?{title:"Something went wrong",subtitle:"We're on it. Please try again later.",icon:d,iconVariant:"error",primaryCta:{label:"Close",onClick:n},watermark:!0}:{title:"Connecting to your wallet",subtitle:"Please wait...",iconVariant:"loading",showClose:!0,onClose:n,watermark:!1}),Sy={component:()=>{let{authenticated:e,user:n}=_i(),{client:a,closePrivyModal:i,createAnalyticsEvent:r,walletProxy:o}=O(),{navigate:l,data:s,setModalData:c,onUserCloseViaDialogOrKeybindRef:d}=Ni(),p=A((()=>Date.now()),[]),[h,u]=T(!1),{onCompleteNavigateTo:m,onFailure:g,shouldForceMFA:y,entropyId:f,entropyIdVerifier:w,recoveryMethod:v,connectingWalletAddress:b,isUnifiedWallet:C=!1}=s?.connectWallet,x=e=>{h||(u(!0),g("string"==typeof e?Error(e):e))};return I((()=>{let t;return e?o?((async()=>{let e=await a.getAccessToken();if(!e)return x("User must be authenticated and have a Privy wallet before it can be connected");try{if(!C){if(!f||!w)return x("For on-device first-class chain wallets, entropyId and entropyIdVerifier are required");await o.connect({accessToken:e,entropyId:f,entropyIdVerifier:w})}y&&await o.verifyMfa({accessToken:e});let n=(Date.now()-p)/1e3;m===ky&&n<1?t=setTimeout((()=>{l(m,!1)}),1e3*(1-n)):l(m,!1)}catch(e){if(wl(e)&&"privy"===v){let e=await a.getAccessToken();if(!e)return x("User must be authenticated and have a Privy wallet before it can be recovered");try{r({eventName:"embedded_wallet_pinless_recovery_started",payload:{walletAddress:b}});let t=await(o?.recover({accessToken:e,entropyId:f,entropyIdVerifier:w}));t?.entropyId||x(Error("Unable to recover wallet")),m?l(m):i({shouldCallAuthOnSuccess:!1}),r({eventName:"embedded_wallet_recovery_completed",payload:{walletAddress:b}}),l(m)}catch(e){x("An error has occurred, please try again.")}}else wl(e)&&"privy"!==v&&"privy-v2"!==v?(c({...s,recoverWallet:{entropyId:f,entropyIdVerifier:w,onCompleteNavigateTo:m,onFailure:g},recoveryOAuthStatus:{provider:v,action:"recover",isInAccountCreateFlow:!1,shouldCreateEth:!1,shouldCreateSol:!1}}),l(yy(v))):x(e)}})(),()=>clearTimeout(t)):void 0:x("User must be authenticated and have a Privy wallet before it can be connected")}),[e,n,o]),d.current=()=>{x("User exited before wallet could be connected"),i({shouldCallAuthOnSuccess:!1})},/*#__PURE__*/t(Iy,{connectionFailed:h,onClose:()=>i({shouldCallAuthOnSuccess:!1})})}};export{hl as $,Wn as A,$a as B,ja as C,Ln as D,ni as E,xi as F,Pn as G,Va as H,Dn as I,mi as J,oi as K,Rn as L,si as M,gn as N,An as O,ai as P,$n as Q,Tn as R,Un as S,zn as T,La as U,ma as V,Ti as W,Qr as X,Ri as Y,Oi as Z,Gi as _,Sn as a,od as a$,dl as a0,ul as a1,ol as a2,yr as a3,ml as a4,Zi as a5,ar as a6,lr as a7,Cl as a8,bl as a9,Fc as aA,Sp as aB,Bm as aC,zm as aD,ad as aE,Io as aF,Qg as aG,mg as aH,Vg as aI,xc as aJ,ay as aK,hu as aL,Cc as aM,xl as aN,kl as aO,yp as aP,gp as aQ,Eo as aR,fp as aS,vp as aT,Yd as aU,op as aV,ac as aW,Hn as aX,Jn as aY,sd as aZ,id as a_,vl as aa,_i as ab,Ni as ac,Ei as ad,Po as ae,Ki as af,Fo as ag,Ui as ah,yl as ai,aa as aj,Wa as ak,Ji as al,bu as am,Cu as an,Om as ao,ym as ap,hm as aq,pm as ar,mm as as,Fp as at,Em as au,za as av,wl as aw,Bc as ax,tc as ay,Uc as az,Bn as b,zp as b$,pr as b0,Xd as b1,$d as b2,Gd as b3,Ra as b4,xa as b5,ka as b6,Sa as b7,Ks as b8,Js as b9,Xm as bA,wa as bB,pp as bC,Um as bD,lu as bE,gy as bF,fa as bG,hi as bH,vu as bI,Rs as bJ,ha as bK,qn as bL,Xn as bM,Ea as bN,da as bO,Ja as bP,pd as bQ,ea as bR,Zc as bS,Hs as bT,Np as bU,ao as bV,$i as bW,Td as bX,Ad as bY,Op as bZ,Lp as b_,Ka as ba,la as bb,Xa as bc,_a as bd,Na as be,yy as bf,jn as bg,na as bh,fu as bi,ga as bj,Gn as bk,um as bl,_p as bm,pl as bn,ua as bo,Us as bp,Si as bq,kg as br,cp as bs,Zd as bt,ki as bu,ky as bv,Sy as bw,Ma as bx,Qa as by,Pg as bz,In as c,Xp as c0,bd as c1,Bu as c2,vd as c3,rc as c4,Kp as c5,yd as c6,fd as c7,Cd as c8,Nd as c9,yo as cA,Aa as cB,Wp as cC,lo as cD,yi as cE,su as cF,_o as cG,So as cH,yu as cI,Mp as cJ,Ep as cK,kr as cL,Ia as cM,Ll as cN,Pl as cO,Ta as cP,Hc as cQ,Za as cR,Wo as cS,Hp as cT,$p as cU,Ed as ca,Pd as cb,Sd as cc,xd as cd,_d as ce,Id as cf,fi as cg,Ci as ch,qd as ci,Zp as cj,th as ck,Co as cl,il as cm,Al as cn,Mi as co,go as cp,co as cq,po as cr,so as cs,ho as ct,uo as cu,mo as cv,cl as cw,wo as cx,Ih as cy,wh as cz,Nn as d,Vn as e,On as f,En as g,Fn as h,Mn as i,_n as j,Ga as k,ii as l,Kn as m,ca as n,kn as o,yn as p,ri as q,ei as r,li as s,ra as t,ci as u,oa as v,pi as w,vi as x,Ba as y,ti as z};