1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[1250],{41626:function(e,t,n){"use strict";n.d(t,{X:function(){return i.Z},B:function(){return u}});var i=n(95296),r=n(59499),o=n(4730),s=(n(67294),n(56785)),l=n(85893);const a=["currencies","dense","maxLogos","size"];function c(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,i)}return n}function d(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?c(Object(n),!0).forEach((function(t){(0,r.Z)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):c(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var u=e=>{let{currencies:t,dense:n=!1,maxLogos:r=3,size:c=24}=e,u=(0,o.Z)(e,a);const m=t.length<=r?t:t.slice(0,Math.max(0,Math.min(t.length,r)-1)),v=t.length-m.length;return(0,l.jsxs)("div",{className:"flex",children:[m.map(((e,t)=>(0,l.jsx)("div",{className:"overflow-hidden rounded-full",style:{marginLeft:r>1?0===t?"":n?-Math.floor(c/2-4):-6:0,filter:"drop-shadow(0px 3px 6px rgba(15, 15, 15, 0.25))"},children:(0,l.jsx)(i.Z,d({currency:e,size:c},u))},t)),[]),v>0&&(0,l.jsx)("div",{className:"rounded-full overflow-hidden flex items-center justify-center z-[1]",style:{marginLeft:r>1?n?-Math.floor(c/2+2):-6:0,width:c,height:c,background:"radial-gradient(50% 50% at 50% 50%, #FFFFFF 0%, #DBDBDB 100%)",filter:"drop-shadow(0px 3px 6px rgba(15, 15, 15, 0.25))"},children:(0,l.jsxs)(s.Z,{weight:700,className:"text-low-emphesis",variant:"sm",children:["+",t.length-r+1]})})]})}},493:function(e,t,n){"use strict";n.d(t,{Z:function(){return v}});var i=n(59499),r=n(26835),o=n(6022),s=n(52631),l=n(67294),a=n(73935),c=n(66441),d=n(85893);function u(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,i)}return n}function m(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?u(Object(n),!0).forEach((function(t){(0,i.Z)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):u(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function v({content:e,children:t,placement:n="auto",show:i,modifiers:u}){const{0:v,1:p}=(0,l.useState)(null),{0:h,1:f}=(0,l.useState)(null),{0:g,1:x}=(0,l.useState)(null),{styles:y,update:w,attributes:b}=(0,c.D)(v,h,{placement:n,strategy:"fixed",modifiers:u||[{name:"offset",options:{offset:[0,8]}},{name:"arrow",options:{element:g}}]}),j=(0,l.useCallback)((()=>{w&&w()}),[w]);return(0,s.Z)(j,i?100:null),(0,d.jsx)(r.J,{as:l.Fragment,children:({open:n})=>(0,d.jsxs)(d.Fragment,{children:[l.Children.map(t,(e=>(0,d.jsx)(r.J.Button,{as:l.Fragment,ref:p,children:e}))),(null!==i&&void 0!==i?i:n)&&a.createPortal((0,d.jsxs)(r.J.Panel,m(m({static:!0,className:"z-1000 shadow-xl shadow-dark-1000/80 rounded overflow-hidden",ref:f,style:y.popper},b.popper),{},{children:[e,(0,d.jsx)("div",m({className:(0,o.AK)("w-2 h-2 z-50"),ref:x,style:y.arrow},b.arrow))]})),document.querySelector("#popover-portal"))]})})}},54962:function(e,t,n){"use strict";n.d(t,{Z:function(){return a}});var i=n(63801),r=n(6022),o=n(67294);var s=n(70518),l=n(85893);var a=({className:e,children:t,text:n,icon:a=(0,l.jsx)(i.AV5,{width:14,height:14})})=>{const{0:c,1:d}=(0,o.useState)(!1),[u,m]=function(e=!1){const{0:t,1:n}=(0,o.useState)(e);return[t,(0,o.useCallback)((()=>n((e=>!e))),[])]}(!1),v=(0,o.useRef)(null);!function(e,t){const n=(0,o.useRef)(t);(0,o.useEffect)((()=>{n.current=t}),[t]),(0,o.useEffect)((()=>{const t=t=>{var i,r;null!==(i=null===(r=e.current)||void 0===r?void 0:r.contains(t.target))&&void 0!==i&&i||n.current&&n.current()};return document.addEventListener("mousedown",t),()=>{document.removeEventListener("mousedown",t)}}),[e])}(v,u?m:void 0);const p=(0,o.useCallback)((()=>d(!0)),[d]),h=(0,o.useCallback)((()=>d(!1)),[d]);return t?(0,l.jsx)(s.ZP,{text:n,show:c||u,className:e,children:o.cloneElement(t,{ref:v,onClick:m,className:(0,r.AK)(t.props.className,"flex items-center justify-center w-full outline-none"),onMouseEnter:p,onMouseLeave:h})}):(0,l.jsx)(s.ZP,{text:n,show:c||u,className:e,children:(0,l.jsx)("div",{ref:v,onClick:m,className:"flex items-center justify-center ml-1 outline-none cursor-help hover:text-primary",onMouseEnter:p,onMouseLeave:h,children:a})})}},70518:function(e,t,n){"use strict";n.d(t,{ZP:function(){return v},ud:function(){return p}});var i=n(59499),r=n(4730),o=n(6022),s=n(67294),l=n(493),a=n(85893);const c=["text","children","className"],d=["children"];function u(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,i)}return n}function m(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};
1t%2?u(Object(n),!0).forEach((function(t){(0,i.Z)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):u(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function v(e){let{text:t,children:n,className:i}=e,s=(0,r.Z)(e,c);return(0,a.jsx)(l.Z,m(m({placement:"bottom",content:(0,a.jsx)("div",{className:(0,o.AK)(i,"w-full max-w-[228px] px-3 py-2 font-bold bg-dark-900 border border-dark-700 rounded text-sm shadow-lg"),children:t})},s),{},{children:n}))}function p(e){let{children:t}=e,n=(0,r.Z)(e,d);const{0:i,1:o}=(0,s.useState)(!1),l=(0,s.useCallback)((()=>o(!0)),[o]),c=(0,s.useCallback)((()=>o(!1)),[o]);return(0,a.jsx)(v,m(m({},n),{},{show:i,children:(0,a.jsx)("div",{onMouseEnter:l,onMouseLeave:c,children:t})}))}},82766:function(e,t,n){"use strict";n.d(t,{r:function(){return c}});var i=n(71923),r=(n(93036),n(1082)),o=n.n(r),s=n(83852),l=n(67294),a=n(75438);function c(e){const{0:t,1:n}=(0,l.useState)("#0094ec");return(0,l.useLayoutEffect)((()=>{let t=!1;return e&&async function(e){if(e.chainId===i.a_.RINKEBY&&"0xc7AD46e0b8a400Bb3C915120d284AafbA8fc4735"===e.address)return Promise.resolve("#FAAB14");const t="https://raw.githubusercontent.com/trustwallet/assets/master/blockchains/ethereum/assets/".concat(e.address,"/logo.png");return o().from(t).getPalette().then((e=>{if(null!==e&&void 0!==e&&e.Vibrant){let t=e.Vibrant.hex,n=(0,a.$v)(t,"#FFF");for(;n<3;)t=(0,s.wj)(.005,t),n=(0,a.$v)(t,"#FFF");return t}return null})).catch((()=>null))}(e).then((e=>{t||null===e||n(e)})),()=>{t=!0,n("#0094ec")}}),[e]),t}},44232:function(e,t,n){"use strict";n.d(t,{pO:function(){return C},j3:function(){return E}});var i,r=n(59499),o=n(16441),s=n(71923),l=n(62793),a=n(12614),c=n(67294),d=n(1569),u=n(31453),m=n(67993),v=n(74272);function p(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,i)}return n}function h(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?p(Object(n),!0).forEach((function(t){(0,r.Z)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):p(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}!function(e){e[e.AMOUNT=1]="AMOUNT",e[e.ALLOWED=2]="ALLOWED"}(i||(i={}));const f={1:{[l.gn.address]:{type:i.AMOUNT,name:"USD Coin",version:"2"},[l.h1.address]:{type:i.ALLOWED,name:"Dai Stablecoin",version:"1"},[s.hs[1].address]:{type:i.AMOUNT,name:"OwlSwap"}},4:{"0xc7AD46e0b8a400Bb3C915120d284AafbA8fc4735":{type:i.ALLOWED,name:"Dai Stablecoin",version:"1"},[s.hs[4].address]:{type:i.AMOUNT,name:"OwlSwap"}},3:{[s.hs[3].address]:{type:i.AMOUNT,name:"OwlSwap"},"0x07865c6E87B9F70255377e024ace6630C1Eaa37F":{type:i.AMOUNT,name:"USD Coin",version:"2"}},5:{[s.hs[5].address]:{type:i.AMOUNT,name:"OwlSwap"}},42:{[s.hs[42].address]:{type:i.AMOUNT,name:"OwlSwap"}}};let g;!function(e){e[e.NOT_APPLICABLE=0]="NOT_APPLICABLE",e[e.LOADING=1]="LOADING",e[e.NOT_SIGNED=2]="NOT_SIGNED",e[e.SIGNED=3]="SIGNED"}(g||(g={}));const x=[{name:"name",type:"string"},{name:"version",type:"string"},{name:"chainId",type:"uint256"},{name:"verifyingContract",type:"address"}],y=[{name:"name",type:"string"},{name:"chainId",type:"uint256"},{name:"verifyingContract",type:"address"}],w=[{name:"owner",type:"address"},{name:"spender",type:"address"},{name:"value",type:"uint256"},{name:"nonce",type:"uint256"},{name:"deadline",type:"uint256"}],b=[{name:"holder",type:"address"},{name:"spender",type:"address"},{name:"nonce",type:"uint256"},{name:"expiry",type:"uint256"},{name:"allowed",type:"bool"}];function j(e,t,n){var r,l;const{account:p,chainId:j,library:N}=(0,a.a)(),C=(0,v.Z)(),E=null!==e&&void 0!==e&&null!==(r=e.currency)&&void 0!==r&&r.isToken?e.currency.address:void 0,O=(0,u.N9)(E),R=(0,m.Z)(),I=(0,c.useMemo)((()=>[null!==p&&void 0!==p?p:void 0]),[p]),T=(0,d.Wk)(O,"nonces",I),_=null!==n&&void 0!==n?n:j&&E?null===(l=f[j])||void 0===l?void 0:l[E]:void 0,{0:A,1:U}=(0,c.useState)(null);return(0,c.useMemo)((()=>{var n,r;if(R||!e||!O||!p||!j||!C||!N||!T.valid||!E||!t||!_)return{state:g.NOT_APPLICABLE,signatureData:null,gatherPermitSignature:null};const l=null===(n=T.result)||void 0===n||null===(r=n[0])||void 0===r?void 0:r.toNumber();if(T.loading||"number"!==typeof l)return{state:g.LOADING,signatureData:null,gatherPermitSignature:null};const a=A&&A.owner===p&&A.deadline>=C.toNumber()&&A.tokenAddress===E&&A.nonce===l&&A.spender===t&&("allowed"in A||s.QA.equal(s.QA.BigInt(A.amount),e.quotient));return{state:a?g.SIGNED:g.NOT_SIGNED,signatureData:a?A:null,gatherPermitSignature:async function(){const n=_.type===i.ALLOWED,r=C.toNumber()+1200,s=e.quotient.toString(),a=n?{holder:p,spender:t,allowed:n,nonce:l,expiry:r}:{owner:p,spender:t,value:s,nonce:l,deadline:r}
1,c=_.version?{name:_.name,version:_.version,verifyingContract:E,chainId:j}:{name:_.name,verifyingContract:E,chainId:j},d=JSON.stringify({types:{EIP712Domain:_.version?x:y,Permit:n?b:w},domain:c,primaryType:"Permit",message:a});return N.send("eth_signTypedData_v4",[p,d]).then(o.N).then((e=>{U(h(h({v:e.v,r:e.r,s:e.s,deadline:r},n?{allowed:n}:{amount:s}),{},{nonce:l,chainId:j,owner:p,spender:t,tokenAddress:E,permitType:_.type}))}))}}}),[R,e,O,p,j,C,N,T.valid,T.result,T.loading,E,t,_,A])}const N={version:"1",name:"OracleSwap LP Token",type:i.AMOUNT};function C(e,t){return j(e,t,N)}function E(e,t){const n=(0,u.N9)(null===e||void 0===e?void 0:e.currency.address),r=(0,d.Wk)(n,"name"),o=(0,c.useMemo)((()=>{var e;return null!==r&&void 0!==r&&null!==(e=r.result)&&void 0!==e&&e.length?null===r||void 0===r?void 0:r.result[0]:void 0}),[r]);return j(e?s.ih.fromRawAmount(e.currency,s.Bz):void 0,t,{version:"1",name:null!==o&&void 0!==o?o:"",type:i.AMOUNT})}},67993:function(e,t,n){"use strict";n.d(t,{Z:function(){return l}});var i=n(12614),r=n(1569),o=n(67294),s=n(31453);function l(){var e,t;const{account:n}=(0,i.a)(),l=(0,s.c5)(),a=(0,o.useMemo)((()=>[null!==n&&void 0!==n?n:void 0]),[n]),c=(0,r.Wk)(l,"isArgentWallet",a,r.DB);return null!==(e=null===c||void 0===c||null===(t=c.result)||void 0===t?void 0:t[0])&&void 0!==e&&e}},64211:function(e,t,n){"use strict";n.r(t),n.d(t,{default:function(){return Q}});var i=n(2593),r=n(63153),o=n(85169),s=n(71923),l=n(71862),a=n(73957),c=n(72457),d=n(41626),u=n(3382),m=n(64958),v=n(67294),p=n(39281),h=n(85893);function f({value:e,onUserInput:t,id:n}){return(0,h.jsx)("div",{id:n,className:"p-5 rounded bg-dark-800",children:(0,h.jsxs)("div",{className:"flex flex-col justify-between space-y-3 sm:space-y-0 sm:flex-row",children:[(0,h.jsx)("div",{className:"w-full text-white sm:w-2/5",style:{margin:"auto 0px"},children:"Amount to Remove"}),(0,h.jsxs)("div",{className:"flex items-center w-full p-3 space-x-3 text-xl font-bold rounded bg-dark-900 sm:w-3/5",children:[(0,h.jsx)(p.Z.Percent,{className:"token-amount-input",value:e,onUserInput:e=>{t(e)},align:"right"}),(0,h.jsx)("div",{className:"pl-2 text-xl font-bold",children:"%"})]})]})})}var g=n(79345),x=n(14202),y=n(63192),w=n(11134),b=n(66529),j=n(92659),N=n(62483),C=n(27262),E=n(31453);var O=n(44232),R=n(74272),I=n(73218),T=n(12614),_=n(90849),A=n(68211),U=n(1025),P=n(16339),k=n(37643),D=n(68411),S=n(9008),L=n(41664),q=n(11163),Y=n(61896),B=n(50542),M=n(81793),Z=n(32333);M.ag.loadLocaleData("en",{plurals:Z.en});const F=new s.gG(5,100);function Q(){var e,t,n,p,M,Z,Q,G,z,W,V,X,H,K,J;const{i18n:$}=(0,o.mV)(),ee=(0,q.useRouter)(),te=ee.query.tokens,[ne,ie]=te||[void 0,void 0],[re,oe]=[null!==(e=(0,N.U8)(ne))&&void 0!==e?e:void 0,null!==(t=(0,N.U8)(ie))&&void 0!==t?t:void 0],{account:se,chainId:le,library:ae}=(0,T.a)(),{0:ce,1:de}=(0,v.useMemo)((()=>[null===re||void 0===re?void 0:re.wrapped,null===oe||void 0===oe?void 0:oe.wrapped]),[re,oe]),{independentField:ue,typedValue:me}=((0,_.mq)(),(0,U.Xi)()),{pair:ve,parsedAmounts:pe,error:he}=(0,U.Vx)(null!==re&&void 0!==re?re:void 0,null!==oe&&void 0!==oe?oe:void 0),{onUserInput:fe}=(0,U.GF)(),ge=!he,{0:xe,1:ye}=(0,v.useState)(!1),{0:we,1:be}=(0,v.useState)(!1),{0:je,1:Ne}=(0,v.useState)(!1),{0:Ce,1:Ee}=(0,v.useState)(""),Oe=(0,R.Z)(),Re=(0,P.C)((0,k.yr)(F)),Ie={[A.g.LIQUIDITY_PERCENT]:pe[A.g.LIQUIDITY_PERCENT].equalTo("0")?"0":pe[A.g.LIQUIDITY_PERCENT].lessThan(new s.gG("1","100"))?"<1":pe[A.g.LIQUIDITY_PERCENT].toFixed(0),[A.g.LIQUIDITY]:ue===A.g.LIQUIDITY?me:null!==(n=null===(p=pe[A.g.LIQUIDITY])||void 0===p?void 0:p.toSignificant(6))&&void 0!==n?n:"",[A.g.CURRENCY_A]:ue===A.g.CURRENCY_A?me:null!==(M=null===(Z=pe[A.g.CURRENCY_A])||void 0===Z?void 0:Z.toSignificant(6))&&void 0!==M?M:"",[A.g.CURRENCY_B]:ue===A.g.CURRENCY_B?me:null!==(Q=null===(G=pe[A.g.CURRENCY_B])||void 0===G?void 0:G.toSignificant(6))&&void 0!==Q?Q:""},Te=(null===(z=pe[A.g.LIQUIDITY_PERCENT])||void 0===z||z.equalTo(new s.gG("1")),(0,E.t0)(null===ve||void 0===ve||null===(W=ve.liquidityToken)||void 0===W?void 0:W.address)),_e=(0,E.Ti)(),{gatherPermitSignature:Ae,signatureData:Ue}=(0,O.pO)(pe[A.g.LIQUIDITY],null===_e||void 0===_e?void 0:_e.address),[Pe,ke]=(0,C.qL)(pe[A.g.LIQUIDITY],null===_e||void 0===_e?void 0:_e.address);const De=(0,v.useCallback)(((e,t)=>fe(e,t)),[fe]),Se=((0,v.useCallback)((e=>De(A.g.LIQUIDITY,e)),[De]),(0,v.useCallback)((e=>De(A.g.CURRENCY_A,e)),[De]),(0,v.useCallback)((e=>De(A.g.CURRENCY_B,e)),[De]),(0,D.h7)());const Le=(0,h.jsxs)("div",{className:"grid gap-4 pt-3 pb-4",children:[(0,h.jsxs)("div",{className:"grid gap-2",children:[(0,h.jsxs)("div",{className:"flex items-center justify-between",children:[(0,h.jsxs)("div",{className:"flex items-center gap-3",children:[(0,h.jsx)(d.X,{currency:re,size:48}),(0,h.jsx)("div",{className:"text-2xl font-bold text-high-emphesis",children:null===(V=pe[A.g.CURRENCY_A])||void 0===V?void 0:V.toSignificant(6)})]}),(0,h.jsx)("div",{className:"ml-3 text-2xl font-medium text-high-emphesis",children:null===re||void 0===re?void 0:re.symbol})]}),(0,h.jsx)("div",{className:"ml-3 mr-3 min-w-[24px]",children:(0,h.jsx)(Y.Z,{size:24})}),(0,h.jsxs)("div",{className:"flex items-center justify-between",children:[(0,h.jsxs)("div",{className:"flex items-center gap-3",children:[(0,h.jsx)(d.X,{currency:oe,size:48}),(0,h.jsx)("div",{className:"text-2xl font-bold text-high-emphesis",children:null===(X=pe[A.g.CURRENCY_B])||void 0===X?void 0:X.toSignificant(6)})]}),(0,h.jsx)("div",{className:"ml-3 text-2xl font-medium text-high-emphesis",children:null===oe||void 0===oe?void 0:oe.symbol})]})]}),(0,h.jsx)("div",{className:"justify-start text-sm text-high-emphesis",children:$._("Output is estimated. If the price changes by more than {0}% your transaction will revert.",{0:Re.toSignificant(4)})})]}),qe=(0,h.jsxs)("div",{className:"p-6 mt-0 -m-6 bg-dark-800",children:[ve&&(0,h.jsxs)(h.Fragment,{children:[(0,h.jsxs)("div",{className:"grid gap-1",children:[(0,h.jsxs)("div",{className:"flex items-center justify-between",children:[(0,h.jsx)("div",{className:"text-sm text-high-emphesis",children:$._($._("Rates"))}),(0,h.jsx)("div",{className:"text-sm font-bold justify-center items-center flex right-align pl-1.5 text-high-emphesis",children:"1 ".concat(null===re||void 0===re?void 0:re.symbol," = ").concat(ce?ve.priceOf(ce).toSignificant(6):"-"," ").concat(null===oe||void 0===oe?void 0:oe.symbol)})]}),(0,h.jsx)("div",{className:"flex items-center justify-end",children:(0,h.jsx)("div",{className:"text-sm font-bold justify-center items-center flex right-align pl-1.5 text-high-emphesis",children:"1 ".concat(null===oe||void 0===oe?void 0:oe.symbol," = ").concat(de?ve.priceOf(de).toSignificant(6):"-"," ").concat(null===re||void 0===re?void 0:re.symbol)})})]}),(0,h.jsx)("div",{className:"h-px my-6 bg-gray-700"})]}),(0,h.jsx)("div",{className:"grid gap-1 pb-6",children:(0,h.jsxs)("div",{className:"flex items-center justify-between",children:[(0,h.jsx)("div",{className:"text-sm text-high-emphesis",children:$._($._("{0}/{1} Burned",{0:null===re||void 0===re?void 0:re.symbol,1:null===oe||void 0===oe?void 0:oe.symbol}))}),(0,h.jsx)("div",{className:"text-sm font-bold justify-center items-center flex right-align pl-1.5 text-high-emphasis",children:null===(H=pe[A.g.LIQUIDITY])||void 0===H?void 0:H.toSignificant(6)})]})}),(0,h.jsx)(l.ZP,{color:"gradient",size:"lg",disabled:!(Pe===C.UK.APPROVED||null!==Ue),onClick:async function(){if(!le||!ae||!se||!Oe||!ee)throw new Error("missing dependencies");const{[A.g.CURRENCY_A]:e,[A.g.CURRENCY_B]:t}=pe;if(!e||!t)throw new Error("missing currency amounts");const n={[A.g.CURRENCY_A]:(0,j.uc)(e,Re)[0],[A.g.CURRENCY_B]:(0,j.uc)(t,Re)[0]};if(!re||!oe)throw new Error("missing tokens");const r=pe[A.g.LIQUIDITY];if(!r)throw new Error("missing liquidity amount");const o=oe.isNative,s=re.isNative||o;if(!ce||!de)throw new Error("could not wrap");let l,a;s?(l=["removeLiquidityETH","removeLiquidityETHSupportingFeeOnTransferTokens"],a=[o?ce.address:de.address,r.quotient.toString(),n[o?A.g.CURRENCY_A:A.g.CURRENCY_B].toString(),n[o?A.g.CURRENCY_B:A.g.CURRENCY_A].toString(),se,Oe.toHexString()]):(l=["removeLiquidity"],a=[ce.address,de.address,r.quotient.toString(),n[A.g.CURRENCY_A].toString(),n[A.g.CURRENCY_B].toString(),se,Oe.toHexString()]),console.log("Attempting to remove liquidity with methods:",l),console.log("Arguments:",a);const c=await Promise.all(l.map((e=>null===_e||void 0===_e?void 0:_e.estimateGas[e](...a).then((t=>(console.log("Gas estimate for ".concat(e,":"),t.toString()),(0,j.yC)(t)))).catch((t=>{console.error("estimateGas failed for ".concat(e,":"),t)}))))),d=c.findIndex((e=>i.O$.isBigNumber(e)));if(-1===d)console.error("This transaction would fail. Please contact support.");else{const e=l[d],t=c[d];if(Ne(!0),!_e)throw new Error("Router contract is null");await _e[e](...a,{gasLimit:t}).then((e=>{var t,n;
1Ne(!1),Se(e,{summary:$._("Remove {0} {1} and {2} {3}",{0:null===(t=pe[A.g.CURRENCY_A])||void 0===t?void 0:t.toSignificant(3),1:null===re||void 0===re?void 0:re.symbol,2:null===(n=pe[A.g.CURRENCY_B])||void 0===n?void 0:n.toSignificant(3),3:null===oe||void 0===oe?void 0:oe.symbol})}),Ee(e.hash),B.ZP.event({category:"Liquidity",action:"Remove",label:[null===re||void 0===re?void 0:re.symbol,null===oe||void 0===oe?void 0:oe.symbol].join("/")})})).catch((e=>{Ne(!1),console.error("Remove liquidity failed:",e)}))}},children:$._($._("Confirm"))})]}),Ye=$._($._("Removing {0} {1} and {2} {3}",{0:null===(K=pe[A.g.CURRENCY_A])||void 0===K?void 0:K.toSignificant(6),1:null===re||void 0===re?void 0:re.symbol,2:null===(J=pe[A.g.CURRENCY_B])||void 0===J?void 0:J.toSignificant(6),3:null===oe||void 0===oe?void 0:oe.symbol})),Be=(0,v.useCallback)((e=>{De(A.g.LIQUIDITY_PERCENT,e)}),[De]),Me=(null===re||void 0===re?void 0:re.isNative)||(null===oe||void 0===oe?void 0:oe.isNative),Ze=Boolean(le&&s.FX[le]&&((null===re||void 0===re?void 0:re.equals(s.FX[le]))||(null===oe||void 0===oe?void 0:oe.equals(s.FX[le])))),Fe=((0,v.useCallback)((e=>{ie&&(0,b.Hh)(e)===ie?ee.push("/remove/".concat((0,b.Hh)(e),"/").concat(ne)):ee.push("/remove/".concat((0,b.Hh)(e),"/").concat(ie))}),[ne,ie,ee]),(0,v.useCallback)((e=>{ne&&(0,b.Hh)(e)===ne?ee.push("/remove/".concat(ie,"/").concat((0,b.Hh)(e))):ee.push("/remove/".concat(ne,"/").concat((0,b.Hh)(e)))}),[ne,ie,ee]),(0,v.useCallback)((()=>{ye(!1),Ce&&De(A.g.LIQUIDITY_PERCENT,"0"),Ee("")}),[De,Ce])),[Qe,Ge]=function(e,t,n=100){const{0:i,1:r}=(0,v.useState)((()=>e)),o=(0,v.useRef)(),s=(0,v.useCallback)((e=>{r(e),o.current&&clearTimeout(o.current),o.current=setTimeout((()=>{t(e),o.current=void 0}),n)}),[n,t]);return(0,v.useEffect)((()=>{o.current&&(clearTimeout(o.current),o.current=void 0),r(e)}),[e]),[i,s]}(pe[A.g.LIQUIDITY_PERCENT].toFixed(0),Be);return(0,h.jsxs)(c.Z,{id:"remove-liquidity-page",className:"py-4 space-y-4 md:py-8 lg:py-12",maxWidth:"2xl",children:[(0,h.jsxs)(S.default,{children:[(0,h.jsx)("title",{children:"Remove Liquidity | OwlSwap"}),(0,h.jsx)("meta",{name:"description",content:"Remove liquidity from the OwlSwap AMM"},"description"),(0,h.jsx)("meta",{name:"twitter:description",content:"Remove liquidity from the OwlSwap AMM"},"twitter:description"),(0,h.jsx)("meta",{property:"og:description",content:"Remove liquidity from the OwlSwap AMM"},"og:description")]}),(0,h.jsx)("div",{className:"px-4 mb-5",children:(0,h.jsx)(m.Z,{href:"/pool",children:(0,h.jsxs)("a",{className:"flex items-center space-x-2 text-base font-medium text-center cursor-pointer text-secondary hover:text-high-emphesis",children:[(0,h.jsx)("span",{children:$._($._("View Liquidity Positions"))}),(0,h.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",className:"w-4 h-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:(0,h.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M9 5l7 7-7 7"})})]})})}),(0,h.jsx)(u.Z,{children:(0,h.jsxs)("div",{className:"p-4 space-y-4 rounded bg-dark-900",style:{zIndex:1},children:[(0,h.jsx)(w.Z,{input:re,output:oe,allowedSlippage:Re}),(0,h.jsxs)("div",{children:[(0,h.jsx)(I.ZP,{isOpen:xe,onDismiss:Fe,attemptingTxn:je,hash:Ce||"",content:(0,h.jsx)(I.pM,{title:$._($._("You will receive")),onDismiss:Fe,topContent:Le,bottomContent:qe}),pendingText:Ye}),(0,h.jsxs)(a.Tz,{gap:"md",children:[(0,h.jsxs)("div",{children:[(0,h.jsx)(f,{value:Qe,onUserInput:Ge,id:"liquidity-percent"}),(0,h.jsx)(a.Tz,{justify:"space-between",className:"py-2.5",children:(0,h.jsx)(x.BA,{justify:"flex-start",style:{padding:"0 1rem"},children:(0,h.jsx)("button",{className:"z-10 -mt-6 -mb-6 rounded-full cursor-default bg-dark-900 p-3px",children:(0,h.jsx)("div",{className:"p-3 rounded-full bg-dark-800",children:(0,h.jsx)(r.veu,{width:"32px",height:"32px"})})})})}),(0,h.jsx)("div",{id:"remove-liquidity-output",className:"p-5 rounded bg-dark-800",children:(0,h.jsxs)("div",{className:"flex flex-col justify-between space-y-3 sm:space-y-0 sm:flex-row",children:[(0,h.jsx)("div",{className:"w-full sm:w-2/5",style:{margin:"auto 0px"},children:(0,h.jsxs)(a.Tz,{children:[(0,h.jsx)("div",{className:"font-bold text-lg text-black dark:text-white",children:"You Will Receive:"}
1),le&&(Ze||Me)?(0,h.jsx)(x.m0,{className:"text-sm",children:Me?(0,h.jsx)(L.default,{href:"/remove/".concat(null!==re&&void 0!==re&&re.isNative?s.df[le]:ne,"/").concat(null!==oe&&void 0!==oe&&oe.isNative?s.df[le]:ie),children:(0,h.jsxs)("a",{className:"text-baseline text-blue opacity-80 hover:opacity-100 focus:opacity-100 whitespace-nowrap",children:["Receive W",s.B5[le].symbol]})}):Ze?(0,h.jsx)(L.default,{href:"/remove/".concat(null!==re&&void 0!==re&&re.equals(s.FX[le])?"ETH":ne,"/").concat(null!==oe&&void 0!==oe&&oe.equals(s.FX[le])?"ETH":ie),children:(0,h.jsxs)("a",{className:"text-baseline text-blue opacity-80 hover:opacity-100 whitespace-nowrap",children:["Receive ",s.B5[le].symbol]})}):null}):null]})}),(0,h.jsxs)("div",{className:"flex flex-col space-y-3 md:flex-row md:space-x-6 md:space-y-0",children:[(0,h.jsxs)("div",{className:"flex flex-row items-center w-full p-3 pr-8 space-x-3 rounded bg-dark-900",children:[(0,h.jsx)(d.X,{currency:re,size:"46px"}),(0,h.jsxs)(a.Tz,{children:[(0,h.jsx)("div",{className:"font-bold text-lg text-black dark:text-white truncate",children:Ie[A.g.CURRENCY_A]||"-"}),(0,h.jsx)("div",{className:"text-sm font-medium text-black dark:text-white",children:null===re||void 0===re?void 0:re.symbol})]})]}),(0,h.jsxs)("div",{className:"flex flex-row items-center w-full p-3 pr-8 space-x-3 rounded bg-dark-900",children:[(0,h.jsx)(d.X,{currency:oe,size:"46px"}),(0,h.jsxs)(a.Tz,{children:[(0,h.jsx)("div",{className:"font-bold text-lg text-black dark:text-white truncate",children:Ie[A.g.CURRENCY_B]||"-"}),(0,h.jsx)("div",{className:"text-sm font-medium text-black dark:text-white",children:null===oe||void 0===oe?void 0:oe.symbol})]})]})]})]})})]}),(0,h.jsx)("div",{style:{position:"relative"},children:se?(0,h.jsxs)("div",{className:"grid grid-cols-2 gap-4",children:[(0,h.jsx)(l.ZP,{fullWidth:!0,loading:Pe===C.UK.PENDING,onClick:async function(){var e;if(!Te||!ve||!ae||!Oe)throw console.error("Missing dependencies for approval:",{pairContract:!!Te,pair:!!ve,library:!!ae,deadline:!!Oe}),new Error("missing dependencies");const t=pe[A.g.LIQUIDITY];if(!t)throw console.error("Missing liquidity amount for approval"),new Error("missing liquidity amount");console.log("Starting approval process..."),console.log("Liquidity amount:",t.toExact()),console.log("Router address:",null===_e||void 0===_e?void 0:_e.address),console.log("Pair address:",null===ve||void 0===ve||null===(e=ve.liquidityToken)||void 0===e?void 0:e.address);try{console.log("Executing approval transaction..."),await ke(),console.log("Approval transaction executed")}catch(he){if(console.error("Approval transaction failed:",he),4001===(null===he||void 0===he?void 0:he.code))throw new Error("Transaction rejected by user");throw new Error("Approval failed: ".concat((null===he||void 0===he?void 0:he.message)||"Unknown error"))}},disabled:Pe!==C.UK.NOT_APPROVED||null!==Ue,children:Pe===C.UK.APPROVED||null!==Ue?$._($._("Approved")):$._($._("Approve"))}),(0,h.jsx)(l.ZP,{fullWidth:!0,color:!ge&&pe[A.g.CURRENCY_A]&&pe[A.g.CURRENCY_B]?"red":"blue",onClick:()=>{ye(!0)},disabled:!ge||null===Ue&&Pe!==C.UK.APPROVED,children:he||$._($._("Confirm Withdrawal"))})]}):(0,h.jsx)(y.Z,{size:"lg",color:"blue",className:"w-full"})})]})]}),ve?(0,h.jsx)(g.W,{showUnwrapped:Ze,pair:ve}):null]})})]})}},1025:function(e,t,n){"use strict";n.d(t,{Xi:function(){return v},Vx:function(){return p},GF:function(){return h}});var i=n(85169),r=n(71923),o=n(60708),s=n(62603),l=n(15625),a=n(12614),c=n(16339),d=n(98950),u=n(67294),m=n(68211);function v(){return(0,c.C)((e=>e.burn))}function p(e,t){var n,c,u,p;const{account:h,chainId:f}=(0,a.a)(),{i18n:g}=(0,i.mV)(),{independentField:x,typedValue:y}=v(),[,w]=(0,l.Oo)(e,t),b=(0,d.Z)(null!==h&&void 0!==h?h:void 0,[null===w||void 0===w?void 0:w.liquidityToken]),j=null===b||void 0===b?void 0:b[null!==(n=null===w||void 0===w||null===(c=w.liquidityToken)||void 0===c?void 0:c.address)&&void 0!==n?n:""],[N,C]=[null===e||void 0===e?void 0:e.wrapped,null===t||void 0===t?void 0:t.wrapped],E={[m.g.CURRENCY_A]:N,[m.g.CURRENCY_B]:C,[m.g.LIQUIDITY]:null===w||void 0===w?void 0:w.liquidityToken},O=(0,s.A)(null===w||void 0===w?void 0:w.liquidityToken),R=w&&O&&j&&N&&r.QA.greaterThanOrEqual(O.quotient,j.quotient)?r.ih.fromRawAmount(N,w.getLiquidityValue(N,O,j,!1).quotient):void 0,I=w&&O&&j&&C&&r.QA.greaterThanOrEqual(O.quotient,j.quotient)?r.ih.fromRawAmount(C,w.getLiquidityValue(C,O,j,!1).quotient):void 0,T={[m.g.CURRENCY_A]:R,[m.g.CURRENCY_B]:I};let _=new r.gG("0","100");if(x===m.g.LIQUIDITY_PERCENT)_=new r.gG(y,"100");else if(x===m.g.LIQUIDITY){if(null!==w&&void 0!==w&&w.liquidityToken){const e=(0,o.e)(y,w.liquidityToken);e&&j&&!e.greaterThan(j)&&(_=new r.gG(e.quotient,j.quotient))}}else if(E[x]){const e=(0,o.e)(y,E[x]),t=T[x];e&&t&&!e.greaterThan(t)&&(_=new r.gG(e.quotient,t.quotient))}const A={[m.g.LIQUIDITY_PERCENT]:_,[m.g.LIQUIDITY]:j&&_&&_.greaterThan("0")?r.ih.fromRawAmount(j.currency,_.multiply(j.quotient).quotient):void 0,[m.g.CURRENCY_A]:N&&_&&_.greaterThan("0")&&R?r.ih.fromRawAmount(N,_.multiply(R.quotient).quotient):void 0,[m.g.CURRENCY_B]:C&&_&&_.greaterThan("0")&&I?r.ih.fromRawAmount(C,_.multiply(I.quotient).quotient):void 0};let U;var P,k;(h||(U=g._(g._("Connect Wallet"))),A[m.g.LIQUIDITY]&&A[m.g.CURRENCY_A]&&A[m.g.CURRENCY_B])||(U=null!==(P=U)&&void 0!==P?P:g._(g._("Enter an amount")));null!==(u=A[m.g.CURRENCY_A])&&void 0!==u&&u.equalTo(r.xE)&&null!==(p=A[m.g.CURRENCY_B])&&void 0!==p&&p.equalTo(r.xE)&&(U=null!==(k=U)&&void 0!==k?k:g._(g._("Insufficient OLP balance")));return{pair:w,parsedAmounts:A,error:U,userLiquidity:j}}function h(){const e=(0,c.T)();return{onUserInput:(0,u.useCallback)(((t,n)=>{e((0,m.L)({field:t,typedValue:n}))}),[e])}}},43843:function(e,t,n){(window.__NEXT_P=window.__NEXT_P||[]).push(["/legacy/remove/[[...tokens]]",function(){return n(64211)}])}},function(e){e.O(0,[3153,7440,6441,5296,6452,3218,3903,2840,9774,2888,179],(function(){return t=43843,e(e.s=t);var t}));var t=e.O();_N_E=t}]);
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.