tokentracker-cli 0.5.2 → 0.5.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1 @@
1
+ import{ay as Ee,az as Pe,ah as Ae,ai as Ie,r as c,aA as Me,h as $e,j as Re,B as o,aB as Be,aC as $,aD as Ue,C as e,aE as b,au as K,a9 as de,aF as ze,aG as De,a8 as Fe,aH as ce,aI as ge,aJ as Ke}from"./main-b3V-nHUe.js";import{L as pe,a as Oe,l as me,b as xe,c as ue,d as He,e as Ge}from"./leaderboard-columns-wV7NeEpI.js";import{u as Ve,T as Ye}from"./ThemeToggle-BeCU2uxY.js";function L(t,{min:r,max:n,fallback:i}){const s=Number(t);if(!Number.isFinite(s))return i;const d=Math.floor(s);return d<r?r:d>n?n:d}function Je(t,r){const n=L(r,{min:0,max:1e6,fallback:0}),i=L(t,{min:1,max:Math.max(1,n||1),fallback:1});if(n<=1)return[1];const s=new Set([1,n,i-2,i-1,i,i+1,i+2]),d=Array.from(s).filter(m=>Number.isInteger(m)&&m>=1&&m<=n).sort((m,T)=>m-T),x=[];let p=null;for(const m of d)p!=null&&m-p>1&&x.push(null),x.push(m),p=m;return x}function We({page:t,totalPages:r}){const n=typeof r=="number"&&Number.isFinite(r)&&r>=0,i=n?L(r,{min:0,max:1e6,fallback:0}):null,s=L(t,{min:1,max:n?Math.max(1,i||1):1e6,fallback:1}),d=s>1,x=n?s<i:!0;return{canPrev:d,canNext:x,safePage:s,safeTotal:i}}function qe({entries:t,me:r,meLabel:n,limit:i}){const s=L(i,{min:1,max:1e3,fallback:20}),d=Array.isArray(t)?t.slice(0,s):[],x=r&&typeof r.rank=="number"?r.rank:null,p=d.some(N=>!!N?.is_me);if(!x||p)return d;const m={rank:x,is_me:!0,display_name:n,avatar_url:null,gpt_tokens:r?.gpt_tokens??"0",claude_tokens:r?.claude_tokens??"0",gemini_tokens:r?.gemini_tokens??"0",cursor_tokens:r?.cursor_tokens??"0",opencode_tokens:r?.opencode_tokens??"0",openclaw_tokens:r?.openclaw_tokens??"0",other_tokens:r?.other_tokens??"0",total_tokens:r?.total_tokens??"0"},T=3,A=4,g=d.filter(N=>!N?.is_me).filter((N,k)=>k!==T).slice();return g.splice(Math.min(A,g.length),0,m),g.slice(0,s)}const F=20;function be(t){const r=Number(t);return!Number.isFinite(r)||r<=0?"-":r>=1e3?`$${Math.round(r).toLocaleString()}`:r>=10?`$${Math.round(r)}`:`$${r.toFixed(2)}`}function he(t,r){const n=r?"text-oai-gray-700 dark:text-oai-gray-300":"text-oai-gray-500 dark:text-oai-gray-400",i=r?"bg-oai-brand-50 dark:bg-oai-brand-900/10":"bg-white dark:bg-oai-gray-950 group-hover:bg-oai-gray-50 dark:group-hover:bg-oai-gray-900/60";return pe.map(s=>e.jsx("td",{className:b("px-4 py-4 whitespace-nowrap",n,i),children:K(t?.[s.key])},s.key))}function O(t){if(typeof t!="string")return null;const r=t.trim().toLowerCase();return r==="week"||r==="month"||r==="total"?r:null}function Qe(t){if(!t)return o("shared.error.prefix",{error:o("leaderboard.error.unknown")});const r=t?.message||String(t),n=String(r||"").trim()||o("leaderboard.error.unknown");return o("shared.error.prefix",{error:n})}function ye(t){return typeof t!="string"?"":t.trim()}function Xe(t){const r=ye(t);return r?r.toLowerCase()==="anonymous":!0}function Ze(t,r=""){if(typeof t!="string")return null;const n=t.trim().toLowerCase();if(!n)return null;const i=new URLSearchParams(typeof r=="string"?r:""),s=O(i.get("period")),d=s?`?period=${s}`:"";return`/share/pv1-${n}${d}`}function fe(t,r){const n=typeof t?.user_id=="string"?t.user_id.trim():"";return n||`${t?.rank??""}:${r}`}function oa({auth:t,signedIn:r,sessionSoftExpired:n}){const i=Ee(),s=Pe(),{openLoginModal:d}=Ae(),{signedIn:x,loading:p}=Ie(),{resolvedTheme:m,toggleTheme:T}=Ve(),A=c.useMemo(()=>Me(),[]),y=$e(),g=r&&!n,N=c.useMemo(()=>g&&(typeof t=="function"||typeof t=="string"||t&&typeof t=="object")?t:null,[t,g]),k=g?N:null,_=g&&Re(k),H=o("shared.placeholder.short"),[R,C]=c.useState(1),[ke,G]=c.useState(0),[u,I]=c.useState(()=>({loading:!1,error:null,data:null})),[V,we]=c.useState(()=>Be()),[Y,J]=c.useState(!1),[W,q]=c.useState(!1),w=c.useMemo(()=>{const a=new URLSearchParams(i?.search||"");return O(a.get("period"))||"week"},[i?.search]),ve=i?.search||"",je=a=>{const l=O(a);if(!l||l===w)return;const j=new URLSearchParams(i?.search||"");j.set("period",l),C(1),s(`${i?.pathname||"/leaderboard"}?${j.toString()}`,{replace:!0})};c.useEffect(()=>{p||y||x||d()},[x,p,y,d]),c.useEffect(()=>{C(1)},[w]),c.useEffect(()=>{y||g&&(_||I({loading:!1,error:null,data:null}))},[g,_,y]);const Q=c.useMemo(()=>(L(R,{min:1,max:1e6,fallback:1})-1)*F,[R]);c.useEffect(()=>{if(!A&&!y||!y&&g&&!_)return;let a=!0;return I(l=>({...l,loading:!0,error:null})),(async()=>{const l=g?await $(k):null,j=await Ue({accessToken:l,period:w,limit:F,offset:Q});a&&I({loading:!1,error:null,data:j})})().catch(l=>{a&&I({loading:!1,error:Qe(l),data:null})}),()=>{a=!1}},[A,k,g,_,Q,ke,y,w]);const h=u.data,M=h?.total_pages??null,v=h?.page??R,Ne=c.useMemo(()=>Je(v,M),[v,M]),X=h?.from||null,Z=h?.to||null,ee=h?.generated_at||null,ae=h?.me||null,B=o("leaderboard.me_label"),_e=o("leaderboard.anon_label"),re=o("leaderboard.period.week"),te=o("leaderboard.period.month"),oe=o("leaderboard.period.total"),ne=w==="month"?te:w==="total"?oe:re,U=c.useMemo(()=>{const a=Array.isArray(h?.entries)?h.entries:[];return v!==1?a:qe({entries:a,me:ae,meLabel:B,limit:F})},[v,h?.entries,ae,B]),Se=async()=>{J(!0);try{Ke(!0),we(!0),await ce(()=>$(k));const a=await $(k);a&&await ge({accessToken:a}),G(l=>l+1)}catch(a){console.warn("[tokentracker] sync:",a)}finally{J(!1)}},Le=async()=>{q(!0);try{const a=await $(k);V&&a&&await ce(()=>Promise.resolve(a)),a&&await ge({accessToken:a}),G(l=>l+1)}catch(a){console.warn("[tokentracker] refresh:",a)}finally{q(!1)}},{canPrev:ie,canNext:se}=We({page:v,totalPages:M}),Te=Array.isArray(U)&&U.length!==0;let E=null;u.loading?E=e.jsx("div",{className:"px-6 py-12 text-center",children:e.jsx("p",{className:"text-sm text-oai-gray-500 dark:text-oai-gray-400",children:o("leaderboard.loading")})}):u.error?E=e.jsx("div",{className:"px-6 py-12 text-center",children:e.jsx("p",{className:"text-sm text-red-500 dark:text-red-400",children:u.error})}):Te?E=e.jsx("div",{className:"w-full overflow-x-auto",children:e.jsxs("table",{className:"min-w-max w-full text-left text-sm",children:[e.jsx("thead",{className:"border-b border-oai-gray-200 dark:border-oai-gray-800",children:e.jsxs("tr",{children:[e.jsx("th",{className:b(He,"font-medium text-oai-gray-500 dark:text-oai-gray-400"),children:o("leaderboard.column.rank")}),e.jsx("th",{className:b(Ge,"font-medium text-oai-gray-500 dark:text-oai-gray-400"),children:o("leaderboard.column.user")}),e.jsx("th",{className:"px-4 py-4 font-medium text-oai-gray-500 dark:text-oai-gray-400 whitespace-nowrap",children:o("leaderboard.column.total")}),e.jsx("th",{className:"px-4 py-4 font-medium text-oai-gray-500 dark:text-oai-gray-400 whitespace-nowrap",title:"Based on estimated API pricing, not actual billing",children:"Est. Cost"}),pe.map(a=>e.jsx("th",{className:"px-4 py-4 font-medium text-oai-gray-500 dark:text-oai-gray-400 whitespace-nowrap",children:e.jsx(Oe,{iconSrc:a.icon,label:o(a.copyKey)})},a.key))]})}),e.jsx("tbody",{className:"divide-y divide-oai-gray-100 dark:divide-oai-gray-800/50",children:U.map(a=>{const l=!!a?.is_me,j=typeof a?.user_id=="string"?a.user_id:null,le=ye(a?.display_name),Ce=Xe(le)?_e:le,f=l?B:Ce,P=!!j&&!l&&!!a?.is_public?Ze(j,ve):null,S=!!P;return l?e.jsxs("tr",{className:"border-y border-oai-brand-300/40 dark:border-oai-brand-500/30 bg-oai-brand-50 dark:bg-oai-brand-900/10 transition-colors",children:[e.jsx("td",{className:b(me(!0),"font-semibold text-oai-brand-600 dark:text-oai-brand-400"),children:a?.rank??H}),e.jsx("td",{className:ue(!0),children:e.jsxs("div",{className:"flex min-w-0 max-w-[min(320px,55vw)] items-center gap-4",children:[e.jsx(xe,{avatarUrl:a?.avatar_url,displayName:f,seed:fe(a,f)}),e.jsx("span",{className:"truncate font-semibold text-oai-black dark:text-oai-white",children:f})]})}),e.jsx("td",{className:"px-4 py-4 font-medium text-oai-black dark:text-oai-white whitespace-nowrap bg-oai-brand-50 dark:bg-oai-brand-900/10",children:K(a?.total_tokens)}),e.jsx("td",{className:"px-4 py-4 font-medium text-oai-brand-600 dark:text-oai-brand-400 whitespace-nowrap bg-oai-brand-50 dark:bg-oai-brand-900/10",title:"Based on estimated API pricing, not actual billing",children:be(a?.estimated_cost_usd)}),he(a,!0)]},`row-${a?.rank}-${f}`):e.jsxs("tr",{className:b("group transition-colors",S?"cursor-pointer hover:bg-oai-gray-50 dark:hover:bg-oai-gray-900/60":""),onClick:S?()=>{if(typeof window<"u"){window.location.assign(P);return}s(P)}:void 0,onKeyDown:S?D=>{if(D.key==="Enter"||D.key===" "){if(D.preventDefault(),typeof window<"u"){window.location.assign(P);return}s(P)}}:void 0,role:S?"link":void 0,tabIndex:S?0:void 0,"aria-label":S?`Open public dashboard for ${f}`:void 0,children:[e.jsx("td",{className:b(me(!1),"font-medium text-oai-gray-500 dark:text-oai-gray-400"),children:a?.rank??H}),e.jsx("td",{className:ue(!1),children:e.jsxs("div",{className:"flex min-w-0 max-w-[min(320px,55vw)] items-center gap-4",children:[e.jsx(xe,{avatarUrl:a?.avatar_url,displayName:f,seed:fe(a,f)}),e.jsx("span",{className:"truncate font-medium text-oai-gray-800 dark:text-oai-gray-200",children:f})]})}),e.jsx("td",{className:"px-4 py-4 text-oai-gray-700 dark:text-oai-gray-300 whitespace-nowrap bg-white dark:bg-oai-gray-950 group-hover:bg-oai-gray-50 dark:group-hover:bg-oai-gray-900/60",children:K(a?.total_tokens)}),e.jsx("td",{className:"px-4 py-4 text-oai-gray-500 dark:text-oai-gray-400 whitespace-nowrap bg-white dark:bg-oai-gray-950 group-hover:bg-oai-gray-50 dark:group-hover:bg-oai-gray-900/60",title:"Based on estimated API pricing, not actual billing",children:be(a?.estimated_cost_usd)}),he(a,!1)]},`row-${a?.rank}-${f}`)})})]})}):E=e.jsx("div",{className:"px-6 py-12 text-center",children:e.jsx("p",{className:"text-sm text-oai-gray-500 dark:text-oai-gray-400",children:o("leaderboard.empty")})});let z=null;return typeof M=="number"?z=Ne.map((a,l)=>a==null?e.jsx("span",{className:"px-2 text-oai-gray-400 dark:text-oai-gray-500",children:o("leaderboard.pagination.ellipsis")},`ellipsis-${l}`):e.jsx("button",{className:b("flex h-8 w-8 items-center justify-center rounded-md text-sm font-medium transition-colors",a===v?"bg-oai-gray-200 dark:bg-oai-gray-800 text-oai-black dark:text-white":"text-oai-gray-500 dark:text-oai-gray-400 hover:bg-oai-gray-100 dark:hover:bg-oai-gray-800 hover:text-oai-black dark:hover:text-white"),onClick:()=>C(a),disabled:u.loading,children:String(a)},`page-${a}`)):z=e.jsx("span",{className:"text-sm text-oai-gray-500 dark:text-oai-gray-400",children:o("leaderboard.pagination.page_unknown",{page:String(v)})}),e.jsxs("div",{className:"flex flex-col min-h-screen bg-oai-white dark:bg-oai-gray-950 text-oai-black dark:text-oai-white font-oai antialiased transition-colors duration-200",children:[e.jsx("header",{className:"sticky top-0 z-50 bg-white/80 dark:bg-oai-gray-950/80 backdrop-blur-md border-b border-oai-gray-200 dark:border-oai-gray-900 transition-colors duration-200",children:e.jsxs("div",{className:"mx-auto flex h-14 max-w-6xl items-center justify-between px-4 sm:px-6",children:[e.jsxs("div",{className:"flex items-center gap-5",children:[e.jsxs(de,{to:"/",className:"flex items-center gap-3 no-underline outline-none rounded focus-visible:ring-2 focus-visible:ring-oai-brand-500 focus-visible:ring-offset-2 dark:ring-offset-oai-gray-950 transition-opacity hover:opacity-80",children:[e.jsx("img",{src:"/app-icon.png",alt:"",width:24,height:24,className:"rounded-md"}),e.jsx("span",{className:"text-sm font-semibold tracking-wide text-oai-black dark:text-white uppercase",children:"Token Tracker"})]}),e.jsx("div",{className:"hidden sm:block",children:e.jsx(ze,{})})]}),e.jsxs("div",{className:"flex items-center gap-2 sm:gap-3",children:[e.jsx(Ye,{theme:m,onToggle:T}),e.jsx(de,{to:De(),className:b("no-underline inline-flex items-center justify-center h-9 px-5 text-sm font-medium rounded-full transition-colors",x?"shadow-sm ring-1 ring-oai-gray-200 dark:ring-white/10 bg-oai-gray-900 dark:bg-white text-white dark:text-oai-gray-900 hover:bg-oai-gray-800 dark:hover:bg-oai-gray-100":"ring-1 ring-oai-gray-200 dark:ring-oai-gray-700 text-oai-gray-600 dark:text-oai-gray-400 hover:text-oai-gray-900 dark:hover:text-white hover:bg-oai-gray-100 dark:hover:bg-oai-gray-800"),children:o("landing.v2.cta.primary")}),e.jsx(Fe,{})]})]})}),e.jsx("main",{className:"flex-1 py-12 sm:py-16",children:e.jsxs("div",{className:"mx-auto max-w-6xl px-4 sm:px-6",children:[e.jsxs("div",{className:"flex flex-col md:flex-row md:items-end justify-between gap-6 mb-10",children:[e.jsxs("div",{children:[e.jsx("h1",{className:"text-3xl sm:text-4xl font-semibold tracking-tight text-oai-black dark:text-white mb-3",children:o("leaderboard.title")}),e.jsxs("p",{className:"text-oai-gray-500 dark:text-oai-gray-400 text-sm sm:text-base",children:[w==="total"?o("leaderboard.range.total"):X&&Z?o("leaderboard.range",{period:ne,from:X,to:Z}):o("leaderboard.range_loading",{period:ne}),ee&&e.jsx("span",{className:"ml-2 pl-2 border-l border-oai-gray-200 dark:border-oai-gray-800 inline-block text-oai-gray-400 dark:text-oai-gray-500 text-xs",children:o("leaderboard.generated_at",{ts:ee})})]})]}),e.jsxs("div",{className:"flex items-center gap-3",children:[g&&_&&e.jsx("button",{onClick:Le,disabled:W||u.loading,className:"text-sm text-oai-gray-500 dark:text-oai-gray-400 hover:text-oai-black dark:hover:text-white transition-colors disabled:opacity-50",children:W?"Refreshing...":"↻"}),e.jsx("div",{className:"inline-flex p-1 border border-oai-gray-200 dark:border-oai-gray-800 rounded-lg",children:["week","month","total"].map(a=>e.jsx("button",{onClick:()=>je(a),disabled:u.loading,className:b("px-4 py-1.5 text-sm font-medium rounded-md transition-colors",w===a?"bg-oai-gray-200 dark:bg-oai-gray-800 text-oai-black dark:text-white":"text-oai-gray-500 dark:text-oai-gray-400 hover:text-oai-gray-800 dark:hover:text-oai-gray-200"),children:a==="week"?re:a==="month"?te:oe},a))})]})]}),!r&&e.jsxs("div",{className:"mb-6 flex items-center justify-between text-sm",children:[e.jsx("p",{className:"text-oai-gray-500 dark:text-oai-gray-400",children:"Sign in to join the leaderboard"}),e.jsx("button",{onClick:d,className:"px-3 py-1.5 text-sm font-medium text-oai-gray-600 dark:text-oai-gray-300 border border-oai-gray-300 dark:border-oai-gray-700 rounded-md hover:text-oai-black dark:hover:text-white hover:border-oai-gray-400 dark:hover:border-oai-gray-600 transition-colors",children:"Sign In"})]}),g&&_&&!V&&e.jsxs("div",{className:"mb-6 flex items-center justify-between text-sm",children:[e.jsx("p",{className:"text-oai-gray-500 dark:text-oai-gray-400",children:"Enable Cloud Sync to appear in rankings"}),e.jsx("button",{onClick:Se,disabled:Y,className:"px-3 py-1.5 text-sm font-medium text-oai-gray-600 dark:text-oai-gray-300 border border-oai-gray-300 dark:border-oai-gray-700 rounded-md hover:text-oai-black dark:hover:text-white hover:border-oai-gray-400 dark:hover:border-oai-gray-600 disabled:opacity-50 transition-colors",children:Y?"Syncing...":"Enable & Sync"})]}),e.jsxs("div",{className:"rounded-xl border border-oai-gray-200 dark:border-oai-gray-800 overflow-hidden",children:[E,e.jsxs("div",{className:"px-6 py-3 border-t border-oai-gray-200 dark:border-oai-gray-800 flex flex-wrap items-center justify-between gap-4",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("button",{className:b("px-3 py-1.5 text-sm font-medium text-oai-gray-500 dark:text-oai-gray-400 rounded-md transition-colors",ie&&!u.loading?"hover:bg-oai-gray-100 dark:hover:bg-oai-gray-800 hover:text-oai-black dark:hover:text-white":"opacity-50 cursor-not-allowed"),onClick:()=>C(a=>Math.max(1,a-1)),disabled:!ie||u.loading,children:o("leaderboard.pagination.prev")}),e.jsx("button",{className:b("px-3 py-1.5 text-sm font-medium text-oai-gray-500 dark:text-oai-gray-400 rounded-md transition-colors",se&&!u.loading?"hover:bg-oai-gray-100 dark:hover:bg-oai-gray-800 hover:text-oai-black dark:hover:text-white":"opacity-50 cursor-not-allowed"),onClick:()=>C(a=>a+1),disabled:!se||u.loading,children:o("leaderboard.pagination.next")})]}),e.jsx("div",{className:"flex flex-wrap items-center gap-1",children:z})]})]})]})}),e.jsx("footer",{className:"border-t border-oai-gray-200 dark:border-oai-gray-900 py-8 transition-colors duration-200",children:e.jsxs("div",{className:"mx-auto flex max-w-6xl items-center justify-between px-4 sm:px-6 text-sm text-oai-gray-400 dark:text-oai-gray-500",children:[e.jsx("p",{children:o("landing.v2.footer.line")}),e.jsx("a",{href:"https://github.com/mm7894215/tokentracker",className:"text-oai-gray-400 dark:text-oai-gray-500 hover:text-oai-black dark:hover:text-white transition-colors",target:"_blank",rel:"noopener noreferrer",children:o("landing.v2.nav.github")})]})})]})}export{oa as LeaderboardPage};
@@ -1 +1 @@
1
- import{aw as H,r as x,aA as M,h as O,j as D,aC as Y,aK as $,B as a,C as e,aE as f,as as A,a9 as j,aF as F,a8 as G}from"./main-8JBJiGVQ.js";import{L as E,a as W,l as q,f as J,b as Q,d as V,g as X}from"./leaderboard-columns-COq9DxPJ.js";import{u as Z,T as I}from"./ThemeToggle-CQvh_d2Z.js";function ee(r){if(!r)return a("shared.error.prefix",{error:a("leaderboard.error.unknown")});const o=r?.message||String(r),y=String(o||"").trim()||a("leaderboard.error.unknown");return a("shared.error.prefix",{error:y})}function ae(r){return typeof r!="string"?"":r.trim()}function re(r){if(typeof r!="string")return null;const o=r.trim().toLowerCase();return o==="week"||o==="month"||o==="total"?o:null}function ie({auth:r,signedIn:o,sessionSoftExpired:y,userId:s}){const b=H(),{resolvedTheme:R,toggleTheme:C}=Z(),N=x.useMemo(()=>M(),[]),p=O(),i=o&&!y,P=x.useMemo(()=>i&&(typeof r=="function"||typeof r=="string"||r&&typeof r=="object")?r:null,[r,i]),u=i?P:null,w=i&&D(u),c=x.useMemo(()=>{const t=new URLSearchParams(b?.search||"");return re(t.get("period"))||"week"},[b?.search]),v=b?.search||"",[m,g]=x.useState(()=>({loading:!1,error:null,data:null}));x.useEffect(()=>{if(!N&&!p||!s||!p&&(!i||!w))return;let t=!0;return g(d=>({...d,loading:!0,error:null})),(async()=>{const d=await Y(u);if(!t)return;if(!d){g({loading:!1,error:null,data:null});return}const z=await $({accessToken:d,userId:s,period:c});t&&g({loading:!1,error:null,data:z})})().catch(d=>{t&&g({loading:!1,error:ee(d),data:null})}),()=>{t=!1}},[i,w,N,u,p,c,s]);const h=m.data,T=h?.from||null,L=h?.to||null,_=h?.generated_at||null,n=h?.entry||null,k=ae(n?.display_name)||a("leaderboard.anon_label"),B=a("leaderboard.period.week"),K=a("leaderboard.period.month"),U=a("leaderboard.period.total"),S=c==="month"?K:c==="total"?U:B;let l=null;return s?m.loading?l=e.jsx("div",{className:"px-6 py-12 text-center",children:e.jsx("p",{className:"text-sm text-oai-gray-500 dark:text-oai-gray-400",children:a("leaderboard.loading")})}):m.error?l=e.jsx("div",{className:"px-6 py-12 text-center",children:e.jsx("p",{className:"text-sm text-red-500 dark:text-red-400",children:m.error})}):n?l=e.jsx("div",{className:"w-full overflow-x-auto",children:e.jsxs("table",{className:"min-w-max w-full text-left text-sm",children:[e.jsx("thead",{className:"border-b border-oai-gray-200 dark:border-oai-gray-800",children:e.jsxs("tr",{children:[e.jsx("th",{className:f(V,"font-medium text-oai-gray-500 dark:text-oai-gray-400"),children:a("leaderboard.column.rank")}),e.jsx("th",{className:f(X,"font-medium text-oai-gray-500 dark:text-oai-gray-400 whitespace-nowrap"),children:a("leaderboard.column.total")}),E.map(t=>e.jsx("th",{className:"px-4 py-4 font-medium text-oai-gray-500 dark:text-oai-gray-400 whitespace-nowrap",children:e.jsx(W,{iconSrc:t.icon,label:a(t.copyKey)})},t.key))]})}),e.jsx("tbody",{className:"divide-y divide-oai-gray-100 dark:divide-oai-gray-800/50",children:e.jsxs("tr",{className:"transition-colors hover:bg-oai-gray-50 dark:hover:bg-oai-gray-900/60",children:[e.jsx("td",{className:f(q(!1),"font-medium text-oai-gray-500 dark:text-oai-gray-400"),children:n?.rank??a("shared.placeholder.short")}),e.jsx("td",{className:f(J(),"text-oai-gray-700 dark:text-oai-gray-300"),children:A(n?.total_tokens)}),E.map(t=>e.jsx("td",{className:"px-4 py-4 text-oai-gray-500 dark:text-oai-gray-400 whitespace-nowrap",children:A(n?.[t.key])},t.key))]})})]})}):l=e.jsx("div",{className:"px-6 py-12 text-center",children:e.jsx("p",{className:"text-sm text-oai-gray-500 dark:text-oai-gray-400",children:a("leaderboard.empty")})}):l=e.jsx("div",{className:"px-6 py-12 text-center",children:e.jsx("p",{className:"text-sm text-oai-gray-500 dark:text-oai-gray-400",children:a("leaderboard.empty")})}),e.jsxs("div",{className:"flex flex-col min-h-screen bg-oai-white dark:bg-oai-gray-950 text-oai-black dark:text-oai-white font-oai antialiased transition-colors duration-200",children:[e.jsx("header",{className:"sticky top-0 z-50 bg-white/80 dark:bg-oai-gray-950/80 backdrop-blur-md border-b border-oai-gray-200 dark:border-oai-gray-900 transition-colors duration-200",children:e.jsxs("div",{className:"mx-auto flex h-16 max-w-6xl items-center justify-between px-4 sm:px-6",children:[e.jsxs("div",{className:"flex items-center gap-5",children:[e.jsxs(j,{to:"/",className:"flex items-center gap-3 no-underline outline-none rounded focus-visible:ring-2 focus-visible:ring-oai-brand-500 focus-visible:ring-offset-2 dark:ring-offset-oai-gray-950 transition-opacity hover:opacity-80",children:[e.jsx("img",{src:"/app-icon.png",alt:"",width:24,height:24,className:"rounded-md"}),e.jsx("span",{className:"text-sm font-semibold tracking-wide text-oai-black dark:text-white uppercase",children:"Token Tracker"})]}),e.jsx("div",{className:"hidden sm:block",children:e.jsx(F,{})})]}),e.jsxs("div",{className:"flex items-center gap-2 sm:gap-3",children:[e.jsx(j,{to:`/leaderboard${v}`,className:"no-underline inline-flex items-center justify-center h-9 px-5 text-sm font-medium rounded-full shadow-sm ring-1 ring-oai-gray-200 dark:ring-white/10 bg-oai-gray-900 dark:bg-white text-white dark:text-oai-gray-900 hover:bg-oai-gray-800 dark:hover:bg-oai-gray-100 transition-colors",children:a("leaderboard.profile.nav.back")}),e.jsx(I,{theme:R,onToggle:C}),e.jsx(G,{})]})]})}),e.jsx("main",{className:"flex-1 py-12 sm:py-16",children:e.jsxs("div",{className:"mx-auto max-w-6xl px-4 sm:px-6",children:[e.jsxs("div",{className:"flex flex-col sm:flex-row sm:items-center gap-6 mb-10",children:[e.jsx(Q,{avatarUrl:n?.avatar_url,displayName:k,seed:typeof s=="string"?s:k,size:"lg",className:"shrink-0 ring-2 ring-oai-gray-200 dark:ring-oai-gray-800"}),e.jsxs("div",{className:"min-w-0",children:[e.jsx("h1",{className:"text-3xl sm:text-4xl font-semibold tracking-tight text-oai-black dark:text-white mb-3",children:k}),e.jsxs("p",{className:"text-oai-gray-500 dark:text-oai-gray-400 text-sm sm:text-base",children:[c==="total"?a("leaderboard.range.total"):T&&L?a("leaderboard.range",{period:S,from:T,to:L}):a("leaderboard.range_loading",{period:S}),_&&e.jsx("span",{className:"ml-2 pl-2 border-l border-oai-gray-200 dark:border-oai-gray-800 inline-block text-oai-gray-400 dark:text-oai-gray-500 text-xs",children:a("leaderboard.generated_at",{ts:_})})]})]})]}),e.jsx("div",{className:"rounded-xl border border-oai-gray-200 dark:border-oai-gray-800 overflow-hidden",children:l})]})}),e.jsx("footer",{className:"border-t border-oai-gray-200 dark:border-oai-gray-900 py-8 transition-colors duration-200",children:e.jsxs("div",{className:"mx-auto flex max-w-6xl items-center justify-between px-4 sm:px-6 text-sm text-oai-gray-400 dark:text-oai-gray-500",children:[e.jsx("p",{children:a("landing.v2.footer.line")}),e.jsx(j,{to:`/leaderboard${v}`,className:"text-oai-gray-400 dark:text-oai-gray-500 hover:text-oai-black dark:hover:text-white transition-colors",children:a("leaderboard.profile.nav.back")})]})})]})}export{ie as LeaderboardProfilePage};
1
+ import{ay as H,r as x,aA as M,h as O,j as D,aC as Y,aK as $,B as a,C as e,aE as f,au as A,a9 as j,aF as F,a8 as G}from"./main-b3V-nHUe.js";import{L as E,a as W,l as q,f as J,b as Q,d as V,g as X}from"./leaderboard-columns-wV7NeEpI.js";import{u as Z,T as I}from"./ThemeToggle-BeCU2uxY.js";function ee(r){if(!r)return a("shared.error.prefix",{error:a("leaderboard.error.unknown")});const o=r?.message||String(r),y=String(o||"").trim()||a("leaderboard.error.unknown");return a("shared.error.prefix",{error:y})}function ae(r){return typeof r!="string"?"":r.trim()}function re(r){if(typeof r!="string")return null;const o=r.trim().toLowerCase();return o==="week"||o==="month"||o==="total"?o:null}function ie({auth:r,signedIn:o,sessionSoftExpired:y,userId:s}){const b=H(),{resolvedTheme:R,toggleTheme:C}=Z(),N=x.useMemo(()=>M(),[]),p=O(),i=o&&!y,P=x.useMemo(()=>i&&(typeof r=="function"||typeof r=="string"||r&&typeof r=="object")?r:null,[r,i]),u=i?P:null,w=i&&D(u),c=x.useMemo(()=>{const t=new URLSearchParams(b?.search||"");return re(t.get("period"))||"week"},[b?.search]),v=b?.search||"",[m,g]=x.useState(()=>({loading:!1,error:null,data:null}));x.useEffect(()=>{if(!N&&!p||!s||!p&&(!i||!w))return;let t=!0;return g(d=>({...d,loading:!0,error:null})),(async()=>{const d=await Y(u);if(!t)return;if(!d){g({loading:!1,error:null,data:null});return}const z=await $({accessToken:d,userId:s,period:c});t&&g({loading:!1,error:null,data:z})})().catch(d=>{t&&g({loading:!1,error:ee(d),data:null})}),()=>{t=!1}},[i,w,N,u,p,c,s]);const h=m.data,T=h?.from||null,L=h?.to||null,_=h?.generated_at||null,n=h?.entry||null,k=ae(n?.display_name)||a("leaderboard.anon_label"),B=a("leaderboard.period.week"),K=a("leaderboard.period.month"),U=a("leaderboard.period.total"),S=c==="month"?K:c==="total"?U:B;let l=null;return s?m.loading?l=e.jsx("div",{className:"px-6 py-12 text-center",children:e.jsx("p",{className:"text-sm text-oai-gray-500 dark:text-oai-gray-400",children:a("leaderboard.loading")})}):m.error?l=e.jsx("div",{className:"px-6 py-12 text-center",children:e.jsx("p",{className:"text-sm text-red-500 dark:text-red-400",children:m.error})}):n?l=e.jsx("div",{className:"w-full overflow-x-auto",children:e.jsxs("table",{className:"min-w-max w-full text-left text-sm",children:[e.jsx("thead",{className:"border-b border-oai-gray-200 dark:border-oai-gray-800",children:e.jsxs("tr",{children:[e.jsx("th",{className:f(V,"font-medium text-oai-gray-500 dark:text-oai-gray-400"),children:a("leaderboard.column.rank")}),e.jsx("th",{className:f(X,"font-medium text-oai-gray-500 dark:text-oai-gray-400 whitespace-nowrap"),children:a("leaderboard.column.total")}),E.map(t=>e.jsx("th",{className:"px-4 py-4 font-medium text-oai-gray-500 dark:text-oai-gray-400 whitespace-nowrap",children:e.jsx(W,{iconSrc:t.icon,label:a(t.copyKey)})},t.key))]})}),e.jsx("tbody",{className:"divide-y divide-oai-gray-100 dark:divide-oai-gray-800/50",children:e.jsxs("tr",{className:"transition-colors hover:bg-oai-gray-50 dark:hover:bg-oai-gray-900/60",children:[e.jsx("td",{className:f(q(!1),"font-medium text-oai-gray-500 dark:text-oai-gray-400"),children:n?.rank??a("shared.placeholder.short")}),e.jsx("td",{className:f(J(),"text-oai-gray-700 dark:text-oai-gray-300"),children:A(n?.total_tokens)}),E.map(t=>e.jsx("td",{className:"px-4 py-4 text-oai-gray-500 dark:text-oai-gray-400 whitespace-nowrap",children:A(n?.[t.key])},t.key))]})})]})}):l=e.jsx("div",{className:"px-6 py-12 text-center",children:e.jsx("p",{className:"text-sm text-oai-gray-500 dark:text-oai-gray-400",children:a("leaderboard.empty")})}):l=e.jsx("div",{className:"px-6 py-12 text-center",children:e.jsx("p",{className:"text-sm text-oai-gray-500 dark:text-oai-gray-400",children:a("leaderboard.empty")})}),e.jsxs("div",{className:"flex flex-col min-h-screen bg-oai-white dark:bg-oai-gray-950 text-oai-black dark:text-oai-white font-oai antialiased transition-colors duration-200",children:[e.jsx("header",{className:"sticky top-0 z-50 bg-white/80 dark:bg-oai-gray-950/80 backdrop-blur-md border-b border-oai-gray-200 dark:border-oai-gray-900 transition-colors duration-200",children:e.jsxs("div",{className:"mx-auto flex h-14 max-w-6xl items-center justify-between px-4 sm:px-6",children:[e.jsxs("div",{className:"flex items-center gap-5",children:[e.jsxs(j,{to:"/",className:"flex items-center gap-3 no-underline outline-none rounded focus-visible:ring-2 focus-visible:ring-oai-brand-500 focus-visible:ring-offset-2 dark:ring-offset-oai-gray-950 transition-opacity hover:opacity-80",children:[e.jsx("img",{src:"/app-icon.png",alt:"",width:24,height:24,className:"rounded-md"}),e.jsx("span",{className:"text-sm font-semibold tracking-wide text-oai-black dark:text-white uppercase",children:"Token Tracker"})]}),e.jsx("div",{className:"hidden sm:block",children:e.jsx(F,{})})]}),e.jsxs("div",{className:"flex items-center gap-2 sm:gap-3",children:[e.jsx(j,{to:`/leaderboard${v}`,className:"no-underline inline-flex items-center justify-center h-9 px-5 text-sm font-medium rounded-full shadow-sm ring-1 ring-oai-gray-200 dark:ring-white/10 bg-oai-gray-900 dark:bg-white text-white dark:text-oai-gray-900 hover:bg-oai-gray-800 dark:hover:bg-oai-gray-100 transition-colors",children:a("leaderboard.profile.nav.back")}),e.jsx(I,{theme:R,onToggle:C}),e.jsx(G,{})]})]})}),e.jsx("main",{className:"flex-1 py-12 sm:py-16",children:e.jsxs("div",{className:"mx-auto max-w-6xl px-4 sm:px-6",children:[e.jsxs("div",{className:"flex flex-col sm:flex-row sm:items-center gap-6 mb-10",children:[e.jsx(Q,{avatarUrl:n?.avatar_url,displayName:k,seed:typeof s=="string"?s:k,size:"lg",className:"shrink-0 ring-2 ring-oai-gray-200 dark:ring-oai-gray-800"}),e.jsxs("div",{className:"min-w-0",children:[e.jsx("h1",{className:"text-3xl sm:text-4xl font-semibold tracking-tight text-oai-black dark:text-white mb-3",children:k}),e.jsxs("p",{className:"text-oai-gray-500 dark:text-oai-gray-400 text-sm sm:text-base",children:[c==="total"?a("leaderboard.range.total"):T&&L?a("leaderboard.range",{period:S,from:T,to:L}):a("leaderboard.range_loading",{period:S}),_&&e.jsx("span",{className:"ml-2 pl-2 border-l border-oai-gray-200 dark:border-oai-gray-800 inline-block text-oai-gray-400 dark:text-oai-gray-500 text-xs",children:a("leaderboard.generated_at",{ts:_})})]})]})]}),e.jsx("div",{className:"rounded-xl border border-oai-gray-200 dark:border-oai-gray-800 overflow-hidden",children:l})]})}),e.jsx("footer",{className:"border-t border-oai-gray-200 dark:border-oai-gray-900 py-8 transition-colors duration-200",children:e.jsxs("div",{className:"mx-auto flex max-w-6xl items-center justify-between px-4 sm:px-6 text-sm text-oai-gray-400 dark:text-oai-gray-500",children:[e.jsx("p",{children:a("landing.v2.footer.line")}),e.jsx(j,{to:`/leaderboard${v}`,className:"text-oai-gray-400 dark:text-oai-gray-500 hover:text-oai-black dark:hover:text-white transition-colors",children:a("leaderboard.profile.nav.back")})]})})]})}export{ie as LeaderboardProfilePage};
@@ -1 +1 @@
1
- import{r as x,aL as m,ab as k,C as t,ac as u}from"./main-8JBJiGVQ.js";function j(){const a=x.useContext(m);if(a===null)throw new Error("useTheme must be used within a ThemeProvider");return a}function y({theme:a,onToggle:g,className:s="",size:e=36,iconSize:n=20}){const p=k(),o=a==="dark",i=()=>{g?.(o?"light":"dark")},c={width:e,height:e,borderRadius:8,background:"transparent",border:"none",cursor:"pointer",display:"flex",alignItems:"center",justifyContent:"center",color:"var(--oai-gray-600)",transition:"background-color 150ms ease, color 150ms ease"},l={backgroundColor:"var(--oai-gray-100)",color:"var(--oai-black)"},d=()=>t.jsxs("svg",{"aria-hidden":"true",width:n,height:n,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[t.jsx("circle",{cx:"12",cy:"12",r:"4"}),t.jsx("path",{d:"M12 2v2"}),t.jsx("path",{d:"M12 20v2"}),t.jsx("path",{d:"m4.93 4.93 1.41 1.41"}),t.jsx("path",{d:"m17.66 17.66 1.41 1.41"}),t.jsx("path",{d:"M2 12h2"}),t.jsx("path",{d:"M20 12h2"}),t.jsx("path",{d:"m6.34 17.66-1.41 1.41"}),t.jsx("path",{d:"m19.07 4.93-1.41 1.41"})]}),h=()=>t.jsx("svg",{"aria-hidden":"true",width:n,height:n,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:t.jsx("path",{d:"M12 3a6 6 0 0 0 9 9 9 9 0 1 1-9-9Z"})});return p?t.jsx("button",{type:"button","aria-label":o?"Switch to light mode":"Switch to dark mode",onClick:i,className:`oai-button-ghost oai-button-sm ${s}`,style:{...c,width:e,height:e,padding:0},title:o?"切换到亮色模式":"切换到暗色模式",onMouseEnter:r=>{r.currentTarget.style.backgroundColor=l.backgroundColor,r.currentTarget.style.color=l.color},onMouseLeave:r=>{r.currentTarget.style.backgroundColor="transparent",r.currentTarget.style.color="var(--oai-gray-600)"},children:o?t.jsx(h,{}):t.jsx(d,{})}):t.jsx(u.button,{type:"button","aria-label":o?"Switch to light mode":"Switch to dark mode",onClick:i,className:`oai-button-ghost oai-button-sm ${s}`,style:{...c,width:e,height:e,padding:0},title:o?"切换到亮色模式":"切换到暗色模式",whileHover:{backgroundColor:"var(--oai-gray-100)",color:"var(--oai-black)"},whileTap:{scale:.95},transition:{type:"spring",stiffness:400,damping:25},children:t.jsx(u.div,{initial:{scale:.8,opacity:0,rotate:-20},animate:{scale:1,opacity:1,rotate:0},exit:{scale:.8,opacity:0,rotate:20},transition:{type:"spring",stiffness:400,damping:25},children:o?t.jsx(h,{}):t.jsx(d,{})},o?"moon":"sun")})}export{y as T,j as u};
1
+ import{r as x,aL as m,ab as k,C as t,ac as u}from"./main-b3V-nHUe.js";function j(){const a=x.useContext(m);if(a===null)throw new Error("useTheme must be used within a ThemeProvider");return a}function y({theme:a,onToggle:g,className:s="",size:e=36,iconSize:n=20}){const p=k(),o=a==="dark",i=()=>{g?.(o?"light":"dark")},c={width:e,height:e,borderRadius:8,background:"transparent",border:"none",cursor:"pointer",display:"flex",alignItems:"center",justifyContent:"center",color:"var(--oai-gray-600)",transition:"background-color 150ms ease, color 150ms ease"},l={backgroundColor:"var(--oai-gray-100)",color:"var(--oai-black)"},d=()=>t.jsxs("svg",{"aria-hidden":"true",width:n,height:n,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[t.jsx("circle",{cx:"12",cy:"12",r:"4"}),t.jsx("path",{d:"M12 2v2"}),t.jsx("path",{d:"M12 20v2"}),t.jsx("path",{d:"m4.93 4.93 1.41 1.41"}),t.jsx("path",{d:"m17.66 17.66 1.41 1.41"}),t.jsx("path",{d:"M2 12h2"}),t.jsx("path",{d:"M20 12h2"}),t.jsx("path",{d:"m6.34 17.66-1.41 1.41"}),t.jsx("path",{d:"m19.07 4.93-1.41 1.41"})]}),h=()=>t.jsx("svg",{"aria-hidden":"true",width:n,height:n,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:t.jsx("path",{d:"M12 3a6 6 0 0 0 9 9 9 9 0 1 1-9-9Z"})});return p?t.jsx("button",{type:"button","aria-label":o?"Switch to light mode":"Switch to dark mode",onClick:i,className:`oai-button-ghost oai-button-sm ${s}`,style:{...c,width:e,height:e,padding:0},title:o?"切换到亮色模式":"切换到暗色模式",onMouseEnter:r=>{r.currentTarget.style.backgroundColor=l.backgroundColor,r.currentTarget.style.color=l.color},onMouseLeave:r=>{r.currentTarget.style.backgroundColor="transparent",r.currentTarget.style.color="var(--oai-gray-600)"},children:o?t.jsx(h,{}):t.jsx(d,{})}):t.jsx(u.button,{type:"button","aria-label":o?"Switch to light mode":"Switch to dark mode",onClick:i,className:`oai-button-ghost oai-button-sm ${s}`,style:{...c,width:e,height:e,padding:0},title:o?"切换到亮色模式":"切换到暗色模式",whileHover:{backgroundColor:"var(--oai-gray-100)",color:"var(--oai-black)"},whileTap:{scale:.95},transition:{type:"spring",stiffness:400,damping:25},children:t.jsx(u.div,{initial:{scale:.8,opacity:0,rotate:-20},animate:{scale:1,opacity:1,rotate:0},exit:{scale:.8,opacity:0,rotate:20},transition:{type:"spring",stiffness:400,damping:25},children:o?t.jsx(h,{}):t.jsx(d,{})},o?"moon":"sun")})}export{y as T,j as u};
@@ -1 +1 @@
1
- import{C as n,aE as i}from"./main-8JBJiGVQ.js";function l(r){let e=0;const o=String(r??"");for(let a=0;a<o.length;a+=1)e=Math.imul(31,e)+o.charCodeAt(a)|0;return Math.abs(e)%360}function b(r){const e=String(r??"").trim();if(!e)return"?";const o=e.split(/\s+/).filter(Boolean);if(o.length>=2){const a=o[0][0]||"",t=o[1][0]||"";return`${a}${t}`.toUpperCase()}return e.slice(0,2).toUpperCase()}const c={sm:"h-7 w-7 min-h-7 min-w-7 text-[10px]",md:"h-8 w-8 min-h-8 min-w-8 text-[11px]",lg:"h-14 w-14 min-h-14 min-w-14 text-base"};function y({avatarUrl:r,displayName:e,seed:o,size:a="md",className:t}){const s=c[a]||c.md,g=l(o??e??""),d=typeof r=="string"?r.trim():"";return d?n.jsx("img",{src:d,alt:"",className:i("rounded-full object-cover ring-1 ring-white/10",s,t)}):n.jsx("div",{className:i("flex shrink-0 items-center justify-center rounded-full font-semibold text-white ring-1 ring-white/10",s,t),style:{backgroundColor:`hsl(${g} 42% 34%)`},"aria-hidden":!0,children:b(e)})}function m({iconSrc:r,label:e}){return n.jsxs("span",{className:"inline-flex items-center gap-3",children:[n.jsx("img",{src:r,alt:"",width:16,height:16,className:"h-4 w-4 shrink-0 object-contain opacity-90"}),n.jsx("span",{className:"whitespace-nowrap",children:e})]})}const u=[{key:"gpt_tokens",copyKey:"leaderboard.column.codex",icon:"/brand-logos/codex.svg"},{key:"claude_tokens",copyKey:"leaderboard.column.claude",icon:"/brand-logos/claude-code.svg"},{key:"gemini_tokens",copyKey:"leaderboard.column.gemini",icon:"/brand-logos/gemini.svg"},{key:"cursor_tokens",copyKey:"leaderboard.column.cursor",icon:"/brand-logos/cursor.svg"},{key:"opencode_tokens",copyKey:"leaderboard.column.opencode",icon:"/brand-logos/opencode.svg"},{key:"openclaw_tokens",copyKey:"leaderboard.column.openclaw",icon:"/brand-logos/openclaw.svg"},{key:"other_tokens",copyKey:"leaderboard.column.supplemental",icon:"/brand-logos/gemini.svg"}],h="sticky left-0 z-40 w-[72px] min-w-[72px] max-w-[72px] border-r border-oai-gray-200 dark:border-oai-gray-800 bg-white dark:bg-oai-gray-950 px-4 py-4",k="sticky left-[72px] z-40 min-w-[220px] max-w-[min(320px,40vw)] border-r border-oai-gray-200 dark:border-oai-gray-800 bg-white dark:bg-oai-gray-950 px-4 py-4",x="sticky left-[72px] z-40 min-w-[6rem] border-r border-oai-gray-200 dark:border-oai-gray-800 bg-white dark:bg-oai-gray-950 px-4 py-4";function w(r){return i("sticky left-0 z-30 w-[72px] min-w-[72px] max-w-[72px] border-r border-oai-gray-200 dark:border-oai-gray-800 px-4 py-4 whitespace-nowrap",r?"bg-oai-brand-50 dark:bg-oai-brand-900/10":"bg-white dark:bg-oai-gray-950 group-hover:bg-oai-gray-50 dark:group-hover:bg-oai-gray-900/60")}function f(r){return i("sticky left-[72px] z-30 min-w-[220px] max-w-[min(320px,40vw)] border-r border-oai-gray-200 dark:border-oai-gray-800 px-4 py-4 min-w-0",r?"bg-oai-brand-50 dark:bg-oai-brand-900/10":"bg-white dark:bg-oai-gray-950 group-hover:bg-oai-gray-50 dark:group-hover:bg-oai-gray-900/60")}function _(r){return i("sticky left-[72px] z-30 min-w-[6rem] border-r border-oai-gray-200 dark:border-oai-gray-800 px-4 py-4 whitespace-nowrap","bg-white dark:bg-oai-gray-950")}export{u as L,m as a,y as b,f as c,h as d,k as e,_ as f,x as g,w as l};
1
+ import{C as n,aE as i}from"./main-b3V-nHUe.js";function l(r){let e=0;const o=String(r??"");for(let a=0;a<o.length;a+=1)e=Math.imul(31,e)+o.charCodeAt(a)|0;return Math.abs(e)%360}function b(r){const e=String(r??"").trim();if(!e)return"?";const o=e.split(/\s+/).filter(Boolean);if(o.length>=2){const a=o[0][0]||"",t=o[1][0]||"";return`${a}${t}`.toUpperCase()}return e.slice(0,2).toUpperCase()}const c={sm:"h-7 w-7 min-h-7 min-w-7 text-[10px]",md:"h-8 w-8 min-h-8 min-w-8 text-[11px]",lg:"h-14 w-14 min-h-14 min-w-14 text-base"};function y({avatarUrl:r,displayName:e,seed:o,size:a="md",className:t}){const s=c[a]||c.md,g=l(o??e??""),d=typeof r=="string"?r.trim():"";return d?n.jsx("img",{src:d,alt:"",className:i("rounded-full object-cover ring-1 ring-white/10",s,t)}):n.jsx("div",{className:i("flex shrink-0 items-center justify-center rounded-full font-semibold text-white ring-1 ring-white/10",s,t),style:{backgroundColor:`hsl(${g} 42% 34%)`},"aria-hidden":!0,children:b(e)})}function m({iconSrc:r,label:e}){return n.jsxs("span",{className:"inline-flex items-center gap-3",children:[n.jsx("img",{src:r,alt:"",width:16,height:16,className:"h-4 w-4 shrink-0 object-contain opacity-90"}),n.jsx("span",{className:"whitespace-nowrap",children:e})]})}const u=[{key:"gpt_tokens",copyKey:"leaderboard.column.codex",icon:"/brand-logos/codex.svg"},{key:"claude_tokens",copyKey:"leaderboard.column.claude",icon:"/brand-logos/claude-code.svg"},{key:"gemini_tokens",copyKey:"leaderboard.column.gemini",icon:"/brand-logos/gemini.svg"},{key:"cursor_tokens",copyKey:"leaderboard.column.cursor",icon:"/brand-logos/cursor.svg"},{key:"opencode_tokens",copyKey:"leaderboard.column.opencode",icon:"/brand-logos/opencode.svg"},{key:"openclaw_tokens",copyKey:"leaderboard.column.openclaw",icon:"/brand-logos/openclaw.svg"},{key:"other_tokens",copyKey:"leaderboard.column.supplemental",icon:"/brand-logos/gemini.svg"}],h="sticky left-0 z-40 w-[72px] min-w-[72px] max-w-[72px] border-r border-oai-gray-200 dark:border-oai-gray-800 bg-white dark:bg-oai-gray-950 px-4 py-4",k="sticky left-[72px] z-40 min-w-[220px] max-w-[min(320px,40vw)] border-r border-oai-gray-200 dark:border-oai-gray-800 bg-white dark:bg-oai-gray-950 px-4 py-4",x="sticky left-[72px] z-40 min-w-[6rem] border-r border-oai-gray-200 dark:border-oai-gray-800 bg-white dark:bg-oai-gray-950 px-4 py-4";function w(r){return i("sticky left-0 z-30 w-[72px] min-w-[72px] max-w-[72px] border-r border-oai-gray-200 dark:border-oai-gray-800 px-4 py-4 whitespace-nowrap",r?"bg-oai-brand-50 dark:bg-oai-brand-900/10":"bg-white dark:bg-oai-gray-950 group-hover:bg-oai-gray-50 dark:group-hover:bg-oai-gray-900/60")}function f(r){return i("sticky left-[72px] z-30 min-w-[220px] max-w-[min(320px,40vw)] border-r border-oai-gray-200 dark:border-oai-gray-800 px-4 py-4 min-w-0",r?"bg-oai-brand-50 dark:bg-oai-brand-900/10":"bg-white dark:bg-oai-gray-950 group-hover:bg-oai-gray-50 dark:group-hover:bg-oai-gray-900/60")}function _(r){return i("sticky left-[72px] z-30 min-w-[6rem] border-r border-oai-gray-200 dark:border-oai-gray-800 px-4 py-4 whitespace-nowrap","bg-white dark:bg-oai-gray-950")}export{u as L,m as a,y as b,f as c,h as d,k as e,_ as f,x as g,w as l};
@@ -1,4 +1,4 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/DashboardPage-ccDq1oTb.js","assets/ThemeToggle-CQvh_d2Z.js","assets/LeaderboardPage-BvhBcafd.js","assets/leaderboard-columns-COq9DxPJ.js","assets/LeaderboardProfilePage-B5Yw_BZM.js"])))=>i.map(i=>d[i]);
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/DashboardPage-CGaKcd55.js","assets/ThemeToggle-BeCU2uxY.js","assets/LeaderboardPage-Dj9QZ8jC.js","assets/leaderboard-columns-wV7NeEpI.js","assets/LeaderboardProfilePage-Bz-aUVkS.js"])))=>i.map(i=>d[i]);
2
2
  function vP(t,e){for(var n=0;n<e.length;n++){const i=e[n];if(typeof i!="string"&&!Array.isArray(i)){for(const r in i)if(r!=="default"&&!(r in t)){const s=Object.getOwnPropertyDescriptor(i,r);s&&Object.defineProperty(t,r,s.get?s:{enumerable:!0,get:()=>i[r]})}}}return Object.freeze(Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}))}(function(){const e=document.createElement("link").relList;if(e&&e.supports&&e.supports("modulepreload"))return;for(const r of document.querySelectorAll('link[rel="modulepreload"]'))i(r);new MutationObserver(r=>{for(const s of r)if(s.type==="childList")for(const l of s.addedNodes)l.tagName==="LINK"&&l.rel==="modulepreload"&&i(l)}).observe(document,{childList:!0,subtree:!0});function n(r){const s={};return r.integrity&&(s.integrity=r.integrity),r.referrerPolicy&&(s.referrerPolicy=r.referrerPolicy),r.crossOrigin==="use-credentials"?s.credentials="include":r.crossOrigin==="anonymous"?s.credentials="omit":s.credentials="same-origin",s}function i(r){if(r.ep)return;r.ep=!0;const s=n(r);fetch(r.href,s)}})();function JE(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}function yP(t){if(Object.prototype.hasOwnProperty.call(t,"__esModule"))return t;var e=t.default;if(typeof e=="function"){var n=function i(){var r=!1;try{r=this instanceof i}catch{}return r?Reflect.construct(e,arguments,this.constructor):e.apply(this,arguments)};n.prototype=e.prototype}else n={};return Object.defineProperty(n,"__esModule",{value:!0}),Object.keys(t).forEach(function(i){var r=Object.getOwnPropertyDescriptor(t,i);Object.defineProperty(n,i,r.get?r:{enumerable:!0,get:function(){return t[i]}})}),n}var om={exports:{}},Pc={},lm={exports:{}},Jt={};var ab;function _P(){if(ab)return Jt;ab=1;var t=Symbol.for("react.element"),e=Symbol.for("react.portal"),n=Symbol.for("react.fragment"),i=Symbol.for("react.strict_mode"),r=Symbol.for("react.profiler"),s=Symbol.for("react.provider"),l=Symbol.for("react.context"),c=Symbol.for("react.forward_ref"),d=Symbol.for("react.suspense"),f=Symbol.for("react.memo"),h=Symbol.for("react.lazy"),m=Symbol.iterator;function g(B){return B===null||typeof B!="object"?null:(B=m&&B[m]||B["@@iterator"],typeof B=="function"?B:null)}var v={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},b=Object.assign,E={};function _(B,ie,ye){this.props=B,this.context=ie,this.refs=E,this.updater=ye||v}_.prototype.isReactComponent={},_.prototype.setState=function(B,ie){if(typeof B!="object"&&typeof B!="function"&&B!=null)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,B,ie,"setState")},_.prototype.forceUpdate=function(B){this.updater.enqueueForceUpdate(this,B,"forceUpdate")};function x(){}x.prototype=_.prototype;function T(B,ie,ye){this.props=B,this.context=ie,this.refs=E,this.updater=ye||v}var C=T.prototype=new x;C.constructor=T,b(C,_.prototype),C.isPureReactComponent=!0;var A=Array.isArray,N=Object.prototype.hasOwnProperty,I={current:null},U={key:!0,ref:!0,__self:!0,__source:!0};function S(B,ie,ye){var Ee,Ue={},le=null,be=null;if(ie!=null)for(Ee in ie.ref!==void 0&&(be=ie.ref),ie.key!==void 0&&(le=""+ie.key),ie)N.call(ie,Ee)&&!U.hasOwnProperty(Ee)&&(Ue[Ee]=ie[Ee]);var Se=arguments.length-2;if(Se===1)Ue.children=ye;else if(1<Se){for(var Ne=Array(Se),et=0;et<Se;et++)Ne[et]=arguments[et+2];Ue.children=Ne}if(B&&B.defaultProps)for(Ee in Se=B.defaultProps,Se)Ue[Ee]===void 0&&(Ue[Ee]=Se[Ee]);return{$$typeof:t,type:B,key:le,ref:be,props:Ue,_owner:I.current}}function k(B,ie){return{$$typeof:t,type:B.type,key:ie,ref:B.ref,props:B.props,_owner:B._owner}}function Y(B){return typeof B=="object"&&B!==null&&B.$$typeof===t}function F(B){var ie={"=":"=0",":":"=2"};return"$"+B.replace(/[=:]/g,function(ye){return ie[ye]})}var $=/\/+/g;function J(B,ie){return typeof B=="object"&&B!==null&&B.key!=null?F(""+B.key):ie.toString(36)}function X(B,ie,ye,Ee,Ue){var le=typeof B;(le==="undefined"||le==="boolean")&&(B=null);var be=!1;if(B===null)be=!0;else switch(le){case"string":case"number":be=!0;break;case"object":switch(B.$$typeof){case t:case e:be=!0}}if(be)return be=B,Ue=Ue(be),B=Ee===""?"."+J(be,0):Ee,A(Ue)?(ye="",B!=null&&(ye=B.replace($,"$&/")+"/"),X(Ue,ie,ye,"",function(et){return et})):Ue!=null&&(Y(Ue)&&(Ue=k(Ue,ye+(!Ue.key||be&&be.key===Ue.key?"":(""+Ue.key).replace($,"$&/")+"/")+B)),ie.push(Ue)),1;if(be=0,Ee=Ee===""?".":Ee+":",A(B))for(var Se=0;Se<B.length;Se++){le=B[Se];var Ne=Ee+J(le,Se);be+=X(le,ie,ye,Ne,Ue)}else if(Ne=g(B),typeof Ne=="function")for(B=Ne.call(B),Se=0;!(le=B.next()).done;)le=le.value,Ne=Ee+J(le,Se++),be+=X(le,ie,ye,Ne,Ue);else if(le==="object")throw ie=String(B),Error("Objects are not valid as a React child (found: "+(ie==="[object Object]"?"object with keys {"+Object.keys(B).join(", ")+"}":ie)+"). If you meant to render a collection of children, use an array instead.");return be}function q(B,ie,ye){if(B==null)return B;var Ee=[],Ue=0;return X(B,Ee,"","",function(le){return ie.call(ye,le,Ue++)}),Ee}function Z(B){if(B._status===-1){var ie=B._result;ie=ie(),ie.then(function(ye){(B._status===0||B._status===-1)&&(B._status=1,B._result=ye)},function(ye){(B._status===0||B._status===-1)&&(B._status=2,B._result=ye)}),B._status===-1&&(B._status=0,B._result=ie)}if(B._status===1)return B._result.default;throw B._result}var te={current:null},G={transition:null},W={ReactCurrentDispatcher:te,ReactCurrentBatchConfig:G,ReactCurrentOwner:I};function K(){throw Error("act(...) is not supported in production builds of React.")}return Jt.Children={map:q,forEach:function(B,ie,ye){q(B,function(){ie.apply(this,arguments)},ye)},count:function(B){var ie=0;return q(B,function(){ie++}),ie},toArray:function(B){return q(B,function(ie){return ie})||[]},only:function(B){if(!Y(B))throw Error("React.Children.only expected to receive a single React element child.");return B}},Jt.Component=_,Jt.Fragment=n,Jt.Profiler=r,Jt.PureComponent=T,Jt.StrictMode=i,Jt.Suspense=d,Jt.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=W,Jt.act=K,Jt.cloneElement=function(B,ie,ye){if(B==null)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+B+".");var Ee=b({},B.props),Ue=B.key,le=B.ref,be=B._owner;if(ie!=null){if(ie.ref!==void 0&&(le=ie.ref,be=I.current),ie.key!==void 0&&(Ue=""+ie.key),B.type&&B.type.defaultProps)var Se=B.type.defaultProps;for(Ne in ie)N.call(ie,Ne)&&!U.hasOwnProperty(Ne)&&(Ee[Ne]=ie[Ne]===void 0&&Se!==void 0?Se[Ne]:ie[Ne])}var Ne=arguments.length-2;if(Ne===1)Ee.children=ye;else if(1<Ne){Se=Array(Ne);for(var et=0;et<Ne;et++)Se[et]=arguments[et+2];Ee.children=Se}return{$$typeof:t,type:B.type,key:Ue,ref:le,props:Ee,_owner:be}},Jt.createContext=function(B){return B={$$typeof:l,_currentValue:B,_currentValue2:B,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},B.Provider={$$typeof:s,_context:B},B.Consumer=B},Jt.createElement=S,Jt.createFactory=function(B){var ie=S.bind(null,B);return ie.type=B,ie},Jt.createRef=function(){return{current:null}},Jt.forwardRef=function(B){return{$$typeof:c,render:B}},Jt.isValidElement=Y,Jt.lazy=function(B){return{$$typeof:h,_payload:{_status:-1,_result:B},_init:Z}},Jt.memo=function(B,ie){return{$$typeof:f,type:B,compare:ie===void 0?null:ie}},Jt.startTransition=function(B){var ie=G.transition;G.transition={};try{B()}finally{G.transition=ie}},Jt.unstable_act=K,Jt.useCallback=function(B,ie){return te.current.useCallback(B,ie)},Jt.useContext=function(B){return te.current.useContext(B)},Jt.useDebugValue=function(){},Jt.useDeferredValue=function(B){return te.current.useDeferredValue(B)},Jt.useEffect=function(B,ie){return te.current.useEffect(B,ie)},Jt.useId=function(){return te.current.useId()},Jt.useImperativeHandle=function(B,ie,ye){return te.current.useImperativeHandle(B,ie,ye)},Jt.useInsertionEffect=function(B,ie){return te.current.useInsertionEffect(B,ie)},Jt.useLayoutEffect=function(B,ie){return te.current.useLayoutEffect(B,ie)},Jt.useMemo=function(B,ie){return te.current.useMemo(B,ie)},Jt.useReducer=function(B,ie,ye){return te.current.useReducer(B,ie,ye)},Jt.useRef=function(B){return te.current.useRef(B)},Jt.useState=function(B){return te.current.useState(B)},Jt.useSyncExternalStore=function(B,ie,ye){return te.current.useSyncExternalStore(B,ie,ye)},Jt.useTransition=function(){return te.current.useTransition()},Jt.version="18.3.1",Jt}var sb;function my(){return sb||(sb=1,lm.exports=_P()),lm.exports}var ob;function xP(){if(ob)return Pc;ob=1;var t=my(),e=Symbol.for("react.element"),n=Symbol.for("react.fragment"),i=Object.prototype.hasOwnProperty,r=t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,s={key:!0,ref:!0,__self:!0,__source:!0};function l(c,d,f){var h,m={},g=null,v=null;f!==void 0&&(g=""+f),d.key!==void 0&&(g=""+d.key),d.ref!==void 0&&(v=d.ref);for(h in d)i.call(d,h)&&!s.hasOwnProperty(h)&&(m[h]=d[h]);if(c&&c.defaultProps)for(h in d=c.defaultProps,d)m[h]===void 0&&(m[h]=d[h]);return{$$typeof:e,type:c,key:g,ref:v,props:m,_owner:r.current}}return Pc.Fragment=n,Pc.jsx=l,Pc.jsxs=l,Pc}var lb;function bP(){return lb||(lb=1,om.exports=xP()),om.exports}var V=bP(),D=my();const zl=JE(D),QE=vP({__proto__:null,default:zl},[D]);var kd={},cm={exports:{}},zi={},um={exports:{}},dm={};var cb;function SP(){return cb||(cb=1,(function(t){function e(G,W){var K=G.length;G.push(W);e:for(;0<K;){var B=K-1>>>1,ie=G[B];if(0<r(ie,W))G[B]=W,G[K]=ie,K=B;else break e}}function n(G){return G.length===0?null:G[0]}function i(G){if(G.length===0)return null;var W=G[0],K=G.pop();if(K!==W){G[0]=K;e:for(var B=0,ie=G.length,ye=ie>>>1;B<ye;){var Ee=2*(B+1)-1,Ue=G[Ee],le=Ee+1,be=G[le];if(0>r(Ue,K))le<ie&&0>r(be,Ue)?(G[B]=be,G[le]=K,B=le):(G[B]=Ue,G[Ee]=K,B=Ee);else if(le<ie&&0>r(be,K))G[B]=be,G[le]=K,B=le;else break e}}return W}function r(G,W){var K=G.sortIndex-W.sortIndex;return K!==0?K:G.id-W.id}if(typeof performance=="object"&&typeof performance.now=="function"){var s=performance;t.unstable_now=function(){return s.now()}}else{var l=Date,c=l.now();t.unstable_now=function(){return l.now()-c}}var d=[],f=[],h=1,m=null,g=3,v=!1,b=!1,E=!1,_=typeof setTimeout=="function"?setTimeout:null,x=typeof clearTimeout=="function"?clearTimeout:null,T=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function C(G){for(var W=n(f);W!==null;){if(W.callback===null)i(f);else if(W.startTime<=G)i(f),W.sortIndex=W.expirationTime,e(d,W);else break;W=n(f)}}function A(G){if(E=!1,C(G),!b)if(n(d)!==null)b=!0,Z(N);else{var W=n(f);W!==null&&te(A,W.startTime-G)}}function N(G,W){b=!1,E&&(E=!1,x(S),S=-1),v=!0;var K=g;try{for(C(W),m=n(d);m!==null&&(!(m.expirationTime>W)||G&&!F());){var B=m.callback;if(typeof B=="function"){m.callback=null,g=m.priorityLevel;var ie=B(m.expirationTime<=W);W=t.unstable_now(),typeof ie=="function"?m.callback=ie:m===n(d)&&i(d),C(W)}else i(d);m=n(d)}if(m!==null)var ye=!0;else{var Ee=n(f);Ee!==null&&te(A,Ee.startTime-W),ye=!1}return ye}finally{m=null,g=K,v=!1}}var I=!1,U=null,S=-1,k=5,Y=-1;function F(){return!(t.unstable_now()-Y<k)}function $(){if(U!==null){var G=t.unstable_now();Y=G;var W=!0;try{W=U(!0,G)}finally{W?J():(I=!1,U=null)}}else I=!1}var J;if(typeof T=="function")J=function(){T($)};else if(typeof MessageChannel<"u"){var X=new MessageChannel,q=X.port2;X.port1.onmessage=$,J=function(){q.postMessage(null)}}else J=function(){_($,0)};function Z(G){U=G,I||(I=!0,J())}function te(G,W){S=_(function(){G(t.unstable_now())},W)}t.unstable_IdlePriority=5,t.unstable_ImmediatePriority=1,t.unstable_LowPriority=4,t.unstable_NormalPriority=3,t.unstable_Profiling=null,t.unstable_UserBlockingPriority=2,t.unstable_cancelCallback=function(G){G.callback=null},t.unstable_continueExecution=function(){b||v||(b=!0,Z(N))},t.unstable_forceFrameRate=function(G){0>G||125<G?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):k=0<G?Math.floor(1e3/G):5},t.unstable_getCurrentPriorityLevel=function(){return g},t.unstable_getFirstCallbackNode=function(){return n(d)},t.unstable_next=function(G){switch(g){case 1:case 2:case 3:var W=3;break;default:W=g}var K=g;g=W;try{return G()}finally{g=K}},t.unstable_pauseExecution=function(){},t.unstable_requestPaint=function(){},t.unstable_runWithPriority=function(G,W){switch(G){case 1:case 2:case 3:case 4:case 5:break;default:G=3}var K=g;g=G;try{return W()}finally{g=K}},t.unstable_scheduleCallback=function(G,W,K){var B=t.unstable_now();switch(typeof K=="object"&&K!==null?(K=K.delay,K=typeof K=="number"&&0<K?B+K:B):K=B,G){case 1:var ie=-1;break;case 2:ie=250;break;case 5:ie=1073741823;break;case 4:ie=1e4;break;default:ie=5e3}return ie=K+ie,G={id:h++,callback:W,priorityLevel:G,startTime:K,expirationTime:ie,sortIndex:-1},K>B?(G.sortIndex=K,e(f,G),n(d)===null&&G===n(f)&&(E?(x(S),S=-1):E=!0,te(A,K-B))):(G.sortIndex=ie,e(d,G),b||v||(b=!0,Z(N))),G},t.unstable_shouldYield=F,t.unstable_wrapCallback=function(G){var W=g;return function(){var K=g;g=W;try{return G.apply(this,arguments)}finally{g=K}}}})(dm)),dm}var ub;function wP(){return ub||(ub=1,um.exports=SP()),um.exports}var db;function EP(){if(db)return zi;db=1;var t=my(),e=wP();function n(a){for(var o="https://reactjs.org/docs/error-decoder.html?invariant="+a,u=1;u<arguments.length;u++)o+="&args[]="+encodeURIComponent(arguments[u]);return"Minified React error #"+a+"; visit "+o+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}var i=new Set,r={};function s(a,o){l(a,o),l(a+"Capture",o)}function l(a,o){for(r[a]=o,a=0;a<o.length;a++)i.add(o[a])}var c=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),d=Object.prototype.hasOwnProperty,f=/^[:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD][:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\-.0-9\u00B7\u0300-\u036F\u203F-\u2040]*$/,h={},m={};function g(a){return d.call(m,a)?!0:d.call(h,a)?!1:f.test(a)?m[a]=!0:(h[a]=!0,!1)}function v(a,o,u,p){if(u!==null&&u.type===0)return!1;switch(typeof o){case"function":case"symbol":return!0;case"boolean":return p?!1:u!==null?!u.acceptsBooleans:(a=a.toLowerCase().slice(0,5),a!=="data-"&&a!=="aria-");default:return!1}}function b(a,o,u,p){if(o===null||typeof o>"u"||v(a,o,u,p))return!0;if(p)return!1;if(u!==null)switch(u.type){case 3:return!o;case 4:return o===!1;case 5:return isNaN(o);case 6:return isNaN(o)||1>o}return!1}function E(a,o,u,p,y,w,P){this.acceptsBooleans=o===2||o===3||o===4,this.attributeName=p,this.attributeNamespace=y,this.mustUseProperty=u,this.propertyName=a,this.type=o,this.sanitizeURL=w,this.removeEmptyString=P}var _={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(a){_[a]=new E(a,0,!1,a,null,!1,!1)}),[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(a){var o=a[0];_[o]=new E(o,1,!1,a[1],null,!1,!1)}),["contentEditable","draggable","spellCheck","value"].forEach(function(a){_[a]=new E(a,2,!1,a.toLowerCase(),null,!1,!1)}),["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(a){_[a]=new E(a,2,!1,a,null,!1,!1)}),"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(a){_[a]=new E(a,3,!1,a.toLowerCase(),null,!1,!1)}),["checked","multiple","muted","selected"].forEach(function(a){_[a]=new E(a,3,!0,a,null,!1,!1)}),["capture","download"].forEach(function(a){_[a]=new E(a,4,!1,a,null,!1,!1)}),["cols","rows","size","span"].forEach(function(a){_[a]=new E(a,6,!1,a,null,!1,!1)}),["rowSpan","start"].forEach(function(a){_[a]=new E(a,5,!1,a.toLowerCase(),null,!1,!1)});var x=/[\-:]([a-z])/g;function T(a){return a[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(a){var o=a.replace(x,T);_[o]=new E(o,1,!1,a,null,!1,!1)}),"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(a){var o=a.replace(x,T);_[o]=new E(o,1,!1,a,"http://www.w3.org/1999/xlink",!1,!1)}),["xml:base","xml:lang","xml:space"].forEach(function(a){var o=a.replace(x,T);_[o]=new E(o,1,!1,a,"http://www.w3.org/XML/1998/namespace",!1,!1)}),["tabIndex","crossOrigin"].forEach(function(a){_[a]=new E(a,1,!1,a.toLowerCase(),null,!1,!1)}),_.xlinkHref=new E("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1),["src","href","action","formAction"].forEach(function(a){_[a]=new E(a,1,!1,a.toLowerCase(),null,!0,!0)});function C(a,o,u,p){var y=_.hasOwnProperty(o)?_[o]:null;(y!==null?y.type!==0:p||!(2<o.length)||o[0]!=="o"&&o[0]!=="O"||o[1]!=="n"&&o[1]!=="N")&&(b(o,u,y,p)&&(u=null),p||y===null?g(o)&&(u===null?a.removeAttribute(o):a.setAttribute(o,""+u)):y.mustUseProperty?a[y.propertyName]=u===null?y.type===3?!1:"":u:(o=y.attributeName,p=y.attributeNamespace,u===null?a.removeAttribute(o):(y=y.type,u=y===3||y===4&&u===!0?"":""+u,p?a.setAttributeNS(p,o,u):a.setAttribute(o,u))))}var A=t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,N=Symbol.for("react.element"),I=Symbol.for("react.portal"),U=Symbol.for("react.fragment"),S=Symbol.for("react.strict_mode"),k=Symbol.for("react.profiler"),Y=Symbol.for("react.provider"),F=Symbol.for("react.context"),$=Symbol.for("react.forward_ref"),J=Symbol.for("react.suspense"),X=Symbol.for("react.suspense_list"),q=Symbol.for("react.memo"),Z=Symbol.for("react.lazy"),te=Symbol.for("react.offscreen"),G=Symbol.iterator;function W(a){return a===null||typeof a!="object"?null:(a=G&&a[G]||a["@@iterator"],typeof a=="function"?a:null)}var K=Object.assign,B;function ie(a){if(B===void 0)try{throw Error()}catch(u){var o=u.stack.trim().match(/\n( *(at )?)/);B=o&&o[1]||""}return`
3
3
  `+B+a}var ye=!1;function Ee(a,o){if(!a||ye)return"";ye=!0;var u=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{if(o)if(o=function(){throw Error()},Object.defineProperty(o.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(o,[])}catch(ge){var p=ge}Reflect.construct(a,[],o)}else{try{o.call()}catch(ge){p=ge}a.call(o.prototype)}else{try{throw Error()}catch(ge){p=ge}a()}}catch(ge){if(ge&&p&&typeof ge.stack=="string"){for(var y=ge.stack.split(`
4
4
  `),w=p.stack.split(`
@@ -4756,4 +4756,4 @@ void main(){
4756
4756
  // straight (non-premultiplied) alpha output
4757
4757
  gl_FragColor=vec4(col,alpha);
4758
4758
  }
4759
- `;function qE(t){let e=t.trim().replace("#","");e.length===3&&(e=e.split("").map(i=>i+i).join(""));const n=parseInt(e,16)||16777215;return{r:(n>>16&255)/255,g:(n>>8&255)/255,b:(n&255)/255}}function XW({className:t,style:e,wispDensity:n=1,dpr:i,mouseSmoothTime:r=.06,mouseTiltStrength:s=.01,horizontalBeamOffset:l=0,verticalBeamOffset:c=-.5,flowSpeed:d=.35,verticalSizing:f=2,horizontalSizing:h=.5,fogIntensity:m=.45,fogScale:g=.3,wispSpeed:v=15,wispIntensity:b=5,flowStrength:E=.25,decay:_=1.1,falloffStart:x=1.2,fogFallSpeed:T=.6,color:C="#8a7aff"}){const A=D.useRef(null),N=D.useRef(null),I=D.useRef(!1),U=D.useRef(null),S=D.useRef(!0),k=D.useRef(!1),Y=D.useRef(r);return D.useEffect(()=>{Y.current=r},[r]),D.useEffect(()=>{const F=A.current;let $;try{$=new WW({antialias:!1,alpha:!0,premultipliedAlpha:!1,depth:!1,stencil:!1,powerPreference:"high-performance"})}catch(At){console.warn("LaserFlow: WebGL not supported or context creation failed.",At);return}let X=Math.min(i??(window.devicePixelRatio||1),2);$.setPixelRatio(X),$.outputColorSpace=Mo,$.setClearColor(0,0);const q=$.domElement;q.style.cssText="position:absolute;inset:0;width:100%;height:100%;display:block;",F.appendChild(q);const Z=new P5,te=new V0(-1,1,1,-1,0,1),G=new ha;G.setAttribute("position",new Vr(new Float32Array([-1,-1,0,3,-1,0,-1,3,0]),3));const W={iTime:{value:0},iResolution:{value:new me(1,1,1)},iMouse:{value:new Vn(0,0,0,0)},uWispDensity:{value:n},uTiltScale:{value:s},uFlowTime:{value:0},uFogTime:{value:0},uBeamXFrac:{value:l},uBeamYFrac:{value:c},uFlowSpeed:{value:d},uVLenFactor:{value:f},uHLenFactor:{value:h},uFogIntensity:{value:m},uFogScale:{value:g},uWSpeed:{value:v},uWIntensity:{value:b},uFlowStrength:{value:E},uDecay:{value:_},uFalloffStart:{value:x},uFogFallSpeed:{value:T},uColor:{value:new me(1,1,1)},uFade:{value:I.current?1:0}};N.current=W;const{r:K,g:B,b:ie}=qE(C);W.uColor.value.set(K,B,ie);const ye=new kC({vertexShader:jW,fragmentShader:$W,uniforms:W,transparent:!0,depthTest:!1,depthWrite:!1,blending:yo}),Ee=new ua(G,ye);Ee.frustumCulled=!1,Z.add(Ee);let Ue=0,le=0,be=0;function Se(){const At=F.clientWidth||1,kt=F.clientHeight||1;Math.abs(At-Ue)<1&&Math.abs(kt-le)<1&&Math.abs(X-be)<.01||(Ue=At,le=kt,be=X,$.setPixelRatio(X),$.setSize(At,kt,!1),W.iResolution.value.set(At*X,kt*X,X),U.current=q.getBoundingClientRect())}let Ne=0;const et=new ResizeObserver(()=>{cancelAnimationFrame(Ne),Ne=requestAnimationFrame(Se)});et.observe(F),Se();const xt=new IntersectionObserver(At=>{S.current=At[0]?.isIntersecting??!0},{threshold:0});xt.observe(F),document.addEventListener("visibilitychange",()=>{k.current=document.hidden},{passive:!0});const pn=new bn(0,0),ht=new bn(0,0);function Ut(At){const kt=U.current;kt&&pn.set((At.clientX-kt.left)*X,(kt.height-(At.clientY-kt.top))*X)}q.addEventListener("pointermove",Ut,{passive:!0}),q.addEventListener("pointerleave",()=>pn.set(0,0),{passive:!0});let nn=0,Lt=I.current?1:0;const sn=new K5;let Q=0;function Sn(){if(Q=requestAnimationFrame(Sn),k.current||!S.current)return;const At=sn.getElapsedTime(),kt=Math.min(Math.max(At-nn,.001),.033);nn=At,W.iTime.value=At,W.uFlowTime.value+=kt,W.uFogTime.value+=kt,I.current||(Lt=Math.min(1,Lt+kt/1),W.uFade.value=Lt,Lt>=1&&(I.current=!0));const it=Math.max(.001,Y.current);ht.lerp(pn,1-Math.exp(-kt/it)),W.iMouse.value.set(ht.x,ht.y,0,0),$.render(Z,te)}return Sn(),()=>{cancelAnimationFrame(Q),cancelAnimationFrame(Ne),et.disconnect(),xt.disconnect(),Z.clear(),G.dispose(),ye.dispose(),$.dispose(),$.forceContextLoss(),F.contains(q)&&F.removeChild(q)}},[i]),D.useEffect(()=>{const F=N.current;if(!F)return;F.uWispDensity.value=n,F.uTiltScale.value=s,F.uBeamXFrac.value=l,F.uBeamYFrac.value=c,F.uFlowSpeed.value=d,F.uVLenFactor.value=f,F.uHLenFactor.value=h,F.uFogIntensity.value=m,F.uFogScale.value=g,F.uWSpeed.value=v,F.uWIntensity.value=b,F.uFlowStrength.value=E,F.uDecay.value=_,F.uFalloffStart.value=x,F.uFogFallSpeed.value=T;const{r:$,g:J,b:X}=qE(C);F.uColor.value.set($,J,X)},[n,s,l,c,d,f,h,m,g,v,b,E,_,x,T,C]),V.jsx("div",{ref:A,className:t,style:{position:"relative",overflow:"hidden",...e}})}function qW({className:t}){return V.jsx("svg",{viewBox:"0 0 384 512",className:t,fill:"currentColor",children:V.jsx("path",{d:"M318.7 268.7c-.2-36.7 16.4-64.4 50-84.8-18.8-26.9-47.2-41.7-84.7-44.6-35.5-2.8-74.3 20.7-88.5 20.7-15 0-49.4-19.7-76.4-19.7C63.3 141.2 4 184.8 4 273.5q0 39.3 14.4 81.2c12.8 36.7 59 126.7 107.2 125.2 25.2-.6 43-17.9 75.8-17.9 31.8 0 48.3 17.9 76.4 17.9 48.6-.7 90.4-82.5 102.6-119.3-65.2-30.7-61.7-90-61.7-91.9zm-56.6-164.2c27.3-32.4 24.8-61.9 24-72.5-24.1 1.4-52 16.4-67.9 34.9-17.5 19.8-27.8 44.3-25.6 71.9 26.1 2 49.9-11.4 69.5-34.3z"})})}function YW({className:t}){return V.jsx("svg",{viewBox:"0 0 16 16",className:t,fill:"currentColor",children:V.jsx("path",{d:"M8 0c4.42 0 8 3.58 8 8a8.013 8.013 0 0 1-5.45 7.59c-.4.08-.55-.17-.55-.38 0-.27.01-1.13.01-2.2 0-.75-.25-1.23-.54-1.48 1.78-.2 3.65-.88 3.65-3.95 0-.88-.31-1.59-.82-2.15.08-.2.36-1.02-.08-2.12 0 0-.67-.22-2.2.82-.64-.18-1.32-.27-2-.27-.68 0-1.36.09-2 .27-1.53-1.03-2.2-.82-2.2-.82-.44 1.1-.16 1.92-.08 2.12-.51.56-.82 1.28-.82 2.15 0 3.06 1.86 3.75 3.64 3.95-.23.2-.44.55-.51 1.07-.46.21-1.61.55-2.33-.66-.15-.24-.6-.83-1.23-.82-.67.01-.27.38.01.53.34.19.73.9.82 1.13.16.45.68 1.31 2.69.94 0 .67.01 1.3.01 1.49 0 .21-.15.45-.55.38A7.995 7.995 0 0 1 0 8c0-4.42 3.58-8 8-8Z"})})}function KW({className:t}){return V.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:t,children:[V.jsx("rect",{x:"9",y:"9",width:"13",height:"13",rx:"2",ry:"2"}),V.jsx("path",{d:"M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1"})]})}function ZW({className:t}){return V.jsx("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:t,children:V.jsx("polyline",{points:"20 6 9 17 4 12"})})}const YE="https://github.com/mm7894215/tokentracker",JW="https://github.com/mm7894215/tokentracker/releases/latest";function QW(t="default",e="md",n){const i="inline-flex items-center justify-center rounded font-medium transition-colors duration-200 ease-out focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-oai-brand-500 focus-visible:ring-offset-2 dark:focus-visible:ring-offset-oai-gray-950",r={default:"bg-oai-gray-900 text-white hover:bg-oai-gray-800 active:bg-oai-gray-950 dark:bg-white dark:text-oai-gray-900 dark:hover:bg-oai-gray-100 dark:active:bg-oai-gray-200",ghost:"text-oai-gray-600 hover:text-oai-gray-900 hover:bg-oai-gray-100 active:bg-oai-gray-200 dark:text-oai-gray-400 dark:hover:text-white dark:hover:bg-oai-gray-800 dark:active:bg-oai-gray-700"},s={sm:"h-9 px-4 text-sm",md:"h-11 px-6 text-sm",lg:"h-12 px-8 text-base"};return Pi(i,r[t],s[e],n)}function ej({copy:t,signInUrl:e,signUpUrl:n,installCommand:i,installCopied:r,onCopyInstallCommand:s}){const l=P4(),{signedIn:c,loading:d}=Wl(),f=D.useMemo(()=>({codex:t("landing.v2.models.agent.codex"),claude_code:t("landing.v2.models.agent.claude_code"),cursor:t("landing.v2.models.agent.cursor"),gemini:t("landing.v2.models.agent.gemini"),opencode:t("landing.v2.models.agent.opencode"),openclaw:t("landing.v2.models.agent.openclaw")}),[t]),h=D.useMemo(()=>[{id:"codex",icon:"/brand-logos/codex.svg"},{id:"claude_code",icon:"/brand-logos/claude-code.svg"},{id:"cursor",icon:"/brand-logos/cursor.svg"},{id:"gemini",icon:"/brand-logos/gemini.svg"},{id:"opencode",icon:"/brand-logos/opencode.svg"},{id:"openclaw",icon:"/brand-logos/openclaw.svg"}],[]),m=l?{duration:0}:void 0;return V.jsxs("div",{className:"min-h-screen bg-oai-gray-950 text-oai-white font-oai antialiased dark",children:[V.jsx("header",{className:"sticky top-0 z-50 bg-oai-gray-950/80 backdrop-blur-md border-b border-oai-gray-900",children:V.jsxs("div",{className:"mx-auto flex h-16 max-w-6xl items-center justify-between px-4 sm:px-6",children:[V.jsxs("div",{className:"flex items-center gap-5",children:[V.jsxs(po,{to:n||"/",className:"flex items-center gap-3 no-underline outline-none rounded focus-visible:ring-2 focus-visible:ring-oai-brand-500 focus-visible:ring-offset-2 dark:ring-offset-oai-gray-950 transition-opacity hover:opacity-80",children:[V.jsx("img",{src:"/app-icon.png",alt:"",width:24,height:24,className:"rounded-md"}),V.jsx("span",{className:"text-sm font-semibold tracking-wide text-white uppercase",children:"Token Tracker"})]}),V.jsx("div",{className:"hidden sm:block",children:V.jsx(Mz,{})})]}),V.jsxs("div",{className:"flex flex-wrap items-center justify-end gap-2 sm:gap-3",children:[V.jsxs(po,{to:Ez(),className:Pi(QW(c||d?"default":"ghost","sm"),"no-underline px-5 rounded-full group",c||d?"shadow-sm ring-1 ring-white/10":"ring-1 ring-oai-gray-700"),children:[t("landing.v2.cta.primary"),V.jsx("span",{className:"ml-2 inline-block transition-transform duration-200 group-hover:translate-x-0.5",children:"→"})]}),V.jsx(Lz,{})]})]})}),V.jsxs("main",{children:[V.jsx("section",{className:"py-16 sm:py-24 lg:py-32",children:V.jsxs("div",{className:"mx-auto max-w-7xl px-4 sm:px-6 flex flex-col items-center text-center gap-20 lg:gap-36",children:[V.jsxs(vo.div,{initial:l?!1:{opacity:0,y:20},animate:{opacity:1,y:0},transition:m||{duration:.5},className:"w-full max-w-3xl relative z-20",children:[V.jsxs("h1",{className:"text-balance text-5xl font-semibold tracking-tight text-white sm:text-6xl lg:text-[4rem] lg:leading-[1.05]",children:[t("landing.v2.hero.title_line1"),V.jsx("br",{}),V.jsx("span",{className:"bg-gradient-to-b from-white via-oai-gray-200 to-oai-gray-500 bg-clip-text text-transparent font-bold tracking-tight",style:{WebkitTextStroke:"1px rgba(255, 255, 255, 0.15)"},children:t("landing.v2.hero.title_line2")})]}),V.jsx("p",{className:"mt-6 text-lg leading-relaxed text-oai-gray-400",children:t("landing.v2.hero.subtagline")}),V.jsxs("div",{className:"mt-8 w-full max-w-lg mx-auto",children:[V.jsxs(vo.div,{whileHover:{scale:1.01,y:-1},transition:{type:"spring",stiffness:400,damping:25},className:"group relative flex items-center justify-between w-full bg-[#0a0a0a]/50 backdrop-blur-md border border-oai-gray-800 rounded-2xl p-1.5 pl-5 shadow-2xl shadow-black/50 transition-all duration-300",children:[V.jsx("div",{className:"absolute inset-0 rounded-2xl bg-gradient-to-r from-oai-brand-500/0 via-oai-brand-500/5 to-oai-brand-500/0 opacity-0 group-hover:opacity-100 transition-opacity duration-500 pointer-events-none"}),V.jsxs("div",{className:"flex items-center gap-3 overflow-hidden relative z-10",children:[V.jsx("span",{className:"text-oai-gray-600 font-mono select-none","aria-hidden":"true",children:"›"}),V.jsx("code",{className:"font-mono text-sm text-oai-gray-200 overflow-x-auto whitespace-nowrap py-2 [scrollbar-width:none]",children:i?i.split(" ").map((g,v)=>V.jsxs("span",{className:g==="npx"||g==="tokentracker-cli"?"text-white font-medium":g==="--yes"?"text-oai-gray-500":"text-oai-brand-400",children:[g," "]},v)):null})]}),V.jsx("button",{type:"button",onClick:s,"aria-label":t(r?"landing.install.action.copied":"landing.install.action.copy"),className:"shrink-0 relative z-10 flex h-9 w-9 items-center justify-center text-oai-gray-200 bg-oai-gray-900 border border-oai-gray-700 rounded-lg hover:bg-oai-gray-800 hover:text-white active:scale-95 transition-all duration-200 shadow-sm",children:r?V.jsx(ZW,{className:"h-4 w-4 text-green-400","aria-hidden":!0}):V.jsx(KW,{className:"h-4 w-4 opacity-70","aria-hidden":!0})})]}),V.jsxs("div",{className:"mt-8 flex flex-wrap items-center justify-center gap-x-6 gap-y-4",children:[V.jsxs("a",{href:JW,target:"_blank",rel:"noopener noreferrer",className:"group flex items-center gap-2 text-sm font-medium text-oai-gray-400 hover:text-white transition-colors",children:[V.jsx("div",{className:"flex items-center justify-center h-8 w-8 rounded-full bg-oai-gray-800 group-hover:bg-oai-gray-700 transition-colors",children:V.jsx(qW,{className:"h-4 w-4 text-oai-gray-400 group-hover:text-white"})}),t("landing.v2.install.mac_cta")]}),V.jsxs("a",{href:YE,target:"_blank",rel:"noopener noreferrer",className:"group flex items-center gap-2 text-sm font-medium text-oai-gray-400 hover:text-white transition-colors",children:[V.jsx("div",{className:"flex items-center justify-center h-8 w-8 rounded-full bg-oai-gray-800 group-hover:bg-oai-gray-700 transition-colors",children:V.jsx(YW,{className:"h-4 w-4 text-oai-gray-400 group-hover:text-white"})}),t("landing.cta.secondary")]})]}),V.jsx("span",{className:"sr-only","aria-live":"polite",children:r?t("landing.install.action.copied"):""})]})]}),V.jsx("div",{className:"relative group w-full",children:V.jsxs(vo.div,{initial:l?!1:{opacity:0,y:24},animate:{opacity:1,y:0},transition:m||{duration:.6,delay:.1},className:"relative w-full",children:[V.jsx("div",{style:{position:"absolute",top:"-256px",left:0,right:0,height:"510px",zIndex:3,pointerEvents:"none"},children:V.jsx(XW,{color:"#8a7aff",wispDensity:2,flowSpeed:.28,verticalSizing:2.2,horizontalSizing:1.22,fogIntensity:4,fogScale:.1,wispSpeed:18,wispIntensity:10,flowStrength:.12,decay:1.1,falloffStart:1.1,fogFallSpeed:.5,horizontalBeamOffset:.22,verticalBeamOffset:0,style:{width:"100%",height:"100%"}})}),V.jsx("div",{className:"relative rounded-xl p-[1px] shadow-2xl bg-gradient-to-b from-[rgba(138,122,255,0.6)] via-[rgba(138,122,255,0.15)] to-[rgba(138,122,255,0.05)]",style:{position:"relative",zIndex:10,boxShadow:"0 20px 60px -10px rgba(138,122,255,0.15), 0 4px 20px rgba(0,0,0,0.4)"},children:V.jsxs("div",{className:"relative rounded-[11px] overflow-hidden bg-oai-gray-950",children:[V.jsx("div",{style:{position:"absolute",top:0,left:0,right:0,height:"180px",background:"linear-gradient(to bottom, rgba(138,122,255,0.35) 0%, rgba(138,122,255,0.12) 40%, transparent 100%)",mixBlendMode:"screen",zIndex:20,pointerEvents:"none"}}),V.jsx("div",{style:{position:"absolute",top:0,left:0,right:0,height:"1px",background:"linear-gradient(90deg, transparent 0%, rgba(138,122,255,0.9) 30%, rgba(180,168,255,1) 50%, rgba(138,122,255,0.9) 70%, transparent 100%)",zIndex:25,pointerEvents:"none"}}),V.jsx("img",{src:"/dashboard-dark.png",alt:t("landing.screenshot.alt"),className:"block h-auto w-full object-cover",style:{position:"relative",zIndex:10},loading:"eager",decoding:"async"})]})})]})})]})}),V.jsx("section",{className:"border-y border-oai-gray-900 bg-oai-gray-950/50 py-12 lg:py-16",children:V.jsx("div",{className:"mx-auto max-w-6xl px-4 sm:px-6",children:V.jsxs("div",{className:"flex flex-col md:flex-row md:items-center justify-between gap-8",children:[V.jsx("p",{className:"text-sm font-semibold uppercase tracking-wider text-oai-gray-400 shrink-0",children:t("landing.v2.models.title")}),V.jsx("div",{className:"flex flex-wrap items-center gap-x-8 gap-y-6 opacity-60 hover:opacity-100 transition-opacity duration-500 grayscale hover:grayscale-0",children:h.map(g=>V.jsxs("div",{className:"flex items-center gap-2.5 transition-transform hover:-translate-y-0.5 duration-300",children:[V.jsx("img",{src:g.icon,alt:"",width:20,height:20,className:"h-5 w-5 object-contain",loading:"lazy"}),V.jsx("span",{className:"text-sm font-medium text-oai-gray-300",children:f[g.id]})]},g.id))})]})})}),V.jsx("section",{className:"py-20 lg:py-32",children:V.jsxs("div",{className:"mx-auto max-w-6xl px-4 sm:px-6 grid grid-cols-1 md:grid-cols-2 gap-16 lg:gap-24 items-start",children:[V.jsxs("div",{className:"max-w-md",children:[V.jsx("p",{className:"text-xs font-bold tracking-widest uppercase text-oai-brand-500 mb-4",children:t("landing.v2.compare.kicker")}),V.jsx("h2",{className:"text-3xl font-semibold tracking-tight text-white sm:text-4xl text-balance",children:t("landing.v2.compare.title")}),V.jsx("p",{className:"mt-6 text-lg leading-relaxed text-oai-gray-400",children:t("landing.v2.compare.subtitle")}),V.jsx("p",{className:"mt-6 text-base leading-relaxed text-oai-gray-500",children:t("landing.v2.distill.body")})]}),V.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-10",children:[V.jsxs("div",{className:"space-y-4",children:[V.jsx("h3",{className:"text-sm font-semibold uppercase tracking-wider text-white border-b border-oai-gray-800 pb-3",children:t("landing.v2.compare.with.title")}),V.jsxs("ul",{className:"space-y-3 text-sm text-oai-gray-400",children:[V.jsxs("li",{className:"flex gap-2",children:[V.jsx("span",{className:"text-oai-brand-500 shrink-0",children:"✦"}),V.jsx("span",{children:t("landing.v2.compare.with.p1")})]}),V.jsxs("li",{className:"flex gap-2",children:[V.jsx("span",{className:"text-oai-brand-500 shrink-0",children:"✦"}),V.jsx("span",{children:t("landing.v2.compare.with.p2")})]}),V.jsxs("li",{className:"flex gap-2",children:[V.jsx("span",{className:"text-oai-brand-500 shrink-0",children:"✦"}),V.jsx("span",{children:t("landing.v2.compare.with.p3")})]})]})]}),V.jsxs("div",{className:"space-y-4",children:[V.jsx("h3",{className:"text-sm font-semibold uppercase tracking-wider text-oai-gray-500 border-b border-oai-gray-800/50 pb-3",children:t("landing.v2.compare.without.title")}),V.jsxs("ul",{className:"space-y-3 text-sm text-oai-gray-500",children:[V.jsxs("li",{className:"flex gap-2",children:[V.jsx("span",{className:"opacity-50 shrink-0",children:"✕"}),V.jsx("span",{children:t("landing.v2.compare.without.p1")})]}),V.jsxs("li",{className:"flex gap-2",children:[V.jsx("span",{className:"opacity-50 shrink-0",children:"✕"}),V.jsx("span",{children:t("landing.v2.compare.without.p2")})]}),V.jsxs("li",{className:"flex gap-2",children:[V.jsx("span",{className:"opacity-50 shrink-0",children:"✕"}),V.jsx("span",{children:t("landing.v2.compare.without.p3")})]})]})]})]})]})})]}),V.jsx("footer",{className:"border-t border-oai-gray-900 bg-oai-gray-950 py-12",children:V.jsxs("div",{className:"mx-auto flex max-w-6xl flex-col items-center justify-between gap-6 px-4 sm:px-6 text-sm text-oai-gray-400 sm:flex-row",children:[V.jsx("p",{children:t("landing.v2.footer.line")}),V.jsxs("div",{className:"flex items-center gap-6",children:[V.jsx("a",{href:YE,className:"font-medium text-oai-gray-400 hover:text-white transition-colors",target:"_blank",rel:"noopener noreferrer",children:t("landing.v2.nav.github")}),V.jsxs(po,{to:e,className:"font-medium text-oai-brand-500 hover:text-oai-brand-400 transition-colors",children:[t("landing.cta.primary")," →"]})]})]})})]})}function tj({prefersReducedMotion:t,screenshotMode:e}){return!(e||t)}function nj(){return D.useMemo(()=>typeof window>"u"||!window.matchMedia?!1:window.matchMedia("(prefers-reduced-motion: reduce)").matches,[])}function ij(t=0,e=!0){const[n,i]=D.useState(()=>!e);return D.useEffect(()=>{if(!e){i(!0);return}let r=null,s=null;const l=()=>i(!0);return typeof window<"u"&&"requestIdleCallback"in window?(s=window.requestIdleCallback(l,{timeout:t||200}),()=>{typeof window.cancelIdleCallback=="function"&&s!=null&&window.cancelIdleCallback(s)}):(r=window.setTimeout(l,t),()=>{r!=null&&window.clearTimeout(r)})},[t,e]),n}function rj({signInUrl:t,signUpUrl:e}){const n=qt("landing.handle.special"),i=qt("landing.handle.default");qt("landing.nav.login"),qt("landing.nav.signup");const[r,s]=D.useState(i),l=nj(),c=D.useMemo(()=>typeof window>"u"?!1:QA(window.location.search),[]),d=tj({prefersReducedMotion:l,screenshotMode:c});ij(250,d);const f="tokentracker.dashboard.from_landing.v1";D.useEffect(()=>{if(!(typeof window>"u"))try{window.sessionStorage.setItem(f,"1")}catch{}},[f]),D.useMemo(()=>qt("landing.handle.placeholder",{handle:n}),[n]),D.useMemo(()=>{const b=qt(r===n?"landing.rank.singularity":"landing.rank.unranked");return qt("landing.rank.expectation",{rank:b})},[r,n]);const h=qt("landing.install.command"),[m,g]=D.useState(!1),v=async()=>{await Sz(h)&&(g(!0),window.setTimeout(()=>g(!1),2e3))};return V.jsx(ej,{copy:qt,reduceMotion:l,signInUrl:t,signUpUrl:e,installCommand:h,installCopied:m,onCopyInstallCommand:v})}function aj(t){const e=new URLSearchParams(t).get("next");return typeof e!="string"||e.length===0||!e.startsWith("/")||e.startsWith("//")?"/dashboard":e}const KE={google:"Google",github:"GitHub",microsoft:"Microsoft",discord:"Discord",linkedin:"LinkedIn",facebook:"Facebook",instagram:"Instagram",tiktok:"TikTok",apple:"Apple",x:"X",spotify:"Spotify"};function ZE(t){const e=String(t||"").trim();return KE[e]?KE[e]:e.replace(/-/g," ")}function sj(){const t=wy(),[e,n]=jL(),{enabled:i,loading:r,signedIn:s,refreshUser:l,signInWithPassword:c,signUp:d,signInWithOAuth:f,getPublicAuthConfig:h}=Wl(),m=D.useMemo(()=>aj(e.toString()),[e]),[g,v]=D.useState("signin"),[b,E]=D.useState(""),[_,x]=D.useState(""),[T,C]=D.useState(""),[A,N]=D.useState(!1),[I,U]=D.useState(null),[S,k]=D.useState(null),[Y,F]=D.useState(!0),[$,J]=D.useState([]),[X,q]=D.useState([]),[Z,te]=D.useState(8);D.useEffect(()=>{const ye=e.get("insforge_status"),Ee=e.get("insforge_type"),Ue=e.get("insforge_error");ye==="success"&&Ee==="verify_email"?k(qt("login.verify_email_success")):ye==="error"&&Ee==="verify_email"&&Ue&&k(qt("shared.error.prefix",{error:Ue}))},[e]),D.useEffect(()=>{if(!i){F(!1);return}let ye=!0;return(async()=>{const{data:Ee,error:Ue}=await h();ye&&(Ue||!Ee?(J(["google","github"]),q([])):(J(Array.isArray(Ee.oAuthProviders)?Ee.oAuthProviders:[]),q(Array.isArray(Ee.customOAuthProviders)?Ee.customOAuthProviders:[]),typeof Ee.passwordMinLength=="number"&&Ee.passwordMinLength>0&&te(Ee.passwordMinLength)),F(!1))})(),()=>{ye=!1}},[i,h]),D.useEffect(()=>{!i||r||s&&t(m,{replace:!0})},[i,r,s,t,m]),D.useEffect(()=>{i&&l()},[i,l]);const G=D.useMemo(()=>typeof window>"u"?"":`${window.location.origin}${m}`,[m]),W=D.useMemo(()=>{if(typeof window>"u")return"";const ye=new URLSearchParams;return ye.set("next",m),`${window.location.origin}/login?${ye.toString()}`},[m]),K=D.useCallback(async ye=>{ye.preventDefault(),U(null),N(!0);try{if(g==="signup"){const{data:Ue,error:le}=await d({email:b.trim(),password:_,name:T.trim()||void 0,redirectTo:W});if(le){U(le.message||String(le));return}if(Ue?.requireEmailVerification){k(qt("login.verify_email_pending")),v("signin");return}t(m,{replace:!0});return}const{error:Ee}=await c({email:b.trim(),password:_});if(Ee){U(Ee.message||String(Ee));return}t(m,{replace:!0})}finally{N(!1)}},[g,b,_,T,d,c,t,m,W]),B=D.useCallback(async ye=>{U(null),N(!0);try{const{error:Ee}=await f(ye,G);Ee&&U(Ee.message||String(Ee))}finally{N(!1)}},[f,G]),ie=D.useCallback(()=>{n(ye=>{const Ee=new URLSearchParams(ye);return Ee.delete("insforge_status"),Ee.delete("insforge_type"),Ee.delete("insforge_error"),Ee},{replace:!0}),k(null)},[n]);return i?V.jsxs("div",{className:"min-h-screen bg-oai-gray-950 text-oai-white font-oai antialiased dark flex flex-col",children:[V.jsx("header",{className:"border-b border-oai-gray-900 px-4 sm:px-6 h-16 flex items-center justify-between",children:V.jsx(po,{to:"/",className:"text-sm font-medium text-oai-gray-400 hover:text-white no-underline focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-oai-brand-500 rounded",children:qt("login.back_home")})}),V.jsx("main",{className:"flex-1 flex items-center justify-center px-4 py-12",children:V.jsxs("div",{className:"w-full max-w-md space-y-8",children:[V.jsxs("div",{className:"text-center",children:[V.jsx("h1",{className:"text-2xl font-semibold text-white tracking-tight",children:qt("login.title")}),V.jsx("p",{className:"mt-2 text-sm text-oai-gray-500",children:qt("login.subtitle")})]}),S?V.jsxs("div",{className:"rounded-lg border border-oai-gray-800 bg-oai-gray-900/50 px-4 py-3 text-sm text-oai-gray-300 flex justify-between gap-3 items-start",role:"status",children:[V.jsx("span",{children:S}),V.jsx("button",{type:"button",onClick:ie,className:"shrink-0 text-oai-gray-500 hover:text-white text-xs",children:qt("login.dismiss")})]}):null,I?V.jsx("p",{className:"text-sm text-red-400",role:"alert",children:qt("shared.error.prefix",{error:I})}):null,V.jsx("div",{className:"space-y-3",children:Y?V.jsx("div",{className:"h-11 rounded-lg bg-oai-gray-900 animate-pulse","aria-hidden":!0}):V.jsxs(V.Fragment,{children:[$.map(ye=>V.jsx("button",{type:"button",disabled:A,onClick:()=>B(ye),className:Pi("w-full h-11 rounded-lg border border-oai-gray-700 bg-oai-gray-900 text-sm font-medium text-white","hover:bg-oai-gray-800 transition-colors disabled:opacity-50"),children:qt("login.oauth.continue",{provider:ZE(ye)})},ye)),X.map(ye=>V.jsx("button",{type:"button",disabled:A,onClick:()=>B(ye),className:Pi("w-full h-11 rounded-lg border border-oai-gray-700 bg-oai-gray-900 text-sm font-medium text-white","hover:bg-oai-gray-800 transition-colors disabled:opacity-50"),children:qt("login.oauth.continue",{provider:ZE(ye)})},ye))]})}),V.jsxs("div",{className:"relative",children:[V.jsx("div",{className:"absolute inset-0 flex items-center","aria-hidden":!0,children:V.jsx("span",{className:"w-full border-t border-oai-gray-800"})}),V.jsx("div",{className:"relative flex justify-center text-xs uppercase tracking-wider",children:V.jsx("span",{className:"bg-oai-gray-950 px-3 text-oai-gray-600",children:qt("login.divider")})})]}),V.jsxs("div",{className:"flex rounded-lg border border-oai-gray-800 p-0.5 bg-oai-gray-900/50",children:[V.jsx("button",{type:"button",className:Pi("flex-1 py-2 text-sm font-medium rounded-md transition-colors",g==="signin"?"bg-oai-gray-800 text-white":"text-oai-gray-500 hover:text-oai-gray-300"),onClick:()=>{v("signin"),U(null)},children:qt("login.tab.sign_in")}),V.jsx("button",{type:"button",className:Pi("flex-1 py-2 text-sm font-medium rounded-md transition-colors",g==="signup"?"bg-oai-gray-800 text-white":"text-oai-gray-500 hover:text-oai-gray-300"),onClick:()=>{v("signup"),U(null)},children:qt("login.tab.sign_up")})]}),V.jsxs("form",{onSubmit:K,className:"space-y-4",children:[g==="signup"?V.jsxs("div",{children:[V.jsx("label",{htmlFor:"login-name",className:"block text-xs font-medium text-oai-gray-500 mb-1",children:qt("login.field.name")}),V.jsx("input",{id:"login-name",type:"text",autoComplete:"name",value:T,onChange:ye=>C(ye.target.value),className:"w-full h-11 rounded-lg border border-oai-gray-800 bg-oai-gray-900 px-3 text-sm text-white placeholder-oai-gray-600 focus:outline-none focus:ring-2 focus:ring-oai-brand-500",placeholder:qt("login.field.name_placeholder")})]}):null,V.jsxs("div",{children:[V.jsx("label",{htmlFor:"login-email",className:"block text-xs font-medium text-oai-gray-500 mb-1",children:qt("login.field.email")}),V.jsx("input",{id:"login-email",type:"email",autoComplete:"email",required:!0,value:b,onChange:ye=>E(ye.target.value),className:"w-full h-11 rounded-lg border border-oai-gray-800 bg-oai-gray-900 px-3 text-sm text-white placeholder-oai-gray-600 focus:outline-none focus:ring-2 focus:ring-oai-brand-500"})]}),V.jsxs("div",{children:[V.jsx("label",{htmlFor:"login-password",className:"block text-xs font-medium text-oai-gray-500 mb-1",children:qt("login.field.password")}),V.jsx("input",{id:"login-password",type:"password",autoComplete:g==="signup"?"new-password":"current-password",required:!0,minLength:g==="signup"?Z:void 0,value:_,onChange:ye=>x(ye.target.value),className:"w-full h-11 rounded-lg border border-oai-gray-800 bg-oai-gray-900 px-3 text-sm text-white placeholder-oai-gray-600 focus:outline-none focus:ring-2 focus:ring-oai-brand-500"}),g==="signup"?V.jsx("p",{className:"mt-1 text-xs text-oai-gray-600",children:qt("login.password_hint",{min:String(Z)})}):null]}),V.jsx("button",{type:"submit",disabled:A||r,className:"w-full h-11 rounded-lg bg-white text-oai-gray-950 text-sm font-semibold hover:bg-oai-gray-100 transition-colors disabled:opacity-50",children:qt(g==="signup"?"login.submit.sign_up":"login.submit.sign_in")})]})]})})]}):V.jsxs("div",{className:"min-h-screen bg-oai-gray-950 text-oai-white font-oai antialiased dark flex flex-col",children:[V.jsx("header",{className:"border-b border-oai-gray-900 px-4 sm:px-6 py-4",children:V.jsx(po,{to:"/",className:"text-sm font-medium text-oai-gray-400 hover:text-white no-underline",children:qt("login.back_home")})}),V.jsx("main",{className:"flex-1 flex items-center justify-center px-4",children:V.jsx("p",{className:"text-oai-gray-400 text-center max-w-md",children:qt("login.cloud_only")})})]})}const oj=zl.lazy(()=>Wy(()=>import("./DashboardPage-ccDq1oTb.js"),__vite__mapDeps([0,1])).then(t=>({default:t.DashboardPage}))),lj=zl.lazy(()=>Wy(()=>import("./LeaderboardPage-BvhBcafd.js"),__vite__mapDeps([2,3,1])).then(t=>({default:t.LeaderboardPage}))),cj=zl.lazy(()=>Wy(()=>import("./LeaderboardProfilePage-B5Yw_BZM.js"),__vite__mapDeps([4,3,1])).then(t=>({default:t.LeaderboardProfilePage})));function uj(){const t=vr(),e=Wl();xz();const n=xr(),i=D.useMemo(()=>typeof window>"u"?!1:QA(window.location.search),[]),r=t?.pathname||"/",s=new URL(window.location.href),l=s.pathname.replace(/\/+$/,"")||"/",d=l.match(/^\/share\/([^/?#]+)$/i)?.[1]||null,f=s.searchParams.get("token")||null,h=d||f,m=l==="/share"||l==="/share.html"||l.startsWith("/share/"),g=typeof window<"u"&&(window.location.hostname==="localhost"||window.location.hostname==="127.0.0.1"),v=r.replace(/\/+$/,"")||"/",b=v.match(/^\/leaderboard\/u\/([^/]+)$/i),E=b?b[1]:null,_=v==="/leaderboard"||!!E,x=!!(e.enabled&&e.signedIn),T=g||x,C=!1,A=VV(),N=D.useMemo(()=>!e.enabled||!x?null:{getAccessToken:()=>e.getAccessToken()},[e,x]);let I=g||n||i?"dashboard":"landing";v==="/landing"&&(I="landing"),v==="/dashboard"&&(I="dashboard"),_&&(I="dashboard");const U=E?cj:v==="/leaderboard"?lj:oj,S=V.jsx("div",{className:"min-h-screen bg-[#050505]"});let k=null;return v==="/login"?k=V.jsx(sj,{}):I==="landing"?k=V.jsx(rj,{signInUrl:"/login",signUpUrl:"/login"}):k=V.jsx(D.Suspense,{fallback:S,children:V.jsx(U,{baseUrl:A,auth:N,signedIn:T,sessionSoftExpired:C,signOut:()=>e.enabled?e.signOut():Promise.resolve(),publicMode:m,publicToken:h,userId:E,signInUrl:"/login",signUpUrl:"/login"})}),V.jsx(A3,{children:V.jsx(k3,{children:V.jsxs(L3,{children:[k,V.jsx(OV,{})]})})})}const dj=OL([{path:"*",element:V.jsx(uj,{})}]);MP.createRoot(document.getElementById("root")).render(V.jsx(zl.StrictMode,{children:V.jsx(UI,{children:V.jsx(JL,{router:dj})})}));export{WI as $,qA as A,qt as B,V as C,Xy as D,KI as E,BM as F,my as G,d3 as H,xS as I,eh as J,vS as K,$y as L,b0 as M,Sj as N,bl as O,jy as P,ZL as Q,QE as R,PM as S,m3 as T,bS as U,jl as V,NM as W,yS as X,kM as Y,BI as Z,jI as _,hi as a,VI as a0,Xg as a1,DM as a2,_j as a3,GI as a4,xj as a5,LM as a6,bj as a7,Lz as a8,po as a9,Ej as aA,TM as aB,Em as aC,Oj as aD,Pi as aE,Mz as aF,Ez as aG,vz as aH,Bj as aI,RI as aJ,Vj as aK,C3 as aL,Tz as aa,P4 as ab,vo as ac,a3 as ad,zl as ae,Dj as af,Lj as ag,yA as ah,QA as ai,ro as aj,zj as ak,Tj as al,Mj as am,Nj as an,$V as ao,Aj as ap,Cj as aq,Hj as ar,kj as as,Wy as at,Ij as au,Sz as av,vr as aw,wy as ax,GM as ay,Wl as az,WM as b,Ps as c,BS as d,E0 as e,Mn as f,YA as g,xr as h,CU as i,yj as j,NI as k,Xj as l,Il as m,YV as n,KV as o,Wj as p,Pj as q,D as r,Fj as s,jj as t,Yy as u,$j as v,Rj as w,kn as x,Uj as y,Gj as z};
4759
+ `;function qE(t){let e=t.trim().replace("#","");e.length===3&&(e=e.split("").map(i=>i+i).join(""));const n=parseInt(e,16)||16777215;return{r:(n>>16&255)/255,g:(n>>8&255)/255,b:(n&255)/255}}function XW({className:t,style:e,wispDensity:n=1,dpr:i,mouseSmoothTime:r=.06,mouseTiltStrength:s=.01,horizontalBeamOffset:l=0,verticalBeamOffset:c=-.5,flowSpeed:d=.35,verticalSizing:f=2,horizontalSizing:h=.5,fogIntensity:m=.45,fogScale:g=.3,wispSpeed:v=15,wispIntensity:b=5,flowStrength:E=.25,decay:_=1.1,falloffStart:x=1.2,fogFallSpeed:T=.6,color:C="#8a7aff"}){const A=D.useRef(null),N=D.useRef(null),I=D.useRef(!1),U=D.useRef(null),S=D.useRef(!0),k=D.useRef(!1),Y=D.useRef(r);return D.useEffect(()=>{Y.current=r},[r]),D.useEffect(()=>{const F=A.current;let $;try{$=new WW({antialias:!1,alpha:!0,premultipliedAlpha:!1,depth:!1,stencil:!1,powerPreference:"high-performance"})}catch(At){console.warn("LaserFlow: WebGL not supported or context creation failed.",At);return}let X=Math.min(i??(window.devicePixelRatio||1),2);$.setPixelRatio(X),$.outputColorSpace=Mo,$.setClearColor(0,0);const q=$.domElement;q.style.cssText="position:absolute;inset:0;width:100%;height:100%;display:block;",F.appendChild(q);const Z=new P5,te=new V0(-1,1,1,-1,0,1),G=new ha;G.setAttribute("position",new Vr(new Float32Array([-1,-1,0,3,-1,0,-1,3,0]),3));const W={iTime:{value:0},iResolution:{value:new me(1,1,1)},iMouse:{value:new Vn(0,0,0,0)},uWispDensity:{value:n},uTiltScale:{value:s},uFlowTime:{value:0},uFogTime:{value:0},uBeamXFrac:{value:l},uBeamYFrac:{value:c},uFlowSpeed:{value:d},uVLenFactor:{value:f},uHLenFactor:{value:h},uFogIntensity:{value:m},uFogScale:{value:g},uWSpeed:{value:v},uWIntensity:{value:b},uFlowStrength:{value:E},uDecay:{value:_},uFalloffStart:{value:x},uFogFallSpeed:{value:T},uColor:{value:new me(1,1,1)},uFade:{value:I.current?1:0}};N.current=W;const{r:K,g:B,b:ie}=qE(C);W.uColor.value.set(K,B,ie);const ye=new kC({vertexShader:jW,fragmentShader:$W,uniforms:W,transparent:!0,depthTest:!1,depthWrite:!1,blending:yo}),Ee=new ua(G,ye);Ee.frustumCulled=!1,Z.add(Ee);let Ue=0,le=0,be=0;function Se(){const At=F.clientWidth||1,kt=F.clientHeight||1;Math.abs(At-Ue)<1&&Math.abs(kt-le)<1&&Math.abs(X-be)<.01||(Ue=At,le=kt,be=X,$.setPixelRatio(X),$.setSize(At,kt,!1),W.iResolution.value.set(At*X,kt*X,X),U.current=q.getBoundingClientRect())}let Ne=0;const et=new ResizeObserver(()=>{cancelAnimationFrame(Ne),Ne=requestAnimationFrame(Se)});et.observe(F),Se();const xt=new IntersectionObserver(At=>{S.current=At[0]?.isIntersecting??!0},{threshold:0});xt.observe(F),document.addEventListener("visibilitychange",()=>{k.current=document.hidden},{passive:!0});const pn=new bn(0,0),ht=new bn(0,0);function Ut(At){const kt=U.current;kt&&pn.set((At.clientX-kt.left)*X,(kt.height-(At.clientY-kt.top))*X)}q.addEventListener("pointermove",Ut,{passive:!0}),q.addEventListener("pointerleave",()=>pn.set(0,0),{passive:!0});let nn=0,Lt=I.current?1:0;const sn=new K5;let Q=0;function Sn(){if(Q=requestAnimationFrame(Sn),k.current||!S.current)return;const At=sn.getElapsedTime(),kt=Math.min(Math.max(At-nn,.001),.033);nn=At,W.iTime.value=At,W.uFlowTime.value+=kt,W.uFogTime.value+=kt,I.current||(Lt=Math.min(1,Lt+kt/1),W.uFade.value=Lt,Lt>=1&&(I.current=!0));const it=Math.max(.001,Y.current);ht.lerp(pn,1-Math.exp(-kt/it)),W.iMouse.value.set(ht.x,ht.y,0,0),$.render(Z,te)}return Sn(),()=>{cancelAnimationFrame(Q),cancelAnimationFrame(Ne),et.disconnect(),xt.disconnect(),Z.clear(),G.dispose(),ye.dispose(),$.dispose(),$.forceContextLoss(),F.contains(q)&&F.removeChild(q)}},[i]),D.useEffect(()=>{const F=N.current;if(!F)return;F.uWispDensity.value=n,F.uTiltScale.value=s,F.uBeamXFrac.value=l,F.uBeamYFrac.value=c,F.uFlowSpeed.value=d,F.uVLenFactor.value=f,F.uHLenFactor.value=h,F.uFogIntensity.value=m,F.uFogScale.value=g,F.uWSpeed.value=v,F.uWIntensity.value=b,F.uFlowStrength.value=E,F.uDecay.value=_,F.uFalloffStart.value=x,F.uFogFallSpeed.value=T;const{r:$,g:J,b:X}=qE(C);F.uColor.value.set($,J,X)},[n,s,l,c,d,f,h,m,g,v,b,E,_,x,T,C]),V.jsx("div",{ref:A,className:t,style:{position:"relative",overflow:"hidden",...e}})}function qW({className:t}){return V.jsx("svg",{viewBox:"0 0 384 512",className:t,fill:"currentColor",children:V.jsx("path",{d:"M318.7 268.7c-.2-36.7 16.4-64.4 50-84.8-18.8-26.9-47.2-41.7-84.7-44.6-35.5-2.8-74.3 20.7-88.5 20.7-15 0-49.4-19.7-76.4-19.7C63.3 141.2 4 184.8 4 273.5q0 39.3 14.4 81.2c12.8 36.7 59 126.7 107.2 125.2 25.2-.6 43-17.9 75.8-17.9 31.8 0 48.3 17.9 76.4 17.9 48.6-.7 90.4-82.5 102.6-119.3-65.2-30.7-61.7-90-61.7-91.9zm-56.6-164.2c27.3-32.4 24.8-61.9 24-72.5-24.1 1.4-52 16.4-67.9 34.9-17.5 19.8-27.8 44.3-25.6 71.9 26.1 2 49.9-11.4 69.5-34.3z"})})}function YW({className:t}){return V.jsx("svg",{viewBox:"0 0 16 16",className:t,fill:"currentColor",children:V.jsx("path",{d:"M8 0c4.42 0 8 3.58 8 8a8.013 8.013 0 0 1-5.45 7.59c-.4.08-.55-.17-.55-.38 0-.27.01-1.13.01-2.2 0-.75-.25-1.23-.54-1.48 1.78-.2 3.65-.88 3.65-3.95 0-.88-.31-1.59-.82-2.15.08-.2.36-1.02-.08-2.12 0 0-.67-.22-2.2.82-.64-.18-1.32-.27-2-.27-.68 0-1.36.09-2 .27-1.53-1.03-2.2-.82-2.2-.82-.44 1.1-.16 1.92-.08 2.12-.51.56-.82 1.28-.82 2.15 0 3.06 1.86 3.75 3.64 3.95-.23.2-.44.55-.51 1.07-.46.21-1.61.55-2.33-.66-.15-.24-.6-.83-1.23-.82-.67.01-.27.38.01.53.34.19.73.9.82 1.13.16.45.68 1.31 2.69.94 0 .67.01 1.3.01 1.49 0 .21-.15.45-.55.38A7.995 7.995 0 0 1 0 8c0-4.42 3.58-8 8-8Z"})})}function KW({className:t}){return V.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:t,children:[V.jsx("rect",{x:"9",y:"9",width:"13",height:"13",rx:"2",ry:"2"}),V.jsx("path",{d:"M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1"})]})}function ZW({className:t}){return V.jsx("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:t,children:V.jsx("polyline",{points:"20 6 9 17 4 12"})})}const YE="https://github.com/mm7894215/tokentracker",JW="https://github.com/mm7894215/tokentracker/releases/latest";function QW(t="default",e="md",n){const i="inline-flex items-center justify-center rounded font-medium transition-colors duration-200 ease-out focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-oai-brand-500 focus-visible:ring-offset-2 dark:focus-visible:ring-offset-oai-gray-950",r={default:"bg-oai-gray-900 text-white hover:bg-oai-gray-800 active:bg-oai-gray-950 dark:bg-white dark:text-oai-gray-900 dark:hover:bg-oai-gray-100 dark:active:bg-oai-gray-200",ghost:"text-oai-gray-600 hover:text-oai-gray-900 hover:bg-oai-gray-100 active:bg-oai-gray-200 dark:text-oai-gray-400 dark:hover:text-white dark:hover:bg-oai-gray-800 dark:active:bg-oai-gray-700"},s={sm:"h-9 px-4 text-sm",md:"h-11 px-6 text-sm",lg:"h-12 px-8 text-base"};return Pi(i,r[t],s[e],n)}function ej({copy:t,signInUrl:e,signUpUrl:n,installCommand:i,installCopied:r,onCopyInstallCommand:s}){const l=P4(),c=typeof window<"u"&&(window.location.hostname==="localhost"||window.location.hostname==="127.0.0.1"),{signedIn:d,loading:f}=Wl(),h=D.useMemo(()=>({codex:t("landing.v2.models.agent.codex"),claude_code:t("landing.v2.models.agent.claude_code"),cursor:t("landing.v2.models.agent.cursor"),gemini:t("landing.v2.models.agent.gemini"),opencode:t("landing.v2.models.agent.opencode"),openclaw:t("landing.v2.models.agent.openclaw")}),[t]),m=D.useMemo(()=>[{id:"codex",icon:"/brand-logos/codex.svg"},{id:"claude_code",icon:"/brand-logos/claude-code.svg"},{id:"cursor",icon:"/brand-logos/cursor.svg"},{id:"gemini",icon:"/brand-logos/gemini.svg"},{id:"opencode",icon:"/brand-logos/opencode.svg"},{id:"openclaw",icon:"/brand-logos/openclaw.svg"}],[]),g=l?{duration:0}:void 0;return V.jsxs("div",{className:"min-h-screen bg-oai-gray-950 text-oai-white font-oai antialiased dark",children:[V.jsx("header",{className:"sticky top-0 z-50 bg-oai-gray-950/80 backdrop-blur-md border-b border-oai-gray-900",children:V.jsxs("div",{className:"mx-auto flex h-14 max-w-6xl items-center justify-between px-4 sm:px-6",children:[V.jsxs("div",{className:"flex items-center gap-5",children:[V.jsxs(po,{to:n||"/",className:"flex items-center gap-3 no-underline outline-none rounded focus-visible:ring-2 focus-visible:ring-oai-brand-500 focus-visible:ring-offset-2 dark:ring-offset-oai-gray-950 transition-opacity hover:opacity-80",children:[V.jsx("img",{src:"/app-icon.png",alt:"",width:24,height:24,className:"rounded-md"}),V.jsx("span",{className:"text-sm font-semibold tracking-wide text-white uppercase",children:"Token Tracker"})]}),V.jsx("div",{className:"hidden sm:block",children:V.jsx(Mz,{})})]}),c&&V.jsxs("div",{className:"flex flex-wrap items-center justify-end gap-2 sm:gap-3",children:[V.jsxs(po,{to:Ez(),className:Pi(QW(d||f?"default":"ghost","sm"),"no-underline px-5 rounded-full group",d||f?"shadow-sm ring-1 ring-white/10":"ring-1 ring-oai-gray-700"),children:[t("landing.v2.cta.primary"),V.jsx("span",{className:"ml-2 inline-block transition-transform duration-200 group-hover:translate-x-0.5",children:"→"})]}),V.jsx(Lz,{})]})]})}),V.jsxs("main",{children:[V.jsx("section",{className:"py-16 sm:py-24 lg:py-32",children:V.jsxs("div",{className:"mx-auto max-w-7xl px-4 sm:px-6 flex flex-col items-center text-center gap-20 lg:gap-36",children:[V.jsxs(vo.div,{initial:l?!1:{opacity:0,y:20},animate:{opacity:1,y:0},transition:g||{duration:.5},className:"w-full max-w-3xl relative z-20",children:[V.jsxs("h1",{className:"text-balance text-5xl font-semibold tracking-tight text-white sm:text-6xl lg:text-[4rem] lg:leading-[1.05]",children:[t("landing.v2.hero.title_line1"),V.jsx("br",{}),V.jsx("span",{className:"bg-gradient-to-b from-white via-oai-gray-200 to-oai-gray-500 bg-clip-text text-transparent font-bold tracking-tight",style:{WebkitTextStroke:"1px rgba(255, 255, 255, 0.15)"},children:t("landing.v2.hero.title_line2")})]}),V.jsx("p",{className:"mt-6 text-lg leading-relaxed text-oai-gray-400",children:t("landing.v2.hero.subtagline")}),V.jsxs("div",{className:"mt-8 w-full max-w-lg mx-auto",children:[V.jsxs(vo.div,{whileHover:{scale:1.01,y:-1},transition:{type:"spring",stiffness:400,damping:25},className:"group relative flex items-center justify-between w-full bg-[#0a0a0a]/50 backdrop-blur-md border border-oai-gray-800 rounded-2xl p-1.5 pl-5 shadow-2xl shadow-black/50 transition-all duration-300",children:[V.jsx("div",{className:"absolute inset-0 rounded-2xl bg-gradient-to-r from-oai-brand-500/0 via-oai-brand-500/5 to-oai-brand-500/0 opacity-0 group-hover:opacity-100 transition-opacity duration-500 pointer-events-none"}),V.jsxs("div",{className:"flex items-center gap-3 overflow-hidden relative z-10",children:[V.jsx("span",{className:"text-oai-gray-600 font-mono select-none","aria-hidden":"true",children:"›"}),V.jsx("code",{className:"font-mono text-sm text-oai-gray-200 overflow-x-auto whitespace-nowrap py-2 [scrollbar-width:none]",children:i?i.split(" ").map((v,b)=>V.jsxs("span",{className:v==="npx"||v==="tokentracker-cli"?"text-white font-medium":v==="--yes"?"text-oai-gray-500":"text-oai-brand-400",children:[v," "]},b)):null})]}),V.jsx("button",{type:"button",onClick:s,"aria-label":t(r?"landing.install.action.copied":"landing.install.action.copy"),className:"shrink-0 relative z-10 flex h-9 w-9 items-center justify-center text-oai-gray-200 bg-oai-gray-900 border border-oai-gray-700 rounded-lg hover:bg-oai-gray-800 hover:text-white active:scale-95 transition-all duration-200 shadow-sm",children:r?V.jsx(ZW,{className:"h-4 w-4 text-green-400","aria-hidden":!0}):V.jsx(KW,{className:"h-4 w-4 opacity-70","aria-hidden":!0})})]}),V.jsxs("div",{className:"mt-8 flex flex-wrap items-center justify-center gap-x-6 gap-y-4",children:[V.jsxs("a",{href:JW,target:"_blank",rel:"noopener noreferrer",className:"group flex items-center gap-2 text-sm font-medium text-oai-gray-400 hover:text-white transition-colors",children:[V.jsx("div",{className:"flex items-center justify-center h-8 w-8 rounded-full bg-oai-gray-800 group-hover:bg-oai-gray-700 transition-colors",children:V.jsx(qW,{className:"h-4 w-4 text-oai-gray-400 group-hover:text-white"})}),t("landing.v2.install.mac_cta")]}),V.jsxs("a",{href:YE,target:"_blank",rel:"noopener noreferrer",className:"group flex items-center gap-2 text-sm font-medium text-oai-gray-400 hover:text-white transition-colors",children:[V.jsx("div",{className:"flex items-center justify-center h-8 w-8 rounded-full bg-oai-gray-800 group-hover:bg-oai-gray-700 transition-colors",children:V.jsx(YW,{className:"h-4 w-4 text-oai-gray-400 group-hover:text-white"})}),t("landing.cta.secondary")]})]}),V.jsx("span",{className:"sr-only","aria-live":"polite",children:r?t("landing.install.action.copied"):""})]})]}),V.jsx("div",{className:"relative group w-full",children:V.jsxs(vo.div,{initial:l?!1:{opacity:0,y:24},animate:{opacity:1,y:0},transition:g||{duration:.6,delay:.1},className:"relative w-full",children:[V.jsx("div",{style:{position:"absolute",top:"-256px",left:0,right:0,height:"510px",zIndex:3,pointerEvents:"none"},children:V.jsx(XW,{color:"#8a7aff",wispDensity:2,flowSpeed:.28,verticalSizing:2.2,horizontalSizing:1.22,fogIntensity:4,fogScale:.1,wispSpeed:18,wispIntensity:10,flowStrength:.12,decay:1.1,falloffStart:1.1,fogFallSpeed:.5,horizontalBeamOffset:.22,verticalBeamOffset:0,style:{width:"100%",height:"100%"}})}),V.jsx("div",{className:"relative rounded-xl p-[1px] shadow-2xl bg-gradient-to-b from-[rgba(138,122,255,0.6)] via-[rgba(138,122,255,0.15)] to-[rgba(138,122,255,0.05)]",style:{position:"relative",zIndex:10,boxShadow:"0 20px 60px -10px rgba(138,122,255,0.15), 0 4px 20px rgba(0,0,0,0.4)"},children:V.jsxs("div",{className:"relative rounded-[11px] overflow-hidden bg-oai-gray-950",children:[V.jsx("div",{style:{position:"absolute",top:0,left:0,right:0,height:"180px",background:"linear-gradient(to bottom, rgba(138,122,255,0.35) 0%, rgba(138,122,255,0.12) 40%, transparent 100%)",mixBlendMode:"screen",zIndex:20,pointerEvents:"none"}}),V.jsx("div",{style:{position:"absolute",top:0,left:0,right:0,height:"1px",background:"linear-gradient(90deg, transparent 0%, rgba(138,122,255,0.9) 30%, rgba(180,168,255,1) 50%, rgba(138,122,255,0.9) 70%, transparent 100%)",zIndex:25,pointerEvents:"none"}}),V.jsx("img",{src:"/dashboard-dark.png",alt:t("landing.screenshot.alt"),className:"block h-auto w-full object-cover",style:{position:"relative",zIndex:10},loading:"eager",decoding:"async"})]})})]})})]})}),V.jsx("section",{className:"border-y border-oai-gray-900 bg-oai-gray-950/50 py-12 lg:py-16",children:V.jsx("div",{className:"mx-auto max-w-6xl px-4 sm:px-6",children:V.jsxs("div",{className:"flex flex-col md:flex-row md:items-center justify-between gap-8",children:[V.jsx("p",{className:"text-sm font-semibold uppercase tracking-wider text-oai-gray-400 shrink-0",children:t("landing.v2.models.title")}),V.jsx("div",{className:"flex flex-wrap items-center gap-x-8 gap-y-6 opacity-60 hover:opacity-100 transition-opacity duration-500 grayscale hover:grayscale-0",children:m.map(v=>V.jsxs("div",{className:"flex items-center gap-2.5 transition-transform hover:-translate-y-0.5 duration-300",children:[V.jsx("img",{src:v.icon,alt:"",width:20,height:20,className:"h-5 w-5 object-contain",loading:"lazy"}),V.jsx("span",{className:"text-sm font-medium text-oai-gray-300",children:h[v.id]})]},v.id))})]})})}),V.jsx("section",{className:"py-20 lg:py-32",children:V.jsxs("div",{className:"mx-auto max-w-6xl px-4 sm:px-6 grid grid-cols-1 md:grid-cols-2 gap-16 lg:gap-24 items-start",children:[V.jsxs("div",{className:"max-w-md",children:[V.jsx("p",{className:"text-xs font-bold tracking-widest uppercase text-oai-brand-500 mb-4",children:t("landing.v2.compare.kicker")}),V.jsx("h2",{className:"text-3xl font-semibold tracking-tight text-white sm:text-4xl text-balance",children:t("landing.v2.compare.title")}),V.jsx("p",{className:"mt-6 text-lg leading-relaxed text-oai-gray-400",children:t("landing.v2.compare.subtitle")}),V.jsx("p",{className:"mt-6 text-base leading-relaxed text-oai-gray-500",children:t("landing.v2.distill.body")})]}),V.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-10",children:[V.jsxs("div",{className:"space-y-4",children:[V.jsx("h3",{className:"text-sm font-semibold uppercase tracking-wider text-white border-b border-oai-gray-800 pb-3",children:t("landing.v2.compare.with.title")}),V.jsxs("ul",{className:"space-y-3 text-sm text-oai-gray-400",children:[V.jsxs("li",{className:"flex gap-2",children:[V.jsx("span",{className:"text-oai-brand-500 shrink-0",children:"✦"}),V.jsx("span",{children:t("landing.v2.compare.with.p1")})]}),V.jsxs("li",{className:"flex gap-2",children:[V.jsx("span",{className:"text-oai-brand-500 shrink-0",children:"✦"}),V.jsx("span",{children:t("landing.v2.compare.with.p2")})]}),V.jsxs("li",{className:"flex gap-2",children:[V.jsx("span",{className:"text-oai-brand-500 shrink-0",children:"✦"}),V.jsx("span",{children:t("landing.v2.compare.with.p3")})]})]})]}),V.jsxs("div",{className:"space-y-4",children:[V.jsx("h3",{className:"text-sm font-semibold uppercase tracking-wider text-oai-gray-500 border-b border-oai-gray-800/50 pb-3",children:t("landing.v2.compare.without.title")}),V.jsxs("ul",{className:"space-y-3 text-sm text-oai-gray-500",children:[V.jsxs("li",{className:"flex gap-2",children:[V.jsx("span",{className:"opacity-50 shrink-0",children:"✕"}),V.jsx("span",{children:t("landing.v2.compare.without.p1")})]}),V.jsxs("li",{className:"flex gap-2",children:[V.jsx("span",{className:"opacity-50 shrink-0",children:"✕"}),V.jsx("span",{children:t("landing.v2.compare.without.p2")})]}),V.jsxs("li",{className:"flex gap-2",children:[V.jsx("span",{className:"opacity-50 shrink-0",children:"✕"}),V.jsx("span",{children:t("landing.v2.compare.without.p3")})]})]})]})]})]})})]}),V.jsx("footer",{className:"border-t border-oai-gray-900 bg-oai-gray-950 py-12",children:V.jsxs("div",{className:"mx-auto flex max-w-6xl flex-col items-center justify-between gap-6 px-4 sm:px-6 text-sm text-oai-gray-400 sm:flex-row",children:[V.jsx("p",{children:t("landing.v2.footer.line")}),V.jsxs("div",{className:"flex items-center gap-6",children:[V.jsx("a",{href:YE,className:"font-medium text-oai-gray-400 hover:text-white transition-colors",target:"_blank",rel:"noopener noreferrer",children:t("landing.v2.nav.github")}),c&&V.jsxs(po,{to:e,className:"font-medium text-oai-brand-500 hover:text-oai-brand-400 transition-colors",children:[t("landing.cta.primary")," →"]})]})]})})]})}function tj({prefersReducedMotion:t,screenshotMode:e}){return!(e||t)}function nj(){return D.useMemo(()=>typeof window>"u"||!window.matchMedia?!1:window.matchMedia("(prefers-reduced-motion: reduce)").matches,[])}function ij(t=0,e=!0){const[n,i]=D.useState(()=>!e);return D.useEffect(()=>{if(!e){i(!0);return}let r=null,s=null;const l=()=>i(!0);return typeof window<"u"&&"requestIdleCallback"in window?(s=window.requestIdleCallback(l,{timeout:t||200}),()=>{typeof window.cancelIdleCallback=="function"&&s!=null&&window.cancelIdleCallback(s)}):(r=window.setTimeout(l,t),()=>{r!=null&&window.clearTimeout(r)})},[t,e]),n}function rj({signInUrl:t,signUpUrl:e}){const n=qt("landing.handle.special"),i=qt("landing.handle.default");qt("landing.nav.login"),qt("landing.nav.signup");const[r,s]=D.useState(i),l=nj(),c=D.useMemo(()=>typeof window>"u"?!1:QA(window.location.search),[]),d=tj({prefersReducedMotion:l,screenshotMode:c});ij(250,d);const f="tokentracker.dashboard.from_landing.v1";D.useEffect(()=>{if(!(typeof window>"u"))try{window.sessionStorage.setItem(f,"1")}catch{}},[f]),D.useMemo(()=>qt("landing.handle.placeholder",{handle:n}),[n]),D.useMemo(()=>{const b=qt(r===n?"landing.rank.singularity":"landing.rank.unranked");return qt("landing.rank.expectation",{rank:b})},[r,n]);const h=qt("landing.install.command"),[m,g]=D.useState(!1),v=async()=>{await Sz(h)&&(g(!0),window.setTimeout(()=>g(!1),2e3))};return V.jsx(ej,{copy:qt,reduceMotion:l,signInUrl:t,signUpUrl:e,installCommand:h,installCopied:m,onCopyInstallCommand:v})}function aj(t){const e=new URLSearchParams(t).get("next");return typeof e!="string"||e.length===0||!e.startsWith("/")||e.startsWith("//")?"/dashboard":e}const KE={google:"Google",github:"GitHub",microsoft:"Microsoft",discord:"Discord",linkedin:"LinkedIn",facebook:"Facebook",instagram:"Instagram",tiktok:"TikTok",apple:"Apple",x:"X",spotify:"Spotify"};function ZE(t){const e=String(t||"").trim();return KE[e]?KE[e]:e.replace(/-/g," ")}function sj(){const t=wy(),[e,n]=jL(),{enabled:i,loading:r,signedIn:s,refreshUser:l,signInWithPassword:c,signUp:d,signInWithOAuth:f,getPublicAuthConfig:h}=Wl(),m=D.useMemo(()=>aj(e.toString()),[e]),[g,v]=D.useState("signin"),[b,E]=D.useState(""),[_,x]=D.useState(""),[T,C]=D.useState(""),[A,N]=D.useState(!1),[I,U]=D.useState(null),[S,k]=D.useState(null),[Y,F]=D.useState(!0),[$,J]=D.useState([]),[X,q]=D.useState([]),[Z,te]=D.useState(8);D.useEffect(()=>{const ye=e.get("insforge_status"),Ee=e.get("insforge_type"),Ue=e.get("insforge_error");ye==="success"&&Ee==="verify_email"?k(qt("login.verify_email_success")):ye==="error"&&Ee==="verify_email"&&Ue&&k(qt("shared.error.prefix",{error:Ue}))},[e]),D.useEffect(()=>{if(!i){F(!1);return}let ye=!0;return(async()=>{const{data:Ee,error:Ue}=await h();ye&&(Ue||!Ee?(J(["google","github"]),q([])):(J(Array.isArray(Ee.oAuthProviders)?Ee.oAuthProviders:[]),q(Array.isArray(Ee.customOAuthProviders)?Ee.customOAuthProviders:[]),typeof Ee.passwordMinLength=="number"&&Ee.passwordMinLength>0&&te(Ee.passwordMinLength)),F(!1))})(),()=>{ye=!1}},[i,h]),D.useEffect(()=>{!i||r||s&&t(m,{replace:!0})},[i,r,s,t,m]),D.useEffect(()=>{i&&l()},[i,l]);const G=D.useMemo(()=>typeof window>"u"?"":`${window.location.origin}${m}`,[m]),W=D.useMemo(()=>{if(typeof window>"u")return"";const ye=new URLSearchParams;return ye.set("next",m),`${window.location.origin}/login?${ye.toString()}`},[m]),K=D.useCallback(async ye=>{ye.preventDefault(),U(null),N(!0);try{if(g==="signup"){const{data:Ue,error:le}=await d({email:b.trim(),password:_,name:T.trim()||void 0,redirectTo:W});if(le){U(le.message||String(le));return}if(Ue?.requireEmailVerification){k(qt("login.verify_email_pending")),v("signin");return}t(m,{replace:!0});return}const{error:Ee}=await c({email:b.trim(),password:_});if(Ee){U(Ee.message||String(Ee));return}t(m,{replace:!0})}finally{N(!1)}},[g,b,_,T,d,c,t,m,W]),B=D.useCallback(async ye=>{U(null),N(!0);try{const{error:Ee}=await f(ye,G);Ee&&U(Ee.message||String(Ee))}finally{N(!1)}},[f,G]),ie=D.useCallback(()=>{n(ye=>{const Ee=new URLSearchParams(ye);return Ee.delete("insforge_status"),Ee.delete("insforge_type"),Ee.delete("insforge_error"),Ee},{replace:!0}),k(null)},[n]);return i?V.jsxs("div",{className:"min-h-screen bg-oai-gray-950 text-oai-white font-oai antialiased dark flex flex-col",children:[V.jsx("header",{className:"border-b border-oai-gray-900 px-4 sm:px-6 h-16 flex items-center justify-between",children:V.jsx(po,{to:"/",className:"text-sm font-medium text-oai-gray-400 hover:text-white no-underline focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-oai-brand-500 rounded",children:qt("login.back_home")})}),V.jsx("main",{className:"flex-1 flex items-center justify-center px-4 py-12",children:V.jsxs("div",{className:"w-full max-w-md space-y-8",children:[V.jsxs("div",{className:"text-center",children:[V.jsx("h1",{className:"text-2xl font-semibold text-white tracking-tight",children:qt("login.title")}),V.jsx("p",{className:"mt-2 text-sm text-oai-gray-500",children:qt("login.subtitle")})]}),S?V.jsxs("div",{className:"rounded-lg border border-oai-gray-800 bg-oai-gray-900/50 px-4 py-3 text-sm text-oai-gray-300 flex justify-between gap-3 items-start",role:"status",children:[V.jsx("span",{children:S}),V.jsx("button",{type:"button",onClick:ie,className:"shrink-0 text-oai-gray-500 hover:text-white text-xs",children:qt("login.dismiss")})]}):null,I?V.jsx("p",{className:"text-sm text-red-400",role:"alert",children:qt("shared.error.prefix",{error:I})}):null,V.jsx("div",{className:"space-y-3",children:Y?V.jsx("div",{className:"h-11 rounded-lg bg-oai-gray-900 animate-pulse","aria-hidden":!0}):V.jsxs(V.Fragment,{children:[$.map(ye=>V.jsx("button",{type:"button",disabled:A,onClick:()=>B(ye),className:Pi("w-full h-11 rounded-lg border border-oai-gray-700 bg-oai-gray-900 text-sm font-medium text-white","hover:bg-oai-gray-800 transition-colors disabled:opacity-50"),children:qt("login.oauth.continue",{provider:ZE(ye)})},ye)),X.map(ye=>V.jsx("button",{type:"button",disabled:A,onClick:()=>B(ye),className:Pi("w-full h-11 rounded-lg border border-oai-gray-700 bg-oai-gray-900 text-sm font-medium text-white","hover:bg-oai-gray-800 transition-colors disabled:opacity-50"),children:qt("login.oauth.continue",{provider:ZE(ye)})},ye))]})}),V.jsxs("div",{className:"relative",children:[V.jsx("div",{className:"absolute inset-0 flex items-center","aria-hidden":!0,children:V.jsx("span",{className:"w-full border-t border-oai-gray-800"})}),V.jsx("div",{className:"relative flex justify-center text-xs uppercase tracking-wider",children:V.jsx("span",{className:"bg-oai-gray-950 px-3 text-oai-gray-600",children:qt("login.divider")})})]}),V.jsxs("div",{className:"flex rounded-lg border border-oai-gray-800 p-0.5 bg-oai-gray-900/50",children:[V.jsx("button",{type:"button",className:Pi("flex-1 py-2 text-sm font-medium rounded-md transition-colors",g==="signin"?"bg-oai-gray-800 text-white":"text-oai-gray-500 hover:text-oai-gray-300"),onClick:()=>{v("signin"),U(null)},children:qt("login.tab.sign_in")}),V.jsx("button",{type:"button",className:Pi("flex-1 py-2 text-sm font-medium rounded-md transition-colors",g==="signup"?"bg-oai-gray-800 text-white":"text-oai-gray-500 hover:text-oai-gray-300"),onClick:()=>{v("signup"),U(null)},children:qt("login.tab.sign_up")})]}),V.jsxs("form",{onSubmit:K,className:"space-y-4",children:[g==="signup"?V.jsxs("div",{children:[V.jsx("label",{htmlFor:"login-name",className:"block text-xs font-medium text-oai-gray-500 mb-1",children:qt("login.field.name")}),V.jsx("input",{id:"login-name",type:"text",autoComplete:"name",value:T,onChange:ye=>C(ye.target.value),className:"w-full h-11 rounded-lg border border-oai-gray-800 bg-oai-gray-900 px-3 text-sm text-white placeholder-oai-gray-600 focus:outline-none focus:ring-2 focus:ring-oai-brand-500",placeholder:qt("login.field.name_placeholder")})]}):null,V.jsxs("div",{children:[V.jsx("label",{htmlFor:"login-email",className:"block text-xs font-medium text-oai-gray-500 mb-1",children:qt("login.field.email")}),V.jsx("input",{id:"login-email",type:"email",autoComplete:"email",required:!0,value:b,onChange:ye=>E(ye.target.value),className:"w-full h-11 rounded-lg border border-oai-gray-800 bg-oai-gray-900 px-3 text-sm text-white placeholder-oai-gray-600 focus:outline-none focus:ring-2 focus:ring-oai-brand-500"})]}),V.jsxs("div",{children:[V.jsx("label",{htmlFor:"login-password",className:"block text-xs font-medium text-oai-gray-500 mb-1",children:qt("login.field.password")}),V.jsx("input",{id:"login-password",type:"password",autoComplete:g==="signup"?"new-password":"current-password",required:!0,minLength:g==="signup"?Z:void 0,value:_,onChange:ye=>x(ye.target.value),className:"w-full h-11 rounded-lg border border-oai-gray-800 bg-oai-gray-900 px-3 text-sm text-white placeholder-oai-gray-600 focus:outline-none focus:ring-2 focus:ring-oai-brand-500"}),g==="signup"?V.jsx("p",{className:"mt-1 text-xs text-oai-gray-600",children:qt("login.password_hint",{min:String(Z)})}):null]}),V.jsx("button",{type:"submit",disabled:A||r,className:"w-full h-11 rounded-lg bg-white text-oai-gray-950 text-sm font-semibold hover:bg-oai-gray-100 transition-colors disabled:opacity-50",children:qt(g==="signup"?"login.submit.sign_up":"login.submit.sign_in")})]})]})})]}):V.jsxs("div",{className:"min-h-screen bg-oai-gray-950 text-oai-white font-oai antialiased dark flex flex-col",children:[V.jsx("header",{className:"border-b border-oai-gray-900 px-4 sm:px-6 py-4",children:V.jsx(po,{to:"/",className:"text-sm font-medium text-oai-gray-400 hover:text-white no-underline",children:qt("login.back_home")})}),V.jsx("main",{className:"flex-1 flex items-center justify-center px-4",children:V.jsx("p",{className:"text-oai-gray-400 text-center max-w-md",children:qt("login.cloud_only")})})]})}const oj=zl.lazy(()=>Wy(()=>import("./DashboardPage-CGaKcd55.js"),__vite__mapDeps([0,1])).then(t=>({default:t.DashboardPage}))),lj=zl.lazy(()=>Wy(()=>import("./LeaderboardPage-Dj9QZ8jC.js"),__vite__mapDeps([2,3,1])).then(t=>({default:t.LeaderboardPage}))),cj=zl.lazy(()=>Wy(()=>import("./LeaderboardProfilePage-Bz-aUVkS.js"),__vite__mapDeps([4,3,1])).then(t=>({default:t.LeaderboardProfilePage})));function uj(){const t=vr(),e=Wl();xz();const n=xr(),i=D.useMemo(()=>typeof window>"u"?!1:QA(window.location.search),[]),r=t?.pathname||"/",s=new URL(window.location.href),l=s.pathname.replace(/\/+$/,"")||"/",d=l.match(/^\/share\/([^/?#]+)$/i)?.[1]||null,f=s.searchParams.get("token")||null,h=d||f,m=l==="/share"||l==="/share.html"||l.startsWith("/share/"),g=typeof window<"u"&&(window.location.hostname==="localhost"||window.location.hostname==="127.0.0.1"),v=r.replace(/\/+$/,"")||"/",b=v.match(/^\/leaderboard\/u\/([^/]+)$/i),E=b?b[1]:null,_=v==="/leaderboard"||!!E,x=!!(e.enabled&&e.signedIn),T=g||x,C=!1,A=VV(),N=D.useMemo(()=>!e.enabled||!x?null:{getAccessToken:()=>e.getAccessToken()},[e,x]);let I=g||n||i?"dashboard":"landing";v==="/landing"&&(I="landing"),v==="/dashboard"&&(I="dashboard"),_&&(I="dashboard");const U=E?cj:v==="/leaderboard"?lj:oj,S=V.jsx("div",{className:"min-h-screen bg-[#050505]"});let k=null;return v==="/login"?k=V.jsx(sj,{}):I==="landing"?k=V.jsx(rj,{signInUrl:"/login",signUpUrl:"/login"}):k=V.jsx(D.Suspense,{fallback:S,children:V.jsx(U,{baseUrl:A,auth:N,signedIn:T,sessionSoftExpired:C,signOut:()=>e.enabled?e.signOut():Promise.resolve(),publicMode:m,publicToken:h,userId:E,signInUrl:"/login",signUpUrl:"/login"})}),V.jsx(A3,{children:V.jsx(k3,{children:V.jsxs(L3,{children:[k,V.jsx(OV,{})]})})})}const dj=OL([{path:"*",element:V.jsx(uj,{})}]);MP.createRoot(document.getElementById("root")).render(V.jsx(zl.StrictMode,{children:V.jsx(UI,{children:V.jsx(JL,{router:dj})})}));export{WI as $,qA as A,qt as B,V as C,Xy as D,KI as E,BM as F,my as G,d3 as H,xS as I,eh as J,vS as K,$y as L,b0 as M,Sj as N,bl as O,jy as P,ZL as Q,QE as R,PM as S,m3 as T,bS as U,jl as V,NM as W,yS as X,kM as Y,BI as Z,jI as _,hi as a,VI as a0,Xg as a1,DM as a2,_j as a3,GI as a4,xj as a5,LM as a6,bj as a7,Lz as a8,po as a9,Ej as aA,TM as aB,Em as aC,Oj as aD,Pi as aE,Mz as aF,Ez as aG,vz as aH,Bj as aI,RI as aJ,Vj as aK,C3 as aL,Tz as aa,P4 as ab,vo as ac,a3 as ad,zl as ae,Dj as af,Lj as ag,GM as ah,Wl as ai,yA as aj,QA as ak,ro as al,zj as am,Tj as an,Mj as ao,Nj as ap,$V as aq,Aj as ar,Cj as as,Hj as at,kj as au,Wy as av,Ij as aw,Sz as ax,vr as ay,wy as az,WM as b,Ps as c,BS as d,E0 as e,Mn as f,YA as g,xr as h,CU as i,yj as j,NI as k,Xj as l,Il as m,YV as n,KV as o,Wj as p,Pj as q,D as r,Fj as s,jj as t,Yy as u,$j as v,Rj as w,kn as x,Uj as y,Gj as z};
@@ -107,7 +107,7 @@
107
107
  ]
108
108
  }
109
109
  </script>
110
- <script type="module" crossorigin src="/assets/main-8JBJiGVQ.js"></script>
110
+ <script type="module" crossorigin src="/assets/main-b3V-nHUe.js"></script>
111
111
  <link rel="stylesheet" crossorigin href="/assets/main-Cwn9_aQV.css">
112
112
  </head>
113
113
  <body>
@@ -51,7 +51,7 @@
51
51
  "description": "Shareable Token Tracker dashboard snapshot."
52
52
  }
53
53
  </script>
54
- <script type="module" crossorigin src="/assets/main-8JBJiGVQ.js"></script>
54
+ <script type="module" crossorigin src="/assets/main-b3V-nHUe.js"></script>
55
55
  <link rel="stylesheet" crossorigin href="/assets/main-Cwn9_aQV.css">
56
56
  </head>
57
57
  <body>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "tokentracker-cli",
3
- "version": "0.5.2",
3
+ "version": "0.5.3",
4
4
  "description": "Token usage tracker for AI agent CLIs (Claude Code, Codex, Cursor, Kiro, Gemini, OpenCode, OpenClaw)",
5
5
  "main": "src/cli.js",
6
6
  "bin": {
@@ -48,7 +48,7 @@
48
48
  "type": "git",
49
49
  "url": "git+https://github.com/mm7894215/TokenTracker.git"
50
50
  },
51
- "homepage": "https://github.com/mm7894215/TokenTracker#readme",
51
+ "homepage": "https://token.rynn.me",
52
52
  "bugs": {
53
53
  "url": "https://github.com/mm7894215/TokenTracker/issues"
54
54
  },