tokentracker-cli 0.83.1 → 0.83.2

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.
Files changed (107) hide show
  1. package/dashboard/dist/assets/{AchievementBadge-tMxPvIPA.js → AchievementBadge-BrSr5pjk.js} +1 -1
  2. package/dashboard/dist/assets/AchievementsPage-za-wqAO2.js +2 -0
  3. package/dashboard/dist/assets/AchievementsSection-CGRVm1uS.js +1 -0
  4. package/dashboard/dist/assets/BadgeDetailModal-D1XDT2dG.js +1 -0
  5. package/dashboard/dist/assets/{Card-D479hjUR.js → Card-DX2Wwm9U.js} +1 -1
  6. package/dashboard/dist/assets/{ClawdAnimated-ChoWfPva.js → ClawdAnimated-D6JzFu8y.js} +1 -1
  7. package/dashboard/dist/assets/CommandPalette-NWiETwtS.js +1 -0
  8. package/dashboard/dist/assets/CommunityStatsModal-D4FdxAWd.js +1 -0
  9. package/dashboard/dist/assets/{ConfirmModal-CCFe2duP.js → ConfirmModal-SAheZUAv.js} +1 -1
  10. package/dashboard/dist/assets/DashboardPage-CjnBsm3Q.js +1 -0
  11. package/dashboard/dist/assets/{DevicePage-Bk9mryIp.js → DevicePage-Cf-PHRlL.js} +1 -1
  12. package/dashboard/dist/assets/DialogClose-pg5pVOeD.js +1 -0
  13. package/dashboard/dist/assets/DialogDescription-CVuGFYFU.js +1 -0
  14. package/dashboard/dist/assets/{DialogTitle-vIrqSKer.js → DialogTitle-Im7ESzoS.js} +1 -1
  15. package/dashboard/dist/assets/FadeIn-CGGFraHR.js +1 -0
  16. package/dashboard/dist/assets/{HeaderGithubStar-CFt_WMjW.js → HeaderGithubStar-DRTZXRsx.js} +1 -1
  17. package/dashboard/dist/assets/{IpCheckPage-CSWXPm3B.js → IpCheckPage-Dn62HUZu.js} +1 -1
  18. package/dashboard/dist/assets/LandingPage-CLsljoir.js +2 -0
  19. package/dashboard/dist/assets/{LeaderboardAvatar-CQkIM_Gb.js → LeaderboardAvatar-DktI_89h.js} +1 -1
  20. package/dashboard/dist/assets/LeaderboardPage-t87ElnDI.js +2 -0
  21. package/dashboard/dist/assets/{LeaderboardProfileModal-DRPXqVvC.js → LeaderboardProfileModal-DN7HurS3.js} +4 -4
  22. package/dashboard/dist/assets/{LeaderboardProfilePage-Bef_4_ug.js → LeaderboardProfilePage-CprOXLXX.js} +3 -3
  23. package/dashboard/dist/assets/{LimitsPage-bSZCJNkv.js → LimitsPage-DRX3XMYx.js} +3 -3
  24. package/dashboard/dist/assets/{LocalOnlyNotice-CIEE7t0-.js → LocalOnlyNotice-B8BtIdAA.js} +1 -1
  25. package/dashboard/dist/assets/LoginCard-OoduGJmK.js +1 -0
  26. package/dashboard/dist/assets/LoginModal-DoDoCpr6.js +1 -0
  27. package/dashboard/dist/assets/LoginPage-Dn2KMisI.js +1 -0
  28. package/dashboard/dist/assets/PetPage-CVaG5H3O.js +1 -0
  29. package/dashboard/dist/assets/PopoverPopup-B2HqJNaq.js +1 -0
  30. package/dashboard/dist/assets/ProviderIcon-BYl1Yyf3.js +1 -0
  31. package/dashboard/dist/assets/ResetPasswordPage-DWfgvuvR.js +1 -0
  32. package/dashboard/dist/assets/{Select-Ch5kjPZu.js → Select-ClnnGJY1.js} +1 -1
  33. package/dashboard/dist/assets/SelectItemText-iaFWq7GD.js +1 -0
  34. package/dashboard/dist/assets/SettingsPage-zwAOWRur.js +1 -0
  35. package/dashboard/dist/assets/SkillsPage-BB96nB2i.js +1 -0
  36. package/dashboard/dist/assets/TokenGalaxy-9_VJKdPr.js +4314 -0
  37. package/dashboard/dist/assets/TrendMonitor-D9RHcQgH.js +19 -0
  38. package/dashboard/dist/assets/WidgetsPage-CjAT6p0C.js +1 -0
  39. package/dashboard/dist/assets/{WrappedPage-CPAtRfkp.js → WrappedPage-ba6teG1N.js} +1 -1
  40. package/dashboard/dist/assets/__vite-browser-external-DWKjPxnU.js +1350 -0
  41. package/dashboard/dist/assets/__vite-browser-external-D_0JUhT7.css +1 -0
  42. package/dashboard/dist/assets/agent-logos-HCzl7U8i.js +1 -0
  43. package/dashboard/dist/assets/{arrow-up-right-Bm0oL1jH.js → arrow-up-right-TvEj8NTT.js} +1 -1
  44. package/dashboard/dist/assets/{check-DR7E_A1J.js → check-Cz3lYRiR.js} +1 -1
  45. package/dashboard/dist/assets/{copy-BtstNk2s.js → copy-CTtF84H9.js} +1 -1
  46. package/dashboard/dist/assets/{download-zOVMvQXI.js → download-B5WAY6Nh.js} +1 -1
  47. package/dashboard/dist/assets/{flame-DQaixlOI.js → flame-Cja4F8Mj.js} +1 -1
  48. package/dashboard/dist/assets/{format-tokens-Cbac-ZGw.js → format-tokens-UavRPN4W.js} +1 -1
  49. package/dashboard/dist/assets/{icons-iL7TjE7A.js → icons-BW2vjmu_.js} +1 -1
  50. package/dashboard/dist/assets/index-0w19KMWl.js +9 -0
  51. package/dashboard/dist/assets/index-Bfxr6erc.js +1 -0
  52. package/dashboard/dist/assets/index-BnzrUY9J.js +1 -0
  53. package/dashboard/dist/assets/{info-BtnxfCu0.js → info-F-75j15K.js} +1 -1
  54. package/dashboard/dist/assets/{limits-providers-DkoPB8B2.js → limits-providers-8NsMiLNP.js} +1 -1
  55. package/dashboard/dist/assets/{link-2-Bh0vUBU6.js → link-2-C_eJlLvb.js} +1 -1
  56. package/dashboard/dist/assets/{loader-circle-BVF4Sglg.js → loader-circle-BjzQhjhO.js} +1 -1
  57. package/dashboard/dist/assets/module-kH5GsDis.js +2 -0
  58. package/dashboard/dist/assets/provider-display-D1zp03ID.js +42 -0
  59. package/dashboard/dist/assets/react-Nv3-bJyw.js +1 -0
  60. package/dashboard/dist/assets/skills-api-DazKXxME.js +1 -0
  61. package/dashboard/dist/assets/{terminal-BUoPNPs5.js → terminal-DBXjwlTm.js} +1 -1
  62. package/dashboard/dist/assets/{trash-2-DrGpFJsR.js → trash-2-DLG8hKJm.js} +1 -1
  63. package/dashboard/dist/assets/{use-community-stats-D6Kxm_DN.js → use-community-stats-BQB72xAN.js} +1 -1
  64. package/dashboard/dist/assets/{use-limits-display-prefs-BCh-4-Bo.js → use-limits-display-prefs-CH8MmjYf.js} +1 -1
  65. package/dashboard/dist/assets/{use-native-settings-o-TL7MGQ.js → use-native-settings-__RhxrW5.js} +1 -1
  66. package/dashboard/dist/assets/{use-ordered-list-sMvpJjOK.js → use-ordered-list-AhnqpdnT.js} +1 -1
  67. package/dashboard/dist/assets/use-reduced-motion-CA2IXeeO.js +1 -0
  68. package/dashboard/dist/assets/{use-session-efficiency-pref-BsG2CJqB.js → use-session-efficiency-pref-CCYtJ_cN.js} +1 -1
  69. package/dashboard/dist/assets/use-transform-BhcppNI4.js +1 -0
  70. package/dashboard/dist/assets/{use-usage-limits-DVhgZkTD.js → use-usage-limits-CbA095lv.js} +1 -1
  71. package/dashboard/dist/assets/{useCurrency-DqxQMZty.js → useCurrency-Dt2GqkDm.js} +1 -1
  72. package/dashboard/dist/assets/{useScrollLock-DZpDnNt6.js → useScrollLock-C5d53j7C.js} +1 -1
  73. package/dashboard/dist/assets/{useTokenFormat-CdYh0d_c.js → useTokenFormat-dnqZK7Z-.js} +1 -1
  74. package/dashboard/dist/assets/{zap-9gvAtu1o.js → zap-Bw5OO91s.js} +1 -1
  75. package/dashboard/dist/index.html +2 -2
  76. package/dashboard/dist/share.html +2 -2
  77. package/package.json +1 -1
  78. package/src/commands/serve.js +21 -4
  79. package/src/commands/sync.js +142 -73
  80. package/src/lib/cursor-store.js +52 -2
  81. package/src/lib/local-api.js +143 -35
  82. package/src/lib/pricing/seed-snapshot.json +1 -1
  83. package/src/lib/runtime-config.js +19 -1
  84. package/dashboard/dist/assets/AchievementsPage-qqu8DWOa.js +0 -2
  85. package/dashboard/dist/assets/AchievementsSection-iRzgGWeO.js +0 -1
  86. package/dashboard/dist/assets/BadgeDetailModal-D3lYNgOJ.js +0 -1
  87. package/dashboard/dist/assets/CommunityStatsModal-CR-VAT3e.js +0 -1
  88. package/dashboard/dist/assets/DashboardPage-DGzKf5-y.js +0 -1
  89. package/dashboard/dist/assets/DialogClose-8Fw7R9Ma.js +0 -1
  90. package/dashboard/dist/assets/DialogDescription-DDeAH6I9.js +0 -1
  91. package/dashboard/dist/assets/FadeIn-DdYC9vT8.js +0 -1
  92. package/dashboard/dist/assets/LandingPage-D7WEaged.js +0 -4314
  93. package/dashboard/dist/assets/LeaderboardPage-nRXBc0bw.js +0 -2
  94. package/dashboard/dist/assets/LoginPage-2c5mYQJ1.js +0 -1
  95. package/dashboard/dist/assets/PetPage-BMi50Olg.js +0 -1
  96. package/dashboard/dist/assets/PopoverPopup-ByOC1OEv.js +0 -1
  97. package/dashboard/dist/assets/ResetPasswordPage-CNeptbJw.js +0 -1
  98. package/dashboard/dist/assets/SelectItemText-D4laqPg3.js +0 -1
  99. package/dashboard/dist/assets/SettingsPage-DlFD5hy9.js +0 -1
  100. package/dashboard/dist/assets/SkillsPage-ChdsShAm.js +0 -1
  101. package/dashboard/dist/assets/TrendMonitor-ueTTQIih.js +0 -19
  102. package/dashboard/dist/assets/WidgetsPage-a6S6gqVf.js +0 -1
  103. package/dashboard/dist/assets/__vite-browser-external-C44tPAD-.css +0 -1
  104. package/dashboard/dist/assets/__vite-browser-external-Djkun5S2.js +0 -1354
  105. package/dashboard/dist/assets/agent-logos-CwuIej9M.js +0 -1
  106. package/dashboard/dist/assets/provider-display-BgCflQrF.js +0 -42
  107. package/dashboard/dist/assets/use-transform-Bjy8uQ3M.js +0 -1
@@ -1 +0,0 @@
1
- import{j as e,c as o,M as P,N as I,r as u,o as D,R as E,b as M}from"./__vite-browser-external-Djkun5S2.js";import{S as _}from"./Select-Ch5kjPZu.js";import{u as K,T as R}from"./use-native-settings-o-TL7MGQ.js";import{F as j,S as G,a as O}from"./FadeIn-DdYC9vT8.js";import{A as $}from"./arrow-up-right-Bm0oL1jH.js";import{D as z}from"./download-zOVMvQXI.js";import"./SelectItemText-D4laqPg3.js";import"./useScrollLock-DZpDnNt6.js";import"./check-DR7E_A1J.js";import"./Card-D479hjUR.js";const H=["todayTokens","todayCost"],W=[{id:"todayTokens",label:"Today Tokens",shortLabel:"Tokens",category:"tokens"},{id:"todayCost",label:"Today Cost",shortLabel:"Cost",category:"cost"},{id:"last7dTokens",label:"Last 7 Days",shortLabel:"7d",category:"tokens"},{id:"totalTokens",label:"Total Tokens",shortLabel:"Total",category:"tokens"},{id:"totalCost",label:"Total Cost",shortLabel:"All $",category:"cost"},{id:"claude5h",label:"Claude 5h Limit",shortLabel:"Cl 5h",category:"limits"},{id:"claude7d",label:"Claude 7d Limit",shortLabel:"Cl 7d",category:"limits"},{id:"codex5h",label:"Codex 5h Limit",shortLabel:"Cx 5h",category:"limits"},{id:"codex7d",label:"Codex 7d Limit",shortLabel:"Cx 7d",category:"limits"},{id:"codexCredits",label:"Codex Credit Limit",shortLabel:"Cx Cred",category:"limits"},{id:"codexSpark5h",label:"Codex Spark 5h Limit",shortLabel:"Cx Spark 5h",category:"limits"},{id:"codexSpark7d",label:"Codex Spark 7d Limit",shortLabel:"Cx Spark 7d",category:"limits"},{id:"cursorPlan",label:"Cursor Plan Limit",shortLabel:"Cu Plan",category:"limits"},{id:"cursorAuto",label:"Cursor Auto Limit",shortLabel:"Cu Auto",category:"limits"},{id:"cursorAPI",label:"Cursor API Limit",shortLabel:"Cu API",category:"limits"},{id:"geminiPro",label:"Gemini Pro Limit",shortLabel:"Gm Pro",category:"limits"},{id:"geminiFlash",label:"Gemini Flash Limit",shortLabel:"Gm Flash",category:"limits"},{id:"geminiLite",label:"Gemini Lite Limit",shortLabel:"Gm Lite",category:"limits"},{id:"kimiWeekly",label:"Kimi Weekly Limit",shortLabel:"Km Wk",category:"limits"},{id:"kimi5h",label:"Kimi 5h Limit",shortLabel:"Km 5h",category:"limits"},{id:"kimiTotal",label:"Kimi Total Limit",shortLabel:"Km Tot",category:"limits"},{id:"kiroMonth",label:"Kiro Monthly Limit",shortLabel:"Kr Mo",category:"limits"},{id:"kiroBonus",label:"Kiro Bonus Limit",shortLabel:"Kr Bn",category:"limits"},{id:"copilotPremium",label:"Copilot Premium Limit",shortLabel:"Co Prem",category:"limits"},{id:"copilotChat",label:"Copilot Chat Limit",shortLabel:"Co Chat",category:"limits"},{id:"antigravityClaudeWeekly",label:"Antigravity Claude 7d Limit",shortLabel:"Ag Cl 7d",category:"limits"},{id:"antigravityClaude5h",label:"Antigravity Claude 5h Limit",shortLabel:"Ag Cl 5h",category:"limits"},{id:"antigravityGeminiWeekly",label:"Antigravity Gemini 7d Limit",shortLabel:"Ag Gm 7d",category:"limits"},{id:"antigravityGemini5h",label:"Antigravity Gemini 5h Limit",shortLabel:"Ag Gm 5h",category:"limits"}];function v(t,a=W,r=2){const i=new Set(a.map(n=>n.id)),l=new Set,s=Array.isArray(t)?t.filter(n=>!i.has(n)||l.has(n)?!1:(l.add(n),!0)):[];return(s.length>0?s:H).slice(0,Math.max(1,Number(r)||2))}const U=264,V=124,x="ui-rounded, -apple-system, system-ui",L=["#5A8CF2","#9973E6","#4DB8A6","#E68C59"],X={claude:"#C77DFF",codex:"#34C759",cursor:"#FFCC00",gemini:"#0A84FF"};function Y(t){return t>=.9?"#E64D4D":t>=.7?"#D9A633":"#33B866"}function b({size:t="sm",children:a}){const r=t==="lg",i=r?560:264,l=r?32:22;return e.jsx("div",{className:M("flex w-full items-center justify-center rounded-xl bg-oai-gray-100 dark:bg-oai-gray-950/60",r?"py-10 sm:py-14 px-6":"py-6 px-4"),children:e.jsx("div",{className:"overflow-hidden bg-white dark:bg-oai-gray-800 shadow-oai-md dark:shadow-[0_2px_4px_rgba(0,0,0,0.4),0_8px_24px_rgba(0,0,0,0.5)]",style:{width:"100%",maxWidth:i,aspectRatio:`${U} / ${V}`,borderRadius:l},children:a})})}function Z({size:t="sm"}){const a="M0,104 L14,104 C26,98 34,100 44,96 S58,88 68,92 80,100 90,94 102,80 112,82 126,92 136,88 150,74 162,76 178,88 188,86 204,72 216,74 236,84 250,80 L264,80",r=`${a} L264,124 L0,124 Z`,i=`sparkArea-${t}`;return e.jsx(b,{size:t,children:e.jsxs("svg",{viewBox:"0 0 264 124",className:"h-full w-full","aria-hidden":"true",children:[e.jsx("defs",{children:e.jsxs("linearGradient",{id:i,x1:"0",y1:"0",x2:"0",y2:"1",children:[e.jsx("stop",{offset:"0%",stopColor:"#0A84FF",stopOpacity:"0.18"}),e.jsx("stop",{offset:"100%",stopColor:"#0A84FF",stopOpacity:"0"})]})}),e.jsx("text",{x:"14",y:"20",className:"fill-oai-gray-500 dark:fill-oai-gray-400",fontSize:"8",fontWeight:"700",letterSpacing:"0.6",children:"TODAY"}),e.jsx("text",{x:"14",y:"46",className:"fill-oai-black dark:fill-white",fontSize:"22",fontWeight:"700",fontFamily:x,children:"203.2M"}),e.jsx("text",{x:"14",y:"60",className:"fill-oai-gray-500 dark:fill-oai-gray-400",fontSize:"8",fontWeight:"500",fontFamily:x,children:"$129.56 ±0%"}),e.jsx("text",{x:"134",y:"20",className:"fill-oai-gray-500 dark:fill-oai-gray-400",fontSize:"8",fontWeight:"700",letterSpacing:"0.6",children:"7 DAYS"}),e.jsx("text",{x:"134",y:"46",className:"fill-oai-black dark:fill-white",fontSize:"22",fontWeight:"700",fontFamily:x,children:"880.9M"}),e.jsx("text",{x:"134",y:"60",className:"fill-oai-gray-500 dark:fill-oai-gray-400",fontSize:"8",fontWeight:"500",fontFamily:x,children:"$673.61"}),e.jsx("path",{d:r,fill:`url(#${i})`,stroke:"none"}),e.jsx("path",{d:a,fill:"none",stroke:"#0A84FF",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round"})]})})}const C=(()=>{const r=[];for(let i=0;i<26;i++)for(let l=0;l<7;l++){const s=Math.sin((i+1)*12.9898+(l+1)*78.233+17)*43758.5453,c=Math.floor(Math.abs(s-Math.floor(s))*100);r.push({w:i,d:l,v:c})}return r})();function S(t,a){return t<18?a?"#262626":"#e5e5e5":t<38?"rgba(10, 132, 255, 0.28)":t<58?"rgba(10, 132, 255, 0.50)":t<80?"rgba(10, 132, 255, 0.75)":"#0A84FF"}function q(){return e.jsx(b,{children:e.jsxs("svg",{viewBox:"0 0 264 124",className:"h-full w-full","aria-hidden":"true",children:[e.jsx("g",{transform:`translate(${19.5}, 10)`,className:"hidden dark:inline",children:C.map(s=>e.jsx("rect",{x:s.w*(7.5+1.2),y:s.d*(8+1.2),width:7.5,height:8,rx:"1.3",fill:S(s.v,!0)},`d-${s.w}-${s.d}`))}),e.jsx("g",{transform:`translate(${19.5}, 10)`,className:"dark:hidden",children:C.map(s=>e.jsx("rect",{x:s.w*(7.5+1.2),y:s.d*(8+1.2),width:7.5,height:8,rx:"1.3",fill:S(s.v,!1)},`l-${s.w}-${s.d}`))}),e.jsx("text",{x:19.5,y:"102",className:"fill-oai-black dark:fill-white",fontSize:"10",fontWeight:"700",fontFamily:x,children:"10.3B"}),e.jsx("text",{x:19.5+30,y:"102",className:"fill-oai-gray-500 dark:fill-oai-gray-400",fontSize:"9",fontWeight:"500",children:"tokens · 202 active days"})]})})}function J(){const t=[{name:"claude-opus-4-6",value:"586.4M",pct:59},{name:"claude-sonnet-4-5-20250929",value:"218.7M",pct:22},{name:"gpt-5.4",value:"80.6M",pct:8},{name:"composer-2-fast",value:"52.1M",pct:5}],a=22,r=28,i=14,l=236;return e.jsx(b,{children:e.jsx("svg",{viewBox:"0 0 264 124",className:"h-full w-full","aria-hidden":"true",children:t.map((s,c)=>{const n=r+c*a,h=L[c%L.length];return e.jsxs("g",{children:[e.jsx("circle",{cx:"18",cy:n-3,r:"2.5",fill:h}),e.jsx("text",{x:"26",y:n,className:"fill-oai-black dark:fill-white",fontSize:"9",fontWeight:"500",children:s.name}),e.jsx("text",{x:"218",y:n,textAnchor:"end",className:"fill-oai-gray-500 dark:fill-oai-gray-400",fontSize:"9",fontWeight:"600",fontFamily:x,children:s.value}),e.jsxs("text",{x:"250",y:n,textAnchor:"end",className:"fill-oai-gray-500 dark:fill-oai-gray-400",fontSize:"8",fontWeight:"600",fontFamily:x,children:[s.pct,"%"]}),e.jsx("rect",{x:i,y:n+4,width:l,height:"2.8",rx:"1.4",className:"fill-oai-gray-200 dark:fill-oai-gray-700"}),e.jsx("rect",{x:i,y:n+4,width:Math.max(l*(s.pct/100),4),height:"2.8",rx:"1.4",fill:h})]},s.name)})})})}function Q(){const t=[{label:"Claude · 7d",source:"claude",reset:"in 1d",pct:61},{label:"Claude · 5h",source:"claude",reset:"in 4h 28m",pct:4},{label:"Cursor",source:"cursor",reset:"in 25d",pct:51},{label:"Codex · weekly",source:"codex",reset:"in 1d",pct:32}],a=22,r=28,i=14,l=236;return e.jsx(b,{children:e.jsx("svg",{viewBox:"0 0 264 124",className:"h-full w-full","aria-hidden":"true",children:t.map((s,c)=>{const n=r+c*a,h=X[s.source],y=Y(s.pct/100);return e.jsxs("g",{children:[e.jsx("circle",{cx:"18",cy:n-3,r:"2.5",fill:h}),e.jsx("text",{x:"26",y:n,className:"fill-oai-black dark:fill-white",fontSize:"9",fontWeight:"500",children:s.label}),e.jsx("text",{x:"218",y:n,textAnchor:"end",className:"fill-oai-gray-500 dark:fill-oai-gray-400",fontSize:"8",fontWeight:"500",fontFamily:x,children:s.reset}),e.jsxs("text",{x:"250",y:n,textAnchor:"end",className:"fill-oai-black dark:fill-white",fontSize:"9",fontWeight:"700",fontFamily:x,children:[s.pct,"%"]}),e.jsx("rect",{x:i,y:n+4,width:l,height:"2.8",rx:"1.4",className:"fill-oai-gray-200 dark:fill-oai-gray-700"}),e.jsx("rect",{x:i,y:n+4,width:Math.max(l*(s.pct/100),4),height:"2.8",rx:"1.4",fill:y})]},s.label)})})})}function ee(t){switch(t.category){case"cost":return"$8.42";case"limits":return"62%";default:return t.id==="last7dTokens"?"1.8B":"203M"}}function te(t,a){switch(t){case"todayTokens":return o("menubar.metric.today_tokens");case"todayCost":return o("menubar.metric.today_cost");case"last7dTokens":return o("menubar.metric.last_7d_tokens");case"totalTokens":return o("menubar.metric.total_tokens");case"totalCost":return o("menubar.metric.total_cost");case"claude5h":return o("menubar.metric.claude_5h");case"claude7d":return o("menubar.metric.claude_7d");case"codex5h":return o("menubar.metric.codex_5h");case"codex7d":return o("menubar.metric.codex_7d");case"codexCredits":return o("menubar.metric.codex_credits");case"codexSpark5h":return o("menubar.metric.codex_spark_5h");case"codexSpark7d":return o("menubar.metric.codex_spark_7d");default:return a}}function ae(t,a){const r=new Set(a.map(l=>l.id)),i=t.filter(l=>r.has(l));for(const l of a){if(i.length>=2)break;i.includes(l.id)||i.push(l.id)}return i.slice(0,2)}function ie({slotConfigs:t,showStats:a}){return e.jsx("div",{className:"flex justify-center rounded-xl bg-gradient-to-b from-oai-gray-100 to-oai-gray-200 px-6 py-8 dark:from-oai-gray-950/80 dark:to-oai-gray-900/80",children:e.jsxs("div",{className:"inline-flex items-stretch rounded-md shadow-[0_1px_3px_rgba(0,0,0,0.18)] ring-1 ring-black/10 dark:ring-white/10 px-3",style:{background:"linear-gradient(180deg, #2c2c2e 0%, #1c1c1e 100%)"},children:[e.jsx("div",{className:"flex items-center pl-2 pr-1 py-2.5",children:e.jsx("img",{src:"/clawd/mini/idle-tight.svg",alt:"","aria-hidden":"true",className:"block shrink-0",style:{height:22,width:"auto"},draggable:"false"})}),a?t.map(({slot:r,item:i},l)=>e.jsxs(E.Fragment,{children:[l>0?e.jsx("span",{className:"my-1 w-px bg-white/20","aria-hidden":"true"}):null,e.jsxs("div",{className:M("flex min-w-[52px] flex-col items-center justify-center py-1.5",l===0?"pl-1 pr-2":"px-2"),children:[e.jsx("span",{className:"text-[13px] font-semibold leading-none tabular-nums text-white",children:i?.previewValue||"--"}),e.jsx("span",{className:"mt-[2px] text-[6px] font-semibold uppercase leading-none text-white/75",children:i?.shortLabel||"Metric"})]})]},r)):null]})})}function se({slot:t,value:a,options:r,disabled:i,onChange:l}){const s=t===0?o("menubar.slot.primary"):o("menubar.slot.secondary");return e.jsxs("div",{className:"flex min-w-0 flex-col gap-1.5",children:[e.jsx("span",{className:"text-[11px] font-semibold uppercase tracking-[0.08em] text-oai-gray-500 dark:text-oai-gray-400",children:s}),e.jsx(_,{value:a,disabled:i,ariaLabel:s,onValueChange:c=>l(t,c),options:r.map(c=>({value:c.id,label:c.displayLabel})),matchTriggerWidth:!0,className:"w-full px-3 py-2 text-sm font-medium"})]})}function N({label:t,hint:a,checked:r,disabled:i,onChange:l}){return e.jsxs("div",{className:"flex items-center justify-between gap-3 py-3",children:[e.jsxs("div",{className:"min-w-0",children:[e.jsx("p",{className:"text-sm font-medium text-oai-black dark:text-white",children:t}),a?e.jsx("p",{className:"mt-0.5 text-xs text-oai-gray-500 dark:text-oai-gray-400",children:a}):null]}),e.jsx(R,{checked:r,disabled:i,onChange:l,ariaLabel:t})]})}function re({label:t,hint:a,value:r,options:i,disabled:l,onChange:s}){return e.jsxs("div",{className:"flex items-center justify-between gap-3 py-3",children:[e.jsxs("div",{className:"min-w-0",children:[e.jsx("p",{className:"text-sm font-medium text-oai-black dark:text-white",children:t}),a?e.jsx("p",{className:"mt-0.5 text-xs text-oai-gray-500 dark:text-oai-gray-400",children:a}):null]}),e.jsx(_,{value:r,disabled:l,ariaLabel:t,onValueChange:s,options:i,className:"shrink-0 px-3 py-2 text-sm font-medium"})]})}function le(){const{available:t,settings:a,setSetting:r}=K(),i=u.useMemo(()=>(Array.isArray(a?.menuBarAvailableItems)?a.menuBarAvailableItems:W).map(m=>({...m,displayLabel:te(m.id,m.label),previewValue:ee(m)})),[a?.menuBarAvailableItems]),l=Number(a?.menuBarMaxItems)||2,s=u.useMemo(()=>v(a?.menuBarItems,i,l),[i,l,a?.menuBarItems]),c=u.useMemo(()=>ae(s,i),[i,s]),n=a?.showStats!==!1,h=d=>{r("menuBarItems",v(d,i,l))},y=(d,m)=>{const g=[...c];g[d===0?1:0]!==m&&(g[d]=m,h(g))},p=[0,1].map(d=>{const m=c[d]||i[d]?.id||"",w=c[d===0?1:0],F=i.filter(f=>f.id===m||f.id!==w),B=i.find(f=>f.id===m);return{slot:d,currentValue:m,options:F,item:B}}),T=["clawd","cat","pet","static"].includes(a?.menuBarIconStyle)?a.menuBarIconStyle:"clawd",k=a?.confettiOnReset!==!1;return e.jsxs("article",{className:"rounded-xl border border-oai-gray-200 bg-white p-5 transition-colors duration-200 dark:border-oai-gray-800 dark:bg-oai-gray-900 sm:p-6",children:[e.jsx(ie,{slotConfigs:p,showStats:n}),e.jsx("div",{className:"mt-5 grid grid-cols-1 gap-3 sm:grid-cols-2 sm:gap-4",children:p.map(({slot:d,currentValue:m,options:g})=>e.jsx(se,{slot:d,value:m,options:g,disabled:!t||!n,onChange:y},d))}),e.jsxs("div",{className:"mt-5 divide-y divide-oai-gray-100 border-t border-oai-gray-100 dark:divide-oai-gray-800 dark:border-oai-gray-800",children:[e.jsx(N,{label:o("settings.menubar.showStats"),hint:t?o("settings.menubar.showStatsHint"):o("menubar.native_only"),checked:n,disabled:!t,onChange:()=>r("showStats",!n)}),e.jsx(re,{label:o("settings.menubar.iconStyle"),hint:o("settings.menubar.iconStyleHint"),value:T,disabled:!t,options:[{value:"clawd",label:o("settings.menubar.iconStyle.clawd")},{value:"cat",label:o("settings.menubar.iconStyle.cat")},{value:"pet",label:o("settings.menubar.iconStyle.pet")},{value:"static",label:o("settings.menubar.iconStyle.static")}],onChange:d=>r("menuBarIconStyle",d)}),e.jsx(N,{label:o("settings.menubar.confettiOnReset"),hint:o("settings.menubar.confettiOnResetHint"),checked:k,disabled:!t,onChange:()=>r("confettiOnReset",!k)})]})]})}function oe(){const[t,a]=u.useState("loading");return u.useEffect(()=>{if(typeof window>"u")return;if(D()){a("native");return}const r=(navigator.userAgent||"").toLowerCase(),i=/mac/.test(r)&&!/iphone|ipad/.test(r);a(i?"mac-web":"other")},[]),t}function ne(){const t=oe();return t==="loading"?e.jsx("div",{className:"h-10 w-40","aria-hidden":"true"}):t==="native"?e.jsxs("button",{type:"button",onClick:()=>P("openWidgetGallery"),className:"inline-flex h-10 items-center gap-2 rounded-lg bg-oai-black px-4 text-sm font-medium text-white transition-colors hover:bg-oai-gray-800 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-oai-brand-500 focus-visible:ring-offset-2 dark:bg-white dark:text-oai-black dark:hover:bg-oai-gray-200",children:[o("widgets.cta.open_gallery"),e.jsx($,{className:"h-4 w-4","aria-hidden":"true"})]}):t==="mac-web"?e.jsxs("a",{href:"https://github.com/mm7894215/TokenTracker/releases/latest",target:"_blank",rel:"noopener noreferrer",className:"inline-flex h-10 items-center gap-2 rounded-lg bg-oai-black px-4 text-sm font-medium text-white no-underline transition-colors hover:bg-oai-gray-800 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-oai-brand-500 focus-visible:ring-offset-2 dark:bg-white dark:text-oai-black dark:hover:bg-oai-gray-200",children:[e.jsx(z,{className:"h-4 w-4","aria-hidden":"true"}),o("widgets.cta.download")]}):e.jsxs("span",{className:"inline-flex h-10 items-center gap-2 rounded-lg border border-oai-gray-200 bg-oai-gray-50 px-4 text-sm font-medium text-oai-gray-500 dark:border-oai-gray-800 dark:bg-oai-gray-900 dark:text-oai-gray-400",children:[e.jsx(I,{className:"h-4 w-4","aria-hidden":"true"}),o("widgets.cta.macos_only")]})}const ce=[{id:"summary",Preview:Z,nameKey:"widgets.summary.name",descKey:"widgets.summary.description"},{id:"heatmap",Preview:q,nameKey:"widgets.heatmap.name",descKey:"widgets.heatmap.description"},{id:"topModels",Preview:J,nameKey:"widgets.topModels.name",descKey:"widgets.topModels.description"},{id:"limits",Preview:Q,nameKey:"widgets.limits.name",descKey:"widgets.limits.description"}];function de({Preview:t,nameKey:a,descKey:r}){return e.jsxs("article",{className:"flex h-full flex-col rounded-xl border border-oai-gray-200 bg-white p-4 transition-colors duration-200 dark:border-oai-gray-800 dark:bg-oai-gray-900 sm:p-5",children:[e.jsx(t,{}),e.jsxs("div",{className:"mt-4",children:[e.jsx("h3",{className:"text-[15px] font-semibold text-oai-black dark:text-white",children:o(a)}),e.jsx("p",{className:"mt-1.5 text-sm leading-relaxed text-oai-gray-500 dark:text-oai-gray-400",children:o(r)})]})]})}function A({titleKey:t}){return e.jsx("h2",{className:"mb-4 text-xl font-semibold tracking-tight text-oai-black dark:text-white sm:mb-5 sm:text-2xl",children:o(t)})}function je(){return e.jsx("div",{className:"flex flex-col flex-1 text-oai-black dark:text-oai-white font-oai antialiased",children:e.jsx("main",{className:"flex-1 pt-8 sm:pt-10 pb-12 sm:pb-16",children:e.jsxs("div",{className:"mx-auto max-w-5xl px-4 sm:px-6",children:[e.jsx(j,{y:12,children:e.jsxs("header",{className:"mb-10 flex items-start justify-between gap-4 sm:mb-12",children:[e.jsx("h1",{className:"text-3xl font-semibold tracking-tight text-oai-black dark:text-white sm:text-4xl",children:o("widgets.page.title")}),e.jsx("div",{className:"shrink-0",children:e.jsx(ne,{})})]})}),e.jsx(j,{y:12,delay:.06,children:e.jsxs("section",{"aria-label":o("widgets.menubar.section.title"),className:"mb-12 sm:mb-14",children:[e.jsx(A,{titleKey:"widgets.menubar.section.title"}),e.jsx(le,{})]})}),e.jsxs("section",{"aria-label":o("widgets.gallery.section.title"),children:[e.jsx(A,{titleKey:"widgets.gallery.section.title"}),e.jsx(G,{staggerDelay:.08,initialDelay:.04,children:e.jsx("div",{className:"grid grid-cols-1 gap-4 lg:grid-cols-2 lg:gap-5",children:ce.map(({id:t,Preview:a,nameKey:r,descKey:i})=>e.jsx(O,{children:e.jsx(de,{Preview:a,nameKey:r,descKey:i})},t))})})]})]})})})}export{je as WidgetsPage};