@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.
- package/dist/m0-swap-component/ConstantsUtil-btJ3XIXu.js +28 -0
- package/dist/m0-swap-component/ConstantsUtil-btJ3XIXu.js.map +1 -0
- package/dist/m0-swap-component/HelpersUtil-5wkO4kIW.js +142 -0
- package/dist/m0-swap-component/HelpersUtil-5wkO4kIW.js.map +1 -0
- package/dist/m0-swap-component/PhArrowCircleDown-BiDIiYXi.js +76 -0
- package/dist/m0-swap-component/PhArrowCircleDown-BiDIiYXi.js.map +1 -0
- package/dist/m0-swap-component/PhArrowClockwise-BRnlxNUR.js +76 -0
- package/dist/m0-swap-component/PhArrowClockwise-BRnlxNUR.js.map +1 -0
- package/dist/m0-swap-component/PhArrowDown-Co2hyXIs.js +76 -0
- package/dist/m0-swap-component/PhArrowDown-Co2hyXIs.js.map +1 -0
- package/dist/m0-swap-component/PhArrowLeft-Cb8ijwK6.js +76 -0
- package/dist/m0-swap-component/PhArrowLeft-Cb8ijwK6.js.map +1 -0
- package/dist/m0-swap-component/PhArrowRight-B9t--Gmh.js +76 -0
- package/dist/m0-swap-component/PhArrowRight-B9t--Gmh.js.map +1 -0
- package/dist/m0-swap-component/PhArrowSquareOut-eGBMEr5T.js +76 -0
- package/dist/m0-swap-component/PhArrowSquareOut-eGBMEr5T.js.map +1 -0
- package/dist/m0-swap-component/PhArrowUp-CjSpT-xh.js +76 -0
- package/dist/m0-swap-component/PhArrowUp-CjSpT-xh.js.map +1 -0
- package/dist/m0-swap-component/PhArrowUpRight-B8u6wk-A.js +76 -0
- package/dist/m0-swap-component/PhArrowUpRight-B8u6wk-A.js.map +1 -0
- package/dist/m0-swap-component/PhArrowsClockwise-CBcfV6j6.js +76 -0
- package/dist/m0-swap-component/PhArrowsClockwise-CBcfV6j6.js.map +1 -0
- package/dist/m0-swap-component/PhArrowsDownUp-CMVR84b1.js +76 -0
- package/dist/m0-swap-component/PhArrowsDownUp-CMVR84b1.js.map +1 -0
- package/dist/m0-swap-component/PhArrowsLeftRight-CmXk8rs2.js +76 -0
- package/dist/m0-swap-component/PhArrowsLeftRight-CmXk8rs2.js.map +1 -0
- package/dist/m0-swap-component/PhBank-BigtjnS8.js +76 -0
- package/dist/m0-swap-component/PhBank-BigtjnS8.js.map +1 -0
- package/dist/m0-swap-component/PhBrowser-BOulLD8D.js +76 -0
- package/dist/m0-swap-component/PhBrowser-BOulLD8D.js.map +1 -0
- package/dist/m0-swap-component/PhCaretDown-BvvZ65ad.js +76 -0
- package/dist/m0-swap-component/PhCaretDown-BvvZ65ad.js.map +1 -0
- package/dist/m0-swap-component/PhCaretLeft-DtwjZbZ7.js +76 -0
- package/dist/m0-swap-component/PhCaretLeft-DtwjZbZ7.js.map +1 -0
- package/dist/m0-swap-component/PhCaretRight-C8LuSZkO.js +76 -0
- package/dist/m0-swap-component/PhCaretRight-C8LuSZkO.js.map +1 -0
- package/dist/m0-swap-component/PhCaretUp-B2lAObip.js +76 -0
- package/dist/m0-swap-component/PhCaretUp-B2lAObip.js.map +1 -0
- package/dist/m0-swap-component/PhCheck-DQtuVrQf.js +76 -0
- package/dist/m0-swap-component/PhCheck-DQtuVrQf.js.map +1 -0
- package/dist/m0-swap-component/PhCircleHalf-CXfZ0QZv.js +76 -0
- package/dist/m0-swap-component/PhCircleHalf-CXfZ0QZv.js.map +1 -0
- package/dist/m0-swap-component/PhClock-CXsmuc_a.js +76 -0
- package/dist/m0-swap-component/PhClock-CXsmuc_a.js.map +1 -0
- package/dist/m0-swap-component/PhCompass-Cg-qnMon.js +76 -0
- package/dist/m0-swap-component/PhCompass-Cg-qnMon.js.map +1 -0
- package/dist/m0-swap-component/PhCopy-kGRKcvb4.js +76 -0
- package/dist/m0-swap-component/PhCopy-kGRKcvb4.js.map +1 -0
- package/dist/m0-swap-component/PhCreditCard-jYFausLO.js +76 -0
- package/dist/m0-swap-component/PhCreditCard-jYFausLO.js.map +1 -0
- package/dist/m0-swap-component/PhCurrencyDollar-C8vSY3fy.js +76 -0
- package/dist/m0-swap-component/PhCurrencyDollar-C8vSY3fy.js.map +1 -0
- package/dist/m0-swap-component/PhDesktop-AczlBCho.js +76 -0
- package/dist/m0-swap-component/PhDesktop-AczlBCho.js.map +1 -0
- package/dist/m0-swap-component/PhDeviceMobile-3rFbdWLA.js +76 -0
- package/dist/m0-swap-component/PhDeviceMobile-3rFbdWLA.js.map +1 -0
- package/dist/m0-swap-component/PhDotsThree-cJsXXsvY.js +76 -0
- package/dist/m0-swap-component/PhDotsThree-cJsXXsvY.js.map +1 -0
- package/dist/m0-swap-component/PhEnvelope-C1bxHVXw.js +76 -0
- package/dist/m0-swap-component/PhEnvelope-C1bxHVXw.js.map +1 -0
- package/dist/m0-swap-component/PhFunnelSimple-DhqB9fsu.js +76 -0
- package/dist/m0-swap-component/PhFunnelSimple-DhqB9fsu.js.map +1 -0
- package/dist/m0-swap-component/PhGlobe-BFp6kx95.js +76 -0
- package/dist/m0-swap-component/PhGlobe-BFp6kx95.js.map +1 -0
- package/dist/m0-swap-component/PhIdentificationCard-BdYxckWB.js +76 -0
- package/dist/m0-swap-component/PhIdentificationCard-BdYxckWB.js.map +1 -0
- package/dist/m0-swap-component/PhImage-CXxX5oq3.js +76 -0
- package/dist/m0-swap-component/PhImage-CXxX5oq3.js.map +1 -0
- package/dist/m0-swap-component/PhInfo-BcuP36hY.js +76 -0
- package/dist/m0-swap-component/PhInfo-BcuP36hY.js.map +1 -0
- package/dist/m0-swap-component/PhLightbulb-DkWwRl94.js +76 -0
- package/dist/m0-swap-component/PhLightbulb-DkWwRl94.js.map +1 -0
- package/dist/m0-swap-component/PhMagnifyingGlass-B_fFjslY.js +76 -0
- package/dist/m0-swap-component/PhMagnifyingGlass-B_fFjslY.js.map +1 -0
- package/dist/m0-swap-component/PhPaperPlaneRight-BIzGG3QW.js +76 -0
- package/dist/m0-swap-component/PhPaperPlaneRight-BIzGG3QW.js.map +1 -0
- package/dist/m0-swap-component/PhPlus-BGosT2zu.js +76 -0
- package/dist/m0-swap-component/PhPlus-BGosT2zu.js.map +1 -0
- package/dist/m0-swap-component/PhPower-BMqDnP1n.js +76 -0
- package/dist/m0-swap-component/PhPower-BMqDnP1n.js.map +1 -0
- package/dist/m0-swap-component/PhPuzzlePiece-DNMpiJNU.js +76 -0
- package/dist/m0-swap-component/PhPuzzlePiece-DNMpiJNU.js.map +1 -0
- package/dist/m0-swap-component/PhQrCode-DrHkqrU4.js +76 -0
- package/dist/m0-swap-component/PhQrCode-DrHkqrU4.js.map +1 -0
- package/dist/m0-swap-component/PhQuestion-zTfvwqNz.js +76 -0
- package/dist/m0-swap-component/PhQuestion-zTfvwqNz.js.map +1 -0
- package/dist/m0-swap-component/PhQuestionMark-h3Nk1Yf1.js +76 -0
- package/dist/m0-swap-component/PhQuestionMark-h3Nk1Yf1.js.map +1 -0
- package/dist/m0-swap-component/PhSealCheck-DPPqSt6G.js +76 -0
- package/dist/m0-swap-component/PhSealCheck-DPPqSt6G.js.map +1 -0
- package/dist/m0-swap-component/PhSignOut-CJgnrE_v.js +76 -0
- package/dist/m0-swap-component/PhSignOut-CJgnrE_v.js.map +1 -0
- package/dist/m0-swap-component/PhSpinner-CMTEIWbw.js +76 -0
- package/dist/m0-swap-component/PhSpinner-CMTEIWbw.js.map +1 -0
- package/dist/m0-swap-component/PhTrash-CeDVW4am.js +76 -0
- package/dist/m0-swap-component/PhTrash-CeDVW4am.js.map +1 -0
- package/dist/m0-swap-component/PhUser-lQ9WUtAV.js +76 -0
- package/dist/m0-swap-component/PhUser-lQ9WUtAV.js.map +1 -0
- package/dist/m0-swap-component/PhVault-EnLnS_IQ.js +76 -0
- package/dist/m0-swap-component/PhVault-EnLnS_IQ.js.map +1 -0
- package/dist/m0-swap-component/PhWallet-CUeDZydd.js +76 -0
- package/dist/m0-swap-component/PhWallet-CUeDZydd.js.map +1 -0
- package/dist/m0-swap-component/PhWarning-CokeGZs2.js +76 -0
- package/dist/m0-swap-component/PhWarning-CokeGZs2.js.map +1 -0
- package/dist/m0-swap-component/PhWarningCircle-vWtA7S0R.js +76 -0
- package/dist/m0-swap-component/PhWarningCircle-vWtA7S0R.js.map +1 -0
- package/dist/m0-swap-component/PhX-DwCRIvoc.js +76 -0
- package/dist/m0-swap-component/PhX-DwCRIvoc.js.map +1 -0
- package/dist/m0-swap-component/data-capture-BmovBbKV.js +573 -0
- package/dist/m0-swap-component/data-capture-BmovBbKV.js.map +1 -0
- package/dist/m0-swap-component/email-B4niz3Ms.js +445 -0
- package/dist/m0-swap-component/email-B4niz3Ms.js.map +1 -0
- package/dist/m0-swap-component/embedded-wallet-D6bzjX_K.js +988 -0
- package/dist/m0-swap-component/embedded-wallet-D6bzjX_K.js.map +1 -0
- package/dist/m0-swap-component/features-EhJNVE-M.js +355 -0
- package/dist/m0-swap-component/features-EhJNVE-M.js.map +1 -0
- package/dist/m0-swap-component/if-defined-2CMpVr2R.js +12 -0
- package/dist/m0-swap-component/if-defined-2CMpVr2R.js.map +1 -0
- package/dist/m0-swap-component/index-B4xuj7uR.js +965 -0
- package/dist/m0-swap-component/index-B4xuj7uR.js.map +1 -0
- package/dist/m0-swap-component/index-BVZ66GYf.js +206 -0
- package/dist/m0-swap-component/index-BVZ66GYf.js.map +1 -0
- package/dist/m0-swap-component/index-BZXyMieH.js +150 -0
- package/dist/m0-swap-component/index-BZXyMieH.js.map +1 -0
- package/dist/m0-swap-component/index-Bj5sA_Ri.js +252 -0
- package/dist/m0-swap-component/index-Bj5sA_Ri.js.map +1 -0
- package/dist/m0-swap-component/index-Bs-pPJYj.js +129 -0
- package/dist/m0-swap-component/index-Bs-pPJYj.js.map +1 -0
- package/dist/m0-swap-component/index-CMS76VPf.js +474 -0
- package/dist/m0-swap-component/index-CMS76VPf.js.map +1 -0
- package/dist/m0-swap-component/index-CoMTkqee.js +95 -0
- package/dist/m0-swap-component/index-CoMTkqee.js.map +1 -0
- package/dist/m0-swap-component/index-DE0OtbL2.js +3566 -0
- package/dist/m0-swap-component/index-DE0OtbL2.js.map +1 -0
- package/dist/m0-swap-component/index-DEG-YczD.js +231 -0
- package/dist/m0-swap-component/index-DEG-YczD.js.map +1 -0
- package/dist/m0-swap-component/index-DY_Ijq_4.js +4345 -0
- package/dist/m0-swap-component/index-DY_Ijq_4.js.map +1 -0
- package/dist/m0-swap-component/index-IRpGhIhy.js +9394 -0
- package/dist/m0-swap-component/index-IRpGhIhy.js.map +1 -0
- package/dist/m0-swap-component/index-Z70nBYWG.js +113 -0
- package/dist/m0-swap-component/index-Z70nBYWG.js.map +1 -0
- package/dist/m0-swap-component/index-iNFotRMa.js +73 -0
- package/dist/m0-swap-component/index-iNFotRMa.js.map +1 -0
- package/dist/m0-swap-component/index-n1fooC-v.js +37757 -0
- package/dist/m0-swap-component/index-n1fooC-v.js.map +1 -0
- package/dist/m0-swap-component/index.esm.js +2 -0
- package/dist/m0-swap-component/index.esm.js.map +1 -0
- package/dist/m0-swap-component/loader.esm.js.map +1 -0
- package/dist/m0-swap-component/m0-swap-component.esm.js +48 -0
- package/dist/m0-swap-component/m0-swap-component.esm.js.map +1 -0
- package/dist/m0-swap-component/native-CPtqJIn7.js +18 -0
- package/dist/m0-swap-component/native-CPtqJIn7.js.map +1 -0
- package/dist/m0-swap-component/onramp-BppY2eDR.js +1003 -0
- package/dist/m0-swap-component/onramp-BppY2eDR.js.map +1 -0
- package/dist/m0-swap-component/pay-with-exchange-BJYQgTMB.js +639 -0
- package/dist/m0-swap-component/pay-with-exchange-BJYQgTMB.js.map +1 -0
- package/dist/m0-swap-component/property-BN-VaT99.js +625 -0
- package/dist/m0-swap-component/property-BN-VaT99.js.map +1 -0
- package/dist/m0-swap-component/receive-BptRM_5_.js +281 -0
- package/dist/m0-swap-component/receive-BptRM_5_.js.map +1 -0
- package/dist/m0-swap-component/ref-3xALOvo5.js +25 -0
- package/dist/m0-swap-component/ref-3xALOvo5.js.map +1 -0
- package/dist/m0-swap-component/send-BCyHM4Zr.js +1408 -0
- package/dist/m0-swap-component/send-BCyHM4Zr.js.map +1 -0
- package/dist/m0-swap-component/socials-BbajCSWV.js +824 -0
- package/dist/m0-swap-component/socials-BbajCSWV.js.map +1 -0
- package/dist/m0-swap-component/swap-module-5ZLM-vAV.js +140887 -0
- package/dist/m0-swap-component/swap-module-5ZLM-vAV.js.map +1 -0
- package/dist/m0-swap-component/swap-module.entry.esm.js.map +1 -0
- package/dist/m0-swap-component/swap-module.entry.js +15 -0
- package/dist/m0-swap-component/swaps-DyGe65DR.js +2121 -0
- package/dist/m0-swap-component/swaps-DyGe65DR.js.map +1 -0
- package/dist/m0-swap-component/transactions-BZ9l4zt5.js +60 -0
- package/dist/m0-swap-component/transactions-BZ9l4zt5.js.map +1 -0
- package/dist/m0-swap-component/utils-RCeZbvdb.js +95 -0
- package/dist/m0-swap-component/utils-RCeZbvdb.js.map +1 -0
- package/dist/m0-swap-component/w3m-modal-D0HWVPsj.js +2097 -0
- package/dist/m0-swap-component/w3m-modal-D0HWVPsj.js.map +1 -0
- package/dist/m0-swap-component/wui-button-BeTWD3Va.js +223 -0
- package/dist/m0-swap-component/wui-button-BeTWD3Va.js.map +1 -0
- package/dist/m0-swap-component/wui-email-input-CgnfUH0c.js +65 -0
- package/dist/m0-swap-component/wui-email-input-CgnfUH0c.js.map +1 -0
- package/dist/m0-swap-component/wui-icon-B0uTDhW-.js +4 -0
- package/dist/m0-swap-component/wui-icon-B0uTDhW-.js.map +1 -0
- package/dist/m0-swap-component/wui-icon-box-s87lODBB.js +4 -0
- package/dist/m0-swap-component/wui-icon-box-s87lODBB.js.map +1 -0
- package/dist/m0-swap-component/wui-icon-link-BFpV9kPE.js +127 -0
- package/dist/m0-swap-component/wui-icon-link-BFpV9kPE.js.map +1 -0
- package/dist/m0-swap-component/wui-image-BvjxoR51.js +4 -0
- package/dist/m0-swap-component/wui-image-BvjxoR51.js.map +1 -0
- package/dist/m0-swap-component/wui-input-amount-CWQfP3RO.js +182 -0
- package/dist/m0-swap-component/wui-input-amount-CWQfP3RO.js.map +1 -0
- package/dist/m0-swap-component/wui-input-text-g0sN4B2y.js +4 -0
- package/dist/m0-swap-component/wui-input-text-g0sN4B2y.js.map +1 -0
- package/dist/m0-swap-component/wui-link-VqM3wLny.js +123 -0
- package/dist/m0-swap-component/wui-link-VqM3wLny.js.map +1 -0
- package/dist/m0-swap-component/wui-list-item-BIijofqN.js +170 -0
- package/dist/m0-swap-component/wui-list-item-BIijofqN.js.map +1 -0
- package/dist/m0-swap-component/wui-list-social-C7GhkRc8.js +119 -0
- package/dist/m0-swap-component/wui-list-social-C7GhkRc8.js.map +1 -0
- package/dist/m0-swap-component/wui-list-token-C94lmAbT.js +134 -0
- package/dist/m0-swap-component/wui-list-token-C94lmAbT.js.map +1 -0
- package/dist/m0-swap-component/wui-list-wallet-C7fnQvCW.js +622 -0
- package/dist/m0-swap-component/wui-list-wallet-C7fnQvCW.js.map +1 -0
- package/dist/m0-swap-component/wui-loading-spinner-CW2_5SKA.js +4 -0
- package/dist/m0-swap-component/wui-loading-spinner-CW2_5SKA.js.map +1 -0
- package/dist/m0-swap-component/wui-loading-thumbnail-y3sGkT5j.js +337 -0
- package/dist/m0-swap-component/wui-loading-thumbnail-y3sGkT5j.js.map +1 -0
- package/dist/m0-swap-component/wui-qr-code-DekJTDGf.js +3412 -0
- package/dist/m0-swap-component/wui-qr-code-DekJTDGf.js.map +1 -0
- package/dist/m0-swap-component/wui-separator-DMZIL_Av.js +67 -0
- package/dist/m0-swap-component/wui-separator-DMZIL_Av.js.map +1 -0
- package/dist/m0-swap-component/wui-shimmer-CVFC8fMx.js +4 -0
- package/dist/m0-swap-component/wui-shimmer-CVFC8fMx.js.map +1 -0
- package/dist/m0-swap-component/wui-text-BS_lZKY4.js +1127 -0
- package/dist/m0-swap-component/wui-text-BS_lZKY4.js.map +1 -0
- package/dist/m0-swap-component/wui-token-button-CsOFoNJG.js +214 -0
- package/dist/m0-swap-component/wui-token-button-CsOFoNJG.js.map +1 -0
- package/dist/m0-swap-component/wui-visual-hU2Mkyrv.js +565 -0
- package/dist/m0-swap-component/wui-visual-hU2Mkyrv.js.map +1 -0
- package/dist/m0-swap-component/wui-wallet-switch-CWbdtfbN.js +459 -0
- package/dist/m0-swap-component/wui-wallet-switch-CWbdtfbN.js.map +1 -0
- package/dist/types/components/swap-module/balances.d.ts +16 -0
- package/dist/types/components/swap-module/chains.d.ts +16 -0
- package/dist/types/components/swap-module/store.d.ts +34 -0
- package/dist/types/components/swap-module/swap-module.d.ts +113 -0
- package/dist/types/components/swap-module/utils/constants.d.ts +7 -0
- package/dist/types/components/swap-module/utils/formatters.d.ts +23 -0
- package/dist/types/components/swap-module/utils/reown.d.ts +59 -0
- package/dist/types/components/swap-module/utils/wallet.d.ts +83 -0
- package/dist/types/components.d.ts +165 -0
- package/dist/types/index.d.ts +1 -0
- package/dist/types/stencil-public-runtime.d.ts +1732 -0
- package/loader/cdn.js +1 -0
- package/loader/index.cjs.js +1 -0
- package/loader/index.d.ts +24 -0
- package/loader/index.es2017.js +1 -0
- package/loader/index.js +2 -0
- 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
|