tokentracker-cli 1.3.15 → 1.4.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dashboard/dist/assets/{AchievementBadge-CSXb26DC.js → AchievementBadge-DWECUOAX.js} +1 -1
- package/dashboard/dist/assets/{AchievementsPage-Bs6vIpd0.js → AchievementsPage-Bakfwwn_.js} +2 -2
- package/dashboard/dist/assets/{AchievementsSection-BO4u-574.js → AchievementsSection-DiEX2_5U.js} +1 -1
- package/dashboard/dist/assets/{BadgeDetailModal-ic60vrZX.js → BadgeDetailModal-ClVMnxVW.js} +1 -1
- package/dashboard/dist/assets/{BotAnimated-BHHAUEQL.js → BotAnimated-D7eyrAPs.js} +1 -1
- package/dashboard/dist/assets/{Card-8t2FYLJV.js → Card-CsAQxZZ8.js} +1 -1
- package/dashboard/dist/assets/{CloudCheckoutPage-CXaDDial.js → CloudCheckoutPage-BAN-DtXB.js} +1 -1
- package/dashboard/dist/assets/{CloudPage-DN6s_UrT.js → CloudPage-D9sNlUAy.js} +2 -2
- package/dashboard/dist/assets/{CommandPalette-D7dHMpHK.js → CommandPalette-D9TNT6un.js} +1 -1
- package/dashboard/dist/assets/{CommunityStatsModal-C55r20Vb.js → CommunityStatsModal-CotRRQNH.js} +1 -1
- package/dashboard/dist/assets/{ConfirmModal-jSEqSSnW.js → ConfirmModal-C_il5anp.js} +1 -1
- package/dashboard/dist/assets/{Controls-CqmoR37l.js → Controls-Bd1kODP4.js} +1 -1
- package/dashboard/dist/assets/DashboardPage-De0EL8Hn.js +1 -0
- package/dashboard/dist/assets/{DateRangePopover-z89rKqjK.js → DateRangePopover-quw6hpxy.js} +1 -1
- package/dashboard/dist/assets/DevicePage-CP20lVYv.js +1 -0
- package/dashboard/dist/assets/{DialogClose-imfpTM8a.js → DialogClose-BEUL9bD6.js} +1 -1
- package/dashboard/dist/assets/DialogDescription-DpkD2qwW.js +1 -0
- package/dashboard/dist/assets/DialogTitle-C--sXGjf.js +1 -0
- package/dashboard/dist/assets/{ElectricLogo-CrnDjhtG.js → ElectricLogo-DhP7S1Cu.js} +1 -1
- package/dashboard/dist/assets/{FadeIn-CAr2EMcK.js → FadeIn-BPH15_jE.js} +1 -1
- package/dashboard/dist/assets/{HeaderGithubStar-UK7qFFNh.js → HeaderGithubStar-DziE8s6w.js} +1 -1
- package/dashboard/dist/assets/{HoverTooltip-fs1HBOXB.js → HoverTooltip-tQyY2CuV.js} +1 -1
- package/dashboard/dist/assets/{IpCheckPage-Bk-MlPWf.js → IpCheckPage-BjoB05O7.js} +1 -1
- package/dashboard/dist/assets/{LandingPage-DJnPCdqP.js → LandingPage-Cav49COr.js} +2 -2
- package/dashboard/dist/assets/{LeaderboardPage-wVjwsqyc.js → LeaderboardPage-CHjFKLvs.js} +2 -2
- package/dashboard/dist/assets/{LeaderboardProBadge-BaQdHu06.js → LeaderboardProBadge-D97MfK5W.js} +1 -1
- package/dashboard/dist/assets/{LeaderboardProfileModal-D5ZZtIPl.js → LeaderboardProfileModal-NNTwtWSu.js} +3 -3
- package/dashboard/dist/assets/{LeaderboardProfilePage-BZsBL2jT.js → LeaderboardProfilePage-xI81GH3D.js} +1 -1
- package/dashboard/dist/assets/{LimitsPage-Cks_mKSL.js → LimitsPage-BPOo3FOW.js} +1 -1
- package/dashboard/dist/assets/{LocalOnlyNotice-DLnC_Tq4.js → LocalOnlyNotice-j8Tijts2.js} +1 -1
- package/dashboard/dist/assets/{LoginCard-FXZbjmOY.js → LoginCard-C7_n6J7k.js} +1 -1
- package/dashboard/dist/assets/{LoginModal-_R-0ZtpQ.js → LoginModal-DwlNscw5.js} +1 -1
- package/dashboard/dist/assets/{LoginPage-MzDRyv1Q.js → LoginPage-BqhWatt2.js} +1 -1
- package/dashboard/dist/assets/{PetPage-DJ58EiPT.js → PetPage-CJlC0V0i.js} +2 -2
- package/dashboard/dist/assets/PopoverPopup-wleZ4DTI.js +1 -0
- package/dashboard/dist/assets/{ProviderIcon-xSNRuia-.js → ProviderIcon-biLVsOGr.js} +1 -1
- package/dashboard/dist/assets/{ResetPasswordPage-BcVcWbsW.js → ResetPasswordPage-5Sl45OsN.js} +1 -1
- package/dashboard/dist/assets/Select-77l2QNqa.js +1 -0
- package/dashboard/dist/assets/SelectItemText-BQbmtjd3.js +1 -0
- package/dashboard/dist/assets/{SelfHostPage-BLocCkUo.js → SelfHostPage-C8hlgVu4.js} +1 -1
- package/dashboard/dist/assets/{ServiceStatusPage-CzMjS7EQ.js → ServiceStatusPage-DrY9Mef8.js} +1 -1
- package/dashboard/dist/assets/{SessionsPage-Dqzuthrd.js → SessionsPage-BDTsH3Mk.js} +2 -2
- package/dashboard/dist/assets/SettingsPage-C_id9Go3.js +5 -0
- package/dashboard/dist/assets/SkillsPage-kb6_5uUk.js +1 -0
- package/dashboard/dist/assets/{TokenGalaxy-B2sMNsM0.js → TokenGalaxy-BoS0yUFS.js} +1 -1
- package/dashboard/dist/assets/TooltipPopup-LV1aWIRZ.js +1 -0
- package/dashboard/dist/assets/{TrendMonitor-DpMcMWVh.js → TrendMonitor-DN-nwcSA.js} +1 -1
- package/dashboard/dist/assets/{WidgetsPage-aKfztwsk.js → WidgetsPage-C6lvwceS.js} +1 -1
- package/dashboard/dist/assets/{WrappedPage-NoY2hqbF.js → WrappedPage-CfC39wWP.js} +1 -1
- package/dashboard/dist/assets/{__vite-browser-external-kAUz3kFs.css → __vite-browser-external-B0m8a6Te.css} +1 -1
- package/dashboard/dist/assets/__vite-browser-external-DpZbUcLL.js +45 -0
- package/dashboard/dist/assets/{agent-logos-Oh8CLAYk.js → agent-logos-CvcdCGj5.js} +1 -1
- package/dashboard/dist/assets/{arrow-left-Mwggxctm.js → arrow-left-BX4LX5TF.js} +1 -1
- package/dashboard/dist/assets/{arrow-right-Crx-kuck.js → arrow-right-Aktjo2RL.js} +1 -1
- package/dashboard/dist/assets/{arrow-up-right-uwoo8I0B.js → arrow-up-right-kkQt6Du0.js} +1 -1
- package/dashboard/dist/assets/{calendar-days-C6MeKaqh.js → calendar-days-OvLTNZBH.js} +1 -1
- package/dashboard/dist/assets/{check-dsWQRYNj.js → check-v5Ie379p.js} +1 -1
- package/dashboard/dist/assets/{chevron-down-BIf5bhyB.js → chevron-down-CPlz1cYW.js} +1 -1
- package/dashboard/dist/assets/{cloud-checkout-GnFRQdnr.js → cloud-checkout-C_Rhiwno.js} +1 -1
- package/dashboard/dist/assets/composite-DD_boZdD.js +1 -0
- package/dashboard/dist/assets/{download-B7eyvOxn.js → download-NqHXZ-zn.js} +1 -1
- package/dashboard/dist/assets/{external-link-RNTsFDG4.js → external-link-B0D03J0f.js} +1 -1
- package/dashboard/dist/assets/{flame-uwCJ6brb.js → flame-av87we58.js} +1 -1
- package/dashboard/dist/assets/{format-tokens-Bf7JxB4E.js → format-tokens-B43Ehkbb.js} +1 -1
- package/dashboard/dist/assets/{gift-BY7kCGBK.js → gift-CZus7M21.js} +1 -1
- package/dashboard/dist/assets/{host-mode-Bs-UHw-7.js → host-mode-Dd9fzAdq.js} +1 -1
- package/dashboard/dist/assets/{icons-CrLu8vlW.js → icons-CnScwnf_.js} +1 -1
- package/dashboard/dist/assets/{index-CXQag63s.js → index-BZTIoCof.js} +1 -1
- package/dashboard/dist/assets/{index-DYIIk93n.js → index-Cj9NdXOj.js} +1 -1
- package/dashboard/dist/assets/{index-DieuzFHA.js → index-D3XPaYEL.js} +1 -1
- package/dashboard/dist/assets/{info-BteHQN_N.js → info-BUmCmjwd.js} +1 -1
- package/dashboard/dist/assets/{link-2-C1RSbOHv.js → link-2-t-wSLB2a.js} +1 -1
- package/dashboard/dist/assets/{loader-circle-BM3x6_YL.js → loader-circle-DM-FdXeX.js} +1 -1
- package/dashboard/dist/assets/{modifiers.esm-BHzOJfH3.js → modifiers.esm-D5AKZNa7.js} +1 -1
- package/dashboard/dist/assets/module-DOCYJaxl.js +3 -0
- package/dashboard/dist/assets/{monitor-smartphone-Ps3VptSt.js → monitor-smartphone-CDHFLZS-.js} +1 -1
- package/dashboard/dist/assets/{play-7MpFYU7a.js → play-BIQH--yZ.js} +1 -1
- package/dashboard/dist/assets/{plus-Dk-p9OaZ.js → plus-CztG5eum.js} +1 -1
- package/dashboard/dist/assets/{provider-display-Czwv4ClR.js → provider-display-B2gZ38Oh.js} +1 -1
- package/dashboard/dist/assets/{react-D9vco0ZF.js → react-D1u6HsZx.js} +1 -1
- package/dashboard/dist/assets/safePolygon-ClG4WM06.js +1 -0
- package/dashboard/dist/assets/{search-Z2Hfw99-.js → search-NNy_fIbJ.js} +1 -1
- package/dashboard/dist/assets/{server-Dh_OraRG.js → server-N94HJtJY.js} +1 -1
- package/dashboard/dist/assets/{shield-check-59NUSZvk.js → shield-check-BGfaKXG9.js} +1 -1
- package/dashboard/dist/assets/{skills-api-Bguk8iPD.js → skills-api-CWydQc4G.js} +1 -1
- package/dashboard/dist/assets/{sortable.esm-C9M-1k5o.js → sortable.esm-BF83ljWQ.js} +1 -1
- package/dashboard/dist/assets/store-l5WfCa7P.js +1 -0
- package/dashboard/dist/assets/{terminal-DKTXh9tj.js → terminal-CRBThKUQ.js} +1 -1
- package/dashboard/dist/assets/{trash-CQRRKbCs.js → trash-BXN5tg81.js} +1 -1
- package/dashboard/dist/assets/{use-community-stats-BoOd2Hhq.js → use-community-stats-dHketgyF.js} +1 -1
- package/dashboard/dist/assets/{use-latest-request-guard-vQtFEBIX.js → use-latest-request-guard-CdM1Pn_p.js} +1 -1
- package/dashboard/dist/assets/{use-limits-display-prefs-BRTj9_xd.js → use-limits-display-prefs-dOm4SCFU.js} +1 -1
- package/dashboard/dist/assets/{use-native-settings-CC6uEn3j.js → use-native-settings-GL9uAidm.js} +1 -1
- package/dashboard/dist/assets/{use-ordered-list-BUx6eIN7.js → use-ordered-list-Btz_NSiA.js} +1 -1
- package/dashboard/dist/assets/use-reduced-motion-D9n2I_eN.js +1 -0
- package/dashboard/dist/assets/{use-session-efficiency-pref-BsUypXPb.js → use-session-efficiency-pref-BPZel3HL.js} +1 -1
- package/dashboard/dist/assets/{use-transform-oomGXI86.js → use-transform-D2xePGbE.js} +1 -1
- package/dashboard/dist/assets/{use-usage-limits-CXeCKJZ_.js → use-usage-limits-vEmyPwMY.js} +1 -1
- package/dashboard/dist/assets/{useCurrency-DIZEXq5g.js → useCurrency-DnhS0llv.js} +1 -1
- package/dashboard/dist/assets/usePositioner-7yozJJJ0.js +1 -0
- package/dashboard/dist/assets/{useTokenFormat-DKURSOqb.js → useTokenFormat-DvjyXv8i.js} +1 -1
- package/dashboard/dist/assets/{zap-BQ8nGK7b.js → zap-CElRpX2w.js} +1 -1
- package/dashboard/dist/index.html +2 -2
- package/dashboard/dist/ip-check.html +2 -2
- package/dashboard/dist/leaderboard.html +2 -2
- package/dashboard/dist/share.html +2 -2
- package/package.json +2 -2
- package/src/commands/status.js +1 -1
- package/src/commands/sync.js +34 -4
- package/src/lib/cloud-usage-reset.js +115 -0
- package/src/lib/diagnostics.js +1 -1
- package/src/lib/kimi-model-repair.js +173 -0
- package/src/lib/kimi-session.js +216 -0
- package/src/lib/local-api.js +46 -1
- package/src/lib/pricing/seed-snapshot.json +1 -1
- package/src/lib/qoder-cn-cli-limits.js +9 -7
- package/src/lib/qoder-limits.js +45 -15
- package/src/lib/rollout.js +6 -4
- package/src/lib/session-analytics.js +47 -9
- package/dashboard/dist/assets/DashboardPage-BLr2XmyZ.js +0 -1
- package/dashboard/dist/assets/DevicePage-Ddm5uKOw.js +0 -1
- package/dashboard/dist/assets/DialogDescription-BE5CNMW0.js +0 -1
- package/dashboard/dist/assets/DialogTitle-Ca1-hka8.js +0 -1
- package/dashboard/dist/assets/PopoverPopup-uQa7G-IO.js +0 -1
- package/dashboard/dist/assets/Select-Dwix4ZFd.js +0 -1
- package/dashboard/dist/assets/SelectItemText-Bz5cn5Gk.js +0 -1
- package/dashboard/dist/assets/SettingsPage-DEdNhzKR.js +0 -5
- package/dashboard/dist/assets/SkillsPage-CqocOQID.js +0 -1
- package/dashboard/dist/assets/TooltipPopup-LzbtjRSA.js +0 -1
- package/dashboard/dist/assets/__vite-browser-external-BnGukaND.js +0 -45
- package/dashboard/dist/assets/composite-lINFdwLI.js +0 -1
- package/dashboard/dist/assets/module-BNnaKM__.js +0 -3
- package/dashboard/dist/assets/safePolygon-Ca2iBTNb.js +0 -1
- package/dashboard/dist/assets/store-nR9Ah4fr.js +0 -1
- package/dashboard/dist/assets/use-reduced-motion-BZBrXeyc.js +0 -1
- package/dashboard/dist/assets/usePositioner-Drh2sy7w.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{o as M,d as E,r,P as I,c as i,j as o,y as L}from"./__vite-browser-external-
|
|
1
|
+
import{o as M,d as E,r,P as I,c as i,j as o,y as L}from"./__vite-browser-external-DpZbUcLL.js";import{m as j}from"./react-D1u6HsZx.js";import{P as A}from"./ProviderIcon-biLVsOGr.js";import{g as $}from"./skills-api-CWydQc4G.js";import{A as R}from"./index-D3XPaYEL.js";import{S as K}from"./search-NNy_fIbJ.js";import{u as q}from"./use-reduced-motion-D9n2I_eN.js";const N={name:"corner-down-left",size:24,node:[["path",{d:"M20 4v7a4 4 0 0 1-4 4H4",key:"6o5b7l"}],["path",{d:"m9 10-5 5 5 5",key:"1kshq7"}]]};N.node;const O=M(N),P=typeof window<"u"&&(window.location.hostname==="localhost"||window.location.hostname==="127.0.0.1");function Q(){const f=E(),d=q(),[u,g]=r.useState(!1),[x,h]=r.useState(""),[n,l]=r.useState(0),[m,k]=r.useState([]),b=r.useRef(null),w=r.useRef(null);r.useEffect(()=>{const e=t=>{(t.metaKey||t.ctrlKey)&&(t.key==="k"||t.key==="K")&&(t.preventDefault(),g(c=>!c))};return window.addEventListener("keydown",e),()=>window.removeEventListener("keydown",e)},[]),r.useEffect(()=>{if(!u)return;h(""),l(0);const e=requestAnimationFrame(()=>b.current?.focus());return P&&!m.length&&$().then(t=>k(t?.skills||[])).catch(()=>k([])),()=>cancelAnimationFrame(e)},[u,m.length]);const y=r.useMemo(()=>{const e=I().flatMap(a=>a.items.map(c=>({kind:"page",id:`page:${c.id}`,label:c.label,sub:i("cmdk.group.pages"),Icon:c.icon,run:()=>f(c.to)}))),t=(m||[]).map(a=>({kind:"skill",id:`skill:${a.id||a.directory}`,label:a.name||a.directory,sub:a.repoOwner&&a.repoName?`${a.repoOwner}/${a.repoName}`:i("cmdk.group.skills"),provider:(a.targets||[])[0]||"claude",run:()=>f(`/skills?skill=${encodeURIComponent(a.directory||a.id)}`)}));return[...e,...t]},[f,m]),s=r.useMemo(()=>{const e=x.trim().toLowerCase();return e?y.filter(t=>t.label.toLowerCase().includes(e)||String(t.sub||"").toLowerCase().includes(e)):y},[y,x]);r.useEffect(()=>{n>=s.length&&l(s.length?s.length-1:0)},[n,s.length]),r.useEffect(()=>{if(!u)return;w.current?.querySelector(`[data-cmdk-index="${n}"]`)?.scrollIntoView({block:"nearest"})},[n,u]);const p=r.useCallback(()=>g(!1),[]),v=r.useCallback(e=>{e&&(p(),e.run())},[p]),C=e=>{e.key==="ArrowDown"?(e.preventDefault(),l(t=>Math.min(t+1,Math.max(0,s.length-1)))):e.key==="ArrowUp"?(e.preventDefault(),l(t=>Math.max(t-1,0))):e.key==="Enter"?(e.preventDefault(),v(s[n])):e.key==="Escape"&&(e.preventDefault(),p())},S={duration:d?0:.12},D=d?{duration:0}:{type:"spring",stiffness:460,damping:34,mass:.6};return o.jsx(R,{children:u?o.jsxs(j.div,{className:"fixed inset-0 z-[120] flex items-start justify-center px-4 pt-[16vh]",initial:d?!1:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:S,children:[o.jsx("button",{type:"button","aria-label":i("cmdk.close"),onClick:p,className:"absolute inset-0 cursor-default bg-oai-black/40"}),o.jsxs(j.div,{role:"dialog","aria-modal":"true","aria-label":i("cmdk.open_aria"),initial:d?!1:{opacity:0,y:-8,scale:.985},animate:{opacity:1,y:0,scale:1},exit:d?{opacity:0}:{opacity:0,y:-8,scale:.985},transition:D,className:"relative w-full max-w-xl overflow-hidden rounded-2xl border border-oai-gray-200 bg-oai-white shadow-2xl dark:border-oai-gray-800 dark:bg-oai-gray-950",children:[o.jsxs("div",{className:"flex items-center gap-2.5 border-b border-oai-gray-200 px-4 dark:border-oai-gray-800",children:[o.jsx(K,{className:"h-4 w-4 shrink-0 text-oai-gray-400","aria-hidden":!0}),o.jsx("input",{ref:b,type:"text",value:x,onChange:e=>{h(e.target.value),l(0)},onKeyDown:C,"aria-label":i("cmdk.placeholder"),"aria-controls":"cmdk-listbox","aria-activedescendant":s[n]?`cmdk-opt-${n}`:void 0,role:"combobox","aria-expanded":"true",placeholder:i("cmdk.placeholder"),className:"h-12 w-full bg-transparent text-sm text-oai-black placeholder:text-oai-gray-400 focus:outline-none dark:text-white"})]}),o.jsx("div",{ref:w,id:"cmdk-listbox",role:"listbox",className:"max-h-[min(56vh,22rem)] overflow-y-auto p-1.5",children:s.length===0?o.jsx("div",{className:"px-3 py-8 text-center text-sm text-oai-gray-500 dark:text-oai-gray-400",children:i("cmdk.empty")}):s.map((e,t)=>{const a=t===n;return o.jsxs("button",{type:"button",role:"option",id:`cmdk-opt-${t}`,"data-cmdk-index":t,"aria-selected":a,onMouseMove:()=>l(t),onClick:()=>v(e),className:L("flex w-full items-center gap-3 rounded-lg px-3 py-2 text-left text-sm transition-colors",a?"bg-oai-gray-100 text-oai-black dark:bg-oai-gray-800/70 dark:text-white":"text-oai-gray-700 dark:text-oai-gray-200"),children:[o.jsx("span",{className:"flex h-5 w-5 shrink-0 items-center justify-center text-oai-gray-500 dark:text-oai-gray-400",children:e.kind==="skill"?o.jsx(A,{provider:e.provider,size:16}):o.jsx(e.Icon,{className:"h-4 w-4","aria-hidden":!0})}),o.jsx("span",{className:"min-w-0 flex-1 truncate font-medium",children:e.label}),o.jsx("span",{className:"shrink-0 truncate text-xs text-oai-gray-400 dark:text-oai-gray-500",children:e.sub}),a?o.jsx(O,{className:"h-3.5 w-3.5 shrink-0 text-oai-gray-400","aria-hidden":!0}):null]},e.id)})})]})]}):null})}export{Q as CommandPalette};
|
package/dashboard/dist/assets/{CommunityStatsModal-C55r20Vb.js → CommunityStatsModal-CotRRQNH.js}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{o as R,j as e,an as P,l as z,r as D,c as n,X as S,i as K}from"./__vite-browser-external-BnGukaND.js";import{m as M}from"./react-D9vco0ZF.js";import{A as U,W as B}from"./icons-CrLu8vlW.js";import{u as F}from"./useTokenFormat-DKURSOqb.js";import{P as G}from"./ProviderIcon-xSNRuia-.js";import{T as W}from"./TrendMonitor-DpMcMWVh.js";import{T as V}from"./AchievementBadge-CSXb26DC.js";import{T as X}from"./terminal-DKTXh9tj.js";import{D as Y,a as Z,b as H,c as q,d as J,e as Q}from"./DialogTitle-Ca1-hka8.js";import{D as ee}from"./DialogDescription-BE5CNMW0.js";import{D as ae}from"./DialogClose-imfpTM8a.js";import"./useCurrency-DIZEXq5g.js";import"./DateRangePopover-z89rKqjK.js";import"./use-latest-request-guard-vQtFEBIX.js";import"./PopoverPopup-uQa7G-IO.js";import"./store-nR9Ah4fr.js";import"./composite-lINFdwLI.js";import"./SelectItemText-Bz5cn5Gk.js";import"./usePositioner-Drh2sy7w.js";import"./safePolygon-Ca2iBTNb.js";import"./use-reduced-motion-BZBrXeyc.js";import"./zap-BQ8nGK7b.js";import"./flame-uwCJ6brb.js";import"./calendar-days-C6MeKaqh.js";import"./shield-check-59NUSZvk.js";const C={name:"trending-down",size:24,node:[["path",{d:"M16 17h6v-6",key:"t6n2it"}],["path",{d:"m22 17-8.5-8.5-5 5L2 7",key:"x473p"}]]};C.node;const te=R(C),O=10,_={input:"var(--community-token-input)",cache_read:"var(--community-token-cache-read)",cache_write:"var(--community-token-cache-write)",output:"var(--community-token-output)",reasoning:"var(--community-token-reasoning)"},re={CLAUDE:"var(--community-claude)",CODEX:"var(--community-codex)",GEMINI:"var(--community-gemini)",CURSOR:"var(--community-cursor)",OPENCODE:"var(--community-opencode)",HERMES:"var(--community-hermes)",KIMI:"var(--community-kimi)",MIMO:"var(--community-mimo)",COPILOT:"var(--community-copilot)",KIRO:"var(--community-kiro)",GROK:"var(--community-grok)",DEEPSEEK:"var(--community-deepseek)",ZCODE:"var(--community-zcode)",WORKBUDDY:"var(--community-workbuddy)",MINIMAX:"var(--community-minimax)",DROID:"var(--community-droid)",DUMATE:"var(--community-dumate)"};function ie(t){return re[String(t||"").toUpperCase()]||"var(--community-muted)"}const se=[[/claude|fable|opus|sonnet|haiku/,"CLAUDE"],[/gpt|codex|o3|o4/,"CODEX"],[/gemini/,"GEMINI"],[/composer|cursor/,"CURSOR"],[/kimi/,"KIMI"],[/mimo/,"MIMO"],[/copilot/,"COPILOT"],[/kiro/,"KIRO"],[/grok/,"GROK"],[/deepseek/,"DEEPSEEK"],[/glm/,"ZCODE"],[/hy3/,"WORKBUDDY"],[/minimax/,"MINIMAX"]],g=["overview","providers","community","models"];function oe(t){const s=String(t||"").toLowerCase(),a=se.find(([i])=>i.test(s));return a?a[1]:""}function x(t){const s=Number(t);return Number.isFinite(s)?`${s.toFixed(1)}%`:"—"}function p(t){return K(Number(t)||0)}function ne(t){return t?new Date(`${t}T00:00:00Z`).toLocaleDateString(void 0,{month:"short",day:"numeric",timeZone:"UTC"}):""}function k(){return e.jsx("div",{className:"flex h-full min-h-40 items-center justify-center text-xs text-oai-gray-400",children:n("leaderboard.community.modal.no_data")})}function b({children:t,detail:s}){return e.jsxs("div",{className:"mb-3 flex items-baseline justify-between gap-4",children:[e.jsx("h3",{className:"text-xs font-medium uppercase tracking-wide text-oai-gray-500 dark:text-oai-gray-400",children:t}),s?e.jsx("span",{className:"text-xs text-oai-gray-400",children:s}):null]})}function A({value:t,label:s}){const a=Number(t);if(!Number.isFinite(a))return null;const i=Math.sign(a)!==-1,r=i?V:te;return e.jsxs("span",{className:`inline-flex items-center gap-1 text-xs font-medium tabular-nums ${i?"text-emerald-600 dark:text-emerald-400":"text-rose-600 dark:text-rose-400"}`,title:s,children:[e.jsx(r,{className:"size-3","aria-hidden":"true"}),i?"+":"",a.toFixed(1),"%"]})}function j({label:t,value:s,title:a,delta:i,deltaLabel:r}){return e.jsxs("div",{className:"min-w-0",children:[e.jsx("div",{className:"truncate text-xs font-medium text-oai-gray-500 dark:text-oai-gray-400",children:t}),e.jsxs("div",{className:"mt-1 flex min-w-0 items-baseline gap-2",children:[e.jsx("span",{className:"truncate text-xl font-semibold leading-none tracking-tight text-oai-black tabular-nums dark:text-white",title:a,children:s}),e.jsx(A,{value:i,label:r})]})]})}function I({fillWidth:t,share:s,color:a="var(--oai-blue)",ariaLabel:i,dataAttrs:r,children:o}){return e.jsxs("div",{...r,className:"group relative grid min-h-11 grid-cols-[minmax(0,1fr)_auto] items-center gap-3 overflow-hidden px-2.5 transition-colors hover:bg-oai-gray-50 dark:hover:bg-oai-gray-900/60",children:[e.jsx("div",{className:"pointer-events-none absolute inset-y-0 left-0 opacity-[0.15] transition-opacity group-hover:opacity-[0.22] dark:opacity-[0.24] dark:group-hover:opacity-[0.32]",style:{width:`${t}%`,backgroundColor:a},role:"progressbar","aria-label":i,"aria-valuemin":"0","aria-valuemax":"100","aria-valuenow":Number(s)||0}),o]})}function T({rank:t,provider:s,name:a,fillWidth:i,share:r,tokens:o,tokensTitle:l,dataAttrs:c}){return e.jsxs(I,{fillWidth:i,share:r,color:ie(s),ariaLabel:`${a} ${x(r)}`,dataAttrs:c,children:[e.jsxs("div",{className:"relative flex min-w-0 items-center gap-2.5",children:[e.jsx("span",{className:`w-5 shrink-0 text-xs tabular-nums ${t<=3?"font-semibold text-oai-gray-700 dark:text-oai-gray-200":"text-oai-gray-400"}`,children:t}),e.jsx("span",{className:"grid size-6 shrink-0 place-items-center text-oai-gray-700 dark:text-oai-gray-200",children:e.jsx(G,{provider:s,size:15})}),e.jsx("span",{className:"truncate text-xs font-medium text-oai-gray-700 dark:text-oai-gray-200",title:a,children:a})]}),e.jsxs("div",{className:"relative min-w-[4.5rem] text-right",children:[e.jsx("div",{className:"text-xs font-semibold text-oai-black tabular-nums dark:text-white",title:l,children:o}),e.jsx("div",{className:"text-xs text-oai-gray-500 tabular-nums dark:text-oai-gray-400",children:x(r)})]})]})}function le({rows:t,formatTokensTooltip:s}){return t.length?e.jsxs("div",{className:"mt-7",children:[e.jsx(b,{children:n("leaderboard.community.modal.token_mix")}),e.jsx("div",{className:"flex h-1.5 overflow-hidden bg-oai-gray-100 dark:bg-oai-gray-800",children:t.map(a=>e.jsx("div",{style:{width:`${Math.max(Number(a.share)||0,0)}%`,backgroundColor:_[a.key]||"var(--community-muted)"},title:`${n(`leaderboard.community.modal.token_mix.${a.key}`)} · ${x(a.share)}`},a.key))}),e.jsx("div",{className:"mt-3 flex flex-wrap gap-x-5 gap-y-1.5",children:t.map(a=>e.jsxs("span",{className:"inline-flex items-center gap-1.5 text-xs text-oai-gray-500 dark:text-oai-gray-400",title:s(a.tokens),children:[e.jsx("span",{className:"size-2",style:{backgroundColor:_[a.key]||"var(--community-muted)"}}),n(`leaderboard.community.modal.token_mix.${a.key}`),e.jsx("span",{className:"tabular-nums text-oai-gray-700 dark:text-oai-gray-200",children:x(a.share)})]},a.key))})]}):null}function f({label:t,value:s,title:a,delta:i,deltaLabel:r,className:o=""}){return e.jsxs("div",{className:`min-w-0 ${o}`,children:[e.jsx("div",{className:"truncate text-xs text-oai-gray-500 dark:text-oai-gray-400",children:t}),e.jsxs("div",{className:"mt-1 flex min-w-0 items-baseline gap-2",children:[e.jsx("span",{className:"truncate text-base font-semibold leading-none tracking-tight tabular-nums text-oai-black dark:text-white",title:a,children:s}),e.jsx(A,{value:i,label:r})]})]})}function de({trendRows:t,activeDevelopers30d:s,developerGrowthPct:a,formatTokens:i,formatTokensTooltip:r}){if(!t.length)return null;const o=t.reduce((m,h)=>m+h.value,0),l=t.reduce((m,h)=>m.value<h.value?h:m,t[0]),c=o/t.length;return e.jsxs("div",{className:"mt-5 grid grid-cols-3 divide-x divide-oai-gray-100 border-y border-oai-gray-100 py-3.5 dark:divide-oai-gray-800/80 dark:border-oai-gray-800/80",children:[e.jsx(f,{className:"pr-4",label:n("leaderboard.community.modal.daily_average"),value:i(c),title:r(c)}),e.jsx(f,{className:"px-4",label:`${n("leaderboard.community.modal.peak_day")} · ${l.day}`,value:i(l.value),title:r(l.value)}),e.jsx(f,{className:"pl-4",label:n("leaderboard.community.modal.active_30d"),value:p(s),title:Number(s).toLocaleString(),delta:a,deltaLabel:n("leaderboard.community.modal.vs_previous_week")})]})}function me({trendRows:t,mix:s,activeDevelopers30d:a,developerGrowthPct:i,formatTokens:r,formatTokensTooltip:o}){return!t.length&&!s.length?e.jsx(k,{}):e.jsxs("div",{children:[e.jsx(b,{detail:n("leaderboard.community.modal.utc_note"),children:n("leaderboard.community.modal.community_activity")}),e.jsx(W,{embedded:!0,rows:t,from:t[0]?.day,to:t.at(-1)?.day,chartHeightClass:"h-44"}),e.jsx(de,{trendRows:t,activeDevelopers30d:a,developerGrowthPct:i,formatTokens:r,formatTokensTooltip:o}),e.jsx(le,{rows:s,formatTokensTooltip:o})]})}function ce({rows:t,maxShare:s,formatTokens:a,formatTokensTooltip:i}){return t.length?e.jsx("div",{className:"space-y-0.5",children:t.map((r,o)=>e.jsx(T,{rank:o+1,dataAttrs:{"data-provider-rank":o+1,"data-provider-name":r.name},provider:String(r.name).toUpperCase(),name:r.name,fillWidth:Math.max((Number(r.share)||0)/s*100,2),share:r.share,tokens:a(r.tokens),tokensTitle:i(r.tokens)},r.name))}):e.jsx(k,{})}function ue({rows:t,maxShare:s,formatTokens:a,formatTokensTooltip:i}){return t.length?e.jsx("div",{className:"space-y-0.5",children:t.map((r,o)=>{const l=Number(r.share)||0;return e.jsx(T,{rank:o+1,dataAttrs:{"data-model-rank":o+1,"data-model-name":r.name},provider:oe(r.name),name:r.name,fillWidth:Math.max(l/s*100,2),share:l,tokens:a(r.tokens),tokensTitle:i(r.tokens)},r.name)})}):e.jsx(k,{})}function xe({name:t}){const s=String(t||"").toLowerCase();return s==="darwin"?e.jsx(U,{className:"size-3.5"}):s==="win32"?e.jsx(B,{className:"size-3.5"}):e.jsx(X,{className:"size-4","aria-hidden":"true"})}const he=.175,ye=.3;function ge({bands:t,formatTokensTooltip:s}){const a=t.reduce((r,o)=>Math.max(r,Number(o.developer_share)||0),0)||1,i=r=>`${n(`leaderboard.community.modal.band.${r.key}`)} · ${n("leaderboard.community.modal.developer_count",{count:p(r.developers)})} (${s(r.tokens)})`;return e.jsxs("div",{children:[e.jsx("div",{className:"flex gap-2 border-b border-oai-gray-200 dark:border-oai-gray-800",children:t.map((r,o)=>{const l=Number(r.developer_share)||0,c=Math.max(l/a*80,2);return e.jsxs("div",{className:"relative h-32 min-w-0 flex-1",title:i(r),children:[e.jsx("div",{role:"progressbar","aria-label":n("leaderboard.community.modal.developer_share_title",{share:x(l)}),"aria-valuemin":"0","aria-valuemax":"100","aria-valuenow":l,className:"absolute inset-x-0 bottom-0",style:{height:`${c}%`,backgroundColor:"var(--oai-blue)",opacity:ye+o*he}}),e.jsx("div",{className:"absolute inset-x-0 text-center text-xs font-medium tabular-nums text-oai-gray-700 dark:text-oai-gray-200",style:{bottom:`calc(${c}% + 4px)`},children:x(l)})]},r.key)})}),e.jsx("div",{className:"mt-2 flex gap-2",children:t.map(r=>e.jsxs("div",{className:"min-w-0 flex-1 text-center",title:i(r),children:[e.jsx("div",{className:"truncate text-xs font-medium text-oai-gray-700 dark:text-oai-gray-200",children:n(`leaderboard.community.modal.band.${r.key}`)}),e.jsx("div",{className:"truncate text-xs tabular-nums text-oai-gray-500 dark:text-oai-gray-400",children:p(r.developers)})]},r.key))})]})}function pe({bands:t,platforms:s,formatTokensTooltip:a}){return!t.length&&!s.length?e.jsx(k,{}):e.jsxs("div",{className:"space-y-8",children:[t.length?e.jsxs("div",{children:[e.jsx(b,{children:n("leaderboard.community.modal.usage_distribution")}),e.jsx(ge,{bands:t,formatTokensTooltip:a})]}):null,s.length?e.jsxs("div",{children:[e.jsx(b,{children:n("leaderboard.community.modal.platforms")}),e.jsx("div",{className:"space-y-0.5",children:s.map(i=>e.jsxs(I,{fillWidth:Math.max(Number(i.share)||0,1),share:i.share,ariaLabel:`${n(`leaderboard.community.modal.platform.${i.name}`)} ${x(i.share)}`,children:[e.jsxs("div",{className:"relative flex min-w-0 items-center gap-2.5",children:[e.jsx("span",{className:"grid size-6 shrink-0 place-items-center text-oai-gray-700 dark:text-oai-gray-200",children:e.jsx(xe,{name:i.name})}),e.jsx("span",{className:"truncate text-xs font-medium text-oai-gray-700 dark:text-oai-gray-200",children:n(`leaderboard.community.modal.platform.${i.name}`)})]}),e.jsxs("div",{className:"relative min-w-[4.5rem] text-right",children:[e.jsx("div",{className:"text-xs font-semibold text-oai-black tabular-nums dark:text-white",children:x(i.share)}),e.jsx("div",{className:"text-xs text-oai-gray-500 tabular-nums dark:text-oai-gray-400",title:Number(i.machines||0).toLocaleString(),children:n("leaderboard.community.modal.machine_count",{count:p(i.machines)})})]})]},i.name))})]}):null]})}function ve({isOpen:t,onClose:s,communityStats:a}){const{formatTokens:i,formatTokensTooltip:r}=F(),[o,l]=D.useState("overview"),c=a?.status==="ready",m=D.useMemo(()=>{if(!c)return null;const d=(Array.isArray(a.providers)?a.providers:[]).slice(0,O),u=(Array.isArray(a.topModels)?a.topModels:[]).slice(0,O),y=v=>v.reduce(($,L)=>Math.max($,Number(L.share)||0),0)||1;return{providers:d,models:u,providersMaxShare:y(d),modelsMaxShare:y(u),trendRows:(Array.isArray(a.dailyGrowth)?a.dailyGrowth:[]).map(v=>({day:ne(v.day),value:Number(v.tokens)||0})),mix:Array.isArray(a.tokenMix)?a.tokenMix:[],bands:Array.isArray(a.userDistribution)?a.userDistribution:[],platforms:Array.isArray(a.platforms)?a.platforms:[]}},[c,a]);if(!m)return null;const h=Number(a.tokenFloor)||0,N=Number(a.activeDevelopersTotal)||Number(a.totalEntries)||0,w=Number(a.tokens30d)||0,E=d=>{if(d.key!=="ArrowRight"&&d.key!=="ArrowLeft")return;d.preventDefault();const u=d.key==="ArrowRight"?1:-1,y=g[(g.indexOf(o)+u+g.length)%g.length];l(y),d.currentTarget.querySelector(`[data-tab-id="${y}"]`)?.focus()};return e.jsx(Y,{open:t,onOpenChange:d=>!d&&s(),children:e.jsxs(Z,{children:[e.jsx(H,{className:"fixed inset-0 z-[100] bg-black/50 backdrop-blur-[3px] transition-opacity duration-200 ease-out data-[ending-style]:opacity-0 data-[starting-style]:opacity-0"}),e.jsx(q,{className:"fixed inset-0 z-[101] flex items-center justify-center p-2 sm:p-5",children:e.jsxs(J,{className:"relative flex h-[min(42rem,92vh)] w-full max-w-xl flex-col overflow-hidden rounded-2xl bg-white shadow-2xl ring-1 ring-black/10 transition-[opacity,transform] duration-[220ms] ease-[cubic-bezier(0.16,1,0.3,1)] data-[ending-style]:translate-y-3 data-[ending-style]:scale-[0.98] data-[ending-style]:opacity-0 data-[starting-style]:translate-y-3 data-[starting-style]:scale-[0.98] data-[starting-style]:opacity-0 dark:bg-oai-gray-950 dark:ring-white/10",children:[e.jsxs("header",{"data-testid":"community-metrics-header",className:"shrink-0 px-5 pt-5 sm:px-6",children:[e.jsxs("div",{className:"flex items-start justify-between gap-4",children:[e.jsxs("div",{children:[e.jsx(Q,{className:"text-lg font-semibold tracking-[-0.02em] text-oai-black dark:text-white",children:n("leaderboard.community.modal.title")}),e.jsx(ee,{className:"sr-only",children:n("leaderboard.community.modal.description")})]}),e.jsx(ae,{className:"-mr-1 -mt-1 grid size-8 place-items-center rounded-full text-oai-gray-400 transition-colors hover:bg-black/5 hover:text-oai-black dark:hover:bg-white/10 dark:hover:text-white","aria-label":n("shared.dialog.close"),children:e.jsx(S,{className:"size-4"})})]}),e.jsxs("div",{className:"mt-4 grid grid-cols-3 gap-x-5",children:[e.jsx(j,{label:n("leaderboard.community.modal.total_tokens"),value:i(h),title:r(h)}),e.jsx(j,{label:n("leaderboard.community.modal.tokens_30d"),value:i(w),title:r(w),delta:a.tokenGrowthPct,deltaLabel:n("leaderboard.community.modal.vs_previous_week")}),e.jsx(j,{label:n("leaderboard.community.modal.contributors"),value:p(N),title:N.toLocaleString()})]}),e.jsx("div",{className:"mt-4 flex items-end overflow-x-auto border-b border-oai-gray-100 dark:border-oai-gray-900",role:"tablist","aria-label":n("leaderboard.community.modal.views"),onKeyDown:E,children:g.map(d=>{const u=o===d;return e.jsxs("button",{type:"button",role:"tab","data-tab-id":d,"aria-selected":u,tabIndex:u?0:-1,onClick:()=>l(d),className:`relative mr-5 h-10 shrink-0 text-sm font-medium transition-colors last:mr-0 ${u?"text-oai-black dark:text-white":"text-oai-gray-500 hover:text-oai-gray-700 dark:text-oai-gray-400 dark:hover:text-oai-gray-200"}`,children:[n(`leaderboard.community.modal.tab.${d}`),u?e.jsx(M.span,{layoutId:"community-metrics-tab-underline",className:"absolute inset-x-0 -bottom-px h-0.5 rounded-full bg-oai-black dark:bg-white",transition:{type:"spring",stiffness:420,damping:34}}):null]},d)})})]}),e.jsx("div",{"data-testid":"community-metrics-content",className:"min-h-0 flex-1 overflow-y-auto px-5 py-5 sm:px-6",children:e.jsxs(M.div,{initial:{opacity:0,y:4},animate:{opacity:1,y:0},transition:{duration:.18,ease:[.16,1,.3,1]},className:"h-full",children:[o==="overview"?e.jsx(me,{trendRows:m.trendRows,mix:m.mix,activeDevelopers30d:Number(a.activeDevelopers30d)||0,developerGrowthPct:a.developerGrowthPct,formatTokens:i,formatTokensTooltip:r}):null,o==="providers"?e.jsx(ce,{rows:m.providers,maxShare:m.providersMaxShare,formatTokens:i,formatTokensTooltip:r}):null,o==="community"?e.jsx(pe,{bands:m.bands,platforms:m.platforms,formatTokensTooltip:r}):null,o==="models"?e.jsx(ue,{rows:m.models,maxShare:m.modelsMaxShare,formatTokens:i,formatTokensTooltip:r}):null]},o)})]})})]})})}function Ge(t){return e.jsx(P,{mode:z.COMPACT,children:e.jsx(ve,{...t})})}export{Ge as CommunityStatsModal};
|
|
1
|
+
import{o as R,j as e,an as P,l as z,r as D,c as n,X as S,i as K}from"./__vite-browser-external-DpZbUcLL.js";import{m as M}from"./react-D1u6HsZx.js";import{A as U,W as B}from"./icons-CnScwnf_.js";import{u as F}from"./useTokenFormat-DvjyXv8i.js";import{P as G}from"./ProviderIcon-biLVsOGr.js";import{T as W}from"./TrendMonitor-DN-nwcSA.js";import{T as V}from"./AchievementBadge-DWECUOAX.js";import{T as X}from"./terminal-CRBThKUQ.js";import{D as Y,a as Z,b as H,c as q,d as J,e as Q}from"./DialogTitle-C--sXGjf.js";import{D as ee}from"./DialogDescription-DpkD2qwW.js";import{D as ae}from"./DialogClose-BEUL9bD6.js";import"./useCurrency-DnhS0llv.js";import"./DateRangePopover-quw6hpxy.js";import"./use-latest-request-guard-CdM1Pn_p.js";import"./PopoverPopup-wleZ4DTI.js";import"./store-l5WfCa7P.js";import"./composite-DD_boZdD.js";import"./SelectItemText-BQbmtjd3.js";import"./usePositioner-7yozJJJ0.js";import"./safePolygon-ClG4WM06.js";import"./use-reduced-motion-D9n2I_eN.js";import"./zap-CElRpX2w.js";import"./flame-av87we58.js";import"./calendar-days-OvLTNZBH.js";import"./shield-check-BGfaKXG9.js";const C={name:"trending-down",size:24,node:[["path",{d:"M16 17h6v-6",key:"t6n2it"}],["path",{d:"m22 17-8.5-8.5-5 5L2 7",key:"x473p"}]]};C.node;const te=R(C),O=10,_={input:"var(--community-token-input)",cache_read:"var(--community-token-cache-read)",cache_write:"var(--community-token-cache-write)",output:"var(--community-token-output)",reasoning:"var(--community-token-reasoning)"},re={CLAUDE:"var(--community-claude)",CODEX:"var(--community-codex)",GEMINI:"var(--community-gemini)",CURSOR:"var(--community-cursor)",OPENCODE:"var(--community-opencode)",HERMES:"var(--community-hermes)",KIMI:"var(--community-kimi)",MIMO:"var(--community-mimo)",COPILOT:"var(--community-copilot)",KIRO:"var(--community-kiro)",GROK:"var(--community-grok)",DEEPSEEK:"var(--community-deepseek)",ZCODE:"var(--community-zcode)",WORKBUDDY:"var(--community-workbuddy)",MINIMAX:"var(--community-minimax)",DROID:"var(--community-droid)",DUMATE:"var(--community-dumate)"};function ie(t){return re[String(t||"").toUpperCase()]||"var(--community-muted)"}const se=[[/claude|fable|opus|sonnet|haiku/,"CLAUDE"],[/gpt|codex|o3|o4/,"CODEX"],[/gemini/,"GEMINI"],[/composer|cursor/,"CURSOR"],[/kimi/,"KIMI"],[/mimo/,"MIMO"],[/copilot/,"COPILOT"],[/kiro/,"KIRO"],[/grok/,"GROK"],[/deepseek/,"DEEPSEEK"],[/glm/,"ZCODE"],[/hy3/,"WORKBUDDY"],[/minimax/,"MINIMAX"]],g=["overview","providers","community","models"];function oe(t){const s=String(t||"").toLowerCase(),a=se.find(([i])=>i.test(s));return a?a[1]:""}function x(t){const s=Number(t);return Number.isFinite(s)?`${s.toFixed(1)}%`:"—"}function p(t){return K(Number(t)||0)}function ne(t){return t?new Date(`${t}T00:00:00Z`).toLocaleDateString(void 0,{month:"short",day:"numeric",timeZone:"UTC"}):""}function k(){return e.jsx("div",{className:"flex h-full min-h-40 items-center justify-center text-xs text-oai-gray-400",children:n("leaderboard.community.modal.no_data")})}function b({children:t,detail:s}){return e.jsxs("div",{className:"mb-3 flex items-baseline justify-between gap-4",children:[e.jsx("h3",{className:"text-xs font-medium uppercase tracking-wide text-oai-gray-500 dark:text-oai-gray-400",children:t}),s?e.jsx("span",{className:"text-xs text-oai-gray-400",children:s}):null]})}function A({value:t,label:s}){const a=Number(t);if(!Number.isFinite(a))return null;const i=Math.sign(a)!==-1,r=i?V:te;return e.jsxs("span",{className:`inline-flex items-center gap-1 text-xs font-medium tabular-nums ${i?"text-emerald-600 dark:text-emerald-400":"text-rose-600 dark:text-rose-400"}`,title:s,children:[e.jsx(r,{className:"size-3","aria-hidden":"true"}),i?"+":"",a.toFixed(1),"%"]})}function j({label:t,value:s,title:a,delta:i,deltaLabel:r}){return e.jsxs("div",{className:"min-w-0",children:[e.jsx("div",{className:"truncate text-xs font-medium text-oai-gray-500 dark:text-oai-gray-400",children:t}),e.jsxs("div",{className:"mt-1 flex min-w-0 items-baseline gap-2",children:[e.jsx("span",{className:"truncate text-xl font-semibold leading-none tracking-tight text-oai-black tabular-nums dark:text-white",title:a,children:s}),e.jsx(A,{value:i,label:r})]})]})}function I({fillWidth:t,share:s,color:a="var(--oai-blue)",ariaLabel:i,dataAttrs:r,children:o}){return e.jsxs("div",{...r,className:"group relative grid min-h-11 grid-cols-[minmax(0,1fr)_auto] items-center gap-3 overflow-hidden px-2.5 transition-colors hover:bg-oai-gray-50 dark:hover:bg-oai-gray-900/60",children:[e.jsx("div",{className:"pointer-events-none absolute inset-y-0 left-0 opacity-[0.15] transition-opacity group-hover:opacity-[0.22] dark:opacity-[0.24] dark:group-hover:opacity-[0.32]",style:{width:`${t}%`,backgroundColor:a},role:"progressbar","aria-label":i,"aria-valuemin":"0","aria-valuemax":"100","aria-valuenow":Number(s)||0}),o]})}function T({rank:t,provider:s,name:a,fillWidth:i,share:r,tokens:o,tokensTitle:l,dataAttrs:c}){return e.jsxs(I,{fillWidth:i,share:r,color:ie(s),ariaLabel:`${a} ${x(r)}`,dataAttrs:c,children:[e.jsxs("div",{className:"relative flex min-w-0 items-center gap-2.5",children:[e.jsx("span",{className:`w-5 shrink-0 text-xs tabular-nums ${t<=3?"font-semibold text-oai-gray-700 dark:text-oai-gray-200":"text-oai-gray-400"}`,children:t}),e.jsx("span",{className:"grid size-6 shrink-0 place-items-center text-oai-gray-700 dark:text-oai-gray-200",children:e.jsx(G,{provider:s,size:15})}),e.jsx("span",{className:"truncate text-xs font-medium text-oai-gray-700 dark:text-oai-gray-200",title:a,children:a})]}),e.jsxs("div",{className:"relative min-w-[4.5rem] text-right",children:[e.jsx("div",{className:"text-xs font-semibold text-oai-black tabular-nums dark:text-white",title:l,children:o}),e.jsx("div",{className:"text-xs text-oai-gray-500 tabular-nums dark:text-oai-gray-400",children:x(r)})]})]})}function le({rows:t,formatTokensTooltip:s}){return t.length?e.jsxs("div",{className:"mt-7",children:[e.jsx(b,{children:n("leaderboard.community.modal.token_mix")}),e.jsx("div",{className:"flex h-1.5 overflow-hidden bg-oai-gray-100 dark:bg-oai-gray-800",children:t.map(a=>e.jsx("div",{style:{width:`${Math.max(Number(a.share)||0,0)}%`,backgroundColor:_[a.key]||"var(--community-muted)"},title:`${n(`leaderboard.community.modal.token_mix.${a.key}`)} · ${x(a.share)}`},a.key))}),e.jsx("div",{className:"mt-3 flex flex-wrap gap-x-5 gap-y-1.5",children:t.map(a=>e.jsxs("span",{className:"inline-flex items-center gap-1.5 text-xs text-oai-gray-500 dark:text-oai-gray-400",title:s(a.tokens),children:[e.jsx("span",{className:"size-2",style:{backgroundColor:_[a.key]||"var(--community-muted)"}}),n(`leaderboard.community.modal.token_mix.${a.key}`),e.jsx("span",{className:"tabular-nums text-oai-gray-700 dark:text-oai-gray-200",children:x(a.share)})]},a.key))})]}):null}function f({label:t,value:s,title:a,delta:i,deltaLabel:r,className:o=""}){return e.jsxs("div",{className:`min-w-0 ${o}`,children:[e.jsx("div",{className:"truncate text-xs text-oai-gray-500 dark:text-oai-gray-400",children:t}),e.jsxs("div",{className:"mt-1 flex min-w-0 items-baseline gap-2",children:[e.jsx("span",{className:"truncate text-base font-semibold leading-none tracking-tight tabular-nums text-oai-black dark:text-white",title:a,children:s}),e.jsx(A,{value:i,label:r})]})]})}function de({trendRows:t,activeDevelopers30d:s,developerGrowthPct:a,formatTokens:i,formatTokensTooltip:r}){if(!t.length)return null;const o=t.reduce((m,h)=>m+h.value,0),l=t.reduce((m,h)=>m.value<h.value?h:m,t[0]),c=o/t.length;return e.jsxs("div",{className:"mt-5 grid grid-cols-3 divide-x divide-oai-gray-100 border-y border-oai-gray-100 py-3.5 dark:divide-oai-gray-800/80 dark:border-oai-gray-800/80",children:[e.jsx(f,{className:"pr-4",label:n("leaderboard.community.modal.daily_average"),value:i(c),title:r(c)}),e.jsx(f,{className:"px-4",label:`${n("leaderboard.community.modal.peak_day")} · ${l.day}`,value:i(l.value),title:r(l.value)}),e.jsx(f,{className:"pl-4",label:n("leaderboard.community.modal.active_30d"),value:p(s),title:Number(s).toLocaleString(),delta:a,deltaLabel:n("leaderboard.community.modal.vs_previous_week")})]})}function me({trendRows:t,mix:s,activeDevelopers30d:a,developerGrowthPct:i,formatTokens:r,formatTokensTooltip:o}){return!t.length&&!s.length?e.jsx(k,{}):e.jsxs("div",{children:[e.jsx(b,{detail:n("leaderboard.community.modal.utc_note"),children:n("leaderboard.community.modal.community_activity")}),e.jsx(W,{embedded:!0,rows:t,from:t[0]?.day,to:t.at(-1)?.day,chartHeightClass:"h-44"}),e.jsx(de,{trendRows:t,activeDevelopers30d:a,developerGrowthPct:i,formatTokens:r,formatTokensTooltip:o}),e.jsx(le,{rows:s,formatTokensTooltip:o})]})}function ce({rows:t,maxShare:s,formatTokens:a,formatTokensTooltip:i}){return t.length?e.jsx("div",{className:"space-y-0.5",children:t.map((r,o)=>e.jsx(T,{rank:o+1,dataAttrs:{"data-provider-rank":o+1,"data-provider-name":r.name},provider:String(r.name).toUpperCase(),name:r.name,fillWidth:Math.max((Number(r.share)||0)/s*100,2),share:r.share,tokens:a(r.tokens),tokensTitle:i(r.tokens)},r.name))}):e.jsx(k,{})}function ue({rows:t,maxShare:s,formatTokens:a,formatTokensTooltip:i}){return t.length?e.jsx("div",{className:"space-y-0.5",children:t.map((r,o)=>{const l=Number(r.share)||0;return e.jsx(T,{rank:o+1,dataAttrs:{"data-model-rank":o+1,"data-model-name":r.name},provider:oe(r.name),name:r.name,fillWidth:Math.max(l/s*100,2),share:l,tokens:a(r.tokens),tokensTitle:i(r.tokens)},r.name)})}):e.jsx(k,{})}function xe({name:t}){const s=String(t||"").toLowerCase();return s==="darwin"?e.jsx(U,{className:"size-3.5"}):s==="win32"?e.jsx(B,{className:"size-3.5"}):e.jsx(X,{className:"size-4","aria-hidden":"true"})}const he=.175,ye=.3;function ge({bands:t,formatTokensTooltip:s}){const a=t.reduce((r,o)=>Math.max(r,Number(o.developer_share)||0),0)||1,i=r=>`${n(`leaderboard.community.modal.band.${r.key}`)} · ${n("leaderboard.community.modal.developer_count",{count:p(r.developers)})} (${s(r.tokens)})`;return e.jsxs("div",{children:[e.jsx("div",{className:"flex gap-2 border-b border-oai-gray-200 dark:border-oai-gray-800",children:t.map((r,o)=>{const l=Number(r.developer_share)||0,c=Math.max(l/a*80,2);return e.jsxs("div",{className:"relative h-32 min-w-0 flex-1",title:i(r),children:[e.jsx("div",{role:"progressbar","aria-label":n("leaderboard.community.modal.developer_share_title",{share:x(l)}),"aria-valuemin":"0","aria-valuemax":"100","aria-valuenow":l,className:"absolute inset-x-0 bottom-0",style:{height:`${c}%`,backgroundColor:"var(--oai-blue)",opacity:ye+o*he}}),e.jsx("div",{className:"absolute inset-x-0 text-center text-xs font-medium tabular-nums text-oai-gray-700 dark:text-oai-gray-200",style:{bottom:`calc(${c}% + 4px)`},children:x(l)})]},r.key)})}),e.jsx("div",{className:"mt-2 flex gap-2",children:t.map(r=>e.jsxs("div",{className:"min-w-0 flex-1 text-center",title:i(r),children:[e.jsx("div",{className:"truncate text-xs font-medium text-oai-gray-700 dark:text-oai-gray-200",children:n(`leaderboard.community.modal.band.${r.key}`)}),e.jsx("div",{className:"truncate text-xs tabular-nums text-oai-gray-500 dark:text-oai-gray-400",children:p(r.developers)})]},r.key))})]})}function pe({bands:t,platforms:s,formatTokensTooltip:a}){return!t.length&&!s.length?e.jsx(k,{}):e.jsxs("div",{className:"space-y-8",children:[t.length?e.jsxs("div",{children:[e.jsx(b,{children:n("leaderboard.community.modal.usage_distribution")}),e.jsx(ge,{bands:t,formatTokensTooltip:a})]}):null,s.length?e.jsxs("div",{children:[e.jsx(b,{children:n("leaderboard.community.modal.platforms")}),e.jsx("div",{className:"space-y-0.5",children:s.map(i=>e.jsxs(I,{fillWidth:Math.max(Number(i.share)||0,1),share:i.share,ariaLabel:`${n(`leaderboard.community.modal.platform.${i.name}`)} ${x(i.share)}`,children:[e.jsxs("div",{className:"relative flex min-w-0 items-center gap-2.5",children:[e.jsx("span",{className:"grid size-6 shrink-0 place-items-center text-oai-gray-700 dark:text-oai-gray-200",children:e.jsx(xe,{name:i.name})}),e.jsx("span",{className:"truncate text-xs font-medium text-oai-gray-700 dark:text-oai-gray-200",children:n(`leaderboard.community.modal.platform.${i.name}`)})]}),e.jsxs("div",{className:"relative min-w-[4.5rem] text-right",children:[e.jsx("div",{className:"text-xs font-semibold text-oai-black tabular-nums dark:text-white",children:x(i.share)}),e.jsx("div",{className:"text-xs text-oai-gray-500 tabular-nums dark:text-oai-gray-400",title:Number(i.machines||0).toLocaleString(),children:n("leaderboard.community.modal.machine_count",{count:p(i.machines)})})]})]},i.name))})]}):null]})}function ve({isOpen:t,onClose:s,communityStats:a}){const{formatTokens:i,formatTokensTooltip:r}=F(),[o,l]=D.useState("overview"),c=a?.status==="ready",m=D.useMemo(()=>{if(!c)return null;const d=(Array.isArray(a.providers)?a.providers:[]).slice(0,O),u=(Array.isArray(a.topModels)?a.topModels:[]).slice(0,O),y=v=>v.reduce(($,L)=>Math.max($,Number(L.share)||0),0)||1;return{providers:d,models:u,providersMaxShare:y(d),modelsMaxShare:y(u),trendRows:(Array.isArray(a.dailyGrowth)?a.dailyGrowth:[]).map(v=>({day:ne(v.day),value:Number(v.tokens)||0})),mix:Array.isArray(a.tokenMix)?a.tokenMix:[],bands:Array.isArray(a.userDistribution)?a.userDistribution:[],platforms:Array.isArray(a.platforms)?a.platforms:[]}},[c,a]);if(!m)return null;const h=Number(a.tokenFloor)||0,N=Number(a.activeDevelopersTotal)||Number(a.totalEntries)||0,w=Number(a.tokens30d)||0,E=d=>{if(d.key!=="ArrowRight"&&d.key!=="ArrowLeft")return;d.preventDefault();const u=d.key==="ArrowRight"?1:-1,y=g[(g.indexOf(o)+u+g.length)%g.length];l(y),d.currentTarget.querySelector(`[data-tab-id="${y}"]`)?.focus()};return e.jsx(Y,{open:t,onOpenChange:d=>!d&&s(),children:e.jsxs(Z,{children:[e.jsx(H,{className:"fixed inset-0 z-[100] bg-black/50 backdrop-blur-[3px] transition-opacity duration-200 ease-out data-[ending-style]:opacity-0 data-[starting-style]:opacity-0"}),e.jsx(q,{className:"fixed inset-0 z-[101] flex items-center justify-center p-2 sm:p-5",children:e.jsxs(J,{className:"relative flex h-[min(42rem,92vh)] w-full max-w-xl flex-col overflow-hidden rounded-2xl bg-white shadow-2xl ring-1 ring-black/10 transition-[opacity,transform] duration-[220ms] ease-[cubic-bezier(0.16,1,0.3,1)] data-[ending-style]:translate-y-3 data-[ending-style]:scale-[0.98] data-[ending-style]:opacity-0 data-[starting-style]:translate-y-3 data-[starting-style]:scale-[0.98] data-[starting-style]:opacity-0 dark:bg-oai-gray-950 dark:ring-white/10",children:[e.jsxs("header",{"data-testid":"community-metrics-header",className:"shrink-0 px-5 pt-5 sm:px-6",children:[e.jsxs("div",{className:"flex items-start justify-between gap-4",children:[e.jsxs("div",{children:[e.jsx(Q,{className:"text-lg font-semibold tracking-[-0.02em] text-oai-black dark:text-white",children:n("leaderboard.community.modal.title")}),e.jsx(ee,{className:"sr-only",children:n("leaderboard.community.modal.description")})]}),e.jsx(ae,{className:"-mr-1 -mt-1 grid size-8 place-items-center rounded-full text-oai-gray-400 transition-colors hover:bg-black/5 hover:text-oai-black dark:hover:bg-white/10 dark:hover:text-white","aria-label":n("shared.dialog.close"),children:e.jsx(S,{className:"size-4"})})]}),e.jsxs("div",{className:"mt-4 grid grid-cols-3 gap-x-5",children:[e.jsx(j,{label:n("leaderboard.community.modal.total_tokens"),value:i(h),title:r(h)}),e.jsx(j,{label:n("leaderboard.community.modal.tokens_30d"),value:i(w),title:r(w),delta:a.tokenGrowthPct,deltaLabel:n("leaderboard.community.modal.vs_previous_week")}),e.jsx(j,{label:n("leaderboard.community.modal.contributors"),value:p(N),title:N.toLocaleString()})]}),e.jsx("div",{className:"mt-4 flex items-end overflow-x-auto border-b border-oai-gray-100 dark:border-oai-gray-900",role:"tablist","aria-label":n("leaderboard.community.modal.views"),onKeyDown:E,children:g.map(d=>{const u=o===d;return e.jsxs("button",{type:"button",role:"tab","data-tab-id":d,"aria-selected":u,tabIndex:u?0:-1,onClick:()=>l(d),className:`relative mr-5 h-10 shrink-0 text-sm font-medium transition-colors last:mr-0 ${u?"text-oai-black dark:text-white":"text-oai-gray-500 hover:text-oai-gray-700 dark:text-oai-gray-400 dark:hover:text-oai-gray-200"}`,children:[n(`leaderboard.community.modal.tab.${d}`),u?e.jsx(M.span,{layoutId:"community-metrics-tab-underline",className:"absolute inset-x-0 -bottom-px h-0.5 rounded-full bg-oai-black dark:bg-white",transition:{type:"spring",stiffness:420,damping:34}}):null]},d)})})]}),e.jsx("div",{"data-testid":"community-metrics-content",className:"min-h-0 flex-1 overflow-y-auto px-5 py-5 sm:px-6",children:e.jsxs(M.div,{initial:{opacity:0,y:4},animate:{opacity:1,y:0},transition:{duration:.18,ease:[.16,1,.3,1]},className:"h-full",children:[o==="overview"?e.jsx(me,{trendRows:m.trendRows,mix:m.mix,activeDevelopers30d:Number(a.activeDevelopers30d)||0,developerGrowthPct:a.developerGrowthPct,formatTokens:i,formatTokensTooltip:r}):null,o==="providers"?e.jsx(ce,{rows:m.providers,maxShare:m.providersMaxShare,formatTokens:i,formatTokensTooltip:r}):null,o==="community"?e.jsx(pe,{bands:m.bands,platforms:m.platforms,formatTokensTooltip:r}):null,o==="models"?e.jsx(ue,{rows:m.models,maxShare:m.modelsMaxShare,formatTokens:i,formatTokensTooltip:r}):null]},o)})]})})]})})}function Ge(t){return e.jsx(P,{mode:z.COMPACT,children:e.jsx(ve,{...t})})}export{Ge as CommunityStatsModal};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{j as a,B as r,y as p}from"./__vite-browser-external-
|
|
1
|
+
import{j as a,B as r,y as p}from"./__vite-browser-external-DpZbUcLL.js";import{D as m,a as y,b,c as u,d as f,e as h}from"./DialogTitle-C--sXGjf.js";import{D as j}from"./DialogDescription-DpkD2qwW.js";function _({open:l,title:n,description:t,error:s=null,confirmLabel:d,cancelLabel:o,destructive:c=!1,busy:e=!1,onConfirm:g,onCancel:i}){return a.jsx(m,{open:l,onOpenChange:x=>{!x&&!e&&i?.()},children:a.jsxs(y,{children:[a.jsx(b,{className:"fixed inset-0 z-[100] bg-black/40 backdrop-blur-[2px] transition-opacity duration-200 ease-out data-[ending-style]:opacity-0 data-[starting-style]:opacity-0"}),a.jsx(u,{className:"fixed inset-0 z-[101] flex items-center justify-center p-4",children:a.jsxs(f,{className:"relative w-full max-w-md rounded-2xl bg-white p-6 shadow-[0_20px_60px_-20px_rgba(0,0,0,0.25)] ring-1 ring-oai-gray-200 transition-[opacity,transform] duration-[220ms] ease-[cubic-bezier(0.16,1,0.3,1)] data-[ending-style]:translate-y-2 data-[ending-style]:scale-[0.96] data-[ending-style]:opacity-0 data-[starting-style]:translate-y-2 data-[starting-style]:scale-[0.96] data-[starting-style]:opacity-0 dark:bg-oai-gray-950 dark:shadow-[0_20px_60px_-10px_rgba(0,0,0,0.65)] dark:ring-oai-gray-800",children:[a.jsx(h,{className:"text-base font-semibold text-oai-black dark:text-white",children:n}),t?a.jsx(j,{className:"mt-2 text-sm leading-6 text-oai-gray-600 dark:text-oai-gray-300",children:t}):null,s?a.jsx("p",{className:"mt-2 text-sm leading-6 text-red-600 dark:text-red-400",role:"alert",children:s}):null,a.jsxs("div",{className:"mt-5 flex justify-end gap-2",children:[a.jsx(r,{type:"button",variant:"secondary",size:"sm",disabled:e,onClick:()=>i?.(),children:o}),a.jsx(r,{type:"button",size:"sm",disabled:e,onClick:()=>g?.(),className:p(c&&"!bg-red-600 hover:!bg-red-700 focus-visible:!outline-red-600 dark:!bg-red-600 dark:hover:!bg-red-500"),children:d})]})]})})]})})}export{_ as C};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{j as e,y as n}from"./__vite-browser-external-
|
|
1
|
+
import{j as e,y as n}from"./__vite-browser-external-DpZbUcLL.js";import{C as c}from"./Card-CsAQxZZ8.js";function g({checked:r,onChange:a,disabled:i,ariaLabel:s,id:t}){return e.jsx("button",{type:"button",id:t,role:"switch","aria-checked":r,"aria-label":s,onClick:a,disabled:i,className:"relative inline-flex h-11 w-11 min-h-11 min-w-11 shrink-0 items-center justify-center rounded-full bg-transparent p-0 focus:outline-none focus-visible:ring-2 focus-visible:ring-oai-brand-500 disabled:cursor-not-allowed disabled:opacity-50",children:e.jsx("span",{"aria-hidden":"true",className:n("tt-toggle-track relative inline-flex h-5 w-9 shrink-0 items-center rounded-full transition-colors",r?"bg-oai-brand-500":"bg-oai-gray-300 dark:bg-oai-gray-700"),children:e.jsx("span",{className:n("tt-toggle-thumb inline-block h-3.5 w-3.5 rounded-full bg-white transition-transform",r?"translate-x-[18px]":"translate-x-[3px]")})})})}function u({label:r,hint:a,control:i}){return e.jsxs("div",{className:"flex flex-col gap-2 py-3 sm:flex-row sm:items-center sm:justify-between sm:gap-4",children:[e.jsxs("div",{className:"min-w-0 flex-1",children:[e.jsx("div",{className:"text-sm text-oai-gray-900 dark:text-oai-gray-200",children:r}),a?e.jsx("div",{className:"mt-0.5 text-xs text-oai-gray-500 dark:text-oai-gray-400",children:a}):null]}),e.jsx("div",{className:"self-end sm:shrink-0 sm:self-auto",children:i})]})}function b({title:r,subtitle:a,action:i,children:s}){return e.jsxs(c,{className:"rounded-lg",children:[e.jsxs("div",{className:n("flex justify-between gap-4",a?"mb-3 items-start":"mb-2 items-center"),children:[e.jsxs("div",{className:"min-w-0 flex-1",children:[e.jsx("h2",{className:"text-sm font-medium text-oai-gray-500 dark:text-oai-gray-300 uppercase tracking-wide",children:r}),a?e.jsx("p",{className:"mt-1 truncate text-xs text-oai-gray-500 dark:text-oai-gray-400",children:a}):null]}),i?e.jsx("div",{className:"shrink-0",children:i}):null]}),e.jsx("div",{className:"-mb-3 divide-y divide-oai-gray-200/60 dark:divide-oai-gray-800/60",children:s})]})}const f="w-full rounded-md border border-oai-gray-300 bg-transparent px-2.5 py-1.5 text-sm text-oai-black outline-none transition-colors focus:border-oai-brand-500 focus:ring-1 focus:ring-inset focus:ring-oai-brand-500 dark:border-oai-gray-700 dark:text-white";function h({options:r,value:a,onChange:i,disabled:s=!1}){return e.jsx("div",{className:"inline-flex items-center rounded-lg border border-oai-gray-200 bg-oai-gray-50 p-0.5 dark:border-oai-gray-800 dark:bg-oai-gray-900",children:r.map(({value:t,label:d,Icon:o})=>{const l=a===t;return e.jsxs("button",{type:"button",onClick:()=>i(t),"aria-pressed":l,disabled:s,className:n("inline-flex items-center gap-1.5 rounded-md px-3 py-1.5 text-xs font-medium transition-colors focus:outline-none focus-visible:ring-2 focus-visible:ring-oai-brand-500 disabled:cursor-not-allowed disabled:opacity-50",l?"bg-white text-oai-black shadow-sm dark:bg-oai-gray-800 dark:text-white":"text-oai-gray-500 hover:text-oai-black dark:text-oai-gray-400 dark:hover:text-white"),children:[o?e.jsx(o,{className:"h-3.5 w-3.5","aria-hidden":!0}):null,e.jsx("span",{children:d})]},t)})})}export{h as S,g as T,u as a,b,f as c};
|