diff --git a/pancake-swap-interface-v1/build/asset-manifest.json b/pancake-swap-interface-v1/build/asset-manifest.json index 749b1bc..e733afb 100644 --- a/pancake-swap-interface-v1/build/asset-manifest.json +++ b/pancake-swap-interface-v1/build/asset-manifest.json @@ -2,8 +2,8 @@ "files": { "static/js/0.63e15dfd.chunk.js": "./static/js/0.63e15dfd.chunk.js", "static/js/0.63e15dfd.chunk.js.map": "./static/js/0.63e15dfd.chunk.js.map", - "main.js": "./static/js/main.20ff5f10.chunk.js", - "main.js.map": "./static/js/main.20ff5f10.chunk.js.map", + "main.js": "./static/js/main.814ff23e.chunk.js", + "main.js.map": "./static/js/main.814ff23e.chunk.js.map", "runtime-main.js": "./static/js/runtime-main.c7bcc3ad.js", "runtime-main.js.map": "./static/js/runtime-main.c7bcc3ad.js.map", "static/css/3.191f4a61.chunk.css": "./static/css/3.191f4a61.chunk.css", @@ -29,6 +29,6 @@ "static/js/runtime-main.c7bcc3ad.js", "static/css/3.191f4a61.chunk.css", "static/js/3.341de6fc.chunk.js", - "static/js/main.20ff5f10.chunk.js" + "static/js/main.814ff23e.chunk.js" ] } \ No newline at end of file diff --git a/pancake-swap-interface-v1/build/index.html b/pancake-swap-interface-v1/build/index.html index b26a4ab..3826129 100644 --- a/pancake-swap-interface-v1/build/index.html +++ b/pancake-swap-interface-v1/build/index.html @@ -1 +1 @@ -Pancake Swap
\ No newline at end of file +Pancake Swap
\ No newline at end of file diff --git a/pancake-swap-interface-v1/build/static/js/main.20ff5f10.chunk.js b/pancake-swap-interface-v1/build/static/js/main.20ff5f10.chunk.js deleted file mode 100644 index 44c3a99..0000000 --- a/pancake-swap-interface-v1/build/static/js/main.20ff5f10.chunk.js +++ /dev/null @@ -1,2 +0,0 @@ -(this["webpackJsonp@pancakeswap/interface"]=this["webpackJsonp@pancakeswap/interface"]||[]).push([[1],{114:function(e){e.exports=JSON.parse('[{"constant":true,"inputs":[],"name":"name","outputs":[{"name":"","type":"string"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"_spender","type":"address"},{"name":"_value","type":"uint256"}],"name":"approve","outputs":[{"name":"","type":"bool"}],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"totalSupply","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"_from","type":"address"},{"name":"_to","type":"address"},{"name":"_value","type":"uint256"}],"name":"transferFrom","outputs":[{"name":"","type":"bool"}],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"decimals","outputs":[{"name":"","type":"uint8"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"name":"_owner","type":"address"}],"name":"balanceOf","outputs":[{"name":"balance","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"symbol","outputs":[{"name":"","type":"string"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"_to","type":"address"},{"name":"_value","type":"uint256"}],"name":"transfer","outputs":[{"name":"","type":"bool"}],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[{"name":"_owner","type":"address"},{"name":"_spender","type":"address"}],"name":"allowance","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"payable":true,"stateMutability":"payable","type":"fallback"},{"anonymous":false,"inputs":[{"indexed":true,"name":"owner","type":"address"},{"indexed":true,"name":"spender","type":"address"},{"indexed":false,"name":"value","type":"uint256"}],"name":"Approval","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"name":"from","type":"address"},{"indexed":true,"name":"to","type":"address"},{"indexed":false,"name":"value","type":"uint256"}],"name":"Transfer","type":"event"}]')},146:function(e){e.exports=JSON.parse('{"name":"PancakeSwap Default List","timestamp":"2021-03-17T09:56:23Z","version":{"major":2,"minor":10,"patch":0},"tags":{},"logoURI":"https://exchange.pancakeswap.finance/images/pancakeswap.png","keywords":["pancake","default"],"tokens":[{"name":"WBNB Token","symbol":"WBNB","address":"0x0dE8FCAE8421fc79B29adE9ffF97854a424Cad09","chainId":97,"decimals":18,"logoURI":"https://exchange.pancakeswap.finance/images/coins/0xbb4cdb9cbd36b01bd1cbaebf2de08d9173bc095c.png"},{"name":"Bakery Token","symbol":"BAKE","address":"0xb289b361a633A9D2b0B39BAE76BB458d83f58CEC","chainId":97,"decimals":18,"logoURI":"https://exchange.pancakeswap.finance/images/coins/0xe02df9e3e622debdd69fb838bb799e3f168902c5.png"},{"name":"BUSD Token","symbol":"BUSD","address":"0xE0dFffc2E01A7f051069649aD4eb3F518430B6a4","chainId":97,"decimals":18,"logoURI":"https://exchange.pancakeswap.finance/images/coins/0xe9e7cea3dedca5984780bafc599bd69add087d56.png"},{"name":"Ethereum Token","symbol":"ETH","address":"0xE282a15DBad45e3131620C1b8AF85B7330Cb3b4B","chainId":97,"decimals":18,"logoURI":"https://exchange.pancakeswap.finance/images/coins/0x2170ed0880ac9a755fd29b2688956bd959f933f8.png"},{"name":"Tether USD","symbol":"USDT","address":"0x7afd064DaE94d73ee37d19ff2D264f5A2903bBB0","chainId":97,"decimals":18,"logoURI":"https://exchange.pancakeswap.finance/images/coins/0x55d398326f99059ff775485246999027b3197955.png"},{"name":"XRP Token","symbol":"XRP","address":"0x3833B175Af1900b457cf83B839727AF6C9cF0bEe","chainId":97,"decimals":18,"logoURI":"https://exchange.pancakeswap.finance/images/coins/0x1d2f0da169ceb9fc7b3144628db156f3f6c60dbe.png"},{"name":"Dai Token","symbol":"DAI","address":"0x3Cf204795c4995cCf9C1a0B3191F00c01B03C56C","chainId":97,"decimals":18,"logoURI":"https://exchange.pancakeswap.finance/images/coins/0x1af3f329e8be154074d8769d1ffa4ee058b1dbc3.png"},{"name":"PancakeSwap Token","symbol":"CAKE","address":"0xB8F5B50ed77596b5E638359d828000747bb3dd89","chainId":97,"decimals":18,"logoURI":"https://exchange.pancakeswap.finance/images/coins/0x0e09fabb73bd3ade0a17ecc321fd13a19e81ce82.png"}]}')},199:function(e){e.exports=JSON.parse('[{"constant":true,"inputs":[],"name":"name","outputs":[{"name":"","type":"bytes32"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"symbol","outputs":[{"name":"","type":"bytes32"}],"payable":false,"stateMutability":"view","type":"function"}]')},200:function(e){e.exports=JSON.parse('[{"constant":true,"inputs":[],"name":"getCurrentBlockTimestamp","outputs":[{"name":"timestamp","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"components":[{"name":"target","type":"address"},{"name":"callData","type":"bytes"}],"name":"calls","type":"tuple[]"}],"name":"aggregate","outputs":[{"name":"blockNumber","type":"uint256"},{"name":"returnData","type":"bytes[]"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"getLastBlockHash","outputs":[{"name":"blockHash","type":"bytes32"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"name":"addr","type":"address"}],"name":"getEthBalance","outputs":[{"name":"balance","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"getCurrentBlockDifficulty","outputs":[{"name":"difficulty","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"getCurrentBlockGasLimit","outputs":[{"name":"gaslimit","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"getCurrentBlockCoinbase","outputs":[{"name":"coinbase","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"name":"blockNumber","type":"uint256"}],"name":"getBlockHash","outputs":[{"name":"blockHash","type":"bytes32"}],"payable":false,"stateMutability":"view","type":"function"}]')},229:function(e){e.exports=JSON.parse('[{"inputs":[{"internalType":"contract ENS","name":"_old","type":"address"}],"payable":false,"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":true,"internalType":"address","name":"operator","type":"address"},{"indexed":false,"internalType":"bool","name":"approved","type":"bool"}],"name":"ApprovalForAll","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"node","type":"bytes32"},{"indexed":true,"internalType":"bytes32","name":"label","type":"bytes32"},{"indexed":false,"internalType":"address","name":"owner","type":"address"}],"name":"NewOwner","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"node","type":"bytes32"},{"indexed":false,"internalType":"address","name":"resolver","type":"address"}],"name":"NewResolver","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"node","type":"bytes32"},{"indexed":false,"internalType":"uint64","name":"ttl","type":"uint64"}],"name":"NewTTL","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"node","type":"bytes32"},{"indexed":false,"internalType":"address","name":"owner","type":"address"}],"name":"Transfer","type":"event"},{"constant":true,"inputs":[{"internalType":"address","name":"owner","type":"address"},{"internalType":"address","name":"operator","type":"address"}],"name":"isApprovedForAll","outputs":[{"internalType":"bool","name":"","type":"bool"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"old","outputs":[{"internalType":"contract ENS","name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"internalType":"bytes32","name":"node","type":"bytes32"}],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"internalType":"bytes32","name":"node","type":"bytes32"}],"name":"recordExists","outputs":[{"internalType":"bool","name":"","type":"bool"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"internalType":"bytes32","name":"node","type":"bytes32"}],"name":"resolver","outputs":[{"internalType":"address","name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"internalType":"address","name":"operator","type":"address"},{"internalType":"bool","name":"approved","type":"bool"}],"name":"setApprovalForAll","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"internalType":"bytes32","name":"node","type":"bytes32"},{"internalType":"address","name":"owner","type":"address"}],"name":"setOwner","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"internalType":"bytes32","name":"node","type":"bytes32"},{"internalType":"address","name":"owner","type":"address"},{"internalType":"address","name":"resolver","type":"address"},{"internalType":"uint64","name":"ttl","type":"uint64"}],"name":"setRecord","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"internalType":"bytes32","name":"node","type":"bytes32"},{"internalType":"address","name":"resolver","type":"address"}],"name":"setResolver","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"internalType":"bytes32","name":"node","type":"bytes32"},{"internalType":"bytes32","name":"label","type":"bytes32"},{"internalType":"address","name":"owner","type":"address"}],"name":"setSubnodeOwner","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"internalType":"bytes32","name":"node","type":"bytes32"},{"internalType":"bytes32","name":"label","type":"bytes32"},{"internalType":"address","name":"owner","type":"address"},{"internalType":"address","name":"resolver","type":"address"},{"internalType":"uint64","name":"ttl","type":"uint64"}],"name":"setSubnodeRecord","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"internalType":"bytes32","name":"node","type":"bytes32"},{"internalType":"uint64","name":"ttl","type":"uint64"}],"name":"setTTL","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[{"internalType":"bytes32","name":"node","type":"bytes32"}],"name":"ttl","outputs":[{"internalType":"uint64","name":"","type":"uint64"}],"payable":false,"stateMutability":"view","type":"function"}]')},230:function(e){e.exports=JSON.parse('[{"inputs":[{"internalType":"contract ENS","name":"_ens","type":"address"}],"payable":false,"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"node","type":"bytes32"},{"indexed":true,"internalType":"uint256","name":"contentType","type":"uint256"}],"name":"ABIChanged","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"node","type":"bytes32"},{"indexed":false,"internalType":"address","name":"a","type":"address"}],"name":"AddrChanged","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"node","type":"bytes32"},{"indexed":false,"internalType":"uint256","name":"coinType","type":"uint256"},{"indexed":false,"internalType":"bytes","name":"newAddress","type":"bytes"}],"name":"AddressChanged","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"node","type":"bytes32"},{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":true,"internalType":"address","name":"target","type":"address"},{"indexed":false,"internalType":"bool","name":"isAuthorised","type":"bool"}],"name":"AuthorisationChanged","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"node","type":"bytes32"},{"indexed":false,"internalType":"bytes","name":"hash","type":"bytes"}],"name":"ContenthashChanged","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"node","type":"bytes32"},{"indexed":false,"internalType":"bytes","name":"name","type":"bytes"},{"indexed":false,"internalType":"uint16","name":"resource","type":"uint16"},{"indexed":false,"internalType":"bytes","name":"record","type":"bytes"}],"name":"DNSRecordChanged","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"node","type":"bytes32"},{"indexed":false,"internalType":"bytes","name":"name","type":"bytes"},{"indexed":false,"internalType":"uint16","name":"resource","type":"uint16"}],"name":"DNSRecordDeleted","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"node","type":"bytes32"}],"name":"DNSZoneCleared","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"node","type":"bytes32"},{"indexed":true,"internalType":"bytes4","name":"interfaceID","type":"bytes4"},{"indexed":false,"internalType":"address","name":"implementer","type":"address"}],"name":"InterfaceChanged","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"node","type":"bytes32"},{"indexed":false,"internalType":"string","name":"name","type":"string"}],"name":"NameChanged","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"node","type":"bytes32"},{"indexed":false,"internalType":"bytes32","name":"x","type":"bytes32"},{"indexed":false,"internalType":"bytes32","name":"y","type":"bytes32"}],"name":"PubkeyChanged","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"node","type":"bytes32"},{"indexed":true,"internalType":"string","name":"indexedKey","type":"string"},{"indexed":false,"internalType":"string","name":"key","type":"string"}],"name":"TextChanged","type":"event"},{"constant":true,"inputs":[{"internalType":"bytes32","name":"node","type":"bytes32"},{"internalType":"uint256","name":"contentTypes","type":"uint256"}],"name":"ABI","outputs":[{"internalType":"uint256","name":"","type":"uint256"},{"internalType":"bytes","name":"","type":"bytes"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"internalType":"bytes32","name":"node","type":"bytes32"}],"name":"addr","outputs":[{"internalType":"address payable","name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"internalType":"bytes32","name":"","type":"bytes32"},{"internalType":"address","name":"","type":"address"},{"internalType":"address","name":"","type":"address"}],"name":"authorisations","outputs":[{"internalType":"bool","name":"","type":"bool"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"internalType":"bytes32","name":"node","type":"bytes32"}],"name":"clearDNSZone","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[{"internalType":"bytes32","name":"node","type":"bytes32"}],"name":"contenthash","outputs":[{"internalType":"bytes","name":"","type":"bytes"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"internalType":"bytes32","name":"node","type":"bytes32"},{"internalType":"bytes32","name":"name","type":"bytes32"},{"internalType":"uint16","name":"resource","type":"uint16"}],"name":"dnsRecord","outputs":[{"internalType":"bytes","name":"","type":"bytes"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"internalType":"bytes32","name":"node","type":"bytes32"},{"internalType":"bytes32","name":"name","type":"bytes32"}],"name":"hasDNSRecords","outputs":[{"internalType":"bool","name":"","type":"bool"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"internalType":"bytes32","name":"node","type":"bytes32"},{"internalType":"bytes4","name":"interfaceID","type":"bytes4"}],"name":"interfaceImplementer","outputs":[{"internalType":"address","name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"internalType":"bytes32","name":"node","type":"bytes32"}],"name":"name","outputs":[{"internalType":"string","name":"","type":"string"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"internalType":"bytes32","name":"node","type":"bytes32"}],"name":"pubkey","outputs":[{"internalType":"bytes32","name":"x","type":"bytes32"},{"internalType":"bytes32","name":"y","type":"bytes32"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"internalType":"bytes32","name":"node","type":"bytes32"},{"internalType":"uint256","name":"contentType","type":"uint256"},{"internalType":"bytes","name":"data","type":"bytes"}],"name":"setABI","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"internalType":"bytes32","name":"node","type":"bytes32"},{"internalType":"uint256","name":"coinType","type":"uint256"},{"internalType":"bytes","name":"a","type":"bytes"}],"name":"setAddr","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"internalType":"bytes32","name":"node","type":"bytes32"},{"internalType":"address","name":"a","type":"address"}],"name":"setAddr","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"internalType":"bytes32","name":"node","type":"bytes32"},{"internalType":"address","name":"target","type":"address"},{"internalType":"bool","name":"isAuthorised","type":"bool"}],"name":"setAuthorisation","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"internalType":"bytes32","name":"node","type":"bytes32"},{"internalType":"bytes","name":"hash","type":"bytes"}],"name":"setContenthash","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"internalType":"bytes32","name":"node","type":"bytes32"},{"internalType":"bytes","name":"data","type":"bytes"}],"name":"setDNSRecords","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"internalType":"bytes32","name":"node","type":"bytes32"},{"internalType":"bytes4","name":"interfaceID","type":"bytes4"},{"internalType":"address","name":"implementer","type":"address"}],"name":"setInterface","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"internalType":"bytes32","name":"node","type":"bytes32"},{"internalType":"string","name":"name","type":"string"}],"name":"setName","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"internalType":"bytes32","name":"node","type":"bytes32"},{"internalType":"bytes32","name":"x","type":"bytes32"},{"internalType":"bytes32","name":"y","type":"bytes32"}],"name":"setPubkey","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"internalType":"bytes32","name":"node","type":"bytes32"},{"internalType":"string","name":"key","type":"string"},{"internalType":"string","name":"value","type":"string"}],"name":"setText","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[{"internalType":"bytes4","name":"interfaceID","type":"bytes4"}],"name":"supportsInterface","outputs":[{"internalType":"bool","name":"","type":"bool"}],"payable":false,"stateMutability":"pure","type":"function"},{"constant":true,"inputs":[{"internalType":"bytes32","name":"node","type":"bytes32"},{"internalType":"string","name":"key","type":"string"}],"name":"text","outputs":[{"internalType":"string","name":"","type":"string"}],"payable":false,"stateMutability":"view","type":"function"}]')},231:function(e){e.exports=JSON.parse('[{"constant":true,"inputs":[],"name":"name","outputs":[{"name":"","type":"string"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"guy","type":"address"},{"name":"wad","type":"uint256"}],"name":"approve","outputs":[{"name":"","type":"bool"}],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"totalSupply","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"src","type":"address"},{"name":"dst","type":"address"},{"name":"wad","type":"uint256"}],"name":"transferFrom","outputs":[{"name":"","type":"bool"}],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"wad","type":"uint256"}],"name":"withdraw","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"decimals","outputs":[{"name":"","type":"uint8"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"name":"","type":"address"}],"name":"balanceOf","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"symbol","outputs":[{"name":"","type":"string"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"dst","type":"address"},{"name":"wad","type":"uint256"}],"name":"transfer","outputs":[{"name":"","type":"bool"}],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[],"name":"deposit","outputs":[],"payable":true,"stateMutability":"payable","type":"function"},{"constant":true,"inputs":[{"name":"","type":"address"},{"name":"","type":"address"}],"name":"allowance","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"payable":true,"stateMutability":"payable","type":"fallback"},{"anonymous":false,"inputs":[{"indexed":true,"name":"src","type":"address"},{"indexed":true,"name":"guy","type":"address"},{"indexed":false,"name":"wad","type":"uint256"}],"name":"Approval","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"name":"src","type":"address"},{"indexed":true,"name":"dst","type":"address"},{"indexed":false,"name":"wad","type":"uint256"}],"name":"Transfer","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"name":"dst","type":"address"},{"indexed":false,"name":"wad","type":"uint256"}],"name":"Deposit","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"name":"src","type":"address"},{"indexed":false,"name":"wad","type":"uint256"}],"name":"Withdrawal","type":"event"}]')},310:function(e,n){},410:function(e,n,t){"use strict";t.r(n);var r=t(1),i=t(0),a=t.n(i),c=t(73),o=t.n(c),s=t(2),u=t(9),l=t(4);function d(){var e=Object(u.a)(["\n body {\n background-color: ",";\n\n img {\n height: auto;\n max-width: 100%;\n }\n }\n"]);return d=function(){return e},e}var b,p=Object(l.createGlobalStyle)(d(),(function(e){return e.theme.colors.background})),f=t(11),j=t(38),h=t(39),v=t(21),m=t(51),O=t(117),y=t(17),x=t(167),g=t(118),C=t(119),w=t(221),k=t(136),T=t(12),I=t(7),E=t.n(I),N=t(120),S=t(32),R=t(10),U=t(14),A=t(15),z=t(122),B=t(78),P=t(20),M=function(e){Object(U.a)(t,e);var n=Object(A.a)(t);function t(e,r,i){var a;return Object(R.a)(this,t),(a=n.call(this,e)).code=r,a.data=i,a}return t}(Object(z.a)(Error)),D=function e(n,t,r){var i=this;Object(R.a)(this,e),this.isMetaMask=!1,this.chainId=void 0,this.url=void 0,this.host=void 0,this.path=void 0,this.batchWaitTimeMs=void 0,this.nextId=1,this.batchTimeoutId=null,this.batch=[],this.clearBatch=Object(S.a)(E.a.mark((function e(){var n,t,r,a,c,o,s,u,l,d,b,p,f,j;return E.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=i.batch,i.batch=[],i.batchTimeoutId=null,e.prev=3,e.next=6,fetch(i.url,{method:"POST",headers:{"content-type":"application/json",accept:"application/json"},body:JSON.stringify(n.map((function(e){return e.request})))});case 6:t=e.sent,e.next=13;break;case 9:return e.prev=9,e.t0=e.catch(3),n.forEach((function(e){return(0,e.reject)(new Error("Failed to send batch call"))})),e.abrupt("return");case 13:if(t.ok){e.next=16;break}return n.forEach((function(e){return(0,e.reject)(new M("".concat(t.status,": ").concat(t.statusText),-32e3))})),e.abrupt("return");case 16:return e.prev=16,e.next=19,t.json();case 19:r=e.sent,e.next=26;break;case 22:return e.prev=22,e.t1=e.catch(16),n.forEach((function(e){return(0,e.reject)(new Error("Failed to parse JSON response"))})),e.abrupt("return");case 26:a=n.reduce((function(e,n){return e[n.request.id]=n,e}),{}),c=Object(N.a)(r);try{for(c.s();!(o=c.n()).done;)s=o.value,u=a[s.id],l=u.resolve,d=u.reject,b=u.request.method,l&&d&&("error"in s?d(new M(null===s||void 0===s||null===(p=s.error)||void 0===p?void 0:p.message,null===s||void 0===s||null===(f=s.error)||void 0===f?void 0:f.code,null===s||void 0===s||null===(j=s.error)||void 0===j?void 0:j.data)):"result"in s?l(s.result):d(new M("Received unexpected JSON-RPC response to ".concat(b," request."),-32e3,s)))}catch(h){c.e(h)}finally{c.f()}case 29:case"end":return e.stop()}}),e,null,[[3,9],[16,22]])}))),this.sendAsync=function(e,n){i.request(e.method,e.params).then((function(t){return n(null,{jsonrpc:"2.0",id:e.id,result:t})})).catch((function(e){return n(e,null)}))},this.request=function(){var e=Object(S.a)(E.a.mark((function e(n,t){var r,a;return E.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if("string"===typeof n){e.next=2;break}return e.abrupt("return",i.request(n.method,n.params));case 2:if("eth_chainId"!==n){e.next=4;break}return e.abrupt("return","0x".concat(i.chainId.toString(16)));case 4:return a=new Promise((function(e,r){i.batch.push({request:{jsonrpc:"2.0",id:i.nextId++,method:n,params:t},resolve:e,reject:r})})),i.batchTimeoutId=null!==(r=i.batchTimeoutId)&&void 0!==r?r:setTimeout(i.clearBatch,i.batchWaitTimeMs),e.abrupt("return",a);case 7:case"end":return e.stop()}}),e)})));return function(n,t){return e.apply(this,arguments)}}(),this.chainId=n,this.url=t;var a=new URL(t);this.host=a.host,this.path=a.pathname,this.batchWaitTimeMs=null!==r&&void 0!==r?r:50},L=function(e){Object(U.a)(t,e);var n=Object(A.a)(t);function t(e){var r,i=e.urls,a=e.defaultChainId;return Object(R.a)(this,t),Object(P.a)(a||1===Object.keys(i).length,"defaultChainId is a required argument with >1 url"),(r=n.call(this,{supportedChainIds:Object.keys(i).map((function(e){return Number(e)}))})).providers=void 0,r.currentChainId=void 0,r.currentChainId=a||Number(Object.keys(i)[0]),r.providers=Object.keys(i).reduce((function(e,n){return e[Number(n)]=new D(Number(n),i[Number(n)]),e}),{}),r}return Object(T.a)(t,[{key:"activate",value:function(){var e=Object(S.a)(E.a.mark((function e(){return E.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",{provider:this.providers[this.currentChainId],chainId:this.currentChainId,account:null});case 1:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()},{key:"getProvider",value:function(){var e=Object(S.a)(E.a.mark((function e(){return E.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.providers[this.currentChainId]);case 1:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()},{key:"getChainId",value:function(){var e=Object(S.a)(E.a.mark((function e(){return E.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.currentChainId);case 1:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()},{key:"getAccount",value:function(){var e=Object(S.a)(E.a.mark((function e(){return E.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",null);case 1:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}()},{key:"deactivate",value:function(){return null}},{key:"provider",get:function(){return this.providers[this.currentChainId]}}]),t}(B.AbstractConnector),_="https://bsc-dataseed1.defibit.io",Y=parseInt(null!=="56"?"56":"97");var F,q=new L({urls:Object(y.a)({},Y,_)});var V,W=new g.a({supportedChainIds:[97]}),H=new k.BscConnector({supportedChainIds:[97]}),Q=new C.b({rpc:Object(y.a)({},Y,_),bridge:"https://bridge.walletconnect.org",qrcode:!0,pollingInterval:15e3}),G=(new w.a({url:_,appName:"Uniswap",appLogoUrl:"https://mpng.pngfly.com/20181202/bex/kisspng-emoji-domain-unicorn-pin-badges-sticker-unicorn-tumblr-emoji-unicorn-iphoneemoji-5c046729264a77.5671679315437924251569.jpg"}),b={},Object(y.a)(b,s.l.Injected,W),Object(y.a)(b,s.l.WalletConnect,Q),Object(y.a)(b,s.l.BSC,H),b),K=t(27),X=t(13),J=t(5),$="0xCc7aDc94F3D80127849D2b41b6439b7CF1eB4Ae0",Z=new J.j(J.a.BSCTESTNET,"0xB8F5B50ed77596b5E638359d828000747bb3dd89",18,"CAKE","PancakeSwap Token"),ee=new J.j(J.a.BSCTESTNET,"0x0dE8FCAE8421fc79B29adE9ffF97854a424Cad09",18,"WBNB","Wrapped BNB"),ne=new J.j(J.a.BSCTESTNET,"0x3Cf204795c4995cCf9C1a0B3191F00c01B03C56C",18,"DAI","Dai Stablecoin"),te=new J.j(J.a.BSCTESTNET,"0xE0dFffc2E01A7f051069649aD4eb3F518430B6a4",18,"BUSD","Binance USD"),re=new J.j(J.a.BSCTESTNET,"0x7afd064DaE94d73ee37d19ff2D264f5A2903bBB0",18,"USDT","Tether USD"),ie=new J.j(J.a.BSCTESTNET,"0xE282a15DBad45e3131620C1b8AF85B7330Cb3b4B",18,"ETH","Binance-Peg Ethereum Token"),ae=(V={},Object(y.a)(V,J.a.MAINNET,[J.n[J.a.MAINNET]]),Object(y.a)(V,J.a.BSCTESTNET,[J.n[J.a.BSCTESTNET]]),V),ce=Object(X.a)(Object(X.a)({},ae),{},Object(y.a)({},J.a.BSCTESTNET,[].concat(Object(K.a)(ae[J.a.BSCTESTNET]),[ne,te,re,ie]))),oe=Object(y.a)({},J.a.BSCTESTNET,{}),se=Object(X.a)(Object(X.a)({},ae),{},Object(y.a)({},J.a.BSCTESTNET,[].concat(Object(K.a)(ae[J.a.BSCTESTNET]),[ne,te,re]))),ue=Object(X.a)(Object(X.a)({},ae),{},Object(y.a)({},J.a.BSCTESTNET,[].concat(Object(K.a)(ae[J.a.BSCTESTNET]),[ne,te,re]))),le=Object(y.a)({},J.a.BSCTESTNET,[[Z,ee],[te,re],[ne,re]]),de="NETWORK",be=80,pe=1200,fe=new J.g(J.e.BigInt(1),J.e.BigInt(1e4)),je=J.e.BigInt(1e4),he=new J.g(J.e.BigInt(100),je),ve=new J.g(J.e.BigInt(300),je),me=new J.g(J.e.BigInt(500),je),Oe=new J.g(J.e.BigInt(1e3),je),ye=new J.g(J.e.BigInt(1500),je),xe=J.e.exponentiate(J.e.BigInt(10),J.e.BigInt(16));function ge(){var e=Object(m.d)(),n=Object(m.d)(de);return e.active?e:n}var Ce=t(22),we=Object(Ce.b)("app/updateBlockNumber"),ke=Object(Ce.b)("app/toggleWalletModal"),Te=Object(Ce.b)("app/toggleSettingsMenu"),Ie=Object(Ce.b)("app/addPopup"),Ee=Object(Ce.b)("app/removePopup");function Ne(){var e=ge().chainId;return Object(v.d)((function(n){return n.application.blockNumber[null!==e&&void 0!==e?e:-1]}))}function Se(){var e=Object(v.c)();return Object(i.useCallback)((function(n){e(Ee({key:n}))}),[e])}function Re(){var e=Object(u.a)(["\n display: grid;\n grid-auto-rows: auto;\n grid-row-gap: ",";\n justify-items: ",";\n"]);return Re=function(){return e},e}function Ue(){var e=Object(u.a)(["\n width: 100%;\n align-items: center;\n"]);return Ue=function(){return e},e}function Ae(){var e=Object(u.a)(["\n display: flex;\n flex-direction: column;\n justify-content: flex-start;\n"]);return Ae=function(){return e},e}var ze=l.default.div(Ae()),Be=Object(l.default)(ze)(Ue()),Pe=l.default.div(Re(),(function(e){var n=e.gap;return("sm"===n?"8px":"md"===n&&"12px")||"lg"===n&&"24px"||n}),(function(e){var n=e.justify;return n&&n})),Me=ze,De=t(426),Le=t(89),_e=t(61),Ye={pending:Object(Ce.b)("lists/fetchTokenList/pending"),fulfilled:Object(Ce.b)("lists/fetchTokenList/fulfilled"),rejected:Object(Ce.b)("lists/fetchTokenList/rejected")},Fe=Object(Ce.b)("lists/acceptListUpdate"),qe=Object(Ce.b)("lists/addList"),Ve=Object(Ce.b)("lists/removeList"),We=Object(Ce.b)("lists/selectList");Object(Ce.b)("lists/rejectVersionUpdate");function He(e){return"v".concat(e.major,".").concat(e.minor,".").concat(e.patch)}var Qe=t(225);function Ge(){var e=Object(u.a)(["\n width: fit-content;\n margin: ",";\n"]);return Ge=function(){return e},e}function Ke(){var e=Object(u.a)(["\n flex-wrap: wrap;\n margin: ",";\n justify-content: ",";\n\n & > * {\n margin: "," !important;\n }\n"]);return Ke=function(){return e},e}function Xe(){var e=Object(u.a)(["\n display: flex;\n align-items: flex-end;\n"]);return Xe=function(){return e},e}function Je(){var e=Object(u.a)(["\n justify-content: space-between;\n"]);return Je=function(){return e},e}function $e(){var e=Object(u.a)(["\n width: 100%;\n display: flex;\n padding: 0;\n align-items: ",";\n padding: ",";\n border: ",";\n border-radius: ",";\n"]);return $e=function(){return e},e}var Ze=Object(l.default)(Qe.Box)($e(),(function(e){return e.align||"center"}),(function(e){return e.padding}),(function(e){return e.border}),(function(e){return e.borderRadius})),en=Object(l.default)(Ze)(Je()),nn=l.default.div(Xe()),tn=Object(l.default)(Ze)(Ke(),(function(e){var n=e.gap;return n&&"-".concat(n)}),(function(e){var n=e.justify;return n&&n}),(function(e){return e.gap})),rn=Object(l.default)(Ze)(Ge(),(function(e){var n=e.gap;return n&&"-".concat(n)})),an=Ze;function cn(e){var n=e.popKey,t=e.listUrl,c=e.oldList,o=e.newList,u=e.auto,l=Se(),d=Object(i.useCallback)((function(){return l(n)}),[n,l]),b=Object(v.c)(),p=Object(i.useCallback)((function(){u||(b(Fe(t)),d())}),[u,b,t,d]),f=Object(i.useMemo)((function(){return Object(_e.b)(c.tokens,o.tokens)}),[o.tokens,c.tokens]),j=f.added,h=f.changed,m=f.removed,O=Object(i.useMemo)((function(){return Object.keys(h).reduce((function(e,n){return e+Object.keys(h[n]).length}),0)}),[h]);return Object(r.jsx)(tn,{children:Object(r.jsx)(Pe,{style:{flex:"1"},gap:"8px",children:u?Object(r.jsxs)(s.z,{children:['The token list "',c.name,'" has been updated to'," ",Object(r.jsx)("strong",{children:He(o.version)}),"."]}):Object(r.jsxs)(r.Fragment,{children:[Object(r.jsxs)("div",{children:[Object(r.jsxs)(s.z,{fontSize:"14px",children:['An update is available for the token list "',c.name,'" (',He(c.version)," to ",He(o.version),")."]}),Object(r.jsxs)("ul",{children:[j.length>0?Object(r.jsxs)("li",{children:[j.map((function(e,n){return Object(r.jsxs)(a.a.Fragment,{children:[Object(r.jsx)("strong",{title:e.address,children:e.symbol}),n===j.length-1?null:", "]},"".concat(e.chainId,"-").concat(e.address))}))," ","added"]}):null,m.length>0?Object(r.jsxs)("li",{children:[m.map((function(e,n){return Object(r.jsxs)(a.a.Fragment,{children:[Object(r.jsx)("strong",{title:e.address,children:e.symbol}),n===m.length-1?null:", "]},"".concat(e.chainId,"-").concat(e.address))}))," ","removed"]}):null,O>0?Object(r.jsxs)("li",{children:[O," tokens updated"]}):null]})]}),Object(r.jsxs)(tn,{children:[Object(r.jsx)("div",{style:{flexGrow:1,marginRight:12},children:Object(r.jsx)(s.d,{onClick:p,children:"Accept update"})}),Object(r.jsx)("div",{style:{flexGrow:1},children:Object(r.jsx)(s.d,{onClick:d,children:"Dismiss"})})]})]})})})}var on=t(424),sn=t(425),un=t(90),ln=t(30),dn=t(413),bn=t(24),pn=t(226);function fn(e){try{return Object(ln.getAddress)(e)}catch(n){return!1}}var jn={56:"",97:"testnet."};function hn(e,n,t){var r="https://".concat(jn[e]||jn[J.a.MAINNET],"bscscan.com");switch(t){case"transaction":return"".concat(r,"/tx/").concat(n);case"token":return"".concat(r,"/token/").concat(n);case"address":default:return"".concat(r,"/address/").concat(n)}}function vn(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:4,t=fn(e);if(!t)throw Error("Invalid 'address' parameter '".concat(e,"'."));return"".concat(t.substring(0,n+2),"...").concat(t.substring(42-n))}function mn(e){return e.mul(bn.a.from(1e4).add(bn.a.from(1e3))).div(bn.a.from(1e4))}function On(e,n){if(n<0||n>1e4)throw Error("Unexpected slippage value: ".concat(n));return[J.e.divide(J.e.multiply(e.raw,J.e.BigInt(1e4-n)),J.e.BigInt(1e4)),J.e.divide(J.e.multiply(e.raw,J.e.BigInt(1e4+n)),J.e.BigInt(1e4))]}function yn(e,n,t,r){if(!fn(e)||e===dn.a)throw Error("Invalid 'address' parameter '".concat(e,"'."));return new un.a(e,n,function(e,n){return n?function(e,n){return e.getSigner(n).connectUnchecked()}(e,n):e}(t,r))}function xn(e,n,t){return yn($,pn.a,n,t)}var gn=t(53);function Cn(){var e=Object(u.a)(["\n animation: 2s "," linear infinite;\n width: 16px;\n height: 16px;\n"]);return Cn=function(){return e},e}function wn(){var e=Object(u.a)(["\n from {\n transform: rotate(0deg);\n }\n to {\n transform: rotate(360deg);\n }\n"]);return wn=function(){return e},e}function kn(){var e=Object(u.a)(["\n text-decoration: none;\n cursor: pointer;\n color: ",";\n font-weight: 500;\n\n :hover {\n text-decoration: underline;\n }\n\n :focus {\n outline: none;\n text-decoration: underline;\n }\n\n :active {\n text-decoration: none;\n }\n"]);return kn=function(){return e},e}function Tn(){var e=Object(u.a)(["\n text-decoration: none;\n cursor: pointer;\n color: ",";\n font-weight: 500;\n\n :hover {\n text-decoration: underline;\n }\n\n :focus {\n outline: none;\n text-decoration: underline;\n }\n\n :active {\n text-decoration: none;\n }\n"]);return Tn=function(){return e},e}function In(){var e=Object(u.a)(["\n border: none;\n text-decoration: none;\n background: none;\n\n cursor: ",";\n color: ",";\n font-weight: 500;\n\n :hover {\n text-decoration: ",";\n }\n\n :focus {\n outline: none;\n text-decoration: ",";\n }\n\n :active {\n text-decoration: none;\n }\n"]);return In=function(){return e},e}var En=l.default.button(In(),(function(e){return e.disabled?"default":"pointer"}),(function(e){var n=e.theme;return e.disabled?n.colors.textSubtle:n.colors.primary}),(function(e){return e.disabled?null:"underline"}),(function(e){return e.disabled?null:"underline"})),Nn=Object(l.default)(j.b)(Tn(),(function(e){return e.theme.colors.primary})),Sn=l.default.a(kn(),(function(e){return e.theme.colors.primary}));function Rn(e){var n=e.target,t=void 0===n?"_blank":n,a=e.href,c=e.rel,o=void 0===c?"noopener noreferrer":c,s=Object(gn.a)(e,["target","href","rel"]),u=Object(i.useCallback)((function(e){"_blank"===t||e.ctrlKey||e.metaKey||e.preventDefault()}),[t]);return Object(r.jsx)(Sn,Object(X.a)({target:t,rel:o,href:a,onClick:u},s))}var Un=Object(l.keyframes)(wn()),An=l.default.img(Cn(),Un);function zn(){var e=Object(u.a)(["\n flex-wrap: nowrap;\n"]);return zn=function(){return e},e}var Bn=Object(l.default)(tn)(zn());function Pn(e){var n=e.hash,t=e.success,a=e.summary,c=ge().chainId,o=Object(i.useContext)(l.ThemeContext);return Object(r.jsxs)(Bn,{children:[Object(r.jsx)("div",{style:{paddingRight:16},children:t?Object(r.jsx)(on.a,{color:o.colors.success,size:24}):Object(r.jsx)(sn.a,{color:o.colors.failure,size:24})}),Object(r.jsxs)(Pe,{gap:"8px",children:[Object(r.jsx)(s.z,{children:null!==a&&void 0!==a?a:"Hash: ".concat(n.slice(0,8),"...").concat(n.slice(58,65))}),c&&Object(r.jsx)(Rn,{href:hn(c,n,"transaction"),children:"View on bscscan"})]})]})}function Mn(){var e=Object(u.a)(["\n position: absolute;\n bottom: 0px;\n left: 0px;\n width: 100%;\n height: 2px;\n background-color: ",";\n"]);return Mn=function(){return e},e}function Dn(){var e=Object(u.a)(["\n display: inline-block;\n width: 100%;\n padding: 1em;\n background-color: ",";\n position: relative;\n border-radius: 10px;\n padding: 20px;\n padding-right: 35px;\n overflow: hidden;\n\n "," {\n min-width: 290px;\n }\n"]);return Dn=function(){return e},e}function Ln(){var e=Object(u.a)(["\n position: absolute;\n right: 10px;\n top: 10px;\n\n :hover {\n cursor: pointer;\n }\n"]);return Ln=function(){return e},e}var _n=Object(l.default)(De.a)(Ln()),Yn=l.default.div(Dn(),(function(e){return e.theme.colors.invertedContrast}),(function(e){return e.theme.mediaQueries.sm})),Fn=l.default.div(Mn(),(function(e){return e.theme.colors.tertiary})),qn=Object(Le.a)(Fn);function Vn(e){var n=e.removeAfterMs,t=e.content,a=e.popKey,c=Se(),o=Object(i.useCallback)((function(){return c(a)}),[a,c]);Object(i.useEffect)((function(){if(null!==n){var e=setTimeout((function(){o()}),n);return function(){clearTimeout(e)}}}),[n,o]);var s,u=Object(i.useContext)(l.ThemeContext);if("txn"in t){var d=t.txn,b=d.hash,p=d.success,f=d.summary;s=Object(r.jsx)(Pn,{hash:b,success:p,summary:f})}else if("listUpdate"in t){var j=t.listUpdate,h=j.listUrl,v=j.oldList,m=j.newList,O=j.auto;s=Object(r.jsx)(cn,{popKey:a,listUrl:h,oldList:v,newList:m,auto:O})}var y=Object(Le.b)({from:{width:"100%"},to:{width:"0%"},config:{duration:null!==n&&void 0!==n?n:void 0}});return Object(r.jsxs)(Yn,{children:[Object(r.jsx)(_n,{color:u.colors.textSubtle,onClick:o}),s,null!==n?Object(r.jsx)(qn,{style:y}):null]})}function Wn(){var e=Object(u.a)(["\n position: fixed;\n top: 64px;\n right: 1rem;\n max-width: 355px !important;\n width: 100%;\n z-index: 2;\n\n "," {\n display: none;\n }\n"]);return Wn=function(){return e},e}function Hn(){var e=Object(u.a)(["\n height: 99%;\n overflow-x: auto;\n overflow-y: hidden;\n display: flex;\n flex-direction: row;\n -webkit-overflow-scrolling: touch;\n ::-webkit-scrollbar {\n display: none;\n }\n"]);return Hn=function(){return e},e}function Qn(){var e=Object(u.a)(["\n position: relative;\n max-width: 100%;\n height: ",";\n margin: ",";\n margin-bottom: ","};\n display: none;\n\n "," {\n display: block;\n }\n"]);return Qn=function(){return e},e}var Gn=l.default.div(Qn(),(function(e){return e.height}),(function(e){return e.height?"0 auto;":0}),(function(e){return e.height?"20px":0}),(function(e){return e.theme.mediaQueries.sm})),Kn=l.default.div(Hn()),Xn=Object(l.default)(Pe)(Wn(),(function(e){return e.theme.mediaQueries.sm}));function Jn(){var e=function(){var e=Object(v.d)((function(e){return e.application.popupList}));return Object(i.useMemo)((function(){return e.filter((function(e){return e.show}))}),[e])}();return Object(r.jsxs)(r.Fragment,{children:[Object(r.jsx)(Xn,{gap:"20px",children:e.map((function(e){return Object(r.jsx)(Vn,{content:e.content,popKey:e.key,removeAfterMs:e.removeAfterMs},e.key)}))}),Object(r.jsx)(Gn,{height:(null===e||void 0===e?void 0:e.length)>0?"fit-content":0,children:Object(r.jsx)(Kn,{children:e.slice(0).reverse().map((function(e){return Object(r.jsx)(Vn,{content:e.content,popKey:e.key,removeAfterMs:e.removeAfterMs},e.key)}))})})]})}var $n=t(104);function Zn(){var e=Object(u.a)(["\n animation: 2s "," linear infinite;\n height: ",";\n width: ",";\n path {\n stroke: ",";\n }\n"]);return Zn=function(){return e},e}function et(){var e=Object(u.a)(["\n from {\n transform: rotate(0deg);\n }\n to {\n transform: rotate(360deg);\n }\n"]);return et=function(){return e},e}var nt=Object(l.keyframes)(et()),tt=l.default.svg(Zn(),nt,(function(e){return e.size}),(function(e){return e.size}),(function(e){var n=e.stroke,t=e.theme;return null!==n&&void 0!==n?n:t.colors.primary}));function rt(e){var n=e.size,t=void 0===n?"16px":n,i=e.stroke,a=Object(gn.a)(e,["size","stroke"]);return Object(r.jsx)(tt,Object(X.a)(Object(X.a)({viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",size:t,stroke:i},a),{},{children:Object(r.jsx)("path",{d:"M12 2C6.47715 2 2 6.47715 2 12C2 17.5228 6.47715 22 12 22C17.5228 22 22 17.5228 22 12C22 9.27455 20.9097 6.80375 19.1414 5",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round"})}))}function it(){var e=Object(u.a)(["\n color: ",";\n"]);return it=function(){return e},e}function at(){var e=Object(u.a)(["\n display: flex;\n align-items: center;\n justify-content: center;\n height: 20rem;\n"]);return at=function(){return e},e}var ct=l.default.div(at()),ot=l.default.h2(it(),(function(e){return e.theme.colors.primaryDark}));function st(e){var n=e.children,t=Object($n.b)().t,a=Object(m.d)().active,c=Object(m.d)(de),o=c.active,u=c.error,l=c.activate,d=function(){var e=Object(m.d)(),n=e.activate,t=e.active,r=Object(i.useState)(!1),a=Object(f.a)(r,2),c=a[0],o=a[1];return Object(i.useEffect)((function(){W.isAuthorized().then((function(e){var t=window.localStorage.getItem(s.C);e&&t||O.isMobile&&window.ethereum&&t?n(W,void 0,!0).catch((function(){o(!0)})):o(!0)}))}),[n]),Object(i.useEffect)((function(){t&&o(!0)}),[t]),c}();Object(i.useEffect)((function(){!d||o||u||a||l(q)}),[d,o,u,l,a]),function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],n=Object(m.d)(),t=n.active,r=n.error,a=n.activate;Object(i.useEffect)((function(){var n=window.ethereum;if(n&&n.on&&!t&&!r&&!e){var i=function(){a(W,void 0,!0).catch((function(e){console.error("Failed to activate after chain changed",e)}))},c=function(e){e.length>0&&a(W,void 0,!0).catch((function(e){console.error("Failed to activate after accounts changed",e)}))};return n.on("chainChanged",i),n.on("accountsChanged",c),function(){n.removeListener&&(n.removeListener("chainChanged",i),n.removeListener("accountsChanged",c))}}}),[t,r,e,a])}(!d);var b=Object(i.useState)(!1),p=Object(f.a)(b,2),j=p[0],h=p[1];return Object(i.useEffect)((function(){var e=setTimeout((function(){h(!0)}),600);return function(){clearTimeout(e)}}),[]),d?!a&&u?Object(r.jsx)(ct,{children:Object(r.jsx)(ot,{children:t("unknownError")})}):a||o?n:j?Object(r.jsx)(ct,{children:Object(r.jsx)(rt,{})}):null:null}function ut(){var e=Object(u.a)(["\n background-color: ",";\n"]);return ut=function(){return e},e}function lt(){var e=Object(u.a)(["\n border: 1px solid ",";\n background-color: ",";\n"]);return lt=function(){return e},e}function dt(){var e=Object(u.a)(["\n width: 100%;\n border-radius: 16px;\n padding: 1.25rem;\n padding: ",";\n border: ",";\n border-radius: ",";\n"]);return dt=function(){return e},e}var bt=l.default.div(dt(),(function(e){return e.padding}),(function(e){return e.border}),(function(e){return e.borderRadius})),pt=bt,ft=Object(l.default)(bt)(lt(),(function(e){return e.theme.colors.invertedContrast}),(function(e){return e.theme.colors.invertedContrast})),jt=Object(l.default)(bt)(ut(),(function(e){return e.theme.colors.tertiary})),ht=t(176),vt=(t(332),t(49));function mt(){var e=Object(u.a)(["\n min-height: ","vh;\n "]);return mt=function(){return e},e}function Ot(){var e=Object(u.a)(["\n max-height: ","vh;\n "]);return Ot=function(){return e},e}function yt(){var e=Object(u.a)(["\n &[data-reach-dialog-content] {\n margin: 0 0 2rem 0;\n border: 1px solid ",";\n background-color: ",";\n box-shadow: 0 4px 8px 0 ",";\n padding: 0px;\n width: 80%;\n overflow: hidden;\n\n align-self: ",";\n\n max-width: 420px;\n ","\n ","\n display: flex;\n border-radius: 20px;\n\n "," {\n width: 65vw;\n }\n "," {\n width: 85vw;\n }\n }\n"]);return yt=function(){return e},e}function xt(){var e=Object(u.a)(["\n &[data-reach-dialog-overlay] {\n z-index: 2;\n background-color: transparent;\n overflow: hidden;\n\n display: flex;\n align-items: center;\n justify-content: center;\n\n background-color: rgba(0, 0, 0, 0.3);\n }\n"]);return xt=function(){return e},e}var gt=Object(Le.a)(ht.b),Ct=Object(l.default)(gt)(xt()),wt=Object(Le.a)(ht.a),kt=Object(l.default)((function(e){e.minHeight,e.maxHeight,e.mobile,e.isOpen;var n=Object(gn.a)(e,["minHeight","maxHeight","mobile","isOpen"]);return Object(r.jsx)(wt,Object(X.a)({},n))})).attrs({"aria-label":"dialog"})(yt(),(function(e){return e.theme.colors.invertedContrast}),(function(e){return e.theme.colors.invertedContrast}),Object(vt.b)(.95,"#191326"),(function(e){return e.mobile?"flex-end":"center"}),(function(e){var n=e.maxHeight;return n&&Object(l.css)(Ot(),n)}),(function(e){var n=e.minHeight;return n&&Object(l.css)(mt(),n)}),(function(e){return e.theme.mediaQueries.lg}),(function(e){return e.theme.mediaQueries.sm}));function Tt(e){var n=e.isOpen,t=e.onDismiss,i=e.minHeight,a=void 0!==i&&i,c=e.maxHeight,o=void 0===c?50:c,s=e.initialFocusRef,u=e.children,l=Object(Le.c)(n,null,{config:{duration:200},from:{opacity:0},enter:{opacity:1},leave:{opacity:0}});return Object(r.jsx)(r.Fragment,{children:l.map((function(e){var n=e.item,i=e.key,c=e.props;return n&&Object(r.jsx)(Ct,{style:c,onDismiss:t,initialFocusRef:s,children:Object(r.jsxs)(kt,{"aria-label":"dialog content",minHeight:a,maxHeight:o,mobile:O.isMobile,children:[!s&&O.isMobile?Object(r.jsx)("div",{tabIndex:1}):null,u]})},i)}))})}function It(){var e=Object(u.a)(["\n align-items: center;\n display: flex;\n\n & > "," {\n flex: 1;\n }\n"]);return It=function(){return e},e}function Et(){var e=Object(u.a)(["\n background-color: ",";\n border-bottom-left-radius: 20px;\n border-bottom-right-radius: 20px;\n"]);return Et=function(){return e},e}function Nt(){var e=Object(u.a)(["\n padding: 40px 0;\n"]);return Nt=function(){return e},e}function St(){var e=Object(u.a)(["\n padding: 24px;\n"]);return St=function(){return e},e}function Rt(){var e=Object(u.a)(["\n width: 100%;\n overflow-y: auto;\n"]);return Rt=function(){return e},e}var Ut=l.default.div(Rt()),At=Object(l.default)(Pe)(St()),zt=Object(l.default)(Be)(Nt()),Bt=Object(l.default)(At)(Et(),(function(e){return e.theme.colors.invertedContrast})),Pt=l.default.div(It(),s.o),Mt=function(e){var n=e.children,t=e.onDismiss;return Object(r.jsxs)(Pt,{children:[Object(r.jsx)(s.o,{children:n}),Object(r.jsx)(s.q,{onClick:t,variant:"text",children:Object(r.jsx)(s.k,{color:"primary"})})]})};function Dt(){var e=Object(u.a)(["\n height: ",";\n width: ",";\n"]);return Dt=function(){return e},e}var Lt=Object(l.default)(An)(Dt(),(function(e){return e.size}),(function(e){return e.size})),_t=function(e){var n=e.onDismiss,t=e.pendingText;return Object(r.jsx)(Ut,{children:Object(r.jsxs)(At,{children:[Object(r.jsx)(Mt,{onDismiss:n,children:"Waiting for confirmation"}),Object(r.jsx)(zt,{children:Object(r.jsx)(Lt,{src:"/images/blue-loader.svg",alt:"loader",size:"90px"})}),Object(r.jsxs)(Pe,{gap:"12px",justify:"center",children:[Object(r.jsx)(Pe,{gap:"12px",justify:"center",children:Object(r.jsx)(s.z,{fontSize:"14px",children:Object(r.jsx)("strong",{children:t})})}),Object(r.jsx)(s.z,{fontSize:"14px",children:"Confirm this transaction in your wallet"})]})]})})},Yt=t(427),Ft=function(e){var n=e.onDismiss,t=e.chainId,a=e.hash,c=Object(i.useContext)(l.ThemeContext);return Object(r.jsx)(Ut,{children:Object(r.jsxs)(At,{children:[Object(r.jsx)(Mt,{onDismiss:n,children:"Transaction submitted"}),Object(r.jsx)(zt,{children:Object(r.jsx)(Yt.a,{strokeWidth:.5,size:97,color:c.colors.primary})}),Object(r.jsxs)(Pe,{gap:"8px",justify:"center",children:[t&&a&&Object(r.jsx)(s.s,{href:hn(t,a,"transaction"),children:"View on BscScan"}),Object(r.jsx)(s.d,{onClick:n,mt:"20px",children:"Close"})]})]})})},qt=function(e){var n=e.isOpen,t=e.onDismiss,i=e.attemptingTxn,a=e.hash,c=e.pendingText,o=e.content,s=ge().chainId;return s?Object(r.jsx)(Tt,{isOpen:n,onDismiss:t,maxHeight:90,children:i?Object(r.jsx)(_t,{onDismiss:t,pendingText:c}):a?Object(r.jsx)(Ft,{chainId:s,hash:a,onDismiss:t}):o()}):null},Vt=function(e){var n=e.title,t=e.bottomContent,i=e.onDismiss,a=e.topContent;return Object(r.jsxs)(Ut,{children:[Object(r.jsxs)(At,{children:[Object(r.jsx)(Mt,{onDismiss:i,children:n}),a()]}),Object(r.jsx)(Bt,{gap:"12px",children:t()})]})},Wt=t(428),Ht=function(e){var n=e.message,t=e.onDismiss,a=Object(i.useContext)(l.ThemeContext);return Object(r.jsxs)(Ut,{children:[Object(r.jsxs)(At,{children:[Object(r.jsx)(Mt,{onDismiss:t,children:"Error"}),Object(r.jsxs)(Pe,{style:{marginTop:20,padding:"2rem 0"},gap:"24px",justify:"center",children:[Object(r.jsx)(Wt.a,{color:a.colors.failure,style:{strokeWidth:1.5},size:64}),Object(r.jsx)(s.z,{fontSize:"16px",color:"failure",style:{textAlign:"center",width:"85%"},children:n})]})]}),Object(r.jsx)(Bt,{gap:"12px",children:Object(r.jsx)(s.d,{onClick:t,children:"Dismiss"})})]})},Qt=qt,Gt={translations:[],setTranslations:function(){}},Kt=Object(i.createContext)(Gt),Xt=/%(.*?)%/,Jt=function(e,n,t){var r=e.find((function(e){return e.data.stringId===n}));if(r){var i=r.data.text;return i.includes("%")?function(e,n){var t=Xt.exec(e)[0],r=e.split(" ").indexOf(t),i=n.split(" ")[r];return e.replace(t,i)}(i,t):i}return t},$t=function(e,n){var t=Object(i.useContext)(Kt).translations;return"error"===t[0]||0===t.length?n:t.length>0?Jt(t,e,n):null},Zt=function(){var e=Object(i.useContext)(Kt).translations;return Object(i.useCallback)((function(n,t){return"error"===e[0]?t:e.length>0?Jt(e,n,t):t}),[e])};function er(){var e=Object(u.a)(["\n margin-bottom: 40px;\n"]);return er=function(){return e},e}var nr=l.default.div(er());var tr,rr=function(e){var n=e.activeIndex,t=void 0===n?0:n,i=Zt();return Object(r.jsx)(nr,{children:Object(r.jsxs)(s.e,{activeIndex:t,scale:"sm",variant:"subtle",children:[Object(r.jsx)(s.f,{id:"swap-nav-link",to:"/swap",as:j.b,children:i(1142,"Swap")}),Object(r.jsx)(s.f,{id:"pool-nav-link",to:"/pool",as:j.b,children:i(262,"Liquidity")}),Object(r.jsx)(s.f,{id:"pool-nav-link",as:"a",href:"https://www.binance.org/en/bridge?utm_source=PancakeSwap",target:"_blank",rel:"noreferrer noopener",children:"Bridge"})]})})},ir=t(110),ar=t(114),cr=t(199),or=new ir.b(ar),sr=t(156),ur=function(e){Object(U.a)(t,e);var n=Object(A.a)(t);function t(e,r){var i;return Object(R.a)(this,t),(i=n.call(this,e.chainId,e.address,e.decimals,e.symbol,e.name)).tokenInfo=void 0,i.tags=void 0,i.tokenInfo=e,i.tags=r,i}return Object(T.a)(t,[{key:"logoURI",get:function(){return this.tokenInfo.logoURI}}]),t}(J.j),lr=(tr={},Object(y.a)(tr,J.a.MAINNET,{}),Object(y.a)(tr,J.a.BSCTESTNET,{}),tr),dr="undefined"!==typeof WeakMap?new WeakMap:null;function br(e){var n=Object(v.d)((function(e){return e.lists.byUrl}));return Object(i.useMemo)((function(){var t;if(!e)return lr;var r=null===(t=n[e])||void 0===t?void 0:t.current;if(!r)return lr;try{return function(e){var n=null===dr||void 0===dr?void 0:dr.get(e);if(n)return n;var t=e.tokens.reduce((function(n,t){var r,i,a,c=null!==(r=null===(i=t.tags)||void 0===i||null===(a=i.map((function(n){var t;if(null===(t=e.tags)||void 0===t?void 0:t[n])return Object(X.a)(Object(X.a)({},e.tags[n]),{},{id:n})})))||void 0===a?void 0:a.filter((function(e){return Boolean(e)})))&&void 0!==r?r:[],o=new ur(t,c);if(void 0!==n[o.chainId][o.address])throw Error("Duplicate tokens.");return Object(X.a)(Object(X.a)({},n),{},Object(y.a)({},o.chainId,Object(X.a)(Object(X.a)({},n[o.chainId]),{},Object(y.a)({},o.address,o))))}),Object(X.a)({},lr));return null===dr||void 0===dr||dr.set(e,t),t}(r)}catch(i){return console.error("Could not show token list due to error",i),lr}}),[n,e])}function pr(){return Object(v.d)((function(e){return e.lists.selectedListUrl}))}function fr(){return br(pr())}var jr=/^0x[a-fA-F0-9]{40}$/,hr=/^0x[a-f0-9]*$/;function vr(e){if(!jr.test(e.address))throw new Error("Invalid address: ".concat(e.address));if(!hr.test(e.callData))throw new Error("Invalid hex: ".concat(e.callData));return"".concat(e.address,"-").concat(e.callData)}function mr(e){var n=e.split("-");if(2!==n.length)throw new Error("Invalid call key: ".concat(e));return{address:n[0],callData:n[1]}}var Or=Object(Ce.b)("multicall/addMulticallListeners"),yr=Object(Ce.b)("multicall/removeMulticallListeners"),xr=Object(Ce.b)("multicall/fetchingMulticallResults"),gr=Object(Ce.b)("multicall/errorFetchingMulticallResults"),Cr=Object(Ce.b)("multicall/updateMulticallResults");function wr(e){return-1!==["string","number"].indexOf(typeof e)}function kr(e){return void 0===e||Array.isArray(e)&&e.every((function(e){return wr(e)||Array.isArray(e)&&e.every(wr)}))}var Tr={valid:!1,blockNumber:void 0,data:void 0},Ir={blocksPerFetch:1/0};function Er(e,n){var t=ge().chainId,r=Object(v.d)((function(e){return e.multicall.callResults})),a=Object(v.c)(),c=Object(i.useMemo)((function(){var n,t,r;return JSON.stringify(null!==(n=null===e||void 0===e||null===(t=e.filter((function(e){return Boolean(e)})))||void 0===t||null===(r=t.map(vr))||void 0===r?void 0:r.sort())&&void 0!==n?n:[])}),[e]);return Object(i.useEffect)((function(){var e=JSON.parse(c);if(t&&0!==e.length){var r=e.map((function(e){return mr(e)}));return a(Or({chainId:t,calls:r,options:n})),function(){a(yr({chainId:t,calls:r,options:n}))}}}),[t,a,n,c]),Object(i.useMemo)((function(){return e.map((function(e){var n;if(!t||!e)return Tr;var i=null===(n=r[t])||void 0===n?void 0:n[vr(e)];return{valid:!0,data:(null===i||void 0===i?void 0:i.data)&&"0x"!==(null===i||void 0===i?void 0:i.data)?i.data:null,blockNumber:null===i||void 0===i?void 0:i.blockNumber}}))}),[r,e,t])}var Nr={valid:!1,result:void 0,loading:!1,syncing:!1,error:!1},Sr={valid:!0,result:void 0,loading:!0,syncing:!0,error:!1};function Rr(e,n,t,r){if(!e)return Nr;var i=e.valid,a=e.data,c=e.blockNumber;if(!i)return Nr;if(i&&!c)return Sr;if(!n||!t||!r)return Sr;var o,s=a&&a.length>2,u=(null!==c&&void 0!==c?c:0)0&&o?e.map((function(e){return e&&o?{address:e,callData:o}:void 0})):[]}),[e,o,c]),a),u=Ne();return Object(i.useMemo)((function(){return s.map((function(e){return Rr(e,n,c,u)}))}),[c,s,n,u])}function Ar(e,n,t,r){var a=Object(i.useMemo)((function(){var t;return null===e||void 0===e||null===(t=e.interface)||void 0===t?void 0:t.getFunction(n)}),[e,n]),c=Er(Object(i.useMemo)((function(){return e&&a&&kr(t)?[{address:e.address,callData:e.interface.encodeFunctionData(a,t)}]:[]}),[e,a,t]),r)[0],o=Ne();return Object(i.useMemo)((function(){return Rr(c,null===e||void 0===e?void 0:e.interface,a,o)}),[c,e,a,o])}var zr=t(135),Br=t.n(zr),Pr=Object(Ce.b)("user/updateMatchesDarkMode"),Mr=Object(Ce.b)("user/updateUserDarkMode"),Dr=Object(Ce.b)("user/updateUserExpertMode"),Lr=Object(Ce.b)("user/updateUserSlippageTolerance"),_r=Object(Ce.b)("user/updateUserDeadline"),Yr=Object(Ce.b)("user/addSerializedToken"),Fr=Object(Ce.b)("user/removeSerializedToken"),qr=Object(Ce.b)("user/addSerializedPair"),Vr=Object(Ce.b)("user/removeSerializedPair"),Wr=Object(Ce.b)("user/muteAudio"),Hr=Object(Ce.b)("user/unmuteAudio"),Qr="IS_DARK";function Gr(e){return{chainId:e.chainId,address:e.address,decimals:e.decimals,symbol:e.symbol,name:e.name}}function Kr(e){return new J.j(e.chainId,e.address,e.decimals,e.symbol,e.name)}function Xr(){return Object(v.d)((function(e){return e.user.userExpertMode}))}function Jr(){var e=Object(v.c)();return[Object(v.d)((function(e){return e.user.userSlippageTolerance})),Object(i.useCallback)((function(n){e(Lr({userSlippageTolerance:n}))}),[e])]}function $r(){var e=Object(v.c)();return[Object(v.d)((function(e){return e.user.userDeadline})),Object(i.useCallback)((function(n){e(_r({userDeadline:n}))}),[e])]}function Zr(){var e=ge().chainId,n=Object(v.d)((function(e){return e.user.tokens}));return Object(i.useMemo)((function(){var t;return e?Object.values(null!==(t=n[e])&&void 0!==t?t:{}).map(Kr):[]}),[n,e])}function ei(e){return{token0:Gr(e.token0),token1:Gr(e.token1)}}function ni(e){var n=Object(f.a)(e,2),t=n[0],r=n[1];return new J.j(t.chainId,J.f.getAddress(t,r),18,"Cake-LP","Pancake LPs")}var ti,ri=t(144),ii=t(229),ai=t(230),ci=t(231),oi=t(200),si=(ti={},Object(y.a)(ti,J.a.MAINNET,"0x1Ee38d535d541c55C9dae27B12edf090C608E6Fb"),Object(y.a)(ti,J.a.BSCTESTNET,"0x301907b5835a2d723Fe3e9E8C5Bc5375d5c1236A"),ti);function ui(e,n){var t=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],r=ge(),a=r.library,c=r.account;return Object(i.useMemo)((function(){if(!e||!n||!a)return null;try{return yn(e,n,a,t&&c?c:void 0)}catch(r){return console.error("Failed to get contract",r),null}}),[e,n,a,t,c])}function li(e,n){return ui(e,ar,n)}function di(e){var n=ge().chainId;if(n)switch(n){case J.a.MAINNET:case J.a.BSCTESTNET:}return ui(undefined,ii,e)}function bi(e,n){return ui(e,ai,n)}function pi(){var e=ge().chainId;return ui(e&&si[e],oi,!1)}function fi(){var e=ge().chainId,n=Zr(),t=fr();return Object(i.useMemo)((function(){return e?n.reduce((function(e,n){return e[n.address]=n,e}),Object(X.a)({},t[e])):{}}),[e,n,t])}var ji=/^0x[a-fA-F0-9]{64}$/;function hi(e,n,t){return e&&e.length>0?e:n&&ji.test(n)?Object(sr.b)(n):t}function vi(e){var n=ge().chainId,t=fi(),r=fn(e),a=li(r||void 0,!1),c=function(e,n){return ui(e,cr,n)}(r||void 0,!1),o=r?t[r]:void 0,s=Ar(o?void 0:a,"name",void 0,Ir),u=Ar(o?void 0:c,"name",void 0,Ir),l=Ar(o?void 0:a,"symbol",void 0,Ir),d=Ar(o?void 0:c,"symbol",void 0,Ir),b=Ar(o?void 0:a,"decimals",void 0,Ir);return Object(i.useMemo)((function(){if(o)return o;if(n&&r){if(b.loading||l.loading||s.loading)return null;var e,t,i,a;if(b.result)return new J.j(n,r,b.result[0],hi(null===(e=l.result)||void 0===e?void 0:e[0],null===(t=d.result)||void 0===t?void 0:t[0],"UNKNOWN"),hi(null===(i=s.result)||void 0===i?void 0:i[0],null===(a=u.result)||void 0===a?void 0:a[0],"Unknown Token"))}}),[r,n,b.loading,b.result,l.loading,l.result,d.result,o,s.loading,s.result,u.result])}function mi(e){var n="BNB"===(null===e||void 0===e?void 0:e.toUpperCase()),t=vi(n?void 0:e);return n?J.d:t}function Oi(e){var n=pi(),t=Object(i.useMemo)((function(){return e?e.map(fn).filter((function(e){return!1!==e})).sort():[]}),[e]),r=function(e,n,t,r){var a=Object(i.useMemo)((function(){var t;return null===e||void 0===e||null===(t=e.interface)||void 0===t?void 0:t.getFunction(n)}),[e,n]),c=Er(Object(i.useMemo)((function(){return e&&a&&t&&t.length>0?t.map((function(n){return{address:e.address,callData:e.interface.encodeFunctionData(a,n)}})):[]}),[t,e,a]),r),o=Ne();return Object(i.useMemo)((function(){return c.map((function(n){return Rr(n,null===e||void 0===e?void 0:e.interface,a,o)}))}),[a,e,c,o])}(n,"getEthBalance",t.map((function(e){return[e]})));return Object(i.useMemo)((function(){return t.reduce((function(e,n,t){var i,a,c=null===r||void 0===r||null===(i=r[t])||void 0===i||null===(a=i.result)||void 0===a?void 0:a[0];return c&&(e[n]=J.c.ether(J.e.BigInt(c.toString()))),e}),{})}),[t,r])}function yi(e,n){var t=Object(i.useMemo)((function(){var e;return null!==(e=null===n||void 0===n?void 0:n.filter((function(e){return!1!==fn(null===e||void 0===e?void 0:e.address)})))&&void 0!==e?e:[]}),[n]),r=Ur(Object(i.useMemo)((function(){return t.map((function(e){return e.address}))}),[t]),or,"balanceOf",[e]),a=Object(i.useMemo)((function(){return r.some((function(e){return e.loading}))}),[r]);return[Object(i.useMemo)((function(){return e&&t.length>0?t.reduce((function(e,n,t){var i,a,c=null===r||void 0===r||null===(i=r[t])||void 0===i||null===(a=i.result)||void 0===a?void 0:a[0],o=c?J.e.BigInt(c.toString()):void 0;return o&&(e[n.address]=new J.k(n,o)),e}),{}):{}}),[e,t,r]),a]}function xi(e,n){return yi(e,n)[0]}function gi(e,n){var t=xi(e,[n]);if(n)return t[n.address]}function Ci(e,n){var t=Object(i.useMemo)((function(){var e;return null!==(e=null===n||void 0===n?void 0:n.filter((function(e){return e instanceof J.j})))&&void 0!==e?e:[]}),[n]),r=xi(e,t),a=Oi(Object(i.useMemo)((function(){var e;return null!==(e=null===n||void 0===n?void 0:n.some((function(e){return e===J.d})))&&void 0!==e&&e}),[n])?[e]:[]);return Object(i.useMemo)((function(){var t;return null!==(t=null===n||void 0===n?void 0:n.map((function(n){if(e&&n)return n instanceof J.j?r[n.address]:n===J.d?a[e]:void 0})))&&void 0!==t?t:[]}),[e,n,a,r])}function wi(e,n){return Ci(e,[n])[0]}function ki(e,n){var t=Object(i.useState)(n&&n(e)?e:void 0),r=Object(f.a)(t,2),a=r[0],c=r[1];return Object(i.useEffect)((function(){c((function(t){return!n||n(e)?e:t}))}),[n,e]),a}function Ti(e){return null!==e&&void 0!==e}var Ii=t(232),Ei=t(174),Ni=t.n(Ei),Si=t(121),Ri=t(103);var Ui=new TextDecoder;function Ai(e){var n=function(e){if((e=e.startsWith("0x")?e.substr(2):e).length%2!==0)throw new Error("hex must have length that is multiple of 2");for(var n=new Uint8Array(e.length/2),t=0;t2&&void 0!==arguments[2])||arguments[2],r=Object(i.useRef)();Object(i.useEffect)((function(){r.current=e}),[e]),Object(i.useEffect)((function(){function e(){var e=r.current;e&&e()}if(null!==n){t&&e();var i=setInterval(e,n);return function(){return clearInterval(i)}}}),[n,t])}function Ki(){var e=Object(u.a)(["\n width: 8px;\n height: 8px;\n z-index: 9998;\n\n ::before {\n position: absolute;\n width: 8px;\n height: 8px;\n z-index: 9998;\n\n content: '';\n border: 1px solid ",";\n transform: rotate(45deg);\n background: ",";\n }\n\n &.arrow-top {\n bottom: -5px;\n ::before {\n border-top: none;\n border-left: none;\n }\n }\n\n &.arrow-bottom {\n top: -5px;\n ::before {\n border-bottom: none;\n border-right: none;\n }\n }\n\n &.arrow-left {\n right: -5px;\n\n ::before {\n border-bottom: none;\n border-left: none;\n }\n }\n\n &.arrow-right {\n left: -5px;\n ::before {\n border-right: none;\n border-top: none;\n }\n }\n"]);return Ki=function(){return e},e}function Xi(){var e=Object(u.a)(["\n display: inline-block;\n"]);return Xi=function(){return e},e}function Ji(){var e=Object(u.a)(["\n z-index: 9999;\n\n visibility: ",";\n opacity: ",";\n transition: visibility 150ms linear, opacity 150ms linear;\n\n background: ",";\n border: 1px solid ",";\n box-shadow: 0 4px 8px 0 ",";\n color: ",";\n border-radius: 8px;\n"]);return Ji=function(){return e},e}var $i=l.default.div(Ji(),(function(e){return e.show?"visible":"hidden"}),(function(e){return e.show?1:0}),(function(e){return e.theme.colors.invertedContrast}),(function(e){return e.theme.colors.tertiary}),Object(vt.b)(.9,"#2F80ED"),(function(e){return e.theme.colors.textSubtle})),Zi=l.default.div(Xi()),ea=l.default.div(Ki(),(function(e){return e.theme.colors.tertiary}),(function(e){return e.theme.colors.invertedContrast}));function na(e){var n,t,a=e.content,c=e.show,o=e.children,s=e.placement,u=void 0===s?"auto":s,l=Object(i.useState)(null),d=Object(f.a)(l,2),b=d[0],p=d[1],j=Object(i.useState)(null),h=Object(f.a)(j,2),v=h[0],m=h[1],O=Object(i.useState)(null),y=Object(f.a)(O,2),x=y[0],g=y[1],C=Object(Hi.a)(b,v,{placement:u,strategy:"fixed",modifiers:[{name:"offset",options:{offset:[8,8]}},{name:"arrow",options:{element:x}}]}),w=C.styles,k=C.update,T=C.attributes;return Gi(Object(i.useCallback)((function(){k&&k()}),[k]),c?100:null),Object(r.jsxs)(r.Fragment,{children:[Object(r.jsx)(Zi,{ref:p,children:o}),Object(r.jsx)(Qi.a,{children:Object(r.jsxs)($i,Object(X.a)(Object(X.a)({show:c,ref:m,style:w.popper},T.popper),{},{children:[a,Object(r.jsx)(ea,Object(X.a)({className:"arrow-".concat(null!==(n=null===(t=T.popper)||void 0===t?void 0:t["data-popper-placement"])&&void 0!==n?n:""),ref:g,style:w.arrow},T.arrow))]}))})]})}function ta(){var e=Object(u.a)(["\n width: 228px;\n padding: 0.6rem 1rem;\n line-height: 150%;\n font-weight: 400;\n"]);return ta=function(){return e},e}var ra=l.default.div(ta());function ia(e){var n=e.text,t=Object(gn.a)(e,["text"]);return Object(r.jsx)(na,Object(X.a)({content:Object(r.jsx)(ra,{children:n})},t))}function aa(e){var n=e.children,t=Object(gn.a)(e,["children"]),a=Object(i.useState)(!1),c=Object(f.a)(a,2),o=c[0],s=c[1],u=Object(i.useCallback)((function(){return s(!0)}),[s]),l=Object(i.useCallback)((function(){return s(!1)}),[s]);return Object(r.jsx)(ia,Object(X.a)(Object(X.a)({},t),{},{show:o,children:Object(r.jsx)("div",{onMouseEnter:u,onMouseLeave:l,children:n})}))}function ca(){var e=Object(u.a)(["\n display: flex;\n align-items: center;\n justify-content: center;\n padding: 0.2rem;\n border: none;\n background: none;\n outline: none;\n cursor: default;\n border-radius: 36px;\n background-color: ",";\n color: ",";\n\n :hover,\n :focus {\n opacity: 0.7;\n }\n"]);return ca=function(){return e},e}var oa=l.default.div(ca(),(function(e){return e.theme.colors.invertedContrast}),(function(e){return e.theme.colors.textSubtle}));function sa(e){var n=e.text,t=Object(i.useState)(!1),a=Object(f.a)(t,2),c=a[0],o=a[1],s=Object(i.useCallback)((function(){return o(!0)}),[o]),u=Object(i.useCallback)((function(){return o(!1)}),[o]);return Object(r.jsx)("span",{style:{marginLeft:4},children:Object(r.jsx)(ia,{text:n,show:c,children:Object(r.jsx)(oa,{onClick:s,onMouseEnter:s,onMouseLeave:u,children:Object(r.jsx)(_i.a,{size:16})})})})}function ua(){var e=Object(u.a)(["\n width: ",";\n height: ",";\n"]);return ua=function(){return e},e}var la=Object(l.default)(Fi)(ua(),(function(e){return e.size}),(function(e){return e.size}));function da(){var e=Object(u.a)(["\n width: ",";\n height: ",";\n"]);return da=function(){return e},e}function ba(){var e=Object(u.a)(["\n width: ",";\n height: ",";\n box-shadow: 0px 6px 10px rgba(0, 0, 0, 0.075);\n border-radius: 24px;\n"]);return ba=function(){return e},e}var pa=function(e){return"https://raw.githubusercontent.com/trustwallet/assets/master/blockchains/smartchain/assets/".concat(e,"/logo.png")},fa=l.default.img(ba(),(function(e){return e.size}),(function(e){return e.size})),ja=Object(l.default)(Fi)(da(),(function(e){return e.size}),(function(e){return e.size}));function ha(e){var n,t,a=e.currency,c=e.size,o=void 0===c?"24px":c,s=e.style,u=Li(a instanceof ur?a.logoURI:void 0),l=Object(i.useMemo)((function(){return a===J.d?[]:a instanceof J.j?a instanceof ur?[].concat(Object(K.a)(u),["/images/coins/".concat(null!==(n=null===a||void 0===a?void 0:a.address)&&void 0!==n?n:"token",".png"),pa(a.address)]):["/images/coins/".concat(null!==(e=null===a||void 0===a?void 0:a.address)&&void 0!==e?e:"token",".png"),pa(a.address)]:[];var e,n}),[a,u]);return a===J.d?Object(r.jsx)(fa,{src:"/images/coins/bnb.png",size:o,style:s}):(null===a||void 0===a?void 0:a.symbol)?Object(r.jsx)(la,{size:o,srcs:l,alt:"".concat(null!==(n=null===a||void 0===a?void 0:a.symbol)&&void 0!==n?n:"token"," logo"),style:s}):Object(r.jsx)(ja,{size:o,srcs:l,alt:"".concat(null!==(t=null===a||void 0===a?void 0:a.symbol)&&void 0!==t?t:"token"," logo"),style:s})}function va(){var e=Object(u.a)(["\n border: 1px solid ",";\n border-radius: 10px;\n display: flex;\n padding: 6px;\n\n align-items: center;\n :hover {\n cursor: ",";\n background-color: ",";\n }\n\n background-color: ",";\n opacity: ",";\n"]);return va=function(){return e},e}var ma=l.default.div(va(),(function(e){var n=e.theme;return e.disable?"transparent":n.colors.tertiary}),(function(e){return!e.disable&&"pointer"}),(function(e){var n=e.theme;return!e.disable&&n.colors.invertedContrast}),(function(e){var n=e.theme;return e.disable&&n.colors.tertiary}),(function(e){return e.disable&&"0.4"}));function Oa(e){var n=e.chainId,t=e.onSelect,i=e.selectedCurrency,a=Zt();return Object(r.jsxs)(Pe,{gap:"md",children:[Object(r.jsxs)(tn,{children:[Object(r.jsx)(s.z,{fontSize:"14px",children:"Common bases"}),Object(r.jsx)(sa,{text:a(1204,"These tokens are commonly paired with other tokens.")})]}),Object(r.jsxs)(tn,{gap:"4px",children:[Object(r.jsxs)(ma,{onClick:function(){i&&Object(J.o)(i,J.d)||t(J.d)},disable:i===J.d,children:[Object(r.jsx)(ha,{currency:J.d,style:{marginRight:8}}),Object(r.jsx)(s.z,{children:"BNB"})]}),(n?se[n]:[]).map((function(e){var n=i instanceof J.j&&i.address===e.address;return Object(r.jsxs)(ma,{onClick:function(){return!n&&t(e)},disable:n,children:[Object(r.jsx)(ha,{currency:e,style:{marginRight:8}}),Object(r.jsx)(s.z,{children:e.symbol})]},e.address)}))]})]})}var ya=t(242);function xa(){var e=Object(u.a)(["\n width: 100%;\n height: 1px;\n background-color: ",";\n"]);return xa=function(){return e},e}function ga(){var e=Object(u.a)(["\n width: 100%;\n height: 1px;\n background-color: ",";\n"]);return ga=function(){return e},e}function Ca(){var e=Object(u.a)(["\n position: relative;\n display: flex;\n padding: 16px;\n align-items: center;\n width: 100%;\n white-space: nowrap;\n background: none;\n border: none;\n outline: none;\n border-radius: 20px;\n color: ",";\n border-style: solid;\n border: 1px solid ",";\n -webkit-appearance: none;\n\n font-size: 18px;\n\n ::placeholder {\n color: ",";\n }\n transition: border 100ms;\n :focus {\n border: 1px solid ",";\n outline: none;\n }\n"]);return Ca=function(){return e},e}function wa(){var e=Object(u.a)(["\n padding: 4px 20px;\n height: 56px;\n display: grid;\n grid-template-columns: auto minmax(auto, 1fr) auto minmax(0, 72px);\n grid-gap: 16px;\n cursor: ",";\n pointer-events: ",";\n :hover {\n background-color: ",";\n }\n opacity: ",";\n"]);return wa=function(){return e},e}function ka(){var e=Object(u.a)(["\n padding: 20px;\n padding-bottom: 12px;\n"]);return ka=function(){return e},e}function Ta(){var e=Object(u.a)(["\n color: ",";\n font-size: 14px;\n"]);return Ta=function(){return e},e}var Ia=Object(l.default)(rn)(Ta(),(function(e){return e.theme.colors.primary})),Ea=Object(l.default)(Pe)(ka()),Na=Object(l.default)(en)(wa(),(function(e){return!e.disabled&&"pointer"}),(function(e){return e.disabled&&"none"}),(function(e){var n=e.theme;return!e.disabled&&n.colors.invertedContrast}),(function(e){var n=e.disabled,t=e.selected;return n||t?.5:1})),Sa=l.default.input(Ca(),(function(e){return e.theme.colors.text}),(function(e){return e.theme.colors.tertiary}),(function(e){return e.theme.colors.textDisabled}),(function(e){return e.theme.colors.primary})),Ra=l.default.div(ga(),(function(e){return e.theme.colors.invertedContrast})),Ua=l.default.div(xa(),(function(e){return e.theme.colors.tertiary}));function Aa(){var e=Object(u.a)(["\n display: flex;\n justify-content: flex-end;\n"]);return Aa=function(){return e},e}function za(){var e=Object(u.a)(["\n background-color: ",";\n color: ",";\n font-size: 14px;\n border-radius: 4px;\n padding: 0.25rem 0.3rem 0.25rem 0.3rem;\n max-width: 6rem;\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n justify-self: flex-end;\n margin-right: 4px;\n"]);return za=function(){return e},e}function Ba(){var e=Object(u.a)(["\n white-space: nowrap;\n overflow: hidden;\n max-width: 5rem;\n text-overflow: ellipsis;\n"]);return Ba=function(){return e},e}function Pa(e){return e instanceof J.j?e.address:e===J.d?"ETHER":""}var Ma=Object(l.default)(s.z)(Ba()),Da=l.default.div(za(),(function(e){return e.theme.colors.tertiary}),(function(e){return e.theme.colors.textSubtle}));function La(e){var n=e.balance;return Object(r.jsx)(Ma,{title:n.toExact(),children:n.toSignificant(4)})}var _a=l.default.div(Aa());function Ya(e){var n=e.currency;if(!(n instanceof ur))return Object(r.jsx)("span",{});var t=n.tags;if(!t||0===t.length)return Object(r.jsx)("span",{});var i=t[0];return Object(r.jsxs)(_a,{children:[Object(r.jsx)(aa,{text:i.description,children:Object(r.jsx)(Da,{children:i.name},i.id)}),t.length>1?Object(r.jsx)(aa,{text:t.slice(1).map((function(e){var n=e.name,t=e.description;return"".concat(n,": ").concat(t)})).join("; \n"),children:Object(r.jsx)(Da,{children:"..."})}):null]})}function Fa(e){var n=e.currency,t=e.onSelect,a=e.isSelected,c=e.otherSelected,o=e.style,u=ge(),l=u.account,d=u.chainId,b=Pa(n),p=function(e,n){var t;return n===J.d||Boolean(n instanceof J.j&&(null===(t=e[n.chainId])||void 0===t?void 0:t[n.address]))}(fr(),n),f=function(e){return!!Zr().find((function(n){return Object(J.o)(e,n)}))}(n),j=wi(null!==l&&void 0!==l?l:void 0,n),h=function(){var e=Object(v.c)();return Object(i.useCallback)((function(n,t){e(Fr({chainId:n,address:t}))}),[e])}(),m=function(){var e=Object(v.c)();return Object(i.useCallback)((function(n){e(Yr({serializedToken:Gr(n)}))}),[e])}();return Object(r.jsxs)(Na,{style:o,className:"token-item-".concat(b),onClick:function(){return a?null:t()},disabled:a,selected:c,children:[Object(r.jsx)(ha,{currency:n,size:"24px"}),Object(r.jsxs)(Me,{children:[Object(r.jsx)(s.z,{title:n.name,children:n.symbol}),Object(r.jsxs)(Ia,{children:[p||!f||n instanceof ur?null:Object(r.jsxs)(s.z,{children:["Added by user",Object(r.jsx)(En,{onClick:function(e){e.stopPropagation(),d&&n instanceof J.j&&h(d,n.address)},children:"(Remove)"})]}),p||f||n instanceof ur?null:Object(r.jsxs)(s.z,{children:["Found by address",Object(r.jsx)(En,{onClick:function(e){e.stopPropagation(),n instanceof J.j&&m(n)},children:"(Add)"})]})]})]}),Object(r.jsx)(Ya,{currency:n}),Object(r.jsx)(rn,{style:{justifySelf:"flex-end"},children:j?Object(r.jsx)(La,{balance:j}):l?Object(r.jsx)(rt,{}):null})]})}function qa(e){var n=e.height,t=e.currencies,a=e.selectedCurrency,c=e.onCurrencySelect,o=e.otherCurrency,s=e.fixedListRef,u=e.showETH,l=Object(i.useMemo)((function(){return u?[J.b.ETHER].concat(Object(K.a)(t)):Object(K.a)(t)}),[t,u]),d=Object(i.useCallback)((function(e){var n=e.data,t=e.index,i=e.style,s=n[t],u=Boolean(a&&Object(J.o)(a,s)),l=Boolean(o&&Object(J.o)(o,s));return Object(r.jsx)(Fa,{style:i,currency:s,isSelected:u,onSelect:function(){return c(s)},otherSelected:l})}),[c,o,a]),b=Object(i.useCallback)((function(e,n){return Pa(n[e])}),[]);return Object(r.jsx)(ya.a,{height:n,ref:s,width:"100%",itemData:l,itemCount:l.length,itemSize:56,itemKey:b,children:d})}function Va(e,n){if(0===n.length)return e;var t=fn(n);if(t)return e.filter((function(e){return e.address===t}));var r=n.toLowerCase().split(/\s+/).filter((function(e){return e.length>0}));if(0===r.length)return e;var i=function(e){var n=e.toLowerCase().split(/\s+/).filter((function(e){return e.length>0}));return r.every((function(e){return 0===e.length||n.some((function(n){return n.startsWith(e)||n.endsWith(e)}))}))};return e.filter((function(e){var n=e.symbol,t=e.name;return n&&i(n)||t&&i(t)}))}function Wa(){var e=Object(u.a)(["\n padding: 8px;\n background-color: ",";\n color: ",";\n border-radius: 8px;\n user-select: none;\n & > * {\n user-select: none;\n }\n :hover {\n cursor: pointer;\n }\n"]);return Wa=function(){return e},e}var Ha=Object(l.default)(rn)(Wa(),(function(e){return e.theme.colors.invertedContrast}),(function(e){return e.theme.colors.text}));function Qa(e){var n=e.toggleSortOrder,t=e.ascending;return Object(r.jsx)(Ha,{onClick:n,children:Object(r.jsx)(s.z,{fontSize:"14px",children:t?"\u2191":"\u2193"})})}function Ga(e){var n=function(){var e=ge().account,n=fi(),t=xi(null!==e&&void 0!==e?e:void 0,Object(i.useMemo)((function(){return Object.values(null!==n&&void 0!==n?n:{})}),[n]));return null!==t&&void 0!==t?t:{}}(),t=Object(i.useMemo)((function(){return function(e){return function(n,t){var r,i,a=(r=e[n.address],i=e[t.address],r&&i?r.greaterThan(i)?-1:r.equalTo(i)?0:1:r&&r.greaterThan("0")?-1:i&&i.greaterThan("0")?1:0);return 0!==a?a:n.symbol&&t.symbol?n.symbol.toLowerCase()0}));return n.length>1?e:[].concat(Object(K.a)(T?[T]:[]),Object(K.a)(e.filter((function(e){var t;return(null===(t=e.symbol)||void 0===t?void 0:t.toLowerCase())===n[0]}))),Object(K.a)(e.filter((function(e){var t;return(null===(t=e.symbol)||void 0===t?void 0:t.toLowerCase())!==n[0]}))))}),[S,m,T,E]),U=Object(i.useCallback)((function(e){if(t(e),o(),N){var n=document.getElementById("bgMusic");n&&n.play()}}),[o,t,N]);Object(i.useEffect)((function(){u&&O("")}),[u]);var A=Object(i.useRef)(),z=Object(i.useCallback)((function(e){var n,t=e.target.value,r=fn(t);O(r||t),null===(n=p.current)||void 0===n||n.scrollTo(0)}),[]),B=Object(i.useCallback)((function(e){if("Enter"===e.key)if("bnb"===m.toLowerCase().trim())U(J.d);else if(R.length>0){var n;(null===(n=R[0].symbol)||void 0===n?void 0:n.toLowerCase())!==m.trim().toLowerCase()&&1!==R.length||U(R[0])}}),[R,U,m]),P=(function(){var e,n,t=pr(),r=Object(v.d)((function(e){return e.lists.byUrl})),i=t?r[t]:void 0;e=null===i||void 0===i?void 0:i.current,n=null===i||void 0===i?void 0:i.pendingUpdate,null===i||void 0===i||i.loadingRequestId}(),Zt());return Object(r.jsxs)(Me,{style:{width:"100%",flex:"1 1"},children:[Object(r.jsxs)(Ea,{gap:"14px",children:[Object(r.jsxs)(en,{children:[Object(r.jsxs)(s.z,{children:[P(82,"Select a token"),Object(r.jsx)(sa,{text:P(128,"Find a token by searching for its name or symbol or by pasting its address below.")})]}),Object(r.jsx)(s.k,{onClick:o})]}),Object(r.jsx)(Sa,{type:"text",id:"token-search-input",placeholder:d("tokenSearchPlaceholder"),value:m,ref:A,onChange:z,onKeyDown:B}),c&&Object(r.jsx)(Oa,{chainId:b,onSelect:U,selectedCurrency:n}),Object(r.jsxs)(en,{children:[Object(r.jsx)(s.z,{fontSize:"14px",children:P(126,"Token name")}),Object(r.jsx)(Qa,{ascending:g,toggleSortOrder:function(){return C((function(e){return!e}))}})]})]}),Object(r.jsx)(Ra,{}),Object(r.jsx)("div",{style:{flex:"1"},children:Object(r.jsx)(Ii.a,{disableWidth:!0,children:function(e){var t=e.height;return Object(r.jsx)(qa,{height:t,showETH:I,currencies:R,onCurrencySelect:U,otherCurrency:a,selectedCurrency:n,fixedListRef:p})}})}),null]})}var Xa=t(430),Ja=t(235),$a=t(236),Za=t.n($a),ec="pancakeswap",nc=[ec],tc=t(146),rc=new Za.a({allErrors:!0}).compile(Ja);function ic(e,n){return ac.apply(this,arguments)}function ac(){return(ac=Object(S.a)(E.a.mark((function e(n,t){var r,i,a,c,o,s,u,l,d,b,p,f,j;return E.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n!==ec){e.next=2;break}return e.abrupt("return",tc);case 2:if(!(r=Bi(n))){e.next=25;break}return e.prev=4,e.next=7,t(r.ensName);case 7:c=e.sent,e.next=14;break;case 10:throw e.prev=10,e.t0=e.catch(4),console.error("Failed to resolve ENS name: ".concat(r.ensName),e.t0),new Error("Failed to resolve ENS name: ".concat(r.ensName));case 14:e.prev=14,o=Ai(c),e.next=22;break;case 18:throw e.prev=18,e.t1=e.catch(14),console.error("Failed to translate contenthash to URI",c),new Error("Failed to translate contenthash to URI: ".concat(c));case 22:i=Pi("".concat(o).concat(null!==(a=r.ensPath)&&void 0!==a?a:"")),e.next=26;break;case 25:i=Pi(n);case 26:s=0;case 27:if(!(s0?"".concat(e,"; ").concat(r):"".concat(r)}),""))&&void 0!==p?p:"unknown error",new Error("Token list failed validation: ".concat(j));case 53:return e.abrupt("return",b);case 54:s++,e.next=27;break;case 57:throw new Error("Unrecognized list URL protocol.");case 58:case"end":return e.stop()}}),e,null,[[4,10],[14,18],[31,37]])})))).apply(this,arguments)}var cc=[{constant:!0,inputs:[{name:"node",type:"bytes32"}],name:"resolver",outputs:[{name:"resolverAddress",type:"address"}],payable:!1,stateMutability:"view",type:"function"}],oc="0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e",sc=[{constant:!0,inputs:[{internalType:"bytes32",name:"node",type:"bytes32"}],name:"contenthash",outputs:[{internalType:"bytes",name:"",type:"bytes"}],payable:!1,stateMutability:"view",type:"function"}];function uc(e,n){return new un.a(e,sc,n)}function lc(e,n){return dc.apply(this,arguments)}function dc(){return(dc=Object(S.a)(E.a.mark((function e(n,t){var r,i,a;return E.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=new un.a(oc,cc,t),i=Object(Mi.namehash)(n),e.next=4,r.resolver(i);case 4:return a=e.sent,e.abrupt("return",uc(a,t).contenthash(i));case 6:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function bc(){var e=ge(),n=e.chainId,t=e.library,r=Object(v.c)(),a=Object(i.useCallback)((function(e){if(!t||n!==J.a.MAINNET){if(Y===J.a.MAINNET){var r=function(){var e;return F=null!==(e=F)&&void 0!==e?e:new x.a(q.provider)}();if(r)return lc(e,r)}throw new Error("Could not construct mainnet ENS resolver")}return lc(e,t)}),[n,t]);return Object(i.useCallback)(function(){var e=Object(S.a)(E.a.mark((function e(n){var t;return E.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=Object(Ce.f)(),r(Ye.pending({requestId:t,url:n})),e.abrupt("return",ic(n,a).then((function(e){return r(Ye.fulfilled({url:n,tokenList:e,requestId:t})),e})).catch((function(e){throw console.error("Failed to get list at url ".concat(n),e),r(Ye.rejected({url:n,requestId:t,errorMessage:e.message})),e})));case 3:case"end":return e.stop()}}),e)})));return function(n){return e.apply(this,arguments)}}(),[r,a])}function pc(e,n){var t=Object(i.useRef)(n);Object(i.useEffect)((function(){t.current=n}),[n]),Object(i.useEffect)((function(){var n=function(n){var r,i;null!==(r=null===(i=e.current)||void 0===i?void 0:i.contains(n.target))&&void 0!==r&&r||t.current&&t.current()};return document.addEventListener("mousedown",n),function(){document.removeEventListener("mousedown",n)}}),[e])}function fc(){var e=Object(u.a)(["\n flex: 1;\n overflow: auto;\n"]);return fc=function(){return e},e}function jc(){var e=Object(u.a)(["\n max-width: 160px;\n opacity: 0.6;\n margin-right: 0.5rem;\n font-size: 14px;\n overflow: hidden;\n text-overflow: ellipsis;\n"]);return jc=function(){return e},e}function hc(){var e=Object(u.a)(["\n display: flex;\n justify-content: center;\n align-items: center;\n position: relative;\n border: none;\n"]);return hc=function(){return e},e}function vc(){var e=Object(u.a)(["\n z-index: 100;\n visibility: ",";\n opacity: ",";\n transition: visibility 150ms linear, opacity 150ms linear;\n background: ",";\n border: 1px solid ",";\n box-shadow: 0px 0px 1px rgba(0, 0, 0, 0.01), 0px 4px 8px rgba(0, 0, 0, 0.04), 0px 16px 24px rgba(0, 0, 0, 0.04),\n 0px 24px 32px rgba(0, 0, 0, 0.01);\n color: ",";\n border-radius: 0.5rem;\n padding: 1rem;\n display: grid;\n grid-template-rows: 1fr;\n grid-gap: 8px;\n font-size: 1rem;\n text-align: left;\n"]);return vc=function(){return e},e}function mc(){var e=Object(u.a)(["\n padding: 0;\n font-size: 1rem;\n opacity: ",";\n"]);return mc=function(){return e},e}var Oc=Object(l.default)(En)(mc(),(function(e){return e.disabled?"0.4":"1"})),yc=l.default.div(vc(),(function(e){return e.show?"visible":"hidden"}),(function(e){return e.show?1:0}),(function(e){return e.theme.colors.invertedContrast}),(function(e){return e.theme.colors.tertiary}),(function(e){return e.theme.colors.textSubtle})),xc=l.default.div(hc()),gc=l.default.div(jc());function Cc(e){var n=e.listUrl,t=Object(i.useMemo)((function(){var e;return null===(e=Bi(n))||void 0===e?void 0:e.ensName}),[n]),a=Object(i.useMemo)((function(){if(!t){var e=n.toLowerCase();if(e.startsWith("ipfs://")||e.startsWith("ipns://"))return n;try{return new URL(n).host}catch(r){return}}}),[n,t]);return Object(r.jsx)(r.Fragment,{children:null!==t&&void 0!==t?t:a})}function wc(e){return"list-row-".concat(e.replace(/\./g,"-"))}var kc=Object(i.memo)((function(e){var n=e.listUrl,t=e.onBack,a=Object(v.d)((function(e){return e.lists.byUrl})),c=pr(),o=Object(v.c)(),u=a[n],l=u.current,d=u.pendingUpdate,b=n===c,p=function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],n=Object(i.useState)(e),t=Object(f.a)(n,2),r=t[0],a=t[1],c=Object(i.useCallback)((function(){return a((function(e){return!e}))}),[]);return[r,c]}(!1),j=Object(f.a)(p,2),h=j[0],m=j[1],O=Object(i.useRef)(),y=Object(i.useState)(),x=Object(f.a)(y,2),g=x[0],C=x[1],w=Object(i.useState)(),k=Object(f.a)(w,2),T=k[0],I=k[1],E=Object(Hi.a)(g,T,{placement:"auto",strategy:"fixed",modifiers:[{name:"offset",options:{offset:[8,8]}}]}),N=E.styles,S=E.attributes;pc(O,h?m:void 0);var R=Object(i.useCallback)((function(){b||(o(We(n)),t())}),[o,b,n,t]),U=Object(i.useCallback)((function(){d&&o(Fe(n))}),[o,n,d]),A=Object(i.useCallback)((function(){"REMOVE"===window.prompt("Please confirm you would like to remove this list by typing REMOVE")&&o(Ve(n))}),[o,n]),z=Zt();return l?Object(r.jsxs)(an,{align:"center",padding:"16px",id:wc(n),children:[l.logoURI?Object(r.jsx)(Wi,{style:{marginRight:"1rem"},logoURI:l.logoURI,alt:"".concat(l.name," list logo")}):Object(r.jsx)("div",{style:{width:"24px",height:"24px",marginRight:"1rem"}}),Object(r.jsxs)(Me,{style:{flex:"1"},children:[Object(r.jsx)(an,{children:Object(r.jsx)(s.z,{bold:b,fontSize:"16px",style:{overflow:"hidden",textOverflow:"ellipsis"},children:l.name})}),Object(r.jsx)(an,{style:{marginTop:"4px"},children:Object(r.jsx)(gc,{title:n,children:Object(r.jsx)(Cc,{listUrl:n})})})]}),Object(r.jsxs)(xc,{ref:O,children:[Object(r.jsx)("div",{style:{display:"inline-block"},ref:C,children:Object(r.jsx)(s.d,{style:{width:"32px",marginRight:"8px"},onClick:m,variant:"secondary",children:Object(r.jsx)(s.j,{})})}),h&&Object(r.jsxs)(yc,Object(X.a)(Object(X.a)({show:!0,ref:I,style:N.popper},S.popper),{},{children:[Object(r.jsx)("div",{children:l&&He(l.version)}),Object(r.jsx)(Ua,{}),Object(r.jsx)(Rn,{href:"https://tokenlists.org/token-list?url=".concat(n),children:z(1206,"View list")}),Object(r.jsx)(Oc,{onClick:A,disabled:1===Object.keys(a).length,children:"Remove list"}),d&&Object(r.jsx)(Oc,{onClick:U,children:"Update list"})]}))]}),b?Object(r.jsx)(s.d,{disabled:!0,style:{width:"5rem",minWidth:"5rem"},children:"Selected"}):Object(r.jsx)(r.Fragment,{children:Object(r.jsx)(s.d,{className:"select-button",style:{width:"5rem",minWidth:"4.5rem"},onClick:R,children:"Select"})})]},n):null})),Tc=l.default.div(fc());function Ic(e){var n,t=e.onDismiss,a=e.onBack,c=Object(i.useState)(""),o=Object(f.a)(c,2),u=o[0],l=o[1],d=Object(v.c)(),b=Object(v.d)((function(e){return e.lists.byUrl})),p=Boolean(null===(n=b[u])||void 0===n?void 0:n.loadingRequestId),j=Object(i.useState)(null),h=Object(f.a)(j,2),m=h[0],O=h[1],y=Object(i.useCallback)((function(e){l(e.target.value),O(null)}),[]),x=bc(),g=Object(i.useCallback)((function(){p||(O(null),x(u).then((function(){l("")})).catch((function(e){O(e.message),d(Ve(u))})))}),[p,d,x,u]),C=Object(i.useMemo)((function(){return Pi(u).length>0||Boolean(Bi(u))}),[u]),w=Object(i.useCallback)((function(e){C&&"Enter"===e.key&&g()}),[g,C]),k=Object(i.useMemo)((function(){return Object.keys(b).filter((function(e){return Boolean(b[e].current)})).sort((function(e,n){var t=b[e].current,r=b[n].current;return t&&r?t.name.toLowerCase()20?"".concat(l.symbol.slice(0,4),"...").concat(l.symbol.slice(l.symbol.length-5,l.symbol.length)):null===l||void 0===l?void 0:l.symbol)||N(1196,"Select a currency")}),!b&&Object(r.jsx)(s.j,{})]})})]})]}),!b&&u&&Object(r.jsx)(Ec,{isOpen:k,onDismiss:R,onCurrencySelect:u,selectedCurrency:l,otherSelectedCurrency:y,showCommonBases:g})]})}function Zc(){var e=Object(u.a)(["\n color: ",";\n"]);return Zc=function(){return e},e}function eo(){var e=Object(u.a)(["\n font-weight: 500;\n font-size: 20px;\n"]);return eo=function(){return e},e}function no(){var e=Object(u.a)(["\n display: flex;\n flex-flow: row nowrap;\n align-items: center;\n border-radius: 3rem;\n justify-content: space-evenly;\n"]);return no=function(){return e},e}var to=l.default.div(no()),ro=l.default.div(eo()),io=Object(l.default)(Xa.a)(Zc(),(function(e){return e.theme.colors.text}));function ao(){var e=Zt();return Object(r.jsx)(to,{children:Object(r.jsxs)(en,{style:{padding:"1rem"},children:[Object(r.jsx)(j.b,{to:"/pool",children:Object(r.jsx)(io,{})}),Object(r.jsx)(ro,{children:"Import Pool"}),Object(r.jsx)(sa,{text:e(256,"Use this tool to find pairs that do not automatically appear in the interface.")})]})})}function co(e){var n=e.adding,t=Zt();return Object(r.jsx)(to,{children:Object(r.jsxs)(en,{style:{padding:"1rem"},children:[Object(r.jsx)(j.b,{to:"/pool",children:Object(r.jsx)(io,{})}),Object(r.jsxs)(ro,{children:[n?t(258,"Add"):t(260,"Remove")," Liquidity"]}),Object(r.jsx)(sa,{text:n?t(264,"When you add liquidity, you are given pool tokens representing your position. These tokens automatically earn fees proportional to your share of the pool, and can be redeemed at any time."):t(266,"Removing pool tokens converts your position back into underlying tokens at the current rate, proportional to your share of the pool. Accrued fees are included in the amounts you receive.")})]})})}var oo=t(431),so=t(432);function uo(e){var n,t,r=null===(n=Ar(li(null===e||void 0===e?void 0:e.address,!1),"totalSupply"))||void 0===n||null===(t=n.result)||void 0===t?void 0:t[0];return e&&r?new J.k(e,r.toString()):void 0}function lo(e){if(e===J.d)return"BNB";if(e instanceof J.j)return e.address;throw new Error("invalid currency")}function bo(e,n){return n&&e===J.d?J.n[n]:e instanceof J.j?e:void 0}function po(e,n){var t=e&&n?bo(e.currency,n):void 0;return t&&e?new J.k(t,e.raw):void 0}function fo(e){return e.equals(J.n[e.chainId])?J.d:e}function jo(){var e=Object(u.a)(["\n background-color: ",";\n color: ",";\n padding: 0.5rem;\n border-radius: 12px;\n margin-top: 8px;\n"]);return jo=function(){return e},e}function ho(){var e=Object(u.a)(["\n background-color: ",";\n display: flex;\n align-items: center;\n justify-content: center;\n margin-right: 12px;\n border-radius: 12px;\n min-width: 48px;\n height: 48px;\n"]);return ho=function(){return e},e}function vo(){var e=Object(u.a)(["\n background-color: ",";\n border-radius: 1rem;\n display: flex;\n align-items: center;\n font-size: 0.825rem;\n width: 100%;\n padding: 3rem 1.25rem 1rem 1rem;\n margin-top: -2rem;\n color: ",";\n z-index: -1;\n p {\n padding: 0;\n margin: 0;\n font-weight: 500;\n }\n"]);return vo=function(){return e},e}function mo(){var e=Object(u.a)(["\n &::after {\n display: inline-block;\n animation: ellipsis 1.25s infinite;\n content: '.';\n width: 1em;\n text-align: left;\n }\n @keyframes ellipsis {\n 0% {\n content: '.';\n }\n 33% {\n content: '..';\n }\n 66% {\n content: '...';\n }\n }\n"]);return mo=function(){return e},e}function Oo(){var e=Object(u.a)(["\n height: 22px;\n width: 22px;\n background-color: ",";\n border: none;\n border-radius: 50%;\n padding: 0.2rem;\n font-size: 0.875rem;\n font-weight: 400;\n margin-left: 0.4rem;\n cursor: pointer;\n color: ",";\n display: flex;\n justify-content: center;\n align-items: center;\n float: right;\n\n :hover {\n background-color: ",";\n }\n :focus {\n background-color: ",";\n outline: none;\n }\n"]);return Oo=function(){return e},e}function yo(){var e=Object(u.a)(["\n color: ",";\n"]);return yo=function(){return e},e}function xo(){var e=Object(u.a)(["\n margin-top: 1rem;\n"]);return xo=function(){return e},e}function go(){var e=Object(u.a)(["\n height: 1px;\n width: 100%;\n background-color: ",";\n"]);return go=function(){return e},e}function Co(){var e=Object(u.a)(["\n :hover {\n cursor: pointer;\n opacity: 0.8;\n }\n "]);return Co=function(){return e},e}function wo(){var e=Object(u.a)(["\n padding: 2px;\n\n ","\n"]);return wo=function(){return e},e}function ko(){var e=Object(u.a)(["\n position: relative;\n"]);return ko=function(){return e},e}var To=l.default.div(ko()),Io=l.default.div(wo(),(function(e){return e.clickable?Object(l.css)(Co()):null})),Eo=l.default.div(go(),(function(e){return e.theme.colors.tertiary})),No=l.default.div(xo()),So=Object(l.default)(s.z)(yo(),(function(e){var n=e.theme,t=e.severity;return 3===t||4===t?n.colors.failure:2===t?n.colors.binance:1===t?n.colors.text:n.colors.success})),Ro=l.default.button(Oo(),(function(e){return e.theme.colors.invertedContrast}),(function(e){return e.theme.colors.textSubtle}),(function(e){return e.theme.colors.tertiary}),(function(e){return e.theme.colors.tertiary})),Uo=l.default.span(mo()),Ao=l.default.div(vo(),(function(e){var n=e.theme;return Object(vt.b)(.9,n.colors.failure)}),(function(e){return e.theme.colors.failure})),zo=l.default.div(ho(),(function(e){var n=e.theme;return Object(vt.b)(.9,n.colors.failure)}));function Bo(e){var n=e.error;return Object(r.jsxs)(Ao,{children:[Object(r.jsx)(zo,{children:Object(r.jsx)(Wt.a,{size:24})}),Object(r.jsx)("p",{children:n})]})}var Po=Object(l.default)(Pe)(jo(),(function(e){var n=e.theme;return Object(vt.b)(.9,n.colors.primary)}),(function(e){return e.theme.colors.primary}));function Mo(){var e=Object(u.a)(["\n border: 1px solid ",";\n :hover {\n border: 1px solid ",";\n }\n"]);return Mo=function(){return e},e}function Do(){var e=Object(u.a)(["\n height: 24px;\n"]);return Do=function(){return e},e}var Lo=Object(l.default)(en)(Do()),_o=Object(l.default)(pt)(Mo(),(function(e){return e.theme.colors.invertedContrast}),(function(e){var n=e.theme;return Object(vt.a)(.06,n.colors.invertedContrast)}));function Yo(e){var n=e.pair,t=e.showUnwrapped,a=void 0!==t&&t,c=ge().account,o=a?n.token0:fo(n.token0),u=a?n.token1:fo(n.token1),l=Object(i.useState)(!1),d=Object(f.a)(l,2),b=d[0],p=d[1],j=gi(null!==c&&void 0!==c?c:void 0,n.liquidityToken),h=uo(n.liquidityToken),v=n&&h&&j&&J.e.greaterThanOrEqual(h.raw,j.raw)?[n.getLiquidityValue(n.token0,h,j,!1),n.getLiquidityValue(n.token1,h,j,!1)]:[void 0,void 0],m=Object(f.a)(v,2),O=m[0],y=m[1];return Object(r.jsx)(r.Fragment,{children:j&&Object(r.jsx)(s.g,{children:Object(r.jsx)(s.h,{children:Object(r.jsxs)(Pe,{gap:"12px",children:[Object(r.jsx)(Lo,{children:Object(r.jsx)(rn,{children:Object(r.jsx)(s.z,{style:{textTransform:"uppercase",fontWeight:600},fontSize:"14px",color:"textSubtle",children:"LP Tokens in your Wallet"})})}),Object(r.jsxs)(Lo,{onClick:function(){return p(!b)},children:[Object(r.jsxs)(rn,{children:[Object(r.jsx)(Bc,{currency0:o,currency1:u,margin:!0,size:20}),Object(r.jsxs)(s.z,{fontSize:"14px",children:[o.symbol,"/",u.symbol]})]}),Object(r.jsx)(rn,{children:Object(r.jsx)(s.z,{fontSize:"14px",children:j?j.toSignificant(4):"-"})})]}),Object(r.jsxs)(Pe,{gap:"4px",children:[Object(r.jsxs)(Lo,{children:[Object(r.jsxs)(s.z,{fontSize:"14px",children:[o.symbol,":"]}),O?Object(r.jsx)(rn,{children:Object(r.jsx)(s.z,{ml:"6px",fontSize:"14px",children:null===O||void 0===O?void 0:O.toSignificant(6)})}):"-"]}),Object(r.jsxs)(Lo,{children:[Object(r.jsxs)(s.z,{fontSize:"14px",children:[u.symbol,":"]}),y?Object(r.jsx)(rn,{children:Object(r.jsx)(s.z,{ml:"6px",fontSize:"14px",children:null===y||void 0===y?void 0:y.toSignificant(6)})}):"-"]})]})]})})})})}function Fo(e){var n=e.pair,t=ge().account,a=fo(n.token0),c=fo(n.token1),o=Object(i.useState)(!1),u=Object(f.a)(o,2),l=u[0],d=u[1],b=gi(null!==t&&void 0!==t?t:void 0,n.liquidityToken),p=uo(n.liquidityToken),h=b&&p&&J.e.greaterThanOrEqual(p.raw,b.raw)?new J.g(b.raw,p.raw):void 0,v=n&&p&&b&&J.e.greaterThanOrEqual(p.raw,b.raw)?[n.getLiquidityValue(n.token0,p,b,!1),n.getLiquidityValue(n.token1,p,b,!1)]:[void 0,void 0],m=Object(f.a)(v,2),O=m[0],y=m[1];return Object(r.jsx)(_o,{children:Object(r.jsxs)(Pe,{gap:"12px",children:[Object(r.jsxs)(Lo,{onClick:function(){return d(!l)},style:{cursor:"pointer"},children:[Object(r.jsxs)(rn,{children:[Object(r.jsx)(Bc,{currency0:a,currency1:c,margin:!0,size:20}),Object(r.jsx)(s.z,{children:a&&c?"".concat(a.symbol,"/").concat(c.symbol):Object(r.jsx)(Uo,{children:"Loading"})})]}),Object(r.jsx)(rn,{children:l?Object(r.jsx)(oo.a,{size:"20",style:{marginLeft:"10px"}}):Object(r.jsx)(so.a,{size:"20",style:{marginLeft:"10px"}})})]}),l&&Object(r.jsxs)(Pe,{gap:"8px",children:[Object(r.jsxs)(Lo,{children:[Object(r.jsx)(rn,{children:Object(r.jsxs)(s.z,{children:["Pooled ",a.symbol,":"]})}),O?Object(r.jsxs)(rn,{children:[Object(r.jsx)(s.z,{ml:"6px",children:null===O||void 0===O?void 0:O.toSignificant(6)}),Object(r.jsx)(ha,{size:"20px",style:{marginLeft:"8px"},currency:a})]}):"-"]}),Object(r.jsxs)(Lo,{children:[Object(r.jsx)(rn,{children:Object(r.jsxs)(s.z,{children:["Pooled ",c.symbol,":"]})}),y?Object(r.jsxs)(rn,{children:[Object(r.jsx)(s.z,{ml:"6px",children:null===y||void 0===y?void 0:y.toSignificant(6)}),Object(r.jsx)(ha,{size:"20px",style:{marginLeft:"8px"},currency:c})]}):"-"]}),Object(r.jsxs)(Lo,{children:[Object(r.jsx)(s.z,{children:"Your pool tokens:"}),Object(r.jsx)(s.z,{children:b?b.toSignificant(4):"-"})]}),Object(r.jsxs)(Lo,{children:[Object(r.jsx)(s.z,{children:"Your pool share:"}),Object(r.jsx)(s.z,{children:h?"".concat(h.toFixed(2),"%"):"-"})]}),Object(r.jsxs)(en,{marginTop:"10px",children:[Object(r.jsx)(s.d,{as:j.b,to:"/add/".concat(lo(a),"/").concat(lo(c)),style:{width:"48%"},children:"Add"}),Object(r.jsx)(s.d,{as:j.b,style:{width:"48%"},to:"/remove/".concat(lo(a),"/").concat(lo(c)),children:"Remove"})]})]})]})})}var qo,Vo=new ir.b(ri.a);function Wo(e){var n=ge().chainId,t=Object(i.useMemo)((function(){return e.map((function(e){var t=Object(f.a)(e,2),r=t[0],i=t[1];return[bo(r,n),bo(i,n)]}))}),[n,e]),r=Ur(Object(i.useMemo)((function(){return t.map((function(e){var n=Object(f.a)(e,2),t=n[0],r=n[1];return t&&r&&!t.equals(r)?J.f.getAddress(t,r):void 0}))}),[t]),Vo,"getReserves");return Object(i.useMemo)((function(){return r.map((function(e,n){var r=e.result,i=e.loading,a=t[n][0],c=t[n][1];if(i)return[qo.LOADING,null];if(!a||!c||a.equals(c))return[qo.INVALID,null];if(!r)return[qo.NOT_EXISTS,null];var o=r.reserve0,s=r.reserve1,u=a.sortsBefore(c)?[a,c]:[c,a],l=Object(f.a)(u,2),d=l[0],b=l[1];return[qo.EXISTS,new J.f(new J.k(d,o.toString()),new J.k(b,s.toString()))]}))}),[r,t])}function Ho(e,n){return Wo([[e,n]])[0]}!function(e){e[e.LOADING=0]="LOADING",e[e.NOT_EXISTS=1]="NOT_EXISTS",e[e.EXISTS=2]="EXISTS",e[e.INVALID=3]="INVALID"}(qo||(qo={}));var Qo=t(423);function Go(e,n,t){var r=Ar(li(null===e||void 0===e?void 0:e.address,!1),"allowance",Object(i.useMemo)((function(){return[n,t]}),[n,t])).result;return Object(i.useMemo)((function(){return e&&r?new J.k(e,r.toString()):void 0}),[e,r])}var Ko;!function(e){e.INPUT="INPUT",e.OUTPUT="OUTPUT"}(Ko||(Ko={}));var Xo=Object(Ce.b)("swap/selectCurrency"),Jo=Object(Ce.b)("swap/switchCurrencies"),$o=Object(Ce.b)("swap/typeInput"),Zo=Object(Ce.b)("swap/replaceSwapState"),es=Object(Ce.b)("swap/setRecipient"),ns=Object(Ce.b)("transactions/addTransaction"),ts=Object(Ce.b)("transactions/clearAllTransactions"),rs=Object(Ce.b)("transactions/finalizeTransaction"),is=Object(Ce.b)("transactions/checkedTransaction");function as(){var e=ge(),n=e.chainId,t=e.account,r=Object(v.c)();return Object(i.useCallback)((function(e){var i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},a=i.summary,c=i.approval;if(t&&n){var o=e.hash;if(!o)throw Error("No transaction hash found.");r(ns({hash:o,from:t,chainId:n,approval:c,summary:a}))}}),[r,n,t])}function cs(){var e,n=ge().chainId,t=Object(v.d)((function(e){return e.transactions}));return n&&null!==(e=t[n])&&void 0!==e?e:{}}function os(e){return(new Date).getTime()-e.addedTime<864e5}var ss,us,ls=new J.g(J.e.BigInt(20),J.e.BigInt(1e4)),ds=new J.g(J.e.BigInt(1e4),J.e.BigInt(1e4)),bs=ds.subtract(ls);function ps(e){var n=e?ds.subtract(e.route.pairs.reduce((function(e){return e.multiply(bs)}),ds)):void 0,t=e&&n?e.priceImpact.subtract(n):void 0;return{priceImpactWithoutFee:t?new J.g(null===t||void 0===t?void 0:t.numerator,null===t||void 0===t?void 0:t.denominator):void 0,realizedLPFee:n&&e&&(e.inputAmount instanceof J.k?new J.k(e.inputAmount.token,n.multiply(e.inputAmount.raw).quotient):J.c.ether(n.multiply(e.inputAmount.raw).quotient))}}function fs(e,n){var t,r,i=(r=n,new J.g(J.e.BigInt(Math.floor(r)),J.e.BigInt(1e4)));return t={},Object(y.a)(t,Ko.INPUT,null===e||void 0===e?void 0:e.maximumAmountIn(i)),Object(y.a)(t,Ko.OUTPUT,null===e||void 0===e?void 0:e.minimumAmountOut(i)),t}function js(e){return(null===e||void 0===e?void 0:e.lessThan(ye))?(null===e||void 0===e?void 0:e.lessThan(me))?(null===e||void 0===e?void 0:e.lessThan(ve))?(null===e||void 0===e?void 0:e.lessThan(he))?0:1:2:3:4}function hs(e,n){return e?n?"".concat(e.executionPrice.invert().toSignificant(6)," ").concat(e.inputAmount.currency.symbol," / ").concat(e.outputAmount.currency.symbol):"".concat(e.executionPrice.toSignificant(6)," ").concat(e.outputAmount.currency.symbol," / ").concat(e.inputAmount.currency.symbol):""}function vs(e,n){var t=ge().account,r=e instanceof J.k?e.token:void 0,a=Go(r,null!==t&&void 0!==t?t:void 0,n),c=function(e,n){var t=cs();return Object(i.useMemo)((function(){return"string"===typeof e&&"string"===typeof n&&Object.keys(t).some((function(r){var i=t[r];if(!i)return!1;if(i.receipt)return!1;var a=i.approval;return!!a&&a.spender===n&&a.tokenAddress===e&&os(i)}))}),[t,n,e])}(null===r||void 0===r?void 0:r.address,n),o=Object(i.useMemo)((function(){return e&&n?e.currency===J.d?ss.APPROVED:a?a.lessThan(e)?c?ss.PENDING:ss.NOT_APPROVED:ss.APPROVED:ss.UNKNOWN:ss.UNKNOWN}),[e,a,c,n]),s=li(null===r||void 0===r?void 0:r.address),u=as(),l=Object(i.useCallback)(Object(S.a)(E.a.mark((function t(){var i,a;return E.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(o===ss.NOT_APPROVED){t.next=3;break}return console.error("approve was called unnecessarily"),t.abrupt("return");case 3:if(r){t.next=6;break}return console.error("no token"),t.abrupt("return");case 6:if(s){t.next=9;break}return console.error("tokenContract is null"),t.abrupt("return");case 9:if(e){t.next=12;break}return console.error("missing amount to approve"),t.abrupt("return");case 12:if(n){t.next=15;break}return console.error("no spender"),t.abrupt("return");case 15:return i=!1,t.next=18,s.estimateGas.approve(n,Qo.a).catch((function(){return i=!0,s.estimateGas.approve(n,e.raw.toString())}));case 18:return a=t.sent,t.abrupt("return",s.approve(n,i?e.raw.toString():Qo.a,{gasLimit:mn(a)}).then((function(t){u(t,{summary:"Approve ".concat(e.currency.symbol),approval:{tokenAddress:r.address,spender:n}})})).catch((function(e){throw console.error("Failed to approve token",e),e})));case 20:case"end":return t.stop()}}),t)}))),[o,r,s,e,n,u]);return[o,l]}!function(e){e[e.UNKNOWN=0]="UNKNOWN",e[e.NOT_APPROVED=1]="NOT_APPROVED",e[e.PENDING=2]="PENDING",e[e.APPROVED=3]="APPROVED"}(ss||(ss={})),function(e){e.CURRENCY_A="CURRENCY_A",e.CURRENCY_B="CURRENCY_B"}(us||(us={}));var ms=Object(Ce.b)("mint/typeInputMint"),Os=Object(Ce.b)("mint/resetMintState"),ys=t(168);function xs(e,n){var t=Object(i.useState)(e),r=Object(f.a)(t,2),a=r[0],c=r[1];return Object(i.useEffect)((function(){var t=setTimeout((function(){c(e)}),n);return function(){clearTimeout(t)}}),[e,n]),a}function gs(e){var n=fn(e),t=function(e){var n,t,r,a=xs(e,200),c=Object(i.useMemo)((function(){if(!a||!fn(a))return[void 0];try{return a?[Object(Mi.namehash)("".concat(a.toLowerCase().substr(2),".addr.reverse"))]:[void 0]}catch(e){return[void 0]}}),[a]),o=Ar(di(!1),"resolver",c),s=null===(n=o.result)||void 0===n?void 0:n[0],u=Ar(bi(s&&!Di(s)?s:void 0,!1),"name",c),l=a!==e;return{ENSName:l?null:null!==(t=null===(r=u.result)||void 0===r?void 0:r[0])&&void 0!==t?t:null,loading:l||o.loading||u.loading}}(n||void 0),r=function(e){var n,t,r,a=xs(e,200),c=Object(i.useMemo)((function(){if(!a)return[void 0];try{return a?[Object(Mi.namehash)(a)]:[void 0]}catch(e){return[void 0]}}),[a]),o=Ar(di(!1),"resolver",c),s=null===(n=o.result)||void 0===n?void 0:n[0],u=Ar(bi(s&&!Di(s)?s:void 0,!1),"addr",c),l=a!==e;return{address:l?null:null!==(t=null===(r=u.result)||void 0===r?void 0:r[0])&&void 0!==t?t:null,loading:l||o.loading||u.loading}}(e);return{loading:t.loading||r.loading,address:n||r.address,name:t.ENSName?t.ENSName:!n&&r.address&&e||null}}function Cs(e,n){var t=ge().chainId,r=Object(i.useMemo)((function(){return t?ce[t]:[]}),[t]),a=Object(i.useMemo)((function(){return Br()(r,(function(e){return r.map((function(n){return[e,n]}))})).filter((function(e){var n=Object(f.a)(e,2),t=n[0],r=n[1];return t.address!==r.address}))}),[r]),c=t?[bo(e,t),bo(n,t)]:[void 0,void 0],o=Object(f.a)(c,2),s=o[0],u=o[1],l=Wo(Object(i.useMemo)((function(){return s&&u?[[s,u]].concat(Object(K.a)(r.map((function(e){return[s,e]}))),Object(K.a)(r.map((function(e){return[u,e]}))),Object(K.a)(a)).filter((function(e){return Boolean(e[0]&&e[1])})).filter((function(e){var n=Object(f.a)(e,2),t=n[0],r=n[1];return t.address!==r.address})).filter((function(e){var n=Object(f.a)(e,2),r=n[0],i=n[1];if(!t)return!0;var a=oe[t];if(!a)return!0;var c=a[r.address],o=a[i.address];return!c&&!o||!(c&&!c.find((function(e){return i.equals(e)})))&&!(o&&!o.find((function(e){return r.equals(e)})))})):[]}),[s,u,r,a,t]));return Object(i.useMemo)((function(){return Object.values(l.filter((function(e){return Boolean(e[0]===qo.EXISTS&&e[1])})).reduce((function(e,n){var t,r=Object(f.a)(n,2)[1];return e[r.liquidityToken.address]=null!==(t=e[r.liquidityToken.address])&&void 0!==t?t:r,e}),{}))}),[l])}var ws=t(237);function ks(){return Object(v.d)((function(e){return e.swap}))}function Ts(e,n){if(e&&n)try{var t=Object(ys.parseUnits)(e,n.decimals).toString();if("0"!==t)return n instanceof J.j?new J.k(n,J.e.BigInt(t)):J.c.ether(J.e.BigInt(t))}catch(r){console.info('Failed to parse input amount: "'.concat(e,'"'),r)}}var Is=["0x5Fe5cC0122403f06abE2A75DBba1860Edb762985","0x3E2b14680108E8C5C45C3ab5Bc04E01397af14cB","0xCc7aDc94F3D80127849D2b41b6439b7CF1eB4Ae0"];function Es(e,n){return e.route.path.some((function(e){return e.address===n}))||e.route.pairs.some((function(e){return e.liquidityToken.address===n}))}function Ns(){var e,n,t,r,a,c,o,s=ge().account,u=ks(),l=u.independentField,d=u.typedValue,b=u[Ko.INPUT].currencyId,p=u[Ko.OUTPUT].currencyId,j=u.recipient,h=mi(b),v=mi(p),m=gs(null!==j&&void 0!==j?j:void 0),O=null!==(e=null===j?s:m.address)&&void 0!==e?e:null,x=Ci(null!==s&&void 0!==s?s:void 0,[null!==h&&void 0!==h?h:void 0,null!==v&&void 0!==v?v:void 0]),g=l===Ko.INPUT,C=Ts(d,null!==(n=g?h:v)&&void 0!==n?n:void 0),w=function(e,n){var t=Cs(null===e||void 0===e?void 0:e.currency,n);return Object(i.useMemo)((function(){var r;return e&&n&&t.length>0&&null!==(r=J.l.bestTradeExactIn(t,e,n,{maxHops:3,maxNumResults:1})[0])&&void 0!==r?r:null}),[t,e,n])}(g?C:void 0,null!==v&&void 0!==v?v:void 0),k=function(e,n){var t=Cs(e,null===n||void 0===n?void 0:n.currency);return Object(i.useMemo)((function(){var r;return e&&n&&t.length>0&&null!==(r=J.l.bestTradeExactOut(t,e,n,{maxHops:3,maxNumResults:1})[0])&&void 0!==r?r:null}),[t,e,n])}(null!==h&&void 0!==h?h:void 0,g?void 0:C),T=g?w:k,I=(t={},Object(y.a)(t,Ko.INPUT,x[0]),Object(y.a)(t,Ko.OUTPUT,x[1]),t),E=(r={},Object(y.a)(r,Ko.INPUT,null!==h&&void 0!==h?h:void 0),Object(y.a)(r,Ko.OUTPUT,null!==v&&void 0!==v?v:void 0),r);(s||(a="Connect Wallet"),C)||(a=null!==(c=a)&&void 0!==c?c:"Enter an amount");E[Ko.INPUT]&&E[Ko.OUTPUT]||(a=null!==(o=a)&&void 0!==o?o:"Select a token");var N,S=fn(O);if(O&&S){if(-1!==Is.indexOf(S)||w&&Es(w,S)||k&&Es(k,S)){var R;a=null!==(R=a)&&void 0!==R?R:"Invalid recipient"}}else a=null!==(N=a)&&void 0!==N?N:"Enter a recipient";var U=Jr(),A=Object(f.a)(U,1)[0],z=T&&A&&fs(T,A),B=[I[Ko.INPUT],z?z[Ko.INPUT]:null],P=B[0],M=B[1];return P&&M&&P.lessThan(M)&&(a="Insufficient ".concat(M.currency.symbol," balance")),{currencies:E,currencyBalances:I,parsedAmount:C,v2Trade:null!==T&&void 0!==T?T:void 0,inputError:a}}function Ss(e){if("string"===typeof e){var n=fn(e);if(n)return n;if("BNB"===e.toUpperCase())return"BNB";if(!1===n)return"BNB"}return null!=="BNB"?"BNB":""}var Rs=/^[-a-zA-Z0-9@:%._+~#=]{1,256}\.[a-zA-Z0-9()]{1,6}\b([-a-zA-Z0-9()@:%_+.~#?&/=]*)?$/,Us=/^0x[a-fA-F0-9]{40}$/;function As(e){var n,t=Ss(e.inputCurrency),r=Ss(e.outputCurrency);t===r&&("string"===typeof e.outputCurrency?t="":r="");var i,a=function(e){return"string"!==typeof e?null:fn(e)||(Rs.test(e)||Us.test(e)?e:null)}(e.recipient);return n={},Object(y.a)(n,Ko.INPUT,{currencyId:t}),Object(y.a)(n,Ko.OUTPUT,{currencyId:r}),Object(y.a)(n,"typedValue","string"!==typeof(i=e.exactAmount)||isNaN(parseFloat(i))?"":i),Object(y.a)(n,"independentField",function(e){return"string"===typeof e&&"output"===e.toLowerCase()?Ko.OUTPUT:Ko.INPUT}(e.exactField)),Object(y.a)(n,"recipient",a),n}function zs(){var e=ge().chainId,n=Object(v.c)(),t=function(){var e=Object(h.g)().search;return Object(i.useMemo)((function(){return e&&e.length>1?Object(ws.parse)(e,{parseArrays:!1,ignoreQueryPrefix:!0}):{}}),[e])}(),r=Object(i.useState)(),a=Object(f.a)(r,2),c=a[0],o=a[1];return Object(i.useEffect)((function(){if(e){var r=As(t);n(Zo({typedValue:r.typedValue,field:r.independentField,inputCurrencyId:r[Ko.INPUT].currencyId,outputCurrencyId:r[Ko.OUTPUT].currencyId,recipient:r.recipient})),o({inputCurrencyId:r[Ko.INPUT].currencyId,outputCurrencyId:r[Ko.OUTPUT].currencyId})}}),[n,e]),c}var Bs=J.e.BigInt(0);function Ps(){return Object(v.d)((function(e){return e.mint}))}function Ms(e){if(e)return e.currency===J.d?J.e.greaterThan(e.raw,xe)?J.c.ether(J.e.subtract(e.raw,xe)):J.c.ether(J.e.BigInt(0)):e}function Ds(){var e=Object(u.a)(["\n border: 2px solid ",";\n border-radius: 16px;\n padding: 16px;\n"]);return Ds=function(){return e},e}var Ls=l.default.div(Ds(),(function(e){return e.theme.colors.borderColor})),_s=t(124),Ys=Object(Ce.d)({name:"toasts",initialState:{data:[]},reducers:{push:function(e,n){var t=n.payload,r=e.data.findIndex((function(e){return e.id===n.payload.id}));r>=0&&e.data.splice(r,1),e.data.unshift(t)},remove:function(e,n){var t=e.data.findIndex((function(e){return e.id===n.payload}));t>=0&&e.data.splice(t,1)},clear:function(e){e.data=[]}}}),Fs=Ys.actions,qs=Fs.clear,Vs=Fs.remove,Ws=Fs.push,Hs=Ys.reducer,Qs=function(){var e=Object(v.c)();return Object(i.useMemo)((function(){var n=function(n){return e(Ws(n))};return{toastError:function(e,t){return n({id:Object(_s.kebabCase)(e),type:s.F.DANGER,title:e,description:t})},toastInfo:function(e,t){return n({id:Object(_s.kebabCase)(e),type:s.F.INFO,title:e,description:t})},toastSuccess:function(e,t){return n({id:Object(_s.kebabCase)(e),type:s.F.SUCCESS,title:e,description:t})},toastWarning:function(e,t){return n({id:Object(_s.kebabCase)(e),type:s.F.WARNING,title:e,description:t})},push:n,remove:function(n){return e(Vs(n))},clear:function(){return e(qs())}}}),[e])},Gs=function(){var e=Object(m.d)(),n=e.activate,t=e.deactivate,r=Qs().toastError;return{login:Object(i.useCallback)((function(e){var t=G[e];t?n(t,function(){var e=Object(S.a)(E.a.mark((function e(n){return E.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:window.localStorage.removeItem(s.C),n instanceof m.a?r("Unsupported Chain Id","Unsupported Chain Id Error. Check your chain Id."):n instanceof g.b||n instanceof k.NoBscProviderError?r("Provider Error","No provider was found"):n instanceof g.c||n instanceof C.a?(t instanceof C.b&&(t.walletConnectProvider=null),r("Authorization Error","Please authorize to access your account")):r(n.name,n.message);case 2:case"end":return e.stop()}}),e)})));return function(n){return e.apply(this,arguments)}}()):r("Can't find connector","The connector config is wrong")}),[]),logout:t}},Ks=function(e){var n=Zt(),t=Gs(),i=t.login,a=t.logout,c=Object(s.I)(i,a).onPresentConnectModal;return Object(r.jsx)(s.d,Object(X.a)(Object(X.a)({onClick:c},e),{},{children:n(292,"Unlock Wallet")}))};function Xs(){var e=Object(u.a)(["\n position: relative;\n max-width: 436px;\n width: 100%;\n z-index: 5;\n"]);return Xs=function(){return e},e}var Js=Object(l.default)(s.g)(Xs());function $s(e){var n=e.children;return Object(r.jsx)(Js,{children:n})}function Zs(){var e=Object(u.a)(["\n &::after {\n display: inline-block;\n animation: ellipsis 1.25s infinite;\n content: '.';\n width: 1em;\n text-align: left;\n }\n @keyframes ellipsis {\n 0% {\n content: '.';\n }\n 33% {\n content: '..';\n }\n 66% {\n content: '...';\n }\n }\n"]);return Zs=function(){return e},e}function eu(){var e=Object(u.a)(["\n :hover {\n cursor: pointer;\n }\n color: ",";\n"]);return eu=function(){return e},e}function nu(){var e=Object(u.a)(["\n position: relative;\n"]);return nu=function(){return e},e}var tu=l.default.div(nu()),ru=Object(l.default)(s.z)(eu(),(function(e){return e.theme.colors.primary})),iu=l.default.span(Zs());function au(e){var n,t,i,a,c,o,u,l,d=e.noLiquidity,b=e.price,p=e.currencies,f=e.parsedAmounts,j=e.poolTokenPercentage,h=e.onAdd;return Object(r.jsxs)(r.Fragment,{children:[Object(r.jsxs)(en,{children:[Object(r.jsxs)(s.z,{children:[null===(n=p[us.CURRENCY_A])||void 0===n?void 0:n.symbol," Deposited"]}),Object(r.jsxs)(rn,{children:[Object(r.jsx)(ha,{currency:p[us.CURRENCY_A],style:{marginRight:"8px"}}),Object(r.jsx)(s.z,{children:null===(t=f[us.CURRENCY_A])||void 0===t?void 0:t.toSignificant(6)})]})]}),Object(r.jsxs)(en,{children:[Object(r.jsxs)(s.z,{children:[null===(i=p[us.CURRENCY_B])||void 0===i?void 0:i.symbol," Deposited"]}),Object(r.jsxs)(rn,{children:[Object(r.jsx)(ha,{currency:p[us.CURRENCY_B],style:{marginRight:"8px"}}),Object(r.jsx)(s.z,{children:null===(a=f[us.CURRENCY_B])||void 0===a?void 0:a.toSignificant(6)})]})]}),Object(r.jsxs)(en,{children:[Object(r.jsx)(s.z,{children:"Rates"}),Object(r.jsx)(s.z,{children:"1 ".concat(null===(c=p[us.CURRENCY_A])||void 0===c?void 0:c.symbol," = ").concat(null===b||void 0===b?void 0:b.toSignificant(4)," ").concat(null===(o=p[us.CURRENCY_B])||void 0===o?void 0:o.symbol)})]}),Object(r.jsx)(en,{style:{justifyContent:"flex-end"},children:Object(r.jsx)(s.z,{children:"1 ".concat(null===(u=p[us.CURRENCY_B])||void 0===u?void 0:u.symbol," = ").concat(null===b||void 0===b?void 0:b.invert().toSignificant(4)," ").concat(null===(l=p[us.CURRENCY_A])||void 0===l?void 0:l.symbol)})}),Object(r.jsxs)(en,{children:[Object(r.jsx)(s.z,{children:"Share of Pool:"}),Object(r.jsxs)(s.z,{children:[d?"100":null===j||void 0===j?void 0:j.toSignificant(4),"%"]})]}),Object(r.jsx)(s.d,{mt:"20px",onClick:h,children:d?$t(250,"Create Pool & Supply"):$t(252,"Confirm Supply")})]})}function cu(e){var n,t,i,a,c,o,u,l,d=e.currencies,b=e.noLiquidity,p=e.poolTokenPercentage,f=e.price;return Object(r.jsx)(Pe,{gap:"md",children:Object(r.jsxs)(tn,{justify:"space-around",gap:"4px",children:[Object(r.jsxs)(Pe,{justify:"center",children:[Object(r.jsx)(s.z,{children:null!==(n=null===f||void 0===f?void 0:f.toSignificant(6))&&void 0!==n?n:"-"}),Object(r.jsxs)(s.z,{fontSize:"14px",color:"textSubtle",pt:1,children:[null===(t=d[us.CURRENCY_B])||void 0===t?void 0:t.symbol," per ",null===(i=d[us.CURRENCY_A])||void 0===i?void 0:i.symbol]})]}),Object(r.jsxs)(Pe,{justify:"center",children:[Object(r.jsx)(s.z,{children:null!==(a=null===f||void 0===f||null===(c=f.invert())||void 0===c?void 0:c.toSignificant(6))&&void 0!==a?a:"-"}),Object(r.jsxs)(s.z,{fontSize:"14px",color:"textSubtle",pt:1,children:[null===(o=d[us.CURRENCY_A])||void 0===o?void 0:o.symbol," per ",null===(u=d[us.CURRENCY_B])||void 0===u?void 0:u.symbol]})]}),Object(r.jsxs)(Pe,{justify:"center",children:[Object(r.jsxs)(s.z,{children:[b&&f?"100":null!==(l=(null===p||void 0===p?void 0:p.lessThan(fe))?"<0.01":null===p||void 0===p?void 0:p.toFixed(2))&&void 0!==l?l:"0","%"]}),Object(r.jsx)(s.z,{fontSize:"14px",color:"textSubtle",pt:1,children:"Share of Pool"})]})]})})}function ou(e){var n,t,a,c,o,u,l,d,b,p,j,h=e.match.params,m=h.currencyIdA,O=h.currencyIdB,x=e.history,g=ge(),C=g.account,w=g.chainId,k=g.library,T=mi(m),I=mi(O),N=Zt(),R=Boolean(w&&(T&&Object(J.o)(T,J.n[w])||I&&Object(J.o)(I,J.n[w]))),U=Xr(),A=Ps(),z=A.independentField,B=A.typedValue,P=A.otherTypedValue,M=function(e,n){var t,r,a,c,o,s,u,l=ge(),d=l.account,b=l.chainId,p=Ps(),j=p.independentField,h=p.typedValue,v=p.otherTypedValue,m=j===us.CURRENCY_A?us.CURRENCY_B:us.CURRENCY_A,O=Object(i.useMemo)((function(){var t;return t={},Object(y.a)(t,us.CURRENCY_A,null!==e&&void 0!==e?e:void 0),Object(y.a)(t,us.CURRENCY_B,null!==n&&void 0!==n?n:void 0),t}),[e,n]),x=Ho(O[us.CURRENCY_A],O[us.CURRENCY_B]),g=Object(f.a)(x,2),C=g[0],w=g[1],k=uo(null===w||void 0===w?void 0:w.liquidityToken),T=C===qo.NOT_EXISTS||Boolean(k&&J.e.equal(k.raw,Bs)),I=Ci(null!==d&&void 0!==d?d:void 0,[O[us.CURRENCY_A],O[us.CURRENCY_B]]),E=(t={},Object(y.a)(t,us.CURRENCY_A,I[0]),Object(y.a)(t,us.CURRENCY_B,I[1]),t),N=Ts(h,O[j]),S=Object(i.useMemo)((function(){if(T)return v&&O[m]?Ts(v,O[m]):void 0;if(N){var t=po(N,b),r=[bo(e,b),bo(n,b)],i=r[0],a=r[1];if(i&&a&&t&&w){var c=m===us.CURRENCY_B?n:e,o=m===us.CURRENCY_B?w.priceOf(i).quote(t):w.priceOf(a).quote(t);return c===J.d?J.c.ether(o.raw):o}}}),[T,v,O,m,N,e,b,n,w]),R=(r={},Object(y.a)(r,us.CURRENCY_A,j===us.CURRENCY_A?N:S),Object(y.a)(r,us.CURRENCY_B,j===us.CURRENCY_A?S:N),r),U=Object(i.useMemo)((function(){if(T){var n=R[us.CURRENCY_A],t=R[us.CURRENCY_B];return n&&t?new J.h(n.currency,t.currency,n.raw,t.raw):void 0}var r=bo(e,b);return w&&r?w.priceOf(r):void 0}),[b,e,T,w,R]),A=Object(i.useMemo)((function(){var e=R[us.CURRENCY_A],n=R[us.CURRENCY_B],t=[po(e,b),po(n,b)],r=t[0],i=t[1];if(w&&k&&r&&i)return w.getLiquidityMinted(k,r,i)}),[R,b,w,k]),z=Object(i.useMemo)((function(){if(A&&k)return new J.g(A.raw,k.add(A).raw)}),[A,k]);d||(o="Connect Wallet"),C===qo.INVALID&&(o=null!==(s=o)&&void 0!==s?s:$t(136,"Invalid pair")),R[us.CURRENCY_A]&&R[us.CURRENCY_B]||(o=null!==(u=o)&&void 0!==u?u:$t(84,"Enter an amount"));var B,P,M=R[us.CURRENCY_A],D=R[us.CURRENCY_B];return M&&(null===E||void 0===E||null===(a=E[us.CURRENCY_A])||void 0===a?void 0:a.lessThan(M))&&(o="Insufficient ".concat(null===(B=O[us.CURRENCY_A])||void 0===B?void 0:B.symbol," balance")),D&&(null===E||void 0===E||null===(c=E[us.CURRENCY_B])||void 0===c?void 0:c.lessThan(D))&&(o="Insufficient ".concat(null===(P=O[us.CURRENCY_B])||void 0===P?void 0:P.symbol," balance")),{dependentField:m,currencies:O,pair:w,pairState:C,currencyBalances:E,parsedAmounts:R,price:U,noLiquidity:T,liquidityMinted:A,poolTokenPercentage:z,error:o}}(null!==T&&void 0!==T?T:void 0,null!==I&&void 0!==I?I:void 0),D=M.dependentField,L=M.currencies,_=M.pair,Y=M.pairState,F=M.currencyBalances,q=M.parsedAmounts,V=M.price,W=M.noLiquidity,H=M.liquidityMinted,Q=M.poolTokenPercentage,G=M.error,Z=function(e){var n=Object(v.c)();return{onFieldAInput:Object(i.useCallback)((function(t){n(ms({field:us.CURRENCY_A,typedValue:t,noLiquidity:!0===e}))}),[n,e]),onFieldBInput:Object(i.useCallback)((function(t){n(ms({field:us.CURRENCY_B,typedValue:t,noLiquidity:!0===e}))}),[n,e])}}(W),ee=Z.onFieldAInput,ne=Z.onFieldBInput,te=!G,re=Object(i.useState)(!1),ie=Object(f.a)(re,2),ae=ie[0],ce=ie[1],oe=Object(i.useState)(!1),se=Object(f.a)(oe,2),ue=se[0],le=se[1],de=$r(),be=Object(f.a)(de,1)[0],pe=Jr(),fe=Object(f.a)(pe,1)[0],je=Object(i.useState)(""),he=Object(f.a)(je,2),ve=he[0],me=he[1],Oe=(a={},Object(y.a)(a,z,B),Object(y.a)(a,D,W?P:null!==(n=null===(t=q[D])||void 0===t?void 0:t.toSignificant(6))&&void 0!==n?n:""),a),ye=[us.CURRENCY_A,us.CURRENCY_B].reduce((function(e,n){return Object(X.a)(Object(X.a)({},e),{},Object(y.a)({},n,Ms(F[n])))}),{}),xe=[us.CURRENCY_A,us.CURRENCY_B].reduce((function(e,n){var t,r;return Object(X.a)(Object(X.a)({},e),{},Object(y.a)({},n,null===(t=ye[n])||void 0===t?void 0:t.equalTo(null!==(r=q[n])&&void 0!==r?r:"0")))}),{}),Ce=vs(q[us.CURRENCY_A],$),we=Object(f.a)(Ce,2),ke=we[0],Te=we[1],Ie=vs(q[us.CURRENCY_B],$),Ee=Object(f.a)(Ie,2),Ne=Ee[0],Se=Ee[1],Re=as();function Ue(){return Ae.apply(this,arguments)}function Ae(){return(Ae=Object(S.a)(E.a.mark((function e(){var n,t,r,i,a,c,o,s,u,l,d,b,p,f,j,h,v;return E.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(w&&k&&C){e.next=2;break}return e.abrupt("return");case 2:if(t=xn(0,k,C),r=q[us.CURRENCY_A],i=q[us.CURRENCY_B],r&&i&&T&&I){e.next=6;break}return e.abrupt("return");case 6:return n={},Object(y.a)(n,us.CURRENCY_A,On(r,W?0:fe)[0]),Object(y.a)(n,us.CURRENCY_B,On(i,W?0:fe)[0]),a=n,c=Math.ceil(Date.now()/1e3)+be,T===J.d||I===J.d?(p=I===J.d,o=t.estimateGas.addLiquidityETH,s=t.addLiquidityETH,u=[null!==(d=null===(b=bo(p?T:I,w))||void 0===b?void 0:b.address)&&void 0!==d?d:"",(p?r:i).raw.toString(),a[p?us.CURRENCY_A:us.CURRENCY_B].toString(),a[p?us.CURRENCY_B:us.CURRENCY_A].toString(),C,c],l=bn.a.from((p?i:r).raw.toString())):(o=t.estimateGas.addLiquidity,s=t.addLiquidity,u=[null!==(f=null===(j=bo(T,w))||void 0===j?void 0:j.address)&&void 0!==f?f:"",null!==(h=null===(v=bo(I,w))||void 0===v?void 0:v.address)&&void 0!==h?h:"",r.raw.toString(),i.raw.toString(),a[us.CURRENCY_A].toString(),a[us.CURRENCY_B].toString(),C,c],l=null),le(!0),e.next=12,o.apply(void 0,Object(K.a)(u).concat([l?{value:l}:{}])).then((function(e){return s.apply(void 0,Object(K.a)(u).concat([Object(X.a)(Object(X.a)({},l?{value:l}:{}),{},{gasLimit:mn(e)})])).then((function(e){var n,t,r,i;le(!1),Re(e,{summary:"Add ".concat(null===(n=q[us.CURRENCY_A])||void 0===n?void 0:n.toSignificant(3)," ").concat(null===(t=L[us.CURRENCY_A])||void 0===t?void 0:t.symbol," and ").concat(null===(r=q[us.CURRENCY_B])||void 0===r?void 0:r.toSignificant(3)," ").concat(null===(i=L[us.CURRENCY_B])||void 0===i?void 0:i.symbol)}),me(e.hash)}))})).catch((function(e){le(!1),4001!==(null===e||void 0===e?void 0:e.code)&&console.error(e)}));case 12:case"end":return e.stop()}}),e)})))).apply(this,arguments)}var ze=function(){var e,n,t,i;return W?Object(r.jsx)(Pe,{gap:"20px",children:Object(r.jsx)(ft,{mt:"20px",borderRadius:"20px",children:Object(r.jsxs)(nn,{children:[Object(r.jsx)(s.z,{fontSize:"48px",mr:"8px",children:"".concat(null===(e=L[us.CURRENCY_A])||void 0===e?void 0:e.symbol,"/").concat(null===(n=L[us.CURRENCY_B])||void 0===n?void 0:n.symbol)}),Object(r.jsx)(Bc,{currency0:L[us.CURRENCY_A],currency1:L[us.CURRENCY_B],size:30})]})})}):Object(r.jsxs)(Pe,{gap:"20px",children:[Object(r.jsxs)(nn,{style:{marginTop:"20px"},children:[Object(r.jsx)(s.z,{fontSize:"48px",mr:"8px",children:null===H||void 0===H?void 0:H.toSignificant(6)}),Object(r.jsx)(Bc,{currency0:L[us.CURRENCY_A],currency1:L[us.CURRENCY_B],size:30})]}),Object(r.jsx)(an,{children:Object(r.jsx)(s.z,{fontSize:"24px",children:"".concat(null===(t=L[us.CURRENCY_A])||void 0===t?void 0:t.symbol,"/").concat(null===(i=L[us.CURRENCY_B])||void 0===i?void 0:i.symbol," Pool Tokens")})}),Object(r.jsx)(s.z,{small:!0,textAlign:"left",padding:"8px 0 0 0 ",style:{fontStyle:"italic"},children:"Output is estimated. If the price changes by more than ".concat(fe/100,"% your transaction will revert.")})]})},Me=function(){return Object(r.jsx)(au,{price:V,currencies:L,parsedAmounts:q,noLiquidity:W,onAdd:Ue,poolTokenPercentage:Q})},De="Supplying ".concat(null===(c=q[us.CURRENCY_A])||void 0===c?void 0:c.toSignificant(6)," ").concat(null===(o=L[us.CURRENCY_A])||void 0===o?void 0:o.symbol," and ").concat(null===(u=q[us.CURRENCY_B])||void 0===u?void 0:u.toSignificant(6)," ").concat(null===(l=L[us.CURRENCY_B])||void 0===l?void 0:l.symbol),Le=Object(i.useCallback)((function(e){var n=lo(e);n===O?x.push("/add/".concat(O,"/").concat(m)):x.push("/add/".concat(n,"/").concat(O))}),[O,x,m]),_e=Object(i.useCallback)((function(e){var n=lo(e);m===n?O?x.push("/add/".concat(O,"/").concat(n)):x.push("/add/".concat(n)):x.push("/add/".concat(m||"BNB","/").concat(n))}),[m,x,O]),Ye=Object(i.useCallback)((function(){ce(!1),ve&&ee(""),me("")}),[ee,ve]);return Object(r.jsxs)(r.Fragment,{children:[Object(r.jsx)(rr,{activeIndex:1}),Object(r.jsxs)($s,{children:[Object(r.jsx)(co,{adding:!0}),Object(r.jsxs)(tu,{children:[Object(r.jsx)(Qt,{isOpen:ae,onDismiss:Ye,attemptingTxn:ue,hash:ve,content:function(){return Object(r.jsx)(Vt,{title:W?N(1154,"You are creating a pool"):N(1156,"You will receive"),onDismiss:Ye,topContent:ze,bottomContent:Me})},pendingText:De}),Object(r.jsx)(s.h,{children:Object(r.jsxs)(Pe,{gap:"20px",children:[W&&Object(r.jsx)(Be,{children:Object(r.jsx)(Ls,{children:Object(r.jsxs)(Pe,{gap:"12px",children:[Object(r.jsx)(s.z,{children:N(1158,"You are the first liquidity provider.")}),Object(r.jsx)(s.z,{children:N(1160,"The ratio of tokens you add will set the price of this pool.")}),Object(r.jsx)(s.z,{children:N(1162,"Once you are happy with the rate click supply to review.")})]})})}),Object(r.jsx)($c,{value:Oe[us.CURRENCY_A],onUserInput:ee,onMax:function(){var e,n;ee(null!==(e=null===(n=ye[us.CURRENCY_A])||void 0===n?void 0:n.toExact())&&void 0!==e?e:"")},onCurrencySelect:Le,showMaxButton:!xe[us.CURRENCY_A],currency:L[us.CURRENCY_A],id:"add-liquidity-input-tokena",showCommonBases:!1}),Object(r.jsx)(Be,{children:Object(r.jsx)(s.a,{color:"textSubtle"})}),Object(r.jsx)($c,{value:Oe[us.CURRENCY_B],onUserInput:ne,onCurrencySelect:_e,onMax:function(){var e,n;ne(null!==(e=null===(n=ye[us.CURRENCY_B])||void 0===n?void 0:n.toExact())&&void 0!==e?e:"")},showMaxButton:!xe[us.CURRENCY_B],currency:L[us.CURRENCY_B],id:"add-liquidity-input-tokenb",showCommonBases:!1}),L[us.CURRENCY_A]&&L[us.CURRENCY_B]&&Y!==qo.INVALID&&Object(r.jsxs)("div",{children:[Object(r.jsx)(s.z,{style:{textTransform:"uppercase",fontWeight:600},color:"textSubtle",fontSize:"12px",mb:"2px",children:W?N(1164,"Initial prices and pool share"):N(1166,"Prices and pool share")}),Object(r.jsx)(Ls,{children:Object(r.jsx)(cu,{currencies:L,poolTokenPercentage:Q,noLiquidity:W,price:V})})]}),C?Object(r.jsxs)(Pe,{gap:"md",children:[(ke===ss.NOT_APPROVED||ke===ss.PENDING||Ne===ss.NOT_APPROVED||Ne===ss.PENDING)&&te&&Object(r.jsxs)(en,{children:[ke!==ss.APPROVED&&Object(r.jsx)(s.d,{onClick:Te,disabled:ke===ss.PENDING,style:{width:Ne!==ss.APPROVED?"48%":"100%"},children:ke===ss.PENDING?Object(r.jsxs)(iu,{children:["Approving ",null===(d=L[us.CURRENCY_A])||void 0===d?void 0:d.symbol]}):"Approve ".concat(null===(b=L[us.CURRENCY_A])||void 0===b?void 0:b.symbol)}),Ne!==ss.APPROVED&&Object(r.jsx)(s.d,{onClick:Se,disabled:Ne===ss.PENDING,style:{width:ke!==ss.APPROVED?"48%":"100%"},children:Ne===ss.PENDING?Object(r.jsxs)(iu,{children:["Approving ",null===(p=L[us.CURRENCY_B])||void 0===p?void 0:p.symbol]}):"Approve ".concat(null===(j=L[us.CURRENCY_B])||void 0===j?void 0:j.symbol)})]}),Object(r.jsx)(s.d,{onClick:function(){U?Ue():ce(!0)},disabled:!te||ke!==ss.APPROVED||Ne!==ss.APPROVED,variant:!te&&q[us.CURRENCY_A]&&q[us.CURRENCY_B]?"danger":"primary",width:"100%",children:null!==G&&void 0!==G?G:"Supply"})]}):Object(r.jsx)(Ks,{width:"100%"})]})})]})]}),_&&!W&&Y!==qo.INVALID?Object(r.jsx)(Pe,{style:{minWidth:"20rem",marginTop:"1rem"},children:Object(r.jsx)(Yo,{showUnwrapped:R,pair:_})}):null]})}var su=/^(0x[a-fA-F0-9]{40})-(0x[a-fA-F0-9]{40})$/;function uu(e){var n=e.match.params.currencyIdA.match(su);return(null===n||void 0===n?void 0:n.length)?Object(r.jsx)(h.a,{to:"/add/".concat(n[1],"/").concat(n[2])}):Object(r.jsx)(ou,Object(X.a)({},e))}function lu(e){var n=e.match.params,t=n.currencyIdA,i=n.currencyIdB;return t.toLowerCase()===i.toLowerCase()?Object(r.jsx)(h.a,{to:"/add/".concat(t)}):Object(r.jsx)(ou,Object(X.a)({},e))}var du=/^(0x[a-fA-F0-9]{40})-(0x[a-fA-F0-9]{40})$/;function bu(e){var n=e.match.params.tokens;if(!du.test(n))return Object(r.jsx)(h.a,{to:"/pool"});var t=n.split("-"),i=Object(f.a)(t,2),a=i[0],c=i[1];return Object(r.jsx)(h.a,{to:"/remove/".concat(a,"/").concat(c)})}function pu(){var e=Object(u.a)(["\n align-items: center;\n display: flex;\n flex-direction: column;\n\n ",":first-child {\n padding-left: 0;\n }\n\n ",":last-child {\n padding-right: 0;\n }\n\n "," {\n flex-direction: row;\n }\n"]);return pu=function(){return e},e}function fu(){var e=Object(u.a)(["\n padding: 0 4px;\n"]);return fu=function(){return e},e}var ju=l.default.div(fu()),hu=l.default.div(pu(),ju,ju,(function(e){return e.theme.mediaQueries.sm})),vu=[{label:"0.1%",value:.1},{label:"0.5%",value:.5},{label:"1%",value:1}],mu=function(e){var n=e.translateString,t=Jr(),a=Object(f.a)(t,2),c=a[0],o=a[1],u=Object(i.useState)(c/100),l=Object(f.a)(u,2),d=l[0],b=l[1],p=Object(i.useState)(null),j=Object(f.a)(p,2),h=j[0],v=j[1];return Object(i.useEffect)((function(){try{var e=100*d;!Number.isNaN(e)&&e>0&&e<5e3?(o(e),v(null)):v(n(1144,"Enter a valid slippage percentage"))}catch(t){v(n(1144,"Enter a valid slippage percentage"))}}),[d,v,o,n]),Object(i.useEffect)((function(){c<50?v(n(1146,"Your transaction may fail")):c>500&&v(n(1148,"Your transaction may be frontrun"))}),[c,v,n]),Object(r.jsxs)(s.c,{mb:"16px",children:[Object(r.jsxs)(s.n,{alignItems:"center",mb:"8px",children:[Object(r.jsx)(s.z,{bold:!0,children:n(88,"Slippage tolerance")}),Object(r.jsx)(sa,{text:n(186,"Your transaction will revert if the price changes unfavorably by more than this percentage.")})]}),Object(r.jsxs)(hu,{children:[Object(r.jsx)(s.n,{mb:["8px","8px",0],mr:[0,0,"8px"],children:vu.map((function(e){var n=e.label,t=e.value;return Object(r.jsx)(ju,{children:Object(r.jsx)(s.d,{variant:d===t?"primary":"tertiary",onClick:function(){return b(t)},children:n})},t)}))}),Object(r.jsxs)(s.n,{alignItems:"center",children:[Object(r.jsx)(ju,{children:Object(r.jsx)(s.r,{type:"number",scale:"lg",step:.1,min:.1,placeholder:"5%",value:d,onChange:function(e){var n=e.target.value;b(parseFloat(n))},isWarning:null!==h})}),Object(r.jsx)(ju,{children:Object(r.jsx)(s.z,{fontSize:"18px",children:"%"})})]})]}),h&&Object(r.jsx)(s.z,{mt:"8px",color:"failure",children:h})]})};function Ou(){var e=Object(u.a)(["\n align-items: center;\n display: inline-flex;\n\n & > "," {\n max-width: 100px;\n }\n"]);return Ou=function(){return e},e}var yu=l.default.div(Ou(),s.r),xu=function(e){var n=e.translateString,t=$r(),a=Object(f.a)(t,2),c=a[0],o=a[1],u=Object(i.useState)(c/60),l=Object(f.a)(u,2),d=l[0],b=l[1],p=Object(i.useState)(null),j=Object(f.a)(p,2),h=j[0],v=j[1];return Object(i.useEffect)((function(){try{var e=60*d;!Number.isNaN(e)&&e>0?(o(e),v(null)):v(n(1150,"Enter a valid deadline"))}catch(t){v(n(1150,"Enter a valid deadline"))}}),[d,v,o,n]),Object(r.jsxs)(s.c,{mb:"16px",children:[Object(r.jsxs)(s.n,{alignItems:"center",mb:"8px",children:[Object(r.jsx)(s.z,{bold:!0,children:n(90,"Transaction deadline")}),Object(r.jsx)(sa,{text:n(188,"Your transaction will revert if it is pending for more than this long.")})]}),Object(r.jsxs)(yu,{children:[Object(r.jsx)(s.r,{type:"number",step:"1",min:"1",value:d,onChange:function(e){var n=e.target.value;b(parseInt(n,10))}}),Object(r.jsx)(s.z,{fontSize:"14px",ml:"8px",children:"Minutes"})]}),h&&Object(r.jsx)(s.z,{mt:"8px",color:"failure",children:h})]})},gu=function(e){var n=e.translateString,t=Object(s.G)(),a=t.isSm,c=t.isXs,o=function(){var e=Object(v.c)(),n=Object(v.d)((function(e){return e.user.audioPlay})),t=Object(i.useCallback)((function(){e(n?Wr():Hr())}),[n,e]);return[n,t]}(),u=Object(f.a)(o,2),l=u[0],d=u[1];return Object(r.jsxs)(s.c,{mb:"16px",children:[Object(r.jsx)(s.n,{alignItems:"center",mb:"8px",children:Object(r.jsx)(s.z,{bold:!0,children:n(999,"Audio")})}),Object(r.jsx)(s.c,{children:Object(r.jsx)(s.w,{scale:a||c?"sm":"md",checked:l,onChange:d})})]})},Cu=function(){return null},wu=function(e){var n=e.onDismiss,t=void 0===n?Cu:n,i=e.translateString;return Object(r.jsxs)(s.u,{title:i(1200,"Settings"),onDismiss:t,children:[Object(r.jsx)(mu,{translateString:i}),Object(r.jsx)(xu,{translateString:i}),Object(r.jsx)(gu,{translateString:i})]})},ku=function(){return null},Tu=function(e,n){return n.addedTime-e.addedTime},Iu=function(e){var n=e.onDismiss,t=void 0===n?ku:n,a=e.translateString,c=ge(),o=c.account,u=c.chainId,l=cs(),d=Object(i.useMemo)((function(){return Object.values(l).filter(os).sort(Tu)}),[l]);return Object(r.jsxs)(s.u,{title:a(1202,"Recent transactions"),onDismiss:t,children:[!o&&Object(r.jsxs)(s.n,{justifyContent:"center",flexDirection:"column",alignItems:"center",children:[Object(r.jsx)(s.z,{mb:"8px",bold:!0,children:"Please connect your wallet to view your recent transactions"}),Object(r.jsx)(s.d,{variant:"tertiary",scale:"sm",onClick:t,children:"Close"})]}),o&&u&&0===d.length&&Object(r.jsxs)(s.n,{justifyContent:"center",flexDirection:"column",alignItems:"center",children:[Object(r.jsx)(s.z,{mb:"8px",bold:!0,children:"No recent transactions"}),Object(r.jsx)(s.d,{variant:"tertiary",scale:"sm",onClick:t,children:"Close"})]}),o&&u&&d.map((function(e){var n=e.hash,t=e.summary,i=function(e){var n=e.hash,t=e.receipt;return n?n&&1===(null===t||void 0===t?void 0:t.status)?{icon:Object(r.jsx)(s.i,{color:"success"}),color:"success"}:{icon:Object(r.jsx)(s.m,{color:"failure"}),color:"failure"}:{icon:Object(r.jsx)(rt,{}),color:"text"}}(e),a=i.icon,c=i.color;return Object(r.jsx)(r.Fragment,{children:Object(r.jsxs)(s.n,{alignItems:"center",justifyContent:"space-between",mb:"4px",children:[Object(r.jsx)(s.s,{href:hn(u,n,"transaction"),color:c,children:null!==t&&void 0!==t?t:n}),a]},n)})}))]})};function Eu(){var e=Object(u.a)(["\n flex: 1;\n"]);return Eu=function(){return e},e}function Nu(){var e=Object(u.a)(["\n border-bottom: 1px solid ",";\n padding: 24px;\n"]);return Nu=function(){return e},e}var Su,Ru=l.default.div(Nu(),(function(e){return e.theme.colors.borderColor})),Uu=l.default.div(Eu()),Au=function(e){var n=e.title,t=e.description,i=e.children,a=Zt(),c=Object(s.H)(Object(r.jsx)(wu,{translateString:a})),o=Object(f.a)(c,1)[0],u=Object(s.H)(Object(r.jsx)(Iu,{translateString:a})),l=Object(f.a)(u,1)[0];return Object(r.jsxs)(Ru,{children:[Object(r.jsxs)(s.n,{alignItems:"center",children:[Object(r.jsxs)(Uu,{children:[Object(r.jsx)(s.o,{mb:"8px",children:n}),t&&Object(r.jsx)(s.z,{color:"textSubtle",fontSize:"14px",children:t})]}),Object(r.jsx)(s.q,{variant:"text",onClick:o,title:a(1200,"Settings"),children:Object(r.jsx)(s.B,{width:"24px",color:"currentColor"})}),Object(r.jsx)(s.q,{variant:"text",onClick:l,title:a(1202,"Recent transactions"),children:Object(r.jsx)(s.p,{width:"24px",color:"currentColor"})})]}),i&&Object(r.jsx)(s.z,{mt:"16px",children:i})]})};function zu(){var e=Object(i.useContext)(l.ThemeContext),n=ge().account,t=Zt(),a=function(){var e=ge().chainId,n=fi(),t=Object(i.useMemo)((function(){var n;return e&&null!==(n=le[e])&&void 0!==n?n:[]}),[e]),r=Object(i.useMemo)((function(){return e?Br()(Object.keys(n),(function(t){var r,i=n[t];return(null!==(r=ue[e])&&void 0!==r?r:[]).map((function(e){return e.address===i.address?null:[e,i]})).filter((function(e){return null!==e}))})):[]}),[n,e]),a=Object(v.d)((function(e){return e.user.pairs})),c=Object(i.useMemo)((function(){if(!e||!a)return[];var n=a[e];return n?Object.keys(n).map((function(e){return[Kr(n[e].token0),Kr(n[e].token1)]})):[]}),[a,e]),o=Object(i.useMemo)((function(){return c.concat(r).concat(t)}),[r,t,c]);return Object(i.useMemo)((function(){var e=o.reduce((function(e,n){var t=Object(f.a)(n,2),r=t[0],i=t[1],a=r.sortsBefore(i),c=a?"".concat(r.address,":").concat(i.address):"".concat(i.address,":").concat(r.address);return e[c]||(e[c]=a?[r,i]:[i,r]),e}),{});return Object.keys(e).map((function(n){return e[n]}))}),[o])}(),c=Object(i.useMemo)((function(){return a.map((function(e){return{liquidityToken:ni(e),tokens:e}}))}),[a]),o=yi(null!==n&&void 0!==n?n:void 0,Object(i.useMemo)((function(){return c.map((function(e){return e.liquidityToken}))}),[c])),u=Object(f.a)(o,2),d=u[0],b=u[1],p=Object(i.useMemo)((function(){return c.filter((function(e){var n,t=e.liquidityToken;return null===(n=d[t.address])||void 0===n?void 0:n.greaterThan("0")}))}),[c,d]),h=Wo(p.map((function(e){return e.tokens}))),m=b||(null===h||void 0===h?void 0:h.length)0?Object(r.jsx)(r.Fragment,{children:O.map((function(e){return Object(r.jsx)(Fo,{pair:e},e.liquidityToken.address)}))}):Object(r.jsx)(ft,{padding:"40px",children:Object(r.jsx)(s.z,{color:"textDisabled",textAlign:"center",children:t(104,"No liquidity found.")})}):Object(r.jsx)(ft,{padding:"40px",children:Object(r.jsx)(s.z,{color:"textDisabled",textAlign:"center",children:t(156,"Connect to a wallet to view your liquidity.")})}),Object(r.jsxs)("div",{children:[Object(r.jsxs)(s.z,{fontSize:"14px",style:{padding:".5rem 0 .5rem 0"},children:[t(106,"Don't see a pool you joined?")," ",Object(r.jsx)(Nn,{id:"import-pool-link",to:"/find",children:t(108,"Import it.")})]}),Object(r.jsx)(s.z,{fontSize:"14px",style:{padding:".5rem 0 .5rem 0"},children:t(1172,"Or, if you staked your LP tokens in a farm, unstake them to see them here.")})]})]})})})]})]})}function Bu(){var e,n=ge().account,t=Object(i.useState)(!1),a=Object(f.a)(t,2),c=a[0],o=a[1],u=Object(i.useState)(Su.TOKEN1),l=Object(f.a)(u,2),d=l[0],b=l[1],p=Object(i.useState)(J.d),j=Object(f.a)(p,2),h=j[0],m=j[1],O=Object(i.useState)(null),y=Object(f.a)(O,2),x=y[0],g=y[1],C=Ho(null!==h&&void 0!==h?h:void 0,null!==x&&void 0!==x?x:void 0),w=Object(f.a)(C,2),k=w[0],T=w[1],I=function(){var e=Object(v.c)();return Object(i.useCallback)((function(n){e(qr({serializedPair:ei(n)}))}),[e])}(),E=Zt();Object(i.useEffect)((function(){T&&I(T)}),[T,I]);var N=k===qo.NOT_EXISTS||Boolean(k===qo.EXISTS&&T&&J.e.equal(T.reserve0.raw,J.e.BigInt(0))&&J.e.equal(T.reserve1.raw,J.e.BigInt(0))),S=gi(null!==n&&void 0!==n?n:void 0,null===T||void 0===T?void 0:T.liquidityToken),R=Boolean(S&&J.e.greaterThan(S.raw,J.e.BigInt(0))),U=Object(i.useCallback)((function(e){d===Su.TOKEN0?m(e):g(e)}),[d]),A=Object(i.useCallback)((function(){o(!1)}),[o]),z=Object(r.jsx)(ft,{padding:"45px 10px",children:Object(r.jsx)(s.z,{style:{textAlign:"center"},children:n?E(208,"Select a token to find your liquidity."):E(1174,"Connect to a wallet to find pools")})});return Object(r.jsxs)(r.Fragment,{children:[Object(r.jsx)(rr,{activeIndex:1}),Object(r.jsxs)($s,{children:[Object(r.jsx)(ao,{}),Object(r.jsxs)(s.h,{children:[Object(r.jsxs)(Pe,{gap:"md",children:[Object(r.jsx)(s.d,{onClick:function(){o(!0),b(Su.TOKEN0)},startIcon:h?Object(r.jsx)(ha,{currency:h,style:{marginRight:".5rem"}}):null,endIcon:Object(r.jsx)(s.j,{width:"24px",color:"white"}),width:"100%",children:h?h.symbol:E(82,"Select a Token")}),Object(r.jsx)(Be,{children:Object(r.jsx)(s.a,{color:"textSubtle"})}),Object(r.jsx)(s.d,{onClick:function(){o(!0),b(Su.TOKEN1)},startIcon:x?Object(r.jsx)(ha,{currency:x,style:{marginRight:".5rem"}}):null,endIcon:Object(r.jsx)(s.j,{width:"24px",color:"white"}),width:"100%",children:x?x.symbol:E(82,"Select a Token")}),R&&Object(r.jsx)(Be,{style:{justifyItems:"center",backgroundColor:"",padding:"12px 0px",borderRadius:"12px"},children:Object(r.jsx)(s.z,{style:{textAlign:"center"},children:E(210,"Pool found!")})}),h&&x?k===qo.EXISTS?R&&T?Object(r.jsx)(Yo,{pair:T}):Object(r.jsx)(ft,{padding:"45px 10px",children:Object(r.jsxs)(Pe,{gap:"sm",justify:"center",children:[Object(r.jsx)(s.z,{style:{textAlign:"center"},children:E(212,"You don\u2019t have liquidity in this pool yet.")}),Object(r.jsx)(Nn,{to:"/add/".concat(lo(h),"/").concat(lo(x)),children:Object(r.jsx)(s.z,{style:{textAlign:"center"},children:E(168,"Add Liquidity")})})]})}):N?Object(r.jsx)(ft,{padding:"45px 10px",children:Object(r.jsxs)(Pe,{gap:"sm",justify:"center",children:[Object(r.jsx)(s.z,{style:{textAlign:"center"},children:E(214,"No pool found.")}),Object(r.jsx)(Nn,{to:"/add/".concat(lo(h),"/").concat(lo(x)),children:"Create pool."})]})}):k===qo.INVALID?Object(r.jsx)(ft,{padding:"45px 10px",children:Object(r.jsx)(Pe,{gap:"sm",justify:"center",children:Object(r.jsx)(s.z,{style:{textAlign:"center"},children:E(136,"Invalid pair.")})})}):k===qo.LOADING?Object(r.jsx)(ft,{padding:"45px 10px",children:Object(r.jsx)(Pe,{gap:"sm",justify:"center",children:Object(r.jsxs)(s.z,{style:{textAlign:"center"},children:["Loading",Object(r.jsx)(iu,{})]})})}):null:z]}),Object(r.jsx)(Ec,{isOpen:c,onCurrencySelect:U,onDismiss:A,showCommonBases:!0,selectedCurrency:null!==(e=d===Su.TOKEN0?x:h)&&void 0!==e?e:void 0})]})]})]})}!function(e){e[e.TOKEN0=0]="TOKEN0",e[e.TOKEN1=1]="TOKEN1"}(Su||(Su={}));var Pu=t(3),Mu=t(433),Du=t(434);function Lu(){var e=Object(u.a)(["\n -webkit-appearance: none; /* Hides the slider so that custom slider can be made */\n width: 100%; /* Specific width is required for Firefox. */\n background: transparent; /* Otherwise white in Chrome */\n cursor: pointer;\n\n &:focus {\n outline: none;\n }\n\n &::-moz-focus-outer {\n border: 0;\n }\n\n &::-webkit-slider-thumb {\n -webkit-appearance: none;\n height: ","px;\n width: ","px;\n background-color: #565a69;\n border-radius: 100%;\n border: none;\n transform: translateY(-50%);\n color: ",";\n\n &:hover,\n &:focus {\n box-shadow: 0px 0px 1px rgba(0, 0, 0, 0.1), 0px 4px 8px rgba(0, 0, 0, 0.08), 0px 16px 24px rgba(0, 0, 0, 0.06),\n 0px 24px 32px rgba(0, 0, 0, 0.04);\n }\n }\n\n &::-moz-range-thumb {\n height: ","px;\n width: ","px;\n background-color: #565a69;\n border-radius: 100%;\n border: none;\n color: ",";\n\n &:hover,\n &:focus {\n box-shadow: 0px 0px 1px rgba(0, 0, 0, 0.1), 0px 4px 8px rgba(0, 0, 0, 0.08), 0px 16px 24px rgba(0, 0, 0, 0.06),\n 0px 24px 32px rgba(0, 0, 0, 0.04);\n }\n }\n\n &::-ms-thumb {\n height: ","px;\n width: ","px;\n background-color: #565a69;\n border-radius: 100%;\n color: ",";\n\n &:hover,\n &:focus {\n box-shadow: 0px 0px 1px rgba(0, 0, 0, 0.1), 0px 4px 8px rgba(0, 0, 0, 0.08), 0px 16px 24px rgba(0, 0, 0, 0.06),\n 0px 24px 32px rgba(0, 0, 0, 0.04);\n }\n }\n\n &::-webkit-slider-runnable-track {\n background: linear-gradient(\n 90deg,\n ",",\n ","\n );\n height: 2px;\n }\n\n &::-moz-range-track {\n background: linear-gradient(\n 90deg,\n ",",\n ","\n );\n height: 2px;\n }\n\n &::-ms-track {\n width: 100%;\n border-color: transparent;\n color: transparent;\n\n background: ",";\n height: 2px;\n }\n &::-ms-fill-lower {\n background: ",";\n }\n &::-ms-fill-upper {\n background: ",";\n }\n"]);return Lu=function(){return e},e}var _u,Yu=l.default.input(Lu(),(function(e){return e.size}),(function(e){return e.size}),(function(e){return e.theme.colors.invertedContrast}),(function(e){return e.size}),(function(e){return e.size}),(function(e){return e.theme.colors.invertedContrast}),(function(e){return e.size}),(function(e){return e.size}),(function(e){return e.theme.colors.invertedContrast}),(function(e){return e.theme.colors.primaryDark}),(function(e){return e.theme.colors.tertiary}),(function(e){return e.theme.colors.primaryDark}),(function(e){return e.theme.colors.tertiary}),(function(e){return e.theme.colors.primaryDark}),(function(e){return e.theme.colors.primaryDark}),(function(e){return e.theme.colors.tertiary}));function Fu(e){var n=e.value,t=e.onChange,a=e.min,c=void 0===a?0:a,o=e.step,s=void 0===o?1:o,u=e.max,l=void 0===u?100:u,d=e.size,b=void 0===d?28:d,p=Object(i.useCallback)((function(e){t(parseInt(e.target.value))}),[t]);return Object(r.jsx)(Yu,{size:b,type:"range",value:n,style:{width:"90%",marginLeft:15,marginRight:15,padding:"15px 0"},onChange:p,"aria-labelledby":"input slider",step:s,min:c,max:l})}!function(e){e.LIQUIDITY_PERCENT="LIQUIDITY_PERCENT",e.LIQUIDITY="LIQUIDITY",e.CURRENCY_A="CURRENCY_A",e.CURRENCY_B="CURRENCY_B"}(_u||(_u={}));var qu=Object(Ce.b)("burn/typeInputBurn");function Vu(){return Object(v.d)((function(e){return e.burn}))}function Wu(){var e=Object(u.a)(["\n padding-left: 24px;\n padding-right: 24px;\n"]);return Wu=function(){return e},e}function Hu(){var e=Object(u.a)(["\n border: 1px solid ",";\n border-radius: 16px;\n padding: 24px;\n"]);return Hu=function(){return e},e}var Qu=l.default.div(Hu(),(function(e){return e.theme.colors.borderColor})),Gu=l.default.div(Wu());function Ku(e){var n,t,a,c,o,u,d,b,p,j,h,m,O,x,g=e.history,C=e.match.params,w=C.currencyIdA,k=C.currencyIdB,T=null!==(n=mi(w))&&void 0!==n?n:void 0,I=null!==(t=mi(k))&&void 0!==t?t:void 0,N=ge(),R=N.account,U=N.chainId,A=N.library,z=Zt(),B=Object(i.useMemo)((function(){return[bo(T,U),bo(I,U)]}),[T,I,U]),P=Object(f.a)(B,2),M=P[0],D=P[1],L=Object(i.useContext)(l.ThemeContext),_=Vu(),Y=_.independentField,F=_.typedValue,q=function(e,n){var t,r,i,a,c,o=ge(),s=o.account,u=o.chainId,l=Vu(),d=l.independentField,b=l.typedValue,p=Ho(e,n),j=Object(f.a)(p,2)[1],h=xi(null!==s&&void 0!==s?s:void 0,[null===j||void 0===j?void 0:j.liquidityToken]),v=null===h||void 0===h?void 0:h[null!==(t=null===j||void 0===j||null===(r=j.liquidityToken)||void 0===r?void 0:r.address)&&void 0!==t?t:""],m=[bo(e,u),bo(n,u)],O=m[0],x=m[1],g=(i={},Object(y.a)(i,_u.CURRENCY_A,O),Object(y.a)(i,_u.CURRENCY_B,x),Object(y.a)(i,_u.LIQUIDITY,null===j||void 0===j?void 0:j.liquidityToken),i),C=uo(null===j||void 0===j?void 0:j.liquidityToken),w=j&&C&&v&&O&&J.e.greaterThanOrEqual(C.raw,v.raw)?new J.k(O,j.getLiquidityValue(O,C,v,!1).raw):void 0,k=j&&C&&v&&x&&J.e.greaterThanOrEqual(C.raw,v.raw)?new J.k(x,j.getLiquidityValue(x,C,v,!1).raw):void 0,T=(a={},Object(y.a)(a,_u.CURRENCY_A,w),Object(y.a)(a,_u.CURRENCY_B,k),a),I=new J.g("0","100");if(d===_u.LIQUIDITY_PERCENT)I=new J.g(b,"100");else if(d===_u.LIQUIDITY){if(null===j||void 0===j?void 0:j.liquidityToken){var E=Ts(b,j.liquidityToken);E&&v&&!E.greaterThan(v)&&(I=new J.g(E.raw,v.raw))}}else if(g[d]){var N=Ts(b,g[d]),S=T[d];N&&S&&!N.greaterThan(S)&&(I=new J.g(N.raw,S.raw))}var R,U,A=(c={},Object(y.a)(c,_u.LIQUIDITY_PERCENT,I),Object(y.a)(c,_u.LIQUIDITY,v&&I&&I.greaterThan("0")?new J.k(v.token,I.multiply(v.raw).quotient):void 0),Object(y.a)(c,_u.CURRENCY_A,O&&I&&I.greaterThan("0")&&w?new J.k(O,I.multiply(w.raw).quotient):void 0),Object(y.a)(c,_u.CURRENCY_B,x&&I&&I.greaterThan("0")&&k?new J.k(x,I.multiply(k.raw).quotient):void 0),c);return s||(R="Connect Wallet"),A[_u.LIQUIDITY]&&A[_u.CURRENCY_A]&&A[_u.CURRENCY_B]||(R=null!==(U=R)&&void 0!==U?U:"Enter an amount"),{pair:j,parsedAmounts:A,error:R}}(null!==T&&void 0!==T?T:void 0,null!==I&&void 0!==I?I:void 0),V=q.pair,W=q.parsedAmounts,H=q.error,Q=function(){var e=Object(v.c)();return{onUserInput:Object(i.useCallback)((function(n,t){e(qu({field:n,typedValue:t}))}),[e])}}().onUserInput,G=!H,X=Object(i.useState)(!1),Z=Object(f.a)(X,2),ee=Z[0],ne=Z[1],te=Object(i.useState)(!1),re=Object(f.a)(te,2),ie=re[0],ae=re[1],ce=Object(i.useState)(!1),oe=Object(f.a)(ce,2),se=oe[0],ue=oe[1],le=Object(i.useState)(""),de=Object(f.a)(le,2),be=de[0],pe=de[1],fe=$r(),je=Object(f.a)(fe,1)[0],he=Jr(),ve=Object(f.a)(he,1)[0],me=(p={},Object(y.a)(p,_u.LIQUIDITY_PERCENT,W[_u.LIQUIDITY_PERCENT].equalTo("0")?"0":W[_u.LIQUIDITY_PERCENT].lessThan(new J.g("1","100"))?"<1":W[_u.LIQUIDITY_PERCENT].toFixed(0)),Object(y.a)(p,_u.LIQUIDITY,Y===_u.LIQUIDITY?F:null!==(a=null===(c=W[_u.LIQUIDITY])||void 0===c?void 0:c.toSignificant(6))&&void 0!==a?a:""),Object(y.a)(p,_u.CURRENCY_A,Y===_u.CURRENCY_A?F:null!==(o=null===(u=W[_u.CURRENCY_A])||void 0===u?void 0:u.toSignificant(6))&&void 0!==o?o:""),Object(y.a)(p,_u.CURRENCY_B,Y===_u.CURRENCY_B?F:null!==(d=null===(b=W[_u.CURRENCY_B])||void 0===b?void 0:b.toSignificant(6))&&void 0!==d?d:""),p),Oe=null===(j=W[_u.LIQUIDITY_PERCENT])||void 0===j?void 0:j.equalTo(new J.g("1")),ye=ui(null===V||void 0===V||null===(h=V.liquidityToken)||void 0===h?void 0:h.address,ri.a,x),xe=Object(i.useState)(null),Ce=Object(f.a)(xe,2),we=Ce[0],ke=Ce[1],Te=vs(W[_u.LIQUIDITY],$),Ie=Object(f.a)(Te,2),Ee=Ie[0],Ne=Ie[1];function Se(){return(Se=Object(S.a)(E.a.mark((function e(){var n,t,r,i,a,c,o,s;return E.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(ye&&V&&A){e.next=2;break}throw new Error("missing dependencies");case 2:if(n=W[_u.LIQUIDITY]){e.next=5;break}throw new Error("missing liquidity amount");case 5:return e.next=7,ye.nonces(R);case 7:t=e.sent,r=Math.ceil(Date.now()/1e3)+je,i=[{name:"name",type:"string"},{name:"version",type:"string"},{name:"chainId",type:"uint256"},{name:"verifyingContract",type:"address"}],a={name:"Pancake LPs",version:"1",chainId:U,verifyingContract:V.liquidityToken.address},c=[{name:"owner",type:"address"},{name:"spender",type:"address"},{name:"value",type:"uint256"},{name:"nonce",type:"uint256"},{name:"deadline",type:"uint256"}],o={owner:R,spender:$,value:n.raw.toString(),nonce:t.toHexString(),deadline:r},s=JSON.stringify({types:{EIP712Domain:i,Permit:c},domain:a,primaryType:"Permit",message:o}),A.send("eth_signTypedData_v4",[R,s]).then(Pu.splitSignature).then((function(e){ke({v:e.v,r:e.r,s:e.s,deadline:r})})).catch((function(e){4001!==(null===e||void 0===e?void 0:e.code)&&Ne()}));case 15:case"end":return e.stop()}}),e)})))).apply(this,arguments)}var Re=Object(i.useCallback)((function(e,n){return ke(null),Q(e,n)}),[Q]),Ue=Object(i.useCallback)((function(e){return Re(_u.LIQUIDITY,e)}),[Re]),Ae=Object(i.useCallback)((function(e){return Re(_u.CURRENCY_A,e)}),[Re]),ze=Object(i.useCallback)((function(e){return Re(_u.CURRENCY_B,e)}),[Re]),Me=as();function De(){return Le.apply(this,arguments)}function Le(){return(Le=Object(S.a)(E.a.mark((function e(){var n,t,r,i,a,c,o,s,u,l,d,b,p,f,j;return E.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(U&&A&&R){e.next=2;break}throw new Error("missing dependencies");case 2:if(t=W[_u.CURRENCY_A],r=W[_u.CURRENCY_B],t&&r){e.next=5;break}throw new Error("missing currency amounts");case 5:if(i=xn(0,A,R),n={},Object(y.a)(n,_u.CURRENCY_A,On(t,ve)[0]),Object(y.a)(n,_u.CURRENCY_B,On(r,ve)[0]),a=n,T&&I){e.next=9;break}throw new Error("missing tokens");case 9:if(c=W[_u.LIQUIDITY]){e.next=12;break}throw new Error("missing liquidity amount");case 12:if(o=I===J.d,s=T===J.d||o,u=Math.ceil(Date.now()/1e3)+je,M&&D){e.next=17;break}throw new Error("could not wrap");case 17:if(Ee!==ss.APPROVED){e.next=21;break}s?(l=["removeLiquidityETH","removeLiquidityETHSupportingFeeOnTransferTokens"],d=[o?M.address:D.address,c.raw.toString(),a[o?_u.CURRENCY_A:_u.CURRENCY_B].toString(),a[o?_u.CURRENCY_B:_u.CURRENCY_A].toString(),R,u]):(l=["removeLiquidity"],d=[M.address,D.address,c.raw.toString(),a[_u.CURRENCY_A].toString(),a[_u.CURRENCY_B].toString(),R,u]),e.next=26;break;case 21:if(null===we){e.next=25;break}s?(l=["removeLiquidityETHWithPermit","removeLiquidityETHWithPermitSupportingFeeOnTransferTokens"],d=[o?M.address:D.address,c.raw.toString(),a[o?_u.CURRENCY_A:_u.CURRENCY_B].toString(),a[o?_u.CURRENCY_B:_u.CURRENCY_A].toString(),R,we.deadline,!1,we.v,we.r,we.s]):(l=["removeLiquidityWithPermit"],d=[M.address,D.address,c.raw.toString(),a[_u.CURRENCY_A].toString(),a[_u.CURRENCY_B].toString(),R,we.deadline,!1,we.v,we.r,we.s]),e.next=26;break;case 25:throw new Error("Attempting to confirm without approval or a signature. Please contact support.");case 26:return e.next=28,Promise.all(l.map((function(e,n){var t;return(t=i.estimateGas)[e].apply(t,Object(K.a)(d)).then(mn).catch((function(t){console.error("estimateGas failed",n,e,d,t)}))})));case 28:if(b=e.sent,-1!==(p=b.findIndex((function(e){return bn.a.isBigNumber(e)})))){e.next=34;break}console.error("This transaction would fail. Please contact support."),e.next=39;break;case 34:return f=l[p],j=b[p],ue(!0),e.next=39,i[f].apply(i,Object(K.a)(d).concat([{gasLimit:j}])).then((function(e){var n,t;ue(!1),Me(e,{summary:"Remove ".concat(null===(n=W[_u.CURRENCY_A])||void 0===n?void 0:n.toSignificant(3)," ").concat(null===T||void 0===T?void 0:T.symbol," and ").concat(null===(t=W[_u.CURRENCY_B])||void 0===t?void 0:t.toSignificant(3)," ").concat(null===I||void 0===I?void 0:I.symbol)}),pe(e.hash)})).catch((function(e){ue(!1),console.error(e)}));case 39:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function _e(){var e,n;return Object(r.jsxs)(Pe,{gap:"md",style:{marginTop:"20px"},children:[Object(r.jsxs)(en,{align:"flex-end",children:[Object(r.jsx)(s.z,{fontSize:"24px",children:null===(e=W[_u.CURRENCY_A])||void 0===e?void 0:e.toSignificant(6)}),Object(r.jsxs)(rn,{gap:"4px",children:[Object(r.jsx)(ha,{currency:T,size:"24px"}),Object(r.jsx)(s.z,{fontSize:"24px",style:{marginLeft:"10px"},children:null===T||void 0===T?void 0:T.symbol})]})]}),Object(r.jsx)(rn,{children:Object(r.jsx)(Mu.a,{size:"16",color:L.colors.textSubtle})}),Object(r.jsxs)(en,{align:"flex-end",children:[Object(r.jsx)(s.z,{fontSize:"24px",children:null===(n=W[_u.CURRENCY_B])||void 0===n?void 0:n.toSignificant(6)}),Object(r.jsxs)(rn,{gap:"4px",children:[Object(r.jsx)(ha,{currency:I,size:"24px"}),Object(r.jsx)(s.z,{fontSize:"24px",style:{marginLeft:"10px"},children:null===I||void 0===I?void 0:I.symbol})]})]}),Object(r.jsx)(s.z,{small:!0,color:"textSubtle",textAlign:"left",padding:"12px 0 0 0",style:{fontStyle:"italic"},children:"Output is estimated. If the price changes by more than ".concat(ve/100,"% your transaction will revert.")})]})}function Ye(){var e;return Object(r.jsxs)(r.Fragment,{children:[Object(r.jsxs)(en,{children:[Object(r.jsxs)(s.z,{color:"textSubtle",children:["LP ".concat(null===T||void 0===T?void 0:T.symbol,"/").concat(null===I||void 0===I?void 0:I.symbol)," Burned"]}),Object(r.jsxs)(rn,{children:[Object(r.jsx)(Bc,{currency0:T,currency1:I,margin:!0}),Object(r.jsx)(s.z,{children:null===(e=W[_u.LIQUIDITY])||void 0===e?void 0:e.toSignificant(6)})]})]}),V&&Object(r.jsxs)(r.Fragment,{children:[Object(r.jsxs)(en,{children:[Object(r.jsx)(s.z,{color:"textSubtle",children:z(1182,"Price")}),Object(r.jsxs)(s.z,{children:["1 ",null===T||void 0===T?void 0:T.symbol," = ",M?V.priceOf(M).toSignificant(6):"-"," ",null===I||void 0===I?void 0:I.symbol]})]}),Object(r.jsxs)(en,{children:[Object(r.jsx)("div",{}),Object(r.jsxs)(s.z,{children:["1 ",null===I||void 0===I?void 0:I.symbol," = ",D?V.priceOf(D).toSignificant(6):"-"," ",null===T||void 0===T?void 0:T.symbol]})]})]}),Object(r.jsx)(s.d,{disabled:!(Ee===ss.APPROVED||null!==we),onClick:De,children:z(1136,"Confirm")})]})}var Fe="Removing ".concat(null===(m=W[_u.CURRENCY_A])||void 0===m?void 0:m.toSignificant(6)," ").concat(null===T||void 0===T?void 0:T.symbol," and ").concat(null===(O=W[_u.CURRENCY_B])||void 0===O?void 0:O.toSignificant(6)," ").concat(null===I||void 0===I?void 0:I.symbol),qe=Object(i.useCallback)((function(e){Re(_u.LIQUIDITY_PERCENT,e.toString())}),[Re]),Ve=T===J.d||I===J.d,We=Boolean(U&&(T&&Object(J.o)(J.n[U],T)||I&&Object(J.o)(J.n[U],I))),He=Object(i.useCallback)((function(e){k&&lo(e)===k?g.push("/remove/".concat(lo(e),"/").concat(w)):g.push("/remove/".concat(lo(e),"/").concat(k))}),[w,k,g]),Qe=Object(i.useCallback)((function(e){w&&lo(e)===w?g.push("/remove/".concat(k,"/").concat(lo(e))):g.push("/remove/".concat(w,"/").concat(lo(e)))}),[w,k,g]),Ge=Object(i.useCallback)((function(){ne(!1),ke(null),be&&Re(_u.LIQUIDITY_PERCENT,"0"),pe("")}),[Re,be]),Ke=function(e,n){var t=arguments.length>2&&void 0!==arguments[2]?arguments[2]:100,r=Object(i.useState)((function(){return e})),a=Object(f.a)(r,2),c=a[0],o=a[1],s=Object(i.useRef)(),u=Object(i.useCallback)((function(e){o(e),s.current&&clearTimeout(s.current),s.current=setTimeout((function(){n(e),s.current=void 0}),t)}),[t,n]);return Object(i.useEffect)((function(){s.current&&(clearTimeout(s.current),s.current=void 0),o(e)}),[e]),[c,u]}(Number.parseInt(W[_u.LIQUIDITY_PERCENT].toFixed(0)),qe),Xe=Object(f.a)(Ke,2),Je=Xe[0],$e=Xe[1];return Object(r.jsxs)(r.Fragment,{children:[Object(r.jsxs)($s,{children:[Object(r.jsx)(co,{adding:!1}),Object(r.jsxs)(tu,{children:[Object(r.jsx)(Qt,{isOpen:ee,onDismiss:Ge,attemptingTxn:se,hash:be||"",content:function(){return Object(r.jsx)(Vt,{title:z(1156,"You will receive"),onDismiss:Ge,topContent:_e,bottomContent:Ye})},pendingText:Fe}),Object(r.jsxs)(Pe,{gap:"md",children:[Object(r.jsx)(Gu,{children:Object(r.jsx)(Qu,{children:Object(r.jsxs)(Pe,{children:[Object(r.jsxs)(en,{children:[Object(r.jsx)(s.z,{children:"Amount"}),Object(r.jsx)(ru,{onClick:function(){ae(!ie)},children:ie?z(1184,"Simple"):z(1186,"Detailed")})]}),Object(r.jsx)(s.n,{justifyContent:"start",children:Object(r.jsxs)(s.z,{fontSize:"64px",children:[me[_u.LIQUIDITY_PERCENT],"%"]})}),!ie&&Object(r.jsxs)(r.Fragment,{children:[Object(r.jsx)(s.n,{mb:"8px",children:Object(r.jsx)(Fu,{value:Je,onChange:$e})}),Object(r.jsxs)(s.n,{justifyContent:"space-around",children:[Object(r.jsx)(s.d,{variant:"tertiary",scale:"sm",onClick:function(){return Re(_u.LIQUIDITY_PERCENT,"25")},children:"25%"}),Object(r.jsx)(s.d,{variant:"tertiary",scale:"sm",onClick:function(){return Re(_u.LIQUIDITY_PERCENT,"50")},children:"50%"}),Object(r.jsx)(s.d,{variant:"tertiary",scale:"sm",onClick:function(){return Re(_u.LIQUIDITY_PERCENT,"75")},children:"75%"}),Object(r.jsx)(s.d,{variant:"tertiary",scale:"sm",onClick:function(){return Re(_u.LIQUIDITY_PERCENT,"100")},children:z(166,"Max")})]})]})]})})}),!ie&&Object(r.jsxs)(r.Fragment,{children:[Object(r.jsx)(Be,{children:Object(r.jsx)(Du.a,{size:"16",color:L.colors.textSubtle})}),Object(r.jsx)(Gu,{children:Object(r.jsx)(Qu,{children:Object(r.jsxs)(Pe,{gap:"10px",children:[Object(r.jsxs)(en,{children:[Object(r.jsx)(s.z,{fontSize:"24px",children:me[_u.CURRENCY_A]||"-"}),Object(r.jsxs)(rn,{children:[Object(r.jsx)(ha,{currency:T,style:{marginRight:"12px"}}),Object(r.jsx)(s.z,{fontSize:"24px",id:"remove-liquidity-tokena-symbol",children:null===T||void 0===T?void 0:T.symbol})]})]}),Object(r.jsxs)(en,{children:[Object(r.jsx)(s.z,{fontSize:"24px",children:me[_u.CURRENCY_B]||"-"}),Object(r.jsxs)(rn,{children:[Object(r.jsx)(ha,{currency:I,style:{marginRight:"12px"}}),Object(r.jsx)(s.z,{fontSize:"24px",id:"remove-liquidity-tokenb-symbol",children:null===I||void 0===I?void 0:I.symbol})]})]}),U&&(We||Ve)?Object(r.jsx)(en,{style:{justifyContent:"flex-end"},children:Ve?Object(r.jsx)(Nn,{to:"/remove/".concat(T===J.d?J.n[U].address:w,"/").concat(I===J.d?J.n[U].address:k),children:z(1188,"Receive WBNB")}):We?Object(r.jsx)(Nn,{to:"/remove/".concat(T&&Object(J.o)(T,J.n[U])?"BNB":w,"/").concat(I&&Object(J.o)(I,J.n[U])?"BNB":k),children:z(1190,"Receive BNB")}):null}):null]})})})]}),Object(r.jsxs)(Gu,{style:{paddingBottom:"24px"},children:[ie&&Object(r.jsxs)(r.Fragment,{children:[Object(r.jsx)($c,{value:me[_u.LIQUIDITY],onUserInput:Ue,onMax:function(){Re(_u.LIQUIDITY_PERCENT,"100")},showMaxButton:!Oe,disableCurrencySelect:!0,currency:null===V||void 0===V?void 0:V.liquidityToken,pair:V,id:"liquidity-amount"}),Object(r.jsx)(Be,{children:Object(r.jsx)(Du.a,{size:"16",color:L.colors.textSubtle})}),Object(r.jsx)($c,{hideBalance:!0,value:me[_u.CURRENCY_A],onUserInput:Ae,onMax:function(){return Re(_u.LIQUIDITY_PERCENT,"100")},showMaxButton:!Oe,currency:T,label:"Output",onCurrencySelect:He,id:"remove-liquidity-tokena"}),Object(r.jsx)(Be,{children:Object(r.jsx)(Mu.a,{size:"16",color:L.colors.textSubtle})}),Object(r.jsx)($c,{hideBalance:!0,value:me[_u.CURRENCY_B],onUserInput:ze,onMax:function(){return Re(_u.LIQUIDITY_PERCENT,"100")},showMaxButton:!Oe,currency:I,label:"Output",onCurrencySelect:Qe,id:"remove-liquidity-tokenb"})]}),V&&Object(r.jsxs)("div",{style:{padding:"24px"},children:[Object(r.jsxs)(s.n,{justifyContent:"space-between",mb:"8px",children:["Price:",Object(r.jsxs)("div",{children:["1 ",null===T||void 0===T?void 0:T.symbol," = ",M?V.priceOf(M).toSignificant(6):"-"," ",null===I||void 0===I?void 0:I.symbol]})]}),Object(r.jsxs)(s.n,{justifyContent:"space-between",children:[Object(r.jsx)("div",{}),Object(r.jsxs)("div",{children:["1 ",null===I||void 0===I?void 0:I.symbol," = ",D?V.priceOf(D).toSignificant(6):"-"," ",null===T||void 0===T?void 0:T.symbol]})]})]}),Object(r.jsx)("div",{style:{position:"relative"},children:R?Object(r.jsxs)(en,{children:[Object(r.jsx)(s.d,{onClick:function(){return Se.apply(this,arguments)},variant:Ee===ss.APPROVED||null!==we?"success":"primary",disabled:Ee!==ss.NOT_APPROVED||null!==we,mr:"8px",children:Ee===ss.PENDING?Object(r.jsx)(Uo,{children:"Approving"}):Ee===ss.APPROVED||null!==we?"Approved":"Approve"}),Object(r.jsx)(s.d,{onClick:function(){ne(!0)},disabled:!G||null===we&&Ee!==ss.APPROVED,variant:!G&&W[_u.CURRENCY_A]&&W[_u.CURRENCY_B]?"danger":"primary",children:H||"Remove"})]}):Object(r.jsx)(Ks,{width:"100%"})})]})]})]})]}),V?Object(r.jsx)(Pe,{style:{minWidth:"20rem",marginTop:"1rem"},children:Object(r.jsx)(Yo,{showUnwrapped:We,pair:V})}):null]})}function Xu(){var e=Object(u.a)(["\n font-size: 1.25rem;\n outline: none;\n border: none;\n flex: 1 1 auto;\n width: 0;\n background-color: ",";\n transition: color 300ms ",";\n color: ",";\n overflow: hidden;\n text-overflow: ellipsis;\n font-weight: 500;\n width: 100%;\n ::placeholder {\n color: ",";\n }\n padding: 0px;\n -webkit-appearance: textfield;\n\n ::-webkit-search-decoration {\n -webkit-appearance: none;\n }\n\n ::-webkit-outer-spin-button,\n ::-webkit-inner-spin-button {\n -webkit-appearance: none;\n }\n\n ::placeholder {\n color: ",";\n }\n"]);return Xu=function(){return e},e}function Ju(){var e=Object(u.a)(["\n flex: 1;\n padding: 1rem;\n"]);return Ju=function(){return e},e}function $u(){var e=Object(u.a)(["\n display: flex;\n justify-content: center;\n align-items: center;\n border-radius: 1.25rem;\n border: 1px solid ",";\n transition: border-color 300ms ",",\n color 500ms ",";\n background-color: ",";\n"]);return $u=function(){return e},e}function Zu(){var e=Object(u.a)(["\n display: flex;\n flex-flow: column nowrap;\n position: relative;\n border-radius: 1.25rem;\n background-color: ",";\n z-index: 1;\n width: 100%;\n"]);return Zu=function(){return e},e}var el=l.default.div(Zu(),(function(e){return e.theme.colors.invertedContrast})),nl=l.default.div($u(),(function(e){var n=e.error,t=e.theme;return n?t.colors.failure:t.colors.invertedContrast}),(function(e){return e.error?"step-end":"step-start"}),(function(e){return e.error?"step-end":"step-start"}),(function(e){return e.theme.colors.invertedContrast})),tl=l.default.div(Ju()),rl=l.default.input(Xu(),(function(e){return e.theme.colors.invertedContrast}),(function(e){return e.error?"step-end":"step-start"}),(function(e){var n=e.error,t=e.theme;return n?t.colors.failure:t.colors.primary}),(function(e){return e.theme.colors.textDisabled}),(function(e){return e.theme.colors.textDisabled}));function il(e){var n=e.id,t=e.value,a=e.onChange,c=ge().chainId,o=Zt(),u=gs(t),l=u.address,d=u.loading,b=u.name,p=Object(i.useCallback)((function(e){var n=e.target.value.replace(/\s+/g,"");a(n)}),[a]),f=Boolean(t.length>0&&!d&&!l);return Object(r.jsx)(el,{id:n,children:Object(r.jsx)(nl,{error:f,children:Object(r.jsx)(tl,{children:Object(r.jsxs)(Pe,{gap:"md",children:[Object(r.jsxs)(en,{children:[Object(r.jsx)(s.z,{color:"textSubtle",fontWeight:500,fontSize:"14px",children:o(1138,"Recipient")}),l&&c&&Object(r.jsx)(Rn,{href:hn(c,null!==b&&void 0!==b?b:l,"address"),style:{fontSize:"14px"},children:o(116,"(View on BscScan)")})]}),Object(r.jsx)(rl,{className:"recipient-address-input",type:"text",autoComplete:"off",autoCorrect:"off",autoCapitalize:"off",spellCheck:"false",placeholder:o(1140,"Wallet Address or ENS name"),error:f,pattern:"^(0x[a-fA-F0-9]{40})$",onChange:p,value:t})]})})})})}var al=t(435);function cl(e){var n=e.priceImpact;return Object(r.jsx)(So,{fontSize:"14px",severity:js(n),children:n?n.lessThan(fe)?"<0.01%":"".concat(n.toFixed(2),"%"):"-"})}function ol(e){var n,t,a,c,o=e.trade,u=e.onConfirm,l=e.allowedSlippage,d=e.swapErrorMessage,b=e.disabledConfirm,p=Object(i.useState)(!1),j=Object(f.a)(p,2),h=j[0],v=j[1],m=Object(i.useMemo)((function(){return fs(o,l)}),[l,o]),O=Object(i.useMemo)((function(){return ps(o)}),[o]),y=O.priceImpactWithoutFee,x=O.realizedLPFee,g=js(y),C=Zt();return Object(r.jsxs)(r.Fragment,{children:[Object(r.jsxs)(Pe,{gap:"0px",children:[Object(r.jsxs)(en,{align:"center",children:[Object(r.jsx)(s.z,{fontSize:"14px",children:"Price"}),Object(r.jsxs)(s.z,{fontSize:"14px",style:{justifyContent:"center",alignItems:"center",display:"flex",textAlign:"right",paddingLeft:"8px",fontWeight:500},children:[hs(o,h),Object(r.jsx)(Ro,{onClick:function(){return v(!h)},children:Object(r.jsx)(al.a,{size:14})})]})]}),Object(r.jsxs)(en,{children:[Object(r.jsxs)(rn,{children:[Object(r.jsx)(s.z,{fontSize:"14px",children:o.tradeType===J.m.EXACT_INPUT?C(1210,"Minimum received"):C(220,"Maximum sold")}),Object(r.jsx)(sa,{text:C(202,"Your transaction will revert if there is a large, unfavorable price movement before it is confirmed.")})]}),Object(r.jsxs)(rn,{children:[Object(r.jsx)(s.z,{fontSize:"14px",children:o.tradeType===J.m.EXACT_INPUT?null!==(n=null===(t=m[Ko.OUTPUT])||void 0===t?void 0:t.toSignificant(4))&&void 0!==n?n:"-":null!==(a=null===(c=m[Ko.INPUT])||void 0===c?void 0:c.toSignificant(4))&&void 0!==a?a:"-"}),Object(r.jsx)(s.z,{fontSize:"14px",marginLeft:"4px",children:o.tradeType===J.m.EXACT_INPUT?o.outputAmount.currency.symbol:o.inputAmount.currency.symbol})]})]}),Object(r.jsxs)(en,{children:[Object(r.jsxs)(rn,{children:[Object(r.jsx)(s.z,{fontSize:"14px",children:C(226,"Price Impact")}),Object(r.jsx)(sa,{text:C(224,"The difference between the market price and your price due to trade size.")})]}),Object(r.jsx)(cl,{priceImpact:y})]}),Object(r.jsxs)(en,{children:[Object(r.jsxs)(rn,{children:[Object(r.jsx)(s.z,{fontSize:"14px",children:C(228,"Liquidity Provider Fee")}),Object(r.jsx)(sa,{text:C(999,"For each trade a 0.2% fee is paid. 0.17% goes to liquidity providers and 0.03% goes to the PancakeSwap treasury.")})]}),Object(r.jsx)(s.z,{fontSize:"14px",children:x?"".concat(null===x||void 0===x?void 0:x.toSignificant(6)," ").concat(o.inputAmount.currency.symbol):"-"})]})]}),Object(r.jsxs)(tn,{children:[Object(r.jsx)(s.d,{onClick:u,disabled:b,variant:g>2?"danger":"primary",mt:"10px",id:"confirm-swap-or-send",width:"100%",children:g>2?"Swap Anyway":"Confirm Swap"}),d?Object(r.jsx)(Bo,{error:d}):null]})]})}function sl(){var e=Object(u.a)(["\n font-style: italic;\n line-height: 1.3;\n\n span {\n color: ",";\n font-weight: 600;\n }\n"]);return sl=function(){return e},e}var ul=Object(l.default)(s.z)(sl(),(function(e){return e.theme.colors.primary}));function ll(e){var n,t,a=e.trade,c=e.allowedSlippage,o=e.recipient,u=e.showAcceptChanges,d=e.onAcceptChanges,b=Object(i.useMemo)((function(){return fs(a,c)}),[a,c]),p=js(Object(i.useMemo)((function(){return ps(a)}),[a]).priceImpactWithoutFee),f=Object(i.useContext)(l.ThemeContext);return Object(r.jsxs)(Pe,{gap:"md",style:{marginTop:"20px"},children:[Object(r.jsxs)(en,{align:"flex-end",children:[Object(r.jsxs)(rn,{gap:"0px",children:[Object(r.jsx)(ha,{currency:a.inputAmount.currency,size:"24px",style:{marginRight:"12px"}}),Object(r.jsx)(s.z,{fontSize:"24px",color:u&&a.tradeType===J.m.EXACT_OUTPUT?f.colors.primary:"text",children:a.inputAmount.toSignificant(6)})]}),Object(r.jsx)(rn,{gap:"0px",children:Object(r.jsx)(s.z,{fontSize:"24px",style:{marginLeft:"10px",fontWeight:500},children:a.inputAmount.currency.symbol})})]}),Object(r.jsx)(rn,{children:Object(r.jsx)(Du.a,{size:"16",color:f.colors.textSubtle,style:{marginLeft:"4px",minWidth:"16px"}})}),Object(r.jsxs)(en,{align:"flex-end",children:[Object(r.jsxs)(rn,{gap:"0px",children:[Object(r.jsx)(ha,{currency:a.outputAmount.currency,size:"24px",style:{marginRight:"12px"}}),Object(r.jsx)(s.z,{fontSize:"24px",style:{marginLeft:"10px",fontWeight:500},color:p>2?f.colors.failure:u&&a.tradeType===J.m.EXACT_INPUT?f.colors.primary:"text",children:a.outputAmount.toSignificant(6)})]}),Object(r.jsx)(rn,{gap:"0px",children:Object(r.jsx)(s.z,{fontSize:"24px",style:{marginLeft:"10px",fontWeight:500},children:a.outputAmount.currency.symbol})})]}),u?Object(r.jsx)(Po,{justify:"flex-start",gap:"0px",children:Object(r.jsxs)(en,{children:[Object(r.jsxs)(rn,{children:[Object(r.jsx)(Wt.a,{size:20,style:{marginRight:"8px",minWidth:24}}),Object(r.jsx)(s.z,{color:"primary",children:" Price Updated"})]}),Object(r.jsx)(s.d,{onClick:d,children:"Accept"})]})}):null,Object(r.jsx)(Pe,{justify:"flex-start",gap:"sm",style:{padding:"16px 0 0"},children:a.tradeType===J.m.EXACT_INPUT?Object(r.jsxs)(ul,{children:["Output is estimated. You will receive at least ",Object(r.jsxs)("span",{children:[null===(n=b[Ko.OUTPUT])||void 0===n?void 0:n.toSignificant(6)," ",a.outputAmount.currency.symbol]})," or the transaction will revert."]}):Object(r.jsxs)(ul,{children:["Input is estimated. You will sell at most ",Object(r.jsxs)("span",{children:[null===(t=b[Ko.INPUT])||void 0===t?void 0:t.toSignificant(6)," ",a.inputAmount.currency.symbol]})," or the transaction will revert."]})}),null!==o?Object(r.jsx)(Pe,{justify:"flex-start",gap:"sm",style:{padding:"16px 0 0"},children:Object(r.jsxs)(s.z,{children:["Output will be sent to"," ",Object(r.jsx)("b",{title:o,children:fn(o)?vn(o):o})]})}):null]})}function dl(e){var n,t,a,c,o,s,u=e.trade,l=e.originalTrade,d=e.onAcceptChanges,b=e.allowedSlippage,p=e.onConfirm,f=e.onDismiss,j=e.recipient,h=e.swapErrorMessage,v=e.isOpen,m=e.attemptingTxn,O=e.txHash,y=Object(i.useMemo)((function(){return Boolean(u&&l&&(n=l,(e=u).tradeType!==n.tradeType||!Object(J.o)(e.inputAmount.currency,n.inputAmount.currency)||!e.inputAmount.equalTo(n.inputAmount)||!Object(J.o)(e.outputAmount.currency,n.outputAmount.currency)||!e.outputAmount.equalTo(n.outputAmount)));var e,n}),[l,u]),x=Object(i.useCallback)((function(){return u?Object(r.jsx)(ll,{trade:u,allowedSlippage:b,recipient:j,showAcceptChanges:y,onAcceptChanges:d}):null}),[b,d,j,y,u]),g=Object(i.useCallback)((function(){return u?Object(r.jsx)(ol,{onConfirm:p,trade:u,disabledConfirm:y,swapErrorMessage:h,allowedSlippage:b}):null}),[b,p,y,h,u]),C="Swapping ".concat(null===u||void 0===u||null===(n=u.inputAmount)||void 0===n?void 0:n.toSignificant(6)," ").concat(null===u||void 0===u||null===(t=u.inputAmount)||void 0===t||null===(a=t.currency)||void 0===a?void 0:a.symbol," for ").concat(null===u||void 0===u||null===(c=u.outputAmount)||void 0===c?void 0:c.toSignificant(6)," ").concat(null===u||void 0===u||null===(o=u.outputAmount)||void 0===o||null===(s=o.currency)||void 0===s?void 0:s.symbol),w=Object(i.useCallback)((function(){return h?Object(r.jsx)(Ht,{onDismiss:f,message:h}):Object(r.jsx)(Vt,{title:"Confirm Swap",onDismiss:f,topContent:x,bottomContent:g})}),[f,g,x,h]);return Object(r.jsx)(Qt,{isOpen:v,onDismiss:f,attemptingTxn:m,hash:O,content:w,pendingText:C})}var bl=t(436),pl=Object(i.memo)((function(e){var n=e.trade,t=Object(i.useContext)(l.ThemeContext);return Object(r.jsx)(s.n,{px:"1rem",py:"0.5rem",my:"0.5rem",style:{border:"1px solid ".concat(t.colors.tertiary),borderRadius:"1rem"},flexWrap:"wrap",justifyContent:"space-evenly",alignItems:"center",children:n.route.path.map((function(e,n,t){var a=n===t.length-1;return Object(r.jsxs)(i.Fragment,{children:[Object(r.jsxs)(s.n,{my:"0.5rem",alignItems:"center",style:{flexShrink:0},children:[Object(r.jsx)(ha,{currency:e,size:"1.5rem"}),Object(r.jsx)(s.z,{fontSize:"14px",color:"text",ml:"0.5rem",children:e.symbol})]}),a?null:Object(r.jsx)(bl.a,{color:"textSubtle"})]},n)}))})}));function fl(e){var n,t,i,a,c=e.trade,o=e.allowedSlippage,u=ps(c),l=u.priceImpactWithoutFee,d=u.realizedLPFee,b=c.tradeType===J.m.EXACT_INPUT,p=fs(c,o),f=Zt();return Object(r.jsx)(s.g,{children:Object(r.jsxs)(s.h,{children:[Object(r.jsxs)(en,{children:[Object(r.jsxs)(rn,{children:[Object(r.jsx)(s.z,{fontSize:"14px",children:b?f(1210,"Minimum received"):f(220,"Maximum sold")}),Object(r.jsx)(sa,{text:f(202,"Your transaction will revert if there is a large, unfavorable price movement before it is confirmed.")})]}),Object(r.jsx)(rn,{children:Object(r.jsx)(s.z,{fontSize:"14px",children:b?null!==(n="".concat(null===(t=p[Ko.OUTPUT])||void 0===t?void 0:t.toSignificant(4)," ").concat(c.outputAmount.currency.symbol))&&void 0!==n?n:"-":null!==(i="".concat(null===(a=p[Ko.INPUT])||void 0===a?void 0:a.toSignificant(4)," ").concat(c.inputAmount.currency.symbol))&&void 0!==i?i:"-"})})]}),Object(r.jsxs)(en,{children:[Object(r.jsxs)(rn,{children:[Object(r.jsx)(s.z,{fontSize:"14px",children:f(226,"Price Impact")}),Object(r.jsx)(sa,{text:f(224,"The difference between the market price and estimated price due to trade size.")})]}),Object(r.jsx)(cl,{priceImpact:l})]}),Object(r.jsxs)(en,{children:[Object(r.jsxs)(rn,{children:[Object(r.jsx)(s.z,{fontSize:"14px",children:f(228,"Liquidity Provider Fee")}),Object(r.jsx)(sa,{text:f(230,"For each trade a 0.2% fee is paid. 0.17% goes to liquidity providers and 0.03% goes to the PancakeSwap treasury.")})]}),Object(r.jsx)(s.z,{fontSize:"14px",children:d?"".concat(d.toSignificant(4)," ").concat(c.inputAmount.currency.symbol):"-"})]})]})})}function jl(e){var n=e.trade,t=Jr(),i=Object(f.a)(t,1)[0],a=Zt(),c=Boolean(n&&n.route.path.length>2);return Object(r.jsx)(Pe,{gap:"md",children:n&&Object(r.jsxs)(r.Fragment,{children:[Object(r.jsx)(fl,{trade:n,allowedSlippage:i}),c&&Object(r.jsxs)(r.Fragment,{children:[Object(r.jsx)(Eo,{}),Object(r.jsxs)(Pe,{style:{padding:"0 24px"},children:[Object(r.jsxs)(rn,{children:[Object(r.jsx)(s.z,{fontSize:"14px",children:"Route"}),Object(r.jsx)(sa,{text:a(999,"Routing through these tokens resulted in the best price for your trade.")})]}),Object(r.jsx)(pl,{trade:n})]})]})]})})}function hl(){var e=Object(u.a)(["\n padding-top: calc(16px + 2rem);\n padding-bottom: 20px;\n margin-top: -2rem;\n width: 100%;\n max-width: 400px;\n border-bottom-left-radius: 20px;\n border-bottom-right-radius: 20px;\n color: ",";\n z-index: 1;\n\n transform: ",";\n transition: transform 300ms ease-in-out;\n"]);return hl=function(){return e},e}var vl=l.default.div(hl(),(function(e){return e.theme.colors.textSubtle}),(function(e){return e.show?"translateY(0%)":"translateY(-100%)"}));function ml(e){var n,t=e.trade,i=Object(gn.a)(e,["trade"]),a=ki(t,Ti);return Object(r.jsx)(vl,{show:Boolean(t),children:Object(r.jsx)(jl,Object(X.a)(Object(X.a)({},i),{},{trade:null!==(n=null!==t&&void 0!==t?t:a)&&void 0!==n?n:void 0}))})}function Ol(e){var n,t,i,a,c,o=e.price,u=e.showInverted,l=e.setShowInverted,d=u?null===o||void 0===o?void 0:o.toSignificant(6):null===o||void 0===o||null===(n=o.invert())||void 0===n?void 0:n.toSignificant(6),b=Boolean((null===o||void 0===o?void 0:o.baseCurrency)&&(null===o||void 0===o?void 0:o.quoteCurrency)),p=u?"".concat(null===o||void 0===o||null===(t=o.quoteCurrency)||void 0===t?void 0:t.symbol," per ").concat(null===o||void 0===o||null===(i=o.baseCurrency)||void 0===i?void 0:i.symbol):"".concat(null===o||void 0===o||null===(a=o.baseCurrency)||void 0===a?void 0:a.symbol," per ").concat(null===o||void 0===o||null===(c=o.quoteCurrency)||void 0===c?void 0:c.symbol);return Object(r.jsx)(s.z,{fontSize:"14px",style:{justifyContent:"center",alignItems:"center",display:"flex"},children:b?Object(r.jsxs)(r.Fragment,{children:[null!==d&&void 0!==d?d:"-"," ",p,Object(r.jsx)(Ro,{onClick:function(){return l(!u)},children:Object(r.jsx)(s.y,{width:"20px",color:"primary"})})]}):"-"})}function yl(){var e=Object(u.a)(["\n stroke: ",";\n"]);return yl=function(){return e},e}function xl(){var e=Object(u.a)(["\n max-width: 420px;\n width: 100%;\n padding: 1rem;\n background: rgba(242, 150, 2, 0.05);\n border: 1px solid #f3841e;\n border-radius: 20px;\n overflow: auto;\n"]);return xl=function(){return e},e}function gl(){var e=Object(u.a)(["\n background: ",";\n padding: 0.75rem;\n border-radius: 20px;\n"]);return gl=function(){return e},e}var Cl=l.default.div(gl(),(function(e){var n=e.theme;return Object(vt.b)(.6,n.colors.tertiary)})),wl=l.default.div(xl()),kl=Object(l.default)(Wt.a)(yl(),(function(e){return e.theme.colors.failure}));function Tl(e){var n,t,a,c,o=e.token,u=ge().chainId,l=Zt(),d=null!==(n=null===o||void 0===o||null===(t=o.symbol)||void 0===t?void 0:t.toLowerCase())&&void 0!==n?n:"",b=null!==(a=null===o||void 0===o||null===(c=o.name)||void 0===c?void 0:c.toLowerCase())&&void 0!==a?a:"",p=fi(),f=Object(i.useMemo)((function(){return!(!o||!u)&&Object.keys(p).some((function(e){var n,t,r=p[e];return!r.equals(o)&&((null===(n=r.symbol)||void 0===n?void 0:n.toLowerCase())===d||(null===(t=r.name)||void 0===t?void 0:t.toLowerCase())===b)}))}),[o,u,p,d,b]);return o?Object(r.jsx)(Cl,{error:f,children:Object(r.jsxs)(tn,{gap:"6px",children:[Object(r.jsxs)(Pe,{gap:"24px",children:[Object(r.jsx)(ha,{currency:o,size:"16px"}),Object(r.jsx)("div",{children:" "})]}),Object(r.jsxs)(Pe,{gap:"10px",justify:"flex-start",children:[Object(r.jsxs)(s.z,{children:[o&&o.name&&o.symbol&&o.name!==o.symbol?"".concat(o.name," (").concat(o.symbol,")"):o.name||o.symbol," "]}),u&&Object(r.jsx)(Rn,{style:{fontWeight:400},href:hn(u,o.address,"token"),children:Object(r.jsxs)(s.z,{title:o.address,children:[vn(o.address)," ",l(116,"(View on BscScan)")]})})]})]})}):null}function Il(e){var n=e.isOpen,t=e.tokens,a=e.onConfirm,c=Object(i.useState)(!1),o=Object(f.a)(c,2),u=o[0],l=o[1],d=Object(i.useCallback)((function(){return l((function(e){return!e}))}),[]),b=Zt(),p=Object(i.useCallback)((function(){return null}),[]);return Object(r.jsx)(Tt,{isOpen:n,onDismiss:p,maxHeight:90,children:Object(r.jsx)(wl,{className:"token-warning-container",children:Object(r.jsxs)(Pe,{gap:"lg",children:[Object(r.jsxs)(tn,{gap:"6px",children:[Object(r.jsx)(kl,{}),Object(r.jsx)(s.z,{color:"failure",children:b(1128,"Token imported")})]}),Object(r.jsx)(s.z,{children:b(1130,"Anyone can create a BEP20 token on BSC with any name, including creating fake versions of existing tokens and tokens that claim to represent projects that do not have a token.")}),Object(r.jsx)(s.z,{children:b(1132,"This interface can load arbitrary tokens by token addresses. Please take extra caution and do your research when interacting with arbitrary BEP20 tokens.")}),Object(r.jsx)(s.z,{children:b(1134,"If you purchase an arbitrary token, you may be unable to sell it back.")}),t.map((function(e){return Object(r.jsx)(Tl,{token:e},e.address)})),Object(r.jsxs)(en,{children:[Object(r.jsx)("div",{children:Object(r.jsxs)("label",{htmlFor:"understand-checkbox",style:{cursor:"pointer",userSelect:"none"},children:[Object(r.jsx)("input",{id:"understand-checkbox",type:"checkbox",className:"understand-checkbox",checked:u,onChange:d})," ",Object(r.jsx)(s.z,{as:"span",ml:"4px",children:b(148,"I understand")})]})}),Object(r.jsx)(s.d,{disabled:!u,variant:"danger",style:{width:"140px"},className:"token-dismiss-button",onClick:function(){a()},children:b(150,"Continue")})]})]})})})}function El(){var e=Object(u.a)(["\n stroke: ",";\n"]);return El=function(){return e},e}function Nl(){var e=Object(u.a)(["\n max-width: 420px;\n width: 100%;\n padding: 1rem;\n background: rgba(242, 150, 2, 0.05);\n border: 1px solid #f3841e;\n border-radius: 20px;\n overflow: auto;\n"]);return Nl=function(){return e},e}var Sl=l.default.div(Nl()),Rl=Object(l.default)(Wt.a)(El(),(function(e){return e.theme.colors.failure}));function Ul(e){var n=e.isOpen,t=e.transactionType,a=e.onConfirm,c=Object(i.useState)(!1),o=Object(f.a)(c,2),u=o[0],l=o[1],d=Object(i.useCallback)((function(){return l((function(e){return!e}))}),[]),b=Object(i.useCallback)((function(){return null}),[]);return Object(r.jsx)(Tt,{isOpen:n,onDismiss:b,maxHeight:90,children:Object(r.jsx)(Sl,{className:"token-warning-container",children:Object(r.jsxs)(Pe,{gap:"lg",children:[Object(r.jsxs)(tn,{gap:"6px",children:[Object(r.jsx)(Rl,{}),Object(r.jsx)(s.z,{color:"failure",children:"Syrup Warning"})]}),""!==t&&Object(r.jsxs)(r.Fragment,{children:[Object(r.jsxs)(s.z,{color:"failure",children:["Please be careful when ",Object(r.jsx)("strong",{children:t})," SYRUP."]}),Object(r.jsx)(s.z,{color:"failure",children:"Buying"===t?"You will not receive CAKE rewards for holding purchased SYRUP.":"You will need to buy back the same amount of SYRUP to be able to convert back to CAKE."})]}),Object(r.jsxs)(en,{children:[Object(r.jsx)("div",{children:Object(r.jsxs)("label",{htmlFor:"understand-checkbox",style:{cursor:"pointer",userSelect:"none"},children:[Object(r.jsx)("input",{id:"understand-checkbox",type:"checkbox",className:"understand-checkbox",checked:u,onChange:d})," ",Object(r.jsx)(s.z,{as:"span",children:"I understand"})]})}),Object(r.jsx)(s.d,{disabled:!u,variant:"danger",style:{width:"140px"},onClick:function(){l(!1),a()},children:"Continue"})]})]})})})}function Al(){var e=Object(u.a)(["\n stroke: ",";\n"]);return Al=function(){return e},e}function zl(){var e=Object(u.a)(["\n max-width: 420px;\n width: 100%;\n padding: 1rem;\n background: rgba(242, 150, 2, 0.05);\n border: 1px solid #f3841e;\n border-radius: 20px;\n overflow: auto;\n"]);return zl=function(){return e},e}var Bl=l.default.div(zl()),Pl=Object(l.default)(Wt.a)(Al(),(function(e){return e.theme.colors.binance}));function Ml(e){var n=e.isOpen,t=e.onConfirm,a=Object(i.useState)(!1),c=Object(f.a)(a,2),o=c[0],u=c[1],l=Object(i.useCallback)((function(){return u((function(e){return!e}))}),[]),d=Object(i.useCallback)((function(){return null}),[]);return Object(r.jsx)(Tt,{isOpen:n,onDismiss:d,maxHeight:90,children:Object(r.jsx)(Bl,{className:"token-warning-container",children:Object(r.jsxs)(Pe,{gap:"lg",children:[Object(r.jsxs)(tn,{gap:"6px",children:[Object(r.jsx)(Pl,{}),Object(r.jsx)(s.z,{children:"Notice for trading SafeMoon"})]}),Object(r.jsxs)(r.Fragment,{children:[Object(r.jsxs)(s.z,{children:["To trade SAFEMOON, you must click on the settings icon and"," ",Object(r.jsx)("strong",{children:"set your slippage tolerance to 12%+"})]}),Object(r.jsx)(s.z,{children:"This is because SafeMoon taxes a 10% fee on each transaction."}),Object(r.jsx)(s.z,{children:"\u2022 5% fee = redistributed to all existing holders"}),Object(r.jsx)(s.z,{children:"\u2022 5% fee = used to add liquidity"})]}),Object(r.jsxs)(en,{children:[Object(r.jsx)("div",{children:Object(r.jsxs)("label",{htmlFor:"understand-checkbox",style:{cursor:"pointer",userSelect:"none"},children:[Object(r.jsx)("input",{id:"understand-safeMoonWarning",type:"checkbox",className:"understand-checkbox",checked:o,onChange:l})," ",Object(r.jsx)(s.z,{as:"span",children:"I understand"})]})}),Object(r.jsx)(s.d,{id:"confirm-safeMoonWarning",disabled:!o,variant:"danger",style:{width:"140px"},onClick:function(){u(!1),t()},children:"Continue"})]})]})})})}function Dl(){var e=Object(u.a)(["\n width: 100%;\n height: 2px;\n background-color: ;\n background: linear-gradient(\n 90deg,\n "," 0%,\n "," 80%\n );\n opacity: 0.6;\n"]);return Dl=function(){return e},e}function Ll(){var e=Object(u.a)(["\n width: calc(100% - 20px);\n display: flex;\n align-items: center;\n"]);return Ll=function(){return e},e}function _l(){var e=Object(u.a)(["\n min-width: 20px;\n min-height: 20px;\n background-color: ",";\n border-radius: 50%;\n display: flex;\n align-items: center;\n justify-content: center;\n line-height: 8px;\n font-size: 12px;\n color: ",";\n"]);return _l=function(){return e},e}function Yl(){var e=Object(u.a)(["\n width: 50%;\n"]);return Yl=function(){return e},e}function Fl(){var e=Object(u.a)(["\n margin-top: 1.25rem;\n"]);return Fl=function(){return e},e}var ql,Vl=Object(l.default)(Pe)(Fl()),Wl=Object(l.default)(en)(Yl()),Hl=l.default.div(_l(),(function(e){var n=e.theme,t=e.confirmed;return e.disabled?n.colors.backgroundDisabled:t?n.colors.success:n.colors.primary}),(function(e){var n=e.theme,t=e.confirmed;return e.disabled?n.colors.text:t?n.colors.success:"#FFFFFF"})),Ql=l.default.div(Ll()),Gl=l.default.div(Dl(),(function(e){var n=e.theme,t=e.prevConfirmed;return Object(vt.b)(.5,t?n.colors.success:n.colors.primary)}),(function(e){var n=e.theme;return e.prevConfirmed?n.colors.primary:n.colors.backgroundDisabled}));function Kl(e){var n=e.steps;return Object(r.jsx)(Vl,{justify:"center",children:Object(r.jsxs)(Wl,{children:[n.map((function(e,t){return Object(r.jsxs)(Ql,{children:[Object(r.jsx)(Hl,{confirmed:e,disabled:!n[t-1]&&0!==t,children:e?"\u2713":t+1}),Object(r.jsx)(Gl,{prevConfirmed:e})]},t)})),Object(r.jsx)(Hl,{disabled:!n[n.length-1],children:n.length+1})]})})}function Xl(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:be,t=arguments.length>2&&void 0!==arguments[2]?arguments[2]:pe,r=arguments.length>3?arguments[3]:void 0,a=ge(),c=a.account,o=a.chainId,s=a.library,u=gs(r),l=u.address,d=null===r?c:l;return Object(i.useMemo)((function(){if(!e||!d||!s||!c||!o)return[];var r=xn(0,s,c);if(!r)return[];var i=[];return i.push(J.i.swapCallParameters(e,{feeOnTransfer:!1,allowedSlippage:new J.g(J.e.BigInt(Math.floor(n)),je),recipient:d,ttl:t})),e.tradeType===J.m.EXACT_INPUT&&i.push(J.i.swapCallParameters(e,{feeOnTransfer:!0,allowedSlippage:new J.g(J.e.BigInt(Math.floor(n)),je),recipient:d,ttl:t})),i.map((function(e){return{parameters:e,contract:r}}))}),[c,n,o,t,s,d,e])}function Jl(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:be,t=arguments.length>2&&void 0!==arguments[2]?arguments[2]:pe,r=arguments.length>3?arguments[3]:void 0,a=ge(),c=a.account,o=a.chainId,s=a.library,u=Xl(e,n,t,r),l=as(),d=gs(r),b=d.address,p=null===r?c:b;return Object(i.useMemo)((function(){return e&&s&&c&&o?p?{state:ql.VALID,callback:function(){var n=Object(S.a)(E.a.mark((function n(){var t,i,a,o,s,d,b,f,j,h;return E.a.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return n.next=2,Promise.all(u.map((function(e){var n,t=e.parameters,r=t.methodName,i=t.args,a=t.value,c=e.contract,o=!a||Di(a)?{}:{value:a};return(n=c.estimateGas)[r].apply(n,Object(K.a)(i).concat([o])).then((function(n){return{call:e,gasEstimate:n}})).catch((function(n){var t;return console.info("Gas estimate failed, trying eth_call to extract error",e),(t=c.callStatic)[r].apply(t,Object(K.a)(i).concat([o])).then((function(t){return console.info("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((function(n){var t;switch(console.info("Call threw error",e,n),n.reason){case"UniswapV2Router: INSUFFICIENT_OUTPUT_AMOUNT":case"UniswapV2Router: EXCESSIVE_INPUT_AMOUNT":t="This transaction will not succeed either due to price movement or fee on transfer. Try increasing your slippage tolerance.";break;default:t="The transaction cannot succeed due to error: ".concat(n.reason,". This is probably an issue with one of the tokens you are swapping.")}return{call:e,error:new Error(t)}}))}))})));case 2:if(t=n.sent,i=t.find((function(e,n,t){return"gasEstimate"in e&&(n===t.length-1||"gasEstimate"in t[n+1])}))){n.next=9;break}if(!((a=t.filter((function(e){return"error"in e}))).length>0)){n.next=8;break}throw a[a.length-1].error;case 8:throw new Error("Unexpected error. Please contact support: none of the calls threw an error");case 9:return o=i.call,s=o.contract,d=o.parameters,b=d.methodName,f=d.args,j=d.value,h=i.gasEstimate,n.abrupt("return",s[b].apply(s,Object(K.a)(f).concat([Object(X.a)({gasLimit:mn(h)},j&&!Di(j)?{value:j,from:c}:{from:c})])).then((function(n){var t=e.inputAmount.currency.symbol,i=e.outputAmount.currency.symbol,a=e.inputAmount.toSignificant(3),o=e.outputAmount.toSignificant(3),s="Swap ".concat(a," ").concat(t," for ").concat(o," ").concat(i),u=p===c?s:"".concat(s," to ").concat(r&&fn(r)?vn(r):r);return l(n,{summary:u}),n.hash})).catch((function(e){throw 4001===(null===e||void 0===e?void 0:e.code)?new Error("Transaction rejected."):(console.error("Swap failed",e,b,f,j),new Error("Swap failed: ".concat(e.message)))})));case 11:case"end":return n.stop()}}),n)})));return function(){return n.apply(this,arguments)}}(),error:null}:null!==r?{state:ql.INVALID,callback:null,error:"Invalid recipient"}:{state:ql.LOADING,callback:null,error:null}:{state:ql.INVALID,callback:null,error:"Missing dependencies"}}),[e,s,c,o,p,r,u,l])}!function(e){e[e.INVALID=0]="INVALID",e[e.LOADING=1]="LOADING",e[e.VALID=2]="VALID"}(ql||(ql={}));var $l;!function(e){e[e.NOT_APPLICABLE=0]="NOT_APPLICABLE",e[e.WRAP=1]="WRAP",e[e.UNWRAP=2]="UNWRAP"}($l||($l={}));var Zl={wrapType:$l.NOT_APPLICABLE};function ed(e,n,t){var r=ge(),a=r.chainId,c=r.account,o=function(e){var n=ge().chainId;return ui(n?J.n[n].address:void 0,ci,e)}(),s=wi(null!==c&&void 0!==c?c:void 0,e),u=Object(i.useMemo)((function(){return Ts(t,e)}),[e,t]),l=as();return Object(i.useMemo)((function(){if(!o||!a||!e||!n)return Zl;var t=u&&s&&!s.lessThan(u);return e===J.d&&Object(J.o)(J.n[a],n)?{wrapType:$l.WRAP,execute:t&&u?Object(S.a)(E.a.mark((function e(){var n;return E.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,o.deposit({value:"0x".concat(u.raw.toString(16))});case 3:n=e.sent,l(n,{summary:"Wrap ".concat(u.toSignificant(6)," BNB to WBNB")}),e.next=10;break;case 7:e.prev=7,e.t0=e.catch(0),console.error("Could not deposit",e.t0);case 10:case"end":return e.stop()}}),e,null,[[0,7]])}))):void 0,inputError:t?void 0:"Insufficient BNB balance"}:Object(J.o)(J.n[a],e)&&n===J.d?{wrapType:$l.UNWRAP,execute:t&&u?Object(S.a)(E.a.mark((function e(){var n;return E.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,o.withdraw("0x".concat(u.raw.toString(16)));case 3:n=e.sent,l(n,{summary:"Unwrap ".concat(u.toSignificant(6)," WBNB to BNB")}),e.next=10;break;case 7:e.prev=7,e.t0=e.catch(0),console.error("Could not withdraw",e.t0);case 10:case"end":return e.stop()}}),e,null,[[0,7]])}))):void 0,inputError:t?void 0:"Insufficient WBNB balance"}:Zl}),[o,a,e,n,u,s,l])}var nd=function(){var e,n,t,a,c,o,u,d,b,p,j=zs(),h=Zt(),m=[mi(null===j||void 0===j?void 0:j.inputCurrencyId),mi(null===j||void 0===j?void 0:j.outputCurrencyId)],O=m[0],x=m[1],g=Object(i.useState)(!1),C=Object(f.a)(g,2),w=C[0],k=C[1],T=Object(i.useState)({selectedToken:null,purchaseType:null}),I=Object(f.a)(T,2),E=I[0],N=I[1],S=Object(i.useMemo)((function(){var e,n;return null!==(e=null===(n=[O,x])||void 0===n?void 0:n.filter((function(e){return e instanceof J.j})))&&void 0!==e?e:[]}),[O,x]),R=Object(i.useCallback)((function(){k(!0)}),[]),U=function(){N({selectedToken:null,purchaseType:null})},A=ge().account,z=Object(i.useContext)(l.ThemeContext),B=function(){var e=Object(v.c)(),n=Xr(),t=Object(i.useCallback)((function(){e(Dr({userExpertMode:!n}))}),[n,e]);return[n,t]}(),P=Object(f.a)(B,1)[0],M=$r(),D=Object(f.a)(M,1)[0],L=Jr(),_=Object(f.a)(L,1)[0],Y=ks(),F=Y.independentField,q=Y.typedValue,V=Y.recipient,W=Ns(),H=W.v2Trade,Q=W.currencyBalances,G=W.parsedAmount,K=W.currencies,Z=W.inputError,ee=ed(K[Ko.INPUT],K[Ko.OUTPUT],q),ne=ee.wrapType,te=ee.execute,re=ee.inputError,ie=ne!==$l.NOT_APPLICABLE,ae=ie?void 0:H,ce=ie?(e={},Object(y.a)(e,Ko.INPUT,G),Object(y.a)(e,Ko.OUTPUT,G),e):(n={},Object(y.a)(n,Ko.INPUT,F===Ko.INPUT?G:null===ae||void 0===ae?void 0:ae.inputAmount),Object(y.a)(n,Ko.OUTPUT,F===Ko.OUTPUT?G:null===ae||void 0===ae?void 0:ae.outputAmount),n),oe=function(){var e=Object(v.c)(),n=Object(i.useCallback)((function(n,t){e(Xo({field:n,currencyId:t instanceof J.j?t.address:t===J.d?"BNB":""}))}),[e]);return{onSwitchTokens:Object(i.useCallback)((function(){e(Jo())}),[e]),onCurrencySelection:n,onUserInput:Object(i.useCallback)((function(n,t){e($o({field:n,typedValue:t}))}),[e]),onChangeRecipient:Object(i.useCallback)((function(n){e(es({recipient:n}))}),[e])}}(),se=oe.onSwitchTokens,ue=oe.onCurrencySelection,le=oe.onUserInput,de=oe.onChangeRecipient,pe=!Z,fe=F===Ko.INPUT?Ko.OUTPUT:Ko.INPUT,je=Object(i.useCallback)((function(e){le(Ko.INPUT,e)}),[le]),he=Object(i.useCallback)((function(e){le(Ko.OUTPUT,e)}),[le]),ve=Object(i.useState)({showConfirm:!1,tradeToConfirm:void 0,attemptingTxn:!1,swapErrorMessage:void 0,txHash:void 0}),ye=Object(f.a)(ve,2),xe=ye[0],Ce=xe.showConfirm,we=xe.tradeToConfirm,ke=xe.swapErrorMessage,Te=xe.attemptingTxn,Ie=xe.txHash,Ee=ye[1],Ne=(u={},Object(y.a)(u,F,q),Object(y.a)(u,fe,ie?null!==(t=null===(a=ce[F])||void 0===a?void 0:a.toExact())&&void 0!==t?t:"":null!==(c=null===(o=ce[fe])||void 0===o?void 0:o.toSignificant(6))&&void 0!==c?c:""),u),Se=null===ae||void 0===ae?void 0:ae.route,Re=Boolean(K[Ko.INPUT]&&K[Ko.OUTPUT]&&(null===(d=ce[F])||void 0===d?void 0:d.greaterThan(J.e.BigInt(0)))),Ue=!Se,Ae=function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return vs(Object(i.useMemo)((function(){return e?fs(e,n)[Ko.INPUT]:void 0}),[e,n]),$)}(ae,_),ze=Object(f.a)(Ae,2),Be=ze[0],Me=ze[1],De=Object(i.useState)(!1),Le=Object(f.a)(De,2),_e=Le[0],Ye=Le[1];Object(i.useEffect)((function(){Be===ss.PENDING&&Ye(!0)}),[Be,_e]);var Fe=Ms(Q[Ko.INPUT]),qe=Boolean(Fe&&(null===(b=ce[Ko.INPUT])||void 0===b?void 0:b.equalTo(Fe))),Ve=Jl(ae,_,D,V),We=Ve.callback,He=Ve.error,Qe=ps(ae).priceImpactWithoutFee,Ge=Object(i.useCallback)((function(){Qe&&!function(e){return e.lessThan(Oe)?!!e.lessThan(me)||window.confirm("This swap has a price impact of at least ".concat(me.toFixed(0),"%. Please confirm that you would like to continue with this swap.")):"confirm"===window.prompt("This swap has a price impact of at least ".concat(Oe.toFixed(0),'%. Please type the word "confirm" to continue with this swap.'))}(Qe)||We&&(Ee((function(e){return Object(X.a)(Object(X.a)({},e),{},{attemptingTxn:!0,swapErrorMessage:void 0,txHash:void 0})})),We().then((function(e){Ee((function(n){return Object(X.a)(Object(X.a)({},n),{},{attemptingTxn:!1,swapErrorMessage:void 0,txHash:e})}))})).catch((function(e){Ee((function(n){return Object(X.a)(Object(X.a)({},n),{},{attemptingTxn:!1,swapErrorMessage:e.message,txHash:void 0})}))})))}),[Qe,We,Ee]),Ke=Object(i.useState)(!1),Xe=Object(f.a)(Ke,2),Je=Xe[0],$e=Xe[1],Ze=js(Qe),nn=!Z&&(Be===ss.NOT_APPROVED||Be===ss.PENDING||_e&&Be===ss.APPROVED)&&!(Ze>3&&!P),rn=Object(i.useCallback)((function(){Ee((function(e){return Object(X.a)(Object(X.a)({},e),{},{showConfirm:!1})})),Ie&&le(Ko.INPUT,"")}),[le,Ie,Ee]),an=Object(i.useCallback)((function(){Ee((function(e){return Object(X.a)(Object(X.a)({},e),{},{tradeToConfirm:ae})}))}),[ae]),cn=Object(i.useCallback)((function(e,n){["SYRUP","SAFEMOON"].includes(e)&&N({selectedToken:e,purchaseType:n})}),[N]),on=Object(i.useCallback)((function(e){Ye(!1),ue(Ko.INPUT,e),"SYRUP"===e.symbol&&cn(e.symbol,"Selling"),"SAFEMOON"===e.symbol&&cn(e.symbol,"Selling")}),[ue,Ye,cn]),sn=Object(i.useCallback)((function(){Fe&&le(Ko.INPUT,Fe.toExact())}),[Fe,le]),un=Object(i.useCallback)((function(e){ue(Ko.OUTPUT,e),"SYRUP"===e.symbol&&cn(e.symbol,"Buying"),"SAFEMOON"===e.symbol&&cn(e.symbol,"Buying")}),[ue,cn]);return Object(r.jsxs)(r.Fragment,{children:[Object(r.jsx)(Il,{isOpen:S.length>0&&!w,tokens:S,onConfirm:R}),Object(r.jsx)(Ul,{isOpen:"SYRUP"===E.selectedToken,transactionType:E.purchaseType,onConfirm:U}),Object(r.jsx)(Ml,{isOpen:"SAFEMOON"===E.selectedToken,onConfirm:U}),Object(r.jsx)(rr,{}),Object(r.jsx)($s,{children:Object(r.jsxs)(To,{id:"swap-page",children:[Object(r.jsx)(dl,{isOpen:Ce,trade:ae,originalTrade:we,onAcceptChanges:an,attemptingTxn:Te,txHash:Ie,recipient:V,allowedSlippage:_,onConfirm:Ge,swapErrorMessage:ke,onDismiss:rn}),Object(r.jsx)(Au,{title:h(8,"Exchange"),description:h(1192,"Trade tokens in an instant")}),Object(r.jsxs)(s.h,{children:[Object(r.jsxs)(Pe,{gap:"md",children:[Object(r.jsx)($c,{label:F===Ko.OUTPUT&&!ie&&ae?h(194,"From (estimated)"):h(76,"From"),value:Ne[Ko.INPUT],showMaxButton:!qe,currency:K[Ko.INPUT],onUserInput:je,onMax:sn,onCurrencySelect:on,otherCurrency:K[Ko.OUTPUT],id:"swap-currency-input"}),Object(r.jsx)(Pe,{justify:"space-between",children:Object(r.jsxs)(tn,{justify:P?"space-between":"center",style:{padding:"0 1rem"},children:[Object(r.jsx)(Io,{clickable:!0,children:Object(r.jsx)(s.q,{variant:"tertiary",onClick:function(){Ye(!1),se()},style:{borderRadius:"50%"},scale:"sm",children:Object(r.jsx)(s.b,{color:"primary",width:"24px"})})}),null===V&&!ie&&P?Object(r.jsx)(En,{id:"add-recipient-button",onClick:function(){return de("")},children:"+ Add a send (optional)"}):null]})}),Object(r.jsx)($c,{value:Ne[Ko.OUTPUT],onUserInput:he,label:F===Ko.INPUT&&!ie&&ae?h(196,"To (estimated)"):h(80,"To"),showMaxButton:!1,currency:K[Ko.OUTPUT],onCurrencySelect:un,otherCurrency:K[Ko.INPUT],id:"swap-currency-output"}),null===V||ie?null:Object(r.jsxs)(r.Fragment,{children:[Object(r.jsxs)(tn,{justify:"space-between",style:{padding:"0 1rem"},children:[Object(r.jsx)(Io,{clickable:!1,children:Object(r.jsx)(Du.a,{size:"16",color:z.colors.textSubtle})}),Object(r.jsx)(En,{id:"remove-recipient-button",onClick:function(){return de(null)},children:"- Remove send"})]}),Object(r.jsx)(il,{id:"recipient",value:V,onChange:de})]}),ie?null:Object(r.jsx)(pt,{padding:".25rem .75rem 0 .75rem",borderRadius:"20px",children:Object(r.jsxs)(Pe,{gap:"4px",children:[Boolean(ae)&&Object(r.jsxs)(en,{align:"center",children:[Object(r.jsx)(s.z,{fontSize:"14px",children:h(1182,"Price")}),Object(r.jsx)(Ol,{price:null===ae||void 0===ae?void 0:ae.executionPrice,showInverted:Je,setShowInverted:$e})]}),_!==be&&Object(r.jsxs)(en,{align:"center",children:[Object(r.jsx)(s.z,{fontSize:"14px",children:h(88,"Slippage Tolerance")}),Object(r.jsxs)(s.z,{fontSize:"14px",children:[_/100,"%"]})]})]})})]}),Object(r.jsxs)(No,{children:[A?ie?Object(r.jsx)(s.d,{disabled:Boolean(re),onClick:te,width:"100%",children:null!==re&&void 0!==re?re:ne===$l.WRAP?"Wrap":ne===$l.UNWRAP?"Unwrap":null}):Ue&&Re?Object(r.jsx)(jt,{style:{textAlign:"center"},children:Object(r.jsx)(s.z,{mb:"4px",children:h(1194,"Insufficient liquidity for this trade.")})}):nn?Object(r.jsxs)(en,{children:[Object(r.jsx)(s.d,{onClick:Me,disabled:Be!==ss.NOT_APPROVED||_e,style:{width:"48%"},variant:Be===ss.APPROVED?"success":"primary",children:Be===ss.PENDING?Object(r.jsxs)(tn,{gap:"6px",justify:"center",children:["Approving ",Object(r.jsx)(rt,{stroke:"white"})]}):_e&&Be===ss.APPROVED?"Approved":"Approve ".concat(null===(p=K[Ko.INPUT])||void 0===p?void 0:p.symbol)}),Object(r.jsx)(s.d,{onClick:function(){P?Ge():Ee({tradeToConfirm:ae,attemptingTxn:!1,swapErrorMessage:void 0,showConfirm:!0,txHash:void 0})},style:{width:"48%"},id:"swap-button",disabled:!pe||Be!==ss.APPROVED||Ze>3&&!P,variant:pe&&Ze>2?"danger":"primary",children:Ze>3&&!P?"Price Impact High":"Swap".concat(Ze>2?" Anyway":"")})]}):Object(r.jsx)(s.d,{onClick:function(){P?Ge():Ee({tradeToConfirm:ae,attemptingTxn:!1,swapErrorMessage:void 0,showConfirm:!0,txHash:void 0})},id:"swap-button",disabled:!pe||Ze>3&&!P||!!He,variant:pe&&Ze>2&&!He?"danger":"primary",width:"100%",children:Z||(Ze>3&&!P?"Price Impact Too High":"Swap".concat(Ze>2?" Anyway":""))}):Object(r.jsx)(Ks,{width:"100%"}),nn&&Object(r.jsx)(Kl,{steps:[Be===ss.APPROVED]}),P&&ke?Object(r.jsx)(Bo,{error:ke}):null]})]})]})}),Object(r.jsx)(ml,{trade:ae})]})};function td(e){var n=e.location;return Object(r.jsx)(h.a,{to:Object(X.a)(Object(X.a)({},n),{},{pathname:"/swap"})})}var rd={code:"en",language:"English"},id=[rd],ad={selectedLanguage:{code:"",language:""},setSelectedLanguage:function(){},translatedLanguage:{code:"",language:""},setTranslatedLanguage:function(){}},cd=Object(i.createContext)(ad),od="IS_DARK",sd=a.a.createContext({isDark:!1,toggleTheme:function(){return null}}),ud=function(e){var n=e.children,t=Object(i.useState)((function(){var e=localStorage.getItem(od);return!!e&&JSON.parse(e)})),a=Object(f.a)(t,2),c=a[0],o=a[1];return Object(r.jsx)(sd.Provider,{value:{isDark:c,toggleTheme:function(){o((function(e){return localStorage.setItem(od,JSON.stringify(!e)),!e}))}},children:Object(r.jsx)(l.ThemeProvider,{theme:c?s.D:s.E,children:n})})},ld=function(){var e=Object(i.useContext)(sd);return{isDark:e.isDark,toggleTheme:e.toggleTheme,theme:Object(i.useContext)(l.ThemeContext)}},dd=function(){var e=Object(i.useState)(null),n=Object(f.a)(e,2),t=n[0],r=n[1];return Object(i.useEffect)((function(){(function(){var e=Object(S.a)(E.a.mark((function e(){var n,t;return E.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,fetch("https://api.pancakeswap.info/api/tokens");case 3:return n=e.sent,e.next=6,n.json();case 6:t=e.sent,r(t),e.next=13;break;case 10:e.prev=10,e.t0=e.catch(0),console.error("Unable to fetch price data:",e.t0);case 13:case"end":return e.stop()}}),e,null,[[0,10]])})));return function(){return e.apply(this,arguments)}})()()}),[r]),t},bd=t(238),pd=t.n(bd),fd={profileLink:"https://pancakeswap.finance/profile",noProfileLink:"https://pancakeswap.finance/profile"},jd=function(){var e=Object(i.useState)(fd),n=Object(f.a)(e,2),t=n[0],r=n[1],a=ge().account;return Object(i.useEffect)((function(){if(a)try{var e=pd.a.get("profile_".concat(a));if(e){var n=JSON.parse(e);r((function(e){return Object(X.a)(Object(X.a)({},e),{},{username:n.username,image:n.avatar})}))}}catch(t){r(fd)}else r(fd)}),[a,r]),t},hd=[{label:"Home",icon:"HomeIcon",href:"/"},{label:"Trade",icon:"TradeIcon",initialOpenState:!1,items:[{label:"Exchange",href:"/swap"},{label:"Liquidity",href:"/pool"}]}],vd=function(e){var n=Object(m.d)().account,t=Gs(),a=t.login,c=t.logout,o=Object(i.useContext)(cd),u=o.selectedLanguage,l=o.setSelectedLanguage,d=ld(),b=d.isDark,p=d.toggleTheme,f=dd(),j=0;try{var h;j=f?Number(null!==(h=f.data["0x0E09FaBB73Bd3Ade0a17ECC321fD13a19e81cE82"].price)&&void 0!==h?h:0):0}catch(O){}var v=jd();return Object(r.jsx)(s.t,Object(X.a)({links:hd,account:n,login:a,logout:c,isDark:b,toggleTheme:p,currentLang:(null===u||void 0===u?void 0:u.code)||"",langs:id,setLang:l,cakePriceUsd:j,profile:v},e))},md=function(){var e=dd(),n=0;try{var t;n=e?parseFloat(null!==(t=e.data[Z.address].price)&&void 0!==t?t:0):0}catch(a){}var r=Number.isNaN(n)||0===n?"":" - $".concat(n.toLocaleString(void 0,{minimumFractionDigits:3,maximumFractionDigits:3}));Object(i.useEffect)((function(){document.title="PancakeSwap".concat(r)}),[r])};function Od(){var e=Object(u.a)(["\n margin-top: 5rem;\n"]);return Od=function(){return e},e}function yd(){var e=Object(u.a)(["\n display: flex;\n flex-direction: column;\n width: 100%;\n padding: 32px 16px;\n align-items: center;\n flex: 1;\n overflow-y: auto;\n overflow-x: hidden;\n z-index: 1;\n justify-content: center;\n background-image: url('/images/group-pancake.svg');\n background-repeat: no-repeat;\n background-position: bottom 24px center;\n background-size: 90%;\n\n "," {\n background-size: auto;\n }\n\n "," {\n background-image: url('/images/arch-",".svg'),\n url('/images/left-pancake.svg'), url('/images/right-pancake.svg');\n background-repeat: no-repeat;\n background-position: center 420px, 10% 230px, 90% 230px;\n background-size: contain, 266px, 266px;\n min-height: 90vh;\n }\n"]);return yd=function(){return e},e}function xd(){var e=Object(u.a)(["\n display: flex;\n flex-flow: column;\n align-items: flex-start;\n overflow-x: hidden;\n"]);return xd=function(){return e},e}var gd=l.default.div(xd()),Cd=l.default.div(yd(),(function(e){return e.theme.mediaQueries.xs}),(function(e){return e.theme.mediaQueries.lg}),(function(e){return e.theme.isDark?"dark":"light"})),wd=l.default.div(Od()),kd="pancakeSwapLanguage";function Td(){var e=Object(i.useState)(void 0),n=Object(f.a)(e,2),t=n[0],a=n[1],c=Object(i.useState)(void 0),o=Object(f.a)(c,2),s=o[0],u=o[1],l=Object(i.useState)([]),d=Object(f.a)(l,2),b=d[0],p=d[1];Object(i.useEffect)((function(){var e=localStorage.getItem(kd);if(e){var n=function(e){return id.filter((function(n){return n.code===e}))[0]}(e);a(n)}else a(rd)}),[]);return md(),Object(r.jsx)(i.Suspense,{fallback:null,children:Object(r.jsx)(j.a,{children:Object(r.jsx)(gd,{children:Object(r.jsx)(cd.Provider,{value:{selectedLanguage:t,setSelectedLanguage:function(e){a(e),localStorage.setItem(kd,e.code)},translatedLanguage:s,setTranslatedLanguage:u},children:Object(r.jsx)(Kt.Provider,{value:{translations:b,setTranslations:p},children:Object(r.jsx)(vd,{children:Object(r.jsxs)(Cd,{children:[Object(r.jsx)(Jn,{}),Object(r.jsx)(st,{children:Object(r.jsxs)(h.d,{children:[Object(r.jsx)(h.b,{exact:!0,strict:!0,path:"/swap",component:nd}),Object(r.jsx)(h.b,{exact:!0,strict:!0,path:"/find",component:Bu}),Object(r.jsx)(h.b,{exact:!0,strict:!0,path:"/pool",component:zu}),Object(r.jsx)(h.b,{exact:!0,path:"/add",component:ou}),Object(r.jsx)(h.b,{exact:!0,strict:!0,path:"/remove/:currencyIdA/:currencyIdB",component:Ku}),Object(r.jsx)(h.b,{exact:!0,path:"/add/:currencyIdA",component:uu}),Object(r.jsx)(h.b,{exact:!0,path:"/add/:currencyIdA/:currencyIdB",component:lu}),Object(r.jsx)(h.b,{exact:!0,strict:!0,path:"/remove/:tokens",component:bu}),Object(r.jsx)(h.b,{component:td})]})}),Object(r.jsx)(wd,{})]})})})})})})})}var Id="visibilityState"in document;function Ed(){return!Id||"hidden"!==document.visibilityState}function Nd(){var e=Object(i.useState)(Ed()),n=Object(f.a)(e,2),t=n[0],r=n[1],a=Object(i.useCallback)((function(){r(Ed())}),[r]);return Object(i.useEffect)((function(){if(Id)return document.addEventListener("visibilitychange",a),function(){document.removeEventListener("visibilitychange",a)}}),[a]),t}function Sd(){var e=ge(),n=e.library,t=e.chainId,r=Object(v.c)(),a=Nd(),c=Object(i.useState)({chainId:t,blockNumber:null}),o=Object(f.a)(c,2),s=o[0],u=o[1],l=Object(i.useCallback)((function(e){u((function(n){return t===n.chainId?"number"!==typeof n.blockNumber?{chainId:t,blockNumber:e}:{chainId:t,blockNumber:Math.max(e,n.blockNumber)}:n}))}),[t,u]);Object(i.useEffect)((function(){if(n&&t&&a)return u({chainId:t,blockNumber:null}),n.getBlockNumber().then(l).catch((function(e){return console.error("Failed to get block number for chainId: ".concat(t),e)})),n.on("block",l),function(){n.removeListener("block",l)}}),[r,t,n,l,a]);var d=xs(s,100);return Object(i.useEffect)((function(){d.chainId&&d.blockNumber&&a&&r(we({chainId:d.chainId,blockNumber:d.blockNumber}))}),[a,r,d.blockNumber,d.chainId]),null}function Rd(){var e=ge().library,n=Object(v.c)(),t=Object(v.d)((function(e){return e.lists.byUrl})),r=Nd(),a=bc();return Gi(Object(i.useCallback)((function(){r&&Object.keys(t).forEach((function(e){return a(e).catch((function(e){return console.error("interval list fetching error",e)}))}))}),[a,r,t]),e?6e5:null),Object(i.useEffect)((function(){Object.keys(t).forEach((function(e){var n=t[e];n.current||n.loadingRequestId||n.error||a(e).catch((function(e){return console.error("list added fetching error",e)}))}))}),[n,a,e,t]),Object(i.useEffect)((function(){Object.keys(t).forEach((function(e){var r=t[e];if(r.current&&r.pendingUpdate){var i=Object(_e.c)(r.current.version,r.pendingUpdate.version);switch(i){case _e.a.NONE:throw new Error("unexpected no version bump");case _e.a.PATCH:case _e.a.MINOR:i>=Object(_e.d)(r.current.tokens,r.pendingUpdate.tokens)?(n(Fe(e)),n(Ie({key:e,content:{listUpdate:{listUrl:e,oldList:r.current,newList:r.pendingUpdate,auto:!0}}}))):console.error("List at url ".concat(e," could not automatically update because the version bump was only PATCH/MINOR while the update had breaking changes and should have been MAJOR"));break;case _e.a.MAJOR:n(Ie({key:e,content:{listUpdate:{listUrl:e,auto:!1,oldList:r.current,newList:r.pendingUpdate}},removeAfterMs:null}))}}}))}),[n,t]),null}function Ud(e,n){return t=e+Math.round(Math.random()*Math.max(0,n-e)),new Promise((function(e){return setTimeout(e,t)}));var t}var Ad=function(e){Object(U.a)(t,e);var n=Object(A.a)(t);function t(){return Object(R.a)(this,t),n.call(this,"Cancelled")}return t}(Object(z.a)(Error)),zd=function(e){Object(U.a)(t,e);var n=Object(A.a)(t);function t(){return Object(R.a)(this,t),n.apply(this,arguments)}return t}(Object(z.a)(Error));function Bd(){return(Bd=Object(S.a)(E.a.mark((function e(n,t,r){var i,a,c,o;return E.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,n.aggregate(t.map((function(e){return[e.address,e.callData]})));case 3:c=e.sent,o=Object(f.a)(c,2),i=o[0],a=o[1],e.next=13;break;case 9:throw e.prev=9,e.t0=e.catch(0),console.info("Failed to fetch chunk inside retry",e.t0),e.t0;case 13:if(!(i.toNumber()0})).reduce((function(e,n){return Math.min(e,parseInt(n))}),1/0),e}),{}):{}}(t,a)}),[t,a]),u=Object(i.useMemo)((function(){return function(e,n,t,r){return t&&r?e[t]?Object.keys(n).filter((function(i){var a=n[i],c=e[t][i];if(!c)return!0;var o=r-(a-1);return!(c.fetchingBlockNumber&&c.fetchingBlockNumber>=o)&&(!c.blockNumber||c.blockNumber60?t>9:!(r>5)||t>2}(a,s[e])})).forEach((function(e){r.getTransactionReceipt(e).then((function(n){var r;n?(c(rs({chainId:t,hash:e,receipt:{blockHash:n.blockHash,blockNumber:n.blockNumber,contractAddress:n.contractAddress,from:n.from,status:n.status,to:n.to,transactionHash:n.transactionHash,transactionIndex:n.transactionIndex}})),u({txn:{hash:e,success:1===n.status,summary:null===(r=s[e])||void 0===r?void 0:r.summary}},e)):c(is({chainId:t,hash:e,blockNumber:a}))})).catch((function(n){console.error("failed to check transaction hash: ".concat(e),n)}))}))}),[t,r,s,a,c,u]),null}var Dd=function(){var e=Object(v.d)((function(e){return e.toasts.data})),n=Qs().remove;return Object(r.jsx)(s.A,{toasts:e,onRemove:function(e){return n(e)}})},Ld=t(175),_d=Object(Ce.c)({blockNumber:{},popupList:[],walletModalOpen:!1,settingsMenuOpen:!1},(function(e){return e.addCase(we,(function(e,n){var t=n.payload,r=t.chainId,i=t.blockNumber;"number"!==typeof e.blockNumber[r]?e.blockNumber[r]=i:e.blockNumber[r]=Math.max(i,e.blockNumber[r])})).addCase(ke,(function(e){e.walletModalOpen=!e.walletModalOpen})).addCase(Te,(function(e){e.settingsMenuOpen=!e.settingsMenuOpen})).addCase(Ie,(function(e,n){var t=n.payload,r=t.content,i=t.key,a=t.removeAfterMs,c=void 0===a?15e3:a;e.popupList=(i?e.popupList.filter((function(e){return e.key!==i})):e.popupList).concat([{key:i||Object(Ce.f)(),show:!0,content:r,removeAfterMs:c}])})).addCase(Ee,(function(e,n){var t=n.payload.key;e.popupList.forEach((function(e){e.key===t&&(e.show=!1)}))}))})),Yd=Object(Ce.b)("global/updateVersion"),Fd=(Ce.b,function(){return(new Date).getTime()});function qd(e,n){return"".concat(e,";").concat(n)}var Vd,Wd={userDarkMode:null,matchesDarkMode:!1,userExpertMode:!1,userSlippageTolerance:be,userDeadline:pe,tokens:{},pairs:{},timestamp:Fd(),audioPlay:!0},Hd=Object(Ce.c)(Wd,(function(e){return e.addCase(Yd,(function(e){"number"!==typeof e.userSlippageTolerance&&(e.userSlippageTolerance=be),"number"!==typeof e.userDeadline&&(e.userDeadline=pe),e.lastUpdateVersionTimestamp=Fd()})).addCase(Mr,(function(e,n){e.userDarkMode=n.payload.userDarkMode,e.timestamp=Fd()})).addCase(Pr,(function(e,n){e.matchesDarkMode=n.payload.matchesDarkMode,e.timestamp=Fd()})).addCase(Dr,(function(e,n){e.userExpertMode=n.payload.userExpertMode,e.timestamp=Fd()})).addCase(Lr,(function(e,n){e.userSlippageTolerance=n.payload.userSlippageTolerance,e.timestamp=Fd()})).addCase(_r,(function(e,n){e.userDeadline=n.payload.userDeadline,e.timestamp=Fd()})).addCase(Yr,(function(e,n){var t=n.payload.serializedToken;e.tokens[t.chainId]=e.tokens[t.chainId]||{},e.tokens[t.chainId][t.address]=t,e.timestamp=Fd()})).addCase(Fr,(function(e,n){var t=n.payload,r=t.address,i=t.chainId;e.tokens[i]=e.tokens[i]||{},delete e.tokens[i][r],e.timestamp=Fd()})).addCase(qr,(function(e,n){var t=n.payload.serializedPair;if(t.token0.chainId===t.token1.chainId&&t.token0.address!==t.token1.address){var r=t.token0.chainId;e.pairs[r]=e.pairs[r]||{},e.pairs[r][qd(t.token0.address,t.token1.address)]=t}e.timestamp=Fd()})).addCase(Vr,(function(e,n){var t=n.payload,r=t.chainId,i=t.tokenAAddress,a=t.tokenBAddress;e.pairs[r]&&(delete e.pairs[r][qd(i,a)],delete e.pairs[r][qd(a,i)]),e.timestamp=Fd()})).addCase(Wr,(function(e){e.audioPlay=!1})).addCase(Hr,(function(e){e.audioPlay=!0}))})),Qd=function(){return(new Date).getTime()},Gd=Object(Ce.c)({},(function(e){return e.addCase(ns,(function(e,n){var t,r,i=n.payload,a=i.chainId,c=i.from,o=i.hash,s=i.approval,u=i.summary;if(null===(t=e[a])||void 0===t?void 0:t[o])throw Error("Attempted to add existing transaction.");var l=null!==(r=e[a])&&void 0!==r?r:{};l[o]={hash:o,approval:s,summary:u,from:c,addedTime:Qd()},e[a]=l})).addCase(ts,(function(e,n){var t=n.payload.chainId;e[t]&&(e[t]={})})).addCase(is,(function(e,n){var t,r=n.payload,i=r.chainId,a=r.hash,c=r.blockNumber,o=null===(t=e[i])||void 0===t?void 0:t[a];o&&(o.lastCheckedBlockNumber?o.lastCheckedBlockNumber=Math.max(c,o.lastCheckedBlockNumber):o.lastCheckedBlockNumber=c)})).addCase(rs,(function(e,n){var t,r=n.payload,i=r.hash,a=r.chainId,c=r.receipt,o=null===(t=e[a])||void 0===t?void 0:t[i];o&&(o.receipt=c,o.confirmedTime=Qd())}))})),Kd=(Vd={independentField:Ko.INPUT,typedValue:""},Object(y.a)(Vd,Ko.INPUT,{currencyId:""}),Object(y.a)(Vd,Ko.OUTPUT,{currencyId:""}),Object(y.a)(Vd,"recipient",null),Vd),Xd=Object(Ce.c)(Kd,(function(e){return e.addCase(Zo,(function(e,n){var t,r=n.payload,i=r.typedValue,a=r.recipient,c=r.field,o=r.inputCurrencyId,s=r.outputCurrencyId;return t={},Object(y.a)(t,Ko.INPUT,{currencyId:o}),Object(y.a)(t,Ko.OUTPUT,{currencyId:s}),Object(y.a)(t,"independentField",c),Object(y.a)(t,"typedValue",i),Object(y.a)(t,"recipient",a),t})).addCase(Xo,(function(e,n){var t,r=n.payload,i=r.currencyId,a=r.field,c=a===Ko.INPUT?Ko.OUTPUT:Ko.INPUT;return i===e[c].currencyId?Object(X.a)(Object(X.a)({},e),{},(t={independentField:e.independentField===Ko.INPUT?Ko.OUTPUT:Ko.INPUT},Object(y.a)(t,a,{currencyId:i}),Object(y.a)(t,c,{currencyId:e[a].currencyId}),t)):Object(X.a)(Object(X.a)({},e),{},Object(y.a)({},a,{currencyId:i}))})).addCase(Jo,(function(e){var n;return Object(X.a)(Object(X.a)({},e),{},(n={independentField:e.independentField===Ko.INPUT?Ko.OUTPUT:Ko.INPUT},Object(y.a)(n,Ko.INPUT,{currencyId:e[Ko.OUTPUT].currencyId}),Object(y.a)(n,Ko.OUTPUT,{currencyId:e[Ko.INPUT].currencyId}),n))})).addCase($o,(function(e,n){var t=n.payload,r=t.field,i=t.typedValue;return Object(X.a)(Object(X.a)({},e),{},{independentField:r,typedValue:i})})).addCase(es,(function(e,n){var t=n.payload.recipient;e.recipient=t}))})),Jd={independentField:us.CURRENCY_A,typedValue:"",otherTypedValue:""},$d=Object(Ce.c)(Jd,(function(e){return e.addCase(Os,(function(){return Jd})).addCase(ms,(function(e,n){var t=n.payload,r=t.field,i=t.typedValue;return t.noLiquidity?r===e.independentField?Object(X.a)(Object(X.a)({},e),{},{independentField:r,typedValue:i}):Object(X.a)(Object(X.a)({},e),{},{independentField:r,typedValue:i,otherTypedValue:e.typedValue}):Object(X.a)(Object(X.a)({},e),{},{independentField:r,typedValue:i,otherTypedValue:""})}))})),Zd={error:null,current:null,loadingRequestId:null,pendingUpdate:null},eb={lastInitializedDefaultListOfLists:nc,byUrl:Object(X.a)(Object(X.a)({},nc.reduce((function(e,n){return e[n]=Zd,e}),{})),{},Object(y.a)({},ec,{error:null,current:tc,loadingRequestId:null,pendingUpdate:null})),selectedListUrl:ec},nb=Object(Ce.c)(eb,(function(e){return e.addCase(Ye.pending,(function(e,n){var t=n.payload,r=t.requestId,i=t.url;e.byUrl[i]=Object(X.a)(Object(X.a)({current:null,pendingUpdate:null},e.byUrl[i]),{},{loadingRequestId:r,error:null})})).addCase(Ye.fulfilled,(function(e,n){var t,r,i=n.payload,a=i.requestId,c=i.tokenList,o=i.url,s=null===(t=e.byUrl[o])||void 0===t?void 0:t.current,u=null===(r=e.byUrl[o])||void 0===r?void 0:r.loadingRequestId;if(s){if(Object(_e.c)(s.version,c.version)===_e.a.NONE)return;null!==u&&u!==a||(e.byUrl[o]=Object(X.a)(Object(X.a)({},e.byUrl[o]),{},{loadingRequestId:null,error:null,current:s,pendingUpdate:c}))}else e.byUrl[o]=Object(X.a)(Object(X.a)({},e.byUrl[o]),{},{loadingRequestId:null,error:null,current:c,pendingUpdate:null})})).addCase(Ye.rejected,(function(e,n){var t,r=n.payload,i=r.url,a=r.requestId,c=r.errorMessage;(null===(t=e.byUrl[i])||void 0===t?void 0:t.loadingRequestId)===a&&(e.byUrl[i]=Object(X.a)(Object(X.a)({},e.byUrl[i]),{},{loadingRequestId:null,error:c,current:null,pendingUpdate:null}))})).addCase(We,(function(e,n){var t=n.payload;e.selectedListUrl=t,e.byUrl[t]||(e.byUrl[t]=Zd)})).addCase(qe,(function(e,n){var t=n.payload;e.byUrl[t]||(e.byUrl[t]=Zd)})).addCase(Ve,(function(e,n){var t=n.payload;e.byUrl[t]&&delete e.byUrl[t],e.selectedListUrl===t&&(e.selectedListUrl=Object.keys(e.byUrl)[0])})).addCase(Fe,(function(e,n){var t,r=n.payload;if(!(null===(t=e.byUrl[r])||void 0===t?void 0:t.pendingUpdate))throw new Error("accept list update called without pending update");e.byUrl[r]=Object(X.a)(Object(X.a)({},e.byUrl[r]),{},{pendingUpdate:null,current:e.byUrl[r].pendingUpdate})})).addCase(Yd,(function(e){if(e.lastInitializedDefaultListOfLists){if(e.lastInitializedDefaultListOfLists){var n=e.lastInitializedDefaultListOfLists.reduce((function(e,n){return e.add(n)}),new Set),t=nc.reduce((function(e,n){return e.add(n)}),new Set);nc.forEach((function(t){n.has(t)||(e.byUrl[t]=Zd)})),e.lastInitializedDefaultListOfLists.forEach((function(n){t.has(n)||delete e.byUrl[n]}))}}else e.byUrl=eb.byUrl,e.selectedListUrl=void 0;e.lastInitializedDefaultListOfLists=nc}))})),tb={independentField:_u.LIQUIDITY_PERCENT,typedValue:"0"},rb=Object(Ce.c)(tb,(function(e){return e.addCase(qu,(function(e,n){var t=n.payload,r=t.field,i=t.typedValue;return Object(X.a)(Object(X.a)({},e),{},{independentField:r,typedValue:i})}))})),ib=Object(Ce.c)({callResults:{}},(function(e){return e.addCase(Or,(function(e,n){var t,r=n.payload,i=r.calls,a=r.chainId,c=r.options,o=(c=void 0===c?{}:c).blocksPerFetch,s=void 0===o?1:o,u=e.callListeners?e.callListeners:e.callListeners={};u[a]=null!==(t=u[a])&&void 0!==t?t:{},i.forEach((function(e){var n,t,r=vr(e);u[a][r]=null!==(n=u[a][r])&&void 0!==n?n:{},u[a][r][s]=(null!==(t=u[a][r][s])&&void 0!==t?t:0)+1}))})).addCase(yr,(function(e,n){var t=n.payload,r=t.chainId,i=t.calls,a=t.options,c=(a=void 0===a?{}:a).blocksPerFetch,o=void 0===c?1:c,s=e.callListeners?e.callListeners:e.callListeners={};s[r]&&i.forEach((function(e){var n=vr(e);s[r][n]&&s[r][n][o]&&(1===s[r][n][o]?delete s[r][n][o]:s[r][n][o]--)}))})).addCase(xr,(function(e,n){var t,r=n.payload,i=r.chainId,a=r.fetchingBlockNumber,c=r.calls;e.callResults[i]=null!==(t=e.callResults[i])&&void 0!==t?t:{},c.forEach((function(n){var t=vr(n),r=e.callResults[i][t];if(r){var c;if((null!==(c=r.fetchingBlockNumber)&&void 0!==c?c:0)>=a)return;e.callResults[i][t].fetchingBlockNumber=a}else e.callResults[i][t]={fetchingBlockNumber:a}}))})).addCase(gr,(function(e,n){var t,r=n.payload,i=r.fetchingBlockNumber,a=r.chainId,c=r.calls;e.callResults[a]=null!==(t=e.callResults[a])&&void 0!==t?t:{},c.forEach((function(n){var t=vr(n),r=e.callResults[a][t];r&&r.fetchingBlockNumber===i&&(delete r.fetchingBlockNumber,r.data=null,r.blockNumber=i)}))})).addCase(Cr,(function(e,n){var t,r=n.payload,i=r.chainId,a=r.results,c=r.blockNumber;e.callResults[i]=null!==(t=e.callResults[i])&&void 0!==t?t:{},Object.keys(a).forEach((function(n){var t,r=e.callResults[i][n];(null!==(t=null===r||void 0===r?void 0:r.blockNumber)&&void 0!==t?t:0)>c||(e.callResults[i][n]={data:a[n],blockNumber:c})}))}))})),ab=["user","transactions"],cb=Object(Ld.load)({states:ab});cb.user&&(cb.user.userDarkMode=function(){var e=null;try{var n=localStorage.getItem(Qr);n&&(e=JSON.parse(n))}catch(t){console.error(t)}return e}());var ob=Object(Ce.a)({reducer:{application:_d,user:Hd,transactions:Gd,swap:Xd,mint:$d,burn:rb,multicall:ib,lists:nb,toasts:Hs},middleware:[].concat(Object(K.a)(Object(Ce.e)({thunk:!1})),[Object(Ld.save)({states:ab})]),preloadedState:cb});ob.dispatch(Yd());var sb=ob;function ub(e){var n=new x.a(e);return n.pollingInterval=15e3,n}var lb=Object(m.c)(de),db=function(e){var n=e.children;return Object(r.jsx)(m.b,{getLibrary:ub,children:Object(r.jsx)(lb,{getLibrary:ub,children:Object(r.jsx)(v.a,{store:sb,children:Object(r.jsx)(ud,{children:Object(r.jsx)(s.v,{children:n})})})})})},bb=(t(393),t(177)),pb=t(240),fb=t.n(pb),jb=t(241),hb=t.n(jb);bb.a.use(fb.a).use(hb.a).use($n.a).init({backend:{loadPath:"./locales/{{lng}}.json"},react:{useSuspense:!0},fallbackLng:"en",preload:["en"],keySeparator:!1,interpolation:{escapeValue:!1}});bb.a;"ethereum"in window&&(window.ethereum.autoRefreshOnNetworkChange=!1),window.addEventListener("error",(function(){var e;null===(e=localStorage)||void 0===e||e.removeItem("redux_localstorage_simple_lists")})),o.a.render(Object(r.jsx)(i.StrictMode,{children:Object(r.jsxs)(db,{children:[Object(r.jsxs)(r.Fragment,{children:[Object(r.jsx)(Rd,{}),Object(r.jsx)(Sd,{}),Object(r.jsx)(Md,{}),Object(r.jsx)(Pd,{}),Object(r.jsx)(Dd,{})]}),Object(r.jsx)(s.x,{}),Object(r.jsx)(p,{}),Object(r.jsx)(Td,{})]})}),document.getElementById("root"))}},[[410,2,3]]]); -//# sourceMappingURL=main.20ff5f10.chunk.js.map \ No newline at end of file diff --git a/pancake-swap-interface-v1/build/static/js/main.20ff5f10.chunk.js.map b/pancake-swap-interface-v1/build/static/js/main.20ff5f10.chunk.js.map deleted file mode 100644 index e88f2f8..0000000 --- a/pancake-swap-interface-v1/build/static/js/main.20ff5f10.chunk.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["style/Global.ts","connectors/NetworkConnector.ts","connectors/index.ts","constants/index.ts","hooks/index.ts","state/application/actions.ts","state/application/hooks.ts","components/Column/index.tsx","state/lists/actions.ts","utils/listVersionLabel.ts","components/Row/index.tsx","components/Popups/ListUpdatePopup.tsx","utils/index.ts","components/Shared/Common.tsx","components/Popups/TransactionPopup.tsx","components/Popups/PopupItem.tsx","components/Popups/index.tsx","components/Loader/index.tsx","components/Web3ReactManager/index.tsx","components/Card/index.tsx","components/Modal/index.tsx","components/TransactionConfirmationModal/helpers.tsx","components/TransactionConfirmationModal/ConfirmationPendingContent.tsx","components/TransactionConfirmationModal/TransactionSubmittedContent.tsx","components/TransactionConfirmationModal/TransactionConfirmationModal.tsx","components/TransactionConfirmationModal/ConfirmationModalContent.tsx","components/TransactionConfirmationModal/TransactionErrorContent.tsx","components/TransactionConfirmationModal/index.tsx","hooks/TranslationsContext.ts","utils/translateTextHelpers.ts","hooks/useI18n.ts","components/CardNav/index.tsx","constants/abis/erc20.ts","state/lists/hooks.ts","state/multicall/actions.ts","state/multicall/hooks.ts","state/user/actions.ts","utils/theme.ts","state/user/hooks.tsx","constants/multicall/index.ts","hooks/useContract.ts","hooks/Tokens.ts","state/wallet/hooks.ts","hooks/useLast.ts","utils/contenthashToUri.ts","utils/parseENSAddress.ts","utils/uriToHttp.ts","utils/isZero.ts","hooks/useHttpLocations.ts","hooks/useENSContentHash.ts","components/Logo/index.tsx","components/ListLogo/index.tsx","hooks/useInterval.ts","components/Popover/index.tsx","components/Tooltip/index.tsx","components/QuestionHelper/index.tsx","components/pancake/CoinLogo.ts","components/CurrencyLogo/index.tsx","components/SearchModal/CommonBases.tsx","components/SearchModal/styleds.tsx","components/SearchModal/CurrencyList.tsx","components/SearchModal/filtering.ts","components/SearchModal/SortButton.tsx","components/SearchModal/sorting.ts","components/SearchModal/CurrencySearch.tsx","constants/lists.ts","utils/getTokenList.ts","utils/resolveENSContentHash.ts","hooks/useFetchListCallback.ts","hooks/useOnClickOutside.tsx","components/SearchModal/ListSelect.tsx","hooks/useToggle.ts","components/SearchModal/CurrencySearchModal.tsx","components/DoubleLogo/index.tsx","components/NumericalInput/index.tsx","components/CurrencyInputPanel/index.tsx","components/NavigationTabs/index.tsx","data/TotalSupply.ts","utils/currencyId.ts","utils/wrappedCurrency.ts","components/swap/styleds.tsx","components/PositionCard/index.tsx","data/Reserves.ts","data/Allowances.ts","state/swap/actions.ts","state/transactions/actions.ts","state/transactions/hooks.tsx","utils/prices.ts","hooks/useApproveCallback.ts","state/mint/actions.ts","hooks/useDebounce.ts","hooks/useENS.ts","hooks/useENSName.ts","hooks/useENSAddress.ts","hooks/Trades.ts","state/swap/hooks.ts","hooks/useParsedQueryString.ts","state/mint/hooks.ts","utils/maxAmountSpend.ts","components/Pane/index.tsx","state/toasts/index.ts","hooks/useToast.ts","hooks/useAuth.ts","components/ConnectWalletButton/index.tsx","pages/AppBody.tsx","pages/Pool/styleds.tsx","pages/AddLiquidity/ConfirmAddModalBottom.tsx","pages/AddLiquidity/PoolPriceBar.tsx","pages/AddLiquidity/index.tsx","pages/AddLiquidity/redirects.tsx","pages/RemoveLiquidity/redirects.tsx","components/PageHeader/SlippageToleranceSetting.tsx","components/PageHeader/TransactionDeadlineSetting.tsx","components/PageHeader/AudioSetting.tsx","components/PageHeader/SettingsModal.tsx","components/PageHeader/RecentTransactionsModal.tsx","components/PageHeader/index.tsx","pages/PoolFinder/index.tsx","pages/Pool/index.tsx","components/Slider/index.tsx","state/burn/actions.ts","state/burn/hooks.ts","pages/RemoveLiquidity/index.tsx","utils/useDebouncedChangeHandler.ts","components/AddressInputPanel/index.tsx","components/swap/FormattedPriceImpact.tsx","components/swap/SwapModalFooter.tsx","components/swap/SwapModalHeader.tsx","components/swap/ConfirmSwapModal.tsx","components/swap/SwapRoute.tsx","components/swap/AdvancedSwapDetails.tsx","components/swap/AdvancedSwapDetailsDropdown.tsx","components/swap/TradePrice.tsx","components/TokenWarningModal/index.tsx","components/SyrupWarningModal/index.tsx","components/SafeMoonWarningModal/index.tsx","components/ProgressSteps/index.tsx","hooks/useSwapCallback.ts","hooks/useWrapCallback.ts","pages/Swap/index.tsx","components/swap/confirmPriceImpactWithoutFee.ts","pages/Swap/redirects.tsx","constants/localisation/languageCodes.ts","hooks/LanguageContext.ts","ThemeContext.tsx","hooks/useTheme.ts","hooks/useGetPriceData.ts","hooks/useGetLocalProfile.ts","components/Menu/config.ts","components/Menu/index.tsx","hooks/useGetDocumentTitlePrice.ts","pages/App.tsx","hooks/useIsWindowVisible.ts","state/application/updater.ts","state/lists/updater.ts","utils/retry.ts","state/multicall/updater.tsx","utils/chunkArray.ts","state/transactions/updater.tsx","components/ToastListener/index.tsx","state/application/reducer.ts","state/global/actions.ts","state/user/reducer.ts","state/transactions/reducer.ts","state/swap/reducer.ts","state/mint/reducer.ts","state/lists/reducer.ts","state/burn/reducer.ts","state/multicall/reducer.ts","state/index.ts","utils/getLibrary.ts","Providers.tsx","i18n.ts","index.tsx"],"names":["GlobalStyle","createGlobalStyle","theme","colors","background","RequestError","message","code","data","Error","MiniRpcProvider","chainId","url","batchWaitTimeMs","isMetaMask","host","path","nextId","batchTimeoutId","batch","clearBatch","a","fetch","method","headers","accept","body","JSON","stringify","map","item","request","response","forEach","reject","ok","status","statusText","json","byKey","reduce","memo","current","id","result","resolve","error","sendAsync","callback","params","then","jsonrpc","catch","toString","promise","Promise","push","setTimeout","this","parsed","URL","pathname","NetworkConnector","urls","defaultChainId","invariant","Object","keys","length","supportedChainIds","k","Number","providers","currentChainId","accumulator","provider","account","AbstractConnector","NETWORK_URL","process","NETWORK_CHAIN_ID","parseInt","networkLibrary","network","injected","InjectedConnector","bscConnector","BscConnector","walletconnect","WalletConnectConnector","rpc","bridge","qrcode","pollingInterval","connectorsByName","WalletLinkConnector","appName","appLogoUrl","ConnectorNames","Injected","WalletConnect","BSC","ROUTER_ADDRESS","CAKE","Token","ChainId","BSCTESTNET","WBNB","DAI","BUSD","USDT","ETH","WETH_ONLY","MAINNET","WETH","BASES_TO_CHECK_TRADES_AGAINST","CUSTOM_BASES","SUGGESTED_BASES","BASES_TO_TRACK_LIQUIDITY_FOR","PINNED_PAIRS","NetworkContextName","INITIAL_ALLOWED_SLIPPAGE","DEFAULT_DEADLINE_FROM_NOW","ONE_BIPS","Percent","JSBI","BigInt","BIPS_BASE","ALLOWED_PRICE_IMPACT_LOW","ALLOWED_PRICE_IMPACT_MEDIUM","ALLOWED_PRICE_IMPACT_HIGH","PRICE_IMPACT_WITHOUT_FEE_CONFIRM_MIN","BLOCKED_PRICE_IMPACT_NON_EXPERT","MIN_ETH","exponentiate","useActiveWeb3React","context","useWeb3ReactCore","contextNetwork","active","updateBlockNumber","createAction","toggleWalletModal","toggleSettingsMenu","addPopup","removePopup","useBlockNumber","useSelector","state","application","blockNumber","useRemovePopup","dispatch","useDispatch","useCallback","key","Column","styled","div","ColumnCenter","AutoColumn","gap","justify","fetchTokenList","pending","fulfilled","rejected","acceptListUpdate","addList","removeList","selectList","listVersionLabel","version","major","minor","patch","Row","Box","align","padding","border","borderRadius","RowBetween","RowFlat","AutoRow","RowFixed","ListUpdatePopup","popKey","listUrl","oldList","newList","auto","removeThisPopup","handleAcceptUpdate","useMemo","diffTokenLists","tokens","tokensAdded","added","tokensChanged","changed","tokensRemoved","removed","numTokensChanged","style","flex","name","fontSize","token","i","Fragment","title","address","symbol","flexGrow","marginRight","onClick","isAddress","value","getAddress","BSCSCAN_PREFIXES","56","97","getBscScanLink","type","prefix","shortenAddress","chars","substring","calculateGasMargin","mul","BigNumber","from","add","calculateSlippageAmount","slippage","divide","multiply","raw","getContract","ABI","library","AddressZero","Contract","getSigner","connectUnchecked","getProviderOrSigner","getRouterContract","_","IUniswapV2Router02ABI","LinkStyledButton","button","disabled","textSubtle","primary","StyledInternalLink","Link","StyledLink","ExternalLink","target","href","rel","rest","handleClick","event","ctrlKey","metaKey","preventDefault","rotate","keyframes","Spinner","img","RowNoFlex","TransactionPopup","hash","success","summary","useContext","ThemeContext","paddingRight","color","size","failure","slice","StyledClose","X","Popup","invertedContrast","mediaQueries","sm","Fader","tertiary","AnimatedFader","animated","PopupItem","removeAfterMs","content","useEffect","timeout","clearTimeout","popupContent","txn","listUpdate","faderStyle","useSpring","width","to","config","duration","undefined","MobilePopupWrapper","height","MobilePopupInner","FixedPopupColumn","Popups","activePopups","list","popupList","filter","show","useActivePopups","reverse","StyledSVG","svg","stroke","Loader","viewBox","fill","xmlns","d","strokeWidth","strokeLinecap","strokeLinejoin","MessageWrapper","Message","h2","primaryDark","Web3ReactManager","children","t","useTranslation","useWeb3React","networkActive","networkError","activateNetwork","activate","triedEager","useState","tried","setTried","isAuthorized","hasSignedIn","window","localStorage","getItem","connectorLocalStorageKey","isMobile","ethereum","useEagerConnect","suppress","on","handleChainChanged","e","console","handleAccountsChanged","accounts","removeListener","useInactiveListener","showLoader","setShowLoader","Card","LightCard","GreyCard","AnimatedDialogOverlay","DialogOverlay","StyledDialogOverlay","AnimatedDialogContent","DialogContent","StyledDialogContent","minHeight","maxHeight","mobile","isOpen","attrs","transparentize","css","lg","Modal","onDismiss","initialFocusRef","fadeTransition","useTransition","opacity","enter","leave","props","aria-label","tabIndex","Wrapper","Section","ConfirmedIcon","BottomSection","StyledContentHeader","Heading","ContentHeader","variant","CustomLightSpinner","ConfirmationPendingContent","pendingText","src","alt","TransactionSubmittedContent","mt","TransactionConfirmationModal","attemptingTxn","ConfirmationModalContent","bottomContent","topContent","TransactionErrorContent","marginTop","textAlign","defaultTranslationState","translations","setTranslations","TranslationsContext","createContext","variableRegex","getTranslation","translationId","fallback","foundTranslation","find","translation","stringId","translatedString","text","includes","stringToReplace","exec","indexToReplace","split","indexOf","fallbackValueAtIndex","replace","replaceDynamicString","TranslateString","useI18n","StyledNav","Nav","activeIndex","scale","as","ERC20_INTERFACE","Interface","ERC20_ABI","WrappedTokenInfo","tokenInfo","tags","decimals","logoURI","EMPTY_LIST","listCache","WeakMap","useTokenList","lists","byUrl","get","tokenMap","tagId","x","Boolean","set","listToTokenMap","useSelectedListUrl","selectedListUrl","useSelectedTokenList","ADDRESS_REGEX","LOWER_HEX_REGEX","toCallKey","call","test","callData","parseCallKey","callKey","pcs","addMulticallListeners","removeMulticallListeners","fetchingMulticallResults","errorFetchingMulticallResults","updateMulticallResults","isMethodArg","isValidMethodArgs","Array","isArray","every","xi","INVALID_RESULT","valid","NEVER_RELOAD","blocksPerFetch","Infinity","useCallsData","calls","options","callResults","multicall","serializedCallKeys","c","sort","callKeys","parse","INVALID_CALL_STATE","loading","syncing","LOADING_CALL_STATE","toCallState","callResult","contractInterface","fragment","latestBlockNumber","decodeFunctionResult","useMultipleContractSingleData","addresses","methodName","callInputs","getFunction","encodeFunctionData","results","useSingleCallResult","contract","inputs","interface","updateMatchesDarkMode","updateUserDarkMode","updateUserExpertMode","updateUserSlippageTolerance","updateUserDeadline","addSerializedToken","removeSerializedToken","addSerializedPair","removeSerializedPair","muteAudio","unmuteAudio","CACHE_KEY","serializeToken","deserializeToken","serializedToken","useIsExpertMode","user","userExpertMode","useUserSlippageTolerance","userSlippageTolerance","slippageTolerance","useUserDeadline","userDeadline","deadline","useUserAddedTokens","serializedTokensMap","values","serializePair","pair","token0","token1","toV2LiquidityToken","tokenA","tokenB","Pair","MULTICALL_NETWORKS","useContract","withSignerIfPossible","useTokenContract","tokenAddress","useENSRegistrarContract","ENS_ABI","useENSResolverContract","ENS_PUBLIC_RESOLVER_ABI","useMulticallContract","MULTICALL_ABI","useAllTokens","userAddedTokens","allTokens","BYTES32_REGEX","parseStringOrBytes32","str","bytes32","defaultValue","parseBytes32String","useToken","tokenContract","tokenContractBytes32","ERC20_BYTES32_ABI","useBytes32TokenContract","tokenName","tokenNameBytes32","symbolBytes32","useCurrency","currencyId","isBNB","toUpperCase","ETHER","useETHBalances","uncheckedAddresses","multicallContract","useSingleContractMultipleData","CurrencyAmount","ether","useTokenBalancesWithLoadingIndicator","validatedTokens","balances","vt","anyLoading","some","callState","amount","TokenAmount","useTokenBalances","useTokenBalance","tokenBalances","useCurrencyBalances","currencies","currency","ethBalance","useCurrencyBalance","useLast","filterFn","last","setLast","prev","isDefined","UTF_8_DECODER","TextDecoder","contenthashToUri","contenthash","buff","hex","startsWith","substr","arr","Uint8Array","hexToUint8Array","codec","getCodec","rmPrefix","cid","CID","toB58String","multihash","decode","digest","trim","ENS_NAME_REGEX","parseENSAddress","ensAddress","match","ensName","toLowerCase","ensPath","uriToHttp","uri","isZero","hexNumberString","useHttpLocations","ens","resolvedContentHash","ensNodeArgument","namehash","resolverAddressResult","resolverAddress","useENSContentHash","BAD_SRCS","Logo","srcs","refresh","s","onError","StyledListLogo","ListLogo","useInterval","delay","leading","savedCallback","useRef","tick","setInterval","clearInterval","PopoverContainer","ReferenceElement","Arrow","Popover","placement","referenceElement","setReferenceElement","popperElement","setPopperElement","arrowElement","setArrowElement","usePopper","strategy","modifiers","offset","element","styles","update","attributes","ref","popper","className","arrow","TooltipContainer","Tooltip","MouseoverTooltip","setShow","open","close","onMouseEnter","onMouseLeave","QuestionWrapper","QuestionHelper","marginLeft","CoinLogo","getTokenLogoURL","StyledBnbLogo","StyledLogo","CurrencyLogo","uriLocations","BaseWrapper","disable","CommonBases","onSelect","selectedCurrency","currencyEquals","selected","FadedSpan","PaddedColumn","MenuItem","SearchInput","input","textDisabled","Separator","SeparatorDark","currencyKey","StyledBalanceText","Text","Tag","Balance","balance","toExact","toSignificant","TagContainer","TokenTags","tag","description","join","CurrencyRow","isSelected","otherSelected","isOnSelectedList","defaultTokens","isTokenOnList","customAdded","useIsUserAddedToken","removeToken","useRemoveUserAddedToken","addToken","useAddUserToken","stopPropagation","justifySelf","CurrencyList","onCurrencySelect","otherCurrency","fixedListRef","showETH","itemData","Currency","index","itemKey","itemCount","itemSize","filterTokens","search","searchingAddress","lowerSearchParts","matchesSearch","sParts","p","sp","endsWith","FilterWrapper","SortButton","toggleSortOrder","ascending","useTokenComparator","inverted","useAllTokenBalances","comparator","balanceA","balanceB","balanceComp","greaterThan","equalTo","getTokenComparator","CurrencySearch","otherSelectedCurrency","showCommonBases","onChangeList","fixedList","searchQuery","setSearchQuery","invertSearchOrder","setInvertSearchOrder","isAddressSearch","searchToken","tokenComparator","audioPlay","filteredTokens","filteredSortedTokens","sorted","symbolMatch","handleCurrencySelect","audio","document","getElementById","play","inputRef","handleInput","checksummedInput","scrollTo","handleEnter","selectedUrl","listsByUrl","pendingUpdate","loadingRequestId","useSelectedListInfo","placeholder","onChange","onKeyDown","iso","disableWidth","DEFAULT_TOKEN_LIST_URL","DEFAULT_LIST_OF_LISTS","tokenListValidator","Ajv","allErrors","compile","schema","getTokenList","resolveENSContentHash","defaultTokenJson","parsedENS","contentHashUri","translatedUri","isLast","validationErrors","errors","dataPath","REGISTRAR_ABI","constant","outputs","payable","stateMutability","REGISTRAR_ADDRESS","RESOLVER_ABI","internalType","resolverContract","ensRegistrarContract","resolver","useFetchListCallback","ensResolver","Web3Provider","getNetworkLibrary","requestId","nanoid","tokenList","errorMessage","useOnClickOutside","node","handler","handlerRef","handleClickOutside","contains","addEventListener","removeEventListener","UnpaddedLinkStyledButton","StyledMenu","StyledListUrlText","ListOrigin","lowerListUrl","listUrlRowHTMLId","ListRow","onBack","initialState","setState","toggle","useToggle","selectThisList","handleAcceptListUpdate","handleRemoveList","prompt","bold","overflow","textOverflow","display","minWidth","ListContainer","ListSelect","listUrlInput","setListUrlInput","adding","addError","setAddError","fetchList","handleAddList","validUrl","handleEnterKey","sortedLists","u1","u2","l1","l2","cursor","maxWidth","CurrencySearchModal","listView","setListView","lastOpen","handleClickChangeList","handleClickBack","noListSelected","sizeraw","margin","HigherLogo","CoveredLogo","DoubleCurrencyLogo","currency0","currency1","StyledInput","inputRegex","RegExp","Input","React","onUserInput","nextUserInput","inputMode","autoComplete","autoCorrect","pattern","minLength","maxLength","spellCheck","InputRow","CurrencySelect","darken","LabelRow","Aligner","span","InputPanel","hideInput","Container","shadows","inset","CurrencyInputPanel","onMax","showMaxButton","label","disableCurrencySelect","hideBalance","modalOpen","setModalOpen","selectedCurrencyBalance","translatedLabel","handleDismissSearch","val","Tabs","ActiveText","StyledArrowLeft","ArrowLeft","FindPoolTabs","AddRemoveTabs","useTotalSupply","totalSupply","wrappedCurrency","wrappedCurrencyAmount","currencyAmount","unwrappedToken","equals","ArrowWrapper","clickable","SectionBreak","BottomGrouping","ErrorText","severity","binance","StyledBalanceMaxMini","Dots","SwapCallbackErrorInner","SwapCallbackErrorInnerAlertTriangle","SwapCallbackError","SwapShowAcceptChanges","FixedHeightRow","HoverCard","MinimalPositionCard","showUnwrapped","showMore","setShowMore","userPoolBalance","liquidityToken","totalPoolTokens","greaterThanOrEqual","getLiquidityValue","token0Deposited","token1Deposited","textTransform","fontWeight","ml","FullPositionCard","poolTokenPercentage","toFixed","PairState","PAIR_INTERFACE","IUniswapV2PairABI","usePairs","currencyA","currencyB","reserves","LOADING","INVALID","NOT_EXISTS","reserve0","reserve1","sortsBefore","EXISTS","usePair","useTokenAllowance","owner","spender","allowance","Field","selectCurrency","switchCurrencies","typeInput","replaceSwapState","setRecipient","addTransaction","clearAllTransactions","finalizeTransaction","checkedTransaction","useTransactionAdder","approval","useAllTransactions","transactions","isTransactionRecent","tx","Date","getTime","addedTime","ApprovalState","BASE_FEE","ONE_HUNDRED_PERCENT","INPUT_FRACTION_AFTER_FEE","subtract","computeTradePriceBreakdown","trade","realizedLPFee","route","pairs","currentFee","priceImpactWithoutFeeFraction","priceImpact","priceImpactWithoutFee","numerator","denominator","inputAmount","quotient","computeSlippageAdjustedAmounts","allowedSlippage","num","pct","Math","floor","INPUT","maximumAmountIn","OUTPUT","minimumAmountOut","warningSeverity","lessThan","formatExecutionPrice","executionPrice","invert","outputAmount","useApproveCallback","amountToApprove","currentAllowance","pendingApproval","allTransactions","receipt","useHasPendingApproval","approvalState","APPROVED","PENDING","NOT_APPROVED","UNKNOWN","approve","useExact","estimateGas","MaxUint256","estimatedGas","gasLimit","resetMintState","useDebounce","debouncedValue","setDebouncedValue","useENS","nameOrAddress","validated","reverseLookup","debouncedAddress","ENSName","useENSName","lookup","debouncedName","addr","useENSAddress","useAllCommonPairs","bases","basePairs","flatMap","base","otherBase","t0","t1","allPairs","customBases","customBasesA","customBasesB","curr","useSwapState","swap","tryParseAmount","typedValueParsed","parseUnits","info","BAD_RECIPIENT_ADDRESSES","involvesAddress","checksummedAddress","useDerivedSwapInfo","inputError","independentField","typedValue","inputCurrencyId","outputCurrencyId","recipient","inputCurrency","outputCurrency","recipientLookup","relevantTokenBalances","isExactIn","parsedAmount","bestTradeExactIn","currencyAmountIn","currencyOut","allowedPairs","Trade","maxHops","maxNumResults","useTradeExactIn","bestTradeExactOut","currencyIn","currencyAmountOut","useTradeExactOut","v2Trade","currencyBalances","formattedTo","slippageAdjustedAmounts","balanceIn","amountIn","parseCurrencyFromURLParameter","urlParam","queryParametersToSwapState","parsedQs","validatedRecipient","exactAmount","isNaN","parseFloat","parseIndependentFieldURLParameter","exactField","useDefaultsFromURLSearch","useLocation","parseArrays","ignoreQueryPrefix","useParsedQueryString","setResult","field","ZERO","useMintState","mint","maxAmountSpend","Pane","borderColor","toastsSlice","createSlice","reducers","action","payload","toastIndex","findIndex","toast","splice","unshift","remove","clear","actions","useToast","pushToast","toastError","kebabCase","toastTypes","DANGER","toastInfo","INFO","toastSuccess","SUCCESS","toastWarning","WARNING","removeToast","clearToast","useAuth","deactivate","login","connectorID","connector","removeItem","UnsupportedChainIdError","NoEthereumProviderError","NoBscProviderError","UserRejectedRequestErrorInjected","UserRejectedRequestErrorWalletConnect","walletConnectProvider","logout","UnlockButton","onPresentConnectModal","useWalletModal","BodyWrapper","AppBody","ClickableText","ConfirmAddModalBottom","noLiquidity","price","parsedAmounts","onAdd","CURRENCY_A","CURRENCY_B","justifyContent","PoolPriceBar","pt","AddLiquidity","currencyIdA","currencyIdB","history","oneCurrencyIsWBNB","expertMode","otherTypedValue","dependentField","pairState","equal","independentAmount","dependentAmount","wrappedIndependentAmount","dependentCurrency","dependentTokenAmount","priceOf","quote","currencyAAmount","currencyBAmount","Price","wrappedCurrencyA","liquidityMinted","tokenAmountA","tokenAmountB","getLiquidityMinted","useDerivedMintInfo","onFieldAInput","onFieldBInput","useMintActionHandlers","isValid","showConfirm","setShowConfirm","setAttemptingTxn","txHash","setTxHash","formattedAmounts","maxAmounts","atMaxAmounts","approvalA","approveACallback","approvalB","approveBCallback","router","parsedAmountA","parsedAmountB","amountsMin","deadlineFromNow","ceil","now","tokenBIsBNB","estimate","addLiquidityETH","args","addLiquidity","estimatedGasLimit","modalHeader","mr","small","fontStyle","modalBottom","handleCurrencyASelect","currA","newCurrencyIdA","handleCurrencyBSelect","currB","newCurrencyIdB","handleDismissConfirmation","CardNav","mb","ConnectWalletButton","OLD_PATH_STRUCTURE","RedirectOldAddLiquidityPathStructure","RedirectDuplicateTokenIds","RedirectOldRemoveLiquidityPathStructure","Option","Options","predefinedValues","SlippageToleranceSettings","translateString","setUserslippageTolerance","setValue","setError","rawValue","alignItems","predefinedValue","step","min","evt","inputValue","isWarning","TransactionDeadlineSetting","setDeadline","AudioSetting","useMatchBreakpoints","isSm","isXs","toggleSetAudioMode","useAudioModeManager","checked","defaultOnDismiss","SettingsModal","SlippageToleranceSetting","newTransactionsFirst","b","RecentTransactionsModal","sortedRecentTransactions","flexDirection","sortedRecentTransaction","icon","getRowStatus","Fields","StyledPageHeader","Details","PageHeader","useModal","onPresentSettings","onPresentRecentTransactions","Pool","trackedTokenPairs","pinnedPairs","generatedPairs","savedSerializedPairs","userPairs","forChain","pairId","combinedList","concat","keyed","useTrackedTokenPairs","tokenPairsWithLiquidityTokens","tpwlt","v2PairsBalances","fetchingV2PairBalances","liquidityTokensWithBalances","v2Pairs","v2IsLoading","V2Pair","allV2PairsWithLiquidity","v2Pair","PoolFinder","showSearch","setShowSearch","TOKEN1","activeField","setActiveField","setCurrency0","setCurrency1","addPair","serializedPair","usePairAdder","validPairNoLiquidity","position","hasPosition","TOKEN0","handleSearchDismiss","prerequisiteMessage","startIcon","endIcon","justifyItems","backgroundColor","StyledRangeInput","Slider","max","changeCallback","aria-labelledby","useBurnState","burn","OutlineCard","Body","RemoveLiquidity","userLiquidity","LIQUIDITY","liquidityValueA","liquidityValueB","liquidityValues","percentToRemove","LIQUIDITY_PERCENT","liquidityValue","useDerivedBurnInfo","_onUserInput","useBurnActionHandlers","showDetailed","setShowDetailed","atMaxAmount","pairContract","signatureData","setSignatureData","approveCallback","liquidityAmount","nonces","nonce","deadlineForSignature","EIP712Domain","domain","verifyingContract","Permit","toHexString","types","primaryType","send","splitSignature","signature","v","r","onLiquidityInput","onCurrencyAInput","onCurrencyBInput","onRemove","currencyAmountA","currencyAmountB","currencyBIsETH","oneCurrencyIsETH","methodNames","all","safeGasEstimates","indexOfSuccessfulEstimation","safeGasEstimate","isBigNumber","liquidityPercentChangeCallback","oneCurrencyIsWETH","handleSelectCurrencyA","handleSelectCurrencyB","debouncedMs","inner","setInner","timer","onChangeInner","newValue","useDebouncedChangeHandler","innerLiquidityPercentage","setInnerLiquidityPercentage","paddingBottom","ContainerRow","InputContainer","AddressInputPanel","withoutSpaces","autoCapitalize","FormattedPriceImpact","SwapModalFooter","onConfirm","swapErrorMessage","disabledConfirm","showInverted","setShowInverted","paddingLeft","tradeType","TradeType","EXACT_INPUT","PriceInfoText","SwapModalHeader","showAcceptChanges","onAcceptChanges","priceImpactSeverity","EXACT_OUTPUT","ConfirmSwapModal","originalTrade","tradeB","tradeA","confirmationContent","px","py","my","flexWrap","isLastItem","flexShrink","TradeSummary","AdvancedSwapDetails","showRoute","AdvancedDetailsFooter","AdvancedSwapDetailsDropdown","lastTrade","TradePrice","formattedPrice","baseCurrency","quoteCurrency","WarningContainer","StyledWarningIcon","AlertTriangle","TokenWarningCard","tokenSymbol","duplicateNameOrSymbol","userToken","TokenWarningModal","understandChecked","setUnderstandChecked","toggleUnderstand","uc","handleDismiss","htmlFor","userSelect","SyrupWarningModal","transactionType","SafeMoonWarningModal","SwapCallbackState","Grouping","Circle","confirmed","backgroundDisabled","CircleRow","Connector","prevConfirmed","ProgressCircles","steps","useSwapCallArguments","recipientAddressOrName","recipientAddress","swapMethods","Router","swapCallParameters","feeOnTransfer","ttl","parameters","useSwapCallback","swapCalls","VALID","gasEstimate","gasError","callStatic","callError","reason","estimatedCalls","successfulEstimation","el","ix","errorCalls","inputSymbol","outputSymbol","withRecipient","WrapType","NOT_APPLICABLE","wrapType","useWrapCallback","wethContract","WETH_ABI","useWETHContract","sufficientBalance","WRAP","execute","deposit","txReceipt","UNWRAP","withdraw","Swap","loadedUrlParams","loadedInputCurrency","loadedOutputCurrency","dismissTokenWarning","setDismissTokenWarning","selectedToken","purchaseType","transactionWarning","setTransactionWarning","urlLoadedTokens","handleConfirmTokenWarning","handleConfirmWarning","toggleSetExpertMode","useExpertModeManager","isExpertMode","swapInputError","onWrap","wrapInputError","showWrap","onCurrencySelection","onSwitchTokens","onChangeRecipient","useSwapActionHandlers","handleTypeInput","handleTypeOutput","tradeToConfirm","setSwapState","userHasSpecifiedInputOutput","noRoute","useApproveCallbackFromTrade","approvalSubmitted","setApprovalSubmitted","maxAmountInput","atMaxAmountInput","swapCallback","swapCallbackError","handleSwap","confirm","confirmPriceImpactWithoutFee","prevState","showApproveFlow","handleConfirmDismiss","handleAcceptChanges","checkForWarning","handleInputSelect","handleMaxInput","handleOutputSelect","RedirectPathToSwapOnly","location","EN","language","allLanguages","defaultLanguageState","selectedLanguage","setSelectedLanguage","translatedLanguage","setTranslatedLanguage","LanguageContext","isDark","toggleTheme","ThemeContextProvider","isDarkUserSetting","setIsDark","Provider","setItem","dark","light","useTheme","StyledThemeCopntext","useGetPriceData","setData","res","fetchData","profileLink","noProfileLink","useGetLocalProfile","profile","setProfile","localData","Cookies","localProfile","prevProfile","username","image","avatar","initialOpenState","items","Menu","priceData","cakePriceUsd","links","currentLang","langs","setLang","useGetDocumentTitlePrice","cakePriceUsdString","toLocaleString","minimumFractionDigits","maximumFractionDigits","AppWrapper","xs","Marginer","App","storedLangCode","storedLang","getStoredLang","langObject","exact","strict","component","VISIBILITY_STATE_SUPPORTED","isWindowVisible","visibilityState","useIsWindowVisible","focused","setFocused","listener","Updater","windowVisible","blockNumberCallback","getBlockNumber","debouncedState","bump","getVersionUpgrade","VersionUpgrade","NONE","PATCH","MINOR","minVersionBump","MAJOR","waitRandom","ms","round","random","CancelledError","RetryableError","chunk","minBlockNumber","aggregate","obj","resultsBlockNumber","returnData","toNumber","debouncedListeners","callListeners","cancellations","listeningKeys","allListeners","listeners","keyListeners","previousMin","activeListeningKeys","unserializedOutdatedCallKeys","minDataBlockNumber","fetchingBlockNumber","outdatedListeningKeys","serializedOutdatedCallKeys","outdatedCallKeys","chunkedCalls","maxChunkSize","numChunks","chunkSize","chunkArray","fn","rejectCancelled","n","minWait","maxWait","completed","cancel","retry","fetchChunk","fetchBlockNumber","firstCallKeyIndex","lastCallKeyIndex","lastBlockNumber","useAddPopup","lastCheckedBlockNumber","blocksSinceCheck","minutesPending","shouldCheck","getTransactionReceipt","blockHash","contractAddress","transactionHash","transactionIndex","ToastListener","toasts","createReducer","walletModalOpen","settingsMenuOpen","builder","addCase","popup","updateVersion","currentTimestamp","pairKey","token0Address","token1Address","userDarkMode","matchesDarkMode","timestamp","lastUpdateVersionTimestamp","tokenAAddress","tokenBAddress","txs","confirmedTime","otherField","NEW_LIST_STATE","lastInitializedDefaultListOfLists","DEFAULT_LIST","lastInitializedSet","l","Set","newListOfListsSet","has","PERSISTED_KEYS","loadedState","load","states","cache","rawCache","getThemeCache","store","configureStore","reducer","middleware","getDefaultMiddleware","thunk","save","preloadedState","getLibrary","Web3ProviderNetwork","createWeb3ReactRoot","Providers","i18next","use","XHR","LanguageDetector","initReactI18next","init","backend","loadPath","react","useSuspense","fallbackLng","preload","keySeparator","interpolation","escapeValue","autoRefreshOnNetworkChange","ReactDOM","render","Global"],"mappings":"2wuBAEA,I,EAWeA,EAXKC,4BAAH,KAEO,qBAAGC,MAAkBC,OAAOC,c,gMCc9CC,E,kDACJ,WAAYC,EAAwBC,EAAqBC,GAAiB,IAAD,8BACvE,cAAMF,IAD4BC,OAAqC,EAAhBC,OAAgB,E,sBADhDC,QAYrBC,EAmBJ,WAAYC,EAAiBC,EAAaC,GAA2B,IAAD,gCAlBpDC,YAAoB,EAkBgC,KAhBpDH,aAgBoD,OAdpDC,SAcoD,OAZpDG,UAYoD,OAVpDC,UAUoD,OARpDH,qBAQoD,OAN5DI,OAAS,EAMmD,KAJ5DC,eAAuD,KAIK,KAF5DC,MAAqB,GAEuC,KAUpDC,WAVoD,sBAUvC,sDAAAC,EAAA,6DACnBF,EAAU,EAAVA,MACR,EAAKA,MAAQ,GACb,EAAKD,eAAiB,KAHK,kBAMRI,MAAM,EAAKV,IAAK,CAC/BW,OAAQ,OACRC,QAAS,CAAE,eAAgB,mBAAoBC,OAAQ,oBACvDC,KAAMC,KAAKC,UAAUT,EAAMU,KAAI,SAACC,GAAD,OAAUA,EAAKC,cATvB,OAMzBC,EANyB,8DAYzBb,EAAMc,SAAQ,mBAAgBC,EAAhB,EAAGA,QAAoB,IAAIzB,MAAM,iC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AASQ,GAAWztD,GACjC,IAAMsK,EAAU,IAAImnB,IAAazxB,GAEjC,OADAsK,EAAQpJ,gBAAkB,KACnBoJ,ECIT,IAAMojD,GAAsBC,YAAoB9qD,IAgBjC+qD,GAda,SAAC,GAAkB,IAAhBr9C,EAAe,EAAfA,SAC7B,OACE,cAAC,IAAD,CAAmBk9C,WAAYA,GAA/B,SACE,cAACC,GAAD,CAAqBD,WAAYA,GAAjC,SACE,cAAC,IAAD,CAAUR,MAAOA,GAAjB,SACE,cAAC,GAAD,UACE,cAAC,IAAD,UAAgB18C,a,6DCZ5Bs9C,KACGC,IAAIC,MACJD,IAAIE,MACJF,IAAIG,MACJC,KAAK,CACJC,QAAS,CACPC,SAAS,0BAEXC,MAAO,CACLC,aAAa,GAEfC,YAAa,KACbC,QAAS,CAAC,MACVC,cAAc,EACdC,cAAe,CAAEC,aAAa,KAGnBd,GAAf,ECRI,aAAcx8C,SACfA,OAAOK,SAAiBk9C,4BAA6B,GAGxDv9C,OAAOghB,iBAAiB,SAAS,WAAO,IAAD,EACxB,QAAZ,EAAA/gB,oBAAA,SAAc62B,WAAW,sCAG5B0mB,IAASC,OACP,cAAC,aAAD,UACE,eAAC,GAAD,WACE,qCACE,cAAC,GAAD,IACA,cAAC,GAAD,IACA,cAAC,GAAD,IACA,cAAC,GAAD,IACA,cAAC,GAAD,OAEF,cAAC,IAAD,IACA,cAACC,EAAD,IACA,cAACvJ,GAAD,SAGJ/2B,SAASC,eAAe,W","file":"static/js/main.20ff5f10.chunk.js","sourcesContent":["import { createGlobalStyle } from 'styled-components'\n\nconst GlobalStyle = createGlobalStyle`\n body {\n background-color: ${({ theme }) => theme.colors.background};\n\n img {\n height: auto;\n max-width: 100%;\n }\n }\n`\n\nexport default GlobalStyle\n","import { ConnectorUpdate } from '@web3-react/types'\nimport { AbstractConnector } from '@web3-react/abstract-connector'\nimport invariant from 'tiny-invariant'\n\ninterface NetworkConnectorArguments {\n urls: { [chainId: number]: string }\n defaultChainId?: number\n}\n\n// taken from ethers.js, compatible interface with web3 provider\ntype AsyncSendable = {\n isMetaMask?: boolean\n host?: string\n path?: string\n sendAsync?: (request: any, callback: (error: any, response: any) => void) => void\n send?: (request: any, callback: (error: any, response: any) => void) => void\n}\n\nclass RequestError extends Error {\n constructor(message: string, public code: number, public data?: unknown) {\n super(message)\n }\n}\n\ninterface BatchItem {\n request: { jsonrpc: '2.0'; id: number; method: string; params: unknown }\n resolve: (result: any) => void\n reject: (error: Error) => void\n}\n\nclass MiniRpcProvider implements AsyncSendable {\n public readonly isMetaMask: false = false\n\n public readonly chainId: number\n\n public readonly url: string\n\n public readonly host: string\n\n public readonly path: string\n\n public readonly batchWaitTimeMs: number\n\n private nextId = 1\n\n private batchTimeoutId: ReturnType | null = null\n\n private batch: BatchItem[] = []\n\n constructor(chainId: number, url: string, batchWaitTimeMs?: number) {\n this.chainId = chainId\n this.url = url\n const parsed = new URL(url)\n this.host = parsed.host\n this.path = parsed.pathname\n // how long to wait to batch calls\n this.batchWaitTimeMs = batchWaitTimeMs ?? 50\n }\n\n public readonly clearBatch = async () => {\n const { batch } = this\n this.batch = []\n this.batchTimeoutId = null\n let response: Response\n try {\n response = await fetch(this.url, {\n method: 'POST',\n headers: { 'content-type': 'application/json', accept: 'application/json' },\n body: JSON.stringify(batch.map((item) => item.request)),\n })\n } catch (error) {\n batch.forEach(({ reject }) => reject(new Error('Failed to send batch call')))\n return\n }\n\n if (!response.ok) {\n batch.forEach(({ reject }) => reject(new RequestError(`${response.status}: ${response.statusText}`, -32000)))\n return\n }\n\n let json\n try {\n json = await response.json()\n } catch (error) {\n batch.forEach(({ reject }) => reject(new Error('Failed to parse JSON response')))\n return\n }\n const byKey = batch.reduce<{ [id: number]: BatchItem }>((memo, current) => {\n memo[current.request.id] = current\n return memo\n }, {})\n // eslint-disable-next-line no-restricted-syntax\n for (const result of json) {\n const {\n resolve,\n reject,\n request: { method },\n } = byKey[result.id]\n if (resolve && reject) {\n if ('error' in result) {\n reject(new RequestError(result?.error?.message, result?.error?.code, result?.error?.data))\n } else if ('result' in result) {\n resolve(result.result)\n } else {\n reject(new RequestError(`Received unexpected JSON-RPC response to ${method} request.`, -32000, result))\n }\n }\n }\n }\n\n public readonly sendAsync = (\n request: { jsonrpc: '2.0'; id: number | string | null; method: string; params?: any },\n callback: (error: any, response: any) => void\n ): void => {\n this.request(request.method, request.params)\n .then((result) => callback(null, { jsonrpc: '2.0', id: request.id, result }))\n .catch((error) => callback(error, null))\n }\n\n public readonly request = async (\n method: string | { method: string; params: unknown[] },\n params?: any\n ): Promise => {\n if (typeof method !== 'string') {\n return this.request(method.method, method.params)\n }\n if (method === 'eth_chainId') {\n return `0x${this.chainId.toString(16)}`\n }\n const promise = new Promise((resolve, reject) => {\n this.batch.push({\n request: {\n jsonrpc: '2.0',\n id: this.nextId++,\n method,\n params,\n },\n resolve,\n reject,\n })\n })\n this.batchTimeoutId = this.batchTimeoutId ?? setTimeout(this.clearBatch, this.batchWaitTimeMs)\n return promise\n }\n}\n\nexport class NetworkConnector extends AbstractConnector {\n private readonly providers: { [chainId: number]: MiniRpcProvider }\n\n private currentChainId: number\n\n constructor({ urls, defaultChainId }: NetworkConnectorArguments) {\n invariant(defaultChainId || Object.keys(urls).length === 1, 'defaultChainId is a required argument with >1 url')\n super({ supportedChainIds: Object.keys(urls).map((k): number => Number(k)) })\n\n this.currentChainId = defaultChainId || Number(Object.keys(urls)[0])\n this.providers = Object.keys(urls).reduce<{ [chainId: number]: MiniRpcProvider }>((accumulator, chainId) => {\n accumulator[Number(chainId)] = new MiniRpcProvider(Number(chainId), urls[Number(chainId)])\n return accumulator\n }, {})\n }\n\n public get provider(): MiniRpcProvider {\n return this.providers[this.currentChainId]\n }\n\n public async activate(): Promise {\n return { provider: this.providers[this.currentChainId], chainId: this.currentChainId, account: null }\n }\n\n public async getProvider(): Promise {\n return this.providers[this.currentChainId]\n }\n\n public async getChainId(): Promise {\n return this.currentChainId\n }\n\n public async getAccount(): Promise {\n return null\n }\n\n public deactivate() {\n return null\n }\n}\n\nexport default NetworkConnector\n","import { ConnectorNames } from '@pancakeswap-libs/uikit'\nimport { Web3Provider } from '@ethersproject/providers'\nimport { InjectedConnector } from '@web3-react/injected-connector'\nimport { WalletConnectConnector } from '@web3-react/walletconnect-connector'\nimport { WalletLinkConnector } from '@web3-react/walletlink-connector'\nimport { BscConnector } from '@binance-chain/bsc-connector'\nimport { NetworkConnector } from './NetworkConnector'\n\nconst NETWORK_URL = process.env.REACT_APP_NETWORK_URL\n\nexport const NETWORK_CHAIN_ID: number = parseInt(process.env.REACT_APP_CHAIN_ID ?? '97')\n\nif (typeof NETWORK_URL === 'undefined') {\n throw new Error(`REACT_APP_NETWORK_URL must be a defined environment variable`)\n}\n\nexport const network = new NetworkConnector({\n urls: { [NETWORK_CHAIN_ID]: NETWORK_URL },\n})\n\nlet networkLibrary: Web3Provider | undefined\nexport function getNetworkLibrary(): Web3Provider {\n // eslint-disable-next-line no-return-assign\n return (networkLibrary = networkLibrary ?? new Web3Provider(network.provider as any))\n}\n\nexport const injected = new InjectedConnector({\n supportedChainIds: [97],\n})\n\nexport const bscConnector = new BscConnector({ supportedChainIds: [97] })\n\n// mainnet only\nexport const walletconnect = new WalletConnectConnector({\n rpc: { [NETWORK_CHAIN_ID]: NETWORK_URL },\n bridge: 'https://bridge.walletconnect.org',\n qrcode: true,\n pollingInterval: 15000,\n})\n\n// mainnet only\nexport const walletlink = new WalletLinkConnector({\n url: NETWORK_URL,\n appName: 'Uniswap',\n appLogoUrl:\n 'https://mpng.pngfly.com/20181202/bex/kisspng-emoji-domain-unicorn-pin-badges-sticker-unicorn-tumblr-emoji-unicorn-iphoneemoji-5c046729264a77.5671679315437924251569.jpg',\n})\n\nexport const connectorsByName: { [connectorName in ConnectorNames]: any } = {\n [ConnectorNames.Injected]: injected,\n [ConnectorNames.WalletConnect]: walletconnect,\n [ConnectorNames.BSC]: bscConnector,\n}\n","import { ChainId, JSBI, Percent, Token, WETH } from '@pancakeswap-libs/sdk'\n\nexport const ROUTER_ADDRESS = '0xCc7aDc94F3D80127849D2b41b6439b7CF1eB4Ae0'\n\n// a list of tokens by chain\ntype ChainTokenList = {\n readonly [chainId in ChainId]: Token[]\n}\n\nexport const CAKE = new Token(ChainId.BSCTESTNET, '0xB8F5B50ed77596b5E638359d828000747bb3dd89', 18, 'CAKE', 'PancakeSwap Token')\nexport const WBNB = new Token(ChainId.BSCTESTNET, '0x0dE8FCAE8421fc79B29adE9ffF97854a424Cad09', 18, 'WBNB', 'Wrapped BNB')\nexport const DAI = new Token(ChainId.BSCTESTNET, '0x3Cf204795c4995cCf9C1a0B3191F00c01B03C56C', 18, 'DAI', 'Dai Stablecoin')\nexport const BUSD = new Token(ChainId.BSCTESTNET, '0xE0dFffc2E01A7f051069649aD4eb3F518430B6a4', 18, 'BUSD', 'Binance USD')\nexport const USDT = new Token(ChainId.BSCTESTNET, '0x7afd064DaE94d73ee37d19ff2D264f5A2903bBB0', 18, 'USDT', 'Tether USD')\nexport const ETH = new Token(ChainId.BSCTESTNET, '0xE282a15DBad45e3131620C1b8AF85B7330Cb3b4B', 18, 'ETH', 'Binance-Peg Ethereum Token')\n\nconst WETH_ONLY: ChainTokenList = {\n [ChainId.MAINNET]: [WETH[ChainId.MAINNET]],\n [ChainId.BSCTESTNET]: [WETH[ChainId.BSCTESTNET]],\n}\n\n// used to construct intermediary pairs for trading\nexport const BASES_TO_CHECK_TRADES_AGAINST: ChainTokenList = {\n ...WETH_ONLY,\n [ChainId.BSCTESTNET]: [...WETH_ONLY[ChainId.BSCTESTNET], DAI, BUSD, USDT, ETH],\n}\n\n/**\n * Some tokens can only be swapped via certain pairs, so we override the list of bases that are considered for these\n * tokens.\n */\nexport const CUSTOM_BASES: { [chainId in ChainId]?: { [tokenAddress: string]: Token[] } } = {\n [ChainId.BSCTESTNET]: {},\n}\n\n// used for display in the default list when adding liquidity\nexport const SUGGESTED_BASES: ChainTokenList = {\n ...WETH_ONLY,\n [ChainId.BSCTESTNET]: [...WETH_ONLY[ChainId.BSCTESTNET], DAI, BUSD, USDT],\n}\n\n// used to construct the list of all pairs we consider by default in the frontend\nexport const BASES_TO_TRACK_LIQUIDITY_FOR: ChainTokenList = {\n ...WETH_ONLY,\n [ChainId.BSCTESTNET]: [...WETH_ONLY[ChainId.BSCTESTNET], DAI, BUSD, USDT],\n}\n\nexport const PINNED_PAIRS: { readonly [chainId in ChainId]?: [Token, Token][] } = {\n [ChainId.BSCTESTNET]: [\n [CAKE, WBNB],\n [BUSD, USDT],\n [DAI, USDT],\n ],\n}\n\nexport const NetworkContextName = 'NETWORK'\n\n// default allowed slippage, in bips\nexport const INITIAL_ALLOWED_SLIPPAGE = 80\n// 20 minutes, denominated in seconds\nexport const DEFAULT_DEADLINE_FROM_NOW = 60 * 20\n\n// one basis point\nexport const ONE_BIPS = new Percent(JSBI.BigInt(1), JSBI.BigInt(10000))\nexport const BIPS_BASE = JSBI.BigInt(10000)\n// used for warning states\nexport const ALLOWED_PRICE_IMPACT_LOW: Percent = new Percent(JSBI.BigInt(100), BIPS_BASE) // 1%\nexport const ALLOWED_PRICE_IMPACT_MEDIUM: Percent = new Percent(JSBI.BigInt(300), BIPS_BASE) // 3%\nexport const ALLOWED_PRICE_IMPACT_HIGH: Percent = new Percent(JSBI.BigInt(500), BIPS_BASE) // 5%\n// if the price slippage exceeds this number, force the user to type 'confirm' to execute\nexport const PRICE_IMPACT_WITHOUT_FEE_CONFIRM_MIN: Percent = new Percent(JSBI.BigInt(1000), BIPS_BASE) // 10%\n// for non expert mode disable swaps above this\nexport const BLOCKED_PRICE_IMPACT_NON_EXPERT: Percent = new Percent(JSBI.BigInt(1500), BIPS_BASE) // 15%\n\n// used to ensure the user doesn't send so much ETH so they end up with <.01\nexport const MIN_ETH: JSBI = JSBI.exponentiate(JSBI.BigInt(10), JSBI.BigInt(16)) // .01 ETH\n","import { Web3Provider } from '@ethersproject/providers'\nimport { ChainId } from '@pancakeswap-libs/sdk'\nimport { connectorLocalStorageKey } from '@pancakeswap-libs/uikit'\nimport { useWeb3React as useWeb3ReactCore } from '@web3-react/core'\n// eslint-disable-next-line import/no-unresolved\nimport { Web3ReactContextInterface } from '@web3-react/core/dist/types'\nimport { useEffect, useState } from 'react'\nimport { isMobile } from 'react-device-detect'\nimport { injected } from '../connectors'\nimport { NetworkContextName } from '../constants'\n\nexport function useActiveWeb3React(): Web3ReactContextInterface & { chainId?: ChainId } {\n const context = useWeb3ReactCore()\n const contextNetwork = useWeb3ReactCore(NetworkContextName)\n return context.active ? context : contextNetwork\n}\n\nexport function useEagerConnect() {\n const { activate, active } = useWeb3ReactCore() // specifically using useWeb3ReactCore because of what this hook does\n const [tried, setTried] = useState(false)\n\n useEffect(() => {\n injected.isAuthorized().then((isAuthorized) => {\n const hasSignedIn = window.localStorage.getItem(connectorLocalStorageKey)\n if (isAuthorized && hasSignedIn) {\n activate(injected, undefined, true).catch(() => {\n setTried(true)\n })\n } else if (isMobile && window.ethereum && hasSignedIn) {\n activate(injected, undefined, true).catch(() => {\n setTried(true)\n })\n } else {\n setTried(true)\n }\n })\n }, [activate]) // intentionally only running on mount (make sure it's only mounted once :))\n\n // if the connection worked, wait until we get confirmation of that to flip the flag\n useEffect(() => {\n if (active) {\n setTried(true)\n }\n }, [active])\n\n return tried\n}\n\n/**\n * Use for network and injected - logs user in\n * and out after checking what network theyre on\n */\nexport function useInactiveListener(suppress = false) {\n const { active, error, activate } = useWeb3ReactCore() // specifically using useWeb3React because of what this hook does\n\n useEffect(() => {\n const { ethereum } = window\n\n if (ethereum && ethereum.on && !active && !error && !suppress) {\n const handleChainChanged = () => {\n // eat errors\n activate(injected, undefined, true).catch((e) => {\n console.error('Failed to activate after chain changed', e)\n })\n }\n\n const handleAccountsChanged = (accounts: string[]) => {\n if (accounts.length > 0) {\n // eat errors\n activate(injected, undefined, true).catch((e) => {\n console.error('Failed to activate after accounts changed', e)\n })\n }\n }\n\n ethereum.on('chainChanged', handleChainChanged)\n ethereum.on('accountsChanged', handleAccountsChanged)\n\n return () => {\n if (ethereum.removeListener) {\n ethereum.removeListener('chainChanged', handleChainChanged)\n ethereum.removeListener('accountsChanged', handleAccountsChanged)\n }\n }\n }\n return undefined\n }, [active, error, suppress, activate])\n}\n","import { createAction } from '@reduxjs/toolkit'\nimport { TokenList } from '@uniswap/token-lists'\n\nexport type PopupContent =\n | {\n txn: {\n hash: string\n success: boolean\n summary?: string\n }\n }\n | {\n listUpdate: {\n listUrl: string\n oldList: TokenList\n newList: TokenList\n auto: boolean\n }\n }\n\nexport const updateBlockNumber = createAction<{ chainId: number; blockNumber: number }>('app/updateBlockNumber')\nexport const toggleWalletModal = createAction('app/toggleWalletModal')\nexport const toggleSettingsMenu = createAction('app/toggleSettingsMenu')\nexport const addPopup = createAction<{ key?: string; removeAfterMs?: number | null; content: PopupContent }>(\n 'app/addPopup'\n)\nexport const removePopup = createAction<{ key: string }>('app/removePopup')\n","import { useCallback, useMemo } from 'react'\nimport { useSelector, useDispatch } from 'react-redux'\nimport { useActiveWeb3React } from '../../hooks'\nimport { addPopup, PopupContent, removePopup, toggleWalletModal, toggleSettingsMenu } from './actions'\nimport { AppState } from '../index'\n\nexport function useBlockNumber(): number | undefined {\n const { chainId } = useActiveWeb3React()\n\n return useSelector((state: AppState) => state.application.blockNumber[chainId ?? -1])\n}\n\nexport function useWalletModalOpen(): boolean {\n return useSelector((state: AppState) => state.application.walletModalOpen)\n}\n\nexport function useWalletModalToggle(): () => void {\n const dispatch = useDispatch()\n return useCallback(() => dispatch(toggleWalletModal()), [dispatch])\n}\n\nexport function useSettingsMenuOpen(): boolean {\n return useSelector((state: AppState) => state.application.settingsMenuOpen)\n}\n\nexport function useToggleSettingsMenu(): () => void {\n const dispatch = useDispatch()\n return useCallback(() => dispatch(toggleSettingsMenu()), [dispatch])\n}\n\n// returns a function that allows adding a popup\nexport function useAddPopup(): (content: PopupContent, key?: string) => void {\n const dispatch = useDispatch()\n\n return useCallback(\n (content: PopupContent, key?: string) => {\n dispatch(addPopup({ content, key }))\n },\n [dispatch]\n )\n}\n\n// returns a function that allows removing a popup via its key\nexport function useRemovePopup(): (key: string) => void {\n const dispatch = useDispatch()\n return useCallback(\n (key: string) => {\n dispatch(removePopup({ key }))\n },\n [dispatch]\n )\n}\n\n// get the list of active popups\nexport function useActivePopups(): AppState['application']['popupList'] {\n const list = useSelector((state: AppState) => state.application.popupList)\n return useMemo(() => list.filter(item => item.show), [list])\n}\n","import styled from 'styled-components'\n\nconst Column = styled.div`\n display: flex;\n flex-direction: column;\n justify-content: flex-start;\n`\nexport const ColumnCenter = styled(Column)`\n width: 100%;\n align-items: center;\n`\n\nexport const AutoColumn = styled.div<{\n gap?: 'sm' | 'md' | 'lg' | string\n justify?: 'stretch' | 'center' | 'start' | 'end' | 'flex-start' | 'flex-end' | 'space-between'\n}>`\n display: grid;\n grid-auto-rows: auto;\n grid-row-gap: ${({ gap }) => (gap === 'sm' && '8px') || (gap === 'md' && '12px') || (gap === 'lg' && '24px') || gap};\n justify-items: ${({ justify }) => justify && justify};\n`\n\nexport default Column\n","import { ActionCreatorWithPayload, createAction } from '@reduxjs/toolkit'\nimport { TokenList, Version } from '@uniswap/token-lists'\n\nexport const fetchTokenList: Readonly<{\n pending: ActionCreatorWithPayload<{ url: string; requestId: string }>\n fulfilled: ActionCreatorWithPayload<{ url: string; tokenList: TokenList; requestId: string }>\n rejected: ActionCreatorWithPayload<{ url: string; errorMessage: string; requestId: string }>\n}> = {\n pending: createAction('lists/fetchTokenList/pending'),\n fulfilled: createAction('lists/fetchTokenList/fulfilled'),\n rejected: createAction('lists/fetchTokenList/rejected')\n}\n\nexport const acceptListUpdate = createAction('lists/acceptListUpdate')\nexport const addList = createAction('lists/addList')\nexport const removeList = createAction('lists/removeList')\nexport const selectList = createAction('lists/selectList')\nexport const rejectVersionUpdate = createAction('lists/rejectVersionUpdate')\n","import { Version } from '@uniswap/token-lists'\n\nexport default function listVersionLabel(version: Version): string {\n return `v${version.major}.${version.minor}.${version.patch}`\n}\n","import styled from 'styled-components'\nimport { Box } from 'rebass/styled-components'\n\nconst Row = styled(Box)<{ align?: string; padding?: string; border?: string; borderRadius?: string }>`\n width: 100%;\n display: flex;\n padding: 0;\n align-items: ${({ align }) => (align || 'center')};\n padding: ${({ padding }) => padding};\n border: ${({ border }) => border};\n border-radius: ${({ borderRadius }) => borderRadius};\n`\n\nexport const RowBetween = styled(Row)`\n justify-content: space-between;\n`\n\nexport const RowFlat = styled.div`\n display: flex;\n align-items: flex-end;\n`\n\nexport const AutoRow = styled(Row)<{ gap?: string; justify?: string }>`\n flex-wrap: wrap;\n margin: ${({ gap }) => gap && `-${gap}`};\n justify-content: ${({ justify }) => justify && justify};\n\n & > * {\n margin: ${({ gap }) => gap} !important;\n }\n`\n\nexport const RowFixed = styled(Row)<{ gap?: string; justify?: string }>`\n width: fit-content;\n margin: ${({ gap }) => gap && `-${gap}`};\n`\n\nexport default Row\n","import React, { useCallback, useMemo } from 'react'\nimport { diffTokenLists, TokenList } from '@uniswap/token-lists'\nimport { Button, Text } from '@pancakeswap-libs/uikit'\nimport { useDispatch } from 'react-redux'\nimport { AppDispatch } from '../../state'\nimport { useRemovePopup } from '../../state/application/hooks'\nimport { acceptListUpdate } from '../../state/lists/actions'\nimport listVersionLabel from '../../utils/listVersionLabel'\nimport { AutoColumn } from '../Column'\nimport { AutoRow } from '../Row'\n\nexport default function ListUpdatePopup({\n popKey,\n listUrl,\n oldList,\n newList,\n auto,\n}: {\n popKey: string\n listUrl: string\n oldList: TokenList\n newList: TokenList\n auto: boolean\n}) {\n const removePopup = useRemovePopup()\n const removeThisPopup = useCallback(() => removePopup(popKey), [popKey, removePopup])\n const dispatch = useDispatch()\n\n const handleAcceptUpdate = useCallback(() => {\n if (auto) return\n dispatch(acceptListUpdate(listUrl))\n removeThisPopup()\n }, [auto, dispatch, listUrl, removeThisPopup])\n\n const { added: tokensAdded, changed: tokensChanged, removed: tokensRemoved } = useMemo(() => {\n return diffTokenLists(oldList.tokens, newList.tokens)\n }, [newList.tokens, oldList.tokens])\n const numTokensChanged = useMemo(\n () =>\n Object.keys(tokensChanged).reduce((memo, chainId: any) => memo + Object.keys(tokensChanged[chainId]).length, 0),\n [tokensChanged]\n )\n\n return (\n \n \n {auto ? (\n \n The token list "{oldList.name}" has been updated to{' '}\n {listVersionLabel(newList.version)}.\n \n ) : (\n <>\n
\n \n An update is available for the token list "{oldList.name}" (\n {listVersionLabel(oldList.version)} to {listVersionLabel(newList.version)}).\n \n
    \n {tokensAdded.length > 0 ? (\n
  • \n {tokensAdded.map((token, i) => (\n \n {token.symbol}\n {i === tokensAdded.length - 1 ? null : ', '}\n \n ))}{' '}\n added\n
  • \n ) : null}\n {tokensRemoved.length > 0 ? (\n
  • \n {tokensRemoved.map((token, i) => (\n \n {token.symbol}\n {i === tokensRemoved.length - 1 ? null : ', '}\n \n ))}{' '}\n removed\n
  • \n ) : null}\n {numTokensChanged > 0 ?
  • {numTokensChanged} tokens updated
  • : null}\n
\n
\n \n
\n \n
\n
\n \n
\n
\n \n )}\n
\n
\n )\n}\n","import { Contract } from '@ethersproject/contracts'\nimport { getAddress } from '@ethersproject/address'\nimport { AddressZero } from '@ethersproject/constants'\nimport { JsonRpcSigner, Web3Provider } from '@ethersproject/providers'\nimport { BigNumber } from '@ethersproject/bignumber'\nimport { abi as IUniswapV2Router02ABI } from '@uniswap/v2-periphery/build/IUniswapV2Router02.json'\nimport { ChainId, JSBI, Percent, Token, CurrencyAmount, Currency, ETHER } from '@pancakeswap-libs/sdk'\nimport { ROUTER_ADDRESS } from '../constants'\nimport { TokenAddressMap } from '../state/lists/hooks'\n\n// returns the checksummed address if the address is valid, otherwise returns false\nexport function isAddress(value: any): string | false {\n try {\n return getAddress(value)\n } catch {\n return false\n }\n}\n\nconst BSCSCAN_PREFIXES: { [chainId in ChainId]: string } = {\n 56: '',\n 97: 'testnet.'\n}\n\nexport function getBscScanLink(chainId: ChainId, data: string, type: 'transaction' | 'token' | 'address'): string {\n const prefix = `https://${BSCSCAN_PREFIXES[chainId] || BSCSCAN_PREFIXES[ChainId.MAINNET]}bscscan.com`\n\n switch (type) {\n case 'transaction': {\n return `${prefix}/tx/${data}`\n }\n case 'token': {\n return `${prefix}/token/${data}`\n }\n case 'address':\n default: {\n return `${prefix}/address/${data}`\n }\n }\n}\n\n// shorten the checksummed version of the input address to have 0x + 4 characters at start and end\nexport function shortenAddress(address: string, chars = 4): string {\n const parsed = isAddress(address)\n if (!parsed) {\n throw Error(`Invalid 'address' parameter '${address}'.`)\n }\n return `${parsed.substring(0, chars + 2)}...${parsed.substring(42 - chars)}`\n}\n\n// add 10%\nexport function calculateGasMargin(value: BigNumber): BigNumber {\n return value.mul(BigNumber.from(10000).add(BigNumber.from(1000))).div(BigNumber.from(10000))\n}\n\n// converts a basis points value to a sdk percent\nexport function basisPointsToPercent(num: number): Percent {\n return new Percent(JSBI.BigInt(Math.floor(num)), JSBI.BigInt(10000))\n}\n\nexport function calculateSlippageAmount(value: CurrencyAmount, slippage: number): [JSBI, JSBI] {\n if (slippage < 0 || slippage > 10000) {\n throw Error(`Unexpected slippage value: ${slippage}`)\n }\n return [\n JSBI.divide(JSBI.multiply(value.raw, JSBI.BigInt(10000 - slippage)), JSBI.BigInt(10000)),\n JSBI.divide(JSBI.multiply(value.raw, JSBI.BigInt(10000 + slippage)), JSBI.BigInt(10000))\n ]\n}\n\n// account is not optional\nexport function getSigner(library: Web3Provider, account: string): JsonRpcSigner {\n return library.getSigner(account).connectUnchecked()\n}\n\n// account is optional\nexport function getProviderOrSigner(library: Web3Provider, account?: string): Web3Provider | JsonRpcSigner {\n return account ? getSigner(library, account) : library\n}\n\n// account is optional\nexport function getContract(address: string, ABI: any, library: Web3Provider, account?: string): Contract {\n if (!isAddress(address) || address === AddressZero) {\n throw Error(`Invalid 'address' parameter '${address}'.`)\n }\n\n return new Contract(address, ABI, getProviderOrSigner(library, account) as any)\n}\n\n// account is optional\nexport function getRouterContract(_: number, library: Web3Provider, account?: string): Contract {\n return getContract(ROUTER_ADDRESS, IUniswapV2Router02ABI, library, account)\n}\n\nexport function escapeRegExp(string: string): string {\n return string.replace(/[.*+?^${}()|[\\]\\\\]/g, '\\\\$&') // $& means the whole matched string\n}\n\nexport function isTokenOnList(defaultTokens: TokenAddressMap, currency?: Currency): boolean {\n if (currency === ETHER) return true\n return Boolean(currency instanceof Token && defaultTokens[currency.chainId]?.[currency.address])\n}\n","import React, { HTMLProps, useCallback } from 'react'\nimport { Link } from 'react-router-dom'\nimport styled, { keyframes } from 'styled-components'\n\n// A button that triggers some onClick result, but looks like a link.\nexport const LinkStyledButton = styled.button<{ disabled?: boolean }>`\n border: none;\n text-decoration: none;\n background: none;\n\n cursor: ${({ disabled }) => (disabled ? 'default' : 'pointer')};\n color: ${({ theme, disabled }) => (disabled ? theme.colors.textSubtle : theme.colors.primary)};\n font-weight: 500;\n\n :hover {\n text-decoration: ${({ disabled }) => (disabled ? null : 'underline')};\n }\n\n :focus {\n outline: none;\n text-decoration: ${({ disabled }) => (disabled ? null : 'underline')};\n }\n\n :active {\n text-decoration: none;\n }\n`\n\n// An internal link from the react-router-dom library that is correctly styled\nexport const StyledInternalLink = styled(Link)`\n text-decoration: none;\n cursor: pointer;\n color: ${({ theme }) => theme.colors.primary};\n font-weight: 500;\n\n :hover {\n text-decoration: underline;\n }\n\n :focus {\n outline: none;\n text-decoration: underline;\n }\n\n :active {\n text-decoration: none;\n }\n`\n\nconst StyledLink = styled.a`\n text-decoration: none;\n cursor: pointer;\n color: ${({ theme }) => theme.colors.primary};\n font-weight: 500;\n\n :hover {\n text-decoration: underline;\n }\n\n :focus {\n outline: none;\n text-decoration: underline;\n }\n\n :active {\n text-decoration: none;\n }\n`\n\n/**\n * Outbound link that handles firing google analytics events\n */\nexport function ExternalLink({\n target = '_blank',\n href,\n rel = 'noopener noreferrer',\n ...rest\n}: Omit, 'as' | 'ref' | 'onClick'> & { href: string }) {\n const handleClick = useCallback(\n (event: React.MouseEvent) => {\n if (!(target === '_blank' || event.ctrlKey || event.metaKey)) {\n event.preventDefault()\n }\n },\n [target]\n )\n return \n}\n\nconst rotate = keyframes`\n from {\n transform: rotate(0deg);\n }\n to {\n transform: rotate(360deg);\n }\n`\n\nexport const Spinner = styled.img`\n animation: 2s ${rotate} linear infinite;\n width: 16px;\n height: 16px;\n`\n","import React, { useContext } from 'react'\nimport { AlertCircle, CheckCircle } from 'react-feather'\nimport { Text } from '@pancakeswap-libs/uikit'\nimport styled, { ThemeContext } from 'styled-components'\nimport { useActiveWeb3React } from '../../hooks'\nimport { getBscScanLink } from '../../utils'\nimport { ExternalLink } from '../Shared'\nimport { AutoColumn } from '../Column'\nimport { AutoRow } from '../Row'\n\nconst RowNoFlex = styled(AutoRow)`\n flex-wrap: nowrap;\n`\n\nexport default function TransactionPopup({\n hash,\n success,\n summary,\n}: {\n hash: string\n success?: boolean\n summary?: string\n}) {\n const { chainId } = useActiveWeb3React()\n\n const theme = useContext(ThemeContext)\n\n return (\n \n
\n {success ? (\n \n ) : (\n \n )}\n
\n \n {summary ?? `Hash: ${hash.slice(0, 8)}...${hash.slice(58, 65)}`}\n {chainId && View on bscscan}\n \n
\n )\n}\n","import React, { useCallback, useContext, useEffect } from 'react'\nimport { X } from 'react-feather'\nimport { useSpring } from 'react-spring/web'\nimport styled, { ThemeContext } from 'styled-components'\nimport { animated } from 'react-spring'\nimport { PopupContent } from '../../state/application/actions'\nimport { useRemovePopup } from '../../state/application/hooks'\nimport ListUpdatePopup from './ListUpdatePopup'\nimport TransactionPopup from './TransactionPopup'\n\nexport const StyledClose = styled(X)`\n position: absolute;\n right: 10px;\n top: 10px;\n\n :hover {\n cursor: pointer;\n }\n`\nexport const Popup = styled.div`\n display: inline-block;\n width: 100%;\n padding: 1em;\n background-color: ${({ theme }) => theme.colors.invertedContrast};\n position: relative;\n border-radius: 10px;\n padding: 20px;\n padding-right: 35px;\n overflow: hidden;\n\n ${({ theme }) => theme.mediaQueries.sm} {\n min-width: 290px;\n }\n`\nconst Fader = styled.div`\n position: absolute;\n bottom: 0px;\n left: 0px;\n width: 100%;\n height: 2px;\n background-color: ${({ theme }) => theme.colors.tertiary};\n`\n\nconst AnimatedFader = animated(Fader)\n\nexport default function PopupItem({\n removeAfterMs,\n content,\n popKey\n}: {\n removeAfterMs: number | null\n content: PopupContent\n popKey: string\n}) {\n const removePopup = useRemovePopup()\n const removeThisPopup = useCallback(() => removePopup(popKey), [popKey, removePopup])\n useEffect(() => {\n if (removeAfterMs === null) return undefined\n\n const timeout = setTimeout(() => {\n removeThisPopup()\n }, removeAfterMs)\n\n return () => {\n clearTimeout(timeout)\n }\n }, [removeAfterMs, removeThisPopup])\n\n const theme = useContext(ThemeContext)\n\n let popupContent\n if ('txn' in content) {\n const {\n txn: { hash, success, summary }\n } = content\n popupContent = \n } else if ('listUpdate' in content) {\n const {\n listUpdate: { listUrl, oldList, newList, auto }\n } = content\n popupContent = \n }\n\n const faderStyle = useSpring({\n from: { width: '100%' },\n to: { width: '0%' },\n config: { duration: removeAfterMs ?? undefined }\n })\n\n return (\n \n \n {popupContent}\n {removeAfterMs !== null ? : null}\n \n )\n}\n","import React from 'react'\nimport styled from 'styled-components'\nimport { useActivePopups } from '../../state/application/hooks'\nimport { AutoColumn } from '../Column'\nimport PopupItem from './PopupItem'\n\nconst MobilePopupWrapper = styled.div<{ height: string | number }>`\n position: relative;\n max-width: 100%;\n height: ${({ height }) => height};\n margin: ${({ height }) => (height ? '0 auto;' : 0)};\n margin-bottom: ${({ height }) => (height ? '20px' : 0)}};\n display: none;\n\n ${({ theme }) => theme.mediaQueries.sm} {\n display: block;\n }\n`\n\nconst MobilePopupInner = styled.div`\n height: 99%;\n overflow-x: auto;\n overflow-y: hidden;\n display: flex;\n flex-direction: row;\n -webkit-overflow-scrolling: touch;\n ::-webkit-scrollbar {\n display: none;\n }\n`\n\nconst FixedPopupColumn = styled(AutoColumn)`\n position: fixed;\n top: 64px;\n right: 1rem;\n max-width: 355px !important;\n width: 100%;\n z-index: 2;\n\n ${({ theme }) => theme.mediaQueries.sm} {\n display: none;\n }\n`\n\nexport default function Popups() {\n // get all popups\n const activePopups = useActivePopups()\n\n return (\n <>\n \n {activePopups.map((item) => (\n \n ))}\n \n 0 ? 'fit-content' : 0}>\n \n {activePopups // reverse so new items up front\n .slice(0)\n .reverse()\n .map((item) => (\n \n ))}\n \n \n \n )\n}\n","import React from 'react'\n\nimport styled, { keyframes } from 'styled-components'\n\nconst rotate = keyframes`\n from {\n transform: rotate(0deg);\n }\n to {\n transform: rotate(360deg);\n }\n`\n\nconst StyledSVG = styled.svg<{ size: string; stroke?: string }>`\n animation: 2s ${rotate} linear infinite;\n height: ${({ size }) => size};\n width: ${({ size }) => size};\n path {\n stroke: ${({ stroke, theme }) => stroke ?? theme.colors.primary};\n }\n`\n\n/**\n * Takes in custom size and stroke for circle color, default to primary color as fill,\n * need ...rest for layered styles on top\n */\nexport default function Loader({ size = '16px', stroke, ...rest }: { size?: string; stroke?: string }) {\n return (\n \n \n \n )\n}\n","import React, { useState, useEffect } from 'react'\nimport { useWeb3React } from '@web3-react/core'\nimport styled from 'styled-components'\nimport { useTranslation } from 'react-i18next'\n\nimport { network } from '../../connectors'\nimport { useEagerConnect, useInactiveListener } from '../../hooks'\nimport { NetworkContextName } from '../../constants'\nimport Loader from '../Loader'\n\nconst MessageWrapper = styled.div`\n display: flex;\n align-items: center;\n justify-content: center;\n height: 20rem;\n`\n\nconst Message = styled.h2`\n color: ${({ theme }) => theme.colors.primaryDark};\n`\n\nexport default function Web3ReactManager({ children }: { children: JSX.Element }) {\n const { t } = useTranslation()\n const { active } = useWeb3React()\n const { active: networkActive, error: networkError, activate: activateNetwork } = useWeb3React(NetworkContextName)\n\n // try to eagerly connect to an injected provider, if it exists and has granted access already\n const triedEager = useEagerConnect()\n\n // after eagerly trying injected, if the network connect ever isn't active or in an error state, activate itd\n useEffect(() => {\n if (triedEager && !networkActive && !networkError && !active) {\n activateNetwork(network)\n }\n }, [triedEager, networkActive, networkError, activateNetwork, active])\n\n // when there's no account connected, react to logins (broadly speaking) on the injected provider, if it exists\n useInactiveListener(!triedEager)\n\n // handle delayed loader state\n const [showLoader, setShowLoader] = useState(false)\n useEffect(() => {\n const timeout = setTimeout(() => {\n setShowLoader(true)\n }, 600)\n\n return () => {\n clearTimeout(timeout)\n }\n }, [])\n\n // on page load, do nothing until we've tried to connect to the injected connector\n if (!triedEager) {\n return null\n }\n\n // if the account context isn't active, and there's an error on the network context, it's an irrecoverable error\n if (!active && networkError) {\n return (\n \n {t('unknownError')}\n \n )\n }\n\n // if neither context is active, spin\n if (!active && !networkActive) {\n return showLoader ? (\n \n \n \n ) : null\n }\n\n return children\n}\n","import styled from 'styled-components'\n\nconst Card = styled.div`\n width: 100%;\n border-radius: 16px;\n padding: 1.25rem;\n padding: ${({ padding }) => padding};\n border: ${({ border }) => border};\n border-radius: ${({ borderRadius }) => borderRadius};\n`\nexport default Card\n\nexport const LightCard = styled(Card)`\n border: 1px solid ${({ theme }) => theme.colors.invertedContrast};\n background-color: ${({ theme }) => theme.colors.invertedContrast};\n`\n\nexport const GreyCard = styled(Card)`\n background-color: ${({ theme }) => theme.colors.tertiary};\n`\n","import React from 'react'\nimport styled, { css } from 'styled-components'\nimport { animated, useTransition } from 'react-spring'\nimport { DialogOverlay, DialogContent } from '@reach/dialog'\nimport { isMobile } from 'react-device-detect'\nimport '@reach/dialog/styles.css'\nimport { transparentize } from 'polished'\n\nconst AnimatedDialogOverlay = animated(DialogOverlay)\n// eslint-disable-next-line @typescript-eslint/no-unused-vars\nconst StyledDialogOverlay = styled(AnimatedDialogOverlay)`\n &[data-reach-dialog-overlay] {\n z-index: 2;\n background-color: transparent;\n overflow: hidden;\n\n display: flex;\n align-items: center;\n justify-content: center;\n\n background-color: rgba(0, 0, 0, 0.3);\n }\n`\n\nconst AnimatedDialogContent = animated(DialogContent)\n// destructure to not pass custom props to Dialog DOM element\n// eslint-disable-next-line @typescript-eslint/no-unused-vars\nconst StyledDialogContent = styled(({ minHeight, maxHeight, mobile, isOpen, ...rest }) => (\n \n)).attrs({\n 'aria-label': 'dialog',\n})`\n &[data-reach-dialog-content] {\n margin: 0 0 2rem 0;\n border: 1px solid ${({ theme }) => theme.colors.invertedContrast};\n background-color: ${({ theme }) => theme.colors.invertedContrast};\n box-shadow: 0 4px 8px 0 ${transparentize(0.95, '#191326')};\n padding: 0px;\n width: 80%;\n overflow: hidden;\n\n align-self: ${({ mobile }) => (mobile ? 'flex-end' : 'center')};\n\n max-width: 420px;\n ${({ maxHeight }) =>\n maxHeight &&\n css`\n max-height: ${maxHeight}vh;\n `}\n ${({ minHeight }) =>\n minHeight &&\n css`\n min-height: ${minHeight}vh;\n `}\n display: flex;\n border-radius: 20px;\n\n ${({ theme }) => theme.mediaQueries.lg} {\n width: 65vw;\n }\n ${({ theme }) => theme.mediaQueries.sm} {\n width: 85vw;\n }\n }\n`\n\ninterface ModalProps {\n isOpen: boolean\n onDismiss: () => void\n minHeight?: number | false\n maxHeight?: number\n initialFocusRef?: React.RefObject\n children?: React.ReactNode\n}\n\nexport default function Modal({\n isOpen,\n onDismiss,\n minHeight = false,\n maxHeight = 50,\n initialFocusRef,\n children,\n}: ModalProps) {\n const fadeTransition = useTransition(isOpen, null, {\n config: { duration: 200 },\n from: { opacity: 0 },\n enter: { opacity: 1 },\n leave: { opacity: 0 },\n })\n\n return (\n <>\n {fadeTransition.map(\n ({ item, key, props }) =>\n item && (\n \n \n {/* prevents the automatic focusing of inputs on mobile by the reach dialog */}\n {/* eslint-disable */}\n {!initialFocusRef && isMobile ?
: null}\n {/* eslint-enable */}\n {children}\n \n \n )\n )}\n \n )\n}\n","import React, { ReactNode } from 'react'\nimport styled from 'styled-components'\nimport { Heading, IconButton, CloseIcon } from '@pancakeswap-libs/uikit'\nimport { AutoColumn, ColumnCenter } from '../Column'\n\n\nexport const Wrapper = styled.div`\n width: 100%;\n overflow-y: auto;\n`\nexport const Section = styled(AutoColumn)`\n padding: 24px;\n`\n\nexport const ConfirmedIcon = styled(ColumnCenter)`\n padding: 40px 0;\n`\n\nexport const BottomSection = styled(Section)`\n background-color: ${({ theme }) => theme.colors.invertedContrast};\n border-bottom-left-radius: 20px;\n border-bottom-right-radius: 20px;\n`\n\n/**\n * TODO: Remove this when modal system from the UI Kit is implemented\n */\nconst StyledContentHeader = styled.div`\n align-items: center;\n display: flex;\n\n & > ${Heading} {\n flex: 1;\n }\n`\n\ntype ContentHeaderProps = {\n children: ReactNode\n onDismiss: () => void\n}\n\nexport const ContentHeader = ({ children, onDismiss }: ContentHeaderProps) => (\n \n {children}\n \n \n \n \n)\n","import React from 'react'\nimport styled from 'styled-components'\nimport { Text } from '@pancakeswap-libs/uikit'\nimport { Spinner } from '../Shared'\nimport { AutoColumn } from '../Column'\nimport { Wrapper, Section, ConfirmedIcon, ContentHeader } from './helpers'\n\ntype ConfirmationPendingContentProps = { onDismiss: () => void; pendingText: string }\n\nconst CustomLightSpinner = styled(Spinner)<{ size: string }>`\n height: ${({ size }) => size};\n width: ${({ size }) => size};\n`\n\nconst ConfirmationPendingContent = ({ onDismiss, pendingText }: ConfirmationPendingContentProps) => {\n return (\n \n
\n Waiting for confirmation\n \n \n \n \n \n \n {pendingText}\n \n \n Confirm this transaction in your wallet\n \n
\n
\n )\n}\n\nexport default ConfirmationPendingContent\n","import { ChainId } from '@pancakeswap-libs/sdk'\nimport React, { useContext } from 'react'\nimport { ThemeContext } from 'styled-components'\nimport { Button, LinkExternal } from '@pancakeswap-libs/uikit'\nimport { ArrowUpCircle } from 'react-feather'\nimport { AutoColumn } from '../Column'\nimport { getBscScanLink } from '../../utils'\nimport { Wrapper, Section, ConfirmedIcon, ContentHeader } from './helpers'\n\ntype TransactionSubmittedContentProps = {\n onDismiss: () => void\n hash: string | undefined\n chainId: ChainId\n}\n\nconst TransactionSubmittedContent = ({ onDismiss, chainId, hash }: TransactionSubmittedContentProps) => {\n const theme = useContext(ThemeContext)\n\n return (\n \n
\n Transaction submitted\n \n \n \n \n {chainId && hash && (\n View on BscScan\n )}\n \n \n
\n
\n )\n}\n\nexport default TransactionSubmittedContent\n","import React from 'react'\nimport Modal from '../Modal'\nimport { useActiveWeb3React } from '../../hooks'\nimport ConfirmationPendingContent from './ConfirmationPendingContent'\nimport TransactionSubmittedContent from './TransactionSubmittedContent'\n\ninterface ConfirmationModalProps {\n isOpen: boolean\n onDismiss: () => void\n hash: string | undefined\n content: () => React.ReactNode\n attemptingTxn: boolean\n pendingText: string\n}\n\nconst TransactionConfirmationModal = ({\n isOpen,\n onDismiss,\n attemptingTxn,\n hash,\n pendingText,\n content\n}: ConfirmationModalProps) => {\n const { chainId } = useActiveWeb3React()\n\n if (!chainId) return null\n\n // confirmation screen\n return (\n \n {attemptingTxn ? (\n \n ) : hash ? (\n \n ) : (\n content()\n )}\n \n )\n}\n\nexport default TransactionConfirmationModal\n","import React from 'react'\nimport { Wrapper, Section, BottomSection, ContentHeader } from './helpers'\n\ntype ConfirmationModalContentProps = {\n title: string\n onDismiss: () => void\n topContent: () => React.ReactNode\n bottomContent: () => React.ReactNode\n}\n\nconst ConfirmationModalContent = ({ title, bottomContent, onDismiss, topContent }: ConfirmationModalContentProps) => {\n return (\n \n
\n {title}\n {topContent()}\n
\n {bottomContent()}\n
\n )\n}\n\nexport default ConfirmationModalContent\n","import React, { useContext } from 'react'\nimport { ThemeContext } from 'styled-components'\nimport { Button, Text } from '@pancakeswap-libs/uikit'\nimport { AlertTriangle } from 'react-feather'\nimport { AutoColumn } from '../Column'\nimport { Wrapper, Section, BottomSection, ContentHeader } from './helpers'\n\ntype TransactionErrorContentProps = { message: string; onDismiss: () => void }\n\nconst TransactionErrorContent = ({ message, onDismiss }: TransactionErrorContentProps) => {\n const theme = useContext(ThemeContext)\n return (\n \n
\n Error\n \n \n \n {message}\n \n \n
\n \n \n \n
\n )\n}\n\nexport default TransactionErrorContent\n","import TransactionConfirmationModal from './TransactionConfirmationModal'\n\nexport { default as ConfirmationModalContent } from './ConfirmationModalContent'\nexport { default as ConfirmationPendingContent } from './ConfirmationPendingContent'\nexport { default as TransactionErrorContent } from './TransactionErrorContent'\nexport { default as TransactionSubmittedContent } from './TransactionSubmittedContent'\n\nexport default TransactionConfirmationModal\n","import React, { createContext } from 'react'\n\ninterface TranslationState {\n translations: Array\n setTranslations: React.Dispatch>>\n}\n\nconst defaultTranslationState: TranslationState = {\n translations: [],\n setTranslations: (): void => undefined,\n}\n\nexport const TranslationsContext = createContext(defaultTranslationState as TranslationState)\n\nexport default TranslationsContext\n","import { useContext } from 'react'\nimport { TranslationsContext } from '../hooks/TranslationsContext'\n\nconst variableRegex = /%(.*?)%/\n\nconst replaceDynamicString = (foundTranslation: string, fallback: string) => {\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n const stringToReplace = variableRegex.exec(foundTranslation)![0]\n const indexToReplace = foundTranslation.split(' ').indexOf(stringToReplace)\n const fallbackValueAtIndex = fallback.split(' ')[indexToReplace]\n return foundTranslation.replace(stringToReplace, fallbackValueAtIndex)\n}\n\nexport const getTranslation = (translations: Array, translationId: number, fallback: string) => {\n const foundTranslation = translations.find((translation) => {\n return translation.data.stringId === translationId\n })\n if (foundTranslation) {\n const translatedString = foundTranslation.data.text\n const includesVariable = translatedString.includes('%')\n if (includesVariable) {\n return replaceDynamicString(translatedString, fallback)\n }\n return translatedString\n }\n return fallback\n}\n\nexport const TranslateString = (translationId: number, fallback: string) => {\n const { translations } = useContext(TranslationsContext)\n if (translations[0] === 'error' || translations.length === 0) {\n return fallback\n }\n if (translations.length > 0) {\n return getTranslation(translations, translationId, fallback)\n }\n return null\n}\n","import { useCallback, useContext } from 'react'\nimport { TranslationsContext } from 'hooks/TranslationsContext'\nimport { getTranslation } from 'utils/translateTextHelpers'\n\nconst useI18n = () => {\n const { translations } = useContext(TranslationsContext)\n\n /**\n * As a temporary fix memoize the translation function so it can be used in an effect.\n * It appears the TranslationsContext is always empty and is not currently used\n * TODO: Figure out if the context is used and if not, remove it.\n */\n return useCallback(\n (translationId: number, fallback: string) => {\n if (translations[0] === 'error') {\n return fallback\n }\n if (translations.length > 0) {\n return getTranslation(translations, translationId, fallback)\n }\n return fallback\n },\n [translations]\n )\n}\n\nexport default useI18n\n","import React from 'react'\nimport styled from 'styled-components'\nimport { Link } from 'react-router-dom'\nimport { ButtonMenu, ButtonMenuItem } from '@pancakeswap-libs/uikit'\nimport useI18n from 'hooks/useI18n'\n\nconst StyledNav = styled.div`\n margin-bottom: 40px;\n`\n\nfunction Nav({ activeIndex = 0 }: { activeIndex?: number }) {\n const TranslateString = useI18n()\n return (\n \n \n \n {TranslateString(1142, 'Swap')}\n \n \n {TranslateString(262, 'Liquidity')}\n \n \n Bridge\n \n \n \n )\n}\n\nexport default Nav\n","import { Interface } from '@ethersproject/abi'\nimport ERC20_ABI from './erc20.json'\nimport ERC20_BYTES32_ABI from './erc20_bytes32.json'\n\nconst ERC20_INTERFACE = new Interface(ERC20_ABI)\n\nexport default ERC20_INTERFACE\nexport { ERC20_ABI, ERC20_BYTES32_ABI }\n","import { ChainId, Token } from '@pancakeswap-libs/sdk'\nimport { Tags, TokenInfo, TokenList } from '@uniswap/token-lists'\nimport { useMemo } from 'react'\nimport { useSelector } from 'react-redux'\nimport { AppState } from '../index'\n\ntype TagDetails = Tags[keyof Tags]\nexport interface TagInfo extends TagDetails {\n id: string\n}\n\n/**\n * Token instances created from token info.\n */\nexport class WrappedTokenInfo extends Token {\n public readonly tokenInfo: TokenInfo\n\n public readonly tags: TagInfo[]\n\n constructor(tokenInfo: TokenInfo, tags: TagInfo[]) {\n super(tokenInfo.chainId, tokenInfo.address, tokenInfo.decimals, tokenInfo.symbol, tokenInfo.name)\n this.tokenInfo = tokenInfo\n this.tags = tags\n }\n\n public get logoURI(): string | undefined {\n return this.tokenInfo.logoURI\n }\n}\n\nexport type TokenAddressMap = Readonly<{ [chainId in ChainId]: Readonly<{ [tokenAddress: string]: WrappedTokenInfo }> }>\n\n/**\n * An empty result, useful as a default.\n */\nconst EMPTY_LIST: TokenAddressMap = {\n [ChainId.MAINNET]: {},\n [ChainId.BSCTESTNET]: {}\n}\n\nconst listCache: WeakMap | null =\n typeof WeakMap !== 'undefined' ? new WeakMap() : null\n\nexport function listToTokenMap(list: TokenList): TokenAddressMap {\n const result = listCache?.get(list)\n if (result) return result\n\n const map = list.tokens.reduce(\n (tokenMap, tokenInfo) => {\n const tags: TagInfo[] =\n tokenInfo.tags\n ?.map(tagId => {\n if (!list.tags?.[tagId]) return undefined\n return { ...list.tags[tagId], id: tagId }\n })\n ?.filter((x): x is TagInfo => Boolean(x)) ?? []\n const token = new WrappedTokenInfo(tokenInfo, tags)\n if (tokenMap[token.chainId][token.address] !== undefined) throw Error('Duplicate tokens.')\n return {\n ...tokenMap,\n [token.chainId]: {\n ...tokenMap[token.chainId],\n [token.address]: token\n }\n }\n },\n { ...EMPTY_LIST }\n )\n listCache?.set(list, map)\n return map\n}\n\nexport function useTokenList(url: string | undefined): TokenAddressMap {\n const lists = useSelector(state => state.lists.byUrl)\n return useMemo(() => {\n if (!url) return EMPTY_LIST\n const current = lists[url]?.current\n if (!current) return EMPTY_LIST\n try {\n return listToTokenMap(current)\n } catch (error) {\n console.error('Could not show token list due to error', error)\n return EMPTY_LIST\n }\n }, [lists, url])\n}\n\nexport function useSelectedListUrl(): string | undefined {\n return useSelector(state => state.lists.selectedListUrl)\n}\n\nexport function useSelectedTokenList(): TokenAddressMap {\n return useTokenList(useSelectedListUrl())\n}\n\nexport function useSelectedListInfo(): { current: TokenList | null; pending: TokenList | null; loading: boolean } {\n const selectedUrl = useSelectedListUrl()\n const listsByUrl = useSelector(state => state.lists.byUrl)\n const list = selectedUrl ? listsByUrl[selectedUrl] : undefined\n return {\n current: list?.current ?? null,\n pending: list?.pendingUpdate ?? null,\n loading: list?.loadingRequestId !== null\n }\n}\n\n// returns all downloaded current lists\nexport function useAllLists(): TokenList[] {\n const lists = useSelector(state => state.lists.byUrl)\n\n return useMemo(\n () =>\n Object.keys(lists)\n .map(url => lists[url].current)\n .filter((l): l is TokenList => Boolean(l)),\n [lists]\n )\n}\n","import { createAction } from '@reduxjs/toolkit'\n\nexport interface Call {\n address: string\n callData: string\n}\n\nconst ADDRESS_REGEX = /^0x[a-fA-F0-9]{40}$/\nconst LOWER_HEX_REGEX = /^0x[a-f0-9]*$/\nexport function toCallKey(call: Call): string {\n if (!ADDRESS_REGEX.test(call.address)) {\n throw new Error(`Invalid address: ${call.address}`)\n }\n if (!LOWER_HEX_REGEX.test(call.callData)) {\n throw new Error(`Invalid hex: ${call.callData}`)\n }\n return `${call.address}-${call.callData}`\n}\n\nexport function parseCallKey(callKey: string): Call {\n const pcs = callKey.split('-')\n if (pcs.length !== 2) {\n throw new Error(`Invalid call key: ${callKey}`)\n }\n return {\n address: pcs[0],\n callData: pcs[1]\n }\n}\n\nexport interface ListenerOptions {\n // how often this data should be fetched, by default 1\n readonly blocksPerFetch?: number\n}\n\nexport const addMulticallListeners = createAction<{ chainId: number; calls: Call[]; options?: ListenerOptions }>(\n 'multicall/addMulticallListeners'\n)\nexport const removeMulticallListeners = createAction<{ chainId: number; calls: Call[]; options?: ListenerOptions }>(\n 'multicall/removeMulticallListeners'\n)\nexport const fetchingMulticallResults = createAction<{ chainId: number; calls: Call[]; fetchingBlockNumber: number }>(\n 'multicall/fetchingMulticallResults'\n)\nexport const errorFetchingMulticallResults = createAction<{\n chainId: number\n calls: Call[]\n fetchingBlockNumber: number\n}>('multicall/errorFetchingMulticallResults')\nexport const updateMulticallResults = createAction<{\n chainId: number\n blockNumber: number\n results: {\n [callKey: string]: string | null\n }\n}>('multicall/updateMulticallResults')\n","import { Interface, FunctionFragment } from '@ethersproject/abi'\nimport { BigNumber } from '@ethersproject/bignumber'\nimport { Contract } from '@ethersproject/contracts'\nimport { useEffect, useMemo } from 'react'\nimport { useDispatch, useSelector } from 'react-redux'\nimport { useActiveWeb3React } from '../../hooks'\nimport { useBlockNumber } from '../application/hooks'\nimport { AppDispatch, AppState } from '../index'\nimport {\n addMulticallListeners,\n Call,\n removeMulticallListeners,\n parseCallKey,\n toCallKey,\n ListenerOptions,\n} from './actions'\n\nexport interface Result extends ReadonlyArray {\n readonly [key: string]: any\n}\n\ntype MethodArg = string | number | BigNumber\ntype MethodArgs = Array\n\ntype OptionalMethodInputs = Array | undefined\n\nfunction isMethodArg(x: unknown): x is MethodArg {\n return ['string', 'number'].indexOf(typeof x) !== -1\n}\n\nfunction isValidMethodArgs(x: unknown): x is MethodArgs | undefined {\n return (\n x === undefined ||\n (Array.isArray(x) && x.every((xi) => isMethodArg(xi) || (Array.isArray(xi) && xi.every(isMethodArg))))\n )\n}\n\ninterface CallResult {\n readonly valid: boolean\n readonly data: string | undefined\n readonly blockNumber: number | undefined\n}\n\nconst INVALID_RESULT: CallResult = { valid: false, blockNumber: undefined, data: undefined }\n\n// use this options object\nexport const NEVER_RELOAD: ListenerOptions = {\n blocksPerFetch: Infinity,\n}\n\n// the lowest level call for subscribing to contract data\nfunction useCallsData(calls: (Call | undefined)[], options?: ListenerOptions): CallResult[] {\n const { chainId } = useActiveWeb3React()\n const callResults = useSelector(\n (state) => state.multicall.callResults\n )\n const dispatch = useDispatch()\n\n const serializedCallKeys: string = useMemo(\n () =>\n JSON.stringify(\n calls\n ?.filter((c): c is Call => Boolean(c))\n ?.map(toCallKey)\n ?.sort() ?? []\n ),\n [calls]\n )\n\n // update listeners when there is an actual change that persists for at least 100ms\n useEffect(() => {\n const callKeys: string[] = JSON.parse(serializedCallKeys)\n if (!chainId || callKeys.length === 0) return undefined\n // eslint-disable-next-line @typescript-eslint/no-shadow\n const calls = callKeys.map((key) => parseCallKey(key))\n dispatch(\n addMulticallListeners({\n chainId,\n calls,\n options,\n })\n )\n\n return () => {\n dispatch(\n removeMulticallListeners({\n chainId,\n calls,\n options,\n })\n )\n }\n }, [chainId, dispatch, options, serializedCallKeys])\n\n return useMemo(\n () =>\n // @ts-ignore\n calls.map((call) => {\n if (!chainId || !call) return INVALID_RESULT\n\n const result = callResults[chainId]?.[toCallKey(call)]\n const data = result?.data && result?.data !== '0x' ? result.data : null\n\n return { valid: true, data, blockNumber: result?.blockNumber }\n }),\n [callResults, calls, chainId]\n )\n}\n\ninterface CallState {\n readonly valid: boolean\n // the result, or undefined if loading or errored/no data\n readonly result: Result | undefined\n // true if the result has never been fetched\n readonly loading: boolean\n // true if the result is not for the latest block\n readonly syncing: boolean\n // true if the call was made and is synced, but the return data is invalid\n readonly error: boolean\n}\n\nconst INVALID_CALL_STATE: CallState = { valid: false, result: undefined, loading: false, syncing: false, error: false }\nconst LOADING_CALL_STATE: CallState = { valid: true, result: undefined, loading: true, syncing: true, error: false }\n\nfunction toCallState(\n callResult: CallResult | undefined,\n contractInterface: Interface | undefined,\n fragment: FunctionFragment | undefined,\n latestBlockNumber: number | undefined\n): CallState {\n if (!callResult) return INVALID_CALL_STATE\n const { valid, data, blockNumber } = callResult\n if (!valid) return INVALID_CALL_STATE\n if (valid && !blockNumber) return LOADING_CALL_STATE\n if (!contractInterface || !fragment || !latestBlockNumber) return LOADING_CALL_STATE\n const success = data && data.length > 2\n const syncing = (blockNumber ?? 0) < latestBlockNumber\n let result: Result | undefined\n if (success && data) {\n try {\n result = contractInterface.decodeFunctionResult(fragment, data)\n } catch (error) {\n console.error('Result data parsing failed', fragment, data)\n return {\n valid: true,\n loading: false,\n error: true,\n syncing,\n result,\n }\n }\n }\n return {\n valid: true,\n loading: false,\n syncing,\n result,\n error: !success,\n }\n}\n\nexport function useSingleContractMultipleData(\n contract: Contract | null | undefined,\n methodName: string,\n callInputs: OptionalMethodInputs[],\n options?: ListenerOptions\n): CallState[] {\n const fragment = useMemo(() => contract?.interface?.getFunction(methodName), [contract, methodName])\n\n const calls = useMemo(\n () =>\n contract && fragment && callInputs && callInputs.length > 0\n ? callInputs.map((inputs) => {\n return {\n address: contract.address,\n callData: contract.interface.encodeFunctionData(fragment, inputs),\n }\n })\n : [],\n [callInputs, contract, fragment]\n )\n\n const results = useCallsData(calls, options)\n\n const latestBlockNumber = useBlockNumber()\n\n return useMemo(() => {\n return results.map((result) => toCallState(result, contract?.interface, fragment, latestBlockNumber))\n }, [fragment, contract, results, latestBlockNumber])\n}\n\nexport function useMultipleContractSingleData(\n addresses: (string | undefined)[],\n contractInterface: Interface,\n methodName: string,\n callInputs?: OptionalMethodInputs,\n options?: ListenerOptions\n): CallState[] {\n const fragment = useMemo(() => contractInterface.getFunction(methodName), [contractInterface, methodName])\n const callData: string | undefined = useMemo(\n () =>\n fragment && isValidMethodArgs(callInputs)\n ? contractInterface.encodeFunctionData(fragment, callInputs)\n : undefined,\n [callInputs, contractInterface, fragment]\n )\n\n const calls = useMemo(\n () =>\n fragment && addresses && addresses.length > 0 && callData\n ? addresses.map((address) => {\n return address && callData\n ? {\n address,\n callData,\n }\n : undefined\n })\n : [],\n [addresses, callData, fragment]\n )\n\n const results = useCallsData(calls, options)\n\n const latestBlockNumber = useBlockNumber()\n\n return useMemo(() => {\n return results.map((result) => toCallState(result, contractInterface, fragment, latestBlockNumber))\n }, [fragment, results, contractInterface, latestBlockNumber])\n}\n\nexport function useSingleCallResult(\n contract: Contract | null | undefined,\n methodName: string,\n inputs?: OptionalMethodInputs,\n options?: ListenerOptions\n): CallState {\n const fragment = useMemo(() => contract?.interface?.getFunction(methodName), [contract, methodName])\n\n const calls = useMemo(() => {\n return contract && fragment && isValidMethodArgs(inputs)\n ? [\n {\n address: contract.address,\n callData: contract.interface.encodeFunctionData(fragment, inputs),\n },\n ]\n : []\n }, [contract, fragment, inputs])\n\n const result = useCallsData(calls, options)[0]\n const latestBlockNumber = useBlockNumber()\n\n return useMemo(() => {\n return toCallState(result, contract?.interface, fragment, latestBlockNumber)\n }, [result, contract, fragment, latestBlockNumber])\n}\n","import { createAction } from '@reduxjs/toolkit'\n\nexport interface SerializedToken {\n chainId: number\n address: string\n decimals: number\n symbol?: string\n name?: string\n}\n\nexport interface SerializedPair {\n token0: SerializedToken\n token1: SerializedToken\n}\n\nexport const updateMatchesDarkMode = createAction<{ matchesDarkMode: boolean }>('user/updateMatchesDarkMode')\nexport const updateUserDarkMode = createAction<{ userDarkMode: boolean }>('user/updateUserDarkMode')\nexport const updateUserExpertMode = createAction<{ userExpertMode: boolean }>('user/updateUserExpertMode')\nexport const updateUserSlippageTolerance = createAction<{ userSlippageTolerance: number }>(\n 'user/updateUserSlippageTolerance'\n)\nexport const updateUserDeadline = createAction<{ userDeadline: number }>('user/updateUserDeadline')\nexport const addSerializedToken = createAction<{ serializedToken: SerializedToken }>('user/addSerializedToken')\nexport const removeSerializedToken = createAction<{ chainId: number; address: string }>('user/removeSerializedToken')\nexport const addSerializedPair = createAction<{ serializedPair: SerializedPair }>('user/addSerializedPair')\nexport const removeSerializedPair = createAction<{ chainId: number; tokenAAddress: string; tokenBAddress: string }>(\n 'user/removeSerializedPair'\n)\nexport const muteAudio = createAction('user/muteAudio')\nexport const unmuteAudio = createAction('user/unmuteAudio')\n","const CACHE_KEY = 'IS_DARK'\n\nexport function getThemeCache(): boolean | null {\n let cache = null\n try {\n const rawCache = localStorage.getItem(CACHE_KEY)\n if (rawCache) {\n cache = JSON.parse(rawCache)\n }\n } catch (error) {\n console.error(error)\n }\n\n return cache\n}\n\nexport function setThemeCache(isDark: boolean) {\n try {\n localStorage.setItem(CACHE_KEY, JSON.stringify(isDark))\n } catch (error) {\n console.error(error)\n }\n}\n","import { ChainId, Pair, Token } from '@pancakeswap-libs/sdk'\nimport flatMap from 'lodash.flatmap'\nimport { useCallback, useMemo } from 'react'\nimport { shallowEqual, useDispatch, useSelector } from 'react-redux'\nimport { BASES_TO_TRACK_LIQUIDITY_FOR, PINNED_PAIRS } from '../../constants'\n\nimport { useActiveWeb3React } from '../../hooks'\n// eslint-disable-next-line import/no-cycle\nimport { useAllTokens } from '../../hooks/Tokens'\nimport { AppDispatch, AppState } from '../index'\nimport {\n addSerializedPair,\n addSerializedToken,\n removeSerializedToken,\n SerializedPair,\n SerializedToken,\n updateUserDarkMode,\n updateUserDeadline,\n updateUserExpertMode,\n updateUserSlippageTolerance,\n muteAudio,\n unmuteAudio,\n} from './actions'\nimport { setThemeCache } from '../../utils/theme'\n\nfunction serializeToken(token: Token): SerializedToken {\n return {\n chainId: token.chainId,\n address: token.address,\n decimals: token.decimals,\n symbol: token.symbol,\n name: token.name,\n }\n}\n\nfunction deserializeToken(serializedToken: SerializedToken): Token {\n return new Token(\n serializedToken.chainId,\n serializedToken.address,\n serializedToken.decimals,\n serializedToken.symbol,\n serializedToken.name\n )\n}\n\nexport function useIsDarkMode(): boolean {\n const { userDarkMode, matchesDarkMode } = useSelector<\n AppState,\n { userDarkMode: boolean | null; matchesDarkMode: boolean }\n >(\n // eslint-disable-next-line @typescript-eslint/no-shadow\n ({ user: { matchesDarkMode, userDarkMode } }) => ({\n userDarkMode,\n matchesDarkMode,\n }),\n shallowEqual\n )\n return userDarkMode === null ? matchesDarkMode : userDarkMode\n}\n\nexport function useDarkModeManager(): [boolean, () => void] {\n const dispatch = useDispatch()\n const { userDarkMode } = useSelector(\n // eslint-disable-next-line @typescript-eslint/no-shadow\n ({ user: { userDarkMode } }) => ({\n userDarkMode,\n }),\n shallowEqual\n )\n const darkMode = useIsDarkMode()\n\n const toggleSetDarkMode = useCallback(() => {\n setThemeCache(!userDarkMode)\n dispatch(updateUserDarkMode({ userDarkMode: !userDarkMode }))\n }, [userDarkMode, dispatch])\n\n return [darkMode, toggleSetDarkMode]\n}\n\nexport function useAudioModeManager(): [boolean, () => void] {\n const dispatch = useDispatch()\n const audioPlay = useSelector((state) => state.user.audioPlay)\n const toggleSetAudioMode = useCallback(() => {\n if (audioPlay) {\n dispatch(muteAudio())\n } else {\n dispatch(unmuteAudio())\n }\n }, [audioPlay, dispatch])\n\n return [audioPlay, toggleSetAudioMode]\n}\n\nexport function useIsExpertMode(): boolean {\n return useSelector((state) => state.user.userExpertMode)\n}\n\nexport function useExpertModeManager(): [boolean, () => void] {\n const dispatch = useDispatch()\n const expertMode = useIsExpertMode()\n\n const toggleSetExpertMode = useCallback(() => {\n dispatch(updateUserExpertMode({ userExpertMode: !expertMode }))\n }, [expertMode, dispatch])\n\n return [expertMode, toggleSetExpertMode]\n}\n\nexport function useUserSlippageTolerance(): [number, (slippage: number) => void] {\n const dispatch = useDispatch()\n const userSlippageTolerance = useSelector((state) => {\n return state.user.userSlippageTolerance\n })\n\n const setUserSlippageTolerance = useCallback(\n (slippageTolerance: number) => {\n dispatch(updateUserSlippageTolerance({ userSlippageTolerance: slippageTolerance }))\n },\n [dispatch]\n )\n\n return [userSlippageTolerance, setUserSlippageTolerance]\n}\n\nexport function useUserDeadline(): [number, (slippage: number) => void] {\n const dispatch = useDispatch()\n const userDeadline = useSelector((state) => {\n return state.user.userDeadline\n })\n\n const setUserDeadline = useCallback(\n (deadline: number) => {\n dispatch(updateUserDeadline({ userDeadline: deadline }))\n },\n [dispatch]\n )\n\n return [userDeadline, setUserDeadline]\n}\n\nexport function useAddUserToken(): (token: Token) => void {\n const dispatch = useDispatch()\n return useCallback(\n (token: Token) => {\n dispatch(addSerializedToken({ serializedToken: serializeToken(token) }))\n },\n [dispatch]\n )\n}\n\nexport function useRemoveUserAddedToken(): (chainId: number, address: string) => void {\n const dispatch = useDispatch()\n return useCallback(\n (chainId: number, address: string) => {\n dispatch(removeSerializedToken({ chainId, address }))\n },\n [dispatch]\n )\n}\n\nexport function useUserAddedTokens(): Token[] {\n const { chainId } = useActiveWeb3React()\n const serializedTokensMap = useSelector(({ user: { tokens } }) => tokens)\n\n return useMemo(() => {\n if (!chainId) return []\n return Object.values(serializedTokensMap[chainId as ChainId] ?? {}).map(deserializeToken)\n }, [serializedTokensMap, chainId])\n}\n\nfunction serializePair(pair: Pair): SerializedPair {\n return {\n token0: serializeToken(pair.token0),\n token1: serializeToken(pair.token1),\n }\n}\n\nexport function usePairAdder(): (pair: Pair) => void {\n const dispatch = useDispatch()\n\n return useCallback(\n (pair: Pair) => {\n dispatch(addSerializedPair({ serializedPair: serializePair(pair) }))\n },\n [dispatch]\n )\n}\n\n/**\n * Given two tokens return the liquidity token that represents its liquidity shares\n * @param tokenA one of the two tokens\n * @param tokenB the other token\n */\nexport function toV2LiquidityToken([tokenA, tokenB]: [Token, Token]): Token {\n return new Token(tokenA.chainId, Pair.getAddress(tokenA, tokenB), 18, 'Cake-LP', 'Pancake LPs')\n}\n\n/**\n * Returns all the pairs of tokens that are tracked by the user for the current chain ID.\n */\nexport function useTrackedTokenPairs(): [Token, Token][] {\n const { chainId } = useActiveWeb3React()\n const tokens = useAllTokens()\n\n // pinned pairs\n const pinnedPairs = useMemo(() => (chainId ? PINNED_PAIRS[chainId] ?? [] : []), [chainId])\n\n // pairs for every token against every base\n const generatedPairs: [Token, Token][] = useMemo(\n () =>\n chainId\n ? flatMap(Object.keys(tokens), (tokenAddress) => {\n const token = tokens[tokenAddress]\n // for each token on the current chain,\n return (\n // loop though all bases on the current chain\n (BASES_TO_TRACK_LIQUIDITY_FOR[chainId] ?? [])\n // to construct pairs of the given token with each base\n .map((base) => {\n if (base.address === token.address) {\n return null\n }\n return [base, token]\n })\n .filter((p): p is [Token, Token] => p !== null)\n )\n })\n : [],\n [tokens, chainId]\n )\n\n // pairs saved by users\n const savedSerializedPairs = useSelector(({ user: { pairs } }) => pairs)\n\n const userPairs: [Token, Token][] = useMemo(() => {\n if (!chainId || !savedSerializedPairs) return []\n const forChain = savedSerializedPairs[chainId]\n if (!forChain) return []\n\n return Object.keys(forChain).map((pairId) => {\n return [deserializeToken(forChain[pairId].token0), deserializeToken(forChain[pairId].token1)]\n })\n }, [savedSerializedPairs, chainId])\n\n const combinedList = useMemo(() => userPairs.concat(generatedPairs).concat(pinnedPairs), [\n generatedPairs,\n pinnedPairs,\n userPairs,\n ])\n\n return useMemo(() => {\n // dedupes pairs of tokens in the combined list\n const keyed = combinedList.reduce<{ [key: string]: [Token, Token] }>((memo, [tokenA, tokenB]) => {\n const sorted = tokenA.sortsBefore(tokenB)\n const key = sorted ? `${tokenA.address}:${tokenB.address}` : `${tokenB.address}:${tokenA.address}`\n if (memo[key]) return memo\n memo[key] = sorted ? [tokenA, tokenB] : [tokenB, tokenA]\n return memo\n }, {})\n\n return Object.keys(keyed).map((key) => keyed[key])\n }, [combinedList])\n}\n","import { ChainId } from '@pancakeswap-libs/sdk'\nimport MULTICALL_ABI from './abi.json'\n\nconst MULTICALL_NETWORKS: { [chainId in ChainId]: string } = {\n [ChainId.MAINNET]: '0x1Ee38d535d541c55C9dae27B12edf090C608E6Fb', // TODO\n [ChainId.BSCTESTNET]: '0x301907b5835a2d723Fe3e9E8C5Bc5375d5c1236A'\n}\n\nexport { MULTICALL_ABI, MULTICALL_NETWORKS }\n","import { Contract } from '@ethersproject/contracts'\nimport { ChainId, WETH } from '@pancakeswap-libs/sdk'\nimport { abi as IUniswapV2PairABI } from '@uniswap/v2-core/build/IUniswapV2Pair.json'\nimport { useMemo } from 'react'\nimport ENS_ABI from '../constants/abis/ens-registrar.json'\nimport ENS_PUBLIC_RESOLVER_ABI from '../constants/abis/ens-public-resolver.json'\nimport { ERC20_BYTES32_ABI } from '../constants/abis/erc20'\nimport ERC20_ABI from '../constants/abis/erc20.json'\nimport WETH_ABI from '../constants/abis/weth.json'\nimport { MULTICALL_ABI, MULTICALL_NETWORKS } from '../constants/multicall'\nimport { getContract } from '../utils'\nimport { useActiveWeb3React } from './index'\n\n// returns null on errors\nfunction useContract(address: string | undefined, ABI: any, withSignerIfPossible = true): Contract | null {\n const { library, account } = useActiveWeb3React()\n\n return useMemo(() => {\n if (!address || !ABI || !library) return null\n try {\n return getContract(address, ABI, library, withSignerIfPossible && account ? account : undefined)\n } catch (error) {\n console.error('Failed to get contract', error)\n return null\n }\n }, [address, ABI, library, withSignerIfPossible, account])\n}\n\nexport function useTokenContract(tokenAddress?: string, withSignerIfPossible?: boolean): Contract | null {\n return useContract(tokenAddress, ERC20_ABI, withSignerIfPossible)\n}\n\nexport function useWETHContract(withSignerIfPossible?: boolean): Contract | null {\n const { chainId } = useActiveWeb3React()\n return useContract(chainId ? WETH[chainId].address : undefined, WETH_ABI, withSignerIfPossible)\n}\n\nexport function useENSRegistrarContract(withSignerIfPossible?: boolean): Contract | null {\n const { chainId } = useActiveWeb3React()\n let address: string | undefined\n if (chainId) {\n switch (chainId) {\n case ChainId.MAINNET:\n case ChainId.BSCTESTNET:\n }\n }\n return useContract(address, ENS_ABI, withSignerIfPossible)\n}\n\nexport function useENSResolverContract(address: string | undefined, withSignerIfPossible?: boolean): Contract | null {\n return useContract(address, ENS_PUBLIC_RESOLVER_ABI, withSignerIfPossible)\n}\n\nexport function useBytes32TokenContract(tokenAddress?: string, withSignerIfPossible?: boolean): Contract | null {\n return useContract(tokenAddress, ERC20_BYTES32_ABI, withSignerIfPossible)\n}\n\nexport function usePairContract(pairAddress?: string, withSignerIfPossible?: boolean): Contract | null {\n return useContract(pairAddress, IUniswapV2PairABI, withSignerIfPossible)\n}\n\nexport function useMulticallContract(): Contract | null {\n const { chainId } = useActiveWeb3React()\n return useContract(chainId && MULTICALL_NETWORKS[chainId], MULTICALL_ABI, false)\n}\n","import { parseBytes32String } from '@ethersproject/strings'\nimport { Currency, ETHER, Token, currencyEquals } from '@pancakeswap-libs/sdk'\nimport { useMemo } from 'react'\nimport { useSelectedTokenList } from '../state/lists/hooks'\nimport { NEVER_RELOAD, useSingleCallResult } from '../state/multicall/hooks'\n// eslint-disable-next-line import/no-cycle\nimport { useUserAddedTokens } from '../state/user/hooks'\nimport { isAddress } from '../utils'\n\nimport { useActiveWeb3React } from './index'\nimport { useBytes32TokenContract, useTokenContract } from './useContract'\n\nexport function useAllTokens(): { [address: string]: Token } {\n const { chainId } = useActiveWeb3React()\n const userAddedTokens = useUserAddedTokens()\n const allTokens = useSelectedTokenList()\n\n return useMemo(() => {\n if (!chainId) return {}\n return (\n userAddedTokens\n // reduce into all ALL_TOKENS filtered by the current chain\n .reduce<{ [address: string]: Token }>(\n (tokenMap, token) => {\n tokenMap[token.address] = token\n return tokenMap\n },\n // must make a copy because reduce modifies the map, and we do not\n // want to make a copy in every iteration\n { ...allTokens[chainId] }\n )\n )\n }, [chainId, userAddedTokens, allTokens])\n}\n\n// Check if currency is included in custom list from user storage\nexport function useIsUserAddedToken(currency: Currency): boolean {\n const userAddedTokens = useUserAddedTokens()\n return !!userAddedTokens.find((token) => currencyEquals(currency, token))\n}\n\n// parse a name or symbol from a token response\nconst BYTES32_REGEX = /^0x[a-fA-F0-9]{64}$/\nfunction parseStringOrBytes32(str: string | undefined, bytes32: string | undefined, defaultValue: string): string {\n return str && str.length > 0\n ? str\n : bytes32 && BYTES32_REGEX.test(bytes32)\n ? parseBytes32String(bytes32)\n : defaultValue\n}\n\n// undefined if invalid or does not exist\n// null if loading\n// otherwise returns the token\nexport function useToken(tokenAddress?: string): Token | undefined | null {\n const { chainId } = useActiveWeb3React()\n const tokens = useAllTokens()\n\n const address = isAddress(tokenAddress)\n\n const tokenContract = useTokenContract(address || undefined, false)\n const tokenContractBytes32 = useBytes32TokenContract(address || undefined, false)\n const token: Token | undefined = address ? tokens[address] : undefined\n\n const tokenName = useSingleCallResult(token ? undefined : tokenContract, 'name', undefined, NEVER_RELOAD)\n const tokenNameBytes32 = useSingleCallResult(\n token ? undefined : tokenContractBytes32,\n 'name',\n undefined,\n NEVER_RELOAD\n )\n const symbol = useSingleCallResult(token ? undefined : tokenContract, 'symbol', undefined, NEVER_RELOAD)\n const symbolBytes32 = useSingleCallResult(token ? undefined : tokenContractBytes32, 'symbol', undefined, NEVER_RELOAD)\n const decimals = useSingleCallResult(token ? undefined : tokenContract, 'decimals', undefined, NEVER_RELOAD)\n\n return useMemo(() => {\n if (token) return token\n if (!chainId || !address) return undefined\n if (decimals.loading || symbol.loading || tokenName.loading) return null\n if (decimals.result) {\n return new Token(\n chainId,\n address,\n decimals.result[0],\n parseStringOrBytes32(symbol.result?.[0], symbolBytes32.result?.[0], 'UNKNOWN'),\n parseStringOrBytes32(tokenName.result?.[0], tokenNameBytes32.result?.[0], 'Unknown Token')\n )\n }\n return undefined\n }, [\n address,\n chainId,\n decimals.loading,\n decimals.result,\n symbol.loading,\n symbol.result,\n symbolBytes32.result,\n token,\n tokenName.loading,\n tokenName.result,\n tokenNameBytes32.result,\n ])\n}\n\nexport function useCurrency(currencyId: string | undefined): Currency | null | undefined {\n const isBNB = currencyId?.toUpperCase() === 'BNB'\n const token = useToken(isBNB ? undefined : currencyId)\n return isBNB ? ETHER : token\n}\n","import { Currency, CurrencyAmount, ETHER, JSBI, Token, TokenAmount } from '@pancakeswap-libs/sdk'\nimport { useMemo } from 'react'\nimport ERC20_INTERFACE from '../../constants/abis/erc20'\nimport { useAllTokens } from '../../hooks/Tokens'\nimport { useActiveWeb3React } from '../../hooks'\nimport { useMulticallContract } from '../../hooks/useContract'\nimport { isAddress } from '../../utils'\nimport { useSingleContractMultipleData, useMultipleContractSingleData } from '../multicall/hooks'\n\n/**\n * Returns a map of the given addresses to their eventually consistent ETH balances.\n */\nexport function useETHBalances(\n uncheckedAddresses?: (string | undefined)[]\n): { [address: string]: CurrencyAmount | undefined } {\n const multicallContract = useMulticallContract()\n\n const addresses: string[] = useMemo(\n () =>\n uncheckedAddresses\n ? uncheckedAddresses\n .map(isAddress)\n .filter((a): a is string => a !== false)\n .sort()\n : [],\n [uncheckedAddresses]\n )\n\n const results = useSingleContractMultipleData(\n multicallContract,\n 'getEthBalance',\n addresses.map(address => [address])\n )\n\n return useMemo(\n () =>\n addresses.reduce<{ [address: string]: CurrencyAmount }>((memo, address, i) => {\n const value = results?.[i]?.result?.[0]\n if (value) memo[address] = CurrencyAmount.ether(JSBI.BigInt(value.toString()))\n return memo\n }, {}),\n [addresses, results]\n )\n}\n\n/**\n * Returns a map of token addresses to their eventually consistent token balances for a single account.\n */\nexport function useTokenBalancesWithLoadingIndicator(\n address?: string,\n tokens?: (Token | undefined)[]\n): [{ [tokenAddress: string]: TokenAmount | undefined }, boolean] {\n const validatedTokens: Token[] = useMemo(\n () => tokens?.filter((t?: Token): t is Token => isAddress(t?.address) !== false) ?? [],\n [tokens]\n )\n\n const validatedTokenAddresses = useMemo(() => validatedTokens.map(vt => vt.address), [validatedTokens])\n\n const balances = useMultipleContractSingleData(validatedTokenAddresses, ERC20_INTERFACE, 'balanceOf', [address])\n\n const anyLoading: boolean = useMemo(() => balances.some(callState => callState.loading), [balances])\n\n return [\n useMemo(\n () =>\n address && validatedTokens.length > 0\n ? validatedTokens.reduce<{ [tokenAddress: string]: TokenAmount | undefined }>((memo, token, i) => {\n const value = balances?.[i]?.result?.[0]\n const amount = value ? JSBI.BigInt(value.toString()) : undefined\n if (amount) {\n memo[token.address] = new TokenAmount(token, amount)\n }\n return memo\n }, {})\n : {},\n [address, validatedTokens, balances]\n ),\n anyLoading\n ]\n}\n\nexport function useTokenBalances(\n address?: string,\n tokens?: (Token | undefined)[]\n): { [tokenAddress: string]: TokenAmount | undefined } {\n return useTokenBalancesWithLoadingIndicator(address, tokens)[0]\n}\n\n// get the balance for a single token/account combo\nexport function useTokenBalance(account?: string, token?: Token): TokenAmount | undefined {\n const tokenBalances = useTokenBalances(account, [token])\n if (!token) return undefined\n return tokenBalances[token.address]\n}\n\nexport function useCurrencyBalances(\n account?: string,\n currencies?: (Currency | undefined)[]\n): (CurrencyAmount | undefined)[] {\n const tokens = useMemo(() => currencies?.filter((currency): currency is Token => currency instanceof Token) ?? [], [\n currencies\n ])\n\n const tokenBalances = useTokenBalances(account, tokens)\n const containsETH: boolean = useMemo(() => currencies?.some(currency => currency === ETHER) ?? false, [currencies])\n const ethBalance = useETHBalances(containsETH ? [account] : [])\n\n return useMemo(\n () =>\n currencies?.map(currency => {\n if (!account || !currency) return undefined\n if (currency instanceof Token) return tokenBalances[currency.address]\n if (currency === ETHER) return ethBalance[account]\n return undefined\n }) ?? [],\n [account, currencies, ethBalance, tokenBalances]\n )\n}\n\nexport function useCurrencyBalance(account?: string, currency?: Currency): CurrencyAmount | undefined {\n return useCurrencyBalances(account, [currency])[0]\n}\n\n// mimics useAllBalances\nexport function useAllTokenBalances(): { [tokenAddress: string]: TokenAmount | undefined } {\n const { account } = useActiveWeb3React()\n const allTokens = useAllTokens()\n const allTokensArray = useMemo(() => Object.values(allTokens ?? {}), [allTokens])\n const balances = useTokenBalances(account ?? undefined, allTokensArray)\n return balances ?? {}\n}\n","import { useEffect, useState } from 'react'\n\n/**\n * Returns the last value of type T that passes a filter function\n * @param value changing value\n * @param filterFn function that determines whether a given value should be considered for the last value\n */\nexport default function useLast(\n value: T | undefined | null,\n filterFn?: (value: T | null | undefined) => boolean\n): T | null | undefined {\n const [last, setLast] = useState(filterFn && filterFn(value) ? value : undefined)\n useEffect(() => {\n setLast((prev) => {\n const shouldUse: boolean = filterFn ? filterFn(value) : true\n if (shouldUse) return value\n return prev\n })\n }, [filterFn, value])\n return last\n}\n\nfunction isDefined(x: T | null | undefined): x is T {\n return x !== null && x !== undefined\n}\n\n/**\n * Returns the last truthy value of type T\n * @param value changing value\n */\nexport function useLastTruthy(value: T | undefined | null): T | null | undefined {\n return useLast(value, isDefined)\n}\n","import CID from 'cids'\nimport { getCodec, rmPrefix } from 'multicodec'\nimport { decode, toB58String } from 'multihashes'\n\nexport function hexToUint8Array(hex: string): Uint8Array {\n hex = hex.startsWith('0x') ? hex.substr(2) : hex\n if (hex.length % 2 !== 0) throw new Error('hex must have length that is multiple of 2')\n const arr = new Uint8Array(hex.length / 2)\n for (let i = 0; i < arr.length; i++) {\n arr[i] = parseInt(hex.substr(i * 2, 2), 16)\n }\n return arr\n}\n\nconst UTF_8_DECODER = new TextDecoder()\n\n/**\n * Returns the URI representation of the content hash for supported codecs\n * @param contenthash to decode\n */\nexport default function contenthashToUri(contenthash: string): string {\n const buff = hexToUint8Array(contenthash)\n const codec = getCodec(buff as Buffer) // the typing is wrong for @types/multicodec\n switch (codec) {\n case 'ipfs-ns': {\n const data = rmPrefix(buff as Buffer)\n const cid = new CID(data)\n return `ipfs://${toB58String(cid.multihash)}`\n }\n case 'ipns-ns': {\n const data = rmPrefix(buff as Buffer)\n const cid = new CID(data)\n const multihash = decode(cid.multihash)\n if (multihash.name === 'identity') {\n return `ipns://${UTF_8_DECODER.decode(multihash.digest).trim()}`\n } \n return `ipns://${toB58String(cid.multihash)}`\n \n }\n default:\n throw new Error(`Unrecognized codec: ${codec}`)\n }\n}\n","const ENS_NAME_REGEX = /^(([a-zA-Z0-9]+\\.)+)eth(\\/.*)?$/\n\nexport function parseENSAddress(ensAddress: string): { ensName: string; ensPath: string | undefined } | undefined {\n const match = ensAddress.match(ENS_NAME_REGEX)\n if (!match) return undefined\n return { ensName: `${match[1].toLowerCase()}eth`, ensPath: match[3] }\n}\n\nexport default parseENSAddress\n","/**\n * Given a URI that may be ipfs, ipns, http, or https protocol, return the fetch-able http(s) URLs for the same content\n * @param uri to convert to fetch-able http url\n */\nexport default function uriToHttp(uri: string): string[] {\n const protocol = uri.split(':')[0].toLowerCase()\n switch (protocol) {\n case 'https':\n return [uri]\n case 'http':\n return [`https${ uri.substr(4)}`, uri]\n case 'ipfs':\n const hash = uri.match(/^ipfs:(\\/\\/)?(.*)$/i)?.[2]\n return [`https://cloudflare-ipfs.com/ipfs/${hash}/`, `https://ipfs.io/ipfs/${hash}/`]\n case 'ipns':\n const name = uri.match(/^ipns:(\\/\\/)?(.*)$/i)?.[2]\n return [`https://cloudflare-ipfs.com/ipns/${name}/`, `https://ipfs.io/ipns/${name}/`]\n default:\n return []\n }\n}\n","/**\n * Returns true if the string value is zero in hex\n * @param hexNumberString\n */\nexport default function isZero(hexNumberString: string) {\n return /^0x0*$/.test(hexNumberString)\n}\n","import { useMemo } from 'react'\nimport contenthashToUri from '../utils/contenthashToUri'\nimport { parseENSAddress } from '../utils/parseENSAddress'\nimport uriToHttp from '../utils/uriToHttp'\nimport useENSContentHash from './useENSContentHash'\n\nexport default function useHttpLocations(uri: string | undefined): string[] {\n const ens = useMemo(() => (uri ? parseENSAddress(uri) : undefined), [uri])\n const resolvedContentHash = useENSContentHash(ens?.ensName)\n return useMemo(() => {\n if (ens) {\n return resolvedContentHash.contenthash ? uriToHttp(contenthashToUri(resolvedContentHash.contenthash)) : []\n } \n return uri ? uriToHttp(uri) : []\n \n }, [ens, resolvedContentHash.contenthash, uri])\n}\n","import { namehash } from 'ethers/lib/utils'\nimport { useMemo } from 'react'\nimport { useSingleCallResult } from '../state/multicall/hooks'\nimport isZero from '../utils/isZero'\nimport { useENSRegistrarContract, useENSResolverContract } from './useContract'\n\n/**\n * Does a lookup for an ENS name to find its contenthash.\n */\nexport default function useENSContentHash(ensName?: string | null): { loading: boolean; contenthash: string | null } {\n const ensNodeArgument = useMemo(() => {\n if (!ensName) return [undefined]\n try {\n return ensName ? [namehash(ensName)] : [undefined]\n } catch (error) {\n return [undefined]\n }\n }, [ensName])\n const registrarContract = useENSRegistrarContract(false)\n const resolverAddressResult = useSingleCallResult(registrarContract, 'resolver', ensNodeArgument)\n const resolverAddress = resolverAddressResult.result?.[0]\n const resolverContract = useENSResolverContract(\n resolverAddress && isZero(resolverAddress) ? undefined : resolverAddress,\n false\n )\n const contenthash = useSingleCallResult(resolverContract, 'contenthash', ensNodeArgument)\n\n return {\n contenthash: contenthash.result?.[0] ?? null,\n loading: resolverAddressResult.loading || contenthash.loading\n }\n}\n","import React, { useState } from 'react'\nimport { HelpCircle } from 'react-feather'\n\nconst BAD_SRCS: { [tokenAddress: string]: true } = {}\n\nexport interface LogoProps {\n alt?: string\n style?: any\n className?: string\n srcs: string[]\n}\n\n/**\n * Renders an image by sequentially trying a list of URIs, and then eventually a fallback triangle alert\n */\nexport default function Logo({ srcs, alt, ...rest }: LogoProps) {\n const [, refresh] = useState(0)\n\n const src: string | undefined = srcs.find((s) => !BAD_SRCS[s])\n\n if (src) {\n return (\n {\n if (src) BAD_SRCS[src] = true\n refresh((i) => i + 1)\n }}\n />\n )\n }\n\n return \n}\n","import React from 'react'\nimport styled from 'styled-components'\nimport useHttpLocations from '../../hooks/useHttpLocations'\n\nimport Logo from '../Logo'\n\nconst StyledListLogo = styled(Logo)<{ size: string }>`\n width: ${({ size }) => size};\n height: ${({ size }) => size};\n`\n\nexport default function ListLogo({\n logoURI,\n style,\n size = '24px',\n alt\n}: {\n logoURI: string\n size?: string\n style?: React.CSSProperties\n alt?: string\n}) {\n const srcs: string[] = useHttpLocations(logoURI)\n\n return \n}\n","import { useEffect, useRef } from 'react'\n\nexport default function useInterval(callback: () => void, delay: null | number, leading = true) {\n const savedCallback = useRef<() => void>()\n\n // Remember the latest callback.\n useEffect(() => {\n savedCallback.current = callback\n }, [callback])\n\n // Set up the interval.\n useEffect(() => {\n function tick() {\n const { current } = savedCallback\n if (current) {\n current()\n }\n }\n\n if (delay !== null) {\n if (leading) tick()\n const id = setInterval(tick, delay)\n return () => clearInterval(id)\n }\n return undefined\n }, [delay, leading])\n}\n","import { Placement } from '@popperjs/core'\nimport { transparentize } from 'polished'\nimport React, { useCallback, useState } from 'react'\nimport { usePopper } from 'react-popper'\nimport styled from 'styled-components'\nimport Portal from '@reach/portal'\nimport useInterval from '../../hooks/useInterval'\n\nconst PopoverContainer = styled.div<{ show: boolean }>`\n z-index: 9999;\n\n visibility: ${(props) => (props.show ? 'visible' : 'hidden')};\n opacity: ${(props) => (props.show ? 1 : 0)};\n transition: visibility 150ms linear, opacity 150ms linear;\n\n background: ${({ theme }) => theme.colors.invertedContrast};\n border: 1px solid ${({ theme }) => theme.colors.tertiary};\n box-shadow: 0 4px 8px 0 ${transparentize(0.9, '#2F80ED')};\n color: ${({ theme }) => theme.colors.textSubtle};\n border-radius: 8px;\n`\n\nconst ReferenceElement = styled.div`\n display: inline-block;\n`\n\nconst Arrow = styled.div`\n width: 8px;\n height: 8px;\n z-index: 9998;\n\n ::before {\n position: absolute;\n width: 8px;\n height: 8px;\n z-index: 9998;\n\n content: '';\n border: 1px solid ${({ theme }) => theme.colors.tertiary};\n transform: rotate(45deg);\n background: ${({ theme }) => theme.colors.invertedContrast};\n }\n\n &.arrow-top {\n bottom: -5px;\n ::before {\n border-top: none;\n border-left: none;\n }\n }\n\n &.arrow-bottom {\n top: -5px;\n ::before {\n border-bottom: none;\n border-right: none;\n }\n }\n\n &.arrow-left {\n right: -5px;\n\n ::before {\n border-bottom: none;\n border-left: none;\n }\n }\n\n &.arrow-right {\n left: -5px;\n ::before {\n border-right: none;\n border-top: none;\n }\n }\n`\n\nexport interface PopoverProps {\n content: React.ReactNode\n show: boolean\n children: React.ReactNode\n placement?: Placement\n}\n\nexport default function Popover({ content, show, children, placement = 'auto' }: PopoverProps) {\n const [referenceElement, setReferenceElement] = useState(null)\n const [popperElement, setPopperElement] = useState(null)\n const [arrowElement, setArrowElement] = useState(null)\n const { styles, update, attributes } = usePopper(referenceElement, popperElement, {\n placement,\n strategy: 'fixed',\n modifiers: [\n { name: 'offset', options: { offset: [8, 8] } },\n { name: 'arrow', options: { element: arrowElement } },\n ],\n })\n const updateCallback = useCallback(() => {\n if (update) {\n update()\n }\n }, [update])\n useInterval(updateCallback, show ? 100 : null)\n\n return (\n <>\n {children}\n \n \n {content}\n \n \n \n \n )\n}\n","import React, { useCallback, useState } from 'react'\nimport styled from 'styled-components'\nimport Popover, { PopoverProps } from '../Popover'\n\nconst TooltipContainer = styled.div`\n width: 228px;\n padding: 0.6rem 1rem;\n line-height: 150%;\n font-weight: 400;\n`\n\ninterface TooltipProps extends Omit {\n text: string\n}\n\nexport default function Tooltip({ text, ...rest }: TooltipProps) {\n return {text}} {...rest} />\n}\n\nexport function MouseoverTooltip({ children, ...rest }: Omit) {\n const [show, setShow] = useState(false)\n const open = useCallback(() => setShow(true), [setShow])\n const close = useCallback(() => setShow(false), [setShow])\n return (\n \n
\n {children}\n
\n
\n )\n}\n","import React, { useCallback, useState } from 'react'\nimport { HelpCircle as Question } from 'react-feather'\nimport styled from 'styled-components'\nimport Tooltip from '../Tooltip'\n\nconst QuestionWrapper = styled.div`\n display: flex;\n align-items: center;\n justify-content: center;\n padding: 0.2rem;\n border: none;\n background: none;\n outline: none;\n cursor: default;\n border-radius: 36px;\n background-color: ${({ theme }) => theme.colors.invertedContrast};\n color: ${({ theme }) => theme.colors.textSubtle};\n\n :hover,\n :focus {\n opacity: 0.7;\n }\n`\n\nexport default function QuestionHelper({ text }: { text: string }) {\n const [show, setShow] = useState(false)\n\n const open = useCallback(() => setShow(true), [setShow])\n const close = useCallback(() => setShow(false), [setShow])\n\n return (\n \n \n \n \n \n \n \n )\n}\n","import styled from 'styled-components'\nimport Logo from '../Logo'\n\nconst CoinLogo = styled(Logo)<{ size: string }>`\n width: ${({ size }) => size};\n height: ${({ size }) => size};\n`\n\nexport default CoinLogo\n","import { Currency, ETHER, Token } from '@pancakeswap-libs/sdk'\nimport React, { useMemo } from 'react'\nimport styled from 'styled-components'\nimport useHttpLocations from '../../hooks/useHttpLocations'\nimport { WrappedTokenInfo } from '../../state/lists/hooks'\nimport Logo from '../Logo'\nimport CoinLogo from '../pancake/CoinLogo'\n\nconst getTokenLogoURL = (address: string) =>\n `https://raw.githubusercontent.com/trustwallet/assets/master/blockchains/smartchain/assets/${address}/logo.png`\n\nconst StyledBnbLogo = styled.img<{ size: string }>`\n width: ${({ size }) => size};\n height: ${({ size }) => size};\n box-shadow: 0px 6px 10px rgba(0, 0, 0, 0.075);\n border-radius: 24px;\n`\n\nconst StyledLogo = styled(Logo)<{ size: string }>`\n width: ${({ size }) => size};\n height: ${({ size }) => size};\n`\n\nexport default function CurrencyLogo({\n currency,\n size = '24px',\n style,\n}: {\n currency?: Currency\n size?: string\n style?: React.CSSProperties\n}) {\n const uriLocations = useHttpLocations(currency instanceof WrappedTokenInfo ? currency.logoURI : undefined)\n\n const srcs: string[] = useMemo(() => {\n if (currency === ETHER) return []\n\n if (currency instanceof Token) {\n if (currency instanceof WrappedTokenInfo) {\n return [...uriLocations, `/images/coins/${currency?.address ?? 'token'}.png`, getTokenLogoURL(currency.address)]\n }\n\n return [`/images/coins/${currency?.address ?? 'token'}.png`, getTokenLogoURL(currency.address)]\n }\n return []\n }, [currency, uriLocations])\n\n if (currency === ETHER) {\n return \n }\n\n return (currency as any)?.symbol ? (\n \n ) : (\n \n )\n}\n","import React from 'react'\nimport { Text } from '@pancakeswap-libs/uikit'\nimport { ChainId, Currency, currencyEquals, ETHER, Token } from '@pancakeswap-libs/sdk'\nimport styled from 'styled-components'\n\nimport useI18n from 'hooks/useI18n'\nimport { SUGGESTED_BASES } from '../../constants'\nimport { AutoColumn } from '../Column'\nimport QuestionHelper from '../QuestionHelper'\nimport { AutoRow } from '../Row'\nimport CurrencyLogo from '../CurrencyLogo'\n\nconst BaseWrapper = styled.div<{ disable?: boolean }>`\n border: 1px solid ${({ theme, disable }) => (disable ? 'transparent' : theme.colors.tertiary)};\n border-radius: 10px;\n display: flex;\n padding: 6px;\n\n align-items: center;\n :hover {\n cursor: ${({ disable }) => !disable && 'pointer'};\n background-color: ${({ theme, disable }) => !disable && theme.colors.invertedContrast};\n }\n\n background-color: ${({ theme, disable }) => disable && theme.colors.tertiary};\n opacity: ${({ disable }) => disable && '0.4'};\n`\n\nexport default function CommonBases({\n chainId,\n onSelect,\n selectedCurrency,\n}: {\n chainId?: ChainId\n selectedCurrency?: Currency | null\n onSelect: (currency: Currency) => void\n}) {\n const TranslateString = useI18n()\n return (\n \n \n Common bases\n \n \n \n {\n if (!selectedCurrency || !currencyEquals(selectedCurrency, ETHER)) {\n onSelect(ETHER)\n }\n }}\n disable={selectedCurrency === ETHER}\n >\n \n BNB\n \n {(chainId ? SUGGESTED_BASES[chainId] : []).map((token: Token) => {\n const selected = selectedCurrency instanceof Token && selectedCurrency.address === token.address\n return (\n !selected && onSelect(token)} disable={selected} key={token.address}>\n \n {token.symbol}\n \n )\n })}\n \n \n )\n}\n","import styled from 'styled-components'\nimport { AutoColumn } from '../Column'\nimport { RowBetween, RowFixed } from '../Row'\n\nexport const FadedSpan = styled(RowFixed)`\n color: ${({ theme }) => theme.colors.primary};\n font-size: 14px;\n`\n\nexport const PaddedColumn = styled(AutoColumn)`\n padding: 20px;\n padding-bottom: 12px;\n`\n\nexport const MenuItem = styled(RowBetween)`\n padding: 4px 20px;\n height: 56px;\n display: grid;\n grid-template-columns: auto minmax(auto, 1fr) auto minmax(0, 72px);\n grid-gap: 16px;\n cursor: ${({ disabled }) => !disabled && 'pointer'};\n pointer-events: ${({ disabled }) => disabled && 'none'};\n :hover {\n background-color: ${({ theme, disabled }) => !disabled && theme.colors.invertedContrast};\n }\n opacity: ${({ disabled, selected }) => (disabled || selected ? 0.5 : 1)};\n`\n\nexport const SearchInput = styled.input`\n position: relative;\n display: flex;\n padding: 16px;\n align-items: center;\n width: 100%;\n white-space: nowrap;\n background: none;\n border: none;\n outline: none;\n border-radius: 20px;\n color: ${({ theme }) => theme.colors.text};\n border-style: solid;\n border: 1px solid ${({ theme }) => theme.colors.tertiary};\n -webkit-appearance: none;\n\n font-size: 18px;\n\n ::placeholder {\n color: ${({ theme }) => theme.colors.textDisabled};\n }\n transition: border 100ms;\n :focus {\n border: 1px solid ${({ theme }) => theme.colors.primary};\n outline: none;\n }\n`\nexport const Separator = styled.div`\n width: 100%;\n height: 1px;\n background-color: ${({ theme }) => theme.colors.invertedContrast};\n`\n\nexport const SeparatorDark = styled.div`\n width: 100%;\n height: 1px;\n background-color: ${({ theme }) => theme.colors.tertiary};\n`\n","import { Currency, CurrencyAmount, currencyEquals, ETHER, Token } from '@pancakeswap-libs/sdk'\nimport React, { CSSProperties, MutableRefObject, useCallback, useMemo } from 'react'\nimport { FixedSizeList } from 'react-window'\nimport styled from 'styled-components'\nimport { Text } from '@pancakeswap-libs/uikit'\nimport { useActiveWeb3React } from '../../hooks'\nimport { useSelectedTokenList, WrappedTokenInfo } from '../../state/lists/hooks'\nimport { useAddUserToken, useRemoveUserAddedToken } from '../../state/user/hooks'\nimport { useCurrencyBalance } from '../../state/wallet/hooks'\nimport { LinkStyledButton } from '../Shared'\nimport { useIsUserAddedToken } from '../../hooks/Tokens'\nimport Column from '../Column'\nimport { RowFixed } from '../Row'\nimport CurrencyLogo from '../CurrencyLogo'\nimport { MouseoverTooltip } from '../Tooltip'\nimport { FadedSpan, MenuItem } from './styleds'\nimport Loader from '../Loader'\nimport { isTokenOnList } from '../../utils'\n\nfunction currencyKey(currency: Currency): string {\n return currency instanceof Token ? currency.address : currency === ETHER ? 'ETHER' : ''\n}\n\nconst StyledBalanceText = styled(Text)`\n white-space: nowrap;\n overflow: hidden;\n max-width: 5rem;\n text-overflow: ellipsis;\n`\n\nconst Tag = styled.div`\n background-color: ${({ theme }) => theme.colors.tertiary};\n color: ${({ theme }) => theme.colors.textSubtle};\n font-size: 14px;\n border-radius: 4px;\n padding: 0.25rem 0.3rem 0.25rem 0.3rem;\n max-width: 6rem;\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n justify-self: flex-end;\n margin-right: 4px;\n`\n\nfunction Balance({ balance }: { balance: CurrencyAmount }) {\n return {balance.toSignificant(4)}\n}\n\nconst TagContainer = styled.div`\n display: flex;\n justify-content: flex-end;\n`\n\nfunction TokenTags({ currency }: { currency: Currency }) {\n if (!(currency instanceof WrappedTokenInfo)) {\n return \n }\n\n const { tags } = currency\n if (!tags || tags.length === 0) return \n\n const tag = tags[0]\n\n return (\n \n \n {tag.name}\n \n {tags.length > 1 ? (\n `${name}: ${description}`)\n .join('; \\n')}\n >\n ...\n \n ) : null}\n \n )\n}\n\nfunction CurrencyRow({\n currency,\n onSelect,\n isSelected,\n otherSelected,\n style,\n}: {\n currency: Currency\n onSelect: () => void\n isSelected: boolean\n otherSelected: boolean\n style: CSSProperties\n}) {\n const { account, chainId } = useActiveWeb3React()\n const key = currencyKey(currency)\n const selectedTokenList = useSelectedTokenList()\n const isOnSelectedList = isTokenOnList(selectedTokenList, currency)\n const customAdded = useIsUserAddedToken(currency)\n const balance = useCurrencyBalance(account ?? undefined, currency)\n\n const removeToken = useRemoveUserAddedToken()\n const addToken = useAddUserToken()\n\n // only show add or remove buttons if not on selected list\n return (\n (isSelected ? null : onSelect())}\n disabled={isSelected}\n selected={otherSelected}\n >\n \n \n {currency.symbol}\n \n {!isOnSelectedList && customAdded && !(currency instanceof WrappedTokenInfo) ? (\n \n Added by user\n {\n event.stopPropagation()\n if (chainId && currency instanceof Token) removeToken(chainId, currency.address)\n }}\n >\n (Remove)\n \n \n ) : null}\n {!isOnSelectedList && !customAdded && !(currency instanceof WrappedTokenInfo) ? (\n \n Found by address\n {\n event.stopPropagation()\n if (currency instanceof Token) addToken(currency)\n }}\n >\n (Add)\n \n \n ) : null}\n \n \n \n \n {balance ? : account ? : null}\n \n \n )\n}\n\nexport default function CurrencyList({\n height,\n currencies,\n selectedCurrency,\n onCurrencySelect,\n otherCurrency,\n fixedListRef,\n showETH,\n}: {\n height: number\n currencies: Currency[]\n selectedCurrency?: Currency | null\n onCurrencySelect: (currency: Currency) => void\n otherCurrency?: Currency | null\n fixedListRef?: MutableRefObject\n showETH: boolean\n}) {\n const itemData = useMemo(() => (showETH ? [Currency.ETHER, ...currencies] : [...currencies]), [currencies, showETH])\n\n const Row = useCallback(\n ({ data, index, style }) => {\n const currency: Currency = data[index]\n const isSelected = Boolean(selectedCurrency && currencyEquals(selectedCurrency, currency))\n const otherSelected = Boolean(otherCurrency && currencyEquals(otherCurrency, currency))\n const handleSelect = () => onCurrencySelect(currency)\n return (\n \n )\n },\n [onCurrencySelect, otherCurrency, selectedCurrency]\n )\n\n const itemKey = useCallback((index: number, data: any) => currencyKey(data[index]), [])\n\n return (\n \n {Row}\n \n )\n}\n","import { Token } from '@pancakeswap-libs/sdk'\nimport { isAddress } from '../../utils'\n\nexport function filterTokens(tokens: Token[], search: string): Token[] {\n if (search.length === 0) return tokens\n\n const searchingAddress = isAddress(search)\n\n if (searchingAddress) {\n return tokens.filter((token) => token.address === searchingAddress)\n }\n\n const lowerSearchParts = search\n .toLowerCase()\n .split(/\\s+/)\n .filter((s) => s.length > 0)\n\n if (lowerSearchParts.length === 0) {\n return tokens\n }\n\n const matchesSearch = (s: string): boolean => {\n const sParts = s\n .toLowerCase()\n .split(/\\s+/)\n .filter((str) => str.length > 0)\n\n return lowerSearchParts.every((p) => p.length === 0 || sParts.some((sp) => sp.startsWith(p) || sp.endsWith(p)))\n }\n\n return tokens.filter((token) => {\n const { symbol, name } = token\n\n return (symbol && matchesSearch(symbol)) || (name && matchesSearch(name))\n })\n}\n\nexport default filterTokens\n","import React from 'react'\nimport { Text } from '@pancakeswap-libs/uikit'\nimport styled from 'styled-components'\nimport { RowFixed } from '../Row'\n\nexport const FilterWrapper = styled(RowFixed)`\n padding: 8px;\n background-color: ${({ theme }) => theme.colors.invertedContrast};\n color: ${({ theme }) => theme.colors.text};\n border-radius: 8px;\n user-select: none;\n & > * {\n user-select: none;\n }\n :hover {\n cursor: pointer;\n }\n`\n\nexport default function SortButton({\n toggleSortOrder,\n ascending\n}: {\n toggleSortOrder: () => void\n ascending: boolean\n}) {\n return (\n \n {ascending ? '↑' : '↓'}\n \n )\n}\n","import { Token, TokenAmount } from '@pancakeswap-libs/sdk'\nimport { useMemo } from 'react'\nimport { useAllTokenBalances } from '../../state/wallet/hooks'\n\n// compare two token amounts with highest one coming first\nfunction balanceComparator(balanceA?: TokenAmount, balanceB?: TokenAmount) {\n if (balanceA && balanceB) {\n return balanceA.greaterThan(balanceB) ? -1 : balanceA.equalTo(balanceB) ? 0 : 1\n }\n if (balanceA && balanceA.greaterThan('0')) {\n return -1\n }\n if (balanceB && balanceB.greaterThan('0')) {\n return 1\n }\n return 0\n}\n\nfunction getTokenComparator(balances: {\n [tokenAddress: string]: TokenAmount | undefined\n}): (tokenA: Token, tokenB: Token) => number {\n return function sortTokens(tokenA: Token, tokenB: Token): number {\n // -1 = a is first\n // 1 = b is first\n\n // sort by balances\n const balanceA = balances[tokenA.address]\n const balanceB = balances[tokenB.address]\n\n const balanceComp = balanceComparator(balanceA, balanceB)\n if (balanceComp !== 0) return balanceComp\n\n if (tokenA.symbol && tokenB.symbol) {\n // sort by symbol\n return tokenA.symbol.toLowerCase() < tokenB.symbol.toLowerCase() ? -1 : 1\n }\n return tokenA.symbol ? -1 : tokenB.symbol ? -1 : 0\n }\n}\n\nexport function useTokenComparator(inverted: boolean): (tokenA: Token, tokenB: Token) => number {\n const balances = useAllTokenBalances()\n const comparator = useMemo(() => getTokenComparator(balances ?? {}), [balances])\n return useMemo(() => {\n if (inverted) {\n return (tokenA: Token, tokenB: Token) => comparator(tokenA, tokenB) * -1\n }\n return comparator\n }, [inverted, comparator])\n}\n\nexport default useTokenComparator\n","import { Currency, ETHER, Token } from '@pancakeswap-libs/sdk'\nimport React, { KeyboardEvent, RefObject, useCallback, useContext, useEffect, useMemo, useRef, useState } from 'react'\nimport { Text, CloseIcon } from '@pancakeswap-libs/uikit'\nimport { useSelector } from 'react-redux'\nimport { useTranslation } from 'react-i18next'\nimport { FixedSizeList } from 'react-window'\nimport { ThemeContext } from 'styled-components'\nimport AutoSizer from 'react-virtualized-auto-sizer'\nimport useI18n from 'hooks/useI18n'\nimport { useActiveWeb3React } from '../../hooks'\nimport { AppState } from '../../state'\nimport { useAllTokens, useToken } from '../../hooks/Tokens'\nimport { useSelectedListInfo } from '../../state/lists/hooks'\nimport { LinkStyledButton } from '../Shared'\nimport { isAddress } from '../../utils'\nimport Card from '../Card'\nimport Column from '../Column'\nimport ListLogo from '../ListLogo'\nimport QuestionHelper from '../QuestionHelper'\nimport Row, { RowBetween } from '../Row'\nimport CommonBases from './CommonBases'\nimport CurrencyList from './CurrencyList'\nimport { filterTokens } from './filtering'\nimport SortButton from './SortButton'\nimport { useTokenComparator } from './sorting'\nimport { PaddedColumn, SearchInput, Separator } from './styleds'\n\ninterface CurrencySearchProps {\n isOpen: boolean\n onDismiss: () => void\n selectedCurrency?: Currency | null\n onCurrencySelect: (currency: Currency) => void\n otherSelectedCurrency?: Currency | null\n showCommonBases?: boolean\n onChangeList: () => void\n}\n\nexport function CurrencySearch({\n selectedCurrency,\n onCurrencySelect,\n otherSelectedCurrency,\n showCommonBases,\n onDismiss,\n isOpen,\n onChangeList,\n}: CurrencySearchProps) {\n const { t } = useTranslation()\n const { chainId } = useActiveWeb3React()\n const theme = useContext(ThemeContext)\n\n const fixedList = useRef()\n const [searchQuery, setSearchQuery] = useState('')\n const [invertSearchOrder, setInvertSearchOrder] = useState(false)\n const allTokens = useAllTokens()\n\n // if they input an address, use it\n const isAddressSearch = isAddress(searchQuery)\n const searchToken = useToken(searchQuery)\n\n const showETH: boolean = useMemo(() => {\n const s = searchQuery.toLowerCase().trim()\n return s === '' || s === 'b' || s === 'bn' || s === 'bnb'\n }, [searchQuery])\n\n const tokenComparator = useTokenComparator(invertSearchOrder)\n\n const audioPlay = useSelector((state) => state.user.audioPlay)\n\n const filteredTokens: Token[] = useMemo(() => {\n if (isAddressSearch) return searchToken ? [searchToken] : []\n return filterTokens(Object.values(allTokens), searchQuery)\n }, [isAddressSearch, searchToken, allTokens, searchQuery])\n\n const filteredSortedTokens: Token[] = useMemo(() => {\n if (searchToken) return [searchToken]\n const sorted = filteredTokens.sort(tokenComparator)\n const symbolMatch = searchQuery\n .toLowerCase()\n .split(/\\s+/)\n .filter((s) => s.length > 0)\n if (symbolMatch.length > 1) return sorted\n\n return [\n ...(searchToken ? [searchToken] : []),\n // sort any exact symbol matches first\n ...sorted.filter((token) => token.symbol?.toLowerCase() === symbolMatch[0]),\n ...sorted.filter((token) => token.symbol?.toLowerCase() !== symbolMatch[0]),\n ]\n }, [filteredTokens, searchQuery, searchToken, tokenComparator])\n\n const handleCurrencySelect = useCallback(\n (currency: Currency) => {\n onCurrencySelect(currency)\n onDismiss()\n if (audioPlay) {\n const audio = document.getElementById('bgMusic') as HTMLAudioElement\n if (audio) {\n audio.play()\n }\n }\n },\n [onDismiss, onCurrencySelect, audioPlay]\n )\n\n // clear the input on open\n useEffect(() => {\n if (isOpen) setSearchQuery('')\n }, [isOpen])\n\n // manage focus on modal show\n const inputRef = useRef()\n const handleInput = useCallback((event) => {\n const input = event.target.value\n const checksummedInput = isAddress(input)\n setSearchQuery(checksummedInput || input)\n fixedList.current?.scrollTo(0)\n }, [])\n\n const handleEnter = useCallback(\n (e: KeyboardEvent) => {\n if (e.key === 'Enter') {\n const s = searchQuery.toLowerCase().trim()\n if (s === 'bnb') {\n handleCurrencySelect(ETHER)\n } else if (filteredSortedTokens.length > 0) {\n if (\n filteredSortedTokens[0].symbol?.toLowerCase() === searchQuery.trim().toLowerCase() ||\n filteredSortedTokens.length === 1\n ) {\n handleCurrencySelect(filteredSortedTokens[0])\n }\n }\n }\n },\n [filteredSortedTokens, handleCurrencySelect, searchQuery]\n )\n\n const selectedListInfo = useSelectedListInfo()\n const TranslateString = useI18n()\n return (\n \n \n \n \n {TranslateString(82, 'Select a token')}\n \n \n \n \n }\n onChange={handleInput}\n onKeyDown={handleEnter}\n />\n {showCommonBases && (\n \n )}\n \n {TranslateString(126, 'Token name')}\n setInvertSearchOrder((iso) => !iso)} />\n \n \n\n \n\n
\n \n {({ height }) => (\n \n )}\n \n
\n\n {null && (\n <>\n \n \n \n {selectedListInfo.current ? (\n \n {selectedListInfo.current.logoURI ? (\n \n ) : null}\n {selectedListInfo.current.name}\n \n ) : null}\n \n {selectedListInfo.current ? TranslateString(180, 'Change') : TranslateString(1152, 'Select a list')}\n \n \n \n \n )}\n
\n )\n}\n\nexport default CurrencySearch\n","export const DEFAULT_TOKEN_LIST_URL = 'pancakeswap'\n\nexport const DEFAULT_LIST_OF_LISTS: string[] = [DEFAULT_TOKEN_LIST_URL]\n","import { TokenList } from '@uniswap/token-lists'\nimport schema from '@uniswap/token-lists/src/tokenlist.schema.json'\nimport Ajv from 'ajv'\nimport contenthashToUri from './contenthashToUri'\nimport { parseENSAddress } from './parseENSAddress'\nimport uriToHttp from './uriToHttp'\n\n// bakeryswap defaultTokenJson\nimport { DEFAULT_TOKEN_LIST_URL } from '../constants/lists'\nimport defaultTokenJson from '../constants/token/pancakeswap.json'\n\nconst tokenListValidator = new Ajv({ allErrors: true }).compile(schema)\n\n/**\n * Contains the logic for resolving a list URL to a validated token list\n * @param listUrl list url\n * @param resolveENSContentHash resolves an ens name to a contenthash\n */\nexport default async function getTokenList(\n listUrl: string,\n resolveENSContentHash: (ensName: string) => Promise\n): Promise {\n if (listUrl === DEFAULT_TOKEN_LIST_URL) {\n return defaultTokenJson\n }\n const parsedENS = parseENSAddress(listUrl)\n\n let urls: string[]\n if (parsedENS) {\n let contentHashUri\n try {\n contentHashUri = await resolveENSContentHash(parsedENS.ensName)\n } catch (error) {\n console.error(`Failed to resolve ENS name: ${parsedENS.ensName}`, error)\n throw new Error(`Failed to resolve ENS name: ${parsedENS.ensName}`)\n }\n let translatedUri\n try {\n translatedUri = contenthashToUri(contentHashUri)\n } catch (error) {\n console.error('Failed to translate contenthash to URI', contentHashUri)\n throw new Error(`Failed to translate contenthash to URI: ${contentHashUri}`)\n }\n urls = uriToHttp(`${translatedUri}${parsedENS.ensPath ?? ''}`)\n } else {\n urls = uriToHttp(listUrl)\n }\n for (let i = 0; i < urls.length; i++) {\n const url = urls[i]\n const isLast = i === urls.length - 1\n let response\n try {\n response = await fetch(url)\n } catch (error) {\n console.error('Failed to fetch list', listUrl, error)\n if (isLast) throw new Error(`Failed to download list ${listUrl}`)\n // eslint-disable-next-line no-continue\n continue\n }\n\n if (!response.ok) {\n if (isLast) throw new Error(`Failed to download list ${listUrl}`)\n // eslint-disable-next-line no-continue\n continue\n }\n\n const json = await response.json()\n if (!tokenListValidator(json)) {\n const validationErrors: string =\n tokenListValidator.errors?.reduce((memo, error) => {\n const add = `${error.dataPath} ${error.message ?? ''}`\n return memo.length > 0 ? `${memo}; ${add}` : `${add}`\n }, '') ?? 'unknown error'\n throw new Error(`Token list failed validation: ${validationErrors}`)\n }\n return json\n }\n throw new Error('Unrecognized list URL protocol.')\n}\n","import { Contract } from '@ethersproject/contracts'\nimport { Provider } from '@ethersproject/abstract-provider'\nimport { namehash } from 'ethers/lib/utils'\n\nconst REGISTRAR_ABI = [\n {\n constant: true,\n inputs: [\n {\n name: 'node',\n type: 'bytes32'\n }\n ],\n name: 'resolver',\n outputs: [\n {\n name: 'resolverAddress',\n type: 'address'\n }\n ],\n payable: false,\n stateMutability: 'view',\n type: 'function'\n }\n]\nconst REGISTRAR_ADDRESS = '0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e'\n\nconst RESOLVER_ABI = [\n {\n constant: true,\n inputs: [\n {\n internalType: 'bytes32',\n name: 'node',\n type: 'bytes32'\n }\n ],\n name: 'contenthash',\n outputs: [\n {\n internalType: 'bytes',\n name: '',\n type: 'bytes'\n }\n ],\n payable: false,\n stateMutability: 'view',\n type: 'function'\n }\n]\n\n// cache the resolver contracts since most of them are the public resolver\nfunction resolverContract(resolverAddress: string, provider: Provider): Contract {\n return new Contract(resolverAddress, RESOLVER_ABI, provider)\n}\n\n/**\n * Fetches and decodes the result of an ENS contenthash lookup on mainnet to a URI\n * @param ensName to resolve\n * @param provider provider to use to fetch the data\n */\nexport default async function resolveENSContentHash(ensName: string, provider: Provider): Promise {\n const ensRegistrarContract = new Contract(REGISTRAR_ADDRESS, REGISTRAR_ABI, provider)\n const hash = namehash(ensName)\n const resolverAddress = await ensRegistrarContract.resolver(hash)\n return resolverContract(resolverAddress, provider).contenthash(hash)\n}\n","import { nanoid } from '@reduxjs/toolkit'\nimport { ChainId } from '@pancakeswap-libs/sdk'\nimport { TokenList } from '@uniswap/token-lists'\nimport { useCallback } from 'react'\nimport { useDispatch } from 'react-redux'\nimport { getNetworkLibrary, NETWORK_CHAIN_ID } from '../connectors'\nimport { AppDispatch } from '../state'\nimport { fetchTokenList } from '../state/lists/actions'\nimport getTokenList from '../utils/getTokenList'\nimport resolveENSContentHash from '../utils/resolveENSContentHash'\nimport { useActiveWeb3React } from './index'\n\nexport function useFetchListCallback(): (listUrl: string) => Promise {\n const { chainId, library } = useActiveWeb3React()\n const dispatch = useDispatch()\n\n const ensResolver = useCallback(\n (ensName: string) => {\n if (!library || chainId !== ChainId.MAINNET) {\n if (NETWORK_CHAIN_ID === ChainId.MAINNET) {\n const networkLibrary = getNetworkLibrary()\n if (networkLibrary) {\n return resolveENSContentHash(ensName, networkLibrary)\n }\n }\n throw new Error('Could not construct mainnet ENS resolver')\n }\n return resolveENSContentHash(ensName, library)\n },\n [chainId, library]\n )\n\n return useCallback(\n async (listUrl: string) => {\n const requestId = nanoid()\n dispatch(fetchTokenList.pending({ requestId, url: listUrl }))\n return getTokenList(listUrl, ensResolver)\n .then((tokenList) => {\n dispatch(fetchTokenList.fulfilled({ url: listUrl, tokenList, requestId }))\n return tokenList\n })\n .catch((error) => {\n console.error(`Failed to get list at url ${listUrl}`, error)\n dispatch(fetchTokenList.rejected({ url: listUrl, requestId, errorMessage: error.message }))\n throw error\n })\n },\n [dispatch, ensResolver]\n )\n}\n\nexport default useFetchListCallback\n","import { RefObject, useEffect, useRef } from 'react'\n\nexport function useOnClickOutside(\n node: RefObject,\n handler: undefined | (() => void)\n) {\n const handlerRef = useRef void)>(handler)\n useEffect(() => {\n handlerRef.current = handler\n }, [handler])\n\n useEffect(() => {\n const handleClickOutside = (e: MouseEvent) => {\n if (node.current?.contains(e.target as Node) ?? false) {\n return\n }\n if (handlerRef.current) handlerRef.current()\n }\n\n document.addEventListener('mousedown', handleClickOutside)\n\n return () => {\n document.removeEventListener('mousedown', handleClickOutside)\n }\n }, [node])\n}\n\nexport default useOnClickOutside\n","import React, { memo, useCallback, useMemo, useRef, useState } from 'react'\nimport { ArrowLeft } from 'react-feather'\nimport { usePopper } from 'react-popper'\nimport { useDispatch, useSelector } from 'react-redux'\nimport { Button, Text, ChevronDownIcon, CloseIcon } from '@pancakeswap-libs/uikit'\nimport styled from 'styled-components'\nimport useI18n from 'hooks/useI18n'\nimport { useFetchListCallback } from '../../hooks/useFetchListCallback'\nimport { useOnClickOutside } from '../../hooks/useOnClickOutside'\nimport useToggle from '../../hooks/useToggle'\nimport { AppDispatch, AppState } from '../../state'\nimport { acceptListUpdate, removeList, selectList } from '../../state/lists/actions'\nimport { useSelectedListUrl } from '../../state/lists/hooks'\nimport { ExternalLink, LinkStyledButton } from '../Shared'\nimport listVersionLabel from '../../utils/listVersionLabel'\nimport { parseENSAddress } from '../../utils/parseENSAddress'\nimport uriToHttp from '../../utils/uriToHttp'\nimport Column from '../Column'\nimport ListLogo from '../ListLogo'\nimport QuestionHelper from '../QuestionHelper'\nimport Row, { RowBetween } from '../Row'\nimport { PaddedColumn, SearchInput, Separator, SeparatorDark } from './styleds'\n\nconst UnpaddedLinkStyledButton = styled(LinkStyledButton)`\n padding: 0;\n font-size: 1rem;\n opacity: ${({ disabled }) => (disabled ? '0.4' : '1')};\n`\n\nconst PopoverContainer = styled.div<{ show: boolean }>`\n z-index: 100;\n visibility: ${(props) => (props.show ? 'visible' : 'hidden')};\n opacity: ${(props) => (props.show ? 1 : 0)};\n transition: visibility 150ms linear, opacity 150ms linear;\n background: ${({ theme }) => theme.colors.invertedContrast};\n border: 1px solid ${({ theme }) => theme.colors.tertiary};\n box-shadow: 0px 0px 1px rgba(0, 0, 0, 0.01), 0px 4px 8px rgba(0, 0, 0, 0.04), 0px 16px 24px rgba(0, 0, 0, 0.04),\n 0px 24px 32px rgba(0, 0, 0, 0.01);\n color: ${({ theme }) => theme.colors.textSubtle};\n border-radius: 0.5rem;\n padding: 1rem;\n display: grid;\n grid-template-rows: 1fr;\n grid-gap: 8px;\n font-size: 1rem;\n text-align: left;\n`\n\nconst StyledMenu = styled.div`\n display: flex;\n justify-content: center;\n align-items: center;\n position: relative;\n border: none;\n`\n\nconst StyledListUrlText = styled.div`\n max-width: 160px;\n opacity: 0.6;\n margin-right: 0.5rem;\n font-size: 14px;\n overflow: hidden;\n text-overflow: ellipsis;\n`\n\nfunction ListOrigin({ listUrl }: { listUrl: string }) {\n const ensName = useMemo(() => parseENSAddress(listUrl)?.ensName, [listUrl])\n const host = useMemo(() => {\n if (ensName) return undefined\n const lowerListUrl = listUrl.toLowerCase()\n if (lowerListUrl.startsWith('ipfs://') || lowerListUrl.startsWith('ipns://')) {\n return listUrl\n }\n try {\n const url = new URL(listUrl)\n return url.host\n } catch (error) {\n return undefined\n }\n }, [listUrl, ensName])\n return <>{ensName ?? host}\n}\n\nfunction listUrlRowHTMLId(listUrl: string) {\n return `list-row-${listUrl.replace(/\\./g, '-')}`\n}\n\nconst ListRow = memo(function ListRow({ listUrl, onBack }: { listUrl: string; onBack: () => void }) {\n const listsByUrl = useSelector((state) => state.lists.byUrl)\n const selectedListUrl = useSelectedListUrl()\n const dispatch = useDispatch()\n const { current: list, pendingUpdate: pending } = listsByUrl[listUrl]\n\n const isSelected = listUrl === selectedListUrl\n\n const [open, toggle] = useToggle(false)\n const node = useRef()\n const [referenceElement, setReferenceElement] = useState()\n const [popperElement, setPopperElement] = useState()\n\n const { styles, attributes } = usePopper(referenceElement, popperElement, {\n placement: 'auto',\n strategy: 'fixed',\n modifiers: [{ name: 'offset', options: { offset: [8, 8] } }],\n })\n\n useOnClickOutside(node, open ? toggle : undefined)\n\n const selectThisList = useCallback(() => {\n if (isSelected) return\n\n dispatch(selectList(listUrl))\n onBack()\n }, [dispatch, isSelected, listUrl, onBack])\n\n const handleAcceptListUpdate = useCallback(() => {\n if (!pending) return\n dispatch(acceptListUpdate(listUrl))\n }, [dispatch, listUrl, pending])\n\n const handleRemoveList = useCallback(() => {\n if (window.prompt(`Please confirm you would like to remove this list by typing REMOVE`) === `REMOVE`) {\n dispatch(removeList(listUrl))\n }\n }, [dispatch, listUrl])\n const TranslateString = useI18n()\n if (!list) return null\n\n return (\n \n {list.logoURI ? (\n \n ) : (\n
\n )}\n \n \n \n {list.name}\n \n \n \n \n \n \n \n \n \n
\n \n \n \n
\n\n {open && (\n \n
{list && listVersionLabel(list.version)}
\n \n \n {TranslateString(1206, 'View list')}\n \n \n Remove list\n \n {pending && (\n Update list\n )}\n
\n )}\n
\n {isSelected ? (\n \n ) : (\n <>\n \n Select\n \n \n )}\n \n )\n})\n\nconst ListContainer = styled.div`\n flex: 1;\n overflow: auto;\n`\n\nexport function ListSelect({ onDismiss, onBack }: { onDismiss: () => void; onBack: () => void }) {\n const [listUrlInput, setListUrlInput] = useState('')\n\n const dispatch = useDispatch()\n const lists = useSelector((state) => state.lists.byUrl)\n const adding = Boolean(lists[listUrlInput]?.loadingRequestId)\n const [addError, setAddError] = useState(null)\n\n const handleInput = useCallback((e) => {\n setListUrlInput(e.target.value)\n setAddError(null)\n }, [])\n const fetchList = useFetchListCallback()\n\n const handleAddList = useCallback(() => {\n if (adding) return\n setAddError(null)\n fetchList(listUrlInput)\n .then(() => {\n setListUrlInput('')\n })\n .catch((error) => {\n setAddError(error.message)\n dispatch(removeList(listUrlInput))\n })\n }, [adding, dispatch, fetchList, listUrlInput])\n\n const validUrl: boolean = useMemo(() => {\n return uriToHttp(listUrlInput).length > 0 || Boolean(parseENSAddress(listUrlInput))\n }, [listUrlInput])\n\n const handleEnterKey = useCallback(\n (e) => {\n if (validUrl && e.key === 'Enter') {\n handleAddList()\n }\n },\n [handleAddList, validUrl]\n )\n\n const sortedLists = useMemo(() => {\n const listUrls = Object.keys(lists)\n return listUrls\n .filter((listUrl) => {\n return Boolean(lists[listUrl].current)\n })\n .sort((u1, u2) => {\n const { current: l1 } = lists[u1]\n const { current: l2 } = lists[u2]\n if (l1 && l2) {\n return l1.name.toLowerCase() < l2.name.toLowerCase()\n ? -1\n : l1.name.toLowerCase() === l2.name.toLowerCase()\n ? 0\n : 1\n }\n if (l1) return -1\n if (l2) return 1\n return 0\n })\n }, [lists])\n const TranslateString = useI18n()\n return (\n \n \n \n
\n \n
\n {TranslateString(1208, 'Manage Lists')}\n \n
\n
\n\n \n\n \n \n Add a list{' '}\n \n \n \n \n \n \n {addError ? (\n \n {addError}\n \n ) : null}\n \n\n \n\n \n {sortedLists.map((listUrl) => (\n \n ))}\n \n \n\n
\n Browse lists\n
\n
\n )\n}\n\nexport default ListSelect\n","import { useCallback, useState } from 'react'\n\nexport default function useToggle(initialState = false): [boolean, () => void] {\n const [state, setState] = useState(initialState)\n const toggle = useCallback(() => setState((prev) => !prev), [])\n return [state, toggle]\n}\n","import { Currency } from '@pancakeswap-libs/sdk'\nimport React, { useCallback, useEffect, useState } from 'react'\nimport useLast from '../../hooks/useLast'\nimport { useSelectedListUrl } from '../../state/lists/hooks'\nimport Modal from '../Modal'\nimport { CurrencySearch } from './CurrencySearch'\nimport { ListSelect } from './ListSelect'\n\ninterface CurrencySearchModalProps {\n isOpen: boolean\n onDismiss: () => void\n selectedCurrency?: Currency | null\n onCurrencySelect: (currency: Currency) => void\n otherSelectedCurrency?: Currency | null\n // eslint-disable-next-line react/no-unused-prop-types\n showCommonBases?: boolean\n}\n\nexport default function CurrencySearchModal({\n isOpen,\n onDismiss,\n onCurrencySelect,\n selectedCurrency,\n otherSelectedCurrency,\n}: CurrencySearchModalProps) {\n const [listView, setListView] = useState(false)\n const lastOpen = useLast(isOpen)\n\n useEffect(() => {\n if (isOpen && !lastOpen) {\n setListView(false)\n }\n }, [isOpen, lastOpen])\n\n const handleCurrencySelect = useCallback(\n (currency: Currency) => {\n onCurrencySelect(currency)\n onDismiss()\n },\n [onDismiss, onCurrencySelect]\n )\n\n const handleClickChangeList = useCallback(() => {\n setListView(true)\n }, [])\n const handleClickBack = useCallback(() => {\n setListView(false)\n }, [])\n\n const selectedListUrl = useSelectedListUrl()\n const noListSelected = !selectedListUrl\n\n return (\n \n {listView ? (\n \n ) : noListSelected ? (\n \n ) : (\n \n )}\n \n )\n}\n","import { Currency } from '@pancakeswap-libs/sdk'\nimport React from 'react'\nimport styled from 'styled-components'\nimport CurrencyLogo from '../CurrencyLogo'\n\nconst Wrapper = styled.div<{ margin: boolean; sizeraw: number }>`\n position: relative;\n display: flex;\n flex-direction: row;\n margin-right: ${({ sizeraw, margin }) => margin && `${(sizeraw / 3 + 8).toString() }px`};\n`\n\ninterface DoubleCurrencyLogoProps {\n margin?: boolean\n size?: number\n currency0?: Currency\n currency1?: Currency\n}\n\nconst HigherLogo = styled(CurrencyLogo)`\n z-index: 2;\n`\nconst CoveredLogo = styled(CurrencyLogo)<{ sizeraw: number }>`\n position: absolute;\n left: ${({ sizeraw }) => `${(sizeraw / 2).toString() }px`};\n`\n\nexport default function DoubleCurrencyLogo({\n currency0,\n currency1,\n size = 16,\n margin = false\n}: DoubleCurrencyLogoProps) {\n return (\n \n {currency0 && }\n {currency1 && }\n \n )\n}\n","import React from 'react'\nimport styled from 'styled-components'\nimport { escapeRegExp } from '../../utils'\n\nconst StyledInput = styled.input<{ error?: boolean; fontSize?: string; align?: string }>`\n color: ${({ error, theme }) => (error ? theme.colors.failure : theme.colors.text)};\n width: 0;\n position: relative;\n font-weight: 500;\n outline: none;\n border: none;\n flex: 1 1 auto;\n background-color: transparent;\n font-size: 16px;\n text-align: ${({ align }) => align && align};\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n padding: 0px;\n -webkit-appearance: textfield;\n\n ::-webkit-search-decoration {\n -webkit-appearance: none;\n }\n\n [type='number'] {\n -moz-appearance: textfield;\n }\n\n ::-webkit-outer-spin-button,\n ::-webkit-inner-spin-button {\n -webkit-appearance: none;\n }\n\n ::placeholder {\n color: ${({ theme }) => theme.colors.textSubtle};\n }\n`\n\nconst inputRegex = RegExp(`^\\\\d*(?:\\\\\\\\[.])?\\\\d*$`) // match escaped \".\" characters via in a non-capturing group\n\nexport const Input = React.memo(function InnerInput({\n value,\n onUserInput,\n placeholder,\n ...rest\n}: {\n value: string | number\n onUserInput: (input: string) => void\n error?: boolean\n fontSize?: string\n align?: 'right' | 'left'\n} & Omit, 'ref' | 'onChange' | 'as'>) {\n const enforcer = (nextUserInput: string) => {\n if (nextUserInput === '' || inputRegex.test(escapeRegExp(nextUserInput))) {\n onUserInput(nextUserInput)\n }\n }\n\n return (\n {\n // replace commas with periods, because uniswap exclusively uses period as the decimal separator\n enforcer(event.target.value.replace(/,/g, '.'))\n }}\n // universal input options\n inputMode=\"decimal\"\n title=\"Token Amount\"\n autoComplete=\"off\"\n autoCorrect=\"off\"\n // text-specific options\n type=\"text\"\n pattern=\"^[0-9]*[.,]?[0-9]*$\"\n placeholder={placeholder || '0.0'}\n minLength={1}\n maxLength={79}\n spellCheck=\"false\"\n />\n )\n})\n\nexport default Input\n","import React, { useState, useCallback } from 'react'\nimport { Currency, Pair } from '@pancakeswap-libs/sdk'\nimport { Button, ChevronDownIcon, Text } from '@pancakeswap-libs/uikit'\nimport styled from 'styled-components'\nimport { darken } from 'polished'\nimport useI18n from 'hooks/useI18n'\nimport { useCurrencyBalance } from '../../state/wallet/hooks'\nimport CurrencySearchModal from '../SearchModal/CurrencySearchModal'\nimport CurrencyLogo from '../CurrencyLogo'\nimport DoubleCurrencyLogo from '../DoubleLogo'\nimport { RowBetween } from '../Row'\nimport { Input as NumericalInput } from '../NumericalInput'\nimport { useActiveWeb3React } from '../../hooks'\n\nconst InputRow = styled.div<{ selected: boolean }>`\n display: flex;\n flex-flow: row nowrap;\n align-items: center;\n padding: ${({ selected }) => (selected ? '0.75rem 0.5rem 0.75rem 1rem' : '0.75rem 0.75rem 0.75rem 1rem')};\n`\nconst CurrencySelect = styled.button<{ selected: boolean }>`\n align-items: center;\n height: 34px;\n font-size: 16px;\n font-weight: 500;\n background-color: transparent;\n color: ${({ selected, theme }) => (selected ? theme.colors.text : '#FFFFFF')};\n border-radius: 12px;\n outline: none;\n cursor: pointer;\n user-select: none;\n border: none;\n padding: 0 0.5rem;\n :focus,\n :hover {\n background-color: ${({ theme }) => darken(0.05, theme.colors.input)};\n }\n`\nconst LabelRow = styled.div`\n display: flex;\n flex-flow: row nowrap;\n align-items: center;\n color: ${({ theme }) => theme.colors.text};\n font-size: 0.75rem;\n line-height: 1rem;\n padding: 0.75rem 1rem 0 1rem;\n span:hover {\n cursor: pointer;\n color: ${({ theme }) => darken(0.2, theme.colors.textSubtle)};\n }\n`\nconst Aligner = styled.span`\n display: flex;\n align-items: center;\n justify-content: space-between;\n`\nconst InputPanel = styled.div<{ hideInput?: boolean }>`\n display: flex;\n flex-flow: column nowrap;\n position: relative;\n border-radius: ${({ hideInput }) => (hideInput ? '8px' : '20px')};\n background-color: ${({ theme }) => theme.colors.background};\n z-index: 1;\n`\nconst Container = styled.div<{ hideInput: boolean }>`\n border-radius: 16px;\n background-color: ${({ theme }) => theme.colors.input};\n box-shadow: ${({ theme }) => theme.shadows.inset};\n`\ninterface CurrencyInputPanelProps {\n value: string\n onUserInput: (value: string) => void\n onMax?: () => void\n showMaxButton: boolean\n label?: string\n onCurrencySelect?: (currency: Currency) => void\n currency?: Currency | null\n disableCurrencySelect?: boolean\n hideBalance?: boolean\n pair?: Pair | null\n hideInput?: boolean\n otherCurrency?: Currency | null\n id: string\n showCommonBases?: boolean\n}\nexport default function CurrencyInputPanel({\n value,\n onUserInput,\n onMax,\n showMaxButton,\n label,\n onCurrencySelect,\n currency,\n disableCurrencySelect = false,\n hideBalance = false,\n pair = null, // used for double token logo\n hideInput = false,\n otherCurrency,\n id,\n showCommonBases,\n}: CurrencyInputPanelProps) {\n const [modalOpen, setModalOpen] = useState(false)\n const { account } = useActiveWeb3React()\n const selectedCurrencyBalance = useCurrencyBalance(account ?? undefined, currency ?? undefined)\n const TranslateString = useI18n()\n const translatedLabel = label || TranslateString(132, 'Input')\n const handleDismissSearch = useCallback(() => {\n setModalOpen(false)\n }, [setModalOpen])\n return (\n \n \n {!hideInput && (\n \n \n {translatedLabel}\n {account && (\n \n {!hideBalance && !!currency && selectedCurrencyBalance\n ? `Balance: ${selectedCurrencyBalance?.toSignificant(6)}`\n : ' -'}\n \n )}\n \n \n )}\n \n {!hideInput && (\n <>\n {\n onUserInput(val)\n }}\n />\n {account && currency && showMaxButton && label !== 'To' && (\n \n )}\n \n )}\n {\n if (!disableCurrencySelect) {\n setModalOpen(true)\n }\n }}\n >\n \n {pair ? (\n \n ) : currency ? (\n \n ) : null}\n {pair ? (\n \n {pair?.token0.symbol}:{pair?.token1.symbol}\n \n ) : (\n \n {(currency && currency.symbol && currency.symbol.length > 20\n ? `${currency.symbol.slice(0, 4)}...${currency.symbol.slice(\n currency.symbol.length - 5,\n currency.symbol.length\n )}`\n : currency?.symbol) || TranslateString(1196, 'Select a currency')}\n \n )}\n {!disableCurrencySelect && }\n \n \n \n \n {!disableCurrencySelect && onCurrencySelect && (\n \n )}\n \n )\n}\n","import React from 'react'\nimport styled from 'styled-components'\nimport { Link as HistoryLink } from 'react-router-dom'\nimport { ArrowLeft } from 'react-feather'\nimport { RowBetween } from 'components/Row'\nimport QuestionHelper from 'components/QuestionHelper'\nimport useI18n from 'hooks/useI18n'\n\nconst Tabs = styled.div`\n display: flex;\n flex-flow: row nowrap;\n align-items: center;\n border-radius: 3rem;\n justify-content: space-evenly;\n`\n\nconst ActiveText = styled.div`\n font-weight: 500;\n font-size: 20px;\n`\n\nconst StyledArrowLeft = styled(ArrowLeft)`\n color: ${({ theme }) => theme.colors.text};\n`\n\nexport function FindPoolTabs() {\n const TranslateString = useI18n()\n return (\n \n \n \n \n \n Import Pool\n \n \n \n )\n}\n\nexport function AddRemoveTabs({ adding }: { adding: boolean }) {\n const TranslateString = useI18n()\n return (\n \n \n \n \n \n {adding ? TranslateString(258, 'Add') : TranslateString(260, 'Remove')} Liquidity\n \n \n \n )\n}\n","import { BigNumber } from '@ethersproject/bignumber'\nimport { Token, TokenAmount } from '@pancakeswap-libs/sdk'\nimport { useTokenContract } from '../hooks/useContract'\nimport { useSingleCallResult } from '../state/multicall/hooks'\n\n// returns undefined if input token is undefined, or fails to get token contract,\n// or contract total supply cannot be fetched\nexport function useTotalSupply(token?: Token): TokenAmount | undefined {\n const contract = useTokenContract(token?.address, false)\n\n const totalSupply: BigNumber = useSingleCallResult(contract, 'totalSupply')?.result?.[0]\n\n return token && totalSupply ? new TokenAmount(token, totalSupply.toString()) : undefined\n}\n\nexport default useTotalSupply\n","import { Currency, ETHER, Token } from '@pancakeswap-libs/sdk'\n\nexport function currencyId(currency: Currency): string {\n if (currency === ETHER) return 'BNB'\n if (currency instanceof Token) return currency.address\n throw new Error('invalid currency')\n}\n\nexport default currencyId\n","import { ChainId, Currency, CurrencyAmount, ETHER, Token, TokenAmount, WETH } from '@pancakeswap-libs/sdk'\n\nexport function wrappedCurrency(currency: Currency | undefined, chainId: ChainId | undefined): Token | undefined {\n // eslint-disable-next-line no-nested-ternary\n return chainId && currency === ETHER ? WETH[chainId] : currency instanceof Token ? currency : undefined\n}\n\nexport function wrappedCurrencyAmount(\n currencyAmount: CurrencyAmount | undefined,\n chainId: ChainId | undefined\n): TokenAmount | undefined {\n const token = currencyAmount && chainId ? wrappedCurrency(currencyAmount.currency, chainId) : undefined\n return token && currencyAmount ? new TokenAmount(token, currencyAmount.raw) : undefined\n}\n\nexport function unwrappedToken(token: Token): Currency {\n if (token.equals(WETH[token.chainId])) return ETHER\n return token\n}\n","import { transparentize } from 'polished'\nimport React from 'react'\nimport { AlertTriangle } from 'react-feather'\nimport { Text } from '@pancakeswap-libs/uikit'\nimport styled, { css } from 'styled-components'\nimport { AutoColumn } from '../Column'\n\nexport const Wrapper = styled.div`\n position: relative;\n`\n\nexport const ArrowWrapper = styled.div<{ clickable: boolean }>`\n padding: 2px;\n\n ${({ clickable }) =>\n clickable\n ? css`\n :hover {\n cursor: pointer;\n opacity: 0.8;\n }\n `\n : null}\n`\n\nexport const SectionBreak = styled.div`\n height: 1px;\n width: 100%;\n background-color: ${({ theme }) => theme.colors.tertiary};\n`\n\nexport const BottomGrouping = styled.div`\n margin-top: 1rem;\n`\n\nexport const ErrorText = styled(Text)<{ severity?: 0 | 1 | 2 | 3 | 4 }>`\n color: ${({ theme, severity }) =>\n severity === 3 || severity === 4\n ? theme.colors.failure\n : severity === 2\n ? theme.colors.binance\n : severity === 1\n ? theme.colors.text\n : theme.colors.success};\n`\n\nexport const StyledBalanceMaxMini = styled.button`\n height: 22px;\n width: 22px;\n background-color: ${({ theme }) => theme.colors.invertedContrast};\n border: none;\n border-radius: 50%;\n padding: 0.2rem;\n font-size: 0.875rem;\n font-weight: 400;\n margin-left: 0.4rem;\n cursor: pointer;\n color: ${({ theme }) => theme.colors.textSubtle};\n display: flex;\n justify-content: center;\n align-items: center;\n float: right;\n\n :hover {\n background-color: ${({ theme }) => theme.colors.tertiary};\n }\n :focus {\n background-color: ${({ theme }) => theme.colors.tertiary};\n outline: none;\n }\n`\n\n// styles\nexport const Dots = styled.span`\n &::after {\n display: inline-block;\n animation: ellipsis 1.25s infinite;\n content: '.';\n width: 1em;\n text-align: left;\n }\n @keyframes ellipsis {\n 0% {\n content: '.';\n }\n 33% {\n content: '..';\n }\n 66% {\n content: '...';\n }\n }\n`\n\nconst SwapCallbackErrorInner = styled.div`\n background-color: ${({ theme }) => transparentize(0.9, theme.colors.failure)};\n border-radius: 1rem;\n display: flex;\n align-items: center;\n font-size: 0.825rem;\n width: 100%;\n padding: 3rem 1.25rem 1rem 1rem;\n margin-top: -2rem;\n color: ${({ theme }) => theme.colors.failure};\n z-index: -1;\n p {\n padding: 0;\n margin: 0;\n font-weight: 500;\n }\n`\n\nconst SwapCallbackErrorInnerAlertTriangle = styled.div`\n background-color: ${({ theme }) => transparentize(0.9, theme.colors.failure)};\n display: flex;\n align-items: center;\n justify-content: center;\n margin-right: 12px;\n border-radius: 12px;\n min-width: 48px;\n height: 48px;\n`\n\nexport function SwapCallbackError({ error }: { error: string }) {\n return (\n \n \n \n \n

{error}

\n
\n )\n}\n\nexport const SwapShowAcceptChanges = styled(AutoColumn)`\n background-color: ${({ theme }) => transparentize(0.9, theme.colors.primary)};\n color: ${({ theme }) => theme.colors.primary};\n padding: 0.5rem;\n border-radius: 12px;\n margin-top: 8px;\n`\n","import React, { useState } from 'react'\nimport { JSBI, Pair, Percent } from '@pancakeswap-libs/sdk'\nimport { Button, Card as UIKitCard, CardBody, Text } from '@pancakeswap-libs/uikit'\nimport { darken } from 'polished'\nimport { ChevronDown, ChevronUp } from 'react-feather'\nimport { Link } from 'react-router-dom'\nimport styled from 'styled-components'\nimport { useTotalSupply } from '../../data/TotalSupply'\n\nimport { useActiveWeb3React } from '../../hooks'\nimport { useTokenBalance } from '../../state/wallet/hooks'\nimport { currencyId } from '../../utils/currencyId'\nimport { unwrappedToken } from '../../utils/wrappedCurrency'\nimport Card from '../Card'\nimport { AutoColumn } from '../Column'\nimport CurrencyLogo from '../CurrencyLogo'\nimport DoubleCurrencyLogo from '../DoubleLogo'\nimport { RowBetween, RowFixed } from '../Row'\nimport { Dots } from '../swap/styleds'\n\nexport const FixedHeightRow = styled(RowBetween)`\n height: 24px;\n`\n\nexport const HoverCard = styled(Card)`\n border: 1px solid ${({ theme }) => theme.colors.invertedContrast};\n :hover {\n border: 1px solid ${({ theme }) => darken(0.06, theme.colors.invertedContrast)};\n }\n`\n\ninterface PositionCardProps {\n pair: Pair\n // eslint-disable-next-line react/no-unused-prop-types\n showUnwrapped?: boolean\n}\n\nexport function MinimalPositionCard({ pair, showUnwrapped = false }: PositionCardProps) {\n const { account } = useActiveWeb3React()\n\n const currency0 = showUnwrapped ? pair.token0 : unwrappedToken(pair.token0)\n const currency1 = showUnwrapped ? pair.token1 : unwrappedToken(pair.token1)\n\n const [showMore, setShowMore] = useState(false)\n\n const userPoolBalance = useTokenBalance(account ?? undefined, pair.liquidityToken)\n const totalPoolTokens = useTotalSupply(pair.liquidityToken)\n\n const [token0Deposited, token1Deposited] =\n !!pair &&\n !!totalPoolTokens &&\n !!userPoolBalance &&\n // this condition is a short-circuit in the case where useTokenBalance updates sooner than useTotalSupply\n JSBI.greaterThanOrEqual(totalPoolTokens.raw, userPoolBalance.raw)\n ? [\n pair.getLiquidityValue(pair.token0, totalPoolTokens, userPoolBalance, false),\n pair.getLiquidityValue(pair.token1, totalPoolTokens, userPoolBalance, false),\n ]\n : [undefined, undefined]\n\n return (\n <>\n {userPoolBalance && (\n \n \n \n \n \n \n LP Tokens in your Wallet\n \n \n \n setShowMore(!showMore)}>\n \n \n \n {currency0.symbol}/{currency1.symbol}\n \n \n \n {userPoolBalance ? userPoolBalance.toSignificant(4) : '-'}\n \n \n \n \n {currency0.symbol}:\n {token0Deposited ? (\n \n \n {token0Deposited?.toSignificant(6)}\n \n \n ) : (\n '-'\n )}\n \n \n {currency1.symbol}:\n {token1Deposited ? (\n \n \n {token1Deposited?.toSignificant(6)}\n \n \n ) : (\n '-'\n )}\n \n \n \n \n \n )}\n \n )\n}\n\nexport default function FullPositionCard({ pair }: PositionCardProps) {\n const { account } = useActiveWeb3React()\n\n const currency0 = unwrappedToken(pair.token0)\n const currency1 = unwrappedToken(pair.token1)\n\n const [showMore, setShowMore] = useState(false)\n\n const userPoolBalance = useTokenBalance(account ?? undefined, pair.liquidityToken)\n const totalPoolTokens = useTotalSupply(pair.liquidityToken)\n\n const poolTokenPercentage =\n !!userPoolBalance && !!totalPoolTokens && JSBI.greaterThanOrEqual(totalPoolTokens.raw, userPoolBalance.raw)\n ? new Percent(userPoolBalance.raw, totalPoolTokens.raw)\n : undefined\n\n const [token0Deposited, token1Deposited] =\n !!pair &&\n !!totalPoolTokens &&\n !!userPoolBalance &&\n // this condition is a short-circuit in the case where useTokenBalance updates sooner than useTotalSupply\n JSBI.greaterThanOrEqual(totalPoolTokens.raw, userPoolBalance.raw)\n ? [\n pair.getLiquidityValue(pair.token0, totalPoolTokens, userPoolBalance, false),\n pair.getLiquidityValue(pair.token1, totalPoolTokens, userPoolBalance, false),\n ]\n : [undefined, undefined]\n\n return (\n \n \n setShowMore(!showMore)} style={{ cursor: 'pointer' }}>\n \n \n {!currency0 || !currency1 ? Loading : `${currency0.symbol}/${currency1.symbol}`}\n \n \n {showMore ? (\n \n ) : (\n \n )}\n \n \n {showMore && (\n \n \n \n Pooled {currency0.symbol}:\n \n {token0Deposited ? (\n \n {token0Deposited?.toSignificant(6)}\n \n \n ) : (\n '-'\n )}\n \n\n \n \n Pooled {currency1.symbol}:\n \n {token1Deposited ? (\n \n {token1Deposited?.toSignificant(6)}\n \n \n ) : (\n '-'\n )}\n \n \n Your pool tokens:\n {userPoolBalance ? userPoolBalance.toSignificant(4) : '-'}\n \n \n Your pool share:\n {poolTokenPercentage ? `${poolTokenPercentage.toFixed(2)}%` : '-'}\n \n\n \n \n \n Remove\n \n \n \n )}\n \n \n )\n}\n","import { TokenAmount, Pair, Currency } from '@pancakeswap-libs/sdk'\nimport { useMemo } from 'react'\nimport { abi as IUniswapV2PairABI } from '@uniswap/v2-core/build/IUniswapV2Pair.json'\nimport { Interface } from '@ethersproject/abi'\nimport { useActiveWeb3React } from '../hooks'\n\nimport { useMultipleContractSingleData } from '../state/multicall/hooks'\nimport { wrappedCurrency } from '../utils/wrappedCurrency'\n\nconst PAIR_INTERFACE = new Interface(IUniswapV2PairABI)\n\nexport enum PairState {\n LOADING,\n NOT_EXISTS,\n EXISTS,\n INVALID\n}\n\nexport function usePairs(currencies: [Currency | undefined, Currency | undefined][]): [PairState, Pair | null][] {\n const { chainId } = useActiveWeb3React()\n\n const tokens = useMemo(\n () =>\n currencies.map(([currencyA, currencyB]) => [\n wrappedCurrency(currencyA, chainId),\n wrappedCurrency(currencyB, chainId)\n ]),\n [chainId, currencies]\n )\n\n const pairAddresses = useMemo(\n () =>\n tokens.map(([tokenA, tokenB]) => {\n return tokenA && tokenB && !tokenA.equals(tokenB) ? Pair.getAddress(tokenA, tokenB) : undefined\n }),\n [tokens]\n )\n\n const results = useMultipleContractSingleData(pairAddresses, PAIR_INTERFACE, 'getReserves')\n\n return useMemo(() => {\n return results.map((result, i) => {\n const { result: reserves, loading } = result\n const tokenA = tokens[i][0]\n const tokenB = tokens[i][1]\n\n if (loading) return [PairState.LOADING, null]\n if (!tokenA || !tokenB || tokenA.equals(tokenB)) return [PairState.INVALID, null]\n if (!reserves) return [PairState.NOT_EXISTS, null]\n const { reserve0, reserve1 } = reserves\n const [token0, token1] = tokenA.sortsBefore(tokenB) ? [tokenA, tokenB] : [tokenB, tokenA]\n return [\n PairState.EXISTS,\n new Pair(new TokenAmount(token0, reserve0.toString()), new TokenAmount(token1, reserve1.toString()))\n ]\n })\n }, [results, tokens])\n}\n\nexport function usePair(tokenA?: Currency, tokenB?: Currency): [PairState, Pair | null] {\n return usePairs([[tokenA, tokenB]])[0]\n}\n","import { Token, TokenAmount } from '@pancakeswap-libs/sdk'\nimport { useMemo } from 'react'\n\nimport { useTokenContract } from '../hooks/useContract'\nimport { useSingleCallResult } from '../state/multicall/hooks'\n\nexport function useTokenAllowance(token?: Token, owner?: string, spender?: string): TokenAmount | undefined {\n const contract = useTokenContract(token?.address, false)\n\n const inputs = useMemo(() => [owner, spender], [owner, spender])\n const allowance = useSingleCallResult(contract, 'allowance', inputs).result\n\n return useMemo(() => (token && allowance ? new TokenAmount(token, allowance.toString()) : undefined), [\n token,\n allowance,\n ])\n}\n\nexport default useTokenAllowance\n","import { createAction } from '@reduxjs/toolkit'\n\nexport enum Field {\n INPUT = 'INPUT',\n OUTPUT = 'OUTPUT'\n}\n\nexport const selectCurrency = createAction<{ field: Field; currencyId: string }>('swap/selectCurrency')\nexport const switchCurrencies = createAction('swap/switchCurrencies')\nexport const typeInput = createAction<{ field: Field; typedValue: string }>('swap/typeInput')\nexport const replaceSwapState = createAction<{\n field: Field\n typedValue: string\n inputCurrencyId?: string\n outputCurrencyId?: string\n recipient: string | null\n}>('swap/replaceSwapState')\nexport const setRecipient = createAction<{ recipient: string | null }>('swap/setRecipient')\n","import { createAction } from '@reduxjs/toolkit'\nimport { ChainId } from '@pancakeswap-libs/sdk'\n\nexport interface SerializableTransactionReceipt {\n to: string\n from: string\n contractAddress: string\n transactionIndex: number\n blockHash: string\n transactionHash: string\n blockNumber: number\n status?: number\n}\n\nexport const addTransaction = createAction<{\n chainId: ChainId\n hash: string\n from: string\n approval?: { tokenAddress: string; spender: string }\n summary?: string\n}>('transactions/addTransaction')\nexport const clearAllTransactions = createAction<{ chainId: ChainId }>('transactions/clearAllTransactions')\nexport const finalizeTransaction = createAction<{\n chainId: ChainId\n hash: string\n receipt: SerializableTransactionReceipt\n}>('transactions/finalizeTransaction')\nexport const checkedTransaction = createAction<{\n chainId: ChainId\n hash: string\n blockNumber: number\n}>('transactions/checkedTransaction')\n","import { TransactionResponse } from '@ethersproject/providers'\nimport { useCallback, useMemo } from 'react'\nimport { useDispatch, useSelector } from 'react-redux'\n\nimport { useActiveWeb3React } from '../../hooks'\nimport { AppDispatch, AppState } from '../index'\nimport { addTransaction } from './actions'\nimport { TransactionDetails } from './reducer'\n\n// helper that can take a ethers library transaction response and add it to the list of transactions\nexport function useTransactionAdder(): (\n response: TransactionResponse,\n customData?: { summary?: string; approval?: { tokenAddress: string; spender: string } }\n) => void {\n const { chainId, account } = useActiveWeb3React()\n const dispatch = useDispatch()\n\n return useCallback(\n (\n response: TransactionResponse,\n { summary, approval }: { summary?: string; approval?: { tokenAddress: string; spender: string } } = {}\n ) => {\n if (!account) return\n if (!chainId) return\n\n const { hash } = response\n if (!hash) {\n throw Error('No transaction hash found.')\n }\n dispatch(addTransaction({ hash, from: account, chainId, approval, summary }))\n },\n [dispatch, chainId, account]\n )\n}\n\n// returns all the transactions for the current chain\nexport function useAllTransactions(): { [txHash: string]: TransactionDetails } {\n const { chainId } = useActiveWeb3React()\n\n const state = useSelector((s) => s.transactions)\n\n return chainId ? state[chainId] ?? {} : {}\n}\n\nexport function useIsTransactionPending(transactionHash?: string): boolean {\n const transactions = useAllTransactions()\n\n if (!transactionHash || !transactions[transactionHash]) return false\n\n return !transactions[transactionHash].receipt\n}\n\n/**\n * Returns whether a transaction happened in the last day (86400 seconds * 1000 milliseconds / second)\n * @param tx to check for recency\n */\nexport function isTransactionRecent(tx: TransactionDetails): boolean {\n return new Date().getTime() - tx.addedTime < 86_400_000\n}\n\n// returns whether a token has a pending approval transaction\nexport function useHasPendingApproval(tokenAddress: string | undefined, spender: string | undefined): boolean {\n const allTransactions = useAllTransactions()\n return useMemo(\n () =>\n typeof tokenAddress === 'string' &&\n typeof spender === 'string' &&\n Object.keys(allTransactions).some((hash) => {\n const tx = allTransactions[hash]\n if (!tx) return false\n if (tx.receipt) {\n return false\n }\n const { approval } = tx\n if (!approval) return false\n return approval.spender === spender && approval.tokenAddress === tokenAddress && isTransactionRecent(tx)\n }),\n [allTransactions, spender, tokenAddress]\n )\n}\n","import { CurrencyAmount, Fraction, JSBI, Percent, TokenAmount, Trade } from '@pancakeswap-libs/sdk'\nimport {\n BLOCKED_PRICE_IMPACT_NON_EXPERT,\n ALLOWED_PRICE_IMPACT_HIGH,\n ALLOWED_PRICE_IMPACT_LOW,\n ALLOWED_PRICE_IMPACT_MEDIUM,\n} from '../constants'\n\nimport { Field } from '../state/swap/actions'\nimport { basisPointsToPercent } from './index'\n\nconst BASE_FEE = new Percent(JSBI.BigInt(20), JSBI.BigInt(10000))\nconst ONE_HUNDRED_PERCENT = new Percent(JSBI.BigInt(10000), JSBI.BigInt(10000))\nconst INPUT_FRACTION_AFTER_FEE = ONE_HUNDRED_PERCENT.subtract(BASE_FEE)\n\n// computes price breakdown for the trade\nexport function computeTradePriceBreakdown(\n trade?: Trade\n): { priceImpactWithoutFee?: Percent; realizedLPFee?: CurrencyAmount } {\n // for each hop in our trade, take away the x*y=k price impact from 0.2% fees\n // e.g. for 3 tokens/2 hops: 1 - ((1 - .02) * (1-.02))\n const realizedLPFee = !trade\n ? undefined\n : ONE_HUNDRED_PERCENT.subtract(\n trade.route.pairs.reduce(\n (currentFee: Fraction): Fraction => currentFee.multiply(INPUT_FRACTION_AFTER_FEE),\n ONE_HUNDRED_PERCENT\n )\n )\n\n // remove lp fees from price impact\n const priceImpactWithoutFeeFraction = trade && realizedLPFee ? trade.priceImpact.subtract(realizedLPFee) : undefined\n\n // the x*y=k impact\n const priceImpactWithoutFeePercent = priceImpactWithoutFeeFraction\n ? new Percent(priceImpactWithoutFeeFraction?.numerator, priceImpactWithoutFeeFraction?.denominator)\n : undefined\n\n // the amount of the input that accrues to LPs\n const realizedLPFeeAmount =\n realizedLPFee &&\n trade &&\n (trade.inputAmount instanceof TokenAmount\n ? new TokenAmount(trade.inputAmount.token, realizedLPFee.multiply(trade.inputAmount.raw).quotient)\n : CurrencyAmount.ether(realizedLPFee.multiply(trade.inputAmount.raw).quotient))\n\n return { priceImpactWithoutFee: priceImpactWithoutFeePercent, realizedLPFee: realizedLPFeeAmount }\n}\n\n// computes the minimum amount out and maximum amount in for a trade given a user specified allowed slippage in bips\nexport function computeSlippageAdjustedAmounts(\n trade: Trade | undefined,\n allowedSlippage: number\n): { [field in Field]?: CurrencyAmount } {\n const pct = basisPointsToPercent(allowedSlippage)\n return {\n [Field.INPUT]: trade?.maximumAmountIn(pct),\n [Field.OUTPUT]: trade?.minimumAmountOut(pct),\n }\n}\n\nexport function warningSeverity(priceImpact: Percent | undefined): 0 | 1 | 2 | 3 | 4 {\n if (!priceImpact?.lessThan(BLOCKED_PRICE_IMPACT_NON_EXPERT)) return 4\n if (!priceImpact?.lessThan(ALLOWED_PRICE_IMPACT_HIGH)) return 3\n if (!priceImpact?.lessThan(ALLOWED_PRICE_IMPACT_MEDIUM)) return 2\n if (!priceImpact?.lessThan(ALLOWED_PRICE_IMPACT_LOW)) return 1\n return 0\n}\n\nexport function formatExecutionPrice(trade?: Trade, inverted?: boolean): string {\n if (!trade) {\n return ''\n }\n return inverted\n ? `${trade.executionPrice.invert().toSignificant(6)} ${trade.inputAmount.currency.symbol} / ${\n trade.outputAmount.currency.symbol\n }`\n : `${trade.executionPrice.toSignificant(6)} ${trade.outputAmount.currency.symbol} / ${\n trade.inputAmount.currency.symbol\n }`\n}\n","import { MaxUint256 } from '@ethersproject/constants'\nimport { TransactionResponse } from '@ethersproject/providers'\nimport { Trade, TokenAmount, CurrencyAmount, ETHER } from '@pancakeswap-libs/sdk'\nimport { useCallback, useMemo } from 'react'\nimport { ROUTER_ADDRESS } from '../constants'\nimport { useTokenAllowance } from '../data/Allowances'\nimport { Field } from '../state/swap/actions'\nimport { useTransactionAdder, useHasPendingApproval } from '../state/transactions/hooks'\nimport { computeSlippageAdjustedAmounts } from '../utils/prices'\nimport { calculateGasMargin } from '../utils'\nimport { useTokenContract } from './useContract'\nimport { useActiveWeb3React } from './index'\n\nexport enum ApprovalState {\n UNKNOWN,\n NOT_APPROVED,\n PENDING,\n APPROVED,\n}\n\n// returns a variable indicating the state of the approval and a function which approves if necessary or early returns\nexport function useApproveCallback(\n amountToApprove?: CurrencyAmount,\n spender?: string\n): [ApprovalState, () => Promise] {\n const { account } = useActiveWeb3React()\n const token = amountToApprove instanceof TokenAmount ? amountToApprove.token : undefined\n const currentAllowance = useTokenAllowance(token, account ?? undefined, spender)\n const pendingApproval = useHasPendingApproval(token?.address, spender)\n\n // check the current approval status\n const approvalState: ApprovalState = useMemo(() => {\n if (!amountToApprove || !spender) return ApprovalState.UNKNOWN\n if (amountToApprove.currency === ETHER) return ApprovalState.APPROVED\n // we might not have enough data to know whether or not we need to approve\n if (!currentAllowance) return ApprovalState.UNKNOWN\n\n // amountToApprove will be defined if currentAllowance is\n return currentAllowance.lessThan(amountToApprove)\n ? pendingApproval\n ? ApprovalState.PENDING\n : ApprovalState.NOT_APPROVED\n : ApprovalState.APPROVED\n }, [amountToApprove, currentAllowance, pendingApproval, spender])\n\n const tokenContract = useTokenContract(token?.address)\n const addTransaction = useTransactionAdder()\n\n const approve = useCallback(async (): Promise => {\n if (approvalState !== ApprovalState.NOT_APPROVED) {\n console.error('approve was called unnecessarily')\n return\n }\n if (!token) {\n console.error('no token')\n return\n }\n\n if (!tokenContract) {\n console.error('tokenContract is null')\n return\n }\n\n if (!amountToApprove) {\n console.error('missing amount to approve')\n return\n }\n\n if (!spender) {\n console.error('no spender')\n return\n }\n\n let useExact = false\n const estimatedGas = await tokenContract.estimateGas.approve(spender, MaxUint256).catch(() => {\n // general fallback for tokens who restrict approval amounts\n useExact = true\n return tokenContract.estimateGas.approve(spender, amountToApprove.raw.toString())\n })\n\n // eslint-disable-next-line consistent-return\n return tokenContract\n .approve(spender, useExact ? amountToApprove.raw.toString() : MaxUint256, {\n gasLimit: calculateGasMargin(estimatedGas),\n })\n .then((response: TransactionResponse) => {\n addTransaction(response, {\n summary: `Approve ${amountToApprove.currency.symbol}`,\n approval: { tokenAddress: token.address, spender },\n })\n })\n .catch((error: Error) => {\n console.error('Failed to approve token', error)\n throw error\n })\n }, [approvalState, token, tokenContract, amountToApprove, spender, addTransaction])\n\n return [approvalState, approve]\n}\n\n// wraps useApproveCallback in the context of a swap\nexport function useApproveCallbackFromTrade(trade?: Trade, allowedSlippage = 0) {\n const amountToApprove = useMemo(\n () => (trade ? computeSlippageAdjustedAmounts(trade, allowedSlippage)[Field.INPUT] : undefined),\n [trade, allowedSlippage]\n )\n return useApproveCallback(amountToApprove, ROUTER_ADDRESS)\n}\n","import { createAction } from '@reduxjs/toolkit'\n\nexport enum Field {\n CURRENCY_A = 'CURRENCY_A',\n CURRENCY_B = 'CURRENCY_B'\n}\n\nexport const typeInput = createAction<{ field: Field; typedValue: string; noLiquidity: boolean }>('mint/typeInputMint')\nexport const resetMintState = createAction('mint/resetMintState')\n","import { useEffect, useState } from 'react'\n\n// modified from https://usehooks.com/useDebounce/\nexport default function useDebounce(value: T, delay: number): T {\n const [debouncedValue, setDebouncedValue] = useState(value)\n\n useEffect(() => {\n // Update debounced value after delay\n const handler = setTimeout(() => {\n setDebouncedValue(value)\n }, delay)\n\n // Cancel the timeout if value changes (also on delay change or unmount)\n // This is how we prevent debounced value from updating if value is changed ...\n // .. within the delay period. Timeout gets cleared and restarted.\n return () => {\n clearTimeout(handler)\n }\n }, [value, delay])\n\n return debouncedValue\n}\n","import { isAddress } from '../utils'\nimport useENSAddress from './useENSAddress'\nimport useENSName from './useENSName'\n\n/**\n * Given a name or address, does a lookup to resolve to an address and name\n * @param nameOrAddress ENS name or address\n */\nexport default function useENS(\n nameOrAddress?: string | null\n): { loading: boolean; address: string | null; name: string | null } {\n const validated = isAddress(nameOrAddress)\n const reverseLookup = useENSName(validated || undefined)\n const lookup = useENSAddress(nameOrAddress)\n\n return {\n loading: reverseLookup.loading || lookup.loading,\n address: validated || lookup.address,\n name: reverseLookup.ENSName ? reverseLookup.ENSName : !validated && lookup.address ? nameOrAddress || null : null\n }\n}\n","import { namehash } from 'ethers/lib/utils'\nimport { useMemo } from 'react'\nimport { useSingleCallResult } from '../state/multicall/hooks'\nimport { isAddress } from '../utils'\nimport isZero from '../utils/isZero'\nimport { useENSRegistrarContract, useENSResolverContract } from './useContract'\nimport useDebounce from './useDebounce'\n\n/**\n * Does a reverse lookup for an address to find its ENS name.\n * Note this is not the same as looking up an ENS name to find an address.\n */\nexport default function useENSName(address?: string): { ENSName: string | null; loading: boolean } {\n const debouncedAddress = useDebounce(address, 200)\n const ensNodeArgument = useMemo(() => {\n if (!debouncedAddress || !isAddress(debouncedAddress)) return [undefined]\n try {\n return debouncedAddress ? [namehash(`${debouncedAddress.toLowerCase().substr(2)}.addr.reverse`)] : [undefined]\n } catch (error) {\n return [undefined]\n }\n }, [debouncedAddress])\n const registrarContract = useENSRegistrarContract(false)\n const resolverAddress = useSingleCallResult(registrarContract, 'resolver', ensNodeArgument)\n const resolverAddressResult = resolverAddress.result?.[0]\n const resolverContract = useENSResolverContract(\n resolverAddressResult && !isZero(resolverAddressResult) ? resolverAddressResult : undefined,\n false\n )\n const name = useSingleCallResult(resolverContract, 'name', ensNodeArgument)\n\n const changed = debouncedAddress !== address\n return {\n ENSName: changed ? null : name.result?.[0] ?? null,\n loading: changed || resolverAddress.loading || name.loading\n }\n}\n","import { namehash } from 'ethers/lib/utils'\nimport { useMemo } from 'react'\nimport { useSingleCallResult } from '../state/multicall/hooks'\nimport isZero from '../utils/isZero'\nimport { useENSRegistrarContract, useENSResolverContract } from './useContract'\nimport useDebounce from './useDebounce'\n\n/**\n * Does a lookup for an ENS name to find its address.\n */\nexport default function useENSAddress(ensName?: string | null): { loading: boolean; address: string | null } {\n const debouncedName = useDebounce(ensName, 200)\n const ensNodeArgument = useMemo(() => {\n if (!debouncedName) return [undefined]\n try {\n return debouncedName ? [namehash(debouncedName)] : [undefined]\n } catch (error) {\n return [undefined]\n }\n }, [debouncedName])\n const registrarContract = useENSRegistrarContract(false)\n const resolverAddress = useSingleCallResult(registrarContract, 'resolver', ensNodeArgument)\n const resolverAddressResult = resolverAddress.result?.[0]\n const resolverContract = useENSResolverContract(\n resolverAddressResult && !isZero(resolverAddressResult) ? resolverAddressResult : undefined,\n false\n )\n const addr = useSingleCallResult(resolverContract, 'addr', ensNodeArgument)\n\n const changed = debouncedName !== ensName\n return {\n address: changed ? null : addr.result?.[0] ?? null,\n loading: changed || resolverAddress.loading || addr.loading\n }\n}\n","import { Currency, CurrencyAmount, Pair, Token, Trade } from '@pancakeswap-libs/sdk'\nimport flatMap from 'lodash.flatmap'\nimport { useMemo } from 'react'\n\nimport { BASES_TO_CHECK_TRADES_AGAINST, CUSTOM_BASES } from '../constants'\nimport { PairState, usePairs } from '../data/Reserves'\nimport { wrappedCurrency } from '../utils/wrappedCurrency'\n\nimport { useActiveWeb3React } from './index'\n\nfunction useAllCommonPairs(currencyA?: Currency, currencyB?: Currency): Pair[] {\n const { chainId } = useActiveWeb3React()\n\n // Base tokens for building intermediary trading routes\n const bases: Token[] = useMemo(() => (chainId ? BASES_TO_CHECK_TRADES_AGAINST[chainId] : []), [chainId])\n\n // All pairs from base tokens\n const basePairs: [Token, Token][] = useMemo(\n () =>\n flatMap(bases, (base): [Token, Token][] => bases.map((otherBase) => [base, otherBase])).filter(\n ([t0, t1]) => t0.address !== t1.address\n ),\n [bases]\n )\n\n const [tokenA, tokenB] = chainId\n ? [wrappedCurrency(currencyA, chainId), wrappedCurrency(currencyB, chainId)]\n : [undefined, undefined]\n\n const allPairCombinations: [Token, Token][] = useMemo(\n () =>\n tokenA && tokenB\n ? [\n // the direct pair\n [tokenA, tokenB],\n // token A against all bases\n ...bases.map((base): [Token, Token] => [tokenA, base]),\n // token B against all bases\n ...bases.map((base): [Token, Token] => [tokenB, base]),\n // each base against all bases\n ...basePairs,\n ]\n .filter((tokens): tokens is [Token, Token] => Boolean(tokens[0] && tokens[1]))\n .filter(([t0, t1]) => t0.address !== t1.address)\n // This filter will remove all the pairs that are not supported by the CUSTOM_BASES settings\n // This option is currently not used on Pancake swap\n .filter(([t0, t1]) => {\n if (!chainId) return true\n const customBases = CUSTOM_BASES[chainId]\n if (!customBases) return true\n\n const customBasesA: Token[] | undefined = customBases[t0.address]\n const customBasesB: Token[] | undefined = customBases[t1.address]\n\n if (!customBasesA && !customBasesB) return true\n if (customBasesA && !customBasesA.find((base) => t1.equals(base))) return false\n if (customBasesB && !customBasesB.find((base) => t0.equals(base))) return false\n\n return true\n })\n : [],\n [tokenA, tokenB, bases, basePairs, chainId]\n )\n\n const allPairs = usePairs(allPairCombinations)\n\n // only pass along valid pairs, non-duplicated pairs\n return useMemo(\n () =>\n Object.values(\n allPairs\n // filter out invalid pairs\n .filter((result): result is [PairState.EXISTS, Pair] => Boolean(result[0] === PairState.EXISTS && result[1]))\n // filter out duplicated pairs\n .reduce<{ [pairAddress: string]: Pair }>((memo, [, curr]) => {\n memo[curr.liquidityToken.address] = memo[curr.liquidityToken.address] ?? curr\n return memo\n }, {})\n ),\n [allPairs]\n )\n}\n\n/**\n * Returns the best trade for the exact amount of tokens in to the given token out\n */\nexport function useTradeExactIn(currencyAmountIn?: CurrencyAmount, currencyOut?: Currency): Trade | null {\n const allowedPairs = useAllCommonPairs(currencyAmountIn?.currency, currencyOut)\n\n return useMemo(() => {\n if (currencyAmountIn && currencyOut && allowedPairs.length > 0) {\n return (\n Trade.bestTradeExactIn(allowedPairs, currencyAmountIn, currencyOut, { maxHops: 3, maxNumResults: 1 })[0] ?? null\n )\n }\n return null\n }, [allowedPairs, currencyAmountIn, currencyOut])\n}\n\n/**\n * Returns the best trade for the token in to the exact amount of token out\n */\nexport function useTradeExactOut(currencyIn?: Currency, currencyAmountOut?: CurrencyAmount): Trade | null {\n const allowedPairs = useAllCommonPairs(currencyIn, currencyAmountOut?.currency)\n\n return useMemo(() => {\n if (currencyIn && currencyAmountOut && allowedPairs.length > 0) {\n return (\n Trade.bestTradeExactOut(allowedPairs, currencyIn, currencyAmountOut, { maxHops: 3, maxNumResults: 1 })[0] ??\n null\n )\n }\n return null\n }, [allowedPairs, currencyIn, currencyAmountOut])\n}\n","import { parseUnits } from '@ethersproject/units'\nimport { Currency, CurrencyAmount, ETHER, JSBI, Token, TokenAmount, Trade } from '@pancakeswap-libs/sdk'\nimport { ParsedQs } from 'qs'\nimport { useCallback, useEffect, useState } from 'react'\nimport { useDispatch, useSelector } from 'react-redux'\nimport useENS from '../../hooks/useENS'\nimport { useActiveWeb3React } from '../../hooks'\nimport { useCurrency } from '../../hooks/Tokens'\nimport { useTradeExactIn, useTradeExactOut } from '../../hooks/Trades'\nimport useParsedQueryString from '../../hooks/useParsedQueryString'\nimport { isAddress } from '../../utils'\nimport { AppDispatch, AppState } from '../index'\nimport { useCurrencyBalances } from '../wallet/hooks'\nimport { Field, replaceSwapState, selectCurrency, setRecipient, switchCurrencies, typeInput } from './actions'\nimport { SwapState } from './reducer'\n\nimport { useUserSlippageTolerance } from '../user/hooks'\nimport { computeSlippageAdjustedAmounts } from '../../utils/prices'\n\nexport function useSwapState(): AppState['swap'] {\n return useSelector((state) => state.swap)\n}\n\nexport function useSwapActionHandlers(): {\n onCurrencySelection: (field: Field, currency: Currency) => void\n onSwitchTokens: () => void\n onUserInput: (field: Field, typedValue: string) => void\n onChangeRecipient: (recipient: string | null) => void\n} {\n const dispatch = useDispatch()\n const onCurrencySelection = useCallback(\n (field: Field, currency: Currency) => {\n dispatch(\n selectCurrency({\n field,\n currencyId: currency instanceof Token ? currency.address : currency === ETHER ? 'BNB' : '',\n })\n )\n },\n [dispatch]\n )\n\n const onSwitchTokens = useCallback(() => {\n dispatch(switchCurrencies())\n }, [dispatch])\n\n const onUserInput = useCallback(\n (field: Field, typedValue: string) => {\n dispatch(typeInput({ field, typedValue }))\n },\n [dispatch]\n )\n\n const onChangeRecipient = useCallback(\n (recipient: string | null) => {\n dispatch(setRecipient({ recipient }))\n },\n [dispatch]\n )\n\n return {\n onSwitchTokens,\n onCurrencySelection,\n onUserInput,\n onChangeRecipient,\n }\n}\n\n// try to parse a user entered amount for a given token\nexport function tryParseAmount(value?: string, currency?: Currency): CurrencyAmount | undefined {\n if (!value || !currency) {\n return undefined\n }\n try {\n const typedValueParsed = parseUnits(value, currency.decimals).toString()\n if (typedValueParsed !== '0') {\n return currency instanceof Token\n ? new TokenAmount(currency, JSBI.BigInt(typedValueParsed))\n : CurrencyAmount.ether(JSBI.BigInt(typedValueParsed))\n }\n } catch (error) {\n // should fail if the user specifies too many decimal places of precision (or maybe exceed max uint?)\n console.info(`Failed to parse input amount: \"${value}\"`, error)\n }\n // necessary for all paths to return a value\n return undefined\n}\n\nconst BAD_RECIPIENT_ADDRESSES: string[] = [\n '0x5Fe5cC0122403f06abE2A75DBba1860Edb762985', // v2 factory\n '0x3E2b14680108E8C5C45C3ab5Bc04E01397af14cB', // v2 router 01\n '0xCc7aDc94F3D80127849D2b41b6439b7CF1eB4Ae0', // v2 router 02\n]\n\n/**\n * Returns true if any of the pairs or tokens in a trade have the given checksummed address\n * @param trade to check for the given address\n * @param checksummedAddress address to check in the pairs and tokens\n */\nfunction involvesAddress(trade: Trade, checksummedAddress: string): boolean {\n return (\n trade.route.path.some((token) => token.address === checksummedAddress) ||\n trade.route.pairs.some((pair) => pair.liquidityToken.address === checksummedAddress)\n )\n}\n\n// from the current swap inputs, compute the best trade and return it.\nexport function useDerivedSwapInfo(): {\n currencies: { [field in Field]?: Currency }\n currencyBalances: { [field in Field]?: CurrencyAmount }\n parsedAmount: CurrencyAmount | undefined\n v2Trade: Trade | undefined\n inputError?: string\n} {\n const { account } = useActiveWeb3React()\n\n const {\n independentField,\n typedValue,\n [Field.INPUT]: { currencyId: inputCurrencyId },\n [Field.OUTPUT]: { currencyId: outputCurrencyId },\n recipient,\n } = useSwapState()\n\n const inputCurrency = useCurrency(inputCurrencyId)\n const outputCurrency = useCurrency(outputCurrencyId)\n const recipientLookup = useENS(recipient ?? undefined)\n const to: string | null = (recipient === null ? account : recipientLookup.address) ?? null\n\n const relevantTokenBalances = useCurrencyBalances(account ?? undefined, [\n inputCurrency ?? undefined,\n outputCurrency ?? undefined,\n ])\n\n const isExactIn: boolean = independentField === Field.INPUT\n const parsedAmount = tryParseAmount(typedValue, (isExactIn ? inputCurrency : outputCurrency) ?? undefined)\n\n const bestTradeExactIn = useTradeExactIn(isExactIn ? parsedAmount : undefined, outputCurrency ?? undefined)\n const bestTradeExactOut = useTradeExactOut(inputCurrency ?? undefined, !isExactIn ? parsedAmount : undefined)\n\n const v2Trade = isExactIn ? bestTradeExactIn : bestTradeExactOut\n\n const currencyBalances = {\n [Field.INPUT]: relevantTokenBalances[0],\n [Field.OUTPUT]: relevantTokenBalances[1],\n }\n\n const currencies: { [field in Field]?: Currency } = {\n [Field.INPUT]: inputCurrency ?? undefined,\n [Field.OUTPUT]: outputCurrency ?? undefined,\n }\n\n let inputError: string | undefined\n if (!account) {\n inputError = 'Connect Wallet'\n }\n\n if (!parsedAmount) {\n inputError = inputError ?? 'Enter an amount'\n }\n\n if (!currencies[Field.INPUT] || !currencies[Field.OUTPUT]) {\n inputError = inputError ?? 'Select a token'\n }\n\n const formattedTo = isAddress(to)\n if (!to || !formattedTo) {\n inputError = inputError ?? 'Enter a recipient'\n } else if (\n BAD_RECIPIENT_ADDRESSES.indexOf(formattedTo) !== -1 ||\n (bestTradeExactIn && involvesAddress(bestTradeExactIn, formattedTo)) ||\n (bestTradeExactOut && involvesAddress(bestTradeExactOut, formattedTo))\n ) {\n inputError = inputError ?? 'Invalid recipient'\n }\n\n const [allowedSlippage] = useUserSlippageTolerance()\n\n const slippageAdjustedAmounts = v2Trade && allowedSlippage && computeSlippageAdjustedAmounts(v2Trade, allowedSlippage)\n\n // compare input balance to max input based on version\n const [balanceIn, amountIn] = [\n currencyBalances[Field.INPUT],\n slippageAdjustedAmounts ? slippageAdjustedAmounts[Field.INPUT] : null,\n ]\n\n if (balanceIn && amountIn && balanceIn.lessThan(amountIn)) {\n inputError = `Insufficient ${amountIn.currency.symbol} balance`\n }\n\n return {\n currencies,\n currencyBalances,\n parsedAmount,\n v2Trade: v2Trade ?? undefined,\n inputError,\n }\n}\n\nfunction parseCurrencyFromURLParameter(urlParam: any): string {\n if (typeof urlParam === 'string') {\n const valid = isAddress(urlParam)\n if (valid) return valid\n if (urlParam.toUpperCase() === 'BNB') return 'BNB'\n if (valid === false) return 'BNB'\n }\n return 'BNB' ?? ''\n}\n\nfunction parseTokenAmountURLParameter(urlParam: any): string {\n // eslint-disable-next-line no-restricted-globals\n return typeof urlParam === 'string' && !isNaN(parseFloat(urlParam)) ? urlParam : ''\n}\n\nfunction parseIndependentFieldURLParameter(urlParam: any): Field {\n return typeof urlParam === 'string' && urlParam.toLowerCase() === 'output' ? Field.OUTPUT : Field.INPUT\n}\n\nconst ENS_NAME_REGEX = /^[-a-zA-Z0-9@:%._+~#=]{1,256}\\.[a-zA-Z0-9()]{1,6}\\b([-a-zA-Z0-9()@:%_+.~#?&/=]*)?$/\nconst ADDRESS_REGEX = /^0x[a-fA-F0-9]{40}$/\nfunction validatedRecipient(recipient: any): string | null {\n if (typeof recipient !== 'string') return null\n const address = isAddress(recipient)\n if (address) return address\n if (ENS_NAME_REGEX.test(recipient)) return recipient\n if (ADDRESS_REGEX.test(recipient)) return recipient\n return null\n}\n\nexport function queryParametersToSwapState(parsedQs: ParsedQs): SwapState {\n let inputCurrency = parseCurrencyFromURLParameter(parsedQs.inputCurrency)\n let outputCurrency = parseCurrencyFromURLParameter(parsedQs.outputCurrency)\n if (inputCurrency === outputCurrency) {\n if (typeof parsedQs.outputCurrency === 'string') {\n inputCurrency = ''\n } else {\n outputCurrency = ''\n }\n }\n\n const recipient = validatedRecipient(parsedQs.recipient)\n\n return {\n [Field.INPUT]: {\n currencyId: inputCurrency,\n },\n [Field.OUTPUT]: {\n currencyId: outputCurrency,\n },\n typedValue: parseTokenAmountURLParameter(parsedQs.exactAmount),\n independentField: parseIndependentFieldURLParameter(parsedQs.exactField),\n recipient,\n }\n}\n\n// updates the swap state to use the defaults for a given network\nexport function useDefaultsFromURLSearch():\n | { inputCurrencyId: string | undefined; outputCurrencyId: string | undefined }\n | undefined {\n const { chainId } = useActiveWeb3React()\n const dispatch = useDispatch()\n const parsedQs = useParsedQueryString()\n const [result, setResult] = useState<\n { inputCurrencyId: string | undefined; outputCurrencyId: string | undefined } | undefined\n >()\n\n useEffect(() => {\n if (!chainId) return\n const parsed = queryParametersToSwapState(parsedQs)\n\n dispatch(\n replaceSwapState({\n typedValue: parsed.typedValue,\n field: parsed.independentField,\n inputCurrencyId: parsed[Field.INPUT].currencyId,\n outputCurrencyId: parsed[Field.OUTPUT].currencyId,\n recipient: parsed.recipient,\n })\n )\n\n setResult({ inputCurrencyId: parsed[Field.INPUT].currencyId, outputCurrencyId: parsed[Field.OUTPUT].currencyId })\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [dispatch, chainId])\n\n return result\n}\n","import { parse, ParsedQs } from 'qs'\nimport { useMemo } from 'react'\nimport { useLocation } from 'react-router-dom'\n\nexport default function useParsedQueryString(): ParsedQs {\n const { search } = useLocation()\n return useMemo(\n () => (search && search.length > 1 ? parse(search, { parseArrays: false, ignoreQueryPrefix: true }) : {}),\n [search]\n )\n}\n","import { Currency, CurrencyAmount, ETHER, JSBI, Pair, Percent, Price, TokenAmount } from '@pancakeswap-libs/sdk'\nimport { useCallback, useMemo } from 'react'\nimport { useDispatch, useSelector } from 'react-redux'\nimport { PairState, usePair } from '../../data/Reserves'\nimport { useTotalSupply } from '../../data/TotalSupply'\n\nimport { useActiveWeb3React } from '../../hooks'\nimport { TranslateString } from '../../utils/translateTextHelpers'\nimport { wrappedCurrency, wrappedCurrencyAmount } from '../../utils/wrappedCurrency'\nimport { AppDispatch, AppState } from '../index'\nimport { tryParseAmount } from '../swap/hooks'\nimport { useCurrencyBalances } from '../wallet/hooks'\nimport { Field, typeInput } from './actions'\n\nconst ZERO = JSBI.BigInt(0)\n\nexport function useMintState(): AppState['mint'] {\n return useSelector((state) => state.mint)\n}\n\nexport function useDerivedMintInfo(\n currencyA: Currency | undefined,\n currencyB: Currency | undefined\n): {\n dependentField: Field\n currencies: { [field in Field]?: Currency }\n pair?: Pair | null\n pairState: PairState\n currencyBalances: { [field in Field]?: CurrencyAmount }\n parsedAmounts: { [field in Field]?: CurrencyAmount }\n price?: Price\n noLiquidity?: boolean\n liquidityMinted?: TokenAmount\n poolTokenPercentage?: Percent\n error?: string\n} {\n const { account, chainId } = useActiveWeb3React()\n\n const { independentField, typedValue, otherTypedValue } = useMintState()\n\n const dependentField = independentField === Field.CURRENCY_A ? Field.CURRENCY_B : Field.CURRENCY_A\n\n // tokens\n const currencies: { [field in Field]?: Currency } = useMemo(\n () => ({\n [Field.CURRENCY_A]: currencyA ?? undefined,\n [Field.CURRENCY_B]: currencyB ?? undefined,\n }),\n [currencyA, currencyB]\n )\n\n // pair\n const [pairState, pair] = usePair(currencies[Field.CURRENCY_A], currencies[Field.CURRENCY_B])\n const totalSupply = useTotalSupply(pair?.liquidityToken)\n\n const noLiquidity: boolean =\n pairState === PairState.NOT_EXISTS || Boolean(totalSupply && JSBI.equal(totalSupply.raw, ZERO))\n\n // balances\n const balances = useCurrencyBalances(account ?? undefined, [\n currencies[Field.CURRENCY_A],\n currencies[Field.CURRENCY_B],\n ])\n const currencyBalances: { [field in Field]?: CurrencyAmount } = {\n [Field.CURRENCY_A]: balances[0],\n [Field.CURRENCY_B]: balances[1],\n }\n\n // amounts\n const independentAmount: CurrencyAmount | undefined = tryParseAmount(typedValue, currencies[independentField])\n const dependentAmount: CurrencyAmount | undefined = useMemo(() => {\n if (noLiquidity) {\n if (otherTypedValue && currencies[dependentField]) {\n return tryParseAmount(otherTypedValue, currencies[dependentField])\n }\n return undefined\n }\n if (independentAmount) {\n // we wrap the currencies just to get the price in terms of the other token\n const wrappedIndependentAmount = wrappedCurrencyAmount(independentAmount, chainId)\n const [tokenA, tokenB] = [wrappedCurrency(currencyA, chainId), wrappedCurrency(currencyB, chainId)]\n if (tokenA && tokenB && wrappedIndependentAmount && pair) {\n const dependentCurrency = dependentField === Field.CURRENCY_B ? currencyB : currencyA\n const dependentTokenAmount =\n dependentField === Field.CURRENCY_B\n ? pair.priceOf(tokenA).quote(wrappedIndependentAmount)\n : pair.priceOf(tokenB).quote(wrappedIndependentAmount)\n return dependentCurrency === ETHER ? CurrencyAmount.ether(dependentTokenAmount.raw) : dependentTokenAmount\n }\n return undefined\n }\n return undefined\n }, [noLiquidity, otherTypedValue, currencies, dependentField, independentAmount, currencyA, chainId, currencyB, pair])\n // eslint-disable-next-line react-hooks/exhaustive-deps\n const parsedAmounts: { [field in Field]: CurrencyAmount | undefined } = {\n [Field.CURRENCY_A]: independentField === Field.CURRENCY_A ? independentAmount : dependentAmount,\n [Field.CURRENCY_B]: independentField === Field.CURRENCY_A ? dependentAmount : independentAmount,\n }\n\n const price = useMemo(() => {\n if (noLiquidity) {\n const { [Field.CURRENCY_A]: currencyAAmount, [Field.CURRENCY_B]: currencyBAmount } = parsedAmounts\n if (currencyAAmount && currencyBAmount) {\n return new Price(currencyAAmount.currency, currencyBAmount.currency, currencyAAmount.raw, currencyBAmount.raw)\n }\n return undefined\n }\n const wrappedCurrencyA = wrappedCurrency(currencyA, chainId)\n return pair && wrappedCurrencyA ? pair.priceOf(wrappedCurrencyA) : undefined\n }, [chainId, currencyA, noLiquidity, pair, parsedAmounts])\n\n // liquidity minted\n const liquidityMinted = useMemo(() => {\n const { [Field.CURRENCY_A]: currencyAAmount, [Field.CURRENCY_B]: currencyBAmount } = parsedAmounts\n const [tokenAmountA, tokenAmountB] = [\n wrappedCurrencyAmount(currencyAAmount, chainId),\n wrappedCurrencyAmount(currencyBAmount, chainId),\n ]\n if (pair && totalSupply && tokenAmountA && tokenAmountB) {\n return pair.getLiquidityMinted(totalSupply, tokenAmountA, tokenAmountB)\n }\n return undefined\n }, [parsedAmounts, chainId, pair, totalSupply])\n\n const poolTokenPercentage = useMemo(() => {\n if (liquidityMinted && totalSupply) {\n return new Percent(liquidityMinted.raw, totalSupply.add(liquidityMinted).raw)\n }\n return undefined\n }, [liquidityMinted, totalSupply])\n\n let error: string | undefined\n if (!account) {\n error = 'Connect Wallet'\n }\n\n if (pairState === PairState.INVALID) {\n error = error ?? TranslateString(136, 'Invalid pair')\n }\n\n if (!parsedAmounts[Field.CURRENCY_A] || !parsedAmounts[Field.CURRENCY_B]) {\n error = error ?? TranslateString(84, 'Enter an amount')\n }\n\n const { [Field.CURRENCY_A]: currencyAAmount, [Field.CURRENCY_B]: currencyBAmount } = parsedAmounts\n\n if (currencyAAmount && currencyBalances?.[Field.CURRENCY_A]?.lessThan(currencyAAmount)) {\n error = `Insufficient ${currencies[Field.CURRENCY_A]?.symbol} balance`\n }\n\n if (currencyBAmount && currencyBalances?.[Field.CURRENCY_B]?.lessThan(currencyBAmount)) {\n error = `Insufficient ${currencies[Field.CURRENCY_B]?.symbol} balance`\n }\n\n return {\n dependentField,\n currencies,\n pair,\n pairState,\n currencyBalances,\n parsedAmounts,\n price,\n noLiquidity,\n liquidityMinted,\n poolTokenPercentage,\n error,\n }\n}\n\nexport function useMintActionHandlers(\n noLiquidity: boolean | undefined\n): {\n onFieldAInput: (typedValue: string) => void\n onFieldBInput: (typedValue: string) => void\n} {\n const dispatch = useDispatch()\n\n const onFieldAInput = useCallback(\n (typedValue: string) => {\n dispatch(typeInput({ field: Field.CURRENCY_A, typedValue, noLiquidity: noLiquidity === true }))\n },\n [dispatch, noLiquidity]\n )\n const onFieldBInput = useCallback(\n (typedValue: string) => {\n dispatch(typeInput({ field: Field.CURRENCY_B, typedValue, noLiquidity: noLiquidity === true }))\n },\n [dispatch, noLiquidity]\n )\n\n return {\n onFieldAInput,\n onFieldBInput,\n }\n}\n","import { CurrencyAmount, ETHER, JSBI } from '@pancakeswap-libs/sdk'\nimport { MIN_ETH } from '../constants'\n\n/**\n * Given some token amount, return the max that can be spent of it\n * @param currencyAmount to return max of\n */\nexport function maxAmountSpend(currencyAmount?: CurrencyAmount): CurrencyAmount | undefined {\n if (!currencyAmount) return undefined\n if (currencyAmount.currency === ETHER) {\n if (JSBI.greaterThan(currencyAmount.raw, MIN_ETH)) {\n return CurrencyAmount.ether(JSBI.subtract(currencyAmount.raw, MIN_ETH))\n }\n return CurrencyAmount.ether(JSBI.BigInt(0))\n }\n return currencyAmount\n}\n\nexport default maxAmountSpend\n","import styled from 'styled-components'\n\nconst Pane = styled.div`\n border: 2px solid ${({ theme }) => theme.colors.borderColor};\n border-radius: 16px;\n padding: 16px;\n`\n\nexport default Pane\n","/* eslint-disable no-param-reassign */\nimport { Toast } from '@pancakeswap-libs/uikit'\nimport { createSlice, PayloadAction } from '@reduxjs/toolkit'\n\nconst initialState: ToastsState = {\n data: [],\n}\n\nexport interface ToastsState {\n data: Toast[]\n}\n\nexport const toastsSlice = createSlice({\n name: 'toasts',\n initialState,\n reducers: {\n push: (state: ToastsState, action: PayloadAction) => {\n const { payload } = action\n const toastIndex = state.data.findIndex((toast) => toast.id === action.payload.id)\n\n // If id already matches remove it before adding it to the top of the stack\n if (toastIndex >= 0) {\n state.data.splice(toastIndex, 1)\n }\n\n state.data.unshift(payload)\n },\n remove: (state: ToastsState, action: PayloadAction) => {\n const toastIndex = state.data.findIndex((toast) => toast.id === action.payload)\n\n if (toastIndex >= 0) {\n state.data.splice(toastIndex, 1)\n }\n },\n clear: (state: ToastsState) => {\n state.data = []\n },\n },\n})\n\n// Actions\nexport const { clear, remove, push } = toastsSlice.actions\n\nexport default toastsSlice.reducer\n","import { useMemo } from 'react'\nimport { kebabCase } from 'lodash'\nimport { Toast, toastTypes } from '@pancakeswap-libs/uikit'\nimport { useDispatch } from 'react-redux'\n\nimport {\n push as pushToast,\n remove as removeToast,\n clear as clearToast\n} from 'state/actions'\n\n// Toasts\nconst useToast = () => {\n const dispatch = useDispatch()\n const helpers = useMemo(() => {\n const push = (toast: Toast) => dispatch(pushToast(toast))\n\n return {\n toastError: (title: string, description?: string) => {\n return push({ id: kebabCase(title), type: toastTypes.DANGER, title, description })\n },\n toastInfo: (title: string, description?: string) => {\n return push({ id: kebabCase(title), type: toastTypes.INFO, title, description })\n },\n toastSuccess: (title: string, description?: string) => {\n return push({ id: kebabCase(title), type: toastTypes.SUCCESS, title, description })\n },\n toastWarning: (title: string, description?: string) => {\n return push({ id: kebabCase(title), type: toastTypes.WARNING, title, description })\n },\n push,\n remove: (id: string) => dispatch(removeToast(id)),\n clear: () => dispatch(clearToast()),\n }\n }, [dispatch])\n\n return helpers\n}\n\nexport default useToast","import { useCallback } from 'react'\nimport { useWeb3React, UnsupportedChainIdError } from '@web3-react/core'\nimport { NoBscProviderError } from '@binance-chain/bsc-connector'\nimport {\n NoEthereumProviderError,\n UserRejectedRequestError as UserRejectedRequestErrorInjected,\n} from '@web3-react/injected-connector'\nimport {\n UserRejectedRequestError as UserRejectedRequestErrorWalletConnect,\n WalletConnectConnector,\n} from '@web3-react/walletconnect-connector'\nimport { connectorLocalStorageKey, ConnectorNames } from '@pancakeswap-libs/uikit'\nimport useToast from 'hooks/useToast'\nimport { connectorsByName } from 'connectors'\n\nconst useAuth = () => {\n const { activate, deactivate } = useWeb3React()\n const { toastError } = useToast()\n\n const login = useCallback((connectorID: ConnectorNames) => {\n const connector = connectorsByName[connectorID]\n if (connector) {\n activate(connector, async (error: Error) => {\n window.localStorage.removeItem(connectorLocalStorageKey)\n if (error instanceof UnsupportedChainIdError) {\n toastError('Unsupported Chain Id', 'Unsupported Chain Id Error. Check your chain Id.')\n } else if (error instanceof NoEthereumProviderError || error instanceof NoBscProviderError) {\n toastError('Provider Error', 'No provider was found')\n } else if (\n error instanceof UserRejectedRequestErrorInjected ||\n error instanceof UserRejectedRequestErrorWalletConnect\n ) {\n if (connector instanceof WalletConnectConnector) {\n const walletConnector = connector as WalletConnectConnector\n walletConnector.walletConnectProvider = null\n }\n toastError('Authorization Error', 'Please authorize to access your account')\n } else {\n toastError(error.name, error.message)\n }\n })\n } else {\n toastError(\"Can't find connector\", 'The connector config is wrong')\n }\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [])\n\n return { login, logout: deactivate }\n}\n\nexport default useAuth\n","import React from 'react'\nimport { Button, ButtonProps, useWalletModal} from '@pancakeswap-libs/uikit'\nimport useI18n from 'hooks/useI18n'\nimport useAuth from 'hooks/useAuth'\n\nconst UnlockButton: React.FC = (props) => {\n const TranslateString = useI18n()\n const { login, logout } = useAuth()\n const { onPresentConnectModal } = useWalletModal(login, logout)\n\n return (\n \n )\n}\n\nexport default UnlockButton\n","import React from 'react'\nimport styled from 'styled-components'\nimport { Card } from '@pancakeswap-libs/uikit'\n\nexport const BodyWrapper = styled(Card)`\n position: relative;\n max-width: 436px;\n width: 100%;\n z-index: 5;\n`\n\n/**\n * The styled container element that wraps the content of most pages and the tabs.\n */\nexport default function AppBody({ children }: { children: React.ReactNode }) {\n return {children}\n}\n","import { Text } from '@pancakeswap-libs/uikit'\nimport styled from 'styled-components'\n\nexport const Wrapper = styled.div`\n position: relative;\n`\n\nexport const ClickableText = styled(Text)`\n :hover {\n cursor: pointer;\n }\n color: ${({ theme }) => theme.colors.primary};\n`\n\nexport const Dots = styled.span`\n &::after {\n display: inline-block;\n animation: ellipsis 1.25s infinite;\n content: '.';\n width: 1em;\n text-align: left;\n }\n @keyframes ellipsis {\n 0% {\n content: '.';\n }\n 33% {\n content: '..';\n }\n 66% {\n content: '...';\n }\n }\n`\n","import { Currency, CurrencyAmount, Fraction, Percent } from '@pancakeswap-libs/sdk'\nimport React from 'react'\nimport { Button, Text } from '@pancakeswap-libs/uikit'\nimport { TranslateString } from 'utils/translateTextHelpers'\nimport { RowBetween, RowFixed } from '../../components/Row'\nimport CurrencyLogo from '../../components/CurrencyLogo'\nimport { Field } from '../../state/mint/actions'\n\nexport function ConfirmAddModalBottom({\n noLiquidity,\n price,\n currencies,\n parsedAmounts,\n poolTokenPercentage,\n onAdd,\n}: {\n noLiquidity?: boolean\n price?: Fraction\n currencies: { [field in Field]?: Currency }\n parsedAmounts: { [field in Field]?: CurrencyAmount }\n poolTokenPercentage?: Percent\n onAdd: () => void\n}) {\n return (\n <>\n \n {currencies[Field.CURRENCY_A]?.symbol} Deposited\n \n \n {parsedAmounts[Field.CURRENCY_A]?.toSignificant(6)}\n \n \n \n {currencies[Field.CURRENCY_B]?.symbol} Deposited\n \n \n {parsedAmounts[Field.CURRENCY_B]?.toSignificant(6)}\n \n \n \n Rates\n \n {`1 ${currencies[Field.CURRENCY_A]?.symbol} = ${price?.toSignificant(4)} ${\n currencies[Field.CURRENCY_B]?.symbol\n }`}\n \n \n \n \n {`1 ${currencies[Field.CURRENCY_B]?.symbol} = ${price?.invert().toSignificant(4)} ${\n currencies[Field.CURRENCY_A]?.symbol\n }`}\n \n \n \n Share of Pool:\n {noLiquidity ? '100' : poolTokenPercentage?.toSignificant(4)}%\n \n \n \n )\n}\n\nexport default ConfirmAddModalBottom\n","import React from 'react'\nimport { Currency, Percent, Price } from '@pancakeswap-libs/sdk'\nimport { Text } from '@pancakeswap-libs/uikit'\nimport { AutoColumn } from '../../components/Column'\nimport { AutoRow } from '../../components/Row'\nimport { ONE_BIPS } from '../../constants'\nimport { Field } from '../../state/mint/actions'\n\nexport function PoolPriceBar({\n currencies,\n noLiquidity,\n poolTokenPercentage,\n price,\n}: {\n currencies: { [field in Field]?: Currency }\n noLiquidity?: boolean\n poolTokenPercentage?: Percent\n price?: Price\n}) {\n return (\n \n \n \n {price?.toSignificant(6) ?? '-'}\n \n {currencies[Field.CURRENCY_B]?.symbol} per {currencies[Field.CURRENCY_A]?.symbol}\n \n \n \n {price?.invert()?.toSignificant(6) ?? '-'}\n \n {currencies[Field.CURRENCY_A]?.symbol} per {currencies[Field.CURRENCY_B]?.symbol}\n \n \n \n \n {noLiquidity && price\n ? '100'\n : (poolTokenPercentage?.lessThan(ONE_BIPS) ? '<0.01' : poolTokenPercentage?.toFixed(2)) ?? '0'}\n %\n \n \n Share of Pool\n \n \n \n \n )\n}\n\nexport default PoolPriceBar\n","import React, { useCallback, useState } from 'react'\nimport { BigNumber } from '@ethersproject/bignumber'\nimport { TransactionResponse } from '@ethersproject/providers'\nimport { Currency, currencyEquals, ETHER, TokenAmount, WETH } from '@pancakeswap-libs/sdk'\nimport { Button, CardBody, AddIcon, Text as UIKitText } from '@pancakeswap-libs/uikit'\nimport { RouteComponentProps } from 'react-router-dom'\nimport { LightCard } from 'components/Card'\nimport { AutoColumn, ColumnCenter } from 'components/Column'\nimport TransactionConfirmationModal, { ConfirmationModalContent } from 'components/TransactionConfirmationModal'\nimport CardNav from 'components/CardNav'\nimport CurrencyInputPanel from 'components/CurrencyInputPanel'\nimport DoubleCurrencyLogo from 'components/DoubleLogo'\nimport { AddRemoveTabs } from 'components/NavigationTabs'\nimport { MinimalPositionCard } from 'components/PositionCard'\nimport Row, { RowBetween, RowFlat } from 'components/Row'\n\nimport { PairState } from 'data/Reserves'\nimport { useActiveWeb3React } from 'hooks'\nimport { useCurrency } from 'hooks/Tokens'\nimport { ApprovalState, useApproveCallback } from 'hooks/useApproveCallback'\nimport { Field } from 'state/mint/actions'\nimport { useDerivedMintInfo, useMintActionHandlers, useMintState } from 'state/mint/hooks'\n\nimport { useTransactionAdder } from 'state/transactions/hooks'\nimport { useIsExpertMode, useUserDeadline, useUserSlippageTolerance } from 'state/user/hooks'\nimport { calculateGasMargin, calculateSlippageAmount, getRouterContract } from 'utils'\nimport { maxAmountSpend } from 'utils/maxAmountSpend'\nimport { wrappedCurrency } from 'utils/wrappedCurrency'\nimport { currencyId } from 'utils/currencyId'\nimport Pane from 'components/Pane'\nimport ConnectWalletButton from 'components/ConnectWalletButton'\nimport useI18n from 'hooks/useI18n'\nimport AppBody from '../AppBody'\nimport { Dots, Wrapper } from '../Pool/styleds'\nimport { ConfirmAddModalBottom } from './ConfirmAddModalBottom'\nimport { PoolPriceBar } from './PoolPriceBar'\nimport { ROUTER_ADDRESS } from '../../constants'\n\nexport default function AddLiquidity({\n match: {\n params: { currencyIdA, currencyIdB },\n },\n history,\n}: RouteComponentProps<{ currencyIdA?: string; currencyIdB?: string }>) {\n const { account, chainId, library } = useActiveWeb3React()\n const currencyA = useCurrency(currencyIdA)\n const currencyB = useCurrency(currencyIdB)\n const TranslateString = useI18n()\n\n const oneCurrencyIsWBNB = Boolean(\n chainId &&\n ((currencyA && currencyEquals(currencyA, WETH[chainId])) ||\n (currencyB && currencyEquals(currencyB, WETH[chainId])))\n )\n const expertMode = useIsExpertMode()\n\n // mint state\n const { independentField, typedValue, otherTypedValue } = useMintState()\n const {\n dependentField,\n currencies,\n pair,\n pairState,\n currencyBalances,\n parsedAmounts,\n price,\n noLiquidity,\n liquidityMinted,\n poolTokenPercentage,\n error,\n } = useDerivedMintInfo(currencyA ?? undefined, currencyB ?? undefined)\n const { onFieldAInput, onFieldBInput } = useMintActionHandlers(noLiquidity)\n\n const isValid = !error\n\n // modal and loading\n const [showConfirm, setShowConfirm] = useState(false)\n const [attemptingTxn, setAttemptingTxn] = useState(false) // clicked confirm\n\n // txn values\n const [deadline] = useUserDeadline() // custom from users settings\n const [allowedSlippage] = useUserSlippageTolerance() // custom from users\n const [txHash, setTxHash] = useState('')\n\n // get formatted amounts\n const formattedAmounts = {\n [independentField]: typedValue,\n [dependentField]: noLiquidity ? otherTypedValue : parsedAmounts[dependentField]?.toSignificant(6) ?? '',\n }\n\n // get the max amounts user can add\n const maxAmounts: { [field in Field]?: TokenAmount } = [Field.CURRENCY_A, Field.CURRENCY_B].reduce(\n (accumulator, field) => {\n return {\n ...accumulator,\n [field]: maxAmountSpend(currencyBalances[field]),\n }\n },\n {}\n )\n\n const atMaxAmounts: { [field in Field]?: TokenAmount } = [Field.CURRENCY_A, Field.CURRENCY_B].reduce(\n (accumulator, field) => {\n return {\n ...accumulator,\n [field]: maxAmounts[field]?.equalTo(parsedAmounts[field] ?? '0'),\n }\n },\n {}\n )\n\n // check whether the user has approved the router on the tokens\n const [approvalA, approveACallback] = useApproveCallback(parsedAmounts[Field.CURRENCY_A], ROUTER_ADDRESS)\n const [approvalB, approveBCallback] = useApproveCallback(parsedAmounts[Field.CURRENCY_B], ROUTER_ADDRESS)\n\n const addTransaction = useTransactionAdder()\n\n async function onAdd() {\n if (!chainId || !library || !account) return\n const router = getRouterContract(chainId, library, account)\n\n const { [Field.CURRENCY_A]: parsedAmountA, [Field.CURRENCY_B]: parsedAmountB } = parsedAmounts\n if (!parsedAmountA || !parsedAmountB || !currencyA || !currencyB) {\n return\n }\n\n const amountsMin = {\n [Field.CURRENCY_A]: calculateSlippageAmount(parsedAmountA, noLiquidity ? 0 : allowedSlippage)[0],\n [Field.CURRENCY_B]: calculateSlippageAmount(parsedAmountB, noLiquidity ? 0 : allowedSlippage)[0],\n }\n\n const deadlineFromNow = Math.ceil(Date.now() / 1000) + deadline\n\n let estimate\n let method: (...args: any) => Promise\n let args: Array\n let value: BigNumber | null\n if (currencyA === ETHER || currencyB === ETHER) {\n const tokenBIsBNB = currencyB === ETHER\n estimate = router.estimateGas.addLiquidityETH\n method = router.addLiquidityETH\n args = [\n wrappedCurrency(tokenBIsBNB ? currencyA : currencyB, chainId)?.address ?? '', // token\n (tokenBIsBNB ? parsedAmountA : parsedAmountB).raw.toString(), // token desired\n amountsMin[tokenBIsBNB ? Field.CURRENCY_A : Field.CURRENCY_B].toString(), // token min\n amountsMin[tokenBIsBNB ? Field.CURRENCY_B : Field.CURRENCY_A].toString(), // eth min\n account,\n deadlineFromNow,\n ]\n value = BigNumber.from((tokenBIsBNB ? parsedAmountB : parsedAmountA).raw.toString())\n } else {\n estimate = router.estimateGas.addLiquidity\n method = router.addLiquidity\n args = [\n wrappedCurrency(currencyA, chainId)?.address ?? '',\n wrappedCurrency(currencyB, chainId)?.address ?? '',\n parsedAmountA.raw.toString(),\n parsedAmountB.raw.toString(),\n amountsMin[Field.CURRENCY_A].toString(),\n amountsMin[Field.CURRENCY_B].toString(),\n account,\n deadlineFromNow,\n ]\n value = null\n }\n\n setAttemptingTxn(true)\n // const aa = await estimate(...args, value ? { value } : {})\n await estimate(...args, value ? { value } : {})\n .then((estimatedGasLimit) =>\n method(...args, {\n ...(value ? { value } : {}),\n gasLimit: calculateGasMargin(estimatedGasLimit),\n }).then((response) => {\n setAttemptingTxn(false)\n\n addTransaction(response, {\n summary: `Add ${parsedAmounts[Field.CURRENCY_A]?.toSignificant(3)} ${\n currencies[Field.CURRENCY_A]?.symbol\n } and ${parsedAmounts[Field.CURRENCY_B]?.toSignificant(3)} ${currencies[Field.CURRENCY_B]?.symbol}`,\n })\n\n setTxHash(response.hash)\n })\n )\n .catch((e) => {\n setAttemptingTxn(false)\n // we only care if the error is something _other_ than the user rejected the tx\n if (e?.code !== 4001) {\n console.error(e)\n }\n })\n }\n\n const modalHeader = () => {\n return noLiquidity ? (\n \n \n \n \n {`${currencies[Field.CURRENCY_A]?.symbol}/${currencies[Field.CURRENCY_B]?.symbol}`}\n \n \n \n \n \n ) : (\n \n \n \n {liquidityMinted?.toSignificant(6)}\n \n \n \n \n \n {`${currencies[Field.CURRENCY_A]?.symbol}/${currencies[Field.CURRENCY_B]?.symbol} Pool Tokens`}\n \n \n \n {`Output is estimated. If the price changes by more than ${\n allowedSlippage / 100\n }% your transaction will revert.`}\n \n \n )\n }\n\n const modalBottom = () => {\n return (\n \n )\n }\n\n const pendingText = `Supplying ${parsedAmounts[Field.CURRENCY_A]?.toSignificant(6)} ${\n currencies[Field.CURRENCY_A]?.symbol\n } and ${parsedAmounts[Field.CURRENCY_B]?.toSignificant(6)} ${currencies[Field.CURRENCY_B]?.symbol}`\n\n const handleCurrencyASelect = useCallback(\n (currA: Currency) => {\n const newCurrencyIdA = currencyId(currA)\n if (newCurrencyIdA === currencyIdB) {\n history.push(`/add/${currencyIdB}/${currencyIdA}`)\n } else {\n history.push(`/add/${newCurrencyIdA}/${currencyIdB}`)\n }\n },\n [currencyIdB, history, currencyIdA]\n )\n const handleCurrencyBSelect = useCallback(\n (currB: Currency) => {\n const newCurrencyIdB = currencyId(currB)\n if (currencyIdA === newCurrencyIdB) {\n if (currencyIdB) {\n history.push(`/add/${currencyIdB}/${newCurrencyIdB}`)\n } else {\n history.push(`/add/${newCurrencyIdB}`)\n }\n } else {\n history.push(`/add/${currencyIdA || 'BNB'}/${newCurrencyIdB}`)\n }\n },\n [currencyIdA, history, currencyIdB]\n )\n\n const handleDismissConfirmation = useCallback(() => {\n setShowConfirm(false)\n // if there was a tx hash, we want to clear the input\n if (txHash) {\n onFieldAInput('')\n }\n setTxHash('')\n }, [onFieldAInput, txHash])\n\n return (\n <>\n \n \n \n \n (\n \n )}\n pendingText={pendingText}\n />\n \n \n {noLiquidity && (\n \n \n \n {TranslateString(1158, 'You are the first liquidity provider.')}\n \n {TranslateString(1160, 'The ratio of tokens you add will set the price of this pool.')}\n \n \n {TranslateString(1162, 'Once you are happy with the rate click supply to review.')}\n \n \n \n \n )}\n {\n onFieldAInput(maxAmounts[Field.CURRENCY_A]?.toExact() ?? '')\n }}\n onCurrencySelect={handleCurrencyASelect}\n showMaxButton={!atMaxAmounts[Field.CURRENCY_A]}\n currency={currencies[Field.CURRENCY_A]}\n id=\"add-liquidity-input-tokena\"\n showCommonBases={false}\n />\n \n \n \n {\n onFieldBInput(maxAmounts[Field.CURRENCY_B]?.toExact() ?? '')\n }}\n showMaxButton={!atMaxAmounts[Field.CURRENCY_B]}\n currency={currencies[Field.CURRENCY_B]}\n id=\"add-liquidity-input-tokenb\"\n showCommonBases={false}\n />\n {currencies[Field.CURRENCY_A] && currencies[Field.CURRENCY_B] && pairState !== PairState.INVALID && (\n
\n \n {noLiquidity\n ? TranslateString(1164, 'Initial prices and pool share')\n : TranslateString(1166, 'Prices and pool share')}\n \n \n \n \n
\n )}\n\n {!account ? (\n \n ) : (\n \n {(approvalA === ApprovalState.NOT_APPROVED ||\n approvalA === ApprovalState.PENDING ||\n approvalB === ApprovalState.NOT_APPROVED ||\n approvalB === ApprovalState.PENDING) &&\n isValid && (\n \n {approvalA !== ApprovalState.APPROVED && (\n \n {approvalA === ApprovalState.PENDING ? (\n Approving {currencies[Field.CURRENCY_A]?.symbol}\n ) : (\n `Approve ${currencies[Field.CURRENCY_A]?.symbol}`\n )}\n \n )}\n {approvalB !== ApprovalState.APPROVED && (\n \n {approvalB === ApprovalState.PENDING ? (\n Approving {currencies[Field.CURRENCY_B]?.symbol}\n ) : (\n `Approve ${currencies[Field.CURRENCY_B]?.symbol}`\n )}\n \n )}\n \n )}\n {\n if (expertMode) {\n onAdd()\n } else {\n setShowConfirm(true)\n }\n }}\n disabled={!isValid || approvalA !== ApprovalState.APPROVED || approvalB !== ApprovalState.APPROVED}\n variant={\n !isValid && !!parsedAmounts[Field.CURRENCY_A] && !!parsedAmounts[Field.CURRENCY_B]\n ? 'danger'\n : 'primary'\n }\n width=\"100%\"\n >\n {error ?? 'Supply'}\n \n \n )}\n
\n
\n
\n
\n {pair && !noLiquidity && pairState !== PairState.INVALID ? (\n \n \n \n ) : null}\n \n )\n}\n","import React from 'react'\nimport { Redirect, RouteComponentProps } from 'react-router-dom'\nimport AddLiquidity from './index'\n\nconst OLD_PATH_STRUCTURE = /^(0x[a-fA-F0-9]{40})-(0x[a-fA-F0-9]{40})$/\nexport function RedirectOldAddLiquidityPathStructure(props: RouteComponentProps<{ currencyIdA: string }>) {\n const {\n match: {\n params: { currencyIdA },\n },\n } = props\n const match = currencyIdA.match(OLD_PATH_STRUCTURE)\n if (match?.length) {\n return \n }\n\n return \n}\n\nexport function RedirectDuplicateTokenIds(props: RouteComponentProps<{ currencyIdA: string; currencyIdB: string }>) {\n const {\n match: {\n params: { currencyIdA, currencyIdB },\n },\n } = props\n if (currencyIdA.toLowerCase() === currencyIdB.toLowerCase()) {\n return \n }\n return \n}\n","import React from 'react'\nimport { RouteComponentProps, Redirect } from 'react-router-dom'\n\nconst OLD_PATH_STRUCTURE = /^(0x[a-fA-F0-9]{40})-(0x[a-fA-F0-9]{40})$/\n\nexport function RedirectOldRemoveLiquidityPathStructure({\n match: {\n params: { tokens },\n },\n}: RouteComponentProps<{ tokens: string }>) {\n if (!OLD_PATH_STRUCTURE.test(tokens)) {\n return \n }\n const [currency0, currency1] = tokens.split('-')\n\n return \n}\n\nexport default RedirectOldRemoveLiquidityPathStructure\n","import React, { useEffect, useState } from 'react'\nimport styled from 'styled-components'\nimport { Box, Button, Flex, Input, Text } from '@pancakeswap-libs/uikit'\nimport { useUserSlippageTolerance } from 'state/user/hooks'\nimport QuestionHelper from '../QuestionHelper'\n\nconst MAX_SLIPPAGE = 5000\nconst RISKY_SLIPPAGE_LOW = 50\nconst RISKY_SLIPPAGE_HIGH = 500\n\nconst Option = styled.div`\n padding: 0 4px;\n`\n\nconst Options = styled.div`\n align-items: center;\n display: flex;\n flex-direction: column;\n\n ${Option}:first-child {\n padding-left: 0;\n }\n\n ${Option}:last-child {\n padding-right: 0;\n }\n\n ${({ theme }) => theme.mediaQueries.sm} {\n flex-direction: row;\n }\n`\n\nconst predefinedValues = [\n { label: '0.1%', value: 0.1 },\n { label: '0.5%', value: 0.5 },\n { label: '1%', value: 1 },\n]\n\ntype SlippageToleranceSettingsModalProps = {\n translateString: (translationId: number, fallback: string) => string\n}\n\nconst SlippageToleranceSettings = ({ translateString }: SlippageToleranceSettingsModalProps) => {\n const [userSlippageTolerance, setUserslippageTolerance] = useUserSlippageTolerance()\n const [value, setValue] = useState(userSlippageTolerance / 100)\n const [error, setError] = useState(null)\n const handleChange = (evt: React.ChangeEvent) => {\n const { value: inputValue } = evt.target\n setValue(parseFloat(inputValue))\n }\n\n // Updates local storage if value is valid\n useEffect(() => {\n try {\n const rawValue = value * 100\n if (!Number.isNaN(rawValue) && rawValue > 0 && rawValue < MAX_SLIPPAGE) {\n setUserslippageTolerance(rawValue)\n setError(null)\n } else {\n setError(translateString(1144, 'Enter a valid slippage percentage'))\n }\n } catch {\n setError(translateString(1144, 'Enter a valid slippage percentage'))\n }\n }, [value, setError, setUserslippageTolerance, translateString])\n\n // Notify user if slippage is risky\n useEffect(() => {\n if (userSlippageTolerance < RISKY_SLIPPAGE_LOW) {\n setError(translateString(1146, 'Your transaction may fail'))\n } else if (userSlippageTolerance > RISKY_SLIPPAGE_HIGH) {\n setError(translateString(1148, 'Your transaction may be frontrun'))\n }\n }, [userSlippageTolerance, setError, translateString])\n\n return (\n \n \n {translateString(88, 'Slippage tolerance')}\n \n \n \n \n {predefinedValues.map(({ label, value: predefinedValue }) => {\n const handleClick = () => setValue(predefinedValue)\n\n return (\n \n )\n })}\n \n \n \n \n \n \n {error && (\n \n {error}\n \n )}\n \n )\n}\n\nexport default SlippageToleranceSettings\n","import React, { useEffect, useState } from 'react'\nimport styled from 'styled-components'\nimport { Input, Text, Flex, Box } from '@pancakeswap-libs/uikit'\nimport { useUserDeadline } from 'state/user/hooks'\nimport QuestionHelper from '../QuestionHelper'\n\nconst Field = styled.div`\n align-items: center;\n display: inline-flex;\n\n & > ${Input} {\n max-width: 100px;\n }\n`\n\ntype TransactionDeadlineSettingModalProps = {\n translateString: (translationId: number, fallback: string) => string\n}\n\nconst TransactionDeadlineSetting = ({ translateString }: TransactionDeadlineSettingModalProps) => {\n const [deadline, setDeadline] = useUserDeadline()\n const [value, setValue] = useState(deadline / 60) // deadline in minutes\n const [error, setError] = useState(null)\n\n const handleChange = (evt: React.ChangeEvent) => {\n const { value: inputValue } = evt.target\n setValue(parseInt(inputValue, 10))\n }\n\n // Updates local storage if value is valid\n useEffect(() => {\n try {\n const rawValue = value * 60\n if (!Number.isNaN(rawValue) && rawValue > 0) {\n setDeadline(rawValue)\n setError(null)\n } else {\n setError(translateString(1150, 'Enter a valid deadline'))\n }\n } catch {\n setError(translateString(1150, 'Enter a valid deadline'))\n }\n }, [value, setError, setDeadline, translateString])\n\n return (\n \n \n {translateString(90, 'Transaction deadline')}\n \n \n \n \n \n Minutes\n \n \n {error && (\n \n {error}\n \n )}\n \n )\n}\n\nexport default TransactionDeadlineSetting\n","import React from 'react'\nimport { Box, Flex, Text, PancakeToggle, useMatchBreakpoints } from '@pancakeswap-libs/uikit'\nimport { useAudioModeManager } from 'state/user/hooks'\n\ntype AudioSettingModalProps = {\n translateString: (translationId: number, fallback: string) => string\n}\n\nconst AudioSetting = ({ translateString }: AudioSettingModalProps) => {\n const { isSm, isXs } = useMatchBreakpoints()\n const [audioPlay, toggleSetAudioMode] = useAudioModeManager()\n\n return (\n \n \n {translateString(999, 'Audio')}\n \n \n \n \n \n )\n}\n\nexport default AudioSetting\n","import React from 'react'\nimport { Modal } from '@pancakeswap-libs/uikit'\nimport SlippageToleranceSetting from './SlippageToleranceSetting'\nimport TransactionDeadlineSetting from './TransactionDeadlineSetting'\nimport AudioSetting from './AudioSetting'\n\ntype SettingsModalProps = {\n onDismiss?: () => void\n translateString: (translationId: number, fallback: string) => string\n}\n\n// TODO: Fix UI Kit typings\nconst defaultOnDismiss = () => null\n\nconst SettingsModal = ({ onDismiss = defaultOnDismiss, translateString }: SettingsModalProps) => {\n return (\n \n \n \n \n \n )\n}\n\nexport default SettingsModal\n","import React, { useMemo } from 'react'\nimport { CheckmarkCircleIcon, ErrorIcon, Flex, LinkExternal, Text, Modal, Button } from '@pancakeswap-libs/uikit'\nimport { useActiveWeb3React } from 'hooks'\nimport { getBscScanLink } from 'utils'\nimport { isTransactionRecent, useAllTransactions } from 'state/transactions/hooks'\nimport { TransactionDetails } from 'state/transactions/reducer'\nimport Loader from 'components/Loader'\n\ntype RecentTransactionsModalProps = {\n onDismiss?: () => void\n translateString: (translationId: number, fallback: string) => string\n}\n\n// TODO: Fix UI Kit typings\nconst defaultOnDismiss = () => null\n\nconst newTransactionsFirst = (a: TransactionDetails, b: TransactionDetails) => b.addedTime - a.addedTime\n\nconst getRowStatus = (sortedRecentTransaction: TransactionDetails) => {\n const { hash, receipt } = sortedRecentTransaction\n\n if (!hash) {\n return { icon: , color: 'text' }\n }\n\n if (hash && receipt?.status === 1) {\n return { icon: , color: 'success' }\n }\n\n return { icon: , color: 'failure' }\n}\n\nconst RecentTransactionsModal = ({ onDismiss = defaultOnDismiss, translateString }: RecentTransactionsModalProps) => {\n const { account, chainId } = useActiveWeb3React()\n const allTransactions = useAllTransactions()\n\n // Logic taken from Web3Status/index.tsx line 175\n const sortedRecentTransactions = useMemo(() => {\n const txs = Object.values(allTransactions)\n return txs.filter(isTransactionRecent).sort(newTransactionsFirst)\n }, [allTransactions])\n\n return (\n \n {!account && (\n \n \n Please connect your wallet to view your recent transactions\n \n \n \n )}\n {account && chainId && sortedRecentTransactions.length === 0 && (\n \n \n No recent transactions\n \n \n \n )}\n {account &&\n chainId &&\n sortedRecentTransactions.map((sortedRecentTransaction) => {\n const { hash, summary } = sortedRecentTransaction\n const { icon, color } = getRowStatus(sortedRecentTransaction)\n\n return (\n <>\n \n \n {summary ?? hash}\n \n {icon}\n \n \n )\n })}\n \n )\n}\n\nexport default RecentTransactionsModal\n","import React, { ReactNode } from 'react'\nimport styled from 'styled-components'\nimport { Heading, IconButton, Text, Flex, useModal, TuneIcon, HistoryIcon } from '@pancakeswap-libs/uikit'\nimport useI18n from 'hooks/useI18n'\nimport SettingsModal from './SettingsModal'\nimport RecentTransactionsModal from './RecentTransactionsModal'\n\ninterface PageHeaderProps {\n title: ReactNode\n description?: ReactNode\n children?: ReactNode\n}\n\nconst StyledPageHeader = styled.div`\n border-bottom: 1px solid ${({ theme }) => theme.colors.borderColor};\n padding: 24px;\n`\n\nconst Details = styled.div`\n flex: 1;\n`\n\nconst PageHeader = ({ title, description, children }: PageHeaderProps) => {\n const TranslateString = useI18n()\n const [onPresentSettings] = useModal()\n const [onPresentRecentTransactions] = useModal()\n\n return (\n \n \n
\n {title}\n {description && (\n \n {description}\n \n )}\n
\n \n \n \n \n \n \n
\n {children && {children}}\n
\n )\n}\n\nexport default PageHeader\n","import { Currency, ETHER, JSBI, TokenAmount } from '@pancakeswap-libs/sdk'\nimport React, { useCallback, useEffect, useState } from 'react'\nimport { Button, ChevronDownIcon, AddIcon, CardBody, Text } from '@pancakeswap-libs/uikit'\nimport CardNav from 'components/CardNav'\nimport { LightCard } from 'components/Card'\nimport { AutoColumn, ColumnCenter } from 'components/Column'\nimport CurrencyLogo from 'components/CurrencyLogo'\nimport { FindPoolTabs } from 'components/NavigationTabs'\nimport { MinimalPositionCard } from 'components/PositionCard'\nimport CurrencySearchModal from 'components/SearchModal/CurrencySearchModal'\nimport { PairState, usePair } from 'data/Reserves'\nimport { useActiveWeb3React } from 'hooks'\nimport { usePairAdder } from 'state/user/hooks'\nimport { useTokenBalance } from 'state/wallet/hooks'\nimport { StyledInternalLink } from 'components/Shared'\nimport { currencyId } from 'utils/currencyId'\nimport useI18n from 'hooks/useI18n'\nimport AppBody from '../AppBody'\nimport { Dots } from '../Pool/styleds'\n\nenum Fields {\n TOKEN0 = 0,\n TOKEN1 = 1,\n}\n\nexport default function PoolFinder() {\n const { account } = useActiveWeb3React()\n\n const [showSearch, setShowSearch] = useState(false)\n const [activeField, setActiveField] = useState(Fields.TOKEN1)\n\n const [currency0, setCurrency0] = useState(ETHER)\n const [currency1, setCurrency1] = useState(null)\n\n const [pairState, pair] = usePair(currency0 ?? undefined, currency1 ?? undefined)\n const addPair = usePairAdder()\n\n const TranslateString = useI18n()\n useEffect(() => {\n if (pair) {\n addPair(pair)\n }\n }, [pair, addPair])\n\n const validPairNoLiquidity: boolean =\n pairState === PairState.NOT_EXISTS ||\n Boolean(\n pairState === PairState.EXISTS &&\n pair &&\n JSBI.equal(pair.reserve0.raw, JSBI.BigInt(0)) &&\n JSBI.equal(pair.reserve1.raw, JSBI.BigInt(0))\n )\n\n const position: TokenAmount | undefined = useTokenBalance(account ?? undefined, pair?.liquidityToken)\n const hasPosition = Boolean(position && JSBI.greaterThan(position.raw, JSBI.BigInt(0)))\n\n const handleCurrencySelect = useCallback(\n (currency: Currency) => {\n if (activeField === Fields.TOKEN0) {\n setCurrency0(currency)\n } else {\n setCurrency1(currency)\n }\n },\n [activeField]\n )\n\n const handleSearchDismiss = useCallback(() => {\n setShowSearch(false)\n }, [setShowSearch])\n\n const prerequisiteMessage = (\n \n \n {!account\n ? TranslateString(1174, 'Connect to a wallet to find pools')\n : TranslateString(208, 'Select a token to find your liquidity.')}\n \n \n )\n\n return (\n <>\n \n \n \n \n \n {\n setShowSearch(true)\n setActiveField(Fields.TOKEN0)\n }}\n startIcon={currency0 ? : null}\n endIcon={}\n width=\"100%\"\n >\n {currency0 ? currency0.symbol : TranslateString(82, 'Select a Token')}\n \n\n \n \n \n\n {\n setShowSearch(true)\n setActiveField(Fields.TOKEN1)\n }}\n startIcon={currency1 ? : null}\n endIcon={}\n width=\"100%\"\n >\n {currency1 ? currency1.symbol : TranslateString(82, 'Select a Token')}\n \n\n {hasPosition && (\n \n {TranslateString(210, 'Pool found!')}\n \n )}\n\n {currency0 && currency1 ? (\n pairState === PairState.EXISTS ? (\n hasPosition && pair ? (\n \n ) : (\n \n \n \n {TranslateString(212, 'You don’t have liquidity in this pool yet.')}\n \n \n {TranslateString(168, 'Add Liquidity')}\n \n \n \n )\n ) : validPairNoLiquidity ? (\n \n \n {TranslateString(214, 'No pool found.')}\n \n Create pool.\n \n \n \n ) : pairState === PairState.INVALID ? (\n \n \n {TranslateString(136, 'Invalid pair.')}\n \n \n ) : pairState === PairState.LOADING ? (\n \n \n \n Loading\n \n \n \n \n ) : null\n ) : (\n prerequisiteMessage\n )}\n \n\n \n \n \n \n )\n}\n","import React, { useContext, useMemo } from 'react'\nimport { ThemeContext } from 'styled-components'\nimport { Pair } from '@pancakeswap-libs/sdk'\nimport { Button, CardBody, Text } from '@pancakeswap-libs/uikit'\nimport { Link } from 'react-router-dom'\nimport CardNav from 'components/CardNav'\nimport Question from 'components/QuestionHelper'\nimport FullPositionCard from 'components/PositionCard'\nimport { useTokenBalancesWithLoadingIndicator } from 'state/wallet/hooks'\nimport { StyledInternalLink } from 'components/Shared'\nimport { LightCard } from 'components/Card'\nimport { RowBetween } from 'components/Row'\nimport { AutoColumn } from 'components/Column'\n\nimport { useActiveWeb3React } from 'hooks'\nimport { usePairs } from 'data/Reserves'\nimport { toV2LiquidityToken, useTrackedTokenPairs } from 'state/user/hooks'\nimport { Dots } from 'components/swap/styleds'\nimport useI18n from 'hooks/useI18n'\nimport PageHeader from 'components/PageHeader'\nimport AppBody from '../AppBody'\n\nexport default function Pool() {\n const theme = useContext(ThemeContext)\n const { account } = useActiveWeb3React()\n const TranslateString = useI18n()\n\n // fetch the user's balances of all tracked V2 LP tokens\n const trackedTokenPairs = useTrackedTokenPairs()\n const tokenPairsWithLiquidityTokens = useMemo(\n () => trackedTokenPairs.map((tokens) => ({ liquidityToken: toV2LiquidityToken(tokens), tokens })),\n [trackedTokenPairs]\n )\n const liquidityTokens = useMemo(() => tokenPairsWithLiquidityTokens.map((tpwlt) => tpwlt.liquidityToken), [\n tokenPairsWithLiquidityTokens,\n ])\n const [v2PairsBalances, fetchingV2PairBalances] = useTokenBalancesWithLoadingIndicator(\n account ?? undefined,\n liquidityTokens\n )\n\n // fetch the reserves for all V2 pools in which the user has a balance\n const liquidityTokensWithBalances = useMemo(\n () =>\n tokenPairsWithLiquidityTokens.filter(({ liquidityToken }) =>\n v2PairsBalances[liquidityToken.address]?.greaterThan('0')\n ),\n [tokenPairsWithLiquidityTokens, v2PairsBalances]\n )\n\n const v2Pairs = usePairs(liquidityTokensWithBalances.map(({ tokens }) => tokens))\n const v2IsLoading =\n fetchingV2PairBalances || v2Pairs?.length < liquidityTokensWithBalances.length || v2Pairs?.some((V2Pair) => !V2Pair)\n\n const allV2PairsWithLiquidity = v2Pairs.map(([, pair]) => pair).filter((v2Pair): v2Pair is Pair => Boolean(v2Pair))\n\n return (\n <>\n \n \n \n \n \n \n \n \n \n {TranslateString(107, 'Your Liquidity')}\n \n \n\n {!account ? (\n \n \n {TranslateString(156, 'Connect to a wallet to view your liquidity.')}\n \n \n ) : v2IsLoading ? (\n \n \n Loading\n \n \n ) : allV2PairsWithLiquidity?.length > 0 ? (\n <>\n {allV2PairsWithLiquidity.map((v2Pair) => (\n \n ))}\n \n ) : (\n \n \n {TranslateString(104, 'No liquidity found.')}\n \n \n )}\n\n
\n \n {TranslateString(106, \"Don't see a pool you joined?\")}{' '}\n \n {TranslateString(108, 'Import it.')}\n \n \n \n {TranslateString(1172, 'Or, if you staked your LP tokens in a farm, unstake them to see them here.')}\n \n
\n
\n
\n
\n
\n \n )\n}\n","import React, { useCallback } from 'react'\nimport styled from 'styled-components'\n\nconst StyledRangeInput = styled.input<{ size: number }>`\n -webkit-appearance: none; /* Hides the slider so that custom slider can be made */\n width: 100%; /* Specific width is required for Firefox. */\n background: transparent; /* Otherwise white in Chrome */\n cursor: pointer;\n\n &:focus {\n outline: none;\n }\n\n &::-moz-focus-outer {\n border: 0;\n }\n\n &::-webkit-slider-thumb {\n -webkit-appearance: none;\n height: ${({ size }) => size}px;\n width: ${({ size }) => size}px;\n background-color: #565a69;\n border-radius: 100%;\n border: none;\n transform: translateY(-50%);\n color: ${({ theme }) => theme.colors.invertedContrast};\n\n &:hover,\n &:focus {\n box-shadow: 0px 0px 1px rgba(0, 0, 0, 0.1), 0px 4px 8px rgba(0, 0, 0, 0.08), 0px 16px 24px rgba(0, 0, 0, 0.06),\n 0px 24px 32px rgba(0, 0, 0, 0.04);\n }\n }\n\n &::-moz-range-thumb {\n height: ${({ size }) => size}px;\n width: ${({ size }) => size}px;\n background-color: #565a69;\n border-radius: 100%;\n border: none;\n color: ${({ theme }) => theme.colors.invertedContrast};\n\n &:hover,\n &:focus {\n box-shadow: 0px 0px 1px rgba(0, 0, 0, 0.1), 0px 4px 8px rgba(0, 0, 0, 0.08), 0px 16px 24px rgba(0, 0, 0, 0.06),\n 0px 24px 32px rgba(0, 0, 0, 0.04);\n }\n }\n\n &::-ms-thumb {\n height: ${({ size }) => size}px;\n width: ${({ size }) => size}px;\n background-color: #565a69;\n border-radius: 100%;\n color: ${({ theme }) => theme.colors.invertedContrast};\n\n &:hover,\n &:focus {\n box-shadow: 0px 0px 1px rgba(0, 0, 0, 0.1), 0px 4px 8px rgba(0, 0, 0, 0.08), 0px 16px 24px rgba(0, 0, 0, 0.06),\n 0px 24px 32px rgba(0, 0, 0, 0.04);\n }\n }\n\n &::-webkit-slider-runnable-track {\n background: linear-gradient(\n 90deg,\n ${({ theme }) => theme.colors.primaryDark},\n ${({ theme }) => theme.colors.tertiary}\n );\n height: 2px;\n }\n\n &::-moz-range-track {\n background: linear-gradient(\n 90deg,\n ${({ theme }) => theme.colors.primaryDark},\n ${({ theme }) => theme.colors.tertiary}\n );\n height: 2px;\n }\n\n &::-ms-track {\n width: 100%;\n border-color: transparent;\n color: transparent;\n\n background: ${({ theme }) => theme.colors.primaryDark};\n height: 2px;\n }\n &::-ms-fill-lower {\n background: ${({ theme }) => theme.colors.primaryDark};\n }\n &::-ms-fill-upper {\n background: ${({ theme }) => theme.colors.tertiary};\n }\n`\n\ninterface InputSliderProps {\n value: number\n onChange: (value: number) => void\n step?: number\n min?: number\n max?: number\n size?: number\n}\n\nexport default function Slider({ value, onChange, min = 0, step = 1, max = 100, size = 28 }: InputSliderProps) {\n const changeCallback = useCallback(\n e => {\n onChange(parseInt(e.target.value))\n },\n [onChange]\n )\n\n return (\n \n )\n}\n","import { createAction } from '@reduxjs/toolkit'\n\nexport enum Field {\n LIQUIDITY_PERCENT = 'LIQUIDITY_PERCENT',\n LIQUIDITY = 'LIQUIDITY',\n CURRENCY_A = 'CURRENCY_A',\n CURRENCY_B = 'CURRENCY_B'\n}\n\nexport const typeInput = createAction<{ field: Field; typedValue: string }>('burn/typeInputBurn')\n","import { Currency, CurrencyAmount, JSBI, Pair, Percent, TokenAmount } from '@pancakeswap-libs/sdk'\nimport { useCallback } from 'react'\nimport { useDispatch, useSelector } from 'react-redux'\nimport { usePair } from '../../data/Reserves'\nimport { useTotalSupply } from '../../data/TotalSupply'\n\nimport { useActiveWeb3React } from '../../hooks'\nimport { wrappedCurrency } from '../../utils/wrappedCurrency'\nimport { AppDispatch, AppState } from '../index'\nimport { tryParseAmount } from '../swap/hooks'\nimport { useTokenBalances } from '../wallet/hooks'\nimport { Field, typeInput } from './actions'\n\nexport function useBurnState(): AppState['burn'] {\n return useSelector(state => state.burn)\n}\n\nexport function useDerivedBurnInfo(\n currencyA: Currency | undefined,\n currencyB: Currency | undefined\n): {\n pair?: Pair | null\n parsedAmounts: {\n [Field.LIQUIDITY_PERCENT]: Percent\n [Field.LIQUIDITY]?: TokenAmount\n [Field.CURRENCY_A]?: CurrencyAmount\n [Field.CURRENCY_B]?: CurrencyAmount\n }\n error?: string\n} {\n const { account, chainId } = useActiveWeb3React()\n\n const { independentField, typedValue } = useBurnState()\n\n // pair + totalsupply\n const [, pair] = usePair(currencyA, currencyB)\n\n // balances\n const relevantTokenBalances = useTokenBalances(account ?? undefined, [pair?.liquidityToken])\n const userLiquidity: undefined | TokenAmount = relevantTokenBalances?.[pair?.liquidityToken?.address ?? '']\n\n const [tokenA, tokenB] = [wrappedCurrency(currencyA, chainId), wrappedCurrency(currencyB, chainId)]\n const tokens = {\n [Field.CURRENCY_A]: tokenA,\n [Field.CURRENCY_B]: tokenB,\n [Field.LIQUIDITY]: pair?.liquidityToken\n }\n\n // liquidity values\n const totalSupply = useTotalSupply(pair?.liquidityToken)\n const liquidityValueA =\n pair &&\n totalSupply &&\n userLiquidity &&\n tokenA &&\n // this condition is a short-circuit in the case where useTokenBalance updates sooner than useTotalSupply\n JSBI.greaterThanOrEqual(totalSupply.raw, userLiquidity.raw)\n ? new TokenAmount(tokenA, pair.getLiquidityValue(tokenA, totalSupply, userLiquidity, false).raw)\n : undefined\n const liquidityValueB =\n pair &&\n totalSupply &&\n userLiquidity &&\n tokenB &&\n // this condition is a short-circuit in the case where useTokenBalance updates sooner than useTotalSupply\n JSBI.greaterThanOrEqual(totalSupply.raw, userLiquidity.raw)\n ? new TokenAmount(tokenB, pair.getLiquidityValue(tokenB, totalSupply, userLiquidity, false).raw)\n : undefined\n const liquidityValues: { [Field.CURRENCY_A]?: TokenAmount; [Field.CURRENCY_B]?: TokenAmount } = {\n [Field.CURRENCY_A]: liquidityValueA,\n [Field.CURRENCY_B]: liquidityValueB\n }\n\n let percentToRemove: Percent = new Percent('0', '100')\n // user specified a %\n if (independentField === Field.LIQUIDITY_PERCENT) {\n percentToRemove = new Percent(typedValue, '100')\n }\n // user specified a specific amount of liquidity tokens\n else if (independentField === Field.LIQUIDITY) {\n if (pair?.liquidityToken) {\n const independentAmount = tryParseAmount(typedValue, pair.liquidityToken)\n if (independentAmount && userLiquidity && !independentAmount.greaterThan(userLiquidity)) {\n percentToRemove = new Percent(independentAmount.raw, userLiquidity.raw)\n }\n }\n }\n // user specified a specific amount of token a or b\n else if (tokens[independentField]) {\n const independentAmount = tryParseAmount(typedValue, tokens[independentField])\n const liquidityValue = liquidityValues[independentField]\n if (independentAmount && liquidityValue && !independentAmount.greaterThan(liquidityValue)) {\n percentToRemove = new Percent(independentAmount.raw, liquidityValue.raw)\n }\n }\n\n const parsedAmounts: {\n [Field.LIQUIDITY_PERCENT]: Percent\n [Field.LIQUIDITY]?: TokenAmount\n [Field.CURRENCY_A]?: TokenAmount\n [Field.CURRENCY_B]?: TokenAmount\n } = {\n [Field.LIQUIDITY_PERCENT]: percentToRemove,\n [Field.LIQUIDITY]:\n userLiquidity && percentToRemove && percentToRemove.greaterThan('0')\n ? new TokenAmount(userLiquidity.token, percentToRemove.multiply(userLiquidity.raw).quotient)\n : undefined,\n [Field.CURRENCY_A]:\n tokenA && percentToRemove && percentToRemove.greaterThan('0') && liquidityValueA\n ? new TokenAmount(tokenA, percentToRemove.multiply(liquidityValueA.raw).quotient)\n : undefined,\n [Field.CURRENCY_B]:\n tokenB && percentToRemove && percentToRemove.greaterThan('0') && liquidityValueB\n ? new TokenAmount(tokenB, percentToRemove.multiply(liquidityValueB.raw).quotient)\n : undefined\n }\n\n let error: string | undefined\n if (!account) {\n error = 'Connect Wallet'\n }\n\n if (!parsedAmounts[Field.LIQUIDITY] || !parsedAmounts[Field.CURRENCY_A] || !parsedAmounts[Field.CURRENCY_B]) {\n error = error ?? 'Enter an amount'\n }\n\n return { pair, parsedAmounts, error }\n}\n\nexport function useBurnActionHandlers(): {\n onUserInput: (field: Field, typedValue: string) => void\n} {\n const dispatch = useDispatch()\n\n const onUserInput = useCallback(\n (field: Field, typedValue: string) => {\n dispatch(typeInput({ field, typedValue }))\n },\n [dispatch]\n )\n\n return {\n onUserInput\n }\n}\n","import React, { useCallback, useContext, useMemo, useState } from 'react'\nimport styled, { ThemeContext } from 'styled-components'\nimport { splitSignature } from '@ethersproject/bytes'\nimport { Contract } from '@ethersproject/contracts'\nimport { TransactionResponse } from '@ethersproject/providers'\nimport { Currency, currencyEquals, ETHER, Percent, WETH } from '@pancakeswap-libs/sdk'\nimport { Button, Flex, Text } from '@pancakeswap-libs/uikit'\nimport { ArrowDown, Plus } from 'react-feather'\nimport { RouteComponentProps } from 'react-router'\n\nimport { BigNumber } from '@ethersproject/bignumber'\nimport ConnectWalletButton from 'components/ConnectWalletButton'\nimport useI18n from 'hooks/useI18n'\nimport { AutoColumn, ColumnCenter } from '../../components/Column'\nimport TransactionConfirmationModal, { ConfirmationModalContent } from '../../components/TransactionConfirmationModal'\nimport CurrencyInputPanel from '../../components/CurrencyInputPanel'\nimport DoubleCurrencyLogo from '../../components/DoubleLogo'\nimport { AddRemoveTabs } from '../../components/NavigationTabs'\nimport { MinimalPositionCard } from '../../components/PositionCard'\nimport { RowBetween, RowFixed } from '../../components/Row'\n\nimport Slider from '../../components/Slider'\nimport CurrencyLogo from '../../components/CurrencyLogo'\nimport { ROUTER_ADDRESS } from '../../constants'\nimport { useActiveWeb3React } from '../../hooks'\nimport { useCurrency } from '../../hooks/Tokens'\nimport { usePairContract } from '../../hooks/useContract'\n\nimport { useTransactionAdder } from '../../state/transactions/hooks'\nimport { StyledInternalLink } from '../../components/Shared'\nimport { calculateGasMargin, calculateSlippageAmount, getRouterContract } from '../../utils'\nimport { currencyId } from '../../utils/currencyId'\nimport useDebouncedChangeHandler from '../../utils/useDebouncedChangeHandler'\nimport { wrappedCurrency } from '../../utils/wrappedCurrency'\nimport AppBody from '../AppBody'\nimport { ClickableText, Wrapper } from '../Pool/styleds'\nimport { useApproveCallback, ApprovalState } from '../../hooks/useApproveCallback'\nimport { Dots } from '../../components/swap/styleds'\nimport { useBurnActionHandlers, useDerivedBurnInfo, useBurnState } from '../../state/burn/hooks'\n\nimport { Field } from '../../state/burn/actions'\nimport { useUserDeadline, useUserSlippageTolerance } from '../../state/user/hooks'\n\nconst OutlineCard = styled.div`\n border: 1px solid ${({ theme }) => theme.colors.borderColor};\n border-radius: 16px;\n padding: 24px;\n`\n\nconst Body = styled.div`\n padding-left: 24px;\n padding-right: 24px;\n`\n\nexport default function RemoveLiquidity({\n history,\n match: {\n params: { currencyIdA, currencyIdB },\n },\n}: RouteComponentProps<{ currencyIdA: string; currencyIdB: string }>) {\n const [currencyA, currencyB] = [useCurrency(currencyIdA) ?? undefined, useCurrency(currencyIdB) ?? undefined]\n const { account, chainId, library } = useActiveWeb3React()\n const TranslateString = useI18n()\n const [tokenA, tokenB] = useMemo(() => [wrappedCurrency(currencyA, chainId), wrappedCurrency(currencyB, chainId)], [\n currencyA,\n currencyB,\n chainId,\n ])\n\n const theme = useContext(ThemeContext)\n\n // burn state\n const { independentField, typedValue } = useBurnState()\n const { pair, parsedAmounts, error } = useDerivedBurnInfo(currencyA ?? undefined, currencyB ?? undefined)\n const { onUserInput: _onUserInput } = useBurnActionHandlers()\n const isValid = !error\n\n // modal and loading\n const [showConfirm, setShowConfirm] = useState(false)\n const [showDetailed, setShowDetailed] = useState(false)\n const [attemptingTxn, setAttemptingTxn] = useState(false) // clicked confirm\n\n // txn values\n const [txHash, setTxHash] = useState('')\n const [deadline] = useUserDeadline()\n const [allowedSlippage] = useUserSlippageTolerance()\n\n const formattedAmounts = {\n [Field.LIQUIDITY_PERCENT]: parsedAmounts[Field.LIQUIDITY_PERCENT].equalTo('0')\n ? '0'\n : parsedAmounts[Field.LIQUIDITY_PERCENT].lessThan(new Percent('1', '100'))\n ? '<1'\n : parsedAmounts[Field.LIQUIDITY_PERCENT].toFixed(0),\n [Field.LIQUIDITY]:\n independentField === Field.LIQUIDITY ? typedValue : parsedAmounts[Field.LIQUIDITY]?.toSignificant(6) ?? '',\n [Field.CURRENCY_A]:\n independentField === Field.CURRENCY_A ? typedValue : parsedAmounts[Field.CURRENCY_A]?.toSignificant(6) ?? '',\n [Field.CURRENCY_B]:\n independentField === Field.CURRENCY_B ? typedValue : parsedAmounts[Field.CURRENCY_B]?.toSignificant(6) ?? '',\n }\n\n const atMaxAmount = parsedAmounts[Field.LIQUIDITY_PERCENT]?.equalTo(new Percent('1'))\n\n // pair contract\n const pairContract: Contract | null = usePairContract(pair?.liquidityToken?.address)\n\n // allowance handling\n const [signatureData, setSignatureData] = useState<{ v: number; r: string; s: string; deadline: number } | null>(null)\n const [approval, approveCallback] = useApproveCallback(parsedAmounts[Field.LIQUIDITY], ROUTER_ADDRESS)\n async function onAttemptToApprove() {\n if (!pairContract || !pair || !library) throw new Error('missing dependencies')\n const liquidityAmount = parsedAmounts[Field.LIQUIDITY]\n if (!liquidityAmount) throw new Error('missing liquidity amount')\n // try to gather a signature for permission\n const nonce = await pairContract.nonces(account)\n\n const deadlineForSignature: number = Math.ceil(Date.now() / 1000) + deadline\n\n const EIP712Domain = [\n { name: 'name', type: 'string' },\n { name: 'version', type: 'string' },\n { name: 'chainId', type: 'uint256' },\n { name: 'verifyingContract', type: 'address' },\n ]\n const domain = {\n name: 'Pancake LPs',\n version: '1',\n chainId,\n verifyingContract: pair.liquidityToken.address,\n }\n const Permit = [\n { name: 'owner', type: 'address' },\n { name: 'spender', type: 'address' },\n { name: 'value', type: 'uint256' },\n { name: 'nonce', type: 'uint256' },\n { name: 'deadline', type: 'uint256' },\n ]\n const message = {\n owner: account,\n spender: ROUTER_ADDRESS,\n value: liquidityAmount.raw.toString(),\n nonce: nonce.toHexString(),\n deadline: deadlineForSignature,\n }\n const data = JSON.stringify({\n types: {\n EIP712Domain,\n Permit,\n },\n domain,\n primaryType: 'Permit',\n message,\n })\n\n library\n .send('eth_signTypedData_v4', [account, data])\n .then(splitSignature)\n .then((signature) => {\n setSignatureData({\n v: signature.v,\n r: signature.r,\n s: signature.s,\n deadline: deadlineForSignature,\n })\n })\n .catch((e) => {\n // for all errors other than 4001 (EIP-1193 user rejected request), fall back to manual approve\n if (e?.code !== 4001) {\n approveCallback()\n }\n })\n }\n\n // wrapped onUserInput to clear signatures\n const onUserInput = useCallback(\n (field: Field, val: string) => {\n setSignatureData(null)\n return _onUserInput(field, val)\n },\n [_onUserInput]\n )\n\n const onLiquidityInput = useCallback((val: string): void => onUserInput(Field.LIQUIDITY, val), [onUserInput])\n const onCurrencyAInput = useCallback((val: string): void => onUserInput(Field.CURRENCY_A, val), [onUserInput])\n const onCurrencyBInput = useCallback((val: string): void => onUserInput(Field.CURRENCY_B, val), [onUserInput])\n\n // tx sending\n const addTransaction = useTransactionAdder()\n async function onRemove() {\n if (!chainId || !library || !account) throw new Error('missing dependencies')\n const { [Field.CURRENCY_A]: currencyAmountA, [Field.CURRENCY_B]: currencyAmountB } = parsedAmounts\n if (!currencyAmountA || !currencyAmountB) {\n throw new Error('missing currency amounts')\n }\n const router = getRouterContract(chainId, library, account)\n\n const amountsMin = {\n [Field.CURRENCY_A]: calculateSlippageAmount(currencyAmountA, allowedSlippage)[0],\n [Field.CURRENCY_B]: calculateSlippageAmount(currencyAmountB, allowedSlippage)[0],\n }\n\n if (!currencyA || !currencyB) throw new Error('missing tokens')\n const liquidityAmount = parsedAmounts[Field.LIQUIDITY]\n if (!liquidityAmount) throw new Error('missing liquidity amount')\n\n const currencyBIsETH = currencyB === ETHER\n const oneCurrencyIsETH = currencyA === ETHER || currencyBIsETH\n const deadlineFromNow = Math.ceil(Date.now() / 1000) + deadline\n\n if (!tokenA || !tokenB) throw new Error('could not wrap')\n\n let methodNames: string[]\n let args: Array\n // we have approval, use normal remove liquidity\n if (approval === ApprovalState.APPROVED) {\n // removeLiquidityETH\n if (oneCurrencyIsETH) {\n methodNames = ['removeLiquidityETH', 'removeLiquidityETHSupportingFeeOnTransferTokens']\n args = [\n currencyBIsETH ? tokenA.address : tokenB.address,\n liquidityAmount.raw.toString(),\n amountsMin[currencyBIsETH ? Field.CURRENCY_A : Field.CURRENCY_B].toString(),\n amountsMin[currencyBIsETH ? Field.CURRENCY_B : Field.CURRENCY_A].toString(),\n account,\n deadlineFromNow,\n ]\n }\n // removeLiquidity\n else {\n methodNames = ['removeLiquidity']\n args = [\n tokenA.address,\n tokenB.address,\n liquidityAmount.raw.toString(),\n amountsMin[Field.CURRENCY_A].toString(),\n amountsMin[Field.CURRENCY_B].toString(),\n account,\n deadlineFromNow,\n ]\n }\n }\n // we have a signataure, use permit versions of remove liquidity\n else if (signatureData !== null) {\n // removeLiquidityETHWithPermit\n if (oneCurrencyIsETH) {\n methodNames = ['removeLiquidityETHWithPermit', 'removeLiquidityETHWithPermitSupportingFeeOnTransferTokens']\n args = [\n currencyBIsETH ? tokenA.address : tokenB.address,\n liquidityAmount.raw.toString(),\n amountsMin[currencyBIsETH ? Field.CURRENCY_A : Field.CURRENCY_B].toString(),\n amountsMin[currencyBIsETH ? Field.CURRENCY_B : Field.CURRENCY_A].toString(),\n account,\n signatureData.deadline,\n false,\n signatureData.v,\n signatureData.r,\n signatureData.s,\n ]\n }\n // removeLiquidityETHWithPermit\n else {\n methodNames = ['removeLiquidityWithPermit']\n args = [\n tokenA.address,\n tokenB.address,\n liquidityAmount.raw.toString(),\n amountsMin[Field.CURRENCY_A].toString(),\n amountsMin[Field.CURRENCY_B].toString(),\n account,\n signatureData.deadline,\n false,\n signatureData.v,\n signatureData.r,\n signatureData.s,\n ]\n }\n } else {\n throw new Error('Attempting to confirm without approval or a signature. Please contact support.')\n }\n const safeGasEstimates: (BigNumber | undefined)[] = await Promise.all(\n methodNames.map((methodName, index) =>\n router.estimateGas[methodName](...args)\n .then(calculateGasMargin)\n .catch((e) => {\n console.error(`estimateGas failed`, index, methodName, args, e)\n return undefined\n })\n )\n )\n\n const indexOfSuccessfulEstimation = safeGasEstimates.findIndex((safeGasEstimate) =>\n BigNumber.isBigNumber(safeGasEstimate)\n )\n\n // all estimations failed...\n if (indexOfSuccessfulEstimation === -1) {\n console.error('This transaction would fail. Please contact support.')\n } else {\n const methodName = methodNames[indexOfSuccessfulEstimation]\n const safeGasEstimate = safeGasEstimates[indexOfSuccessfulEstimation]\n\n setAttemptingTxn(true)\n await router[methodName](...args, {\n gasLimit: safeGasEstimate,\n })\n .then((response: TransactionResponse) => {\n setAttemptingTxn(false)\n\n addTransaction(response, {\n summary: `Remove ${parsedAmounts[Field.CURRENCY_A]?.toSignificant(3)} ${\n currencyA?.symbol\n } and ${parsedAmounts[Field.CURRENCY_B]?.toSignificant(3)} ${currencyB?.symbol}`,\n })\n\n setTxHash(response.hash)\n })\n .catch((e: Error) => {\n setAttemptingTxn(false)\n // we only care if the error is something _other_ than the user rejected the tx\n console.error(e)\n })\n }\n }\n\n function modalHeader() {\n return (\n \n \n {parsedAmounts[Field.CURRENCY_A]?.toSignificant(6)}\n \n \n \n {currencyA?.symbol}\n \n \n \n \n \n \n \n {parsedAmounts[Field.CURRENCY_B]?.toSignificant(6)}\n \n \n \n {currencyB?.symbol}\n \n \n \n\n \n {`Output is estimated. If the price changes by more than ${\n allowedSlippage / 100\n }% your transaction will revert.`}\n \n \n )\n }\n\n function modalBottom() {\n return (\n <>\n \n {`LP ${currencyA?.symbol}/${currencyB?.symbol}`} Burned\n \n \n {parsedAmounts[Field.LIQUIDITY]?.toSignificant(6)}\n \n \n {pair && (\n <>\n \n {TranslateString(1182, 'Price')}\n \n 1 {currencyA?.symbol} = {tokenA ? pair.priceOf(tokenA).toSignificant(6) : '-'} {currencyB?.symbol}\n \n \n \n
\n \n 1 {currencyB?.symbol} = {tokenB ? pair.priceOf(tokenB).toSignificant(6) : '-'} {currencyA?.symbol}\n \n \n \n )}\n \n \n )\n }\n\n const pendingText = `Removing ${parsedAmounts[Field.CURRENCY_A]?.toSignificant(6)} ${\n currencyA?.symbol\n } and ${parsedAmounts[Field.CURRENCY_B]?.toSignificant(6)} ${currencyB?.symbol}`\n\n const liquidityPercentChangeCallback = useCallback(\n (value: number) => {\n onUserInput(Field.LIQUIDITY_PERCENT, value.toString())\n },\n [onUserInput]\n )\n\n const oneCurrencyIsETH = currencyA === ETHER || currencyB === ETHER\n const oneCurrencyIsWETH = Boolean(\n chainId &&\n ((currencyA && currencyEquals(WETH[chainId], currencyA)) ||\n (currencyB && currencyEquals(WETH[chainId], currencyB)))\n )\n\n const handleSelectCurrencyA = useCallback(\n (currency: Currency) => {\n if (currencyIdB && currencyId(currency) === currencyIdB) {\n history.push(`/remove/${currencyId(currency)}/${currencyIdA}`)\n } else {\n history.push(`/remove/${currencyId(currency)}/${currencyIdB}`)\n }\n },\n [currencyIdA, currencyIdB, history]\n )\n const handleSelectCurrencyB = useCallback(\n (currency: Currency) => {\n if (currencyIdA && currencyId(currency) === currencyIdA) {\n history.push(`/remove/${currencyIdB}/${currencyId(currency)}`)\n } else {\n history.push(`/remove/${currencyIdA}/${currencyId(currency)}`)\n }\n },\n [currencyIdA, currencyIdB, history]\n )\n\n const handleDismissConfirmation = useCallback(() => {\n setShowConfirm(false)\n setSignatureData(null) // important that we clear signature data to avoid bad sigs\n // if there was a tx hash, we want to clear the input\n if (txHash) {\n onUserInput(Field.LIQUIDITY_PERCENT, '0')\n }\n setTxHash('')\n }, [onUserInput, txHash])\n\n const [innerLiquidityPercentage, setInnerLiquidityPercentage] = useDebouncedChangeHandler(\n Number.parseInt(parsedAmounts[Field.LIQUIDITY_PERCENT].toFixed(0)),\n liquidityPercentChangeCallback\n )\n\n return (\n <>\n \n \n \n (\n \n )}\n pendingText={pendingText}\n />\n \n \n \n \n \n Amount\n {\n setShowDetailed(!showDetailed)\n }}\n >\n {showDetailed ? TranslateString(1184, 'Simple') : TranslateString(1186, 'Detailed')}\n \n \n \n {formattedAmounts[Field.LIQUIDITY_PERCENT]}%\n \n {!showDetailed && (\n <>\n \n \n \n \n onUserInput(Field.LIQUIDITY_PERCENT, '25')}\n >\n 25%\n \n onUserInput(Field.LIQUIDITY_PERCENT, '50')}\n >\n 50%\n \n onUserInput(Field.LIQUIDITY_PERCENT, '75')}\n >\n 75%\n \n onUserInput(Field.LIQUIDITY_PERCENT, '100')}\n >\n {TranslateString(166, 'Max')}\n \n \n \n )}\n \n \n \n {!showDetailed && (\n <>\n \n \n \n \n \n \n \n {formattedAmounts[Field.CURRENCY_A] || '-'}\n \n \n \n {currencyA?.symbol}\n \n \n \n \n {formattedAmounts[Field.CURRENCY_B] || '-'}\n \n \n \n {currencyB?.symbol}\n \n \n \n {chainId && (oneCurrencyIsWETH || oneCurrencyIsETH) ? (\n \n {oneCurrencyIsETH ? (\n \n {TranslateString(1188, 'Receive WBNB')}\n \n ) : oneCurrencyIsWETH ? (\n \n {TranslateString(1190, 'Receive BNB')}\n \n ) : null}\n \n ) : null}\n \n \n \n \n )}\n \n {showDetailed && (\n <>\n {\n onUserInput(Field.LIQUIDITY_PERCENT, '100')\n }}\n showMaxButton={!atMaxAmount}\n disableCurrencySelect\n currency={pair?.liquidityToken}\n pair={pair}\n id=\"liquidity-amount\"\n />\n \n \n \n onUserInput(Field.LIQUIDITY_PERCENT, '100')}\n showMaxButton={!atMaxAmount}\n currency={currencyA}\n label=\"Output\"\n onCurrencySelect={handleSelectCurrencyA}\n id=\"remove-liquidity-tokena\"\n />\n \n \n \n onUserInput(Field.LIQUIDITY_PERCENT, '100')}\n showMaxButton={!atMaxAmount}\n currency={currencyB}\n label=\"Output\"\n onCurrencySelect={handleSelectCurrencyB}\n id=\"remove-liquidity-tokenb\"\n />\n \n )}\n {pair && (\n
\n \n Price:\n
\n 1 {currencyA?.symbol} = {tokenA ? pair.priceOf(tokenA).toSignificant(6) : '-'} {currencyB?.symbol}\n
\n
\n \n
\n
\n 1 {currencyB?.symbol} = {tokenB ? pair.priceOf(tokenB).toSignificant(6) : '-'} {currencyA?.symbol}\n
\n \n
\n )}\n
\n {!account ? (\n \n ) : (\n \n \n {approval === ApprovalState.PENDING ? (\n Approving\n ) : approval === ApprovalState.APPROVED || signatureData !== null ? (\n 'Approved'\n ) : (\n 'Approve'\n )}\n \n {\n setShowConfirm(true)\n }}\n disabled={!isValid || (signatureData === null && approval !== ApprovalState.APPROVED)}\n variant={\n !isValid && !!parsedAmounts[Field.CURRENCY_A] && !!parsedAmounts[Field.CURRENCY_B]\n ? 'danger'\n : 'primary'\n }\n >\n {error || 'Remove'}\n \n \n )}\n
\n \n \n \n \n\n {pair ? (\n \n \n \n ) : null}\n \n )\n}\n","import { useCallback, useEffect, useRef, useState } from 'react'\n\n/**\n * Easy way to debounce the handling of a rapidly changing value, e.g. a changing slider input\n * @param value value that is rapidly changing\n * @param onChange change handler that should receive the debounced updates to the value\n * @param debouncedMs how long we should wait for changes to be applied\n */\nexport default function useDebouncedChangeHandler(\n value: T,\n onChange: (newValue: T) => void,\n debouncedMs = 100\n): [T, (value: T) => void] {\n const [inner, setInner] = useState(() => value)\n const timer = useRef>()\n\n const onChangeInner = useCallback(\n (newValue: T) => {\n setInner(newValue)\n if (timer.current) {\n clearTimeout(timer.current)\n }\n timer.current = setTimeout(() => {\n onChange(newValue)\n timer.current = undefined\n }, debouncedMs)\n },\n [debouncedMs, onChange]\n )\n\n useEffect(() => {\n if (timer.current) {\n clearTimeout(timer.current)\n timer.current = undefined\n }\n setInner(value)\n }, [value])\n\n return [inner, onChangeInner]\n}\n","import React, { useCallback } from 'react'\nimport styled from 'styled-components'\nimport { Text } from '@pancakeswap-libs/uikit'\nimport useI18n from 'hooks/useI18n'\nimport useENS from '../../hooks/useENS'\nimport { useActiveWeb3React } from '../../hooks'\nimport { ExternalLink } from '../Shared'\nimport { AutoColumn } from '../Column'\nimport { RowBetween } from '../Row'\nimport { getBscScanLink } from '../../utils'\n\nconst InputPanel = styled.div`\n display: flex;\n flex-flow: column nowrap;\n position: relative;\n border-radius: 1.25rem;\n background-color: ${({ theme }) => theme.colors.invertedContrast};\n z-index: 1;\n width: 100%;\n`\n\nconst ContainerRow = styled.div<{ error: boolean }>`\n display: flex;\n justify-content: center;\n align-items: center;\n border-radius: 1.25rem;\n border: 1px solid ${({ error, theme }) => (error ? theme.colors.failure : theme.colors.invertedContrast)};\n transition: border-color 300ms ${({ error }) => (error ? 'step-end' : 'step-start')},\n color 500ms ${({ error }) => (error ? 'step-end' : 'step-start')};\n background-color: ${({ theme }) => theme.colors.invertedContrast};\n`\n\nconst InputContainer = styled.div`\n flex: 1;\n padding: 1rem;\n`\n\nconst Input = styled.input<{ error?: boolean }>`\n font-size: 1.25rem;\n outline: none;\n border: none;\n flex: 1 1 auto;\n width: 0;\n background-color: ${({ theme }) => theme.colors.invertedContrast};\n transition: color 300ms ${({ error }) => (error ? 'step-end' : 'step-start')};\n color: ${({ error, theme }) => (error ? theme.colors.failure : theme.colors.primary)};\n overflow: hidden;\n text-overflow: ellipsis;\n font-weight: 500;\n width: 100%;\n ::placeholder {\n color: ${({ theme }) => theme.colors.textDisabled};\n }\n padding: 0px;\n -webkit-appearance: textfield;\n\n ::-webkit-search-decoration {\n -webkit-appearance: none;\n }\n\n ::-webkit-outer-spin-button,\n ::-webkit-inner-spin-button {\n -webkit-appearance: none;\n }\n\n ::placeholder {\n color: ${({ theme }) => theme.colors.textDisabled};\n }\n`\n\nexport default function AddressInputPanel({\n id,\n value,\n onChange,\n}: {\n id?: string\n // the typed string value\n value: string\n // triggers whenever the typed value changes\n onChange: (value: string) => void\n}) {\n const { chainId } = useActiveWeb3React()\n const TranslateString = useI18n()\n const { address, loading, name } = useENS(value)\n\n const handleInput = useCallback(\n (event) => {\n const input = event.target.value\n const withoutSpaces = input.replace(/\\s+/g, '')\n onChange(withoutSpaces)\n },\n [onChange]\n )\n\n const error = Boolean(value.length > 0 && !loading && !address)\n\n return (\n \n \n \n \n \n \n {TranslateString(1138, 'Recipient')}\n \n {address && chainId && (\n \n {TranslateString(116, '(View on BscScan)')}\n \n )}\n \n \n \n \n \n \n )\n}\n","import { Percent } from '@pancakeswap-libs/sdk'\nimport React from 'react'\nimport { ONE_BIPS } from '../../constants'\nimport { warningSeverity } from '../../utils/prices'\nimport { ErrorText } from './styleds'\n\n/**\n * Formatted version of price impact text with warning colors\n */\nexport default function FormattedPriceImpact({ priceImpact }: { priceImpact?: Percent }) {\n return (\n \n {priceImpact ? (priceImpact.lessThan(ONE_BIPS) ? '<0.01%' : `${priceImpact.toFixed(2)}%`) : '-'}\n \n )\n}\n","import { Trade, TradeType } from '@pancakeswap-libs/sdk'\nimport React, { useMemo, useState } from 'react'\nimport { Text, Button } from '@pancakeswap-libs/uikit'\nimport { Repeat } from 'react-feather'\n\nimport useI18n from 'hooks/useI18n'\nimport { Field } from '../../state/swap/actions'\nimport {\n computeSlippageAdjustedAmounts,\n computeTradePriceBreakdown,\n formatExecutionPrice,\n warningSeverity,\n} from '../../utils/prices'\nimport { AutoColumn } from '../Column'\nimport QuestionHelper from '../QuestionHelper'\nimport { AutoRow, RowBetween, RowFixed } from '../Row'\nimport FormattedPriceImpact from './FormattedPriceImpact'\nimport { StyledBalanceMaxMini, SwapCallbackError } from './styleds'\n\nexport default function SwapModalFooter({\n trade,\n onConfirm,\n allowedSlippage,\n swapErrorMessage,\n disabledConfirm,\n}: {\n trade: Trade\n allowedSlippage: number\n onConfirm: () => void\n swapErrorMessage: string | undefined\n disabledConfirm: boolean\n}) {\n const [showInverted, setShowInverted] = useState(false)\n const slippageAdjustedAmounts = useMemo(() => computeSlippageAdjustedAmounts(trade, allowedSlippage), [\n allowedSlippage,\n trade,\n ])\n const { priceImpactWithoutFee, realizedLPFee } = useMemo(() => computeTradePriceBreakdown(trade), [trade])\n const severity = warningSeverity(priceImpactWithoutFee)\n const TranslateString = useI18n()\n\n return (\n <>\n \n \n Price\n \n {formatExecutionPrice(trade, showInverted)}\n setShowInverted(!showInverted)}>\n \n \n \n \n\n \n \n \n {trade.tradeType === TradeType.EXACT_INPUT\n ? TranslateString(1210, 'Minimum received')\n : TranslateString(220, 'Maximum sold')}\n \n \n \n \n \n {trade.tradeType === TradeType.EXACT_INPUT\n ? slippageAdjustedAmounts[Field.OUTPUT]?.toSignificant(4) ?? '-'\n : slippageAdjustedAmounts[Field.INPUT]?.toSignificant(4) ?? '-'}\n \n \n {trade.tradeType === TradeType.EXACT_INPUT\n ? trade.outputAmount.currency.symbol\n : trade.inputAmount.currency.symbol}\n \n \n \n \n \n {TranslateString(226, 'Price Impact')}\n \n \n \n \n \n \n {TranslateString(228, 'Liquidity Provider Fee')}\n \n \n \n {realizedLPFee ? `${realizedLPFee?.toSignificant(6)} ${trade.inputAmount.currency.symbol}` : '-'}\n \n \n \n\n \n 2 ? 'danger' : 'primary'}\n mt=\"10px\"\n id=\"confirm-swap-or-send\"\n width=\"100%\"\n >\n {severity > 2 ? 'Swap Anyway' : 'Confirm Swap'}\n \n\n {swapErrorMessage ? : null}\n \n \n )\n}\n","import React, { useContext, useMemo } from 'react'\nimport styled, { ThemeContext } from 'styled-components'\nimport { Trade, TradeType } from '@pancakeswap-libs/sdk'\nimport { Button, Text } from '@pancakeswap-libs/uikit'\nimport { ArrowDown, AlertTriangle } from 'react-feather'\nimport { Field } from '../../state/swap/actions'\nimport { isAddress, shortenAddress } from '../../utils'\nimport { computeSlippageAdjustedAmounts, computeTradePriceBreakdown, warningSeverity } from '../../utils/prices'\nimport { AutoColumn } from '../Column'\nimport CurrencyLogo from '../CurrencyLogo'\nimport { RowBetween, RowFixed } from '../Row'\nimport { SwapShowAcceptChanges } from './styleds'\n\nconst PriceInfoText = styled(Text)`\n font-style: italic;\n line-height: 1.3;\n\n span {\n color: ${({ theme }) => theme.colors.primary};\n font-weight: 600;\n }\n`\n\nexport default function SwapModalHeader({\n trade,\n allowedSlippage,\n recipient,\n showAcceptChanges,\n onAcceptChanges,\n}: {\n trade: Trade\n allowedSlippage: number\n recipient: string | null\n showAcceptChanges: boolean\n onAcceptChanges: () => void\n}) {\n const slippageAdjustedAmounts = useMemo(() => computeSlippageAdjustedAmounts(trade, allowedSlippage), [\n trade,\n allowedSlippage,\n ])\n const { priceImpactWithoutFee } = useMemo(() => computeTradePriceBreakdown(trade), [trade])\n const priceImpactSeverity = warningSeverity(priceImpactWithoutFee)\n\n const theme = useContext(ThemeContext)\n\n return (\n \n \n \n \n \n {trade.inputAmount.toSignificant(6)}\n \n \n \n \n {trade.inputAmount.currency.symbol}\n \n \n \n \n \n \n \n \n \n 2\n ? theme.colors.failure\n : showAcceptChanges && trade.tradeType === TradeType.EXACT_INPUT\n ? theme.colors.primary\n : 'text'\n }\n >\n {trade.outputAmount.toSignificant(6)}\n \n \n \n \n {trade.outputAmount.currency.symbol}\n \n \n \n {showAcceptChanges ? (\n \n \n \n \n Price Updated\n \n \n \n \n ) : null}\n \n {trade.tradeType === TradeType.EXACT_INPUT ? (\n \n {`Output is estimated. You will receive at least `}\n \n {slippageAdjustedAmounts[Field.OUTPUT]?.toSignificant(6)} {trade.outputAmount.currency.symbol}\n \n {' or the transaction will revert.'}\n \n ) : (\n \n {`Input is estimated. You will sell at most `}\n \n {slippageAdjustedAmounts[Field.INPUT]?.toSignificant(6)} {trade.inputAmount.currency.symbol}\n \n {' or the transaction will revert.'}\n \n )}\n \n {recipient !== null ? (\n \n \n Output will be sent to{' '}\n {isAddress(recipient) ? shortenAddress(recipient) : recipient}\n \n \n ) : null}\n \n )\n}\n","import { currencyEquals, Trade } from '@pancakeswap-libs/sdk'\nimport React, { useCallback, useMemo } from 'react'\nimport TransactionConfirmationModal, {\n ConfirmationModalContent,\n TransactionErrorContent\n} from '../TransactionConfirmationModal'\nimport SwapModalFooter from './SwapModalFooter'\nimport SwapModalHeader from './SwapModalHeader'\n\n/**\n * Returns true if the trade requires a confirmation of details before we can submit it\n * @param tradeA trade A\n * @param tradeB trade B\n */\nfunction tradeMeaningfullyDiffers(tradeA: Trade, tradeB: Trade): boolean {\n return (\n tradeA.tradeType !== tradeB.tradeType ||\n !currencyEquals(tradeA.inputAmount.currency, tradeB.inputAmount.currency) ||\n !tradeA.inputAmount.equalTo(tradeB.inputAmount) ||\n !currencyEquals(tradeA.outputAmount.currency, tradeB.outputAmount.currency) ||\n !tradeA.outputAmount.equalTo(tradeB.outputAmount)\n )\n}\n\nexport default function ConfirmSwapModal({\n trade,\n originalTrade,\n onAcceptChanges,\n allowedSlippage,\n onConfirm,\n onDismiss,\n recipient,\n swapErrorMessage,\n isOpen,\n attemptingTxn,\n txHash\n}: {\n isOpen: boolean\n trade: Trade | undefined\n originalTrade: Trade | undefined\n attemptingTxn: boolean\n txHash: string | undefined\n recipient: string | null\n allowedSlippage: number\n onAcceptChanges: () => void\n onConfirm: () => void\n swapErrorMessage: string | undefined\n onDismiss: () => void\n}) {\n const showAcceptChanges = useMemo(\n () => Boolean(trade && originalTrade && tradeMeaningfullyDiffers(trade, originalTrade)),\n [originalTrade, trade]\n )\n\n const modalHeader = useCallback(() => {\n return trade ? (\n \n ) : null\n }, [allowedSlippage, onAcceptChanges, recipient, showAcceptChanges, trade])\n\n const modalBottom = useCallback(() => {\n return trade ? (\n \n ) : null\n }, [allowedSlippage, onConfirm, showAcceptChanges, swapErrorMessage, trade])\n\n // text to show while loading\n const pendingText = `Swapping ${trade?.inputAmount?.toSignificant(6)} ${\n trade?.inputAmount?.currency?.symbol\n } for ${trade?.outputAmount?.toSignificant(6)} ${trade?.outputAmount?.currency?.symbol}`\n\n const confirmationContent = useCallback(\n () =>\n swapErrorMessage ? (\n \n ) : (\n \n ),\n [onDismiss, modalBottom, modalHeader, swapErrorMessage]\n )\n\n return (\n \n )\n}\n","import { Trade } from '@pancakeswap-libs/sdk'\nimport React, { Fragment, memo, useContext } from 'react'\nimport { ChevronRight } from 'react-feather'\nimport { Flex, Text } from '@pancakeswap-libs/uikit'\nimport { ThemeContext } from 'styled-components'\nimport CurrencyLogo from '../CurrencyLogo'\n\nexport default memo(function SwapRoute({ trade }: { trade: Trade }) {\n const theme = useContext(ThemeContext)\n return (\n \n {trade.route.path.map((token, i, path) => {\n const isLastItem: boolean = i === path.length - 1\n return (\n // eslint-disable-next-line react/no-array-index-key\n \n \n \n \n {token.symbol}\n \n \n {isLastItem ? null : }\n \n )\n })}\n
\n )\n})\n","import React from 'react'\nimport { Trade, TradeType } from '@pancakeswap-libs/sdk'\nimport { Card, CardBody, Text } from '@pancakeswap-libs/uikit'\nimport useI18n from 'hooks/useI18n'\nimport { Field } from '../../state/swap/actions'\nimport { useUserSlippageTolerance } from '../../state/user/hooks'\nimport { computeSlippageAdjustedAmounts, computeTradePriceBreakdown } from '../../utils/prices'\nimport { AutoColumn } from '../Column'\nimport QuestionHelper from '../QuestionHelper'\nimport { RowBetween, RowFixed } from '../Row'\nimport FormattedPriceImpact from './FormattedPriceImpact'\nimport { SectionBreak } from './styleds'\nimport SwapRoute from './SwapRoute'\n\nfunction TradeSummary({ trade, allowedSlippage }: { trade: Trade; allowedSlippage: number }) {\n const { priceImpactWithoutFee, realizedLPFee } = computeTradePriceBreakdown(trade)\n const isExactIn = trade.tradeType === TradeType.EXACT_INPUT\n const slippageAdjustedAmounts = computeSlippageAdjustedAmounts(trade, allowedSlippage)\n const TranslateString = useI18n()\n\n return (\n \n \n \n \n \n {isExactIn ? TranslateString(1210, 'Minimum received') : TranslateString(220, 'Maximum sold')}\n \n \n \n \n \n {isExactIn\n ? `${slippageAdjustedAmounts[Field.OUTPUT]?.toSignificant(4)} ${trade.outputAmount.currency.symbol}` ??\n '-'\n : `${slippageAdjustedAmounts[Field.INPUT]?.toSignificant(4)} ${trade.inputAmount.currency.symbol}` ??\n '-'}\n \n \n \n \n \n {TranslateString(226, 'Price Impact')}\n \n \n \n \n\n \n \n {TranslateString(228, 'Liquidity Provider Fee')}\n \n \n \n {realizedLPFee ? `${realizedLPFee.toSignificant(4)} ${trade.inputAmount.currency.symbol}` : '-'}\n \n \n \n \n )\n}\n\nexport interface AdvancedSwapDetailsProps {\n trade?: Trade\n}\n\nexport function AdvancedSwapDetails({ trade }: AdvancedSwapDetailsProps) {\n const [allowedSlippage] = useUserSlippageTolerance()\n const TranslateString = useI18n()\n const showRoute = Boolean(trade && trade.route.path.length > 2)\n\n return (\n \n {trade && (\n <>\n \n {showRoute && (\n <>\n \n \n \n Route\n \n \n \n \n \n )}\n \n )}\n \n )\n}\n","import React from 'react'\nimport styled from 'styled-components'\nimport { useLastTruthy } from '../../hooks/useLast'\nimport { AdvancedSwapDetails, AdvancedSwapDetailsProps } from './AdvancedSwapDetails'\n\nconst AdvancedDetailsFooter = styled.div<{ show: boolean }>`\n padding-top: calc(16px + 2rem);\n padding-bottom: 20px;\n margin-top: -2rem;\n width: 100%;\n max-width: 400px;\n border-bottom-left-radius: 20px;\n border-bottom-right-radius: 20px;\n color: ${({ theme }) => theme.colors.textSubtle};\n z-index: 1;\n\n transform: ${({ show }) => (show ? 'translateY(0%)' : 'translateY(-100%)')};\n transition: transform 300ms ease-in-out;\n`\n\nexport default function AdvancedSwapDetailsDropdown({ trade, ...rest }: AdvancedSwapDetailsProps) {\n const lastTrade = useLastTruthy(trade)\n\n return (\n \n \n \n )\n}\n","import React from 'react'\nimport { Price } from '@pancakeswap-libs/sdk'\nimport { SyncAltIcon, Text } from '@pancakeswap-libs/uikit'\nimport { StyledBalanceMaxMini } from './styleds'\n\ninterface TradePriceProps {\n price?: Price\n showInverted: boolean\n setShowInverted: (showInverted: boolean) => void\n}\n\nexport default function TradePrice({ price, showInverted, setShowInverted }: TradePriceProps) {\n const formattedPrice = showInverted ? price?.toSignificant(6) : price?.invert()?.toSignificant(6)\n\n const show = Boolean(price?.baseCurrency && price?.quoteCurrency)\n const label = showInverted\n ? `${price?.quoteCurrency?.symbol} per ${price?.baseCurrency?.symbol}`\n : `${price?.baseCurrency?.symbol} per ${price?.quoteCurrency?.symbol}`\n\n return (\n \n {show ? (\n <>\n {formattedPrice ?? '-'} {label}\n setShowInverted(!showInverted)}>\n \n \n \n ) : (\n '-'\n )}\n \n )\n}\n","import { Token } from '@pancakeswap-libs/sdk'\nimport { transparentize } from 'polished'\nimport { Button, Text } from '@pancakeswap-libs/uikit'\nimport React, { useCallback, useMemo, useState } from 'react'\nimport styled from 'styled-components'\nimport { AlertTriangle } from 'react-feather'\nimport useI18n from 'hooks/useI18n'\nimport { useActiveWeb3React } from '../../hooks'\nimport { useAllTokens } from '../../hooks/Tokens'\nimport { getBscScanLink, shortenAddress } from '../../utils'\nimport { ExternalLink } from '../Shared'\nimport CurrencyLogo from '../CurrencyLogo'\nimport Modal from '../Modal'\nimport { AutoRow, RowBetween } from '../Row'\nimport { AutoColumn } from '../Column'\n\nconst Wrapper = styled.div<{ error: boolean }>`\n background: ${({ theme }) => transparentize(0.6, theme.colors.tertiary)};\n padding: 0.75rem;\n border-radius: 20px;\n`\n\nconst WarningContainer = styled.div`\n max-width: 420px;\n width: 100%;\n padding: 1rem;\n background: rgba(242, 150, 2, 0.05);\n border: 1px solid #f3841e;\n border-radius: 20px;\n overflow: auto;\n`\n\nconst StyledWarningIcon = styled(AlertTriangle)`\n stroke: ${({ theme }) => theme.colors.failure};\n`\n\ninterface TokenWarningCardProps {\n token?: Token\n}\n\nfunction TokenWarningCard({ token }: TokenWarningCardProps) {\n const { chainId } = useActiveWeb3React()\n const TranslateString = useI18n()\n const tokenSymbol = token?.symbol?.toLowerCase() ?? ''\n const tokenName = token?.name?.toLowerCase() ?? ''\n\n const allTokens = useAllTokens()\n\n const duplicateNameOrSymbol = useMemo(() => {\n if (!token || !chainId) return false\n\n return Object.keys(allTokens).some((tokenAddress) => {\n const userToken = allTokens[tokenAddress]\n if (userToken.equals(token)) {\n return false\n }\n return userToken.symbol?.toLowerCase() === tokenSymbol || userToken.name?.toLowerCase() === tokenName\n })\n }, [token, chainId, allTokens, tokenSymbol, tokenName])\n\n if (!token) return null\n\n return (\n \n \n \n \n
\n
\n \n \n {token && token.name && token.symbol && token.name !== token.symbol\n ? `${token.name} (${token.symbol})`\n : token.name || token.symbol}{' '}\n \n {chainId && (\n \n \n {shortenAddress(token.address)} {TranslateString(116, '(View on BscScan)')}\n \n \n )}\n \n
\n
\n )\n}\n\nexport default function TokenWarningModal({\n isOpen,\n tokens,\n onConfirm,\n}: {\n isOpen: boolean\n tokens: Token[]\n onConfirm: () => void\n}) {\n const [understandChecked, setUnderstandChecked] = useState(false)\n const toggleUnderstand = useCallback(() => setUnderstandChecked((uc) => !uc), [])\n const TranslateString = useI18n()\n\n const handleDismiss = useCallback(() => null, [])\n return (\n \n \n \n \n \n {TranslateString(1128, 'Token imported')}\n \n \n {TranslateString(\n 1130,\n 'Anyone can create a BEP20 token on BSC with any name, including creating fake versions of existing tokens and tokens that claim to represent projects that do not have a token.'\n )}\n \n \n {TranslateString(\n 1132,\n 'This interface can load arbitrary tokens by token addresses. Please take extra caution and do your research when interacting with arbitrary BEP20 tokens.'\n )}\n \n {TranslateString(1134, 'If you purchase an arbitrary token, you may be unable to sell it back.')}\n {tokens.map((token) => {\n return \n })}\n \n
\n \n
\n {\n onConfirm()\n }}\n >\n {TranslateString(150, 'Continue')}\n \n
\n
\n
\n
\n )\n}\n","import React, { useCallback, useState } from 'react'\nimport styled from 'styled-components'\nimport { Button, Text } from '@pancakeswap-libs/uikit'\nimport { AlertTriangle } from 'react-feather'\nimport Modal from '../Modal'\nimport { AutoRow, RowBetween } from '../Row'\nimport { AutoColumn } from '../Column'\n\nconst WarningContainer = styled.div`\n max-width: 420px;\n width: 100%;\n padding: 1rem;\n background: rgba(242, 150, 2, 0.05);\n border: 1px solid #f3841e;\n border-radius: 20px;\n overflow: auto;\n`\n\nconst StyledWarningIcon = styled(AlertTriangle)`\n stroke: ${({ theme }) => theme.colors.failure};\n`\n\nexport default function SyrupWarningModal({\n isOpen,\n transactionType,\n onConfirm,\n}: {\n isOpen: boolean\n transactionType: string | null\n onConfirm: () => void\n}) {\n const [understandChecked, setUnderstandChecked] = useState(false)\n const toggleUnderstand = useCallback(() => setUnderstandChecked((uc) => !uc), [])\n\n const handleDismiss = useCallback(() => null, [])\n return (\n \n \n \n \n \n Syrup Warning\n \n {transactionType !== '' && (\n <>\n \n Please be careful when {transactionType} SYRUP.\n \n \n {transactionType === 'Buying'\n ? 'You will not receive CAKE rewards for holding purchased SYRUP.'\n : 'You will need to buy back the same amount of SYRUP to be able to convert back to CAKE.'}\n \n \n )}\n \n
\n \n
\n {\n setUnderstandChecked(false)\n onConfirm()\n }}\n >\n Continue\n \n
\n
\n
\n
\n )\n}\n","import React, { useCallback, useState } from 'react'\nimport styled from 'styled-components'\nimport { Button, Text } from '@pancakeswap-libs/uikit'\nimport { AlertTriangle } from 'react-feather'\nimport Modal from '../Modal'\nimport { AutoRow, RowBetween } from '../Row'\nimport { AutoColumn } from '../Column'\n\nconst WarningContainer = styled.div`\n max-width: 420px;\n width: 100%;\n padding: 1rem;\n background: rgba(242, 150, 2, 0.05);\n border: 1px solid #f3841e;\n border-radius: 20px;\n overflow: auto;\n`\n\nconst StyledWarningIcon = styled(AlertTriangle)`\n stroke: ${({ theme }) => theme.colors.binance};\n`\n\nexport default function SafeMoonWarningModal({ isOpen, onConfirm }: { isOpen: boolean; onConfirm: () => void }) {\n const [understandChecked, setUnderstandChecked] = useState(false)\n const toggleUnderstand = useCallback(() => setUnderstandChecked((uc) => !uc), [])\n\n const handleDismiss = useCallback(() => null, [])\n return (\n \n \n \n \n \n Notice for trading SafeMoon\n \n <>\n \n To trade SAFEMOON, you must click on the settings icon and{' '}\n set your slippage tolerance to 12%+\n \n This is because SafeMoon taxes a 10% fee on each transaction.\n • 5% fee = redistributed to all existing holders\n • 5% fee = used to add liquidity\n \n \n
\n \n
\n {\n setUnderstandChecked(false)\n onConfirm()\n }}\n >\n Continue\n \n
\n
\n
\n
\n )\n}\n","import React from 'react'\nimport styled from 'styled-components'\nimport { transparentize } from 'polished'\nimport { RowBetween } from '../Row'\nimport { AutoColumn } from '../Column'\n\nconst Wrapper = styled(AutoColumn)`\n margin-top: 1.25rem;\n`\n\nconst Grouping = styled(RowBetween)`\n width: 50%;\n`\n\nconst Circle = styled.div<{ confirmed?: boolean; disabled?: boolean }>`\n min-width: 20px;\n min-height: 20px;\n background-color: ${({ theme, confirmed, disabled }) =>\n disabled ? theme.colors.backgroundDisabled : confirmed ? theme.colors.success : theme.colors.primary};\n border-radius: 50%;\n display: flex;\n align-items: center;\n justify-content: center;\n line-height: 8px;\n font-size: 12px;\n color: ${({ theme, confirmed, disabled }) =>\n disabled ? theme.colors.text : confirmed ? theme.colors.success : '#FFFFFF'};\n`\n\nconst CircleRow = styled.div`\n width: calc(100% - 20px);\n display: flex;\n align-items: center;\n`\n\nconst Connector = styled.div<{ prevConfirmed?: boolean }>`\n width: 100%;\n height: 2px;\n background-color: ;\n background: linear-gradient(\n 90deg,\n ${({ theme, prevConfirmed }) => transparentize(0.5, prevConfirmed ? theme.colors.success : theme.colors.primary)} 0%,\n ${({ theme, prevConfirmed }) => (prevConfirmed ? theme.colors.primary : theme.colors.backgroundDisabled)} 80%\n );\n opacity: 0.6;\n`\n\ninterface ProgressCirclesProps {\n steps: boolean[]\n}\n\n/**\n * Based on array of steps, create a step counter of circles.\n * A circle can be enabled, disabled, or confirmed. States are derived\n * from previous step.\n *\n * An extra circle is added to represent the ability to swap, add, or remove.\n * This step will never be marked as complete (because no 'txn done' state in body ui).\n *\n * @param steps array of booleans where true means step is complete\n */\nexport default function ProgressCircles({ steps }: ProgressCirclesProps) {\n return (\n \n \n {steps.map((step, i) => {\n return (\n // eslint-disable-next-line react/no-array-index-key\n \n \n {step ? '✓' : i + 1}\n \n \n \n )\n })}\n {steps.length + 1}\n \n \n )\n}\n","import { BigNumber } from '@ethersproject/bignumber'\nimport { Contract } from '@ethersproject/contracts'\nimport { JSBI, Percent, Router, SwapParameters, Trade, TradeType } from '@pancakeswap-libs/sdk'\nimport { useMemo } from 'react'\nimport { BIPS_BASE, DEFAULT_DEADLINE_FROM_NOW, INITIAL_ALLOWED_SLIPPAGE } from '../constants'\nimport { useTransactionAdder } from '../state/transactions/hooks'\nimport { calculateGasMargin, getRouterContract, isAddress, shortenAddress } from '../utils'\nimport isZero from '../utils/isZero'\nimport { useActiveWeb3React } from './index'\nimport useENS from './useENS'\n\n enum SwapCallbackState {\n INVALID,\n LOADING,\n VALID,\n}\n\ninterface SwapCall {\n contract: Contract\n parameters: SwapParameters\n}\n\ninterface SuccessfulCall {\n call: SwapCall\n gasEstimate: BigNumber\n}\n\ninterface FailedCall {\n call: SwapCall\n error: Error\n}\n\ntype EstimatedSwapCall = SuccessfulCall | FailedCall\n\n/**\n * Returns the swap calls that can be used to make the trade\n * @param trade trade to execute\n * @param allowedSlippage user allowed slippage\n * @param deadline the deadline for the trade\n * @param recipientAddressOrName\n */\nfunction useSwapCallArguments(\n trade: Trade | undefined, // trade to execute, required\n allowedSlippage: number = INITIAL_ALLOWED_SLIPPAGE, // in bips\n deadline: number = DEFAULT_DEADLINE_FROM_NOW, // in seconds from now\n recipientAddressOrName: string | null // the ENS name or address of the recipient of the trade, or null if swap should be returned to sender\n): SwapCall[] {\n const { account, chainId, library } = useActiveWeb3React()\n\n const { address: recipientAddress } = useENS(recipientAddressOrName)\n const recipient = recipientAddressOrName === null ? account : recipientAddress\n\n return useMemo(() => {\n if (!trade || !recipient || !library || !account || !chainId) return []\n\n const contract: Contract | null = getRouterContract(chainId, library, account)\n if (!contract) {\n return []\n }\n\n const swapMethods = []\n\n swapMethods.push(\n // @ts-ignore\n Router.swapCallParameters(trade, {\n feeOnTransfer: false,\n allowedSlippage: new Percent(JSBI.BigInt(Math.floor(allowedSlippage)), BIPS_BASE),\n recipient,\n ttl: deadline,\n })\n )\n\n if (trade.tradeType === TradeType.EXACT_INPUT) {\n swapMethods.push(\n // @ts-ignore\n Router.swapCallParameters(trade, {\n feeOnTransfer: true,\n allowedSlippage: new Percent(JSBI.BigInt(Math.floor(allowedSlippage)), BIPS_BASE),\n recipient,\n ttl: deadline,\n })\n )\n }\n\n return swapMethods.map((parameters) => ({ parameters, contract }))\n }, [account, allowedSlippage, chainId, deadline, library, recipient, trade])\n}\n\n// returns a function that will execute a swap, if the parameters are all valid\n// and the user has approved the slippage adjusted input amount for the trade\nexport function useSwapCallback(\n trade: Trade | undefined, // trade to execute, required\n allowedSlippage: number = INITIAL_ALLOWED_SLIPPAGE, // in bips\n deadline: number = DEFAULT_DEADLINE_FROM_NOW, // in seconds from now\n recipientAddressOrName: string | null // the ENS name or address of the recipient of the trade, or null if swap should be returned to sender\n): { state: SwapCallbackState; callback: null | (() => Promise); error: string | null } {\n const { account, chainId, library } = useActiveWeb3React()\n\n const swapCalls = useSwapCallArguments(trade, allowedSlippage, deadline, recipientAddressOrName)\n\n const addTransaction = useTransactionAdder()\n\n const { address: recipientAddress } = useENS(recipientAddressOrName)\n const recipient = recipientAddressOrName === null ? account : recipientAddress\n\n return useMemo(() => {\n if (!trade || !library || !account || !chainId) {\n return { state: SwapCallbackState.INVALID, callback: null, error: 'Missing dependencies' }\n }\n if (!recipient) {\n if (recipientAddressOrName !== null) {\n return { state: SwapCallbackState.INVALID, callback: null, error: 'Invalid recipient' }\n }\n return { state: SwapCallbackState.LOADING, callback: null, error: null }\n }\n\n return {\n state: SwapCallbackState.VALID,\n callback: async function onSwap(): Promise {\n const estimatedCalls: EstimatedSwapCall[] = await Promise.all(\n swapCalls.map((call) => {\n const {\n parameters: { methodName, args, value },\n contract,\n } = call\n const options = !value || isZero(value) ? {} : { value }\n\n return contract.estimateGas[methodName](...args, options)\n .then((gasEstimate) => {\n return {\n call,\n gasEstimate,\n }\n })\n .catch((gasError) => {\n console.info('Gas estimate failed, trying eth_call to extract error', call)\n\n return contract.callStatic[methodName](...args, options)\n .then((result) => {\n console.info('Unexpected successful call after failed estimate gas', call, gasError, result)\n return { call, error: new Error('Unexpected issue with estimating the gas. Please try again.') }\n })\n .catch((callError) => {\n console.info('Call threw error', call, callError)\n let errorMessage: string\n switch (callError.reason) {\n case 'UniswapV2Router: INSUFFICIENT_OUTPUT_AMOUNT':\n case 'UniswapV2Router: EXCESSIVE_INPUT_AMOUNT':\n errorMessage =\n 'This transaction will not succeed either due to price movement or fee on transfer. Try increasing your slippage tolerance.'\n break\n default:\n errorMessage = `The transaction cannot succeed due to error: ${callError.reason}. This is probably an issue with one of the tokens you are swapping.`\n }\n return { call, error: new Error(errorMessage) }\n })\n })\n })\n )\n\n // a successful estimation is a bignumber gas estimate and the next call is also a bignumber gas estimate\n const successfulEstimation = estimatedCalls.find(\n (el, ix, list): el is SuccessfulCall =>\n 'gasEstimate' in el && (ix === list.length - 1 || 'gasEstimate' in list[ix + 1])\n )\n\n if (!successfulEstimation) {\n const errorCalls = estimatedCalls.filter((call): call is FailedCall => 'error' in call)\n if (errorCalls.length > 0) throw errorCalls[errorCalls.length - 1].error\n throw new Error('Unexpected error. Please contact support: none of the calls threw an error')\n }\n\n const {\n call: {\n contract,\n parameters: { methodName, args, value },\n },\n gasEstimate,\n } = successfulEstimation\n\n return contract[methodName](...args, {\n gasLimit: calculateGasMargin(gasEstimate),\n ...(value && !isZero(value) ? { value, from: account } : { from: account }),\n })\n .then((response: any) => {\n const inputSymbol = trade.inputAmount.currency.symbol\n const outputSymbol = trade.outputAmount.currency.symbol\n const inputAmount = trade.inputAmount.toSignificant(3)\n const outputAmount = trade.outputAmount.toSignificant(3)\n\n const base = `Swap ${inputAmount} ${inputSymbol} for ${outputAmount} ${outputSymbol}`\n const withRecipient =\n recipient === account\n ? base\n : `${base} to ${\n recipientAddressOrName && isAddress(recipientAddressOrName)\n ? shortenAddress(recipientAddressOrName)\n : recipientAddressOrName\n }`\n\n addTransaction(response, {\n summary: withRecipient,\n })\n\n return response.hash\n })\n .catch((error: any) => {\n // if the user rejected the tx, pass this along\n if (error?.code === 4001) {\n throw new Error('Transaction rejected.')\n } else {\n // otherwise, the error was unexpected and we need to convey that\n console.error(`Swap failed`, error, methodName, args, value)\n throw new Error(`Swap failed: ${error.message}`)\n }\n })\n },\n error: null,\n }\n }, [trade, library, account, chainId, recipient, recipientAddressOrName, swapCalls, addTransaction])\n}\n\nexport default useSwapCallback","import { Currency, currencyEquals, ETHER, WETH } from '@pancakeswap-libs/sdk'\nimport { useMemo } from 'react'\nimport { tryParseAmount } from '../state/swap/hooks'\nimport { useTransactionAdder } from '../state/transactions/hooks'\nimport { useCurrencyBalance } from '../state/wallet/hooks'\nimport { useActiveWeb3React } from './index'\nimport { useWETHContract } from './useContract'\n\nexport enum WrapType {\n NOT_APPLICABLE,\n WRAP,\n UNWRAP\n}\n\nconst NOT_APPLICABLE = { wrapType: WrapType.NOT_APPLICABLE }\n/**\n * Given the selected input and output currency, return a wrap callback\n * @param inputCurrency the selected input currency\n * @param outputCurrency the selected output currency\n * @param typedValue the user input value\n */\nexport default function useWrapCallback(\n inputCurrency: Currency | undefined,\n outputCurrency: Currency | undefined,\n typedValue: string | undefined\n): { wrapType: WrapType; execute?: undefined | (() => Promise); inputError?: string } {\n const { chainId, account } = useActiveWeb3React()\n const wethContract = useWETHContract()\n const balance = useCurrencyBalance(account ?? undefined, inputCurrency)\n // we can always parse the amount typed as the input currency, since wrapping is 1:1\n const inputAmount = useMemo(() => tryParseAmount(typedValue, inputCurrency), [inputCurrency, typedValue])\n const addTransaction = useTransactionAdder()\n\n return useMemo(() => {\n if (!wethContract || !chainId || !inputCurrency || !outputCurrency) return NOT_APPLICABLE\n\n const sufficientBalance = inputAmount && balance && !balance.lessThan(inputAmount)\n\n if (inputCurrency === ETHER && currencyEquals(WETH[chainId], outputCurrency)) {\n return {\n wrapType: WrapType.WRAP,\n execute:\n sufficientBalance && inputAmount\n ? async () => {\n try {\n const txReceipt = await wethContract.deposit({ value: `0x${inputAmount.raw.toString(16)}` })\n addTransaction(txReceipt, { summary: `Wrap ${inputAmount.toSignificant(6)} BNB to WBNB` })\n } catch (error) {\n console.error('Could not deposit', error)\n }\n }\n : undefined,\n inputError: sufficientBalance ? undefined : 'Insufficient BNB balance'\n }\n } if (currencyEquals(WETH[chainId], inputCurrency) && outputCurrency === ETHER) {\n return {\n wrapType: WrapType.UNWRAP,\n execute:\n sufficientBalance && inputAmount\n ? async () => {\n try {\n const txReceipt = await wethContract.withdraw(`0x${inputAmount.raw.toString(16)}`)\n addTransaction(txReceipt, { summary: `Unwrap ${inputAmount.toSignificant(6)} WBNB to BNB` })\n } catch (error) {\n console.error('Could not withdraw', error)\n }\n }\n : undefined,\n inputError: sufficientBalance ? undefined : 'Insufficient WBNB balance'\n }\n } \n return NOT_APPLICABLE\n \n }, [wethContract, chainId, inputCurrency, outputCurrency, inputAmount, balance, addTransaction])\n}\n","import { CurrencyAmount, JSBI, Token, Trade } from '@pancakeswap-libs/sdk'\nimport React, { useCallback, useContext, useEffect, useMemo, useState } from 'react'\nimport { ArrowDown } from 'react-feather'\nimport { CardBody, ArrowDownIcon, Button, IconButton, Text } from '@pancakeswap-libs/uikit'\nimport { ThemeContext } from 'styled-components'\nimport AddressInputPanel from 'components/AddressInputPanel'\nimport Card, { GreyCard } from 'components/Card'\nimport { AutoColumn } from 'components/Column'\nimport ConfirmSwapModal from 'components/swap/ConfirmSwapModal'\nimport CurrencyInputPanel from 'components/CurrencyInputPanel'\nimport CardNav from 'components/CardNav'\nimport { AutoRow, RowBetween } from 'components/Row'\nimport AdvancedSwapDetailsDropdown from 'components/swap/AdvancedSwapDetailsDropdown'\nimport confirmPriceImpactWithoutFee from 'components/swap/confirmPriceImpactWithoutFee'\nimport { ArrowWrapper, BottomGrouping, SwapCallbackError, Wrapper } from 'components/swap/styleds'\nimport TradePrice from 'components/swap/TradePrice'\nimport TokenWarningModal from 'components/TokenWarningModal'\nimport SyrupWarningModal from 'components/SyrupWarningModal'\nimport SafeMoonWarningModal from 'components/SafeMoonWarningModal'\nimport ProgressSteps from 'components/ProgressSteps'\n\nimport { INITIAL_ALLOWED_SLIPPAGE } from 'constants/index'\nimport { useActiveWeb3React } from 'hooks'\nimport { useCurrency } from 'hooks/Tokens'\nimport { ApprovalState, useApproveCallbackFromTrade } from 'hooks/useApproveCallback'\nimport { useSwapCallback } from 'hooks/useSwapCallback'\nimport useWrapCallback, { WrapType } from 'hooks/useWrapCallback'\nimport { Field } from 'state/swap/actions'\nimport { useDefaultsFromURLSearch, useDerivedSwapInfo, useSwapActionHandlers, useSwapState } from 'state/swap/hooks'\nimport { useExpertModeManager, useUserDeadline, useUserSlippageTolerance } from 'state/user/hooks'\nimport { LinkStyledButton } from 'components/Shared'\nimport { maxAmountSpend } from 'utils/maxAmountSpend'\nimport { computeTradePriceBreakdown, warningSeverity } from 'utils/prices'\nimport Loader from 'components/Loader'\nimport useI18n from 'hooks/useI18n'\nimport PageHeader from 'components/PageHeader'\nimport ConnectWalletButton from 'components/ConnectWalletButton'\nimport AppBody from '../AppBody'\n\nconst Swap = () => {\n const loadedUrlParams = useDefaultsFromURLSearch()\n const TranslateString = useI18n()\n\n // token warning stuff\n const [loadedInputCurrency, loadedOutputCurrency] = [\n useCurrency(loadedUrlParams?.inputCurrencyId),\n useCurrency(loadedUrlParams?.outputCurrencyId),\n ]\n const [dismissTokenWarning, setDismissTokenWarning] = useState(false)\n const [transactionWarning, setTransactionWarning] = useState<{\n selectedToken: string | null\n purchaseType: string | null\n }>({\n selectedToken: null,\n purchaseType: null,\n })\n const urlLoadedTokens: Token[] = useMemo(\n () => [loadedInputCurrency, loadedOutputCurrency]?.filter((c): c is Token => c instanceof Token) ?? [],\n [loadedInputCurrency, loadedOutputCurrency]\n )\n const handleConfirmTokenWarning = useCallback(() => {\n setDismissTokenWarning(true)\n }, [])\n\n const handleConfirmWarning = () => {\n setTransactionWarning({\n selectedToken: null,\n purchaseType: null,\n })\n }\n\n const { account } = useActiveWeb3React()\n const theme = useContext(ThemeContext)\n\n const [isExpertMode] = useExpertModeManager()\n\n // get custom setting values for user\n const [deadline] = useUserDeadline()\n const [allowedSlippage] = useUserSlippageTolerance()\n\n // swap state\n const { independentField, typedValue, recipient } = useSwapState()\n const { v2Trade, currencyBalances, parsedAmount, currencies, inputError: swapInputError } = useDerivedSwapInfo()\n const { wrapType, execute: onWrap, inputError: wrapInputError } = useWrapCallback(\n currencies[Field.INPUT],\n currencies[Field.OUTPUT],\n typedValue\n )\n const showWrap: boolean = wrapType !== WrapType.NOT_APPLICABLE\n const trade = showWrap ? undefined : v2Trade\n\n const parsedAmounts = showWrap\n ? {\n [Field.INPUT]: parsedAmount,\n [Field.OUTPUT]: parsedAmount,\n }\n : {\n [Field.INPUT]: independentField === Field.INPUT ? parsedAmount : trade?.inputAmount,\n [Field.OUTPUT]: independentField === Field.OUTPUT ? parsedAmount : trade?.outputAmount,\n }\n\n const { onSwitchTokens, onCurrencySelection, onUserInput, onChangeRecipient } = useSwapActionHandlers()\n const isValid = !swapInputError\n const dependentField: Field = independentField === Field.INPUT ? Field.OUTPUT : Field.INPUT\n\n const handleTypeInput = useCallback(\n (value: string) => {\n onUserInput(Field.INPUT, value)\n },\n [onUserInput]\n )\n const handleTypeOutput = useCallback(\n (value: string) => {\n onUserInput(Field.OUTPUT, value)\n },\n [onUserInput]\n )\n\n // modal and loading\n const [{ showConfirm, tradeToConfirm, swapErrorMessage, attemptingTxn, txHash }, setSwapState] = useState<{\n showConfirm: boolean\n tradeToConfirm: Trade | undefined\n attemptingTxn: boolean\n swapErrorMessage: string | undefined\n txHash: string | undefined\n }>({\n showConfirm: false,\n tradeToConfirm: undefined,\n attemptingTxn: false,\n swapErrorMessage: undefined,\n txHash: undefined,\n })\n\n const formattedAmounts = {\n [independentField]: typedValue,\n [dependentField]: showWrap\n ? parsedAmounts[independentField]?.toExact() ?? ''\n : parsedAmounts[dependentField]?.toSignificant(6) ?? '',\n }\n\n const route = trade?.route\n const userHasSpecifiedInputOutput = Boolean(\n currencies[Field.INPUT] && currencies[Field.OUTPUT] && parsedAmounts[independentField]?.greaterThan(JSBI.BigInt(0))\n )\n const noRoute = !route\n\n // check whether the user has approved the router on the input token\n const [approval, approveCallback] = useApproveCallbackFromTrade(trade, allowedSlippage)\n\n // check if user has gone through approval process, used to show two step buttons, reset on token change\n const [approvalSubmitted, setApprovalSubmitted] = useState(false)\n\n // mark when a user has submitted an approval, reset onTokenSelection for input field\n useEffect(() => {\n if (approval === ApprovalState.PENDING) {\n setApprovalSubmitted(true)\n }\n }, [approval, approvalSubmitted])\n\n const maxAmountInput: CurrencyAmount | undefined = maxAmountSpend(currencyBalances[Field.INPUT])\n const atMaxAmountInput = Boolean(maxAmountInput && parsedAmounts[Field.INPUT]?.equalTo(maxAmountInput))\n\n // the callback to execute the swap\n const { callback: swapCallback, error: swapCallbackError } = useSwapCallback(\n trade,\n allowedSlippage,\n deadline,\n recipient\n )\n\n const { priceImpactWithoutFee } = computeTradePriceBreakdown(trade)\n\n const handleSwap = useCallback(() => {\n if (priceImpactWithoutFee && !confirmPriceImpactWithoutFee(priceImpactWithoutFee)) {\n return\n }\n if (!swapCallback) {\n return\n }\n setSwapState((prevState) => ({ ...prevState, attemptingTxn: true, swapErrorMessage: undefined, txHash: undefined }))\n swapCallback()\n .then((hash) => {\n setSwapState((prevState) => ({\n ...prevState,\n attemptingTxn: false,\n swapErrorMessage: undefined,\n txHash: hash,\n }))\n })\n .catch((error) => {\n setSwapState((prevState) => ({\n ...prevState,\n attemptingTxn: false,\n swapErrorMessage: error.message,\n txHash: undefined,\n }))\n })\n }, [priceImpactWithoutFee, swapCallback, setSwapState])\n\n // errors\n const [showInverted, setShowInverted] = useState(false)\n\n // warnings on slippage\n const priceImpactSeverity = warningSeverity(priceImpactWithoutFee)\n\n // show approve flow when: no error on inputs, not approved or pending, or approved in current session\n // never show if price impact is above threshold in non expert mode\n const showApproveFlow =\n !swapInputError &&\n (approval === ApprovalState.NOT_APPROVED ||\n approval === ApprovalState.PENDING ||\n (approvalSubmitted && approval === ApprovalState.APPROVED)) &&\n !(priceImpactSeverity > 3 && !isExpertMode)\n\n const handleConfirmDismiss = useCallback(() => {\n setSwapState((prevState) => ({ ...prevState, showConfirm: false }))\n\n // if there was a tx hash, we want to clear the input\n if (txHash) {\n onUserInput(Field.INPUT, '')\n }\n }, [onUserInput, txHash, setSwapState])\n\n const handleAcceptChanges = useCallback(() => {\n setSwapState((prevState) => ({ ...prevState, tradeToConfirm: trade }))\n }, [trade])\n\n // This will check to see if the user has selected Syrup or SafeMoon to either buy or sell.\n // If so, they will be alerted with a warning message.\n const checkForWarning = useCallback(\n (selected: string, purchaseType: string) => {\n if (['SYRUP', 'SAFEMOON'].includes(selected)) {\n setTransactionWarning({\n selectedToken: selected,\n purchaseType,\n })\n }\n },\n [setTransactionWarning]\n )\n\n const handleInputSelect = useCallback(\n (inputCurrency) => {\n setApprovalSubmitted(false) // reset 2 step UI for approvals\n onCurrencySelection(Field.INPUT, inputCurrency)\n if (inputCurrency.symbol === 'SYRUP') {\n checkForWarning(inputCurrency.symbol, 'Selling')\n }\n if (inputCurrency.symbol === 'SAFEMOON') {\n checkForWarning(inputCurrency.symbol, 'Selling')\n }\n },\n [onCurrencySelection, setApprovalSubmitted, checkForWarning]\n )\n\n const handleMaxInput = useCallback(() => {\n if (maxAmountInput) {\n onUserInput(Field.INPUT, maxAmountInput.toExact())\n }\n }, [maxAmountInput, onUserInput])\n\n const handleOutputSelect = useCallback(\n (outputCurrency) => {\n onCurrencySelection(Field.OUTPUT, outputCurrency)\n if (outputCurrency.symbol === 'SYRUP') {\n checkForWarning(outputCurrency.symbol, 'Buying')\n }\n if (outputCurrency.symbol === 'SAFEMOON') {\n checkForWarning(outputCurrency.symbol, 'Buying')\n }\n },\n [onCurrencySelection, checkForWarning]\n )\n\n return (\n <>\n 0 && !dismissTokenWarning}\n tokens={urlLoadedTokens}\n onConfirm={handleConfirmTokenWarning}\n />\n \n \n \n \n \n \n \n \n \n \n \n \n \n {\n setApprovalSubmitted(false) // reset 2 step UI for approvals\n onSwitchTokens()\n }}\n style={{ borderRadius: '50%' }}\n scale=\"sm\"\n >\n \n \n \n {recipient === null && !showWrap && isExpertMode ? (\n onChangeRecipient('')}>\n + Add a send (optional)\n \n ) : null}\n \n \n \n\n {recipient !== null && !showWrap ? (\n <>\n \n \n \n \n onChangeRecipient(null)}>\n - Remove send\n \n \n \n \n ) : null}\n\n {showWrap ? null : (\n \n \n {Boolean(trade) && (\n \n {TranslateString(1182, 'Price')}\n \n \n )}\n {allowedSlippage !== INITIAL_ALLOWED_SLIPPAGE && (\n \n {TranslateString(88, 'Slippage Tolerance')}\n {allowedSlippage / 100}%\n \n )}\n \n \n )}\n \n \n {!account ? (\n \n ) : showWrap ? (\n \n ) : noRoute && userHasSpecifiedInputOutput ? (\n \n {TranslateString(1194, 'Insufficient liquidity for this trade.')}\n \n ) : showApproveFlow ? (\n \n \n {approval === ApprovalState.PENDING ? (\n \n Approving \n \n ) : approvalSubmitted && approval === ApprovalState.APPROVED ? (\n 'Approved'\n ) : (\n `Approve ${currencies[Field.INPUT]?.symbol}`\n )}\n \n {\n if (isExpertMode) {\n handleSwap()\n } else {\n setSwapState({\n tradeToConfirm: trade,\n attemptingTxn: false,\n swapErrorMessage: undefined,\n showConfirm: true,\n txHash: undefined,\n })\n }\n }}\n style={{ width: '48%' }}\n id=\"swap-button\"\n disabled={\n !isValid || approval !== ApprovalState.APPROVED || (priceImpactSeverity > 3 && !isExpertMode)\n }\n variant={isValid && priceImpactSeverity > 2 ? 'danger' : 'primary'}\n >\n {priceImpactSeverity > 3 && !isExpertMode\n ? `Price Impact High`\n : `Swap${priceImpactSeverity > 2 ? ' Anyway' : ''}`}\n \n \n ) : (\n {\n if (isExpertMode) {\n handleSwap()\n } else {\n setSwapState({\n tradeToConfirm: trade,\n attemptingTxn: false,\n swapErrorMessage: undefined,\n showConfirm: true,\n txHash: undefined,\n })\n }\n }}\n id=\"swap-button\"\n disabled={!isValid || (priceImpactSeverity > 3 && !isExpertMode) || !!swapCallbackError}\n variant={isValid && priceImpactSeverity > 2 && !swapCallbackError ? 'danger' : 'primary'}\n width=\"100%\"\n >\n {swapInputError ||\n (priceImpactSeverity > 3 && !isExpertMode\n ? `Price Impact Too High`\n : `Swap${priceImpactSeverity > 2 ? ' Anyway' : ''}`)}\n \n )}\n {showApproveFlow && }\n {isExpertMode && swapErrorMessage ? : null}\n \n \n \n \n \n \n )\n}\n\nexport default Swap\n","import { Percent } from '@pancakeswap-libs/sdk'\nimport { ALLOWED_PRICE_IMPACT_HIGH, PRICE_IMPACT_WITHOUT_FEE_CONFIRM_MIN } from '../../constants'\n\n/**\n * Given the price impact, get user confirmation.\n *\n * @param priceImpactWithoutFee price impact of the trade without the fee.\n */\nexport default function confirmPriceImpactWithoutFee(priceImpactWithoutFee: Percent): boolean {\n if (!priceImpactWithoutFee.lessThan(PRICE_IMPACT_WITHOUT_FEE_CONFIRM_MIN)) {\n return (\n window.prompt(\n `This swap has a price impact of at least ${PRICE_IMPACT_WITHOUT_FEE_CONFIRM_MIN.toFixed(\n 0\n )}%. Please type the word \"confirm\" to continue with this swap.`\n ) === 'confirm'\n )\n } if (!priceImpactWithoutFee.lessThan(ALLOWED_PRICE_IMPACT_HIGH)) {\n return window.confirm(\n `This swap has a price impact of at least ${ALLOWED_PRICE_IMPACT_HIGH.toFixed(\n 0\n )}%. Please confirm that you would like to continue with this swap.`\n )\n }\n return true\n}\n","import React from 'react'\nimport { Redirect, RouteComponentProps } from 'react-router-dom'\n\n// Redirects to swap but only replace the pathname\nexport function RedirectPathToSwapOnly({ location }: RouteComponentProps) {\n return \n}\n\nexport default RedirectPathToSwapOnly\n","export const EN = { code: 'en', language: 'English' }\nexport const AR = { code: 'ar', language: 'العربية' }\nexport const BN = { code: 'bn', language: 'বাংলা'}\nexport const ZHCN = { code: 'zh-CN', language: '简体中文' }\nexport const ZHTW = { code: 'zh-TW', language: '繁體中文' }\nexport const NL = { code: 'nl', language: 'Nederlands' }\nexport const FIL = { code: 'fil', language: 'Filipino' }\nexport const FI = { code: 'fi', language: 'Suomalainen' }\nexport const FR = { code: 'fr', language: 'Français' }\nexport const DE = { code: 'de', language: 'Deutsch' }\nexport const EL = { code: 'el', language: 'Ελληνικά' }\nexport const HI = { code: 'hi', language: 'हिंदी' }\nexport const HU = { code: 'hu', language: 'Magyar' }\nexport const ID = { code: 'id', language: 'Bahasa Indonesia' }\nexport const IT = { code: 'it', language: 'Italiano' }\nexport const JA = { code: 'ja', language: '日本語' }\nexport const KO = { code: 'ko', language: '한국어' }\nexport const PL = { code: 'pl', language: 'Polski' }\nexport const PTPT = { code: 'pt-PT', language: 'Português (Portugal)' }\nexport const PTBR = { code: 'pt-BR', language: 'Português (Brasil)' }\nexport const RO = { code: 'ro', language: 'Română' }\nexport const RU = { code: 'ru', language: 'Русский' }\nexport const ESES = { code: 'es-ES', language: 'Español' }\nexport const SVSE = { code: 'sv-SE', language: 'Svenska' }\nexport const TA = { code: 'ta', language: 'தமிழ்' }\nexport const TR = { code: 'tr', language: 'Türkçe' }\nexport const UK = { code: 'uk', language: 'Українська' }\nexport const VI = { code: 'vi', language: 'Tiếng Việt' }\n\nexport const allLanguages = [\n EN\n]\n","import React, { createContext } from 'react'\nimport { LangType } from '@pancakeswap-libs/uikit'\n\nexport interface LanguageObject {\n code: string\n language: string\n}\ninterface LanguageState {\n selectedLanguage: LanguageObject\n setSelectedLanguage: (langObject: LangType) => void\n translatedLanguage: LanguageObject\n setTranslatedLanguage: React.Dispatch>\n}\n\nconst defaultLanguageState: LanguageState = {\n selectedLanguage: { code: '', language: '' },\n setSelectedLanguage: (): void => undefined,\n translatedLanguage: { code: '', language: '' },\n setTranslatedLanguage: (): void => undefined,\n}\n\nexport const LanguageContext = createContext(defaultLanguageState as LanguageState)\n","import React, { useState } from 'react'\nimport { ThemeProvider as SCThemeProvider } from 'styled-components'\nimport { light, dark } from '@pancakeswap-libs/uikit'\n\nconst CACHE_KEY = 'IS_DARK'\n\nexport interface ThemeContextType {\n isDark: boolean;\n toggleTheme: () => void;\n}\n\nconst ThemeContext = React.createContext({ isDark: false, toggleTheme: () => null })\n\nconst ThemeContextProvider: React.FC = ({ children }) => {\n const [isDark, setIsDark] = useState(() => {\n const isDarkUserSetting = localStorage.getItem(CACHE_KEY)\n return isDarkUserSetting ? JSON.parse(isDarkUserSetting) : false\n })\n\n const toggleTheme = () => {\n setIsDark((prevState: any) => {\n localStorage.setItem(CACHE_KEY, JSON.stringify(!prevState))\n return !prevState\n })\n }\n\n return (\n \n {children}\n \n )\n}\n\nexport { ThemeContext, ThemeContextProvider }\n","import { useContext } from 'react'\nimport { ThemeContext as StyledThemeCopntext } from 'styled-components'\nimport { ThemeContext } from '../ThemeContext'\n\nconst useTheme = () => {\n const { isDark, toggleTheme } = useContext(ThemeContext)\n const theme = useContext(StyledThemeCopntext)\n return { isDark, toggleTheme, theme }\n}\n\nexport default useTheme\n","import { useEffect, useState } from 'react'\n\ntype ApiResponse = {\n updated_at: string\n data: {\n [key: string]: {\n name: string\n symbol: string\n price: string\n price_BNB: string\n }\n }\n}\n\nconst api = 'https://api.pancakeswap.info/api/tokens'\n\nconst useGetPriceData = () => {\n const [data, setData] = useState(null)\n\n useEffect(() => {\n const fetchData = async () => {\n try {\n const response = await fetch(api)\n const res: ApiResponse = await response.json()\n\n setData(res)\n } catch (error) {\n console.error('Unable to fetch price data:', error)\n }\n }\n\n fetchData()\n }, [setData])\n\n return data\n}\n\nexport default useGetPriceData\n","import { useEffect, useState } from 'react'\nimport Cookies from 'js-cookie'\nimport { useActiveWeb3React } from 'hooks'\n\nconst initialState = {\n profileLink: 'https://pancakeswap.finance/profile',\n noProfileLink: 'https://pancakeswap.finance/profile',\n}\n\n/**\n * Note - this will only work if the app is on the same domain\n */\nconst useGetLocalProfile = () => {\n const [profile, setProfile] = useState(initialState)\n const { account } = useActiveWeb3React()\n\n useEffect(() => {\n if (account) {\n try {\n const localData = Cookies.get(`profile_${account}`)\n\n if (localData) {\n const localProfile = JSON.parse(localData)\n\n setProfile((prevProfile) => ({\n ...prevProfile,\n username: localProfile.username,\n image: localProfile.avatar,\n }))\n }\n } catch (error) {\n setProfile(initialState)\n }\n } else {\n setProfile(initialState)\n }\n }, [account, setProfile])\n\n return profile\n}\n\nexport default useGetLocalProfile\n","import { MenuEntry } from '@pancakeswap-libs/uikit'\n\nconst config: MenuEntry[] = [\n {\n label: 'Home',\n icon: 'HomeIcon',\n href: '/',\n },\n {\n label: 'Trade',\n icon: 'TradeIcon',\n initialOpenState: false,\n items: [\n {\n label: 'Exchange',\n href: '/swap',\n },\n {\n label: 'Liquidity',\n href: '/pool',\n },\n ],\n },\n]\n\nexport default config\n","import React, { useContext } from 'react'\nimport { Menu as UikitMenu} from '@pancakeswap-libs/uikit'\nimport { useWeb3React } from '@web3-react/core'\nimport { allLanguages } from 'constants/localisation/languageCodes'\nimport { LanguageContext } from 'hooks/LanguageContext'\nimport useTheme from 'hooks/useTheme'\nimport useGetPriceData from 'hooks/useGetPriceData'\nimport useGetLocalProfile from 'hooks/useGetLocalProfile'\nimport useAuth from 'hooks/useAuth'\nimport links from './config'\n\nconst Menu: React.FC = (props) => {\n const { account } = useWeb3React()\n const { login, logout } = useAuth()\n const { selectedLanguage, setSelectedLanguage } = useContext(LanguageContext)\n const { isDark, toggleTheme } = useTheme()\n const priceData = useGetPriceData()\n let cakePriceUsd = 0;\n try {\n cakePriceUsd = priceData ? Number(priceData.data['0x0E09FaBB73Bd3Ade0a17ECC321fD13a19e81cE82'].price ?? 0) : 0\n } catch (e) {\n // Ignore\n }\n const profile = useGetLocalProfile()\n\n return (\n \n )\n}\n\nexport default Menu\n","import { useEffect } from 'react'\nimport useGetPriceData from './useGetPriceData'\nimport { CAKE } from '../constants'\n\nconst useGetDocumentTitlePrice = () => {\n const priceData = useGetPriceData();\n let cakePriceUsd = 0;\n try {\n cakePriceUsd = priceData ? parseFloat(priceData.data[CAKE.address].price ?? 0) : 0\n } catch (e) {\n // Ignore\n }\n\n const cakePriceUsdString =\n Number.isNaN(cakePriceUsd) || cakePriceUsd === 0\n ? ''\n : ` - $${cakePriceUsd.toLocaleString(undefined, {\n minimumFractionDigits: 3,\n maximumFractionDigits: 3,\n })}`\n\n useEffect(() => {\n document.title = `PancakeSwap${cakePriceUsdString}`\n }, [cakePriceUsdString])\n}\nexport default useGetDocumentTitlePrice\n","import React, { Suspense, useEffect, useState } from 'react'\nimport { HashRouter, Route, Switch } from 'react-router-dom'\nimport styled from 'styled-components'\nimport { LangType } from '@pancakeswap-libs/uikit'\nimport Popups from '../components/Popups'\nimport Web3ReactManager from '../components/Web3ReactManager'\nimport { RedirectDuplicateTokenIds, RedirectOldAddLiquidityPathStructure } from './AddLiquidity/redirects'\nimport { RedirectOldRemoveLiquidityPathStructure } from './RemoveLiquidity/redirects'\nimport AddLiquidity from './AddLiquidity'\nimport Pool from './Pool'\nimport PoolFinder from './PoolFinder'\nimport RemoveLiquidity from './RemoveLiquidity'\nimport Swap from './Swap'\nimport { RedirectPathToSwapOnly } from './Swap/redirects'\nimport { EN, allLanguages } from '../constants/localisation/languageCodes'\nimport { LanguageContext } from '../hooks/LanguageContext'\nimport { TranslationsContext } from '../hooks/TranslationsContext'\n\nimport Menu from '../components/Menu'\nimport useGetDocumentTitlePrice from '../hooks/useGetDocumentTitlePrice'\n\nconst AppWrapper = styled.div`\n display: flex;\n flex-flow: column;\n align-items: flex-start;\n overflow-x: hidden;\n`\n\nconst BodyWrapper = styled.div`\n display: flex;\n flex-direction: column;\n width: 100%;\n padding: 32px 16px;\n align-items: center;\n flex: 1;\n overflow-y: auto;\n overflow-x: hidden;\n z-index: 1;\n justify-content: center;\n background-image: url('/images/group-pancake.svg');\n background-repeat: no-repeat;\n background-position: bottom 24px center;\n background-size: 90%;\n\n ${({ theme }) => theme.mediaQueries.xs} {\n background-size: auto;\n }\n\n ${({ theme }) => theme.mediaQueries.lg} {\n background-image: url('/images/arch-${({ theme }) => (theme.isDark ? 'dark' : 'light')}.svg'),\n url('/images/left-pancake.svg'), url('/images/right-pancake.svg');\n background-repeat: no-repeat;\n background-position: center 420px, 10% 230px, 90% 230px;\n background-size: contain, 266px, 266px;\n min-height: 90vh;\n }\n`\n\nconst Marginer = styled.div`\n margin-top: 5rem;\n`\n\nconst CACHE_KEY = 'pancakeSwapLanguage'\n\nexport default function App() {\n const [selectedLanguage, setSelectedLanguage] = useState(undefined)\n const [translatedLanguage, setTranslatedLanguage] = useState(undefined)\n const [translations, setTranslations] = useState>([])\n\n const getStoredLang = (storedLangCode: string) => {\n return allLanguages.filter((language) => {\n return language.code === storedLangCode\n })[0]\n }\n\n useEffect(() => {\n const storedLangCode = localStorage.getItem(CACHE_KEY)\n if (storedLangCode) {\n const storedLang = getStoredLang(storedLangCode)\n setSelectedLanguage(storedLang)\n } else {\n setSelectedLanguage(EN)\n }\n }, [])\n\n const handleLanguageSelect = (langObject: LangType) => {\n setSelectedLanguage(langObject)\n localStorage.setItem(CACHE_KEY, langObject.code)\n }\n\n useGetDocumentTitlePrice()\n\n return (\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n\n {/* Redirection: These old routes are still used in the code base */}\n \n \n \n\n \n \n \n \n \n \n \n \n \n \n \n )\n}\n","import { useCallback, useEffect, useState } from 'react'\n\nconst VISIBILITY_STATE_SUPPORTED = 'visibilityState' in document\n\nfunction isWindowVisible() {\n return !VISIBILITY_STATE_SUPPORTED || document.visibilityState !== 'hidden'\n}\n\n/**\n * Returns whether the window is currently visible to the user.\n */\nexport default function useIsWindowVisible(): boolean {\n const [focused, setFocused] = useState(isWindowVisible())\n const listener = useCallback(() => {\n setFocused(isWindowVisible())\n }, [setFocused])\n\n useEffect(() => {\n if (!VISIBILITY_STATE_SUPPORTED) return undefined\n\n document.addEventListener('visibilitychange', listener)\n return () => {\n document.removeEventListener('visibilitychange', listener)\n }\n }, [listener])\n\n return focused\n}\n","import { useCallback, useEffect, useState } from 'react'\nimport { useDispatch } from 'react-redux'\nimport { useActiveWeb3React } from '../../hooks'\nimport useDebounce from '../../hooks/useDebounce'\nimport useIsWindowVisible from '../../hooks/useIsWindowVisible'\nimport { updateBlockNumber } from './actions'\n\nexport default function Updater(): null {\n const { library, chainId } = useActiveWeb3React()\n const dispatch = useDispatch()\n\n const windowVisible = useIsWindowVisible()\n\n const [state, setState] = useState<{ chainId: number | undefined; blockNumber: number | null }>({\n chainId,\n blockNumber: null,\n })\n\n const blockNumberCallback = useCallback(\n (blockNumber: number) => {\n setState((s) => {\n if (chainId === s.chainId) {\n if (typeof s.blockNumber !== 'number') return { chainId, blockNumber }\n return { chainId, blockNumber: Math.max(blockNumber, s.blockNumber) }\n }\n return s\n })\n },\n [chainId, setState]\n )\n\n // attach/detach listeners\n useEffect(() => {\n if (!library || !chainId || !windowVisible) return undefined\n\n setState({ chainId, blockNumber: null })\n\n library\n .getBlockNumber()\n .then(blockNumberCallback)\n .catch((error) => console.error(`Failed to get block number for chainId: ${chainId}`, error))\n\n library.on('block', blockNumberCallback)\n return () => {\n library.removeListener('block', blockNumberCallback)\n }\n }, [dispatch, chainId, library, blockNumberCallback, windowVisible])\n\n const debouncedState = useDebounce(state, 100)\n\n useEffect(() => {\n if (!debouncedState.chainId || !debouncedState.blockNumber || !windowVisible) return\n dispatch(updateBlockNumber({ chainId: debouncedState.chainId, blockNumber: debouncedState.blockNumber }))\n }, [windowVisible, dispatch, debouncedState.blockNumber, debouncedState.chainId])\n\n return null\n}\n","import { getVersionUpgrade, minVersionBump, VersionUpgrade } from '@uniswap/token-lists'\nimport { useCallback, useEffect } from 'react'\nimport { useDispatch, useSelector } from 'react-redux'\nimport { useActiveWeb3React } from '../../hooks'\nimport { useFetchListCallback } from '../../hooks/useFetchListCallback'\nimport useInterval from '../../hooks/useInterval'\nimport useIsWindowVisible from '../../hooks/useIsWindowVisible'\nimport { addPopup } from '../application/actions'\nimport { AppDispatch, AppState } from '../index'\nimport { acceptListUpdate } from './actions'\n\nexport default function Updater(): null {\n const { library } = useActiveWeb3React()\n const dispatch = useDispatch()\n const lists = useSelector((state) => state.lists.byUrl)\n\n const isWindowVisible = useIsWindowVisible()\n\n const fetchList = useFetchListCallback()\n\n const fetchAllListsCallback = useCallback(() => {\n if (!isWindowVisible) return\n Object.keys(lists).forEach((url) =>\n fetchList(url).catch((error) => console.error('interval list fetching error', error))\n )\n }, [fetchList, isWindowVisible, lists])\n\n // fetch all lists every 10 minutes, but only after we initialize library\n useInterval(fetchAllListsCallback, library ? 1000 * 60 * 10 : null)\n\n // whenever a list is not loaded and not loading, try again to load it\n useEffect(() => {\n Object.keys(lists).forEach((listUrl) => {\n const list = lists[listUrl]\n\n if (!list.current && !list.loadingRequestId && !list.error) {\n fetchList(listUrl).catch((error) => console.error('list added fetching error', error))\n }\n })\n }, [dispatch, fetchList, library, lists])\n\n // automatically update lists if versions are minor/patch\n useEffect(() => {\n Object.keys(lists).forEach((listUrl) => {\n const list = lists[listUrl]\n if (list.current && list.pendingUpdate) {\n const bump = getVersionUpgrade(list.current.version, list.pendingUpdate.version)\n switch (bump) {\n case VersionUpgrade.NONE:\n throw new Error('unexpected no version bump')\n case VersionUpgrade.PATCH:\n case VersionUpgrade.MINOR:\n const min = minVersionBump(list.current.tokens, list.pendingUpdate.tokens)\n // automatically update minor/patch as long as bump matches the min update\n if (bump >= min) {\n dispatch(acceptListUpdate(listUrl))\n dispatch(\n addPopup({\n key: listUrl,\n content: {\n listUpdate: {\n listUrl,\n oldList: list.current,\n newList: list.pendingUpdate,\n auto: true,\n },\n },\n })\n )\n } else {\n console.error(\n `List at url ${listUrl} could not automatically update because the version bump was only PATCH/MINOR while the update had breaking changes and should have been MAJOR`\n )\n }\n break\n\n case VersionUpgrade.MAJOR:\n dispatch(\n addPopup({\n key: listUrl,\n content: {\n listUpdate: {\n listUrl,\n auto: false,\n oldList: list.current,\n newList: list.pendingUpdate,\n },\n },\n removeAfterMs: null,\n })\n )\n }\n }\n })\n }, [dispatch, lists])\n\n return null\n}\n","function wait(ms: number): Promise {\n return new Promise((resolve) => setTimeout(resolve, ms))\n}\n\nfunction waitRandom(min: number, max: number): Promise {\n return wait(min + Math.round(Math.random() * Math.max(0, max - min)))\n}\n\n/**\n * This error is thrown if the function is cancelled before completing\n */\nexport class CancelledError extends Error {\n constructor() {\n super('Cancelled')\n }\n}\n\n/**\n * Throw this error if the function should retry\n */\nexport class RetryableError extends Error {}\n\n/**\n * Retries the function that returns the promise until the promise successfully resolves up to n retries\n * @param fn function to retry\n * @param n how many times to retry\n * @param minWait min wait between retries in ms\n * @param maxWait max wait between retries in ms\n */\nexport function retry(\n fn: () => Promise,\n { n, minWait, maxWait }: { n: number; minWait: number; maxWait: number }\n): { promise: Promise; cancel: () => void } {\n let completed = false\n let rejectCancelled: (error: Error) => void\n // eslint-disable-next-line no-async-promise-executor\n const promise = new Promise(async (resolve, reject) => {\n rejectCancelled = reject\n // eslint-disable-next-line no-constant-condition\n while (true) {\n let result: T\n try {\n result = await fn()\n if (!completed) {\n resolve(result)\n completed = true\n }\n break\n } catch (error) {\n if (completed) {\n break\n }\n if (n <= 0 || !(error instanceof RetryableError)) {\n reject(error)\n completed = true\n break\n }\n n--\n }\n await waitRandom(minWait, maxWait)\n }\n })\n return {\n promise,\n cancel: () => {\n if (completed) return\n completed = true\n rejectCancelled(new CancelledError())\n },\n }\n}\n","import { Contract } from '@ethersproject/contracts'\nimport { useEffect, useMemo, useRef } from 'react'\nimport { useDispatch, useSelector } from 'react-redux'\nimport { useActiveWeb3React } from '../../hooks'\nimport { useMulticallContract } from '../../hooks/useContract'\nimport useDebounce from '../../hooks/useDebounce'\nimport chunkArray from '../../utils/chunkArray'\nimport { CancelledError, retry, RetryableError } from '../../utils/retry'\nimport { useBlockNumber } from '../application/hooks'\nimport { AppDispatch, AppState } from '../index'\nimport {\n Call,\n errorFetchingMulticallResults,\n fetchingMulticallResults,\n parseCallKey,\n updateMulticallResults,\n} from './actions'\n\n// chunk calls so we do not exceed the gas limit\nconst CALL_CHUNK_SIZE = 500\n\n/**\n * Fetches a chunk of calls, enforcing a minimum block number constraint\n * @param multicallContract multicall contract to fetch against\n * @param chunk chunk of calls to make\n * @param minBlockNumber minimum block number of the result set\n */\nasync function fetchChunk(\n multicallContract: Contract,\n chunk: Call[],\n minBlockNumber: number\n): Promise<{ results: string[]; blockNumber: number }> {\n let resultsBlockNumber\n let returnData\n try {\n [resultsBlockNumber, returnData] = await multicallContract.aggregate(\n chunk.map((obj) => [obj.address, obj.callData])\n )\n } catch (error) {\n console.info('Failed to fetch chunk inside retry', error)\n throw error\n }\n if (resultsBlockNumber.toNumber() < minBlockNumber) {\n throw new RetryableError('Fetched for old block number')\n }\n return { results: returnData, blockNumber: resultsBlockNumber.toNumber() }\n}\n\n/**\n * From the current all listeners state, return each call key mapped to the\n * minimum number of blocks per fetch. This is how often each key must be fetched.\n * @param allListeners the all listeners state\n * @param chainId the current chain id\n */\nexport function activeListeningKeys(\n allListeners: AppState['multicall']['callListeners'],\n chainId?: number\n): { [callKey: string]: number } {\n if (!allListeners || !chainId) return {}\n const listeners = allListeners[chainId]\n if (!listeners) return {}\n\n return Object.keys(listeners).reduce<{ [callKey: string]: number }>((memo, callKey) => {\n const keyListeners = listeners[callKey]\n\n memo[callKey] = Object.keys(keyListeners)\n .filter((key) => {\n const blocksPerFetch = parseInt(key)\n if (blocksPerFetch <= 0) return false\n return keyListeners[blocksPerFetch] > 0\n })\n .reduce((previousMin, current) => {\n return Math.min(previousMin, parseInt(current))\n }, Infinity)\n return memo\n }, {})\n}\n\n/**\n * Return the keys that need to be refetched\n * @param callResults current call result state\n * @param listeningKeys each call key mapped to how old the data can be in blocks\n * @param chainId the current chain id\n * @param latestBlockNumber the latest block number\n */\nexport function outdatedListeningKeys(\n callResults: AppState['multicall']['callResults'],\n listeningKeys: { [callKey: string]: number },\n chainId: number | undefined,\n latestBlockNumber: number | undefined\n): string[] {\n if (!chainId || !latestBlockNumber) return []\n const results = callResults[chainId]\n // no results at all, load everything\n if (!results) return Object.keys(listeningKeys)\n\n return Object.keys(listeningKeys).filter((callKey) => {\n const blocksPerFetch = listeningKeys[callKey]\n\n const data = callResults[chainId][callKey]\n // no data, must fetch\n if (!data) return true\n\n const minDataBlockNumber = latestBlockNumber - (blocksPerFetch - 1)\n\n // already fetching it for a recent enough block, don't refetch it\n if (data.fetchingBlockNumber && data.fetchingBlockNumber >= minDataBlockNumber) return false\n\n // if data is older than minDataBlockNumber, fetch it\n return !data.blockNumber || data.blockNumber < minDataBlockNumber\n })\n}\n\nexport default function Updater(): null {\n const dispatch = useDispatch()\n const state = useSelector((s) => s.multicall)\n // wait for listeners to settle before triggering updates\n const debouncedListeners = useDebounce(state.callListeners, 100)\n const latestBlockNumber = useBlockNumber()\n const { chainId } = useActiveWeb3React()\n const multicallContract = useMulticallContract()\n const cancellations = useRef<{ blockNumber: number; cancellations: (() => void)[] }>()\n\n const listeningKeys: { [callKey: string]: number } = useMemo(() => {\n return activeListeningKeys(debouncedListeners, chainId)\n }, [debouncedListeners, chainId])\n\n const unserializedOutdatedCallKeys = useMemo(() => {\n return outdatedListeningKeys(state.callResults, listeningKeys, chainId, latestBlockNumber)\n }, [chainId, state.callResults, listeningKeys, latestBlockNumber])\n\n const serializedOutdatedCallKeys = useMemo(() => JSON.stringify(unserializedOutdatedCallKeys.sort()), [\n unserializedOutdatedCallKeys,\n ])\n\n useEffect(() => {\n if (!latestBlockNumber || !chainId || !multicallContract) return\n\n const outdatedCallKeys: string[] = JSON.parse(serializedOutdatedCallKeys)\n if (outdatedCallKeys.length === 0) return\n const calls = outdatedCallKeys.map((key) => parseCallKey(key))\n // .filter(item => item.address.toLowerCase() !== '0x5Fe5cC0122403f06abE2A75DBba1860Edb762985'.toLowerCase())\n\n const chunkedCalls = chunkArray(calls, CALL_CHUNK_SIZE)\n\n if (cancellations.current?.blockNumber !== latestBlockNumber) {\n cancellations.current?.cancellations?.forEach((c) => c())\n }\n\n dispatch(\n fetchingMulticallResults({\n calls,\n chainId,\n fetchingBlockNumber: latestBlockNumber,\n })\n )\n\n cancellations.current = {\n blockNumber: latestBlockNumber,\n cancellations: chunkedCalls.map((chunk, index) => {\n const { cancel, promise } = retry(() => fetchChunk(multicallContract, chunk, latestBlockNumber), {\n n: Infinity,\n minWait: 2500,\n maxWait: 3500,\n })\n promise\n .then(({ results: returnData, blockNumber: fetchBlockNumber }) => {\n cancellations.current = { cancellations: [], blockNumber: latestBlockNumber }\n\n // accumulates the length of all previous indices\n const firstCallKeyIndex = chunkedCalls.slice(0, index).reduce((memo, curr) => memo + curr.length, 0)\n const lastCallKeyIndex = firstCallKeyIndex + returnData.length\n\n dispatch(\n updateMulticallResults({\n chainId,\n results: outdatedCallKeys\n .slice(firstCallKeyIndex, lastCallKeyIndex)\n .reduce<{ [callKey: string]: string | null }>((memo, callKey, i) => {\n memo[callKey] = returnData[i] ?? null\n return memo\n }, {}),\n blockNumber: fetchBlockNumber,\n })\n )\n })\n .catch((error: any) => {\n if (error instanceof CancelledError) {\n console.error('Cancelled fetch for blockNumber', latestBlockNumber)\n return\n }\n console.error('Failed to fetch multicall chunk', chunk, chainId, error)\n dispatch(\n errorFetchingMulticallResults({\n calls: chunk,\n chainId,\n fetchingBlockNumber: latestBlockNumber,\n })\n )\n })\n return cancel\n }),\n }\n }, [chainId, multicallContract, dispatch, serializedOutdatedCallKeys, latestBlockNumber])\n\n return null\n}\n","// chunks array into chunks of maximum size\n// evenly distributes items among the chunks\nexport default function chunkArray(items: T[], maxChunkSize: number): T[][] {\n if (maxChunkSize < 1) throw new Error('maxChunkSize must be gte 1')\n if (items.length <= maxChunkSize) return [items]\n\n const numChunks: number = Math.ceil(items.length / maxChunkSize)\n const chunkSize = Math.ceil(items.length / numChunks)\n\n return [...Array(numChunks).keys()].map(ix => items.slice(ix * chunkSize, ix * chunkSize + chunkSize))\n}\n","import { useEffect } from 'react'\nimport { useDispatch, useSelector } from 'react-redux'\nimport { useActiveWeb3React } from '../../hooks'\nimport { useAddPopup, useBlockNumber } from '../application/hooks'\nimport { AppDispatch, AppState } from '../index'\nimport { checkedTransaction, finalizeTransaction } from './actions'\n\nexport function shouldCheck(\n lastBlockNumber: number,\n tx: { addedTime: number; receipt?: any; lastCheckedBlockNumber?: number }\n): boolean {\n if (tx.receipt) return false\n if (!tx.lastCheckedBlockNumber) return true\n const blocksSinceCheck = lastBlockNumber - tx.lastCheckedBlockNumber\n if (blocksSinceCheck < 1) return false\n const minutesPending = (new Date().getTime() - tx.addedTime) / 1000 / 60\n if (minutesPending > 60) {\n // every 10 blocks if pending for longer than an hour\n return blocksSinceCheck > 9\n }\n if (minutesPending > 5) {\n // every 3 blocks if pending more than 5 minutes\n return blocksSinceCheck > 2\n }\n // otherwise every block\n return true\n}\n\nexport default function Updater(): null {\n const { chainId, library } = useActiveWeb3React()\n\n const lastBlockNumber = useBlockNumber()\n\n const dispatch = useDispatch()\n const state = useSelector((s) => s.transactions)\n\n // eslint-disable-next-line react-hooks/exhaustive-deps\n const transactions = chainId ? state[chainId] ?? {} : {}\n\n // show popup on confirm\n const addPopup = useAddPopup()\n\n useEffect(() => {\n if (!chainId || !library || !lastBlockNumber) return\n\n Object.keys(transactions)\n .filter((hash) => shouldCheck(lastBlockNumber, transactions[hash]))\n .forEach((hash) => {\n library\n .getTransactionReceipt(hash)\n .then((receipt) => {\n if (receipt) {\n dispatch(\n finalizeTransaction({\n chainId,\n hash,\n receipt: {\n blockHash: receipt.blockHash,\n blockNumber: receipt.blockNumber,\n contractAddress: receipt.contractAddress,\n from: receipt.from,\n status: receipt.status,\n to: receipt.to,\n transactionHash: receipt.transactionHash,\n transactionIndex: receipt.transactionIndex,\n },\n })\n )\n\n addPopup(\n {\n txn: {\n hash,\n success: receipt.status === 1,\n summary: transactions[hash]?.summary,\n },\n },\n hash\n )\n } else {\n dispatch(checkedTransaction({ chainId, hash, blockNumber: lastBlockNumber }))\n }\n })\n .catch((error) => {\n console.error(`failed to check transaction hash: ${hash}`, error)\n })\n })\n }, [chainId, library, transactions, lastBlockNumber, dispatch, addPopup])\n\n return null\n}\n","import React from 'react'\nimport { useSelector } from 'react-redux'\nimport { ToastContainer, Toast } from '@pancakeswap-libs/uikit'\nimport useToast from 'hooks/useToast'\nimport { AppState } from '../../state'\n\nconst ToastListener = () => {\n const toasts: Toast[] = useSelector((state: AppState) => state.toasts.data)\n const { remove } = useToast()\n\n const handleRemove = (id: string) => remove(id)\n\n return \n}\n\nexport default ToastListener\n","import { createReducer, nanoid } from '@reduxjs/toolkit'\nimport {\n addPopup,\n PopupContent,\n removePopup,\n toggleWalletModal,\n toggleSettingsMenu,\n updateBlockNumber\n} from './actions'\n\ntype PopupList = Array<{ key: string; show: boolean; content: PopupContent; removeAfterMs: number | null }>\n\nexport interface ApplicationState {\n blockNumber: { [chainId: number]: number }\n popupList: PopupList\n walletModalOpen: boolean\n settingsMenuOpen: boolean\n}\n\nconst initialState: ApplicationState = {\n blockNumber: {},\n popupList: [],\n walletModalOpen: false,\n settingsMenuOpen: false\n}\n\nexport default createReducer(initialState, builder =>\n builder\n .addCase(updateBlockNumber, (state, action) => {\n const { chainId, blockNumber } = action.payload\n if (typeof state.blockNumber[chainId] !== 'number') {\n state.blockNumber[chainId] = blockNumber\n } else {\n state.blockNumber[chainId] = Math.max(blockNumber, state.blockNumber[chainId])\n }\n })\n .addCase(toggleWalletModal, state => {\n state.walletModalOpen = !state.walletModalOpen\n })\n .addCase(toggleSettingsMenu, state => {\n state.settingsMenuOpen = !state.settingsMenuOpen\n })\n .addCase(addPopup, (state, { payload: { content, key, removeAfterMs = 15000 } }) => {\n state.popupList = (key ? state.popupList.filter(popup => popup.key !== key) : state.popupList).concat([\n {\n key: key || nanoid(),\n show: true,\n content,\n removeAfterMs\n }\n ])\n })\n .addCase(removePopup, (state, { payload: { key } }) => {\n state.popupList.forEach(p => {\n if (p.key === key) {\n p.show = false\n }\n })\n })\n)\n","import { createAction } from '@reduxjs/toolkit'\n\n// fired once when the app reloads but before the app renders\n// allows any updates to be applied to store data loaded from localStorage\nexport const updateVersion = createAction('global/updateVersion')\n\nexport default createAction\n","import { createReducer } from '@reduxjs/toolkit'\nimport { INITIAL_ALLOWED_SLIPPAGE, DEFAULT_DEADLINE_FROM_NOW } from '../../constants'\nimport { updateVersion } from '../global/actions'\nimport {\n addSerializedPair,\n addSerializedToken,\n removeSerializedPair,\n removeSerializedToken,\n SerializedPair,\n SerializedToken,\n updateMatchesDarkMode,\n updateUserDarkMode,\n updateUserExpertMode,\n updateUserSlippageTolerance,\n updateUserDeadline,\n muteAudio,\n unmuteAudio\n} from './actions'\n\nconst currentTimestamp = () => new Date().getTime()\n\nexport interface UserState {\n // the timestamp of the last updateVersion action\n lastUpdateVersionTimestamp?: number\n\n userDarkMode: boolean | null // the user's choice for dark mode or light mode\n matchesDarkMode: boolean // whether the dark mode media query matches\n\n userExpertMode: boolean\n\n // user defined slippage tolerance in bips, used in all txns\n userSlippageTolerance: number\n\n // deadline set by user in minutes, used in all txns\n userDeadline: number\n\n tokens: {\n [chainId: number]: {\n [address: string]: SerializedToken\n }\n }\n\n pairs: {\n [chainId: number]: {\n // keyed by token0Address:token1Address\n [key: string]: SerializedPair\n }\n }\n\n timestamp: number\n\n audioPlay: boolean\n}\n\nfunction pairKey(token0Address: string, token1Address: string) {\n return `${token0Address};${token1Address}`\n}\n\nexport const initialState: UserState = {\n userDarkMode: null,\n matchesDarkMode: false,\n userExpertMode: false,\n userSlippageTolerance: INITIAL_ALLOWED_SLIPPAGE,\n userDeadline: DEFAULT_DEADLINE_FROM_NOW,\n tokens: {},\n pairs: {},\n timestamp: currentTimestamp(),\n audioPlay: true\n}\n\nexport default createReducer(initialState, builder =>\n builder\n .addCase(updateVersion, state => {\n // slippage isnt being tracked in local storage, reset to default\n // noinspection SuspiciousTypeOfGuard\n if (typeof state.userSlippageTolerance !== 'number') {\n state.userSlippageTolerance = INITIAL_ALLOWED_SLIPPAGE\n }\n\n // deadline isnt being tracked in local storage, reset to default\n // noinspection SuspiciousTypeOfGuard\n if (typeof state.userDeadline !== 'number') {\n state.userDeadline = DEFAULT_DEADLINE_FROM_NOW\n }\n\n state.lastUpdateVersionTimestamp = currentTimestamp()\n })\n .addCase(updateUserDarkMode, (state, action) => {\n state.userDarkMode = action.payload.userDarkMode\n state.timestamp = currentTimestamp()\n })\n .addCase(updateMatchesDarkMode, (state, action) => {\n state.matchesDarkMode = action.payload.matchesDarkMode\n state.timestamp = currentTimestamp()\n })\n .addCase(updateUserExpertMode, (state, action) => {\n state.userExpertMode = action.payload.userExpertMode\n state.timestamp = currentTimestamp()\n })\n .addCase(updateUserSlippageTolerance, (state, action) => {\n state.userSlippageTolerance = action.payload.userSlippageTolerance\n state.timestamp = currentTimestamp()\n })\n .addCase(updateUserDeadline, (state, action) => {\n state.userDeadline = action.payload.userDeadline\n state.timestamp = currentTimestamp()\n })\n .addCase(addSerializedToken, (state, { payload: { serializedToken } }) => {\n state.tokens[serializedToken.chainId] = state.tokens[serializedToken.chainId] || {}\n state.tokens[serializedToken.chainId][serializedToken.address] = serializedToken\n state.timestamp = currentTimestamp()\n })\n .addCase(removeSerializedToken, (state, { payload: { address, chainId } }) => {\n state.tokens[chainId] = state.tokens[chainId] || {}\n delete state.tokens[chainId][address]\n state.timestamp = currentTimestamp()\n })\n .addCase(addSerializedPair, (state, { payload: { serializedPair } }) => {\n if (\n serializedPair.token0.chainId === serializedPair.token1.chainId &&\n serializedPair.token0.address !== serializedPair.token1.address\n ) {\n const {chainId} = serializedPair.token0\n state.pairs[chainId] = state.pairs[chainId] || {}\n state.pairs[chainId][pairKey(serializedPair.token0.address, serializedPair.token1.address)] = serializedPair\n }\n state.timestamp = currentTimestamp()\n })\n .addCase(removeSerializedPair, (state, { payload: { chainId, tokenAAddress, tokenBAddress } }) => {\n if (state.pairs[chainId]) {\n // just delete both keys if either exists\n delete state.pairs[chainId][pairKey(tokenAAddress, tokenBAddress)]\n delete state.pairs[chainId][pairKey(tokenBAddress, tokenAAddress)]\n }\n state.timestamp = currentTimestamp()\n })\n .addCase(muteAudio, state => {\n state.audioPlay = false\n })\n .addCase(unmuteAudio, state => {\n state.audioPlay = true\n })\n)\n","import { createReducer } from '@reduxjs/toolkit'\nimport {\n addTransaction,\n checkedTransaction,\n clearAllTransactions,\n finalizeTransaction,\n SerializableTransactionReceipt\n} from './actions'\n\nconst now = () => new Date().getTime()\n\nexport interface TransactionDetails {\n hash: string\n approval?: { tokenAddress: string; spender: string }\n summary?: string\n receipt?: SerializableTransactionReceipt\n lastCheckedBlockNumber?: number\n addedTime: number\n confirmedTime?: number\n from: string\n}\n\nexport interface TransactionState {\n [chainId: number]: {\n [txHash: string]: TransactionDetails\n }\n}\n\nexport const initialState: TransactionState = {}\n\nexport default createReducer(initialState, builder =>\n builder\n .addCase(addTransaction, (transactions, { payload: { chainId, from, hash, approval, summary } }) => {\n if (transactions[chainId]?.[hash]) {\n throw Error('Attempted to add existing transaction.')\n }\n const txs = transactions[chainId] ?? {}\n txs[hash] = { hash, approval, summary, from, addedTime: now() }\n transactions[chainId] = txs\n })\n .addCase(clearAllTransactions, (transactions, { payload: { chainId } }) => {\n if (!transactions[chainId]) return\n transactions[chainId] = {}\n })\n .addCase(checkedTransaction, (transactions, { payload: { chainId, hash, blockNumber } }) => {\n const tx = transactions[chainId]?.[hash]\n if (!tx) {\n return\n }\n if (!tx.lastCheckedBlockNumber) {\n tx.lastCheckedBlockNumber = blockNumber\n } else {\n tx.lastCheckedBlockNumber = Math.max(blockNumber, tx.lastCheckedBlockNumber)\n }\n })\n .addCase(finalizeTransaction, (transactions, { payload: { hash, chainId, receipt } }) => {\n const tx = transactions[chainId]?.[hash]\n if (!tx) {\n return\n }\n tx.receipt = receipt\n tx.confirmedTime = now()\n })\n)\n","import { createReducer } from '@reduxjs/toolkit'\nimport { Field, replaceSwapState, selectCurrency, setRecipient, switchCurrencies, typeInput } from './actions'\n\nexport interface SwapState {\n readonly independentField: Field\n readonly typedValue: string\n readonly [Field.INPUT]: {\n readonly currencyId: string | undefined\n }\n readonly [Field.OUTPUT]: {\n readonly currencyId: string | undefined\n }\n // the typed recipient address or ENS name, or null if swap should go to sender\n readonly recipient: string | null\n}\n\nconst initialState: SwapState = {\n independentField: Field.INPUT,\n typedValue: '',\n [Field.INPUT]: {\n currencyId: '',\n },\n [Field.OUTPUT]: {\n currencyId: '',\n },\n recipient: null,\n}\n\nexport default createReducer(initialState, (builder) =>\n builder\n .addCase(\n replaceSwapState,\n (state, { payload: { typedValue, recipient, field, inputCurrencyId, outputCurrencyId } }) => {\n return {\n [Field.INPUT]: {\n currencyId: inputCurrencyId,\n },\n [Field.OUTPUT]: {\n currencyId: outputCurrencyId,\n },\n independentField: field,\n typedValue,\n recipient,\n }\n }\n )\n .addCase(selectCurrency, (state, { payload: { currencyId, field } }) => {\n const otherField = field === Field.INPUT ? Field.OUTPUT : Field.INPUT\n if (currencyId === state[otherField].currencyId) {\n // the case where we have to swap the order\n return {\n ...state,\n independentField: state.independentField === Field.INPUT ? Field.OUTPUT : Field.INPUT,\n [field]: { currencyId },\n [otherField]: { currencyId: state[field].currencyId },\n }\n }\n // the normal case\n return {\n ...state,\n [field]: { currencyId },\n }\n })\n .addCase(switchCurrencies, (state) => {\n return {\n ...state,\n independentField: state.independentField === Field.INPUT ? Field.OUTPUT : Field.INPUT,\n [Field.INPUT]: { currencyId: state[Field.OUTPUT].currencyId },\n [Field.OUTPUT]: { currencyId: state[Field.INPUT].currencyId },\n }\n })\n .addCase(typeInput, (state, { payload: { field, typedValue } }) => {\n return {\n ...state,\n independentField: field,\n typedValue,\n }\n })\n .addCase(setRecipient, (state, { payload: { recipient } }) => {\n state.recipient = recipient\n })\n)\n","import { createReducer } from '@reduxjs/toolkit'\nimport { Field, resetMintState, typeInput } from './actions'\n\nexport interface MintState {\n readonly independentField: Field\n readonly typedValue: string\n readonly otherTypedValue: string // for the case when there's no liquidity\n}\n\nconst initialState: MintState = {\n independentField: Field.CURRENCY_A,\n typedValue: '',\n otherTypedValue: ''\n}\n\nexport default createReducer(initialState, builder =>\n builder\n .addCase(resetMintState, () => initialState)\n .addCase(typeInput, (state, { payload: { field, typedValue, noLiquidity } }) => {\n if (noLiquidity) {\n // they're typing into the field they've last typed in\n if (field === state.independentField) {\n return {\n ...state,\n independentField: field,\n typedValue\n }\n }\n // they're typing into a new field, store the other value\n \n return {\n ...state,\n independentField: field,\n typedValue,\n otherTypedValue: state.typedValue\n }\n \n } \n return {\n ...state,\n independentField: field,\n typedValue,\n otherTypedValue: ''\n }\n \n })\n)\n","import { createReducer } from '@reduxjs/toolkit'\nimport { getVersionUpgrade, VersionUpgrade } from '@uniswap/token-lists'\n// eslint-disable-next-line import/no-unresolved\nimport { TokenList } from '@uniswap/token-lists/dist/types'\nimport { DEFAULT_LIST_OF_LISTS, DEFAULT_TOKEN_LIST_URL } from '../../constants/lists'\nimport { updateVersion } from '../global/actions'\nimport { acceptListUpdate, addList, fetchTokenList, removeList, selectList } from './actions'\nimport DEFAULT_LIST from '../../constants/token/pancakeswap.json'\n\nexport interface ListsState {\n readonly byUrl: {\n readonly [url: string]: {\n readonly current: TokenList | null\n readonly pendingUpdate: TokenList | null\n readonly loadingRequestId: string | null\n readonly error: string | null\n }\n }\n // this contains the default list of lists from the last time the updateVersion was called, i.e. the app was reloaded\n readonly lastInitializedDefaultListOfLists?: string[]\n readonly selectedListUrl: string | undefined\n}\n\nconst NEW_LIST_STATE: ListsState['byUrl'][string] = {\n error: null,\n current: null,\n loadingRequestId: null,\n pendingUpdate: null,\n}\n\ntype Mutable = { -readonly [P in keyof T]: T[P] extends ReadonlyArray ? U[] : T[P] }\n\nconst initialState: ListsState = {\n lastInitializedDefaultListOfLists: DEFAULT_LIST_OF_LISTS,\n byUrl: {\n ...DEFAULT_LIST_OF_LISTS.reduce>((memo, listUrl) => {\n memo[listUrl] = NEW_LIST_STATE\n return memo\n }, {}),\n [DEFAULT_TOKEN_LIST_URL]: {\n error: null,\n current: DEFAULT_LIST,\n loadingRequestId: null,\n pendingUpdate: null,\n },\n },\n selectedListUrl: DEFAULT_TOKEN_LIST_URL,\n}\n\nexport default createReducer(initialState, (builder) =>\n builder\n .addCase(fetchTokenList.pending, (state, { payload: { requestId, url } }) => {\n state.byUrl[url] = {\n current: null,\n pendingUpdate: null,\n ...state.byUrl[url],\n loadingRequestId: requestId,\n error: null,\n }\n })\n .addCase(fetchTokenList.fulfilled, (state, { payload: { requestId, tokenList, url } }) => {\n const current = state.byUrl[url]?.current\n const loadingRequestId = state.byUrl[url]?.loadingRequestId\n\n // no-op if update does nothing\n if (current) {\n const upgradeType = getVersionUpgrade(current.version, tokenList.version)\n if (upgradeType === VersionUpgrade.NONE) return\n if (loadingRequestId === null || loadingRequestId === requestId) {\n state.byUrl[url] = {\n ...state.byUrl[url],\n loadingRequestId: null,\n error: null,\n current,\n pendingUpdate: tokenList,\n }\n }\n } else {\n state.byUrl[url] = {\n ...state.byUrl[url],\n loadingRequestId: null,\n error: null,\n current: tokenList,\n pendingUpdate: null,\n }\n }\n })\n .addCase(fetchTokenList.rejected, (state, { payload: { url, requestId, errorMessage } }) => {\n if (state.byUrl[url]?.loadingRequestId !== requestId) {\n // no-op since it's not the latest request\n return\n }\n\n state.byUrl[url] = {\n ...state.byUrl[url],\n loadingRequestId: null,\n error: errorMessage,\n current: null,\n pendingUpdate: null,\n }\n })\n .addCase(selectList, (state, { payload: url }) => {\n state.selectedListUrl = url\n // automatically adds list\n if (!state.byUrl[url]) {\n state.byUrl[url] = NEW_LIST_STATE\n }\n })\n .addCase(addList, (state, { payload: url }) => {\n if (!state.byUrl[url]) {\n state.byUrl[url] = NEW_LIST_STATE\n }\n })\n .addCase(removeList, (state, { payload: url }) => {\n if (state.byUrl[url]) {\n delete state.byUrl[url]\n }\n if (state.selectedListUrl === url) {\n state.selectedListUrl = Object.keys(state.byUrl)[0]\n }\n })\n .addCase(acceptListUpdate, (state, { payload: url }) => {\n if (!state.byUrl[url]?.pendingUpdate) {\n throw new Error('accept list update called without pending update')\n }\n state.byUrl[url] = {\n ...state.byUrl[url],\n pendingUpdate: null,\n current: state.byUrl[url].pendingUpdate,\n }\n })\n .addCase(updateVersion, (state) => {\n // state loaded from localStorage, but new lists have never been initialized\n if (!state.lastInitializedDefaultListOfLists) {\n state.byUrl = initialState.byUrl\n state.selectedListUrl = undefined\n } else if (state.lastInitializedDefaultListOfLists) {\n const lastInitializedSet = state.lastInitializedDefaultListOfLists.reduce>(\n (s, l) => s.add(l),\n new Set()\n )\n const newListOfListsSet = DEFAULT_LIST_OF_LISTS.reduce>((s, l) => s.add(l), new Set())\n\n DEFAULT_LIST_OF_LISTS.forEach((listUrl) => {\n if (!lastInitializedSet.has(listUrl)) {\n state.byUrl[listUrl] = NEW_LIST_STATE\n }\n })\n\n state.lastInitializedDefaultListOfLists.forEach((listUrl) => {\n if (!newListOfListsSet.has(listUrl)) {\n delete state.byUrl[listUrl]\n }\n })\n }\n\n state.lastInitializedDefaultListOfLists = DEFAULT_LIST_OF_LISTS\n })\n)\n","import { createReducer } from '@reduxjs/toolkit'\nimport { Field, typeInput } from './actions'\n\nexport interface BurnState {\n readonly independentField: Field\n readonly typedValue: string\n}\n\nconst initialState: BurnState = {\n independentField: Field.LIQUIDITY_PERCENT,\n typedValue: '0'\n}\n\nexport default createReducer(initialState, builder =>\n builder.addCase(typeInput, (state, { payload: { field, typedValue } }) => {\n return {\n ...state,\n independentField: field,\n typedValue\n }\n })\n)\n","import { createReducer } from '@reduxjs/toolkit'\nimport {\n addMulticallListeners,\n errorFetchingMulticallResults,\n fetchingMulticallResults,\n removeMulticallListeners,\n toCallKey,\n updateMulticallResults\n} from './actions'\n\nexport interface MulticallState {\n callListeners?: {\n // on a per-chain basis\n [chainId: number]: {\n // stores for each call key the listeners' preferences\n [callKey: string]: {\n // stores how many listeners there are per each blocks per fetch preference\n [blocksPerFetch: number]: number\n }\n }\n }\n\n callResults: {\n [chainId: number]: {\n [callKey: string]: {\n data?: string | null\n blockNumber?: number\n fetchingBlockNumber?: number\n }\n }\n }\n}\n\nconst initialState: MulticallState = {\n callResults: {}\n}\n\nexport default createReducer(initialState, builder =>\n builder\n .addCase(addMulticallListeners, (state, { payload: { calls, chainId, options: { blocksPerFetch = 1 } = {} } }) => {\n const listeners: MulticallState['callListeners'] = state.callListeners\n ? state.callListeners\n : (state.callListeners = {})\n listeners[chainId] = listeners[chainId] ?? {}\n calls.forEach(call => {\n const callKey = toCallKey(call)\n listeners[chainId][callKey] = listeners[chainId][callKey] ?? {}\n listeners[chainId][callKey][blocksPerFetch] = (listeners[chainId][callKey][blocksPerFetch] ?? 0) + 1\n })\n })\n .addCase(\n removeMulticallListeners,\n (state, { payload: { chainId, calls, options: { blocksPerFetch = 1 } = {} } }) => {\n const listeners: MulticallState['callListeners'] = state.callListeners\n ? state.callListeners\n : (state.callListeners = {})\n\n if (!listeners[chainId]) return\n calls.forEach(call => {\n const callKey = toCallKey(call)\n if (!listeners[chainId][callKey]) return\n if (!listeners[chainId][callKey][blocksPerFetch]) return\n\n if (listeners[chainId][callKey][blocksPerFetch] === 1) {\n delete listeners[chainId][callKey][blocksPerFetch]\n } else {\n listeners[chainId][callKey][blocksPerFetch]--\n }\n })\n }\n )\n .addCase(fetchingMulticallResults, (state, { payload: { chainId, fetchingBlockNumber, calls } }) => {\n state.callResults[chainId] = state.callResults[chainId] ?? {}\n calls.forEach(call => {\n const callKey = toCallKey(call)\n const current = state.callResults[chainId][callKey]\n if (!current) {\n state.callResults[chainId][callKey] = {\n fetchingBlockNumber\n }\n } else {\n if ((current.fetchingBlockNumber ?? 0) >= fetchingBlockNumber) return\n state.callResults[chainId][callKey].fetchingBlockNumber = fetchingBlockNumber\n }\n })\n })\n .addCase(errorFetchingMulticallResults, (state, { payload: { fetchingBlockNumber, chainId, calls } }) => {\n state.callResults[chainId] = state.callResults[chainId] ?? {}\n calls.forEach(call => {\n const callKey = toCallKey(call)\n const current = state.callResults[chainId][callKey]\n if (!current) return // only should be dispatched if we are already fetching\n if (current.fetchingBlockNumber === fetchingBlockNumber) {\n delete current.fetchingBlockNumber\n current.data = null\n current.blockNumber = fetchingBlockNumber\n }\n })\n })\n .addCase(updateMulticallResults, (state, { payload: { chainId, results, blockNumber } }) => {\n state.callResults[chainId] = state.callResults[chainId] ?? {}\n Object.keys(results).forEach(callKey => {\n const current = state.callResults[chainId][callKey]\n if ((current?.blockNumber ?? 0) > blockNumber) return\n state.callResults[chainId][callKey] = {\n data: results[callKey],\n blockNumber\n }\n })\n })\n)\n","import { configureStore, getDefaultMiddleware } from '@reduxjs/toolkit'\nimport { save, load } from 'redux-localstorage-simple'\n\nimport application from './application/reducer'\nimport { updateVersion } from './global/actions'\nimport user from './user/reducer'\nimport transactions from './transactions/reducer'\nimport swap from './swap/reducer'\nimport mint from './mint/reducer'\nimport lists from './lists/reducer'\nimport burn from './burn/reducer'\nimport multicall from './multicall/reducer'\nimport toasts from './toasts'\nimport { getThemeCache } from '../utils/theme'\n\ntype MergedState = {\n user: {\n [key: string]: any\n }\n transactions: {\n [key: string]: any\n }\n}\nconst PERSISTED_KEYS: string[] = ['user', 'transactions']\nconst loadedState = load({ states: PERSISTED_KEYS }) as MergedState\nif (loadedState.user) {\n loadedState.user.userDarkMode = getThemeCache()\n}\n\nconst store = configureStore({\n reducer: {\n application,\n user,\n transactions,\n swap,\n mint,\n burn,\n multicall,\n lists,\n toasts\n },\n middleware: [...getDefaultMiddleware({ thunk: false }), save({ states: PERSISTED_KEYS })],\n preloadedState: loadedState,\n})\n\nstore.dispatch(updateVersion())\n\nexport default store\n\nexport type AppState = ReturnType\nexport type AppDispatch = typeof store.dispatch\n","import { Web3Provider } from '@ethersproject/providers'\n\nexport default function getLibrary(provider: any): Web3Provider {\n const library = new Web3Provider(provider)\n library.pollingInterval = 15000\n return library\n}\n","import React from 'react'\nimport { createWeb3ReactRoot, Web3ReactProvider } from '@web3-react/core'\nimport { Provider } from 'react-redux'\nimport { ModalProvider } from '@pancakeswap-libs/uikit'\nimport { NetworkContextName } from './constants'\nimport store from './state'\nimport getLibrary from './utils/getLibrary'\nimport { ThemeContextProvider } from './ThemeContext'\n\nconst Web3ProviderNetwork = createWeb3ReactRoot(NetworkContextName)\n\nconst Providers: React.FC = ({ children }) => {\n return (\n \n \n \n \n {children}\n \n \n \n \n )\n}\n\nexport default Providers\n","import i18next from 'i18next'\nimport { initReactI18next } from 'react-i18next'\nimport XHR from 'i18next-xhr-backend'\nimport LanguageDetector from 'i18next-browser-languagedetector'\n\ni18next\n .use(XHR)\n .use(LanguageDetector)\n .use(initReactI18next)\n .init({\n backend: {\n loadPath: `./locales/{{lng}}.json`\n },\n react: {\n useSuspense: true\n },\n fallbackLng: 'en',\n preload: ['en'],\n keySeparator: false,\n interpolation: { escapeValue: false }\n })\n\nexport default i18next\n","import React, { StrictMode } from 'react'\nimport ReactDOM from 'react-dom'\nimport { ResetCSS } from '@pancakeswap-libs/uikit'\nimport GlobalStyle from './style/Global'\nimport App from './pages/App'\nimport ApplicationUpdater from './state/application/updater'\nimport ListsUpdater from './state/lists/updater'\nimport MulticallUpdater from './state/multicall/updater'\nimport TransactionUpdater from './state/transactions/updater'\nimport ToastListener from './components/ToastListener'\nimport Providers from './Providers'\nimport 'inter-ui'\nimport './i18n'\n\nif ('ethereum' in window) {\n (window.ethereum as any).autoRefreshOnNetworkChange = false\n}\n\nwindow.addEventListener('error', () => {\n localStorage?.removeItem('redux_localstorage_simple_lists')\n})\n\nReactDOM.render(\n \n \n <>\n \n \n \n \n \n \n \n \n \n \n ,\n document.getElementById('root')\n)\n"],"sourceRoot":""} \ No newline at end of file diff --git a/pancake-swap-interface-v1/build/static/js/main.814ff23e.chunk.js b/pancake-swap-interface-v1/build/static/js/main.814ff23e.chunk.js new file mode 100644 index 0000000..5ccc12f --- /dev/null +++ b/pancake-swap-interface-v1/build/static/js/main.814ff23e.chunk.js @@ -0,0 +1,2 @@ +(this["webpackJsonp@pancakeswap/interface"]=this["webpackJsonp@pancakeswap/interface"]||[]).push([[1],{114:function(e){e.exports=JSON.parse('[{"constant":true,"inputs":[],"name":"name","outputs":[{"name":"","type":"string"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"_spender","type":"address"},{"name":"_value","type":"uint256"}],"name":"approve","outputs":[{"name":"","type":"bool"}],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"totalSupply","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"_from","type":"address"},{"name":"_to","type":"address"},{"name":"_value","type":"uint256"}],"name":"transferFrom","outputs":[{"name":"","type":"bool"}],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"decimals","outputs":[{"name":"","type":"uint8"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"name":"_owner","type":"address"}],"name":"balanceOf","outputs":[{"name":"balance","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"symbol","outputs":[{"name":"","type":"string"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"_to","type":"address"},{"name":"_value","type":"uint256"}],"name":"transfer","outputs":[{"name":"","type":"bool"}],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[{"name":"_owner","type":"address"},{"name":"_spender","type":"address"}],"name":"allowance","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"payable":true,"stateMutability":"payable","type":"fallback"},{"anonymous":false,"inputs":[{"indexed":true,"name":"owner","type":"address"},{"indexed":true,"name":"spender","type":"address"},{"indexed":false,"name":"value","type":"uint256"}],"name":"Approval","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"name":"from","type":"address"},{"indexed":true,"name":"to","type":"address"},{"indexed":false,"name":"value","type":"uint256"}],"name":"Transfer","type":"event"}]')},146:function(e){e.exports=JSON.parse('{"name":"PancakeSwap Default List","timestamp":"2021-03-17T09:56:23Z","version":{"major":2,"minor":10,"patch":0},"tags":{},"logoURI":"https://exchange.pancakeswap.finance/images/pancakeswap.png","keywords":["pancake","default"],"tokens":[{"name":"WBNB Token","symbol":"WBNB","address":"0x0dE8FCAE8421fc79B29adE9ffF97854a424Cad09","chainId":97,"decimals":18,"logoURI":"https://exchange.pancakeswap.finance/images/coins/0xbb4cdb9cbd36b01bd1cbaebf2de08d9173bc095c.png"},{"name":"Bakery Token","symbol":"BAKE","address":"0xb289b361a633A9D2b0B39BAE76BB458d83f58CEC","chainId":97,"decimals":18,"logoURI":"https://exchange.pancakeswap.finance/images/coins/0xe02df9e3e622debdd69fb838bb799e3f168902c5.png"},{"name":"BUSD Token","symbol":"BUSD","address":"0xE0dFffc2E01A7f051069649aD4eb3F518430B6a4","chainId":97,"decimals":18,"logoURI":"https://exchange.pancakeswap.finance/images/coins/0xe9e7cea3dedca5984780bafc599bd69add087d56.png"},{"name":"Ethereum Token","symbol":"ETH","address":"0xE282a15DBad45e3131620C1b8AF85B7330Cb3b4B","chainId":97,"decimals":18,"logoURI":"https://exchange.pancakeswap.finance/images/coins/0x2170ed0880ac9a755fd29b2688956bd959f933f8.png"},{"name":"Tether USD","symbol":"USDT","address":"0x7afd064DaE94d73ee37d19ff2D264f5A2903bBB0","chainId":97,"decimals":18,"logoURI":"https://exchange.pancakeswap.finance/images/coins/0x55d398326f99059ff775485246999027b3197955.png"},{"name":"XRP Token","symbol":"XRP","address":"0x3833B175Af1900b457cf83B839727AF6C9cF0bEe","chainId":97,"decimals":18,"logoURI":"https://exchange.pancakeswap.finance/images/coins/0x1d2f0da169ceb9fc7b3144628db156f3f6c60dbe.png"},{"name":"Dai Token","symbol":"DAI","address":"0x3Cf204795c4995cCf9C1a0B3191F00c01B03C56C","chainId":97,"decimals":18,"logoURI":"https://exchange.pancakeswap.finance/images/coins/0x1af3f329e8be154074d8769d1ffa4ee058b1dbc3.png"},{"name":"PancakeSwap Token","symbol":"CAKE","address":"0xB8F5B50ed77596b5E638359d828000747bb3dd89","chainId":97,"decimals":18,"logoURI":"https://exchange.pancakeswap.finance/images/coins/0x0e09fabb73bd3ade0a17ecc321fd13a19e81ce82.png"}]}')},199:function(e){e.exports=JSON.parse('[{"constant":true,"inputs":[],"name":"name","outputs":[{"name":"","type":"bytes32"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"symbol","outputs":[{"name":"","type":"bytes32"}],"payable":false,"stateMutability":"view","type":"function"}]')},200:function(e){e.exports=JSON.parse('[{"constant":true,"inputs":[],"name":"getCurrentBlockTimestamp","outputs":[{"name":"timestamp","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"components":[{"name":"target","type":"address"},{"name":"callData","type":"bytes"}],"name":"calls","type":"tuple[]"}],"name":"aggregate","outputs":[{"name":"blockNumber","type":"uint256"},{"name":"returnData","type":"bytes[]"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"getLastBlockHash","outputs":[{"name":"blockHash","type":"bytes32"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"name":"addr","type":"address"}],"name":"getEthBalance","outputs":[{"name":"balance","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"getCurrentBlockDifficulty","outputs":[{"name":"difficulty","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"getCurrentBlockGasLimit","outputs":[{"name":"gaslimit","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"getCurrentBlockCoinbase","outputs":[{"name":"coinbase","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"name":"blockNumber","type":"uint256"}],"name":"getBlockHash","outputs":[{"name":"blockHash","type":"bytes32"}],"payable":false,"stateMutability":"view","type":"function"}]')},229:function(e){e.exports=JSON.parse('[{"inputs":[{"internalType":"contract ENS","name":"_old","type":"address"}],"payable":false,"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":true,"internalType":"address","name":"operator","type":"address"},{"indexed":false,"internalType":"bool","name":"approved","type":"bool"}],"name":"ApprovalForAll","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"node","type":"bytes32"},{"indexed":true,"internalType":"bytes32","name":"label","type":"bytes32"},{"indexed":false,"internalType":"address","name":"owner","type":"address"}],"name":"NewOwner","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"node","type":"bytes32"},{"indexed":false,"internalType":"address","name":"resolver","type":"address"}],"name":"NewResolver","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"node","type":"bytes32"},{"indexed":false,"internalType":"uint64","name":"ttl","type":"uint64"}],"name":"NewTTL","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"node","type":"bytes32"},{"indexed":false,"internalType":"address","name":"owner","type":"address"}],"name":"Transfer","type":"event"},{"constant":true,"inputs":[{"internalType":"address","name":"owner","type":"address"},{"internalType":"address","name":"operator","type":"address"}],"name":"isApprovedForAll","outputs":[{"internalType":"bool","name":"","type":"bool"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"old","outputs":[{"internalType":"contract ENS","name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"internalType":"bytes32","name":"node","type":"bytes32"}],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"internalType":"bytes32","name":"node","type":"bytes32"}],"name":"recordExists","outputs":[{"internalType":"bool","name":"","type":"bool"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"internalType":"bytes32","name":"node","type":"bytes32"}],"name":"resolver","outputs":[{"internalType":"address","name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"internalType":"address","name":"operator","type":"address"},{"internalType":"bool","name":"approved","type":"bool"}],"name":"setApprovalForAll","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"internalType":"bytes32","name":"node","type":"bytes32"},{"internalType":"address","name":"owner","type":"address"}],"name":"setOwner","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"internalType":"bytes32","name":"node","type":"bytes32"},{"internalType":"address","name":"owner","type":"address"},{"internalType":"address","name":"resolver","type":"address"},{"internalType":"uint64","name":"ttl","type":"uint64"}],"name":"setRecord","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"internalType":"bytes32","name":"node","type":"bytes32"},{"internalType":"address","name":"resolver","type":"address"}],"name":"setResolver","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"internalType":"bytes32","name":"node","type":"bytes32"},{"internalType":"bytes32","name":"label","type":"bytes32"},{"internalType":"address","name":"owner","type":"address"}],"name":"setSubnodeOwner","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"internalType":"bytes32","name":"node","type":"bytes32"},{"internalType":"bytes32","name":"label","type":"bytes32"},{"internalType":"address","name":"owner","type":"address"},{"internalType":"address","name":"resolver","type":"address"},{"internalType":"uint64","name":"ttl","type":"uint64"}],"name":"setSubnodeRecord","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"internalType":"bytes32","name":"node","type":"bytes32"},{"internalType":"uint64","name":"ttl","type":"uint64"}],"name":"setTTL","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[{"internalType":"bytes32","name":"node","type":"bytes32"}],"name":"ttl","outputs":[{"internalType":"uint64","name":"","type":"uint64"}],"payable":false,"stateMutability":"view","type":"function"}]')},230:function(e){e.exports=JSON.parse('[{"inputs":[{"internalType":"contract ENS","name":"_ens","type":"address"}],"payable":false,"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"node","type":"bytes32"},{"indexed":true,"internalType":"uint256","name":"contentType","type":"uint256"}],"name":"ABIChanged","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"node","type":"bytes32"},{"indexed":false,"internalType":"address","name":"a","type":"address"}],"name":"AddrChanged","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"node","type":"bytes32"},{"indexed":false,"internalType":"uint256","name":"coinType","type":"uint256"},{"indexed":false,"internalType":"bytes","name":"newAddress","type":"bytes"}],"name":"AddressChanged","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"node","type":"bytes32"},{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":true,"internalType":"address","name":"target","type":"address"},{"indexed":false,"internalType":"bool","name":"isAuthorised","type":"bool"}],"name":"AuthorisationChanged","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"node","type":"bytes32"},{"indexed":false,"internalType":"bytes","name":"hash","type":"bytes"}],"name":"ContenthashChanged","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"node","type":"bytes32"},{"indexed":false,"internalType":"bytes","name":"name","type":"bytes"},{"indexed":false,"internalType":"uint16","name":"resource","type":"uint16"},{"indexed":false,"internalType":"bytes","name":"record","type":"bytes"}],"name":"DNSRecordChanged","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"node","type":"bytes32"},{"indexed":false,"internalType":"bytes","name":"name","type":"bytes"},{"indexed":false,"internalType":"uint16","name":"resource","type":"uint16"}],"name":"DNSRecordDeleted","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"node","type":"bytes32"}],"name":"DNSZoneCleared","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"node","type":"bytes32"},{"indexed":true,"internalType":"bytes4","name":"interfaceID","type":"bytes4"},{"indexed":false,"internalType":"address","name":"implementer","type":"address"}],"name":"InterfaceChanged","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"node","type":"bytes32"},{"indexed":false,"internalType":"string","name":"name","type":"string"}],"name":"NameChanged","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"node","type":"bytes32"},{"indexed":false,"internalType":"bytes32","name":"x","type":"bytes32"},{"indexed":false,"internalType":"bytes32","name":"y","type":"bytes32"}],"name":"PubkeyChanged","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"node","type":"bytes32"},{"indexed":true,"internalType":"string","name":"indexedKey","type":"string"},{"indexed":false,"internalType":"string","name":"key","type":"string"}],"name":"TextChanged","type":"event"},{"constant":true,"inputs":[{"internalType":"bytes32","name":"node","type":"bytes32"},{"internalType":"uint256","name":"contentTypes","type":"uint256"}],"name":"ABI","outputs":[{"internalType":"uint256","name":"","type":"uint256"},{"internalType":"bytes","name":"","type":"bytes"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"internalType":"bytes32","name":"node","type":"bytes32"}],"name":"addr","outputs":[{"internalType":"address payable","name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"internalType":"bytes32","name":"","type":"bytes32"},{"internalType":"address","name":"","type":"address"},{"internalType":"address","name":"","type":"address"}],"name":"authorisations","outputs":[{"internalType":"bool","name":"","type":"bool"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"internalType":"bytes32","name":"node","type":"bytes32"}],"name":"clearDNSZone","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[{"internalType":"bytes32","name":"node","type":"bytes32"}],"name":"contenthash","outputs":[{"internalType":"bytes","name":"","type":"bytes"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"internalType":"bytes32","name":"node","type":"bytes32"},{"internalType":"bytes32","name":"name","type":"bytes32"},{"internalType":"uint16","name":"resource","type":"uint16"}],"name":"dnsRecord","outputs":[{"internalType":"bytes","name":"","type":"bytes"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"internalType":"bytes32","name":"node","type":"bytes32"},{"internalType":"bytes32","name":"name","type":"bytes32"}],"name":"hasDNSRecords","outputs":[{"internalType":"bool","name":"","type":"bool"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"internalType":"bytes32","name":"node","type":"bytes32"},{"internalType":"bytes4","name":"interfaceID","type":"bytes4"}],"name":"interfaceImplementer","outputs":[{"internalType":"address","name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"internalType":"bytes32","name":"node","type":"bytes32"}],"name":"name","outputs":[{"internalType":"string","name":"","type":"string"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"internalType":"bytes32","name":"node","type":"bytes32"}],"name":"pubkey","outputs":[{"internalType":"bytes32","name":"x","type":"bytes32"},{"internalType":"bytes32","name":"y","type":"bytes32"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"internalType":"bytes32","name":"node","type":"bytes32"},{"internalType":"uint256","name":"contentType","type":"uint256"},{"internalType":"bytes","name":"data","type":"bytes"}],"name":"setABI","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"internalType":"bytes32","name":"node","type":"bytes32"},{"internalType":"uint256","name":"coinType","type":"uint256"},{"internalType":"bytes","name":"a","type":"bytes"}],"name":"setAddr","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"internalType":"bytes32","name":"node","type":"bytes32"},{"internalType":"address","name":"a","type":"address"}],"name":"setAddr","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"internalType":"bytes32","name":"node","type":"bytes32"},{"internalType":"address","name":"target","type":"address"},{"internalType":"bool","name":"isAuthorised","type":"bool"}],"name":"setAuthorisation","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"internalType":"bytes32","name":"node","type":"bytes32"},{"internalType":"bytes","name":"hash","type":"bytes"}],"name":"setContenthash","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"internalType":"bytes32","name":"node","type":"bytes32"},{"internalType":"bytes","name":"data","type":"bytes"}],"name":"setDNSRecords","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"internalType":"bytes32","name":"node","type":"bytes32"},{"internalType":"bytes4","name":"interfaceID","type":"bytes4"},{"internalType":"address","name":"implementer","type":"address"}],"name":"setInterface","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"internalType":"bytes32","name":"node","type":"bytes32"},{"internalType":"string","name":"name","type":"string"}],"name":"setName","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"internalType":"bytes32","name":"node","type":"bytes32"},{"internalType":"bytes32","name":"x","type":"bytes32"},{"internalType":"bytes32","name":"y","type":"bytes32"}],"name":"setPubkey","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"internalType":"bytes32","name":"node","type":"bytes32"},{"internalType":"string","name":"key","type":"string"},{"internalType":"string","name":"value","type":"string"}],"name":"setText","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[{"internalType":"bytes4","name":"interfaceID","type":"bytes4"}],"name":"supportsInterface","outputs":[{"internalType":"bool","name":"","type":"bool"}],"payable":false,"stateMutability":"pure","type":"function"},{"constant":true,"inputs":[{"internalType":"bytes32","name":"node","type":"bytes32"},{"internalType":"string","name":"key","type":"string"}],"name":"text","outputs":[{"internalType":"string","name":"","type":"string"}],"payable":false,"stateMutability":"view","type":"function"}]')},231:function(e){e.exports=JSON.parse('[{"constant":true,"inputs":[],"name":"name","outputs":[{"name":"","type":"string"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"guy","type":"address"},{"name":"wad","type":"uint256"}],"name":"approve","outputs":[{"name":"","type":"bool"}],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"totalSupply","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"src","type":"address"},{"name":"dst","type":"address"},{"name":"wad","type":"uint256"}],"name":"transferFrom","outputs":[{"name":"","type":"bool"}],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"wad","type":"uint256"}],"name":"withdraw","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"decimals","outputs":[{"name":"","type":"uint8"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"name":"","type":"address"}],"name":"balanceOf","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"symbol","outputs":[{"name":"","type":"string"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"dst","type":"address"},{"name":"wad","type":"uint256"}],"name":"transfer","outputs":[{"name":"","type":"bool"}],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[],"name":"deposit","outputs":[],"payable":true,"stateMutability":"payable","type":"function"},{"constant":true,"inputs":[{"name":"","type":"address"},{"name":"","type":"address"}],"name":"allowance","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"payable":true,"stateMutability":"payable","type":"fallback"},{"anonymous":false,"inputs":[{"indexed":true,"name":"src","type":"address"},{"indexed":true,"name":"guy","type":"address"},{"indexed":false,"name":"wad","type":"uint256"}],"name":"Approval","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"name":"src","type":"address"},{"indexed":true,"name":"dst","type":"address"},{"indexed":false,"name":"wad","type":"uint256"}],"name":"Transfer","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"name":"dst","type":"address"},{"indexed":false,"name":"wad","type":"uint256"}],"name":"Deposit","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"name":"src","type":"address"},{"indexed":false,"name":"wad","type":"uint256"}],"name":"Withdrawal","type":"event"}]')},310:function(e,n){},410:function(e,n,t){"use strict";t.r(n);var r=t(1),i=t(0),a=t.n(i),c=t(73),o=t.n(c),s=t(2),u=t(9),l=t(4);function d(){var e=Object(u.a)(["\n body {\n background-color: ",";\n\n img {\n height: auto;\n max-width: 100%;\n }\n }\n"]);return d=function(){return e},e}var b,p=Object(l.createGlobalStyle)(d(),(function(e){return e.theme.colors.background})),f=t(11),j=t(38),h=t(39),v=t(21),m=t(51),O=t(117),y=t(17),x=t(167),g=t(118),C=t(119),w=t(221),k=t(136),T=t(12),I=t(7),E=t.n(I),N=t(120),S=t(32),R=t(10),U=t(14),A=t(15),z=t(122),B=t(78),P=t(20),M=function(e){Object(U.a)(t,e);var n=Object(A.a)(t);function t(e,r,i){var a;return Object(R.a)(this,t),(a=n.call(this,e)).code=r,a.data=i,a}return t}(Object(z.a)(Error)),D=function e(n,t,r){var i=this;Object(R.a)(this,e),this.isMetaMask=!1,this.chainId=void 0,this.url=void 0,this.host=void 0,this.path=void 0,this.batchWaitTimeMs=void 0,this.nextId=1,this.batchTimeoutId=null,this.batch=[],this.clearBatch=Object(S.a)(E.a.mark((function e(){var n,t,r,a,c,o,s,u,l,d,b,p,f,j;return E.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=i.batch,i.batch=[],i.batchTimeoutId=null,e.prev=3,e.next=6,fetch(i.url,{method:"POST",headers:{"content-type":"application/json",accept:"application/json"},body:JSON.stringify(n.map((function(e){return e.request})))});case 6:t=e.sent,e.next=13;break;case 9:return e.prev=9,e.t0=e.catch(3),n.forEach((function(e){return(0,e.reject)(new Error("Failed to send batch call"))})),e.abrupt("return");case 13:if(t.ok){e.next=16;break}return n.forEach((function(e){return(0,e.reject)(new M("".concat(t.status,": ").concat(t.statusText),-32e3))})),e.abrupt("return");case 16:return e.prev=16,e.next=19,t.json();case 19:r=e.sent,e.next=26;break;case 22:return e.prev=22,e.t1=e.catch(16),n.forEach((function(e){return(0,e.reject)(new Error("Failed to parse JSON response"))})),e.abrupt("return");case 26:a=n.reduce((function(e,n){return e[n.request.id]=n,e}),{}),c=Object(N.a)(r);try{for(c.s();!(o=c.n()).done;)s=o.value,u=a[s.id],l=u.resolve,d=u.reject,b=u.request.method,l&&d&&("error"in s?d(new M(null===s||void 0===s||null===(p=s.error)||void 0===p?void 0:p.message,null===s||void 0===s||null===(f=s.error)||void 0===f?void 0:f.code,null===s||void 0===s||null===(j=s.error)||void 0===j?void 0:j.data)):"result"in s?l(s.result):d(new M("Received unexpected JSON-RPC response to ".concat(b," request."),-32e3,s)))}catch(h){c.e(h)}finally{c.f()}case 29:case"end":return e.stop()}}),e,null,[[3,9],[16,22]])}))),this.sendAsync=function(e,n){i.request(e.method,e.params).then((function(t){return n(null,{jsonrpc:"2.0",id:e.id,result:t})})).catch((function(e){return n(e,null)}))},this.request=function(){var e=Object(S.a)(E.a.mark((function e(n,t){var r,a;return E.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if("string"===typeof n){e.next=2;break}return e.abrupt("return",i.request(n.method,n.params));case 2:if("eth_chainId"!==n){e.next=4;break}return e.abrupt("return","0x".concat(i.chainId.toString(16)));case 4:return a=new Promise((function(e,r){i.batch.push({request:{jsonrpc:"2.0",id:i.nextId++,method:n,params:t},resolve:e,reject:r})})),i.batchTimeoutId=null!==(r=i.batchTimeoutId)&&void 0!==r?r:setTimeout(i.clearBatch,i.batchWaitTimeMs),e.abrupt("return",a);case 7:case"end":return e.stop()}}),e)})));return function(n,t){return e.apply(this,arguments)}}(),this.chainId=n,this.url=t;var a=new URL(t);this.host=a.host,this.path=a.pathname,this.batchWaitTimeMs=null!==r&&void 0!==r?r:50},L=function(e){Object(U.a)(t,e);var n=Object(A.a)(t);function t(e){var r,i=e.urls,a=e.defaultChainId;return Object(R.a)(this,t),Object(P.a)(a||1===Object.keys(i).length,"defaultChainId is a required argument with >1 url"),(r=n.call(this,{supportedChainIds:Object.keys(i).map((function(e){return Number(e)}))})).providers=void 0,r.currentChainId=void 0,r.currentChainId=a||Number(Object.keys(i)[0]),r.providers=Object.keys(i).reduce((function(e,n){return e[Number(n)]=new D(Number(n),i[Number(n)]),e}),{}),r}return Object(T.a)(t,[{key:"activate",value:function(){var e=Object(S.a)(E.a.mark((function e(){return E.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",{provider:this.providers[this.currentChainId],chainId:this.currentChainId,account:null});case 1:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()},{key:"getProvider",value:function(){var e=Object(S.a)(E.a.mark((function e(){return E.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.providers[this.currentChainId]);case 1:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()},{key:"getChainId",value:function(){var e=Object(S.a)(E.a.mark((function e(){return E.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.currentChainId);case 1:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()},{key:"getAccount",value:function(){var e=Object(S.a)(E.a.mark((function e(){return E.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",null);case 1:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}()},{key:"deactivate",value:function(){return null}},{key:"provider",get:function(){return this.providers[this.currentChainId]}}]),t}(B.AbstractConnector),_="https://bsc-dataseed1.defibit.io",Y=parseInt(null!=="56"?"56":"97");var F,q=new L({urls:Object(y.a)({},Y,_),defaultChainId:Y});var V,W=new g.a({supportedChainIds:[97]}),H=new k.BscConnector({supportedChainIds:[97]}),Q=new C.b({rpc:Object(y.a)({},Y,_),bridge:"https://bridge.walletconnect.org",qrcode:!0,pollingInterval:15e3}),G=(new w.a({url:_,appName:"Uniswap",appLogoUrl:"https://mpng.pngfly.com/20181202/bex/kisspng-emoji-domain-unicorn-pin-badges-sticker-unicorn-tumblr-emoji-unicorn-iphoneemoji-5c046729264a77.5671679315437924251569.jpg"}),b={},Object(y.a)(b,s.l.Injected,W),Object(y.a)(b,s.l.WalletConnect,Q),Object(y.a)(b,s.l.BSC,H),b),K=t(27),X=t(13),J=t(5),$="0xCc7aDc94F3D80127849D2b41b6439b7CF1eB4Ae0",Z=new J.j(J.a.BSCTESTNET,"0xB8F5B50ed77596b5E638359d828000747bb3dd89",18,"CAKE","PancakeSwap Token"),ee=new J.j(J.a.BSCTESTNET,"0x0dE8FCAE8421fc79B29adE9ffF97854a424Cad09",18,"WBNB","Wrapped BNB"),ne=new J.j(J.a.BSCTESTNET,"0x3Cf204795c4995cCf9C1a0B3191F00c01B03C56C",18,"DAI","Dai Stablecoin"),te=new J.j(J.a.BSCTESTNET,"0xE0dFffc2E01A7f051069649aD4eb3F518430B6a4",18,"BUSD","Binance USD"),re=new J.j(J.a.BSCTESTNET,"0x7afd064DaE94d73ee37d19ff2D264f5A2903bBB0",18,"USDT","Tether USD"),ie=new J.j(J.a.BSCTESTNET,"0xE282a15DBad45e3131620C1b8AF85B7330Cb3b4B",18,"ETH","Binance-Peg Ethereum Token"),ae=(V={},Object(y.a)(V,J.a.MAINNET,[J.n[J.a.MAINNET]]),Object(y.a)(V,J.a.BSCTESTNET,[J.n[J.a.BSCTESTNET]]),V),ce=Object(X.a)(Object(X.a)({},ae),{},Object(y.a)({},J.a.BSCTESTNET,[].concat(Object(K.a)(ae[J.a.BSCTESTNET]),[ne,te,re,ie]))),oe=Object(y.a)({},J.a.BSCTESTNET,{}),se=Object(X.a)(Object(X.a)({},ae),{},Object(y.a)({},J.a.BSCTESTNET,[].concat(Object(K.a)(ae[J.a.BSCTESTNET]),[ne,te,re]))),ue=Object(X.a)(Object(X.a)({},ae),{},Object(y.a)({},J.a.BSCTESTNET,[].concat(Object(K.a)(ae[J.a.BSCTESTNET]),[ne,te,re]))),le=Object(y.a)({},J.a.BSCTESTNET,[[Z,ee],[te,re],[ne,re]]),de="NETWORK",be=80,pe=1200,fe=new J.g(J.e.BigInt(1),J.e.BigInt(1e4)),je=J.e.BigInt(1e4),he=new J.g(J.e.BigInt(100),je),ve=new J.g(J.e.BigInt(300),je),me=new J.g(J.e.BigInt(500),je),Oe=new J.g(J.e.BigInt(1e3),je),ye=new J.g(J.e.BigInt(1500),je),xe=J.e.exponentiate(J.e.BigInt(10),J.e.BigInt(16));function ge(){var e=Object(m.d)(),n=Object(m.d)(de);return e.active?e:n}var Ce=t(22),we=Object(Ce.b)("app/updateBlockNumber"),ke=Object(Ce.b)("app/toggleWalletModal"),Te=Object(Ce.b)("app/toggleSettingsMenu"),Ie=Object(Ce.b)("app/addPopup"),Ee=Object(Ce.b)("app/removePopup");function Ne(){var e=ge().chainId;return Object(v.d)((function(n){return n.application.blockNumber[null!==e&&void 0!==e?e:-1]}))}function Se(){var e=Object(v.c)();return Object(i.useCallback)((function(n){e(Ee({key:n}))}),[e])}function Re(){var e=Object(u.a)(["\n display: grid;\n grid-auto-rows: auto;\n grid-row-gap: ",";\n justify-items: ",";\n"]);return Re=function(){return e},e}function Ue(){var e=Object(u.a)(["\n width: 100%;\n align-items: center;\n"]);return Ue=function(){return e},e}function Ae(){var e=Object(u.a)(["\n display: flex;\n flex-direction: column;\n justify-content: flex-start;\n"]);return Ae=function(){return e},e}var ze=l.default.div(Ae()),Be=Object(l.default)(ze)(Ue()),Pe=l.default.div(Re(),(function(e){var n=e.gap;return("sm"===n?"8px":"md"===n&&"12px")||"lg"===n&&"24px"||n}),(function(e){var n=e.justify;return n&&n})),Me=ze,De=t(426),Le=t(89),_e=t(61),Ye={pending:Object(Ce.b)("lists/fetchTokenList/pending"),fulfilled:Object(Ce.b)("lists/fetchTokenList/fulfilled"),rejected:Object(Ce.b)("lists/fetchTokenList/rejected")},Fe=Object(Ce.b)("lists/acceptListUpdate"),qe=Object(Ce.b)("lists/addList"),Ve=Object(Ce.b)("lists/removeList"),We=Object(Ce.b)("lists/selectList");Object(Ce.b)("lists/rejectVersionUpdate");function He(e){return"v".concat(e.major,".").concat(e.minor,".").concat(e.patch)}var Qe=t(225);function Ge(){var e=Object(u.a)(["\n width: fit-content;\n margin: ",";\n"]);return Ge=function(){return e},e}function Ke(){var e=Object(u.a)(["\n flex-wrap: wrap;\n margin: ",";\n justify-content: ",";\n\n & > * {\n margin: "," !important;\n }\n"]);return Ke=function(){return e},e}function Xe(){var e=Object(u.a)(["\n display: flex;\n align-items: flex-end;\n"]);return Xe=function(){return e},e}function Je(){var e=Object(u.a)(["\n justify-content: space-between;\n"]);return Je=function(){return e},e}function $e(){var e=Object(u.a)(["\n width: 100%;\n display: flex;\n padding: 0;\n align-items: ",";\n padding: ",";\n border: ",";\n border-radius: ",";\n"]);return $e=function(){return e},e}var Ze=Object(l.default)(Qe.Box)($e(),(function(e){return e.align||"center"}),(function(e){return e.padding}),(function(e){return e.border}),(function(e){return e.borderRadius})),en=Object(l.default)(Ze)(Je()),nn=l.default.div(Xe()),tn=Object(l.default)(Ze)(Ke(),(function(e){var n=e.gap;return n&&"-".concat(n)}),(function(e){var n=e.justify;return n&&n}),(function(e){return e.gap})),rn=Object(l.default)(Ze)(Ge(),(function(e){var n=e.gap;return n&&"-".concat(n)})),an=Ze;function cn(e){var n=e.popKey,t=e.listUrl,c=e.oldList,o=e.newList,u=e.auto,l=Se(),d=Object(i.useCallback)((function(){return l(n)}),[n,l]),b=Object(v.c)(),p=Object(i.useCallback)((function(){u||(b(Fe(t)),d())}),[u,b,t,d]),f=Object(i.useMemo)((function(){return Object(_e.b)(c.tokens,o.tokens)}),[o.tokens,c.tokens]),j=f.added,h=f.changed,m=f.removed,O=Object(i.useMemo)((function(){return Object.keys(h).reduce((function(e,n){return e+Object.keys(h[n]).length}),0)}),[h]);return Object(r.jsx)(tn,{children:Object(r.jsx)(Pe,{style:{flex:"1"},gap:"8px",children:u?Object(r.jsxs)(s.z,{children:['The token list "',c.name,'" has been updated to'," ",Object(r.jsx)("strong",{children:He(o.version)}),"."]}):Object(r.jsxs)(r.Fragment,{children:[Object(r.jsxs)("div",{children:[Object(r.jsxs)(s.z,{fontSize:"14px",children:['An update is available for the token list "',c.name,'" (',He(c.version)," to ",He(o.version),")."]}),Object(r.jsxs)("ul",{children:[j.length>0?Object(r.jsxs)("li",{children:[j.map((function(e,n){return Object(r.jsxs)(a.a.Fragment,{children:[Object(r.jsx)("strong",{title:e.address,children:e.symbol}),n===j.length-1?null:", "]},"".concat(e.chainId,"-").concat(e.address))}))," ","added"]}):null,m.length>0?Object(r.jsxs)("li",{children:[m.map((function(e,n){return Object(r.jsxs)(a.a.Fragment,{children:[Object(r.jsx)("strong",{title:e.address,children:e.symbol}),n===m.length-1?null:", "]},"".concat(e.chainId,"-").concat(e.address))}))," ","removed"]}):null,O>0?Object(r.jsxs)("li",{children:[O," tokens updated"]}):null]})]}),Object(r.jsxs)(tn,{children:[Object(r.jsx)("div",{style:{flexGrow:1,marginRight:12},children:Object(r.jsx)(s.d,{onClick:p,children:"Accept update"})}),Object(r.jsx)("div",{style:{flexGrow:1},children:Object(r.jsx)(s.d,{onClick:d,children:"Dismiss"})})]})]})})})}var on=t(424),sn=t(425),un=t(90),ln=t(30),dn=t(413),bn=t(24),pn=t(226);function fn(e){try{return Object(ln.getAddress)(e)}catch(n){return!1}}var jn={56:"",97:"testnet."};function hn(e,n,t){var r="https://".concat(jn[e]||jn[J.a.MAINNET],"bscscan.com");switch(t){case"transaction":return"".concat(r,"/tx/").concat(n);case"token":return"".concat(r,"/token/").concat(n);case"address":default:return"".concat(r,"/address/").concat(n)}}function vn(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:4,t=fn(e);if(!t)throw Error("Invalid 'address' parameter '".concat(e,"'."));return"".concat(t.substring(0,n+2),"...").concat(t.substring(42-n))}function mn(e){return e.mul(bn.a.from(1e4).add(bn.a.from(1e3))).div(bn.a.from(1e4))}function On(e,n){if(n<0||n>1e4)throw Error("Unexpected slippage value: ".concat(n));return[J.e.divide(J.e.multiply(e.raw,J.e.BigInt(1e4-n)),J.e.BigInt(1e4)),J.e.divide(J.e.multiply(e.raw,J.e.BigInt(1e4+n)),J.e.BigInt(1e4))]}function yn(e,n,t,r){if(!fn(e)||e===dn.a)throw Error("Invalid 'address' parameter '".concat(e,"'."));return new un.a(e,n,function(e,n){return n?function(e,n){return e.getSigner(n).connectUnchecked()}(e,n):e}(t,r))}function xn(e,n,t){return yn($,pn.a,n,t)}var gn=t(53);function Cn(){var e=Object(u.a)(["\n animation: 2s "," linear infinite;\n width: 16px;\n height: 16px;\n"]);return Cn=function(){return e},e}function wn(){var e=Object(u.a)(["\n from {\n transform: rotate(0deg);\n }\n to {\n transform: rotate(360deg);\n }\n"]);return wn=function(){return e},e}function kn(){var e=Object(u.a)(["\n text-decoration: none;\n cursor: pointer;\n color: ",";\n font-weight: 500;\n\n :hover {\n text-decoration: underline;\n }\n\n :focus {\n outline: none;\n text-decoration: underline;\n }\n\n :active {\n text-decoration: none;\n }\n"]);return kn=function(){return e},e}function Tn(){var e=Object(u.a)(["\n text-decoration: none;\n cursor: pointer;\n color: ",";\n font-weight: 500;\n\n :hover {\n text-decoration: underline;\n }\n\n :focus {\n outline: none;\n text-decoration: underline;\n }\n\n :active {\n text-decoration: none;\n }\n"]);return Tn=function(){return e},e}function In(){var e=Object(u.a)(["\n border: none;\n text-decoration: none;\n background: none;\n\n cursor: ",";\n color: ",";\n font-weight: 500;\n\n :hover {\n text-decoration: ",";\n }\n\n :focus {\n outline: none;\n text-decoration: ",";\n }\n\n :active {\n text-decoration: none;\n }\n"]);return In=function(){return e},e}var En=l.default.button(In(),(function(e){return e.disabled?"default":"pointer"}),(function(e){var n=e.theme;return e.disabled?n.colors.textSubtle:n.colors.primary}),(function(e){return e.disabled?null:"underline"}),(function(e){return e.disabled?null:"underline"})),Nn=Object(l.default)(j.b)(Tn(),(function(e){return e.theme.colors.primary})),Sn=l.default.a(kn(),(function(e){return e.theme.colors.primary}));function Rn(e){var n=e.target,t=void 0===n?"_blank":n,a=e.href,c=e.rel,o=void 0===c?"noopener noreferrer":c,s=Object(gn.a)(e,["target","href","rel"]),u=Object(i.useCallback)((function(e){"_blank"===t||e.ctrlKey||e.metaKey||e.preventDefault()}),[t]);return Object(r.jsx)(Sn,Object(X.a)({target:t,rel:o,href:a,onClick:u},s))}var Un=Object(l.keyframes)(wn()),An=l.default.img(Cn(),Un);function zn(){var e=Object(u.a)(["\n flex-wrap: nowrap;\n"]);return zn=function(){return e},e}var Bn=Object(l.default)(tn)(zn());function Pn(e){var n=e.hash,t=e.success,a=e.summary,c=ge().chainId,o=Object(i.useContext)(l.ThemeContext);return Object(r.jsxs)(Bn,{children:[Object(r.jsx)("div",{style:{paddingRight:16},children:t?Object(r.jsx)(on.a,{color:o.colors.success,size:24}):Object(r.jsx)(sn.a,{color:o.colors.failure,size:24})}),Object(r.jsxs)(Pe,{gap:"8px",children:[Object(r.jsx)(s.z,{children:null!==a&&void 0!==a?a:"Hash: ".concat(n.slice(0,8),"...").concat(n.slice(58,65))}),c&&Object(r.jsx)(Rn,{href:hn(c,n,"transaction"),children:"View on bscscan"})]})]})}function Mn(){var e=Object(u.a)(["\n position: absolute;\n bottom: 0px;\n left: 0px;\n width: 100%;\n height: 2px;\n background-color: ",";\n"]);return Mn=function(){return e},e}function Dn(){var e=Object(u.a)(["\n display: inline-block;\n width: 100%;\n padding: 1em;\n background-color: ",";\n position: relative;\n border-radius: 10px;\n padding: 20px;\n padding-right: 35px;\n overflow: hidden;\n\n "," {\n min-width: 290px;\n }\n"]);return Dn=function(){return e},e}function Ln(){var e=Object(u.a)(["\n position: absolute;\n right: 10px;\n top: 10px;\n\n :hover {\n cursor: pointer;\n }\n"]);return Ln=function(){return e},e}var _n=Object(l.default)(De.a)(Ln()),Yn=l.default.div(Dn(),(function(e){return e.theme.colors.invertedContrast}),(function(e){return e.theme.mediaQueries.sm})),Fn=l.default.div(Mn(),(function(e){return e.theme.colors.tertiary})),qn=Object(Le.a)(Fn);function Vn(e){var n=e.removeAfterMs,t=e.content,a=e.popKey,c=Se(),o=Object(i.useCallback)((function(){return c(a)}),[a,c]);Object(i.useEffect)((function(){if(null!==n){var e=setTimeout((function(){o()}),n);return function(){clearTimeout(e)}}}),[n,o]);var s,u=Object(i.useContext)(l.ThemeContext);if("txn"in t){var d=t.txn,b=d.hash,p=d.success,f=d.summary;s=Object(r.jsx)(Pn,{hash:b,success:p,summary:f})}else if("listUpdate"in t){var j=t.listUpdate,h=j.listUrl,v=j.oldList,m=j.newList,O=j.auto;s=Object(r.jsx)(cn,{popKey:a,listUrl:h,oldList:v,newList:m,auto:O})}var y=Object(Le.b)({from:{width:"100%"},to:{width:"0%"},config:{duration:null!==n&&void 0!==n?n:void 0}});return Object(r.jsxs)(Yn,{children:[Object(r.jsx)(_n,{color:u.colors.textSubtle,onClick:o}),s,null!==n?Object(r.jsx)(qn,{style:y}):null]})}function Wn(){var e=Object(u.a)(["\n position: fixed;\n top: 64px;\n right: 1rem;\n max-width: 355px !important;\n width: 100%;\n z-index: 2;\n\n "," {\n display: none;\n }\n"]);return Wn=function(){return e},e}function Hn(){var e=Object(u.a)(["\n height: 99%;\n overflow-x: auto;\n overflow-y: hidden;\n display: flex;\n flex-direction: row;\n -webkit-overflow-scrolling: touch;\n ::-webkit-scrollbar {\n display: none;\n }\n"]);return Hn=function(){return e},e}function Qn(){var e=Object(u.a)(["\n position: relative;\n max-width: 100%;\n height: ",";\n margin: ",";\n margin-bottom: ","};\n display: none;\n\n "," {\n display: block;\n }\n"]);return Qn=function(){return e},e}var Gn=l.default.div(Qn(),(function(e){return e.height}),(function(e){return e.height?"0 auto;":0}),(function(e){return e.height?"20px":0}),(function(e){return e.theme.mediaQueries.sm})),Kn=l.default.div(Hn()),Xn=Object(l.default)(Pe)(Wn(),(function(e){return e.theme.mediaQueries.sm}));function Jn(){var e=function(){var e=Object(v.d)((function(e){return e.application.popupList}));return Object(i.useMemo)((function(){return e.filter((function(e){return e.show}))}),[e])}();return Object(r.jsxs)(r.Fragment,{children:[Object(r.jsx)(Xn,{gap:"20px",children:e.map((function(e){return Object(r.jsx)(Vn,{content:e.content,popKey:e.key,removeAfterMs:e.removeAfterMs},e.key)}))}),Object(r.jsx)(Gn,{height:(null===e||void 0===e?void 0:e.length)>0?"fit-content":0,children:Object(r.jsx)(Kn,{children:e.slice(0).reverse().map((function(e){return Object(r.jsx)(Vn,{content:e.content,popKey:e.key,removeAfterMs:e.removeAfterMs},e.key)}))})})]})}var $n=t(104);function Zn(){var e=Object(u.a)(["\n animation: 2s "," linear infinite;\n height: ",";\n width: ",";\n path {\n stroke: ",";\n }\n"]);return Zn=function(){return e},e}function et(){var e=Object(u.a)(["\n from {\n transform: rotate(0deg);\n }\n to {\n transform: rotate(360deg);\n }\n"]);return et=function(){return e},e}var nt=Object(l.keyframes)(et()),tt=l.default.svg(Zn(),nt,(function(e){return e.size}),(function(e){return e.size}),(function(e){var n=e.stroke,t=e.theme;return null!==n&&void 0!==n?n:t.colors.primary}));function rt(e){var n=e.size,t=void 0===n?"16px":n,i=e.stroke,a=Object(gn.a)(e,["size","stroke"]);return Object(r.jsx)(tt,Object(X.a)(Object(X.a)({viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",size:t,stroke:i},a),{},{children:Object(r.jsx)("path",{d:"M12 2C6.47715 2 2 6.47715 2 12C2 17.5228 6.47715 22 12 22C17.5228 22 22 17.5228 22 12C22 9.27455 20.9097 6.80375 19.1414 5",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round"})}))}function it(){var e=Object(u.a)(["\n color: ",";\n"]);return it=function(){return e},e}function at(){var e=Object(u.a)(["\n display: flex;\n align-items: center;\n justify-content: center;\n height: 20rem;\n"]);return at=function(){return e},e}var ct=l.default.div(at()),ot=l.default.h2(it(),(function(e){return e.theme.colors.primaryDark}));function st(e){var n=e.children,t=Object($n.b)().t,a=Object(m.d)().active,c=Object(m.d)(de),o=c.active,u=c.error,l=c.activate,d=function(){var e=Object(m.d)(),n=e.activate,t=e.active,r=Object(i.useState)(!1),a=Object(f.a)(r,2),c=a[0],o=a[1];return Object(i.useEffect)((function(){W.isAuthorized().then((function(e){var t=window.localStorage.getItem(s.C);e&&t||O.isMobile&&window.ethereum&&t?n(W,void 0,!0).catch((function(){o(!0)})):o(!0)}))}),[n]),Object(i.useEffect)((function(){t&&o(!0)}),[t]),c}();Object(i.useEffect)((function(){!d||o||u||a||l(q)}),[d,o,u,l,a]),function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],n=Object(m.d)(),t=n.active,r=n.error,a=n.activate;Object(i.useEffect)((function(){var n=window.ethereum;if(n&&n.on&&!t&&!r&&!e){var i=function(){a(W,void 0,!0).catch((function(e){console.error("Failed to activate after chain changed",e)}))},c=function(e){e.length>0&&a(W,void 0,!0).catch((function(e){console.error("Failed to activate after accounts changed",e)}))};return n.on("chainChanged",i),n.on("accountsChanged",c),function(){n.removeListener&&(n.removeListener("chainChanged",i),n.removeListener("accountsChanged",c))}}}),[t,r,e,a])}(!d);var b=Object(i.useState)(!1),p=Object(f.a)(b,2),j=p[0],h=p[1];return Object(i.useEffect)((function(){var e=setTimeout((function(){h(!0)}),600);return function(){clearTimeout(e)}}),[]),d?!a&&u?Object(r.jsx)(ct,{children:Object(r.jsx)(ot,{children:t("unknownError")})}):a||o?n:j?Object(r.jsx)(ct,{children:Object(r.jsx)(rt,{})}):null:null}function ut(){var e=Object(u.a)(["\n background-color: ",";\n"]);return ut=function(){return e},e}function lt(){var e=Object(u.a)(["\n border: 1px solid ",";\n background-color: ",";\n"]);return lt=function(){return e},e}function dt(){var e=Object(u.a)(["\n width: 100%;\n border-radius: 16px;\n padding: 1.25rem;\n padding: ",";\n border: ",";\n border-radius: ",";\n"]);return dt=function(){return e},e}var bt=l.default.div(dt(),(function(e){return e.padding}),(function(e){return e.border}),(function(e){return e.borderRadius})),pt=bt,ft=Object(l.default)(bt)(lt(),(function(e){return e.theme.colors.invertedContrast}),(function(e){return e.theme.colors.invertedContrast})),jt=Object(l.default)(bt)(ut(),(function(e){return e.theme.colors.tertiary})),ht=t(176),vt=(t(332),t(49));function mt(){var e=Object(u.a)(["\n min-height: ","vh;\n "]);return mt=function(){return e},e}function Ot(){var e=Object(u.a)(["\n max-height: ","vh;\n "]);return Ot=function(){return e},e}function yt(){var e=Object(u.a)(["\n &[data-reach-dialog-content] {\n margin: 0 0 2rem 0;\n border: 1px solid ",";\n background-color: ",";\n box-shadow: 0 4px 8px 0 ",";\n padding: 0px;\n width: 80%;\n overflow: hidden;\n\n align-self: ",";\n\n max-width: 420px;\n ","\n ","\n display: flex;\n border-radius: 20px;\n\n "," {\n width: 65vw;\n }\n "," {\n width: 85vw;\n }\n }\n"]);return yt=function(){return e},e}function xt(){var e=Object(u.a)(["\n &[data-reach-dialog-overlay] {\n z-index: 2;\n background-color: transparent;\n overflow: hidden;\n\n display: flex;\n align-items: center;\n justify-content: center;\n\n background-color: rgba(0, 0, 0, 0.3);\n }\n"]);return xt=function(){return e},e}var gt=Object(Le.a)(ht.b),Ct=Object(l.default)(gt)(xt()),wt=Object(Le.a)(ht.a),kt=Object(l.default)((function(e){e.minHeight,e.maxHeight,e.mobile,e.isOpen;var n=Object(gn.a)(e,["minHeight","maxHeight","mobile","isOpen"]);return Object(r.jsx)(wt,Object(X.a)({},n))})).attrs({"aria-label":"dialog"})(yt(),(function(e){return e.theme.colors.invertedContrast}),(function(e){return e.theme.colors.invertedContrast}),Object(vt.b)(.95,"#191326"),(function(e){return e.mobile?"flex-end":"center"}),(function(e){var n=e.maxHeight;return n&&Object(l.css)(Ot(),n)}),(function(e){var n=e.minHeight;return n&&Object(l.css)(mt(),n)}),(function(e){return e.theme.mediaQueries.lg}),(function(e){return e.theme.mediaQueries.sm}));function Tt(e){var n=e.isOpen,t=e.onDismiss,i=e.minHeight,a=void 0!==i&&i,c=e.maxHeight,o=void 0===c?50:c,s=e.initialFocusRef,u=e.children,l=Object(Le.c)(n,null,{config:{duration:200},from:{opacity:0},enter:{opacity:1},leave:{opacity:0}});return Object(r.jsx)(r.Fragment,{children:l.map((function(e){var n=e.item,i=e.key,c=e.props;return n&&Object(r.jsx)(Ct,{style:c,onDismiss:t,initialFocusRef:s,children:Object(r.jsxs)(kt,{"aria-label":"dialog content",minHeight:a,maxHeight:o,mobile:O.isMobile,children:[!s&&O.isMobile?Object(r.jsx)("div",{tabIndex:1}):null,u]})},i)}))})}function It(){var e=Object(u.a)(["\n align-items: center;\n display: flex;\n\n & > "," {\n flex: 1;\n }\n"]);return It=function(){return e},e}function Et(){var e=Object(u.a)(["\n background-color: ",";\n border-bottom-left-radius: 20px;\n border-bottom-right-radius: 20px;\n"]);return Et=function(){return e},e}function Nt(){var e=Object(u.a)(["\n padding: 40px 0;\n"]);return Nt=function(){return e},e}function St(){var e=Object(u.a)(["\n padding: 24px;\n"]);return St=function(){return e},e}function Rt(){var e=Object(u.a)(["\n width: 100%;\n overflow-y: auto;\n"]);return Rt=function(){return e},e}var Ut=l.default.div(Rt()),At=Object(l.default)(Pe)(St()),zt=Object(l.default)(Be)(Nt()),Bt=Object(l.default)(At)(Et(),(function(e){return e.theme.colors.invertedContrast})),Pt=l.default.div(It(),s.o),Mt=function(e){var n=e.children,t=e.onDismiss;return Object(r.jsxs)(Pt,{children:[Object(r.jsx)(s.o,{children:n}),Object(r.jsx)(s.q,{onClick:t,variant:"text",children:Object(r.jsx)(s.k,{color:"primary"})})]})};function Dt(){var e=Object(u.a)(["\n height: ",";\n width: ",";\n"]);return Dt=function(){return e},e}var Lt=Object(l.default)(An)(Dt(),(function(e){return e.size}),(function(e){return e.size})),_t=function(e){var n=e.onDismiss,t=e.pendingText;return Object(r.jsx)(Ut,{children:Object(r.jsxs)(At,{children:[Object(r.jsx)(Mt,{onDismiss:n,children:"Waiting for confirmation"}),Object(r.jsx)(zt,{children:Object(r.jsx)(Lt,{src:"/images/blue-loader.svg",alt:"loader",size:"90px"})}),Object(r.jsxs)(Pe,{gap:"12px",justify:"center",children:[Object(r.jsx)(Pe,{gap:"12px",justify:"center",children:Object(r.jsx)(s.z,{fontSize:"14px",children:Object(r.jsx)("strong",{children:t})})}),Object(r.jsx)(s.z,{fontSize:"14px",children:"Confirm this transaction in your wallet"})]})]})})},Yt=t(427),Ft=function(e){var n=e.onDismiss,t=e.chainId,a=e.hash,c=Object(i.useContext)(l.ThemeContext);return Object(r.jsx)(Ut,{children:Object(r.jsxs)(At,{children:[Object(r.jsx)(Mt,{onDismiss:n,children:"Transaction submitted"}),Object(r.jsx)(zt,{children:Object(r.jsx)(Yt.a,{strokeWidth:.5,size:97,color:c.colors.primary})}),Object(r.jsxs)(Pe,{gap:"8px",justify:"center",children:[t&&a&&Object(r.jsx)(s.s,{href:hn(t,a,"transaction"),children:"View on BscScan"}),Object(r.jsx)(s.d,{onClick:n,mt:"20px",children:"Close"})]})]})})},qt=function(e){var n=e.isOpen,t=e.onDismiss,i=e.attemptingTxn,a=e.hash,c=e.pendingText,o=e.content,s=ge().chainId;return s?Object(r.jsx)(Tt,{isOpen:n,onDismiss:t,maxHeight:90,children:i?Object(r.jsx)(_t,{onDismiss:t,pendingText:c}):a?Object(r.jsx)(Ft,{chainId:s,hash:a,onDismiss:t}):o()}):null},Vt=function(e){var n=e.title,t=e.bottomContent,i=e.onDismiss,a=e.topContent;return Object(r.jsxs)(Ut,{children:[Object(r.jsxs)(At,{children:[Object(r.jsx)(Mt,{onDismiss:i,children:n}),a()]}),Object(r.jsx)(Bt,{gap:"12px",children:t()})]})},Wt=t(428),Ht=function(e){var n=e.message,t=e.onDismiss,a=Object(i.useContext)(l.ThemeContext);return Object(r.jsxs)(Ut,{children:[Object(r.jsxs)(At,{children:[Object(r.jsx)(Mt,{onDismiss:t,children:"Error"}),Object(r.jsxs)(Pe,{style:{marginTop:20,padding:"2rem 0"},gap:"24px",justify:"center",children:[Object(r.jsx)(Wt.a,{color:a.colors.failure,style:{strokeWidth:1.5},size:64}),Object(r.jsx)(s.z,{fontSize:"16px",color:"failure",style:{textAlign:"center",width:"85%"},children:n})]})]}),Object(r.jsx)(Bt,{gap:"12px",children:Object(r.jsx)(s.d,{onClick:t,children:"Dismiss"})})]})},Qt=qt,Gt={translations:[],setTranslations:function(){}},Kt=Object(i.createContext)(Gt),Xt=/%(.*?)%/,Jt=function(e,n,t){var r=e.find((function(e){return e.data.stringId===n}));if(r){var i=r.data.text;return i.includes("%")?function(e,n){var t=Xt.exec(e)[0],r=e.split(" ").indexOf(t),i=n.split(" ")[r];return e.replace(t,i)}(i,t):i}return t},$t=function(e,n){var t=Object(i.useContext)(Kt).translations;return"error"===t[0]||0===t.length?n:t.length>0?Jt(t,e,n):null},Zt=function(){var e=Object(i.useContext)(Kt).translations;return Object(i.useCallback)((function(n,t){return"error"===e[0]?t:e.length>0?Jt(e,n,t):t}),[e])};function er(){var e=Object(u.a)(["\n margin-bottom: 40px;\n"]);return er=function(){return e},e}var nr=l.default.div(er());var tr,rr=function(e){var n=e.activeIndex,t=void 0===n?0:n,i=Zt();return Object(r.jsx)(nr,{children:Object(r.jsxs)(s.e,{activeIndex:t,scale:"sm",variant:"subtle",children:[Object(r.jsx)(s.f,{id:"swap-nav-link",to:"/swap",as:j.b,children:i(1142,"Swap")}),Object(r.jsx)(s.f,{id:"pool-nav-link",to:"/pool",as:j.b,children:i(262,"Liquidity")}),Object(r.jsx)(s.f,{id:"pool-nav-link",as:"a",href:"https://www.binance.org/en/bridge?utm_source=PancakeSwap",target:"_blank",rel:"noreferrer noopener",children:"Bridge"})]})})},ir=t(110),ar=t(114),cr=t(199),or=new ir.b(ar),sr=t(156),ur=function(e){Object(U.a)(t,e);var n=Object(A.a)(t);function t(e,r){var i;return Object(R.a)(this,t),(i=n.call(this,e.chainId,e.address,e.decimals,e.symbol,e.name)).tokenInfo=void 0,i.tags=void 0,i.tokenInfo=e,i.tags=r,i}return Object(T.a)(t,[{key:"logoURI",get:function(){return this.tokenInfo.logoURI}}]),t}(J.j),lr=(tr={},Object(y.a)(tr,J.a.MAINNET,{}),Object(y.a)(tr,J.a.BSCTESTNET,{}),tr),dr="undefined"!==typeof WeakMap?new WeakMap:null;function br(e){var n=Object(v.d)((function(e){return e.lists.byUrl}));return Object(i.useMemo)((function(){var t;if(!e)return lr;var r=null===(t=n[e])||void 0===t?void 0:t.current;if(!r)return lr;try{return function(e){var n=null===dr||void 0===dr?void 0:dr.get(e);if(n)return n;var t=e.tokens.reduce((function(n,t){var r,i,a,c=null!==(r=null===(i=t.tags)||void 0===i||null===(a=i.map((function(n){var t;if(null===(t=e.tags)||void 0===t?void 0:t[n])return Object(X.a)(Object(X.a)({},e.tags[n]),{},{id:n})})))||void 0===a?void 0:a.filter((function(e){return Boolean(e)})))&&void 0!==r?r:[],o=new ur(t,c);if(void 0!==n[o.chainId][o.address])throw Error("Duplicate tokens.");return Object(X.a)(Object(X.a)({},n),{},Object(y.a)({},o.chainId,Object(X.a)(Object(X.a)({},n[o.chainId]),{},Object(y.a)({},o.address,o))))}),Object(X.a)({},lr));return null===dr||void 0===dr||dr.set(e,t),t}(r)}catch(i){return console.error("Could not show token list due to error",i),lr}}),[n,e])}function pr(){return Object(v.d)((function(e){return e.lists.selectedListUrl}))}function fr(){return br(pr())}var jr=/^0x[a-fA-F0-9]{40}$/,hr=/^0x[a-f0-9]*$/;function vr(e){if(!jr.test(e.address))throw new Error("Invalid address: ".concat(e.address));if(!hr.test(e.callData))throw new Error("Invalid hex: ".concat(e.callData));return"".concat(e.address,"-").concat(e.callData)}function mr(e){var n=e.split("-");if(2!==n.length)throw new Error("Invalid call key: ".concat(e));return{address:n[0],callData:n[1]}}var Or=Object(Ce.b)("multicall/addMulticallListeners"),yr=Object(Ce.b)("multicall/removeMulticallListeners"),xr=Object(Ce.b)("multicall/fetchingMulticallResults"),gr=Object(Ce.b)("multicall/errorFetchingMulticallResults"),Cr=Object(Ce.b)("multicall/updateMulticallResults");function wr(e){return-1!==["string","number"].indexOf(typeof e)}function kr(e){return void 0===e||Array.isArray(e)&&e.every((function(e){return wr(e)||Array.isArray(e)&&e.every(wr)}))}var Tr={valid:!1,blockNumber:void 0,data:void 0},Ir={blocksPerFetch:1/0};function Er(e,n){var t=ge().chainId,r=Object(v.d)((function(e){return e.multicall.callResults})),a=Object(v.c)(),c=Object(i.useMemo)((function(){var n,t,r;return JSON.stringify(null!==(n=null===e||void 0===e||null===(t=e.filter((function(e){return Boolean(e)})))||void 0===t||null===(r=t.map(vr))||void 0===r?void 0:r.sort())&&void 0!==n?n:[])}),[e]);return Object(i.useEffect)((function(){var e=JSON.parse(c);if(t&&0!==e.length){var r=e.map((function(e){return mr(e)}));return a(Or({chainId:t,calls:r,options:n})),function(){a(yr({chainId:t,calls:r,options:n}))}}}),[t,a,n,c]),Object(i.useMemo)((function(){return e.map((function(e){var n;if(!t||!e)return Tr;var i=null===(n=r[t])||void 0===n?void 0:n[vr(e)];return{valid:!0,data:(null===i||void 0===i?void 0:i.data)&&"0x"!==(null===i||void 0===i?void 0:i.data)?i.data:null,blockNumber:null===i||void 0===i?void 0:i.blockNumber}}))}),[r,e,t])}var Nr={valid:!1,result:void 0,loading:!1,syncing:!1,error:!1},Sr={valid:!0,result:void 0,loading:!0,syncing:!0,error:!1};function Rr(e,n,t,r){if(!e)return Nr;var i=e.valid,a=e.data,c=e.blockNumber;if(!i)return Nr;if(i&&!c)return Sr;if(!n||!t||!r)return Sr;var o,s=a&&a.length>2,u=(null!==c&&void 0!==c?c:0)0&&o?e.map((function(e){return e&&o?{address:e,callData:o}:void 0})):[]}),[e,o,c]),a),u=Ne();return Object(i.useMemo)((function(){return s.map((function(e){return Rr(e,n,c,u)}))}),[c,s,n,u])}function Ar(e,n,t,r){var a=Object(i.useMemo)((function(){var t;return null===e||void 0===e||null===(t=e.interface)||void 0===t?void 0:t.getFunction(n)}),[e,n]),c=Er(Object(i.useMemo)((function(){return e&&a&&kr(t)?[{address:e.address,callData:e.interface.encodeFunctionData(a,t)}]:[]}),[e,a,t]),r)[0],o=Ne();return Object(i.useMemo)((function(){return Rr(c,null===e||void 0===e?void 0:e.interface,a,o)}),[c,e,a,o])}var zr=t(135),Br=t.n(zr),Pr=Object(Ce.b)("user/updateMatchesDarkMode"),Mr=Object(Ce.b)("user/updateUserDarkMode"),Dr=Object(Ce.b)("user/updateUserExpertMode"),Lr=Object(Ce.b)("user/updateUserSlippageTolerance"),_r=Object(Ce.b)("user/updateUserDeadline"),Yr=Object(Ce.b)("user/addSerializedToken"),Fr=Object(Ce.b)("user/removeSerializedToken"),qr=Object(Ce.b)("user/addSerializedPair"),Vr=Object(Ce.b)("user/removeSerializedPair"),Wr=Object(Ce.b)("user/muteAudio"),Hr=Object(Ce.b)("user/unmuteAudio"),Qr="IS_DARK";function Gr(e){return{chainId:e.chainId,address:e.address,decimals:e.decimals,symbol:e.symbol,name:e.name}}function Kr(e){return new J.j(e.chainId,e.address,e.decimals,e.symbol,e.name)}function Xr(){return Object(v.d)((function(e){return e.user.userExpertMode}))}function Jr(){var e=Object(v.c)();return[Object(v.d)((function(e){return e.user.userSlippageTolerance})),Object(i.useCallback)((function(n){e(Lr({userSlippageTolerance:n}))}),[e])]}function $r(){var e=Object(v.c)();return[Object(v.d)((function(e){return e.user.userDeadline})),Object(i.useCallback)((function(n){e(_r({userDeadline:n}))}),[e])]}function Zr(){var e=ge().chainId,n=Object(v.d)((function(e){return e.user.tokens}));return Object(i.useMemo)((function(){var t;return e?Object.values(null!==(t=n[e])&&void 0!==t?t:{}).map(Kr):[]}),[n,e])}function ei(e){return{token0:Gr(e.token0),token1:Gr(e.token1)}}function ni(e){var n=Object(f.a)(e,2),t=n[0],r=n[1];return new J.j(t.chainId,J.f.getAddress(t,r),18,"Cake-LP","Pancake LPs")}var ti,ri=t(144),ii=t(229),ai=t(230),ci=t(231),oi=t(200),si=(ti={},Object(y.a)(ti,J.a.MAINNET,"0x1Ee38d535d541c55C9dae27B12edf090C608E6Fb"),Object(y.a)(ti,J.a.BSCTESTNET,"0x301907b5835a2d723Fe3e9E8C5Bc5375d5c1236A"),ti);function ui(e,n){var t=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],r=ge(),a=r.library,c=r.account;return Object(i.useMemo)((function(){if(!e||!n||!a)return null;try{return yn(e,n,a,t&&c?c:void 0)}catch(r){return console.error("Failed to get contract",r),null}}),[e,n,a,t,c])}function li(e,n){return ui(e,ar,n)}function di(e){var n=ge().chainId;if(n)switch(n){case J.a.MAINNET:case J.a.BSCTESTNET:}return ui(undefined,ii,e)}function bi(e,n){return ui(e,ai,n)}function pi(){var e=ge().chainId;return ui(e&&si[e],oi,!1)}function fi(){var e=ge().chainId,n=Zr(),t=fr();return Object(i.useMemo)((function(){return e?n.reduce((function(e,n){return e[n.address]=n,e}),Object(X.a)({},t[e])):{}}),[e,n,t])}var ji=/^0x[a-fA-F0-9]{64}$/;function hi(e,n,t){return e&&e.length>0?e:n&&ji.test(n)?Object(sr.b)(n):t}function vi(e){var n=ge().chainId,t=fi(),r=fn(e),a=li(r||void 0,!1),c=function(e,n){return ui(e,cr,n)}(r||void 0,!1),o=r?t[r]:void 0,s=Ar(o?void 0:a,"name",void 0,Ir),u=Ar(o?void 0:c,"name",void 0,Ir),l=Ar(o?void 0:a,"symbol",void 0,Ir),d=Ar(o?void 0:c,"symbol",void 0,Ir),b=Ar(o?void 0:a,"decimals",void 0,Ir);return Object(i.useMemo)((function(){if(o)return o;if(n&&r){if(b.loading||l.loading||s.loading)return null;var e,t,i,a;if(b.result)return new J.j(n,r,b.result[0],hi(null===(e=l.result)||void 0===e?void 0:e[0],null===(t=d.result)||void 0===t?void 0:t[0],"UNKNOWN"),hi(null===(i=s.result)||void 0===i?void 0:i[0],null===(a=u.result)||void 0===a?void 0:a[0],"Unknown Token"))}}),[r,n,b.loading,b.result,l.loading,l.result,d.result,o,s.loading,s.result,u.result])}function mi(e){var n="BNB"===(null===e||void 0===e?void 0:e.toUpperCase()),t=vi(n?void 0:e);return n?J.d:t}function Oi(e){var n=pi(),t=Object(i.useMemo)((function(){return e?e.map(fn).filter((function(e){return!1!==e})).sort():[]}),[e]),r=function(e,n,t,r){var a=Object(i.useMemo)((function(){var t;return null===e||void 0===e||null===(t=e.interface)||void 0===t?void 0:t.getFunction(n)}),[e,n]),c=Er(Object(i.useMemo)((function(){return e&&a&&t&&t.length>0?t.map((function(n){return{address:e.address,callData:e.interface.encodeFunctionData(a,n)}})):[]}),[t,e,a]),r),o=Ne();return Object(i.useMemo)((function(){return c.map((function(n){return Rr(n,null===e||void 0===e?void 0:e.interface,a,o)}))}),[a,e,c,o])}(n,"getEthBalance",t.map((function(e){return[e]})));return Object(i.useMemo)((function(){return t.reduce((function(e,n,t){var i,a,c=null===r||void 0===r||null===(i=r[t])||void 0===i||null===(a=i.result)||void 0===a?void 0:a[0];return c&&(e[n]=J.c.ether(J.e.BigInt(c.toString()))),e}),{})}),[t,r])}function yi(e,n){var t=Object(i.useMemo)((function(){var e;return null!==(e=null===n||void 0===n?void 0:n.filter((function(e){return!1!==fn(null===e||void 0===e?void 0:e.address)})))&&void 0!==e?e:[]}),[n]),r=Ur(Object(i.useMemo)((function(){return t.map((function(e){return e.address}))}),[t]),or,"balanceOf",[e]),a=Object(i.useMemo)((function(){return r.some((function(e){return e.loading}))}),[r]);return[Object(i.useMemo)((function(){return e&&t.length>0?t.reduce((function(e,n,t){var i,a,c=null===r||void 0===r||null===(i=r[t])||void 0===i||null===(a=i.result)||void 0===a?void 0:a[0],o=c?J.e.BigInt(c.toString()):void 0;return o&&(e[n.address]=new J.k(n,o)),e}),{}):{}}),[e,t,r]),a]}function xi(e,n){return yi(e,n)[0]}function gi(e,n){var t=xi(e,[n]);if(n)return t[n.address]}function Ci(e,n){var t=Object(i.useMemo)((function(){var e;return null!==(e=null===n||void 0===n?void 0:n.filter((function(e){return e instanceof J.j})))&&void 0!==e?e:[]}),[n]),r=xi(e,t),a=Oi(Object(i.useMemo)((function(){var e;return null!==(e=null===n||void 0===n?void 0:n.some((function(e){return e===J.d})))&&void 0!==e&&e}),[n])?[e]:[]);return Object(i.useMemo)((function(){var t;return null!==(t=null===n||void 0===n?void 0:n.map((function(n){if(e&&n)return n instanceof J.j?r[n.address]:n===J.d?a[e]:void 0})))&&void 0!==t?t:[]}),[e,n,a,r])}function wi(e,n){return Ci(e,[n])[0]}function ki(e,n){var t=Object(i.useState)(n&&n(e)?e:void 0),r=Object(f.a)(t,2),a=r[0],c=r[1];return Object(i.useEffect)((function(){c((function(t){return!n||n(e)?e:t}))}),[n,e]),a}function Ti(e){return null!==e&&void 0!==e}var Ii=t(232),Ei=t(174),Ni=t.n(Ei),Si=t(121),Ri=t(103);var Ui=new TextDecoder;function Ai(e){var n=function(e){if((e=e.startsWith("0x")?e.substr(2):e).length%2!==0)throw new Error("hex must have length that is multiple of 2");for(var n=new Uint8Array(e.length/2),t=0;t2&&void 0!==arguments[2])||arguments[2],r=Object(i.useRef)();Object(i.useEffect)((function(){r.current=e}),[e]),Object(i.useEffect)((function(){function e(){var e=r.current;e&&e()}if(null!==n){t&&e();var i=setInterval(e,n);return function(){return clearInterval(i)}}}),[n,t])}function Ki(){var e=Object(u.a)(["\n width: 8px;\n height: 8px;\n z-index: 9998;\n\n ::before {\n position: absolute;\n width: 8px;\n height: 8px;\n z-index: 9998;\n\n content: '';\n border: 1px solid ",";\n transform: rotate(45deg);\n background: ",";\n }\n\n &.arrow-top {\n bottom: -5px;\n ::before {\n border-top: none;\n border-left: none;\n }\n }\n\n &.arrow-bottom {\n top: -5px;\n ::before {\n border-bottom: none;\n border-right: none;\n }\n }\n\n &.arrow-left {\n right: -5px;\n\n ::before {\n border-bottom: none;\n border-left: none;\n }\n }\n\n &.arrow-right {\n left: -5px;\n ::before {\n border-right: none;\n border-top: none;\n }\n }\n"]);return Ki=function(){return e},e}function Xi(){var e=Object(u.a)(["\n display: inline-block;\n"]);return Xi=function(){return e},e}function Ji(){var e=Object(u.a)(["\n z-index: 9999;\n\n visibility: ",";\n opacity: ",";\n transition: visibility 150ms linear, opacity 150ms linear;\n\n background: ",";\n border: 1px solid ",";\n box-shadow: 0 4px 8px 0 ",";\n color: ",";\n border-radius: 8px;\n"]);return Ji=function(){return e},e}var $i=l.default.div(Ji(),(function(e){return e.show?"visible":"hidden"}),(function(e){return e.show?1:0}),(function(e){return e.theme.colors.invertedContrast}),(function(e){return e.theme.colors.tertiary}),Object(vt.b)(.9,"#2F80ED"),(function(e){return e.theme.colors.textSubtle})),Zi=l.default.div(Xi()),ea=l.default.div(Ki(),(function(e){return e.theme.colors.tertiary}),(function(e){return e.theme.colors.invertedContrast}));function na(e){var n,t,a=e.content,c=e.show,o=e.children,s=e.placement,u=void 0===s?"auto":s,l=Object(i.useState)(null),d=Object(f.a)(l,2),b=d[0],p=d[1],j=Object(i.useState)(null),h=Object(f.a)(j,2),v=h[0],m=h[1],O=Object(i.useState)(null),y=Object(f.a)(O,2),x=y[0],g=y[1],C=Object(Hi.a)(b,v,{placement:u,strategy:"fixed",modifiers:[{name:"offset",options:{offset:[8,8]}},{name:"arrow",options:{element:x}}]}),w=C.styles,k=C.update,T=C.attributes;return Gi(Object(i.useCallback)((function(){k&&k()}),[k]),c?100:null),Object(r.jsxs)(r.Fragment,{children:[Object(r.jsx)(Zi,{ref:p,children:o}),Object(r.jsx)(Qi.a,{children:Object(r.jsxs)($i,Object(X.a)(Object(X.a)({show:c,ref:m,style:w.popper},T.popper),{},{children:[a,Object(r.jsx)(ea,Object(X.a)({className:"arrow-".concat(null!==(n=null===(t=T.popper)||void 0===t?void 0:t["data-popper-placement"])&&void 0!==n?n:""),ref:g,style:w.arrow},T.arrow))]}))})]})}function ta(){var e=Object(u.a)(["\n width: 228px;\n padding: 0.6rem 1rem;\n line-height: 150%;\n font-weight: 400;\n"]);return ta=function(){return e},e}var ra=l.default.div(ta());function ia(e){var n=e.text,t=Object(gn.a)(e,["text"]);return Object(r.jsx)(na,Object(X.a)({content:Object(r.jsx)(ra,{children:n})},t))}function aa(e){var n=e.children,t=Object(gn.a)(e,["children"]),a=Object(i.useState)(!1),c=Object(f.a)(a,2),o=c[0],s=c[1],u=Object(i.useCallback)((function(){return s(!0)}),[s]),l=Object(i.useCallback)((function(){return s(!1)}),[s]);return Object(r.jsx)(ia,Object(X.a)(Object(X.a)({},t),{},{show:o,children:Object(r.jsx)("div",{onMouseEnter:u,onMouseLeave:l,children:n})}))}function ca(){var e=Object(u.a)(["\n display: flex;\n align-items: center;\n justify-content: center;\n padding: 0.2rem;\n border: none;\n background: none;\n outline: none;\n cursor: default;\n border-radius: 36px;\n background-color: ",";\n color: ",";\n\n :hover,\n :focus {\n opacity: 0.7;\n }\n"]);return ca=function(){return e},e}var oa=l.default.div(ca(),(function(e){return e.theme.colors.invertedContrast}),(function(e){return e.theme.colors.textSubtle}));function sa(e){var n=e.text,t=Object(i.useState)(!1),a=Object(f.a)(t,2),c=a[0],o=a[1],s=Object(i.useCallback)((function(){return o(!0)}),[o]),u=Object(i.useCallback)((function(){return o(!1)}),[o]);return Object(r.jsx)("span",{style:{marginLeft:4},children:Object(r.jsx)(ia,{text:n,show:c,children:Object(r.jsx)(oa,{onClick:s,onMouseEnter:s,onMouseLeave:u,children:Object(r.jsx)(_i.a,{size:16})})})})}function ua(){var e=Object(u.a)(["\n width: ",";\n height: ",";\n"]);return ua=function(){return e},e}var la=Object(l.default)(Fi)(ua(),(function(e){return e.size}),(function(e){return e.size}));function da(){var e=Object(u.a)(["\n width: ",";\n height: ",";\n"]);return da=function(){return e},e}function ba(){var e=Object(u.a)(["\n width: ",";\n height: ",";\n box-shadow: 0px 6px 10px rgba(0, 0, 0, 0.075);\n border-radius: 24px;\n"]);return ba=function(){return e},e}var pa=function(e){return"https://raw.githubusercontent.com/trustwallet/assets/master/blockchains/smartchain/assets/".concat(e,"/logo.png")},fa=l.default.img(ba(),(function(e){return e.size}),(function(e){return e.size})),ja=Object(l.default)(Fi)(da(),(function(e){return e.size}),(function(e){return e.size}));function ha(e){var n,t,a=e.currency,c=e.size,o=void 0===c?"24px":c,s=e.style,u=Li(a instanceof ur?a.logoURI:void 0),l=Object(i.useMemo)((function(){return a===J.d?[]:a instanceof J.j?a instanceof ur?[].concat(Object(K.a)(u),["/images/coins/".concat(null!==(n=null===a||void 0===a?void 0:a.address)&&void 0!==n?n:"token",".png"),pa(a.address)]):["/images/coins/".concat(null!==(e=null===a||void 0===a?void 0:a.address)&&void 0!==e?e:"token",".png"),pa(a.address)]:[];var e,n}),[a,u]);return a===J.d?Object(r.jsx)(fa,{src:"/images/coins/bnb.png",size:o,style:s}):(null===a||void 0===a?void 0:a.symbol)?Object(r.jsx)(la,{size:o,srcs:l,alt:"".concat(null!==(n=null===a||void 0===a?void 0:a.symbol)&&void 0!==n?n:"token"," logo"),style:s}):Object(r.jsx)(ja,{size:o,srcs:l,alt:"".concat(null!==(t=null===a||void 0===a?void 0:a.symbol)&&void 0!==t?t:"token"," logo"),style:s})}function va(){var e=Object(u.a)(["\n border: 1px solid ",";\n border-radius: 10px;\n display: flex;\n padding: 6px;\n\n align-items: center;\n :hover {\n cursor: ",";\n background-color: ",";\n }\n\n background-color: ",";\n opacity: ",";\n"]);return va=function(){return e},e}var ma=l.default.div(va(),(function(e){var n=e.theme;return e.disable?"transparent":n.colors.tertiary}),(function(e){return!e.disable&&"pointer"}),(function(e){var n=e.theme;return!e.disable&&n.colors.invertedContrast}),(function(e){var n=e.theme;return e.disable&&n.colors.tertiary}),(function(e){return e.disable&&"0.4"}));function Oa(e){var n=e.chainId,t=e.onSelect,i=e.selectedCurrency,a=Zt();return Object(r.jsxs)(Pe,{gap:"md",children:[Object(r.jsxs)(tn,{children:[Object(r.jsx)(s.z,{fontSize:"14px",children:"Common bases"}),Object(r.jsx)(sa,{text:a(1204,"These tokens are commonly paired with other tokens.")})]}),Object(r.jsxs)(tn,{gap:"4px",children:[Object(r.jsxs)(ma,{onClick:function(){i&&Object(J.o)(i,J.d)||t(J.d)},disable:i===J.d,children:[Object(r.jsx)(ha,{currency:J.d,style:{marginRight:8}}),Object(r.jsx)(s.z,{children:"BNB"})]}),(n?se[n]:[]).map((function(e){var n=i instanceof J.j&&i.address===e.address;return Object(r.jsxs)(ma,{onClick:function(){return!n&&t(e)},disable:n,children:[Object(r.jsx)(ha,{currency:e,style:{marginRight:8}}),Object(r.jsx)(s.z,{children:e.symbol})]},e.address)}))]})]})}var ya=t(242);function xa(){var e=Object(u.a)(["\n width: 100%;\n height: 1px;\n background-color: ",";\n"]);return xa=function(){return e},e}function ga(){var e=Object(u.a)(["\n width: 100%;\n height: 1px;\n background-color: ",";\n"]);return ga=function(){return e},e}function Ca(){var e=Object(u.a)(["\n position: relative;\n display: flex;\n padding: 16px;\n align-items: center;\n width: 100%;\n white-space: nowrap;\n background: none;\n border: none;\n outline: none;\n border-radius: 20px;\n color: ",";\n border-style: solid;\n border: 1px solid ",";\n -webkit-appearance: none;\n\n font-size: 18px;\n\n ::placeholder {\n color: ",";\n }\n transition: border 100ms;\n :focus {\n border: 1px solid ",";\n outline: none;\n }\n"]);return Ca=function(){return e},e}function wa(){var e=Object(u.a)(["\n padding: 4px 20px;\n height: 56px;\n display: grid;\n grid-template-columns: auto minmax(auto, 1fr) auto minmax(0, 72px);\n grid-gap: 16px;\n cursor: ",";\n pointer-events: ",";\n :hover {\n background-color: ",";\n }\n opacity: ",";\n"]);return wa=function(){return e},e}function ka(){var e=Object(u.a)(["\n padding: 20px;\n padding-bottom: 12px;\n"]);return ka=function(){return e},e}function Ta(){var e=Object(u.a)(["\n color: ",";\n font-size: 14px;\n"]);return Ta=function(){return e},e}var Ia=Object(l.default)(rn)(Ta(),(function(e){return e.theme.colors.primary})),Ea=Object(l.default)(Pe)(ka()),Na=Object(l.default)(en)(wa(),(function(e){return!e.disabled&&"pointer"}),(function(e){return e.disabled&&"none"}),(function(e){var n=e.theme;return!e.disabled&&n.colors.invertedContrast}),(function(e){var n=e.disabled,t=e.selected;return n||t?.5:1})),Sa=l.default.input(Ca(),(function(e){return e.theme.colors.text}),(function(e){return e.theme.colors.tertiary}),(function(e){return e.theme.colors.textDisabled}),(function(e){return e.theme.colors.primary})),Ra=l.default.div(ga(),(function(e){return e.theme.colors.invertedContrast})),Ua=l.default.div(xa(),(function(e){return e.theme.colors.tertiary}));function Aa(){var e=Object(u.a)(["\n display: flex;\n justify-content: flex-end;\n"]);return Aa=function(){return e},e}function za(){var e=Object(u.a)(["\n background-color: ",";\n color: ",";\n font-size: 14px;\n border-radius: 4px;\n padding: 0.25rem 0.3rem 0.25rem 0.3rem;\n max-width: 6rem;\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n justify-self: flex-end;\n margin-right: 4px;\n"]);return za=function(){return e},e}function Ba(){var e=Object(u.a)(["\n white-space: nowrap;\n overflow: hidden;\n max-width: 5rem;\n text-overflow: ellipsis;\n"]);return Ba=function(){return e},e}function Pa(e){return e instanceof J.j?e.address:e===J.d?"ETHER":""}var Ma=Object(l.default)(s.z)(Ba()),Da=l.default.div(za(),(function(e){return e.theme.colors.tertiary}),(function(e){return e.theme.colors.textSubtle}));function La(e){var n=e.balance;return Object(r.jsx)(Ma,{title:n.toExact(),children:n.toSignificant(4)})}var _a=l.default.div(Aa());function Ya(e){var n=e.currency;if(!(n instanceof ur))return Object(r.jsx)("span",{});var t=n.tags;if(!t||0===t.length)return Object(r.jsx)("span",{});var i=t[0];return Object(r.jsxs)(_a,{children:[Object(r.jsx)(aa,{text:i.description,children:Object(r.jsx)(Da,{children:i.name},i.id)}),t.length>1?Object(r.jsx)(aa,{text:t.slice(1).map((function(e){var n=e.name,t=e.description;return"".concat(n,": ").concat(t)})).join("; \n"),children:Object(r.jsx)(Da,{children:"..."})}):null]})}function Fa(e){var n=e.currency,t=e.onSelect,a=e.isSelected,c=e.otherSelected,o=e.style,u=ge(),l=u.account,d=u.chainId,b=Pa(n),p=function(e,n){var t;return n===J.d||Boolean(n instanceof J.j&&(null===(t=e[n.chainId])||void 0===t?void 0:t[n.address]))}(fr(),n),f=function(e){return!!Zr().find((function(n){return Object(J.o)(e,n)}))}(n),j=wi(null!==l&&void 0!==l?l:void 0,n),h=function(){var e=Object(v.c)();return Object(i.useCallback)((function(n,t){e(Fr({chainId:n,address:t}))}),[e])}(),m=function(){var e=Object(v.c)();return Object(i.useCallback)((function(n){e(Yr({serializedToken:Gr(n)}))}),[e])}();return Object(r.jsxs)(Na,{style:o,className:"token-item-".concat(b),onClick:function(){return a?null:t()},disabled:a,selected:c,children:[Object(r.jsx)(ha,{currency:n,size:"24px"}),Object(r.jsxs)(Me,{children:[Object(r.jsx)(s.z,{title:n.name,children:n.symbol}),Object(r.jsxs)(Ia,{children:[p||!f||n instanceof ur?null:Object(r.jsxs)(s.z,{children:["Added by user",Object(r.jsx)(En,{onClick:function(e){e.stopPropagation(),d&&n instanceof J.j&&h(d,n.address)},children:"(Remove)"})]}),p||f||n instanceof ur?null:Object(r.jsxs)(s.z,{children:["Found by address",Object(r.jsx)(En,{onClick:function(e){e.stopPropagation(),n instanceof J.j&&m(n)},children:"(Add)"})]})]})]}),Object(r.jsx)(Ya,{currency:n}),Object(r.jsx)(rn,{style:{justifySelf:"flex-end"},children:j?Object(r.jsx)(La,{balance:j}):l?Object(r.jsx)(rt,{}):null})]})}function qa(e){var n=e.height,t=e.currencies,a=e.selectedCurrency,c=e.onCurrencySelect,o=e.otherCurrency,s=e.fixedListRef,u=e.showETH,l=Object(i.useMemo)((function(){return u?[J.b.ETHER].concat(Object(K.a)(t)):Object(K.a)(t)}),[t,u]),d=Object(i.useCallback)((function(e){var n=e.data,t=e.index,i=e.style,s=n[t],u=Boolean(a&&Object(J.o)(a,s)),l=Boolean(o&&Object(J.o)(o,s));return Object(r.jsx)(Fa,{style:i,currency:s,isSelected:u,onSelect:function(){return c(s)},otherSelected:l})}),[c,o,a]),b=Object(i.useCallback)((function(e,n){return Pa(n[e])}),[]);return Object(r.jsx)(ya.a,{height:n,ref:s,width:"100%",itemData:l,itemCount:l.length,itemSize:56,itemKey:b,children:d})}function Va(e,n){if(0===n.length)return e;var t=fn(n);if(t)return e.filter((function(e){return e.address===t}));var r=n.toLowerCase().split(/\s+/).filter((function(e){return e.length>0}));if(0===r.length)return e;var i=function(e){var n=e.toLowerCase().split(/\s+/).filter((function(e){return e.length>0}));return r.every((function(e){return 0===e.length||n.some((function(n){return n.startsWith(e)||n.endsWith(e)}))}))};return e.filter((function(e){var n=e.symbol,t=e.name;return n&&i(n)||t&&i(t)}))}function Wa(){var e=Object(u.a)(["\n padding: 8px;\n background-color: ",";\n color: ",";\n border-radius: 8px;\n user-select: none;\n & > * {\n user-select: none;\n }\n :hover {\n cursor: pointer;\n }\n"]);return Wa=function(){return e},e}var Ha=Object(l.default)(rn)(Wa(),(function(e){return e.theme.colors.invertedContrast}),(function(e){return e.theme.colors.text}));function Qa(e){var n=e.toggleSortOrder,t=e.ascending;return Object(r.jsx)(Ha,{onClick:n,children:Object(r.jsx)(s.z,{fontSize:"14px",children:t?"\u2191":"\u2193"})})}function Ga(e){var n=function(){var e=ge().account,n=fi(),t=xi(null!==e&&void 0!==e?e:void 0,Object(i.useMemo)((function(){return Object.values(null!==n&&void 0!==n?n:{})}),[n]));return null!==t&&void 0!==t?t:{}}(),t=Object(i.useMemo)((function(){return function(e){return function(n,t){var r,i,a=(r=e[n.address],i=e[t.address],r&&i?r.greaterThan(i)?-1:r.equalTo(i)?0:1:r&&r.greaterThan("0")?-1:i&&i.greaterThan("0")?1:0);return 0!==a?a:n.symbol&&t.symbol?n.symbol.toLowerCase()0}));return n.length>1?e:[].concat(Object(K.a)(T?[T]:[]),Object(K.a)(e.filter((function(e){var t;return(null===(t=e.symbol)||void 0===t?void 0:t.toLowerCase())===n[0]}))),Object(K.a)(e.filter((function(e){var t;return(null===(t=e.symbol)||void 0===t?void 0:t.toLowerCase())!==n[0]}))))}),[S,m,T,E]),U=Object(i.useCallback)((function(e){if(t(e),o(),N){var n=document.getElementById("bgMusic");n&&n.play()}}),[o,t,N]);Object(i.useEffect)((function(){u&&O("")}),[u]);var A=Object(i.useRef)(),z=Object(i.useCallback)((function(e){var n,t=e.target.value,r=fn(t);O(r||t),null===(n=p.current)||void 0===n||n.scrollTo(0)}),[]),B=Object(i.useCallback)((function(e){if("Enter"===e.key)if("bnb"===m.toLowerCase().trim())U(J.d);else if(R.length>0){var n;(null===(n=R[0].symbol)||void 0===n?void 0:n.toLowerCase())!==m.trim().toLowerCase()&&1!==R.length||U(R[0])}}),[R,U,m]),P=(function(){var e,n,t=pr(),r=Object(v.d)((function(e){return e.lists.byUrl})),i=t?r[t]:void 0;e=null===i||void 0===i?void 0:i.current,n=null===i||void 0===i?void 0:i.pendingUpdate,null===i||void 0===i||i.loadingRequestId}(),Zt());return Object(r.jsxs)(Me,{style:{width:"100%",flex:"1 1"},children:[Object(r.jsxs)(Ea,{gap:"14px",children:[Object(r.jsxs)(en,{children:[Object(r.jsxs)(s.z,{children:[P(82,"Select a token"),Object(r.jsx)(sa,{text:P(128,"Find a token by searching for its name or symbol or by pasting its address below.")})]}),Object(r.jsx)(s.k,{onClick:o})]}),Object(r.jsx)(Sa,{type:"text",id:"token-search-input",placeholder:d("tokenSearchPlaceholder"),value:m,ref:A,onChange:z,onKeyDown:B}),c&&Object(r.jsx)(Oa,{chainId:b,onSelect:U,selectedCurrency:n}),Object(r.jsxs)(en,{children:[Object(r.jsx)(s.z,{fontSize:"14px",children:P(126,"Token name")}),Object(r.jsx)(Qa,{ascending:g,toggleSortOrder:function(){return C((function(e){return!e}))}})]})]}),Object(r.jsx)(Ra,{}),Object(r.jsx)("div",{style:{flex:"1"},children:Object(r.jsx)(Ii.a,{disableWidth:!0,children:function(e){var t=e.height;return Object(r.jsx)(qa,{height:t,showETH:I,currencies:R,onCurrencySelect:U,otherCurrency:a,selectedCurrency:n,fixedListRef:p})}})}),null]})}var Xa=t(430),Ja=t(235),$a=t(236),Za=t.n($a),ec="pancakeswap",nc=[ec],tc=t(146),rc=new Za.a({allErrors:!0}).compile(Ja);function ic(e,n){return ac.apply(this,arguments)}function ac(){return(ac=Object(S.a)(E.a.mark((function e(n,t){var r,i,a,c,o,s,u,l,d,b,p,f,j;return E.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n!==ec){e.next=2;break}return e.abrupt("return",tc);case 2:if(!(r=Bi(n))){e.next=25;break}return e.prev=4,e.next=7,t(r.ensName);case 7:c=e.sent,e.next=14;break;case 10:throw e.prev=10,e.t0=e.catch(4),console.error("Failed to resolve ENS name: ".concat(r.ensName),e.t0),new Error("Failed to resolve ENS name: ".concat(r.ensName));case 14:e.prev=14,o=Ai(c),e.next=22;break;case 18:throw e.prev=18,e.t1=e.catch(14),console.error("Failed to translate contenthash to URI",c),new Error("Failed to translate contenthash to URI: ".concat(c));case 22:i=Pi("".concat(o).concat(null!==(a=r.ensPath)&&void 0!==a?a:"")),e.next=26;break;case 25:i=Pi(n);case 26:s=0;case 27:if(!(s0?"".concat(e,"; ").concat(r):"".concat(r)}),""))&&void 0!==p?p:"unknown error",new Error("Token list failed validation: ".concat(j));case 53:return e.abrupt("return",b);case 54:s++,e.next=27;break;case 57:throw new Error("Unrecognized list URL protocol.");case 58:case"end":return e.stop()}}),e,null,[[4,10],[14,18],[31,37]])})))).apply(this,arguments)}var cc=[{constant:!0,inputs:[{name:"node",type:"bytes32"}],name:"resolver",outputs:[{name:"resolverAddress",type:"address"}],payable:!1,stateMutability:"view",type:"function"}],oc="0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e",sc=[{constant:!0,inputs:[{internalType:"bytes32",name:"node",type:"bytes32"}],name:"contenthash",outputs:[{internalType:"bytes",name:"",type:"bytes"}],payable:!1,stateMutability:"view",type:"function"}];function uc(e,n){return new un.a(e,sc,n)}function lc(e,n){return dc.apply(this,arguments)}function dc(){return(dc=Object(S.a)(E.a.mark((function e(n,t){var r,i,a;return E.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=new un.a(oc,cc,t),i=Object(Mi.namehash)(n),e.next=4,r.resolver(i);case 4:return a=e.sent,e.abrupt("return",uc(a,t).contenthash(i));case 6:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function bc(){var e=ge(),n=e.chainId,t=e.library,r=Object(v.c)(),a=Object(i.useCallback)((function(e){if(!t||n!==J.a.MAINNET){if(Y===J.a.MAINNET){var r=function(){var e;return F=null!==(e=F)&&void 0!==e?e:new x.a(q.provider)}();if(r)return lc(e,r)}throw new Error("Could not construct mainnet ENS resolver")}return lc(e,t)}),[n,t]);return Object(i.useCallback)(function(){var e=Object(S.a)(E.a.mark((function e(n){var t;return E.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=Object(Ce.f)(),r(Ye.pending({requestId:t,url:n})),e.abrupt("return",ic(n,a).then((function(e){return r(Ye.fulfilled({url:n,tokenList:e,requestId:t})),e})).catch((function(e){throw console.error("Failed to get list at url ".concat(n),e),r(Ye.rejected({url:n,requestId:t,errorMessage:e.message})),e})));case 3:case"end":return e.stop()}}),e)})));return function(n){return e.apply(this,arguments)}}(),[r,a])}function pc(e,n){var t=Object(i.useRef)(n);Object(i.useEffect)((function(){t.current=n}),[n]),Object(i.useEffect)((function(){var n=function(n){var r,i;null!==(r=null===(i=e.current)||void 0===i?void 0:i.contains(n.target))&&void 0!==r&&r||t.current&&t.current()};return document.addEventListener("mousedown",n),function(){document.removeEventListener("mousedown",n)}}),[e])}function fc(){var e=Object(u.a)(["\n flex: 1;\n overflow: auto;\n"]);return fc=function(){return e},e}function jc(){var e=Object(u.a)(["\n max-width: 160px;\n opacity: 0.6;\n margin-right: 0.5rem;\n font-size: 14px;\n overflow: hidden;\n text-overflow: ellipsis;\n"]);return jc=function(){return e},e}function hc(){var e=Object(u.a)(["\n display: flex;\n justify-content: center;\n align-items: center;\n position: relative;\n border: none;\n"]);return hc=function(){return e},e}function vc(){var e=Object(u.a)(["\n z-index: 100;\n visibility: ",";\n opacity: ",";\n transition: visibility 150ms linear, opacity 150ms linear;\n background: ",";\n border: 1px solid ",";\n box-shadow: 0px 0px 1px rgba(0, 0, 0, 0.01), 0px 4px 8px rgba(0, 0, 0, 0.04), 0px 16px 24px rgba(0, 0, 0, 0.04),\n 0px 24px 32px rgba(0, 0, 0, 0.01);\n color: ",";\n border-radius: 0.5rem;\n padding: 1rem;\n display: grid;\n grid-template-rows: 1fr;\n grid-gap: 8px;\n font-size: 1rem;\n text-align: left;\n"]);return vc=function(){return e},e}function mc(){var e=Object(u.a)(["\n padding: 0;\n font-size: 1rem;\n opacity: ",";\n"]);return mc=function(){return e},e}var Oc=Object(l.default)(En)(mc(),(function(e){return e.disabled?"0.4":"1"})),yc=l.default.div(vc(),(function(e){return e.show?"visible":"hidden"}),(function(e){return e.show?1:0}),(function(e){return e.theme.colors.invertedContrast}),(function(e){return e.theme.colors.tertiary}),(function(e){return e.theme.colors.textSubtle})),xc=l.default.div(hc()),gc=l.default.div(jc());function Cc(e){var n=e.listUrl,t=Object(i.useMemo)((function(){var e;return null===(e=Bi(n))||void 0===e?void 0:e.ensName}),[n]),a=Object(i.useMemo)((function(){if(!t){var e=n.toLowerCase();if(e.startsWith("ipfs://")||e.startsWith("ipns://"))return n;try{return new URL(n).host}catch(r){return}}}),[n,t]);return Object(r.jsx)(r.Fragment,{children:null!==t&&void 0!==t?t:a})}function wc(e){return"list-row-".concat(e.replace(/\./g,"-"))}var kc=Object(i.memo)((function(e){var n=e.listUrl,t=e.onBack,a=Object(v.d)((function(e){return e.lists.byUrl})),c=pr(),o=Object(v.c)(),u=a[n],l=u.current,d=u.pendingUpdate,b=n===c,p=function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],n=Object(i.useState)(e),t=Object(f.a)(n,2),r=t[0],a=t[1],c=Object(i.useCallback)((function(){return a((function(e){return!e}))}),[]);return[r,c]}(!1),j=Object(f.a)(p,2),h=j[0],m=j[1],O=Object(i.useRef)(),y=Object(i.useState)(),x=Object(f.a)(y,2),g=x[0],C=x[1],w=Object(i.useState)(),k=Object(f.a)(w,2),T=k[0],I=k[1],E=Object(Hi.a)(g,T,{placement:"auto",strategy:"fixed",modifiers:[{name:"offset",options:{offset:[8,8]}}]}),N=E.styles,S=E.attributes;pc(O,h?m:void 0);var R=Object(i.useCallback)((function(){b||(o(We(n)),t())}),[o,b,n,t]),U=Object(i.useCallback)((function(){d&&o(Fe(n))}),[o,n,d]),A=Object(i.useCallback)((function(){"REMOVE"===window.prompt("Please confirm you would like to remove this list by typing REMOVE")&&o(Ve(n))}),[o,n]),z=Zt();return l?Object(r.jsxs)(an,{align:"center",padding:"16px",id:wc(n),children:[l.logoURI?Object(r.jsx)(Wi,{style:{marginRight:"1rem"},logoURI:l.logoURI,alt:"".concat(l.name," list logo")}):Object(r.jsx)("div",{style:{width:"24px",height:"24px",marginRight:"1rem"}}),Object(r.jsxs)(Me,{style:{flex:"1"},children:[Object(r.jsx)(an,{children:Object(r.jsx)(s.z,{bold:b,fontSize:"16px",style:{overflow:"hidden",textOverflow:"ellipsis"},children:l.name})}),Object(r.jsx)(an,{style:{marginTop:"4px"},children:Object(r.jsx)(gc,{title:n,children:Object(r.jsx)(Cc,{listUrl:n})})})]}),Object(r.jsxs)(xc,{ref:O,children:[Object(r.jsx)("div",{style:{display:"inline-block"},ref:C,children:Object(r.jsx)(s.d,{style:{width:"32px",marginRight:"8px"},onClick:m,variant:"secondary",children:Object(r.jsx)(s.j,{})})}),h&&Object(r.jsxs)(yc,Object(X.a)(Object(X.a)({show:!0,ref:I,style:N.popper},S.popper),{},{children:[Object(r.jsx)("div",{children:l&&He(l.version)}),Object(r.jsx)(Ua,{}),Object(r.jsx)(Rn,{href:"https://tokenlists.org/token-list?url=".concat(n),children:z(1206,"View list")}),Object(r.jsx)(Oc,{onClick:A,disabled:1===Object.keys(a).length,children:"Remove list"}),d&&Object(r.jsx)(Oc,{onClick:U,children:"Update list"})]}))]}),b?Object(r.jsx)(s.d,{disabled:!0,style:{width:"5rem",minWidth:"5rem"},children:"Selected"}):Object(r.jsx)(r.Fragment,{children:Object(r.jsx)(s.d,{className:"select-button",style:{width:"5rem",minWidth:"4.5rem"},onClick:R,children:"Select"})})]},n):null})),Tc=l.default.div(fc());function Ic(e){var n,t=e.onDismiss,a=e.onBack,c=Object(i.useState)(""),o=Object(f.a)(c,2),u=o[0],l=o[1],d=Object(v.c)(),b=Object(v.d)((function(e){return e.lists.byUrl})),p=Boolean(null===(n=b[u])||void 0===n?void 0:n.loadingRequestId),j=Object(i.useState)(null),h=Object(f.a)(j,2),m=h[0],O=h[1],y=Object(i.useCallback)((function(e){l(e.target.value),O(null)}),[]),x=bc(),g=Object(i.useCallback)((function(){p||(O(null),x(u).then((function(){l("")})).catch((function(e){O(e.message),d(Ve(u))})))}),[p,d,x,u]),C=Object(i.useMemo)((function(){return Pi(u).length>0||Boolean(Bi(u))}),[u]),w=Object(i.useCallback)((function(e){C&&"Enter"===e.key&&g()}),[g,C]),k=Object(i.useMemo)((function(){return Object.keys(b).filter((function(e){return Boolean(b[e].current)})).sort((function(e,n){var t=b[e].current,r=b[n].current;return t&&r?t.name.toLowerCase()20?"".concat(l.symbol.slice(0,4),"...").concat(l.symbol.slice(l.symbol.length-5,l.symbol.length)):null===l||void 0===l?void 0:l.symbol)||N(1196,"Select a currency")}),!b&&Object(r.jsx)(s.j,{})]})})]})]}),!b&&u&&Object(r.jsx)(Ec,{isOpen:k,onDismiss:R,onCurrencySelect:u,selectedCurrency:l,otherSelectedCurrency:y,showCommonBases:g})]})}function Zc(){var e=Object(u.a)(["\n color: ",";\n"]);return Zc=function(){return e},e}function eo(){var e=Object(u.a)(["\n font-weight: 500;\n font-size: 20px;\n"]);return eo=function(){return e},e}function no(){var e=Object(u.a)(["\n display: flex;\n flex-flow: row nowrap;\n align-items: center;\n border-radius: 3rem;\n justify-content: space-evenly;\n"]);return no=function(){return e},e}var to=l.default.div(no()),ro=l.default.div(eo()),io=Object(l.default)(Xa.a)(Zc(),(function(e){return e.theme.colors.text}));function ao(){var e=Zt();return Object(r.jsx)(to,{children:Object(r.jsxs)(en,{style:{padding:"1rem"},children:[Object(r.jsx)(j.b,{to:"/pool",children:Object(r.jsx)(io,{})}),Object(r.jsx)(ro,{children:"Import Pool"}),Object(r.jsx)(sa,{text:e(256,"Use this tool to find pairs that do not automatically appear in the interface.")})]})})}function co(e){var n=e.adding,t=Zt();return Object(r.jsx)(to,{children:Object(r.jsxs)(en,{style:{padding:"1rem"},children:[Object(r.jsx)(j.b,{to:"/pool",children:Object(r.jsx)(io,{})}),Object(r.jsxs)(ro,{children:[n?t(258,"Add"):t(260,"Remove")," Liquidity"]}),Object(r.jsx)(sa,{text:n?t(264,"When you add liquidity, you are given pool tokens representing your position. These tokens automatically earn fees proportional to your share of the pool, and can be redeemed at any time."):t(266,"Removing pool tokens converts your position back into underlying tokens at the current rate, proportional to your share of the pool. Accrued fees are included in the amounts you receive.")})]})})}var oo=t(431),so=t(432);function uo(e){var n,t,r=null===(n=Ar(li(null===e||void 0===e?void 0:e.address,!1),"totalSupply"))||void 0===n||null===(t=n.result)||void 0===t?void 0:t[0];return e&&r?new J.k(e,r.toString()):void 0}function lo(e){if(e===J.d)return"BNB";if(e instanceof J.j)return e.address;throw new Error("invalid currency")}function bo(e,n){return n&&e===J.d?J.n[n]:e instanceof J.j?e:void 0}function po(e,n){var t=e&&n?bo(e.currency,n):void 0;return t&&e?new J.k(t,e.raw):void 0}function fo(e){return e.equals(J.n[e.chainId])?J.d:e}function jo(){var e=Object(u.a)(["\n background-color: ",";\n color: ",";\n padding: 0.5rem;\n border-radius: 12px;\n margin-top: 8px;\n"]);return jo=function(){return e},e}function ho(){var e=Object(u.a)(["\n background-color: ",";\n display: flex;\n align-items: center;\n justify-content: center;\n margin-right: 12px;\n border-radius: 12px;\n min-width: 48px;\n height: 48px;\n"]);return ho=function(){return e},e}function vo(){var e=Object(u.a)(["\n background-color: ",";\n border-radius: 1rem;\n display: flex;\n align-items: center;\n font-size: 0.825rem;\n width: 100%;\n padding: 3rem 1.25rem 1rem 1rem;\n margin-top: -2rem;\n color: ",";\n z-index: -1;\n p {\n padding: 0;\n margin: 0;\n font-weight: 500;\n }\n"]);return vo=function(){return e},e}function mo(){var e=Object(u.a)(["\n &::after {\n display: inline-block;\n animation: ellipsis 1.25s infinite;\n content: '.';\n width: 1em;\n text-align: left;\n }\n @keyframes ellipsis {\n 0% {\n content: '.';\n }\n 33% {\n content: '..';\n }\n 66% {\n content: '...';\n }\n }\n"]);return mo=function(){return e},e}function Oo(){var e=Object(u.a)(["\n height: 22px;\n width: 22px;\n background-color: ",";\n border: none;\n border-radius: 50%;\n padding: 0.2rem;\n font-size: 0.875rem;\n font-weight: 400;\n margin-left: 0.4rem;\n cursor: pointer;\n color: ",";\n display: flex;\n justify-content: center;\n align-items: center;\n float: right;\n\n :hover {\n background-color: ",";\n }\n :focus {\n background-color: ",";\n outline: none;\n }\n"]);return Oo=function(){return e},e}function yo(){var e=Object(u.a)(["\n color: ",";\n"]);return yo=function(){return e},e}function xo(){var e=Object(u.a)(["\n margin-top: 1rem;\n"]);return xo=function(){return e},e}function go(){var e=Object(u.a)(["\n height: 1px;\n width: 100%;\n background-color: ",";\n"]);return go=function(){return e},e}function Co(){var e=Object(u.a)(["\n :hover {\n cursor: pointer;\n opacity: 0.8;\n }\n "]);return Co=function(){return e},e}function wo(){var e=Object(u.a)(["\n padding: 2px;\n\n ","\n"]);return wo=function(){return e},e}function ko(){var e=Object(u.a)(["\n position: relative;\n"]);return ko=function(){return e},e}var To=l.default.div(ko()),Io=l.default.div(wo(),(function(e){return e.clickable?Object(l.css)(Co()):null})),Eo=l.default.div(go(),(function(e){return e.theme.colors.tertiary})),No=l.default.div(xo()),So=Object(l.default)(s.z)(yo(),(function(e){var n=e.theme,t=e.severity;return 3===t||4===t?n.colors.failure:2===t?n.colors.binance:1===t?n.colors.text:n.colors.success})),Ro=l.default.button(Oo(),(function(e){return e.theme.colors.invertedContrast}),(function(e){return e.theme.colors.textSubtle}),(function(e){return e.theme.colors.tertiary}),(function(e){return e.theme.colors.tertiary})),Uo=l.default.span(mo()),Ao=l.default.div(vo(),(function(e){var n=e.theme;return Object(vt.b)(.9,n.colors.failure)}),(function(e){return e.theme.colors.failure})),zo=l.default.div(ho(),(function(e){var n=e.theme;return Object(vt.b)(.9,n.colors.failure)}));function Bo(e){var n=e.error;return Object(r.jsxs)(Ao,{children:[Object(r.jsx)(zo,{children:Object(r.jsx)(Wt.a,{size:24})}),Object(r.jsx)("p",{children:n})]})}var Po=Object(l.default)(Pe)(jo(),(function(e){var n=e.theme;return Object(vt.b)(.9,n.colors.primary)}),(function(e){return e.theme.colors.primary}));function Mo(){var e=Object(u.a)(["\n border: 1px solid ",";\n :hover {\n border: 1px solid ",";\n }\n"]);return Mo=function(){return e},e}function Do(){var e=Object(u.a)(["\n height: 24px;\n"]);return Do=function(){return e},e}var Lo=Object(l.default)(en)(Do()),_o=Object(l.default)(pt)(Mo(),(function(e){return e.theme.colors.invertedContrast}),(function(e){var n=e.theme;return Object(vt.a)(.06,n.colors.invertedContrast)}));function Yo(e){var n=e.pair,t=e.showUnwrapped,a=void 0!==t&&t,c=ge().account,o=a?n.token0:fo(n.token0),u=a?n.token1:fo(n.token1),l=Object(i.useState)(!1),d=Object(f.a)(l,2),b=d[0],p=d[1],j=gi(null!==c&&void 0!==c?c:void 0,n.liquidityToken),h=uo(n.liquidityToken),v=n&&h&&j&&J.e.greaterThanOrEqual(h.raw,j.raw)?[n.getLiquidityValue(n.token0,h,j,!1),n.getLiquidityValue(n.token1,h,j,!1)]:[void 0,void 0],m=Object(f.a)(v,2),O=m[0],y=m[1];return Object(r.jsx)(r.Fragment,{children:j&&Object(r.jsx)(s.g,{children:Object(r.jsx)(s.h,{children:Object(r.jsxs)(Pe,{gap:"12px",children:[Object(r.jsx)(Lo,{children:Object(r.jsx)(rn,{children:Object(r.jsx)(s.z,{style:{textTransform:"uppercase",fontWeight:600},fontSize:"14px",color:"textSubtle",children:"LP Tokens in your Wallet"})})}),Object(r.jsxs)(Lo,{onClick:function(){return p(!b)},children:[Object(r.jsxs)(rn,{children:[Object(r.jsx)(Bc,{currency0:o,currency1:u,margin:!0,size:20}),Object(r.jsxs)(s.z,{fontSize:"14px",children:[o.symbol,"/",u.symbol]})]}),Object(r.jsx)(rn,{children:Object(r.jsx)(s.z,{fontSize:"14px",children:j?j.toSignificant(4):"-"})})]}),Object(r.jsxs)(Pe,{gap:"4px",children:[Object(r.jsxs)(Lo,{children:[Object(r.jsxs)(s.z,{fontSize:"14px",children:[o.symbol,":"]}),O?Object(r.jsx)(rn,{children:Object(r.jsx)(s.z,{ml:"6px",fontSize:"14px",children:null===O||void 0===O?void 0:O.toSignificant(6)})}):"-"]}),Object(r.jsxs)(Lo,{children:[Object(r.jsxs)(s.z,{fontSize:"14px",children:[u.symbol,":"]}),y?Object(r.jsx)(rn,{children:Object(r.jsx)(s.z,{ml:"6px",fontSize:"14px",children:null===y||void 0===y?void 0:y.toSignificant(6)})}):"-"]})]})]})})})})}function Fo(e){var n=e.pair,t=ge().account,a=fo(n.token0),c=fo(n.token1),o=Object(i.useState)(!1),u=Object(f.a)(o,2),l=u[0],d=u[1],b=gi(null!==t&&void 0!==t?t:void 0,n.liquidityToken),p=uo(n.liquidityToken),h=b&&p&&J.e.greaterThanOrEqual(p.raw,b.raw)?new J.g(b.raw,p.raw):void 0,v=n&&p&&b&&J.e.greaterThanOrEqual(p.raw,b.raw)?[n.getLiquidityValue(n.token0,p,b,!1),n.getLiquidityValue(n.token1,p,b,!1)]:[void 0,void 0],m=Object(f.a)(v,2),O=m[0],y=m[1];return Object(r.jsx)(_o,{children:Object(r.jsxs)(Pe,{gap:"12px",children:[Object(r.jsxs)(Lo,{onClick:function(){return d(!l)},style:{cursor:"pointer"},children:[Object(r.jsxs)(rn,{children:[Object(r.jsx)(Bc,{currency0:a,currency1:c,margin:!0,size:20}),Object(r.jsx)(s.z,{children:a&&c?"".concat(a.symbol,"/").concat(c.symbol):Object(r.jsx)(Uo,{children:"Loading"})})]}),Object(r.jsx)(rn,{children:l?Object(r.jsx)(oo.a,{size:"20",style:{marginLeft:"10px"}}):Object(r.jsx)(so.a,{size:"20",style:{marginLeft:"10px"}})})]}),l&&Object(r.jsxs)(Pe,{gap:"8px",children:[Object(r.jsxs)(Lo,{children:[Object(r.jsx)(rn,{children:Object(r.jsxs)(s.z,{children:["Pooled ",a.symbol,":"]})}),O?Object(r.jsxs)(rn,{children:[Object(r.jsx)(s.z,{ml:"6px",children:null===O||void 0===O?void 0:O.toSignificant(6)}),Object(r.jsx)(ha,{size:"20px",style:{marginLeft:"8px"},currency:a})]}):"-"]}),Object(r.jsxs)(Lo,{children:[Object(r.jsx)(rn,{children:Object(r.jsxs)(s.z,{children:["Pooled ",c.symbol,":"]})}),y?Object(r.jsxs)(rn,{children:[Object(r.jsx)(s.z,{ml:"6px",children:null===y||void 0===y?void 0:y.toSignificant(6)}),Object(r.jsx)(ha,{size:"20px",style:{marginLeft:"8px"},currency:c})]}):"-"]}),Object(r.jsxs)(Lo,{children:[Object(r.jsx)(s.z,{children:"Your pool tokens:"}),Object(r.jsx)(s.z,{children:b?b.toSignificant(4):"-"})]}),Object(r.jsxs)(Lo,{children:[Object(r.jsx)(s.z,{children:"Your pool share:"}),Object(r.jsx)(s.z,{children:h?"".concat(h.toFixed(2),"%"):"-"})]}),Object(r.jsxs)(en,{marginTop:"10px",children:[Object(r.jsx)(s.d,{as:j.b,to:"/add/".concat(lo(a),"/").concat(lo(c)),style:{width:"48%"},children:"Add"}),Object(r.jsx)(s.d,{as:j.b,style:{width:"48%"},to:"/remove/".concat(lo(a),"/").concat(lo(c)),children:"Remove"})]})]})]})})}var qo,Vo=new ir.b(ri.a);function Wo(e){var n=ge().chainId,t=Object(i.useMemo)((function(){return e.map((function(e){var t=Object(f.a)(e,2),r=t[0],i=t[1];return[bo(r,n),bo(i,n)]}))}),[n,e]),r=Ur(Object(i.useMemo)((function(){return t.map((function(e){var n=Object(f.a)(e,2),t=n[0],r=n[1];return t&&r&&!t.equals(r)?J.f.getAddress(t,r):void 0}))}),[t]),Vo,"getReserves");return Object(i.useMemo)((function(){return r.map((function(e,n){var r=e.result,i=e.loading,a=t[n][0],c=t[n][1];if(i)return[qo.LOADING,null];if(!a||!c||a.equals(c))return[qo.INVALID,null];if(!r)return[qo.NOT_EXISTS,null];var o=r.reserve0,s=r.reserve1,u=a.sortsBefore(c)?[a,c]:[c,a],l=Object(f.a)(u,2),d=l[0],b=l[1];return[qo.EXISTS,new J.f(new J.k(d,o.toString()),new J.k(b,s.toString()))]}))}),[r,t])}function Ho(e,n){return Wo([[e,n]])[0]}!function(e){e[e.LOADING=0]="LOADING",e[e.NOT_EXISTS=1]="NOT_EXISTS",e[e.EXISTS=2]="EXISTS",e[e.INVALID=3]="INVALID"}(qo||(qo={}));var Qo=t(423);function Go(e,n,t){var r=Ar(li(null===e||void 0===e?void 0:e.address,!1),"allowance",Object(i.useMemo)((function(){return[n,t]}),[n,t])).result;return Object(i.useMemo)((function(){return e&&r?new J.k(e,r.toString()):void 0}),[e,r])}var Ko;!function(e){e.INPUT="INPUT",e.OUTPUT="OUTPUT"}(Ko||(Ko={}));var Xo=Object(Ce.b)("swap/selectCurrency"),Jo=Object(Ce.b)("swap/switchCurrencies"),$o=Object(Ce.b)("swap/typeInput"),Zo=Object(Ce.b)("swap/replaceSwapState"),es=Object(Ce.b)("swap/setRecipient"),ns=Object(Ce.b)("transactions/addTransaction"),ts=Object(Ce.b)("transactions/clearAllTransactions"),rs=Object(Ce.b)("transactions/finalizeTransaction"),is=Object(Ce.b)("transactions/checkedTransaction");function as(){var e=ge(),n=e.chainId,t=e.account,r=Object(v.c)();return Object(i.useCallback)((function(e){var i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},a=i.summary,c=i.approval;if(t&&n){var o=e.hash;if(!o)throw Error("No transaction hash found.");r(ns({hash:o,from:t,chainId:n,approval:c,summary:a}))}}),[r,n,t])}function cs(){var e,n=ge().chainId,t=Object(v.d)((function(e){return e.transactions}));return n&&null!==(e=t[n])&&void 0!==e?e:{}}function os(e){return(new Date).getTime()-e.addedTime<864e5}var ss,us,ls=new J.g(J.e.BigInt(20),J.e.BigInt(1e4)),ds=new J.g(J.e.BigInt(1e4),J.e.BigInt(1e4)),bs=ds.subtract(ls);function ps(e){var n=e?ds.subtract(e.route.pairs.reduce((function(e){return e.multiply(bs)}),ds)):void 0,t=e&&n?e.priceImpact.subtract(n):void 0;return{priceImpactWithoutFee:t?new J.g(null===t||void 0===t?void 0:t.numerator,null===t||void 0===t?void 0:t.denominator):void 0,realizedLPFee:n&&e&&(e.inputAmount instanceof J.k?new J.k(e.inputAmount.token,n.multiply(e.inputAmount.raw).quotient):J.c.ether(n.multiply(e.inputAmount.raw).quotient))}}function fs(e,n){var t,r,i=(r=n,new J.g(J.e.BigInt(Math.floor(r)),J.e.BigInt(1e4)));return t={},Object(y.a)(t,Ko.INPUT,null===e||void 0===e?void 0:e.maximumAmountIn(i)),Object(y.a)(t,Ko.OUTPUT,null===e||void 0===e?void 0:e.minimumAmountOut(i)),t}function js(e){return(null===e||void 0===e?void 0:e.lessThan(ye))?(null===e||void 0===e?void 0:e.lessThan(me))?(null===e||void 0===e?void 0:e.lessThan(ve))?(null===e||void 0===e?void 0:e.lessThan(he))?0:1:2:3:4}function hs(e,n){return e?n?"".concat(e.executionPrice.invert().toSignificant(6)," ").concat(e.inputAmount.currency.symbol," / ").concat(e.outputAmount.currency.symbol):"".concat(e.executionPrice.toSignificant(6)," ").concat(e.outputAmount.currency.symbol," / ").concat(e.inputAmount.currency.symbol):""}function vs(e,n){var t=ge().account,r=e instanceof J.k?e.token:void 0,a=Go(r,null!==t&&void 0!==t?t:void 0,n),c=function(e,n){var t=cs();return Object(i.useMemo)((function(){return"string"===typeof e&&"string"===typeof n&&Object.keys(t).some((function(r){var i=t[r];if(!i)return!1;if(i.receipt)return!1;var a=i.approval;return!!a&&a.spender===n&&a.tokenAddress===e&&os(i)}))}),[t,n,e])}(null===r||void 0===r?void 0:r.address,n),o=Object(i.useMemo)((function(){return e&&n?e.currency===J.d?ss.APPROVED:a?a.lessThan(e)?c?ss.PENDING:ss.NOT_APPROVED:ss.APPROVED:ss.UNKNOWN:ss.UNKNOWN}),[e,a,c,n]),s=li(null===r||void 0===r?void 0:r.address),u=as(),l=Object(i.useCallback)(Object(S.a)(E.a.mark((function t(){var i,a;return E.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(o===ss.NOT_APPROVED){t.next=3;break}return console.error("approve was called unnecessarily"),t.abrupt("return");case 3:if(r){t.next=6;break}return console.error("no token"),t.abrupt("return");case 6:if(s){t.next=9;break}return console.error("tokenContract is null"),t.abrupt("return");case 9:if(e){t.next=12;break}return console.error("missing amount to approve"),t.abrupt("return");case 12:if(n){t.next=15;break}return console.error("no spender"),t.abrupt("return");case 15:return i=!1,t.next=18,s.estimateGas.approve(n,Qo.a).catch((function(){return i=!0,s.estimateGas.approve(n,e.raw.toString())}));case 18:return a=t.sent,t.abrupt("return",s.approve(n,i?e.raw.toString():Qo.a,{gasLimit:mn(a)}).then((function(t){u(t,{summary:"Approve ".concat(e.currency.symbol),approval:{tokenAddress:r.address,spender:n}})})).catch((function(e){throw console.error("Failed to approve token",e),e})));case 20:case"end":return t.stop()}}),t)}))),[o,r,s,e,n,u]);return[o,l]}!function(e){e[e.UNKNOWN=0]="UNKNOWN",e[e.NOT_APPROVED=1]="NOT_APPROVED",e[e.PENDING=2]="PENDING",e[e.APPROVED=3]="APPROVED"}(ss||(ss={})),function(e){e.CURRENCY_A="CURRENCY_A",e.CURRENCY_B="CURRENCY_B"}(us||(us={}));var ms=Object(Ce.b)("mint/typeInputMint"),Os=Object(Ce.b)("mint/resetMintState"),ys=t(168);function xs(e,n){var t=Object(i.useState)(e),r=Object(f.a)(t,2),a=r[0],c=r[1];return Object(i.useEffect)((function(){var t=setTimeout((function(){c(e)}),n);return function(){clearTimeout(t)}}),[e,n]),a}function gs(e){var n=fn(e),t=function(e){var n,t,r,a=xs(e,200),c=Object(i.useMemo)((function(){if(!a||!fn(a))return[void 0];try{return a?[Object(Mi.namehash)("".concat(a.toLowerCase().substr(2),".addr.reverse"))]:[void 0]}catch(e){return[void 0]}}),[a]),o=Ar(di(!1),"resolver",c),s=null===(n=o.result)||void 0===n?void 0:n[0],u=Ar(bi(s&&!Di(s)?s:void 0,!1),"name",c),l=a!==e;return{ENSName:l?null:null!==(t=null===(r=u.result)||void 0===r?void 0:r[0])&&void 0!==t?t:null,loading:l||o.loading||u.loading}}(n||void 0),r=function(e){var n,t,r,a=xs(e,200),c=Object(i.useMemo)((function(){if(!a)return[void 0];try{return a?[Object(Mi.namehash)(a)]:[void 0]}catch(e){return[void 0]}}),[a]),o=Ar(di(!1),"resolver",c),s=null===(n=o.result)||void 0===n?void 0:n[0],u=Ar(bi(s&&!Di(s)?s:void 0,!1),"addr",c),l=a!==e;return{address:l?null:null!==(t=null===(r=u.result)||void 0===r?void 0:r[0])&&void 0!==t?t:null,loading:l||o.loading||u.loading}}(e);return{loading:t.loading||r.loading,address:n||r.address,name:t.ENSName?t.ENSName:!n&&r.address&&e||null}}function Cs(e,n){var t=ge().chainId,r=Object(i.useMemo)((function(){return t?ce[t]:[]}),[t]),a=Object(i.useMemo)((function(){return Br()(r,(function(e){return r.map((function(n){return[e,n]}))})).filter((function(e){var n=Object(f.a)(e,2),t=n[0],r=n[1];return t.address!==r.address}))}),[r]),c=t?[bo(e,t),bo(n,t)]:[void 0,void 0],o=Object(f.a)(c,2),s=o[0],u=o[1],l=Wo(Object(i.useMemo)((function(){return s&&u?[[s,u]].concat(Object(K.a)(r.map((function(e){return[s,e]}))),Object(K.a)(r.map((function(e){return[u,e]}))),Object(K.a)(a)).filter((function(e){return Boolean(e[0]&&e[1])})).filter((function(e){var n=Object(f.a)(e,2),t=n[0],r=n[1];return t.address!==r.address})).filter((function(e){var n=Object(f.a)(e,2),r=n[0],i=n[1];if(!t)return!0;var a=oe[t];if(!a)return!0;var c=a[r.address],o=a[i.address];return!c&&!o||!(c&&!c.find((function(e){return i.equals(e)})))&&!(o&&!o.find((function(e){return r.equals(e)})))})):[]}),[s,u,r,a,t]));return Object(i.useMemo)((function(){return Object.values(l.filter((function(e){return Boolean(e[0]===qo.EXISTS&&e[1])})).reduce((function(e,n){var t,r=Object(f.a)(n,2)[1];return e[r.liquidityToken.address]=null!==(t=e[r.liquidityToken.address])&&void 0!==t?t:r,e}),{}))}),[l])}var ws=t(237);function ks(){return Object(v.d)((function(e){return e.swap}))}function Ts(e,n){if(e&&n)try{var t=Object(ys.parseUnits)(e,n.decimals).toString();if("0"!==t)return n instanceof J.j?new J.k(n,J.e.BigInt(t)):J.c.ether(J.e.BigInt(t))}catch(r){console.info('Failed to parse input amount: "'.concat(e,'"'),r)}}var Is=["0x5Fe5cC0122403f06abE2A75DBba1860Edb762985","0x3E2b14680108E8C5C45C3ab5Bc04E01397af14cB","0xCc7aDc94F3D80127849D2b41b6439b7CF1eB4Ae0"];function Es(e,n){return e.route.path.some((function(e){return e.address===n}))||e.route.pairs.some((function(e){return e.liquidityToken.address===n}))}function Ns(){var e,n,t,r,a,c,o,s=ge().account,u=ks(),l=u.independentField,d=u.typedValue,b=u[Ko.INPUT].currencyId,p=u[Ko.OUTPUT].currencyId,j=u.recipient,h=mi(b),v=mi(p),m=gs(null!==j&&void 0!==j?j:void 0),O=null!==(e=null===j?s:m.address)&&void 0!==e?e:null,x=Ci(null!==s&&void 0!==s?s:void 0,[null!==h&&void 0!==h?h:void 0,null!==v&&void 0!==v?v:void 0]),g=l===Ko.INPUT,C=Ts(d,null!==(n=g?h:v)&&void 0!==n?n:void 0),w=function(e,n){var t=Cs(null===e||void 0===e?void 0:e.currency,n);return Object(i.useMemo)((function(){var r;return e&&n&&t.length>0&&null!==(r=J.l.bestTradeExactIn(t,e,n,{maxHops:3,maxNumResults:1})[0])&&void 0!==r?r:null}),[t,e,n])}(g?C:void 0,null!==v&&void 0!==v?v:void 0),k=function(e,n){var t=Cs(e,null===n||void 0===n?void 0:n.currency);return Object(i.useMemo)((function(){var r;return e&&n&&t.length>0&&null!==(r=J.l.bestTradeExactOut(t,e,n,{maxHops:3,maxNumResults:1})[0])&&void 0!==r?r:null}),[t,e,n])}(null!==h&&void 0!==h?h:void 0,g?void 0:C),T=g?w:k,I=(t={},Object(y.a)(t,Ko.INPUT,x[0]),Object(y.a)(t,Ko.OUTPUT,x[1]),t),E=(r={},Object(y.a)(r,Ko.INPUT,null!==h&&void 0!==h?h:void 0),Object(y.a)(r,Ko.OUTPUT,null!==v&&void 0!==v?v:void 0),r);(s||(a="Connect Wallet"),C)||(a=null!==(c=a)&&void 0!==c?c:"Enter an amount");E[Ko.INPUT]&&E[Ko.OUTPUT]||(a=null!==(o=a)&&void 0!==o?o:"Select a token");var N,S=fn(O);if(O&&S){if(-1!==Is.indexOf(S)||w&&Es(w,S)||k&&Es(k,S)){var R;a=null!==(R=a)&&void 0!==R?R:"Invalid recipient"}}else a=null!==(N=a)&&void 0!==N?N:"Enter a recipient";var U=Jr(),A=Object(f.a)(U,1)[0],z=T&&A&&fs(T,A),B=[I[Ko.INPUT],z?z[Ko.INPUT]:null],P=B[0],M=B[1];return P&&M&&P.lessThan(M)&&(a="Insufficient ".concat(M.currency.symbol," balance")),{currencies:E,currencyBalances:I,parsedAmount:C,v2Trade:null!==T&&void 0!==T?T:void 0,inputError:a}}function Ss(e){if("string"===typeof e){var n=fn(e);if(n)return n;if("BNB"===e.toUpperCase())return"BNB";if(!1===n)return"BNB"}return null!=="BNB"?"BNB":""}var Rs=/^[-a-zA-Z0-9@:%._+~#=]{1,256}\.[a-zA-Z0-9()]{1,6}\b([-a-zA-Z0-9()@:%_+.~#?&/=]*)?$/,Us=/^0x[a-fA-F0-9]{40}$/;function As(e){var n,t=Ss(e.inputCurrency),r=Ss(e.outputCurrency);t===r&&("string"===typeof e.outputCurrency?t="":r="");var i,a=function(e){return"string"!==typeof e?null:fn(e)||(Rs.test(e)||Us.test(e)?e:null)}(e.recipient);return n={},Object(y.a)(n,Ko.INPUT,{currencyId:t}),Object(y.a)(n,Ko.OUTPUT,{currencyId:r}),Object(y.a)(n,"typedValue","string"!==typeof(i=e.exactAmount)||isNaN(parseFloat(i))?"":i),Object(y.a)(n,"independentField",function(e){return"string"===typeof e&&"output"===e.toLowerCase()?Ko.OUTPUT:Ko.INPUT}(e.exactField)),Object(y.a)(n,"recipient",a),n}function zs(){var e=ge().chainId,n=Object(v.c)(),t=function(){var e=Object(h.g)().search;return Object(i.useMemo)((function(){return e&&e.length>1?Object(ws.parse)(e,{parseArrays:!1,ignoreQueryPrefix:!0}):{}}),[e])}(),r=Object(i.useState)(),a=Object(f.a)(r,2),c=a[0],o=a[1];return Object(i.useEffect)((function(){if(e){var r=As(t);n(Zo({typedValue:r.typedValue,field:r.independentField,inputCurrencyId:r[Ko.INPUT].currencyId,outputCurrencyId:r[Ko.OUTPUT].currencyId,recipient:r.recipient})),o({inputCurrencyId:r[Ko.INPUT].currencyId,outputCurrencyId:r[Ko.OUTPUT].currencyId})}}),[n,e]),c}var Bs=J.e.BigInt(0);function Ps(){return Object(v.d)((function(e){return e.mint}))}function Ms(e){if(e)return e.currency===J.d?J.e.greaterThan(e.raw,xe)?J.c.ether(J.e.subtract(e.raw,xe)):J.c.ether(J.e.BigInt(0)):e}function Ds(){var e=Object(u.a)(["\n border: 2px solid ",";\n border-radius: 16px;\n padding: 16px;\n"]);return Ds=function(){return e},e}var Ls=l.default.div(Ds(),(function(e){return e.theme.colors.borderColor})),_s=t(124),Ys=Object(Ce.d)({name:"toasts",initialState:{data:[]},reducers:{push:function(e,n){var t=n.payload,r=e.data.findIndex((function(e){return e.id===n.payload.id}));r>=0&&e.data.splice(r,1),e.data.unshift(t)},remove:function(e,n){var t=e.data.findIndex((function(e){return e.id===n.payload}));t>=0&&e.data.splice(t,1)},clear:function(e){e.data=[]}}}),Fs=Ys.actions,qs=Fs.clear,Vs=Fs.remove,Ws=Fs.push,Hs=Ys.reducer,Qs=function(){var e=Object(v.c)();return Object(i.useMemo)((function(){var n=function(n){return e(Ws(n))};return{toastError:function(e,t){return n({id:Object(_s.kebabCase)(e),type:s.F.DANGER,title:e,description:t})},toastInfo:function(e,t){return n({id:Object(_s.kebabCase)(e),type:s.F.INFO,title:e,description:t})},toastSuccess:function(e,t){return n({id:Object(_s.kebabCase)(e),type:s.F.SUCCESS,title:e,description:t})},toastWarning:function(e,t){return n({id:Object(_s.kebabCase)(e),type:s.F.WARNING,title:e,description:t})},push:n,remove:function(n){return e(Vs(n))},clear:function(){return e(qs())}}}),[e])},Gs=function(){var e=Object(m.d)(),n=e.activate,t=e.deactivate,r=Qs().toastError;return{login:Object(i.useCallback)((function(e){var t=G[e];t?n(t,function(){var e=Object(S.a)(E.a.mark((function e(n){return E.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:window.localStorage.removeItem(s.C),n instanceof m.a?r("Unsupported Chain Id","Unsupported Chain Id Error. Check your chain Id."):n instanceof g.b||n instanceof k.NoBscProviderError?r("Provider Error","No provider was found"):n instanceof g.c||n instanceof C.a?(t instanceof C.b&&(t.walletConnectProvider=null),r("Authorization Error","Please authorize to access your account")):r(n.name,n.message);case 2:case"end":return e.stop()}}),e)})));return function(n){return e.apply(this,arguments)}}()):r("Can't find connector","The connector config is wrong")}),[]),logout:t}},Ks=function(e){var n=Zt(),t=Gs(),i=t.login,a=t.logout,c=Object(s.I)(i,a).onPresentConnectModal;return Object(r.jsx)(s.d,Object(X.a)(Object(X.a)({onClick:c},e),{},{children:n(292,"Unlock Wallet")}))};function Xs(){var e=Object(u.a)(["\n position: relative;\n max-width: 436px;\n width: 100%;\n z-index: 5;\n"]);return Xs=function(){return e},e}var Js=Object(l.default)(s.g)(Xs());function $s(e){var n=e.children;return Object(r.jsx)(Js,{children:n})}function Zs(){var e=Object(u.a)(["\n &::after {\n display: inline-block;\n animation: ellipsis 1.25s infinite;\n content: '.';\n width: 1em;\n text-align: left;\n }\n @keyframes ellipsis {\n 0% {\n content: '.';\n }\n 33% {\n content: '..';\n }\n 66% {\n content: '...';\n }\n }\n"]);return Zs=function(){return e},e}function eu(){var e=Object(u.a)(["\n :hover {\n cursor: pointer;\n }\n color: ",";\n"]);return eu=function(){return e},e}function nu(){var e=Object(u.a)(["\n position: relative;\n"]);return nu=function(){return e},e}var tu=l.default.div(nu()),ru=Object(l.default)(s.z)(eu(),(function(e){return e.theme.colors.primary})),iu=l.default.span(Zs());function au(e){var n,t,i,a,c,o,u,l,d=e.noLiquidity,b=e.price,p=e.currencies,f=e.parsedAmounts,j=e.poolTokenPercentage,h=e.onAdd;return Object(r.jsxs)(r.Fragment,{children:[Object(r.jsxs)(en,{children:[Object(r.jsxs)(s.z,{children:[null===(n=p[us.CURRENCY_A])||void 0===n?void 0:n.symbol," Deposited"]}),Object(r.jsxs)(rn,{children:[Object(r.jsx)(ha,{currency:p[us.CURRENCY_A],style:{marginRight:"8px"}}),Object(r.jsx)(s.z,{children:null===(t=f[us.CURRENCY_A])||void 0===t?void 0:t.toSignificant(6)})]})]}),Object(r.jsxs)(en,{children:[Object(r.jsxs)(s.z,{children:[null===(i=p[us.CURRENCY_B])||void 0===i?void 0:i.symbol," Deposited"]}),Object(r.jsxs)(rn,{children:[Object(r.jsx)(ha,{currency:p[us.CURRENCY_B],style:{marginRight:"8px"}}),Object(r.jsx)(s.z,{children:null===(a=f[us.CURRENCY_B])||void 0===a?void 0:a.toSignificant(6)})]})]}),Object(r.jsxs)(en,{children:[Object(r.jsx)(s.z,{children:"Rates"}),Object(r.jsx)(s.z,{children:"1 ".concat(null===(c=p[us.CURRENCY_A])||void 0===c?void 0:c.symbol," = ").concat(null===b||void 0===b?void 0:b.toSignificant(4)," ").concat(null===(o=p[us.CURRENCY_B])||void 0===o?void 0:o.symbol)})]}),Object(r.jsx)(en,{style:{justifyContent:"flex-end"},children:Object(r.jsx)(s.z,{children:"1 ".concat(null===(u=p[us.CURRENCY_B])||void 0===u?void 0:u.symbol," = ").concat(null===b||void 0===b?void 0:b.invert().toSignificant(4)," ").concat(null===(l=p[us.CURRENCY_A])||void 0===l?void 0:l.symbol)})}),Object(r.jsxs)(en,{children:[Object(r.jsx)(s.z,{children:"Share of Pool:"}),Object(r.jsxs)(s.z,{children:[d?"100":null===j||void 0===j?void 0:j.toSignificant(4),"%"]})]}),Object(r.jsx)(s.d,{mt:"20px",onClick:h,children:d?$t(250,"Create Pool & Supply"):$t(252,"Confirm Supply")})]})}function cu(e){var n,t,i,a,c,o,u,l,d=e.currencies,b=e.noLiquidity,p=e.poolTokenPercentage,f=e.price;return Object(r.jsx)(Pe,{gap:"md",children:Object(r.jsxs)(tn,{justify:"space-around",gap:"4px",children:[Object(r.jsxs)(Pe,{justify:"center",children:[Object(r.jsx)(s.z,{children:null!==(n=null===f||void 0===f?void 0:f.toSignificant(6))&&void 0!==n?n:"-"}),Object(r.jsxs)(s.z,{fontSize:"14px",color:"textSubtle",pt:1,children:[null===(t=d[us.CURRENCY_B])||void 0===t?void 0:t.symbol," per ",null===(i=d[us.CURRENCY_A])||void 0===i?void 0:i.symbol]})]}),Object(r.jsxs)(Pe,{justify:"center",children:[Object(r.jsx)(s.z,{children:null!==(a=null===f||void 0===f||null===(c=f.invert())||void 0===c?void 0:c.toSignificant(6))&&void 0!==a?a:"-"}),Object(r.jsxs)(s.z,{fontSize:"14px",color:"textSubtle",pt:1,children:[null===(o=d[us.CURRENCY_A])||void 0===o?void 0:o.symbol," per ",null===(u=d[us.CURRENCY_B])||void 0===u?void 0:u.symbol]})]}),Object(r.jsxs)(Pe,{justify:"center",children:[Object(r.jsxs)(s.z,{children:[b&&f?"100":null!==(l=(null===p||void 0===p?void 0:p.lessThan(fe))?"<0.01":null===p||void 0===p?void 0:p.toFixed(2))&&void 0!==l?l:"0","%"]}),Object(r.jsx)(s.z,{fontSize:"14px",color:"textSubtle",pt:1,children:"Share of Pool"})]})]})})}function ou(e){var n,t,a,c,o,u,l,d,b,p,j,h=e.match.params,m=h.currencyIdA,O=h.currencyIdB,x=e.history,g=ge(),C=g.account,w=g.chainId,k=g.library,T=mi(m),I=mi(O),N=Zt(),R=Boolean(w&&(T&&Object(J.o)(T,J.n[w])||I&&Object(J.o)(I,J.n[w]))),U=Xr(),A=Ps(),z=A.independentField,B=A.typedValue,P=A.otherTypedValue,M=function(e,n){var t,r,a,c,o,s,u,l=ge(),d=l.account,b=l.chainId,p=Ps(),j=p.independentField,h=p.typedValue,v=p.otherTypedValue,m=j===us.CURRENCY_A?us.CURRENCY_B:us.CURRENCY_A,O=Object(i.useMemo)((function(){var t;return t={},Object(y.a)(t,us.CURRENCY_A,null!==e&&void 0!==e?e:void 0),Object(y.a)(t,us.CURRENCY_B,null!==n&&void 0!==n?n:void 0),t}),[e,n]),x=Ho(O[us.CURRENCY_A],O[us.CURRENCY_B]),g=Object(f.a)(x,2),C=g[0],w=g[1],k=uo(null===w||void 0===w?void 0:w.liquidityToken),T=C===qo.NOT_EXISTS||Boolean(k&&J.e.equal(k.raw,Bs)),I=Ci(null!==d&&void 0!==d?d:void 0,[O[us.CURRENCY_A],O[us.CURRENCY_B]]),E=(t={},Object(y.a)(t,us.CURRENCY_A,I[0]),Object(y.a)(t,us.CURRENCY_B,I[1]),t),N=Ts(h,O[j]),S=Object(i.useMemo)((function(){if(T)return v&&O[m]?Ts(v,O[m]):void 0;if(N){var t=po(N,b),r=[bo(e,b),bo(n,b)],i=r[0],a=r[1];if(i&&a&&t&&w){var c=m===us.CURRENCY_B?n:e,o=m===us.CURRENCY_B?w.priceOf(i).quote(t):w.priceOf(a).quote(t);return c===J.d?J.c.ether(o.raw):o}}}),[T,v,O,m,N,e,b,n,w]),R=(r={},Object(y.a)(r,us.CURRENCY_A,j===us.CURRENCY_A?N:S),Object(y.a)(r,us.CURRENCY_B,j===us.CURRENCY_A?S:N),r),U=Object(i.useMemo)((function(){if(T){var n=R[us.CURRENCY_A],t=R[us.CURRENCY_B];return n&&t?new J.h(n.currency,t.currency,n.raw,t.raw):void 0}var r=bo(e,b);return w&&r?w.priceOf(r):void 0}),[b,e,T,w,R]),A=Object(i.useMemo)((function(){var e=R[us.CURRENCY_A],n=R[us.CURRENCY_B],t=[po(e,b),po(n,b)],r=t[0],i=t[1];if(w&&k&&r&&i)return w.getLiquidityMinted(k,r,i)}),[R,b,w,k]),z=Object(i.useMemo)((function(){if(A&&k)return new J.g(A.raw,k.add(A).raw)}),[A,k]);d||(o="Connect Wallet"),C===qo.INVALID&&(o=null!==(s=o)&&void 0!==s?s:$t(136,"Invalid pair")),R[us.CURRENCY_A]&&R[us.CURRENCY_B]||(o=null!==(u=o)&&void 0!==u?u:$t(84,"Enter an amount"));var B,P,M=R[us.CURRENCY_A],D=R[us.CURRENCY_B];return M&&(null===E||void 0===E||null===(a=E[us.CURRENCY_A])||void 0===a?void 0:a.lessThan(M))&&(o="Insufficient ".concat(null===(B=O[us.CURRENCY_A])||void 0===B?void 0:B.symbol," balance")),D&&(null===E||void 0===E||null===(c=E[us.CURRENCY_B])||void 0===c?void 0:c.lessThan(D))&&(o="Insufficient ".concat(null===(P=O[us.CURRENCY_B])||void 0===P?void 0:P.symbol," balance")),{dependentField:m,currencies:O,pair:w,pairState:C,currencyBalances:E,parsedAmounts:R,price:U,noLiquidity:T,liquidityMinted:A,poolTokenPercentage:z,error:o}}(null!==T&&void 0!==T?T:void 0,null!==I&&void 0!==I?I:void 0),D=M.dependentField,L=M.currencies,_=M.pair,Y=M.pairState,F=M.currencyBalances,q=M.parsedAmounts,V=M.price,W=M.noLiquidity,H=M.liquidityMinted,Q=M.poolTokenPercentage,G=M.error,Z=function(e){var n=Object(v.c)();return{onFieldAInput:Object(i.useCallback)((function(t){n(ms({field:us.CURRENCY_A,typedValue:t,noLiquidity:!0===e}))}),[n,e]),onFieldBInput:Object(i.useCallback)((function(t){n(ms({field:us.CURRENCY_B,typedValue:t,noLiquidity:!0===e}))}),[n,e])}}(W),ee=Z.onFieldAInput,ne=Z.onFieldBInput,te=!G,re=Object(i.useState)(!1),ie=Object(f.a)(re,2),ae=ie[0],ce=ie[1],oe=Object(i.useState)(!1),se=Object(f.a)(oe,2),ue=se[0],le=se[1],de=$r(),be=Object(f.a)(de,1)[0],pe=Jr(),fe=Object(f.a)(pe,1)[0],je=Object(i.useState)(""),he=Object(f.a)(je,2),ve=he[0],me=he[1],Oe=(a={},Object(y.a)(a,z,B),Object(y.a)(a,D,W?P:null!==(n=null===(t=q[D])||void 0===t?void 0:t.toSignificant(6))&&void 0!==n?n:""),a),ye=[us.CURRENCY_A,us.CURRENCY_B].reduce((function(e,n){return Object(X.a)(Object(X.a)({},e),{},Object(y.a)({},n,Ms(F[n])))}),{}),xe=[us.CURRENCY_A,us.CURRENCY_B].reduce((function(e,n){var t,r;return Object(X.a)(Object(X.a)({},e),{},Object(y.a)({},n,null===(t=ye[n])||void 0===t?void 0:t.equalTo(null!==(r=q[n])&&void 0!==r?r:"0")))}),{}),Ce=vs(q[us.CURRENCY_A],$),we=Object(f.a)(Ce,2),ke=we[0],Te=we[1],Ie=vs(q[us.CURRENCY_B],$),Ee=Object(f.a)(Ie,2),Ne=Ee[0],Se=Ee[1],Re=as();function Ue(){return Ae.apply(this,arguments)}function Ae(){return(Ae=Object(S.a)(E.a.mark((function e(){var n,t,r,i,a,c,o,s,u,l,d,b,p,f,j,h,v;return E.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(w&&k&&C){e.next=2;break}return e.abrupt("return");case 2:if(t=xn(0,k,C),r=q[us.CURRENCY_A],i=q[us.CURRENCY_B],r&&i&&T&&I){e.next=6;break}return e.abrupt("return");case 6:return n={},Object(y.a)(n,us.CURRENCY_A,On(r,W?0:fe)[0]),Object(y.a)(n,us.CURRENCY_B,On(i,W?0:fe)[0]),a=n,c=Math.ceil(Date.now()/1e3)+be,T===J.d||I===J.d?(p=I===J.d,o=t.estimateGas.addLiquidityETH,s=t.addLiquidityETH,u=[null!==(d=null===(b=bo(p?T:I,w))||void 0===b?void 0:b.address)&&void 0!==d?d:"",(p?r:i).raw.toString(),a[p?us.CURRENCY_A:us.CURRENCY_B].toString(),a[p?us.CURRENCY_B:us.CURRENCY_A].toString(),C,c],l=bn.a.from((p?i:r).raw.toString())):(o=t.estimateGas.addLiquidity,s=t.addLiquidity,u=[null!==(f=null===(j=bo(T,w))||void 0===j?void 0:j.address)&&void 0!==f?f:"",null!==(h=null===(v=bo(I,w))||void 0===v?void 0:v.address)&&void 0!==h?h:"",r.raw.toString(),i.raw.toString(),a[us.CURRENCY_A].toString(),a[us.CURRENCY_B].toString(),C,c],l=null),le(!0),e.next=12,o.apply(void 0,Object(K.a)(u).concat([l?{value:l}:{}])).then((function(e){return s.apply(void 0,Object(K.a)(u).concat([Object(X.a)(Object(X.a)({},l?{value:l}:{}),{},{gasLimit:mn(e)})])).then((function(e){var n,t,r,i;le(!1),Re(e,{summary:"Add ".concat(null===(n=q[us.CURRENCY_A])||void 0===n?void 0:n.toSignificant(3)," ").concat(null===(t=L[us.CURRENCY_A])||void 0===t?void 0:t.symbol," and ").concat(null===(r=q[us.CURRENCY_B])||void 0===r?void 0:r.toSignificant(3)," ").concat(null===(i=L[us.CURRENCY_B])||void 0===i?void 0:i.symbol)}),me(e.hash)}))})).catch((function(e){le(!1),4001!==(null===e||void 0===e?void 0:e.code)&&console.error(e)}));case 12:case"end":return e.stop()}}),e)})))).apply(this,arguments)}var ze=function(){var e,n,t,i;return W?Object(r.jsx)(Pe,{gap:"20px",children:Object(r.jsx)(ft,{mt:"20px",borderRadius:"20px",children:Object(r.jsxs)(nn,{children:[Object(r.jsx)(s.z,{fontSize:"48px",mr:"8px",children:"".concat(null===(e=L[us.CURRENCY_A])||void 0===e?void 0:e.symbol,"/").concat(null===(n=L[us.CURRENCY_B])||void 0===n?void 0:n.symbol)}),Object(r.jsx)(Bc,{currency0:L[us.CURRENCY_A],currency1:L[us.CURRENCY_B],size:30})]})})}):Object(r.jsxs)(Pe,{gap:"20px",children:[Object(r.jsxs)(nn,{style:{marginTop:"20px"},children:[Object(r.jsx)(s.z,{fontSize:"48px",mr:"8px",children:null===H||void 0===H?void 0:H.toSignificant(6)}),Object(r.jsx)(Bc,{currency0:L[us.CURRENCY_A],currency1:L[us.CURRENCY_B],size:30})]}),Object(r.jsx)(an,{children:Object(r.jsx)(s.z,{fontSize:"24px",children:"".concat(null===(t=L[us.CURRENCY_A])||void 0===t?void 0:t.symbol,"/").concat(null===(i=L[us.CURRENCY_B])||void 0===i?void 0:i.symbol," Pool Tokens")})}),Object(r.jsx)(s.z,{small:!0,textAlign:"left",padding:"8px 0 0 0 ",style:{fontStyle:"italic"},children:"Output is estimated. If the price changes by more than ".concat(fe/100,"% your transaction will revert.")})]})},Me=function(){return Object(r.jsx)(au,{price:V,currencies:L,parsedAmounts:q,noLiquidity:W,onAdd:Ue,poolTokenPercentage:Q})},De="Supplying ".concat(null===(c=q[us.CURRENCY_A])||void 0===c?void 0:c.toSignificant(6)," ").concat(null===(o=L[us.CURRENCY_A])||void 0===o?void 0:o.symbol," and ").concat(null===(u=q[us.CURRENCY_B])||void 0===u?void 0:u.toSignificant(6)," ").concat(null===(l=L[us.CURRENCY_B])||void 0===l?void 0:l.symbol),Le=Object(i.useCallback)((function(e){var n=lo(e);n===O?x.push("/add/".concat(O,"/").concat(m)):x.push("/add/".concat(n,"/").concat(O))}),[O,x,m]),_e=Object(i.useCallback)((function(e){var n=lo(e);m===n?O?x.push("/add/".concat(O,"/").concat(n)):x.push("/add/".concat(n)):x.push("/add/".concat(m||"BNB","/").concat(n))}),[m,x,O]),Ye=Object(i.useCallback)((function(){ce(!1),ve&&ee(""),me("")}),[ee,ve]);return Object(r.jsxs)(r.Fragment,{children:[Object(r.jsx)(rr,{activeIndex:1}),Object(r.jsxs)($s,{children:[Object(r.jsx)(co,{adding:!0}),Object(r.jsxs)(tu,{children:[Object(r.jsx)(Qt,{isOpen:ae,onDismiss:Ye,attemptingTxn:ue,hash:ve,content:function(){return Object(r.jsx)(Vt,{title:W?N(1154,"You are creating a pool"):N(1156,"You will receive"),onDismiss:Ye,topContent:ze,bottomContent:Me})},pendingText:De}),Object(r.jsx)(s.h,{children:Object(r.jsxs)(Pe,{gap:"20px",children:[W&&Object(r.jsx)(Be,{children:Object(r.jsx)(Ls,{children:Object(r.jsxs)(Pe,{gap:"12px",children:[Object(r.jsx)(s.z,{children:N(1158,"You are the first liquidity provider.")}),Object(r.jsx)(s.z,{children:N(1160,"The ratio of tokens you add will set the price of this pool.")}),Object(r.jsx)(s.z,{children:N(1162,"Once you are happy with the rate click supply to review.")})]})})}),Object(r.jsx)($c,{value:Oe[us.CURRENCY_A],onUserInput:ee,onMax:function(){var e,n;ee(null!==(e=null===(n=ye[us.CURRENCY_A])||void 0===n?void 0:n.toExact())&&void 0!==e?e:"")},onCurrencySelect:Le,showMaxButton:!xe[us.CURRENCY_A],currency:L[us.CURRENCY_A],id:"add-liquidity-input-tokena",showCommonBases:!1}),Object(r.jsx)(Be,{children:Object(r.jsx)(s.a,{color:"textSubtle"})}),Object(r.jsx)($c,{value:Oe[us.CURRENCY_B],onUserInput:ne,onCurrencySelect:_e,onMax:function(){var e,n;ne(null!==(e=null===(n=ye[us.CURRENCY_B])||void 0===n?void 0:n.toExact())&&void 0!==e?e:"")},showMaxButton:!xe[us.CURRENCY_B],currency:L[us.CURRENCY_B],id:"add-liquidity-input-tokenb",showCommonBases:!1}),L[us.CURRENCY_A]&&L[us.CURRENCY_B]&&Y!==qo.INVALID&&Object(r.jsxs)("div",{children:[Object(r.jsx)(s.z,{style:{textTransform:"uppercase",fontWeight:600},color:"textSubtle",fontSize:"12px",mb:"2px",children:W?N(1164,"Initial prices and pool share"):N(1166,"Prices and pool share")}),Object(r.jsx)(Ls,{children:Object(r.jsx)(cu,{currencies:L,poolTokenPercentage:Q,noLiquidity:W,price:V})})]}),C?Object(r.jsxs)(Pe,{gap:"md",children:[(ke===ss.NOT_APPROVED||ke===ss.PENDING||Ne===ss.NOT_APPROVED||Ne===ss.PENDING)&&te&&Object(r.jsxs)(en,{children:[ke!==ss.APPROVED&&Object(r.jsx)(s.d,{onClick:Te,disabled:ke===ss.PENDING,style:{width:Ne!==ss.APPROVED?"48%":"100%"},children:ke===ss.PENDING?Object(r.jsxs)(iu,{children:["Approving ",null===(d=L[us.CURRENCY_A])||void 0===d?void 0:d.symbol]}):"Approve ".concat(null===(b=L[us.CURRENCY_A])||void 0===b?void 0:b.symbol)}),Ne!==ss.APPROVED&&Object(r.jsx)(s.d,{onClick:Se,disabled:Ne===ss.PENDING,style:{width:ke!==ss.APPROVED?"48%":"100%"},children:Ne===ss.PENDING?Object(r.jsxs)(iu,{children:["Approving ",null===(p=L[us.CURRENCY_B])||void 0===p?void 0:p.symbol]}):"Approve ".concat(null===(j=L[us.CURRENCY_B])||void 0===j?void 0:j.symbol)})]}),Object(r.jsx)(s.d,{onClick:function(){U?Ue():ce(!0)},disabled:!te||ke!==ss.APPROVED||Ne!==ss.APPROVED,variant:!te&&q[us.CURRENCY_A]&&q[us.CURRENCY_B]?"danger":"primary",width:"100%",children:null!==G&&void 0!==G?G:"Supply"})]}):Object(r.jsx)(Ks,{width:"100%"})]})})]})]}),_&&!W&&Y!==qo.INVALID?Object(r.jsx)(Pe,{style:{minWidth:"20rem",marginTop:"1rem"},children:Object(r.jsx)(Yo,{showUnwrapped:R,pair:_})}):null]})}var su=/^(0x[a-fA-F0-9]{40})-(0x[a-fA-F0-9]{40})$/;function uu(e){var n=e.match.params.currencyIdA.match(su);return(null===n||void 0===n?void 0:n.length)?Object(r.jsx)(h.a,{to:"/add/".concat(n[1],"/").concat(n[2])}):Object(r.jsx)(ou,Object(X.a)({},e))}function lu(e){var n=e.match.params,t=n.currencyIdA,i=n.currencyIdB;return t.toLowerCase()===i.toLowerCase()?Object(r.jsx)(h.a,{to:"/add/".concat(t)}):Object(r.jsx)(ou,Object(X.a)({},e))}var du=/^(0x[a-fA-F0-9]{40})-(0x[a-fA-F0-9]{40})$/;function bu(e){var n=e.match.params.tokens;if(!du.test(n))return Object(r.jsx)(h.a,{to:"/pool"});var t=n.split("-"),i=Object(f.a)(t,2),a=i[0],c=i[1];return Object(r.jsx)(h.a,{to:"/remove/".concat(a,"/").concat(c)})}function pu(){var e=Object(u.a)(["\n align-items: center;\n display: flex;\n flex-direction: column;\n\n ",":first-child {\n padding-left: 0;\n }\n\n ",":last-child {\n padding-right: 0;\n }\n\n "," {\n flex-direction: row;\n }\n"]);return pu=function(){return e},e}function fu(){var e=Object(u.a)(["\n padding: 0 4px;\n"]);return fu=function(){return e},e}var ju=l.default.div(fu()),hu=l.default.div(pu(),ju,ju,(function(e){return e.theme.mediaQueries.sm})),vu=[{label:"0.1%",value:.1},{label:"0.5%",value:.5},{label:"1%",value:1}],mu=function(e){var n=e.translateString,t=Jr(),a=Object(f.a)(t,2),c=a[0],o=a[1],u=Object(i.useState)(c/100),l=Object(f.a)(u,2),d=l[0],b=l[1],p=Object(i.useState)(null),j=Object(f.a)(p,2),h=j[0],v=j[1];return Object(i.useEffect)((function(){try{var e=100*d;!Number.isNaN(e)&&e>0&&e<5e3?(o(e),v(null)):v(n(1144,"Enter a valid slippage percentage"))}catch(t){v(n(1144,"Enter a valid slippage percentage"))}}),[d,v,o,n]),Object(i.useEffect)((function(){c<50?v(n(1146,"Your transaction may fail")):c>500&&v(n(1148,"Your transaction may be frontrun"))}),[c,v,n]),Object(r.jsxs)(s.c,{mb:"16px",children:[Object(r.jsxs)(s.n,{alignItems:"center",mb:"8px",children:[Object(r.jsx)(s.z,{bold:!0,children:n(88,"Slippage tolerance")}),Object(r.jsx)(sa,{text:n(186,"Your transaction will revert if the price changes unfavorably by more than this percentage.")})]}),Object(r.jsxs)(hu,{children:[Object(r.jsx)(s.n,{mb:["8px","8px",0],mr:[0,0,"8px"],children:vu.map((function(e){var n=e.label,t=e.value;return Object(r.jsx)(ju,{children:Object(r.jsx)(s.d,{variant:d===t?"primary":"tertiary",onClick:function(){return b(t)},children:n})},t)}))}),Object(r.jsxs)(s.n,{alignItems:"center",children:[Object(r.jsx)(ju,{children:Object(r.jsx)(s.r,{type:"number",scale:"lg",step:.1,min:.1,placeholder:"5%",value:d,onChange:function(e){var n=e.target.value;b(parseFloat(n))},isWarning:null!==h})}),Object(r.jsx)(ju,{children:Object(r.jsx)(s.z,{fontSize:"18px",children:"%"})})]})]}),h&&Object(r.jsx)(s.z,{mt:"8px",color:"failure",children:h})]})};function Ou(){var e=Object(u.a)(["\n align-items: center;\n display: inline-flex;\n\n & > "," {\n max-width: 100px;\n }\n"]);return Ou=function(){return e},e}var yu=l.default.div(Ou(),s.r),xu=function(e){var n=e.translateString,t=$r(),a=Object(f.a)(t,2),c=a[0],o=a[1],u=Object(i.useState)(c/60),l=Object(f.a)(u,2),d=l[0],b=l[1],p=Object(i.useState)(null),j=Object(f.a)(p,2),h=j[0],v=j[1];return Object(i.useEffect)((function(){try{var e=60*d;!Number.isNaN(e)&&e>0?(o(e),v(null)):v(n(1150,"Enter a valid deadline"))}catch(t){v(n(1150,"Enter a valid deadline"))}}),[d,v,o,n]),Object(r.jsxs)(s.c,{mb:"16px",children:[Object(r.jsxs)(s.n,{alignItems:"center",mb:"8px",children:[Object(r.jsx)(s.z,{bold:!0,children:n(90,"Transaction deadline")}),Object(r.jsx)(sa,{text:n(188,"Your transaction will revert if it is pending for more than this long.")})]}),Object(r.jsxs)(yu,{children:[Object(r.jsx)(s.r,{type:"number",step:"1",min:"1",value:d,onChange:function(e){var n=e.target.value;b(parseInt(n,10))}}),Object(r.jsx)(s.z,{fontSize:"14px",ml:"8px",children:"Minutes"})]}),h&&Object(r.jsx)(s.z,{mt:"8px",color:"failure",children:h})]})},gu=function(e){var n=e.translateString,t=Object(s.G)(),a=t.isSm,c=t.isXs,o=function(){var e=Object(v.c)(),n=Object(v.d)((function(e){return e.user.audioPlay})),t=Object(i.useCallback)((function(){e(n?Wr():Hr())}),[n,e]);return[n,t]}(),u=Object(f.a)(o,2),l=u[0],d=u[1];return Object(r.jsxs)(s.c,{mb:"16px",children:[Object(r.jsx)(s.n,{alignItems:"center",mb:"8px",children:Object(r.jsx)(s.z,{bold:!0,children:n(999,"Audio")})}),Object(r.jsx)(s.c,{children:Object(r.jsx)(s.w,{scale:a||c?"sm":"md",checked:l,onChange:d})})]})},Cu=function(){return null},wu=function(e){var n=e.onDismiss,t=void 0===n?Cu:n,i=e.translateString;return Object(r.jsxs)(s.u,{title:i(1200,"Settings"),onDismiss:t,children:[Object(r.jsx)(mu,{translateString:i}),Object(r.jsx)(xu,{translateString:i}),Object(r.jsx)(gu,{translateString:i})]})},ku=function(){return null},Tu=function(e,n){return n.addedTime-e.addedTime},Iu=function(e){var n=e.onDismiss,t=void 0===n?ku:n,a=e.translateString,c=ge(),o=c.account,u=c.chainId,l=cs(),d=Object(i.useMemo)((function(){return Object.values(l).filter(os).sort(Tu)}),[l]);return Object(r.jsxs)(s.u,{title:a(1202,"Recent transactions"),onDismiss:t,children:[!o&&Object(r.jsxs)(s.n,{justifyContent:"center",flexDirection:"column",alignItems:"center",children:[Object(r.jsx)(s.z,{mb:"8px",bold:!0,children:"Please connect your wallet to view your recent transactions"}),Object(r.jsx)(s.d,{variant:"tertiary",scale:"sm",onClick:t,children:"Close"})]}),o&&u&&0===d.length&&Object(r.jsxs)(s.n,{justifyContent:"center",flexDirection:"column",alignItems:"center",children:[Object(r.jsx)(s.z,{mb:"8px",bold:!0,children:"No recent transactions"}),Object(r.jsx)(s.d,{variant:"tertiary",scale:"sm",onClick:t,children:"Close"})]}),o&&u&&d.map((function(e){var n=e.hash,t=e.summary,i=function(e){var n=e.hash,t=e.receipt;return n?n&&1===(null===t||void 0===t?void 0:t.status)?{icon:Object(r.jsx)(s.i,{color:"success"}),color:"success"}:{icon:Object(r.jsx)(s.m,{color:"failure"}),color:"failure"}:{icon:Object(r.jsx)(rt,{}),color:"text"}}(e),a=i.icon,c=i.color;return Object(r.jsx)(r.Fragment,{children:Object(r.jsxs)(s.n,{alignItems:"center",justifyContent:"space-between",mb:"4px",children:[Object(r.jsx)(s.s,{href:hn(u,n,"transaction"),color:c,children:null!==t&&void 0!==t?t:n}),a]},n)})}))]})};function Eu(){var e=Object(u.a)(["\n flex: 1;\n"]);return Eu=function(){return e},e}function Nu(){var e=Object(u.a)(["\n border-bottom: 1px solid ",";\n padding: 24px;\n"]);return Nu=function(){return e},e}var Su,Ru=l.default.div(Nu(),(function(e){return e.theme.colors.borderColor})),Uu=l.default.div(Eu()),Au=function(e){var n=e.title,t=e.description,i=e.children,a=Zt(),c=Object(s.H)(Object(r.jsx)(wu,{translateString:a})),o=Object(f.a)(c,1)[0],u=Object(s.H)(Object(r.jsx)(Iu,{translateString:a})),l=Object(f.a)(u,1)[0];return Object(r.jsxs)(Ru,{children:[Object(r.jsxs)(s.n,{alignItems:"center",children:[Object(r.jsxs)(Uu,{children:[Object(r.jsx)(s.o,{mb:"8px",children:n}),t&&Object(r.jsx)(s.z,{color:"textSubtle",fontSize:"14px",children:t})]}),Object(r.jsx)(s.q,{variant:"text",onClick:o,title:a(1200,"Settings"),children:Object(r.jsx)(s.B,{width:"24px",color:"currentColor"})}),Object(r.jsx)(s.q,{variant:"text",onClick:l,title:a(1202,"Recent transactions"),children:Object(r.jsx)(s.p,{width:"24px",color:"currentColor"})})]}),i&&Object(r.jsx)(s.z,{mt:"16px",children:i})]})};function zu(){var e=Object(i.useContext)(l.ThemeContext),n=ge().account,t=Zt(),a=function(){var e=ge().chainId,n=fi(),t=Object(i.useMemo)((function(){var n;return e&&null!==(n=le[e])&&void 0!==n?n:[]}),[e]),r=Object(i.useMemo)((function(){return e?Br()(Object.keys(n),(function(t){var r,i=n[t];return(null!==(r=ue[e])&&void 0!==r?r:[]).map((function(e){return e.address===i.address?null:[e,i]})).filter((function(e){return null!==e}))})):[]}),[n,e]),a=Object(v.d)((function(e){return e.user.pairs})),c=Object(i.useMemo)((function(){if(!e||!a)return[];var n=a[e];return n?Object.keys(n).map((function(e){return[Kr(n[e].token0),Kr(n[e].token1)]})):[]}),[a,e]),o=Object(i.useMemo)((function(){return c.concat(r).concat(t)}),[r,t,c]);return Object(i.useMemo)((function(){var e=o.reduce((function(e,n){var t=Object(f.a)(n,2),r=t[0],i=t[1],a=r.sortsBefore(i),c=a?"".concat(r.address,":").concat(i.address):"".concat(i.address,":").concat(r.address);return e[c]||(e[c]=a?[r,i]:[i,r]),e}),{});return Object.keys(e).map((function(n){return e[n]}))}),[o])}(),c=Object(i.useMemo)((function(){return a.map((function(e){return{liquidityToken:ni(e),tokens:e}}))}),[a]),o=yi(null!==n&&void 0!==n?n:void 0,Object(i.useMemo)((function(){return c.map((function(e){return e.liquidityToken}))}),[c])),u=Object(f.a)(o,2),d=u[0],b=u[1],p=Object(i.useMemo)((function(){return c.filter((function(e){var n,t=e.liquidityToken;return null===(n=d[t.address])||void 0===n?void 0:n.greaterThan("0")}))}),[c,d]),h=Wo(p.map((function(e){return e.tokens}))),m=b||(null===h||void 0===h?void 0:h.length)0?Object(r.jsx)(r.Fragment,{children:O.map((function(e){return Object(r.jsx)(Fo,{pair:e},e.liquidityToken.address)}))}):Object(r.jsx)(ft,{padding:"40px",children:Object(r.jsx)(s.z,{color:"textDisabled",textAlign:"center",children:t(104,"No liquidity found.")})}):Object(r.jsx)(ft,{padding:"40px",children:Object(r.jsx)(s.z,{color:"textDisabled",textAlign:"center",children:t(156,"Connect to a wallet to view your liquidity.")})}),Object(r.jsxs)("div",{children:[Object(r.jsxs)(s.z,{fontSize:"14px",style:{padding:".5rem 0 .5rem 0"},children:[t(106,"Don't see a pool you joined?")," ",Object(r.jsx)(Nn,{id:"import-pool-link",to:"/find",children:t(108,"Import it.")})]}),Object(r.jsx)(s.z,{fontSize:"14px",style:{padding:".5rem 0 .5rem 0"},children:t(1172,"Or, if you staked your LP tokens in a farm, unstake them to see them here.")})]})]})})})]})]})}function Bu(){var e,n=ge().account,t=Object(i.useState)(!1),a=Object(f.a)(t,2),c=a[0],o=a[1],u=Object(i.useState)(Su.TOKEN1),l=Object(f.a)(u,2),d=l[0],b=l[1],p=Object(i.useState)(J.d),j=Object(f.a)(p,2),h=j[0],m=j[1],O=Object(i.useState)(null),y=Object(f.a)(O,2),x=y[0],g=y[1],C=Ho(null!==h&&void 0!==h?h:void 0,null!==x&&void 0!==x?x:void 0),w=Object(f.a)(C,2),k=w[0],T=w[1],I=function(){var e=Object(v.c)();return Object(i.useCallback)((function(n){e(qr({serializedPair:ei(n)}))}),[e])}(),E=Zt();Object(i.useEffect)((function(){T&&I(T)}),[T,I]);var N=k===qo.NOT_EXISTS||Boolean(k===qo.EXISTS&&T&&J.e.equal(T.reserve0.raw,J.e.BigInt(0))&&J.e.equal(T.reserve1.raw,J.e.BigInt(0))),S=gi(null!==n&&void 0!==n?n:void 0,null===T||void 0===T?void 0:T.liquidityToken),R=Boolean(S&&J.e.greaterThan(S.raw,J.e.BigInt(0))),U=Object(i.useCallback)((function(e){d===Su.TOKEN0?m(e):g(e)}),[d]),A=Object(i.useCallback)((function(){o(!1)}),[o]),z=Object(r.jsx)(ft,{padding:"45px 10px",children:Object(r.jsx)(s.z,{style:{textAlign:"center"},children:n?E(208,"Select a token to find your liquidity."):E(1174,"Connect to a wallet to find pools")})});return Object(r.jsxs)(r.Fragment,{children:[Object(r.jsx)(rr,{activeIndex:1}),Object(r.jsxs)($s,{children:[Object(r.jsx)(ao,{}),Object(r.jsxs)(s.h,{children:[Object(r.jsxs)(Pe,{gap:"md",children:[Object(r.jsx)(s.d,{onClick:function(){o(!0),b(Su.TOKEN0)},startIcon:h?Object(r.jsx)(ha,{currency:h,style:{marginRight:".5rem"}}):null,endIcon:Object(r.jsx)(s.j,{width:"24px",color:"white"}),width:"100%",children:h?h.symbol:E(82,"Select a Token")}),Object(r.jsx)(Be,{children:Object(r.jsx)(s.a,{color:"textSubtle"})}),Object(r.jsx)(s.d,{onClick:function(){o(!0),b(Su.TOKEN1)},startIcon:x?Object(r.jsx)(ha,{currency:x,style:{marginRight:".5rem"}}):null,endIcon:Object(r.jsx)(s.j,{width:"24px",color:"white"}),width:"100%",children:x?x.symbol:E(82,"Select a Token")}),R&&Object(r.jsx)(Be,{style:{justifyItems:"center",backgroundColor:"",padding:"12px 0px",borderRadius:"12px"},children:Object(r.jsx)(s.z,{style:{textAlign:"center"},children:E(210,"Pool found!")})}),h&&x?k===qo.EXISTS?R&&T?Object(r.jsx)(Yo,{pair:T}):Object(r.jsx)(ft,{padding:"45px 10px",children:Object(r.jsxs)(Pe,{gap:"sm",justify:"center",children:[Object(r.jsx)(s.z,{style:{textAlign:"center"},children:E(212,"You don\u2019t have liquidity in this pool yet.")}),Object(r.jsx)(Nn,{to:"/add/".concat(lo(h),"/").concat(lo(x)),children:Object(r.jsx)(s.z,{style:{textAlign:"center"},children:E(168,"Add Liquidity")})})]})}):N?Object(r.jsx)(ft,{padding:"45px 10px",children:Object(r.jsxs)(Pe,{gap:"sm",justify:"center",children:[Object(r.jsx)(s.z,{style:{textAlign:"center"},children:E(214,"No pool found.")}),Object(r.jsx)(Nn,{to:"/add/".concat(lo(h),"/").concat(lo(x)),children:"Create pool."})]})}):k===qo.INVALID?Object(r.jsx)(ft,{padding:"45px 10px",children:Object(r.jsx)(Pe,{gap:"sm",justify:"center",children:Object(r.jsx)(s.z,{style:{textAlign:"center"},children:E(136,"Invalid pair.")})})}):k===qo.LOADING?Object(r.jsx)(ft,{padding:"45px 10px",children:Object(r.jsx)(Pe,{gap:"sm",justify:"center",children:Object(r.jsxs)(s.z,{style:{textAlign:"center"},children:["Loading",Object(r.jsx)(iu,{})]})})}):null:z]}),Object(r.jsx)(Ec,{isOpen:c,onCurrencySelect:U,onDismiss:A,showCommonBases:!0,selectedCurrency:null!==(e=d===Su.TOKEN0?x:h)&&void 0!==e?e:void 0})]})]})]})}!function(e){e[e.TOKEN0=0]="TOKEN0",e[e.TOKEN1=1]="TOKEN1"}(Su||(Su={}));var Pu=t(3),Mu=t(433),Du=t(434);function Lu(){var e=Object(u.a)(["\n -webkit-appearance: none; /* Hides the slider so that custom slider can be made */\n width: 100%; /* Specific width is required for Firefox. */\n background: transparent; /* Otherwise white in Chrome */\n cursor: pointer;\n\n &:focus {\n outline: none;\n }\n\n &::-moz-focus-outer {\n border: 0;\n }\n\n &::-webkit-slider-thumb {\n -webkit-appearance: none;\n height: ","px;\n width: ","px;\n background-color: #565a69;\n border-radius: 100%;\n border: none;\n transform: translateY(-50%);\n color: ",";\n\n &:hover,\n &:focus {\n box-shadow: 0px 0px 1px rgba(0, 0, 0, 0.1), 0px 4px 8px rgba(0, 0, 0, 0.08), 0px 16px 24px rgba(0, 0, 0, 0.06),\n 0px 24px 32px rgba(0, 0, 0, 0.04);\n }\n }\n\n &::-moz-range-thumb {\n height: ","px;\n width: ","px;\n background-color: #565a69;\n border-radius: 100%;\n border: none;\n color: ",";\n\n &:hover,\n &:focus {\n box-shadow: 0px 0px 1px rgba(0, 0, 0, 0.1), 0px 4px 8px rgba(0, 0, 0, 0.08), 0px 16px 24px rgba(0, 0, 0, 0.06),\n 0px 24px 32px rgba(0, 0, 0, 0.04);\n }\n }\n\n &::-ms-thumb {\n height: ","px;\n width: ","px;\n background-color: #565a69;\n border-radius: 100%;\n color: ",";\n\n &:hover,\n &:focus {\n box-shadow: 0px 0px 1px rgba(0, 0, 0, 0.1), 0px 4px 8px rgba(0, 0, 0, 0.08), 0px 16px 24px rgba(0, 0, 0, 0.06),\n 0px 24px 32px rgba(0, 0, 0, 0.04);\n }\n }\n\n &::-webkit-slider-runnable-track {\n background: linear-gradient(\n 90deg,\n ",",\n ","\n );\n height: 2px;\n }\n\n &::-moz-range-track {\n background: linear-gradient(\n 90deg,\n ",",\n ","\n );\n height: 2px;\n }\n\n &::-ms-track {\n width: 100%;\n border-color: transparent;\n color: transparent;\n\n background: ",";\n height: 2px;\n }\n &::-ms-fill-lower {\n background: ",";\n }\n &::-ms-fill-upper {\n background: ",";\n }\n"]);return Lu=function(){return e},e}var _u,Yu=l.default.input(Lu(),(function(e){return e.size}),(function(e){return e.size}),(function(e){return e.theme.colors.invertedContrast}),(function(e){return e.size}),(function(e){return e.size}),(function(e){return e.theme.colors.invertedContrast}),(function(e){return e.size}),(function(e){return e.size}),(function(e){return e.theme.colors.invertedContrast}),(function(e){return e.theme.colors.primaryDark}),(function(e){return e.theme.colors.tertiary}),(function(e){return e.theme.colors.primaryDark}),(function(e){return e.theme.colors.tertiary}),(function(e){return e.theme.colors.primaryDark}),(function(e){return e.theme.colors.primaryDark}),(function(e){return e.theme.colors.tertiary}));function Fu(e){var n=e.value,t=e.onChange,a=e.min,c=void 0===a?0:a,o=e.step,s=void 0===o?1:o,u=e.max,l=void 0===u?100:u,d=e.size,b=void 0===d?28:d,p=Object(i.useCallback)((function(e){t(parseInt(e.target.value))}),[t]);return Object(r.jsx)(Yu,{size:b,type:"range",value:n,style:{width:"90%",marginLeft:15,marginRight:15,padding:"15px 0"},onChange:p,"aria-labelledby":"input slider",step:s,min:c,max:l})}!function(e){e.LIQUIDITY_PERCENT="LIQUIDITY_PERCENT",e.LIQUIDITY="LIQUIDITY",e.CURRENCY_A="CURRENCY_A",e.CURRENCY_B="CURRENCY_B"}(_u||(_u={}));var qu=Object(Ce.b)("burn/typeInputBurn");function Vu(){return Object(v.d)((function(e){return e.burn}))}function Wu(){var e=Object(u.a)(["\n padding-left: 24px;\n padding-right: 24px;\n"]);return Wu=function(){return e},e}function Hu(){var e=Object(u.a)(["\n border: 1px solid ",";\n border-radius: 16px;\n padding: 24px;\n"]);return Hu=function(){return e},e}var Qu=l.default.div(Hu(),(function(e){return e.theme.colors.borderColor})),Gu=l.default.div(Wu());function Ku(e){var n,t,a,c,o,u,d,b,p,j,h,m,O,x,g=e.history,C=e.match.params,w=C.currencyIdA,k=C.currencyIdB,T=null!==(n=mi(w))&&void 0!==n?n:void 0,I=null!==(t=mi(k))&&void 0!==t?t:void 0,N=ge(),R=N.account,U=N.chainId,A=N.library,z=Zt(),B=Object(i.useMemo)((function(){return[bo(T,U),bo(I,U)]}),[T,I,U]),P=Object(f.a)(B,2),M=P[0],D=P[1],L=Object(i.useContext)(l.ThemeContext),_=Vu(),Y=_.independentField,F=_.typedValue,q=function(e,n){var t,r,i,a,c,o=ge(),s=o.account,u=o.chainId,l=Vu(),d=l.independentField,b=l.typedValue,p=Ho(e,n),j=Object(f.a)(p,2)[1],h=xi(null!==s&&void 0!==s?s:void 0,[null===j||void 0===j?void 0:j.liquidityToken]),v=null===h||void 0===h?void 0:h[null!==(t=null===j||void 0===j||null===(r=j.liquidityToken)||void 0===r?void 0:r.address)&&void 0!==t?t:""],m=[bo(e,u),bo(n,u)],O=m[0],x=m[1],g=(i={},Object(y.a)(i,_u.CURRENCY_A,O),Object(y.a)(i,_u.CURRENCY_B,x),Object(y.a)(i,_u.LIQUIDITY,null===j||void 0===j?void 0:j.liquidityToken),i),C=uo(null===j||void 0===j?void 0:j.liquidityToken),w=j&&C&&v&&O&&J.e.greaterThanOrEqual(C.raw,v.raw)?new J.k(O,j.getLiquidityValue(O,C,v,!1).raw):void 0,k=j&&C&&v&&x&&J.e.greaterThanOrEqual(C.raw,v.raw)?new J.k(x,j.getLiquidityValue(x,C,v,!1).raw):void 0,T=(a={},Object(y.a)(a,_u.CURRENCY_A,w),Object(y.a)(a,_u.CURRENCY_B,k),a),I=new J.g("0","100");if(d===_u.LIQUIDITY_PERCENT)I=new J.g(b,"100");else if(d===_u.LIQUIDITY){if(null===j||void 0===j?void 0:j.liquidityToken){var E=Ts(b,j.liquidityToken);E&&v&&!E.greaterThan(v)&&(I=new J.g(E.raw,v.raw))}}else if(g[d]){var N=Ts(b,g[d]),S=T[d];N&&S&&!N.greaterThan(S)&&(I=new J.g(N.raw,S.raw))}var R,U,A=(c={},Object(y.a)(c,_u.LIQUIDITY_PERCENT,I),Object(y.a)(c,_u.LIQUIDITY,v&&I&&I.greaterThan("0")?new J.k(v.token,I.multiply(v.raw).quotient):void 0),Object(y.a)(c,_u.CURRENCY_A,O&&I&&I.greaterThan("0")&&w?new J.k(O,I.multiply(w.raw).quotient):void 0),Object(y.a)(c,_u.CURRENCY_B,x&&I&&I.greaterThan("0")&&k?new J.k(x,I.multiply(k.raw).quotient):void 0),c);return s||(R="Connect Wallet"),A[_u.LIQUIDITY]&&A[_u.CURRENCY_A]&&A[_u.CURRENCY_B]||(R=null!==(U=R)&&void 0!==U?U:"Enter an amount"),{pair:j,parsedAmounts:A,error:R}}(null!==T&&void 0!==T?T:void 0,null!==I&&void 0!==I?I:void 0),V=q.pair,W=q.parsedAmounts,H=q.error,Q=function(){var e=Object(v.c)();return{onUserInput:Object(i.useCallback)((function(n,t){e(qu({field:n,typedValue:t}))}),[e])}}().onUserInput,G=!H,X=Object(i.useState)(!1),Z=Object(f.a)(X,2),ee=Z[0],ne=Z[1],te=Object(i.useState)(!1),re=Object(f.a)(te,2),ie=re[0],ae=re[1],ce=Object(i.useState)(!1),oe=Object(f.a)(ce,2),se=oe[0],ue=oe[1],le=Object(i.useState)(""),de=Object(f.a)(le,2),be=de[0],pe=de[1],fe=$r(),je=Object(f.a)(fe,1)[0],he=Jr(),ve=Object(f.a)(he,1)[0],me=(p={},Object(y.a)(p,_u.LIQUIDITY_PERCENT,W[_u.LIQUIDITY_PERCENT].equalTo("0")?"0":W[_u.LIQUIDITY_PERCENT].lessThan(new J.g("1","100"))?"<1":W[_u.LIQUIDITY_PERCENT].toFixed(0)),Object(y.a)(p,_u.LIQUIDITY,Y===_u.LIQUIDITY?F:null!==(a=null===(c=W[_u.LIQUIDITY])||void 0===c?void 0:c.toSignificant(6))&&void 0!==a?a:""),Object(y.a)(p,_u.CURRENCY_A,Y===_u.CURRENCY_A?F:null!==(o=null===(u=W[_u.CURRENCY_A])||void 0===u?void 0:u.toSignificant(6))&&void 0!==o?o:""),Object(y.a)(p,_u.CURRENCY_B,Y===_u.CURRENCY_B?F:null!==(d=null===(b=W[_u.CURRENCY_B])||void 0===b?void 0:b.toSignificant(6))&&void 0!==d?d:""),p),Oe=null===(j=W[_u.LIQUIDITY_PERCENT])||void 0===j?void 0:j.equalTo(new J.g("1")),ye=ui(null===V||void 0===V||null===(h=V.liquidityToken)||void 0===h?void 0:h.address,ri.a,x),xe=Object(i.useState)(null),Ce=Object(f.a)(xe,2),we=Ce[0],ke=Ce[1],Te=vs(W[_u.LIQUIDITY],$),Ie=Object(f.a)(Te,2),Ee=Ie[0],Ne=Ie[1];function Se(){return(Se=Object(S.a)(E.a.mark((function e(){var n,t,r,i,a,c,o,s;return E.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(ye&&V&&A){e.next=2;break}throw new Error("missing dependencies");case 2:if(n=W[_u.LIQUIDITY]){e.next=5;break}throw new Error("missing liquidity amount");case 5:return e.next=7,ye.nonces(R);case 7:t=e.sent,r=Math.ceil(Date.now()/1e3)+je,i=[{name:"name",type:"string"},{name:"version",type:"string"},{name:"chainId",type:"uint256"},{name:"verifyingContract",type:"address"}],a={name:"Pancake LPs",version:"1",chainId:U,verifyingContract:V.liquidityToken.address},c=[{name:"owner",type:"address"},{name:"spender",type:"address"},{name:"value",type:"uint256"},{name:"nonce",type:"uint256"},{name:"deadline",type:"uint256"}],o={owner:R,spender:$,value:n.raw.toString(),nonce:t.toHexString(),deadline:r},s=JSON.stringify({types:{EIP712Domain:i,Permit:c},domain:a,primaryType:"Permit",message:o}),A.send("eth_signTypedData_v4",[R,s]).then(Pu.splitSignature).then((function(e){ke({v:e.v,r:e.r,s:e.s,deadline:r})})).catch((function(e){4001!==(null===e||void 0===e?void 0:e.code)&&Ne()}));case 15:case"end":return e.stop()}}),e)})))).apply(this,arguments)}var Re=Object(i.useCallback)((function(e,n){return ke(null),Q(e,n)}),[Q]),Ue=Object(i.useCallback)((function(e){return Re(_u.LIQUIDITY,e)}),[Re]),Ae=Object(i.useCallback)((function(e){return Re(_u.CURRENCY_A,e)}),[Re]),ze=Object(i.useCallback)((function(e){return Re(_u.CURRENCY_B,e)}),[Re]),Me=as();function De(){return Le.apply(this,arguments)}function Le(){return(Le=Object(S.a)(E.a.mark((function e(){var n,t,r,i,a,c,o,s,u,l,d,b,p,f,j;return E.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(U&&A&&R){e.next=2;break}throw new Error("missing dependencies");case 2:if(t=W[_u.CURRENCY_A],r=W[_u.CURRENCY_B],t&&r){e.next=5;break}throw new Error("missing currency amounts");case 5:if(i=xn(0,A,R),n={},Object(y.a)(n,_u.CURRENCY_A,On(t,ve)[0]),Object(y.a)(n,_u.CURRENCY_B,On(r,ve)[0]),a=n,T&&I){e.next=9;break}throw new Error("missing tokens");case 9:if(c=W[_u.LIQUIDITY]){e.next=12;break}throw new Error("missing liquidity amount");case 12:if(o=I===J.d,s=T===J.d||o,u=Math.ceil(Date.now()/1e3)+je,M&&D){e.next=17;break}throw new Error("could not wrap");case 17:if(Ee!==ss.APPROVED){e.next=21;break}s?(l=["removeLiquidityETH","removeLiquidityETHSupportingFeeOnTransferTokens"],d=[o?M.address:D.address,c.raw.toString(),a[o?_u.CURRENCY_A:_u.CURRENCY_B].toString(),a[o?_u.CURRENCY_B:_u.CURRENCY_A].toString(),R,u]):(l=["removeLiquidity"],d=[M.address,D.address,c.raw.toString(),a[_u.CURRENCY_A].toString(),a[_u.CURRENCY_B].toString(),R,u]),e.next=26;break;case 21:if(null===we){e.next=25;break}s?(l=["removeLiquidityETHWithPermit","removeLiquidityETHWithPermitSupportingFeeOnTransferTokens"],d=[o?M.address:D.address,c.raw.toString(),a[o?_u.CURRENCY_A:_u.CURRENCY_B].toString(),a[o?_u.CURRENCY_B:_u.CURRENCY_A].toString(),R,we.deadline,!1,we.v,we.r,we.s]):(l=["removeLiquidityWithPermit"],d=[M.address,D.address,c.raw.toString(),a[_u.CURRENCY_A].toString(),a[_u.CURRENCY_B].toString(),R,we.deadline,!1,we.v,we.r,we.s]),e.next=26;break;case 25:throw new Error("Attempting to confirm without approval or a signature. Please contact support.");case 26:return e.next=28,Promise.all(l.map((function(e,n){var t;return(t=i.estimateGas)[e].apply(t,Object(K.a)(d)).then(mn).catch((function(t){console.error("estimateGas failed",n,e,d,t)}))})));case 28:if(b=e.sent,-1!==(p=b.findIndex((function(e){return bn.a.isBigNumber(e)})))){e.next=34;break}console.error("This transaction would fail. Please contact support."),e.next=39;break;case 34:return f=l[p],j=b[p],ue(!0),e.next=39,i[f].apply(i,Object(K.a)(d).concat([{gasLimit:j}])).then((function(e){var n,t;ue(!1),Me(e,{summary:"Remove ".concat(null===(n=W[_u.CURRENCY_A])||void 0===n?void 0:n.toSignificant(3)," ").concat(null===T||void 0===T?void 0:T.symbol," and ").concat(null===(t=W[_u.CURRENCY_B])||void 0===t?void 0:t.toSignificant(3)," ").concat(null===I||void 0===I?void 0:I.symbol)}),pe(e.hash)})).catch((function(e){ue(!1),console.error(e)}));case 39:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function _e(){var e,n;return Object(r.jsxs)(Pe,{gap:"md",style:{marginTop:"20px"},children:[Object(r.jsxs)(en,{align:"flex-end",children:[Object(r.jsx)(s.z,{fontSize:"24px",children:null===(e=W[_u.CURRENCY_A])||void 0===e?void 0:e.toSignificant(6)}),Object(r.jsxs)(rn,{gap:"4px",children:[Object(r.jsx)(ha,{currency:T,size:"24px"}),Object(r.jsx)(s.z,{fontSize:"24px",style:{marginLeft:"10px"},children:null===T||void 0===T?void 0:T.symbol})]})]}),Object(r.jsx)(rn,{children:Object(r.jsx)(Mu.a,{size:"16",color:L.colors.textSubtle})}),Object(r.jsxs)(en,{align:"flex-end",children:[Object(r.jsx)(s.z,{fontSize:"24px",children:null===(n=W[_u.CURRENCY_B])||void 0===n?void 0:n.toSignificant(6)}),Object(r.jsxs)(rn,{gap:"4px",children:[Object(r.jsx)(ha,{currency:I,size:"24px"}),Object(r.jsx)(s.z,{fontSize:"24px",style:{marginLeft:"10px"},children:null===I||void 0===I?void 0:I.symbol})]})]}),Object(r.jsx)(s.z,{small:!0,color:"textSubtle",textAlign:"left",padding:"12px 0 0 0",style:{fontStyle:"italic"},children:"Output is estimated. If the price changes by more than ".concat(ve/100,"% your transaction will revert.")})]})}function Ye(){var e;return Object(r.jsxs)(r.Fragment,{children:[Object(r.jsxs)(en,{children:[Object(r.jsxs)(s.z,{color:"textSubtle",children:["LP ".concat(null===T||void 0===T?void 0:T.symbol,"/").concat(null===I||void 0===I?void 0:I.symbol)," Burned"]}),Object(r.jsxs)(rn,{children:[Object(r.jsx)(Bc,{currency0:T,currency1:I,margin:!0}),Object(r.jsx)(s.z,{children:null===(e=W[_u.LIQUIDITY])||void 0===e?void 0:e.toSignificant(6)})]})]}),V&&Object(r.jsxs)(r.Fragment,{children:[Object(r.jsxs)(en,{children:[Object(r.jsx)(s.z,{color:"textSubtle",children:z(1182,"Price")}),Object(r.jsxs)(s.z,{children:["1 ",null===T||void 0===T?void 0:T.symbol," = ",M?V.priceOf(M).toSignificant(6):"-"," ",null===I||void 0===I?void 0:I.symbol]})]}),Object(r.jsxs)(en,{children:[Object(r.jsx)("div",{}),Object(r.jsxs)(s.z,{children:["1 ",null===I||void 0===I?void 0:I.symbol," = ",D?V.priceOf(D).toSignificant(6):"-"," ",null===T||void 0===T?void 0:T.symbol]})]})]}),Object(r.jsx)(s.d,{disabled:!(Ee===ss.APPROVED||null!==we),onClick:De,children:z(1136,"Confirm")})]})}var Fe="Removing ".concat(null===(m=W[_u.CURRENCY_A])||void 0===m?void 0:m.toSignificant(6)," ").concat(null===T||void 0===T?void 0:T.symbol," and ").concat(null===(O=W[_u.CURRENCY_B])||void 0===O?void 0:O.toSignificant(6)," ").concat(null===I||void 0===I?void 0:I.symbol),qe=Object(i.useCallback)((function(e){Re(_u.LIQUIDITY_PERCENT,e.toString())}),[Re]),Ve=T===J.d||I===J.d,We=Boolean(U&&(T&&Object(J.o)(J.n[U],T)||I&&Object(J.o)(J.n[U],I))),He=Object(i.useCallback)((function(e){k&&lo(e)===k?g.push("/remove/".concat(lo(e),"/").concat(w)):g.push("/remove/".concat(lo(e),"/").concat(k))}),[w,k,g]),Qe=Object(i.useCallback)((function(e){w&&lo(e)===w?g.push("/remove/".concat(k,"/").concat(lo(e))):g.push("/remove/".concat(w,"/").concat(lo(e)))}),[w,k,g]),Ge=Object(i.useCallback)((function(){ne(!1),ke(null),be&&Re(_u.LIQUIDITY_PERCENT,"0"),pe("")}),[Re,be]),Ke=function(e,n){var t=arguments.length>2&&void 0!==arguments[2]?arguments[2]:100,r=Object(i.useState)((function(){return e})),a=Object(f.a)(r,2),c=a[0],o=a[1],s=Object(i.useRef)(),u=Object(i.useCallback)((function(e){o(e),s.current&&clearTimeout(s.current),s.current=setTimeout((function(){n(e),s.current=void 0}),t)}),[t,n]);return Object(i.useEffect)((function(){s.current&&(clearTimeout(s.current),s.current=void 0),o(e)}),[e]),[c,u]}(Number.parseInt(W[_u.LIQUIDITY_PERCENT].toFixed(0)),qe),Xe=Object(f.a)(Ke,2),Je=Xe[0],$e=Xe[1];return Object(r.jsxs)(r.Fragment,{children:[Object(r.jsxs)($s,{children:[Object(r.jsx)(co,{adding:!1}),Object(r.jsxs)(tu,{children:[Object(r.jsx)(Qt,{isOpen:ee,onDismiss:Ge,attemptingTxn:se,hash:be||"",content:function(){return Object(r.jsx)(Vt,{title:z(1156,"You will receive"),onDismiss:Ge,topContent:_e,bottomContent:Ye})},pendingText:Fe}),Object(r.jsxs)(Pe,{gap:"md",children:[Object(r.jsx)(Gu,{children:Object(r.jsx)(Qu,{children:Object(r.jsxs)(Pe,{children:[Object(r.jsxs)(en,{children:[Object(r.jsx)(s.z,{children:"Amount"}),Object(r.jsx)(ru,{onClick:function(){ae(!ie)},children:ie?z(1184,"Simple"):z(1186,"Detailed")})]}),Object(r.jsx)(s.n,{justifyContent:"start",children:Object(r.jsxs)(s.z,{fontSize:"64px",children:[me[_u.LIQUIDITY_PERCENT],"%"]})}),!ie&&Object(r.jsxs)(r.Fragment,{children:[Object(r.jsx)(s.n,{mb:"8px",children:Object(r.jsx)(Fu,{value:Je,onChange:$e})}),Object(r.jsxs)(s.n,{justifyContent:"space-around",children:[Object(r.jsx)(s.d,{variant:"tertiary",scale:"sm",onClick:function(){return Re(_u.LIQUIDITY_PERCENT,"25")},children:"25%"}),Object(r.jsx)(s.d,{variant:"tertiary",scale:"sm",onClick:function(){return Re(_u.LIQUIDITY_PERCENT,"50")},children:"50%"}),Object(r.jsx)(s.d,{variant:"tertiary",scale:"sm",onClick:function(){return Re(_u.LIQUIDITY_PERCENT,"75")},children:"75%"}),Object(r.jsx)(s.d,{variant:"tertiary",scale:"sm",onClick:function(){return Re(_u.LIQUIDITY_PERCENT,"100")},children:z(166,"Max")})]})]})]})})}),!ie&&Object(r.jsxs)(r.Fragment,{children:[Object(r.jsx)(Be,{children:Object(r.jsx)(Du.a,{size:"16",color:L.colors.textSubtle})}),Object(r.jsx)(Gu,{children:Object(r.jsx)(Qu,{children:Object(r.jsxs)(Pe,{gap:"10px",children:[Object(r.jsxs)(en,{children:[Object(r.jsx)(s.z,{fontSize:"24px",children:me[_u.CURRENCY_A]||"-"}),Object(r.jsxs)(rn,{children:[Object(r.jsx)(ha,{currency:T,style:{marginRight:"12px"}}),Object(r.jsx)(s.z,{fontSize:"24px",id:"remove-liquidity-tokena-symbol",children:null===T||void 0===T?void 0:T.symbol})]})]}),Object(r.jsxs)(en,{children:[Object(r.jsx)(s.z,{fontSize:"24px",children:me[_u.CURRENCY_B]||"-"}),Object(r.jsxs)(rn,{children:[Object(r.jsx)(ha,{currency:I,style:{marginRight:"12px"}}),Object(r.jsx)(s.z,{fontSize:"24px",id:"remove-liquidity-tokenb-symbol",children:null===I||void 0===I?void 0:I.symbol})]})]}),U&&(We||Ve)?Object(r.jsx)(en,{style:{justifyContent:"flex-end"},children:Ve?Object(r.jsx)(Nn,{to:"/remove/".concat(T===J.d?J.n[U].address:w,"/").concat(I===J.d?J.n[U].address:k),children:z(1188,"Receive WBNB")}):We?Object(r.jsx)(Nn,{to:"/remove/".concat(T&&Object(J.o)(T,J.n[U])?"BNB":w,"/").concat(I&&Object(J.o)(I,J.n[U])?"BNB":k),children:z(1190,"Receive BNB")}):null}):null]})})})]}),Object(r.jsxs)(Gu,{style:{paddingBottom:"24px"},children:[ie&&Object(r.jsxs)(r.Fragment,{children:[Object(r.jsx)($c,{value:me[_u.LIQUIDITY],onUserInput:Ue,onMax:function(){Re(_u.LIQUIDITY_PERCENT,"100")},showMaxButton:!Oe,disableCurrencySelect:!0,currency:null===V||void 0===V?void 0:V.liquidityToken,pair:V,id:"liquidity-amount"}),Object(r.jsx)(Be,{children:Object(r.jsx)(Du.a,{size:"16",color:L.colors.textSubtle})}),Object(r.jsx)($c,{hideBalance:!0,value:me[_u.CURRENCY_A],onUserInput:Ae,onMax:function(){return Re(_u.LIQUIDITY_PERCENT,"100")},showMaxButton:!Oe,currency:T,label:"Output",onCurrencySelect:He,id:"remove-liquidity-tokena"}),Object(r.jsx)(Be,{children:Object(r.jsx)(Mu.a,{size:"16",color:L.colors.textSubtle})}),Object(r.jsx)($c,{hideBalance:!0,value:me[_u.CURRENCY_B],onUserInput:ze,onMax:function(){return Re(_u.LIQUIDITY_PERCENT,"100")},showMaxButton:!Oe,currency:I,label:"Output",onCurrencySelect:Qe,id:"remove-liquidity-tokenb"})]}),V&&Object(r.jsxs)("div",{style:{padding:"24px"},children:[Object(r.jsxs)(s.n,{justifyContent:"space-between",mb:"8px",children:["Price:",Object(r.jsxs)("div",{children:["1 ",null===T||void 0===T?void 0:T.symbol," = ",M?V.priceOf(M).toSignificant(6):"-"," ",null===I||void 0===I?void 0:I.symbol]})]}),Object(r.jsxs)(s.n,{justifyContent:"space-between",children:[Object(r.jsx)("div",{}),Object(r.jsxs)("div",{children:["1 ",null===I||void 0===I?void 0:I.symbol," = ",D?V.priceOf(D).toSignificant(6):"-"," ",null===T||void 0===T?void 0:T.symbol]})]})]}),Object(r.jsx)("div",{style:{position:"relative"},children:R?Object(r.jsxs)(en,{children:[Object(r.jsx)(s.d,{onClick:function(){return Se.apply(this,arguments)},variant:Ee===ss.APPROVED||null!==we?"success":"primary",disabled:Ee!==ss.NOT_APPROVED||null!==we,mr:"8px",children:Ee===ss.PENDING?Object(r.jsx)(Uo,{children:"Approving"}):Ee===ss.APPROVED||null!==we?"Approved":"Approve"}),Object(r.jsx)(s.d,{onClick:function(){ne(!0)},disabled:!G||null===we&&Ee!==ss.APPROVED,variant:!G&&W[_u.CURRENCY_A]&&W[_u.CURRENCY_B]?"danger":"primary",children:H||"Remove"})]}):Object(r.jsx)(Ks,{width:"100%"})})]})]})]})]}),V?Object(r.jsx)(Pe,{style:{minWidth:"20rem",marginTop:"1rem"},children:Object(r.jsx)(Yo,{showUnwrapped:We,pair:V})}):null]})}function Xu(){var e=Object(u.a)(["\n font-size: 1.25rem;\n outline: none;\n border: none;\n flex: 1 1 auto;\n width: 0;\n background-color: ",";\n transition: color 300ms ",";\n color: ",";\n overflow: hidden;\n text-overflow: ellipsis;\n font-weight: 500;\n width: 100%;\n ::placeholder {\n color: ",";\n }\n padding: 0px;\n -webkit-appearance: textfield;\n\n ::-webkit-search-decoration {\n -webkit-appearance: none;\n }\n\n ::-webkit-outer-spin-button,\n ::-webkit-inner-spin-button {\n -webkit-appearance: none;\n }\n\n ::placeholder {\n color: ",";\n }\n"]);return Xu=function(){return e},e}function Ju(){var e=Object(u.a)(["\n flex: 1;\n padding: 1rem;\n"]);return Ju=function(){return e},e}function $u(){var e=Object(u.a)(["\n display: flex;\n justify-content: center;\n align-items: center;\n border-radius: 1.25rem;\n border: 1px solid ",";\n transition: border-color 300ms ",",\n color 500ms ",";\n background-color: ",";\n"]);return $u=function(){return e},e}function Zu(){var e=Object(u.a)(["\n display: flex;\n flex-flow: column nowrap;\n position: relative;\n border-radius: 1.25rem;\n background-color: ",";\n z-index: 1;\n width: 100%;\n"]);return Zu=function(){return e},e}var el=l.default.div(Zu(),(function(e){return e.theme.colors.invertedContrast})),nl=l.default.div($u(),(function(e){var n=e.error,t=e.theme;return n?t.colors.failure:t.colors.invertedContrast}),(function(e){return e.error?"step-end":"step-start"}),(function(e){return e.error?"step-end":"step-start"}),(function(e){return e.theme.colors.invertedContrast})),tl=l.default.div(Ju()),rl=l.default.input(Xu(),(function(e){return e.theme.colors.invertedContrast}),(function(e){return e.error?"step-end":"step-start"}),(function(e){var n=e.error,t=e.theme;return n?t.colors.failure:t.colors.primary}),(function(e){return e.theme.colors.textDisabled}),(function(e){return e.theme.colors.textDisabled}));function il(e){var n=e.id,t=e.value,a=e.onChange,c=ge().chainId,o=Zt(),u=gs(t),l=u.address,d=u.loading,b=u.name,p=Object(i.useCallback)((function(e){var n=e.target.value.replace(/\s+/g,"");a(n)}),[a]),f=Boolean(t.length>0&&!d&&!l);return Object(r.jsx)(el,{id:n,children:Object(r.jsx)(nl,{error:f,children:Object(r.jsx)(tl,{children:Object(r.jsxs)(Pe,{gap:"md",children:[Object(r.jsxs)(en,{children:[Object(r.jsx)(s.z,{color:"textSubtle",fontWeight:500,fontSize:"14px",children:o(1138,"Recipient")}),l&&c&&Object(r.jsx)(Rn,{href:hn(c,null!==b&&void 0!==b?b:l,"address"),style:{fontSize:"14px"},children:o(116,"(View on BscScan)")})]}),Object(r.jsx)(rl,{className:"recipient-address-input",type:"text",autoComplete:"off",autoCorrect:"off",autoCapitalize:"off",spellCheck:"false",placeholder:o(1140,"Wallet Address or ENS name"),error:f,pattern:"^(0x[a-fA-F0-9]{40})$",onChange:p,value:t})]})})})})}var al=t(435);function cl(e){var n=e.priceImpact;return Object(r.jsx)(So,{fontSize:"14px",severity:js(n),children:n?n.lessThan(fe)?"<0.01%":"".concat(n.toFixed(2),"%"):"-"})}function ol(e){var n,t,a,c,o=e.trade,u=e.onConfirm,l=e.allowedSlippage,d=e.swapErrorMessage,b=e.disabledConfirm,p=Object(i.useState)(!1),j=Object(f.a)(p,2),h=j[0],v=j[1],m=Object(i.useMemo)((function(){return fs(o,l)}),[l,o]),O=Object(i.useMemo)((function(){return ps(o)}),[o]),y=O.priceImpactWithoutFee,x=O.realizedLPFee,g=js(y),C=Zt();return Object(r.jsxs)(r.Fragment,{children:[Object(r.jsxs)(Pe,{gap:"0px",children:[Object(r.jsxs)(en,{align:"center",children:[Object(r.jsx)(s.z,{fontSize:"14px",children:"Price"}),Object(r.jsxs)(s.z,{fontSize:"14px",style:{justifyContent:"center",alignItems:"center",display:"flex",textAlign:"right",paddingLeft:"8px",fontWeight:500},children:[hs(o,h),Object(r.jsx)(Ro,{onClick:function(){return v(!h)},children:Object(r.jsx)(al.a,{size:14})})]})]}),Object(r.jsxs)(en,{children:[Object(r.jsxs)(rn,{children:[Object(r.jsx)(s.z,{fontSize:"14px",children:o.tradeType===J.m.EXACT_INPUT?C(1210,"Minimum received"):C(220,"Maximum sold")}),Object(r.jsx)(sa,{text:C(202,"Your transaction will revert if there is a large, unfavorable price movement before it is confirmed.")})]}),Object(r.jsxs)(rn,{children:[Object(r.jsx)(s.z,{fontSize:"14px",children:o.tradeType===J.m.EXACT_INPUT?null!==(n=null===(t=m[Ko.OUTPUT])||void 0===t?void 0:t.toSignificant(4))&&void 0!==n?n:"-":null!==(a=null===(c=m[Ko.INPUT])||void 0===c?void 0:c.toSignificant(4))&&void 0!==a?a:"-"}),Object(r.jsx)(s.z,{fontSize:"14px",marginLeft:"4px",children:o.tradeType===J.m.EXACT_INPUT?o.outputAmount.currency.symbol:o.inputAmount.currency.symbol})]})]}),Object(r.jsxs)(en,{children:[Object(r.jsxs)(rn,{children:[Object(r.jsx)(s.z,{fontSize:"14px",children:C(226,"Price Impact")}),Object(r.jsx)(sa,{text:C(224,"The difference between the market price and your price due to trade size.")})]}),Object(r.jsx)(cl,{priceImpact:y})]}),Object(r.jsxs)(en,{children:[Object(r.jsxs)(rn,{children:[Object(r.jsx)(s.z,{fontSize:"14px",children:C(228,"Liquidity Provider Fee")}),Object(r.jsx)(sa,{text:C(999,"For each trade a 0.2% fee is paid. 0.17% goes to liquidity providers and 0.03% goes to the PancakeSwap treasury.")})]}),Object(r.jsx)(s.z,{fontSize:"14px",children:x?"".concat(null===x||void 0===x?void 0:x.toSignificant(6)," ").concat(o.inputAmount.currency.symbol):"-"})]})]}),Object(r.jsxs)(tn,{children:[Object(r.jsx)(s.d,{onClick:u,disabled:b,variant:g>2?"danger":"primary",mt:"10px",id:"confirm-swap-or-send",width:"100%",children:g>2?"Swap Anyway":"Confirm Swap"}),d?Object(r.jsx)(Bo,{error:d}):null]})]})}function sl(){var e=Object(u.a)(["\n font-style: italic;\n line-height: 1.3;\n\n span {\n color: ",";\n font-weight: 600;\n }\n"]);return sl=function(){return e},e}var ul=Object(l.default)(s.z)(sl(),(function(e){return e.theme.colors.primary}));function ll(e){var n,t,a=e.trade,c=e.allowedSlippage,o=e.recipient,u=e.showAcceptChanges,d=e.onAcceptChanges,b=Object(i.useMemo)((function(){return fs(a,c)}),[a,c]),p=js(Object(i.useMemo)((function(){return ps(a)}),[a]).priceImpactWithoutFee),f=Object(i.useContext)(l.ThemeContext);return Object(r.jsxs)(Pe,{gap:"md",style:{marginTop:"20px"},children:[Object(r.jsxs)(en,{align:"flex-end",children:[Object(r.jsxs)(rn,{gap:"0px",children:[Object(r.jsx)(ha,{currency:a.inputAmount.currency,size:"24px",style:{marginRight:"12px"}}),Object(r.jsx)(s.z,{fontSize:"24px",color:u&&a.tradeType===J.m.EXACT_OUTPUT?f.colors.primary:"text",children:a.inputAmount.toSignificant(6)})]}),Object(r.jsx)(rn,{gap:"0px",children:Object(r.jsx)(s.z,{fontSize:"24px",style:{marginLeft:"10px",fontWeight:500},children:a.inputAmount.currency.symbol})})]}),Object(r.jsx)(rn,{children:Object(r.jsx)(Du.a,{size:"16",color:f.colors.textSubtle,style:{marginLeft:"4px",minWidth:"16px"}})}),Object(r.jsxs)(en,{align:"flex-end",children:[Object(r.jsxs)(rn,{gap:"0px",children:[Object(r.jsx)(ha,{currency:a.outputAmount.currency,size:"24px",style:{marginRight:"12px"}}),Object(r.jsx)(s.z,{fontSize:"24px",style:{marginLeft:"10px",fontWeight:500},color:p>2?f.colors.failure:u&&a.tradeType===J.m.EXACT_INPUT?f.colors.primary:"text",children:a.outputAmount.toSignificant(6)})]}),Object(r.jsx)(rn,{gap:"0px",children:Object(r.jsx)(s.z,{fontSize:"24px",style:{marginLeft:"10px",fontWeight:500},children:a.outputAmount.currency.symbol})})]}),u?Object(r.jsx)(Po,{justify:"flex-start",gap:"0px",children:Object(r.jsxs)(en,{children:[Object(r.jsxs)(rn,{children:[Object(r.jsx)(Wt.a,{size:20,style:{marginRight:"8px",minWidth:24}}),Object(r.jsx)(s.z,{color:"primary",children:" Price Updated"})]}),Object(r.jsx)(s.d,{onClick:d,children:"Accept"})]})}):null,Object(r.jsx)(Pe,{justify:"flex-start",gap:"sm",style:{padding:"16px 0 0"},children:a.tradeType===J.m.EXACT_INPUT?Object(r.jsxs)(ul,{children:["Output is estimated. You will receive at least ",Object(r.jsxs)("span",{children:[null===(n=b[Ko.OUTPUT])||void 0===n?void 0:n.toSignificant(6)," ",a.outputAmount.currency.symbol]})," or the transaction will revert."]}):Object(r.jsxs)(ul,{children:["Input is estimated. You will sell at most ",Object(r.jsxs)("span",{children:[null===(t=b[Ko.INPUT])||void 0===t?void 0:t.toSignificant(6)," ",a.inputAmount.currency.symbol]})," or the transaction will revert."]})}),null!==o?Object(r.jsx)(Pe,{justify:"flex-start",gap:"sm",style:{padding:"16px 0 0"},children:Object(r.jsxs)(s.z,{children:["Output will be sent to"," ",Object(r.jsx)("b",{title:o,children:fn(o)?vn(o):o})]})}):null]})}function dl(e){var n,t,a,c,o,s,u=e.trade,l=e.originalTrade,d=e.onAcceptChanges,b=e.allowedSlippage,p=e.onConfirm,f=e.onDismiss,j=e.recipient,h=e.swapErrorMessage,v=e.isOpen,m=e.attemptingTxn,O=e.txHash,y=Object(i.useMemo)((function(){return Boolean(u&&l&&(n=l,(e=u).tradeType!==n.tradeType||!Object(J.o)(e.inputAmount.currency,n.inputAmount.currency)||!e.inputAmount.equalTo(n.inputAmount)||!Object(J.o)(e.outputAmount.currency,n.outputAmount.currency)||!e.outputAmount.equalTo(n.outputAmount)));var e,n}),[l,u]),x=Object(i.useCallback)((function(){return u?Object(r.jsx)(ll,{trade:u,allowedSlippage:b,recipient:j,showAcceptChanges:y,onAcceptChanges:d}):null}),[b,d,j,y,u]),g=Object(i.useCallback)((function(){return u?Object(r.jsx)(ol,{onConfirm:p,trade:u,disabledConfirm:y,swapErrorMessage:h,allowedSlippage:b}):null}),[b,p,y,h,u]),C="Swapping ".concat(null===u||void 0===u||null===(n=u.inputAmount)||void 0===n?void 0:n.toSignificant(6)," ").concat(null===u||void 0===u||null===(t=u.inputAmount)||void 0===t||null===(a=t.currency)||void 0===a?void 0:a.symbol," for ").concat(null===u||void 0===u||null===(c=u.outputAmount)||void 0===c?void 0:c.toSignificant(6)," ").concat(null===u||void 0===u||null===(o=u.outputAmount)||void 0===o||null===(s=o.currency)||void 0===s?void 0:s.symbol),w=Object(i.useCallback)((function(){return h?Object(r.jsx)(Ht,{onDismiss:f,message:h}):Object(r.jsx)(Vt,{title:"Confirm Swap",onDismiss:f,topContent:x,bottomContent:g})}),[f,g,x,h]);return Object(r.jsx)(Qt,{isOpen:v,onDismiss:f,attemptingTxn:m,hash:O,content:w,pendingText:C})}var bl=t(436),pl=Object(i.memo)((function(e){var n=e.trade,t=Object(i.useContext)(l.ThemeContext);return Object(r.jsx)(s.n,{px:"1rem",py:"0.5rem",my:"0.5rem",style:{border:"1px solid ".concat(t.colors.tertiary),borderRadius:"1rem"},flexWrap:"wrap",justifyContent:"space-evenly",alignItems:"center",children:n.route.path.map((function(e,n,t){var a=n===t.length-1;return Object(r.jsxs)(i.Fragment,{children:[Object(r.jsxs)(s.n,{my:"0.5rem",alignItems:"center",style:{flexShrink:0},children:[Object(r.jsx)(ha,{currency:e,size:"1.5rem"}),Object(r.jsx)(s.z,{fontSize:"14px",color:"text",ml:"0.5rem",children:e.symbol})]}),a?null:Object(r.jsx)(bl.a,{color:"textSubtle"})]},n)}))})}));function fl(e){var n,t,i,a,c=e.trade,o=e.allowedSlippage,u=ps(c),l=u.priceImpactWithoutFee,d=u.realizedLPFee,b=c.tradeType===J.m.EXACT_INPUT,p=fs(c,o),f=Zt();return Object(r.jsx)(s.g,{children:Object(r.jsxs)(s.h,{children:[Object(r.jsxs)(en,{children:[Object(r.jsxs)(rn,{children:[Object(r.jsx)(s.z,{fontSize:"14px",children:b?f(1210,"Minimum received"):f(220,"Maximum sold")}),Object(r.jsx)(sa,{text:f(202,"Your transaction will revert if there is a large, unfavorable price movement before it is confirmed.")})]}),Object(r.jsx)(rn,{children:Object(r.jsx)(s.z,{fontSize:"14px",children:b?null!==(n="".concat(null===(t=p[Ko.OUTPUT])||void 0===t?void 0:t.toSignificant(4)," ").concat(c.outputAmount.currency.symbol))&&void 0!==n?n:"-":null!==(i="".concat(null===(a=p[Ko.INPUT])||void 0===a?void 0:a.toSignificant(4)," ").concat(c.inputAmount.currency.symbol))&&void 0!==i?i:"-"})})]}),Object(r.jsxs)(en,{children:[Object(r.jsxs)(rn,{children:[Object(r.jsx)(s.z,{fontSize:"14px",children:f(226,"Price Impact")}),Object(r.jsx)(sa,{text:f(224,"The difference between the market price and estimated price due to trade size.")})]}),Object(r.jsx)(cl,{priceImpact:l})]}),Object(r.jsxs)(en,{children:[Object(r.jsxs)(rn,{children:[Object(r.jsx)(s.z,{fontSize:"14px",children:f(228,"Liquidity Provider Fee")}),Object(r.jsx)(sa,{text:f(230,"For each trade a 0.2% fee is paid. 0.17% goes to liquidity providers and 0.03% goes to the PancakeSwap treasury.")})]}),Object(r.jsx)(s.z,{fontSize:"14px",children:d?"".concat(d.toSignificant(4)," ").concat(c.inputAmount.currency.symbol):"-"})]})]})})}function jl(e){var n=e.trade,t=Jr(),i=Object(f.a)(t,1)[0],a=Zt(),c=Boolean(n&&n.route.path.length>2);return Object(r.jsx)(Pe,{gap:"md",children:n&&Object(r.jsxs)(r.Fragment,{children:[Object(r.jsx)(fl,{trade:n,allowedSlippage:i}),c&&Object(r.jsxs)(r.Fragment,{children:[Object(r.jsx)(Eo,{}),Object(r.jsxs)(Pe,{style:{padding:"0 24px"},children:[Object(r.jsxs)(rn,{children:[Object(r.jsx)(s.z,{fontSize:"14px",children:"Route"}),Object(r.jsx)(sa,{text:a(999,"Routing through these tokens resulted in the best price for your trade.")})]}),Object(r.jsx)(pl,{trade:n})]})]})]})})}function hl(){var e=Object(u.a)(["\n padding-top: calc(16px + 2rem);\n padding-bottom: 20px;\n margin-top: -2rem;\n width: 100%;\n max-width: 400px;\n border-bottom-left-radius: 20px;\n border-bottom-right-radius: 20px;\n color: ",";\n z-index: 1;\n\n transform: ",";\n transition: transform 300ms ease-in-out;\n"]);return hl=function(){return e},e}var vl=l.default.div(hl(),(function(e){return e.theme.colors.textSubtle}),(function(e){return e.show?"translateY(0%)":"translateY(-100%)"}));function ml(e){var n,t=e.trade,i=Object(gn.a)(e,["trade"]),a=ki(t,Ti);return Object(r.jsx)(vl,{show:Boolean(t),children:Object(r.jsx)(jl,Object(X.a)(Object(X.a)({},i),{},{trade:null!==(n=null!==t&&void 0!==t?t:a)&&void 0!==n?n:void 0}))})}function Ol(e){var n,t,i,a,c,o=e.price,u=e.showInverted,l=e.setShowInverted,d=u?null===o||void 0===o?void 0:o.toSignificant(6):null===o||void 0===o||null===(n=o.invert())||void 0===n?void 0:n.toSignificant(6),b=Boolean((null===o||void 0===o?void 0:o.baseCurrency)&&(null===o||void 0===o?void 0:o.quoteCurrency)),p=u?"".concat(null===o||void 0===o||null===(t=o.quoteCurrency)||void 0===t?void 0:t.symbol," per ").concat(null===o||void 0===o||null===(i=o.baseCurrency)||void 0===i?void 0:i.symbol):"".concat(null===o||void 0===o||null===(a=o.baseCurrency)||void 0===a?void 0:a.symbol," per ").concat(null===o||void 0===o||null===(c=o.quoteCurrency)||void 0===c?void 0:c.symbol);return Object(r.jsx)(s.z,{fontSize:"14px",style:{justifyContent:"center",alignItems:"center",display:"flex"},children:b?Object(r.jsxs)(r.Fragment,{children:[null!==d&&void 0!==d?d:"-"," ",p,Object(r.jsx)(Ro,{onClick:function(){return l(!u)},children:Object(r.jsx)(s.y,{width:"20px",color:"primary"})})]}):"-"})}function yl(){var e=Object(u.a)(["\n stroke: ",";\n"]);return yl=function(){return e},e}function xl(){var e=Object(u.a)(["\n max-width: 420px;\n width: 100%;\n padding: 1rem;\n background: rgba(242, 150, 2, 0.05);\n border: 1px solid #f3841e;\n border-radius: 20px;\n overflow: auto;\n"]);return xl=function(){return e},e}function gl(){var e=Object(u.a)(["\n background: ",";\n padding: 0.75rem;\n border-radius: 20px;\n"]);return gl=function(){return e},e}var Cl=l.default.div(gl(),(function(e){var n=e.theme;return Object(vt.b)(.6,n.colors.tertiary)})),wl=l.default.div(xl()),kl=Object(l.default)(Wt.a)(yl(),(function(e){return e.theme.colors.failure}));function Tl(e){var n,t,a,c,o=e.token,u=ge().chainId,l=Zt(),d=null!==(n=null===o||void 0===o||null===(t=o.symbol)||void 0===t?void 0:t.toLowerCase())&&void 0!==n?n:"",b=null!==(a=null===o||void 0===o||null===(c=o.name)||void 0===c?void 0:c.toLowerCase())&&void 0!==a?a:"",p=fi(),f=Object(i.useMemo)((function(){return!(!o||!u)&&Object.keys(p).some((function(e){var n,t,r=p[e];return!r.equals(o)&&((null===(n=r.symbol)||void 0===n?void 0:n.toLowerCase())===d||(null===(t=r.name)||void 0===t?void 0:t.toLowerCase())===b)}))}),[o,u,p,d,b]);return o?Object(r.jsx)(Cl,{error:f,children:Object(r.jsxs)(tn,{gap:"6px",children:[Object(r.jsxs)(Pe,{gap:"24px",children:[Object(r.jsx)(ha,{currency:o,size:"16px"}),Object(r.jsx)("div",{children:" "})]}),Object(r.jsxs)(Pe,{gap:"10px",justify:"flex-start",children:[Object(r.jsxs)(s.z,{children:[o&&o.name&&o.symbol&&o.name!==o.symbol?"".concat(o.name," (").concat(o.symbol,")"):o.name||o.symbol," "]}),u&&Object(r.jsx)(Rn,{style:{fontWeight:400},href:hn(u,o.address,"token"),children:Object(r.jsxs)(s.z,{title:o.address,children:[vn(o.address)," ",l(116,"(View on BscScan)")]})})]})]})}):null}function Il(e){var n=e.isOpen,t=e.tokens,a=e.onConfirm,c=Object(i.useState)(!1),o=Object(f.a)(c,2),u=o[0],l=o[1],d=Object(i.useCallback)((function(){return l((function(e){return!e}))}),[]),b=Zt(),p=Object(i.useCallback)((function(){return null}),[]);return Object(r.jsx)(Tt,{isOpen:n,onDismiss:p,maxHeight:90,children:Object(r.jsx)(wl,{className:"token-warning-container",children:Object(r.jsxs)(Pe,{gap:"lg",children:[Object(r.jsxs)(tn,{gap:"6px",children:[Object(r.jsx)(kl,{}),Object(r.jsx)(s.z,{color:"failure",children:b(1128,"Token imported")})]}),Object(r.jsx)(s.z,{children:b(1130,"Anyone can create a BEP20 token on BSC with any name, including creating fake versions of existing tokens and tokens that claim to represent projects that do not have a token.")}),Object(r.jsx)(s.z,{children:b(1132,"This interface can load arbitrary tokens by token addresses. Please take extra caution and do your research when interacting with arbitrary BEP20 tokens.")}),Object(r.jsx)(s.z,{children:b(1134,"If you purchase an arbitrary token, you may be unable to sell it back.")}),t.map((function(e){return Object(r.jsx)(Tl,{token:e},e.address)})),Object(r.jsxs)(en,{children:[Object(r.jsx)("div",{children:Object(r.jsxs)("label",{htmlFor:"understand-checkbox",style:{cursor:"pointer",userSelect:"none"},children:[Object(r.jsx)("input",{id:"understand-checkbox",type:"checkbox",className:"understand-checkbox",checked:u,onChange:d})," ",Object(r.jsx)(s.z,{as:"span",ml:"4px",children:b(148,"I understand")})]})}),Object(r.jsx)(s.d,{disabled:!u,variant:"danger",style:{width:"140px"},className:"token-dismiss-button",onClick:function(){a()},children:b(150,"Continue")})]})]})})})}function El(){var e=Object(u.a)(["\n stroke: ",";\n"]);return El=function(){return e},e}function Nl(){var e=Object(u.a)(["\n max-width: 420px;\n width: 100%;\n padding: 1rem;\n background: rgba(242, 150, 2, 0.05);\n border: 1px solid #f3841e;\n border-radius: 20px;\n overflow: auto;\n"]);return Nl=function(){return e},e}var Sl=l.default.div(Nl()),Rl=Object(l.default)(Wt.a)(El(),(function(e){return e.theme.colors.failure}));function Ul(e){var n=e.isOpen,t=e.transactionType,a=e.onConfirm,c=Object(i.useState)(!1),o=Object(f.a)(c,2),u=o[0],l=o[1],d=Object(i.useCallback)((function(){return l((function(e){return!e}))}),[]),b=Object(i.useCallback)((function(){return null}),[]);return Object(r.jsx)(Tt,{isOpen:n,onDismiss:b,maxHeight:90,children:Object(r.jsx)(Sl,{className:"token-warning-container",children:Object(r.jsxs)(Pe,{gap:"lg",children:[Object(r.jsxs)(tn,{gap:"6px",children:[Object(r.jsx)(Rl,{}),Object(r.jsx)(s.z,{color:"failure",children:"Syrup Warning"})]}),""!==t&&Object(r.jsxs)(r.Fragment,{children:[Object(r.jsxs)(s.z,{color:"failure",children:["Please be careful when ",Object(r.jsx)("strong",{children:t})," SYRUP."]}),Object(r.jsx)(s.z,{color:"failure",children:"Buying"===t?"You will not receive CAKE rewards for holding purchased SYRUP.":"You will need to buy back the same amount of SYRUP to be able to convert back to CAKE."})]}),Object(r.jsxs)(en,{children:[Object(r.jsx)("div",{children:Object(r.jsxs)("label",{htmlFor:"understand-checkbox",style:{cursor:"pointer",userSelect:"none"},children:[Object(r.jsx)("input",{id:"understand-checkbox",type:"checkbox",className:"understand-checkbox",checked:u,onChange:d})," ",Object(r.jsx)(s.z,{as:"span",children:"I understand"})]})}),Object(r.jsx)(s.d,{disabled:!u,variant:"danger",style:{width:"140px"},onClick:function(){l(!1),a()},children:"Continue"})]})]})})})}function Al(){var e=Object(u.a)(["\n stroke: ",";\n"]);return Al=function(){return e},e}function zl(){var e=Object(u.a)(["\n max-width: 420px;\n width: 100%;\n padding: 1rem;\n background: rgba(242, 150, 2, 0.05);\n border: 1px solid #f3841e;\n border-radius: 20px;\n overflow: auto;\n"]);return zl=function(){return e},e}var Bl=l.default.div(zl()),Pl=Object(l.default)(Wt.a)(Al(),(function(e){return e.theme.colors.binance}));function Ml(e){var n=e.isOpen,t=e.onConfirm,a=Object(i.useState)(!1),c=Object(f.a)(a,2),o=c[0],u=c[1],l=Object(i.useCallback)((function(){return u((function(e){return!e}))}),[]),d=Object(i.useCallback)((function(){return null}),[]);return Object(r.jsx)(Tt,{isOpen:n,onDismiss:d,maxHeight:90,children:Object(r.jsx)(Bl,{className:"token-warning-container",children:Object(r.jsxs)(Pe,{gap:"lg",children:[Object(r.jsxs)(tn,{gap:"6px",children:[Object(r.jsx)(Pl,{}),Object(r.jsx)(s.z,{children:"Notice for trading SafeMoon"})]}),Object(r.jsxs)(r.Fragment,{children:[Object(r.jsxs)(s.z,{children:["To trade SAFEMOON, you must click on the settings icon and"," ",Object(r.jsx)("strong",{children:"set your slippage tolerance to 12%+"})]}),Object(r.jsx)(s.z,{children:"This is because SafeMoon taxes a 10% fee on each transaction."}),Object(r.jsx)(s.z,{children:"\u2022 5% fee = redistributed to all existing holders"}),Object(r.jsx)(s.z,{children:"\u2022 5% fee = used to add liquidity"})]}),Object(r.jsxs)(en,{children:[Object(r.jsx)("div",{children:Object(r.jsxs)("label",{htmlFor:"understand-checkbox",style:{cursor:"pointer",userSelect:"none"},children:[Object(r.jsx)("input",{id:"understand-safeMoonWarning",type:"checkbox",className:"understand-checkbox",checked:o,onChange:l})," ",Object(r.jsx)(s.z,{as:"span",children:"I understand"})]})}),Object(r.jsx)(s.d,{id:"confirm-safeMoonWarning",disabled:!o,variant:"danger",style:{width:"140px"},onClick:function(){u(!1),t()},children:"Continue"})]})]})})})}function Dl(){var e=Object(u.a)(["\n width: 100%;\n height: 2px;\n background-color: ;\n background: linear-gradient(\n 90deg,\n "," 0%,\n "," 80%\n );\n opacity: 0.6;\n"]);return Dl=function(){return e},e}function Ll(){var e=Object(u.a)(["\n width: calc(100% - 20px);\n display: flex;\n align-items: center;\n"]);return Ll=function(){return e},e}function _l(){var e=Object(u.a)(["\n min-width: 20px;\n min-height: 20px;\n background-color: ",";\n border-radius: 50%;\n display: flex;\n align-items: center;\n justify-content: center;\n line-height: 8px;\n font-size: 12px;\n color: ",";\n"]);return _l=function(){return e},e}function Yl(){var e=Object(u.a)(["\n width: 50%;\n"]);return Yl=function(){return e},e}function Fl(){var e=Object(u.a)(["\n margin-top: 1.25rem;\n"]);return Fl=function(){return e},e}var ql,Vl=Object(l.default)(Pe)(Fl()),Wl=Object(l.default)(en)(Yl()),Hl=l.default.div(_l(),(function(e){var n=e.theme,t=e.confirmed;return e.disabled?n.colors.backgroundDisabled:t?n.colors.success:n.colors.primary}),(function(e){var n=e.theme,t=e.confirmed;return e.disabled?n.colors.text:t?n.colors.success:"#FFFFFF"})),Ql=l.default.div(Ll()),Gl=l.default.div(Dl(),(function(e){var n=e.theme,t=e.prevConfirmed;return Object(vt.b)(.5,t?n.colors.success:n.colors.primary)}),(function(e){var n=e.theme;return e.prevConfirmed?n.colors.primary:n.colors.backgroundDisabled}));function Kl(e){var n=e.steps;return Object(r.jsx)(Vl,{justify:"center",children:Object(r.jsxs)(Wl,{children:[n.map((function(e,t){return Object(r.jsxs)(Ql,{children:[Object(r.jsx)(Hl,{confirmed:e,disabled:!n[t-1]&&0!==t,children:e?"\u2713":t+1}),Object(r.jsx)(Gl,{prevConfirmed:e})]},t)})),Object(r.jsx)(Hl,{disabled:!n[n.length-1],children:n.length+1})]})})}function Xl(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:be,t=arguments.length>2&&void 0!==arguments[2]?arguments[2]:pe,r=arguments.length>3?arguments[3]:void 0,a=ge(),c=a.account,o=a.chainId,s=a.library,u=gs(r),l=u.address,d=null===r?c:l;return Object(i.useMemo)((function(){if(!e||!d||!s||!c||!o)return[];var r=xn(0,s,c);if(!r)return[];var i=[];return i.push(J.i.swapCallParameters(e,{feeOnTransfer:!1,allowedSlippage:new J.g(J.e.BigInt(Math.floor(n)),je),recipient:d,ttl:t})),e.tradeType===J.m.EXACT_INPUT&&i.push(J.i.swapCallParameters(e,{feeOnTransfer:!0,allowedSlippage:new J.g(J.e.BigInt(Math.floor(n)),je),recipient:d,ttl:t})),i.map((function(e){return{parameters:e,contract:r}}))}),[c,n,o,t,s,d,e])}function Jl(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:be,t=arguments.length>2&&void 0!==arguments[2]?arguments[2]:pe,r=arguments.length>3?arguments[3]:void 0,a=ge(),c=a.account,o=a.chainId,s=a.library,u=Xl(e,n,t,r),l=as(),d=gs(r),b=d.address,p=null===r?c:b;return Object(i.useMemo)((function(){return e&&s&&c&&o?p?{state:ql.VALID,callback:function(){var n=Object(S.a)(E.a.mark((function n(){var t,i,a,o,s,d,b,f,j,h;return E.a.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return n.next=2,Promise.all(u.map((function(e){var n,t=e.parameters,r=t.methodName,i=t.args,a=t.value,c=e.contract,o=!a||Di(a)?{}:{value:a};return(n=c.estimateGas)[r].apply(n,Object(K.a)(i).concat([o])).then((function(n){return{call:e,gasEstimate:n}})).catch((function(n){var t;return console.info("Gas estimate failed, trying eth_call to extract error",e),(t=c.callStatic)[r].apply(t,Object(K.a)(i).concat([o])).then((function(t){return console.info("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((function(n){var t;switch(console.info("Call threw error",e,n),n.reason){case"UniswapV2Router: INSUFFICIENT_OUTPUT_AMOUNT":case"UniswapV2Router: EXCESSIVE_INPUT_AMOUNT":t="This transaction will not succeed either due to price movement or fee on transfer. Try increasing your slippage tolerance.";break;default:t="The transaction cannot succeed due to error: ".concat(n.reason,". This is probably an issue with one of the tokens you are swapping.")}return{call:e,error:new Error(t)}}))}))})));case 2:if(t=n.sent,i=t.find((function(e,n,t){return"gasEstimate"in e&&(n===t.length-1||"gasEstimate"in t[n+1])}))){n.next=9;break}if(!((a=t.filter((function(e){return"error"in e}))).length>0)){n.next=8;break}throw a[a.length-1].error;case 8:throw new Error("Unexpected error. Please contact support: none of the calls threw an error");case 9:return o=i.call,s=o.contract,d=o.parameters,b=d.methodName,f=d.args,j=d.value,h=i.gasEstimate,n.abrupt("return",s[b].apply(s,Object(K.a)(f).concat([Object(X.a)({gasLimit:mn(h)},j&&!Di(j)?{value:j,from:c}:{from:c})])).then((function(n){var t=e.inputAmount.currency.symbol,i=e.outputAmount.currency.symbol,a=e.inputAmount.toSignificant(3),o=e.outputAmount.toSignificant(3),s="Swap ".concat(a," ").concat(t," for ").concat(o," ").concat(i),u=p===c?s:"".concat(s," to ").concat(r&&fn(r)?vn(r):r);return l(n,{summary:u}),n.hash})).catch((function(e){throw 4001===(null===e||void 0===e?void 0:e.code)?new Error("Transaction rejected."):(console.error("Swap failed",e,b,f,j),new Error("Swap failed: ".concat(e.message)))})));case 11:case"end":return n.stop()}}),n)})));return function(){return n.apply(this,arguments)}}(),error:null}:null!==r?{state:ql.INVALID,callback:null,error:"Invalid recipient"}:{state:ql.LOADING,callback:null,error:null}:{state:ql.INVALID,callback:null,error:"Missing dependencies"}}),[e,s,c,o,p,r,u,l])}!function(e){e[e.INVALID=0]="INVALID",e[e.LOADING=1]="LOADING",e[e.VALID=2]="VALID"}(ql||(ql={}));var $l;!function(e){e[e.NOT_APPLICABLE=0]="NOT_APPLICABLE",e[e.WRAP=1]="WRAP",e[e.UNWRAP=2]="UNWRAP"}($l||($l={}));var Zl={wrapType:$l.NOT_APPLICABLE};function ed(e,n,t){var r=ge(),a=r.chainId,c=r.account,o=function(e){var n=ge().chainId;return ui(n?J.n[n].address:void 0,ci,e)}(),s=wi(null!==c&&void 0!==c?c:void 0,e),u=Object(i.useMemo)((function(){return Ts(t,e)}),[e,t]),l=as();return Object(i.useMemo)((function(){if(!o||!a||!e||!n)return Zl;var t=u&&s&&!s.lessThan(u);return e===J.d&&Object(J.o)(J.n[a],n)?{wrapType:$l.WRAP,execute:t&&u?Object(S.a)(E.a.mark((function e(){var n;return E.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,o.deposit({value:"0x".concat(u.raw.toString(16))});case 3:n=e.sent,l(n,{summary:"Wrap ".concat(u.toSignificant(6)," BNB to WBNB")}),e.next=10;break;case 7:e.prev=7,e.t0=e.catch(0),console.error("Could not deposit",e.t0);case 10:case"end":return e.stop()}}),e,null,[[0,7]])}))):void 0,inputError:t?void 0:"Insufficient BNB balance"}:Object(J.o)(J.n[a],e)&&n===J.d?{wrapType:$l.UNWRAP,execute:t&&u?Object(S.a)(E.a.mark((function e(){var n;return E.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,o.withdraw("0x".concat(u.raw.toString(16)));case 3:n=e.sent,l(n,{summary:"Unwrap ".concat(u.toSignificant(6)," WBNB to BNB")}),e.next=10;break;case 7:e.prev=7,e.t0=e.catch(0),console.error("Could not withdraw",e.t0);case 10:case"end":return e.stop()}}),e,null,[[0,7]])}))):void 0,inputError:t?void 0:"Insufficient WBNB balance"}:Zl}),[o,a,e,n,u,s,l])}var nd=function(){var e,n,t,a,c,o,u,d,b,p,j=zs(),h=Zt(),m=[mi(null===j||void 0===j?void 0:j.inputCurrencyId),mi(null===j||void 0===j?void 0:j.outputCurrencyId)],O=m[0],x=m[1],g=Object(i.useState)(!1),C=Object(f.a)(g,2),w=C[0],k=C[1],T=Object(i.useState)({selectedToken:null,purchaseType:null}),I=Object(f.a)(T,2),E=I[0],N=I[1],S=Object(i.useMemo)((function(){var e,n;return null!==(e=null===(n=[O,x])||void 0===n?void 0:n.filter((function(e){return e instanceof J.j})))&&void 0!==e?e:[]}),[O,x]),R=Object(i.useCallback)((function(){k(!0)}),[]),U=function(){N({selectedToken:null,purchaseType:null})},A=ge().account,z=Object(i.useContext)(l.ThemeContext),B=function(){var e=Object(v.c)(),n=Xr(),t=Object(i.useCallback)((function(){e(Dr({userExpertMode:!n}))}),[n,e]);return[n,t]}(),P=Object(f.a)(B,1)[0],M=$r(),D=Object(f.a)(M,1)[0],L=Jr(),_=Object(f.a)(L,1)[0],Y=ks(),F=Y.independentField,q=Y.typedValue,V=Y.recipient,W=Ns(),H=W.v2Trade,Q=W.currencyBalances,G=W.parsedAmount,K=W.currencies,Z=W.inputError,ee=ed(K[Ko.INPUT],K[Ko.OUTPUT],q),ne=ee.wrapType,te=ee.execute,re=ee.inputError,ie=ne!==$l.NOT_APPLICABLE,ae=ie?void 0:H,ce=ie?(e={},Object(y.a)(e,Ko.INPUT,G),Object(y.a)(e,Ko.OUTPUT,G),e):(n={},Object(y.a)(n,Ko.INPUT,F===Ko.INPUT?G:null===ae||void 0===ae?void 0:ae.inputAmount),Object(y.a)(n,Ko.OUTPUT,F===Ko.OUTPUT?G:null===ae||void 0===ae?void 0:ae.outputAmount),n),oe=function(){var e=Object(v.c)(),n=Object(i.useCallback)((function(n,t){e(Xo({field:n,currencyId:t instanceof J.j?t.address:t===J.d?"BNB":""}))}),[e]);return{onSwitchTokens:Object(i.useCallback)((function(){e(Jo())}),[e]),onCurrencySelection:n,onUserInput:Object(i.useCallback)((function(n,t){e($o({field:n,typedValue:t}))}),[e]),onChangeRecipient:Object(i.useCallback)((function(n){e(es({recipient:n}))}),[e])}}(),se=oe.onSwitchTokens,ue=oe.onCurrencySelection,le=oe.onUserInput,de=oe.onChangeRecipient,pe=!Z,fe=F===Ko.INPUT?Ko.OUTPUT:Ko.INPUT,je=Object(i.useCallback)((function(e){le(Ko.INPUT,e)}),[le]),he=Object(i.useCallback)((function(e){le(Ko.OUTPUT,e)}),[le]),ve=Object(i.useState)({showConfirm:!1,tradeToConfirm:void 0,attemptingTxn:!1,swapErrorMessage:void 0,txHash:void 0}),ye=Object(f.a)(ve,2),xe=ye[0],Ce=xe.showConfirm,we=xe.tradeToConfirm,ke=xe.swapErrorMessage,Te=xe.attemptingTxn,Ie=xe.txHash,Ee=ye[1],Ne=(u={},Object(y.a)(u,F,q),Object(y.a)(u,fe,ie?null!==(t=null===(a=ce[F])||void 0===a?void 0:a.toExact())&&void 0!==t?t:"":null!==(c=null===(o=ce[fe])||void 0===o?void 0:o.toSignificant(6))&&void 0!==c?c:""),u),Se=null===ae||void 0===ae?void 0:ae.route,Re=Boolean(K[Ko.INPUT]&&K[Ko.OUTPUT]&&(null===(d=ce[F])||void 0===d?void 0:d.greaterThan(J.e.BigInt(0)))),Ue=!Se,Ae=function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return vs(Object(i.useMemo)((function(){return e?fs(e,n)[Ko.INPUT]:void 0}),[e,n]),$)}(ae,_),ze=Object(f.a)(Ae,2),Be=ze[0],Me=ze[1],De=Object(i.useState)(!1),Le=Object(f.a)(De,2),_e=Le[0],Ye=Le[1];Object(i.useEffect)((function(){Be===ss.PENDING&&Ye(!0)}),[Be,_e]);var Fe=Ms(Q[Ko.INPUT]),qe=Boolean(Fe&&(null===(b=ce[Ko.INPUT])||void 0===b?void 0:b.equalTo(Fe))),Ve=Jl(ae,_,D,V),We=Ve.callback,He=Ve.error,Qe=ps(ae).priceImpactWithoutFee,Ge=Object(i.useCallback)((function(){Qe&&!function(e){return e.lessThan(Oe)?!!e.lessThan(me)||window.confirm("This swap has a price impact of at least ".concat(me.toFixed(0),"%. Please confirm that you would like to continue with this swap.")):"confirm"===window.prompt("This swap has a price impact of at least ".concat(Oe.toFixed(0),'%. Please type the word "confirm" to continue with this swap.'))}(Qe)||We&&(Ee((function(e){return Object(X.a)(Object(X.a)({},e),{},{attemptingTxn:!0,swapErrorMessage:void 0,txHash:void 0})})),We().then((function(e){Ee((function(n){return Object(X.a)(Object(X.a)({},n),{},{attemptingTxn:!1,swapErrorMessage:void 0,txHash:e})}))})).catch((function(e){Ee((function(n){return Object(X.a)(Object(X.a)({},n),{},{attemptingTxn:!1,swapErrorMessage:e.message,txHash:void 0})}))})))}),[Qe,We,Ee]),Ke=Object(i.useState)(!1),Xe=Object(f.a)(Ke,2),Je=Xe[0],$e=Xe[1],Ze=js(Qe),nn=!Z&&(Be===ss.NOT_APPROVED||Be===ss.PENDING||_e&&Be===ss.APPROVED)&&!(Ze>3&&!P),rn=Object(i.useCallback)((function(){Ee((function(e){return Object(X.a)(Object(X.a)({},e),{},{showConfirm:!1})})),Ie&&le(Ko.INPUT,"")}),[le,Ie,Ee]),an=Object(i.useCallback)((function(){Ee((function(e){return Object(X.a)(Object(X.a)({},e),{},{tradeToConfirm:ae})}))}),[ae]),cn=Object(i.useCallback)((function(e,n){["SYRUP","SAFEMOON"].includes(e)&&N({selectedToken:e,purchaseType:n})}),[N]),on=Object(i.useCallback)((function(e){Ye(!1),ue(Ko.INPUT,e),"SYRUP"===e.symbol&&cn(e.symbol,"Selling"),"SAFEMOON"===e.symbol&&cn(e.symbol,"Selling")}),[ue,Ye,cn]),sn=Object(i.useCallback)((function(){Fe&&le(Ko.INPUT,Fe.toExact())}),[Fe,le]),un=Object(i.useCallback)((function(e){ue(Ko.OUTPUT,e),"SYRUP"===e.symbol&&cn(e.symbol,"Buying"),"SAFEMOON"===e.symbol&&cn(e.symbol,"Buying")}),[ue,cn]);return Object(r.jsxs)(r.Fragment,{children:[Object(r.jsx)(Il,{isOpen:S.length>0&&!w,tokens:S,onConfirm:R}),Object(r.jsx)(Ul,{isOpen:"SYRUP"===E.selectedToken,transactionType:E.purchaseType,onConfirm:U}),Object(r.jsx)(Ml,{isOpen:"SAFEMOON"===E.selectedToken,onConfirm:U}),Object(r.jsx)(rr,{}),Object(r.jsx)($s,{children:Object(r.jsxs)(To,{id:"swap-page",children:[Object(r.jsx)(dl,{isOpen:Ce,trade:ae,originalTrade:we,onAcceptChanges:an,attemptingTxn:Te,txHash:Ie,recipient:V,allowedSlippage:_,onConfirm:Ge,swapErrorMessage:ke,onDismiss:rn}),Object(r.jsx)(Au,{title:h(8,"Exchange"),description:h(1192,"Trade tokens in an instant")}),Object(r.jsxs)(s.h,{children:[Object(r.jsxs)(Pe,{gap:"md",children:[Object(r.jsx)($c,{label:F===Ko.OUTPUT&&!ie&&ae?h(194,"From (estimated)"):h(76,"From"),value:Ne[Ko.INPUT],showMaxButton:!qe,currency:K[Ko.INPUT],onUserInput:je,onMax:sn,onCurrencySelect:on,otherCurrency:K[Ko.OUTPUT],id:"swap-currency-input"}),Object(r.jsx)(Pe,{justify:"space-between",children:Object(r.jsxs)(tn,{justify:P?"space-between":"center",style:{padding:"0 1rem"},children:[Object(r.jsx)(Io,{clickable:!0,children:Object(r.jsx)(s.q,{variant:"tertiary",onClick:function(){Ye(!1),se()},style:{borderRadius:"50%"},scale:"sm",children:Object(r.jsx)(s.b,{color:"primary",width:"24px"})})}),null===V&&!ie&&P?Object(r.jsx)(En,{id:"add-recipient-button",onClick:function(){return de("")},children:"+ Add a send (optional)"}):null]})}),Object(r.jsx)($c,{value:Ne[Ko.OUTPUT],onUserInput:he,label:F===Ko.INPUT&&!ie&&ae?h(196,"To (estimated)"):h(80,"To"),showMaxButton:!1,currency:K[Ko.OUTPUT],onCurrencySelect:un,otherCurrency:K[Ko.INPUT],id:"swap-currency-output"}),null===V||ie?null:Object(r.jsxs)(r.Fragment,{children:[Object(r.jsxs)(tn,{justify:"space-between",style:{padding:"0 1rem"},children:[Object(r.jsx)(Io,{clickable:!1,children:Object(r.jsx)(Du.a,{size:"16",color:z.colors.textSubtle})}),Object(r.jsx)(En,{id:"remove-recipient-button",onClick:function(){return de(null)},children:"- Remove send"})]}),Object(r.jsx)(il,{id:"recipient",value:V,onChange:de})]}),ie?null:Object(r.jsx)(pt,{padding:".25rem .75rem 0 .75rem",borderRadius:"20px",children:Object(r.jsxs)(Pe,{gap:"4px",children:[Boolean(ae)&&Object(r.jsxs)(en,{align:"center",children:[Object(r.jsx)(s.z,{fontSize:"14px",children:h(1182,"Price")}),Object(r.jsx)(Ol,{price:null===ae||void 0===ae?void 0:ae.executionPrice,showInverted:Je,setShowInverted:$e})]}),_!==be&&Object(r.jsxs)(en,{align:"center",children:[Object(r.jsx)(s.z,{fontSize:"14px",children:h(88,"Slippage Tolerance")}),Object(r.jsxs)(s.z,{fontSize:"14px",children:[_/100,"%"]})]})]})})]}),Object(r.jsxs)(No,{children:[A?ie?Object(r.jsx)(s.d,{disabled:Boolean(re),onClick:te,width:"100%",children:null!==re&&void 0!==re?re:ne===$l.WRAP?"Wrap":ne===$l.UNWRAP?"Unwrap":null}):Ue&&Re?Object(r.jsx)(jt,{style:{textAlign:"center"},children:Object(r.jsx)(s.z,{mb:"4px",children:h(1194,"Insufficient liquidity for this trade.")})}):nn?Object(r.jsxs)(en,{children:[Object(r.jsx)(s.d,{onClick:Me,disabled:Be!==ss.NOT_APPROVED||_e,style:{width:"48%"},variant:Be===ss.APPROVED?"success":"primary",children:Be===ss.PENDING?Object(r.jsxs)(tn,{gap:"6px",justify:"center",children:["Approving ",Object(r.jsx)(rt,{stroke:"white"})]}):_e&&Be===ss.APPROVED?"Approved":"Approve ".concat(null===(p=K[Ko.INPUT])||void 0===p?void 0:p.symbol)}),Object(r.jsx)(s.d,{onClick:function(){P?Ge():Ee({tradeToConfirm:ae,attemptingTxn:!1,swapErrorMessage:void 0,showConfirm:!0,txHash:void 0})},style:{width:"48%"},id:"swap-button",disabled:!pe||Be!==ss.APPROVED||Ze>3&&!P,variant:pe&&Ze>2?"danger":"primary",children:Ze>3&&!P?"Price Impact High":"Swap".concat(Ze>2?" Anyway":"")})]}):Object(r.jsx)(s.d,{onClick:function(){P?Ge():Ee({tradeToConfirm:ae,attemptingTxn:!1,swapErrorMessage:void 0,showConfirm:!0,txHash:void 0})},id:"swap-button",disabled:!pe||Ze>3&&!P||!!He,variant:pe&&Ze>2&&!He?"danger":"primary",width:"100%",children:Z||(Ze>3&&!P?"Price Impact Too High":"Swap".concat(Ze>2?" Anyway":""))}):Object(r.jsx)(Ks,{width:"100%"}),nn&&Object(r.jsx)(Kl,{steps:[Be===ss.APPROVED]}),P&&ke?Object(r.jsx)(Bo,{error:ke}):null]})]})]})}),Object(r.jsx)(ml,{trade:ae})]})};function td(e){var n=e.location;return Object(r.jsx)(h.a,{to:Object(X.a)(Object(X.a)({},n),{},{pathname:"/swap"})})}var rd={code:"en",language:"English"},id=[rd],ad={selectedLanguage:{code:"",language:""},setSelectedLanguage:function(){},translatedLanguage:{code:"",language:""},setTranslatedLanguage:function(){}},cd=Object(i.createContext)(ad),od="IS_DARK",sd=a.a.createContext({isDark:!1,toggleTheme:function(){return null}}),ud=function(e){var n=e.children,t=Object(i.useState)((function(){var e=localStorage.getItem(od);return!!e&&JSON.parse(e)})),a=Object(f.a)(t,2),c=a[0],o=a[1];return Object(r.jsx)(sd.Provider,{value:{isDark:c,toggleTheme:function(){o((function(e){return localStorage.setItem(od,JSON.stringify(!e)),!e}))}},children:Object(r.jsx)(l.ThemeProvider,{theme:c?s.D:s.E,children:n})})},ld=function(){var e=Object(i.useContext)(sd);return{isDark:e.isDark,toggleTheme:e.toggleTheme,theme:Object(i.useContext)(l.ThemeContext)}},dd=function(){var e=Object(i.useState)(null),n=Object(f.a)(e,2),t=n[0],r=n[1];return Object(i.useEffect)((function(){(function(){var e=Object(S.a)(E.a.mark((function e(){var n,t;return E.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,fetch("https://api.pancakeswap.info/api/tokens");case 3:return n=e.sent,e.next=6,n.json();case 6:t=e.sent,r(t),e.next=13;break;case 10:e.prev=10,e.t0=e.catch(0),console.error("Unable to fetch price data:",e.t0);case 13:case"end":return e.stop()}}),e,null,[[0,10]])})));return function(){return e.apply(this,arguments)}})()()}),[r]),t},bd=t(238),pd=t.n(bd),fd={profileLink:"https://pancakeswap.finance/profile",noProfileLink:"https://pancakeswap.finance/profile"},jd=function(){var e=Object(i.useState)(fd),n=Object(f.a)(e,2),t=n[0],r=n[1],a=ge().account;return Object(i.useEffect)((function(){if(a)try{var e=pd.a.get("profile_".concat(a));if(e){var n=JSON.parse(e);r((function(e){return Object(X.a)(Object(X.a)({},e),{},{username:n.username,image:n.avatar})}))}}catch(t){r(fd)}else r(fd)}),[a,r]),t},hd=[{label:"Home",icon:"HomeIcon",href:"/"},{label:"Trade",icon:"TradeIcon",initialOpenState:!1,items:[{label:"Exchange",href:"/swap"},{label:"Liquidity",href:"/pool"}]}],vd=function(e){var n=Object(m.d)().account,t=Gs(),a=t.login,c=t.logout,o=Object(i.useContext)(cd),u=o.selectedLanguage,l=o.setSelectedLanguage,d=ld(),b=d.isDark,p=d.toggleTheme,f=dd(),j=0;try{var h;j=f?Number(null!==(h=f.data["0x0E09FaBB73Bd3Ade0a17ECC321fD13a19e81cE82"].price)&&void 0!==h?h:0):0}catch(O){}var v=jd();return Object(r.jsx)(s.t,Object(X.a)({links:hd,account:n,login:a,logout:c,isDark:b,toggleTheme:p,currentLang:(null===u||void 0===u?void 0:u.code)||"",langs:id,setLang:l,cakePriceUsd:j,profile:v},e))},md=function(){var e=dd(),n=0;try{var t;n=e?parseFloat(null!==(t=e.data[Z.address].price)&&void 0!==t?t:0):0}catch(a){}var r=Number.isNaN(n)||0===n?"":" - $".concat(n.toLocaleString(void 0,{minimumFractionDigits:3,maximumFractionDigits:3}));Object(i.useEffect)((function(){document.title="PancakeSwap".concat(r)}),[r])};function Od(){var e=Object(u.a)(["\n margin-top: 5rem;\n"]);return Od=function(){return e},e}function yd(){var e=Object(u.a)(["\n display: flex;\n flex-direction: column;\n width: 100%;\n padding: 32px 16px;\n align-items: center;\n flex: 1;\n overflow-y: auto;\n overflow-x: hidden;\n z-index: 1;\n justify-content: center;\n background-image: url('/images/group-pancake.svg');\n background-repeat: no-repeat;\n background-position: bottom 24px center;\n background-size: 90%;\n\n "," {\n background-size: auto;\n }\n\n "," {\n background-image: url('/images/arch-",".svg'),\n url('/images/left-pancake.svg'), url('/images/right-pancake.svg');\n background-repeat: no-repeat;\n background-position: center 420px, 10% 230px, 90% 230px;\n background-size: contain, 266px, 266px;\n min-height: 90vh;\n }\n"]);return yd=function(){return e},e}function xd(){var e=Object(u.a)(["\n display: flex;\n flex-flow: column;\n align-items: flex-start;\n overflow-x: hidden;\n"]);return xd=function(){return e},e}var gd=l.default.div(xd()),Cd=l.default.div(yd(),(function(e){return e.theme.mediaQueries.xs}),(function(e){return e.theme.mediaQueries.lg}),(function(e){return e.theme.isDark?"dark":"light"})),wd=l.default.div(Od()),kd="pancakeSwapLanguage";function Td(){var e=Object(i.useState)(void 0),n=Object(f.a)(e,2),t=n[0],a=n[1],c=Object(i.useState)(void 0),o=Object(f.a)(c,2),s=o[0],u=o[1],l=Object(i.useState)([]),d=Object(f.a)(l,2),b=d[0],p=d[1];Object(i.useEffect)((function(){var e=localStorage.getItem(kd);if(e){var n=function(e){return id.filter((function(n){return n.code===e}))[0]}(e);a(n)}else a(rd)}),[]);return md(),Object(r.jsx)(i.Suspense,{fallback:null,children:Object(r.jsx)(j.a,{children:Object(r.jsx)(gd,{children:Object(r.jsx)(cd.Provider,{value:{selectedLanguage:t,setSelectedLanguage:function(e){a(e),localStorage.setItem(kd,e.code)},translatedLanguage:s,setTranslatedLanguage:u},children:Object(r.jsx)(Kt.Provider,{value:{translations:b,setTranslations:p},children:Object(r.jsx)(vd,{children:Object(r.jsxs)(Cd,{children:[Object(r.jsx)(Jn,{}),Object(r.jsx)(st,{children:Object(r.jsxs)(h.d,{children:[Object(r.jsx)(h.b,{exact:!0,strict:!0,path:"/swap",component:nd}),Object(r.jsx)(h.b,{exact:!0,strict:!0,path:"/find",component:Bu}),Object(r.jsx)(h.b,{exact:!0,strict:!0,path:"/pool",component:zu}),Object(r.jsx)(h.b,{exact:!0,path:"/add",component:ou}),Object(r.jsx)(h.b,{exact:!0,strict:!0,path:"/remove/:currencyIdA/:currencyIdB",component:Ku}),Object(r.jsx)(h.b,{exact:!0,path:"/add/:currencyIdA",component:uu}),Object(r.jsx)(h.b,{exact:!0,path:"/add/:currencyIdA/:currencyIdB",component:lu}),Object(r.jsx)(h.b,{exact:!0,strict:!0,path:"/remove/:tokens",component:bu}),Object(r.jsx)(h.b,{component:td})]})}),Object(r.jsx)(wd,{})]})})})})})})})}var Id="visibilityState"in document;function Ed(){return!Id||"hidden"!==document.visibilityState}function Nd(){var e=Object(i.useState)(Ed()),n=Object(f.a)(e,2),t=n[0],r=n[1],a=Object(i.useCallback)((function(){r(Ed())}),[r]);return Object(i.useEffect)((function(){if(Id)return document.addEventListener("visibilitychange",a),function(){document.removeEventListener("visibilitychange",a)}}),[a]),t}function Sd(){var e=ge(),n=e.library,t=e.chainId,r=Object(v.c)(),a=Nd(),c=Object(i.useState)({chainId:t,blockNumber:null}),o=Object(f.a)(c,2),s=o[0],u=o[1],l=Object(i.useCallback)((function(e){u((function(n){return t===n.chainId?"number"!==typeof n.blockNumber?{chainId:t,blockNumber:e}:{chainId:t,blockNumber:Math.max(e,n.blockNumber)}:n}))}),[t,u]);Object(i.useEffect)((function(){if(n&&t&&a)return u({chainId:t,blockNumber:null}),n.getBlockNumber().then(l).catch((function(e){return console.error("Failed to get block number for chainId: ".concat(t),e)})),n.on("block",l),function(){n.removeListener("block",l)}}),[r,t,n,l,a]);var d=xs(s,100);return Object(i.useEffect)((function(){d.chainId&&d.blockNumber&&a&&r(we({chainId:d.chainId,blockNumber:d.blockNumber}))}),[a,r,d.blockNumber,d.chainId]),null}function Rd(){var e=ge().library,n=Object(v.c)(),t=Object(v.d)((function(e){return e.lists.byUrl})),r=Nd(),a=bc();return Gi(Object(i.useCallback)((function(){r&&Object.keys(t).forEach((function(e){return a(e).catch((function(e){return console.error("interval list fetching error",e)}))}))}),[a,r,t]),e?6e5:null),Object(i.useEffect)((function(){Object.keys(t).forEach((function(e){var n=t[e];n.current||n.loadingRequestId||n.error||a(e).catch((function(e){return console.error("list added fetching error",e)}))}))}),[n,a,e,t]),Object(i.useEffect)((function(){Object.keys(t).forEach((function(e){var r=t[e];if(r.current&&r.pendingUpdate){var i=Object(_e.c)(r.current.version,r.pendingUpdate.version);switch(i){case _e.a.NONE:throw new Error("unexpected no version bump");case _e.a.PATCH:case _e.a.MINOR:i>=Object(_e.d)(r.current.tokens,r.pendingUpdate.tokens)?(n(Fe(e)),n(Ie({key:e,content:{listUpdate:{listUrl:e,oldList:r.current,newList:r.pendingUpdate,auto:!0}}}))):console.error("List at url ".concat(e," could not automatically update because the version bump was only PATCH/MINOR while the update had breaking changes and should have been MAJOR"));break;case _e.a.MAJOR:n(Ie({key:e,content:{listUpdate:{listUrl:e,auto:!1,oldList:r.current,newList:r.pendingUpdate}},removeAfterMs:null}))}}}))}),[n,t]),null}function Ud(e,n){return t=e+Math.round(Math.random()*Math.max(0,n-e)),new Promise((function(e){return setTimeout(e,t)}));var t}var Ad=function(e){Object(U.a)(t,e);var n=Object(A.a)(t);function t(){return Object(R.a)(this,t),n.call(this,"Cancelled")}return t}(Object(z.a)(Error)),zd=function(e){Object(U.a)(t,e);var n=Object(A.a)(t);function t(){return Object(R.a)(this,t),n.apply(this,arguments)}return t}(Object(z.a)(Error));function Bd(){return(Bd=Object(S.a)(E.a.mark((function e(n,t,r){var i,a,c,o;return E.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,n.aggregate(t.map((function(e){return[e.address,e.callData]})));case 3:c=e.sent,o=Object(f.a)(c,2),i=o[0],a=o[1],e.next=13;break;case 9:throw e.prev=9,e.t0=e.catch(0),console.info("Failed to fetch chunk inside retry",e.t0),e.t0;case 13:if(!(i.toNumber()0})).reduce((function(e,n){return Math.min(e,parseInt(n))}),1/0),e}),{}):{}}(t,a)}),[t,a]),u=Object(i.useMemo)((function(){return function(e,n,t,r){return t&&r?e[t]?Object.keys(n).filter((function(i){var a=n[i],c=e[t][i];if(!c)return!0;var o=r-(a-1);return!(c.fetchingBlockNumber&&c.fetchingBlockNumber>=o)&&(!c.blockNumber||c.blockNumber60?t>9:!(r>5)||t>2}(a,s[e])})).forEach((function(e){r.getTransactionReceipt(e).then((function(n){var r;n?(c(rs({chainId:t,hash:e,receipt:{blockHash:n.blockHash,blockNumber:n.blockNumber,contractAddress:n.contractAddress,from:n.from,status:n.status,to:n.to,transactionHash:n.transactionHash,transactionIndex:n.transactionIndex}})),u({txn:{hash:e,success:1===n.status,summary:null===(r=s[e])||void 0===r?void 0:r.summary}},e)):c(is({chainId:t,hash:e,blockNumber:a}))})).catch((function(n){console.error("failed to check transaction hash: ".concat(e),n)}))}))}),[t,r,s,a,c,u]),null}var Dd=function(){var e=Object(v.d)((function(e){return e.toasts.data})),n=Qs().remove;return Object(r.jsx)(s.A,{toasts:e,onRemove:function(e){return n(e)}})},Ld=t(175),_d=Object(Ce.c)({blockNumber:{},popupList:[],walletModalOpen:!1,settingsMenuOpen:!1},(function(e){return e.addCase(we,(function(e,n){var t=n.payload,r=t.chainId,i=t.blockNumber;"number"!==typeof e.blockNumber[r]?e.blockNumber[r]=i:e.blockNumber[r]=Math.max(i,e.blockNumber[r])})).addCase(ke,(function(e){e.walletModalOpen=!e.walletModalOpen})).addCase(Te,(function(e){e.settingsMenuOpen=!e.settingsMenuOpen})).addCase(Ie,(function(e,n){var t=n.payload,r=t.content,i=t.key,a=t.removeAfterMs,c=void 0===a?15e3:a;e.popupList=(i?e.popupList.filter((function(e){return e.key!==i})):e.popupList).concat([{key:i||Object(Ce.f)(),show:!0,content:r,removeAfterMs:c}])})).addCase(Ee,(function(e,n){var t=n.payload.key;e.popupList.forEach((function(e){e.key===t&&(e.show=!1)}))}))})),Yd=Object(Ce.b)("global/updateVersion"),Fd=(Ce.b,function(){return(new Date).getTime()});function qd(e,n){return"".concat(e,";").concat(n)}var Vd,Wd={userDarkMode:null,matchesDarkMode:!1,userExpertMode:!1,userSlippageTolerance:be,userDeadline:pe,tokens:{},pairs:{},timestamp:Fd(),audioPlay:!0},Hd=Object(Ce.c)(Wd,(function(e){return e.addCase(Yd,(function(e){"number"!==typeof e.userSlippageTolerance&&(e.userSlippageTolerance=be),"number"!==typeof e.userDeadline&&(e.userDeadline=pe),e.lastUpdateVersionTimestamp=Fd()})).addCase(Mr,(function(e,n){e.userDarkMode=n.payload.userDarkMode,e.timestamp=Fd()})).addCase(Pr,(function(e,n){e.matchesDarkMode=n.payload.matchesDarkMode,e.timestamp=Fd()})).addCase(Dr,(function(e,n){e.userExpertMode=n.payload.userExpertMode,e.timestamp=Fd()})).addCase(Lr,(function(e,n){e.userSlippageTolerance=n.payload.userSlippageTolerance,e.timestamp=Fd()})).addCase(_r,(function(e,n){e.userDeadline=n.payload.userDeadline,e.timestamp=Fd()})).addCase(Yr,(function(e,n){var t=n.payload.serializedToken;e.tokens[t.chainId]=e.tokens[t.chainId]||{},e.tokens[t.chainId][t.address]=t,e.timestamp=Fd()})).addCase(Fr,(function(e,n){var t=n.payload,r=t.address,i=t.chainId;e.tokens[i]=e.tokens[i]||{},delete e.tokens[i][r],e.timestamp=Fd()})).addCase(qr,(function(e,n){var t=n.payload.serializedPair;if(t.token0.chainId===t.token1.chainId&&t.token0.address!==t.token1.address){var r=t.token0.chainId;e.pairs[r]=e.pairs[r]||{},e.pairs[r][qd(t.token0.address,t.token1.address)]=t}e.timestamp=Fd()})).addCase(Vr,(function(e,n){var t=n.payload,r=t.chainId,i=t.tokenAAddress,a=t.tokenBAddress;e.pairs[r]&&(delete e.pairs[r][qd(i,a)],delete e.pairs[r][qd(a,i)]),e.timestamp=Fd()})).addCase(Wr,(function(e){e.audioPlay=!1})).addCase(Hr,(function(e){e.audioPlay=!0}))})),Qd=function(){return(new Date).getTime()},Gd=Object(Ce.c)({},(function(e){return e.addCase(ns,(function(e,n){var t,r,i=n.payload,a=i.chainId,c=i.from,o=i.hash,s=i.approval,u=i.summary;if(null===(t=e[a])||void 0===t?void 0:t[o])throw Error("Attempted to add existing transaction.");var l=null!==(r=e[a])&&void 0!==r?r:{};l[o]={hash:o,approval:s,summary:u,from:c,addedTime:Qd()},e[a]=l})).addCase(ts,(function(e,n){var t=n.payload.chainId;e[t]&&(e[t]={})})).addCase(is,(function(e,n){var t,r=n.payload,i=r.chainId,a=r.hash,c=r.blockNumber,o=null===(t=e[i])||void 0===t?void 0:t[a];o&&(o.lastCheckedBlockNumber?o.lastCheckedBlockNumber=Math.max(c,o.lastCheckedBlockNumber):o.lastCheckedBlockNumber=c)})).addCase(rs,(function(e,n){var t,r=n.payload,i=r.hash,a=r.chainId,c=r.receipt,o=null===(t=e[a])||void 0===t?void 0:t[i];o&&(o.receipt=c,o.confirmedTime=Qd())}))})),Kd=(Vd={independentField:Ko.INPUT,typedValue:""},Object(y.a)(Vd,Ko.INPUT,{currencyId:""}),Object(y.a)(Vd,Ko.OUTPUT,{currencyId:""}),Object(y.a)(Vd,"recipient",null),Vd),Xd=Object(Ce.c)(Kd,(function(e){return e.addCase(Zo,(function(e,n){var t,r=n.payload,i=r.typedValue,a=r.recipient,c=r.field,o=r.inputCurrencyId,s=r.outputCurrencyId;return t={},Object(y.a)(t,Ko.INPUT,{currencyId:o}),Object(y.a)(t,Ko.OUTPUT,{currencyId:s}),Object(y.a)(t,"independentField",c),Object(y.a)(t,"typedValue",i),Object(y.a)(t,"recipient",a),t})).addCase(Xo,(function(e,n){var t,r=n.payload,i=r.currencyId,a=r.field,c=a===Ko.INPUT?Ko.OUTPUT:Ko.INPUT;return i===e[c].currencyId?Object(X.a)(Object(X.a)({},e),{},(t={independentField:e.independentField===Ko.INPUT?Ko.OUTPUT:Ko.INPUT},Object(y.a)(t,a,{currencyId:i}),Object(y.a)(t,c,{currencyId:e[a].currencyId}),t)):Object(X.a)(Object(X.a)({},e),{},Object(y.a)({},a,{currencyId:i}))})).addCase(Jo,(function(e){var n;return Object(X.a)(Object(X.a)({},e),{},(n={independentField:e.independentField===Ko.INPUT?Ko.OUTPUT:Ko.INPUT},Object(y.a)(n,Ko.INPUT,{currencyId:e[Ko.OUTPUT].currencyId}),Object(y.a)(n,Ko.OUTPUT,{currencyId:e[Ko.INPUT].currencyId}),n))})).addCase($o,(function(e,n){var t=n.payload,r=t.field,i=t.typedValue;return Object(X.a)(Object(X.a)({},e),{},{independentField:r,typedValue:i})})).addCase(es,(function(e,n){var t=n.payload.recipient;e.recipient=t}))})),Jd={independentField:us.CURRENCY_A,typedValue:"",otherTypedValue:""},$d=Object(Ce.c)(Jd,(function(e){return e.addCase(Os,(function(){return Jd})).addCase(ms,(function(e,n){var t=n.payload,r=t.field,i=t.typedValue;return t.noLiquidity?r===e.independentField?Object(X.a)(Object(X.a)({},e),{},{independentField:r,typedValue:i}):Object(X.a)(Object(X.a)({},e),{},{independentField:r,typedValue:i,otherTypedValue:e.typedValue}):Object(X.a)(Object(X.a)({},e),{},{independentField:r,typedValue:i,otherTypedValue:""})}))})),Zd={error:null,current:null,loadingRequestId:null,pendingUpdate:null},eb={lastInitializedDefaultListOfLists:nc,byUrl:Object(X.a)(Object(X.a)({},nc.reduce((function(e,n){return e[n]=Zd,e}),{})),{},Object(y.a)({},ec,{error:null,current:tc,loadingRequestId:null,pendingUpdate:null})),selectedListUrl:ec},nb=Object(Ce.c)(eb,(function(e){return e.addCase(Ye.pending,(function(e,n){var t=n.payload,r=t.requestId,i=t.url;e.byUrl[i]=Object(X.a)(Object(X.a)({current:null,pendingUpdate:null},e.byUrl[i]),{},{loadingRequestId:r,error:null})})).addCase(Ye.fulfilled,(function(e,n){var t,r,i=n.payload,a=i.requestId,c=i.tokenList,o=i.url,s=null===(t=e.byUrl[o])||void 0===t?void 0:t.current,u=null===(r=e.byUrl[o])||void 0===r?void 0:r.loadingRequestId;if(s){if(Object(_e.c)(s.version,c.version)===_e.a.NONE)return;null!==u&&u!==a||(e.byUrl[o]=Object(X.a)(Object(X.a)({},e.byUrl[o]),{},{loadingRequestId:null,error:null,current:s,pendingUpdate:c}))}else e.byUrl[o]=Object(X.a)(Object(X.a)({},e.byUrl[o]),{},{loadingRequestId:null,error:null,current:c,pendingUpdate:null})})).addCase(Ye.rejected,(function(e,n){var t,r=n.payload,i=r.url,a=r.requestId,c=r.errorMessage;(null===(t=e.byUrl[i])||void 0===t?void 0:t.loadingRequestId)===a&&(e.byUrl[i]=Object(X.a)(Object(X.a)({},e.byUrl[i]),{},{loadingRequestId:null,error:c,current:null,pendingUpdate:null}))})).addCase(We,(function(e,n){var t=n.payload;e.selectedListUrl=t,e.byUrl[t]||(e.byUrl[t]=Zd)})).addCase(qe,(function(e,n){var t=n.payload;e.byUrl[t]||(e.byUrl[t]=Zd)})).addCase(Ve,(function(e,n){var t=n.payload;e.byUrl[t]&&delete e.byUrl[t],e.selectedListUrl===t&&(e.selectedListUrl=Object.keys(e.byUrl)[0])})).addCase(Fe,(function(e,n){var t,r=n.payload;if(!(null===(t=e.byUrl[r])||void 0===t?void 0:t.pendingUpdate))throw new Error("accept list update called without pending update");e.byUrl[r]=Object(X.a)(Object(X.a)({},e.byUrl[r]),{},{pendingUpdate:null,current:e.byUrl[r].pendingUpdate})})).addCase(Yd,(function(e){if(e.lastInitializedDefaultListOfLists){if(e.lastInitializedDefaultListOfLists){var n=e.lastInitializedDefaultListOfLists.reduce((function(e,n){return e.add(n)}),new Set),t=nc.reduce((function(e,n){return e.add(n)}),new Set);nc.forEach((function(t){n.has(t)||(e.byUrl[t]=Zd)})),e.lastInitializedDefaultListOfLists.forEach((function(n){t.has(n)||delete e.byUrl[n]}))}}else e.byUrl=eb.byUrl,e.selectedListUrl=void 0;e.lastInitializedDefaultListOfLists=nc}))})),tb={independentField:_u.LIQUIDITY_PERCENT,typedValue:"0"},rb=Object(Ce.c)(tb,(function(e){return e.addCase(qu,(function(e,n){var t=n.payload,r=t.field,i=t.typedValue;return Object(X.a)(Object(X.a)({},e),{},{independentField:r,typedValue:i})}))})),ib=Object(Ce.c)({callResults:{}},(function(e){return e.addCase(Or,(function(e,n){var t,r=n.payload,i=r.calls,a=r.chainId,c=r.options,o=(c=void 0===c?{}:c).blocksPerFetch,s=void 0===o?1:o,u=e.callListeners?e.callListeners:e.callListeners={};u[a]=null!==(t=u[a])&&void 0!==t?t:{},i.forEach((function(e){var n,t,r=vr(e);u[a][r]=null!==(n=u[a][r])&&void 0!==n?n:{},u[a][r][s]=(null!==(t=u[a][r][s])&&void 0!==t?t:0)+1}))})).addCase(yr,(function(e,n){var t=n.payload,r=t.chainId,i=t.calls,a=t.options,c=(a=void 0===a?{}:a).blocksPerFetch,o=void 0===c?1:c,s=e.callListeners?e.callListeners:e.callListeners={};s[r]&&i.forEach((function(e){var n=vr(e);s[r][n]&&s[r][n][o]&&(1===s[r][n][o]?delete s[r][n][o]:s[r][n][o]--)}))})).addCase(xr,(function(e,n){var t,r=n.payload,i=r.chainId,a=r.fetchingBlockNumber,c=r.calls;e.callResults[i]=null!==(t=e.callResults[i])&&void 0!==t?t:{},c.forEach((function(n){var t=vr(n),r=e.callResults[i][t];if(r){var c;if((null!==(c=r.fetchingBlockNumber)&&void 0!==c?c:0)>=a)return;e.callResults[i][t].fetchingBlockNumber=a}else e.callResults[i][t]={fetchingBlockNumber:a}}))})).addCase(gr,(function(e,n){var t,r=n.payload,i=r.fetchingBlockNumber,a=r.chainId,c=r.calls;e.callResults[a]=null!==(t=e.callResults[a])&&void 0!==t?t:{},c.forEach((function(n){var t=vr(n),r=e.callResults[a][t];r&&r.fetchingBlockNumber===i&&(delete r.fetchingBlockNumber,r.data=null,r.blockNumber=i)}))})).addCase(Cr,(function(e,n){var t,r=n.payload,i=r.chainId,a=r.results,c=r.blockNumber;e.callResults[i]=null!==(t=e.callResults[i])&&void 0!==t?t:{},Object.keys(a).forEach((function(n){var t,r=e.callResults[i][n];(null!==(t=null===r||void 0===r?void 0:r.blockNumber)&&void 0!==t?t:0)>c||(e.callResults[i][n]={data:a[n],blockNumber:c})}))}))})),ab=["user","transactions"],cb=Object(Ld.load)({states:ab});cb.user&&(cb.user.userDarkMode=function(){var e=null;try{var n=localStorage.getItem(Qr);n&&(e=JSON.parse(n))}catch(t){console.error(t)}return e}());var ob=Object(Ce.a)({reducer:{application:_d,user:Hd,transactions:Gd,swap:Xd,mint:$d,burn:rb,multicall:ib,lists:nb,toasts:Hs},middleware:[].concat(Object(K.a)(Object(Ce.e)({thunk:!1})),[Object(Ld.save)({states:ab})]),preloadedState:cb});ob.dispatch(Yd());var sb=ob;function ub(e){var n=new x.a(e);return n.pollingInterval=15e3,n}var lb=Object(m.c)(de),db=function(e){var n=e.children;return Object(r.jsx)(m.b,{getLibrary:ub,children:Object(r.jsx)(lb,{getLibrary:ub,children:Object(r.jsx)(v.a,{store:sb,children:Object(r.jsx)(ud,{children:Object(r.jsx)(s.v,{children:n})})})})})},bb=(t(393),t(177)),pb=t(240),fb=t.n(pb),jb=t(241),hb=t.n(jb);bb.a.use(fb.a).use(hb.a).use($n.a).init({backend:{loadPath:"./locales/{{lng}}.json"},react:{useSuspense:!0},fallbackLng:"en",preload:["en"],keySeparator:!1,interpolation:{escapeValue:!1}});bb.a;"ethereum"in window&&(window.ethereum.autoRefreshOnNetworkChange=!1),window.addEventListener("error",(function(){var e;null===(e=localStorage)||void 0===e||e.removeItem("redux_localstorage_simple_lists")})),o.a.render(Object(r.jsx)(i.StrictMode,{children:Object(r.jsxs)(db,{children:[Object(r.jsxs)(r.Fragment,{children:[Object(r.jsx)(Rd,{}),Object(r.jsx)(Sd,{}),Object(r.jsx)(Md,{}),Object(r.jsx)(Pd,{}),Object(r.jsx)(Dd,{})]}),Object(r.jsx)(s.x,{}),Object(r.jsx)(p,{}),Object(r.jsx)(Td,{})]})}),document.getElementById("root"))}},[[410,2,3]]]); +//# sourceMappingURL=main.814ff23e.chunk.js.map \ No newline at end of file diff --git a/pancake-swap-interface-v1/build/static/js/main.814ff23e.chunk.js.map b/pancake-swap-interface-v1/build/static/js/main.814ff23e.chunk.js.map new file mode 100644 index 0000000..0b5a25f --- /dev/null +++ b/pancake-swap-interface-v1/build/static/js/main.814ff23e.chunk.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["style/Global.ts","connectors/NetworkConnector.ts","connectors/index.ts","constants/index.ts","hooks/index.ts","state/application/actions.ts","state/application/hooks.ts","components/Column/index.tsx","state/lists/actions.ts","utils/listVersionLabel.ts","components/Row/index.tsx","components/Popups/ListUpdatePopup.tsx","utils/index.ts","components/Shared/Common.tsx","components/Popups/TransactionPopup.tsx","components/Popups/PopupItem.tsx","components/Popups/index.tsx","components/Loader/index.tsx","components/Web3ReactManager/index.tsx","components/Card/index.tsx","components/Modal/index.tsx","components/TransactionConfirmationModal/helpers.tsx","components/TransactionConfirmationModal/ConfirmationPendingContent.tsx","components/TransactionConfirmationModal/TransactionSubmittedContent.tsx","components/TransactionConfirmationModal/TransactionConfirmationModal.tsx","components/TransactionConfirmationModal/ConfirmationModalContent.tsx","components/TransactionConfirmationModal/TransactionErrorContent.tsx","components/TransactionConfirmationModal/index.tsx","hooks/TranslationsContext.ts","utils/translateTextHelpers.ts","hooks/useI18n.ts","components/CardNav/index.tsx","constants/abis/erc20.ts","state/lists/hooks.ts","state/multicall/actions.ts","state/multicall/hooks.ts","state/user/actions.ts","utils/theme.ts","state/user/hooks.tsx","constants/multicall/index.ts","hooks/useContract.ts","hooks/Tokens.ts","state/wallet/hooks.ts","hooks/useLast.ts","utils/contenthashToUri.ts","utils/parseENSAddress.ts","utils/uriToHttp.ts","utils/isZero.ts","hooks/useHttpLocations.ts","hooks/useENSContentHash.ts","components/Logo/index.tsx","components/ListLogo/index.tsx","hooks/useInterval.ts","components/Popover/index.tsx","components/Tooltip/index.tsx","components/QuestionHelper/index.tsx","components/pancake/CoinLogo.ts","components/CurrencyLogo/index.tsx","components/SearchModal/CommonBases.tsx","components/SearchModal/styleds.tsx","components/SearchModal/CurrencyList.tsx","components/SearchModal/filtering.ts","components/SearchModal/SortButton.tsx","components/SearchModal/sorting.ts","components/SearchModal/CurrencySearch.tsx","constants/lists.ts","utils/getTokenList.ts","utils/resolveENSContentHash.ts","hooks/useFetchListCallback.ts","hooks/useOnClickOutside.tsx","components/SearchModal/ListSelect.tsx","hooks/useToggle.ts","components/SearchModal/CurrencySearchModal.tsx","components/DoubleLogo/index.tsx","components/NumericalInput/index.tsx","components/CurrencyInputPanel/index.tsx","components/NavigationTabs/index.tsx","data/TotalSupply.ts","utils/currencyId.ts","utils/wrappedCurrency.ts","components/swap/styleds.tsx","components/PositionCard/index.tsx","data/Reserves.ts","data/Allowances.ts","state/swap/actions.ts","state/transactions/actions.ts","state/transactions/hooks.tsx","utils/prices.ts","hooks/useApproveCallback.ts","state/mint/actions.ts","hooks/useDebounce.ts","hooks/useENS.ts","hooks/useENSName.ts","hooks/useENSAddress.ts","hooks/Trades.ts","state/swap/hooks.ts","hooks/useParsedQueryString.ts","state/mint/hooks.ts","utils/maxAmountSpend.ts","components/Pane/index.tsx","state/toasts/index.ts","hooks/useToast.ts","hooks/useAuth.ts","components/ConnectWalletButton/index.tsx","pages/AppBody.tsx","pages/Pool/styleds.tsx","pages/AddLiquidity/ConfirmAddModalBottom.tsx","pages/AddLiquidity/PoolPriceBar.tsx","pages/AddLiquidity/index.tsx","pages/AddLiquidity/redirects.tsx","pages/RemoveLiquidity/redirects.tsx","components/PageHeader/SlippageToleranceSetting.tsx","components/PageHeader/TransactionDeadlineSetting.tsx","components/PageHeader/AudioSetting.tsx","components/PageHeader/SettingsModal.tsx","components/PageHeader/RecentTransactionsModal.tsx","components/PageHeader/index.tsx","pages/PoolFinder/index.tsx","pages/Pool/index.tsx","components/Slider/index.tsx","state/burn/actions.ts","state/burn/hooks.ts","pages/RemoveLiquidity/index.tsx","utils/useDebouncedChangeHandler.ts","components/AddressInputPanel/index.tsx","components/swap/FormattedPriceImpact.tsx","components/swap/SwapModalFooter.tsx","components/swap/SwapModalHeader.tsx","components/swap/ConfirmSwapModal.tsx","components/swap/SwapRoute.tsx","components/swap/AdvancedSwapDetails.tsx","components/swap/AdvancedSwapDetailsDropdown.tsx","components/swap/TradePrice.tsx","components/TokenWarningModal/index.tsx","components/SyrupWarningModal/index.tsx","components/SafeMoonWarningModal/index.tsx","components/ProgressSteps/index.tsx","hooks/useSwapCallback.ts","hooks/useWrapCallback.ts","pages/Swap/index.tsx","components/swap/confirmPriceImpactWithoutFee.ts","pages/Swap/redirects.tsx","constants/localisation/languageCodes.ts","hooks/LanguageContext.ts","ThemeContext.tsx","hooks/useTheme.ts","hooks/useGetPriceData.ts","hooks/useGetLocalProfile.ts","components/Menu/config.ts","components/Menu/index.tsx","hooks/useGetDocumentTitlePrice.ts","pages/App.tsx","hooks/useIsWindowVisible.ts","state/application/updater.ts","state/lists/updater.ts","utils/retry.ts","state/multicall/updater.tsx","utils/chunkArray.ts","state/transactions/updater.tsx","components/ToastListener/index.tsx","state/application/reducer.ts","state/global/actions.ts","state/user/reducer.ts","state/transactions/reducer.ts","state/swap/reducer.ts","state/mint/reducer.ts","state/lists/reducer.ts","state/burn/reducer.ts","state/multicall/reducer.ts","state/index.ts","utils/getLibrary.ts","Providers.tsx","i18n.ts","index.tsx"],"names":["GlobalStyle","createGlobalStyle","theme","colors","background","RequestError","message","code","data","Error","MiniRpcProvider","chainId","url","batchWaitTimeMs","isMetaMask","host","path","nextId","batchTimeoutId","batch","clearBatch","a","fetch","method","headers","accept","body","JSON","stringify","map","item","request","response","forEach","reject","ok","status","statusText","json","byKey","reduce","memo","current","id","result","resolve","error","sendAsync","callback","params","then","jsonrpc","catch","toString","promise","Promise","push","setTimeout","this","parsed","URL","pathname","NetworkConnector","urls","defaultChainId","invariant","Object","keys","length","supportedChainIds","k","Number","providers","currentChainId","accumulator","provider","account","AbstractConnector","NETWORK_URL","process","NETWORK_CHAIN_ID","parseInt","networkLibrary","network","injected","InjectedConnector","bscConnector","BscConnector","walletconnect","WalletConnectConnector","rpc","bridge","qrcode","pollingInterval","connectorsByName","WalletLinkConnector","appName","appLogoUrl","ConnectorNames","Injected","WalletConnect","BSC","ROUTER_ADDRESS","CAKE","Token","ChainId","BSCTESTNET","WBNB","DAI","BUSD","USDT","ETH","WETH_ONLY","MAINNET","WETH","BASES_TO_CHECK_TRADES_AGAINST","CUSTOM_BASES","SUGGESTED_BASES","BASES_TO_TRACK_LIQUIDITY_FOR","PINNED_PAIRS","NetworkContextName","INITIAL_ALLOWED_SLIPPAGE","DEFAULT_DEADLINE_FROM_NOW","ONE_BIPS","Percent","JSBI","BigInt","BIPS_BASE","ALLOWED_PRICE_IMPACT_LOW","ALLOWED_PRICE_IMPACT_MEDIUM","ALLOWED_PRICE_IMPACT_HIGH","PRICE_IMPACT_WITHOUT_FEE_CONFIRM_MIN","BLOCKED_PRICE_IMPACT_NON_EXPERT","MIN_ETH","exponentiate","useActiveWeb3React","context","useWeb3ReactCore","contextNetwork","active","updateBlockNumber","createAction","toggleWalletModal","toggleSettingsMenu","addPopup","removePopup","useBlockNumber","useSelector","state","application","blockNumber","useRemovePopup","dispatch","useDispatch","useCallback","key","Column","styled","div","ColumnCenter","AutoColumn","gap","justify","fetchTokenList","pending","fulfilled","rejected","acceptListUpdate","addList","removeList","selectList","listVersionLabel","version","major","minor","patch","Row","Box","align","padding","border","borderRadius","RowBetween","RowFlat","AutoRow","RowFixed","ListUpdatePopup","popKey","listUrl","oldList","newList","auto","removeThisPopup","handleAcceptUpdate","useMemo","diffTokenLists","tokens","tokensAdded","added","tokensChanged","changed","tokensRemoved","removed","numTokensChanged","style","flex","name","fontSize","token","i","Fragment","title","address","symbol","flexGrow","marginRight","onClick","isAddress","value","getAddress","BSCSCAN_PREFIXES","56","97","getBscScanLink","type","prefix","shortenAddress","chars","substring","calculateGasMargin","mul","BigNumber","from","add","calculateSlippageAmount","slippage","divide","multiply","raw","getContract","ABI","library","AddressZero","Contract","getSigner","connectUnchecked","getProviderOrSigner","getRouterContract","_","IUniswapV2Router02ABI","LinkStyledButton","button","disabled","textSubtle","primary","StyledInternalLink","Link","StyledLink","ExternalLink","target","href","rel","rest","handleClick","event","ctrlKey","metaKey","preventDefault","rotate","keyframes","Spinner","img","RowNoFlex","TransactionPopup","hash","success","summary","useContext","ThemeContext","paddingRight","color","size","failure","slice","StyledClose","X","Popup","invertedContrast","mediaQueries","sm","Fader","tertiary","AnimatedFader","animated","PopupItem","removeAfterMs","content","useEffect","timeout","clearTimeout","popupContent","txn","listUpdate","faderStyle","useSpring","width","to","config","duration","undefined","MobilePopupWrapper","height","MobilePopupInner","FixedPopupColumn","Popups","activePopups","list","popupList","filter","show","useActivePopups","reverse","StyledSVG","svg","stroke","Loader","viewBox","fill","xmlns","d","strokeWidth","strokeLinecap","strokeLinejoin","MessageWrapper","Message","h2","primaryDark","Web3ReactManager","children","t","useTranslation","useWeb3React","networkActive","networkError","activateNetwork","activate","triedEager","useState","tried","setTried","isAuthorized","hasSignedIn","window","localStorage","getItem","connectorLocalStorageKey","isMobile","ethereum","useEagerConnect","suppress","on","handleChainChanged","e","console","handleAccountsChanged","accounts","removeListener","useInactiveListener","showLoader","setShowLoader","Card","LightCard","GreyCard","AnimatedDialogOverlay","DialogOverlay","StyledDialogOverlay","AnimatedDialogContent","DialogContent","StyledDialogContent","minHeight","maxHeight","mobile","isOpen","attrs","transparentize","css","lg","Modal","onDismiss","initialFocusRef","fadeTransition","useTransition","opacity","enter","leave","props","aria-label","tabIndex","Wrapper","Section","ConfirmedIcon","BottomSection","StyledContentHeader","Heading","ContentHeader","variant","CustomLightSpinner","ConfirmationPendingContent","pendingText","src","alt","TransactionSubmittedContent","mt","TransactionConfirmationModal","attemptingTxn","ConfirmationModalContent","bottomContent","topContent","TransactionErrorContent","marginTop","textAlign","defaultTranslationState","translations","setTranslations","TranslationsContext","createContext","variableRegex","getTranslation","translationId","fallback","foundTranslation","find","translation","stringId","translatedString","text","includes","stringToReplace","exec","indexToReplace","split","indexOf","fallbackValueAtIndex","replace","replaceDynamicString","TranslateString","useI18n","StyledNav","Nav","activeIndex","scale","as","ERC20_INTERFACE","Interface","ERC20_ABI","WrappedTokenInfo","tokenInfo","tags","decimals","logoURI","EMPTY_LIST","listCache","WeakMap","useTokenList","lists","byUrl","get","tokenMap","tagId","x","Boolean","set","listToTokenMap","useSelectedListUrl","selectedListUrl","useSelectedTokenList","ADDRESS_REGEX","LOWER_HEX_REGEX","toCallKey","call","test","callData","parseCallKey","callKey","pcs","addMulticallListeners","removeMulticallListeners","fetchingMulticallResults","errorFetchingMulticallResults","updateMulticallResults","isMethodArg","isValidMethodArgs","Array","isArray","every","xi","INVALID_RESULT","valid","NEVER_RELOAD","blocksPerFetch","Infinity","useCallsData","calls","options","callResults","multicall","serializedCallKeys","c","sort","callKeys","parse","INVALID_CALL_STATE","loading","syncing","LOADING_CALL_STATE","toCallState","callResult","contractInterface","fragment","latestBlockNumber","decodeFunctionResult","useMultipleContractSingleData","addresses","methodName","callInputs","getFunction","encodeFunctionData","results","useSingleCallResult","contract","inputs","interface","updateMatchesDarkMode","updateUserDarkMode","updateUserExpertMode","updateUserSlippageTolerance","updateUserDeadline","addSerializedToken","removeSerializedToken","addSerializedPair","removeSerializedPair","muteAudio","unmuteAudio","CACHE_KEY","serializeToken","deserializeToken","serializedToken","useIsExpertMode","user","userExpertMode","useUserSlippageTolerance","userSlippageTolerance","slippageTolerance","useUserDeadline","userDeadline","deadline","useUserAddedTokens","serializedTokensMap","values","serializePair","pair","token0","token1","toV2LiquidityToken","tokenA","tokenB","Pair","MULTICALL_NETWORKS","useContract","withSignerIfPossible","useTokenContract","tokenAddress","useENSRegistrarContract","ENS_ABI","useENSResolverContract","ENS_PUBLIC_RESOLVER_ABI","useMulticallContract","MULTICALL_ABI","useAllTokens","userAddedTokens","allTokens","BYTES32_REGEX","parseStringOrBytes32","str","bytes32","defaultValue","parseBytes32String","useToken","tokenContract","tokenContractBytes32","ERC20_BYTES32_ABI","useBytes32TokenContract","tokenName","tokenNameBytes32","symbolBytes32","useCurrency","currencyId","isBNB","toUpperCase","ETHER","useETHBalances","uncheckedAddresses","multicallContract","useSingleContractMultipleData","CurrencyAmount","ether","useTokenBalancesWithLoadingIndicator","validatedTokens","balances","vt","anyLoading","some","callState","amount","TokenAmount","useTokenBalances","useTokenBalance","tokenBalances","useCurrencyBalances","currencies","currency","ethBalance","useCurrencyBalance","useLast","filterFn","last","setLast","prev","isDefined","UTF_8_DECODER","TextDecoder","contenthashToUri","contenthash","buff","hex","startsWith","substr","arr","Uint8Array","hexToUint8Array","codec","getCodec","rmPrefix","cid","CID","toB58String","multihash","decode","digest","trim","ENS_NAME_REGEX","parseENSAddress","ensAddress","match","ensName","toLowerCase","ensPath","uriToHttp","uri","isZero","hexNumberString","useHttpLocations","ens","resolvedContentHash","ensNodeArgument","namehash","resolverAddressResult","resolverAddress","useENSContentHash","BAD_SRCS","Logo","srcs","refresh","s","onError","StyledListLogo","ListLogo","useInterval","delay","leading","savedCallback","useRef","tick","setInterval","clearInterval","PopoverContainer","ReferenceElement","Arrow","Popover","placement","referenceElement","setReferenceElement","popperElement","setPopperElement","arrowElement","setArrowElement","usePopper","strategy","modifiers","offset","element","styles","update","attributes","ref","popper","className","arrow","TooltipContainer","Tooltip","MouseoverTooltip","setShow","open","close","onMouseEnter","onMouseLeave","QuestionWrapper","QuestionHelper","marginLeft","CoinLogo","getTokenLogoURL","StyledBnbLogo","StyledLogo","CurrencyLogo","uriLocations","BaseWrapper","disable","CommonBases","onSelect","selectedCurrency","currencyEquals","selected","FadedSpan","PaddedColumn","MenuItem","SearchInput","input","textDisabled","Separator","SeparatorDark","currencyKey","StyledBalanceText","Text","Tag","Balance","balance","toExact","toSignificant","TagContainer","TokenTags","tag","description","join","CurrencyRow","isSelected","otherSelected","isOnSelectedList","defaultTokens","isTokenOnList","customAdded","useIsUserAddedToken","removeToken","useRemoveUserAddedToken","addToken","useAddUserToken","stopPropagation","justifySelf","CurrencyList","onCurrencySelect","otherCurrency","fixedListRef","showETH","itemData","Currency","index","itemKey","itemCount","itemSize","filterTokens","search","searchingAddress","lowerSearchParts","matchesSearch","sParts","p","sp","endsWith","FilterWrapper","SortButton","toggleSortOrder","ascending","useTokenComparator","inverted","useAllTokenBalances","comparator","balanceA","balanceB","balanceComp","greaterThan","equalTo","getTokenComparator","CurrencySearch","otherSelectedCurrency","showCommonBases","onChangeList","fixedList","searchQuery","setSearchQuery","invertSearchOrder","setInvertSearchOrder","isAddressSearch","searchToken","tokenComparator","audioPlay","filteredTokens","filteredSortedTokens","sorted","symbolMatch","handleCurrencySelect","audio","document","getElementById","play","inputRef","handleInput","checksummedInput","scrollTo","handleEnter","selectedUrl","listsByUrl","pendingUpdate","loadingRequestId","useSelectedListInfo","placeholder","onChange","onKeyDown","iso","disableWidth","DEFAULT_TOKEN_LIST_URL","DEFAULT_LIST_OF_LISTS","tokenListValidator","Ajv","allErrors","compile","schema","getTokenList","resolveENSContentHash","defaultTokenJson","parsedENS","contentHashUri","translatedUri","isLast","validationErrors","errors","dataPath","REGISTRAR_ABI","constant","outputs","payable","stateMutability","REGISTRAR_ADDRESS","RESOLVER_ABI","internalType","resolverContract","ensRegistrarContract","resolver","useFetchListCallback","ensResolver","Web3Provider","getNetworkLibrary","requestId","nanoid","tokenList","errorMessage","useOnClickOutside","node","handler","handlerRef","handleClickOutside","contains","addEventListener","removeEventListener","UnpaddedLinkStyledButton","StyledMenu","StyledListUrlText","ListOrigin","lowerListUrl","listUrlRowHTMLId","ListRow","onBack","initialState","setState","toggle","useToggle","selectThisList","handleAcceptListUpdate","handleRemoveList","prompt","bold","overflow","textOverflow","display","minWidth","ListContainer","ListSelect","listUrlInput","setListUrlInput","adding","addError","setAddError","fetchList","handleAddList","validUrl","handleEnterKey","sortedLists","u1","u2","l1","l2","cursor","maxWidth","CurrencySearchModal","listView","setListView","lastOpen","handleClickChangeList","handleClickBack","noListSelected","sizeraw","margin","HigherLogo","CoveredLogo","DoubleCurrencyLogo","currency0","currency1","StyledInput","inputRegex","RegExp","Input","React","onUserInput","nextUserInput","inputMode","autoComplete","autoCorrect","pattern","minLength","maxLength","spellCheck","InputRow","CurrencySelect","darken","LabelRow","Aligner","span","InputPanel","hideInput","Container","shadows","inset","CurrencyInputPanel","onMax","showMaxButton","label","disableCurrencySelect","hideBalance","modalOpen","setModalOpen","selectedCurrencyBalance","translatedLabel","handleDismissSearch","val","Tabs","ActiveText","StyledArrowLeft","ArrowLeft","FindPoolTabs","AddRemoveTabs","useTotalSupply","totalSupply","wrappedCurrency","wrappedCurrencyAmount","currencyAmount","unwrappedToken","equals","ArrowWrapper","clickable","SectionBreak","BottomGrouping","ErrorText","severity","binance","StyledBalanceMaxMini","Dots","SwapCallbackErrorInner","SwapCallbackErrorInnerAlertTriangle","SwapCallbackError","SwapShowAcceptChanges","FixedHeightRow","HoverCard","MinimalPositionCard","showUnwrapped","showMore","setShowMore","userPoolBalance","liquidityToken","totalPoolTokens","greaterThanOrEqual","getLiquidityValue","token0Deposited","token1Deposited","textTransform","fontWeight","ml","FullPositionCard","poolTokenPercentage","toFixed","PairState","PAIR_INTERFACE","IUniswapV2PairABI","usePairs","currencyA","currencyB","reserves","LOADING","INVALID","NOT_EXISTS","reserve0","reserve1","sortsBefore","EXISTS","usePair","useTokenAllowance","owner","spender","allowance","Field","selectCurrency","switchCurrencies","typeInput","replaceSwapState","setRecipient","addTransaction","clearAllTransactions","finalizeTransaction","checkedTransaction","useTransactionAdder","approval","useAllTransactions","transactions","isTransactionRecent","tx","Date","getTime","addedTime","ApprovalState","BASE_FEE","ONE_HUNDRED_PERCENT","INPUT_FRACTION_AFTER_FEE","subtract","computeTradePriceBreakdown","trade","realizedLPFee","route","pairs","currentFee","priceImpactWithoutFeeFraction","priceImpact","priceImpactWithoutFee","numerator","denominator","inputAmount","quotient","computeSlippageAdjustedAmounts","allowedSlippage","num","pct","Math","floor","INPUT","maximumAmountIn","OUTPUT","minimumAmountOut","warningSeverity","lessThan","formatExecutionPrice","executionPrice","invert","outputAmount","useApproveCallback","amountToApprove","currentAllowance","pendingApproval","allTransactions","receipt","useHasPendingApproval","approvalState","APPROVED","PENDING","NOT_APPROVED","UNKNOWN","approve","useExact","estimateGas","MaxUint256","estimatedGas","gasLimit","resetMintState","useDebounce","debouncedValue","setDebouncedValue","useENS","nameOrAddress","validated","reverseLookup","debouncedAddress","ENSName","useENSName","lookup","debouncedName","addr","useENSAddress","useAllCommonPairs","bases","basePairs","flatMap","base","otherBase","t0","t1","allPairs","customBases","customBasesA","customBasesB","curr","useSwapState","swap","tryParseAmount","typedValueParsed","parseUnits","info","BAD_RECIPIENT_ADDRESSES","involvesAddress","checksummedAddress","useDerivedSwapInfo","inputError","independentField","typedValue","inputCurrencyId","outputCurrencyId","recipient","inputCurrency","outputCurrency","recipientLookup","relevantTokenBalances","isExactIn","parsedAmount","bestTradeExactIn","currencyAmountIn","currencyOut","allowedPairs","Trade","maxHops","maxNumResults","useTradeExactIn","bestTradeExactOut","currencyIn","currencyAmountOut","useTradeExactOut","v2Trade","currencyBalances","formattedTo","slippageAdjustedAmounts","balanceIn","amountIn","parseCurrencyFromURLParameter","urlParam","queryParametersToSwapState","parsedQs","validatedRecipient","exactAmount","isNaN","parseFloat","parseIndependentFieldURLParameter","exactField","useDefaultsFromURLSearch","useLocation","parseArrays","ignoreQueryPrefix","useParsedQueryString","setResult","field","ZERO","useMintState","mint","maxAmountSpend","Pane","borderColor","toastsSlice","createSlice","reducers","action","payload","toastIndex","findIndex","toast","splice","unshift","remove","clear","actions","useToast","pushToast","toastError","kebabCase","toastTypes","DANGER","toastInfo","INFO","toastSuccess","SUCCESS","toastWarning","WARNING","removeToast","clearToast","useAuth","deactivate","login","connectorID","connector","removeItem","UnsupportedChainIdError","NoEthereumProviderError","NoBscProviderError","UserRejectedRequestErrorInjected","UserRejectedRequestErrorWalletConnect","walletConnectProvider","logout","UnlockButton","onPresentConnectModal","useWalletModal","BodyWrapper","AppBody","ClickableText","ConfirmAddModalBottom","noLiquidity","price","parsedAmounts","onAdd","CURRENCY_A","CURRENCY_B","justifyContent","PoolPriceBar","pt","AddLiquidity","currencyIdA","currencyIdB","history","oneCurrencyIsWBNB","expertMode","otherTypedValue","dependentField","pairState","equal","independentAmount","dependentAmount","wrappedIndependentAmount","dependentCurrency","dependentTokenAmount","priceOf","quote","currencyAAmount","currencyBAmount","Price","wrappedCurrencyA","liquidityMinted","tokenAmountA","tokenAmountB","getLiquidityMinted","useDerivedMintInfo","onFieldAInput","onFieldBInput","useMintActionHandlers","isValid","showConfirm","setShowConfirm","setAttemptingTxn","txHash","setTxHash","formattedAmounts","maxAmounts","atMaxAmounts","approvalA","approveACallback","approvalB","approveBCallback","router","parsedAmountA","parsedAmountB","amountsMin","deadlineFromNow","ceil","now","tokenBIsBNB","estimate","addLiquidityETH","args","addLiquidity","estimatedGasLimit","modalHeader","mr","small","fontStyle","modalBottom","handleCurrencyASelect","currA","newCurrencyIdA","handleCurrencyBSelect","currB","newCurrencyIdB","handleDismissConfirmation","CardNav","mb","ConnectWalletButton","OLD_PATH_STRUCTURE","RedirectOldAddLiquidityPathStructure","RedirectDuplicateTokenIds","RedirectOldRemoveLiquidityPathStructure","Option","Options","predefinedValues","SlippageToleranceSettings","translateString","setUserslippageTolerance","setValue","setError","rawValue","alignItems","predefinedValue","step","min","evt","inputValue","isWarning","TransactionDeadlineSetting","setDeadline","AudioSetting","useMatchBreakpoints","isSm","isXs","toggleSetAudioMode","useAudioModeManager","checked","defaultOnDismiss","SettingsModal","SlippageToleranceSetting","newTransactionsFirst","b","RecentTransactionsModal","sortedRecentTransactions","flexDirection","sortedRecentTransaction","icon","getRowStatus","Fields","StyledPageHeader","Details","PageHeader","useModal","onPresentSettings","onPresentRecentTransactions","Pool","trackedTokenPairs","pinnedPairs","generatedPairs","savedSerializedPairs","userPairs","forChain","pairId","combinedList","concat","keyed","useTrackedTokenPairs","tokenPairsWithLiquidityTokens","tpwlt","v2PairsBalances","fetchingV2PairBalances","liquidityTokensWithBalances","v2Pairs","v2IsLoading","V2Pair","allV2PairsWithLiquidity","v2Pair","PoolFinder","showSearch","setShowSearch","TOKEN1","activeField","setActiveField","setCurrency0","setCurrency1","addPair","serializedPair","usePairAdder","validPairNoLiquidity","position","hasPosition","TOKEN0","handleSearchDismiss","prerequisiteMessage","startIcon","endIcon","justifyItems","backgroundColor","StyledRangeInput","Slider","max","changeCallback","aria-labelledby","useBurnState","burn","OutlineCard","Body","RemoveLiquidity","userLiquidity","LIQUIDITY","liquidityValueA","liquidityValueB","liquidityValues","percentToRemove","LIQUIDITY_PERCENT","liquidityValue","useDerivedBurnInfo","_onUserInput","useBurnActionHandlers","showDetailed","setShowDetailed","atMaxAmount","pairContract","signatureData","setSignatureData","approveCallback","liquidityAmount","nonces","nonce","deadlineForSignature","EIP712Domain","domain","verifyingContract","Permit","toHexString","types","primaryType","send","splitSignature","signature","v","r","onLiquidityInput","onCurrencyAInput","onCurrencyBInput","onRemove","currencyAmountA","currencyAmountB","currencyBIsETH","oneCurrencyIsETH","methodNames","all","safeGasEstimates","indexOfSuccessfulEstimation","safeGasEstimate","isBigNumber","liquidityPercentChangeCallback","oneCurrencyIsWETH","handleSelectCurrencyA","handleSelectCurrencyB","debouncedMs","inner","setInner","timer","onChangeInner","newValue","useDebouncedChangeHandler","innerLiquidityPercentage","setInnerLiquidityPercentage","paddingBottom","ContainerRow","InputContainer","AddressInputPanel","withoutSpaces","autoCapitalize","FormattedPriceImpact","SwapModalFooter","onConfirm","swapErrorMessage","disabledConfirm","showInverted","setShowInverted","paddingLeft","tradeType","TradeType","EXACT_INPUT","PriceInfoText","SwapModalHeader","showAcceptChanges","onAcceptChanges","priceImpactSeverity","EXACT_OUTPUT","ConfirmSwapModal","originalTrade","tradeB","tradeA","confirmationContent","px","py","my","flexWrap","isLastItem","flexShrink","TradeSummary","AdvancedSwapDetails","showRoute","AdvancedDetailsFooter","AdvancedSwapDetailsDropdown","lastTrade","TradePrice","formattedPrice","baseCurrency","quoteCurrency","WarningContainer","StyledWarningIcon","AlertTriangle","TokenWarningCard","tokenSymbol","duplicateNameOrSymbol","userToken","TokenWarningModal","understandChecked","setUnderstandChecked","toggleUnderstand","uc","handleDismiss","htmlFor","userSelect","SyrupWarningModal","transactionType","SafeMoonWarningModal","SwapCallbackState","Grouping","Circle","confirmed","backgroundDisabled","CircleRow","Connector","prevConfirmed","ProgressCircles","steps","useSwapCallArguments","recipientAddressOrName","recipientAddress","swapMethods","Router","swapCallParameters","feeOnTransfer","ttl","parameters","useSwapCallback","swapCalls","VALID","gasEstimate","gasError","callStatic","callError","reason","estimatedCalls","successfulEstimation","el","ix","errorCalls","inputSymbol","outputSymbol","withRecipient","WrapType","NOT_APPLICABLE","wrapType","useWrapCallback","wethContract","WETH_ABI","useWETHContract","sufficientBalance","WRAP","execute","deposit","txReceipt","UNWRAP","withdraw","Swap","loadedUrlParams","loadedInputCurrency","loadedOutputCurrency","dismissTokenWarning","setDismissTokenWarning","selectedToken","purchaseType","transactionWarning","setTransactionWarning","urlLoadedTokens","handleConfirmTokenWarning","handleConfirmWarning","toggleSetExpertMode","useExpertModeManager","isExpertMode","swapInputError","onWrap","wrapInputError","showWrap","onCurrencySelection","onSwitchTokens","onChangeRecipient","useSwapActionHandlers","handleTypeInput","handleTypeOutput","tradeToConfirm","setSwapState","userHasSpecifiedInputOutput","noRoute","useApproveCallbackFromTrade","approvalSubmitted","setApprovalSubmitted","maxAmountInput","atMaxAmountInput","swapCallback","swapCallbackError","handleSwap","confirm","confirmPriceImpactWithoutFee","prevState","showApproveFlow","handleConfirmDismiss","handleAcceptChanges","checkForWarning","handleInputSelect","handleMaxInput","handleOutputSelect","RedirectPathToSwapOnly","location","EN","language","allLanguages","defaultLanguageState","selectedLanguage","setSelectedLanguage","translatedLanguage","setTranslatedLanguage","LanguageContext","isDark","toggleTheme","ThemeContextProvider","isDarkUserSetting","setIsDark","Provider","setItem","dark","light","useTheme","StyledThemeCopntext","useGetPriceData","setData","res","fetchData","profileLink","noProfileLink","useGetLocalProfile","profile","setProfile","localData","Cookies","localProfile","prevProfile","username","image","avatar","initialOpenState","items","Menu","priceData","cakePriceUsd","links","currentLang","langs","setLang","useGetDocumentTitlePrice","cakePriceUsdString","toLocaleString","minimumFractionDigits","maximumFractionDigits","AppWrapper","xs","Marginer","App","storedLangCode","storedLang","getStoredLang","langObject","exact","strict","component","VISIBILITY_STATE_SUPPORTED","isWindowVisible","visibilityState","useIsWindowVisible","focused","setFocused","listener","Updater","windowVisible","blockNumberCallback","getBlockNumber","debouncedState","bump","getVersionUpgrade","VersionUpgrade","NONE","PATCH","MINOR","minVersionBump","MAJOR","waitRandom","ms","round","random","CancelledError","RetryableError","chunk","minBlockNumber","aggregate","obj","resultsBlockNumber","returnData","toNumber","debouncedListeners","callListeners","cancellations","listeningKeys","allListeners","listeners","keyListeners","previousMin","activeListeningKeys","unserializedOutdatedCallKeys","minDataBlockNumber","fetchingBlockNumber","outdatedListeningKeys","serializedOutdatedCallKeys","outdatedCallKeys","chunkedCalls","maxChunkSize","numChunks","chunkSize","chunkArray","fn","rejectCancelled","n","minWait","maxWait","completed","cancel","retry","fetchChunk","fetchBlockNumber","firstCallKeyIndex","lastCallKeyIndex","lastBlockNumber","useAddPopup","lastCheckedBlockNumber","blocksSinceCheck","minutesPending","shouldCheck","getTransactionReceipt","blockHash","contractAddress","transactionHash","transactionIndex","ToastListener","toasts","createReducer","walletModalOpen","settingsMenuOpen","builder","addCase","popup","updateVersion","currentTimestamp","pairKey","token0Address","token1Address","userDarkMode","matchesDarkMode","timestamp","lastUpdateVersionTimestamp","tokenAAddress","tokenBAddress","txs","confirmedTime","otherField","NEW_LIST_STATE","lastInitializedDefaultListOfLists","DEFAULT_LIST","lastInitializedSet","l","Set","newListOfListsSet","has","PERSISTED_KEYS","loadedState","load","states","cache","rawCache","getThemeCache","store","configureStore","reducer","middleware","getDefaultMiddleware","thunk","save","preloadedState","getLibrary","Web3ProviderNetwork","createWeb3ReactRoot","Providers","i18next","use","XHR","LanguageDetector","initReactI18next","init","backend","loadPath","react","useSuspense","fallbackLng","preload","keySeparator","interpolation","escapeValue","autoRefreshOnNetworkChange","ReactDOM","render","Global"],"mappings":"2wuBAEA,I,EAWeA,EAXKC,4BAAH,KAEO,qBAAGC,MAAkBC,OAAOC,c,gMCc9CC,E,kDACJ,WAAYC,EAAwBC,EAAqBC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cx8C,SACfA,OAAOK,SAAiBk9C,4BAA6B,GAGxDv9C,OAAOghB,iBAAiB,SAAS,WAAO,IAAD,EACxB,QAAZ,EAAA/gB,oBAAA,SAAc62B,WAAW,sCAG5B0mB,IAASC,OACP,cAAC,aAAD,UACE,eAAC,GAAD,WACE,qCACE,cAAC,GAAD,IACA,cAAC,GAAD,IACA,cAAC,GAAD,IACA,cAAC,GAAD,IACA,cAAC,GAAD,OAEF,cAAC,IAAD,IACA,cAACC,EAAD,IACA,cAACvJ,GAAD,SAGJ/2B,SAASC,eAAe,W","file":"static/js/main.814ff23e.chunk.js","sourcesContent":["import { createGlobalStyle } from 'styled-components'\n\nconst GlobalStyle = createGlobalStyle`\n body {\n background-color: ${({ theme }) => theme.colors.background};\n\n img {\n height: auto;\n max-width: 100%;\n }\n }\n`\n\nexport default GlobalStyle\n","import { ConnectorUpdate } from '@web3-react/types'\nimport { AbstractConnector } from '@web3-react/abstract-connector'\nimport invariant from 'tiny-invariant'\n\ninterface NetworkConnectorArguments {\n urls: { [chainId: number]: string }\n defaultChainId?: number\n}\n\n// taken from ethers.js, compatible interface with web3 provider\ntype AsyncSendable = {\n isMetaMask?: boolean\n host?: string\n path?: string\n sendAsync?: (request: any, callback: (error: any, response: any) => void) => void\n send?: (request: any, callback: (error: any, response: any) => void) => void\n}\n\nclass RequestError extends Error {\n constructor(message: string, public code: number, public data?: unknown) {\n super(message)\n }\n}\n\ninterface BatchItem {\n request: { jsonrpc: '2.0'; id: number; method: string; params: unknown }\n resolve: (result: any) => void\n reject: (error: Error) => void\n}\n\nclass MiniRpcProvider implements AsyncSendable {\n public readonly isMetaMask: false = false\n\n public readonly chainId: number\n\n public readonly url: string\n\n public readonly host: string\n\n public readonly path: string\n\n public readonly batchWaitTimeMs: number\n\n private nextId = 1\n\n private batchTimeoutId: ReturnType | null = null\n\n private batch: BatchItem[] = []\n\n constructor(chainId: number, url: string, batchWaitTimeMs?: number) {\n this.chainId = chainId\n this.url = url\n const parsed = new URL(url)\n this.host = parsed.host\n this.path = parsed.pathname\n // how long to wait to batch calls\n this.batchWaitTimeMs = batchWaitTimeMs ?? 50\n }\n\n public readonly clearBatch = async () => {\n const { batch } = this\n this.batch = []\n this.batchTimeoutId = null\n let response: Response\n try {\n response = await fetch(this.url, {\n method: 'POST',\n headers: { 'content-type': 'application/json', accept: 'application/json' },\n body: JSON.stringify(batch.map((item) => item.request)),\n })\n } catch (error) {\n batch.forEach(({ reject }) => reject(new Error('Failed to send batch call')))\n return\n }\n\n if (!response.ok) {\n batch.forEach(({ reject }) => reject(new RequestError(`${response.status}: ${response.statusText}`, -32000)))\n return\n }\n\n let json\n try {\n json = await response.json()\n } catch (error) {\n batch.forEach(({ reject }) => reject(new Error('Failed to parse JSON response')))\n return\n }\n const byKey = batch.reduce<{ [id: number]: BatchItem }>((memo, current) => {\n memo[current.request.id] = current\n return memo\n }, {})\n // eslint-disable-next-line no-restricted-syntax\n for (const result of json) {\n const {\n resolve,\n reject,\n request: { method },\n } = byKey[result.id]\n if (resolve && reject) {\n if ('error' in result) {\n reject(new RequestError(result?.error?.message, result?.error?.code, result?.error?.data))\n } else if ('result' in result) {\n resolve(result.result)\n } else {\n reject(new RequestError(`Received unexpected JSON-RPC response to ${method} request.`, -32000, result))\n }\n }\n }\n }\n\n public readonly sendAsync = (\n request: { jsonrpc: '2.0'; id: number | string | null; method: string; params?: any },\n callback: (error: any, response: any) => void\n ): void => {\n this.request(request.method, request.params)\n .then((result) => callback(null, { jsonrpc: '2.0', id: request.id, result }))\n .catch((error) => callback(error, null))\n }\n\n public readonly request = async (\n method: string | { method: string; params: unknown[] },\n params?: any\n ): Promise => {\n if (typeof method !== 'string') {\n return this.request(method.method, method.params)\n }\n if (method === 'eth_chainId') {\n return `0x${this.chainId.toString(16)}`\n }\n const promise = new Promise((resolve, reject) => {\n this.batch.push({\n request: {\n jsonrpc: '2.0',\n id: this.nextId++,\n method,\n params,\n },\n resolve,\n reject,\n })\n })\n this.batchTimeoutId = this.batchTimeoutId ?? setTimeout(this.clearBatch, this.batchWaitTimeMs)\n return promise\n }\n}\n\nexport class NetworkConnector extends AbstractConnector {\n private readonly providers: { [chainId: number]: MiniRpcProvider }\n\n private currentChainId: number\n\n constructor({ urls, defaultChainId }: NetworkConnectorArguments) {\n invariant(defaultChainId || Object.keys(urls).length === 1, 'defaultChainId is a required argument with >1 url')\n super({ supportedChainIds: Object.keys(urls).map((k): number => Number(k)) })\n\n this.currentChainId = defaultChainId || Number(Object.keys(urls)[0])\n this.providers = Object.keys(urls).reduce<{ [chainId: number]: MiniRpcProvider }>((accumulator, chainId) => {\n accumulator[Number(chainId)] = new MiniRpcProvider(Number(chainId), urls[Number(chainId)])\n return accumulator\n }, {})\n }\n\n public get provider(): MiniRpcProvider {\n return this.providers[this.currentChainId]\n }\n\n public async activate(): Promise {\n return { provider: this.providers[this.currentChainId], chainId: this.currentChainId, account: null }\n }\n\n public async getProvider(): Promise {\n return this.providers[this.currentChainId]\n }\n\n public async getChainId(): Promise {\n return this.currentChainId\n }\n\n public async getAccount(): Promise {\n return null\n }\n\n public deactivate() {\n return null\n }\n}\n\nexport default NetworkConnector\n","import { ConnectorNames } from '@pancakeswap-libs/uikit'\nimport { Web3Provider } from '@ethersproject/providers'\nimport { InjectedConnector } from '@web3-react/injected-connector'\nimport { WalletConnectConnector } from '@web3-react/walletconnect-connector'\nimport { WalletLinkConnector } from '@web3-react/walletlink-connector'\nimport { BscConnector } from '@binance-chain/bsc-connector'\nimport { NetworkConnector } from './NetworkConnector'\n\nconst NETWORK_URL = process.env.REACT_APP_NETWORK_URL\n\nexport const NETWORK_CHAIN_ID: number = parseInt(process.env.REACT_APP_CHAIN_ID ?? '97')\n\nif (typeof NETWORK_URL === 'undefined') {\n throw new Error(`REACT_APP_NETWORK_URL must be a defined environment variable`)\n}\n\nexport const network = new NetworkConnector({\n urls: { [NETWORK_CHAIN_ID]: NETWORK_URL },\n defaultChainId: NETWORK_CHAIN_ID\n})\n\nlet networkLibrary: Web3Provider | undefined\nexport function getNetworkLibrary(): Web3Provider {\n // eslint-disable-next-line no-return-assign\n return (networkLibrary = networkLibrary ?? new Web3Provider(network.provider as any))\n}\n\nexport const injected = new InjectedConnector({\n supportedChainIds: [97],\n})\n\nexport const bscConnector = new BscConnector({ supportedChainIds: [97] })\n\n// mainnet only\nexport const walletconnect = new WalletConnectConnector({\n rpc: { [NETWORK_CHAIN_ID]: NETWORK_URL },\n bridge: 'https://bridge.walletconnect.org',\n qrcode: true,\n pollingInterval: 15000,\n})\n\n// mainnet only\nexport const walletlink = new WalletLinkConnector({\n url: NETWORK_URL,\n appName: 'Uniswap',\n appLogoUrl:\n 'https://mpng.pngfly.com/20181202/bex/kisspng-emoji-domain-unicorn-pin-badges-sticker-unicorn-tumblr-emoji-unicorn-iphoneemoji-5c046729264a77.5671679315437924251569.jpg',\n})\n\nexport const connectorsByName: { [connectorName in ConnectorNames]: any } = {\n [ConnectorNames.Injected]: injected,\n [ConnectorNames.WalletConnect]: walletconnect,\n [ConnectorNames.BSC]: bscConnector,\n}\n","import { ChainId, JSBI, Percent, Token, WETH } from '@pancakeswap-libs/sdk'\n\nexport const ROUTER_ADDRESS = '0xCc7aDc94F3D80127849D2b41b6439b7CF1eB4Ae0'\n\n// a list of tokens by chain\ntype ChainTokenList = {\n readonly [chainId in ChainId]: Token[]\n}\n\nexport const CAKE = new Token(ChainId.BSCTESTNET, '0xB8F5B50ed77596b5E638359d828000747bb3dd89', 18, 'CAKE', 'PancakeSwap Token')\nexport const WBNB = new Token(ChainId.BSCTESTNET, '0x0dE8FCAE8421fc79B29adE9ffF97854a424Cad09', 18, 'WBNB', 'Wrapped BNB')\nexport const DAI = new Token(ChainId.BSCTESTNET, '0x3Cf204795c4995cCf9C1a0B3191F00c01B03C56C', 18, 'DAI', 'Dai Stablecoin')\nexport const BUSD = new Token(ChainId.BSCTESTNET, '0xE0dFffc2E01A7f051069649aD4eb3F518430B6a4', 18, 'BUSD', 'Binance USD')\nexport const USDT = new Token(ChainId.BSCTESTNET, '0x7afd064DaE94d73ee37d19ff2D264f5A2903bBB0', 18, 'USDT', 'Tether USD')\nexport const ETH = new Token(ChainId.BSCTESTNET, '0xE282a15DBad45e3131620C1b8AF85B7330Cb3b4B', 18, 'ETH', 'Binance-Peg Ethereum Token')\n\nconst WETH_ONLY: ChainTokenList = {\n [ChainId.MAINNET]: [WETH[ChainId.MAINNET]],\n [ChainId.BSCTESTNET]: [WETH[ChainId.BSCTESTNET]],\n}\n\n// used to construct intermediary pairs for trading\nexport const BASES_TO_CHECK_TRADES_AGAINST: ChainTokenList = {\n ...WETH_ONLY,\n [ChainId.BSCTESTNET]: [...WETH_ONLY[ChainId.BSCTESTNET], DAI, BUSD, USDT, ETH],\n}\n\n/**\n * Some tokens can only be swapped via certain pairs, so we override the list of bases that are considered for these\n * tokens.\n */\nexport const CUSTOM_BASES: { [chainId in ChainId]?: { [tokenAddress: string]: Token[] } } = {\n [ChainId.BSCTESTNET]: {},\n}\n\n// used for display in the default list when adding liquidity\nexport const SUGGESTED_BASES: ChainTokenList = {\n ...WETH_ONLY,\n [ChainId.BSCTESTNET]: [...WETH_ONLY[ChainId.BSCTESTNET], DAI, BUSD, USDT],\n}\n\n// used to construct the list of all pairs we consider by default in the frontend\nexport const BASES_TO_TRACK_LIQUIDITY_FOR: ChainTokenList = {\n ...WETH_ONLY,\n [ChainId.BSCTESTNET]: [...WETH_ONLY[ChainId.BSCTESTNET], DAI, BUSD, USDT],\n}\n\nexport const PINNED_PAIRS: { readonly [chainId in ChainId]?: [Token, Token][] } = {\n [ChainId.BSCTESTNET]: [\n [CAKE, WBNB],\n [BUSD, USDT],\n [DAI, USDT],\n ],\n}\n\nexport const NetworkContextName = 'NETWORK'\n\n// default allowed slippage, in bips\nexport const INITIAL_ALLOWED_SLIPPAGE = 80\n// 20 minutes, denominated in seconds\nexport const DEFAULT_DEADLINE_FROM_NOW = 60 * 20\n\n// one basis point\nexport const ONE_BIPS = new Percent(JSBI.BigInt(1), JSBI.BigInt(10000))\nexport const BIPS_BASE = JSBI.BigInt(10000)\n// used for warning states\nexport const ALLOWED_PRICE_IMPACT_LOW: Percent = new Percent(JSBI.BigInt(100), BIPS_BASE) // 1%\nexport const ALLOWED_PRICE_IMPACT_MEDIUM: Percent = new Percent(JSBI.BigInt(300), BIPS_BASE) // 3%\nexport const ALLOWED_PRICE_IMPACT_HIGH: Percent = new Percent(JSBI.BigInt(500), BIPS_BASE) // 5%\n// if the price slippage exceeds this number, force the user to type 'confirm' to execute\nexport const PRICE_IMPACT_WITHOUT_FEE_CONFIRM_MIN: Percent = new Percent(JSBI.BigInt(1000), BIPS_BASE) // 10%\n// for non expert mode disable swaps above this\nexport const BLOCKED_PRICE_IMPACT_NON_EXPERT: Percent = new Percent(JSBI.BigInt(1500), BIPS_BASE) // 15%\n\n// used to ensure the user doesn't send so much ETH so they end up with <.01\nexport const MIN_ETH: JSBI = JSBI.exponentiate(JSBI.BigInt(10), JSBI.BigInt(16)) // .01 ETH\n","import { Web3Provider } from '@ethersproject/providers'\nimport { ChainId } from '@pancakeswap-libs/sdk'\nimport { connectorLocalStorageKey } from '@pancakeswap-libs/uikit'\nimport { useWeb3React as useWeb3ReactCore } from '@web3-react/core'\n// eslint-disable-next-line import/no-unresolved\nimport { Web3ReactContextInterface } from '@web3-react/core/dist/types'\nimport { useEffect, useState } from 'react'\nimport { isMobile } from 'react-device-detect'\nimport { injected } from '../connectors'\nimport { NetworkContextName } from '../constants'\n\nexport function useActiveWeb3React(): Web3ReactContextInterface & { chainId?: ChainId } {\n const context = useWeb3ReactCore()\n const contextNetwork = useWeb3ReactCore(NetworkContextName)\n return context.active ? context : contextNetwork\n}\n\nexport function useEagerConnect() {\n const { activate, active } = useWeb3ReactCore() // specifically using useWeb3ReactCore because of what this hook does\n const [tried, setTried] = useState(false)\n\n useEffect(() => {\n injected.isAuthorized().then((isAuthorized) => {\n const hasSignedIn = window.localStorage.getItem(connectorLocalStorageKey)\n if (isAuthorized && hasSignedIn) {\n activate(injected, undefined, true).catch(() => {\n setTried(true)\n })\n } else if (isMobile && window.ethereum && hasSignedIn) {\n activate(injected, undefined, true).catch(() => {\n setTried(true)\n })\n } else {\n setTried(true)\n }\n })\n }, [activate]) // intentionally only running on mount (make sure it's only mounted once :))\n\n // if the connection worked, wait until we get confirmation of that to flip the flag\n useEffect(() => {\n if (active) {\n setTried(true)\n }\n }, [active])\n\n return tried\n}\n\n/**\n * Use for network and injected - logs user in\n * and out after checking what network theyre on\n */\nexport function useInactiveListener(suppress = false) {\n const { active, error, activate } = useWeb3ReactCore() // specifically using useWeb3React because of what this hook does\n\n useEffect(() => {\n const { ethereum } = window\n\n if (ethereum && ethereum.on && !active && !error && !suppress) {\n const handleChainChanged = () => {\n // eat errors\n activate(injected, undefined, true).catch((e) => {\n console.error('Failed to activate after chain changed', e)\n })\n }\n\n const handleAccountsChanged = (accounts: string[]) => {\n if (accounts.length > 0) {\n // eat errors\n activate(injected, undefined, true).catch((e) => {\n console.error('Failed to activate after accounts changed', e)\n })\n }\n }\n\n ethereum.on('chainChanged', handleChainChanged)\n ethereum.on('accountsChanged', handleAccountsChanged)\n\n return () => {\n if (ethereum.removeListener) {\n ethereum.removeListener('chainChanged', handleChainChanged)\n ethereum.removeListener('accountsChanged', handleAccountsChanged)\n }\n }\n }\n return undefined\n }, [active, error, suppress, activate])\n}\n","import { createAction } from '@reduxjs/toolkit'\nimport { TokenList } from '@uniswap/token-lists'\n\nexport type PopupContent =\n | {\n txn: {\n hash: string\n success: boolean\n summary?: string\n }\n }\n | {\n listUpdate: {\n listUrl: string\n oldList: TokenList\n newList: TokenList\n auto: boolean\n }\n }\n\nexport const updateBlockNumber = createAction<{ chainId: number; blockNumber: number }>('app/updateBlockNumber')\nexport const toggleWalletModal = createAction('app/toggleWalletModal')\nexport const toggleSettingsMenu = createAction('app/toggleSettingsMenu')\nexport const addPopup = createAction<{ key?: string; removeAfterMs?: number | null; content: PopupContent }>(\n 'app/addPopup'\n)\nexport const removePopup = createAction<{ key: string }>('app/removePopup')\n","import { useCallback, useMemo } from 'react'\nimport { useSelector, useDispatch } from 'react-redux'\nimport { useActiveWeb3React } from '../../hooks'\nimport { addPopup, PopupContent, removePopup, toggleWalletModal, toggleSettingsMenu } from './actions'\nimport { AppState } from '../index'\n\nexport function useBlockNumber(): number | undefined {\n const { chainId } = useActiveWeb3React()\n\n return useSelector((state: AppState) => state.application.blockNumber[chainId ?? -1])\n}\n\nexport function useWalletModalOpen(): boolean {\n return useSelector((state: AppState) => state.application.walletModalOpen)\n}\n\nexport function useWalletModalToggle(): () => void {\n const dispatch = useDispatch()\n return useCallback(() => dispatch(toggleWalletModal()), [dispatch])\n}\n\nexport function useSettingsMenuOpen(): boolean {\n return useSelector((state: AppState) => state.application.settingsMenuOpen)\n}\n\nexport function useToggleSettingsMenu(): () => void {\n const dispatch = useDispatch()\n return useCallback(() => dispatch(toggleSettingsMenu()), [dispatch])\n}\n\n// returns a function that allows adding a popup\nexport function useAddPopup(): (content: PopupContent, key?: string) => void {\n const dispatch = useDispatch()\n\n return useCallback(\n (content: PopupContent, key?: string) => {\n dispatch(addPopup({ content, key }))\n },\n [dispatch]\n )\n}\n\n// returns a function that allows removing a popup via its key\nexport function useRemovePopup(): (key: string) => void {\n const dispatch = useDispatch()\n return useCallback(\n (key: string) => {\n dispatch(removePopup({ key }))\n },\n [dispatch]\n )\n}\n\n// get the list of active popups\nexport function useActivePopups(): AppState['application']['popupList'] {\n const list = useSelector((state: AppState) => state.application.popupList)\n return useMemo(() => list.filter(item => item.show), [list])\n}\n","import styled from 'styled-components'\n\nconst Column = styled.div`\n display: flex;\n flex-direction: column;\n justify-content: flex-start;\n`\nexport const ColumnCenter = styled(Column)`\n width: 100%;\n align-items: center;\n`\n\nexport const AutoColumn = styled.div<{\n gap?: 'sm' | 'md' | 'lg' | string\n justify?: 'stretch' | 'center' | 'start' | 'end' | 'flex-start' | 'flex-end' | 'space-between'\n}>`\n display: grid;\n grid-auto-rows: auto;\n grid-row-gap: ${({ gap }) => (gap === 'sm' && '8px') || (gap === 'md' && '12px') || (gap === 'lg' && '24px') || gap};\n justify-items: ${({ justify }) => justify && justify};\n`\n\nexport default Column\n","import { ActionCreatorWithPayload, createAction } from '@reduxjs/toolkit'\nimport { TokenList, Version } from '@uniswap/token-lists'\n\nexport const fetchTokenList: Readonly<{\n pending: ActionCreatorWithPayload<{ url: string; requestId: string }>\n fulfilled: ActionCreatorWithPayload<{ url: string; tokenList: TokenList; requestId: string }>\n rejected: ActionCreatorWithPayload<{ url: string; errorMessage: string; requestId: string }>\n}> = {\n pending: createAction('lists/fetchTokenList/pending'),\n fulfilled: createAction('lists/fetchTokenList/fulfilled'),\n rejected: createAction('lists/fetchTokenList/rejected')\n}\n\nexport const acceptListUpdate = createAction('lists/acceptListUpdate')\nexport const addList = createAction('lists/addList')\nexport const removeList = createAction('lists/removeList')\nexport const selectList = createAction('lists/selectList')\nexport const rejectVersionUpdate = createAction('lists/rejectVersionUpdate')\n","import { Version } from '@uniswap/token-lists'\n\nexport default function listVersionLabel(version: Version): string {\n return `v${version.major}.${version.minor}.${version.patch}`\n}\n","import styled from 'styled-components'\nimport { Box } from 'rebass/styled-components'\n\nconst Row = styled(Box)<{ align?: string; padding?: string; border?: string; borderRadius?: string }>`\n width: 100%;\n display: flex;\n padding: 0;\n align-items: ${({ align }) => (align || 'center')};\n padding: ${({ padding }) => padding};\n border: ${({ border }) => border};\n border-radius: ${({ borderRadius }) => borderRadius};\n`\n\nexport const RowBetween = styled(Row)`\n justify-content: space-between;\n`\n\nexport const RowFlat = styled.div`\n display: flex;\n align-items: flex-end;\n`\n\nexport const AutoRow = styled(Row)<{ gap?: string; justify?: string }>`\n flex-wrap: wrap;\n margin: ${({ gap }) => gap && `-${gap}`};\n justify-content: ${({ justify }) => justify && justify};\n\n & > * {\n margin: ${({ gap }) => gap} !important;\n }\n`\n\nexport const RowFixed = styled(Row)<{ gap?: string; justify?: string }>`\n width: fit-content;\n margin: ${({ gap }) => gap && `-${gap}`};\n`\n\nexport default Row\n","import React, { useCallback, useMemo } from 'react'\nimport { diffTokenLists, TokenList } from '@uniswap/token-lists'\nimport { Button, Text } from '@pancakeswap-libs/uikit'\nimport { useDispatch } from 'react-redux'\nimport { AppDispatch } from '../../state'\nimport { useRemovePopup } from '../../state/application/hooks'\nimport { acceptListUpdate } from '../../state/lists/actions'\nimport listVersionLabel from '../../utils/listVersionLabel'\nimport { AutoColumn } from '../Column'\nimport { AutoRow } from '../Row'\n\nexport default function ListUpdatePopup({\n popKey,\n listUrl,\n oldList,\n newList,\n auto,\n}: {\n popKey: string\n listUrl: string\n oldList: TokenList\n newList: TokenList\n auto: boolean\n}) {\n const removePopup = useRemovePopup()\n const removeThisPopup = useCallback(() => removePopup(popKey), [popKey, removePopup])\n const dispatch = useDispatch()\n\n const handleAcceptUpdate = useCallback(() => {\n if (auto) return\n dispatch(acceptListUpdate(listUrl))\n removeThisPopup()\n }, [auto, dispatch, listUrl, removeThisPopup])\n\n const { added: tokensAdded, changed: tokensChanged, removed: tokensRemoved } = useMemo(() => {\n return diffTokenLists(oldList.tokens, newList.tokens)\n }, [newList.tokens, oldList.tokens])\n const numTokensChanged = useMemo(\n () =>\n Object.keys(tokensChanged).reduce((memo, chainId: any) => memo + Object.keys(tokensChanged[chainId]).length, 0),\n [tokensChanged]\n )\n\n return (\n \n \n {auto ? (\n \n The token list "{oldList.name}" has been updated to{' '}\n {listVersionLabel(newList.version)}.\n \n ) : (\n <>\n
\n \n An update is available for the token list "{oldList.name}" (\n {listVersionLabel(oldList.version)} to {listVersionLabel(newList.version)}).\n \n
    \n {tokensAdded.length > 0 ? (\n
  • \n {tokensAdded.map((token, i) => (\n \n {token.symbol}\n {i === tokensAdded.length - 1 ? null : ', '}\n \n ))}{' '}\n added\n
  • \n ) : null}\n {tokensRemoved.length > 0 ? (\n
  • \n {tokensRemoved.map((token, i) => (\n \n {token.symbol}\n {i === tokensRemoved.length - 1 ? null : ', '}\n \n ))}{' '}\n removed\n
  • \n ) : null}\n {numTokensChanged > 0 ?
  • {numTokensChanged} tokens updated
  • : null}\n
\n
\n \n
\n \n
\n
\n \n
\n
\n \n )}\n
\n
\n )\n}\n","import { Contract } from '@ethersproject/contracts'\nimport { getAddress } from '@ethersproject/address'\nimport { AddressZero } from '@ethersproject/constants'\nimport { JsonRpcSigner, Web3Provider } from '@ethersproject/providers'\nimport { BigNumber } from '@ethersproject/bignumber'\nimport { abi as IUniswapV2Router02ABI } from '@uniswap/v2-periphery/build/IUniswapV2Router02.json'\nimport { ChainId, JSBI, Percent, Token, CurrencyAmount, Currency, ETHER } from '@pancakeswap-libs/sdk'\nimport { ROUTER_ADDRESS } from '../constants'\nimport { TokenAddressMap } from '../state/lists/hooks'\n\n// returns the checksummed address if the address is valid, otherwise returns false\nexport function isAddress(value: any): string | false {\n try {\n return getAddress(value)\n } catch {\n return false\n }\n}\n\nconst BSCSCAN_PREFIXES: { [chainId in ChainId]: string } = {\n 56: '',\n 97: 'testnet.'\n}\n\nexport function getBscScanLink(chainId: ChainId, data: string, type: 'transaction' | 'token' | 'address'): string {\n const prefix = `https://${BSCSCAN_PREFIXES[chainId] || BSCSCAN_PREFIXES[ChainId.MAINNET]}bscscan.com`\n\n switch (type) {\n case 'transaction': {\n return `${prefix}/tx/${data}`\n }\n case 'token': {\n return `${prefix}/token/${data}`\n }\n case 'address':\n default: {\n return `${prefix}/address/${data}`\n }\n }\n}\n\n// shorten the checksummed version of the input address to have 0x + 4 characters at start and end\nexport function shortenAddress(address: string, chars = 4): string {\n const parsed = isAddress(address)\n if (!parsed) {\n throw Error(`Invalid 'address' parameter '${address}'.`)\n }\n return `${parsed.substring(0, chars + 2)}...${parsed.substring(42 - chars)}`\n}\n\n// add 10%\nexport function calculateGasMargin(value: BigNumber): BigNumber {\n return value.mul(BigNumber.from(10000).add(BigNumber.from(1000))).div(BigNumber.from(10000))\n}\n\n// converts a basis points value to a sdk percent\nexport function basisPointsToPercent(num: number): Percent {\n return new Percent(JSBI.BigInt(Math.floor(num)), JSBI.BigInt(10000))\n}\n\nexport function calculateSlippageAmount(value: CurrencyAmount, slippage: number): [JSBI, JSBI] {\n if (slippage < 0 || slippage > 10000) {\n throw Error(`Unexpected slippage value: ${slippage}`)\n }\n return [\n JSBI.divide(JSBI.multiply(value.raw, JSBI.BigInt(10000 - slippage)), JSBI.BigInt(10000)),\n JSBI.divide(JSBI.multiply(value.raw, JSBI.BigInt(10000 + slippage)), JSBI.BigInt(10000))\n ]\n}\n\n// account is not optional\nexport function getSigner(library: Web3Provider, account: string): JsonRpcSigner {\n return library.getSigner(account).connectUnchecked()\n}\n\n// account is optional\nexport function getProviderOrSigner(library: Web3Provider, account?: string): Web3Provider | JsonRpcSigner {\n return account ? getSigner(library, account) : library\n}\n\n// account is optional\nexport function getContract(address: string, ABI: any, library: Web3Provider, account?: string): Contract {\n if (!isAddress(address) || address === AddressZero) {\n throw Error(`Invalid 'address' parameter '${address}'.`)\n }\n\n return new Contract(address, ABI, getProviderOrSigner(library, account) as any)\n}\n\n// account is optional\nexport function getRouterContract(_: number, library: Web3Provider, account?: string): Contract {\n return getContract(ROUTER_ADDRESS, IUniswapV2Router02ABI, library, account)\n}\n\nexport function escapeRegExp(string: string): string {\n return string.replace(/[.*+?^${}()|[\\]\\\\]/g, '\\\\$&') // $& means the whole matched string\n}\n\nexport function isTokenOnList(defaultTokens: TokenAddressMap, currency?: Currency): boolean {\n if (currency === ETHER) return true\n return Boolean(currency instanceof Token && defaultTokens[currency.chainId]?.[currency.address])\n}\n","import React, { HTMLProps, useCallback } from 'react'\nimport { Link } from 'react-router-dom'\nimport styled, { keyframes } from 'styled-components'\n\n// A button that triggers some onClick result, but looks like a link.\nexport const LinkStyledButton = styled.button<{ disabled?: boolean }>`\n border: none;\n text-decoration: none;\n background: none;\n\n cursor: ${({ disabled }) => (disabled ? 'default' : 'pointer')};\n color: ${({ theme, disabled }) => (disabled ? theme.colors.textSubtle : theme.colors.primary)};\n font-weight: 500;\n\n :hover {\n text-decoration: ${({ disabled }) => (disabled ? null : 'underline')};\n }\n\n :focus {\n outline: none;\n text-decoration: ${({ disabled }) => (disabled ? null : 'underline')};\n }\n\n :active {\n text-decoration: none;\n }\n`\n\n// An internal link from the react-router-dom library that is correctly styled\nexport const StyledInternalLink = styled(Link)`\n text-decoration: none;\n cursor: pointer;\n color: ${({ theme }) => theme.colors.primary};\n font-weight: 500;\n\n :hover {\n text-decoration: underline;\n }\n\n :focus {\n outline: none;\n text-decoration: underline;\n }\n\n :active {\n text-decoration: none;\n }\n`\n\nconst StyledLink = styled.a`\n text-decoration: none;\n cursor: pointer;\n color: ${({ theme }) => theme.colors.primary};\n font-weight: 500;\n\n :hover {\n text-decoration: underline;\n }\n\n :focus {\n outline: none;\n text-decoration: underline;\n }\n\n :active {\n text-decoration: none;\n }\n`\n\n/**\n * Outbound link that handles firing google analytics events\n */\nexport function ExternalLink({\n target = '_blank',\n href,\n rel = 'noopener noreferrer',\n ...rest\n}: Omit, 'as' | 'ref' | 'onClick'> & { href: string }) {\n const handleClick = useCallback(\n (event: React.MouseEvent) => {\n if (!(target === '_blank' || event.ctrlKey || event.metaKey)) {\n event.preventDefault()\n }\n },\n [target]\n )\n return \n}\n\nconst rotate = keyframes`\n from {\n transform: rotate(0deg);\n }\n to {\n transform: rotate(360deg);\n }\n`\n\nexport const Spinner = styled.img`\n animation: 2s ${rotate} linear infinite;\n width: 16px;\n height: 16px;\n`\n","import React, { useContext } from 'react'\nimport { AlertCircle, CheckCircle } from 'react-feather'\nimport { Text } from '@pancakeswap-libs/uikit'\nimport styled, { ThemeContext } from 'styled-components'\nimport { useActiveWeb3React } from '../../hooks'\nimport { getBscScanLink } from '../../utils'\nimport { ExternalLink } from '../Shared'\nimport { AutoColumn } from '../Column'\nimport { AutoRow } from '../Row'\n\nconst RowNoFlex = styled(AutoRow)`\n flex-wrap: nowrap;\n`\n\nexport default function TransactionPopup({\n hash,\n success,\n summary,\n}: {\n hash: string\n success?: boolean\n summary?: string\n}) {\n const { chainId } = useActiveWeb3React()\n\n const theme = useContext(ThemeContext)\n\n return (\n \n
\n {success ? (\n \n ) : (\n \n )}\n
\n \n {summary ?? `Hash: ${hash.slice(0, 8)}...${hash.slice(58, 65)}`}\n {chainId && View on bscscan}\n \n
\n )\n}\n","import React, { useCallback, useContext, useEffect } from 'react'\nimport { X } from 'react-feather'\nimport { useSpring } from 'react-spring/web'\nimport styled, { ThemeContext } from 'styled-components'\nimport { animated } from 'react-spring'\nimport { PopupContent } from '../../state/application/actions'\nimport { useRemovePopup } from '../../state/application/hooks'\nimport ListUpdatePopup from './ListUpdatePopup'\nimport TransactionPopup from './TransactionPopup'\n\nexport const StyledClose = styled(X)`\n position: absolute;\n right: 10px;\n top: 10px;\n\n :hover {\n cursor: pointer;\n }\n`\nexport const Popup = styled.div`\n display: inline-block;\n width: 100%;\n padding: 1em;\n background-color: ${({ theme }) => theme.colors.invertedContrast};\n position: relative;\n border-radius: 10px;\n padding: 20px;\n padding-right: 35px;\n overflow: hidden;\n\n ${({ theme }) => theme.mediaQueries.sm} {\n min-width: 290px;\n }\n`\nconst Fader = styled.div`\n position: absolute;\n bottom: 0px;\n left: 0px;\n width: 100%;\n height: 2px;\n background-color: ${({ theme }) => theme.colors.tertiary};\n`\n\nconst AnimatedFader = animated(Fader)\n\nexport default function PopupItem({\n removeAfterMs,\n content,\n popKey\n}: {\n removeAfterMs: number | null\n content: PopupContent\n popKey: string\n}) {\n const removePopup = useRemovePopup()\n const removeThisPopup = useCallback(() => removePopup(popKey), [popKey, removePopup])\n useEffect(() => {\n if (removeAfterMs === null) return undefined\n\n const timeout = setTimeout(() => {\n removeThisPopup()\n }, removeAfterMs)\n\n return () => {\n clearTimeout(timeout)\n }\n }, [removeAfterMs, removeThisPopup])\n\n const theme = useContext(ThemeContext)\n\n let popupContent\n if ('txn' in content) {\n const {\n txn: { hash, success, summary }\n } = content\n popupContent = \n } else if ('listUpdate' in content) {\n const {\n listUpdate: { listUrl, oldList, newList, auto }\n } = content\n popupContent = \n }\n\n const faderStyle = useSpring({\n from: { width: '100%' },\n to: { width: '0%' },\n config: { duration: removeAfterMs ?? undefined }\n })\n\n return (\n \n \n {popupContent}\n {removeAfterMs !== null ? : null}\n \n )\n}\n","import React from 'react'\nimport styled from 'styled-components'\nimport { useActivePopups } from '../../state/application/hooks'\nimport { AutoColumn } from '../Column'\nimport PopupItem from './PopupItem'\n\nconst MobilePopupWrapper = styled.div<{ height: string | number }>`\n position: relative;\n max-width: 100%;\n height: ${({ height }) => height};\n margin: ${({ height }) => (height ? '0 auto;' : 0)};\n margin-bottom: ${({ height }) => (height ? '20px' : 0)}};\n display: none;\n\n ${({ theme }) => theme.mediaQueries.sm} {\n display: block;\n }\n`\n\nconst MobilePopupInner = styled.div`\n height: 99%;\n overflow-x: auto;\n overflow-y: hidden;\n display: flex;\n flex-direction: row;\n -webkit-overflow-scrolling: touch;\n ::-webkit-scrollbar {\n display: none;\n }\n`\n\nconst FixedPopupColumn = styled(AutoColumn)`\n position: fixed;\n top: 64px;\n right: 1rem;\n max-width: 355px !important;\n width: 100%;\n z-index: 2;\n\n ${({ theme }) => theme.mediaQueries.sm} {\n display: none;\n }\n`\n\nexport default function Popups() {\n // get all popups\n const activePopups = useActivePopups()\n\n return (\n <>\n \n {activePopups.map((item) => (\n \n ))}\n \n 0 ? 'fit-content' : 0}>\n \n {activePopups // reverse so new items up front\n .slice(0)\n .reverse()\n .map((item) => (\n \n ))}\n \n \n \n )\n}\n","import React from 'react'\n\nimport styled, { keyframes } from 'styled-components'\n\nconst rotate = keyframes`\n from {\n transform: rotate(0deg);\n }\n to {\n transform: rotate(360deg);\n }\n`\n\nconst StyledSVG = styled.svg<{ size: string; stroke?: string }>`\n animation: 2s ${rotate} linear infinite;\n height: ${({ size }) => size};\n width: ${({ size }) => size};\n path {\n stroke: ${({ stroke, theme }) => stroke ?? theme.colors.primary};\n }\n`\n\n/**\n * Takes in custom size and stroke for circle color, default to primary color as fill,\n * need ...rest for layered styles on top\n */\nexport default function Loader({ size = '16px', stroke, ...rest }: { size?: string; stroke?: string }) {\n return (\n \n \n \n )\n}\n","import React, { useState, useEffect } from 'react'\nimport { useWeb3React } from '@web3-react/core'\nimport styled from 'styled-components'\nimport { useTranslation } from 'react-i18next'\n\nimport { network } from '../../connectors'\nimport { useEagerConnect, useInactiveListener } from '../../hooks'\nimport { NetworkContextName } from '../../constants'\nimport Loader from '../Loader'\n\nconst MessageWrapper = styled.div`\n display: flex;\n align-items: center;\n justify-content: center;\n height: 20rem;\n`\n\nconst Message = styled.h2`\n color: ${({ theme }) => theme.colors.primaryDark};\n`\n\nexport default function Web3ReactManager({ children }: { children: JSX.Element }) {\n const { t } = useTranslation()\n const { active } = useWeb3React()\n const { active: networkActive, error: networkError, activate: activateNetwork } = useWeb3React(NetworkContextName)\n\n // try to eagerly connect to an injected provider, if it exists and has granted access already\n const triedEager = useEagerConnect()\n\n // after eagerly trying injected, if the network connect ever isn't active or in an error state, activate itd\n useEffect(() => {\n if (triedEager && !networkActive && !networkError && !active) {\n activateNetwork(network)\n }\n }, [triedEager, networkActive, networkError, activateNetwork, active])\n\n // when there's no account connected, react to logins (broadly speaking) on the injected provider, if it exists\n useInactiveListener(!triedEager)\n\n // handle delayed loader state\n const [showLoader, setShowLoader] = useState(false)\n useEffect(() => {\n const timeout = setTimeout(() => {\n setShowLoader(true)\n }, 600)\n\n return () => {\n clearTimeout(timeout)\n }\n }, [])\n\n // on page load, do nothing until we've tried to connect to the injected connector\n if (!triedEager) {\n return null\n }\n\n // if the account context isn't active, and there's an error on the network context, it's an irrecoverable error\n if (!active && networkError) {\n return (\n \n {t('unknownError')}\n \n )\n }\n\n // if neither context is active, spin\n if (!active && !networkActive) {\n return showLoader ? (\n \n \n \n ) : null\n }\n\n return children\n}\n","import styled from 'styled-components'\n\nconst Card = styled.div`\n width: 100%;\n border-radius: 16px;\n padding: 1.25rem;\n padding: ${({ padding }) => padding};\n border: ${({ border }) => border};\n border-radius: ${({ borderRadius }) => borderRadius};\n`\nexport default Card\n\nexport const LightCard = styled(Card)`\n border: 1px solid ${({ theme }) => theme.colors.invertedContrast};\n background-color: ${({ theme }) => theme.colors.invertedContrast};\n`\n\nexport const GreyCard = styled(Card)`\n background-color: ${({ theme }) => theme.colors.tertiary};\n`\n","import React from 'react'\nimport styled, { css } from 'styled-components'\nimport { animated, useTransition } from 'react-spring'\nimport { DialogOverlay, DialogContent } from '@reach/dialog'\nimport { isMobile } from 'react-device-detect'\nimport '@reach/dialog/styles.css'\nimport { transparentize } from 'polished'\n\nconst AnimatedDialogOverlay = animated(DialogOverlay)\n// eslint-disable-next-line @typescript-eslint/no-unused-vars\nconst StyledDialogOverlay = styled(AnimatedDialogOverlay)`\n &[data-reach-dialog-overlay] {\n z-index: 2;\n background-color: transparent;\n overflow: hidden;\n\n display: flex;\n align-items: center;\n justify-content: center;\n\n background-color: rgba(0, 0, 0, 0.3);\n }\n`\n\nconst AnimatedDialogContent = animated(DialogContent)\n// destructure to not pass custom props to Dialog DOM element\n// eslint-disable-next-line @typescript-eslint/no-unused-vars\nconst StyledDialogContent = styled(({ minHeight, maxHeight, mobile, isOpen, ...rest }) => (\n \n)).attrs({\n 'aria-label': 'dialog',\n})`\n &[data-reach-dialog-content] {\n margin: 0 0 2rem 0;\n border: 1px solid ${({ theme }) => theme.colors.invertedContrast};\n background-color: ${({ theme }) => theme.colors.invertedContrast};\n box-shadow: 0 4px 8px 0 ${transparentize(0.95, '#191326')};\n padding: 0px;\n width: 80%;\n overflow: hidden;\n\n align-self: ${({ mobile }) => (mobile ? 'flex-end' : 'center')};\n\n max-width: 420px;\n ${({ maxHeight }) =>\n maxHeight &&\n css`\n max-height: ${maxHeight}vh;\n `}\n ${({ minHeight }) =>\n minHeight &&\n css`\n min-height: ${minHeight}vh;\n `}\n display: flex;\n border-radius: 20px;\n\n ${({ theme }) => theme.mediaQueries.lg} {\n width: 65vw;\n }\n ${({ theme }) => theme.mediaQueries.sm} {\n width: 85vw;\n }\n }\n`\n\ninterface ModalProps {\n isOpen: boolean\n onDismiss: () => void\n minHeight?: number | false\n maxHeight?: number\n initialFocusRef?: React.RefObject\n children?: React.ReactNode\n}\n\nexport default function Modal({\n isOpen,\n onDismiss,\n minHeight = false,\n maxHeight = 50,\n initialFocusRef,\n children,\n}: ModalProps) {\n const fadeTransition = useTransition(isOpen, null, {\n config: { duration: 200 },\n from: { opacity: 0 },\n enter: { opacity: 1 },\n leave: { opacity: 0 },\n })\n\n return (\n <>\n {fadeTransition.map(\n ({ item, key, props }) =>\n item && (\n \n \n {/* prevents the automatic focusing of inputs on mobile by the reach dialog */}\n {/* eslint-disable */}\n {!initialFocusRef && isMobile ?
: null}\n {/* eslint-enable */}\n {children}\n \n \n )\n )}\n \n )\n}\n","import React, { ReactNode } from 'react'\nimport styled from 'styled-components'\nimport { Heading, IconButton, CloseIcon } from '@pancakeswap-libs/uikit'\nimport { AutoColumn, ColumnCenter } from '../Column'\n\n\nexport const Wrapper = styled.div`\n width: 100%;\n overflow-y: auto;\n`\nexport const Section = styled(AutoColumn)`\n padding: 24px;\n`\n\nexport const ConfirmedIcon = styled(ColumnCenter)`\n padding: 40px 0;\n`\n\nexport const BottomSection = styled(Section)`\n background-color: ${({ theme }) => theme.colors.invertedContrast};\n border-bottom-left-radius: 20px;\n border-bottom-right-radius: 20px;\n`\n\n/**\n * TODO: Remove this when modal system from the UI Kit is implemented\n */\nconst StyledContentHeader = styled.div`\n align-items: center;\n display: flex;\n\n & > ${Heading} {\n flex: 1;\n }\n`\n\ntype ContentHeaderProps = {\n children: ReactNode\n onDismiss: () => void\n}\n\nexport const ContentHeader = ({ children, onDismiss }: ContentHeaderProps) => (\n \n {children}\n \n \n \n \n)\n","import React from 'react'\nimport styled from 'styled-components'\nimport { Text } from '@pancakeswap-libs/uikit'\nimport { Spinner } from '../Shared'\nimport { AutoColumn } from '../Column'\nimport { Wrapper, Section, ConfirmedIcon, ContentHeader } from './helpers'\n\ntype ConfirmationPendingContentProps = { onDismiss: () => void; pendingText: string }\n\nconst CustomLightSpinner = styled(Spinner)<{ size: string }>`\n height: ${({ size }) => size};\n width: ${({ size }) => size};\n`\n\nconst ConfirmationPendingContent = ({ onDismiss, pendingText }: ConfirmationPendingContentProps) => {\n return (\n \n
\n Waiting for confirmation\n \n \n \n \n \n \n {pendingText}\n \n \n Confirm this transaction in your wallet\n \n
\n
\n )\n}\n\nexport default ConfirmationPendingContent\n","import { ChainId } from '@pancakeswap-libs/sdk'\nimport React, { useContext } from 'react'\nimport { ThemeContext } from 'styled-components'\nimport { Button, LinkExternal } from '@pancakeswap-libs/uikit'\nimport { ArrowUpCircle } from 'react-feather'\nimport { AutoColumn } from '../Column'\nimport { getBscScanLink } from '../../utils'\nimport { Wrapper, Section, ConfirmedIcon, ContentHeader } from './helpers'\n\ntype TransactionSubmittedContentProps = {\n onDismiss: () => void\n hash: string | undefined\n chainId: ChainId\n}\n\nconst TransactionSubmittedContent = ({ onDismiss, chainId, hash }: TransactionSubmittedContentProps) => {\n const theme = useContext(ThemeContext)\n\n return (\n \n
\n Transaction submitted\n \n \n \n \n {chainId && hash && (\n View on BscScan\n )}\n \n \n
\n
\n )\n}\n\nexport default TransactionSubmittedContent\n","import React from 'react'\nimport Modal from '../Modal'\nimport { useActiveWeb3React } from '../../hooks'\nimport ConfirmationPendingContent from './ConfirmationPendingContent'\nimport TransactionSubmittedContent from './TransactionSubmittedContent'\n\ninterface ConfirmationModalProps {\n isOpen: boolean\n onDismiss: () => void\n hash: string | undefined\n content: () => React.ReactNode\n attemptingTxn: boolean\n pendingText: string\n}\n\nconst TransactionConfirmationModal = ({\n isOpen,\n onDismiss,\n attemptingTxn,\n hash,\n pendingText,\n content\n}: ConfirmationModalProps) => {\n const { chainId } = useActiveWeb3React()\n\n if (!chainId) return null\n\n // confirmation screen\n return (\n \n {attemptingTxn ? (\n \n ) : hash ? (\n \n ) : (\n content()\n )}\n \n )\n}\n\nexport default TransactionConfirmationModal\n","import React from 'react'\nimport { Wrapper, Section, BottomSection, ContentHeader } from './helpers'\n\ntype ConfirmationModalContentProps = {\n title: string\n onDismiss: () => void\n topContent: () => React.ReactNode\n bottomContent: () => React.ReactNode\n}\n\nconst ConfirmationModalContent = ({ title, bottomContent, onDismiss, topContent }: ConfirmationModalContentProps) => {\n return (\n \n
\n {title}\n {topContent()}\n
\n {bottomContent()}\n
\n )\n}\n\nexport default ConfirmationModalContent\n","import React, { useContext } from 'react'\nimport { ThemeContext } from 'styled-components'\nimport { Button, Text } from '@pancakeswap-libs/uikit'\nimport { AlertTriangle } from 'react-feather'\nimport { AutoColumn } from '../Column'\nimport { Wrapper, Section, BottomSection, ContentHeader } from './helpers'\n\ntype TransactionErrorContentProps = { message: string; onDismiss: () => void }\n\nconst TransactionErrorContent = ({ message, onDismiss }: TransactionErrorContentProps) => {\n const theme = useContext(ThemeContext)\n return (\n \n
\n Error\n \n \n \n {message}\n \n \n
\n \n \n \n
\n )\n}\n\nexport default TransactionErrorContent\n","import TransactionConfirmationModal from './TransactionConfirmationModal'\n\nexport { default as ConfirmationModalContent } from './ConfirmationModalContent'\nexport { default as ConfirmationPendingContent } from './ConfirmationPendingContent'\nexport { default as TransactionErrorContent } from './TransactionErrorContent'\nexport { default as TransactionSubmittedContent } from './TransactionSubmittedContent'\n\nexport default TransactionConfirmationModal\n","import React, { createContext } from 'react'\n\ninterface TranslationState {\n translations: Array\n setTranslations: React.Dispatch>>\n}\n\nconst defaultTranslationState: TranslationState = {\n translations: [],\n setTranslations: (): void => undefined,\n}\n\nexport const TranslationsContext = createContext(defaultTranslationState as TranslationState)\n\nexport default TranslationsContext\n","import { useContext } from 'react'\nimport { TranslationsContext } from '../hooks/TranslationsContext'\n\nconst variableRegex = /%(.*?)%/\n\nconst replaceDynamicString = (foundTranslation: string, fallback: string) => {\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n const stringToReplace = variableRegex.exec(foundTranslation)![0]\n const indexToReplace = foundTranslation.split(' ').indexOf(stringToReplace)\n const fallbackValueAtIndex = fallback.split(' ')[indexToReplace]\n return foundTranslation.replace(stringToReplace, fallbackValueAtIndex)\n}\n\nexport const getTranslation = (translations: Array, translationId: number, fallback: string) => {\n const foundTranslation = translations.find((translation) => {\n return translation.data.stringId === translationId\n })\n if (foundTranslation) {\n const translatedString = foundTranslation.data.text\n const includesVariable = translatedString.includes('%')\n if (includesVariable) {\n return replaceDynamicString(translatedString, fallback)\n }\n return translatedString\n }\n return fallback\n}\n\nexport const TranslateString = (translationId: number, fallback: string) => {\n const { translations } = useContext(TranslationsContext)\n if (translations[0] === 'error' || translations.length === 0) {\n return fallback\n }\n if (translations.length > 0) {\n return getTranslation(translations, translationId, fallback)\n }\n return null\n}\n","import { useCallback, useContext } from 'react'\nimport { TranslationsContext } from 'hooks/TranslationsContext'\nimport { getTranslation } from 'utils/translateTextHelpers'\n\nconst useI18n = () => {\n const { translations } = useContext(TranslationsContext)\n\n /**\n * As a temporary fix memoize the translation function so it can be used in an effect.\n * It appears the TranslationsContext is always empty and is not currently used\n * TODO: Figure out if the context is used and if not, remove it.\n */\n return useCallback(\n (translationId: number, fallback: string) => {\n if (translations[0] === 'error') {\n return fallback\n }\n if (translations.length > 0) {\n return getTranslation(translations, translationId, fallback)\n }\n return fallback\n },\n [translations]\n )\n}\n\nexport default useI18n\n","import React from 'react'\nimport styled from 'styled-components'\nimport { Link } from 'react-router-dom'\nimport { ButtonMenu, ButtonMenuItem } from '@pancakeswap-libs/uikit'\nimport useI18n from 'hooks/useI18n'\n\nconst StyledNav = styled.div`\n margin-bottom: 40px;\n`\n\nfunction Nav({ activeIndex = 0 }: { activeIndex?: number }) {\n const TranslateString = useI18n()\n return (\n \n \n \n {TranslateString(1142, 'Swap')}\n \n \n {TranslateString(262, 'Liquidity')}\n \n \n Bridge\n \n \n \n )\n}\n\nexport default Nav\n","import { Interface } from '@ethersproject/abi'\nimport ERC20_ABI from './erc20.json'\nimport ERC20_BYTES32_ABI from './erc20_bytes32.json'\n\nconst ERC20_INTERFACE = new Interface(ERC20_ABI)\n\nexport default ERC20_INTERFACE\nexport { ERC20_ABI, ERC20_BYTES32_ABI }\n","import { ChainId, Token } from '@pancakeswap-libs/sdk'\nimport { Tags, TokenInfo, TokenList } from '@uniswap/token-lists'\nimport { useMemo } from 'react'\nimport { useSelector } from 'react-redux'\nimport { AppState } from '../index'\n\ntype TagDetails = Tags[keyof Tags]\nexport interface TagInfo extends TagDetails {\n id: string\n}\n\n/**\n * Token instances created from token info.\n */\nexport class WrappedTokenInfo extends Token {\n public readonly tokenInfo: TokenInfo\n\n public readonly tags: TagInfo[]\n\n constructor(tokenInfo: TokenInfo, tags: TagInfo[]) {\n super(tokenInfo.chainId, tokenInfo.address, tokenInfo.decimals, tokenInfo.symbol, tokenInfo.name)\n this.tokenInfo = tokenInfo\n this.tags = tags\n }\n\n public get logoURI(): string | undefined {\n return this.tokenInfo.logoURI\n }\n}\n\nexport type TokenAddressMap = Readonly<{ [chainId in ChainId]: Readonly<{ [tokenAddress: string]: WrappedTokenInfo }> }>\n\n/**\n * An empty result, useful as a default.\n */\nconst EMPTY_LIST: TokenAddressMap = {\n [ChainId.MAINNET]: {},\n [ChainId.BSCTESTNET]: {}\n}\n\nconst listCache: WeakMap | null =\n typeof WeakMap !== 'undefined' ? new WeakMap() : null\n\nexport function listToTokenMap(list: TokenList): TokenAddressMap {\n const result = listCache?.get(list)\n if (result) return result\n\n const map = list.tokens.reduce(\n (tokenMap, tokenInfo) => {\n const tags: TagInfo[] =\n tokenInfo.tags\n ?.map(tagId => {\n if (!list.tags?.[tagId]) return undefined\n return { ...list.tags[tagId], id: tagId }\n })\n ?.filter((x): x is TagInfo => Boolean(x)) ?? []\n const token = new WrappedTokenInfo(tokenInfo, tags)\n if (tokenMap[token.chainId][token.address] !== undefined) throw Error('Duplicate tokens.')\n return {\n ...tokenMap,\n [token.chainId]: {\n ...tokenMap[token.chainId],\n [token.address]: token\n }\n }\n },\n { ...EMPTY_LIST }\n )\n listCache?.set(list, map)\n return map\n}\n\nexport function useTokenList(url: string | undefined): TokenAddressMap {\n const lists = useSelector(state => state.lists.byUrl)\n return useMemo(() => {\n if (!url) return EMPTY_LIST\n const current = lists[url]?.current\n if (!current) return EMPTY_LIST\n try {\n return listToTokenMap(current)\n } catch (error) {\n console.error('Could not show token list due to error', error)\n return EMPTY_LIST\n }\n }, [lists, url])\n}\n\nexport function useSelectedListUrl(): string | undefined {\n return useSelector(state => state.lists.selectedListUrl)\n}\n\nexport function useSelectedTokenList(): TokenAddressMap {\n return useTokenList(useSelectedListUrl())\n}\n\nexport function useSelectedListInfo(): { current: TokenList | null; pending: TokenList | null; loading: boolean } {\n const selectedUrl = useSelectedListUrl()\n const listsByUrl = useSelector(state => state.lists.byUrl)\n const list = selectedUrl ? listsByUrl[selectedUrl] : undefined\n return {\n current: list?.current ?? null,\n pending: list?.pendingUpdate ?? null,\n loading: list?.loadingRequestId !== null\n }\n}\n\n// returns all downloaded current lists\nexport function useAllLists(): TokenList[] {\n const lists = useSelector(state => state.lists.byUrl)\n\n return useMemo(\n () =>\n Object.keys(lists)\n .map(url => lists[url].current)\n .filter((l): l is TokenList => Boolean(l)),\n [lists]\n )\n}\n","import { createAction } from '@reduxjs/toolkit'\n\nexport interface Call {\n address: string\n callData: string\n}\n\nconst ADDRESS_REGEX = /^0x[a-fA-F0-9]{40}$/\nconst LOWER_HEX_REGEX = /^0x[a-f0-9]*$/\nexport function toCallKey(call: Call): string {\n if (!ADDRESS_REGEX.test(call.address)) {\n throw new Error(`Invalid address: ${call.address}`)\n }\n if (!LOWER_HEX_REGEX.test(call.callData)) {\n throw new Error(`Invalid hex: ${call.callData}`)\n }\n return `${call.address}-${call.callData}`\n}\n\nexport function parseCallKey(callKey: string): Call {\n const pcs = callKey.split('-')\n if (pcs.length !== 2) {\n throw new Error(`Invalid call key: ${callKey}`)\n }\n return {\n address: pcs[0],\n callData: pcs[1]\n }\n}\n\nexport interface ListenerOptions {\n // how often this data should be fetched, by default 1\n readonly blocksPerFetch?: number\n}\n\nexport const addMulticallListeners = createAction<{ chainId: number; calls: Call[]; options?: ListenerOptions }>(\n 'multicall/addMulticallListeners'\n)\nexport const removeMulticallListeners = createAction<{ chainId: number; calls: Call[]; options?: ListenerOptions }>(\n 'multicall/removeMulticallListeners'\n)\nexport const fetchingMulticallResults = createAction<{ chainId: number; calls: Call[]; fetchingBlockNumber: number }>(\n 'multicall/fetchingMulticallResults'\n)\nexport const errorFetchingMulticallResults = createAction<{\n chainId: number\n calls: Call[]\n fetchingBlockNumber: number\n}>('multicall/errorFetchingMulticallResults')\nexport const updateMulticallResults = createAction<{\n chainId: number\n blockNumber: number\n results: {\n [callKey: string]: string | null\n }\n}>('multicall/updateMulticallResults')\n","import { Interface, FunctionFragment } from '@ethersproject/abi'\nimport { BigNumber } from '@ethersproject/bignumber'\nimport { Contract } from '@ethersproject/contracts'\nimport { useEffect, useMemo } from 'react'\nimport { useDispatch, useSelector } from 'react-redux'\nimport { useActiveWeb3React } from '../../hooks'\nimport { useBlockNumber } from '../application/hooks'\nimport { AppDispatch, AppState } from '../index'\nimport {\n addMulticallListeners,\n Call,\n removeMulticallListeners,\n parseCallKey,\n toCallKey,\n ListenerOptions,\n} from './actions'\n\nexport interface Result extends ReadonlyArray {\n readonly [key: string]: any\n}\n\ntype MethodArg = string | number | BigNumber\ntype MethodArgs = Array\n\ntype OptionalMethodInputs = Array | undefined\n\nfunction isMethodArg(x: unknown): x is MethodArg {\n return ['string', 'number'].indexOf(typeof x) !== -1\n}\n\nfunction isValidMethodArgs(x: unknown): x is MethodArgs | undefined {\n return (\n x === undefined ||\n (Array.isArray(x) && x.every((xi) => isMethodArg(xi) || (Array.isArray(xi) && xi.every(isMethodArg))))\n )\n}\n\ninterface CallResult {\n readonly valid: boolean\n readonly data: string | undefined\n readonly blockNumber: number | undefined\n}\n\nconst INVALID_RESULT: CallResult = { valid: false, blockNumber: undefined, data: undefined }\n\n// use this options object\nexport const NEVER_RELOAD: ListenerOptions = {\n blocksPerFetch: Infinity,\n}\n\n// the lowest level call for subscribing to contract data\nfunction useCallsData(calls: (Call | undefined)[], options?: ListenerOptions): CallResult[] {\n const { chainId } = useActiveWeb3React()\n const callResults = useSelector(\n (state) => state.multicall.callResults\n )\n const dispatch = useDispatch()\n\n const serializedCallKeys: string = useMemo(\n () =>\n JSON.stringify(\n calls\n ?.filter((c): c is Call => Boolean(c))\n ?.map(toCallKey)\n ?.sort() ?? []\n ),\n [calls]\n )\n\n // update listeners when there is an actual change that persists for at least 100ms\n useEffect(() => {\n const callKeys: string[] = JSON.parse(serializedCallKeys)\n if (!chainId || callKeys.length === 0) return undefined\n // eslint-disable-next-line @typescript-eslint/no-shadow\n const calls = callKeys.map((key) => parseCallKey(key))\n dispatch(\n addMulticallListeners({\n chainId,\n calls,\n options,\n })\n )\n\n return () => {\n dispatch(\n removeMulticallListeners({\n chainId,\n calls,\n options,\n })\n )\n }\n }, [chainId, dispatch, options, serializedCallKeys])\n\n return useMemo(\n () =>\n // @ts-ignore\n calls.map((call) => {\n if (!chainId || !call) return INVALID_RESULT\n\n const result = callResults[chainId]?.[toCallKey(call)]\n const data = result?.data && result?.data !== '0x' ? result.data : null\n\n return { valid: true, data, blockNumber: result?.blockNumber }\n }),\n [callResults, calls, chainId]\n )\n}\n\ninterface CallState {\n readonly valid: boolean\n // the result, or undefined if loading or errored/no data\n readonly result: Result | undefined\n // true if the result has never been fetched\n readonly loading: boolean\n // true if the result is not for the latest block\n readonly syncing: boolean\n // true if the call was made and is synced, but the return data is invalid\n readonly error: boolean\n}\n\nconst INVALID_CALL_STATE: CallState = { valid: false, result: undefined, loading: false, syncing: false, error: false }\nconst LOADING_CALL_STATE: CallState = { valid: true, result: undefined, loading: true, syncing: true, error: false }\n\nfunction toCallState(\n callResult: CallResult | undefined,\n contractInterface: Interface | undefined,\n fragment: FunctionFragment | undefined,\n latestBlockNumber: number | undefined\n): CallState {\n if (!callResult) return INVALID_CALL_STATE\n const { valid, data, blockNumber } = callResult\n if (!valid) return INVALID_CALL_STATE\n if (valid && !blockNumber) return LOADING_CALL_STATE\n if (!contractInterface || !fragment || !latestBlockNumber) return LOADING_CALL_STATE\n const success = data && data.length > 2\n const syncing = (blockNumber ?? 0) < latestBlockNumber\n let result: Result | undefined\n if (success && data) {\n try {\n result = contractInterface.decodeFunctionResult(fragment, data)\n } catch (error) {\n console.error('Result data parsing failed', fragment, data)\n return {\n valid: true,\n loading: false,\n error: true,\n syncing,\n result,\n }\n }\n }\n return {\n valid: true,\n loading: false,\n syncing,\n result,\n error: !success,\n }\n}\n\nexport function useSingleContractMultipleData(\n contract: Contract | null | undefined,\n methodName: string,\n callInputs: OptionalMethodInputs[],\n options?: ListenerOptions\n): CallState[] {\n const fragment = useMemo(() => contract?.interface?.getFunction(methodName), [contract, methodName])\n\n const calls = useMemo(\n () =>\n contract && fragment && callInputs && callInputs.length > 0\n ? callInputs.map((inputs) => {\n return {\n address: contract.address,\n callData: contract.interface.encodeFunctionData(fragment, inputs),\n }\n })\n : [],\n [callInputs, contract, fragment]\n )\n\n const results = useCallsData(calls, options)\n\n const latestBlockNumber = useBlockNumber()\n\n return useMemo(() => {\n return results.map((result) => toCallState(result, contract?.interface, fragment, latestBlockNumber))\n }, [fragment, contract, results, latestBlockNumber])\n}\n\nexport function useMultipleContractSingleData(\n addresses: (string | undefined)[],\n contractInterface: Interface,\n methodName: string,\n callInputs?: OptionalMethodInputs,\n options?: ListenerOptions\n): CallState[] {\n const fragment = useMemo(() => contractInterface.getFunction(methodName), [contractInterface, methodName])\n const callData: string | undefined = useMemo(\n () =>\n fragment && isValidMethodArgs(callInputs)\n ? contractInterface.encodeFunctionData(fragment, callInputs)\n : undefined,\n [callInputs, contractInterface, fragment]\n )\n\n const calls = useMemo(\n () =>\n fragment && addresses && addresses.length > 0 && callData\n ? addresses.map((address) => {\n return address && callData\n ? {\n address,\n callData,\n }\n : undefined\n })\n : [],\n [addresses, callData, fragment]\n )\n\n const results = useCallsData(calls, options)\n\n const latestBlockNumber = useBlockNumber()\n\n return useMemo(() => {\n return results.map((result) => toCallState(result, contractInterface, fragment, latestBlockNumber))\n }, [fragment, results, contractInterface, latestBlockNumber])\n}\n\nexport function useSingleCallResult(\n contract: Contract | null | undefined,\n methodName: string,\n inputs?: OptionalMethodInputs,\n options?: ListenerOptions\n): CallState {\n const fragment = useMemo(() => contract?.interface?.getFunction(methodName), [contract, methodName])\n\n const calls = useMemo(() => {\n return contract && fragment && isValidMethodArgs(inputs)\n ? [\n {\n address: contract.address,\n callData: contract.interface.encodeFunctionData(fragment, inputs),\n },\n ]\n : []\n }, [contract, fragment, inputs])\n\n const result = useCallsData(calls, options)[0]\n const latestBlockNumber = useBlockNumber()\n\n return useMemo(() => {\n return toCallState(result, contract?.interface, fragment, latestBlockNumber)\n }, [result, contract, fragment, latestBlockNumber])\n}\n","import { createAction } from '@reduxjs/toolkit'\n\nexport interface SerializedToken {\n chainId: number\n address: string\n decimals: number\n symbol?: string\n name?: string\n}\n\nexport interface SerializedPair {\n token0: SerializedToken\n token1: SerializedToken\n}\n\nexport const updateMatchesDarkMode = createAction<{ matchesDarkMode: boolean }>('user/updateMatchesDarkMode')\nexport const updateUserDarkMode = createAction<{ userDarkMode: boolean }>('user/updateUserDarkMode')\nexport const updateUserExpertMode = createAction<{ userExpertMode: boolean }>('user/updateUserExpertMode')\nexport const updateUserSlippageTolerance = createAction<{ userSlippageTolerance: number }>(\n 'user/updateUserSlippageTolerance'\n)\nexport const updateUserDeadline = createAction<{ userDeadline: number }>('user/updateUserDeadline')\nexport const addSerializedToken = createAction<{ serializedToken: SerializedToken }>('user/addSerializedToken')\nexport const removeSerializedToken = createAction<{ chainId: number; address: string }>('user/removeSerializedToken')\nexport const addSerializedPair = createAction<{ serializedPair: SerializedPair }>('user/addSerializedPair')\nexport const removeSerializedPair = createAction<{ chainId: number; tokenAAddress: string; tokenBAddress: string }>(\n 'user/removeSerializedPair'\n)\nexport const muteAudio = createAction('user/muteAudio')\nexport const unmuteAudio = createAction('user/unmuteAudio')\n","const CACHE_KEY = 'IS_DARK'\n\nexport function getThemeCache(): boolean | null {\n let cache = null\n try {\n const rawCache = localStorage.getItem(CACHE_KEY)\n if (rawCache) {\n cache = JSON.parse(rawCache)\n }\n } catch (error) {\n console.error(error)\n }\n\n return cache\n}\n\nexport function setThemeCache(isDark: boolean) {\n try {\n localStorage.setItem(CACHE_KEY, JSON.stringify(isDark))\n } catch (error) {\n console.error(error)\n }\n}\n","import { ChainId, Pair, Token } from '@pancakeswap-libs/sdk'\nimport flatMap from 'lodash.flatmap'\nimport { useCallback, useMemo } from 'react'\nimport { shallowEqual, useDispatch, useSelector } from 'react-redux'\nimport { BASES_TO_TRACK_LIQUIDITY_FOR, PINNED_PAIRS } from '../../constants'\n\nimport { useActiveWeb3React } from '../../hooks'\n// eslint-disable-next-line import/no-cycle\nimport { useAllTokens } from '../../hooks/Tokens'\nimport { AppDispatch, AppState } from '../index'\nimport {\n addSerializedPair,\n addSerializedToken,\n removeSerializedToken,\n SerializedPair,\n SerializedToken,\n updateUserDarkMode,\n updateUserDeadline,\n updateUserExpertMode,\n updateUserSlippageTolerance,\n muteAudio,\n unmuteAudio,\n} from './actions'\nimport { setThemeCache } from '../../utils/theme'\n\nfunction serializeToken(token: Token): SerializedToken {\n return {\n chainId: token.chainId,\n address: token.address,\n decimals: token.decimals,\n symbol: token.symbol,\n name: token.name,\n }\n}\n\nfunction deserializeToken(serializedToken: SerializedToken): Token {\n return new Token(\n serializedToken.chainId,\n serializedToken.address,\n serializedToken.decimals,\n serializedToken.symbol,\n serializedToken.name\n )\n}\n\nexport function useIsDarkMode(): boolean {\n const { userDarkMode, matchesDarkMode } = useSelector<\n AppState,\n { userDarkMode: boolean | null; matchesDarkMode: boolean }\n >(\n // eslint-disable-next-line @typescript-eslint/no-shadow\n ({ user: { matchesDarkMode, userDarkMode } }) => ({\n userDarkMode,\n matchesDarkMode,\n }),\n shallowEqual\n )\n return userDarkMode === null ? matchesDarkMode : userDarkMode\n}\n\nexport function useDarkModeManager(): [boolean, () => void] {\n const dispatch = useDispatch()\n const { userDarkMode } = useSelector(\n // eslint-disable-next-line @typescript-eslint/no-shadow\n ({ user: { userDarkMode } }) => ({\n userDarkMode,\n }),\n shallowEqual\n )\n const darkMode = useIsDarkMode()\n\n const toggleSetDarkMode = useCallback(() => {\n setThemeCache(!userDarkMode)\n dispatch(updateUserDarkMode({ userDarkMode: !userDarkMode }))\n }, [userDarkMode, dispatch])\n\n return [darkMode, toggleSetDarkMode]\n}\n\nexport function useAudioModeManager(): [boolean, () => void] {\n const dispatch = useDispatch()\n const audioPlay = useSelector((state) => state.user.audioPlay)\n const toggleSetAudioMode = useCallback(() => {\n if (audioPlay) {\n dispatch(muteAudio())\n } else {\n dispatch(unmuteAudio())\n }\n }, [audioPlay, dispatch])\n\n return [audioPlay, toggleSetAudioMode]\n}\n\nexport function useIsExpertMode(): boolean {\n return useSelector((state) => state.user.userExpertMode)\n}\n\nexport function useExpertModeManager(): [boolean, () => void] {\n const dispatch = useDispatch()\n const expertMode = useIsExpertMode()\n\n const toggleSetExpertMode = useCallback(() => {\n dispatch(updateUserExpertMode({ userExpertMode: !expertMode }))\n }, [expertMode, dispatch])\n\n return [expertMode, toggleSetExpertMode]\n}\n\nexport function useUserSlippageTolerance(): [number, (slippage: number) => void] {\n const dispatch = useDispatch()\n const userSlippageTolerance = useSelector((state) => {\n return state.user.userSlippageTolerance\n })\n\n const setUserSlippageTolerance = useCallback(\n (slippageTolerance: number) => {\n dispatch(updateUserSlippageTolerance({ userSlippageTolerance: slippageTolerance }))\n },\n [dispatch]\n )\n\n return [userSlippageTolerance, setUserSlippageTolerance]\n}\n\nexport function useUserDeadline(): [number, (slippage: number) => void] {\n const dispatch = useDispatch()\n const userDeadline = useSelector((state) => {\n return state.user.userDeadline\n })\n\n const setUserDeadline = useCallback(\n (deadline: number) => {\n dispatch(updateUserDeadline({ userDeadline: deadline }))\n },\n [dispatch]\n )\n\n return [userDeadline, setUserDeadline]\n}\n\nexport function useAddUserToken(): (token: Token) => void {\n const dispatch = useDispatch()\n return useCallback(\n (token: Token) => {\n dispatch(addSerializedToken({ serializedToken: serializeToken(token) }))\n },\n [dispatch]\n )\n}\n\nexport function useRemoveUserAddedToken(): (chainId: number, address: string) => void {\n const dispatch = useDispatch()\n return useCallback(\n (chainId: number, address: string) => {\n dispatch(removeSerializedToken({ chainId, address }))\n },\n [dispatch]\n )\n}\n\nexport function useUserAddedTokens(): Token[] {\n const { chainId } = useActiveWeb3React()\n const serializedTokensMap = useSelector(({ user: { tokens } }) => tokens)\n\n return useMemo(() => {\n if (!chainId) return []\n return Object.values(serializedTokensMap[chainId as ChainId] ?? {}).map(deserializeToken)\n }, [serializedTokensMap, chainId])\n}\n\nfunction serializePair(pair: Pair): SerializedPair {\n return {\n token0: serializeToken(pair.token0),\n token1: serializeToken(pair.token1),\n }\n}\n\nexport function usePairAdder(): (pair: Pair) => void {\n const dispatch = useDispatch()\n\n return useCallback(\n (pair: Pair) => {\n dispatch(addSerializedPair({ serializedPair: serializePair(pair) }))\n },\n [dispatch]\n )\n}\n\n/**\n * Given two tokens return the liquidity token that represents its liquidity shares\n * @param tokenA one of the two tokens\n * @param tokenB the other token\n */\nexport function toV2LiquidityToken([tokenA, tokenB]: [Token, Token]): Token {\n return new Token(tokenA.chainId, Pair.getAddress(tokenA, tokenB), 18, 'Cake-LP', 'Pancake LPs')\n}\n\n/**\n * Returns all the pairs of tokens that are tracked by the user for the current chain ID.\n */\nexport function useTrackedTokenPairs(): [Token, Token][] {\n const { chainId } = useActiveWeb3React()\n const tokens = useAllTokens()\n\n // pinned pairs\n const pinnedPairs = useMemo(() => (chainId ? PINNED_PAIRS[chainId] ?? [] : []), [chainId])\n\n // pairs for every token against every base\n const generatedPairs: [Token, Token][] = useMemo(\n () =>\n chainId\n ? flatMap(Object.keys(tokens), (tokenAddress) => {\n const token = tokens[tokenAddress]\n // for each token on the current chain,\n return (\n // loop though all bases on the current chain\n (BASES_TO_TRACK_LIQUIDITY_FOR[chainId] ?? [])\n // to construct pairs of the given token with each base\n .map((base) => {\n if (base.address === token.address) {\n return null\n }\n return [base, token]\n })\n .filter((p): p is [Token, Token] => p !== null)\n )\n })\n : [],\n [tokens, chainId]\n )\n\n // pairs saved by users\n const savedSerializedPairs = useSelector(({ user: { pairs } }) => pairs)\n\n const userPairs: [Token, Token][] = useMemo(() => {\n if (!chainId || !savedSerializedPairs) return []\n const forChain = savedSerializedPairs[chainId]\n if (!forChain) return []\n\n return Object.keys(forChain).map((pairId) => {\n return [deserializeToken(forChain[pairId].token0), deserializeToken(forChain[pairId].token1)]\n })\n }, [savedSerializedPairs, chainId])\n\n const combinedList = useMemo(() => userPairs.concat(generatedPairs).concat(pinnedPairs), [\n generatedPairs,\n pinnedPairs,\n userPairs,\n ])\n\n return useMemo(() => {\n // dedupes pairs of tokens in the combined list\n const keyed = combinedList.reduce<{ [key: string]: [Token, Token] }>((memo, [tokenA, tokenB]) => {\n const sorted = tokenA.sortsBefore(tokenB)\n const key = sorted ? `${tokenA.address}:${tokenB.address}` : `${tokenB.address}:${tokenA.address}`\n if (memo[key]) return memo\n memo[key] = sorted ? [tokenA, tokenB] : [tokenB, tokenA]\n return memo\n }, {})\n\n return Object.keys(keyed).map((key) => keyed[key])\n }, [combinedList])\n}\n","import { ChainId } from '@pancakeswap-libs/sdk'\nimport MULTICALL_ABI from './abi.json'\n\nconst MULTICALL_NETWORKS: { [chainId in ChainId]: string } = {\n [ChainId.MAINNET]: '0x1Ee38d535d541c55C9dae27B12edf090C608E6Fb', // TODO\n [ChainId.BSCTESTNET]: '0x301907b5835a2d723Fe3e9E8C5Bc5375d5c1236A'\n}\n\nexport { MULTICALL_ABI, MULTICALL_NETWORKS }\n","import { Contract } from '@ethersproject/contracts'\nimport { ChainId, WETH } from '@pancakeswap-libs/sdk'\nimport { abi as IUniswapV2PairABI } from '@uniswap/v2-core/build/IUniswapV2Pair.json'\nimport { useMemo } from 'react'\nimport ENS_ABI from '../constants/abis/ens-registrar.json'\nimport ENS_PUBLIC_RESOLVER_ABI from '../constants/abis/ens-public-resolver.json'\nimport { ERC20_BYTES32_ABI } from '../constants/abis/erc20'\nimport ERC20_ABI from '../constants/abis/erc20.json'\nimport WETH_ABI from '../constants/abis/weth.json'\nimport { MULTICALL_ABI, MULTICALL_NETWORKS } from '../constants/multicall'\nimport { getContract } from '../utils'\nimport { useActiveWeb3React } from './index'\n\n// returns null on errors\nfunction useContract(address: string | undefined, ABI: any, withSignerIfPossible = true): Contract | null {\n const { library, account } = useActiveWeb3React()\n\n return useMemo(() => {\n if (!address || !ABI || !library) return null\n try {\n return getContract(address, ABI, library, withSignerIfPossible && account ? account : undefined)\n } catch (error) {\n console.error('Failed to get contract', error)\n return null\n }\n }, [address, ABI, library, withSignerIfPossible, account])\n}\n\nexport function useTokenContract(tokenAddress?: string, withSignerIfPossible?: boolean): Contract | null {\n return useContract(tokenAddress, ERC20_ABI, withSignerIfPossible)\n}\n\nexport function useWETHContract(withSignerIfPossible?: boolean): Contract | null {\n const { chainId } = useActiveWeb3React()\n return useContract(chainId ? WETH[chainId].address : undefined, WETH_ABI, withSignerIfPossible)\n}\n\nexport function useENSRegistrarContract(withSignerIfPossible?: boolean): Contract | null {\n const { chainId } = useActiveWeb3React()\n let address: string | undefined\n if (chainId) {\n switch (chainId) {\n case ChainId.MAINNET:\n case ChainId.BSCTESTNET:\n }\n }\n return useContract(address, ENS_ABI, withSignerIfPossible)\n}\n\nexport function useENSResolverContract(address: string | undefined, withSignerIfPossible?: boolean): Contract | null {\n return useContract(address, ENS_PUBLIC_RESOLVER_ABI, withSignerIfPossible)\n}\n\nexport function useBytes32TokenContract(tokenAddress?: string, withSignerIfPossible?: boolean): Contract | null {\n return useContract(tokenAddress, ERC20_BYTES32_ABI, withSignerIfPossible)\n}\n\nexport function usePairContract(pairAddress?: string, withSignerIfPossible?: boolean): Contract | null {\n return useContract(pairAddress, IUniswapV2PairABI, withSignerIfPossible)\n}\n\nexport function useMulticallContract(): Contract | null {\n const { chainId } = useActiveWeb3React()\n return useContract(chainId && MULTICALL_NETWORKS[chainId], MULTICALL_ABI, false)\n}\n","import { parseBytes32String } from '@ethersproject/strings'\nimport { Currency, ETHER, Token, currencyEquals } from '@pancakeswap-libs/sdk'\nimport { useMemo } from 'react'\nimport { useSelectedTokenList } from '../state/lists/hooks'\nimport { NEVER_RELOAD, useSingleCallResult } from '../state/multicall/hooks'\n// eslint-disable-next-line import/no-cycle\nimport { useUserAddedTokens } from '../state/user/hooks'\nimport { isAddress } from '../utils'\n\nimport { useActiveWeb3React } from './index'\nimport { useBytes32TokenContract, useTokenContract } from './useContract'\n\nexport function useAllTokens(): { [address: string]: Token } {\n const { chainId } = useActiveWeb3React()\n const userAddedTokens = useUserAddedTokens()\n const allTokens = useSelectedTokenList()\n\n return useMemo(() => {\n if (!chainId) return {}\n return (\n userAddedTokens\n // reduce into all ALL_TOKENS filtered by the current chain\n .reduce<{ [address: string]: Token }>(\n (tokenMap, token) => {\n tokenMap[token.address] = token\n return tokenMap\n },\n // must make a copy because reduce modifies the map, and we do not\n // want to make a copy in every iteration\n { ...allTokens[chainId] }\n )\n )\n }, [chainId, userAddedTokens, allTokens])\n}\n\n// Check if currency is included in custom list from user storage\nexport function useIsUserAddedToken(currency: Currency): boolean {\n const userAddedTokens = useUserAddedTokens()\n return !!userAddedTokens.find((token) => currencyEquals(currency, token))\n}\n\n// parse a name or symbol from a token response\nconst BYTES32_REGEX = /^0x[a-fA-F0-9]{64}$/\nfunction parseStringOrBytes32(str: string | undefined, bytes32: string | undefined, defaultValue: string): string {\n return str && str.length > 0\n ? str\n : bytes32 && BYTES32_REGEX.test(bytes32)\n ? parseBytes32String(bytes32)\n : defaultValue\n}\n\n// undefined if invalid or does not exist\n// null if loading\n// otherwise returns the token\nexport function useToken(tokenAddress?: string): Token | undefined | null {\n const { chainId } = useActiveWeb3React()\n const tokens = useAllTokens()\n\n const address = isAddress(tokenAddress)\n\n const tokenContract = useTokenContract(address || undefined, false)\n const tokenContractBytes32 = useBytes32TokenContract(address || undefined, false)\n const token: Token | undefined = address ? tokens[address] : undefined\n\n const tokenName = useSingleCallResult(token ? undefined : tokenContract, 'name', undefined, NEVER_RELOAD)\n const tokenNameBytes32 = useSingleCallResult(\n token ? undefined : tokenContractBytes32,\n 'name',\n undefined,\n NEVER_RELOAD\n )\n const symbol = useSingleCallResult(token ? undefined : tokenContract, 'symbol', undefined, NEVER_RELOAD)\n const symbolBytes32 = useSingleCallResult(token ? undefined : tokenContractBytes32, 'symbol', undefined, NEVER_RELOAD)\n const decimals = useSingleCallResult(token ? undefined : tokenContract, 'decimals', undefined, NEVER_RELOAD)\n\n return useMemo(() => {\n if (token) return token\n if (!chainId || !address) return undefined\n if (decimals.loading || symbol.loading || tokenName.loading) return null\n if (decimals.result) {\n return new Token(\n chainId,\n address,\n decimals.result[0],\n parseStringOrBytes32(symbol.result?.[0], symbolBytes32.result?.[0], 'UNKNOWN'),\n parseStringOrBytes32(tokenName.result?.[0], tokenNameBytes32.result?.[0], 'Unknown Token')\n )\n }\n return undefined\n }, [\n address,\n chainId,\n decimals.loading,\n decimals.result,\n symbol.loading,\n symbol.result,\n symbolBytes32.result,\n token,\n tokenName.loading,\n tokenName.result,\n tokenNameBytes32.result,\n ])\n}\n\nexport function useCurrency(currencyId: string | undefined): Currency | null | undefined {\n const isBNB = currencyId?.toUpperCase() === 'BNB'\n const token = useToken(isBNB ? undefined : currencyId)\n return isBNB ? ETHER : token\n}\n","import { Currency, CurrencyAmount, ETHER, JSBI, Token, TokenAmount } from '@pancakeswap-libs/sdk'\nimport { useMemo } from 'react'\nimport ERC20_INTERFACE from '../../constants/abis/erc20'\nimport { useAllTokens } from '../../hooks/Tokens'\nimport { useActiveWeb3React } from '../../hooks'\nimport { useMulticallContract } from '../../hooks/useContract'\nimport { isAddress } from '../../utils'\nimport { useSingleContractMultipleData, useMultipleContractSingleData } from '../multicall/hooks'\n\n/**\n * Returns a map of the given addresses to their eventually consistent ETH balances.\n */\nexport function useETHBalances(\n uncheckedAddresses?: (string | undefined)[]\n): { [address: string]: CurrencyAmount | undefined } {\n const multicallContract = useMulticallContract()\n\n const addresses: string[] = useMemo(\n () =>\n uncheckedAddresses\n ? uncheckedAddresses\n .map(isAddress)\n .filter((a): a is string => a !== false)\n .sort()\n : [],\n [uncheckedAddresses]\n )\n\n const results = useSingleContractMultipleData(\n multicallContract,\n 'getEthBalance',\n addresses.map(address => [address])\n )\n\n return useMemo(\n () =>\n addresses.reduce<{ [address: string]: CurrencyAmount }>((memo, address, i) => {\n const value = results?.[i]?.result?.[0]\n if (value) memo[address] = CurrencyAmount.ether(JSBI.BigInt(value.toString()))\n return memo\n }, {}),\n [addresses, results]\n )\n}\n\n/**\n * Returns a map of token addresses to their eventually consistent token balances for a single account.\n */\nexport function useTokenBalancesWithLoadingIndicator(\n address?: string,\n tokens?: (Token | undefined)[]\n): [{ [tokenAddress: string]: TokenAmount | undefined }, boolean] {\n const validatedTokens: Token[] = useMemo(\n () => tokens?.filter((t?: Token): t is Token => isAddress(t?.address) !== false) ?? [],\n [tokens]\n )\n\n const validatedTokenAddresses = useMemo(() => validatedTokens.map(vt => vt.address), [validatedTokens])\n\n const balances = useMultipleContractSingleData(validatedTokenAddresses, ERC20_INTERFACE, 'balanceOf', [address])\n\n const anyLoading: boolean = useMemo(() => balances.some(callState => callState.loading), [balances])\n\n return [\n useMemo(\n () =>\n address && validatedTokens.length > 0\n ? validatedTokens.reduce<{ [tokenAddress: string]: TokenAmount | undefined }>((memo, token, i) => {\n const value = balances?.[i]?.result?.[0]\n const amount = value ? JSBI.BigInt(value.toString()) : undefined\n if (amount) {\n memo[token.address] = new TokenAmount(token, amount)\n }\n return memo\n }, {})\n : {},\n [address, validatedTokens, balances]\n ),\n anyLoading\n ]\n}\n\nexport function useTokenBalances(\n address?: string,\n tokens?: (Token | undefined)[]\n): { [tokenAddress: string]: TokenAmount | undefined } {\n return useTokenBalancesWithLoadingIndicator(address, tokens)[0]\n}\n\n// get the balance for a single token/account combo\nexport function useTokenBalance(account?: string, token?: Token): TokenAmount | undefined {\n const tokenBalances = useTokenBalances(account, [token])\n if (!token) return undefined\n return tokenBalances[token.address]\n}\n\nexport function useCurrencyBalances(\n account?: string,\n currencies?: (Currency | undefined)[]\n): (CurrencyAmount | undefined)[] {\n const tokens = useMemo(() => currencies?.filter((currency): currency is Token => currency instanceof Token) ?? [], [\n currencies\n ])\n\n const tokenBalances = useTokenBalances(account, tokens)\n const containsETH: boolean = useMemo(() => currencies?.some(currency => currency === ETHER) ?? false, [currencies])\n const ethBalance = useETHBalances(containsETH ? [account] : [])\n\n return useMemo(\n () =>\n currencies?.map(currency => {\n if (!account || !currency) return undefined\n if (currency instanceof Token) return tokenBalances[currency.address]\n if (currency === ETHER) return ethBalance[account]\n return undefined\n }) ?? [],\n [account, currencies, ethBalance, tokenBalances]\n )\n}\n\nexport function useCurrencyBalance(account?: string, currency?: Currency): CurrencyAmount | undefined {\n return useCurrencyBalances(account, [currency])[0]\n}\n\n// mimics useAllBalances\nexport function useAllTokenBalances(): { [tokenAddress: string]: TokenAmount | undefined } {\n const { account } = useActiveWeb3React()\n const allTokens = useAllTokens()\n const allTokensArray = useMemo(() => Object.values(allTokens ?? {}), [allTokens])\n const balances = useTokenBalances(account ?? undefined, allTokensArray)\n return balances ?? {}\n}\n","import { useEffect, useState } from 'react'\n\n/**\n * Returns the last value of type T that passes a filter function\n * @param value changing value\n * @param filterFn function that determines whether a given value should be considered for the last value\n */\nexport default function useLast(\n value: T | undefined | null,\n filterFn?: (value: T | null | undefined) => boolean\n): T | null | undefined {\n const [last, setLast] = useState(filterFn && filterFn(value) ? value : undefined)\n useEffect(() => {\n setLast((prev) => {\n const shouldUse: boolean = filterFn ? filterFn(value) : true\n if (shouldUse) return value\n return prev\n })\n }, [filterFn, value])\n return last\n}\n\nfunction isDefined(x: T | null | undefined): x is T {\n return x !== null && x !== undefined\n}\n\n/**\n * Returns the last truthy value of type T\n * @param value changing value\n */\nexport function useLastTruthy(value: T | undefined | null): T | null | undefined {\n return useLast(value, isDefined)\n}\n","import CID from 'cids'\nimport { getCodec, rmPrefix } from 'multicodec'\nimport { decode, toB58String } from 'multihashes'\n\nexport function hexToUint8Array(hex: string): Uint8Array {\n hex = hex.startsWith('0x') ? hex.substr(2) : hex\n if (hex.length % 2 !== 0) throw new Error('hex must have length that is multiple of 2')\n const arr = new Uint8Array(hex.length / 2)\n for (let i = 0; i < arr.length; i++) {\n arr[i] = parseInt(hex.substr(i * 2, 2), 16)\n }\n return arr\n}\n\nconst UTF_8_DECODER = new TextDecoder()\n\n/**\n * Returns the URI representation of the content hash for supported codecs\n * @param contenthash to decode\n */\nexport default function contenthashToUri(contenthash: string): string {\n const buff = hexToUint8Array(contenthash)\n const codec = getCodec(buff as Buffer) // the typing is wrong for @types/multicodec\n switch (codec) {\n case 'ipfs-ns': {\n const data = rmPrefix(buff as Buffer)\n const cid = new CID(data)\n return `ipfs://${toB58String(cid.multihash)}`\n }\n case 'ipns-ns': {\n const data = rmPrefix(buff as Buffer)\n const cid = new CID(data)\n const multihash = decode(cid.multihash)\n if (multihash.name === 'identity') {\n return `ipns://${UTF_8_DECODER.decode(multihash.digest).trim()}`\n } \n return `ipns://${toB58String(cid.multihash)}`\n \n }\n default:\n throw new Error(`Unrecognized codec: ${codec}`)\n }\n}\n","const ENS_NAME_REGEX = /^(([a-zA-Z0-9]+\\.)+)eth(\\/.*)?$/\n\nexport function parseENSAddress(ensAddress: string): { ensName: string; ensPath: string | undefined } | undefined {\n const match = ensAddress.match(ENS_NAME_REGEX)\n if (!match) return undefined\n return { ensName: `${match[1].toLowerCase()}eth`, ensPath: match[3] }\n}\n\nexport default parseENSAddress\n","/**\n * Given a URI that may be ipfs, ipns, http, or https protocol, return the fetch-able http(s) URLs for the same content\n * @param uri to convert to fetch-able http url\n */\nexport default function uriToHttp(uri: string): string[] {\n const protocol = uri.split(':')[0].toLowerCase()\n switch (protocol) {\n case 'https':\n return [uri]\n case 'http':\n return [`https${ uri.substr(4)}`, uri]\n case 'ipfs':\n const hash = uri.match(/^ipfs:(\\/\\/)?(.*)$/i)?.[2]\n return [`https://cloudflare-ipfs.com/ipfs/${hash}/`, `https://ipfs.io/ipfs/${hash}/`]\n case 'ipns':\n const name = uri.match(/^ipns:(\\/\\/)?(.*)$/i)?.[2]\n return [`https://cloudflare-ipfs.com/ipns/${name}/`, `https://ipfs.io/ipns/${name}/`]\n default:\n return []\n }\n}\n","/**\n * Returns true if the string value is zero in hex\n * @param hexNumberString\n */\nexport default function isZero(hexNumberString: string) {\n return /^0x0*$/.test(hexNumberString)\n}\n","import { useMemo } from 'react'\nimport contenthashToUri from '../utils/contenthashToUri'\nimport { parseENSAddress } from '../utils/parseENSAddress'\nimport uriToHttp from '../utils/uriToHttp'\nimport useENSContentHash from './useENSContentHash'\n\nexport default function useHttpLocations(uri: string | undefined): string[] {\n const ens = useMemo(() => (uri ? parseENSAddress(uri) : undefined), [uri])\n const resolvedContentHash = useENSContentHash(ens?.ensName)\n return useMemo(() => {\n if (ens) {\n return resolvedContentHash.contenthash ? uriToHttp(contenthashToUri(resolvedContentHash.contenthash)) : []\n } \n return uri ? uriToHttp(uri) : []\n \n }, [ens, resolvedContentHash.contenthash, uri])\n}\n","import { namehash } from 'ethers/lib/utils'\nimport { useMemo } from 'react'\nimport { useSingleCallResult } from '../state/multicall/hooks'\nimport isZero from '../utils/isZero'\nimport { useENSRegistrarContract, useENSResolverContract } from './useContract'\n\n/**\n * Does a lookup for an ENS name to find its contenthash.\n */\nexport default function useENSContentHash(ensName?: string | null): { loading: boolean; contenthash: string | null } {\n const ensNodeArgument = useMemo(() => {\n if (!ensName) return [undefined]\n try {\n return ensName ? [namehash(ensName)] : [undefined]\n } catch (error) {\n return [undefined]\n }\n }, [ensName])\n const registrarContract = useENSRegistrarContract(false)\n const resolverAddressResult = useSingleCallResult(registrarContract, 'resolver', ensNodeArgument)\n const resolverAddress = resolverAddressResult.result?.[0]\n const resolverContract = useENSResolverContract(\n resolverAddress && isZero(resolverAddress) ? undefined : resolverAddress,\n false\n )\n const contenthash = useSingleCallResult(resolverContract, 'contenthash', ensNodeArgument)\n\n return {\n contenthash: contenthash.result?.[0] ?? null,\n loading: resolverAddressResult.loading || contenthash.loading\n }\n}\n","import React, { useState } from 'react'\nimport { HelpCircle } from 'react-feather'\n\nconst BAD_SRCS: { [tokenAddress: string]: true } = {}\n\nexport interface LogoProps {\n alt?: string\n style?: any\n className?: string\n srcs: string[]\n}\n\n/**\n * Renders an image by sequentially trying a list of URIs, and then eventually a fallback triangle alert\n */\nexport default function Logo({ srcs, alt, ...rest }: LogoProps) {\n const [, refresh] = useState(0)\n\n const src: string | undefined = srcs.find((s) => !BAD_SRCS[s])\n\n if (src) {\n return (\n {\n if (src) BAD_SRCS[src] = true\n refresh((i) => i + 1)\n }}\n />\n )\n }\n\n return \n}\n","import React from 'react'\nimport styled from 'styled-components'\nimport useHttpLocations from '../../hooks/useHttpLocations'\n\nimport Logo from '../Logo'\n\nconst StyledListLogo = styled(Logo)<{ size: string }>`\n width: ${({ size }) => size};\n height: ${({ size }) => size};\n`\n\nexport default function ListLogo({\n logoURI,\n style,\n size = '24px',\n alt\n}: {\n logoURI: string\n size?: string\n style?: React.CSSProperties\n alt?: string\n}) {\n const srcs: string[] = useHttpLocations(logoURI)\n\n return \n}\n","import { useEffect, useRef } from 'react'\n\nexport default function useInterval(callback: () => void, delay: null | number, leading = true) {\n const savedCallback = useRef<() => void>()\n\n // Remember the latest callback.\n useEffect(() => {\n savedCallback.current = callback\n }, [callback])\n\n // Set up the interval.\n useEffect(() => {\n function tick() {\n const { current } = savedCallback\n if (current) {\n current()\n }\n }\n\n if (delay !== null) {\n if (leading) tick()\n const id = setInterval(tick, delay)\n return () => clearInterval(id)\n }\n return undefined\n }, [delay, leading])\n}\n","import { Placement } from '@popperjs/core'\nimport { transparentize } from 'polished'\nimport React, { useCallback, useState } from 'react'\nimport { usePopper } from 'react-popper'\nimport styled from 'styled-components'\nimport Portal from '@reach/portal'\nimport useInterval from '../../hooks/useInterval'\n\nconst PopoverContainer = styled.div<{ show: boolean }>`\n z-index: 9999;\n\n visibility: ${(props) => (props.show ? 'visible' : 'hidden')};\n opacity: ${(props) => (props.show ? 1 : 0)};\n transition: visibility 150ms linear, opacity 150ms linear;\n\n background: ${({ theme }) => theme.colors.invertedContrast};\n border: 1px solid ${({ theme }) => theme.colors.tertiary};\n box-shadow: 0 4px 8px 0 ${transparentize(0.9, '#2F80ED')};\n color: ${({ theme }) => theme.colors.textSubtle};\n border-radius: 8px;\n`\n\nconst ReferenceElement = styled.div`\n display: inline-block;\n`\n\nconst Arrow = styled.div`\n width: 8px;\n height: 8px;\n z-index: 9998;\n\n ::before {\n position: absolute;\n width: 8px;\n height: 8px;\n z-index: 9998;\n\n content: '';\n border: 1px solid ${({ theme }) => theme.colors.tertiary};\n transform: rotate(45deg);\n background: ${({ theme }) => theme.colors.invertedContrast};\n }\n\n &.arrow-top {\n bottom: -5px;\n ::before {\n border-top: none;\n border-left: none;\n }\n }\n\n &.arrow-bottom {\n top: -5px;\n ::before {\n border-bottom: none;\n border-right: none;\n }\n }\n\n &.arrow-left {\n right: -5px;\n\n ::before {\n border-bottom: none;\n border-left: none;\n }\n }\n\n &.arrow-right {\n left: -5px;\n ::before {\n border-right: none;\n border-top: none;\n }\n }\n`\n\nexport interface PopoverProps {\n content: React.ReactNode\n show: boolean\n children: React.ReactNode\n placement?: Placement\n}\n\nexport default function Popover({ content, show, children, placement = 'auto' }: PopoverProps) {\n const [referenceElement, setReferenceElement] = useState(null)\n const [popperElement, setPopperElement] = useState(null)\n const [arrowElement, setArrowElement] = useState(null)\n const { styles, update, attributes } = usePopper(referenceElement, popperElement, {\n placement,\n strategy: 'fixed',\n modifiers: [\n { name: 'offset', options: { offset: [8, 8] } },\n { name: 'arrow', options: { element: arrowElement } },\n ],\n })\n const updateCallback = useCallback(() => {\n if (update) {\n update()\n }\n }, [update])\n useInterval(updateCallback, show ? 100 : null)\n\n return (\n <>\n {children}\n \n \n {content}\n \n \n \n \n )\n}\n","import React, { useCallback, useState } from 'react'\nimport styled from 'styled-components'\nimport Popover, { PopoverProps } from '../Popover'\n\nconst TooltipContainer = styled.div`\n width: 228px;\n padding: 0.6rem 1rem;\n line-height: 150%;\n font-weight: 400;\n`\n\ninterface TooltipProps extends Omit {\n text: string\n}\n\nexport default function Tooltip({ text, ...rest }: TooltipProps) {\n return {text}} {...rest} />\n}\n\nexport function MouseoverTooltip({ children, ...rest }: Omit) {\n const [show, setShow] = useState(false)\n const open = useCallback(() => setShow(true), [setShow])\n const close = useCallback(() => setShow(false), [setShow])\n return (\n \n
\n {children}\n
\n
\n )\n}\n","import React, { useCallback, useState } from 'react'\nimport { HelpCircle as Question } from 'react-feather'\nimport styled from 'styled-components'\nimport Tooltip from '../Tooltip'\n\nconst QuestionWrapper = styled.div`\n display: flex;\n align-items: center;\n justify-content: center;\n padding: 0.2rem;\n border: none;\n background: none;\n outline: none;\n cursor: default;\n border-radius: 36px;\n background-color: ${({ theme }) => theme.colors.invertedContrast};\n color: ${({ theme }) => theme.colors.textSubtle};\n\n :hover,\n :focus {\n opacity: 0.7;\n }\n`\n\nexport default function QuestionHelper({ text }: { text: string }) {\n const [show, setShow] = useState(false)\n\n const open = useCallback(() => setShow(true), [setShow])\n const close = useCallback(() => setShow(false), [setShow])\n\n return (\n \n \n \n \n \n \n \n )\n}\n","import styled from 'styled-components'\nimport Logo from '../Logo'\n\nconst CoinLogo = styled(Logo)<{ size: string }>`\n width: ${({ size }) => size};\n height: ${({ size }) => size};\n`\n\nexport default CoinLogo\n","import { Currency, ETHER, Token } from '@pancakeswap-libs/sdk'\nimport React, { useMemo } from 'react'\nimport styled from 'styled-components'\nimport useHttpLocations from '../../hooks/useHttpLocations'\nimport { WrappedTokenInfo } from '../../state/lists/hooks'\nimport Logo from '../Logo'\nimport CoinLogo from '../pancake/CoinLogo'\n\nconst getTokenLogoURL = (address: string) =>\n `https://raw.githubusercontent.com/trustwallet/assets/master/blockchains/smartchain/assets/${address}/logo.png`\n\nconst StyledBnbLogo = styled.img<{ size: string }>`\n width: ${({ size }) => size};\n height: ${({ size }) => size};\n box-shadow: 0px 6px 10px rgba(0, 0, 0, 0.075);\n border-radius: 24px;\n`\n\nconst StyledLogo = styled(Logo)<{ size: string }>`\n width: ${({ size }) => size};\n height: ${({ size }) => size};\n`\n\nexport default function CurrencyLogo({\n currency,\n size = '24px',\n style,\n}: {\n currency?: Currency\n size?: string\n style?: React.CSSProperties\n}) {\n const uriLocations = useHttpLocations(currency instanceof WrappedTokenInfo ? currency.logoURI : undefined)\n\n const srcs: string[] = useMemo(() => {\n if (currency === ETHER) return []\n\n if (currency instanceof Token) {\n if (currency instanceof WrappedTokenInfo) {\n return [...uriLocations, `/images/coins/${currency?.address ?? 'token'}.png`, getTokenLogoURL(currency.address)]\n }\n\n return [`/images/coins/${currency?.address ?? 'token'}.png`, getTokenLogoURL(currency.address)]\n }\n return []\n }, [currency, uriLocations])\n\n if (currency === ETHER) {\n return \n }\n\n return (currency as any)?.symbol ? (\n \n ) : (\n \n )\n}\n","import React from 'react'\nimport { Text } from '@pancakeswap-libs/uikit'\nimport { ChainId, Currency, currencyEquals, ETHER, Token } from '@pancakeswap-libs/sdk'\nimport styled from 'styled-components'\n\nimport useI18n from 'hooks/useI18n'\nimport { SUGGESTED_BASES } from '../../constants'\nimport { AutoColumn } from '../Column'\nimport QuestionHelper from '../QuestionHelper'\nimport { AutoRow } from '../Row'\nimport CurrencyLogo from '../CurrencyLogo'\n\nconst BaseWrapper = styled.div<{ disable?: boolean }>`\n border: 1px solid ${({ theme, disable }) => (disable ? 'transparent' : theme.colors.tertiary)};\n border-radius: 10px;\n display: flex;\n padding: 6px;\n\n align-items: center;\n :hover {\n cursor: ${({ disable }) => !disable && 'pointer'};\n background-color: ${({ theme, disable }) => !disable && theme.colors.invertedContrast};\n }\n\n background-color: ${({ theme, disable }) => disable && theme.colors.tertiary};\n opacity: ${({ disable }) => disable && '0.4'};\n`\n\nexport default function CommonBases({\n chainId,\n onSelect,\n selectedCurrency,\n}: {\n chainId?: ChainId\n selectedCurrency?: Currency | null\n onSelect: (currency: Currency) => void\n}) {\n const TranslateString = useI18n()\n return (\n \n \n Common bases\n \n \n \n {\n if (!selectedCurrency || !currencyEquals(selectedCurrency, ETHER)) {\n onSelect(ETHER)\n }\n }}\n disable={selectedCurrency === ETHER}\n >\n \n BNB\n \n {(chainId ? SUGGESTED_BASES[chainId] : []).map((token: Token) => {\n const selected = selectedCurrency instanceof Token && selectedCurrency.address === token.address\n return (\n !selected && onSelect(token)} disable={selected} key={token.address}>\n \n {token.symbol}\n \n )\n })}\n \n \n )\n}\n","import styled from 'styled-components'\nimport { AutoColumn } from '../Column'\nimport { RowBetween, RowFixed } from '../Row'\n\nexport const FadedSpan = styled(RowFixed)`\n color: ${({ theme }) => theme.colors.primary};\n font-size: 14px;\n`\n\nexport const PaddedColumn = styled(AutoColumn)`\n padding: 20px;\n padding-bottom: 12px;\n`\n\nexport const MenuItem = styled(RowBetween)`\n padding: 4px 20px;\n height: 56px;\n display: grid;\n grid-template-columns: auto minmax(auto, 1fr) auto minmax(0, 72px);\n grid-gap: 16px;\n cursor: ${({ disabled }) => !disabled && 'pointer'};\n pointer-events: ${({ disabled }) => disabled && 'none'};\n :hover {\n background-color: ${({ theme, disabled }) => !disabled && theme.colors.invertedContrast};\n }\n opacity: ${({ disabled, selected }) => (disabled || selected ? 0.5 : 1)};\n`\n\nexport const SearchInput = styled.input`\n position: relative;\n display: flex;\n padding: 16px;\n align-items: center;\n width: 100%;\n white-space: nowrap;\n background: none;\n border: none;\n outline: none;\n border-radius: 20px;\n color: ${({ theme }) => theme.colors.text};\n border-style: solid;\n border: 1px solid ${({ theme }) => theme.colors.tertiary};\n -webkit-appearance: none;\n\n font-size: 18px;\n\n ::placeholder {\n color: ${({ theme }) => theme.colors.textDisabled};\n }\n transition: border 100ms;\n :focus {\n border: 1px solid ${({ theme }) => theme.colors.primary};\n outline: none;\n }\n`\nexport const Separator = styled.div`\n width: 100%;\n height: 1px;\n background-color: ${({ theme }) => theme.colors.invertedContrast};\n`\n\nexport const SeparatorDark = styled.div`\n width: 100%;\n height: 1px;\n background-color: ${({ theme }) => theme.colors.tertiary};\n`\n","import { Currency, CurrencyAmount, currencyEquals, ETHER, Token } from '@pancakeswap-libs/sdk'\nimport React, { CSSProperties, MutableRefObject, useCallback, useMemo } from 'react'\nimport { FixedSizeList } from 'react-window'\nimport styled from 'styled-components'\nimport { Text } from '@pancakeswap-libs/uikit'\nimport { useActiveWeb3React } from '../../hooks'\nimport { useSelectedTokenList, WrappedTokenInfo } from '../../state/lists/hooks'\nimport { useAddUserToken, useRemoveUserAddedToken } from '../../state/user/hooks'\nimport { useCurrencyBalance } from '../../state/wallet/hooks'\nimport { LinkStyledButton } from '../Shared'\nimport { useIsUserAddedToken } from '../../hooks/Tokens'\nimport Column from '../Column'\nimport { RowFixed } from '../Row'\nimport CurrencyLogo from '../CurrencyLogo'\nimport { MouseoverTooltip } from '../Tooltip'\nimport { FadedSpan, MenuItem } from './styleds'\nimport Loader from '../Loader'\nimport { isTokenOnList } from '../../utils'\n\nfunction currencyKey(currency: Currency): string {\n return currency instanceof Token ? currency.address : currency === ETHER ? 'ETHER' : ''\n}\n\nconst StyledBalanceText = styled(Text)`\n white-space: nowrap;\n overflow: hidden;\n max-width: 5rem;\n text-overflow: ellipsis;\n`\n\nconst Tag = styled.div`\n background-color: ${({ theme }) => theme.colors.tertiary};\n color: ${({ theme }) => theme.colors.textSubtle};\n font-size: 14px;\n border-radius: 4px;\n padding: 0.25rem 0.3rem 0.25rem 0.3rem;\n max-width: 6rem;\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n justify-self: flex-end;\n margin-right: 4px;\n`\n\nfunction Balance({ balance }: { balance: CurrencyAmount }) {\n return {balance.toSignificant(4)}\n}\n\nconst TagContainer = styled.div`\n display: flex;\n justify-content: flex-end;\n`\n\nfunction TokenTags({ currency }: { currency: Currency }) {\n if (!(currency instanceof WrappedTokenInfo)) {\n return \n }\n\n const { tags } = currency\n if (!tags || tags.length === 0) return \n\n const tag = tags[0]\n\n return (\n \n \n {tag.name}\n \n {tags.length > 1 ? (\n `${name}: ${description}`)\n .join('; \\n')}\n >\n ...\n \n ) : null}\n \n )\n}\n\nfunction CurrencyRow({\n currency,\n onSelect,\n isSelected,\n otherSelected,\n style,\n}: {\n currency: Currency\n onSelect: () => void\n isSelected: boolean\n otherSelected: boolean\n style: CSSProperties\n}) {\n const { account, chainId } = useActiveWeb3React()\n const key = currencyKey(currency)\n const selectedTokenList = useSelectedTokenList()\n const isOnSelectedList = isTokenOnList(selectedTokenList, currency)\n const customAdded = useIsUserAddedToken(currency)\n const balance = useCurrencyBalance(account ?? undefined, currency)\n\n const removeToken = useRemoveUserAddedToken()\n const addToken = useAddUserToken()\n\n // only show add or remove buttons if not on selected list\n return (\n (isSelected ? null : onSelect())}\n disabled={isSelected}\n selected={otherSelected}\n >\n \n \n {currency.symbol}\n \n {!isOnSelectedList && customAdded && !(currency instanceof WrappedTokenInfo) ? (\n \n Added by user\n {\n event.stopPropagation()\n if (chainId && currency instanceof Token) removeToken(chainId, currency.address)\n }}\n >\n (Remove)\n \n \n ) : null}\n {!isOnSelectedList && !customAdded && !(currency instanceof WrappedTokenInfo) ? (\n \n Found by address\n {\n event.stopPropagation()\n if (currency instanceof Token) addToken(currency)\n }}\n >\n (Add)\n \n \n ) : null}\n \n \n \n \n {balance ? : account ? : null}\n \n \n )\n}\n\nexport default function CurrencyList({\n height,\n currencies,\n selectedCurrency,\n onCurrencySelect,\n otherCurrency,\n fixedListRef,\n showETH,\n}: {\n height: number\n currencies: Currency[]\n selectedCurrency?: Currency | null\n onCurrencySelect: (currency: Currency) => void\n otherCurrency?: Currency | null\n fixedListRef?: MutableRefObject\n showETH: boolean\n}) {\n const itemData = useMemo(() => (showETH ? [Currency.ETHER, ...currencies] : [...currencies]), [currencies, showETH])\n\n const Row = useCallback(\n ({ data, index, style }) => {\n const currency: Currency = data[index]\n const isSelected = Boolean(selectedCurrency && currencyEquals(selectedCurrency, currency))\n const otherSelected = Boolean(otherCurrency && currencyEquals(otherCurrency, currency))\n const handleSelect = () => onCurrencySelect(currency)\n return (\n \n )\n },\n [onCurrencySelect, otherCurrency, selectedCurrency]\n )\n\n const itemKey = useCallback((index: number, data: any) => currencyKey(data[index]), [])\n\n return (\n \n {Row}\n \n )\n}\n","import { Token } from '@pancakeswap-libs/sdk'\nimport { isAddress } from '../../utils'\n\nexport function filterTokens(tokens: Token[], search: string): Token[] {\n if (search.length === 0) return tokens\n\n const searchingAddress = isAddress(search)\n\n if (searchingAddress) {\n return tokens.filter((token) => token.address === searchingAddress)\n }\n\n const lowerSearchParts = search\n .toLowerCase()\n .split(/\\s+/)\n .filter((s) => s.length > 0)\n\n if (lowerSearchParts.length === 0) {\n return tokens\n }\n\n const matchesSearch = (s: string): boolean => {\n const sParts = s\n .toLowerCase()\n .split(/\\s+/)\n .filter((str) => str.length > 0)\n\n return lowerSearchParts.every((p) => p.length === 0 || sParts.some((sp) => sp.startsWith(p) || sp.endsWith(p)))\n }\n\n return tokens.filter((token) => {\n const { symbol, name } = token\n\n return (symbol && matchesSearch(symbol)) || (name && matchesSearch(name))\n })\n}\n\nexport default filterTokens\n","import React from 'react'\nimport { Text } from '@pancakeswap-libs/uikit'\nimport styled from 'styled-components'\nimport { RowFixed } from '../Row'\n\nexport const FilterWrapper = styled(RowFixed)`\n padding: 8px;\n background-color: ${({ theme }) => theme.colors.invertedContrast};\n color: ${({ theme }) => theme.colors.text};\n border-radius: 8px;\n user-select: none;\n & > * {\n user-select: none;\n }\n :hover {\n cursor: pointer;\n }\n`\n\nexport default function SortButton({\n toggleSortOrder,\n ascending\n}: {\n toggleSortOrder: () => void\n ascending: boolean\n}) {\n return (\n \n {ascending ? '↑' : '↓'}\n \n )\n}\n","import { Token, TokenAmount } from '@pancakeswap-libs/sdk'\nimport { useMemo } from 'react'\nimport { useAllTokenBalances } from '../../state/wallet/hooks'\n\n// compare two token amounts with highest one coming first\nfunction balanceComparator(balanceA?: TokenAmount, balanceB?: TokenAmount) {\n if (balanceA && balanceB) {\n return balanceA.greaterThan(balanceB) ? -1 : balanceA.equalTo(balanceB) ? 0 : 1\n }\n if (balanceA && balanceA.greaterThan('0')) {\n return -1\n }\n if (balanceB && balanceB.greaterThan('0')) {\n return 1\n }\n return 0\n}\n\nfunction getTokenComparator(balances: {\n [tokenAddress: string]: TokenAmount | undefined\n}): (tokenA: Token, tokenB: Token) => number {\n return function sortTokens(tokenA: Token, tokenB: Token): number {\n // -1 = a is first\n // 1 = b is first\n\n // sort by balances\n const balanceA = balances[tokenA.address]\n const balanceB = balances[tokenB.address]\n\n const balanceComp = balanceComparator(balanceA, balanceB)\n if (balanceComp !== 0) return balanceComp\n\n if (tokenA.symbol && tokenB.symbol) {\n // sort by symbol\n return tokenA.symbol.toLowerCase() < tokenB.symbol.toLowerCase() ? -1 : 1\n }\n return tokenA.symbol ? -1 : tokenB.symbol ? -1 : 0\n }\n}\n\nexport function useTokenComparator(inverted: boolean): (tokenA: Token, tokenB: Token) => number {\n const balances = useAllTokenBalances()\n const comparator = useMemo(() => getTokenComparator(balances ?? {}), [balances])\n return useMemo(() => {\n if (inverted) {\n return (tokenA: Token, tokenB: Token) => comparator(tokenA, tokenB) * -1\n }\n return comparator\n }, [inverted, comparator])\n}\n\nexport default useTokenComparator\n","import { Currency, ETHER, Token } from '@pancakeswap-libs/sdk'\nimport React, { KeyboardEvent, RefObject, useCallback, useContext, useEffect, useMemo, useRef, useState } from 'react'\nimport { Text, CloseIcon } from '@pancakeswap-libs/uikit'\nimport { useSelector } from 'react-redux'\nimport { useTranslation } from 'react-i18next'\nimport { FixedSizeList } from 'react-window'\nimport { ThemeContext } from 'styled-components'\nimport AutoSizer from 'react-virtualized-auto-sizer'\nimport useI18n from 'hooks/useI18n'\nimport { useActiveWeb3React } from '../../hooks'\nimport { AppState } from '../../state'\nimport { useAllTokens, useToken } from '../../hooks/Tokens'\nimport { useSelectedListInfo } from '../../state/lists/hooks'\nimport { LinkStyledButton } from '../Shared'\nimport { isAddress } from '../../utils'\nimport Card from '../Card'\nimport Column from '../Column'\nimport ListLogo from '../ListLogo'\nimport QuestionHelper from '../QuestionHelper'\nimport Row, { RowBetween } from '../Row'\nimport CommonBases from './CommonBases'\nimport CurrencyList from './CurrencyList'\nimport { filterTokens } from './filtering'\nimport SortButton from './SortButton'\nimport { useTokenComparator } from './sorting'\nimport { PaddedColumn, SearchInput, Separator } from './styleds'\n\ninterface CurrencySearchProps {\n isOpen: boolean\n onDismiss: () => void\n selectedCurrency?: Currency | null\n onCurrencySelect: (currency: Currency) => void\n otherSelectedCurrency?: Currency | null\n showCommonBases?: boolean\n onChangeList: () => void\n}\n\nexport function CurrencySearch({\n selectedCurrency,\n onCurrencySelect,\n otherSelectedCurrency,\n showCommonBases,\n onDismiss,\n isOpen,\n onChangeList,\n}: CurrencySearchProps) {\n const { t } = useTranslation()\n const { chainId } = useActiveWeb3React()\n const theme = useContext(ThemeContext)\n\n const fixedList = useRef()\n const [searchQuery, setSearchQuery] = useState('')\n const [invertSearchOrder, setInvertSearchOrder] = useState(false)\n const allTokens = useAllTokens()\n\n // if they input an address, use it\n const isAddressSearch = isAddress(searchQuery)\n const searchToken = useToken(searchQuery)\n\n const showETH: boolean = useMemo(() => {\n const s = searchQuery.toLowerCase().trim()\n return s === '' || s === 'b' || s === 'bn' || s === 'bnb'\n }, [searchQuery])\n\n const tokenComparator = useTokenComparator(invertSearchOrder)\n\n const audioPlay = useSelector((state) => state.user.audioPlay)\n\n const filteredTokens: Token[] = useMemo(() => {\n if (isAddressSearch) return searchToken ? [searchToken] : []\n return filterTokens(Object.values(allTokens), searchQuery)\n }, [isAddressSearch, searchToken, allTokens, searchQuery])\n\n const filteredSortedTokens: Token[] = useMemo(() => {\n if (searchToken) return [searchToken]\n const sorted = filteredTokens.sort(tokenComparator)\n const symbolMatch = searchQuery\n .toLowerCase()\n .split(/\\s+/)\n .filter((s) => s.length > 0)\n if (symbolMatch.length > 1) return sorted\n\n return [\n ...(searchToken ? [searchToken] : []),\n // sort any exact symbol matches first\n ...sorted.filter((token) => token.symbol?.toLowerCase() === symbolMatch[0]),\n ...sorted.filter((token) => token.symbol?.toLowerCase() !== symbolMatch[0]),\n ]\n }, [filteredTokens, searchQuery, searchToken, tokenComparator])\n\n const handleCurrencySelect = useCallback(\n (currency: Currency) => {\n onCurrencySelect(currency)\n onDismiss()\n if (audioPlay) {\n const audio = document.getElementById('bgMusic') as HTMLAudioElement\n if (audio) {\n audio.play()\n }\n }\n },\n [onDismiss, onCurrencySelect, audioPlay]\n )\n\n // clear the input on open\n useEffect(() => {\n if (isOpen) setSearchQuery('')\n }, [isOpen])\n\n // manage focus on modal show\n const inputRef = useRef()\n const handleInput = useCallback((event) => {\n const input = event.target.value\n const checksummedInput = isAddress(input)\n setSearchQuery(checksummedInput || input)\n fixedList.current?.scrollTo(0)\n }, [])\n\n const handleEnter = useCallback(\n (e: KeyboardEvent) => {\n if (e.key === 'Enter') {\n const s = searchQuery.toLowerCase().trim()\n if (s === 'bnb') {\n handleCurrencySelect(ETHER)\n } else if (filteredSortedTokens.length > 0) {\n if (\n filteredSortedTokens[0].symbol?.toLowerCase() === searchQuery.trim().toLowerCase() ||\n filteredSortedTokens.length === 1\n ) {\n handleCurrencySelect(filteredSortedTokens[0])\n }\n }\n }\n },\n [filteredSortedTokens, handleCurrencySelect, searchQuery]\n )\n\n const selectedListInfo = useSelectedListInfo()\n const TranslateString = useI18n()\n return (\n \n \n \n \n {TranslateString(82, 'Select a token')}\n \n \n \n \n }\n onChange={handleInput}\n onKeyDown={handleEnter}\n />\n {showCommonBases && (\n \n )}\n \n {TranslateString(126, 'Token name')}\n setInvertSearchOrder((iso) => !iso)} />\n \n \n\n \n\n
\n \n {({ height }) => (\n \n )}\n \n
\n\n {null && (\n <>\n \n \n \n {selectedListInfo.current ? (\n \n {selectedListInfo.current.logoURI ? (\n \n ) : null}\n {selectedListInfo.current.name}\n \n ) : null}\n \n {selectedListInfo.current ? TranslateString(180, 'Change') : TranslateString(1152, 'Select a list')}\n \n \n \n \n )}\n
\n )\n}\n\nexport default CurrencySearch\n","export const DEFAULT_TOKEN_LIST_URL = 'pancakeswap'\n\nexport const DEFAULT_LIST_OF_LISTS: string[] = [DEFAULT_TOKEN_LIST_URL]\n","import { TokenList } from '@uniswap/token-lists'\nimport schema from '@uniswap/token-lists/src/tokenlist.schema.json'\nimport Ajv from 'ajv'\nimport contenthashToUri from './contenthashToUri'\nimport { parseENSAddress } from './parseENSAddress'\nimport uriToHttp from './uriToHttp'\n\n// bakeryswap defaultTokenJson\nimport { DEFAULT_TOKEN_LIST_URL } from '../constants/lists'\nimport defaultTokenJson from '../constants/token/pancakeswap.json'\n\nconst tokenListValidator = new Ajv({ allErrors: true }).compile(schema)\n\n/**\n * Contains the logic for resolving a list URL to a validated token list\n * @param listUrl list url\n * @param resolveENSContentHash resolves an ens name to a contenthash\n */\nexport default async function getTokenList(\n listUrl: string,\n resolveENSContentHash: (ensName: string) => Promise\n): Promise {\n if (listUrl === DEFAULT_TOKEN_LIST_URL) {\n return defaultTokenJson\n }\n const parsedENS = parseENSAddress(listUrl)\n\n let urls: string[]\n if (parsedENS) {\n let contentHashUri\n try {\n contentHashUri = await resolveENSContentHash(parsedENS.ensName)\n } catch (error) {\n console.error(`Failed to resolve ENS name: ${parsedENS.ensName}`, error)\n throw new Error(`Failed to resolve ENS name: ${parsedENS.ensName}`)\n }\n let translatedUri\n try {\n translatedUri = contenthashToUri(contentHashUri)\n } catch (error) {\n console.error('Failed to translate contenthash to URI', contentHashUri)\n throw new Error(`Failed to translate contenthash to URI: ${contentHashUri}`)\n }\n urls = uriToHttp(`${translatedUri}${parsedENS.ensPath ?? ''}`)\n } else {\n urls = uriToHttp(listUrl)\n }\n for (let i = 0; i < urls.length; i++) {\n const url = urls[i]\n const isLast = i === urls.length - 1\n let response\n try {\n response = await fetch(url)\n } catch (error) {\n console.error('Failed to fetch list', listUrl, error)\n if (isLast) throw new Error(`Failed to download list ${listUrl}`)\n // eslint-disable-next-line no-continue\n continue\n }\n\n if (!response.ok) {\n if (isLast) throw new Error(`Failed to download list ${listUrl}`)\n // eslint-disable-next-line no-continue\n continue\n }\n\n const json = await response.json()\n if (!tokenListValidator(json)) {\n const validationErrors: string =\n tokenListValidator.errors?.reduce((memo, error) => {\n const add = `${error.dataPath} ${error.message ?? ''}`\n return memo.length > 0 ? `${memo}; ${add}` : `${add}`\n }, '') ?? 'unknown error'\n throw new Error(`Token list failed validation: ${validationErrors}`)\n }\n return json\n }\n throw new Error('Unrecognized list URL protocol.')\n}\n","import { Contract } from '@ethersproject/contracts'\nimport { Provider } from '@ethersproject/abstract-provider'\nimport { namehash } from 'ethers/lib/utils'\n\nconst REGISTRAR_ABI = [\n {\n constant: true,\n inputs: [\n {\n name: 'node',\n type: 'bytes32'\n }\n ],\n name: 'resolver',\n outputs: [\n {\n name: 'resolverAddress',\n type: 'address'\n }\n ],\n payable: false,\n stateMutability: 'view',\n type: 'function'\n }\n]\nconst REGISTRAR_ADDRESS = '0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e'\n\nconst RESOLVER_ABI = [\n {\n constant: true,\n inputs: [\n {\n internalType: 'bytes32',\n name: 'node',\n type: 'bytes32'\n }\n ],\n name: 'contenthash',\n outputs: [\n {\n internalType: 'bytes',\n name: '',\n type: 'bytes'\n }\n ],\n payable: false,\n stateMutability: 'view',\n type: 'function'\n }\n]\n\n// cache the resolver contracts since most of them are the public resolver\nfunction resolverContract(resolverAddress: string, provider: Provider): Contract {\n return new Contract(resolverAddress, RESOLVER_ABI, provider)\n}\n\n/**\n * Fetches and decodes the result of an ENS contenthash lookup on mainnet to a URI\n * @param ensName to resolve\n * @param provider provider to use to fetch the data\n */\nexport default async function resolveENSContentHash(ensName: string, provider: Provider): Promise {\n const ensRegistrarContract = new Contract(REGISTRAR_ADDRESS, REGISTRAR_ABI, provider)\n const hash = namehash(ensName)\n const resolverAddress = await ensRegistrarContract.resolver(hash)\n return resolverContract(resolverAddress, provider).contenthash(hash)\n}\n","import { nanoid } from '@reduxjs/toolkit'\nimport { ChainId } from '@pancakeswap-libs/sdk'\nimport { TokenList } from '@uniswap/token-lists'\nimport { useCallback } from 'react'\nimport { useDispatch } from 'react-redux'\nimport { getNetworkLibrary, NETWORK_CHAIN_ID } from '../connectors'\nimport { AppDispatch } from '../state'\nimport { fetchTokenList } from '../state/lists/actions'\nimport getTokenList from '../utils/getTokenList'\nimport resolveENSContentHash from '../utils/resolveENSContentHash'\nimport { useActiveWeb3React } from './index'\n\nexport function useFetchListCallback(): (listUrl: string) => Promise {\n const { chainId, library } = useActiveWeb3React()\n const dispatch = useDispatch()\n\n const ensResolver = useCallback(\n (ensName: string) => {\n if (!library || chainId !== ChainId.MAINNET) {\n if (NETWORK_CHAIN_ID === ChainId.MAINNET) {\n const networkLibrary = getNetworkLibrary()\n if (networkLibrary) {\n return resolveENSContentHash(ensName, networkLibrary)\n }\n }\n throw new Error('Could not construct mainnet ENS resolver')\n }\n return resolveENSContentHash(ensName, library)\n },\n [chainId, library]\n )\n\n return useCallback(\n async (listUrl: string) => {\n const requestId = nanoid()\n dispatch(fetchTokenList.pending({ requestId, url: listUrl }))\n return getTokenList(listUrl, ensResolver)\n .then((tokenList) => {\n dispatch(fetchTokenList.fulfilled({ url: listUrl, tokenList, requestId }))\n return tokenList\n })\n .catch((error) => {\n console.error(`Failed to get list at url ${listUrl}`, error)\n dispatch(fetchTokenList.rejected({ url: listUrl, requestId, errorMessage: error.message }))\n throw error\n })\n },\n [dispatch, ensResolver]\n )\n}\n\nexport default useFetchListCallback\n","import { RefObject, useEffect, useRef } from 'react'\n\nexport function useOnClickOutside(\n node: RefObject,\n handler: undefined | (() => void)\n) {\n const handlerRef = useRef void)>(handler)\n useEffect(() => {\n handlerRef.current = handler\n }, [handler])\n\n useEffect(() => {\n const handleClickOutside = (e: MouseEvent) => {\n if (node.current?.contains(e.target as Node) ?? false) {\n return\n }\n if (handlerRef.current) handlerRef.current()\n }\n\n document.addEventListener('mousedown', handleClickOutside)\n\n return () => {\n document.removeEventListener('mousedown', handleClickOutside)\n }\n }, [node])\n}\n\nexport default useOnClickOutside\n","import React, { memo, useCallback, useMemo, useRef, useState } from 'react'\nimport { ArrowLeft } from 'react-feather'\nimport { usePopper } from 'react-popper'\nimport { useDispatch, useSelector } from 'react-redux'\nimport { Button, Text, ChevronDownIcon, CloseIcon } from '@pancakeswap-libs/uikit'\nimport styled from 'styled-components'\nimport useI18n from 'hooks/useI18n'\nimport { useFetchListCallback } from '../../hooks/useFetchListCallback'\nimport { useOnClickOutside } from '../../hooks/useOnClickOutside'\nimport useToggle from '../../hooks/useToggle'\nimport { AppDispatch, AppState } from '../../state'\nimport { acceptListUpdate, removeList, selectList } from '../../state/lists/actions'\nimport { useSelectedListUrl } from '../../state/lists/hooks'\nimport { ExternalLink, LinkStyledButton } from '../Shared'\nimport listVersionLabel from '../../utils/listVersionLabel'\nimport { parseENSAddress } from '../../utils/parseENSAddress'\nimport uriToHttp from '../../utils/uriToHttp'\nimport Column from '../Column'\nimport ListLogo from '../ListLogo'\nimport QuestionHelper from '../QuestionHelper'\nimport Row, { RowBetween } from '../Row'\nimport { PaddedColumn, SearchInput, Separator, SeparatorDark } from './styleds'\n\nconst UnpaddedLinkStyledButton = styled(LinkStyledButton)`\n padding: 0;\n font-size: 1rem;\n opacity: ${({ disabled }) => (disabled ? '0.4' : '1')};\n`\n\nconst PopoverContainer = styled.div<{ show: boolean }>`\n z-index: 100;\n visibility: ${(props) => (props.show ? 'visible' : 'hidden')};\n opacity: ${(props) => (props.show ? 1 : 0)};\n transition: visibility 150ms linear, opacity 150ms linear;\n background: ${({ theme }) => theme.colors.invertedContrast};\n border: 1px solid ${({ theme }) => theme.colors.tertiary};\n box-shadow: 0px 0px 1px rgba(0, 0, 0, 0.01), 0px 4px 8px rgba(0, 0, 0, 0.04), 0px 16px 24px rgba(0, 0, 0, 0.04),\n 0px 24px 32px rgba(0, 0, 0, 0.01);\n color: ${({ theme }) => theme.colors.textSubtle};\n border-radius: 0.5rem;\n padding: 1rem;\n display: grid;\n grid-template-rows: 1fr;\n grid-gap: 8px;\n font-size: 1rem;\n text-align: left;\n`\n\nconst StyledMenu = styled.div`\n display: flex;\n justify-content: center;\n align-items: center;\n position: relative;\n border: none;\n`\n\nconst StyledListUrlText = styled.div`\n max-width: 160px;\n opacity: 0.6;\n margin-right: 0.5rem;\n font-size: 14px;\n overflow: hidden;\n text-overflow: ellipsis;\n`\n\nfunction ListOrigin({ listUrl }: { listUrl: string }) {\n const ensName = useMemo(() => parseENSAddress(listUrl)?.ensName, [listUrl])\n const host = useMemo(() => {\n if (ensName) return undefined\n const lowerListUrl = listUrl.toLowerCase()\n if (lowerListUrl.startsWith('ipfs://') || lowerListUrl.startsWith('ipns://')) {\n return listUrl\n }\n try {\n const url = new URL(listUrl)\n return url.host\n } catch (error) {\n return undefined\n }\n }, [listUrl, ensName])\n return <>{ensName ?? host}\n}\n\nfunction listUrlRowHTMLId(listUrl: string) {\n return `list-row-${listUrl.replace(/\\./g, '-')}`\n}\n\nconst ListRow = memo(function ListRow({ listUrl, onBack }: { listUrl: string; onBack: () => void }) {\n const listsByUrl = useSelector((state) => state.lists.byUrl)\n const selectedListUrl = useSelectedListUrl()\n const dispatch = useDispatch()\n const { current: list, pendingUpdate: pending } = listsByUrl[listUrl]\n\n const isSelected = listUrl === selectedListUrl\n\n const [open, toggle] = useToggle(false)\n const node = useRef()\n const [referenceElement, setReferenceElement] = useState()\n const [popperElement, setPopperElement] = useState()\n\n const { styles, attributes } = usePopper(referenceElement, popperElement, {\n placement: 'auto',\n strategy: 'fixed',\n modifiers: [{ name: 'offset', options: { offset: [8, 8] } }],\n })\n\n useOnClickOutside(node, open ? toggle : undefined)\n\n const selectThisList = useCallback(() => {\n if (isSelected) return\n\n dispatch(selectList(listUrl))\n onBack()\n }, [dispatch, isSelected, listUrl, onBack])\n\n const handleAcceptListUpdate = useCallback(() => {\n if (!pending) return\n dispatch(acceptListUpdate(listUrl))\n }, [dispatch, listUrl, pending])\n\n const handleRemoveList = useCallback(() => {\n if (window.prompt(`Please confirm you would like to remove this list by typing REMOVE`) === `REMOVE`) {\n dispatch(removeList(listUrl))\n }\n }, [dispatch, listUrl])\n const TranslateString = useI18n()\n if (!list) return null\n\n return (\n \n {list.logoURI ? (\n \n ) : (\n
\n )}\n \n \n \n {list.name}\n \n \n \n \n \n \n \n \n \n
\n \n \n \n
\n\n {open && (\n \n
{list && listVersionLabel(list.version)}
\n \n \n {TranslateString(1206, 'View list')}\n \n \n Remove list\n \n {pending && (\n Update list\n )}\n
\n )}\n
\n {isSelected ? (\n \n ) : (\n <>\n \n Select\n \n \n )}\n \n )\n})\n\nconst ListContainer = styled.div`\n flex: 1;\n overflow: auto;\n`\n\nexport function ListSelect({ onDismiss, onBack }: { onDismiss: () => void; onBack: () => void }) {\n const [listUrlInput, setListUrlInput] = useState('')\n\n const dispatch = useDispatch()\n const lists = useSelector((state) => state.lists.byUrl)\n const adding = Boolean(lists[listUrlInput]?.loadingRequestId)\n const [addError, setAddError] = useState(null)\n\n const handleInput = useCallback((e) => {\n setListUrlInput(e.target.value)\n setAddError(null)\n }, [])\n const fetchList = useFetchListCallback()\n\n const handleAddList = useCallback(() => {\n if (adding) return\n setAddError(null)\n fetchList(listUrlInput)\n .then(() => {\n setListUrlInput('')\n })\n .catch((error) => {\n setAddError(error.message)\n dispatch(removeList(listUrlInput))\n })\n }, [adding, dispatch, fetchList, listUrlInput])\n\n const validUrl: boolean = useMemo(() => {\n return uriToHttp(listUrlInput).length > 0 || Boolean(parseENSAddress(listUrlInput))\n }, [listUrlInput])\n\n const handleEnterKey = useCallback(\n (e) => {\n if (validUrl && e.key === 'Enter') {\n handleAddList()\n }\n },\n [handleAddList, validUrl]\n )\n\n const sortedLists = useMemo(() => {\n const listUrls = Object.keys(lists)\n return listUrls\n .filter((listUrl) => {\n return Boolean(lists[listUrl].current)\n })\n .sort((u1, u2) => {\n const { current: l1 } = lists[u1]\n const { current: l2 } = lists[u2]\n if (l1 && l2) {\n return l1.name.toLowerCase() < l2.name.toLowerCase()\n ? -1\n : l1.name.toLowerCase() === l2.name.toLowerCase()\n ? 0\n : 1\n }\n if (l1) return -1\n if (l2) return 1\n return 0\n })\n }, [lists])\n const TranslateString = useI18n()\n return (\n \n \n \n
\n \n
\n {TranslateString(1208, 'Manage Lists')}\n \n
\n
\n\n \n\n \n \n Add a list{' '}\n \n \n \n \n \n \n {addError ? (\n \n {addError}\n \n ) : null}\n \n\n \n\n \n {sortedLists.map((listUrl) => (\n \n ))}\n \n \n\n
\n Browse lists\n
\n
\n )\n}\n\nexport default ListSelect\n","import { useCallback, useState } from 'react'\n\nexport default function useToggle(initialState = false): [boolean, () => void] {\n const [state, setState] = useState(initialState)\n const toggle = useCallback(() => setState((prev) => !prev), [])\n return [state, toggle]\n}\n","import { Currency } from '@pancakeswap-libs/sdk'\nimport React, { useCallback, useEffect, useState } from 'react'\nimport useLast from '../../hooks/useLast'\nimport { useSelectedListUrl } from '../../state/lists/hooks'\nimport Modal from '../Modal'\nimport { CurrencySearch } from './CurrencySearch'\nimport { ListSelect } from './ListSelect'\n\ninterface CurrencySearchModalProps {\n isOpen: boolean\n onDismiss: () => void\n selectedCurrency?: Currency | null\n onCurrencySelect: (currency: Currency) => void\n otherSelectedCurrency?: Currency | null\n // eslint-disable-next-line react/no-unused-prop-types\n showCommonBases?: boolean\n}\n\nexport default function CurrencySearchModal({\n isOpen,\n onDismiss,\n onCurrencySelect,\n selectedCurrency,\n otherSelectedCurrency,\n}: CurrencySearchModalProps) {\n const [listView, setListView] = useState(false)\n const lastOpen = useLast(isOpen)\n\n useEffect(() => {\n if (isOpen && !lastOpen) {\n setListView(false)\n }\n }, [isOpen, lastOpen])\n\n const handleCurrencySelect = useCallback(\n (currency: Currency) => {\n onCurrencySelect(currency)\n onDismiss()\n },\n [onDismiss, onCurrencySelect]\n )\n\n const handleClickChangeList = useCallback(() => {\n setListView(true)\n }, [])\n const handleClickBack = useCallback(() => {\n setListView(false)\n }, [])\n\n const selectedListUrl = useSelectedListUrl()\n const noListSelected = !selectedListUrl\n\n return (\n \n {listView ? (\n \n ) : noListSelected ? (\n \n ) : (\n \n )}\n \n )\n}\n","import { Currency } from '@pancakeswap-libs/sdk'\nimport React from 'react'\nimport styled from 'styled-components'\nimport CurrencyLogo from '../CurrencyLogo'\n\nconst Wrapper = styled.div<{ margin: boolean; sizeraw: number }>`\n position: relative;\n display: flex;\n flex-direction: row;\n margin-right: ${({ sizeraw, margin }) => margin && `${(sizeraw / 3 + 8).toString() }px`};\n`\n\ninterface DoubleCurrencyLogoProps {\n margin?: boolean\n size?: number\n currency0?: Currency\n currency1?: Currency\n}\n\nconst HigherLogo = styled(CurrencyLogo)`\n z-index: 2;\n`\nconst CoveredLogo = styled(CurrencyLogo)<{ sizeraw: number }>`\n position: absolute;\n left: ${({ sizeraw }) => `${(sizeraw / 2).toString() }px`};\n`\n\nexport default function DoubleCurrencyLogo({\n currency0,\n currency1,\n size = 16,\n margin = false\n}: DoubleCurrencyLogoProps) {\n return (\n \n {currency0 && }\n {currency1 && }\n \n )\n}\n","import React from 'react'\nimport styled from 'styled-components'\nimport { escapeRegExp } from '../../utils'\n\nconst StyledInput = styled.input<{ error?: boolean; fontSize?: string; align?: string }>`\n color: ${({ error, theme }) => (error ? theme.colors.failure : theme.colors.text)};\n width: 0;\n position: relative;\n font-weight: 500;\n outline: none;\n border: none;\n flex: 1 1 auto;\n background-color: transparent;\n font-size: 16px;\n text-align: ${({ align }) => align && align};\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n padding: 0px;\n -webkit-appearance: textfield;\n\n ::-webkit-search-decoration {\n -webkit-appearance: none;\n }\n\n [type='number'] {\n -moz-appearance: textfield;\n }\n\n ::-webkit-outer-spin-button,\n ::-webkit-inner-spin-button {\n -webkit-appearance: none;\n }\n\n ::placeholder {\n color: ${({ theme }) => theme.colors.textSubtle};\n }\n`\n\nconst inputRegex = RegExp(`^\\\\d*(?:\\\\\\\\[.])?\\\\d*$`) // match escaped \".\" characters via in a non-capturing group\n\nexport const Input = React.memo(function InnerInput({\n value,\n onUserInput,\n placeholder,\n ...rest\n}: {\n value: string | number\n onUserInput: (input: string) => void\n error?: boolean\n fontSize?: string\n align?: 'right' | 'left'\n} & Omit, 'ref' | 'onChange' | 'as'>) {\n const enforcer = (nextUserInput: string) => {\n if (nextUserInput === '' || inputRegex.test(escapeRegExp(nextUserInput))) {\n onUserInput(nextUserInput)\n }\n }\n\n return (\n {\n // replace commas with periods, because uniswap exclusively uses period as the decimal separator\n enforcer(event.target.value.replace(/,/g, '.'))\n }}\n // universal input options\n inputMode=\"decimal\"\n title=\"Token Amount\"\n autoComplete=\"off\"\n autoCorrect=\"off\"\n // text-specific options\n type=\"text\"\n pattern=\"^[0-9]*[.,]?[0-9]*$\"\n placeholder={placeholder || '0.0'}\n minLength={1}\n maxLength={79}\n spellCheck=\"false\"\n />\n )\n})\n\nexport default Input\n","import React, { useState, useCallback } from 'react'\nimport { Currency, Pair } from '@pancakeswap-libs/sdk'\nimport { Button, ChevronDownIcon, Text } from '@pancakeswap-libs/uikit'\nimport styled from 'styled-components'\nimport { darken } from 'polished'\nimport useI18n from 'hooks/useI18n'\nimport { useCurrencyBalance } from '../../state/wallet/hooks'\nimport CurrencySearchModal from '../SearchModal/CurrencySearchModal'\nimport CurrencyLogo from '../CurrencyLogo'\nimport DoubleCurrencyLogo from '../DoubleLogo'\nimport { RowBetween } from '../Row'\nimport { Input as NumericalInput } from '../NumericalInput'\nimport { useActiveWeb3React } from '../../hooks'\n\nconst InputRow = styled.div<{ selected: boolean }>`\n display: flex;\n flex-flow: row nowrap;\n align-items: center;\n padding: ${({ selected }) => (selected ? '0.75rem 0.5rem 0.75rem 1rem' : '0.75rem 0.75rem 0.75rem 1rem')};\n`\nconst CurrencySelect = styled.button<{ selected: boolean }>`\n align-items: center;\n height: 34px;\n font-size: 16px;\n font-weight: 500;\n background-color: transparent;\n color: ${({ selected, theme }) => (selected ? theme.colors.text : '#FFFFFF')};\n border-radius: 12px;\n outline: none;\n cursor: pointer;\n user-select: none;\n border: none;\n padding: 0 0.5rem;\n :focus,\n :hover {\n background-color: ${({ theme }) => darken(0.05, theme.colors.input)};\n }\n`\nconst LabelRow = styled.div`\n display: flex;\n flex-flow: row nowrap;\n align-items: center;\n color: ${({ theme }) => theme.colors.text};\n font-size: 0.75rem;\n line-height: 1rem;\n padding: 0.75rem 1rem 0 1rem;\n span:hover {\n cursor: pointer;\n color: ${({ theme }) => darken(0.2, theme.colors.textSubtle)};\n }\n`\nconst Aligner = styled.span`\n display: flex;\n align-items: center;\n justify-content: space-between;\n`\nconst InputPanel = styled.div<{ hideInput?: boolean }>`\n display: flex;\n flex-flow: column nowrap;\n position: relative;\n border-radius: ${({ hideInput }) => (hideInput ? '8px' : '20px')};\n background-color: ${({ theme }) => theme.colors.background};\n z-index: 1;\n`\nconst Container = styled.div<{ hideInput: boolean }>`\n border-radius: 16px;\n background-color: ${({ theme }) => theme.colors.input};\n box-shadow: ${({ theme }) => theme.shadows.inset};\n`\ninterface CurrencyInputPanelProps {\n value: string\n onUserInput: (value: string) => void\n onMax?: () => void\n showMaxButton: boolean\n label?: string\n onCurrencySelect?: (currency: Currency) => void\n currency?: Currency | null\n disableCurrencySelect?: boolean\n hideBalance?: boolean\n pair?: Pair | null\n hideInput?: boolean\n otherCurrency?: Currency | null\n id: string\n showCommonBases?: boolean\n}\nexport default function CurrencyInputPanel({\n value,\n onUserInput,\n onMax,\n showMaxButton,\n label,\n onCurrencySelect,\n currency,\n disableCurrencySelect = false,\n hideBalance = false,\n pair = null, // used for double token logo\n hideInput = false,\n otherCurrency,\n id,\n showCommonBases,\n}: CurrencyInputPanelProps) {\n const [modalOpen, setModalOpen] = useState(false)\n const { account } = useActiveWeb3React()\n const selectedCurrencyBalance = useCurrencyBalance(account ?? undefined, currency ?? undefined)\n const TranslateString = useI18n()\n const translatedLabel = label || TranslateString(132, 'Input')\n const handleDismissSearch = useCallback(() => {\n setModalOpen(false)\n }, [setModalOpen])\n return (\n \n \n {!hideInput && (\n \n \n {translatedLabel}\n {account && (\n \n {!hideBalance && !!currency && selectedCurrencyBalance\n ? `Balance: ${selectedCurrencyBalance?.toSignificant(6)}`\n : ' -'}\n \n )}\n \n \n )}\n \n {!hideInput && (\n <>\n {\n onUserInput(val)\n }}\n />\n {account && currency && showMaxButton && label !== 'To' && (\n \n )}\n \n )}\n {\n if (!disableCurrencySelect) {\n setModalOpen(true)\n }\n }}\n >\n \n {pair ? (\n \n ) : currency ? (\n \n ) : null}\n {pair ? (\n \n {pair?.token0.symbol}:{pair?.token1.symbol}\n \n ) : (\n \n {(currency && currency.symbol && currency.symbol.length > 20\n ? `${currency.symbol.slice(0, 4)}...${currency.symbol.slice(\n currency.symbol.length - 5,\n currency.symbol.length\n )}`\n : currency?.symbol) || TranslateString(1196, 'Select a currency')}\n \n )}\n {!disableCurrencySelect && }\n \n \n \n \n {!disableCurrencySelect && onCurrencySelect && (\n \n )}\n \n )\n}\n","import React from 'react'\nimport styled from 'styled-components'\nimport { Link as HistoryLink } from 'react-router-dom'\nimport { ArrowLeft } from 'react-feather'\nimport { RowBetween } from 'components/Row'\nimport QuestionHelper from 'components/QuestionHelper'\nimport useI18n from 'hooks/useI18n'\n\nconst Tabs = styled.div`\n display: flex;\n flex-flow: row nowrap;\n align-items: center;\n border-radius: 3rem;\n justify-content: space-evenly;\n`\n\nconst ActiveText = styled.div`\n font-weight: 500;\n font-size: 20px;\n`\n\nconst StyledArrowLeft = styled(ArrowLeft)`\n color: ${({ theme }) => theme.colors.text};\n`\n\nexport function FindPoolTabs() {\n const TranslateString = useI18n()\n return (\n \n \n \n \n \n Import Pool\n \n \n \n )\n}\n\nexport function AddRemoveTabs({ adding }: { adding: boolean }) {\n const TranslateString = useI18n()\n return (\n \n \n \n \n \n {adding ? TranslateString(258, 'Add') : TranslateString(260, 'Remove')} Liquidity\n \n \n \n )\n}\n","import { BigNumber } from '@ethersproject/bignumber'\nimport { Token, TokenAmount } from '@pancakeswap-libs/sdk'\nimport { useTokenContract } from '../hooks/useContract'\nimport { useSingleCallResult } from '../state/multicall/hooks'\n\n// returns undefined if input token is undefined, or fails to get token contract,\n// or contract total supply cannot be fetched\nexport function useTotalSupply(token?: Token): TokenAmount | undefined {\n const contract = useTokenContract(token?.address, false)\n\n const totalSupply: BigNumber = useSingleCallResult(contract, 'totalSupply')?.result?.[0]\n\n return token && totalSupply ? new TokenAmount(token, totalSupply.toString()) : undefined\n}\n\nexport default useTotalSupply\n","import { Currency, ETHER, Token } from '@pancakeswap-libs/sdk'\n\nexport function currencyId(currency: Currency): string {\n if (currency === ETHER) return 'BNB'\n if (currency instanceof Token) return currency.address\n throw new Error('invalid currency')\n}\n\nexport default currencyId\n","import { ChainId, Currency, CurrencyAmount, ETHER, Token, TokenAmount, WETH } from '@pancakeswap-libs/sdk'\n\nexport function wrappedCurrency(currency: Currency | undefined, chainId: ChainId | undefined): Token | undefined {\n // eslint-disable-next-line no-nested-ternary\n return chainId && currency === ETHER ? WETH[chainId] : currency instanceof Token ? currency : undefined\n}\n\nexport function wrappedCurrencyAmount(\n currencyAmount: CurrencyAmount | undefined,\n chainId: ChainId | undefined\n): TokenAmount | undefined {\n const token = currencyAmount && chainId ? wrappedCurrency(currencyAmount.currency, chainId) : undefined\n return token && currencyAmount ? new TokenAmount(token, currencyAmount.raw) : undefined\n}\n\nexport function unwrappedToken(token: Token): Currency {\n if (token.equals(WETH[token.chainId])) return ETHER\n return token\n}\n","import { transparentize } from 'polished'\nimport React from 'react'\nimport { AlertTriangle } from 'react-feather'\nimport { Text } from '@pancakeswap-libs/uikit'\nimport styled, { css } from 'styled-components'\nimport { AutoColumn } from '../Column'\n\nexport const Wrapper = styled.div`\n position: relative;\n`\n\nexport const ArrowWrapper = styled.div<{ clickable: boolean }>`\n padding: 2px;\n\n ${({ clickable }) =>\n clickable\n ? css`\n :hover {\n cursor: pointer;\n opacity: 0.8;\n }\n `\n : null}\n`\n\nexport const SectionBreak = styled.div`\n height: 1px;\n width: 100%;\n background-color: ${({ theme }) => theme.colors.tertiary};\n`\n\nexport const BottomGrouping = styled.div`\n margin-top: 1rem;\n`\n\nexport const ErrorText = styled(Text)<{ severity?: 0 | 1 | 2 | 3 | 4 }>`\n color: ${({ theme, severity }) =>\n severity === 3 || severity === 4\n ? theme.colors.failure\n : severity === 2\n ? theme.colors.binance\n : severity === 1\n ? theme.colors.text\n : theme.colors.success};\n`\n\nexport const StyledBalanceMaxMini = styled.button`\n height: 22px;\n width: 22px;\n background-color: ${({ theme }) => theme.colors.invertedContrast};\n border: none;\n border-radius: 50%;\n padding: 0.2rem;\n font-size: 0.875rem;\n font-weight: 400;\n margin-left: 0.4rem;\n cursor: pointer;\n color: ${({ theme }) => theme.colors.textSubtle};\n display: flex;\n justify-content: center;\n align-items: center;\n float: right;\n\n :hover {\n background-color: ${({ theme }) => theme.colors.tertiary};\n }\n :focus {\n background-color: ${({ theme }) => theme.colors.tertiary};\n outline: none;\n }\n`\n\n// styles\nexport const Dots = styled.span`\n &::after {\n display: inline-block;\n animation: ellipsis 1.25s infinite;\n content: '.';\n width: 1em;\n text-align: left;\n }\n @keyframes ellipsis {\n 0% {\n content: '.';\n }\n 33% {\n content: '..';\n }\n 66% {\n content: '...';\n }\n }\n`\n\nconst SwapCallbackErrorInner = styled.div`\n background-color: ${({ theme }) => transparentize(0.9, theme.colors.failure)};\n border-radius: 1rem;\n display: flex;\n align-items: center;\n font-size: 0.825rem;\n width: 100%;\n padding: 3rem 1.25rem 1rem 1rem;\n margin-top: -2rem;\n color: ${({ theme }) => theme.colors.failure};\n z-index: -1;\n p {\n padding: 0;\n margin: 0;\n font-weight: 500;\n }\n`\n\nconst SwapCallbackErrorInnerAlertTriangle = styled.div`\n background-color: ${({ theme }) => transparentize(0.9, theme.colors.failure)};\n display: flex;\n align-items: center;\n justify-content: center;\n margin-right: 12px;\n border-radius: 12px;\n min-width: 48px;\n height: 48px;\n`\n\nexport function SwapCallbackError({ error }: { error: string }) {\n return (\n \n \n \n \n

{error}

\n
\n )\n}\n\nexport const SwapShowAcceptChanges = styled(AutoColumn)`\n background-color: ${({ theme }) => transparentize(0.9, theme.colors.primary)};\n color: ${({ theme }) => theme.colors.primary};\n padding: 0.5rem;\n border-radius: 12px;\n margin-top: 8px;\n`\n","import React, { useState } from 'react'\nimport { JSBI, Pair, Percent } from '@pancakeswap-libs/sdk'\nimport { Button, Card as UIKitCard, CardBody, Text } from '@pancakeswap-libs/uikit'\nimport { darken } from 'polished'\nimport { ChevronDown, ChevronUp } from 'react-feather'\nimport { Link } from 'react-router-dom'\nimport styled from 'styled-components'\nimport { useTotalSupply } from '../../data/TotalSupply'\n\nimport { useActiveWeb3React } from '../../hooks'\nimport { useTokenBalance } from '../../state/wallet/hooks'\nimport { currencyId } from '../../utils/currencyId'\nimport { unwrappedToken } from '../../utils/wrappedCurrency'\nimport Card from '../Card'\nimport { AutoColumn } from '../Column'\nimport CurrencyLogo from '../CurrencyLogo'\nimport DoubleCurrencyLogo from '../DoubleLogo'\nimport { RowBetween, RowFixed } from '../Row'\nimport { Dots } from '../swap/styleds'\n\nexport const FixedHeightRow = styled(RowBetween)`\n height: 24px;\n`\n\nexport const HoverCard = styled(Card)`\n border: 1px solid ${({ theme }) => theme.colors.invertedContrast};\n :hover {\n border: 1px solid ${({ theme }) => darken(0.06, theme.colors.invertedContrast)};\n }\n`\n\ninterface PositionCardProps {\n pair: Pair\n // eslint-disable-next-line react/no-unused-prop-types\n showUnwrapped?: boolean\n}\n\nexport function MinimalPositionCard({ pair, showUnwrapped = false }: PositionCardProps) {\n const { account } = useActiveWeb3React()\n\n const currency0 = showUnwrapped ? pair.token0 : unwrappedToken(pair.token0)\n const currency1 = showUnwrapped ? pair.token1 : unwrappedToken(pair.token1)\n\n const [showMore, setShowMore] = useState(false)\n\n const userPoolBalance = useTokenBalance(account ?? undefined, pair.liquidityToken)\n const totalPoolTokens = useTotalSupply(pair.liquidityToken)\n\n const [token0Deposited, token1Deposited] =\n !!pair &&\n !!totalPoolTokens &&\n !!userPoolBalance &&\n // this condition is a short-circuit in the case where useTokenBalance updates sooner than useTotalSupply\n JSBI.greaterThanOrEqual(totalPoolTokens.raw, userPoolBalance.raw)\n ? [\n pair.getLiquidityValue(pair.token0, totalPoolTokens, userPoolBalance, false),\n pair.getLiquidityValue(pair.token1, totalPoolTokens, userPoolBalance, false),\n ]\n : [undefined, undefined]\n\n return (\n <>\n {userPoolBalance && (\n \n \n \n \n \n \n LP Tokens in your Wallet\n \n \n \n setShowMore(!showMore)}>\n \n \n \n {currency0.symbol}/{currency1.symbol}\n \n \n \n {userPoolBalance ? userPoolBalance.toSignificant(4) : '-'}\n \n \n \n \n {currency0.symbol}:\n {token0Deposited ? (\n \n \n {token0Deposited?.toSignificant(6)}\n \n \n ) : (\n '-'\n )}\n \n \n {currency1.symbol}:\n {token1Deposited ? (\n \n \n {token1Deposited?.toSignificant(6)}\n \n \n ) : (\n '-'\n )}\n \n \n \n \n \n )}\n \n )\n}\n\nexport default function FullPositionCard({ pair }: PositionCardProps) {\n const { account } = useActiveWeb3React()\n\n const currency0 = unwrappedToken(pair.token0)\n const currency1 = unwrappedToken(pair.token1)\n\n const [showMore, setShowMore] = useState(false)\n\n const userPoolBalance = useTokenBalance(account ?? undefined, pair.liquidityToken)\n const totalPoolTokens = useTotalSupply(pair.liquidityToken)\n\n const poolTokenPercentage =\n !!userPoolBalance && !!totalPoolTokens && JSBI.greaterThanOrEqual(totalPoolTokens.raw, userPoolBalance.raw)\n ? new Percent(userPoolBalance.raw, totalPoolTokens.raw)\n : undefined\n\n const [token0Deposited, token1Deposited] =\n !!pair &&\n !!totalPoolTokens &&\n !!userPoolBalance &&\n // this condition is a short-circuit in the case where useTokenBalance updates sooner than useTotalSupply\n JSBI.greaterThanOrEqual(totalPoolTokens.raw, userPoolBalance.raw)\n ? [\n pair.getLiquidityValue(pair.token0, totalPoolTokens, userPoolBalance, false),\n pair.getLiquidityValue(pair.token1, totalPoolTokens, userPoolBalance, false),\n ]\n : [undefined, undefined]\n\n return (\n \n \n setShowMore(!showMore)} style={{ cursor: 'pointer' }}>\n \n \n {!currency0 || !currency1 ? Loading : `${currency0.symbol}/${currency1.symbol}`}\n \n \n {showMore ? (\n \n ) : (\n \n )}\n \n \n {showMore && (\n \n \n \n Pooled {currency0.symbol}:\n \n {token0Deposited ? (\n \n {token0Deposited?.toSignificant(6)}\n \n \n ) : (\n '-'\n )}\n \n\n \n \n Pooled {currency1.symbol}:\n \n {token1Deposited ? (\n \n {token1Deposited?.toSignificant(6)}\n \n \n ) : (\n '-'\n )}\n \n \n Your pool tokens:\n {userPoolBalance ? userPoolBalance.toSignificant(4) : '-'}\n \n \n Your pool share:\n {poolTokenPercentage ? `${poolTokenPercentage.toFixed(2)}%` : '-'}\n \n\n \n \n \n Remove\n \n \n \n )}\n \n \n )\n}\n","import { TokenAmount, Pair, Currency } from '@pancakeswap-libs/sdk'\nimport { useMemo } from 'react'\nimport { abi as IUniswapV2PairABI } from '@uniswap/v2-core/build/IUniswapV2Pair.json'\nimport { Interface } from '@ethersproject/abi'\nimport { useActiveWeb3React } from '../hooks'\n\nimport { useMultipleContractSingleData } from '../state/multicall/hooks'\nimport { wrappedCurrency } from '../utils/wrappedCurrency'\n\nconst PAIR_INTERFACE = new Interface(IUniswapV2PairABI)\n\nexport enum PairState {\n LOADING,\n NOT_EXISTS,\n EXISTS,\n INVALID\n}\n\nexport function usePairs(currencies: [Currency | undefined, Currency | undefined][]): [PairState, Pair | null][] {\n const { chainId } = useActiveWeb3React()\n\n const tokens = useMemo(\n () =>\n currencies.map(([currencyA, currencyB]) => [\n wrappedCurrency(currencyA, chainId),\n wrappedCurrency(currencyB, chainId)\n ]),\n [chainId, currencies]\n )\n\n const pairAddresses = useMemo(\n () =>\n tokens.map(([tokenA, tokenB]) => {\n return tokenA && tokenB && !tokenA.equals(tokenB) ? Pair.getAddress(tokenA, tokenB) : undefined\n }),\n [tokens]\n )\n\n const results = useMultipleContractSingleData(pairAddresses, PAIR_INTERFACE, 'getReserves')\n\n return useMemo(() => {\n return results.map((result, i) => {\n const { result: reserves, loading } = result\n const tokenA = tokens[i][0]\n const tokenB = tokens[i][1]\n\n if (loading) return [PairState.LOADING, null]\n if (!tokenA || !tokenB || tokenA.equals(tokenB)) return [PairState.INVALID, null]\n if (!reserves) return [PairState.NOT_EXISTS, null]\n const { reserve0, reserve1 } = reserves\n const [token0, token1] = tokenA.sortsBefore(tokenB) ? [tokenA, tokenB] : [tokenB, tokenA]\n return [\n PairState.EXISTS,\n new Pair(new TokenAmount(token0, reserve0.toString()), new TokenAmount(token1, reserve1.toString()))\n ]\n })\n }, [results, tokens])\n}\n\nexport function usePair(tokenA?: Currency, tokenB?: Currency): [PairState, Pair | null] {\n return usePairs([[tokenA, tokenB]])[0]\n}\n","import { Token, TokenAmount } from '@pancakeswap-libs/sdk'\nimport { useMemo } from 'react'\n\nimport { useTokenContract } from '../hooks/useContract'\nimport { useSingleCallResult } from '../state/multicall/hooks'\n\nexport function useTokenAllowance(token?: Token, owner?: string, spender?: string): TokenAmount | undefined {\n const contract = useTokenContract(token?.address, false)\n\n const inputs = useMemo(() => [owner, spender], [owner, spender])\n const allowance = useSingleCallResult(contract, 'allowance', inputs).result\n\n return useMemo(() => (token && allowance ? new TokenAmount(token, allowance.toString()) : undefined), [\n token,\n allowance,\n ])\n}\n\nexport default useTokenAllowance\n","import { createAction } from '@reduxjs/toolkit'\n\nexport enum Field {\n INPUT = 'INPUT',\n OUTPUT = 'OUTPUT'\n}\n\nexport const selectCurrency = createAction<{ field: Field; currencyId: string }>('swap/selectCurrency')\nexport const switchCurrencies = createAction('swap/switchCurrencies')\nexport const typeInput = createAction<{ field: Field; typedValue: string }>('swap/typeInput')\nexport const replaceSwapState = createAction<{\n field: Field\n typedValue: string\n inputCurrencyId?: string\n outputCurrencyId?: string\n recipient: string | null\n}>('swap/replaceSwapState')\nexport const setRecipient = createAction<{ recipient: string | null }>('swap/setRecipient')\n","import { createAction } from '@reduxjs/toolkit'\nimport { ChainId } from '@pancakeswap-libs/sdk'\n\nexport interface SerializableTransactionReceipt {\n to: string\n from: string\n contractAddress: string\n transactionIndex: number\n blockHash: string\n transactionHash: string\n blockNumber: number\n status?: number\n}\n\nexport const addTransaction = createAction<{\n chainId: ChainId\n hash: string\n from: string\n approval?: { tokenAddress: string; spender: string }\n summary?: string\n}>('transactions/addTransaction')\nexport const clearAllTransactions = createAction<{ chainId: ChainId }>('transactions/clearAllTransactions')\nexport const finalizeTransaction = createAction<{\n chainId: ChainId\n hash: string\n receipt: SerializableTransactionReceipt\n}>('transactions/finalizeTransaction')\nexport const checkedTransaction = createAction<{\n chainId: ChainId\n hash: string\n blockNumber: number\n}>('transactions/checkedTransaction')\n","import { TransactionResponse } from '@ethersproject/providers'\nimport { useCallback, useMemo } from 'react'\nimport { useDispatch, useSelector } from 'react-redux'\n\nimport { useActiveWeb3React } from '../../hooks'\nimport { AppDispatch, AppState } from '../index'\nimport { addTransaction } from './actions'\nimport { TransactionDetails } from './reducer'\n\n// helper that can take a ethers library transaction response and add it to the list of transactions\nexport function useTransactionAdder(): (\n response: TransactionResponse,\n customData?: { summary?: string; approval?: { tokenAddress: string; spender: string } }\n) => void {\n const { chainId, account } = useActiveWeb3React()\n const dispatch = useDispatch()\n\n return useCallback(\n (\n response: TransactionResponse,\n { summary, approval }: { summary?: string; approval?: { tokenAddress: string; spender: string } } = {}\n ) => {\n if (!account) return\n if (!chainId) return\n\n const { hash } = response\n if (!hash) {\n throw Error('No transaction hash found.')\n }\n dispatch(addTransaction({ hash, from: account, chainId, approval, summary }))\n },\n [dispatch, chainId, account]\n )\n}\n\n// returns all the transactions for the current chain\nexport function useAllTransactions(): { [txHash: string]: TransactionDetails } {\n const { chainId } = useActiveWeb3React()\n\n const state = useSelector((s) => s.transactions)\n\n return chainId ? state[chainId] ?? {} : {}\n}\n\nexport function useIsTransactionPending(transactionHash?: string): boolean {\n const transactions = useAllTransactions()\n\n if (!transactionHash || !transactions[transactionHash]) return false\n\n return !transactions[transactionHash].receipt\n}\n\n/**\n * Returns whether a transaction happened in the last day (86400 seconds * 1000 milliseconds / second)\n * @param tx to check for recency\n */\nexport function isTransactionRecent(tx: TransactionDetails): boolean {\n return new Date().getTime() - tx.addedTime < 86_400_000\n}\n\n// returns whether a token has a pending approval transaction\nexport function useHasPendingApproval(tokenAddress: string | undefined, spender: string | undefined): boolean {\n const allTransactions = useAllTransactions()\n return useMemo(\n () =>\n typeof tokenAddress === 'string' &&\n typeof spender === 'string' &&\n Object.keys(allTransactions).some((hash) => {\n const tx = allTransactions[hash]\n if (!tx) return false\n if (tx.receipt) {\n return false\n }\n const { approval } = tx\n if (!approval) return false\n return approval.spender === spender && approval.tokenAddress === tokenAddress && isTransactionRecent(tx)\n }),\n [allTransactions, spender, tokenAddress]\n )\n}\n","import { CurrencyAmount, Fraction, JSBI, Percent, TokenAmount, Trade } from '@pancakeswap-libs/sdk'\nimport {\n BLOCKED_PRICE_IMPACT_NON_EXPERT,\n ALLOWED_PRICE_IMPACT_HIGH,\n ALLOWED_PRICE_IMPACT_LOW,\n ALLOWED_PRICE_IMPACT_MEDIUM,\n} from '../constants'\n\nimport { Field } from '../state/swap/actions'\nimport { basisPointsToPercent } from './index'\n\nconst BASE_FEE = new Percent(JSBI.BigInt(20), JSBI.BigInt(10000))\nconst ONE_HUNDRED_PERCENT = new Percent(JSBI.BigInt(10000), JSBI.BigInt(10000))\nconst INPUT_FRACTION_AFTER_FEE = ONE_HUNDRED_PERCENT.subtract(BASE_FEE)\n\n// computes price breakdown for the trade\nexport function computeTradePriceBreakdown(\n trade?: Trade\n): { priceImpactWithoutFee?: Percent; realizedLPFee?: CurrencyAmount } {\n // for each hop in our trade, take away the x*y=k price impact from 0.2% fees\n // e.g. for 3 tokens/2 hops: 1 - ((1 - .02) * (1-.02))\n const realizedLPFee = !trade\n ? undefined\n : ONE_HUNDRED_PERCENT.subtract(\n trade.route.pairs.reduce(\n (currentFee: Fraction): Fraction => currentFee.multiply(INPUT_FRACTION_AFTER_FEE),\n ONE_HUNDRED_PERCENT\n )\n )\n\n // remove lp fees from price impact\n const priceImpactWithoutFeeFraction = trade && realizedLPFee ? trade.priceImpact.subtract(realizedLPFee) : undefined\n\n // the x*y=k impact\n const priceImpactWithoutFeePercent = priceImpactWithoutFeeFraction\n ? new Percent(priceImpactWithoutFeeFraction?.numerator, priceImpactWithoutFeeFraction?.denominator)\n : undefined\n\n // the amount of the input that accrues to LPs\n const realizedLPFeeAmount =\n realizedLPFee &&\n trade &&\n (trade.inputAmount instanceof TokenAmount\n ? new TokenAmount(trade.inputAmount.token, realizedLPFee.multiply(trade.inputAmount.raw).quotient)\n : CurrencyAmount.ether(realizedLPFee.multiply(trade.inputAmount.raw).quotient))\n\n return { priceImpactWithoutFee: priceImpactWithoutFeePercent, realizedLPFee: realizedLPFeeAmount }\n}\n\n// computes the minimum amount out and maximum amount in for a trade given a user specified allowed slippage in bips\nexport function computeSlippageAdjustedAmounts(\n trade: Trade | undefined,\n allowedSlippage: number\n): { [field in Field]?: CurrencyAmount } {\n const pct = basisPointsToPercent(allowedSlippage)\n return {\n [Field.INPUT]: trade?.maximumAmountIn(pct),\n [Field.OUTPUT]: trade?.minimumAmountOut(pct),\n }\n}\n\nexport function warningSeverity(priceImpact: Percent | undefined): 0 | 1 | 2 | 3 | 4 {\n if (!priceImpact?.lessThan(BLOCKED_PRICE_IMPACT_NON_EXPERT)) return 4\n if (!priceImpact?.lessThan(ALLOWED_PRICE_IMPACT_HIGH)) return 3\n if (!priceImpact?.lessThan(ALLOWED_PRICE_IMPACT_MEDIUM)) return 2\n if (!priceImpact?.lessThan(ALLOWED_PRICE_IMPACT_LOW)) return 1\n return 0\n}\n\nexport function formatExecutionPrice(trade?: Trade, inverted?: boolean): string {\n if (!trade) {\n return ''\n }\n return inverted\n ? `${trade.executionPrice.invert().toSignificant(6)} ${trade.inputAmount.currency.symbol} / ${\n trade.outputAmount.currency.symbol\n }`\n : `${trade.executionPrice.toSignificant(6)} ${trade.outputAmount.currency.symbol} / ${\n trade.inputAmount.currency.symbol\n }`\n}\n","import { MaxUint256 } from '@ethersproject/constants'\nimport { TransactionResponse } from '@ethersproject/providers'\nimport { Trade, TokenAmount, CurrencyAmount, ETHER } from '@pancakeswap-libs/sdk'\nimport { useCallback, useMemo } from 'react'\nimport { ROUTER_ADDRESS } from '../constants'\nimport { useTokenAllowance } from '../data/Allowances'\nimport { Field } from '../state/swap/actions'\nimport { useTransactionAdder, useHasPendingApproval } from '../state/transactions/hooks'\nimport { computeSlippageAdjustedAmounts } from '../utils/prices'\nimport { calculateGasMargin } from '../utils'\nimport { useTokenContract } from './useContract'\nimport { useActiveWeb3React } from './index'\n\nexport enum ApprovalState {\n UNKNOWN,\n NOT_APPROVED,\n PENDING,\n APPROVED,\n}\n\n// returns a variable indicating the state of the approval and a function which approves if necessary or early returns\nexport function useApproveCallback(\n amountToApprove?: CurrencyAmount,\n spender?: string\n): [ApprovalState, () => Promise] {\n const { account } = useActiveWeb3React()\n const token = amountToApprove instanceof TokenAmount ? amountToApprove.token : undefined\n const currentAllowance = useTokenAllowance(token, account ?? undefined, spender)\n const pendingApproval = useHasPendingApproval(token?.address, spender)\n\n // check the current approval status\n const approvalState: ApprovalState = useMemo(() => {\n if (!amountToApprove || !spender) return ApprovalState.UNKNOWN\n if (amountToApprove.currency === ETHER) return ApprovalState.APPROVED\n // we might not have enough data to know whether or not we need to approve\n if (!currentAllowance) return ApprovalState.UNKNOWN\n\n // amountToApprove will be defined if currentAllowance is\n return currentAllowance.lessThan(amountToApprove)\n ? pendingApproval\n ? ApprovalState.PENDING\n : ApprovalState.NOT_APPROVED\n : ApprovalState.APPROVED\n }, [amountToApprove, currentAllowance, pendingApproval, spender])\n\n const tokenContract = useTokenContract(token?.address)\n const addTransaction = useTransactionAdder()\n\n const approve = useCallback(async (): Promise => {\n if (approvalState !== ApprovalState.NOT_APPROVED) {\n console.error('approve was called unnecessarily')\n return\n }\n if (!token) {\n console.error('no token')\n return\n }\n\n if (!tokenContract) {\n console.error('tokenContract is null')\n return\n }\n\n if (!amountToApprove) {\n console.error('missing amount to approve')\n return\n }\n\n if (!spender) {\n console.error('no spender')\n return\n }\n\n let useExact = false\n const estimatedGas = await tokenContract.estimateGas.approve(spender, MaxUint256).catch(() => {\n // general fallback for tokens who restrict approval amounts\n useExact = true\n return tokenContract.estimateGas.approve(spender, amountToApprove.raw.toString())\n })\n\n // eslint-disable-next-line consistent-return\n return tokenContract\n .approve(spender, useExact ? amountToApprove.raw.toString() : MaxUint256, {\n gasLimit: calculateGasMargin(estimatedGas),\n })\n .then((response: TransactionResponse) => {\n addTransaction(response, {\n summary: `Approve ${amountToApprove.currency.symbol}`,\n approval: { tokenAddress: token.address, spender },\n })\n })\n .catch((error: Error) => {\n console.error('Failed to approve token', error)\n throw error\n })\n }, [approvalState, token, tokenContract, amountToApprove, spender, addTransaction])\n\n return [approvalState, approve]\n}\n\n// wraps useApproveCallback in the context of a swap\nexport function useApproveCallbackFromTrade(trade?: Trade, allowedSlippage = 0) {\n const amountToApprove = useMemo(\n () => (trade ? computeSlippageAdjustedAmounts(trade, allowedSlippage)[Field.INPUT] : undefined),\n [trade, allowedSlippage]\n )\n return useApproveCallback(amountToApprove, ROUTER_ADDRESS)\n}\n","import { createAction } from '@reduxjs/toolkit'\n\nexport enum Field {\n CURRENCY_A = 'CURRENCY_A',\n CURRENCY_B = 'CURRENCY_B'\n}\n\nexport const typeInput = createAction<{ field: Field; typedValue: string; noLiquidity: boolean }>('mint/typeInputMint')\nexport const resetMintState = createAction('mint/resetMintState')\n","import { useEffect, useState } from 'react'\n\n// modified from https://usehooks.com/useDebounce/\nexport default function useDebounce(value: T, delay: number): T {\n const [debouncedValue, setDebouncedValue] = useState(value)\n\n useEffect(() => {\n // Update debounced value after delay\n const handler = setTimeout(() => {\n setDebouncedValue(value)\n }, delay)\n\n // Cancel the timeout if value changes (also on delay change or unmount)\n // This is how we prevent debounced value from updating if value is changed ...\n // .. within the delay period. Timeout gets cleared and restarted.\n return () => {\n clearTimeout(handler)\n }\n }, [value, delay])\n\n return debouncedValue\n}\n","import { isAddress } from '../utils'\nimport useENSAddress from './useENSAddress'\nimport useENSName from './useENSName'\n\n/**\n * Given a name or address, does a lookup to resolve to an address and name\n * @param nameOrAddress ENS name or address\n */\nexport default function useENS(\n nameOrAddress?: string | null\n): { loading: boolean; address: string | null; name: string | null } {\n const validated = isAddress(nameOrAddress)\n const reverseLookup = useENSName(validated || undefined)\n const lookup = useENSAddress(nameOrAddress)\n\n return {\n loading: reverseLookup.loading || lookup.loading,\n address: validated || lookup.address,\n name: reverseLookup.ENSName ? reverseLookup.ENSName : !validated && lookup.address ? nameOrAddress || null : null\n }\n}\n","import { namehash } from 'ethers/lib/utils'\nimport { useMemo } from 'react'\nimport { useSingleCallResult } from '../state/multicall/hooks'\nimport { isAddress } from '../utils'\nimport isZero from '../utils/isZero'\nimport { useENSRegistrarContract, useENSResolverContract } from './useContract'\nimport useDebounce from './useDebounce'\n\n/**\n * Does a reverse lookup for an address to find its ENS name.\n * Note this is not the same as looking up an ENS name to find an address.\n */\nexport default function useENSName(address?: string): { ENSName: string | null; loading: boolean } {\n const debouncedAddress = useDebounce(address, 200)\n const ensNodeArgument = useMemo(() => {\n if (!debouncedAddress || !isAddress(debouncedAddress)) return [undefined]\n try {\n return debouncedAddress ? [namehash(`${debouncedAddress.toLowerCase().substr(2)}.addr.reverse`)] : [undefined]\n } catch (error) {\n return [undefined]\n }\n }, [debouncedAddress])\n const registrarContract = useENSRegistrarContract(false)\n const resolverAddress = useSingleCallResult(registrarContract, 'resolver', ensNodeArgument)\n const resolverAddressResult = resolverAddress.result?.[0]\n const resolverContract = useENSResolverContract(\n resolverAddressResult && !isZero(resolverAddressResult) ? resolverAddressResult : undefined,\n false\n )\n const name = useSingleCallResult(resolverContract, 'name', ensNodeArgument)\n\n const changed = debouncedAddress !== address\n return {\n ENSName: changed ? null : name.result?.[0] ?? null,\n loading: changed || resolverAddress.loading || name.loading\n }\n}\n","import { namehash } from 'ethers/lib/utils'\nimport { useMemo } from 'react'\nimport { useSingleCallResult } from '../state/multicall/hooks'\nimport isZero from '../utils/isZero'\nimport { useENSRegistrarContract, useENSResolverContract } from './useContract'\nimport useDebounce from './useDebounce'\n\n/**\n * Does a lookup for an ENS name to find its address.\n */\nexport default function useENSAddress(ensName?: string | null): { loading: boolean; address: string | null } {\n const debouncedName = useDebounce(ensName, 200)\n const ensNodeArgument = useMemo(() => {\n if (!debouncedName) return [undefined]\n try {\n return debouncedName ? [namehash(debouncedName)] : [undefined]\n } catch (error) {\n return [undefined]\n }\n }, [debouncedName])\n const registrarContract = useENSRegistrarContract(false)\n const resolverAddress = useSingleCallResult(registrarContract, 'resolver', ensNodeArgument)\n const resolverAddressResult = resolverAddress.result?.[0]\n const resolverContract = useENSResolverContract(\n resolverAddressResult && !isZero(resolverAddressResult) ? resolverAddressResult : undefined,\n false\n )\n const addr = useSingleCallResult(resolverContract, 'addr', ensNodeArgument)\n\n const changed = debouncedName !== ensName\n return {\n address: changed ? null : addr.result?.[0] ?? null,\n loading: changed || resolverAddress.loading || addr.loading\n }\n}\n","import { Currency, CurrencyAmount, Pair, Token, Trade } from '@pancakeswap-libs/sdk'\nimport flatMap from 'lodash.flatmap'\nimport { useMemo } from 'react'\n\nimport { BASES_TO_CHECK_TRADES_AGAINST, CUSTOM_BASES } from '../constants'\nimport { PairState, usePairs } from '../data/Reserves'\nimport { wrappedCurrency } from '../utils/wrappedCurrency'\n\nimport { useActiveWeb3React } from './index'\n\nfunction useAllCommonPairs(currencyA?: Currency, currencyB?: Currency): Pair[] {\n const { chainId } = useActiveWeb3React()\n\n // Base tokens for building intermediary trading routes\n const bases: Token[] = useMemo(() => (chainId ? BASES_TO_CHECK_TRADES_AGAINST[chainId] : []), [chainId])\n\n // All pairs from base tokens\n const basePairs: [Token, Token][] = useMemo(\n () =>\n flatMap(bases, (base): [Token, Token][] => bases.map((otherBase) => [base, otherBase])).filter(\n ([t0, t1]) => t0.address !== t1.address\n ),\n [bases]\n )\n\n const [tokenA, tokenB] = chainId\n ? [wrappedCurrency(currencyA, chainId), wrappedCurrency(currencyB, chainId)]\n : [undefined, undefined]\n\n const allPairCombinations: [Token, Token][] = useMemo(\n () =>\n tokenA && tokenB\n ? [\n // the direct pair\n [tokenA, tokenB],\n // token A against all bases\n ...bases.map((base): [Token, Token] => [tokenA, base]),\n // token B against all bases\n ...bases.map((base): [Token, Token] => [tokenB, base]),\n // each base against all bases\n ...basePairs,\n ]\n .filter((tokens): tokens is [Token, Token] => Boolean(tokens[0] && tokens[1]))\n .filter(([t0, t1]) => t0.address !== t1.address)\n // This filter will remove all the pairs that are not supported by the CUSTOM_BASES settings\n // This option is currently not used on Pancake swap\n .filter(([t0, t1]) => {\n if (!chainId) return true\n const customBases = CUSTOM_BASES[chainId]\n if (!customBases) return true\n\n const customBasesA: Token[] | undefined = customBases[t0.address]\n const customBasesB: Token[] | undefined = customBases[t1.address]\n\n if (!customBasesA && !customBasesB) return true\n if (customBasesA && !customBasesA.find((base) => t1.equals(base))) return false\n if (customBasesB && !customBasesB.find((base) => t0.equals(base))) return false\n\n return true\n })\n : [],\n [tokenA, tokenB, bases, basePairs, chainId]\n )\n\n const allPairs = usePairs(allPairCombinations)\n\n // only pass along valid pairs, non-duplicated pairs\n return useMemo(\n () =>\n Object.values(\n allPairs\n // filter out invalid pairs\n .filter((result): result is [PairState.EXISTS, Pair] => Boolean(result[0] === PairState.EXISTS && result[1]))\n // filter out duplicated pairs\n .reduce<{ [pairAddress: string]: Pair }>((memo, [, curr]) => {\n memo[curr.liquidityToken.address] = memo[curr.liquidityToken.address] ?? curr\n return memo\n }, {})\n ),\n [allPairs]\n )\n}\n\n/**\n * Returns the best trade for the exact amount of tokens in to the given token out\n */\nexport function useTradeExactIn(currencyAmountIn?: CurrencyAmount, currencyOut?: Currency): Trade | null {\n const allowedPairs = useAllCommonPairs(currencyAmountIn?.currency, currencyOut)\n\n return useMemo(() => {\n if (currencyAmountIn && currencyOut && allowedPairs.length > 0) {\n return (\n Trade.bestTradeExactIn(allowedPairs, currencyAmountIn, currencyOut, { maxHops: 3, maxNumResults: 1 })[0] ?? null\n )\n }\n return null\n }, [allowedPairs, currencyAmountIn, currencyOut])\n}\n\n/**\n * Returns the best trade for the token in to the exact amount of token out\n */\nexport function useTradeExactOut(currencyIn?: Currency, currencyAmountOut?: CurrencyAmount): Trade | null {\n const allowedPairs = useAllCommonPairs(currencyIn, currencyAmountOut?.currency)\n\n return useMemo(() => {\n if (currencyIn && currencyAmountOut && allowedPairs.length > 0) {\n return (\n Trade.bestTradeExactOut(allowedPairs, currencyIn, currencyAmountOut, { maxHops: 3, maxNumResults: 1 })[0] ??\n null\n )\n }\n return null\n }, [allowedPairs, currencyIn, currencyAmountOut])\n}\n","import { parseUnits } from '@ethersproject/units'\nimport { Currency, CurrencyAmount, ETHER, JSBI, Token, TokenAmount, Trade } from '@pancakeswap-libs/sdk'\nimport { ParsedQs } from 'qs'\nimport { useCallback, useEffect, useState } from 'react'\nimport { useDispatch, useSelector } from 'react-redux'\nimport useENS from '../../hooks/useENS'\nimport { useActiveWeb3React } from '../../hooks'\nimport { useCurrency } from '../../hooks/Tokens'\nimport { useTradeExactIn, useTradeExactOut } from '../../hooks/Trades'\nimport useParsedQueryString from '../../hooks/useParsedQueryString'\nimport { isAddress } from '../../utils'\nimport { AppDispatch, AppState } from '../index'\nimport { useCurrencyBalances } from '../wallet/hooks'\nimport { Field, replaceSwapState, selectCurrency, setRecipient, switchCurrencies, typeInput } from './actions'\nimport { SwapState } from './reducer'\n\nimport { useUserSlippageTolerance } from '../user/hooks'\nimport { computeSlippageAdjustedAmounts } from '../../utils/prices'\n\nexport function useSwapState(): AppState['swap'] {\n return useSelector((state) => state.swap)\n}\n\nexport function useSwapActionHandlers(): {\n onCurrencySelection: (field: Field, currency: Currency) => void\n onSwitchTokens: () => void\n onUserInput: (field: Field, typedValue: string) => void\n onChangeRecipient: (recipient: string | null) => void\n} {\n const dispatch = useDispatch()\n const onCurrencySelection = useCallback(\n (field: Field, currency: Currency) => {\n dispatch(\n selectCurrency({\n field,\n currencyId: currency instanceof Token ? currency.address : currency === ETHER ? 'BNB' : '',\n })\n )\n },\n [dispatch]\n )\n\n const onSwitchTokens = useCallback(() => {\n dispatch(switchCurrencies())\n }, [dispatch])\n\n const onUserInput = useCallback(\n (field: Field, typedValue: string) => {\n dispatch(typeInput({ field, typedValue }))\n },\n [dispatch]\n )\n\n const onChangeRecipient = useCallback(\n (recipient: string | null) => {\n dispatch(setRecipient({ recipient }))\n },\n [dispatch]\n )\n\n return {\n onSwitchTokens,\n onCurrencySelection,\n onUserInput,\n onChangeRecipient,\n }\n}\n\n// try to parse a user entered amount for a given token\nexport function tryParseAmount(value?: string, currency?: Currency): CurrencyAmount | undefined {\n if (!value || !currency) {\n return undefined\n }\n try {\n const typedValueParsed = parseUnits(value, currency.decimals).toString()\n if (typedValueParsed !== '0') {\n return currency instanceof Token\n ? new TokenAmount(currency, JSBI.BigInt(typedValueParsed))\n : CurrencyAmount.ether(JSBI.BigInt(typedValueParsed))\n }\n } catch (error) {\n // should fail if the user specifies too many decimal places of precision (or maybe exceed max uint?)\n console.info(`Failed to parse input amount: \"${value}\"`, error)\n }\n // necessary for all paths to return a value\n return undefined\n}\n\nconst BAD_RECIPIENT_ADDRESSES: string[] = [\n '0x5Fe5cC0122403f06abE2A75DBba1860Edb762985', // v2 factory\n '0x3E2b14680108E8C5C45C3ab5Bc04E01397af14cB', // v2 router 01\n '0xCc7aDc94F3D80127849D2b41b6439b7CF1eB4Ae0', // v2 router 02\n]\n\n/**\n * Returns true if any of the pairs or tokens in a trade have the given checksummed address\n * @param trade to check for the given address\n * @param checksummedAddress address to check in the pairs and tokens\n */\nfunction involvesAddress(trade: Trade, checksummedAddress: string): boolean {\n return (\n trade.route.path.some((token) => token.address === checksummedAddress) ||\n trade.route.pairs.some((pair) => pair.liquidityToken.address === checksummedAddress)\n )\n}\n\n// from the current swap inputs, compute the best trade and return it.\nexport function useDerivedSwapInfo(): {\n currencies: { [field in Field]?: Currency }\n currencyBalances: { [field in Field]?: CurrencyAmount }\n parsedAmount: CurrencyAmount | undefined\n v2Trade: Trade | undefined\n inputError?: string\n} {\n const { account } = useActiveWeb3React()\n\n const {\n independentField,\n typedValue,\n [Field.INPUT]: { currencyId: inputCurrencyId },\n [Field.OUTPUT]: { currencyId: outputCurrencyId },\n recipient,\n } = useSwapState()\n\n const inputCurrency = useCurrency(inputCurrencyId)\n const outputCurrency = useCurrency(outputCurrencyId)\n const recipientLookup = useENS(recipient ?? undefined)\n const to: string | null = (recipient === null ? account : recipientLookup.address) ?? null\n\n const relevantTokenBalances = useCurrencyBalances(account ?? undefined, [\n inputCurrency ?? undefined,\n outputCurrency ?? undefined,\n ])\n\n const isExactIn: boolean = independentField === Field.INPUT\n const parsedAmount = tryParseAmount(typedValue, (isExactIn ? inputCurrency : outputCurrency) ?? undefined)\n\n const bestTradeExactIn = useTradeExactIn(isExactIn ? parsedAmount : undefined, outputCurrency ?? undefined)\n const bestTradeExactOut = useTradeExactOut(inputCurrency ?? undefined, !isExactIn ? parsedAmount : undefined)\n\n const v2Trade = isExactIn ? bestTradeExactIn : bestTradeExactOut\n\n const currencyBalances = {\n [Field.INPUT]: relevantTokenBalances[0],\n [Field.OUTPUT]: relevantTokenBalances[1],\n }\n\n const currencies: { [field in Field]?: Currency } = {\n [Field.INPUT]: inputCurrency ?? undefined,\n [Field.OUTPUT]: outputCurrency ?? undefined,\n }\n\n let inputError: string | undefined\n if (!account) {\n inputError = 'Connect Wallet'\n }\n\n if (!parsedAmount) {\n inputError = inputError ?? 'Enter an amount'\n }\n\n if (!currencies[Field.INPUT] || !currencies[Field.OUTPUT]) {\n inputError = inputError ?? 'Select a token'\n }\n\n const formattedTo = isAddress(to)\n if (!to || !formattedTo) {\n inputError = inputError ?? 'Enter a recipient'\n } else if (\n BAD_RECIPIENT_ADDRESSES.indexOf(formattedTo) !== -1 ||\n (bestTradeExactIn && involvesAddress(bestTradeExactIn, formattedTo)) ||\n (bestTradeExactOut && involvesAddress(bestTradeExactOut, formattedTo))\n ) {\n inputError = inputError ?? 'Invalid recipient'\n }\n\n const [allowedSlippage] = useUserSlippageTolerance()\n\n const slippageAdjustedAmounts = v2Trade && allowedSlippage && computeSlippageAdjustedAmounts(v2Trade, allowedSlippage)\n\n // compare input balance to max input based on version\n const [balanceIn, amountIn] = [\n currencyBalances[Field.INPUT],\n slippageAdjustedAmounts ? slippageAdjustedAmounts[Field.INPUT] : null,\n ]\n\n if (balanceIn && amountIn && balanceIn.lessThan(amountIn)) {\n inputError = `Insufficient ${amountIn.currency.symbol} balance`\n }\n\n return {\n currencies,\n currencyBalances,\n parsedAmount,\n v2Trade: v2Trade ?? undefined,\n inputError,\n }\n}\n\nfunction parseCurrencyFromURLParameter(urlParam: any): string {\n if (typeof urlParam === 'string') {\n const valid = isAddress(urlParam)\n if (valid) return valid\n if (urlParam.toUpperCase() === 'BNB') return 'BNB'\n if (valid === false) return 'BNB'\n }\n return 'BNB' ?? ''\n}\n\nfunction parseTokenAmountURLParameter(urlParam: any): string {\n // eslint-disable-next-line no-restricted-globals\n return typeof urlParam === 'string' && !isNaN(parseFloat(urlParam)) ? urlParam : ''\n}\n\nfunction parseIndependentFieldURLParameter(urlParam: any): Field {\n return typeof urlParam === 'string' && urlParam.toLowerCase() === 'output' ? Field.OUTPUT : Field.INPUT\n}\n\nconst ENS_NAME_REGEX = /^[-a-zA-Z0-9@:%._+~#=]{1,256}\\.[a-zA-Z0-9()]{1,6}\\b([-a-zA-Z0-9()@:%_+.~#?&/=]*)?$/\nconst ADDRESS_REGEX = /^0x[a-fA-F0-9]{40}$/\nfunction validatedRecipient(recipient: any): string | null {\n if (typeof recipient !== 'string') return null\n const address = isAddress(recipient)\n if (address) return address\n if (ENS_NAME_REGEX.test(recipient)) return recipient\n if (ADDRESS_REGEX.test(recipient)) return recipient\n return null\n}\n\nexport function queryParametersToSwapState(parsedQs: ParsedQs): SwapState {\n let inputCurrency = parseCurrencyFromURLParameter(parsedQs.inputCurrency)\n let outputCurrency = parseCurrencyFromURLParameter(parsedQs.outputCurrency)\n if (inputCurrency === outputCurrency) {\n if (typeof parsedQs.outputCurrency === 'string') {\n inputCurrency = ''\n } else {\n outputCurrency = ''\n }\n }\n\n const recipient = validatedRecipient(parsedQs.recipient)\n\n return {\n [Field.INPUT]: {\n currencyId: inputCurrency,\n },\n [Field.OUTPUT]: {\n currencyId: outputCurrency,\n },\n typedValue: parseTokenAmountURLParameter(parsedQs.exactAmount),\n independentField: parseIndependentFieldURLParameter(parsedQs.exactField),\n recipient,\n }\n}\n\n// updates the swap state to use the defaults for a given network\nexport function useDefaultsFromURLSearch():\n | { inputCurrencyId: string | undefined; outputCurrencyId: string | undefined }\n | undefined {\n const { chainId } = useActiveWeb3React()\n const dispatch = useDispatch()\n const parsedQs = useParsedQueryString()\n const [result, setResult] = useState<\n { inputCurrencyId: string | undefined; outputCurrencyId: string | undefined } | undefined\n >()\n\n useEffect(() => {\n if (!chainId) return\n const parsed = queryParametersToSwapState(parsedQs)\n\n dispatch(\n replaceSwapState({\n typedValue: parsed.typedValue,\n field: parsed.independentField,\n inputCurrencyId: parsed[Field.INPUT].currencyId,\n outputCurrencyId: parsed[Field.OUTPUT].currencyId,\n recipient: parsed.recipient,\n })\n )\n\n setResult({ inputCurrencyId: parsed[Field.INPUT].currencyId, outputCurrencyId: parsed[Field.OUTPUT].currencyId })\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [dispatch, chainId])\n\n return result\n}\n","import { parse, ParsedQs } from 'qs'\nimport { useMemo } from 'react'\nimport { useLocation } from 'react-router-dom'\n\nexport default function useParsedQueryString(): ParsedQs {\n const { search } = useLocation()\n return useMemo(\n () => (search && search.length > 1 ? parse(search, { parseArrays: false, ignoreQueryPrefix: true }) : {}),\n [search]\n )\n}\n","import { Currency, CurrencyAmount, ETHER, JSBI, Pair, Percent, Price, TokenAmount } from '@pancakeswap-libs/sdk'\nimport { useCallback, useMemo } from 'react'\nimport { useDispatch, useSelector } from 'react-redux'\nimport { PairState, usePair } from '../../data/Reserves'\nimport { useTotalSupply } from '../../data/TotalSupply'\n\nimport { useActiveWeb3React } from '../../hooks'\nimport { TranslateString } from '../../utils/translateTextHelpers'\nimport { wrappedCurrency, wrappedCurrencyAmount } from '../../utils/wrappedCurrency'\nimport { AppDispatch, AppState } from '../index'\nimport { tryParseAmount } from '../swap/hooks'\nimport { useCurrencyBalances } from '../wallet/hooks'\nimport { Field, typeInput } from './actions'\n\nconst ZERO = JSBI.BigInt(0)\n\nexport function useMintState(): AppState['mint'] {\n return useSelector((state) => state.mint)\n}\n\nexport function useDerivedMintInfo(\n currencyA: Currency | undefined,\n currencyB: Currency | undefined\n): {\n dependentField: Field\n currencies: { [field in Field]?: Currency }\n pair?: Pair | null\n pairState: PairState\n currencyBalances: { [field in Field]?: CurrencyAmount }\n parsedAmounts: { [field in Field]?: CurrencyAmount }\n price?: Price\n noLiquidity?: boolean\n liquidityMinted?: TokenAmount\n poolTokenPercentage?: Percent\n error?: string\n} {\n const { account, chainId } = useActiveWeb3React()\n\n const { independentField, typedValue, otherTypedValue } = useMintState()\n\n const dependentField = independentField === Field.CURRENCY_A ? Field.CURRENCY_B : Field.CURRENCY_A\n\n // tokens\n const currencies: { [field in Field]?: Currency } = useMemo(\n () => ({\n [Field.CURRENCY_A]: currencyA ?? undefined,\n [Field.CURRENCY_B]: currencyB ?? undefined,\n }),\n [currencyA, currencyB]\n )\n\n // pair\n const [pairState, pair] = usePair(currencies[Field.CURRENCY_A], currencies[Field.CURRENCY_B])\n const totalSupply = useTotalSupply(pair?.liquidityToken)\n\n const noLiquidity: boolean =\n pairState === PairState.NOT_EXISTS || Boolean(totalSupply && JSBI.equal(totalSupply.raw, ZERO))\n\n // balances\n const balances = useCurrencyBalances(account ?? undefined, [\n currencies[Field.CURRENCY_A],\n currencies[Field.CURRENCY_B],\n ])\n const currencyBalances: { [field in Field]?: CurrencyAmount } = {\n [Field.CURRENCY_A]: balances[0],\n [Field.CURRENCY_B]: balances[1],\n }\n\n // amounts\n const independentAmount: CurrencyAmount | undefined = tryParseAmount(typedValue, currencies[independentField])\n const dependentAmount: CurrencyAmount | undefined = useMemo(() => {\n if (noLiquidity) {\n if (otherTypedValue && currencies[dependentField]) {\n return tryParseAmount(otherTypedValue, currencies[dependentField])\n }\n return undefined\n }\n if (independentAmount) {\n // we wrap the currencies just to get the price in terms of the other token\n const wrappedIndependentAmount = wrappedCurrencyAmount(independentAmount, chainId)\n const [tokenA, tokenB] = [wrappedCurrency(currencyA, chainId), wrappedCurrency(currencyB, chainId)]\n if (tokenA && tokenB && wrappedIndependentAmount && pair) {\n const dependentCurrency = dependentField === Field.CURRENCY_B ? currencyB : currencyA\n const dependentTokenAmount =\n dependentField === Field.CURRENCY_B\n ? pair.priceOf(tokenA).quote(wrappedIndependentAmount)\n : pair.priceOf(tokenB).quote(wrappedIndependentAmount)\n return dependentCurrency === ETHER ? CurrencyAmount.ether(dependentTokenAmount.raw) : dependentTokenAmount\n }\n return undefined\n }\n return undefined\n }, [noLiquidity, otherTypedValue, currencies, dependentField, independentAmount, currencyA, chainId, currencyB, pair])\n // eslint-disable-next-line react-hooks/exhaustive-deps\n const parsedAmounts: { [field in Field]: CurrencyAmount | undefined } = {\n [Field.CURRENCY_A]: independentField === Field.CURRENCY_A ? independentAmount : dependentAmount,\n [Field.CURRENCY_B]: independentField === Field.CURRENCY_A ? dependentAmount : independentAmount,\n }\n\n const price = useMemo(() => {\n if (noLiquidity) {\n const { [Field.CURRENCY_A]: currencyAAmount, [Field.CURRENCY_B]: currencyBAmount } = parsedAmounts\n if (currencyAAmount && currencyBAmount) {\n return new Price(currencyAAmount.currency, currencyBAmount.currency, currencyAAmount.raw, currencyBAmount.raw)\n }\n return undefined\n }\n const wrappedCurrencyA = wrappedCurrency(currencyA, chainId)\n return pair && wrappedCurrencyA ? pair.priceOf(wrappedCurrencyA) : undefined\n }, [chainId, currencyA, noLiquidity, pair, parsedAmounts])\n\n // liquidity minted\n const liquidityMinted = useMemo(() => {\n const { [Field.CURRENCY_A]: currencyAAmount, [Field.CURRENCY_B]: currencyBAmount } = parsedAmounts\n const [tokenAmountA, tokenAmountB] = [\n wrappedCurrencyAmount(currencyAAmount, chainId),\n wrappedCurrencyAmount(currencyBAmount, chainId),\n ]\n if (pair && totalSupply && tokenAmountA && tokenAmountB) {\n return pair.getLiquidityMinted(totalSupply, tokenAmountA, tokenAmountB)\n }\n return undefined\n }, [parsedAmounts, chainId, pair, totalSupply])\n\n const poolTokenPercentage = useMemo(() => {\n if (liquidityMinted && totalSupply) {\n return new Percent(liquidityMinted.raw, totalSupply.add(liquidityMinted).raw)\n }\n return undefined\n }, [liquidityMinted, totalSupply])\n\n let error: string | undefined\n if (!account) {\n error = 'Connect Wallet'\n }\n\n if (pairState === PairState.INVALID) {\n error = error ?? TranslateString(136, 'Invalid pair')\n }\n\n if (!parsedAmounts[Field.CURRENCY_A] || !parsedAmounts[Field.CURRENCY_B]) {\n error = error ?? TranslateString(84, 'Enter an amount')\n }\n\n const { [Field.CURRENCY_A]: currencyAAmount, [Field.CURRENCY_B]: currencyBAmount } = parsedAmounts\n\n if (currencyAAmount && currencyBalances?.[Field.CURRENCY_A]?.lessThan(currencyAAmount)) {\n error = `Insufficient ${currencies[Field.CURRENCY_A]?.symbol} balance`\n }\n\n if (currencyBAmount && currencyBalances?.[Field.CURRENCY_B]?.lessThan(currencyBAmount)) {\n error = `Insufficient ${currencies[Field.CURRENCY_B]?.symbol} balance`\n }\n\n return {\n dependentField,\n currencies,\n pair,\n pairState,\n currencyBalances,\n parsedAmounts,\n price,\n noLiquidity,\n liquidityMinted,\n poolTokenPercentage,\n error,\n }\n}\n\nexport function useMintActionHandlers(\n noLiquidity: boolean | undefined\n): {\n onFieldAInput: (typedValue: string) => void\n onFieldBInput: (typedValue: string) => void\n} {\n const dispatch = useDispatch()\n\n const onFieldAInput = useCallback(\n (typedValue: string) => {\n dispatch(typeInput({ field: Field.CURRENCY_A, typedValue, noLiquidity: noLiquidity === true }))\n },\n [dispatch, noLiquidity]\n )\n const onFieldBInput = useCallback(\n (typedValue: string) => {\n dispatch(typeInput({ field: Field.CURRENCY_B, typedValue, noLiquidity: noLiquidity === true }))\n },\n [dispatch, noLiquidity]\n )\n\n return {\n onFieldAInput,\n onFieldBInput,\n }\n}\n","import { CurrencyAmount, ETHER, JSBI } from '@pancakeswap-libs/sdk'\nimport { MIN_ETH } from '../constants'\n\n/**\n * Given some token amount, return the max that can be spent of it\n * @param currencyAmount to return max of\n */\nexport function maxAmountSpend(currencyAmount?: CurrencyAmount): CurrencyAmount | undefined {\n if (!currencyAmount) return undefined\n if (currencyAmount.currency === ETHER) {\n if (JSBI.greaterThan(currencyAmount.raw, MIN_ETH)) {\n return CurrencyAmount.ether(JSBI.subtract(currencyAmount.raw, MIN_ETH))\n }\n return CurrencyAmount.ether(JSBI.BigInt(0))\n }\n return currencyAmount\n}\n\nexport default maxAmountSpend\n","import styled from 'styled-components'\n\nconst Pane = styled.div`\n border: 2px solid ${({ theme }) => theme.colors.borderColor};\n border-radius: 16px;\n padding: 16px;\n`\n\nexport default Pane\n","/* eslint-disable no-param-reassign */\nimport { Toast } from '@pancakeswap-libs/uikit'\nimport { createSlice, PayloadAction } from '@reduxjs/toolkit'\n\nconst initialState: ToastsState = {\n data: [],\n}\n\nexport interface ToastsState {\n data: Toast[]\n}\n\nexport const toastsSlice = createSlice({\n name: 'toasts',\n initialState,\n reducers: {\n push: (state: ToastsState, action: PayloadAction) => {\n const { payload } = action\n const toastIndex = state.data.findIndex((toast) => toast.id === action.payload.id)\n\n // If id already matches remove it before adding it to the top of the stack\n if (toastIndex >= 0) {\n state.data.splice(toastIndex, 1)\n }\n\n state.data.unshift(payload)\n },\n remove: (state: ToastsState, action: PayloadAction) => {\n const toastIndex = state.data.findIndex((toast) => toast.id === action.payload)\n\n if (toastIndex >= 0) {\n state.data.splice(toastIndex, 1)\n }\n },\n clear: (state: ToastsState) => {\n state.data = []\n },\n },\n})\n\n// Actions\nexport const { clear, remove, push } = toastsSlice.actions\n\nexport default toastsSlice.reducer\n","import { useMemo } from 'react'\nimport { kebabCase } from 'lodash'\nimport { Toast, toastTypes } from '@pancakeswap-libs/uikit'\nimport { useDispatch } from 'react-redux'\n\nimport {\n push as pushToast,\n remove as removeToast,\n clear as clearToast\n} from 'state/actions'\n\n// Toasts\nconst useToast = () => {\n const dispatch = useDispatch()\n const helpers = useMemo(() => {\n const push = (toast: Toast) => dispatch(pushToast(toast))\n\n return {\n toastError: (title: string, description?: string) => {\n return push({ id: kebabCase(title), type: toastTypes.DANGER, title, description })\n },\n toastInfo: (title: string, description?: string) => {\n return push({ id: kebabCase(title), type: toastTypes.INFO, title, description })\n },\n toastSuccess: (title: string, description?: string) => {\n return push({ id: kebabCase(title), type: toastTypes.SUCCESS, title, description })\n },\n toastWarning: (title: string, description?: string) => {\n return push({ id: kebabCase(title), type: toastTypes.WARNING, title, description })\n },\n push,\n remove: (id: string) => dispatch(removeToast(id)),\n clear: () => dispatch(clearToast()),\n }\n }, [dispatch])\n\n return helpers\n}\n\nexport default useToast","import { useCallback } from 'react'\nimport { useWeb3React, UnsupportedChainIdError } from '@web3-react/core'\nimport { NoBscProviderError } from '@binance-chain/bsc-connector'\nimport {\n NoEthereumProviderError,\n UserRejectedRequestError as UserRejectedRequestErrorInjected,\n} from '@web3-react/injected-connector'\nimport {\n UserRejectedRequestError as UserRejectedRequestErrorWalletConnect,\n WalletConnectConnector,\n} from '@web3-react/walletconnect-connector'\nimport { connectorLocalStorageKey, ConnectorNames } from '@pancakeswap-libs/uikit'\nimport useToast from 'hooks/useToast'\nimport { connectorsByName } from 'connectors'\n\nconst useAuth = () => {\n const { activate, deactivate } = useWeb3React()\n const { toastError } = useToast()\n\n const login = useCallback((connectorID: ConnectorNames) => {\n const connector = connectorsByName[connectorID]\n if (connector) {\n activate(connector, async (error: Error) => {\n window.localStorage.removeItem(connectorLocalStorageKey)\n if (error instanceof UnsupportedChainIdError) {\n toastError('Unsupported Chain Id', 'Unsupported Chain Id Error. Check your chain Id.')\n } else if (error instanceof NoEthereumProviderError || error instanceof NoBscProviderError) {\n toastError('Provider Error', 'No provider was found')\n } else if (\n error instanceof UserRejectedRequestErrorInjected ||\n error instanceof UserRejectedRequestErrorWalletConnect\n ) {\n if (connector instanceof WalletConnectConnector) {\n const walletConnector = connector as WalletConnectConnector\n walletConnector.walletConnectProvider = null\n }\n toastError('Authorization Error', 'Please authorize to access your account')\n } else {\n toastError(error.name, error.message)\n }\n })\n } else {\n toastError(\"Can't find connector\", 'The connector config is wrong')\n }\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [])\n\n return { login, logout: deactivate }\n}\n\nexport default useAuth\n","import React from 'react'\nimport { Button, ButtonProps, useWalletModal} from '@pancakeswap-libs/uikit'\nimport useI18n from 'hooks/useI18n'\nimport useAuth from 'hooks/useAuth'\n\nconst UnlockButton: React.FC = (props) => {\n const TranslateString = useI18n()\n const { login, logout } = useAuth()\n const { onPresentConnectModal } = useWalletModal(login, logout)\n\n return (\n \n )\n}\n\nexport default UnlockButton\n","import React from 'react'\nimport styled from 'styled-components'\nimport { Card } from '@pancakeswap-libs/uikit'\n\nexport const BodyWrapper = styled(Card)`\n position: relative;\n max-width: 436px;\n width: 100%;\n z-index: 5;\n`\n\n/**\n * The styled container element that wraps the content of most pages and the tabs.\n */\nexport default function AppBody({ children }: { children: React.ReactNode }) {\n return {children}\n}\n","import { Text } from '@pancakeswap-libs/uikit'\nimport styled from 'styled-components'\n\nexport const Wrapper = styled.div`\n position: relative;\n`\n\nexport const ClickableText = styled(Text)`\n :hover {\n cursor: pointer;\n }\n color: ${({ theme }) => theme.colors.primary};\n`\n\nexport const Dots = styled.span`\n &::after {\n display: inline-block;\n animation: ellipsis 1.25s infinite;\n content: '.';\n width: 1em;\n text-align: left;\n }\n @keyframes ellipsis {\n 0% {\n content: '.';\n }\n 33% {\n content: '..';\n }\n 66% {\n content: '...';\n }\n }\n`\n","import { Currency, CurrencyAmount, Fraction, Percent } from '@pancakeswap-libs/sdk'\nimport React from 'react'\nimport { Button, Text } from '@pancakeswap-libs/uikit'\nimport { TranslateString } from 'utils/translateTextHelpers'\nimport { RowBetween, RowFixed } from '../../components/Row'\nimport CurrencyLogo from '../../components/CurrencyLogo'\nimport { Field } from '../../state/mint/actions'\n\nexport function ConfirmAddModalBottom({\n noLiquidity,\n price,\n currencies,\n parsedAmounts,\n poolTokenPercentage,\n onAdd,\n}: {\n noLiquidity?: boolean\n price?: Fraction\n currencies: { [field in Field]?: Currency }\n parsedAmounts: { [field in Field]?: CurrencyAmount }\n poolTokenPercentage?: Percent\n onAdd: () => void\n}) {\n return (\n <>\n \n {currencies[Field.CURRENCY_A]?.symbol} Deposited\n \n \n {parsedAmounts[Field.CURRENCY_A]?.toSignificant(6)}\n \n \n \n {currencies[Field.CURRENCY_B]?.symbol} Deposited\n \n \n {parsedAmounts[Field.CURRENCY_B]?.toSignificant(6)}\n \n \n \n Rates\n \n {`1 ${currencies[Field.CURRENCY_A]?.symbol} = ${price?.toSignificant(4)} ${\n currencies[Field.CURRENCY_B]?.symbol\n }`}\n \n \n \n \n {`1 ${currencies[Field.CURRENCY_B]?.symbol} = ${price?.invert().toSignificant(4)} ${\n currencies[Field.CURRENCY_A]?.symbol\n }`}\n \n \n \n Share of Pool:\n {noLiquidity ? '100' : poolTokenPercentage?.toSignificant(4)}%\n \n \n \n )\n}\n\nexport default ConfirmAddModalBottom\n","import React from 'react'\nimport { Currency, Percent, Price } from '@pancakeswap-libs/sdk'\nimport { Text } from '@pancakeswap-libs/uikit'\nimport { AutoColumn } from '../../components/Column'\nimport { AutoRow } from '../../components/Row'\nimport { ONE_BIPS } from '../../constants'\nimport { Field } from '../../state/mint/actions'\n\nexport function PoolPriceBar({\n currencies,\n noLiquidity,\n poolTokenPercentage,\n price,\n}: {\n currencies: { [field in Field]?: Currency }\n noLiquidity?: boolean\n poolTokenPercentage?: Percent\n price?: Price\n}) {\n return (\n \n \n \n {price?.toSignificant(6) ?? '-'}\n \n {currencies[Field.CURRENCY_B]?.symbol} per {currencies[Field.CURRENCY_A]?.symbol}\n \n \n \n {price?.invert()?.toSignificant(6) ?? '-'}\n \n {currencies[Field.CURRENCY_A]?.symbol} per {currencies[Field.CURRENCY_B]?.symbol}\n \n \n \n \n {noLiquidity && price\n ? '100'\n : (poolTokenPercentage?.lessThan(ONE_BIPS) ? '<0.01' : poolTokenPercentage?.toFixed(2)) ?? '0'}\n %\n \n \n Share of Pool\n \n \n \n \n )\n}\n\nexport default PoolPriceBar\n","import React, { useCallback, useState } from 'react'\nimport { BigNumber } from '@ethersproject/bignumber'\nimport { TransactionResponse } from '@ethersproject/providers'\nimport { Currency, currencyEquals, ETHER, TokenAmount, WETH } from '@pancakeswap-libs/sdk'\nimport { Button, CardBody, AddIcon, Text as UIKitText } from '@pancakeswap-libs/uikit'\nimport { RouteComponentProps } from 'react-router-dom'\nimport { LightCard } from 'components/Card'\nimport { AutoColumn, ColumnCenter } from 'components/Column'\nimport TransactionConfirmationModal, { ConfirmationModalContent } from 'components/TransactionConfirmationModal'\nimport CardNav from 'components/CardNav'\nimport CurrencyInputPanel from 'components/CurrencyInputPanel'\nimport DoubleCurrencyLogo from 'components/DoubleLogo'\nimport { AddRemoveTabs } from 'components/NavigationTabs'\nimport { MinimalPositionCard } from 'components/PositionCard'\nimport Row, { RowBetween, RowFlat } from 'components/Row'\n\nimport { PairState } from 'data/Reserves'\nimport { useActiveWeb3React } from 'hooks'\nimport { useCurrency } from 'hooks/Tokens'\nimport { ApprovalState, useApproveCallback } from 'hooks/useApproveCallback'\nimport { Field } from 'state/mint/actions'\nimport { useDerivedMintInfo, useMintActionHandlers, useMintState } from 'state/mint/hooks'\n\nimport { useTransactionAdder } from 'state/transactions/hooks'\nimport { useIsExpertMode, useUserDeadline, useUserSlippageTolerance } from 'state/user/hooks'\nimport { calculateGasMargin, calculateSlippageAmount, getRouterContract } from 'utils'\nimport { maxAmountSpend } from 'utils/maxAmountSpend'\nimport { wrappedCurrency } from 'utils/wrappedCurrency'\nimport { currencyId } from 'utils/currencyId'\nimport Pane from 'components/Pane'\nimport ConnectWalletButton from 'components/ConnectWalletButton'\nimport useI18n from 'hooks/useI18n'\nimport AppBody from '../AppBody'\nimport { Dots, Wrapper } from '../Pool/styleds'\nimport { ConfirmAddModalBottom } from './ConfirmAddModalBottom'\nimport { PoolPriceBar } from './PoolPriceBar'\nimport { ROUTER_ADDRESS } from '../../constants'\n\nexport default function AddLiquidity({\n match: {\n params: { currencyIdA, currencyIdB },\n },\n history,\n}: RouteComponentProps<{ currencyIdA?: string; currencyIdB?: string }>) {\n const { account, chainId, library } = useActiveWeb3React()\n const currencyA = useCurrency(currencyIdA)\n const currencyB = useCurrency(currencyIdB)\n const TranslateString = useI18n()\n\n const oneCurrencyIsWBNB = Boolean(\n chainId &&\n ((currencyA && currencyEquals(currencyA, WETH[chainId])) ||\n (currencyB && currencyEquals(currencyB, WETH[chainId])))\n )\n const expertMode = useIsExpertMode()\n\n // mint state\n const { independentField, typedValue, otherTypedValue } = useMintState()\n const {\n dependentField,\n currencies,\n pair,\n pairState,\n currencyBalances,\n parsedAmounts,\n price,\n noLiquidity,\n liquidityMinted,\n poolTokenPercentage,\n error,\n } = useDerivedMintInfo(currencyA ?? undefined, currencyB ?? undefined)\n const { onFieldAInput, onFieldBInput } = useMintActionHandlers(noLiquidity)\n\n const isValid = !error\n\n // modal and loading\n const [showConfirm, setShowConfirm] = useState(false)\n const [attemptingTxn, setAttemptingTxn] = useState(false) // clicked confirm\n\n // txn values\n const [deadline] = useUserDeadline() // custom from users settings\n const [allowedSlippage] = useUserSlippageTolerance() // custom from users\n const [txHash, setTxHash] = useState('')\n\n // get formatted amounts\n const formattedAmounts = {\n [independentField]: typedValue,\n [dependentField]: noLiquidity ? otherTypedValue : parsedAmounts[dependentField]?.toSignificant(6) ?? '',\n }\n\n // get the max amounts user can add\n const maxAmounts: { [field in Field]?: TokenAmount } = [Field.CURRENCY_A, Field.CURRENCY_B].reduce(\n (accumulator, field) => {\n return {\n ...accumulator,\n [field]: maxAmountSpend(currencyBalances[field]),\n }\n },\n {}\n )\n\n const atMaxAmounts: { [field in Field]?: TokenAmount } = [Field.CURRENCY_A, Field.CURRENCY_B].reduce(\n (accumulator, field) => {\n return {\n ...accumulator,\n [field]: maxAmounts[field]?.equalTo(parsedAmounts[field] ?? '0'),\n }\n },\n {}\n )\n\n // check whether the user has approved the router on the tokens\n const [approvalA, approveACallback] = useApproveCallback(parsedAmounts[Field.CURRENCY_A], ROUTER_ADDRESS)\n const [approvalB, approveBCallback] = useApproveCallback(parsedAmounts[Field.CURRENCY_B], ROUTER_ADDRESS)\n\n const addTransaction = useTransactionAdder()\n\n async function onAdd() {\n if (!chainId || !library || !account) return\n const router = getRouterContract(chainId, library, account)\n\n const { [Field.CURRENCY_A]: parsedAmountA, [Field.CURRENCY_B]: parsedAmountB } = parsedAmounts\n if (!parsedAmountA || !parsedAmountB || !currencyA || !currencyB) {\n return\n }\n\n const amountsMin = {\n [Field.CURRENCY_A]: calculateSlippageAmount(parsedAmountA, noLiquidity ? 0 : allowedSlippage)[0],\n [Field.CURRENCY_B]: calculateSlippageAmount(parsedAmountB, noLiquidity ? 0 : allowedSlippage)[0],\n }\n\n const deadlineFromNow = Math.ceil(Date.now() / 1000) + deadline\n\n let estimate\n let method: (...args: any) => Promise\n let args: Array\n let value: BigNumber | null\n if (currencyA === ETHER || currencyB === ETHER) {\n const tokenBIsBNB = currencyB === ETHER\n estimate = router.estimateGas.addLiquidityETH\n method = router.addLiquidityETH\n args = [\n wrappedCurrency(tokenBIsBNB ? currencyA : currencyB, chainId)?.address ?? '', // token\n (tokenBIsBNB ? parsedAmountA : parsedAmountB).raw.toString(), // token desired\n amountsMin[tokenBIsBNB ? Field.CURRENCY_A : Field.CURRENCY_B].toString(), // token min\n amountsMin[tokenBIsBNB ? Field.CURRENCY_B : Field.CURRENCY_A].toString(), // eth min\n account,\n deadlineFromNow,\n ]\n value = BigNumber.from((tokenBIsBNB ? parsedAmountB : parsedAmountA).raw.toString())\n } else {\n estimate = router.estimateGas.addLiquidity\n method = router.addLiquidity\n args = [\n wrappedCurrency(currencyA, chainId)?.address ?? '',\n wrappedCurrency(currencyB, chainId)?.address ?? '',\n parsedAmountA.raw.toString(),\n parsedAmountB.raw.toString(),\n amountsMin[Field.CURRENCY_A].toString(),\n amountsMin[Field.CURRENCY_B].toString(),\n account,\n deadlineFromNow,\n ]\n value = null\n }\n\n setAttemptingTxn(true)\n // const aa = await estimate(...args, value ? { value } : {})\n await estimate(...args, value ? { value } : {})\n .then((estimatedGasLimit) =>\n method(...args, {\n ...(value ? { value } : {}),\n gasLimit: calculateGasMargin(estimatedGasLimit),\n }).then((response) => {\n setAttemptingTxn(false)\n\n addTransaction(response, {\n summary: `Add ${parsedAmounts[Field.CURRENCY_A]?.toSignificant(3)} ${\n currencies[Field.CURRENCY_A]?.symbol\n } and ${parsedAmounts[Field.CURRENCY_B]?.toSignificant(3)} ${currencies[Field.CURRENCY_B]?.symbol}`,\n })\n\n setTxHash(response.hash)\n })\n )\n .catch((e) => {\n setAttemptingTxn(false)\n // we only care if the error is something _other_ than the user rejected the tx\n if (e?.code !== 4001) {\n console.error(e)\n }\n })\n }\n\n const modalHeader = () => {\n return noLiquidity ? (\n \n \n \n \n {`${currencies[Field.CURRENCY_A]?.symbol}/${currencies[Field.CURRENCY_B]?.symbol}`}\n \n \n \n \n \n ) : (\n \n \n \n {liquidityMinted?.toSignificant(6)}\n \n \n \n \n \n {`${currencies[Field.CURRENCY_A]?.symbol}/${currencies[Field.CURRENCY_B]?.symbol} Pool Tokens`}\n \n \n \n {`Output is estimated. If the price changes by more than ${\n allowedSlippage / 100\n }% your transaction will revert.`}\n \n \n )\n }\n\n const modalBottom = () => {\n return (\n \n )\n }\n\n const pendingText = `Supplying ${parsedAmounts[Field.CURRENCY_A]?.toSignificant(6)} ${\n currencies[Field.CURRENCY_A]?.symbol\n } and ${parsedAmounts[Field.CURRENCY_B]?.toSignificant(6)} ${currencies[Field.CURRENCY_B]?.symbol}`\n\n const handleCurrencyASelect = useCallback(\n (currA: Currency) => {\n const newCurrencyIdA = currencyId(currA)\n if (newCurrencyIdA === currencyIdB) {\n history.push(`/add/${currencyIdB}/${currencyIdA}`)\n } else {\n history.push(`/add/${newCurrencyIdA}/${currencyIdB}`)\n }\n },\n [currencyIdB, history, currencyIdA]\n )\n const handleCurrencyBSelect = useCallback(\n (currB: Currency) => {\n const newCurrencyIdB = currencyId(currB)\n if (currencyIdA === newCurrencyIdB) {\n if (currencyIdB) {\n history.push(`/add/${currencyIdB}/${newCurrencyIdB}`)\n } else {\n history.push(`/add/${newCurrencyIdB}`)\n }\n } else {\n history.push(`/add/${currencyIdA || 'BNB'}/${newCurrencyIdB}`)\n }\n },\n [currencyIdA, history, currencyIdB]\n )\n\n const handleDismissConfirmation = useCallback(() => {\n setShowConfirm(false)\n // if there was a tx hash, we want to clear the input\n if (txHash) {\n onFieldAInput('')\n }\n setTxHash('')\n }, [onFieldAInput, txHash])\n\n return (\n <>\n \n \n \n \n (\n \n )}\n pendingText={pendingText}\n />\n \n \n {noLiquidity && (\n \n \n \n {TranslateString(1158, 'You are the first liquidity provider.')}\n \n {TranslateString(1160, 'The ratio of tokens you add will set the price of this pool.')}\n \n \n {TranslateString(1162, 'Once you are happy with the rate click supply to review.')}\n \n \n \n \n )}\n {\n onFieldAInput(maxAmounts[Field.CURRENCY_A]?.toExact() ?? '')\n }}\n onCurrencySelect={handleCurrencyASelect}\n showMaxButton={!atMaxAmounts[Field.CURRENCY_A]}\n currency={currencies[Field.CURRENCY_A]}\n id=\"add-liquidity-input-tokena\"\n showCommonBases={false}\n />\n \n \n \n {\n onFieldBInput(maxAmounts[Field.CURRENCY_B]?.toExact() ?? '')\n }}\n showMaxButton={!atMaxAmounts[Field.CURRENCY_B]}\n currency={currencies[Field.CURRENCY_B]}\n id=\"add-liquidity-input-tokenb\"\n showCommonBases={false}\n />\n {currencies[Field.CURRENCY_A] && currencies[Field.CURRENCY_B] && pairState !== PairState.INVALID && (\n
\n \n {noLiquidity\n ? TranslateString(1164, 'Initial prices and pool share')\n : TranslateString(1166, 'Prices and pool share')}\n \n \n \n \n
\n )}\n\n {!account ? (\n \n ) : (\n \n {(approvalA === ApprovalState.NOT_APPROVED ||\n approvalA === ApprovalState.PENDING ||\n approvalB === ApprovalState.NOT_APPROVED ||\n approvalB === ApprovalState.PENDING) &&\n isValid && (\n \n {approvalA !== ApprovalState.APPROVED && (\n \n {approvalA === ApprovalState.PENDING ? (\n Approving {currencies[Field.CURRENCY_A]?.symbol}\n ) : (\n `Approve ${currencies[Field.CURRENCY_A]?.symbol}`\n )}\n \n )}\n {approvalB !== ApprovalState.APPROVED && (\n \n {approvalB === ApprovalState.PENDING ? (\n Approving {currencies[Field.CURRENCY_B]?.symbol}\n ) : (\n `Approve ${currencies[Field.CURRENCY_B]?.symbol}`\n )}\n \n )}\n \n )}\n {\n if (expertMode) {\n onAdd()\n } else {\n setShowConfirm(true)\n }\n }}\n disabled={!isValid || approvalA !== ApprovalState.APPROVED || approvalB !== ApprovalState.APPROVED}\n variant={\n !isValid && !!parsedAmounts[Field.CURRENCY_A] && !!parsedAmounts[Field.CURRENCY_B]\n ? 'danger'\n : 'primary'\n }\n width=\"100%\"\n >\n {error ?? 'Supply'}\n \n \n )}\n
\n
\n
\n
\n {pair && !noLiquidity && pairState !== PairState.INVALID ? (\n \n \n \n ) : null}\n \n )\n}\n","import React from 'react'\nimport { Redirect, RouteComponentProps } from 'react-router-dom'\nimport AddLiquidity from './index'\n\nconst OLD_PATH_STRUCTURE = /^(0x[a-fA-F0-9]{40})-(0x[a-fA-F0-9]{40})$/\nexport function RedirectOldAddLiquidityPathStructure(props: RouteComponentProps<{ currencyIdA: string }>) {\n const {\n match: {\n params: { currencyIdA },\n },\n } = props\n const match = currencyIdA.match(OLD_PATH_STRUCTURE)\n if (match?.length) {\n return \n }\n\n return \n}\n\nexport function RedirectDuplicateTokenIds(props: RouteComponentProps<{ currencyIdA: string; currencyIdB: string }>) {\n const {\n match: {\n params: { currencyIdA, currencyIdB },\n },\n } = props\n if (currencyIdA.toLowerCase() === currencyIdB.toLowerCase()) {\n return \n }\n return \n}\n","import React from 'react'\nimport { RouteComponentProps, Redirect } from 'react-router-dom'\n\nconst OLD_PATH_STRUCTURE = /^(0x[a-fA-F0-9]{40})-(0x[a-fA-F0-9]{40})$/\n\nexport function RedirectOldRemoveLiquidityPathStructure({\n match: {\n params: { tokens },\n },\n}: RouteComponentProps<{ tokens: string }>) {\n if (!OLD_PATH_STRUCTURE.test(tokens)) {\n return \n }\n const [currency0, currency1] = tokens.split('-')\n\n return \n}\n\nexport default RedirectOldRemoveLiquidityPathStructure\n","import React, { useEffect, useState } from 'react'\nimport styled from 'styled-components'\nimport { Box, Button, Flex, Input, Text } from '@pancakeswap-libs/uikit'\nimport { useUserSlippageTolerance } from 'state/user/hooks'\nimport QuestionHelper from '../QuestionHelper'\n\nconst MAX_SLIPPAGE = 5000\nconst RISKY_SLIPPAGE_LOW = 50\nconst RISKY_SLIPPAGE_HIGH = 500\n\nconst Option = styled.div`\n padding: 0 4px;\n`\n\nconst Options = styled.div`\n align-items: center;\n display: flex;\n flex-direction: column;\n\n ${Option}:first-child {\n padding-left: 0;\n }\n\n ${Option}:last-child {\n padding-right: 0;\n }\n\n ${({ theme }) => theme.mediaQueries.sm} {\n flex-direction: row;\n }\n`\n\nconst predefinedValues = [\n { label: '0.1%', value: 0.1 },\n { label: '0.5%', value: 0.5 },\n { label: '1%', value: 1 },\n]\n\ntype SlippageToleranceSettingsModalProps = {\n translateString: (translationId: number, fallback: string) => string\n}\n\nconst SlippageToleranceSettings = ({ translateString }: SlippageToleranceSettingsModalProps) => {\n const [userSlippageTolerance, setUserslippageTolerance] = useUserSlippageTolerance()\n const [value, setValue] = useState(userSlippageTolerance / 100)\n const [error, setError] = useState(null)\n const handleChange = (evt: React.ChangeEvent) => {\n const { value: inputValue } = evt.target\n setValue(parseFloat(inputValue))\n }\n\n // Updates local storage if value is valid\n useEffect(() => {\n try {\n const rawValue = value * 100\n if (!Number.isNaN(rawValue) && rawValue > 0 && rawValue < MAX_SLIPPAGE) {\n setUserslippageTolerance(rawValue)\n setError(null)\n } else {\n setError(translateString(1144, 'Enter a valid slippage percentage'))\n }\n } catch {\n setError(translateString(1144, 'Enter a valid slippage percentage'))\n }\n }, [value, setError, setUserslippageTolerance, translateString])\n\n // Notify user if slippage is risky\n useEffect(() => {\n if (userSlippageTolerance < RISKY_SLIPPAGE_LOW) {\n setError(translateString(1146, 'Your transaction may fail'))\n } else if (userSlippageTolerance > RISKY_SLIPPAGE_HIGH) {\n setError(translateString(1148, 'Your transaction may be frontrun'))\n }\n }, [userSlippageTolerance, setError, translateString])\n\n return (\n \n \n {translateString(88, 'Slippage tolerance')}\n \n \n \n \n {predefinedValues.map(({ label, value: predefinedValue }) => {\n const handleClick = () => setValue(predefinedValue)\n\n return (\n \n )\n })}\n \n \n \n \n \n \n {error && (\n \n {error}\n \n )}\n \n )\n}\n\nexport default SlippageToleranceSettings\n","import React, { useEffect, useState } from 'react'\nimport styled from 'styled-components'\nimport { Input, Text, Flex, Box } from '@pancakeswap-libs/uikit'\nimport { useUserDeadline } from 'state/user/hooks'\nimport QuestionHelper from '../QuestionHelper'\n\nconst Field = styled.div`\n align-items: center;\n display: inline-flex;\n\n & > ${Input} {\n max-width: 100px;\n }\n`\n\ntype TransactionDeadlineSettingModalProps = {\n translateString: (translationId: number, fallback: string) => string\n}\n\nconst TransactionDeadlineSetting = ({ translateString }: TransactionDeadlineSettingModalProps) => {\n const [deadline, setDeadline] = useUserDeadline()\n const [value, setValue] = useState(deadline / 60) // deadline in minutes\n const [error, setError] = useState(null)\n\n const handleChange = (evt: React.ChangeEvent) => {\n const { value: inputValue } = evt.target\n setValue(parseInt(inputValue, 10))\n }\n\n // Updates local storage if value is valid\n useEffect(() => {\n try {\n const rawValue = value * 60\n if (!Number.isNaN(rawValue) && rawValue > 0) {\n setDeadline(rawValue)\n setError(null)\n } else {\n setError(translateString(1150, 'Enter a valid deadline'))\n }\n } catch {\n setError(translateString(1150, 'Enter a valid deadline'))\n }\n }, [value, setError, setDeadline, translateString])\n\n return (\n \n \n {translateString(90, 'Transaction deadline')}\n \n \n \n \n \n Minutes\n \n \n {error && (\n \n {error}\n \n )}\n \n )\n}\n\nexport default TransactionDeadlineSetting\n","import React from 'react'\nimport { Box, Flex, Text, PancakeToggle, useMatchBreakpoints } from '@pancakeswap-libs/uikit'\nimport { useAudioModeManager } from 'state/user/hooks'\n\ntype AudioSettingModalProps = {\n translateString: (translationId: number, fallback: string) => string\n}\n\nconst AudioSetting = ({ translateString }: AudioSettingModalProps) => {\n const { isSm, isXs } = useMatchBreakpoints()\n const [audioPlay, toggleSetAudioMode] = useAudioModeManager()\n\n return (\n \n \n {translateString(999, 'Audio')}\n \n \n \n \n \n )\n}\n\nexport default AudioSetting\n","import React from 'react'\nimport { Modal } from '@pancakeswap-libs/uikit'\nimport SlippageToleranceSetting from './SlippageToleranceSetting'\nimport TransactionDeadlineSetting from './TransactionDeadlineSetting'\nimport AudioSetting from './AudioSetting'\n\ntype SettingsModalProps = {\n onDismiss?: () => void\n translateString: (translationId: number, fallback: string) => string\n}\n\n// TODO: Fix UI Kit typings\nconst defaultOnDismiss = () => null\n\nconst SettingsModal = ({ onDismiss = defaultOnDismiss, translateString }: SettingsModalProps) => {\n return (\n \n \n \n \n \n )\n}\n\nexport default SettingsModal\n","import React, { useMemo } from 'react'\nimport { CheckmarkCircleIcon, ErrorIcon, Flex, LinkExternal, Text, Modal, Button } from '@pancakeswap-libs/uikit'\nimport { useActiveWeb3React } from 'hooks'\nimport { getBscScanLink } from 'utils'\nimport { isTransactionRecent, useAllTransactions } from 'state/transactions/hooks'\nimport { TransactionDetails } from 'state/transactions/reducer'\nimport Loader from 'components/Loader'\n\ntype RecentTransactionsModalProps = {\n onDismiss?: () => void\n translateString: (translationId: number, fallback: string) => string\n}\n\n// TODO: Fix UI Kit typings\nconst defaultOnDismiss = () => null\n\nconst newTransactionsFirst = (a: TransactionDetails, b: TransactionDetails) => b.addedTime - a.addedTime\n\nconst getRowStatus = (sortedRecentTransaction: TransactionDetails) => {\n const { hash, receipt } = sortedRecentTransaction\n\n if (!hash) {\n return { icon: , color: 'text' }\n }\n\n if (hash && receipt?.status === 1) {\n return { icon: , color: 'success' }\n }\n\n return { icon: , color: 'failure' }\n}\n\nconst RecentTransactionsModal = ({ onDismiss = defaultOnDismiss, translateString }: RecentTransactionsModalProps) => {\n const { account, chainId } = useActiveWeb3React()\n const allTransactions = useAllTransactions()\n\n // Logic taken from Web3Status/index.tsx line 175\n const sortedRecentTransactions = useMemo(() => {\n const txs = Object.values(allTransactions)\n return txs.filter(isTransactionRecent).sort(newTransactionsFirst)\n }, [allTransactions])\n\n return (\n \n {!account && (\n \n \n Please connect your wallet to view your recent transactions\n \n \n \n )}\n {account && chainId && sortedRecentTransactions.length === 0 && (\n \n \n No recent transactions\n \n \n \n )}\n {account &&\n chainId &&\n sortedRecentTransactions.map((sortedRecentTransaction) => {\n const { hash, summary } = sortedRecentTransaction\n const { icon, color } = getRowStatus(sortedRecentTransaction)\n\n return (\n <>\n \n \n {summary ?? hash}\n \n {icon}\n \n \n )\n })}\n \n )\n}\n\nexport default RecentTransactionsModal\n","import React, { ReactNode } from 'react'\nimport styled from 'styled-components'\nimport { Heading, IconButton, Text, Flex, useModal, TuneIcon, HistoryIcon } from '@pancakeswap-libs/uikit'\nimport useI18n from 'hooks/useI18n'\nimport SettingsModal from './SettingsModal'\nimport RecentTransactionsModal from './RecentTransactionsModal'\n\ninterface PageHeaderProps {\n title: ReactNode\n description?: ReactNode\n children?: ReactNode\n}\n\nconst StyledPageHeader = styled.div`\n border-bottom: 1px solid ${({ theme }) => theme.colors.borderColor};\n padding: 24px;\n`\n\nconst Details = styled.div`\n flex: 1;\n`\n\nconst PageHeader = ({ title, description, children }: PageHeaderProps) => {\n const TranslateString = useI18n()\n const [onPresentSettings] = useModal()\n const [onPresentRecentTransactions] = useModal()\n\n return (\n \n \n
\n {title}\n {description && (\n \n {description}\n \n )}\n
\n \n \n \n \n \n \n
\n {children && {children}}\n
\n )\n}\n\nexport default PageHeader\n","import { Currency, ETHER, JSBI, TokenAmount } from '@pancakeswap-libs/sdk'\nimport React, { useCallback, useEffect, useState } from 'react'\nimport { Button, ChevronDownIcon, AddIcon, CardBody, Text } from '@pancakeswap-libs/uikit'\nimport CardNav from 'components/CardNav'\nimport { LightCard } from 'components/Card'\nimport { AutoColumn, ColumnCenter } from 'components/Column'\nimport CurrencyLogo from 'components/CurrencyLogo'\nimport { FindPoolTabs } from 'components/NavigationTabs'\nimport { MinimalPositionCard } from 'components/PositionCard'\nimport CurrencySearchModal from 'components/SearchModal/CurrencySearchModal'\nimport { PairState, usePair } from 'data/Reserves'\nimport { useActiveWeb3React } from 'hooks'\nimport { usePairAdder } from 'state/user/hooks'\nimport { useTokenBalance } from 'state/wallet/hooks'\nimport { StyledInternalLink } from 'components/Shared'\nimport { currencyId } from 'utils/currencyId'\nimport useI18n from 'hooks/useI18n'\nimport AppBody from '../AppBody'\nimport { Dots } from '../Pool/styleds'\n\nenum Fields {\n TOKEN0 = 0,\n TOKEN1 = 1,\n}\n\nexport default function PoolFinder() {\n const { account } = useActiveWeb3React()\n\n const [showSearch, setShowSearch] = useState(false)\n const [activeField, setActiveField] = useState(Fields.TOKEN1)\n\n const [currency0, setCurrency0] = useState(ETHER)\n const [currency1, setCurrency1] = useState(null)\n\n const [pairState, pair] = usePair(currency0 ?? undefined, currency1 ?? undefined)\n const addPair = usePairAdder()\n\n const TranslateString = useI18n()\n useEffect(() => {\n if (pair) {\n addPair(pair)\n }\n }, [pair, addPair])\n\n const validPairNoLiquidity: boolean =\n pairState === PairState.NOT_EXISTS ||\n Boolean(\n pairState === PairState.EXISTS &&\n pair &&\n JSBI.equal(pair.reserve0.raw, JSBI.BigInt(0)) &&\n JSBI.equal(pair.reserve1.raw, JSBI.BigInt(0))\n )\n\n const position: TokenAmount | undefined = useTokenBalance(account ?? undefined, pair?.liquidityToken)\n const hasPosition = Boolean(position && JSBI.greaterThan(position.raw, JSBI.BigInt(0)))\n\n const handleCurrencySelect = useCallback(\n (currency: Currency) => {\n if (activeField === Fields.TOKEN0) {\n setCurrency0(currency)\n } else {\n setCurrency1(currency)\n }\n },\n [activeField]\n )\n\n const handleSearchDismiss = useCallback(() => {\n setShowSearch(false)\n }, [setShowSearch])\n\n const prerequisiteMessage = (\n \n \n {!account\n ? TranslateString(1174, 'Connect to a wallet to find pools')\n : TranslateString(208, 'Select a token to find your liquidity.')}\n \n \n )\n\n return (\n <>\n \n \n \n \n \n {\n setShowSearch(true)\n setActiveField(Fields.TOKEN0)\n }}\n startIcon={currency0 ? : null}\n endIcon={}\n width=\"100%\"\n >\n {currency0 ? currency0.symbol : TranslateString(82, 'Select a Token')}\n \n\n \n \n \n\n {\n setShowSearch(true)\n setActiveField(Fields.TOKEN1)\n }}\n startIcon={currency1 ? : null}\n endIcon={}\n width=\"100%\"\n >\n {currency1 ? currency1.symbol : TranslateString(82, 'Select a Token')}\n \n\n {hasPosition && (\n \n {TranslateString(210, 'Pool found!')}\n \n )}\n\n {currency0 && currency1 ? (\n pairState === PairState.EXISTS ? (\n hasPosition && pair ? (\n \n ) : (\n \n \n \n {TranslateString(212, 'You don’t have liquidity in this pool yet.')}\n \n \n {TranslateString(168, 'Add Liquidity')}\n \n \n \n )\n ) : validPairNoLiquidity ? (\n \n \n {TranslateString(214, 'No pool found.')}\n \n Create pool.\n \n \n \n ) : pairState === PairState.INVALID ? (\n \n \n {TranslateString(136, 'Invalid pair.')}\n \n \n ) : pairState === PairState.LOADING ? (\n \n \n \n Loading\n \n \n \n \n ) : null\n ) : (\n prerequisiteMessage\n )}\n \n\n \n \n \n \n )\n}\n","import React, { useContext, useMemo } from 'react'\nimport { ThemeContext } from 'styled-components'\nimport { Pair } from '@pancakeswap-libs/sdk'\nimport { Button, CardBody, Text } from '@pancakeswap-libs/uikit'\nimport { Link } from 'react-router-dom'\nimport CardNav from 'components/CardNav'\nimport Question from 'components/QuestionHelper'\nimport FullPositionCard from 'components/PositionCard'\nimport { useTokenBalancesWithLoadingIndicator } from 'state/wallet/hooks'\nimport { StyledInternalLink } from 'components/Shared'\nimport { LightCard } from 'components/Card'\nimport { RowBetween } from 'components/Row'\nimport { AutoColumn } from 'components/Column'\n\nimport { useActiveWeb3React } from 'hooks'\nimport { usePairs } from 'data/Reserves'\nimport { toV2LiquidityToken, useTrackedTokenPairs } from 'state/user/hooks'\nimport { Dots } from 'components/swap/styleds'\nimport useI18n from 'hooks/useI18n'\nimport PageHeader from 'components/PageHeader'\nimport AppBody from '../AppBody'\n\nexport default function Pool() {\n const theme = useContext(ThemeContext)\n const { account } = useActiveWeb3React()\n const TranslateString = useI18n()\n\n // fetch the user's balances of all tracked V2 LP tokens\n const trackedTokenPairs = useTrackedTokenPairs()\n const tokenPairsWithLiquidityTokens = useMemo(\n () => trackedTokenPairs.map((tokens) => ({ liquidityToken: toV2LiquidityToken(tokens), tokens })),\n [trackedTokenPairs]\n )\n const liquidityTokens = useMemo(() => tokenPairsWithLiquidityTokens.map((tpwlt) => tpwlt.liquidityToken), [\n tokenPairsWithLiquidityTokens,\n ])\n const [v2PairsBalances, fetchingV2PairBalances] = useTokenBalancesWithLoadingIndicator(\n account ?? undefined,\n liquidityTokens\n )\n\n // fetch the reserves for all V2 pools in which the user has a balance\n const liquidityTokensWithBalances = useMemo(\n () =>\n tokenPairsWithLiquidityTokens.filter(({ liquidityToken }) =>\n v2PairsBalances[liquidityToken.address]?.greaterThan('0')\n ),\n [tokenPairsWithLiquidityTokens, v2PairsBalances]\n )\n\n const v2Pairs = usePairs(liquidityTokensWithBalances.map(({ tokens }) => tokens))\n const v2IsLoading =\n fetchingV2PairBalances || v2Pairs?.length < liquidityTokensWithBalances.length || v2Pairs?.some((V2Pair) => !V2Pair)\n\n const allV2PairsWithLiquidity = v2Pairs.map(([, pair]) => pair).filter((v2Pair): v2Pair is Pair => Boolean(v2Pair))\n\n return (\n <>\n \n \n \n \n \n \n \n \n \n {TranslateString(107, 'Your Liquidity')}\n \n \n\n {!account ? (\n \n \n {TranslateString(156, 'Connect to a wallet to view your liquidity.')}\n \n \n ) : v2IsLoading ? (\n \n \n Loading\n \n \n ) : allV2PairsWithLiquidity?.length > 0 ? (\n <>\n {allV2PairsWithLiquidity.map((v2Pair) => (\n \n ))}\n \n ) : (\n \n \n {TranslateString(104, 'No liquidity found.')}\n \n \n )}\n\n
\n \n {TranslateString(106, \"Don't see a pool you joined?\")}{' '}\n \n {TranslateString(108, 'Import it.')}\n \n \n \n {TranslateString(1172, 'Or, if you staked your LP tokens in a farm, unstake them to see them here.')}\n \n
\n
\n
\n
\n
\n \n )\n}\n","import React, { useCallback } from 'react'\nimport styled from 'styled-components'\n\nconst StyledRangeInput = styled.input<{ size: number }>`\n -webkit-appearance: none; /* Hides the slider so that custom slider can be made */\n width: 100%; /* Specific width is required for Firefox. */\n background: transparent; /* Otherwise white in Chrome */\n cursor: pointer;\n\n &:focus {\n outline: none;\n }\n\n &::-moz-focus-outer {\n border: 0;\n }\n\n &::-webkit-slider-thumb {\n -webkit-appearance: none;\n height: ${({ size }) => size}px;\n width: ${({ size }) => size}px;\n background-color: #565a69;\n border-radius: 100%;\n border: none;\n transform: translateY(-50%);\n color: ${({ theme }) => theme.colors.invertedContrast};\n\n &:hover,\n &:focus {\n box-shadow: 0px 0px 1px rgba(0, 0, 0, 0.1), 0px 4px 8px rgba(0, 0, 0, 0.08), 0px 16px 24px rgba(0, 0, 0, 0.06),\n 0px 24px 32px rgba(0, 0, 0, 0.04);\n }\n }\n\n &::-moz-range-thumb {\n height: ${({ size }) => size}px;\n width: ${({ size }) => size}px;\n background-color: #565a69;\n border-radius: 100%;\n border: none;\n color: ${({ theme }) => theme.colors.invertedContrast};\n\n &:hover,\n &:focus {\n box-shadow: 0px 0px 1px rgba(0, 0, 0, 0.1), 0px 4px 8px rgba(0, 0, 0, 0.08), 0px 16px 24px rgba(0, 0, 0, 0.06),\n 0px 24px 32px rgba(0, 0, 0, 0.04);\n }\n }\n\n &::-ms-thumb {\n height: ${({ size }) => size}px;\n width: ${({ size }) => size}px;\n background-color: #565a69;\n border-radius: 100%;\n color: ${({ theme }) => theme.colors.invertedContrast};\n\n &:hover,\n &:focus {\n box-shadow: 0px 0px 1px rgba(0, 0, 0, 0.1), 0px 4px 8px rgba(0, 0, 0, 0.08), 0px 16px 24px rgba(0, 0, 0, 0.06),\n 0px 24px 32px rgba(0, 0, 0, 0.04);\n }\n }\n\n &::-webkit-slider-runnable-track {\n background: linear-gradient(\n 90deg,\n ${({ theme }) => theme.colors.primaryDark},\n ${({ theme }) => theme.colors.tertiary}\n );\n height: 2px;\n }\n\n &::-moz-range-track {\n background: linear-gradient(\n 90deg,\n ${({ theme }) => theme.colors.primaryDark},\n ${({ theme }) => theme.colors.tertiary}\n );\n height: 2px;\n }\n\n &::-ms-track {\n width: 100%;\n border-color: transparent;\n color: transparent;\n\n background: ${({ theme }) => theme.colors.primaryDark};\n height: 2px;\n }\n &::-ms-fill-lower {\n background: ${({ theme }) => theme.colors.primaryDark};\n }\n &::-ms-fill-upper {\n background: ${({ theme }) => theme.colors.tertiary};\n }\n`\n\ninterface InputSliderProps {\n value: number\n onChange: (value: number) => void\n step?: number\n min?: number\n max?: number\n size?: number\n}\n\nexport default function Slider({ value, onChange, min = 0, step = 1, max = 100, size = 28 }: InputSliderProps) {\n const changeCallback = useCallback(\n e => {\n onChange(parseInt(e.target.value))\n },\n [onChange]\n )\n\n return (\n \n )\n}\n","import { createAction } from '@reduxjs/toolkit'\n\nexport enum Field {\n LIQUIDITY_PERCENT = 'LIQUIDITY_PERCENT',\n LIQUIDITY = 'LIQUIDITY',\n CURRENCY_A = 'CURRENCY_A',\n CURRENCY_B = 'CURRENCY_B'\n}\n\nexport const typeInput = createAction<{ field: Field; typedValue: string }>('burn/typeInputBurn')\n","import { Currency, CurrencyAmount, JSBI, Pair, Percent, TokenAmount } from '@pancakeswap-libs/sdk'\nimport { useCallback } from 'react'\nimport { useDispatch, useSelector } from 'react-redux'\nimport { usePair } from '../../data/Reserves'\nimport { useTotalSupply } from '../../data/TotalSupply'\n\nimport { useActiveWeb3React } from '../../hooks'\nimport { wrappedCurrency } from '../../utils/wrappedCurrency'\nimport { AppDispatch, AppState } from '../index'\nimport { tryParseAmount } from '../swap/hooks'\nimport { useTokenBalances } from '../wallet/hooks'\nimport { Field, typeInput } from './actions'\n\nexport function useBurnState(): AppState['burn'] {\n return useSelector(state => state.burn)\n}\n\nexport function useDerivedBurnInfo(\n currencyA: Currency | undefined,\n currencyB: Currency | undefined\n): {\n pair?: Pair | null\n parsedAmounts: {\n [Field.LIQUIDITY_PERCENT]: Percent\n [Field.LIQUIDITY]?: TokenAmount\n [Field.CURRENCY_A]?: CurrencyAmount\n [Field.CURRENCY_B]?: CurrencyAmount\n }\n error?: string\n} {\n const { account, chainId } = useActiveWeb3React()\n\n const { independentField, typedValue } = useBurnState()\n\n // pair + totalsupply\n const [, pair] = usePair(currencyA, currencyB)\n\n // balances\n const relevantTokenBalances = useTokenBalances(account ?? undefined, [pair?.liquidityToken])\n const userLiquidity: undefined | TokenAmount = relevantTokenBalances?.[pair?.liquidityToken?.address ?? '']\n\n const [tokenA, tokenB] = [wrappedCurrency(currencyA, chainId), wrappedCurrency(currencyB, chainId)]\n const tokens = {\n [Field.CURRENCY_A]: tokenA,\n [Field.CURRENCY_B]: tokenB,\n [Field.LIQUIDITY]: pair?.liquidityToken\n }\n\n // liquidity values\n const totalSupply = useTotalSupply(pair?.liquidityToken)\n const liquidityValueA =\n pair &&\n totalSupply &&\n userLiquidity &&\n tokenA &&\n // this condition is a short-circuit in the case where useTokenBalance updates sooner than useTotalSupply\n JSBI.greaterThanOrEqual(totalSupply.raw, userLiquidity.raw)\n ? new TokenAmount(tokenA, pair.getLiquidityValue(tokenA, totalSupply, userLiquidity, false).raw)\n : undefined\n const liquidityValueB =\n pair &&\n totalSupply &&\n userLiquidity &&\n tokenB &&\n // this condition is a short-circuit in the case where useTokenBalance updates sooner than useTotalSupply\n JSBI.greaterThanOrEqual(totalSupply.raw, userLiquidity.raw)\n ? new TokenAmount(tokenB, pair.getLiquidityValue(tokenB, totalSupply, userLiquidity, false).raw)\n : undefined\n const liquidityValues: { [Field.CURRENCY_A]?: TokenAmount; [Field.CURRENCY_B]?: TokenAmount } = {\n [Field.CURRENCY_A]: liquidityValueA,\n [Field.CURRENCY_B]: liquidityValueB\n }\n\n let percentToRemove: Percent = new Percent('0', '100')\n // user specified a %\n if (independentField === Field.LIQUIDITY_PERCENT) {\n percentToRemove = new Percent(typedValue, '100')\n }\n // user specified a specific amount of liquidity tokens\n else if (independentField === Field.LIQUIDITY) {\n if (pair?.liquidityToken) {\n const independentAmount = tryParseAmount(typedValue, pair.liquidityToken)\n if (independentAmount && userLiquidity && !independentAmount.greaterThan(userLiquidity)) {\n percentToRemove = new Percent(independentAmount.raw, userLiquidity.raw)\n }\n }\n }\n // user specified a specific amount of token a or b\n else if (tokens[independentField]) {\n const independentAmount = tryParseAmount(typedValue, tokens[independentField])\n const liquidityValue = liquidityValues[independentField]\n if (independentAmount && liquidityValue && !independentAmount.greaterThan(liquidityValue)) {\n percentToRemove = new Percent(independentAmount.raw, liquidityValue.raw)\n }\n }\n\n const parsedAmounts: {\n [Field.LIQUIDITY_PERCENT]: Percent\n [Field.LIQUIDITY]?: TokenAmount\n [Field.CURRENCY_A]?: TokenAmount\n [Field.CURRENCY_B]?: TokenAmount\n } = {\n [Field.LIQUIDITY_PERCENT]: percentToRemove,\n [Field.LIQUIDITY]:\n userLiquidity && percentToRemove && percentToRemove.greaterThan('0')\n ? new TokenAmount(userLiquidity.token, percentToRemove.multiply(userLiquidity.raw).quotient)\n : undefined,\n [Field.CURRENCY_A]:\n tokenA && percentToRemove && percentToRemove.greaterThan('0') && liquidityValueA\n ? new TokenAmount(tokenA, percentToRemove.multiply(liquidityValueA.raw).quotient)\n : undefined,\n [Field.CURRENCY_B]:\n tokenB && percentToRemove && percentToRemove.greaterThan('0') && liquidityValueB\n ? new TokenAmount(tokenB, percentToRemove.multiply(liquidityValueB.raw).quotient)\n : undefined\n }\n\n let error: string | undefined\n if (!account) {\n error = 'Connect Wallet'\n }\n\n if (!parsedAmounts[Field.LIQUIDITY] || !parsedAmounts[Field.CURRENCY_A] || !parsedAmounts[Field.CURRENCY_B]) {\n error = error ?? 'Enter an amount'\n }\n\n return { pair, parsedAmounts, error }\n}\n\nexport function useBurnActionHandlers(): {\n onUserInput: (field: Field, typedValue: string) => void\n} {\n const dispatch = useDispatch()\n\n const onUserInput = useCallback(\n (field: Field, typedValue: string) => {\n dispatch(typeInput({ field, typedValue }))\n },\n [dispatch]\n )\n\n return {\n onUserInput\n }\n}\n","import React, { useCallback, useContext, useMemo, useState } from 'react'\nimport styled, { ThemeContext } from 'styled-components'\nimport { splitSignature } from '@ethersproject/bytes'\nimport { Contract } from '@ethersproject/contracts'\nimport { TransactionResponse } from '@ethersproject/providers'\nimport { Currency, currencyEquals, ETHER, Percent, WETH } from '@pancakeswap-libs/sdk'\nimport { Button, Flex, Text } from '@pancakeswap-libs/uikit'\nimport { ArrowDown, Plus } from 'react-feather'\nimport { RouteComponentProps } from 'react-router'\n\nimport { BigNumber } from '@ethersproject/bignumber'\nimport ConnectWalletButton from 'components/ConnectWalletButton'\nimport useI18n from 'hooks/useI18n'\nimport { AutoColumn, ColumnCenter } from '../../components/Column'\nimport TransactionConfirmationModal, { ConfirmationModalContent } from '../../components/TransactionConfirmationModal'\nimport CurrencyInputPanel from '../../components/CurrencyInputPanel'\nimport DoubleCurrencyLogo from '../../components/DoubleLogo'\nimport { AddRemoveTabs } from '../../components/NavigationTabs'\nimport { MinimalPositionCard } from '../../components/PositionCard'\nimport { RowBetween, RowFixed } from '../../components/Row'\n\nimport Slider from '../../components/Slider'\nimport CurrencyLogo from '../../components/CurrencyLogo'\nimport { ROUTER_ADDRESS } from '../../constants'\nimport { useActiveWeb3React } from '../../hooks'\nimport { useCurrency } from '../../hooks/Tokens'\nimport { usePairContract } from '../../hooks/useContract'\n\nimport { useTransactionAdder } from '../../state/transactions/hooks'\nimport { StyledInternalLink } from '../../components/Shared'\nimport { calculateGasMargin, calculateSlippageAmount, getRouterContract } from '../../utils'\nimport { currencyId } from '../../utils/currencyId'\nimport useDebouncedChangeHandler from '../../utils/useDebouncedChangeHandler'\nimport { wrappedCurrency } from '../../utils/wrappedCurrency'\nimport AppBody from '../AppBody'\nimport { ClickableText, Wrapper } from '../Pool/styleds'\nimport { useApproveCallback, ApprovalState } from '../../hooks/useApproveCallback'\nimport { Dots } from '../../components/swap/styleds'\nimport { useBurnActionHandlers, useDerivedBurnInfo, useBurnState } from '../../state/burn/hooks'\n\nimport { Field } from '../../state/burn/actions'\nimport { useUserDeadline, useUserSlippageTolerance } from '../../state/user/hooks'\n\nconst OutlineCard = styled.div`\n border: 1px solid ${({ theme }) => theme.colors.borderColor};\n border-radius: 16px;\n padding: 24px;\n`\n\nconst Body = styled.div`\n padding-left: 24px;\n padding-right: 24px;\n`\n\nexport default function RemoveLiquidity({\n history,\n match: {\n params: { currencyIdA, currencyIdB },\n },\n}: RouteComponentProps<{ currencyIdA: string; currencyIdB: string }>) {\n const [currencyA, currencyB] = [useCurrency(currencyIdA) ?? undefined, useCurrency(currencyIdB) ?? undefined]\n const { account, chainId, library } = useActiveWeb3React()\n const TranslateString = useI18n()\n const [tokenA, tokenB] = useMemo(() => [wrappedCurrency(currencyA, chainId), wrappedCurrency(currencyB, chainId)], [\n currencyA,\n currencyB,\n chainId,\n ])\n\n const theme = useContext(ThemeContext)\n\n // burn state\n const { independentField, typedValue } = useBurnState()\n const { pair, parsedAmounts, error } = useDerivedBurnInfo(currencyA ?? undefined, currencyB ?? undefined)\n const { onUserInput: _onUserInput } = useBurnActionHandlers()\n const isValid = !error\n\n // modal and loading\n const [showConfirm, setShowConfirm] = useState(false)\n const [showDetailed, setShowDetailed] = useState(false)\n const [attemptingTxn, setAttemptingTxn] = useState(false) // clicked confirm\n\n // txn values\n const [txHash, setTxHash] = useState('')\n const [deadline] = useUserDeadline()\n const [allowedSlippage] = useUserSlippageTolerance()\n\n const formattedAmounts = {\n [Field.LIQUIDITY_PERCENT]: parsedAmounts[Field.LIQUIDITY_PERCENT].equalTo('0')\n ? '0'\n : parsedAmounts[Field.LIQUIDITY_PERCENT].lessThan(new Percent('1', '100'))\n ? '<1'\n : parsedAmounts[Field.LIQUIDITY_PERCENT].toFixed(0),\n [Field.LIQUIDITY]:\n independentField === Field.LIQUIDITY ? typedValue : parsedAmounts[Field.LIQUIDITY]?.toSignificant(6) ?? '',\n [Field.CURRENCY_A]:\n independentField === Field.CURRENCY_A ? typedValue : parsedAmounts[Field.CURRENCY_A]?.toSignificant(6) ?? '',\n [Field.CURRENCY_B]:\n independentField === Field.CURRENCY_B ? typedValue : parsedAmounts[Field.CURRENCY_B]?.toSignificant(6) ?? '',\n }\n\n const atMaxAmount = parsedAmounts[Field.LIQUIDITY_PERCENT]?.equalTo(new Percent('1'))\n\n // pair contract\n const pairContract: Contract | null = usePairContract(pair?.liquidityToken?.address)\n\n // allowance handling\n const [signatureData, setSignatureData] = useState<{ v: number; r: string; s: string; deadline: number } | null>(null)\n const [approval, approveCallback] = useApproveCallback(parsedAmounts[Field.LIQUIDITY], ROUTER_ADDRESS)\n async function onAttemptToApprove() {\n if (!pairContract || !pair || !library) throw new Error('missing dependencies')\n const liquidityAmount = parsedAmounts[Field.LIQUIDITY]\n if (!liquidityAmount) throw new Error('missing liquidity amount')\n // try to gather a signature for permission\n const nonce = await pairContract.nonces(account)\n\n const deadlineForSignature: number = Math.ceil(Date.now() / 1000) + deadline\n\n const EIP712Domain = [\n { name: 'name', type: 'string' },\n { name: 'version', type: 'string' },\n { name: 'chainId', type: 'uint256' },\n { name: 'verifyingContract', type: 'address' },\n ]\n const domain = {\n name: 'Pancake LPs',\n version: '1',\n chainId,\n verifyingContract: pair.liquidityToken.address,\n }\n const Permit = [\n { name: 'owner', type: 'address' },\n { name: 'spender', type: 'address' },\n { name: 'value', type: 'uint256' },\n { name: 'nonce', type: 'uint256' },\n { name: 'deadline', type: 'uint256' },\n ]\n const message = {\n owner: account,\n spender: ROUTER_ADDRESS,\n value: liquidityAmount.raw.toString(),\n nonce: nonce.toHexString(),\n deadline: deadlineForSignature,\n }\n const data = JSON.stringify({\n types: {\n EIP712Domain,\n Permit,\n },\n domain,\n primaryType: 'Permit',\n message,\n })\n\n library\n .send('eth_signTypedData_v4', [account, data])\n .then(splitSignature)\n .then((signature) => {\n setSignatureData({\n v: signature.v,\n r: signature.r,\n s: signature.s,\n deadline: deadlineForSignature,\n })\n })\n .catch((e) => {\n // for all errors other than 4001 (EIP-1193 user rejected request), fall back to manual approve\n if (e?.code !== 4001) {\n approveCallback()\n }\n })\n }\n\n // wrapped onUserInput to clear signatures\n const onUserInput = useCallback(\n (field: Field, val: string) => {\n setSignatureData(null)\n return _onUserInput(field, val)\n },\n [_onUserInput]\n )\n\n const onLiquidityInput = useCallback((val: string): void => onUserInput(Field.LIQUIDITY, val), [onUserInput])\n const onCurrencyAInput = useCallback((val: string): void => onUserInput(Field.CURRENCY_A, val), [onUserInput])\n const onCurrencyBInput = useCallback((val: string): void => onUserInput(Field.CURRENCY_B, val), [onUserInput])\n\n // tx sending\n const addTransaction = useTransactionAdder()\n async function onRemove() {\n if (!chainId || !library || !account) throw new Error('missing dependencies')\n const { [Field.CURRENCY_A]: currencyAmountA, [Field.CURRENCY_B]: currencyAmountB } = parsedAmounts\n if (!currencyAmountA || !currencyAmountB) {\n throw new Error('missing currency amounts')\n }\n const router = getRouterContract(chainId, library, account)\n\n const amountsMin = {\n [Field.CURRENCY_A]: calculateSlippageAmount(currencyAmountA, allowedSlippage)[0],\n [Field.CURRENCY_B]: calculateSlippageAmount(currencyAmountB, allowedSlippage)[0],\n }\n\n if (!currencyA || !currencyB) throw new Error('missing tokens')\n const liquidityAmount = parsedAmounts[Field.LIQUIDITY]\n if (!liquidityAmount) throw new Error('missing liquidity amount')\n\n const currencyBIsETH = currencyB === ETHER\n const oneCurrencyIsETH = currencyA === ETHER || currencyBIsETH\n const deadlineFromNow = Math.ceil(Date.now() / 1000) + deadline\n\n if (!tokenA || !tokenB) throw new Error('could not wrap')\n\n let methodNames: string[]\n let args: Array\n // we have approval, use normal remove liquidity\n if (approval === ApprovalState.APPROVED) {\n // removeLiquidityETH\n if (oneCurrencyIsETH) {\n methodNames = ['removeLiquidityETH', 'removeLiquidityETHSupportingFeeOnTransferTokens']\n args = [\n currencyBIsETH ? tokenA.address : tokenB.address,\n liquidityAmount.raw.toString(),\n amountsMin[currencyBIsETH ? Field.CURRENCY_A : Field.CURRENCY_B].toString(),\n amountsMin[currencyBIsETH ? Field.CURRENCY_B : Field.CURRENCY_A].toString(),\n account,\n deadlineFromNow,\n ]\n }\n // removeLiquidity\n else {\n methodNames = ['removeLiquidity']\n args = [\n tokenA.address,\n tokenB.address,\n liquidityAmount.raw.toString(),\n amountsMin[Field.CURRENCY_A].toString(),\n amountsMin[Field.CURRENCY_B].toString(),\n account,\n deadlineFromNow,\n ]\n }\n }\n // we have a signataure, use permit versions of remove liquidity\n else if (signatureData !== null) {\n // removeLiquidityETHWithPermit\n if (oneCurrencyIsETH) {\n methodNames = ['removeLiquidityETHWithPermit', 'removeLiquidityETHWithPermitSupportingFeeOnTransferTokens']\n args = [\n currencyBIsETH ? tokenA.address : tokenB.address,\n liquidityAmount.raw.toString(),\n amountsMin[currencyBIsETH ? Field.CURRENCY_A : Field.CURRENCY_B].toString(),\n amountsMin[currencyBIsETH ? Field.CURRENCY_B : Field.CURRENCY_A].toString(),\n account,\n signatureData.deadline,\n false,\n signatureData.v,\n signatureData.r,\n signatureData.s,\n ]\n }\n // removeLiquidityETHWithPermit\n else {\n methodNames = ['removeLiquidityWithPermit']\n args = [\n tokenA.address,\n tokenB.address,\n liquidityAmount.raw.toString(),\n amountsMin[Field.CURRENCY_A].toString(),\n amountsMin[Field.CURRENCY_B].toString(),\n account,\n signatureData.deadline,\n false,\n signatureData.v,\n signatureData.r,\n signatureData.s,\n ]\n }\n } else {\n throw new Error('Attempting to confirm without approval or a signature. Please contact support.')\n }\n const safeGasEstimates: (BigNumber | undefined)[] = await Promise.all(\n methodNames.map((methodName, index) =>\n router.estimateGas[methodName](...args)\n .then(calculateGasMargin)\n .catch((e) => {\n console.error(`estimateGas failed`, index, methodName, args, e)\n return undefined\n })\n )\n )\n\n const indexOfSuccessfulEstimation = safeGasEstimates.findIndex((safeGasEstimate) =>\n BigNumber.isBigNumber(safeGasEstimate)\n )\n\n // all estimations failed...\n if (indexOfSuccessfulEstimation === -1) {\n console.error('This transaction would fail. Please contact support.')\n } else {\n const methodName = methodNames[indexOfSuccessfulEstimation]\n const safeGasEstimate = safeGasEstimates[indexOfSuccessfulEstimation]\n\n setAttemptingTxn(true)\n await router[methodName](...args, {\n gasLimit: safeGasEstimate,\n })\n .then((response: TransactionResponse) => {\n setAttemptingTxn(false)\n\n addTransaction(response, {\n summary: `Remove ${parsedAmounts[Field.CURRENCY_A]?.toSignificant(3)} ${\n currencyA?.symbol\n } and ${parsedAmounts[Field.CURRENCY_B]?.toSignificant(3)} ${currencyB?.symbol}`,\n })\n\n setTxHash(response.hash)\n })\n .catch((e: Error) => {\n setAttemptingTxn(false)\n // we only care if the error is something _other_ than the user rejected the tx\n console.error(e)\n })\n }\n }\n\n function modalHeader() {\n return (\n \n \n {parsedAmounts[Field.CURRENCY_A]?.toSignificant(6)}\n \n \n \n {currencyA?.symbol}\n \n \n \n \n \n \n \n {parsedAmounts[Field.CURRENCY_B]?.toSignificant(6)}\n \n \n \n {currencyB?.symbol}\n \n \n \n\n \n {`Output is estimated. If the price changes by more than ${\n allowedSlippage / 100\n }% your transaction will revert.`}\n \n \n )\n }\n\n function modalBottom() {\n return (\n <>\n \n {`LP ${currencyA?.symbol}/${currencyB?.symbol}`} Burned\n \n \n {parsedAmounts[Field.LIQUIDITY]?.toSignificant(6)}\n \n \n {pair && (\n <>\n \n {TranslateString(1182, 'Price')}\n \n 1 {currencyA?.symbol} = {tokenA ? pair.priceOf(tokenA).toSignificant(6) : '-'} {currencyB?.symbol}\n \n \n \n
\n \n 1 {currencyB?.symbol} = {tokenB ? pair.priceOf(tokenB).toSignificant(6) : '-'} {currencyA?.symbol}\n \n \n \n )}\n \n \n )\n }\n\n const pendingText = `Removing ${parsedAmounts[Field.CURRENCY_A]?.toSignificant(6)} ${\n currencyA?.symbol\n } and ${parsedAmounts[Field.CURRENCY_B]?.toSignificant(6)} ${currencyB?.symbol}`\n\n const liquidityPercentChangeCallback = useCallback(\n (value: number) => {\n onUserInput(Field.LIQUIDITY_PERCENT, value.toString())\n },\n [onUserInput]\n )\n\n const oneCurrencyIsETH = currencyA === ETHER || currencyB === ETHER\n const oneCurrencyIsWETH = Boolean(\n chainId &&\n ((currencyA && currencyEquals(WETH[chainId], currencyA)) ||\n (currencyB && currencyEquals(WETH[chainId], currencyB)))\n )\n\n const handleSelectCurrencyA = useCallback(\n (currency: Currency) => {\n if (currencyIdB && currencyId(currency) === currencyIdB) {\n history.push(`/remove/${currencyId(currency)}/${currencyIdA}`)\n } else {\n history.push(`/remove/${currencyId(currency)}/${currencyIdB}`)\n }\n },\n [currencyIdA, currencyIdB, history]\n )\n const handleSelectCurrencyB = useCallback(\n (currency: Currency) => {\n if (currencyIdA && currencyId(currency) === currencyIdA) {\n history.push(`/remove/${currencyIdB}/${currencyId(currency)}`)\n } else {\n history.push(`/remove/${currencyIdA}/${currencyId(currency)}`)\n }\n },\n [currencyIdA, currencyIdB, history]\n )\n\n const handleDismissConfirmation = useCallback(() => {\n setShowConfirm(false)\n setSignatureData(null) // important that we clear signature data to avoid bad sigs\n // if there was a tx hash, we want to clear the input\n if (txHash) {\n onUserInput(Field.LIQUIDITY_PERCENT, '0')\n }\n setTxHash('')\n }, [onUserInput, txHash])\n\n const [innerLiquidityPercentage, setInnerLiquidityPercentage] = useDebouncedChangeHandler(\n Number.parseInt(parsedAmounts[Field.LIQUIDITY_PERCENT].toFixed(0)),\n liquidityPercentChangeCallback\n )\n\n return (\n <>\n \n \n \n (\n \n )}\n pendingText={pendingText}\n />\n \n \n \n \n \n Amount\n {\n setShowDetailed(!showDetailed)\n }}\n >\n {showDetailed ? TranslateString(1184, 'Simple') : TranslateString(1186, 'Detailed')}\n \n \n \n {formattedAmounts[Field.LIQUIDITY_PERCENT]}%\n \n {!showDetailed && (\n <>\n \n \n \n \n onUserInput(Field.LIQUIDITY_PERCENT, '25')}\n >\n 25%\n \n onUserInput(Field.LIQUIDITY_PERCENT, '50')}\n >\n 50%\n \n onUserInput(Field.LIQUIDITY_PERCENT, '75')}\n >\n 75%\n \n onUserInput(Field.LIQUIDITY_PERCENT, '100')}\n >\n {TranslateString(166, 'Max')}\n \n \n \n )}\n \n \n \n {!showDetailed && (\n <>\n \n \n \n \n \n \n \n {formattedAmounts[Field.CURRENCY_A] || '-'}\n \n \n \n {currencyA?.symbol}\n \n \n \n \n {formattedAmounts[Field.CURRENCY_B] || '-'}\n \n \n \n {currencyB?.symbol}\n \n \n \n {chainId && (oneCurrencyIsWETH || oneCurrencyIsETH) ? (\n \n {oneCurrencyIsETH ? (\n \n {TranslateString(1188, 'Receive WBNB')}\n \n ) : oneCurrencyIsWETH ? (\n \n {TranslateString(1190, 'Receive BNB')}\n \n ) : null}\n \n ) : null}\n \n \n \n \n )}\n \n {showDetailed && (\n <>\n {\n onUserInput(Field.LIQUIDITY_PERCENT, '100')\n }}\n showMaxButton={!atMaxAmount}\n disableCurrencySelect\n currency={pair?.liquidityToken}\n pair={pair}\n id=\"liquidity-amount\"\n />\n \n \n \n onUserInput(Field.LIQUIDITY_PERCENT, '100')}\n showMaxButton={!atMaxAmount}\n currency={currencyA}\n label=\"Output\"\n onCurrencySelect={handleSelectCurrencyA}\n id=\"remove-liquidity-tokena\"\n />\n \n \n \n onUserInput(Field.LIQUIDITY_PERCENT, '100')}\n showMaxButton={!atMaxAmount}\n currency={currencyB}\n label=\"Output\"\n onCurrencySelect={handleSelectCurrencyB}\n id=\"remove-liquidity-tokenb\"\n />\n \n )}\n {pair && (\n
\n \n Price:\n
\n 1 {currencyA?.symbol} = {tokenA ? pair.priceOf(tokenA).toSignificant(6) : '-'} {currencyB?.symbol}\n
\n
\n \n
\n
\n 1 {currencyB?.symbol} = {tokenB ? pair.priceOf(tokenB).toSignificant(6) : '-'} {currencyA?.symbol}\n
\n \n
\n )}\n
\n {!account ? (\n \n ) : (\n \n \n {approval === ApprovalState.PENDING ? (\n Approving\n ) : approval === ApprovalState.APPROVED || signatureData !== null ? (\n 'Approved'\n ) : (\n 'Approve'\n )}\n \n {\n setShowConfirm(true)\n }}\n disabled={!isValid || (signatureData === null && approval !== ApprovalState.APPROVED)}\n variant={\n !isValid && !!parsedAmounts[Field.CURRENCY_A] && !!parsedAmounts[Field.CURRENCY_B]\n ? 'danger'\n : 'primary'\n }\n >\n {error || 'Remove'}\n \n \n )}\n
\n \n \n \n \n\n {pair ? (\n \n \n \n ) : null}\n \n )\n}\n","import { useCallback, useEffect, useRef, useState } from 'react'\n\n/**\n * Easy way to debounce the handling of a rapidly changing value, e.g. a changing slider input\n * @param value value that is rapidly changing\n * @param onChange change handler that should receive the debounced updates to the value\n * @param debouncedMs how long we should wait for changes to be applied\n */\nexport default function useDebouncedChangeHandler(\n value: T,\n onChange: (newValue: T) => void,\n debouncedMs = 100\n): [T, (value: T) => void] {\n const [inner, setInner] = useState(() => value)\n const timer = useRef>()\n\n const onChangeInner = useCallback(\n (newValue: T) => {\n setInner(newValue)\n if (timer.current) {\n clearTimeout(timer.current)\n }\n timer.current = setTimeout(() => {\n onChange(newValue)\n timer.current = undefined\n }, debouncedMs)\n },\n [debouncedMs, onChange]\n )\n\n useEffect(() => {\n if (timer.current) {\n clearTimeout(timer.current)\n timer.current = undefined\n }\n setInner(value)\n }, [value])\n\n return [inner, onChangeInner]\n}\n","import React, { useCallback } from 'react'\nimport styled from 'styled-components'\nimport { Text } from '@pancakeswap-libs/uikit'\nimport useI18n from 'hooks/useI18n'\nimport useENS from '../../hooks/useENS'\nimport { useActiveWeb3React } from '../../hooks'\nimport { ExternalLink } from '../Shared'\nimport { AutoColumn } from '../Column'\nimport { RowBetween } from '../Row'\nimport { getBscScanLink } from '../../utils'\n\nconst InputPanel = styled.div`\n display: flex;\n flex-flow: column nowrap;\n position: relative;\n border-radius: 1.25rem;\n background-color: ${({ theme }) => theme.colors.invertedContrast};\n z-index: 1;\n width: 100%;\n`\n\nconst ContainerRow = styled.div<{ error: boolean }>`\n display: flex;\n justify-content: center;\n align-items: center;\n border-radius: 1.25rem;\n border: 1px solid ${({ error, theme }) => (error ? theme.colors.failure : theme.colors.invertedContrast)};\n transition: border-color 300ms ${({ error }) => (error ? 'step-end' : 'step-start')},\n color 500ms ${({ error }) => (error ? 'step-end' : 'step-start')};\n background-color: ${({ theme }) => theme.colors.invertedContrast};\n`\n\nconst InputContainer = styled.div`\n flex: 1;\n padding: 1rem;\n`\n\nconst Input = styled.input<{ error?: boolean }>`\n font-size: 1.25rem;\n outline: none;\n border: none;\n flex: 1 1 auto;\n width: 0;\n background-color: ${({ theme }) => theme.colors.invertedContrast};\n transition: color 300ms ${({ error }) => (error ? 'step-end' : 'step-start')};\n color: ${({ error, theme }) => (error ? theme.colors.failure : theme.colors.primary)};\n overflow: hidden;\n text-overflow: ellipsis;\n font-weight: 500;\n width: 100%;\n ::placeholder {\n color: ${({ theme }) => theme.colors.textDisabled};\n }\n padding: 0px;\n -webkit-appearance: textfield;\n\n ::-webkit-search-decoration {\n -webkit-appearance: none;\n }\n\n ::-webkit-outer-spin-button,\n ::-webkit-inner-spin-button {\n -webkit-appearance: none;\n }\n\n ::placeholder {\n color: ${({ theme }) => theme.colors.textDisabled};\n }\n`\n\nexport default function AddressInputPanel({\n id,\n value,\n onChange,\n}: {\n id?: string\n // the typed string value\n value: string\n // triggers whenever the typed value changes\n onChange: (value: string) => void\n}) {\n const { chainId } = useActiveWeb3React()\n const TranslateString = useI18n()\n const { address, loading, name } = useENS(value)\n\n const handleInput = useCallback(\n (event) => {\n const input = event.target.value\n const withoutSpaces = input.replace(/\\s+/g, '')\n onChange(withoutSpaces)\n },\n [onChange]\n )\n\n const error = Boolean(value.length > 0 && !loading && !address)\n\n return (\n \n \n \n \n \n \n {TranslateString(1138, 'Recipient')}\n \n {address && chainId && (\n \n {TranslateString(116, '(View on BscScan)')}\n \n )}\n \n \n \n \n \n \n )\n}\n","import { Percent } from '@pancakeswap-libs/sdk'\nimport React from 'react'\nimport { ONE_BIPS } from '../../constants'\nimport { warningSeverity } from '../../utils/prices'\nimport { ErrorText } from './styleds'\n\n/**\n * Formatted version of price impact text with warning colors\n */\nexport default function FormattedPriceImpact({ priceImpact }: { priceImpact?: Percent }) {\n return (\n \n {priceImpact ? (priceImpact.lessThan(ONE_BIPS) ? '<0.01%' : `${priceImpact.toFixed(2)}%`) : '-'}\n \n )\n}\n","import { Trade, TradeType } from '@pancakeswap-libs/sdk'\nimport React, { useMemo, useState } from 'react'\nimport { Text, Button } from '@pancakeswap-libs/uikit'\nimport { Repeat } from 'react-feather'\n\nimport useI18n from 'hooks/useI18n'\nimport { Field } from '../../state/swap/actions'\nimport {\n computeSlippageAdjustedAmounts,\n computeTradePriceBreakdown,\n formatExecutionPrice,\n warningSeverity,\n} from '../../utils/prices'\nimport { AutoColumn } from '../Column'\nimport QuestionHelper from '../QuestionHelper'\nimport { AutoRow, RowBetween, RowFixed } from '../Row'\nimport FormattedPriceImpact from './FormattedPriceImpact'\nimport { StyledBalanceMaxMini, SwapCallbackError } from './styleds'\n\nexport default function SwapModalFooter({\n trade,\n onConfirm,\n allowedSlippage,\n swapErrorMessage,\n disabledConfirm,\n}: {\n trade: Trade\n allowedSlippage: number\n onConfirm: () => void\n swapErrorMessage: string | undefined\n disabledConfirm: boolean\n}) {\n const [showInverted, setShowInverted] = useState(false)\n const slippageAdjustedAmounts = useMemo(() => computeSlippageAdjustedAmounts(trade, allowedSlippage), [\n allowedSlippage,\n trade,\n ])\n const { priceImpactWithoutFee, realizedLPFee } = useMemo(() => computeTradePriceBreakdown(trade), [trade])\n const severity = warningSeverity(priceImpactWithoutFee)\n const TranslateString = useI18n()\n\n return (\n <>\n \n \n Price\n \n {formatExecutionPrice(trade, showInverted)}\n setShowInverted(!showInverted)}>\n \n \n \n \n\n \n \n \n {trade.tradeType === TradeType.EXACT_INPUT\n ? TranslateString(1210, 'Minimum received')\n : TranslateString(220, 'Maximum sold')}\n \n \n \n \n \n {trade.tradeType === TradeType.EXACT_INPUT\n ? slippageAdjustedAmounts[Field.OUTPUT]?.toSignificant(4) ?? '-'\n : slippageAdjustedAmounts[Field.INPUT]?.toSignificant(4) ?? '-'}\n \n \n {trade.tradeType === TradeType.EXACT_INPUT\n ? trade.outputAmount.currency.symbol\n : trade.inputAmount.currency.symbol}\n \n \n \n \n \n {TranslateString(226, 'Price Impact')}\n \n \n \n \n \n \n {TranslateString(228, 'Liquidity Provider Fee')}\n \n \n \n {realizedLPFee ? `${realizedLPFee?.toSignificant(6)} ${trade.inputAmount.currency.symbol}` : '-'}\n \n \n \n\n \n 2 ? 'danger' : 'primary'}\n mt=\"10px\"\n id=\"confirm-swap-or-send\"\n width=\"100%\"\n >\n {severity > 2 ? 'Swap Anyway' : 'Confirm Swap'}\n \n\n {swapErrorMessage ? : null}\n \n \n )\n}\n","import React, { useContext, useMemo } from 'react'\nimport styled, { ThemeContext } from 'styled-components'\nimport { Trade, TradeType } from '@pancakeswap-libs/sdk'\nimport { Button, Text } from '@pancakeswap-libs/uikit'\nimport { ArrowDown, AlertTriangle } from 'react-feather'\nimport { Field } from '../../state/swap/actions'\nimport { isAddress, shortenAddress } from '../../utils'\nimport { computeSlippageAdjustedAmounts, computeTradePriceBreakdown, warningSeverity } from '../../utils/prices'\nimport { AutoColumn } from '../Column'\nimport CurrencyLogo from '../CurrencyLogo'\nimport { RowBetween, RowFixed } from '../Row'\nimport { SwapShowAcceptChanges } from './styleds'\n\nconst PriceInfoText = styled(Text)`\n font-style: italic;\n line-height: 1.3;\n\n span {\n color: ${({ theme }) => theme.colors.primary};\n font-weight: 600;\n }\n`\n\nexport default function SwapModalHeader({\n trade,\n allowedSlippage,\n recipient,\n showAcceptChanges,\n onAcceptChanges,\n}: {\n trade: Trade\n allowedSlippage: number\n recipient: string | null\n showAcceptChanges: boolean\n onAcceptChanges: () => void\n}) {\n const slippageAdjustedAmounts = useMemo(() => computeSlippageAdjustedAmounts(trade, allowedSlippage), [\n trade,\n allowedSlippage,\n ])\n const { priceImpactWithoutFee } = useMemo(() => computeTradePriceBreakdown(trade), [trade])\n const priceImpactSeverity = warningSeverity(priceImpactWithoutFee)\n\n const theme = useContext(ThemeContext)\n\n return (\n \n \n \n \n \n {trade.inputAmount.toSignificant(6)}\n \n \n \n \n {trade.inputAmount.currency.symbol}\n \n \n \n \n \n \n \n \n \n 2\n ? theme.colors.failure\n : showAcceptChanges && trade.tradeType === TradeType.EXACT_INPUT\n ? theme.colors.primary\n : 'text'\n }\n >\n {trade.outputAmount.toSignificant(6)}\n \n \n \n \n {trade.outputAmount.currency.symbol}\n \n \n \n {showAcceptChanges ? (\n \n \n \n \n Price Updated\n \n \n \n \n ) : null}\n \n {trade.tradeType === TradeType.EXACT_INPUT ? (\n \n {`Output is estimated. You will receive at least `}\n \n {slippageAdjustedAmounts[Field.OUTPUT]?.toSignificant(6)} {trade.outputAmount.currency.symbol}\n \n {' or the transaction will revert.'}\n \n ) : (\n \n {`Input is estimated. You will sell at most `}\n \n {slippageAdjustedAmounts[Field.INPUT]?.toSignificant(6)} {trade.inputAmount.currency.symbol}\n \n {' or the transaction will revert.'}\n \n )}\n \n {recipient !== null ? (\n \n \n Output will be sent to{' '}\n {isAddress(recipient) ? shortenAddress(recipient) : recipient}\n \n \n ) : null}\n \n )\n}\n","import { currencyEquals, Trade } from '@pancakeswap-libs/sdk'\nimport React, { useCallback, useMemo } from 'react'\nimport TransactionConfirmationModal, {\n ConfirmationModalContent,\n TransactionErrorContent\n} from '../TransactionConfirmationModal'\nimport SwapModalFooter from './SwapModalFooter'\nimport SwapModalHeader from './SwapModalHeader'\n\n/**\n * Returns true if the trade requires a confirmation of details before we can submit it\n * @param tradeA trade A\n * @param tradeB trade B\n */\nfunction tradeMeaningfullyDiffers(tradeA: Trade, tradeB: Trade): boolean {\n return (\n tradeA.tradeType !== tradeB.tradeType ||\n !currencyEquals(tradeA.inputAmount.currency, tradeB.inputAmount.currency) ||\n !tradeA.inputAmount.equalTo(tradeB.inputAmount) ||\n !currencyEquals(tradeA.outputAmount.currency, tradeB.outputAmount.currency) ||\n !tradeA.outputAmount.equalTo(tradeB.outputAmount)\n )\n}\n\nexport default function ConfirmSwapModal({\n trade,\n originalTrade,\n onAcceptChanges,\n allowedSlippage,\n onConfirm,\n onDismiss,\n recipient,\n swapErrorMessage,\n isOpen,\n attemptingTxn,\n txHash\n}: {\n isOpen: boolean\n trade: Trade | undefined\n originalTrade: Trade | undefined\n attemptingTxn: boolean\n txHash: string | undefined\n recipient: string | null\n allowedSlippage: number\n onAcceptChanges: () => void\n onConfirm: () => void\n swapErrorMessage: string | undefined\n onDismiss: () => void\n}) {\n const showAcceptChanges = useMemo(\n () => Boolean(trade && originalTrade && tradeMeaningfullyDiffers(trade, originalTrade)),\n [originalTrade, trade]\n )\n\n const modalHeader = useCallback(() => {\n return trade ? (\n \n ) : null\n }, [allowedSlippage, onAcceptChanges, recipient, showAcceptChanges, trade])\n\n const modalBottom = useCallback(() => {\n return trade ? (\n \n ) : null\n }, [allowedSlippage, onConfirm, showAcceptChanges, swapErrorMessage, trade])\n\n // text to show while loading\n const pendingText = `Swapping ${trade?.inputAmount?.toSignificant(6)} ${\n trade?.inputAmount?.currency?.symbol\n } for ${trade?.outputAmount?.toSignificant(6)} ${trade?.outputAmount?.currency?.symbol}`\n\n const confirmationContent = useCallback(\n () =>\n swapErrorMessage ? (\n \n ) : (\n \n ),\n [onDismiss, modalBottom, modalHeader, swapErrorMessage]\n )\n\n return (\n \n )\n}\n","import { Trade } from '@pancakeswap-libs/sdk'\nimport React, { Fragment, memo, useContext } from 'react'\nimport { ChevronRight } from 'react-feather'\nimport { Flex, Text } from '@pancakeswap-libs/uikit'\nimport { ThemeContext } from 'styled-components'\nimport CurrencyLogo from '../CurrencyLogo'\n\nexport default memo(function SwapRoute({ trade }: { trade: Trade }) {\n const theme = useContext(ThemeContext)\n return (\n \n {trade.route.path.map((token, i, path) => {\n const isLastItem: boolean = i === path.length - 1\n return (\n // eslint-disable-next-line react/no-array-index-key\n \n \n \n \n {token.symbol}\n \n \n {isLastItem ? null : }\n \n )\n })}\n
\n )\n})\n","import React from 'react'\nimport { Trade, TradeType } from '@pancakeswap-libs/sdk'\nimport { Card, CardBody, Text } from '@pancakeswap-libs/uikit'\nimport useI18n from 'hooks/useI18n'\nimport { Field } from '../../state/swap/actions'\nimport { useUserSlippageTolerance } from '../../state/user/hooks'\nimport { computeSlippageAdjustedAmounts, computeTradePriceBreakdown } from '../../utils/prices'\nimport { AutoColumn } from '../Column'\nimport QuestionHelper from '../QuestionHelper'\nimport { RowBetween, RowFixed } from '../Row'\nimport FormattedPriceImpact from './FormattedPriceImpact'\nimport { SectionBreak } from './styleds'\nimport SwapRoute from './SwapRoute'\n\nfunction TradeSummary({ trade, allowedSlippage }: { trade: Trade; allowedSlippage: number }) {\n const { priceImpactWithoutFee, realizedLPFee } = computeTradePriceBreakdown(trade)\n const isExactIn = trade.tradeType === TradeType.EXACT_INPUT\n const slippageAdjustedAmounts = computeSlippageAdjustedAmounts(trade, allowedSlippage)\n const TranslateString = useI18n()\n\n return (\n \n \n \n \n \n {isExactIn ? TranslateString(1210, 'Minimum received') : TranslateString(220, 'Maximum sold')}\n \n \n \n \n \n {isExactIn\n ? `${slippageAdjustedAmounts[Field.OUTPUT]?.toSignificant(4)} ${trade.outputAmount.currency.symbol}` ??\n '-'\n : `${slippageAdjustedAmounts[Field.INPUT]?.toSignificant(4)} ${trade.inputAmount.currency.symbol}` ??\n '-'}\n \n \n \n \n \n {TranslateString(226, 'Price Impact')}\n \n \n \n \n\n \n \n {TranslateString(228, 'Liquidity Provider Fee')}\n \n \n \n {realizedLPFee ? `${realizedLPFee.toSignificant(4)} ${trade.inputAmount.currency.symbol}` : '-'}\n \n \n \n \n )\n}\n\nexport interface AdvancedSwapDetailsProps {\n trade?: Trade\n}\n\nexport function AdvancedSwapDetails({ trade }: AdvancedSwapDetailsProps) {\n const [allowedSlippage] = useUserSlippageTolerance()\n const TranslateString = useI18n()\n const showRoute = Boolean(trade && trade.route.path.length > 2)\n\n return (\n \n {trade && (\n <>\n \n {showRoute && (\n <>\n \n \n \n Route\n \n \n \n \n \n )}\n \n )}\n \n )\n}\n","import React from 'react'\nimport styled from 'styled-components'\nimport { useLastTruthy } from '../../hooks/useLast'\nimport { AdvancedSwapDetails, AdvancedSwapDetailsProps } from './AdvancedSwapDetails'\n\nconst AdvancedDetailsFooter = styled.div<{ show: boolean }>`\n padding-top: calc(16px + 2rem);\n padding-bottom: 20px;\n margin-top: -2rem;\n width: 100%;\n max-width: 400px;\n border-bottom-left-radius: 20px;\n border-bottom-right-radius: 20px;\n color: ${({ theme }) => theme.colors.textSubtle};\n z-index: 1;\n\n transform: ${({ show }) => (show ? 'translateY(0%)' : 'translateY(-100%)')};\n transition: transform 300ms ease-in-out;\n`\n\nexport default function AdvancedSwapDetailsDropdown({ trade, ...rest }: AdvancedSwapDetailsProps) {\n const lastTrade = useLastTruthy(trade)\n\n return (\n \n \n \n )\n}\n","import React from 'react'\nimport { Price } from '@pancakeswap-libs/sdk'\nimport { SyncAltIcon, Text } from '@pancakeswap-libs/uikit'\nimport { StyledBalanceMaxMini } from './styleds'\n\ninterface TradePriceProps {\n price?: Price\n showInverted: boolean\n setShowInverted: (showInverted: boolean) => void\n}\n\nexport default function TradePrice({ price, showInverted, setShowInverted }: TradePriceProps) {\n const formattedPrice = showInverted ? price?.toSignificant(6) : price?.invert()?.toSignificant(6)\n\n const show = Boolean(price?.baseCurrency && price?.quoteCurrency)\n const label = showInverted\n ? `${price?.quoteCurrency?.symbol} per ${price?.baseCurrency?.symbol}`\n : `${price?.baseCurrency?.symbol} per ${price?.quoteCurrency?.symbol}`\n\n return (\n \n {show ? (\n <>\n {formattedPrice ?? '-'} {label}\n setShowInverted(!showInverted)}>\n \n \n \n ) : (\n '-'\n )}\n \n )\n}\n","import { Token } from '@pancakeswap-libs/sdk'\nimport { transparentize } from 'polished'\nimport { Button, Text } from '@pancakeswap-libs/uikit'\nimport React, { useCallback, useMemo, useState } from 'react'\nimport styled from 'styled-components'\nimport { AlertTriangle } from 'react-feather'\nimport useI18n from 'hooks/useI18n'\nimport { useActiveWeb3React } from '../../hooks'\nimport { useAllTokens } from '../../hooks/Tokens'\nimport { getBscScanLink, shortenAddress } from '../../utils'\nimport { ExternalLink } from '../Shared'\nimport CurrencyLogo from '../CurrencyLogo'\nimport Modal from '../Modal'\nimport { AutoRow, RowBetween } from '../Row'\nimport { AutoColumn } from '../Column'\n\nconst Wrapper = styled.div<{ error: boolean }>`\n background: ${({ theme }) => transparentize(0.6, theme.colors.tertiary)};\n padding: 0.75rem;\n border-radius: 20px;\n`\n\nconst WarningContainer = styled.div`\n max-width: 420px;\n width: 100%;\n padding: 1rem;\n background: rgba(242, 150, 2, 0.05);\n border: 1px solid #f3841e;\n border-radius: 20px;\n overflow: auto;\n`\n\nconst StyledWarningIcon = styled(AlertTriangle)`\n stroke: ${({ theme }) => theme.colors.failure};\n`\n\ninterface TokenWarningCardProps {\n token?: Token\n}\n\nfunction TokenWarningCard({ token }: TokenWarningCardProps) {\n const { chainId } = useActiveWeb3React()\n const TranslateString = useI18n()\n const tokenSymbol = token?.symbol?.toLowerCase() ?? ''\n const tokenName = token?.name?.toLowerCase() ?? ''\n\n const allTokens = useAllTokens()\n\n const duplicateNameOrSymbol = useMemo(() => {\n if (!token || !chainId) return false\n\n return Object.keys(allTokens).some((tokenAddress) => {\n const userToken = allTokens[tokenAddress]\n if (userToken.equals(token)) {\n return false\n }\n return userToken.symbol?.toLowerCase() === tokenSymbol || userToken.name?.toLowerCase() === tokenName\n })\n }, [token, chainId, allTokens, tokenSymbol, tokenName])\n\n if (!token) return null\n\n return (\n \n \n \n \n
\n
\n \n \n {token && token.name && token.symbol && token.name !== token.symbol\n ? `${token.name} (${token.symbol})`\n : token.name || token.symbol}{' '}\n \n {chainId && (\n \n \n {shortenAddress(token.address)} {TranslateString(116, '(View on BscScan)')}\n \n \n )}\n \n
\n
\n )\n}\n\nexport default function TokenWarningModal({\n isOpen,\n tokens,\n onConfirm,\n}: {\n isOpen: boolean\n tokens: Token[]\n onConfirm: () => void\n}) {\n const [understandChecked, setUnderstandChecked] = useState(false)\n const toggleUnderstand = useCallback(() => setUnderstandChecked((uc) => !uc), [])\n const TranslateString = useI18n()\n\n const handleDismiss = useCallback(() => null, [])\n return (\n \n \n \n \n \n {TranslateString(1128, 'Token imported')}\n \n \n {TranslateString(\n 1130,\n 'Anyone can create a BEP20 token on BSC with any name, including creating fake versions of existing tokens and tokens that claim to represent projects that do not have a token.'\n )}\n \n \n {TranslateString(\n 1132,\n 'This interface can load arbitrary tokens by token addresses. Please take extra caution and do your research when interacting with arbitrary BEP20 tokens.'\n )}\n \n {TranslateString(1134, 'If you purchase an arbitrary token, you may be unable to sell it back.')}\n {tokens.map((token) => {\n return \n })}\n \n
\n \n
\n {\n onConfirm()\n }}\n >\n {TranslateString(150, 'Continue')}\n \n
\n
\n
\n
\n )\n}\n","import React, { useCallback, useState } from 'react'\nimport styled from 'styled-components'\nimport { Button, Text } from '@pancakeswap-libs/uikit'\nimport { AlertTriangle } from 'react-feather'\nimport Modal from '../Modal'\nimport { AutoRow, RowBetween } from '../Row'\nimport { AutoColumn } from '../Column'\n\nconst WarningContainer = styled.div`\n max-width: 420px;\n width: 100%;\n padding: 1rem;\n background: rgba(242, 150, 2, 0.05);\n border: 1px solid #f3841e;\n border-radius: 20px;\n overflow: auto;\n`\n\nconst StyledWarningIcon = styled(AlertTriangle)`\n stroke: ${({ theme }) => theme.colors.failure};\n`\n\nexport default function SyrupWarningModal({\n isOpen,\n transactionType,\n onConfirm,\n}: {\n isOpen: boolean\n transactionType: string | null\n onConfirm: () => void\n}) {\n const [understandChecked, setUnderstandChecked] = useState(false)\n const toggleUnderstand = useCallback(() => setUnderstandChecked((uc) => !uc), [])\n\n const handleDismiss = useCallback(() => null, [])\n return (\n \n \n \n \n \n Syrup Warning\n \n {transactionType !== '' && (\n <>\n \n Please be careful when {transactionType} SYRUP.\n \n \n {transactionType === 'Buying'\n ? 'You will not receive CAKE rewards for holding purchased SYRUP.'\n : 'You will need to buy back the same amount of SYRUP to be able to convert back to CAKE.'}\n \n \n )}\n \n
\n \n
\n {\n setUnderstandChecked(false)\n onConfirm()\n }}\n >\n Continue\n \n
\n
\n
\n
\n )\n}\n","import React, { useCallback, useState } from 'react'\nimport styled from 'styled-components'\nimport { Button, Text } from '@pancakeswap-libs/uikit'\nimport { AlertTriangle } from 'react-feather'\nimport Modal from '../Modal'\nimport { AutoRow, RowBetween } from '../Row'\nimport { AutoColumn } from '../Column'\n\nconst WarningContainer = styled.div`\n max-width: 420px;\n width: 100%;\n padding: 1rem;\n background: rgba(242, 150, 2, 0.05);\n border: 1px solid #f3841e;\n border-radius: 20px;\n overflow: auto;\n`\n\nconst StyledWarningIcon = styled(AlertTriangle)`\n stroke: ${({ theme }) => theme.colors.binance};\n`\n\nexport default function SafeMoonWarningModal({ isOpen, onConfirm }: { isOpen: boolean; onConfirm: () => void }) {\n const [understandChecked, setUnderstandChecked] = useState(false)\n const toggleUnderstand = useCallback(() => setUnderstandChecked((uc) => !uc), [])\n\n const handleDismiss = useCallback(() => null, [])\n return (\n \n \n \n \n \n Notice for trading SafeMoon\n \n <>\n \n To trade SAFEMOON, you must click on the settings icon and{' '}\n set your slippage tolerance to 12%+\n \n This is because SafeMoon taxes a 10% fee on each transaction.\n • 5% fee = redistributed to all existing holders\n • 5% fee = used to add liquidity\n \n \n
\n \n
\n {\n setUnderstandChecked(false)\n onConfirm()\n }}\n >\n Continue\n \n
\n
\n
\n
\n )\n}\n","import React from 'react'\nimport styled from 'styled-components'\nimport { transparentize } from 'polished'\nimport { RowBetween } from '../Row'\nimport { AutoColumn } from '../Column'\n\nconst Wrapper = styled(AutoColumn)`\n margin-top: 1.25rem;\n`\n\nconst Grouping = styled(RowBetween)`\n width: 50%;\n`\n\nconst Circle = styled.div<{ confirmed?: boolean; disabled?: boolean }>`\n min-width: 20px;\n min-height: 20px;\n background-color: ${({ theme, confirmed, disabled }) =>\n disabled ? theme.colors.backgroundDisabled : confirmed ? theme.colors.success : theme.colors.primary};\n border-radius: 50%;\n display: flex;\n align-items: center;\n justify-content: center;\n line-height: 8px;\n font-size: 12px;\n color: ${({ theme, confirmed, disabled }) =>\n disabled ? theme.colors.text : confirmed ? theme.colors.success : '#FFFFFF'};\n`\n\nconst CircleRow = styled.div`\n width: calc(100% - 20px);\n display: flex;\n align-items: center;\n`\n\nconst Connector = styled.div<{ prevConfirmed?: boolean }>`\n width: 100%;\n height: 2px;\n background-color: ;\n background: linear-gradient(\n 90deg,\n ${({ theme, prevConfirmed }) => transparentize(0.5, prevConfirmed ? theme.colors.success : theme.colors.primary)} 0%,\n ${({ theme, prevConfirmed }) => (prevConfirmed ? theme.colors.primary : theme.colors.backgroundDisabled)} 80%\n );\n opacity: 0.6;\n`\n\ninterface ProgressCirclesProps {\n steps: boolean[]\n}\n\n/**\n * Based on array of steps, create a step counter of circles.\n * A circle can be enabled, disabled, or confirmed. States are derived\n * from previous step.\n *\n * An extra circle is added to represent the ability to swap, add, or remove.\n * This step will never be marked as complete (because no 'txn done' state in body ui).\n *\n * @param steps array of booleans where true means step is complete\n */\nexport default function ProgressCircles({ steps }: ProgressCirclesProps) {\n return (\n \n \n {steps.map((step, i) => {\n return (\n // eslint-disable-next-line react/no-array-index-key\n \n \n {step ? '✓' : i + 1}\n \n \n \n )\n })}\n {steps.length + 1}\n \n \n )\n}\n","import { BigNumber } from '@ethersproject/bignumber'\nimport { Contract } from '@ethersproject/contracts'\nimport { JSBI, Percent, Router, SwapParameters, Trade, TradeType } from '@pancakeswap-libs/sdk'\nimport { useMemo } from 'react'\nimport { BIPS_BASE, DEFAULT_DEADLINE_FROM_NOW, INITIAL_ALLOWED_SLIPPAGE } from '../constants'\nimport { useTransactionAdder } from '../state/transactions/hooks'\nimport { calculateGasMargin, getRouterContract, isAddress, shortenAddress } from '../utils'\nimport isZero from '../utils/isZero'\nimport { useActiveWeb3React } from './index'\nimport useENS from './useENS'\n\n enum SwapCallbackState {\n INVALID,\n LOADING,\n VALID,\n}\n\ninterface SwapCall {\n contract: Contract\n parameters: SwapParameters\n}\n\ninterface SuccessfulCall {\n call: SwapCall\n gasEstimate: BigNumber\n}\n\ninterface FailedCall {\n call: SwapCall\n error: Error\n}\n\ntype EstimatedSwapCall = SuccessfulCall | FailedCall\n\n/**\n * Returns the swap calls that can be used to make the trade\n * @param trade trade to execute\n * @param allowedSlippage user allowed slippage\n * @param deadline the deadline for the trade\n * @param recipientAddressOrName\n */\nfunction useSwapCallArguments(\n trade: Trade | undefined, // trade to execute, required\n allowedSlippage: number = INITIAL_ALLOWED_SLIPPAGE, // in bips\n deadline: number = DEFAULT_DEADLINE_FROM_NOW, // in seconds from now\n recipientAddressOrName: string | null // the ENS name or address of the recipient of the trade, or null if swap should be returned to sender\n): SwapCall[] {\n const { account, chainId, library } = useActiveWeb3React()\n\n const { address: recipientAddress } = useENS(recipientAddressOrName)\n const recipient = recipientAddressOrName === null ? account : recipientAddress\n\n return useMemo(() => {\n if (!trade || !recipient || !library || !account || !chainId) return []\n\n const contract: Contract | null = getRouterContract(chainId, library, account)\n if (!contract) {\n return []\n }\n\n const swapMethods = []\n\n swapMethods.push(\n // @ts-ignore\n Router.swapCallParameters(trade, {\n feeOnTransfer: false,\n allowedSlippage: new Percent(JSBI.BigInt(Math.floor(allowedSlippage)), BIPS_BASE),\n recipient,\n ttl: deadline,\n })\n )\n\n if (trade.tradeType === TradeType.EXACT_INPUT) {\n swapMethods.push(\n // @ts-ignore\n Router.swapCallParameters(trade, {\n feeOnTransfer: true,\n allowedSlippage: new Percent(JSBI.BigInt(Math.floor(allowedSlippage)), BIPS_BASE),\n recipient,\n ttl: deadline,\n })\n )\n }\n\n return swapMethods.map((parameters) => ({ parameters, contract }))\n }, [account, allowedSlippage, chainId, deadline, library, recipient, trade])\n}\n\n// returns a function that will execute a swap, if the parameters are all valid\n// and the user has approved the slippage adjusted input amount for the trade\nexport function useSwapCallback(\n trade: Trade | undefined, // trade to execute, required\n allowedSlippage: number = INITIAL_ALLOWED_SLIPPAGE, // in bips\n deadline: number = DEFAULT_DEADLINE_FROM_NOW, // in seconds from now\n recipientAddressOrName: string | null // the ENS name or address of the recipient of the trade, or null if swap should be returned to sender\n): { state: SwapCallbackState; callback: null | (() => Promise); error: string | null } {\n const { account, chainId, library } = useActiveWeb3React()\n\n const swapCalls = useSwapCallArguments(trade, allowedSlippage, deadline, recipientAddressOrName)\n\n const addTransaction = useTransactionAdder()\n\n const { address: recipientAddress } = useENS(recipientAddressOrName)\n const recipient = recipientAddressOrName === null ? account : recipientAddress\n\n return useMemo(() => {\n if (!trade || !library || !account || !chainId) {\n return { state: SwapCallbackState.INVALID, callback: null, error: 'Missing dependencies' }\n }\n if (!recipient) {\n if (recipientAddressOrName !== null) {\n return { state: SwapCallbackState.INVALID, callback: null, error: 'Invalid recipient' }\n }\n return { state: SwapCallbackState.LOADING, callback: null, error: null }\n }\n\n return {\n state: SwapCallbackState.VALID,\n callback: async function onSwap(): Promise {\n const estimatedCalls: EstimatedSwapCall[] = await Promise.all(\n swapCalls.map((call) => {\n const {\n parameters: { methodName, args, value },\n contract,\n } = call\n const options = !value || isZero(value) ? {} : { value }\n\n return contract.estimateGas[methodName](...args, options)\n .then((gasEstimate) => {\n return {\n call,\n gasEstimate,\n }\n })\n .catch((gasError) => {\n console.info('Gas estimate failed, trying eth_call to extract error', call)\n\n return contract.callStatic[methodName](...args, options)\n .then((result) => {\n console.info('Unexpected successful call after failed estimate gas', call, gasError, result)\n return { call, error: new Error('Unexpected issue with estimating the gas. Please try again.') }\n })\n .catch((callError) => {\n console.info('Call threw error', call, callError)\n let errorMessage: string\n switch (callError.reason) {\n case 'UniswapV2Router: INSUFFICIENT_OUTPUT_AMOUNT':\n case 'UniswapV2Router: EXCESSIVE_INPUT_AMOUNT':\n errorMessage =\n 'This transaction will not succeed either due to price movement or fee on transfer. Try increasing your slippage tolerance.'\n break\n default:\n errorMessage = `The transaction cannot succeed due to error: ${callError.reason}. This is probably an issue with one of the tokens you are swapping.`\n }\n return { call, error: new Error(errorMessage) }\n })\n })\n })\n )\n\n // a successful estimation is a bignumber gas estimate and the next call is also a bignumber gas estimate\n const successfulEstimation = estimatedCalls.find(\n (el, ix, list): el is SuccessfulCall =>\n 'gasEstimate' in el && (ix === list.length - 1 || 'gasEstimate' in list[ix + 1])\n )\n\n if (!successfulEstimation) {\n const errorCalls = estimatedCalls.filter((call): call is FailedCall => 'error' in call)\n if (errorCalls.length > 0) throw errorCalls[errorCalls.length - 1].error\n throw new Error('Unexpected error. Please contact support: none of the calls threw an error')\n }\n\n const {\n call: {\n contract,\n parameters: { methodName, args, value },\n },\n gasEstimate,\n } = successfulEstimation\n\n return contract[methodName](...args, {\n gasLimit: calculateGasMargin(gasEstimate),\n ...(value && !isZero(value) ? { value, from: account } : { from: account }),\n })\n .then((response: any) => {\n const inputSymbol = trade.inputAmount.currency.symbol\n const outputSymbol = trade.outputAmount.currency.symbol\n const inputAmount = trade.inputAmount.toSignificant(3)\n const outputAmount = trade.outputAmount.toSignificant(3)\n\n const base = `Swap ${inputAmount} ${inputSymbol} for ${outputAmount} ${outputSymbol}`\n const withRecipient =\n recipient === account\n ? base\n : `${base} to ${\n recipientAddressOrName && isAddress(recipientAddressOrName)\n ? shortenAddress(recipientAddressOrName)\n : recipientAddressOrName\n }`\n\n addTransaction(response, {\n summary: withRecipient,\n })\n\n return response.hash\n })\n .catch((error: any) => {\n // if the user rejected the tx, pass this along\n if (error?.code === 4001) {\n throw new Error('Transaction rejected.')\n } else {\n // otherwise, the error was unexpected and we need to convey that\n console.error(`Swap failed`, error, methodName, args, value)\n throw new Error(`Swap failed: ${error.message}`)\n }\n })\n },\n error: null,\n }\n }, [trade, library, account, chainId, recipient, recipientAddressOrName, swapCalls, addTransaction])\n}\n\nexport default useSwapCallback","import { Currency, currencyEquals, ETHER, WETH } from '@pancakeswap-libs/sdk'\nimport { useMemo } from 'react'\nimport { tryParseAmount } from '../state/swap/hooks'\nimport { useTransactionAdder } from '../state/transactions/hooks'\nimport { useCurrencyBalance } from '../state/wallet/hooks'\nimport { useActiveWeb3React } from './index'\nimport { useWETHContract } from './useContract'\n\nexport enum WrapType {\n NOT_APPLICABLE,\n WRAP,\n UNWRAP\n}\n\nconst NOT_APPLICABLE = { wrapType: WrapType.NOT_APPLICABLE }\n/**\n * Given the selected input and output currency, return a wrap callback\n * @param inputCurrency the selected input currency\n * @param outputCurrency the selected output currency\n * @param typedValue the user input value\n */\nexport default function useWrapCallback(\n inputCurrency: Currency | undefined,\n outputCurrency: Currency | undefined,\n typedValue: string | undefined\n): { wrapType: WrapType; execute?: undefined | (() => Promise); inputError?: string } {\n const { chainId, account } = useActiveWeb3React()\n const wethContract = useWETHContract()\n const balance = useCurrencyBalance(account ?? undefined, inputCurrency)\n // we can always parse the amount typed as the input currency, since wrapping is 1:1\n const inputAmount = useMemo(() => tryParseAmount(typedValue, inputCurrency), [inputCurrency, typedValue])\n const addTransaction = useTransactionAdder()\n\n return useMemo(() => {\n if (!wethContract || !chainId || !inputCurrency || !outputCurrency) return NOT_APPLICABLE\n\n const sufficientBalance = inputAmount && balance && !balance.lessThan(inputAmount)\n\n if (inputCurrency === ETHER && currencyEquals(WETH[chainId], outputCurrency)) {\n return {\n wrapType: WrapType.WRAP,\n execute:\n sufficientBalance && inputAmount\n ? async () => {\n try {\n const txReceipt = await wethContract.deposit({ value: `0x${inputAmount.raw.toString(16)}` })\n addTransaction(txReceipt, { summary: `Wrap ${inputAmount.toSignificant(6)} BNB to WBNB` })\n } catch (error) {\n console.error('Could not deposit', error)\n }\n }\n : undefined,\n inputError: sufficientBalance ? undefined : 'Insufficient BNB balance'\n }\n } if (currencyEquals(WETH[chainId], inputCurrency) && outputCurrency === ETHER) {\n return {\n wrapType: WrapType.UNWRAP,\n execute:\n sufficientBalance && inputAmount\n ? async () => {\n try {\n const txReceipt = await wethContract.withdraw(`0x${inputAmount.raw.toString(16)}`)\n addTransaction(txReceipt, { summary: `Unwrap ${inputAmount.toSignificant(6)} WBNB to BNB` })\n } catch (error) {\n console.error('Could not withdraw', error)\n }\n }\n : undefined,\n inputError: sufficientBalance ? undefined : 'Insufficient WBNB balance'\n }\n } \n return NOT_APPLICABLE\n \n }, [wethContract, chainId, inputCurrency, outputCurrency, inputAmount, balance, addTransaction])\n}\n","import { CurrencyAmount, JSBI, Token, Trade } from '@pancakeswap-libs/sdk'\nimport React, { useCallback, useContext, useEffect, useMemo, useState } from 'react'\nimport { ArrowDown } from 'react-feather'\nimport { CardBody, ArrowDownIcon, Button, IconButton, Text } from '@pancakeswap-libs/uikit'\nimport { ThemeContext } from 'styled-components'\nimport AddressInputPanel from 'components/AddressInputPanel'\nimport Card, { GreyCard } from 'components/Card'\nimport { AutoColumn } from 'components/Column'\nimport ConfirmSwapModal from 'components/swap/ConfirmSwapModal'\nimport CurrencyInputPanel from 'components/CurrencyInputPanel'\nimport CardNav from 'components/CardNav'\nimport { AutoRow, RowBetween } from 'components/Row'\nimport AdvancedSwapDetailsDropdown from 'components/swap/AdvancedSwapDetailsDropdown'\nimport confirmPriceImpactWithoutFee from 'components/swap/confirmPriceImpactWithoutFee'\nimport { ArrowWrapper, BottomGrouping, SwapCallbackError, Wrapper } from 'components/swap/styleds'\nimport TradePrice from 'components/swap/TradePrice'\nimport TokenWarningModal from 'components/TokenWarningModal'\nimport SyrupWarningModal from 'components/SyrupWarningModal'\nimport SafeMoonWarningModal from 'components/SafeMoonWarningModal'\nimport ProgressSteps from 'components/ProgressSteps'\n\nimport { INITIAL_ALLOWED_SLIPPAGE } from 'constants/index'\nimport { useActiveWeb3React } from 'hooks'\nimport { useCurrency } from 'hooks/Tokens'\nimport { ApprovalState, useApproveCallbackFromTrade } from 'hooks/useApproveCallback'\nimport { useSwapCallback } from 'hooks/useSwapCallback'\nimport useWrapCallback, { WrapType } from 'hooks/useWrapCallback'\nimport { Field } from 'state/swap/actions'\nimport { useDefaultsFromURLSearch, useDerivedSwapInfo, useSwapActionHandlers, useSwapState } from 'state/swap/hooks'\nimport { useExpertModeManager, useUserDeadline, useUserSlippageTolerance } from 'state/user/hooks'\nimport { LinkStyledButton } from 'components/Shared'\nimport { maxAmountSpend } from 'utils/maxAmountSpend'\nimport { computeTradePriceBreakdown, warningSeverity } from 'utils/prices'\nimport Loader from 'components/Loader'\nimport useI18n from 'hooks/useI18n'\nimport PageHeader from 'components/PageHeader'\nimport ConnectWalletButton from 'components/ConnectWalletButton'\nimport AppBody from '../AppBody'\n\nconst Swap = () => {\n const loadedUrlParams = useDefaultsFromURLSearch()\n const TranslateString = useI18n()\n\n // token warning stuff\n const [loadedInputCurrency, loadedOutputCurrency] = [\n useCurrency(loadedUrlParams?.inputCurrencyId),\n useCurrency(loadedUrlParams?.outputCurrencyId),\n ]\n const [dismissTokenWarning, setDismissTokenWarning] = useState(false)\n const [transactionWarning, setTransactionWarning] = useState<{\n selectedToken: string | null\n purchaseType: string | null\n }>({\n selectedToken: null,\n purchaseType: null,\n })\n const urlLoadedTokens: Token[] = useMemo(\n () => [loadedInputCurrency, loadedOutputCurrency]?.filter((c): c is Token => c instanceof Token) ?? [],\n [loadedInputCurrency, loadedOutputCurrency]\n )\n const handleConfirmTokenWarning = useCallback(() => {\n setDismissTokenWarning(true)\n }, [])\n\n const handleConfirmWarning = () => {\n setTransactionWarning({\n selectedToken: null,\n purchaseType: null,\n })\n }\n\n const { account } = useActiveWeb3React()\n const theme = useContext(ThemeContext)\n\n const [isExpertMode] = useExpertModeManager()\n\n // get custom setting values for user\n const [deadline] = useUserDeadline()\n const [allowedSlippage] = useUserSlippageTolerance()\n\n // swap state\n const { independentField, typedValue, recipient } = useSwapState()\n const { v2Trade, currencyBalances, parsedAmount, currencies, inputError: swapInputError } = useDerivedSwapInfo()\n const { wrapType, execute: onWrap, inputError: wrapInputError } = useWrapCallback(\n currencies[Field.INPUT],\n currencies[Field.OUTPUT],\n typedValue\n )\n const showWrap: boolean = wrapType !== WrapType.NOT_APPLICABLE\n const trade = showWrap ? undefined : v2Trade\n\n const parsedAmounts = showWrap\n ? {\n [Field.INPUT]: parsedAmount,\n [Field.OUTPUT]: parsedAmount,\n }\n : {\n [Field.INPUT]: independentField === Field.INPUT ? parsedAmount : trade?.inputAmount,\n [Field.OUTPUT]: independentField === Field.OUTPUT ? parsedAmount : trade?.outputAmount,\n }\n\n const { onSwitchTokens, onCurrencySelection, onUserInput, onChangeRecipient } = useSwapActionHandlers()\n const isValid = !swapInputError\n const dependentField: Field = independentField === Field.INPUT ? Field.OUTPUT : Field.INPUT\n\n const handleTypeInput = useCallback(\n (value: string) => {\n onUserInput(Field.INPUT, value)\n },\n [onUserInput]\n )\n const handleTypeOutput = useCallback(\n (value: string) => {\n onUserInput(Field.OUTPUT, value)\n },\n [onUserInput]\n )\n\n // modal and loading\n const [{ showConfirm, tradeToConfirm, swapErrorMessage, attemptingTxn, txHash }, setSwapState] = useState<{\n showConfirm: boolean\n tradeToConfirm: Trade | undefined\n attemptingTxn: boolean\n swapErrorMessage: string | undefined\n txHash: string | undefined\n }>({\n showConfirm: false,\n tradeToConfirm: undefined,\n attemptingTxn: false,\n swapErrorMessage: undefined,\n txHash: undefined,\n })\n\n const formattedAmounts = {\n [independentField]: typedValue,\n [dependentField]: showWrap\n ? parsedAmounts[independentField]?.toExact() ?? ''\n : parsedAmounts[dependentField]?.toSignificant(6) ?? '',\n }\n\n const route = trade?.route\n const userHasSpecifiedInputOutput = Boolean(\n currencies[Field.INPUT] && currencies[Field.OUTPUT] && parsedAmounts[independentField]?.greaterThan(JSBI.BigInt(0))\n )\n const noRoute = !route\n\n // check whether the user has approved the router on the input token\n const [approval, approveCallback] = useApproveCallbackFromTrade(trade, allowedSlippage)\n\n // check if user has gone through approval process, used to show two step buttons, reset on token change\n const [approvalSubmitted, setApprovalSubmitted] = useState(false)\n\n // mark when a user has submitted an approval, reset onTokenSelection for input field\n useEffect(() => {\n if (approval === ApprovalState.PENDING) {\n setApprovalSubmitted(true)\n }\n }, [approval, approvalSubmitted])\n\n const maxAmountInput: CurrencyAmount | undefined = maxAmountSpend(currencyBalances[Field.INPUT])\n const atMaxAmountInput = Boolean(maxAmountInput && parsedAmounts[Field.INPUT]?.equalTo(maxAmountInput))\n\n // the callback to execute the swap\n const { callback: swapCallback, error: swapCallbackError } = useSwapCallback(\n trade,\n allowedSlippage,\n deadline,\n recipient\n )\n\n const { priceImpactWithoutFee } = computeTradePriceBreakdown(trade)\n\n const handleSwap = useCallback(() => {\n if (priceImpactWithoutFee && !confirmPriceImpactWithoutFee(priceImpactWithoutFee)) {\n return\n }\n if (!swapCallback) {\n return\n }\n setSwapState((prevState) => ({ ...prevState, attemptingTxn: true, swapErrorMessage: undefined, txHash: undefined }))\n swapCallback()\n .then((hash) => {\n setSwapState((prevState) => ({\n ...prevState,\n attemptingTxn: false,\n swapErrorMessage: undefined,\n txHash: hash,\n }))\n })\n .catch((error) => {\n setSwapState((prevState) => ({\n ...prevState,\n attemptingTxn: false,\n swapErrorMessage: error.message,\n txHash: undefined,\n }))\n })\n }, [priceImpactWithoutFee, swapCallback, setSwapState])\n\n // errors\n const [showInverted, setShowInverted] = useState(false)\n\n // warnings on slippage\n const priceImpactSeverity = warningSeverity(priceImpactWithoutFee)\n\n // show approve flow when: no error on inputs, not approved or pending, or approved in current session\n // never show if price impact is above threshold in non expert mode\n const showApproveFlow =\n !swapInputError &&\n (approval === ApprovalState.NOT_APPROVED ||\n approval === ApprovalState.PENDING ||\n (approvalSubmitted && approval === ApprovalState.APPROVED)) &&\n !(priceImpactSeverity > 3 && !isExpertMode)\n\n const handleConfirmDismiss = useCallback(() => {\n setSwapState((prevState) => ({ ...prevState, showConfirm: false }))\n\n // if there was a tx hash, we want to clear the input\n if (txHash) {\n onUserInput(Field.INPUT, '')\n }\n }, [onUserInput, txHash, setSwapState])\n\n const handleAcceptChanges = useCallback(() => {\n setSwapState((prevState) => ({ ...prevState, tradeToConfirm: trade }))\n }, [trade])\n\n // This will check to see if the user has selected Syrup or SafeMoon to either buy or sell.\n // If so, they will be alerted with a warning message.\n const checkForWarning = useCallback(\n (selected: string, purchaseType: string) => {\n if (['SYRUP', 'SAFEMOON'].includes(selected)) {\n setTransactionWarning({\n selectedToken: selected,\n purchaseType,\n })\n }\n },\n [setTransactionWarning]\n )\n\n const handleInputSelect = useCallback(\n (inputCurrency) => {\n setApprovalSubmitted(false) // reset 2 step UI for approvals\n onCurrencySelection(Field.INPUT, inputCurrency)\n if (inputCurrency.symbol === 'SYRUP') {\n checkForWarning(inputCurrency.symbol, 'Selling')\n }\n if (inputCurrency.symbol === 'SAFEMOON') {\n checkForWarning(inputCurrency.symbol, 'Selling')\n }\n },\n [onCurrencySelection, setApprovalSubmitted, checkForWarning]\n )\n\n const handleMaxInput = useCallback(() => {\n if (maxAmountInput) {\n onUserInput(Field.INPUT, maxAmountInput.toExact())\n }\n }, [maxAmountInput, onUserInput])\n\n const handleOutputSelect = useCallback(\n (outputCurrency) => {\n onCurrencySelection(Field.OUTPUT, outputCurrency)\n if (outputCurrency.symbol === 'SYRUP') {\n checkForWarning(outputCurrency.symbol, 'Buying')\n }\n if (outputCurrency.symbol === 'SAFEMOON') {\n checkForWarning(outputCurrency.symbol, 'Buying')\n }\n },\n [onCurrencySelection, checkForWarning]\n )\n\n return (\n <>\n 0 && !dismissTokenWarning}\n tokens={urlLoadedTokens}\n onConfirm={handleConfirmTokenWarning}\n />\n \n \n \n \n \n \n \n \n \n \n \n \n \n {\n setApprovalSubmitted(false) // reset 2 step UI for approvals\n onSwitchTokens()\n }}\n style={{ borderRadius: '50%' }}\n scale=\"sm\"\n >\n \n \n \n {recipient === null && !showWrap && isExpertMode ? (\n onChangeRecipient('')}>\n + Add a send (optional)\n \n ) : null}\n \n \n \n\n {recipient !== null && !showWrap ? (\n <>\n \n \n \n \n onChangeRecipient(null)}>\n - Remove send\n \n \n \n \n ) : null}\n\n {showWrap ? null : (\n \n \n {Boolean(trade) && (\n \n {TranslateString(1182, 'Price')}\n \n \n )}\n {allowedSlippage !== INITIAL_ALLOWED_SLIPPAGE && (\n \n {TranslateString(88, 'Slippage Tolerance')}\n {allowedSlippage / 100}%\n \n )}\n \n \n )}\n \n \n {!account ? (\n \n ) : showWrap ? (\n \n ) : noRoute && userHasSpecifiedInputOutput ? (\n \n {TranslateString(1194, 'Insufficient liquidity for this trade.')}\n \n ) : showApproveFlow ? (\n \n \n {approval === ApprovalState.PENDING ? (\n \n Approving \n \n ) : approvalSubmitted && approval === ApprovalState.APPROVED ? (\n 'Approved'\n ) : (\n `Approve ${currencies[Field.INPUT]?.symbol}`\n )}\n \n {\n if (isExpertMode) {\n handleSwap()\n } else {\n setSwapState({\n tradeToConfirm: trade,\n attemptingTxn: false,\n swapErrorMessage: undefined,\n showConfirm: true,\n txHash: undefined,\n })\n }\n }}\n style={{ width: '48%' }}\n id=\"swap-button\"\n disabled={\n !isValid || approval !== ApprovalState.APPROVED || (priceImpactSeverity > 3 && !isExpertMode)\n }\n variant={isValid && priceImpactSeverity > 2 ? 'danger' : 'primary'}\n >\n {priceImpactSeverity > 3 && !isExpertMode\n ? `Price Impact High`\n : `Swap${priceImpactSeverity > 2 ? ' Anyway' : ''}`}\n \n \n ) : (\n {\n if (isExpertMode) {\n handleSwap()\n } else {\n setSwapState({\n tradeToConfirm: trade,\n attemptingTxn: false,\n swapErrorMessage: undefined,\n showConfirm: true,\n txHash: undefined,\n })\n }\n }}\n id=\"swap-button\"\n disabled={!isValid || (priceImpactSeverity > 3 && !isExpertMode) || !!swapCallbackError}\n variant={isValid && priceImpactSeverity > 2 && !swapCallbackError ? 'danger' : 'primary'}\n width=\"100%\"\n >\n {swapInputError ||\n (priceImpactSeverity > 3 && !isExpertMode\n ? `Price Impact Too High`\n : `Swap${priceImpactSeverity > 2 ? ' Anyway' : ''}`)}\n \n )}\n {showApproveFlow && }\n {isExpertMode && swapErrorMessage ? : null}\n \n \n \n \n \n \n )\n}\n\nexport default Swap\n","import { Percent } from '@pancakeswap-libs/sdk'\nimport { ALLOWED_PRICE_IMPACT_HIGH, PRICE_IMPACT_WITHOUT_FEE_CONFIRM_MIN } from '../../constants'\n\n/**\n * Given the price impact, get user confirmation.\n *\n * @param priceImpactWithoutFee price impact of the trade without the fee.\n */\nexport default function confirmPriceImpactWithoutFee(priceImpactWithoutFee: Percent): boolean {\n if (!priceImpactWithoutFee.lessThan(PRICE_IMPACT_WITHOUT_FEE_CONFIRM_MIN)) {\n return (\n window.prompt(\n `This swap has a price impact of at least ${PRICE_IMPACT_WITHOUT_FEE_CONFIRM_MIN.toFixed(\n 0\n )}%. Please type the word \"confirm\" to continue with this swap.`\n ) === 'confirm'\n )\n } if (!priceImpactWithoutFee.lessThan(ALLOWED_PRICE_IMPACT_HIGH)) {\n return window.confirm(\n `This swap has a price impact of at least ${ALLOWED_PRICE_IMPACT_HIGH.toFixed(\n 0\n )}%. Please confirm that you would like to continue with this swap.`\n )\n }\n return true\n}\n","import React from 'react'\nimport { Redirect, RouteComponentProps } from 'react-router-dom'\n\n// Redirects to swap but only replace the pathname\nexport function RedirectPathToSwapOnly({ location }: RouteComponentProps) {\n return \n}\n\nexport default RedirectPathToSwapOnly\n","export const EN = { code: 'en', language: 'English' }\nexport const AR = { code: 'ar', language: 'العربية' }\nexport const BN = { code: 'bn', language: 'বাংলা'}\nexport const ZHCN = { code: 'zh-CN', language: '简体中文' }\nexport const ZHTW = { code: 'zh-TW', language: '繁體中文' }\nexport const NL = { code: 'nl', language: 'Nederlands' }\nexport const FIL = { code: 'fil', language: 'Filipino' }\nexport const FI = { code: 'fi', language: 'Suomalainen' }\nexport const FR = { code: 'fr', language: 'Français' }\nexport const DE = { code: 'de', language: 'Deutsch' }\nexport const EL = { code: 'el', language: 'Ελληνικά' }\nexport const HI = { code: 'hi', language: 'हिंदी' }\nexport const HU = { code: 'hu', language: 'Magyar' }\nexport const ID = { code: 'id', language: 'Bahasa Indonesia' }\nexport const IT = { code: 'it', language: 'Italiano' }\nexport const JA = { code: 'ja', language: '日本語' }\nexport const KO = { code: 'ko', language: '한국어' }\nexport const PL = { code: 'pl', language: 'Polski' }\nexport const PTPT = { code: 'pt-PT', language: 'Português (Portugal)' }\nexport const PTBR = { code: 'pt-BR', language: 'Português (Brasil)' }\nexport const RO = { code: 'ro', language: 'Română' }\nexport const RU = { code: 'ru', language: 'Русский' }\nexport const ESES = { code: 'es-ES', language: 'Español' }\nexport const SVSE = { code: 'sv-SE', language: 'Svenska' }\nexport const TA = { code: 'ta', language: 'தமிழ்' }\nexport const TR = { code: 'tr', language: 'Türkçe' }\nexport const UK = { code: 'uk', language: 'Українська' }\nexport const VI = { code: 'vi', language: 'Tiếng Việt' }\n\nexport const allLanguages = [\n EN\n]\n","import React, { createContext } from 'react'\nimport { LangType } from '@pancakeswap-libs/uikit'\n\nexport interface LanguageObject {\n code: string\n language: string\n}\ninterface LanguageState {\n selectedLanguage: LanguageObject\n setSelectedLanguage: (langObject: LangType) => void\n translatedLanguage: LanguageObject\n setTranslatedLanguage: React.Dispatch>\n}\n\nconst defaultLanguageState: LanguageState = {\n selectedLanguage: { code: '', language: '' },\n setSelectedLanguage: (): void => undefined,\n translatedLanguage: { code: '', language: '' },\n setTranslatedLanguage: (): void => undefined,\n}\n\nexport const LanguageContext = createContext(defaultLanguageState as LanguageState)\n","import React, { useState } from 'react'\nimport { ThemeProvider as SCThemeProvider } from 'styled-components'\nimport { light, dark } from '@pancakeswap-libs/uikit'\n\nconst CACHE_KEY = 'IS_DARK'\n\nexport interface ThemeContextType {\n isDark: boolean;\n toggleTheme: () => void;\n}\n\nconst ThemeContext = React.createContext({ isDark: false, toggleTheme: () => null })\n\nconst ThemeContextProvider: React.FC = ({ children }) => {\n const [isDark, setIsDark] = useState(() => {\n const isDarkUserSetting = localStorage.getItem(CACHE_KEY)\n return isDarkUserSetting ? JSON.parse(isDarkUserSetting) : false\n })\n\n const toggleTheme = () => {\n setIsDark((prevState: any) => {\n localStorage.setItem(CACHE_KEY, JSON.stringify(!prevState))\n return !prevState\n })\n }\n\n return (\n \n {children}\n \n )\n}\n\nexport { ThemeContext, ThemeContextProvider }\n","import { useContext } from 'react'\nimport { ThemeContext as StyledThemeCopntext } from 'styled-components'\nimport { ThemeContext } from '../ThemeContext'\n\nconst useTheme = () => {\n const { isDark, toggleTheme } = useContext(ThemeContext)\n const theme = useContext(StyledThemeCopntext)\n return { isDark, toggleTheme, theme }\n}\n\nexport default useTheme\n","import { useEffect, useState } from 'react'\n\ntype ApiResponse = {\n updated_at: string\n data: {\n [key: string]: {\n name: string\n symbol: string\n price: string\n price_BNB: string\n }\n }\n}\n\nconst api = 'https://api.pancakeswap.info/api/tokens'\n\nconst useGetPriceData = () => {\n const [data, setData] = useState(null)\n\n useEffect(() => {\n const fetchData = async () => {\n try {\n const response = await fetch(api)\n const res: ApiResponse = await response.json()\n\n setData(res)\n } catch (error) {\n console.error('Unable to fetch price data:', error)\n }\n }\n\n fetchData()\n }, [setData])\n\n return data\n}\n\nexport default useGetPriceData\n","import { useEffect, useState } from 'react'\nimport Cookies from 'js-cookie'\nimport { useActiveWeb3React } from 'hooks'\n\nconst initialState = {\n profileLink: 'https://pancakeswap.finance/profile',\n noProfileLink: 'https://pancakeswap.finance/profile',\n}\n\n/**\n * Note - this will only work if the app is on the same domain\n */\nconst useGetLocalProfile = () => {\n const [profile, setProfile] = useState(initialState)\n const { account } = useActiveWeb3React()\n\n useEffect(() => {\n if (account) {\n try {\n const localData = Cookies.get(`profile_${account}`)\n\n if (localData) {\n const localProfile = JSON.parse(localData)\n\n setProfile((prevProfile) => ({\n ...prevProfile,\n username: localProfile.username,\n image: localProfile.avatar,\n }))\n }\n } catch (error) {\n setProfile(initialState)\n }\n } else {\n setProfile(initialState)\n }\n }, [account, setProfile])\n\n return profile\n}\n\nexport default useGetLocalProfile\n","import { MenuEntry } from '@pancakeswap-libs/uikit'\n\nconst config: MenuEntry[] = [\n {\n label: 'Home',\n icon: 'HomeIcon',\n href: '/',\n },\n {\n label: 'Trade',\n icon: 'TradeIcon',\n initialOpenState: false,\n items: [\n {\n label: 'Exchange',\n href: '/swap',\n },\n {\n label: 'Liquidity',\n href: '/pool',\n },\n ],\n },\n]\n\nexport default config\n","import React, { useContext } from 'react'\nimport { Menu as UikitMenu} from '@pancakeswap-libs/uikit'\nimport { useWeb3React } from '@web3-react/core'\nimport { allLanguages } from 'constants/localisation/languageCodes'\nimport { LanguageContext } from 'hooks/LanguageContext'\nimport useTheme from 'hooks/useTheme'\nimport useGetPriceData from 'hooks/useGetPriceData'\nimport useGetLocalProfile from 'hooks/useGetLocalProfile'\nimport useAuth from 'hooks/useAuth'\nimport links from './config'\n\nconst Menu: React.FC = (props) => {\n const { account } = useWeb3React()\n const { login, logout } = useAuth()\n const { selectedLanguage, setSelectedLanguage } = useContext(LanguageContext)\n const { isDark, toggleTheme } = useTheme()\n const priceData = useGetPriceData()\n let cakePriceUsd = 0;\n try {\n cakePriceUsd = priceData ? Number(priceData.data['0x0E09FaBB73Bd3Ade0a17ECC321fD13a19e81cE82'].price ?? 0) : 0\n } catch (e) {\n // Ignore\n }\n const profile = useGetLocalProfile()\n\n return (\n \n )\n}\n\nexport default Menu\n","import { useEffect } from 'react'\nimport useGetPriceData from './useGetPriceData'\nimport { CAKE } from '../constants'\n\nconst useGetDocumentTitlePrice = () => {\n const priceData = useGetPriceData();\n let cakePriceUsd = 0;\n try {\n cakePriceUsd = priceData ? parseFloat(priceData.data[CAKE.address].price ?? 0) : 0\n } catch (e) {\n // Ignore\n }\n\n const cakePriceUsdString =\n Number.isNaN(cakePriceUsd) || cakePriceUsd === 0\n ? ''\n : ` - $${cakePriceUsd.toLocaleString(undefined, {\n minimumFractionDigits: 3,\n maximumFractionDigits: 3,\n })}`\n\n useEffect(() => {\n document.title = `PancakeSwap${cakePriceUsdString}`\n }, [cakePriceUsdString])\n}\nexport default useGetDocumentTitlePrice\n","import React, { Suspense, useEffect, useState } from 'react'\nimport { HashRouter, Route, Switch } from 'react-router-dom'\nimport styled from 'styled-components'\nimport { LangType } from '@pancakeswap-libs/uikit'\nimport Popups from '../components/Popups'\nimport Web3ReactManager from '../components/Web3ReactManager'\nimport { RedirectDuplicateTokenIds, RedirectOldAddLiquidityPathStructure } from './AddLiquidity/redirects'\nimport { RedirectOldRemoveLiquidityPathStructure } from './RemoveLiquidity/redirects'\nimport AddLiquidity from './AddLiquidity'\nimport Pool from './Pool'\nimport PoolFinder from './PoolFinder'\nimport RemoveLiquidity from './RemoveLiquidity'\nimport Swap from './Swap'\nimport { RedirectPathToSwapOnly } from './Swap/redirects'\nimport { EN, allLanguages } from '../constants/localisation/languageCodes'\nimport { LanguageContext } from '../hooks/LanguageContext'\nimport { TranslationsContext } from '../hooks/TranslationsContext'\n\nimport Menu from '../components/Menu'\nimport useGetDocumentTitlePrice from '../hooks/useGetDocumentTitlePrice'\n\nconst AppWrapper = styled.div`\n display: flex;\n flex-flow: column;\n align-items: flex-start;\n overflow-x: hidden;\n`\n\nconst BodyWrapper = styled.div`\n display: flex;\n flex-direction: column;\n width: 100%;\n padding: 32px 16px;\n align-items: center;\n flex: 1;\n overflow-y: auto;\n overflow-x: hidden;\n z-index: 1;\n justify-content: center;\n background-image: url('/images/group-pancake.svg');\n background-repeat: no-repeat;\n background-position: bottom 24px center;\n background-size: 90%;\n\n ${({ theme }) => theme.mediaQueries.xs} {\n background-size: auto;\n }\n\n ${({ theme }) => theme.mediaQueries.lg} {\n background-image: url('/images/arch-${({ theme }) => (theme.isDark ? 'dark' : 'light')}.svg'),\n url('/images/left-pancake.svg'), url('/images/right-pancake.svg');\n background-repeat: no-repeat;\n background-position: center 420px, 10% 230px, 90% 230px;\n background-size: contain, 266px, 266px;\n min-height: 90vh;\n }\n`\n\nconst Marginer = styled.div`\n margin-top: 5rem;\n`\n\nconst CACHE_KEY = 'pancakeSwapLanguage'\n\nexport default function App() {\n const [selectedLanguage, setSelectedLanguage] = useState(undefined)\n const [translatedLanguage, setTranslatedLanguage] = useState(undefined)\n const [translations, setTranslations] = useState>([])\n\n const getStoredLang = (storedLangCode: string) => {\n return allLanguages.filter((language) => {\n return language.code === storedLangCode\n })[0]\n }\n\n useEffect(() => {\n const storedLangCode = localStorage.getItem(CACHE_KEY)\n if (storedLangCode) {\n const storedLang = getStoredLang(storedLangCode)\n setSelectedLanguage(storedLang)\n } else {\n setSelectedLanguage(EN)\n }\n }, [])\n\n const handleLanguageSelect = (langObject: LangType) => {\n setSelectedLanguage(langObject)\n localStorage.setItem(CACHE_KEY, langObject.code)\n }\n\n useGetDocumentTitlePrice()\n\n return (\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n\n {/* Redirection: These old routes are still used in the code base */}\n \n \n \n\n \n \n \n \n \n \n \n \n \n \n \n )\n}\n","import { useCallback, useEffect, useState } from 'react'\n\nconst VISIBILITY_STATE_SUPPORTED = 'visibilityState' in document\n\nfunction isWindowVisible() {\n return !VISIBILITY_STATE_SUPPORTED || document.visibilityState !== 'hidden'\n}\n\n/**\n * Returns whether the window is currently visible to the user.\n */\nexport default function useIsWindowVisible(): boolean {\n const [focused, setFocused] = useState(isWindowVisible())\n const listener = useCallback(() => {\n setFocused(isWindowVisible())\n }, [setFocused])\n\n useEffect(() => {\n if (!VISIBILITY_STATE_SUPPORTED) return undefined\n\n document.addEventListener('visibilitychange', listener)\n return () => {\n document.removeEventListener('visibilitychange', listener)\n }\n }, [listener])\n\n return focused\n}\n","import { useCallback, useEffect, useState } from 'react'\nimport { useDispatch } from 'react-redux'\nimport { useActiveWeb3React } from '../../hooks'\nimport useDebounce from '../../hooks/useDebounce'\nimport useIsWindowVisible from '../../hooks/useIsWindowVisible'\nimport { updateBlockNumber } from './actions'\n\nexport default function Updater(): null {\n const { library, chainId } = useActiveWeb3React()\n const dispatch = useDispatch()\n\n const windowVisible = useIsWindowVisible()\n\n const [state, setState] = useState<{ chainId: number | undefined; blockNumber: number | null }>({\n chainId,\n blockNumber: null,\n })\n\n const blockNumberCallback = useCallback(\n (blockNumber: number) => {\n setState((s) => {\n if (chainId === s.chainId) {\n if (typeof s.blockNumber !== 'number') return { chainId, blockNumber }\n return { chainId, blockNumber: Math.max(blockNumber, s.blockNumber) }\n }\n return s\n })\n },\n [chainId, setState]\n )\n\n // attach/detach listeners\n useEffect(() => {\n if (!library || !chainId || !windowVisible) return undefined\n\n setState({ chainId, blockNumber: null })\n\n library\n .getBlockNumber()\n .then(blockNumberCallback)\n .catch((error) => console.error(`Failed to get block number for chainId: ${chainId}`, error))\n\n library.on('block', blockNumberCallback)\n return () => {\n library.removeListener('block', blockNumberCallback)\n }\n }, [dispatch, chainId, library, blockNumberCallback, windowVisible])\n\n const debouncedState = useDebounce(state, 100)\n\n useEffect(() => {\n if (!debouncedState.chainId || !debouncedState.blockNumber || !windowVisible) return\n dispatch(updateBlockNumber({ chainId: debouncedState.chainId, blockNumber: debouncedState.blockNumber }))\n }, [windowVisible, dispatch, debouncedState.blockNumber, debouncedState.chainId])\n\n return null\n}\n","import { getVersionUpgrade, minVersionBump, VersionUpgrade } from '@uniswap/token-lists'\nimport { useCallback, useEffect } from 'react'\nimport { useDispatch, useSelector } from 'react-redux'\nimport { useActiveWeb3React } from '../../hooks'\nimport { useFetchListCallback } from '../../hooks/useFetchListCallback'\nimport useInterval from '../../hooks/useInterval'\nimport useIsWindowVisible from '../../hooks/useIsWindowVisible'\nimport { addPopup } from '../application/actions'\nimport { AppDispatch, AppState } from '../index'\nimport { acceptListUpdate } from './actions'\n\nexport default function Updater(): null {\n const { library } = useActiveWeb3React()\n const dispatch = useDispatch()\n const lists = useSelector((state) => state.lists.byUrl)\n\n const isWindowVisible = useIsWindowVisible()\n\n const fetchList = useFetchListCallback()\n\n const fetchAllListsCallback = useCallback(() => {\n if (!isWindowVisible) return\n Object.keys(lists).forEach((url) =>\n fetchList(url).catch((error) => console.error('interval list fetching error', error))\n )\n }, [fetchList, isWindowVisible, lists])\n\n // fetch all lists every 10 minutes, but only after we initialize library\n useInterval(fetchAllListsCallback, library ? 1000 * 60 * 10 : null)\n\n // whenever a list is not loaded and not loading, try again to load it\n useEffect(() => {\n Object.keys(lists).forEach((listUrl) => {\n const list = lists[listUrl]\n\n if (!list.current && !list.loadingRequestId && !list.error) {\n fetchList(listUrl).catch((error) => console.error('list added fetching error', error))\n }\n })\n }, [dispatch, fetchList, library, lists])\n\n // automatically update lists if versions are minor/patch\n useEffect(() => {\n Object.keys(lists).forEach((listUrl) => {\n const list = lists[listUrl]\n if (list.current && list.pendingUpdate) {\n const bump = getVersionUpgrade(list.current.version, list.pendingUpdate.version)\n switch (bump) {\n case VersionUpgrade.NONE:\n throw new Error('unexpected no version bump')\n case VersionUpgrade.PATCH:\n case VersionUpgrade.MINOR:\n const min = minVersionBump(list.current.tokens, list.pendingUpdate.tokens)\n // automatically update minor/patch as long as bump matches the min update\n if (bump >= min) {\n dispatch(acceptListUpdate(listUrl))\n dispatch(\n addPopup({\n key: listUrl,\n content: {\n listUpdate: {\n listUrl,\n oldList: list.current,\n newList: list.pendingUpdate,\n auto: true,\n },\n },\n })\n )\n } else {\n console.error(\n `List at url ${listUrl} could not automatically update because the version bump was only PATCH/MINOR while the update had breaking changes and should have been MAJOR`\n )\n }\n break\n\n case VersionUpgrade.MAJOR:\n dispatch(\n addPopup({\n key: listUrl,\n content: {\n listUpdate: {\n listUrl,\n auto: false,\n oldList: list.current,\n newList: list.pendingUpdate,\n },\n },\n removeAfterMs: null,\n })\n )\n }\n }\n })\n }, [dispatch, lists])\n\n return null\n}\n","function wait(ms: number): Promise {\n return new Promise((resolve) => setTimeout(resolve, ms))\n}\n\nfunction waitRandom(min: number, max: number): Promise {\n return wait(min + Math.round(Math.random() * Math.max(0, max - min)))\n}\n\n/**\n * This error is thrown if the function is cancelled before completing\n */\nexport class CancelledError extends Error {\n constructor() {\n super('Cancelled')\n }\n}\n\n/**\n * Throw this error if the function should retry\n */\nexport class RetryableError extends Error {}\n\n/**\n * Retries the function that returns the promise until the promise successfully resolves up to n retries\n * @param fn function to retry\n * @param n how many times to retry\n * @param minWait min wait between retries in ms\n * @param maxWait max wait between retries in ms\n */\nexport function retry(\n fn: () => Promise,\n { n, minWait, maxWait }: { n: number; minWait: number; maxWait: number }\n): { promise: Promise; cancel: () => void } {\n let completed = false\n let rejectCancelled: (error: Error) => void\n // eslint-disable-next-line no-async-promise-executor\n const promise = new Promise(async (resolve, reject) => {\n rejectCancelled = reject\n // eslint-disable-next-line no-constant-condition\n while (true) {\n let result: T\n try {\n result = await fn()\n if (!completed) {\n resolve(result)\n completed = true\n }\n break\n } catch (error) {\n if (completed) {\n break\n }\n if (n <= 0 || !(error instanceof RetryableError)) {\n reject(error)\n completed = true\n break\n }\n n--\n }\n await waitRandom(minWait, maxWait)\n }\n })\n return {\n promise,\n cancel: () => {\n if (completed) return\n completed = true\n rejectCancelled(new CancelledError())\n },\n }\n}\n","import { Contract } from '@ethersproject/contracts'\nimport { useEffect, useMemo, useRef } from 'react'\nimport { useDispatch, useSelector } from 'react-redux'\nimport { useActiveWeb3React } from '../../hooks'\nimport { useMulticallContract } from '../../hooks/useContract'\nimport useDebounce from '../../hooks/useDebounce'\nimport chunkArray from '../../utils/chunkArray'\nimport { CancelledError, retry, RetryableError } from '../../utils/retry'\nimport { useBlockNumber } from '../application/hooks'\nimport { AppDispatch, AppState } from '../index'\nimport {\n Call,\n errorFetchingMulticallResults,\n fetchingMulticallResults,\n parseCallKey,\n updateMulticallResults,\n} from './actions'\n\n// chunk calls so we do not exceed the gas limit\nconst CALL_CHUNK_SIZE = 500\n\n/**\n * Fetches a chunk of calls, enforcing a minimum block number constraint\n * @param multicallContract multicall contract to fetch against\n * @param chunk chunk of calls to make\n * @param minBlockNumber minimum block number of the result set\n */\nasync function fetchChunk(\n multicallContract: Contract,\n chunk: Call[],\n minBlockNumber: number\n): Promise<{ results: string[]; blockNumber: number }> {\n let resultsBlockNumber\n let returnData\n try {\n [resultsBlockNumber, returnData] = await multicallContract.aggregate(\n chunk.map((obj) => [obj.address, obj.callData])\n )\n } catch (error) {\n console.info('Failed to fetch chunk inside retry', error)\n throw error\n }\n if (resultsBlockNumber.toNumber() < minBlockNumber) {\n throw new RetryableError('Fetched for old block number')\n }\n return { results: returnData, blockNumber: resultsBlockNumber.toNumber() }\n}\n\n/**\n * From the current all listeners state, return each call key mapped to the\n * minimum number of blocks per fetch. This is how often each key must be fetched.\n * @param allListeners the all listeners state\n * @param chainId the current chain id\n */\nexport function activeListeningKeys(\n allListeners: AppState['multicall']['callListeners'],\n chainId?: number\n): { [callKey: string]: number } {\n if (!allListeners || !chainId) return {}\n const listeners = allListeners[chainId]\n if (!listeners) return {}\n\n return Object.keys(listeners).reduce<{ [callKey: string]: number }>((memo, callKey) => {\n const keyListeners = listeners[callKey]\n\n memo[callKey] = Object.keys(keyListeners)\n .filter((key) => {\n const blocksPerFetch = parseInt(key)\n if (blocksPerFetch <= 0) return false\n return keyListeners[blocksPerFetch] > 0\n })\n .reduce((previousMin, current) => {\n return Math.min(previousMin, parseInt(current))\n }, Infinity)\n return memo\n }, {})\n}\n\n/**\n * Return the keys that need to be refetched\n * @param callResults current call result state\n * @param listeningKeys each call key mapped to how old the data can be in blocks\n * @param chainId the current chain id\n * @param latestBlockNumber the latest block number\n */\nexport function outdatedListeningKeys(\n callResults: AppState['multicall']['callResults'],\n listeningKeys: { [callKey: string]: number },\n chainId: number | undefined,\n latestBlockNumber: number | undefined\n): string[] {\n if (!chainId || !latestBlockNumber) return []\n const results = callResults[chainId]\n // no results at all, load everything\n if (!results) return Object.keys(listeningKeys)\n\n return Object.keys(listeningKeys).filter((callKey) => {\n const blocksPerFetch = listeningKeys[callKey]\n\n const data = callResults[chainId][callKey]\n // no data, must fetch\n if (!data) return true\n\n const minDataBlockNumber = latestBlockNumber - (blocksPerFetch - 1)\n\n // already fetching it for a recent enough block, don't refetch it\n if (data.fetchingBlockNumber && data.fetchingBlockNumber >= minDataBlockNumber) return false\n\n // if data is older than minDataBlockNumber, fetch it\n return !data.blockNumber || data.blockNumber < minDataBlockNumber\n })\n}\n\nexport default function Updater(): null {\n const dispatch = useDispatch()\n const state = useSelector((s) => s.multicall)\n // wait for listeners to settle before triggering updates\n const debouncedListeners = useDebounce(state.callListeners, 100)\n const latestBlockNumber = useBlockNumber()\n const { chainId } = useActiveWeb3React()\n const multicallContract = useMulticallContract()\n const cancellations = useRef<{ blockNumber: number; cancellations: (() => void)[] }>()\n\n const listeningKeys: { [callKey: string]: number } = useMemo(() => {\n return activeListeningKeys(debouncedListeners, chainId)\n }, [debouncedListeners, chainId])\n\n const unserializedOutdatedCallKeys = useMemo(() => {\n return outdatedListeningKeys(state.callResults, listeningKeys, chainId, latestBlockNumber)\n }, [chainId, state.callResults, listeningKeys, latestBlockNumber])\n\n const serializedOutdatedCallKeys = useMemo(() => JSON.stringify(unserializedOutdatedCallKeys.sort()), [\n unserializedOutdatedCallKeys,\n ])\n\n useEffect(() => {\n if (!latestBlockNumber || !chainId || !multicallContract) return\n\n const outdatedCallKeys: string[] = JSON.parse(serializedOutdatedCallKeys)\n if (outdatedCallKeys.length === 0) return\n const calls = outdatedCallKeys.map((key) => parseCallKey(key))\n // .filter(item => item.address.toLowerCase() !== '0x5Fe5cC0122403f06abE2A75DBba1860Edb762985'.toLowerCase())\n\n const chunkedCalls = chunkArray(calls, CALL_CHUNK_SIZE)\n\n if (cancellations.current?.blockNumber !== latestBlockNumber) {\n cancellations.current?.cancellations?.forEach((c) => c())\n }\n\n dispatch(\n fetchingMulticallResults({\n calls,\n chainId,\n fetchingBlockNumber: latestBlockNumber,\n })\n )\n\n cancellations.current = {\n blockNumber: latestBlockNumber,\n cancellations: chunkedCalls.map((chunk, index) => {\n const { cancel, promise } = retry(() => fetchChunk(multicallContract, chunk, latestBlockNumber), {\n n: Infinity,\n minWait: 2500,\n maxWait: 3500,\n })\n promise\n .then(({ results: returnData, blockNumber: fetchBlockNumber }) => {\n cancellations.current = { cancellations: [], blockNumber: latestBlockNumber }\n\n // accumulates the length of all previous indices\n const firstCallKeyIndex = chunkedCalls.slice(0, index).reduce((memo, curr) => memo + curr.length, 0)\n const lastCallKeyIndex = firstCallKeyIndex + returnData.length\n\n dispatch(\n updateMulticallResults({\n chainId,\n results: outdatedCallKeys\n .slice(firstCallKeyIndex, lastCallKeyIndex)\n .reduce<{ [callKey: string]: string | null }>((memo, callKey, i) => {\n memo[callKey] = returnData[i] ?? null\n return memo\n }, {}),\n blockNumber: fetchBlockNumber,\n })\n )\n })\n .catch((error: any) => {\n if (error instanceof CancelledError) {\n console.error('Cancelled fetch for blockNumber', latestBlockNumber)\n return\n }\n console.error('Failed to fetch multicall chunk', chunk, chainId, error)\n dispatch(\n errorFetchingMulticallResults({\n calls: chunk,\n chainId,\n fetchingBlockNumber: latestBlockNumber,\n })\n )\n })\n return cancel\n }),\n }\n }, [chainId, multicallContract, dispatch, serializedOutdatedCallKeys, latestBlockNumber])\n\n return null\n}\n","// chunks array into chunks of maximum size\n// evenly distributes items among the chunks\nexport default function chunkArray(items: T[], maxChunkSize: number): T[][] {\n if (maxChunkSize < 1) throw new Error('maxChunkSize must be gte 1')\n if (items.length <= maxChunkSize) return [items]\n\n const numChunks: number = Math.ceil(items.length / maxChunkSize)\n const chunkSize = Math.ceil(items.length / numChunks)\n\n return [...Array(numChunks).keys()].map(ix => items.slice(ix * chunkSize, ix * chunkSize + chunkSize))\n}\n","import { useEffect } from 'react'\nimport { useDispatch, useSelector } from 'react-redux'\nimport { useActiveWeb3React } from '../../hooks'\nimport { useAddPopup, useBlockNumber } from '../application/hooks'\nimport { AppDispatch, AppState } from '../index'\nimport { checkedTransaction, finalizeTransaction } from './actions'\n\nexport function shouldCheck(\n lastBlockNumber: number,\n tx: { addedTime: number; receipt?: any; lastCheckedBlockNumber?: number }\n): boolean {\n if (tx.receipt) return false\n if (!tx.lastCheckedBlockNumber) return true\n const blocksSinceCheck = lastBlockNumber - tx.lastCheckedBlockNumber\n if (blocksSinceCheck < 1) return false\n const minutesPending = (new Date().getTime() - tx.addedTime) / 1000 / 60\n if (minutesPending > 60) {\n // every 10 blocks if pending for longer than an hour\n return blocksSinceCheck > 9\n }\n if (minutesPending > 5) {\n // every 3 blocks if pending more than 5 minutes\n return blocksSinceCheck > 2\n }\n // otherwise every block\n return true\n}\n\nexport default function Updater(): null {\n const { chainId, library } = useActiveWeb3React()\n\n const lastBlockNumber = useBlockNumber()\n\n const dispatch = useDispatch()\n const state = useSelector((s) => s.transactions)\n\n // eslint-disable-next-line react-hooks/exhaustive-deps\n const transactions = chainId ? state[chainId] ?? {} : {}\n\n // show popup on confirm\n const addPopup = useAddPopup()\n\n useEffect(() => {\n if (!chainId || !library || !lastBlockNumber) return\n\n Object.keys(transactions)\n .filter((hash) => shouldCheck(lastBlockNumber, transactions[hash]))\n .forEach((hash) => {\n library\n .getTransactionReceipt(hash)\n .then((receipt) => {\n if (receipt) {\n dispatch(\n finalizeTransaction({\n chainId,\n hash,\n receipt: {\n blockHash: receipt.blockHash,\n blockNumber: receipt.blockNumber,\n contractAddress: receipt.contractAddress,\n from: receipt.from,\n status: receipt.status,\n to: receipt.to,\n transactionHash: receipt.transactionHash,\n transactionIndex: receipt.transactionIndex,\n },\n })\n )\n\n addPopup(\n {\n txn: {\n hash,\n success: receipt.status === 1,\n summary: transactions[hash]?.summary,\n },\n },\n hash\n )\n } else {\n dispatch(checkedTransaction({ chainId, hash, blockNumber: lastBlockNumber }))\n }\n })\n .catch((error) => {\n console.error(`failed to check transaction hash: ${hash}`, error)\n })\n })\n }, [chainId, library, transactions, lastBlockNumber, dispatch, addPopup])\n\n return null\n}\n","import React from 'react'\nimport { useSelector } from 'react-redux'\nimport { ToastContainer, Toast } from '@pancakeswap-libs/uikit'\nimport useToast from 'hooks/useToast'\nimport { AppState } from '../../state'\n\nconst ToastListener = () => {\n const toasts: Toast[] = useSelector((state: AppState) => state.toasts.data)\n const { remove } = useToast()\n\n const handleRemove = (id: string) => remove(id)\n\n return \n}\n\nexport default ToastListener\n","import { createReducer, nanoid } from '@reduxjs/toolkit'\nimport {\n addPopup,\n PopupContent,\n removePopup,\n toggleWalletModal,\n toggleSettingsMenu,\n updateBlockNumber\n} from './actions'\n\ntype PopupList = Array<{ key: string; show: boolean; content: PopupContent; removeAfterMs: number | null }>\n\nexport interface ApplicationState {\n blockNumber: { [chainId: number]: number }\n popupList: PopupList\n walletModalOpen: boolean\n settingsMenuOpen: boolean\n}\n\nconst initialState: ApplicationState = {\n blockNumber: {},\n popupList: [],\n walletModalOpen: false,\n settingsMenuOpen: false\n}\n\nexport default createReducer(initialState, builder =>\n builder\n .addCase(updateBlockNumber, (state, action) => {\n const { chainId, blockNumber } = action.payload\n if (typeof state.blockNumber[chainId] !== 'number') {\n state.blockNumber[chainId] = blockNumber\n } else {\n state.blockNumber[chainId] = Math.max(blockNumber, state.blockNumber[chainId])\n }\n })\n .addCase(toggleWalletModal, state => {\n state.walletModalOpen = !state.walletModalOpen\n })\n .addCase(toggleSettingsMenu, state => {\n state.settingsMenuOpen = !state.settingsMenuOpen\n })\n .addCase(addPopup, (state, { payload: { content, key, removeAfterMs = 15000 } }) => {\n state.popupList = (key ? state.popupList.filter(popup => popup.key !== key) : state.popupList).concat([\n {\n key: key || nanoid(),\n show: true,\n content,\n removeAfterMs\n }\n ])\n })\n .addCase(removePopup, (state, { payload: { key } }) => {\n state.popupList.forEach(p => {\n if (p.key === key) {\n p.show = false\n }\n })\n })\n)\n","import { createAction } from '@reduxjs/toolkit'\n\n// fired once when the app reloads but before the app renders\n// allows any updates to be applied to store data loaded from localStorage\nexport const updateVersion = createAction('global/updateVersion')\n\nexport default createAction\n","import { createReducer } from '@reduxjs/toolkit'\nimport { INITIAL_ALLOWED_SLIPPAGE, DEFAULT_DEADLINE_FROM_NOW } from '../../constants'\nimport { updateVersion } from '../global/actions'\nimport {\n addSerializedPair,\n addSerializedToken,\n removeSerializedPair,\n removeSerializedToken,\n SerializedPair,\n SerializedToken,\n updateMatchesDarkMode,\n updateUserDarkMode,\n updateUserExpertMode,\n updateUserSlippageTolerance,\n updateUserDeadline,\n muteAudio,\n unmuteAudio\n} from './actions'\n\nconst currentTimestamp = () => new Date().getTime()\n\nexport interface UserState {\n // the timestamp of the last updateVersion action\n lastUpdateVersionTimestamp?: number\n\n userDarkMode: boolean | null // the user's choice for dark mode or light mode\n matchesDarkMode: boolean // whether the dark mode media query matches\n\n userExpertMode: boolean\n\n // user defined slippage tolerance in bips, used in all txns\n userSlippageTolerance: number\n\n // deadline set by user in minutes, used in all txns\n userDeadline: number\n\n tokens: {\n [chainId: number]: {\n [address: string]: SerializedToken\n }\n }\n\n pairs: {\n [chainId: number]: {\n // keyed by token0Address:token1Address\n [key: string]: SerializedPair\n }\n }\n\n timestamp: number\n\n audioPlay: boolean\n}\n\nfunction pairKey(token0Address: string, token1Address: string) {\n return `${token0Address};${token1Address}`\n}\n\nexport const initialState: UserState = {\n userDarkMode: null,\n matchesDarkMode: false,\n userExpertMode: false,\n userSlippageTolerance: INITIAL_ALLOWED_SLIPPAGE,\n userDeadline: DEFAULT_DEADLINE_FROM_NOW,\n tokens: {},\n pairs: {},\n timestamp: currentTimestamp(),\n audioPlay: true\n}\n\nexport default createReducer(initialState, builder =>\n builder\n .addCase(updateVersion, state => {\n // slippage isnt being tracked in local storage, reset to default\n // noinspection SuspiciousTypeOfGuard\n if (typeof state.userSlippageTolerance !== 'number') {\n state.userSlippageTolerance = INITIAL_ALLOWED_SLIPPAGE\n }\n\n // deadline isnt being tracked in local storage, reset to default\n // noinspection SuspiciousTypeOfGuard\n if (typeof state.userDeadline !== 'number') {\n state.userDeadline = DEFAULT_DEADLINE_FROM_NOW\n }\n\n state.lastUpdateVersionTimestamp = currentTimestamp()\n })\n .addCase(updateUserDarkMode, (state, action) => {\n state.userDarkMode = action.payload.userDarkMode\n state.timestamp = currentTimestamp()\n })\n .addCase(updateMatchesDarkMode, (state, action) => {\n state.matchesDarkMode = action.payload.matchesDarkMode\n state.timestamp = currentTimestamp()\n })\n .addCase(updateUserExpertMode, (state, action) => {\n state.userExpertMode = action.payload.userExpertMode\n state.timestamp = currentTimestamp()\n })\n .addCase(updateUserSlippageTolerance, (state, action) => {\n state.userSlippageTolerance = action.payload.userSlippageTolerance\n state.timestamp = currentTimestamp()\n })\n .addCase(updateUserDeadline, (state, action) => {\n state.userDeadline = action.payload.userDeadline\n state.timestamp = currentTimestamp()\n })\n .addCase(addSerializedToken, (state, { payload: { serializedToken } }) => {\n state.tokens[serializedToken.chainId] = state.tokens[serializedToken.chainId] || {}\n state.tokens[serializedToken.chainId][serializedToken.address] = serializedToken\n state.timestamp = currentTimestamp()\n })\n .addCase(removeSerializedToken, (state, { payload: { address, chainId } }) => {\n state.tokens[chainId] = state.tokens[chainId] || {}\n delete state.tokens[chainId][address]\n state.timestamp = currentTimestamp()\n })\n .addCase(addSerializedPair, (state, { payload: { serializedPair } }) => {\n if (\n serializedPair.token0.chainId === serializedPair.token1.chainId &&\n serializedPair.token0.address !== serializedPair.token1.address\n ) {\n const {chainId} = serializedPair.token0\n state.pairs[chainId] = state.pairs[chainId] || {}\n state.pairs[chainId][pairKey(serializedPair.token0.address, serializedPair.token1.address)] = serializedPair\n }\n state.timestamp = currentTimestamp()\n })\n .addCase(removeSerializedPair, (state, { payload: { chainId, tokenAAddress, tokenBAddress } }) => {\n if (state.pairs[chainId]) {\n // just delete both keys if either exists\n delete state.pairs[chainId][pairKey(tokenAAddress, tokenBAddress)]\n delete state.pairs[chainId][pairKey(tokenBAddress, tokenAAddress)]\n }\n state.timestamp = currentTimestamp()\n })\n .addCase(muteAudio, state => {\n state.audioPlay = false\n })\n .addCase(unmuteAudio, state => {\n state.audioPlay = true\n })\n)\n","import { createReducer } from '@reduxjs/toolkit'\nimport {\n addTransaction,\n checkedTransaction,\n clearAllTransactions,\n finalizeTransaction,\n SerializableTransactionReceipt\n} from './actions'\n\nconst now = () => new Date().getTime()\n\nexport interface TransactionDetails {\n hash: string\n approval?: { tokenAddress: string; spender: string }\n summary?: string\n receipt?: SerializableTransactionReceipt\n lastCheckedBlockNumber?: number\n addedTime: number\n confirmedTime?: number\n from: string\n}\n\nexport interface TransactionState {\n [chainId: number]: {\n [txHash: string]: TransactionDetails\n }\n}\n\nexport const initialState: TransactionState = {}\n\nexport default createReducer(initialState, builder =>\n builder\n .addCase(addTransaction, (transactions, { payload: { chainId, from, hash, approval, summary } }) => {\n if (transactions[chainId]?.[hash]) {\n throw Error('Attempted to add existing transaction.')\n }\n const txs = transactions[chainId] ?? {}\n txs[hash] = { hash, approval, summary, from, addedTime: now() }\n transactions[chainId] = txs\n })\n .addCase(clearAllTransactions, (transactions, { payload: { chainId } }) => {\n if (!transactions[chainId]) return\n transactions[chainId] = {}\n })\n .addCase(checkedTransaction, (transactions, { payload: { chainId, hash, blockNumber } }) => {\n const tx = transactions[chainId]?.[hash]\n if (!tx) {\n return\n }\n if (!tx.lastCheckedBlockNumber) {\n tx.lastCheckedBlockNumber = blockNumber\n } else {\n tx.lastCheckedBlockNumber = Math.max(blockNumber, tx.lastCheckedBlockNumber)\n }\n })\n .addCase(finalizeTransaction, (transactions, { payload: { hash, chainId, receipt } }) => {\n const tx = transactions[chainId]?.[hash]\n if (!tx) {\n return\n }\n tx.receipt = receipt\n tx.confirmedTime = now()\n })\n)\n","import { createReducer } from '@reduxjs/toolkit'\nimport { Field, replaceSwapState, selectCurrency, setRecipient, switchCurrencies, typeInput } from './actions'\n\nexport interface SwapState {\n readonly independentField: Field\n readonly typedValue: string\n readonly [Field.INPUT]: {\n readonly currencyId: string | undefined\n }\n readonly [Field.OUTPUT]: {\n readonly currencyId: string | undefined\n }\n // the typed recipient address or ENS name, or null if swap should go to sender\n readonly recipient: string | null\n}\n\nconst initialState: SwapState = {\n independentField: Field.INPUT,\n typedValue: '',\n [Field.INPUT]: {\n currencyId: '',\n },\n [Field.OUTPUT]: {\n currencyId: '',\n },\n recipient: null,\n}\n\nexport default createReducer(initialState, (builder) =>\n builder\n .addCase(\n replaceSwapState,\n (state, { payload: { typedValue, recipient, field, inputCurrencyId, outputCurrencyId } }) => {\n return {\n [Field.INPUT]: {\n currencyId: inputCurrencyId,\n },\n [Field.OUTPUT]: {\n currencyId: outputCurrencyId,\n },\n independentField: field,\n typedValue,\n recipient,\n }\n }\n )\n .addCase(selectCurrency, (state, { payload: { currencyId, field } }) => {\n const otherField = field === Field.INPUT ? Field.OUTPUT : Field.INPUT\n if (currencyId === state[otherField].currencyId) {\n // the case where we have to swap the order\n return {\n ...state,\n independentField: state.independentField === Field.INPUT ? Field.OUTPUT : Field.INPUT,\n [field]: { currencyId },\n [otherField]: { currencyId: state[field].currencyId },\n }\n }\n // the normal case\n return {\n ...state,\n [field]: { currencyId },\n }\n })\n .addCase(switchCurrencies, (state) => {\n return {\n ...state,\n independentField: state.independentField === Field.INPUT ? Field.OUTPUT : Field.INPUT,\n [Field.INPUT]: { currencyId: state[Field.OUTPUT].currencyId },\n [Field.OUTPUT]: { currencyId: state[Field.INPUT].currencyId },\n }\n })\n .addCase(typeInput, (state, { payload: { field, typedValue } }) => {\n return {\n ...state,\n independentField: field,\n typedValue,\n }\n })\n .addCase(setRecipient, (state, { payload: { recipient } }) => {\n state.recipient = recipient\n })\n)\n","import { createReducer } from '@reduxjs/toolkit'\nimport { Field, resetMintState, typeInput } from './actions'\n\nexport interface MintState {\n readonly independentField: Field\n readonly typedValue: string\n readonly otherTypedValue: string // for the case when there's no liquidity\n}\n\nconst initialState: MintState = {\n independentField: Field.CURRENCY_A,\n typedValue: '',\n otherTypedValue: ''\n}\n\nexport default createReducer(initialState, builder =>\n builder\n .addCase(resetMintState, () => initialState)\n .addCase(typeInput, (state, { payload: { field, typedValue, noLiquidity } }) => {\n if (noLiquidity) {\n // they're typing into the field they've last typed in\n if (field === state.independentField) {\n return {\n ...state,\n independentField: field,\n typedValue\n }\n }\n // they're typing into a new field, store the other value\n \n return {\n ...state,\n independentField: field,\n typedValue,\n otherTypedValue: state.typedValue\n }\n \n } \n return {\n ...state,\n independentField: field,\n typedValue,\n otherTypedValue: ''\n }\n \n })\n)\n","import { createReducer } from '@reduxjs/toolkit'\nimport { getVersionUpgrade, VersionUpgrade } from '@uniswap/token-lists'\n// eslint-disable-next-line import/no-unresolved\nimport { TokenList } from '@uniswap/token-lists/dist/types'\nimport { DEFAULT_LIST_OF_LISTS, DEFAULT_TOKEN_LIST_URL } from '../../constants/lists'\nimport { updateVersion } from '../global/actions'\nimport { acceptListUpdate, addList, fetchTokenList, removeList, selectList } from './actions'\nimport DEFAULT_LIST from '../../constants/token/pancakeswap.json'\n\nexport interface ListsState {\n readonly byUrl: {\n readonly [url: string]: {\n readonly current: TokenList | null\n readonly pendingUpdate: TokenList | null\n readonly loadingRequestId: string | null\n readonly error: string | null\n }\n }\n // this contains the default list of lists from the last time the updateVersion was called, i.e. the app was reloaded\n readonly lastInitializedDefaultListOfLists?: string[]\n readonly selectedListUrl: string | undefined\n}\n\nconst NEW_LIST_STATE: ListsState['byUrl'][string] = {\n error: null,\n current: null,\n loadingRequestId: null,\n pendingUpdate: null,\n}\n\ntype Mutable = { -readonly [P in keyof T]: T[P] extends ReadonlyArray ? U[] : T[P] }\n\nconst initialState: ListsState = {\n lastInitializedDefaultListOfLists: DEFAULT_LIST_OF_LISTS,\n byUrl: {\n ...DEFAULT_LIST_OF_LISTS.reduce>((memo, listUrl) => {\n memo[listUrl] = NEW_LIST_STATE\n return memo\n }, {}),\n [DEFAULT_TOKEN_LIST_URL]: {\n error: null,\n current: DEFAULT_LIST,\n loadingRequestId: null,\n pendingUpdate: null,\n },\n },\n selectedListUrl: DEFAULT_TOKEN_LIST_URL,\n}\n\nexport default createReducer(initialState, (builder) =>\n builder\n .addCase(fetchTokenList.pending, (state, { payload: { requestId, url } }) => {\n state.byUrl[url] = {\n current: null,\n pendingUpdate: null,\n ...state.byUrl[url],\n loadingRequestId: requestId,\n error: null,\n }\n })\n .addCase(fetchTokenList.fulfilled, (state, { payload: { requestId, tokenList, url } }) => {\n const current = state.byUrl[url]?.current\n const loadingRequestId = state.byUrl[url]?.loadingRequestId\n\n // no-op if update does nothing\n if (current) {\n const upgradeType = getVersionUpgrade(current.version, tokenList.version)\n if (upgradeType === VersionUpgrade.NONE) return\n if (loadingRequestId === null || loadingRequestId === requestId) {\n state.byUrl[url] = {\n ...state.byUrl[url],\n loadingRequestId: null,\n error: null,\n current,\n pendingUpdate: tokenList,\n }\n }\n } else {\n state.byUrl[url] = {\n ...state.byUrl[url],\n loadingRequestId: null,\n error: null,\n current: tokenList,\n pendingUpdate: null,\n }\n }\n })\n .addCase(fetchTokenList.rejected, (state, { payload: { url, requestId, errorMessage } }) => {\n if (state.byUrl[url]?.loadingRequestId !== requestId) {\n // no-op since it's not the latest request\n return\n }\n\n state.byUrl[url] = {\n ...state.byUrl[url],\n loadingRequestId: null,\n error: errorMessage,\n current: null,\n pendingUpdate: null,\n }\n })\n .addCase(selectList, (state, { payload: url }) => {\n state.selectedListUrl = url\n // automatically adds list\n if (!state.byUrl[url]) {\n state.byUrl[url] = NEW_LIST_STATE\n }\n })\n .addCase(addList, (state, { payload: url }) => {\n if (!state.byUrl[url]) {\n state.byUrl[url] = NEW_LIST_STATE\n }\n })\n .addCase(removeList, (state, { payload: url }) => {\n if (state.byUrl[url]) {\n delete state.byUrl[url]\n }\n if (state.selectedListUrl === url) {\n state.selectedListUrl = Object.keys(state.byUrl)[0]\n }\n })\n .addCase(acceptListUpdate, (state, { payload: url }) => {\n if (!state.byUrl[url]?.pendingUpdate) {\n throw new Error('accept list update called without pending update')\n }\n state.byUrl[url] = {\n ...state.byUrl[url],\n pendingUpdate: null,\n current: state.byUrl[url].pendingUpdate,\n }\n })\n .addCase(updateVersion, (state) => {\n // state loaded from localStorage, but new lists have never been initialized\n if (!state.lastInitializedDefaultListOfLists) {\n state.byUrl = initialState.byUrl\n state.selectedListUrl = undefined\n } else if (state.lastInitializedDefaultListOfLists) {\n const lastInitializedSet = state.lastInitializedDefaultListOfLists.reduce>(\n (s, l) => s.add(l),\n new Set()\n )\n const newListOfListsSet = DEFAULT_LIST_OF_LISTS.reduce>((s, l) => s.add(l), new Set())\n\n DEFAULT_LIST_OF_LISTS.forEach((listUrl) => {\n if (!lastInitializedSet.has(listUrl)) {\n state.byUrl[listUrl] = NEW_LIST_STATE\n }\n })\n\n state.lastInitializedDefaultListOfLists.forEach((listUrl) => {\n if (!newListOfListsSet.has(listUrl)) {\n delete state.byUrl[listUrl]\n }\n })\n }\n\n state.lastInitializedDefaultListOfLists = DEFAULT_LIST_OF_LISTS\n })\n)\n","import { createReducer } from '@reduxjs/toolkit'\nimport { Field, typeInput } from './actions'\n\nexport interface BurnState {\n readonly independentField: Field\n readonly typedValue: string\n}\n\nconst initialState: BurnState = {\n independentField: Field.LIQUIDITY_PERCENT,\n typedValue: '0'\n}\n\nexport default createReducer(initialState, builder =>\n builder.addCase(typeInput, (state, { payload: { field, typedValue } }) => {\n return {\n ...state,\n independentField: field,\n typedValue\n }\n })\n)\n","import { createReducer } from '@reduxjs/toolkit'\nimport {\n addMulticallListeners,\n errorFetchingMulticallResults,\n fetchingMulticallResults,\n removeMulticallListeners,\n toCallKey,\n updateMulticallResults\n} from './actions'\n\nexport interface MulticallState {\n callListeners?: {\n // on a per-chain basis\n [chainId: number]: {\n // stores for each call key the listeners' preferences\n [callKey: string]: {\n // stores how many listeners there are per each blocks per fetch preference\n [blocksPerFetch: number]: number\n }\n }\n }\n\n callResults: {\n [chainId: number]: {\n [callKey: string]: {\n data?: string | null\n blockNumber?: number\n fetchingBlockNumber?: number\n }\n }\n }\n}\n\nconst initialState: MulticallState = {\n callResults: {}\n}\n\nexport default createReducer(initialState, builder =>\n builder\n .addCase(addMulticallListeners, (state, { payload: { calls, chainId, options: { blocksPerFetch = 1 } = {} } }) => {\n const listeners: MulticallState['callListeners'] = state.callListeners\n ? state.callListeners\n : (state.callListeners = {})\n listeners[chainId] = listeners[chainId] ?? {}\n calls.forEach(call => {\n const callKey = toCallKey(call)\n listeners[chainId][callKey] = listeners[chainId][callKey] ?? {}\n listeners[chainId][callKey][blocksPerFetch] = (listeners[chainId][callKey][blocksPerFetch] ?? 0) + 1\n })\n })\n .addCase(\n removeMulticallListeners,\n (state, { payload: { chainId, calls, options: { blocksPerFetch = 1 } = {} } }) => {\n const listeners: MulticallState['callListeners'] = state.callListeners\n ? state.callListeners\n : (state.callListeners = {})\n\n if (!listeners[chainId]) return\n calls.forEach(call => {\n const callKey = toCallKey(call)\n if (!listeners[chainId][callKey]) return\n if (!listeners[chainId][callKey][blocksPerFetch]) return\n\n if (listeners[chainId][callKey][blocksPerFetch] === 1) {\n delete listeners[chainId][callKey][blocksPerFetch]\n } else {\n listeners[chainId][callKey][blocksPerFetch]--\n }\n })\n }\n )\n .addCase(fetchingMulticallResults, (state, { payload: { chainId, fetchingBlockNumber, calls } }) => {\n state.callResults[chainId] = state.callResults[chainId] ?? {}\n calls.forEach(call => {\n const callKey = toCallKey(call)\n const current = state.callResults[chainId][callKey]\n if (!current) {\n state.callResults[chainId][callKey] = {\n fetchingBlockNumber\n }\n } else {\n if ((current.fetchingBlockNumber ?? 0) >= fetchingBlockNumber) return\n state.callResults[chainId][callKey].fetchingBlockNumber = fetchingBlockNumber\n }\n })\n })\n .addCase(errorFetchingMulticallResults, (state, { payload: { fetchingBlockNumber, chainId, calls } }) => {\n state.callResults[chainId] = state.callResults[chainId] ?? {}\n calls.forEach(call => {\n const callKey = toCallKey(call)\n const current = state.callResults[chainId][callKey]\n if (!current) return // only should be dispatched if we are already fetching\n if (current.fetchingBlockNumber === fetchingBlockNumber) {\n delete current.fetchingBlockNumber\n current.data = null\n current.blockNumber = fetchingBlockNumber\n }\n })\n })\n .addCase(updateMulticallResults, (state, { payload: { chainId, results, blockNumber } }) => {\n state.callResults[chainId] = state.callResults[chainId] ?? {}\n Object.keys(results).forEach(callKey => {\n const current = state.callResults[chainId][callKey]\n if ((current?.blockNumber ?? 0) > blockNumber) return\n state.callResults[chainId][callKey] = {\n data: results[callKey],\n blockNumber\n }\n })\n })\n)\n","import { configureStore, getDefaultMiddleware } from '@reduxjs/toolkit'\nimport { save, load } from 'redux-localstorage-simple'\n\nimport application from './application/reducer'\nimport { updateVersion } from './global/actions'\nimport user from './user/reducer'\nimport transactions from './transactions/reducer'\nimport swap from './swap/reducer'\nimport mint from './mint/reducer'\nimport lists from './lists/reducer'\nimport burn from './burn/reducer'\nimport multicall from './multicall/reducer'\nimport toasts from './toasts'\nimport { getThemeCache } from '../utils/theme'\n\ntype MergedState = {\n user: {\n [key: string]: any\n }\n transactions: {\n [key: string]: any\n }\n}\nconst PERSISTED_KEYS: string[] = ['user', 'transactions']\nconst loadedState = load({ states: PERSISTED_KEYS }) as MergedState\nif (loadedState.user) {\n loadedState.user.userDarkMode = getThemeCache()\n}\n\nconst store = configureStore({\n reducer: {\n application,\n user,\n transactions,\n swap,\n mint,\n burn,\n multicall,\n lists,\n toasts\n },\n middleware: [...getDefaultMiddleware({ thunk: false }), save({ states: PERSISTED_KEYS })],\n preloadedState: loadedState,\n})\n\nstore.dispatch(updateVersion())\n\nexport default store\n\nexport type AppState = ReturnType\nexport type AppDispatch = typeof store.dispatch\n","import { Web3Provider } from '@ethersproject/providers'\n\nexport default function getLibrary(provider: any): Web3Provider {\n const library = new Web3Provider(provider)\n library.pollingInterval = 15000\n return library\n}\n","import React from 'react'\nimport { createWeb3ReactRoot, Web3ReactProvider } from '@web3-react/core'\nimport { Provider } from 'react-redux'\nimport { ModalProvider } from '@pancakeswap-libs/uikit'\nimport { NetworkContextName } from './constants'\nimport store from './state'\nimport getLibrary from './utils/getLibrary'\nimport { ThemeContextProvider } from './ThemeContext'\n\nconst Web3ProviderNetwork = createWeb3ReactRoot(NetworkContextName)\n\nconst Providers: React.FC = ({ children }) => {\n return (\n \n \n \n \n {children}\n \n \n \n \n )\n}\n\nexport default Providers\n","import i18next from 'i18next'\nimport { initReactI18next } from 'react-i18next'\nimport XHR from 'i18next-xhr-backend'\nimport LanguageDetector from 'i18next-browser-languagedetector'\n\ni18next\n .use(XHR)\n .use(LanguageDetector)\n .use(initReactI18next)\n .init({\n backend: {\n loadPath: `./locales/{{lng}}.json`\n },\n react: {\n useSuspense: true\n },\n fallbackLng: 'en',\n preload: ['en'],\n keySeparator: false,\n interpolation: { escapeValue: false }\n })\n\nexport default i18next\n","import React, { StrictMode } from 'react'\nimport ReactDOM from 'react-dom'\nimport { ResetCSS } from '@pancakeswap-libs/uikit'\nimport GlobalStyle from './style/Global'\nimport App from './pages/App'\nimport ApplicationUpdater from './state/application/updater'\nimport ListsUpdater from './state/lists/updater'\nimport MulticallUpdater from './state/multicall/updater'\nimport TransactionUpdater from './state/transactions/updater'\nimport ToastListener from './components/ToastListener'\nimport Providers from './Providers'\nimport 'inter-ui'\nimport './i18n'\n\nif ('ethereum' in window) {\n (window.ethereum as any).autoRefreshOnNetworkChange = false\n}\n\nwindow.addEventListener('error', () => {\n localStorage?.removeItem('redux_localstorage_simple_lists')\n})\n\nReactDOM.render(\n \n \n <>\n \n \n \n \n \n \n \n \n \n \n ,\n document.getElementById('root')\n)\n"],"sourceRoot":""} \ No newline at end of file diff --git a/pancake-swap-interface-v1/src/connectors/index.ts b/pancake-swap-interface-v1/src/connectors/index.ts index 080a6b6..ef74dc3 100644 --- a/pancake-swap-interface-v1/src/connectors/index.ts +++ b/pancake-swap-interface-v1/src/connectors/index.ts @@ -16,6 +16,7 @@ if (typeof NETWORK_URL === 'undefined') { export const network = new NetworkConnector({ urls: { [NETWORK_CHAIN_ID]: NETWORK_URL }, + defaultChainId: NETWORK_CHAIN_ID }) let networkLibrary: Web3Provider | undefined