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AA,EAAAA,CAAW,CAAC1B,EAAQ,CAAGQ,KAAAA,EAgBtD,OAdAC,EAAoB,KACdI,EAAOgB,QAAQ,GAAKC,EAAAA,CAASA,CAACC,KAAK,EAIvClB,EAAOmB,OAAO,CACZP,GAAeG,EACX,GAAoCH,MAAAA,CAAjCK,EAAAA,CAASA,CAACG,QAAQ,CAACF,KAAK,CAAC,UAAoBxB,MAAA,CAAZkB,GACpCT,EACA,GAAoCA,MAAAA,CAAjCc,EAAAA,CAASA,CAACI,OAAO,CAACH,KAAK,CAAC,WAAexB,MAAA,CAANS,GACpCc,EAAAA,CAASA,CAACI,OAAO,CAACH,KAAK,CAE/B,EAAG,CAAClB,EAAQY,EAAaT,EAAM,EAExB,GAAAmB,EAAAC,GAAA,EAAAD,EAAAE,QAAA,IACT","sources":["webpack://_N_E/","webpack://_N_E/./src/hooks/useLastSafe.ts","webpack://_N_E/./src/pages/index.tsx","webpack://_N_E/"],"sourcesContent":["\n (window.__NEXT_P = window.__NEXT_P || []).push([\n \"/\",\n function () {\n return require(\"private-next-pages/index.tsx\");\n }\n ]);\n if(module.hot) {\n module.hot.dispose(function () {\n window.__NEXT_P.push([\"/\"])\n });\n }\n ","import { useAppSelector } from '@/store'\nimport { selectLastSafeAddress } from '@/store/sessionSlice'\nimport { useCurrentChain } from './useChains'\n\nconst useLastSafe = (): string | undefined => {\n const chainInfo = useCurrentChain()\n const chainId = chainInfo?.chainId || ''\n const prefix = chainInfo?.shortName || ''\n const lastSafeAddress = useAppSelector((state) => selectLastSafeAddress(state, chainId))\n return prefix && lastSafeAddress ? `${prefix}:${lastSafeAddress}` : undefined\n}\n\nexport default useLastSafe\n","import { useEffect, useLayoutEffect } from 'react'\nimport type { NextPage } from 'next'\nimport { useRouter } from 'next/router'\nimport useLastSafe from '@/hooks/useLastSafe'\nimport { AppRoutes } from '@/config/routes'\nimport { useAppSelector } from '@/store'\nimport { selectRpc } from '@/store/settingsSlice'\nimport useChains from '@/hooks/useChains'\nimport chains from '@/config/chains'\n\nconst useIsomorphicEffect = typeof window !== 'undefined' ? useLayoutEffect : useEffect\n\nconst IndexPage: NextPage = () => {\n const router = useRouter()\n const { safe, chain } = router.query\n const { configs } = useChains()\n const chainId = chain?.toString()\n ? chains[chain.toString()] || configs.find((item) => item.shortName === chain.toString())?.chainId\n : undefined\n const lastSafe = useLastSafe()\n const safeAddress = safe || lastSafe\n const customRpc = useAppSelector(selectRpc)\n const customRpcUrl = chainId ? customRpc?.[chainId] : undefined\n\n useIsomorphicEffect(() => {\n if (router.pathname !== AppRoutes.index) {\n return\n }\n\n router.replace(\n safeAddress && customRpcUrl\n ? `${AppRoutes.balances.index}?safe=${safeAddress}`\n : chain\n ? `${AppRoutes.welcome.index}?chain=${chain}`\n : AppRoutes.welcome.index,\n )\n }, [router, safeAddress, chain])\n\n return <>\n}\n\nexport default IndexPage\n"],"names":["window","__NEXT_P","push","__webpack_require__","hooks_useLastSafe","chainInfo","useCurrentChain","chainId","prefix","shortName","lastSafeAddress","useAppSelector","selectLastSafeAddress","state","concat","undefined","useIsomorphicEffect","useLayoutEffect","pages","configs","router","useRouter","safe","chain","query","useChains","toString","chains","find","item","lastSafe","useLastSafe","safeAddress","customRpc","selectRpc","customRpcUrl","pathname","AppRoutes","index","replace","balances","welcome","jsx_runtime","jsx","Fragment"],"sourceRoot":""}