1(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,754788,e=>{"use strict";var t=e.i(86604),r=e.i(333334),n=e.i(672044),s=e.i(7545),i=e.i(561554),a=e.i(342510),l=e.i(550457),o=e.i(561993);function c({refreshedAt:e}){let n,[s,i]=(0,r.useState)(()=>Date.now()),a=e?Date.parse(e):NaN,l=Number.isFinite(a);(0,r.useEffect)(()=>{if(i(Date.now()),!l)return;let e=window.setInterval(()=>i(Date.now()),1e3);return()=>window.clearInterval(e)},[l,e]);let o=l?(n=Math.max(0,Math.floor((s-a)/1e3)))<2?"now":n<60?`${n}s ago`:`${Math.floor(n/60)}m ago`:"waiting";return(0,t.jsxs)("span",{className:"inline-flex min-h-8 shrink-0 items-center gap-1.5 rounded-lg border border-white/8 bg-black/15 px-2 text-[11px] font-semibold text-white/48","aria-label":l?`Live data updated ${o}`:"Waiting for live data","data-testid":"memecoin-live-status",children:[(0,t.jsxs)("span",{className:"relative flex h-2 w-2","aria-hidden":"true",children:[l?(0,t.jsx)("span",{className:"ui-live-status-pulse absolute inline-flex h-full w-full rounded-full bg-emerald-300"},e):null,(0,t.jsx)("span",{className:`relative inline-flex h-2 w-2 rounded-full ${l?"bg-emerald-400":"bg-white/20"}`})]}),(0,t.jsx)("span",{className:l?"text-emerald-300":void 0,children:"Live"}),(0,t.jsx)("span",{"aria-hidden":"true",children:"·"}),(0,t.jsx)("span",{children:l?`Updated ${o}`:"Waiting"})]})}function d(e){return(0,t.jsxs)("fieldset",{children:[(0,t.jsx)("legend",{className:"mb-2 text-xs font-semibold uppercase tracking-[0.14em] text-white/55",children:e.label}),(0,t.jsx)("div",{className:"grid grid-cols-3 gap-2",children:e.values.map(r=>{let n=r===e.value;return(0,t.jsx)("button",{type:"button","aria-pressed":n,onClick:()=>e.onChange(r),className:`min-h-11 touch-manipulation rounded-xl border px-3 py-2 text-sm font-semibold transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-emerald-400/70 ${n?e.accent?"border-emerald-500/30 bg-terminal-success-surface text-emerald-300":"border-white/16 bg-terminal-surface-raised text-white":"border-white/8 bg-terminal-surface-soft text-white/65 active:bg-terminal-surface-raised"}`,children:e.labelForValue?e.labelForValue(r):r},r)})})]})}function m(e){let[n,s]=(0,r.useState)(!1),[m,u]=(0,r.useState)({dexScreenerFilter:e.activeDexScreenerFilter,timeframe:e.activeTimeframe,pLevel:e.activePLevel});(0,r.useEffect)(()=>{n||u({dexScreenerFilter:e.activeDexScreenerFilter,timeframe:e.activeTimeframe,pLevel:e.activePLevel})},[n,e.activeDexScreenerFilter,e.activePLevel,e.activeTimeframe]);let h=l.CATEGORY_META.filter(t=>!(e.hidePumpLive&&"pump-live"===t.key)),x=l.DEXSCREENER_FILTER_META.find(t=>t.key===e.activeDexScreenerFilter)?.label;return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("section",{className:"hidden rounded-2xl border border-white/8 bg-terminal-surface p-4 shadow-[0_22px_40px_-30px_rgba(0,0,0,0.95)] xl:block",children:(0,t.jsxs)("div",{className:"flex flex-col gap-3 lg:flex-row lg:items-center lg:justify-between",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)(c,{refreshedAt:e.liveRefreshedAt}),(0,t.jsx)("div",{className:"inline-flex rounded-xl border border-white/8 bg-terminal-surface-soft p-1",children:h.map(r=>{let n=r.key===e.activeCategory;return(0,t.jsx)("button",{type:"button",onClick:()=>e.onCategoryChange(r.key),className:`rounded-lg border px-4 py-2 text-sm font-semibold transition-colors ${n?"border-white/12 bg-terminal-surface-raised text-white":"border-transparent text-muted-foreground hover:bg-terminal-surface-raised hover:text-foreground"}`,children:r.label},r.key)})})]}),(0,t.jsx)("div",{className:"flex flex-wrap items-center gap-2",children:"pump-live"!==e.activeCategory?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("div",{className:"inline-flex rounded-xl border border-white/8 bg-terminal-surface-soft p-1",children:l.DEXSCREENER_FILTER_META.map(r=>{let n=r.key===e.activeDexScreenerFilter;return(0,t.jsx)("button",{type:"button",onClick:()=>e.onDexScreenerFilterChange(r.key),className:`rounded-lg border px-4 py-1.5 text-xs font-semibold transition-colors ${n?"border-white/12 bg-terminal-surface-raised text-white":"border-transparent text-muted-foreground hover:bg-terminal-surface-raised hover:text-foreground"}`,children:r.label},r.key)})}),(0,t.jsx)("div",{className:"inline-flex rounded-xl border border-white/8 bg-terminal-surface-soft p-1",children:l.TIMEFRAMES.map(r=>{let n=r===e.activeTimeframe;return(0,t.jsx)("button",{type:"button",onClick:()=>e.onTimeframeChange(r),className:`rounded-lg border px-3 py-1.5 text-xs font-semibold transition-colors ${n?"border-white/12 bg-terminal-surface-raised text-white":"border-transparent text-muted-foreground hover:bg-terminal-surface-raised hover:text-foreground"}`,children:r},r)})}),(0,t.jsx)("div",{className:"inline-flex rounded-xl border border-white/8 bg-terminal-surface-soft p-1",children:l.P_LEVELS.map(r=>{let n=r===e.activePLevel;return(0,t.jsx)("button",{type:"button",onClick:()=>e.onPLevelChange(r),className:`rounded-lg border px-3 py-1.5 text-xs font-semibold transition-colors ${n?"border-emerald-500/18 bg-terminal-success-surface text-emerald-300":"border-transparent text-muted-foreground hover:bg-terminal-surface-raised hover:text-foreground"}`,children:r},r)})})]}):(0,t.jsx)("div",{className:"rounded-xl border border-emerald-500/18 bg-terminal-success-surface px-3 py-2 text-[12px] font-semibold text-emerald-300",children:"Pump.fun launch stream board"})})]})}),(0,t.jsxs)("section",{className:"space-y-2 xl:hidden","aria-label":"Memecoin board filters",children:[(0,t.jsx)("div",{className:"flex justify-end px-1",children:(0,t.jsx)(c,{refreshedAt:e.liveRefreshedAt})}),h.length>1?(0,t.jsx)("div",{className:"grid grid-cols-2 gap-2 rounded-2xl border border-white/8 bg-terminal-surface p-1.5",children:h.map(r=>{let n=r.key===e.activeCategory;return(0,t.jsx)("button",{type:"button","aria-pressed":n,onClick:()=>e.onCategoryChange(r.key),className:`min-h-11 touch-manipulation rounded-xl px-3 text-sm font-semibold transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-emerald-400/70 ${n?"bg-terminal-surface-raised text-white shadow-sm":"text-white/60 active:bg-terminal-surface-soft"}`,children:r.label},r.key)})}):null,"pump-live"===e.activeCategory?(0,t.jsx)("div",{className:"rounded-xl border border-emerald-500/18 bg-terminal-success-surface px-3 py-3 text-sm font-semibold text-emerald-300",children:"Live Pump.fun launch stream"}):(0,t.jsxs)("button",{type:"button",onClick:()=>s(!0),className:"flex min-h-12 w-full touch-manipulation items-center justify-between gap-3 rounded-2xl border border-white/8 bg-terminal-surface px-3.5 text-left transition-colors active:bg-terminal-surface-raised focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-emerald-400/70",children:[(0,t.jsxs)("span",{className:"flex min-w-0 items-center gap-2",children:[(0,t.jsx)(i.SlidersHorizontal,{className:"h-4 w-4 shrink-0 text-white/65","aria-hidden":"true"}),(0,t.jsx)("span",{className:"truncate text-sm font-semibold text-white",children:"Filters"})]}),(0,t.jsxs)("span",{className:"flex min-w-0 items-center justify-end gap-1.5 text-xs font-semibold text-white/65",children:[(0,t.jsx)("span",{className:"rounded-lg bg-white/[0.06] px-2 py-1 text-white/85",children:x}),(0,t.jsx)("span",{className:"rounded-lg bg-white/[0.06] px-2 py-1 text-white/85",children:e.activeTimeframe}),(0,t.jsx)("span",{className:"rounded-lg bg-emerald-400/10 px-2 py-1 text-emerald-300",children:e.activePLevel})]})]})]}),(0,t.jsx)(o.Drawer,{open:n,onOpenChange:s,children:(0,t.jsxs)(o.DrawerContent,{className:"memecoin-surface z-[100] max-h-[calc(100dvh-max(0.75rem,var(--app-telegram-safe-area-top))-max(0.75rem,var(--app-telegram-safe-area-bottom))-0.75rem)] overflow-hidden rounded-t-[24px] border-white/10 bg-terminal-surface p-0 shadow-[0_-24px_64px_rgba(0,0,0,0.82)] xl:hidden",overlayClassName:"z-[99] bg-black/65 backdrop-blur-sm xl:hidden",children:[(0,t.jsxs)(o.DrawerHeader,{className:"flex-row items-center justify-between border-b border-white/8 px-4 pb-3 pt-4 text-left",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)(o.DrawerTitle,{className:"text-base font-semibold text-white",children:"Filter memecoins"}),(0,t.jsx)("p",{className:"mt-0.5 text-xs text-white/50",children:"Changes apply together to keep the board stable."})]}),(0,t.jsx)(o.DrawerClose,{className:"flex h-11 w-11 touch-manipulation items-center justify-center rounded-full border border-white/10 bg-white/[0.03] text-white/65 transition-colors active:bg-white/[0.08] focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-emerald-400/70","aria-label":"Close filters",children:(0,t.jsx)(a.X,{className:"h-5 w-5"})})]}),(0,t.jsxs)("div",{className:"min-h-0 flex-1 space-y-5 overflow-y-auto px-4 py-5",children:[(0,t.jsx)(d,{label:"Ranking",values:l.DEXSCREENER_FILTER_META.map(e=>e.key),value:m.dexScreenerFilter,labelForValue:e=>l.DEXSCREENER_FILTER_META.find(t=>t.key===e)?.label??e,onChange:e=>u(t=>({...t,dexScreenerFilter:e}))}),(0,t.jsx)(d,{label:"Time window",values:l.TIMEFRAMES,value:m.timeframe,onChange:e=>u(t=>({...t,timeframe:e}))}),(0,t.jsx)(d,{label:"Priority level",values:l.P_LEVELS,value:m.pLevel,onChange:e=>u(t=>({...t,pLevel:e})),accent:!0})]}),(0,t.jsxs)(o.DrawerFooter,{className:"grid grid-cols-[0.8fr_1.2fr] gap-2 border-t border-white/8 bg-terminal-surface px-4 pb-[calc(1rem+var(--app-telegram-safe-area-bottom))] pt-3",children:[(0,t.jsx)("button",{type:"button",onClick:()=>u({dexScreenerFilter:l.DEFAULT_DEXSCREENER_FILTER,timeframe:l.DEFAULT_TIMEFRAME,pLevel:l.DEFAULT_P_LEVEL}),className:"min-h-12 touch-manipulation rounded-xl border border-white/10 bg-terminal-surface-soft text-sm font-semibold text-white/75 transition-colors active:bg-terminal-surface-raised focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-white/40",children:"Reset"}),(0,t.jsx)("button",{type:"button",onClick:()=>{e.onApplyFilters(m),s(!1)},className:"min-h-12 touch-manipulation rounded-xl border border-emerald-400/30 bg-emerald-400 text-sm font-bold text-black transition-colors active:bg-emerald-300 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-emerald-300 focus-visible:ring-offset-2 focus-visible:ring-offset-black",children:"Show results"})]})]})})]})}var u=e.i(286770);let h=[{id:"solana-mainnet",label:"Solana",icon:"/token-icons/solana.png"},{id:"robinhood-mainnet",label:"Robinhood",icon:"/token-icons/robinhood-chain-feather.svg"}];function x(e){return(0,t.jsx)("span",{className:"flex h-8 w-8 shrink-0 items-center justify-center rounded-lg border border-white/8 bg-black/20",children:(0,t.jsx)("img",{src:e.chain.icon,alt:"",width:20,height:20,decoding:"async",className:"h-5 w-5 object-contain"})})}function b(e){let r=e.chains?h.filter(t=>e.chains?.includes(t.id)):h;return(0,t.jsx)("nav",{"aria-label":"Memecoin trading network",className:"flex w-fit max-w-full self
1-start rounded-2xl border border-white/8 bg-terminal-surface p-1 shadow-[0_18px_36px_-28px_rgba(0,0,0,0.95)]",children:r.map(r=>{let n=r.id===e.value;return(0,t.jsxs)(u.default,{href:e.hrefForChain(r.id),scroll:!1,"aria-current":n?"page":void 0,className:`group flex min-h-11 min-w-0 touch-manipulation items-center gap-2 rounded-xl border px-2.5 py-1.5 text-left transition-colors duration-200 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-emerald-400/70 sm:px-3 ${n?"border-emerald-500/28 bg-terminal-success-surface text-white":"border-transparent bg-transparent text-white/65 hover:bg-terminal-surface-raised hover:text-white"}`,children:[(0,t.jsx)(x,{chain:r}),(0,t.jsx)("span",{className:"truncate text-sm font-semibold text-current",children:r.label}),(0,t.jsx)("span",{"aria-hidden":"true",className:`h-1.5 w-1.5 shrink-0 rounded-full transition-colors ${n?"bg-emerald-400":"bg-white/18 group-hover:bg-white/32"}`}),(0,t.jsx)("span",{className:"sr-only",children:n?"Current network":`Switch to ${r.label}`})]},r.id)})})}var p=e.i(582425),f=e.i(328661),g=e.i(207466),w=e.i(216021),v=e.i(174434),y=e.i(389347),j=e.i(329300),k=e.i(71937),N=e.i(411429),S=e.i(241396),E=e.i(302747),C=e.i(154105),A=e.i(175379),T=e.i(975157);let M="xl:grid-cols-[minmax(240px,1.8fr)_minmax(112px,.8fr)_minmax(106px,.75fr)_minmax(100px,.7fr)_minmax(110px,.75fr)_minmax(120px,.8fr)_minmax(90px,.65fr)_minmax(90px,.65fr)_minmax(126px,.9fr)_minmax(116px,.8fr)]";function R({className:e}
1){return(0,t.jsx)("svg",{viewBox:"0 0 24 24",className:e,fill:"currentColor","aria-hidden":"true",children:(0,t.jsx)("path",{d:"M18.244 2.25h3.308l-7.227 8.26 8.502 11.24h-6.657l-5.214-6.817L4.99 21.75H1.68l7.73-8.835L1.254 2.25H8.08l4.713 6.231 5.45-6.231Zm-1.161 17.52h1.833L7.084 4.126H5.117L17.083 19.77Z"})})}function L({item:e}){let r=[e.links.websiteUrl?{href:e.links.websiteUrl,label:`Open ${e.symbol} official website`,icon:(0,t.jsx)(y.Globe2,{className:"h-3.5 w-3.5"})}:null,e.links.xUrl?{href:e.links.xUrl,label:`Open ${e.symbol} on X`,icon:(0,t.jsx)(R,{className:"h-3 w-3"})}:null,e.links.telegramUrl?{href:e.links.telegramUrl,label:`Open ${e.symbol} Telegram`,icon:(0,t.jsx)(N.Send,{className:"h-3.5 w-3.5"})}:null,e.links.dexUrl?{href:e.links.dexUrl,label:`Open ${e.symbol} DEX pool`,icon:(0,t.jsx)(f.ChartNoAxesCombined,{className:"h-3.5 w-3.5"})}:null,e.links.explorerUrl?{href:e.links.explorerUrl,label:`Open ${e.symbol} in block explorer`,icon:(0,t.jsx)(v.Compass,{className:"h-3.5 w-3.5"})}:null].filter(e=>null!==e);return(0,t.jsx)("div",{className:"relative z-20 flex items-center gap-2 xl:gap-1","aria-label":`${e.symbol} external links`,children:r.map(e=>(0,t.jsx)("a",{href:e.href,target:"_blank",rel:"noreferrer","aria-label":e.label,title:e.label,className:"inline-flex h-11 w-11 touch-manipulation items-center justify-center rounded-lg text-white/45 transition-colors duration-150 hover:bg-white/[0.06] hover:text-white focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-emerald-400/70 xl:h-6 xl:w-6",children:e.icon},e.label))})}function _(e){return(0,t.jsxs)("div",{className:(0,T.cn)("flex min-h-14 min-w-0 flex-col justify-center px-3 py-2 xl:min-h-[68px] xl:px-2",e.className),role:"cell",children:[(0,t.jsx)("span",{className:"text-[11px] font-semibold uppercase tracking-[0.04em] text-white/55 xl:hidden",children:e.label}),(0,t.jsx)("span",{className:(0,T.cn)("mt-0.5 truncate text-sm font-semibold tabular-nums text-white/90 xl:mt-0",e.valueClassName),children:e.value}),e.detail?(0,t.jsx)("span",{className:"mt-0.5 truncate text-xs tabular-nums text-white/55 xl:text-[11px]",children:e.detail}):null]})}function U({value:e,testId:r}){let n="number"==typeof e&&e>=0;return(0,t.jsx)("span",{"data-testid":r,"data-trend-direction":"number"==typeof e?n?"up":"down":void 0,className:(0,T.cn)("font-bold tabular-nums","number"!=typeof e?"text-white/45":n?"text-emerald-300":"text-rose-300"),children:(0,l.formatPercent)(e)})}function P({item:e,pending:r,failed:n}){if(r)return(0,t.jsxs)("span",{className:"inline-flex items-center gap-1.5 text-white/55",children:[(0,t.jsx)(j.Loader2,{className:"h-3.5 w-3.5 animate-spin motion-reduce:animate-none"}),"Checking"]});if(n)return(0,t.jsxs)("span",{className:"inline-flex items-center gap-1.5 text-amber-300",children:[(0,t.jsx)(S.ShieldAlert,{className:"h-3.5 w-3.5"}),"Unavailable"]});let s=!0===e.security.contractVerified;return(0,t.jsxs)("span",{className:"space-y-0.5",children:[(0,t.jsxs)("span",{className:(0,T.cn)("flex items-center gap-1.5 font-semibold",s?"text-emerald-300":"text-amber-300"),children:[s?(0,t.jsx)(g.CheckCircle2,{className:"h-3.5 w-3.5"}):(0,t.jsx)(w.CircleHelp,{className:"h-3.5 w-3.5"}),s?"Verified":(0,l.formatDexStatus)(e.security.dexStatus)]}),(0,t.jsx)("span",{className:"block text-[11px] text-white/45",children:!0===e.security.liquidityLocked?`Pool locked${"number"==typeof e.security.liquidityLockedPct?` ${e.security.liquidityLockedPct.toFixed(0)}%`:""}`:"Lock unknown"})]})}function $(e){let{item:r}=e,n=(0,l.buildMemecoinTradeHref)(e.chainId,r.tokenAddress),s=e.quickBuy.settlementToken?.symbol??("robinhood-mainnet"===e.chainId?"ETH":"SOL"),i=e.quickBuy.presetAmounts[1]??e.quickBuy.presetAmounts[0],a=i?`${r.tokenAddress}:${i}`:null,o=null!=a&&e.quickBuy.pendingButtonKey===a,c="robinhood-mainnet"===e.chainId?"robinhood":"solana";return(0,t.jsxs)("div",{className:(0,T.cn)("group relative even:[&_.memecoin-market-row-surface]:bg-white/[0.018]",e.recentlyAdded&&"ui-live-item-enter"),"data-memecoin-list-address":r.tokenAddress,"data-testid":"memecoin-market-row",role:"row",children:[(0,t.jsx)("div",{className:(0,T.cn)("ui-market-card-refresh-shell rounded-xl",`refresh-brand-${c}`,e.refreshing?"scale-100 opacity-100":"pointer-events-none scale-[0.985] opacity-0"),"aria-hidden":"true"}),(0,t.jsxs)("div",{className:(0,T.cn)("memecoin-market-row-surface relative z-0 grid grid-cols-[minmax(0,1fr)_auto] border-b border-white/[0.055] bg-terminal-surface transition-colors duration-150 group-hover:bg-terminal-surface-raised/65 group-focus-within:bg-terminal-surface-raised/65",M),children:[(0,t.jsx)(u.default,{href:n,"aria-label":`Open ${r.symbol} trade panel`,className:"absolute inset-0 z-10 cursor-pointer rounded-lg focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-emerald-400/70"}),(0,t.jsx)("div",{className:"flex min-w-0 items-center gap-2.5 px-3 py-3 xl:col-start-1 xl:row-start-1 xl:min-h-[68px] xl:py-2 2xl:pr-[132px]","data-testid":"memecoin-token-cell",role:"cell",children:(0,t.jsxs)("div",{className:"flex min-h-11 min-w-0 items-center gap-2.5 rounded-lg",children:[(0,t.jsx)("span",{className:"flex h-10 w-10 shrink-0 items-center justify-center overflow-hidden rounded-lg bg-white/[0.06] text-[10px] font-black text-white ring-1 ring-white/[0.08]",children:r.logoUrl?(0,t.jsx)("img",{src:r.logoUrl,alt:`${r.symbol} token logo`,width:40,height:40,loading:"lazy",decoding:"async",className:"h-full w-full object-cover"}):r.symbol.slice(0,3)}),(0,t.jsxs)("span",{className:"min-w-0",children:[(0,t.jsxs)("span",{className:"flex min-w-0 items-baseline gap-1.5",children:[(0,t.jsx)("span",{className:"truncate text-sm font-bold text-white",children:r.symbol}),(0,t.jsx)("span",{className:"truncate text-xs text-white/42",children:r.name})]}),(0,t.jsxs)("span",{className:"mt-0.5 flex items-center gap-1.5 text-[11px] text-white/55",children:[(0,t.jsx)("span",{className:"font-mono",children:(0,C.shortenWalletAddress)(r.tokenAddress)}),(0,t.jsx)("span",{"aria-hidden":"true",children:"·"}),(0,t.jsx)("span",{children:r.provenance.pairCreatedAt?(0,A.formatAge)(r.provenance.pairCreatedAt):"New"})]})]})]})}),(0,t.jsxs)("div",{className:"flex min-w-[92px] flex-col items-end justify-center px-3 py-3 xl:hidden",role:"cell",children:[(0,t.jsx)("span",{className:"text-sm font-bold tabular-nums text-white",children:(0,l.formatPriceUsd)(r.market.priceUsd)}),(0,t.jsx)(U,{value:r.windowMetrics.priceChangePct})]}),(0,t.jsxs)("div",{className:"col-span-2 grid grid-cols-2 border-t border-white/[0.055] xl:contents xl:border-t-0",children:[(0,t.jsx)(_,{label:"MC /
1Liquidity",value:(0,A.formatCompactUsd)(r.market.marketCapUsd),detail:(0,A.formatCompactUsd)(r.market.liquidityUsd)}),(0,t.jsx)(_,{className:"hidden xl:flex",label:"Holders / Top 10",value:"number"==typeof r.holders.holderCount?r.holders.holderCount.toLocaleString("en-US"):"N/A",detail:(0,l.formatHolderConcentration)(r.holders.top10HolderPct)}),(0,t.jsx)(_,{label:`${e.timeframe} volume`,value:(0,A.formatCompactUsd)(r.windowMetrics.volumeUsd),detail:`24h ${(0,A.formatCompactUsd)(r.market.volumeUsd24h)}`}),(0,t.jsx)(_,{className:"hidden xl:flex",label:"Price",value:(0,l.formatPriceUsd)(r.market.priceUsd)}),(0,t.jsx)(_,{label:`${e.timeframe} transactions`,value:(0,l.formatCompactCount)(r.windowMetrics.totalTxns),detail:(0,t.jsxs)("span",{children:[(0,t.jsxs)("span",{className:"text-emerald-300","data-testid":"memecoin-trend-buys",children:["B ",(0,l.formatCompactCount)(r.windowMetrics.buys)]}),(0,t.jsx)("span",{className:"mx-1 text-white/20",children:"/"}),(0,t.jsxs)("span",{className:"text-rose-300","data-testid":"memecoin-trend-sells",children:["S ",(0,l.formatCompactCount)(r.windowMetrics.sells)]})]})}),(0,t.jsx)(_,{className:"hidden xl:flex",label:`${e.timeframe} change`,value:(0,t.jsx)(U,{value:r.windowMetrics.priceChangePct,testId:"memecoin-trend-change"})}),(0,t.jsx)(_,{className:"hidden xl:flex",label:"24h change",value:(0,t.jsx)(U,{value:r.market.priceChangePct24h})}
1),(0,t.jsx)(_,{label:"Safe check",value:(0,t.jsx)(P,{item:r,pending:e.enrichmentPending,failed:e.enrichmentFailed})}),(0,t.jsx)("div",{className:"col-span-2 flex min-h-14 items-center px-3 py-2 xl:col-span-1 xl:min-h-[68px] xl:px-2",role:"cell",children:(0,t.jsxs)("button",{type:"button",disabled:!i||!r.actions.buyEnabled||!!e.quickBuy.pendingButtonKey,onClick:()=>{i&&e.quickBuy.startQuickBuy(r,i)},className:"relative z-20 inline-flex min-h-11 w-full touch-manipulation cursor-pointer items-center justify-center gap-1.5 rounded-lg border border-emerald-400/15 bg-emerald-400/[0.1] px-2 text-xs font-bold tabular-nums text-emerald-300 transition-colors duration-150 hover:bg-emerald-400/[0.16] focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-emerald-400/70 disabled:cursor-not-allowed disabled:opacity-45 xl:min-h-9","aria-label":i?`Quick buy ${r.symbol} for ${i} ${s}`:`Quick buy ${r.symbol} unavailable`,title:r.actions.buyEnabled?"Review a live quote before buying":r.actions.buyReason||"Quick buy unavailable",children:[o?(0,t.jsx)(j.Loader2,{className:"h-4 w-4 animate-spin motion-reduce:animate-none"}):`Buy ${i??""}`,(0,t.jsx)("span",{className:"text-[10px] opacity-65",children:s})]})})]}),(0,t.jsx)("div",{className:"col-span-2 flex items-center border-t border-white/[0.045] px-2 py-1 xl:hidden 2xl:col-span-1 2xl:col-start-1 2xl:row-start-1 2xl:flex 2xl:justify-end 2xl:border-t-0 2xl:bg-transparent 2xl:px-2 2xl:py-0","data-testid":"memecoin-external-links-cell",children:(0,t.jsx)(L,{item:r})})]})]})}function I(){return(0,t.jsx)("div",{className:"space-y-px","data-testid":"memecoin-market-list-loading",children:[0,1,2,3,4,5].map(e=>(0,t.jsxs)("div",{className:"grid grid-cols-[48px_minmax(0,1fr)_90px] items-center gap-3 border-b border-white/[0.055] bg-terminal-surface px-3 py-3 xl:min-h-[68px] xl:grid-cols-[48px_minmax(180px,1fr)_repeat(7,minmax(80px,.55fr))]",children:[(0,t.jsx)(E.Skeleton,{className:"h-10 w-10 rounded-lg bg-white/[0.07]"}),(0,t.jsx)(E.Skeleton,{className:"h-4 w-32 bg-white/[0.07]"}),[0,1,2,3,4,5,6].map(e=>(0,t.jsx)(E.Skeleton,{className:"hidden h-4 w-16 bg-white/[0.07] xl:block"},e)),(0,t.jsx)(E.Skeleton,{className:"h-4 w-20 bg-white/[0.07] xl:hidden"})]},e))})}function F(e){let n=(0,r.useRef)(null),s=(0,r.useRef)(null),i=(0,r.useRef)(new Set),a=new Set(e.enrichmentPendingTokenAddresses),l=new Set(e.enrichmentFailedTokenAddresses),o=new Set(e.recentlyUpdatedTokenAddresses),c=new Set(e.refreshingTokenAddresses),d=new Set(e.recentlyAddedTokenAddresses),m=(0,r.useCallback)(()=>{e.onVisibleTokenAddressesChange?.(Array.from(i.current))},[e.onVisibleTokenAddressesChange]);return(0,r.useEffect)(()=>{if(!e.onVisibleTokenAddressesChange)return;let t=new IntersectionObserver(e=>{let t=!1;for(let r of e){let e=r.target.getAttribute("data-memecoin-list-address");e&&(r.isIntersecting&&!i.current.has(e)?(i.current.add(e),t=!0):!r.isIntersecting&&i.current.delete(e)&&(t=!0))}t&&m()},{rootMargin:"320px 0px",threshold:.01});return s.current=t,()=>{t.disconnect(),s.current=null,i.current.clear()}},[e.onVisibleTokenAddressesChange,m]),(0,r.useEffect)(()=>{if(!e.onVisibleTokenAddressesChange||!s.current||!n.current)return;let t=Array.from(n.current.querySelectorAll("[data-memecoin-list-address]"));return t.forEach(e=>s.current?.observe(e)),()=>t.forEach(e=>s.current?.unobserve(e))},[e.items,e.onVisibleTokenAddressesChange]),(0,t.jsxs)("section",{"aria-label":"Memecoin markets",children:[e.enrichmentFailedTokenAddresses.length>0?(0,t.jsxs)("div",{className:"mb-3 flex flex-wrap items-center justify-between gap-3 rounded-xl border border-amber-400/15 bg-amber-400/[0.06] px-4 py-3 text-xs text-amber-100",children:[(0,t.jsxs)("span",{className:"inline-flex items-center gap-2",children:[(0,t.jsx)(p.AlertCircle,{className:"h-4 w-4"}),"Live holder and security checks are unavailable for some tokens. Market data remains visible."]}),(0,t.jsxs)("button",{type:"button",onClick:e.onRetryEnrichment,className:"inline-flex min-h-11 cursor-pointer items-center gap-1.5 rounded-lg border border-amber-300/25 bg-amber-300/10 px-3 font-semibold transition-colors hover:bg-amber-300/15 focu
1s-visible:outline-none focus-visible:ring-2 focus-visible:ring-amber-300/60",children:[(0,t.jsx)(k.RotateCcw,{className:"h-3.5 w-3.5"}),"Retry checks"]})]}):null,(0,t.jsx)("div",{className:"overflow-clip rounded-xl border border-white/[0.07] bg-terminal-surface shadow-[0_18px_50px_-38px_rgba(0,0,0,0.95)]",children:(0,t.jsx)("div",{className:"min-w-0",children:(0,t.jsxs)("div",{className:"xl:min-w-[1180px]",role:"table","aria-label":"Ranked memecoin market list",children:[(0,t.jsx)("div",{className:(0,T.cn)("hidden border-b border-white/[0.08] bg-black/20 text-[10px] font-semibold uppercase tracking-[0.06em] text-white/38 xl:grid",M),role:"row",children:["Token","MC / Liquidity","Holders / Top 10",`${e.timeframe} Volume`,"Price",`${e.timeframe} TXs`,`${e.timeframe}%`,"24h%","Safe Check","Quick Buy"].map(e=>(0,t.jsx)("div",{className:"flex min-h-10 items-center px-2 first:px-3",role:"columnheader",children:e},e))}),e.isLoadingList?(0,t.jsx)(I,{}):e.listError&&0===e.items.length?(0,t.jsx)("div",{className:"flex min-h-80 items-center justify-center px-4 text-sm text-rose-300",children:e.listError}):0===e.items.length?(0,t.jsx)("div",{className:"flex min-h-64 items-center justify-center px-4 text-sm text-white/50",children:"No memecoins match the current filters."}):(0,t.jsx)("div",{ref:n,"data-testid":"memecoin-market-list",role:"rowgroup",children:e.items.map(r=>(0,t.jsx)($,{chainId:e.chainId,item:r,timeframe:e.timeframe,enrichmentPending:a.has(r.tokenAddress),enrichmentFailed:l.has(r.tokenAddress),refreshing:c.has(r.tokenAddress)||o.has(r.tokenAddress)||d.has(r.tokenAddress),recentlyAdded:d.has(r.tokenAddress),quickBuy:e.quickBuy},r.tokenAddress))})]})})}),(0,t.jsx)("div",{className:"py-4",children:e.loadMoreError?(0,t.jsxs)("div",{className:"flex flex-wrap items-center justify-between gap-3 rounded-xl border border-rose-500/20 bg-rose-500/6 px-4 py-3 text-sm text-rose-200",children:[(0,t.jsx)("span",{children:e.loadMoreError}),(0,t.jsx)("button",{type:"button",onClick:e.onLoadMore,className:"min-h-11 cursor-pointer rounded-xl border border-rose-400/30 bg-rose-400/10 px-4 text-xs font-semibold transition-colors hover:bg-rose-400/15",children:"Retry loading"})]}):e.isLoadingMore?(0,t.jsxs)("div",{className:"flex min-h-11 items-center justify-center gap-2 text-sm text-muted-foreground",children:[(0,t.jsx)(j.Loader2,{className:"h-4 w-4 animate-spin motion-reduce:animate-none"}),"Loading more memecoins..."]}):e.listPagination?.hasMore?(0,t.jsx)("div",{className:"py-2 text-center text-xs text-muted-foreground",children:"Scroll to load more."}):null}),e.listPagination?.hasMore?(0,t.jsx)("div",{ref:e.loadMoreSentinelRef,className:"h-1 w-full","aria-hidden":"true"}):null]})}var D=e.i(904042),q=e.i(2626),B=e.i(160719),H=e.i(664458),O=e.i(519455),z=e.i(781376),V=e.i(980376);function K(e){return"number"==typeof e&&Number.isFinite(e)?`$${e.toFixed(2)}`:"Unavailable"}function Q({expiresAt:e,nowMs:r}){let n=Math.max(0,Math.ceil((Date.parse(e)-r)/1e3));return(0,t.jsx)("span",{className:n<=3?"font-semibold text-amber-300":void 0,children:n>0?`${n}s`:"Expired"})}function G({controller:e}){let n,{selection:s,quote:i,settlementToken:a,settlementTokens:l,outputDecimals:o,blockedReason:c,error:d,swapStatus:m,phase:u}=e,[h,x]=(0,r.useState)(()=>Date.now());(0,r.useEffect)(()=>{if(!e.open||!i)return;x(Date.now());let t=window.setInterval(()=>x(Date.now()),1e3);return()=>window.clearInterval(t)},[e.open,i]);let b="quoting"===u||"executing"===u,p=i?Date.parse(i.quoteExpiresAt):NaN,f=!!i&&(!Number.isFinite(p)||p<=h),w="CONFIRMED"===(n=String(m?.status||"").trim().toUpperCase())||"COMPLETED"===n?"success":"FAILED"===n||"CANCELED"===n||"EXPIRED"===n?"error":"pending",v=(0,r.useMemo)(()=>{if(!i)return"â";
1let e=(0,H.formatAmountFromRaw)(i.destinationAmountRaw,o);return`${e} ${i.outputSymbol||s?.item.symbol||"token"}`},[o,i,s?.item.symbol]),y=(0,r.useMemo)(()=>{if(!i)return"â";let e=(0,H.formatAmountFromRaw)(i.minDestinationAmountRaw,o);return`${e} ${i.outputSymbol||s?.item.symbol||"token"}`},[o,i,s?.item.symbol]);return(0,t.jsx)(V.Sheet,{open:e.open,onOpenChange:e.setOpen,children:(0,t.jsxs)(V.SheetContent,{side:"center",className:"memecoin-surface w-[min(calc(100vw-1rem),520px)] gap-0 overflow-hidden rounded-[24px] border-white/10 bg-[#111318] p-0",style:{"--sheet-content-max-width":"520px"},children:[(0,t.jsx)(V.SheetHeader,{className:"border-b border-white/8 px-4 py-4 pr-12 text-left sm:px-5",children:(0,t.jsxs)("div",{className:"flex items-center gap-3",children:[(0,t.jsx)("div",{className:"flex h-11 w-11 shrink-0 items-center justify-center overflow-hidden rounded-full border border-white/10 bg-white/[0.05] text-[10px] font-black text-white",children:s?.item.logoUrl?(0,t.jsx)("img",{src:s.item.logoUrl,alt:"",width:44,height:44,className:"h-full w-full object-cover"}):s?.item.symbol.slice(0,3)}),(0,t.jsxs)("div",{className:"min-w-0",children:[(0,t.jsxs)(V.SheetTitle,{className:"truncate text-base font-bold text-white",children:["Quick buy ",s?.item.symbol||"memecoin"]}),(0,t.jsx)(V.SheetDescription,{className:"mt-0.5 text-xs text-white/50",children:"Review a live on-chain quote before the swap is submitted."})]})]})}),(0,t.jsxs)("div",{className:"max-h-[min(66dvh,590px)] overflow-y-auto px-4 py-4 custom-scrollbar sm:px-5",children:[(0,t.jsxs)("div",{className:"grid grid-cols-2 gap-3",children:[(0,t.jsxs)("label",{className:"block",children:[(0,t.jsx)("span",{className:"text-[11px] font-semibold uppercase tracking-[0.08em] text-white/40",children:"Spend"}),(0,t.jsxs)("div",{className:"mt-1 flex min-h-11 items-center rounded-xl border border-white/8 bg-white/[0.04] px-3 text-sm font-bold text-white",children:[s?.amount||"â"," ",a?.symbol||"â"]})]}),(0,t.jsxs)("label",{className:"block",children:[(0,t.jsx)("span",{className:"text-[11px] font-semibold uppercase tracking-[0.08em] text-white/40",children:"Pay with"}),(0,t.jsx)(z.CustomSelect,{ariaLabel:"Pay with",value:a?.mint??"",onValueChange:e.setSettlementMint,disabled:b||l.length<=1,options:l.map(e=>({value:e.mint,label:e.symbol})),triggerClassName:"mt-1 min-h-11 rounded-xl border-white/8 bg-white/[0.04] px-3 text-sm font-bold text-white hover:border-white/15 hover:bg-white/[0.07] focus-visible:ring-emerald-400/70 disabled:opacity-70"})]})]}),"quoting"===u?(0,t.jsxs)("div",{className:"mt-4 flex min-h-40 flex-col items-center justify-center rounded-2xl border border-white/8 bg-white/[0.025] text-center",children:[(0,t.jsx)(j.Loader2,{className:"h-6 w-6 animate-spin text-emerald-300 motion-reduce:animate-none"}),(0,t.jsx)("p",{className:"mt-3 text-sm font-semibold text-white",children:"Loading live quote"}),(0,t.jsx)("p",{className:"mt-1 text-xs text-white/45",children:"Checking route, fees, balance, and account readiness."})]}):i?(0,t.jsx)("div",{className:"mt-4 overflow-hidden rounded-2xl border border-white/8 bg-white/[0.025]",children:(0,t.jsxs)("dl",{className:"divide-y divide-white/7",children:[[["Expected receive",v],["Minimum receive",y],["Base fee",K(i.signatureFeeUpperBoundUsd)],["Commission",K(i.commissionFeeUsd)],["Network fee",K(i.estimatedNetworkFeeUsd)],["Slippage limit",`${(i.slippageBps/100).toFixed(2)}%`]].map(([e,r])=>(0,t.jsxs)("div",{className:"flex min-h-11 items-center justify-between gap-4 px-3 py-2.5 text-xs",children:[(0,t.jsx)("dt",{className:"text-white/45",children:e}),(0,t.jsx)("dd",{className:"max-w-[65%] truncate text-right font-semibold tabular-nums text-white",children:r})]},e)),(0,t.jsxs)("div",{className:"flex min-h-11 items-center justify-between gap-4 px-3 py-2.5 text-xs",children:[(0,t.jsx)("dt",{className:"text-white/45",children:"Quote expires"}),(0,t.jsx)("dd",{className:"font-semibold tabular-nums text-white",children:(0,t.jsx)(Q,{expiresAt:i.quoteExpiresAt,nowMs:h})})]})]})}):null,c?(0,t.jsxs)("div",{className:"mt-3 flex gap-2 rounded-xl border border-amber-400/20 bg-amber-400/[0.07] px-3 py-3 text-xs leading-5 text-amber-100",children:[(0,t.jsx)(D.AlertTriangle,{className:"mt-0.5 h-4 w-4 shrink-0 text-amber-300","aria-hidden":"true"}),(0,t.jsx)("span",{children:c})]}):null,d?(0,t.jsxs)("div",{className:"mt-3 flex gap-2 rounded-xl border border-rose-400/20 bg-rose-400/[0.07] px-3 py-3 text-xs leading-5 text-rose-100",children:[(0,t.jsx)(D.AlertTriangle,{className:"mt-0.5 h-4 w-4 shrink-0 text-rose-300","aria-hidden":"true"}),(0,t.jsx)("span",{className:"whitespace-pre-line",children:d})]}):null,m||"submitted"===u||"executing"===u?(0,t.jsxs)("div",{className:(0,T.cn)("mt-4 flex items-center gap-3 rounded-2xl border px-3 py-3","success"===w?"border-emerald-400/20 bg-emerald-400/[0.06]":"error"===w?"border-rose-400/20 bg-rose-400/[0.06]":"border-cyan-400/20 bg-cyan-400/[0.06]"),children:["success"===w?(0,t.jsx)(g.CheckCircle2,{className:"h-5 w-5 shrink-0 text-emerald-300","aria-hidden":"true"}):"error"===w?(0,t.jsx)(D.AlertTriangle,{className:"h-5 w-5 shrink-0 text-rose-300","aria-hidden":"true"}):(0,t.jsx)(j.Loader2,{className:"h-5 w-5 shrink-0 animate-spin text-cyan-300 motion-reduce:animate-none","aria-hidden":"true"}),(0,t.jsxs)("div",{className:"min-w-0",children:[(0,t.jsx)("p",{className:"text-sm font-semibold text-white",children:"executing"===u?"Submitting swap":`Swap ${m?.status||"submitted"}`}),(0,t.jsx)("p",{className:"mt-0.5 text-xs text-white/45",children:m?`Swap #${m.id} \xb7 ${m.provider}`:"Waiting for the first chain status update."})]})]}):i&&!c?(0,t.jsxs)("div",{className:"mt-3 flex items-center gap-2 text-[11px] text-white/45",children:[(0,t.jsx)(B.ShieldCheck,{className:"h-4 w-4 text-emerald-300","aria-hidden":"true"}),"The swap is submitted only after you confirm this quote."]}):null]}),(0,t.jsxs)(V.SheetFooter,{className:"flex-row border-t border-white/8 px-4 py-4 sm:px-5",children:[(0,t.jsx)(O.Button,{type:"button",variant:"outline",size:"lg",className:"min-h-11 flex-1 rounded-xl border-white/10 bg-transparent text-white hover:bg-white/[0.05]",onClick:()=>e.setOpen(!1),disabled:"executing"===u,children:"submitted"===u||"completed"===u||"failed"===u?"Close"
1:"Cancel"}),f||!i&&"quoting"!==u?(0,t.jsxs)(O.Button,{type:"button",size:"lg",className:"min-h-11 flex-1 rounded-xl bg-emerald-400 font-bold text-black hover:bg-emerald-300",onClick:()=>{e.refreshQuote()},disabled:b,children:["quoting"===u?(0,t.jsx)(j.Loader2,{className:"mr-2 h-4 w-4 animate-spin"}):(0,t.jsx)(q.RefreshCw,{className:"mr-2 h-4 w-4"}),"Refresh quote"]}):"review"===u?(0,t.jsx)(O.Button,{type:"button",size:"lg",className:"min-h-11 flex-1 rounded-xl bg-emerald-400 font-bold text-black hover:bg-emerald-300",onClick:()=>{e.confirmBuy()},disabled:!i||!!c||b,children:"Confirm buy"}):null]})]})})}var X=e.i(857661),W=e.i(295107),Z=e.i(24917),Y=e.i(204311);let J=(0,Y.default)("circle-dot",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["circle",{cx:"12",cy:"12",r:"1",key:"41hilf"}]]);var ee=e.i(352122),et=e.i(683912);let er=(0,Y.default)("pickaxe",[["path",{d:"m14 13-8.381 8.38a1 1 0 0 1-3.001-3L11 9.999",key:"1lw9ds"}],["path",{d:"M15.973 4.027A13 13 0 0 0 5.902 2.373c-1.398.342-1.092 2.158.277 2.601a19.9 19.9 0 0 1 5.822 3.024",key:"ffj4ej"}],["path",{d:"M16.001 11.999a19.9 19.9 0 0 1 3.024 5.824c.444 1.369 2.26 1.676 2.603.278A13 13 0 0 0 20 8.069",key:"8tj4zw"}],["path",{d:"M18.352 3.352a1.205 1.205 0 0 0-1.704 0l-5.296 5.296a1.205 1.205 0 0 0 0 1.704l2.296 2.296a1.205 1.205 0 0 0 1.704 0l5.296-5.296a1.205 1.205 0 0 0 0-1.704z",key:"hh6h97"}]]),en=(0,Y.default)("rocket",[["path",{d:"M4.5 16.5c-1.5 1.26-2 5-2 5s3.74-.5 5-2c.71-.84.7-2.13-.09-2.91a2.18 2.18 0 0 0-2.91-.09z",key:"m3kijz"}],["path",{d:"m12 15-3-3a22 22 0 0 1 2-3.95A12.88 12.88 0 0 1 22 2c0 2.72-.78 7.5-6 11a22.35 22.35 0 0 1-4 2z",key:"1fmvmk"}],["path",{d:"M9 12H4s.55-3.03 2-4c1.62-1.08 5 0 5 0",key:"1f8sc4"}],["path",{d:"M12 15v5s3.03-.55 4-2c1.08-1.62 0-5 0-5",key:"qeys4"}]]),es=(0,Y.default)("user-round-cog",[["path",{d:"m14.305 19.53.923-.382",key:"3m78fa"}],["path",{d:"m15.228 16.852-.923-.383",key:"npixar"}],["path",{d:"m16.852 15.228-.383-.923",key:"5xggr7"}],["path",{d:"m16.852 20.772-.383.924",key:"dpfhf9"}],["path",{d:"m19.148 15.228.383-.923",key:"1reyyz"}],["path",{d:"m19.53 21.696-.382-.924",key:"1goivc"}],["path",{d:"M2 21a8 8 0 0 1 10.434-7.62",key:"1yezr2"}],["path",{d:"m20.772 16.852.924-.383",key:"htqkph"}],["path",{d:"m20.772 19.148.924.383",key:"9w9pjp"}],["circle",{cx:"10",cy:"8",r:"5",key:"o932ke"}],["circle",{cx:"18",cy:"18",r:"3",key:"1xkwt0"}]]);var ei=e.i(325879),ea=e.i(364172);async function el(e,t,r,n){let s,i=new URLSearchParams({chainId:e,tokenAddresses:t.join(",")});for(let e=1;e<=2;e+=1)try{let e=await n(`/api/crypto/memecoins/explorer/enrichment?${i.toString()}`,{cache:"no-store",signal:r,headers:{Accept:"application/json"}}),t=await e.json().catch(()=>null);if(!e.ok||!t||!0!==t.ok)throw Error(t&&!1===t.ok?t.error:"Failed to load memecoin explorer enrichment");return t}catch(t){if(r?.aborted)throw t;s=t,e<2&&await function(e,t){return t?.aborted?Promise.reject(t.reason):new Promise((e,r)=>{let n=window.setTimeout(()=>{t?.removeEventListener("abort",s),e()},400),s=()=>{window.clearTimeout(n),r(t?.reason)};t?.addEventListener("abort",s,{once:!0})})}(0,r)}throw s instanceof Error?s:Error("Failed to load memecoin explorer enrichment")}async function eo({chainId:e,tokenAddresses:t,signal:r,fetcher:n=fetch,onBatch:s}){let i=Array.from(new Set(t.filter(Boolean))),a=[];for(let t=0;t<i.length;t+=8){let l=i.slice(t,t+8);try{let t=await el(e,l,r,n);if(r?.aborted)throw r.reason;s(t,l)}catch(e){if(r?.aborted)throw e;a.push(...l)}}return{failedTokenAddresses:a}}var ec=e.i(746798);function ed(e){let t="robinhood-mainnet"===e.chainId?e.tokenAddress.toLowerCase():e.tokenAddress;return`${e.stage}:${t}`}function em(e){return[...e.columns.new,...e.columns.almostBonded,...e.columns.migrated]}function eu(e){return[e.progressPct,e.marketCapUsd,e.volumeUsd,e.totalTxns,e.buyTxns,e.sellTxns,e.risk.level].join("|")}function eh(e,t){return"robinhood-mainnet"===e?t.toLowerCase():t}function ex(e){return null!=e&&Number.isFinite(e)?`${e.toFixed(1).replace(/\.0$/,"")}%`:"â"}function eb(e,t,r){return null==e?"border-white/8 bg-white/[0.035] text-white/55":e>r?"border-rose-400/20 bg-rose-400/8 text-rose-300":e>t?"border-amber-400/20 bg-amber-400/8 text-amber-300":"border-emerald-400/20 bg-emerald-400/8 text-emerald-300"}function ep({icon:e,label:r,value:n,tooltip:s,tone:i,loading:a}){let l=a&&"â"===n?"â¦":n;return(0,t.jsxs)(ec.Tooltip,{children:[(0,t.jsx)(ec.TooltipTrigger,{asChild:!0,children:(0,t.jsxs)("span",{tabIndex:0,"aria-label":`${r}: ${l}`,className:(0,T.cn)("relative z-20 inline-flex min-h-11 items-center justify-between gap-1 rounded-lg border px-2.5 py-1 text-[11px] font-semibold leading-none tabular-nums xl:min-h-6 xl:justify-start xl:rounded-md xl:px-1.5 xl:text-[10px]","focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-emerald-300/70",i),children:[(0,t.jsx)(e,{className:"h-3 w-3 shrink-0","aria-hidden":"true"}),(0,t.jsx)("span",{children:r}),(0,t.jsx)("span",{className:"font-bold",children:l})]})}),(0,t.jsx)(ec.TooltipContent,{side:"top",className:"max-w-64",children:s})]})}function ef({chainId:e,enrichment:r,loading:n}){let s=(0,X.useTranslations)("MemecoinTrenches"),i=r?.holders.holderCount??null,a=r?.holders.top10HolderPct??null,o=r?.security.devHoldingPct??null,c=r?.security.contractVerified,d=s("robinhood-mainnet"===e?"top10Raw":"top10");return(0,t.jsxs)("div",{className:"mt-2.5 grid grid-cols-2 gap-2 xl:flex xl:flex-wrap xl:gap-1.5","aria-label":s("tokenMetrics"),children:[(0,t.jsx)(ep,{icon:ei.Users,label:s("holders"),value:null==i?"â":(0,l.formatCompactCount)(i),tooltip:s("holdersTooltip"),tone:null==i?"border-white/8 bg-white/[0.035] text-white/55":"border-cyan-400/20 bg-cyan-400/8 text-cyan-300",loading:n}),(0,t.jsx)(ep,{icon:ee.Crown,label:d,value:ex(a),tooltip:s("robinhood-mainnet"===e?"top10RawTooltip":"top10Tooltip"),tone:eb(a,40,60),loading:n}),(0,t.jsx)(ep,{icon:es,label:s("dev"),value:ex(o),tooltip:s("robinhood-mainnet"===e?"devRobinhoodTooltip":"devTooltip"),tone:eb(o,10,20),loading:n}),(0,t.jsx)(ep,{icon:Z.BadgeCheck,label:s("verified"),value:null==c?"â":s(c?"yes":"no"),tooltip:s("robinhood-mainnet"===e?"verifiedRobinhoodTooltip":"verifiedSolanaTooltip"),tone:null==c?"border-white/8 bg-white/[0.035] text-white/55":c?"border-emerald-400/20 bg-emerald-400/8 text-emerald-300":"border-amber-400/20 bg-amber-400/8 text-amber-300",loading:n})]})}function eg({item:e}){let r=(0,X.useTranslations)("MemecoinTrenches"),n=null==e.progressPct?null:Math.min(100,Math.max(0,e.progressPct)),s=null==n?null:`${n.toFixed(1).replace(/\.0$/,"")}%`;return(0,t.jsxs)("div",{className:"relative h-[3.625rem] w-[3.25rem] shrink-0","aria-label":s?r("bondingProgress",{progress:s}):void 0,children:[(0,t.jsxs)("div",{className:"absolute left-1/2 top-0 h-[3.25rem] w-[3.25rem] -translate-x-1/2",children:[(0,t.jsxs)("svg",{className:"pointer-events-none absolute inset-0 h-full w-full -rotate-90",viewBox:"0 0 52 52","aria-hidden":"true",children:[(0,t.jsx)("rect",{x:"1.5",y:"1.5",width:"49",he
1ight:"49",rx:"12",fill:"none",stroke:"currentColor",strokeWidth:"3",pathLength:"100",className:"text-white/10"}),null!=n?(0,t.jsx)("rect",{x:"1.5",y:"1.5",width:"49",height:"49",rx:"12",fill:"none",stroke:"currentColor",strokeWidth:"3",pathLength:"100",strokeDasharray:`${n} 100`,strokeLinecap:"round",className:"text-emerald-400 transition-[stroke-dasharray] duration-700 motion-reduce:transition-none"}):null]}),(0,t.jsx)("div",{className:"absolute inset-1 flex items-center justify-center overflow-hidden rounded-[0.625rem] bg-white/5",children:e.imageUrl?(0,t.jsx)("img",{src:e.imageUrl,alt:r("logoAlt",{name:e.name}),className:"h-full w-full object-cover",loading:"lazy",decoding:"async"}):(0,t.jsx)("span",{className:"text-[10px] font-bold text-white",children:e.symbol.slice(0,4)})})]}),s?(0,t.jsx)("span",{className:"absolute bottom-0 left-1/2 z-10 -translate-x-1/2 whitespace-nowrap rounded-full border border-emerald-300/25 bg-emerald-950 px-1.5 py-0.5 text-[10px] font-bold leading-none tabular-nums text-emerald-300 shadow-sm",children:s}):null]})}function ew({item:e,now:r,brand:n,recentlyAdded:s,recentlyUpdated:i,enrichment:a,enrichmentLoading:o}){let c=(0,X.useTranslations)("MemecoinTrenches"),d=(0,X.useFormatter)(),m="pumpfun_read_model"===e.stageSource?"Pump":"hoodfun_read_model"===e.stageSource?"hood.fun":null,h=m?(0,t.jsx)("a",{href:e.links.detailUrl,target:"_blank",rel:"noreferrer",className:"relative z-20 inline-flex min-h-11 touch-manipulation items-center rounded-lg bg-emerald-400/10 px-3 font-semibold text-emerald-300 transition-colors hover:bg-emerald-400/15 focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-emerald-300 xl:min-h-8",children:m}):(0,t.jsx)(u.default,{href:e.links.detailUrl,className:"relative z-20 inline-flex min-h-11 touch-manipulation items-center rounded-lg bg-emerald-400/10 px-3 font-semibold text-emerald-300 transition-colors hover:bg-emerald-400/15 focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-emerald-300 xl:min-h-8",children:c("details")}),x=s||i,b=(0,l.buildMemecoinTradeHref)(e.chainId,e.tokenAddress);return(0,t.jsxs)("div",{className:(0,T.cn)("relative",s&&"ui-live-item-enter",i&&"ui-live-metric-update"),children:[(0,t.jsx)("div",{className:(0,T.cn)("ui-market-card-refresh-shell rounded-xl",`refresh-brand-${n}`,x?"scale-100 opacity-100":"pointer-events-none scale-[0.985] opacity-0"),"aria-hidden":"true"}),(0,t.jsxs)("article",{className:"ui-trench-row relative z-0 border-b border-white/6 p-3.5 last:border-b-0 hover:bg-white/[0.025] focus-within:bg-white/[0.025]",children:[(0,t.jsx)(u.default,{href:b,"aria-label":`Open ${e.symbol} trade panel`,className:"absolute inset-0 z-10 cursor-pointer rounded-lg focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-emerald-400/70"}),(0,t.jsxs)("div",{className:"flex gap-3",children:[(0,t.jsx)(eg,{item:e}),(0,t.jsxs)("div",{className:"min-w-0 flex-1","data-trench-token-details":!0,children:[(0,t.jsxs)("div",{className:"flex items-start justify-between gap-2",children:[(0,t.jsxs)("div",{className:"flex min-w-0 items-center gap-1.5",children:[(0,t.jsx)("span",{className:"truncate text-sm font-bold text-white",children:e.symbol}),(0,t.jsx)("span",{className:"truncate text-xs font-medium text-white/80",children:e.name})]}),(0,t.jsx)("span",{className:`h-fit shrink-0 rounded-full px-2 py-1 text-[11px] font-bold ${"HIGH"===e.risk.level?"bg-rose-400/10 text-rose-300":"bg-white/8 text-white/80"}`,children:e.risk.level})]}),(0,t.jsxs)("div",{className:"mt-1 flex flex-wrap items-center gap-x-2 gap-y-1 text-xs text-white/75",children:[(0,t.jsx)("span",{className:"text-emerald-300",children:e.createdAt?d.relativeTime(e.createdAt,r):c("live")}),(0,t.jsxs)("span",{children:["MC ",(0,A.formatCompactUsd)(e.marketCapUsd)]}),(0,t.jsxs)("span",{children:["TX ",(0,l.formatCompactCount)(e.totalTxns)]}),(0,t.jsx)("span",{className:"hidden sm:inline",children:(0,l.shortAddress)(e.creator)})]}),(0,t.jsx)(ef,{chainId:e.chainId,enrichment:a,loading:o})]})]}),(0,t.jsxs)("div",{className:"mt-3 flex items-center justify-between text-xs",children:[(0,t.jsx)("span",{className:"font-medium text-white/75",children:e.launchPlatform}),(0,t.jsxs)("div",{className:"relative z-20 flex items-center gap-2",children:[h,e.links.externalUrl&&e.links.externalUrl!==e.links.detailUrl?(0,t.jsx)("a",{href:e.links.externalUrl,target:"_blank",rel:"noreferrer","aria-label":c("openExternally",{symbol:e.symbol}),className:"inline-flex h-11 w-11 touch-manipulation items-center justify-center rounded-lg bg-white/8 text-white/80 transition-colors hover:bg-white/12 focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-white",children:(0,t.jsx)(W.ArrowUpRight,{className:"h-4 w-4"})}):null]})]})]})]})}function ev(e){let r=e.icon,n=e.items.some(t=>e.recentlyAddedKeys.has(ed(t))||e.recentlyUpdatedKeys.has(ed(t)));return(0,t.jsxs)("div",{className:(0,T.cn)("ui-live-item-enter relative min-w-0",e.className),style:{animationDelay:`${e.entryDelayMs}ms`},children:[(0,t.jsx)("div",{className:(0,T.cn)("ui-market-card-refresh-shell rounded-2xl",`refresh-brand-${e.brand}`,e.refreshing?"scale-100 opacity-100":"pointer-events-none scale-[0.985] opacity-0"),"aria-hidden":"true"}),(0,t.jsxs)("section",{className:"relative z-0 overflow-hidden rounded-2xl border border-white/8 bg-terminal-surface",children:[(0,t.jsxs)("header",{className:"flex items-center gap-3 border-b border-white/7 bg-white/[0.02] px-4 py-3.5",children:[(0,t.jsx)("div",{className:"rounded-lg bg-amber-400/10 p-2 text-amber-300",children:(0,t.jsx)(r,{className:"h-4 w-4"})}),(0,t.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,t.jsx)("h2",{className:"text-xs font-bold text-white",children:e.title}),(0,t.jsx)("p",{className:"mt-0.5 text-[11px] font-medium text-white/75",children:e.subt
1itle})]}),(0,t.jsx)("span",{className:(0,T.cn)("rounded-full bg-white/6 px-2 py-1 text-[10px] font-bold tabular-nums text-white/70",n&&"ui-live-badge-pop text-emerald-300"),children:e.items.length})]}),e.items.length?(0,t.jsx)("div",{children:e.items.map(r=>{let n=eh(r.chainId,r.tokenAddress);return(0,t.jsx)(ew,{item:r,now:e.now,brand:e.brand,recentlyAdded:e.recentlyAddedKeys.has(ed(r)),recentlyUpdated:e.recentlyUpdatedKeys.has(ed(r)),enrichment:e.enrichmentByTokenAddress.get(n),enrichmentLoading:e.enrichmentPendingTokenAddresses.has(n)},ed(r))})}):(0,t.jsx)("div",{className:"flex min-h-48 items-center justify-center p-5 text-center text-xs font-medium leading-5 text-white/75",children:e.empty})]})]})}function ey({chainId:e,initialPayload:n,initialNow:s}){let[i,a]=(0,r.useState)(()=>s??Date.now());(0,r.useEffect)(()=>(0,ea.startVisibleRefreshInterval)(()=>a(Date.now()),1e4),[]);let l=(0,X.useTranslations)("MemecoinTrenches"),o=n?.chainId===e?n:null,[c,d]=(0,r.useState)("new"),[m,u]=(0,r.useState)(o),[h,x]=(0,r.useState)(null),[b,p]=(0,r.useState)(null==o),[f,g]=(0,r.useState)(!1),[w,v]=(0,r.useState)([]),[y,j]=(0,r.useState)([]),[k,N]=(0,r.useState)(()=>new Map),[S,C]=(0,r.useState)(()=>new Set),A=(0,r.useRef)(null),M=(0,r.useRef)(null),R=m?Array.from(new Set(em(m).map(t=>eh(e,t.tokenAddress)))).sort().join(","):"";if((0,r.useEffect)(()=>{let t=new AbortController,r=o,n=!1;async function s(i=!1){if(!n){n=!0,i&&g(!0);try{let n=await fetch(`/api/crypto/memecoins/trenches?chainId=${encodeURIComponent(e)}&limit=8`,{cache:"no-store",signal:t.signal,headers:{Accept:"application/json"}}),s=await n.json().catch(()=>null);if(!n.ok||!s||!0!==s.ok)throw Error(s&&!1===s.ok?s.error:l("loadFailed"));if(t.signal.aborted)return;if(i&&r){let e=new Map(em(r).map(e=>[ed(e),e])),t=em(s),n=t.map(ed).filter(t=>!e.has(t)),i=t.filter(t=>{let r=e.get(ed(t));return null!=r&&eu(r)!==eu(t)}).map(ed);n.length&&(v(n),null!=A.current&&window.clearTimeout(A.current),A.current=window.setTimeout(()=>{v([]),A.current=null},ea.MEMECOIN_NEW_ITEM_HIGHLIGHT_MS)),i.length&&(j(i),null!=M.current&&window.clearTimeout(M.current),M.current=window.setTimeout(()=>{j([]),M.current=null},ea.MEMECOIN_ROW_UPDATE_HIGHLIGHT_MS))}r=s,u(s),x(null)}catch(e){t.signal.aborted||i||x(e instanceof Error?e.message:String(e))}finally{n=!1,!t.signal.aborted&&(p(!1),i&&g(!1))}}}p(null==o),g(!1),x(null),u(o),v([]),j([]),o||s();let i=(0,ea.startVisibleRefreshInterval)(()=>{s(!0)});return()=>{i(),t.abort(),null!=A.current&&(window.clearTimeout(A.current),A.current=null),null!=M.current&&(window.clearTimeout(M.current),M.current=null)}},[e,o,l]),(0,r.useEffect)(()=>{N(new Map),C(new Set),d("new")},[e]),(0,r.useEffect)(()=>{if(!R)return;let t=R.split(","),r=new AbortController,n=!1;async function s(){if(!n){n=!0,C(e=>new Set([...e,...t]));try{let{failedTokenAddresses:n}=await eo({chainId:e,tokenAddresses:t,signal:r.signal,onBatch:(t,n)=>{r.signal.aborted||(N(r=>{let n=new Map(r);for(let r of t.items)n.set(eh(e,r.tokenAddress),r);return n}),C(t=>{let r=new Set(t);for(let t of n)r.delete(eh(e,t));return r}))}});C(t=>{let r=new Set(t);for(let t of n)r.delete(eh(e,t));return r})}catch{r.signal.aborted||C(r=>{let n=new Set(r);for(let r of t)n.delete(eh(e,r));return n})}finally{n=!1}}}s();let i=(0,ea.startVisibleRefreshInterval)(()=>{s()},ea.MEMECOIN_ENRICHMENT_REFRESH_INTERVAL_MS);return()=>{i(),r.abort()}},[e,R]),b)return(0,t.jsxs)("section",{role:"status","aria-label":l("loading"),className:"overflow-hidden rounded-2xl border border-white/8 bg-terminal-surface",children:[(0,t.jsxs)("div",{className:"flex items-center gap-3 border-b border-white/8 px-4 py-4",children:[(0,t.jsx)(E.Skeleton,{className:"h-9 w-9 rounded-lg bg-white/8 motion-reduce:animate-none"}),(0,t.jsxs)("div",{className:"flex-1",children:[(0,t.jsx)(E.Skeleton,{className:"h-4 w-32 bg-white/8 motion-reduce:animate-none"}),(0,t.jsx)(E.Skeleton,{className:"mt-2 h-3 w-48 max-w-full bg-white/8 motion-reduce:animate-none"})]})]}),(0,t.jsx)("div",{className:"space-y-px",children:[0,1,2].map(e=>(0,t.jsxs)("div",{className:"flex gap-3 border-b border-white/6 p-3.5 last:border-b-0",children:[(0,t.jsx)(E.Skeleton,{className:"h-[3.25rem] w-[3.25rem] shrink-0 rounded-xl bg-white/8 motion-reduce:animate-none"}),(0,t.jsxs)("div",{className:"flex-1",children:[(0,t.jsx)(E.Skeleton,{className:"h-4 w-36 bg-white/8 motion-reduce:animate-none"}),(0,t.jsx)(E.Skeleton,{className:"mt-2 h-3 w-48 max-w-full bg-white/8 motion-reduce:animate-none"}),(0,t.jsxs)("div",{className:"mt-3 grid grid-cols-2 gap-2",children:[(0,t.jsx)(E.Skeleton,{className:"h-11 rounded-lg bg-white/8 motion-reduce:animate-none"}),(0,t.jsx)(E.Skeleton,{className:"h-11 rounded-lg bg-white/8 motion-reduce:animate-none"})]})]})]},e))}),(0,t.jsx)("span",{className:"sr-only",children:l("loading")})]});if(h)return(0,t.jsx)("div",{role:"alert",className:"rounded-2xl border border-rose-400/20 bg-rose-400/5 p-5 text-sm text-rose-300",children:h});if(!m)return null;let L="solana-mainnet"===e?l("migrated"):l("livePools"),_="solana-mainnet"===e?"solana":"robinhood",U=new Set(w),P=new Set(y);return(0,t.jsx)(ec.TooltipProvider,{children:(0,t.jsxs)("section",{className:"space-y-3","aria-busy":f,children:[(0,t.jsxs)("div",{className:"memecoin-lifecycle-banner ui-live-item-enter flex items-start justify-between gap-3 rounded-2xl border border-white/8 p-4",children:[(0,t.jsxs)("div",{className:"flex min-w-0 items-start gap-3",children:[(0,t.jsx)(er,{className:"mt-0.5 h-5 w-5 shrink-0 text-amber-300"}),(0,t.jsxs)("div",{children:[(0,t.jsx)("h2",{className:"text-sm font-bold text-white",children:l("title")}),(0,t.jsx)("p",{className:"mt-1 hidden text-xs font-medium leading-5 text-white/75 sm:block",children:"solana-mainnet"===e?l("solanaDescription"):l("robinhoodDescription")})]})]}),(0,t.jsxs)("div",{className:"flex shrink-0 items-center gap-2 rounded-full border border-emerald-400/15 bg-emerald-400/7 px-2.5 py-1.5 text-[10px] font-bold text-emerald-300","aria-label":f?l("boardRefreshing"):l("boardLive"),children:[(0,t.jsxs)("span",{className:"relative flex h-2 w-2",children:[f?(0,t.jsx)("span",{className:"ui-live-status-pulse absolute inset-0 rounded-full bg-emerald-300","aria-hidden":"true"}):null,(0,t.jsx)("span",{className:"relative h-2 w-2 rounded-full bg-emerald-400","aria-hidden":"true"})]}),f?l("refreshing"):l("live")]})]}),(0,t.jsx)("div",{role:"group",className:"grid grid-cols-3 gap-2 rounded-2xl border border-white/8 bg-terminal-surface p-1.5 xl:hidden","aria-label":"Trenches lifecycle stages",children:[["new",l("new"),m.columns.new.length],["almostBonded",l("almostBonded"),m.columns.almostBonded.length],["migrated",L,m.columns.migrated.length]].map(([e,r,n])=>(0,t.jsxs)("button",{type:"button","aria-pressed":c===e,onClick:()=>d(e),className:(0,T.cn)("flex min-h-11 touch-manipulation items-center justify-center gap-1.5 rounded-xl px-2 text-xs font-bold transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-emerald-400/70",c===e?"bg-terminal-surface-raised text-white":"text-white/65 active:bg-white/[0.05]"),children:[(0,t.jsx)("span",{className:"truncate",children:r}),(0,t.jsx)("span",{className:"rounded-full bg-white/8 px-1.5 py-0.5 text-[10px] tabular-nums text-white/75",children:n})]},e))}),(0,t.jsxs)("div",{className:"grid gap-3 xl:grid-cols-3",children:[(0,t.jsx)(ev,{now:i,className:"new"===c?void 0:"hidden xl:block",title:l("new"),subtitle:l("newSubtitle"),icon:J,items:m.columns.new,empty:l("newEmpty"),brand:_,refreshing:f,recentlyAddedKeys:U,recentlyUpdatedKeys:P,enrichmentByTokenAddress:k,enrichmentPendingTokenAddresses:S,entryDelayMs:50}),(0,t.jsx)(ev,{now:i,className:"almostBonded"===c?void 0:"hidden xl:block",title:l("almostBonded"),subtitle:l("almostSubtitle"),icon:et.Gauge,items:m.columns.almostBonded,empty:l("almostEmpty"),brand:_,refreshing:f,recentlyAddedKeys:U,recentlyUpdatedKeys:P,enrichmentByTokenAddress:k,enrichmentPendingTokenAddresses:S,entryDelayMs:110}),(0,t.jsx)(ev,{now:i,className:"migrated"===c?void 0:"hidden xl:block",title:L,subtitle:"solana-mainnet"===e?l("migratedSubtitle"):l("livePoolsSubtitle"),icon:en,items:m.columns.migrated,empty:l("migratedEmpty"),brand:_,refreshing:f,recentlyAddedKeys:U,recentlyUpdatedKeys:P,enrichmentByTokenAddress:k,enrichmentPendingTokenAddresses:S,entryDelayMs:170})]})]})})}function ej(e,t){t.tradable&&t.tradeUrl?e.push(t.tradeUrl):window.open(t.pumpUrl,"_blank","noopener,noreferrer")}function ek(e){let r=(0,s.useRouter)(),n=new Set(e.recentlyAddedMints);return(0,t.jsxs)("div",{className:"relative min-w-0",children:[(0,t.jsx)("div",{className:(0,T.cn)("ui-market-card-refresh-shell refresh-brand-solana rounded-xl",e.isRefreshing?"scale-100 opacity-100":"pointer-events-none scale-[0.985] opacity-0"),"aria-hidden":"true"}),(0,t.jsxs)("section",{className:"ui-panel-strong relative z-0 overflow-hidden border-border/50 p-0",children:[(0,t.jsx)("div",{className:"flex items-center justify-between border-b border-border/40 bg-card/40 px-5 py-4",children:(0,t.jsxs)("div",{children:[(0,t.jsx)("div",{className:"text-sm font-semibold text-foreground",children:e.title}),(0,t.jsx)("div",{className:"mt-1 text-xs text-white/80",children:e.subt
1itle})]})}),e.isLoading?(0,t.jsxs)("div",{className:"flex min-h-[360px] items-center justify-center text-sm text-muted-foreground",children:[(0,t.jsx)(j.Loader2,{className:"mr-2 h-4 w-4 animate-spin"}),"Loading pump live streams..."]}):e.error?(0,t.jsx)("div",{className:"p-4 text-sm text-rose-300",children:e.error}):(0,t.jsx)("div",{children:e.items.map(s=>{let i=n.has(s.mint);return(0,t.jsxs)("div",{role:"button",tabIndex:0,onClick:()=>ej(r,s),onKeyDown:e=>{("Enter"===e.key||" "===e.key)&&(e.preventDefault(),ej(r,s))},className:(0,T.cn)("group relative grid cursor-pointer grid-cols-[auto_1fr_auto] gap-4 border-b border-border/20 px-5 py-4 transition-colors hover:bg-card/60",i&&"ui-live-item-enter"),children:[(0,t.jsx)("div",{className:(0,T.cn)("ui-market-card-refresh-shell refresh-brand-solana rounded-xl",i?"scale-100 opacity-100":"pointer-events-none scale-[0.985] opacity-0"),"aria-hidden":"true"}),(0,t.jsx)("div",{className:"flex h-14 w-14 shrink-0 items-center justify-center overflow-hidden rounded-xl bg-secondary ring-1 ring-border/50",children:s.imageUrl?(0,t.jsx)("img",{src:s.imageUrl,alt:s.symbol,width:56,height:56,loading:"lazy",decoding:"async",className:"h-full w-full object-cover"}):(0,t.jsx)("span",{className:"text-xs font-bold text-foreground",children:s.symbol.slice(0,4)})}),(0,t.jsxs)("div",{className:"min-w-0",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)("span",{className:"truncate text-sm font-bold text-foreground",children:s.symbol}),(0,t.jsx)("span",{className:"truncate text-xs text-white/80",children:s.name}),(0,t.jsx)("span",{className:`rounded-full px-2 py-0.5 text-[10px] font-semibold ${s.tradable?"border border-emerald-500/25 bg-emerald-500/10 text-emerald-300":"border border-border/40 bg-card/60 text-slate-200"}`,children:s.tradable?"Tradable":"External"})]}),(0,t.jsx)("div",{className:"mt-1 line-clamp-2 text-[12px] text-slate-200",children:s.description||"Live Pump launch stream token."}),(0,t.jsxs)("div",{className:"mt-2 flex flex-wrap items-center gap-x-3 gap-y-1 text-[11px] font-medium text-white/80",children:[(0,t.jsx)("span",{className:"text-emerald-400",children:s.createdAt?(0,A.formatAge)(s.createdAt):"live"}),(0,t.jsxs)("span",{children:["MC ",(0,A.formatCompactUsd)(s.marketCapUsd)]}),(0,t.jsxs)("span",{children:["Replies ",(0,l.formatCompactCount)(s.replyCount)]}),(0,t.jsxs)("span",{children:["Creator ",(0,l.shortAddress)(s.creator)]})]})]}),(0,t.jsx)("div",{className:"flex items-center justify-end",children:(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[s.tradable&&s.tradeUrl?(0,t.jsx)(u.default,{href:s.tradeUrl,onClick:e=>e.stopPropagation(),className:"inline-flex items-center gap-1 rounded-full border border-emerald-500/25 bg-emerald-500/10 px-3 py-1 text-[11px] font-semibold text-emerald-300 transition-colors hover:bg-emerald-500/15",children:"Trade"}):null,(0,t.jsxs)("a",{href:s.pumpUrl,target:"_blank",rel:"noreferrer",onClick:e=>e.stopPropagation(),className:"inline-flex items-center gap-1 rounded-full border border-border/40 bg-card/60 px-3 py-1 text-[11px] font-semibold text-slate-200 transition-colors hover:text-foreground",children:["Pump ",(0,t.jsx)(W.ArrowUpRight,{className:"h-3.5 w-3.5"})]})]})})]},`${e.title}-${s.mint}`)})})]})]})}var eN=e.i(799766),eS=e.i(629930),eE=e.i(788152),eC=e.i(673635),eA=e.i(585191),eT=e.i(965716);e.i(410722);var eM=e.i(855277),eR=e.i(286729),eL=e.i(261920);let e_={SOL:["0.01","0.05","0.1","0.5"],ETH:["0.001","0.005","0.01","0.05"],USDC:["5","10","25","50"],USDG:["5","10","25","50"]};function eU(e,t){let r=t?.symbol.trim().toUpperCase();return r&&e_[r]?e_[r]:"robinhood-mainnet"===e?e_.ETH:e_.SOL}function eP(e,t){let r="robinhood-mainnet"===t?"ETH":"SOL";return e.find(e=>e.symbol.trim().toUpperCase()===r)??e.find(e=>e.isNative)??e[0]??null}async function e$(e,t){let r=new URLSearchParams({tokenAddress:e.tokenAddress,chainId:t}),n=await fetch(`/api/crypto/memecoins/detail?${r.toString()}`,{cache:"no-store",headers:{Accept:"application/json"}}),s=await n.json().catch(()=>null);if(!n.ok||!s||!0!==s.ok)throw Error(s&&!1===s.ok?s.error:"Failed to load token metadata for quick buy.");return s}var eI=e.i(374801),eF=e.i(969622),eD=e.i(868110);let eq=(0,n.default)(()=>e.A(898361).then(e=>e.MemecoinSignalBoard),{loadableGenerated:{modules:[921368]},loading:()=>(0,t.jsx)("div",{"aria-live":"polite",className:"flex min-h-48 items-center justify-center rounded-xl border border-border/70 bg-card/35 text-sm text-muted-foreground",role:"status",children:"Loading signal eventsâ¦"})});function eB(e){return{discovery:e.source.discovery,pricing:e.source.pricing,trend:e.source.trend,holders:e.source.holders,security:e.source.security,limitations:e.source.limitations,refreshedAt:e.source.refreshedAt,timeframe:e.timeframe,tier:e.tier}}function eH({initialData:e,surface:n,initialNow:i}
1){let a=(0,s.useRouter)(),o=(0,s.usePathname)(),c=(0,s.useSearchParams)(),d=(0,eD.useMemecoinCapabilities)(e.capabilities),u=(0,l.parseMemecoinPageQuery)(c,n),{chainId:h,category:x,dexScreenerFilter:p,timeframe:f,pLevel:g,legacyDexScreenerTab:w}=u,v=function(e,t=!0){let n=(0,eS.useQueryClient)(),{toast:s}=(0,eC.useToast)(),{me:i,isAuthenticated:a,hasResolvedAuth:l}=(0,eA.usePolybotMe)(),o=i?.ok===!0?i.user.wallet:null,c=o&&Array.isArray(o.accounts)?o.accounts:[],d=(0,r.useMemo)(()=>(0,H.resolveMemecoinOwnerAccount)(c,e),[e,c]),m=(0,eN.useQuery)({queryKey:["memecoin-quick-buy","settlement-tokens",e],enabled:t&&a,staleTime:6e4,retry:!1,queryFn:async()=>{let t=await (0,eM.polybotMemecoinTokens)({chainId:e});if(!0!==t.ok)throw Error(t.error||"Failed to load memecoin settlement assets.");return(0,eL.filterTradePanelSettlementTokens)(t.tokens,e)}}),u=m.data??[],[h,x]=(0,r.useState)(""),b=(0,r.useMemo)(()=>u.find(e=>e.mint===h)??eP(u,e),[e,h,u]),[p,f]=(0,r.useState)(!1),[g,w]=(0,r.useState)("idle"),[v,y]=(0,r.useState)(null),[j,k]=(0,r.useState)(null),[N,S]=(0,r.useState)(null),[E,C]=(0,r.useState)(null),[A,T]=(0,r.useState)(null),[M,R]=(0,r.useState)(null),[L,_]=(0,r.useState)(null),[U,P]=(0,r.useState)(null),$=(0,r.useRef)(0),I=(0,r.useRef)(new Set),F=(0,r.useRef)(new Map);(0,r.useEffect)(()=>{let t=eP(u,e);t&&x(e=>u.some(t=>t.mint===e)?e:t.mint)},[e,u]),(0,r.useEffect)(()=>{f(!1),w("idle"),y(null),k(null),S(null),C(null),T(null),R(null),_(null),P(null),$.current+=1},[e]);let D=(0,r.useCallback)(async(t,r)=>{var n,s;let i=$.current+1;$.current=i,P((n=t.item,s=t.amount,`${n.tokenAddress}:${s}`)),w("quoting"),k(null),C(null),T(null),R(null),_(null);try{if(null==r.decimals)throw Error(`${r.symbol} decimals are unavailable, so quick buy cannot encode the amount safely.`);let n=(0,eT.parseBridgeAmountToBaseUnit)(t.amount,r.decimals);if(!n||"0"===n)throw Error("Choose a valid quick buy amount.");let s=`${e}:${t.item.tokenAddress}`,a=F.current.get(s)??null;a||(a=await e$(t.item,e),F.current.set(s,a));let l=await (0,eM.polybotMemecoinQuote)({chainId:e,inputMint:r.mint,outputMint:t.item.tokenAddress,sourceAmountRaw:n,inputDecimals:r.decimals,outputDecimals:a.tokenDecimals??void 0,slippageBps:H.DEFAULT_SLIPPAGE_BPS});if(i!==$.current)return;if(!0!==l.ok)throw Error((0,H.formatMemecoinApiError)(l));let o=null;if("solana-mainnet"===e){let e=await (0,eR.polybotTradeReadiness)({venue:"MEMECOIN",trade:{quoteKey:l.quote.quoteKey}});if(i!==$.current)return;!0!==e.ok?o="string"==typeof e.error?(0,eE.humanizeTradeError)(e.error):"Trade readiness could not be confirmed.":e.ready||(o=e.requirements.reason||e.checks.gasReserve.reason||e.checks.balanceSufficiency.reason||e.checks.feeSufficiency.reason||"Quick buy is blocked by account readiness.")}k(l.quote),S(a.tokenDecimals),C(o),w("review")}catch(e){if(i!==$.current)return;T(e instanceof Error?e.message:String(e)),w("review")}finally{i===$.current&&P(null)}},[e]),q=(0,r.useCallback)(async(t,r)=>{if(null!=L&&!(0,H.isTerminalMemecoinSwapStatus)(M))return void s({title:"Memecoin swap in progress",description:"Wait for the current swap to finish before starting another quick buy.",variant:"info"});if(!t.actions.buyEnabled)return void s({title:`Buy ${t.symbol} unavailable`,description:t.actions.buyReason||"The trade route is unavailable for this token.",variant:"error"});if(!l)return void s({title:"Account is still loading",description:"Wait for the account session to resolve before using quick buy.",variant:"info"});if(!a)return void s({title:"Sign in to quick buy",description:"Connect your account before requesting a live memecoin quote.",variant:"error"});if(m.isPending)return void s({title:"Settlement assets are loading",description:"Try quick buy again in a moment.",variant:"info"});if(m.error)return void s({title:"Quick buy unavailable",description:m.error instanceof Error?m.error.message:"Settlement assets could not be loaded.",variant:"error"});if(!b)return void s({title:"Quick buy unavailable",description:"No supported settlement asset is available for this account.",variant:"error"});if(!d)return void s({title:"Trading wallet is not ready",description:"robinhood-mainnet"===e?"Create the Turnkey EVM owner wallet before using Robinhood quick buy.":"Create the Solana owner wallet before using quick buy.",variant:"error"});let n={item:t,amount:r};y(n),f(!0),await D(n,b)},[e,l,a,d,D,b,m.error,m.isPending,L,M,s]),B=(0,r.useCallback)(async()=>{v&&b&&await D(v,b)},[D,v,b]),O=(0,r.useCallback)(t=>{x(t);let r=u.find(e=>e.mint===t);if(!v||!r)return;let n={...v,amount:eU(e,r)[0]};y(n),D(n,r)},[e,D,v,u]),z=(0,r.useCallback)(async()=>
1{if(!v||!j||E)return;let e=Date.parse(j.quoteExpiresAt);if(!Number.isFinite(e)||e<=Date.now()){T("The quote expired before confirmation. Review the refreshed quote before submitting."),await B();return}w("executing"),T(null);try{let e=await (0,eM.polybotMemecoinExecute)({quoteKey:j.quoteKey,idempotencyKey:globalThis.crypto?.randomUUID?.()??`memecoin-quick-buy-${Date.now()}`});if(!0!==e.ok){if((0,H.shouldRefreshMemecoinQuote)(e)){k(null),w("quoting"),await B();return}throw Error((0,H.formatMemecoinApiError)(e))}_(e.swapId),w("submitted");let t=await (0,eM.polybotMemecoinStatus)({swapId:e.swapId});!0===t.ok&&R(t.swap)}catch(e){T(e instanceof Error?e.message:String(e)),w("review")}},[E,j,B,v]);(0,r.useEffect)(()=>{if(null==L||(0,H.isTerminalMemecoinSwapStatus)(M))return;let e=!1,t=async()=>{let t=await (0,eM.polybotMemecoinStatus)({swapId:L});if(!e){if(!0!==t.ok)return void T((0,H.formatMemecoinApiError)(t));R(t.swap)}};t();let r=window.setInterval(()=>{t()},4e3);return()=>{e=!0,window.clearInterval(r)}},[L,M]),(0,r.useEffect)(()=>{if(!v||!M||!(0,H.isTerminalMemecoinSwapStatus)(M)||I.current.has(M.id))return;I.current.add(M.id);let t=String(M.status||"").trim().toUpperCase(),r="CONFIRMED"===t||"COMPLETED"===t;w(r?"completed":"failed"),s({title:r?`${v.item.symbol} quick buy confirmed`:`${v.item.symbol} quick buy failed`,description:r?`Swap #${M.id} completed on ${"robinhood-mainnet"===e?"Robinhood":"Solana"}.`:M.steps.find(e=>e.errorMessage)?.errorMessage||`Swap #${M.id} failed.`,variant:r?"success":"error",layout:"trade-success"}),n.invalidateQueries({queryKey:["polybotLiveAssetBalance"]}),n.invalidateQueries({queryKey:["memecoin-trade-panel","portfolio"]})},[e,n,v,M,s]);let V=(0,r.useCallback)(e=>{(e||"executing"!==g)&&(f(e),e||"review"!==g&&"completed"!==g&&"failed"!==g||($.current+=1,P(null)))},[g]);return{chainId:e,isAuthenticated:a,hasResolvedAuth:l,settlementTokens:u,settlementToken:b,settlementTokensLoading:t&&m.isPending,presetAmounts:eU(e,b),pendingButtonKey:U,open:p,phase:g,selection:v,quote:j,outputDecimals:N,blockedReason:E,error:A,swapStatus:M,startQuickBuy:q,setOpen:V,setSettlementMint:O,refreshQuote:B,confirmBuy:z}}(h,"trenches"!==n),y=(0,l.getMemecoinPageQueryKey)(u),j=e.queryKey===y?e.board:null,k=!!(d.data&&!d.enabledChains.includes(h)),[N,S]=(0,r.useState)(null),[E,C]=(0,r.useTransition)(),A=N?.category??x,T=N?.dexScreenerFilter??p,M=N?.timeframe??f,R=N?.pLevel??g,[L,_]=(0,r.useState)(()=>j?.items??[]),[U,P]=(0,r.useState)(null),[$,I]=(0,r.useState)(null),[D,q]=(0,r.useState)(()=>null==j),[B,O]=(0,r.useState)(!1),[z,V]=(0,r.useState)(!1),[K,Q]=(0,r.useState)(()=>j?.pagination??null),[X,W]=(0,r.useState)(()=>j?.items.map(e=>e.tokenAddress)??[]),[Z,Y]=(0,r.useState)([]),[J,ee]=(0,r.useState)([]),[et,er]=(0,r.useState)([]),[en,es]=(0,r.useState)([]),[ei,el]=(0,r.useState)(()=>j?eB(j):null),[ec,ed]=(0,r.useState)(null),em=(0,r.useRef)(0),eu=(0,r.useRef)(new Set),eh=(0,r.useRef)(0),ex=(0,r.useRef)(!1),eb=(0,r.useRef)(!1),ep=(0,r.useRef)(null),ef=(0,r.useRef)(null),eg=(0,r.useRef)(null),ew=(0,r.useRef)(L),ev=(0,r.useRef)([]),ej=(0,r.useRef)(null),e_=(0,r.useRef)(null),eH=(0,r.useRef)(ec);(0,r.useEffect)(()=>{ew.current=L},[L]),(0,r.useEffect)(()=>{eH.current=ec},[ec]);let eO=(0,r.useCallback)(e=>{ev.current=e},[]),ez=(0,r.useCallback)(e=>{e.length&&(ee(e),null!=ej.current&&window.clearTimeout(ej.current),ej.current=window.setTimeout(()=>{ee([]),ej.current=null},ea.MEMECOIN_ROW_UPDATE_HIGHLIGHT_MS))},[]),eV=(0,r.useCallback)(e=>{e.length&&(er(e),null!=e_.current&&window.clearTimeout(e_.current),e_.current=window.setTimeout(()=>{er([]),e_.current=null},ea.MEMECOIN_NEW_ITEM_HIGHLIGHT_MS))},[]);function eK(e,t){return Array.from(new Set([...e,...t]))}function eQ(e,t){return Array.from(new Set([...e,...t]))}function eG(e,t){let r=new Set(t);return e.filter(e=>!r.has(e))}(0,r.useEffect)(()=>()=>{null!=ej.current&&window.clearTimeout(ej.current),null!=e_.current&&window.clearTimeout(e_.current)},[]);let eX=(0,r.useCallback)(async(e,t,r)=>{let n=Array.from(new Set(e.map(e=>e.tokenAddress).filter(Boolean)));if(!n.length)return;Y(e=>eG(e,n));let{failedTokenAddresses:s}=await eo({chainId:h,tokenAddresses:n,signal:r,onBatch:(e,n)=>{if(!r?.aborted&&em.current===t){for(let t of(_(t=>{let r;return r=new Map(e.items.map(e=>[e.tokenAddress,e])),t.map(e=>{let t=r.get(e.tokenAddress);return t?{...e,provenance:{...e.provenance,launchPlatform:t.provenance.launchPlatform},trend:t.trend,holders:t.holders,security:t.security}:e})}),n))eu.current.add(t);W(e=>eG(e,n)),Y(e=>eG(e,n)),el(t=>t?{...t,trend:eK(t.trend,e.source.trend),holders:eK(t.holders,e.source.holders),security:eK(t.security,e.source.security),limitations:eK(t.limitations,e.source.limitations)}:t)}}});r?.aborted||em.current!==t||(W(e=>eG(e,s)),Y(e=>eQ(e,s)))},[h]),eW=(0,r.useCallback)(()=>{let e=new Set(Z),t=L.filter(t=>e.has(t.tokenAddress));if(!t.length)return;eg.current?.abort();let r=new AbortController;eg.current=r;let n=em.current,s=t.map(e=>e.tokenAddress);Y(e=>eG(e,s)),W(e=>eQ(e,s)),eX(t,n,r.signal).catch(()=>{r.signal.aborted||em.current!==n||(W(e=>eG(e,s)),Y(e=>eQ(e,s)))})},[Z,eX,L]),eZ=e=>{let t=e.category??x,r=e.dexScreenerFilter??p,n=e.timeframe??f,s=e.pLevel??g,i=new URLSearchParams(c?.toString()??"");t===l.DEFAULT_CATEGORY?i.delete("tab"):i.set("tab",t),r===l.DEFAULT_DEXSCREENER_FILTER?i.delete("view"):i.set("view",r),n===l.DEFAULT_TIMEFRAME?i.delete("window"):i.set("window",n),s===l.DEFAULT_P_LEVEL?i.delete("tier"):i.set("tier",s);let d=i.toString();S({category:t,dexScreenerFilter:r,timeframe:n,pLevel:s}),C(()=>{a.replace(d?`${o}?${d}`:o,{scroll:!1})})};(0,r.useEffect)(()=>
1{if(!d.data)return;let e=new URLSearchParams(c?.toString()??""),t=d.enabledChains.includes(h)?h:"solana-mainnet";c?.get("chainId")!==t&&(e.set("chainId",t),a.replace(`${o}${e.toString()?`?${e.toString()}`:""}`,{scroll:!1}))},[h,d.data,d.enabledChains,o,a,c]),(0,r.useEffect)(()=>{S(null)},[x,p,f,g]),(0,r.useEffect)(()=>{if(!w)return;let e=new URLSearchParams(c?.toString()??"");e.set("tab","dexscreener"),e.set("view",w);let t=e.toString();a.replace(t?`${o}?${t}`:o,{scroll:!1})},[w,o,a,c]),(0,r.useEffect)(()=>{if("market"!==n){em.current+=1,eg.current?.abort(),q(!1),O(!1),es([]);return}let e=new AbortController,t=em.current+1;if(em.current=t,eu.current=new Set,eg.current?.abort(),eg.current=null,eh.current=0,ex.current=!1,eb.current=!1,V(!1),O(!1),es([]),ev.current=[],Y([]),ee([]),er([]),null!=e_.current&&(window.clearTimeout(e_.current),e_.current=null),k){q(!1),_([]),Q(null);return}let r=!1,s=!1;async function i(){if(s)return!0;let r=(0,ea.selectMemecoinLivePatchItems)(ew.current,ev.current);if(!r.length)return!0;if(s=!0,es(r.map(e=>e.tokenAddress)),Date.now()-eh.current>=ea.MEMECOIN_ENRICHMENT_REFRESH_INTERVAL_MS){eh.current=Date.now();let n=r.map(e=>e.tokenAddress);W(e=>eQ(e,n)),eX(r,t,e.signal).catch(()=>{e.signal.aborted||em.current!==t||W(e=>eG(e,n))})}try{let n=new URLSearchParams({chainId:h,timeframe:f,tokenAddresses:r.map(e=>e.tokenAddress).join(",")}),s=await fetch(`/api/crypto/memecoins/explorer/metrics?${n.toString()}`,{cache:"no-store",signal:e.signal,headers:{Accept:"application/json"}}),i=await s.json().catch(()=>null);if(!s.ok||!i||!0!==i.ok)throw Error(i&&!1===i.ok?i.error:"Failed to refresh memecoin metrics");if(e.signal.aborted||em.current!==t)return!0;let a=(0,ea.getChangedMemecoinMetricTokenAddresses)(ew.current,i.items);return _(e=>(0,ea.mergeMemecoinMetricPatches)(e,i.items)),ez(a),el(e=>e?{...e,pricing:eK(e.pricing,i.source.pricing),refreshedAt:i.source.refreshedAt,limitations:eK(e.limitations,i.source.limitations)}:e),!0}catch{return!1}finally{s=!1,e.signal.aborted||es([])}}async function a(n=!1){if(!r){r=!0,n?O(!0):q(!0),n||(P(null),I(null));try{if("pump-live"===x){let r=await fetch("/api/crypto/memecoins/pump-live?limit=8",{cache:"no-store",signal:e.signal,headers:{Accept:"application/json"}}),s=await r.json().catch(()=>null);if(!r.ok||!s||!0!==s.ok)throw Error(s&&!1===s.ok?s.error:"Failed to load pump live board");if(e.signal.aborted||em.current!==t)return;if(n){let e=new Set([...eH.current?.newStreams??[],...eH.current?.topStreamTokens??[]].map(e=>e.mint));eV([...s.newStreams,...s.topStreamTokens].filter(t=>!e.has(t.mint)).map(e=>e.mint))}P(null),ed({newStreams:s.newStreams,topStreamTokens:s.topStreamTokens,source:s.source}),_([]),Q(null),W([]),el(null);return}let r=new URLSearchParams({filter:p,timeframe:f,tier:g,limit:String(l.DEXSCREENER_PAGE_SIZE)});r.set("chainId",h);let s=await fetch(`/api/crypto/memecoins/explorer/board?${r.toString()}`,{cache:"no-store",signal:e.signal,headers:{Accept:"application/json"}}),i=await s.json().catch(()=>null);if(!s.ok||!i||!0!==i.ok)throw Error(i&&!1===i.ok?i.error:"Failed to load memecoin explorer board");if(e.signal.aborted||em.current!==t)return;P(null),n&&(ex.current||eV((0,ea.getNewMemecoinTokenAddresses)(ew.current,i.items,"robinhood-mainnet"===h)),ez((0,ea.getChangedMemecoinMetricTokenAddresses)(ew.current,i.items))),_(e=>n?(0,ea.mergeRefreshedFirstPage)(e,i.items,ex.current):i.items),n&&ex.current||Q(i.pagination);let a=!n||Date.now()-eh.current>=ea.MEMECOIN_ENRICHMENT_REFRESH_INTERVAL_MS;a&&(eh.current=Date.now());let o=a?i.items:i.items.filter(e=>!eu.current.has(e.tokenAddress)),c=o.map(e=>e.tokenAddress);W(e=>n?eQ(e,c):c),el(eB(i)),ed(null),eX(o,t,e.signal).catch(()=>{e.signal.aborted||em.current!==t||W(e=>eG(e,c))})}catch(t){if(e.signal.aborted)return;n||(W([]),P(t instanceof Error?t.message:String(t)))}finally{r=!1,!e.signal.aborted&&n&&O(!1),e.signal.aborted||n||q(!1)}}}let o=j?`${y}:${j.source.refreshedAt}:${j.pagination.nextCursor??"end"}`:null;if(j){ef.current!==o&&(ef.current=o,P(null),I(null),q(!1),_(j.items),Q(j.pagination),el(eB(j)),ed(null));let r=j.items.map(e=>e.tokenAddress);eh.current=Date.now(),W(r),eX(j.items,t,e.signal).catch(()=>{e.signal.aborted||em.current!==t||W(e=>eG(e,r))})}else a();
1let c=(0,ea.startVisibleRefreshInterval)(()=>{(0,ea.shouldAutoRefreshMemecoinBoard)(ex.current)&&a(!0)}),d="pump-live"===x?()=>{}:(0,ea.startVisibleRefreshBackoff)(i,ea.MEMECOIN_LIVE_PATCH_REFRESH_INTERVAL_MS);return()=>{c(),d(),e.abort(),eg.current?.abort()}},[x,h,k,p,eX,j,eV,ez,g,y,n,f]);let eY=(0,r.useCallback)(async()=>{if("trenches"===n||"pump-live"===x||D||eb.current||!K?.hasMore||!K.nextCursor)return;let e=new AbortController,t=em.current;eb.current=!0,V(!0),I(null);try{let r=new URLSearchParams({cursor:K.nextCursor,chainId:h}),n=await fetch(`/api/crypto/memecoins/explorer/board?${r.toString()}`,{cache:"no-store",signal:e.signal,headers:{Accept:"application/json"}}),s=await n.json().catch(()=>null);if(!n.ok||!s||!0!==s.ok)throw Error(s&&!1===s.ok?s.error:"Failed to load more memecoins");if(e.signal.aborted||em.current!==t)return;_(e=>(0,l.mergeMemecoinItems)(e,s.items)),ex.current=!0,Q(s.pagination),W(e=>eQ(e,s.items.map(e=>e.tokenAddress))),el(eB(s)),eX(s.items,t,e.signal).catch(()=>{e.signal.aborted||em.current!==t||W(e=>eG(e,s.items.map(e=>e.tokenAddress)))})}catch(r){e.signal.aborted||em.current!==t||I(r instanceof Error?r.message:String(r))}finally{eb.current=!1,V(!1)}},[x,h,p,eX,D,K,g,n,f]);return(0,r.useEffect)(()=>{if("trenches"===n||"pump-live"===x||D||!K?.hasMore)return;let e=ep.current;if(!e)return;let t=new IntersectionObserver(e=>{e.some(e=>e.isIntersecting)&&eY()},{rootMargin:"320px 0px"});return t.observe(e),()=>t.disconnect()},[x,D,K?.hasMore,eY,n]),(0,t.jsxs)("div",{className:"memecoin-surface flex w-full max-w-full flex-col gap-3 px-3 pb-[calc(var(--app-mobile-bottom-nav-reserve,6rem)+1rem)] pt-3 sm:px-4 md:gap-5 md:pt-6 min-[1180px]:px-0 min-[1180px]:pb-6",children:[(0,t.jsx)("h1",{className:"sr-only",children:"signal"===n?"Memecoin Signal":"trenches"===n?"Memecoin Trenches":"Memecoin Market"}),(0,t.jsx)(b,{value:h,chains:d.data?d.enabledChains:[h],hrefForChain:e=>(0,eI.getMemecoinChainHref)({pathname:o,searchParams:c,chainId:e,currentCategory:x})}),"market"===n?(0,t.jsx)(m,{hidePumpLive:"robinhood-mainnet"===h,activeCategory:A,activeDexScreenerFilter:T,activeTimeframe:M,activePLevel:R,onCategoryChange:e=>eZ({category:e}),onDexScreenerFilterChange:e=>eZ({dexScreenerFilter:e}),onTimeframeChange:e=>eZ({timeframe:e}),onPLevelChange:e=>eZ({pLevel:e}),onApplyFilters:e=>eZ(e),liveRefreshedAt:ei?.refreshedAt??ec?.source.refreshedAt??null}):null,(0,t.jsxs)("div",{className:"relative min-h-[320px]","aria-busy":B||en.length>0,children:[E?(0,t.jsx)(eF.InlineRouteTransition,{label:"Updating memecoin board"}):null,"signal"===n?(0,t.jsx)(eq,{chainId:h,initialPayload:e.signals,quickBuy:v}):"trenches"===n?(0,t.jsx)(ey,{chainId:h,initialPayload:e.trenches,initialNow:i}):"pump-live"===A?(0,t.jsxs)("section",{className:"grid gap-4 xl:grid-cols-2",children:[(0,t.jsx)(ek,{title:"New Streams",subtitle:"Latest tokens entering the live Pump launch feed.",items:ec?.newStreams??[],isLoading:D,isRefreshing:B,recentlyAddedMints:et,error:U}),(0,t.jsx)(ek,{title:"Top Stream Tokens",subtitle:"Highest live signal ranked by market cap and reply activity.",items:ec?.topStreamTokens??[],isLoading:D,isRefreshing:B,recentlyAddedMints:et,error:U})]}):(0,t.jsx)(F,{chainId:h,items:L,timeframe:M,enrichmentPendingTokenAddresses:X,enrichmentFailedTokenAddresses:Z,recentlyUpdatedTokenAddresses:J,recentlyAddedTokenAddresses:et,listError:U,loadMoreError:$,isLoadingList:D,refreshingTokenAddresses:en,isLoadingMore:z,listPagination:K,loadMoreSentinelRef:ep,quickBuy:v,onVisibleTokenAddressesChange:eO,onLoadMore:()=>{eY()},onRetryEnrichment:eW})]}),(0,t.jsx)(G,{controller:v})]})}e.s(["MemecoinsPageClient",()=>eH],754788)}]);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.