@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,554 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./index-CjZQCcwG.js");require("./index-BvUx3ULC.js");require("./index-DhN9vL4k.js");const $=require("./SwapController-4lzoYsYr.js"),A=e.css`
2
+ :host {
3
+ width: 100%;
4
+ height: 100px;
5
+ border-radius: ${({borderRadius:t})=>t[5]};
6
+ border: 1px solid ${({tokens:t})=>t.theme.foregroundPrimary};
7
+ background-color: ${({tokens:t})=>t.theme.foregroundPrimary};
8
+ transition: background-color ${({durations:t})=>t.lg}
9
+ ${({easings:t})=>t["ease-out-power-1"]};
10
+ will-change: background-color;
11
+ position: relative;
12
+ }
13
+
14
+ :host(:hover) {
15
+ background-color: ${({tokens:t})=>t.theme.foregroundSecondary};
16
+ }
17
+
18
+ wui-flex {
19
+ width: 100%;
20
+ height: fit-content;
21
+ }
22
+
23
+ wui-button {
24
+ display: ruby;
25
+ color: ${({tokens:t})=>t.theme.textPrimary};
26
+ margin: 0 ${({spacing:t})=>t[2]};
27
+ }
28
+
29
+ .instruction {
30
+ position: absolute;
31
+ top: 50%;
32
+ transform: translateY(-50%);
33
+ z-index: 2;
34
+ }
35
+
36
+ .paste {
37
+ display: inline-flex;
38
+ }
39
+
40
+ textarea {
41
+ background: transparent;
42
+ width: 100%;
43
+ font-family: ${({fontFamily:t})=>t.regular};
44
+ font-style: normal;
45
+ font-size: ${({textSize:t})=>t.large};
46
+ font-weight: ${({fontWeight:t})=>t.regular};
47
+ line-height: ${({typography:t})=>t["lg-regular"].lineHeight};
48
+ letter-spacing: ${({typography:t})=>t["lg-regular"].letterSpacing};
49
+ color: ${({tokens:t})=>t.theme.textPrimary};
50
+ caret-color: ${({tokens:t})=>t.core.backgroundAccentPrimary};
51
+ box-sizing: border-box;
52
+ -webkit-appearance: none;
53
+ -moz-appearance: textfield;
54
+ padding: 0px;
55
+ border: none;
56
+ outline: none;
57
+ appearance: none;
58
+ resize: none;
59
+ overflow: hidden;
60
+ }
61
+ `;var g=function(t,i,n,o){var s=arguments.length,r=s<3?i:o===null?o=Object.getOwnPropertyDescriptor(i,n):o,l;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(t,i,n,o);else for(var a=t.length-1;a>=0;a--)(l=t[a])&&(r=(s<3?l(r):s>3?l(i,n,r):l(i,n))||r);return s>3&&r&&Object.defineProperty(i,n,r),r};let h=class extends e.i{constructor(){super(...arguments),this.inputElementRef=e.e(),this.instructionElementRef=e.e(),this.readOnly=!1,this.instructionHidden=!!this.value,this.pasting=!1,this.onDebouncedSearch=e.CoreHelperUtil.debounce(async i=>{if(!i.length){this.setReceiverAddress("");return}const n=e.ChainController.state.activeChain;if(e.CoreHelperUtil.isAddress(i,n)){this.setReceiverAddress(i);return}try{const s=await e.ConnectionController.getEnsAddress(i);if(s){e.SendController.setReceiverProfileName(i),e.SendController.setReceiverAddress(s);const r=await e.ConnectionController.getEnsAvatar(i);e.SendController.setReceiverProfileImageUrl(r||void 0)}}catch{this.setReceiverAddress(i)}finally{e.SendController.setLoading(!1)}})}firstUpdated(){this.value&&(this.instructionHidden=!0),this.checkHidden()}render(){return this.readOnly?e.b` <wui-flex
62
+ flexDirection="column"
63
+ justifyContent="center"
64
+ gap="01"
65
+ .padding=${["8","4","5","4"]}
66
+ >
67
+ <textarea
68
+ spellcheck="false"
69
+ ?disabled=${!0}
70
+ autocomplete="off"
71
+ .value=${this.value??""}
72
+ >
73
+ ${this.value??""}</textarea
74
+ >
75
+ </wui-flex>`:e.b` <wui-flex
76
+ @click=${this.onBoxClick.bind(this)}
77
+ flexDirection="column"
78
+ justifyContent="center"
79
+ gap="01"
80
+ .padding=${["8","4","5","4"]}
81
+ >
82
+ <wui-text
83
+ ${e.n$1(this.instructionElementRef)}
84
+ class="instruction"
85
+ color="secondary"
86
+ variant="md-medium"
87
+ >
88
+ Type or
89
+ <wui-button
90
+ class="paste"
91
+ size="md"
92
+ variant="neutral-secondary"
93
+ iconLeft="copy"
94
+ @click=${this.onPasteClick.bind(this)}
95
+ >
96
+ <wui-icon size="sm" color="inherit" slot="iconLeft" name="copy"></wui-icon>
97
+ Paste
98
+ </wui-button>
99
+ address
100
+ </wui-text>
101
+ <textarea
102
+ spellcheck="false"
103
+ ?disabled=${!this.instructionHidden}
104
+ ${e.n$1(this.inputElementRef)}
105
+ @input=${this.onInputChange.bind(this)}
106
+ @blur=${this.onBlur.bind(this)}
107
+ .value=${this.value??""}
108
+ autocomplete="off"
109
+ >
110
+ ${this.value??""}</textarea
111
+ >
112
+ </wui-flex>`}async focusInput(){var i;this.instructionElementRef.value&&(this.instructionHidden=!0,await this.toggleInstructionFocus(!1),this.instructionElementRef.value.style.pointerEvents="none",(i=this.inputElementRef.value)==null||i.focus(),this.inputElementRef.value&&(this.inputElementRef.value.selectionStart=this.inputElementRef.value.selectionEnd=this.inputElementRef.value.value.length))}async focusInstruction(){var i;this.instructionElementRef.value&&(this.instructionHidden=!1,await this.toggleInstructionFocus(!0),this.instructionElementRef.value.style.pointerEvents="auto",(i=this.inputElementRef.value)==null||i.blur())}async toggleInstructionFocus(i){this.instructionElementRef.value&&await this.instructionElementRef.value.animate([{opacity:i?0:1},{opacity:i?1:0}],{duration:100,easing:"ease",fill:"forwards"}).finished}onBoxClick(){!this.value&&!this.instructionHidden&&this.focusInput()}onBlur(){!this.value&&this.instructionHidden&&!this.pasting&&this.focusInstruction()}checkHidden(){this.instructionHidden&&this.focusInput()}async onPasteClick(){this.pasting=!0;const i=await navigator.clipboard.readText();e.SendController.setReceiverAddress(i),this.focusInput()}onInputChange(i){var o;const n=i.target;this.pasting=!1,this.value=(o=i.target)==null?void 0:o.value,n.value&&!this.instructionHidden&&this.focusInput(),e.SendController.setLoading(!0),this.onDebouncedSearch(n.value)}setReceiverAddress(i){e.SendController.setReceiverAddress(i),e.SendController.setReceiverProfileName(void 0),e.SendController.setReceiverProfileImageUrl(void 0),e.SendController.setLoading(!1)}};h.styles=A;g([e.n()],h.prototype,"value",void 0);g([e.n({type:Boolean})],h.prototype,"readOnly",void 0);g([e.r()],h.prototype,"instructionHidden",void 0);g([e.r()],h.prototype,"pasting",void 0);h=g([e.customElement("w3m-input-address")],h);const T=e.css`
113
+ :host {
114
+ width: 100%;
115
+ height: 100px;
116
+ border-radius: ${({borderRadius:t})=>t[5]};
117
+ border: 1px solid ${({tokens:t})=>t.theme.foregroundPrimary};
118
+ background-color: ${({tokens:t})=>t.theme.foregroundPrimary};
119
+ transition: background-color ${({durations:t})=>t.lg}
120
+ ${({easings:t})=>t["ease-out-power-1"]};
121
+ will-change: background-color;
122
+ transition: all ${({easings:t})=>t["ease-out-power-1"]}
123
+ ${({durations:t})=>t.lg};
124
+ }
125
+
126
+ :host(:hover) {
127
+ background-color: ${({tokens:t})=>t.theme.foregroundSecondary};
128
+ }
129
+
130
+ wui-flex {
131
+ width: 100%;
132
+ height: fit-content;
133
+ }
134
+
135
+ wui-button {
136
+ width: 100%;
137
+ display: flex;
138
+ justify-content: flex-end;
139
+ }
140
+
141
+ wui-input-amount {
142
+ mask-image: linear-gradient(
143
+ 270deg,
144
+ transparent 0px,
145
+ transparent 8px,
146
+ black 24px,
147
+ black 25px,
148
+ black 32px,
149
+ black 100%
150
+ );
151
+ }
152
+
153
+ .totalValue {
154
+ width: 100%;
155
+ }
156
+ `;var b=function(t,i,n,o){var s=arguments.length,r=s<3?i:o===null?o=Object.getOwnPropertyDescriptor(i,n):o,l;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(t,i,n,o);else for(var a=t.length-1;a>=0;a--)(l=t[a])&&(r=(s<3?l(r):s>3?l(i,n,r):l(i,n))||r);return s>3&&r&&Object.defineProperty(i,n,r),r};let f=class extends e.i{constructor(){super(...arguments),this.readOnly=!1,this.isInsufficientBalance=!1}render(){const i=this.readOnly||!this.token;return e.b` <wui-flex
157
+ flexDirection="column"
158
+ gap="01"
159
+ .padding=${["5","3","4","3"]}
160
+ >
161
+ <wui-flex alignItems="center">
162
+ <wui-input-amount
163
+ @inputChange=${this.onInputChange.bind(this)}
164
+ ?disabled=${i}
165
+ .value=${this.sendTokenAmount?String(this.sendTokenAmount):""}
166
+ ?error=${!!this.isInsufficientBalance}
167
+ ></wui-input-amount>
168
+ ${this.buttonTemplate()}
169
+ </wui-flex>
170
+ ${this.bottomTemplate()}
171
+ </wui-flex>`}buttonTemplate(){return this.token?e.b`<wui-token-button
172
+ text=${this.token.symbol}
173
+ imageSrc=${this.token.iconUrl}
174
+ @click=${this.handleSelectButtonClick.bind(this)}
175
+ >
176
+ </wui-token-button>`:e.b`<wui-button
177
+ size="md"
178
+ variant="neutral-secondary"
179
+ @click=${this.handleSelectButtonClick.bind(this)}
180
+ >Select token</wui-button
181
+ >`}handleSelectButtonClick(){this.readOnly||e.RouterController.push("WalletSendSelectToken")}sendValueTemplate(){if(!this.readOnly&&this.token&&this.sendTokenAmount){const n=this.token.price*this.sendTokenAmount;return e.b`<wui-text class="totalValue" variant="sm-regular" color="secondary"
182
+ >${n?`$${e.NumberUtil.formatNumberToLocalString(n,2)}`:"Incorrect value"}</wui-text
183
+ >`}return null}maxAmountTemplate(){return this.token?e.b` <wui-text variant="sm-regular" color="secondary">
184
+ ${e.UiHelperUtil.roundNumber(Number(this.token.quantity.numeric),6,5)}
185
+ </wui-text>`:null}actionTemplate(){return this.token?e.b`<wui-link @click=${this.onMaxClick.bind(this)}>Max</wui-link>`:null}bottomTemplate(){return this.readOnly?null:e.b`<wui-flex alignItems="center" justifyContent="space-between">
186
+ ${this.sendValueTemplate()}
187
+ <wui-flex alignItems="center" gap="01" justifyContent="flex-end">
188
+ ${this.maxAmountTemplate()} ${this.actionTemplate()}
189
+ </wui-flex>
190
+ </wui-flex>`}onInputChange(i){e.SendController.setTokenAmount(i.detail)}onMaxClick(){if(this.token){const i=e.NumberUtil.bigNumber(this.token.quantity.numeric);e.SendController.setTokenAmount(Number(i.toFixed(20)))}}};f.styles=T;b([e.n({type:Object})],f.prototype,"token",void 0);b([e.n({type:Boolean})],f.prototype,"readOnly",void 0);b([e.n({type:Number})],f.prototype,"sendTokenAmount",void 0);b([e.n({type:Boolean})],f.prototype,"isInsufficientBalance",void 0);f=b([e.customElement("w3m-input-token")],f);const R=e.css`
191
+ :host {
192
+ display: block;
193
+ }
194
+
195
+ wui-flex {
196
+ position: relative;
197
+ }
198
+
199
+ wui-icon-box {
200
+ width: 32px;
201
+ height: 32px;
202
+ border-radius: ${({borderRadius:t})=>t[10]} !important;
203
+ border: 4px solid ${({tokens:t})=>t.theme.backgroundPrimary};
204
+ background: ${({tokens:t})=>t.theme.foregroundPrimary};
205
+ position: absolute;
206
+ top: 50%;
207
+ left: 50%;
208
+ transform: translate(-50%, -50%);
209
+ z-index: 3;
210
+ }
211
+
212
+ wui-button {
213
+ --local-border-radius: ${({borderRadius:t})=>t[4]} !important;
214
+ }
215
+
216
+ .inputContainer {
217
+ height: fit-content;
218
+ }
219
+ `;var u=function(t,i,n,o){var s=arguments.length,r=s<3?i:o===null?o=Object.getOwnPropertyDescriptor(i,n):o,l;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(t,i,n,o);else for(var a=t.length-1;a>=0;a--)(l=t[a])&&(r=(s<3?l(r):s>3?l(i,n,r):l(i,n))||r);return s>3&&r&&Object.defineProperty(i,n,r),r};const c={INSUFFICIENT_FUNDS:"Insufficient Funds",INCORRECT_VALUE:"Incorrect Value",INVALID_ADDRESS:"Invalid Address",ADD_ADDRESS:"Add Address",ADD_AMOUNT:"Add Amount",SELECT_TOKEN:"Select Token",PREVIEW_SEND:"Preview Send"};exports.W3mWalletSendView=class extends e.i{constructor(){var n,o;super(),this.unsubscribe=[],this.isTryingToChooseDifferentWallet=!1,this.token=e.SendController.state.token,this.sendTokenAmount=e.SendController.state.sendTokenAmount,this.receiverAddress=e.SendController.state.receiverAddress,this.receiverProfileName=e.SendController.state.receiverProfileName,this.loading=e.SendController.state.loading,this.params=(n=e.RouterController.state.data)==null?void 0:n.send,this.caipAddress=(o=e.ChainController.getAccountData())==null?void 0:o.caipAddress,this.message=c.PREVIEW_SEND,this.disconnecting=!1,this.token&&!this.params&&(this.fetchBalances(),this.fetchNetworkPrice());const i=e.ChainController.subscribeKey("activeCaipAddress",s=>{!s&&this.isTryingToChooseDifferentWallet&&(this.isTryingToChooseDifferentWallet=!1,e.ModalController.open({view:"Connect",data:{redirectView:"WalletSend"}}).catch(()=>null),i())});this.unsubscribe.push(e.ChainController.subscribeAccountStateProp("caipAddress",s=>{this.caipAddress=s}),e.SendController.subscribe(s=>{this.token=s.token,this.sendTokenAmount=s.sendTokenAmount,this.receiverAddress=s.receiverAddress,this.receiverProfileName=s.receiverProfileName,this.loading=s.loading}))}disconnectedCallback(){this.unsubscribe.forEach(i=>i())}async firstUpdated(){await this.handleSendParameters()}render(){this.getMessage();const i=!!this.params;return e.b` <wui-flex flexDirection="column" .padding=${["0","4","4","4"]}>
220
+ <wui-flex class="inputContainer" gap="2" flexDirection="column">
221
+ <w3m-input-token
222
+ .token=${this.token}
223
+ .sendTokenAmount=${this.sendTokenAmount}
224
+ ?readOnly=${i}
225
+ ?isInsufficientBalance=${this.message===c.INSUFFICIENT_FUNDS}
226
+ ></w3m-input-token>
227
+ <wui-icon-box size="md" variant="secondary" icon="arrowBottom"></wui-icon-box>
228
+ <w3m-input-address
229
+ ?readOnly=${i}
230
+ .value=${this.receiverProfileName?this.receiverProfileName:this.receiverAddress}
231
+ ></w3m-input-address>
232
+ </wui-flex>
233
+ ${this.buttonTemplate()}
234
+ </wui-flex>`}async fetchBalances(){await e.SendController.fetchTokenBalance(),e.SendController.fetchNetworkBalance()}async fetchNetworkPrice(){await $.SwapController.getNetworkTokenPrice()}onButtonClick(){e.RouterController.push("WalletSendPreview",{send:this.params})}onFundWalletClick(){e.RouterController.push("FundWallet",{redirectView:"WalletSend"})}async onConnectDifferentWalletClick(){try{this.isTryingToChooseDifferentWallet=!0,this.disconnecting=!0,await e.ConnectionController.disconnect()}finally{this.disconnecting=!1}}getMessage(){var i;this.message=c.PREVIEW_SEND,this.receiverAddress&&!e.CoreHelperUtil.isAddress(this.receiverAddress,e.ChainController.state.activeChain)&&(this.message=c.INVALID_ADDRESS),this.receiverAddress||(this.message=c.ADD_ADDRESS),this.sendTokenAmount&&this.token&&this.sendTokenAmount>Number(this.token.quantity.numeric)&&(this.message=c.INSUFFICIENT_FUNDS),this.sendTokenAmount||(this.message=c.ADD_AMOUNT),this.sendTokenAmount&&((i=this.token)!=null&&i.price)&&(this.sendTokenAmount*this.token.price||(this.message=c.INCORRECT_VALUE)),this.token||(this.message=c.SELECT_TOKEN)}buttonTemplate(){const i=!this.message.startsWith(c.PREVIEW_SEND),n=this.message===c.INSUFFICIENT_FUNDS,o=!!this.params;return n&&!o?e.b`
235
+ <wui-flex .margin=${["4","0","0","0"]} flexDirection="column" gap="4">
236
+ <wui-button
237
+ @click=${this.onFundWalletClick.bind(this)}
238
+ size="lg"
239
+ variant="accent-secondary"
240
+ fullWidth
241
+ >
242
+ Fund Wallet
243
+ </wui-button>
244
+
245
+ <wui-separator data-testid="wui-separator" text="or"></wui-separator>
246
+
247
+ <wui-button
248
+ @click=${this.onConnectDifferentWalletClick.bind(this)}
249
+ size="lg"
250
+ variant="neutral-secondary"
251
+ fullWidth
252
+ ?loading=${this.disconnecting}
253
+ >
254
+ Connect a different wallet
255
+ </wui-button>
256
+ </wui-flex>
257
+ `:e.b`<wui-flex .margin=${["4","0","0","0"]}>
258
+ <wui-button
259
+ @click=${this.onButtonClick.bind(this)}
260
+ ?disabled=${i}
261
+ size="lg"
262
+ variant="accent-primary"
263
+ ?loading=${this.loading}
264
+ fullWidth
265
+ >
266
+ ${this.message}
267
+ </wui-button>
268
+ </wui-flex>`}async handleSendParameters(){if(this.loading=!0,!this.params){this.loading=!1;return}const i=Number(this.params.amount);if(isNaN(i)){e.SnackController.showError("Invalid amount"),this.loading=!1;return}const{namespace:n,chainId:o,assetAddress:s}=this.params;if(!e.ConstantsUtil$1.SEND_PARAMS_SUPPORTED_CHAINS.includes(n)){e.SnackController.showError(`Chain "${n}" is not supported for send parameters`),this.loading=!1;return}const r=e.ChainController.getCaipNetworkById(o,n);if(!r){e.SnackController.showError(`Network with id "${o}" not found`),this.loading=!1;return}try{const{balance:l,name:a,symbol:S,decimals:y}=await e.BalanceUtil.fetchERC20Balance({caipAddress:this.caipAddress,assetAddress:s,caipNetwork:r});if(!a||!S||!y||!l){e.SnackController.showError("Token not found");return}e.SendController.setToken({name:a,symbol:S,chainId:r.id.toString(),address:`${r.chainNamespace}:${r.id}:${s}`,value:0,price:0,quantity:{decimals:y.toString(),numeric:l.toString()},iconUrl:e.AssetUtil.getTokenImage(S)??""}),e.SendController.setTokenAmount(i),e.SendController.setReceiverAddress(this.params.to)}catch(l){console.error("Failed to load token information:",l),e.SnackController.showError("Failed to load token information")}finally{this.loading=!1}}};exports.W3mWalletSendView.styles=R;u([e.r()],exports.W3mWalletSendView.prototype,"token",void 0);u([e.r()],exports.W3mWalletSendView.prototype,"sendTokenAmount",void 0);u([e.r()],exports.W3mWalletSendView.prototype,"receiverAddress",void 0);u([e.r()],exports.W3mWalletSendView.prototype,"receiverProfileName",void 0);u([e.r()],exports.W3mWalletSendView.prototype,"loading",void 0);u([e.r()],exports.W3mWalletSendView.prototype,"params",void 0);u([e.r()],exports.W3mWalletSendView.prototype,"caipAddress",void 0);u([e.r()],exports.W3mWalletSendView.prototype,"message",void 0);u([e.r()],exports.W3mWalletSendView.prototype,"disconnecting",void 0);exports.W3mWalletSendView=u([e.customElement("w3m-wallet-send-view")],exports.W3mWalletSendView);const E=e.css`
269
+ .contentContainer {
270
+ height: 440px;
271
+ overflow: scroll;
272
+ scrollbar-width: none;
273
+ }
274
+
275
+ .contentContainer::-webkit-scrollbar {
276
+ display: none;
277
+ }
278
+
279
+ wui-icon-box {
280
+ width: 40px;
281
+ height: 40px;
282
+ border-radius: ${({borderRadius:t})=>t[3]};
283
+ }
284
+ `;var x=function(t,i,n,o){var s=arguments.length,r=s<3?i:o===null?o=Object.getOwnPropertyDescriptor(i,n):o,l;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(t,i,n,o);else for(var a=t.length-1;a>=0;a--)(l=t[a])&&(r=(s<3?l(r):s>3?l(i,n,r):l(i,n))||r);return s>3&&r&&Object.defineProperty(i,n,r),r};exports.W3mSendSelectTokenView=class extends e.i{constructor(){super(),this.unsubscribe=[],this.tokenBalances=e.SendController.state.tokenBalances,this.search="",this.onDebouncedSearch=e.CoreHelperUtil.debounce(i=>{this.search=i}),this.fetchBalancesAndNetworkPrice(),this.unsubscribe.push(e.SendController.subscribe(i=>{this.tokenBalances=i.tokenBalances}))}disconnectedCallback(){this.unsubscribe.forEach(i=>i())}render(){return e.b`
285
+ <wui-flex flexDirection="column">
286
+ ${this.templateSearchInput()} <wui-separator></wui-separator> ${this.templateTokens()}
287
+ </wui-flex>
288
+ `}async fetchBalancesAndNetworkPrice(){var i;(!this.tokenBalances||((i=this.tokenBalances)==null?void 0:i.length)===0)&&(await this.fetchBalances(),await this.fetchNetworkPrice())}async fetchBalances(){await e.SendController.fetchTokenBalance(),e.SendController.fetchNetworkBalance()}async fetchNetworkPrice(){await $.SwapController.getNetworkTokenPrice()}templateSearchInput(){return e.b`
289
+ <wui-flex gap="2" padding="3">
290
+ <wui-input-text
291
+ @inputChange=${this.onInputChange.bind(this)}
292
+ class="network-search-input"
293
+ size="sm"
294
+ placeholder="Search token"
295
+ icon="search"
296
+ ></wui-input-text>
297
+ </wui-flex>
298
+ `}templateTokens(){var i,n;return this.tokens=(i=this.tokenBalances)==null?void 0:i.filter(o=>{var s;return o.chainId===((s=e.ChainController.state.activeCaipNetwork)==null?void 0:s.caipNetworkId)}),this.search?this.filteredTokens=(n=this.tokenBalances)==null?void 0:n.filter(o=>o.name.toLowerCase().includes(this.search.toLowerCase())):this.filteredTokens=this.tokens,e.b`
299
+ <wui-flex
300
+ class="contentContainer"
301
+ flexDirection="column"
302
+ .padding=${["0","3","0","3"]}
303
+ >
304
+ <wui-flex justifyContent="flex-start" .padding=${["4","3","3","3"]}>
305
+ <wui-text variant="md-medium" color="secondary">Your tokens</wui-text>
306
+ </wui-flex>
307
+ <wui-flex flexDirection="column" gap="2">
308
+ ${this.filteredTokens&&this.filteredTokens.length>0?this.filteredTokens.map(o=>e.b`<wui-list-token
309
+ @click=${this.handleTokenClick.bind(this,o)}
310
+ ?clickable=${!0}
311
+ tokenName=${o.name}
312
+ tokenImageUrl=${o.iconUrl}
313
+ tokenAmount=${o.quantity.numeric}
314
+ tokenValue=${o.value}
315
+ tokenCurrency=${o.symbol}
316
+ ></wui-list-token>`):e.b`<wui-flex
317
+ .padding=${["20","0","0","0"]}
318
+ alignItems="center"
319
+ flexDirection="column"
320
+ gap="4"
321
+ >
322
+ <wui-icon-box icon="coinPlaceholder" color="default" size="lg"></wui-icon-box>
323
+ <wui-flex
324
+ class="textContent"
325
+ gap="2"
326
+ flexDirection="column"
327
+ justifyContent="center"
328
+ flexDirection="column"
329
+ >
330
+ <wui-text variant="lg-medium" align="center" color="primary">
331
+ No tokens found
332
+ </wui-text>
333
+ <wui-text variant="lg-regular" align="center" color="secondary">
334
+ Your tokens will appear here
335
+ </wui-text>
336
+ </wui-flex>
337
+ <wui-link @click=${this.onBuyClick.bind(this)}>Buy</wui-link>
338
+ </wui-flex>`}
339
+ </wui-flex>
340
+ </wui-flex>
341
+ `}onBuyClick(){e.RouterController.push("OnRampProviders")}onInputChange(i){this.onDebouncedSearch(i.detail)}handleTokenClick(i){e.SendController.setToken(i),e.SendController.setTokenAmount(void 0),e.RouterController.goBack()}};exports.W3mSendSelectTokenView.styles=E;x([e.r()],exports.W3mSendSelectTokenView.prototype,"tokenBalances",void 0);x([e.r()],exports.W3mSendSelectTokenView.prototype,"tokens",void 0);x([e.r()],exports.W3mSendSelectTokenView.prototype,"filteredTokens",void 0);x([e.r()],exports.W3mSendSelectTokenView.prototype,"search",void 0);exports.W3mSendSelectTokenView=x([e.customElement("w3m-wallet-send-select-token-view")],exports.W3mSendSelectTokenView);const P=e.css`
342
+ :host {
343
+ height: 32px;
344
+ display: flex;
345
+ align-items: center;
346
+ gap: ${({spacing:t})=>t[1]};
347
+ border-radius: ${({borderRadius:t})=>t[32]};
348
+ background-color: ${({tokens:t})=>t.theme.foregroundPrimary};
349
+ padding: ${({spacing:t})=>t[1]};
350
+ padding-left: ${({spacing:t})=>t[2]};
351
+ }
352
+
353
+ wui-avatar,
354
+ wui-image {
355
+ width: 24px;
356
+ height: 24px;
357
+ border-radius: ${({borderRadius:t})=>t[16]};
358
+ }
359
+
360
+ wui-icon {
361
+ border-radius: ${({borderRadius:t})=>t[16]};
362
+ }
363
+ `;var v=function(t,i,n,o){var s=arguments.length,r=s<3?i:o===null?o=Object.getOwnPropertyDescriptor(i,n):o,l;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(t,i,n,o);else for(var a=t.length-1;a>=0;a--)(l=t[a])&&(r=(s<3?l(r):s>3?l(i,n,r):l(i,n))||r);return s>3&&r&&Object.defineProperty(i,n,r),r};let p=class extends e.i{constructor(){super(...arguments),this.text=""}render(){return e.b`<wui-text variant="lg-regular" color="primary">${this.text}</wui-text>
364
+ ${this.imageTemplate()}`}imageTemplate(){return this.address?e.b`<wui-avatar address=${this.address} .imageSrc=${this.imageSrc}></wui-avatar>`:this.imageSrc?e.b`<wui-image src=${this.imageSrc}></wui-image>`:e.b`<wui-icon size="lg" color="inverse" name="networkPlaceholder"></wui-icon>`}};p.styles=[e.resetStyles,e.elementStyles,P];v([e.n({type:String})],p.prototype,"text",void 0);v([e.n({type:String})],p.prototype,"address",void 0);v([e.n({type:String})],p.prototype,"imageSrc",void 0);p=v([e.customElement("wui-preview-item")],p);const W=e.css`
365
+ :host {
366
+ display: flex;
367
+ padding: ${({spacing:t})=>t[4]} ${({spacing:t})=>t[3]};
368
+ width: 100%;
369
+ background-color: ${({tokens:t})=>t.theme.foregroundPrimary};
370
+ border-radius: ${({borderRadius:t})=>t[4]};
371
+ }
372
+
373
+ wui-image {
374
+ width: 20px;
375
+ height: 20px;
376
+ border-radius: ${({borderRadius:t})=>t[16]};
377
+ }
378
+
379
+ wui-icon {
380
+ width: 20px;
381
+ height: 20px;
382
+ }
383
+ `;var k=function(t,i,n,o){var s=arguments.length,r=s<3?i:o===null?o=Object.getOwnPropertyDescriptor(i,n):o,l;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(t,i,n,o);else for(var a=t.length-1;a>=0;a--)(l=t[a])&&(r=(s<3?l(r):s>3?l(i,n,r):l(i,n))||r);return s>3&&r&&Object.defineProperty(i,n,r),r};let m=class extends e.i{constructor(){super(...arguments),this.imageSrc=void 0,this.textTitle="",this.textValue=void 0}render(){return e.b`
384
+ <wui-flex justifyContent="space-between" alignItems="center">
385
+ <wui-text variant="lg-regular" color="primary"> ${this.textTitle} </wui-text>
386
+ ${this.templateContent()}
387
+ </wui-flex>
388
+ `}templateContent(){return this.imageSrc?e.b`<wui-image src=${this.imageSrc} alt=${this.textTitle}></wui-image>`:this.textValue?e.b` <wui-text variant="md-regular" color="secondary"> ${this.textValue} </wui-text>`:e.b`<wui-icon size="inherit" color="default" name="networkPlaceholder"></wui-icon>`}};m.styles=[e.resetStyles,e.elementStyles,W];k([e.n()],m.prototype,"imageSrc",void 0);k([e.n()],m.prototype,"textTitle",void 0);k([e.n()],m.prototype,"textValue",void 0);m=k([e.customElement("wui-list-content")],m);const N=e.css`
389
+ :host {
390
+ display: flex;
391
+ width: auto;
392
+ flex-direction: column;
393
+ gap: ${({spacing:t})=>t[1]};
394
+ border-radius: ${({borderRadius:t})=>t[5]};
395
+ background: ${({tokens:t})=>t.theme.foregroundPrimary};
396
+ padding: ${({spacing:t})=>t[3]} ${({spacing:t})=>t[2]}
397
+ ${({spacing:t})=>t[2]} ${({spacing:t})=>t[2]};
398
+ }
399
+
400
+ wui-list-content {
401
+ width: -webkit-fill-available !important;
402
+ }
403
+
404
+ wui-text {
405
+ padding: 0 ${({spacing:t})=>t[2]};
406
+ }
407
+
408
+ wui-flex {
409
+ margin-top: ${({spacing:t})=>t[2]};
410
+ }
411
+
412
+ .network {
413
+ cursor: pointer;
414
+ transition: background-color ${({durations:t})=>t.lg}
415
+ ${({easings:t})=>t["ease-out-power-1"]};
416
+ will-change: background-color;
417
+ }
418
+
419
+ .network:focus-visible {
420
+ border: 1px solid ${({tokens:t})=>t.core.textAccentPrimary};
421
+ background-color: ${({tokens:t})=>t.core.glass010};
422
+ -webkit-box-shadow: 0px 0px 0px 4px ${({tokens:t})=>t.core.foregroundAccent010};
423
+ -moz-box-shadow: 0px 0px 0px 4px ${({tokens:t})=>t.core.foregroundAccent010};
424
+ box-shadow: 0px 0px 0px 4px ${({tokens:t})=>t.core.foregroundAccent010};
425
+ }
426
+
427
+ .network:hover {
428
+ background-color: ${({tokens:t})=>t.core.glass010};
429
+ }
430
+
431
+ .network:active {
432
+ background-color: ${({tokens:t})=>t.core.glass010};
433
+ }
434
+ `;var C=function(t,i,n,o){var s=arguments.length,r=s<3?i:o===null?o=Object.getOwnPropertyDescriptor(i,n):o,l;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(t,i,n,o);else for(var a=t.length-1;a>=0;a--)(l=t[a])&&(r=(s<3?l(r):s>3?l(i,n,r):l(i,n))||r);return s>3&&r&&Object.defineProperty(i,n,r),r};let w=class extends e.i{constructor(){var i;super(...arguments),this.params=(i=e.RouterController.state.data)==null?void 0:i.send}render(){return e.b` <wui-text variant="sm-regular" color="secondary">Details</wui-text>
435
+ <wui-flex flexDirection="column" gap="1">
436
+ <wui-list-content
437
+ textTitle="Address"
438
+ textValue=${e.UiHelperUtil.getTruncateString({string:this.receiverAddress??"",charsStart:4,charsEnd:4,truncate:"middle"})}
439
+ >
440
+ </wui-list-content>
441
+ ${this.networkTemplate()}
442
+ </wui-flex>`}networkTemplate(){var i;return(i=this.caipNetwork)!=null&&i.name?e.b` <wui-list-content
443
+ @click=${()=>this.onNetworkClick(this.caipNetwork)}
444
+ class="network"
445
+ textTitle="Network"
446
+ imageSrc=${e.o(e.AssetUtil.getNetworkImage(this.caipNetwork))}
447
+ ></wui-list-content>`:null}onNetworkClick(i){i&&!this.params&&e.RouterController.push("Networks",{network:i})}};w.styles=N;C([e.n()],w.prototype,"receiverAddress",void 0);C([e.n({type:Object})],w.prototype,"caipNetwork",void 0);C([e.r()],w.prototype,"params",void 0);w=C([e.customElement("w3m-wallet-send-details")],w);const I=e.css`
448
+ wui-avatar,
449
+ wui-image {
450
+ display: ruby;
451
+ width: 32px;
452
+ height: 32px;
453
+ border-radius: ${({borderRadius:t})=>t[20]};
454
+ }
455
+
456
+ .sendButton {
457
+ width: 70%;
458
+ --local-width: 100% !important;
459
+ --local-border-radius: ${({borderRadius:t})=>t[4]} !important;
460
+ }
461
+
462
+ .cancelButton {
463
+ width: 30%;
464
+ --local-width: 100% !important;
465
+ --local-border-radius: ${({borderRadius:t})=>t[4]} !important;
466
+ }
467
+ `;var d=function(t,i,n,o){var s=arguments.length,r=s<3?i:o===null?o=Object.getOwnPropertyDescriptor(i,n):o,l;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(t,i,n,o);else for(var a=t.length-1;a>=0;a--)(l=t[a])&&(r=(s<3?l(r):s>3?l(i,n,r):l(i,n))||r);return s>3&&r&&Object.defineProperty(i,n,r),r};exports.W3mWalletSendPreviewView=class extends e.i{constructor(){var i;super(),this.unsubscribe=[],this.token=e.SendController.state.token,this.sendTokenAmount=e.SendController.state.sendTokenAmount,this.receiverAddress=e.SendController.state.receiverAddress,this.receiverProfileName=e.SendController.state.receiverProfileName,this.receiverProfileImageUrl=e.SendController.state.receiverProfileImageUrl,this.caipNetwork=e.ChainController.state.activeCaipNetwork,this.loading=e.SendController.state.loading,this.params=(i=e.RouterController.state.data)==null?void 0:i.send,this.unsubscribe.push(e.SendController.subscribe(n=>{this.token=n.token,this.sendTokenAmount=n.sendTokenAmount,this.receiverAddress=n.receiverAddress,this.receiverProfileName=n.receiverProfileName,this.receiverProfileImageUrl=n.receiverProfileImageUrl,this.loading=n.loading}),e.ChainController.subscribeKey("activeCaipNetwork",n=>this.caipNetwork=n))}disconnectedCallback(){this.unsubscribe.forEach(i=>i())}render(){var i,n;return e.b` <wui-flex flexDirection="column" .padding=${["0","4","4","4"]}>
468
+ <wui-flex gap="2" flexDirection="column" .padding=${["0","2","0","2"]}>
469
+ <wui-flex alignItems="center" justifyContent="space-between">
470
+ <wui-flex flexDirection="column" gap="01">
471
+ <wui-text variant="sm-regular" color="secondary">Send</wui-text>
472
+ ${this.sendValueTemplate()}
473
+ </wui-flex>
474
+ <wui-preview-item
475
+ text="${this.sendTokenAmount?e.UiHelperUtil.roundNumber(this.sendTokenAmount,6,5):"unknown"} ${(i=this.token)==null?void 0:i.symbol}"
476
+ .imageSrc=${(n=this.token)==null?void 0:n.iconUrl}
477
+ ></wui-preview-item>
478
+ </wui-flex>
479
+ <wui-flex>
480
+ <wui-icon color="default" size="md" name="arrowBottom"></wui-icon>
481
+ </wui-flex>
482
+ <wui-flex alignItems="center" justifyContent="space-between">
483
+ <wui-text variant="sm-regular" color="secondary">To</wui-text>
484
+ <wui-preview-item
485
+ text="${this.receiverProfileName?e.UiHelperUtil.getTruncateString({string:this.receiverProfileName,charsStart:20,charsEnd:0,truncate:"end"}):e.UiHelperUtil.getTruncateString({string:this.receiverAddress?this.receiverAddress:"",charsStart:4,charsEnd:4,truncate:"middle"})}"
486
+ address=${this.receiverAddress??""}
487
+ .imageSrc=${this.receiverProfileImageUrl??void 0}
488
+ .isAddress=${!0}
489
+ ></wui-preview-item>
490
+ </wui-flex>
491
+ </wui-flex>
492
+ <wui-flex flexDirection="column" .padding=${["6","0","0","0"]}>
493
+ <w3m-wallet-send-details
494
+ .caipNetwork=${this.caipNetwork}
495
+ .receiverAddress=${this.receiverAddress}
496
+ ></w3m-wallet-send-details>
497
+ <wui-flex justifyContent="center" gap="1" .padding=${["3","0","0","0"]}>
498
+ <wui-icon size="sm" color="default" name="warningCircle"></wui-icon>
499
+ <wui-text variant="sm-regular" color="secondary">Review transaction carefully</wui-text>
500
+ </wui-flex>
501
+ <wui-flex justifyContent="center" gap="3" .padding=${["4","0","0","0"]}>
502
+ <wui-button
503
+ class="cancelButton"
504
+ @click=${this.onCancelClick.bind(this)}
505
+ size="lg"
506
+ variant="neutral-secondary"
507
+ >
508
+ Cancel
509
+ </wui-button>
510
+ <wui-button
511
+ class="sendButton"
512
+ @click=${this.onSendClick.bind(this)}
513
+ size="lg"
514
+ variant="accent-primary"
515
+ .loading=${this.loading}
516
+ >
517
+ Send
518
+ </wui-button>
519
+ </wui-flex>
520
+ </wui-flex></wui-flex
521
+ >`}sendValueTemplate(){if(!this.params&&this.token&&this.sendTokenAmount){const n=this.token.price*this.sendTokenAmount;return e.b`<wui-text variant="md-regular" color="primary"
522
+ >$${n.toFixed(2)}</wui-text
523
+ >`}return null}async onSendClick(){if(!this.sendTokenAmount||!this.receiverAddress){e.SnackController.showError("Please enter a valid amount and receiver address");return}try{await e.SendController.sendToken(),this.params?e.RouterController.reset("WalletSendConfirmed"):(e.SnackController.showSuccess("Transaction started"),e.RouterController.replace("Account"))}catch(i){let n="Failed to send transaction";const o=i instanceof e.AppKitError&&i.originalName===e.ErrorUtil$1.PROVIDER_RPC_ERROR_NAME.USER_REJECTED_REQUEST,s=i instanceof e.AppKitError&&i.originalName===e.ErrorUtil$1.PROVIDER_RPC_ERROR_NAME.SEND_TRANSACTION_ERROR;(o||s)&&(n=i.message),e.EventsController.sendEvent({type:"track",event:o?"SEND_REJECTED":"SEND_ERROR",properties:e.SendController.getSdkEventProperties(i)}),e.SnackController.showError(n)}}onCancelClick(){e.RouterController.goBack()}};exports.W3mWalletSendPreviewView.styles=I;d([e.r()],exports.W3mWalletSendPreviewView.prototype,"token",void 0);d([e.r()],exports.W3mWalletSendPreviewView.prototype,"sendTokenAmount",void 0);d([e.r()],exports.W3mWalletSendPreviewView.prototype,"receiverAddress",void 0);d([e.r()],exports.W3mWalletSendPreviewView.prototype,"receiverProfileName",void 0);d([e.r()],exports.W3mWalletSendPreviewView.prototype,"receiverProfileImageUrl",void 0);d([e.r()],exports.W3mWalletSendPreviewView.prototype,"caipNetwork",void 0);d([e.r()],exports.W3mWalletSendPreviewView.prototype,"loading",void 0);d([e.r()],exports.W3mWalletSendPreviewView.prototype,"params",void 0);exports.W3mWalletSendPreviewView=d([e.customElement("w3m-wallet-send-preview-view")],exports.W3mWalletSendPreviewView);const D=e.css`
524
+ .icon-box {
525
+ width: 64px;
526
+ height: 64px;
527
+ border-radius: 16px;
528
+ background-color: ${({spacing:t})=>t[16]};
529
+ border: 8px solid ${({tokens:t})=>t.theme.borderPrimary};
530
+ border-radius: ${({borderRadius:t})=>t.round};
531
+ }
532
+ `;var V=function(t,i,n,o){var s=arguments.length,r=s<3?i:o===null?o=Object.getOwnPropertyDescriptor(i,n):o,l;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(t,i,n,o);else for(var a=t.length-1;a>=0;a--)(l=t[a])&&(r=(s<3?l(r):s>3?l(i,n,r):l(i,n))||r);return s>3&&r&&Object.defineProperty(i,n,r),r};exports.W3mSendConfirmedView=class extends e.i{constructor(){super(),this.unsubscribe=[],this.unsubscribe.push()}render(){return e.b`
533
+ <wui-flex
534
+ flexDirection="column"
535
+ alignItems="center"
536
+ gap="4"
537
+ .padding="${["1","3","4","3"]}"
538
+ >
539
+ <wui-flex justifyContent="center" alignItems="center" class="icon-box">
540
+ <wui-icon size="xxl" color="success" name="checkmark"></wui-icon>
541
+ </wui-flex>
542
+
543
+ <wui-text variant="h6-medium" color="primary">You successfully sent asset</wui-text>
544
+
545
+ <wui-button
546
+ fullWidth
547
+ @click=${this.onCloseClick.bind(this)}
548
+ size="lg"
549
+ variant="neutral-secondary"
550
+ >
551
+ Close
552
+ </wui-button>
553
+ </wui-flex>
554
+ `}onCloseClick(){e.ModalController.close()}};exports.W3mSendConfirmedView.styles=D;exports.W3mSendConfirmedView=V([e.customElement("w3m-send-confirmed-view")],exports.W3mSendConfirmedView);