1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[4762],{24762:(e,t,i)=>{i.r(t),i.d(t,{W3mSendConfirmedView:()=>Q,W3mSendSelectTokenView:()=>N,W3mWalletSendPreviewView:()=>Y,W3mWalletSendView:()=>E});var n=i(56059),r=i(81767),o=i(12050),a=i(18577),s=i(26274),l=i(82376),c=i(30615),u=i(53984),d=i(36071),h=i(33432),p=i(82875),f=i(81920),m=i(28877),g=i(71016),w=i(2076);i(56060),i(6647),i(23833),i(44141);var y=i(99736);i(48029),i(66803);let v=(0,w.AH)` 2 :host { 3 width: 100%; 4 height: 100px; 5 border-radius: ${({borderRadius:e})=>e["5"]}; 6 border: 1px solid ${({tokens:e})=>e.theme.foregroundPrimary}; 7 background-color: ${({tokens:e})=>e.theme.foregroundPrimary}; 8 transition: background-color ${({durations:e})=>e.lg} 9 ${({easings:e})=>e["ease-out-power-1"]}; 10 will-change: background-color; 11 position: relative; 12 } 13 14 :host(:hover) { 15 background-color: ${({tokens:e})=>e.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:e})=>e.theme.textPrimary}; 26 margin: 0 ${({spacing:e})=>e["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:e})=>e.regular}; 44 font-style: normal; 45 font-size: ${({textSize:e})=>e.large}; 46 font-weight: ${({fontWeight:e})=>e.regular}; 47 line-height: ${({typography:e})=>e["lg-regular"].lineHeight}; 48 letter-spacing: ${({typography:e})=>e["lg-regular"].letterSpacing}; 49 color: ${({tokens:e})=>e.theme.textPrimary}; 50 caret-color: ${({tokens:e})=>e.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 x=function(e,t,i,n){var r,o=arguments.length,a=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,i,n);else for(var s=e.length-1;s>=0;s--)(r=e[s])&&(a=(o<3?r(a):o>3?r(t,i,a):r(t,i))||a);return o>3&&a&&Object.defineProperty(t,i,a),a};let b=class extends n.WF{constructor(){super(...arguments),this.inputElementRef=(0,y._)(),this.instructionElementRef=(0,y._)(),this.readOnly=!1,this.instructionHidden=!!this.value,this.pasting=!1,this.onDebouncedSearch=h.w.debounce(async e=>{if(!e.length)return void this.setReceiverAddress("");let t=l.W.state.activeChain;if(h.w.isAddress(e,t))return void this.setReceiverAddress(e);try{let t=await d.x.getEnsAddress(e);if(t){a.R.setReceiverProfileName(e),a.R.setReceiverAddress(t);let i=await d.x.getEnsAvatar(e);a.R.setReceiverProfileImageUrl(i||void 0)}}catch(t){this.setReceiverAddress(e)}finally{a.R.setLoading(!1)}})}firstUpdated(){this.value&&(this.instructionHidden=!0),this.checkHidden()}render(){return this.readOnly?(0,n.qy)` <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 ></textarea> 73 </wui-flex>`:(0,n.qy)` <wui-flex 74 @click=${this.onBoxClick.bind(this)} 75 flexDirection="column" 76 justifyContent="center" 77 gap="01" 78 .padding=${["8","4","5","4"]} 79 > 80 <wui-text 81 ${(0,y.K)(this.instructionElementRef)} 82 class="instruction" 83 color="secondary" 84 variant="md-medium" 85 > 86 Type or 87 <wui-button 88 class="paste" 89 size="md" 90 variant="neutral-secondary" 91 iconLeft="copy" 92 @click=${this.onPasteClick.bind(this)} 93 > 94 <wui-icon size="sm" color="inherit" slot="iconLeft" name="copy"></wui-icon> 95 Paste 96 </wui-button> 97 address 98 </wui-text> 99 <textarea 100 spellcheck="false" 101 ?disabled=${!this.instructionHidden} 102 ${(0,y.K)(this.inputElementRef)}
103 @input=${this.onInputChange.bind(this)} 104 @blur=${this.onBlur.bind(this)} 105 .value=${this.value??""} 106 autocomplete="off" 107 ></textarea> 108 </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();a.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(),a.R.setLoading(!0),this.onDebouncedSearch(t.value)}setReceiverAddress(e){a.R.setReceiverAddress(e),a.R.setReceiverProfileName(void 0),a.R.setReceiverProfileImageUrl(void 0),a.R.setLoading(!1)}};b.styles=v,x([(0,r.MZ)()],b.prototype,"value",void 0),x([(0,r.MZ)({type:Boolean})],b.prototype,"readOnly",void 0),x([(0,r.wk)()],b.prototype,"instructionHidden",void 0),x([(0,r.wk)()],b.prototype,"pasting",void 0),b=x([(0,w.EM)("w3m-input-address")],b),i(70007),i(9266),i(99643);let k=(0,w.AH)` 109 :host { 110 width: 100%; 111 height: 100px; 112 border-radius: ${({borderRadius:e})=>e["5"]}; 113 border: 1px solid ${({tokens:e})=>e.theme.foregroundPrimary}; 114 background-color: ${({tokens:e})=>e.theme.foregroundPrimary}; 115 transition: background-color ${({durations:e})=>e.lg} 116 ${({easings:e})=>e["ease-out-power-1"]}; 117 will-change: background-color; 118 transition: all ${({easings:e})=>e["ease-out-power-1"]} 119 ${({durations:e})=>e.lg}; 120 } 121 122 :host(:hover) { 123 background-color: ${({tokens:e})=>e.theme.foregroundSecondary}; 124 } 125 126 wui-flex { 127 width: 100%; 128 height: fit-content; 129 } 130 131 wui-button { 132 width: 100%; 133 display: flex; 134 justify-content: flex-end; 135 } 136 137 wui-input-amount { 138 mask-image: linear-gradient( 139 270deg, 140 transparent 0px, 141 transparent 8px, 142 black 24px, 143 black 25px, 144 black 32px, 145 black 100% 146 ); 147 } 148 149 .totalValue { 150 width: 100%; 151 } 152`;var $=function(e,t,i,n){var r,o=arguments.length,a=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,i,n);else for(var s=e.length-1;s>=0;s--)(r=e[s])&&(a=(o<3?r(a):o>3?r(t,i,a):r(t,i))||a);return o>3&&a&&Object.defineProperty(t,i,a),a};let R=class extends n.WF{constructor(){super(...arguments),this.readOnly=!1,this.isInsufficientBalance=!1}render(){let e=this.readOnly||!this.token;return(0,n.qy)` <wui-flex 153 flexDirection="column" 154 gap="01" 155 .padding=${["5","3","4","3"]} 156 > 157 <wui-flex alignItems="center"> 158 <wui-input-amount 159 @inputChange=${this.onInputChange.bind(this)} 160 ?disabled=${e} 161 .value=${this.sendTokenAmount??""} 162 ?error=${!!this.isInsufficientBalance} 163 ></wui-input-amount> 164 ${this.buttonTemplate()} 165 </wui-flex> 166 ${this.bottomTemplate()} 167 </wui-flex>`}buttonTemplate(){return this.token?(0,n.qy)`<wui-token-button 168 text=${this.token.symbol} 169 imageSrc=${this.token.iconUrl} 170 @click=${this.handleSelectButtonClick.bind(this)} 171 > 172 </wui-token-button>`:(0,n.qy)`<wui-button 173 size="md" 174 variant="neutral-secondary" 175 @click=${this.handleSelectButtonClick.bind(this)} 176 >Select token</wui-button 177 >`}handleSelectButtonClick(){this.readOnly||s.I.push("WalletSendSelectToken")}sendValueTemplate(){if(!this.readOnly&&this.token&&this.sendTokenAmount){let e=this.token.price*Number(this.sendTokenAmount);return(0,n.qy)`<wui-text class="totalValue" variant="sm-regular" color="secondary" 178 >${e?`$${o.S.formatNumberToLocalString(e,2)}`:"Incorrect value"}</wui-text 179 >`}return null}maxAmountTemplate(){return this.token?(0,n.qy)` <wui-text variant="sm-regular" color="secondary"> 180 ${w.Zv.roundNumber(Number(this.token.quantity.numeric),6,5)} 181 </wui-text>`:null}actionTemplate(){return this.token?(0,n.qy)`<wui-link @click=${this.onMaxClick.bind(this)}>Max</wui-link>`:null}bottomTemplate(){return this.readOnly?null:(0,n.qy)`<wui-flex alignItems="center" justifyContent="space-between"> 182 ${this.sendValueTemplate()} 183 <wui-flex alignItems="center" gap="01" justifyContent="flex-end"> 184 ${this.maxAmountTemplate()} ${this.actionTemplate()} 185 </wui-flex> 186 </wui-flex>`}onInputChange(e){a.R.setTokenAmount(String(e.detail))}onMaxClick(){if(this.token){let e=Number(this.token.quantity.decimals),t=o.S.bigNumber(this.token.quantity.numeric);if(!this.token.address&&this.gasPrice){let i=65000n*BigInt(this.gasPrice),n=o.S.bigNumber(i.toString()).div(o.S.bigNumber(10).pow(e)),r=t.minus(n);a.R.setTokenAmount(r.gt(0)?r.toFixed(e,0):"0")}else a.R.setTokenAmount(t.toFixed(e,0))}}};R.styles=k,$([(0,r.MZ)({type:Object})],R.prototype,"token",void 0),$([(0,r.MZ)({type:Boolean})],R.prototype,"readOnly",void 0),$([(0,r.MZ)({type:String})],R.prototype,"sendTokenAmount",void 0),$([(0,r.MZ)({type:Boolean})],R.prototype,"isInsufficientBalance",void 0),$([(0,r.MZ)({type:String})],R.prototype,"gasPrice",void 0),R=$([(0,w.EM)("w3m-input-token")],R);let S=(0,w.AH)` 187 :host { 188 display: block; 189 } 190 191 wui-flex { 192 position: relative; 193 } 194 195 wui-icon-box { 196 width: 32px; 197 height: 32px; 198 border-radius: ${({borderRadius:e})=>e["10"]} !important; 199 border: 4px solid ${({tokens:e})=>e.theme.backgroundPrimary}; 200 background: ${({tokens:e})=>e.theme.foregroundPrimary}; 201 position: absolute; 202 top: 50%; 203 left: 50%; 204 transform: translate(-50%, -50%); 205 z-index: 3; 206 } 207 208 wui-button { 209 --local-border-radius: ${({borderRadius:e})=>e["4"]} !important; 210 } 211 212 .inputContainer { 213 height: fit-content; 214 } 215`;var A=function(e,t,i,n){var r,o=arguments.length,a=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,i,n);else for(var s=e.length-1;s>=0;s--)(r=e[s])&&(a=(o<3?r(a):o>3?r(t,i,a):r(t,i))||a);return o>3&&a&&Object.defineProperty(t,i,a),a};let T={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"},E=class extends n.WF{constructor(){super(),this.unsubscribe=[],this.isTryingToChooseDifferentWallet=!1,this.token=a.R.state.token,this.sendTokenAmount=a.R.state.sendTokenAmount,this.receiverAddress=a.R.state.receiverAddress,this.receiverProfileName=a.R.state.receiverProfileName,this.loading=a.R.state.loading,this.params=s.I.state.data?.send,this.caipAddress=l.W.getAccountData()?.caipAddress,this.disconnecting=!1,this.gasFee=c.GN.state.gasFee,this.token&&!this.params&&(this.fetchBalances(),this.fetchNetworkPrice());let e=l.W.subscribeKey("activeCaipAddress",t=>{!t&&this.isTryingToChooseDifferentWallet&&(this.isTryingToChooseDifferentWallet=!1,u.W.open({view:"Connect",data:{redirectView:"WalletSend"}}).catch(()=>null),e())});this.unsubscribe.push(l.W.subscribeAccountStateProp("caipAddress",e=>{this.caipAddress=e}),a.R.subscribe(e=>{this.token=e.token,this.sendTokenAmount=e.sendTokenAmount,this.receiverAddress=e.receiverAddress,this.receiverProfileName=e.receiverProfileName,this.loading=e.loading}),c.GN.subscribeKey("gasFee",e=>{this.gasFee=e}))}
215disconnectedCallback(){this.unsubscribe.forEach(e=>e())}async firstUpdated(){await this.handleSendParameters()}render(){let e=this.getMessage(),t=!!this.params;return(0,n.qy)` <wui-flex flexDirection="column" .padding=${["0","4","4","4"]}> 216 <wui-flex class="inputContainer" gap="2" flexDirection="column"> 217 <w3m-input-token 218 .token=${this.token} 219 .sendTokenAmount=${this.sendTokenAmount} 220 .gasPrice=${this.gasFee} 221 ?readOnly=${t} 222 ?isInsufficientBalance=${e===T.INSUFFICIENT_FUNDS} 223 ></w3m-input-token> 224 <wui-icon-box size="md" variant="secondary" icon="arrowBottom"></wui-icon-box> 225 <w3m-input-address 226 ?readOnly=${t} 227 .value=${this.receiverProfileName?this.receiverProfileName:this.receiverAddress} 228 ></w3m-input-address> 229 </wui-flex> 230 ${this.buttonTemplate(e)} 231 </wui-flex>`}async fetchBalances(){await a.R.fetchTokenBalance(),a.R.fetchNetworkBalance()}async fetchNetworkPrice(){await c.GN.getNetworkTokenPrice(),await c.GN.getInitialGasPrice()}onButtonClick(){s.I.push("WalletSendPreview",{send:this.params})}onFundWalletClick(){s.I.push("FundWallet",{redirectView:"WalletSend"})}async onConnectDifferentWalletClick(){try{this.isTryingToChooseDifferentWallet=!0,this.disconnecting=!0,await d.x.disconnect()}finally{this.disconnecting=!1}}getMessage(){return this.token?this.sendTokenAmount?this.token.price&&!(Number(this.sendTokenAmount)*this.token.price)?T.INCORRECT_VALUE:o.S.bigNumber(this.sendTokenAmount).gt(this.token.quantity.numeric)?T.INSUFFICIENT_FUNDS:this.receiverAddress?h.w.isAddress(this.receiverAddress,l.W.state.activeChain)?T.PREVIEW_SEND:T.INVALID_ADDRESS:T.ADD_ADDRESS:T.ADD_AMOUNT:T.SELECT_TOKEN}buttonTemplate(e){let t=!e.startsWith(T.PREVIEW_SEND),i=e===T.INSUFFICIENT_FUNDS,r=!!this.params;return i&&!r?(0,n.qy)` 232 <wui-flex .margin=${["4","0","0","0"]} flexDirection="column" gap="4"> 233 <wui-button 234 @click=${this.onFundWalletClick.bind(this)} 235 size="lg" 236 variant="accent-secondary" 237 fullWidth 238 > 239 Fund Wallet 240 </wui-button> 241 242 <wui-separator data-testid="wui-separator" text="or"></wui-separator> 243 244 <wui-button 245 @click=${this.onConnectDifferentWalletClick.bind(this)} 246 size="lg" 247 variant="neutral-secondary" 248 fullWidth 249 ?loading=${this.disconnecting} 250 > 251 Connect a different wallet 252 </wui-button> 253 </wui-flex> 254 `:(0,n.qy)`<wui-flex .margin=${["4","0","0","0"]}> 255 <wui-button 256 @click=${this.onButtonClick.bind(this)} 257 ?disabled=${t} 258 size="lg" 259 variant="accent-primary" 260 ?loading=${this.loading} 261 fullWidth 262 > 263 ${e} 264 </wui-button> 265 </wui-flex>`}async handleSendParameters(){if(this.loading=!0,!this.params){this.loading=!1;return}let e=Number(this.params.amount);if(isNaN(e)){p.P.showError("Invalid amount"),this.loading=!1;return}let{namespace:t,chainId:i,assetAddress:n}=this.params;if(!f.oU.SEND_PARAMS_SUPPORTED_CHAINS.includes(t)){p.P.showError(`Chain "${t}" is not supported for send parameters`),this.loading=!1;return}let r=l.W.getCaipNetworkById(i,t);if(!r){p.P.showError(`Network with id "${i}" not found`),this.loading=!1;return}try{let{balance:t,name:i,symbol:o,decimals:s}=await g.Z.fetchERC20Balance({caipAddress:this.caipAddress,assetAddress:n,caipNetwork:r});if(!i||!o||!s||!t)return void p.P.showError("Token not found");a.R.setToken({name:i,symbol:o,chainId:r.id.toString(),address:`${r.chainNamespace}:${r.id}:${n}`,value:0,price:0,quantity:{decimals:s.toString(),numeric:t.toString()},iconUrl:m.$.getTokenImage(o)??""}),a.R.setTokenAmount(String(e)),a.R.setReceiverAddress(this.params.to)}catch(e){console.error("Failed to load token information:",e),p.P.showError("Failed to load token information")}finally{this.loading=!1}}};E.styles=S,A([(0,r.wk)()],E.prototype,"token",void 0),A([(0,r.wk)()],E.prototype,"sendTokenAmount",void 0),A([(0,r.wk)()],E.prototype,"receiverAddress",void 0),A([(0,r.wk)()],E.prototype,"receiverProfileName",void 0),A([(0,r.wk)()],E.prototype,"loading",void 0),A([(0,r.wk)()],E.prototype,"params",void 0),A([(0,r.wk)()],E.prototype,"caipAddress",void 0),A([(0,r.wk)()],E.prototype,"disconnecting",void 0),A([(0,r.wk)()],E.prototype,"gasFee",void 0),E=A([(0,w.EM)("w3m-wallet-send-view")],E),i(77652),i(20398);let P=(0,w.AH)` 266 .contentContainer { 267 height: 440px; 268 overflow: scroll; 269 scrollbar-width: none; 270 } 271 272 .contentContainer::-webkit-scrollbar {
273 display: none; 274 } 275 276 wui-icon-box { 277 width: 40px; 278 height: 40px; 279 border-radius: ${({borderRadius:e})=>e["3"]}; 280 } 281`;var C=function(e,t,i,n){var r,o=arguments.length,a=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,i,n);else for(var s=e.length-1;s>=0;s--)(r=e[s])&&(a=(o<3?r(a):o>3?r(t,i,a):r(t,i))||a);return o>3&&a&&Object.defineProperty(t,i,a),a};let N=class extends n.WF{constructor(){super(),this.unsubscribe=[],this.tokenBalances=a.R.state.tokenBalances,this.search="",this.onDebouncedSearch=h.w.debounce(e=>{this.search=e}),this.fetchBalancesAndNetworkPrice(),this.unsubscribe.push(a.R.subscribe(e=>{this.tokenBalances=e.tokenBalances}))}disconnectedCallback(){this.unsubscribe.forEach(e=>e())}render(){return(0,n.qy)` 282 <wui-flex flexDirection="column"> 283 ${this.templateSearchInput()} <wui-separator></wui-separator> ${this.templateTokens()} 284 </wui-flex> 285 `}async fetchBalancesAndNetworkPrice(){this.tokenBalances&&this.tokenBalances?.length!==0||(await this.fetchBalances(),await this.fetchNetworkPrice())}async fetchBalances(){await a.R.fetchTokenBalance(),a.R.fetchNetworkBalance()}async fetchNetworkPrice(){await c.GN.getNetworkTokenPrice()}templateSearchInput(){return(0,n.qy)` 286 <wui-flex gap="2" padding="3"> 287 <wui-input-text 288 @inputChange=${this.onInputChange.bind(this)} 289 class="network-search-input" 290 size="sm" 291 placeholder="Search token" 292 icon="search" 293 ></wui-input-text> 294 </wui-flex> 295 `}templateTokens(){return this.tokens=this.tokenBalances?.filter(e=>e.chainId===l.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)` 296 <wui-flex 297 class="contentContainer" 298 flexDirection="column" 299 .padding=${["0","3","0","3"]} 300 > 301 <wui-flex justifyContent="flex-start" .padding=${["4","3","3","3"]}> 302 <wui-text variant="md-medium" color="secondary">Your tokens</wui-text> 303 </wui-flex> 304 <wui-flex flexDirection="column" gap="2"> 305 ${this.filteredTokens&&this.filteredTokens.length>0?this.filteredTokens.map(e=>(0,n.qy)`<wui-list-token 306 @click=${this.handleTokenClick.bind(this,e)} 307 ?clickable=${!0} 308 tokenName=${e.name} 309 tokenImageUrl=${e.iconUrl} 310 tokenAmount=${e.quantity.numeric} 311 tokenValue=${e.value} 312 tokenCurrency=${e.symbol} 313 ></wui-list-token>`):(0,n.qy)`<wui-flex 314 .padding=${["20","0","0","0"]} 315 alignItems="center" 316 flexDirection="column" 317 gap="4" 318 > 319 <wui-icon-box icon="coinPlaceholder" color="default" size="lg"></wui-icon-box> 320 <wui-flex 321 class="textContent" 322 gap="2" 323 flexDirection="column" 324 justifyContent="center" 325 flexDirection="column" 326 > 327 <wui-text variant="lg-medium" align="center" color="primary"> 328 No tokens found 329 </wui-text> 330 <wui-text variant="lg-regular" align="center" color="secondary"> 331 Your tokens will appear here 332 </wui-text> 333 </wui-flex> 334 <wui-link @click=${this.onBuyClick.bind(this)}>Buy</wui-link> 335 </wui-flex>`} 336 </wui-flex> 337 </wui-flex> 338 `}onBuyClick(){s.I.push("OnRampProviders")}onInputChange(e){this.onDebouncedSearch(e.detail)}handleTokenClick(e){a.R.setToken(e),a.R.setTokenAmount(void 0),s.I.goBack()}};N.styles=P,C([(0,r.wk)()],N.prototype,"tokenBalances",void 0),C([(0,r.wk)()],N.prototype,"tokens",void 0),C([(0,r.wk)()],N.prototype,"filteredTokens",void 0),C([(0,r.wk)()],N.prototype,"search",void 0),N=C([(0,w.EM)("w3m-wallet-send-select-token-view")],N);var I=i(43850),D=i(17052),O=i(42242);i(79909),i(39909),i(83627),i(6077);var z=i(46756),W=i(63412);i(35305);var B=i(91392);let j=(0,B.AH)` 339 :host { 340 height: 32px; 341 display: flex; 342 align-items: center; 343 gap: ${({spacing:e})=>e[1]}; 344 border-radius: ${({borderRadius:e})=>e[32]}; 345 background-color: ${({tokens:e})=>e.theme.foregroundPrimary}; 346 padding: ${({spacing:e})=>e[1]}; 347 padding-left: ${({spacing:e})=>e[2]}; 348 } 349 350 wui-avatar, 351 wui-image { 352 width: 24px; 353 height: 24px; 354 border-radius: ${({borderRadius:e})=>e[16]}; 355 } 356 357 wui-icon { 358 border-radius: ${({borderRadius:e})=>e[16]}; 359 } 360`;var M=function(e,t,i,n){var r,o=arguments.length,a=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,i,n);else for(var s=e.length-1;s>=0;s--)(r=e[s])&&(a=(o<3?r(a):o>3?r(t,i,a):r(t,i))||a);return o>3&&a&&Object.defineProperty(t,i,a),a};let q=class extends n.WF{constructor(){super(...arguments),this.text=""}render(){return(0,n.qy)`<wui-text variant="lg-regular" color="primary">${this.text}</wui-text> 361 ${this.imageTemplate()}`}imageTemplate(){return this.address?(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="lg" color="inverse" name="networkPlaceholder"></wui-icon>`}};q.styles=[z.W5,z.fD,j],M([(0,r.MZ)({type:String})],q.prototype,"text",void 0),M([(0,r.MZ)({type:String})],q.prototype,"address",void 0),M([(0,r.MZ)({type:String})],q.prototype,"imageSrc",void 0),q=M([(0,W.E)("wui-preview-item")],q);var F=i(55284);let _=(0,B.AH)` 362 :host { 363 display: flex; 364 padding: ${({spacing:e})=>e[4]} ${({spacing:e})=>e[3]}; 365 width: 100%; 366 background-color: ${({tokens:e})=>e.theme.foregroundPrimary}; 367 border-radius: ${({borderRadius:e})=>e[4]}; 368 } 369 370 wui-image {
371 width: 20px; 372 height: 20px; 373 border-radius: ${({borderRadius:e})=>e[16]}; 374 } 375 376 wui-icon { 377 width: 20px; 378 height: 20px; 379 } 380`;var Z=function(e,t,i,n){var r,o=arguments.length,a=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,i,n);else for(var s=e.length-1;s>=0;s--)(r=e[s])&&(a=(o<3?r(a):o>3?r(t,i,a):r(t,i))||a);return o>3&&a&&Object.defineProperty(t,i,a),a};let V=class extends n.WF{constructor(){super(...arguments),this.imageSrc=void 0,this.textTitle="",this.textValue=void 0}render(){return(0,n.qy)` 381 <wui-flex justifyContent="space-between" alignItems="center"> 382 <wui-text variant="lg-regular" color="primary"> ${this.textTitle} </wui-text> 383 ${this.templateContent()} 384 </wui-flex> 385 `}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="md-regular" color="secondary"> ${this.textValue} </wui-text>`:(0,n.qy)`<wui-icon size="inherit" color="default" name="networkPlaceholder"></wui-icon>`}};V.styles=[z.W5,z.fD,_],Z([(0,r.MZ)()],V.prototype,"imageSrc",void 0),Z([(0,r.MZ)()],V.prototype,"textTitle",void 0),Z([(0,r.MZ)()],V.prototype,"textValue",void 0),V=Z([(0,W.E)("wui-list-content")],V);let U=(0,w.AH)` 386 :host { 387 display: flex; 388 width: auto; 389 flex-direction: column; 390 gap: ${({spacing:e})=>e["1"]}; 391 border-radius: ${({borderRadius:e})=>e["5"]}; 392 background: ${({tokens:e})=>e.theme.foregroundPrimary}; 393 padding: ${({spacing:e})=>e["3"]} ${({spacing:e})=>e["2"]} 394 ${({spacing:e})=>e["2"]} ${({spacing:e})=>e["2"]}; 395 } 396 397 wui-list-content { 398 width: -webkit-fill-available !important; 399 } 400 401 wui-text { 402 padding: 0 ${({spacing:e})=>e["2"]}; 403 } 404 405 wui-flex { 406 margin-top: ${({spacing:e})=>e["2"]}; 407 } 408 409 .network { 410 cursor: pointer; 411 transition: background-color ${({durations:e})=>e.lg} 412 ${({easings:e})=>e["ease-out-power-1"]}; 413 will-change: background-color; 414 } 415 416 .network:focus-visible { 417 border: 1px solid ${({tokens:e})=>e.core.textAccentPrimary}; 418 background-color: ${({tokens:e})=>e.core.glass010}; 419 -webkit-box-shadow: 0px 0px 0px 4px ${({tokens:e})=>e.core.foregroundAccent010}; 420 -moz-box-shadow: 0px 0px 0px 4px ${({tokens:e})=>e.core.foregroundAccent010}; 421 box-shadow: 0px 0px 0px 4px ${({tokens:e})=>e.core.foregroundAccent010}; 422 } 423 424 .network:hover { 425 background-color: ${({tokens:e})=>e.core.glass010}; 426 } 427 428 .network:active { 429 background-color: ${({tokens:e})=>e.core.glass010}; 430 } 431`;var H=function(e,t,i,n){var r,o=arguments.length,a=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,i,n);else for(var s=e.length-1;s>=0;s--)(r=e[s])&&(a=(o<3?r(a):o>3?r(t,i,a):r(t,i))||a);return o>3&&a&&Object.defineProperty(t,i,a),a};let L=class extends n.WF{constructor(){super(...arguments),this.params=s.I.state.data?.send}render(){return(0,n.qy)` <wui-text variant="sm-regular" color="secondary">Details</wui-text> 432 <wui-flex flexDirection="column" gap="1"> 433 <wui-list-content 434 textTitle="Address" 435 textValue=${w.Zv.getTruncateString({string:this.receiverAddress??"",charsStart:4,charsEnd:4,truncate:"middle"})} 436 > 437 </wui-list-content> 438 ${this.networkTemplate()} 439 </wui-flex>`}networkTemplate(){return this.caipNetwork?.name?(0,n.qy)` <wui-list-content 440 @click=${()=>this.onNetworkClick(this.caipNetwork)} 441 class="network" 442 textTitle="Network" 443 imageSrc=${(0,F.J)(m.$.getNetworkImage(this.caipNetwork))} 444 ></wui-list-content>`:null}onNetworkClick(e){e&&!this.params&&s.I.push("Networks",{network:e})}};L.styles=U,H([(0,r.MZ)()],L.prototype,"receiverAddress",void 0),H([(0,r.MZ)({type:Object})],L.prototype,"caipNetwork",void 0),H([(0,r.wk)()],L.prototype,"params",void 0),L=H([(0,w.EM)("w3m-wallet-send-details")],L);let K=(0,w.AH)` 445 wui-avatar, 446 wui-image { 447 display: ruby; 448 width: 32px; 449 height: 32px; 450 border-radius: ${({borderRadius:e})=>e["20"]}; 451 } 452 453 .sendButton { 454 width: 70%; 455 --local-width: 100% !important; 456 --local-border-radius: ${({borderRadius:e})=>e["4"]} !important; 457 } 458 459 .cancelButton { 460 width: 30%; 461 --local-width: 100% !important; 462 --local-border-radius: ${({borderRadius:e})=>e["4"]} !important; 463 } 464`;var G=function(e,t,i,n){var r,o=arguments.length,a=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,i,n);else for(var s=e.length-1;s>=0;s--)(r=e[s])&&(a=(o<3?r(a):o>3?r(t,i,a):r(t,i))||a);return o>3&&a&&Object.defineProperty(t,i,a),a};let Y=class extends n.WF{constructor(){super(),this.unsubscribe=[],this.token=a.R.state.token,this.sendTokenAmount=a.R.state.sendTokenAmount,this.receiverAddress=a.R.state.receiverAddress,this.receiverProfileName=a.R.state.receiverProfileName,this.receiverProfileImageUrl=a.R.state.receiverProfileImageUrl,this.caipNetwork=l.W.state.activeCaipNetwork,this.loading=a.R.state.loading,this.params=s.I.state.data?.send,this.unsubscribe.push(a.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}),l.W.subscribeKey("activeCaipNetwork",e=>this.caipNetwork=e))}
464disconnectedCallback(){this.unsubscribe.forEach(e=>e())}render(){return(0,n.qy)` <wui-flex flexDirection="column" .padding=${["0","4","4","4"]}> 465 <wui-flex gap="2" flexDirection="column" .padding=${["0","2","0","2"]}> 466 <wui-flex alignItems="center" justifyContent="space-between"> 467 <wui-flex flexDirection="column" gap="01"> 468 <wui-text variant="sm-regular" color="secondary">Send</wui-text> 469 ${this.sendValueTemplate()} 470 </wui-flex> 471 <wui-preview-item 472 text="${this.sendTokenAmount?w.Zv.roundNumber(Number(this.sendTokenAmount),6,5):"unknown"} ${this.token?.symbol}" 473 .imageSrc=${this.token?.iconUrl} 474 ></wui-preview-item> 475 </wui-flex> 476 <wui-flex> 477 <wui-icon color="default" size="md" name="arrowBottom"></wui-icon> 478 </wui-flex> 479 <wui-flex alignItems="center" justifyContent="space-between"> 480 <wui-text variant="sm-regular" color="secondary">To</wui-text> 481 <wui-preview-item 482 text="${this.receiverProfileName?w.Zv.getTruncateString({string:this.receiverProfileName,charsStart:20,charsEnd:0,truncate:"end"}):w.Zv.getTruncateString({string:this.receiverAddress?this.receiverAddress:"",charsStart:4,charsEnd:4,truncate:"middle"})}" 483 address=${this.receiverAddress??""} 484 .imageSrc=${this.receiverProfileImageUrl??void 0} 485 .isAddress=${!0} 486 ></wui-preview-item> 487 </wui-flex> 488 </wui-flex> 489 <wui-flex flexDirection="column" .padding=${["6","0","0","0"]}> 490 <w3m-wallet-send-details 491 .caipNetwork=${this.caipNetwork} 492 .receiverAddress=${this.receiverAddress} 493 ></w3m-wallet-send-details> 494 <wui-flex justifyContent="center" gap="1" .padding=${["3","0","0","0"]}> 495 <wui-icon size="sm" color="default" name="warningCircle"></wui-icon> 496 <wui-text variant="sm-regular" color="secondary">Review transaction carefully</wui-text> 497 </wui-flex> 498 <wui-flex justifyContent="center" gap="3" .padding=${["4","0","0","0"]}> 499 <wui-button 500 class="cancelButton" 501 @click=${this.onCancelClick.bind(this)} 502 size="lg" 503 variant="neutral-secondary" 504 > 505 Cancel 506 </wui-button> 507 <wui-button 508 class="sendButton" 509 @click=${this.onSendClick.bind(this)} 510 size="lg" 511 variant="accent-primary" 512 .loading=${this.loading} 513 > 514 Send 515 </wui-button> 516 </wui-flex> 517 </wui-flex></wui-flex 518 >`}sendValueTemplate(){if(!this.params&&this.token&&this.sendTokenAmount){let e=this.token.price*Number(this.sendTokenAmount);return(0,n.qy)`<wui-text variant="md-regular" color="primary" 519 >$${e.toFixed(2)}</wui-text 520 >`}return null}async onSendClick(){if(!this.sendTokenAmount||!this.receiverAddress)return void p.P.showError("Please enter a valid amount and receiver address");try{await a.R.sendToken(),this.params?s.I.reset("WalletSendConfirmed"):(p.P.showSuccess("Transaction started"),s.I.replace("Account"))}catch(n){let e="Failed to send transaction",t=n instanceof D.A&&n.originalName===I.RQ.PROVIDER_RPC_ERROR_NAME.USER_REJECTED_REQUEST,i=n instanceof D.A&&n.originalName===I.RQ.PROVIDER_RPC_ERROR_NAME.SEND_TRANSACTION_ERROR;(t||i)&&(e=n.message),O.E.sendEvent({type:"track",event:t?"SEND_REJECTED":"SEND_ERROR",properties:a.R.getSdkEventProperties(n)}),p.P.showError(e)}}onCancelClick(){s.I.goBack()}};Y.styles=K,G([(0,r.wk)()],Y.prototype,"token",void 0),G([(0,r.wk)()],Y.prototype,"sendTokenAmount",void 0),G([(0,r.wk)()],Y.prototype,"receiverAddress",void 0),G([(0,r.wk)()],Y.prototype,"receiverProfileName",void 0),G([(0,r.wk)()],Y.prototype,"receiverProfileImageUrl",void 0),G([(0,r.wk)()],Y.prototype,"caipNetwork",void 0),G([(0,r.wk)()],Y.prototype,"loading",void 0),G([(0,r.wk)()],Y.prototype,"params",void 0),Y=G([(0,w.EM)("w3m-wallet-send-preview-view")],Y);let J=(0,w.AH)` 521 .icon-box { 522 width: 64px; 523 height: 64px; 524 border-radius: 16px; 525 background-color: ${({spacing:e})=>e[16]}; 526 border: 8px solid ${({tokens:e})=>e.theme.borderPrimary}; 527 border-radius: ${({borderRadius:e})=>e.round}; 528 } 529`,Q=class extends n.WF{constructor(){super(),this.unsubscribe=[],this.unsubscribe.push()}render(){return(0,n.qy)` 530 <wui-flex 531 flexDirection="column" 532 alignItems="center" 533 gap="4" 534 .padding="${["1","3","4","3"]}" 535 > 536 <wui-flex justifyContent="center" alignItems="center" class="icon-box"> 537 <wui-icon size="xxl" color="success" name="checkmark"></wui-icon> 538 </wui-flex> 539 540 <wui-text variant="h6-medium" color="primary">You successfully sent asset</wui-text> 541 542 <wui-button 543 fullWidth 544 @click=${this.onCloseClick.bind(this)} 545 size="lg" 546 variant="neutral-secondary" 547 > 548 Close 549 </wui-button>
549 550 </wui-flex> 551 `}onCloseClick(){u.W.close()}};Q.styles=J,Q=function(e,t,i,n){var r,o=arguments.length,a=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,i,n);else for(var s=e.length-1;s>=0;s--)(r=e[s])&&(a=(o<3?r(a):o>3?r(t,i,a):r(t,i))||a);return o>3&&a&&Object.defineProperty(t,i,a),a}([(0,w.EM)("w3m-send-confirmed-view")],Q)},70007:(e,t,i)=>{var n=i(56059),r=i(81767),o=i(99736),a=i(91392),s=i(46756),l=i(55405),c=i(63412);let u=(0,a.AH)` 552 :host { 553 position: relative; 554 display: inline-block; 555 } 556 557 :host([data-error='true']) > input { 558 color: ${({tokens:e})=>e.core.textError}; 559 } 560 561 :host([data-error='false']) > input { 562 color: ${({tokens:e})=>e.theme.textPrimary}; 563 } 564 565 input { 566 background: transparent; 567 height: auto; 568 box-sizing: border-box; 569 color: ${({tokens:e})=>e.theme.textPrimary}; 570 font-feature-settings: 'case' on; 571 font-size: ${({textSize:e})=>e.h4}; 572 caret-color: ${({tokens:e})=>e.core.backgroundAccentPrimary}; 573 line-height: ${({typography:e})=>e["h4-regular-mono"].lineHeight}; 574 letter-spacing: ${({typography:e})=>e["h4-regular-mono"].letterSpacing}; 575 -webkit-appearance: none; 576 -moz-appearance: textfield; 577 padding: 0px; 578 font-family: ${({fontFamily:e})=>e.mono}; 579 } 580 581 :host([data-width-variant='auto']) input { 582 width: 100%; 583 } 584 585 :host([data-width-variant='fit']) input { 586 width: 1ch; 587 } 588 589 .wui-input-amount-fit-mirror { 590 position: absolute; 591 visibility: hidden; 592 white-space: pre; 593 font-size: var(--local-font-size); 594 line-height: 130%; 595 letter-spacing: -1.28px; 596 font-family: ${({fontFamily:e})=>e.mono}; 597 } 598 599 .wui-input-amount-fit-width { 600 display: inline-block; 601 position: relative; 602 } 603 604 input::-webkit-outer-spin-button, 605 input::-webkit-inner-spin-button { 606 -webkit-appearance: none; 607 margin: 0; 608 } 609 610 input::placeholder { 611 color: ${({tokens:e})=>e.theme.textSecondary}; 612 } 613`;var d=function(e,t,i,n){var r,o=arguments.length,a=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,i,n);else for(var s=e.length-1;s>=0;s--)(r=e[s])&&(a=(o<3?r(a):o>3?r(t,i,a):r(t,i))||a);return o>3&&a&&Object.defineProperty(t,i,a),a};let h=class extends n.WF{constructor(){super(...arguments),this.inputElementRef=(0,o._)(),this.disabled=!1,this.value="",this.placeholder="0",this.widthVariant="auto",this.maxDecimals=void 0,this.maxIntegers=void 0,this.fontSize="h4",this.error=!1}firstUpdated(){this.resizeInput()}updated(){this.style.setProperty("--local-font-size",a.f.textSize[this.fontSize]),this.resizeInput()}render(){return(this.dataset.widthVariant=this.widthVariant,this.dataset.error=String(this.error),this.inputElementRef?.value&&this.value&&(this.inputElementRef.value.value=this.value),"auto"===this.widthVariant)?this.inputTemplate():(0,n.qy)` 614 <div class="wui-input-amount-fit-width"> 615 <span class="wui-input-amount-fit-mirror"></span> 616 ${this.inputTemplate()} 617 </div> 618 `}inputTemplate(){return(0,n.qy)`<input 619 ${(0,o.K)(this.inputElementRef)} 620 type="text" 621 inputmode="decimal" 622 pattern="[0-9,.]*" 623 placeholder=${this.placeholder} 624 ?disabled=${this.disabled} 625 autofocus 626 value=${this.value??""} 627 @input=${this.dispatchInputChangeEvent.bind(this)} 628 />`}dispatchInputChangeEvent(){this.inputElementRef.value&&(this.inputElementRef.value.value=l.Z.maskInput({value:this.inputElementRef.value.value,decimals:this.maxDecimals,integers:this.maxIntegers}),this.dispatchEvent(new CustomEvent("inputChange",{detail:this.inputElementRef.value.value,bubbles:!0,composed:!0})),this.resizeInput())}resizeInput(){if("fit"===this.widthVariant){let e=this.inputElementRef.value;if(e){let t=e.previousElementSibling;t&&(t.textContent=e.value||"0",e.style.width=`${t.offsetWidth}px`)}}}};h.styles=[s.W5,s.fD,u],d([(0,r.MZ)({type:Boolean})],h.prototype,"disabled",void 0),d([(0,r.MZ)({type:String})],h.prototype,"value",void 0),d([(0,r.MZ)({type:String})],h.prototype,"placeholder",void 0),d([(0,r.MZ)({type:String})],h.prototype,"widthVariant",void 0),d([(0,r.MZ)({type:Number})],h.prototype,"maxDecimals",void 0),d([(0,r.MZ)({type:Number})],h.prototype,"maxIntegers",void 0),d([(0,r.MZ)({type:String})],h.prototype,"fontSize",void 0),d([(0,r.MZ)({type:Boolean})],h.prototype,"error",void 0),h=d([(0,c.E)("wui-input-amount")],h)},99643:(e,t,i)=>{var n=i(56059),r=i(81767);i(79909),i(39909),i(52131),i(83627),i(6077);var o=i(46756),a=i(63412),s=i(91392);let l=(0,s.AH)` 629 button { 630 display: block; 631 display: flex; 632 align-items: center; 633 padding: ${({spacing:e})=>e[1]}; 634 transition: background-color ${({durations:e})=>e.lg} 635 ${({easings:e})=>e["ease-out-power-2"]}; 636 will-change: background-color; 637 background-color: ${({tokens:e})=>e.theme.foregroundPrimary}; 638 border-radius: ${({borderRadius:e})=>e[32]}; 639 } 640 641 wui-image { 642 border-radius: ${({borderRadius:e})=>e[32]}; 643 } 644 645 wui-text { 646 padding-left: ${({spacing:e})=>e[1]}; 647 padding-right: ${({spacing:e})=>e[1]}; 648 } 649 650 .left-icon-container { 651 width: 24px; 652 height: 24px; 653 justify-content: center;
654 align-items: center; 655 } 656 657 .left-image-container { 658 position: relative; 659 justify-content: center; 660 align-items: center; 661 } 662 663 .chain-image { 664 position: absolute; 665 border: 1px solid ${({tokens:e})=>e.theme.foregroundPrimary}; 666 } 667 668 /* -- Sizes --------------------------------------------------- */ 669 button[data-size='lg'] { 670 height: 32px; 671 } 672 673 button[data-size='md'] { 674 height: 28px; 675 } 676 677 button[data-size='sm'] { 678 height: 24px; 679 } 680 681 button[data-size='lg'] .token-image { 682 width: 24px; 683 height: 24px; 684 } 685 686 button[data-size='md'] .token-image { 687 width: 20px; 688 height: 20px; 689 } 690 691 button[data-size='sm'] .token-image { 692 width: 16px; 693 height: 16px; 694 } 695 696 button[data-size='lg'] .left-icon-container { 697 width: 24px; 698 height: 24px; 699 } 700 701 button[data-size='md'] .left-icon-container { 702 width: 20px; 703 height: 20px; 704 } 705 706 button[data-size='sm'] .left-icon-container { 707 width: 16px; 708 height: 16px; 709 } 710 711 button[data-size='lg'] .chain-image { 712 width: 12px; 713 height: 12px; 714 bottom: 2px; 715 right: -4px; 716 } 717 718 button[data-size='md'] .chain-image { 719 width: 10px; 720 height: 10px; 721 bottom: 2px; 722 right: -4px; 723 } 724 725 button[data-size='sm'] .chain-image { 726 width: 8px; 727 height: 8px; 728 bottom: 2px; 729 right: -3px; 730 } 731 732 /* -- Focus states --------------------------------------------------- */ 733 button:focus-visible:enabled { 734 background-color: ${({tokens:e})=>e.theme.foregroundSecondary}; 735 box-shadow: 0 0 0 4px ${({tokens:e})=>e.core.foregroundAccent040}; 736 } 737 738 /* -- Hover & Active states ----------------------------------------------------------- */ 739 @media (hover: hover) { 740 button:hover:enabled, 741 button:active:enabled { 742 background-color: ${({tokens:e})=>e.theme.foregroundSecondary}; 743 } 744 } 745 746 /* -- Disabled states --------------------------------------------------- */ 747 button:disabled { 748 background-color: ${({tokens:e})=>e.theme.foregroundSecondary}; 749 opacity: 0.5; 750 } 751`;var c=function(e,t,i,n){var r,o=arguments.length,a=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,i,n);else for(var s=e.length-1;s>=0;s--)(r=e[s])&&(a=(o<3?r(a):o>3?r(t,i,a):r(t,i))||a);return o>3&&a&&Object.defineProperty(t,i,a),a};let u={lg:"lg-regular",md:"lg-regular",sm:"md-regular"},d={lg:"lg",md:"md",sm:"sm"},h=class extends n.WF{constructor(){super(...arguments),this.size="md",this.disabled=!1,this.text="",this.loading=!1}render(){return this.loading?(0,n.qy)` <wui-flex alignItems="center" gap="01" padding="01"> 752 <wui-shimmer width="20px" height="20px"></wui-shimmer> 753 <wui-shimmer width="32px" height="18px" borderRadius="4xs"></wui-shimmer> 754 </wui-flex>`:(0,n.qy)` 755 <button ?disabled=${this.disabled} data-size=${this.size}> 756 ${this.imageTemplate()} ${this.textTemplate()} 757 </button> 758 `}imageTemplate(){if(this.imageSrc&&this.chainImageSrc)return(0,n.qy)`<wui-flex class="left-image-container"> 759 <wui-image src=${this.imageSrc} class="token-image"></wui-image> 760 <wui-image src=${this.chainImageSrc} class="chain-image"></wui-image> 761 </wui-flex>`;if(this.imageSrc)return(0,n.qy)`<wui-image src=${this.imageSrc} class="token-image"></wui-image>`;let e=d[this.size];return(0,n.qy)`<wui-flex class="left-icon-container"> 762 <wui-icon size=${e} name="networkPlaceholder"></wui-icon> 763 </wui-flex>`}textTemplate(){let e=u[this.size];return(0,n.qy)`<wui-text color="primary" variant=${e} 764 >${this.text}</wui-text 765 >`}};h.styles=[o.W5,o.fD,l],c([(0,r.MZ)()],h.prototype,"size",void 0),c([(0,r.MZ)()],h.prototype,"imageSrc",void 0),c([(0,r.MZ)()],h.prototype,"chainImageSrc",void 0),c([(0,r.MZ)({type:Boolean})],h.prototype,"disabled",void 0),c([(0,r.MZ)()],h.prototype,"text",void 0),c([(0,r.MZ)({type:Boolean})],h.prototype,"loading",void 0),h=c([(0,a.E)("wui-token-button")],h)}}]);
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.