@directcryptopay/sdk 0.2.2 → 0.2.3

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 (228) hide show
  1. package/dist/ExchangeController-CPMQq6Q-.js +217 -0
  2. package/dist/HelpersUtil-DfMFC7Bf.js +120 -0
  3. package/dist/NavigationUtil-kj9LEOOd.js +8 -0
  4. package/dist/PhArrowCircleDown-lsK25DCk.js +73 -0
  5. package/dist/PhArrowClockwise-NeKHZ1co.js +73 -0
  6. package/dist/PhArrowDown-C9AkNvLs.js +73 -0
  7. package/dist/PhArrowLeft-RNfIQP1X.js +73 -0
  8. package/dist/PhArrowRight-DM1tna0G.js +73 -0
  9. package/dist/PhArrowSquareOut-S5XYbAZj.js +73 -0
  10. package/dist/PhArrowUp-DmktzOWy.js +73 -0
  11. package/dist/PhArrowUpRight-BkNeW_5i.js +73 -0
  12. package/dist/PhArrowsClockwise-CQ4pG76b.js +73 -0
  13. package/dist/PhArrowsDownUp-H6gxaNM6.js +73 -0
  14. package/dist/PhArrowsLeftRight-DZSsfMR6.js +73 -0
  15. package/dist/PhBank-4_9QzqIB.js +73 -0
  16. package/dist/PhBrowser-B-JSznId.js +73 -0
  17. package/dist/PhCaretDown-vV5oHMNi.js +73 -0
  18. package/dist/PhCaretLeft-BLo6Y_f4.js +73 -0
  19. package/dist/PhCaretRight-CqQN4TT3.js +73 -0
  20. package/dist/PhCaretUp-Df7UCAHy.js +73 -0
  21. package/dist/PhCheck-gtpfK4ed.js +73 -0
  22. package/dist/PhCircleHalf-Uq7dwDYw.js +73 -0
  23. package/dist/PhClock-SDCW-NmF.js +73 -0
  24. package/dist/PhCompass-B7hgtdx-.js +73 -0
  25. package/dist/PhCopy-BcnhyXCy.js +73 -0
  26. package/dist/PhCreditCard-BJjByVgu.js +73 -0
  27. package/dist/PhCurrencyDollar-B7ZXqXBy.js +73 -0
  28. package/dist/PhDesktop-B3VKPuJx.js +73 -0
  29. package/dist/PhDeviceMobile-Bnd0TYEH.js +73 -0
  30. package/dist/PhDotsThree-yyMWyZ-R.js +73 -0
  31. package/dist/PhEnvelope-67uzHbI9.js +73 -0
  32. package/dist/PhFunnelSimple-B-DCsloI.js +73 -0
  33. package/dist/PhGlobe-TMm_6qGk.js +73 -0
  34. package/dist/PhIdentificationCard-CePPD2xc.js +73 -0
  35. package/dist/PhImage-gY96WtHR.js +73 -0
  36. package/dist/PhInfo-DRQM_ZDP.js +73 -0
  37. package/dist/PhLightbulb-B0TxPfZ1.js +73 -0
  38. package/dist/PhMagnifyingGlass-B8si5_6W.js +73 -0
  39. package/dist/PhPaperPlaneRight-DVu5PLYd.js +73 -0
  40. package/dist/PhPlus-BfTsQnUz.js +73 -0
  41. package/dist/PhPower-CxYUGOWn.js +73 -0
  42. package/dist/PhPuzzlePiece-CQ4wh0gV.js +73 -0
  43. package/dist/PhQrCode-BuJ97NYJ.js +73 -0
  44. package/dist/PhQuestion-kJoP8Mja.js +73 -0
  45. package/dist/PhQuestionMark-C46ZkFpu.js +73 -0
  46. package/dist/PhSealCheck-Eh8jVqSN.js +73 -0
  47. package/dist/PhSignOut-jk97OSVt.js +73 -0
  48. package/dist/PhSpinner-CiYOhwMg.js +73 -0
  49. package/dist/PhTrash-pxerMqzd.js +73 -0
  50. package/dist/PhUser-BMg0VV4A.js +73 -0
  51. package/dist/PhVault-DYQvx5A-.js +73 -0
  52. package/dist/PhWarning-NLC5Mj87.js +73 -0
  53. package/dist/PhWarningCircle-Ch2jU9fA.js +73 -0
  54. package/dist/PhX-Bx4wpwm3.js +73 -0
  55. package/dist/SwapController-Cti0Cyxa.js +457 -0
  56. package/dist/{ccip-BIGqktC1.js → ccip-CKZd2XJ7.js} +4 -4
  57. package/dist/data-capture-7D5CL385.js +490 -0
  58. package/dist/dcp-sdk.umd.js +7400 -6589
  59. package/dist/email-AmK0INbZ.js +344 -0
  60. package/dist/embedded-wallet-Pn0I_XLn.js +820 -0
  61. package/dist/features-x8XNprEe.js +274 -0
  62. package/dist/{hashTypedData-ZH9ZnWu3.js → hashTypedData-B50-z0AA.js} +6 -6
  63. package/dist/if-defined-CdZSZ6UL.js +10 -0
  64. package/dist/index-4ewUtPPp.js +7981 -0
  65. package/dist/{index-D6h-qfpt.js → index-51l86yqx.js} +5 -5
  66. package/dist/index-B6K56LF_.js +85 -0
  67. package/dist/index-BAmv9PxJ.js +257 -0
  68. package/dist/index-BEswjY9r.js +117 -0
  69. package/dist/index-BSKRq56S.js +355 -0
  70. package/dist/index-BaygXQxx.js +172 -0
  71. package/dist/index-BcPxaHr5.js +118 -0
  72. package/dist/index-Bjt7nGaJ.js +199 -0
  73. package/dist/{index-D5r0iSq4.js → index-BkTSyAJb.js} +1 -1
  74. package/dist/index-Bmnl7l2U.js +555 -0
  75. package/dist/index-BvPvouSq.js +56 -0
  76. package/dist/index-C-6iznUO.js +174 -0
  77. package/dist/index-C4M5s_AM.js +228 -0
  78. package/dist/index-CEqcN8QP.js +1175 -0
  79. package/dist/{index-CPTcEPbD.js → index-CM3YaYca.js} +296 -298
  80. package/dist/{index-f3LXSfM5.js → index-CclBLA5r.js} +56 -142
  81. package/dist/index-ChTxJOiF.js +46 -0
  82. package/dist/index-CmAv0Tzr.js +86 -0
  83. package/dist/index-CmvoKY4x.js +125 -0
  84. package/dist/{index-BdSIrl-R.js → index-D7PmdQ9B.js} +578 -570
  85. package/dist/{index-DobBVPe4.js → index-D7k2Pc4e.js} +481 -236
  86. package/dist/index-D7lmgqUR.js +153 -0
  87. package/dist/index-DG_-qYze.js +107 -0
  88. package/dist/{index-Dy4NyE6l.js → index-DHot9Fdb.js} +7 -7
  89. package/dist/index-DV2LrPtU.js +123 -0
  90. package/dist/index-DYBaJQ2W.js +65 -0
  91. package/dist/{index-BJ7cbG3N.js → index-D_8VUmn1.js} +36688 -40208
  92. package/dist/index-D_gLn3rT.js +100 -0
  93. package/dist/index-DqcVUSC9.js +62 -0
  94. package/dist/index-I7VDqINw.js +128 -0
  95. package/dist/index-Oz72I9VP.js +209 -0
  96. package/dist/index-UclsHkJ0.js +118 -0
  97. package/dist/index-X8zir_1j.js +110 -0
  98. package/dist/index-XvlWKGCu.js +1281 -0
  99. package/dist/index-dO97xPlt.js +171 -0
  100. package/dist/{index-5mp7WkhV.js → index-uBeF6OAB.js} +2 -2
  101. package/dist/index-zeA_RiCV.js +159 -0
  102. package/dist/index.js +1 -1
  103. package/dist/{localBatchGatewayRequest-CjGcn5nM.js → localBatchGatewayRequest-BUZHGdjw.js} +1 -1
  104. package/dist/onramp-CdnBuF0r.js +855 -0
  105. package/dist/{parseSignature-S8VEpRHC.js → parseSignature-CcyTNGr4.js} +2312 -2313
  106. package/dist/pay-with-exchange-CSM6WCOV.js +525 -0
  107. package/dist/property-Bd8U3_QP.js +618 -0
  108. package/dist/receive-DooMu4Dx.js +232 -0
  109. package/dist/ref-CpgjXAw7.js +107 -0
  110. package/dist/send-3T7CyYic.js +1166 -0
  111. package/dist/socials-Dt-iHL17.js +620 -0
  112. package/dist/swaps-CjA9Es42.js +1760 -0
  113. package/dist/{transactions-DujFkB-M.js → transactions-nRm9DVzn.js} +10 -10
  114. package/dist/w3m-modal-NV25AXhM.js +1706 -0
  115. package/package.json +3 -3
  116. package/dist/ConstantsUtil-B-_-u8aQ.js +0 -6
  117. package/dist/add-sji6scSD.js +0 -19
  118. package/dist/all-wallets-B4H-890E.js +0 -10
  119. package/dist/app-store-Z433s97G.js +0 -21
  120. package/dist/apple-b8Lxj7nb.js +0 -22
  121. package/dist/arrow-bottom-M9oWWo_9.js +0 -12
  122. package/dist/arrow-bottom-circle-N9c4CXY1.js +0 -15
  123. package/dist/arrow-left-Dw8AKfwf.js +0 -12
  124. package/dist/arrow-right-DwLQZSC_.js +0 -12
  125. package/dist/arrow-top-zhUjkBe1.js +0 -12
  126. package/dist/bank-CbQdnILK.js +0 -18
  127. package/dist/browser-xAqNwt7z.js +0 -18
  128. package/dist/card-Dr1QBmWp.js +0 -18
  129. package/dist/checkmark-BhT1dTgG.js +0 -15
  130. package/dist/checkmark-bold-CPB29wqQ.js +0 -12
  131. package/dist/chevron-bottom-BhNyx2II.js +0 -12
  132. package/dist/chevron-left-CGuEjQlY.js +0 -12
  133. package/dist/chevron-right-CvIRRsqZ.js +0 -12
  134. package/dist/chevron-top-RSzCqjBd.js +0 -12
  135. package/dist/chrome-store-Cs8dAgs0.js +0 -65
  136. package/dist/clock-fhZO5otC.js +0 -12
  137. package/dist/close-BPuztrdR.js +0 -12
  138. package/dist/coinPlaceholder-C8X2i7Kh.js +0 -12
  139. package/dist/compass-WMc5huk0.js +0 -12
  140. package/dist/copy-DVAeT17y.js +0 -19
  141. package/dist/cursor-BJ4YLXfy.js +0 -7
  142. package/dist/cursor-transparent-DN2fLQN4.js +0 -16
  143. package/dist/desktop-6avxisBw.js +0 -13
  144. package/dist/disconnect-AReVI8Gk.js +0 -12
  145. package/dist/discord-CxrI30BZ.js +0 -21
  146. package/dist/email-B8dIIaay.js +0 -696
  147. package/dist/embedded-wallet-C_5hF7rM.js +0 -468
  148. package/dist/etherscan-BnAy8cIF.js +0 -10
  149. package/dist/exclamation-triangle-Bu7nHwx9.js +0 -8
  150. package/dist/extension-F0LIhvcf.js +0 -12
  151. package/dist/external-link-CP6phyaM.js +0 -12
  152. package/dist/facebook-BtQ-Io2y.js +0 -30
  153. package/dist/farcaster-BmaN1ugd.js +0 -16
  154. package/dist/filters-DpEwoOmy.js +0 -12
  155. package/dist/github-q7qO9V-b.js +0 -22
  156. package/dist/google-DH_ZE8bW.js +0 -22
  157. package/dist/help-circle-BAQVmKas.js +0 -16
  158. package/dist/id-Cj68Zwgo.js +0 -16
  159. package/dist/if-defined-CNte9B3N.js +0 -744
  160. package/dist/image-BKJDw6N-.js +0 -8
  161. package/dist/index-7toZMdtG.js +0 -573
  162. package/dist/index-B1uKzdvN.js +0 -170
  163. package/dist/index-BHFZVF-b.js +0 -257
  164. package/dist/index-BKwa5JSA.js +0 -559
  165. package/dist/index-BP4B9VUt.js +0 -54
  166. package/dist/index-BVdzXHpO.js +0 -181
  167. package/dist/index-BYND0GJ9.js +0 -146
  168. package/dist/index-BaJ0zEbh.js +0 -97
  169. package/dist/index-Bh0MPFwP.js +0 -58
  170. package/dist/index-Bsh7_qTp.js +0 -511
  171. package/dist/index-BwnXTNNg.js +0 -199
  172. package/dist/index-C0kPDbg_.js +0 -77
  173. package/dist/index-CKikVKe2.js +0 -75
  174. package/dist/index-ChVh0Hkp.js +0 -243
  175. package/dist/index-Cle_NnnS.js +0 -305
  176. package/dist/index-CmWdvIFT.js +0 -51
  177. package/dist/index-D2AMA8Bu.js +0 -65
  178. package/dist/index-DAUM8CO4.js +0 -65
  179. package/dist/index-DGjZW6uR.js +0 -78
  180. package/dist/index-DQe94z7X.js +0 -265
  181. package/dist/index-DTo6w99t.js +0 -7864
  182. package/dist/index-DYdXjap2.js +0 -320
  183. package/dist/index-DceCxNV5.js +0 -181
  184. package/dist/index-Uw9cSw0q.js +0 -294
  185. package/dist/index-qiuyrukh.js +0 -45
  186. package/dist/index-zddvaohA.js +0 -78
  187. package/dist/info-RfPsmroW.js +0 -7
  188. package/dist/info-circle-DFKHB_ZN.js +0 -16
  189. package/dist/lightbulb-B-Bykj9X.js +0 -7
  190. package/dist/mail-mBAgGuw5.js +0 -12
  191. package/dist/mobile-Dhh3ndkf.js +0 -13
  192. package/dist/more-D1h7UTvg.js +0 -15
  193. package/dist/network-placeholder-Dqynvc-t.js +0 -18
  194. package/dist/nftPlaceholder-Df7MW4MM.js +0 -12
  195. package/dist/off-BmG3cHTX.js +0 -12
  196. package/dist/onramp-C401Aenb.js +0 -1279
  197. package/dist/play-store-4q1fzL_P.js +0 -36
  198. package/dist/plus-603Gs3yG.js +0 -17
  199. package/dist/qr-code-Dgwhf6M1.js +0 -10
  200. package/dist/receive-CYXbbEUR.js +0 -186
  201. package/dist/recycle-horizontal-Bu8zZ563.js +0 -13
  202. package/dist/ref-DpmKRWBK.js +0 -41
  203. package/dist/refresh-BMZFu0mu.js +0 -12
  204. package/dist/reown-logo-BXph7ThY.js +0 -16
  205. package/dist/search-Cm_V42Y_.js +0 -12
  206. package/dist/secp256k1-C0iX1TUr.js +0 -1510
  207. package/dist/secp256k1-DOQBqE4Z.js +0 -1302
  208. package/dist/send-BSMYxDuP.js +0 -19
  209. package/dist/send-C8EeIzRB.js +0 -1038
  210. package/dist/socials-DQrHQajs.js +0 -574
  211. package/dist/swapHorizontal-98rnJewS.js +0 -12
  212. package/dist/swapHorizontalBold-C299FjEt.js +0 -12
  213. package/dist/swapHorizontalMedium-Cqm6i4WJ.js +0 -20
  214. package/dist/swapHorizontalRoundedBold-De7hFfqZ.js +0 -12
  215. package/dist/swapVertical-DSL75l8L.js +0 -12
  216. package/dist/swaps-BuTNp65Y.js +0 -1637
  217. package/dist/telegram-cJP7hgUb.js +0 -20
  218. package/dist/three-dots-DHnEh28O.js +0 -9
  219. package/dist/twitch-CR2iGcBo.js +0 -22
  220. package/dist/twitterIcon-E5TAQjOn.js +0 -10
  221. package/dist/verify-DEukUJp0.js +0 -12
  222. package/dist/verify-filled-BXsx1i_p.js +0 -12
  223. package/dist/w3m-modal-Bm7BqVng.js +0 -1037
  224. package/dist/wallet-CzyyvdrT.js +0 -12
  225. package/dist/wallet-placeholder-BrcmyGEe.js +0 -18
  226. package/dist/walletconnect-BSYogWiE.js +0 -36
  227. package/dist/warning-circle-Cgp2BW3m.js +0 -16
  228. package/dist/x-BJinLpTw.js +0 -16
@@ -0,0 +1,855 @@
1
+ import { cU as O, cX as b, dG as c, dH as C, cM as T, cY as u, df as $, cE as I, dh as E, d0 as D, cG as B, cF as z, d3 as V, d4 as M, d1 as K, di as F, cH as W } from "./index-D_8VUmn1.js";
2
+ import { r as l, c as g, n as p } from "./index-CEqcN8QP.js";
3
+ import { o as m } from "./if-defined-CdZSZ6UL.js";
4
+ import "./index-BcPxaHr5.js";
5
+ import { O as j } from "./index-BAmv9PxJ.js";
6
+ import "./index-I7VDqINw.js";
7
+ import "./index-CmAv0Tzr.js";
8
+ import "./index-CclBLA5r.js";
9
+ import "./index-dO97xPlt.js";
10
+ import "./index-Oz72I9VP.js";
11
+ import "./index-UclsHkJ0.js";
12
+ import "./index-X8zir_1j.js";
13
+ import "./index-DYBaJQ2W.js";
14
+ import "./index-C4M5s_AM.js";
15
+ const Y = O`
16
+ :host > wui-grid {
17
+ max-height: 360px;
18
+ overflow: auto;
19
+ }
20
+
21
+ wui-flex {
22
+ transition: opacity ${({ easings: t }) => t["ease-out-power-1"]}
23
+ ${({ durations: t }) => t.md};
24
+ will-change: opacity;
25
+ }
26
+
27
+ wui-grid::-webkit-scrollbar {
28
+ display: none;
29
+ }
30
+
31
+ wui-flex.disabled {
32
+ opacity: 0.3;
33
+ pointer-events: none;
34
+ user-select: none;
35
+ }
36
+ `;
37
+ var A = function(t, e, i, o) {
38
+ var n = arguments.length, r = n < 3 ? e : o === null ? o = Object.getOwnPropertyDescriptor(e, i) : o, s;
39
+ if (typeof Reflect == "object" && typeof Reflect.decorate == "function") r = Reflect.decorate(t, e, i, o);
40
+ else for (var a = t.length - 1; a >= 0; a--) (s = t[a]) && (r = (n < 3 ? s(r) : n > 3 ? s(e, i, r) : s(e, i)) || r);
41
+ return n > 3 && r && Object.defineProperty(e, i, r), r;
42
+ };
43
+ let P = class extends b {
44
+ constructor() {
45
+ super(), this.unsubscribe = [], this.selectedCurrency = c.state.paymentCurrency, this.currencies = c.state.paymentCurrencies, this.currencyImages = C.state.currencyImages, this.checked = j.state.isLegalCheckboxChecked, this.unsubscribe.push(c.subscribe((e) => {
46
+ this.selectedCurrency = e.paymentCurrency, this.currencies = e.paymentCurrencies;
47
+ }), C.subscribeKey("currencyImages", (e) => this.currencyImages = e), j.subscribeKey("isLegalCheckboxChecked", (e) => {
48
+ this.checked = e;
49
+ }));
50
+ }
51
+ disconnectedCallback() {
52
+ this.unsubscribe.forEach((e) => e());
53
+ }
54
+ render() {
55
+ var a;
56
+ const { termsConditionsUrl: e, privacyPolicyUrl: i } = T.state, o = (a = T.state.features) == null ? void 0 : a.legalCheckbox, s = !!(e || i) && !!o && !this.checked;
57
+ return u`
58
+ <w3m-legal-checkbox></w3m-legal-checkbox>
59
+ <wui-flex
60
+ flexDirection="column"
61
+ .padding=${["0", "3", "3", "3"]}
62
+ gap="2"
63
+ class=${m(s ? "disabled" : void 0)}
64
+ >
65
+ ${this.currenciesTemplate(s)}
66
+ </wui-flex>
67
+ `;
68
+ }
69
+ currenciesTemplate(e = !1) {
70
+ return this.currencies.map((i) => {
71
+ var o;
72
+ return u`
73
+ <wui-list-item
74
+ imageSrc=${m((o = this.currencyImages) == null ? void 0 : o[i.id])}
75
+ @click=${() => this.selectCurrency(i)}
76
+ variant="image"
77
+ tabIdx=${m(e ? -1 : void 0)}
78
+ >
79
+ <wui-text variant="md-medium" color="primary">${i.id}</wui-text>
80
+ </wui-list-item>
81
+ `;
82
+ });
83
+ }
84
+ selectCurrency(e) {
85
+ e && (c.setPaymentCurrency(e), $.close());
86
+ }
87
+ };
88
+ P.styles = Y;
89
+ A([
90
+ l()
91
+ ], P.prototype, "selectedCurrency", void 0);
92
+ A([
93
+ l()
94
+ ], P.prototype, "currencies", void 0);
95
+ A([
96
+ l()
97
+ ], P.prototype, "currencyImages", void 0);
98
+ A([
99
+ l()
100
+ ], P.prototype, "checked", void 0);
101
+ P = A([
102
+ g("w3m-onramp-fiat-select-view")
103
+ ], P);
104
+ const N = O`
105
+ button {
106
+ padding: ${({ spacing: t }) => t[3]};
107
+ border-radius: ${({ borderRadius: t }) => t[4]};
108
+ border: none;
109
+ outline: none;
110
+ background-color: ${({ tokens: t }) => t.core.glass010};
111
+ width: 100%;
112
+ display: flex;
113
+ align-items: center;
114
+ justify-content: flex-start;
115
+ gap: ${({ spacing: t }) => t[3]};
116
+ transition: background-color ${({ easings: t }) => t["ease-out-power-1"]}
117
+ ${({ durations: t }) => t.md};
118
+ will-change: background-color;
119
+ cursor: pointer;
120
+ }
121
+
122
+ button:hover {
123
+ background-color: ${({ tokens: t }) => t.theme.foregroundPrimary};
124
+ }
125
+
126
+ .provider-image {
127
+ width: ${({ spacing: t }) => t[10]};
128
+ min-width: ${({ spacing: t }) => t[10]};
129
+ height: ${({ spacing: t }) => t[10]};
130
+ border-radius: calc(
131
+ ${({ borderRadius: t }) => t[4]} - calc(${({ spacing: t }) => t[3]} / 2)
132
+ );
133
+ position: relative;
134
+ overflow: hidden;
135
+ }
136
+
137
+ .network-icon {
138
+ width: ${({ spacing: t }) => t[3]};
139
+ height: ${({ spacing: t }) => t[3]};
140
+ border-radius: calc(${({ spacing: t }) => t[3]} / 2);
141
+ overflow: hidden;
142
+ box-shadow:
143
+ 0 0 0 3px ${({ tokens: t }) => t.theme.foregroundPrimary},
144
+ 0 0 0 3px ${({ tokens: t }) => t.theme.backgroundPrimary};
145
+ transition: box-shadow ${({ easings: t }) => t["ease-out-power-1"]}
146
+ ${({ durations: t }) => t.md};
147
+ will-change: box-shadow;
148
+ }
149
+
150
+ button:hover .network-icon {
151
+ box-shadow:
152
+ 0 0 0 3px ${({ tokens: t }) => t.core.glass010},
153
+ 0 0 0 3px ${({ tokens: t }) => t.theme.backgroundPrimary};
154
+ }
155
+ `;
156
+ var v = function(t, e, i, o) {
157
+ var n = arguments.length, r = n < 3 ? e : o === null ? o = Object.getOwnPropertyDescriptor(e, i) : o, s;
158
+ if (typeof Reflect == "object" && typeof Reflect.decorate == "function") r = Reflect.decorate(t, e, i, o);
159
+ else for (var a = t.length - 1; a >= 0; a--) (s = t[a]) && (r = (n < 3 ? s(r) : n > 3 ? s(e, i, r) : s(e, i)) || r);
160
+ return n > 3 && r && Object.defineProperty(e, i, r), r;
161
+ };
162
+ let h = class extends b {
163
+ constructor() {
164
+ super(...arguments), this.disabled = !1, this.color = "inherit", this.label = "", this.feeRange = "", this.loading = !1, this.onClick = null;
165
+ }
166
+ render() {
167
+ return u`
168
+ <button ?disabled=${this.disabled} @click=${this.onClick} ontouchstart>
169
+ <wui-visual name=${m(this.name)} class="provider-image"></wui-visual>
170
+ <wui-flex flexDirection="column" gap="01">
171
+ <wui-text variant="md-regular" color="primary">${this.label}</wui-text>
172
+ <wui-flex alignItems="center" justifyContent="flex-start" gap="4">
173
+ <wui-text variant="sm-medium" color="primary">
174
+ <wui-text variant="sm-regular" color="secondary">Fees</wui-text>
175
+ ${this.feeRange}
176
+ </wui-text>
177
+ <wui-flex gap="2">
178
+ <wui-icon name="bank" size="sm" color="default"></wui-icon>
179
+ <wui-icon name="card" size="sm" color="default"></wui-icon>
180
+ </wui-flex>
181
+ ${this.networksTemplate()}
182
+ </wui-flex>
183
+ </wui-flex>
184
+ ${this.loading ? u`<wui-loading-spinner color="secondary" size="md"></wui-loading-spinner>` : u`<wui-icon name="chevronRight" color="default" size="sm"></wui-icon>`}
185
+ </button>
186
+ `;
187
+ }
188
+ networksTemplate() {
189
+ var o;
190
+ const e = I.getAllRequestedCaipNetworks(), i = (o = e == null ? void 0 : e.filter((n) => {
191
+ var r;
192
+ return (r = n == null ? void 0 : n.assets) == null ? void 0 : r.imageId;
193
+ })) == null ? void 0 : o.slice(0, 5);
194
+ return u`
195
+ <wui-flex class="networks">
196
+ ${i == null ? void 0 : i.map((n) => u`
197
+ <wui-flex class="network-icon">
198
+ <wui-image src=${m(E.getNetworkImage(n))}></wui-image>
199
+ </wui-flex>
200
+ `)}
201
+ </wui-flex>
202
+ `;
203
+ }
204
+ };
205
+ h.styles = [N];
206
+ v([
207
+ p({ type: Boolean })
208
+ ], h.prototype, "disabled", void 0);
209
+ v([
210
+ p()
211
+ ], h.prototype, "color", void 0);
212
+ v([
213
+ p()
214
+ ], h.prototype, "name", void 0);
215
+ v([
216
+ p()
217
+ ], h.prototype, "label", void 0);
218
+ v([
219
+ p()
220
+ ], h.prototype, "feeRange", void 0);
221
+ v([
222
+ p({ type: Boolean })
223
+ ], h.prototype, "loading", void 0);
224
+ v([
225
+ p()
226
+ ], h.prototype, "onClick", void 0);
227
+ h = v([
228
+ g("w3m-onramp-provider-item")
229
+ ], h);
230
+ var S = function(t, e, i, o) {
231
+ var n = arguments.length, r = n < 3 ? e : o === null ? o = Object.getOwnPropertyDescriptor(e, i) : o, s;
232
+ if (typeof Reflect == "object" && typeof Reflect.decorate == "function") r = Reflect.decorate(t, e, i, o);
233
+ else for (var a = t.length - 1; a >= 0; a--) (s = t[a]) && (r = (n < 3 ? s(r) : n > 3 ? s(e, i, r) : s(e, i)) || r);
234
+ return n > 3 && r && Object.defineProperty(e, i, r), r;
235
+ };
236
+ let U = class extends b {
237
+ constructor() {
238
+ super(), this.unsubscribe = [], this.providers = c.state.providers, this.unsubscribe.push(c.subscribeKey("providers", (e) => {
239
+ this.providers = e;
240
+ }));
241
+ }
242
+ render() {
243
+ return u`
244
+ <wui-flex flexDirection="column" .padding=${["0", "3", "3", "3"]} gap="2">
245
+ ${this.onRampProvidersTemplate()}
246
+ </wui-flex>
247
+ `;
248
+ }
249
+ onRampProvidersTemplate() {
250
+ return this.providers.filter((e) => e.supportedChains.includes(I.state.activeChain ?? "eip155")).map((e) => u`
251
+ <w3m-onramp-provider-item
252
+ label=${e.label}
253
+ name=${e.name}
254
+ feeRange=${e.feeRange}
255
+ @click=${() => {
256
+ this.onClickProvider(e);
257
+ }}
258
+ ?disabled=${!e.url}
259
+ data-testid=${`onramp-provider-${e.name}`}
260
+ ></w3m-onramp-provider-item>
261
+ `);
262
+ }
263
+ onClickProvider(e) {
264
+ var i;
265
+ c.setSelectedProvider(e), D.push("BuyInProgress"), B.openHref(((i = c.state.selectedProvider) == null ? void 0 : i.url) || e.url, "popupWindow", "width=600,height=800,scrollbars=yes"), z.sendEvent({
266
+ type: "track",
267
+ event: "SELECT_BUY_PROVIDER",
268
+ properties: {
269
+ provider: e.name,
270
+ isSmartAccount: V(I.state.activeChain) === M.ACCOUNT_TYPES.SMART_ACCOUNT
271
+ }
272
+ });
273
+ }
274
+ };
275
+ S([
276
+ l()
277
+ ], U.prototype, "providers", void 0);
278
+ U = S([
279
+ g("w3m-onramp-providers-view")
280
+ ], U);
281
+ const q = O`
282
+ :host > wui-grid {
283
+ max-height: 360px;
284
+ overflow: auto;
285
+ }
286
+
287
+ wui-flex {
288
+ transition: opacity ${({ easings: t }) => t["ease-out-power-1"]}
289
+ ${({ durations: t }) => t.md};
290
+ will-change: opacity;
291
+ }
292
+
293
+ wui-grid::-webkit-scrollbar {
294
+ display: none;
295
+ }
296
+
297
+ wui-flex.disabled {
298
+ opacity: 0.3;
299
+ pointer-events: none;
300
+ user-select: none;
301
+ }
302
+ `;
303
+ var _ = function(t, e, i, o) {
304
+ var n = arguments.length, r = n < 3 ? e : o === null ? o = Object.getOwnPropertyDescriptor(e, i) : o, s;
305
+ if (typeof Reflect == "object" && typeof Reflect.decorate == "function") r = Reflect.decorate(t, e, i, o);
306
+ else for (var a = t.length - 1; a >= 0; a--) (s = t[a]) && (r = (n < 3 ? s(r) : n > 3 ? s(e, i, r) : s(e, i)) || r);
307
+ return n > 3 && r && Object.defineProperty(e, i, r), r;
308
+ };
309
+ let k = class extends b {
310
+ constructor() {
311
+ super(), this.unsubscribe = [], this.selectedCurrency = c.state.purchaseCurrencies, this.tokens = c.state.purchaseCurrencies, this.tokenImages = C.state.tokenImages, this.checked = j.state.isLegalCheckboxChecked, this.unsubscribe.push(c.subscribe((e) => {
312
+ this.selectedCurrency = e.purchaseCurrencies, this.tokens = e.purchaseCurrencies;
313
+ }), C.subscribeKey("tokenImages", (e) => this.tokenImages = e), j.subscribeKey("isLegalCheckboxChecked", (e) => {
314
+ this.checked = e;
315
+ }));
316
+ }
317
+ disconnectedCallback() {
318
+ this.unsubscribe.forEach((e) => e());
319
+ }
320
+ render() {
321
+ var a;
322
+ const { termsConditionsUrl: e, privacyPolicyUrl: i } = T.state, o = (a = T.state.features) == null ? void 0 : a.legalCheckbox, s = !!(e || i) && !!o && !this.checked;
323
+ return u`
324
+ <w3m-legal-checkbox></w3m-legal-checkbox>
325
+ <wui-flex
326
+ flexDirection="column"
327
+ .padding=${["0", "3", "3", "3"]}
328
+ gap="2"
329
+ class=${m(s ? "disabled" : void 0)}
330
+ >
331
+ ${this.currenciesTemplate(s)}
332
+ </wui-flex>
333
+ `;
334
+ }
335
+ currenciesTemplate(e = !1) {
336
+ return this.tokens.map((i) => {
337
+ var o;
338
+ return u`
339
+ <wui-list-item
340
+ imageSrc=${m((o = this.tokenImages) == null ? void 0 : o[i.symbol])}
341
+ @click=${() => this.selectToken(i)}
342
+ variant="image"
343
+ tabIdx=${m(e ? -1 : void 0)}
344
+ >
345
+ <wui-flex gap="1" alignItems="center">
346
+ <wui-text variant="md-medium" color="primary">${i.name}</wui-text>
347
+ <wui-text variant="sm-regular" color="secondary">${i.symbol}</wui-text>
348
+ </wui-flex>
349
+ </wui-list-item>
350
+ `;
351
+ });
352
+ }
353
+ selectToken(e) {
354
+ e && (c.setPurchaseCurrency(e), $.close());
355
+ }
356
+ };
357
+ k.styles = q;
358
+ _([
359
+ l()
360
+ ], k.prototype, "selectedCurrency", void 0);
361
+ _([
362
+ l()
363
+ ], k.prototype, "tokens", void 0);
364
+ _([
365
+ l()
366
+ ], k.prototype, "tokenImages", void 0);
367
+ _([
368
+ l()
369
+ ], k.prototype, "checked", void 0);
370
+ k = _([
371
+ g("w3m-onramp-token-select-view")
372
+ ], k);
373
+ const X = O`
374
+ @keyframes shake {
375
+ 0% {
376
+ transform: translateX(0);
377
+ }
378
+ 25% {
379
+ transform: translateX(3px);
380
+ }
381
+ 50% {
382
+ transform: translateX(-3px);
383
+ }
384
+ 75% {
385
+ transform: translateX(3px);
386
+ }
387
+ 100% {
388
+ transform: translateX(0);
389
+ }
390
+ }
391
+
392
+ wui-flex:first-child:not(:only-child) {
393
+ position: relative;
394
+ }
395
+
396
+ wui-loading-thumbnail {
397
+ position: absolute;
398
+ }
399
+
400
+ wui-visual {
401
+ border-radius: calc(
402
+ ${({ borderRadius: t }) => t[1]} * 9 - ${({ borderRadius: t }) => t[3]}
403
+ );
404
+ position: relative;
405
+ overflow: hidden;
406
+ }
407
+
408
+ wui-icon-box {
409
+ position: absolute;
410
+ right: calc(${({ spacing: t }) => t[1]} * -1);
411
+ bottom: calc(${({ spacing: t }) => t[1]} * -1);
412
+ opacity: 0;
413
+ transform: scale(0.5);
414
+ transition:
415
+ opacity ${({ durations: t }) => t.lg} ${({ easings: t }) => t["ease-out-power-2"]},
416
+ transform ${({ durations: t }) => t.lg}
417
+ ${({ easings: t }) => t["ease-out-power-2"]};
418
+ will-change: opacity, transform;
419
+ }
420
+
421
+ wui-text[align='center'] {
422
+ width: 100%;
423
+ padding: 0px ${({ spacing: t }) => t[4]};
424
+ }
425
+
426
+ [data-error='true'] wui-icon-box {
427
+ opacity: 1;
428
+ transform: scale(1);
429
+ }
430
+
431
+ [data-error='true'] > wui-flex:first-child {
432
+ animation: shake 250ms ${({ easings: t }) => t["ease-out-power-2"]} both;
433
+ }
434
+
435
+ [data-retry='false'] wui-link {
436
+ display: none;
437
+ }
438
+
439
+ [data-retry='true'] wui-link {
440
+ display: block;
441
+ opacity: 1;
442
+ }
443
+
444
+ wui-link {
445
+ padding: ${({ spacing: t }) => t["01"]} ${({ spacing: t }) => t[2]};
446
+ }
447
+ `;
448
+ var y = function(t, e, i, o) {
449
+ var n = arguments.length, r = n < 3 ? e : o === null ? o = Object.getOwnPropertyDescriptor(e, i) : o, s;
450
+ if (typeof Reflect == "object" && typeof Reflect.decorate == "function") r = Reflect.decorate(t, e, i, o);
451
+ else for (var a = t.length - 1; a >= 0; a--) (s = t[a]) && (r = (n < 3 ? s(r) : n > 3 ? s(e, i, r) : s(e, i)) || r);
452
+ return n > 3 && r && Object.defineProperty(e, i, r), r;
453
+ };
454
+ let d = class extends b {
455
+ constructor() {
456
+ super(), this.unsubscribe = [], this.selectedOnRampProvider = c.state.selectedProvider, this.uri = K.state.wcUri, this.ready = !1, this.showRetry = !1, this.buffering = !1, this.error = !1, this.isMobile = !1, this.onRetry = void 0, this.unsubscribe.push(c.subscribeKey("selectedProvider", (e) => {
457
+ this.selectedOnRampProvider = e;
458
+ }));
459
+ }
460
+ disconnectedCallback() {
461
+ this.intervalId && clearInterval(this.intervalId);
462
+ }
463
+ render() {
464
+ var o, n;
465
+ let e = "Continue in external window";
466
+ this.error ? e = "Buy failed" : this.selectedOnRampProvider && (e = `Buy in ${(o = this.selectedOnRampProvider) == null ? void 0 : o.label}`);
467
+ const i = 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";
468
+ return u`
469
+ <wui-flex
470
+ data-error=${m(this.error)}
471
+ data-retry=${this.showRetry}
472
+ flexDirection="column"
473
+ alignItems="center"
474
+ .padding=${["10", "5", "5", "5"]}
475
+ gap="5"
476
+ >
477
+ <wui-flex justifyContent="center" alignItems="center">
478
+ <wui-visual
479
+ name=${m((n = this.selectedOnRampProvider) == null ? void 0 : n.name)}
480
+ size="lg"
481
+ class="provider-image"
482
+ >
483
+ </wui-visual>
484
+
485
+ ${this.error ? null : this.loaderTemplate()}
486
+
487
+ <wui-icon-box
488
+ color="error"
489
+ icon="close"
490
+ size="sm"
491
+ border
492
+ borderColor="wui-color-bg-125"
493
+ ></wui-icon-box>
494
+ </wui-flex>
495
+
496
+ <wui-flex
497
+ flexDirection="column"
498
+ alignItems="center"
499
+ gap="2"
500
+ .padding=${["4", "0", "0", "0"]}
501
+ >
502
+ <wui-text variant="md-medium" color=${this.error ? "error" : "primary"}>
503
+ ${e}
504
+ </wui-text>
505
+ <wui-text align="center" variant="sm-medium" color="secondary">${i}</wui-text>
506
+ </wui-flex>
507
+
508
+ ${this.error ? this.tryAgainTemplate() : null}
509
+ </wui-flex>
510
+
511
+ <wui-flex .padding=${["0", "5", "5", "5"]} justifyContent="center">
512
+ <wui-link @click=${this.onCopyUri} color="secondary">
513
+ <wui-icon size="sm" color="default" slot="iconLeft" name="copy"></wui-icon>
514
+ Copy link
515
+ </wui-link>
516
+ </wui-flex>
517
+ `;
518
+ }
519
+ onTryAgain() {
520
+ this.selectedOnRampProvider && (this.error = !1, B.openHref(this.selectedOnRampProvider.url, "popupWindow", "width=600,height=800,scrollbars=yes"));
521
+ }
522
+ tryAgainTemplate() {
523
+ var e;
524
+ return (e = this.selectedOnRampProvider) != null && e.url ? u`<wui-button size="md" variant="accent" @click=${this.onTryAgain.bind(this)}>
525
+ <wui-icon color="inherit" slot="iconLeft" name="refresh"></wui-icon>
526
+ Try again
527
+ </wui-button>` : null;
528
+ }
529
+ loaderTemplate() {
530
+ const e = F.state.themeVariables["--w3m-border-radius-master"], i = e ? parseInt(e.replace("px", ""), 10) : 4;
531
+ return u`<wui-loading-thumbnail radius=${i * 9}></wui-loading-thumbnail>`;
532
+ }
533
+ onCopyUri() {
534
+ var e;
535
+ if (!((e = this.selectedOnRampProvider) != null && e.url)) {
536
+ W.showError("No link found"), D.goBack();
537
+ return;
538
+ }
539
+ try {
540
+ B.copyToClopboard(this.selectedOnRampProvider.url), W.showSuccess("Link copied");
541
+ } catch {
542
+ W.showError("Failed to copy");
543
+ }
544
+ }
545
+ };
546
+ d.styles = X;
547
+ y([
548
+ l()
549
+ ], d.prototype, "intervalId", void 0);
550
+ y([
551
+ l()
552
+ ], d.prototype, "selectedOnRampProvider", void 0);
553
+ y([
554
+ l()
555
+ ], d.prototype, "uri", void 0);
556
+ y([
557
+ l()
558
+ ], d.prototype, "ready", void 0);
559
+ y([
560
+ l()
561
+ ], d.prototype, "showRetry", void 0);
562
+ y([
563
+ l()
564
+ ], d.prototype, "buffering", void 0);
565
+ y([
566
+ l()
567
+ ], d.prototype, "error", void 0);
568
+ y([
569
+ p({ type: Boolean })
570
+ ], d.prototype, "isMobile", void 0);
571
+ y([
572
+ p()
573
+ ], d.prototype, "onRetry", void 0);
574
+ d = y([
575
+ g("w3m-buy-in-progress-view")
576
+ ], d);
577
+ var H = function(t, e, i, o) {
578
+ var n = arguments.length, r = n < 3 ? e : o === null ? o = Object.getOwnPropertyDescriptor(e, i) : o, s;
579
+ if (typeof Reflect == "object" && typeof Reflect.decorate == "function") r = Reflect.decorate(t, e, i, o);
580
+ else for (var a = t.length - 1; a >= 0; a--) (s = t[a]) && (r = (n < 3 ? s(r) : n > 3 ? s(e, i, r) : s(e, i)) || r);
581
+ return n > 3 && r && Object.defineProperty(e, i, r), r;
582
+ };
583
+ let L = class extends b {
584
+ render() {
585
+ return u`
586
+ <wui-flex
587
+ flexDirection="column"
588
+ .padding=${["6", "10", "5", "10"]}
589
+ alignItems="center"
590
+ gap="5"
591
+ >
592
+ <wui-visual name="onrampCard"></wui-visual>
593
+ <wui-flex flexDirection="column" gap="2" alignItems="center">
594
+ <wui-text align="center" variant="md-medium" color="primary">
595
+ Quickly and easily buy digital assets!
596
+ </wui-text>
597
+ <wui-text align="center" variant="sm-regular" color="secondary">
598
+ Simply select your preferred onramp provider and add digital assets to your account
599
+ using your credit card or bank transfer
600
+ </wui-text>
601
+ </wui-flex>
602
+ <wui-button @click=${D.goBack}>
603
+ <wui-icon size="sm" color="inherit" name="add" slot="iconLeft"></wui-icon>
604
+ Buy
605
+ </wui-button>
606
+ </wui-flex>
607
+ `;
608
+ }
609
+ };
610
+ L = H([
611
+ g("w3m-what-is-a-buy-view")
612
+ ], L);
613
+ const Q = O`
614
+ :host {
615
+ width: 100%;
616
+ }
617
+
618
+ wui-loading-spinner {
619
+ position: absolute;
620
+ top: 50%;
621
+ right: 20px;
622
+ transform: translateY(-50%);
623
+ }
624
+
625
+ .currency-container {
626
+ position: absolute;
627
+ top: 50%;
628
+ transform: translateY(-50%);
629
+ right: ${({ spacing: t }) => t[2]};
630
+ height: 40px;
631
+ padding: ${({ spacing: t }) => t[2]} ${({ spacing: t }) => t[2]}
632
+ ${({ spacing: t }) => t[2]} ${({ spacing: t }) => t[2]};
633
+ min-width: 95px;
634
+ border-radius: ${({ borderRadius: t }) => t.round};
635
+ border: 1px solid ${({ tokens: t }) => t.theme.foregroundPrimary};
636
+ background: ${({ tokens: t }) => t.theme.foregroundPrimary};
637
+ cursor: pointer;
638
+ }
639
+
640
+ .currency-container > wui-image {
641
+ height: 24px;
642
+ width: 24px;
643
+ border-radius: 50%;
644
+ }
645
+ `;
646
+ var R = function(t, e, i, o) {
647
+ var n = arguments.length, r = n < 3 ? e : o === null ? o = Object.getOwnPropertyDescriptor(e, i) : o, s;
648
+ if (typeof Reflect == "object" && typeof Reflect.decorate == "function") r = Reflect.decorate(t, e, i, o);
649
+ else for (var a = t.length - 1; a >= 0; a--) (s = t[a]) && (r = (n < 3 ? s(r) : n > 3 ? s(e, i, r) : s(e, i)) || r);
650
+ return n > 3 && r && Object.defineProperty(e, i, r), r;
651
+ };
652
+ let w = class extends b {
653
+ constructor() {
654
+ var e;
655
+ super(), this.unsubscribe = [], this.type = "Token", this.value = 0, this.currencies = [], this.selectedCurrency = (e = this.currencies) == null ? void 0 : e[0], this.currencyImages = C.state.currencyImages, this.tokenImages = C.state.tokenImages, this.unsubscribe.push(c.subscribeKey("purchaseCurrency", (i) => {
656
+ !i || this.type === "Fiat" || (this.selectedCurrency = this.formatPurchaseCurrency(i));
657
+ }), c.subscribeKey("paymentCurrency", (i) => {
658
+ !i || this.type === "Token" || (this.selectedCurrency = this.formatPaymentCurrency(i));
659
+ }), c.subscribe((i) => {
660
+ this.type === "Fiat" ? this.currencies = i.purchaseCurrencies.map(this.formatPurchaseCurrency) : this.currencies = i.paymentCurrencies.map(this.formatPaymentCurrency);
661
+ }), C.subscribe((i) => {
662
+ this.currencyImages = { ...i.currencyImages }, this.tokenImages = { ...i.tokenImages };
663
+ }));
664
+ }
665
+ firstUpdated() {
666
+ c.getAvailableCurrencies();
667
+ }
668
+ disconnectedCallback() {
669
+ this.unsubscribe.forEach((e) => e());
670
+ }
671
+ render() {
672
+ var o;
673
+ const e = ((o = this.selectedCurrency) == null ? void 0 : o.symbol) || "", i = this.currencyImages[e] || this.tokenImages[e];
674
+ return u`<wui-input-text type="number" size="lg" value=${this.value}>
675
+ ${this.selectedCurrency ? u` <wui-flex
676
+ class="currency-container"
677
+ justifyContent="space-between"
678
+ alignItems="center"
679
+ gap="1"
680
+ @click=${() => $.open({ view: `OnRamp${this.type}Select` })}
681
+ >
682
+ <wui-image src=${m(i)}></wui-image>
683
+ <wui-text color="primary">${this.selectedCurrency.symbol}</wui-text>
684
+ </wui-flex>` : u`<wui-loading-spinner></wui-loading-spinner>`}
685
+ </wui-input-text>`;
686
+ }
687
+ formatPaymentCurrency(e) {
688
+ return {
689
+ name: e.id,
690
+ symbol: e.id
691
+ };
692
+ }
693
+ formatPurchaseCurrency(e) {
694
+ return {
695
+ name: e.name,
696
+ symbol: e.symbol
697
+ };
698
+ }
699
+ };
700
+ w.styles = Q;
701
+ R([
702
+ p({ type: String })
703
+ ], w.prototype, "type", void 0);
704
+ R([
705
+ p({ type: Number })
706
+ ], w.prototype, "value", void 0);
707
+ R([
708
+ l()
709
+ ], w.prototype, "currencies", void 0);
710
+ R([
711
+ l()
712
+ ], w.prototype, "selectedCurrency", void 0);
713
+ R([
714
+ l()
715
+ ], w.prototype, "currencyImages", void 0);
716
+ R([
717
+ l()
718
+ ], w.prototype, "tokenImages", void 0);
719
+ w = R([
720
+ g("w3m-onramp-input")
721
+ ], w);
722
+ const G = O`
723
+ :host > wui-flex {
724
+ width: 100%;
725
+ max-width: 360px;
726
+ }
727
+
728
+ :host > wui-flex > wui-flex {
729
+ border-radius: ${({ borderRadius: t }) => t[8]};
730
+ width: 100%;
731
+ }
732
+
733
+ .amounts-container {
734
+ width: 100%;
735
+ }
736
+ `;
737
+ var x = function(t, e, i, o) {
738
+ var n = arguments.length, r = n < 3 ? e : o === null ? o = Object.getOwnPropertyDescriptor(e, i) : o, s;
739
+ if (typeof Reflect == "object" && typeof Reflect.decorate == "function") r = Reflect.decorate(t, e, i, o);
740
+ else for (var a = t.length - 1; a >= 0; a--) (s = t[a]) && (r = (n < 3 ? s(r) : n > 3 ? s(e, i, r) : s(e, i)) || r);
741
+ return n > 3 && r && Object.defineProperty(e, i, r), r;
742
+ };
743
+ const J = {
744
+ USD: "$",
745
+ EUR: "€",
746
+ GBP: "£"
747
+ }, Z = [100, 250, 500, 1e3];
748
+ let f = class extends b {
749
+ constructor() {
750
+ super(), this.unsubscribe = [], this.disabled = !1, this.caipAddress = I.state.activeCaipAddress, this.loading = $.state.loading, this.paymentCurrency = c.state.paymentCurrency, this.paymentAmount = c.state.paymentAmount, this.purchaseAmount = c.state.purchaseAmount, this.quoteLoading = c.state.quotesLoading, this.unsubscribe.push(I.subscribeKey("activeCaipAddress", (e) => this.caipAddress = e), $.subscribeKey("loading", (e) => {
751
+ this.loading = e;
752
+ }), c.subscribe((e) => {
753
+ this.paymentCurrency = e.paymentCurrency, this.paymentAmount = e.paymentAmount, this.purchaseAmount = e.purchaseAmount, this.quoteLoading = e.quotesLoading;
754
+ }));
755
+ }
756
+ disconnectedCallback() {
757
+ this.unsubscribe.forEach((e) => e());
758
+ }
759
+ render() {
760
+ return u`
761
+ <wui-flex flexDirection="column" justifyContent="center" alignItems="center">
762
+ <wui-flex flexDirection="column" alignItems="center" gap="2">
763
+ <w3m-onramp-input
764
+ type="Fiat"
765
+ @inputChange=${this.onPaymentAmountChange.bind(this)}
766
+ .value=${this.paymentAmount || 0}
767
+ ></w3m-onramp-input>
768
+ <w3m-onramp-input
769
+ type="Token"
770
+ .value=${this.purchaseAmount || 0}
771
+ .loading=${this.quoteLoading}
772
+ ></w3m-onramp-input>
773
+ <wui-flex justifyContent="space-evenly" class="amounts-container" gap="2">
774
+ ${Z.map((e) => {
775
+ var i;
776
+ return u`<wui-button
777
+ variant=${this.paymentAmount === e ? "accent-secondary" : "neutral-secondary"}
778
+ size="md"
779
+ textVariant="md-medium"
780
+ fullWidth
781
+ @click=${() => this.selectPresetAmount(e)}
782
+ >${`${J[((i = this.paymentCurrency) == null ? void 0 : i.id) || "USD"]} ${e}`}</wui-button
783
+ >`;
784
+ })}
785
+ </wui-flex>
786
+ ${this.templateButton()}
787
+ </wui-flex>
788
+ </wui-flex>
789
+ `;
790
+ }
791
+ templateButton() {
792
+ return this.caipAddress ? u`<wui-button
793
+ @click=${this.getQuotes.bind(this)}
794
+ variant="accent-primary"
795
+ fullWidth
796
+ size="lg"
797
+ borderRadius="xs"
798
+ >
799
+ Get quotes
800
+ </wui-button>` : u`<wui-button
801
+ @click=${this.openModal.bind(this)}
802
+ variant="accent"
803
+ fullWidth
804
+ size="lg"
805
+ borderRadius="xs"
806
+ >
807
+ Connect wallet
808
+ </wui-button>`;
809
+ }
810
+ getQuotes() {
811
+ this.loading || $.open({ view: "OnRampProviders" });
812
+ }
813
+ openModal() {
814
+ $.open({ view: "Connect" });
815
+ }
816
+ async onPaymentAmountChange(e) {
817
+ c.setPaymentAmount(Number(e.detail)), await c.getQuote();
818
+ }
819
+ async selectPresetAmount(e) {
820
+ c.setPaymentAmount(e), await c.getQuote();
821
+ }
822
+ };
823
+ f.styles = G;
824
+ x([
825
+ p({ type: Boolean })
826
+ ], f.prototype, "disabled", void 0);
827
+ x([
828
+ l()
829
+ ], f.prototype, "caipAddress", void 0);
830
+ x([
831
+ l()
832
+ ], f.prototype, "loading", void 0);
833
+ x([
834
+ l()
835
+ ], f.prototype, "paymentCurrency", void 0);
836
+ x([
837
+ l()
838
+ ], f.prototype, "paymentAmount", void 0);
839
+ x([
840
+ l()
841
+ ], f.prototype, "purchaseAmount", void 0);
842
+ x([
843
+ l()
844
+ ], f.prototype, "quoteLoading", void 0);
845
+ f = x([
846
+ g("w3m-onramp-widget")
847
+ ], f);
848
+ export {
849
+ d as W3mBuyInProgressView,
850
+ U as W3mOnRampProvidersView,
851
+ P as W3mOnrampFiatSelectView,
852
+ k as W3mOnrampTokensView,
853
+ f as W3mOnrampWidget,
854
+ L as W3mWhatIsABuyView
855
+ };