tokentracker-cli 1.2.2 → 1.3.4
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/README.md +2 -0
- package/README.zh-CN.md +2 -0
- package/THIRD_PARTY_NOTICES.md +92 -0
- package/dashboard/dist/THIRD_PARTY_NOTICES.txt +92 -0
- package/dashboard/dist/assets/AchievementBadge-CKjtQp-U.js +1 -0
- package/dashboard/dist/assets/AchievementsPage-DpOXrabE.js +2 -0
- package/dashboard/dist/assets/{AchievementsSection-BDqKRGyL.js → AchievementsSection-DiXyIoa0.js} +1 -1
- package/dashboard/dist/assets/BadgeDetailModal-CILTTkPF.js +1 -0
- package/dashboard/dist/assets/{BotAnimated-OQbsVw1O.js → BotAnimated-CrBHWiRi.js} +1 -1
- package/dashboard/dist/assets/Card-DUItW3xI.js +1 -0
- package/dashboard/dist/assets/CloudCheckoutPage-C_t_PDlG.js +1 -0
- package/dashboard/dist/assets/CloudPage-pvJUrhya.js +1 -0
- package/dashboard/dist/assets/CloudUsageExport-DQbDwiyk.js +4 -0
- package/dashboard/dist/assets/{CommandPalette-8B38qUs0.js → CommandPalette-BvHilrbV.js} +1 -1
- package/dashboard/dist/assets/CommunityStatsModal-CizxEYv-.js +1 -0
- package/dashboard/dist/assets/{ConfirmModal-Dhu_qmiM.js → ConfirmModal-h9nISVy7.js} +1 -1
- package/dashboard/dist/assets/Controls-BjdIonTX.js +1 -0
- package/dashboard/dist/assets/DashboardPage-Bxryr4qp.js +1 -0
- package/dashboard/dist/assets/DateRangePopover-DpKh-0l8.js +1 -0
- package/dashboard/dist/assets/{DevicePage-Bvz7JJwt.js → DevicePage-DUJR9hJC.js} +1 -1
- package/dashboard/dist/assets/DialogClose-BmVAmN-o.js +1 -0
- package/dashboard/dist/assets/DialogDescription-C0Cgq67g.js +1 -0
- package/dashboard/dist/assets/DialogTitle-BsaIbN8k.js +1 -0
- package/dashboard/dist/assets/{FadeIn-DDF5PqTX.js → FadeIn-BpSt2P_W.js} +1 -1
- package/dashboard/dist/assets/{HeaderGithubStar-CNzQFPol.js → HeaderGithubStar-Cc_VHB0R.js} +1 -1
- package/dashboard/dist/assets/{HoverTooltip-BKg9Z6gg.js → HoverTooltip-WFd21iP9.js} +1 -1
- package/dashboard/dist/assets/{IpCheckPage-BTdrLt08.js → IpCheckPage-C_mUPSRB.js} +1 -1
- package/dashboard/dist/assets/LandingPage-DVR8ClZO.js +2 -0
- package/dashboard/dist/assets/LeaderboardPage-D8ydzVpn.js +2 -0
- package/dashboard/dist/assets/LeaderboardProBadge-BjX4EFl2.js +1 -0
- package/dashboard/dist/assets/LeaderboardProfileModal-vbPMNn7W.js +73 -0
- package/dashboard/dist/assets/{LeaderboardProfilePage-CoqcDSTw.js → LeaderboardProfilePage-CqClmuA-.js} +2 -2
- package/dashboard/dist/assets/{LimitsPage-3RuSFnn-.js → LimitsPage-DaRggHge.js} +2 -2
- package/dashboard/dist/assets/{LocalOnlyNotice-D-OrIXty.js → LocalOnlyNotice-B6nDke_u.js} +1 -1
- package/dashboard/dist/assets/LoginCard-C28QVjd7.js +1 -0
- package/dashboard/dist/assets/LoginModal-Bx1btNhH.js +1 -0
- package/dashboard/dist/assets/LoginPage-DVOGNGYI.js +1 -0
- package/dashboard/dist/assets/PetPage-nOKryTde.js +1 -0
- package/dashboard/dist/assets/PopoverPopup-Ch6NLnu6.js +1 -0
- package/dashboard/dist/assets/{ProviderIcon-BTYVbUti.js → ProviderIcon-BRY2br-g.js} +1 -1
- package/dashboard/dist/assets/ResetPasswordPage-ko1OQecQ.js +1 -0
- package/dashboard/dist/assets/Select-Q8mS3_od.js +1 -0
- package/dashboard/dist/assets/SelectItemText-C1id8GDj.js +1 -0
- package/dashboard/dist/assets/SelfHostPage-Dzb2bDiM.js +1 -0
- package/dashboard/dist/assets/{ServiceStatusPage-Cb3k_C4g.js → ServiceStatusPage-ewFwz29J.js} +1 -1
- package/dashboard/dist/assets/SessionsPage-C6Y8kbnM.js +3 -0
- package/dashboard/dist/assets/SessionsPage-GV2fuNmd.css +1 -0
- package/dashboard/dist/assets/SettingsPage-nztCXEPs.js +2 -0
- package/dashboard/dist/assets/SkillsPage-CcG77tqU.js +1 -0
- package/dashboard/dist/assets/{TokenGalaxy-BGRF4I_8.js → TokenGalaxy-D2HDrbQR.js} +2 -2
- package/dashboard/dist/assets/TooltipPopup-C_bF2ZwO.js +1 -0
- package/dashboard/dist/assets/TrendMonitor-BcyoN5ns.js +19 -0
- package/dashboard/dist/assets/WidgetsPage-BirK0U_N.js +1 -0
- package/dashboard/dist/assets/{WrappedPage-BqyB7ezg.js → WrappedPage-thsXBuw6.js} +1 -1
- package/dashboard/dist/assets/__vite-browser-external-Bq8nj-JV.js +45 -0
- package/dashboard/dist/assets/__vite-browser-external-BwmeEfv7.css +1 -0
- package/dashboard/dist/assets/{agent-logos-CEcgxIBU.js → agent-logos-CK6SzhI7.js} +1 -1
- package/dashboard/dist/assets/arrow-left-c_NOSfoq.js +1 -0
- package/dashboard/dist/assets/arrow-right-CP7drKCT.js +1 -0
- package/dashboard/dist/assets/{arrow-up-right-CdzAw406.js → arrow-up-right-DQ6QfCpo.js} +1 -1
- package/dashboard/dist/assets/calendar-days-D_pxFQvT.js +1 -0
- package/dashboard/dist/assets/{check-DhEiHlwq.js → check-HAS31kTT.js} +1 -1
- package/dashboard/dist/assets/chevron-down-BIMuk6oN.js +1 -0
- package/dashboard/dist/assets/cloud-checkout-COmDwrUT.js +1 -0
- package/dashboard/dist/assets/composite-kLwqpqEk.js +1 -0
- package/dashboard/dist/assets/download-9RgsZIiH.js +1 -0
- package/dashboard/dist/assets/{external-link-SOFbVRrH.js → external-link-C_gYjHGF.js} +1 -1
- package/dashboard/dist/assets/{flame-BRdc7HDz.js → flame-BSsCvgT8.js} +1 -1
- package/dashboard/dist/assets/{format-tokens-DhIeweGK.js → format-tokens-N22Wqv1X.js} +1 -1
- package/dashboard/dist/assets/{host-mode-APftzzvz.js → host-mode-JzrhHX7F.js} +1 -1
- package/dashboard/dist/assets/{icons-D-wu8eUg.js → icons-pK99mIMv.js} +1 -1
- package/dashboard/dist/assets/{index-CZ3D1Q7c.js → index-BhviBroj.js} +1 -1
- package/dashboard/dist/assets/{index-D2g1tPGl.js → index-CmD84EJi.js} +1 -1
- package/dashboard/dist/assets/{index-CiWf_0mc.js → index-Dk43KNa6.js} +1 -1
- package/dashboard/dist/assets/info-D-RLFnSK.js +1 -0
- package/dashboard/dist/assets/{link-2-Cg6bEvjQ.js → link-2-BiKXW9mV.js} +1 -1
- package/dashboard/dist/assets/{loader-circle-Cd7h4LcE.js → loader-circle-KVUaEKV2.js} +1 -1
- package/dashboard/dist/assets/{modifiers.esm-B7hOvflM.js → modifiers.esm-5NK8j3mT.js} +1 -1
- package/dashboard/dist/assets/monitor-smartphone-u9yr-_Es.js +1 -0
- package/dashboard/dist/assets/os-DMmhX9tk.js +1 -0
- package/dashboard/dist/assets/play-D0MaDCOx.js +1 -0
- package/dashboard/dist/assets/plus-DTJVtoAJ.js +1 -0
- package/dashboard/dist/assets/provider-display-YhtG0I9Y.js +42 -0
- package/dashboard/dist/assets/{react-CfB5zBqR.js → react-gIVxucOB.js} +1 -1
- package/dashboard/dist/assets/safePolygon-C_sPnJ1L.js +1 -0
- package/dashboard/dist/assets/{search-DMtc6bBy.js → search-DdQRwFYV.js} +1 -1
- package/dashboard/dist/assets/server-M0rmbGWy.js +1 -0
- package/dashboard/dist/assets/shield-check-9-sqQKdD.js +1 -0
- package/dashboard/dist/assets/skills-api-B0qBWnuK.js +1 -0
- package/dashboard/dist/assets/{sortable.esm-O7ntEYCi.js → sortable.esm-iqbm7x5D.js} +1 -1
- package/dashboard/dist/assets/{store-D-FZbBaC.js → store-DstuWd4a.js} +1 -1
- package/dashboard/dist/assets/{terminal-Y3qDL50U.js → terminal-Dz0MxHNG.js} +1 -1
- package/dashboard/dist/assets/{trash-D_PaPrXq.js → trash-DBMFOFVz.js} +1 -1
- package/dashboard/dist/assets/{use-community-stats-DGTBo_4v.js → use-community-stats-CacbAcUR.js} +1 -1
- package/dashboard/dist/assets/{use-latest-request-guard-BpfCferm.js → use-latest-request-guard-nBuQVZOR.js} +1 -1
- package/dashboard/dist/assets/use-limits-display-prefs-fqg8hs6b.js +1 -0
- package/dashboard/dist/assets/use-native-settings-EAqAFx2x.js +1 -0
- package/dashboard/dist/assets/{use-ordered-list-CClTBWi0.js → use-ordered-list-DGLjjU6Q.js} +1 -1
- package/dashboard/dist/assets/use-pet-settings-C5MzWHE7.js +2 -0
- package/dashboard/dist/assets/use-reduced-motion-DK2oZ2uC.js +1 -0
- package/dashboard/dist/assets/{use-transform-CA5mW4u8.js → use-transform-C25eCuz_.js} +1 -1
- package/dashboard/dist/assets/use-usage-limits-BhqnEai3.js +1 -0
- package/dashboard/dist/assets/{useCurrency-CaOhUMcm.js → useCurrency-t3PYQi1l.js} +1 -1
- package/dashboard/dist/assets/usePositioner-C59mj6kG.js +1 -0
- package/dashboard/dist/assets/useTokenFormat-C0xQsBGf.js +1 -0
- package/dashboard/dist/assets/zap-CyH0tvKM.js +1 -0
- 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/pricing.html +6 -5
- package/dashboard/dist/privacy.html +3 -3
- package/dashboard/dist/share.html +2 -2
- package/dashboard/dist/terms.html +6 -6
- package/package.json +7 -2
- package/src/commands/device-login.js +60 -33
- package/src/commands/init.js +26 -7
- package/src/commands/serve.js +3 -3
- package/src/commands/sync.js +43 -22
- package/src/lib/atomic-json.js +27 -0
- package/src/lib/bearer-token.js +11 -0
- package/src/lib/cloud-account.js +4 -1
- package/src/lib/local-api.js +282 -69
- package/src/lib/openclaw-cli.js +104 -0
- package/src/lib/openclaw-hook.js +1 -46
- package/src/lib/openclaw-session-plugin.js +1 -59
- package/src/lib/pricing/seed-snapshot.json +1 -1
- package/src/lib/proxy-env.js +8 -3
- package/src/lib/rollout.js +15 -10
- package/src/lib/runtime-config.js +84 -14
- package/src/lib/skills-manager.js +8 -1
- package/src/lib/static-server.js +19 -4
- package/src/lib/upload-throttle.js +18 -4
- package/dashboard/dist/assets/AchievementBadge-B67_Cp1T.js +0 -1
- package/dashboard/dist/assets/AchievementsPage-DNJ5n0Bn.js +0 -2
- package/dashboard/dist/assets/BadgeDetailModal-DFL1MPcg.js +0 -1
- package/dashboard/dist/assets/Card-dqzakOoX.js +0 -1
- package/dashboard/dist/assets/CommunityStatsModal-DnbCiGms.js +0 -1
- package/dashboard/dist/assets/Controls-BgQflA-3.js +0 -1
- package/dashboard/dist/assets/DashboardPage-DeLRhWU_.js +0 -1
- package/dashboard/dist/assets/DialogClose-DUxjaRqf.js +0 -1
- package/dashboard/dist/assets/DialogDescription-h6XMtzIU.js +0 -1
- package/dashboard/dist/assets/DialogTitle-C8vpXqg8.js +0 -1
- package/dashboard/dist/assets/LandingPage-cjoagPAb.js +0 -2
- package/dashboard/dist/assets/LeaderboardAvatar-CJdG51hR.js +0 -1
- package/dashboard/dist/assets/LeaderboardPage-D-yf2rOQ.js +0 -2
- package/dashboard/dist/assets/LeaderboardProfileModal--hrfpUPF.js +0 -73
- package/dashboard/dist/assets/LoginCard-BiMyV2Uf.js +0 -1
- package/dashboard/dist/assets/LoginModal-D79CMZmf.js +0 -1
- package/dashboard/dist/assets/LoginPage-BLyGuPlG.js +0 -1
- package/dashboard/dist/assets/PetPage-Bv0K4k2t.js +0 -1
- package/dashboard/dist/assets/PopoverPopup-3eucO8QU.js +0 -1
- package/dashboard/dist/assets/ResetPasswordPage-VYMl84_-.js +0 -1
- package/dashboard/dist/assets/Select-D8N2TJz1.js +0 -1
- package/dashboard/dist/assets/SelectItemText-CoTR0Uwm.js +0 -1
- package/dashboard/dist/assets/SessionsPage-BngTWN7Q.css +0 -1
- package/dashboard/dist/assets/SessionsPage-BtH5iLbi.js +0 -3
- package/dashboard/dist/assets/SettingsPage-huGkex5G.js +0 -2
- package/dashboard/dist/assets/SkillsPage-B9usVOTU.js +0 -1
- package/dashboard/dist/assets/TrendMonitor-B8SKBsWO.js +0 -19
- package/dashboard/dist/assets/WidgetsPage-o_91L3Zi.js +0 -1
- package/dashboard/dist/assets/__vite-browser-external-Cj9D7QBh.js +0 -45
- package/dashboard/dist/assets/__vite-browser-external-gKkiQad5.css +0 -1
- package/dashboard/dist/assets/composite-DO7_ilHE.js +0 -1
- package/dashboard/dist/assets/download-kGPw24XQ.js +0 -1
- package/dashboard/dist/assets/info-Qgc5VctK.js +0 -1
- package/dashboard/dist/assets/monitor-smartphone-wFv5VQQf.js +0 -1
- package/dashboard/dist/assets/plus-0xHQei42.js +0 -1
- package/dashboard/dist/assets/provider-display-DNqVkqfp.js +0 -42
- package/dashboard/dist/assets/skills-api-BeN184fz.js +0 -1
- package/dashboard/dist/assets/use-limits-display-prefs-Drs82lSi.js +0 -1
- package/dashboard/dist/assets/use-pet-settings-DvaQ7XrL.js +0 -2
- package/dashboard/dist/assets/use-reduced-motion-Dg10dVuu.js +0 -1
- package/dashboard/dist/assets/use-session-efficiency-pref-BiYRXVlN.js +0 -1
- package/dashboard/dist/assets/use-usage-limits-B0uafB4O.js +0 -1
- package/dashboard/dist/assets/useTokenFormat-JjQCKdIr.js +0 -1
- package/dashboard/dist/assets/zap-Cqur2X5s.js +0 -1
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{j as e,c as a,Y as R,Z as E,r as b,K as $,d as K,e as W}from"./__vite-browser-external-Cj9D7QBh.js";import{S as F}from"./Select-D8N2TJz1.js";import{u as O,T as D}from"./Controls-BgQflA-3.js";import{F as N,S as G,a as z}from"./FadeIn-DDF5PqTX.js";import{A as H}from"./arrow-up-right-CdzAw406.js";import{D as U}from"./download-kGPw24XQ.js";import"./SelectItemText-CoTR0Uwm.js";import"./composite-DO7_ilHE.js";import"./check-DhEiHlwq.js";import"./Card-dqzakOoX.js";import"./react-CfB5zBqR.js";import"./use-reduced-motion-Dg10dVuu.js";const V=["todayTokens","todayCost"],x="none",T=[{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 S(t,i=T,r=2){const s=new Set(i.map(n=>n.id)),o=new Set,l=Array.isArray(t)?t.filter(n=>n===x?!0:!s.has(n)||o.has(n)?!1:(o.add(n),!0)):[];return(l.length>0?l:V).slice(0,Math.max(1,Number(r)||2))}const X=264,Y=124,g="ui-rounded, -apple-system, system-ui",C=["#5A8CF2","#9973E6","#4DB8A6","#E68C59"],Z={claude:"#C77DFF",codex:"#34C759",cursor:"#FFCC00",gemini:"#0A84FF"};function q(t){return t>=.9?"#E64D4D":t>=.7?"#D9A633":"#33B866"}function y({size:t="sm",children:i}){const r=t==="lg",s=r?560:264,o=r?32:22;return e.jsx("div",{className:W("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:s,aspectRatio:`${X} / ${Y}`,borderRadius:o},children:i})})}function J({size:t="sm"}){const i="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=`${i} L264,124 L0,124 Z`,s=`sparkArea-${t}`;return e.jsx(y,{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:s,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:a("widgets.preview.today")}),e.jsx("text",{x:"14",y:"46",className:"fill-oai-black dark:fill-white",fontSize:"22",fontWeight:"700",fontFamily:g,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:g,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:a("widgets.preview.seven_days")}),e.jsx("text",{x:"134",y:"46",className:"fill-oai-black dark:fill-white",fontSize:"22",fontWeight:"700",fontFamily:g,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:g,children:"$673.61"}),e.jsx("path",{d:r,fill:`url(#${s})`,stroke:"none"}),e.jsx("path",{d:i,fill:"none",stroke:"#0A84FF",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round"})]})})}const _=(()=>{const r=[];for(let s=0;s<26;s++)for(let o=0;o<7;o++){const l=Math.sin((s+1)*12.9898+(o+1)*78.233+17)*43758.5453,c=Math.floor(Math.abs(l-Math.floor(l))*100);r.push({w:s,d:o,v:c})}return r})();function A(t,i){return t<18?i?"#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(y,{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:_.map(l=>e.jsx("rect",{x:l.w*(7.5+1.2),y:l.d*(8+1.2),width:7.5,height:8,rx:"1.3",fill:A(l.v,!0)},`d-${l.w}-${l.d}`))}),e.jsx("g",{transform:`translate(${19.5}, 10)`,className:"dark:hidden",children:_.map(l=>e.jsx("rect",{x:l.w*(7.5+1.2),y:l.d*(8+1.2),width:7.5,height:8,rx:"1.3",fill:A(l.v,!1)},`l-${l.w}-${l.d}`))}),e.jsx("text",{x:19.5,y:"102",className:"fill-oai-black dark:fill-white",fontSize:"10",fontWeight:"700",fontFamily:g,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:a("widgets.preview.heatmap_summary",{days:202})})]})})}function ee(){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}],i=22,r=28,s=14,o=236;return e.jsx(y,{children:e.jsx("svg",{viewBox:"0 0 264 124",className:"h-full w-full","aria-hidden":"true",children:t.map((l,c)=>{const n=r+c*i,u=C[c%C.length];return e.jsxs("g",{children:[e.jsx("circle",{cx:"18",cy:n-3,r:"2.5",fill:u}),e.jsx("text",{x:"26",y:n,className:"fill-oai-black dark:fill-white",fontSize:"9",fontWeight:"500",children:l.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:g,children:l.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:g,children:[l.pct,"%"]}),e.jsx("rect",{x:s,y:n+4,width:o,height:"2.8",rx:"1.4",className:"fill-oai-gray-200 dark:fill-oai-gray-700"}),e.jsx("rect",{x:s,y:n+4,width:Math.max(o*(l.pct/100),4),height:"2.8",rx:"1.4",fill:u})]},l.name)})})})}function te(){const t=[{label:`${a("limits.provider.claude")} · ${a("limits.label.claude_7d")}`,source:"claude",reset:a("widgets.preview.reset_days",{days:1}),pct:61},{label:`${a("limits.provider.claude")} · ${a("limits.label.claude_5h")}`,source:"claude",reset:a("widgets.preview.reset_hours_minutes",{hours:4,minutes:28}),pct:4},{label:a("limits.provider.cursor"),source:"cursor",reset:a("widgets.preview.reset_days",{days:25}),pct:51},{label:`${a("limits.provider.codex")} · ${a("limits.label.codex_7d")}`,source:"codex",reset:a("widgets.preview.reset_days",{days:1}),pct:32}],i=22,r=28,s=14,o=236;return e.jsx(y,{children:e.jsx("svg",{viewBox:"0 0 264 124",className:"h-full w-full","aria-hidden":"true",children:t.map((l,c)=>{const n=r+c*i,u=Z[l.source],p=q(l.pct/100);return e.jsxs("g",{children:[e.jsx("circle",{cx:"18",cy:n-3,r:"2.5",fill:u}),e.jsx("text",{x:"26",y:n,className:"fill-oai-black dark:fill-white",fontSize:"9",fontWeight:"500",children:l.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:g,children:l.reset}),e.jsxs("text",{x:"250",y:n,textAnchor:"end",className:"fill-oai-black dark:fill-white",fontSize:"9",fontWeight:"700",fontFamily:g,children:[l.pct,"%"]}),e.jsx("rect",{x:s,y:n+4,width:o,height:"2.8",rx:"1.4",className:"fill-oai-gray-200 dark:fill-oai-gray-700"}),e.jsx("rect",{x:s,y:n+4,width:Math.max(o*(l.pct/100),4),height:"2.8",rx:"1.4",fill:p})]},l.label)})})})}function ae(t){switch(t.category){case"none":return"";case"cost":return"$8.42";case"limits":return"62%";default:return t.id==="last7dTokens"?"1.8B":"203M"}}function ie(t,i){switch(t){case x:return a("menubar.metric.none");case"todayTokens":return a("menubar.metric.today_tokens");case"todayCost":return a("menubar.metric.today_cost");case"last7dTokens":return a("menubar.metric.last_7d_tokens");case"totalTokens":return a("menubar.metric.total_tokens");case"totalCost":return a("menubar.metric.total_cost");case"claude5h":return a("menubar.metric.claude_5h");case"claude7d":return a("menubar.metric.claude_7d");case"codex5h":return a("menubar.metric.codex_5h");case"codex7d":return a("menubar.metric.codex_7d");case"codexCredits":return a("menubar.metric.codex_credits");case"codexSpark5h":return a("menubar.metric.codex_spark_5h");case"codexSpark7d":return a("menubar.metric.codex_spark_7d");default:return i}}function se(t,i){const r=new Set(i.map(o=>o.id)),s=t.filter(o=>o===x||r.has(o));for(const o of i){if(s.length>=2)break;o.id!==x&&(s.includes(o.id)||s.push(o.id))}return s.slice(0,2)}function re({slotConfigs:t,showStats:i}){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"})}),i?t.filter(({item:r})=>r?.category!=="none").map(({slot:r,item:s},o)=>e.jsxs(K.Fragment,{children:[o>0?e.jsx("span",{className:"my-1 w-px bg-white/20","aria-hidden":"true"}):null,e.jsxs("div",{className:W("flex min-w-[52px] flex-col items-center justify-center py-1.5",o===0?"pl-1 pr-2":"px-2"),children:[e.jsx("span",{className:"text-[13px] font-semibold leading-none tabular-nums text-white",children:s?.previewValue||"--"}),e.jsx("span",{className:"mt-[2px] text-[6px] font-semibold uppercase leading-none text-white/75",children:s?.shortLabel||a("widgets.preview.metric")})]})]},r)):null]})})}function le({slot:t,value:i,options:r,disabled:s,onChange:o}){const l=t===0?a("menubar.slot.primary"):a("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:l}),e.jsx(F,{value:i,disabled:s,ariaLabel:l,onValueChange:c=>o(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 w({label:t,hint:i,checked:r,disabled:s,onChange:o}){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}),i?e.jsx("p",{className:"mt-0.5 text-xs text-oai-gray-500 dark:text-oai-gray-400",children:i}):null]}),e.jsx(D,{checked:r,disabled:s,onChange:o,ariaLabel:t})]})}function oe({label:t,hint:i,value:r,options:s,disabled:o,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}),i?e.jsx("p",{className:"mt-0.5 text-xs text-oai-gray-500 dark:text-oai-gray-400",children:i}):null]}),e.jsx(F,{value:r,disabled:o,ariaLabel:t,onValueChange:l,options:s,className:"shrink-0 px-3 py-2 text-sm font-medium"})]})}function ne(){const{available:t,settings:i,setSetting:r}=O(),s=b.useMemo(()=>(Array.isArray(i?.menuBarAvailableItems)?i.menuBarAvailableItems:T).map(m=>({...m,displayLabel:ie(m.id,m.label),previewValue:ae(m)})),[i?.menuBarAvailableItems]),o=Number(i?.menuBarMaxItems)||2,l=b.useMemo(()=>S(i?.menuBarItems,s,o),[s,o,i?.menuBarItems]),c=b.useMemo(()=>se(l,s),[s,l]),n=i?.showStats!==!1,u=d=>{r("menuBarItems",S(d,s,o))},p=(d,m)=>{const h=[...c];m!==x&&h[d===0?1:0]===m||(h[d]=m,u(h))},k=[0,1].map(d=>{const m=c[d]||s[d]?.id||"",L=c[d===0?1:0],I=s.filter(f=>f.id===x||f.id===m||f.id!==L),P=s.find(f=>f.id===m);return{slot:d,currentValue:m,options:I,item:P}}),B=["clawd","bot","cat","pet","static"].includes(i?.menuBarIconStyle)?i.menuBarIconStyle:"clawd",j=i?.toastOnReset!==!1,v=i?.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(re,{slotConfigs:k,showStats:n}),e.jsx("div",{className:"mt-5 grid grid-cols-1 gap-3 sm:grid-cols-2 sm:gap-4",children:k.map(({slot:d,currentValue:m,options:h})=>e.jsx(le,{slot:d,value:m,options:h,disabled:!t||!n,onChange:p},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(w,{label:a("settings.menubar.showStats"),hint:t?a("settings.menubar.showStatsHint"):a("menubar.native_only"),checked:n,disabled:!t,onChange:()=>r("showStats",!n)}),e.jsx(oe,{label:a("settings.menubar.iconStyle"),hint:a("settings.menubar.iconStyleHint"),value:B,disabled:!t,options:[{value:"clawd",label:a("settings.menubar.iconStyle.clawd")},{value:"bot",label:a("settings.menubar.iconStyle.bot")},{value:"cat",label:a("settings.menubar.iconStyle.cat")},{value:"pet",label:a("settings.menubar.iconStyle.pet")},{value:"static",label:a("settings.menubar.iconStyle.static")}],onChange:d=>r("menuBarIconStyle",d)}),e.jsx(w,{label:a("settings.menubar.toastOnReset"),hint:a("settings.menubar.toastOnResetHint"),checked:j,disabled:!t,onChange:()=>r("toastOnReset",!j)}),e.jsx(w,{label:a("settings.menubar.confettiOnReset"),hint:a("settings.menubar.confettiOnResetHint"),checked:v,disabled:!t,onChange:()=>r("confettiOnReset",!v)})]})]})}function ce(){const[t,i]=b.useState("loading");return b.useEffect(()=>{if(typeof window>"u")return;if($()){i("native");return}const r=(navigator.userAgent||"").toLowerCase(),s=/mac/.test(r)&&!/iphone|ipad/.test(r);i(s?"mac-web":"other")},[]),t}function de(){const t=ce();return t==="loading"?e.jsx("div",{className:"h-10 w-40","aria-hidden":"true"}):t==="native"?e.jsxs("button",{type:"button",onClick:()=>R("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:[a("widgets.cta.open_gallery"),e.jsx(H,{className:"h-4 w-4","aria-hidden":"true"})]}):t==="mac-web"?e.jsxs("a",{href:"https://github.com/xiufengsun/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(U,{className:"h-4 w-4","aria-hidden":"true"}),a("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(E,{className:"h-4 w-4","aria-hidden":"true"}),a("widgets.cta.macos_only")]})}const me=[{id:"summary",Preview:J,nameKey:"widgets.summary.name",descKey:"widgets.summary.description"},{id:"heatmap",Preview:Q,nameKey:"widgets.heatmap.name",descKey:"widgets.heatmap.description"},{id:"topModels",Preview:ee,nameKey:"widgets.topModels.name",descKey:"widgets.topModels.description"},{id:"limits",Preview:te,nameKey:"widgets.limits.name",descKey:"widgets.limits.description"}];function ge({Preview:t,nameKey:i,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:a(i)}),e.jsx("p",{className:"mt-1.5 text-sm leading-relaxed text-oai-gray-500 dark:text-oai-gray-400",children:a(r)})]})]})}function M({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:a(t)})}function Se(){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(N,{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:a("widgets.page.title")}),e.jsx("div",{className:"shrink-0",children:e.jsx(de,{})})]})}),e.jsx(N,{y:12,delay:.06,children:e.jsxs("section",{"aria-label":a("widgets.menubar.section.title"),className:"mb-12 sm:mb-14",children:[e.jsx(M,{titleKey:"widgets.menubar.section.title"}),e.jsx(ne,{})]})}),e.jsxs("section",{"aria-label":a("widgets.gallery.section.title"),children:[e.jsx(M,{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:me.map(({id:t,Preview:i,nameKey:r,descKey:s})=>e.jsx(z,{children:e.jsx(ge,{Preview:i,nameKey:r,descKey:s})},t))})})]})]})})})}export{Se as WidgetsPage};
|