@lnfi-network/nodeflow-sdk 1.0.0-alpha.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 (106) hide show
  1. package/README.md +276 -0
  2. package/dist/SwapController-C-2g6oSP.js +447 -0
  3. package/dist/add-DDBnz1-Q.js +19 -0
  4. package/dist/all-wallets-XTwjZKGg.js +10 -0
  5. package/dist/app-store-sCzhkWOo.js +21 -0
  6. package/dist/apple-C4IG4u61.js +22 -0
  7. package/dist/arrow-bottom-D5KjiSxX.js +12 -0
  8. package/dist/arrow-bottom-circle-BwWTHJky.js +15 -0
  9. package/dist/arrow-left-hn1Ftfvb.js +12 -0
  10. package/dist/arrow-right-CkV03q5Q.js +12 -0
  11. package/dist/arrow-top-BFm9X5g1.js +12 -0
  12. package/dist/bank-BUCrVHdo.js +18 -0
  13. package/dist/bin-BKleaahE.js +8 -0
  14. package/dist/bitcoin-C7iWQVuy.js +17 -0
  15. package/dist/browser-CpOtTIku.js +18 -0
  16. package/dist/build-info.json +1 -0
  17. package/dist/card-CJ3tg2Ri.js +18 -0
  18. package/dist/ccip-DyUNuvL1.js +239 -0
  19. package/dist/checkmark-CvSC6zeV.js +15 -0
  20. package/dist/checkmark-bold-DyZJqlJ7.js +12 -0
  21. package/dist/chevron-bottom-T9v1OvPA.js +12 -0
  22. package/dist/chevron-left-B4I8A8BR.js +12 -0
  23. package/dist/chevron-right-DGcVStvL.js +12 -0
  24. package/dist/chevron-top-BtD7BPVB.js +12 -0
  25. package/dist/chrome-store-BTKxY14m.js +65 -0
  26. package/dist/circle-DLLZtCBf.js +8 -0
  27. package/dist/clock-BNIDUPYZ.js +12 -0
  28. package/dist/close-BscNWH3j.js +12 -0
  29. package/dist/coinPlaceholder-JCYCAADZ.js +12 -0
  30. package/dist/compass-D7B-kHmZ.js +12 -0
  31. package/dist/copy-DHBc9gJO.js +19 -0
  32. package/dist/cursor-DKduK293.js +7 -0
  33. package/dist/cursor-transparent-8DkjrHTm.js +16 -0
  34. package/dist/desktop-ChlWl7Ma.js +13 -0
  35. package/dist/disconnect-CML_GEin.js +12 -0
  36. package/dist/discord-CgAM6i7H.js +21 -0
  37. package/dist/email-8mepCwp-.js +10 -0
  38. package/dist/embedded-wallet-scU49N5X.js +464 -0
  39. package/dist/ethereum-CA-_7cWX.js +14 -0
  40. package/dist/etherscan-B4h2i8Uc.js +10 -0
  41. package/dist/exclamation-triangle-ftOWMqSf.js +8 -0
  42. package/dist/extension-7iqlSonF.js +12 -0
  43. package/dist/external-link-DAvuMfW6.js +12 -0
  44. package/dist/facebook-CsyBIxMB.js +30 -0
  45. package/dist/farcaster-DfetCk1r.js +16 -0
  46. package/dist/filters-CsU-LYSd.js +12 -0
  47. package/dist/font/ClashDisplay-Variable.ttf +0 -0
  48. package/dist/font/ClashDisplay-Variable.woff +0 -0
  49. package/dist/font/ClashDisplay-Variable.woff2 +0 -0
  50. package/dist/github-DjxwfOOF.js +22 -0
  51. package/dist/google--g4VSi6h.js +22 -0
  52. package/dist/help-circle-BPA985E7.js +16 -0
  53. package/dist/id-BCUBMri8.js +16 -0
  54. package/dist/image-gYCDO7su.js +8 -0
  55. package/dist/index-B9q3HG5u.js +709 -0
  56. package/dist/index-BEm1bPeX.js +63547 -0
  57. package/dist/index-CCgAY-U4.js +70 -0
  58. package/dist/index-CRbuhHbe.js +33 -0
  59. package/dist/index-DYL5OPkx.js +1060 -0
  60. package/dist/info-CIaFQJ_e.js +7 -0
  61. package/dist/info-circle-BPz5hFQa.js +16 -0
  62. package/dist/lightbulb-BDmHvdbq.js +7 -0
  63. package/dist/mail-DQiXQ-4_.js +12 -0
  64. package/dist/mobile-CG_8sNWZ.js +13 -0
  65. package/dist/more-B1H_I3-I.js +15 -0
  66. package/dist/network-placeholder-1RWeD7Yp.js +18 -0
  67. package/dist/nftPlaceholder-Cg-f-eaw.js +12 -0
  68. package/dist/nodeflow-sdk.es.js +15 -0
  69. package/dist/off-DB-2L-AT.js +8 -0
  70. package/dist/onramp-DI5eQmAC.js +917 -0
  71. package/dist/play-store-DKJRWbqp.js +36 -0
  72. package/dist/plus-By1Ef8nV.js +17 -0
  73. package/dist/qr-code-DGuZgP-9.js +10 -0
  74. package/dist/receive-BEsZr88v.js +179 -0
  75. package/dist/recycle-horizontal-DubwRDbc.js +13 -0
  76. package/dist/refresh-Dwfvwy6t.js +12 -0
  77. package/dist/reown-logo-oDEjOrqY.js +16 -0
  78. package/dist/search-DX_QdW9h.js +12 -0
  79. package/dist/send-Bd5bwLNJ.js +1039 -0
  80. package/dist/send-Dq4B7ftm.js +19 -0
  81. package/dist/socials-BnnwB5_t.js +589 -0
  82. package/dist/solana-B7Ds9KBT.js +17 -0
  83. package/dist/swapHorizontal-CF6_7qU-.js +12 -0
  84. package/dist/swapHorizontalBold-C-YFgVbc.js +12 -0
  85. package/dist/swapHorizontalMedium-BGOdc8_e.js +20 -0
  86. package/dist/swapHorizontalRoundedBold-D_vYgwwO.js +12 -0
  87. package/dist/swapVertical-j2pWqia1.js +12 -0
  88. package/dist/swaps-Bh2kuHjL.js +1713 -0
  89. package/dist/telegram-bh_htnzP.js +20 -0
  90. package/dist/three-dots-B31D_Ocu.js +9 -0
  91. package/dist/transactions-Ch56TR3p.js +35 -0
  92. package/dist/twitch-DUloatpE.js +22 -0
  93. package/dist/twitterIcon-CNo6b91J.js +10 -0
  94. package/dist/ui-C7PJmqHY.js +812 -0
  95. package/dist/user-DqFnAlKR.js +7 -0
  96. package/dist/verify-BmaaygAV.js +12 -0
  97. package/dist/verify-filled-BwLeEdJj.js +12 -0
  98. package/dist/vite.svg +1 -0
  99. package/dist/w3m-modal-BijXCMl6.js +1041 -0
  100. package/dist/wallet-DyP6_6JN.js +12 -0
  101. package/dist/wallet-placeholder-BZC82rR0.js +18 -0
  102. package/dist/walletconnect-DT69luRK.js +36 -0
  103. package/dist/warning-circle-CGbg6QZn.js +16 -0
  104. package/dist/x-BfEtqtAc.js +16 -0
  105. package/dist/x-mark-CSmIdhvb.js +7 -0
  106. package/package.json +53 -0
@@ -0,0 +1,917 @@
1
+ import { E as P, J as y, aX as l, aY as $, aD as j, aA as A, a9 as h, K as u, aH as C, aa as c, I as b, H as p, V as I, a6 as Y, Q as E, T as z, U as V, R as W, Y as U, O as F, a8 as K, S as B } from "./index-BEm1bPeX.js";
2
+ const N = P`
3
+ :host > wui-grid {
4
+ max-height: 360px;
5
+ overflow: auto;
6
+ }
7
+
8
+ wui-flex {
9
+ transition: opacity var(--wui-ease-out-power-1) var(--wui-duration-md);
10
+ will-change: opacity;
11
+ }
12
+
13
+ wui-grid::-webkit-scrollbar {
14
+ display: none;
15
+ }
16
+
17
+ wui-flex.disabled {
18
+ opacity: 0.3;
19
+ pointer-events: none;
20
+ user-select: none;
21
+ }
22
+ `;
23
+ var _ = function(s, e, t, r) {
24
+ var o = arguments.length, i = o < 3 ? e : r === null ? r = Object.getOwnPropertyDescriptor(e, t) : r, n;
25
+ if (typeof Reflect == "object" && typeof Reflect.decorate == "function") i = Reflect.decorate(s, e, t, r);
26
+ else for (var a = s.length - 1; a >= 0; a--) (n = s[a]) && (i = (o < 3 ? n(i) : o > 3 ? n(e, t, i) : n(e, t)) || i);
27
+ return o > 3 && i && Object.defineProperty(e, t, i), i;
28
+ };
29
+ let R = class extends y {
30
+ constructor() {
31
+ super(), this.unsubscribe = [], this.selectedCurrency = l.state.paymentCurrency, this.currencies = l.state.paymentCurrencies, this.currencyImages = $.state.currencyImages, this.checked = j.state.isLegalCheckboxChecked, this.unsubscribe.push(l.subscribe((e) => {
32
+ this.selectedCurrency = e.paymentCurrency, this.currencies = e.paymentCurrencies;
33
+ }), $.subscribeKey("currencyImages", (e) => this.currencyImages = e), j.subscribeKey("isLegalCheckboxChecked", (e) => {
34
+ this.checked = e;
35
+ }));
36
+ }
37
+ disconnectedCallback() {
38
+ this.unsubscribe.forEach((e) => e());
39
+ }
40
+ render() {
41
+ var a;
42
+ const { termsConditionsUrl: e, privacyPolicyUrl: t } = A.state, r = (a = A.state.features) == null ? void 0 : a.legalCheckbox, n = !!(e || t) && !!r && !this.checked;
43
+ return u`
44
+ <w3m-legal-checkbox></w3m-legal-checkbox>
45
+ <wui-flex
46
+ flexDirection="column"
47
+ .padding=${["0", "s", "s", "s"]}
48
+ gap="xs"
49
+ class=${h(n ? "disabled" : void 0)}
50
+ >
51
+ ${this.currenciesTemplate(n)}
52
+ </wui-flex>
53
+ <w3m-legal-footer></w3m-legal-footer>
54
+ `;
55
+ }
56
+ currenciesTemplate(e = !1) {
57
+ return this.currencies.map((t) => {
58
+ var r;
59
+ return u`
60
+ <wui-list-item
61
+ imageSrc=${h((r = this.currencyImages) == null ? void 0 : r[t.id])}
62
+ @click=${() => this.selectCurrency(t)}
63
+ variant="image"
64
+ tabIdx=${h(e ? -1 : void 0)}
65
+ >
66
+ <wui-text variant="paragraph-500" color="fg-100">${t.id}</wui-text>
67
+ </wui-list-item>
68
+ `;
69
+ });
70
+ }
71
+ selectCurrency(e) {
72
+ e && (l.setPaymentCurrency(e), C.close());
73
+ }
74
+ };
75
+ R.styles = N;
76
+ _([
77
+ c()
78
+ ], R.prototype, "selectedCurrency", void 0);
79
+ _([
80
+ c()
81
+ ], R.prototype, "currencies", void 0);
82
+ _([
83
+ c()
84
+ ], R.prototype, "currencyImages", void 0);
85
+ _([
86
+ c()
87
+ ], R.prototype, "checked", void 0);
88
+ R = _([
89
+ b("w3m-onramp-fiat-select-view")
90
+ ], R);
91
+ const q = P`
92
+ button {
93
+ padding: var(--wui-spacing-s);
94
+ border-radius: var(--wui-border-radius-xs);
95
+ border: none;
96
+ outline: none;
97
+ background-color: var(--wui-color-gray-glass-002);
98
+ width: 100%;
99
+ display: flex;
100
+ align-items: center;
101
+ justify-content: flex-start;
102
+ gap: var(--wui-spacing-s);
103
+ transition: background-color var(--wui-ease-out-power-1) var(--wui-duration-md);
104
+ will-change: background-color;
105
+ }
106
+
107
+ button:hover {
108
+ background-color: var(--wui-color-gray-glass-005);
109
+ }
110
+
111
+ .provider-image {
112
+ width: var(--wui-spacing-3xl);
113
+ min-width: var(--wui-spacing-3xl);
114
+ height: var(--wui-spacing-3xl);
115
+ border-radius: calc(var(--wui-border-radius-xs) - calc(var(--wui-spacing-s) / 2));
116
+ position: relative;
117
+ overflow: hidden;
118
+ }
119
+
120
+ .provider-image::after {
121
+ content: '';
122
+ display: block;
123
+ width: 100%;
124
+ height: 100%;
125
+ position: absolute;
126
+ inset: 0;
127
+ border-radius: calc(var(--wui-border-radius-xs) - calc(var(--wui-spacing-s) / 2));
128
+ box-shadow: inset 0 0 0 1px var(--wui-color-gray-glass-005);
129
+ }
130
+
131
+ .network-icon {
132
+ width: var(--wui-spacing-m);
133
+ height: var(--wui-spacing-m);
134
+ border-radius: calc(var(--wui-spacing-m) / 2);
135
+ overflow: hidden;
136
+ box-shadow:
137
+ 0 0 0 3px var(--wui-color-gray-glass-002),
138
+ 0 0 0 3px var(--wui-color-modal-bg);
139
+ transition: box-shadow var(--wui-ease-out-power-1) var(--wui-duration-md);
140
+ will-change: box-shadow;
141
+ }
142
+
143
+ button:hover .network-icon {
144
+ box-shadow:
145
+ 0 0 0 3px var(--wui-color-gray-glass-005),
146
+ 0 0 0 3px var(--wui-color-modal-bg);
147
+ }
148
+ `;
149
+ var v = function(s, e, t, r) {
150
+ var o = arguments.length, i = o < 3 ? e : r === null ? r = Object.getOwnPropertyDescriptor(e, t) : r, n;
151
+ if (typeof Reflect == "object" && typeof Reflect.decorate == "function") i = Reflect.decorate(s, e, t, r);
152
+ else for (var a = s.length - 1; a >= 0; a--) (n = s[a]) && (i = (o < 3 ? n(i) : o > 3 ? n(e, t, i) : n(e, t)) || i);
153
+ return o > 3 && i && Object.defineProperty(e, t, i), i;
154
+ };
155
+ let m = class extends y {
156
+ constructor() {
157
+ super(...arguments), this.disabled = !1, this.color = "inherit", this.label = "", this.feeRange = "", this.loading = !1, this.onClick = null;
158
+ }
159
+ render() {
160
+ return u`
161
+ <button ?disabled=${this.disabled} @click=${this.onClick} ontouchstart>
162
+ <wui-visual name=${h(this.name)} class="provider-image"></wui-visual>
163
+ <wui-flex flexDirection="column" gap="4xs">
164
+ <wui-text variant="paragraph-500" color="fg-100">${this.label}</wui-text>
165
+ <wui-flex alignItems="center" justifyContent="flex-start" gap="l">
166
+ <wui-text variant="tiny-500" color="fg-100">
167
+ <wui-text variant="tiny-400" color="fg-200">Fees</wui-text>
168
+ ${this.feeRange}
169
+ </wui-text>
170
+ <wui-flex gap="xxs">
171
+ <wui-icon name="bank" size="xs" color="fg-150"></wui-icon>
172
+ <wui-icon name="card" size="xs" color="fg-150"></wui-icon>
173
+ </wui-flex>
174
+ ${this.networksTemplate()}
175
+ </wui-flex>
176
+ </wui-flex>
177
+ ${this.loading ? u`<wui-loading-spinner color="fg-200" size="md"></wui-loading-spinner>` : u`<wui-icon name="chevronRight" color="fg-200" size="sm"></wui-icon>`}
178
+ </button>
179
+ `;
180
+ }
181
+ networksTemplate() {
182
+ var r;
183
+ const e = I.getAllRequestedCaipNetworks(), t = (r = e == null ? void 0 : e.filter((o) => {
184
+ var i;
185
+ return (i = o == null ? void 0 : o.assets) == null ? void 0 : i.imageId;
186
+ })) == null ? void 0 : r.slice(0, 5);
187
+ return u`
188
+ <wui-flex class="networks">
189
+ ${t == null ? void 0 : t.map((o) => u`
190
+ <wui-flex class="network-icon">
191
+ <wui-image src=${h(Y.getNetworkImage(o))}></wui-image>
192
+ </wui-flex>
193
+ `)}
194
+ </wui-flex>
195
+ `;
196
+ }
197
+ };
198
+ m.styles = [q];
199
+ v([
200
+ p({ type: Boolean })
201
+ ], m.prototype, "disabled", void 0);
202
+ v([
203
+ p()
204
+ ], m.prototype, "color", void 0);
205
+ v([
206
+ p()
207
+ ], m.prototype, "name", void 0);
208
+ v([
209
+ p()
210
+ ], m.prototype, "label", void 0);
211
+ v([
212
+ p()
213
+ ], m.prototype, "feeRange", void 0);
214
+ v([
215
+ p({ type: Boolean })
216
+ ], m.prototype, "loading", void 0);
217
+ v([
218
+ p()
219
+ ], m.prototype, "onClick", void 0);
220
+ m = v([
221
+ b("w3m-onramp-provider-item")
222
+ ], m);
223
+ const H = P`
224
+ wui-flex {
225
+ border-top: 1px solid var(--wui-color-gray-glass-005);
226
+ }
227
+
228
+ a {
229
+ text-decoration: none;
230
+ color: var(--wui-color-fg-175);
231
+ font-weight: 500;
232
+ display: flex;
233
+ align-items: center;
234
+ justify-content: center;
235
+ gap: var(--wui-spacing-3xs);
236
+ }
237
+ `;
238
+ var Q = function(s, e, t, r) {
239
+ var o = arguments.length, i = o < 3 ? e : r === null ? r = Object.getOwnPropertyDescriptor(e, t) : r, n;
240
+ if (typeof Reflect == "object" && typeof Reflect.decorate == "function") i = Reflect.decorate(s, e, t, r);
241
+ else for (var a = s.length - 1; a >= 0; a--) (n = s[a]) && (i = (o < 3 ? n(i) : o > 3 ? n(e, t, i) : n(e, t)) || i);
242
+ return o > 3 && i && Object.defineProperty(e, t, i), i;
243
+ };
244
+ let S = class extends y {
245
+ render() {
246
+ const { termsConditionsUrl: e, privacyPolicyUrl: t } = A.state;
247
+ return !e && !t ? null : u`
248
+ <wui-flex
249
+ .padding=${["m", "s", "s", "s"]}
250
+ flexDirection="column"
251
+ alignItems="center"
252
+ justifyContent="center"
253
+ gap="s"
254
+ >
255
+ <wui-text color="fg-250" variant="small-400" align="center">
256
+ We work with the best providers to give you the lowest fees and best support. More options
257
+ coming soon!
258
+ </wui-text>
259
+
260
+ ${this.howDoesItWorkTemplate()}
261
+ </wui-flex>
262
+ `;
263
+ }
264
+ howDoesItWorkTemplate() {
265
+ return u` <wui-link @click=${this.onWhatIsBuy.bind(this)}>
266
+ <wui-icon size="xs" color="accent-100" slot="iconLeft" name="helpCircle"></wui-icon>
267
+ How does it work?
268
+ </wui-link>`;
269
+ }
270
+ onWhatIsBuy() {
271
+ E.sendEvent({
272
+ type: "track",
273
+ event: "SELECT_WHAT_IS_A_BUY",
274
+ properties: {
275
+ isSmartAccount: z(I.state.activeChain) === V.ACCOUNT_TYPES.SMART_ACCOUNT
276
+ }
277
+ }), W.push("WhatIsABuy");
278
+ }
279
+ };
280
+ S.styles = [H];
281
+ S = Q([
282
+ b("w3m-onramp-providers-footer")
283
+ ], S);
284
+ var M = function(s, e, t, r) {
285
+ var o = arguments.length, i = o < 3 ? e : r === null ? r = Object.getOwnPropertyDescriptor(e, t) : r, n;
286
+ if (typeof Reflect == "object" && typeof Reflect.decorate == "function") i = Reflect.decorate(s, e, t, r);
287
+ else for (var a = s.length - 1; a >= 0; a--) (n = s[a]) && (i = (o < 3 ? n(i) : o > 3 ? n(e, t, i) : n(e, t)) || i);
288
+ return o > 3 && i && Object.defineProperty(e, t, i), i;
289
+ };
290
+ let D = class extends y {
291
+ constructor() {
292
+ super(), this.unsubscribe = [], this.providers = l.state.providers, this.unsubscribe.push(l.subscribeKey("providers", (e) => {
293
+ this.providers = e;
294
+ }));
295
+ }
296
+ render() {
297
+ return u`
298
+ <wui-flex flexDirection="column" .padding=${["0", "s", "s", "s"]} gap="xs">
299
+ ${this.onRampProvidersTemplate()}
300
+ </wui-flex>
301
+ <w3m-onramp-providers-footer></w3m-onramp-providers-footer>
302
+ `;
303
+ }
304
+ onRampProvidersTemplate() {
305
+ return this.providers.filter((e) => e.supportedChains.includes(I.state.activeChain ?? "eip155")).map((e) => u`
306
+ <w3m-onramp-provider-item
307
+ label=${e.label}
308
+ name=${e.name}
309
+ feeRange=${e.feeRange}
310
+ @click=${() => {
311
+ this.onClickProvider(e);
312
+ }}
313
+ ?disabled=${!e.url}
314
+ data-testid=${`onramp-provider-${e.name}`}
315
+ ></w3m-onramp-provider-item>
316
+ `);
317
+ }
318
+ onClickProvider(e) {
319
+ var t;
320
+ l.setSelectedProvider(e), W.push("BuyInProgress"), U.openHref(((t = l.state.selectedProvider) == null ? void 0 : t.url) || e.url, "popupWindow", "width=600,height=800,scrollbars=yes"), E.sendEvent({
321
+ type: "track",
322
+ event: "SELECT_BUY_PROVIDER",
323
+ properties: {
324
+ provider: e.name,
325
+ isSmartAccount: z(I.state.activeChain) === V.ACCOUNT_TYPES.SMART_ACCOUNT
326
+ }
327
+ });
328
+ }
329
+ };
330
+ M([
331
+ c()
332
+ ], D.prototype, "providers", void 0);
333
+ D = M([
334
+ b("w3m-onramp-providers-view")
335
+ ], D);
336
+ const X = P`
337
+ :host > wui-grid {
338
+ max-height: 360px;
339
+ overflow: auto;
340
+ }
341
+
342
+ wui-flex {
343
+ transition: opacity var(--wui-ease-out-power-1) var(--wui-duration-md);
344
+ will-change: opacity;
345
+ }
346
+
347
+ wui-grid::-webkit-scrollbar {
348
+ display: none;
349
+ }
350
+
351
+ wui-flex.disabled {
352
+ opacity: 0.3;
353
+ pointer-events: none;
354
+ user-select: none;
355
+ }
356
+ `;
357
+ var T = function(s, e, t, r) {
358
+ var o = arguments.length, i = o < 3 ? e : r === null ? r = Object.getOwnPropertyDescriptor(e, t) : r, n;
359
+ if (typeof Reflect == "object" && typeof Reflect.decorate == "function") i = Reflect.decorate(s, e, t, r);
360
+ else for (var a = s.length - 1; a >= 0; a--) (n = s[a]) && (i = (o < 3 ? n(i) : o > 3 ? n(e, t, i) : n(e, t)) || i);
361
+ return o > 3 && i && Object.defineProperty(e, t, i), i;
362
+ };
363
+ let k = class extends y {
364
+ constructor() {
365
+ super(), this.unsubscribe = [], this.selectedCurrency = l.state.purchaseCurrencies, this.tokens = l.state.purchaseCurrencies, this.tokenImages = $.state.tokenImages, this.checked = j.state.isLegalCheckboxChecked, this.unsubscribe.push(l.subscribe((e) => {
366
+ this.selectedCurrency = e.purchaseCurrencies, this.tokens = e.purchaseCurrencies;
367
+ }), $.subscribeKey("tokenImages", (e) => this.tokenImages = e), j.subscribeKey("isLegalCheckboxChecked", (e) => {
368
+ this.checked = e;
369
+ }));
370
+ }
371
+ disconnectedCallback() {
372
+ this.unsubscribe.forEach((e) => e());
373
+ }
374
+ render() {
375
+ var a;
376
+ const { termsConditionsUrl: e, privacyPolicyUrl: t } = A.state, r = (a = A.state.features) == null ? void 0 : a.legalCheckbox, n = !!(e || t) && !!r && !this.checked;
377
+ return u`
378
+ <w3m-legal-checkbox></w3m-legal-checkbox>
379
+ <wui-flex
380
+ flexDirection="column"
381
+ .padding=${["0", "s", "s", "s"]}
382
+ gap="xs"
383
+ class=${h(n ? "disabled" : void 0)}
384
+ >
385
+ ${this.currenciesTemplate(n)}
386
+ </wui-flex>
387
+ <w3m-legal-footer></w3m-legal-footer>
388
+ `;
389
+ }
390
+ currenciesTemplate(e = !1) {
391
+ return this.tokens.map((t) => {
392
+ var r;
393
+ return u`
394
+ <wui-list-item
395
+ imageSrc=${h((r = this.tokenImages) == null ? void 0 : r[t.symbol])}
396
+ @click=${() => this.selectToken(t)}
397
+ variant="image"
398
+ tabIdx=${h(e ? -1 : void 0)}
399
+ >
400
+ <wui-flex gap="3xs" alignItems="center">
401
+ <wui-text variant="paragraph-500" color="fg-100">${t.name}</wui-text>
402
+ <wui-text variant="small-400" color="fg-200">${t.symbol}</wui-text>
403
+ </wui-flex>
404
+ </wui-list-item>
405
+ `;
406
+ });
407
+ }
408
+ selectToken(e) {
409
+ e && (l.setPurchaseCurrency(e), C.close());
410
+ }
411
+ };
412
+ k.styles = X;
413
+ T([
414
+ c()
415
+ ], k.prototype, "selectedCurrency", void 0);
416
+ T([
417
+ c()
418
+ ], k.prototype, "tokens", void 0);
419
+ T([
420
+ c()
421
+ ], k.prototype, "tokenImages", void 0);
422
+ T([
423
+ c()
424
+ ], k.prototype, "checked", void 0);
425
+ k = T([
426
+ b("w3m-onramp-token-select-view")
427
+ ], k);
428
+ const G = P`
429
+ @keyframes shake {
430
+ 0% {
431
+ transform: translateX(0);
432
+ }
433
+ 25% {
434
+ transform: translateX(3px);
435
+ }
436
+ 50% {
437
+ transform: translateX(-3px);
438
+ }
439
+ 75% {
440
+ transform: translateX(3px);
441
+ }
442
+ 100% {
443
+ transform: translateX(0);
444
+ }
445
+ }
446
+
447
+ wui-flex:first-child:not(:only-child) {
448
+ position: relative;
449
+ }
450
+
451
+ wui-loading-thumbnail {
452
+ position: absolute;
453
+ }
454
+
455
+ wui-visual {
456
+ width: var(--wui-wallet-image-size-lg);
457
+ height: var(--wui-wallet-image-size-lg);
458
+ border-radius: calc(var(--wui-border-radius-5xs) * 9 - var(--wui-border-radius-xxs));
459
+ position: relative;
460
+ overflow: hidden;
461
+ }
462
+
463
+ wui-visual::after {
464
+ content: '';
465
+ display: block;
466
+ width: 100%;
467
+ height: 100%;
468
+ position: absolute;
469
+ inset: 0;
470
+ border-radius: calc(var(--wui-border-radius-5xs) * 9 - var(--wui-border-radius-xxs));
471
+ box-shadow: inset 0 0 0 1px var(--wui-color-gray-glass-005);
472
+ }
473
+
474
+ wui-icon-box {
475
+ position: absolute;
476
+ right: calc(var(--wui-spacing-3xs) * -1);
477
+ bottom: calc(var(--wui-spacing-3xs) * -1);
478
+ opacity: 0;
479
+ transform: scale(0.5);
480
+ transition:
481
+ opacity var(--wui-ease-out-power-2) var(--wui-duration-lg),
482
+ transform var(--wui-ease-out-power-2) var(--wui-duration-lg);
483
+ will-change: opacity, transform;
484
+ }
485
+
486
+ wui-text[align='center'] {
487
+ width: 100%;
488
+ padding: 0px var(--wui-spacing-l);
489
+ }
490
+
491
+ [data-error='true'] wui-icon-box {
492
+ opacity: 1;
493
+ transform: scale(1);
494
+ }
495
+
496
+ [data-error='true'] > wui-flex:first-child {
497
+ animation: shake 250ms cubic-bezier(0.36, 0.07, 0.19, 0.97) both;
498
+ }
499
+
500
+ [data-retry='false'] wui-link {
501
+ display: none;
502
+ }
503
+
504
+ [data-retry='true'] wui-link {
505
+ display: block;
506
+ opacity: 1;
507
+ }
508
+
509
+ wui-link {
510
+ padding: var(--wui-spacing-4xs) var(--wui-spacing-xxs);
511
+ }
512
+ `;
513
+ var f = function(s, e, t, r) {
514
+ var o = arguments.length, i = o < 3 ? e : r === null ? r = Object.getOwnPropertyDescriptor(e, t) : r, n;
515
+ if (typeof Reflect == "object" && typeof Reflect.decorate == "function") i = Reflect.decorate(s, e, t, r);
516
+ else for (var a = s.length - 1; a >= 0; a--) (n = s[a]) && (i = (o < 3 ? n(i) : o > 3 ? n(e, t, i) : n(e, t)) || i);
517
+ return o > 3 && i && Object.defineProperty(e, t, i), i;
518
+ };
519
+ let d = class extends y {
520
+ constructor() {
521
+ super(), this.unsubscribe = [], this.selectedOnRampProvider = l.state.selectedProvider, this.uri = F.state.wcUri, this.ready = !1, this.showRetry = !1, this.buffering = !1, this.error = !1, this.isMobile = !1, this.onRetry = void 0, this.unsubscribe.push(l.subscribeKey("selectedProvider", (e) => {
522
+ this.selectedOnRampProvider = e;
523
+ }));
524
+ }
525
+ disconnectedCallback() {
526
+ this.intervalId && clearInterval(this.intervalId);
527
+ }
528
+ render() {
529
+ var r, o;
530
+ let e = "Continue in external window";
531
+ this.error ? e = "Buy failed" : this.selectedOnRampProvider && (e = `Buy in ${(r = this.selectedOnRampProvider) == null ? void 0 : r.label}`);
532
+ const t = this.error ? "Buy can be declined from your side or due to and error on the provider app" : "We’ll notify you once your Buy is processed";
533
+ return u`
534
+ <wui-flex
535
+ data-error=${h(this.error)}
536
+ data-retry=${this.showRetry}
537
+ flexDirection="column"
538
+ alignItems="center"
539
+ .padding=${["3xl", "xl", "xl", "xl"]}
540
+ gap="xl"
541
+ >
542
+ <wui-flex justifyContent="center" alignItems="center">
543
+ <wui-visual
544
+ name=${h((o = this.selectedOnRampProvider) == null ? void 0 : o.name)}
545
+ size="lg"
546
+ class="provider-image"
547
+ >
548
+ </wui-visual>
549
+
550
+ ${this.error ? null : this.loaderTemplate()}
551
+
552
+ <wui-icon-box
553
+ backgroundColor="error-100"
554
+ background="opaque"
555
+ iconColor="error-100"
556
+ icon="close"
557
+ size="sm"
558
+ border
559
+ borderColor="wui-color-bg-125"
560
+ ></wui-icon-box>
561
+ </wui-flex>
562
+
563
+ <wui-flex flexDirection="column" alignItems="center" gap="xs">
564
+ <wui-text variant="paragraph-500" color=${this.error ? "error-100" : "fg-100"}>
565
+ ${e}
566
+ </wui-text>
567
+ <wui-text align="center" variant="small-500" color="fg-200">${t}</wui-text>
568
+ </wui-flex>
569
+
570
+ ${this.error ? this.tryAgainTemplate() : null}
571
+ </wui-flex>
572
+
573
+ <wui-flex .padding=${["0", "xl", "xl", "xl"]} justifyContent="center">
574
+ <wui-link @click=${this.onCopyUri} color="fg-200">
575
+ <wui-icon size="xs" color="fg-200" slot="iconLeft" name="copy"></wui-icon>
576
+ Copy link
577
+ </wui-link>
578
+ </wui-flex>
579
+ `;
580
+ }
581
+ onTryAgain() {
582
+ this.selectedOnRampProvider && (this.error = !1, U.openHref(this.selectedOnRampProvider.url, "popupWindow", "width=600,height=800,scrollbars=yes"));
583
+ }
584
+ tryAgainTemplate() {
585
+ var e;
586
+ return (e = this.selectedOnRampProvider) != null && e.url ? u`<wui-button size="md" variant="accent" @click=${this.onTryAgain.bind(this)}>
587
+ <wui-icon color="inherit" slot="iconLeft" name="refresh"></wui-icon>
588
+ Try again
589
+ </wui-button>` : null;
590
+ }
591
+ loaderTemplate() {
592
+ const e = K.state.themeVariables["--w3m-border-radius-master"], t = e ? parseInt(e.replace("px", ""), 10) : 4;
593
+ return u`<wui-loading-thumbnail radius=${t * 9}></wui-loading-thumbnail>`;
594
+ }
595
+ onCopyUri() {
596
+ var e;
597
+ if (!((e = this.selectedOnRampProvider) != null && e.url)) {
598
+ B.showError("No link found"), W.goBack();
599
+ return;
600
+ }
601
+ try {
602
+ U.copyToClopboard(this.selectedOnRampProvider.url), B.showSuccess("Link copied");
603
+ } catch {
604
+ B.showError("Failed to copy");
605
+ }
606
+ }
607
+ };
608
+ d.styles = G;
609
+ f([
610
+ c()
611
+ ], d.prototype, "intervalId", void 0);
612
+ f([
613
+ c()
614
+ ], d.prototype, "selectedOnRampProvider", void 0);
615
+ f([
616
+ c()
617
+ ], d.prototype, "uri", void 0);
618
+ f([
619
+ c()
620
+ ], d.prototype, "ready", void 0);
621
+ f([
622
+ c()
623
+ ], d.prototype, "showRetry", void 0);
624
+ f([
625
+ c()
626
+ ], d.prototype, "buffering", void 0);
627
+ f([
628
+ c()
629
+ ], d.prototype, "error", void 0);
630
+ f([
631
+ p({ type: Boolean })
632
+ ], d.prototype, "isMobile", void 0);
633
+ f([
634
+ p()
635
+ ], d.prototype, "onRetry", void 0);
636
+ d = f([
637
+ b("w3m-buy-in-progress-view")
638
+ ], d);
639
+ var J = function(s, e, t, r) {
640
+ var o = arguments.length, i = o < 3 ? e : r === null ? r = Object.getOwnPropertyDescriptor(e, t) : r, n;
641
+ if (typeof Reflect == "object" && typeof Reflect.decorate == "function") i = Reflect.decorate(s, e, t, r);
642
+ else for (var a = s.length - 1; a >= 0; a--) (n = s[a]) && (i = (o < 3 ? n(i) : o > 3 ? n(e, t, i) : n(e, t)) || i);
643
+ return o > 3 && i && Object.defineProperty(e, t, i), i;
644
+ };
645
+ let L = class extends y {
646
+ render() {
647
+ return u`
648
+ <wui-flex
649
+ flexDirection="column"
650
+ .padding=${["xxl", "3xl", "xl", "3xl"]}
651
+ alignItems="center"
652
+ gap="xl"
653
+ >
654
+ <wui-visual name="onrampCard"></wui-visual>
655
+ <wui-flex flexDirection="column" gap="xs" alignItems="center">
656
+ <wui-text align="center" variant="paragraph-500" color="fg-100">
657
+ Quickly and easily buy digital assets!
658
+ </wui-text>
659
+ <wui-text align="center" variant="small-400" color="fg-200">
660
+ Simply select your preferred onramp provider and add digital assets to your account
661
+ using your credit card or bank transfer
662
+ </wui-text>
663
+ </wui-flex>
664
+ <wui-button @click=${W.goBack}>
665
+ <wui-icon size="sm" color="inherit" name="add" slot="iconLeft"></wui-icon>
666
+ Buy
667
+ </wui-button>
668
+ </wui-flex>
669
+ `;
670
+ }
671
+ };
672
+ L = J([
673
+ b("w3m-what-is-a-buy-view")
674
+ ], L);
675
+ const Z = P`
676
+ :host {
677
+ width: 100%;
678
+ }
679
+
680
+ wui-loading-spinner {
681
+ position: absolute;
682
+ top: 50%;
683
+ right: 20px;
684
+ transform: translateY(-50%);
685
+ }
686
+
687
+ .currency-container {
688
+ position: absolute;
689
+ top: 50%;
690
+ transform: translateY(-50%);
691
+ right: var(--wui-spacing-1xs);
692
+ height: 40px;
693
+ padding: var(--wui-spacing-xs) var(--wui-spacing-1xs) var(--wui-spacing-xs)
694
+ var(--wui-spacing-xs);
695
+ min-width: 95px;
696
+ border-radius: var(--FULL, 1000px);
697
+ border: 1px solid var(--wui-color-gray-glass-002);
698
+ background: var(--wui-color-gray-glass-002);
699
+ cursor: pointer;
700
+ }
701
+
702
+ .currency-container > wui-image {
703
+ height: 24px;
704
+ width: 24px;
705
+ border-radius: 50%;
706
+ }
707
+ `;
708
+ var O = function(s, e, t, r) {
709
+ var o = arguments.length, i = o < 3 ? e : r === null ? r = Object.getOwnPropertyDescriptor(e, t) : r, n;
710
+ if (typeof Reflect == "object" && typeof Reflect.decorate == "function") i = Reflect.decorate(s, e, t, r);
711
+ else for (var a = s.length - 1; a >= 0; a--) (n = s[a]) && (i = (o < 3 ? n(i) : o > 3 ? n(e, t, i) : n(e, t)) || i);
712
+ return o > 3 && i && Object.defineProperty(e, t, i), i;
713
+ };
714
+ let g = class extends y {
715
+ constructor() {
716
+ var e;
717
+ super(), this.unsubscribe = [], this.type = "Token", this.value = 0, this.currencies = [], this.selectedCurrency = (e = this.currencies) == null ? void 0 : e[0], this.currencyImages = $.state.currencyImages, this.tokenImages = $.state.tokenImages, this.unsubscribe.push(l.subscribeKey("purchaseCurrency", (t) => {
718
+ !t || this.type === "Fiat" || (this.selectedCurrency = this.formatPurchaseCurrency(t));
719
+ }), l.subscribeKey("paymentCurrency", (t) => {
720
+ !t || this.type === "Token" || (this.selectedCurrency = this.formatPaymentCurrency(t));
721
+ }), l.subscribe((t) => {
722
+ this.type === "Fiat" ? this.currencies = t.purchaseCurrencies.map(this.formatPurchaseCurrency) : this.currencies = t.paymentCurrencies.map(this.formatPaymentCurrency);
723
+ }), $.subscribe((t) => {
724
+ this.currencyImages = { ...t.currencyImages }, this.tokenImages = { ...t.tokenImages };
725
+ }));
726
+ }
727
+ firstUpdated() {
728
+ l.getAvailableCurrencies();
729
+ }
730
+ disconnectedCallback() {
731
+ this.unsubscribe.forEach((e) => e());
732
+ }
733
+ render() {
734
+ var r;
735
+ const e = ((r = this.selectedCurrency) == null ? void 0 : r.symbol) || "", t = this.currencyImages[e] || this.tokenImages[e];
736
+ return u`<wui-input-text type="number" size="lg" value=${this.value}>
737
+ ${this.selectedCurrency ? u` <wui-flex
738
+ class="currency-container"
739
+ justifyContent="space-between"
740
+ alignItems="center"
741
+ gap="xxs"
742
+ @click=${() => C.open({ view: `OnRamp${this.type}Select` })}
743
+ >
744
+ <wui-image src=${h(t)}></wui-image>
745
+ <wui-text color="fg-100">${this.selectedCurrency.symbol}</wui-text>
746
+ </wui-flex>` : u`<wui-loading-spinner></wui-loading-spinner>`}
747
+ </wui-input-text>`;
748
+ }
749
+ formatPaymentCurrency(e) {
750
+ return {
751
+ name: e.id,
752
+ symbol: e.id
753
+ };
754
+ }
755
+ formatPurchaseCurrency(e) {
756
+ return {
757
+ name: e.name,
758
+ symbol: e.symbol
759
+ };
760
+ }
761
+ };
762
+ g.styles = Z;
763
+ O([
764
+ p({ type: String })
765
+ ], g.prototype, "type", void 0);
766
+ O([
767
+ p({ type: Number })
768
+ ], g.prototype, "value", void 0);
769
+ O([
770
+ c()
771
+ ], g.prototype, "currencies", void 0);
772
+ O([
773
+ c()
774
+ ], g.prototype, "selectedCurrency", void 0);
775
+ O([
776
+ c()
777
+ ], g.prototype, "currencyImages", void 0);
778
+ O([
779
+ c()
780
+ ], g.prototype, "tokenImages", void 0);
781
+ g = O([
782
+ b("w3m-onramp-input")
783
+ ], g);
784
+ const ee = P`
785
+ :host > wui-flex {
786
+ width: 100%;
787
+ max-width: 360px;
788
+ }
789
+
790
+ :host > wui-flex > wui-flex {
791
+ border-radius: var(--wui-border-radius-l);
792
+ width: 100%;
793
+ }
794
+
795
+ .amounts-container {
796
+ width: 100%;
797
+ }
798
+ `;
799
+ var x = function(s, e, t, r) {
800
+ var o = arguments.length, i = o < 3 ? e : r === null ? r = Object.getOwnPropertyDescriptor(e, t) : r, n;
801
+ if (typeof Reflect == "object" && typeof Reflect.decorate == "function") i = Reflect.decorate(s, e, t, r);
802
+ else for (var a = s.length - 1; a >= 0; a--) (n = s[a]) && (i = (o < 3 ? n(i) : o > 3 ? n(e, t, i) : n(e, t)) || i);
803
+ return o > 3 && i && Object.defineProperty(e, t, i), i;
804
+ };
805
+ const te = {
806
+ USD: "$",
807
+ EUR: "€",
808
+ GBP: "£"
809
+ }, ie = [100, 250, 500, 1e3];
810
+ let w = class extends y {
811
+ constructor() {
812
+ super(), this.unsubscribe = [], this.disabled = !1, this.caipAddress = I.state.activeCaipAddress, this.loading = C.state.loading, this.paymentCurrency = l.state.paymentCurrency, this.paymentAmount = l.state.paymentAmount, this.purchaseAmount = l.state.purchaseAmount, this.quoteLoading = l.state.quotesLoading, this.unsubscribe.push(I.subscribeKey("activeCaipAddress", (e) => this.caipAddress = e), C.subscribeKey("loading", (e) => {
813
+ this.loading = e;
814
+ }), l.subscribe((e) => {
815
+ this.paymentCurrency = e.paymentCurrency, this.paymentAmount = e.paymentAmount, this.purchaseAmount = e.purchaseAmount, this.quoteLoading = e.quotesLoading;
816
+ }));
817
+ }
818
+ disconnectedCallback() {
819
+ this.unsubscribe.forEach((e) => e());
820
+ }
821
+ render() {
822
+ return u`
823
+ <wui-flex flexDirection="column" justifyContent="center" alignItems="center">
824
+ <wui-flex flexDirection="column" alignItems="center" gap="xs">
825
+ <w3m-onramp-input
826
+ type="Fiat"
827
+ @inputChange=${this.onPaymentAmountChange.bind(this)}
828
+ .value=${this.paymentAmount || 0}
829
+ ></w3m-onramp-input>
830
+ <w3m-onramp-input
831
+ type="Token"
832
+ .value=${this.purchaseAmount || 0}
833
+ .loading=${this.quoteLoading}
834
+ ></w3m-onramp-input>
835
+ <wui-flex justifyContent="space-evenly" class="amounts-container" gap="xs">
836
+ ${ie.map((e) => {
837
+ var t;
838
+ return u`<wui-button
839
+ variant=${this.paymentAmount === e ? "accent" : "neutral"}
840
+ size="md"
841
+ textVariant="paragraph-600"
842
+ fullWidth
843
+ @click=${() => this.selectPresetAmount(e)}
844
+ >${`${te[((t = this.paymentCurrency) == null ? void 0 : t.id) || "USD"]} ${e}`}</wui-button
845
+ >`;
846
+ })}
847
+ </wui-flex>
848
+ ${this.templateButton()}
849
+ </wui-flex>
850
+ </wui-flex>
851
+ `;
852
+ }
853
+ templateButton() {
854
+ return this.caipAddress ? u`<wui-button
855
+ @click=${this.getQuotes.bind(this)}
856
+ variant="main"
857
+ fullWidth
858
+ size="lg"
859
+ borderRadius="xs"
860
+ >
861
+ Get quotes
862
+ </wui-button>` : u`<wui-button
863
+ @click=${this.openModal.bind(this)}
864
+ variant="accent"
865
+ fullWidth
866
+ size="lg"
867
+ borderRadius="xs"
868
+ >
869
+ Connect wallet
870
+ </wui-button>`;
871
+ }
872
+ getQuotes() {
873
+ this.loading || C.open({ view: "OnRampProviders" });
874
+ }
875
+ openModal() {
876
+ C.open({ view: "Connect" });
877
+ }
878
+ async onPaymentAmountChange(e) {
879
+ l.setPaymentAmount(Number(e.detail)), await l.getQuote();
880
+ }
881
+ async selectPresetAmount(e) {
882
+ l.setPaymentAmount(e), await l.getQuote();
883
+ }
884
+ };
885
+ w.styles = ee;
886
+ x([
887
+ p({ type: Boolean })
888
+ ], w.prototype, "disabled", void 0);
889
+ x([
890
+ c()
891
+ ], w.prototype, "caipAddress", void 0);
892
+ x([
893
+ c()
894
+ ], w.prototype, "loading", void 0);
895
+ x([
896
+ c()
897
+ ], w.prototype, "paymentCurrency", void 0);
898
+ x([
899
+ c()
900
+ ], w.prototype, "paymentAmount", void 0);
901
+ x([
902
+ c()
903
+ ], w.prototype, "purchaseAmount", void 0);
904
+ x([
905
+ c()
906
+ ], w.prototype, "quoteLoading", void 0);
907
+ w = x([
908
+ b("w3m-onramp-widget")
909
+ ], w);
910
+ export {
911
+ d as W3mBuyInProgressView,
912
+ D as W3mOnRampProvidersView,
913
+ R as W3mOnrampFiatSelectView,
914
+ k as W3mOnrampTokensView,
915
+ w as W3mOnrampWidget,
916
+ L as W3mWhatIsABuyView
917
+ };