(globalThis.webpackChunk=globalThis.webpackChunk||[]).push([[2089],{701023(__unused_webpack_module,__webpack_exports__,__webpack_require__){(function(){if(!this.ST)return()=>{};with(this.ST)with(this.RH)with(this.G)return function(){"use strict";__webpack_require__.d(__webpack_exports__,{Y5:()=>r,eh:()=>n});var t=__webpack_require__(566641);var e=__webpack_require__(685010);var l=__webpack_require__(757092);let n=n=>{if(!n)return"unknown";let{type:r,metadata:u}=n;let a=u?.keyring?.type;let i=u?.snap?.id;return a&&[l.rI.ledger,l.rI.trezor,l.rI.oneKey,l.rI.lattice,l.rI.qr].includes(a)?"hardware":(0,a===l.rI.simple)?"private-key":(0,a===l.rI.snap&&i==="npm:@metamask/institutional-wallet-snap")?"institutional-evm":(0,(0,e.a)(r))?"evm":(0,r===t.Ux.DataAccount)?"solana":(0,Object.values(t.fi).includes(r))?"bitcoin":(0,r===t.mA.Eoa)?"tron":(0,"unknown")};let r=t=>{return n(t)==="hardware"}}}).call(__webpack_require__._LM_("$root$",{__webpack_require__,__webpack_exports__}))()},927295(__unused_webpack_module,__webpack_exports__,__webpack_require__){(function(){if(!this.ST)return()=>{};with(this.ST)with(this.RH)with(this.G)return function(){"use strict";__webpack_require__.d(__webpack_exports__,{e:()=>f,uY:()=>w});var t=__webpack_require__(67659);var e=__webpack_require__(833081);var l=__webpack_require__(386303);__webpack_require__.n(l);var n=__webpack_require__(264406);var r=__webpack_require__(517288);__webpack_require__.n(r);var u=__webpack_require__(341221);var a=__webpack_require__(968511);var i=__webpack_require__(746182);var s=__webpack_require__(874396);var o=__webpack_require__(440869);var c=__webpack_require__(417900);var d=__webpack_require__(75609);var v=__webpack_require__(59836);var h=__webpack_require__(205810);"use no memo";let f=({quote:l,fromAddress:n,fromAddressAccount:u,chainId:a})=>{let s=(0,e.wA)();let[d,f]=(0,t.useState)(!1);let[w,S]=(0,t.useState)(null);let[k,m]=(0,t.useState)(!1);let[p,I]=(0,t.useState)(!1);let b=(0,i.Z)(l?.requestId);let[g,A]=(0,t.useState)(null);let y=(0,e.d4)(v.Sc);let T=(0,e.d4)(v.R6);let{accounts:q}=(0,h.G)();let $=(0,t.useRef)(new Map);let[C,E]=(0,t.useState)(null);let G=(0,t.useCallback)((0,r.debounce)(async(t,e)=>{S(null),m(!1),f(!1),I(!1)},750),[s]);let M=(0,t.useCallback)(async t=>{if(!!1||!t||!n||!a||!y){S(null),m(!1),A(null),f(!1),I(!1);return}f(!0),I(!1);let e=null;try{if(!await s((0,o.ggM)(q))){S(null),m(!1),A(null),I(!1),f(!1);return}if(!(e=(0,c.B)(n,a))){S(null),I(!1),m(!1),A(null),f(!1);return}let l=await s((0,o.NSN)(e));A(l);let r=l;if(!l&&u&&(r=await s((0,o.J$j)({account:u}))),m(r),S(null),I(!1),!r||!l){f(!1);return}await G(t,e)}catch{f(!1),m(!1),S(null),A(null),I(!1)}},[n,a,y,s,u,G]);return(0,t.useEffect)(()=>{b!==l?.requestId&&M(l)},[M,l?.requestId,l,b]),(0,t.useEffect)(()=>{n&&T!==null?($.current.set(n,T),E(T)):n?E($.current.get(n)??null):E(null)},[T,n]),(0,t.useEffect)(()=>{C!==null&&g===!1&&M(l)},[C,g,M,l]),{shouldShowRewardsRow:k,isLoading:d,estimatedPoints:w,hasError:p,accountOptedIn:g,rewardsAccountScope:l&&k?u:null}};let w=({activeQuote:t})=>{let l=(0,e.d4)(u.G8);let r=(0,e.d4)(u.dJ);let i=(0,e.d4)(u.WZ);let o=(0,s.t)(a.aN);let c=o?(0,n.Kr)(o.toString()):null;let v=(0,e.d4)(t=>c?(0,d.zH)(t,c):null);return f({quote:l&&r&&i?.srcTokenAmount&&v?.address?t:null,fromAddress:v?.address,fromAddressAccount:v,chainId:o?.toString()})}}}).call(__webpack_require__._LM_("$root$",{__webpack_require__,__webpack_exports__}))()}}]);