@m0-foundation/swap-component 0.0.1

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 (240) hide show
  1. package/dist/m0-swap-component/ConstantsUtil-btJ3XIXu.js +28 -0
  2. package/dist/m0-swap-component/ConstantsUtil-btJ3XIXu.js.map +1 -0
  3. package/dist/m0-swap-component/HelpersUtil-5wkO4kIW.js +142 -0
  4. package/dist/m0-swap-component/HelpersUtil-5wkO4kIW.js.map +1 -0
  5. package/dist/m0-swap-component/PhArrowCircleDown-BiDIiYXi.js +76 -0
  6. package/dist/m0-swap-component/PhArrowCircleDown-BiDIiYXi.js.map +1 -0
  7. package/dist/m0-swap-component/PhArrowClockwise-BRnlxNUR.js +76 -0
  8. package/dist/m0-swap-component/PhArrowClockwise-BRnlxNUR.js.map +1 -0
  9. package/dist/m0-swap-component/PhArrowDown-Co2hyXIs.js +76 -0
  10. package/dist/m0-swap-component/PhArrowDown-Co2hyXIs.js.map +1 -0
  11. package/dist/m0-swap-component/PhArrowLeft-Cb8ijwK6.js +76 -0
  12. package/dist/m0-swap-component/PhArrowLeft-Cb8ijwK6.js.map +1 -0
  13. package/dist/m0-swap-component/PhArrowRight-B9t--Gmh.js +76 -0
  14. package/dist/m0-swap-component/PhArrowRight-B9t--Gmh.js.map +1 -0
  15. package/dist/m0-swap-component/PhArrowSquareOut-eGBMEr5T.js +76 -0
  16. package/dist/m0-swap-component/PhArrowSquareOut-eGBMEr5T.js.map +1 -0
  17. package/dist/m0-swap-component/PhArrowUp-CjSpT-xh.js +76 -0
  18. package/dist/m0-swap-component/PhArrowUp-CjSpT-xh.js.map +1 -0
  19. package/dist/m0-swap-component/PhArrowUpRight-B8u6wk-A.js +76 -0
  20. package/dist/m0-swap-component/PhArrowUpRight-B8u6wk-A.js.map +1 -0
  21. package/dist/m0-swap-component/PhArrowsClockwise-CBcfV6j6.js +76 -0
  22. package/dist/m0-swap-component/PhArrowsClockwise-CBcfV6j6.js.map +1 -0
  23. package/dist/m0-swap-component/PhArrowsDownUp-CMVR84b1.js +76 -0
  24. package/dist/m0-swap-component/PhArrowsDownUp-CMVR84b1.js.map +1 -0
  25. package/dist/m0-swap-component/PhArrowsLeftRight-CmXk8rs2.js +76 -0
  26. package/dist/m0-swap-component/PhArrowsLeftRight-CmXk8rs2.js.map +1 -0
  27. package/dist/m0-swap-component/PhBank-BigtjnS8.js +76 -0
  28. package/dist/m0-swap-component/PhBank-BigtjnS8.js.map +1 -0
  29. package/dist/m0-swap-component/PhBrowser-BOulLD8D.js +76 -0
  30. package/dist/m0-swap-component/PhBrowser-BOulLD8D.js.map +1 -0
  31. package/dist/m0-swap-component/PhCaretDown-BvvZ65ad.js +76 -0
  32. package/dist/m0-swap-component/PhCaretDown-BvvZ65ad.js.map +1 -0
  33. package/dist/m0-swap-component/PhCaretLeft-DtwjZbZ7.js +76 -0
  34. package/dist/m0-swap-component/PhCaretLeft-DtwjZbZ7.js.map +1 -0
  35. package/dist/m0-swap-component/PhCaretRight-C8LuSZkO.js +76 -0
  36. package/dist/m0-swap-component/PhCaretRight-C8LuSZkO.js.map +1 -0
  37. package/dist/m0-swap-component/PhCaretUp-B2lAObip.js +76 -0
  38. package/dist/m0-swap-component/PhCaretUp-B2lAObip.js.map +1 -0
  39. package/dist/m0-swap-component/PhCheck-DQtuVrQf.js +76 -0
  40. package/dist/m0-swap-component/PhCheck-DQtuVrQf.js.map +1 -0
  41. package/dist/m0-swap-component/PhCircleHalf-CXfZ0QZv.js +76 -0
  42. package/dist/m0-swap-component/PhCircleHalf-CXfZ0QZv.js.map +1 -0
  43. package/dist/m0-swap-component/PhClock-CXsmuc_a.js +76 -0
  44. package/dist/m0-swap-component/PhClock-CXsmuc_a.js.map +1 -0
  45. package/dist/m0-swap-component/PhCompass-Cg-qnMon.js +76 -0
  46. package/dist/m0-swap-component/PhCompass-Cg-qnMon.js.map +1 -0
  47. package/dist/m0-swap-component/PhCopy-kGRKcvb4.js +76 -0
  48. package/dist/m0-swap-component/PhCopy-kGRKcvb4.js.map +1 -0
  49. package/dist/m0-swap-component/PhCreditCard-jYFausLO.js +76 -0
  50. package/dist/m0-swap-component/PhCreditCard-jYFausLO.js.map +1 -0
  51. package/dist/m0-swap-component/PhCurrencyDollar-C8vSY3fy.js +76 -0
  52. package/dist/m0-swap-component/PhCurrencyDollar-C8vSY3fy.js.map +1 -0
  53. package/dist/m0-swap-component/PhDesktop-AczlBCho.js +76 -0
  54. package/dist/m0-swap-component/PhDesktop-AczlBCho.js.map +1 -0
  55. package/dist/m0-swap-component/PhDeviceMobile-3rFbdWLA.js +76 -0
  56. package/dist/m0-swap-component/PhDeviceMobile-3rFbdWLA.js.map +1 -0
  57. package/dist/m0-swap-component/PhDotsThree-cJsXXsvY.js +76 -0
  58. package/dist/m0-swap-component/PhDotsThree-cJsXXsvY.js.map +1 -0
  59. package/dist/m0-swap-component/PhEnvelope-C1bxHVXw.js +76 -0
  60. package/dist/m0-swap-component/PhEnvelope-C1bxHVXw.js.map +1 -0
  61. package/dist/m0-swap-component/PhFunnelSimple-DhqB9fsu.js +76 -0
  62. package/dist/m0-swap-component/PhFunnelSimple-DhqB9fsu.js.map +1 -0
  63. package/dist/m0-swap-component/PhGlobe-BFp6kx95.js +76 -0
  64. package/dist/m0-swap-component/PhGlobe-BFp6kx95.js.map +1 -0
  65. package/dist/m0-swap-component/PhIdentificationCard-BdYxckWB.js +76 -0
  66. package/dist/m0-swap-component/PhIdentificationCard-BdYxckWB.js.map +1 -0
  67. package/dist/m0-swap-component/PhImage-CXxX5oq3.js +76 -0
  68. package/dist/m0-swap-component/PhImage-CXxX5oq3.js.map +1 -0
  69. package/dist/m0-swap-component/PhInfo-BcuP36hY.js +76 -0
  70. package/dist/m0-swap-component/PhInfo-BcuP36hY.js.map +1 -0
  71. package/dist/m0-swap-component/PhLightbulb-DkWwRl94.js +76 -0
  72. package/dist/m0-swap-component/PhLightbulb-DkWwRl94.js.map +1 -0
  73. package/dist/m0-swap-component/PhMagnifyingGlass-B_fFjslY.js +76 -0
  74. package/dist/m0-swap-component/PhMagnifyingGlass-B_fFjslY.js.map +1 -0
  75. package/dist/m0-swap-component/PhPaperPlaneRight-BIzGG3QW.js +76 -0
  76. package/dist/m0-swap-component/PhPaperPlaneRight-BIzGG3QW.js.map +1 -0
  77. package/dist/m0-swap-component/PhPlus-BGosT2zu.js +76 -0
  78. package/dist/m0-swap-component/PhPlus-BGosT2zu.js.map +1 -0
  79. package/dist/m0-swap-component/PhPower-BMqDnP1n.js +76 -0
  80. package/dist/m0-swap-component/PhPower-BMqDnP1n.js.map +1 -0
  81. package/dist/m0-swap-component/PhPuzzlePiece-DNMpiJNU.js +76 -0
  82. package/dist/m0-swap-component/PhPuzzlePiece-DNMpiJNU.js.map +1 -0
  83. package/dist/m0-swap-component/PhQrCode-DrHkqrU4.js +76 -0
  84. package/dist/m0-swap-component/PhQrCode-DrHkqrU4.js.map +1 -0
  85. package/dist/m0-swap-component/PhQuestion-zTfvwqNz.js +76 -0
  86. package/dist/m0-swap-component/PhQuestion-zTfvwqNz.js.map +1 -0
  87. package/dist/m0-swap-component/PhQuestionMark-h3Nk1Yf1.js +76 -0
  88. package/dist/m0-swap-component/PhQuestionMark-h3Nk1Yf1.js.map +1 -0
  89. package/dist/m0-swap-component/PhSealCheck-DPPqSt6G.js +76 -0
  90. package/dist/m0-swap-component/PhSealCheck-DPPqSt6G.js.map +1 -0
  91. package/dist/m0-swap-component/PhSignOut-CJgnrE_v.js +76 -0
  92. package/dist/m0-swap-component/PhSignOut-CJgnrE_v.js.map +1 -0
  93. package/dist/m0-swap-component/PhSpinner-CMTEIWbw.js +76 -0
  94. package/dist/m0-swap-component/PhSpinner-CMTEIWbw.js.map +1 -0
  95. package/dist/m0-swap-component/PhTrash-CeDVW4am.js +76 -0
  96. package/dist/m0-swap-component/PhTrash-CeDVW4am.js.map +1 -0
  97. package/dist/m0-swap-component/PhUser-lQ9WUtAV.js +76 -0
  98. package/dist/m0-swap-component/PhUser-lQ9WUtAV.js.map +1 -0
  99. package/dist/m0-swap-component/PhVault-EnLnS_IQ.js +76 -0
  100. package/dist/m0-swap-component/PhVault-EnLnS_IQ.js.map +1 -0
  101. package/dist/m0-swap-component/PhWallet-CUeDZydd.js +76 -0
  102. package/dist/m0-swap-component/PhWallet-CUeDZydd.js.map +1 -0
  103. package/dist/m0-swap-component/PhWarning-CokeGZs2.js +76 -0
  104. package/dist/m0-swap-component/PhWarning-CokeGZs2.js.map +1 -0
  105. package/dist/m0-swap-component/PhWarningCircle-vWtA7S0R.js +76 -0
  106. package/dist/m0-swap-component/PhWarningCircle-vWtA7S0R.js.map +1 -0
  107. package/dist/m0-swap-component/PhX-DwCRIvoc.js +76 -0
  108. package/dist/m0-swap-component/PhX-DwCRIvoc.js.map +1 -0
  109. package/dist/m0-swap-component/data-capture-BmovBbKV.js +573 -0
  110. package/dist/m0-swap-component/data-capture-BmovBbKV.js.map +1 -0
  111. package/dist/m0-swap-component/email-B4niz3Ms.js +445 -0
  112. package/dist/m0-swap-component/email-B4niz3Ms.js.map +1 -0
  113. package/dist/m0-swap-component/embedded-wallet-D6bzjX_K.js +988 -0
  114. package/dist/m0-swap-component/embedded-wallet-D6bzjX_K.js.map +1 -0
  115. package/dist/m0-swap-component/features-EhJNVE-M.js +355 -0
  116. package/dist/m0-swap-component/features-EhJNVE-M.js.map +1 -0
  117. package/dist/m0-swap-component/if-defined-2CMpVr2R.js +12 -0
  118. package/dist/m0-swap-component/if-defined-2CMpVr2R.js.map +1 -0
  119. package/dist/m0-swap-component/index-B4xuj7uR.js +965 -0
  120. package/dist/m0-swap-component/index-B4xuj7uR.js.map +1 -0
  121. package/dist/m0-swap-component/index-BVZ66GYf.js +206 -0
  122. package/dist/m0-swap-component/index-BVZ66GYf.js.map +1 -0
  123. package/dist/m0-swap-component/index-BZXyMieH.js +150 -0
  124. package/dist/m0-swap-component/index-BZXyMieH.js.map +1 -0
  125. package/dist/m0-swap-component/index-Bj5sA_Ri.js +252 -0
  126. package/dist/m0-swap-component/index-Bj5sA_Ri.js.map +1 -0
  127. package/dist/m0-swap-component/index-Bs-pPJYj.js +129 -0
  128. package/dist/m0-swap-component/index-Bs-pPJYj.js.map +1 -0
  129. package/dist/m0-swap-component/index-CMS76VPf.js +474 -0
  130. package/dist/m0-swap-component/index-CMS76VPf.js.map +1 -0
  131. package/dist/m0-swap-component/index-CoMTkqee.js +95 -0
  132. package/dist/m0-swap-component/index-CoMTkqee.js.map +1 -0
  133. package/dist/m0-swap-component/index-DE0OtbL2.js +3566 -0
  134. package/dist/m0-swap-component/index-DE0OtbL2.js.map +1 -0
  135. package/dist/m0-swap-component/index-DEG-YczD.js +231 -0
  136. package/dist/m0-swap-component/index-DEG-YczD.js.map +1 -0
  137. package/dist/m0-swap-component/index-DY_Ijq_4.js +4345 -0
  138. package/dist/m0-swap-component/index-DY_Ijq_4.js.map +1 -0
  139. package/dist/m0-swap-component/index-IRpGhIhy.js +9394 -0
  140. package/dist/m0-swap-component/index-IRpGhIhy.js.map +1 -0
  141. package/dist/m0-swap-component/index-Z70nBYWG.js +113 -0
  142. package/dist/m0-swap-component/index-Z70nBYWG.js.map +1 -0
  143. package/dist/m0-swap-component/index-iNFotRMa.js +73 -0
  144. package/dist/m0-swap-component/index-iNFotRMa.js.map +1 -0
  145. package/dist/m0-swap-component/index-n1fooC-v.js +37757 -0
  146. package/dist/m0-swap-component/index-n1fooC-v.js.map +1 -0
  147. package/dist/m0-swap-component/index.esm.js +2 -0
  148. package/dist/m0-swap-component/index.esm.js.map +1 -0
  149. package/dist/m0-swap-component/loader.esm.js.map +1 -0
  150. package/dist/m0-swap-component/m0-swap-component.esm.js +48 -0
  151. package/dist/m0-swap-component/m0-swap-component.esm.js.map +1 -0
  152. package/dist/m0-swap-component/native-CPtqJIn7.js +18 -0
  153. package/dist/m0-swap-component/native-CPtqJIn7.js.map +1 -0
  154. package/dist/m0-swap-component/onramp-BppY2eDR.js +1003 -0
  155. package/dist/m0-swap-component/onramp-BppY2eDR.js.map +1 -0
  156. package/dist/m0-swap-component/pay-with-exchange-BJYQgTMB.js +639 -0
  157. package/dist/m0-swap-component/pay-with-exchange-BJYQgTMB.js.map +1 -0
  158. package/dist/m0-swap-component/property-BN-VaT99.js +625 -0
  159. package/dist/m0-swap-component/property-BN-VaT99.js.map +1 -0
  160. package/dist/m0-swap-component/receive-BptRM_5_.js +281 -0
  161. package/dist/m0-swap-component/receive-BptRM_5_.js.map +1 -0
  162. package/dist/m0-swap-component/ref-3xALOvo5.js +25 -0
  163. package/dist/m0-swap-component/ref-3xALOvo5.js.map +1 -0
  164. package/dist/m0-swap-component/send-BCyHM4Zr.js +1408 -0
  165. package/dist/m0-swap-component/send-BCyHM4Zr.js.map +1 -0
  166. package/dist/m0-swap-component/socials-BbajCSWV.js +824 -0
  167. package/dist/m0-swap-component/socials-BbajCSWV.js.map +1 -0
  168. package/dist/m0-swap-component/swap-module-5ZLM-vAV.js +140887 -0
  169. package/dist/m0-swap-component/swap-module-5ZLM-vAV.js.map +1 -0
  170. package/dist/m0-swap-component/swap-module.entry.esm.js.map +1 -0
  171. package/dist/m0-swap-component/swap-module.entry.js +15 -0
  172. package/dist/m0-swap-component/swaps-DyGe65DR.js +2121 -0
  173. package/dist/m0-swap-component/swaps-DyGe65DR.js.map +1 -0
  174. package/dist/m0-swap-component/transactions-BZ9l4zt5.js +60 -0
  175. package/dist/m0-swap-component/transactions-BZ9l4zt5.js.map +1 -0
  176. package/dist/m0-swap-component/utils-RCeZbvdb.js +95 -0
  177. package/dist/m0-swap-component/utils-RCeZbvdb.js.map +1 -0
  178. package/dist/m0-swap-component/w3m-modal-D0HWVPsj.js +2097 -0
  179. package/dist/m0-swap-component/w3m-modal-D0HWVPsj.js.map +1 -0
  180. package/dist/m0-swap-component/wui-button-BeTWD3Va.js +223 -0
  181. package/dist/m0-swap-component/wui-button-BeTWD3Va.js.map +1 -0
  182. package/dist/m0-swap-component/wui-email-input-CgnfUH0c.js +65 -0
  183. package/dist/m0-swap-component/wui-email-input-CgnfUH0c.js.map +1 -0
  184. package/dist/m0-swap-component/wui-icon-B0uTDhW-.js +4 -0
  185. package/dist/m0-swap-component/wui-icon-B0uTDhW-.js.map +1 -0
  186. package/dist/m0-swap-component/wui-icon-box-s87lODBB.js +4 -0
  187. package/dist/m0-swap-component/wui-icon-box-s87lODBB.js.map +1 -0
  188. package/dist/m0-swap-component/wui-icon-link-BFpV9kPE.js +127 -0
  189. package/dist/m0-swap-component/wui-icon-link-BFpV9kPE.js.map +1 -0
  190. package/dist/m0-swap-component/wui-image-BvjxoR51.js +4 -0
  191. package/dist/m0-swap-component/wui-image-BvjxoR51.js.map +1 -0
  192. package/dist/m0-swap-component/wui-input-amount-CWQfP3RO.js +182 -0
  193. package/dist/m0-swap-component/wui-input-amount-CWQfP3RO.js.map +1 -0
  194. package/dist/m0-swap-component/wui-input-text-g0sN4B2y.js +4 -0
  195. package/dist/m0-swap-component/wui-input-text-g0sN4B2y.js.map +1 -0
  196. package/dist/m0-swap-component/wui-link-VqM3wLny.js +123 -0
  197. package/dist/m0-swap-component/wui-link-VqM3wLny.js.map +1 -0
  198. package/dist/m0-swap-component/wui-list-item-BIijofqN.js +170 -0
  199. package/dist/m0-swap-component/wui-list-item-BIijofqN.js.map +1 -0
  200. package/dist/m0-swap-component/wui-list-social-C7GhkRc8.js +119 -0
  201. package/dist/m0-swap-component/wui-list-social-C7GhkRc8.js.map +1 -0
  202. package/dist/m0-swap-component/wui-list-token-C94lmAbT.js +134 -0
  203. package/dist/m0-swap-component/wui-list-token-C94lmAbT.js.map +1 -0
  204. package/dist/m0-swap-component/wui-list-wallet-C7fnQvCW.js +622 -0
  205. package/dist/m0-swap-component/wui-list-wallet-C7fnQvCW.js.map +1 -0
  206. package/dist/m0-swap-component/wui-loading-spinner-CW2_5SKA.js +4 -0
  207. package/dist/m0-swap-component/wui-loading-spinner-CW2_5SKA.js.map +1 -0
  208. package/dist/m0-swap-component/wui-loading-thumbnail-y3sGkT5j.js +337 -0
  209. package/dist/m0-swap-component/wui-loading-thumbnail-y3sGkT5j.js.map +1 -0
  210. package/dist/m0-swap-component/wui-qr-code-DekJTDGf.js +3412 -0
  211. package/dist/m0-swap-component/wui-qr-code-DekJTDGf.js.map +1 -0
  212. package/dist/m0-swap-component/wui-separator-DMZIL_Av.js +67 -0
  213. package/dist/m0-swap-component/wui-separator-DMZIL_Av.js.map +1 -0
  214. package/dist/m0-swap-component/wui-shimmer-CVFC8fMx.js +4 -0
  215. package/dist/m0-swap-component/wui-shimmer-CVFC8fMx.js.map +1 -0
  216. package/dist/m0-swap-component/wui-text-BS_lZKY4.js +1127 -0
  217. package/dist/m0-swap-component/wui-text-BS_lZKY4.js.map +1 -0
  218. package/dist/m0-swap-component/wui-token-button-CsOFoNJG.js +214 -0
  219. package/dist/m0-swap-component/wui-token-button-CsOFoNJG.js.map +1 -0
  220. package/dist/m0-swap-component/wui-visual-hU2Mkyrv.js +565 -0
  221. package/dist/m0-swap-component/wui-visual-hU2Mkyrv.js.map +1 -0
  222. package/dist/m0-swap-component/wui-wallet-switch-CWbdtfbN.js +459 -0
  223. package/dist/m0-swap-component/wui-wallet-switch-CWbdtfbN.js.map +1 -0
  224. package/dist/types/components/swap-module/balances.d.ts +16 -0
  225. package/dist/types/components/swap-module/chains.d.ts +16 -0
  226. package/dist/types/components/swap-module/store.d.ts +34 -0
  227. package/dist/types/components/swap-module/swap-module.d.ts +113 -0
  228. package/dist/types/components/swap-module/utils/constants.d.ts +7 -0
  229. package/dist/types/components/swap-module/utils/formatters.d.ts +23 -0
  230. package/dist/types/components/swap-module/utils/reown.d.ts +59 -0
  231. package/dist/types/components/swap-module/utils/wallet.d.ts +83 -0
  232. package/dist/types/components.d.ts +165 -0
  233. package/dist/types/index.d.ts +1 -0
  234. package/dist/types/stencil-public-runtime.d.ts +1732 -0
  235. package/loader/cdn.js +1 -0
  236. package/loader/index.cjs.js +1 -0
  237. package/loader/index.d.ts +24 -0
  238. package/loader/index.es2017.js +1 -0
  239. package/loader/index.js +2 -0
  240. package/package.json +60 -0
@@ -0,0 +1,824 @@
1
+ import { d as css, a as i, C as ConnectorController, O as OptionsController, A as ApiController, R as RouterController, f as ConstantsUtil, b, n as CoreHelperUtil, s as W3mFrameProvider, t as AlertController, c as customElement, u as OptionsStateController, h as ChainController, m as ConnectionController, o as EventsController, v as StorageUtil, p as SnackController, w as ErrorUtil, M as ModalController, T as ThemeController } from './swap-module-5ZLM-vAV.js';
2
+ import { n, r } from './wui-text-BS_lZKY4.js';
3
+ import { o } from './if-defined-2CMpVr2R.js';
4
+ import './wui-loading-thumbnail-y3sGkT5j.js';
5
+ import { e as executeSocialLogin } from './utils-RCeZbvdb.js';
6
+ import './wui-list-social-C7GhkRc8.js';
7
+ import './wui-icon-box-s87lODBB.js';
8
+ import { C as ConstantsUtil$1 } from './ConstantsUtil-btJ3XIXu.js';
9
+ import './wui-button-BeTWD3Va.js';
10
+ import './wui-icon-B0uTDhW-.js';
11
+ import './wui-qr-code-DekJTDGf.js';
12
+ import './wui-shimmer-CVFC8fMx.js';
13
+ import './index-DY_Ijq_4.js';
14
+ import 'buffer';
15
+ import 'ox/BlockOverrides';
16
+ import 'ox/erc8010';
17
+ import 'ox/AbiConstructor';
18
+ import 'ox/AbiFunction';
19
+ import 'ox/erc6492';
20
+ import 'events';
21
+ import 'ox';
22
+ import 'ox/tempo';
23
+ import 'ox/Hex';
24
+ import 'ox/Secp256k1';
25
+ import 'ox/Signature';
26
+ import './ref-3xALOvo5.js';
27
+ import './index-Bs-pPJYj.js';
28
+ import './index-CoMTkqee.js';
29
+ import './index-BZXyMieH.js';
30
+ import './index-iNFotRMa.js';
31
+
32
+ var styles$3 = css `
33
+ :host {
34
+ margin-top: ${({ spacing }) => spacing['1']};
35
+ }
36
+ wui-separator {
37
+ margin: ${({ spacing }) => spacing['3']} calc(${({ spacing }) => spacing['3']} * -1)
38
+ ${({ spacing }) => spacing['2']} calc(${({ spacing }) => spacing['3']} * -1);
39
+ width: calc(100% + ${({ spacing }) => spacing['3']} * 2);
40
+ }
41
+ `;
42
+
43
+ var __decorate$3 = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
44
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
45
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
46
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
47
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
48
+ };
49
+ let W3mSocialLoginList = class W3mSocialLoginList extends i {
50
+ constructor() {
51
+ super();
52
+ this.unsubscribe = [];
53
+ this.tabIdx = undefined;
54
+ this.connectors = ConnectorController.state.connectors;
55
+ this.authConnector = this.connectors.find(c => c.type === 'AUTH');
56
+ this.remoteFeatures = OptionsController.state.remoteFeatures;
57
+ this.isPwaLoading = false;
58
+ this.hasExceededUsageLimit = ApiController.state.plan.hasExceededUsageLimit;
59
+ this.unsubscribe.push(ConnectorController.subscribeKey('connectors', val => {
60
+ this.connectors = val;
61
+ this.authConnector = this.connectors.find(c => c.type === 'AUTH');
62
+ }), OptionsController.subscribeKey('remoteFeatures', val => (this.remoteFeatures = val)));
63
+ }
64
+ connectedCallback() {
65
+ super.connectedCallback();
66
+ this.handlePwaFrameLoad();
67
+ }
68
+ disconnectedCallback() {
69
+ this.unsubscribe.forEach(unsubscribe => unsubscribe());
70
+ }
71
+ render() {
72
+ let socials = this.remoteFeatures?.socials || [];
73
+ const isAuthConnectorExist = Boolean(this.authConnector);
74
+ const isSocialsEnabled = socials?.length;
75
+ const isConnectSocialsView = RouterController.state.view === 'ConnectSocials';
76
+ if ((!isAuthConnectorExist || !isSocialsEnabled) && !isConnectSocialsView) {
77
+ return null;
78
+ }
79
+ if (isConnectSocialsView && !isSocialsEnabled) {
80
+ socials = ConstantsUtil.DEFAULT_SOCIALS;
81
+ }
82
+ return b ` <wui-flex flexDirection="column" gap="2">
83
+ ${socials.map(social => b `<wui-list-social
84
+ @click=${() => {
85
+ this.onSocialClick(social);
86
+ }}
87
+ data-testid=${`social-selector-${social}`}
88
+ name=${social}
89
+ logo=${social}
90
+ ?disabled=${this.isPwaLoading}
91
+ ></wui-list-social>`)}
92
+ </wui-flex>`;
93
+ }
94
+ async onSocialClick(socialProvider) {
95
+ if (this.hasExceededUsageLimit) {
96
+ RouterController.push('UsageExceeded');
97
+ return;
98
+ }
99
+ if (socialProvider) {
100
+ await executeSocialLogin(socialProvider);
101
+ }
102
+ }
103
+ async handlePwaFrameLoad() {
104
+ if (CoreHelperUtil.isPWA()) {
105
+ this.isPwaLoading = true;
106
+ try {
107
+ if (this.authConnector?.provider instanceof W3mFrameProvider) {
108
+ await this.authConnector.provider.init();
109
+ }
110
+ }
111
+ catch (error) {
112
+ AlertController.open({
113
+ displayMessage: 'Error loading embedded wallet in PWA',
114
+ debugMessage: error.message
115
+ }, 'error');
116
+ }
117
+ finally {
118
+ this.isPwaLoading = false;
119
+ }
120
+ }
121
+ }
122
+ };
123
+ W3mSocialLoginList.styles = styles$3;
124
+ __decorate$3([
125
+ n()
126
+ ], W3mSocialLoginList.prototype, "tabIdx", void 0);
127
+ __decorate$3([
128
+ r()
129
+ ], W3mSocialLoginList.prototype, "connectors", void 0);
130
+ __decorate$3([
131
+ r()
132
+ ], W3mSocialLoginList.prototype, "authConnector", void 0);
133
+ __decorate$3([
134
+ r()
135
+ ], W3mSocialLoginList.prototype, "remoteFeatures", void 0);
136
+ __decorate$3([
137
+ r()
138
+ ], W3mSocialLoginList.prototype, "isPwaLoading", void 0);
139
+ __decorate$3([
140
+ r()
141
+ ], W3mSocialLoginList.prototype, "hasExceededUsageLimit", void 0);
142
+ W3mSocialLoginList = __decorate$3([
143
+ customElement('w3m-social-login-list')
144
+ ], W3mSocialLoginList);
145
+
146
+ var styles$2 = css `
147
+ wui-flex {
148
+ max-height: clamp(360px, 540px, 80vh);
149
+ overflow: scroll;
150
+ scrollbar-width: none;
151
+ transition: opacity ${({ durations }) => durations['md']}
152
+ ${({ easings }) => easings['ease-out-power-1']};
153
+ will-change: opacity;
154
+ }
155
+
156
+ wui-flex::-webkit-scrollbar {
157
+ display: none;
158
+ }
159
+
160
+ wui-flex.disabled {
161
+ opacity: 0.3;
162
+ pointer-events: none;
163
+ user-select: none;
164
+ }
165
+ `;
166
+
167
+ var __decorate$2 = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
168
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
169
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
170
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
171
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
172
+ };
173
+ let W3mConnectSocialsView = class W3mConnectSocialsView extends i {
174
+ constructor() {
175
+ super();
176
+ this.unsubscribe = [];
177
+ this.checked = OptionsStateController.state.isLegalCheckboxChecked;
178
+ this.unsubscribe.push(OptionsStateController.subscribeKey('isLegalCheckboxChecked', val => {
179
+ this.checked = val;
180
+ }));
181
+ }
182
+ disconnectedCallback() {
183
+ this.unsubscribe.forEach(unsubscribe => unsubscribe());
184
+ }
185
+ render() {
186
+ const { termsConditionsUrl, privacyPolicyUrl } = OptionsController.state;
187
+ const legalCheckbox = OptionsController.state.features?.legalCheckbox;
188
+ const legalUrl = termsConditionsUrl || privacyPolicyUrl;
189
+ const showLegalCheckbox = Boolean(legalUrl) && Boolean(legalCheckbox);
190
+ const disabled = showLegalCheckbox && !this.checked;
191
+ const tabIndex = disabled ? -1 : undefined;
192
+ return b `
193
+ <w3m-legal-checkbox></w3m-legal-checkbox>
194
+ <wui-flex
195
+ flexDirection="column"
196
+ .padding=${['0', '3', '3', '3']}
197
+ gap="01"
198
+ class=${o(disabled ? 'disabled' : undefined)}
199
+ >
200
+ <w3m-social-login-list tabIdx=${o(tabIndex)}></w3m-social-login-list>
201
+ </wui-flex>
202
+ `;
203
+ }
204
+ };
205
+ W3mConnectSocialsView.styles = styles$2;
206
+ __decorate$2([
207
+ r()
208
+ ], W3mConnectSocialsView.prototype, "checked", void 0);
209
+ W3mConnectSocialsView = __decorate$2([
210
+ customElement('w3m-connect-socials-view')
211
+ ], W3mConnectSocialsView);
212
+
213
+ var styles$1 = css `
214
+ wui-logo {
215
+ width: 80px;
216
+ height: 80px;
217
+ border-radius: ${({ borderRadius }) => borderRadius['8']};
218
+ }
219
+ @keyframes shake {
220
+ 0% {
221
+ transform: translateX(0);
222
+ }
223
+ 25% {
224
+ transform: translateX(3px);
225
+ }
226
+ 50% {
227
+ transform: translateX(-3px);
228
+ }
229
+ 75% {
230
+ transform: translateX(3px);
231
+ }
232
+ 100% {
233
+ transform: translateX(0);
234
+ }
235
+ }
236
+ wui-flex:first-child:not(:only-child) {
237
+ position: relative;
238
+ }
239
+ wui-loading-thumbnail {
240
+ position: absolute;
241
+ }
242
+ wui-icon-box {
243
+ position: absolute;
244
+ right: calc(${({ spacing }) => spacing['1']} * -1);
245
+ bottom: calc(${({ spacing }) => spacing['1']} * -1);
246
+ opacity: 0;
247
+ transform: scale(0.5);
248
+ transition: all ${({ easings }) => easings['ease-out-power-2']}
249
+ ${({ durations }) => durations['lg']};
250
+ }
251
+ wui-text[align='center'] {
252
+ width: 100%;
253
+ padding: 0px ${({ spacing }) => spacing['4']};
254
+ }
255
+ [data-error='true'] wui-icon-box {
256
+ opacity: 1;
257
+ transform: scale(1);
258
+ }
259
+ [data-error='true'] > wui-flex:first-child {
260
+ animation: shake 250ms ${({ easings }) => easings['ease-out-power-2']} both;
261
+ }
262
+ .capitalize {
263
+ text-transform: capitalize;
264
+ }
265
+ `;
266
+
267
+ var __decorate$1 = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
268
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
269
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
270
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
271
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
272
+ };
273
+ let W3mConnectingSocialView = class W3mConnectingSocialView extends i {
274
+ constructor() {
275
+ super();
276
+ this.unsubscribe = [];
277
+ this.socialProvider = ChainController.getAccountData()?.socialProvider;
278
+ this.socialWindow = ChainController.getAccountData()?.socialWindow;
279
+ this.error = false;
280
+ this.connecting = false;
281
+ this.message = 'Connect in the provider window';
282
+ this.remoteFeatures = OptionsController.state.remoteFeatures;
283
+ this.address = ChainController.getAccountData()?.address;
284
+ this.connectionsByNamespace = ConnectionController.getConnections(ChainController.state.activeChain);
285
+ this.hasMultipleConnections = this.connectionsByNamespace.length > 0;
286
+ this.authConnector = ConnectorController.getAuthConnector();
287
+ this.handleSocialConnection = async (event) => {
288
+ if (event.data?.resultUri) {
289
+ if (event.origin === ConstantsUtil$1.SECURE_SITE_ORIGIN) {
290
+ window.removeEventListener('message', this.handleSocialConnection, false);
291
+ try {
292
+ if (this.authConnector && !this.connecting) {
293
+ this.connecting = true;
294
+ const error = this.parseURLError(event.data.resultUri);
295
+ if (error) {
296
+ this.handleSocialError(error);
297
+ return;
298
+ }
299
+ this.closeSocialWindow();
300
+ this.updateMessage();
301
+ const uri = event.data.resultUri;
302
+ if (this.socialProvider) {
303
+ EventsController.sendEvent({
304
+ type: 'track',
305
+ event: 'SOCIAL_LOGIN_REQUEST_USER_DATA',
306
+ properties: { provider: this.socialProvider }
307
+ });
308
+ }
309
+ await ConnectionController.connectExternal({
310
+ id: this.authConnector.id,
311
+ type: this.authConnector.type,
312
+ socialUri: uri
313
+ }, this.authConnector.chain);
314
+ if (this.socialProvider) {
315
+ StorageUtil.setConnectedSocialProvider(this.socialProvider);
316
+ EventsController.sendEvent({
317
+ type: 'track',
318
+ event: 'SOCIAL_LOGIN_SUCCESS',
319
+ properties: { provider: this.socialProvider }
320
+ });
321
+ }
322
+ }
323
+ }
324
+ catch (error) {
325
+ this.error = true;
326
+ this.updateMessage();
327
+ if (this.socialProvider) {
328
+ EventsController.sendEvent({
329
+ type: 'track',
330
+ event: 'SOCIAL_LOGIN_ERROR',
331
+ properties: {
332
+ provider: this.socialProvider,
333
+ message: CoreHelperUtil.parseError(error)
334
+ }
335
+ });
336
+ }
337
+ }
338
+ }
339
+ else {
340
+ RouterController.goBack();
341
+ SnackController.showError('Untrusted Origin');
342
+ if (this.socialProvider) {
343
+ EventsController.sendEvent({
344
+ type: 'track',
345
+ event: 'SOCIAL_LOGIN_ERROR',
346
+ properties: {
347
+ provider: this.socialProvider,
348
+ message: 'Untrusted Origin'
349
+ }
350
+ });
351
+ }
352
+ }
353
+ }
354
+ };
355
+ const abortController = ErrorUtil.EmbeddedWalletAbortController;
356
+ abortController.signal.addEventListener('abort', () => {
357
+ this.closeSocialWindow();
358
+ });
359
+ this.unsubscribe.push(...[
360
+ ChainController.subscribeChainProp('accountState', val => {
361
+ if (val) {
362
+ this.socialProvider = val.socialProvider;
363
+ if (val.socialWindow) {
364
+ this.socialWindow = val.socialWindow;
365
+ }
366
+ if (val.address) {
367
+ const isMultiWalletEnabled = this.remoteFeatures?.multiWallet;
368
+ if (val.address !== this.address) {
369
+ if (this.hasMultipleConnections && isMultiWalletEnabled) {
370
+ RouterController.replace('ProfileWallets');
371
+ SnackController.showSuccess('New Wallet Added');
372
+ this.address = val.address;
373
+ }
374
+ else if (ModalController.state.open || OptionsController.state.enableEmbedded) {
375
+ ModalController.close();
376
+ }
377
+ }
378
+ }
379
+ }
380
+ }),
381
+ OptionsController.subscribeKey('remoteFeatures', val => {
382
+ this.remoteFeatures = val;
383
+ })
384
+ ]);
385
+ if (this.authConnector) {
386
+ this.connectSocial();
387
+ }
388
+ }
389
+ disconnectedCallback() {
390
+ this.unsubscribe.forEach(unsubscribe => unsubscribe());
391
+ window.removeEventListener('message', this.handleSocialConnection, false);
392
+ const isConnected = ChainController.state.activeCaipAddress;
393
+ if (!isConnected && this.socialProvider && !this.connecting) {
394
+ EventsController.sendEvent({
395
+ type: 'track',
396
+ event: 'SOCIAL_LOGIN_CANCELED',
397
+ properties: { provider: this.socialProvider }
398
+ });
399
+ }
400
+ this.closeSocialWindow();
401
+ }
402
+ render() {
403
+ return b `
404
+ <wui-flex
405
+ data-error=${o(this.error)}
406
+ flexDirection="column"
407
+ alignItems="center"
408
+ .padding=${['10', '5', '5', '5']}
409
+ gap="6"
410
+ >
411
+ <wui-flex justifyContent="center" alignItems="center">
412
+ <wui-logo logo=${o(this.socialProvider)}></wui-logo>
413
+ ${this.error ? null : this.loaderTemplate()}
414
+ <wui-icon-box color="error" icon="close" size="sm"></wui-icon-box>
415
+ </wui-flex>
416
+ <wui-flex flexDirection="column" alignItems="center" gap="2">
417
+ <wui-text align="center" variant="lg-medium" color="primary"
418
+ >Log in with
419
+ <span class="capitalize">${this.socialProvider ?? 'Social'}</span></wui-text
420
+ >
421
+ <wui-text align="center" variant="lg-regular" color=${this.error ? 'error' : 'secondary'}
422
+ >${this.message}</wui-text
423
+ ></wui-flex
424
+ >
425
+ </wui-flex>
426
+ `;
427
+ }
428
+ loaderTemplate() {
429
+ const borderRadiusMaster = ThemeController.state.themeVariables['--w3m-border-radius-master'];
430
+ const radius = borderRadiusMaster ? parseInt(borderRadiusMaster.replace('px', ''), 10) : 4;
431
+ return b `<wui-loading-thumbnail radius=${radius * 9}></wui-loading-thumbnail>`;
432
+ }
433
+ parseURLError(uri) {
434
+ try {
435
+ const errorKey = 'error=';
436
+ const errorIndex = uri.indexOf(errorKey);
437
+ if (errorIndex === -1) {
438
+ return null;
439
+ }
440
+ const error = uri.substring(errorIndex + errorKey.length);
441
+ return error;
442
+ }
443
+ catch {
444
+ return null;
445
+ }
446
+ }
447
+ connectSocial() {
448
+ const interval = setInterval(() => {
449
+ if (this.socialWindow?.closed) {
450
+ if (!this.connecting && RouterController.state.view === 'ConnectingSocial') {
451
+ RouterController.goBack();
452
+ }
453
+ clearInterval(interval);
454
+ }
455
+ }, 1000);
456
+ window.addEventListener('message', this.handleSocialConnection, false);
457
+ }
458
+ updateMessage() {
459
+ if (this.error) {
460
+ this.message = 'Something went wrong';
461
+ }
462
+ else if (this.connecting) {
463
+ this.message = 'Retrieving user data';
464
+ }
465
+ else {
466
+ this.message = 'Connect in the provider window';
467
+ }
468
+ }
469
+ handleSocialError(error) {
470
+ this.error = true;
471
+ this.updateMessage();
472
+ if (this.socialProvider) {
473
+ EventsController.sendEvent({
474
+ type: 'track',
475
+ event: 'SOCIAL_LOGIN_ERROR',
476
+ properties: { provider: this.socialProvider, message: error }
477
+ });
478
+ }
479
+ this.closeSocialWindow();
480
+ }
481
+ closeSocialWindow() {
482
+ if (this.socialWindow) {
483
+ this.socialWindow.close();
484
+ ChainController.setAccountProp('socialWindow', undefined, ChainController.state.activeChain);
485
+ }
486
+ }
487
+ };
488
+ W3mConnectingSocialView.styles = styles$1;
489
+ __decorate$1([
490
+ r()
491
+ ], W3mConnectingSocialView.prototype, "socialProvider", void 0);
492
+ __decorate$1([
493
+ r()
494
+ ], W3mConnectingSocialView.prototype, "socialWindow", void 0);
495
+ __decorate$1([
496
+ r()
497
+ ], W3mConnectingSocialView.prototype, "error", void 0);
498
+ __decorate$1([
499
+ r()
500
+ ], W3mConnectingSocialView.prototype, "connecting", void 0);
501
+ __decorate$1([
502
+ r()
503
+ ], W3mConnectingSocialView.prototype, "message", void 0);
504
+ __decorate$1([
505
+ r()
506
+ ], W3mConnectingSocialView.prototype, "remoteFeatures", void 0);
507
+ W3mConnectingSocialView = __decorate$1([
508
+ customElement('w3m-connecting-social-view')
509
+ ], W3mConnectingSocialView);
510
+
511
+ var styles = css `
512
+ wui-shimmer {
513
+ width: 100%;
514
+ aspect-ratio: 1 / 1;
515
+ border-radius: ${({ borderRadius }) => borderRadius[4]};
516
+ }
517
+
518
+ wui-qr-code {
519
+ opacity: 0;
520
+ animation-duration: ${({ durations }) => durations['xl']};
521
+ animation-timing-function: ${({ easings }) => easings['ease-out-power-2']};
522
+ animation-name: fade-in;
523
+ animation-fill-mode: forwards;
524
+ }
525
+
526
+ wui-logo {
527
+ width: 80px;
528
+ height: 80px;
529
+ border-radius: ${({ borderRadius }) => borderRadius['8']};
530
+ }
531
+
532
+ wui-flex:first-child:not(:only-child) {
533
+ position: relative;
534
+ }
535
+
536
+ wui-loading-thumbnail {
537
+ position: absolute;
538
+ }
539
+
540
+ wui-icon-box {
541
+ position: absolute;
542
+ right: calc(${({ spacing }) => spacing['1']} * -1);
543
+ bottom: calc(${({ spacing }) => spacing['1']} * -1);
544
+ opacity: 0;
545
+ transform: scale(0.5);
546
+ transition:
547
+ opacity ${({ durations }) => durations['lg']} ${({ easings }) => easings['ease-out-power-2']},
548
+ transform ${({ durations }) => durations['lg']}
549
+ ${({ easings }) => easings['ease-out-power-2']};
550
+ will-change: opacity, transform;
551
+ }
552
+
553
+ @keyframes fade-in {
554
+ from {
555
+ opacity: 0;
556
+ }
557
+ to {
558
+ opacity: 1;
559
+ }
560
+ }
561
+ `;
562
+
563
+ var __decorate = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
564
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
565
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
566
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
567
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
568
+ };
569
+ let W3mConnectingFarcasterView = class W3mConnectingFarcasterView extends i {
570
+ constructor() {
571
+ super();
572
+ this.unsubscribe = [];
573
+ this.timeout = undefined;
574
+ this.socialProvider = ChainController.getAccountData()?.socialProvider;
575
+ this.uri = ChainController.getAccountData()?.farcasterUrl;
576
+ this.ready = false;
577
+ this.loading = false;
578
+ this.remoteFeatures = OptionsController.state.remoteFeatures;
579
+ this.authConnector = ConnectorController.getAuthConnector();
580
+ this.forceUpdate = () => {
581
+ this.requestUpdate();
582
+ };
583
+ this.unsubscribe.push(...[
584
+ ChainController.subscribeChainProp('accountState', val => {
585
+ this.socialProvider = val?.socialProvider;
586
+ this.uri = val?.farcasterUrl;
587
+ this.connectFarcaster();
588
+ }),
589
+ OptionsController.subscribeKey('remoteFeatures', val => {
590
+ this.remoteFeatures = val;
591
+ })
592
+ ]);
593
+ window.addEventListener('resize', this.forceUpdate);
594
+ }
595
+ disconnectedCallback() {
596
+ super.disconnectedCallback();
597
+ clearTimeout(this.timeout);
598
+ window.removeEventListener('resize', this.forceUpdate);
599
+ const isConnected = ChainController.state.activeCaipAddress;
600
+ if (!isConnected && this.socialProvider && (this.uri || this.loading)) {
601
+ EventsController.sendEvent({
602
+ type: 'track',
603
+ event: 'SOCIAL_LOGIN_CANCELED',
604
+ properties: { provider: this.socialProvider }
605
+ });
606
+ }
607
+ }
608
+ render() {
609
+ this.onRenderProxy();
610
+ return b `${this.platformTemplate()}`;
611
+ }
612
+ platformTemplate() {
613
+ if (CoreHelperUtil.isMobile()) {
614
+ return b `${this.mobileTemplate()}`;
615
+ }
616
+ return b `${this.desktopTemplate()}`;
617
+ }
618
+ desktopTemplate() {
619
+ if (this.loading) {
620
+ return b `${this.loadingTemplate()}`;
621
+ }
622
+ return b `${this.qrTemplate()}`;
623
+ }
624
+ qrTemplate() {
625
+ return b ` <wui-flex
626
+ flexDirection="column"
627
+ alignItems="center"
628
+ .padding=${['0', '5', '5', '5']}
629
+ gap="5"
630
+ >
631
+ <wui-shimmer width="100%"> ${this.qrCodeTemplate()} </wui-shimmer>
632
+
633
+ <wui-text variant="lg-medium" color="primary"> Scan this QR Code with your phone </wui-text>
634
+ ${this.copyTemplate()}
635
+ </wui-flex>`;
636
+ }
637
+ loadingTemplate() {
638
+ return b `
639
+ <wui-flex
640
+ flexDirection="column"
641
+ alignItems="center"
642
+ .padding=${['5', '5', '5', '5']}
643
+ gap="5"
644
+ >
645
+ <wui-flex justifyContent="center" alignItems="center">
646
+ <wui-logo logo="farcaster"></wui-logo>
647
+ ${this.loaderTemplate()}
648
+ <wui-icon-box color="error" icon="close" size="sm"></wui-icon-box>
649
+ </wui-flex>
650
+ <wui-flex flexDirection="column" alignItems="center" gap="2">
651
+ <wui-text align="center" variant="md-medium" color="primary">
652
+ Loading user data
653
+ </wui-text>
654
+ <wui-text align="center" variant="sm-regular" color="secondary">
655
+ Please wait a moment while we load your data.
656
+ </wui-text>
657
+ </wui-flex>
658
+ </wui-flex>
659
+ `;
660
+ }
661
+ mobileTemplate() {
662
+ return b ` <wui-flex
663
+ flexDirection="column"
664
+ alignItems="center"
665
+ .padding=${['10', '5', '5', '5']}
666
+ gap="5"
667
+ >
668
+ <wui-flex justifyContent="center" alignItems="center">
669
+ <wui-logo logo="farcaster"></wui-logo>
670
+ ${this.loaderTemplate()}
671
+ <wui-icon-box
672
+ color="error"
673
+ icon="close"
674
+ size="sm"
675
+ ></wui-icon-box>
676
+ </wui-flex>
677
+ <wui-flex flexDirection="column" alignItems="center" gap="2">
678
+ <wui-text align="center" variant="md-medium" color="primary"
679
+ >Continue in Farcaster</span></wui-text
680
+ >
681
+ <wui-text align="center" variant="sm-regular" color="secondary"
682
+ >Accept connection request in the app</wui-text
683
+ ></wui-flex
684
+ >
685
+ ${this.mobileLinkTemplate()}
686
+ </wui-flex>`;
687
+ }
688
+ loaderTemplate() {
689
+ const borderRadiusMaster = ThemeController.state.themeVariables['--w3m-border-radius-master'];
690
+ const radius = borderRadiusMaster ? parseInt(borderRadiusMaster.replace('px', ''), 10) : 4;
691
+ return b `<wui-loading-thumbnail radius=${radius * 9}></wui-loading-thumbnail>`;
692
+ }
693
+ async connectFarcaster() {
694
+ if (this.authConnector) {
695
+ try {
696
+ await this.authConnector?.provider.connectFarcaster();
697
+ if (this.socialProvider) {
698
+ StorageUtil.setConnectedSocialProvider(this.socialProvider);
699
+ EventsController.sendEvent({
700
+ type: 'track',
701
+ event: 'SOCIAL_LOGIN_REQUEST_USER_DATA',
702
+ properties: { provider: this.socialProvider }
703
+ });
704
+ }
705
+ this.loading = true;
706
+ const connectionsByNamespace = ConnectionController.getConnections(this.authConnector.chain);
707
+ const hasConnections = connectionsByNamespace.length > 0;
708
+ await ConnectionController.connectExternal(this.authConnector, this.authConnector.chain);
709
+ const isMultiWalletEnabled = this.remoteFeatures?.multiWallet;
710
+ if (this.socialProvider) {
711
+ EventsController.sendEvent({
712
+ type: 'track',
713
+ event: 'SOCIAL_LOGIN_SUCCESS',
714
+ properties: { provider: this.socialProvider }
715
+ });
716
+ }
717
+ this.loading = false;
718
+ if (hasConnections && isMultiWalletEnabled) {
719
+ RouterController.replace('ProfileWallets');
720
+ SnackController.showSuccess('New Wallet Added');
721
+ }
722
+ else {
723
+ ModalController.close();
724
+ }
725
+ }
726
+ catch (error) {
727
+ if (this.socialProvider) {
728
+ EventsController.sendEvent({
729
+ type: 'track',
730
+ event: 'SOCIAL_LOGIN_ERROR',
731
+ properties: { provider: this.socialProvider, message: CoreHelperUtil.parseError(error) }
732
+ });
733
+ }
734
+ RouterController.goBack();
735
+ SnackController.showError(error);
736
+ }
737
+ }
738
+ }
739
+ mobileLinkTemplate() {
740
+ return b `<wui-button
741
+ size="md"
742
+ ?loading=${this.loading}
743
+ ?disabled=${!this.uri || this.loading}
744
+ @click=${() => {
745
+ if (this.uri) {
746
+ CoreHelperUtil.openHref(this.uri, '_blank');
747
+ }
748
+ }}
749
+ >
750
+ Open farcaster</wui-button
751
+ >`;
752
+ }
753
+ onRenderProxy() {
754
+ if (!this.ready && this.uri) {
755
+ this.timeout = setTimeout(() => {
756
+ this.ready = true;
757
+ }, 200);
758
+ }
759
+ }
760
+ qrCodeTemplate() {
761
+ if (!this.uri || !this.ready) {
762
+ return null;
763
+ }
764
+ const size = this.getBoundingClientRect().width - 40;
765
+ const qrColor = ThemeController.state.themeVariables['--apkt-qr-color'] ??
766
+ ThemeController.state.themeVariables['--w3m-qr-color'];
767
+ return b ` <wui-qr-code
768
+ size=${size}
769
+ theme=${ThemeController.state.themeMode}
770
+ uri=${this.uri}
771
+ ?farcaster=${true}
772
+ data-testid="wui-qr-code"
773
+ color=${o(qrColor)}
774
+ ></wui-qr-code>`;
775
+ }
776
+ copyTemplate() {
777
+ const inactive = !this.uri || !this.ready;
778
+ return b `<wui-button
779
+ .disabled=${inactive}
780
+ @click=${this.onCopyUri}
781
+ variant="neutral-secondary"
782
+ size="sm"
783
+ data-testid="copy-wc2-uri"
784
+ >
785
+ <wui-icon size="sm" color="default" slot="iconRight" name="copy"></wui-icon>
786
+ Copy link
787
+ </wui-button>`;
788
+ }
789
+ onCopyUri() {
790
+ try {
791
+ if (this.uri) {
792
+ CoreHelperUtil.copyToClopboard(this.uri);
793
+ SnackController.showSuccess('Link copied');
794
+ }
795
+ }
796
+ catch {
797
+ SnackController.showError('Failed to copy');
798
+ }
799
+ }
800
+ };
801
+ W3mConnectingFarcasterView.styles = styles;
802
+ __decorate([
803
+ r()
804
+ ], W3mConnectingFarcasterView.prototype, "socialProvider", void 0);
805
+ __decorate([
806
+ r()
807
+ ], W3mConnectingFarcasterView.prototype, "uri", void 0);
808
+ __decorate([
809
+ r()
810
+ ], W3mConnectingFarcasterView.prototype, "ready", void 0);
811
+ __decorate([
812
+ r()
813
+ ], W3mConnectingFarcasterView.prototype, "loading", void 0);
814
+ __decorate([
815
+ r()
816
+ ], W3mConnectingFarcasterView.prototype, "remoteFeatures", void 0);
817
+ W3mConnectingFarcasterView = __decorate([
818
+ customElement('w3m-connecting-farcaster-view')
819
+ ], W3mConnectingFarcasterView);
820
+
821
+ export { W3mConnectSocialsView, W3mConnectingFarcasterView, W3mConnectingSocialView };
822
+ //# sourceMappingURL=socials-BbajCSWV.js.map
823
+
824
+ //# sourceMappingURL=socials-BbajCSWV.js.map