@directcryptopay/sdk 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (141) hide show
  1. package/README.md +357 -0
  2. package/dist/ConstantsUtil-B-_-u8aQ.js +6 -0
  3. package/dist/add-KF4m4jFK.js +19 -0
  4. package/dist/all-wallets-D6NAjQgX.js +10 -0
  5. package/dist/app-store-D7TTn-EO.js +21 -0
  6. package/dist/apple-DjX2E2hE.js +22 -0
  7. package/dist/arrow-bottom-C0YrNJYB.js +12 -0
  8. package/dist/arrow-bottom-circle-Dlxvx_XG.js +15 -0
  9. package/dist/arrow-left-x8_-lUyK.js +12 -0
  10. package/dist/arrow-right-BTZybj80.js +12 -0
  11. package/dist/arrow-top-LzH7iLCp.js +12 -0
  12. package/dist/bank-23jp-IV_.js +18 -0
  13. package/dist/browser-EjoorDid.js +18 -0
  14. package/dist/card-DGgWwtwC.js +18 -0
  15. package/dist/ccip-BMANewTU.js +150 -0
  16. package/dist/checkmark-B1qcQhBo.js +15 -0
  17. package/dist/checkmark-bold-Cyc4IEEJ.js +12 -0
  18. package/dist/chevron-bottom-ClHs08rB.js +12 -0
  19. package/dist/chevron-left-O8h_551_.js +12 -0
  20. package/dist/chevron-right-DP3xpyIA.js +12 -0
  21. package/dist/chevron-top-CuwkBUs9.js +12 -0
  22. package/dist/chrome-store-zfT_aJ3R.js +65 -0
  23. package/dist/clock-DHZqivIS.js +12 -0
  24. package/dist/close-Cp9rNAw4.js +12 -0
  25. package/dist/coinPlaceholder-U7-T1KKQ.js +12 -0
  26. package/dist/compass-Ds5-PRSR.js +12 -0
  27. package/dist/copy-Jg4HdIMf.js +19 -0
  28. package/dist/core/api.d.ts +30 -0
  29. package/dist/core/config.d.ts +59 -0
  30. package/dist/core/logic.d.ts +2 -0
  31. package/dist/core/wallet.d.ts +34 -0
  32. package/dist/cursor-DmMevduB.js +7 -0
  33. package/dist/cursor-transparent-Dn9-1SV8.js +16 -0
  34. package/dist/dcp-sdk.umd.js +12000 -0
  35. package/dist/dcp.d.ts +10 -0
  36. package/dist/desktop-C4udXXlZ.js +13 -0
  37. package/dist/disconnect-wd1BYLxt.js +12 -0
  38. package/dist/discord-DthxuCAP.js +21 -0
  39. package/dist/email-B3jSnUFE.js +696 -0
  40. package/dist/embedded-wallet-CJHmoBI2.js +468 -0
  41. package/dist/etherscan-Cjp4xfMW.js +10 -0
  42. package/dist/exclamation-triangle-CRNR5WOy.js +8 -0
  43. package/dist/extension-Cydk0mZt.js +12 -0
  44. package/dist/external-link-CuPTAoq9.js +12 -0
  45. package/dist/facebook-CghqXmdf.js +30 -0
  46. package/dist/farcaster-BREqMX4y.js +16 -0
  47. package/dist/filters-Dn_Ys7ew.js +12 -0
  48. package/dist/github-C-A7JmIY.js +22 -0
  49. package/dist/google-CCdM_naE.js +22 -0
  50. package/dist/hashTypedData-D2Qmzscs.js +197 -0
  51. package/dist/help-circle-DIH4vyj3.js +16 -0
  52. package/dist/id-DkJ0gBuy.js +16 -0
  53. package/dist/if-defined-BciplFKz.js +744 -0
  54. package/dist/image-qMjyiXM0.js +8 -0
  55. package/dist/index--3Zp0jAb.js +45 -0
  56. package/dist/index-1adX-Fit.js +65 -0
  57. package/dist/index-AvC0IGDl.js +7864 -0
  58. package/dist/index-B2-vKLd8.js +276 -0
  59. package/dist/index-B2iDt0TJ.js +146 -0
  60. package/dist/index-B5zkXsLJ.js +320 -0
  61. package/dist/index-B7K86vWu.js +1742 -0
  62. package/dist/index-BBkcvSiY.js +511 -0
  63. package/dist/index-BdjxQs66.js +181 -0
  64. package/dist/index-Bijd4_Ns.js +294 -0
  65. package/dist/index-BpXOsxzU.js +387 -0
  66. package/dist/index-C1QEJL-2.js +572 -0
  67. package/dist/index-C27dwOyE.js +243 -0
  68. package/dist/index-C4BX3QW8.js +58 -0
  69. package/dist/index-CMPIqsB1.js +170 -0
  70. package/dist/index-CTYngdl0.js +21991 -0
  71. package/dist/index-CUdQyyFn.js +51 -0
  72. package/dist/index-CX60z_g2.js +573 -0
  73. package/dist/index-CppCc1n8.js +65 -0
  74. package/dist/index-CqVegmN4.js +559 -0
  75. package/dist/index-CuiyMA8F.js +78 -0
  76. package/dist/index-CwB_qRfM.js +305 -0
  77. package/dist/index-CxOF7GqE.js +265 -0
  78. package/dist/index-D-IzHD_8.js +54 -0
  79. package/dist/index-DRNiFv9I.js +218 -0
  80. package/dist/index-Da8oZh8H.js +838 -0
  81. package/dist/index-DiHImG4L.js +44236 -0
  82. package/dist/index-DmOMXRG1.js +181 -0
  83. package/dist/index-DoSYqTQg.js +199 -0
  84. package/dist/index-DpHXq5_E.js +603 -0
  85. package/dist/index-DtCsAVBg.js +78 -0
  86. package/dist/index-Ij6XA6_4.js +77 -0
  87. package/dist/index-SzyBYfzA.js +8490 -0
  88. package/dist/index-eW8y-mXH.js +257 -0
  89. package/dist/index-fxzIDZsb.js +75 -0
  90. package/dist/index-lbhz9evJ.js +97 -0
  91. package/dist/index.d.ts +3 -0
  92. package/dist/index.js +4 -0
  93. package/dist/info-DMIGgjkL.js +7 -0
  94. package/dist/info-circle-CJuIKZSx.js +16 -0
  95. package/dist/lightbulb-qFT6WEWV.js +7 -0
  96. package/dist/localBatchGatewayRequest-CsMVMFBc.js +91 -0
  97. package/dist/mail-DoYgQvOt.js +12 -0
  98. package/dist/mobile-URtsh7o-.js +13 -0
  99. package/dist/more-DoQd10TF.js +15 -0
  100. package/dist/network-placeholder-BBA2Ue6C.js +18 -0
  101. package/dist/nftPlaceholder-C9RXWz9k.js +12 -0
  102. package/dist/off-YcuDQczT.js +12 -0
  103. package/dist/onramp-BfqDIx4o.js +1279 -0
  104. package/dist/parseSignature-280HB24T.js +3560 -0
  105. package/dist/play-store-sFaloG_r.js +36 -0
  106. package/dist/plus-l0wekSht.js +17 -0
  107. package/dist/qr-code-CihrUU4G.js +10 -0
  108. package/dist/receive-dfY1Cu-g.js +186 -0
  109. package/dist/recycle-horizontal-nXu6YaPw.js +13 -0
  110. package/dist/ref-huAzXCX0.js +41 -0
  111. package/dist/refresh-D2ZbVeNC.js +12 -0
  112. package/dist/reown-logo-BMaTMJmc.js +16 -0
  113. package/dist/search-YVM9q3J-.js +12 -0
  114. package/dist/secp256k1-BrysY3Sv.js +1302 -0
  115. package/dist/secp256k1-DPQgTBwQ.js +1510 -0
  116. package/dist/send-BwQZPKxI.js +19 -0
  117. package/dist/send-GyetMVu1.js +1038 -0
  118. package/dist/socials-B0W91J9k.js +574 -0
  119. package/dist/swapHorizontal-Dy_oQEkp.js +12 -0
  120. package/dist/swapHorizontalBold-C4JpaMpc.js +12 -0
  121. package/dist/swapHorizontalMedium-D5NuVZFh.js +20 -0
  122. package/dist/swapHorizontalRoundedBold-Bq4P2MCj.js +12 -0
  123. package/dist/swapVertical-CVQ8Mg03.js +12 -0
  124. package/dist/swaps-CA04SSdK.js +1637 -0
  125. package/dist/telegram-BP4SgW_L.js +20 -0
  126. package/dist/three-dots-BJYGJ-dQ.js +9 -0
  127. package/dist/transactions-Bq-98Tsg.js +37 -0
  128. package/dist/twitch-DTATWo9M.js +22 -0
  129. package/dist/twitterIcon-D5UWPInb.js +10 -0
  130. package/dist/types.d.ts +128 -0
  131. package/dist/ui/Modal.d.ts +9 -0
  132. package/dist/ui/index.d.ts +6 -0
  133. package/dist/verify-Byvj8Wi1.js +12 -0
  134. package/dist/verify-filled-B40taNm0.js +12 -0
  135. package/dist/w3m-modal-HV6SE74G.js +1037 -0
  136. package/dist/wallet-Cp-6Kk88.js +12 -0
  137. package/dist/wallet-placeholder-C3juwA9o.js +18 -0
  138. package/dist/walletconnect-CRkIiLCx.js +36 -0
  139. package/dist/warning-circle-DtvCLwG4.js +16 -0
  140. package/dist/x-Cqyx5eCt.js +16 -0
  141. package/package.json +70 -0
@@ -0,0 +1,574 @@
1
+ import { cz as E, cA as L, d7 as S, dd as b, cE as g, d6 as A, cB as c, cY as C, dp as F, d4 as D, cS as d, cF as j, cT as _, d3 as u, d1 as T, d9 as U, cU as y, dq as q, cN as I, cW as P } from "./index-DiHImG4L.js";
2
+ import { n as z, r as l, c as k, o as v } from "./if-defined-BciplFKz.js";
3
+ import { O as R } from "./index-CwB_qRfM.js";
4
+ import { e as N } from "./index-DmOMXRG1.js";
5
+ import "./index-fxzIDZsb.js";
6
+ import "./index-CppCc1n8.js";
7
+ import "./index-Bijd4_Ns.js";
8
+ import "./index-D-IzHD_8.js";
9
+ import "./index-B7K86vWu.js";
10
+ import "./index-Ij6XA6_4.js";
11
+ const M = E`
12
+ :host {
13
+ margin-top: var(--wui-spacing-3xs);
14
+ }
15
+ wui-separator {
16
+ margin: var(--wui-spacing-m) calc(var(--wui-spacing-m) * -1) var(--wui-spacing-xs)
17
+ calc(var(--wui-spacing-m) * -1);
18
+ width: calc(100% + var(--wui-spacing-s) * 2);
19
+ }
20
+ `;
21
+ var f = function(s, e, i, o) {
22
+ var n = arguments.length, t = n < 3 ? e : o === null ? o = Object.getOwnPropertyDescriptor(e, i) : o, r;
23
+ if (typeof Reflect == "object" && typeof Reflect.decorate == "function") t = Reflect.decorate(s, e, i, o);
24
+ else for (var a = s.length - 1; a >= 0; a--) (r = s[a]) && (t = (n < 3 ? r(t) : n > 3 ? r(e, i, t) : r(e, i)) || t);
25
+ return n > 3 && t && Object.defineProperty(e, i, t), t;
26
+ };
27
+ let h = class extends L {
28
+ constructor() {
29
+ super(), this.unsubscribe = [], this.tabIdx = void 0, this.connectors = S.state.connectors, this.authConnector = this.connectors.find((e) => e.type === "AUTH"), this.remoteFeatures = b.state.remoteFeatures, this.isPwaLoading = !1, this.unsubscribe.push(S.subscribeKey("connectors", (e) => {
30
+ this.connectors = e, this.authConnector = this.connectors.find((i) => i.type === "AUTH");
31
+ }), b.subscribeKey("remoteFeatures", (e) => this.remoteFeatures = e));
32
+ }
33
+ connectedCallback() {
34
+ super.connectedCallback(), this.handlePwaFrameLoad();
35
+ }
36
+ disconnectedCallback() {
37
+ this.unsubscribe.forEach((e) => e());
38
+ }
39
+ render() {
40
+ var t;
41
+ let e = ((t = this.remoteFeatures) == null ? void 0 : t.socials) || [];
42
+ const i = !!this.authConnector, o = e == null ? void 0 : e.length, n = g.state.view === "ConnectSocials";
43
+ return (!i || !o) && !n ? null : (n && !o && (e = A.DEFAULT_SOCIALS), c` <wui-flex flexDirection="column" gap="xs">
44
+ ${e.map((r) => c`<wui-list-social
45
+ @click=${() => {
46
+ this.onSocialClick(r);
47
+ }}
48
+ data-testid=${`social-selector-${r}`}
49
+ name=${r}
50
+ logo=${r}
51
+ ?disabled=${this.isPwaLoading}
52
+ ></wui-list-social>`)}
53
+ </wui-flex>`);
54
+ }
55
+ async onSocialClick(e) {
56
+ e && await N(e);
57
+ }
58
+ async handlePwaFrameLoad() {
59
+ var e;
60
+ if (C.isPWA()) {
61
+ this.isPwaLoading = !0;
62
+ try {
63
+ ((e = this.authConnector) == null ? void 0 : e.provider) instanceof F && await this.authConnector.provider.init();
64
+ } catch (i) {
65
+ D.open({
66
+ shortMessage: "Error loading embedded wallet in PWA",
67
+ longMessage: i.message
68
+ }, "error");
69
+ } finally {
70
+ this.isPwaLoading = !1;
71
+ }
72
+ }
73
+ }
74
+ };
75
+ h.styles = M;
76
+ f([
77
+ z()
78
+ ], h.prototype, "tabIdx", void 0);
79
+ f([
80
+ l()
81
+ ], h.prototype, "connectors", void 0);
82
+ f([
83
+ l()
84
+ ], h.prototype, "authConnector", void 0);
85
+ f([
86
+ l()
87
+ ], h.prototype, "remoteFeatures", void 0);
88
+ f([
89
+ l()
90
+ ], h.prototype, "isPwaLoading", void 0);
91
+ h = f([
92
+ k("w3m-social-login-list")
93
+ ], h);
94
+ const V = E`
95
+ wui-flex {
96
+ max-height: clamp(360px, 540px, 80vh);
97
+ overflow: scroll;
98
+ scrollbar-width: none;
99
+ transition: opacity var(--wui-ease-out-power-1) var(--wui-duration-md);
100
+ will-change: opacity;
101
+ }
102
+ wui-flex::-webkit-scrollbar {
103
+ display: none;
104
+ }
105
+ wui-flex.disabled {
106
+ opacity: 0.3;
107
+ pointer-events: none;
108
+ user-select: none;
109
+ }
110
+ `;
111
+ var W = function(s, e, i, o) {
112
+ var n = arguments.length, t = n < 3 ? e : o === null ? o = Object.getOwnPropertyDescriptor(e, i) : o, r;
113
+ if (typeof Reflect == "object" && typeof Reflect.decorate == "function") t = Reflect.decorate(s, e, i, o);
114
+ else for (var a = s.length - 1; a >= 0; a--) (r = s[a]) && (t = (n < 3 ? r(t) : n > 3 ? r(e, i, t) : r(e, i)) || t);
115
+ return n > 3 && t && Object.defineProperty(e, i, t), t;
116
+ };
117
+ let $ = class extends L {
118
+ constructor() {
119
+ super(), this.unsubscribe = [], this.checked = R.state.isLegalCheckboxChecked, this.unsubscribe.push(R.subscribeKey("isLegalCheckboxChecked", (e) => {
120
+ this.checked = e;
121
+ }));
122
+ }
123
+ disconnectedCallback() {
124
+ this.unsubscribe.forEach((e) => e());
125
+ }
126
+ render() {
127
+ var O;
128
+ const { termsConditionsUrl: e, privacyPolicyUrl: i } = b.state, o = (O = b.state.features) == null ? void 0 : O.legalCheckbox, t = !!(e || i) && !!o, r = t && !this.checked, a = r ? -1 : void 0;
129
+ return c`
130
+ <w3m-legal-checkbox></w3m-legal-checkbox>
131
+ <wui-flex
132
+ flexDirection="column"
133
+ .padding=${t ? ["0", "s", "s", "s"] : "s"}
134
+ gap="xs"
135
+ class=${v(r ? "disabled" : void 0)}
136
+ >
137
+ <w3m-social-login-list tabIdx=${v(a)}></w3m-social-login-list>
138
+ </wui-flex>
139
+ <w3m-legal-footer></w3m-legal-footer>
140
+ `;
141
+ }
142
+ };
143
+ $.styles = V;
144
+ W([
145
+ l()
146
+ ], $.prototype, "checked", void 0);
147
+ $ = W([
148
+ k("w3m-connect-socials-view")
149
+ ], $);
150
+ const G = E`
151
+ wui-logo {
152
+ width: 80px;
153
+ height: 80px;
154
+ border-radius: var(--wui-border-radius-m);
155
+ }
156
+ @keyframes shake {
157
+ 0% {
158
+ transform: translateX(0);
159
+ }
160
+ 25% {
161
+ transform: translateX(3px);
162
+ }
163
+ 50% {
164
+ transform: translateX(-3px);
165
+ }
166
+ 75% {
167
+ transform: translateX(3px);
168
+ }
169
+ 100% {
170
+ transform: translateX(0);
171
+ }
172
+ }
173
+ wui-flex:first-child:not(:only-child) {
174
+ position: relative;
175
+ }
176
+ wui-loading-thumbnail {
177
+ position: absolute;
178
+ }
179
+ wui-icon-box {
180
+ position: absolute;
181
+ right: calc(var(--wui-spacing-3xs) * -1);
182
+ bottom: calc(var(--wui-spacing-3xs) * -1);
183
+ opacity: 0;
184
+ transform: scale(0.5);
185
+ transition: all var(--wui-ease-out-power-2) var(--wui-duration-lg);
186
+ }
187
+ wui-text[align='center'] {
188
+ width: 100%;
189
+ padding: 0px var(--wui-spacing-l);
190
+ }
191
+ [data-error='true'] wui-icon-box {
192
+ opacity: 1;
193
+ transform: scale(1);
194
+ }
195
+ [data-error='true'] > wui-flex:first-child {
196
+ animation: shake 250ms cubic-bezier(0.36, 0.07, 0.19, 0.97) both;
197
+ }
198
+ .capitalize {
199
+ text-transform: capitalize;
200
+ }
201
+ `;
202
+ var m = function(s, e, i, o) {
203
+ var n = arguments.length, t = n < 3 ? e : o === null ? o = Object.getOwnPropertyDescriptor(e, i) : o, r;
204
+ if (typeof Reflect == "object" && typeof Reflect.decorate == "function") t = Reflect.decorate(s, e, i, o);
205
+ else for (var a = s.length - 1; a >= 0; a--) (r = s[a]) && (t = (n < 3 ? r(t) : n > 3 ? r(e, i, t) : r(e, i)) || t);
206
+ return n > 3 && t && Object.defineProperty(e, i, t), t;
207
+ };
208
+ let p = class extends L {
209
+ constructor() {
210
+ 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.authConnector = S.getAuthConnector(), this.handleSocialConnection = async (i) => {
211
+ var o;
212
+ if ((o = i.data) != null && o.resultUri)
213
+ if (i.origin === j.SECURE_SITE_ORIGIN) {
214
+ window.removeEventListener("message", this.handleSocialConnection, !1);
215
+ try {
216
+ if (this.authConnector && !this.connecting) {
217
+ this.socialWindow && (this.socialWindow.close(), d.setSocialWindow(void 0, _.state.activeChain)), this.connecting = !0, this.updateMessage();
218
+ const n = i.data.resultUri;
219
+ this.socialProvider && u.sendEvent({
220
+ type: "track",
221
+ event: "SOCIAL_LOGIN_REQUEST_USER_DATA",
222
+ properties: { provider: this.socialProvider }
223
+ }), await T.connectExternal({
224
+ id: this.authConnector.id,
225
+ type: this.authConnector.type,
226
+ socialUri: n
227
+ }, this.authConnector.chain), this.socialProvider && (U.setConnectedSocialProvider(this.socialProvider), u.sendEvent({
228
+ type: "track",
229
+ event: "SOCIAL_LOGIN_SUCCESS",
230
+ properties: { provider: this.socialProvider }
231
+ }));
232
+ }
233
+ } catch {
234
+ this.error = !0, this.updateMessage(), this.socialProvider && u.sendEvent({
235
+ type: "track",
236
+ event: "SOCIAL_LOGIN_ERROR",
237
+ properties: { provider: this.socialProvider }
238
+ });
239
+ }
240
+ } else
241
+ g.goBack(), y.showError("Untrusted Origin"), this.socialProvider && u.sendEvent({
242
+ type: "track",
243
+ event: "SOCIAL_LOGIN_ERROR",
244
+ properties: { provider: this.socialProvider }
245
+ });
246
+ }, q.EmbeddedWalletAbortController.signal.addEventListener("abort", () => {
247
+ this.socialWindow && (this.socialWindow.close(), d.setSocialWindow(void 0, _.state.activeChain));
248
+ }), this.unsubscribe.push(d.subscribe((i) => {
249
+ i.socialProvider && (this.socialProvider = i.socialProvider), i.socialWindow && (this.socialWindow = i.socialWindow), i.address && (I.state.open || b.state.enableEmbedded) && I.close();
250
+ })), this.authConnector && this.connectSocial();
251
+ }
252
+ disconnectedCallback() {
253
+ var e;
254
+ this.unsubscribe.forEach((i) => i()), window.removeEventListener("message", this.handleSocialConnection, !1), (e = this.socialWindow) == null || e.close(), d.setSocialWindow(void 0, _.state.activeChain);
255
+ }
256
+ render() {
257
+ return c`
258
+ <wui-flex
259
+ data-error=${v(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=${v(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 = P.state.themeVariables["--w3m-border-radius-master"], i = e ? parseInt(e.replace("px", ""), 10) : 4;
292
+ return c`<wui-loading-thumbnail radius=${i * 9}></wui-loading-thumbnail>`;
293
+ }
294
+ connectSocial() {
295
+ const e = setInterval(() => {
296
+ var i;
297
+ (i = this.socialWindow) != null && i.closed && (!this.connecting && g.state.view === "ConnectingSocial" && (this.socialProvider && u.sendEvent({
298
+ type: "track",
299
+ event: "SOCIAL_LOGIN_CANCELED",
300
+ properties: { provider: this.socialProvider }
301
+ }), g.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
+ p.styles = G;
310
+ m([
311
+ l()
312
+ ], p.prototype, "socialProvider", void 0);
313
+ m([
314
+ l()
315
+ ], p.prototype, "socialWindow", void 0);
316
+ m([
317
+ l()
318
+ ], p.prototype, "error", void 0);
319
+ m([
320
+ l()
321
+ ], p.prototype, "connecting", void 0);
322
+ m([
323
+ l()
324
+ ], p.prototype, "message", void 0);
325
+ p = m([
326
+ k("w3m-connecting-social-view")
327
+ ], p);
328
+ const B = E`
329
+ @keyframes fadein {
330
+ from {
331
+ opacity: 0;
332
+ }
333
+ to {
334
+ opacity: 1;
335
+ }
336
+ }
337
+
338
+ wui-shimmer {
339
+ width: 100%;
340
+ aspect-ratio: 1 / 1;
341
+ border-radius: clamp(0px, var(--wui-border-radius-l), 40px) !important;
342
+ }
343
+
344
+ wui-qr-code {
345
+ opacity: 0;
346
+ animation-duration: 200ms;
347
+ animation-timing-function: ease;
348
+ animation-name: fadein;
349
+ animation-fill-mode: forwards;
350
+ }
351
+
352
+ wui-logo {
353
+ width: 80px;
354
+ height: 80px;
355
+ border-radius: var(--wui-border-radius-m);
356
+ }
357
+
358
+ wui-flex:first-child:not(:only-child) {
359
+ position: relative;
360
+ }
361
+ wui-loading-thumbnail {
362
+ position: absolute;
363
+ }
364
+ wui-icon-box {
365
+ position: absolute;
366
+ right: calc(var(--wui-spacing-3xs) * -1);
367
+ bottom: calc(var(--wui-spacing-3xs) * -1);
368
+ opacity: 0;
369
+ transform: scale(0.5);
370
+ transition: all var(--wui-ease-out-power-2) var(--wui-duration-lg);
371
+ }
372
+ `;
373
+ var x = function(s, e, i, o) {
374
+ var n = arguments.length, t = n < 3 ? e : o === null ? o = Object.getOwnPropertyDescriptor(e, i) : o, r;
375
+ if (typeof Reflect == "object" && typeof Reflect.decorate == "function") t = Reflect.decorate(s, e, i, o);
376
+ else for (var a = s.length - 1; a >= 0; a--) (r = s[a]) && (t = (n < 3 ? r(t) : n > 3 ? r(e, i, t) : r(e, i)) || t);
377
+ return n > 3 && t && Object.defineProperty(e, i, t), t;
378
+ };
379
+ let w = class extends L {
380
+ constructor() {
381
+ super(), this.unsubscribe = [], this.timeout = void 0, this.socialProvider = d.state.socialProvider, this.uri = d.state.farcasterUrl, this.ready = !1, this.loading = !1, this.authConnector = S.getAuthConnector(), this.forceUpdate = () => {
382
+ this.requestUpdate();
383
+ }, this.unsubscribe.push(d.subscribeKey("farcasterUrl", (e) => {
384
+ e && (this.uri = e, this.connectFarcaster());
385
+ }), d.subscribeKey("socialProvider", (e) => {
386
+ e && (this.socialProvider = e);
387
+ })), window.addEventListener("resize", this.forceUpdate);
388
+ }
389
+ disconnectedCallback() {
390
+ super.disconnectedCallback(), clearTimeout(this.timeout), window.removeEventListener("resize", this.forceUpdate);
391
+ }
392
+ render() {
393
+ return this.onRenderProxy(), c`${this.platformTemplate()}`;
394
+ }
395
+ platformTemplate() {
396
+ return C.isMobile() ? c`${this.mobileTemplate()}` : c`${this.desktopTemplate()}`;
397
+ }
398
+ desktopTemplate() {
399
+ return this.loading ? c`${this.loadingTemplate()}` : c`${this.qrTemplate()}`;
400
+ }
401
+ qrTemplate() {
402
+ return c` <wui-flex
403
+ flexDirection="column"
404
+ alignItems="center"
405
+ .padding=${["0", "xl", "xl", "xl"]}
406
+ gap="xl"
407
+ >
408
+ <wui-shimmer borderRadius="l" width="100%"> ${this.qrCodeTemplate()} </wui-shimmer>
409
+
410
+ <wui-text variant="paragraph-500" color="fg-100">
411
+ Scan this QR Code with your phone
412
+ </wui-text>
413
+ ${this.copyTemplate()}
414
+ </wui-flex>`;
415
+ }
416
+ loadingTemplate() {
417
+ return c`
418
+ <wui-flex
419
+ flexDirection="column"
420
+ alignItems="center"
421
+ .padding=${["xl", "xl", "xl", "xl"]}
422
+ gap="xl"
423
+ >
424
+ <wui-flex justifyContent="center" alignItems="center">
425
+ <wui-logo logo="farcaster"></wui-logo>
426
+ ${this.loaderTemplate()}
427
+ <wui-icon-box
428
+ backgroundColor="error-100"
429
+ background="opaque"
430
+ iconColor="error-100"
431
+ icon="close"
432
+ size="sm"
433
+ border
434
+ borderColor="wui-color-bg-125"
435
+ ></wui-icon-box>
436
+ </wui-flex>
437
+ <wui-flex flexDirection="column" alignItems="center" gap="xs">
438
+ <wui-text align="center" variant="paragraph-500" color="fg-100">
439
+ Loading user data
440
+ </wui-text>
441
+ <wui-text align="center" variant="small-400" color="fg-200">
442
+ Please wait a moment while we load your data.
443
+ </wui-text>
444
+ </wui-flex>
445
+ </wui-flex>
446
+ `;
447
+ }
448
+ mobileTemplate() {
449
+ return c` <wui-flex
450
+ flexDirection="column"
451
+ alignItems="center"
452
+ .padding=${["3xl", "xl", "xl", "xl"]}
453
+ gap="xl"
454
+ >
455
+ <wui-flex justifyContent="center" alignItems="center">
456
+ <wui-logo logo="farcaster"></wui-logo>
457
+ ${this.loaderTemplate()}
458
+ <wui-icon-box
459
+ backgroundColor="error-100"
460
+ background="opaque"
461
+ iconColor="error-100"
462
+ icon="close"
463
+ size="sm"
464
+ border
465
+ borderColor="wui-color-bg-125"
466
+ ></wui-icon-box>
467
+ </wui-flex>
468
+ <wui-flex flexDirection="column" alignItems="center" gap="xs">
469
+ <wui-text align="center" variant="paragraph-500" color="fg-100"
470
+ >Continue in Farcaster</span></wui-text
471
+ >
472
+ <wui-text align="center" variant="small-400" color="fg-200"
473
+ >Accept connection request in the app</wui-text
474
+ ></wui-flex
475
+ >
476
+ ${this.mobileLinkTemplate()}
477
+ </wui-flex>`;
478
+ }
479
+ loaderTemplate() {
480
+ const e = P.state.themeVariables["--w3m-border-radius-master"], i = e ? parseInt(e.replace("px", ""), 10) : 4;
481
+ return c`<wui-loading-thumbnail radius=${i * 9}></wui-loading-thumbnail>`;
482
+ }
483
+ async connectFarcaster() {
484
+ var e;
485
+ if (this.authConnector)
486
+ try {
487
+ await ((e = this.authConnector) == null ? void 0 : e.provider.connectFarcaster()), this.socialProvider && (U.setConnectedSocialProvider(this.socialProvider), u.sendEvent({
488
+ type: "track",
489
+ event: "SOCIAL_LOGIN_REQUEST_USER_DATA",
490
+ properties: { provider: this.socialProvider }
491
+ })), this.loading = !0, await T.connectExternal(this.authConnector, this.authConnector.chain), this.socialProvider && u.sendEvent({
492
+ type: "track",
493
+ event: "SOCIAL_LOGIN_SUCCESS",
494
+ properties: { provider: this.socialProvider }
495
+ }), this.loading = !1, I.close();
496
+ } catch (i) {
497
+ this.socialProvider && u.sendEvent({
498
+ type: "track",
499
+ event: "SOCIAL_LOGIN_ERROR",
500
+ properties: { provider: this.socialProvider }
501
+ }), g.goBack(), y.showError(i);
502
+ }
503
+ }
504
+ mobileLinkTemplate() {
505
+ return c`<wui-button
506
+ size="md"
507
+ ?loading=${this.loading}
508
+ ?disabled=${!this.uri || this.loading}
509
+ @click=${() => {
510
+ this.uri && C.openHref(this.uri, "_blank");
511
+ }}
512
+ >
513
+ Open farcaster</wui-button
514
+ >`;
515
+ }
516
+ onRenderProxy() {
517
+ !this.ready && this.uri && (this.timeout = setTimeout(() => {
518
+ this.ready = !0;
519
+ }, 200));
520
+ }
521
+ qrCodeTemplate() {
522
+ if (!this.uri || !this.ready)
523
+ return null;
524
+ const e = this.getBoundingClientRect().width - 40;
525
+ return c` <wui-qr-code
526
+ size=${e}
527
+ theme=${P.state.themeMode}
528
+ uri=${this.uri}
529
+ ?farcaster=${!0}
530
+ data-testid="wui-qr-code"
531
+ color=${v(P.state.themeVariables["--w3m-qr-color"])}
532
+ ></wui-qr-code>`;
533
+ }
534
+ copyTemplate() {
535
+ const e = !this.uri || !this.ready;
536
+ return c`<wui-link
537
+ .disabled=${e}
538
+ @click=${this.onCopyUri}
539
+ color="fg-200"
540
+ data-testid="copy-wc2-uri"
541
+ >
542
+ <wui-icon size="xs" color="fg-200" slot="iconLeft" name="copy"></wui-icon>
543
+ Copy link
544
+ </wui-link>`;
545
+ }
546
+ onCopyUri() {
547
+ try {
548
+ this.uri && (C.copyToClopboard(this.uri), y.showSuccess("Link copied"));
549
+ } catch {
550
+ y.showError("Failed to copy");
551
+ }
552
+ }
553
+ };
554
+ w.styles = B;
555
+ x([
556
+ l()
557
+ ], w.prototype, "socialProvider", void 0);
558
+ x([
559
+ l()
560
+ ], w.prototype, "uri", void 0);
561
+ x([
562
+ l()
563
+ ], w.prototype, "ready", void 0);
564
+ x([
565
+ l()
566
+ ], w.prototype, "loading", void 0);
567
+ w = x([
568
+ k("w3m-connecting-farcaster-view")
569
+ ], w);
570
+ export {
571
+ $ as W3mConnectSocialsView,
572
+ w as W3mConnectingFarcasterView,
573
+ p as W3mConnectingSocialView
574
+ };
@@ -0,0 +1,12 @@
1
+ import { cy as l } from "./index-DiHImG4L.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 { cy as C } from "./index-DiHImG4L.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 { cy as C } from "./index-DiHImG4L.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 { cy as C } from "./index-DiHImG4L.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 { cy as l } from "./index-DiHImG4L.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
+ };