@liberfi.io/ui-tokens 3.0.17 → 3.0.19

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.mjs CHANGED
@@ -1,4 +1,4 @@
1
- import {memo,useMemo,useCallback,useState,useRef,useEffect}from'react';import {List}from'react-window';import {StyledTooltip,HorsePowerHighIcon,HorsePowerLowIcon,HorsePowerIcon,cn,useCopyToClipboard,toast,CopyIcon,Link,WebsiteIcon,TwitterIcon,TelegramIcon,DiscordIcon,SearchIcon,PeopleIcon,KlineCandlesIcon,StarIcon,UserWithStarBadgeIcon,CookIcon,SniperIcon,RatIcon,BundlesIcon,TriangleUpIcon,TriangleDownIcon,Avatar,CameraIcon,Image,PauseIcon,HorizontalScrollContainer,Button,TrashIcon,Chip,StyledInput,XCloseIcon,Kbd,Spinner,EmptyIcon,useScreen,StyledModal,ModalContent,ModalHeader,ModalBody,useDisclosure,FilterIcon,ScrollShadow,ModalFooter,RefreshIcon,StyledPlainTabs,Tab,ChevronDownIcon,TableColumn,Sortable,StyledTable,TableHeader,TableBody,CrownIcon,ShiningStarIcon,TableRow,Skeleton,Progress,StyledLightTabs,StyledBadge,TableCell,StyledNumberInput}from'@liberfi.io/ui';import {useTranslation}from'@liberfi.io/i18n';import {jsx,jsxs,Fragment}from'react/jsx-runtime';import {useTickAge,useResizeObserver,useCallbackRef}from'@liberfi.io/hooks';import {SafeBigNumber,formatPercent,formatAge,searchTwitterUrl,formatAmount,formatAmountUSD,formatPriceUSD,parseTokenProtocolFamily,searchImageUrl,formatAmountUSDCompact,debounce,formatPrice,formatTokenProtocolName}from'@liberfi.io/utils';export{formatAmount}from'@liberfi.io/utils';import {SolanaTokenProtocol,Chain}from'@liberfi.io/types';import {useNewPoolsQuery,useNewPoolsSubscription,useMigratedTokensQuery,useFinalStretchTokensQuery,useSearchTokensInfiniteQuery,useTrendingTokensQuery,useTrendingTokensSubscription,useTokenHoldersQuery,useTokenSubscription,useTokenActivitiesQuery,useTokenActivitiesSubscription,useTokenSecurityQuery,useTokenStatsQuery,useWalletTokenPositionsQuery,useWalletLimitOrdersQuery,useTokenTopTradersQuery,useTokensByCreatorQuery,useSearchTokensQuery,useNewTokensQuery,useNewTokensSubscription,useStockTokensQuery,useStockTokensSubscription,useTokensQuery,useDexClient,useTokensSubscription,useTokenQuery}from'@liberfi.io/react';import {AsyncModal,useAsyncModal,StatsFlipPanel}from'@liberfi.io/ui-scaffold';import {useAtom}from'jotai';import {atomWithStorage}from'jotai/utils';import {useInfiniteLoader}from'react-window-infinite-loader';function hr({title:e,isPaused:t,extra:o,className:r}){let{t:n}=useTranslation();return jsxs("div",{className:cn("w-full h-12 px-3 flex-none bg-[#0a0a0b] flex items-center justify-between gap-4 border-b border-[rgba(39,39,42,0.6)]",r),children:[jsxs("div",{className:"flex items-center gap-2",children:[jsx("h2",{className:"font-semibold",children:e}),t&&jsxs("div",{className:"flex items-center gap-1 text-primary",children:[jsx(PauseIcon,{className:"w-4 h-4"}),jsx("span",{className:"text-xs hidden sm:inline",children:n("tokens.pulse.paused")})]})]}),o&&jsx("div",{className:"flex items-center gap-3",children:o})]})}function br({isLast:e=false,className:t}){return jsxs("div",{className:cn("w-full h-full overflow-hidden px-4 py-3 animate-pulse border-b",t),style:e?void 0:{borderBottomColor:"rgba(39,39,42,0.6)"},children:[jsxs("div",{className:"flex items-start gap-2",children:[jsxs("div",{className:"flex-none flex flex-col items-center gap-2",children:[jsx("div",{className:"w-20 h-20 rounded-sm bg-content2"}),jsx("div",{className:"w-14 h-2.5 rounded bg-content2"})]}),jsxs("div",{className:"flex-1 min-w-0 flex flex-col gap-2.5",children:[jsxs("div",{className:"flex items-center gap-1.5",children:[jsx("div",{className:"w-16 h-3.5 rounded bg-content2"}),jsx("div",{className:"w-20 h-3.5 rounded bg-content2"}),jsx("div",{className:"w-3.5 h-3.5 rounded bg-content2"})]}),jsxs("div",{className:"flex items-center gap-2",children:[jsx("div",{className:"w-8 h-3 rounded bg-content2"}),jsx("div",{className:"w-3.5 h-3.5 rounded bg-content2"}),jsx("div",{className:"w-3.5 h-3.5 rounded bg-content2"}),jsx("div",{className:"w-3.5 h-3.5 rounded bg-content2"})]}),jsxs("div",{className:"flex items-center gap-2",children:[jsx("div",{className:"w-12 h-3 rounded bg-content2"}),jsx("div",{className:"w-12 h-3 rounded bg-content2"})]}),jsxs("div",{className:"flex items-center gap-2",children:[jsx("div",{className:"w-10 h-3 rounded bg-content2"}),jsx("div",{className:"w-10 h-3 rounded bg-content2"}),jsx("div",{className:"w-10 h-3 rounded bg-content2"})]})]}),jsxs("div",{className:"flex-none flex flex-col items-end gap-2.5",children:[jsx("div",{className:"flex flex-col items-end gap-1",children:jsx("div",{className:"w-16 h-4 rounded bg-content2"})}),jsxs("div",{className:"flex flex-col items-end gap-1",children:[jsx("div",{className:"w-14 h-3 rounded bg-content2"}),jsx("div",{className:"w-12 h-2.5 rounded bg-content2"})]}),jsx("div",{className:"w-10 h-2.5 rounded bg-content2"})]})]}),jsxs("div",{className:"mt-2.5 flex items-center gap-4",children:[jsxs("div",{className:"flex-1 min-w-0 flex items-center gap-1",children:[jsx("div",{className:"w-12 h-5 rounded-full bg-content2"}),jsx("div",{className:"w-12 h-5 rounded-full bg-content2"}),jsx("div",{className:"w-12 h-5 rounded-full bg-content2"}),jsx("div",{className:"w-12 h-5 rounded-full bg-content2"}),jsx("div",{className:"w-12 h-5 rounded-full bg-content2"})]}),jsx("div",{className:"w-16 h-7 rounded-md bg-content2 flex-none"})]})]})}function $({icon:e,value:t,tooltip:o,warning:r,disable:n=false,className:s,tooltipPlacement:i="top"}){return jsx(StyledTooltip,{content:o,placement:i,children:jsxs("div",{className:cn("shrink-0 px-2 py-0.5 flex items-center gap-1 rounded-full text-xs border border-border/60",r?"text-danger-500":n?"text-neutral":"text-primary",s),children:[e,jsx("span",{children:t})]})})}var No={kol:{label:"KOL",bgClass:"bg-yellow-500/15",textClass:"text-yellow-400"},smart:{label:"Smart",bgClass:"bg-sky-500/15",textClass:"text-sky-400"},sniper:{label:"Sniper",bgClass:"bg-red-500/15",textClass:"text-red-400"},dev:{label:"Dev",bgClass:"bg-orange-500/15",textClass:"text-orange-400"},bundle:{label:"Bundle",bgClass:"bg-purple-500/15",textClass:"text-purple-400"},bluechip:{label:"Bluechip",bgClass:"bg-emerald-500/15",textClass:"text-emerald-400"},insider:{label:"Insider",bgClass:"bg-fuchsia-500/15",textClass:"text-fuchsia-400"},fresh:{label:"Fresh",bgClass:"bg-teal-500/15",textClass:"text-teal-400"}};function Ya({tag:e,className:t}){let o=No[e]??{label:e,bgClass:"bg-default/20",textClass:"text-default-500"};return jsx("span",{className:cn("inline-flex items-center rounded px-1.5 py-0.5 text-[10px] font-medium uppercase leading-none tracking-wide",o.bgClass,o.textClass,t),children:o.label})}function Nr({tags:e,className:t,max:o}){if(!e||e.length===0)return null;let r=o!=null&&o>0?e.slice(0,o):e,n=e.length-r.length;return jsxs("div",{className:cn("flex flex-wrap items-center gap-1",t),children:[r.map(s=>jsx(Ya,{tag:s},s)),n>0&&jsxs("span",{className:"inline-flex items-center rounded bg-default/20 px-1.5 py-0.5 text-[10px] font-medium text-default-500",children:["+",n]})]})}function Za({tag:e,className:t}){let o=No[e]??{label:e,bgClass:"bg-default/20",textClass:"text-default-500"};return jsx("span",{className:cn("inline-flex items-center rounded px-1.5 py-0.5 text-[10px] font-medium uppercase leading-none tracking-wide",o.bgClass,o.textClass,t),children:o.label})}function Mt({tags:e,className:t,max:o}){if(!e||e.length===0)return null;let r=o!=null&&o>0?e.slice(0,o):e,n=e.length-r.length;return jsxs("div",{className:cn("flex flex-wrap items-center gap-1",t),children:[r.map(s=>jsx(Za,{tag:s},s)),n>0&&jsxs("span",{className:"inline-flex items-center rounded bg-default/20 px-1.5 py-0.5 text-[10px] font-medium text-default-500",children:["+",n]})]})}var ja={[SolanaTokenProtocol.BAGS]:{text:"text-bags",bg:"bg-bags",bg5:"bg-bags/5",bg20:"bg-bags/20",border:"border-bags"},[SolanaTokenProtocol.BELIEVE]:{text:"text-believe",bg:"bg-believe",bg5:"bg-believe/5",bg20:"bg-believe/20",border:"border-believe"},[SolanaTokenProtocol.BONK]:{text:"text-bonk",bg:"bg-bonk",bg5:"bg-bonk/5",bg20:"bg-bonk/20",border:"border-bonk"},[SolanaTokenProtocol.BOOP]:{text:"text-boop",bg:"bg-boop",bg5:"bg-boop/5",bg20:"bg-boop/20",border:"border-boop"},[SolanaTokenProtocol.HEAVEN]:{text:"text-heaven",bg:"bg-heaven",bg5:"bg-heaven/5",bg20:"bg-heaven/20",border:"border-heaven"},[SolanaTokenProtocol.JUPSTUDIO]:{text:"text-jupstudio",bg:"bg-jupstudio",bg5:"bg-jupstudio/5",bg20:"bg-jupstudio/20",border:"border-jupstudio"},[SolanaTokenProtocol.LAUNCHLAB]:{text:"text-launchlab",bg:"bg-launchlab",bg5:"bg-launchlab/5",bg20:"bg-launchlab/20",border:"border-launchlab"},[SolanaTokenProtocol.METEORA]:{text:"text-meteora",bg:"bg-meteora",bg5:"bg-meteora/5",bg20:"bg-meteora/20",border:"border-meteora"},[SolanaTokenProtocol.MOONIT]:{text:"text-moonit",bg:"bg-moonit",bg5:"bg-moonit/5",bg20:"bg-moonit/20",border:"border-moonit"},[SolanaTokenProtocol.MOONSHOT]:{text:"text-moonshot",bg:"bg-moonshot",bg5:"bg-moonshot/5",bg20:"bg-moonshot/20",border:"border-moonshot"},[SolanaTokenProtocol.ORCA]:{text:"text-orca",bg:"bg-orca",bg5:"bg-orca/5",bg20:"bg-orca/20",border:"border-orca"},[SolanaTokenProtocol.PUMP]:{text:"text-pump",bg:"bg-pump",bg5:"bg-pump/5",bg20:"bg-pump/20",border:"border-pump"},[SolanaTokenProtocol.RAYDIUM]:{text:"text-raydium",bg:"bg-raydium",bg5:"bg-raydium/5",bg20:"bg-raydium/20",border:"border-raydium"},[SolanaTokenProtocol.SUGAR]:{text:"text-sugar",bg:"bg-sugar",bg5:"bg-sugar/5",bg20:"bg-sugar/20",border:"border-sugar"},[SolanaTokenProtocol.VIRTUAL_CURVE]:{text:"text-virtual-curve",bg:"bg-virtual-curve",bg5:"bg-virtual-curve/5",bg20:"bg-virtual-curve/20",border:"border-virtual-curve"},[SolanaTokenProtocol.PUMP_AMM]:{text:"text-pump-amm",bg:"bg-pump-amm",bg5:"bg-pump-amm/5",bg20:"bg-pump-amm/20",border:"border-pump-amm"}},el={text:"text-neutral",bg:"bg-neutral",bg5:"bg-neutral/5",bg20:"bg-neutral/20",border:"border-neutral"};function He(e){return ja[e]??el}function de({token:e,enablePreview:t=true,enableSearch:o=true,showProgress:r=true,showProtocolFamily:n=true,radius:s="sm",className:i,classNames:l}){let a=useMemo(()=>e.launchedFrom?.protocolFamily?parseTokenProtocolFamily(e.chain,e.launchedFrom.protocolFamily):void 0,[e.chain,e.launchedFrom?.protocolFamily]),d=useMemo(()=>n&&a,[n,a]),m=useMemo(()=>r&&e.migrateProgress&&new SafeBigNumber(e.migrateProgress).lt(100),[r,e.migrateProgress]),c=useMemo(()=>o&&e.image,[o,e.image]),p=useMemo(()=>(e.symbol??e.name??e.address??"L").slice(0,1).toUpperCase(),[e.symbol,e.name,e.address]),[u,g]=useState(false),k=useCallback(()=>{g(true);},[]),x=useCallback(()=>{g(false);},[]),f=useCallback(h=>{if(h.stopPropagation(),!e.image)return;let b=searchImageUrl(e.image);window.open(b,"_blank");},[e.image]);return jsxs("div",{className:cn("relative justify-center items-center",i??"w-15 h-15"),children:[!m&&jsx("div",{className:cn("absolute inset-0",`rounded-${s}`,a?He(a).bg:"bg-[rgba(39,39,42,0.6)]",l?.background)}),m&&jsx("div",{className:cn("absolute -inset-0.5",`rounded-${s}`),children:jsx(il,{className:cn(a?He(a).text:"text-[rgba(39,39,42,0.6)]",l?.progress),progress:e.migrateProgress??"0"})}),jsx("div",{className:cn("absolute inset-0 p-px flex items-center justify-center",`rounded-${s}`,a?He(a).bg20:"bg-[rgba(39,39,42,0.12)]",l?.avatarWrapper),children:jsx(sl,{token:e,radius:s,enableSearch:o,enablePreview:t,classNames:l,children:jsxs("div",{className:cn("relative w-full h-full bg-content1 flex items-center justify-center p-0.5",`rounded-${s}`,u&&c&&"cursor-pointer"),onMouseEnter:k,onMouseLeave:x,children:[jsx(Avatar,{showFallback:true,src:e.image,name:p,className:cn("w-full h-full bg-content1 text-neutral text-2xl",`rounded-${s}`,l?.avatar)}),u&&c&&jsx("div",{className:cn("absolute inset-0 bg-content1/80 flex items-center justify-center",`rounded-${s}`,l?.searchWrapper),onClick:f,children:jsx(CameraIcon,{className:cn("w-6 h-6",l?.searchIcon)})})]})})}),d&&jsx("div",{className:"contents",children:jsx(StyledTooltip,{content:e.launchedFrom?.protocolFamily??a,placement:"bottom",children:jsx("div",{className:cn("absolute -bottom-1 -right-1 rounded-full p-px w-4 h-4",a&&He(a).bg,l?.protocolFamilyIconWrapper),children:jsx(Image,{removeWrapper:true,src:`/images/protocols/${a}.svg`,className:cn("w-full h-full rounded-full bg-content1",l?.protocolFamilyIcon)})})})})]})}function sl({token:e,radius:t,enableSearch:o,enablePreview:r,classNames:n,children:s}){return useMemo(()=>r&&e.image,[r,e.image])?jsx(StyledTooltip,{content:jsx(nl,{token:e,radius:t,enableSearch:o,classNames:n}),closeDelay:100,placement:"bottom-start",classNames:{content:"p-1"},children:s}):s}function nl({token:e,enableSearch:t,radius:o,classNames:r}){let n=useMemo(()=>t&&e.image,[t,e.image]),s=useMemo(()=>(e.symbol??e.name??e.address??"L").slice(0,1).toUpperCase(),[e.symbol,e.name,e.address]),[i,l]=useState(false),a=useCallback(()=>{l(true);},[]),d=useCallback(()=>{l(false);},[]),m=useCallback(c=>{if(c.stopPropagation(),!e.image)return;let p=searchImageUrl(e.image);window.open(p,"_blank");},[e.image]);return jsxs("div",{className:cn("relative flex items-center justify-center w-60 h-60",`rounded-${o}`,i&&n&&"cursor-pointer",r?.previewWrapper),onMouseEnter:a,onMouseLeave:d,children:[jsx(Avatar,{showFallback:true,src:e.image,name:s,className:cn("w-full h-full bg-content1 text-neutral text-3xl",`rounded-${o}`,r?.previewAvatar)}),i&&n&&jsx("div",{className:cn("absolute inset-0 bg-content1/80 flex items-center justify-center",`rounded-${o}`,r?.previewSearchWrapper),onClick:m,children:jsx(CameraIcon,{className:cn("w-10 h-10",r?.previewSearchIcon)})})]})}function il({progress:e,className:t}){let o=useMemo(()=>296-Number(e)*296/100,[e]);return jsxs("svg",{viewBox:"0 0 78 78",className:"w-full h-full",children:[jsx("path",{className:`${t} opacity-40`,stroke:"currentColor",fill:"transparent",strokeWidth:"1",d:`
1
+ import {memo,useMemo,useState,useRef,useCallback,useEffect}from'react';import {List}from'react-window';import {StyledTooltip,HorsePowerHighIcon,HorsePowerLowIcon,HorsePowerIcon,cn,useCopyToClipboard,toast,CheckIcon,CopyIcon,Link,WebsiteIcon,TwitterIcon,TelegramIcon,DiscordIcon,SearchIcon,PeopleIcon,KlineCandlesIcon,StarIcon,UserWithStarBadgeIcon,CookIcon,SniperIcon,RatIcon,BundlesIcon,TriangleUpIcon,TriangleDownIcon,Avatar,CameraIcon,Image,PauseIcon,HorizontalScrollContainer,Button,TrashIcon,Chip,StyledInput,XCloseIcon,Kbd,Spinner,EmptyIcon,useScreen,StyledModal,ModalContent,ModalHeader,ModalBody,useDisclosure,FilterIcon,ScrollShadow,ModalFooter,RefreshIcon,StyledPlainTabs,Tab,ChevronDownIcon,TableColumn,Sortable,StyledTable,TableHeader,TableBody,CrownIcon,ShiningStarIcon,TableRow,Skeleton,Progress,StyledLightTabs,StyledBadge,TableCell,StyledNumberInput}from'@liberfi.io/ui';import {useTranslation}from'@liberfi.io/i18n';import {jsx,jsxs,Fragment}from'react/jsx-runtime';import {useTickAge,useResizeObserver,useCallbackRef}from'@liberfi.io/hooks';import {SafeBigNumber,formatPercent,formatAge,searchTwitterUrl,formatAmount,formatAmountUSD,formatPriceUSD,parseTokenProtocolFamily,searchImageUrl,formatAmountUSDCompact,debounce,formatPrice,formatTokenProtocolName}from'@liberfi.io/utils';export{formatAmount}from'@liberfi.io/utils';import {SolanaTokenProtocol,Chain}from'@liberfi.io/types';import {useNewPoolsQuery,useNewPoolsSubscription,useMigratedTokensQuery,useFinalStretchTokensQuery,useSearchTokensInfiniteQuery,useTrendingTokensQuery,useTrendingTokensSubscription,useTokenHoldersQuery,useTokenSubscription,useTokenActivitiesQuery,useTokenActivitiesSubscription,useTokenSecurityQuery,useTokenStatsQuery,useWalletTokenPositionsQuery,useWalletLimitOrdersQuery,useTokenTopTradersQuery,useTokensByCreatorQuery,useSearchTokensQuery,useNewTokensQuery,useNewTokensSubscription,useStockTokensQuery,useStockTokensSubscription,useTokensQuery,useDexClient,useTokensSubscription,useTokenQuery}from'@liberfi.io/react';import {AsyncModal,useAsyncModal,StatsFlipPanel}from'@liberfi.io/ui-scaffold';import {useAtom}from'jotai';import {atomWithStorage}from'jotai/utils';import {useInfiniteLoader}from'react-window-infinite-loader';function Pr({title:e,isPaused:t,extra:o,className:r}){let{t:s}=useTranslation();return jsxs("div",{className:cn("w-full h-12 px-3 flex-none bg-[#0a0a0b] flex items-center justify-between gap-4 border-b border-[rgba(39,39,42,0.6)]",r),children:[jsxs("div",{className:"flex items-center gap-2",children:[jsx("h2",{className:"font-semibold",children:e}),t&&jsxs("div",{className:"flex items-center gap-1 text-primary",children:[jsx(PauseIcon,{className:"w-4 h-4"}),jsx("span",{className:"text-xs hidden sm:inline",children:s("tokens.pulse.paused")})]})]}),o&&jsx("div",{className:"flex items-center gap-3",children:o})]})}function Rr({isLast:e=false,className:t}){return jsxs("div",{className:cn("w-full h-full overflow-hidden px-4 py-3 animate-pulse border-b",t),style:e?void 0:{borderBottomColor:"rgba(39,39,42,0.6)"},children:[jsxs("div",{className:"flex items-start gap-2",children:[jsxs("div",{className:"flex-none flex flex-col items-center gap-2",children:[jsx("div",{className:"w-20 h-20 rounded-sm bg-content2"}),jsx("div",{className:"w-14 h-2.5 rounded bg-content2"})]}),jsxs("div",{className:"flex-1 min-w-0 flex flex-col gap-2.5",children:[jsxs("div",{className:"flex items-center gap-1.5",children:[jsx("div",{className:"w-16 h-3.5 rounded bg-content2"}),jsx("div",{className:"w-20 h-3.5 rounded bg-content2"}),jsx("div",{className:"w-3.5 h-3.5 rounded bg-content2"})]}),jsxs("div",{className:"flex items-center gap-2",children:[jsx("div",{className:"w-8 h-3 rounded bg-content2"}),jsx("div",{className:"w-3.5 h-3.5 rounded bg-content2"}),jsx("div",{className:"w-3.5 h-3.5 rounded bg-content2"}),jsx("div",{className:"w-3.5 h-3.5 rounded bg-content2"})]}),jsxs("div",{className:"flex items-center gap-2",children:[jsx("div",{className:"w-12 h-3 rounded bg-content2"}),jsx("div",{className:"w-12 h-3 rounded bg-content2"})]}),jsxs("div",{className:"flex items-center gap-2",children:[jsx("div",{className:"w-10 h-3 rounded bg-content2"}),jsx("div",{className:"w-10 h-3 rounded bg-content2"}),jsx("div",{className:"w-10 h-3 rounded bg-content2"})]})]}),jsxs("div",{className:"flex-none flex flex-col items-end gap-2.5",children:[jsx("div",{className:"flex flex-col items-end gap-1",children:jsx("div",{className:"w-16 h-4 rounded bg-content2"})}),jsxs("div",{className:"flex flex-col items-end gap-1",children:[jsx("div",{className:"w-14 h-3 rounded bg-content2"}),jsx("div",{className:"w-12 h-2.5 rounded bg-content2"})]}),jsx("div",{className:"w-10 h-2.5 rounded bg-content2"})]})]}),jsxs("div",{className:"mt-2.5 flex items-center gap-4",children:[jsxs("div",{className:"flex-1 min-w-0 flex items-center gap-1",children:[jsx("div",{className:"w-12 h-5 rounded-full bg-content2"}),jsx("div",{className:"w-12 h-5 rounded-full bg-content2"}),jsx("div",{className:"w-12 h-5 rounded-full bg-content2"}),jsx("div",{className:"w-12 h-5 rounded-full bg-content2"}),jsx("div",{className:"w-12 h-5 rounded-full bg-content2"})]}),jsx("div",{className:"w-16 h-7 rounded-md bg-content2 flex-none"})]})]})}function $({icon:e,value:t,tooltip:o,warning:r,disable:s=false,className:n,tooltipPlacement:i="top"}){return jsx(StyledTooltip,{content:o,placement:i,children:jsxs("div",{className:cn("shrink-0 px-2 py-0.5 flex items-center gap-1 rounded-full text-xs border border-border/60",r?"text-danger-500":s?"text-neutral":"text-primary",n),children:[e,jsx("span",{children:t})]})})}var Io={kol:{label:"KOL",bgClass:"bg-yellow-500/15",textClass:"text-yellow-400"},smart:{label:"Smart",bgClass:"bg-sky-500/15",textClass:"text-sky-400"},sniper:{label:"Sniper",bgClass:"bg-red-500/15",textClass:"text-red-400"},dev:{label:"Dev",bgClass:"bg-orange-500/15",textClass:"text-orange-400"},bundle:{label:"Bundle",bgClass:"bg-purple-500/15",textClass:"text-purple-400"},bluechip:{label:"Bluechip",bgClass:"bg-emerald-500/15",textClass:"text-emerald-400"},insider:{label:"Insider",bgClass:"bg-fuchsia-500/15",textClass:"text-fuchsia-400"},fresh:{label:"Fresh",bgClass:"bg-teal-500/15",textClass:"text-teal-400"}};function xl({tag:e,className:t}){let o=Io[e]??{label:e,bgClass:"bg-default/20",textClass:"text-default-500"};return jsx("span",{className:cn("inline-flex items-center rounded px-1.5 py-0.5 text-[10px] font-medium uppercase leading-none tracking-wide",o.bgClass,o.textClass,t),children:o.label})}function Mr({tags:e,className:t,max:o}){if(!e||e.length===0)return null;let r=o!=null&&o>0?e.slice(0,o):e,s=e.length-r.length;return jsxs("div",{className:cn("flex flex-wrap items-center gap-1",t),children:[r.map(n=>jsx(xl,{tag:n},n)),s>0&&jsxs("span",{className:"inline-flex items-center rounded bg-default/20 px-1.5 py-0.5 text-[10px] font-medium text-default-500",children:["+",s]})]})}function kl({tag:e,className:t}){let o=Io[e]??{label:e,bgClass:"bg-default/20",textClass:"text-default-500"};return jsx("span",{className:cn("inline-flex items-center rounded px-1.5 py-0.5 text-[10px] font-medium uppercase leading-none tracking-wide",o.bgClass,o.textClass,t),children:o.label})}function Ot({tags:e,className:t,max:o}){if(!e||e.length===0)return null;let r=o!=null&&o>0?e.slice(0,o):e,s=e.length-r.length;return jsxs("div",{className:cn("flex flex-wrap items-center gap-1",t),children:[r.map(n=>jsx(kl,{tag:n},n)),s>0&&jsxs("span",{className:"inline-flex items-center rounded bg-default/20 px-1.5 py-0.5 text-[10px] font-medium text-default-500",children:["+",s]})]})}var hl={[SolanaTokenProtocol.BAGS]:{text:"text-bags",bg:"bg-bags",bg5:"bg-bags/5",bg20:"bg-bags/20",border:"border-bags"},[SolanaTokenProtocol.BELIEVE]:{text:"text-believe",bg:"bg-believe",bg5:"bg-believe/5",bg20:"bg-believe/20",border:"border-believe"},[SolanaTokenProtocol.BONK]:{text:"text-bonk",bg:"bg-bonk",bg5:"bg-bonk/5",bg20:"bg-bonk/20",border:"border-bonk"},[SolanaTokenProtocol.BOOP]:{text:"text-boop",bg:"bg-boop",bg5:"bg-boop/5",bg20:"bg-boop/20",border:"border-boop"},[SolanaTokenProtocol.HEAVEN]:{text:"text-heaven",bg:"bg-heaven",bg5:"bg-heaven/5",bg20:"bg-heaven/20",border:"border-heaven"},[SolanaTokenProtocol.JUPSTUDIO]:{text:"text-jupstudio",bg:"bg-jupstudio",bg5:"bg-jupstudio/5",bg20:"bg-jupstudio/20",border:"border-jupstudio"},[SolanaTokenProtocol.LAUNCHLAB]:{text:"text-launchlab",bg:"bg-launchlab",bg5:"bg-launchlab/5",bg20:"bg-launchlab/20",border:"border-launchlab"},[SolanaTokenProtocol.METEORA]:{text:"text-meteora",bg:"bg-meteora",bg5:"bg-meteora/5",bg20:"bg-meteora/20",border:"border-meteora"},[SolanaTokenProtocol.MOONIT]:{text:"text-moonit",bg:"bg-moonit",bg5:"bg-moonit/5",bg20:"bg-moonit/20",border:"border-moonit"},[SolanaTokenProtocol.MOONSHOT]:{text:"text-moonshot",bg:"bg-moonshot",bg5:"bg-moonshot/5",bg20:"bg-moonshot/20",border:"border-moonshot"},[SolanaTokenProtocol.ORCA]:{text:"text-orca",bg:"bg-orca",bg5:"bg-orca/5",bg20:"bg-orca/20",border:"border-orca"},[SolanaTokenProtocol.PUMP]:{text:"text-pump",bg:"bg-pump",bg5:"bg-pump/5",bg20:"bg-pump/20",border:"border-pump"},[SolanaTokenProtocol.RAYDIUM]:{text:"text-raydium",bg:"bg-raydium",bg5:"bg-raydium/5",bg20:"bg-raydium/20",border:"border-raydium"},[SolanaTokenProtocol.SUGAR]:{text:"text-sugar",bg:"bg-sugar",bg5:"bg-sugar/5",bg20:"bg-sugar/20",border:"border-sugar"},[SolanaTokenProtocol.VIRTUAL_CURVE]:{text:"text-virtual-curve",bg:"bg-virtual-curve",bg5:"bg-virtual-curve/5",bg20:"bg-virtual-curve/20",border:"border-virtual-curve"},[SolanaTokenProtocol.PUMP_AMM]:{text:"text-pump-amm",bg:"bg-pump-amm",bg5:"bg-pump-amm/5",bg20:"bg-pump-amm/20",border:"border-pump-amm"}},bl={text:"text-neutral",bg:"bg-neutral",bg5:"bg-neutral/5",bg20:"bg-neutral/20",border:"border-neutral"};function Me(e){return hl[e]??bl}function ce({token:e,enablePreview:t=true,enableSearch:o=true,showProgress:r=true,showProtocolFamily:s=true,radius:n="sm",className:i,classNames:a}){let l=useMemo(()=>e.launchedFrom?.protocolFamily?parseTokenProtocolFamily(e.chain,e.launchedFrom.protocolFamily):void 0,[e.chain,e.launchedFrom?.protocolFamily]),d=useMemo(()=>s&&l,[s,l]),m=useMemo(()=>r&&e.migrateProgress&&new SafeBigNumber(e.migrateProgress).lt(100),[r,e.migrateProgress]),c=useMemo(()=>o&&e.image,[o,e.image]),p=useMemo(()=>(e.symbol??e.name??e.address??"L").slice(0,1).toUpperCase(),[e.symbol,e.name,e.address]),[u,f]=useState(false),k=useCallback(()=>{f(true);},[]),x=useCallback(()=>{f(false);},[]),g=useCallback(h=>{if(h.stopPropagation(),!e.image)return;let b=searchImageUrl(e.image);window.open(b,"_blank");},[e.image]);return jsxs("div",{className:cn("relative justify-center items-center",i??"w-15 h-15"),children:[!m&&jsx("div",{className:cn("absolute inset-0",`rounded-${n}`,l?Me(l).bg:"bg-[rgba(39,39,42,0.6)]",a?.background)}),m&&jsx("div",{className:cn("absolute -inset-0.5",`rounded-${n}`),children:jsx(Cl,{className:cn(l?Me(l).text:"text-[rgba(39,39,42,0.6)]",a?.progress),progress:e.migrateProgress??"0"})}),jsx("div",{className:cn("absolute inset-0 p-px flex items-center justify-center",`rounded-${n}`,l?Me(l).bg20:"bg-[rgba(39,39,42,0.12)]",a?.avatarWrapper),children:jsx(Nl,{token:e,radius:n,enableSearch:o,enablePreview:t,classNames:a,children:jsxs("div",{className:cn("relative w-full h-full bg-content1 flex items-center justify-center p-0.5",`rounded-${n}`,u&&c&&"cursor-pointer"),onMouseEnter:k,onMouseLeave:x,children:[jsx(Avatar,{showFallback:true,src:e.image,name:p,className:cn("w-full h-full bg-content1 text-neutral text-2xl",`rounded-${n}`,a?.avatar)}),u&&c&&jsx("div",{className:cn("absolute inset-0 bg-content1/80 flex items-center justify-center",`rounded-${n}`,a?.searchWrapper),onClick:g,children:jsx(CameraIcon,{className:cn("w-6 h-6",a?.searchIcon)})})]})})}),d&&jsx("div",{className:"contents",children:jsx(StyledTooltip,{content:e.launchedFrom?.protocolFamily??l,placement:"bottom",children:jsx("div",{className:cn("absolute -bottom-1 -right-1 rounded-full p-px w-4 h-4",l&&Me(l).bg,a?.protocolFamilyIconWrapper),children:jsx(Image,{removeWrapper:true,src:`/images/protocols/${l}.svg`,className:cn("w-full h-full rounded-full bg-content1",a?.protocolFamilyIcon)})})})})]})}function Nl({token:e,radius:t,enableSearch:o,enablePreview:r,classNames:s,children:n}){return useMemo(()=>r&&e.image,[r,e.image])?jsx(StyledTooltip,{content:jsx(Sl,{token:e,radius:t,enableSearch:o,classNames:s}),closeDelay:100,placement:"bottom-start",classNames:{content:"p-1"},children:n}):n}function Sl({token:e,enableSearch:t,radius:o,classNames:r}){let s=useMemo(()=>t&&e.image,[t,e.image]),n=useMemo(()=>(e.symbol??e.name??e.address??"L").slice(0,1).toUpperCase(),[e.symbol,e.name,e.address]),[i,a]=useState(false),l=useCallback(()=>{a(true);},[]),d=useCallback(()=>{a(false);},[]),m=useCallback(c=>{if(c.stopPropagation(),!e.image)return;let p=searchImageUrl(e.image);window.open(p,"_blank");},[e.image]);return jsxs("div",{className:cn("relative flex items-center justify-center w-60 h-60",`rounded-${o}`,i&&s&&"cursor-pointer",r?.previewWrapper),onMouseEnter:l,onMouseLeave:d,children:[jsx(Avatar,{showFallback:true,src:e.image,name:n,className:cn("w-full h-full bg-content1 text-neutral text-3xl",`rounded-${o}`,r?.previewAvatar)}),i&&s&&jsx("div",{className:cn("absolute inset-0 bg-content1/80 flex items-center justify-center",`rounded-${o}`,r?.previewSearchWrapper),onClick:m,children:jsx(CameraIcon,{className:cn("w-10 h-10",r?.previewSearchIcon)})})]})}function Cl({progress:e,className:t}){let o=useMemo(()=>296-Number(e)*296/100,[e]);return jsxs("svg",{viewBox:"0 0 78 78",className:"w-full h-full",children:[jsx("path",{className:`${t} opacity-40`,stroke:"currentColor",fill:"transparent",strokeWidth:"1",d:`
2
2
  M 76 76
3
3
  L 6 76
4
4
  Q 2 76 2 72
@@ -18,7 +18,7 @@ import {memo,useMemo,useCallback,useState,useRef,useEffect}from'react';import {L
18
18
  Q 76 2 76 6
19
19
  L 76 72
20
20
  Q 76 76 76 76
21
- `})]})}function Fr({token:e,renderAction:t,isLast:o=false,onSelectToken:r,className:n}){let{t:s}=useTranslation(),i=useCopyToClipboard(),l=useTickAge(e.createdAt),a=e.marketData,d=e.stats?.["1h"],m=useCallback(()=>{r?.(e);},[r,e]),c=useCallback(F=>{F.stopPropagation(),i(e.address,()=>toast.success(s("tokens.copied.address")));},[i,e.address,s]),p=useMemo(()=>d?.volumesInUsd,[d?.volumesInUsd]),u=useMemo(()=>d?.buyVolumesInUsd,[d?.buyVolumesInUsd]),g=useMemo(()=>d?.sellVolumesInUsd,[d?.sellVolumesInUsd]),k=useMemo(()=>d?.trades,[d?.trades]),x=useMemo(()=>a?.marketCapInUsd,[a?.marketCapInUsd]),f=useMemo(()=>a?.tvlInUsd,[a?.tvlInUsd]),h=useMemo(()=>{let F=new SafeBigNumber(x);return F.lt(1e3)?"text-foreground":F.lt(1e6)?"text-secondary":"text-primary"},[x]),b=useMemo(()=>new SafeBigNumber(a?.top10HoldingsRatio).gte(.1),[a?.top10HoldingsRatio]),T=useMemo(()=>new SafeBigNumber(a?.devHoldingsRatio).gte(.1),[a?.devHoldingsRatio]),U=useMemo(()=>new SafeBigNumber(a?.insiderHoldingsRatio).gte(.1),[a?.insiderHoldingsRatio]),I=useMemo(()=>new SafeBigNumber(a?.sniperHoldingsRatio).gte(.1),[a?.sniperHoldingsRatio]),q=useMemo(()=>new SafeBigNumber(a?.bundleHoldingsRatio).gte(.1),[a?.bundleHoldingsRatio]),[ve,_]=useMemo(()=>{let F=Number(d?.buys??0),w=Number(d?.sells??0),W=F+w;if(W===0)return [12,12];let ct=Math.round(F/W*24);return [ct,24-ct]},[d?.buys,d?.sells]),ke=a?.holders!==void 0&&a.holders>0,he=a?.proHolders!==void 0&&a.proHolders>0,M=a?.kolHolders!==void 0&&a.kolHolders>0,re=ke||he||M;return jsxs("div",{className:cn("relative w-full h-full overflow-hidden px-4 py-3 hover:bg-content2/40 cursor-pointer border-b",n),style:o?void 0:{borderBottomColor:"rgba(39,39,42,0.6)"},onClick:r?m:void 0,children:[jsxs("div",{className:"flex items-start gap-2",children:[jsxs("div",{className:"flex-none flex flex-col items-center gap-2",children:[jsx(de,{token:e,enableSearch:true,enablePreview:!!e.image,showProgress:true,className:"w-20 h-20"}),jsxs("button",{type:"button",className:"text-xs font-mono text-neutral hover:text-foreground leading-none",onClick:c,"aria-label":s("tokens.copied.address"),title:s("tokens.copied.address"),children:[e.address.slice(0,4),"...",e.address.slice(-4)]})]}),jsxs("div",{className:"flex-1 min-w-0 flex flex-col gap-2.5",children:[jsxs("button",{type:"button",className:"flex items-center gap-1.5 min-w-0 text-left",onClick:c,"aria-label":s("tokens.copied.address"),title:s("tokens.copied.address"),children:[jsx("span",{className:"flex-none text-sm font-semibold leading-none whitespace-nowrap overflow-hidden text-ellipsis max-w-24",children:e.symbol}),jsx(StyledTooltip,{content:e.name,children:jsx("span",{className:"text-[13px] leading-none text-neutral truncate max-w-20",children:e.name})}),jsx(CopyIcon,{className:"flex-none w-3.5 h-3.5 text-neutral"})]}),jsxs("div",{className:"flex items-center gap-2 leading-none",children:[jsx("span",{className:"text-[13px] font-mono font-medium text-neutral",children:formatAge(l)}),e.socialMedias?.website&&jsx(Link,{href:e.socialMedias.website,className:"text-neutral hover:text-primary",target:"_blank",onClick:F=>F.stopPropagation(),children:jsx(WebsiteIcon,{className:"w-3.5 h-3.5"})}),e.socialMedias?.twitter&&jsx(Link,{href:e.socialMedias.twitter,className:"text-neutral hover:text-primary",target:"_blank",onClick:F=>F.stopPropagation(),children:jsx(TwitterIcon,{className:"w-3.5 h-3.5"})}),e.socialMedias?.telegram&&jsx(Link,{href:e.socialMedias.telegram,className:"text-neutral hover:text-primary",target:"_blank",onClick:F=>F.stopPropagation(),children:jsx(TelegramIcon,{className:"w-3.5 h-3.5"})}),jsx(Link,{href:searchTwitterUrl(`${e.symbol} OR ${e.address}`),className:"max-sm:hidden text-neutral hover:text-primary",target:"_blank",onClick:F=>F.stopPropagation(),children:jsx(SearchIcon,{className:"w-3.5 h-3.5"})})]}),jsxs("div",{className:"flex items-center gap-2 text-xs font-mono text-foreground/80 leading-none",children:[jsxs("span",{className:"inline-flex items-baseline gap-1",children:[jsx("span",{className:"text-neutral",children:"MC"}),jsx("span",{className:cn(h),children:formatAmountUSDCompact(x)})]}),jsx("span",{className:"text-neutral/30",children:"\xB7"}),jsxs("span",{className:"inline-flex items-baseline gap-1",children:[jsx("span",{className:"text-neutral",children:"Liq"}),jsx("span",{children:formatAmountUSDCompact(f)})]})]}),re&&jsxs("div",{className:"flex items-center gap-2 text-xs font-mono text-neutral leading-none",children:[ke&&jsx(StyledTooltip,{content:s("tokens.tokenInfo.holders"),children:jsxs("span",{className:"inline-flex items-center gap-1",children:[jsx(PeopleIcon,{className:"w-3 h-3 text-neutral"}),formatAmount(a?.holders)]})}),he&&jsx(StyledTooltip,{content:s("tokens.tokenInfo.proHolders"),children:jsxs("span",{className:"inline-flex items-center gap-1",children:[jsx(KlineCandlesIcon,{className:"w-3 h-3 text-neutral"}),formatAmount(a?.proHolders)]})}),M&&jsx(StyledTooltip,{content:s("tokens.tokenInfo.kolHolders"),children:jsxs("span",{className:"inline-flex items-center gap-1",children:[jsx(StarIcon,{className:"w-3 h-3 text-neutral"}),formatAmount(a?.kolHolders)]})})]})]}),jsxs("div",{className:"flex-none flex flex-col items-end gap-2.5 leading-none font-mono",children:[jsx("div",{className:"flex flex-col items-end gap-1",children:jsx("span",{className:cn("text-base font-bold leading-none",h),children:formatAmountUSDCompact(x)})}),jsxs("div",{className:"flex flex-col items-end gap-1",children:[jsxs("div",{className:"flex items-baseline gap-1",children:[jsx("span",{className:"text-xs text-neutral",children:"V"}),jsx("span",{className:"text-xs text-foreground/80",children:formatAmountUSDCompact(p)})]}),jsxs("span",{className:"text-[10px] leading-none",children:[jsx("span",{className:"text-bullish",children:formatAmountUSDCompact(u)}),jsx("span",{className:"text-neutral/50 mx-0.5",children:"/"}),jsx("span",{className:"text-bearish",children:formatAmountUSDCompact(g)})]})]}),jsxs("div",{className:"flex items-baseline gap-1",children:[jsx("span",{className:"text-xs text-neutral",children:"TX"}),jsx("span",{className:"text-xs text-foreground/80",children:formatAmount(k)})]})]})]}),jsxs("div",{className:"mt-2.5 flex items-start gap-4 relative",children:[jsx(HorizontalScrollContainer,{className:"flex-auto min-w-0",forceShowArrows:true,children:jsxs("div",{className:"flex items-center gap-1",children:[jsx($,{icon:jsx(UserWithStarBadgeIcon,{width:12,height:12}),value:formatPercent(a?.top10HoldingsRatio),tooltip:s("tokens.tokenInfo.top10HoldingsRatio"),warning:b,disable:!a?.top10HoldingsRatio||a?.top10HoldingsRatio==="0"}),jsx($,{icon:jsx(CookIcon,{width:12,height:12}),value:formatPercent(a?.devHoldingsRatio),tooltip:s("tokens.tokenInfo.devHoldingsRatio"),warning:T,disable:!a?.devHoldingsRatio||a?.devHoldingsRatio==="0"}),jsx($,{icon:jsx(SniperIcon,{width:12,height:12}),value:formatPercent(a?.sniperHoldingsRatio),tooltip:s("tokens.tokenInfo.sniperHoldingsRatio"),warning:I,disable:!a?.sniperHoldingsRatio||a?.sniperHoldingsRatio==="0"}),jsx($,{icon:jsx(RatIcon,{width:12,height:12}),value:formatPercent(a?.insiderHoldingsRatio),tooltip:s("tokens.tokenInfo.insiderHoldingsRatio"),warning:U,disable:!a?.insiderHoldingsRatio||a?.insiderHoldingsRatio==="0"}),jsx($,{icon:jsx(BundlesIcon,{width:12,height:12}),value:formatPercent(a?.bundleHoldingsRatio),tooltip:s("tokens.tokenInfo.bundleHoldingsRatio"),warning:q,disable:!a?.bundleHoldingsRatio||a?.bundleHoldingsRatio==="0"})]})}),t&&jsx("div",{className:"flex-none relative",onClick:F=>F.stopPropagation(),children:t(e)})]})]})}var Hl=152,Or=10;function Il({index:e,style:t,data:o,skeletonCount:r,renderItemAction:n,onSelectToken:s}){return o?jsx("div",{style:t,children:jsx(Fr,{token:o[e],isLast:e===o.length-1,renderAction:n,onSelectToken:s})}):jsx("div",{style:t,children:jsx(br,{isLast:e===r-1})})}function qe({title:e,tokens:t,isLoading:o,itemHeight:r=Hl,renderHeaderExtra:n,renderItemAction:s,onSelectToken:i,onPauseChange:l,className:a,hideHeader:d}){let m=o||!t?void 0:t,c=m?m.length:Or,p=useMemo(()=>({data:m,skeletonCount:Or,renderItemAction:s,onSelectToken:i}),[m,s,i]),[u,g]=useState(false),k=useCallback(()=>{g(true),l?.(true);},[l]),x=useCallback(()=>{g(false),l?.(false);},[l]);return jsxs("div",{className:cn("w-full h-full bg-[#0a0a0b] overflow-hidden flex flex-col border border-[rgba(39,39,42,0.6)] rounded-lg",a),onMouseEnter:k,onMouseLeave:x,children:[!d&&jsx(hr,{title:e,isPaused:u,extra:n}),jsx("div",{className:"flex-1 w-full overflow-hidden",children:jsx(List,{className:"h-full w-full",rowCount:c,rowHeight:r,rowComponent:Il,rowProps:p,overscanCount:5})})]})}function Co(e,t){let o={...e};for(let r of Object.keys(t))t[r]!==void 0&&(o[r]=t[r]);return o}var Fl=["1m","5m","15m","30m","1h","4h","24h"];function Ul(e,t){if(!t)return e;if(!e)return t;let o={...e};for(let r of Fl)t[r]&&(o[r]=e[r]?Co(e[r],t[r]):t[r]);return o}function Ol(e,t){return t?e?Co(e,t):t:e}function Bt(e,t){return t?e?Co(e,t):t:e}function G(e,t){let{chain:o,address:r,stats:n,marketData:s,socialMedias:i,security:l,launchedFrom:a,migratedTo:d,...m}=t,c={...e};for(let p of Object.keys(m))m[p]!==void 0&&(c[p]=m[p]);return c.stats=Ul(e.stats,n),c.marketData=Ol(e.marketData,s),c.socialMedias=Bt(e.socialMedias,i),c.security=Bt(e.security,l),c.launchedFrom=Bt(e.launchedFrom,a),c.migratedTo=Bt(e.migratedTo,d),c}function Qe(e,t){let o=new Map(e.map(r=>[r.address,r]));return t.map(r=>{let n=o.get(r.address);return n?G(n,r):r})}function Dl(e){return e.chain!==void 0&&e.address!==void 0&&e.address!==""&&e.name!==void 0&&e.symbol!==void 0&&e.decimals!==void 0}function Ne(e,t){if(t.length===0)return e;let o=[...e],r=false;for(let n of t){let s=o.findIndex(i=>i.address===n.address);if(s>=0){o[s]=G(o[s],n),r=true;continue}Dl(n)&&(o.push(n),r=true);}return r?o:e}function Er({chain:e,tokens:t,onUpdate:o,enabled:r=true}){let{subscribeClient:n}=useDexClient(),s=useRef(new Map),i=useRef(o);i.current=o;let l=useMemo(()=>Array.from(new Set(t.map(m=>m.address.trim()).filter(Boolean))).sort().join(","),[t]),a=useMemo(()=>l?l.split(","):[],[l]),d=()=>{s.current.forEach(m=>m.unsubscribe()),s.current.clear();};useEffect(()=>d,[e,n,r]),useEffect(()=>{if(!r){d();return}let m=new Set(a),c=s.current;for(let[p,u]of c)m.has(p)||(u.unsubscribe(),c.delete(p));for(let p of a)c.has(p)||c.set(p,n.subscribeToken(e,p,u=>{i.current(u);}));},[a,e,r,n]);}var Vl=80;function Qr(e){return {chain:e.chain,address:e.address,name:e.name??"",symbol:e.symbol??"",decimals:e.decimals??0,image:e.image,description:e.description,socialMedias:e.socialMedias,launchedFrom:e.launchedFrom,migratedTo:e.migratedTo,createdAt:e.createdAt}}function _l(e,t,o){return e===t?o:e===o?t:o||t}function wo(e){let t=e.token?.address??e.tokenAAddress??"",o=e.token;return {...o,chain:e.chain,address:t,name:o?.name??"",symbol:o?.symbol??"",decimals:o?.decimals??0,createdAt:o?.createdAt??e.createdAt,liquidities:[{poolAddress:e.poolAddress,pairAddress:_l(t,e.tokenAAddress,e.tokenBAddress),image:e.dex?.image,programAddress:e.dex?.programAddress,protocolFamily:e.dex?.protocolFamily,protocolName:e.dex?.protocolName}]}}function $l(e){return {...Qr(wo(e)),...e.token??{},liquidities:wo(e).liquidities,createdAt:e.token?.createdAt??e.createdAt}}function qr(e){return e.sort((t,o)=>{let r=t.createdAt?.getTime()??0;return (o.createdAt?.getTime()??0)-r}),e.slice(0,Vl)}function Gr({chain:e,isPaused:t=false}){let o=useMemo(()=>({chain:e}),[e]),r=useRef(t);r.current=t;let n=useRef(e),[s,i]=useState(true),[l,a]=useState([]);useEffect(()=>{e!==n.current&&(i(true),a([]),n.current=e);},[e]);let{data:d,isPending:m}=useNewPoolsQuery(o);useEffect(()=>{d&&(a(g=>{let k=r.current,x=g.length===0&&d.length>0,f=[...g];for(let h of d){let b=$l(h),T=f.findIndex(U=>U.address===b.address);T>=0?f[T]=G(f[T],b):(!k||x)&&f.push(b);}return k?f:qr(f)}),i(false));},[d]);let c=useCallback(g=>{a(k=>{let x=r.current,f=[...k],h=false;for(let b of g){let T=f.findIndex(U=>U.address===b.address);T>=0?(h=true,f[T]=G(f[T],b)):x||(h=true,f.push(Qr(b)));}return h?x?f:qr(f):k});},[]),p=useCallback(g=>{c(g.map(wo));},[c]);useNewPoolsSubscription({chain:e},p),Er({chain:e,tokens:l,onUpdate:c});let u=useMemo(()=>m||s,[m,s]);return {tokens:l,isLoading:u}}function Nk({chain:e,title:t,renderHeaderExtra:o,renderItemAction:r,onSelectToken:n,className:s,hideHeader:i}){let[l,a]=useState(false),{tokens:d,isLoading:m}=Gr({chain:e,isPaused:l}),c=useCallback(p=>{a(p);},[]);return jsx(qe,{title:t,tokens:d,isLoading:m,renderHeaderExtra:o,renderItemAction:r,onSelectToken:n,onPauseChange:c,className:s,hideHeader:i})}function Se({chain:e,tokens:t,onUpdate:o,enabled:r=true}){let n=useMemo(()=>Array.from(new Set(t.map(i=>i.address.trim()).filter(Boolean))).sort().join(","),[t]),s=useMemo(()=>n?n.split(","):[],[n]);useTokensSubscription({chain:e,addresses:s},o,{enabled:r&&s.length>0});}function es({chain:e,isPaused:t=false,refetchInterval:o=3e4}){let r=useMemo(()=>({chain:e}),[e]),n=useRef(t);n.current=t;let s=useRef(e),[i,l]=useState(true),[a,d]=useState([]);useEffect(()=>{e!==s.current&&(l(true),d([]),s.current=e);},[e]);let{data:m,isPending:c}=useMigratedTokensQuery(r,{refetchInterval:o});useEffect(()=>{m&&(d(g=>{let k=n.current,x=[...g];for(let f of m){let h=x.findIndex(b=>b.address===f.address);h>=0?x[h]=G(x[h],f):k||x.unshift(f);}return x}),l(false));},[m]);let p=useCallback(g=>{d(k=>Ne(k,g));},[]);Se({chain:e,tokens:a,onUpdate:p});let u=useMemo(()=>c||i,[c,i]);return {tokens:a,isLoading:u}}function Bk({chain:e,title:t,renderHeaderExtra:o,renderItemAction:r,onSelectToken:n,className:s,hideHeader:i}){let[l,a]=useState(false),{tokens:d,isLoading:m}=es({chain:e,isPaused:l}),c=useCallback(p=>{a(p);},[]);return jsx(qe,{title:t,tokens:d,isLoading:m,renderHeaderExtra:o,renderItemAction:r,onSelectToken:n,onPauseChange:c,className:s,hideHeader:i})}function td(e){return e.sort((t,o)=>{let r=Number(t.migrateProgress??0);return Number(o.migrateProgress??0)-r})}function ns({chain:e,isPaused:t=false,refetchInterval:o=15e3}){let r=useMemo(()=>({chain:e}),[e]),n=useRef(t);n.current=t;let s=useRef(e),[i,l]=useState(true),[a,d]=useState([]);useEffect(()=>{e!==s.current&&(l(true),d([]),s.current=e);},[e]);let{data:m,isPending:c}=useFinalStretchTokensQuery(r,{refetchInterval:o});useEffect(()=>{m&&(d(g=>{let k=n.current,x=g.length===0&&m.length>0,f=[...g];for(let h of m){let b=f.findIndex(T=>T.address===h.address);b>=0?f[b]=G(f[b],h):(!k||x)&&f.push(h);}return k?f:td(f)}),l(false));},[m]);let p=useCallback(g=>{d(k=>Ne(k,g));},[]);Se({chain:e,tokens:a,onUpdate:p});let u=useMemo(()=>c||i,[c,i]);return {tokens:a,isLoading:u}}function Jk({chain:e,title:t,renderHeaderExtra:o,renderItemAction:r,onSelectToken:n,className:s,hideHeader:i}){let[l,a]=useState(false),{tokens:d,isLoading:m}=ns({chain:e,isPaused:l}),c=useCallback(p=>{a(p);},[]);return jsx(qe,{title:t,tokens:d,isLoading:m,renderHeaderExtra:o,renderItemAction:r,onSelectToken:n,onPauseChange:c,className:s,hideHeader:i})}var ad=10,ld=atomWithStorage("liberfi:search_histories",[],void 0,{getOnInit:true});function Wt(){let[e,t]=useAtom(ld),o=useCallback(n=>{let s=n.trim();s&&t(i=>{let l=i.filter(a=>a!==s);return [s,...l].slice(0,ad)});},[t]),r=useCallback(()=>{t([]);},[t]);return {histories:e,addHistory:o,clearHistories:r}}function ds({histories:e,onSelect:t,onClear:o,className:r}){let{t:n}=useTranslation();return e.length===0?null:jsxs("div",{className:cn("px-4 pb-4",r),children:[jsxs("div",{className:"flex items-center justify-between",children:[jsx("span",{className:"text-sm font-medium",children:n("tokens.search.history")}),jsx(Button,{isIconOnly:true,size:"sm",className:"bg-transparent min-w-6 w-6 h-6 text-neutral",onPress:o,children:jsx(TrashIcon,{width:20,height:20})})]}),jsx("div",{className:"flex flex-wrap gap-2 mt-2",children:e.map(s=>jsx(Chip,{size:"sm",variant:"bordered",className:cn("text-neutral","border-border border-1","cursor-pointer","hover:opacity-hover"),onClick:()=>t?.(s),children:s},s))})]})}function cs({onSelect:e,className:t}){let{histories:o,clearHistories:r}=Wt();return jsx(ds,{className:cn(t),histories:o,onSelect:e,onClear:r})}function ms({value:e,onValueChange:t,onClear:o,onEscape:r,className:n}){let{t:s}=useTranslation();return jsx("div",{className:n,children:jsx(StyledInput,{autoFocus:true,variant:"bordered",radius:"full",value:e,onValueChange:t,placeholder:s("tokens.search.placeholder"),classNames:{inputWrapper:["!bg-[rgba(39,39,42,0.6)]","!border-[rgba(63,63,70,0.5)]","data-[hover=true]:!bg-[rgba(39,39,42,1)]","group-data-[focus=true]:!bg-[rgba(39,39,42,1)]","group-data-[focus=true]:!border-[rgba(63,63,70,0.8)]"].join(" ")},startContent:jsx(SearchIcon,{width:20,height:20,className:"text-neutral"}),endContent:e?jsx(Button,{isIconOnly:true,className:"bg-transparent min-w-6 w-6 h-6 text-neutral",onPress:o,children:jsx(XCloseIcon,{width:20,height:20})}):jsx(Kbd,{className:"min-w-8 justify-center text-xs text-neutral bg-transparent border border-[rgba(63,63,70,0.5)] rounded-full cursor-pointer select-none",onMouseDown:i=>{i.preventDefault(),r?.();},children:"Esc"})})})}function Et({token:e,className:t}){let{t:o}=useTranslation(),r=useTickAge(e.createdAt),n=useMemo(()=>e.marketData?.priceInUsd,[e]),s=useMemo(()=>e.marketData?.marketCapInUsd,[e]),i=useMemo(()=>e.marketData?.tvlInUsd,[e]),l=useMemo(()=>e.stats?.["24h"]?.priceChange,[e]),a=useMemo(()=>l?new SafeBigNumber(l).abs().toString():void 0,[l]),d=useMemo(()=>l!=null&&new SafeBigNumber(l).gte(0),[l]);return jsxs("div",{className:cn("w-full h-full px-3 flex items-center justify-between gap-2","hover:cursor-pointer hover:bg-content2 rounded-lg",t),children:[jsxs("div",{className:"flex-1 min-w-0 flex items-center gap-2.5",children:[jsx(de,{token:e,className:"w-10 h-10 flex-none",showProtocolFamily:true,classNames:{searchIcon:"w-5 h-5"}}),jsxs("div",{className:"flex-1 min-w-0 flex flex-col gap-0.5",children:[jsxs("div",{className:"flex items-center gap-1",children:[jsx("span",{className:"font-medium text-sm truncate",children:e.symbol}),jsx("span",{className:"text-xs text-primary font-medium",children:formatAge(r)})]}),jsxs("div",{className:"flex items-center gap-1 text-xs text-neutral",children:[jsxs("span",{children:[o("tokens.listHeader.mcShort")," ",formatAmountUSD(s)]}),jsx("span",{children:"/"}),jsxs("span",{children:[o("tokens.listHeader.liqShort")," ",formatAmountUSD(i)]})]})]})]}),jsxs("div",{className:"flex-none w-20 flex flex-col items-end",children:[jsx("span",{className:"text-xs",children:formatPriceUSD(n)}),jsxs("span",{className:cn("inline-flex gap-0.5 items-center text-xs",d?"text-bullish":"text-bearish"),children:[d?jsx(TriangleUpIcon,{width:8,height:8}):jsx(TriangleDownIcon,{width:8,height:8}),jsx("span",{children:formatPercent(a)})]})]})]})}function Vt({className:e}){let{t}=useTranslation();return jsxs("div",{className:cn("h-9 px-3 flex items-center justify-between","text-xs font-medium text-neutral","sticky top-0 z-10",e),children:[jsx("div",{className:"flex-1",children:jsxs("span",{children:[t("tokens.listHeader.token")," / ",t("tokens.listHeader.age")," /"," ",t("tokens.listHeader.marketCap")," /"," ",t("tokens.listHeader.liquidity")]})}),jsx("div",{className:"flex-none w-20 text-right",children:jsxs("span",{children:[t("tokens.listHeader.price")," / ",t("tokens.listHeader.24hChange")]})})]})}function Hd(){return jsxs("div",{className:"w-full h-14 px-3 flex items-center justify-between gap-2",children:[jsxs("div",{className:"flex-1 min-w-0 flex items-center gap-2",children:[jsx(Skeleton,{className:"flex-none w-8 h-8 rounded-full"}),jsxs("div",{className:"flex flex-col gap-1.5",children:[jsx(Skeleton,{className:"w-24 h-4 rounded-md"}),jsx(Skeleton,{className:"w-36 h-3 rounded-md"})]})]}),jsxs("div",{className:"flex-none w-20 flex flex-col items-end gap-1.5",children:[jsx(Skeleton,{className:"w-14 h-4 rounded-md"}),jsx(Skeleton,{className:"w-10 h-3 rounded-md"})]})]})}function $t({rows:e=6,className:t}){return jsx("div",{className:cn("w-full",t),children:Array.from({length:e}).map((o,r)=>jsx(Hd,{},r))})}function ks({keyword:e,chains:t,limit:o=50}){let r=useMemo(()=>({keyword:e,chains:t,limit:o}),[e,t,o]),{data:n,isLoading:s,isFetchingNextPage:i,hasNextPage:l,fetchNextPage:a}=useSearchTokensInfiniteQuery(r,{enabled:!!e});return {tokens:useMemo(()=>n?.pages.flatMap(m=>m.data)??[],[n]),isLoading:s,isFetchingNextPage:i,hasNextPage:l??false,fetchNextPage:a}}var Vd=56;function bs({onSelectToken:e,className:t,...o}){let{tokens:r,isLoading:n,isFetchingNextPage:s,hasNextPage:i,fetchNextPage:l}=ks(o),a=useRef(null),{height:d}=useResizeObserver({ref:a}),m=useCallback(g=>g<r.length,[r]),c=useCallback(async()=>{i&&!s&&await l();},[i,s,l]),p=useMemo(()=>i?r.length+1:r.length,[r,i]),u=useInfiniteLoader({isRowLoaded:m,loadMoreRows:c,rowCount:p,threshold:5});return n?jsxs("div",{className:cn("w-full",t),children:[jsx(Vt,{}),jsx($t,{})]}):r.length===0?jsxs("div",{className:cn("w-full",t),children:[jsx(Vt,{}),jsx($d,{})]}):jsxs("div",{className:cn("w-full h-full flex flex-col",t),children:[jsx(Vt,{className:"flex-none"}),jsx("div",{className:"flex-auto min-h-0",ref:a,children:jsx(List,{style:{height:d},onRowsRendered:u,rowComponent:_d,rowCount:p,rowHeight:Vd,rowProps:{tokens:r,onSelectToken:e},overscanCount:5})})]})}function _d({index:e,style:t,tokens:o,onSelectToken:r}){let n=o[e];return n?jsx("div",{style:t,onClick:()=>r?.(n),children:jsx(Et,{token:n})}):jsx("div",{style:t,className:"flex items-center justify-center",children:jsx(Spinner,{size:"sm"})})}function $d(){let{t:e}=useTranslation();return jsxs("div",{className:"flex flex-col items-center justify-center py-16",children:[jsx(EmptyIcon,{width:28,height:28,className:"text-neutral"}),jsx("p",{className:"mt-2 text-sm text-neutral",children:e("tokens.search.noResults")})]})}function Je({applyUpdates:e,paused:t=false,flushInterval:o=500}){let r=useRef(e),n=useRef(t),s=useRef([]),i=useRef(),l=useRef();r.current=e,n.current=t;let a=useCallback(()=>{i.current!==void 0&&(clearTimeout(i.current),i.current=void 0),l.current!==void 0&&(cancelAnimationFrame(l.current),l.current=void 0);},[]),d=useCallback(()=>{if(a(),n.current){i.current=setTimeout(d,o);return}let p=s.current;p.length!==0&&(s.current=[],r.current(p));},[a,o]),m=useCallback(()=>{i.current!==void 0||l.current!==void 0||(i.current=setTimeout(()=>{i.current=void 0,l.current=requestAnimationFrame(()=>{l.current=void 0,d();});},o));},[d,o]),c=useCallback(p=>{p.length!==0&&(s.current.push(...p),m());},[m]);return useEffect(()=>{t||d();},[d,t]),useEffect(()=>a,[a]),{enqueueUpdates:c,flush:d}}function qt({chain:e,resolution:t,options:o,refetchInterval:r=12e3,deferUpdates:n=false,updateFlushInterval:s}){let i=useMemo(()=>({chain:e,resolution:t,...o}),[e,t,o]),l=useRef(i),[a,d]=useState(true);useEffect(()=>{JSON.stringify(i)!==JSON.stringify(l.current)&&(d(true),l.current=i);},[i]);let[m,c]=useState([]),{data:p,isPending:u}=useTrendingTokensQuery(i,{refetchInterval:r});useEffect(()=>{p&&(c(f=>Qe(f,p)),d(false));},[p]);let g=useCallback(f=>{c(h=>Ne(h,f));},[]),{enqueueUpdates:k}=Je({applyUpdates:g,paused:n,flushInterval:s});useTrendingTokensSubscription({chain:e},k),Se({chain:e,tokens:m,onUpdate:k});let x=useMemo(()=>!!(u||a),[u,a]);return {tokens:m,isLoading:x}}var Jd=Chain.ETHEREUM,Yd="24h",Zd=56;function Ss({chains:e,onSelectToken:t,className:o}){let r=e?.length===1?e[0]:e?.[0]??Jd,{tokens:n,isLoading:s}=qt({chain:r,resolution:Yd});return jsx("div",{className:cn("w-full flex flex-col overflow-hidden",o),children:s?jsx($t,{}):jsx("div",{className:"overflow-y-auto",children:n.map(i=>jsx("div",{style:{height:Zd},onClick:()=>t?.(i),children:jsx(Et,{token:i,className:"h-full"})},i.address))})})}function Ls({onKeywordChange:e}){let[t,o]=useState(""),[r,n]=useState(""),{addHistory:s}=Wt(),i=useCallbackRef(e),l=useCallbackRef(s),a=useMemo(()=>debounce(p=>{n(p),i(p),p&&l(p);},500),[i,l]),d=useCallback(p=>{o(p),a(p);},[a]),m=useCallback(p=>{a.cancel(),o(p),n(p),i(p),p&&l(p);},[a,i,l]),c=useCallback(()=>m(""),[m]);return {text:t,keyword:r,setText:d,setKeyword:m,clearKeyword:c}}function Rs({chains:e,onKeywordChange:t,onSelectToken:o,onEscape:r}){let{text:n,keyword:s,setText:i,setKeyword:l,clearKeyword:a}=Ls({onKeywordChange:t});return jsxs("div",{className:"w-full h-full flex flex-col gap-3",children:[jsx(ms,{value:n,onValueChange:i,onClear:a,onPaste:l,onEscape:r}),s?jsx(bs,{className:"flex-auto min-h-0",keyword:s,chains:e,onSelectToken:o}):jsxs("div",{className:"flex-auto min-h-0 flex flex-col overflow-hidden",children:[jsx(cs,{onSelect:l}),jsx(Ss,{className:"flex-auto min-h-0",chains:e,onSelectToken:o})]})]})}var Ao="search";function Bb({id:e=Ao}){return jsx(AsyncModal,{id:e,children:t=>jsx(mc,{...t})})}function mc({params:e,isOpen:t,onOpenChange:o,onResult:r}){let{t:n}=useTranslation(),{isMobile:s}=useScreen(),i=useCallback(l=>{r(l);},[r]);return jsx(StyledModal,{isOpen:t,onOpenChange:o,size:s?"full":"lg",hideCloseButton:true,backdrop:"blur",radius:"lg",children:jsxs(ModalContent,{className:"w-full h-full",style:{borderRadius:s?void 0:14,border:s?void 0:"1px solid rgba(39,39,42,1)",background:"rgba(24,24,27,1)",boxShadow:s?void 0:"0 25px 50px -12px rgba(0,0,0,0.5)",overflow:"hidden"},children:[jsxs(ModalHeader,{className:"sm:hidden flex items-center justify-between pt-4 pb-2",children:[jsx("span",{className:"text-base font-semibold",children:n("tokens.search.title")}),jsx(Button,{isIconOnly:true,onPress:()=>o(false),size:"sm",className:"bg-transparent min-w-6 w-6 h-6",children:jsx(XCloseIcon,{width:20,height:20})})]}),jsx(ModalBody,{className:"p-4",children:jsx(Rs,{chains:e?.chains,onSelectToken:i,onEscape:()=>o(false)})})]})})}function Qb({chains:e,onSelectToken:t,className:o}){let{t:r}=useTranslation(),{isDesktop:n}=useScreen(),{onOpen:s,onClose:i}=useAsyncModal(Ao),l=useCallbackRef(t),a=useCallbackRef(async()=>{let m=await s({params:{chains:e}});m&&l(m);}),d=useCallbackRef(()=>{i();});return useEffect(()=>{let m=c=>{let p=document.activeElement,u=!!p&&(p.tagName==="INPUT"||p.tagName==="TEXTAREA"||p.getAttribute("contenteditable")==="true");c.key==="/"&&!u&&(c.preventDefault(),a()),c.key==="Escape"&&(c.preventDefault(),d());};return window.addEventListener("keydown",m),()=>{window.removeEventListener("keydown",m);}},[a,d]),n?jsx(Button,{size:"sm",radius:"full",onPress:a,variant:"bordered",startContent:jsx(SearchIcon,{width:16,height:16,className:"text-foreground"}),endContent:jsx(Kbd,{className:"min-w-6 justify-center text-xs text-foreground bg-content3 rounded-lg",children:"/"}),className:cn("w-56 min-w-0 h-8 min-h-0 border-transparent hover:border-border bg-content2 pl-3 pr-1.5 text-neutral",o),children:r("tokens.search.placeholder")}):jsx(Button,{size:"sm",radius:"full",isIconOnly:true,onPress:a,variant:"bordered",className:cn("w-8 min-w-0 h-8 min-h-0 border-1 border-border bg-content2",o),children:jsx(SearchIcon,{width:16,height:16,className:"text-foreground"})})}function Fe(e){return e==null||e===""?"--":formatPercent(Number(e)/100)}function ce(e,t=4,o=4){return e?e.length<=t+o+1?e:`${e.slice(0,t)}\u2026${e.slice(-o)}`:"--"}function ye(e,t=Date.now()){if(e==null)return "--";let o=typeof e=="string"||typeof e=="number"?new Date(e):e,r=typeof t=="number"?new Date(t):t,n=Math.max(0,Math.floor((r.getTime()-o.getTime())/1e3));if(n<60)return `${n}s`;let s=Math.floor(n/60);if(s<60)return `${s}m`;let i=Math.floor(s/60);if(i<24)return `${i}h`;let l=Math.floor(i/24);if(l<30)return `${l}d`;let a=Math.floor(l/30);return a<12?`${a}mo`:`${Math.floor(l/365)}y`}function A(e,t){let{data:o,isLoading:r}=useTokenQuery({chain:e,address:t}),[n,s]=useState(o);return useEffect(()=>{o&&s(o);},[o]),useTokenSubscription({chain:e,address:t},i=>{i?.length&&s(l=>{if(!l)return l;let a=l;for(let d of i)a=G(a,d);return a});}),{token:n,isLoading:r}}function Ye({label:e,totalFormatted:t,buysFormatted:o,sellsFormatted:r,totalValue:n=0,buysValue:s=0,className:i}){let l=new SafeBigNumber(n??0),a=new SafeBigNumber(s??0),d=l.eq(0)?0:a.div(l).times(100).toNumber();return jsxs("div",{className:cn("flex flex-col gap-1",i),children:[jsxs("div",{className:"flex items-baseline justify-between",children:[jsx("span",{className:"text-xs text-default-500",children:e}),jsx("span",{className:"text-xs text-foreground",children:t})]}),jsx(Progress,{size:"sm",value:d,classNames:{track:"bg-bearish/40",indicator:"bg-bullish"},"aria-label":`${e} buy share`}),jsxs("div",{className:"flex justify-between gap-4 text-[10px]",children:[jsxs("span",{className:"text-bullish",children:["Buys: ",o]}),jsxs("span",{className:"text-bearish",children:["Sells: ",r]})]})]})}function Us({token:e,actions:t,dataStrip:o,className:r,onCopyAddress:n}){let s=e?.address;return jsxs("div",{className:cn("flex w-full flex-wrap items-center gap-4 px-4 py-3",r),children:[jsxs("div",{className:"flex min-w-0 items-center gap-3",children:[e&&jsx(de,{token:e,radius:"lg",className:"h-10 w-10"}),jsxs("div",{className:"flex min-w-0 flex-col gap-0.5",children:[jsxs("div",{className:"flex items-center gap-2",children:[jsx("span",{className:"truncate text-base font-semibold text-foreground",children:e?.symbol??"--"}),jsx("span",{className:"truncate text-xs text-default-400",children:e?.name})]}),s&&jsxs("button",{type:"button",onClick:()=>n?.(s),className:"flex items-center gap-1 text-[11px] text-default-400 transition-colors hover:text-foreground",title:s,children:[ce(s,6,6),jsx(CopyIcon,{width:12,height:12})]})]})]}),o&&jsx("div",{className:"flex-1 min-w-0",children:o}),t&&jsx("div",{className:"ml-auto flex items-center gap-2",children:t})]})}function Os(e,t){return A(e,t)}function Bs({price:e,marketCap:t,volume:o,holdersCount:r,socialMedia:n,className:s}){return jsxs("div",{className:cn("flex flex-wrap items-center gap-x-6 gap-y-3",s),children:[e,jsxs("div",{className:"flex flex-wrap items-center gap-x-6 gap-y-3",children:[t,o,r]}),jsx("div",{className:"ml-auto",children:n})]})}function DT(e,t){return A(e,t)}function Es({holders:e,top10HoldingsRatio:t,top100HoldingsRatio:o,className:r}){return jsxs("div",{className:cn("flex flex-col items-start justify-center gap-0.5",r),children:[jsxs("div",{className:"text-xs font-medium text-default-500",children:[jsx("span",{className:"text-foreground",children:e!=null?formatAmount(e):"--"}),jsx("span",{className:"px-1",children:"/"}),jsx("span",{children:Fe(t)}),jsx("span",{className:"px-1",children:"/"}),jsx("span",{children:Fe(o)})]}),jsx("div",{className:"text-[10px] text-default-400",children:"Holders / Top10 / Top100"})]})}function Vs(e,t){return A(e,t)}function _s({chain:e,address:t,className:o}){let{token:r}=Vs(e,t);return jsx(Es,{holders:r?.marketData?.holders,top10HoldingsRatio:r?.marketData?.top10HoldingsRatio,top100HoldingsRatio:r?.marketData?.top100HoldingsRatio,className:o})}function zs({marketCapInUsd:e,tvlInUsd:t,createdAt:o,className:r}){return jsxs("div",{className:cn("flex flex-col items-start justify-center gap-0.5",r),children:[jsxs("div",{className:"text-xs font-medium text-default-500",children:[jsx("span",{className:"text-foreground",children:e?formatAmountUSDCompact(e):"--"}),jsx("span",{className:"px-1",children:"/"}),jsx("span",{children:t?formatAmountUSDCompact(t):"--"}),jsx("span",{className:"px-1",children:"/"}),jsx("span",{children:ye(o)})]}),jsx("div",{className:"text-[10px] text-default-400",children:"MC / Liq / Age"})]})}function qs(e,t){return A(e,t)}function Qs({chain:e,address:t,className:o}){let{token:r}=qs(e,t);return jsx(zs,{marketCapInUsd:r?.marketData?.marketCapInUsd,tvlInUsd:r?.marketData?.tvlInUsd,createdAt:r?.createdAt,className:o})}function Js({priceInUsd:e,price24hAgoInUsd:t,className:o}){let{bearish:r,priceChange:n}=useMemo(()=>{if(!e||!t)return {bearish:false,priceChange:void 0};let s=new SafeBigNumber(e),i=new SafeBigNumber(t);return i.lte(0)?{bearish:false,priceChange:void 0}:{bearish:s.lt(i),priceChange:s.minus(i).div(i).abs().toNumber()}},[e,t]);return jsxs("div",{className:cn("group flex flex-col gap-1",o),"data-bearish":r,children:[jsx("div",{className:"text-base font-medium leading-none text-bullish group-data-[bearish=true]:text-bearish",children:e?formatPriceUSD(e):"--"}),jsxs("div",{className:"flex items-center gap-2 text-[10px] leading-none",children:[jsx("span",{className:"text-default-400",children:"24h"}),jsx("span",{className:"text-bullish group-data-[bearish=true]:text-bearish",children:n!=null?formatPercent(n):"--"})]})]})}function Ys(e,t){return A(e,t)}function Zs({chain:e,address:t,className:o}){let{token:r}=Ys(e,t);return jsx(Js,{priceInUsd:r?.marketData?.priceInUsd,price24hAgoInUsd:r?.stats?.["24h"]?.openPriceInUsd,className:o})}function $c(e,t){switch(e){case "website":return jsx(WebsiteIcon,{width:t,height:t});case "twitter":return jsx(TwitterIcon,{width:t,height:t});case "telegram":return jsx(TelegramIcon,{width:t,height:t});case "discord":return jsx(DiscordIcon,{width:t,height:t});default:return jsx("span",{className:"text-[9px] font-medium uppercase",children:e.slice(0,2)})}}function js({socials:e,className:t,iconSize:o=16}){if(!e)return null;let n=["website","twitter","telegram","discord","github","reddit","youtube","medium"].filter(s=>!!e[s]);return n.length===0?null:jsx("div",{className:cn("flex items-center gap-3",t),children:n.map(s=>jsx("a",{href:e[s],target:"_blank",rel:"noreferrer noopener",className:"flex items-center justify-center text-default-400 transition-colors hover:text-foreground",style:{width:o,height:o},children:$c(s,o)},s))})}function en(e,t){return A(e,t)}function tn({chain:e,address:t,className:o,iconSize:r}){let{token:n}=en(e,t);return jsx(js,{socials:n?.socialMedias,className:o,iconSize:r})}function sn({volumesInUsd:e,trades:t,traders:o,className:r}){return jsxs("div",{className:cn("flex flex-col items-start justify-center gap-0.5",r),children:[jsxs("div",{className:"text-xs font-medium text-default-500",children:[jsx("span",{className:"text-foreground",children:e?formatAmountUSDCompact(e):"--"}),jsx("span",{className:"px-1",children:"/"}),jsx("span",{children:t!=null?formatAmount(t):"--"}),jsx("span",{className:"px-1",children:"/"}),jsx("span",{children:o!=null?formatAmount(o):"--"})]}),jsx("div",{className:"text-[10px] text-default-400",children:"24h Vol / Txs / Traders"})]})}function nn(e,t){return A(e,t)}function an({chain:e,address:t,className:o}){let{token:r}=nn(e,t),n=r?.stats?.["24h"];return jsx(sn,{volumesInUsd:n?.volumesInUsd,trades:n?.trades,traders:n?.traders,className:o})}function ln({chain:e,address:t,className:o}){return jsx(Bs,{className:o,price:jsx(Zs,{chain:e,address:t}),marketCap:jsx(Qs,{chain:e,address:t}),volume:jsx(an,{chain:e,address:t}),holdersCount:jsx(_s,{chain:e,address:t}),socialMedia:jsx(tn,{chain:e,address:t})})}function hv({chain:e,address:t,actions:o,dataStrip:r,className:n,onCopyAddress:s}){let{token:i}=Os(e,t);return jsx(Us,{token:i,actions:o,dataStrip:r===void 0?jsx(ln,{chain:e,address:t}):r,className:n,onCopyAddress:s})}var Jc=[{value:"holdingUsd",label:"Value"},{value:"lastActiveAt",label:"Last active"}];function mn({holders:e,isLoading:t,sortBy:o,onSortByChange:r,onlyTracked:n=false,onOnlyTrackedChange:s,onLoadMore:i,hasMore:l,now:a=Date.now(),wellKnownAddresses:d,className:m,renderAddress:c}){let p=n?e.filter(u=>u.tags&&u.tags.length>0):e;return jsxs("div",{className:cn("flex flex-col",m),children:[jsxs("div",{className:"flex items-center justify-between gap-4 px-3 py-2",children:[jsxs("div",{className:"flex items-center gap-3",children:[jsx("span",{className:"text-xs font-medium text-default-500",children:"Holders"}),jsxs("label",{className:"flex cursor-pointer items-center gap-1 text-[11px] text-default-400",children:[jsx("input",{type:"checkbox",className:"size-3 accent-primary",checked:n,onChange:u=>s?.(u.target.checked)}),"Only Tracked"]})]}),jsx("div",{className:"flex items-center gap-1",children:Jc.map(u=>jsx("button",{type:"button",onClick:()=>r(u.value),className:cn("rounded px-2 py-1 text-[11px] transition-colors",o===u.value?"bg-default-100 text-foreground":"text-default-400 hover:text-foreground"),children:u.label},u.value))})]}),jsx("div",{className:"overflow-x-auto",children:jsxs("table",{className:"w-full min-w-[640px] table-fixed text-[12px]",children:[jsx("thead",{className:"text-default-400",children:jsxs("tr",{className:"border-b border-default-100",children:[jsx("th",{className:"w-[30%] px-3 py-2 text-left font-normal",children:"Wallet"}),jsx("th",{className:"w-[20%] px-3 py-2 text-left font-normal",children:"Tags"}),jsx("th",{className:"w-[15%] px-3 py-2 text-right font-normal",children:"Value"}),jsx("th",{className:"w-[10%] px-3 py-2 text-right font-normal",children:"%"}),jsx("th",{className:"w-[12%] px-3 py-2 text-right font-normal",children:"First held"}),jsx("th",{className:"w-[13%] px-3 py-2 text-right font-normal",children:"Last active"})]})}),jsxs("tbody",{children:[p.length===0&&!t&&jsx("tr",{children:jsx("td",{colSpan:6,className:"py-8 text-center text-default-400",children:"No holders"})}),p.map(u=>jsx(Yc,{holder:u,now:a,wellKnownAddresses:d,renderAddress:c},u.address)),t&&jsx("tr",{children:jsx("td",{colSpan:6,className:"py-4 text-center text-default-400",children:"Loading\u2026"})})]})]})}),l&&jsx("div",{className:"flex justify-center px-3 py-2",children:jsx("button",{type:"button",onClick:i,disabled:t,className:"rounded bg-default-100 px-3 py-1 text-[11px] text-default-600 transition-colors hover:bg-default-200 disabled:opacity-50",children:"Load more"})})]})}function Yc({holder:e,now:t,wellKnownAddresses:o,renderAddress:r}){let n=o?.[e.address],s=useMemo(()=>r?r(e.address):n?jsx("span",{className:"rounded bg-default-100 px-1.5 py-0.5 text-[10px] font-semibold uppercase tracking-wide text-default-600",children:n}):jsx("span",{className:"font-mono text-[11px] text-default-500",children:ce(e.address,6,6)}),[e.address,r,n]);return jsxs("tr",{className:"border-b border-default-50 hover:bg-default-50/60",children:[jsx("td",{className:"px-3 py-2 align-middle",children:s}),jsx("td",{className:"px-3 py-2 align-middle",children:jsx(Mt,{tags:e.tags,max:3})}),jsx("td",{className:"px-3 py-2 text-right align-middle text-foreground",children:formatAmountUSDCompact(e.amountInUsd)}),jsx("td",{className:"px-3 py-2 text-right align-middle text-default-500",children:Fe(e.ratio)}),jsx("td",{className:"px-3 py-2 text-right align-middle text-default-400",children:e.startHoldingAt?ye(e.startHoldingAt,t):"--"}),jsx("td",{className:"px-3 py-2 text-right align-middle text-default-400",children:e.lastActiveAt?ye(e.lastActiveAt,t):"--"})]})}function fn({chain:e,address:t,limit:o=50,initialSortBy:r="holdingUsd"}){let[n,s]=useState(r),[i,l]=useState(void 0),[a,d]=useState([]),m=useCallback(()=>{l(void 0),d([]);},[]),c=useCallback(T=>{T!==n&&(s(T),m());},[n,m]);useEffect(()=>{m();},[e,t,m]);let p=useMemo(()=>({chain:e,address:t,cursor:i,limit:o,sortBy:n}),[e,t,i,o,n]),{data:u,isPending:g,isFetching:k}=useTokenHoldersQuery(p);useEffect(()=>{u&&d(T=>i==null?[u]:T[T.length-1]?.endCursor===u.endCursor?T:[...T,u]);},[u,i]),useTokenSubscription({chain:e,address:t},()=>{});let x=useMemo(()=>a.flatMap(T=>T.data),[a]),f=a[a.length-1],h=!!(f?.hasNext&&f.endCursor),b=useCallback(()=>{!f?.endCursor||!f.hasNext||l(f.endCursor);},[f]);return {holders:x,isLoading:g||k,sortBy:n,setSortBy:c,hasMore:h,loadMore:b}}function Wv({chain:e,address:t,limit:o,initialSortBy:r,initialOnlyTracked:n=false,wellKnownAddresses:s,className:i,renderAddress:l}){let[a,d]=useState(n),{holders:m,isLoading:c,sortBy:p,setSortBy:u,hasMore:g,loadMore:k}=fn({chain:e,address:t,limit:o,initialSortBy:r});return jsx(mn,{holders:m,isLoading:c,sortBy:p,onSortByChange:u,onlyTracked:a,onOnlyTrackedChange:d,wellKnownAddresses:s,hasMore:g,onLoadMore:k,className:i,renderAddress:l})}var sm=[{value:"timestamp",label:"Latest"},{value:"totalUsd",label:"Top USD"}],nm=[{value:"all",label:"All"},{value:"buy",label:"Buys"},{value:"sell",label:"Sells"}],im=[{value:"all",label:"All"},{value:"dev",label:"DEV"},{value:"tracked",label:"TRACKED"},{value:"you",label:"YOU"}];function gn({activities:e,isLoading:t,sortBy:o,onSortByChange:r,typeFilter:n="all",onTypeFilterChange:s,traderFilter:i="all",onTraderFilterChange:l,youWalletAddress:a,currency:d="usd",onCurrencyChange:m,onLoadMore:c,hasMore:p,now:u=Date.now(),nativeDecimals:g=9,nativeSymbol:k="SOL",className:x,onRowClick:f}){let h=lm(e,i,a);return jsxs("div",{className:cn("flex flex-col",x),children:[jsxs("div",{className:"flex flex-wrap items-center justify-between gap-2 px-3 py-2",children:[jsxs("div",{className:"flex items-center gap-1",children:[nm.map(b=>jsx("button",{type:"button",onClick:()=>s?.(b.value),className:cn("rounded px-2 py-1 text-[11px] transition-colors",n===b.value?"bg-default-100 text-foreground":"text-default-400 hover:text-foreground"),children:b.label},b.value)),jsx("span",{className:"mx-1 h-3 w-px bg-default-200","aria-hidden":true}),im.map(b=>{let T=i===b.value,U=b.value==="you"&&!a;return jsx("button",{type:"button",disabled:U,onClick:()=>l?.(b.value),className:cn("rounded px-2 py-1 text-[11px] transition-colors",T?"bg-default-100 text-foreground":"text-default-400 hover:text-foreground",U&&"cursor-not-allowed opacity-50"),children:b.label},b.value)})]}),jsxs("div",{className:"flex items-center gap-2",children:[jsx(dm,{value:d,nativeSymbol:k,onChange:m}),jsx("div",{className:"flex items-center gap-1",children:sm.map(b=>jsx("button",{type:"button",onClick:()=>r(b.value),className:cn("rounded px-2 py-1 text-[11px] transition-colors",o===b.value?"bg-default-100 text-foreground":"text-default-400 hover:text-foreground"),children:b.label},b.value))})]})]}),jsx("div",{className:"overflow-x-auto",children:jsxs("table",{className:"w-full min-w-[780px] table-fixed text-[12px]",children:[jsx("thead",{className:"text-default-400",children:jsxs("tr",{className:"border-b border-default-100",children:[jsx("th",{className:"w-[10%] px-3 py-2 text-left font-normal",children:"Side"}),jsx("th",{className:"w-[25%] px-3 py-2 text-left font-normal",children:"Trader"}),jsx("th",{className:"w-[15%] px-3 py-2 text-right font-normal",children:"Amount"}),jsx("th",{className:"w-[15%] px-3 py-2 text-right font-normal",children:"USD"}),jsx("th",{className:"w-[15%] px-3 py-2 text-right font-normal",children:"Price"}),jsx("th",{className:"w-[10%] px-3 py-2 text-right font-normal",children:"Gas"}),jsx("th",{className:"w-[10%] px-3 py-2 text-right font-normal",children:"Age"})]})}),jsxs("tbody",{children:[h.length===0&&!t&&jsx("tr",{children:jsx("td",{colSpan:7,className:"py-8 text-center text-default-400",children:"No activities"})}),h.map(b=>jsx(mm,{activity:b,now:u,nativeDecimals:g,nativeSymbol:k,currency:d,onRowClick:f},b.txHash)),t&&jsx("tr",{children:jsx("td",{colSpan:7,className:"py-4 text-center text-default-400",children:"Loading\u2026"})})]})]})}),p&&jsx("div",{className:"flex justify-center px-3 py-2",children:jsx("button",{type:"button",onClick:c,disabled:t,className:"rounded bg-default-100 px-3 py-1 text-[11px] text-default-600 transition-colors hover:bg-default-200 disabled:opacity-50",children:"Load more"})})]})}function am(e){return e.type==="buy"?e.to:e.type==="sell"?e.from:e.to}function lm(e,t,o){if(t==="all")return e;if(t==="you"){if(!o)return [];let n=o.toLowerCase();return e.filter(s=>s.walletAddress?.toLowerCase()===n)}if(t==="dev")return e.filter(n=>n.traderTags?.some(s=>s==="dev"));let r=new Set(["kol","smart","bluechip"]);return e.filter(n=>n.traderTags?.some(s=>r.has(s)))}function dm({value:e,nativeSymbol:t,onChange:o}){return jsx("div",{className:"flex h-[22px] items-center rounded bg-default-100 p-[2px] text-[11px]",children:[{k:"usd",label:"USD"},{k:"native",label:t}].map(n=>jsx("button",{type:"button",onClick:()=>o?.(n.k),className:cn("rounded px-2 transition-colors",e===n.k?"bg-default-200 text-foreground":"text-default-400 hover:text-foreground"),children:n.label},n.k))})}function cm(e,t,o){if(!e)return "--";let r=Number(e)/Math.pow(10,t);return Number.isFinite(r)?`${formatAmount(r)} ${o}`:"--"}function mm({activity:e,now:t,nativeDecimals:o,nativeSymbol:r,currency:n,onRowClick:s}){let i=am(e),l=e.type==="buy"?"Buy":e.type==="sell"?"Sell":e.type.replace(/_/g," "),a=e.type==="buy"?"text-bullish":e.type==="sell"?"text-bearish":"text-default-500";return jsxs("tr",{className:cn("border-b border-default-50 hover:bg-default-50/60",s&&"cursor-pointer"),onClick:s?()=>s(e):void 0,children:[jsx("td",{className:cn("px-3 py-2 align-middle font-medium capitalize",a),children:l}),jsx("td",{className:"px-3 py-2 align-middle",children:jsxs("div",{className:"flex flex-col gap-0.5",children:[jsx("span",{className:"font-mono text-[11px] text-default-500",children:ce(e.walletAddress,6,6)}),jsx(Nr,{tags:e.traderTags,max:2})]})}),jsxs("td",{className:"px-3 py-2 text-right align-middle",children:[formatAmount(i.amount)," ",i.symbol]}),jsx("td",{className:"px-3 py-2 text-right align-middle text-foreground",children:n==="native"&&i.amountInNative?`${formatAmount(i.amountInNative)} ${i.symbol}`:i.amountInUsd?formatAmountUSDCompact(i.amountInUsd):"--"}),jsx("td",{className:"px-3 py-2 text-right align-middle text-default-500",children:i.priceInUsd?`$${formatPrice(i.priceInUsd)}`:"--"}),jsx("td",{className:"px-3 py-2 text-right align-middle text-default-400",children:cm(e.gasFee,o,r)}),jsx("td",{className:"px-3 py-2 text-right align-middle text-default-400",children:ye(e.time,t)})]})}function hn({chain:e,address:t,limit:o=50,initialSortBy:r="timestamp",initialTypeFilter:n="all"}){let[s,i]=useState(r),[l,a]=useState(n),[d,m]=useState(void 0),[c,p]=useState([]),[u,g]=useState([]),k=useCallback(()=>{m(void 0),p([]),g([]);},[]),x=useCallback(M=>{M!==s&&(i(M),k());},[s,k]),f=useCallback(M=>{M!==l&&(a(M),k());},[l,k]);useEffect(()=>{k();},[e,t,k]);let h=l==="all"?void 0:l,b=useMemo(()=>({chain:e,address:t,cursor:d,limit:o,sortBy:s,type:h}),[e,t,d,o,s,h]),{data:T,isPending:U,isFetching:I}=useTokenActivitiesQuery(b);useEffect(()=>{T&&p(M=>d==null?[T]:M[M.length-1]?.endCursor===T.endCursor?M:[...M,T]);},[T,d]);let q=s==="timestamp"&&l==="all"&&d==null;useTokenActivitiesSubscription({chain:e,address:t},M=>{!q||!M?.length||g(re=>{let F=new Set(re.map(W=>W.txHash)),w=M.filter(W=>!F.has(W.txHash));return w.length===0?re:[...w,...re].slice(0,100)});});let ve=useMemo(()=>{let M=c.flatMap(w=>w.data);if(!q||u.length===0)return M;let re=new Set(M.map(w=>w.txHash));return [...u.filter(w=>!re.has(w.txHash)),...M]},[c,u,q]),_=c[c.length-1],ke=!!(_?.hasNext&&_.endCursor),he=useCallback(()=>{!_?.endCursor||!_.hasNext||m(_.endCursor);},[_]);return {activities:ve,isLoading:U||I,sortBy:s,setSortBy:x,typeFilter:l,setTypeFilter:f,hasMore:ke,loadMore:he}}function s0({chain:e,address:t,limit:o,initialSortBy:r,initialTypeFilter:n,initialTraderFilter:s="all",initialCurrency:i="usd",youWalletAddress:l,nativeDecimals:a,nativeSymbol:d,className:m,onRowClick:c}){let[p,u]=useState(s),[g,k]=useState(i),{activities:x,isLoading:f,sortBy:h,setSortBy:b,typeFilter:T,setTypeFilter:U,hasMore:I,loadMore:q}=hn({chain:e,address:t,limit:o,initialSortBy:r,initialTypeFilter:n});return jsx(gn,{activities:x,isLoading:f,sortBy:h,onSortByChange:b,typeFilter:T,onTypeFilterChange:U,traderFilter:p,onTraderFilterChange:u,youWalletAddress:l,currency:g,onCurrencyChange:k,hasMore:I,onLoadMore:q,className:m,nativeDecimals:a,nativeSymbol:d,onRowClick:c})}function Tn({stats:e,resolution:t,className:o}){let r=e?.[t],n=r?.traders??0,s=r?.buyers??0,i=r?.sellers??0;return jsx(Ye,{className:o,label:`Traders (${t})`,totalFormatted:formatAmount(n),buysFormatted:formatAmount(s),sellsFormatted:formatAmount(i),totalValue:n,buysValue:s})}function yn(e,t){return A(e,t)}function b0({chain:e,address:t,resolution:o="24h",className:r}){let{token:n}=yn(e,t);return jsx(Tn,{stats:n?.stats,resolution:o,className:r})}function vn({stats:e,resolution:t,className:o}){let r=e?.[t],n=r?.trades??0,s=r?.buys??0,i=r?.sells??0;return jsx(Ye,{className:o,label:`Transactions (${t})`,totalFormatted:formatAmount(n),buysFormatted:formatAmount(s),sellsFormatted:formatAmount(i),totalValue:n,buysValue:s})}function Nn(e,t){return A(e,t)}function F0({chain:e,address:t,resolution:o="24h",className:r}){let{token:n}=Nn(e,t);return jsx(vn,{stats:n?.stats,resolution:o,className:r})}function Sn({stats:e,resolution:t,className:o}){let r=e?.[t],n=r?.volumesInUsd??"0",s=r?.buyVolumesInUsd??"0",i=r?.sellVolumesInUsd??"0";return jsx(Ye,{className:o,label:`Volume (${t})`,totalFormatted:formatAmountUSDCompact(n),buysFormatted:formatAmountUSDCompact(s),sellsFormatted:formatAmountUSDCompact(i),totalValue:n,buysValue:s})}function Cn(e,t){return A(e,t)}function X0({chain:e,address:t,resolution:o="24h",className:r}){let{token:n}=Cn(e,t);return jsx(Sn,{stats:n?.stats,resolution:o,className:r})}function wn({security:e,externalUrl:t,externalLabel:o,className:r}){let n=[{title:"Transfer fee",value:e?.hasTransferFee,safeWhen:false,description:"Whether the token charges a fee on transfer."},{title:"Fee not upgradable",value:e?.isTransferFeeUpgradable,safeWhen:false,description:"Whether the transfer fee can be raised by the token owner."},{title:"Transferable",value:e?.isTransferable,safeWhen:true,description:"Whether token holders can freely transfer the token."},{title:"Not freezable",value:e?.isFreezable,safeWhen:false,description:"Whether the token authority can freeze holder balances."},{title:"Not closable",value:e?.isClosable,safeWhen:false,description:"Whether the token program can be closed by its owner."}],s=n.every(i=>i.value!==void 0&&i.value===i.safeWhen);return jsxs("section",{className:cn("flex w-full flex-col gap-3",r),children:[jsxs("div",{className:"flex items-baseline justify-between",children:[jsx("span",{className:"text-sm font-medium text-foreground",children:"Security"}),jsx("span",{className:cn("text-xs",e===void 0?"text-default-400":s?"text-success-500":"text-danger-500"),children:e===void 0?"--":s?"Safe":"Review"})]}),jsx("div",{className:"flex flex-col",children:n.map(i=>jsx(ym,{...i},i.title))}),t&&o&&jsx("div",{className:"flex justify-center",children:jsx("a",{href:t,target:"_blank",rel:"noreferrer noopener",className:"text-xs text-default-400 transition-colors hover:text-foreground",children:o})})]})}function ym({title:e,value:t,safeWhen:o,description:r}){let n=t!==void 0&&t===o,s=t===void 0?"--":n?"OK":"Risk";return jsxs("div",{className:"flex h-8 items-center justify-between gap-2",children:[jsx("span",{className:"text-xs text-default-500",title:r,children:e}),jsx("span",{className:cn("text-xs",t===void 0?"text-default-400":n?"text-success-500":"text-danger-500"),children:s})]})}function Ln(e,t){let{data:o,isLoading:r}=useTokenSecurityQuery({chain:e,address:t});return {security:o,isLoading:r}}function dN({chain:e,address:t,externalUrl:o,externalLabel:r,className:n}){let{security:s}=Ln(e,t);return jsx(wn,{security:s,externalUrl:o,externalLabel:r,className:n})}function An({token:e,className:t}){return e?jsxs("section",{className:cn("flex w-full flex-col gap-2",t),children:[jsxs("div",{className:"text-sm font-medium text-foreground",children:["About ",e.symbol]}),e.description?jsx("p",{className:"whitespace-pre-line text-xs text-default-500",children:e.description}):jsx("p",{className:"text-xs text-default-400",children:"No description provided."})]}):null}function Hn(e,t){return A(e,t)}function NN({chain:e,address:t,className:o}){let{token:r}=Hn(e,t);return jsx(An,{token:r,className:o})}function Fn({liquidities:e,totalTvlInUsd:t,collapseAt:o=3,className:r,onPoolClick:n}){let[s,i]=useState(!e||e.length<=o),l=useCallback(()=>i(a=>!a),[]);return jsxs("section",{className:cn("flex w-full flex-col gap-3",r),children:[jsxs("div",{className:"flex items-baseline justify-between",children:[jsx("span",{className:"text-sm font-medium text-foreground",children:"Liquidity"}),t&&jsx("span",{className:"text-xs text-foreground",children:formatAmountUSDCompact(t)})]}),(!e||e.length===0)&&jsx("div",{className:"py-4 text-center text-xs text-default-400",children:"No pools"}),e&&e.length>0&&jsxs("div",{className:"flex flex-col gap-2",children:[e.map((a,d)=>jsxs("div",{className:cn("flex h-10 w-full items-center justify-between overflow-hidden text-xs",d>=o&&!s&&"hidden",n&&"cursor-pointer hover:bg-default-50"),onClick:n?()=>n(a):void 0,children:[jsxs("div",{className:"flex flex-col gap-0.5",children:[jsx("span",{className:"text-foreground",children:a.protocolFamily??a.protocolName??"Unknown"}),a.poolAddress&&jsxs("span",{className:"font-mono text-[10px] text-default-400",children:["Pool: ",ce(a.poolAddress,6,6)]})]}),jsx("div",{className:"text-default-500",children:formatAmountUSDCompact(a.tvlInUsd??0)})]},a.poolAddress??`${a.protocolFamily}-${d}`)),e.length>o&&jsx("div",{className:"flex justify-center pt-1",children:jsx("button",{type:"button",onClick:l,className:"rounded px-2 py-1 text-xs text-default-400 transition-colors hover:text-foreground",children:s?"Show less":"Show more"})})]})]})}function Un(e,t){return A(e,t)}function EN({chain:e,address:t,collapseAt:o,className:r,onPoolClick:n}){let{token:s}=Un(e,t);return jsx(Fn,{liquidities:s?.liquidities,totalTvlInUsd:s?.marketData?.tvlInUsd,collapseAt:o,className:r,onPoolClick:n})}function On({cexes:e,collapseAt:t=4,className:o}){let[r,n]=useState(!e||e.length<=t),s=useCallback(()=>n(i=>!i),[]);return !e||e.length===0?null:jsxs("section",{className:cn("w-full",o),children:[jsx("div",{className:"text-sm font-medium text-foreground",children:"CEX listings"}),jsx("div",{className:"mt-3 flex flex-wrap gap-2",children:e.map((i,l)=>{let a=l>=t&&!r,d=jsx(Chip,{startContent:i.logo?jsx(Image,{src:i.logo,width:20,height:20,alt:i.name}):void 0,className:cn("bg-default-100 text-xs",a&&"hidden"),children:i.name},i.id);return i.url?jsx("a",{href:i.url,target:"_blank",rel:"noreferrer noopener",className:cn(a&&"hidden"),children:d},i.id):d})}),e.length>t&&jsx("div",{className:"mt-3 flex justify-center",children:jsx("button",{type:"button",onClick:s,className:"rounded px-2 py-1 text-xs text-default-400 transition-colors hover:text-foreground",children:r?"Show less":"Show more"})})]})}function Dn(e){return {cexes:e}}function eS({cexes:e,collapseAt:t,className:o}){let{cexes:r}=Dn(e);return jsx(On,{cexes:r,collapseAt:t,className:o})}function Wn({categories:e,collapseAt:t=4,className:o,onCategoryClick:r}){let[n,s]=useState(!e||e.length<=t),i=useCallback(()=>s(l=>!l),[]);return !e||e.length===0?null:jsxs("section",{className:cn("w-full",o),children:[jsx("div",{className:"text-sm font-medium text-foreground",children:"Categories"}),jsx("div",{className:"mt-3 flex flex-wrap gap-2",children:e.map((l,a)=>{let d=a>=t&&!n;return jsx(Chip,{size:"sm",className:cn("bg-default-100",d&&"hidden",r&&"cursor-pointer"),onClick:r?()=>r(l):void 0,children:l},l)})}),e.length>t&&jsx("div",{className:"mt-3 flex justify-center",children:jsx("button",{type:"button",onClick:i,className:"rounded px-2 py-1 text-xs text-default-400 transition-colors hover:text-foreground",children:n?"Show less":"Show more"})})]})}function En(e,t){return A(e,t)}function gS({chain:e,address:t,collapseAt:o,className:r,onCategoryClick:n}){let{token:s}=En(e,t);return jsx(Wn,{categories:s?.tags,collapseAt:o,className:r,onCategoryClick:n})}var Vn=["5m","1h","4h","24h"];function _n({stats:e,resolution:t,className:o}){let r=e?.[t],n=new SafeBigNumber(r?.buyVolumesInUsd??0),s=new SafeBigNumber(r?.sellVolumesInUsd??0),i=n.plus(s),l=n.minus(s),a=i.eq(0)?50:Math.min(100,Math.max(0,n.div(i).times(100).toNumber())),d=[{label:`${t} Vol`,value:formatAmountUSDCompact(i.toString()),className:"text-foreground"},{label:"Buys",value:formatAmountUSDCompact(n.toString()),className:"text-bullish"},{label:"Sells",value:formatAmountUSDCompact(s.toString()),className:"text-bearish"},{label:"Net Vol.",value:formatAmountUSDCompact(l.abs().toString()),className:l.gte(0)?"text-bullish":"text-bearish"}];return jsxs("div",{className:cn("flex h-full w-full flex-col",o),children:[jsx("div",{className:"grid flex-1 grid-cols-4 items-center",children:d.map(m=>jsxs("div",{className:"flex flex-col items-start justify-center gap-[2px] px-2",children:[jsx("span",{className:"text-[10px] leading-none text-default-400",children:m.label}),jsx("span",{className:cn("text-[13px] font-medium leading-none tabular-nums",m.className),children:m.value})]},m.label))}),jsx("div",{className:"relative h-[2px] w-full overflow-hidden bg-bearish",children:jsx("div",{className:"absolute inset-y-0 left-0 bg-bullish transition-[width] duration-200 ease-out",style:{width:`${a}%`}})})]})}function $n({stats:e,resolutions:t,className:o}){return jsx("div",{className:cn("grid h-full w-full grid-cols-4 items-center",o),children:t.map(r=>{let s=e?.[r]?.priceChange,i=s?new SafeBigNumber(s):void 0,l=i?i.gte(0):void 0,a=r,d=i?formatPercent(i,{showPlusGtThanZero:true}):"\u2014";return jsxs("div",{className:"flex flex-col items-start justify-center gap-[2px] px-2",children:[jsx("span",{className:"text-[10px] leading-none text-default-400",children:a}),jsx("span",{className:cn("text-[13px] font-medium leading-none tabular-nums",l===void 0?"text-foreground":l?"text-bullish":"text-bearish"),children:d})]},r)})})}function Kn({chain:e,address:t}){let{data:o,isLoading:r}=useTokenStatsQuery({chain:e,address:t});return {stats:o,isLoading:r}}function HS({chain:e,address:t,baseResolution:o="5m",hoverResolutions:r=Vn,height:n=64,className:s}){let{stats:i}=Kn({chain:e,address:t});return jsx(StatsFlipPanel,{className:s,height:n,base:jsx(_n,{stats:i,resolution:o}),hover:jsx($n,{stats:i,resolutions:r})})}function zn({positions:e,isLoading:t,hasMore:o,onLoadMore:r,currency:n="usd",onCurrencyChange:s,showHidden:i=false,onShowHiddenChange:l,nativeSymbol:a="Native",renderActions:d,className:m}){return jsxs("div",{className:cn("flex flex-col",m),children:[jsxs("div",{className:"flex items-center justify-between gap-4 px-3 py-2",children:[jsxs("div",{className:"flex items-center gap-3",children:[jsx("span",{className:"text-xs font-medium text-default-500",children:"Positions"}),jsxs("label",{className:"flex cursor-pointer items-center gap-1 text-[11px] text-default-400",children:[jsx("input",{type:"checkbox",className:"size-3 accent-primary",checked:i,onChange:c=>l?.(c.target.checked)}),"Show Hidden"]})]}),jsx(Qm,{value:n,nativeSymbol:a,onChange:s})]}),jsx("div",{className:"overflow-x-auto",children:jsxs("table",{className:"w-full min-w-[720px] table-fixed text-[12px]",children:[jsx("thead",{className:"text-default-400",children:jsxs("tr",{className:"border-b border-default-100",children:[jsx("th",{className:"w-[26%] px-3 py-2 text-left font-normal",children:"Token"}),jsx("th",{className:"w-[14%] px-3 py-2 text-right font-normal",children:"Bought"}),jsx("th",{className:"w-[14%] px-3 py-2 text-right font-normal",children:"Sold"}),jsx("th",{className:"w-[16%] px-3 py-2 text-right font-normal",children:"Remaining"}),jsx("th",{className:"w-[18%] px-3 py-2 text-right font-normal",children:"PnL"}),jsx("th",{className:"w-[12%] px-3 py-2 text-right font-normal",children:"Actions"})]})}),jsxs("tbody",{children:[e.length===0&&!t&&jsx("tr",{children:jsx("td",{colSpan:6,className:"py-8 text-center text-default-400",children:"No open positions"})}),e.map(c=>jsx(Gm,{position:c,currency:n,renderActions:d},`${c.chain}:${c.address}`)),t&&jsx("tr",{children:jsx("td",{colSpan:6,className:"py-4 text-center text-default-400",children:"Loading\u2026"})})]})]})}),o&&jsx("div",{className:"flex justify-center px-3 py-2",children:jsx("button",{type:"button",onClick:r,disabled:t,className:"rounded bg-default-100 px-3 py-1 text-[11px] text-default-600 transition-colors hover:bg-default-200 disabled:opacity-50",children:"Load more"})})]})}function Qm({value:e,nativeSymbol:t,onChange:o}){return jsx("div",{className:"flex h-[24px] items-center rounded bg-default-100 p-[2px] text-[11px]",children:[{k:"usd",label:"USD"},{k:"native",label:t}].map(n=>jsx("button",{type:"button",onClick:()=>o?.(n.k),className:cn("rounded px-2 transition-colors",e===n.k?"bg-default-200 text-foreground":"text-default-400 hover:text-foreground"),children:n.label},n.k))})}function Gm({position:e,currency:t,renderActions:o}){let{bought:r,sold:n,remaining:s,pnl:i}=useMemo(()=>Xm(e,t),[e,t]),l=jsxs("div",{className:"flex items-center gap-2",children:[jsx(Avatar,{src:e.image??void 0,name:(e.symbol??"?").slice(0,1),className:"size-5 shrink-0 rounded-full bg-default-200 text-[10px]",showFallback:true}),jsxs("div",{className:"flex min-w-0 flex-col",children:[jsx("span",{className:"truncate text-foreground",children:e.symbol}),jsx("span",{className:"truncate text-[10px] text-default-400",children:e.name})]})]});return jsxs("tr",{className:"border-b border-default-50 hover:bg-default-50/60",children:[jsx("td",{className:"px-3 py-2 align-middle",children:l}),jsx("td",{className:"px-3 py-2 text-right align-middle text-foreground",children:r}),jsx("td",{className:"px-3 py-2 text-right align-middle text-foreground",children:n}),jsx("td",{className:"px-3 py-2 text-right align-middle text-foreground",children:s}),jsx("td",{className:cn("px-3 py-2 text-right align-middle font-medium",i.isPositive===void 0?"text-default-400":i.isPositive?"text-bullish":"text-bearish"),children:jsxs("div",{className:"flex flex-col items-end leading-tight",children:[jsx("span",{children:i.amount}),i.ratio?jsx("span",{className:"text-[10px]",children:i.ratio}):null]})}),jsx("td",{className:"px-3 py-2 text-right align-middle",children:o?o(e):jsx("span",{className:"text-default-400",children:"--"})})]})}function Xm(e,t){let o=t==="usd"?e.buyVolumesInUsd:e.buyVolumes,r=t==="usd"?e.sellVolumesInUsd:e.sellVolumes,n=t==="usd"?e.amountInUsd:e.amount,s=e.totalProfitInUsd,i=t==="usd"?formatAmountUSDCompact(o??0):formatAmount(o??0),l=t==="usd"?formatAmountUSDCompact(r??0):formatAmount(r??0),a=t==="usd"?formatAmountUSDCompact(n??0):formatAmount(n??0),d=s?new SafeBigNumber(s):void 0,m=d?d.gte(0):void 0,c=d?(m?"+":"")+formatAmountUSDCompact(d.toString()):"--",p=e.totalProfitRatio?formatPercent(e.totalProfitRatio,{showPlusGtThanZero:true}):void 0;return {bought:i,sold:l,remaining:a,pnl:{amount:c,ratio:p,isPositive:m}}}function Gn({chain:e,wallet:t,limit:o=50,initialShowHidden:r=false}){let[n,s]=useState(void 0),[i,l]=useState([]),[a,d]=useState(r);useEffect(()=>{s(void 0),l([]);},[e,t]);let m=useMemo(()=>({chain:e,address:t??"",cursor:n,limit:o,positionState:"open"}),[e,t,n,o]),{data:c,isPending:p,isFetching:u}=useWalletTokenPositionsQuery(m,{enabled:!!t});useEffect(()=>{c&&l(h=>n==null?[c]:h[h.length-1]?.endCursor===c.endCursor?h:[...h,c]);},[c,n]);let g=useMemo(()=>i.flatMap(h=>h.portfolios),[i]),k=i[i.length-1],x=!!(k?.hasNext&&k.endCursor),f=useCallback(()=>{!k?.endCursor||!k.hasNext||s(k.endCursor);},[k]);return {positions:g,isLoading:!!t&&(p||u),hasMore:x,loadMore:f,showHidden:a,setShowHidden:d}}function XS({chain:e,wallet:t,limit:o,initialCurrency:r="usd",nativeSymbol:n,renderActions:s,className:i}){let[l,a]=useState(r),{positions:d,isLoading:m,hasMore:c,loadMore:p,showHidden:u,setShowHidden:g}=Gn({chain:e,wallet:t,limit:o});return jsx(zn,{className:i,positions:d,isLoading:m,hasMore:c,onLoadMore:p,currency:l,onCurrencyChange:a,showHidden:u,onShowHiddenChange:g,nativeSymbol:n,renderActions:s})}function Xn({orders:e,isLoading:t,unavailable:o,hasMore:r,onLoadMore:n,stateFilter:s,onStateFilterChange:i,onlyThisToken:l=false,onOnlyThisTokenChange:a,tokenSymbol:d,currency:m="usd",onCurrencyChange:c,nativeSymbol:p="Native",onCancelAll:u,renderActions:g,className:k}){return jsxs("div",{className:cn("flex flex-col",k),children:[jsxs("div",{className:"flex flex-wrap items-center justify-between gap-2 px-3 py-2",children:[jsxs("div",{className:"flex items-center gap-2",children:[jsx("div",{className:"flex h-[24px] items-center rounded bg-default-100 p-[2px] text-[11px]",children:[{k:"active",label:"Active Orders"},{k:"history",label:"Order History"}].map(x=>jsx("button",{type:"button",onClick:()=>i(x.k),className:cn("rounded px-2 transition-colors",s===x.k?"bg-default-200 text-foreground":"text-default-400 hover:text-foreground"),children:x.label},x.k))}),d?jsxs("label",{className:"flex cursor-pointer items-center gap-1 text-[11px] text-default-400",children:[jsx("input",{type:"checkbox",className:"size-3 accent-primary",checked:l,onChange:x=>a?.(x.target.checked)}),"Only ",d]}):null]}),jsxs("div",{className:"flex items-center gap-2",children:[u?jsx("button",{type:"button",onClick:u,className:"rounded px-2 py-1 text-[11px] text-bearish transition-colors hover:bg-default-100",children:"Cancel All"}):null,jsx(rp,{value:m,nativeSymbol:p,onChange:c})]})]}),jsx("div",{className:"overflow-x-auto",children:jsxs("table",{className:"w-full min-w-[760px] table-fixed text-[12px]",children:[jsx("thead",{className:"text-default-400",children:jsxs("tr",{className:"border-b border-default-100",children:[jsx("th",{className:"w-[22%] px-3 py-2 text-left font-normal",children:"Token"}),jsx("th",{className:"w-[10%] px-3 py-2 text-left font-normal",children:"Type"}),jsx("th",{className:"w-[14%] px-3 py-2 text-right font-normal",children:"Amount"}),jsx("th",{className:"w-[14%] px-3 py-2 text-right font-normal",children:"Current MC"}),jsx("th",{className:"w-[14%] px-3 py-2 text-right font-normal",children:"Target MC"}),jsx("th",{className:"w-[14%] px-3 py-2 text-right font-normal",children:"Settings"}),jsx("th",{className:"w-[12%] px-3 py-2 text-right font-normal",children:"Action"})]})}),jsxs("tbody",{children:[o?jsx("tr",{children:jsx("td",{colSpan:7,className:"py-10 text-center text-default-400",children:"Limit orders are coming soon."})}):e.length===0&&!t?jsx("tr",{children:jsxs("td",{colSpan:7,className:"py-10 text-center text-default-400",children:["No ",s==="active"?"active":"historical"," orders"]})}):e.map(x=>jsx(sp,{order:x,currency:m,renderActions:g},x.id)),t&&!o&&jsx("tr",{children:jsx("td",{colSpan:7,className:"py-4 text-center text-default-400",children:"Loading\u2026"})})]})]})}),!o&&r&&jsx("div",{className:"flex justify-center px-3 py-2",children:jsx("button",{type:"button",onClick:n,disabled:t,className:"rounded bg-default-100 px-3 py-1 text-[11px] text-default-600 transition-colors hover:bg-default-200 disabled:opacity-50",children:"Load more"})})]})}function rp({value:e,nativeSymbol:t,onChange:o}){return jsx("div",{className:"flex h-[24px] items-center rounded bg-default-100 p-[2px] text-[11px]",children:[{k:"usd",label:"USD"},{k:"native",label:t}].map(n=>jsx("button",{type:"button",onClick:()=>o?.(n.k),className:cn("rounded px-2 transition-colors",e===n.k?"bg-default-200 text-foreground":"text-default-400 hover:text-foreground"),children:n.label},n.k))})}function sp({order:e,currency:t,renderActions:o}){let r=useMemo(()=>t==="usd"&&e.amountInUsd?formatAmountUSDCompact(e.amountInUsd):formatAmount(e.amount),[t,e.amount,e.amountInUsd]),n=e.side==="buy"?"Buy":"Sell",s=e.side==="buy"?"text-bullish":"text-bearish";return jsxs("tr",{className:"border-b border-default-50 hover:bg-default-50/60",children:[jsx("td",{className:"px-3 py-2 align-middle",children:jsxs("div",{className:"flex items-center gap-2",children:[jsx(Avatar,{src:e.tokenImage??void 0,name:(e.tokenSymbol??"?").slice(0,1),className:"size-5 shrink-0 rounded-full bg-default-200 text-[10px]",showFallback:true}),jsx("span",{className:"truncate text-foreground",children:e.tokenSymbol??"--"})]})}),jsx("td",{className:cn("px-3 py-2 align-middle font-medium",s),children:n}),jsx("td",{className:"px-3 py-2 text-right align-middle text-foreground",children:r}),jsx("td",{className:"px-3 py-2 text-right align-middle text-default-500",children:e.currentMarketCapInUsd?formatAmountUSDCompact(e.currentMarketCapInUsd):"--"}),jsx("td",{className:"px-3 py-2 text-right align-middle text-foreground",children:e.targetMarketCapInUsd?formatAmountUSDCompact(e.targetMarketCapInUsd):e.targetPriceInUsd?formatAmountUSDCompact(e.targetPriceInUsd):"--"}),jsx("td",{className:"px-3 py-2 text-right align-middle text-default-400",children:e.slippage!=null?`Slip ${e.slippage}%`:"--"}),jsx("td",{className:"px-3 py-2 text-right align-middle",children:o?o(e):jsx("span",{className:"text-default-400",children:"--"})})]})}function ip(e){return e instanceof Error&&e.code==="NotImplemented"}function ap(e){return e==="active"?"active":"filled"}function jn({chain:e,wallet:t,tokenAddress:o,limit:r=50,initialStateFilter:n="active",initialOnlyThisToken:s=false}){let[i,l]=useState(n),[a,d]=useState(s),[m,c]=useState(void 0),[p,u]=useState([]);useEffect(()=>{c(void 0),u([]);},[e,t,i,a,o]);let g=useCallback(_=>{_!==i&&l(_);},[i]),k=useMemo(()=>({chain:e,address:t??"",cursor:m,limit:r,state:ap(i),tokenAddress:a?o:void 0}),[e,t,m,r,i,a,o]),{data:x,isPending:f,isFetching:h,error:b}=useWalletLimitOrdersQuery(k,{enabled:!!t});useEffect(()=>{x&&u(_=>m==null?[x]:_[_.length-1]?.endCursor===x.endCursor?_:[..._,x]);},[x,m]);let T=!!b&&ip(b),U=useMemo(()=>p.flatMap(_=>_.data),[p]),I=p[p.length-1],q=!!(I?.hasNext&&I.endCursor),ve=useCallback(()=>{!I?.endCursor||!I.hasNext||c(I.endCursor);},[I]);return {orders:U,isLoading:!!t&&!T&&(f||h),unavailable:T,hasMore:q,loadMore:ve,stateFilter:i,setStateFilter:g,onlyThisToken:a,setOnlyThisToken:d}}function uC({chain:e,wallet:t,tokenAddress:o,tokenSymbol:r,limit:n,initialStateFilter:s="active",initialCurrency:i="usd",nativeSymbol:l,onCancelAll:a,renderActions:d,className:m}){let[c,p]=useState(i),{orders:u,isLoading:g,unavailable:k,hasMore:x,loadMore:f,stateFilter:h,setStateFilter:b,onlyThisToken:T,setOnlyThisToken:U}=jn({chain:e,wallet:t,tokenAddress:o,limit:n,initialStateFilter:s});return jsx(Xn,{className:m,orders:u,isLoading:g,unavailable:k,hasMore:x,onLoadMore:f,stateFilter:h,onStateFilterChange:b,onlyThisToken:T,onOnlyThisTokenChange:U,tokenSymbol:r,currency:c,onCurrencyChange:p,nativeSymbol:l,onCancelAll:k?void 0:a,renderActions:d})}function ei({traders:e,isLoading:t,hasMore:o,onLoadMore:r,onlyTracked:n=false,onOnlyTrackedChange:s,now:i=Date.now(),renderAddress:l,className:a}){return jsxs("div",{className:cn("flex flex-col",a),children:[jsxs("div",{className:"flex items-center justify-between gap-4 px-3 py-2",children:[jsx("span",{className:"text-xs font-medium text-default-500",children:"Top Traders"}),jsxs("label",{className:"flex cursor-pointer items-center gap-1 text-[11px] text-default-400",children:[jsx("input",{type:"checkbox",className:"size-3 accent-primary",checked:n,onChange:d=>s?.(d.target.checked)}),"Only Tracked"]})]}),jsx("div",{className:"overflow-x-auto",children:jsxs("table",{className:"w-full min-w-[680px] table-fixed text-[12px]",children:[jsx("thead",{className:"text-default-400",children:jsxs("tr",{className:"border-b border-default-100",children:[jsx("th",{className:"w-[28%] px-3 py-2 text-left font-normal",children:"Wallet"}),jsx("th",{className:"w-[20%] px-3 py-2 text-left font-normal",children:"Tags"}),jsx("th",{className:"w-[15%] px-3 py-2 text-right font-normal",children:"Value"}),jsx("th",{className:"w-[10%] px-3 py-2 text-right font-normal",children:"%"}),jsx("th",{className:"w-[14%] px-3 py-2 text-right font-normal",children:"Realized PnL"}),jsx("th",{className:"w-[13%] px-3 py-2 text-right font-normal",children:"Last active"})]})}),jsxs("tbody",{children:[e.length===0&&!t&&jsx("tr",{children:jsx("td",{colSpan:6,className:"py-8 text-center text-default-400",children:"No top traders yet"})}),e.map(d=>jsx(up,{trader:d,now:i,renderAddress:l},d.address)),t&&jsx("tr",{children:jsx("td",{colSpan:6,className:"py-4 text-center text-default-400",children:"Loading\u2026"})})]})]})}),o&&jsx("div",{className:"flex justify-center px-3 py-2",children:jsx("button",{type:"button",onClick:r,disabled:t,className:"rounded bg-default-100 px-3 py-1 text-[11px] text-default-600 transition-colors hover:bg-default-200 disabled:opacity-50",children:"Load more"})})]})}function up({trader:e,now:t,renderAddress:o}){let r=useMemo(()=>o?o(e.address):jsx("span",{className:"font-mono text-[11px] text-default-500",children:ce(e.address,6,6)}),[e.address,o]);return jsxs("tr",{className:"border-b border-default-50 hover:bg-default-50/60",children:[jsx("td",{className:"px-3 py-2 align-middle",children:r}),jsx("td",{className:"px-3 py-2 align-middle",children:jsx(Mt,{tags:e.tags,max:3})}),jsx("td",{className:"px-3 py-2 text-right align-middle text-foreground",children:formatAmountUSDCompact(e.amountInUsd)}),jsx("td",{className:"px-3 py-2 text-right align-middle text-default-500",children:Fe(e.ratio)}),jsx("td",{className:"px-3 py-2 text-right align-middle text-default-400",children:"\u2014"}),jsx("td",{className:"px-3 py-2 text-right align-middle text-default-400",children:e.lastActiveAt?ye(e.lastActiveAt,t):"--"})]})}function oi({chain:e,address:t,limit:o=50,initialOnlyTracked:r=false}){let[n,s]=useState(void 0),[i,l]=useState([]),[a,d]=useState(r);useEffect(()=>{s(void 0),l([]);},[e,t]);let m=useMemo(()=>({chain:e,address:t,cursor:n,limit:o,sortBy:"realizedPnl"}),[e,t,n,o]),{data:c,isPending:p,isFetching:u}=useTokenTopTradersQuery(m);useEffect(()=>{c&&l(b=>n==null?[c]:b[b.length-1]?.endCursor===c.endCursor?b:[...b,c]);},[c,n]);let g=useMemo(()=>i.flatMap(b=>b.data),[i]),k=useMemo(()=>a?g.filter(b=>b.tags&&b.tags.length>0):g,[g,a]),x=i[i.length-1],f=!!(x?.hasNext&&x.endCursor),h=useCallback(()=>{!x?.endCursor||!x.hasNext||s(x.endCursor);},[x]);return {traders:k,isLoading:p||u,hasMore:f,loadMore:h,onlyTracked:a,setOnlyTracked:d}}function IC({chain:e,address:t,limit:o,className:r,renderAddress:n}){let{traders:s,isLoading:i,hasMore:l,loadMore:a,onlyTracked:d,setOnlyTracked:m}=oi({chain:e,address:t,limit:o});return jsx(ei,{className:r,traders:s,isLoading:i,hasMore:l,onLoadMore:a,onlyTracked:d,onOnlyTrackedChange:m,renderAddress:n})}function si({tokens:e,isLoading:t,unavailable:o,hasMore:r,onLoadMore:n,renderTokenLink:s,className:i}){return jsxs("div",{className:cn("flex flex-col",i),children:[jsx("div",{className:"flex items-center justify-between gap-4 px-3 py-2",children:jsx("span",{className:"text-xs font-medium text-default-500",children:"Dev Tokens"})}),jsx("div",{className:"overflow-x-auto",children:jsxs("table",{className:"w-full min-w-[700px] table-fixed text-[12px]",children:[jsx("thead",{className:"text-default-400",children:jsxs("tr",{className:"border-b border-default-100",children:[jsx("th",{className:"w-[28%] px-3 py-2 text-left font-normal",children:"Token"}),jsx("th",{className:"w-[10%] px-3 py-2 text-center font-normal",children:"Migrated"}),jsx("th",{className:"w-[16%] px-3 py-2 text-right font-normal",children:"Market Cap"}),jsx("th",{className:"w-[14%] px-3 py-2 text-right font-normal",children:"ATH"}),jsx("th",{className:"w-[16%] px-3 py-2 text-right font-normal",children:"Liquidity"}),jsx("th",{className:"w-[16%] px-3 py-2 text-right font-normal",children:"1h Volume"})]})}),jsxs("tbody",{children:[o?jsx("tr",{children:jsx("td",{colSpan:6,className:"py-10 text-center text-default-400",children:"Dev tokens index is coming soon."})}):e.length===0&&!t?jsx("tr",{children:jsx("td",{colSpan:6,className:"py-8 text-center text-default-400",children:"No dev tokens"})}):e.map(l=>jsx(hp,{token:l,renderTokenLink:s},`${l.chain}:${l.address}`)),!o&&t&&jsx("tr",{children:jsx("td",{colSpan:6,className:"py-4 text-center text-default-400",children:"Loading\u2026"})})]})]})}),!o&&r&&jsx("div",{className:"flex justify-center px-3 py-2",children:jsx("button",{type:"button",onClick:n,disabled:t,className:"rounded bg-default-100 px-3 py-1 text-[11px] text-default-600 transition-colors hover:bg-default-200 disabled:opacity-50",children:"Load more"})})]})}function hp({token:e,renderTokenLink:t}){let o=e.marketData?.marketCapInUsd??e.marketData?.marketCap,r=e.marketData?.tvlInUsd,s=e.stats?.["1h"]?.volumesInUsd,i=!!e.migratedTo,l=t?t(e):jsxs("div",{className:"flex items-center gap-2",children:[jsx(Avatar,{src:e.image??void 0,name:(e.symbol??e.name??"?").slice(0,1),className:"size-5 shrink-0 rounded-full bg-default-200 text-[10px]",showFallback:true}),jsxs("div",{className:"flex min-w-0 flex-col",children:[jsx("span",{className:"truncate text-foreground",children:e.symbol}),jsx("span",{className:"truncate text-[10px] text-default-400",children:e.name})]})]});return jsxs("tr",{className:"border-b border-default-50 hover:bg-default-50/60",children:[jsx("td",{className:"px-3 py-2 align-middle",children:l}),jsx("td",{className:"px-3 py-2 text-center align-middle",children:i?jsx("span",{className:"text-bullish",children:"\u2713"}):jsx("span",{className:"text-default-400",children:"\u2014"})}),jsx("td",{className:"px-3 py-2 text-right align-middle text-foreground",children:o?formatAmountUSDCompact(o):"--"}),jsx("td",{className:"px-3 py-2 text-right align-middle text-foreground",children:"--"}),jsx("td",{className:"px-3 py-2 text-right align-middle text-foreground",children:r?formatAmountUSDCompact(r):"--"}),jsx("td",{className:"px-3 py-2 text-right align-middle text-foreground",children:s?formatAmountUSDCompact(s):"--"})]})}function ni({tokens:e,className:t}){let o=e.length,r=e.filter(l=>!!l.migratedTo).length,n=o===0?0:Math.round(r/o*100),s=e.map(l=>l.stats?.["1h"]?.volumesInUsd??"0").reduce((l,a)=>l.plus(new SafeBigNumber(a)),new SafeBigNumber(0)),i=e.map(l=>l.marketData?.marketCapInUsd??l.marketData?.marketCap??"0").reduce((l,a)=>l.plus(new SafeBigNumber(a)),new SafeBigNumber(0));return jsxs("div",{className:cn("flex flex-col gap-2 p-3",t),children:[jsx("div",{className:"flex items-center justify-between",children:jsx("span",{className:"text-xs font-medium text-default-500",children:"Token Stats"})}),jsxs("div",{className:"grid grid-cols-2 gap-3",children:[jsx(oo,{label:"Total",value:String(o)}),jsx(oo,{label:"Migrated",value:`${r} (${n}%)`}),jsx(oo,{label:"Total Market Cap",value:formatAmountUSDCompact(i.toString())}),jsx(oo,{label:"Total 1h Volume",value:formatAmountUSDCompact(s.toString())})]})]})}function oo({label:e,value:t}){return jsxs("div",{className:"flex flex-col gap-[2px]",children:[jsx("span",{className:"text-[10px] text-default-400",children:e}),jsx("span",{className:"text-[13px] font-medium text-foreground",children:t})]})}function yp(e){return e instanceof Error&&e.code==="NotImplemented"}function di({chain:e,creator:t,limit:o=20}){let[r,n]=useState(void 0),[s,i]=useState([]);useEffect(()=>{n(void 0),i([]);},[e,t]);let l=useMemo(()=>({chain:e,creator:t??"",cursor:r,limit:o}),[e,t,r,o]),{data:a,isPending:d,isFetching:m,error:c}=useTokensByCreatorQuery(l,{enabled:!!t});useEffect(()=>{a&&i(f=>r==null?[a]:f[f.length-1]?.endCursor===a.endCursor?f:[...f,a]);},[a,r]);let p=!!c&&yp(c),u=useMemo(()=>s.flatMap(f=>f.data),[s]),g=s[s.length-1],k=!!(g?.hasNext&&g.endCursor),x=useCallback(()=>{!g?.endCursor||!g.hasNext||n(g.endCursor);},[g]);return {tokens:u,isLoading:!!t&&!p&&(d||m),unavailable:p,hasMore:k,loadMore:x}}function GC({chain:e,creator:t,limit:o,showSummary:r=false,renderTokenLink:n,className:s}){let{tokens:i,isLoading:l,unavailable:a,hasMore:d,loadMore:m}=di({chain:e,creator:t,limit:o});return jsxs("div",{className:s,children:[jsx(si,{tokens:i,isLoading:l,unavailable:a,hasMore:d,onLoadMore:m,renderTokenLink:n}),r&&!a?jsx(ni,{tokens:i}):null]})}function pi({token:e,athInUsd:t,athAt:o,globalFeesPaidInUsd:r,rank:n,onTogglePin:s,pinned:i,className:l}){let a=e?.marketData?.priceInUsd,d=e?.marketData?.tvlInUsd,m=e?.marketData?.totalSupply;return jsxs("div",{className:cn("flex h-[48px] w-full flex-row items-center gap-4 overflow-x-auto px-3 text-[12px]",l),children:[jsx(nt,{label:"Price",value:a?formatPriceUSD(a):"--"}),jsx(nt,{label:"Liquidity",value:d?formatAmountUSDCompact(d):"--"}),jsx(nt,{label:"Supply",value:m?formatAmount(m):"--"}),r?jsx(nt,{label:"Fees Paid",value:formatAmountUSDCompact(r)}):null,t?jsx(nt,{label:"ATH",value:formatAmountUSDCompact(t),title:o?`All-time high at ${o.toLocaleDateString()}`:void 0}):null,n!==void 0?jsx(nt,{label:"Rank",value:`#${n}`}):null,jsx("div",{className:"flex-1"}),s?jsx("button",{type:"button",onClick:s,"aria-pressed":i,className:cn("flex size-[26px] items-center justify-center rounded text-default-400 transition-colors hover:bg-default-100 hover:text-foreground",i&&"text-foreground"),title:i?"Unpin token":"Pin token",children:i?"\u2605":"\u2606"}):null]})}function nt({label:e,value:t,title:o}){return jsxs("div",{className:"flex flex-col items-start justify-center gap-[2px] whitespace-nowrap",title:o,children:[jsx("span",{className:"text-[10px] leading-none text-default-400",children:e}),jsx("span",{className:"text-[13px] font-medium leading-none tabular-nums text-foreground",children:t})]})}function fi({chain:e,address:t}){return A(e,t)}function dw({chain:e,address:t,athInUsd:o,athAt:r,globalFeesPaidInUsd:n,rank:s,pinned:i,onTogglePin:l,className:a}){let{token:d}=fi({chain:e,address:t});return jsx(pi,{className:a,token:d,athInUsd:o,athAt:r,globalFeesPaidInUsd:n,rank:s,pinned:i,onTogglePin:l})}function gi({tokens:e,isLoading:t,unavailable:o,onTokenClick:r,className:n}){return o?jsx("div",{className:cn("flex items-center justify-center p-4 text-center text-[11px] text-default-400",n),children:"Similar tokens coming soon."}):!t&&e.length===0?jsx("div",{className:cn("flex items-center justify-center p-4 text-center text-[11px] text-default-400",n),children:"No similar tokens found."}):jsxs("ul",{className:cn("flex flex-col",n),children:[e.map(s=>jsxs("li",{className:cn("flex cursor-pointer items-center gap-2 border-b border-default-50 px-3 py-2 last:border-0 hover:bg-default-50/60",!r&&"cursor-default"),onClick:r?()=>r(s):void 0,children:[jsx(Avatar,{src:s.image??void 0,name:(s.symbol??"?").slice(0,1),className:"size-5 shrink-0 rounded-full bg-default-200 text-[10px]",showFallback:true}),jsxs("div",{className:"flex min-w-0 flex-1 flex-col",children:[jsx("span",{className:"truncate text-[12px] text-foreground",children:s.symbol}),jsx("span",{className:"truncate text-[10px] text-default-400",children:s.name})]}),jsx("span",{className:"text-[11px] tabular-nums text-default-500",children:s.marketData?.marketCapInUsd?formatAmountUSDCompact(s.marketData.marketCapInUsd):"--"})]},`${s.chain}:${s.address}`)),t&&jsx("li",{className:"py-2 text-center text-[11px] text-default-400",children:"Loading\u2026"})]})}function xi({chain:e,address:t,keyword:o,limit:r=10}){let n=!!o&&o.length>0,{data:s,isPending:i,isFetching:l}=useSearchTokensQuery({chains:[e],keyword:o,limit:r+1},{enabled:n});return {tokens:useMemo(()=>{if(!s)return [];let d=t.toLowerCase();return (s.data??[]).filter(m=>m.address.toLowerCase()!==d).slice(0,r)},[s,t,r]),isLoading:n&&(i||l),unavailable:!n}}function Cw({chain:e,address:t,keyword:o,limit:r,onTokenClick:n,className:s}){let{tokens:i,isLoading:l,unavailable:a}=xi({chain:e,address:t,keyword:o,limit:r});return jsx(gi,{className:s,tokens:i,isLoading:l,unavailable:a,onTokenClick:n})}function ki({tokens:e=[],unavailable:t=true,onTokenClick:o,className:r}){return t?jsx("div",{className:cn("flex items-center justify-center p-4 text-center text-[11px] text-default-400",r),children:"Image-similarity search is coming soon."}):e.length===0?jsx("div",{className:cn("flex items-center justify-center p-4 text-center text-[11px] text-default-400",r),children:"No reused-image tokens found."}):jsx("div",{className:cn("flex flex-row flex-wrap gap-2 p-3",r),children:e.map(n=>jsx("button",{type:"button",onClick:o?()=>o(n):void 0,className:"flex size-10 items-center justify-center overflow-hidden rounded-full border border-default-100 transition-opacity hover:opacity-80",title:n.symbol,children:jsx(Avatar,{src:n.image??void 0,name:(n.symbol??"?").slice(0,1),className:"size-full bg-default-100 text-[10px] text-default-400",showFallback:true})},`${n.chain}:${n.address}`))})}function hi(e){return {tokens:[],isLoading:false,unavailable:true}}function Bw({chain:e,address:t,onTokenClick:o,className:r}){let{tokens:n,unavailable:s}=hi();return jsx(ki,{className:r,tokens:n,unavailable:s,onTokenClick:o})}function Ni({keywords:e,excludeKeywords:t,onKeywordsChange:o,onExcludeKeywordsChange:r,className:n}){let{t:s}=useTranslation(),[i,l]=useState(e?.join(", ")??""),[a,d]=useState(t?.join(", ")??"");useEffect(()=>{l(p=>{let u=so(p);return u===void 0&&e===void 0?p:u===void 0?e?.join(", ")??"":e===void 0?"":u.join("")===e.join("")?p:e.join(", ")});},[e]),useEffect(()=>{d(p=>{let u=so(p);return u===void 0&&t===void 0?p:u===void 0?t?.join(", ")??"":t===void 0?"":u.join("")===t.join("")?p:t.join(", ")});},[t]);let m=useCallback(p=>{l(p),o?.(so(p));},[o]),c=useCallback(p=>{d(p),r?.(so(p));},[r]);return jsxs("div",{className:cn("grid grid-cols-2 gap-3 px-4",n),children:[jsxs("div",{className:"flex flex-col gap-3",children:[jsx("h3",{className:"text-xs text-neutral",children:s("tokens.filters.keywords.title")}),jsx(StyledInput,{variant:"bordered",radius:"lg",size:"sm",placeholder:s("tokens.filters.keywords.placeholder"),value:i,onValueChange:m})]}),jsxs("div",{className:"flex flex-col gap-3",children:[jsx("h3",{className:"text-xs text-neutral",children:s("tokens.filters.keywords.exclude.title")}),jsx(StyledInput,{variant:"bordered",radius:"lg",size:"sm",placeholder:s("tokens.filters.keywords.placeholder"),value:a,onValueChange:c})]})]})}function so(e){let t=e.split(",").map(o=>o.trim()).filter(Boolean);return t.length>0?t:void 0}function Ri({protocols:e,selectedProtocols:t=[],onSelectedProtocolsChange:o,className:r}){let{t:n}=useTranslation(),[s,i]=useState(t);useEffect(()=>{i(t);},[t]);let l=useMemo(()=>e.every(m=>s.includes(m)),[e,s]),a=useCallback(()=>{if(l){let m=[];i(m),o?.(m);}else {let m=[...e];i(m),o?.(m);}},[e,o,l]),d=useCallback(m=>()=>{if(s.includes(m)){let c=s.filter(p=>p!==m);i(c),o?.(c);}else {let c=[...s,m];i(c),o?.(c);}},[s,o]);return jsxs("div",{className:cn("flex flex-col gap-3 px-4",r),children:[jsxs("div",{className:"flex justify-between items-center",children:[jsx("h3",{className:"text-xs text-neutral",children:n("tokens.filters.protocols.title")}),jsx(Button,{variant:"light",color:"default",size:"sm",radius:"full",onPress:a,children:n(l?"tokens.filters.protocols.unselectAll":"tokens.filters.protocols.selectAll")})]}),jsx("div",{className:"grid grid-cols-3 gap-3",children:e.map(m=>{let c=He(m);return jsx(Button,{variant:"bordered",size:"sm",radius:"full",className:cn("w-fit h-6 px-2.5",c.text,c.bg5,"border",c.border,{"opacity-40 data-[hover=true]:!opacity-30":!s.includes(m)}),startContent:jsx(Image,{width:14,height:14,src:`/images/protocols/${m}.svg`,alt:formatTokenProtocolName(m)}),onPress:d(m),children:formatTokenProtocolName(m)},m)})})]})}function fe({title:e,field:t,value:o,onChange:r}){let{t:n}=useTranslation(),[s,i]=useState(o?tr(o).min:NaN),[l,a]=useState(o?tr(o).max:NaN);useEffect(()=>{if(o===void 0)i(NaN),a(NaN);else {let{min:c,max:p}=tr(o);i(c),a(p);}},[o]);let d=useCallback(c=>{i(c),r?.(Mi(t,c,l));},[t,r,l]),m=useCallback(c=>{a(c),r?.(Mi(t,s,c));},[t,r,s]);return jsxs("div",{className:"flex flex-col gap-1",children:[e&&jsx("h3",{className:"text-xs text-neutral",children:e}),jsxs("div",{className:"grid grid-cols-2 gap-3",children:[jsx(StyledNumberInput,{value:s,onValueChange:d,variant:"bordered",radius:"lg",size:"sm",placeholder:n("tokens.filters.stats.min"),"aria-label":`${e} min`}),jsx(StyledNumberInput,{value:l,onValueChange:m,variant:"bordered",radius:"lg",size:"sm",placeholder:n("tokens.filters.stats.max"),"aria-label":`${e} max`})]})]})}function tr(e){if(e.operator==="between"){let[t,o]=e.value;return {min:t,max:o}}return e.operator==="gte"?{min:e.value,max:NaN}:e.operator==="lte"?{min:NaN,max:e.value}:{min:NaN,max:NaN}}function Mi(e,t,o){if(!(isNaN(t)&&isNaN(o)))return isNaN(t)?{field:e,operator:"lte",value:o}:isNaN(o)?{field:e,operator:"gte",value:t}:{field:e,operator:"between",value:[t,o]}}function Ui({values:e,onValuesChange:t,className:o}){let{t:r}=useTranslation(),[n,s]=useState(e);useEffect(()=>{s(e);},[e]);let i=useCallback(l=>a=>{if(a===void 0){let d=(n??[]).filter(m=>m.field!==l);d=d.length>0?d:void 0,s(d),t?.(d);}else {let d=[...(n??[]).filter(m=>m.field!==l),a];s(d),t?.(d);}},[n,t]);return jsxs("div",{className:cn("flex flex-col gap-4",o),children:[jsx(fe,{field:"holders",title:r("tokens.filters.stats.audits.holders"),value:n?.find(l=>l.field==="holders"),onChange:i("holders")}),jsx(fe,{field:"top10Ratio",title:r("tokens.filters.stats.audits.top10HoldingsRatio"),value:n?.find(l=>l.field==="top10Ratio"),onChange:i("top10Ratio")}),jsx(fe,{field:"top100Ratio",title:r("tokens.filters.stats.audits.top100HoldingsRatio"),value:n?.find(l=>l.field==="top100Ratio"),onChange:i("top100Ratio")}),jsx(fe,{field:"creatorsRatio",title:r("tokens.filters.stats.audits.devHoldingsRatio"),value:n?.find(l=>l.field==="creatorsRatio"),onChange:i("creatorsRatio")})]})}function Oi({resolution:e,values:t,onValuesChange:o,className:r}){let{t:n}=useTranslation(),[s,i]=useState(t);useEffect(()=>{i(t);},[t]);let l=useCallback(a=>d=>{if(d===void 0){let m=(s??[]).filter(c=>c.field!==a);m=m.length>0?m:void 0,i(m),o?.(m);}else {let m=[...(s??[]).filter(c=>c.field!==a),d];i(m),o?.(m);}},[s,o]);return jsxs("div",{className:cn("flex flex-col gap-4",r),children:[jsx(fe,{field:"marketCap",title:n("tokens.filters.stats.metrics.marketCap"),value:s?.find(a=>a.field==="marketCap"),onChange:l("marketCap")}),jsx(fe,{field:"tvl",title:n("tokens.filters.stats.metrics.liquidity"),value:s?.find(a=>a.field==="tvl"),onChange:l("tvl")}),jsx(fe,{field:`volumes${e}`,title:n("tokens.filters.stats.metrics.volumes",{resolution:n(`common.resolution.${e}`)}),value:s?.find(a=>a.field===`volumes${e}`),onChange:l(`volumes${e}`)}),jsx(fe,{field:`trades${e}`,title:n("tokens.filters.stats.metrics.txns",{resolution:n(`common.resolution.${e}`)}),value:s?.find(a=>a.field===`trades${e}`),onChange:l(`trades${e}`)})]})}function _i({resolution:e,values:t,onValuesChange:o,className:r}){let{t:n}=useTranslation(),[s,i]=useState("audits"),[l,a]=useState(t);useEffect(()=>{a(t);},[t]);let d=useCallback(p=>{a(p),o?.(p);},[o]),m=useMemo(()=>{let p=["holders","top10Ratio","top100Ratio","creatorsRatio"];return l?.filter(u=>p.includes(u.field))?.length??0},[l]),c=useMemo(()=>{let p=["marketCap","tvl",`volumes${e}`,`trades${e}`];return l?.filter(u=>p.includes(u.field)).length??0},[l,e]);return jsxs("div",{className:cn("flex flex-col gap-3 px-4",r),children:[jsxs(StyledLightTabs,{color:"default",radius:"full",size:"sm",selectedKey:s,onSelectionChange:i,children:[jsx(Tab,{title:m===0?n("tokens.filters.stats.audits"):jsx(StyledBadge,{color:"primary",size:"sm",content:m,shape:"circle",children:n("tokens.filters.stats.audits")})},"audits"),jsx(Tab,{title:c===0?n("tokens.filters.stats.metrics"):jsx(StyledBadge,{color:"primary",size:"sm",content:c,shape:"circle",children:n("tokens.filters.stats.metrics")})},"metrics")]}),jsx(Ui,{values:l,onValuesChange:d,className:cn({hidden:s!=="audits"})}),jsx(Oi,{values:l,onValuesChange:d,resolution:e,className:cn({hidden:s!=="metrics"})})]})}function uo({protocols:e,resolution:t,filters:o,onFiltersChange:r,className:n}){let[s,i]=useState($i(o?.filters,e));useEffect(()=>{i($i(o?.filters,e));},[o?.filters,e]);let[l,a]=useState(o?.keywords);useEffect(()=>{a(o?.keywords);},[o?.keywords]);let[d,m]=useState(o?.excludeKeywords);useEffect(()=>{m(o?.excludeKeywords);},[o?.excludeKeywords]);let[c,p]=useState(o?.filters);useEffect(()=>{p(o?.filters);},[o?.filters]);let u=useCallback(f=>{i(f),r?.(po(e,f,l,d,c));},[e,l,d,c,r]),g=useCallback(f=>{a(f),r?.(po(e,s,f,d,c));},[e,s,d,c,r]),k=useCallback(f=>{m(f),r?.(po(e,s,l,f,c));},[e,s,l,c,r]),x=useCallback(f=>{p(f),r?.(po(e,s,l,d,f));},[e,s,l,d,r]);return jsxs("div",{className:cn("flex flex-col gap-4",n),children:[e&&e.length>0&&jsxs(Fragment,{children:[jsx(Ri,{protocols:e,selectedProtocols:s,onSelectedProtocolsChange:u}),jsx("div",{style:{height:1,background:"rgba(39,39,42,1)"}})]}),jsx(Ni,{keywords:l,excludeKeywords:d,onKeywordsChange:g,onExcludeKeywordsChange:k}),jsx("div",{style:{height:1,background:"rgba(39,39,42,1)"}}),jsx(_i,{resolution:t,values:c,onValuesChange:x})]})}function $i(e,t){let o=e?.find(r=>r.field==="launchedFromProtocolFamily");return o?o.operator==="in"?o.value:(console.warn("invalid token protocols filter",o),[...t||[]]):[...t||[]]}function po(e,t,o,r,n){let s=n?[...n.filter(i=>i.field!=="launchedFromProtocolFamily")]:[];return e&&e.length>0&&(e.every(l=>t.includes(l))||s.push({field:"launchedFromProtocolFamily",operator:"in",value:t})),o===void 0&&r===void 0&&s.length===0?void 0:{keywords:o,excludeKeywords:r,filters:s.length>0?s:void 0}}function Qi({protocols:e,resolution:t,filters:o,onFiltersChange:r}){let{t:n}=useTranslation(),{isOpen:s,onOpen:i,onClose:l,onOpenChange:a}=useDisclosure(),[d,m]=useState(o),c=useCallback(()=>{m(void 0);},[]),p=useCallback(()=>{r?.(d),l();},[d,r,l]);useEffect(()=>{m(o);},[s,o]);let u=useMemo(()=>Object.values(o||{}).every(g=>g===void 0),[o]);return jsxs(Fragment,{children:[jsxs("button",{type:"button",onClick:i,style:{display:"inline-flex",alignItems:"center",justifyContent:"center",borderRadius:9999,border:"1px solid rgba(63,63,70,0.5)",background:"rgba(39,39,42,0.6)",width:32,height:32,minHeight:32,cursor:"pointer",position:"relative"},children:[jsx(FilterIcon,{width:16,height:16,className:"text-zinc-400"}),!u&&jsx("span",{style:{position:"absolute",top:-2,right:-2,width:8,height:8,borderRadius:4,background:"#c7ff2e"}})]}),jsx(StyledModal,{isOpen:s,onOpenChange:a,size:"md",scrollBehavior:"inside",children:jsxs(ModalContent,{className:"w-full h-full",children:[jsx(ModalHeader,{className:"px-4 py-2",children:jsx("span",{className:"text-base font-semibold",children:n("tokens.filters.modal.title")})}),jsx(ModalBody,{className:"px-0 pt-0 pb-4",children:jsx(ScrollShadow,{children:jsx(uo,{protocols:e,resolution:t,filters:d,onFiltersChange:m,className:"pb-4"})})}),jsx(ModalFooter,{className:"px-4",children:jsxs("div",{className:"w-full flex justify-between items-center",children:[jsx(Button,{variant:"light",color:"default",size:"sm",radius:"full",startContent:jsx(RefreshIcon,{width:16,height:16}),onPress:c,children:n("common.reset")}),jsx(Button,{color:"primary",size:"sm",radius:"full",onPress:p,children:n("common.apply")})]})})]})})]})}var wu={display:"inline-flex",alignItems:"center",gap:8,borderRadius:9999,border:"1px solid rgba(63,63,70,0.5)",background:"rgba(39,39,42,0.6)",padding:"6px 12px",fontSize:14,fontWeight:700,color:"#d4d4d8",cursor:"pointer",transition:"all 0.15s",height:32},Lu={position:"absolute",right:0,top:"100%",zIndex:20,marginTop:8,borderRadius:14,border:"1px solid rgba(39,39,42,1)",background:"rgba(24,24,27,1)",boxShadow:"0 25px 50px -12px rgba(0,0,0,0.5)",overflow:"hidden"},Pu={height:1,background:"rgba(39,39,42,1)",margin:0};function Yi({protocols:e,resolution:t,filters:o,onFiltersChange:r}){let{t:n}=useTranslation(),[s,i]=useState(false),l=useRef(null),[a,d]=useState(o),m=useCallback(()=>{d(void 0);},[]),c=useCallback(()=>{r?.(a),i(false);},[a,r]);useEffect(()=>{d(o);},[s,o]),useEffect(()=>{let u=g=>{l.current&&!l.current.contains(g.target)&&i(false);};return document.addEventListener("mousedown",u),()=>document.removeEventListener("mousedown",u)},[]),useEffect(()=>{if(!s)return;let u=g=>{g.key==="Escape"&&i(false);};return document.addEventListener("keydown",u),()=>document.removeEventListener("keydown",u)},[s]);let p=useMemo(()=>Object.values(o||{}).every(u=>u===void 0),[o]);return jsxs("div",{ref:l,style:{position:"relative"},children:[jsxs("div",{style:{position:"relative",display:"inline-flex"},children:[jsxs("button",{type:"button",style:wu,onMouseEnter:u=>{u.currentTarget.style.background="rgba(39,39,42,1)";},onMouseLeave:u=>{u.currentTarget.style.background="rgba(39,39,42,0.6)";},onClick:()=>i(u=>!u),children:[jsx(FilterIcon,{width:16,height:16,className:"flex-none"}),jsx("span",{className:"hidden sm:block",children:n("tokens.listHeader.filter")}),jsx(Ru,{open:s})]}),!p&&jsx("span",{style:{position:"absolute",top:-4,right:-4,minWidth:8,height:8,borderRadius:4,background:"#c7ff2e"}})]}),s&&jsxs("div",{style:{...Lu,width:420},children:[jsx("div",{style:{padding:"16px 0"},children:jsx(ScrollShadow,{className:"w-full max-h-120 px-4",children:jsx(uo,{protocols:e,resolution:t,filters:a,onFiltersChange:d})})}),jsx("div",{style:Pu}),jsxs("div",{style:{padding:"12px 16px",display:"flex",justifyContent:"space-between",alignItems:"center"},children:[jsx(Button,{variant:"light",size:"sm",color:"default",radius:"full",startContent:jsx(RefreshIcon,{width:16,height:16}),onPress:m,children:n("common.reset")}),jsx(Button,{variant:"solid",size:"sm",color:"primary",radius:"full",onPress:c,children:n("common.apply")})]})]})]})}function Ru({open:e}){return jsx("svg",{viewBox:"0 0 24 24",style:{width:14,height:14,color:"#71717a",transition:"transform 0.15s",transform:e?"rotate(180deg)":void 0},fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:jsx("path",{d:"m6 9 6 6 6-6"})})}function AP({popoverPlacement:e="bottom-end",...t}){let{isMobile:o}=useScreen();return o?jsx(Qi,{...t}):jsx(Yi,{placement:e,...t})}function ea({resolution:e,onResolutionChange:t,resolutionOptions:o=["1m","5m","1h","4h","24h"]}){let{t:r}=useTranslation(),n=useCallback(s=>{t?.(s);},[t]);return jsx(StyledPlainTabs,{color:"primary",radius:"lg",selectedKey:e,onSelectionChange:n,"aria-label":"Select Resolution",classNames:{tabList:"gap-0",tab:"px-2",tabContent:"!text-zinc-500 group-data-[hover=true]:!text-foreground group-data-[selected=true]:!text-primary"},children:o.map(s=>jsx(Tab,{title:r(`common.resolution.${s}`)},s))})}var _u={display:"inline-flex",alignItems:"center",gap:4,borderRadius:9999,border:"1px solid rgba(63,63,70,0.5)",background:"rgba(39,39,42,0.6)",padding:"0 10px",fontSize:12,fontWeight:500,color:"#d4d4d8",cursor:"pointer",height:32,minHeight:32},$u={position:"absolute",left:0,top:"100%",zIndex:20,marginTop:6,borderRadius:14,border:"1px solid rgba(39,39,42,1)",background:"rgba(24,24,27,1)",boxShadow:"0 25px 50px -12px rgba(0,0,0,0.5)",overflow:"hidden",padding:"6px",minWidth:"100%"};function oa({resolution:e,onResolutionChange:t,resolutionOptions:o=["1m","5m","1h","4h","24h"]}){let{t:r}=useTranslation(),[n,s]=useState(false),i=useRef(null),l=useCallback(a=>{t?.(a),s(false);},[t]);return useEffect(()=>{if(!n)return;let a=m=>{i.current&&!i.current.contains(m.target)&&s(false);},d=m=>{m.key==="Escape"&&s(false);};return document.addEventListener("mousedown",a),document.addEventListener("keydown",d),()=>{document.removeEventListener("mousedown",a),document.removeEventListener("keydown",d);}},[n]),jsxs("div",{ref:i,style:{position:"relative",zIndex:50},children:[jsxs("button",{type:"button",style:_u,onClick:()=>s(a=>!a),children:[jsx("span",{children:e?r(`common.resolution.${e}`):"\u2014"}),jsx(ChevronDownIcon,{width:14,height:14,className:"text-zinc-500",style:{transition:"transform 0.15s",transform:n?"rotate(180deg)":void 0}})]}),n&&jsx("div",{style:$u,children:o.map(a=>jsx("button",{type:"button",onClick:()=>l(a),className:cn("w-full text-left px-3 py-1.5 rounded-lg text-xs font-medium transition-colors cursor-pointer",a===e?"text-primary bg-primary/10":"text-zinc-400 hover:text-foreground hover:bg-zinc-800"),children:r(`common.resolution.${a}`)},a))})]})}function QP(e){let{isMobile:t}=useScreen();return t?jsx(oa,{...e}):jsx(ea,{...e})}var na=memo(function({token:t}){let{t:o}=useTranslation(),r=useMemo(()=>t.marketData?.bluechipHoldingsRatio,[t.marketData?.bluechipHoldingsRatio]),n=useMemo(()=>r!==void 0&&new SafeBigNumber(r).gte(.1),[r]),s=useMemo(()=>r===void 0||new SafeBigNumber(r).lt(.05),[r]);return jsx(StyledTooltip,{content:o("tokens.bluechip.explained"),children:jsxs("div",{className:"flex items-center gap-2.5",children:[n&&jsx(HorsePowerHighIcon,{}),s&&jsx(HorsePowerLowIcon,{}),!n&&!s&&jsx(HorsePowerIcon,{}),jsx("span",{className:cn(n&&"text-bullish",!n&&!s&&"text-bearish",r===void 0&&"text-neutral"),children:formatPercent(r)})]})})});var ia=memo(function({token:t}){let o=useCopyToClipboard(),{t:r}=useTranslation(),n=useCallback(i=>{i.preventDefault(),i.stopPropagation(),o(t.address,()=>toast.success(r("tokens.copied.address")));},[o,t.address,r]),s=useTickAge(t.createdAt);return jsxs("div",{className:"w-full flex justify-start items-center gap-3",children:[jsx(de,{token:t,showProgress:false,className:"w-10 h-10 sm:w-16 sm:h-16 flex-none"}),jsxs("div",{className:"flex-auto flex flex-col gap-1 min-w-0",children:[jsxs("div",{className:"flex items-center gap-1",children:[jsx("span",{className:"flex-none font-medium tracking-[-0.02em]",children:t.symbol}),jsx(StyledTooltip,{content:t.name,children:jsxs("div",{className:"flex-initial flex items-center gap-1 min-w-0 text-neutral hover:text-primary-200 cursor-pointer",onClick:n,children:[jsx("div",{className:"flex-initial whitespace-nowrap truncate",children:t.name}),jsx(CopyIcon,{className:"flex-none w-3 h-3 sm:w-3.5 sm:h-3.5"})]})})]}),jsxs("div",{className:"flex items-center gap-2",children:[jsx("span",{className:"text-primary text-xs sm:text-sm font-medium",children:formatAge(s)}),t.socialMedias?.website&&jsx(Link,{href:t.socialMedias.website,className:"text-neutral hover:text-primary",target:"_blank",children:jsx(WebsiteIcon,{className:"w-3.5 h-3.5 sm:w-4 sm:h-4"})}),t.socialMedias?.twitter&&jsx(Link,{href:t.socialMedias.twitter,className:"text-neutral hover:text-primary",target:"_blank",children:jsx(TwitterIcon,{className:"w-3.5 h-3.5 sm:w-4 sm:h-4"})}),t.socialMedias?.telegram&&jsx(Link,{href:t.socialMedias.telegram,className:"text-neutral hover:text-primary",target:"_blank",children:jsx(TelegramIcon,{className:"w-3.5 h-3.5 sm:w-4 sm:h-4"})}),t.socialMedias?.discord&&jsx(Link,{href:t.socialMedias.discord,className:"text-neutral hover:text-primary",target:"_blank",children:jsx(DiscordIcon,{className:"w-3.5 h-3.5 sm:w-4 sm:h-4"})}),jsx(Link,{href:searchTwitterUrl(`${t.symbol} OR ${t.address}`),className:"text-neutral hover:text-primary",target:"_blank",children:jsx(SearchIcon,{className:"w-3.5 h-3.5 sm:w-4 sm:h-4"})})]})]})]})});var aa=memo(function({token:t}){let{t:o}=useTranslation(),r=t.marketData,n=useMemo(()=>new SafeBigNumber(r?.top10HoldingsRatio).gte(.1),[r?.top10HoldingsRatio]),s=useMemo(()=>new SafeBigNumber(r?.devHoldingsRatio).gte(.1),[r?.devHoldingsRatio]),i=useMemo(()=>new SafeBigNumber(r?.sniperHoldingsRatio).gte(.1),[r?.sniperHoldingsRatio]),l=useMemo(()=>new SafeBigNumber(r?.insiderHoldingsRatio).gte(.1),[r?.insiderHoldingsRatio]),a=useMemo(()=>new SafeBigNumber(r?.bundleHoldingsRatio).gte(.1),[r?.bundleHoldingsRatio]);return jsxs("div",{className:"w-full h-full flex flex-col gap-1 justify-center",children:[jsxs("div",{className:"flex items-center gap-1",children:[jsx($,{icon:jsx(PeopleIcon,{width:12,height:12}),value:formatAmount(r?.holders),tooltip:o("tokens.tokenInfo.holders"),warning:false,disable:!r?.holders}),jsx($,{icon:jsx(KlineCandlesIcon,{width:12,height:12}),value:formatAmount(r?.proHolders),tooltip:o("tokens.tokenInfo.proHolders"),warning:false,disable:!r?.proHolders}),jsx($,{icon:jsx(StarIcon,{width:12,height:12}),value:formatAmount(r?.kolHolders),tooltip:o("tokens.tokenInfo.kolHolders"),warning:false,disable:!r?.kolHolders}),jsx($,{icon:jsx(UserWithStarBadgeIcon,{width:12,height:12}),value:formatPercent(r?.top10HoldingsRatio),tooltip:o("tokens.tokenInfo.top10HoldingsRatio"),warning:n,disable:!r?.top10HoldingsRatio||r?.top10HoldingsRatio==="0"})]}),jsxs("div",{className:"flex items-center gap-1",children:[jsx($,{icon:jsx(CookIcon,{width:12,height:12}),value:formatPercent(r?.devHoldingsRatio),tooltip:o("tokens.tokenInfo.devHoldingsRatio"),warning:s,disable:!r?.devHoldingsRatio||r?.devHoldingsRatio==="0",tooltipPlacement:"bottom"}),jsx($,{icon:jsx(SniperIcon,{width:12,height:12}),value:formatPercent(r?.sniperHoldingsRatio),tooltip:o("tokens.tokenInfo.sniperHoldingsRatio"),warning:i,disable:!r?.sniperHoldingsRatio||r?.sniperHoldingsRatio==="0",tooltipPlacement:"bottom"}),jsx($,{icon:jsx(RatIcon,{width:12,height:12}),value:formatPercent(r?.insiderHoldingsRatio),tooltip:o("tokens.tokenInfo.insiderHoldingsRatio"),warning:l,disable:!r?.insiderHoldingsRatio||r?.insiderHoldingsRatio==="0",tooltipPlacement:"bottom"}),jsx($,{icon:jsx(BundlesIcon,{width:12,height:12}),value:formatPercent(r?.bundleHoldingsRatio),tooltip:o("tokens.tokenInfo.bundleHoldingsRatio"),warning:a,disable:!r?.bundleHoldingsRatio||r?.bundleHoldingsRatio==="0",tooltipPlacement:"bottom"})]})]})});var la=memo(function({token:t}){let o=useMemo(()=>t.marketData?.tvlInUsd,[t.marketData?.tvlInUsd]);return jsx(Fragment,{children:formatAmountUSD(o)})});var da=memo(function({token:t}){let o=useMemo(()=>t.marketData?.marketCapInUsd,[t.marketData?.marketCapInUsd]);return jsx(Fragment,{children:formatAmountUSD(o)})});var pa=memo(function({token:t,resolution:o}){let r=useMemo(()=>t.marketData?.priceInUsd,[t.marketData?.priceInUsd]),n=useMemo(()=>t.stats?.[o]?.priceChange,[t,o]),s=useMemo(()=>n?new SafeBigNumber(n).abs().toString():void 0,[n]),i=useMemo(()=>n&&new SafeBigNumber(n).gte(0),[n]);return jsxs("div",{className:"flex flex-col gap-1 justify-center items-start",children:[jsx("span",{children:formatPriceUSD(r)}),jsxs("span",{className:cn("inline-flex gap-1 items-center text-xs",i?"text-bullish":"text-bearish"),children:[i?jsx(TriangleUpIcon,{width:10,height:10}):jsx(TriangleDownIcon,{width:10,height:10}),jsx("span",{children:formatPercent(s)})]})]})});var fa=memo(function({token:t,resolution:o}){let r=useMemo(()=>t.stats?.[o]?.traders,[t.stats?.[o]?.traders]),n=useMemo(()=>t.stats?.[o]?.buyers,[t.stats?.[o]?.buyers]),s=useMemo(()=>t.stats?.[o]?.sellers,[t.stats?.[o]?.sellers]);return jsxs("div",{className:"flex flex-col gap-1 justify-center items-start",children:[jsx("span",{children:formatAmount(r)}),jsxs("div",{className:"flex gap-1 text-xs",children:[jsx("span",{className:"text-bullish",children:formatAmount(n)}),"/",jsx("span",{className:"text-bearish",children:formatAmount(s)})]})]})});var xa=memo(function({token:t,resolution:o}){let r=useMemo(()=>t.stats?.[o]?.trades,[t.stats?.[o]?.trades]),n=useMemo(()=>t.stats?.[o]?.buys,[t.stats?.[o]?.buys]),s=useMemo(()=>t.stats?.[o]?.sells,[t.stats?.[o]?.sells]);return jsxs("div",{className:"flex flex-col gap-1 justify-center items-start",children:[jsx("span",{children:formatAmount(r)}),jsxs("div",{className:"flex gap-1 text-xs",children:[jsx("span",{className:"text-bullish",children:formatAmount(n)}),"/",jsx("span",{className:"text-bearish",children:formatAmount(s)})]})]})});var ha=memo(function({token:t,resolution:o}){let r=useMemo(()=>t.stats?.[o]?.volumesInUsd,[t.stats?.[o]?.volumesInUsd]),n=useMemo(()=>t.stats?.[o]?.buyVolumesInUsd,[t.stats?.[o]?.buyVolumesInUsd]),s=useMemo(()=>t.stats?.[o]?.sellVolumesInUsd,[t.stats?.[o]?.sellVolumesInUsd]);return jsxs("div",{className:"flex flex-col gap-1 justify-center items-start",children:[jsx("span",{children:formatAmountUSD(r)}),jsxs("div",{className:"flex gap-1 text-xs",children:[jsx("span",{className:"text-bullish",children:formatAmountUSD(n)}),"/",jsx("span",{className:"text-bearish",children:formatAmountUSD(s)})]})]})});var zf=`
21
+ `})]})}function Kr({token:e,renderAction:t,isLast:o=false,onSelectToken:r,className:s}){let{t:n}=useTranslation(),i=useCopyToClipboard(),a=useTickAge(e.createdAt),l=e.marketData,d=e.stats?.["1h"],m=useCallback(()=>{r?.(e);},[r,e]),c=useCallback(U=>{U.stopPropagation(),i(e.address,()=>toast.success(n("tokens.copied.address")));},[i,e.address,n]),p=useMemo(()=>d?.volumesInUsd,[d?.volumesInUsd]),u=useMemo(()=>d?.buyVolumesInUsd,[d?.buyVolumesInUsd]),f=useMemo(()=>d?.sellVolumesInUsd,[d?.sellVolumesInUsd]),k=useMemo(()=>d?.trades,[d?.trades]),x=useMemo(()=>l?.marketCapInUsd,[l?.marketCapInUsd]),g=useMemo(()=>l?.tvlInUsd,[l?.tvlInUsd]),h=useMemo(()=>{let U=new SafeBigNumber(x);return U.lt(1e3)?"text-foreground":U.lt(1e6)?"text-secondary":"text-primary"},[x]),b=useMemo(()=>new SafeBigNumber(l?.top10HoldingsRatio).gte(.1),[l?.top10HoldingsRatio]),T=useMemo(()=>new SafeBigNumber(l?.devHoldingsRatio).gte(.1),[l?.devHoldingsRatio]),I=useMemo(()=>new SafeBigNumber(l?.insiderHoldingsRatio).gte(.1),[l?.insiderHoldingsRatio]),M=useMemo(()=>new SafeBigNumber(l?.sniperHoldingsRatio).gte(.1),[l?.sniperHoldingsRatio]),Q=useMemo(()=>new SafeBigNumber(l?.bundleHoldingsRatio).gte(.1),[l?.bundleHoldingsRatio]),[Se,_]=useMemo(()=>{let U=Number(d?.buys??0),P=Number(d?.sells??0),W=U+P;if(W===0)return [12,12];let ft=Math.round(U/W*24);return [ft,24-ft]},[d?.buys,d?.sells]),be=l?.holders!==void 0&&l.holders>0,Te=l?.proHolders!==void 0&&l.proHolders>0,F=l?.kolHolders!==void 0&&l.kolHolders>0,ne=be||Te||F;return jsxs("div",{className:cn("relative w-full h-full overflow-hidden px-4 py-3 hover:bg-content2/40 cursor-pointer border-b",s),style:o?void 0:{borderBottomColor:"rgba(39,39,42,0.6)"},onClick:r?m:void 0,children:[jsxs("div",{className:"flex items-start gap-2",children:[jsxs("div",{className:"flex-none flex flex-col items-center gap-2",children:[jsx(ce,{token:e,enableSearch:true,enablePreview:!!e.image,showProgress:true,className:"w-20 h-20"}),jsxs("button",{type:"button",className:"text-xs font-mono text-neutral hover:text-foreground leading-none",onClick:c,"aria-label":n("tokens.copied.address"),title:n("tokens.copied.address"),children:[e.address.slice(0,4),"...",e.address.slice(-4)]})]}),jsxs("div",{className:"flex-1 min-w-0 flex flex-col gap-2.5",children:[jsxs("button",{type:"button",className:"flex items-center gap-1.5 min-w-0 text-left",onClick:c,"aria-label":n("tokens.copied.address"),title:n("tokens.copied.address"),children:[jsx("span",{className:"flex-none text-sm font-semibold leading-none whitespace-nowrap overflow-hidden text-ellipsis max-w-24",children:e.symbol}),jsx(StyledTooltip,{content:e.name,children:jsx("span",{className:"text-[13px] leading-none text-neutral truncate max-w-20",children:e.name})}),jsx(CopyIcon,{className:"flex-none w-3.5 h-3.5 text-neutral"})]}),jsxs("div",{className:"flex items-center gap-2 leading-none",children:[jsx("span",{className:"text-[13px] font-mono font-medium text-neutral",children:formatAge(a)}),e.socialMedias?.website&&jsx(Link,{href:e.socialMedias.website,className:"text-neutral hover:text-primary",target:"_blank",onClick:U=>U.stopPropagation(),children:jsx(WebsiteIcon,{className:"w-3.5 h-3.5"})}),e.socialMedias?.twitter&&jsx(Link,{href:e.socialMedias.twitter,className:"text-neutral hover:text-primary",target:"_blank",onClick:U=>U.stopPropagation(),children:jsx(TwitterIcon,{className:"w-3.5 h-3.5"})}),e.socialMedias?.telegram&&jsx(Link,{href:e.socialMedias.telegram,className:"text-neutral hover:text-primary",target:"_blank",onClick:U=>U.stopPropagation(),children:jsx(TelegramIcon,{className:"w-3.5 h-3.5"})}),jsx(Link,{href:searchTwitterUrl(`${e.symbol} OR ${e.address}`),className:"max-sm:hidden text-neutral hover:text-primary",target:"_blank",onClick:U=>U.stopPropagation(),children:jsx(SearchIcon,{className:"w-3.5 h-3.5"})})]}),jsxs("div",{className:"flex items-center gap-2 text-xs font-mono text-foreground/80 leading-none",children:[jsxs("span",{className:"inline-flex items-baseline gap-1",children:[jsx("span",{className:"text-neutral",children:"MC"}),jsx("span",{className:cn(h),children:formatAmountUSDCompact(x)})]}),jsx("span",{className:"text-neutral/30",children:"\xB7"}),jsxs("span",{className:"inline-flex items-baseline gap-1",children:[jsx("span",{className:"text-neutral",children:"Liq"}),jsx("span",{children:formatAmountUSDCompact(g)})]})]}),ne&&jsxs("div",{className:"flex items-center gap-2 text-xs font-mono text-neutral leading-none",children:[be&&jsx(StyledTooltip,{content:n("tokens.tokenInfo.holders"),children:jsxs("span",{className:"inline-flex items-center gap-1",children:[jsx(PeopleIcon,{className:"w-3 h-3 text-neutral"}),formatAmount(l?.holders)]})}),Te&&jsx(StyledTooltip,{content:n("tokens.tokenInfo.proHolders"),children:jsxs("span",{className:"inline-flex items-center gap-1",children:[jsx(KlineCandlesIcon,{className:"w-3 h-3 text-neutral"}),formatAmount(l?.proHolders)]})}),F&&jsx(StyledTooltip,{content:n("tokens.tokenInfo.kolHolders"),children:jsxs("span",{className:"inline-flex items-center gap-1",children:[jsx(StarIcon,{className:"w-3 h-3 text-neutral"}),formatAmount(l?.kolHolders)]})})]})]}),jsxs("div",{className:"flex-none flex flex-col items-end gap-2.5 leading-none font-mono",children:[jsx("div",{className:"flex flex-col items-end gap-1",children:jsx("span",{className:cn("text-base font-bold leading-none",h),children:formatAmountUSDCompact(x)})}),jsxs("div",{className:"flex flex-col items-end gap-1",children:[jsxs("div",{className:"flex items-baseline gap-1",children:[jsx("span",{className:"text-xs text-neutral",children:"V"}),jsx("span",{className:"text-xs text-foreground/80",children:formatAmountUSDCompact(p)})]}),jsxs("span",{className:"text-[10px] leading-none",children:[jsx("span",{className:"text-bullish",children:formatAmountUSDCompact(u)}),jsx("span",{className:"text-neutral/50 mx-0.5",children:"/"}),jsx("span",{className:"text-bearish",children:formatAmountUSDCompact(f)})]})]}),jsxs("div",{className:"flex items-baseline gap-1",children:[jsx("span",{className:"text-xs text-neutral",children:"TX"}),jsx("span",{className:"text-xs text-foreground/80",children:formatAmount(k)})]})]})]}),jsxs("div",{className:"mt-2.5 flex items-start gap-4 relative",children:[jsx(HorizontalScrollContainer,{className:"flex-auto min-w-0",forceShowArrows:true,children:jsxs("div",{className:"flex items-center gap-1",children:[jsx($,{icon:jsx(UserWithStarBadgeIcon,{width:12,height:12}),value:formatPercent(l?.top10HoldingsRatio),tooltip:n("tokens.tokenInfo.top10HoldingsRatio"),warning:b,disable:!l?.top10HoldingsRatio||l?.top10HoldingsRatio==="0"}),jsx($,{icon:jsx(CookIcon,{width:12,height:12}),value:formatPercent(l?.devHoldingsRatio),tooltip:n("tokens.tokenInfo.devHoldingsRatio"),warning:T,disable:!l?.devHoldingsRatio||l?.devHoldingsRatio==="0"}),jsx($,{icon:jsx(SniperIcon,{width:12,height:12}),value:formatPercent(l?.sniperHoldingsRatio),tooltip:n("tokens.tokenInfo.sniperHoldingsRatio"),warning:M,disable:!l?.sniperHoldingsRatio||l?.sniperHoldingsRatio==="0"}),jsx($,{icon:jsx(RatIcon,{width:12,height:12}),value:formatPercent(l?.insiderHoldingsRatio),tooltip:n("tokens.tokenInfo.insiderHoldingsRatio"),warning:I,disable:!l?.insiderHoldingsRatio||l?.insiderHoldingsRatio==="0"}),jsx($,{icon:jsx(BundlesIcon,{width:12,height:12}),value:formatPercent(l?.bundleHoldingsRatio),tooltip:n("tokens.tokenInfo.bundleHoldingsRatio"),warning:Q,disable:!l?.bundleHoldingsRatio||l?.bundleHoldingsRatio==="0"})]})}),t&&jsx("div",{className:"flex-none relative",onClick:U=>U.stopPropagation(),children:t(e)})]})]})}var Jl=152,qr=10;function Yl({index:e,style:t,data:o,skeletonCount:r,renderItemAction:s,onSelectToken:n}){return o?jsx("div",{style:t,children:jsx(Kr,{token:o[e],isLast:e===o.length-1,renderAction:s,onSelectToken:n})}):jsx("div",{style:t,children:jsx(Rr,{isLast:e===r-1})})}function Ge({title:e,tokens:t,isLoading:o,itemHeight:r=Jl,renderHeaderExtra:s,renderItemAction:n,onSelectToken:i,onPauseChange:a,className:l,hideHeader:d}){let m=o||!t?void 0:t,c=m?m.length:qr,p=useMemo(()=>({data:m,skeletonCount:qr,renderItemAction:n,onSelectToken:i}),[m,n,i]),[u,f]=useState(false),k=useCallback(()=>{f(true),a?.(true);},[a]),x=useCallback(()=>{f(false),a?.(false);},[a]);return jsxs("div",{className:cn("w-full h-full bg-[#0a0a0b] overflow-hidden flex flex-col border border-[rgba(39,39,42,0.6)] rounded-lg",l),onMouseEnter:k,onMouseLeave:x,children:[!d&&jsx(Pr,{title:e,isPaused:u,extra:s}),jsx("div",{className:"flex-1 w-full overflow-hidden",children:jsx(List,{className:"h-full w-full",rowCount:c,rowHeight:r,rowComponent:Yl,rowProps:p,overscanCount:5})})]})}function Fo(e,t){let o={...e};for(let r of Object.keys(t))t[r]!==void 0&&(o[r]=t[r]);return o}var jl=["1m","5m","15m","30m","1h","4h","24h"];function ed(e,t){if(!t)return e;if(!e)return t;let o={...e};for(let r of jl)t[r]&&(o[r]=e[r]?Fo(e[r],t[r]):t[r]);return o}function td(e,t){return t?e?Fo(e,t):t:e}function Vt(e,t){return t?e?Fo(e,t):t:e}function X(e,t){let{chain:o,address:r,stats:s,marketData:n,socialMedias:i,security:a,launchedFrom:l,migratedTo:d,...m}=t,c={...e};for(let p of Object.keys(m))m[p]!==void 0&&(c[p]=m[p]);return c.stats=ed(e.stats,s),c.marketData=td(e.marketData,n),c.socialMedias=Vt(e.socialMedias,i),c.security=Vt(e.security,a),c.launchedFrom=Vt(e.launchedFrom,l),c.migratedTo=Vt(e.migratedTo,d),c}function Xe(e,t){let o=new Map(e.map(r=>[r.address,r]));return t.map(r=>{let s=o.get(r.address);return s?X(s,r):r})}function od(e){return e.chain!==void 0&&e.address!==void 0&&e.address!==""&&e.name!==void 0&&e.symbol!==void 0&&e.decimals!==void 0}function Ce(e,t){if(t.length===0)return e;let o=[...e],r=false;for(let s of t){let n=o.findIndex(i=>i.address===s.address);if(n>=0){o[n]=X(o[n],s),r=true;continue}od(s)&&(o.push(s),r=true);}return r?o:e}function Jr({chain:e,tokens:t,onUpdate:o,enabled:r=true}){let{subscribeClient:s}=useDexClient(),n=useRef(new Map),i=useRef(o);i.current=o;let a=useMemo(()=>Array.from(new Set(t.map(m=>m.address.trim()).filter(Boolean))).sort().join(","),[t]),l=useMemo(()=>a?a.split(","):[],[a]),d=()=>{n.current.forEach(m=>m.unsubscribe()),n.current.clear();};useEffect(()=>d,[e,s,r]),useEffect(()=>{if(!r){d();return}let m=new Set(l),c=n.current;for(let[p,u]of c)m.has(p)||(u.unsubscribe(),c.delete(p));for(let p of l)c.has(p)||c.set(p,s.subscribeToken(e,p,u=>{i.current(u);}));},[l,e,r,s]);}var id=80;function rn(e){return {chain:e.chain,address:e.address,name:e.name??"",symbol:e.symbol??"",decimals:e.decimals??0,image:e.image,description:e.description,socialMedias:e.socialMedias,launchedFrom:e.launchedFrom,migratedTo:e.migratedTo,createdAt:e.createdAt}}function ad(e,t,o){return e===t?o:e===o?t:o||t}function Uo(e){let t=e.token?.address??e.tokenAAddress??"",o=e.token;return {...o,chain:e.chain,address:t,name:o?.name??"",symbol:o?.symbol??"",decimals:o?.decimals??0,createdAt:o?.createdAt??e.createdAt,liquidities:[{poolAddress:e.poolAddress,pairAddress:ad(t,e.tokenAAddress,e.tokenBAddress),image:e.dex?.image,programAddress:e.dex?.programAddress,protocolFamily:e.dex?.protocolFamily,protocolName:e.dex?.protocolName}]}}function ld(e){return {...rn(Uo(e)),...e.token??{},liquidities:Uo(e).liquidities,createdAt:e.token?.createdAt??e.createdAt}}function on(e){return e.sort((t,o)=>{let r=t.createdAt?.getTime()??0;return (o.createdAt?.getTime()??0)-r}),e.slice(0,id)}function nn({chain:e,isPaused:t=false}){let o=useMemo(()=>({chain:e}),[e]),r=useRef(t);r.current=t;let s=useRef(e),[n,i]=useState(true),[a,l]=useState([]);useEffect(()=>{e!==s.current&&(i(true),l([]),s.current=e);},[e]);let{data:d,isPending:m}=useNewPoolsQuery(o);useEffect(()=>{d&&(l(f=>{let k=r.current,x=f.length===0&&d.length>0,g=[...f];for(let h of d){let b=ld(h),T=g.findIndex(I=>I.address===b.address);T>=0?g[T]=X(g[T],b):(!k||x)&&g.push(b);}return k?g:on(g)}),i(false));},[d]);let c=useCallback(f=>{l(k=>{let x=r.current,g=[...k],h=false;for(let b of f){let T=g.findIndex(I=>I.address===b.address);T>=0?(h=true,g[T]=X(g[T],b)):x||(h=true,g.push(rn(b)));}return h?x?g:on(g):k});},[]),p=useCallback(f=>{c(f.map(Uo));},[c]);useNewPoolsSubscription({chain:e},p),Jr({chain:e,tokens:a,onUpdate:c});let u=useMemo(()=>m||n,[m,n]);return {tokens:a,isLoading:u}}function Xk({chain:e,title:t,renderHeaderExtra:o,renderItemAction:r,onSelectToken:s,className:n,hideHeader:i}){let[a,l]=useState(false),{tokens:d,isLoading:m}=nn({chain:e,isPaused:a}),c=useCallback(p=>{l(p);},[]);return jsx(Ge,{title:t,tokens:d,isLoading:m,renderHeaderExtra:o,renderItemAction:r,onSelectToken:s,onPauseChange:c,className:n,hideHeader:i})}function we({chain:e,tokens:t,onUpdate:o,enabled:r=true}){let s=useMemo(()=>Array.from(new Set(t.map(i=>i.address.trim()).filter(Boolean))).sort().join(","),[t]),n=useMemo(()=>s?s.split(","):[],[s]);useTokensSubscription({chain:e,addresses:n},o,{enabled:r&&n.length>0});}function mn({chain:e,isPaused:t=false,refetchInterval:o=3e4}){let r=useMemo(()=>({chain:e}),[e]),s=useRef(t);s.current=t;let n=useRef(e),[i,a]=useState(true),[l,d]=useState([]);useEffect(()=>{e!==n.current&&(a(true),d([]),n.current=e);},[e]);let{data:m,isPending:c}=useMigratedTokensQuery(r,{refetchInterval:o});useEffect(()=>{m&&(d(f=>{let k=s.current,x=[...f];for(let g of m){let h=x.findIndex(b=>b.address===g.address);h>=0?x[h]=X(x[h],g):k||x.unshift(g);}return x}),a(false));},[m]);let p=useCallback(f=>{d(k=>Ce(k,f));},[]);we({chain:e,tokens:l,onUpdate:p});let u=useMemo(()=>c||i,[c,i]);return {tokens:l,isLoading:u}}function ch({chain:e,title:t,renderHeaderExtra:o,renderItemAction:r,onSelectToken:s,className:n,hideHeader:i}){let[a,l]=useState(false),{tokens:d,isLoading:m}=mn({chain:e,isPaused:a}),c=useCallback(p=>{l(p);},[]);return jsx(Ge,{title:t,tokens:d,isLoading:m,renderHeaderExtra:o,renderItemAction:r,onSelectToken:s,onPauseChange:c,className:n,hideHeader:i})}function Td(e){return e.sort((t,o)=>{let r=Number(t.migrateProgress??0);return Number(o.migrateProgress??0)-r})}function xn({chain:e,isPaused:t=false,refetchInterval:o=15e3}){let r=useMemo(()=>({chain:e}),[e]),s=useRef(t);s.current=t;let n=useRef(e),[i,a]=useState(true),[l,d]=useState([]);useEffect(()=>{e!==n.current&&(a(true),d([]),n.current=e);},[e]);let{data:m,isPending:c}=useFinalStretchTokensQuery(r,{refetchInterval:o});useEffect(()=>{m&&(d(f=>{let k=s.current,x=f.length===0&&m.length>0,g=[...f];for(let h of m){let b=g.findIndex(T=>T.address===h.address);b>=0?g[b]=X(g[b],h):(!k||x)&&g.push(h);}return k?g:Td(g)}),a(false));},[m]);let p=useCallback(f=>{d(k=>Ce(k,f));},[]);we({chain:e,tokens:l,onUpdate:p});let u=useMemo(()=>c||i,[c,i]);return {tokens:l,isLoading:u}}function vh({chain:e,title:t,renderHeaderExtra:o,renderItemAction:r,onSelectToken:s,className:n,hideHeader:i}){let[a,l]=useState(false),{tokens:d,isLoading:m}=xn({chain:e,isPaused:a}),c=useCallback(p=>{l(p);},[]);return jsx(Ge,{title:t,tokens:d,isLoading:m,renderHeaderExtra:o,renderItemAction:r,onSelectToken:s,onPauseChange:c,className:n,hideHeader:i})}var wd=10,Ld=atomWithStorage("liberfi:search_histories",[],void 0,{getOnInit:true});function _t(){let[e,t]=useAtom(Ld),o=useCallback(s=>{let n=s.trim();n&&t(i=>{let a=i.filter(l=>l!==n);return [n,...a].slice(0,wd)});},[t]),r=useCallback(()=>{t([]);},[t]);return {histories:e,addHistory:o,clearHistories:r}}function Tn({histories:e,onSelect:t,onClear:o,className:r}){let{t:s}=useTranslation();return e.length===0?null:jsxs("div",{className:cn("px-4 pb-4",r),children:[jsxs("div",{className:"flex items-center justify-between",children:[jsx("span",{className:"text-sm font-medium",children:s("tokens.search.history")}),jsx(Button,{isIconOnly:true,size:"sm",className:"bg-transparent min-w-6 w-6 h-6 text-neutral",onPress:o,children:jsx(TrashIcon,{width:20,height:20})})]}),jsx("div",{className:"flex flex-wrap gap-2 mt-2",children:e.map(n=>jsx(Chip,{size:"sm",variant:"bordered",className:cn("text-neutral","border-border border-1","cursor-pointer","hover:opacity-hover"),onClick:()=>t?.(n),children:n},n))})]})}function yn({onSelect:e,className:t}){let{histories:o,clearHistories:r}=_t();return jsx(Tn,{className:cn(t),histories:o,onSelect:e,onClear:r})}function vn({value:e,onValueChange:t,onClear:o,onEscape:r,className:s}){let{t:n}=useTranslation();return jsx("div",{className:s,children:jsx(StyledInput,{autoFocus:true,variant:"bordered",radius:"full",value:e,onValueChange:t,placeholder:n("tokens.search.placeholder"),classNames:{inputWrapper:["!bg-[rgba(39,39,42,0.6)]","!border-[rgba(63,63,70,0.5)]","data-[hover=true]:!bg-[rgba(39,39,42,1)]","group-data-[focus=true]:!bg-[rgba(39,39,42,1)]","group-data-[focus=true]:!border-[rgba(63,63,70,0.8)]"].join(" ")},startContent:jsx(SearchIcon,{width:20,height:20,className:"text-neutral"}),endContent:e?jsx(Button,{isIconOnly:true,className:"bg-transparent min-w-6 w-6 h-6 text-neutral",onPress:o,children:jsx(XCloseIcon,{width:20,height:20})}):jsx(Kbd,{className:"min-w-8 justify-center text-xs text-neutral bg-transparent border border-[rgba(63,63,70,0.5)] rounded-full cursor-pointer select-none",onMouseDown:i=>{i.preventDefault(),r?.();},children:"Esc"})})})}function $t({token:e,className:t}){let{t:o}=useTranslation(),r=useTickAge(e.createdAt),s=useMemo(()=>e.marketData?.priceInUsd,[e]),n=useMemo(()=>e.marketData?.marketCapInUsd,[e]),i=useMemo(()=>e.marketData?.tvlInUsd,[e]),a=useMemo(()=>e.stats?.["24h"]?.priceChange,[e]),l=useMemo(()=>a?new SafeBigNumber(a).abs().toString():void 0,[a]),d=useMemo(()=>a!=null&&new SafeBigNumber(a).gte(0),[a]);return jsxs("div",{className:cn("w-full h-full px-3 flex items-center justify-between gap-2","hover:cursor-pointer hover:bg-content2 rounded-lg",t),children:[jsxs("div",{className:"flex-1 min-w-0 flex items-center gap-2.5",children:[jsx(ce,{token:e,className:"w-10 h-10 flex-none",showProtocolFamily:true,classNames:{searchIcon:"w-5 h-5"}}),jsxs("div",{className:"flex-1 min-w-0 flex flex-col gap-0.5",children:[jsxs("div",{className:"flex items-center gap-1",children:[jsx("span",{className:"font-medium text-sm truncate",children:e.symbol}),jsx("span",{className:"text-xs text-primary font-medium",children:formatAge(r)})]}),jsxs("div",{className:"flex items-center gap-1 text-xs text-neutral",children:[jsxs("span",{children:[o("tokens.listHeader.mcShort")," ",formatAmountUSD(n)]}),jsx("span",{children:"/"}),jsxs("span",{children:[o("tokens.listHeader.liqShort")," ",formatAmountUSD(i)]})]})]})]}),jsxs("div",{className:"flex-none w-20 flex flex-col items-end",children:[jsx("span",{className:"text-xs",children:formatPriceUSD(s)}),jsxs("span",{className:cn("inline-flex gap-0.5 items-center text-xs",d?"text-bullish":"text-bearish"),children:[d?jsx(TriangleUpIcon,{width:8,height:8}):jsx(TriangleDownIcon,{width:8,height:8}),jsx("span",{children:formatPercent(l)})]})]})]})}function Kt({className:e}){let{t}=useTranslation();return jsxs("div",{className:cn("h-9 px-3 flex items-center justify-between","text-xs font-medium text-neutral","sticky top-0 z-10",e),children:[jsx("div",{className:"flex-1",children:jsxs("span",{children:[t("tokens.listHeader.token")," / ",t("tokens.listHeader.age")," /"," ",t("tokens.listHeader.marketCap")," /"," ",t("tokens.listHeader.liquidity")]})}),jsx("div",{className:"flex-none w-20 text-right",children:jsxs("span",{children:[t("tokens.listHeader.price")," / ",t("tokens.listHeader.24hChange")]})})]})}function Jd(){return jsxs("div",{className:"w-full h-14 px-3 flex items-center justify-between gap-2",children:[jsxs("div",{className:"flex-1 min-w-0 flex items-center gap-2",children:[jsx(Skeleton,{className:"flex-none w-8 h-8 rounded-full"}),jsxs("div",{className:"flex flex-col gap-1.5",children:[jsx(Skeleton,{className:"w-24 h-4 rounded-md"}),jsx(Skeleton,{className:"w-36 h-3 rounded-md"})]})]}),jsxs("div",{className:"flex-none w-20 flex flex-col items-end gap-1.5",children:[jsx(Skeleton,{className:"w-14 h-4 rounded-md"}),jsx(Skeleton,{className:"w-10 h-3 rounded-md"})]})]})}function qt({rows:e=6,className:t}){return jsx("div",{className:cn("w-full",t),children:Array.from({length:e}).map((o,r)=>jsx(Jd,{},r))})}function Pn({keyword:e,chains:t,limit:o=50}){let r=useMemo(()=>({keyword:e,chains:t,limit:o}),[e,t,o]),{data:s,isLoading:n,isFetchingNextPage:i,hasNextPage:a,fetchNextPage:l}=useSearchTokensInfiniteQuery(r,{enabled:!!e});return {tokens:useMemo(()=>s?.pages.flatMap(m=>m.data)??[],[s]),isLoading:n,isFetchingNextPage:i,hasNextPage:a??false,fetchNextPage:l}}var ic=56;function An({onSelectToken:e,className:t,...o}){let{tokens:r,isLoading:s,isFetchingNextPage:n,hasNextPage:i,fetchNextPage:a}=Pn(o),l=useRef(null),{height:d}=useResizeObserver({ref:l}),m=useCallback(f=>f<r.length,[r]),c=useCallback(async()=>{i&&!n&&await a();},[i,n,a]),p=useMemo(()=>i?r.length+1:r.length,[r,i]),u=useInfiniteLoader({isRowLoaded:m,loadMoreRows:c,rowCount:p,threshold:5});return s?jsxs("div",{className:cn("w-full",t),children:[jsx(Kt,{}),jsx(qt,{})]}):r.length===0?jsxs("div",{className:cn("w-full",t),children:[jsx(Kt,{}),jsx(lc,{})]}):jsxs("div",{className:cn("w-full h-full flex flex-col",t),children:[jsx(Kt,{className:"flex-none"}),jsx("div",{className:"flex-auto min-h-0",ref:l,children:jsx(List,{style:{height:d},onRowsRendered:u,rowComponent:ac,rowCount:p,rowHeight:ic,rowProps:{tokens:r,onSelectToken:e},overscanCount:5})})]})}function ac({index:e,style:t,tokens:o,onSelectToken:r}){let s=o[e];return s?jsx("div",{style:t,onClick:()=>r?.(s),children:jsx($t,{token:s})}):jsx("div",{style:t,className:"flex items-center justify-center",children:jsx(Spinner,{size:"sm"})})}function lc(){let{t:e}=useTranslation();return jsxs("div",{className:"flex flex-col items-center justify-center py-16",children:[jsx(EmptyIcon,{width:28,height:28,className:"text-neutral"}),jsx("p",{className:"mt-2 text-sm text-neutral",children:e("tokens.search.noResults")})]})}var cc=["24h","12h","30m","15m","30s","15s","1m","5m","1h","4h","1s"],mc=new Set(["price","marketCap","tvl","holders","top10Holdings","top10Ratio","top100Holdings","top100Ratio","creatorsHoldings","creatorsRatio","createdAt","launchedFromProtocolFamily","migratedToProtocolFamily","tag"]),pc=new Set(["priceChange","volumes","trades","traders","buys","sells"]);function J(e){if(e==null||e==="")return;let t=Number(e);return Number.isFinite(t)?t:void 0}function In(e){for(let t of cc){if(!e.endsWith(t))continue;let o=e.slice(0,-t.length);return o?{metric:o,resolution:t}:void 0}}function Mn(e){if(mc.has(e))return true;let t=In(e);return t?pc.has(t.metric):false}function Gt(e,t){switch(t){case "price":return J(e.marketData?.priceInUsd);case "marketCap":return J(e.marketData?.marketCapInUsd);case "tvl":return J(e.marketData?.tvlInUsd);case "holders":return J(e.marketData?.holders);case "top10Holdings":return J(e.marketData?.top10Holdings);case "top10Ratio":return J(e.marketData?.top10HoldingsRatio);case "top100Holdings":return J(e.marketData?.top100Holdings);case "top100Ratio":return J(e.marketData?.top100HoldingsRatio);case "creatorsHoldings":return J(e.marketData?.devHoldings);case "creatorsRatio":return J(e.marketData?.devHoldingsRatio);case "createdAt":return e.createdAt?.getTime();case "launchedFromProtocolFamily":return Hn(e,e.launchedFrom?.protocolFamily);case "migratedToProtocolFamily":return Hn(e,e.migratedTo?.protocolFamily);case "tag":return e.tags?.[0];}let o=In(t);if(!o)return;let r=e.stats?.[o.resolution];switch(o.metric){case "priceChange":return J(r?.priceChange);case "volumes":return J(r?.volumesInUsd);case "trades":return J(r?.trades);case "traders":return J(r?.traders);case "buys":return J(r?.buys);case "sells":return J(r?.sells);default:return}}function Hn(e,t){if(t)return parseTokenProtocolFamily(e.chain,t)??t}var uc=new Set(["top10Ratio","top100Ratio","creatorsRatio"]);function Fn(e){let t=e.trim().toLowerCase();return t.length>0?t:void 0}function fc(e){return [e.name,e.symbol].filter(Boolean).join(" ").toLowerCase()}function gc(e){return Array.isArray(e)?e:void 0}function xc(e){return Array.isArray(e)?void 0:e}function Un(e,t){if(!uc.has(e))return t;let o=Number(t);return Number.isFinite(o)?o/100:t}function me(e,t){let o=xc(t);return o===void 0?void 0:Un(e,o)}function Eo(e,t){return gc(t)?.map(o=>Un(e,o))}function Ze(e,t){if(typeof e=="number"){let o=Number(t);return Number.isFinite(o)?e-o:void 0}if(typeof e=="string")return e.localeCompare(String(t))}function Xt(e,t){if(typeof e=="number"){let o=Number(t);return Number.isFinite(o)&&e===o}return String(e)===String(t)}function kc(e,t){if(!Mn(t.field))return false;let o=Gt(e,t.field),r=o===void 0;if(t.operator==="isNull")return r;if(t.operator==="isNotNull")return !r;if(r)return false;switch(t.operator){case "eq":{let s=me(t.field,t.value);return s!==void 0&&Xt(o,s)}case "ne":{let s=me(t.field,t.value);return s!==void 0&&!Xt(o,s)}case "gt":{let s=me(t.field,t.value),n=s!==void 0?Ze(o,s):void 0;return n!==void 0&&n>0}case "gte":{let s=me(t.field,t.value),n=s!==void 0?Ze(o,s):void 0;return n!==void 0&&n>=0}case "lt":{let s=me(t.field,t.value),n=s!==void 0?Ze(o,s):void 0;return n!==void 0&&n<0}case "lte":{let s=me(t.field,t.value),n=s!==void 0?Ze(o,s):void 0;return n!==void 0&&n<=0}case "between":{let s=Eo(t.field,t.value);if(!s||s.length<2)return false;let n=Ze(o,s[0]),i=Ze(o,s[1]);return n!==void 0&&i!==void 0&&n>=0&&i<=0}case "in":{let s=Eo(t.field,t.value);return s?s.some(n=>Xt(o,n)):false}case "nin":{let s=Eo(t.field,t.value);return s?s.every(n=>!Xt(o,n)):false}case "contains":{let s=me(t.field,t.value);return s!==void 0&&String(o).includes(String(s))}case "notContains":{let s=me(t.field,t.value);return s!==void 0&&!String(o).includes(String(s))}case "startsWith":{let s=me(t.field,t.value);return s!==void 0&&String(o).startsWith(String(s))}case "endsWith":{let s=me(t.field,t.value);return s!==void 0&&String(o).endsWith(String(s))}default:return false}}function Jt(e,t){let o=t?.keywords?.map(Fn).filter(n=>n!==void 0),r=t?.excludeKeywords?.map(Fn).filter(n=>n!==void 0),s=t?.filters;return !o?.length&&!r?.length&&!s?.length?e:e.filter(n=>{let i=fc(n);return !(o?.length&&!o.some(a=>i.includes(a))||r?.length&&r.some(a=>i.includes(a))||s?.length&&!s.every(a=>kc(n,a)))})}function hc(e,t){return typeof e=="number"&&typeof t=="number"?e-t:String(e).localeCompare(String(t))}function Yt(e,t){let o=Object.keys(t??{})[0];if(!o)return e;let r=t?.[o];if(r!=="asc"&&r!=="desc")return e;let s=e.map((n,i)=>({token:n,index:i,value:Gt(n,o)}));return s.every(({value:n})=>n===void 0)?e:s.sort((n,i)=>{let a=n.value===void 0,l=i.value===void 0;if(a&&l)return n.index-i.index;if(a)return 1;if(l)return -1;let d=hc(n.value,i.value);return d===0?n.index-i.index:r==="asc"?d:-d}).map(({token:n})=>n)}function je({applyUpdates:e,paused:t=false,flushInterval:o=500}){let r=useRef(e),s=useRef(t),n=useRef([]),i=useRef(),a=useRef();r.current=e,s.current=t;let l=useCallback(()=>{i.current!==void 0&&(clearTimeout(i.current),i.current=void 0),a.current!==void 0&&(cancelAnimationFrame(a.current),a.current=void 0);},[]),d=useCallback(()=>{if(l(),s.current){i.current=setTimeout(d,o);return}let p=n.current;p.length!==0&&(n.current=[],r.current(p));},[l,o]),m=useCallback(()=>{i.current!==void 0||a.current!==void 0||(i.current=setTimeout(()=>{i.current=void 0,a.current=requestAnimationFrame(()=>{a.current=void 0,d();});},o));},[d,o]),c=useCallback(p=>{p.length!==0&&(n.current.push(...p),m());},[m]);return useEffect(()=>{t||d();},[d,t]),useEffect(()=>l,[l]),{enqueueUpdates:c,flush:d}}function eo({chain:e,resolution:t,filters:o,sortDirections:r,refetchInterval:s=12e3,deferUpdates:n=false,updateFlushInterval:i}){let a=useMemo(()=>({chain:e,resolution:t}),[e,t]),l=useRef(a),[d,m]=useState(true);useEffect(()=>{JSON.stringify(a)!==JSON.stringify(l.current)&&(m(true),l.current=a);},[a]);let[c,p]=useState([]),{data:u,isPending:f}=useTrendingTokensQuery(a,{refetchInterval:s});useEffect(()=>{u&&(p(T=>Xe(T,u)),m(false));},[u]);let k=useCallback(T=>{p(I=>Ce(I,T));},[]),{enqueueUpdates:x}=je({applyUpdates:k,paused:n,flushInterval:i});useTrendingTokensSubscription({chain:e},x),we({chain:e,tokens:c,onUpdate:x});let g=useMemo(()=>!!(f||d),[f,d]),h=useMemo(()=>Jt(c,o),[c,o]);return {tokens:useMemo(()=>Yt(h,r),[h,r]),isLoading:g}}var Cc=Chain.ETHEREUM,wc="24h",Lc=56;function Wn({chains:e,onSelectToken:t,className:o}){let r=e?.length===1?e[0]:e?.[0]??Cc,{tokens:s,isLoading:n}=eo({chain:r,resolution:wc});return jsx("div",{className:cn("w-full flex flex-col overflow-hidden",o),children:n?jsx(qt,{}):jsx("div",{className:"overflow-y-auto",children:s.map(i=>jsx("div",{style:{height:Lc},onClick:()=>t?.(i),children:jsx($t,{token:i,className:"h-full"})},i.address))})})}function _n({onKeywordChange:e}){let[t,o]=useState(""),[r,s]=useState(""),{addHistory:n}=_t(),i=useCallbackRef(e),a=useCallbackRef(n),l=useMemo(()=>debounce(p=>{s(p),i(p),p&&a(p);},500),[i,a]),d=useCallback(p=>{o(p),l(p);},[l]),m=useCallback(p=>{l.cancel(),o(p),s(p),i(p),p&&a(p);},[l,i,a]),c=useCallback(()=>m(""),[m]);return {text:t,keyword:r,setText:d,setKeyword:m,clearKeyword:c}}function Kn({chains:e,onKeywordChange:t,onSelectToken:o,onEscape:r}){let{text:s,keyword:n,setText:i,setKeyword:a,clearKeyword:l}=_n({onKeywordChange:t});return jsxs("div",{className:"w-full h-full flex flex-col gap-3",children:[jsx(vn,{value:s,onValueChange:i,onClear:l,onPaste:a,onEscape:r}),n?jsx(An,{className:"flex-auto min-h-0",keyword:n,chains:e,onSelectToken:o}):jsxs("div",{className:"flex-auto min-h-0 flex flex-col overflow-hidden",children:[jsx(yn,{onSelect:a}),jsx(Wn,{className:"flex-auto min-h-0",chains:e,onSelectToken:o})]})]})}var Bo="search";function hT({id:e=Bo}){return jsx(AsyncModal,{id:e,children:t=>jsx(Bc,{...t})})}function Bc({params:e,isOpen:t,onOpenChange:o,onResult:r}){let{t:s}=useTranslation(),{isMobile:n}=useScreen(),i=useCallback(a=>{r(a);},[r]);return jsx(StyledModal,{isOpen:t,onOpenChange:o,size:n?"full":"lg",hideCloseButton:true,backdrop:"blur",radius:"lg",children:jsxs(ModalContent,{className:"w-full h-full",style:{borderRadius:n?void 0:14,border:n?void 0:"1px solid rgba(39,39,42,1)",background:"rgba(24,24,27,1)",boxShadow:n?void 0:"0 25px 50px -12px rgba(0,0,0,0.5)",overflow:"hidden"},children:[jsxs(ModalHeader,{className:"sm:hidden flex items-center justify-between pt-4 pb-2",children:[jsx("span",{className:"text-base font-semibold",children:s("tokens.search.title")}),jsx(Button,{isIconOnly:true,onPress:()=>o(false),size:"sm",className:"bg-transparent min-w-6 w-6 h-6",children:jsx(XCloseIcon,{width:20,height:20})})]}),jsx(ModalBody,{className:"p-4",children:jsx(Kn,{chains:e?.chains,onSelectToken:i,onEscape:()=>o(false)})})]})})}function LT({chains:e,onSelectToken:t,className:o}){let{t:r}=useTranslation(),{isDesktop:s}=useScreen(),{onOpen:n,onClose:i}=useAsyncModal(Bo),a=useCallbackRef(t),l=useCallbackRef(async()=>{let m=await n({params:{chains:e}});m&&a(m);}),d=useCallbackRef(()=>{i();});return useEffect(()=>{let m=c=>{let p=document.activeElement,u=!!p&&(p.tagName==="INPUT"||p.tagName==="TEXTAREA"||p.getAttribute("contenteditable")==="true");c.key==="/"&&!u&&(c.preventDefault(),l()),c.key==="Escape"&&(c.preventDefault(),d());};return window.addEventListener("keydown",m),()=>{window.removeEventListener("keydown",m);}},[l,d]),s?jsx(Button,{size:"sm",radius:"full",onPress:l,variant:"bordered",startContent:jsx(SearchIcon,{width:16,height:16,className:"text-foreground"}),endContent:jsx(Kbd,{className:"min-w-6 justify-center text-xs text-foreground bg-content3 rounded-lg",children:"/"}),className:cn("w-56 min-w-0 h-8 min-h-0 border-transparent hover:border-border bg-content2 pl-3 pr-1.5 text-neutral",o),children:r("tokens.search.placeholder")}):jsx(Button,{size:"sm",radius:"full",isIconOnly:true,onPress:l,variant:"bordered",className:cn("w-8 min-w-0 h-8 min-h-0 border-1 border-border bg-content2",o),children:jsx(SearchIcon,{width:16,height:16,className:"text-foreground"})})}function Oe(e){return e==null||e===""?"--":formatPercent(Number(e)/100)}function pe(e,t=4,o=4){return e?e.length<=t+o+1?e:`${e.slice(0,t)}\u2026${e.slice(-o)}`:"--"}function Ne(e,t=Date.now()){if(e==null)return "--";let o=typeof e=="string"||typeof e=="number"?new Date(e):e,r=typeof t=="number"?new Date(t):t,s=Math.max(0,Math.floor((r.getTime()-o.getTime())/1e3));if(s<60)return `${s}s`;let n=Math.floor(s/60);if(n<60)return `${n}m`;let i=Math.floor(n/60);if(i<24)return `${i}h`;let a=Math.floor(i/24);if(a<30)return `${a}d`;let l=Math.floor(a/30);return l<12?`${l}mo`:`${Math.floor(a/365)}y`}function A(e,t){let{data:o,isLoading:r}=useTokenQuery({chain:e,address:t}),[s,n]=useState(o);return useEffect(()=>{o&&n(o);},[o]),useTokenSubscription({chain:e,address:t},i=>{i?.length&&n(a=>{if(!a)return a;let l=a;for(let d of i)l=X(l,d);return l});}),{token:s,isLoading:r}}function et({label:e,totalFormatted:t,buysFormatted:o,sellsFormatted:r,totalValue:s=0,buysValue:n=0,className:i}){let a=new SafeBigNumber(s??0),l=new SafeBigNumber(n??0),d=a.eq(0)?0:l.div(a).times(100).toNumber();return jsxs("div",{className:cn("flex flex-col gap-1",i),children:[jsxs("div",{className:"flex items-baseline justify-between",children:[jsx("span",{className:"text-xs text-default-500",children:e}),jsx("span",{className:"text-xs text-foreground",children:t})]}),jsx(Progress,{size:"sm",value:d,classNames:{track:"bg-bearish/40",indicator:"bg-bullish"},"aria-label":`${e} buy share`}),jsxs("div",{className:"flex justify-between gap-4 text-[10px]",children:[jsxs("span",{className:"text-bullish",children:["Buys: ",o]}),jsxs("span",{className:"text-bearish",children:["Sells: ",r]})]})]})}function Jn({token:e,actions:t,dataStrip:o,className:r,onCopyAddress:s}){let n=e?.address;return jsxs("div",{className:cn("flex w-full flex-wrap items-center gap-4 px-4 py-3",r),children:[jsxs("div",{className:"flex min-w-0 items-center gap-3",children:[e&&jsx(ce,{token:e,radius:"lg",className:"h-10 w-10"}),jsxs("div",{className:"flex min-w-0 flex-col gap-0.5",children:[jsxs("div",{className:"flex items-center gap-2",children:[jsx("span",{className:"truncate text-base font-semibold text-foreground",children:e?.symbol??"--"}),jsx("span",{className:"truncate text-xs text-default-400",children:e?.name})]}),n&&jsxs("button",{type:"button",onClick:()=>s?.(n),className:"flex items-center gap-1 text-[11px] text-default-400 transition-colors hover:text-foreground",title:n,children:[pe(n,6,6),jsx(CopyIcon,{width:12,height:12})]})]})]}),o&&jsx("div",{className:"flex-1 min-w-0",children:o}),t&&jsx("div",{className:"ml-auto flex items-center gap-2",children:t})]})}function Yn(e,t){return A(e,t)}function jn({price:e,marketCap:t,volume:o,holdersCount:r,socialMedia:s,className:n}){return jsxs("div",{className:cn("flex flex-wrap items-center gap-x-6 gap-y-3",n),children:[e,jsxs("div",{className:"flex flex-wrap items-center gap-x-6 gap-y-3",children:[t,o,r]}),jsx("div",{className:"ml-auto",children:s})]})}function ky(e,t){return A(e,t)}function ts({holders:e,top10HoldingsRatio:t,top100HoldingsRatio:o,className:r}){return jsxs("div",{className:cn("flex flex-col items-start justify-center gap-0.5",r),children:[jsxs("div",{className:"text-xs font-medium text-default-500",children:[jsx("span",{className:"text-foreground",children:e!=null?formatAmount(e):"--"}),jsx("span",{className:"px-1",children:"/"}),jsx("span",{children:Oe(t)}),jsx("span",{className:"px-1",children:"/"}),jsx("span",{children:Oe(o)})]}),jsx("div",{className:"text-[10px] text-default-400",children:"Holders / Top10 / Top100"})]})}function os(e,t){return A(e,t)}function rs({chain:e,address:t,className:o}){let{token:r}=os(e,t);return jsx(ts,{holders:r?.marketData?.holders,top10HoldingsRatio:r?.marketData?.top10HoldingsRatio,top100HoldingsRatio:r?.marketData?.top100HoldingsRatio,className:o})}function is({marketCapInUsd:e,tvlInUsd:t,createdAt:o,className:r}){return jsxs("div",{className:cn("flex flex-col items-start justify-center gap-0.5",r),children:[jsxs("div",{className:"text-xs font-medium text-default-500",children:[jsx("span",{className:"text-foreground",children:e?formatAmountUSDCompact(e):"--"}),jsx("span",{className:"px-1",children:"/"}),jsx("span",{children:t?formatAmountUSDCompact(t):"--"}),jsx("span",{className:"px-1",children:"/"}),jsx("span",{children:Ne(o)})]}),jsx("div",{className:"text-[10px] text-default-400",children:"MC / Liq / Age"})]})}function as(e,t){return A(e,t)}function ls({chain:e,address:t,className:o}){let{token:r}=as(e,t);return jsx(is,{marketCapInUsd:r?.marketData?.marketCapInUsd,tvlInUsd:r?.marketData?.tvlInUsd,createdAt:r?.createdAt,className:o})}function ms({priceInUsd:e,price24hAgoInUsd:t,className:o}){let{bearish:r,priceChange:s}=useMemo(()=>{if(!e||!t)return {bearish:false,priceChange:void 0};let n=new SafeBigNumber(e),i=new SafeBigNumber(t);return i.lte(0)?{bearish:false,priceChange:void 0}:{bearish:n.lt(i),priceChange:n.minus(i).div(i).abs().toNumber()}},[e,t]);return jsxs("div",{className:cn("group flex flex-col gap-1",o),"data-bearish":r,children:[jsx("div",{className:"text-base font-medium leading-none text-bullish group-data-[bearish=true]:text-bearish",children:e?formatPriceUSD(e):"--"}),jsxs("div",{className:"flex items-center gap-2 text-[10px] leading-none",children:[jsx("span",{className:"text-default-400",children:"24h"}),jsx("span",{className:"text-bullish group-data-[bearish=true]:text-bearish",children:s!=null?formatPercent(s):"--"})]})]})}function ps(e,t){return A(e,t)}function us({chain:e,address:t,className:o}){let{token:r}=ps(e,t);return jsx(ms,{priceInUsd:r?.marketData?.priceInUsd,price24hAgoInUsd:r?.stats?.["24h"]?.openPriceInUsd,className:o})}function hm(e,t){switch(e){case "website":return jsx(WebsiteIcon,{width:t,height:t});case "twitter":return jsx(TwitterIcon,{width:t,height:t});case "telegram":return jsx(TelegramIcon,{width:t,height:t});case "discord":return jsx(DiscordIcon,{width:t,height:t});default:return jsx("span",{className:"text-[9px] font-medium uppercase",children:e.slice(0,2)})}}function fs({socials:e,className:t,iconSize:o=16}){if(!e)return null;let s=["website","twitter","telegram","discord","github","reddit","youtube","medium"].filter(n=>!!e[n]);return s.length===0?null:jsx("div",{className:cn("flex items-center gap-3",t),children:s.map(n=>jsx("a",{href:e[n],target:"_blank",rel:"noreferrer noopener",className:"flex items-center justify-center text-default-400 transition-colors hover:text-foreground",style:{width:o,height:o},children:hm(n,o)},n))})}function gs(e,t){return A(e,t)}function xs({chain:e,address:t,className:o,iconSize:r}){let{token:s}=gs(e,t);return jsx(fs,{socials:s?.socialMedias,className:o,iconSize:r})}function bs({volumesInUsd:e,trades:t,traders:o,className:r}){return jsxs("div",{className:cn("flex flex-col items-start justify-center gap-0.5",r),children:[jsxs("div",{className:"text-xs font-medium text-default-500",children:[jsx("span",{className:"text-foreground",children:e?formatAmountUSDCompact(e):"--"}),jsx("span",{className:"px-1",children:"/"}),jsx("span",{children:t!=null?formatAmount(t):"--"}),jsx("span",{className:"px-1",children:"/"}),jsx("span",{children:o!=null?formatAmount(o):"--"})]}),jsx("div",{className:"text-[10px] text-default-400",children:"24h Vol / Txs / Traders"})]})}function Ts(e,t){return A(e,t)}function ys({chain:e,address:t,className:o}){let{token:r}=Ts(e,t),s=r?.stats?.["24h"];return jsx(bs,{volumesInUsd:s?.volumesInUsd,trades:s?.trades,traders:s?.traders,className:o})}function vs({chain:e,address:t,className:o}){return jsx(jn,{className:o,price:jsx(us,{chain:e,address:t}),marketCap:jsx(ls,{chain:e,address:t}),volume:jsx(ys,{chain:e,address:t}),holdersCount:jsx(rs,{chain:e,address:t}),socialMedia:jsx(xs,{chain:e,address:t})})}function Zv({chain:e,address:t,actions:o,dataStrip:r,className:s,onCopyAddress:n}){let{token:i}=Yn(e,t);return jsx(Jn,{token:i,actions:o,dataStrip:r===void 0?jsx(vs,{chain:e,address:t}):r,className:s,onCopyAddress:n})}var Cm=[{value:"holdingUsd",label:"Value"},{value:"lastActiveAt",label:"Last active"}];function Cs({holders:e,isLoading:t,sortBy:o,onSortByChange:r,onlyTracked:s=false,onOnlyTrackedChange:n,onLoadMore:i,hasMore:a,now:l=Date.now(),wellKnownAddresses:d,className:m,renderAddress:c}){let p=s?e.filter(u=>u.tags&&u.tags.length>0):e;return jsxs("div",{className:cn("flex flex-col",m),children:[jsxs("div",{className:"flex items-center justify-between gap-4 px-3 py-2",children:[jsxs("div",{className:"flex items-center gap-3",children:[jsx("span",{className:"text-xs font-medium text-default-500",children:"Holders"}),jsxs("label",{className:"flex cursor-pointer items-center gap-1 text-[11px] text-default-400",children:[jsx("input",{type:"checkbox",className:"size-3 accent-primary",checked:s,onChange:u=>n?.(u.target.checked)}),"Only Tracked"]})]}),jsx("div",{className:"flex items-center gap-1",children:Cm.map(u=>jsx("button",{type:"button",onClick:()=>r(u.value),className:cn("rounded px-2 py-1 text-[11px] transition-colors",o===u.value?"bg-default-100 text-foreground":"text-default-400 hover:text-foreground"),children:u.label},u.value))})]}),jsx("div",{className:"overflow-x-auto",children:jsxs("table",{className:"w-full min-w-[640px] table-fixed text-[12px]",children:[jsx("thead",{className:"text-default-400",children:jsxs("tr",{className:"border-b border-default-100",children:[jsx("th",{className:"w-[30%] px-3 py-2 text-left font-normal",children:"Wallet"}),jsx("th",{className:"w-[20%] px-3 py-2 text-left font-normal",children:"Tags"}),jsx("th",{className:"w-[15%] px-3 py-2 text-right font-normal",children:"Value"}),jsx("th",{className:"w-[10%] px-3 py-2 text-right font-normal",children:"%"}),jsx("th",{className:"w-[12%] px-3 py-2 text-right font-normal",children:"First held"}),jsx("th",{className:"w-[13%] px-3 py-2 text-right font-normal",children:"Last active"})]})}),jsxs("tbody",{children:[p.length===0&&!t&&jsx("tr",{children:jsx("td",{colSpan:6,className:"py-8 text-center text-default-400",children:"No holders"})}),p.map(u=>jsx(wm,{holder:u,now:l,wellKnownAddresses:d,renderAddress:c},u.address)),t&&jsx("tr",{children:jsx("td",{colSpan:6,className:"py-4 text-center text-default-400",children:"Loading\u2026"})})]})]})}),a&&jsx("div",{className:"flex justify-center px-3 py-2",children:jsx("button",{type:"button",onClick:i,disabled:t,className:"rounded bg-default-100 px-3 py-1 text-[11px] text-default-600 transition-colors hover:bg-default-200 disabled:opacity-50",children:"Load more"})})]})}function wm({holder:e,now:t,wellKnownAddresses:o,renderAddress:r}){let s=o?.[e.address],n=useMemo(()=>r?r(e.address):s?jsx("span",{className:"rounded bg-default-100 px-1.5 py-0.5 text-[10px] font-semibold uppercase tracking-wide text-default-600",children:s}):jsx("span",{className:"font-mono text-[11px] text-default-500",children:pe(e.address,6,6)}),[e.address,r,s]);return jsxs("tr",{className:"border-b border-default-50 hover:bg-default-50/60",children:[jsx("td",{className:"px-3 py-2 align-middle",children:n}),jsx("td",{className:"px-3 py-2 align-middle",children:jsx(Ot,{tags:e.tags,max:3})}),jsx("td",{className:"px-3 py-2 text-right align-middle text-foreground",children:formatAmountUSDCompact(e.amountInUsd)}),jsx("td",{className:"px-3 py-2 text-right align-middle text-default-500",children:Oe(e.ratio)}),jsx("td",{className:"px-3 py-2 text-right align-middle text-default-400",children:e.startHoldingAt?Ne(e.startHoldingAt,t):"--"}),jsx("td",{className:"px-3 py-2 text-right align-middle text-default-400",children:e.lastActiveAt?Ne(e.lastActiveAt,t):"--"})]})}function Ps({chain:e,address:t,limit:o=50,initialSortBy:r="holdingUsd"}){let[s,n]=useState(r),[i,a]=useState(void 0),[l,d]=useState([]),m=useCallback(()=>{a(void 0),d([]);},[]),c=useCallback(T=>{T!==s&&(n(T),m());},[s,m]);useEffect(()=>{m();},[e,t,m]);let p=useMemo(()=>({chain:e,address:t,cursor:i,limit:o,sortBy:s}),[e,t,i,o,s]),{data:u,isPending:f,isFetching:k}=useTokenHoldersQuery(p);useEffect(()=>{u&&d(T=>i==null?[u]:T[T.length-1]?.endCursor===u.endCursor?T:[...T,u]);},[u,i]),useTokenSubscription({chain:e,address:t},()=>{});let x=useMemo(()=>l.flatMap(T=>T.data),[l]),g=l[l.length-1],h=!!(g?.hasNext&&g.endCursor),b=useCallback(()=>{!g?.endCursor||!g.hasNext||a(g.endCursor);},[g]);return {holders:x,isLoading:f||k,sortBy:s,setSortBy:c,hasMore:h,loadMore:b}}function b0({chain:e,address:t,limit:o,initialSortBy:r,initialOnlyTracked:s=false,wellKnownAddresses:n,className:i,renderAddress:a}){let[l,d]=useState(s),{holders:m,isLoading:c,sortBy:p,setSortBy:u,hasMore:f,loadMore:k}=Ps({chain:e,address:t,limit:o,initialSortBy:r});return jsx(Cs,{holders:m,isLoading:c,sortBy:p,onSortByChange:u,onlyTracked:l,onOnlyTrackedChange:d,wellKnownAddresses:n,hasMore:f,onLoadMore:k,className:i,renderAddress:a})}var Mm=[{value:"timestamp",label:"Latest"},{value:"totalUsd",label:"Top USD"}],Fm=[{value:"all",label:"All"},{value:"buy",label:"Buys"},{value:"sell",label:"Sells"}],Um=[{value:"all",label:"All"},{value:"dev",label:"DEV"},{value:"tracked",label:"TRACKED"},{value:"you",label:"YOU"}];function Rs({activities:e,isLoading:t,sortBy:o,onSortByChange:r,typeFilter:s="all",onTypeFilterChange:n,traderFilter:i="all",onTraderFilterChange:a,youWalletAddress:l,currency:d="usd",onCurrencyChange:m,onLoadMore:c,hasMore:p,now:u=Date.now(),nativeDecimals:f=9,nativeSymbol:k="SOL",className:x,onRowClick:g}){let h=Dm(e,i,l);return jsxs("div",{className:cn("flex flex-col",x),children:[jsxs("div",{className:"flex flex-wrap items-center justify-between gap-2 px-3 py-2",children:[jsxs("div",{className:"flex items-center gap-1",children:[Fm.map(b=>jsx("button",{type:"button",onClick:()=>n?.(b.value),className:cn("rounded px-2 py-1 text-[11px] transition-colors",s===b.value?"bg-default-100 text-foreground":"text-default-400 hover:text-foreground"),children:b.label},b.value)),jsx("span",{className:"mx-1 h-3 w-px bg-default-200","aria-hidden":true}),Um.map(b=>{let T=i===b.value,I=b.value==="you"&&!l;return jsx("button",{type:"button",disabled:I,onClick:()=>a?.(b.value),className:cn("rounded px-2 py-1 text-[11px] transition-colors",T?"bg-default-100 text-foreground":"text-default-400 hover:text-foreground",I&&"cursor-not-allowed opacity-50"),children:b.label},b.value)})]}),jsxs("div",{className:"flex items-center gap-2",children:[jsx(Em,{value:d,nativeSymbol:k,onChange:m}),jsx("div",{className:"flex items-center gap-1",children:Mm.map(b=>jsx("button",{type:"button",onClick:()=>r(b.value),className:cn("rounded px-2 py-1 text-[11px] transition-colors",o===b.value?"bg-default-100 text-foreground":"text-default-400 hover:text-foreground"),children:b.label},b.value))})]})]}),jsx("div",{className:"overflow-x-auto",children:jsxs("table",{className:"w-full min-w-[780px] table-fixed text-[12px]",children:[jsx("thead",{className:"text-default-400",children:jsxs("tr",{className:"border-b border-default-100",children:[jsx("th",{className:"w-[10%] px-3 py-2 text-left font-normal",children:"Side"}),jsx("th",{className:"w-[25%] px-3 py-2 text-left font-normal",children:"Trader"}),jsx("th",{className:"w-[15%] px-3 py-2 text-right font-normal",children:"Amount"}),jsx("th",{className:"w-[15%] px-3 py-2 text-right font-normal",children:"USD"}),jsx("th",{className:"w-[15%] px-3 py-2 text-right font-normal",children:"Price"}),jsx("th",{className:"w-[10%] px-3 py-2 text-right font-normal",children:"Gas"}),jsx("th",{className:"w-[10%] px-3 py-2 text-right font-normal",children:"Age"})]})}),jsxs("tbody",{children:[h.length===0&&!t&&jsx("tr",{children:jsx("td",{colSpan:7,className:"py-8 text-center text-default-400",children:"No activities"})}),h.map(b=>jsx(Bm,{activity:b,now:u,nativeDecimals:f,nativeSymbol:k,currency:d,onRowClick:g},b.txHash)),t&&jsx("tr",{children:jsx("td",{colSpan:7,className:"py-4 text-center text-default-400",children:"Loading\u2026"})})]})]})}),p&&jsx("div",{className:"flex justify-center px-3 py-2",children:jsx("button",{type:"button",onClick:c,disabled:t,className:"rounded bg-default-100 px-3 py-1 text-[11px] text-default-600 transition-colors hover:bg-default-200 disabled:opacity-50",children:"Load more"})})]})}function Om(e){return e.type==="buy"?e.to:e.type==="sell"?e.from:e.to}function Dm(e,t,o){if(t==="all")return e;if(t==="you"){if(!o)return [];let s=o.toLowerCase();return e.filter(n=>n.walletAddress?.toLowerCase()===s)}if(t==="dev")return e.filter(s=>s.traderTags?.some(n=>n==="dev"));let r=new Set(["kol","smart","bluechip"]);return e.filter(s=>s.traderTags?.some(n=>r.has(n)))}function Em({value:e,nativeSymbol:t,onChange:o}){return jsx("div",{className:"flex h-[22px] items-center rounded bg-default-100 p-[2px] text-[11px]",children:[{k:"usd",label:"USD"},{k:"native",label:t}].map(s=>jsx("button",{type:"button",onClick:()=>o?.(s.k),className:cn("rounded px-2 transition-colors",e===s.k?"bg-default-200 text-foreground":"text-default-400 hover:text-foreground"),children:s.label},s.k))})}function Wm(e,t,o){if(!e)return "--";let r=Number(e)/Math.pow(10,t);return Number.isFinite(r)?`${formatAmount(r)} ${o}`:"--"}function Bm({activity:e,now:t,nativeDecimals:o,nativeSymbol:r,currency:s,onRowClick:n}){let i=Om(e),a=e.type==="buy"?"Buy":e.type==="sell"?"Sell":e.type.replace(/_/g," "),l=e.type==="buy"?"text-bullish":e.type==="sell"?"text-bearish":"text-default-500";return jsxs("tr",{className:cn("border-b border-default-50 hover:bg-default-50/60",n&&"cursor-pointer"),onClick:n?()=>n(e):void 0,children:[jsx("td",{className:cn("px-3 py-2 align-middle font-medium capitalize",l),children:a}),jsx("td",{className:"px-3 py-2 align-middle",children:jsxs("div",{className:"flex flex-col gap-0.5",children:[jsx("span",{className:"font-mono text-[11px] text-default-500",children:pe(e.walletAddress,6,6)}),jsx(Mr,{tags:e.traderTags,max:2})]})}),jsxs("td",{className:"px-3 py-2 text-right align-middle",children:[formatAmount(i.amount)," ",i.symbol]}),jsx("td",{className:"px-3 py-2 text-right align-middle text-foreground",children:s==="native"&&i.amountInNative?`${formatAmount(i.amountInNative)} ${i.symbol}`:i.amountInUsd?formatAmountUSDCompact(i.amountInUsd):"--"}),jsx("td",{className:"px-3 py-2 text-right align-middle text-default-500",children:i.priceInUsd?`$${formatPrice(i.priceInUsd)}`:"--"}),jsx("td",{className:"px-3 py-2 text-right align-middle text-default-400",children:Wm(e.gasFee,o,r)}),jsx("td",{className:"px-3 py-2 text-right align-middle text-default-400",children:Ne(e.time,t)})]})}function Is({chain:e,address:t,limit:o=50,initialSortBy:r="timestamp",initialTypeFilter:s="all"}){let[n,i]=useState(r),[a,l]=useState(s),[d,m]=useState(void 0),[c,p]=useState([]),[u,f]=useState([]),k=useCallback(()=>{m(void 0),p([]),f([]);},[]),x=useCallback(F=>{F!==n&&(i(F),k());},[n,k]),g=useCallback(F=>{F!==a&&(l(F),k());},[a,k]);useEffect(()=>{k();},[e,t,k]);let h=a==="all"?void 0:a,b=useMemo(()=>({chain:e,address:t,cursor:d,limit:o,sortBy:n,type:h}),[e,t,d,o,n,h]),{data:T,isPending:I,isFetching:M}=useTokenActivitiesQuery(b);useEffect(()=>{T&&p(F=>d==null?[T]:F[F.length-1]?.endCursor===T.endCursor?F:[...F,T]);},[T,d]);let Q=n==="timestamp"&&a==="all"&&d==null;useTokenActivitiesSubscription({chain:e,address:t},F=>{!Q||!F?.length||f(ne=>{let U=new Set(ne.map(W=>W.txHash)),P=F.filter(W=>!U.has(W.txHash));return P.length===0?ne:[...P,...ne].slice(0,100)});});let Se=useMemo(()=>{let F=c.flatMap(P=>P.data);if(!Q||u.length===0)return F;let ne=new Set(F.map(P=>P.txHash));return [...u.filter(P=>!ne.has(P.txHash)),...F]},[c,u,Q]),_=c[c.length-1],be=!!(_?.hasNext&&_.endCursor),Te=useCallback(()=>{!_?.endCursor||!_.hasNext||m(_.endCursor);},[_]);return {activities:Se,isLoading:I||M,sortBy:n,setSortBy:x,typeFilter:a,setTypeFilter:g,hasMore:be,loadMore:Te}}function E0({chain:e,address:t,limit:o,initialSortBy:r,initialTypeFilter:s,initialTraderFilter:n="all",initialCurrency:i="usd",youWalletAddress:a,nativeDecimals:l,nativeSymbol:d,className:m,onRowClick:c}){let[p,u]=useState(n),[f,k]=useState(i),{activities:x,isLoading:g,sortBy:h,setSortBy:b,typeFilter:T,setTypeFilter:I,hasMore:M,loadMore:Q}=Is({chain:e,address:t,limit:o,initialSortBy:r,initialTypeFilter:s});return jsx(Rs,{activities:x,isLoading:g,sortBy:h,onSortByChange:b,typeFilter:T,onTypeFilterChange:I,traderFilter:p,onTraderFilterChange:u,youWalletAddress:a,currency:f,onCurrencyChange:k,hasMore:M,onLoadMore:Q,className:m,nativeDecimals:l,nativeSymbol:d,onRowClick:c})}function Fs({stats:e,resolution:t,className:o}){let r=e?.[t],s=r?.traders??0,n=r?.buyers??0,i=r?.sellers??0;return jsx(et,{className:o,label:`Traders (${t})`,totalFormatted:formatAmount(s),buysFormatted:formatAmount(n),sellsFormatted:formatAmount(i),totalValue:s,buysValue:n})}function Us(e,t){return A(e,t)}function j0({chain:e,address:t,resolution:o="24h",className:r}){let{token:s}=Us(e,t);return jsx(Fs,{stats:s?.stats,resolution:o,className:r})}function Os({stats:e,resolution:t,className:o}){let r=e?.[t],s=r?.trades??0,n=r?.buys??0,i=r?.sells??0;return jsx(et,{className:o,label:`Transactions (${t})`,totalFormatted:formatAmount(s),buysFormatted:formatAmount(n),sellsFormatted:formatAmount(i),totalValue:s,buysValue:n})}function Ds(e,t){return A(e,t)}function fN({chain:e,address:t,resolution:o="24h",className:r}){let{token:s}=Ds(e,t);return jsx(Os,{stats:s?.stats,resolution:o,className:r})}function Es({stats:e,resolution:t,className:o}){let r=e?.[t],s=r?.volumesInUsd??"0",n=r?.buyVolumesInUsd??"0",i=r?.sellVolumesInUsd??"0";return jsx(et,{className:o,label:`Volume (${t})`,totalFormatted:formatAmountUSDCompact(s),buysFormatted:formatAmountUSDCompact(n),sellsFormatted:formatAmountUSDCompact(i),totalValue:s,buysValue:n})}function Ws(e,t){return A(e,t)}function RN({chain:e,address:t,resolution:o="24h",className:r}){let{token:s}=Ws(e,t);return jsx(Es,{stats:s?.stats,resolution:o,className:r})}function Bs({security:e,externalUrl:t,externalLabel:o,className:r}){let s=[{title:"Transfer fee",value:e?.hasTransferFee,safeWhen:false,description:"Whether the token charges a fee on transfer."},{title:"Fee not upgradable",value:e?.isTransferFeeUpgradable,safeWhen:false,description:"Whether the transfer fee can be raised by the token owner."},{title:"Transferable",value:e?.isTransferable,safeWhen:true,description:"Whether token holders can freely transfer the token."},{title:"Not freezable",value:e?.isFreezable,safeWhen:false,description:"Whether the token authority can freeze holder balances."},{title:"Not closable",value:e?.isClosable,safeWhen:false,description:"Whether the token program can be closed by its owner."}],n=s.every(i=>i.value!==void 0&&i.value===i.safeWhen);return jsxs("section",{className:cn("flex w-full flex-col gap-3",r),children:[jsxs("div",{className:"flex items-baseline justify-between",children:[jsx("span",{className:"text-sm font-medium text-foreground",children:"Security"}),jsx("span",{className:cn("text-xs",e===void 0?"text-default-400":n?"text-success-500":"text-danger-500"),children:e===void 0?"--":n?"Safe":"Review"})]}),jsx("div",{className:"flex flex-col",children:s.map(i=>jsx(Jm,{...i},i.title))}),t&&o&&jsx("div",{className:"flex justify-center",children:jsx("a",{href:t,target:"_blank",rel:"noreferrer noopener",className:"text-xs text-default-400 transition-colors hover:text-foreground",children:o})})]})}function Jm({title:e,value:t,safeWhen:o,description:r}){let s=t!==void 0&&t===o,n=t===void 0?"--":s?"OK":"Risk";return jsxs("div",{className:"flex h-8 items-center justify-between gap-2",children:[jsx("span",{className:"text-xs text-default-500",title:r,children:e}),jsx("span",{className:cn("text-xs",t===void 0?"text-default-400":s?"text-success-500":"text-danger-500"),children:n})]})}function Vs(e,t){let{data:o,isLoading:r}=useTokenSecurityQuery({chain:e,address:t});return {security:o,isLoading:r}}function $N({chain:e,address:t,externalUrl:o,externalLabel:r,className:s}){let{security:n}=Vs(e,t);return jsx(Bs,{security:n,externalUrl:o,externalLabel:r,className:s})}function Ks({token:e,className:t}){return e?jsxs("section",{className:cn("flex w-full flex-col gap-2",t),children:[jsxs("div",{className:"text-sm font-medium text-foreground",children:["About ",e.symbol]}),e.description?jsx("p",{className:"whitespace-pre-line text-xs text-default-500",children:e.description}):jsx("p",{className:"text-xs text-default-400",children:"No description provided."})]}):null}function zs(e,t){return A(e,t)}function rS({chain:e,address:t,className:o}){let{token:r}=zs(e,t);return jsx(Ks,{token:r,className:o})}function Gs({liquidities:e,totalTvlInUsd:t,collapseAt:o=3,className:r,onPoolClick:s}){let[n,i]=useState(!e||e.length<=o),a=useCallback(()=>i(l=>!l),[]);return jsxs("section",{className:cn("flex w-full flex-col gap-3",r),children:[jsxs("div",{className:"flex items-baseline justify-between",children:[jsx("span",{className:"text-sm font-medium text-foreground",children:"Liquidity"}),t&&jsx("span",{className:"text-xs text-foreground",children:formatAmountUSDCompact(t)})]}),(!e||e.length===0)&&jsx("div",{className:"py-4 text-center text-xs text-default-400",children:"No pools"}),e&&e.length>0&&jsxs("div",{className:"flex flex-col gap-2",children:[e.map((l,d)=>jsxs("div",{className:cn("flex h-10 w-full items-center justify-between overflow-hidden text-xs",d>=o&&!n&&"hidden",s&&"cursor-pointer hover:bg-default-50"),onClick:s?()=>s(l):void 0,children:[jsxs("div",{className:"flex flex-col gap-0.5",children:[jsx("span",{className:"text-foreground",children:l.protocolFamily??l.protocolName??"Unknown"}),l.poolAddress&&jsxs("span",{className:"font-mono text-[10px] text-default-400",children:["Pool: ",pe(l.poolAddress,6,6)]})]}),jsx("div",{className:"text-default-500",children:formatAmountUSDCompact(l.tvlInUsd??0)})]},l.poolAddress??`${l.protocolFamily}-${d}`)),e.length>o&&jsx("div",{className:"flex justify-center pt-1",children:jsx("button",{type:"button",onClick:a,className:"rounded px-2 py-1 text-xs text-default-400 transition-colors hover:text-foreground",children:n?"Show less":"Show more"})})]})]})}function Xs(e,t){return A(e,t)}function TS({chain:e,address:t,collapseAt:o,className:r,onPoolClick:s}){let{token:n}=Xs(e,t);return jsx(Gs,{liquidities:n?.liquidities,totalTvlInUsd:n?.marketData?.tvlInUsd,collapseAt:o,className:r,onPoolClick:s})}function Js({cexes:e,collapseAt:t=4,className:o}){let[r,s]=useState(!e||e.length<=t),n=useCallback(()=>s(i=>!i),[]);return !e||e.length===0?null:jsxs("section",{className:cn("w-full",o),children:[jsx("div",{className:"text-sm font-medium text-foreground",children:"CEX listings"}),jsx("div",{className:"mt-3 flex flex-wrap gap-2",children:e.map((i,a)=>{let l=a>=t&&!r,d=jsx(Chip,{startContent:i.logo?jsx(Image,{src:i.logo,width:20,height:20,alt:i.name}):void 0,className:cn("bg-default-100 text-xs",l&&"hidden"),children:i.name},i.id);return i.url?jsx("a",{href:i.url,target:"_blank",rel:"noreferrer noopener",className:cn(l&&"hidden"),children:d},i.id):d})}),e.length>t&&jsx("div",{className:"mt-3 flex justify-center",children:jsx("button",{type:"button",onClick:n,className:"rounded px-2 py-1 text-xs text-default-400 transition-colors hover:text-foreground",children:r?"Show less":"Show more"})})]})}function Ys(e){return {cexes:e}}function FS({cexes:e,collapseAt:t,className:o}){let{cexes:r}=Ys(e);return jsx(Js,{cexes:r,collapseAt:t,className:o})}function js({categories:e,collapseAt:t=4,className:o,onCategoryClick:r}){let[s,n]=useState(!e||e.length<=t),i=useCallback(()=>n(a=>!a),[]);return !e||e.length===0?null:jsxs("section",{className:cn("w-full",o),children:[jsx("div",{className:"text-sm font-medium text-foreground",children:"Categories"}),jsx("div",{className:"mt-3 flex flex-wrap gap-2",children:e.map((a,l)=>{let d=l>=t&&!s;return jsx(Chip,{size:"sm",className:cn("bg-default-100",d&&"hidden",r&&"cursor-pointer"),onClick:r?()=>r(a):void 0,children:a},a)})}),e.length>t&&jsx("div",{className:"mt-3 flex justify-center",children:jsx("button",{type:"button",onClick:i,className:"rounded px-2 py-1 text-xs text-default-400 transition-colors hover:text-foreground",children:s?"Show less":"Show more"})})]})}function ei(e,t){return A(e,t)}function XS({chain:e,address:t,collapseAt:o,className:r,onCategoryClick:s}){let{token:n}=ei(e,t);return jsx(js,{categories:n?.tags,collapseAt:o,className:r,onCategoryClick:s})}var ti=["5m","1h","4h","24h"];function oi({stats:e,resolution:t,className:o}){let r=e?.[t],s=new SafeBigNumber(r?.buyVolumesInUsd??0),n=new SafeBigNumber(r?.sellVolumesInUsd??0),i=s.plus(n),a=s.minus(n),l=i.eq(0)?50:Math.min(100,Math.max(0,s.div(i).times(100).toNumber())),d=[{label:`${t} Vol`,value:formatAmountUSDCompact(i.toString()),className:"text-foreground"},{label:"Buys",value:formatAmountUSDCompact(s.toString()),className:"text-bullish"},{label:"Sells",value:formatAmountUSDCompact(n.toString()),className:"text-bearish"},{label:"Net Vol.",value:formatAmountUSDCompact(a.abs().toString()),className:a.gte(0)?"text-bullish":"text-bearish"}];return jsxs("div",{className:cn("flex h-full w-full flex-col",o),children:[jsx("div",{className:"grid flex-1 grid-cols-4 items-center",children:d.map(m=>jsxs("div",{className:"flex flex-col items-start justify-center gap-[2px] px-2",children:[jsx("span",{className:"text-[10px] leading-none text-default-400",children:m.label}),jsx("span",{className:cn("text-[13px] font-medium leading-none tabular-nums",m.className),children:m.value})]},m.label))}),jsx("div",{className:"relative h-[2px] w-full overflow-hidden bg-bearish",children:jsx("div",{className:"absolute inset-y-0 left-0 bg-bullish transition-[width] duration-200 ease-out",style:{width:`${l}%`}})})]})}function ri({stats:e,resolutions:t,className:o}){return jsx("div",{className:cn("grid h-full w-full grid-cols-4 items-center",o),children:t.map(r=>{let n=e?.[r]?.priceChange,i=n?new SafeBigNumber(n):void 0,a=i?i.gte(0):void 0,l=r,d=i?formatPercent(i,{showPlusGtThanZero:true}):"\u2014";return jsxs("div",{className:"flex flex-col items-start justify-center gap-[2px] px-2",children:[jsx("span",{className:"text-[10px] leading-none text-default-400",children:l}),jsx("span",{className:cn("text-[13px] font-medium leading-none tabular-nums",a===void 0?"text-foreground":a?"text-bullish":"text-bearish"),children:d})]},r)})})}function ni({chain:e,address:t}){let{data:o,isLoading:r}=useTokenStatsQuery({chain:e,address:t});return {stats:o,isLoading:r}}function mC({chain:e,address:t,baseResolution:o="5m",hoverResolutions:r=ti,height:s=64,className:n}){let{stats:i}=ni({chain:e,address:t});return jsx(StatsFlipPanel,{className:n,height:s,base:jsx(oi,{stats:i,resolution:o}),hover:jsx(ri,{stats:i,resolutions:r})})}function si({positions:e,isLoading:t,hasMore:o,onLoadMore:r,currency:s="usd",onCurrencyChange:n,showHidden:i=false,onShowHiddenChange:a,nativeSymbol:l="Native",renderActions:d,className:m}){return jsxs("div",{className:cn("flex flex-col",m),children:[jsxs("div",{className:"flex items-center justify-between gap-4 px-3 py-2",children:[jsxs("div",{className:"flex items-center gap-3",children:[jsx("span",{className:"text-xs font-medium text-default-500",children:"Positions"}),jsxs("label",{className:"flex cursor-pointer items-center gap-1 text-[11px] text-default-400",children:[jsx("input",{type:"checkbox",className:"size-3 accent-primary",checked:i,onChange:c=>a?.(c.target.checked)}),"Show Hidden"]})]}),jsx(vp,{value:s,nativeSymbol:l,onChange:n})]}),jsx("div",{className:"overflow-x-auto",children:jsxs("table",{className:"w-full min-w-[720px] table-fixed text-[12px]",children:[jsx("thead",{className:"text-default-400",children:jsxs("tr",{className:"border-b border-default-100",children:[jsx("th",{className:"w-[26%] px-3 py-2 text-left font-normal",children:"Token"}),jsx("th",{className:"w-[14%] px-3 py-2 text-right font-normal",children:"Bought"}),jsx("th",{className:"w-[14%] px-3 py-2 text-right font-normal",children:"Sold"}),jsx("th",{className:"w-[16%] px-3 py-2 text-right font-normal",children:"Remaining"}),jsx("th",{className:"w-[18%] px-3 py-2 text-right font-normal",children:"PnL"}),jsx("th",{className:"w-[12%] px-3 py-2 text-right font-normal",children:"Actions"})]})}),jsxs("tbody",{children:[e.length===0&&!t&&jsx("tr",{children:jsx("td",{colSpan:6,className:"py-8 text-center text-default-400",children:"No open positions"})}),e.map(c=>jsx(Np,{position:c,currency:s,renderActions:d},`${c.chain}:${c.address}`)),t&&jsx("tr",{children:jsx("td",{colSpan:6,className:"py-4 text-center text-default-400",children:"Loading\u2026"})})]})]})}),o&&jsx("div",{className:"flex justify-center px-3 py-2",children:jsx("button",{type:"button",onClick:r,disabled:t,className:"rounded bg-default-100 px-3 py-1 text-[11px] text-default-600 transition-colors hover:bg-default-200 disabled:opacity-50",children:"Load more"})})]})}function vp({value:e,nativeSymbol:t,onChange:o}){return jsx("div",{className:"flex h-[24px] items-center rounded bg-default-100 p-[2px] text-[11px]",children:[{k:"usd",label:"USD"},{k:"native",label:t}].map(s=>jsx("button",{type:"button",onClick:()=>o?.(s.k),className:cn("rounded px-2 transition-colors",e===s.k?"bg-default-200 text-foreground":"text-default-400 hover:text-foreground"),children:s.label},s.k))})}function Np({position:e,currency:t,renderActions:o}){let{bought:r,sold:s,remaining:n,pnl:i}=useMemo(()=>Sp(e,t),[e,t]),a=jsxs("div",{className:"flex items-center gap-2",children:[jsx(Avatar,{src:e.image??void 0,name:(e.symbol??"?").slice(0,1),className:"size-5 shrink-0 rounded-full bg-default-200 text-[10px]",showFallback:true}),jsxs("div",{className:"flex min-w-0 flex-col",children:[jsx("span",{className:"truncate text-foreground",children:e.symbol}),jsx("span",{className:"truncate text-[10px] text-default-400",children:e.name})]})]});return jsxs("tr",{className:"border-b border-default-50 hover:bg-default-50/60",children:[jsx("td",{className:"px-3 py-2 align-middle",children:a}),jsx("td",{className:"px-3 py-2 text-right align-middle text-foreground",children:r}),jsx("td",{className:"px-3 py-2 text-right align-middle text-foreground",children:s}),jsx("td",{className:"px-3 py-2 text-right align-middle text-foreground",children:n}),jsx("td",{className:cn("px-3 py-2 text-right align-middle font-medium",i.isPositive===void 0?"text-default-400":i.isPositive?"text-bullish":"text-bearish"),children:jsxs("div",{className:"flex flex-col items-end leading-tight",children:[jsx("span",{children:i.amount}),i.ratio?jsx("span",{className:"text-[10px]",children:i.ratio}):null]})}),jsx("td",{className:"px-3 py-2 text-right align-middle",children:o?o(e):jsx("span",{className:"text-default-400",children:"--"})})]})}function Sp(e,t){let o=t==="usd"?e.buyVolumesInUsd:e.buyVolumes,r=t==="usd"?e.sellVolumesInUsd:e.sellVolumes,s=t==="usd"?e.amountInUsd:e.amount,n=e.totalProfitInUsd,i=t==="usd"?formatAmountUSDCompact(o??0):formatAmount(o??0),a=t==="usd"?formatAmountUSDCompact(r??0):formatAmount(r??0),l=t==="usd"?formatAmountUSDCompact(s??0):formatAmount(s??0),d=n?new SafeBigNumber(n):void 0,m=d?d.gte(0):void 0,c=d?(m?"+":"")+formatAmountUSDCompact(d.toString()):"--",p=e.totalProfitRatio?formatPercent(e.totalProfitRatio,{showPlusGtThanZero:true}):void 0;return {bought:i,sold:a,remaining:l,pnl:{amount:c,ratio:p,isPositive:m}}}function li({chain:e,wallet:t,limit:o=50,initialShowHidden:r=false}){let[s,n]=useState(void 0),[i,a]=useState([]),[l,d]=useState(r);useEffect(()=>{n(void 0),a([]);},[e,t]);let m=useMemo(()=>({chain:e,address:t??"",cursor:s,limit:o,positionState:"open"}),[e,t,s,o]),{data:c,isPending:p,isFetching:u}=useWalletTokenPositionsQuery(m,{enabled:!!t});useEffect(()=>{c&&a(h=>s==null?[c]:h[h.length-1]?.endCursor===c.endCursor?h:[...h,c]);},[c,s]);let f=useMemo(()=>i.flatMap(h=>h.portfolios),[i]),k=i[i.length-1],x=!!(k?.hasNext&&k.endCursor),g=useCallback(()=>{!k?.endCursor||!k.hasNext||n(k.endCursor);},[k]);return {positions:f,isLoading:!!t&&(p||u),hasMore:x,loadMore:g,showHidden:l,setShowHidden:d}}function RC({chain:e,wallet:t,limit:o,initialCurrency:r="usd",nativeSymbol:s,renderActions:n,className:i}){let[a,l]=useState(r),{positions:d,isLoading:m,hasMore:c,loadMore:p,showHidden:u,setShowHidden:f}=li({chain:e,wallet:t,limit:o});return jsx(si,{className:i,positions:d,isLoading:m,hasMore:c,onLoadMore:p,currency:a,onCurrencyChange:l,showHidden:u,onShowHiddenChange:f,nativeSymbol:s,renderActions:n})}function di({orders:e,isLoading:t,unavailable:o,hasMore:r,onLoadMore:s,stateFilter:n,onStateFilterChange:i,onlyThisToken:a=false,onOnlyThisTokenChange:l,tokenSymbol:d,currency:m="usd",onCurrencyChange:c,nativeSymbol:p="Native",onCancelAll:u,renderActions:f,className:k}){return jsxs("div",{className:cn("flex flex-col",k),children:[jsxs("div",{className:"flex flex-wrap items-center justify-between gap-2 px-3 py-2",children:[jsxs("div",{className:"flex items-center gap-2",children:[jsx("div",{className:"flex h-[24px] items-center rounded bg-default-100 p-[2px] text-[11px]",children:[{k:"active",label:"Active Orders"},{k:"history",label:"Order History"}].map(x=>jsx("button",{type:"button",onClick:()=>i(x.k),className:cn("rounded px-2 transition-colors",n===x.k?"bg-default-200 text-foreground":"text-default-400 hover:text-foreground"),children:x.label},x.k))}),d?jsxs("label",{className:"flex cursor-pointer items-center gap-1 text-[11px] text-default-400",children:[jsx("input",{type:"checkbox",className:"size-3 accent-primary",checked:a,onChange:x=>l?.(x.target.checked)}),"Only ",d]}):null]}),jsxs("div",{className:"flex items-center gap-2",children:[u?jsx("button",{type:"button",onClick:u,className:"rounded px-2 py-1 text-[11px] text-bearish transition-colors hover:bg-default-100",children:"Cancel All"}):null,jsx(Ip,{value:m,nativeSymbol:p,onChange:c})]})]}),jsx("div",{className:"overflow-x-auto",children:jsxs("table",{className:"w-full min-w-[760px] table-fixed text-[12px]",children:[jsx("thead",{className:"text-default-400",children:jsxs("tr",{className:"border-b border-default-100",children:[jsx("th",{className:"w-[22%] px-3 py-2 text-left font-normal",children:"Token"}),jsx("th",{className:"w-[10%] px-3 py-2 text-left font-normal",children:"Type"}),jsx("th",{className:"w-[14%] px-3 py-2 text-right font-normal",children:"Amount"}),jsx("th",{className:"w-[14%] px-3 py-2 text-right font-normal",children:"Current MC"}),jsx("th",{className:"w-[14%] px-3 py-2 text-right font-normal",children:"Target MC"}),jsx("th",{className:"w-[14%] px-3 py-2 text-right font-normal",children:"Settings"}),jsx("th",{className:"w-[12%] px-3 py-2 text-right font-normal",children:"Action"})]})}),jsxs("tbody",{children:[o?jsx("tr",{children:jsx("td",{colSpan:7,className:"py-10 text-center text-default-400",children:"Limit orders are coming soon."})}):e.length===0&&!t?jsx("tr",{children:jsxs("td",{colSpan:7,className:"py-10 text-center text-default-400",children:["No ",n==="active"?"active":"historical"," orders"]})}):e.map(x=>jsx(Mp,{order:x,currency:m,renderActions:f},x.id)),t&&!o&&jsx("tr",{children:jsx("td",{colSpan:7,className:"py-4 text-center text-default-400",children:"Loading\u2026"})})]})]})}),!o&&r&&jsx("div",{className:"flex justify-center px-3 py-2",children:jsx("button",{type:"button",onClick:s,disabled:t,className:"rounded bg-default-100 px-3 py-1 text-[11px] text-default-600 transition-colors hover:bg-default-200 disabled:opacity-50",children:"Load more"})})]})}function Ip({value:e,nativeSymbol:t,onChange:o}){return jsx("div",{className:"flex h-[24px] items-center rounded bg-default-100 p-[2px] text-[11px]",children:[{k:"usd",label:"USD"},{k:"native",label:t}].map(s=>jsx("button",{type:"button",onClick:()=>o?.(s.k),className:cn("rounded px-2 transition-colors",e===s.k?"bg-default-200 text-foreground":"text-default-400 hover:text-foreground"),children:s.label},s.k))})}function Mp({order:e,currency:t,renderActions:o}){let r=useMemo(()=>t==="usd"&&e.amountInUsd?formatAmountUSDCompact(e.amountInUsd):formatAmount(e.amount),[t,e.amount,e.amountInUsd]),s=e.side==="buy"?"Buy":"Sell",n=e.side==="buy"?"text-bullish":"text-bearish";return jsxs("tr",{className:"border-b border-default-50 hover:bg-default-50/60",children:[jsx("td",{className:"px-3 py-2 align-middle",children:jsxs("div",{className:"flex items-center gap-2",children:[jsx(Avatar,{src:e.tokenImage??void 0,name:(e.tokenSymbol??"?").slice(0,1),className:"size-5 shrink-0 rounded-full bg-default-200 text-[10px]",showFallback:true}),jsx("span",{className:"truncate text-foreground",children:e.tokenSymbol??"--"})]})}),jsx("td",{className:cn("px-3 py-2 align-middle font-medium",n),children:s}),jsx("td",{className:"px-3 py-2 text-right align-middle text-foreground",children:r}),jsx("td",{className:"px-3 py-2 text-right align-middle text-default-500",children:e.currentMarketCapInUsd?formatAmountUSDCompact(e.currentMarketCapInUsd):"--"}),jsx("td",{className:"px-3 py-2 text-right align-middle text-foreground",children:e.targetMarketCapInUsd?formatAmountUSDCompact(e.targetMarketCapInUsd):e.targetPriceInUsd?formatAmountUSDCompact(e.targetPriceInUsd):"--"}),jsx("td",{className:"px-3 py-2 text-right align-middle text-default-400",children:e.slippage!=null?`Slip ${e.slippage}%`:"--"}),jsx("td",{className:"px-3 py-2 text-right align-middle",children:o?o(e):jsx("span",{className:"text-default-400",children:"--"})})]})}function Up(e){return e instanceof Error&&e.code==="NotImplemented"}function Op(e){return e==="active"?"active":"filled"}function ui({chain:e,wallet:t,tokenAddress:o,limit:r=50,initialStateFilter:s="active",initialOnlyThisToken:n=false}){let[i,a]=useState(s),[l,d]=useState(n),[m,c]=useState(void 0),[p,u]=useState([]);useEffect(()=>{c(void 0),u([]);},[e,t,i,l,o]);let f=useCallback(_=>{_!==i&&a(_);},[i]),k=useMemo(()=>({chain:e,address:t??"",cursor:m,limit:r,state:Op(i),tokenAddress:l?o:void 0}),[e,t,m,r,i,l,o]),{data:x,isPending:g,isFetching:h,error:b}=useWalletLimitOrdersQuery(k,{enabled:!!t});useEffect(()=>{x&&u(_=>m==null?[x]:_[_.length-1]?.endCursor===x.endCursor?_:[..._,x]);},[x,m]);let T=!!b&&Up(b),I=useMemo(()=>p.flatMap(_=>_.data),[p]),M=p[p.length-1],Q=!!(M?.hasNext&&M.endCursor),Se=useCallback(()=>{!M?.endCursor||!M.hasNext||c(M.endCursor);},[M]);return {orders:I,isLoading:!!t&&!T&&(g||h),unavailable:T,hasMore:Q,loadMore:Se,stateFilter:i,setStateFilter:f,onlyThisToken:l,setOnlyThisToken:d}}function QC({chain:e,wallet:t,tokenAddress:o,tokenSymbol:r,limit:s,initialStateFilter:n="active",initialCurrency:i="usd",nativeSymbol:a,onCancelAll:l,renderActions:d,className:m}){let[c,p]=useState(i),{orders:u,isLoading:f,unavailable:k,hasMore:x,loadMore:g,stateFilter:h,setStateFilter:b,onlyThisToken:T,setOnlyThisToken:I}=ui({chain:e,wallet:t,tokenAddress:o,limit:s,initialStateFilter:n});return jsx(di,{className:m,orders:u,isLoading:f,unavailable:k,hasMore:x,onLoadMore:g,stateFilter:h,onStateFilterChange:b,onlyThisToken:T,onOnlyThisTokenChange:I,tokenSymbol:r,currency:c,onCurrencyChange:p,nativeSymbol:a,onCancelAll:k?void 0:l,renderActions:d})}function fi({traders:e,isLoading:t,hasMore:o,onLoadMore:r,onlyTracked:s=false,onOnlyTrackedChange:n,now:i=Date.now(),renderAddress:a,className:l}){return jsxs("div",{className:cn("flex flex-col",l),children:[jsxs("div",{className:"flex items-center justify-between gap-4 px-3 py-2",children:[jsx("span",{className:"text-xs font-medium text-default-500",children:"Top Traders"}),jsxs("label",{className:"flex cursor-pointer items-center gap-1 text-[11px] text-default-400",children:[jsx("input",{type:"checkbox",className:"size-3 accent-primary",checked:s,onChange:d=>n?.(d.target.checked)}),"Only Tracked"]})]}),jsx("div",{className:"overflow-x-auto",children:jsxs("table",{className:"w-full min-w-[680px] table-fixed text-[12px]",children:[jsx("thead",{className:"text-default-400",children:jsxs("tr",{className:"border-b border-default-100",children:[jsx("th",{className:"w-[28%] px-3 py-2 text-left font-normal",children:"Wallet"}),jsx("th",{className:"w-[20%] px-3 py-2 text-left font-normal",children:"Tags"}),jsx("th",{className:"w-[15%] px-3 py-2 text-right font-normal",children:"Value"}),jsx("th",{className:"w-[10%] px-3 py-2 text-right font-normal",children:"%"}),jsx("th",{className:"w-[14%] px-3 py-2 text-right font-normal",children:"Realized PnL"}),jsx("th",{className:"w-[13%] px-3 py-2 text-right font-normal",children:"Last active"})]})}),jsxs("tbody",{children:[e.length===0&&!t&&jsx("tr",{children:jsx("td",{colSpan:6,className:"py-8 text-center text-default-400",children:"No top traders yet"})}),e.map(d=>jsx(_p,{trader:d,now:i,renderAddress:a},d.address)),t&&jsx("tr",{children:jsx("td",{colSpan:6,className:"py-4 text-center text-default-400",children:"Loading\u2026"})})]})]})}),o&&jsx("div",{className:"flex justify-center px-3 py-2",children:jsx("button",{type:"button",onClick:r,disabled:t,className:"rounded bg-default-100 px-3 py-1 text-[11px] text-default-600 transition-colors hover:bg-default-200 disabled:opacity-50",children:"Load more"})})]})}function _p({trader:e,now:t,renderAddress:o}){let r=useMemo(()=>o?o(e.address):jsx("span",{className:"font-mono text-[11px] text-default-500",children:pe(e.address,6,6)}),[e.address,o]);return jsxs("tr",{className:"border-b border-default-50 hover:bg-default-50/60",children:[jsx("td",{className:"px-3 py-2 align-middle",children:r}),jsx("td",{className:"px-3 py-2 align-middle",children:jsx(Ot,{tags:e.tags,max:3})}),jsx("td",{className:"px-3 py-2 text-right align-middle text-foreground",children:formatAmountUSDCompact(e.amountInUsd)}),jsx("td",{className:"px-3 py-2 text-right align-middle text-default-500",children:Oe(e.ratio)}),jsx("td",{className:"px-3 py-2 text-right align-middle text-default-400",children:"\u2014"}),jsx("td",{className:"px-3 py-2 text-right align-middle text-default-400",children:e.lastActiveAt?Ne(e.lastActiveAt,t):"--"})]})}function xi({chain:e,address:t,limit:o=50,initialOnlyTracked:r=false}){let[s,n]=useState(void 0),[i,a]=useState([]),[l,d]=useState(r);useEffect(()=>{n(void 0),a([]);},[e,t]);let m=useMemo(()=>({chain:e,address:t,cursor:s,limit:o,sortBy:"realizedPnl"}),[e,t,s,o]),{data:c,isPending:p,isFetching:u}=useTokenTopTradersQuery(m);useEffect(()=>{c&&a(b=>s==null?[c]:b[b.length-1]?.endCursor===c.endCursor?b:[...b,c]);},[c,s]);let f=useMemo(()=>i.flatMap(b=>b.data),[i]),k=useMemo(()=>l?f.filter(b=>b.tags&&b.tags.length>0):f,[f,l]),x=i[i.length-1],g=!!(x?.hasNext&&x.endCursor),h=useCallback(()=>{!x?.endCursor||!x.hasNext||n(x.endCursor);},[x]);return {traders:k,isLoading:p||u,hasMore:g,loadMore:h,onlyTracked:l,setOnlyTracked:d}}function pw({chain:e,address:t,limit:o,className:r,renderAddress:s}){let{traders:n,isLoading:i,hasMore:a,loadMore:l,onlyTracked:d,setOnlyTracked:m}=xi({chain:e,address:t,limit:o});return jsx(fi,{className:r,traders:n,isLoading:i,hasMore:a,onLoadMore:l,onlyTracked:d,onOnlyTrackedChange:m,renderAddress:s})}function hi({tokens:e,isLoading:t,unavailable:o,hasMore:r,onLoadMore:s,renderTokenLink:n,className:i}){return jsxs("div",{className:cn("flex flex-col",i),children:[jsx("div",{className:"flex items-center justify-between gap-4 px-3 py-2",children:jsx("span",{className:"text-xs font-medium text-default-500",children:"Dev Tokens"})}),jsx("div",{className:"overflow-x-auto",children:jsxs("table",{className:"w-full min-w-[700px] table-fixed text-[12px]",children:[jsx("thead",{className:"text-default-400",children:jsxs("tr",{className:"border-b border-default-100",children:[jsx("th",{className:"w-[28%] px-3 py-2 text-left font-normal",children:"Token"}),jsx("th",{className:"w-[10%] px-3 py-2 text-center font-normal",children:"Migrated"}),jsx("th",{className:"w-[16%] px-3 py-2 text-right font-normal",children:"Market Cap"}),jsx("th",{className:"w-[14%] px-3 py-2 text-right font-normal",children:"ATH"}),jsx("th",{className:"w-[16%] px-3 py-2 text-right font-normal",children:"Liquidity"}),jsx("th",{className:"w-[16%] px-3 py-2 text-right font-normal",children:"1h Volume"})]})}),jsxs("tbody",{children:[o?jsx("tr",{children:jsx("td",{colSpan:6,className:"py-10 text-center text-default-400",children:"Dev tokens index is coming soon."})}):e.length===0&&!t?jsx("tr",{children:jsx("td",{colSpan:6,className:"py-8 text-center text-default-400",children:"No dev tokens"})}):e.map(a=>jsx(Qp,{token:a,renderTokenLink:n},`${a.chain}:${a.address}`)),!o&&t&&jsx("tr",{children:jsx("td",{colSpan:6,className:"py-4 text-center text-default-400",children:"Loading\u2026"})})]})]})}),!o&&r&&jsx("div",{className:"flex justify-center px-3 py-2",children:jsx("button",{type:"button",onClick:s,disabled:t,className:"rounded bg-default-100 px-3 py-1 text-[11px] text-default-600 transition-colors hover:bg-default-200 disabled:opacity-50",children:"Load more"})})]})}function Qp({token:e,renderTokenLink:t}){let o=e.marketData?.marketCapInUsd??e.marketData?.marketCap,r=e.marketData?.tvlInUsd,n=e.stats?.["1h"]?.volumesInUsd,i=!!e.migratedTo,a=t?t(e):jsxs("div",{className:"flex items-center gap-2",children:[jsx(Avatar,{src:e.image??void 0,name:(e.symbol??e.name??"?").slice(0,1),className:"size-5 shrink-0 rounded-full bg-default-200 text-[10px]",showFallback:true}),jsxs("div",{className:"flex min-w-0 flex-col",children:[jsx("span",{className:"truncate text-foreground",children:e.symbol}),jsx("span",{className:"truncate text-[10px] text-default-400",children:e.name})]})]});return jsxs("tr",{className:"border-b border-default-50 hover:bg-default-50/60",children:[jsx("td",{className:"px-3 py-2 align-middle",children:a}),jsx("td",{className:"px-3 py-2 text-center align-middle",children:i?jsx("span",{className:"text-bullish",children:"\u2713"}):jsx("span",{className:"text-default-400",children:"\u2014"})}),jsx("td",{className:"px-3 py-2 text-right align-middle text-foreground",children:o?formatAmountUSDCompact(o):"--"}),jsx("td",{className:"px-3 py-2 text-right align-middle text-foreground",children:"--"}),jsx("td",{className:"px-3 py-2 text-right align-middle text-foreground",children:r?formatAmountUSDCompact(r):"--"}),jsx("td",{className:"px-3 py-2 text-right align-middle text-foreground",children:n?formatAmountUSDCompact(n):"--"})]})}function bi({tokens:e,className:t}){let o=e.length,r=e.filter(a=>!!a.migratedTo).length,s=o===0?0:Math.round(r/o*100),n=e.map(a=>a.stats?.["1h"]?.volumesInUsd??"0").reduce((a,l)=>a.plus(new SafeBigNumber(l)),new SafeBigNumber(0)),i=e.map(a=>a.marketData?.marketCapInUsd??a.marketData?.marketCap??"0").reduce((a,l)=>a.plus(new SafeBigNumber(l)),new SafeBigNumber(0));return jsxs("div",{className:cn("flex flex-col gap-2 p-3",t),children:[jsx("div",{className:"flex items-center justify-between",children:jsx("span",{className:"text-xs font-medium text-default-500",children:"Token Stats"})}),jsxs("div",{className:"grid grid-cols-2 gap-3",children:[jsx(mo,{label:"Total",value:String(o)}),jsx(mo,{label:"Migrated",value:`${r} (${s}%)`}),jsx(mo,{label:"Total Market Cap",value:formatAmountUSDCompact(i.toString())}),jsx(mo,{label:"Total 1h Volume",value:formatAmountUSDCompact(n.toString())})]})]})}function mo({label:e,value:t}){return jsxs("div",{className:"flex flex-col gap-[2px]",children:[jsx("span",{className:"text-[10px] text-default-400",children:e}),jsx("span",{className:"text-[13px] font-medium text-foreground",children:t})]})}function Jp(e){return e instanceof Error&&e.code==="NotImplemented"}function Ni({chain:e,creator:t,limit:o=20}){let[r,s]=useState(void 0),[n,i]=useState([]);useEffect(()=>{s(void 0),i([]);},[e,t]);let a=useMemo(()=>({chain:e,creator:t??"",cursor:r,limit:o}),[e,t,r,o]),{data:l,isPending:d,isFetching:m,error:c}=useTokensByCreatorQuery(a,{enabled:!!t});useEffect(()=>{l&&i(g=>r==null?[l]:g[g.length-1]?.endCursor===l.endCursor?g:[...g,l]);},[l,r]);let p=!!c&&Jp(c),u=useMemo(()=>n.flatMap(g=>g.data),[n]),f=n[n.length-1],k=!!(f?.hasNext&&f.endCursor),x=useCallback(()=>{!f?.endCursor||!f.hasNext||s(f.endCursor);},[f]);return {tokens:u,isLoading:!!t&&!p&&(d||m),unavailable:p,hasMore:k,loadMore:x}}function Pw({chain:e,creator:t,limit:o,showSummary:r=false,renderTokenLink:s,className:n}){let{tokens:i,isLoading:a,unavailable:l,hasMore:d,loadMore:m}=Ni({chain:e,creator:t,limit:o});return jsxs("div",{className:n,children:[jsx(hi,{tokens:i,isLoading:a,unavailable:l,hasMore:d,onLoadMore:m,renderTokenLink:s}),r&&!l?jsx(bi,{tokens:i}):null]})}function wi({token:e,athInUsd:t,athAt:o,globalFeesPaidInUsd:r,rank:s,onTogglePin:n,pinned:i,className:a}){let l=e?.marketData?.priceInUsd,d=e?.marketData?.tvlInUsd,m=e?.marketData?.totalSupply;return jsxs("div",{className:cn("flex h-[48px] w-full flex-row items-center gap-4 overflow-x-auto px-3 text-[12px]",a),children:[jsx(lt,{label:"Price",value:l?formatPriceUSD(l):"--"}),jsx(lt,{label:"Liquidity",value:d?formatAmountUSDCompact(d):"--"}),jsx(lt,{label:"Supply",value:m?formatAmount(m):"--"}),r?jsx(lt,{label:"Fees Paid",value:formatAmountUSDCompact(r)}):null,t?jsx(lt,{label:"ATH",value:formatAmountUSDCompact(t),title:o?`All-time high at ${o.toLocaleDateString()}`:void 0}):null,s!==void 0?jsx(lt,{label:"Rank",value:`#${s}`}):null,jsx("div",{className:"flex-1"}),n?jsx("button",{type:"button",onClick:n,"aria-pressed":i,className:cn("flex size-[26px] items-center justify-center rounded text-default-400 transition-colors hover:bg-default-100 hover:text-foreground",i&&"text-foreground"),title:i?"Unpin token":"Pin token",children:i?"\u2605":"\u2606"}):null]})}function lt({label:e,value:t,title:o}){return jsxs("div",{className:"flex flex-col items-start justify-center gap-[2px] whitespace-nowrap",title:o,children:[jsx("span",{className:"text-[10px] leading-none text-default-400",children:e}),jsx("span",{className:"text-[13px] font-medium leading-none tabular-nums text-foreground",children:t})]})}function Pi({chain:e,address:t}){return A(e,t)}function $w({chain:e,address:t,athInUsd:o,athAt:r,globalFeesPaidInUsd:s,rank:n,pinned:i,onTogglePin:a,className:l}){let{token:d}=Pi({chain:e,address:t});return jsx(wi,{className:l,token:d,athInUsd:o,athAt:r,globalFeesPaidInUsd:s,rank:n,pinned:i,onTogglePin:a})}function Ri({tokens:e,isLoading:t,unavailable:o,onTokenClick:r,className:s}){return o?jsx("div",{className:cn("flex items-center justify-center p-4 text-center text-[11px] text-default-400",s),children:"Similar tokens coming soon."}):!t&&e.length===0?jsx("div",{className:cn("flex items-center justify-center p-4 text-center text-[11px] text-default-400",s),children:"No similar tokens found."}):jsxs("ul",{className:cn("flex flex-col",s),children:[e.map(n=>jsxs("li",{className:cn("flex cursor-pointer items-center gap-2 border-b border-default-50 px-3 py-2 last:border-0 hover:bg-default-50/60",!r&&"cursor-default"),onClick:r?()=>r(n):void 0,children:[jsx(Avatar,{src:n.image??void 0,name:(n.symbol??"?").slice(0,1),className:"size-5 shrink-0 rounded-full bg-default-200 text-[10px]",showFallback:true}),jsxs("div",{className:"flex min-w-0 flex-1 flex-col",children:[jsx("span",{className:"truncate text-[12px] text-foreground",children:n.symbol}),jsx("span",{className:"truncate text-[10px] text-default-400",children:n.name})]}),jsx("span",{className:"text-[11px] tabular-nums text-default-500",children:n.marketData?.marketCapInUsd?formatAmountUSDCompact(n.marketData.marketCapInUsd):"--"})]},`${n.chain}:${n.address}`)),t&&jsx("li",{className:"py-2 text-center text-[11px] text-default-400",children:"Loading\u2026"})]})}function Ai({chain:e,address:t,keyword:o,limit:r=10}){let s=!!o&&o.length>0,{data:n,isPending:i,isFetching:a}=useSearchTokensQuery({chains:[e],keyword:o,limit:r+1},{enabled:s});return {tokens:useMemo(()=>{if(!n)return [];let d=t.toLowerCase();return (n.data??[]).filter(m=>m.address.toLowerCase()!==d).slice(0,r)},[n,t,r]),isLoading:s&&(i||a),unavailable:!s}}function sL({chain:e,address:t,keyword:o,limit:r,onTokenClick:s,className:n}){let{tokens:i,isLoading:a,unavailable:l}=Ai({chain:e,address:t,keyword:o,limit:r});return jsx(Ri,{className:n,tokens:i,isLoading:a,unavailable:l,onTokenClick:s})}function Hi({tokens:e=[],unavailable:t=true,onTokenClick:o,className:r}){return t?jsx("div",{className:cn("flex items-center justify-center p-4 text-center text-[11px] text-default-400",r),children:"Image-similarity search is coming soon."}):e.length===0?jsx("div",{className:cn("flex items-center justify-center p-4 text-center text-[11px] text-default-400",r),children:"No reused-image tokens found."}):jsx("div",{className:cn("flex flex-row flex-wrap gap-2 p-3",r),children:e.map(s=>jsx("button",{type:"button",onClick:o?()=>o(s):void 0,className:"flex size-10 items-center justify-center overflow-hidden rounded-full border border-default-100 transition-opacity hover:opacity-80",title:s.symbol,children:jsx(Avatar,{src:s.image??void 0,name:(s.symbol??"?").slice(0,1),className:"size-full bg-default-100 text-[10px] text-default-400",showFallback:true})},`${s.chain}:${s.address}`))})}function Ii(e){return {tokens:[],isLoading:false,unavailable:true}}function hL({chain:e,address:t,onTokenClick:o,className:r}){let{tokens:s,unavailable:n}=Ii();return jsx(Hi,{className:r,tokens:s,unavailable:n,onTokenClick:o})}function Di({keywords:e,excludeKeywords:t,onKeywordsChange:o,onExcludeKeywordsChange:r,className:s}){let{t:n}=useTranslation(),[i,a]=useState(e?.join(", ")??""),[l,d]=useState(t?.join(", ")??"");useEffect(()=>{a(p=>{let u=uo(p);return u===void 0&&e===void 0?p:u===void 0?e?.join(", ")??"":e===void 0?"":u.join("")===e.join("")?p:e.join(", ")});},[e]),useEffect(()=>{d(p=>{let u=uo(p);return u===void 0&&t===void 0?p:u===void 0?t?.join(", ")??"":t===void 0?"":u.join("")===t.join("")?p:t.join(", ")});},[t]);let m=useCallback(p=>{a(p),o?.(uo(p));},[o]),c=useCallback(p=>{d(p),r?.(uo(p));},[r]);return jsxs("div",{className:cn("grid grid-cols-2 gap-3 px-4",s),children:[jsxs("div",{className:"flex flex-col gap-3",children:[jsx("h3",{className:"text-xs text-neutral",children:n("tokens.filters.keywords.title")}),jsx(StyledInput,{variant:"bordered",radius:"lg",size:"sm",placeholder:n("tokens.filters.keywords.placeholder"),value:i,onValueChange:m})]}),jsxs("div",{className:"flex flex-col gap-3",children:[jsx("h3",{className:"text-xs text-neutral",children:n("tokens.filters.keywords.exclude.title")}),jsx(StyledInput,{variant:"bordered",radius:"lg",size:"sm",placeholder:n("tokens.filters.keywords.placeholder"),value:l,onValueChange:c})]})]})}function uo(e){let t=e.split(",").map(o=>o.trim()).filter(Boolean);return t.length>0?t:void 0}function $i({protocols:e,selectedProtocols:t=[],onSelectedProtocolsChange:o,className:r}){let{t:s}=useTranslation(),[n,i]=useState(t);useEffect(()=>{i(t);},[t]);let a=useMemo(()=>e.every(m=>n.includes(m)),[e,n]),l=useCallback(()=>{if(a){let m=[];i(m),o?.(m);}else {let m=[...e];i(m),o?.(m);}},[e,o,a]),d=useCallback(m=>()=>{if(n.includes(m)){let c=n.filter(p=>p!==m);i(c),o?.(c);}else {let c=[...n,m];i(c),o?.(c);}},[n,o]);return jsxs("div",{className:cn("flex flex-col gap-3 px-4",r),children:[jsxs("div",{className:"flex justify-between items-center",children:[jsx("h3",{className:"text-xs text-neutral",children:s("tokens.filters.protocols.title")}),jsx(Button,{variant:"light",color:"default",size:"sm",radius:"full",onPress:l,children:s(a?"tokens.filters.protocols.unselectAll":"tokens.filters.protocols.selectAll")})]}),jsx("div",{className:"grid grid-cols-3 gap-3",children:e.map(m=>{let c=Me(m);return jsx(Button,{variant:"bordered",size:"sm",radius:"full",className:cn("w-fit h-6 px-2.5",c.text,c.bg5,"border",c.border,{"opacity-40 data-[hover=true]:!opacity-30":!n.includes(m)}),startContent:jsx(Image,{width:14,height:14,src:`/images/protocols/${m}.svg`,alt:formatTokenProtocolName(m)}),onPress:d(m),children:formatTokenProtocolName(m)},m)})})]})}function xe({title:e,field:t,value:o,onChange:r}){let{t:s}=useTranslation(),[n,i]=useState(o?mr(o).min:NaN),[a,l]=useState(o?mr(o).max:NaN);useEffect(()=>{if(o===void 0)i(NaN),l(NaN);else {let{min:c,max:p}=mr(o);i(c),l(p);}},[o]);let d=useCallback(c=>{i(c),r?.(Qi(t,c,a));},[t,r,a]),m=useCallback(c=>{l(c),r?.(Qi(t,n,c));},[t,r,n]);return jsxs("div",{className:"flex flex-col gap-1",children:[e&&jsx("h3",{className:"text-xs text-neutral",children:e}),jsxs("div",{className:"grid grid-cols-2 gap-3",children:[jsx(StyledNumberInput,{value:n,onValueChange:d,variant:"bordered",radius:"lg",size:"sm",placeholder:s("tokens.filters.stats.min"),"aria-label":`${e} min`}),jsx(StyledNumberInput,{value:a,onValueChange:m,variant:"bordered",radius:"lg",size:"sm",placeholder:s("tokens.filters.stats.max"),"aria-label":`${e} max`})]})]})}function mr(e){if(e.operator==="between"){let[t,o]=e.value;return {min:t,max:o}}return e.operator==="gte"?{min:e.value,max:NaN}:e.operator==="lte"?{min:NaN,max:e.value}:{min:NaN,max:NaN}}function Qi(e,t,o){if(!(isNaN(t)&&isNaN(o)))return isNaN(t)?{field:e,operator:"lte",value:o}:isNaN(o)?{field:e,operator:"gte",value:t}:{field:e,operator:"between",value:[t,o]}}function Xi({values:e,onValuesChange:t,className:o}){let{t:r}=useTranslation(),[s,n]=useState(e);useEffect(()=>{n(e);},[e]);let i=useCallback(a=>l=>{if(l===void 0){let d=(s??[]).filter(m=>m.field!==a);d=d.length>0?d:void 0,n(d),t?.(d);}else {let d=[...(s??[]).filter(m=>m.field!==a),l];n(d),t?.(d);}},[s,t]);return jsxs("div",{className:cn("flex flex-col gap-4",o),children:[jsx(xe,{field:"holders",title:r("tokens.filters.stats.audits.holders"),value:s?.find(a=>a.field==="holders"),onChange:i("holders")}),jsx(xe,{field:"top10Ratio",title:r("tokens.filters.stats.audits.top10HoldingsRatio"),value:s?.find(a=>a.field==="top10Ratio"),onChange:i("top10Ratio")}),jsx(xe,{field:"top100Ratio",title:r("tokens.filters.stats.audits.top100HoldingsRatio"),value:s?.find(a=>a.field==="top100Ratio"),onChange:i("top100Ratio")}),jsx(xe,{field:"creatorsRatio",title:r("tokens.filters.stats.audits.devHoldingsRatio"),value:s?.find(a=>a.field==="creatorsRatio"),onChange:i("creatorsRatio")})]})}function Ji({resolution:e,values:t,onValuesChange:o,className:r}){let{t:s}=useTranslation(),[n,i]=useState(t);useEffect(()=>{i(t);},[t]);let a=useCallback(l=>d=>{if(d===void 0){let m=(n??[]).filter(c=>c.field!==l);m=m.length>0?m:void 0,i(m),o?.(m);}else {let m=[...(n??[]).filter(c=>c.field!==l),d];i(m),o?.(m);}},[n,o]);return jsxs("div",{className:cn("flex flex-col gap-4",r),children:[jsx(xe,{field:"marketCap",title:s("tokens.filters.stats.metrics.marketCap"),value:n?.find(l=>l.field==="marketCap"),onChange:a("marketCap")}),jsx(xe,{field:"tvl",title:s("tokens.filters.stats.metrics.liquidity"),value:n?.find(l=>l.field==="tvl"),onChange:a("tvl")}),jsx(xe,{field:`volumes${e}`,title:s("tokens.filters.stats.metrics.volumes",{resolution:s(`common.resolution.${e}`)}),value:n?.find(l=>l.field===`volumes${e}`),onChange:a(`volumes${e}`)}),jsx(xe,{field:`trades${e}`,title:s("tokens.filters.stats.metrics.txns",{resolution:s(`common.resolution.${e}`)}),value:n?.find(l=>l.field===`trades${e}`),onChange:a(`trades${e}`)})]})}function oa({resolution:e,values:t,onValuesChange:o,className:r}){let{t:s}=useTranslation(),[n,i]=useState("audits"),[a,l]=useState(t);useEffect(()=>{l(t);},[t]);let d=useCallback(p=>{l(p),o?.(p);},[o]),m=useMemo(()=>{let p=["holders","top10Ratio","top100Ratio","creatorsRatio"];return a?.filter(u=>p.includes(u.field))?.length??0},[a]),c=useMemo(()=>{let p=["marketCap","tvl",`volumes${e}`,`trades${e}`];return a?.filter(u=>p.includes(u.field)).length??0},[a,e]);return jsxs("div",{className:cn("flex flex-col gap-3 px-4",r),children:[jsxs(StyledLightTabs,{color:"default",radius:"full",size:"sm",selectedKey:n,onSelectionChange:i,children:[jsx(Tab,{title:m===0?s("tokens.filters.stats.audits"):jsx(StyledBadge,{color:"primary",size:"sm",content:m,shape:"circle",children:s("tokens.filters.stats.audits")})},"audits"),jsx(Tab,{title:c===0?s("tokens.filters.stats.metrics"):jsx(StyledBadge,{color:"primary",size:"sm",content:c,shape:"circle",children:s("tokens.filters.stats.metrics")})},"metrics")]}),jsx(Xi,{values:a,onValuesChange:d,className:cn({hidden:n!=="audits"})}),jsx(Ji,{values:a,onValuesChange:d,resolution:e,className:cn({hidden:n!=="metrics"})})]})}function yo({protocols:e,resolution:t,filters:o,onFiltersChange:r,className:s}){let[n,i]=useState(ra(o?.filters,e));useEffect(()=>{i(ra(o?.filters,e));},[o?.filters,e]);let[a,l]=useState(o?.keywords);useEffect(()=>{l(o?.keywords);},[o?.keywords]);let[d,m]=useState(o?.excludeKeywords);useEffect(()=>{m(o?.excludeKeywords);},[o?.excludeKeywords]);let[c,p]=useState(o?.filters);useEffect(()=>{p(o?.filters);},[o?.filters]);let u=useCallback(g=>{i(g),r?.(To(e,g,a,d,c));},[e,a,d,c,r]),f=useCallback(g=>{l(g),r?.(To(e,n,g,d,c));},[e,n,d,c,r]),k=useCallback(g=>{m(g),r?.(To(e,n,a,g,c));},[e,n,a,c,r]),x=useCallback(g=>{p(g),r?.(To(e,n,a,d,g));},[e,n,a,d,r]);return jsxs("div",{className:cn("flex flex-col gap-4",s),children:[e&&e.length>0&&jsxs(Fragment,{children:[jsx($i,{protocols:e,selectedProtocols:n,onSelectedProtocolsChange:u}),jsx("div",{style:{height:1,background:"rgba(39,39,42,1)"}})]}),jsx(Di,{keywords:a,excludeKeywords:d,onKeywordsChange:f,onExcludeKeywordsChange:k}),jsx("div",{style:{height:1,background:"rgba(39,39,42,1)"}}),jsx(oa,{resolution:t,values:c,onValuesChange:x})]})}function ra(e,t){let o=e?.find(r=>r.field==="launchedFromProtocolFamily");return o?o.operator==="in"?o.value:(console.warn("invalid token protocols filter",o),[...t||[]]):[...t||[]]}function To(e,t,o,r,s){let n=s?[...s.filter(i=>i.field!=="launchedFromProtocolFamily")]:[];return e&&e.length>0&&(e.every(a=>t.includes(a))||n.push({field:"launchedFromProtocolFamily",operator:"in",value:t})),o===void 0&&r===void 0&&n.length===0?void 0:{keywords:o,excludeKeywords:r,filters:n.length>0?n:void 0}}function aa({protocols:e,resolution:t,filters:o,onFiltersChange:r}){let{t:s}=useTranslation(),{isOpen:n,onOpen:i,onClose:a,onOpenChange:l}=useDisclosure(),[d,m]=useState(o),c=useCallback(()=>{m(void 0);},[]),p=useCallback(()=>{r?.(d),a();},[d,r,a]);useEffect(()=>{m(o);},[n,o]);let u=useMemo(()=>Object.values(o||{}).every(f=>f===void 0),[o]);return jsxs(Fragment,{children:[jsxs("button",{type:"button",onClick:i,style:{display:"inline-flex",alignItems:"center",justifyContent:"center",borderRadius:9999,border:"1px solid rgba(63,63,70,0.5)",background:"rgba(39,39,42,0.6)",width:32,height:32,minHeight:32,cursor:"pointer",position:"relative"},children:[jsx(FilterIcon,{width:16,height:16,className:"text-zinc-400"}),!u&&jsx("span",{style:{position:"absolute",top:-2,right:-2,width:8,height:8,borderRadius:4,background:"#c7ff2e"}})]}),jsx(StyledModal,{isOpen:n,onOpenChange:l,size:"md",scrollBehavior:"inside",children:jsxs(ModalContent,{className:"w-full h-full",children:[jsx(ModalHeader,{className:"px-4 py-2",children:jsx("span",{className:"text-base font-semibold",children:s("tokens.filters.modal.title")})}),jsx(ModalBody,{className:"px-0 pt-0 pb-4",children:jsx(ScrollShadow,{children:jsx(yo,{protocols:e,resolution:t,filters:d,onFiltersChange:m,className:"pb-4"})})}),jsx(ModalFooter,{className:"px-4",children:jsxs("div",{className:"w-full flex justify-between items-center",children:[jsx(Button,{variant:"light",color:"default",size:"sm",radius:"full",startContent:jsx(RefreshIcon,{width:16,height:16}),onPress:c,children:s("common.reset")}),jsx(Button,{color:"primary",size:"sm",radius:"full",onPress:p,children:s("common.apply")})]})})]})})]})}var tf={display:"inline-flex",alignItems:"center",gap:8,borderRadius:9999,border:"1px solid rgba(63,63,70,0.5)",background:"rgba(39,39,42,0.6)",padding:"6px 12px",fontSize:14,fontWeight:700,color:"#d4d4d8",cursor:"pointer",transition:"all 0.15s",height:32},of={position:"absolute",right:0,top:"100%",zIndex:20,marginTop:8,borderRadius:14,border:"1px solid rgba(39,39,42,1)",background:"rgba(24,24,27,1)",boxShadow:"0 25px 50px -12px rgba(0,0,0,0.5)",overflow:"hidden"},rf={height:1,background:"rgba(39,39,42,1)",margin:0};function ma({protocols:e,resolution:t,filters:o,onFiltersChange:r}){let{t:s}=useTranslation(),[n,i]=useState(false),a=useRef(null),[l,d]=useState(o),m=useCallback(()=>{d(void 0);},[]),c=useCallback(()=>{r?.(l),i(false);},[l,r]);useEffect(()=>{d(o);},[n,o]),useEffect(()=>{let u=f=>{a.current&&!a.current.contains(f.target)&&i(false);};return document.addEventListener("mousedown",u),()=>document.removeEventListener("mousedown",u)},[]),useEffect(()=>{if(!n)return;let u=f=>{f.key==="Escape"&&i(false);};return document.addEventListener("keydown",u),()=>document.removeEventListener("keydown",u)},[n]);let p=useMemo(()=>Object.values(o||{}).every(u=>u===void 0),[o]);return jsxs("div",{ref:a,style:{position:"relative"},children:[jsxs("div",{style:{position:"relative",display:"inline-flex"},children:[jsxs("button",{type:"button",style:tf,onMouseEnter:u=>{u.currentTarget.style.background="rgba(39,39,42,1)";},onMouseLeave:u=>{u.currentTarget.style.background="rgba(39,39,42,0.6)";},onClick:()=>i(u=>!u),children:[jsx(FilterIcon,{width:16,height:16,className:"flex-none"}),jsx("span",{className:"hidden sm:block",children:s("tokens.listHeader.filter")}),jsx(nf,{open:n})]}),!p&&jsx("span",{style:{position:"absolute",top:-4,right:-4,minWidth:8,height:8,borderRadius:4,background:"#c7ff2e"}})]}),n&&jsxs("div",{style:{...of,width:420},children:[jsx("div",{style:{padding:"16px 0"},children:jsx(ScrollShadow,{className:"w-full max-h-120 px-4",children:jsx(yo,{protocols:e,resolution:t,filters:l,onFiltersChange:d})})}),jsx("div",{style:rf}),jsxs("div",{style:{padding:"12px 16px",display:"flex",justifyContent:"space-between",alignItems:"center"},children:[jsx(Button,{variant:"light",size:"sm",color:"default",radius:"full",startContent:jsx(RefreshIcon,{width:16,height:16}),onPress:m,children:s("common.reset")}),jsx(Button,{variant:"solid",size:"sm",color:"primary",radius:"full",onPress:c,children:s("common.apply")})]})]})]})}function nf({open:e}){return jsx("svg",{viewBox:"0 0 24 24",style:{width:14,height:14,color:"#71717a",transition:"transform 0.15s",transform:e?"rotate(180deg)":void 0},fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:jsx("path",{d:"m6 9 6 6 6-6"})})}function c1({popoverPlacement:e="bottom-end",...t}){let{isMobile:o}=useScreen();return o?jsx(aa,{...t}):jsx(ma,{placement:e,...t})}function fa({resolution:e,onResolutionChange:t,resolutionOptions:o=["1m","5m","1h","4h","24h"]}){let{t:r}=useTranslation(),s=useCallback(n=>{t?.(n);},[t]);return jsx(StyledPlainTabs,{color:"primary",radius:"lg",selectedKey:e,onSelectionChange:s,"aria-label":"Select Resolution",classNames:{tabList:"gap-0",tab:"px-2",tabContent:"!text-zinc-500 group-data-[hover=true]:!text-foreground group-data-[selected=true]:!text-primary"},children:o.map(n=>jsx(Tab,{title:r(`common.resolution.${n}`)},n))})}var hf={display:"inline-flex",alignItems:"center",gap:4,borderRadius:9999,border:"1px solid rgba(63,63,70,0.5)",background:"rgba(39,39,42,0.6)",padding:"0 10px",fontSize:12,fontWeight:500,color:"#d4d4d8",cursor:"pointer",height:32,minHeight:32},bf={position:"absolute",left:0,top:"100%",zIndex:20,marginTop:6,borderRadius:14,border:"1px solid rgba(39,39,42,1)",background:"rgba(24,24,27,1)",boxShadow:"0 25px 50px -12px rgba(0,0,0,0.5)",overflow:"hidden",padding:"6px",minWidth:"100%"};function xa({resolution:e,onResolutionChange:t,resolutionOptions:o=["1m","5m","1h","4h","24h"]}){let{t:r}=useTranslation(),[s,n]=useState(false),i=useRef(null),a=useCallback(l=>{t?.(l),n(false);},[t]);return useEffect(()=>{if(!s)return;let l=m=>{i.current&&!i.current.contains(m.target)&&n(false);},d=m=>{m.key==="Escape"&&n(false);};return document.addEventListener("mousedown",l),document.addEventListener("keydown",d),()=>{document.removeEventListener("mousedown",l),document.removeEventListener("keydown",d);}},[s]),jsxs("div",{ref:i,style:{position:"relative",zIndex:50},children:[jsxs("button",{type:"button",style:hf,onClick:()=>n(l=>!l),children:[jsx("span",{children:e?r(`common.resolution.${e}`):"\u2014"}),jsx(ChevronDownIcon,{width:14,height:14,className:"text-zinc-500",style:{transition:"transform 0.15s",transform:s?"rotate(180deg)":void 0}})]}),s&&jsx("div",{style:bf,children:o.map(l=>jsx("button",{type:"button",onClick:()=>a(l),className:cn("w-full text-left px-3 py-1.5 rounded-lg text-xs font-medium transition-colors cursor-pointer",l===e?"text-primary bg-primary/10":"text-zinc-400 hover:text-foreground hover:bg-zinc-800"),children:r(`common.resolution.${l}`)},l))})]})}function L1(e){let{isMobile:t}=useScreen();return t?jsx(xa,{...e}):jsx(fa,{...e})}var ba=memo(function({token:t}){let{t:o}=useTranslation(),r=useMemo(()=>t.marketData?.bluechipHoldingsRatio,[t.marketData?.bluechipHoldingsRatio]),s=useMemo(()=>r!==void 0&&new SafeBigNumber(r).gte(.1),[r]),n=useMemo(()=>r===void 0||new SafeBigNumber(r).lt(.05),[r]);return jsx(StyledTooltip,{content:o("tokens.bluechip.explained"),children:jsxs("div",{className:"flex items-center gap-2.5",children:[s&&jsx(HorsePowerHighIcon,{}),n&&jsx(HorsePowerLowIcon,{}),!s&&!n&&jsx(HorsePowerIcon,{}),jsx("span",{className:cn(s&&"text-bullish",!s&&!n&&"text-bearish",r===void 0&&"text-neutral"),children:formatPercent(r)})]})})});function $f(e){return e.length<=10?e:`${e.slice(0,4)}...${e.slice(-4)}`}var wa=memo(function({token:t}){let o=useCopyToClipboard(),[r,s]=useState(false),[n,i]=useState(false),a=useRef(void 0),l=useRef(void 0),{t:d}=useTranslation(),m=useCallback(u=>{u.preventDefault(),u.stopPropagation(),o(t.name,()=>{toast.success(d("tokens.copied.name")),s(true),a.current&&clearTimeout(a.current),a.current=setTimeout(()=>{s(false);},2e3);});},[o,t.name,d]),c=useCallback(u=>{u.preventDefault(),u.stopPropagation(),o(t.address,()=>{toast.success(d("tokens.copied.address")),i(true),l.current&&clearTimeout(l.current),l.current=setTimeout(()=>{i(false);},2e3);});},[o,t.address,d]);useEffect(()=>()=>{a.current&&clearTimeout(a.current),l.current&&clearTimeout(l.current);},[]);let p=useTickAge(t.createdAt);return jsxs("div",{className:"w-full flex justify-start items-center gap-3",children:[jsx(ce,{token:t,showProgress:false,className:"w-10 h-10 sm:w-16 sm:h-16 flex-none"}),jsxs("div",{className:"flex-auto flex flex-col gap-1 min-w-0",children:[jsxs("div",{className:"flex items-center gap-1",children:[jsx("span",{className:"flex-none font-medium tracking-[-0.02em]",children:t.symbol}),jsx(StyledTooltip,{content:t.name,children:jsxs("div",{className:"flex-initial flex items-center gap-1 min-w-0 text-neutral hover:text-primary-200 cursor-pointer",onClick:m,children:[jsx("div",{className:"flex-initial whitespace-nowrap truncate",children:t.name}),r?jsx(CheckIcon,{className:"flex-none w-3 h-3 sm:w-3.5 sm:h-3.5"}):jsx(CopyIcon,{className:"flex-none w-3 h-3 sm:w-3.5 sm:h-3.5"})]})})]}),jsxs("div",{className:"flex items-center gap-2",children:[jsx("span",{className:"text-primary text-xs sm:text-sm font-medium",children:formatAge(p)}),jsxs("button",{type:"button",className:"group flex items-center gap-1 min-w-0 max-w-28 sm:max-w-36 text-neutral hover:text-primary-200 cursor-pointer",onClick:c,"aria-label":d("tokens.copied.address"),children:[jsx("span",{className:"min-w-0 truncate text-left text-xs font-mono text-neutral/70 group-hover:text-primary-200",children:$f(t.address)}),n?jsx(CheckIcon,{className:"flex-none w-3 h-3"}):jsx(CopyIcon,{className:"flex-none w-3 h-3"})]}),t.socialMedias?.website&&jsx(Link,{href:t.socialMedias.website,className:"max-sm:hidden text-neutral hover:text-primary",target:"_blank",children:jsx(WebsiteIcon,{className:"w-3.5 h-3.5 sm:w-4 sm:h-4"})}),t.socialMedias?.twitter&&jsx(Link,{href:t.socialMedias.twitter,className:"max-sm:hidden text-neutral hover:text-primary",target:"_blank",children:jsx(TwitterIcon,{className:"w-3.5 h-3.5 sm:w-4 sm:h-4"})}),t.socialMedias?.telegram&&jsx(Link,{href:t.socialMedias.telegram,className:"max-sm:hidden text-neutral hover:text-primary",target:"_blank",children:jsx(TelegramIcon,{className:"w-3.5 h-3.5 sm:w-4 sm:h-4"})}),t.socialMedias?.discord&&jsx(Link,{href:t.socialMedias.discord,className:"max-sm:hidden text-neutral hover:text-primary",target:"_blank",children:jsx(DiscordIcon,{className:"w-3.5 h-3.5 sm:w-4 sm:h-4"})}),jsx(Link,{href:searchTwitterUrl(`${t.symbol} OR ${t.address}`),className:"max-sm:hidden text-neutral hover:text-primary",target:"_blank",children:jsx(SearchIcon,{className:"w-3.5 h-3.5 sm:w-4 sm:h-4"})})]})]})]})});var La=memo(function({token:t}){let{t:o}=useTranslation(),r=t.marketData,s=useMemo(()=>new SafeBigNumber(r?.top10HoldingsRatio).gte(.1),[r?.top10HoldingsRatio]),n=useMemo(()=>new SafeBigNumber(r?.devHoldingsRatio).gte(.1),[r?.devHoldingsRatio]),i=useMemo(()=>new SafeBigNumber(r?.sniperHoldingsRatio).gte(.1),[r?.sniperHoldingsRatio]),a=useMemo(()=>new SafeBigNumber(r?.insiderHoldingsRatio).gte(.1),[r?.insiderHoldingsRatio]),l=useMemo(()=>new SafeBigNumber(r?.bundleHoldingsRatio).gte(.1),[r?.bundleHoldingsRatio]);return jsxs("div",{className:"w-full h-full flex flex-col gap-1 justify-center",children:[jsxs("div",{className:"flex items-center gap-1",children:[jsx($,{icon:jsx(PeopleIcon,{width:12,height:12}),value:formatAmount(r?.holders),tooltip:o("tokens.tokenInfo.holders"),warning:false,disable:!r?.holders}),jsx($,{icon:jsx(KlineCandlesIcon,{width:12,height:12}),value:formatAmount(r?.proHolders),tooltip:o("tokens.tokenInfo.proHolders"),warning:false,disable:!r?.proHolders}),jsx($,{icon:jsx(StarIcon,{width:12,height:12}),value:formatAmount(r?.kolHolders),tooltip:o("tokens.tokenInfo.kolHolders"),warning:false,disable:!r?.kolHolders}),jsx($,{icon:jsx(UserWithStarBadgeIcon,{width:12,height:12}),value:formatPercent(r?.top10HoldingsRatio),tooltip:o("tokens.tokenInfo.top10HoldingsRatio"),warning:s,disable:!r?.top10HoldingsRatio||r?.top10HoldingsRatio==="0"})]}),jsxs("div",{className:"flex items-center gap-1",children:[jsx($,{icon:jsx(CookIcon,{width:12,height:12}),value:formatPercent(r?.devHoldingsRatio),tooltip:o("tokens.tokenInfo.devHoldingsRatio"),warning:n,disable:!r?.devHoldingsRatio||r?.devHoldingsRatio==="0",tooltipPlacement:"bottom"}),jsx($,{icon:jsx(SniperIcon,{width:12,height:12}),value:formatPercent(r?.sniperHoldingsRatio),tooltip:o("tokens.tokenInfo.sniperHoldingsRatio"),warning:i,disable:!r?.sniperHoldingsRatio||r?.sniperHoldingsRatio==="0",tooltipPlacement:"bottom"}),jsx($,{icon:jsx(RatIcon,{width:12,height:12}),value:formatPercent(r?.insiderHoldingsRatio),tooltip:o("tokens.tokenInfo.insiderHoldingsRatio"),warning:a,disable:!r?.insiderHoldingsRatio||r?.insiderHoldingsRatio==="0",tooltipPlacement:"bottom"}),jsx($,{icon:jsx(BundlesIcon,{width:12,height:12}),value:formatPercent(r?.bundleHoldingsRatio),tooltip:o("tokens.tokenInfo.bundleHoldingsRatio"),warning:l,disable:!r?.bundleHoldingsRatio||r?.bundleHoldingsRatio==="0",tooltipPlacement:"bottom"})]})]})});var Pa=memo(function({token:t}){let o=useMemo(()=>t.marketData?.tvlInUsd,[t.marketData?.tvlInUsd]);return jsx(Fragment,{children:formatAmountUSD(o)})});var Ra=memo(function({token:t}){let o=useMemo(()=>t.marketData?.marketCapInUsd,[t.marketData?.marketCapInUsd]);return jsx(Fragment,{children:formatAmountUSD(o)})});var Ia=memo(function({token:t,resolution:o}){let r=useMemo(()=>t.marketData?.priceInUsd,[t.marketData?.priceInUsd]),s=useMemo(()=>t.stats?.[o]?.priceChange,[t,o]),n=useMemo(()=>s?new SafeBigNumber(s).abs().toString():void 0,[s]),i=useMemo(()=>s&&new SafeBigNumber(s).gte(0),[s]);return jsxs("div",{className:"flex flex-col gap-1 justify-center items-start",children:[jsx("span",{children:formatPriceUSD(r)}),jsxs("span",{className:cn("inline-flex gap-1 items-center text-xs",i?"text-bullish":"text-bearish"),children:[i?jsx(TriangleUpIcon,{width:10,height:10}):jsx(TriangleDownIcon,{width:10,height:10}),jsx("span",{children:formatPercent(n)})]})]})});var Fa=memo(function({token:t,resolution:o}){let r=useMemo(()=>t.stats?.[o]?.traders,[t.stats?.[o]?.traders]),s=useMemo(()=>t.stats?.[o]?.buyers,[t.stats?.[o]?.buyers]),n=useMemo(()=>t.stats?.[o]?.sellers,[t.stats?.[o]?.sellers]);return jsxs("div",{className:"flex flex-col gap-1 justify-center items-start",children:[jsx("span",{children:formatAmount(r)}),jsxs("div",{className:"flex gap-1 text-xs",children:[jsx("span",{className:"text-bullish",children:formatAmount(s)}),"/",jsx("span",{className:"text-bearish",children:formatAmount(n)})]})]})});var Oa=memo(function({token:t,resolution:o}){let r=useMemo(()=>t.stats?.[o]?.trades,[t.stats?.[o]?.trades]),s=useMemo(()=>t.stats?.[o]?.buys,[t.stats?.[o]?.buys]),n=useMemo(()=>t.stats?.[o]?.sells,[t.stats?.[o]?.sells]);return jsxs("div",{className:"flex flex-col gap-1 justify-center items-start",children:[jsx("span",{children:formatAmount(r)}),jsxs("div",{className:"flex gap-1 text-xs",children:[jsx("span",{className:"text-bullish",children:formatAmount(s)}),"/",jsx("span",{className:"text-bearish",children:formatAmount(n)})]})]})});var Ea=memo(function({token:t,resolution:o}){let r=useMemo(()=>t.stats?.[o]?.volumesInUsd,[t.stats?.[o]?.volumesInUsd]),s=useMemo(()=>t.stats?.[o]?.buyVolumesInUsd,[t.stats?.[o]?.buyVolumesInUsd]),n=useMemo(()=>t.stats?.[o]?.sellVolumesInUsd,[t.stats?.[o]?.sellVolumesInUsd]);return jsxs("div",{className:"flex flex-col gap-1 justify-center items-start",children:[jsx("span",{children:formatAmountUSD(r)}),jsxs("div",{className:"flex gap-1 text-xs",children:[jsx("span",{className:"text-bullish",children:formatAmountUSD(s)}),"/",jsx("span",{className:"text-bearish",children:formatAmountUSD(n)})]})]})});var bg=`
22
22
  @keyframes tklShimmer{0%{background-position:200% 0}100%{background-position:-200% 0}}
23
- `,qf={background:"linear-gradient(90deg, rgba(255,255,255,0.03) 25%, rgba(255,255,255,0.06) 50%, rgba(255,255,255,0.03) 75%)",backgroundSize:"200% 100%",animation:"tklShimmer 1.8s ease-in-out infinite",borderRadius:6};function B(e,t,o,r){return {...qf,animationDelay:`${e}ms`,width:t,height:o,...r}}var ba=10;function Ta({rowHeight:e,hasActions:t,isMobile:o}){return jsxs(Fragment,{children:[jsx("style",{children:zf}),Array.from({length:ba}).map((r,n)=>jsx(Qf,{index:n,rowHeight:e,hasActions:t,isMobile:o,isLast:n===ba-1},n))]})}function Qf({index:e,rowHeight:t,hasActions:o,isMobile:r,isLast:n}){let s=e*80,i=r?208:320,l=r?40:64,a=r?72:124,d=r?64:97;return jsxs("div",{style:{display:"flex",alignItems:"center",height:t,borderBottom:n?void 0:"1px solid rgba(39,39,42,0.3)"},children:[jsxs("div",{style:{width:i,padding:r?"0 12px":"0 12px 0 24px",display:"flex",alignItems:"center",gap:12,flexShrink:0},children:[jsx("div",{style:B(s,l,l,{borderRadius:8,flexShrink:0})}),jsxs("div",{style:{display:"flex",flexDirection:"column",gap:8,flex:1},children:[jsx("div",{style:B(s+30,"60%",20)}),jsx("div",{style:B(s+60,"80%",16)})]})]}),jsxs("div",{style:{width:128,padding:"0 12px",display:"flex",flexDirection:"column",justifyContent:"center",gap:4},children:[jsx("div",{style:B(s+20,72,20)}),jsx("div",{style:B(s+40,52,16)})]}),jsx("div",{style:{width:106,padding:"0 12px",display:"flex",alignItems:"center"},children:jsx("div",{style:B(s+30,64,20)})}),jsx("div",{style:{width:106,padding:"0 12px",display:"flex",alignItems:"center"},children:jsx("div",{style:B(s+40,60,20)})}),jsxs("div",{style:{width:138,padding:"0 12px",display:"flex",flexDirection:"column",justifyContent:"center",gap:4},children:[jsx("div",{style:B(s+50,72,20)}),jsx("div",{style:B(s+70,100,16)})]}),jsxs("div",{style:{width:126,padding:"0 12px",display:"flex",flexDirection:"column",justifyContent:"center",gap:4},children:[jsx("div",{style:B(s+60,48,20)}),jsx("div",{style:B(s+80,80,16)})]}),jsxs("div",{style:{width:126,padding:"0 12px",display:"flex",flexDirection:"column",justifyContent:"center",gap:4},children:[jsx("div",{style:B(s+70,40,20)}),jsx("div",{style:B(s+90,72,16)})]}),jsxs("div",{style:{width:128,padding:"0 12px",display:"flex",alignItems:"center",gap:10},children:[jsx("div",{style:B(s+80,20,20,{borderRadius:4})}),jsx("div",{style:B(s+90,52,20)})]}),jsxs("div",{style:{width:308,padding:"0 12px",display:"flex",alignItems:"center",gap:20},children:[jsxs("div",{style:{display:"flex",flexDirection:"column",gap:8},children:[jsx("div",{style:B(s+80,52,16)}),jsx("div",{style:B(s+100,40,16)}),jsx("div",{style:B(s+120,36,16)})]}),jsxs("div",{style:{display:"flex",flexDirection:"column",gap:8},children:[jsx("div",{style:B(s+90,48,16)}),jsx("div",{style:B(s+110,40,16)}),jsx("div",{style:B(s+130,40,16)})]}),jsxs("div",{style:{display:"flex",flexDirection:"column",gap:8},children:[jsx("div",{style:B(s+100,40,16)}),jsx("div",{style:B(s+120,36,16)})]})]}),o&&jsx("div",{style:{width:a,padding:r?"0 12px 0 0":"0 24px 0 12px",display:"flex",alignItems:"center",justifyContent:"flex-end"},children:jsx("div",{style:B(s+100,d,32,{borderRadius:8})})})]})}var tg=100,og=200,rg=72;function at({tokens:e,resolution:t="24h",isLoading:o,ActionsComponent:r,onSelectToken:n,sortDirections:s,onSortChange:i,onScrollingChange:l,height:a=600,itemHeight:d=88,itemHeightMobile:m=72,className:c}){let{isMobile:p}=useScreen(),u=p?m:d,g=useMemo(()=>e.slice(0,tg),[e]),k=o&&e.length===0,x=useRef(void 0),f=useRef(false),{t:h}=useTranslation(),b=useCallback(w=>W=>{W.preventDefault(),W.stopPropagation(),n?.(w);},[n]),[T,U]=useState(s??{});useEffect(()=>{U(s??{});},[s]);let I=useCallback(w=>W=>{let ct={[w]:W};U(ct),i?.(ct);},[i]),q=useCallback(w=>{f.current||(f.current=true,l?.(true)),x.current&&clearTimeout(x.current),x.current=setTimeout(()=>{f.current=false,l?.(false);},180);},[l]);useEffect(()=>()=>{x.current&&clearTimeout(x.current),f.current&&l?.(false);},[l]);let ve=cn("h-full mx-auto",c??(r?"max-w-362 sm:max-w-403":"max-w-331 sm:max-w-372")),_=r?"!w-[1438px] min-w-[1438px] max-w-[1438px]":"!w-[1366px] min-w-[1366px] max-w-[1366px]",ke=[jsx(TableColumn,{textValue:h("tokens.listHeader.token"),width:p?og:320,className:cn("bg-[#0a0a0b] sticky left-0 z-10",p&&"!w-[200px] min-w-[200px] max-w-[200px] overflow-hidden","shadow-[1px_0_0_0_rgba(39,39,42,0.6)]"),children:h("tokens.listHeader.token")},"token"),jsx(TableColumn,{textValue:h("tokens.listHeader.price"),width:128,children:jsxs("div",{className:"flex items-center gap-1",children:[jsx(Sortable,{sort:T.price,onSortChange:I("price"),children:h("tokens.listHeader.price")}),jsx("span",{children:"/"}),jsx(Sortable,{sort:T[`priceChange${t}`],onSortChange:I(`priceChange${t}`),children:h("tokens.listHeader.priceChange",{resolution:t})})]})},"price"),jsx(TableColumn,{textValue:h("tokens.listHeader.marketCap"),width:106,children:jsx(Sortable,{sort:T.marketCap,onSortChange:I("marketCap"),children:h("tokens.listHeader.marketCap")})},"marketCap"),jsx(TableColumn,{textValue:h("tokens.listHeader.liquidity"),width:106,children:jsx(Sortable,{sort:T.tvl,onSortChange:I("tvl"),children:h("tokens.listHeader.liquidity")})},"liquidity"),jsx(TableColumn,{textValue:h("tokens.listHeader.volumes",{resolution:t}),width:138,children:jsx(Sortable,{sort:T[`volumes${t}`],onSortChange:I(`volumes${t}`),children:h("tokens.listHeader.volumes",{resolution:t})})},"volumes"),jsx(TableColumn,{textValue:h("tokens.listHeader.txs",{resolution:t}),width:126,children:jsx(Sortable,{sort:T[`trades${t}`],onSortChange:I(`trades${t}`),children:h("tokens.listHeader.txs",{resolution:t})})},"txs"),jsx(TableColumn,{textValue:h("tokens.listHeader.traders",{resolution:t}),width:126,children:jsx(Sortable,{sort:T[`traders${t}`],onSortChange:I(`traders${t}`),children:h("tokens.listHeader.traders",{resolution:t})})},"traders"),jsx(TableColumn,{textValue:h("tokens.listHeader.bluechip"),width:128,children:h("tokens.listHeader.bluechip")},"bluechip"),jsx(TableColumn,{textValue:h("tokens.listHeader.tokenInfo"),width:308,children:h("tokens.listHeader.tokenInfo")},"tokenInfo"),r?jsx(TableColumn,{textValue:h("tokens.listHeader.actions"),width:p?rg:124,align:"end",className:cn("bg-[#0a0a0b] sticky right-0 z-10",p&&"!w-[72px] min-w-[72px] max-w-[72px]","shadow-[-1px_0_0_0_rgba(39,39,42,0.6)]"),children:h("tokens.listHeader.actions")},"actions"):void 0].filter(Boolean),he=jsx(Ta,{rowHeight:u,hasActions:!!r,isMobile:p}),M=jsxs("div",{children:[jsx(EmptyIcon,{className:"w-10 h-10 mx-auto text-neutral"}),jsx("p",{className:"mt-2 text-sm text-neutral text-center",children:h("common.empty")})]}),re=w=>[jsx(TableCell,{className:cn("sticky left-0 z-10 bg-[#0a0a0b]",p&&"!w-[200px] min-w-[200px] max-w-[200px] overflow-hidden","shadow-[1px_0_0_0_rgba(39,39,42,0.6)]","transition-colors duration-150","[tr:hover_&]:bg-[#161617]"),children:jsx(ia,{token:w,resolution:t})},"token"),jsx(TableCell,{children:jsx(pa,{token:w,resolution:t})},"price"),jsx(TableCell,{children:jsx(da,{token:w,resolution:t})},"marketCap"),jsx(TableCell,{children:jsx(la,{token:w,resolution:t})},"liquidity"),jsx(TableCell,{children:jsx(ha,{token:w,resolution:t})},"volumes"),jsx(TableCell,{children:jsx(xa,{token:w,resolution:t})},"trades"),jsx(TableCell,{children:jsx(fa,{token:w,resolution:t})},"traders"),jsx(TableCell,{children:jsx(na,{token:w,resolution:t})},"bluechip"),jsx(TableCell,{children:jsx(aa,{token:w,resolution:t})},"tokenInfo"),r?jsx(TableCell,{className:cn("sticky right-0 z-10 bg-[#0a0a0b]",p&&"!w-[72px] min-w-[72px] max-w-[72px]","shadow-[-1px_0_0_0_rgba(39,39,42,0.6)]","transition-colors duration-150","[tr:hover_&]:bg-[#161617]"),children:jsx("div",{className:cn("!absolute inset-y-0 right-3 z-1 w-fit","flex items-center justify-end"),children:jsx(r,{token:w,resolution:t})})},"actions"):void 0].filter(Boolean),F=w=>jsx(TableRow,{onClick:n?b(w):void 0,children:re(w)},w.address);return p?jsx("div",{"data-token-list-mobile-scroll":true,className:cn("h-full min-h-0 w-full overflow-y-auto overflow-x-hidden overscroll-contain","mx-auto",c??(r?"max-w-362 sm:max-w-403":"max-w-331 sm:max-w-372")),style:{height:a},onScroll:q,children:jsx("div",{"data-token-list-horizontal-scroll":true,className:"w-full overflow-x-auto overflow-y-visible",children:jsxs(StyledTable,{isHeaderSticky:true,radius:"none",classNames:{table:cn("table-fixed",_),wrapper:"p-0 w-full !max-h-none !overflow-x-visible !overflow-y-visible bg-transparent rounded-none shadow-none",loadingWrapper:"flex-col justify-start items-start",emptyWrapper:"pt-30"},"aria-label":"Tokens",children:[jsx(TableHeader,{children:ke}),jsx(TableBody,{items:g,isLoading:k,loadingContent:he,emptyContent:M,children:F})]})})}):jsxs(StyledTable,{isHeaderSticky:true,isVirtualized:true,radius:"lg",className:ve,classNames:{loadingWrapper:"flex-col justify-start items-start",emptyWrapper:"pt-30"},onScrollCapture:q,maxTableHeight:a,rowHeight:u,"aria-label":"Tokens",children:[jsx(TableHeader,{children:ke}),jsx(TableBody,{items:e,isLoading:k,loadingContent:he,emptyContent:M,children:F})]})}function Pa({token:e,resolution:t,renderAction:o,isLast:r=false,onSelectToken:n,className:s}){let{t:i}=useTranslation(),l=useCopyToClipboard(),a=useTickAge(e.createdAt),d=useCallback(()=>{n?.(e);},[n,e]),m=useCallback(W=>{W.stopPropagation(),l(e.address,()=>toast.success(i("tokens.copied.address")));},[l,e.address,i]),c=e.marketData,p=e.stats?.[t],u=useMemo(()=>c?.priceInUsd,[c?.priceInUsd]),g=useMemo(()=>p?.priceChange,[p?.priceChange]),k=useMemo(()=>g&&new SafeBigNumber(g).gte(0),[g]),x=useMemo(()=>g?new SafeBigNumber(g).abs().toString():void 0,[g]),f=useMemo(()=>p?.volumesInUsd,[p?.volumesInUsd]),h=useMemo(()=>p?.buyVolumesInUsd,[p?.buyVolumesInUsd]),b=useMemo(()=>p?.sellVolumesInUsd,[p?.sellVolumesInUsd]),T=useMemo(()=>p?.trades,[p?.trades]),U=useMemo(()=>c?.marketCapInUsd,[c?.marketCapInUsd]),I=useMemo(()=>c?.tvlInUsd,[c?.tvlInUsd]),q=useMemo(()=>new SafeBigNumber(c?.top10HoldingsRatio).gte(.1),[c?.top10HoldingsRatio]),ve=useMemo(()=>new SafeBigNumber(c?.devHoldingsRatio).gte(.1),[c?.devHoldingsRatio]),_=useMemo(()=>new SafeBigNumber(c?.sniperHoldingsRatio).gte(.1),[c?.sniperHoldingsRatio]),ke=useMemo(()=>new SafeBigNumber(c?.insiderHoldingsRatio).gte(.1),[c?.insiderHoldingsRatio]),he=useMemo(()=>new SafeBigNumber(c?.bundleHoldingsRatio).gte(.1),[c?.bundleHoldingsRatio]),M=c?.holders!==void 0&&c.holders>0,re=c?.kolHolders!==void 0&&c.kolHolders>0,F=c?.bluechipHolders!==void 0&&c.bluechipHolders>0,w=M||re||F;return jsxs("div",{className:cn("relative w-full h-full overflow-hidden px-4 py-3 hover:bg-content2/40 cursor-pointer",!r&&"border-b",s),style:r?void 0:{borderBottomColor:"rgba(39,39,42,0.6)"},onClick:n?d:void 0,children:[jsxs("div",{className:"flex items-start gap-2",children:[jsxs("div",{className:"flex-none flex flex-col items-center gap-2",children:[jsx(de,{token:e,enableSearch:true,enablePreview:!!e.image,showProgress:false,className:"w-20 h-20"}),jsxs("button",{type:"button",className:"text-xs font-mono text-neutral hover:text-foreground leading-none",onClick:m,"aria-label":i("tokens.copied.address"),title:i("tokens.copied.address"),children:[e.address.slice(0,4),"...",e.address.slice(-4)]})]}),jsxs("div",{className:"flex-1 min-w-0 flex flex-col gap-2.5",children:[jsxs("button",{type:"button",className:"flex items-center gap-1.5 min-w-0 text-left",onClick:m,"aria-label":i("tokens.copied.address"),title:i("tokens.copied.address"),children:[jsx("span",{className:"flex-none text-sm font-semibold leading-none whitespace-nowrap overflow-hidden text-ellipsis max-w-24",children:e.symbol}),jsx(StyledTooltip,{content:e.name,children:jsx("span",{className:"text-[13px] leading-none text-neutral truncate max-w-20",children:e.name})}),jsx(CopyIcon,{className:"flex-none w-3.5 h-3.5 text-neutral"})]}),jsxs("div",{className:"flex items-center gap-2 leading-none",children:[jsx("span",{className:"text-[13px] font-mono font-medium text-neutral",children:formatAge(a)}),e.socialMedias?.website&&jsx(Link,{href:e.socialMedias.website,className:"text-neutral hover:text-primary",target:"_blank",onClick:W=>W.stopPropagation(),children:jsx(WebsiteIcon,{className:"w-3.5 h-3.5"})}),e.socialMedias?.twitter&&jsx(Link,{href:e.socialMedias.twitter,className:"text-neutral hover:text-primary",target:"_blank",onClick:W=>W.stopPropagation(),children:jsx(TwitterIcon,{className:"w-3.5 h-3.5"})}),e.socialMedias?.telegram&&jsx(Link,{href:e.socialMedias.telegram,className:"text-neutral hover:text-primary",target:"_blank",onClick:W=>W.stopPropagation(),children:jsx(TelegramIcon,{className:"w-3.5 h-3.5"})}),jsx(Link,{href:searchTwitterUrl(`${e.symbol} OR ${e.address}`),className:"max-sm:hidden text-neutral hover:text-primary",target:"_blank",onClick:W=>W.stopPropagation(),children:jsx(SearchIcon,{className:"w-3.5 h-3.5"})})]}),jsxs("div",{className:"flex items-center gap-2 text-xs font-mono text-foreground/80 leading-none",children:[jsxs("span",{className:"inline-flex items-baseline gap-1",children:[jsx("span",{className:"text-neutral",children:"MC"}),jsx("span",{children:formatAmountUSDCompact(U)})]}),jsx("span",{className:"text-neutral/30",children:"\xB7"}),jsxs("span",{className:"inline-flex items-baseline gap-1",children:[jsx("span",{className:"text-neutral",children:"Liq"}),jsx("span",{children:formatAmountUSDCompact(I)})]})]}),w&&jsxs("div",{className:"flex items-center gap-2 text-xs font-mono text-neutral leading-none",children:[M&&jsx(StyledTooltip,{content:i("tokens.tokenInfo.holders"),children:jsxs("span",{className:"inline-flex items-center gap-1",children:[jsx(PeopleIcon,{className:"w-3 h-3 text-neutral"}),formatAmount(c?.holders)]})}),re&&jsx(StyledTooltip,{content:i("tokens.tokenInfo.kolHolders"),children:jsxs("span",{className:"inline-flex items-center gap-1",children:[jsx(CrownIcon,{className:"w-3 h-3 text-neutral"}),formatAmount(c?.kolHolders)]})}),F&&jsx(StyledTooltip,{content:i("tokens.listHeader.bluechip"),children:jsxs("span",{className:"inline-flex items-center gap-1",children:[jsx(ShiningStarIcon,{className:"w-3 h-3 text-neutral"}),formatAmount(c?.bluechipHolders)]})})]})]}),jsxs("div",{className:"flex-none flex flex-col items-end gap-2.5 leading-none font-mono",children:[jsxs("div",{className:"flex flex-col items-end gap-1",children:[jsx("span",{className:"text-base font-bold text-foreground leading-none",children:formatPriceUSD(u)}),jsxs("span",{className:cn("inline-flex items-center gap-0.5 text-[10px] leading-none",k?"text-bullish":"text-bearish"),children:[k?jsx(TriangleUpIcon,{width:8,height:8}):jsx(TriangleDownIcon,{width:8,height:8}),g===void 0?"--":formatPercent(x)]})]}),jsxs("div",{className:"flex flex-col items-end gap-1",children:[jsxs("div",{className:"flex items-baseline gap-1",children:[jsx("span",{className:"text-xs text-neutral",children:"V"}),jsx("span",{className:"text-xs text-foreground/80",children:formatAmountUSDCompact(f)})]}),jsxs("span",{className:"text-[10px] leading-none",children:[jsx("span",{className:"text-bullish",children:formatAmountUSDCompact(h)}),jsx("span",{className:"text-neutral/50 mx-0.5",children:"/"}),jsx("span",{className:"text-bearish",children:formatAmountUSDCompact(b)})]})]}),jsxs("div",{className:"flex items-baseline gap-1",children:[jsx("span",{className:"text-xs text-neutral",children:"TX"}),jsx("span",{className:"text-xs text-foreground/80",children:formatAmount(T)})]})]})]}),jsxs("div",{className:"mt-2.5 flex items-start gap-4 relative",children:[jsx(HorizontalScrollContainer,{className:"flex-auto min-w-0",forceShowArrows:true,children:jsxs("div",{className:"flex items-center gap-1",children:[jsx($,{icon:jsx(UserWithStarBadgeIcon,{width:12,height:12}),value:formatPercent(c?.top10HoldingsRatio),tooltip:i("tokens.tokenInfo.top10HoldingsRatio"),warning:q,disable:!c?.top10HoldingsRatio||c?.top10HoldingsRatio==="0"}),jsx($,{icon:jsx(CookIcon,{width:12,height:12}),value:formatPercent(c?.devHoldingsRatio),tooltip:i("tokens.tokenInfo.devHoldingsRatio"),warning:ve,disable:!c?.devHoldingsRatio||c?.devHoldingsRatio==="0"}),jsx($,{icon:jsx(SniperIcon,{width:12,height:12}),value:formatPercent(c?.sniperHoldingsRatio),tooltip:i("tokens.tokenInfo.sniperHoldingsRatio"),warning:_,disable:!c?.sniperHoldingsRatio||c?.sniperHoldingsRatio==="0"}),jsx($,{icon:jsx(RatIcon,{width:12,height:12}),value:formatPercent(c?.insiderHoldingsRatio),tooltip:i("tokens.tokenInfo.insiderHoldingsRatio"),warning:ke,disable:!c?.insiderHoldingsRatio||c?.insiderHoldingsRatio==="0"}),jsx($,{icon:jsx(BundlesIcon,{width:12,height:12}),value:formatPercent(c?.bundleHoldingsRatio),tooltip:i("tokens.tokenInfo.bundleHoldingsRatio"),warning:he,disable:!c?.bundleHoldingsRatio||c?.bundleHoldingsRatio==="0"})]})}),o&&jsx("div",{className:"flex-none relative",onClick:W=>W.stopPropagation(),children:o(e)})]})]})}function Ra({isLast:e=false}){return jsxs("div",{className:cn("w-full h-full overflow-hidden px-4 py-3 animate-pulse",!e&&"border-b"),style:e?void 0:{borderBottomColor:"rgba(39,39,42,0.6)"},children:[jsxs("div",{className:"flex items-start gap-2",children:[jsxs("div",{className:"flex-none flex flex-col items-center gap-2",children:[jsx("div",{className:"w-20 h-20 rounded-lg bg-content2"}),jsx("div",{className:"w-14 h-2.5 rounded bg-content2"})]}),jsxs("div",{className:"flex-1 min-w-0 flex flex-col gap-2",children:[jsxs("div",{className:"flex items-center gap-1.5",children:[jsx("div",{className:"w-16 h-3.5 rounded bg-content2"}),jsx("div",{className:"w-20 h-3.5 rounded bg-content2"}),jsx("div",{className:"w-3.5 h-3.5 rounded bg-content2"})]}),jsxs("div",{className:"flex items-center gap-2",children:[jsx("div",{className:"w-8 h-3 rounded bg-content2"}),jsx("div",{className:"w-3.5 h-3.5 rounded bg-content2"}),jsx("div",{className:"w-3.5 h-3.5 rounded bg-content2"}),jsx("div",{className:"w-3.5 h-3.5 rounded bg-content2"})]}),jsxs("div",{className:"flex items-center gap-2",children:[jsx("div",{className:"w-12 h-3 rounded bg-content2"}),jsx("div",{className:"w-12 h-3 rounded bg-content2"}),jsx("div",{className:"w-10 h-3 rounded bg-content2"})]})]}),jsxs("div",{className:"flex-none flex flex-col items-end gap-3",children:[jsxs("div",{className:"flex flex-col items-end gap-1",children:[jsx("div",{className:"w-16 h-4 rounded bg-content2"}),jsx("div",{className:"w-12 h-2.5 rounded bg-content2"})]}),jsxs("div",{className:"flex flex-col items-end gap-1",children:[jsx("div",{className:"w-14 h-3 rounded bg-content2"}),jsx("div",{className:"w-12 h-2.5 rounded bg-content2"})]})]})]}),jsxs("div",{className:"mt-2.5 flex items-center gap-2",children:[jsxs("div",{className:"flex-1 min-w-0 flex items-center gap-1 overflow-hidden",children:[jsx("div",{className:"w-12 h-5 rounded-full bg-content2"}),jsx("div",{className:"w-12 h-5 rounded-full bg-content2"}),jsx("div",{className:"w-12 h-5 rounded-full bg-content2"}),jsx("div",{className:"w-12 h-5 rounded-full bg-content2"}),jsx("div",{className:"w-12 h-5 rounded-full bg-content2"})]}),jsx("div",{className:"w-16 h-7 rounded-md bg-content2 flex-none"})]})]})}var Hg=154,Aa=10;function Ig({index:e,style:t,tokens:o,skeletonCount:r,resolution:n,renderAction:s,onSelectToken:i}){return o?jsx("div",{style:t,children:jsx(Pa,{token:o[e],resolution:n,isLast:e===o.length-1,renderAction:s,onSelectToken:i})}):jsx("div",{style:t,children:jsx(Ra,{isLast:e===r-1})})}function E2({tokens:e,resolution:t="24h",isLoading:o,height:r=600,renderAction:n,onSelectToken:s,className:i}){let l=o||!e?void 0:e,a=l?l.length:Aa,d=useMemo(()=>({tokens:l,skeletonCount:Aa,resolution:t,renderAction:n,onSelectToken:s}),[l,t,n,s]);return jsx("div",{className:cn("w-full h-full overflow-hidden border rounded-lg",i),style:{background:"rgba(24,24,27,0.4)",borderColor:"rgba(39,39,42,0.6)"},children:jsx(List,{className:"h-full w-full",style:{height:r},rowCount:a,rowHeight:Hg,overscanCount:5,rowComponent:Ig,rowProps:d})})}var Dg=80;function Bg(e){return {chain:e.chain,address:e.address,name:e.name??"",symbol:e.symbol??"",decimals:e.decimals??0,image:e.image,description:e.description,socialMedias:e.socialMedias,launchedFrom:e.launchedFrom,migratedTo:e.migratedTo,createdAt:e.createdAt}}function Fa(e){return e.sort((t,o)=>{let r=t.createdAt?.getTime()??0;return (o.createdAt?.getTime()??0)-r}),e.slice(0,Dg)}function Ua({chain:e,resolution:t,options:o,refetchInterval:r=12e3,deferUpdates:n=false,updateFlushInterval:s}){let i=useMemo(()=>({chain:e,resolution:t,...o}),[e,t,o]),l=useRef(i),[a,d]=useState(true);useEffect(()=>{JSON.stringify(i)!==JSON.stringify(l.current)&&(d(true),l.current=i);},[i]);let[m,c]=useState([]),{data:p,isPending:u}=useNewTokensQuery(i,{refetchInterval:r});useEffect(()=>{p&&(c(f=>Fa(Qe(f,p))),d(false));},[p]);let g=useCallback(f=>{c(h=>{let b=[...h],T=false;for(let U of f){let I=b.findIndex(q=>q.address===U.address);I>=0?(T=true,b[I]=G(b[I],U)):(T=true,b.push(Bg(U)));}return T?Fa(b):h});},[]),{enqueueUpdates:k}=Je({applyUpdates:g,paused:n,flushInterval:s});useNewTokensSubscription({chain:e},k);let x=useMemo(()=>!!(u||a),[u,a]);return {tokens:m,isLoading:x}}function j2({chain:e,resolution:t,filters:o,ActionsComponent:r,onSelectToken:n,height:s,itemHeight:i,itemHeightMobile:l,className:a}){let[d,m]=useState(),[c,p]=useState(false);useEffect(()=>{m(void 0);},[e]);let u=useMemo(()=>{let x=Object.keys(d??{})[0],f=d?.[x];return {...o,...x&&f?{sortBy:x,sortDirection:f}:void 0}},[o,d]),{tokens:g,isLoading:k}=Ua({chain:e,resolution:t,options:u,deferUpdates:c});return jsx(at,{tokens:g,isLoading:k,resolution:t,height:s,itemHeight:i,itemHeightMobile:l,ActionsComponent:r,onSelectToken:n,sortDirections:d,onSortChange:m,onScrollingChange:p,className:a})}function Ea({chain:e,resolution:t,options:o,refetchInterval:r=12e3,deferUpdates:n=false,updateFlushInterval:s}){let i=useMemo(()=>({chain:e,resolution:t,...o}),[e,t,o]),l=useRef(i),[a,d]=useState(true);useEffect(()=>{JSON.stringify(i)!==JSON.stringify(l.current)&&(d(true),l.current=i);},[i]);let[m,c]=useState([]),{data:p,isPending:u}=useStockTokensQuery(i,{refetchInterval:r});useEffect(()=>{p&&(c(f=>Qe(f,p)),d(false));},[p]);let g=useCallback(f=>{c(h=>Ne(h,f));},[]),{enqueueUpdates:k}=Je({applyUpdates:g,paused:n,flushInterval:s});useStockTokensSubscription({chain:e},k),Se({chain:e,tokens:m,onUpdate:k});let x=useMemo(()=>!!(u||a),[u,a]);return {tokens:m,isLoading:x}}function uR({chain:e,resolution:t,filters:o,ActionsComponent:r,onSelectToken:n,height:s,itemHeight:i,itemHeightMobile:l,className:a}){let[d,m]=useState(),[c,p]=useState(false);useEffect(()=>{m(void 0);},[e]);let u=useMemo(()=>{let x=Object.keys(d??{})[0],f=d?.[x];return {...o,...x&&f?{sortBy:x,sortDirection:f}:void 0}},[o,d]),{tokens:g,isLoading:k}=Ea({chain:e,resolution:t,options:u,deferUpdates:c});return jsx(at,{tokens:g,isLoading:k,resolution:t,height:s,itemHeight:i,itemHeightMobile:l,ActionsComponent:r,onSelectToken:n,sortDirections:d,onSortChange:m,onScrollingChange:p,className:a})}function yR({chain:e,resolution:t,filters:o,ActionsComponent:r,onSelectToken:n,height:s,itemHeight:i,itemHeightMobile:l,className:a}){let[d,m]=useState(),[c,p]=useState(false);useEffect(()=>{m(void 0);},[e]);let u=useMemo(()=>{let x=Object.keys(d??{})[0],f=d?.[x];return {...o,...x&&f?{sortBy:x,sortDirection:f}:void 0}},[o,d]),{tokens:g,isLoading:k}=qt({chain:e,resolution:t,options:u,deferUpdates:c});return jsx(at,{tokens:g,isLoading:k,resolution:t,height:s,itemHeight:i,itemHeightMobile:l,ActionsComponent:r,onSelectToken:n,sortDirections:d,onSortChange:m,onScrollingChange:p,className:a})}var rx=15e3;function sx({chain:e,addresses:t,pollMs:o=rx}){let r=t.length>0,[n,s]=useState({}),i=useTokensQuery({chain:e,addresses:t},{enabled:r,refetchInterval:o});useEffect(()=>{i.data&&s(c=>{let p={};for(let u of i.data){let g=c[u.address];p[u.address]=g?G(g,u):u;}return p});},[i.data]);let{subscribeClient:l}=useDexClient(),a=useRef(""),d=t.slice().sort().join(",");d!==a.current&&(a.current=d),useEffect(()=>{if(!r)return;let c=[];for(let p of t)c.push(l.subscribeToken(e,p,u=>{s(g=>{let k=g;for(let x of u){let f=k[x.address];if(!f)continue;let h=G(f,x);h!==f&&(k=k===g?{...g}:k,k[x.address]=h);}return k});}));return ()=>{for(let p of c)p.unsubscribe();}},[l,e,d,r]);let m=useCallback(async()=>{await i.refetch();},[i.refetch]);return {tokens:n,isPending:i.isPending,isFetching:i.isFetching,isError:i.isError,isSuccess:i.isSuccess,error:i.error,refetch:m}}export{Vn as DEFAULT_FLIP_HOVER_RESOLUTIONS,Za as HolderTagBadge,Mt as HolderTagBadgeList,$ as HoldingRatioChip,j2 as NewTokenListWidget,Jk as PulseFinalStretchListWidget,qe as PulseList,hr as PulseListHeader,Fr as PulseListItem,br as PulseListItemSkeleton,Bk as PulseMigratedListWidget,Nk as PulseNewListWidget,Ao as SEARCH_MODAL_ID,ds as SearchHistoryUI,cs as SearchHistoryWidget,ms as SearchInputUI,Bb as SearchModal,Et as SearchResultItemUI,Vt as SearchResultListHeader,$t as SearchResultListSkeleton,bs as SearchResultListWidget,Qb as SearchTokensButton,Rs as SearchWidget,uR as StockTokenListWidget,No as TRADER_TAG_META,An as TokenAbout,NN as TokenAboutWidget,gn as TokenActivitiesList,s0 as TokenActivitiesListWidget,de as TokenAvatar,Bs as TokenBasicInfo,ln as TokenBasicInfoWidget,Wn as TokenCategories,gS as TokenCategoriesWidget,On as TokenCexListing,eS as TokenCexListingWidget,pi as TokenChartBanner,dw as TokenChartBannerWidget,Us as TokenDetailHeader,hv as TokenDetailHeaderWidget,si as TokenDevTokensList,GC as TokenDevTokensListWidget,ni as TokenDevTokensSummary,Es as TokenHoldersCount,_s as TokenHoldersCountWidget,mn as TokenHoldersList,Wv as TokenHoldersListWidget,Fn as TokenLiquidities,EN as TokenLiquiditiesWidget,at as TokenList,uo as TokenListFilter,Qi as TokenListFilterModal,Yi as TokenListFilterPopover,AP as TokenListFilterWidget,ea as TokenListResolutionSelectorDesktop,oa as TokenListResolutionSelectorMobile,QP as TokenListResolutionSelectorWidget,zs as TokenMarketCap,Qs as TokenMarketCapWidget,Xn as TokenOrdersList,uC as TokenOrdersListWidget,zn as TokenPositionsList,XS as TokenPositionsListWidget,Js as TokenPrice,Zs as TokenPriceWidget,ki as TokenReusedImageList,Bw as TokenReusedImageListWidget,wn as TokenSecurity,dN as TokenSecurityWidget,gi as TokenSimilarTokens,Cw as TokenSimilarTokensWidget,js as TokenSocialMedia,tn as TokenSocialMediaWidget,_n as TokenStatsFlipBase,$n as TokenStatsFlipHover,HS as TokenStatsFlipWidget,ei as TokenTopTradersList,IC as TokenTopTradersListWidget,Tn as TokenTradersOverview,b0 as TokenTradersOverviewWidget,vn as TokenTransactionsOverview,F0 as TokenTransactionsOverviewWidget,sn as TokenVolume,an as TokenVolumeWidget,Sn as TokenVolumesOverview,X0 as TokenVolumesOverviewWidget,Ya as TraderTagBadge,Nr as TraderTagBadgeList,Pa as TrendingTokenCard,E2 as TrendingTokenCardList,Ra as TrendingTokenCardSkeleton,yR as TrendingTokenListWidget,Ua as useNewTokensScript,ns as usePulseFinalStretchListScript,es as usePulseMigratedListScript,Gr as usePulseNewListScript,Wt as useSearchHistory,ks as useSearchResultListScript,Ls as useSearchScript,Ea as useStockTokensScript,Hn as useTokenAboutScript,hn as useTokenActivitiesListScript,DT as useTokenBasicInfoScript,En as useTokenCategoriesScript,Dn as useTokenCexListingScript,fi as useTokenChartBannerScript,Os as useTokenDetailHeaderScript,di as useTokenDevTokensListScript,Vs as useTokenHoldersCountScript,fn as useTokenHoldersListScript,Un as useTokenLiquiditiesScript,qs as useTokenMarketCapScript,jn as useTokenOrdersListScript,Gn as useTokenPositionsListScript,Ys as useTokenPriceScript,hi as useTokenReusedImageListScript,Ln as useTokenSecurityScript,xi as useTokenSimilarTokensScript,en as useTokenSocialMediaScript,Kn as useTokenStatsFlipScript,oi as useTokenTopTradersListScript,yn as useTokenTradersOverviewScript,Nn as useTokenTransactionsOverviewScript,nn as useTokenVolumeScript,Cn as useTokenVolumesOverviewScript,sx as useTokens,qt as useTrendingTokensScript};//# sourceMappingURL=index.mjs.map
23
+ `,Tg={background:"linear-gradient(90deg, rgba(255,255,255,0.03) 25%, rgba(255,255,255,0.06) 50%, rgba(255,255,255,0.03) 75%)",backgroundSize:"200% 100%",animation:"tklShimmer 1.8s ease-in-out infinite",borderRadius:6};function E(e,t,o,r){return {...Tg,animationDelay:`${e}ms`,width:t,height:o,...r}}var Wa=10;function Ba({rowHeight:e,hasActions:t,isMobile:o}){return jsxs(Fragment,{children:[jsx("style",{children:bg}),Array.from({length:Wa}).map((r,s)=>jsx(yg,{index:s,rowHeight:e,hasActions:t,isMobile:o,isLast:s===Wa-1},s))]})}function yg({index:e,rowHeight:t,hasActions:o,isMobile:r,isLast:s}){let n=e*80,i=r?208:320,a=r?40:64,l=r?72:124,d=r?64:97;return jsxs("div",{style:{display:"flex",alignItems:"center",height:t,borderBottom:s?void 0:"1px solid rgba(39,39,42,0.3)"},children:[jsxs("div",{style:{width:i,padding:r?"0 12px":"0 12px 0 24px",display:"flex",alignItems:"center",gap:12,flexShrink:0},children:[jsx("div",{style:E(n,a,a,{borderRadius:8,flexShrink:0})}),jsxs("div",{style:{display:"flex",flexDirection:"column",gap:8,flex:1},children:[jsx("div",{style:E(n+30,"60%",20)}),jsx("div",{style:E(n+60,"80%",16)})]})]}),jsxs("div",{style:{width:128,padding:"0 12px",display:"flex",flexDirection:"column",justifyContent:"center",gap:4},children:[jsx("div",{style:E(n+20,72,20)}),jsx("div",{style:E(n+40,52,16)})]}),jsx("div",{style:{width:106,padding:"0 12px",display:"flex",alignItems:"center"},children:jsx("div",{style:E(n+30,64,20)})}),jsx("div",{style:{width:106,padding:"0 12px",display:"flex",alignItems:"center"},children:jsx("div",{style:E(n+40,60,20)})}),jsxs("div",{style:{width:138,padding:"0 12px",display:"flex",flexDirection:"column",justifyContent:"center",gap:4},children:[jsx("div",{style:E(n+50,72,20)}),jsx("div",{style:E(n+70,100,16)})]}),jsxs("div",{style:{width:126,padding:"0 12px",display:"flex",flexDirection:"column",justifyContent:"center",gap:4},children:[jsx("div",{style:E(n+60,48,20)}),jsx("div",{style:E(n+80,80,16)})]}),jsxs("div",{style:{width:126,padding:"0 12px",display:"flex",flexDirection:"column",justifyContent:"center",gap:4},children:[jsx("div",{style:E(n+70,40,20)}),jsx("div",{style:E(n+90,72,16)})]}),jsxs("div",{style:{width:128,padding:"0 12px",display:"flex",alignItems:"center",gap:10},children:[jsx("div",{style:E(n+80,20,20,{borderRadius:4})}),jsx("div",{style:E(n+90,52,20)})]}),jsxs("div",{style:{width:308,padding:"0 12px",display:"flex",alignItems:"center",gap:20},children:[jsxs("div",{style:{display:"flex",flexDirection:"column",gap:8},children:[jsx("div",{style:E(n+80,52,16)}),jsx("div",{style:E(n+100,40,16)}),jsx("div",{style:E(n+120,36,16)})]}),jsxs("div",{style:{display:"flex",flexDirection:"column",gap:8},children:[jsx("div",{style:E(n+90,48,16)}),jsx("div",{style:E(n+110,40,16)}),jsx("div",{style:E(n+130,40,16)})]}),jsxs("div",{style:{display:"flex",flexDirection:"column",gap:8},children:[jsx("div",{style:E(n+100,40,16)}),jsx("div",{style:E(n+120,36,16)})]})]}),o&&jsx("div",{style:{width:l,padding:r?"0 12px 0 0":"0 24px 0 12px",display:"flex",alignItems:"center",justifyContent:"flex-end"},children:jsx("div",{style:E(n+100,d,32,{borderRadius:8})})})]})}var Rg=100,Ag=200,Hg=72;function mt({tokens:e,resolution:t="24h",isLoading:o,ActionsComponent:r,onSelectToken:s,sortDirections:n,onSortChange:i,onScrollingChange:a,height:l=600,itemHeight:d=88,itemHeightMobile:m=72,className:c}){let{isMobile:p}=useScreen(),u=p?m:d,f=useMemo(()=>e.slice(0,Rg),[e]),k=o&&e.length===0,x=useRef(void 0),g=useRef(false),{t:h}=useTranslation(),b=useCallback(P=>W=>{W.preventDefault(),W.stopPropagation(),s?.(P);},[s]),[T,I]=useState(n??{});useEffect(()=>{I(n??{});},[n]);let M=useCallback(P=>W=>{let ft={[P]:W};I(ft),i?.(ft);},[i]),Q=useCallback(()=>{g.current||(g.current=true,a?.(true)),x.current&&clearTimeout(x.current),x.current=setTimeout(()=>{g.current=false,a?.(false);},180);},[a]);useEffect(()=>()=>{x.current&&clearTimeout(x.current),g.current&&a?.(false);},[a]);let Se=cn("h-full mx-auto",c??(r?"max-w-362 sm:max-w-403":"max-w-331 sm:max-w-372")),_=r?"!w-[1438px] min-w-[1438px] max-w-[1438px]":"!w-[1366px] min-w-[1366px] max-w-[1366px]",be=[jsx(TableColumn,{textValue:h("tokens.listHeader.token"),width:p?Ag:320,className:cn("bg-[#0a0a0b] sticky left-0 z-10",p&&"!w-[200px] min-w-[200px] max-w-[200px] overflow-hidden","shadow-[1px_0_0_0_rgba(39,39,42,0.6)]"),children:h("tokens.listHeader.token")},"token"),jsx(TableColumn,{textValue:h("tokens.listHeader.price"),width:128,children:jsxs("div",{className:"flex items-center gap-1",children:[jsx(Sortable,{sort:T.price,onSortChange:M("price"),children:h("tokens.listHeader.price")}),jsx("span",{children:"/"}),jsx(Sortable,{sort:T[`priceChange${t}`],onSortChange:M(`priceChange${t}`),children:h("tokens.listHeader.priceChange",{resolution:t})})]})},"price"),jsx(TableColumn,{textValue:h("tokens.listHeader.marketCap"),width:106,children:jsx(Sortable,{sort:T.marketCap,onSortChange:M("marketCap"),children:h("tokens.listHeader.marketCap")})},"marketCap"),jsx(TableColumn,{textValue:h("tokens.listHeader.liquidity"),width:106,children:jsx(Sortable,{sort:T.tvl,onSortChange:M("tvl"),children:h("tokens.listHeader.liquidity")})},"liquidity"),jsx(TableColumn,{textValue:h("tokens.listHeader.volumes",{resolution:t}),width:138,children:jsx(Sortable,{sort:T[`volumes${t}`],onSortChange:M(`volumes${t}`),children:h("tokens.listHeader.volumes",{resolution:t})})},"volumes"),jsx(TableColumn,{textValue:h("tokens.listHeader.txs",{resolution:t}),width:126,children:jsx(Sortable,{sort:T[`trades${t}`],onSortChange:M(`trades${t}`),children:h("tokens.listHeader.txs",{resolution:t})})},"txs"),jsx(TableColumn,{textValue:h("tokens.listHeader.traders",{resolution:t}),width:126,children:jsx(Sortable,{sort:T[`traders${t}`],onSortChange:M(`traders${t}`),children:h("tokens.listHeader.traders",{resolution:t})})},"traders"),jsx(TableColumn,{textValue:h("tokens.listHeader.bluechip"),width:128,children:h("tokens.listHeader.bluechip")},"bluechip"),jsx(TableColumn,{textValue:h("tokens.listHeader.tokenInfo"),width:308,children:h("tokens.listHeader.tokenInfo")},"tokenInfo"),r?jsx(TableColumn,{textValue:h("tokens.listHeader.actions"),width:p?Hg:124,align:"end",className:cn("bg-[#0a0a0b] sticky right-0 z-10",p&&"!w-[72px] min-w-[72px] max-w-[72px]","shadow-[-1px_0_0_0_rgba(39,39,42,0.6)]"),children:h("tokens.listHeader.actions")},"actions"):void 0].filter(Boolean),Te=jsx(Ba,{rowHeight:u,hasActions:!!r,isMobile:p}),F=jsxs("div",{children:[jsx(EmptyIcon,{className:"w-10 h-10 mx-auto text-neutral"}),jsx("p",{className:"mt-2 text-sm text-neutral text-center",children:h("common.empty")})]}),ne=P=>[jsx(TableCell,{className:cn("sticky left-0 z-10 bg-[#0a0a0b]",p&&"!w-[200px] min-w-[200px] max-w-[200px] overflow-hidden","shadow-[1px_0_0_0_rgba(39,39,42,0.6)]","transition-colors duration-150","[tr:hover_&]:!bg-[#101211]"),children:jsx(wa,{token:P,resolution:t})},"token"),jsx(TableCell,{children:jsx(Ia,{token:P,resolution:t})},"price"),jsx(TableCell,{children:jsx(Ra,{token:P,resolution:t})},"marketCap"),jsx(TableCell,{children:jsx(Pa,{token:P,resolution:t})},"liquidity"),jsx(TableCell,{children:jsx(Ea,{token:P,resolution:t})},"volumes"),jsx(TableCell,{children:jsx(Oa,{token:P,resolution:t})},"trades"),jsx(TableCell,{children:jsx(Fa,{token:P,resolution:t})},"traders"),jsx(TableCell,{children:jsx(ba,{token:P,resolution:t})},"bluechip"),jsx(TableCell,{children:jsx(La,{token:P,resolution:t})},"tokenInfo"),r?jsx(TableCell,{className:cn("sticky right-0 z-10 bg-[#0a0a0b]",p&&"!w-[72px] min-w-[72px] max-w-[72px]","shadow-[-1px_0_0_0_rgba(39,39,42,0.6)]","transition-colors duration-150","[tr:hover_&]:!bg-[#101211]"),children:jsx("div",{className:cn("!absolute inset-y-0 right-3 z-1 w-fit","flex items-center justify-end"),children:jsx(r,{token:P,resolution:t})})},"actions"):void 0].filter(Boolean),U=P=>jsx(TableRow,{onClick:s?b(P):void 0,children:ne(P)},P.address);return p?jsx("div",{"data-token-list-mobile-scroll":true,className:cn("h-full min-h-0 w-full overflow-y-auto overflow-x-hidden overscroll-contain","mx-auto",c??(r?"max-w-362 sm:max-w-403":"max-w-331 sm:max-w-372")),style:{height:l},onScroll:Q,children:jsx("div",{"data-token-list-horizontal-scroll":true,className:"w-full overflow-x-auto overflow-y-visible",children:jsxs(StyledTable,{isHeaderSticky:true,radius:"none",classNames:{table:cn("table-fixed",_),wrapper:"p-0 w-full !max-h-none !overflow-x-visible !overflow-y-visible bg-transparent rounded-none shadow-none",loadingWrapper:"flex-col justify-start items-start",emptyWrapper:"pt-30"},"aria-label":"Tokens",children:[jsx(TableHeader,{children:be}),jsx(TableBody,{items:f,isLoading:k,loadingContent:Te,emptyContent:F,children:U})]})})}):jsxs(StyledTable,{isHeaderSticky:true,isVirtualized:true,radius:"lg",className:Se,classNames:{loadingWrapper:"flex-col justify-start items-start",emptyWrapper:"pt-30"},onScrollCapture:Q,maxTableHeight:l,rowHeight:u,"aria-label":"Tokens",children:[jsx(TableHeader,{children:be}),jsx(TableBody,{items:e,isLoading:k,loadingContent:Te,emptyContent:F,children:U})]})}function Ga({token:e,resolution:t,renderAction:o,isLast:r=false,onSelectToken:s,className:n}){let{t:i}=useTranslation(),a=useCopyToClipboard(),l=useTickAge(e.createdAt),d=useCallback(()=>{s?.(e);},[s,e]),m=useCallback(W=>{W.stopPropagation(),a(e.address,()=>toast.success(i("tokens.copied.address")));},[a,e.address,i]),c=e.marketData,p=e.stats?.[t],u=useMemo(()=>c?.priceInUsd,[c?.priceInUsd]),f=useMemo(()=>p?.priceChange,[p?.priceChange]),k=useMemo(()=>f&&new SafeBigNumber(f).gte(0),[f]),x=useMemo(()=>f?new SafeBigNumber(f).abs().toString():void 0,[f]),g=useMemo(()=>p?.volumesInUsd,[p?.volumesInUsd]),h=useMemo(()=>p?.buyVolumesInUsd,[p?.buyVolumesInUsd]),b=useMemo(()=>p?.sellVolumesInUsd,[p?.sellVolumesInUsd]),T=useMemo(()=>p?.trades,[p?.trades]),I=useMemo(()=>c?.marketCapInUsd,[c?.marketCapInUsd]),M=useMemo(()=>c?.tvlInUsd,[c?.tvlInUsd]),Q=useMemo(()=>new SafeBigNumber(c?.top10HoldingsRatio).gte(.1),[c?.top10HoldingsRatio]),Se=useMemo(()=>new SafeBigNumber(c?.devHoldingsRatio).gte(.1),[c?.devHoldingsRatio]),_=useMemo(()=>new SafeBigNumber(c?.sniperHoldingsRatio).gte(.1),[c?.sniperHoldingsRatio]),be=useMemo(()=>new SafeBigNumber(c?.insiderHoldingsRatio).gte(.1),[c?.insiderHoldingsRatio]),Te=useMemo(()=>new SafeBigNumber(c?.bundleHoldingsRatio).gte(.1),[c?.bundleHoldingsRatio]),F=c?.holders!==void 0&&c.holders>0,ne=c?.kolHolders!==void 0&&c.kolHolders>0,U=c?.bluechipHolders!==void 0&&c.bluechipHolders>0,P=F||ne||U;return jsxs("div",{className:cn("relative w-full h-full overflow-hidden px-4 py-3 hover:bg-content2/40 cursor-pointer",!r&&"border-b",n),style:r?void 0:{borderBottomColor:"rgba(39,39,42,0.6)"},onClick:s?d:void 0,children:[jsxs("div",{className:"flex items-start gap-2",children:[jsxs("div",{className:"flex-none flex flex-col items-center gap-2",children:[jsx(ce,{token:e,enableSearch:true,enablePreview:!!e.image,showProgress:false,className:"w-20 h-20"}),jsxs("button",{type:"button",className:"text-xs font-mono text-neutral hover:text-foreground leading-none",onClick:m,"aria-label":i("tokens.copied.address"),title:i("tokens.copied.address"),children:[e.address.slice(0,4),"...",e.address.slice(-4)]})]}),jsxs("div",{className:"flex-1 min-w-0 flex flex-col gap-2.5",children:[jsxs("button",{type:"button",className:"flex items-center gap-1.5 min-w-0 text-left",onClick:m,"aria-label":i("tokens.copied.address"),title:i("tokens.copied.address"),children:[jsx("span",{className:"flex-none text-sm font-semibold leading-none whitespace-nowrap overflow-hidden text-ellipsis max-w-24",children:e.symbol}),jsx(StyledTooltip,{content:e.name,children:jsx("span",{className:"text-[13px] leading-none text-neutral truncate max-w-20",children:e.name})}),jsx(CopyIcon,{className:"flex-none w-3.5 h-3.5 text-neutral"})]}),jsxs("div",{className:"flex items-center gap-2 leading-none",children:[jsx("span",{className:"text-[13px] font-mono font-medium text-neutral",children:formatAge(l)}),e.socialMedias?.website&&jsx(Link,{href:e.socialMedias.website,className:"text-neutral hover:text-primary",target:"_blank",onClick:W=>W.stopPropagation(),children:jsx(WebsiteIcon,{className:"w-3.5 h-3.5"})}),e.socialMedias?.twitter&&jsx(Link,{href:e.socialMedias.twitter,className:"text-neutral hover:text-primary",target:"_blank",onClick:W=>W.stopPropagation(),children:jsx(TwitterIcon,{className:"w-3.5 h-3.5"})}),e.socialMedias?.telegram&&jsx(Link,{href:e.socialMedias.telegram,className:"text-neutral hover:text-primary",target:"_blank",onClick:W=>W.stopPropagation(),children:jsx(TelegramIcon,{className:"w-3.5 h-3.5"})}),jsx(Link,{href:searchTwitterUrl(`${e.symbol} OR ${e.address}`),className:"max-sm:hidden text-neutral hover:text-primary",target:"_blank",onClick:W=>W.stopPropagation(),children:jsx(SearchIcon,{className:"w-3.5 h-3.5"})})]}),jsxs("div",{className:"flex items-center gap-2 text-xs font-mono text-foreground/80 leading-none",children:[jsxs("span",{className:"inline-flex items-baseline gap-1",children:[jsx("span",{className:"text-neutral",children:"MC"}),jsx("span",{children:formatAmountUSDCompact(I)})]}),jsx("span",{className:"text-neutral/30",children:"\xB7"}),jsxs("span",{className:"inline-flex items-baseline gap-1",children:[jsx("span",{className:"text-neutral",children:"Liq"}),jsx("span",{children:formatAmountUSDCompact(M)})]})]}),P&&jsxs("div",{className:"flex items-center gap-2 text-xs font-mono text-neutral leading-none",children:[F&&jsx(StyledTooltip,{content:i("tokens.tokenInfo.holders"),children:jsxs("span",{className:"inline-flex items-center gap-1",children:[jsx(PeopleIcon,{className:"w-3 h-3 text-neutral"}),formatAmount(c?.holders)]})}),ne&&jsx(StyledTooltip,{content:i("tokens.tokenInfo.kolHolders"),children:jsxs("span",{className:"inline-flex items-center gap-1",children:[jsx(CrownIcon,{className:"w-3 h-3 text-neutral"}),formatAmount(c?.kolHolders)]})}),U&&jsx(StyledTooltip,{content:i("tokens.listHeader.bluechip"),children:jsxs("span",{className:"inline-flex items-center gap-1",children:[jsx(ShiningStarIcon,{className:"w-3 h-3 text-neutral"}),formatAmount(c?.bluechipHolders)]})})]})]}),jsxs("div",{className:"flex-none flex flex-col items-end gap-2.5 leading-none font-mono",children:[jsxs("div",{className:"flex flex-col items-end gap-1",children:[jsx("span",{className:"text-base font-bold text-foreground leading-none",children:formatPriceUSD(u)}),jsxs("span",{className:cn("inline-flex items-center gap-0.5 text-[10px] leading-none",k?"text-bullish":"text-bearish"),children:[k?jsx(TriangleUpIcon,{width:8,height:8}):jsx(TriangleDownIcon,{width:8,height:8}),f===void 0?"--":formatPercent(x)]})]}),jsxs("div",{className:"flex flex-col items-end gap-1",children:[jsxs("div",{className:"flex items-baseline gap-1",children:[jsx("span",{className:"text-xs text-neutral",children:"V"}),jsx("span",{className:"text-xs text-foreground/80",children:formatAmountUSDCompact(g)})]}),jsxs("span",{className:"text-[10px] leading-none",children:[jsx("span",{className:"text-bullish",children:formatAmountUSDCompact(h)}),jsx("span",{className:"text-neutral/50 mx-0.5",children:"/"}),jsx("span",{className:"text-bearish",children:formatAmountUSDCompact(b)})]})]}),jsxs("div",{className:"flex items-baseline gap-1",children:[jsx("span",{className:"text-xs text-neutral",children:"TX"}),jsx("span",{className:"text-xs text-foreground/80",children:formatAmount(T)})]})]})]}),jsxs("div",{className:"mt-2.5 flex items-start gap-4 relative",children:[jsx(HorizontalScrollContainer,{className:"flex-auto min-w-0",forceShowArrows:true,children:jsxs("div",{className:"flex items-center gap-1",children:[jsx($,{icon:jsx(UserWithStarBadgeIcon,{width:12,height:12}),value:formatPercent(c?.top10HoldingsRatio),tooltip:i("tokens.tokenInfo.top10HoldingsRatio"),warning:Q,disable:!c?.top10HoldingsRatio||c?.top10HoldingsRatio==="0"}),jsx($,{icon:jsx(CookIcon,{width:12,height:12}),value:formatPercent(c?.devHoldingsRatio),tooltip:i("tokens.tokenInfo.devHoldingsRatio"),warning:Se,disable:!c?.devHoldingsRatio||c?.devHoldingsRatio==="0"}),jsx($,{icon:jsx(SniperIcon,{width:12,height:12}),value:formatPercent(c?.sniperHoldingsRatio),tooltip:i("tokens.tokenInfo.sniperHoldingsRatio"),warning:_,disable:!c?.sniperHoldingsRatio||c?.sniperHoldingsRatio==="0"}),jsx($,{icon:jsx(RatIcon,{width:12,height:12}),value:formatPercent(c?.insiderHoldingsRatio),tooltip:i("tokens.tokenInfo.insiderHoldingsRatio"),warning:be,disable:!c?.insiderHoldingsRatio||c?.insiderHoldingsRatio==="0"}),jsx($,{icon:jsx(BundlesIcon,{width:12,height:12}),value:formatPercent(c?.bundleHoldingsRatio),tooltip:i("tokens.tokenInfo.bundleHoldingsRatio"),warning:Te,disable:!c?.bundleHoldingsRatio||c?.bundleHoldingsRatio==="0"})]})}),o&&jsx("div",{className:"flex-none relative",onClick:W=>W.stopPropagation(),children:o(e)})]})]})}function Xa({isLast:e=false}){return jsxs("div",{className:cn("w-full h-full overflow-hidden px-4 py-3 animate-pulse",!e&&"border-b"),style:e?void 0:{borderBottomColor:"rgba(39,39,42,0.6)"},children:[jsxs("div",{className:"flex items-start gap-2",children:[jsxs("div",{className:"flex-none flex flex-col items-center gap-2",children:[jsx("div",{className:"w-20 h-20 rounded-lg bg-content2"}),jsx("div",{className:"w-14 h-2.5 rounded bg-content2"})]}),jsxs("div",{className:"flex-1 min-w-0 flex flex-col gap-2",children:[jsxs("div",{className:"flex items-center gap-1.5",children:[jsx("div",{className:"w-16 h-3.5 rounded bg-content2"}),jsx("div",{className:"w-20 h-3.5 rounded bg-content2"}),jsx("div",{className:"w-3.5 h-3.5 rounded bg-content2"})]}),jsxs("div",{className:"flex items-center gap-2",children:[jsx("div",{className:"w-8 h-3 rounded bg-content2"}),jsx("div",{className:"w-3.5 h-3.5 rounded bg-content2"}),jsx("div",{className:"w-3.5 h-3.5 rounded bg-content2"}),jsx("div",{className:"w-3.5 h-3.5 rounded bg-content2"})]}),jsxs("div",{className:"flex items-center gap-2",children:[jsx("div",{className:"w-12 h-3 rounded bg-content2"}),jsx("div",{className:"w-12 h-3 rounded bg-content2"}),jsx("div",{className:"w-10 h-3 rounded bg-content2"})]})]}),jsxs("div",{className:"flex-none flex flex-col items-end gap-3",children:[jsxs("div",{className:"flex flex-col items-end gap-1",children:[jsx("div",{className:"w-16 h-4 rounded bg-content2"}),jsx("div",{className:"w-12 h-2.5 rounded bg-content2"})]}),jsxs("div",{className:"flex flex-col items-end gap-1",children:[jsx("div",{className:"w-14 h-3 rounded bg-content2"}),jsx("div",{className:"w-12 h-2.5 rounded bg-content2"})]})]})]}),jsxs("div",{className:"mt-2.5 flex items-center gap-2",children:[jsxs("div",{className:"flex-1 min-w-0 flex items-center gap-1 overflow-hidden",children:[jsx("div",{className:"w-12 h-5 rounded-full bg-content2"}),jsx("div",{className:"w-12 h-5 rounded-full bg-content2"}),jsx("div",{className:"w-12 h-5 rounded-full bg-content2"}),jsx("div",{className:"w-12 h-5 rounded-full bg-content2"}),jsx("div",{className:"w-12 h-5 rounded-full bg-content2"})]}),jsx("div",{className:"w-16 h-7 rounded-md bg-content2 flex-none"})]})]})}var sx=154,Ja=10;function ix({index:e,style:t,tokens:o,skeletonCount:r,resolution:s,renderAction:n,onSelectToken:i}){return o?jsx("div",{style:t,children:jsx(Ga,{token:o[e],resolution:s,isLast:e===o.length-1,renderAction:n,onSelectToken:i})}):jsx("div",{style:t,children:jsx(Xa,{isLast:e===r-1})})}function bR({tokens:e,resolution:t="24h",isLoading:o,height:r=600,renderAction:s,onSelectToken:n,className:i}){let a=o||!e?void 0:e,l=a?a.length:Ja,d=useMemo(()=>({tokens:a,skeletonCount:Ja,resolution:t,renderAction:s,onSelectToken:n}),[a,t,s,n]);return jsx("div",{className:cn("w-full h-full overflow-hidden border rounded-lg",i),style:{background:"rgba(24,24,27,0.4)",borderColor:"rgba(39,39,42,0.6)"},children:jsx(List,{className:"h-full w-full",style:{height:r},rowCount:l,rowHeight:sx,overscanCount:5,rowComponent:ix,rowProps:d})})}var mx=80;function px(e){return {chain:e.chain,address:e.address,name:e.name??"",symbol:e.symbol??"",decimals:e.decimals??0,image:e.image,description:e.description,socialMedias:e.socialMedias,launchedFrom:e.launchedFrom,migratedTo:e.migratedTo,createdAt:e.createdAt}}function el(e){return e.sort((t,o)=>{let r=t.createdAt?.getTime()??0;return (o.createdAt?.getTime()??0)-r}),e.slice(0,mx)}function tl({chain:e,resolution:t,options:o,refetchInterval:r=12e3,deferUpdates:s=false,updateFlushInterval:n}){let i=useMemo(()=>({chain:e,resolution:t,...o}),[e,t,o]),a=useRef(i),[l,d]=useState(true);useEffect(()=>{JSON.stringify(i)!==JSON.stringify(a.current)&&(d(true),a.current=i);},[i]);let[m,c]=useState([]),{data:p,isPending:u}=useNewTokensQuery(i,{refetchInterval:r});useEffect(()=>{p&&(c(g=>el(Xe(g,p))),d(false));},[p]);let f=useCallback(g=>{c(h=>{let b=[...h],T=false;for(let I of g){let M=b.findIndex(Q=>Q.address===I.address);M>=0?(T=true,b[M]=X(b[M],I)):(T=true,b.push(px(I)));}return T?el(b):h});},[]),{enqueueUpdates:k}=je({applyUpdates:f,paused:s,flushInterval:n});useNewTokensSubscription({chain:e},k);let x=useMemo(()=>!!(u||l),[u,l]);return {tokens:m,isLoading:x}}function IR({chain:e,resolution:t,filters:o,ActionsComponent:r,onSelectToken:s,height:n,itemHeight:i,itemHeightMobile:a,className:l}){let[d,m]=useState(),[c,p]=useState(false);useEffect(()=>{m(void 0);},[e]);let u=useMemo(()=>{let x=Object.keys(d??{})[0],g=d?.[x];return {...o,...x&&g?{sortBy:x,sortDirection:g}:void 0}},[o,d]),{tokens:f,isLoading:k}=tl({chain:e,resolution:t,options:u,deferUpdates:c});return jsx(mt,{tokens:f,isLoading:k,resolution:t,height:n,itemHeight:i,itemHeightMobile:a,ActionsComponent:r,onSelectToken:s,sortDirections:d,onSortChange:m,onScrollingChange:p,className:l})}function sl({chain:e,filters:t,sortDirections:o,refetchInterval:r=12e3,deferUpdates:s=false,updateFlushInterval:n}){let i=useMemo(()=>({chain:e}),[e]),a=useRef(i),[l,d]=useState(true);useEffect(()=>{JSON.stringify(i)!==JSON.stringify(a.current)&&(d(true),a.current=i);},[i]);let[m,c]=useState([]),{data:p,isPending:u}=useStockTokensQuery(i,{refetchInterval:r});useEffect(()=>{p&&(c(b=>Xe(b,p)),d(false));},[p]);let f=useCallback(b=>{c(T=>Ce(T,b));},[]),{enqueueUpdates:k}=je({applyUpdates:f,paused:s,flushInterval:n});useStockTokensSubscription({chain:e},k),we({chain:e,tokens:m,onUpdate:k});let x=useMemo(()=>!!(u||l),[u,l]),g=useMemo(()=>Jt(m,t),[m,t]);return {tokens:useMemo(()=>Yt(g,o),[g,o]),isLoading:x}}function GR({chain:e,resolution:t,filters:o,ActionsComponent:r,onSelectToken:s,height:n,itemHeight:i,itemHeightMobile:a,className:l}){let[d,m]=useState(),[c,p]=useState(false);useEffect(()=>{m(void 0);},[e]);let{tokens:u,isLoading:f}=sl({chain:e,filters:o,sortDirections:d,deferUpdates:c});return jsx(mt,{tokens:u,isLoading:f,resolution:t,height:n,itemHeight:i,itemHeightMobile:a,ActionsComponent:r,onSelectToken:s,sortDirections:d,onSortChange:m,onScrollingChange:p,className:l})}function oA({chain:e,resolution:t,filters:o,ActionsComponent:r,onSelectToken:s,height:n,itemHeight:i,itemHeightMobile:a,className:l}){let[d,m]=useState(),[c,p]=useState(false);useEffect(()=>{m(void 0);},[e]);let{tokens:u,isLoading:f}=eo({chain:e,resolution:t,filters:o,sortDirections:d,deferUpdates:c});return jsx(mt,{tokens:u,isLoading:f,resolution:t,height:n,itemHeight:i,itemHeightMobile:a,ActionsComponent:r,onSelectToken:s,sortDirections:d,onSortChange:m,onScrollingChange:p,className:l})}var Rx=15e3;function Ax({chain:e,addresses:t,pollMs:o=Rx}){let r=t.length>0,[s,n]=useState({}),i=useTokensQuery({chain:e,addresses:t},{enabled:r,refetchInterval:o});useEffect(()=>{i.data&&n(c=>{let p={};for(let u of i.data){let f=c[u.address];p[u.address]=f?X(f,u):u;}return p});},[i.data]);let{subscribeClient:a}=useDexClient(),l=useRef(""),d=t.slice().sort().join(",");d!==l.current&&(l.current=d),useEffect(()=>{if(!r)return;let c=[];for(let p of t)c.push(a.subscribeToken(e,p,u=>{n(f=>{let k=f;for(let x of u){let g=k[x.address];if(!g)continue;let h=X(g,x);h!==g&&(k=k===f?{...f}:k,k[x.address]=h);}return k});}));return ()=>{for(let p of c)p.unsubscribe();}},[a,e,d,r]);let m=useCallback(async()=>{await i.refetch();},[i.refetch]);return {tokens:s,isPending:i.isPending,isFetching:i.isFetching,isError:i.isError,isSuccess:i.isSuccess,error:i.error,refetch:m}}export{ti as DEFAULT_FLIP_HOVER_RESOLUTIONS,kl as HolderTagBadge,Ot as HolderTagBadgeList,$ as HoldingRatioChip,IR as NewTokenListWidget,vh as PulseFinalStretchListWidget,Ge as PulseList,Pr as PulseListHeader,Kr as PulseListItem,Rr as PulseListItemSkeleton,ch as PulseMigratedListWidget,Xk as PulseNewListWidget,Bo as SEARCH_MODAL_ID,Tn as SearchHistoryUI,yn as SearchHistoryWidget,vn as SearchInputUI,hT as SearchModal,$t as SearchResultItemUI,Kt as SearchResultListHeader,qt as SearchResultListSkeleton,An as SearchResultListWidget,LT as SearchTokensButton,Kn as SearchWidget,GR as StockTokenListWidget,Io as TRADER_TAG_META,Ks as TokenAbout,rS as TokenAboutWidget,Rs as TokenActivitiesList,E0 as TokenActivitiesListWidget,ce as TokenAvatar,jn as TokenBasicInfo,vs as TokenBasicInfoWidget,js as TokenCategories,XS as TokenCategoriesWidget,Js as TokenCexListing,FS as TokenCexListingWidget,wi as TokenChartBanner,$w as TokenChartBannerWidget,Jn as TokenDetailHeader,Zv as TokenDetailHeaderWidget,hi as TokenDevTokensList,Pw as TokenDevTokensListWidget,bi as TokenDevTokensSummary,ts as TokenHoldersCount,rs as TokenHoldersCountWidget,Cs as TokenHoldersList,b0 as TokenHoldersListWidget,Gs as TokenLiquidities,TS as TokenLiquiditiesWidget,mt as TokenList,yo as TokenListFilter,aa as TokenListFilterModal,ma as TokenListFilterPopover,c1 as TokenListFilterWidget,fa as TokenListResolutionSelectorDesktop,xa as TokenListResolutionSelectorMobile,L1 as TokenListResolutionSelectorWidget,is as TokenMarketCap,ls as TokenMarketCapWidget,di as TokenOrdersList,QC as TokenOrdersListWidget,si as TokenPositionsList,RC as TokenPositionsListWidget,ms as TokenPrice,us as TokenPriceWidget,Hi as TokenReusedImageList,hL as TokenReusedImageListWidget,Bs as TokenSecurity,$N as TokenSecurityWidget,Ri as TokenSimilarTokens,sL as TokenSimilarTokensWidget,fs as TokenSocialMedia,xs as TokenSocialMediaWidget,oi as TokenStatsFlipBase,ri as TokenStatsFlipHover,mC as TokenStatsFlipWidget,fi as TokenTopTradersList,pw as TokenTopTradersListWidget,Fs as TokenTradersOverview,j0 as TokenTradersOverviewWidget,Os as TokenTransactionsOverview,fN as TokenTransactionsOverviewWidget,bs as TokenVolume,ys as TokenVolumeWidget,Es as TokenVolumesOverview,RN as TokenVolumesOverviewWidget,xl as TraderTagBadge,Mr as TraderTagBadgeList,Ga as TrendingTokenCard,bR as TrendingTokenCardList,Xa as TrendingTokenCardSkeleton,oA as TrendingTokenListWidget,tl as useNewTokensScript,xn as usePulseFinalStretchListScript,mn as usePulseMigratedListScript,nn as usePulseNewListScript,_t as useSearchHistory,Pn as useSearchResultListScript,_n as useSearchScript,sl as useStockTokensScript,zs as useTokenAboutScript,Is as useTokenActivitiesListScript,ky as useTokenBasicInfoScript,ei as useTokenCategoriesScript,Ys as useTokenCexListingScript,Pi as useTokenChartBannerScript,Yn as useTokenDetailHeaderScript,Ni as useTokenDevTokensListScript,os as useTokenHoldersCountScript,Ps as useTokenHoldersListScript,Xs as useTokenLiquiditiesScript,as as useTokenMarketCapScript,ui as useTokenOrdersListScript,li as useTokenPositionsListScript,ps as useTokenPriceScript,Ii as useTokenReusedImageListScript,Vs as useTokenSecurityScript,Ai as useTokenSimilarTokensScript,gs as useTokenSocialMediaScript,ni as useTokenStatsFlipScript,xi as useTokenTopTradersListScript,Us as useTokenTradersOverviewScript,Ds as useTokenTransactionsOverviewScript,Ts as useTokenVolumeScript,Ws as useTokenVolumesOverviewScript,Ax as useTokens,eo as useTrendingTokensScript};//# sourceMappingURL=index.mjs.map
24
24
  //# sourceMappingURL=index.mjs.map