1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[2725],{52725:(e,t,i)=>{i.r(t),i.d(t,{W3mSendSelectTokenView:()=>S,W3mWalletSendPreviewView:()=>Y,W3mWalletSendView:()=>P});var n=i(22707),r=i(71877),o=i(4891),s=i(96060),a=i(6792),l=i(85934),c=i(12890),u=i(21438);i(2080),i(21995),i(39001);var d=i(5838),h=i(2767);i(44949),i(97039);let p=(0,n.AH)` 2 :host { 3 width: 100%; 4 height: 100px; 5 border-radius: var(--wui-border-radius-s); 6 border: 1px solid var(--wui-color-gray-glass-002); 7 background-color: var(--wui-color-gray-glass-002); 8 transition: background-color var(--wui-ease-out-power-1) var(--wui-duration-lg); 9 will-change: background-color; 10 position: relative; 11 } 12 13 :host(:hover) { 14 background-color: var(--wui-color-gray-glass-005); 15 } 16 17 wui-flex { 18 width: 100%; 19 height: fit-content; 20 } 21 22 wui-button { 23 display: ruby; 24 color: var(--wui-color-fg-100); 25 margin: 0 var(--wui-spacing-xs); 26 } 27 28 .instruction { 29 position: absolute; 30 top: 50%; 31 transform: translateY(-50%); 32 z-index: 2; 33 } 34 35 .paste { 36 display: inline-flex; 37 } 38 39 textarea { 40 background: transparent; 41 width: 100%; 42 font-family: var(--w3m-font-family); 43 font-size: var(--wui-font-size-medium); 44 font-style: normal; 45 font-weight: var(--wui-font-weight-light); 46 line-height: 130%; 47 letter-spacing: var(--wui-letter-spacing-medium); 48 color: var(--wui-color-fg-100); 49 caret-color: var(--wui-color-accent-100); 50 box-sizing: border-box; 51 -webkit-appearance: none; 52 -moz-appearance: textfield; 53 padding: 0px; 54 border: none; 55 outline: none; 56 appearance: none; 57 resize: none; 58 overflow: hidden; 59 } 60`;var w=function(e,t,i,n){var r,o=arguments.length,s=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(r=e[a])&&(s=(o<3?r(s):o>3?r(t,i,s):r(t,i))||s);return o>3&&s&&Object.defineProperty(t,i,s),s};let f=class extends n.WF{constructor(){super(...arguments),this.inputElementRef=(0,d._)(),this.instructionElementRef=(0,d._)(),this.instructionHidden=!!this.value,this.pasting=!1,this.onDebouncedSearch=l.w.debounce(async e=>{if(!e.length)return void this.setReceiverAddress("");let t=c.W.state.activeChain;if(l.w.isAddress(e,t))return void this.setReceiverAddress(e);try{let t=await h.x.getEnsAddress(e);if(t){o.R.setReceiverProfileName(e),o.R.setReceiverAddress(t);let i=await h.x.getEnsAvatar(e);o.R.setReceiverProfileImageUrl(i||void 0)}}catch(t){this.setReceiverAddress(e)}finally{o.R.setLoading(!1)}})}firstUpdated(){this.value&&(this.instructionHidden=!0),this.checkHidden()}render(){return(0,n.qy)` <wui-flex 61 @click=${this.onBoxClick.bind(this)} 62 flexDirection="column" 63 justifyContent="center" 64 gap="4xs" 65 .padding=${["2xl","l","xl","l"]} 66 > 67 <wui-text 68 ${(0,d.K)(this.instructionElementRef)} 69 class="instruction" 70 color="fg-300" 71 variant="medium-400" 72 > 73 Type or 74 <wui-button 75 class="paste" 76 size="md" 77 variant="neutral" 78 iconLeft="copy" 79 @click=${this.onPasteClick.bind(this)} 80 > 81 <wui-icon size="sm" color="inherit" slot="iconLeft" name="copy"></wui-icon> 82 Paste 83 </wui-button> 84 address 85 </wui-text> 86 <textarea 87 spellcheck="false" 88 ?disabled=${!this.instructionHidden} 89 ${(0,d.K)(this.inputElementRef)} 90 @input=${this.onInputChange.bind(this)} 91 @blur=${this.onBlur.bind(this)} 92 .value=${this.value??""} 93 autocomplete="off" 94 > 95${this.value??""}</textarea 96 > 97 </wui-flex>`}async focusInput(){this.instructionElementRef.value&&(this.instructionHidden=!0,await this.toggleInstructionFocus(!1),this.instructionElementRef.value.style.pointerEvents="none",this.inputElementRef.value?.focus(),this.inputElementRef.value&&(this.inputElementRef.value.selectionStart=this.inputElementRef.value.selectionEnd=this.inputElementRef.value.value.length))}async focusInstruction(){this.instructionElementRef.value&&(this.instructionHidden=!1,await this.toggleInstructionFocus(!0),this.instructionElementRef.value.style.pointerEvents="auto",this.inputElementRef.value?.blur())}async toggleInstructionFocus(e){this.instructionElementRef.value&&await this.instructionElementRef.value.animate([{opacity:+!e},{opacity:+!!e}],{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;let e=await navigator.clipboard.readText();o.R.setReceiverAddress(e),this.focusInput()}onInputChange(e){let t=e.target;this.pasting=!1,this.value=e.target?.value,t.value&&!this.instructionHidden&&this.focusInput(),o.R.setLoading(!0),this.onDebouncedSearch(t.value)}setReceiverAddress(e){o.R.setReceiverAddress(e),o.R.setReceiverProfileName(void 0),o.R.setReceiverProfileImageUrl(void 0),o.R.setLoading(!1)}};f.styles=p,w([(0,r.MZ)()],f.prototype,"value",void 0),w([(0,r.wk)()],f.prototype,"instructionHidden",void 0),w([(0,r.wk)()],f.prototype,"pasting",void 0),f=w([(0,u.EM)("w3m-input-address")],f);var g=i(58692),v=i(2467),m=i(12248),k=i(64859);let x=(0,n.AH)` 98 :host { 99 position: relative; 100 display: inline-block; 101 } 102 103 input { 104 background: transparent; 105 width: 100%; 106 height: auto; 107 font-family: var(--wui-font-family); 108 color: var(--wui-color-fg-100); 109 110 font-feature-settings: 'case' on; 111 font-size: 32px; 112 font-weight: var(--wui-font-weight-light); 113 caret-color: var(--wui-color-accent-100); 114 line-height: 130%; 115 letter-spacing: -1.28px; 116 box-sizing: border-box; 117 -webkit-appearance: none; 118 -moz-appearance: textfield; 119 padding: 0px; 120 } 121 122 input::-webkit-outer-spin-button, 123 input::-webkit-inner-spin-button { 124 -webkit-appearance: none; 125 margin: 0; 126 } 127 128 input::placeholder { 129 color: var(--wui-color-fg-275); 130 } 131`;var b=function(e,t,i,n){var r,o=arguments.length,s=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(r=e[a])&&(s=(o<3?r(s):o>3?r(t,i,s):r(t,i))||s);return o>3&&s&&Object.defineProperty(t,i,s),s};let y=class extends n.WF{constructor(){super(...arguments),this.inputElementRef=(0,d._)(),this.disabled=!1,this.value="",this.placeholder="0"}render(){return this.inputElementRef?.value&&this.value&&(this.inputElementRef.value.value=this.value),(0,n.qy)`<input 132 ${(0,d.K)(this.inputElementRef)} 133 type="text" 134 inputmode="decimal" 135 pattern="[0-9,.]*" 136 placeholder=${this.placeholder} 137 ?disabled=${this.disabled} 138 autofocus 139 value=${this.value??""}
140 @input=${this.dispatchInputChangeEvent.bind(this)} 141 /> `}dispatchInputChangeEvent(e){let t=e.data;if(t&&this.inputElementRef?.value)if(","===t){let e=this.inputElementRef.value.value.replace(",",".");this.inputElementRef.value.value=e,this.value=`${this.value}${e}`}else v.Ky.test(t)||(this.inputElementRef.value.value=this.value.replace(RegExp(t.replace(v.PG,"\\$&"),"gu"),""));this.dispatchEvent(new CustomEvent("inputChange",{detail:this.inputElementRef.value?.value,bubbles:!0,composed:!0}))}};y.styles=[m.W5,m.fD,x],b([(0,r.MZ)({type:Boolean})],y.prototype,"disabled",void 0),b([(0,r.MZ)({type:String})],y.prototype,"value",void 0),b([(0,r.MZ)({type:String})],y.prototype,"placeholder",void 0),y=b([(0,k.E)("wui-input-amount")],y),i(99548),i(51636);let R=(0,n.AH)` 142 :host { 143 width: 100%; 144 height: 100px; 145 border-radius: var(--wui-border-radius-s); 146 border: 1px solid var(--wui-color-gray-glass-002); 147 background-color: var(--wui-color-gray-glass-002); 148 transition: background-color var(--wui-ease-out-power-1) var(--wui-duration-lg); 149 will-change: background-color; 150 } 151 152 :host(:hover) { 153 background-color: var(--wui-color-gray-glass-005); 154 } 155 156 wui-flex { 157 width: 100%; 158 height: fit-content; 159 } 160 161 wui-button { 162 width: 100%; 163 display: flex; 164 justify-content: flex-end; 165 } 166 167 wui-input-amount { 168 mask-image: linear-gradient( 169 270deg, 170 transparent 0px, 171 transparent 8px, 172 black 24px, 173 black 25px, 174 black 32px, 175 black 100% 176 ); 177 } 178 179 .totalValue { 180 width: 100%; 181 } 182`;var A=function(e,t,i,n){var r,o=arguments.length,s=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(r=e[a])&&(s=(o<3?r(s):o>3?r(t,i,s):r(t,i))||s);return o>3&&s&&Object.defineProperty(t,i,s),s};let $=class extends n.WF{render(){return(0,n.qy)` <wui-flex 183 flexDirection="column" 184 gap="4xs" 185 .padding=${["xl","s","l","l"]} 186 > 187 <wui-flex alignItems="center"> 188 <wui-input-amount 189 @inputChange=${this.onInputChange.bind(this)} 190 ?disabled=${!this.token} 191 .value=${this.sendTokenAmount?String(this.sendTokenAmount):""} 192 ></wui-input-amount> 193 ${this.buttonTemplate()} 194 </wui-flex> 195 <wui-flex alignItems="center" justifyContent="space-between"> 196 ${this.sendValueTemplate()} 197 <wui-flex alignItems="center" gap="4xs" justifyContent="flex-end"> 198 ${this.maxAmountTemplate()} ${this.actionTemplate()} 199 </wui-flex> 200 </wui-flex> 201 </wui-flex>`}buttonTemplate(){return this.token?(0,n.qy)`<wui-token-button 202 text=${this.token.symbol} 203 imageSrc=${this.token.iconUrl} 204 @click=${this.handleSelectButtonClick.bind(this)} 205 > 206 </wui-token-button>`:(0,n.qy)`<wui-button 207 size="md" 208 variant="accent" 209 @click=${this.handleSelectButtonClick.bind(this)} 210 >Select token</wui-button 211 >`}handleSelectButtonClick(){a.I.push("WalletSendSelectToken")}sendValueTemplate(){if(this.token&&this.sendTokenAmount){let e=this.token.price*this.sendTokenAmount;return(0,n.qy)`<wui-text class="totalValue" variant="small-400" color="fg-200" 212 >${e?`$${u.Zv.formatNumberToLocalString(e,2)}`:"Incorrect value"}</wui-text 213 >`}return null}maxAmountTemplate(){return this.token?this.sendTokenAmount&&this.sendTokenAmount>Number(this.token.quantity.numeric)?(0,n.qy)` <wui-text variant="small-400" color="error-100"> 214 ${u.Zv.roundNumber(Number(this.token.quantity.numeric),6,5)} 215 </wui-text>`:(0,n.qy)` <wui-text variant="small-400" color="fg-200"> 216 ${u.Zv.roundNumber(Number(this.token.quantity.numeric),6,5)} 217 </wui-text>`:null}actionTemplate(){return this.token?this.sendTokenAmount&&this.sendTokenAmount>Number(this.token.quantity.numeric)?(0,n.qy)`<wui-link @click=${this.onBuyClick.bind(this)}>Buy</wui-link>`:(0,n.qy)`<wui-link @click=${this.onMaxClick.bind(this)}>Max</wui-link>`:null}onInputChange(e){o.R.setTokenAmount(e.detail)}onMaxClick(){if(this.token){let e=g.S.bigNumber(this.token.quantity.numeric);o.R.setTokenAmount(Number(e.toFixed(20)))}}
217onBuyClick(){a.I.push("OnRampProviders")}};$.styles=R,A([(0,r.MZ)({type:Object})],$.prototype,"token",void 0),A([(0,r.MZ)({type:Number})],$.prototype,"sendTokenAmount",void 0),$=A([(0,u.EM)("w3m-input-token")],$);let T=(0,n.AH)` 218 :host { 219 display: block; 220 } 221 222 wui-flex { 223 position: relative; 224 } 225 226 wui-icon-box { 227 width: 40px; 228 height: 40px; 229 border-radius: var(--wui-border-radius-xs) !important; 230 border: 5px solid var(--wui-color-bg-125); 231 background: var(--wui-color-bg-175); 232 position: absolute; 233 top: 50%; 234 left: 50%; 235 transform: translate(-50%, -50%); 236 z-index: 3; 237 } 238 239 wui-button { 240 --local-border-radius: var(--wui-border-radius-xs) !important; 241 } 242 243 .inputContainer { 244 height: fit-content; 245 } 246`;var C=function(e,t,i,n){var r,o=arguments.length,s=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(r=e[a])&&(s=(o<3?r(s):o>3?r(t,i,s):r(t,i))||s);return o>3&&s&&Object.defineProperty(t,i,s),s};let P=class extends n.WF{constructor(){super(),this.unsubscribe=[],this.token=o.R.state.token,this.sendTokenAmount=o.R.state.sendTokenAmount,this.receiverAddress=o.R.state.receiverAddress,this.receiverProfileName=o.R.state.receiverProfileName,this.loading=o.R.state.loading,this.message="Preview Send",this.token&&(this.fetchBalances(),this.fetchNetworkPrice()),this.unsubscribe.push(o.R.subscribe(e=>{this.token=e.token,this.sendTokenAmount=e.sendTokenAmount,this.receiverAddress=e.receiverAddress,this.receiverProfileName=e.receiverProfileName,this.loading=e.loading}))}disconnectedCallback(){this.unsubscribe.forEach(e=>e())}render(){return this.getMessage(),(0,n.qy)` <wui-flex flexDirection="column" .padding=${["0","l","l","l"]}> 247 <wui-flex class="inputContainer" gap="xs" flexDirection="column"> 248 <w3m-input-token 249 .token=${this.token} 250 .sendTokenAmount=${this.sendTokenAmount} 251 ></w3m-input-token> 252 <wui-icon-box 253 size="inherit" 254 backgroundColor="fg-300" 255 iconSize="lg" 256 iconColor="fg-250" 257 background="opaque" 258 icon="arrowBottom" 259 ></wui-icon-box> 260 <w3m-input-address 261 .value=${this.receiverProfileName?this.receiverProfileName:this.receiverAddress} 262 ></w3m-input-address> 263 </wui-flex> 264 <wui-flex .margin=${["l","0","0","0"]}> 265 <wui-button 266 @click=${this.onButtonClick.bind(this)} 267 ?disabled=${!this.message.startsWith("Preview Send")} 268 size="lg" 269 variant="main" 270 ?loading=${this.loading} 271 fullWidth 272 > 273 ${this.message} 274 </wui-button> 275 </wui-flex> 276 </wui-flex>`}async fetchBalances(){await o.R.fetchTokenBalance(),o.R.fetchNetworkBalance()}async fetchNetworkPrice(){await s.GN.getNetworkTokenPrice()}onButtonClick(){a.I.push("WalletSendPreview")}getMessage(){this.message="Preview Send",this.receiverAddress&&!l.w.isAddress(this.receiverAddress,c.W.state.activeChain)&&(this.message="Invalid Address"),this.receiverAddress||(this.message="Add Address"),this.sendTokenAmount&&this.token&&this.sendTokenAmount>Number(this.token.quantity.numeric)&&(this.message="Insufficient Funds"),this.sendTokenAmount||(this.message="Add Amount"),this.sendTokenAmount&&this.token?.price&&(this.sendTokenAmount*this.token.price||(this.message="Incorrect Value")),this.token||(this.message="Select Token")}};P.styles=T,C([(0,r.wk)()],P.prototype,"token",void 0),C([(0,r.wk)()],P.prototype,"sendTokenAmount",void 0),C([(0,r.wk)()],P.prototype,"receiverAddress",void 0),C([(0,r.wk)()],P.prototype,"receiverProfileName",void 0),C([(0,r.wk)()],P.prototype,"loading",void 0),C([(0,r.wk)()],P.prototype,"message",void 0),P=C([(0,u.EM)("w3m-wallet-send-view")],P),i(66504),i(12070),i(8633);let N=(0,n.AH)` 277 .contentContainer { 278 height: 440px; 279 overflow: scroll; 280 scrollbar-width: none; 281 } 282 283 .contentContainer::-webkit-scrollbar {
284 display: none; 285 } 286 287 wui-icon-box { 288 width: 40px; 289 height: 40px; 290 border-radius: var(--wui-border-radius-xxs); 291 } 292`;var E=function(e,t,i,n){var r,o=arguments.length,s=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(r=e[a])&&(s=(o<3?r(s):o>3?r(t,i,s):r(t,i))||s);return o>3&&s&&Object.defineProperty(t,i,s),s};let S=class extends n.WF{constructor(){super(),this.unsubscribe=[],this.tokenBalances=o.R.state.tokenBalances,this.search="",this.onDebouncedSearch=l.w.debounce(e=>{this.search=e}),this.fetchBalancesAndNetworkPrice(),this.unsubscribe.push(o.R.subscribe(e=>{this.tokenBalances=e.tokenBalances}))}disconnectedCallback(){this.unsubscribe.forEach(e=>e())}render(){return(0,n.qy)` 293 <wui-flex flexDirection="column"> 294 ${this.templateSearchInput()} <wui-separator></wui-separator> ${this.templateTokens()} 295 </wui-flex> 296 `}async fetchBalancesAndNetworkPrice(){this.tokenBalances&&this.tokenBalances?.length!==0||(await this.fetchBalances(),await this.fetchNetworkPrice())}async fetchBalances(){await o.R.fetchTokenBalance(),o.R.fetchNetworkBalance()}async fetchNetworkPrice(){await s.GN.getNetworkTokenPrice()}templateSearchInput(){return(0,n.qy)` 297 <wui-flex gap="xs" padding="s"> 298 <wui-input-text 299 @inputChange=${this.onInputChange.bind(this)} 300 class="network-search-input" 301 size="sm" 302 placeholder="Search token" 303 icon="search" 304 ></wui-input-text> 305 </wui-flex> 306 `}templateTokens(){return this.tokens=this.tokenBalances?.filter(e=>e.chainId===c.W.state.activeCaipNetwork?.caipNetworkId),this.search?this.filteredTokens=this.tokenBalances?.filter(e=>e.name.toLowerCase().includes(this.search.toLowerCase())):this.filteredTokens=this.tokens,(0,n.qy)` 307 <wui-flex 308 class="contentContainer" 309 flexDirection="column" 310 .padding=${["0","s","0","s"]} 311 > 312 <wui-flex justifyContent="flex-start" .padding=${["m","s","s","s"]}> 313 <wui-text variant="paragraph-500" color="fg-200">Your tokens</wui-text> 314 </wui-flex> 315 <wui-flex flexDirection="column" gap="xs"> 316 ${this.filteredTokens&&this.filteredTokens.length>0?this.filteredTokens.map(e=>(0,n.qy)`<wui-list-token 317 @click=${this.handleTokenClick.bind(this,e)} 318 ?clickable=${!0} 319 tokenName=${e.name} 320 tokenImageUrl=${e.iconUrl} 321 tokenAmount=${e.quantity.numeric} 322 tokenValue=${e.value} 323 tokenCurrency=${e.symbol} 324 ></wui-list-token>`):(0,n.qy)`<wui-flex 325 .padding=${["4xl","0","0","0"]} 326 alignItems="center" 327 flexDirection="column" 328 gap="l" 329 > 330 <wui-icon-box 331 icon="coinPlaceholder" 332 size="inherit" 333 iconColor="fg-200" 334 backgroundColor="fg-200" 335 iconSize="lg" 336 ></wui-icon-box> 337 <wui-flex 338 class="textContent" 339 gap="xs" 340 flexDirection="column" 341 justifyContent="center" 342 flexDirection="column" 343 > 344 <wui-text variant="paragraph-500" align="center" color="fg-100" 345 >No tokens found</wui-text 346 > 347 <wui-text variant="small-400" align="center" color="fg-200" 348 >Your tokens will appear here</wui-text 349 > 350 </wui-flex> 351 <wui-link @click=${this.onBuyClick.bind(this)}>Buy</wui-link> 352 </wui-flex>`} 353 </wui-flex> 354 </wui-flex> 355 `}onBuyClick(){a.I.push("OnRampProviders")}onInputChange(e){this.onDebouncedSearch(e.detail)}handleTokenClick(e){o.R.setToken(e),o.R.setTokenAmount(void 0),a.I.goBack()}};S.styles=N,E([(0,r.wk)()],S.prototype,"tokenBalances",void 0),E([(0,r.wk)()],S.prototype,"tokens",void 0),E([(0,r.wk)()],S.prototype,"filteredTokens",void 0),E([(0,r.wk)()],S.prototype,"search",void 0),S=E([(0,u.EM)("w3m-wallet-send-select-token-view")],S);var I=i(72317),B=i(77424),j=i(11862);i(85219),i(2657),i(67327),i(18089),i(33277);let q=(0,n.AH)` 356 :host { 357 display: flex; 358 gap: var(--wui-spacing-xs); 359 border-radius: var(--wui-border-radius-3xl); 360 border: 1px solid var(--wui-color-gray-glass-002); 361 background: var(--wui-color-gray-glass-002); 362 padding: var(--wui-spacing-2xs) var(--wui-spacing-xs) var(--wui-spacing-2xs) 363 var(--wui-spacing-s); 364 align-items: center; 365 } 366 367 wui-avatar, 368 wui-icon, 369 wui-image { 370 width: 32px; 371 height: 32px; 372 border: 1px solid var(--wui-color-gray-glass-002); 373 border-radius: var(--wui-border-radius-3xl); 374 box-shadow: 0 0 0 2px var(--wui-color-gray-glass-002); 375 } 376`;var O=function(e,t,i,n){var r,o=arguments.length,s=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(r=e[a])&&(s=(o<3?r(s):o>3?r(t,i,s):r(t,i))||s);return o>3&&s&&Object.defineProperty(t,i,s),s};let D=class extends n.WF{constructor(){super(...arguments),this.text="",this.address="",this.isAddress=!1}render(){return(0,n.qy)`<wui-text variant="large-500" color="fg-100">${this.text}</wui-text> 377 ${this.imageTemplate()}`}imageTemplate(){return this.isAddress?(0,n.qy)`<wui-avatar address=${this.address} .imageSrc=${this.imageSrc}></wui-avatar>`:this.imageSrc?(0,n.qy)`<wui-image src=${this.imageSrc}></wui-image>`:(0,n.qy)`<wui-icon size="inherit" color="fg-200" name="networkPlaceholder"></wui-icon>`}};D.styles=[m.W5,m.fD,q],O([(0,r.MZ)()],D.prototype,"text",void 0),O([(0,r.MZ)()],D.prototype,"address",void 0),O([(0,r.MZ)()],D.prototype,"imageSrc",void 0),O([(0,r.MZ)({type:Boolean})],D.prototype,"isAddress",void 0),D=O([(0,k.E)("wui-preview-item")],D);var z=i(98280),W=i(43957),M=i(4555);let Z=(0,n.AH)` 378 :host { 379 display: flex; 380 column-gap: var(--wui-spacing-s); 381 padding: 17px 18px 17px var(--wui-spacing-m); 382 width: 100%; 383 background-color: var(--wui-color-gray-glass-002); 384 border-radius: var(--wui-border-radius-xs); 385 color: var(--wui-color-fg-250); 386 } 387 388 wui-image { 389 width: var(--wui-icon-size-lg); 390 height: var(--wui-icon-size-lg); 391 border-radius: var(--wui-border-radius-3xl); 392 } 393 394 wui-icon { 395 width: var(--wui-icon-size-lg); 396 height: var(--wui-icon-size-lg); 397 } 398`;var H=function(e,t,i,n){var r,o=arguments.length,s=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(r=e[a])&&(s=(o<3?r(s):o>3?r(t,i,s):r(t,i))||s);return o>3&&s&&Object.defineProperty(t,i,s),s};let V=class extends n.WF{constructor(){super(...arguments),this.imageSrc=void 0,this.textTitle="",this.textValue=void 0}render(){return(0,n.qy)` 399 <wui-flex justifyContent="space-between" alignItems="center"> 400 <wui-text variant="paragraph-500" color=${this.textValue?"fg-200":"fg-100"}> 401 ${this.textTitle} 402 </wui-text> 403 ${this.templateContent()} 404 </wui-flex> 405 `}templateContent(){return this.imageSrc?(0,n.qy)`<wui-image src=${this.imageSrc} alt=${this.textTitle}></wui-image>`:this.textValue?(0,n.qy)` <wui-text variant="paragraph-400" color="fg-100"> ${this.textValue} </wui-text>`:(0,n.qy)`<wui-icon size="inherit" color="fg-200" name="networkPlaceholder"></wui-icon>`}};V.styles=[m.W5,m.fD,Z],H([(0,r.MZ)()],V.prototype,"imageSrc",void 0),H([(0,r.MZ)()],V.prototype,"textTitle",void 0),H([(0,r.MZ)()],V.prototype,"textValue",void 0),V=H([(0,k.E)("wui-list-content")],V);let F=(0,n.AH)` 406 :host { 407 display: flex; 408 width: auto; 409 flex-direction: column; 410 gap: var(--wui-border-radius-1xs); 411 border-radius: var(--wui-border-radius-s); 412 background: var(--wui-color-gray-glass-002); 413 padding: var(--wui-spacing-s) var(--wui-spacing-1xs) var(--wui-spacing-1xs) 414 var(--wui-spacing-1xs); 415 } 416 417 wui-text { 418 padding: 0 var(--wui-spacing-1xs); 419 } 420 421 wui-flex { 422 margin-top: var(--wui-spacing-1xs); 423 } 424 425 .network { 426 cursor: pointer; 427 transition: background-color var(--wui-ease-out-power-1) var(--wui-duration-lg); 428 will-change: background-color; 429 } 430 431 .network:focus-visible { 432 border: 1px solid var(--wui-color-accent-100); 433 background-color: var(--wui-color-gray-glass-005);
434 -webkit-box-shadow: 0px 0px 0px 4px var(--wui-box-shadow-blue); 435 -moz-box-shadow: 0px 0px 0px 4px var(--wui-box-shadow-blue); 436 box-shadow: 0px 0px 0px 4px var(--wui-box-shadow-blue); 437 } 438 439 .network:hover { 440 background-color: var(--wui-color-gray-glass-005); 441 } 442 443 .network:active { 444 background-color: var(--wui-color-gray-glass-010); 445 } 446`;var U=function(e,t,i,n){var r,o=arguments.length,s=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(r=e[a])&&(s=(o<3?r(s):o>3?r(t,i,s):r(t,i))||s);return o>3&&s&&Object.defineProperty(t,i,s),s};let _=class extends n.WF{render(){return(0,n.qy)` <wui-text variant="small-400" color="fg-200">Details</wui-text> 447 <wui-flex flexDirection="column" gap="xxs"> 448 <wui-list-content 449 textTitle="Address" 450 textValue=${u.Zv.getTruncateString({string:this.receiverAddress??"",charsStart:4,charsEnd:4,truncate:"middle"})} 451 > 452 </wui-list-content> 453 ${this.networkTemplate()} 454 </wui-flex>`}networkTemplate(){return this.caipNetwork?.name?(0,n.qy)` <wui-list-content 455 @click=${()=>this.onNetworkClick(this.caipNetwork)} 456 class="network" 457 textTitle="Network" 458 imageSrc=${(0,W.J)(M.$.getNetworkImage(this.caipNetwork))} 459 ></wui-list-content>`:null}onNetworkClick(e){e&&a.I.push("Networks",{network:e})}};_.styles=F,U([(0,r.MZ)()],_.prototype,"receiverAddress",void 0),U([(0,r.MZ)({type:Object})],_.prototype,"caipNetwork",void 0),_=U([(0,u.EM)("w3m-wallet-send-details")],_);let L=(0,n.AH)` 460 wui-avatar, 461 wui-image { 462 display: ruby; 463 width: 32px; 464 height: 32px; 465 border-radius: var(--wui-border-radius-3xl); 466 } 467 468 .sendButton { 469 width: 70%; 470 --local-width: 100% !important; 471 --local-border-radius: var(--wui-border-radius-xs) !important; 472 } 473 474 .cancelButton { 475 width: 30%; 476 --local-width: 100% !important; 477 --local-border-radius: var(--wui-border-radius-xs) !important; 478 } 479`;var K=function(e,t,i,n){var r,o=arguments.length,s=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(r=e[a])&&(s=(o<3?r(s):o>3?r(t,i,s):r(t,i))||s);return o>3&&s&&Object.defineProperty(t,i,s),s};let Y=class extends n.WF{constructor(){super(),this.unsubscribe=[],this.token=o.R.state.token,this.sendTokenAmount=o.R.state.sendTokenAmount,this.receiverAddress=o.R.state.receiverAddress,this.receiverProfileName=o.R.state.receiverProfileName,this.receiverProfileImageUrl=o.R.state.receiverProfileImageUrl,this.caipNetwork=c.W.state.activeCaipNetwork,this.loading=o.R.state.loading,this.unsubscribe.push(o.R.subscribe(e=>{this.token=e.token,this.sendTokenAmount=e.sendTokenAmount,this.receiverAddress=e.receiverAddress,this.receiverProfileName=e.receiverProfileName,this.receiverProfileImageUrl=e.receiverProfileImageUrl,this.loading=e.loading}),c.W.subscribeKey("activeCaipNetwork",e=>this.caipNetwork=e))}disconnectedCallback(){this.unsubscribe.forEach(e=>e())}render(){return(0,n.qy)` <wui-flex flexDirection="column" .padding=${["0","l","l","l"]}> 480 <wui-flex gap="xs" flexDirection="column" .padding=${["0","xs","0","xs"]}> 481 <wui-flex alignItems="center" justifyContent="space-between"> 482 <wui-flex flexDirection="column" gap="4xs"> 483 <wui-text variant="small-400" color="fg-150">Send</wui-text> 484 ${this.sendValueTemplate()} 485 </wui-flex> 486 <wui-preview-item 487 text="${this.sendTokenAmount?u.Zv.roundNumber(this.sendTokenAmount,6,5):"unknown"} ${this.token?.symbol}" 488 .imageSrc=${this.token?.iconUrl} 489 ></wui-preview-item> 490 </wui-flex> 491 <wui-flex> 492 <wui-icon color="fg-200" size="md" name="arrowBottom"></wui-icon> 493 </wui-flex> 494 <wui-flex alignItems="center" justifyContent="space-between"> 495 <wui-text variant="small-400" color="fg-150">To</wui-text> 496 <wui-preview-item 497 text="${this.receiverProfileName?u.Zv.getTruncateString({string:this.receiverProfileName,charsStart:20,charsEnd:0,truncate:"end"}):u.Zv.getTruncateString({string:this.receiverAddress?this.receiverAddress:"",charsStart:4,charsEnd:4,truncate:"middle"})}" 498 address=${this.receiverAddress??""} 499 .imageSrc=${this.receiverProfileImageUrl??void 0} 500 .isAddress=${!0} 501 ></wui-preview-item> 502 </wui-flex> 503 </wui-flex> 504 <wui-flex flexDirection="column" .padding=${["xxl","0","0","0"]}> 505 <w3m-wallet-send-details 506 .caipNetwork=${this.caipNetwork} 507 .receiverAddress=${this.receiverAddress} 508 ></w3m-wallet-send-details> 509 <wui-flex justifyContent="center" gap="xxs" .padding=${["s","0","0","0"]}> 510 <wui-icon size="sm" color="fg-200" name="warningCircle"></wui-icon> 511 <wui-text variant="small-400" color="fg-200">Review transaction carefully</wui-text> 512 </wui-flex> 513 <wui-flex justifyContent="center" gap="s" .padding=${["l","0","0","0"]}> 514 <wui-button 515 class="cancelButton" 516 @click=${this.onCancelClick.bind(this)} 517 size="lg" 518 variant="neutral" 519 > 520 Cancel 521 </wui-button>
521 522 <wui-button 523 class="sendButton" 524 @click=${this.onSendClick.bind(this)} 525 size="lg" 526 variant="main" 527 .loading=${this.loading} 528 > 529 Send 530 </wui-button> 531 </wui-flex> 532 </wui-flex></wui-flex 533 >`}sendValueTemplate(){if(this.token&&this.sendTokenAmount){let e=this.token.price*this.sendTokenAmount;return(0,n.qy)`<wui-text variant="paragraph-400" color="fg-100" 534 >$${e.toFixed(2)}</wui-text 535 >`}return null}async onSendClick(){if(!this.sendTokenAmount||!this.receiverAddress)return void I.P.showError("Please enter a valid amount and receiver address");try{await o.R.sendToken(),I.P.showSuccess("Transaction started"),a.I.replace("Account")}catch(t){I.P.showError("Failed to send transaction. Please try again."),console.error("SendController:sendToken - failed to send transaction",t);let e=t instanceof Error?t.message:"Unknown error";B.E.sendEvent({type:"track",event:"SEND_ERROR",properties:{message:e,isSmartAccount:(0,j.lj)(c.W.state.activeChain)===z.Vl.ACCOUNT_TYPES.SMART_ACCOUNT,token:this.token?.symbol||"",amount:this.sendTokenAmount,network:c.W.state.activeCaipNetwork?.caipNetworkId||""}})}}onCancelClick(){a.I.goBack()}};Y.styles=L,K([(0,r.wk)()],Y.prototype,"token",void 0),K([(0,r.wk)()],Y.prototype,"sendTokenAmount",void 0),K([(0,r.wk)()],Y.prototype,"receiverAddress",void 0),K([(0,r.wk)()],Y.prototype,"receiverProfileName",void 0),K([(0,r.wk)()],Y.prototype,"receiverProfileImageUrl",void 0),K([(0,r.wk)()],Y.prototype,"caipNetwork",void 0),K([(0,r.wk)()],Y.prototype,"loading",void 0),Y=K([(0,u.EM)("w3m-wallet-send-preview-view")],Y)}}]);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.