@prohetamine/redstone 0.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (160) hide show
  1. package/dist/PhArrowCircleDown-BR-zH4LC.js +14 -0
  2. package/dist/PhArrowCircleDown-Sb38khBy.mjs +73 -0
  3. package/dist/PhArrowClockwise-BE5j9P0Z.mjs +73 -0
  4. package/dist/PhArrowClockwise-BRaehQGe.js +14 -0
  5. package/dist/PhArrowDown-B_WmmmY9.js +14 -0
  6. package/dist/PhArrowDown-CFEyR2dR.mjs +73 -0
  7. package/dist/PhArrowLeft-CYfU7NZj.mjs +73 -0
  8. package/dist/PhArrowLeft-CkEd70hm.js +14 -0
  9. package/dist/PhArrowRight-C07Qkx86.js +14 -0
  10. package/dist/PhArrowRight-EermNu0V.mjs +73 -0
  11. package/dist/PhArrowSquareOut-BjTBfzOP.js +14 -0
  12. package/dist/PhArrowSquareOut-DZwTtw54.mjs +73 -0
  13. package/dist/PhArrowUp-DB4CCSss.js +14 -0
  14. package/dist/PhArrowUp-xTpLFQkg.mjs +73 -0
  15. package/dist/PhArrowUpRight-CQbvn6NO.mjs +73 -0
  16. package/dist/PhArrowUpRight-GpCIMsAh.js +14 -0
  17. package/dist/PhArrowsClockwise-BgcIUg-Z.js +14 -0
  18. package/dist/PhArrowsClockwise-DnUYZTVx.mjs +73 -0
  19. package/dist/PhArrowsDownUp-C8KXUqtu.js +14 -0
  20. package/dist/PhArrowsDownUp-DgoprEe2.mjs +73 -0
  21. package/dist/PhArrowsLeftRight-CahChzCj.js +14 -0
  22. package/dist/PhArrowsLeftRight-FD4AZiLh.mjs +73 -0
  23. package/dist/PhBank-DIqIL4x_.js +14 -0
  24. package/dist/PhBank-DbQOQ9zJ.mjs +73 -0
  25. package/dist/PhBrowser-BCBXK2IM.mjs +73 -0
  26. package/dist/PhBrowser-laCKtn7T.js +14 -0
  27. package/dist/PhCaretDown-CnjP-QjZ.mjs +73 -0
  28. package/dist/PhCaretDown-DDe42xDU.js +14 -0
  29. package/dist/PhCaretLeft-Cskc5OY9.js +14 -0
  30. package/dist/PhCaretLeft-DkuXxjf_.mjs +73 -0
  31. package/dist/PhCaretRight-CBWpghxt.mjs +73 -0
  32. package/dist/PhCaretRight-DNgI5w_B.js +14 -0
  33. package/dist/PhCaretUp-CQ-OztBV.mjs +73 -0
  34. package/dist/PhCaretUp-CUZ4g_Me.js +14 -0
  35. package/dist/PhCheck-BVV_Dwfo.js +14 -0
  36. package/dist/PhCheck-t515emYS.mjs +73 -0
  37. package/dist/PhCircleHalf-BuQTmrKW.mjs +73 -0
  38. package/dist/PhCircleHalf-DDC7rige.js +14 -0
  39. package/dist/PhClock-BqynEKWl.js +14 -0
  40. package/dist/PhClock-D6XkTmM_.mjs +73 -0
  41. package/dist/PhCompass-2QeeX5Ad.mjs +73 -0
  42. package/dist/PhCompass-BsuJwXAE.js +14 -0
  43. package/dist/PhCopy-CO34-_xD.mjs +73 -0
  44. package/dist/PhCopy-MVqtRS6X.js +14 -0
  45. package/dist/PhCreditCard-Dq4kdjCw.js +14 -0
  46. package/dist/PhCreditCard-bfnqYflD.mjs +73 -0
  47. package/dist/PhCurrencyDollar-6k8UWxal.js +14 -0
  48. package/dist/PhCurrencyDollar-BekVYPtC.mjs +73 -0
  49. package/dist/PhDesktop-BkNzf3rT.mjs +73 -0
  50. package/dist/PhDesktop-CfsXQ0vC.js +14 -0
  51. package/dist/PhDeviceMobile-BT3Mg_b0.mjs +73 -0
  52. package/dist/PhDeviceMobile-BnrrDrwf.js +14 -0
  53. package/dist/PhDotsThree-6LRvhAcL.js +14 -0
  54. package/dist/PhDotsThree-kpf2OKxJ.mjs +73 -0
  55. package/dist/PhEnvelope-CHsfC2e0.js +14 -0
  56. package/dist/PhEnvelope-UFKpKtwf.mjs +73 -0
  57. package/dist/PhFunnelSimple-CdAqSIhK.mjs +73 -0
  58. package/dist/PhFunnelSimple-JAk7X9Wo.js +14 -0
  59. package/dist/PhGlobe-B3RYXl8h.mjs +73 -0
  60. package/dist/PhGlobe-Tfs4MfpG.js +14 -0
  61. package/dist/PhIdentificationCard-Dqmd6eY1.js +14 -0
  62. package/dist/PhIdentificationCard-rSq59Czm.mjs +73 -0
  63. package/dist/PhImage-aEryzfCi.js +14 -0
  64. package/dist/PhImage-ynsEnFd_.mjs +73 -0
  65. package/dist/PhInfo-B7lsWl6m.mjs +73 -0
  66. package/dist/PhInfo-D6oUrWpA.js +14 -0
  67. package/dist/PhLightbulb-FQDaMMqu.mjs +73 -0
  68. package/dist/PhLightbulb-qbEduhPa.js +14 -0
  69. package/dist/PhMagnifyingGlass-COdRH2k5.js +14 -0
  70. package/dist/PhMagnifyingGlass-_NXk13-0.mjs +73 -0
  71. package/dist/PhPaperPlaneRight-BYi7SorW.mjs +73 -0
  72. package/dist/PhPaperPlaneRight-DrpVAQOZ.js +14 -0
  73. package/dist/PhPlus-25KQTPHG.mjs +73 -0
  74. package/dist/PhPlus-BhUXef08.js +14 -0
  75. package/dist/PhPower-BKl7gzsB.mjs +73 -0
  76. package/dist/PhPower-BNJf1AGQ.js +14 -0
  77. package/dist/PhPuzzlePiece-BkZeF8CX.js +14 -0
  78. package/dist/PhPuzzlePiece-BqUI4GRs.mjs +73 -0
  79. package/dist/PhQrCode-C-tqZKPP.mjs +73 -0
  80. package/dist/PhQrCode-C0v0iXQN.js +14 -0
  81. package/dist/PhQuestion-BBAiRWgt.js +14 -0
  82. package/dist/PhQuestion-CtYvffyD.mjs +73 -0
  83. package/dist/PhQuestionMark-BNbtL2yx.mjs +73 -0
  84. package/dist/PhQuestionMark-BvGUBZ1h.js +14 -0
  85. package/dist/PhSealCheck-B0TEqWpq.mjs +73 -0
  86. package/dist/PhSealCheck-BwNkuF7G.js +14 -0
  87. package/dist/PhSignOut-C1rMSNaS.js +14 -0
  88. package/dist/PhSignOut-HX2_BVsD.mjs +73 -0
  89. package/dist/PhSpinner-CoDYLYOX.mjs +73 -0
  90. package/dist/PhSpinner-nmsGWDQl.js +14 -0
  91. package/dist/PhTrash-CALlKx3e.js +14 -0
  92. package/dist/PhTrash-DeQHS8ZP.mjs +73 -0
  93. package/dist/PhUser-CA0e5OPI.js +14 -0
  94. package/dist/PhUser-Cy5EY3vX.mjs +73 -0
  95. package/dist/PhVault-DdXjVOO9.mjs +73 -0
  96. package/dist/PhVault-DqxV75cz.js +14 -0
  97. package/dist/PhWallet-CeQrfGYc.mjs +73 -0
  98. package/dist/PhWallet-CyCuEs2U.js +14 -0
  99. package/dist/PhWarning-BKaHv_wT.mjs +73 -0
  100. package/dist/PhWarning-C7oj86bY.js +14 -0
  101. package/dist/PhWarningCircle-8MWw-QgE.mjs +73 -0
  102. package/dist/PhWarningCircle-CrNPXGj4.js +14 -0
  103. package/dist/PhX-9lsrXjyl.js +14 -0
  104. package/dist/PhX-DgXr_Fb0.mjs +73 -0
  105. package/dist/ReownAuthentication-Bfv31LzI.mjs +274 -0
  106. package/dist/ReownAuthentication-d8aYgGOq.js +5 -0
  107. package/dist/SwapController-4lzoYsYr.js +1 -0
  108. package/dist/SwapController-DjzUWRyQ.mjs +462 -0
  109. package/dist/ccip-CvwbEhki.js +1 -0
  110. package/dist/ccip-TuO68NeE.mjs +150 -0
  111. package/dist/data-capture-BwdjH2vc.mjs +489 -0
  112. package/dist/data-capture-xVUNZJ2T.js +242 -0
  113. package/dist/email-BCZObJCY.js +90 -0
  114. package/dist/email-m-wo60fN.mjs +338 -0
  115. package/dist/embedded-wallet-CGSri-4g.js +410 -0
  116. package/dist/embedded-wallet-DdZmv5qP.mjs +808 -0
  117. package/dist/features-BJ8kNaE8.js +1 -0
  118. package/dist/features-CJ34oImB.mjs +6 -0
  119. package/dist/index-4lfXeo30.js +132 -0
  120. package/dist/index-B6Mg114Z.mjs +69182 -0
  121. package/dist/index-BX7gAgT3.mjs +35 -0
  122. package/dist/index-BYQqNbCe.js +1 -0
  123. package/dist/index-BmdHwtJo.js +1 -0
  124. package/dist/index-BvUx3ULC.js +78 -0
  125. package/dist/index-CD-QGO70.mjs +196 -0
  126. package/dist/index-CJtXfdoM.mjs +29621 -0
  127. package/dist/index-CMzdgE-y.mjs +215 -0
  128. package/dist/index-CjZQCcwG.js +7203 -0
  129. package/dist/index-D7VuOaCI.js +19 -0
  130. package/dist/index-DV7SQwgn.mjs +2688 -0
  131. package/dist/index-DVf4BnNh.mjs +352 -0
  132. package/dist/index-DhN9vL4k.js +138 -0
  133. package/dist/index-DvllakY0.mjs +274 -0
  134. package/dist/index-Ho06VKh2.mjs +151 -0
  135. package/dist/index-a8mS2Eh1.js +1062 -0
  136. package/dist/index-aamBi9Tu.js +1 -0
  137. package/dist/index.cjs.js +1 -0
  138. package/dist/index.es.js +14 -0
  139. package/dist/onramp-DLlhSPQg.js +422 -0
  140. package/dist/onramp-k-EAEepC.mjs +842 -0
  141. package/dist/parseSignature-D1tZHglo.js +16 -0
  142. package/dist/parseSignature-DM0lwcDr.mjs +8883 -0
  143. package/dist/pay-with-exchange---G2M1Ag.js +280 -0
  144. package/dist/pay-with-exchange-CFIcUXUe.mjs +512 -0
  145. package/dist/property-Bd8U3_QP.mjs +618 -0
  146. package/dist/property-DissjCbZ.js +27 -0
  147. package/dist/receive-B9LCljO6.mjs +228 -0
  148. package/dist/receive-E8H6GDOX.js +131 -0
  149. package/dist/send-B-AooLph.js +554 -0
  150. package/dist/send-DZd_xhsd.mjs +1155 -0
  151. package/dist/socials-ChWFLEFe.mjs +611 -0
  152. package/dist/socials-YSUYSh8o.js +250 -0
  153. package/dist/swaps-DpR9W9Ld.js +1050 -0
  154. package/dist/swaps-Du7-Ui_V.mjs +1752 -0
  155. package/dist/transactions-DhsK5-QJ.mjs +35 -0
  156. package/dist/transactions-VPsz2OLe.js +16 -0
  157. package/dist/w3m-modal-DhomfjKU.js +891 -0
  158. package/dist/w3m-modal-KuYD-zqQ.mjs +1759 -0
  159. package/package.json +51 -0
  160. package/readme.md +1 -0
@@ -0,0 +1,512 @@
1
+ import { bR as A, bS as D, bT as z, bU as p, bV as $, bW as v, bX as u, cu as P, ca as y, cx as a, c3 as f, cs as E, c4 as b, c5 as S, cv as d, cc as _ } from "./index-B6Mg114Z.mjs";
2
+ import "./index-Ho06VKh2.mjs";
3
+ const T = A`
4
+ button {
5
+ border: none;
6
+ border-radius: ${({ borderRadius: t }) => t[20]};
7
+ display: flex;
8
+ flex-direction: row;
9
+ align-items: center;
10
+ padding: ${({ spacing: t }) => t[1]};
11
+ transition:
12
+ background-color ${({ durations: t }) => t.lg}
13
+ ${({ easings: t }) => t["ease-out-power-2"]},
14
+ box-shadow ${({ durations: t }) => t.lg}
15
+ ${({ easings: t }) => t["ease-out-power-2"]};
16
+ will-change: background-color, box-shadow;
17
+ }
18
+
19
+ /* -- Variants --------------------------------------------------------------- */
20
+ button[data-type='accent'] {
21
+ background-color: ${({ tokens: t }) => t.core.backgroundAccentPrimary};
22
+ color: ${({ tokens: t }) => t.theme.textPrimary};
23
+ }
24
+
25
+ button[data-type='neutral'] {
26
+ background-color: ${({ tokens: t }) => t.theme.foregroundSecondary};
27
+ color: ${({ tokens: t }) => t.theme.textPrimary};
28
+ }
29
+
30
+ /* -- Sizes --------------------------------------------------------------- */
31
+ button[data-size='sm'] {
32
+ height: 24px;
33
+ }
34
+
35
+ button[data-size='md'] {
36
+ height: 28px;
37
+ }
38
+
39
+ button[data-size='lg'] {
40
+ height: 32px;
41
+ }
42
+
43
+ button[data-size='sm'] > wui-image,
44
+ button[data-size='sm'] > wui-icon {
45
+ width: 16px;
46
+ height: 16px;
47
+ }
48
+
49
+ button[data-size='md'] > wui-image,
50
+ button[data-size='md'] > wui-icon {
51
+ width: 20px;
52
+ height: 20px;
53
+ }
54
+
55
+ button[data-size='lg'] > wui-image,
56
+ button[data-size='lg'] > wui-icon {
57
+ width: 24px;
58
+ height: 24px;
59
+ }
60
+
61
+ wui-text {
62
+ padding-left: ${({ spacing: t }) => t[1]};
63
+ padding-right: ${({ spacing: t }) => t[1]};
64
+ }
65
+
66
+ wui-image {
67
+ border-radius: ${({ borderRadius: t }) => t[3]};
68
+ overflow: hidden;
69
+ user-drag: none;
70
+ user-select: none;
71
+ -moz-user-select: none;
72
+ -webkit-user-drag: none;
73
+ -webkit-user-select: none;
74
+ -ms-user-select: none;
75
+ }
76
+
77
+ /* -- States --------------------------------------------------------------- */
78
+ @media (hover: hover) and (pointer: fine) {
79
+ button[data-type='accent']:not(:disabled):hover {
80
+ background-color: ${({ tokens: t }) => t.core.foregroundAccent060};
81
+ }
82
+
83
+ button[data-type='neutral']:not(:disabled):hover {
84
+ background-color: ${({ tokens: t }) => t.theme.foregroundTertiary};
85
+ }
86
+ }
87
+
88
+ button[data-type='accent']:not(:disabled):focus-visible,
89
+ button[data-type='accent']:not(:disabled):active {
90
+ box-shadow: 0 0 0 4px ${({ tokens: t }) => t.core.foregroundAccent020};
91
+ }
92
+
93
+ button[data-type='neutral']:not(:disabled):focus-visible,
94
+ button[data-type='neutral']:not(:disabled):active {
95
+ box-shadow: 0 0 0 4px ${({ tokens: t }) => t.core.foregroundAccent020};
96
+ }
97
+
98
+ button:disabled {
99
+ opacity: 0.5;
100
+ }
101
+ `;
102
+ var g = function(t, e, s, n) {
103
+ var o = arguments.length, i = o < 3 ? e : n === null ? n = Object.getOwnPropertyDescriptor(e, s) : n, r;
104
+ if (typeof Reflect == "object" && typeof Reflect.decorate == "function") i = Reflect.decorate(t, e, s, n);
105
+ else for (var c = t.length - 1; c >= 0; c--) (r = t[c]) && (i = (o < 3 ? r(i) : o > 3 ? r(e, s, i) : r(e, s)) || i);
106
+ return o > 3 && i && Object.defineProperty(e, s, i), i;
107
+ };
108
+ const L = {
109
+ sm: "sm-regular",
110
+ md: "md-regular",
111
+ lg: "lg-regular"
112
+ };
113
+ let h = class extends v {
114
+ constructor() {
115
+ super(...arguments), this.type = "accent", this.size = "md", this.imageSrc = "", this.disabled = !1, this.leftIcon = void 0, this.rightIcon = void 0, this.text = "";
116
+ }
117
+ render() {
118
+ return u`
119
+ <button ?disabled=${this.disabled} data-type=${this.type} data-size=${this.size}>
120
+ ${this.imageSrc ? u`<wui-image src=${this.imageSrc}></wui-image>` : null}
121
+ ${this.leftIcon ? u`<wui-icon name=${this.leftIcon} color="inherit" size="inherit"></wui-icon>` : null}
122
+ <wui-text variant=${L[this.size]} color="inherit">${this.text}</wui-text>
123
+ ${this.rightIcon ? u`<wui-icon name=${this.rightIcon} color="inherit" size="inherit"></wui-icon>` : null}
124
+ </button>
125
+ `;
126
+ }
127
+ };
128
+ h.styles = [D, z, T];
129
+ g([
130
+ p()
131
+ ], h.prototype, "type", void 0);
132
+ g([
133
+ p()
134
+ ], h.prototype, "size", void 0);
135
+ g([
136
+ p()
137
+ ], h.prototype, "imageSrc", void 0);
138
+ g([
139
+ p({ type: Boolean })
140
+ ], h.prototype, "disabled", void 0);
141
+ g([
142
+ p()
143
+ ], h.prototype, "leftIcon", void 0);
144
+ g([
145
+ p()
146
+ ], h.prototype, "rightIcon", void 0);
147
+ g([
148
+ p()
149
+ ], h.prototype, "text", void 0);
150
+ h = g([
151
+ $("wui-chip-button")
152
+ ], h);
153
+ var I = function(t, e, s, n) {
154
+ var o = arguments.length, i = o < 3 ? e : n === null ? n = Object.getOwnPropertyDescriptor(e, s) : n, r;
155
+ if (typeof Reflect == "object" && typeof Reflect.decorate == "function") i = Reflect.decorate(t, e, s, n);
156
+ else for (var c = t.length - 1; c >= 0; c--) (r = t[c]) && (i = (o < 3 ? r(i) : o > 3 ? r(e, s, i) : r(e, s)) || i);
157
+ return o > 3 && i && Object.defineProperty(e, s, i), i;
158
+ };
159
+ let w = class extends v {
160
+ constructor() {
161
+ super(...arguments), this.maxDecimals = void 0, this.maxIntegers = void 0;
162
+ }
163
+ render() {
164
+ return u`
165
+ <wui-flex alignItems="center" gap="1">
166
+ <wui-input-amount
167
+ widthVariant="fit"
168
+ fontSize="h2"
169
+ .maxDecimals=${P(this.maxDecimals)}
170
+ .maxIntegers=${P(this.maxIntegers)}
171
+ .value=${this.amount ? String(this.amount) : ""}
172
+ ></wui-input-amount>
173
+ <wui-text variant="md-regular" color="secondary">USD</wui-text>
174
+ </wui-flex>
175
+ `;
176
+ }
177
+ };
178
+ I([
179
+ p({ type: Number })
180
+ ], w.prototype, "amount", void 0);
181
+ I([
182
+ p({ type: Number })
183
+ ], w.prototype, "maxDecimals", void 0);
184
+ I([
185
+ p({ type: Number })
186
+ ], w.prototype, "maxIntegers", void 0);
187
+ w = I([
188
+ $("w3m-fund-input")
189
+ ], w);
190
+ const R = A`
191
+ .amount-input-container {
192
+ border-radius: ${({ borderRadius: t }) => t[6]};
193
+ border-top-right-radius: 0;
194
+ border-top-left-radius: 0;
195
+ background-color: ${({ tokens: t }) => t.theme.foregroundPrimary};
196
+ padding: ${({ spacing: t }) => t[1]};
197
+ }
198
+
199
+ .container {
200
+ border-radius: 30px;
201
+ }
202
+ `;
203
+ var m = function(t, e, s, n) {
204
+ var o = arguments.length, i = o < 3 ? e : n === null ? n = Object.getOwnPropertyDescriptor(e, s) : n, r;
205
+ if (typeof Reflect == "object" && typeof Reflect.decorate == "function") i = Reflect.decorate(t, e, s, n);
206
+ else for (var c = t.length - 1; c >= 0; c--) (r = t[c]) && (i = (o < 3 ? r(i) : o > 3 ? r(e, s, i) : r(e, s)) || i);
207
+ return o > 3 && i && Object.defineProperty(e, s, i), i;
208
+ };
209
+ const C = [10, 50, 100], j = 6, N = 10;
210
+ let l = class extends v {
211
+ constructor() {
212
+ super(), this.unsubscribe = [], this.network = y.state.activeCaipNetwork, this.exchanges = a.state.exchanges, this.isLoading = a.state.isLoading, this.amount = a.state.amount, this.tokenAmount = a.state.tokenAmount, this.priceLoading = a.state.priceLoading, this.isPaymentInProgress = a.state.isPaymentInProgress, this.currentPayment = a.state.currentPayment, this.paymentId = a.state.paymentId, this.paymentAsset = a.state.paymentAsset, this.unsubscribe.push(y.subscribeKey("activeCaipNetwork", (e) => {
213
+ this.network = e, this.setDefaultPaymentAsset();
214
+ }), a.subscribe((e) => {
215
+ var n, o;
216
+ this.exchanges = e.exchanges, this.isLoading = e.isLoading, this.amount = e.amount, this.tokenAmount = e.tokenAmount, this.priceLoading = e.priceLoading, this.paymentId = e.paymentId, this.isPaymentInProgress = e.isPaymentInProgress, this.currentPayment = e.currentPayment, this.paymentAsset = e.paymentAsset, e.isPaymentInProgress && ((n = e.currentPayment) == null ? void 0 : n.exchangeId) && ((o = e.currentPayment) == null ? void 0 : o.sessionId) && e.paymentId && this.handlePaymentInProgress();
217
+ }));
218
+ }
219
+ disconnectedCallback() {
220
+ this.unsubscribe.forEach((s) => s()), a.state.isPaymentInProgress || a.reset();
221
+ }
222
+ async firstUpdated() {
223
+ await this.getPaymentAssets(), this.paymentAsset || await this.setDefaultPaymentAsset(), a.setAmount(C[0]), await a.fetchExchanges();
224
+ }
225
+ render() {
226
+ return u`
227
+ <wui-flex flexDirection="column" class="container">
228
+ ${this.amountInputTemplate()} ${this.exchangesTemplate()}
229
+ </wui-flex>
230
+ `;
231
+ }
232
+ exchangesLoadingTemplate() {
233
+ return Array.from({ length: 2 }).map(() => u`<wui-shimmer width="100%" height="65px" borderRadius="xxs"></wui-shimmer>`);
234
+ }
235
+ _exchangesTemplate() {
236
+ return this.exchanges.length > 0 ? this.exchanges.map((e) => u`<wui-list-item
237
+ @click=${() => this.onExchangeClick(e)}
238
+ chevron
239
+ variant="image"
240
+ imageSrc=${e.imageUrl}
241
+ ?loading=${this.isLoading}
242
+ >
243
+ <wui-text variant="md-regular" color="primary">
244
+ Deposit from ${e.name}
245
+ </wui-text>
246
+ </wui-list-item>`) : u`<wui-flex flexDirection="column" alignItems="center" gap="4" padding="4">
247
+ <wui-text variant="lg-medium" align="center" color="primary">
248
+ No exchanges support this asset on this network
249
+ </wui-text>
250
+ </wui-flex>`;
251
+ }
252
+ exchangesTemplate() {
253
+ return u`<wui-flex
254
+ flexDirection="column"
255
+ gap="2"
256
+ .padding=${["3", "3", "3", "3"]}
257
+ class="exchanges-container"
258
+ >
259
+ ${this.isLoading ? this.exchangesLoadingTemplate() : this._exchangesTemplate()}
260
+ </wui-flex>`;
261
+ }
262
+ amountInputTemplate() {
263
+ var e, s;
264
+ return u`
265
+ <wui-flex
266
+ flexDirection="column"
267
+ .padding=${["0", "3", "3", "3"]}
268
+ class="amount-input-container"
269
+ >
270
+ <wui-flex
271
+ justifyContent="space-between"
272
+ alignItems="center"
273
+ .margin=${["0", "0", "6", "0"]}
274
+ >
275
+ <wui-text variant="md-medium" color="secondary">Asset</wui-text>
276
+ <wui-token-button
277
+ data-testid="deposit-from-exchange-asset-button"
278
+ flexDirection="row-reverse"
279
+ text=${((e = this.paymentAsset) == null ? void 0 : e.metadata.symbol) || ""}
280
+ imageSrc=${((s = this.paymentAsset) == null ? void 0 : s.metadata.iconUrl) || ""}
281
+ @click=${() => f.push("PayWithExchangeSelectAsset")}
282
+ size="lg"
283
+ .chainImageSrc=${P(E.getNetworkImage(this.network))}
284
+ >
285
+ </wui-token-button>
286
+ </wui-flex>
287
+ <wui-flex
288
+ flexDirection="column"
289
+ alignItems="center"
290
+ justifyContent="center"
291
+ .margin=${["0", "0", "4", "0"]}
292
+ >
293
+ <w3m-fund-input
294
+ @inputChange=${this.onAmountChange.bind(this)}
295
+ .amount=${this.amount}
296
+ .maxDecimals=${j}
297
+ .maxIntegers=${N}
298
+ >
299
+ </w3m-fund-input>
300
+ ${this.tokenAmountTemplate()}
301
+ </wui-flex>
302
+ <wui-flex justifyContent="center" gap="2">
303
+ ${C.map((n) => u`<wui-chip-button
304
+ @click=${() => a.setAmount(n)}
305
+ type="neutral"
306
+ size="lg"
307
+ text=${`$${n}`}
308
+ ></wui-chip-button>`)}
309
+ </wui-flex>
310
+ </wui-flex>
311
+ `;
312
+ }
313
+ tokenAmountTemplate() {
314
+ var e;
315
+ return this.priceLoading ? u`<wui-shimmer
316
+ width="65px"
317
+ height="20px"
318
+ borderRadius="xxs"
319
+ variant="light"
320
+ ></wui-shimmer>` : u`
321
+ <wui-text variant="md-regular" color="secondary">
322
+ ${this.tokenAmount.toFixed(4)} ${(e = this.paymentAsset) == null ? void 0 : e.metadata.symbol}
323
+ </wui-text>
324
+ `;
325
+ }
326
+ async onExchangeClick(e) {
327
+ if (!this.amount) {
328
+ b.showError("Please enter an amount");
329
+ return;
330
+ }
331
+ await a.handlePayWithExchange(e.id);
332
+ }
333
+ handlePaymentInProgress() {
334
+ var n, o;
335
+ const e = y.state.activeChain, { redirectView: s = "Account" } = f.state.data ?? {};
336
+ this.isPaymentInProgress && ((n = this.currentPayment) != null && n.exchangeId) && ((o = this.currentPayment) != null && o.sessionId) && this.paymentId && (a.waitUntilComplete({
337
+ exchangeId: this.currentPayment.exchangeId,
338
+ sessionId: this.currentPayment.sessionId,
339
+ paymentId: this.paymentId
340
+ }).then((i) => {
341
+ i.status === "SUCCESS" ? (b.showSuccess("Deposit completed"), a.reset(), e && (y.fetchTokenBalance(), S.updateBalance(e)), f.replace("Transactions")) : i.status === "FAILED" && b.showError("Deposit failed");
342
+ }), b.showLoading("Deposit in progress..."), f.replace(s));
343
+ }
344
+ onAmountChange({ detail: e }) {
345
+ a.setAmount(e ? Number(e) : null);
346
+ }
347
+ async getPaymentAssets() {
348
+ this.network && await a.getAssetsForNetwork(this.network.caipNetworkId);
349
+ }
350
+ async setDefaultPaymentAsset() {
351
+ if (this.network) {
352
+ const e = await a.getAssetsForNetwork(this.network.caipNetworkId);
353
+ e[0] && a.setPaymentAsset(e[0]);
354
+ }
355
+ }
356
+ };
357
+ l.styles = R;
358
+ m([
359
+ d()
360
+ ], l.prototype, "network", void 0);
361
+ m([
362
+ d()
363
+ ], l.prototype, "exchanges", void 0);
364
+ m([
365
+ d()
366
+ ], l.prototype, "isLoading", void 0);
367
+ m([
368
+ d()
369
+ ], l.prototype, "amount", void 0);
370
+ m([
371
+ d()
372
+ ], l.prototype, "tokenAmount", void 0);
373
+ m([
374
+ d()
375
+ ], l.prototype, "priceLoading", void 0);
376
+ m([
377
+ d()
378
+ ], l.prototype, "isPaymentInProgress", void 0);
379
+ m([
380
+ d()
381
+ ], l.prototype, "currentPayment", void 0);
382
+ m([
383
+ d()
384
+ ], l.prototype, "paymentId", void 0);
385
+ m([
386
+ d()
387
+ ], l.prototype, "paymentAsset", void 0);
388
+ l = m([
389
+ $("w3m-deposit-from-exchange-view")
390
+ ], l);
391
+ const O = A`
392
+ .contentContainer {
393
+ height: 440px;
394
+ overflow: scroll;
395
+ scrollbar-width: none;
396
+ }
397
+
398
+ .contentContainer::-webkit-scrollbar {
399
+ display: none;
400
+ }
401
+
402
+ wui-icon-box {
403
+ width: 40px;
404
+ height: 40px;
405
+ border-radius: ${({ borderRadius: t }) => t[3]};
406
+ }
407
+ `;
408
+ var k = function(t, e, s, n) {
409
+ var o = arguments.length, i = o < 3 ? e : n === null ? n = Object.getOwnPropertyDescriptor(e, s) : n, r;
410
+ if (typeof Reflect == "object" && typeof Reflect.decorate == "function") i = Reflect.decorate(t, e, s, n);
411
+ else for (var c = t.length - 1; c >= 0; c--) (r = t[c]) && (i = (o < 3 ? r(i) : o > 3 ? r(e, s, i) : r(e, s)) || i);
412
+ return o > 3 && i && Object.defineProperty(e, s, i), i;
413
+ };
414
+ let x = class extends v {
415
+ constructor() {
416
+ super(), this.unsubscribe = [], this.assets = a.state.assets, this.search = "", this.onDebouncedSearch = _.debounce((e) => {
417
+ this.search = e;
418
+ }), this.unsubscribe.push(a.subscribe((e) => {
419
+ this.assets = e.assets;
420
+ }));
421
+ }
422
+ disconnectedCallback() {
423
+ this.unsubscribe.forEach((e) => e());
424
+ }
425
+ render() {
426
+ return u`
427
+ <wui-flex flexDirection="column">
428
+ ${this.templateSearchInput()} <wui-separator></wui-separator> ${this.templateTokens()}
429
+ </wui-flex>
430
+ `;
431
+ }
432
+ templateSearchInput() {
433
+ return u`
434
+ <wui-flex gap="2" padding="3">
435
+ <wui-input-text
436
+ @inputChange=${this.onInputChange.bind(this)}
437
+ class="network-search-input"
438
+ size="sm"
439
+ placeholder="Search token"
440
+ icon="search"
441
+ ></wui-input-text>
442
+ </wui-flex>
443
+ `;
444
+ }
445
+ templateTokens() {
446
+ const e = this.assets.filter((n) => n.metadata.name.toLowerCase().includes(this.search.toLowerCase())), s = e.length > 0;
447
+ return u`
448
+ <wui-flex
449
+ class="contentContainer"
450
+ flexDirection="column"
451
+ .padding=${["0", "3", "0", "3"]}
452
+ >
453
+ <wui-flex justifyContent="flex-start" .padding=${["4", "3", "3", "3"]}>
454
+ <wui-text variant="md-medium" color="secondary">Available tokens</wui-text>
455
+ </wui-flex>
456
+ <wui-flex flexDirection="column" gap="2">
457
+ ${s ? e.map((n) => u`<wui-list-item
458
+ .imageSrc=${n.metadata.iconUrl}
459
+ ?clickable=${!0}
460
+ @click=${this.handleTokenClick.bind(this, n)}
461
+ >
462
+ <wui-text variant="md-medium" color="primary">${n.metadata.name}</wui-text>
463
+ <wui-text variant="md-regular" color="secondary"
464
+ >${n.metadata.symbol}</wui-text
465
+ >
466
+ </wui-list-item>`) : u`<wui-flex
467
+ .padding=${["20", "0", "0", "0"]}
468
+ alignItems="center"
469
+ flexDirection="column"
470
+ gap="4"
471
+ >
472
+ <wui-icon-box icon="coinPlaceholder" color="default" size="lg"></wui-icon-box>
473
+ <wui-flex
474
+ class="textContent"
475
+ gap="2"
476
+ flexDirection="column"
477
+ justifyContent="center"
478
+ >
479
+ <wui-text variant="lg-medium" align="center" color="primary">
480
+ No tokens found
481
+ </wui-text>
482
+ </wui-flex>
483
+ <wui-link @click=${this.onBuyClick.bind(this)}>Buy</wui-link>
484
+ </wui-flex>`}
485
+ </wui-flex>
486
+ </wui-flex>
487
+ `;
488
+ }
489
+ onBuyClick() {
490
+ f.push("OnRampProviders");
491
+ }
492
+ onInputChange(e) {
493
+ this.onDebouncedSearch(e.detail);
494
+ }
495
+ handleTokenClick(e) {
496
+ a.setPaymentAsset(e), f.goBack();
497
+ }
498
+ };
499
+ x.styles = O;
500
+ k([
501
+ d()
502
+ ], x.prototype, "assets", void 0);
503
+ k([
504
+ d()
505
+ ], x.prototype, "search", void 0);
506
+ x = k([
507
+ $("w3m-deposit-from-exchange-select-asset-view")
508
+ ], x);
509
+ export {
510
+ x as W3mDepositFromExchangeSelectAssetView,
511
+ l as W3mDepositFromExchangeView
512
+ };