astra-modal-test 1.0.5 → 1.0.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (154) hide show
  1. package/.github/workflows/code-quality.yml +43 -0
  2. package/.github/workflows/publish.yml +64 -0
  3. package/README.md +204 -0
  4. package/dist/SwapController-CsNqEWIM.js +447 -0
  5. package/dist/add-Dm_oSEbv.js +19 -0
  6. package/dist/all-wallets-DfLlzQJ3.js +10 -0
  7. package/dist/app-store-BMdJkp6P.js +21 -0
  8. package/dist/apple-BetlVMKw.js +22 -0
  9. package/dist/arrow-bottom-BddPptxy.js +12 -0
  10. package/dist/arrow-bottom-circle-CvdJJniv.js +15 -0
  11. package/dist/arrow-left-Bbq-z1nQ.js +12 -0
  12. package/dist/arrow-right-Bu4_SVLC.js +12 -0
  13. package/dist/arrow-top-CynlXB-M.js +12 -0
  14. package/dist/astra-sdk.es.js +4 -4
  15. package/dist/bank-B9QscNnS.js +18 -0
  16. package/dist/bin-v-tshf8_.js +8 -0
  17. package/dist/bitcoin-C01gkYyN.js +17 -0
  18. package/dist/browser-9uNaCY31.js +18 -0
  19. package/dist/card-hKR9lRzU.js +18 -0
  20. package/dist/{ccip-oZOrZYR9.js → ccip-CUCziAPw.js} +52 -49
  21. package/dist/checkmark-D1M40aM5.js +15 -0
  22. package/dist/checkmark-bold-1_UGl24m.js +12 -0
  23. package/dist/chevron-bottom-BleoRNRL.js +12 -0
  24. package/dist/chevron-left-C9JMU-3B.js +12 -0
  25. package/dist/chevron-right-Daue4WBx.js +12 -0
  26. package/dist/chevron-top-yuXekbUC.js +12 -0
  27. package/dist/chrome-store-BsUFRR7F.js +65 -0
  28. package/dist/circle-BCxdhM5X.js +8 -0
  29. package/dist/clock-7a-DWZQa.js +12 -0
  30. package/dist/close-DMQYuJ0z.js +12 -0
  31. package/dist/clsx.m-DCYaa4RU.js +20 -0
  32. package/dist/coinPlaceholder-DjQ-HnSH.js +12 -0
  33. package/dist/compass-AMecXNVm.js +12 -0
  34. package/dist/copy-CgIPGYbU.js +19 -0
  35. package/dist/cursor-DpYbTNcO.js +7 -0
  36. package/dist/cursor-transparent-C8iPJkn8.js +16 -0
  37. package/dist/desktop-BWVQVGng.js +13 -0
  38. package/dist/disconnect-C6IQRrtF.js +12 -0
  39. package/dist/discord-gH3i-QsC.js +21 -0
  40. package/dist/email-BxYwJC5T.js +10 -0
  41. package/dist/embedded-wallet-DCcVNgkc.js +464 -0
  42. package/dist/ethereum-CGWsmZaC.js +14 -0
  43. package/dist/etherscan-D4EFsAJ4.js +10 -0
  44. package/dist/exclamation-triangle-DNwQ1Xq6.js +8 -0
  45. package/dist/extension-DxQPsN2z.js +12 -0
  46. package/dist/external-link-BeEzrdgR.js +12 -0
  47. package/dist/facebook-B2Ix8_d3.js +30 -0
  48. package/dist/farcaster-BB83p8dC.js +16 -0
  49. package/dist/filters-PzdIomB1.js +12 -0
  50. package/dist/github-gcp1rxX0.js +22 -0
  51. package/dist/google-Qv9lTZcz.js +22 -0
  52. package/dist/help-circle-BLXTMjzX.js +16 -0
  53. package/dist/id-BHg2CRhj.js +16 -0
  54. package/dist/image-DWi1V30x.js +8 -0
  55. package/dist/index-4lbsZ6RQ.js +33 -0
  56. package/dist/index-64U3D9_n.js +21034 -0
  57. package/dist/index-CRU49I0g.js +15911 -0
  58. package/dist/index-ChxXyuZj.js +572 -0
  59. package/dist/index-ClS956E1.js +74511 -0
  60. package/dist/index-Cs4fWw01.js +386 -0
  61. package/dist/index-DfWqgW4h.js +709 -0
  62. package/dist/index-VYNI76FM.js +315 -0
  63. package/dist/index-qfkTLN90.js +10785 -0
  64. package/dist/index-r2ztgVN2.js +1060 -0
  65. package/dist/index-wvh7Yd5J.js +70 -0
  66. package/dist/info-Bl5tmiBJ.js +7 -0
  67. package/dist/info-circle-D2uYywg-.js +16 -0
  68. package/dist/lightbulb-HvXH2AVF.js +7 -0
  69. package/dist/mail-DXOPfnog.js +12 -0
  70. package/dist/mobile-Dd0Gj4vZ.js +13 -0
  71. package/dist/more-DYcnClbB.js +15 -0
  72. package/dist/network-placeholder-CfRZGQfi.js +18 -0
  73. package/dist/nftPlaceholder-DHmFkY55.js +12 -0
  74. package/dist/off-CG2Y30qN.js +8 -0
  75. package/dist/onramp-DoAMTeNm.js +917 -0
  76. package/dist/play-store-B5EYBQto.js +36 -0
  77. package/dist/plus-DPo25_zL.js +17 -0
  78. package/dist/qr-code-BRTO19PL.js +10 -0
  79. package/dist/receive-BvclNdV_.js +179 -0
  80. package/dist/recycle-horizontal-ng_b2eJV.js +13 -0
  81. package/dist/refresh-3kiwRV0w.js +12 -0
  82. package/dist/reown-logo-_9cuIfJD.js +16 -0
  83. package/dist/search-CoJvIxpi.js +12 -0
  84. package/dist/secp256k1-wZyK2iIX.js +1257 -0
  85. package/dist/send-BVKGSR-Z.js +19 -0
  86. package/dist/send-Bkj5YtHe.js +1039 -0
  87. package/dist/socials-DL42HlL5.js +589 -0
  88. package/dist/solana-BjP-_Ioa.js +17 -0
  89. package/dist/swapHorizontal-Do3uBbum.js +12 -0
  90. package/dist/swapHorizontalBold-D7N75BE-.js +12 -0
  91. package/dist/swapHorizontalMedium-BahEVO2x.js +20 -0
  92. package/dist/swapHorizontalRoundedBold-D6Hoi132.js +12 -0
  93. package/dist/swapVertical-P-fnrADh.js +12 -0
  94. package/dist/swaps-DZgbVJZ2.js +1713 -0
  95. package/dist/telegram-DmaL2iB8.js +20 -0
  96. package/dist/three-dots-oXyAsUA6.js +9 -0
  97. package/dist/transactions-BjB5yZN7.js +35 -0
  98. package/dist/twitch-0UGrMr2K.js +22 -0
  99. package/dist/twitterIcon-B97KAbaJ.js +10 -0
  100. package/dist/ui-r6nnVhBA.js +812 -0
  101. package/dist/user-BG1yp56Q.js +7 -0
  102. package/dist/verify-CgzkMSuV.js +12 -0
  103. package/dist/verify-filled-D-TRpWtN.js +12 -0
  104. package/dist/w3m-modal-Drsibcs0.js +1041 -0
  105. package/dist/wallet-CAHsZdfj.js +12 -0
  106. package/dist/wallet-placeholder-agbbreqw.js +18 -0
  107. package/dist/walletconnect-Yd8iXqY9.js +36 -0
  108. package/dist/warning-circle-C0hqC6h_.js +16 -0
  109. package/dist/x-mark-D9_ai2sI.js +7 -0
  110. package/dist/x-z6v1Jegg.js +16 -0
  111. package/eslint.config.mjs +1 -1
  112. package/package.json +14 -13
  113. package/src/apis/lspApi.js +47 -24
  114. package/src/assets/ln.png +0 -0
  115. package/src/assets/network/Arbitrum.png +0 -0
  116. package/src/assets/network/Polygon.png +0 -0
  117. package/src/assets/network/Solana.png +0 -0
  118. package/src/assets/network/botanix.png +0 -0
  119. package/src/assets/network/bsc.svg +13 -0
  120. package/src/assets/pay.png +0 -0
  121. package/src/assets/tokens/usdc.png +0 -0
  122. package/src/assets/tokens/usdt.png +0 -0
  123. package/src/comps/AstraImage.jsx +17 -3
  124. package/src/comps/AstraModal.jsx +22 -16
  125. package/src/comps/AstraModalLogo.jsx +9 -9
  126. package/src/comps/AstraNetwork.jsx +174 -45
  127. package/src/comps/CheckErc20Button.jsx +1 -1
  128. package/src/comps/CommonStyle.jsx +4 -0
  129. package/src/comps/ConnectButton.jsx +16 -33
  130. package/src/comps/ResultModal.jsx +45 -39
  131. package/src/comps/ToLightning.jsx +207 -80
  132. package/src/comps/ToToken.jsx +278 -217
  133. package/src/constants/index.js +20 -4
  134. package/src/hooks/useContract.js +164 -125
  135. package/src/hooks/useGetMinAndMax.js +48 -0
  136. package/src/hooks/useLspApi.js +56 -39
  137. package/src/hooks/useParseInvoice.js +82 -72
  138. package/src/index.jsx +43 -10
  139. package/src/main.jsx +36 -5
  140. package/src/utils/index.js +136 -24
  141. package/vite.config.js +7 -1
  142. package/dist/astra-sdk.umd.js +0 -12578
  143. package/dist/hooks.module-BBZfodGH.js +0 -506
  144. package/dist/index-BKKAfRrw.js +0 -87520
  145. package/dist/index-C2MAIRET.js +0 -2929
  146. package/dist/index-CsRxokSv.js +0 -445
  147. package/dist/index-DQ6iiHxJ.js +0 -13720
  148. package/dist/index-SJhlkSif.js +0 -133
  149. package/dist/w3m-modal-CYJpmgnf.js +0 -267
  150. package/src/constants/contracts/abi/bridge.js +0 -1281
  151. package/src/constants/contracts/abi/index.js +0 -3
  152. package/src/constants/contracts/abi/usdt.js +0 -130
  153. package/src/constants/contracts/abi/watcher.js +0 -437
  154. package/src/constants/contracts/index.js +0 -37
@@ -0,0 +1,589 @@
1
+ import { E as L, H as A, av as c, I, J as _, a3 as E, aB as u, R as m, a1 as F, K as l, aC as N, Y as P, aD as D, $ as j, aE as W, au as y, _ as d, O as $, V as b, aF as q, Q as p, aG as T, S as v, aH as M, aI as O, at as S } from "./index-ClS956E1.js";
2
+ const z = L`
3
+ :host {
4
+ margin-top: var(--wui-spacing-3xs);
5
+ }
6
+ wui-separator {
7
+ margin: var(--wui-spacing-m) calc(var(--wui-spacing-m) * -1) var(--wui-spacing-xs)
8
+ calc(var(--wui-spacing-m) * -1);
9
+ width: calc(100% + var(--wui-spacing-s) * 2);
10
+ }
11
+ `;
12
+ var x = function(a, e, t, o) {
13
+ var r = arguments.length, i = r < 3 ? e : o === null ? o = Object.getOwnPropertyDescriptor(e, t) : o, s;
14
+ if (typeof Reflect == "object" && typeof Reflect.decorate == "function") i = Reflect.decorate(a, e, t, o);
15
+ else for (var n = a.length - 1; n >= 0; n--) (s = a[n]) && (i = (r < 3 ? s(i) : r > 3 ? s(e, t, i) : s(e, t)) || i);
16
+ return r > 3 && i && Object.defineProperty(e, t, i), i;
17
+ };
18
+ let w = class extends _ {
19
+ constructor() {
20
+ super(), this.unsubscribe = [], this.tabIdx = void 0, this.connectors = E.state.connectors, this.authConnector = this.connectors.find((e) => e.type === "AUTH"), this.remoteFeatures = u.state.remoteFeatures, this.isPwaLoading = !1, this.unsubscribe.push(E.subscribeKey("connectors", (e) => {
21
+ this.connectors = e, this.authConnector = this.connectors.find((t) => t.type === "AUTH");
22
+ }), u.subscribeKey("remoteFeatures", (e) => this.remoteFeatures = e));
23
+ }
24
+ connectedCallback() {
25
+ super.connectedCallback(), this.handlePwaFrameLoad();
26
+ }
27
+ disconnectedCallback() {
28
+ this.unsubscribe.forEach((e) => e());
29
+ }
30
+ render() {
31
+ var i;
32
+ let e = ((i = this.remoteFeatures) == null ? void 0 : i.socials) || [];
33
+ const t = !!this.authConnector, o = e == null ? void 0 : e.length, r = m.state.view === "ConnectSocials";
34
+ return (!t || !o) && !r ? null : (r && !o && (e = F.DEFAULT_SOCIALS), l` <wui-flex flexDirection="column" gap="xs">
35
+ ${e.map((s) => l`<wui-list-social
36
+ @click=${() => {
37
+ this.onSocialClick(s);
38
+ }}
39
+ data-testid=${`social-selector-${s}`}
40
+ name=${s}
41
+ logo=${s}
42
+ ?disabled=${this.isPwaLoading}
43
+ ></wui-list-social>`)}
44
+ </wui-flex>`);
45
+ }
46
+ async onSocialClick(e) {
47
+ e && await N(e);
48
+ }
49
+ async handlePwaFrameLoad() {
50
+ var e;
51
+ if (P.isPWA()) {
52
+ this.isPwaLoading = !0;
53
+ try {
54
+ ((e = this.authConnector) == null ? void 0 : e.provider) instanceof D && await this.authConnector.provider.init();
55
+ } catch (t) {
56
+ j.open({
57
+ displayMessage: "Error loading embedded wallet in PWA",
58
+ debugMessage: t.message
59
+ }, "error");
60
+ } finally {
61
+ this.isPwaLoading = !1;
62
+ }
63
+ }
64
+ }
65
+ };
66
+ w.styles = z;
67
+ x([
68
+ A()
69
+ ], w.prototype, "tabIdx", void 0);
70
+ x([
71
+ c()
72
+ ], w.prototype, "connectors", void 0);
73
+ x([
74
+ c()
75
+ ], w.prototype, "authConnector", void 0);
76
+ x([
77
+ c()
78
+ ], w.prototype, "remoteFeatures", void 0);
79
+ x([
80
+ c()
81
+ ], w.prototype, "isPwaLoading", void 0);
82
+ w = x([
83
+ I("w3m-social-login-list")
84
+ ], w);
85
+ const B = L`
86
+ wui-flex {
87
+ max-height: clamp(360px, 540px, 80vh);
88
+ overflow: scroll;
89
+ scrollbar-width: none;
90
+ transition: opacity var(--wui-ease-out-power-1) var(--wui-duration-md);
91
+ will-change: opacity;
92
+ }
93
+ wui-flex::-webkit-scrollbar {
94
+ display: none;
95
+ }
96
+ wui-flex.disabled {
97
+ opacity: 0.3;
98
+ pointer-events: none;
99
+ user-select: none;
100
+ }
101
+ `;
102
+ var U = function(a, e, t, o) {
103
+ var r = arguments.length, i = r < 3 ? e : o === null ? o = Object.getOwnPropertyDescriptor(e, t) : o, s;
104
+ if (typeof Reflect == "object" && typeof Reflect.decorate == "function") i = Reflect.decorate(a, e, t, o);
105
+ else for (var n = a.length - 1; n >= 0; n--) (s = a[n]) && (i = (r < 3 ? s(i) : r > 3 ? s(e, t, i) : s(e, t)) || i);
106
+ return r > 3 && i && Object.defineProperty(e, t, i), i;
107
+ };
108
+ let k = class extends _ {
109
+ constructor() {
110
+ super(), this.unsubscribe = [], this.checked = W.state.isLegalCheckboxChecked, this.unsubscribe.push(W.subscribeKey("isLegalCheckboxChecked", (e) => {
111
+ this.checked = e;
112
+ }));
113
+ }
114
+ disconnectedCallback() {
115
+ this.unsubscribe.forEach((e) => e());
116
+ }
117
+ render() {
118
+ var R;
119
+ const { termsConditionsUrl: e, privacyPolicyUrl: t } = u.state, o = (R = u.state.features) == null ? void 0 : R.legalCheckbox, i = !!(e || t) && !!o, s = i && !this.checked, n = s ? -1 : void 0;
120
+ return l`
121
+ <w3m-legal-checkbox></w3m-legal-checkbox>
122
+ <wui-flex
123
+ flexDirection="column"
124
+ .padding=${i ? ["0", "s", "s", "s"] : "s"}
125
+ gap="xs"
126
+ class=${y(s ? "disabled" : void 0)}
127
+ >
128
+ <w3m-social-login-list tabIdx=${y(n)}></w3m-social-login-list>
129
+ </wui-flex>
130
+ <w3m-legal-footer></w3m-legal-footer>
131
+ `;
132
+ }
133
+ };
134
+ k.styles = B;
135
+ U([
136
+ c()
137
+ ], k.prototype, "checked", void 0);
138
+ k = U([
139
+ I("w3m-connect-socials-view")
140
+ ], k);
141
+ const V = L`
142
+ wui-logo {
143
+ width: 80px;
144
+ height: 80px;
145
+ border-radius: var(--wui-border-radius-m);
146
+ }
147
+ @keyframes shake {
148
+ 0% {
149
+ transform: translateX(0);
150
+ }
151
+ 25% {
152
+ transform: translateX(3px);
153
+ }
154
+ 50% {
155
+ transform: translateX(-3px);
156
+ }
157
+ 75% {
158
+ transform: translateX(3px);
159
+ }
160
+ 100% {
161
+ transform: translateX(0);
162
+ }
163
+ }
164
+ wui-flex:first-child:not(:only-child) {
165
+ position: relative;
166
+ }
167
+ wui-loading-thumbnail {
168
+ position: absolute;
169
+ }
170
+ wui-icon-box {
171
+ position: absolute;
172
+ right: calc(var(--wui-spacing-3xs) * -1);
173
+ bottom: calc(var(--wui-spacing-3xs) * -1);
174
+ opacity: 0;
175
+ transform: scale(0.5);
176
+ transition: all var(--wui-ease-out-power-2) var(--wui-duration-lg);
177
+ }
178
+ wui-text[align='center'] {
179
+ width: 100%;
180
+ padding: 0px var(--wui-spacing-l);
181
+ }
182
+ [data-error='true'] wui-icon-box {
183
+ opacity: 1;
184
+ transform: scale(1);
185
+ }
186
+ [data-error='true'] > wui-flex:first-child {
187
+ animation: shake 250ms cubic-bezier(0.36, 0.07, 0.19, 0.97) both;
188
+ }
189
+ .capitalize {
190
+ text-transform: capitalize;
191
+ }
192
+ `;
193
+ var g = function(a, e, t, o) {
194
+ var r = arguments.length, i = r < 3 ? e : o === null ? o = Object.getOwnPropertyDescriptor(e, t) : o, s;
195
+ if (typeof Reflect == "object" && typeof Reflect.decorate == "function") i = Reflect.decorate(a, e, t, o);
196
+ else for (var n = a.length - 1; n >= 0; n--) (s = a[n]) && (i = (r < 3 ? s(i) : r > 3 ? s(e, t, i) : s(e, t)) || i);
197
+ return r > 3 && i && Object.defineProperty(e, t, i), i;
198
+ };
199
+ let h = class extends _ {
200
+ constructor() {
201
+ super(), this.unsubscribe = [], this.socialProvider = d.state.socialProvider, this.socialWindow = d.state.socialWindow, this.error = !1, this.connecting = !1, this.message = "Connect in the provider window", this.remoteFeatures = u.state.remoteFeatures, this.address = d.state.address, this.connectionsByNamespace = $.getConnections(b.state.activeChain), this.hasMultipleConnections = this.connectionsByNamespace.length > 0, this.authConnector = E.getAuthConnector(), this.handleSocialConnection = async (t) => {
202
+ var o, r;
203
+ if ((o = t.data) != null && o.resultUri)
204
+ if (t.origin === q.SECURE_SITE_ORIGIN) {
205
+ window.removeEventListener("message", this.handleSocialConnection, !1);
206
+ try {
207
+ if (this.authConnector && !this.connecting) {
208
+ this.socialWindow && (this.socialWindow.close(), d.setSocialWindow(void 0, b.state.activeChain)), this.connecting = !0, this.updateMessage();
209
+ const i = t.data.resultUri;
210
+ this.socialProvider && p.sendEvent({
211
+ type: "track",
212
+ event: "SOCIAL_LOGIN_REQUEST_USER_DATA",
213
+ properties: { provider: this.socialProvider }
214
+ }), await $.connectExternal({
215
+ id: this.authConnector.id,
216
+ type: this.authConnector.type,
217
+ socialUri: i
218
+ }, this.authConnector.chain), this.socialProvider && (T.setConnectedSocialProvider(this.socialProvider), p.sendEvent({
219
+ type: "track",
220
+ event: "SOCIAL_LOGIN_SUCCESS",
221
+ properties: {
222
+ provider: this.socialProvider,
223
+ caipNetworkId: (r = b.getActiveCaipNetwork()) == null ? void 0 : r.caipNetworkId
224
+ }
225
+ }));
226
+ }
227
+ } catch {
228
+ this.error = !0, this.updateMessage(), this.socialProvider && p.sendEvent({
229
+ type: "track",
230
+ event: "SOCIAL_LOGIN_ERROR",
231
+ properties: { provider: this.socialProvider }
232
+ });
233
+ }
234
+ } else
235
+ m.goBack(), v.showError("Untrusted Origin"), this.socialProvider && p.sendEvent({
236
+ type: "track",
237
+ event: "SOCIAL_LOGIN_ERROR",
238
+ properties: { provider: this.socialProvider }
239
+ });
240
+ }, M.EmbeddedWalletAbortController.signal.addEventListener("abort", () => {
241
+ this.socialWindow && (this.socialWindow.close(), d.setSocialWindow(void 0, b.state.activeChain));
242
+ }), this.unsubscribe.push(d.subscribe((t) => {
243
+ t.socialProvider && (this.socialProvider = t.socialProvider), t.socialWindow && (this.socialWindow = t.socialWindow);
244
+ }), u.subscribeKey("remoteFeatures", (t) => {
245
+ this.remoteFeatures = t;
246
+ }), d.subscribeKey("address", (t) => {
247
+ var r;
248
+ const o = (r = this.remoteFeatures) == null ? void 0 : r.multiWallet;
249
+ t && t !== this.address && (this.hasMultipleConnections && o ? (m.replace("ProfileWallets"), v.showSuccess("New Wallet Added")) : (O.state.open || u.state.enableEmbedded) && O.close());
250
+ })), this.authConnector && this.connectSocial();
251
+ }
252
+ disconnectedCallback() {
253
+ var e;
254
+ this.unsubscribe.forEach((t) => t()), window.removeEventListener("message", this.handleSocialConnection, !1), (e = this.socialWindow) == null || e.close(), d.setSocialWindow(void 0, b.state.activeChain);
255
+ }
256
+ render() {
257
+ return l`
258
+ <wui-flex
259
+ data-error=${y(this.error)}
260
+ flexDirection="column"
261
+ alignItems="center"
262
+ .padding=${["3xl", "xl", "xl", "xl"]}
263
+ gap="xl"
264
+ >
265
+ <wui-flex justifyContent="center" alignItems="center">
266
+ <wui-logo logo=${y(this.socialProvider)}></wui-logo>
267
+ ${this.error ? null : this.loaderTemplate()}
268
+ <wui-icon-box
269
+ backgroundColor="error-100"
270
+ background="opaque"
271
+ iconColor="error-100"
272
+ icon="close"
273
+ size="sm"
274
+ border
275
+ borderColor="wui-color-bg-125"
276
+ ></wui-icon-box>
277
+ </wui-flex>
278
+ <wui-flex flexDirection="column" alignItems="center" gap="xs">
279
+ <wui-text align="center" variant="paragraph-500" color="fg-100"
280
+ >Log in with
281
+ <span class="capitalize">${this.socialProvider ?? "Social"}</span></wui-text
282
+ >
283
+ <wui-text align="center" variant="small-400" color=${this.error ? "error-100" : "fg-200"}
284
+ >${this.message}</wui-text
285
+ ></wui-flex
286
+ >
287
+ </wui-flex>
288
+ `;
289
+ }
290
+ loaderTemplate() {
291
+ const e = S.state.themeVariables["--w3m-border-radius-master"], t = e ? parseInt(e.replace("px", ""), 10) : 4;
292
+ return l`<wui-loading-thumbnail radius=${t * 9}></wui-loading-thumbnail>`;
293
+ }
294
+ connectSocial() {
295
+ const e = setInterval(() => {
296
+ var t;
297
+ (t = this.socialWindow) != null && t.closed && (!this.connecting && m.state.view === "ConnectingSocial" && (this.socialProvider && p.sendEvent({
298
+ type: "track",
299
+ event: "SOCIAL_LOGIN_CANCELED",
300
+ properties: { provider: this.socialProvider }
301
+ }), m.goBack()), clearInterval(e));
302
+ }, 1e3);
303
+ window.addEventListener("message", this.handleSocialConnection, !1);
304
+ }
305
+ updateMessage() {
306
+ this.error ? this.message = "Something went wrong" : this.connecting ? this.message = "Retrieving user data" : this.message = "Connect in the provider window";
307
+ }
308
+ };
309
+ h.styles = V;
310
+ g([
311
+ c()
312
+ ], h.prototype, "socialProvider", void 0);
313
+ g([
314
+ c()
315
+ ], h.prototype, "socialWindow", void 0);
316
+ g([
317
+ c()
318
+ ], h.prototype, "error", void 0);
319
+ g([
320
+ c()
321
+ ], h.prototype, "connecting", void 0);
322
+ g([
323
+ c()
324
+ ], h.prototype, "message", void 0);
325
+ g([
326
+ c()
327
+ ], h.prototype, "remoteFeatures", void 0);
328
+ h = g([
329
+ I("w3m-connecting-social-view")
330
+ ], h);
331
+ const G = L`
332
+ @keyframes fadein {
333
+ from {
334
+ opacity: 0;
335
+ }
336
+ to {
337
+ opacity: 1;
338
+ }
339
+ }
340
+
341
+ wui-shimmer {
342
+ width: 100%;
343
+ aspect-ratio: 1 / 1;
344
+ border-radius: clamp(0px, var(--wui-border-radius-l), 40px) !important;
345
+ }
346
+
347
+ wui-qr-code {
348
+ opacity: 0;
349
+ animation-duration: 200ms;
350
+ animation-timing-function: ease;
351
+ animation-name: fadein;
352
+ animation-fill-mode: forwards;
353
+ }
354
+
355
+ wui-logo {
356
+ width: 80px;
357
+ height: 80px;
358
+ border-radius: var(--wui-border-radius-m);
359
+ }
360
+
361
+ wui-flex:first-child:not(:only-child) {
362
+ position: relative;
363
+ }
364
+ wui-loading-thumbnail {
365
+ position: absolute;
366
+ }
367
+ wui-icon-box {
368
+ position: absolute;
369
+ right: calc(var(--wui-spacing-3xs) * -1);
370
+ bottom: calc(var(--wui-spacing-3xs) * -1);
371
+ opacity: 0;
372
+ transform: scale(0.5);
373
+ transition: all var(--wui-ease-out-power-2) var(--wui-duration-lg);
374
+ }
375
+ `;
376
+ var C = function(a, e, t, o) {
377
+ var r = arguments.length, i = r < 3 ? e : o === null ? o = Object.getOwnPropertyDescriptor(e, t) : o, s;
378
+ if (typeof Reflect == "object" && typeof Reflect.decorate == "function") i = Reflect.decorate(a, e, t, o);
379
+ else for (var n = a.length - 1; n >= 0; n--) (s = a[n]) && (i = (r < 3 ? s(i) : r > 3 ? s(e, t, i) : s(e, t)) || i);
380
+ return r > 3 && i && Object.defineProperty(e, t, i), i;
381
+ };
382
+ let f = class extends _ {
383
+ constructor() {
384
+ super(), this.unsubscribe = [], this.timeout = void 0, this.socialProvider = d.state.socialProvider, this.uri = d.state.farcasterUrl, this.ready = !1, this.loading = !1, this.remoteFeatures = u.state.remoteFeatures, this.authConnector = E.getAuthConnector(), this.forceUpdate = () => {
385
+ this.requestUpdate();
386
+ }, this.unsubscribe.push(d.subscribeKey("farcasterUrl", (e) => {
387
+ e && (this.uri = e, this.connectFarcaster());
388
+ }), d.subscribeKey("socialProvider", (e) => {
389
+ e && (this.socialProvider = e);
390
+ }), u.subscribeKey("remoteFeatures", (e) => {
391
+ this.remoteFeatures = e;
392
+ })), window.addEventListener("resize", this.forceUpdate);
393
+ }
394
+ disconnectedCallback() {
395
+ super.disconnectedCallback(), clearTimeout(this.timeout), window.removeEventListener("resize", this.forceUpdate);
396
+ }
397
+ render() {
398
+ return this.onRenderProxy(), l`${this.platformTemplate()}`;
399
+ }
400
+ platformTemplate() {
401
+ return P.isMobile() ? l`${this.mobileTemplate()}` : l`${this.desktopTemplate()}`;
402
+ }
403
+ desktopTemplate() {
404
+ return this.loading ? l`${this.loadingTemplate()}` : l`${this.qrTemplate()}`;
405
+ }
406
+ qrTemplate() {
407
+ return l` <wui-flex
408
+ flexDirection="column"
409
+ alignItems="center"
410
+ .padding=${["0", "xl", "xl", "xl"]}
411
+ gap="xl"
412
+ >
413
+ <wui-shimmer borderRadius="l" width="100%"> ${this.qrCodeTemplate()} </wui-shimmer>
414
+
415
+ <wui-text variant="paragraph-500" color="fg-100">
416
+ Scan this QR Code with your phone
417
+ </wui-text>
418
+ ${this.copyTemplate()}
419
+ </wui-flex>`;
420
+ }
421
+ loadingTemplate() {
422
+ return l`
423
+ <wui-flex
424
+ flexDirection="column"
425
+ alignItems="center"
426
+ .padding=${["xl", "xl", "xl", "xl"]}
427
+ gap="xl"
428
+ >
429
+ <wui-flex justifyContent="center" alignItems="center">
430
+ <wui-logo logo="farcaster"></wui-logo>
431
+ ${this.loaderTemplate()}
432
+ <wui-icon-box
433
+ backgroundColor="error-100"
434
+ background="opaque"
435
+ iconColor="error-100"
436
+ icon="close"
437
+ size="sm"
438
+ border
439
+ borderColor="wui-color-bg-125"
440
+ ></wui-icon-box>
441
+ </wui-flex>
442
+ <wui-flex flexDirection="column" alignItems="center" gap="xs">
443
+ <wui-text align="center" variant="paragraph-500" color="fg-100">
444
+ Loading user data
445
+ </wui-text>
446
+ <wui-text align="center" variant="small-400" color="fg-200">
447
+ Please wait a moment while we load your data.
448
+ </wui-text>
449
+ </wui-flex>
450
+ </wui-flex>
451
+ `;
452
+ }
453
+ mobileTemplate() {
454
+ return l` <wui-flex
455
+ flexDirection="column"
456
+ alignItems="center"
457
+ .padding=${["3xl", "xl", "xl", "xl"]}
458
+ gap="xl"
459
+ >
460
+ <wui-flex justifyContent="center" alignItems="center">
461
+ <wui-logo logo="farcaster"></wui-logo>
462
+ ${this.loaderTemplate()}
463
+ <wui-icon-box
464
+ backgroundColor="error-100"
465
+ background="opaque"
466
+ iconColor="error-100"
467
+ icon="close"
468
+ size="sm"
469
+ border
470
+ borderColor="wui-color-bg-125"
471
+ ></wui-icon-box>
472
+ </wui-flex>
473
+ <wui-flex flexDirection="column" alignItems="center" gap="xs">
474
+ <wui-text align="center" variant="paragraph-500" color="fg-100"
475
+ >Continue in Farcaster</span></wui-text
476
+ >
477
+ <wui-text align="center" variant="small-400" color="fg-200"
478
+ >Accept connection request in the app</wui-text
479
+ ></wui-flex
480
+ >
481
+ ${this.mobileLinkTemplate()}
482
+ </wui-flex>`;
483
+ }
484
+ loaderTemplate() {
485
+ const e = S.state.themeVariables["--w3m-border-radius-master"], t = e ? parseInt(e.replace("px", ""), 10) : 4;
486
+ return l`<wui-loading-thumbnail radius=${t * 9}></wui-loading-thumbnail>`;
487
+ }
488
+ async connectFarcaster() {
489
+ var e, t, o;
490
+ if (this.authConnector)
491
+ try {
492
+ await ((e = this.authConnector) == null ? void 0 : e.provider.connectFarcaster()), this.socialProvider && (T.setConnectedSocialProvider(this.socialProvider), p.sendEvent({
493
+ type: "track",
494
+ event: "SOCIAL_LOGIN_REQUEST_USER_DATA",
495
+ properties: { provider: this.socialProvider }
496
+ })), this.loading = !0;
497
+ const i = $.getConnections(this.authConnector.chain).length > 0;
498
+ await $.connectExternal(this.authConnector, this.authConnector.chain);
499
+ const s = (t = this.remoteFeatures) == null ? void 0 : t.multiWallet;
500
+ this.socialProvider && p.sendEvent({
501
+ type: "track",
502
+ event: "SOCIAL_LOGIN_SUCCESS",
503
+ properties: {
504
+ provider: this.socialProvider,
505
+ caipNetworkId: (o = b.getActiveCaipNetwork()) == null ? void 0 : o.caipNetworkId
506
+ }
507
+ }), this.loading = !1, i && s ? (m.replace("ProfileWallets"), v.showSuccess("New Wallet Added")) : O.close();
508
+ } catch (r) {
509
+ this.socialProvider && p.sendEvent({
510
+ type: "track",
511
+ event: "SOCIAL_LOGIN_ERROR",
512
+ properties: { provider: this.socialProvider }
513
+ }), m.goBack(), v.showError(r);
514
+ }
515
+ }
516
+ mobileLinkTemplate() {
517
+ return l`<wui-button
518
+ size="md"
519
+ ?loading=${this.loading}
520
+ ?disabled=${!this.uri || this.loading}
521
+ @click=${() => {
522
+ this.uri && P.openHref(this.uri, "_blank");
523
+ }}
524
+ >
525
+ Open farcaster</wui-button
526
+ >`;
527
+ }
528
+ onRenderProxy() {
529
+ !this.ready && this.uri && (this.timeout = setTimeout(() => {
530
+ this.ready = !0;
531
+ }, 200));
532
+ }
533
+ qrCodeTemplate() {
534
+ if (!this.uri || !this.ready)
535
+ return null;
536
+ const e = this.getBoundingClientRect().width - 40;
537
+ return l` <wui-qr-code
538
+ size=${e}
539
+ theme=${S.state.themeMode}
540
+ uri=${this.uri}
541
+ ?farcaster=${!0}
542
+ data-testid="wui-qr-code"
543
+ color=${y(S.state.themeVariables["--w3m-qr-color"])}
544
+ ></wui-qr-code>`;
545
+ }
546
+ copyTemplate() {
547
+ const e = !this.uri || !this.ready;
548
+ return l`<wui-link
549
+ .disabled=${e}
550
+ @click=${this.onCopyUri}
551
+ color="fg-200"
552
+ data-testid="copy-wc2-uri"
553
+ >
554
+ <wui-icon size="xs" color="fg-200" slot="iconLeft" name="copy"></wui-icon>
555
+ Copy link
556
+ </wui-link>`;
557
+ }
558
+ onCopyUri() {
559
+ try {
560
+ this.uri && (P.copyToClopboard(this.uri), v.showSuccess("Link copied"));
561
+ } catch {
562
+ v.showError("Failed to copy");
563
+ }
564
+ }
565
+ };
566
+ f.styles = G;
567
+ C([
568
+ c()
569
+ ], f.prototype, "socialProvider", void 0);
570
+ C([
571
+ c()
572
+ ], f.prototype, "uri", void 0);
573
+ C([
574
+ c()
575
+ ], f.prototype, "ready", void 0);
576
+ C([
577
+ c()
578
+ ], f.prototype, "loading", void 0);
579
+ C([
580
+ c()
581
+ ], f.prototype, "remoteFeatures", void 0);
582
+ f = C([
583
+ I("w3m-connecting-farcaster-view")
584
+ ], f);
585
+ export {
586
+ k as W3mConnectSocialsView,
587
+ f as W3mConnectingFarcasterView,
588
+ h as W3mConnectingSocialView
589
+ };
@@ -0,0 +1,17 @@
1
+ import { D as C } from "./index-ClS956E1.js";
2
+ const i = C`
3
+ <svg width="13" height="12" viewBox="0 0 13 12" fill="none" xmlns="http://www.w3.org/2000/svg">
4
+ <g clip-path="url(#clip0_24458_3940)">
5
+ <path d="M6.49987 12C9.81351 12 12.4997 9.31371 12.4997 6C12.4997 2.68629 9.81351 0 6.49987 0C3.18623 0 0.5 2.68629 0.5 6C0.5 9.31371 3.18623 12 6.49987 12Z" fill="var(--wui-color-gray-glass-005)"/>
6
+ <path d="M9.89298 7.73057L8.76102 8.91828C8.73642 8.94408 8.70664 8.96465 8.67356 8.97871C8.64047 8.99277 8.60478 9.00002 8.56872 9H3.2027C3.1771 9 3.15205 8.99268 3.13064 8.97895C3.10923 8.96521 3.09239 8.94565 3.08218 8.92268C3.07197 8.8997 3.06885 8.87431 3.07319 8.84963C3.07753 8.82494 3.08915 8.80203 3.10662 8.78371L4.23943 7.596C4.26397 7.57027 4.29365 7.54974 4.32662 7.53569C4.3596 7.52163 4.39518 7.51435 4.43115 7.51428H9.79688C9.82248 7.51428 9.84752 7.52161 9.86895 7.53534C9.89033 7.54908 9.90717 7.56864 9.91742 7.59161C9.92761 7.61459 9.93073 7.63997 9.92638 7.66466C9.92204 7.68935 9.91043 7.71226 9.89298 7.73057ZM8.76102 5.33885C8.73642 5.31305 8.70664 5.29248 8.67356 5.27843C8.64047 5.26437 8.60478 5.25713 8.56872 5.25715H3.2027C3.1771 5.25715 3.15205 5.26446 3.13064 5.2782C3.10923 5.29194 3.09239 5.31149 3.08218 5.33446C3.07197 5.35744 3.06885 5.38283 3.07319 5.40752C3.07753 5.4322 3.08915 5.45511 3.10662 5.47343L4.23943 6.66115C4.26397 6.68688 4.29365 6.7074 4.32662 6.72146C4.3596 6.73551 4.39518 6.7428 4.43115 6.74285H9.79688C9.82248 6.74285 9.84752 6.73554 9.86895 6.7218C9.89033 6.70806 9.90717 6.68851 9.91742 6.66554C9.92761 6.64256 9.93073 6.61717 9.92638 6.59248C9.92204 6.5678 9.91043 6.54489 9.89298 6.52657L8.76102 5.33885ZM3.2027 4.48572H8.56872C8.60478 4.48573 8.64047 4.47849 8.67356 4.46443C8.70664 4.45037 8.73642 4.4298 8.76102 4.404L9.89298 3.21629C9.91043 3.19797 9.92204 3.17506 9.92638 3.15037C9.93073 3.12569 9.92761 3.1003 9.91742 3.07732C9.90717 3.05435 9.89033 3.03479 9.86895 3.02106C9.84752 3.00732 9.82248 3 9.79688 3H4.43115C4.39518 3.00006 4.3596 3.00734 4.32662 3.0214C4.29365 3.03545 4.26397 3.05598 4.23943 3.08171L3.10691 4.26943C3.08946 4.28772 3.07785 4.31061 3.0735 4.33527C3.06914 4.35993 3.07224 4.3853 3.08241 4.40826C3.09258 4.43122 3.10938 4.45078 3.13075 4.46454C3.15212 4.4783 3.17712 4.48565 3.2027 4.48572Z" fill="var(--wui-color-gray-glass-090)"/>
7
+ </g>
8
+ <defs>
9
+ <clipPath id="clip0_24458_3940">
10
+ <rect width="11.9997" height="12" fill="white" transform="translate(0.5)"/>
11
+ </clipPath>
12
+ </defs>
13
+ </svg>
14
+ `;
15
+ export {
16
+ i as solanaSvg
17
+ };
@@ -0,0 +1,12 @@
1
+ import { D as l } from "./index-ClS956E1.js";
2
+ const o = l`<svg fill="none" viewBox="0 0 20 20">
3
+ <path
4
+ fill="currentColor"
5
+ fill-rule="evenodd"
6
+ d="M6.76.3a1 1 0 0 1 0 1.4L4.07 4.4h9a1 1 0 1 1 0 2h-9l2.69 2.68a1 1 0 1 1-1.42 1.42L.95 6.09a1 1 0 0 1 0-1.4l4.4-4.4a1 1 0 0 1 1.4 0Zm6.49 9.21a1 1 0 0 1 1.41 0l4.39 4.4a1 1 0 0 1 0 1.4l-4.39 4.4a1 1 0 0 1-1.41-1.42l2.68-2.68h-9a1 1 0 0 1 0-2h9l-2.68-2.68a1 1 0 0 1 0-1.42Z"
7
+ clip-rule="evenodd"
8
+ />
9
+ </svg>`;
10
+ export {
11
+ o as swapHorizontalSvg
12
+ };
@@ -0,0 +1,12 @@
1
+ import { D as C } from "./index-ClS956E1.js";
2
+ const e = C`<svg width="10" height="10" viewBox="0 0 10 10">
3
+ <path
4
+ fill="currentColor"
5
+ fill-rule="evenodd"
6
+ d="M3.77986 0.566631C4.0589 0.845577 4.0589 1.29784 3.77986 1.57678L3.08261 2.2738H6.34184C6.73647 2.2738 7.05637 2.5936 7.05637 2.98808C7.05637 3.38257 6.73647 3.70237 6.34184 3.70237H3.08261L3.77986 4.39938C4.0589 4.67833 4.0589 5.13059 3.77986 5.40954C3.50082 5.68848 3.04841 5.68848 2.76937 5.40954L0.852346 3.49316C0.573306 3.21421 0.573306 2.76195 0.852346 2.48301L2.76937 0.566631C3.04841 0.287685 3.50082 0.287685 3.77986 0.566631ZM6.22 4.59102C6.49904 4.31208 6.95145 4.31208 7.23049 4.59102L9.14751 6.5074C9.42655 6.78634 9.42655 7.23861 9.14751 7.51755L7.23049 9.43393C6.95145 9.71287 6.49904 9.71287 6.22 9.43393C5.94096 9.15498 5.94096 8.70272 6.22 8.42377L6.91725 7.72676L3.65802 7.72676C3.26339 7.72676 2.94349 7.40696 2.94349 7.01247C2.94349 6.61798 3.26339 6.29819 3.65802 6.29819L6.91725 6.29819L6.22 5.60117C5.94096 5.32223 5.94096 4.86997 6.22 4.59102Z"
7
+ clip-rule="evenodd"
8
+ />
9
+ </svg>`;
10
+ export {
11
+ e as swapHorizontalBoldSvg
12
+ };
@@ -0,0 +1,20 @@
1
+ import { D as C } from "./index-ClS956E1.js";
2
+ const e = C`<svg
3
+ width="14"
4
+ height="14"
5
+ viewBox="0 0 14 14"
6
+ fill="none"
7
+ xmlns="http://www.w3.org/2000/svg"
8
+ >
9
+ <path
10
+ fill-rule="evenodd"
11
+ clip-rule="evenodd"
12
+ d="M13.7306 3.24213C14.0725 3.58384 14.0725 4.13786 13.7306 4.47957L10.7418 7.46737C10.4 7.80908 9.84581 7.80908 9.50399 7.46737C9.16216 7.12567 9.16216 6.57165 9.50399 6.22994L10.9986 4.73585H5.34082C4.85741 4.73585 4.46553 4.3441 4.46553 3.86085C4.46553 3.3776 4.85741 2.98585 5.34082 2.98585L10.9986 2.98585L9.50399 1.49177C9.16216 1.15006 9.16216 0.596037 9.50399 0.254328C9.84581 -0.0873803 10.4 -0.0873803 10.7418 0.254328L13.7306 3.24213ZM9.52515 10.1352C9.52515 10.6185 9.13327 11.0102 8.64986 11.0102L2.9921 11.0102L4.48669 12.5043C4.82852 12.846 4.82852 13.4001 4.48669 13.7418C4.14487 14.0835 3.59066 14.0835 3.24884 13.7418L0.26003 10.754C0.0958806 10.5899 0.0036621 10.3673 0.00366211 10.1352C0.00366212 9.90318 0.0958806 9.68062 0.26003 9.51652L3.24884 6.52872C3.59066 6.18701 4.14487 6.18701 4.48669 6.52872C4.82851 6.87043 4.82851 7.42445 4.48669 7.76616L2.9921 9.26024L8.64986 9.26024C9.13327 9.26024 9.52515 9.65199 9.52515 10.1352Z"
13
+ fill="currentColor"
14
+ />
15
+ </svg>
16
+
17
+ `;
18
+ export {
19
+ e as swapHorizontalMediumSvg
20
+ };
@@ -0,0 +1,12 @@
1
+ import { D as C } from "./index-ClS956E1.js";
2
+ const L = C`<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 20 20" fill="none">
3
+ <path
4
+ fill="currentColor"
5
+ fill-rule="evenodd"
6
+ clip-rule="evenodd"
7
+ d="M8.3071 0.292893C8.69763 0.683417 8.69763 1.31658 8.3071 1.70711L6.41421 3.6H11.3404C13.8368 3.6 16.0533 5.1975 16.8427 7.56588L16.9487 7.88377C17.1233 8.40772 16.8402 8.97404 16.3162 9.14868C15.7923 9.32333 15.226 9.04017 15.0513 8.51623L14.9453 8.19834C14.4281 6.64664 12.976 5.6 11.3404 5.6H6.41421L8.3071 7.49289C8.69763 7.88342 8.69763 8.51658 8.3071 8.90711C7.91658 9.29763 7.28341 9.29763 6.89289 8.90711L3.29289 5.30711C2.90236 4.91658 2.90236 4.28342 3.29289 3.89289L6.89289 0.292893C7.28341 -0.0976311 7.91658 -0.0976311 8.3071 0.292893ZM3.68377 10.8513C4.20771 10.6767 4.77403 10.9598 4.94868 11.4838L5.05464 11.8017C5.57188 13.3534 7.024 14.4 8.65964 14.4L13.5858 14.4L11.6929 12.5071C11.3024 12.1166 11.3024 11.4834 11.6929 11.0929C12.0834 10.7024 12.7166 10.7024 13.1071 11.0929L16.7071 14.6929C17.0976 15.0834 17.0976 15.7166 16.7071 16.1071L13.1071 19.7071C12.7166 20.0976 12.0834 20.0976 11.6929 19.7071C11.3024 19.3166 11.3024 18.6834 11.6929 18.2929L13.5858 16.4L8.65964 16.4C6.16314 16.4 3.94674 14.8025 3.15728 12.4341L3.05131 12.1162C2.87667 11.5923 3.15983 11.026 3.68377 10.8513Z"
8
+ />
9
+ </svg>`;
10
+ export {
11
+ L as swapHorizontalRoundedBoldSvg
12
+ };
@@ -0,0 +1,12 @@
1
+ import { D as l } from "./index-ClS956E1.js";
2
+ const e = l`<svg fill="none" viewBox="0 0 14 14">
3
+ <path
4
+ fill="currentColor"
5
+ fill-rule="evenodd"
6
+ d="M3.48 2.18a1 1 0 0 1 1.41 0l2.68 2.68a1 1 0 1 1-1.41 1.42l-.98-.98v4.56a1 1 0 0 1-2 0V5.3l-.97.98A1 1 0 0 1 .79 4.86l2.69-2.68Zm6.34 2.93a1 1 0 0 1 1 1v4.56l.97-.98a1 1 0 1 1 1.42 1.42l-2.69 2.68a1 1 0 0 1-1.41 0l-2.68-2.68a1 1 0 0 1 1.41-1.42l.98.98V6.1a1 1 0 0 1 1-1Z"
7
+ clip-rule="evenodd"
8
+ />
9
+ </svg>`;
10
+ export {
11
+ e as swapVerticalSvg
12
+ };