@liberfi.io/ui-tokens 3.0.23 → 3.0.24

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,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 {jsx,jsxs,Fragment}from'react/jsx-runtime';import {useTickAge,useResizeObserver,useCallbackRef}from'@liberfi.io/hooks';import {useTranslation}from'@liberfi.io/i18n';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,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 Ur({title:e,isPaused:t,extra:o,className:r}){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 min-w-0 flex-1 items-center gap-2",children:[jsx("h2",{className:"min-w-0 truncate font-semibold",children:e}),t&&jsx("div",{className:"flex flex-none items-center gap-1 text-primary",children:jsx(PauseIcon,{className:"w-4 h-4"})})]}),o&&jsx("div",{className:"flex min-w-0 items-center gap-3",children:o})]})}function Ho({isLast:e=false,className:t}){return jsxs("div",{className:cn("w-full h-full overflow-hidden px-4 py-3 animate-pulse",t),style:{borderBottom:e?"none":"1px solid 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 z({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 Fo={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 Nl({tag:e,className:t}){let o=Fo[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 Br({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(Nl,{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 Sl({tag:e,className:t}){let o=Fo[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 Dt({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(Sl,{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 Cl={[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"}},wl={text:"text-neutral",bg:"bg-neutral",bg5:"bg-neutral/5",bg20:"bg-neutral/20",border:"border-neutral"};function Oe(e){return Cl[e]??wl}function fe({token:e,enablePreview:t=true,enableSearch:o=true,showProgress:r=true,showProtocolFamily:s=true,radius:n="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(()=>s&&a,[s,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),f=useCallback(()=>{g(true);},[]),x=useCallback(()=>{g(false);},[]),b=useCallback(h=>{if(h.stopPropagation(),!e.image)return;let k=searchImageUrl(e.image);window.open(k,"_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}`,a?Oe(a).bg:"bg-[rgba(39,39,42,0.6)]",l?.background)}),m&&jsx("div",{className:cn("absolute -inset-0.5",`rounded-${n}`),children:jsx(Hl,{className:cn(a?Oe(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-${n}`,a?Oe(a).bg20:"bg-[rgba(39,39,42,0.12)]",l?.avatarWrapper),children:jsx(Al,{token:e,radius:n,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-${n}`,u&&c&&"cursor-pointer"),onMouseEnter:f,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}`,l?.avatar)}),u&&c&&jsx("div",{className:cn("absolute inset-0 bg-content1/80 flex items-center justify-center",`rounded-${n}`,l?.searchWrapper),onClick:b,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&&Oe(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 Al({token:e,radius:t,enableSearch:o,enablePreview:r,classNames:s,children:n}){return useMemo(()=>r&&e.image,[r,e.image])?jsx(StyledTooltip,{content:jsx(Il,{token:e,radius:t,enableSearch:o,classNames:s}),closeDelay:100,placement:"bottom-start",classNames:{content:"p-1"},children:n}):n}function Il({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,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&&s&&"cursor-pointer",r?.previewWrapper),onMouseEnter:a,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 Hl({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 as cn$1,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 {jsx,jsxs,Fragment}from'react/jsx-runtime';import {useTickAge,useResizeObserver,useCallbackRef}from'@liberfi.io/hooks';import {useTranslation}from'@liberfi.io/i18n';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,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 Or({title:e,isPaused:t,extra:o,className:r}){return jsxs("div",{className:cn$1("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 min-w-0 flex-1 items-center gap-2",children:[jsx("h2",{className:"min-w-0 truncate font-semibold",children:e}),t&&jsx("div",{className:"flex flex-none items-center gap-1 text-primary",children:jsx(PauseIcon,{className:"w-4 h-4"})})]}),o&&jsx("div",{className:"flex min-w-0 items-center gap-3",children:o})]})}function Fo({isLast:e=false,className:t}){return jsxs("div",{className:cn$1("w-full h-full overflow-hidden px-4 py-3 animate-pulse",t),style:{borderBottom:e?"none":"1px solid 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 z({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$1("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 Mo={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 Cl({tag:e,className:t}){let o=Mo[e]??{label:e,bgClass:"bg-default/20",textClass:"text-default-500"};return jsx("span",{className:cn$1("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 Wr({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$1("flex flex-wrap items-center gap-1",t),children:[r.map(n=>jsx(Cl,{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 wl({tag:e,className:t}){let o=Mo[e]??{label:e,bgClass:"bg-default/20",textClass:"text-default-500"};return jsx("span",{className:cn$1("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 Dt({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$1("flex flex-wrap items-center gap-1",t),children:[r.map(n=>jsx(wl,{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 Ll={[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"}},Pl={text:"text-neutral",bg:"bg-neutral",bg5:"bg-neutral/5",bg20:"bg-neutral/20",border:"border-neutral"};function Oe(e){return Ll[e]??Pl}function fe({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,g]=useState(false),f=useCallback(()=>{g(true);},[]),x=useCallback(()=>{g(false);},[]),k=useCallback(h=>{if(h.stopPropagation(),!e.image)return;let b=searchImageUrl(e.image);window.open(b,"_blank");},[e.image]);return jsxs("div",{className:cn$1("relative justify-center items-center",i??"w-15 h-15"),children:[!m&&jsx("div",{className:cn$1("absolute inset-0",`rounded-${n}`,l?Oe(l).bg:"bg-[rgba(39,39,42,0.6)]",a?.background)}),m&&jsx("div",{className:cn$1("absolute -inset-0.5",`rounded-${n}`),children:jsx(Ml,{className:cn$1(l?Oe(l).text:"text-[rgba(39,39,42,0.6)]",a?.progress),progress:e.migrateProgress??"0"})}),jsx("div",{className:cn$1("absolute inset-0 p-px flex items-center justify-center",`rounded-${n}`,l?Oe(l).bg20:"bg-[rgba(39,39,42,0.12)]",a?.avatarWrapper),children:jsx(Hl,{token:e,radius:n,enableSearch:o,enablePreview:t,classNames:a,children:jsxs("div",{className:cn$1("relative w-full h-full bg-content1 flex items-center justify-center p-0.5",`rounded-${n}`,u&&c&&"cursor-pointer"),onMouseEnter:f,onMouseLeave:x,children:[jsx(Avatar,{showFallback:true,src:e.image,name:p,className:cn$1("w-full h-full bg-content1 text-neutral text-2xl",`rounded-${n}`,a?.avatar)}),u&&c&&jsx("div",{className:cn$1("absolute inset-0 bg-content1/80 flex items-center justify-center",`rounded-${n}`,a?.searchWrapper),onClick:k,children:jsx(CameraIcon,{className:cn$1("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$1("absolute -bottom-1 -right-1 rounded-full p-px w-4 h-4",l&&Oe(l).bg,a?.protocolFamilyIconWrapper),children:jsx(Image,{removeWrapper:true,src:`/images/protocols/${l}.svg`,className:cn$1("w-full h-full rounded-full bg-content1",a?.protocolFamilyIcon)})})})})]})}function Hl({token:e,radius:t,enableSearch:o,enablePreview:r,classNames:s,children:n}){return useMemo(()=>r&&e.image,[r,e.image])?jsx(StyledTooltip,{content:jsx(Fl,{token:e,radius:t,enableSearch:o,classNames:s}),closeDelay:100,placement:"bottom-start",classNames:{content:"p-1"},children:n}):n}function Fl({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$1("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$1("w-full h-full bg-content1 text-neutral text-3xl",`rounded-${o}`,r?.previewAvatar)}),i&&s&&jsx("div",{className:cn$1("absolute inset-0 bg-content1/80 flex items-center justify-center",`rounded-${o}`,r?.previewSearchWrapper),onClick:m,children:jsx(CameraIcon,{className:cn$1("w-10 h-10",r?.previewSearchIcon)})})]})}function Ml({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,useState,useRef,useCallback,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 Jr({token:e,renderAction:t,isLast:o=false,onSelectToken:r,className:s}){let{t:n}=useTranslation(),i=useCopyToClipboard(),l=useTickAge(e.createdAt),a=e.marketData,d=e.stats?.["1h"],m=useCallback(()=>{r?.(e);},[r,e]),c=useCallback(D=>{D.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]),g=useMemo(()=>d?.sellVolumesInUsd,[d?.sellVolumesInUsd]),f=useMemo(()=>d?.trades,[d?.trades]),x=useMemo(()=>a?.marketCapInUsd,[a?.marketCapInUsd]),b=useMemo(()=>a?.tvlInUsd,[a?.tvlInUsd]),h=useMemo(()=>{let D=new SafeBigNumber(x);return D.lt(1e3)?"text-foreground":D.lt(1e6)?"text-secondary":"text-primary"},[x]),k=useMemo(()=>new SafeBigNumber(a?.top10HoldingsRatio).gte(.1),[a?.top10HoldingsRatio]),T=useMemo(()=>new SafeBigNumber(a?.devHoldingsRatio).gte(.1),[a?.devHoldingsRatio]),C=useMemo(()=>new SafeBigNumber(a?.insiderHoldingsRatio).gte(.1),[a?.insiderHoldingsRatio]),y=useMemo(()=>new SafeBigNumber(a?.sniperHoldingsRatio).gte(.1),[a?.sniperHoldingsRatio]),L=useMemo(()=>new SafeBigNumber(a?.bundleHoldingsRatio).gte(.1),[a?.bundleHoldingsRatio]),[W,I]=useMemo(()=>{let D=Number(d?.buys??0),H=Number(d?.sells??0),_=D+H;if(_===0)return [12,12];let xt=Math.round(D/_*24);return [xt,24-xt]},[d?.buys,d?.sells]),te=a?.holders!==void 0&&a.holders>0,Se=a?.proHolders!==void 0&&a.proHolders>0,O=a?.kolHolders!==void 0&&a.kolHolders>0,ie=te||Se||O;return jsxs("div",{className:cn("relative w-full h-full overflow-hidden px-4 py-3 hover:bg-content2/40 cursor-pointer",s),style:{borderBottom:o?"none":"1px solid 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(fe,{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(l)}),e.socialMedias?.website&&jsx(Link,{href:e.socialMedias.website,className:"text-neutral hover:text-primary",target:"_blank",onClick:D=>D.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:D=>D.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:D=>D.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:D=>D.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(b)})]})]}),ie&&jsxs("div",{className:"flex items-center gap-2 text-xs font-mono text-neutral leading-none",children:[te&&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(a?.holders)]})}),Se&&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(a?.proHolders)]})}),O&&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(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(f)})]})]})]}),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(z,{icon:jsx(UserWithStarBadgeIcon,{width:12,height:12}),value:formatPercent(a?.top10HoldingsRatio),tooltip:n("tokens.tokenInfo.top10HoldingsRatio"),warning:k,disable:!a?.top10HoldingsRatio||a?.top10HoldingsRatio==="0"}),jsx(z,{icon:jsx(CookIcon,{width:12,height:12}),value:formatPercent(a?.devHoldingsRatio),tooltip:n("tokens.tokenInfo.devHoldingsRatio"),warning:T,disable:!a?.devHoldingsRatio||a?.devHoldingsRatio==="0"}),jsx(z,{icon:jsx(SniperIcon,{width:12,height:12}),value:formatPercent(a?.sniperHoldingsRatio),tooltip:n("tokens.tokenInfo.sniperHoldingsRatio"),warning:y,disable:!a?.sniperHoldingsRatio||a?.sniperHoldingsRatio==="0"}),jsx(z,{icon:jsx(RatIcon,{width:12,height:12}),value:formatPercent(a?.insiderHoldingsRatio),tooltip:n("tokens.tokenInfo.insiderHoldingsRatio"),warning:C,disable:!a?.insiderHoldingsRatio||a?.insiderHoldingsRatio==="0"}),jsx(z,{icon:jsx(BundlesIcon,{width:12,height:12}),value:formatPercent(a?.bundleHoldingsRatio),tooltip:n("tokens.tokenInfo.bundleHoldingsRatio"),warning:L,disable:!a?.bundleHoldingsRatio||a?.bundleHoldingsRatio==="0"})]})}),t&&jsx("div",{className:"flex-none relative",onClick:D=>D.stopPropagation(),children:t(e)})]})]})}var nd=152,Zr=10;function sd({index:e,style:t,data:o,skeletonCount:r,renderItemAction:s,onSelectToken:n}){if(!o)return jsx("div",{style:t,children:jsx(Ho,{isLast:e===r-1})});let i=o[e];return i?jsx("div",{style:t,children:jsx(Jr,{token:i,isLast:e===o.length-1,renderAction:s,onSelectToken:n})}):jsx("div",{style:t,children:jsx(Ho,{isLast:e===o.length-1})})}function Je({title:e,tokens:t,isLoading:o,itemHeight:r=nd,renderHeaderExtra:s,renderItemAction:n,onSelectToken:i,onPauseChange:l,onScrollingChange:a,className:d,hideHeader:m}){let c=o||!t?void 0:t,p=c?c.length:Zr,u=useMemo(()=>({data:c,skeletonCount:Zr,renderItemAction:n,onSelectToken:i}),[c,n,i]),[g,f]=useState(false),x=useRef(void 0),b=useRef(false),h=useCallback(()=>{f(true),l?.(true);},[l]),k=useCallback(()=>{f(false),l?.(false);},[l]),T=useCallback(()=>{b.current||(b.current=true,a?.(true)),x.current&&clearTimeout(x.current),x.current=setTimeout(()=>{b.current=false,a?.(false);},180);},[a]);return useEffect(()=>()=>{x.current&&clearTimeout(x.current),b.current&&a?.(false);},[a]),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",d),onMouseEnter:h,onMouseLeave:k,children:[!m&&jsx(Ur,{title:e,isPaused:g,extra:s}),jsx("div",{className:"flex-1 w-full overflow-hidden",onScrollCapture:T,children:jsx(List,{className:"h-full w-full",rowCount:p,rowHeight:r,rowComponent:sd,rowProps:u,overscanCount:10})})]})}function Oo(e,t){let o={...e};for(let r of Object.keys(t))t[r]!==void 0&&(o[r]=t[r]);return o}var ad=["1m","5m","15m","30m","1h","4h","24h"];function ld(e,t){if(!t)return e;if(!e)return t;let o={...e};for(let r of ad)t[r]&&(o[r]=e[r]?Oo(e[r],t[r]):t[r]);return o}function dd(e,t){return t?e?Oo(e,t):t:e}function _t(e,t){return t?e?Oo(e,t):t:e}function X(e,t){let{chain:o,address:r,stats:s,marketData:n,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=ld(e.stats,s),c.marketData=dd(e.marketData,n),c.socialMedias=_t(e.socialMedias,i),c.security=_t(e.security,l),c.launchedFrom=_t(e.launchedFrom,a),c.migratedTo=_t(e.migratedTo,d),c}function $t(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 cd(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 Re(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}cd(s)&&(o.push(s),r=true);}return r?o:e}var pd=["24h","12h","30m","15m","30s","15s","1m","5m","1h","4h","1s"],ud=new Set(["price","marketCap","tvl","holders","top10Holdings","top10Ratio","top100Holdings","top100Ratio","creatorsHoldings","creatorsRatio","createdAt","launchedFromProtocolFamily","migratedToProtocolFamily","tag"]),fd=new Set(["priceChange","volumes","trades","traders","buys","sells"]);function Y(e){if(e==null||e==="")return;let t=Number(e);return Number.isFinite(t)?t:void 0}function en(e){for(let t of pd){if(!e.endsWith(t))continue;let o=e.slice(0,-t.length);return o?{metric:o,resolution:t}:void 0}}function tn(e){if(ud.has(e))return true;let t=en(e);return t?fd.has(t.metric):false}function Kt(e,t){switch(t){case "price":return Y(e.marketData?.priceInUsd);case "marketCap":return Y(e.marketData?.marketCapInUsd);case "tvl":return Y(e.marketData?.tvlInUsd);case "holders":return Y(e.marketData?.holders);case "top10Holdings":return Y(e.marketData?.top10Holdings);case "top10Ratio":return Y(e.marketData?.top10HoldingsRatio);case "top100Holdings":return Y(e.marketData?.top100Holdings);case "top100Ratio":return Y(e.marketData?.top100HoldingsRatio);case "creatorsHoldings":return Y(e.marketData?.devHoldings);case "creatorsRatio":return Y(e.marketData?.devHoldingsRatio);case "createdAt":return e.createdAt?.getTime();case "launchedFromProtocolFamily":return jr(e,e.launchedFrom?.protocolFamily);case "migratedToProtocolFamily":return jr(e,e.migratedTo?.protocolFamily);case "tag":return e.tags?.[0];}let o=en(t);if(!o)return;let r=e.stats?.[o.resolution];switch(o.metric){case "priceChange":return Y(r?.priceChange);case "volumes":return Y(r?.volumesInUsd);case "trades":return Y(r?.trades);case "traders":return Y(r?.traders);case "buys":return Y(r?.buys);case "sells":return Y(r?.sells);default:return}}function jr(e,t){if(t)return parseTokenProtocolFamily(e.chain,t)??t}var gd=new Set(["top10Ratio","top100Ratio","creatorsRatio"]);function on(e){let t=e.trim().toLowerCase();return t.length>0?t:void 0}function xd(e){return [e.name,e.symbol].filter(Boolean).join(" ").toLowerCase()}function kd(e){return Array.isArray(e)?e:void 0}function bd(e){return Array.isArray(e)?void 0:e}function rn(e,t){if(!gd.has(e))return t;let o=Number(t);return Number.isFinite(o)?o/100:t}function ge(e,t){let o=bd(t);return o===void 0?void 0:rn(e,o)}function Do(e,t){return kd(t)?.map(o=>rn(e,o))}function Ye(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 zt(e,t){if(typeof e=="number"){let o=Number(t);return Number.isFinite(o)&&e===o}return String(e)===String(t)}function hd(e,t){if(!tn(t.field))return false;let o=Kt(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=ge(t.field,t.value);return s!==void 0&&zt(o,s)}case "ne":{let s=ge(t.field,t.value);return s!==void 0&&!zt(o,s)}case "gt":{let s=ge(t.field,t.value),n=s!==void 0?Ye(o,s):void 0;return n!==void 0&&n>0}case "gte":{let s=ge(t.field,t.value),n=s!==void 0?Ye(o,s):void 0;return n!==void 0&&n>=0}case "lt":{let s=ge(t.field,t.value),n=s!==void 0?Ye(o,s):void 0;return n!==void 0&&n<0}case "lte":{let s=ge(t.field,t.value),n=s!==void 0?Ye(o,s):void 0;return n!==void 0&&n<=0}case "between":{let s=Do(t.field,t.value);if(!s||s.length<2)return false;let n=Ye(o,s[0]),i=Ye(o,s[1]);return n!==void 0&&i!==void 0&&n>=0&&i<=0}case "in":{let s=Do(t.field,t.value);return s?s.some(n=>zt(o,n)):false}case "nin":{let s=Do(t.field,t.value);return s?s.every(n=>!zt(o,n)):false}case "contains":{let s=ge(t.field,t.value);return s!==void 0&&String(o).includes(String(s))}case "notContains":{let s=ge(t.field,t.value);return s!==void 0&&!String(o).includes(String(s))}case "startsWith":{let s=ge(t.field,t.value);return s!==void 0&&String(o).startsWith(String(s))}case "endsWith":{let s=ge(t.field,t.value);return s!==void 0&&String(o).endsWith(String(s))}default:return false}}function le(e,t){let o=t?.keywords?.map(on).filter(n=>n!==void 0),r=t?.excludeKeywords?.map(on).filter(n=>n!==void 0),s=t?.filters;return !o?.length&&!r?.length&&!s?.length?e:e.filter(n=>{let i=xd(n);return !(o?.length&&!o.some(l=>i.includes(l))||r?.length&&r.some(l=>i.includes(l))||s?.length&&!s.every(l=>hd(n,l)))})}function de({applyUpdates:e,paused:t=false,flushInterval:o=500}){let r=useRef(e),s=useRef(t),n=useRef([]),i=useRef(),l=useRef();r.current=e,s.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(),s.current){i.current=setTimeout(d,o);return}let p=n.current;p.length!==0&&(n.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&&(n.current.push(...p),m());},[m]);return useEffect(()=>{t||d();},[d,t]),useEffect(()=>a,[a]),{enqueueUpdates:c,flush:d}}function dn({chain:e,tokens:t,onUpdate:o,enabled:r=true}){let{subscribeClient:s}=useDexClient(),n=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=()=>{n.current.forEach(m=>m.unsubscribe()),n.current.clear();};useEffect(()=>d,[e,s,r]),useEffect(()=>{if(!r){d();return}let m=new Set(a),c=n.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,s.subscribeToken(e,p,u=>{i.current(u);}));},[a,e,r,s]);}var Nd=80;function gn(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 Sd(e,t,o){return e===t?o:e===o?t:o||t}function Bo(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:Sd(t,e.tokenAAddress,e.tokenBAddress),image:e.dex?.image,programAddress:e.dex?.programAddress,protocolFamily:e.dex?.protocolFamily,protocolName:e.dex?.protocolName}]}}function Cd(e){return {...gn(Bo(e)),...e.token??{},liquidities:Bo(e).liquidities,createdAt:e.token?.createdAt??e.createdAt}}function fn(e){return e.sort((t,o)=>{let r=t.createdAt?.getTime()??0;return (o.createdAt?.getTime()??0)-r}),e.slice(0,Nd)}function xn({chain:e,filters:t,isPaused:o=false,deferUpdates:r=false,updateFlushInterval:s}){let n=useMemo(()=>({chain:e}),[e]),i=useRef(o);i.current=o;let l=useRef(e),[a,d]=useState(true),[m,c]=useState([]);useEffect(()=>{e!==l.current&&(d(true),c([]),l.current=e);},[e]);let{data:p,isPending:u}=useNewPoolsQuery(n);useEffect(()=>{p&&(c(k=>{let T=i.current,C=k.length===0&&p.length>0,y=[...k];for(let L of p){let W=Cd(L),I=y.findIndex(te=>te.address===W.address);I>=0?y[I]=X(y[I],W):(!T||C)&&y.push(W);}return T?y:fn(y)}),d(false));},[p]);let g=useCallback(k=>{c(T=>{let C=i.current,y=[...T],L=false;for(let W of k){let I=y.findIndex(te=>te.address===W.address);I>=0?(L=true,y[I]=X(y[I],W)):C||(L=true,y.push(gn(W)));}return L?C?y:fn(y):T});},[]),{enqueueUpdates:f}=de({applyUpdates:g,paused:r,flushInterval:s}),x=useCallback(k=>{f(k.map(Bo));},[f]);useNewPoolsSubscription({chain:e},x),dn({chain:e,tokens:m,onUpdate:f});let b=useMemo(()=>u||a,[u,a]);return {tokens:useMemo(()=>le(m,t),[m,t]),isLoading:b}}function db({chain:e,filters:t,title:o,renderHeaderExtra:r,renderItemAction:s,onSelectToken:n,className:i,hideHeader:l}){let[a,d]=useState(false),[m,c]=useState(false),{tokens:p,isLoading:u}=xn({chain:e,filters:t,isPaused:a,deferUpdates:m}),g=useCallback(f=>{d(f);},[]);return jsx(Je,{title:o,tokens:p,isLoading:u,renderHeaderExtra:r,renderItemAction:s,onSelectToken:n,onPauseChange:g,onScrollingChange:c,className:i,hideHeader:l})}function xe({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 vn({chain:e,filters:t,isPaused:o=false,refetchInterval:r=3e4,deferUpdates:s=false,updateFlushInterval:n}){let i=useMemo(()=>({chain:e}),[e]),l=useRef(o);l.current=o;let a=useRef(e),[d,m]=useState(true),[c,p]=useState([]);useEffect(()=>{e!==a.current&&(m(true),p([]),a.current=e);},[e]);let{data:u,isPending:g}=useMigratedTokensQuery(i,{refetchInterval:r});useEffect(()=>{u&&(p(k=>{let T=l.current,C=[...k];for(let y of u){let L=C.findIndex(W=>W.address===y.address);L>=0?C[L]=X(C[L],y):T||C.unshift(y);}return C}),m(false));},[u]);let f=useCallback(k=>{p(T=>Re(T,k));},[]),{enqueueUpdates:x}=de({applyUpdates:f,paused:s,flushInterval:n});xe({chain:e,tokens:c,onUpdate:x});let b=useMemo(()=>g||d,[g,d]);return {tokens:useMemo(()=>le(c,t),[c,t]),isLoading:b}}function wb({chain:e,filters:t,title:o,renderHeaderExtra:r,renderItemAction:s,onSelectToken:n,className:i,hideHeader:l}){let[a,d]=useState(false),[m,c]=useState(false),{tokens:p,isLoading:u}=vn({chain:e,filters:t,isPaused:a,deferUpdates:m}),g=useCallback(f=>{d(f);},[]);return jsx(Je,{title:o,tokens:p,isLoading:u,renderHeaderExtra:r,renderItemAction:s,onSelectToken:n,onPauseChange:g,onScrollingChange:c,className:i,hideHeader:l})}function Ud(e){return e.sort((t,o)=>{let r=Number(t.migrateProgress??0);return Number(o.migrateProgress??0)-r})}function Ln({chain:e,filters:t,isPaused:o=false,refetchInterval:r=15e3,deferUpdates:s=false,updateFlushInterval:n}){let i=useMemo(()=>({chain:e}),[e]),l=useRef(o);l.current=o;let a=useRef(e),[d,m]=useState(true),[c,p]=useState([]);useEffect(()=>{e!==a.current&&(m(true),p([]),a.current=e);},[e]);let{data:u,isPending:g}=useFinalStretchTokensQuery(i,{refetchInterval:r});useEffect(()=>{u&&(p(k=>{let T=l.current,C=k.length===0&&u.length>0,y=[...k];for(let L of u){let W=y.findIndex(I=>I.address===L.address);W>=0?y[W]=X(y[W],L):(!T||C)&&y.push(L);}return T?y:Ud(y)}),m(false));},[u]);let f=useCallback(k=>{p(T=>Re(T,k));},[]),{enqueueUpdates:x}=de({applyUpdates:f,paused:s,flushInterval:n});xe({chain:e,tokens:c,onUpdate:x});let b=useMemo(()=>g||d,[g,d]);return {tokens:useMemo(()=>le(c,t),[c,t]),isLoading:b}}function Wb({chain:e,filters:t,title:o,renderHeaderExtra:r,renderItemAction:s,onSelectToken:n,className:i,hideHeader:l}){let[a,d]=useState(false),[m,c]=useState(false),{tokens:p,isLoading:u}=Ln({chain:e,filters:t,isPaused:a,deferUpdates:m}),g=useCallback(f=>{d(f);},[]);return jsx(Je,{title:o,tokens:p,isLoading:u,renderHeaderExtra:r,renderItemAction:s,onSelectToken:n,onPauseChange:g,onScrollingChange:c,className:i,hideHeader:l})}var Wd=10,Vd=atomWithStorage("liberfi:search_histories",[],void 0,{getOnInit:true});function Qt(){let[e,t]=useAtom(Vd),o=useCallback(s=>{let n=s.trim();n&&t(i=>{let l=i.filter(a=>a!==n);return [n,...l].slice(0,Wd)});},[t]),r=useCallback(()=>{t([]);},[t]);return {histories:e,addHistory:o,clearHistories:r}}function Hn({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 Fn({onSelect:e,className:t}){let{histories:o,clearHistories:r}=Qt();return jsx(Hn,{className:cn(t),histories:o,onSelect:e,onClear:r})}function Mn({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 Gt({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]),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(fe,{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(a)})]})]})]})}function Xt({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 cc(){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 Yt({rows:e=6,className:t}){return jsx("div",{className:cn("w-full",t),children:Array.from({length:e}).map((o,r)=>jsx(cc,{},r))})}function Wn({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:l,fetchNextPage:a}=useSearchTokensInfiniteQuery(r,{enabled:!!e});return {tokens:useMemo(()=>s?.pages.flatMap(m=>m.data)??[],[s]),isLoading:n,isFetchingNextPage:i,hasNextPage:l??false,fetchNextPage:a}}var Tc=56;function _n({onSelectToken:e,className:t,...o}){let{tokens:r,isLoading:s,isFetchingNextPage:n,hasNextPage:i,fetchNextPage:l}=Wn(o),a=useRef(null),{height:d}=useResizeObserver({ref:a}),m=useCallback(g=>g<r.length,[r]),c=useCallback(async()=>{i&&!n&&await l();},[i,n,l]),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(Xt,{}),jsx(Yt,{})]}):r.length===0?jsxs("div",{className:cn("w-full",t),children:[jsx(Xt,{}),jsx(vc,{})]}):jsxs("div",{className:cn("w-full h-full flex flex-col",t),children:[jsx(Xt,{className:"flex-none"}),jsx("div",{className:"flex-auto min-h-0",ref:a,children:jsx(List,{style:{height:d},onRowsRendered:u,rowComponent:yc,rowCount:p,rowHeight:Tc,rowProps:{tokens:r,onSelectToken:e},overscanCount:5})})]})}function yc({index:e,style:t,tokens:o,onSelectToken:r}){let s=o[e];return s?jsx("div",{style:t,onClick:()=>r?.(s),children:jsx(Gt,{token:s})}):jsx("div",{style:t,className:"flex items-center justify-center",children:jsx(Spinner,{size:"sm"})})}function vc(){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 Nc(e,t){return typeof e=="number"&&typeof t=="number"?e-t:String(e).localeCompare(String(t))}function et(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:Kt(n,o)}));return s.every(({value:n})=>n===void 0)?e:s.sort((n,i)=>{let l=n.value===void 0,a=i.value===void 0;if(l&&a)return n.index-i.index;if(l)return 1;if(a)return -1;let d=Nc(n.value,i.value);return d===0?n.index-i.index:r==="asc"?d:-d}).map(({token:n})=>n)}function eo({chain:e,resolution:t,filters:o,sortDirections:r,refetchInterval:s=12e3,deferUpdates:n=false,updateFlushInterval:i}){let l=useMemo(()=>({chain:e,resolution:t}),[e,t]),a=useRef(l),[d,m]=useState(true);useEffect(()=>{JSON.stringify(l)!==JSON.stringify(a.current)&&(m(true),a.current=l);},[l]);let[c,p]=useState([]),{data:u,isPending:g}=useTrendingTokensQuery(l,{refetchInterval:s});useEffect(()=>{u&&(p(T=>$t(T,u)),m(false));},[u]);let f=useCallback(T=>{p(C=>Re(C,T));},[]),{enqueueUpdates:x}=de({applyUpdates:f,paused:n,flushInterval:i});useTrendingTokensSubscription({chain:e},x),xe({chain:e,tokens:c,onUpdate:x});let b=useMemo(()=>!!(g||d),[g,d]),h=useMemo(()=>le(c,o),[c,o]);return {tokens:useMemo(()=>et(h,r),[h,r]),isLoading:b}}var Ac=Chain.ETHEREUM,Ic="24h",Hc=56;function zn({chains:e,onSelectToken:t,className:o}){let r=e?.length===1?e[0]:e?.[0]??Ac,{tokens:s,isLoading:n}=eo({chain:r,resolution:Ic});return jsx("div",{className:cn("w-full flex flex-col overflow-hidden",o),children:n?jsx(Yt,{}):jsx("div",{className:"overflow-y-auto",children:s.map(i=>jsx("div",{style:{height:Hc},onClick:()=>t?.(i),children:jsx(Gt,{token:i,className:"h-full"})},i.address))})})}function Gn({onKeywordChange:e}){let[t,o]=useState(""),[r,s]=useState(""),{addHistory:n}=Qt(),i=useCallbackRef(e),l=useCallbackRef(n),a=useMemo(()=>debounce(p=>{s(p),i(p),p&&l(p);},500),[i,l]),d=useCallback(p=>{o(p),a(p);},[a]),m=useCallback(p=>{a.cancel(),o(p),s(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 Jn({chains:e,onKeywordChange:t,onSelectToken:o,onEscape:r}){let{text:s,keyword:n,setText:i,setKeyword:l,clearKeyword:a}=Gn({onKeywordChange:t});return jsxs("div",{className:"w-full h-full flex flex-col gap-3",children:[jsx(Mn,{value:s,onValueChange:i,onClear:a,onPaste:l,onEscape:r}),n?jsx(_n,{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(Fn,{onSelect:l}),jsx(zn,{className:"flex-auto min-h-0",chains:e,onSelectToken:o})]})]})}var zo="search";function AT({id:e=zo}){return jsx(AsyncModal,{id:e,children:t=>jsx(zc,{...t})})}function zc({params:e,isOpen:t,onOpenChange:o,onResult:r}){let{t:s}=useTranslation(),{isMobile:n}=useScreen(),i=useCallback(l=>{r(l);},[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(Jn,{chains:e?.chains,onSelectToken:i,onEscape:()=>o(false)})})]})})}function BT({chains:e,onSelectToken:t,className:o}){let{t:r}=useTranslation(),{isDesktop:s}=useScreen(),{onOpen:n,onClose:i}=useAsyncModal(zo),l=useCallbackRef(t),a=useCallbackRef(async()=>{let m=await n({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]),s?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 Ee(e){return e==null||e===""?"--":formatPercent(Number(e)/100)}function ke(e,t=4,o=4){return e?e.length<=t+o+1?e:`${e.slice(0,t)}\u2026${e.slice(-o)}`:"--"}function Pe(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 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 M(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(l=>{if(!l)return l;let a=l;for(let d of i)a=X(a,d);return a});}),{token:s,isLoading:r}}function tt({label:e,totalFormatted:t,buysFormatted:o,sellsFormatted:r,totalValue:s=0,buysValue:n=0,className:i}){let l=new SafeBigNumber(s??0),a=new SafeBigNumber(n??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 os({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(fe,{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:[ke(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 rs(e,t){return M(e,t)}function ss({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 Ry(e,t){return M(e,t)}function as({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:Ee(t)}),jsx("span",{className:"px-1",children:"/"}),jsx("span",{children:Ee(o)})]}),jsx("div",{className:"text-[10px] text-default-400",children:"Holders / Top10 / Top100"})]})}function ls(e,t){return M(e,t)}function ds({chain:e,address:t,className:o}){let{token:r}=ls(e,t);return jsx(as,{holders:r?.marketData?.holders,top10HoldingsRatio:r?.marketData?.top10HoldingsRatio,top100HoldingsRatio:r?.marketData?.top100HoldingsRatio,className:o})}function ps({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:Pe(o)})]}),jsx("div",{className:"text-[10px] text-default-400",children:"MC / Liq / Age"})]})}function us(e,t){return M(e,t)}function fs({chain:e,address:t,className:o}){let{token:r}=us(e,t);return jsx(ps,{marketCapInUsd:r?.marketData?.marketCapInUsd,tvlInUsd:r?.marketData?.tvlInUsd,createdAt:r?.createdAt,className:o})}function ks({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 bs(e,t){return M(e,t)}function hs({chain:e,address:t,className:o}){let{token:r}=bs(e,t);return jsx(ks,{priceInUsd:r?.marketData?.priceInUsd,price24hAgoInUsd:r?.stats?.["24h"]?.openPriceInUsd,className:o})}function Nm(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 Ts({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:Nm(n,o)},n))})}function ys(e,t){return M(e,t)}function vs({chain:e,address:t,className:o,iconSize:r}){let{token:s}=ys(e,t);return jsx(Ts,{socials:s?.socialMedias,className:o,iconSize:r})}function Cs({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 ws(e,t){return M(e,t)}function Ls({chain:e,address:t,className:o}){let{token:r}=ws(e,t),s=r?.stats?.["24h"];return jsx(Cs,{volumesInUsd:s?.volumesInUsd,trades:s?.trades,traders:s?.traders,className:o})}function Ps({chain:e,address:t,className:o}){return jsx(ss,{className:o,price:jsx(hs,{chain:e,address:t}),marketCap:jsx(fs,{chain:e,address:t}),volume:jsx(Ls,{chain:e,address:t}),holdersCount:jsx(ds,{chain:e,address:t}),socialMedia:jsx(vs,{chain:e,address:t})})}function c0({chain:e,address:t,actions:o,dataStrip:r,className:s,onCopyAddress:n}){let{token:i}=rs(e,t);return jsx(os,{token:i,actions:o,dataStrip:r===void 0?jsx(Ps,{chain:e,address:t}):r,className:s,onCopyAddress:n})}var Am=[{value:"holdingUsd",label:"Value"},{value:"lastActiveAt",label:"Last active"}];function Is({holders:e,isLoading:t,sortBy:o,onSortByChange:r,onlyTracked:s=false,onOnlyTrackedChange:n,onLoadMore:i,hasMore:l,now:a=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:Am.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(Im,{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 Im({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:ke(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(Dt,{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:Ee(e.ratio)}),jsx("td",{className:"px-3 py-2 text-right align-middle text-default-400",children:e.startHoldingAt?Pe(e.startHoldingAt,t):"--"}),jsx("td",{className:"px-3 py-2 text-right align-middle text-default-400",children:e.lastActiveAt?Pe(e.lastActiveAt,t):"--"})]})}function Ms({chain:e,address:t,limit:o=50,initialSortBy:r="holdingUsd"}){let[s,n]=useState(r),[i,l]=useState(void 0),[a,d]=useState([]),m=useCallback(()=>{l(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:g,isFetching:f}=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]),b=a[a.length-1],h=!!(b?.hasNext&&b.endCursor),k=useCallback(()=>{!b?.endCursor||!b.hasNext||l(b.endCursor);},[b]);return {holders:x,isLoading:g||f,sortBy:s,setSortBy:c,hasMore:h,loadMore:k}}function I0({chain:e,address:t,limit:o,initialSortBy:r,initialOnlyTracked:s=false,wellKnownAddresses:n,className:i,renderAddress:l}){let[a,d]=useState(s),{holders:m,isLoading:c,sortBy:p,setSortBy:u,hasMore:g,loadMore:f}=Ms({chain:e,address:t,limit:o,initialSortBy:r});return jsx(Is,{holders:m,isLoading:c,sortBy:p,onSortByChange:u,onlyTracked:a,onOnlyTrackedChange:d,wellKnownAddresses:n,hasMore:g,onLoadMore:f,className:i,renderAddress:l})}var Em=[{value:"timestamp",label:"Latest"},{value:"totalUsd",label:"Top USD"}],Bm=[{value:"all",label:"All"},{value:"buy",label:"Buys"},{value:"sell",label:"Sells"}],Wm=[{value:"all",label:"All"},{value:"dev",label:"DEV"},{value:"tracked",label:"TRACKED"},{value:"you",label:"YOU"}];function Us({activities:e,isLoading:t,sortBy:o,onSortByChange:r,typeFilter:s="all",onTypeFilterChange:n,traderFilter:i="all",onTraderFilterChange:l,youWalletAddress:a,currency:d="usd",onCurrencyChange:m,onLoadMore:c,hasMore:p,now:u=Date.now(),nativeDecimals:g=9,nativeSymbol:f="SOL",className:x,onRowClick:b}){let h=_m(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:[Bm.map(k=>jsx("button",{type:"button",onClick:()=>n?.(k.value),className:cn("rounded px-2 py-1 text-[11px] transition-colors",s===k.value?"bg-default-100 text-foreground":"text-default-400 hover:text-foreground"),children:k.label},k.value)),jsx("span",{className:"mx-1 h-3 w-px bg-default-200","aria-hidden":true}),Wm.map(k=>{let T=i===k.value,C=k.value==="you"&&!a;return jsx("button",{type:"button",disabled:C,onClick:()=>l?.(k.value),className:cn("rounded px-2 py-1 text-[11px] transition-colors",T?"bg-default-100 text-foreground":"text-default-400 hover:text-foreground",C&&"cursor-not-allowed opacity-50"),children:k.label},k.value)})]}),jsxs("div",{className:"flex items-center gap-2",children:[jsx($m,{value:d,nativeSymbol:f,onChange:m}),jsx("div",{className:"flex items-center gap-1",children:Em.map(k=>jsx("button",{type:"button",onClick:()=>r(k.value),className:cn("rounded px-2 py-1 text-[11px] transition-colors",o===k.value?"bg-default-100 text-foreground":"text-default-400 hover:text-foreground"),children:k.label},k.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(k=>jsx(zm,{activity:k,now:u,nativeDecimals:g,nativeSymbol:f,currency:d,onRowClick:b},k.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 Vm(e){return e.type==="buy"?e.to:e.type==="sell"?e.from:e.to}function _m(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 $m({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 Km(e,t,o){if(!e)return "--";let r=Number(e)/Math.pow(10,t);return Number.isFinite(r)?`${formatAmount(r)} ${o}`:"--"}function zm({activity:e,now:t,nativeDecimals:o,nativeSymbol:r,currency:s,onRowClick:n}){let i=Vm(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",n&&"cursor-pointer"),onClick:n?()=>n(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:ke(e.walletAddress,6,6)}),jsx(Br,{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:Km(e.gasFee,o,r)}),jsx("td",{className:"px-3 py-2 text-right align-middle text-default-400",children:Pe(e.time,t)})]})}function Es({chain:e,address:t,limit:o=50,initialSortBy:r="timestamp",initialTypeFilter:s="all"}){let[n,i]=useState(r),[l,a]=useState(s),[d,m]=useState(void 0),[c,p]=useState([]),[u,g]=useState([]),f=useCallback(()=>{m(void 0),p([]),g([]);},[]),x=useCallback(O=>{O!==n&&(i(O),f());},[n,f]),b=useCallback(O=>{O!==l&&(a(O),f());},[l,f]);useEffect(()=>{f();},[e,t,f]);let h=l==="all"?void 0:l,k=useMemo(()=>({chain:e,address:t,cursor:d,limit:o,sortBy:n,type:h}),[e,t,d,o,n,h]),{data:T,isPending:C,isFetching:y}=useTokenActivitiesQuery(k);useEffect(()=>{T&&p(O=>d==null?[T]:O[O.length-1]?.endCursor===T.endCursor?O:[...O,T]);},[T,d]);let L=n==="timestamp"&&l==="all"&&d==null;useTokenActivitiesSubscription({chain:e,address:t},O=>{!L||!O?.length||g(ie=>{let D=new Set(ie.map(_=>_.txHash)),H=O.filter(_=>!D.has(_.txHash));return H.length===0?ie:[...H,...ie].slice(0,100)});});let W=useMemo(()=>{let O=c.flatMap(H=>H.data);if(!L||u.length===0)return O;let ie=new Set(O.map(H=>H.txHash));return [...u.filter(H=>!ie.has(H.txHash)),...O]},[c,u,L]),I=c[c.length-1],te=!!(I?.hasNext&&I.endCursor),Se=useCallback(()=>{!I?.endCursor||!I.hasNext||m(I.endCursor);},[I]);return {activities:W,isLoading:C||y,sortBy:n,setSortBy:x,typeFilter:l,setTypeFilter:b,hasMore:te,loadMore:Se}}function J0({chain:e,address:t,limit:o,initialSortBy:r,initialTypeFilter:s,initialTraderFilter:n="all",initialCurrency:i="usd",youWalletAddress:l,nativeDecimals:a,nativeSymbol:d,className:m,onRowClick:c}){let[p,u]=useState(n),[g,f]=useState(i),{activities:x,isLoading:b,sortBy:h,setSortBy:k,typeFilter:T,setTypeFilter:C,hasMore:y,loadMore:L}=Es({chain:e,address:t,limit:o,initialSortBy:r,initialTypeFilter:s});return jsx(Us,{activities:x,isLoading:b,sortBy:h,onSortByChange:k,typeFilter:T,onTypeFilterChange:C,traderFilter:p,onTraderFilterChange:u,youWalletAddress:l,currency:g,onCurrencyChange:f,hasMore:y,onLoadMore:L,className:m,nativeDecimals:a,nativeSymbol:d,onRowClick:c})}function Ws({stats:e,resolution:t,className:o}){let r=e?.[t],s=r?.traders??0,n=r?.buyers??0,i=r?.sellers??0;return jsx(tt,{className:o,label:`Traders (${t})`,totalFormatted:formatAmount(s),buysFormatted:formatAmount(n),sellsFormatted:formatAmount(i),totalValue:s,buysValue:n})}function Vs(e,t){return M(e,t)}function mN({chain:e,address:t,resolution:o="24h",className:r}){let{token:s}=Vs(e,t);return jsx(Ws,{stats:s?.stats,resolution:o,className:r})}function _s({stats:e,resolution:t,className:o}){let r=e?.[t],s=r?.trades??0,n=r?.buys??0,i=r?.sells??0;return jsx(tt,{className:o,label:`Transactions (${t})`,totalFormatted:formatAmount(s),buysFormatted:formatAmount(n),sellsFormatted:formatAmount(i),totalValue:s,buysValue:n})}function $s(e,t){return M(e,t)}function wN({chain:e,address:t,resolution:o="24h",className:r}){let{token:s}=$s(e,t);return jsx(_s,{stats:s?.stats,resolution:o,className:r})}function Ks({stats:e,resolution:t,className:o}){let r=e?.[t],s=r?.volumesInUsd??"0",n=r?.buyVolumesInUsd??"0",i=r?.sellVolumesInUsd??"0";return jsx(tt,{className:o,label:`Volume (${t})`,totalFormatted:formatAmountUSDCompact(s),buysFormatted:formatAmountUSDCompact(n),sellsFormatted:formatAmountUSDCompact(i),totalValue:s,buysValue:n})}function zs(e,t){return M(e,t)}function VN({chain:e,address:t,resolution:o="24h",className:r}){let{token:s}=zs(e,t);return jsx(Ks,{stats:s?.stats,resolution:o,className:r})}function qs({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(tp,{...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 tp({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 Qs(e,t){let{data:o,isLoading:r}=useTokenSecurityQuery({chain:e,address:t});return {security:o,isLoading:r}}function tS({chain:e,address:t,externalUrl:o,externalLabel:r,className:s}){let{security:n}=Qs(e,t);return jsx(qs,{security:n,externalUrl:o,externalLabel:r,className:s})}function Js({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 Ys(e,t){return M(e,t)}function gS({chain:e,address:t,className:o}){let{token:r}=Ys(e,t);return jsx(Js,{token:r,className:o})}function ei({liquidities:e,totalTvlInUsd:t,collapseAt:o=3,className:r,onPoolClick:s}){let[n,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&&!n&&"hidden",s&&"cursor-pointer hover:bg-default-50"),onClick:s?()=>s(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: ",ke(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:n?"Show less":"Show more"})})]})]})}function ti(e,t){return M(e,t)}function HS({chain:e,address:t,collapseAt:o,className:r,onPoolClick:s}){let{token:n}=ti(e,t);return jsx(ei,{liquidities:n?.liquidities,totalTvlInUsd:n?.marketData?.tvlInUsd,collapseAt:o,className:r,onPoolClick:s})}function oi({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,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:n,className:"rounded px-2 py-1 text-xs text-default-400 transition-colors hover:text-foreground",children:r?"Show less":"Show more"})})]})}function ri(e){return {cexes:e}}function qS({cexes:e,collapseAt:t,className:o}){let{cexes:r}=ri(e);return jsx(oi,{cexes:r,collapseAt:t,className:o})}function si({categories:e,collapseAt:t=4,className:o,onCategoryClick:r}){let[s,n]=useState(!e||e.length<=t),i=useCallback(()=>n(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&&!s;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:s?"Show less":"Show more"})})]})}function ii(e,t){return M(e,t)}function aC({chain:e,address:t,collapseAt:o,className:r,onCategoryClick:s}){let{token:n}=ii(e,t);return jsx(si,{categories:n?.tags,collapseAt:o,className:r,onCategoryClick:s})}var ai=["5m","1h","4h","24h"];function li({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),l=s.minus(n),a=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(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 di({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,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 ci({chain:e,address:t}){let{data:o,isLoading:r}=useTokenStatsQuery({chain:e,address:t});return {stats:o,isLoading:r}}function NC({chain:e,address:t,baseResolution:o="5m",hoverResolutions:r=ai,height:s=64,className:n}){let{stats:i}=ci({chain:e,address:t});return jsx(StatsFlipPanel,{className:n,height:s,base:jsx(li,{stats:i,resolution:o}),hover:jsx(di,{stats:i,resolutions:r})})}function mi({positions:e,isLoading:t,hasMore:o,onLoadMore:r,currency:s="usd",onCurrencyChange:n,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(Lp,{value:s,nativeSymbol:a,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(Pp,{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 Lp({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 Pp({position:e,currency:t,renderActions:o}){let{bought:r,sold:s,remaining:n,pnl:i}=useMemo(()=>Rp(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: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 Rp(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),l=t==="usd"?formatAmountUSDCompact(r??0):formatAmount(r??0),a=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:l,remaining:a,pnl:{amount:c,ratio:p,isPositive:m}}}function fi({chain:e,wallet:t,limit:o=50,initialShowHidden:r=false}){let[s,n]=useState(void 0),[i,l]=useState([]),[a,d]=useState(r);useEffect(()=>{n(void 0),l([]);},[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&&l(h=>s==null?[c]:h[h.length-1]?.endCursor===c.endCursor?h:[...h,c]);},[c,s]);let g=useMemo(()=>i.flatMap(h=>h.portfolios),[i]),f=i[i.length-1],x=!!(f?.hasNext&&f.endCursor),b=useCallback(()=>{!f?.endCursor||!f.hasNext||n(f.endCursor);},[f]);return {positions:g,isLoading:!!t&&(p||u),hasMore:x,loadMore:b,showHidden:a,setShowHidden:d}}function VC({chain:e,wallet:t,limit:o,initialCurrency:r="usd",nativeSymbol:s,renderActions:n,className:i}){let[l,a]=useState(r),{positions:d,isLoading:m,hasMore:c,loadMore:p,showHidden:u,setShowHidden:g}=fi({chain:e,wallet:t,limit:o});return jsx(mi,{className:i,positions:d,isLoading:m,hasMore:c,onLoadMore:p,currency:l,onCurrencyChange:a,showHidden:u,onShowHiddenChange:g,nativeSymbol:s,renderActions:n})}function gi({orders:e,isLoading:t,unavailable:o,hasMore:r,onLoadMore:s,stateFilter:n,onStateFilterChange:i,onlyThisToken:l=false,onOnlyThisTokenChange:a,tokenSymbol:d,currency:m="usd",onCurrencyChange:c,nativeSymbol:p="Native",onCancelAll:u,renderActions:g,className:f}){return jsxs("div",{className:cn("flex flex-col",f),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: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(Dp,{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(Ep,{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: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 Dp({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 Ep({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 Wp(e){return e instanceof Error&&e.code==="NotImplemented"}function Vp(e){return e==="active"?"active":"filled"}function hi({chain:e,wallet:t,tokenAddress:o,limit:r=50,initialStateFilter:s="active",initialOnlyThisToken:n=false}){let[i,l]=useState(s),[a,d]=useState(n),[m,c]=useState(void 0),[p,u]=useState([]);useEffect(()=>{c(void 0),u([]);},[e,t,i,a,o]);let g=useCallback(I=>{I!==i&&l(I);},[i]),f=useMemo(()=>({chain:e,address:t??"",cursor:m,limit:r,state:Vp(i),tokenAddress:a?o:void 0}),[e,t,m,r,i,a,o]),{data:x,isPending:b,isFetching:h,error:k}=useWalletLimitOrdersQuery(f,{enabled:!!t});useEffect(()=>{x&&u(I=>m==null?[x]:I[I.length-1]?.endCursor===x.endCursor?I:[...I,x]);},[x,m]);let T=!!k&&Wp(k),C=useMemo(()=>p.flatMap(I=>I.data),[p]),y=p[p.length-1],L=!!(y?.hasNext&&y.endCursor),W=useCallback(()=>{!y?.endCursor||!y.hasNext||c(y.endCursor);},[y]);return {orders:C,isLoading:!!t&&!T&&(b||h),unavailable:T,hasMore:L,loadMore:W,stateFilter:i,setStateFilter:g,onlyThisToken:a,setOnlyThisToken:d}}function sw({chain:e,wallet:t,tokenAddress:o,tokenSymbol:r,limit:s,initialStateFilter:n="active",initialCurrency:i="usd",nativeSymbol:l,onCancelAll:a,renderActions:d,className:m}){let[c,p]=useState(i),{orders:u,isLoading:g,unavailable:f,hasMore:x,loadMore:b,stateFilter:h,setStateFilter:k,onlyThisToken:T,setOnlyThisToken:C}=hi({chain:e,wallet:t,tokenAddress:o,limit:s,initialStateFilter:n});return jsx(gi,{className:m,orders:u,isLoading:g,unavailable:f,hasMore:x,onLoadMore:b,stateFilter:h,onStateFilterChange:k,onlyThisToken:T,onOnlyThisTokenChange:C,tokenSymbol:r,currency:c,onCurrencyChange:p,nativeSymbol:l,onCancelAll:f?void 0:a,renderActions:d})}function Ti({traders:e,isLoading:t,hasMore:o,onLoadMore:r,onlyTracked:s=false,onOnlyTrackedChange:n,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: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(Qp,{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 Qp({trader:e,now:t,renderAddress:o}){let r=useMemo(()=>o?o(e.address):jsx("span",{className:"font-mono text-[11px] text-default-500",children:ke(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(Dt,{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:Ee(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?Pe(e.lastActiveAt,t):"--"})]})}function vi({chain:e,address:t,limit:o=50,initialOnlyTracked:r=false}){let[s,n]=useState(void 0),[i,l]=useState([]),[a,d]=useState(r);useEffect(()=>{n(void 0),l([]);},[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&&l(k=>s==null?[c]:k[k.length-1]?.endCursor===c.endCursor?k:[...k,c]);},[c,s]);let g=useMemo(()=>i.flatMap(k=>k.data),[i]),f=useMemo(()=>a?g.filter(k=>k.tags&&k.tags.length>0):g,[g,a]),x=i[i.length-1],b=!!(x?.hasNext&&x.endCursor),h=useCallback(()=>{!x?.endCursor||!x.hasNext||n(x.endCursor);},[x]);return {traders:f,isLoading:p||u,hasMore:b,loadMore:h,onlyTracked:a,setOnlyTracked:d}}function Sw({chain:e,address:t,limit:o,className:r,renderAddress:s}){let{traders:n,isLoading:i,hasMore:l,loadMore:a,onlyTracked:d,setOnlyTracked:m}=vi({chain:e,address:t,limit:o});return jsx(Ti,{className:r,traders:n,isLoading:i,hasMore:l,onLoadMore:a,onlyTracked:d,onOnlyTrackedChange:m,renderAddress:s})}function Si({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(l=>jsx(Zp,{token:l,renderTokenLink:n},`${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: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 Zp({token:e,renderTokenLink:t}){let o=e.marketData?.marketCapInUsd??e.marketData?.marketCap,r=e.marketData?.tvlInUsd,n=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:n?formatAmountUSDCompact(n):"--"})]})}function Ci({tokens:e,className:t}){let o=e.length,r=e.filter(l=>!!l.migratedTo).length,s=o===0?0:Math.round(r/o*100),n=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(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 tu(e){return e instanceof Error&&e.code==="NotImplemented"}function Ri({chain:e,creator:t,limit:o=20}){let[r,s]=useState(void 0),[n,i]=useState([]);useEffect(()=>{s(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(b=>r==null?[a]:b[b.length-1]?.endCursor===a.endCursor?b:[...b,a]);},[a,r]);let p=!!c&&tu(c),u=useMemo(()=>n.flatMap(b=>b.data),[n]),g=n[n.length-1],f=!!(g?.hasNext&&g.endCursor),x=useCallback(()=>{!g?.endCursor||!g.hasNext||s(g.endCursor);},[g]);return {tokens:u,isLoading:!!t&&!p&&(d||m),unavailable:p,hasMore:f,loadMore:x}}function Ww({chain:e,creator:t,limit:o,showSummary:r=false,renderTokenLink:s,className:n}){let{tokens:i,isLoading:l,unavailable:a,hasMore:d,loadMore:m}=Ri({chain:e,creator:t,limit:o});return jsxs("div",{className:n,children:[jsx(Si,{tokens:i,isLoading:l,unavailable:a,hasMore:d,onLoadMore:m,renderTokenLink:s}),r&&!a?jsx(Ci,{tokens:i}):null]})}function Hi({token:e,athInUsd:t,athAt:o,globalFeesPaidInUsd:r,rank:s,onTogglePin:n,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(dt,{label:"Price",value:a?formatPriceUSD(a):"--"}),jsx(dt,{label:"Liquidity",value:d?formatAmountUSDCompact(d):"--"}),jsx(dt,{label:"Supply",value:m?formatAmount(m):"--"}),r?jsx(dt,{label:"Fees Paid",value:formatAmountUSDCompact(r)}):null,t?jsx(dt,{label:"ATH",value:formatAmountUSDCompact(t),title:o?`All-time high at ${o.toLocaleDateString()}`:void 0}):null,s!==void 0?jsx(dt,{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 dt({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 Mi({chain:e,address:t}){return M(e,t)}function tL({chain:e,address:t,athInUsd:o,athAt:r,globalFeesPaidInUsd:s,rank:n,pinned:i,onTogglePin:l,className:a}){let{token:d}=Mi({chain:e,address:t});return jsx(Hi,{className:a,token:d,athInUsd:o,athAt:r,globalFeesPaidInUsd:s,rank:n,pinned:i,onTogglePin:l})}function Ui({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 Oi({chain:e,address:t,keyword:o,limit:r=10}){let s=!!o&&o.length>0,{data:n,isPending:i,isFetching:l}=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||l),unavailable:!s}}function kL({chain:e,address:t,keyword:o,limit:r,onTokenClick:s,className:n}){let{tokens:i,isLoading:l,unavailable:a}=Oi({chain:e,address:t,keyword:o,limit:r});return jsx(Ui,{className:n,tokens:i,isLoading:l,unavailable:a,onTokenClick:s})}function Di({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 Ei(e){return {tokens:[],isLoading:false,unavailable:true}}function AL({chain:e,address:t,onTokenClick:o,className:r}){let{tokens:s,unavailable:n}=Ei();return jsx(Di,{className:r,tokens:s,unavailable:n,onTokenClick:o})}function $i({keywords:e,excludeKeywords:t,onKeywordsChange:o,onExcludeKeywordsChange:r,className:s}){let{t:n}=useTranslation(),[i,l]=useState(e?.join(", ")??""),[a,d]=useState(t?.join(", ")??"");useEffect(()=>{l(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=>{l(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:a,onValueChange:c})]})]})}function uo(e){let t=e.split(",").map(o=>o.trim()).filter(Boolean);return t.length>0?t:void 0}function Xi({protocols:e,selectedProtocols:t=[],onSelectedProtocolsChange:o,className:r}){let{t:s}=useTranslation(),[n,i]=useState(t);useEffect(()=>{i(t);},[t]);let l=useMemo(()=>e.every(m=>n.includes(m)),[e,n]),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(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:a,children:s(l?"tokens.filters.protocols.unselectAll":"tokens.filters.protocols.selectAll")})]}),jsx("div",{className:"grid grid-cols-3 gap-3",children:e.map(m=>{let c=Oe(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 ye({title:e,field:t,value:o,onChange:r}){let{t:s}=useTranslation(),[n,i]=useState(o?xr(o).min:NaN),[l,a]=useState(o?xr(o).max:NaN);useEffect(()=>{if(o===void 0)i(NaN),a(NaN);else {let{min:c,max:p}=xr(o);i(c),a(p);}},[o]);let d=useCallback(c=>{i(c),r?.(ji(t,c,l));},[t,r,l]),m=useCallback(c=>{a(c),r?.(ji(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:l,onValueChange:m,variant:"bordered",radius:"lg",size:"sm",placeholder:s("tokens.filters.stats.max"),"aria-label":`${e} max`})]})]})}function xr(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 ji(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 ta({values:e,onValuesChange:t,className:o}){let{t:r}=useTranslation(),[s,n]=useState(e);useEffect(()=>{n(e);},[e]);let i=useCallback(l=>a=>{if(a===void 0){let d=(s??[]).filter(m=>m.field!==l);d=d.length>0?d:void 0,n(d),t?.(d);}else {let d=[...(s??[]).filter(m=>m.field!==l),a];n(d),t?.(d);}},[s,t]);return jsxs("div",{className:cn("flex flex-col gap-4",o),children:[jsx(ye,{field:"holders",title:r("tokens.filters.stats.audits.holders"),value:s?.find(l=>l.field==="holders"),onChange:i("holders")}),jsx(ye,{field:"top10Ratio",title:r("tokens.filters.stats.audits.top10HoldingsRatio"),value:s?.find(l=>l.field==="top10Ratio"),onChange:i("top10Ratio")}),jsx(ye,{field:"top100Ratio",title:r("tokens.filters.stats.audits.top100HoldingsRatio"),value:s?.find(l=>l.field==="top100Ratio"),onChange:i("top100Ratio")}),jsx(ye,{field:"creatorsRatio",title:r("tokens.filters.stats.audits.devHoldingsRatio"),value:s?.find(l=>l.field==="creatorsRatio"),onChange:i("creatorsRatio")})]})}function oa({resolution:e,values:t,onValuesChange:o,className:r}){let{t:s}=useTranslation(),[n,i]=useState(t);useEffect(()=>{i(t);},[t]);let l=useCallback(a=>d=>{if(d===void 0){let m=(n??[]).filter(c=>c.field!==a);m=m.length>0?m:void 0,i(m),o?.(m);}else {let m=[...(n??[]).filter(c=>c.field!==a),d];i(m),o?.(m);}},[n,o]);return jsxs("div",{className:cn("flex flex-col gap-4",r),children:[jsx(ye,{field:"marketCap",title:s("tokens.filters.stats.metrics.marketCap"),value:n?.find(a=>a.field==="marketCap"),onChange:l("marketCap")}),jsx(ye,{field:"tvl",title:s("tokens.filters.stats.metrics.liquidity"),value:n?.find(a=>a.field==="tvl"),onChange:l("tvl")}),jsx(ye,{field:`volumes${e}`,title:s("tokens.filters.stats.metrics.volumes",{resolution:s(`common.resolution.${e}`)}),value:n?.find(a=>a.field===`volumes${e}`),onChange:l(`volumes${e}`)}),jsx(ye,{field:`trades${e}`,title:s("tokens.filters.stats.metrics.txns",{resolution:s(`common.resolution.${e}`)}),value:n?.find(a=>a.field===`trades${e}`),onChange:l(`trades${e}`)})]})}function la({resolution:e,values:t,onValuesChange:o,className:r}){let{t:s}=useTranslation(),[n,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: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(ta,{values:l,onValuesChange:d,className:cn({hidden:n!=="audits"})}),jsx(oa,{values:l,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(da(o?.filters,e));useEffect(()=>{i(da(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(b=>{i(b),r?.(To(e,b,l,d,c));},[e,l,d,c,r]),g=useCallback(b=>{a(b),r?.(To(e,n,b,d,c));},[e,n,d,c,r]),f=useCallback(b=>{m(b),r?.(To(e,n,l,b,c));},[e,n,l,c,r]),x=useCallback(b=>{p(b),r?.(To(e,n,l,d,b));},[e,n,l,d,r]);return jsxs("div",{className:cn("flex flex-col gap-4",s),children:[e&&e.length>0&&jsxs(Fragment,{children:[jsx(Xi,{protocols:e,selectedProtocols:n,onSelectedProtocolsChange:u}),jsx("div",{style:{height:1,background:"rgba(39,39,42,1)"}})]}),jsx($i,{keywords:l,excludeKeywords:d,onKeywordsChange:g,onExcludeKeywordsChange:f}),jsx("div",{style:{height:1,background:"rgba(39,39,42,1)"}}),jsx(la,{resolution:t,values:c,onValuesChange:x})]})}function da(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(l=>t.includes(l))||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 ua({protocols:e,resolution:t,filters:o,onFiltersChange:r,triggerVariant:s="default",badgePlacement:n="outer",className:i}){let{t:l}=useTranslation(),{isOpen:a,onOpen:d,onClose:m,onOpenChange:c}=useDisclosure(),[p,u]=useState(o),g=useCallback(()=>{u(void 0);},[]),f=useCallback(()=>{r?.(p),m();},[p,r,m]);useEffect(()=>{u(o);},[a,o]);let x=useMemo(()=>Object.values(o||{}).every(b=>b===void 0),[o]);return jsxs(Fragment,{children:[jsxs("button",{type:"button",className:i,onClick:d,style:{display:"inline-flex",alignItems:"center",justifyContent:"center",borderRadius:9999,border:s==="plain"?"none":"1px solid rgba(63,63,70,0.5)",background:s==="plain"?"transparent":"rgba(39,39,42,0.6)",width:32,height:32,minHeight:32,padding:0,cursor:"pointer",position:"relative"},children:[jsx(FilterIcon,{width:16,height:16,className:"text-zinc-400"}),!x&&jsx("span",{style:{position:"absolute",top:n==="icon"?6:-2,right:n==="icon"?6:-2,width:8,height:8,borderRadius:4,background:"#c7ff2e"}})]}),jsx(StyledModal,{isOpen:a,onOpenChange:c,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:l("tokens.filters.modal.title")})}),jsx(ModalBody,{className:"px-0 pt-0 pb-4",children:jsx(ScrollShadow,{children:jsx(yo,{protocols:e,resolution:t,filters:p,onFiltersChange:u,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:g,children:l("common.reset")}),jsx(Button,{color:"primary",size:"sm",radius:"full",onPress:f,children:l("common.apply")})]})})]})})]})}var ka={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},af={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"},lf={height:1,background:"rgba(39,39,42,1)",margin:0};function ba({protocols:e,resolution:t,filters:o,onFiltersChange:r,iconOnly:s=false,className:n}){let{t:i}=useTranslation(),[l,a]=useState(false),d=useRef(null),[m,c]=useState(o),p=useCallback(()=>{c(void 0);},[]),u=useCallback(()=>{r?.(m),a(false);},[m,r]);useEffect(()=>{c(o);},[l,o]),useEffect(()=>{let f=x=>{d.current&&!d.current.contains(x.target)&&a(false);};return document.addEventListener("mousedown",f),()=>document.removeEventListener("mousedown",f)},[]),useEffect(()=>{if(!l)return;let f=x=>{x.key==="Escape"&&a(false);};return document.addEventListener("keydown",f),()=>document.removeEventListener("keydown",f)},[l]);let g=useMemo(()=>Object.values(o||{}).every(f=>f===void 0),[o]);return jsxs("div",{ref:d,style:{position:"relative"},children:[jsxs("div",{style:{position:"relative",display:"inline-flex"},children:[jsxs("button",{type:"button",className:n,style:s?{...ka,justifyContent:"center",gap:0,width:32,minWidth:32,padding:0}:ka,onMouseEnter:f=>{f.currentTarget.style.background="rgba(39,39,42,1)";},onMouseLeave:f=>{f.currentTarget.style.background="rgba(39,39,42,0.6)";},onClick:()=>a(f=>!f),children:[jsx(FilterIcon,{width:16,height:16,className:"flex-none"}),!s&&jsxs(Fragment,{children:[jsx("span",{className:"hidden sm:block",children:i("tokens.listHeader.filter")}),jsx(df,{open:l})]})]}),!g&&jsx("span",{style:{position:"absolute",top:-4,right:-4,minWidth:8,height:8,borderRadius:4,background:"#c7ff2e"}})]}),l&&jsxs("div",{style:{...af,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:m,onFiltersChange:c})})}),jsx("div",{style:lf}),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:p,children:i("common.reset")}),jsx(Button,{variant:"solid",size:"sm",color:"primary",radius:"full",onPress:u,children:i("common.apply")})]})]})]})}function df({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 v1({popoverPlacement:e="bottom-end",iconOnly:t,className:o,desktopOverlay:r="popover",...s}){let{isMobile:n}=useScreen();return n||r==="modal"?jsx(ua,{className:o,...s}):jsx(ba,{placement:e,iconOnly:t,className:o,...s})}function ya({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 Nf={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},Sf={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 Na({resolution:e,onResolutionChange:t,resolutionOptions:o=["1m","5m","1h","4h","24h"]}){let{t:r}=useTranslation(),[s,n]=useState(false),i=useRef(null),l=useCallback(a=>{t?.(a),n(false);},[t]);return useEffect(()=>{if(!s)return;let a=m=>{i.current&&!i.current.contains(m.target)&&n(false);},d=m=>{m.key==="Escape"&&n(false);};return document.addEventListener("mousedown",a),document.addEventListener("keydown",d),()=>{document.removeEventListener("mousedown",a),document.removeEventListener("keydown",d);}},[s]),jsxs("div",{ref:i,style:{position:"relative",zIndex:50},children:[jsxs("button",{type:"button",style:Nf,onClick:()=>n(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:s?"rotate(180deg)":void 0}})]}),s&&jsx("div",{style:Sf,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 B1(e){let{isMobile:t}=useScreen();return t?jsx(Na,{...e}):jsx(ya,{...e})}var wa=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 Gf(e){return e.length<=10?e:`${e.slice(0,4)}...${e.slice(-4)}`}var Fa=memo(function({token:t}){let o=useCopyToClipboard(),[r,s]=useState(false),[n,i]=useState(false),l=useRef(void 0),a=useRef(void 0),{t:d}=useTranslation(),m=useCallback(u=>{u.preventDefault(),u.stopPropagation(),o(t.name,()=>{toast.success(d("tokens.copied.name")),s(true),l.current&&clearTimeout(l.current),l.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),a.current&&clearTimeout(a.current),a.current=setTimeout(()=>{i(false);},2e3);});},[o,t.address,d]);useEffect(()=>()=>{l.current&&clearTimeout(l.current),a.current&&clearTimeout(a.current);},[]);let p=useTickAge(t.createdAt);return jsxs("div",{className:"w-full flex justify-start items-center gap-3",children:[jsx(fe,{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:Gf(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 Ma=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]),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(z,{icon:jsx(PeopleIcon,{width:12,height:12}),value:formatAmount(r?.holders),tooltip:o("tokens.tokenInfo.holders"),warning:false,disable:!r?.holders}),jsx(z,{icon:jsx(KlineCandlesIcon,{width:12,height:12}),value:formatAmount(r?.proHolders),tooltip:o("tokens.tokenInfo.proHolders"),warning:false,disable:!r?.proHolders}),jsx(z,{icon:jsx(StarIcon,{width:12,height:12}),value:formatAmount(r?.kolHolders),tooltip:o("tokens.tokenInfo.kolHolders"),warning:false,disable:!r?.kolHolders}),jsx(z,{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(z,{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(z,{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(z,{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(z,{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 Ua=memo(function({token:t}){let o=useMemo(()=>t.marketData?.tvlInUsd,[t.marketData?.tvlInUsd]);return jsx(Fragment,{children:formatAmountUSD(o)})});var Oa=memo(function({token:t}){let o=useMemo(()=>t.marketData?.marketCapInUsd,[t.marketData?.marketCapInUsd]);return jsx(Fragment,{children:formatAmountUSD(o)})});var Ba=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 Va=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 $a=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 za=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 Sg=`
21
+ `})]})}function Yr({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(B=>{B.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]),g=useMemo(()=>d?.sellVolumesInUsd,[d?.sellVolumesInUsd]),f=useMemo(()=>d?.trades,[d?.trades]),x=useMemo(()=>l?.marketCapInUsd,[l?.marketCapInUsd]),k=useMemo(()=>l?.tvlInUsd,[l?.tvlInUsd]),h=useMemo(()=>{let B=new SafeBigNumber(x);return B.lt(1e3)?"text-foreground":B.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]),N=useMemo(()=>new SafeBigNumber(l?.insiderHoldingsRatio).gte(.1),[l?.insiderHoldingsRatio]),y=useMemo(()=>new SafeBigNumber(l?.sniperHoldingsRatio).gte(.1),[l?.sniperHoldingsRatio]),P=useMemo(()=>new SafeBigNumber(l?.bundleHoldingsRatio).gte(.1),[l?.bundleHoldingsRatio]),[L,H]=useMemo(()=>{let B=Number(d?.buys??0),F=Number(d?.sells??0),_=B+F;if(_===0)return [12,12];let gt=Math.round(B/_*24);return [gt,24-gt]},[d?.buys,d?.sells]),te=l?.holders!==void 0&&l.holders>0,Se=l?.proHolders!==void 0&&l.proHolders>0,D=l?.kolHolders!==void 0&&l.kolHolders>0,ie=te||Se||D;return jsxs("div",{className:cn$1("relative w-full h-full overflow-hidden px-4 py-3 hover:bg-content2/40 cursor-pointer",s),style:{borderBottom:o?"none":"1px solid 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(fe,{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:B=>B.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:B=>B.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:B=>B.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:B=>B.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$1(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(k)})]})]}),ie&&jsxs("div",{className:"flex items-center gap-2 text-xs font-mono text-neutral leading-none",children:[te&&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)]})}),Se&&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)]})}),D&&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$1("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(f)})]})]})]}),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(z,{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(z,{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(z,{icon:jsx(SniperIcon,{width:12,height:12}),value:formatPercent(l?.sniperHoldingsRatio),tooltip:n("tokens.tokenInfo.sniperHoldingsRatio"),warning:y,disable:!l?.sniperHoldingsRatio||l?.sniperHoldingsRatio==="0"}),jsx(z,{icon:jsx(RatIcon,{width:12,height:12}),value:formatPercent(l?.insiderHoldingsRatio),tooltip:n("tokens.tokenInfo.insiderHoldingsRatio"),warning:N,disable:!l?.insiderHoldingsRatio||l?.insiderHoldingsRatio==="0"}),jsx(z,{icon:jsx(BundlesIcon,{width:12,height:12}),value:formatPercent(l?.bundleHoldingsRatio),tooltip:n("tokens.tokenInfo.bundleHoldingsRatio"),warning:P,disable:!l?.bundleHoldingsRatio||l?.bundleHoldingsRatio==="0"})]})}),t&&jsx("div",{className:"flex-none relative",onClick:B=>B.stopPropagation(),children:t(e)})]})]})}var id=152,jr=10;function ad({index:e,style:t,data:o,skeletonCount:r,renderItemAction:s,onSelectToken:n}){if(!o)return jsx("div",{style:t,children:jsx(Fo,{isLast:e===r-1})});let i=o[e];return i?jsx("div",{style:t,children:jsx(Yr,{token:i,isLast:e===o.length-1,renderAction:s,onSelectToken:n})}):jsx("div",{style:t,children:jsx(Fo,{isLast:e===o.length-1})})}function Xe({title:e,tokens:t,isLoading:o,itemHeight:r=id,renderHeaderExtra:s,renderItemAction:n,onSelectToken:i,onPauseChange:a,onScrollingChange:l,className:d,hideHeader:m}){let c=o||!t?void 0:t,p=c?c.length:jr,u=useMemo(()=>({data:c,skeletonCount:jr,renderItemAction:n,onSelectToken:i}),[c,n,i]),[g,f]=useState(false),x=useRef(void 0),k=useRef(false),h=useCallback(()=>{f(true),a?.(true);},[a]),b=useCallback(()=>{f(false),a?.(false);},[a]),T=useCallback(()=>{k.current||(k.current=true,l?.(true)),x.current&&clearTimeout(x.current),x.current=setTimeout(()=>{k.current=false,l?.(false);},180);},[l]);return useEffect(()=>()=>{x.current&&clearTimeout(x.current),k.current&&l?.(false);},[l]),jsxs("div",{className:cn$1("w-full h-full bg-[#0a0a0b] overflow-hidden flex flex-col border border-[rgba(39,39,42,0.6)] rounded-lg",d),onMouseEnter:h,onMouseLeave:b,children:[!m&&jsx(Or,{title:e,isPaused:g,extra:s}),jsx("div",{className:"flex-1 w-full overflow-hidden",onScrollCapture:T,children:jsx(List,{className:"h-full w-full",rowCount:p,rowHeight:r,rowComponent:ad,rowProps:u,overscanCount:10})})]})}function Do(e,t){let o={...e};for(let r of Object.keys(t))t[r]!==void 0&&(o[r]=t[r]);return o}var dd=["1m","5m","15m","30m","1h","4h","24h"];function cd(e,t){if(!t)return e;if(!e)return t;let o={...e};for(let r of dd)t[r]&&(o[r]=e[r]?Do(e[r],t[r]):t[r]);return o}function md(e,t){return t?e?Do(e,t):t:e}function _t(e,t){return t?e?Do(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=cd(e.stats,s),c.marketData=md(e.marketData,n),c.socialMedias=_t(e.socialMedias,i),c.security=_t(e.security,a),c.launchedFrom=_t(e.launchedFrom,l),c.migratedTo=_t(e.migratedTo,d),c}function $t(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 pd(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 Re(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}pd(s)&&(o.push(s),r=true);}return r?o:e}var fd=["24h","12h","30m","15m","30s","15s","1m","5m","1h","4h","1s"],gd=new Set(["price","marketCap","tvl","holders","top10Holdings","top10Ratio","top100Holdings","top100Ratio","creatorsHoldings","creatorsRatio","createdAt","launchedFromProtocolFamily","migratedToProtocolFamily","tag"]),xd=new Set(["priceChange","volumes","trades","traders","buys","sells"]);function Y(e){if(e==null||e==="")return;let t=Number(e);return Number.isFinite(t)?t:void 0}function tn(e){for(let t of fd){if(!e.endsWith(t))continue;let o=e.slice(0,-t.length);return o?{metric:o,resolution:t}:void 0}}function on(e){if(gd.has(e))return true;let t=tn(e);return t?xd.has(t.metric):false}function Kt(e,t){switch(t){case "price":return Y(e.marketData?.priceInUsd);case "marketCap":return Y(e.marketData?.marketCapInUsd);case "tvl":return Y(e.marketData?.tvlInUsd);case "holders":return Y(e.marketData?.holders);case "top10Holdings":return Y(e.marketData?.top10Holdings);case "top10Ratio":return Y(e.marketData?.top10HoldingsRatio);case "top100Holdings":return Y(e.marketData?.top100Holdings);case "top100Ratio":return Y(e.marketData?.top100HoldingsRatio);case "creatorsHoldings":return Y(e.marketData?.devHoldings);case "creatorsRatio":return Y(e.marketData?.devHoldingsRatio);case "createdAt":return e.createdAt?.getTime();case "launchedFromProtocolFamily":return en(e,e.launchedFrom?.protocolFamily);case "migratedToProtocolFamily":return en(e,e.migratedTo?.protocolFamily);case "tag":return e.tags?.[0];}let o=tn(t);if(!o)return;let r=e.stats?.[o.resolution];switch(o.metric){case "priceChange":return Y(r?.priceChange);case "volumes":return Y(r?.volumesInUsd);case "trades":return Y(r?.trades);case "traders":return Y(r?.traders);case "buys":return Y(r?.buys);case "sells":return Y(r?.sells);default:return}}function en(e,t){if(t)return parseTokenProtocolFamily(e.chain,t)??t}var kd=new Set(["top10Ratio","top100Ratio","creatorsRatio"]);function rn(e){let t=e.trim().toLowerCase();return t.length>0?t:void 0}function bd(e){return [e.name,e.symbol].filter(Boolean).join(" ").toLowerCase()}function hd(e){return Array.isArray(e)?e:void 0}function Td(e){return Array.isArray(e)?void 0:e}function nn(e,t){if(!kd.has(e))return t;let o=Number(t);return Number.isFinite(o)?o/100:t}function ge(e,t){let o=Td(t);return o===void 0?void 0:nn(e,o)}function Bo(e,t){return hd(t)?.map(o=>nn(e,o))}function Je(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 zt(e,t){if(typeof e=="number"){let o=Number(t);return Number.isFinite(o)&&e===o}return String(e)===String(t)}function yd(e,t){if(!on(t.field))return false;let o=Kt(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=ge(t.field,t.value);return s!==void 0&&zt(o,s)}case "ne":{let s=ge(t.field,t.value);return s!==void 0&&!zt(o,s)}case "gt":{let s=ge(t.field,t.value),n=s!==void 0?Je(o,s):void 0;return n!==void 0&&n>0}case "gte":{let s=ge(t.field,t.value),n=s!==void 0?Je(o,s):void 0;return n!==void 0&&n>=0}case "lt":{let s=ge(t.field,t.value),n=s!==void 0?Je(o,s):void 0;return n!==void 0&&n<0}case "lte":{let s=ge(t.field,t.value),n=s!==void 0?Je(o,s):void 0;return n!==void 0&&n<=0}case "between":{let s=Bo(t.field,t.value);if(!s||s.length<2)return false;let n=Je(o,s[0]),i=Je(o,s[1]);return n!==void 0&&i!==void 0&&n>=0&&i<=0}case "in":{let s=Bo(t.field,t.value);return s?s.some(n=>zt(o,n)):false}case "nin":{let s=Bo(t.field,t.value);return s?s.every(n=>!zt(o,n)):false}case "contains":{let s=ge(t.field,t.value);return s!==void 0&&String(o).includes(String(s))}case "notContains":{let s=ge(t.field,t.value);return s!==void 0&&!String(o).includes(String(s))}case "startsWith":{let s=ge(t.field,t.value);return s!==void 0&&String(o).startsWith(String(s))}case "endsWith":{let s=ge(t.field,t.value);return s!==void 0&&String(o).endsWith(String(s))}default:return false}}function le(e,t){let o=t?.keywords?.map(rn).filter(n=>n!==void 0),r=t?.excludeKeywords?.map(rn).filter(n=>n!==void 0),s=t?.filters;return !o?.length&&!r?.length&&!s?.length?e:e.filter(n=>{let i=bd(n);return !(o?.length&&!o.some(a=>i.includes(a))||r?.length&&r.some(a=>i.includes(a))||s?.length&&!s.every(a=>yd(n,a)))})}function de({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 cn({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 Cd=80;function xn(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 wd(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:wd(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 {...xn(Wo(e)),...e.token??{},liquidities:Wo(e).liquidities,createdAt:e.token?.createdAt??e.createdAt}}function gn(e){return e.sort((t,o)=>{let r=t.createdAt?.getTime()??0;return (o.createdAt?.getTime()??0)-r}),e.slice(0,Cd)}function kn({chain:e,filters:t,isPaused:o=false,deferUpdates:r=false,updateFlushInterval:s}){let n=useMemo(()=>({chain:e}),[e]),i=useRef(o);i.current=o;let a=useRef(e),[l,d]=useState(true),[m,c]=useState([]);useEffect(()=>{e!==a.current&&(d(true),c([]),a.current=e);},[e]);let{data:p,isPending:u}=useNewPoolsQuery(n);useEffect(()=>{p&&(c(b=>{let T=i.current,N=b.length===0&&p.length>0,y=[...b];for(let P of p){let L=Ld(P),H=y.findIndex(te=>te.address===L.address);H>=0?y[H]=X(y[H],L):(!T||N)&&y.push(L);}return T?y:gn(y)}),d(false));},[p]);let g=useCallback(b=>{c(T=>{let N=i.current,y=[...T],P=false;for(let L of b){let H=y.findIndex(te=>te.address===L.address);H>=0?(P=true,y[H]=X(y[H],L)):N||(P=true,y.push(xn(L)));}return P?N?y:gn(y):T});},[]),{enqueueUpdates:f}=de({applyUpdates:g,paused:r,flushInterval:s}),x=useCallback(b=>{f(b.map(Wo));},[f]);useNewPoolsSubscription({chain:e},x),cn({chain:e,tokens:m,onUpdate:f});let k=useMemo(()=>u||l,[u,l]);return {tokens:useMemo(()=>le(m,t),[m,t]),isLoading:k}}function cb({chain:e,filters:t,title:o,renderHeaderExtra:r,renderItemAction:s,onSelectToken:n,className:i,hideHeader:a}){let[l,d]=useState(false),[m,c]=useState(false),{tokens:p,isLoading:u}=kn({chain:e,filters:t,isPaused:l,deferUpdates:m}),g=useCallback(f=>{d(f);},[]);return jsx(Xe,{title:o,tokens:p,isLoading:u,renderHeaderExtra:r,renderItemAction:s,onSelectToken:n,onPauseChange:g,onScrollingChange:c,className:i,hideHeader:a})}function xe({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 Nn({chain:e,filters:t,isPaused:o=false,refetchInterval:r=3e4,deferUpdates:s=false,updateFlushInterval:n}){let i=useMemo(()=>({chain:e}),[e]),a=useRef(o);a.current=o;let l=useRef(e),[d,m]=useState(true),[c,p]=useState([]);useEffect(()=>{e!==l.current&&(m(true),p([]),l.current=e);},[e]);let{data:u,isPending:g}=useMigratedTokensQuery(i,{refetchInterval:r});useEffect(()=>{u&&(p(b=>{let T=a.current,N=[...b];for(let y of u){let P=N.findIndex(L=>L.address===y.address);P>=0?N[P]=X(N[P],y):T||N.unshift(y);}return N}),m(false));},[u]);let f=useCallback(b=>{p(T=>Re(T,b));},[]),{enqueueUpdates:x}=de({applyUpdates:f,paused:s,flushInterval:n});xe({chain:e,tokens:c,onUpdate:x});let k=useMemo(()=>g||d,[g,d]);return {tokens:useMemo(()=>le(c,t),[c,t]),isLoading:k}}function Lb({chain:e,filters:t,title:o,renderHeaderExtra:r,renderItemAction:s,onSelectToken:n,className:i,hideHeader:a}){let[l,d]=useState(false),[m,c]=useState(false),{tokens:p,isLoading:u}=Nn({chain:e,filters:t,isPaused:l,deferUpdates:m}),g=useCallback(f=>{d(f);},[]);return jsx(Xe,{title:o,tokens:p,isLoading:u,renderHeaderExtra:r,renderItemAction:s,onSelectToken:n,onPauseChange:g,onScrollingChange:c,className:i,hideHeader:a})}function Dd(e){return e.sort((t,o)=>{let r=Number(t.migrateProgress??0);return Number(o.migrateProgress??0)-r})}function Pn({chain:e,filters:t,isPaused:o=false,refetchInterval:r=15e3,deferUpdates:s=false,updateFlushInterval:n}){let i=useMemo(()=>({chain:e}),[e]),a=useRef(o);a.current=o;let l=useRef(e),[d,m]=useState(true),[c,p]=useState([]);useEffect(()=>{e!==l.current&&(m(true),p([]),l.current=e);},[e]);let{data:u,isPending:g}=useFinalStretchTokensQuery(i,{refetchInterval:r});useEffect(()=>{u&&(p(b=>{let T=a.current,N=b.length===0&&u.length>0,y=[...b];for(let P of u){let L=y.findIndex(H=>H.address===P.address);L>=0?y[L]=X(y[L],P):(!T||N)&&y.push(P);}return T?y:Dd(y)}),m(false));},[u]);let f=useCallback(b=>{p(T=>Re(T,b));},[]),{enqueueUpdates:x}=de({applyUpdates:f,paused:s,flushInterval:n});xe({chain:e,tokens:c,onUpdate:x});let k=useMemo(()=>g||d,[g,d]);return {tokens:useMemo(()=>le(c,t),[c,t]),isLoading:k}}function Vb({chain:e,filters:t,title:o,renderHeaderExtra:r,renderItemAction:s,onSelectToken:n,className:i,hideHeader:a}){let[l,d]=useState(false),[m,c]=useState(false),{tokens:p,isLoading:u}=Pn({chain:e,filters:t,isPaused:l,deferUpdates:m}),g=useCallback(f=>{d(f);},[]);return jsx(Xe,{title:o,tokens:p,isLoading:u,renderHeaderExtra:r,renderItemAction:s,onSelectToken:n,onPauseChange:g,onScrollingChange:c,className:i,hideHeader:a})}var _d=10,$d=atomWithStorage("liberfi:search_histories",[],void 0,{getOnInit:true});function Qt(){let[e,t]=useAtom($d),o=useCallback(s=>{let n=s.trim();n&&t(i=>{let a=i.filter(l=>l!==n);return [n,...a].slice(0,_d)});},[t]),r=useCallback(()=>{t([]);},[t]);return {histories:e,addHistory:o,clearHistories:r}}function Fn({histories:e,onSelect:t,onClear:o,className:r}){let{t:s}=useTranslation();return e.length===0?null:jsxs("div",{className:cn$1("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$1("text-neutral","border-border border-1","cursor-pointer","hover:opacity-hover"),onClick:()=>t?.(n),children:n},n))})]})}function Mn({onSelect:e,className:t}){let{histories:o,clearHistories:r}=Qt();return jsx(Fn,{className:cn$1(t),histories:o,onSelect:e,onClear:r})}function Un({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 Gt({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$1("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(fe,{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$1("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 Xt({className:e}){let{t}=useTranslation();return jsxs("div",{className:cn$1("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 pc(){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 Yt({rows:e=6,className:t}){return jsx("div",{className:cn$1("w-full",t),children:Array.from({length:e}).map((o,r)=>jsx(pc,{},r))})}function Vn({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 vc=56;function $n({onSelectToken:e,className:t,...o}){let{tokens:r,isLoading:s,isFetchingNextPage:n,hasNextPage:i,fetchNextPage:a}=Vn(o),l=useRef(null),{height:d}=useResizeObserver({ref:l}),m=useCallback(g=>g<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$1("w-full",t),children:[jsx(Xt,{}),jsx(Yt,{})]}):r.length===0?jsxs("div",{className:cn$1("w-full",t),children:[jsx(Xt,{}),jsx(Sc,{})]}):jsxs("div",{className:cn$1("w-full h-full flex flex-col",t),children:[jsx(Xt,{className:"flex-none"}),jsx("div",{className:"flex-auto min-h-0",ref:l,children:jsx(List,{style:{height:d},onRowsRendered:u,rowComponent:Nc,rowCount:p,rowHeight:vc,rowProps:{tokens:r,onSelectToken:e},overscanCount:5})})]})}function Nc({index:e,style:t,tokens:o,onSelectToken:r}){let s=o[e];return s?jsx("div",{style:t,onClick:()=>r?.(s),children:jsx(Gt,{token:s})}):jsx("div",{style:t,className:"flex items-center justify-center",children:jsx(Spinner,{size:"sm"})})}function Sc(){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 Cc(e,t){return typeof e=="number"&&typeof t=="number"?e-t:String(e).localeCompare(String(t))}function je(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:Kt(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=Cc(n.value,i.value);return d===0?n.index-i.index:r==="asc"?d:-d}).map(({token:n})=>n)}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:g}=useTrendingTokensQuery(a,{refetchInterval:s});useEffect(()=>{u&&(p(T=>$t(T,u)),m(false));},[u]);let f=useCallback(T=>{p(N=>Re(N,T));},[]),{enqueueUpdates:x}=de({applyUpdates:f,paused:n,flushInterval:i});useTrendingTokensSubscription({chain:e},x),xe({chain:e,tokens:c,onUpdate:x});let k=useMemo(()=>!!(g||d),[g,d]),h=useMemo(()=>le(c,o),[c,o]);return {tokens:useMemo(()=>je(h,r),[h,r]),isLoading:k}}var Hc=Chain.ETHEREUM,Fc="24h",Mc=56;function qn({chains:e,onSelectToken:t,className:o}){let r=e?.length===1?e[0]:e?.[0]??Hc,{tokens:s,isLoading:n}=eo({chain:r,resolution:Fc});return jsx("div",{className:cn$1("w-full flex flex-col overflow-hidden",o),children:n?jsx(Yt,{}):jsx("div",{className:"overflow-y-auto",children:s.map(i=>jsx("div",{style:{height:Mc},onClick:()=>t?.(i),children:jsx(Gt,{token:i,className:"h-full"})},i.address))})})}function Xn({onKeywordChange:e}){let[t,o]=useState(""),[r,s]=useState(""),{addHistory:n}=Qt(),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 Yn({chains:e,onKeywordChange:t,onSelectToken:o,onEscape:r}){let{text:s,keyword:n,setText:i,setKeyword:a,clearKeyword:l}=Xn({onKeywordChange:t});return jsxs("div",{className:"w-full h-full flex flex-col gap-3",children:[jsx(Un,{value:s,onValueChange:i,onClear:l,onPaste:a,onEscape:r}),n?jsx($n,{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(Mn,{onSelect:a}),jsx(qn,{className:"flex-auto min-h-0",chains:e,onSelectToken:o})]})]})}var qo="search";function IT({id:e=qo}){return jsx(AsyncModal,{id:e,children:t=>jsx(Qc,{...t})})}function Qc({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(Yn,{chains:e?.chains,onSelectToken:i,onEscape:()=>o(false)})})]})})}function WT({chains:e,onSelectToken:t,className:o}){let{t:r}=useTranslation(),{isDesktop:s}=useScreen(),{onOpen:n,onClose:i}=useAsyncModal(qo),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$1("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$1("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 vt(e){return e==null||e===""?"--":formatPercent(Number(e)/100)}function ke(e,t=4,o=4){return e?e.length<=t+o+1?e:`${e.slice(0,t)}\u2026${e.slice(-o)}`:"--"}function Pe(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 U(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$1("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 rs({token:e,actions:t,dataStrip:o,className:r,onCopyAddress:s}){let n=e?.address;return jsxs("div",{className:cn$1("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(fe,{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:[ke(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 ns(e,t){return U(e,t)}function is({price:e,marketCap:t,volume:o,holdersCount:r,socialMedia:s,className:n}){return jsxs("div",{className:cn$1("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 Ay(e,t){return U(e,t)}function ls({holders:e,top10HoldingsRatio:t,top100HoldingsRatio:o,className:r}){return jsxs("div",{className:cn$1("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:vt(t)}),jsx("span",{className:"px-1",children:"/"}),jsx("span",{children:vt(o)})]}),jsx("div",{className:"text-[10px] text-default-400",children:"Holders / Top10 / Top100"})]})}function ds(e,t){return U(e,t)}function cs({chain:e,address:t,className:o}){let{token:r}=ds(e,t);return jsx(ls,{holders:r?.marketData?.holders,top10HoldingsRatio:r?.marketData?.top10HoldingsRatio,top100HoldingsRatio:r?.marketData?.top100HoldingsRatio,className:o})}function us({marketCapInUsd:e,tvlInUsd:t,createdAt:o,className:r}){return jsxs("div",{className:cn$1("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:Pe(o)})]}),jsx("div",{className:"text-[10px] text-default-400",children:"MC / Liq / Age"})]})}function fs(e,t){return U(e,t)}function gs({chain:e,address:t,className:o}){let{token:r}=fs(e,t);return jsx(us,{marketCapInUsd:r?.marketData?.marketCapInUsd,tvlInUsd:r?.marketData?.tvlInUsd,createdAt:r?.createdAt,className:o})}function bs({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$1("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 hs(e,t){return U(e,t)}function Ts({chain:e,address:t,className:o}){let{token:r}=hs(e,t);return jsx(bs,{priceInUsd:r?.marketData?.priceInUsd,price24hAgoInUsd:r?.stats?.["24h"]?.openPriceInUsd,className:o})}function Cm(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 ys({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$1("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:Cm(n,o)},n))})}function vs(e,t){return U(e,t)}function Ns({chain:e,address:t,className:o,iconSize:r}){let{token:s}=vs(e,t);return jsx(ys,{socials:s?.socialMedias,className:o,iconSize:r})}function ws({volumesInUsd:e,trades:t,traders:o,className:r}){return jsxs("div",{className:cn$1("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 Ls(e,t){return U(e,t)}function Ps({chain:e,address:t,className:o}){let{token:r}=Ls(e,t),s=r?.stats?.["24h"];return jsx(ws,{volumesInUsd:s?.volumesInUsd,trades:s?.trades,traders:s?.traders,className:o})}function Rs({chain:e,address:t,className:o}){return jsx(is,{className:o,price:jsx(Ts,{chain:e,address:t}),marketCap:jsx(gs,{chain:e,address:t}),volume:jsx(Ps,{chain:e,address:t}),holdersCount:jsx(cs,{chain:e,address:t}),socialMedia:jsx(Ns,{chain:e,address:t})})}function m0({chain:e,address:t,actions:o,dataStrip:r,className:s,onCopyAddress:n}){let{token:i}=ns(e,t);return jsx(rs,{token:i,actions:o,dataStrip:r===void 0?jsx(Rs,{chain:e,address:t}):r,className:s,onCopyAddress:n})}var Hm=[{value:"holdingUsd",label:"Value"},{value:"lastActiveAt",label:"Last active"}];function Hs({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$1("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:Hm.map(u=>jsx("button",{type:"button",onClick:()=>r(u.value),className:cn$1("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(Fm,{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 Fm({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:ke(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(Dt,{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:vt(e.ratio)}),jsx("td",{className:"px-3 py-2 text-right align-middle text-default-400",children:e.startHoldingAt?Pe(e.startHoldingAt,t):"--"}),jsx("td",{className:"px-3 py-2 text-right align-middle text-default-400",children:e.lastActiveAt?Pe(e.lastActiveAt,t):"--"})]})}function Us({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:g,isFetching:f}=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]),k=l[l.length-1],h=!!(k?.hasNext&&k.endCursor),b=useCallback(()=>{!k?.endCursor||!k.hasNext||a(k.endCursor);},[k]);return {holders:x,isLoading:g||f,sortBy:s,setSortBy:c,hasMore:h,loadMore:b}}function H0({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:g,loadMore:f}=Us({chain:e,address:t,limit:o,initialSortBy:r});return jsx(Hs,{holders:m,isLoading:c,sortBy:p,onSortByChange:u,onlyTracked:l,onOnlyTrackedChange:d,wellKnownAddresses:n,hasMore:g,onLoadMore:f,className:i,renderAddress:a})}var Wm=[{value:"timestamp",label:"Latest"},{value:"totalUsd",label:"Top USD"}],Vm=[{value:"all",label:"All"},{value:"buy",label:"Buys"},{value:"sell",label:"Sells"}],_m=[{value:"all",label:"All"},{value:"dev",label:"DEV"},{value:"tracked",label:"TRACKED"},{value:"you",label:"YOU"}];function Os({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:g=9,nativeSymbol:f="SOL",className:x,onRowClick:k}){let h=Km(e,i,l);return jsxs("div",{className:cn$1("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:[Vm.map(b=>jsx("button",{type:"button",onClick:()=>n?.(b.value),className:cn$1("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}),_m.map(b=>{let T=i===b.value,N=b.value==="you"&&!l;return jsx("button",{type:"button",disabled:N,onClick:()=>a?.(b.value),className:cn$1("rounded px-2 py-1 text-[11px] transition-colors",T?"bg-default-100 text-foreground":"text-default-400 hover:text-foreground",N&&"cursor-not-allowed opacity-50"),children:b.label},b.value)})]}),jsxs("div",{className:"flex items-center gap-2",children:[jsx(zm,{value:d,nativeSymbol:f,onChange:m}),jsx("div",{className:"flex items-center gap-1",children:Wm.map(b=>jsx("button",{type:"button",onClick:()=>r(b.value),className:cn$1("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(Qm,{activity:b,now:u,nativeDecimals:g,nativeSymbol:f,currency:d,onRowClick:k},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 $m(e){return e.type==="buy"?e.to:e.type==="sell"?e.from:e.to}function Km(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 zm({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$1("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 qm(e,t,o){if(!e)return "--";let r=Number(e)/Math.pow(10,t);return Number.isFinite(r)?`${formatAmount(r)} ${o}`:"--"}function Qm({activity:e,now:t,nativeDecimals:o,nativeSymbol:r,currency:s,onRowClick:n}){let i=$m(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$1("border-b border-default-50 hover:bg-default-50/60",n&&"cursor-pointer"),onClick:n?()=>n(e):void 0,children:[jsx("td",{className:cn$1("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:ke(e.walletAddress,6,6)}),jsx(Wr,{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:qm(e.gasFee,o,r)}),jsx("td",{className:"px-3 py-2 text-right align-middle text-default-400",children:Pe(e.time,t)})]})}function Es({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,g]=useState([]),f=useCallback(()=>{m(void 0),p([]),g([]);},[]),x=useCallback(D=>{D!==n&&(i(D),f());},[n,f]),k=useCallback(D=>{D!==a&&(l(D),f());},[a,f]);useEffect(()=>{f();},[e,t,f]);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:N,isFetching:y}=useTokenActivitiesQuery(b);useEffect(()=>{T&&p(D=>d==null?[T]:D[D.length-1]?.endCursor===T.endCursor?D:[...D,T]);},[T,d]);let P=n==="timestamp"&&a==="all"&&d==null;useTokenActivitiesSubscription({chain:e,address:t},D=>{!P||!D?.length||g(ie=>{let B=new Set(ie.map(_=>_.txHash)),F=D.filter(_=>!B.has(_.txHash));return F.length===0?ie:[...F,...ie].slice(0,100)});});let L=useMemo(()=>{let D=c.flatMap(F=>F.data);if(!P||u.length===0)return D;let ie=new Set(D.map(F=>F.txHash));return [...u.filter(F=>!ie.has(F.txHash)),...D]},[c,u,P]),H=c[c.length-1],te=!!(H?.hasNext&&H.endCursor),Se=useCallback(()=>{!H?.endCursor||!H.hasNext||m(H.endCursor);},[H]);return {activities:L,isLoading:N||y,sortBy:n,setSortBy:x,typeFilter:a,setTypeFilter:k,hasMore:te,loadMore:Se}}function Y0({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),[g,f]=useState(i),{activities:x,isLoading:k,sortBy:h,setSortBy:b,typeFilter:T,setTypeFilter:N,hasMore:y,loadMore:P}=Es({chain:e,address:t,limit:o,initialSortBy:r,initialTypeFilter:s});return jsx(Os,{activities:x,isLoading:k,sortBy:h,onSortByChange:b,typeFilter:T,onTypeFilterChange:N,traderFilter:p,onTraderFilterChange:u,youWalletAddress:a,currency:g,onCurrencyChange:f,hasMore:y,onLoadMore:P,className:m,nativeDecimals:l,nativeSymbol:d,onRowClick:c})}function Vs({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 _s(e,t){return U(e,t)}function pN({chain:e,address:t,resolution:o="24h",className:r}){let{token:s}=_s(e,t);return jsx(Vs,{stats:s?.stats,resolution:o,className:r})}function $s({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 Ks(e,t){return U(e,t)}function LN({chain:e,address:t,resolution:o="24h",className:r}){let{token:s}=Ks(e,t);return jsx($s,{stats:s?.stats,resolution:o,className:r})}function zs({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 qs(e,t){return U(e,t)}function _N({chain:e,address:t,resolution:o="24h",className:r}){let{token:s}=qs(e,t);return jsx(zs,{stats:s?.stats,resolution:o,className:r})}function Qs({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$1("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$1("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(rp,{...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 rp({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$1("text-xs",t===void 0?"text-default-400":s?"text-success-500":"text-danger-500"),children:n})]})}function Gs(e,t){let{data:o,isLoading:r}=useTokenSecurityQuery({chain:e,address:t});return {security:o,isLoading:r}}function oS({chain:e,address:t,externalUrl:o,externalLabel:r,className:s}){let{security:n}=Gs(e,t);return jsx(Qs,{security:n,externalUrl:o,externalLabel:r,className:s})}function Ys({token:e,className:t}){return e?jsxs("section",{className:cn$1("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 U(e,t)}function xS({chain:e,address:t,className:o}){let{token:r}=Zs(e,t);return jsx(Ys,{token:r,className:o})}function ti({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$1("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$1("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: ",ke(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 oi(e,t){return U(e,t)}function FS({chain:e,address:t,collapseAt:o,className:r,onPoolClick:s}){let{token:n}=oi(e,t);return jsx(ti,{liquidities:n?.liquidities,totalTvlInUsd:n?.marketData?.tvlInUsd,collapseAt:o,className:r,onPoolClick:s})}function ri({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$1("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$1("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$1(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 ni(e){return {cexes:e}}function QS({cexes:e,collapseAt:t,className:o}){let{cexes:r}=ni(e);return jsx(ri,{cexes:r,collapseAt:t,className:o})}function ii({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$1("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$1("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 ai(e,t){return U(e,t)}function lC({chain:e,address:t,collapseAt:o,className:r,onCategoryClick:s}){let{token:n}=ai(e,t);return jsx(ii,{categories:n?.tags,collapseAt:o,className:r,onCategoryClick:s})}var li=["5m","1h","4h","24h"];function di({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$1("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$1("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 ci({stats:e,resolutions:t,className:o}){return jsx("div",{className:cn$1("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$1("text-[13px] font-medium leading-none tabular-nums",a===void 0?"text-foreground":a?"text-bullish":"text-bearish"),children:d})]},r)})})}function mi({chain:e,address:t}){let{data:o,isLoading:r}=useTokenStatsQuery({chain:e,address:t});return {stats:o,isLoading:r}}function SC({chain:e,address:t,baseResolution:o="5m",hoverResolutions:r=li,height:s=64,className:n}){let{stats:i}=mi({chain:e,address:t});return jsx(StatsFlipPanel,{className:n,height:s,base:jsx(di,{stats:i,resolution:o}),hover:jsx(ci,{stats:i,resolutions:r})})}function pi({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$1("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(Rp,{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(Ap,{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 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(s=>jsx("button",{type:"button",onClick:()=>o?.(s.k),className:cn$1("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 Ap({position:e,currency:t,renderActions:o}){let{bought:r,sold:s,remaining:n,pnl:i}=useMemo(()=>Ip(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$1("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 Ip(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 gi({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 g=useMemo(()=>i.flatMap(h=>h.portfolios),[i]),f=i[i.length-1],x=!!(f?.hasNext&&f.endCursor),k=useCallback(()=>{!f?.endCursor||!f.hasNext||n(f.endCursor);},[f]);return {positions:g,isLoading:!!t&&(p||u),hasMore:x,loadMore:k,showHidden:l,setShowHidden:d}}function _C({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:g}=gi({chain:e,wallet:t,limit:o});return jsx(pi,{className:i,positions:d,isLoading:m,hasMore:c,onLoadMore:p,currency:a,onCurrencyChange:l,showHidden:u,onShowHiddenChange:g,nativeSymbol:s,renderActions:n})}function xi({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:g,className:f}){return jsxs("div",{className:cn$1("flex flex-col",f),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$1("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(Ep,{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(Wp,{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: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 Ep({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$1("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 Wp({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$1("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 _p(e){return e instanceof Error&&e.code==="NotImplemented"}function $p(e){return e==="active"?"active":"filled"}function Ti({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 g=useCallback(H=>{H!==i&&a(H);},[i]),f=useMemo(()=>({chain:e,address:t??"",cursor:m,limit:r,state:$p(i),tokenAddress:l?o:void 0}),[e,t,m,r,i,l,o]),{data:x,isPending:k,isFetching:h,error:b}=useWalletLimitOrdersQuery(f,{enabled:!!t});useEffect(()=>{x&&u(H=>m==null?[x]:H[H.length-1]?.endCursor===x.endCursor?H:[...H,x]);},[x,m]);let T=!!b&&_p(b),N=useMemo(()=>p.flatMap(H=>H.data),[p]),y=p[p.length-1],P=!!(y?.hasNext&&y.endCursor),L=useCallback(()=>{!y?.endCursor||!y.hasNext||c(y.endCursor);},[y]);return {orders:N,isLoading:!!t&&!T&&(k||h),unavailable:T,hasMore:P,loadMore:L,stateFilter:i,setStateFilter:g,onlyThisToken:l,setOnlyThisToken:d}}function iw({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:g,unavailable:f,hasMore:x,loadMore:k,stateFilter:h,setStateFilter:b,onlyThisToken:T,setOnlyThisToken:N}=Ti({chain:e,wallet:t,tokenAddress:o,limit:s,initialStateFilter:n});return jsx(xi,{className:m,orders:u,isLoading:g,unavailable:f,hasMore:x,onLoadMore:k,stateFilter:h,onStateFilterChange:b,onlyThisToken:T,onOnlyThisTokenChange:N,tokenSymbol:r,currency:c,onCurrencyChange:p,nativeSymbol:a,onCancelAll:f?void 0:l,renderActions:d})}function vi({traders:e,isLoading:t,hasMore:o,onLoadMore:r,onlyTracked:s=false,onOnlyTrackedChange:n,now:i=Date.now(),renderAddress:a,className:l}){let{t:d}=useTranslation();return jsxs("div",{className:cn$1("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:d("tokens.tokenDetail.topTraders")}),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:m=>n?.(m.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(m=>jsx(Xp,{trader:m,now:i,renderAddress:a},m.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 Xp({trader:e,now:t,renderAddress:o}){let r=useMemo(()=>o?o(e.address):jsx("span",{className:"font-mono text-[11px] text-default-500",children:ke(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(Dt,{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:"--"}),jsx("td",{className:"px-3 py-2 text-right align-middle text-default-400",children:formatAmountUSDCompact(e.totalRealizedPnlInUsd)}),jsx("td",{className:"px-3 py-2 text-right align-middle text-default-400",children:e.lastActiveAt?Pe(e.lastActiveAt,t):"--"})]})}function Si({chain:e,address:t,limit:o=50,initialSortBy:r,initialOnlyTracked:s=false}){let[n,i]=useState(r),[a,l]=useState(void 0),[d,m]=useState([]),[c,p]=useState(s),u=useCallback(()=>{l(void 0),m([]);},[]),g=useCallback(L=>{L!==n&&(i(L),u());},[u,n]);useEffect(()=>{u();},[e,t,u]);let f=useMemo(()=>({chain:e,address:t,cursor:a,limit:o,sortBy:n}),[e,t,a,o,n]),{data:x,isPending:k,isFetching:h}=useTokenTopTradersQuery(f);useEffect(()=>{x&&m(L=>a==null?[x]:L[L.length-1]?.endCursor===x.endCursor?L:[...L,x]);},[x,a]);let b=useMemo(()=>d.flatMap(L=>L.data),[d]),T=useMemo(()=>c?b.filter(L=>L.tags&&L.tags.length>0):b,[b,c]),N=d[d.length-1],y=!!(N?.hasNext&&N.endCursor),P=useCallback(()=>{!N?.endCursor||!N.hasNext||l(N.endCursor);},[N]);return {traders:T,isLoading:k||h,sortBy:n,setSortBy:g,hasMore:y,loadMore:P,onlyTracked:c,setOnlyTracked:p}}function ww({chain:e,address:t,limit:o,className:r,renderAddress:s}){let{traders:n,isLoading:i,hasMore:a,loadMore:l,onlyTracked:d,setOnlyTracked:m}=Si({chain:e,address:t,limit:o});return jsx(vi,{className:r,traders:n,isLoading:i,hasMore:a,onLoadMore:l,onlyTracked:d,onOnlyTrackedChange:m,renderAddress:s})}function wi({tokens:e,isLoading:t,unavailable:o,hasMore:r,onLoadMore:s,renderTokenLink:n,className:i}){return jsxs("div",{className:cn$1("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(jp,{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 jp({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 Li({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$1("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(po,{label:"Total",value:String(o)}),jsx(po,{label:"Migrated",value:`${r} (${s}%)`}),jsx(po,{label:"Total Market Cap",value:formatAmountUSDCompact(i.toString())}),jsx(po,{label:"Total 1h Volume",value:formatAmountUSDCompact(n.toString())})]})]})}function po({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 ou(e){return e instanceof Error&&e.code==="NotImplemented"}function Ii({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(k=>r==null?[l]:k[k.length-1]?.endCursor===l.endCursor?k:[...k,l]);},[l,r]);let p=!!c&&ou(c),u=useMemo(()=>n.flatMap(k=>k.data),[n]),g=n[n.length-1],f=!!(g?.hasNext&&g.endCursor),x=useCallback(()=>{!g?.endCursor||!g.hasNext||s(g.endCursor);},[g]);return {tokens:u,isLoading:!!t&&!p&&(d||m),unavailable:p,hasMore:f,loadMore:x}}function _w({chain:e,creator:t,limit:o,showSummary:r=false,renderTokenLink:s,className:n}){let{tokens:i,isLoading:a,unavailable:l,hasMore:d,loadMore:m}=Ii({chain:e,creator:t,limit:o});return jsxs("div",{className:n,children:[jsx(wi,{tokens:i,isLoading:a,unavailable:l,hasMore:d,onLoadMore:m,renderTokenLink:s}),r&&!l?jsx(Li,{tokens:i}):null]})}function Mi({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$1("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$1("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 Oi({chain:e,address:t}){return U(e,t)}function rL({chain:e,address:t,athInUsd:o,athAt:r,globalFeesPaidInUsd:s,rank:n,pinned:i,onTogglePin:a,className:l}){let{token:d}=Oi({chain:e,address:t});return jsx(Mi,{className:l,token:d,athInUsd:o,athAt:r,globalFeesPaidInUsd:s,rank:n,pinned:i,onTogglePin:a})}function Di({tokens:e,isLoading:t,unavailable:o,onTokenClick:r,className:s}){return o?jsx("div",{className:cn$1("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$1("flex items-center justify-center p-4 text-center text-[11px] text-default-400",s),children:"No similar tokens found."}):jsxs("ul",{className:cn$1("flex flex-col",s),children:[e.map(n=>jsxs("li",{className:cn$1("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 Bi({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 hL({chain:e,address:t,keyword:o,limit:r,onTokenClick:s,className:n}){let{tokens:i,isLoading:a,unavailable:l}=Bi({chain:e,address:t,keyword:o,limit:r});return jsx(Di,{className:n,tokens:i,isLoading:a,unavailable:l,onTokenClick:s})}function Ei({tokens:e=[],unavailable:t=true,onTokenClick:o,className:r}){return t?jsx("div",{className:cn$1("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$1("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$1("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 Wi(e){return {tokens:[],isLoading:false,unavailable:true}}function HL({chain:e,address:t,onTokenClick:o,className:r}){let{tokens:s,unavailable:n}=Wi();return jsx(Ei,{className:r,tokens:s,unavailable:n,onTokenClick:o})}function zi({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=fo(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=fo(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?.(fo(p));},[o]),c=useCallback(p=>{d(p),r?.(fo(p));},[r]);return jsxs("div",{className:cn$1("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 fo(e){let t=e.split(",").map(o=>o.trim()).filter(Boolean);return t.length>0?t:void 0}function Yi({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$1("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=Oe(m);return jsx(Button,{variant:"bordered",size:"sm",radius:"full",className:cn$1("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 ye({title:e,field:t,value:o,onChange:r}){let{t:s}=useTranslation(),[n,i]=useState(o?kr(o).min:NaN),[a,l]=useState(o?kr(o).max:NaN);useEffect(()=>{if(o===void 0)i(NaN),l(NaN);else {let{min:c,max:p}=kr(o);i(c),l(p);}},[o]);let d=useCallback(c=>{i(c),r?.(ta(t,c,a));},[t,r,a]),m=useCallback(c=>{l(c),r?.(ta(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 kr(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 ta(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 ra({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$1("flex flex-col gap-4",o),children:[jsx(ye,{field:"holders",title:r("tokens.filters.stats.audits.holders"),value:s?.find(a=>a.field==="holders"),onChange:i("holders")}),jsx(ye,{field:"top10Ratio",title:r("tokens.filters.stats.audits.top10HoldingsRatio"),value:s?.find(a=>a.field==="top10Ratio"),onChange:i("top10Ratio")}),jsx(ye,{field:"top100Ratio",title:r("tokens.filters.stats.audits.top100HoldingsRatio"),value:s?.find(a=>a.field==="top100Ratio"),onChange:i("top100Ratio")}),jsx(ye,{field:"creatorsRatio",title:r("tokens.filters.stats.audits.devHoldingsRatio"),value:s?.find(a=>a.field==="creatorsRatio"),onChange:i("creatorsRatio")})]})}function na({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$1("flex flex-col gap-4",r),children:[jsx(ye,{field:"marketCap",title:s("tokens.filters.stats.metrics.marketCap"),value:n?.find(l=>l.field==="marketCap"),onChange:a("marketCap")}),jsx(ye,{field:"tvl",title:s("tokens.filters.stats.metrics.liquidity"),value:n?.find(l=>l.field==="tvl"),onChange:a("tvl")}),jsx(ye,{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(ye,{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 ca({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$1("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(ra,{values:a,onValuesChange:d,className:cn$1({hidden:n!=="audits"})}),jsx(na,{values:a,onValuesChange:d,resolution:e,className:cn$1({hidden:n!=="metrics"})})]})}function vo({protocols:e,resolution:t,filters:o,onFiltersChange:r,className:s}){let[n,i]=useState(ma(o?.filters,e));useEffect(()=>{i(ma(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(k=>{i(k),r?.(yo(e,k,a,d,c));},[e,a,d,c,r]),g=useCallback(k=>{l(k),r?.(yo(e,n,k,d,c));},[e,n,d,c,r]),f=useCallback(k=>{m(k),r?.(yo(e,n,a,k,c));},[e,n,a,c,r]),x=useCallback(k=>{p(k),r?.(yo(e,n,a,d,k));},[e,n,a,d,r]);return jsxs("div",{className:cn$1("flex flex-col gap-4",s),children:[e&&e.length>0&&jsxs(Fragment,{children:[jsx(Yi,{protocols:e,selectedProtocols:n,onSelectedProtocolsChange:u}),jsx("div",{style:{height:1,background:"rgba(39,39,42,1)"}})]}),jsx(zi,{keywords:a,excludeKeywords:d,onKeywordsChange:g,onExcludeKeywordsChange:f}),jsx("div",{style:{height:1,background:"rgba(39,39,42,1)"}}),jsx(ca,{resolution:t,values:c,onValuesChange:x})]})}function ma(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 yo(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 ga({protocols:e,resolution:t,filters:o,onFiltersChange:r,triggerVariant:s="default",badgePlacement:n="outer",className:i}){let{t:a}=useTranslation(),{isOpen:l,onOpen:d,onClose:m,onOpenChange:c}=useDisclosure(),[p,u]=useState(o),g=useCallback(()=>{u(void 0);},[]),f=useCallback(()=>{r?.(p),m();},[p,r,m]);useEffect(()=>{u(o);},[l,o]);let x=useMemo(()=>Object.values(o||{}).every(k=>k===void 0),[o]);return jsxs(Fragment,{children:[jsxs("button",{type:"button",className:i,onClick:d,style:{display:"inline-flex",alignItems:"center",justifyContent:"center",borderRadius:9999,border:s==="plain"?"none":"1px solid rgba(63,63,70,0.5)",background:s==="plain"?"transparent":"rgba(39,39,42,0.6)",width:32,height:32,minHeight:32,padding:0,cursor:"pointer",position:"relative"},children:[jsx(FilterIcon,{width:16,height:16,className:"text-zinc-400"}),!x&&jsx("span",{style:{position:"absolute",top:n==="icon"?6:-2,right:n==="icon"?6:-2,width:8,height:8,borderRadius:4,background:"#c7ff2e"}})]}),jsx(StyledModal,{isOpen:l,onOpenChange:c,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:a("tokens.filters.modal.title")})}),jsx(ModalBody,{className:"px-0 pt-0 pb-4",children:jsx(ScrollShadow,{children:jsx(vo,{protocols:e,resolution:t,filters:p,onFiltersChange:u,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:g,children:a("common.reset")}),jsx(Button,{color:"primary",size:"sm",radius:"full",onPress:f,children:a("common.apply")})]})})]})})]})}var ha={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},lf={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"},df={height:1,background:"rgba(39,39,42,1)",margin:0};function Ta({protocols:e,resolution:t,filters:o,onFiltersChange:r,iconOnly:s=false,className:n}){let{t:i}=useTranslation(),[a,l]=useState(false),d=useRef(null),[m,c]=useState(o),p=useCallback(()=>{c(void 0);},[]),u=useCallback(()=>{r?.(m),l(false);},[m,r]);useEffect(()=>{c(o);},[a,o]),useEffect(()=>{let f=x=>{d.current&&!d.current.contains(x.target)&&l(false);};return document.addEventListener("mousedown",f),()=>document.removeEventListener("mousedown",f)},[]),useEffect(()=>{if(!a)return;let f=x=>{x.key==="Escape"&&l(false);};return document.addEventListener("keydown",f),()=>document.removeEventListener("keydown",f)},[a]);let g=useMemo(()=>Object.values(o||{}).every(f=>f===void 0),[o]);return jsxs("div",{ref:d,style:{position:"relative"},children:[jsxs("div",{style:{position:"relative",display:"inline-flex"},children:[jsxs("button",{type:"button",className:n,style:s?{...ha,justifyContent:"center",gap:0,width:32,minWidth:32,padding:0}:ha,onMouseEnter:f=>{f.currentTarget.style.background="rgba(39,39,42,1)";},onMouseLeave:f=>{f.currentTarget.style.background="rgba(39,39,42,0.6)";},onClick:()=>l(f=>!f),children:[jsx(FilterIcon,{width:16,height:16,className:"flex-none"}),!s&&jsxs(Fragment,{children:[jsx("span",{className:"hidden sm:block",children:i("tokens.listHeader.filter")}),jsx(cf,{open:a})]})]}),!g&&jsx("span",{style:{position:"absolute",top:-4,right:-4,minWidth:8,height:8,borderRadius:4,background:"#c7ff2e"}})]}),a&&jsxs("div",{style:{...lf,width:420},children:[jsx("div",{style:{padding:"16px 0"},children:jsx(ScrollShadow,{className:"w-full max-h-120 px-4",children:jsx(vo,{protocols:e,resolution:t,filters:m,onFiltersChange:c})})}),jsx("div",{style:df}),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:p,children:i("common.reset")}),jsx(Button,{variant:"solid",size:"sm",color:"primary",radius:"full",onPress:u,children:i("common.apply")})]})]})]})}function cf({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 S1({popoverPlacement:e="bottom-end",iconOnly:t,className:o,desktopOverlay:r="popover",...s}){let{isMobile:n}=useScreen();return n||r==="modal"?jsx(ga,{className:o,...s}):jsx(Ta,{placement:e,iconOnly:t,className:o,...s})}function Na({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 Sf={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},Cf={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 Ca({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:Sf,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:Cf,children:o.map(l=>jsx("button",{type:"button",onClick:()=>a(l),className:cn$1("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 V1(e){let{isMobile:t}=useScreen();return t?jsx(Ca,{...e}):jsx(Na,{...e})}var Pa=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$1(s&&"text-bullish",!s&&!n&&"text-bearish",r===void 0&&"text-neutral"),children:formatPercent(r)})]})})});function Xf(e){return e.length<=10?e:`${e.slice(0,4)}...${e.slice(-4)}`}var Ua=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(fe,{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:Xf(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 Oa=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(z,{icon:jsx(PeopleIcon,{width:12,height:12}),value:formatAmount(r?.holders),tooltip:o("tokens.tokenInfo.holders"),warning:false,disable:!r?.holders}),jsx(z,{icon:jsx(KlineCandlesIcon,{width:12,height:12}),value:formatAmount(r?.proHolders),tooltip:o("tokens.tokenInfo.proHolders"),warning:false,disable:!r?.proHolders}),jsx(z,{icon:jsx(StarIcon,{width:12,height:12}),value:formatAmount(r?.kolHolders),tooltip:o("tokens.tokenInfo.kolHolders"),warning:false,disable:!r?.kolHolders}),jsx(z,{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(z,{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(z,{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(z,{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(z,{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 Da=memo(function({token:t}){let o=useMemo(()=>t.marketData?.tvlInUsd,[t.marketData?.tvlInUsd]);return jsx(Fragment,{children:formatAmountUSD(o)})});var Ba=memo(function({token:t}){let o=useMemo(()=>t.marketData?.marketCapInUsd,[t.marketData?.marketCapInUsd]);return jsx(Fragment,{children:formatAmountUSD(o)})});var Va=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$1("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 $a=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 za=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 Qa=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 Cg=`
22
22
  @keyframes tklShimmer{0%{background-position:200% 0}100%{background-position:-200% 0}}
23
- `,Cg={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 V(e,t,o,r){return {...Cg,animationDelay:`${e}ms`,width:t,height:o,...r}}var qa=10;function Qa({rowHeight:e,hasActions:t,isMobile:o}){return jsxs(Fragment,{children:[jsx("style",{children:Sg}),Array.from({length:qa}).map((r,s)=>jsx(wg,{index:s,rowHeight:e,hasActions:t,isMobile:o,isLast:s===qa-1},s))]})}function wg({index:e,rowHeight:t,hasActions:o,isMobile:r,isLast:s}){let n=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: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:V(n,l,l,{borderRadius:8,flexShrink:0})}),jsxs("div",{style:{display:"flex",flexDirection:"column",gap:8,flex:1},children:[jsx("div",{style:V(n+30,"60%",20)}),jsx("div",{style:V(n+60,"80%",16)})]})]}),jsxs("div",{style:{width:128,padding:"0 12px",display:"flex",flexDirection:"column",justifyContent:"center",gap:4},children:[jsx("div",{style:V(n+20,72,20)}),jsx("div",{style:V(n+40,52,16)})]}),jsx("div",{style:{width:106,padding:"0 12px",display:"flex",alignItems:"center"},children:jsx("div",{style:V(n+30,64,20)})}),jsx("div",{style:{width:106,padding:"0 12px",display:"flex",alignItems:"center"},children:jsx("div",{style:V(n+40,60,20)})}),jsxs("div",{style:{width:138,padding:"0 12px",display:"flex",flexDirection:"column",justifyContent:"center",gap:4},children:[jsx("div",{style:V(n+50,72,20)}),jsx("div",{style:V(n+70,100,16)})]}),jsxs("div",{style:{width:126,padding:"0 12px",display:"flex",flexDirection:"column",justifyContent:"center",gap:4},children:[jsx("div",{style:V(n+60,48,20)}),jsx("div",{style:V(n+80,80,16)})]}),jsxs("div",{style:{width:126,padding:"0 12px",display:"flex",flexDirection:"column",justifyContent:"center",gap:4},children:[jsx("div",{style:V(n+70,40,20)}),jsx("div",{style:V(n+90,72,16)})]}),jsxs("div",{style:{width:128,padding:"0 12px",display:"flex",alignItems:"center",gap:10},children:[jsx("div",{style:V(n+80,20,20,{borderRadius:4})}),jsx("div",{style:V(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:V(n+80,52,16)}),jsx("div",{style:V(n+100,40,16)}),jsx("div",{style:V(n+120,36,16)})]}),jsxs("div",{style:{display:"flex",flexDirection:"column",gap:8},children:[jsx("div",{style:V(n+90,48,16)}),jsx("div",{style:V(n+110,40,16)}),jsx("div",{style:V(n+130,40,16)})]}),jsxs("div",{style:{display:"flex",flexDirection:"column",gap:8},children:[jsx("div",{style:V(n+100,40,16)}),jsx("div",{style:V(n+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:V(n+100,d,32,{borderRadius:8})})})]})}var Mg=100,Ug=200,Og=72;function ut({tokens:e,resolution:t="24h",isLoading:o,ActionsComponent:r,onSelectToken:s,sortDirections:n,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,Mg),[e]),f=o&&e.length===0,x=useRef(void 0),b=useRef(false),{t:h}=useTranslation(),k=useCallback(H=>_=>{_.preventDefault(),_.stopPropagation(),s?.(H);},[s]),[T,C]=useState(n??{});useEffect(()=>{C(n??{});},[n]);let y=useCallback(H=>_=>{let xt={[H]:_};C(xt),i?.(xt);},[i]),L=useCallback(()=>{b.current||(b.current=true,l?.(true)),x.current&&clearTimeout(x.current),x.current=setTimeout(()=>{b.current=false,l?.(false);},180);},[l]);useEffect(()=>()=>{x.current&&clearTimeout(x.current),b.current&&l?.(false);},[l]);let W=cn("h-full mx-auto",c??(r?"max-w-362 sm:max-w-403":"max-w-331 sm:max-w-372")),I=r?"!w-[1438px] min-w-[1438px] max-w-[1438px]":"!w-[1366px] min-w-[1366px] max-w-[1366px]",te=[jsx(TableColumn,{textValue:h("tokens.listHeader.token"),width:p?Ug: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:y("price"),children:h("tokens.listHeader.price")}),jsx("span",{children:"/"}),jsx(Sortable,{sort:T[`priceChange${t}`],onSortChange:y(`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:y("marketCap"),children:h("tokens.listHeader.marketCap")})},"marketCap"),jsx(TableColumn,{textValue:h("tokens.listHeader.liquidity"),width:106,children:jsx(Sortable,{sort:T.tvl,onSortChange:y("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:y(`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:y(`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:y(`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?Og: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),Se=jsx(Qa,{rowHeight:u,hasActions:!!r,isMobile:p}),O=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")})]}),ie=H=>[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(Fa,{token:H,resolution:t})},"token"),jsx(TableCell,{children:jsx(Ba,{token:H,resolution:t})},"price"),jsx(TableCell,{children:jsx(Oa,{token:H,resolution:t})},"marketCap"),jsx(TableCell,{children:jsx(Ua,{token:H,resolution:t})},"liquidity"),jsx(TableCell,{children:jsx(za,{token:H,resolution:t})},"volumes"),jsx(TableCell,{children:jsx($a,{token:H,resolution:t})},"trades"),jsx(TableCell,{children:jsx(Va,{token:H,resolution:t})},"traders"),jsx(TableCell,{children:jsx(wa,{token:H,resolution:t})},"bluechip"),jsx(TableCell,{children:jsx(Ma,{token:H,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:H,resolution:t})})},"actions"):void 0].filter(Boolean),D=H=>jsx(TableRow,{onClick:s?k(H):void 0,children:ie(H)},H.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:L,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",I),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:te}),jsx(TableBody,{items:g,isLoading:f,loadingContent:Se,emptyContent:O,children:D})]})})}):jsxs(StyledTable,{isHeaderSticky:true,isVirtualized:true,radius:"lg",className:W,classNames:{loadingWrapper:"flex-col justify-start items-start",emptyWrapper:"pt-30"},onScrollCapture:L,maxTableHeight:a,rowHeight:u,"aria-label":"Tokens",children:[jsx(TableHeader,{children:te}),jsx(TableBody,{items:e,isLoading:f,loadingContent:Se,emptyContent:O,children:D})]})}function tl({token:e,resolution:t,renderAction:o,isLast:r=false,onSelectToken:s,className:n}){let{t:i}=useTranslation(),l=useCopyToClipboard(),a=useTickAge(e.createdAt),d=useCallback(()=>{s?.(e);},[s,e]),m=useCallback(_=>{_.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]),f=useMemo(()=>g&&new SafeBigNumber(g).gte(0),[g]),x=useMemo(()=>g?new SafeBigNumber(g).abs().toString():void 0,[g]),b=useMemo(()=>p?.volumesInUsd,[p?.volumesInUsd]),h=useMemo(()=>p?.buyVolumesInUsd,[p?.buyVolumesInUsd]),k=useMemo(()=>p?.sellVolumesInUsd,[p?.sellVolumesInUsd]),T=useMemo(()=>p?.trades,[p?.trades]),C=useMemo(()=>c?.marketCapInUsd,[c?.marketCapInUsd]),y=useMemo(()=>c?.tvlInUsd,[c?.tvlInUsd]),L=useMemo(()=>new SafeBigNumber(c?.top10HoldingsRatio).gte(.1),[c?.top10HoldingsRatio]),W=useMemo(()=>new SafeBigNumber(c?.devHoldingsRatio).gte(.1),[c?.devHoldingsRatio]),I=useMemo(()=>new SafeBigNumber(c?.sniperHoldingsRatio).gte(.1),[c?.sniperHoldingsRatio]),te=useMemo(()=>new SafeBigNumber(c?.insiderHoldingsRatio).gte(.1),[c?.insiderHoldingsRatio]),Se=useMemo(()=>new SafeBigNumber(c?.bundleHoldingsRatio).gte(.1),[c?.bundleHoldingsRatio]),O=c?.holders!==void 0&&c.holders>0,ie=c?.kolHolders!==void 0&&c.kolHolders>0,D=c?.bluechipHolders!==void 0&&c.bluechipHolders>0,H=O||ie||D;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(fe,{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:_=>_.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:_=>_.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:_=>_.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:_=>_.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(C)})]}),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(y)})]})]}),H&&jsxs("div",{className:"flex items-center gap-2 text-xs font-mono text-neutral leading-none",children:[O&&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)]})}),ie&&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)]})}),D&&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",f?"text-bullish":"text-bearish"),children:[f?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(b)})]}),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(k)})]})]}),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(z,{icon:jsx(UserWithStarBadgeIcon,{width:12,height:12}),value:formatPercent(c?.top10HoldingsRatio),tooltip:i("tokens.tokenInfo.top10HoldingsRatio"),warning:L,disable:!c?.top10HoldingsRatio||c?.top10HoldingsRatio==="0"}),jsx(z,{icon:jsx(CookIcon,{width:12,height:12}),value:formatPercent(c?.devHoldingsRatio),tooltip:i("tokens.tokenInfo.devHoldingsRatio"),warning:W,disable:!c?.devHoldingsRatio||c?.devHoldingsRatio==="0"}),jsx(z,{icon:jsx(SniperIcon,{width:12,height:12}),value:formatPercent(c?.sniperHoldingsRatio),tooltip:i("tokens.tokenInfo.sniperHoldingsRatio"),warning:I,disable:!c?.sniperHoldingsRatio||c?.sniperHoldingsRatio==="0"}),jsx(z,{icon:jsx(RatIcon,{width:12,height:12}),value:formatPercent(c?.insiderHoldingsRatio),tooltip:i("tokens.tokenInfo.insiderHoldingsRatio"),warning:te,disable:!c?.insiderHoldingsRatio||c?.insiderHoldingsRatio==="0"}),jsx(z,{icon:jsx(BundlesIcon,{width:12,height:12}),value:formatPercent(c?.bundleHoldingsRatio),tooltip:i("tokens.tokenInfo.bundleHoldingsRatio"),warning:Se,disable:!c?.bundleHoldingsRatio||c?.bundleHoldingsRatio==="0"})]})}),o&&jsx("div",{className:"flex-none relative",onClick:_=>_.stopPropagation(),children:o(e)})]})]})}function ol({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 cx=154,rl=10;function mx({index:e,style:t,tokens:o,skeletonCount:r,resolution:s,renderAction:n,onSelectToken:i}){return o?jsx("div",{style:t,children:jsx(tl,{token:o[e],resolution:s,isLast:e===o.length-1,renderAction:n,onSelectToken:i})}):jsx("div",{style:t,children:jsx(ol,{isLast:e===r-1})})}function IR({tokens:e,resolution:t="24h",isLoading:o,height:r=600,renderAction:s,onSelectToken:n,className:i}){let l=o||!e?void 0:e,a=l?l.length:rl,d=useMemo(()=>({tokens:l,skeletonCount:rl,resolution:t,renderAction:s,onSelectToken:n}),[l,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:a,rowHeight:cx,overscanCount:5,rowComponent:mx,rowProps:d})})}var gx=80;function ll(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 xx(e,t,o){return e===t?o:e===o?t:o||t}function Fr(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:xx(t,e.tokenAAddress,e.tokenBAddress),image:e.dex?.image,programAddress:e.dex?.programAddress,protocolFamily:e.dex?.protocolFamily,protocolName:e.dex?.protocolName}]}}function kx(e){return {...ll(Fr(e)),...e.token??{},liquidities:Fr(e).liquidities,createdAt:e.token?.createdAt??e.createdAt}}function al(e){return e.sort((t,o)=>{let r=t.createdAt?.getTime()??0;return (o.createdAt?.getTime()??0)-r}),e.slice(0,gx)}function bx(e){if(!(!e?.filters&&!e?.keywords&&!e?.excludeKeywords))return {filters:e.filters,keywords:e.keywords,excludeKeywords:e.excludeKeywords}}function hx(e){if(!(!e?.sortBy||!e.sortDirection))return {[e.sortBy]:e.sortDirection}}function dl({chain:e,options:t,deferUpdates:o=false,updateFlushInterval:r}){let s=useMemo(()=>({chain:e}),[e]),n=useRef(s),[i,l]=useState(true),[a,d]=useState([]);useEffect(()=>{JSON.stringify(s)!==JSON.stringify(n.current)&&(l(true),d([]),n.current=s);},[s]);let{data:m,isPending:c}=useNewPoolsQuery(s);useEffect(()=>{m&&(d(h=>{let k=[...h];for(let T of m){let C=kx(T),y=k.findIndex(L=>L.address===C.address);y>=0?k[y]=X(k[y],C):k.push(C);}return al(k)}),l(false));},[m]);let p=useCallback(h=>{d(k=>{let T=[...k],C=false;for(let y of h){let L=T.findIndex(W=>W.address===y.address);L>=0?(C=true,T[L]=X(T[L],y)):(C=true,T.push(ll(y)));}return C?al(T):k});},[]),{enqueueUpdates:u}=de({applyUpdates:p,paused:o,flushInterval:r}),g=useCallback(h=>{u(h.map(Fr));},[u]);useNewPoolsSubscription({chain:e},g),xe({chain:e,tokens:a,onUpdate:u});let f=useMemo(()=>!!(c||i),[c,i]),x=useMemo(()=>le(a,bx(t)),[a,t]);return {tokens:useMemo(()=>et(x,hx(t)),[x,t]),isLoading:f}}function QR({chain:e,resolution:t,filters:o,ActionsComponent:r,onSelectToken:s,height:n,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],b=d?.[x];return {...o,...x&&b?{sortBy:x,sortDirection:b}:void 0}},[o,d]),{tokens:g,isLoading:f}=dl({chain:e,options:u,deferUpdates:c});return jsx(ut,{tokens:g,isLoading:f,resolution:t,height:n,itemHeight:i,itemHeightMobile:l,ActionsComponent:r,onSelectToken:s,sortDirections:d,onSortChange:m,onScrollingChange:p,className:a})}function ul({chain:e,filters:t,sortDirections:o,refetchInterval:r=12e3,deferUpdates:s=false,updateFlushInterval:n}){let i=useMemo(()=>({chain:e}),[e]),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(k=>$t(k,p)),d(false));},[p]);let g=useCallback(k=>{c(T=>Re(T,k));},[]),{enqueueUpdates:f}=de({applyUpdates:g,paused:s,flushInterval:n});useStockTokensSubscription({chain:e},f),xe({chain:e,tokens:m,onUpdate:f});let x=useMemo(()=>!!(u||a),[u,a]),b=useMemo(()=>le(m,t),[m,t]);return {tokens:useMemo(()=>et(b,o),[b,o]),isLoading:x}}function dA({chain:e,resolution:t,filters:o,ActionsComponent:r,onSelectToken:s,height:n,itemHeight:i,itemHeightMobile:l,className:a}){let[d,m]=useState(),[c,p]=useState(false);useEffect(()=>{m(void 0);},[e]);let{tokens:u,isLoading:g}=ul({chain:e,filters:o,sortDirections:d,deferUpdates:c});return jsx(ut,{tokens:u,isLoading:g,resolution:t,height:n,itemHeight:i,itemHeightMobile:l,ActionsComponent:r,onSelectToken:s,sortDirections:d,onSortChange:m,onScrollingChange:p,className:a})}function kA({chain:e,resolution:t,filters:o,ActionsComponent:r,onSelectToken:s,height:n,itemHeight:i,itemHeightMobile:l,className:a}){let[d,m]=useState(),[c,p]=useState(false);useEffect(()=>{m(void 0);},[e]);let{tokens:u,isLoading:g}=eo({chain:e,resolution:t,filters:o,sortDirections:d,deferUpdates:c});return jsx(ut,{tokens:u,isLoading:g,resolution:t,height:n,itemHeight:i,itemHeightMobile:l,ActionsComponent:r,onSelectToken:s,sortDirections:d,onSortChange:m,onScrollingChange:p,className:a})}var Ox=15e3;function Dx({chain:e,addresses:t,pollMs:o=Ox}){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 g=c[u.address];p[u.address]=g?X(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=>{n(g=>{let f=g;for(let x of u){let b=f[x.address];if(!b)continue;let h=X(b,x);h!==b&&(f=f===g?{...g}:f,f[x.address]=h);}return f});}));return ()=>{for(let p of c)p.unsubscribe();}},[l,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{ai as DEFAULT_FLIP_HOVER_RESOLUTIONS,Sl as HolderTagBadge,Dt as HolderTagBadgeList,z as HoldingRatioChip,QR as NewTokenListWidget,Wb as PulseFinalStretchListWidget,Je as PulseList,Ur as PulseListHeader,Jr as PulseListItem,Ho as PulseListItemSkeleton,wb as PulseMigratedListWidget,db as PulseNewListWidget,zo as SEARCH_MODAL_ID,Hn as SearchHistoryUI,Fn as SearchHistoryWidget,Mn as SearchInputUI,AT as SearchModal,Gt as SearchResultItemUI,Xt as SearchResultListHeader,Yt as SearchResultListSkeleton,_n as SearchResultListWidget,BT as SearchTokensButton,Jn as SearchWidget,dA as StockTokenListWidget,Fo as TRADER_TAG_META,Js as TokenAbout,gS as TokenAboutWidget,Us as TokenActivitiesList,J0 as TokenActivitiesListWidget,fe as TokenAvatar,ss as TokenBasicInfo,Ps as TokenBasicInfoWidget,si as TokenCategories,aC as TokenCategoriesWidget,oi as TokenCexListing,qS as TokenCexListingWidget,Hi as TokenChartBanner,tL as TokenChartBannerWidget,os as TokenDetailHeader,c0 as TokenDetailHeaderWidget,Si as TokenDevTokensList,Ww as TokenDevTokensListWidget,Ci as TokenDevTokensSummary,as as TokenHoldersCount,ds as TokenHoldersCountWidget,Is as TokenHoldersList,I0 as TokenHoldersListWidget,ei as TokenLiquidities,HS as TokenLiquiditiesWidget,ut as TokenList,yo as TokenListFilter,ua as TokenListFilterModal,ba as TokenListFilterPopover,v1 as TokenListFilterWidget,ya as TokenListResolutionSelectorDesktop,Na as TokenListResolutionSelectorMobile,B1 as TokenListResolutionSelectorWidget,ps as TokenMarketCap,fs as TokenMarketCapWidget,gi as TokenOrdersList,sw as TokenOrdersListWidget,mi as TokenPositionsList,VC as TokenPositionsListWidget,ks as TokenPrice,hs as TokenPriceWidget,Di as TokenReusedImageList,AL as TokenReusedImageListWidget,qs as TokenSecurity,tS as TokenSecurityWidget,Ui as TokenSimilarTokens,kL as TokenSimilarTokensWidget,Ts as TokenSocialMedia,vs as TokenSocialMediaWidget,li as TokenStatsFlipBase,di as TokenStatsFlipHover,NC as TokenStatsFlipWidget,Ti as TokenTopTradersList,Sw as TokenTopTradersListWidget,Ws as TokenTradersOverview,mN as TokenTradersOverviewWidget,_s as TokenTransactionsOverview,wN as TokenTransactionsOverviewWidget,Cs as TokenVolume,Ls as TokenVolumeWidget,Ks as TokenVolumesOverview,VN as TokenVolumesOverviewWidget,Nl as TraderTagBadge,Br as TraderTagBadgeList,tl as TrendingTokenCard,IR as TrendingTokenCardList,ol as TrendingTokenCardSkeleton,kA as TrendingTokenListWidget,dl as useNewTokensScript,Ln as usePulseFinalStretchListScript,vn as usePulseMigratedListScript,xn as usePulseNewListScript,Qt as useSearchHistory,Wn as useSearchResultListScript,Gn as useSearchScript,ul as useStockTokensScript,Ys as useTokenAboutScript,Es as useTokenActivitiesListScript,Ry as useTokenBasicInfoScript,ii as useTokenCategoriesScript,ri as useTokenCexListingScript,Mi as useTokenChartBannerScript,rs as useTokenDetailHeaderScript,Ri as useTokenDevTokensListScript,ls as useTokenHoldersCountScript,Ms as useTokenHoldersListScript,ti as useTokenLiquiditiesScript,us as useTokenMarketCapScript,hi as useTokenOrdersListScript,fi as useTokenPositionsListScript,bs as useTokenPriceScript,Ei as useTokenReusedImageListScript,Qs as useTokenSecurityScript,Oi as useTokenSimilarTokensScript,ys as useTokenSocialMediaScript,ci as useTokenStatsFlipScript,vi as useTokenTopTradersListScript,Vs as useTokenTradersOverviewScript,$s as useTokenTransactionsOverviewScript,ws as useTokenVolumeScript,zs as useTokenVolumesOverviewScript,Dx as useTokens,eo as useTrendingTokensScript};//# sourceMappingURL=index.mjs.map
23
+ `,wg={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 V(e,t,o,r){return {...wg,animationDelay:`${e}ms`,width:t,height:o,...r}}var Ga=10;function Xa({rowHeight:e,hasActions:t,isMobile:o}){return jsxs(Fragment,{children:[jsx("style",{children:Cg}),Array.from({length:Ga}).map((r,s)=>jsx(Lg,{index:s,rowHeight:e,hasActions:t,isMobile:o,isLast:s===Ga-1},s))]})}function Lg({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:V(n,a,a,{borderRadius:8,flexShrink:0})}),jsxs("div",{style:{display:"flex",flexDirection:"column",gap:8,flex:1},children:[jsx("div",{style:V(n+30,"60%",20)}),jsx("div",{style:V(n+60,"80%",16)})]})]}),jsxs("div",{style:{width:128,padding:"0 12px",display:"flex",flexDirection:"column",justifyContent:"center",gap:4},children:[jsx("div",{style:V(n+20,72,20)}),jsx("div",{style:V(n+40,52,16)})]}),jsx("div",{style:{width:106,padding:"0 12px",display:"flex",alignItems:"center"},children:jsx("div",{style:V(n+30,64,20)})}),jsx("div",{style:{width:106,padding:"0 12px",display:"flex",alignItems:"center"},children:jsx("div",{style:V(n+40,60,20)})}),jsxs("div",{style:{width:138,padding:"0 12px",display:"flex",flexDirection:"column",justifyContent:"center",gap:4},children:[jsx("div",{style:V(n+50,72,20)}),jsx("div",{style:V(n+70,100,16)})]}),jsxs("div",{style:{width:126,padding:"0 12px",display:"flex",flexDirection:"column",justifyContent:"center",gap:4},children:[jsx("div",{style:V(n+60,48,20)}),jsx("div",{style:V(n+80,80,16)})]}),jsxs("div",{style:{width:126,padding:"0 12px",display:"flex",flexDirection:"column",justifyContent:"center",gap:4},children:[jsx("div",{style:V(n+70,40,20)}),jsx("div",{style:V(n+90,72,16)})]}),jsxs("div",{style:{width:128,padding:"0 12px",display:"flex",alignItems:"center",gap:10},children:[jsx("div",{style:V(n+80,20,20,{borderRadius:4})}),jsx("div",{style:V(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:V(n+80,52,16)}),jsx("div",{style:V(n+100,40,16)}),jsx("div",{style:V(n+120,36,16)})]}),jsxs("div",{style:{display:"flex",flexDirection:"column",gap:8},children:[jsx("div",{style:V(n+90,48,16)}),jsx("div",{style:V(n+110,40,16)}),jsx("div",{style:V(n+130,40,16)})]}),jsxs("div",{style:{display:"flex",flexDirection:"column",gap:8},children:[jsx("div",{style:V(n+100,40,16)}),jsx("div",{style:V(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:V(n+100,d,32,{borderRadius:8})})})]})}var Ug=100,Og=200,Dg=72;function pt({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,g=useMemo(()=>e.slice(0,Ug),[e]),f=!!o,x=useRef(void 0),k=useRef(false),{t:h}=useTranslation(),b=useCallback(F=>_=>{_.preventDefault(),_.stopPropagation(),s?.(F);},[s]),[T,N]=useState(n??{});useEffect(()=>{N(n??{});},[n]);let y=useCallback(F=>_=>{let gt={[F]:_};N(gt),i?.(gt);},[i]),P=useCallback(()=>{k.current||(k.current=true,a?.(true)),x.current&&clearTimeout(x.current),x.current=setTimeout(()=>{k.current=false,a?.(false);},180);},[a]);useEffect(()=>()=>{x.current&&clearTimeout(x.current),k.current&&a?.(false);},[a]);let L=cn$1("h-full mx-auto",c??(r?"max-w-362 sm:max-w-403":"max-w-331 sm:max-w-372")),H=r?"!w-[1438px] min-w-[1438px] max-w-[1438px]":"!w-[1366px] min-w-[1366px] max-w-[1366px]",te=[jsx(TableColumn,{textValue:h("tokens.listHeader.token"),width:p?Og:320,className:cn$1("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:y("price"),children:h("tokens.listHeader.price")}),jsx("span",{children:"/"}),jsx(Sortable,{sort:T[`priceChange${t}`],onSortChange:y(`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:y("marketCap"),children:h("tokens.listHeader.marketCap")})},"marketCap"),jsx(TableColumn,{textValue:h("tokens.listHeader.liquidity"),width:106,children:jsx(Sortable,{sort:T.tvl,onSortChange:y("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:y(`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:y(`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:y(`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?Dg:124,align:"end",className:cn$1("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),Se=jsx(Xa,{rowHeight:u,hasActions:!!r,isMobile:p}),D=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")})]}),ie=F=>[jsx(TableCell,{className:cn$1("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(Ua,{token:F,resolution:t})},"token"),jsx(TableCell,{children:jsx(Va,{token:F,resolution:t})},"price"),jsx(TableCell,{children:jsx(Ba,{token:F,resolution:t})},"marketCap"),jsx(TableCell,{children:jsx(Da,{token:F,resolution:t})},"liquidity"),jsx(TableCell,{children:jsx(Qa,{token:F,resolution:t})},"volumes"),jsx(TableCell,{children:jsx(za,{token:F,resolution:t})},"trades"),jsx(TableCell,{children:jsx($a,{token:F,resolution:t})},"traders"),jsx(TableCell,{children:jsx(Pa,{token:F,resolution:t})},"bluechip"),jsx(TableCell,{children:jsx(Oa,{token:F,resolution:t})},"tokenInfo"),r?jsx(TableCell,{className:cn$1("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$1("!absolute inset-y-0 right-3 z-1 w-fit","flex items-center justify-end"),children:jsx(r,{token:F,resolution:t})})},"actions"):void 0].filter(Boolean),B=F=>jsx(TableRow,{onClick:s?b(F):void 0,children:ie(F)},F.address);return p?jsx("div",{"data-token-list-mobile-scroll":true,className:cn$1("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:P,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$1("table-fixed",H),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:te}),jsx(TableBody,{items:g,isLoading:f,loadingContent:Se,emptyContent:D,children:B})]})})}):jsxs(StyledTable,{isHeaderSticky:true,isVirtualized:true,radius:"lg",className:L,classNames:{loadingWrapper:"flex-col justify-start items-start",emptyWrapper:"pt-30"},onScrollCapture:P,maxTableHeight:l,rowHeight:u,"aria-label":"Tokens",children:[jsx(TableHeader,{children:te}),jsx(TableBody,{items:e,isLoading:f,loadingContent:Se,emptyContent:D,children:B})]})}function rl({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(_=>{_.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]),g=useMemo(()=>p?.priceChange,[p?.priceChange]),f=useMemo(()=>g&&new SafeBigNumber(g).gte(0),[g]),x=useMemo(()=>g?new SafeBigNumber(g).abs().toString():void 0,[g]),k=useMemo(()=>p?.volumesInUsd,[p?.volumesInUsd]),h=useMemo(()=>p?.buyVolumesInUsd,[p?.buyVolumesInUsd]),b=useMemo(()=>p?.sellVolumesInUsd,[p?.sellVolumesInUsd]),T=useMemo(()=>p?.trades,[p?.trades]),N=useMemo(()=>c?.marketCapInUsd,[c?.marketCapInUsd]),y=useMemo(()=>c?.tvlInUsd,[c?.tvlInUsd]),P=useMemo(()=>new SafeBigNumber(c?.top10HoldingsRatio).gte(.1),[c?.top10HoldingsRatio]),L=useMemo(()=>new SafeBigNumber(c?.devHoldingsRatio).gte(.1),[c?.devHoldingsRatio]),H=useMemo(()=>new SafeBigNumber(c?.sniperHoldingsRatio).gte(.1),[c?.sniperHoldingsRatio]),te=useMemo(()=>new SafeBigNumber(c?.insiderHoldingsRatio).gte(.1),[c?.insiderHoldingsRatio]),Se=useMemo(()=>new SafeBigNumber(c?.bundleHoldingsRatio).gte(.1),[c?.bundleHoldingsRatio]),D=c?.holders!==void 0&&c.holders>0,ie=c?.kolHolders!==void 0&&c.kolHolders>0,B=c?.bluechipHolders!==void 0&&c.bluechipHolders>0,F=D||ie||B;return jsxs("div",{className:cn$1("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(fe,{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:_=>_.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:_=>_.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:_=>_.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:_=>_.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(N)})]}),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(y)})]})]}),F&&jsxs("div",{className:"flex items-center gap-2 text-xs font-mono text-neutral leading-none",children:[D&&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)]})}),ie&&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)]})}),B&&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$1("inline-flex items-center gap-0.5 text-[10px] leading-none",f?"text-bullish":"text-bearish"),children:[f?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(k)})]}),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(z,{icon:jsx(UserWithStarBadgeIcon,{width:12,height:12}),value:formatPercent(c?.top10HoldingsRatio),tooltip:i("tokens.tokenInfo.top10HoldingsRatio"),warning:P,disable:!c?.top10HoldingsRatio||c?.top10HoldingsRatio==="0"}),jsx(z,{icon:jsx(CookIcon,{width:12,height:12}),value:formatPercent(c?.devHoldingsRatio),tooltip:i("tokens.tokenInfo.devHoldingsRatio"),warning:L,disable:!c?.devHoldingsRatio||c?.devHoldingsRatio==="0"}),jsx(z,{icon:jsx(SniperIcon,{width:12,height:12}),value:formatPercent(c?.sniperHoldingsRatio),tooltip:i("tokens.tokenInfo.sniperHoldingsRatio"),warning:H,disable:!c?.sniperHoldingsRatio||c?.sniperHoldingsRatio==="0"}),jsx(z,{icon:jsx(RatIcon,{width:12,height:12}),value:formatPercent(c?.insiderHoldingsRatio),tooltip:i("tokens.tokenInfo.insiderHoldingsRatio"),warning:te,disable:!c?.insiderHoldingsRatio||c?.insiderHoldingsRatio==="0"}),jsx(z,{icon:jsx(BundlesIcon,{width:12,height:12}),value:formatPercent(c?.bundleHoldingsRatio),tooltip:i("tokens.tokenInfo.bundleHoldingsRatio"),warning:Se,disable:!c?.bundleHoldingsRatio||c?.bundleHoldingsRatio==="0"})]})}),o&&jsx("div",{className:"flex-none relative",onClick:_=>_.stopPropagation(),children:o(e)})]})]})}function nl({isLast:e=false}){return jsxs("div",{className:cn$1("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 mx=154,sl=10;function px({index:e,style:t,tokens:o,skeletonCount:r,resolution:s,renderAction:n,onSelectToken:i}){return o?jsx("div",{style:t,children:jsx(rl,{token:o[e],resolution:s,isLast:e===o.length-1,renderAction:n,onSelectToken:i})}):jsx("div",{style:t,children:jsx(nl,{isLast:e===r-1})})}function FR({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:sl,d=useMemo(()=>({tokens:a,skeletonCount:sl,resolution:t,renderAction:s,onSelectToken:n}),[a,t,s,n]);return jsx("div",{className:cn$1("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:mx,overscanCount:5,rowComponent:px,rowProps:d})})}var xx=80;function cl(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 kx(e,t,o){return e===t?o:e===o?t:o||t}function Mr(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:kx(t,e.tokenAAddress,e.tokenBAddress),image:e.dex?.image,programAddress:e.dex?.programAddress,protocolFamily:e.dex?.protocolFamily,protocolName:e.dex?.protocolName}]}}function bx(e){return {...cl(Mr(e)),...e.token??{},liquidities:Mr(e).liquidities,createdAt:e.token?.createdAt??e.createdAt}}function dl(e){return e.sort((t,o)=>{let r=t.createdAt?.getTime()??0;return (o.createdAt?.getTime()??0)-r}),e.slice(0,xx)}function hx(e){if(!(!e?.filters&&!e?.keywords&&!e?.excludeKeywords))return {filters:e.filters,keywords:e.keywords,excludeKeywords:e.excludeKeywords}}function Tx(e){if(!(!e?.sortBy||!e.sortDirection))return {[e.sortBy]:e.sortDirection}}function ml({chain:e,options:t,deferUpdates:o=false,updateFlushInterval:r}){let s=useMemo(()=>({chain:e}),[e]),n=useRef(s),[i,a]=useState(true),[l,d]=useState([]);useEffect(()=>{JSON.stringify(s)!==JSON.stringify(n.current)&&(a(true),d([]),n.current=s);},[s]);let{data:m,isPending:c}=useNewPoolsQuery(s);useEffect(()=>{m&&(d(h=>{let b=[...h];for(let T of m){let N=bx(T),y=b.findIndex(P=>P.address===N.address);y>=0?b[y]=X(b[y],N):b.push(N);}return dl(b)}),a(false));},[m]);let p=useCallback(h=>{d(b=>{let T=[...b],N=false;for(let y of h){let P=T.findIndex(L=>L.address===y.address);P>=0?(N=true,T[P]=X(T[P],y)):(N=true,T.push(cl(y)));}return N?dl(T):b});},[]),{enqueueUpdates:u}=de({applyUpdates:p,paused:o,flushInterval:r}),g=useCallback(h=>{u(h.map(Mr));},[u]);useNewPoolsSubscription({chain:e},g),xe({chain:e,tokens:l,onUpdate:u});let f=useMemo(()=>!!(c||i),[c,i]),x=useMemo(()=>le(l,hx(t)),[l,t]);return {tokens:useMemo(()=>je(x,Tx(t)),[x,t]),isLoading:f}}function XR({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],k=d?.[x];return {...o,...x&&k?{sortBy:x,sortDirection:k}:void 0}},[o,d]),{tokens:g,isLoading:f}=ml({chain:e,options:u,deferUpdates:c});return jsx(pt,{tokens:g,isLoading:f,resolution:t,height:n,itemHeight:i,itemHeightMobile:a,ActionsComponent:r,onSelectToken:s,sortDirections:d,onSortChange:m,onScrollingChange:p,className:l})}function gl({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=>$t(b,p)),d(false));},[p]);let g=useCallback(b=>{c(T=>Re(T,b));},[]),{enqueueUpdates:f}=de({applyUpdates:g,paused:s,flushInterval:n});useStockTokensSubscription({chain:e},f),xe({chain:e,tokens:m,onUpdate:f});let x=useMemo(()=>!!(u||l),[u,l]),k=useMemo(()=>le(m,t),[m,t]);return {tokens:useMemo(()=>je(k,o),[k,o]),isLoading:x}}function mA({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:g}=gl({chain:e,filters:o,sortDirections:d,deferUpdates:c});return jsx(pt,{tokens:u,isLoading:g,resolution:t,height:n,itemHeight:i,itemHeightMobile:a,ActionsComponent:r,onSelectToken:s,sortDirections:d,onSortChange:m,onScrollingChange:p,className:l})}function hA({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:g}=eo({chain:e,resolution:t,filters:o,sortDirections:d,deferUpdates:c});return jsx(pt,{tokens:u,isLoading:g,resolution:t,height:n,itemHeight:i,itemHeightMobile:a,ActionsComponent:r,onSelectToken:s,sortDirections:d,onSortChange:m,onScrollingChange:p,className:l})}var Dx=15e3;function Bx({chain:e,addresses:t,pollMs:o=Dx}){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 g=c[u.address];p[u.address]=g?X(g,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(g=>{let f=g;for(let x of u){let k=f[x.address];if(!k)continue;let h=X(k,x);h!==k&&(f=f===g?{...g}:f,f[x.address]=h);}return f});}));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{li as DEFAULT_FLIP_HOVER_RESOLUTIONS,wl as HolderTagBadge,Dt as HolderTagBadgeList,z as HoldingRatioChip,XR as NewTokenListWidget,Vb as PulseFinalStretchListWidget,Xe as PulseList,Or as PulseListHeader,Yr as PulseListItem,Fo as PulseListItemSkeleton,Lb as PulseMigratedListWidget,cb as PulseNewListWidget,qo as SEARCH_MODAL_ID,Fn as SearchHistoryUI,Mn as SearchHistoryWidget,Un as SearchInputUI,IT as SearchModal,Gt as SearchResultItemUI,Xt as SearchResultListHeader,Yt as SearchResultListSkeleton,$n as SearchResultListWidget,WT as SearchTokensButton,Yn as SearchWidget,mA as StockTokenListWidget,Mo as TRADER_TAG_META,Ys as TokenAbout,xS as TokenAboutWidget,Os as TokenActivitiesList,Y0 as TokenActivitiesListWidget,fe as TokenAvatar,is as TokenBasicInfo,Rs as TokenBasicInfoWidget,ii as TokenCategories,lC as TokenCategoriesWidget,ri as TokenCexListing,QS as TokenCexListingWidget,Mi as TokenChartBanner,rL as TokenChartBannerWidget,rs as TokenDetailHeader,m0 as TokenDetailHeaderWidget,wi as TokenDevTokensList,_w as TokenDevTokensListWidget,Li as TokenDevTokensSummary,ls as TokenHoldersCount,cs as TokenHoldersCountWidget,Hs as TokenHoldersList,H0 as TokenHoldersListWidget,ti as TokenLiquidities,FS as TokenLiquiditiesWidget,pt as TokenList,vo as TokenListFilter,ga as TokenListFilterModal,Ta as TokenListFilterPopover,S1 as TokenListFilterWidget,Na as TokenListResolutionSelectorDesktop,Ca as TokenListResolutionSelectorMobile,V1 as TokenListResolutionSelectorWidget,us as TokenMarketCap,gs as TokenMarketCapWidget,xi as TokenOrdersList,iw as TokenOrdersListWidget,pi as TokenPositionsList,_C as TokenPositionsListWidget,bs as TokenPrice,Ts as TokenPriceWidget,Ei as TokenReusedImageList,HL as TokenReusedImageListWidget,Qs as TokenSecurity,oS as TokenSecurityWidget,Di as TokenSimilarTokens,hL as TokenSimilarTokensWidget,ys as TokenSocialMedia,Ns as TokenSocialMediaWidget,di as TokenStatsFlipBase,ci as TokenStatsFlipHover,SC as TokenStatsFlipWidget,vi as TokenTopTradersList,ww as TokenTopTradersListWidget,Vs as TokenTradersOverview,pN as TokenTradersOverviewWidget,$s as TokenTransactionsOverview,LN as TokenTransactionsOverviewWidget,ws as TokenVolume,Ps as TokenVolumeWidget,zs as TokenVolumesOverview,_N as TokenVolumesOverviewWidget,Cl as TraderTagBadge,Wr as TraderTagBadgeList,rl as TrendingTokenCard,FR as TrendingTokenCardList,nl as TrendingTokenCardSkeleton,hA as TrendingTokenListWidget,ml as useNewTokensScript,Pn as usePulseFinalStretchListScript,Nn as usePulseMigratedListScript,kn as usePulseNewListScript,Qt as useSearchHistory,Vn as useSearchResultListScript,Xn as useSearchScript,gl as useStockTokensScript,Zs as useTokenAboutScript,Es as useTokenActivitiesListScript,Ay as useTokenBasicInfoScript,ai as useTokenCategoriesScript,ni as useTokenCexListingScript,Oi as useTokenChartBannerScript,ns as useTokenDetailHeaderScript,Ii as useTokenDevTokensListScript,ds as useTokenHoldersCountScript,Us as useTokenHoldersListScript,oi as useTokenLiquiditiesScript,fs as useTokenMarketCapScript,Ti as useTokenOrdersListScript,gi as useTokenPositionsListScript,hs as useTokenPriceScript,Wi as useTokenReusedImageListScript,Gs as useTokenSecurityScript,Bi as useTokenSimilarTokensScript,vs as useTokenSocialMediaScript,mi as useTokenStatsFlipScript,Si as useTokenTopTradersListScript,_s as useTokenTradersOverviewScript,Ks as useTokenTransactionsOverviewScript,Ls as useTokenVolumeScript,qs as useTokenVolumesOverviewScript,Bx as useTokens,eo as useTrendingTokensScript};//# sourceMappingURL=index.mjs.map
24
24
  //# sourceMappingURL=index.mjs.map