1import{m as us,j as e,L as ae,C as Ge,ay as ds,ak as Ot,n as Ie,au as hs,r,h as Ht,z as ps,l as Qe,aD as qt,g as Ft,av as ms,aA as zt,aB as fs,y as bs,aE as xs,aw as gs,aF as ys,u as _s,aG as js,f as vs,d as Ns,ab as Ts,F as se,aH as Ss,H as ks,a3 as ws,a6 as Cs,ae as Rs,aI as As,aJ as Es}from"./index-C-44qb6b.js";import{S as Ue,a as Ps,u as Ls,b as kt,M as wt,d as Bs,v as $s,e as Ct,T as Ds,f as Ms}from"./TeamTab-BKrNWwHb.js";import{E as Rt}from"./EmptyState-CldqHVAe.js";import{g as At,a as Is,T as Us}from"./TeamPanel-BIITN1f9.js";import{T as Os}from"./TokenAbout-cRSV-1Wl.js";import{A as Xe}from"./arrow-left-Cpl0lCSF.js";import{a as Hs,C as qs}from"./chevron-down-Cu1JFBvu.js";import{e as Fs,u as zs,g as Ws,a as ze,t as Ys,i as Ks,r as Vs,h as Gs,I as Qs,j as Xs,k as Js,R as Et,f as Zs,D as ea,C as Pt,s as ta,S as sa,l as aa,B as na,b as la,m as ra,c as oa}from"./useTradeSubmission-DquSvKfl.js";import{f as ia,h as ca,u as ua,a as da,S as Lt}from"./useTradeLimits-SysnTRvv.js";import{G as ha}from"./GoogleMark-gmhWO4hw.js";import{F as N,h as Wt,H as Yt,i as pa,C as ma,j as fa,T as ba,k as xa}from"./feed-CGbtsN9f.js";import{u as ga,P as ya}from"./PostList-DG2bGlzv.js";import"./SocialPage-DL_GtEBJ.js";import{C as Kt}from"./copy-8OhZGiy3.js";import"./solana-DLf93gq9.js";import"./arrow-up-right-CnuzoMCE.js";import"./x-BPckS_IA.js";/** 2 * @license lucide-react v0.475.0 - ISC 3 * 4 * This source code is licensed under the ISC license. 5 * See the LICENSE file in the root directory of this source tree. 6 */const _a=[["path",{d:"m13.5 8.5-5 5",key:"1cs55j"}],["path",{d:"m8.5 8.5 5 5",key:"a8mexj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["path",{d:"m21 21-4.3-4.3",key:"1qie3q"}]],ja=us("SearchX",_a);
6function We({backTo:t,symbol:a,age:s,compact:l,capLabel:n,mint:i,imageUrl:d,thumbUrl:c=null,showCompact:p}){const u=!!(p&&l);return e.jsxs("header",{className:`trading-detail-bar${u?" is-compact":""}`,children:[e.jsx(ae,{className:"trading-detail-bar__back",to:t,"aria-label":"Back",children:e.jsx(Xe,{size:20,"aria-hidden":"true"})}),u&&(c||d||i)?e.jsx(Ge,{mint:i,symbol:a,imageUrl:d,thumbUrl:c,size:28}):null,e.jsx("strong",{className:"trading-detail-bar__symbol",children:a}),s?e.jsx("span",{className:"trading-detail-bar__age",children:`${s} ago`}):null,e.jsx("span",{className:"trading-detail-bar__compact",hidden:!p,children:u?e.jsxs(e.Fragment,{children:[n?e.jsx("span",{className:"trading-detail-bar__cap-label",children:n}):null,e.jsx("span",{children:l.text})]}):null}),e.jsx(Ue,{mint:i,title:a?`${a} · Deside`:"Deside"})]})}function va({percent:t,text:a}){return e.jsxs("section",{className:"trading-curve-progress","aria-label":"Bonding curve progress",children:[e.jsxs("div",{className:"trading-curve-progress__head",children:[e.jsx("span",{children:"Bonding curve"}),e.jsx("span",{className:"trading-curve-progress__value",children:a})]}),e.jsx("div",{className:"trading-curve-progress__track",role:"progressbar","aria-label":"Bonding curve","aria-valuemin":0,"aria-valuemax":100,"aria-valuenow":t,children:e.jsx("span",{className:"trading-curve-progress__fill",style:{width:`${t}%`}})})]})}function Bt(t){return t==="buy"||t==="sell"?`trading-dock__button trading-dock__button--${t}`:"trading-dock__button"}function $t({label:t,tone:a,disabled:s,onClick:l,secondaryLabel:n,secondaryTone:i,onSecondaryClick:d}){return e.jsxs("div",{className:n?"trading-dock trading-dock--split":"trading-dock",children:[e.jsx("button",{type:"button",className:Bt(a),disabled:s,onClick:l,children:t}),n?e.jsx("button",{type:"button",className:Bt(i),onClick:d,children:n}):null]})}function Dt({model:t}){if(!t)return null;const a=t.investedText!==null||t.avgEntryText!==null;return e.jsxs("section",{className:"trading-position-card","aria-label":"Your position",children:[e.jsxs("span",{className:"trading-position-card__status",children:[e.jsx("span",{className:"trading-position-card__dot","aria-hidden":"true"}),"Open position"]}),e.jsxs("div",{className:"trading-position-card__line",children:[e.jsxs("div",{className:"trading-position-card__main",children:[e.jsx("strong",{className:"trading-position-card__value",children:t.valueText??"â"}),e.jsx("span",{className:"trading-position-card__amount",children:t.amountText})]}),t.pnl?e.jsxs("div",{className:"trading-position-card__pnlbox",children:[e.jsx("span",{className:`trading-position-card__pnl ${ds(t.pnl.direction)}`,children:t.pnl.text}),e.jsx(Ot,{label:t.pnl.pctLabel,direction:t.pnl.direction})]}):null]}),a?e.jsxs("dl",{className:"trading-position-card__facts",children:[t.investedText!==null?e.jsxs("div",{children:[e.jsx("dt",{children:"Invested"}),e.jsx("dd",{children:t.investedText})]}):null,t.avgEntryText!==null?e.jsxs("div",{children:[e.jsx("dt",{children:"Avg entry"}),e.jsx("dd",{children:t.avgEntryText})]}):null]}):null]})}const Na={Pending:"activity-row__status--pending",Done:"activity-row__status--done",Failed:"activity-row__status--failed"};function Ta(t){return`${t.slice(0,4)}â¦${t.slice(-4)}`}function Sa(t,a){const s=Date.parse(t),l=Math.max(0,a-s),n=Math.floor(l/6e4);if(n<1)return"now";if(n<60)return`${n}m`;const i=Math.floor(n/60);return i<24?`${i}h`:`${Math.floor(i/24)}d`}function ka({row:t,token:a}){const s=(a==null?void 0:a.symbol)||null;return e.jsx("li",{className:"activity-row",children:e.jsxs(ae,{className:"activity-row__link",to:t.href,children:[e.jsx(Ge,{mint:t.mint,symbol:s,imageUrl:a==null?void 0:a.imageUrl,size:36}),e.jsxs("span",{className:"activity-row__identity",children:[e.jsxs("span",{className:"activity-row__line1",children:[e.jsx("span",{className:"activity-row__side",children:t.side}),t.amountLabel?e.jsx("span",{className:"activity-row__amount",children:t.amountLabel}):null,t.amountUsdLabel?e.jsx("span",{className:"activity-row__amount-usd",children:t.amountUsdLabel}):null]}),e.jsx("span",{className:"activity-row__line2",children:s||Ta(t.mint)})]}),e.jsxs("span",{className:"activity-row__meta",children:[e.jsx("span",{className:"activity-row__time",children:Sa(t.createdAt,Date.now())}),e.jsx("span",{className:`activity-row__status ${Na[t.status]}`,children:t.status})]})]})})}const wa={submitting:"Pending",submitted:"Pending",submission_unknown:"Pending",confirmed:"Done",failed:"Failed"};function Ca(t){return wa[t]??null}function Ra(t){const a=Ca(t.state);if(a===null)return null;const s=t.side==="sell"?"Sell":"Buy";return{attemptId:t.attemptId,mint:t.mint,side:s,amountLabel:typeof t.amountText=="string"&&t.amountText?t.amountText:null,amountUsdLabel:typeof t.amountUsdText=="string"&&t.amountUsdText?t.amountUsdText:null,status:a,createdAt:t.createdAt,href:Ie(t.mint)}}const Aa=/^[1-9][0-9]*$/;function Ea(t){return!t||typeof t.amountRaw!="string"||!Aa.test(t.amountRaw)?null:{valueText:t.valueLabel??null,amountText:t.amountLabel??null,pnl:t.pnl&&t.pnlLabel?{text:t.pnlLabel,pctLabel:t.pnl.pctLabel??null,direction:hs(t.pnl.direction)}:null,investedText:t.costLabel??null,avgEntryText:t.avgEntryMcLabel??t.avgEntryLabel??null}}function Mt(t){return Array.isArray(t)?t.filter(a=>(a==null?void 0:a.side)==="buy"&&(a==null?void 0:a.state)==="confirmed").map(a=>Date.parse(a.createdAt)).filter(Number.isFinite):[]}function Pa(){return"Your transactions"}function La({items:t,more:a,token:s}){const[l,n]=r.useState(!1),i=(Array.isArray(t)?t:[]).map(Ra).filter(
6Boolean);return i.length===0?null:e.jsxs("section",{className:"trading-token-transactions",children:[e.jsxs("button",{type:"button",className:"trading-token-transactions__toggle","aria-expanded":l,onClick:()=>n(d=>!d),children:[Pa(i.length),e.jsx(Hs,{size:18,"aria-hidden":"true",className:"trading-token-transactions__chevron"})]}),l?e.jsx("ul",{className:"trading-token-transactions__list",children:i.map(d=>e.jsx(ka,{row:d,token:s},d.attemptId))}):null]})}const Ba=15e3,Vt="Not available right now";function Gt({label:t}){return e.jsx("div",{className:"trading-tab-panel__skeleton",role:"status","aria-label":t,children:[0,1,2,3,4,5].map(a=>e.jsx("span",{className:"trading-tab-panel__skeleton-row","aria-hidden":"true"},a))})}function Qt({onRetry:t}){return e.jsxs("div",{className:"trading-notice",role:"alert",children:[e.jsx("p",{children:Vt}),e.jsx("button",{type:"button",onClick:t,children:"Retry"})]})}function Xt({href:t,className:a,label:s,children:l}){return t?e.jsx("a",{className:a,href:t,target:"_blank",rel:"noopener noreferrer","aria-label":s,children:l}):e.jsx("span",{className:a,children:l})}function $a({mint:t}){const[a,s]=r.useState({status:"loading",data:null}),[l,n]=r.useState(0);if(r.useEffect(()=>{const u=new AbortController;return s({status:"loading",data:null}),Is(t,{signal:u.signal}).then(o=>{u.signal.aborted||s({status:"ready",data:(o==null?void 0:o.holders)??null})}).catch(()=>{u.signal.aborted||s({status:"error",data:null})}),()=>u.abort()},[t,l]),a.status==="loading")return e.jsx(Gt,{label:"Loading holders"});if(a.status==="error"||!a.data)return e.jsx(Qt,{onRetry:()=>n(u=>u+1)});const{holderCountText:i,rows:d,emptyText:c}=a.data,p=Array.isArray(d)?d:[];return e.jsxs("section",{className:"trading-tab-panel","aria-label":"Holders",children:[i?e.jsx("p",{className:"trading-tab-panel__head",children:i}):null,p.length===0?c?e.jsx("p",{className:"trading-tab-panel__empty",children:c}):null:e.jsx("ol",{className:"trading-tab-panel__list",children:p.map(u=>e.jsxs("li",{className:"trading-tab-panel__row",children:[e.jsx("span",{className:"trading-tab-panel__rank",children:u.rank}),e.jsxs("span",{className:"trading-tab-panel__main",children:[e.jsx(Xt,{href:u.explorerUrl,className:"trading-tab-panel__wallet",label:u.walletShort?`Open ${u.walletShort} in explorer`:void 0,children:u.walletShort}),u.labelText?e.jsx("span",{className:"trading-tab-panel__tag",children:u.labelText}):null]}),e.jsx("span",{className:"trading-tab-panel__end",children:u.shareText})]},`${u.rank}-${u.wallet??u.walletShort}`))})]})}function Da({mint:t}){const[a,s]=r.useState({status:"loading",head:null,older:[],nextBefore:null,emptyText:null}),[l,n]=r.useState({busy:!1,error:!1}),[i,d]=r.useState(0),c=r.useCallback(async(o,j)=>{try{const T=await At(t,{signal:o});if(o.aborted)return;const h=T==null?void 0:T.trades;if(!h)throw new Error("shape");s(g=>{const b=Array.isArray(h.rows)?h.rows:[],x=new Set(b.map(C=>C.id)),w=g.older.filter(C=>!x.has(C.id));return{status:"ready",head:b,older:w,nextBefore:w.length?g.nextBefore:h.nextBefore??null,emptyText:h.emptyText??null}})}catch{if(o.aborted)return;j||s({status:"error",head:null,older:[],nextBefore:null,emptyText:null})}},[t]);r.useEffect(()=>{const o=new AbortController;s({status:"loading",head:null,older:[],nextBefore:null,emptyText:null}),c(o.signal,!1);const j=setInterval(()=>c(o.signal,!0),Ba);return()=>{o.abort(),clearInterval(j)}},[c,i]);async function p(){if(!(!a.nextBefore||l.busy)){n({busy:!0,error:!1});try{const o=await At(t,{before:a.nextBefore}),j=o==null?void 0:o.trades;if(!j)throw new Error("shape");const T=Array.isArray(j.rows)?j.rows:[];s(h=>{const g=new Set([...h.head??[],...h.older].map(b=>b.id));return{...h,older:[...h.older,...T.filter(b=>!g.has(b.id))],nextBefore:j.nextBefore??null}}),n({busy:!1,error:!1})}catch{n({busy:!1,error:!0})}}}if(a.status==="loading")return e.jsx(Gt,{label:"Loading trades"});if(a.status==="error")return e.jsx(Qt,{onRetry:()=>d(o=>o+1)});const u=[...a.head,...a.older];return e.jsxs("section",{className:"trading-tab-panel","aria-label":"Trades",children:[u.length===0?a.emptyText?e.jsx("p",{className:"trading-tab-panel__empty",children:a.emptyText}):null:e.jsx("ul",{className:"trading-tab-panel__list",children:u.map(o=>e.jsxs("li",{className:"trading-tab-panel__row trading-tab-panel__row--trade",children:[e.jsxs("span",{className:"trading-tab-panel__main",children:[e.jsx("span",{className:`trading-tab-panel__side is-${o.direction==="up"||o.direction==="down"?o.direction:"neutral"}`,children:o.sideText}),e.jsx(Xt,{href:o.walletUrl,className:"trading-tab-panel__wallet",label:o.walletShort?`Open ${o.walletShort} in explorer`:void 0,children:o.walletShort})]}),e.jsxs("span",{className:"trading-tab-panel__amounts",children:[e.jsx("span",{children:o.usdText}),e.jsx("span",{className:"trading-tab-panel__muted",children:o.amountText})]}),e.jsxs("span",{className:"trading-tab-panel__amounts",children:[e.jsx("span",{className:"trading-tab-panel__muted",children:o.priceText}),e.jsx("span",{className:"trading-tab-panel__muted",children:o.timeText})]}),o.explorerUrl?e.jsx("a",{className:"trading-tab-panel__tx",href:o.explorerUrl,target:"_blank",rel:"noopener noreferrer","aria-label":"Open transaction in explorer",children:"â"}):null]},o.id))}),l.error?e.jsx("p",{className:"trading-tab-panel__empty",role:"alert",children:Vt}):null,a.nextBefore?e.jsx("button",{type:"button",className:"trading-tab-panel__more",onClick:p,disabled:l.busy,children:"Show more"}):null]})}const Ma=600,Ia=/^[1-9][0-9]*$/;function Ve(t,a){return Array.isArray(t)&&t.find(s=>
6(s==null?void 0:s.mint)===a&&typeof(s==null?void 0:s.amountRaw)=="string"&&Ia.test(s.amountRaw))||null}function Ua(t,a){const s=typeof t=="string"?t:"";return a==="delete"?s.slice(0,-1):a==="."?s.includes(".")?s:s===""?"0.":`${s}.`:/^[0-9]$/.test(a)?s==="0"?a:`${s}${a}`:s}function Oa(t){const a=t==null?void 0:t.sellAvailable;if(!a||typeof a!="object")return{tokenText:null,usdText:null};const s=l=>typeof l=="string"&&l!==""?l:null;return{tokenText:s(a.tokenText),usdText:s(a.usdText)}}function Ha(t){const[a,s]=r.useState(null);return r.useEffect(()=>{if(!t)return;const l=new AbortController;return ia({signal:l.signal}).then(n=>{l.signal.aborted||s(n)}).catch(()=>{l.signal.aborted||s(null)}),()=>l.abort()},[t]),a}function qa({address:t,mint:a,side:s}){const[l,n]=r.useState(null),[i,d]=r.useState(null),c=r.useRef(0),p=r.useRef({address:t,mint:a,side:s});p.current={address:t,mint:a,side:s},r.useEffect(()=>{if(!l)return;const g=new AbortController,b=()=>{const{address:C,mint:v,side:A}=p.current;ca({address:C,mint:v,side:A,input:l.input},{signal:g.signal}).then(P=>{g.signal.aborted||d({id:l.id,...P,invalid:!1,error:null})}).catch(P=>{if(g.signal.aborted)return;const H=(P==null?void 0:P.statusCode)===400;d({id:l.id,canQuote:!1,amountRaw:null,amountText:null,usdText:null,overBalance:!1,blockedText:null,invalid:H,error:H?null:P})})},x=l.kind==="typed"?Ma:0,w=setTimeout(b,x);return()=>{clearTimeout(w),g.abort()}},[l]);const u=r.useCallback(()=>{n(null),d(null)},[]),o=r.useRef(null);o.current=l;const j=r.useCallback((g,b)=>{const x=o.current,w=(x==null?void 0:x.kind)==="typed"&&x.input.unit===b?x.input.value:"",C=Ua(w,g);if(C===""){n(null),d(null);return}c.current+=1;const v={id:c.current,kind:"typed",input:{unit:b,value:C},label:null};o.current=v,n(v)},[]),T=r.useCallback(g=>{c.current+=1,n({id:c.current,kind:"preset",input:g.input,label:g.label})},[]),h=l!==null&&i!==null&&i.id===l.id?i:null;return{entry:l,resolved:i,current:h,amountRaw:i!=null&&i.canQuote?i.amountRaw:null,type:j,choose:T,reset:u}}function It({accountId:t}){const[a,s]=r.useState(!1);return t&&!a?e.jsx("img",{className:"feed-composer__avatar",src:ps(`/api/v1/account/avatar/${encodeURIComponent(t)}`),alt:"",onError:()=>s(!0)}):e.jsx("span",{className:"feed-composer__avatar feed-composer__avatar--empty","aria-hidden":"true"})}function Fa({session:t,accountId:a=null,mint:s,onPosted:l}){const[n,i]=r.useState(""),[d,c]=r.useState(!1),[p,u]=r.useState(!1),[o,j]=r.useState(null);if(!t)return e.jsxs(ae,{className:"feed-composer feed-composer--signed-out",to:Ht(),children:[e.jsx(It,{accountId:null}),e.jsx("span",{className:"feed-composer__placeholder",children:N.logInToPost})]});const T=h=>{h.preventDefault(),u(!0),j(null),Wt({mint:s,text:n,anchor:{kind:Yt}}).then(()=>{i(""),c(!1),l()}).catch(g=>j(N.postErrors[g==null?void 0:g.code]||N.postErrors.default)).finally(()=>u(!1))};return e.jsxs("form",{className:`feed-composer${d?" is-open":""}`,onSubmit:T,children:[e.jsxs("div",{className:"feed-composer__row",children:[e.jsx(It,{accountId:a}),e.jsx("textarea",{className:"feed-composer__input","aria-label":N.composerPlaceholder,placeholder:N.composerPlaceholder,value:n,onFocus:()=>c(!0),onBlur:()=>{n===""&&c(!1)},onChange:h=>i(h.target.value),rows:d?3:1})]}),o?e.jsx("p",{className:"feed-composer__error",role:"alert",children:o}):null,d||n!==""?e.jsx("button",{type:"submit",className:"feed-composer__submit",disabled:p||n==="",onMouseDown:h=>h.preventDefault(),children:p?N.composerSending:N.composerSubmit}):null]})}const za=[{key:null,label:N.filterAll},{key:ma,label:N.filterCompanies}];function Wa({chain:t="solana",mint:a,onPosted:s}){const l=Qe(),n=l.status!=="loading",i=l.status==="account",[d,c]=r.useState(null),p=i?l.accountId??null:null,[u,o]=r.useState(null),j=u!==null&&u.accountId===p&&u.mint===a,T=r.useCallback((b,x)=>pa({chain:t,mint:a,cursor:b,filter:d,session:i},x).then(w=>{var C,v;return!b&&!((C=x==null?void 0:x.signal)!=null&&C.aborted)&&o(Array.isArray((v=w.viewer)==null?void 0:v.byHandKinds)&&w.viewer.byHandKinds.includes(Yt)?{accountId:p,mint:a}:null),w}),[t,a,d,i,p]),h=ga({loadPage:T,enabled:n&&!!a}),g=r.useCallback(()=>{h.reload(),s==null||s()},[h,s]);return!n||h.status==="off"?null:e.jsxs("section",{className:"feed",children:[i&&!j?e.jsx("p",{className:"feed-composer feed-composer--hint",children:N.tradeToPost}):e.jsx(Fa,{session:i,accountId:p,mint:a,onPosted:g}),e.jsx("div",{className:"feed__filters feed__filters--pills",role:"group","aria-label":N.filterLabel,children:za.map(b=>e.jsx("button",{type:"button","aria-pressed":d===b.key,onClick:()=>c(b.key),children:b.label},b.label))}),h.status==="error"?e.jsxs("div",{className:"feed__error",role:"alert",children:[e.jsx("p",{children:N.loadError}),e.jsx("button",{type:"button",onClick:h.reload,children:N.retry})]}):null,h.status!=="loading"&&!(h.status==="error"&&h.items.length===0)?e.jsx(ya,{items:h.items,nextCursor:h.nextCursor,loadingMore:h.status==="loadingMore",onLoadMore:h.loadMore,showToken:!1}):null]})}function Ya(t){return typeof t=="string"&&Object.hasOwn(N.postErrors,t)?N.postErrors[t]:null}function Jt(t,a){return a===!0&&(t==null?void 0:t.state)==="confirmed"&&typeof(t==null?void 0:t.attemptId)=="string"&&t.attemptId!==""&&typeof(t==null?void 0:t.mint)=="str
6ing"&&t.mint!==""}function Ut({attempt:t,onNavigate:a=null}){var g;const s=qt(),[l,n]=r.useState(""),[i,d]=r.useState(!1),[c,p]=r.useState(null),[u,o]=r.useState(null);if(!Jt(t,s))return null;const j=t.attemptId,T=t.mint;if(u){const b=fa((g=u.token)==null?void 0:g.href)||Ie(T);return e.jsxs("div",{className:"feed-trade-post feed-trade-post--posted",children:[e.jsx("p",{className:"feed-trade-post__done",role:"status",children:N.posted}),e.jsx(ae,{className:"feed-trade-post__view",to:b,onClick:a||void 0,children:N.viewPost})]})}const h=b=>{b.preventDefault(),d(!0),p(null),Wt({mint:T,text:l,anchor:{kind:ba,ref:j}}).then(x=>o(x&&typeof x=="object"?x:{})).catch(x=>p((x==null?void 0:x.serverMessage)||Ya(x==null?void 0:x.code)||N.postErrors.default)).finally(()=>d(!1))};return e.jsxs("form",{className:"feed-trade-post feed-composer",onSubmit:h,children:[e.jsx("textarea",{className:"feed-composer__input","aria-label":N.tradePostPlaceholder,placeholder:N.tradePostPlaceholder,value:l,onChange:b=>n(b.target.value),rows:3}),e.jsx("p",{className:"feed-trade-post__notice",children:N.tradePostNotice}),c?e.jsx("p",{className:"feed-composer__error",role:"alert",children:c}):null,e.jsx("button",{type:"submit",className:"feed-trade-post__submit",disabled:i||l==="",children:i?N.composerSending:N.composerSubmit})]})}function Ka({chain:t="solana",mint:a,range:s,maxCandles:l,reloadKey:n=0}){const[i,d]=r.useState([]),c=r.useRef(l);return c.current=l,r.useEffect(()=>{if(!a)return;const p=new AbortController;return xa({chain:t,mint:a,range:s,maxCandles:c.current},{signal:p.signal}).then(u=>{p.signal.aborted||d(u)}).catch(()=>{p.signal.aborted||d([])}),()=>p.abort()},[t,a,s,n]),i}const Va=[["usdc","USDC"],["sol","SOL"]],Ga=2,Qa=["1","2","3","4","5","6","7","8","9",".","0"];function Xa({mint:t}){const[a,s]=r.useState(!1);async function l(){try{await navigator.clipboard.writeText(t),s(!0),setTimeout(()=>s(!1),1500)}catch{}}return e.jsxs("button",{type:"button",className:"buy-sheet__ca","aria-label":`Copy address ${t}`,onClick:l,children:[e.jsx("span",{children:`${t.slice(0,4)}â¦${t.slice(-4)}`}),a?e.jsx(qs,{size:12,"aria-hidden":"true"}):e.jsx(Kt,{size:12,"aria-hidden":"true"})]})}function Ye({mint:t,symbol:a,onClose:s,side:l="buy",market:n=null,docked:i=!1}){var et,tt,st,at,nt,lt,rt,ot,it,ct,ut,dt,ht,pt,mt,ft,bt,xt,gt,yt,_t,jt;r.useEffect(()=>{if(i)return;const f=document.documentElement;return f.classList.add("trading-sheet-open"),()=>f.classList.remove("trading-sheet-open")},[i]);const d=qt(),c=l==="sell",p=Qe(),u=Ft(),o=ms(),j=p.status==="account",T=u.status==="connected",h=j?p.accountId:null,g=T?u.address:null,b=qa({address:g,mint:t,side:l}),x=Ha(!!(h&&g)),[w,C]=r.useState(!1),v=zt(g),A=!c&&v.state==="ready"&&v.pay&&typeof v.pay=="object"?v.pay:null,P=A!==null&&A.default!=="usdc"&&A.default!=="sol",[H,Te]=r.useState(!1),[fe,Se]=r.useState(!1),D=c?"usdc":(A==null?void 0:A.default)==="sol"?"sol":"usdc",q=v.payPreference??null,E=D==="sol",ke=r.useRef(D),we=ke.current!==D,M=we?null:b.amountRaw,y=Fs({accountId:h,address:g,mint:t,amountRaw:M,side:l,payWith:D}),ne=r.useRef(y);ne.current=y;const le=v.retry,re=ua(!c&&E?g:null),_=zs(),oe=da(),I=r.useRef(null);y.state==="ready"?I.current={attempt:y.attempt,display:y.display}:y.state!=="quoting"&&y.state!=="paused"&&(I.current=null);const O=_.phase==="idle"||_.phase==="claim_error",Ce=y.state==="quoting"&&O&&I.current!==null&&M!==null&&((tt=(et=I.current.attempt)==null?void 0:et.quote)==null?void 0:tt.amount)===M,be=y.state==="paused"&&M!==null&&((nt=(at=(st=I.current)==null?void 0:st.attempt)==null?void 0:at.quote)==null?void 0:nt.amount)===M,Q=M===null?null:y.state==="ready"?{attempt:y.attempt,display:y.display}:Ce||be?I.current:null,[Re,R]=r.useState(null),[ie,L]=r.useState(null),X=r.useRef(!1),xe=r.useRef(null);ie!==null&&!X.current&&(y.state==="quoting"||y.state==="ready"&&((lt=y.attempt)==null?void 0:lt.attemptId)!==xe.current)&&L(null);const K=r.useRef(h);K.current=h;const ge=r.useRef(g);ge.current=g;const B=r.useRef({accountId:null,address:null});function $(f,z){return!f||K.current!==f.accountId||ge.current!==f.address?Promise.resolve(null):ne.current.renew(z)}we&&(ke.current=D,b.reset(),R(null),L(null));const ye=r.useRef({accountId:h,address:g});(ye.current.accountId!==h||ye.current.address!==g)&&(ye.current={accountId:h,address:g},b.reset(),R(null),L(null)),(_.phase==="pending"||_.phase==="done"||_.phase==="failed")&&(B.current.accountId!==h||B.current.address!==g)&&_.reset({handOver:B.current.accountId===h}),r.useEffect(()=>{var k,W;if(_.phase!=="failed"||!!(_.signature||(W=(k=_.attempt)==null?void 0:k.submission)!=null&&W.signature))return;const z=Ws(_.attempt);z&&R(z),_.reset(),$(B.current,{cancel:!1})},[_.phase,_.signature,_.attempt]);async function Ae({attempt:f,serializedUnsigned:z,preparedFor:k},W=f.attemptId,Le=0,te=(V=>(V=f.quote)==null?void 0:V.amount)()??null){var ve,$e,Y;B.current=k;const Be=(U,he)=>{if(K.current!==(k==null?void 0:k.accountId)||ge.current!==(k==null?void 0:k.address)){const Ne=new Error(Lt);throw Ne.code=Lt,Ne}return oe(U,he)},de=await _.submit({attempt:f,serializedUnsigned:z,sign:Be,onDone:le});if(de==="rejected"){R("Couldn't start the trade. Try again."),la({attemptId:f.attemptId,version:f.version,reason:"user_cancelled"},{shouldStop:()=>K.current!==(k==null?void 0:k.accountId)}).then(()=>{$(k,{cancel:!1})});return}if(de==="offline"){R("No connection, try again");return}if(de==="quote_expired"){X.current=!0;let U;try{U=await $(k,{replacesAttemptId:W,amount:te})}finally{X.current=!1}if(!U)return;if(((ve=U.resubmit)==null?void 0:ve.verdict)==="accepted"&&Le<Ga){ne.current.freeze(),await Ae(U,W,Le+1,te);return}xe.current=(($e=U.attempt)==null?void 0:$e.attemptId)??null,L(((Y=U.resubmit)==null?void 0:Y.reasonText)??null);return}}function He(){!y.attempt||y.state!=="ready"||(R(null),L(null),y.freeze(),Ae({attempt:y.attempt,serializedUnsigned:y.serializedUnsigned,preparedFor:y.preparedFor}))}const ce=y.state==="error"&&((rt=y.error)==null?void 0:rt.code)==="terms_required",ue=r.useRef(!1);ce&&!ue.current?(ue.current=!0,o.reload()):ce||(ue.current=!1);const _e=c&&v.state==="ready"?Ve(v.positions,t):null,J=Oa(_e),Z=J.usdText!==null?"usd":"token",Ee=c?Z:E?"sol":"usd",je=!c&&E&&re.
6state==="ready"?((it=(ot=re.limits)==null?void 0:ot.convert)==null?void 0:it.maxLamports)??null:null,ee=!c&&E&&!je,m=b.current,Je=m!=null&&m.canQuote?m.amountRaw:null;function Ze(f){O&&(R(null),L(null),b.type(f,Ee))}function es(f){O&&(R(null),L(null),b.choose(f))}async function ts(f){if(!(H||f===D&&f===q)){Te(!0),Se(!1);try{await aa(f),le()}catch{Se(!0)}finally{Te(!1)}}}function ss(){M&&y.retry()}let F,Pe=null,Fe=!1;if(p.status==="loading"||u.status==="loading"||u.status==="connecting")F=e.jsx("p",{role:"status",children:"Loadingâ¦"});else if(!j)Fe=!0,F=e.jsxs("div",{className:"buy-sheet__gate",children:[e.jsx("h2",{className:"buy-sheet__gate-title",children:c?"Sign in to sell":"Sign in to buy"}),e.jsx("p",{className:"buy-sheet__gate-text",children:"You need an account to trade."}),e.jsxs("a",{className:"buy-sheet__gate-button buy-sheet__gate-google",href:`${bs}/api/v1/auth/google`,onClick:()=>xs(typeof window<"u"?window.location.pathname:null),children:[e.jsx(ha,{}),"Continue with Google"]})]});else if(!T)Fe=!0,F=e.jsxs("div",{className:"buy-sheet__gate",children:[e.jsx("h2",{className:"buy-sheet__gate-title",children:c?"Connect wallet to sell":"Connect wallet to buy"}),e.jsx("p",{className:"buy-sheet__gate-text",children:"Trading needs a connected wallet."}),e.jsx(ae,{className:"buy-sheet__gate-button",to:Ht(),children:"Connect wallet"})]});else if(o.status==="loading")F=e.jsx("p",{role:"status",children:"Loadingâ¦"});else if(o.status==="error")F=e.jsxs("div",{className:"trading-notice",role:"alert",children:[e.jsx("p",{children:ze(o.error,l)}),e.jsx("button",{type:"button",onClick:()=>o.reload(),children:"Retry"})]});else if(o.status==="required")F=e.jsx(gs,{terms:o,onAccepted:ss,onClose:s});else if(o.status==="accepted"){const f=Q?Ys(Q.display):null,z=y.state==="error"&&Ks(y.error),k=z,W=!O,Le=y.state==="ready"&&!k&&O,te=_.signature||((ut=(ct=_.attempt)==null?void 0:ct.submission)==null?void 0:ut.signature)||null,V=_.phase==="done"?Vs(_.attempt,te):null;Pe=V?Gs((dt=_.attempt)==null?void 0:dt.result,V.url):null;const Be=e.jsxs("div",{className:"buy-sheet__keypad",children:[Qa.map(S=>e.jsx("button",{type:"button",disabled:ee||W,onClick:()=>Ze(S),children:S},S)),e.jsx("button",{type:"button","aria-label":"Delete",disabled:ee||W,onClick:()=>Ze("delete"),children:"â«"})]}),de=S=>e.jsx("div",{className:"buy-sheet__presets",children:(S||[]).map(G=>{var Me;return e.jsx("button",{type:"button",className:"buy-sheet__chip","aria-pressed":((Me=b.entry)==null?void 0:Me.kind)==="preset"&&b.entry.label===G.label,disabled:ee||W,onClick:()=>es(G),children:G.label},G.label)})}),ve=f!=null&&f.impactWarning&&f.impactWarning.level!=="high"?e.jsx("p",{className:"buy-sheet__impact-warn",role:"status",children:f.impactWarning.text}):null,$e=((ht=f==null?void 0:f.impactWarning)==null?void 0:ht.level)==="high"?e.jsx("p",{className:"buy-sheet__impact-high",role:"alert",children:f.impactWarning.text}):null,Y=((pt=b.entry)==null?void 0:pt.kind)==="typed"?b.entry.input.value:null,U=((mt=b.entry)==null?void 0:mt.kind)==="preset"?(m==null?void 0:m.amountText)??null:null,he=y.state==="error"&&!ce&&!z?y.error:null,Ne=he?ze(he,l):null,pe=k&&O?((ft=y.error)==null?void 0:ft.text)??Qs:m!=null&&m.blockedText&&(m.overBalance||!m.canQuote)?m.blockedText:m!=null&&m.error?ze(m.error,l):Ne??(be?"Price paused. Tap to refresh.":ie),vt=pe!==null&&pe!==ie&&!(be&&pe==="Price paused. Tap to refresh."),ns=he&&he.code!=="quote_daily_limit"&&pe===Ne,Nt=e.jsx("div",{className:"buy-sheet__issue-slot",children:pe?e.jsxs("p",{className:vt?"buy-sheet__error":"buy-sheet__hint",role:vt?"alert":"status",children:[pe,ns?e.jsxs(e.Fragment,{children:[" ",e.jsx("button",{type:"button",className:"buy-sheet__retry",onClick:y.retry,children:"Retry"})]}):null]}):null}),Tt=m!=null&&m.invalid?e.jsx("p",{className:"buy-sheet__hint",role:"status",children:"Enter a valid amount"}):null;let me,De=null,St=null;if(c)if(v.state==="loading"||v.state==="idle")me=e.jsx("p",{role:"status",children:"Loadingâ¦"});else if(v.state==="error")me=e.jsxs("div",{className:"trading-notice",role:"alert",children:[e.jsx("p",{children:"Couldn't load your balance."}),e.jsx("button",{type:"button",onClick:v.retry,children:"Retry"})]});else if(!_e)me=e.jsx("p",{role:"status",children:"You don't hold this token."});else{const S=a||"token";J.tokenText!==null&&(De=`${J.tokenText} available`,St=J.usdText);const G=Y!==null?Z==="usd"?`$${Y}`:`${Y} ${S}`:U??(Z==="usd"?"$0":`0 ${S}`),Me=m?((yt=b.entry)==null?void 0:yt.kind)==="typed"&&Z==="usd"?m.amountText:m.usdText:null;me=e.jsxs(e.Fragment,{children:[e.jsx("p",{className:"buy-sheet__amount","aria-label":"Amount",children:G}),Nt,Tt,ve,e.jsx("p",{className:"buy-sheet__amount-other",children:Me}),de(x==null?void 0:x.sell),Be]})}else{E?De=Xs(je):typeof((bt=v.cash)==null?void 0:bt.usdcAmountText)=="str
6ing"&&v.cash.usdcAmountText!==""&&(De=`${v.cash.usdcAmountText} available`);const S=Y!==null?E?`${Y} SOL`:`$${Y}`:U??(E?"0 SOL":"$0");me=e.jsxs(e.Fragment,{children:[e.jsx("p",{className:"buy-sheet__amount","aria-label":"Amount",children:S}),E&&ee?e.jsx("p",{className:"buy-sheet__hint",role:"status",children:re.state==="loading"||re.state==="idle"?"Checking your SOL limitâ¦":"Can't pay with SOL right now. Pay with USDC."}):null,Nt,Tt,ve,e.jsx("p",{className:"buy-sheet__amount-other",children:f?`You receive ${f.receive}`:null}),de(E?(xt=x==null?void 0:x.buy)==null?void 0:xt.sol:(gt=x==null?void 0:x.buy)==null?void 0:gt.usdc),Be]})}const ls=((jt=(_t=Q==null?void 0:Q.attempt)==null?void 0:_t.quote)==null?void 0:jt.amount)??null,rs=b.entry===null?"Enter an amount":c?"Slide to sell":"Slide to buy",os=Le&&Je!==null&&Je===M&&ls===M,is=f?e.jsx(na,{breakdown:f}):null,cs=!c&&A!==null&&!P?e.jsxs("div",{className:"buy-sheet__pay-wrap",children:[e.jsxs("div",{className:"buy-sheet__pay",role:"radiogroup","aria-label":"Pay with",children:[e.jsx("span",{className:"buy-sheet__pay-label",children:"Pay with"}),Va.filter(([S])=>A[S]===!0).map(([S,G])=>e.jsx("button",{type:"button",role:"radio","aria-checked":D===S,className:`buy-sheet__pay-option${D===S?" buy-sheet__pay-option--on":""}`,disabled:H,onClick:()=>ts(S),children:G},S))]}),q!==null&&q!==A.default?e.jsx("p",{className:"buy-sheet__pay-note",role:"status",children:`Not enough ${q==="sol"?"SOL":"USDC"} to pay with it`}):null,fe?e.jsx("p",{className:"buy-sheet__pay-note",role:"alert",children:"Couldn't save. Try again."}):null]}):null;F=P?e.jsxs("div",{className:"buy-sheet__gate",children:[e.jsx("p",{role:"status",children:"You have nothing to pay with. Deposit USDC or SOL to buy."}),e.jsx(ae,{className:"trading-button",to:fs(),children:"Deposit"})]}):e.jsx("div",{className:`buy-sheet__form${w&&f?" is-details":""}`,children:V&&Pe?e.jsx(Js,{view:Pe,onDone:s,extraAction:e.jsx(Ue,{mint:t,title:a?`${a} · Deside`:"Deside",label:"Share",className:"buy-sheet__share"}),children:e.jsx(Ut,{attempt:_.attempt,onNavigate:s})}):V?e.jsx(Et,{tone:"done",message:V.text,url:V.url||null,primaryLabel:"Done",onPrimary:s,primaryDemoted:Jt(_.attempt,d),extraAction:e.jsx(Ue,{mint:t,title:a?`${a} · Deside`:"Deside",label:"Share",className:"buy-sheet__share"}),children:e.jsx(Ut,{attempt:_.attempt,onNavigate:s})}):_.phase==="failed"&&te?e.jsx(Et,{tone:"failed",title:"Failed",message:Zs(_.attempt),primaryLabel:"Try again",onPrimary:()=>{_.reset(),$(B.current,{cancel:!1})},secondaryLabel:"Close",onSecondary:s}):e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"buy-sheet__main",children:[cs,me]}),e.jsxs("div",{className:`buy-sheet__footer${be?" is-paused":""}`,children:[f&&w?is:null,e.jsx(ea,{availableText:De,availableSubText:St,hasBreakdown:!!f,summary:f?f.detailsSummary:null,summaryHigh:f?f.detailsSummaryHigh:!1,open:w,onToggle:()=>C(S=>!S)}),Re?e.jsx("p",{className:"buy-sheet__error",role:"alert",children:Re}):null,$e,_.phase==="claiming"||_.phase==="signing"?e.jsx(Pt,{}):_.phase==="pending"?e.jsx(Pt,{children:te?e.jsx("a",{className:"buy-sheet__result-link",href:ta(te),target:"_blank",rel:"noopener noreferrer",children:"View on Solscan"}):null}):e.jsx(sa,{label:rs,disabled:!os,onConfirm:He,tone:c?"sell":"buy"})]})]})})}else F=e.jsx("p",{role:"status",children:"Loadingâ¦"});const as=_.phase==="claiming"||_.phase==="signing";return e.jsxs("div",{className:`buy-sheet${i?" buy-sheet--docked":""}${Fe?" buy-sheet--gate":""}${Pe?" is-done":""}`,role:i?"region":"dialog","aria-modal":i?void 0:"true","aria-label":`${c?"Sell":"Buy"} ${a||"token"}`,children:[i?null:e.jsxs("div",{className:"buy-sheet__top",children:[e.jsx("span",{className:"buy-sheet__grabber","aria-hidden":"true"}),e.jsx("button",{type:"button",className:"buy-sheet__close","aria-label":"Close",onClick:s,disabled:as,children:e.jsx(Xe,{size:20,"aria-hidden":"true"})})]}),n&&!i?e.jsxs("header",{className:"buy-sheet__header",children:[e.jsx(Ge,{mint:t,symbol:a,imageUrl:(n==null?void 0:n.imageUrl)??null,thumbUrl:(n==null?void 0:n.thumbUrl)??null,size:44}),e.jsxs("div",{className:"buy-sheet__header-name",children:[e.jsx("strong",{children:a||"Token"}),n!=null&&n.cap?e.jsx("span",{children:`${n.cap.text} MC`}):null,t?e.jsx(Xa,{mint:t}):null]}),e.jsxs("div",{className:"buy-sheet__header-price",children:[n!=null&&n.price?e.jsx("strong",{children:n.price.text}):null,e.jsx(Ot,{label:(n==null?void 0:n.changeText)??null,direction:(n==null?void 0:n.changeDirection)??null})]})]}):null,F]})}function Ja(t,a){const[s,l]=r.useState({key:null,items:[],more:!1}),n=t&&a?`${t}:${a}`:null,i=r.useRef(n);i.current=n;const d=r.useRef(null),c=r.useCallback(()=>{var u;if(!n)return;(u=d.current)==null||u.abort();const p=new AbortController;d.current=p,ra({mint:a},{signal:p.signal}).then(o=>{p.signal.aborted||i.current!==n||l({key:n,items:o.items.filter(j=>(j==null?void 0:j.mint)===a),more:o.nextBefore!==null})}).catch(()=>{p.signal.aborted||i.current!==n||l({key:n,items:[],more:!1})})},[n,a]);return r.useEffect(()=>{if(!n)return;const p=()=>document.visibilityState==="visible";p()&&c();const u=setInterval(()=>{p()&&c()},ys),o=()=>{p()&&c()};return document.addEventListener("visibilitychange",o),()=>{var j;clearInterval(u),document.removeEventListener("visibilitychange",o),(j=d.current)==null||j.abort()}},[n,c]),n&&s.key===n?s:{key:n,items:[],more:!1}}const Zt="(min-width: 1100px)";function Za(){return typeof window<"u"&&typeof window.matchMedia=="function"&&window.matchMedia(Zt).matches}function en(){const[t,a]=r.useState(Za);return r.useEffect(()=>{var n;if(typeof window>"u"||typeof window.matchMedia!="function")return;const s=window.matchMedia(Zt),l=()=>a(s.matches);return l(),(n=s.addEventListener)==null||n.call(s,"change",l),()=>{var i;return(i=s.removeEventListener)==null?void 0:i.call(s,"change",l)}},[]),t}function Ke(t){return typeof t!="string"||t.length<8?t||"":`${t.slice(0,4)}â¦${t.slice(-4)}`}function tn({mint:t}){var ue,_e,J,qe,Z,Ee,je,ee;const a=Ps(),{model:s,market:l,rowRead:n,seed:i,ficha:d,history:c,range:p,setRange:u,maxCandles:o,setMa
6xCandles:j}=Ls(t),[T,h]=Ns(),[g,b]=r.useState(0),x=Ka({chain:"solana",mint:t,range:p,maxCandles:o,reloadKey:g}),w=()=>h({tab:Ct.posts}),C=(ue=Ts().state)==null?void 0:ue.behindHint,v=!!l.ficha&&(Object.prototype.hasOwnProperty.call(l.ficha,"companyPage")||Object.prototype.hasOwnProperty.call(l.ficha,"behindToken")),A=C===void 0&&!i&&n.status==="loading"&&!v,[P,H]=r.useState(null),[Te,fe]=r.useState(!1),[Se,D]=r.useState(!1),q=en(),[E,ke]=r.useState("buy"),[we,M]=r.useState(0),y=r.useRef(null),ne=Qe(),le=Ft(),re=ne.status==="account"?ne.accountId:null,_=le.status==="connected"?le.address:null,oe=zt(_??le.readAddress??null),I=Ja(re,t);oe.state==="ready"&&Ve(oe.positions,t);const O=((J=(_e=l.ficha??i)==null?void 0:_e.identity)==null?void 0:J.symbol)||null;r.useEffect(()=>{O&&(document.title=`${O} · Deside`)},[O]);async function Ce(){H(null);try{await navigator.clipboard.writeText(t),H("success")}catch{H("error")}}if(l.status==="loading"&&!i)return e.jsxs("section",{className:"trading-page trading-token-detail",children:[e.jsx(We,{backTo:se(),symbol:Ke(t),showCompact:!1}),e.jsx("p",{role:"status",children:"Loading token"}),e.jsx("div",{className:"trading-token-detail__hero-skeleton","aria-hidden":"true"}),A?null:e.jsx(e.Fragment,{children:a?e.jsx(kt,{mint:t}):e.jsx(wt,{history:c,range:p,onRangeChange:u,onMaxCandlesChange:j})})]});if(l.status==="error"&&((qe=l.error)==null?void 0:qe.statusCode)===400)return e.jsxs("section",{className:"trading-page trading-token-detail",children:[e.jsx(We,{backTo:se(),symbol:Ke(t),showCompact:!1}),e.jsx(Rt,{icon:ja,title:"Token not found",text:"This address isn't a token we can read on Solana.",actions:[{label:"Search tokens",to:Ss()},{label:"Back to tokens",to:se()}],children:e.jsx("p",{className:"trading-address trading-empty__text","aria-label":`Full token address ${t}`,children:t})})]});if(l.status==="error")return e.jsxs("section",{className:"trading-page trading-token-detail",children:[e.jsx(We,{backTo:se(),symbol:Ke(t),showCompact:!1}),e.jsx(Rt,{icon:oa,role:"alert",title:"Couldn't load this token",text:"Check your connection and try again.",actions:[{label:"Retry",onClick:l.refetch},{label:"Back to tokens",to:se()}]})]});const Q=((d==null?void 0:d.market)||null)===null&&((Z=d==null?void 0:d.declaration)==null?void 0:Z.readState)==="missing",Re=s.age,R=oe.state==="ready"?Ve(oe.positions,t):null,ie=R?Ea(R):null,L=(c==null?void 0:c.chart)??null,X=(L==null?void 0:L.changeText)??null,xe=X??s.change24hText,Oe=X!==null?L.changeDirection??null:s.change24hDirection,K={imageUrl:s.imageUrl,thumbUrl:s.thumbUrl,cap:s.cap,price:s.price,changeText:xe,changeDirection:Oe},ge=X!==null?((Ee=ks.find(m=>m.key===c.range))==null?void 0:Ee.label)??"24h":"24h",B=n.status==="ready"&&((je=n.ficha)==null?void 0:je.teamTab)===!0,$=Bs(T.get("tab"),{hasTeam:B}),ye=Ms({hasTeam:B}),Ae=$s({hasTeam:B}).map(m=>({key:m.key,label:m.label,to:m.key===ye?Ie(t):`${Ie(t)}?tab=${Ct[m.key]}`})),He=s.cap?"MC":null,ce=n.status==="ready"&&n.ficha?ws(n.ficha):null;return e.jsxs("section",{className:`trading-page trading-token-detail${q?" trading-token-detail--desk":""}`,children:[e.jsxs("div",{className:"trading-token-detail__main",children:[e.jsx("div",{ref:y,className:"trading-token-detail__bar",children:ce?e.jsx(Cs,{header:!0,model:ce,leading:e.jsx(ae,{className:"trading-token-hero__back",to:se(),"aria-label":"Back",children:e.jsx(Xe,{size:20,"aria-hidden":"true"})}),tools:e.jsxs("span",{className:"trading-market-row__tools",children:[e.jsx("span",{className:"trading-visually-hidden","aria-label":`Full token address ${s.mint}`,children:s.mint}),e.jsx("button",{type:"button",className:"trading-market-row__tool","aria-label":"Copy address",onClick:Ce,children:e.jsx(Kt,{size:13,"aria-hidden":"true"})}),e.jsx(Ue,{mint:s.mint,title:s.symbol?`${s.symbol} · Deside`:"Deside",className:"trading-market-row__tool"})]})}):e.jsx(Ds,{backTo:se(),mint:s.mint,shortMint:s.shortMint,symbol:s.symbol,name:s.name,imageUrl:s.imageUrl,thumbUrl:s.thumbUrl,onCopy:Ce,launchpad:s.launchpad,xUrl:s.xUrl,xHandle:s.xHandle,capLabel:He,figure:s.figure,changeText:xe,changeDirection:Oe,period:ge,price:s.price,age:Re})}),P==="success"?e.jsx("p",{role:"status",children:"Address copied"}):null,P==="error"?e.jsx("p",{role:"alert",children:"Couldn't copy the address."}):null,A?null:e.jsxs(e.Fragment,{children:[(()=>{const m=e.jsx(wt,{history:c,range:p,onRangeChange:u,onMaxCandlesChange:j,markers:Mt(I.items),postMarkers:x,onPostMarker:w});return a?e.jsx(kt,{mint:t,markers:Mt(I.items),postMarkers:x,onPostMarker:w,fallback:m}):m})(),q?null:e.jsx(Dt,{model:ie}
6),e.jsx(La,{items:I.items,more:I.more,token:{symbol:s.symbol,imageUrl:s.imageUrl}}),e.jsx(Rs,{items:Ae,current:$,className:"trading-token-detail__tabs",ariaLabel:"Token sections"}),$==="team"?e.jsx(Us,{mint:t}):null,$==="posts"?e.jsx("div",{className:"trading-token-detail__posts","data-soon":"Posts are coming soon",children:e.jsx(Wa,{chain:"solana",mint:t,onPosted:()=>b(m=>m+1)})}):null,$==="trades"?e.jsx(Da,{mint:t}):null,$==="holders"?e.jsx($a,{mint:t}):null,$==="about"&&(s.phaseLabel||s.curve)?e.jsxs("div",{className:"trading-token-detail__phase-block",children:[s.phaseLabel&&!s.curve?e.jsxs("p",{className:"trading-token-detail__phase",children:[s.phaseLabel==="Graduated"?e.jsx(As,{size:16,"aria-hidden":"true"}):e.jsx(Es,{size:16,"aria-hidden":"true"}),e.jsx("span",{children:s.phaseLabel})]}):null,s.curve?e.jsx(va,{percent:s.curve.percent,text:s.curve.text}):null]}):null,$==="about"?e.jsx(Os,{mint:s.mint,symbol:s.symbol,description:s.description,xUrl:B?null:s.xUrl,websiteUrl:B?null:s.websiteUrl,about:s.about,audit:s.audit,launchpadLabel:((ee=s.launchpad)==null?void 0:ee.label)??null,age:s.age}):null]}),Q?e.jsx("p",{role:"status",children:"Fetching token dataâ¦"}):null,l.stale?e.jsx("p",{className:"trading-market__observed",children:"Data may be delayed"}):null]}),q?e.jsxs("aside",{className:"trading-token-detail__side","aria-label":"Trade",children:[R?e.jsx("div",{className:"trading-token-detail__side-switch",role:"group","aria-label":"Buy or sell",children:["buy","sell"].map(m=>e.jsx("button",{type:"button",className:`is-${m}`,"aria-pressed":E===m,onClick:()=>ke(m),children:m==="buy"?"Buy":"Sell"},m))}):null,e.jsx(Ye,{docked:!0,side:R?E:"buy",mint:t,symbol:s.symbol,market:K,onClose:()=>M(m=>m+1)},`${R?E:"buy"}-${we}`),e.jsx(Dt,{model:ie})]}):null,q?null:R?e.jsx($t,{label:"Sell",tone:"sell",onClick:()=>D(!0),secondaryLabel:"Buy",secondaryTone:"buy",onSecondaryClick:()=>fe(!0)}):e.jsx($t,{label:"Buy",tone:"buy",onClick:()=>fe(!0)}),Te?e.jsx(Ye,{mint:t,symbol:s.symbol,market:K,onClose:()=>fe(!1)}):null,Se?e.jsx(Ye,{side:"sell",mint:t,symbol:s.symbol,market:K,onClose:()=>D(!1)}):null]})}function _n(){const{mint:t}=_s();return r.useLayoutEffect(()=>{js(0)},[t]),r.useEffect(()=>{var a;(a=document.getElementById("token-ssr"))==null||a.remove()},[]),e.jsx(vs,{bottomNav:!1,appBar:!1,children:e.jsx(tn,{mint:t},t)})}export{_n as default};
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.