testnet.roguex.io Open in urlscan Pro
2606:4700:3030::ac43:9060  Public Scan

Submitted URL: http://testnet.roguex.io/static/js/main-5b26a900.8dd28a02.js
Effective URL: https://testnet.roguex.io/static/js/main-5b26a900.8dd28a02.js
Submission: On March 09 via api from US — Scanned from US

Form analysis 0 forms found in the DOM

Text Content

"use strict";(self.webpackChunkrogueX_swap=self.webpackChunkrogueX_swap||[]).push([[6256],{55011:(e,n,t)=>{t.d(n,{EH:()=>T,Ol:()=>S,S5:()=>E,U8:()=>N,UF:()=>A,dQ:()=>M,l6:()=>y,uR:()=>k});var o=t(63235),r=t(28183),i=t(11744),u=t(48169),d=t(22107),a=t(54408),l=t(63429),s=t(76653),c=t(76545),v=t(71233),m=t(94232),f=t(76897),g=t(30185),p=t(51873),h=t(77828);const I=new o.vU(i);function w(e,n){return(0,v.useMemo)((()=>{var t;return n?Object.keys(null!==(t=e[n])&&void 0!==t?t:{}).reduce(((t,o)=>(t[o]=e[n][o].token,t)),{}):{}}),[n,e])}function A(){const e=(0,g.K1)(a.Lx),n=(0,m.C)((e=>{let{user:{tokens:n}}=e;return n})),t=(0,g.z0)();return(0,v.useMemo)((()=>{const o={};return n&&Object.keys(n).forEach((e=>{const t=Number(e),r={};Object.values(n[t]).forEach((e=>{r[e.address]=(0,h.iG)(e)})),o[t]=r})),Object.keys(e).forEach((n=>{var t;const r=Number(n),i=null!==(t=o[r])&&void 0!==t?t:{};Object.values(e[r]).forEach((e=>{let{token:n}=e;i[n.address]=n})),o[r]=i})),Object.keys(t).forEach((e=>{var n;const r=Number(e),i=null!==(n=o[r])&&void 0!==n?n:{};Object.values(t[r]).forEach((e=>{let{token:n}=e;i[n.address]=n})),o[r]=i})),Object.keys(t).forEach((e=>{var n;const r=Number(e),i=null!==(n=o[r])&&void 0!==n?n:{};Object.values(t[r]).forEach((e=>{let{token:n}=e;i[n.address]=n})),o[r]=i})),o}),[e,t,n])}function k(e){const n=w((0,g.z0)(),e),t=(0,h.em)();return(0,v.useMemo)((()=>t.reduce(((e,n)=>(e[n.address]=n,e)),{...n})),[n,t])}function y(){const{chainId:e}=(0,u.gi)(),n=(0,g.R0)(),t=w((0,g.Rx)(),e),o=(0,v.useMemo)((()=>{if(!e||!(0,f.p)(e))return{};if(!n)return{};const o=(0,d.bt)(e).defaultListUrl,i=n[o];if(!i||null===i||void 0===i||!i.current)return{};const u=i.current,a=new Set(Object.keys(t));return u.tokens.reduce(((e,n)=>{var t;const o=null===(t=n.extensions)||void 0===t?void 0:t.bridgeInfo;if(o&&o[r.ChainId.MAINNET]&&o[r.ChainId.MAINNET].tokenAddress&&a.has(o[r.ChainId.MAINNET].tokenAddress)){const t=o[r.ChainId.MAINNET].tokenAddress;return{...e,[t]:new r.Token(r.ChainId.MAINNET,t,n.decimals)}}return e}),{})}),[e,n,t]);return{...t,...o}}function E(e){let n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:10;const t=(0,g.R0)(),o=a.Ek,{chainId:r}=(0,u.gi)(),i=k(r);return(0,v.useMemo)((()=>{if(!e||0===e.trim().length)return[];const u=(0,c.F)(e),d=[],a={};for(const e of o){var l;const o=null===(l=t[e])||void 0===l?void 0:l.current;if(o)for(const e of o.tokens)if(e.chainId===r&&u(e))try{const t=new p.D(e,o);if(!(t.address in i)&&!a[t.address]&&(a[t.address]=!0,d.push(t),d.length>=n))return d}catch{continue}}return d}),[i,r,o,t,n,e])}function T(e){const n=(0,h.em)();return!!e&&!!n.find((n=>e.equals(n)))}function M(e){const{chainId:n}=(0,u.gi)(),t=k(n);return(0,s.Kw)(t,e)}function N(e,n){const{chainId:t}=(0,u.gi)(),o=k(null!==n&&void 0!==n?n:t);return(0,s.$m)(o,null!==n&&void 0!==n?n:t,e)}function S(e){const{chainId:n}=(0,u.gi)(),t=e||[void 0],o=(0,l._Y)(t,I,"name",void 0,l.DB),i=(0,l._Y)(t,I,"symbol",void 0,l.DB),d=(0,l._Y)(t,I,"decimals",void 0,l.DB);return(0,v.useMemo)((()=>{if(e)return null===e||void 0===e?void 0:e.reduce(((e,t,u)=>{const{result:a}=o[u],{result:l}=i[u],{result:s}=d[u];if(!a||!l||!s||!n)return e;const c=new r.Token(n,t,s[0],l[0],a[0]);return e.push(c),e}),[])}),[n,d,i,e,o])}},85254:(e,n,t)=>{t.d(n,{H:()=>i,b:()=>u});var o=t(48169),r=t(5331);const i=()=>{const{chainId:e}=(0,o.gi)();return e?r.Xd[e]:void 0},u=()=>{const{chainId:e}=(0,o.gi)();return e?r.yl[e]:void 0}},58102:(e,n,t)=>{t.d(n,{Z:()=>d});var o=t(43822),r=t(71233),i=t(99300),u=t(94232);function d(e){const n=(0,u.T)();(0,r.useEffect)((()=>{if(e){const t="risk-check-".concat(e),r=Date.now();try{const u=localStorage.getItem(t);if((u?parseInt(u):r-1)<Date.now()){const t=new Headers({"Content-Type":"application/json"});fetch("https://screening-worker.uniswap.workers.dev",{method:"POST",headers:t,body:JSON.stringify({address:e})}).then((e=>e.json())).then((t=>{t.block&&(n((0,i.i3)(i.Lk.BLOCKED_ACCOUNT)),(0,o.qP)({category:"Address Screening",action:"blocked",label:e}))})).catch((()=>n((0,i.i3)(null))))}}finally{localStorage.setItem(t,(r+864e5).toString())}}}),[e,n])}},95323:(e,n,t)=>{t.d(n,{St:()=>m,T:()=>v,eQ:()=>f});var o,r,i,u=t(85447),d=t(71233),a=t(38896),l=t(77828),s=t(42841);function c(e){if("string"!==typeof e)return;const n=e.toLowerCase();return u.RF.find((e=>e.toLowerCase()===n||e.split("-")[0]===n))}function v(){if(!navigator.language)return;const[e,n]=navigator.language.split("-");var t;return n&&null!==(t=c("".concat(e,"-").concat(n.toUpperCase())))&&void 0!==t?t:c(e)}const m=null!==(o=null!==(r=null!==(i=c((0,s.E)().lng))&&void 0!==i?i:function(){var e;return null!==(e=a.Z.getState().user.userLocale)&&void 0!==e?e:void 0}())&&void 0!==r?r:v())&&void 0!==o?o:u.ZW;function f(){const e=c((0,s.Z)().lng),n=(0,l.Tc)();return(0,d.useMemo)((()=>{var t,o;return null!==(t=null!==(o=null!==e&&void 0!==e?e:n)&&void 0!==o?o:v())&&void 0!==t?t:u.ZW}),[e,n])}},36714:(e,n,t)=>{t.d(n,{U:()=>o.U,q:()=>a});var o=t(27762),r=t(71233),i=t(73788),u=t(98475);function d(e){const n=(0,i.h7)();return(0,r.useCallback)((()=>e().then((e=>{if(e){const{response:t,tokenAddress:o,spenderAddress:r,amount:i}=e;n(t,{type:u.i.APPROVAL,tokenAddress:o,spender:r,amount:i.quotient.toString()})}}))),[n,e])}function a(e,n){const[t,r]=(0,o.o)(e,n,i.wB);return[t,d(r)]}},18385:(e,n,t)=>{t.d(n,{Z:()=>a});var o=t(48169),r=t(21401),i=t(36099),u=t(63429),d=t(71233);function a(){const{account:e}=(0,o.gi)(),n=function(){var e;const{account:n}=(0,o.gi)(),t=(0,i.c5)(),r=(0,d.useMemo)((()=>[null!==n&&void 0!==n?n:void 0]),[n]),a=(0,u.Wk)(t,"isArgentWallet",r,u.DB);return Boolean(null===a||void 0===a||null===(e=a.result)||void 0===e?void 0:e[0])}();return(0,i.cq)(n&&null!==e&&void 0!==e?e:void 0,r,!0)}},54195:(e,n,t)=>{t.d(n,{Z:()=>s});var o=t(67898),r=t(1756),i=t(18611),u=t(71233),d=t(90797);const a={};function l(e,n,t,o,i){if(n&&t)return(0,r.s)(n);(0,d.UJ)(e);return e?"https://raw.githubusercontent.com/metaverseblock/token-icon/main/".concat(n,"/").concat(e.toLocaleLowerCase(),".png"):null!==o&&void 0!==o?o:void 0}function s(e,n,t,r,d){const[s,c]=(0,u.useState)(l(e,n,t,r)),[v,m]=(0,u.useState)(void 0);(0,u.useEffect)((()=>{c(l(e,n,t,r)),m(void 0)}),[e,r,n,t,d]);const f=(0,u.useCallback)((()=>{if(s&&(a[s]=!0),v)c(v.find((e=>!a[e])));else{var t;const u=null!==(t=o.Z.getIcons(e,n))&&void 0!==t?t:[];r&&u.push(r);const d=function(e){const n=e.map((e=>(0,i.Z)(e))).flat(1),t=[];let o;return n.forEach((e=>{e.startsWith("https://assets.coingecko")?o||(o=e.replace(/small|thumb/g,"large")):t.push(e)})),o?[...t,o]:t}(function(e){const n=[];return e.forEach((e=>n.push(...(0,i.Z)(e)))),n}(u));c(d.find((e=>!a[e]))),m(d)}}),[s,v,e,n,r]);return[s,f]}},68977:(e,n,t)=>{t.d(n,{Z:()=>M});var o=t(23388),r=t(28183),i=t(9784),u=t(74970),d=t(48169),a=t(73304),l=t(44634),s=t.n(l),c=t(71452),v=t(71233),m=t(63429),f=t(36099),g=t(85587);const p=[{inputs:[],name:"latestAnswer",outputs:[{internalType:"int256",name:"",type:"int256"}],stateMutability:"view",type:"function"}];var h=t(96528);const I=new r.Percent(5,1e3),w=1e5,A=135e3,k=7e4,y=5e4;const E=I,T=new r.Percent(5,100);function M(e){var n,t;const{chainId:l}=(0,d.gi)(),M=l&&a.Ny.includes(l),N=(0,h.sq)(null===e||void 0===e?void 0:e.outputAmount),S=function(){var e,n;const{address:t}=(0,g.Z)("fast-gas-gwei.data.eth"),o=(0,f.cq)(null!==t&&void 0!==t?t:void 0,p,!1),r=null===(e=(0,m.Wk)(o,"latestAnswer").result)||void 0===e||null===(n=e[0])||void 0===n?void 0:n.toString();return(0,v.useMemo)((()=>"string"===typeof r?s().BigInt(r):void 0),[r])}(),b=function(e){if(e){let n=0;for(const{route:t}of e.swaps)t.protocol===o.Protocol.V2?n+=A+t.pools.length*y:t.protocol===o.Protocol.V3?n+=w+t.pools.length*k:t.protocol===o.Protocol.MIXED?n+=(0,o.partitionMixedRouteByProtocol)(t).reduce(((e,n)=>n.every((e=>e instanceof u.Pool))?e+w+n.length*k:n.every((e=>e instanceof i.Pair))?e+A+(n.length-1)*y:(console.warn("Invalid section"),e)),0):n+=w+t.pools.length*k;return n}}(e),O=null!==(n=(0,h.cM)(null===e||void 0===e?void 0:e.gasUseEstimateUSD))&&void 0!==n?n:null,L=(0,c.Z)(l),C=(0,h.ZP)(null!==(t=e&&L)&&void 0!==t?t:void 0);return(0,v.useMemo)((()=>{if(!e||M)return I;const n=S&&"number"===typeof b?s().multiply(S,s().BigInt(b)):void 0,t=L&&n&&C?C.quote(r.CurrencyAmount.fromRawAmount(L,n)):void 0,o=l&&a.XR.includes(l)&&O?O:t;if(N&&o){const e=o.asFraction.divide(N.asFraction),n=new r.Percent(e.numerator,e.denominator);return n.greaterThan(T)?T:n.lessThan(E)?E:n}return I}),[e,M,S,b,L,C,l,O,N])}},23238:(e,n,t)=>{t.d(n,{P:()=>k});var o=t(38935),r=t(71233),i=t(16337),u=t(28183),d=t(74970),a=t(48169),l=t(44634),s=t.n(l),c=t(63429),v=t(87774);function m(e,n,t,o){let r=arguments.length>4&&void 0!==arguments[4]?arguments[4]:[],i=arguments.length>5&&void 0!==arguments[5]?arguments[5]:[],u=arguments.length>6&&void 0!==arguments[6]?arguments[6]:e,a=arguments.length>7&&void 0!==arguments[7]?arguments[7]:2;const l=null===e||void 0===e?void 0:e.wrapped,s=null===n||void 0===n?void 0:n.wrapped;if(!l||!s)throw new Error("Missing tokenIn/tokenOut");for(const c of t){if(!c.involvesToken(l)||r.find((e=>{return(n=c)===(t=e)||n.token0.equals(t.token0)&&n.token1.equals(t.token1)&&n.fee===t.fee;var n,t})))continue;const e=c.token0.equals(l)?c.token1:c.token0;e.equals(s)?i.push(new d.Route([...r,c],u,n)):a>1&&m(e,n,t,o,[...r,c],i,u,a-1)}return i}function f(e,n){const{chainId:t}=(0,a.gi)(),{pools:o,loading:i}=(0,v.V)(e,n);return(0,r.useMemo)((()=>{if(i||!t||!o||!e||!n)return{loading:!0,routes:[]};return{loading:!1,routes:m(e,n,o,t,[],[],e,2)}}),[t,e,n,o,i])}var g=t(36099);const p={[u.ChainId.ARBITRUM_ONE]:25e6,[u.ChainId.CELO]:5e7,[u.ChainId.CELO_ALFAJORES]:5e7,[u.ChainId.POLYGON]:4e7,[u.ChainId.POLYGON_MUMBAI]:4e7,[u.ChainId.BNB]:5e7,[u.ChainId.AVALANCHE]:5e7},h=2e6;var I=t(45756);const w=350,A=650;function k(e,n,t){const l=(0,o.R)()===o.M.Enabled,[v,m]=(0,I.Z)((0,r.useMemo)((()=>[n,t]),[n,t]),l?A:w),k=function(e,n,t){var o;const[l,v]=e===u.TradeType.EXACT_INPUT?[null===n||void 0===n?void 0:n.currency,t]:[t,null===n||void 0===n?void 0:n.currency],{routes:m,loading:I}=f(l,v),{chainId:w}=(0,a.gi)(),A=(0,g.Tz)();(0,r.useEffect)((()=>{}),[m]);const k=(0,r.useMemo)((()=>n?m.map((t=>d.SwapQuoter.quoteCallParameters(t,n,e,{useQuoterV2:!1}).calldata)):[]),[n,m,e]),y=(0,c.o6)(A,k,{gasRequired:w?null!==(o=p[w])&&void 0!==o?o:h:void 0}),E=(0,r.useMemo)((()=>l&&v&&(l.equals(v)||l.wrapped.equals(v))),[l,v]);return(0,r.useMemo)((()=>{if(!n||!l||!v||y.some((e=>{let{valid:n}=e;return!n}))||E)return{state:i.qx.INVALID,trade:void 0,v3trade:void 0};if(I||y.some((e=>{let{loading:n}=e;return n})))return{state:i.qx.LOADING,trade:void 0,v3trade:void 0};const{bestRoute:t,amountIn:o,amountOut:r}=y.reduce(((t,o,r)=>{let{result:i}=o;if(!i)return t;if(e===u.TradeType.EXACT_INPUT){const e=u.CurrencyAmount.fromRawAmount(v,i.amountOut.toString());if(null===t.amountOut||s().lessThan(t.amountOut.quotient,e.quotient))return{bestRoute:m[r],amountIn:n,amountOut:e}}else{const e=u.CurrencyAmount.fromRawAmount(l,i.amountIn.toString());if(null===t.amountIn||s().greaterThan(t.amountIn.quotient,e.quotient))return{bestRoute:m[r],amountIn:e,amountOut:n}}return t}),{bestRoute:null,amountIn:null,amountOut:null});return t&&o&&r?{state:i.qx.VALID,trade:new i.H9({v2Routes:[],v3Routes:[{routev3:t,inputAmount:o,outputAmount:r}],tradeType:e,quoteMethod:i.Y2.CLIENT_SIDE,approveInfo:{needsApprove:!1}}),v3trade:d.Trade.createUncheckedTrade({route:t,tradeType:e,inputAmount:o,outputAmount:r})}:{state:i.qx.NO_ROUTE_FOUND,trade:void 0,v3trade:void 0}}),[n,E,l,v,y,m,I,e])}(e,v,m),y=k.state===i.qx.LOADING;return(0,r.useMemo)((()=>({...k,...y?{state:i.qx.LOADING}:{}})),[k,y])}},34408:(e,n,t)=>{t.d(n,{r:()=>m});var o=t(28183),r=t(18611),i=t(94311),u=t.n(i),d=t(29514),a=t(71233),l=t(51873),s=t(61579);function c(e){return"https://raw.githubusercontent.com/uniswap/assets/master/blockchains/ethereum/assets/".concat(e,"/logo.png")}async function v(e){var n;const t=(0,r.Z)(e)[0];let o;try{o=await u().from(t).getPalette()}catch(l){return null}if(null===(n=o)||void 0===n||!n.Vibrant)return null;let i=o.Vibrant.hex,a=(0,s.$v)(i,"#FFF");for(;a<3;)i=(0,d.wj)(.005,i),a=(0,s.$v)(i,"#FFF");return i}function m(e){const[n,t]=(0,a.useState)("#2172E5");return(0,a.useEffect)((()=>{let n=!1;return e&&async function(e){if(!(e instanceof l.D))return null;const n=e,{address:t}=n;let{logoURI:r}=n;if(!r){if(e.chainId!==o.ChainId.MAINNET)return null;r=c(t)}try{return await v(r)}catch(i){if(r===c(t))return null;try{return r=c(t),await v(r)}catch(u){return console.warn("Unable to load logoURI (".concat(e.symbol,"): ").concat(r)),null}}}(e).then((e=>{n||null===e||t(e)})),()=>{n=!0,t("#2172E5")}}),[e]),n}},36099:(e,n,t)=>{t.d(n,{c5:()=>z,gs:()=>Q,cq:()=>V,zb:()=>$,uU:()=>Y,fN:()=>j,OA:()=>K,Hr:()=>me,Y0:()=>ve,h$:()=>J,Yv:()=>re,Mc:()=>le,NZ:()=>ae,n6:()=>Ie,Tz:()=>te,Pm:()=>ge,bM:()=>we,MS:()=>he,ge:()=>se,jT:()=>oe,Ib:()=>H,YU:()=>ie,hV:()=>fe,p5:()=>ue,U:()=>ne,GL:()=>ee,A6:()=>pe,kV:()=>de,N4:()=>ce,Hj:()=>G});var o=t(53518),r=t(75932),i=t(23467),u=(t(2590),t(16090)),d=t(60748),a=t(11744),l=t(10126),s=t(7432),c=t(86784),v=t(24811),m=t(59543),f=t(74373),g=t(69549),p=t(42098),h=t(73029),I=t(98367),w=t(85172),A=t(21875),k=t(72128),y=t(71023),E=t(20904),T=t(20581),M=t(5090),N=t(91748),S=t(74138),b=t(80315),O=t(97682),L=t(70755),C=t(48169),P=t(29228),U=t(23721),R=t(5331),D=t(71233),F=t(90797),_=t(87164);const q=function(){let e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];const{address:n,isConnected:t}=(0,_.mA)(),{chainId:o}=(0,C.gi)(),r=(0,C.zu)(),i=(0,C.yL)({chainId:o});return(0,D.useMemo)((()=>e&&n&&t&&r?r:i),[r,n,t,i,e])},W=function(){let e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];const{address:n,isConnected:t}=(0,_.mA)(),o=(0,C.zu)();return(0,D.useMemo)((()=>e&&n&&t&&o?o:void 0),[o,n,t,e])},{abi:Z}=o,{abi:x}=r,{abi:B}=h;function V(e,n){let t=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];const{chainId:o}=(0,C.gi)(),r=q(t);return(0,D.useMemo)((()=>{if(!e||!n||!r||!o)return null;let t;if(t="string"===typeof e?e:e[o],!t)return null;try{return(0,F.uN)(t,n,r)}catch(i){return console.error("Failed to get contract",i),null}}),[e,n,o,r])}function X(e,n){const{chainId:t}=(0,C.gi)(),o=W(!0);return(0,D.useMemo)((()=>{if(!e||!n||!o||!t)return null;let r;if(r="string"===typeof e?e:e[t],!r)return null;try{return(0,F.uN)(r,n,o)}catch(i){return console.error("Failed to get contract",i),null}}),[e,n,t,o])}function H(e,n){return V(e,a,n)}function G(e){var n;const{chainId:t}=(0,C.gi)();return V(t?null===(n=R.Fl[t])||void 0===n?void 0:n.address:void 0,L,e)}function K(e){return V(e,s,!1)}function j(e){return V(e,c,!1)}function z(){return V(P.xo,i,!1)}function $(e){return V(P.Wk,d,e)}function Y(e,n){return V(e,u,n)}function Q(e,n){return V(e,l,n)}function J(){return V(P.yy,x,!1)}function ee(e){return V(P.ai,B,e)}function ne(){return V(P.vm,k.Mt)}function te(){return V(P.Ww,I.M)}function oe(){const{chainId:e}=(0,C.gi)();return V(e?P.Du[e]:void 0,Z)}function re(){return V(P.YQ,f.Mt)}function ie(e){return V(e,M.Mt)}function ue(){return X(P.IA,N.Mt)}function de(){return V(P.$R,b.Mt)}function ae(){return V(P.IQ,p.Mt)}function le(e){return V(e,g.Mt)}function se(e){return V(e,T.Mt)}function ce(e){return V(e,O.Mt)}function ve(e){return V(e,m.Mt)}function me(){return X(P.uA,v)}function fe(){return V(P.nh,w.Mt)}function ge(){return V(P.hu,A.Mt)}function pe(e){return V(e,S.Mt,!1)}function he(){return V(P.oy,y.Mt)}function Ie(){const{chainId:e}=(0,C.gi)(),n=(0,C.zu)();return(0,U.r)(e,n)}function we(e){return V(e,E.Mt,!1)}},5556:(e,n,t)=>{t.d(n,{Z:()=>u});var o=t(69017),r=t.n(o),i=t(71233);function u(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:500;const[n,t]=(0,i.useState)(!1),o=(0,i.useCallback)((e=>{const n=r()(e);t(n)}),[]);return(0,i.useEffect)((()=>{if(n){const n=setTimeout((()=>{t(!1)}),e);return()=>{clearTimeout(n)}}}),[n,t,e]),[n,o]}},45983:(e,n,t)=>{t.d(n,{Z:()=>d});var o=t(96812),r=t(63429),i=t(71233),u=t(36099);function d(){var e,n,t;const d=(0,u.h$)(),a=null===(e=(0,r.Wk)(d,"getCurrentBlockTimestamp"))||void 0===e||null===(n=e.result)||void 0===n||null===(t=n[0])||void 0===t?void 0:t.toString();return(0,i.useMemo)((()=>"string"===typeof a?o.O$.from(a):void 0),[a])}},45756:(e,n,t)=>{t.d(n,{Z:()=>r});var o=t(71233);function r(e,n){const[t,r]=(0,o.useState)(e);return(0,o.useEffect)((()=>{const t=setTimeout((()=>{r(e)}),n);return()=>{clearTimeout(t)}}),[e,n]),t}},35455:(e,n,t)=>{t.d(n,{Z:()=>r});var o=t(71233);function r(e,n){let t=arguments.length>2&&void 0!==arguments[2]?arguments[2]:100;const[r,i]=(0,o.useState)((()=>e)),u=(0,o.useRef)(),d=(0,o.useCallback)((e=>{i(e),u.current&&clearTimeout(u.current),u.current=setTimeout((()=>{n(e),u.current=void 0}),t)}),[t,n]);return(0,o.useEffect)((()=>{u.current&&(clearTimeout(u.current),u.current=void 0),i(e)}),[e]),[r,d]}},14506:(e,n,t)=>{t.d(n,{Z:()=>u});var o=t(74970),r=t(64820),i=t(55011);function u(e){const n=(0,i.U8)(null===e||void 0===e?void 0:e.token0),t=(0,i.U8)(null===e||void 0===e?void 0:e.token1),[,u]=(0,r.AI)(null!==n&&void 0!==n?n:void 0,null!==t&&void 0!==t?t:void 0,null===e||void 0===e?void 0:e.fee);let d;return u&&e&&(d=new o.Position({pool:u,liquidity:e.liquidity.toString(),tickLower:e.tickLower,tickUpper:e.tickUpper})),{position:d,pool:null!==u&&void 0!==u?u:void 0}}},93236:(e,n,t)=>{t.d(n,{Z:()=>i});var o=t(71233),r=t(66399);function i(e){(0,o.useEffect)((()=>{r.tq&&(document.body.style.overflow=e?"hidden":"auto")}),[e])}},45571:(e,n,t)=>{t.d(n,{Z:()=>d});var o=t(71233),r=t(90797),i=t(85587),u=t(17723);function d(e){const n=(0,r.UJ)(e),t=(0,u.Z)(n||void 0),d=(0,i.Z)(e);return(0,o.useMemo)((()=>({loading:t.loading||d.loading,address:n||d.address,name:t.ENSName?t.ENSName:!n&&d.address&&e||null})),[d.address,d.loading,e,t.ENSName,t.loading,n])}},85587:(e,n,t)=>{t.d(n,{Z:()=>l});var o=t(3910),r=t(63429),i=t(71233),u=t(7769),d=t(36099),a=t(45756);function l(e){var n;const t=(0,a.Z)(e,200),l=(0,i.useMemo)((()=>[t?(0,o.VM)(t):void 0]),[t]),s=(0,d.zb)(!1),c=(0,r.Wk)(s,"resolver",l),v=null===(n=c.result)||void 0===n?void 0:n[0],m=(0,d.uU)(v&&!(0,u.Z)(v)?v:void 0,!1),f=(0,r.Wk)(m,"addr",l),g=t!==e;return(0,i.useMemo)((()=>{var e,n;return{address:g?null:null!==(e=null===(n=f.result)||void 0===n?void 0:n[0])&&void 0!==e?e:null,loading:g||c.loading||f.loading}}),[f.loading,f.result,g,c.loading])}},23774:(e,n,t)=>{t.d(n,{Z:()=>g});var o=t(96812),r=t(53237),i=t(3910),u=t(48169),d=t(63429),a=t(18611),l=t(71233),s=t(90797),c=t(7769),v=t(36099),m=t(45756),f=t(17723);function g(e){let n=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];const t=(0,m.Z)(e,200),c=p((0,l.useMemo)((()=>{if(t&&(0,s.UJ)(t))return(0,i.VM)("".concat(t.toLowerCase().substr(2),".addr.reverse"))}),[t])),g=(0,f.Z)(e).ENSName,h=p(null===g?void 0:(0,i.VM)(g));let I=c.avatar||h.avatar;const w=function(){var e,n,t,i;let s=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",c=arguments.length>1?arguments[1]:void 0;const m=s.toLowerCase().split(":"),f=m[0],[,g]=null!==(e=null===(n=m[1])||void 0===n?void 0:n.split("/"))&&void 0!==e?e:[],[p,h]=null!==(t=null===(i=m[2])||void 0===i?void 0:i.split("/"))&&void 0!==t?t:[],I="eip155"===f&&"erc721"===g,w="eip155"===f&&"erc1155"===g,A=function(e,n,t){const o=(0,l.useMemo)((()=>[n]),[n]),{account:r}=(0,u.gi)(),i=(0,v.OA)(e),a=(0,d.Wk)(i,"ownerOf",o),s=(0,d.Wk)(i,"tokenURI",o);return(0,l.useMemo)((()=>{var e,n;return{uri:t&&r!==(null===(e=a.result)||void 0===e?void 0:e[0])||null===(n=s.result)||void 0===n?void 0:n[0],loading:a.loading||s.loading}}),[r,t,a.loading,a.result,s.loading,s.result])}(I?p:void 0,I?h:void 0,c),k=function(e,n,t){const{account:i}=(0,u.gi)(),a=(0,l.useMemo)((()=>[n]),[n]),s=(0,l.useMemo)((()=>[i||"",n]),[i,n]),c=(0,v.fN)(e),m=(0,d.Wk)(c,"balanceOf",s),f=(0,d.Wk)(c,"uri",a);return(0,l.useMemo)((()=>{try{var e,i,u;const d=n?(0,r.hexZeroPad)(o.O$.from(n).toHexString(),32).substring(2):n;return{uri:!t||(null===(e=m.result)||void 0===e?void 0:e[0])>0?null===(i=f.result)||void 0===i||null===(u=i[0])||void 0===u?void 0:u.replaceAll("{id}",d):void 0,loading:m.loading||f.loading}}catch(d){return console.error("Invalid token id",d),{loading:!1}}}),[m.loading,m.result,t,f.loading,f.result,n])}(w?p:void 0,w?h:void 0,c),y=A.uri||k.uri,E=y&&(0,a.Z)(y)[0],[T,M]=(0,l.useState)(!1),[N,S]=(0,l.useState)(void 0);return(0,l.useEffect)((()=>{S(void 0),E&&(M(!0),fetch(E).then((e=>e.json())).then((e=>{let{image:n}=e;S(n)})).catch((e=>console.warn(e))).finally((()=>{M(!1)})))}),[E]),(0,l.useMemo)((()=>({avatar:N,loading:A.loading||k.loading||T})),[N,k.loading,A.loading,T])}(I,n);I=w.avatar||I;const A=I&&(0,a.Z)(I)[0],k=t!==e;return(0,l.useMemo)((()=>({avatar:k?null:null!==A&&void 0!==A?A:null,loading:k||c.loading||h.loading||w.loading})),[c.loading,k,A,h.loading,w.loading])}function p(e){var n;const t=(0,l.useMemo)((()=>[e]),[e]),o=(0,l.useMemo)((()=>[e,"avatar"]),[e]),r=(0,v.zb)(!1),i=(0,d.Wk)(r,"resolver",t),u=null===(n=i.result)||void 0===n?void 0:n[0],a=(0,v.uU)(u&&!(0,c.Z)(u)?u:void 0,!1),s=(0,d.Wk)(a,"text",o);return(0,l.useMemo)((()=>{var e;return{avatar:null===(e=s.result)||void 0===e?void 0:e[0],loading:i.loading||s.loading}}),[s.loading,s.result,i.loading])}},17723:(e,n,t)=>{t.d(n,{Z:()=>c});var o=t(3910),r=t(63429),i=t(71233),u=t(90797),d=t(7769),a=t(36099),l=t(45756),s=t(85587);function c(e){var n,t;const c=(0,l.Z)(e,200),v=(0,i.useMemo)((()=>c&&(0,u.UJ)(c)?[(0,o.VM)("".concat(c.toLowerCase().substr(2),".addr.reverse"))]:[void 0]),[c]),m=(0,a.zb)(!1),f=(0,r.Wk)(m,"resolver",v),g=null===(n=f.result)||void 0===n?void 0:n[0],p=(0,a.uU)(g&&!(0,d.Z)(g)?g:void 0,!1),h=(0,r.Wk)(p,"name",v),I=null===(t=h.result)||void 0===t?void 0:t[0],w=(0,s.Z)(I),A=e===(null===w||void 0===w?void 0:w.address)?I:null,k=c!==e;return(0,i.useMemo)((()=>({ENSName:k?null:A,loading:k||f.loading||h.loading})),[k,h.loading,A,f.loading])}},23060:(e,n,t)=>{t.d(n,{Z:()=>u});var o=t(63429),r=t(71233),i=t(36099);function u(e,n,t){const u=(0,i.hV)(),{result:d}=(0,o.Wk)(u,"estimateSwap",[e,n?1:0,t]);return(0,r.useMemo)((()=>!!d&&(null===d||void 0===d?void 0:d.resv)/1e6>=.8),[d])}},47152:(e,n,t)=>{t.d(n,{z:()=>l});var o=t(74970),r=t(90021),i=t(71233),u=t(83937),d=t(64820);const a=20;function l(e,n){const{isLoading:t,error:l,distributions:s}=function(e,n){const t=(0,r.ZP)(),{isLoading:d,error:l,data:s}=(0,u.Z)(null===e||void 0===e?void 0:e.address,null===n||void 0===n?void 0:n.address,3e4),{asToken0:c,asToken1:v,_meta:m}=null!==s&&void 0!==s?s:{};return(0,i.useMemo)((()=>{var e,n;if(!t||!m||!c||!v)return{isLoading:d,error:l};if(t-(null!==(e=null===m||void 0===m||null===(n=m.block)||void 0===n?void 0:n.number)&&void 0!==e?e:0)>a)return{isLoading:d,error:l};const r=c.concat(v).reduce(((e,n)=>{var t,o;return e[n.feeTier][0]=(null!==(t=e[n.feeTier][0])&&void 0!==t?t:0)+Number(n.totalValueLockedToken0),e[n.feeTier][1]=(null!==(o=e[n.feeTier][1])&&void 0!==o?o:0)+Number(n.totalValueLockedToken1),e}),{[o.FeeAmount.LOWEST]:[void 0,void 0],[o.FeeAmount.LOW]:[void 0,void 0],[o.FeeAmount.MEDIUM]:[void 0,void 0],[o.FeeAmount.HIGH]:[void 0,void 0]}),[i,u]=Object.values(r).reduce(((e,n)=>{var t,o;return e[0]+=null!==(t=n[0])&&void 0!==t?t:0,e[1]+=null!==(o=n[1])&&void 0!==o?o:0,e}),[0,0]),s=(e,n,t,o)=>void 0===e&&void 0===t?void 0:((null!==e&&void 0!==e?e:0)+(null!==t&&void 0!==t?t:0))/(n+o)||0,f={[o.FeeAmount.LOWEST]:s(r[o.FeeAmount.LOWEST][0],i,r[o.FeeAmount.LOWEST][1],u),[o.FeeAmount.LOW]:s(r[o.FeeAmount.LOW][0],i,r[o.FeeAmount.LOW][1],u),[o.FeeAmount.MEDIUM]:s(r[o.FeeAmount.MEDIUM][0],i,r[o.FeeAmount.MEDIUM][1],u),[o.FeeAmount.HIGH]:s(r[o.FeeAmount.HIGH][0],i,r[o.FeeAmount.HIGH][1],u)};return{isLoading:d,error:l,distributions:f}}),[m,c,v,d,l,t])}(null===e||void 0===e?void 0:e.wrapped,null===n||void 0===n?void 0:n.wrapped),[c]=(0,d.AI)(e,n,o.FeeAmount.LOWEST),[v]=(0,d.AI)(e,n,o.FeeAmount.LOW),[m]=(0,d.AI)(e,n,o.FeeAmount.MEDIUM),[f]=(0,d.AI)(e,n,o.FeeAmount.HIGH);return(0,i.useMemo)((()=>{var e,n,r,i;if(t||l||!s)return{isLoading:t,isError:!!l,distributions:s};const u=Object.keys(s).map((e=>Number(e))).filter((e=>0!==s[e]&&void 0!==s[e])).reduce(((e,n)=>{var t,o;return(null!==(t=s[e])&&void 0!==t?t:0)>(null!==(o=s[n])&&void 0!==o?o:0)?e:n}),-1),a=t||l||!s||c===d.tK.LOADING||v===d.tK.LOADING||m===d.tK.LOADING||f===d.tK.LOADING?void 0:{[o.FeeAmount.LOWEST]:c===d.tK.EXISTS?100*(null!==(e=s[o.FeeAmount.LOWEST])&&void 0!==e?e:0):void 0,[o.FeeAmount.LOW]:v===d.tK.EXISTS?100*(null!==(n=s[o.FeeAmount.LOW])&&void 0!==n?n:0):void 0,[o.FeeAmount.MEDIUM]:m===d.tK.EXISTS?100*(null!==(r=s[o.FeeAmount.MEDIUM])&&void 0!==r?r:0):void 0,[o.FeeAmount.HIGH]:f===d.tK.EXISTS?100*(null!==(i=s[o.FeeAmount.HIGH])&&void 0!==i?i:0):void 0};return{isLoading:t,isError:!!l,distributions:a,largestUsageFeeTier:-1===u?void 0:u}}),[t,l,s,c,v,m,f])}},31550:(e,n,t)=>{t.d(n,{j:()=>c});var o=t(68466),r=t(28183),i=t(75957),u=t(52389),d=t(2062),a=t(71233),l=t(94232),s=t(10401);function c(){const e=(0,l.T)();return(0,a.useCallback)((async(n,t)=>{const a=(0,o.x0)();return e(s.Dn.pending({requestId:a,url:n})),(0,u.Z)(n,(e=>(0,d.Z)(e,i.v[r.ChainId.ARBITRUM_ONE])),t).then((t=>(e(s.Dn.fulfilled({url:n,tokenList:t,requestId:a})),t))).catch((t=>{throw console.debug("Failed to get list at url ".concat(n),t),e(s.Dn.rejected({url:n,requestId:a,errorMessage:t.message})),t}))}),[e])}},38319:(e,n,t)=>{t.d(n,{J:()=>c});var o=t(48169),r=t(71233),i=t(20221),u=t(55011),d=t(63235),a=t(11744),l=t(63429);const s=new d.vU(a);function c(e){const{chainId:n}=(0,o.gi)(),t=(0,u.uR)(n),d=(0,r.useMemo)((()=>function(e){return Array.from(new Set(e.reduce(((e,n)=>e.concat(n.token0,n.token1)),[])))}(e).filter((e=>!t[e]))),[e,t]),a=(c=d,v="symbol",(0,l._Y)(c,s,v,void 0,l.DB));var c,v;const m=(0,r.useMemo)((()=>{const e={};for(let n=0;n<d.length;n++){const t=a[n].result;if(!t)continue;e[d[n]]=t}return e}),[d,a]);return(0,r.useMemo)((()=>e.filter((e=>{var n,o;let r=0;const u=t[e.token0],d=t[e.token1];if(u&&r++,d&&r++,2===r)return!0;let a=0;return(0,i.P)(null!==(n=null===u||void 0===u?void 0:u.symbol)&&void 0!==n?n:m[e.token0])&&a++,(0,i.P)(null!==(o=null===d||void 0===d?void 0:d.symbol)&&void 0!==o?o:m[e.token1])&&a++,1===r&&a<2||0===a}))),[m,e,t])}},77291:(e,n,t)=>{t.d(n,{Z:()=>c});var o=t(59352),r=t(15281),i=t(18611),u=t(71233),d=t(3910),a=t(63429),l=t(7769),s=t(36099);function c(e){const n=(0,u.useMemo)((()=>e?(0,r.Z)(e):void 0),[e]),t=function(e){var n;const t=(0,u.useMemo)((()=>[e?(0,d.VM)(e):void 0]),[e]),o=(0,s.zb)(!1),r=(0,a.Wk)(o,"resolver",t),i=null===(n=r.result)||void 0===n?void 0:n[0],c=(0,s.uU)(i&&(0,l.Z)(i)?void 0:i,!1),v=(0,a.Wk)(c,"contenthash",t);return(0,u.useMemo)((()=>{var e,n;return{contenthash:null!==(e=null===(n=v.result)||void 0===n?void 0:n[0])&&void 0!==e?e:null,loading:r.loading||v.loading}}),[v.loading,v.result,r.loading])}(null===n||void 0===n?void 0:n.ensName);return(0,u.useMemo)((()=>n?t.contenthash?(0,i.Z)((0,o.Z)(t.contenthash)):[]:e?(0,i.Z)(e):[]),[n,t.contenthash,e])}},38255:(e,n,t)=>{t.d(n,{p:()=>c});var o=t(92837),r=t(83138),i=t(28183),u=t(48169),d=t(44634),a=t.n(d),l=t(53107),s=t(71233);function c(e,n){const[t,d]=(0,s.useState)({value:"",amount:void 0}),{account:c}=(0,u.gi)();let v=(0,l.ZP)(null!==c&&void 0!==c?c:void 0,null!==e&&void 0!==e?e:void 0);v=(0,s.useMemo)((()=>n||v),[v,n]);const[m,f]=(0,s.useMemo)((()=>{const e=t.amount;if(!v||!e)return[!1,o.ag._("Enter an amount")];const n=e.currency;return!e.greaterThan(0)||e.greaterThan(v.asFraction)?[!1,o.ag._("Insufficient {0} balance",{0:n.symbol})]:[!0,void 0]}),[v,t.amount]),g=(0,s.useCallback)((n=>{if(!e)return;const t=function(e,n){if(e&&n)try{const t=(0,r.parseUnits)(e,n.decimals).toString();if("0"!==t)return i.CurrencyAmount.fromRawAmount(n,a().BigInt(t))}catch(t){console.debug('Failed to parse input amount: "'.concat(e,'"'),t)}}(n,e);d({value:n,amount:t||i.CurrencyAmount.fromRawAmount(e,"0")})}),[e]),p=(0,s.useCallback)((e=>{var n;d({value:null!==(n=null===e||void 0===e?void 0:e.toExact())&&void 0!==n?n:"",amount:e})}),[]),h=(0,s.useCallback)((()=>{d({value:"",amount:void 0})}),[]);return(0,s.useMemo)((()=>({inputAmount:t,isInputValid:m,inputError:f,setInputAmount:d,handleUserInput:g,handleMax:p,handleResetInput:h,currency:e})),[e,p,h,g,t,f,m])}},7844:(e,n,t)=>{t.d(n,{Q:()=>r});var o=t(94110);function r(){const{pathname:e}=(0,o.TH)();return e.endsWith("/")}},48444:(e,n,t)=>{t.d(n,{GZ:()=>r});var o=t(94110);function r(){const{pathname:e}=(0,o.TH)();return e.startsWith("/nfts")}},41870:(e,n,t)=>{t.d(n,{G:()=>i});var o=t(71233),r=t(55011);function i(e,n){const t=(0,r.l6)();return(0,o.useMemo)((()=>{if(!t)return!1;const o=Boolean((null===e||void 0===e?void 0:e.isToken)&&t[e.address]),r=Boolean((null===n||void 0===n?void 0:n.isToken)&&t[n.address]);return o||r}),[e,n,t])}},96890:(e,n,t)=>{t.d(n,{Z:()=>d});var o=t(74970),r=t(12492),i=t(71233),u=t(91952);function d(e,n,t){return(0,i.useMemo)((()=>({[u.Mb.LOWER]:e&&n?n===(0,o.nearestUsableTick)(o.TickMath.MIN_TICK,r.L[e]):void 0,[u.Mb.UPPER]:e&&t?t===(0,o.nearestUsableTick)(o.TickMath.MAX_TICK,r.L[e]):void 0})),[e,n,t])}},46232:(e,n,t)=>{t.d(n,{Z:()=>u});var o=t(71233);function r(){return"visibilityState"in document}function i(){return!r()||"hidden"!==document.visibilityState}function u(){const[e,n]=(0,o.useState)(!1),t=(0,o.useCallback)((()=>{n(i())}),[n]);return(0,o.useEffect)((()=>{if(r())return n((()=>i())),document.addEventListener("visibilitychange",t),()=>{document.removeEventListener("visibilitychange",t)}}),[t]),e}},9080:(e,n,t)=>{t.d(n,{Z:()=>r});var o=t(71233);function r(e,n){const[t,r]=(0,o.useState)(e);return(0,o.useEffect)((()=>{r((t=>!n||n(e)?e:t))}),[n,e]),t}},96635:(e,n,t)=>{t.d(n,{O:()=>l});var o=t(43822),r=t(42841),i=t(9842),u=t(71233),d=t(94110),a=t(95323);function l(e){const n=(0,d.TH)(),t=(0,r.Z)(),l=(0,a.eQ)();return(0,u.useMemo)((()=>e?{to:{...n,search:(0,i.stringify)({...t,lng:e})},onClick:()=>{(0,o.qP)({category:"Localization",action:"Switch Locale",label:"".concat(l," -> ").concat(e)})}}:{}),[n,t,l,e])}},85253:(e,n,t)=>{t.d(n,{Z:()=>i});var o=t(2646),r=t(71233);const i=e=>{const[n,t]=(0,r.useState)(Date.now());return(0,o.Z)((0,r.useCallback)((()=>{t(Date.now())}),[]),e),n}},4592:(e,n,t)=>{t.d(n,{S:()=>r});var o=t(71233);function r(e,n){return(0,o.useMemo)((()=>{const t=null===e||void 0===e?void 0:e.maximumAmountIn(n);return null!==t&&void 0!==t&&t.currency.isToken?t:void 0}),[n,e])}},10697:(e,n,t)=>{t.d(n,{t:()=>r});var o=t(71233);function r(e,n){let t=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[];const r=(0,o.useRef)(n);(0,o.useEffect)((()=>{r.current=n}),[n]),(0,o.useEffect)((()=>{const n=n=>{var o,i;const u=null===(o=e.current)||void 0===o?void 0:o.contains(n.target),d=t.reduce(((e,t)=>{var o;return e||!(null===(o=t.current)||void 0===o||!o.contains(n.target))}),!1);null!==(i=u||d)&&void 0!==i&&i||r.current&&r.current()};return document.addEventListener("mousedown",n),()=>{document.removeEventListener("mousedown",n)}}),[e,t])}},42841:(e,n,t)=>{t.d(n,{E:()=>u,Z:()=>d});var o=t(9842),r=t(71233),i=t(94110);function u(e){if(!e){const n=window.location.hash;e=n.substr(n.indexOf("?"))}return e&&e.length>1?(0,o.parse)(e,{parseArrays:!1,ignoreQueryPrefix:!0}):{}}function d(){const{search:e}=(0,i.TH)();return(0,r.useMemo)((()=>u(e)),[e])}},19624:(e,n,t)=>{t.d(n,{K:()=>o});t(82224),t(48169),t(22107),t(57850),t(28183),t(76364),t(36099),t(63429),t(71233),t(5546),t(74180);t(71128),t(2646),t(16337),t(73788);let o=function(e){return e[e.LOADING=0]="LOADING",e[e.REQUIRED=1]="REQUIRED",e[e.ALLOWED=2]="ALLOWED",e}({})},3558:(e,n,t)=>{t.d(n,{K:()=>y});var o=t(28183),r=t(74970),i=t(58231),u=t(14581),d=t(29557),a=t(44634),l=t.n(a),s=t(63429),c=t(71233),v=t(41747),m=t(36099),f=t(64820);const g=8,p=[o.ChainId.MAINNET],h={blocksPerFetch:2},I=(e,n)=>e&&n?Math.floor(e/r.TICK_SPACINGS[n])*r.TICK_SPACINGS[n]:void 0,w=(e,n)=>Math.floor(e/n/256);const A=1e3;function k(e,n,t){const o=!e||!p.includes(e.chainId),a=function(e,n,t){let o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:125;const[u,d]=(0,c.useState)([]),[,a]=(0,f.AI)(e,n,t),v=t&&r.TICK_SPACINGS[t],g=null!==a&&void 0!==a&&a.tickCurrent&&v?(0,r.nearestUsableTick)(null===a||void 0===a?void 0:a.tickCurrent,v):void 0,p=(0,m.U)(),{result:I}=(0,s.Wk)(p,"getPool",(0,c.useMemo)((()=>[null===e||void 0===e?void 0:e.wrapped.address,null===n||void 0===n?void 0:n.wrapped.address,t]),[null===e||void 0===e?void 0:e.wrapped.address,null===n||void 0===n?void 0:n.wrapped.address,t])),A=null===I||void 0===I?void 0:I[0],k=(0,c.useMemo)((()=>v&&g?w(g-o*v,v):void 0),[v,g,o]),y=(0,c.useMemo)((()=>v&&g?w(g+o*v,v):void 0),[v,g,o]),E=(0,c.useMemo)((()=>y&&k&&A&&A!==i.r_?new Array(y-k+1).fill(0).map(((e,n)=>n+k)).map((e=>[A,e])):[]),[k,y,A]),T=(0,m.jT)(),M=(0,s.es)(E.length>0?T:void 0,"getPopulatedTicksInWord",E,h),N=(0,c.useMemo)((()=>M.some((e=>{let{error:n}=e;return n}))),[M]),S=(0,c.useMemo)((()=>M.some((e=>{let{loading:n}=e;return n}))),[M]),b=(0,c.useMemo)((()=>M.some((e=>{let{syncing:n}=e;return n}))),[M]),O=(0,c.useMemo)((()=>M.some((e=>{let{valid:n}=e;return n}))),[M]),L=(0,c.useMemo)((()=>M.map((e=>{let{result:n}=e;return null===n||void 0===n?void 0:n.populatedTicks})).reduce(((e,n)=>{var t;return[...e,...null!==(t=null===n||void 0===n?void 0:n.map((e=>({tick:e.tick,liquidityNet:l().BigInt(e.liquidityNet)}))))&&void 0!==t?t:[]]}),[])),[M]);return(0,c.useEffect)((()=>{d([])}),[e,n,t]),(0,c.useEffect)((()=>{b||S||N||!O||d(L.sort(((e,n)=>e.tick-n.tick)))}),[N,S,b,L,O]),(0,c.useMemo)((()=>({isLoading:S,IsSyncing:b,isError:N,isValid:O,tickData:u})),[S,b,N,O,u])}(o?void 0:e,n,t),[v,g]=(0,c.useState)(0),[I,k]=(0,c.useState)([]),{data:y,error:E,loading:T}=function(e,n,t){let o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0;const r=(0,m.U)(),{result:i}=(0,s.Wk)(r,"getPool",(0,c.useMemo)((()=>[null===e||void 0===e?void 0:e.wrapped.address,null===n||void 0===n?void 0:n.wrapped.address,t]),[null===e||void 0===e?void 0:e.wrapped.address,null===n||void 0===n?void 0:n.wrapped.address,t])),a=null===i||void 0===i?void 0:i[0];return(0,u.K_)({variables:{poolAddress:null===a||void 0===a?void 0:a.toLowerCase(),skip:o},skip:!a,pollInterval:3e4,client:d.l})}(o?e:void 0,n,t,v);return(0,c.useEffect)((()=>{null!==y&&void 0!==y&&y.ticks.length&&(k((e=>[...e,...y.ticks])),y.ticks.length===A&&g((e=>e+A)))}),[null===y||void 0===y?void 0:y.ticks]),{isLoading:o?T||(null===y||void 0===y?void 0:y.ticks.length)===A:a.isLoading,error:o?E:a.isError,ticks:o?I:a.tickData}}function y(e,n,t){const o=(0,f.AI)(e,n,t),i=(0,c.useMemo)((()=>{var e;return I(null===(e=o[1])||void 0===e?void 0:e.tickCurrent,t)}),[o,t]),{isLoading:u,error:d,ticks:a}=k(e,n,t);return(0,c.useMemo)((()=>{var t,s;if(!e||!n||void 0===i||o[0]!==f.tK.EXISTS||!a||0===a.length||u)return{isLoading:u||o[0]===f.tK.LOADING,error:d,activeTick:i,data:void 0};const c=null===e||void 0===e?void 0:e.wrapped,m=null===n||void 0===n?void 0:n.wrapped,p=a.findIndex((e=>{let{tick:n}=e;return n>i}))-1;if(p<0)return console.error("TickData pivot not found"),{isLoading:u,error:d,activeTick:i,data:void 0};const h={liquidityActive:l().BigInt(null!==(t=null===(s=o[1])||void 0===s?void 0:s.liquidity)&&void 0!==t?t:0),tick:i,liquidityNet:Number(a[p].tick)===i?l().BigInt(a[p].liquidityNet):l().BigInt(0),price0:(0,r.tickToPrice)(c,m,i).toFixed(g)},I=(0,v.Z)(c,m,h,a,p,!0),w=(0,v.Z)(c,m,h,a,p,!1).concat(h).concat(I);return{isLoading:u,error:d,activeTick:i,data:w}}),[e,n,i,o,a,u,d])}},64820:(e,n,t)=>{t.d(n,{AI:()=>h,Oh:()=>g,hl:()=>p,tK:()=>f});var o=t(63235),r=t(40409),i=t(74970),u=t(48169),d=t(44634),a=t.n(d),l=t(63429),s=t(71233),c=t(36099);const v=new o.vU(r.Mt);class m{static getPoolAddress(e,n,t,o){this.addresses.length>this.MAX_ENTRIES&&(this.addresses=this.addresses.slice(0,this.MAX_ENTRIES/2));const{address:r}=n,{address:u}=t,d="".concat(e,":").concat(r,":").concat(u,":").concat(o.toString()),a=this.addresses.find((e=>e.key===d));if(a)return a.address;const l={key:d,address:(0,i.computePoolAddress)({factoryAddress:e,tokenA:n,tokenB:t,fee:o,initCodeHashManualOverride:"0xd9872f794c7ba9ef2ce4eacd935211fad96918e060136bd1e093981146122542"})};return this.addresses.unshift(l),l.address}static getPool(e,n,t,o,r,u){this.pools.length>this.MAX_ENTRIES&&(this.pools=this.pools.slice(0,this.MAX_ENTRIES/2));const d=this.pools.find((i=>i.token0===e&&i.token1===n&&i.fee===t&&a().EQ(i.sqrtRatioX96,o)&&a().EQ(i.liquidity,r)&&i.tickCurrent===u));if(d)return d;const l=new i.Pool(e,n,t,o,r,u);return this.pools.unshift(l),l}}m.MAX_ENTRIES=128,m.pools=[],m.addresses=[];let f=function(e){return e[e.LOADING=0]="LOADING",e[e.NOT_EXISTS=1]="NOT_EXISTS",e[e.EXISTS=2]="EXISTS",e[e.INVALID=3]="INVALID",e}({});function g(e){const{chainId:n}=(0,u.gi)(),t=(0,c.U)(),o=(0,s.useMemo)((()=>n?e.map((e=>{let[n,t,o]=e;if(n&&t&&o){const e=n.wrapped,r=t.wrapped;if(e.equals(r))return;return e.sortsBefore(r)?[e,r,o]:[r,e,o]}})):new Array(e.length)),[n,e]),r=(0,s.useMemo)((()=>o.map((e=>e?[e[0].address,e[1].address,e[2].toFixed()]:[void 0]))),[o]),i=(0,l.es)(t,"getPool",r),d=(0,s.useMemo)((()=>i.reduce(((e,n)=>{var t;return e.push(null===n||void 0===n||null===(t=n.result)||void 0===t?void 0:t[0]),e}),[])),[i]),a=(0,l._Y)(d,v,"slot0"),g=(0,l._Y)(d,v,"liquidity");return(0,s.useMemo)((()=>e.map(((e,n)=>{const t=o[n];if(!t)return[f.INVALID,null];const[r,i,u]=t;if(!a[n])return[f.INVALID,null];const{result:d,loading:l,valid:s}=a[n];if(!g[n])return[f.INVALID,null];const{result:c,loading:v,valid:p}=g[n];if(!t||!s||!p)return[f.INVALID,null];if(l||v)return[f.LOADING,null];if(!d||!c)return[f.NOT_EXISTS,null];if(!d.sqrtPriceX96||d.sqrtPriceX96.eq(0))return[f.NOT_EXISTS,null];try{const e=m.getPool(r,i,u,d.sqrtPriceX96,c[0],d.tick);return[f.EXISTS,e]}catch(h){return console.error("Error when constructing the pool",h),[f.NOT_EXISTS,null]}}))),[g,e,a,o])}function p(e){const{chainId:n}=(0,u.gi)(),t=(0,c.U)(),o=(0,s.useMemo)((()=>n?e.map((e=>{let[n,t,o]=e;if(n&&t&&o){const e=n.wrapped,r=t.wrapped;if(e.equals(r))return;return e.sortsBefore(r)?[e,r,o]:[r,e,o]}})):new Array(e.length)),[n,e]),r=(0,s.useMemo)((()=>o.map((e=>e?[e[0].address,e[1].address,e[2].toFixed()]:[void 0]))),[o]),i=(0,l.es)(t,"getPool",r),d=(0,s.useMemo)((()=>i.reduce(((e,n)=>{var t;return e.push(null===n||void 0===n||null===(t=n.result)||void 0===t?void 0:t[0]),e}),[])),[i]),a=(0,l._Y)(d,v,"slot0"),g=(0,l._Y)(d,v,"liquidity");return(0,s.useMemo)((()=>e.map(((e,n)=>{const t=o[n];if(!t)return[f.INVALID,null];const[r,i,u]=t,l=d[n];if(!a[n]||!l)return[f.INVALID,null];const{result:s,loading:c,valid:v}=a[n];if(!g[n])return[f.INVALID,null];const{result:p,loading:h,valid:I}=g[n];if(!t||!v||!I)return[f.INVALID,null];if(c||h)return[f.LOADING,null];if(!s||!p)return[f.NOT_EXISTS,null];if(!s.sqrtPriceX96||s.sqrtPriceX96.eq(0))return[f.NOT_EXISTS,null];try{const e=m.getPool(r,i,u,s.sqrtPriceX96,p[0],s.tick);return[f.EXISTS,{pool:e,poolAddr:l}]}catch(w){return console.error("Error when constructing the pool",w),[f.NOT_EXISTS,null]}}))),[e,o,d,a,g])}function h(e,n,t){return g((0,s.useMemo)((()=>[[e,n,t]]),[e,n,t]))[0]}},9509:(e,n,t)=>{t.d(n,{K:()=>s});var o=t(38935),r=t(71233),i=t(3758),u=t(45756),d=t(87774);const a=350,l=650;function s(e,n){const t=(0,o.R)()===o.M.Enabled,[s,c]=(0,u.Z)((0,r.useMemo)((()=>[e,n]),[e,n]),t?l:a),{loading:v,pool:m}=function(e,n){const{pools:t,loading:o}=(0,d._)(e,n),u=(0,r.useMemo)((()=>{if(t&&0!==t.length)return t.reduce(((e,n)=>((0,i.BN)(n.pool.liquidity.toString()).gt(e.maxLiquidity)&&(e.maxLiquidity=(0,i.BN)(n.pool.liquidity.toString()),e.pool=n),e)),{maxLiquidity:(0,i.BN)(0),pool:void 0})}),[t]);return(0,r.useMemo)((()=>({loading:o,pool:null===u||void 0===u?void 0:u.pool})),[null===u||void 0===u?void 0:u.pool,o])}(s,c);return(0,r.useMemo)((()=>({isLoading:v,...m})),[v,m])}},23170:(e,n,t)=>{t.d(n,{Z:()=>r});var o=t(71233);function r(e){const n=(0,o.useRef)();return(0,o.useEffect)((()=>{n.current=e}),[e]),n.current}},67051:(e,n,t)=>{t.d(n,{S:()=>m});var o,r=t(30168),i=t(4657),u=t(28183),d=t(48169),a=t(12977),l=t(49200),s=t(71233),c=t(3758);const v=(0,l.ZP)(o||(o=(0,r.Z)(["\n  {\n    bundles {\n      ethPriceUSD\n    }\n    pools (where:{maxLevleage_gt:1} orderBy:totalValueLockedUSD,orderDirection:desc) {\n      maxLevleage\n      id\n      totalValueLockedUSD\n      tradePool\n      feeTier\n      sqrtPrice\n      sizeLong\n      sizeShort\n      token0Price\n      poolDayData(first: 1, orderBy: date, orderDirection: desc) {\n        close\n      }\n      token0 {\n        id\n        decimals\n        symbol\n        name\n        derivedETH\n      }\n      token1 {\n        id\n        decimals\n        symbol\n        name\n        derivedETH\n      }\n    }\n  }\n"]))),m=()=>{const{chainId:e}=(0,d.gi)(),{data:n}=(()=>{const{data:e,loading:n,error:t}=(0,a.eE)((0,i.a)(v),a.u8.LightningMcQueen);return(0,s.useMemo)((()=>({error:t,isLoading:n,data:e})),[e,t,n])})();return(0,s.useMemo)((()=>{var t;if(!e||!n)return;const o=null===(t=n.bundles[0])||void 0===t?void 0:t.ethPriceUSD;return null===n||void 0===n?void 0:n.pools.reduce(((n,t)=>{var r,i,d;const a=Number(t.sizeShort)<=0||0==Number(t.token0Price)?0:1/Number(t.token0Price)*Number(t.sizeShort)*Math.pow(10,t.token1.decimals)/Math.pow(10,t.token0.decimals),l=0===Number(t.token0Price)||0===Number(null===(r=t.poolDayData)||void 0===r?void 0:r[0].close),s=(0,c.BN)(1).div(t.token0Price).minus((0,c.BN)(1).div(null===(i=t.poolDayData)||void 0===i?void 0:i[0].close)).div((0,c.BN)(1).div(null===(d=t.poolDayData)||void 0===d?void 0:d[0].close)).times(100);return n[t.id]={maxLevleage:t.maxLevleage,totalValueLockedUSD:t.totalValueLockedUSD,token0:new u.Token(e,t.token0.id,Number(t.token0.decimals),t.token0.symbol,t.token0.name),token1:new u.Token(e,t.token1.id,Number(t.token1.decimals),t.token1.symbol,t.token1.name),id:t.id,sqrtPrice:t.sqrtPrice,ethPriceUSD:o,fee:new u.Percent(t.feeTier,1e6),feeTier:Number(t.feeTier),tradePool:t.tradePool,sizeLong:Number(t.sizeLong)<=0?"0":(0,c.BN)(t.sizeLong).toString(),sizeShort:a.toString(),change:l||s.isNaN()?"0.00":s.toFixed(2)},n}),{})}),[e,n])}},72248:(e,n,t)=>{t.d(n,{G_:()=>h,M8:()=>v,Ms:()=>g,R6:()=>w,WN:()=>f,cM:()=>I,eo:()=>p,w2:()=>c,w_:()=>m});var o,r=t(30168),i=t(4657),u=t(12977),d=t(49200),a=t(71233),l=t(77537);const s=(0,d.ZP)(o||(o=(0,r.Z)(['\n  query AllData($weeklyId: String!) {\n    bundles {\n      ethPriceUSD\n      totalDepositedUSDAmount\n    }\n    activePositions(where:{active:true}){\n      entry0Price\n      entry1Price\n      hasProfit\n      v3Pool{\n      token0{\n        id\n        symbol\n        decimals\n        name\n        derivedETH\n      }\n      token1{\n        id\n        symbol\n        name\n        decimals\n        derivedETH\n      }\n    }\n    prepPool{\n      adlLong0\n      adlLong1\n      tPidLong0\n      tPidLong1\n    }\n    entryPos\n    key\n    spotPoolAddress\n    prepPoolAddress\n    size\n    long0\n    collateral\n    reserve\n    liqResv\n  }\n  increaseOrders (where:{executed:false,cancelled:false}){\n    id\n    spotpool\n    account\n    perpPool\n    token0{\n      id\n      symbol\n      decimal\n      name\n    }\n    token1{\n      id\n      symbol\n      decimal\n      name\n    }\n    key\n    collateralIn\n    executionFee\n    sizeDelta\n    long0\n    triggerAboveThreshold\n    shouldWarp\n    triggerPrice\n    executed\n    cancelled\n  }\n  decreaseOrders(where:{executed:false,cancelled:false}){\n    id\n    spotpool\n    account\n    perpPool\n   token0{\n      id\n      symbol\n      decimal\n      name\n    }\n    token1{\n      id\n      symbol\n      decimal\n      name\n    }\n    key\n    sizeDelta\n    collateralDelta\n    executionFee\n    long0\n    triggerAboveThreshold\n    shouldWarp\n    triggerPrice\n    executed\n    cancelled\n  }\n\n    totalVoteds(where: { weeklyId: $weeklyId }) {\n      totalVoted\n    }\n    prepFeeTotals(where:{ weeklyId: $weeklyId }){\n      feeUSD\n    }\n    spotFeeTotals(where:{ weeklyId: $weeklyId }){\n      feeUSD\n    }\n\n    factories {\n      totalFeesUSD\n    }\n    token(id: "','") {\n      derivedETH\n    }\n    tokens {\n      name\n      id\n      symbol\n      decimals\n      derivedETH\n      valueUSD\n      shit\n    }\n    gauges {\n      weeklyVotedTotal(where: { weeklyId: $weeklyId }) {\n        totalVoted\n      }\n      maxLevleage\n      lpAddr\n      poolFee\n      hypervisor {\n        hypervisorAddress\n        share\n        depositedToken0Amount\n        depositedToken1Amount\n        depositedUSDAmount\n      }\n      masterChef {\n        masterChefAddress\n      }\n      PoolVolume(first:1000,where: { weeklyId: $weeklyId }, orderBy: swapVolume, orderDirection: desc) {\n        weeklyId\n        poolAddress\n        swapVolume\n        perpVolume\n        totalValume\n        swapedUser(first:1000,where: { weeklyId: $weeklyId }, orderBy: swapVolume, orderDirection: desc) {\n          userAddress\n          swapVolume\n          perpVolume\n          totalValume\n        }\n      }\n      token0 {\n        id\n        symbol\n        decimals\n        name\n        derivedETH\n        valueUSD\n        shit\n      }\n      token1 {\n        id\n        symbol\n        name\n        decimals\n        derivedETH\n        valueUSD\n        shit\n      }\n      swapMinning {\n        swapMinningAddress\n        feeReward(where: { weeklyId: $weeklyId }) {\n          tokenInfo {\n            id\n            symbol\n            decimals\n            derivedETH\n            valueUSD\n            shit\n          }\n          rewardAmount\n        }\n        bribeReward(where: { weeklyId: $weeklyId }) {\n          tokenInfo {\n            id\n            symbol\n            decimals\n            derivedETH\n            valueUSD\n            shit\n          }\n          rewardAmount\n        }\n      }\n      votingReward {\n        VotingRewardAddress\n        feeReward(where: { weeklyId: $weeklyId }) {\n          tokenInfo {\n            id\n            symbol\n            decimals\n            derivedETH\n            valueUSD\n            shit\n          }\n          rewardAmount\n        }\n        bribeReward(where: { weeklyId: $weeklyId }) {\n          rewardAmountUSD\n          tokenInfo {\n            id\n            symbol\n            decimals\n            derivedETH\n            valueUSD\n            shit\n          }\n          rewardAmount\n        }\n      }\n      feeReward(where: { weeklyId: $weeklyId }) {\n        tokenInfo {\n          id\n          symbol\n          decimals\n          derivedETH\n          valueUSD\n          shit\n        }\n        rewardAmount\n      }\n      bribeReward(where: { weeklyId: $weeklyId }) {\n        tokenInfo {\n          id\n          symbol\n          decimals\n          derivedETH\n          valueUSD\n          shit\n        }\n        rewardAmount\n      }\n    }\n  }\n'])),"0x03ac42e4f1824ccf78c3f31cbf590a7f2bf836f4"),c=()=>{const e=(0,l.AP)(),{data:n,loading:t,error:o}=(0,u.eE)((0,i.a)(s,{variables:{weeklyId:e.toFixed()}}),u.u8.Lowspeed);return(0,a.useMemo)((()=>({error:o,isLoading:t,data:n})),[n,o,t])},v=()=>{const e=(0,l.gI)();return(0,a.useMemo)((()=>{var n;return null===e||void 0===e||null===(n=e.bundles[0])||void 0===n?void 0:n.totalDepositedUSDAmount}),[e])},m=()=>{const e=(0,l.gI)();return(0,a.useMemo)((()=>{var n,t;return Number((null===e||void 0===e||null===(n=e.prepFeeTotals[0])||void 0===n?void 0:n.feeUSD)||0)+Number((null===e||void 0===e||null===(t=e.spotFeeTotals[0])||void 0===t?void 0:t.feeUSD)||0)}),[e])},f=()=>{const e=(0,l.gI)();return(0,a.useMemo)((()=>{var n;return null===e||void 0===e||null===(n=e.bundles[0])||void 0===n?void 0:n.ethPriceUSD}),[e])},g=()=>{const e=(0,l.gI)();return(0,a.useMemo)((()=>null===e||void 0===e?void 0:e.tokens),[e])},p=()=>{const e=(0,l.gI)();return(0,a.useMemo)((()=>null===e||void 0===e?void 0:e.tokens.reduce(((e,n)=>(e[n.id.toLocaleLowerCase()]=n,e)),{})),[e])},h=()=>{const e=(0,l.gI)();return(0,a.useMemo)((()=>{var n;return null===e||void 0===e||null===(n=e.token)||void 0===n?void 0:n.derivedETH}),[e])},I=()=>{const e=(0,l.gI)();return(0,a.useMemo)((()=>{if(!e)return;return[...e.increaseOrders,...e.decreaseOrders]}),[e])},w=()=>{const e=(0,l.gI)();return(0,a.useMemo)((()=>{if(!e)return;return e.activePositions}),[e])}},24634:(e,n,t)=>{t.d(n,{O:()=>l});var o,r=t(30168),i=t(4657),u=t(48169),d=t(49200),a=t(71233);const l=()=>{const{data:e,isLoading:n,error:t}=(()=>{const{account:e}=(0,u.gi)(),n=(0,d.ZP)(o||(o=(0,r.Z)(['\n    {\n      userVoteds(where: { voter: "','" }) {\n        voter\n        votedPool {\n          lpAddr\n          poolFee\n          token0 {\n            id\n            symbol\n          }\n          token1 {\n            id\n            symbol\n          }\n          hypervisor {\n            depositedToken0Amount\n            depositedToken1Amount\n            depositedUSDAmount\n          }\n        }\n        tokenId\n        weight\n      }\n    }\n  '])),null===e||void 0===e?void 0:e.toLowerCase()),{data:t,loading:l,error:s}=(0,i.a)(n);return(0,a.useMemo)((()=>({error:s,isLoading:l,data:t})),[t,s,l])})();return(0,a.useMemo)((()=>{if(!t)return{voteRewards:{data:e||[],isLoading:n}}}),[e,t,n])}},36090:(e,n,t)=>{t.d(n,{e:()=>a});var o=t(71233),r=t(6042);const i="undefined"!==typeof window,u={...r.j$,navSearchInputVisible:1100};function d(){return Object.keys(u).reduce(((e,n)=>Object.assign(e,{[n]:!!i&&window.innerWidth>=u[n]})),{})}function a(){const[e,n]=(0,o.useState)(d());return(0,o.useEffect)((()=>{function e(){n(d())}if(i)return window.addEventListener("resize",e),()=>{window.removeEventListener("resize",e)}}),[]),e}},96528:(e,n,t)=>{t.d(n,{ZP:()=>c,cM:()=>m,sq:()=>v});var o=t(28183),r=t(48169),i=t(24177),u=t(71233),d=t(30875),a=t(95709),l=t(5331);const s={[o.ChainId.MAINNET]:o.CurrencyAmount.fromRawAmount(l.Hz,1e11),[o.ChainId.ARBITRUM_ONE]:o.CurrencyAmount.fromRawAmount(l.dt,1e10),[o.ChainId.OPTIMISM]:o.CurrencyAmount.fromRawAmount(l.V6,1e22),[o.ChainId.POLYGON]:o.CurrencyAmount.fromRawAmount(l.QF,1e10),[o.ChainId.CELO]:o.CurrencyAmount.fromRawAmount(l.Kq,1e22),[o.ChainId.BNB]:o.CurrencyAmount.fromRawAmount(l.rU,1e20),[o.ChainId.AVALANCHE]:o.CurrencyAmount.fromRawAmount(l.N0,1e10)};function c(e){const n=null===e||void 0===e?void 0:e.chainId,t=n?s[n]:void 0,r=null===t||void 0===t?void 0:t.currency,{trade:i}=(0,a.d)(o.TradeType.EXACT_OUTPUT,t,e,d.wi),l=(0,u.useMemo)((()=>{if(e&&r){if(null!==e&&void 0!==e&&e.wrapped.equals(r))return new o.Price(r,r,"1","1");if(i){const{numerator:n,denominator:t}=i.routes[0].midPrice;return new o.Price(e,r,t,n)}}}),[e,r,i]),c=(0,u.useRef)(l);return l&&c.current&&l.equalTo(c.current)&&l.baseCurrency.equals(c.current.baseCurrency)||(c.current=l),c.current}function v(e){const n=c(null===e||void 0===e?void 0:e.currency);return(0,u.useMemo)((()=>{if(!n||!e)return null;try{return n.quote(e)}catch(t){return null}}),[e,n])}function m(e){var n;const{chainId:t}=(0,r.gi)(),o=t?null===(n=s[t])||void 0===n?void 0:n.currency:void 0;return(0,u.useMemo)((()=>{if(null===e||void 0===e||!t||!o)return;const n=e.toFixed(o.decimals).toString();try{return(0,i.Z)(n,o)}catch(r){return}}),[t,e,o])}},34310:(e,n,t)=>{t.d(n,{o:()=>E});var o=t(28183),r=t(48169),i=t(71233),u=t(98475),d=t(42522),a=t(73788),l=t(33953),s=t(92837),c=t(74970),v=t(29228),m=t(16337),f=t(4986),g=t(65155),p=t(5546),h=t(7769),I=t(74180),w=t(18385);class A extends Error{constructor(){super(s.ag._("Your swap is expected to fail."))}}class k extends Error{constructor(){super(s.ag._("Your swap was modified through your wallet. If this was a mistake, please cancel immediately or risk losing your funds."))}}function y(e,n){const{account:t,chainId:o}=(0,r.gi)(),u=(0,r.fr)(),d=function(e,n){const{account:t,chainId:o,provider:u}=(0,r.gi)(),d=t,a=(0,l.Z)(),s=(0,w.Z)();return(0,i.useMemo)((()=>{if(!e||!d||!u||!t||!o||!a)return[];const r=v.Cu[o];if(!r)return[];const{value:i,calldata:l}=c.SwapRouter.swapCallParameters(e,{recipient:d,slippageTolerance:n,deadline:a.toString()});return s&&e.inputAmount.currency.isToken&&r?[{address:s.address,calldata:s.interface.encodeFunctionData("wc_multiCall",[[{to:r,value:i.toString(),data:l}]]),value:"0x0"}]:[{address:r,calldata:l,value:i}]}),[t,n,s,o,a,u,d,e])}(n,e);return(0,i.useCallback)((async()=>(0,f.g)("swap.send",(async e=>{let{setTraceStatus:r,setTraceError:i}=e;try{if(!t)throw new Error("missing account");if(!o)throw new Error("missing chainId");if(!u)throw new Error("missing provider");if(!n)throw new Error("missing trade");const e=await Promise.all(d.map((e=>{const{address:n,calldata:o,value:r}=e,i=!r||(0,h.Z)(r)?{from:t,to:n,data:o}:{from:t,to:n,data:o,value:r};return u.estimateGas(i).then((n=>({call:e,gasEstimate:n}))).catch((n=>(console.debug("Gas estimate failed, trying eth_call to extract error",e),u.call(i).then((t=>(console.debug("Unexpected successful call after failed estimate gas",e,n,t),{call:e,error:new Error("Unexpected issue with estimating the gas. Please try again.")}))).catch((n=>(console.debug("Call threw error",e,n),{call:e,error:new Error((0,I.m)(n))}))))))})));let r=e.find(((e,n,t)=>"gasEstimate"in e&&(n===t.length-1||"gasEstimate"in t[n+1])));if(!r){const n=e.filter((e=>"error"in e));if(n.length>0)throw n[n.length-1].error;const t=e.find((e=>!("error"in e)));if(!t)throw new Error("Unexpected error. Could not estimate gas for the swap.");r=t}const{call:{address:i,calldata:a,value:l}}=r,s=await u.getSigner().sendTransaction({from:t,to:i,data:a,..."gasEstimate"in r?{gasLimit:(0,g.y)(r.gasEstimate)}:{},...l&&!(0,h.Z)(l)?{value:l}:{}});return{type:m.d7.Classic,response:s}}catch(a){if(console.log("[swapError]:",a),a instanceof k)throw a;if(a instanceof A||i(a),(0,I.J)(a))throw r("cancelled"),new p.a((0,I.m)(a));throw new Error((0,I.m)(a))}}))),[t,o,u,d,n])}function E(e,n,t,s,c){const v=(0,l.Z)(),m=(0,a.h7)(),{account:f,chainId:g}=(0,r.gi)(),p=y(t,c);return(0,i.useCallback)((async()=>{if(!e)throw new Error("missing trade");if(!f||!g)throw new Error("wallet must be connected to swap");const n=await p(),r={type:u.i.SWAP,inputCurrencyId:(0,d.H)(e.inputAmount.currency),outputCurrencyId:(0,d.H)(e.outputAmount.currency),isUniswapXOrder:!1,...e.tradeType===o.TradeType.EXACT_INPUT?{tradeType:o.TradeType.EXACT_INPUT,inputCurrencyAmountRaw:e.inputAmount.quotient.toString(),expectedOutputCurrencyAmountRaw:e.outputAmount.quotient.toString(),minimumOutputCurrencyAmountRaw:e.minimumAmountOut(t).quotient.toString()}:{tradeType:o.TradeType.EXACT_OUTPUT,maximumInputCurrencyAmountRaw:e.maximumAmountIn(t).quotient.toString(),outputCurrencyAmountRaw:e.outputAmount.quotient.toString(),expectedInputCurrencyAmountRaw:e.inputAmount.quotient.toString()}};return m(n.response,r,null===v||void 0===v?void 0:v.toNumber()),n}),[f,m,t,g,v,e,p])}},71011:(e,n,t)=>{t.d(n,{Z:()=>r});var o=t(71233);function r(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];const[n,t]=(0,o.useState)(e),r=(0,o.useCallback)((()=>t((e=>!e))),[]);return[n,r]}},71128:(e,n,t)=>{t.d(n,{Fx:()=>d});t(95744);var o=t(28183),r=(t(15020),t(36099)),i=t(63429),u=t(71233);t(98475),t(5546),t(74180);o.MaxUint256.toString();function d(e,n,t){const d=(0,r.Ib)(null===e||void 0===e?void 0:e.address,!1),a=(0,u.useMemo)((()=>[n,t]),[n,t]),[l,s]=(0,u.useState)(),{result:c,syncing:v}=(0,i.Wk)(d,"allowance",a,{blocksPerFetch:l}),m=null===c||void 0===c?void 0:c.toString(),f=(0,u.useMemo)((()=>e&&m?o.CurrencyAmount.fromRawAmount(e,m):void 0),[e,m]);return(0,u.useEffect)((()=>s(null!==f&&void 0!==f&&f.equalTo(0)?1:void 0)),[f]),(0,u.useMemo)((()=>({tokenAllowance:f,isSyncing:v})),[f,v])}},18093:(e,n,t)=>{t.d(n,{W:()=>u});var o=t(48169),r=t(71233),i=t(30185);function u(e){const{chainId:n}=(0,o.gi)(),t=(0,i.z0)();return(0,r.useMemo)((()=>{if(n){if(e.isNative)return e;try{return t[n][e.wrapped.address].token}catch(o){return e}}}),[t,n,e])}},9694:(e,n,t)=>{t.d(n,{A:()=>i,g:()=>u});var o=t(98985),r=t(34728);const i=e=>{const n=(0,o.useTheme)();switch(e){case r.go.MEDIUM:return n.accentWarning;case r.go.UNKNOWN:return n.accentFailure;case r.go.BLOCKED:return n.textSecondary}},u=e=>{const n=(0,o.useTheme)();switch(e){case r.go.MEDIUM:return n.backgroundFloating;case r.go.UNKNOWN:return n.accentFailureSoft;case r.go.BLOCKED:return n.backgroundFloating}}},42568:(e,n,t)=>{t.d(n,{A:()=>d});var o=t(28183),r=t(63429),i=t(71233),u=t(36099);function d(e){var n,t,d;const a=(0,u.Ib)(null!==e&&void 0!==e&&e.isToken?e.address:void 0,!1),l=null===(n=(0,r.Wk)(a,"totalSupply"))||void 0===n||null===(t=n.result)||void 0===t||null===(d=t[0])||void 0===d?void 0:d.toString();return(0,i.useMemo)((()=>null!==e&&void 0!==e&&e.isToken&&l?o.CurrencyAmount.fromRawAmount(e,l):void 0),[e,l])}},33953:(e,n,t)=>{t.d(n,{Z:()=>l});var o=t(48169),r=t(73304),i=t(58231),u=t(71233),d=t(94232),a=t(45983);function l(){const{chainId:e}=(0,o.gi)(),n=(0,d.C)((e=>e.user.userDeadline)),t=(0,a.Z)();return(0,u.useMemo)((()=>t&&e&&r.Ny.includes(e)?t.add(i.Es):t&&n?t.add(n):void 0),[t,e,n])}},82601:(e,n,t)=>{t.d(n,{L:()=>f});var o=t(16073),r=t(28183),i=t(5331),u=t(13746),d=t(12977),a=t(30875),l=t(16337),s=t(95709),c=t(54106),v=t(96528);const m={[r.ChainId.MAINNET]:r.CurrencyAmount.fromRawAmount((0,i.gX)(r.ChainId.MAINNET),5e19),[r.ChainId.ARBITRUM_ONE]:r.CurrencyAmount.fromRawAmount((0,i.gX)(r.ChainId.ARBITRUM_ONE),1e19),[r.ChainId.OPTIMISM]:r.CurrencyAmount.fromRawAmount((0,i.gX)(r.ChainId.OPTIMISM),1e19),[r.ChainId.POLYGON]:r.CurrencyAmount.fromRawAmount((0,i.gX)(r.ChainId.POLYGON),1e22),[r.ChainId.CELO]:r.CurrencyAmount.fromRawAmount((0,i.gX)(r.ChainId.CELO),1e19)};function f(e){var n,t,f,g,p;const h=null!==e&&void 0!==e&&e.currency.chainId?(0,d.Ld)(null===e||void 0===e?void 0:e.currency.chainId):void 0,I=null===e||void 0===e?void 0:e.currency,{data:w,isLoading:A}=function(e){var n;const t=null===e||void 0===e||null===(n=e.currency)||void 0===n?void 0:n.chainId,o=(0,d.bx)(t)?m[t]:void 0,{trade:u,state:c}=(0,s.d)(r.TradeType.EXACT_OUTPUT,o,null===e||void 0===e?void 0:e.currency,a.wi);if(t&&e&&e.currency.wrapped.equals((0,i.gX)(t).wrapped))return{data:new r.Price(e.currency,e.currency,"1","1").quote(e),isLoading:!1};if(!u||c===l.qx.LOADING||null===e||void 0===e||!e.currency||!(0,d.bx)(t))return{data:void 0,isLoading:c===l.qx.LOADING};const{numerator:v,denominator:f}=u.routes[0].midPrice;return{data:new r.Price(null===e||void 0===e?void 0:e.currency,(0,i.gX)(t),f,v).quote(e),isLoading:!1}}(e),{data:k,networkStatus:y}=(0,u.Dw)({variables:{chain:null!==h&&void 0!==h?h:u.qo.Ethereum,address:(0,c.P)(null!==h&&void 0!==h?h:u.qo.Ethereum)},skip:!h||!(0,d.bx)(null===I||void 0===I?void 0:I.chainId),pollInterval:d.u8.Normal,notifyOnNetworkStatusChange:!0,fetchPolicy:"cache-first"}),E=(0,v.ZP)((0,d.bx)(null===I||void 0===I?void 0:I.chainId)?void 0:I);if(!(0,d.bx)(null===I||void 0===I?void 0:I.chainId)&&e&&E)return{data:parseFloat(E.quote(e).toSignificant()),isLoading:!1};const T=y===o.I.loading,M=null===k||void 0===k||null===(n=k.token)||void 0===n||null===(t=n.project)||void 0===t||null===(f=t.markets)||void 0===f||null===(g=f[0])||void 0===g||null===(p=g.price)||void 0===p?void 0:p.value;return M&&w?{data:parseFloat(w.toExact())*M,isLoading:!1}:{data:void 0,isLoading:A||T}}},51932:(e,n,t)=>{t.d(n,{o:()=>r});var o=t(71233);function r(e,n,t){let r=arguments.length>3&&void 0!==arguments[3]&&arguments[3];(0,o.useEffect)((()=>{var o;const i=e.current,u=null!==(o=null===t||void 0===t?void 0:t.map((e=>e.current)))&&void 0!==o?o:[i],d=null===i||void 0===i?void 0:i.parentElement,a=null===d||void 0===d?void 0:d.removeChild;if(d&&a&&!r)return d.removeChild=function(e){if(e===i&&u){u.forEach((e=>null===e||void 0===e?void 0:e.classList.add(n())));const t=u.find((e=>function(e){var n,t;return(null!==(n=null===e||void 0===e||null===(t=e.getAnimations)||void 0===t?void 0:t.call(e).length)&&void 0!==n?n:0)>0}(null!==e&&void 0!==e?e:void 0)));return t?null===t||void 0===t||t.addEventListener("animationend",(n=>{n.target===t&&a.call(d,e)})):a.call(d,e),e}return a.call(d,e)},()=>{d.removeChild=a}}),[t,n,e,r])}},95040:(e,n,t)=>{t.d(n,{t:()=>c});var o=t(96812),r=t(28183),i=t(48169),u=t(75073),d=t(63429),a=t(71233),l=t(77867),s=t(36099);o.O$.from(2).pow(128).sub(1);function c(e,n){let t=arguments.length>2&&void 0!==arguments[2]&&arguments[2];(0,s.GL)(!1);const{account:o}=(0,i.gi)(),c=(0,s.U)(),{result:v}=(0,d.Wk)(c,"getPool",[null===e||void 0===e?void 0:e.token0.address,null===e||void 0===e?void 0:e.token1.address,null===e||void 0===e?void 0:e.fee]),m=(0,s.A6)(null===v||void 0===v?void 0:v[0]),{result:f}=(0,d.Wk)(m,"roxPosnPool"),g=(0,s.bM)(null===f||void 0===f?void 0:f[0]),p=(0,a.useMemo)((()=>{if(n&&o)return((e,n,t)=>(0,u.keccak256)((0,u.solidityPack)(["address","int24","int24"],[e,n,t])))(o,n.tickLower,n.tickUpper)}),[n,o]),{result:h}=(0,d.Wk)(g,"pendingFee",[p]),I=(0,a.useMemo)((()=>{if(h)return{perpFeeOwed0:h.perpFeeOwed0,perpFeeOwed1:h.perpFeeOwed1,spotFeeOwed0:h.spotFeeOwed0,spotFeeOwed1:h.spotFeeOwed1,totalFeeO:h.perpFeeOwed0.add(h.spotFeeOwed0),totalFee1:h.perpFeeOwed1.add(h.spotFeeOwed1)}}),[h]);return e&&I?[r.CurrencyAmount.fromRawAmount(t?e.token0:(0,l.B)(e.token0),I.totalFeeO.toString()),r.CurrencyAmount.fromRawAmount(t?e.token1:(0,l.B)(e.token1),I.totalFee1.toString()),r.CurrencyAmount.fromRawAmount(t?e.token0:(0,l.B)(e.token0),I.spotFeeOwed0.toString()),r.CurrencyAmount.fromRawAmount(t?e.token1:(0,l.B)(e.token1),I.spotFeeOwed1.toString()),r.CurrencyAmount.fromRawAmount(t?e.token0:(0,l.B)(e.token0),I.perpFeeOwed0.toString()),r.CurrencyAmount.fromRawAmount(t?e.token1:(0,l.B)(e.token1),I.perpFeeOwed1.toString())]:[void 0,void 0,void 0,void 0,void 0,void 0]}},1588:(e,n,t)=>{t.d(n,{WW:()=>v,nq:()=>c,vN:()=>m});var o=t(63235),r=t(96812),i=t(73029),u=(t(48169),t(63429)),d=t(71233),a=t(87164),l=t(36099);new o.vU(i.abi);function s(e){const n=(0,l.GL)(),t=(0,d.useMemo)((()=>e?e.map((e=>({address:null===n||void 0===n?void 0:n.address,abi:i.abi,functionName:"positions",args:[e.toString()]}))):[]),[null===n||void 0===n?void 0:n.address,e]),{data:o,isLoading:u,isError:s}=(0,a.Dm)({contracts:t?[...t]:[]}),c=u,v=s,m=(0,d.useMemo)((()=>{if(!c&&!v&&e&&o&&o[0]&&!o[0].error)return o.map(((n,t)=>{let{result:o}=n;return{tokenId:e[t],fee:o.fee,feeGrowthInside0LastX128:r.O$.from(0),feeGrowthInside1LastX128:r.O$.from(0),liquidity:r.O$.from(o.liquidity),nonce:o.nonce,operator:o.operator,tickLower:o.tickLower,tickUpper:o.tickUpper,token0:o.token0,token1:o.token1,spotFeeOwed0:o.spotFeeOwed0,spotFeeOwed1:o.spotFeeOwed1,perpFeeOwed0:o.perpFeeOwed0,perpFeeOwed1:o.perpFeeOwed1,tokensOwed0:o.tokenOwe0,tokensOwed1:o.tokenOwe1}}))}),[c,v,o,e]);return{loading:c,positions:null===m||void 0===m?void 0:m.map(((e,n)=>({...e,tokenId:r.O$.from(t[n].args[0])})))}}function c(e){var n;const t=s(e?[e]:void 0);return{loading:t.loading,position:null===(n=t.positions)||void 0===n?void 0:n[0]}}function v(e){var n;const t=(0,l.GL)(),{loading:o,result:i}=(0,u.Wk)(t,"balanceOf",[null!==e&&void 0!==e?e:void 0]),a=null===i||void 0===i||null===(n=i[0])||void 0===n?void 0:n.toNumber(),c=(0,d.useMemo)((()=>{if(a&&e){const n=[];for(let t=0;t<a;t++)n.push([e,t]);return n}return[]}),[e,a]),v=(0,u.es)(t,"tokenOfOwnerByIndex",c),m=(0,d.useMemo)((()=>v.some((e=>{let{loading:n}=e;return n}))),[v]),f=(0,d.useMemo)((()=>e?v.map((e=>{let{result:n}=e;return n})).filter((e=>!!e)).map((e=>r.O$.from(e[0]))):[]),[e,v]),{positions:g,loading:p}=s(f);return{loading:m||o||p,positions:g}}function m(e,n){if(!e||!n)return!1;const{token0:t,token1:o,fee:r,long0:i}=e,{token0:u,token1:d,fee:a,long0:l}=n;if(!t||!o||!r||!u||!d||!a||void 0==i)return!1;const s=(t+o+r+i).toLowerCase(),c=(o+t+r+i).toLowerCase(),v=(u+d+a+l).toLowerCase(),m=(d+u+a+l).toLowerCase();return s===v||s===m||c===v||c===m}},87774:(e,n,t)=>{t.d(n,{V:()=>l,_:()=>s});var o=t(28183),r=t(74970),i=t(48169),u=t(71233),d=t(32682);var a=t(64820);function l(e,n){const{chainId:t}=(0,i.gi)(),l=function(e,n){const t=null===e||void 0===e?void 0:e.chainId,[o,r]=t?[null===e||void 0===e?void 0:e.wrapped,null===n||void 0===n?void 0:n.wrapped]:[void 0,void 0],i=(0,u.useMemo)((()=>{var e,n,i,u,a;return t&&t===(null===r||void 0===r?void 0:r.chainId)?[...null!==(e=d.lM[t])&&void 0!==e?e:[],...o&&null!==(n=null===(i=d.ck[t])||void 0===i?void 0:i[o.address])&&void 0!==n?n:[],...r&&null!==(u=null===(a=d.ck[t])||void 0===a?void 0:a[r.address])&&void 0!==u?u:[]]:[]}),[t,o,r]),a=(0,u.useMemo)((()=>i.flatMap((e=>i.map((n=>[e,n])))).filter((e=>{let[n,t]=e;return!n.equals(t)}))),[i]);return(0,u.useMemo)((()=>o&&r?[[o,r],...i.map((e=>[o,e])),...i.map((e=>[r,e])),...a].filter((e=>{let[n,t]=e;return!n.equals(t)})).filter(((e,n,t)=>{let[o,r]=e;return t.findIndex((e=>{let[n,t]=e;return o.equals(n)&&r.equals(t)||o.equals(t)&&r.equals(n)}))===n})).filter((e=>{let[n,o]=e;if(!t)return!0;const r=d.IP[t],i=null===r||void 0===r?void 0:r[n.address],u=null===r||void 0===r?void 0:r[o.address];return!i&&!u||!(i&&!i.find((e=>o.equals(e))))&&!(u&&!u.find((e=>n.equals(e))))})):[]),[o,r,i,a,t])}(e,n),s=(0,u.useMemo)((()=>l.reduce(((e,n)=>{let[i,u]=n;return t===o.ChainId.MAINNET?e.concat([[i,u,r.FeeAmount.LOW],[i,u,r.FeeAmount.MEDIUM],[i,u,r.FeeAmount.HIGH]]):e.concat([[i,u,r.FeeAmount.LOWEST],[i,u,r.FeeAmount.LOW],[i,u,r.FeeAmount.MEDIUM],[i,u,r.FeeAmount.HIGH]])}),[])),[l,t]),c=(0,a.Oh)(s);return(0,u.useMemo)((()=>({pools:c.filter((e=>e[0]===a.tK.EXISTS&&null!==e[1])).map((e=>{let[,n]=e;return n})),loading:c.some((e=>{let[n]=e;return n===a.tK.LOADING}))})),[c])}function s(e,n){const{chainId:t}=(0,i.gi)(),[o,d]=t?[null===e||void 0===e?void 0:e.wrapped,null===n||void 0===n?void 0:n.wrapped]:[void 0,void 0],l=(0,u.useMemo)((()=>o&&d?[[o,d,r.FeeAmount.LOW],[o,d,r.FeeAmount.MEDIUM],[o,d,r.FeeAmount.HIGH],[o,d,r.FeeAmount.LOWEST]]:[]),[o,d]),s=(0,a.hl)(l);return(0,u.useMemo)((()=>({pools:s.filter((e=>e[0]===a.tK.EXISTS&&null!==e[1])).map((e=>{let[,n]=e;return n})),loading:s.some((e=>{let[n]=e;return n===a.tK.LOADING}))})),[s])}},88742:(e,n,t)=>{t.d(n,{i:()=>u});var o=t(71233);const r="object"===typeof window;function i(){return{width:r?window.innerWidth:void 0,height:r?window.innerHeight:void 0}}function u(){const[e,n]=(0,o.useState)(i);return(0,o.useEffect)((()=>{function e(){n(i())}if(r)return window.addEventListener("resize",e),()=>{window.removeEventListener("resize",e)}}),[]),e}},73967:(e,n,t)=>{t.d(n,{Vp:()=>A,ZP:()=>k,kC:()=>h});var o=t(73955),r=t(95744),i=t(15020),u=t(48169),d=t(71452),a=t(93951),l=t(24177),s=t(71233),c=t(5331),v=t(70953),m=t(73788),f=t(98475),g=t(36099),p=t(37881);let h=function(e){return e[e.NOT_APPLICABLE=0]="NOT_APPLICABLE",e[e.WRAP=1]="WRAP",e[e.UNWRAP=2]="UNWRAP",e}({});const I={wrapType:h.NOT_APPLICABLE};var w=function(e){return e[e.NO_ERROR=0]="NO_ERROR",e[e.ENTER_NATIVE_AMOUNT=1]="ENTER_NATIVE_AMOUNT",e[e.ENTER_WRAPPED_AMOUNT=2]="ENTER_WRAPPED_AMOUNT",e[e.INSUFFICIENT_NATIVE_BALANCE=3]="INSUFFICIENT_NATIVE_BALANCE",e[e.INSUFFICIENT_WRAPPED_BALANCE=4]="INSUFFICIENT_WRAPPED_BALANCE",e}(w||{});function A(e){let{wrapInputError:n}=e;const{chainId:t}=(0,u.gi)(),r=(0,d.Z)(t),i=null===r||void 0===r?void 0:r.wrapped;switch(n){case w.NO_ERROR:return null;case w.ENTER_NATIVE_AMOUNT:return(0,p.jsx)(o.cC,{id:"Enter {0} amount",values:{0:null===r||void 0===r?void 0:r.symbol}});case w.ENTER_WRAPPED_AMOUNT:return(0,p.jsx)(o.cC,{id:"Enter {0} amount",values:{0:null===i||void 0===i?void 0:i.symbol}});case w.INSUFFICIENT_NATIVE_BALANCE:return(0,p.jsx)(o.cC,{id:"Insufficient {0} balance",values:{0:null===r||void 0===r?void 0:r.symbol}});case w.INSUFFICIENT_WRAPPED_BALANCE:return(0,p.jsx)(o.cC,{id:"Insufficient {0} balance",values:{0:null===i||void 0===i?void 0:i.symbol}})}}function k(e,n,t){const{chainId:o,account:d}=(0,u.gi)(),p=(0,g.Hj)(),A=(0,v._h)(null!==d&&void 0!==d?d:void 0,null!==e&&void 0!==e?e:void 0),k=(0,s.useMemo)((()=>(0,l.Z)(t,null!==e&&void 0!==e?e:void 0)),[e,t]),y=(0,m.h7)(),[E,T]=(0,s.useState)();if(E)throw E;return(0,s.useMemo)((()=>{if(!p||!o||!e||!n)return I;const t=c.Fl[o];if(!t)return I;const u=Boolean(null===k||void 0===k?void 0:k.greaterThan("0")),d=k&&A&&!A.lessThan(k),l={token_in_address:(0,a.DT)(e),token_out_address:(0,a.DT)(n),token_in_symbol:e.symbol,token_out_symbol:n.symbol,chain_id:e.chainId,amount:k?(0,a.lX)(k,null===k||void 0===k?void 0:k.currency.decimals):void 0};return e.isNative&&t.equals(n)?{wrapType:h.WRAP,execute:d&&k?async()=>{var e;const n=await p.provider.getNetwork();if(n.chainId!==o||p.address!==(null===(e=c.Fl[n.chainId])||void 0===e?void 0:e.address)){(0,i._P)(r.Je.WRAP_TOKEN_TXN_INVALIDATED,{...l,contract_address:p.address,contract_chain_id:n.chainId,type:h.WRAP});const e=new Error("Invalid WETH contract\nPlease file a bug detailing how this happened - https://github.com/Uniswap/interface/issues/new?labels=bug&template=bug-report.md&title=Invalid%20WETH%20contract");throw T(e),e}const t=await p.deposit({value:"0x".concat(k.quotient.toString(16))});return y(t,{type:f.i.WRAP,unwrapped:!1,currencyAmountRaw:null===k||void 0===k?void 0:k.quotient.toString(),chainId:o}),(0,i._P)(r.Je.WRAP_TOKEN_TXN_SUBMITTED,{...l,type:h.WRAP}),t.hash}:void 0,inputError:d?void 0:u?w.INSUFFICIENT_NATIVE_BALANCE:w.ENTER_NATIVE_AMOUNT}:t.equals(e)&&n.isNative?{wrapType:h.UNWRAP,execute:d&&k?async()=>{try{const e=await p.withdraw("0x".concat(k.quotient.toString(16)));return y(e,{type:f.i.WRAP,unwrapped:!0,currencyAmountRaw:null===k||void 0===k?void 0:k.quotient.toString(),chainId:o}),(0,i._P)(r.Je.WRAP_TOKEN_TXN_SUBMITTED,{...l,type:h.UNWRAP}),e.hash}catch(E){throw console.error("Could not withdraw",E),E}}:void 0,inputError:d?void 0:u?w.INSUFFICIENT_WRAPPED_BALANCE:w.ENTER_WRAPPED_AMOUNT}:I}),[p,o,e,n,k,A,y])}}}]);
//# sourceMappingURL=main-5b26a900.8dd28a02.js.map