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E,UACzB,SAACC,EAAAA,EAAM,CAACC,GAAG,mBAAmBC,QAAQ,OAAOC,MAAM,KAAKC,GAAG,I,SACxDrD,EAAE,mCAMb,SAAChB,EAAAA,EAAU,CAACsE,MAAO,CAAElB,UAAW,U,UAC9B,SAACU,IAAI,CAACC,KAAK,OAAOC,UAAQ,E,UACxB,SAACC,EAAAA,EAAM,CAACC,GAAG,mBAAmBK,MAAM,OAAOC,WAAW,SAACC,EAAAA,EAAO,CAACtB,MAAM,U,UACnE,SAACD,EAAAA,EAAI,CAACC,MAAM,Q,SACTnC,EAAE,iC","sources":["webpack://_N_E/?d36e","webpack://_N_E/./packages/uikit/src/components/Card/CardFooter.tsx","webpack://_N_E/./src/views/Pool/index.tsx","webpack://_N_E/./src/pages/liquidity.tsx"],"sourcesContent":["\n (window.__NEXT_P = window.__NEXT_P || []).push([\n \"/liquidity\",\n function () {\n return require(\"private-next-pages/liquidity.tsx\");\n }\n ]);\n if(module.hot) {\n module.hot.dispose(function () {\n window.__NEXT_P.push([\"/liquidity\"])\n });\n }\n ","import _tagged_template_literal from \"@swc/helpers/src/_tagged_template_literal.mjs\";\nfunction _templateObject() {\n var data = _tagged_template_literal([\n \"\\n border-top: 1px solid \",\n \";\\n \",\n \"\\n\"\n ]);\n _templateObject = function _templateObject() {\n return data;\n };\n return data;\n}\nimport styled from \"styled-components\";\nimport { space } from \"styled-system\";\nvar CardFooter = styled.div.withConfig({\n componentId: \"sc-5ed8a823-0\"\n})(_templateObject(), function(param) {\n var theme = param.theme;\n return theme.colors.cardBorder;\n}, space);\nCardFooter.defaultProps = {\n p: \"24px\"\n};\nexport default CardFooter;\n","import { useMemo } from 'react'\nimport styled from 'styled-components'\nimport { Text, Flex, CardBody, CardFooter, Button, AddIcon } from '@pancakeswap/uikit'\nimport Link from 'next/link'\nimport { useTranslation } from 'contexts/Localization'\nimport { useAccount } from 'wagmi'\nimport FullPositionCard from '../../components/PositionCard'\nimport { useTokenBalancesWithLoadingIndicator } from '../../state/wallet/hooks'\nimport { usePairs, PairState } from '../../hooks/usePairs'\nimport { toV2LiquidityToken, useTrackedTokenPairs } from '../../state/user/hooks'\nimport Dots from '../../components/Loader/Dots'\nimport { AppHeader, AppBody } from '../../components/App'\nimport Page from '../Page'\n\nconst Body = styled(CardBody)`\n background-color: ${({ theme }) => theme.colors.dropdownDeep};\n`\n\nexport default function Pool() {\n const { address : account } = useAccount()\n const { t } = useTranslation()\n\n // fetch the user's balances of all tracked V2 LP tokens\n const trackedTokenPairs = useTrackedTokenPairs()\n \n const tokenPairsWithLiquidityTokens = useMemo(\n () => trackedTokenPairs.map((tokens) => ({ liquidityToken: toV2LiquidityToken(tokens), tokens })),\n [trackedTokenPairs],\n )\n const liquidityTokens = useMemo(\n () => 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 ||\n v2Pairs?.length < liquidityTokensWithBalances.length ||\n (v2Pairs?.length && v2Pairs.every(([pairState]) => pairState === PairState.LOADING))\n const allV2PairsWithLiquidity = v2Pairs\n ?.filter(([pairState, pair]) => pairState === PairState.EXISTS && Boolean(pair))\n .map(([, pair]) => pair)\n\n const renderBody = () => {\n if (!account) {\n return (\n \n {t('Connect to a wallet to view your liquidity.')}\n \n )\n }\n if (v2IsLoading) {\n return (\n \n {t('Loading')}\n \n )\n }\n if (allV2PairsWithLiquidity?.length > 0) {\n return allV2PairsWithLiquidity.map((v2Pair, index) => (\n \n ))\n }\n return (\n \n {t('No liquidity found.')}\n \n )\n }\n\n return (\n // \n \n \n \n \n {renderBody()}\n {account && !v2IsLoading && (\n \n \n {t(\"Don't see a pool you joined?\")}\n \n \n \n \n \n )}\n \n \n \n }>\n \n {t('Add Liquidity')}\n \n \n \n \n \n \n // \n )\n}\n","import Liquidity from '../views/Pool'\n\nexport default Liquidity\n"],"names":["window","__NEXT_P","push","_templateObject","data","_tagged_template_literal","CardFooter","styled","componentId","param","theme","colors","cardBorder","space","defaultProps","p","Body","CardBody","dropdownDeep","address","useAccount","useTranslation","t","trackedTokenPairs","useTrackedTokenPairs","tokenPairsWithLiquidityTokens","useMemo","map","tokens","liquidityToken","toV2LiquidityToken","liquidityTokens","tpwlt","useTokenBalancesWithLoadingIndicator","account","undefined","v2PairsBalances","fetchingV2PairBalances","liquidityTokensWithBalances","filter","greaterThan","v2Pairs","usePairs","v2IsLoading","length","every","PairState","allV2PairsWithLiquidity","pairState","pair","Boolean","Page","AppBody","AppHeader","title","subtitle","Text","color","textAlign","Dots","v2Pair","index","FullPositionCard","mb","Flex","flexDirection","alignItems","mt","Link","href","passHref","Button","id","variant","scale","as","style","width","startIcon","AddIcon"],"sourceRoot":""}