ccgauge 1.2.1 → 1.3.0
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/.next/standalone/.next/BUILD_ID +1 -1
- package/.next/standalone/.next/app-build-manifest.json +57 -41
- package/.next/standalone/.next/app-path-routes-manifest.json +9 -7
- package/.next/standalone/.next/build-manifest.json +2 -2
- package/.next/standalone/.next/prerender-manifest.json +3 -3
- package/.next/standalone/.next/routes-manifest.json +6 -0
- package/.next/standalone/.next/server/app/_not-found/page.js +2 -2
- package/.next/standalone/.next/server/app/_not-found/page.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/api/blocks/route.js +1 -1
- package/.next/standalone/.next/server/app/api/blocks/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/blocks/route_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/api/export/usage/route.js +1 -1
- package/.next/standalone/.next/server/app/api/export/usage/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/export/usage/route_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/api/pricing/refresh/route.js +1 -0
- package/.next/standalone/.next/server/app/api/pricing/refresh/route.js.nft.json +1 -0
- package/.next/standalone/.next/server/app/api/pricing/refresh/route_client-reference-manifest.js +1 -0
- package/.next/standalone/.next/server/app/api/pricing/route.js +1 -1
- package/.next/standalone/.next/server/app/api/pricing/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/pricing/route_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/api/projects/route.js +1 -1
- package/.next/standalone/.next/server/app/api/projects/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/projects/route_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/api/scan/route.js +1 -1
- package/.next/standalone/.next/server/app/api/scan/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/scan/route_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/api/sessions/route.js +1 -1
- package/.next/standalone/.next/server/app/api/sessions/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/sessions/route_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/api/turns/route.js +1 -1
- package/.next/standalone/.next/server/app/api/turns/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/turns/route_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/api/usage/route.js +1 -1
- package/.next/standalone/.next/server/app/api/usage/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/usage/route_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/models/page.js +2 -2
- package/.next/standalone/.next/server/app/models/page.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/models/page_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/page.js +2 -2
- package/.next/standalone/.next/server/app/page.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/page_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/projects/[id]/page.js +2 -2
- package/.next/standalone/.next/server/app/projects/[id]/page.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/projects/[id]/page_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/projects/page.js +2 -2
- package/.next/standalone/.next/server/app/projects/page.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/projects/page_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/sessions/[id]/page.js +2 -2
- package/.next/standalone/.next/server/app/sessions/[id]/page.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/sessions/[id]/page_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/sessions/page.js +2 -2
- package/.next/standalone/.next/server/app/sessions/page.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/sessions/page_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/settings/page.js +2 -2
- package/.next/standalone/.next/server/app/settings/page.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/settings/page_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/tools/page.js +2 -0
- package/.next/standalone/.next/server/app/tools/page.js.nft.json +1 -0
- package/.next/standalone/.next/server/app/tools/page_client-reference-manifest.js +1 -0
- package/.next/standalone/.next/server/app/usage/page.js +3 -3
- package/.next/standalone/.next/server/app/usage/page.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/usage/page_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app-paths-manifest.json +9 -7
- package/.next/standalone/.next/server/chunks/177.js +28 -0
- package/.next/standalone/.next/server/chunks/195.js +1 -0
- package/.next/standalone/.next/server/chunks/68.js +1 -0
- package/.next/standalone/.next/server/chunks/704.js +1 -0
- package/.next/standalone/.next/server/chunks/860.js +1 -0
- package/.next/standalone/.next/server/chunks/98.js +1 -1
- package/.next/standalone/.next/server/functions-config-manifest.json +3 -2
- package/.next/standalone/.next/server/middleware-manifest.json +5 -5
- package/.next/standalone/.next/server/pages/500.html +1 -1
- package/.next/standalone/.next/server/server-reference-manifest.json +1 -1
- package/.next/standalone/.next/static/chunks/148-086250dab6a8a8d0.js +1 -0
- package/.next/standalone/.next/static/chunks/app/api/blocks/route-bcee47c5d093728c.js +1 -0
- package/.next/standalone/.next/static/chunks/app/api/export/usage/route-bcee47c5d093728c.js +1 -0
- package/.next/standalone/.next/static/chunks/app/api/pricing/refresh/route-bcee47c5d093728c.js +1 -0
- package/.next/standalone/.next/static/chunks/app/api/pricing/route-bcee47c5d093728c.js +1 -0
- package/.next/standalone/.next/static/chunks/app/api/projects/route-bcee47c5d093728c.js +1 -0
- package/.next/standalone/.next/static/chunks/app/api/scan/route-bcee47c5d093728c.js +1 -0
- package/.next/standalone/.next/static/chunks/app/api/sessions/route-bcee47c5d093728c.js +1 -0
- package/.next/standalone/.next/static/chunks/app/api/turns/route-bcee47c5d093728c.js +1 -0
- package/.next/standalone/.next/static/chunks/app/api/usage/route-bcee47c5d093728c.js +1 -0
- package/.next/standalone/.next/static/chunks/app/layout-e349a18fcb94a7c0.js +1 -0
- package/.next/standalone/.next/static/chunks/app/loading-bcee47c5d093728c.js +1 -0
- package/.next/standalone/.next/static/chunks/app/settings/page-799eab6a6fb5294f.js +1 -0
- package/.next/standalone/.next/static/chunks/app/tools/page-f853bb04cc730994.js +1 -0
- package/.next/standalone/.next/static/chunks/app/usage/loading-bcee47c5d093728c.js +1 -0
- package/.next/standalone/.next/static/chunks/app/usage/page-64b22de6021c8bfb.js +1 -0
- package/.next/standalone/.next/static/css/cc3c7c3125ee7611.css +5 -0
- package/.next/standalone/.next/static/qXwEuv57GWCs9fn7xJz_q/_buildManifest.js +1 -0
- package/.next/standalone/package.json +2 -2
- package/CHANGELOG.md +113 -0
- package/README.md +1 -1
- package/README.zh-CN.md +2 -2
- package/dist/mcp/server.mjs +16 -16
- package/dist/report/index.mjs +29 -29
- package/package.json +2 -2
- package/.next/standalone/.next/server/chunks/567.js +0 -28
- package/.next/standalone/.next/server/chunks/697.js +0 -1
- package/.next/standalone/.next/server/chunks/716.js +0 -1
- package/.next/standalone/.next/server/chunks/730.js +0 -1
- package/.next/standalone/.next/static/OqoHJlqnd6wl-Y-PBHJaU/_buildManifest.js +0 -1
- package/.next/standalone/.next/static/chunks/148-1212b038580a0433.js +0 -1
- package/.next/standalone/.next/static/chunks/app/api/blocks/route-c50a1245d93c020a.js +0 -1
- package/.next/standalone/.next/static/chunks/app/api/export/usage/route-c50a1245d93c020a.js +0 -1
- package/.next/standalone/.next/static/chunks/app/api/pricing/route-c50a1245d93c020a.js +0 -1
- package/.next/standalone/.next/static/chunks/app/api/projects/route-c50a1245d93c020a.js +0 -1
- package/.next/standalone/.next/static/chunks/app/api/scan/route-c50a1245d93c020a.js +0 -1
- package/.next/standalone/.next/static/chunks/app/api/sessions/route-c50a1245d93c020a.js +0 -1
- package/.next/standalone/.next/static/chunks/app/api/turns/route-c50a1245d93c020a.js +0 -1
- package/.next/standalone/.next/static/chunks/app/api/usage/route-c50a1245d93c020a.js +0 -1
- package/.next/standalone/.next/static/chunks/app/layout-6eefa1ce02863d7b.js +0 -1
- package/.next/standalone/.next/static/chunks/app/loading-c50a1245d93c020a.js +0 -1
- package/.next/standalone/.next/static/chunks/app/settings/page-1ba7c4a4c0fae2f8.js +0 -1
- package/.next/standalone/.next/static/chunks/app/usage/loading-c50a1245d93c020a.js +0 -1
- package/.next/standalone/.next/static/chunks/app/usage/page-8ff1ec4ef6aa86a0.js +0 -1
- package/.next/standalone/.next/static/css/169dd00e280f7237.css +0 -5
- /package/.next/standalone/.next/static/{OqoHJlqnd6wl-Y-PBHJaU → qXwEuv57GWCs9fn7xJz_q}/_ssgManifest.js +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
exports.id=860,exports.ids=[860],exports.modules={31519:(a,b,c)=>{"use strict";c.d(b,{Q:()=>e,V:()=>d});let d={"claude-opus-4":{input:15,output:75,cacheCreation5m:18.75,cacheCreation1h:30,cacheRead:1.5},"claude-sonnet-4":{input:3,output:15,cacheCreation5m:3.75,cacheCreation1h:6,cacheRead:.3},"claude-sonnet-3-7":{input:3,output:15,cacheCreation5m:3.75,cacheCreation1h:6,cacheRead:.3},"claude-haiku-3-5":{input:.8,output:4,cacheCreation5m:1,cacheCreation1h:1.6,cacheRead:.08},"claude-haiku-3":{input:.25,output:1.25,cacheCreation5m:.3,cacheCreation1h:.5,cacheRead:.03},...c(45699).O},e={fable:d["claude-fable-5"],opus:d["claude-opus-4-8"],sonnet:d["claude-sonnet-4-6"],haiku:d["claude-haiku-4-5"]}},45699:(a,b,c)=>{"use strict";c.d(b,{O:()=>d,y:()=>e});let d={"claude-3-7-sonnet-20250219":{input:3,output:15,cacheCreation5m:3.75,cacheCreation1h:6,cacheRead:.3},"claude-3-haiku-20240307":{input:.25,output:1.25,cacheCreation5m:.3,cacheCreation1h:.5,cacheRead:.03},"claude-3-opus-20240229":{input:15,output:75,cacheCreation5m:18.75,cacheCreation1h:30,cacheRead:1.5},"claude-4-opus-20250514":{input:15,output:75,cacheCreation5m:18.75,cacheCreation1h:30,cacheRead:1.5},"claude-4-sonnet-20250514":{input:3,output:15,cacheCreation5m:3.75,cacheCreation1h:6,cacheRead:.3},"claude-fable-5":{input:10,output:50,cacheCreation5m:12.5,cacheCreation1h:20,cacheRead:1},"claude-haiku-4-5":{input:1,output:5,cacheCreation5m:1.25,cacheCreation1h:2,cacheRead:.1},"claude-haiku-4-5-20251001":{input:1,output:5,cacheCreation5m:1.25,cacheCreation1h:2,cacheRead:.1},"claude-opus-4-1":{input:15,output:75,cacheCreation5m:18.75,cacheCreation1h:30,cacheRead:1.5},"claude-opus-4-1-20250805":{input:15,output:75,cacheCreation5m:18.75,cacheCreation1h:30,cacheRead:1.5},"claude-opus-4-20250514":{input:15,output:75,cacheCreation5m:18.75,cacheCreation1h:30,cacheRead:1.5},"claude-opus-4-5":{input:5,output:25,cacheCreation5m:6.25,cacheCreation1h:10,cacheRead:.5},"claude-opus-4-5-20251101":{input:5,output:25,cacheCreation5m:6.25,cacheCreation1h:10,cacheRead:.5},"claude-opus-4-6":{input:5,output:25,cacheCreation5m:6.25,cacheCreation1h:10,cacheRead:.5},"claude-opus-4-6-20260205":{input:5,output:25,cacheCreation5m:6.25,cacheCreation1h:10,cacheRead:.5},"claude-opus-4-7":{input:5,output:25,cacheCreation5m:6.25,cacheCreation1h:10,cacheRead:.5},"claude-opus-4-7-20260416":{input:5,output:25,cacheCreation5m:6.25,cacheCreation1h:10,cacheRead:.5},"claude-opus-4-8":{input:5,output:25,cacheCreation5m:6.25,cacheCreation1h:10,cacheRead:.5},"claude-sonnet-4-20250514":{input:3,output:15,cacheCreation5m:3.75,cacheCreation1h:6,cacheRead:.3},"claude-sonnet-4-5":{input:3,output:15,cacheCreation5m:3.75,cacheCreation1h:6,cacheRead:.3},"claude-sonnet-4-5-20250929":{input:3,output:15,cacheCreation5m:3.75,cacheCreation1h:6,cacheRead:.3},"claude-sonnet-4-6":{input:3,output:15,cacheCreation5m:3.75,cacheCreation1h:6,cacheRead:.3},"claude-sonnet-5":{input:2,output:10,cacheCreation5m:2.5,cacheCreation1h:4,cacheRead:.2}},e={"chatgpt-4o-latest":{input:5,output:15,cacheCreation5m:0,cacheCreation1h:0,cacheRead:.5},"codex-mini-latest":{input:1.5,output:6,cacheCreation5m:0,cacheCreation1h:0,cacheRead:.375},"gpt-3.5-turbo":{input:.5,output:1.5,cacheCreation5m:0,cacheCreation1h:0,cacheRead:.05},"gpt-3.5-turbo-0125":{input:.5,output:1.5,cacheCreation5m:0,cacheCreation1h:0,cacheRead:.05},"gpt-3.5-turbo-1106":{input:1,output:2,cacheCreation5m:0,cacheCreation1h:0,cacheRead:.1},"gpt-3.5-turbo-16k":{input:3,output:4,cacheCreation5m:0,cacheCreation1h:0,cacheRead:.3},"gpt-4":{input:30,output:60,cacheCreation5m:0,cacheCreation1h:0,cacheRead:3},"gpt-4-0125-preview":{input:10,output:30,cacheCreation5m:0,cacheCreation1h:0,cacheRead:1},"gpt-4-0314":{input:30,output:60,cacheCreation5m:0,cacheCreation1h:0,cacheRead:3},"gpt-4-0613":{input:30,output:60,cacheCreation5m:0,cacheCreation1h:0,cacheRead:3},"gpt-4-1106-preview":{input:10,output:30,cacheCreation5m:0,cacheCreation1h:0,cacheRead:1},"gpt-4-turbo":{input:10,output:30,cacheCreation5m:0,cacheCreation1h:0,cacheRead:1},"gpt-4-turbo-2024-04-09":{input:10,output:30,cacheCreation5m:0,cacheCreation1h:0,cacheRead:1},"gpt-4-turbo-preview":{input:10,output:30,cacheCreation5m:0,cacheCreation1h:0,cacheRead:1},"gpt-4.1":{input:2,output:8,cacheCreation5m:0,cacheCreation1h:0,cacheRead:.5},"gpt-4.1-2025-04-14":{input:2,output:8,cacheCreation5m:0,cacheCreation1h:0,cacheRead:.5},"gpt-4.1-mini":{input:.4,output:1.6,cacheCreation5m:0,cacheCreation1h:0,cacheRead:.1},"gpt-4.1-mini-2025-04-14":{input:.4,output:1.6,cacheCreation5m:0,cacheCreation1h:0,cacheRead:.1},"gpt-4.1-nano":{input:.1,output:.4,cacheCreation5m:0,cacheCreation1h:0,cacheRead:.025},"gpt-4.1-nano-2025-04-14":{input:.1,output:.4,cacheCreation5m:0,cacheCreation1h:0,cacheRead:.025},"gpt-4o":{input:2.5,output:10,cacheCreation5m:0,cacheCreation1h:0,cacheRead:1.25},"gpt-4o-2024-05-13":{input:5,output:15,cacheCreation5m:0,cacheCreation1h:0,cacheRead:.5},"gpt-4o-2024-08-06":{input:2.5,output:10,cacheCreation5m:0,cacheCreation1h:0,cacheRead:1.25},"gpt-4o-2024-11-20":{input:2.5,output:10,cacheCreation5m:0,cacheCreation1h:0,cacheRead:1.25},"gpt-4o-audio-preview":{input:2.5,output:10,cacheCreation5m:0,cacheCreation1h:0,cacheRead:.25},"gpt-4o-audio-preview-2024-12-17":{input:2.5,output:10,cacheCreation5m:0,cacheCreation1h:0,cacheRead:.25},"gpt-4o-audio-preview-2025-06-03":{input:2.5,output:10,cacheCreation5m:0,cacheCreation1h:0,cacheRead:.25},"gpt-4o-mini":{input:.15,output:.6,cacheCreation5m:0,cacheCreation1h:0,cacheRead:.075},"gpt-4o-mini-2024-07-18":{input:.15,output:.6,cacheCreation5m:0,cacheCreation1h:0,cacheRead:.075},"gpt-4o-mini-audio-preview":{input:.15,output:.6,cacheCreation5m:0,cacheCreation1h:0,cacheRead:.015},"gpt-4o-mini-audio-preview-2024-12-17":{input:.15,output:.6,cacheCreation5m:0,cacheCreation1h:0,cacheRead:.015},"gpt-4o-mini-realtime-preview":{input:.6,output:2.4,cacheCreation5m:0,cacheCreation1h:0,cacheRead:.3},"gpt-4o-mini-realtime-preview-2024-12-17":{input:.6,output:2.4,cacheCreation5m:0,cacheCreation1h:0,cacheRead:.3},"gpt-4o-mini-search-preview":{input:.15,output:.6,cacheCreation5m:0,cacheCreation1h:0,cacheRead:.075},"gpt-4o-mini-search-preview-2025-03-11":{input:.15,output:.6,cacheCreation5m:0,cacheCreation1h:0,cacheRead:.075},"gpt-4o-realtime-preview":{input:5,output:20,cacheCreation5m:0,cacheCreation1h:0,cacheRead:2.5},"gpt-4o-realtime-preview-2024-12-17":{input:5,output:20,cacheCreation5m:0,cacheCreation1h:0,cacheRead:2.5},"gpt-4o-realtime-preview-2025-06-03":{input:5,output:20,cacheCreation5m:0,cacheCreation1h:0,cacheRead:2.5},"gpt-4o-search-preview":{input:2.5,output:10,cacheCreation5m:0,cacheCreation1h:0,cacheRead:1.25},"gpt-4o-search-preview-2025-03-11":{input:2.5,output:10,cacheCreation5m:0,cacheCreation1h:0,cacheRead:1.25},"gpt-5":{input:1.25,output:10,cacheCreation5m:0,cacheCreation1h:0,cacheRead:.125},"gpt-5-2025-08-07":{input:1.25,output:10,cacheCreation5m:0,cacheCreation1h:0,cacheRead:.125},"gpt-5-chat":{input:1.25,output:10,cacheCreation5m:0,cacheCreation1h:0,cacheRead:.125},"gpt-5-chat-latest":{input:1.25,output:10,cacheCreation5m:0,cacheCreation1h:0,cacheRead:.125},"gpt-5-codex":{input:1.25,output:10,cacheCreation5m:0,cacheCreation1h:0,cacheRead:.125},"gpt-5-mini":{input:.25,output:2,cacheCreation5m:0,cacheCreation1h:0,cacheRead:.025},"gpt-5-mini-2025-08-07":{input:.25,output:2,cacheCreation5m:0,cacheCreation1h:0,cacheRead:.025},"gpt-5-nano":{input:.05,output:.4,cacheCreation5m:0,cacheCreation1h:0,cacheRead:.005},"gpt-5-nano-2025-08-07":{input:.05,output:.4,cacheCreation5m:0,cacheCreation1h:0,cacheRead:.005},"gpt-5-pro":{input:15,output:120,cacheCreation5m:0,cacheCreation1h:0,cacheRead:1.5},"gpt-5-pro-2025-10-06":{input:15,output:120,cacheCreation5m:0,cacheCreation1h:0,cacheRead:1.5},"gpt-5-search-api":{input:1.25,output:10,cacheCreation5m:0,cacheCreation1h:0,cacheRead:.125},"gpt-5-search-api-2025-10-14":{input:1.25,output:10,cacheCreation5m:0,cacheCreation1h:0,cacheRead:.125},"gpt-5.1":{input:1.25,output:10,cacheCreation5m:0,cacheCreation1h:0,cacheRead:.125},"gpt-5.1-2025-11-13":{input:1.25,output:10,cacheCreation5m:0,cacheCreation1h:0,cacheRead:.125},"gpt-5.1-chat-latest":{input:1.25,output:10,cacheCreation5m:0,cacheCreation1h:0,cacheRead:.125},"gpt-5.1-codex":{input:1.25,output:10,cacheCreation5m:0,cacheCreation1h:0,cacheRead:.125},"gpt-5.1-codex-max":{input:1.25,output:10,cacheCreation5m:0,cacheCreation1h:0,cacheRead:.125},"gpt-5.1-codex-mini":{input:.25,output:2,cacheCreation5m:0,cacheCreation1h:0,cacheRead:.025},"gpt-5.2":{input:1.75,output:14,cacheCreation5m:0,cacheCreation1h:0,cacheRead:.175},"gpt-5.2-2025-12-11":{input:1.75,output:14,cacheCreation5m:0,cacheCreation1h:0,cacheRead:.175},"gpt-5.2-chat-latest":{input:1.75,output:14,cacheCreation5m:0,cacheCreation1h:0,cacheRead:.175},"gpt-5.2-codex":{input:1.75,output:14,cacheCreation5m:0,cacheCreation1h:0,cacheRead:.175},"gpt-5.2-pro":{input:21,output:168,cacheCreation5m:0,cacheCreation1h:0,cacheRead:2.1},"gpt-5.2-pro-2025-12-11":{input:21,output:168,cacheCreation5m:0,cacheCreation1h:0,cacheRead:2.1},"gpt-5.3-chat-latest":{input:1.75,output:14,cacheCreation5m:0,cacheCreation1h:0,cacheRead:.175},"gpt-5.3-codex":{input:1.75,output:14,cacheCreation5m:0,cacheCreation1h:0,cacheRead:.175},"gpt-5.4":{input:2.5,output:15,cacheCreation5m:0,cacheCreation1h:0,cacheRead:.25},"gpt-5.4-2026-03-05":{input:2.5,output:15,cacheCreation5m:0,cacheCreation1h:0,cacheRead:.25},"gpt-5.4-mini":{input:.75,output:4.5,cacheCreation5m:0,cacheCreation1h:0,cacheRead:.075},"gpt-5.4-mini-2026-03-17":{input:.75,output:4.5,cacheCreation5m:0,cacheCreation1h:0,cacheRead:.075},"gpt-5.4-nano":{input:.2,output:1.25,cacheCreation5m:0,cacheCreation1h:0,cacheRead:.02},"gpt-5.4-nano-2026-03-17":{input:.2,output:1.25,cacheCreation5m:0,cacheCreation1h:0,cacheRead:.02},"gpt-5.4-pro":{input:30,output:180,cacheCreation5m:0,cacheCreation1h:0,cacheRead:3},"gpt-5.4-pro-2026-03-05":{input:30,output:180,cacheCreation5m:0,cacheCreation1h:0,cacheRead:3},"gpt-5.5":{input:5,output:30,cacheCreation5m:0,cacheCreation1h:0,cacheRead:.5},"gpt-5.5-2026-04-23":{input:5,output:30,cacheCreation5m:0,cacheCreation1h:0,cacheRead:.5},"gpt-5.5-pro":{input:30,output:180,cacheCreation5m:0,cacheCreation1h:0,cacheRead:3},"gpt-5.5-pro-2026-04-23":{input:30,output:180,cacheCreation5m:0,cacheCreation1h:0,cacheRead:3},"gpt-5.6":{input:5,output:30,cacheCreation5m:6.25,cacheCreation1h:10,cacheRead:.5},"gpt-5.6-luna":{input:1,output:6,cacheCreation5m:1.25,cacheCreation1h:2,cacheRead:.1},"gpt-5.6-sol":{input:5,output:30,cacheCreation5m:6.25,cacheCreation1h:10,cacheRead:.5},"gpt-5.6-terra":{input:2.5,output:15,cacheCreation5m:3.125,cacheCreation1h:5,cacheRead:.25},"gpt-audio":{input:2.5,output:10,cacheCreation5m:0,cacheCreation1h:0,cacheRead:.25},"gpt-audio-1.5":{input:2.5,output:10,cacheCreation5m:0,cacheCreation1h:0,cacheRead:.25},"gpt-audio-2025-08-28":{input:2.5,output:10,cacheCreation5m:0,cacheCreation1h:0,cacheRead:.25},"gpt-audio-mini":{input:.6,output:2.4,cacheCreation5m:0,cacheCreation1h:0,cacheRead:.06},"gpt-audio-mini-2025-10-06":{input:.6,output:2.4,cacheCreation5m:0,cacheCreation1h:0,cacheRead:.06},"gpt-audio-mini-2025-12-15":{input:.6,output:2.4,cacheCreation5m:0,cacheCreation1h:0,cacheRead:.06},"gpt-realtime":{input:4,output:16,cacheCreation5m:0,cacheCreation1h:0,cacheRead:.4},"gpt-realtime-1.5":{input:4,output:16,cacheCreation5m:0,cacheCreation1h:0,cacheRead:.4},"gpt-realtime-2":{input:4,output:16,cacheCreation5m:0,cacheCreation1h:0,cacheRead:.4},"gpt-realtime-2.1":{input:4,output:24,cacheCreation5m:0,cacheCreation1h:0,cacheRead:.4},"gpt-realtime-2.1-mini":{input:.6,output:2.4,cacheCreation5m:0,cacheCreation1h:0,cacheRead:.06},"gpt-realtime-2025-08-28":{input:4,output:16,cacheCreation5m:0,cacheCreation1h:0,cacheRead:.4},"gpt-realtime-mini":{input:.6,output:2.4,cacheCreation5m:0,cacheCreation1h:0,cacheRead:.06},"gpt-realtime-mini-2025-10-06":{input:.6,output:2.4,cacheCreation5m:0,cacheCreation1h:0,cacheRead:.06},"gpt-realtime-mini-2025-12-15":{input:.6,output:2.4,cacheCreation5m:0,cacheCreation1h:0,cacheRead:.06},o1:{input:15,output:60,cacheCreation5m:0,cacheCreation1h:0,cacheRead:7.5},"o1-2024-12-17":{input:15,output:60,cacheCreation5m:0,cacheCreation1h:0,cacheRead:7.5},"o1-pro":{input:150,output:600,cacheCreation5m:0,cacheCreation1h:0,cacheRead:15},"o1-pro-2025-03-19":{input:150,output:600,cacheCreation5m:0,cacheCreation1h:0,cacheRead:15},o3:{input:2,output:8,cacheCreation5m:0,cacheCreation1h:0,cacheRead:.5},"o3-2025-04-16":{input:2,output:8,cacheCreation5m:0,cacheCreation1h:0,cacheRead:.5},"o3-deep-research":{input:10,output:40,cacheCreation5m:0,cacheCreation1h:0,cacheRead:2.5},"o3-deep-research-2025-06-26":{input:10,output:40,cacheCreation5m:0,cacheCreation1h:0,cacheRead:2.5},"o3-mini":{input:1.1,output:4.4,cacheCreation5m:0,cacheCreation1h:0,cacheRead:.55},"o3-mini-2025-01-31":{input:1.1,output:4.4,cacheCreation5m:0,cacheCreation1h:0,cacheRead:.55},"o3-pro":{input:20,output:80,cacheCreation5m:0,cacheCreation1h:0,cacheRead:2},"o3-pro-2025-06-10":{input:20,output:80,cacheCreation5m:0,cacheCreation1h:0,cacheRead:2},"o4-mini":{input:1.1,output:4.4,cacheCreation5m:0,cacheCreation1h:0,cacheRead:.275},"o4-mini-2025-04-16":{input:1.1,output:4.4,cacheCreation5m:0,cacheCreation1h:0,cacheRead:.275},"o4-mini-deep-research":{input:2,output:8,cacheCreation5m:0,cacheCreation1h:0,cacheRead:.5},"o4-mini-deep-research-2025-06-26":{input:2,output:8,cacheCreation5m:0,cacheCreation1h:0,cacheRead:.5}}},71310:(a,b,c)=>{"use strict";c.d(b,{E7:()=>i,_G:()=>d});let d={...c(45699).y},e={gpt:d["gpt-5.5"],o:d.o3};function f(){return globalThis.__ccgaugePricing?.state}let g=/-\d{8}$/,h=/^(openai)\//;function i(a){if(!a)return{pricing:null,matchType:"none",matchedKey:null};let b=f()?.openai??d;if(b[a])return{pricing:b[a],matchType:"exact",matchedKey:a};let c=a.replace(g,"");if(b[c])return{pricing:b[c],matchType:"date-stripped",matchedKey:c};let i=c.replace(h,"");if(b[i])return{pricing:b[i],matchType:"prefix-stripped",matchedKey:i};let j=f()?.openaiFallback??e,k=a.toLowerCase();return k.startsWith("gpt-")||"gpt"===k?{pricing:j.gpt??null,matchType:"family-fallback",matchedKey:"gpt-(latest)"}:/^o\d/.test(k)?{pricing:j.o??null,matchType:"family-fallback",matchedKey:"o-(latest)"}:{pricing:null,matchType:"none",matchedKey:null}}},78335:()=>{},96487:()=>{}};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";exports.id=98,exports.ids=[98],exports.modules={49098:(a,b,c)=>{c.d(b,{So:()=>t,mo:()=>v,TF:()=>u});var d=c(60704),e=c(73024),f=c(76760),g=c.n(f),h=c(48161),i=c.n(h);let j="default";function k(a){let b=a===j?"index-v2.json":`index-${a}-v2.json`;return g().join(process.env.CCGAUGE_STATE_DIR?process.env.CCGAUGE_STATE_DIR:g().join(i().homedir(),".ccgauge"),"cache",b)}async function l(a=j){let b=k(a);try{let a=await e.promises.readFile(b,"utf8"),c=JSON.parse(a);if(2!==c.schemaVersion||!Array.isArray(c.files))return null;return c}catch{return null}}async function m(a,b=j){let c=k(b),d=g().dirname(c);await e.promises.mkdir(d,{recursive:!0});let f={schemaVersion:2,savedAt:a.savedAt,files:a.files},h=`${c}.tmp-${process.pid}`;await e.promises.writeFile(h,JSON.stringify(f)),await e.promises.rename(h,c)}let n=/[\\/]([0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12})[\\/]subagents[\\/](?:[^\\/]+[\\/])*agent-[^\\/]+\.jsonl$/i,o=/[\\/]subagents[\\/]workflows[\\/]/i;class p{constructor(a=j){this.files=new Map,this.snapshot=null,this.watchers=new Map,this.pollTimer=null,this.snapshotRebuildTimer=null,this.persistTimer=null,this.fileDebouncers=new Map,this.initPromise=null,this.isIndexing=!1,this.lastIndexedAt=null,this.indexDurationMs=null,this.existingDirs=[],this.dirToProvider=new Map,this.errors=[],this.loadedFromDisk=!1,this.lastWorkStart=null,this.rescanPromise=null,this.mutationTail=Promise.resolve(),this.cacheName=a}runExclusive(a){let b=this.mutationTail.then(a,a);return this.mutationTail=b.then(()=>void 0,()=>void 0),b}init(){return this.initPromise||(this.initPromise=this.doInit()),this.initPromise}async doInit(){let a=Date.now();this.isIndexing=!0,this.lastWorkStart=a;try{await this.detectProviderDirs();let b=await l(this.cacheName);this.loadedFromDisk=null!==b;let c=new Map;if(b)for(let a of b.files)c.set(a.filePath,a);await this.runExclusive(async()=>{await this.fullScan(c),this.rebuildSnapshotNow(),this.indexDurationMs=Date.now()-a,this.lastIndexedAt=new Date().toISOString(),this.schedulePersist()}),this.syncWatchersToDirs(),this.setupPolling()}finally{this.isIndexing=!1}}async detectProviderDirs(){let a=new Map,b=[];for(let c of(0,d.R0)())for(let d of c.getDirs())await q(d)&&!a.has(d)&&(a.set(d,c),b.push(d));let c=[],e=[];for(let b of a.keys())this.dirToProvider.has(b)||c.push(b);for(let b of this.dirToProvider.keys())a.has(b)||e.push(b);return this.dirToProvider=a,this.existingDirs=b,{added:c,removed:e}}async fullScan(a){let b=[];for(let[a,c]of this.dirToProvider)for(let d of(await r(a,c)))b.push({file:d,provider:c});let c=new Set(b.map(a=>a.file));for(let d of(await Promise.all(b.map(async({file:b,provider:c})=>{try{let d=await e.promises.stat(b),f=a.get(b);if(f&&f.source===c.id&&f.parserVersion===c.parserVersion&&f.mtimeMs===d.mtimeMs&&f.size===d.size)return void this.files.set(b,{source:c.id,parserVersion:c.parserVersion,mtimeMs:d.mtimeMs,size:d.size,assistantRecords:f.assistantRecords,userRecords:f.userRecords,parentLinks:f.parentLinks});let g=await c.parseFile(b);this.files.set(b,{source:c.id,parserVersion:c.parserVersion,mtimeMs:d.mtimeMs,size:d.size,assistantRecords:g.assistant,userRecords:g.user,parentLinks:g.parentLinks})}catch(a){this.recordError(`parse ${b}: ${a.message}`)}})),Array.from(this.files.keys())))c.has(d)||this.files.delete(d)}syncWatchersToDirs(){for(let[a,b]of this.watchers)if(!this.dirToProvider.has(a)){try{b.close()}catch{}this.watchers.delete(a)}for(let[a,b]of this.dirToProvider)if(!this.watchers.has(a))try{let c=(0,e.watch)(a,{recursive:!0},(c,d)=>{if(!d||"string"!=typeof d||!d.endsWith(".jsonl"))return;let e=g().join(a,d);this.scheduleFileReconcile(e,b)});c.on("error",b=>{this.recordError(`watcher ${a}: ${b.message}`)}),this.watchers.set(a,c)}catch(b){this.recordError(`watch ${a}: ${b.message}`)}}setupPolling(){this.pollTimer&&clearInterval(this.pollTimer);let a="mcp"===this.cacheName,b=process.env.CCGAUGE_POLL_FALLBACK;"1"!==b&&("0"===b||a)||(this.pollTimer=setInterval(()=>{this.pollOnce().catch(a=>this.recordError(`poll: ${a.message}`))},3e4),this.pollTimer.unref?.())}async pollOnce(){await this.runExclusive(async()=>{let a=Date.now(),b=await this.detectProviderDirs(),c=b.added.length>0||b.removed.length>0;c&&this.syncWatchersToDirs();let d=[];for(let[a,b]of this.dirToProvider)for(let c of(await r(a,b)))d.push({file:c,provider:b});let f=new Set(d.map(a=>a.file));for(let a of(await Promise.all(d.map(async({file:a,provider:b})=>{try{let d=await e.promises.stat(a),f=this.files.get(a);if(f&&f.mtimeMs===d.mtimeMs&&f.size===d.size)return;let g=await b.parseFile(a);this.files.set(a,{source:b.id,parserVersion:b.parserVersion,mtimeMs:d.mtimeMs,size:d.size,assistantRecords:g.assistant,userRecords:g.user,parentLinks:g.parentLinks}),c=!0}catch(b){this.recordError(`poll-parse ${a}: ${b.message}`)}})),Array.from(this.files.keys())))f.has(a)||(this.files.delete(a),c=!0);c&&(this.lastWorkStart=a,this.scheduleSnapshotRebuild(),this.schedulePersist())})}scheduleFileReconcile(a,b){let c=this.fileDebouncers.get(a);c&&clearTimeout(c);let d=setTimeout(()=>{this.fileDebouncers.delete(a),this.reconcileFile(a,b).catch(b=>this.recordError(`reconcile ${a}: ${b.message}`))},200);d.unref?.(),this.fileDebouncers.set(a,d)}async reconcileFile(a,b){await this.runExclusive(async()=>{let c=Date.now(),d=null;try{d=await e.promises.stat(a)}catch{}if(!d||!d.isFile()){this.files.has(a)&&(this.files.delete(a),this.lastWorkStart=c,this.scheduleSnapshotRebuild(),this.schedulePersist());return}let f=this.files.get(a);if(!f||f.mtimeMs!==d.mtimeMs||f.size!==d.size)try{let e=await b.parseFile(a);this.files.set(a,{source:b.id,parserVersion:b.parserVersion,mtimeMs:d.mtimeMs,size:d.size,assistantRecords:e.assistant,userRecords:e.user,parentLinks:e.parentLinks}),this.lastWorkStart=c,this.scheduleSnapshotRebuild(),this.schedulePersist()}catch(b){this.recordError(`parse ${a}: ${b.message}`)}})}scheduleSnapshotRebuild(){this.snapshotRebuildTimer&&clearTimeout(this.snapshotRebuildTimer),this.snapshotRebuildTimer=setTimeout(()=>{this.snapshotRebuildTimer=null,this.rebuildSnapshotNow()},100),this.snapshotRebuildTimer.unref?.()}rebuildSnapshotNow(){let a=Date.now(),b=this.lastWorkStart??a,c=[],d=[],e={},f=0,g={claude:{source:"claude",filesScanned:0,recordsParsed:0,assistantRecords:0,scannedDirs:[]},codex:{source:"codex",filesScanned:0,recordsParsed:0,assistantRecords:0,scannedDirs:[]}};for(let[a,b]of this.dirToProvider)g[b.id].scannedDirs.push(a);for(let a of this.files.values()){for(let[b,f]of(c.push(...a.assistantRecords),d.push(...a.userRecords),a.parentLinks))e[b]=f;f+=a.assistantRecords.length+a.userRecords.length,g[a.source].filesScanned+=1,g[a.source].recordsParsed+=a.assistantRecords.length+a.userRecords.length}let h=(function(a){let b=new Map;for(let c of a){let a=function(a){let b=`${a.source}:`;return a.messageId&&a.requestId?`${b}${a.messageId}::${a.requestId}`:a.messageId?`${b}mid:${a.messageId}`:a.requestId?`${b}req:${a.requestId}`:`${b}uuid:${a.uuid}`}(c),d=b.get(a);if(!d){b.set(a,c);continue}c.timestamp<d.timestamp&&b.set(a,c)}return Array.from(b.values())})(c).sort((a,b)=>a.timestamp.localeCompare(b.timestamp)),i=(function(a){let b=new Set;return a.filter(a=>{let c=a.uuid;return!c||!b.has(c)&&(b.add(c),!0)})})(d).sort((a,b)=>a.timestamp.localeCompare(b.timestamp));for(let a of(!function({assistantRecords:a,userRecords:b,parentMap:c}){let d=new Map;for(let b of a){if(b.isSidechain||!b.sessionId)continue;let a=d.get(b.sessionId);a||(a=[],d.set(b.sessionId,a)),a.push(b)}for(let a of d.values())a.sort((a,b)=>a.timestamp<b.timestamp?-1:+(a.timestamp>b.timestamp));let e=new Map;for(let a of b){if(!a.isSidechain)continue;let b=e.get(a.filePath);(!b||a.timestamp<b.timestamp)&&e.set(a.filePath,a)}let f={subagentFiles:0,relinked:0,orphans:0,alreadyLinked:0};for(let[a,b]of e){let e,g=function(a){let b=n.exec(a);return b?b[1]:null}(a);if(!g)continue;if(f.subagentFiles+=1,null!=c[b.uuid]){f.alreadyLinked+=1;continue}let h=d.get(g);if(!h||0===h.length){f.orphans+=1;continue}let i=b.timestamp;for(let a=h.length-1;a>=0;a-=1)if(h[a].timestamp<=i){e=h[a];break}e||(e=h[0]),c[b.uuid]=e.uuid,f.relinked+=1}}({assistantRecords:h,userRecords:i,parentMap:e}),h)){var j;a.isSidechain&&(a.isWorkflowSubagent="workflow"===(j=a.filePath,n.test(j)?o.test(j)?"workflow":"task":null))}for(let a of h)g[a.source].assistantRecords+=1;let k={filesScanned:this.files.size,recordsParsed:f,assistantRecords:h.length,durationMs:Date.now()-b,scannedDirs:this.existingDirs};this.snapshot={records:h,userRecords:i,parentMap:e,stats:k,bySource:Object.values(g)},this.lastWorkStart=null}getSnapshot(){if(!this.snapshot)throw Error("Indexer not initialized — call init() first.");return this.snapshot}async forceRescan(){let a=!this.initPromise;if(await this.init(),a)return this.snapshot;if(this.rescanPromise)return this.rescanPromise;this.rescanPromise=this.runRescan();try{return await this.rescanPromise}finally{this.rescanPromise=null}}async runRescan(){this.isIndexing=!0;try{return await this.runExclusive(async()=>{let a=Date.now();return this.lastWorkStart=a,this.snapshotRebuildTimer&&(clearTimeout(this.snapshotRebuildTimer),this.snapshotRebuildTimer=null),this.persistTimer&&(clearTimeout(this.persistTimer),this.persistTimer=null),this.files.clear(),await this.detectProviderDirs(),await this.fullScan(new Map),this.rebuildSnapshotNow(),this.indexDurationMs=Date.now()-a,this.lastIndexedAt=new Date().toISOString(),this.syncWatchersToDirs(),this.schedulePersist(),this.snapshot})}finally{this.isIndexing=!1}}getStatus(){let a=this.snapshot;return{initialized:null!==a,isIndexing:this.isIndexing,lastIndexedAt:this.lastIndexedAt,indexDurationMs:this.indexDurationMs,filesIndexed:this.files.size,recordsIndexed:a?.stats.assistantRecords??0,bySource:a?.bySource??[],watchers:this.watchers.size,errors:this.errors.slice(-20),pendingReconciles:this.fileDebouncers.size,loadedFromDisk:this.loadedFromDisk}}schedulePersist(){this.persistTimer&&clearTimeout(this.persistTimer),this.persistTimer=setTimeout(()=>{this.persistTimer=null;let a=[];for(let[b,c]of this.files)a.push({filePath:b,source:c.source,parserVersion:c.parserVersion,mtimeMs:c.mtimeMs,size:c.size,assistantRecords:c.assistantRecords,userRecords:c.userRecords,parentLinks:c.parentLinks});m({savedAt:new Date().toISOString(),files:a},this.cacheName).catch(a=>this.recordError(`persist: ${a.message}`))},2e3),this.persistTimer.unref?.()}recordError(a){let b=`${new Date().toISOString()} ${function(a){let b=(0,h.homedir)();if(!b)return a;let c=new Set([b]);"win32"===process.platform&&(c.add(b.replace(/\\/g,"/")),c.add(b.replace(/\\/g,"\\\\")),c.add("\\\\?\\"+b),c.add("\\\\?\\"+b.replace(/\\/g,"/")));let d=a;for(let a of c){let b=a.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");d=d.replace(RegExp(b,"g"),"~")}return d}(a)}`;this.errors.push(b),this.errors.length>40&&this.errors.splice(0,this.errors.length-20),process.env.CCGAUGE_DEBUG&&console.error(`[ccgauge:indexer] ${new Date().toISOString()} ${a}`)}disposeWatchers(){for(let a of this.watchers.values())try{a.close()}catch{}this.watchers.clear()}dispose(){for(let a of(this.disposeWatchers(),this.pollTimer&&clearInterval(this.pollTimer),this.snapshotRebuildTimer&&clearTimeout(this.snapshotRebuildTimer),this.persistTimer&&clearTimeout(this.persistTimer),this.fileDebouncers.values()))clearTimeout(a);this.fileDebouncers.clear()}}async function q(a){try{return(await e.promises.stat(a)).isDirectory()}catch{return!1}}async function r(a,b){let c=[];async function d(a,f){let h;if(!(f>8)){try{h=await e.promises.readdir(a,{withFileTypes:!0})}catch{return}for(let e of h){let h=g().join(a,e.name);if(e.isDirectory()){if(b.shouldSkipDir(e.name))continue;await d(h,f+1)}else e.isFile()&&e.name.endsWith(".jsonl")&&c.push(h)}}}return await d(a,0),c}function s(a=j){let b=(globalThis.__ccgaugeIndexers||(globalThis.__ccgaugeIndexers=new Map),globalThis.__ccgaugeIndexers),c=b.get(a);return c||(c=new p(a),b.set(a,c)),c}async function t(a={}){let b=s();return a.force?b.forceRescan():(await b.init(),b.getSnapshot())}function u(){return(0,d.R0)().map(a=>({source:a.id,dirs:a.getDirs()}))}function v(){return s().getStatus()}}};
|
|
1
|
+
"use strict";exports.id=98,exports.ids=[98],exports.modules={49098:(a,b,c)=>{c.d(b,{So:()=>t,mo:()=>v,TF:()=>u});var d=c(60704),e=c(73024),f=c(76760),g=c.n(f),h=c(48161),i=c.n(h);let j="default";function k(a){let b=a===j?"index-v2.json":`index-${a}-v2.json`;return g().join(process.env.CCGAUGE_STATE_DIR?process.env.CCGAUGE_STATE_DIR:g().join(i().homedir(),".ccgauge"),"cache",b)}async function l(a=j){let b=k(a);try{let a=await e.promises.readFile(b,"utf8"),c=JSON.parse(a);if(2!==c.schemaVersion||!Array.isArray(c.files))return null;return c}catch{return null}}async function m(a,b=j){let c=k(b),d=g().dirname(c);await e.promises.mkdir(d,{recursive:!0});let f={schemaVersion:2,savedAt:a.savedAt,files:a.files},h=`${c}.tmp-${process.pid}`;await e.promises.writeFile(h,JSON.stringify(f)),await e.promises.rename(h,c)}let n=/[\\/]([0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12})[\\/]subagents[\\/](?:[^\\/]+[\\/])*agent-[^\\/]+\.jsonl$/i,o=/[\\/]subagents[\\/]workflows[\\/]/i;class p{constructor(a=j){this.files=new Map,this.snapshot=null,this.watchers=new Map,this.pollTimer=null,this.snapshotRebuildTimer=null,this.persistTimer=null,this.fileDebouncers=new Map,this.initPromise=null,this.isIndexing=!1,this.lastIndexedAt=null,this.indexDurationMs=null,this.existingDirs=[],this.dirToProvider=new Map,this.errors=[],this.loadedFromDisk=!1,this.lastWorkStart=null,this.rescanPromise=null,this.mutationTail=Promise.resolve(),this.cacheName=a}runExclusive(a){let b=this.mutationTail.then(a,a);return this.mutationTail=b.then(()=>void 0,()=>void 0),b}init(){return this.initPromise||(this.initPromise=this.doInit()),this.initPromise}async doInit(){let a=Date.now();this.isIndexing=!0,this.lastWorkStart=a;try{await this.detectProviderDirs();let b=await l(this.cacheName);this.loadedFromDisk=null!==b;let c=new Map;if(b)for(let a of b.files)c.set(a.filePath,a);await this.runExclusive(async()=>{await this.fullScan(c),this.rebuildSnapshotNow(),this.indexDurationMs=Date.now()-a,this.lastIndexedAt=new Date().toISOString(),this.schedulePersist()}),this.syncWatchersToDirs(),this.setupPolling()}finally{this.isIndexing=!1}}async detectProviderDirs(){let a=new Map,b=[];for(let c of(0,d.R0)())for(let d of c.getDirs())await q(d)&&!a.has(d)&&(a.set(d,c),b.push(d));let c=[],e=[];for(let b of a.keys())this.dirToProvider.has(b)||c.push(b);for(let b of this.dirToProvider.keys())a.has(b)||e.push(b);return this.dirToProvider=a,this.existingDirs=b,{added:c,removed:e}}async fullScan(a){let b=[];for(let[a,c]of this.dirToProvider)for(let d of(await r(a,c)))b.push({file:d,provider:c});let c=new Set(b.map(a=>a.file));for(let d of(await Promise.all(b.map(async({file:b,provider:c})=>{try{let d=await e.promises.stat(b),f=a.get(b);if(f&&f.source===c.id&&f.parserVersion===c.parserVersion&&f.mtimeMs===d.mtimeMs&&f.size===d.size)return void this.files.set(b,{source:c.id,parserVersion:c.parserVersion,mtimeMs:d.mtimeMs,size:d.size,assistantRecords:f.assistantRecords,userRecords:f.userRecords,parentLinks:f.parentLinks});let g=await c.parseFile(b);this.files.set(b,{source:c.id,parserVersion:c.parserVersion,mtimeMs:d.mtimeMs,size:d.size,assistantRecords:g.assistant,userRecords:g.user,parentLinks:g.parentLinks})}catch(a){this.recordError(`parse ${b}: ${a.message}`)}})),Array.from(this.files.keys())))c.has(d)||this.files.delete(d)}syncWatchersToDirs(){for(let[a,b]of this.watchers)if(!this.dirToProvider.has(a)){try{b.close()}catch{}this.watchers.delete(a)}for(let[a,b]of this.dirToProvider)if(!this.watchers.has(a))try{let c=(0,e.watch)(a,{recursive:!0},(c,d)=>{if(!d||"string"!=typeof d||!d.endsWith(".jsonl"))return;let e=g().join(a,d);this.scheduleFileReconcile(e,b)});c.on("error",b=>{this.recordError(`watcher ${a}: ${b.message}`)}),this.watchers.set(a,c)}catch(b){this.recordError(`watch ${a}: ${b.message}`)}}setupPolling(){this.pollTimer&&clearInterval(this.pollTimer);let a="mcp"===this.cacheName,b=process.env.CCGAUGE_POLL_FALLBACK;"1"!==b&&("0"===b||a)||(this.pollTimer=setInterval(()=>{this.pollOnce().catch(a=>this.recordError(`poll: ${a.message}`))},3e4),this.pollTimer.unref?.())}async pollOnce(){await this.runExclusive(async()=>{let a=Date.now(),b=await this.detectProviderDirs(),c=b.added.length>0||b.removed.length>0;c&&this.syncWatchersToDirs();let d=[];for(let[a,b]of this.dirToProvider)for(let c of(await r(a,b)))d.push({file:c,provider:b});let f=new Set(d.map(a=>a.file));for(let a of(await Promise.all(d.map(async({file:a,provider:b})=>{try{let d=await e.promises.stat(a),f=this.files.get(a);if(f&&f.mtimeMs===d.mtimeMs&&f.size===d.size)return;let g=await b.parseFile(a);this.files.set(a,{source:b.id,parserVersion:b.parserVersion,mtimeMs:d.mtimeMs,size:d.size,assistantRecords:g.assistant,userRecords:g.user,parentLinks:g.parentLinks}),c=!0}catch(b){this.recordError(`poll-parse ${a}: ${b.message}`)}})),Array.from(this.files.keys())))f.has(a)||(this.files.delete(a),c=!0);c&&(this.lastWorkStart=a,this.scheduleSnapshotRebuild(),this.schedulePersist())})}scheduleFileReconcile(a,b){let c=this.fileDebouncers.get(a);c&&clearTimeout(c);let d=setTimeout(()=>{this.fileDebouncers.delete(a),this.reconcileFile(a,b).catch(b=>this.recordError(`reconcile ${a}: ${b.message}`))},200);d.unref?.(),this.fileDebouncers.set(a,d)}async reconcileFile(a,b){await this.runExclusive(async()=>{let c=Date.now(),d=null;try{d=await e.promises.stat(a)}catch{}if(!d||!d.isFile()){this.files.has(a)&&(this.files.delete(a),this.lastWorkStart=c,this.scheduleSnapshotRebuild(),this.schedulePersist());return}let f=this.files.get(a);if(!f||f.mtimeMs!==d.mtimeMs||f.size!==d.size)try{let e=await b.parseFile(a);this.files.set(a,{source:b.id,parserVersion:b.parserVersion,mtimeMs:d.mtimeMs,size:d.size,assistantRecords:e.assistant,userRecords:e.user,parentLinks:e.parentLinks}),this.lastWorkStart=c,this.scheduleSnapshotRebuild(),this.schedulePersist()}catch(b){this.recordError(`parse ${a}: ${b.message}`)}})}scheduleSnapshotRebuild(){this.snapshotRebuildTimer&&clearTimeout(this.snapshotRebuildTimer),this.snapshotRebuildTimer=setTimeout(()=>{this.snapshotRebuildTimer=null,this.rebuildSnapshotNow()},100),this.snapshotRebuildTimer.unref?.()}rebuildSnapshotNow(){let a=Date.now(),b=this.lastWorkStart??a,c=[],d=[],e={},f=0,g={claude:{source:"claude",filesScanned:0,recordsParsed:0,assistantRecords:0,scannedDirs:[]},codex:{source:"codex",filesScanned:0,recordsParsed:0,assistantRecords:0,scannedDirs:[]}};for(let[a,b]of this.dirToProvider)g[b.id].scannedDirs.push(a);for(let a of this.files.values()){for(let[b,f]of(c.push(...a.assistantRecords),d.push(...a.userRecords),a.parentLinks))e[b]=f;f+=a.assistantRecords.length+a.userRecords.length,g[a.source].filesScanned+=1,g[a.source].recordsParsed+=a.assistantRecords.length+a.userRecords.length}let h=(function(a){let b=new Map;for(let c of a){let a=function(a){let b=`${a.source}:`;return a.messageId&&a.requestId?`${b}${a.messageId}::${a.requestId}`:a.messageId?`${b}mid:${a.messageId}`:a.requestId?`${b}req:${a.requestId}`:`${b}uuid:${a.uuid}`}(c),d=b.get(a);if(!d){b.set(a,c);continue}let e=c.timestamp<d.timestamp?c:d,f=e===c?d:c;b.set(a,function(a,b){if(!b.toolUses?.length)return a;let c=new Set((a.toolUses??[]).map(a=>a.id)),d=b.toolUses.filter(a=>!c.has(a.id));return d.length?{...a,toolUses:[...a.toolUses??[],...d]}:a}(e,f))}return Array.from(b.values())})(c).sort((a,b)=>a.timestamp.localeCompare(b.timestamp)),i=(function(a){let b=new Set;return a.filter(a=>{let c=a.uuid;return!c||!b.has(c)&&(b.add(c),!0)})})(d).sort((a,b)=>a.timestamp.localeCompare(b.timestamp));for(let a of(!function({assistantRecords:a,userRecords:b,parentMap:c}){let d=new Map;for(let b of a){if(b.isSidechain||!b.sessionId)continue;let a=d.get(b.sessionId);a||(a=[],d.set(b.sessionId,a)),a.push(b)}for(let a of d.values())a.sort((a,b)=>a.timestamp<b.timestamp?-1:+(a.timestamp>b.timestamp));let e=new Map;for(let a of b){if(!a.isSidechain)continue;let b=e.get(a.filePath);(!b||a.timestamp<b.timestamp)&&e.set(a.filePath,a)}let f={subagentFiles:0,relinked:0,orphans:0,alreadyLinked:0};for(let[a,b]of e){let e,g=function(a){let b=n.exec(a);return b?b[1]:null}(a);if(!g)continue;if(f.subagentFiles+=1,null!=c[b.uuid]){f.alreadyLinked+=1;continue}let h=d.get(g);if(!h||0===h.length){f.orphans+=1;continue}let i=b.timestamp;for(let a=h.length-1;a>=0;a-=1)if(h[a].timestamp<=i){e=h[a];break}e||(e=h[0]),c[b.uuid]=e.uuid,f.relinked+=1}}({assistantRecords:h,userRecords:i,parentMap:e}),h)){var j;a.isSidechain&&(a.isWorkflowSubagent="workflow"===(j=a.filePath,n.test(j)?o.test(j)?"workflow":"task":null))}for(let a of h)g[a.source].assistantRecords+=1;let k={filesScanned:this.files.size,recordsParsed:f,assistantRecords:h.length,durationMs:Date.now()-b,scannedDirs:this.existingDirs};this.snapshot={records:h,userRecords:i,parentMap:e,stats:k,bySource:Object.values(g)},this.lastWorkStart=null}getSnapshot(){if(!this.snapshot)throw Error("Indexer not initialized — call init() first.");return this.snapshot}async forceRescan(){let a=!this.initPromise;if(await this.init(),a)return this.snapshot;if(this.rescanPromise)return this.rescanPromise;this.rescanPromise=this.runRescan();try{return await this.rescanPromise}finally{this.rescanPromise=null}}async runRescan(){this.isIndexing=!0;try{return await this.runExclusive(async()=>{let a=Date.now();return this.lastWorkStart=a,this.snapshotRebuildTimer&&(clearTimeout(this.snapshotRebuildTimer),this.snapshotRebuildTimer=null),this.persistTimer&&(clearTimeout(this.persistTimer),this.persistTimer=null),this.files.clear(),await this.detectProviderDirs(),await this.fullScan(new Map),this.rebuildSnapshotNow(),this.indexDurationMs=Date.now()-a,this.lastIndexedAt=new Date().toISOString(),this.syncWatchersToDirs(),this.schedulePersist(),this.snapshot})}finally{this.isIndexing=!1}}getStatus(){let a=this.snapshot;return{initialized:null!==a,isIndexing:this.isIndexing,lastIndexedAt:this.lastIndexedAt,indexDurationMs:this.indexDurationMs,filesIndexed:this.files.size,recordsIndexed:a?.stats.assistantRecords??0,bySource:a?.bySource??[],watchers:this.watchers.size,errors:this.errors.slice(-20),pendingReconciles:this.fileDebouncers.size,loadedFromDisk:this.loadedFromDisk}}schedulePersist(){this.persistTimer&&clearTimeout(this.persistTimer),this.persistTimer=setTimeout(()=>{this.persistTimer=null;let a=[];for(let[b,c]of this.files)a.push({filePath:b,source:c.source,parserVersion:c.parserVersion,mtimeMs:c.mtimeMs,size:c.size,assistantRecords:c.assistantRecords,userRecords:c.userRecords,parentLinks:c.parentLinks});m({savedAt:new Date().toISOString(),files:a},this.cacheName).catch(a=>this.recordError(`persist: ${a.message}`))},2e3),this.persistTimer.unref?.()}recordError(a){let b=`${new Date().toISOString()} ${function(a){let b=(0,h.homedir)();if(!b)return a;let c=new Set([b]);"win32"===process.platform&&(c.add(b.replace(/\\/g,"/")),c.add(b.replace(/\\/g,"\\\\")),c.add("\\\\?\\"+b),c.add("\\\\?\\"+b.replace(/\\/g,"/")));let d=a;for(let a of c){let b=a.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");d=d.replace(RegExp(b,"g"),"~")}return d}(a)}`;this.errors.push(b),this.errors.length>40&&this.errors.splice(0,this.errors.length-20),process.env.CCGAUGE_DEBUG&&console.error(`[ccgauge:indexer] ${new Date().toISOString()} ${a}`)}disposeWatchers(){for(let a of this.watchers.values())try{a.close()}catch{}this.watchers.clear()}dispose(){for(let a of(this.disposeWatchers(),this.pollTimer&&clearInterval(this.pollTimer),this.snapshotRebuildTimer&&clearTimeout(this.snapshotRebuildTimer),this.persistTimer&&clearTimeout(this.persistTimer),this.fileDebouncers.values()))clearTimeout(a);this.fileDebouncers.clear()}}async function q(a){try{return(await e.promises.stat(a)).isDirectory()}catch{return!1}}async function r(a,b){let c=[];async function d(a,f){let h;if(!(f>8)){try{h=await e.promises.readdir(a,{withFileTypes:!0})}catch{return}for(let e of h){let h=g().join(a,e.name);if(e.isDirectory()){if(b.shouldSkipDir(e.name))continue;await d(h,f+1)}else e.isFile()&&e.name.endsWith(".jsonl")&&c.push(h)}}}return await d(a,0),c}function s(a=j){let b=(globalThis.__ccgaugeIndexers||(globalThis.__ccgaugeIndexers=new Map),globalThis.__ccgaugeIndexers),c=b.get(a);return c||(c=new p(a),b.set(a,c)),c}async function t(a={}){let b=s();return a.force?b.forceRescan():(await b.init(),b.getSnapshot())}function u(){return(0,d.R0)().map(a=>({source:a.id,dirs:a.getDirs()}))}function v(){return s().getStatus()}}};
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 1,
|
|
3
3
|
"functions": {
|
|
4
|
-
"/api/
|
|
4
|
+
"/api/pricing/refresh": {},
|
|
5
5
|
"/api/blocks": {},
|
|
6
|
-
"/api/
|
|
6
|
+
"/api/projects": {},
|
|
7
7
|
"/api/scan": {},
|
|
8
8
|
"/api/sessions": {},
|
|
9
|
+
"/api/pricing": {},
|
|
9
10
|
"/api/usage": {},
|
|
10
11
|
"/api/export/usage": {},
|
|
11
12
|
"/api/turns": {}
|
|
@@ -17,11 +17,11 @@
|
|
|
17
17
|
"wasm": [],
|
|
18
18
|
"assets": [],
|
|
19
19
|
"env": {
|
|
20
|
-
"__NEXT_BUILD_ID": "
|
|
21
|
-
"NEXT_SERVER_ACTIONS_ENCRYPTION_KEY": "
|
|
22
|
-
"__NEXT_PREVIEW_MODE_ID": "
|
|
23
|
-
"__NEXT_PREVIEW_MODE_SIGNING_KEY": "
|
|
24
|
-
"__NEXT_PREVIEW_MODE_ENCRYPTION_KEY": "
|
|
20
|
+
"__NEXT_BUILD_ID": "qXwEuv57GWCs9fn7xJz_q",
|
|
21
|
+
"NEXT_SERVER_ACTIONS_ENCRYPTION_KEY": "x3577FTii5EbSznWC+QrkshLeCoaiugCQkiGtR/fThY=",
|
|
22
|
+
"__NEXT_PREVIEW_MODE_ID": "d3d65ef9127ec9d7c185c079ac8f004b",
|
|
23
|
+
"__NEXT_PREVIEW_MODE_SIGNING_KEY": "05ecc32a8604b51f43cc399a3adad51873ffc0cf1842fefeddc6e4593fffbd6b",
|
|
24
|
+
"__NEXT_PREVIEW_MODE_ENCRYPTION_KEY": "038212fc024461ef1b9c86957d1456fca4cccedef6067ab99d3a5763bb342859"
|
|
25
25
|
}
|
|
26
26
|
}
|
|
27
27
|
},
|
|
@@ -1 +1 @@
|
|
|
1
|
-
<!DOCTYPE html><html><head><meta charSet="utf-8" data-next-head=""/><meta name="viewport" content="width=device-width" data-next-head=""/><title data-next-head="">500: Internal Server Error</title><noscript data-n-css=""></noscript><script defer="" noModule="" src="/_next/static/chunks/polyfills-42372ed130431b0a.js"></script><script src="/_next/static/chunks/webpack-73dfee69c0ddc58e.js" defer=""></script><script src="/_next/static/chunks/framework-1a308e28e19f1a97.js" defer=""></script><script src="/_next/static/chunks/main-2cb79280eaf22774.js" defer=""></script><script src="/_next/static/chunks/pages/_app-5addca2b3b969fde.js" defer=""></script><script src="/_next/static/chunks/pages/_error-022e4ac7bbb9914f.js" defer=""></script><script src="/_next/static/
|
|
1
|
+
<!DOCTYPE html><html><head><meta charSet="utf-8" data-next-head=""/><meta name="viewport" content="width=device-width" data-next-head=""/><title data-next-head="">500: Internal Server Error</title><noscript data-n-css=""></noscript><script defer="" noModule="" src="/_next/static/chunks/polyfills-42372ed130431b0a.js"></script><script src="/_next/static/chunks/webpack-73dfee69c0ddc58e.js" defer=""></script><script src="/_next/static/chunks/framework-1a308e28e19f1a97.js" defer=""></script><script src="/_next/static/chunks/main-2cb79280eaf22774.js" defer=""></script><script src="/_next/static/chunks/pages/_app-5addca2b3b969fde.js" defer=""></script><script src="/_next/static/chunks/pages/_error-022e4ac7bbb9914f.js" defer=""></script><script src="/_next/static/qXwEuv57GWCs9fn7xJz_q/_buildManifest.js" defer=""></script><script src="/_next/static/qXwEuv57GWCs9fn7xJz_q/_ssgManifest.js" defer=""></script></head><body><div id="__next"><div style="font-family:system-ui,"Segoe UI",Roboto,Helvetica,Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji";height:100vh;text-align:center;display:flex;flex-direction:column;align-items:center;justify-content:center"><div style="line-height:48px"><style>body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}</style><h1 class="next-error-h1" style="display:inline-block;margin:0 20px 0 0;padding-right:23px;font-size:24px;font-weight:500;vertical-align:top">500</h1><div style="display:inline-block"><h2 style="font-size:14px;font-weight:400;line-height:28px">Internal Server Error<!-- -->.</h2></div></div></div></div><script id="__NEXT_DATA__" type="application/json">{"props":{"pageProps":{"statusCode":500}},"page":"/_error","query":{},"buildId":"qXwEuv57GWCs9fn7xJz_q","nextExport":true,"isFallback":false,"gip":true,"scriptLoader":[]}</script></body></html>
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"node":{},"edge":{},"encryptionKey":"
|
|
1
|
+
{"node":{},"edge":{},"encryptionKey":"x3577FTii5EbSznWC+QrkshLeCoaiugCQkiGtR/fThY="}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[148],{51148:(e,t,s)=>{s.d(t,{CY:()=>d,s9:()=>u,kj:()=>g});var o=s(95155),i=s(12115),n=s(20063),a=s(79808);let r="ccgauge_locale",c=(0,i.createContext)({locale:a.Xn,setLocale:()=>{},t:e=>e}),l="ccgauge.locale";function d(e){let{initialLocale:t,children:s}=e,d=(0,n.useRouter)();(0,i.useEffect)(()=>{try{let e=localStorage.getItem(l);e&&e!==t&&("en"===e||"zh"===e)&&(document.cookie="".concat(r,"=").concat(e,"; path=/; max-age=").concat(31536e3,"; SameSite=Lax"),d.refresh())}catch(e){}},[]);let u=(0,i.useCallback)(e=>{try{localStorage.setItem(l,e)}catch(e){}document.cookie="".concat(r,"=").concat(e,"; path=/; max-age=").concat(31536e3,"; SameSite=Lax"),d.refresh()},[d]),g=(0,i.useCallback)((e,s)=>(0,a.nA)(t,e,s),[t]),m=(0,i.useMemo)(()=>({locale:t,setLocale:u,t:g}),[t,u,g]);return(0,o.jsx)(c.Provider,{value:m,children:s})}function u(){return(0,i.useContext)(c)}function g(){return(0,i.useContext)(c).t}},79808:(e,t,s)=>{s.d(t,{Xn:()=>i,YZ:()=>o,nA:()=>a});let o=["en","zh"],i="en",n={en:{"brand.tagline":"usage dashboard for AI coding CLIs","nav.overview":"Overview","nav.usage":"Usage","nav.sessions":"Sessions","nav.projects":"Projects","nav.models":"Models","nav.tools":"Tools","nav.analytics":"Analytics","nav.settings":"Settings","nav.docs":"Docs","nav.localBadge":"local","nav.source":"Data source","source.claude":"Claude","source.codex":"Codex","source.all":"All","cost.footnote.codex":"Cost shown is the OpenAI API equivalent (subscription plans pay differently).","common.requests":"requests","common.tokens":"tokens","common.cost":"Cost","common.savedViaCache":"Saved {amount} via cache","common.savedTodayViaCache":"Saved {amount} today","common.live":"live","common.allModels":"All","common.allProjects":"All","common.unknown":"(unknown)","common.session":"Session","common.sessions":"sessions","common.projects":"projects","common.req":"req","common.day":"day","common.days":"days","common.activity":"activity","common.fallbackPrice":"fallback price","common.thinking":"thinking","common.lastActivity":"last activity","common.empty.title":"No usage data yet","common.empty.desc":"Open Claude Code, send a message, then refresh.","common.refresh":"Refresh","common.search":"Search…","common.searchPlaceholder":"Search model, project, session, tool…","common.exportCsv":"Export CSV","common.rows":"{count} rows","common.prev":"‹ Prev","common.next":"Next ›","common.first":"\xab","common.last":"\xbb","common.pageOf":"Page {page} of {total}","common.allSessions":"← All sessions","common.allProjectsLink":"← All projects","common.noMatchingRows":"No matching rows","range.label":"Date range","range.today":"Today","range.7d":"7d","range.30d":"30d","range.90d":"90d","range.all":"All","range.custom":"Custom","range.customApply":"Apply","range.from":"From","range.to":"To","range.cancel":"Cancel","gran.label":"Granularity","gran.hour":"Hour","gran.day":"Day","gran.week":"Week","gran.month":"Month","overview.title":"Overview","overview.subtitle":"{count} requests across {files} files \xb7 scan in {ms}ms","overview.subtitle.empty":"Scanned {dirs} directory(ies). Open Claude Code, send a message, then refresh.","overview.empty.title":"No usage data yet","overview.kpi.tokensToday":"Tokens today","overview.kpi.costToday":"Cost today","overview.kpi.thisMonth":"This month","overview.kpi.cacheHit":"Cache hit rate","overview.kpi.topModel":"Top model","overview.kpi.activeSessions":"Sessions today","overview.kpi.activeSessions.hint":"{count} project(s)","overview.kpi.thisMonth.hint":"{tokens} tokens \xb7 {req} req","overview.kpi.tokensToday.hint":"{count} requests","overview.kpi.topModel.hint":"{pct} of cost this month","overview.kpi.cacheHit.hint":"Saved {amount} today","overview.delta.title":"vs yesterday","overview.delta.firstTime":"NEW","common.loading":"Loading…","common.error.title":"Something went wrong","common.error.desc":"Failed to load this page. Try again.","common.error.retry":"Retry","overview.trend.title":"Usage trend","overview.trend.desc":"Last 30 days \xb7 {metric}","overview.trend.desc.tokens":"stacked by token type","overview.trend.desc.conversations":"conversations per day","overview.trend.metric.tokens":"Tokens","overview.trend.metric.conversations":"Conversations","overview.trend.activeDays":"{n} day with activity","overview.trend.activeDays.plural":"{n} days with activity","overview.costByModel.title":"Cost by model","overview.costByModel.desc":"This month, sorted by spend","activity.title":"Activity","activity.subtitle":"Lifetime stats and when you usually code","activity.sessions":"Sessions","activity.messages":"Messages","activity.totalTokens":"Total tokens","activity.activeDays":"Active days","activity.currentStreak":"Current streak","activity.longestStreak":"Longest streak","activity.streakCombinedLabel":"Streak (cur / max)","activity.streakCombinedValue":"{current} / {longest} d","activity.peakHour":"Peak hour","activity.favoriteModel":"Favorite model","activity.streakValue":"{n}d","activity.dow.0":"Sun","activity.dow.1":"Mon","activity.dow.2":"Tue","activity.dow.3":"Wed","activity.dow.4":"Thu","activity.dow.5":"Fri","activity.dow.6":"Sat","activity.heatmap.tooltip":"{dow} \xb7 {hour} \xb7 {count} messages","activity.heatmap.messages":"Messages","activity.heatmap.tokens":"Tokens","activity.heatmap.shareLabel":"Share","activity.heatmap.intensityLabel":"Of peak","activity.heatmap.empty":"No activity","activity.comparison":"You've used ~{multiplier}\xd7 more tokens than {ref}.","activity.ref.haiku":"a haiku","activity.ref.tweet":"a tweet","activity.ref.littlePrince":"The Little Prince","activity.ref.gatsby":"The Great Gatsby","activity.ref.hobbit":"The Hobbit","activity.ref.lotrTrilogy":"the Lord of the Rings trilogy","activity.ref.warAndPeace":"War and Peace","activity.ref.harryPotterAll":"all 7 Harry Potter books","activity.ref.encyclopediaBritannica":"the Encyclopedia Britannica","activity.ref.wikipediaEn":"all of English Wikipedia","block.title":"Active 5h block","block.remaining":"remaining","block.elapsed":"Time elapsed {pct}%","block.tokensSuffix":"tokens","block.spentSoFar":"Spent so far","block.burnPerMin":"Burn / min","block.projectedTotal":"Projected total","block.requests":"Requests","block.empty":"No active block","block.emptyDesc":"Send a message in {cli} to start one.","block.disclaimer":"Wall-clock progress of the 5h window — not your plan quota.","chart.legend.input":"Input","chart.legend.output":"Output","chart.legend.cacheRead":"Cache read","chart.legend.cacheWrite":"Cache write","chart.tooltip.total":"Total","chart.tooltip.cost":"Cost","chart.tooltip.requests":"Requests","chart.tooltip.conversations":"Conversations","chart.empty":"No data in this range","chart.empty.short":"No data","usage.title":"Usage","usage.subtitle":"{count} turns in selected range","usage.col.calls":"Calls","usage.col.userMessage":"Prompt","usage.overview.label":"Overview","usage.overview.show":"Show overview (KPIs + trend)","usage.overview.hide":"Hide overview (KPIs + trend)","usage.turn.expand":"Expand","usage.turn.collapse":"Collapse","usage.turn.callsCount":"{count} calls","usage.turn.noPrompt":"(no user text)","usage.requests.desc":"One row per turn (user message + tool calls); click ▸ to expand","usage.kpi.totalTokens":"Total tokens","usage.kpi.totalCost":"Total cost","usage.kpi.cacheSaved":"Cache saved","usage.kpi.cacheHit":"Cache hit","usage.trend":"Trend","usage.trend.gran":"Granularity: {gran}","usage.requests.title":"Requests","usage.col.time":"Time","usage.col.duration":"Duration","usage.col.model":"Model","usage.col.project":"Project","usage.col.session":"Session","usage.col.input":"Input","usage.col.output":"Output","usage.col.cacheRead":"Cache R","usage.col.cacheWrite":"Cache W","usage.col.cost":"Cost","usage.col.tools":"Tools","usage.col.total":"Total","usage.badge.workflow":"Workflow","usage.badge.workflowHint":"Fanned out {count} parallel sub-agent(s) (Workflow / ultracode)","usage.badge.fast":"fast","usage.badge.fastHint":"Codex priority/fast service tier is active — these requests are billed at a higher rate (2x+).","usage.columns.button":"Columns","usage.columns.title":"Visible columns","usage.columns.reset":"Reset","usage.breakdown.title":"Token breakdown","usage.breakdown.headerTokens":"Tokens","usage.breakdown.headerCost":"Cost","usage.breakdown.total":"Total","usage.breakdown.reasoning":"reasoning","usage.breakdown.reasoningNote":"incl. above","filter.modelLabel":"Model","filter.projectLabel":"Project","filter.modelAll":"Model: All","filter.projectAll":"Project: All","filter.modelSingle":"Model: {value}","filter.projectSingle":"Project: {value}","filter.modelMulti":"Model: {count}","filter.projectMulti":"Project: {count}","filter.clearAll":"Clear all","filter.noOptions":"No options","sessions.title":"Sessions","sessions.subtitle":"{count} sessions \xb7 sorted by most recent activity","sessions.col.session":"Session","sessions.col.project":"Project","sessions.col.models":"Model(s)","sessions.col.requests":"Requests","sessions.col.tokens":"Tokens","sessions.col.cost":"Cost","sessions.col.duration":"Duration","sessions.col.lastActivity":"Last activity","sessions.untitled":"Session {hash}","sessions.empty":"No sessions yet","session.kpi.requests":"Requests","session.kpi.totalTokens":"Total tokens","session.kpi.cost":"Cost","session.kpi.duration":"Duration","session.timeline.title":"Message timeline","session.timeline.desc":"In order; newest at the bottom","session.perMessage.title":"Per-message tokens","session.modelsInSession":"Models in this session","session.modelLine":"{requests} req \xb7 {tokens} tokens","session.token.in":"in","session.token.out":"out","session.token.cacheR":"cache r","session.token.cacheW":"cache w","projects.title":"Projects","projects.subtitle":"{count} projects \xb7 sorted by spend","projects.empty":"No projects yet","projects.stat.sessions":"Sessions","projects.stat.requests":"Requests","projects.stat.tokens":"Tokens","project.activity":"Activity (last 30 days)","project.sessions.title":"Sessions ({count})","models.title":"Models","models.subtitle":"{count} model(s) used in total","models.empty":"No model usage yet","models.share.cost":"Cost share","models.share.tokens":"Tokens share","models.share.cacheHit":"Cache hit","models.field.requests":"Requests","models.field.savedByCache":"Saved by cache","models.field.input1M":"Input / 1M","models.field.output1M":"Output / 1M","models.field.cacheRead1M":"Cache read / 1M","models.field.pctOfTotal":"{pct} of total spend \xb7 {tokens} tokens","models.eachTrend":"Combined trend (last 30 days)","tools.title":"Tools & skills","tools.subtitle":"Estimated context footprint \xb7 {count} entries","tools.empty":"No tool or skill usage yet","tools.emptyDesc":"Once Claude Code invokes tools or skills, their estimated context footprint shows up here.","tools.dimension":"Breakdown dimension","tools.by.skill":"By skill","tools.by.tool":"By tool","tools.by.mcp":"By MCP server","tools.estimate":"Estimated from payload size (~4 chars/token), not Anthropic per-tool billing. Trust the ranking, not the absolute numbers.","tools.kind.skill":"SKILL","tools.kind.tool":"TOOL","tools.kind.mcp":"MCP","tools.topConsumer":"top consumer","tools.field.estTokens":"Est. context tokens","tools.field.invocations":"Invocations","tools.field.sessionsN":"{n} sessions","tools.field.avgPerCall":"Avg / call","tools.field.largest":"Largest single","tools.formula":"≈ {avg} tokens/call \xd7 {calls} calls (estimated)","settings.title":"Settings","settings.subtitle":"Data sources, pricing, and behavior","settings.dataSources.title":"Data sources","settings.dataSources.desc":"ccgauge scans these locations for JSONL files","settings.dataSources.active":"active","settings.dataSources.notPresent":"not present","settings.dataSources.envHint":"Override with {env1} or {env2} environment variables (the dashboard appends {appendix}).","settings.rescan":"Rescan now","settings.rescanning":"Rescanning…","settings.scanStats.title":"Scan stats","settings.scanStats.files":"Files scanned","settings.scanStats.records":"Records parsed","settings.scanStats.assistant":"Assistant records (deduped)","settings.scanStats.duration":"Scan duration","settings.pricing.title":"Pricing table","settings.pricing.desc":"USD per 1M tokens \xb7 fuzzy match for date-suffixed model names","settings.pricing.col.model":"Model","settings.pricing.col.input":"Input","settings.pricing.col.output":"Output","settings.pricing.col.write5m":"Cache write 5m","settings.pricing.col.write1h":"Cache write 1h","settings.pricing.col.read":"Cache read","settings.pricing.refresh":"Refresh prices","settings.pricing.refreshing":"Refreshing…","settings.pricing.sourceBuiltin":"Built-in snapshot","settings.pricing.sourceCache":"Updated from LiteLLM \xb7 {time}","settings.pricing.refreshOk":"Prices updated","settings.pricing.refreshFail":"Refresh failed — keeping current prices","settings.pricing.offline":"Offline — price refresh disabled","settings.preferences.title":"Preferences","settings.preferences.language":"Language","settings.preferences.theme":"Theme","settings.theme.light":"Light","settings.theme.dark":"Dark","settings.theme.system":"System","settings.about.title":"About","settings.about.subtitle":"Version {version} \xb7 MIT licensed","settings.about.line1":"Local-first: your data never leaves your machine and there's no telemetry. The only optional network call refreshes the pricing table from LiteLLM — disable it with CCGAUGE_OFFLINE=1.","settings.about.line2":"Read-only: ccgauge only reads JSONL files, never writes back to ~/.claude.","settings.about.line3":'Cache: scan results are memoized for 5s; click "Rescan" to force a fresh read.',"settings.about.line4":"Stop with Ctrl+C in the terminal that started ccgauge.","settings.indexer.desc":"Background indexer keeps the cache fresh via file watchers.","settings.indexer.lastIndexedAt":"Last indexed","settings.indexer.indexDuration":"Last index time","settings.indexer.watchers":"Active watchers","settings.indexer.loadedFromDisk":"Loaded from disk","settings.indexer.status":"Status","settings.indexer.indexing":"indexing…","settings.indexer.idle":"idle","settings.indexer.recentErrors":"Recent indexer errors","common.yes":"yes","common.no":"no","lang.label":"Language","lang.en":"English","lang.zh":"中文","theme.label":"Theme"},zh:{"brand.tagline":"AI 编程 CLI 的本地用量看板","nav.overview":"概览","nav.usage":"用量","nav.sessions":"会话","nav.projects":"项目","nav.models":"模型","nav.tools":"工具","nav.analytics":"分析","nav.settings":"设置","nav.docs":"文档","nav.localBadge":"本地","nav.source":"数据源","source.claude":"Claude","source.codex":"Codex","source.all":"全部","cost.footnote.codex":"按 OpenAI API 单价折算估值(订阅计划实际计费不同)","common.requests":"次请求","common.tokens":"tokens","common.cost":"花费","common.savedViaCache":"通过缓存节省 {amount}","common.savedTodayViaCache":"今日缓存节省 {amount}","common.live":"进行中","common.allModels":"全部","common.allProjects":"全部","common.unknown":"(未知)","common.session":"会话","common.sessions":"个会话","common.projects":"个项目","common.req":"请求","common.day":"天","common.days":"天","common.activity":"活跃","common.fallbackPrice":"使用兜底单价","common.thinking":"思考","common.lastActivity":"最近活跃","common.empty.title":"暂无用量数据","common.empty.desc":"打开 Claude Code 发送一条消息后刷新本页。","common.refresh":"刷新","common.search":"搜索…","common.searchPlaceholder":"搜索模型 / 项目 / 会话 / 工具…","common.exportCsv":"导出 CSV","common.rows":"{count} 行","common.prev":"‹ 上一页","common.next":"下一页 ›","common.first":"\xab","common.last":"\xbb","common.pageOf":"第 {page} / {total} 页","common.allSessions":"← 返回会话列表","common.allProjectsLink":"← 返回项目列表","common.noMatchingRows":"没有匹配的记录","range.label":"时间范围","range.today":"今天","range.7d":"7 天","range.30d":"30 天","range.90d":"90 天","range.all":"全部","range.custom":"自定义","range.customApply":"应用","range.from":"开始","range.to":"结束","range.cancel":"取消","gran.label":"粒度","gran.hour":"小时","gran.day":"天","gran.week":"周","gran.month":"月","overview.title":"概览","overview.subtitle":"{count} 次请求,覆盖 {files} 个文件 \xb7 扫描耗时 {ms}ms","overview.subtitle.empty":"已扫描 {dirs} 个目录。打开 Claude Code 发一条消息后刷新本页。","overview.empty.title":"暂无用量数据","overview.kpi.tokensToday":"今日 tokens","overview.kpi.costToday":"今日花费","overview.kpi.thisMonth":"本月累计","overview.kpi.cacheHit":"缓存命中率","overview.kpi.topModel":"主力模型","overview.kpi.activeSessions":"今日会话","overview.kpi.activeSessions.hint":"涉及 {count} 个项目","overview.kpi.thisMonth.hint":"{tokens} tokens \xb7 {req} 次请求","overview.kpi.tokensToday.hint":"{count} 次请求","overview.kpi.topModel.hint":"本月成本占比 {pct}","overview.kpi.cacheHit.hint":"今日缓存节省 {amount}","overview.delta.title":"相比昨日","overview.delta.firstTime":"首次","common.loading":"加载中…","common.error.title":"出错了","common.error.desc":"加载失败,请重试。","common.error.retry":"重试","overview.trend.title":"用量趋势","overview.trend.desc":"近 30 天 \xb7 {metric}","overview.trend.desc.tokens":"按 token 类型堆叠","overview.trend.desc.conversations":"每日对话次数","overview.trend.metric.tokens":"Token","overview.trend.metric.conversations":"对话次数","overview.trend.activeDays":"{n} 天有数据","overview.trend.activeDays.plural":"{n} 天有数据","overview.costByModel.title":"按模型成本分布","overview.costByModel.desc":"本月,按花费排序","activity.title":"活动统计","activity.subtitle":"总览数据 + 每天什么时段最忙","activity.sessions":"会话","activity.messages":"消息","activity.totalTokens":"总 tokens","activity.activeDays":"活跃天数","activity.currentStreak":"当前连续","activity.longestStreak":"最长连续","activity.streakCombinedLabel":"当前 / 最长连续","activity.streakCombinedValue":"{current} / {longest} 天","activity.peakHour":"高峰小时","activity.favoriteModel":"最常用模型","activity.streakValue":"{n} 天","activity.dow.0":"周日","activity.dow.1":"周一","activity.dow.2":"周二","activity.dow.3":"周三","activity.dow.4":"周四","activity.dow.5":"周五","activity.dow.6":"周六","activity.heatmap.tooltip":"周{dow} \xb7 {hour} \xb7 {count} 条消息","activity.heatmap.messages":"消息数","activity.heatmap.tokens":"Tokens","activity.heatmap.shareLabel":"占总数","activity.heatmap.intensityLabel":"占峰值","activity.heatmap.empty":"无活动","activity.comparison":"你用掉的 token 大约是 {ref} 的 {multiplier}\xd7。","activity.ref.haiku":"一首俳句","activity.ref.tweet":"一条推文","activity.ref.littlePrince":"《小王子》","activity.ref.gatsby":"《了不起的盖茨比》","activity.ref.hobbit":"《霍比特人》","activity.ref.lotrTrilogy":"《魔戒》三部曲","activity.ref.warAndPeace":"《战争与和平》","activity.ref.harryPotterAll":"《哈利\xb7波特》全 7 册","activity.ref.encyclopediaBritannica":"《大英百科全书》","activity.ref.wikipediaEn":"英文维基百科全部","block.title":"当前 5h block","block.remaining":"剩余","block.elapsed":"时间进度 {pct}%","block.tokensSuffix":"tokens","block.spentSoFar":"已花费","block.burnPerMin":"每分钟消耗","block.projectedTotal":"预计总花费","block.requests":"请求数","block.empty":"当前无活跃 block","block.emptyDesc":"在 {cli} 中发送消息会启动一个新 block。","block.disclaimer":"仅是 5h 窗口的钟表进度,不是你的套餐配额。","chart.legend.input":"输入","chart.legend.output":"输出","chart.legend.cacheRead":"缓存读取","chart.legend.cacheWrite":"缓存写入","chart.tooltip.total":"合计","chart.tooltip.cost":"花费","chart.tooltip.requests":"请求数","chart.tooltip.conversations":"对话次数","chart.empty":"区间内无数据","chart.empty.short":"暂无数据","usage.title":"用量明细","usage.subtitle":"当前筛选范围内 {count} 轮对话","usage.kpi.totalTokens":"总 tokens","usage.kpi.totalCost":"总花费","usage.kpi.cacheSaved":"缓存节省","usage.kpi.cacheHit":"缓存命中","usage.trend":"趋势","usage.trend.gran":"粒度:{gran}","usage.requests.title":"对话轮次","usage.requests.desc":"每轮对话一行(用户消息 + 工具调用),点击 ▸ 展开明细","usage.col.calls":"调用","usage.col.userMessage":"提示","usage.overview.label":"概览","usage.overview.show":"显示概览(KPI + 趋势)","usage.overview.hide":"隐藏概览(KPI + 趋势)","usage.turn.expand":"展开","usage.turn.collapse":"收起","usage.turn.callsCount":"{count} 次调用","usage.turn.noPrompt":"(无用户文本)","usage.col.time":"时间","usage.col.duration":"耗时","usage.col.model":"模型","usage.col.project":"项目","usage.col.session":"会话","usage.col.input":"输入","usage.col.output":"输出","usage.col.cacheRead":"缓存读","usage.col.cacheWrite":"缓存写","usage.col.cost":"花费","usage.col.tools":"工具","usage.col.total":"总量","usage.badge.workflow":"工作流","usage.badge.workflowHint":"扇出了 {count} 个并行子代理(Workflow / ultracode)","usage.badge.fast":"fast","usage.badge.fastHint":"Codex 优先 / fast 服务档已开启 —— 这些请求按更高费率计费(2 倍起)。","usage.columns.button":"列","usage.columns.title":"显示列","usage.columns.reset":"重置","usage.breakdown.title":"总量明细","usage.breakdown.headerTokens":"Token","usage.breakdown.headerCost":"花费","usage.breakdown.total":"合计","usage.breakdown.reasoning":"其中推理","usage.breakdown.reasoningNote":"已含在 output","filter.modelLabel":"模型","filter.projectLabel":"项目","filter.modelAll":"模型:全部","filter.projectAll":"项目:全部","filter.modelSingle":"模型:{value}","filter.projectSingle":"项目:{value}","filter.modelMulti":"模型:{count} 个","filter.projectMulti":"项目:{count} 个","filter.clearAll":"清除筛选","filter.noOptions":"没有可选项","sessions.title":"会话","sessions.subtitle":"共 {count} 个会话 \xb7 按最近活跃排序","sessions.col.session":"会话","sessions.col.project":"项目","sessions.col.models":"模型","sessions.col.requests":"请求数","sessions.col.tokens":"Tokens","sessions.col.cost":"花费","sessions.col.duration":"时长","sessions.col.lastActivity":"最近活跃","sessions.untitled":"会话 {hash}","sessions.empty":"暂无会话","session.kpi.requests":"请求数","session.kpi.totalTokens":"总 tokens","session.kpi.cost":"花费","session.kpi.duration":"时长","session.timeline.title":"消息时间线","session.timeline.desc":"按时间正序,最新的在最下方","session.perMessage.title":"逐条消息 tokens","session.modelsInSession":"本会话使用的模型","session.modelLine":"{requests} 次 \xb7 {tokens} tokens","session.token.in":"输入","session.token.out":"输出","session.token.cacheR":"缓存读","session.token.cacheW":"缓存写","projects.title":"项目","projects.subtitle":"共 {count} 个项目 \xb7 按花费排序","projects.empty":"暂无项目","projects.stat.sessions":"会话","projects.stat.requests":"请求","projects.stat.tokens":"Tokens","project.activity":"活跃情况(近 30 天)","project.sessions.title":"会话({count})","models.title":"模型","models.subtitle":"共使用过 {count} 个模型","models.empty":"暂无模型用量","models.share.cost":"成本占比","models.share.tokens":"Tokens 占比","models.share.cacheHit":"缓存命中","models.field.requests":"请求数","models.field.savedByCache":"缓存节省","models.field.input1M":"输入 / 1M","models.field.output1M":"输出 / 1M","models.field.cacheRead1M":"缓存读 / 1M","models.field.pctOfTotal":"占总花费 {pct} \xb7 {tokens} tokens","models.eachTrend":"整体趋势(近 30 天)","tools.title":"工具与技能","tools.subtitle":"预估上下文占用 \xb7 共 {count} 项","tools.empty":"暂无工具或技能用量","tools.emptyDesc":"Claude Code 调用工具或技能后,这里会显示它们预估的上下文占用。","tools.dimension":"拆分维度","tools.by.skill":"按技能","tools.by.tool":"按工具","tools.by.mcp":"按 MCP 服务","tools.estimate":"按体积估算(约 4 字符/token),非 Anthropic 按工具真实计费。看排名,别看绝对值。","tools.kind.skill":"技能","tools.kind.tool":"工具","tools.kind.mcp":"MCP","tools.topConsumer":"占用最高","tools.field.estTokens":"预估上下文 tokens","tools.field.invocations":"调用次数","tools.field.sessionsN":"{n} 个会话","tools.field.avgPerCall":"平均每次","tools.field.largest":"单次最大","tools.formula":"≈ 每次 {avg} tokens \xd7 {calls} 次调用(估算)","settings.title":"设置","settings.subtitle":"数据源、价格表与行为偏好","settings.dataSources.title":"数据源","settings.dataSources.desc":"ccgauge 会扫描以下路径的 JSONL 文件","settings.dataSources.active":"已启用","settings.dataSources.notPresent":"不存在","settings.dataSources.envHint":"可以通过环境变量 {env1} 或 {env2} 自定义路径(看板会自动追加 {appendix})。","settings.rescan":"立即重新扫描","settings.rescanning":"扫描中…","settings.scanStats.title":"扫描统计","settings.scanStats.files":"扫描文件数","settings.scanStats.records":"解析记录数","settings.scanStats.assistant":"去重后 assistant 记录","settings.scanStats.duration":"扫描耗时","settings.pricing.title":"价格表","settings.pricing.desc":"美元 / 1M tokens \xb7 对带日期后缀的模型名做 fuzzy 匹配","settings.pricing.col.model":"模型","settings.pricing.col.input":"输入","settings.pricing.col.output":"输出","settings.pricing.col.write5m":"缓存写入 5 分钟","settings.pricing.col.write1h":"缓存写入 1 小时","settings.pricing.col.read":"缓存读取","settings.pricing.refresh":"刷新价格","settings.pricing.refreshing":"刷新中…","settings.pricing.sourceBuiltin":"内置快照","settings.pricing.sourceCache":"已从 LiteLLM 更新 \xb7 {time}","settings.pricing.refreshOk":"价格已更新","settings.pricing.refreshFail":"刷新失败 — 保留当前价格","settings.pricing.offline":"离线 — 已禁用价格刷新","settings.preferences.title":"偏好设置","settings.preferences.language":"语言","settings.preferences.theme":"主题","settings.theme.light":"亮色","settings.theme.dark":"暗色","settings.theme.system":"跟随系统","settings.about.title":"关于","settings.about.subtitle":"版本 {version} \xb7 MIT 协议","settings.about.line1":"本地优先:你的数据从不离开本机,也没有任何遥测。唯一可选的网络请求是从 LiteLLM 刷新价格表 —— 设 CCGAUGE_OFFLINE=1 可关闭。","settings.about.line2":"只读:ccgauge 只读取 JSONL,绝不会写回 ~/.claude。","settings.about.line3":'缓存:扫描结果会缓存 5 秒;点击"重新扫描"可强制刷新。',"settings.about.line4":"在启动 ccgauge 的终端按 Ctrl+C 即可停止。","settings.indexer.desc":"后台 indexer 通过文件监听增量维护缓存。","settings.indexer.lastIndexedAt":"最近索引时间","settings.indexer.indexDuration":"最近索引耗时","settings.indexer.watchers":"活跃 watcher 数","settings.indexer.loadedFromDisk":"从磁盘恢复","settings.indexer.status":"状态","settings.indexer.indexing":"索引中…","settings.indexer.idle":"空闲","settings.indexer.recentErrors":"最近的索引错误","common.yes":"是","common.no":"否","lang.label":"语言","lang.en":"English","lang.zh":"中文","theme.label":"主题"}};function a(e,t,s){var o;let i=null==(o=n[e])?void 0:o[t];if(void 0===i&&(i=n.en[t]),void 0===i&&(i=t),s)for(let[e,t]of Object.entries(s))i=i.replace(RegExp("\\{".concat(e,"\\}"),"g"),String(t));return i}}}]);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[64,74,92,97,209,236,347,609,872,948,949],{84441:()=>{}},_=>{_.O(0,[441,255,358],()=>_(_.s=84441)),_N_E=_.O()}]);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[64,74,92,97,209,236,347,609,872,948,949],{84441:()=>{}},_=>{_.O(0,[441,255,358],()=>_(_.s=84441)),_N_E=_.O()}]);
|
package/.next/standalone/.next/static/chunks/app/api/pricing/refresh/route-bcee47c5d093728c.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[64,74,92,97,209,236,347,609,872,948,949],{84441:()=>{}},_=>{_.O(0,[441,255,358],()=>_(_.s=84441)),_N_E=_.O()}]);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[64,74,92,97,209,236,347,609,872,948,949],{84441:()=>{}},_=>{_.O(0,[441,255,358],()=>_(_.s=84441)),_N_E=_.O()}]);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[64,74,92,97,209,236,347,609,872,948,949],{84441:()=>{}},_=>{_.O(0,[441,255,358],()=>_(_.s=84441)),_N_E=_.O()}]);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[64,74,92,97,209,236,347,609,872,948,949],{84441:()=>{}},_=>{_.O(0,[441,255,358],()=>_(_.s=84441)),_N_E=_.O()}]);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[64,74,92,97,209,236,347,609,872,948,949],{84441:()=>{}},_=>{_.O(0,[441,255,358],()=>_(_.s=84441)),_N_E=_.O()}]);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[64,74,92,97,209,236,347,609,872,948,949],{84441:()=>{}},_=>{_.O(0,[441,255,358],()=>_(_.s=84441)),_N_E=_.O()}]);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[64,74,92,97,209,236,347,609,872,948,949],{84441:()=>{}},_=>{_.O(0,[441,255,358],()=>_(_.s=84441)),_N_E=_.O()}]);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[177],{12112:(e,t,r)=>{"use strict";r.d(t,{Providers:()=>a});var n=r(95155),i=r(51148),o=r(84479);function a(e){let{locale:t,theme:r,children:a}=e;return(0,n.jsx)(i.CY,{initialLocale:t,children:(0,n.jsx)(o.N,{initialTheme:r,children:a})})}},21264:(e,t,r)=>{"use strict";r.d(t,{LanguageSwitcher:()=>c});var n=r(95155),i=r(51148),o=r(79808);let a={en:"EN",zh:"中"},s={en:"English",zh:"中文"};function c(){let{locale:e,setLocale:t,t:r}=(0,i.s9)();return(0,n.jsx)("div",{role:"group",className:"inline-flex items-center rounded-md border border-border bg-bg-surface p-0.5 text-xs",title:r("lang.label"),"aria-label":r("lang.label"),children:o.YZ.map(r=>{let i=r===e;return(0,n.jsx)("button",{type:"button",onClick:()=>{i||t(r)},className:"px-2 py-1 rounded transition-colors ".concat(i?"bg-brand-strong text-white font-semibold":"text-text-tertiary hover:text-text-primary hover:bg-bg-surface-hi"),title:s[r],"aria-pressed":i,children:a[r]},r)})})}},25016:(e,t,r)=>{"use strict";r.d(t,{BC:()=>x,P6:()=>f,PJ:()=>m,R8:()=>d,a3:()=>u,az:()=>c,cn:()=>o,jh:()=>s,l7:()=>l,r6:()=>h});var n=r(2821),i=r(75889);function o(){for(var e=arguments.length,t=Array(e),r=0;r<e;r++)t[r]=arguments[r];return(0,i.QP)((0,n.$)(t))}function a(e,t){var r;return new Intl.NumberFormat("en-US",{maximumFractionDigits:null!=(r=null==t?void 0:t.maxFrac)?r:0}).format(e)}function s(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"en";return Number.isFinite(e)?"zh"===t?e>=1e8?(e/1e8).toFixed(2)+"亿":e>=1e4?(e/1e4).toFixed(1)+"万":a(e):e>=1e9?(e/1e9).toFixed(2)+"B":e>=1e6?(e/1e6).toFixed(2)+"M":e>=1e3?(e/1e3).toFixed(1)+"K":a(e):"0"}function c(e,t){var r,n;return new Intl.NumberFormat("en-US",{style:"currency",currency:"USD",minimumFractionDigits:null!=(r=null==t?void 0:t.minFrac)?r:2,maximumFractionDigits:null!=(n=null==t?void 0:t.maxFrac)?n:2}).format(e)}function l(e){return 0===e?"$0":e<.01?new Intl.NumberFormat("en-US",{style:"currency",currency:"USD",minimumFractionDigits:4,maximumFractionDigits:6}).format(e):c(e)}function d(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;return Number.isFinite(e)?"".concat((100*e).toFixed(t),"%"):"0%"}function u(e){if(e<1e3)return"".concat(e,"ms");let t=Math.floor(e/1e3);if(t<60)return"".concat(t,"s");let r=Math.floor(t/60);if(r<60){let e=t%60;return e?"".concat(r,"m ").concat(e,"s"):"".concat(r,"m")}let n=Math.floor(r/60),i=r%60;return i?"".concat(n,"h ").concat(i,"m"):"".concat(n,"h")}function h(e){let t="string"==typeof e||"number"==typeof e?new Date(e):e;if(Number.isNaN(t.getTime()))return"";let r=t.getFullYear(),n=String(t.getMonth()+1).padStart(2,"0"),i=String(t.getDate()).padStart(2,"0"),o=String(t.getHours()).padStart(2,"0"),a=String(t.getMinutes()).padStart(2,"0"),s=String(t.getSeconds()).padStart(2,"0");return"".concat(r,"-").concat(n,"-").concat(i," ").concat(o,":").concat(a,":").concat(s)}function m(e){if(!e)return"(unknown)";let t=e.replace(/[/\\]+$/,"").split(/[/\\]+/);return t[t.length-1]||e}function x(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:8;return e?e.replace(/-/g,"").slice(0,t):""}let g={mini:"Mini",nano:"Nano",pro:"Pro",turbo:"Turbo",preview:"Preview"};function f(e){if(!e)return"(unknown)";let t=e.replace(/^(vertex_ai|bedrock|anthropic|openai)\//,""),r=t.toLowerCase();if(r.startsWith("gpt-")||/^o\d/.test(r))return r.startsWith("gpt-")?"GPT-"+t.slice(4).split("-").map(e=>{var t;return null!=(t=g[e.toLowerCase()])?t:e}).join(" "):t.toUpperCase();let n=t.replace(/-(\d{8})$/,""),i=(n=n.replace(/^claude-/,"")).split("-");if(i.length>=2){let e=i[0],t=i.slice(1).join(".");return p(e)+" "+t}return p(n.replace(/-/g," "))}function p(e){return e.replace(/\b\w/g,e=>e.toUpperCase())}},41290:()=>{},44703:(e,t,r)=>{"use strict";r.d(t,{ThemeSwitcher:()=>s});var n=r(95155),i=r(84479),o=r(51148);let a={light:"dark",dark:"system",system:"light"};function s(){let{theme:e,resolved:t,setTheme:r}=(0,i.D)(),{t:s}=(0,o.s9)(),l=a[e];return(0,n.jsx)("button",{onClick:()=>r(l),className:"h-7 w-9 inline-flex items-center justify-center rounded-md border border-border bg-bg-surface text-text-secondary hover:text-text-primary hover:bg-bg-surface-hi hover:border-border-hi transition-colors",title:"".concat(s("theme.label"),": ").concat(s("settings.theme.".concat(e))," (").concat(t,") → ").concat(s("settings.theme.".concat(l))),"aria-label":s("theme.label"),children:(0,n.jsx)(c,{theme:e})})}function c(e){let{theme:t}=e;return"light"===t?(0,n.jsxs)("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":!0,children:[(0,n.jsx)("circle",{cx:"12",cy:"12",r:"4"}),(0,n.jsx)("path",{d:"M12 2v2M12 20v2M4.93 4.93l1.41 1.41M17.66 17.66l1.41 1.41M2 12h2M20 12h2M4.93 19.07l1.41-1.41M17.66 6.34l1.41-1.41"})]}):"dark"===t?(0,n.jsx)("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":!0,children:(0,n.jsx)("path",{d:"M21 12.79A9 9 0 1 1 11.21 3 7 7 0 0 0 21 12.79z"})}):(0,n.jsxs)("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":!0,children:[(0,n.jsx)("circle",{cx:"12",cy:"12",r:"9"}),(0,n.jsx)("path",{d:"M12 3v18"}),(0,n.jsx)("path",{d:"M12 3a9 9 0 0 1 0 18z",fill:"currentColor",stroke:"none"})]})}},46227:(e,t,r)=>{"use strict";r.d(t,{j:()=>s});var n=r(95155),i=r(12115),o=r(47650),a=r(25016);function s(e){let{children:t,content:r,className:s,panelClassName:c,align:l="left",delay:d=100,maxWidth:u=360}=e,h=(0,i.useRef)(null),m=(0,i.useRef)(null),x=(0,i.useRef)(null),[g,f]=(0,i.useState)(null),[p,b]=(0,i.useState)(!1),[v,w]=(0,i.useState)(!1);function j(){x.current&&(window.clearTimeout(x.current),x.current=null),v||(m.current=window.setTimeout(()=>{let e=function(){let e,t=h.current;if(!t)return null;let r=t.getBoundingClientRect(),n=Math.min(u,window.innerWidth-16),i=window.innerHeight-r.bottom<200?"top":"bottom";return"right"===l?(e=Math.min(r.right,window.innerWidth-8))-n<8&&(e=n+8):(e=Math.max(r.left,8))+n>window.innerWidth-8&&(e=window.innerWidth-n-8),{x:e,y:"bottom"===i?r.bottom+8:r.top-8,placement:i,align:l}}();e&&(f(e),w(!0))},d))}function k(){m.current&&(window.clearTimeout(m.current),m.current=null),x.current=window.setTimeout(()=>w(!1),80)}return(0,i.useEffect)(()=>b(!0),[]),(0,i.useEffect)(()=>()=>{m.current&&window.clearTimeout(m.current),x.current&&window.clearTimeout(x.current)},[]),(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)("span",{ref:h,onMouseEnter:j,onMouseLeave:k,onFocus:j,onBlur:k,className:(0,a.cn)("inline-block",s),children:t}),p&&g&&(0,o.createPortal)((0,n.jsx)("div",{onMouseEnter:()=>{x.current&&(window.clearTimeout(x.current),x.current=null)},onMouseLeave:k,style:{position:"fixed",left:"right"===g.align?void 0:g.x,right:"right"===g.align?window.innerWidth-g.x:void 0,top:"bottom"===g.placement?g.y:void 0,bottom:"top"===g.placement?window.innerHeight-g.y:void 0,maxWidth:u,transform:v?"translateY(0) scale(1)":"bottom"===g.placement?"translateY(-4px) scale(0.98)":"translateY(4px) scale(0.98)",opacity:+!!v,transitionProperty:"opacity, transform",transitionDuration:"120ms",transitionTimingFunction:"cubic-bezier(0.16, 1, 0.3, 1)",transformOrigin:"bottom"===g.placement?"top":"bottom",pointerEvents:v?"auto":"none"},className:(0,a.cn)("z-50 card border-border-hi shadow-xl rounded-button",c),children:r}),document.body)]})}},57581:(e,t,r)=>{"use strict";r.d(t,{Nav:()=>F});var n=r(95155),i=r(52619),o=r.n(i),a=r(20063),s=r(25016),c=r(51148),l=r(76669),d=r(63847),u=r(46227),h=r(21264),m=r(44703);function x(e){let{className:t,withBackground:r=!0}=e,i=r?"#FFFFFF":"currentColor",o=r?"#FFFFFF":"currentColor",a=r?"#FFFFFF":"currentColor";return(0,n.jsxs)("svg",{viewBox:"0 0 64 64",fill:"none","aria-hidden":!0,className:(0,s.cn)("block",!r&&"text-brand",t),children:[r&&(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)("rect",{x:"3",y:"3",width:"58",height:"58",rx:"16",fill:"rgb(var(--brand-strong))"}),(0,n.jsx)("rect",{x:"3.75",y:"3.75",width:"56.5",height:"56.5",rx:"15.25",stroke:"#FFFFFF",strokeOpacity:"0.18",strokeWidth:"1.5"})]}),(0,n.jsx)("path",{d:"M15 39.5 A17 17 0 0 1 49 39.5",stroke:i,strokeOpacity:r?.24:.22,strokeWidth:"5",strokeLinecap:"round"}),(0,n.jsx)("path",{d:"M20.8 39.5 A11.2 11.2 0 0 1 43.2 39.5",stroke:i,strokeOpacity:r?.2:.18,strokeWidth:"1.8",strokeLinecap:"round"}),(0,n.jsx)("path",{d:"M15 39.5 A17 17 0 0 1 42.8 26",stroke:o,strokeWidth:"5",strokeLinecap:"round"}),(0,n.jsxs)("g",{stroke:i,strokeLinecap:"round",strokeWidth:"2",strokeOpacity:r?.54:.34,children:[(0,n.jsx)("path",{d:"M18.1 34.2 L15 32.4"}),(0,n.jsx)("path",{d:"M24 28.5 L22.3 25.5"}),(0,n.jsx)("path",{d:"M32 26.2 L32 22.8"}),(0,n.jsx)("path",{d:"M40 28.5 L41.7 25.5"}),(0,n.jsx)("path",{d:"M45.9 34.2 L49 32.4"})]}),(0,n.jsx)("path",{d:"M32 39.5 L42.8 26",stroke:a,strokeWidth:"3.4",strokeLinecap:"round"}),(0,n.jsx)("circle",{cx:"32",cy:"39.5",r:"4.8",fill:r?"#FFFFFF":"currentColor"}),r&&(0,n.jsx)("circle",{cx:"32",cy:"39.5",r:"2",fill:"#4F46E5"}),(0,n.jsxs)("g",{opacity:r?1:.68,children:[(0,n.jsx)("rect",{x:"17",y:"46",width:"7",height:"5",rx:"2",fill:r?"#34D399":"currentColor"}),(0,n.jsx)("rect",{x:"28.5",y:"43",width:"7",height:"8",rx:"2",fill:r?"#FBBF24":"currentColor"}),(0,n.jsx)("rect",{x:"40",y:"45",width:"7",height:"6",rx:"2",fill:r?"#93C5FD":"currentColor"})]})]})}var g=r(12115);function f(e){let{available:t,initial:r,providers:i}=e,o=(0,a.useRouter)(),s=(0,a.usePathname)(),l=(0,a.useSearchParams)(),d=(0,c.kj)(),{locale:u}=(0,c.s9)(),[h,m]=(0,g.useTransition)(),x=l.get("source"),f=x&&("all"===x?t.length>=2:t.includes(x))?x:null,[v,w]=(0,g.useState)(null!=f?f:r);if((0,g.useEffect)(()=>{f&&f!==v&&w(f)},[f,v]),t.length<2)return null;let j=e=>{var t;if(e===v)return;w(e),t=e,"undefined"!=typeof document&&(document.cookie="".concat("ccgauge_source","=").concat(encodeURIComponent(t),"; path=/; max-age=").concat(31536e3,"; SameSite=Lax"));let r=new URLSearchParams(l.toString());r.set("source",e);let n=/^\/sessions\/[^/]+|^\/projects\/[^/]+/.test(s)?"/".concat(s.split("/")[1],"?").concat(r.toString()):"".concat(s,"?").concat(r.toString());m(()=>{o.push(n)})},k=i.filter(e=>t.includes(e.id));return(0,n.jsxs)("div",{role:"group","aria-label":d("nav.source"),className:"inline-flex items-center rounded-md border border-border bg-bg-surface p-0.5 gap-0.5 ".concat(h?"opacity-60 cursor-progress":""),"aria-busy":h,title:d("nav.source"),children:[(0,n.jsx)(b,{active:"all"===v,label:d("source.all"),onSelect:()=>j("all"),disabled:h,providers:k}),k.map(e=>{let t=e.id===v,r="zh"===u?e.displayZh:e.displayEn;return(0,n.jsxs)("button",{type:"button",onClick:()=>j(e.id),"aria-pressed":t,disabled:h,className:"px-2.5 h-6 text-xs font-medium inline-flex items-center gap-1.5 rounded transition-colors ".concat(t?"bg-brand-strong text-white shadow-sm":"text-text-tertiary hover:text-text-primary hover:bg-bg-surface-hi"),children:[(0,n.jsx)(p,{provider:e}),(0,n.jsx)("span",{children:r})]},e.id)})]})}function p(e){let{provider:t}=e;return t.logoSrc?(0,n.jsx)("img",{src:t.logoSrc,alt:"","aria-hidden":!0,className:"w-4 h-4 rounded-[3px] object-contain shrink-0"}):(0,n.jsx)("span",{className:"inline-flex items-center justify-center w-3.5 h-3.5 rounded-full text-[9px] font-bold leading-none",style:{background:t.bg,color:t.fg},children:t.shortLabel})}function b(e){let{active:t,label:r,onSelect:i,disabled:o,providers:a}=e;return(0,n.jsxs)("button",{type:"button",onClick:i,"aria-pressed":t,disabled:o,className:"px-2.5 h-6 text-xs font-medium inline-flex items-center gap-1.5 rounded transition-colors ".concat(t?"bg-brand-strong text-white shadow-sm":"text-text-tertiary hover:text-text-primary hover:bg-bg-surface-hi"),children:[(0,n.jsx)("span",{className:"relative inline-flex items-center w-[26px] h-4 shrink-0","aria-hidden":!0,children:a.slice(0,2).map((e,t)=>{let r=10*(0!==t);return e.logoSrc?(0,n.jsx)("img",{src:e.logoSrc,alt:"",className:"absolute w-4 h-4 rounded-[3px] object-contain",style:{left:r,zIndex:a.length-t}},e.id):(0,n.jsx)("span",{className:"absolute inline-flex items-center justify-center w-3.5 h-3.5 rounded-full text-[9px] font-bold leading-none",style:{background:e.bg,color:e.fg,left:r,zIndex:a.length-t},children:e.shortLabel},e.id)})}),(0,n.jsx)("span",{children:r})]})}let v=[{href:"/",tk:"nav.overview",exact:!0},{href:"/usage",tk:"nav.usage"}],w=[{href:"/sessions",tk:"nav.sessions"},{href:"/projects",tk:"nav.projects"},{href:"/models",tk:"nav.models"},{href:"/tools",tk:"nav.tools"}],j=[{href:"/settings",tk:"nav.settings"}],k="/analysis";function y(e,t){return t.exact?e===t.href:e===t.href||e.startsWith(t.href+"/")}function F(e){var t,r;let{availableProviders:i,initialSource:g,providerInfos:p}=e,b=(0,a.usePathname)(),{t:F,locale:N}=(0,c.s9)(),S=w.some(e=>y(b,e)),M=v.find(e=>y(b,e)),L=j.find(e=>y(b,e)),C=S?k:null!=(r=null!=(t=null==M?void 0:M.href)?t:null==L?void 0:L.href)?r:"",{containerRef:E,rect:z}=(0,l.S)(C),W=e=>(0,s.cn)("relative px-2.5 sm:px-3 py-1.5 text-sm rounded-button font-medium whitespace-nowrap shrink-0","transition-colors duration-150",e?"text-text-primary":"text-text-secondary hover:text-text-primary hover:bg-bg-surface-hi/60"),P=e=>(0,n.jsx)(o(),{href:e.href,prefetch:!1,"data-tab":e.href,"aria-current":y(b,e)?"page":void 0,className:W(y(b,e)),children:F(e.tk)},e.href);return(0,n.jsx)("header",{className:"sticky top-0 z-30 border-b border-border bg-bg-base/85 backdrop-blur-md supports-[backdrop-filter]:bg-bg-base/70",children:(0,n.jsxs)("div",{className:"max-w-7xl mx-auto px-3 sm:px-6 h-14 flex items-center gap-2 sm:gap-4",children:[(0,n.jsxs)(o(),{href:"/",className:"flex items-center gap-2 font-semibold tracking-tight whitespace-nowrap shrink-0 text-text-primary hover:opacity-90 transition-opacity","aria-label":"ccgauge home",children:[(0,n.jsx)(x,{className:"w-7 h-7"}),(0,n.jsx)("span",{className:"hidden xs:inline sm:inline",children:"ccgauge"})]}),(0,n.jsxs)("nav",{ref:E,className:"relative flex-1 min-w-0 flex items-center gap-0.5 overflow-x-auto nav-scroller","aria-label":"Primary",children:[(0,n.jsx)(d.j,{rect:z,variant:"underline"}),v.map(P),(0,n.jsx)(u.j,{align:"left",maxWidth:220,className:"shrink-0",content:(0,n.jsx)("div",{className:"py-1.5 min-w-[168px]",role:"menu",children:w.map(e=>{let t=y(b,e);return(0,n.jsx)(o(),{href:e.href,prefetch:!1,role:"menuitem","aria-current":t?"page":void 0,className:(0,s.cn)("block mx-1.5 px-2.5 py-1.5 text-sm rounded-button transition-colors",t?"text-text-primary bg-bg-surface-hi font-medium":"text-text-secondary hover:text-text-primary hover:bg-bg-surface-hi/60"),children:F(e.tk)},e.href)})}),children:(0,n.jsxs)("button",{type:"button","data-tab":k,"aria-haspopup":"menu","aria-current":S?"page":void 0,className:(0,s.cn)(W(S),"inline-flex items-center gap-1"),children:[F("nav.analytics"),(0,n.jsx)("svg",{width:"11",height:"11",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":!0,className:"opacity-60",children:(0,n.jsx)("path",{d:"m6 9 6 6 6-6"})})]})}),j.map(P),(0,n.jsxs)("a",{href:"zh"===N?"https://chengzuopeng.github.io/ccgauge/zh/":"https://chengzuopeng.github.io/ccgauge/",target:"_blank",rel:"noopener noreferrer",className:(0,s.cn)("relative inline-flex items-center gap-1 px-2.5 sm:px-3 py-1.5 text-sm rounded-button font-medium whitespace-nowrap shrink-0","transition-colors duration-150","text-text-secondary hover:text-text-primary hover:bg-bg-surface-hi/60"),children:[F("nav.docs"),(0,n.jsxs)("svg",{width:"11",height:"11",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":!0,className:"opacity-70",children:[(0,n.jsx)("path",{d:"M7 17 17 7"}),(0,n.jsx)("path",{d:"M8 7h9v9"})]})]})]}),(0,n.jsxs)("div",{className:"flex items-center gap-2 shrink-0",children:[(0,n.jsx)(f,{available:i,initial:g,providers:p}),(0,n.jsxs)("div",{className:"flex items-center gap-1.5",children:[(0,n.jsx)(h.LanguageSwitcher,{}),(0,n.jsx)(m.ThemeSwitcher,{}),(0,n.jsx)("a",{href:"https://github.com/chengzuopeng/ccgauge",target:"_blank",rel:"noopener noreferrer",className:"h-7 w-9 inline-flex items-center justify-center rounded-md border border-border bg-bg-surface text-text-secondary hover:text-text-primary hover:bg-bg-surface-hi hover:border-border-hi transition-colors",title:"GitHub","aria-label":"GitHub",children:(0,n.jsx)("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":!0,children:(0,n.jsx)("path",{d:"M12 .5C5.65.5.5 5.65.5 12c0 5.09 3.29 9.4 7.86 10.93.58.1.79-.25.79-.55v-2.1c-3.2.7-3.87-1.36-3.87-1.36-.52-1.33-1.27-1.69-1.27-1.69-1.04-.71.08-.7.08-.7 1.15.08 1.76 1.18 1.76 1.18 1.02 1.75 2.68 1.25 3.34.96.1-.74.4-1.25.73-1.54-2.55-.29-5.23-1.28-5.23-5.69 0-1.26.45-2.29 1.18-3.1-.12-.29-.51-1.45.11-3.03 0 0 .96-.31 3.15 1.18a10.94 10.94 0 0 1 5.74 0c2.19-1.49 3.15-1.18 3.15-1.18.63 1.58.24 2.74.12 3.03.73.81 1.18 1.84 1.18 3.1 0 4.43-2.69 5.4-5.25 5.68.41.36.78 1.06.78 2.14v3.18c0 .31.21.66.8.55A11.5 11.5 0 0 0 23.5 12C23.5 5.65 18.35.5 12 .5Z"})})})]})]})]})})}},63847:(e,t,r)=>{"use strict";r.d(t,{j:()=>o});var n=r(95155),i=r(25016);function o(e){let{rect:t,variant:r="pill",className:o}=e;if(!t)return null;let a=8*("underline"===r);return(0,n.jsx)("span",{"aria-hidden":!0,className:(0,i.cn)("pointer-events-none absolute transition-[transform,width] duration-200 ease-out-soft","pill"===r?"inset-y-0 rounded bg-brand-strong shadow-sm":"-bottom-[12px] h-[2px] rounded-full bg-brand",o),style:{transform:"translateX(".concat(t.left+a,"px)"),width:Math.max(0,t.width-2*a)}})}},76669:(e,t,r)=>{"use strict";r.d(t,{S:()=>o});var n=r(12115);let i=n.useLayoutEffect;function o(e){let t=(0,n.useRef)(null),[r,o]=(0,n.useState)(null),a=(0,n.useCallback)(()=>{let r=t.current;if(!r)return;let n=r.querySelector('[data-tab="'.concat(e,'"]'));if(!n)return void o(null);o(e=>{let t={left:n.offsetLeft,width:n.offsetWidth};return e&&e.left===t.left&&e.width===t.width?e:t})},[e]);return i(()=>{a()},[a]),(0,n.useEffect)(()=>{let e=t.current;if(!e||"undefined"==typeof ResizeObserver)return;let r=new ResizeObserver(()=>a());for(let t of(r.observe(e),Array.from(e.children)))r.observe(t);return window.addEventListener("resize",a),()=>{r.disconnect(),window.removeEventListener("resize",a)}},[a]),{containerRef:t,rect:r}}},79076:(e,t,r)=>{Promise.resolve().then(r.t.bind(r,41290,23)),Promise.resolve().then(r.bind(r,57581)),Promise.resolve().then(r.bind(r,12112))},84479:(e,t,r)=>{"use strict";r.d(t,{N:()=>d,D:()=>u});var n=r(95155),i=r(12115);let o="ccgauge_theme",a=(0,i.createContext)({theme:"dark",resolved:"dark",setTheme:()=>{}}),s="ccgauge.theme";function c(e){return"light"===e?"light":"dark"===e?"dark":window.matchMedia&&window.matchMedia("(prefers-color-scheme: light)").matches?"light":"dark"}function l(e){if("undefined"==typeof document)return;let t=document.documentElement,r=c(e);t.classList.remove("theme-light","theme-dark"),t.classList.add("light"===r?"theme-light":"theme-dark"),t.setAttribute("data-theme",r)}function d(e){let{initialTheme:t,children:r}=e,[d,u]=(0,i.useState)(t),[h,m]=(0,i.useState)(()=>"system"===t?"dark":t);(0,i.useEffect)(()=>{try{let e=localStorage.getItem(s);if("light"===e||"dark"===e||"system"===e){e!==t&&(document.cookie="".concat(o,"=").concat(e,"; path=/; max-age=").concat(31536e3,"; SameSite=Lax")),u(e);let r=c(e);m(r),l(e)}else{let e=c(t);m(e),l(t)}}catch(e){m(c(t)),l(t)}},[]),(0,i.useEffect)(()=>{if("system"!==d)return;let e=window.matchMedia("(prefers-color-scheme: light)"),t=()=>{m(e.matches?"light":"dark"),l("system")};return e.addEventListener("change",t),()=>e.removeEventListener("change",t)},[d]);let x=(0,i.useCallback)(e=>{try{localStorage.setItem(s,e)}catch(e){}document.cookie="".concat(o,"=").concat(e,"; path=/; max-age=").concat(31536e3,"; SameSite=Lax"),u(e),m(c(e)),l(e)},[]);return(0,n.jsx)(a.Provider,{value:{theme:d,resolved:h,setTheme:x},children:r})}function u(){return(0,i.useContext)(a)}}},e=>{e.O(0,[410,760,619,148,441,255,358],()=>e(e.s=79076)),_N_E=e.O()}]);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[64,74,92,97,209,236,347,609,872,948,949],{84441:()=>{}},_=>{_.O(0,[441,255,358],()=>_(_.s=84441)),_N_E=_.O()}]);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[662],{8783:(e,t,r)=>{"use strict";r.d(t,{PricingTable:()=>o});var n=r(95155),i=r(12115),s=r(25016),a=r(51148),c=r(20857);function o(e){let{rows:t}=e,r=(0,a.kj)(),[o,d]=(0,i.useState)(""),[u,h]=(0,i.useState)("model"),[m,g]=(0,i.useState)("asc");function x(e){e===u?g("asc"===m?"desc":"asc"):(h(e),g("model"===e?"asc":"desc"))}let p=(0,i.useMemo)(()=>{let e=o.trim().toLowerCase();return e?t.filter(t=>t.model.toLowerCase().includes(e)||(0,s.P6)(t.model).toLowerCase().includes(e)):t},[t,o]),f=(0,i.useMemo)(()=>{let e=[...p];return e.sort((e,t)=>{if("model"===u){let r=e.model.localeCompare(t.model);return"asc"===m?r:-r}let r=e[u],n=t[u];return r===n?0:"asc"===m?r<n?-1:1:r<n?1:-1}),e},[p,u,m]);return(0,n.jsxs)("div",{children:[(0,n.jsxs)("div",{className:"flex items-center justify-between gap-3 mb-3 flex-wrap",children:[(0,n.jsx)("input",{value:o,onChange:e=>d(e.target.value),placeholder:r("common.searchPlaceholder"),"aria-label":r("common.searchPlaceholder"),className:"px-3 py-1.5 text-sm rounded-button border border-border bg-bg-surface focus:outline-none focus:border-border-hi w-72 placeholder:text-text-tertiary text-text-primary"}),(0,n.jsx)("span",{className:"text-xs text-text-tertiary tabular-nums",children:r("common.rows",{count:f.length.toLocaleString()})})]}),(0,n.jsx)(c.H,{children:(0,n.jsxs)("table",{className:"w-full text-sm",children:[(0,n.jsx)("thead",{children:(0,n.jsxs)("tr",{className:"border-b border-border",children:[(0,n.jsx)(l,{sorted:"model"===u,dir:m,onClick:()=>x("model"),children:r("settings.pricing.col.model")}),(0,n.jsx)(l,{align:"right",sorted:"input"===u,dir:m,onClick:()=>x("input"),children:r("settings.pricing.col.input")}),(0,n.jsx)(l,{align:"right",sorted:"output"===u,dir:m,onClick:()=>x("output"),children:r("settings.pricing.col.output")}),(0,n.jsx)(l,{align:"right",sorted:"cacheCreation5m"===u,dir:m,onClick:()=>x("cacheCreation5m"),children:r("settings.pricing.col.write5m")}),(0,n.jsx)(l,{align:"right",sorted:"cacheCreation1h"===u,dir:m,onClick:()=>x("cacheCreation1h"),children:r("settings.pricing.col.write1h")}),(0,n.jsx)(l,{align:"right",sorted:"cacheRead"===u,dir:m,onClick:()=>x("cacheRead"),children:r("settings.pricing.col.read")})]})}),(0,n.jsxs)("tbody",{children:[f.map(e=>(0,n.jsxs)("tr",{className:"border-b border-border last:border-b-0 hover:bg-bg-surface-hi/30",children:[(0,n.jsx)("td",{className:"px-3 py-2 text-text-primary",title:e.model,children:(0,s.P6)(e.model)}),(0,n.jsx)("td",{className:"px-3 py-2 num-mono text-right",children:(0,s.az)(e.input)}),(0,n.jsx)("td",{className:"px-3 py-2 num-mono text-right",children:(0,s.az)(e.output)}),(0,n.jsx)("td",{className:"px-3 py-2 num-mono text-right text-text-secondary",children:(0,s.az)(e.cacheCreation5m)}),(0,n.jsx)("td",{className:"px-3 py-2 num-mono text-right text-text-secondary",children:(0,s.az)(e.cacheCreation1h)}),(0,n.jsx)("td",{className:"px-3 py-2 num-mono text-right text-success",children:(0,s.az)(e.cacheRead)})]},e.model)),0===f.length&&(0,n.jsx)("tr",{children:(0,n.jsx)("td",{colSpan:6,className:"px-3 py-8 text-center text-text-tertiary text-sm",children:r("common.noMatchingRows")})})]})]})})]})}function l(e){let{children:t,align:r="left",sorted:i,dir:a,onClick:c}=e;return(0,n.jsx)("th",{onClick:c,className:(0,s.cn)("px-3 py-2 text-xs font-medium text-text-tertiary uppercase tracking-wide whitespace-nowrap","right"===r?"text-right":"text-left",c&&"cursor-pointer hover:text-text-primary select-none"),children:(0,n.jsxs)("span",{className:"inline-flex items-center gap-1",children:[t,i&&(0,n.jsx)("span",{className:"text-[10px]",children:"asc"===a?"▲":"▼"})]})})}},20857:(e,t,r)=>{"use strict";r.d(t,{H:()=>a});var n=r(95155),i=r(12115),s=r(25016);function a(e){let{children:t,className:r}=e,a=(0,i.useRef)(null),[c,o]=(0,i.useState)(!1),[l,d]=(0,i.useState)(!1);return(0,i.useEffect)(()=>{let e=a.current;if(!e)return;function t(){if(!e)return;let{scrollLeft:t,scrollWidth:r,clientWidth:n}=e;o(t>4),d(t+n<r-4)}t(),e.addEventListener("scroll",t,{passive:!0});let r=new ResizeObserver(t);return r.observe(e),()=>{e.removeEventListener("scroll",t),r.disconnect()}},[]),(0,n.jsxs)("div",{className:(0,s.cn)("relative",r),children:[(0,n.jsx)("div",{ref:a,className:"overflow-x-auto",children:t}),(0,n.jsx)("div",{"aria-hidden":!0,className:(0,s.cn)("pointer-events-none absolute left-0 top-0 bottom-0 w-8 bg-gradient-to-r from-bg-surface to-transparent transition-opacity duration-150",c?"opacity-100":"opacity-0")}),(0,n.jsx)("div",{"aria-hidden":!0,className:(0,s.cn)("pointer-events-none absolute right-0 top-0 bottom-0 w-8 bg-gradient-to-l from-bg-surface to-transparent transition-opacity duration-150",l?"opacity-100":"opacity-0")})]})}},21264:(e,t,r)=>{"use strict";r.d(t,{LanguageSwitcher:()=>o});var n=r(95155),i=r(51148),s=r(79808);let a={en:"EN",zh:"中"},c={en:"English",zh:"中文"};function o(){let{locale:e,setLocale:t,t:r}=(0,i.s9)();return(0,n.jsx)("div",{role:"group",className:"inline-flex items-center rounded-md border border-border bg-bg-surface p-0.5 text-xs",title:r("lang.label"),"aria-label":r("lang.label"),children:s.YZ.map(r=>{let i=r===e;return(0,n.jsx)("button",{type:"button",onClick:()=>{i||t(r)},className:"px-2 py-1 rounded transition-colors ".concat(i?"bg-brand-strong text-white font-semibold":"text-text-tertiary hover:text-text-primary hover:bg-bg-surface-hi"),title:c[r],"aria-pressed":i,children:a[r]},r)})})}},25016:(e,t,r)=>{"use strict";r.d(t,{BC:()=>g,P6:()=>p,PJ:()=>m,R8:()=>d,a3:()=>u,az:()=>o,cn:()=>s,jh:()=>c,l7:()=>l,r6:()=>h});var n=r(2821),i=r(75889);function s(){for(var e=arguments.length,t=Array(e),r=0;r<e;r++)t[r]=arguments[r];return(0,i.QP)((0,n.$)(t))}function a(e,t){var r;return new Intl.NumberFormat("en-US",{maximumFractionDigits:null!=(r=null==t?void 0:t.maxFrac)?r:0}).format(e)}function c(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"en";return Number.isFinite(e)?"zh"===t?e>=1e8?(e/1e8).toFixed(2)+"亿":e>=1e4?(e/1e4).toFixed(1)+"万":a(e):e>=1e9?(e/1e9).toFixed(2)+"B":e>=1e6?(e/1e6).toFixed(2)+"M":e>=1e3?(e/1e3).toFixed(1)+"K":a(e):"0"}function o(e,t){var r,n;return new Intl.NumberFormat("en-US",{style:"currency",currency:"USD",minimumFractionDigits:null!=(r=null==t?void 0:t.minFrac)?r:2,maximumFractionDigits:null!=(n=null==t?void 0:t.maxFrac)?n:2}).format(e)}function l(e){return 0===e?"$0":e<.01?new Intl.NumberFormat("en-US",{style:"currency",currency:"USD",minimumFractionDigits:4,maximumFractionDigits:6}).format(e):o(e)}function d(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;return Number.isFinite(e)?"".concat((100*e).toFixed(t),"%"):"0%"}function u(e){if(e<1e3)return"".concat(e,"ms");let t=Math.floor(e/1e3);if(t<60)return"".concat(t,"s");let r=Math.floor(t/60);if(r<60){let e=t%60;return e?"".concat(r,"m ").concat(e,"s"):"".concat(r,"m")}let n=Math.floor(r/60),i=r%60;return i?"".concat(n,"h ").concat(i,"m"):"".concat(n,"h")}function h(e){let t="string"==typeof e||"number"==typeof e?new Date(e):e;if(Number.isNaN(t.getTime()))return"";let r=t.getFullYear(),n=String(t.getMonth()+1).padStart(2,"0"),i=String(t.getDate()).padStart(2,"0"),s=String(t.getHours()).padStart(2,"0"),a=String(t.getMinutes()).padStart(2,"0"),c=String(t.getSeconds()).padStart(2,"0");return"".concat(r,"-").concat(n,"-").concat(i," ").concat(s,":").concat(a,":").concat(c)}function m(e){if(!e)return"(unknown)";let t=e.replace(/[/\\]+$/,"").split(/[/\\]+/);return t[t.length-1]||e}function g(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:8;return e?e.replace(/-/g,"").slice(0,t):""}let x={mini:"Mini",nano:"Nano",pro:"Pro",turbo:"Turbo",preview:"Preview"};function p(e){if(!e)return"(unknown)";let t=e.replace(/^(vertex_ai|bedrock|anthropic|openai)\//,""),r=t.toLowerCase();if(r.startsWith("gpt-")||/^o\d/.test(r))return r.startsWith("gpt-")?"GPT-"+t.slice(4).split("-").map(e=>{var t;return null!=(t=x[e.toLowerCase()])?t:e}).join(" "):t.toUpperCase();let n=t.replace(/-(\d{8})$/,""),i=(n=n.replace(/^claude-/,"")).split("-");if(i.length>=2){let e=i[0],t=i.slice(1).join(".");return f(e)+" "+t}return f(n.replace(/-/g," "))}function f(e){return e.replace(/\b\w/g,e=>e.toUpperCase())}},33278:(e,t,r)=>{Promise.resolve().then(r.bind(r,21264)),Promise.resolve().then(r.bind(r,35610)),Promise.resolve().then(r.bind(r,8783)),Promise.resolve().then(r.bind(r,91107)),Promise.resolve().then(r.bind(r,44703))},35610:(e,t,r)=>{"use strict";r.d(t,{PricingRefresh:()=>c});var n=r(95155),i=r(12115),s=r(20063),a=r(51148);function c(e){let{meta:t,fetchedLabel:r}=e,c=(0,a.kj)(),o=(0,s.useRouter)(),[l,d]=(0,i.useState)(!1),[u,h]=(0,i.useState)(null);async function m(){d(!0),h(null);try{let e=await fetch("/api/pricing/refresh",{method:"POST",cache:"no-store"}),t=await e.json().catch(()=>null);(null==t?void 0:t.status)==="refreshed"?(h({ok:!0,msg:c("settings.pricing.refreshOk")}),o.refresh()):(null==t?void 0:t.status)==="offline"?h({ok:!1,msg:c("settings.pricing.offline")}):h({ok:!1,msg:c("settings.pricing.refreshFail")})}catch(e){h({ok:!1,msg:c("settings.pricing.refreshFail")})}finally{d(!1)}}let g="cache"===t.source?c("settings.pricing.sourceCache",{time:null!=r?r:""}):c("settings.pricing.sourceBuiltin");return(0,n.jsxs)("div",{className:"flex items-center gap-2.5 flex-wrap",children:[(0,n.jsxs)("span",{className:"text-xs text-text-tertiary",children:[g,u&&(0,n.jsxs)("span",{className:u.ok?"ml-1.5 text-success":"ml-1.5 text-warning",children:["\xb7 ",u.msg]})]}),t.offline?(0,n.jsx)("span",{className:"text-xs text-text-tertiary",children:c("settings.pricing.offline")}):(0,n.jsx)("button",{onClick:m,disabled:l,className:"btn",children:l?c("settings.pricing.refreshing"):c("settings.pricing.refresh")})]})}},44703:(e,t,r)=>{"use strict";r.d(t,{ThemeSwitcher:()=>c});var n=r(95155),i=r(84479),s=r(51148);let a={light:"dark",dark:"system",system:"light"};function c(){let{theme:e,resolved:t,setTheme:r}=(0,i.D)(),{t:c}=(0,s.s9)(),l=a[e];return(0,n.jsx)("button",{onClick:()=>r(l),className:"h-7 w-9 inline-flex items-center justify-center rounded-md border border-border bg-bg-surface text-text-secondary hover:text-text-primary hover:bg-bg-surface-hi hover:border-border-hi transition-colors",title:"".concat(c("theme.label"),": ").concat(c("settings.theme.".concat(e))," (").concat(t,") → ").concat(c("settings.theme.".concat(l))),"aria-label":c("theme.label"),children:(0,n.jsx)(o,{theme:e})})}function o(e){let{theme:t}=e;return"light"===t?(0,n.jsxs)("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":!0,children:[(0,n.jsx)("circle",{cx:"12",cy:"12",r:"4"}),(0,n.jsx)("path",{d:"M12 2v2M12 20v2M4.93 4.93l1.41 1.41M17.66 17.66l1.41 1.41M2 12h2M20 12h2M4.93 19.07l1.41-1.41M17.66 6.34l1.41-1.41"})]}):"dark"===t?(0,n.jsx)("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":!0,children:(0,n.jsx)("path",{d:"M21 12.79A9 9 0 1 1 11.21 3 7 7 0 0 0 21 12.79z"})}):(0,n.jsxs)("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":!0,children:[(0,n.jsx)("circle",{cx:"12",cy:"12",r:"9"}),(0,n.jsx)("path",{d:"M12 3v18"}),(0,n.jsx)("path",{d:"M12 3a9 9 0 0 1 0 18z",fill:"currentColor",stroke:"none"})]})}},84479:(e,t,r)=>{"use strict";r.d(t,{N:()=>d,D:()=>u});var n=r(95155),i=r(12115);let s="ccgauge_theme",a=(0,i.createContext)({theme:"dark",resolved:"dark",setTheme:()=>{}}),c="ccgauge.theme";function o(e){return"light"===e?"light":"dark"===e?"dark":window.matchMedia&&window.matchMedia("(prefers-color-scheme: light)").matches?"light":"dark"}function l(e){if("undefined"==typeof document)return;let t=document.documentElement,r=o(e);t.classList.remove("theme-light","theme-dark"),t.classList.add("light"===r?"theme-light":"theme-dark"),t.setAttribute("data-theme",r)}function d(e){let{initialTheme:t,children:r}=e,[d,u]=(0,i.useState)(t),[h,m]=(0,i.useState)(()=>"system"===t?"dark":t);(0,i.useEffect)(()=>{try{let e=localStorage.getItem(c);if("light"===e||"dark"===e||"system"===e){e!==t&&(document.cookie="".concat(s,"=").concat(e,"; path=/; max-age=").concat(31536e3,"; SameSite=Lax")),u(e);let r=o(e);m(r),l(e)}else{let e=o(t);m(e),l(t)}}catch(e){m(o(t)),l(t)}},[]),(0,i.useEffect)(()=>{if("system"!==d)return;let e=window.matchMedia("(prefers-color-scheme: light)"),t=()=>{m(e.matches?"light":"dark"),l("system")};return e.addEventListener("change",t),()=>e.removeEventListener("change",t)},[d]);let g=(0,i.useCallback)(e=>{try{localStorage.setItem(c,e)}catch(e){}document.cookie="".concat(s,"=").concat(e,"; path=/; max-age=").concat(31536e3,"; SameSite=Lax"),u(e),m(o(e)),l(e)},[]);return(0,n.jsx)(a.Provider,{value:{theme:d,resolved:h,setTheme:g},children:r})}function u(){return(0,i.useContext)(a)}},91107:(e,t,r)=>{"use strict";r.d(t,{ScanRefresh:()=>c});var n=r(95155),i=r(12115),s=r(20063),a=r(51148);function c(){let e=(0,a.kj)(),[t,r]=(0,i.useState)(!1),c=(0,s.useRouter)();async function o(){r(!0);try{await fetch("/api/scan",{method:"POST",cache:"no-store"}),c.refresh()}finally{r(!1)}}return(0,n.jsx)("button",{onClick:o,disabled:t,className:"btn",children:e(t?"settings.rescanning":"settings.rescan")})}}},e=>{e.O(0,[760,148,441,255,358],()=>e(e.s=33278)),_N_E=e.O()}]);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[554],{1189:(e,t,r)=>{"use strict";r.d(t,{SegmentedPicker:()=>u});var n=r(95155),a=r(20063),i=r(25016),s=r(51148),o=r(76669),l=r(63847),c=r(40464);function u(e){let{paramKey:t,defaultValue:r,options:u,ariaLabel:d}=e,m=(0,a.usePathname)(),h=(0,a.useSearchParams)(),x=(0,s.kj)(),{pending:f,navigate:b}=(0,c.q)(),p=h.get(t)||r,g=u.some(e=>e.value===p)?p:r,{containerRef:v,rect:k}=(0,o.S)(g),y=null===k;function w(e){let r=new URLSearchParams(h.toString());r.set(t,e),b("".concat(m,"?").concat(r.toString()))}return(0,n.jsx)("div",{className:(0,i.cn)("inline-flex rounded-button border border-border bg-bg-surface p-0.5",f&&"opacity-60 cursor-progress"),"aria-busy":f,children:(0,n.jsxs)("div",{ref:v,role:"radiogroup","aria-label":d,onKeyDown:function(e){var t,r;if("ArrowLeft"!==e.key&&"ArrowRight"!==e.key)return;e.preventDefault();let n=(u.findIndex(e=>e.value===g)+("ArrowRight"===e.key?1:-1)+u.length)%u.length;w(u[n].value);let a=null==(t=v.current)?void 0:t.querySelectorAll('button[role="radio"]');null==a||null==(r=a[n])||r.focus()},className:"relative flex gap-0.5",children:[(0,n.jsx)(l.j,{rect:k,className:"ring-1 ring-brand/40"}),u.map(e=>{let t=g===e.value;return(0,n.jsx)("button",{role:"radio","data-tab":e.value,"aria-checked":t,tabIndex:t?0:-1,onClick:()=>w(e.value),className:(0,i.cn)("relative z-10 px-2.5 py-1 text-xs rounded transition-colors","focus:outline-none focus-visible:ring-2 focus-visible:ring-brand/40",t?(0,i.cn)("text-white font-semibold",y&&"bg-brand-strong shadow-sm ring-1 ring-brand/40"):"text-text-tertiary font-medium hover:text-text-primary hover:bg-bg-surface-hi"),children:x(e.tk)},e.value)})]})})}},25016:(e,t,r)=>{"use strict";r.d(t,{BC:()=>x,P6:()=>b,PJ:()=>h,R8:()=>u,a3:()=>d,az:()=>l,cn:()=>i,jh:()=>o,l7:()=>c,r6:()=>m});var n=r(2821),a=r(75889);function i(){for(var e=arguments.length,t=Array(e),r=0;r<e;r++)t[r]=arguments[r];return(0,a.QP)((0,n.$)(t))}function s(e,t){var r;return new Intl.NumberFormat("en-US",{maximumFractionDigits:null!=(r=null==t?void 0:t.maxFrac)?r:0}).format(e)}function o(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"en";return Number.isFinite(e)?"zh"===t?e>=1e8?(e/1e8).toFixed(2)+"亿":e>=1e4?(e/1e4).toFixed(1)+"万":s(e):e>=1e9?(e/1e9).toFixed(2)+"B":e>=1e6?(e/1e6).toFixed(2)+"M":e>=1e3?(e/1e3).toFixed(1)+"K":s(e):"0"}function l(e,t){var r,n;return new Intl.NumberFormat("en-US",{style:"currency",currency:"USD",minimumFractionDigits:null!=(r=null==t?void 0:t.minFrac)?r:2,maximumFractionDigits:null!=(n=null==t?void 0:t.maxFrac)?n:2}).format(e)}function c(e){return 0===e?"$0":e<.01?new Intl.NumberFormat("en-US",{style:"currency",currency:"USD",minimumFractionDigits:4,maximumFractionDigits:6}).format(e):l(e)}function u(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;return Number.isFinite(e)?"".concat((100*e).toFixed(t),"%"):"0%"}function d(e){if(e<1e3)return"".concat(e,"ms");let t=Math.floor(e/1e3);if(t<60)return"".concat(t,"s");let r=Math.floor(t/60);if(r<60){let e=t%60;return e?"".concat(r,"m ").concat(e,"s"):"".concat(r,"m")}let n=Math.floor(r/60),a=r%60;return a?"".concat(n,"h ").concat(a,"m"):"".concat(n,"h")}function m(e){let t="string"==typeof e||"number"==typeof e?new Date(e):e;if(Number.isNaN(t.getTime()))return"";let r=t.getFullYear(),n=String(t.getMonth()+1).padStart(2,"0"),a=String(t.getDate()).padStart(2,"0"),i=String(t.getHours()).padStart(2,"0"),s=String(t.getMinutes()).padStart(2,"0"),o=String(t.getSeconds()).padStart(2,"0");return"".concat(r,"-").concat(n,"-").concat(a," ").concat(i,":").concat(s,":").concat(o)}function h(e){if(!e)return"(unknown)";let t=e.replace(/[/\\]+$/,"").split(/[/\\]+/);return t[t.length-1]||e}function x(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:8;return e?e.replace(/-/g,"").slice(0,t):""}let f={mini:"Mini",nano:"Nano",pro:"Pro",turbo:"Turbo",preview:"Preview"};function b(e){if(!e)return"(unknown)";let t=e.replace(/^(vertex_ai|bedrock|anthropic|openai)\//,""),r=t.toLowerCase();if(r.startsWith("gpt-")||/^o\d/.test(r))return r.startsWith("gpt-")?"GPT-"+t.slice(4).split("-").map(e=>{var t;return null!=(t=f[e.toLowerCase()])?t:e}).join(" "):t.toUpperCase();let n=t.replace(/-(\d{8})$/,""),a=(n=n.replace(/^claude-/,"")).split("-");if(a.length>=2){let e=a[0],t=a.slice(1).join(".");return p(e)+" "+t}return p(n.replace(/-/g," "))}function p(e){return e.replace(/\b\w/g,e=>e.toUpperCase())}},40464:(e,t,r)=>{"use strict";r.d(t,{q:()=>i});var n=r(12115),a=r(20063);function i(){let e=(0,a.useRouter)(),[t,r]=(0,n.useTransition)();return{pending:t,navigate:function(t){r(()=>{e.push(t)})}}}},47613:(e,t,r)=>{Promise.resolve().then(r.bind(r,1189)),Promise.resolve().then(r.bind(r,55294))},55294:(e,t,r)=>{"use strict";r.d(t,{ToolLeaderboard:()=>l});var n=r(95155),a=r(12115),i=r(25016),s=r(51148);let o={skill:"bg-brand/12 text-brand border border-brand/25",tool:"bg-chart-input/12 text-chart-input border border-chart-input/25",mcp:"bg-chart-cache-create/12 text-chart-cache-create border border-chart-cache-create/25"};function l(e){var t;let{rows:r,dimension:l,locale:u}=e,d=(0,s.kj)(),[m,h]=(0,a.useState)(null),x=r.reduce((e,t)=>e+t.estTokens,0)||1,f=(null==(t=r[0])?void 0:t.estTokens)||1,b=e=>(0,i.jh)(e,u);return(0,n.jsx)("div",{className:"card divide-y divide-border",children:r.map((e,t)=>{var r,a;let s=0===t,u=(r=e.key,"skill"===l?"skill":"mcp"===l?"mcp":"Skill"===r?"skill":r.startsWith("mcp__")?"mcp":"tool"),p=e.estTokens/x,g=Math.max(2,e.estTokens/f*100),v=m===e.key,k=e.calls>0?Math.round(e.estTokens/e.calls):0,y=Math.round(e.largestChars/4);return(0,n.jsxs)("div",{children:[(0,n.jsxs)("button",{type:"button",onClick:()=>h(v?null:e.key),"aria-expanded":v,className:(0,i.cn)("w-full text-left px-4 sm:px-5 py-3 transition-colors","hover:bg-bg-surface-hi/40 focus:outline-none focus-visible:bg-bg-surface-hi/50",s&&"bg-brand/5"),children:[(0,n.jsxs)("div",{className:"flex items-center gap-2.5",children:[(0,n.jsx)("span",{className:"num-mono text-xs text-text-tertiary w-5 shrink-0",children:t+1}),(0,n.jsx)("span",{className:(0,i.cn)("truncate text-sm text-text-primary",s&&"font-semibold"),title:e.key,children:(a=e.key).startsWith("mcp__")&&a.split("__").slice(1).join(" \xb7 ")||a}),(0,n.jsx)("span",{className:(0,i.cn)("pill text-[10px] shrink-0",o[u]),children:d("tools.kind.".concat(u))}),s&&(0,n.jsx)("span",{className:"pill text-[10px] shrink-0 bg-warning/12 text-warning border border-warning/25",children:d("tools.topConsumer")}),(0,n.jsxs)("span",{className:"ml-auto flex items-center gap-3 shrink-0",children:[(0,n.jsx)("span",{className:(0,i.cn)("num-mono text-sm tabular-nums",s?"text-brand":"text-text-secondary"),children:b(e.estTokens)}),(0,n.jsx)("span",{className:"num-mono text-xs text-text-tertiary w-12 text-right",children:(0,i.R8)(p,1)}),(0,n.jsx)("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",className:(0,i.cn)("text-text-tertiary transition-transform",v&&"rotate-90"),children:(0,n.jsx)("path",{d:"m9 18 6-6-6-6"})})]})]}),(0,n.jsx)("div",{className:"h-1.5 bg-bg-surface-hi rounded mt-2 overflow-hidden",children:(0,n.jsx)("div",{className:(0,i.cn)("h-full rounded",s?"bg-brand":"bg-border-hi"),style:{width:"".concat(g,"%")}})})]}),v&&(0,n.jsxs)("div",{className:"px-4 sm:px-5 pb-4 pt-1 bg-bg-surface/40",children:[(0,n.jsxs)("div",{className:"grid grid-cols-2 sm:grid-cols-4 gap-x-4 gap-y-3 text-xs",children:[(0,n.jsx)(c,{label:d("tools.field.estTokens"),value:"".concat(b(e.estTokens)," \xb7 ").concat((0,i.R8)(p,1))}),(0,n.jsx)(c,{label:d("tools.field.invocations"),value:"".concat(e.calls," \xb7 ").concat(d("tools.field.sessionsN",{n:e.sessions}))}),(0,n.jsx)(c,{label:d("tools.field.avgPerCall"),value:b(k)}),(0,n.jsx)(c,{label:d("tools.field.largest"),value:b(y)})]}),(0,n.jsx)("div",{className:"num-mono text-[11px] text-text-tertiary mt-3",children:d("tools.formula",{avg:b(k),calls:e.calls})})]})]},e.key)})})}function c(e){let{label:t,value:r}=e;return(0,n.jsxs)("div",{children:[(0,n.jsx)("div",{className:"text-text-tertiary",children:t}),(0,n.jsx)("div",{className:"num-mono text-text-primary mt-1",children:r})]})}},63847:(e,t,r)=>{"use strict";r.d(t,{j:()=>i});var n=r(95155),a=r(25016);function i(e){let{rect:t,variant:r="pill",className:i}=e;if(!t)return null;let s=8*("underline"===r);return(0,n.jsx)("span",{"aria-hidden":!0,className:(0,a.cn)("pointer-events-none absolute transition-[transform,width] duration-200 ease-out-soft","pill"===r?"inset-y-0 rounded bg-brand-strong shadow-sm":"-bottom-[12px] h-[2px] rounded-full bg-brand",i),style:{transform:"translateX(".concat(t.left+s,"px)"),width:Math.max(0,t.width-2*s)}})}},76669:(e,t,r)=>{"use strict";r.d(t,{S:()=>i});var n=r(12115);let a=n.useLayoutEffect;function i(e){let t=(0,n.useRef)(null),[r,i]=(0,n.useState)(null),s=(0,n.useCallback)(()=>{let r=t.current;if(!r)return;let n=r.querySelector('[data-tab="'.concat(e,'"]'));if(!n)return void i(null);i(e=>{let t={left:n.offsetLeft,width:n.offsetWidth};return e&&e.left===t.left&&e.width===t.width?e:t})},[e]);return a(()=>{s()},[s]),(0,n.useEffect)(()=>{let e=t.current;if(!e||"undefined"==typeof ResizeObserver)return;let r=new ResizeObserver(()=>s());for(let t of(r.observe(e),Array.from(e.children)))r.observe(t);return window.addEventListener("resize",s),()=>{r.disconnect(),window.removeEventListener("resize",s)}},[s]),{containerRef:t,rect:r}}}},e=>{e.O(0,[760,148,441,255,358],()=>e(e.s=47613)),_N_E=e.O()}]);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[64,74,92,97,209,236,347,609,872,948,949],{84441:()=>{}},_=>{_.O(0,[441,255,358],()=>_(_.s=84441)),_N_E=_.O()}]);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[430],{1189:(e,t,r)=>{"use strict";r.d(t,{SegmentedPicker:()=>d});var n=r(95155),a=r(20063),s=r(25016),o=r(51148),l=r(76669),i=r(63847),c=r(40464);function d(e){let{paramKey:t,defaultValue:r,options:d,ariaLabel:u}=e,m=(0,a.usePathname)(),x=(0,a.useSearchParams)(),h=(0,o.kj)(),{pending:p,navigate:g}=(0,c.q)(),b=x.get(t)||r,f=d.some(e=>e.value===b)?b:r,{containerRef:v,rect:j}=(0,l.S)(f),y=null===j;function w(e){let r=new URLSearchParams(x.toString());r.set(t,e),g("".concat(m,"?").concat(r.toString()))}return(0,n.jsx)("div",{className:(0,s.cn)("inline-flex rounded-button border border-border bg-bg-surface p-0.5",p&&"opacity-60 cursor-progress"),"aria-busy":p,children:(0,n.jsxs)("div",{ref:v,role:"radiogroup","aria-label":u,onKeyDown:function(e){var t,r;if("ArrowLeft"!==e.key&&"ArrowRight"!==e.key)return;e.preventDefault();let n=(d.findIndex(e=>e.value===f)+("ArrowRight"===e.key?1:-1)+d.length)%d.length;w(d[n].value);let a=null==(t=v.current)?void 0:t.querySelectorAll('button[role="radio"]');null==a||null==(r=a[n])||r.focus()},className:"relative flex gap-0.5",children:[(0,n.jsx)(i.j,{rect:j,className:"ring-1 ring-brand/40"}),d.map(e=>{let t=f===e.value;return(0,n.jsx)("button",{role:"radio","data-tab":e.value,"aria-checked":t,tabIndex:t?0:-1,onClick:()=>w(e.value),className:(0,s.cn)("relative z-10 px-2.5 py-1 text-xs rounded transition-colors","focus:outline-none focus-visible:ring-2 focus-visible:ring-brand/40",t?(0,s.cn)("text-white font-semibold",y&&"bg-brand-strong shadow-sm ring-1 ring-brand/40"):"text-text-tertiary font-medium hover:text-text-primary hover:bg-bg-surface-hi"),children:h(e.tk)},e.value)})]})})}},5955:(e,t,r)=>{"use strict";r.d(t,{UsageDataIsland:()=>K});var n=r(95155),a=r(12115),s=r(20063),o=r(51148),l=r(79808),i=r(7331),c=r(25016);function d(e){var t;let{label:r,value:a,hint:s,delta:o,deltaTitle:l,progress:i,accent:d="default",className:h}=e;return(0,n.jsxs)("div",{className:(0,c.cn)("card card-pad relative flex flex-col gap-2 min-h-[132px] overflow-hidden","default"!==d&&"pt-[18px] sm:pt-[22px]",h),children:["default"!==d&&(0,n.jsx)(u,{tone:d}),(0,n.jsx)("div",{className:"label truncate",children:r}),(0,n.jsxs)("div",{className:"flex items-baseline gap-2 flex-wrap min-w-0",children:[(0,n.jsx)("div",{className:"num-hero min-w-0 max-w-full",children:a}),o&&"firstTime"in o&&o.firstTime&&(0,n.jsx)("span",{className:"pill text-[11px] font-medium whitespace-nowrap text-brand bg-brand/10 border border-brand/20",title:l,children:null!=(t=o.label)?t:"NEW"}),o&&"value"in o&&Number.isFinite(o.value)&&(0,n.jsx)(m,{value:o.value,positiveIsGood:o.positiveIsGood,title:l})]}),s&&(0,n.jsx)("div",{className:"text-xs text-text-secondary mt-auto leading-snug",children:s}),i&&(0,n.jsx)("div",{className:"mt-auto pt-2",children:(0,n.jsx)(x,{value:i.value,tone:i.tone})})]})}function u(e){let{tone:t}=e;return(0,n.jsx)("div",{"aria-hidden":!0,className:(0,c.cn)("absolute left-0 right-0 top-0 h-[3px] bg-gradient-to-r",{brand:"from-brand/0 via-brand/70 to-brand/0",success:"from-success/0 via-success/70 to-success/0",warning:"from-warning/0 via-warning/70 to-warning/0"}[t])})}function m(e){let{value:t,positiveIsGood:r=!0,title:a}=e,s=t>=0;return(0,n.jsxs)("span",{className:(0,c.cn)("pill text-[11px] font-medium whitespace-nowrap border",s===r?"text-success bg-success/10 border-success/20":"text-danger bg-danger/10 border-danger/20"),title:a,children:[s?"↑":"↓"," ",Math.abs(t).toFixed(0),"%"]})}function x(e){let{value:t,tone:r="brand"}=e,a=Math.max(0,Math.min(1,t));return(0,n.jsx)("div",{className:"h-1.5 w-full bg-bg-surface-hi rounded-full overflow-hidden",children:(0,n.jsx)("div",{className:(0,c.cn)("h-full rounded-full transition-all duration-500 ease-out-soft",{brand:"bg-brand",success:"bg-success",warning:"bg-warning",danger:"bg-danger"}[r]),style:{width:"".concat(100*a,"%")}})})}var h=r(38059),p=r(47650),g=r(46227),b=r(20857),f=r(40464);let v=[{id:"time",labelKey:"usage.col.time",sortKey:"timestamp",defaultVisible:!0},{id:"duration",labelKey:"usage.col.duration",align:"right",sortKey:"durationMs",defaultVisible:!1},{id:"prompt",labelKey:"usage.col.userMessage",defaultVisible:!0},{id:"model",labelKey:"usage.col.model",defaultVisible:!0},{id:"project",labelKey:"usage.col.project",defaultVisible:!0},{id:"session",labelKey:"usage.col.session",defaultVisible:!1},{id:"calls",labelKey:"usage.col.calls",align:"right",sortKey:"callCount",defaultVisible:!1},{id:"input",labelKey:"usage.col.input",align:"right",sortKey:"inputTokens",defaultVisible:!1},{id:"output",labelKey:"usage.col.output",align:"right",sortKey:"outputTokens",defaultVisible:!1},{id:"cacheRead",labelKey:"usage.col.cacheRead",align:"right",sortKey:"cacheReadTokens",defaultVisible:!1},{id:"cacheWrite",labelKey:"usage.col.cacheWrite",align:"right",sortKey:"cacheCreationTokens",defaultVisible:!1},{id:"total",labelKey:"usage.col.total",align:"right",sortKey:"totalTokens",defaultVisible:!0},{id:"cost",labelKey:"usage.col.cost",align:"right",sortKey:"cost",defaultVisible:!1},{id:"tools",labelKey:"usage.col.tools",defaultVisible:!1}],j="ccgauge.usage.cols.v4";function y(){return v.reduce((e,t)=>(e[t.id]=t.defaultVisible,e),{})}function w(e){let{rows:t,totalCount:r,page:l,pageCount:i,sort:d,query:u,codexFastActive:m}=e,x=(0,o.kj)(),{locale:h}=(0,o.s9)(),g=(0,s.usePathname)(),w=(0,s.useSearchParams)(),{pending:k,navigate:T}=(0,f.q)(),[C,E]=(0,a.useState)(new Set),[L,K]=(0,a.useState)(y),[R,P]=(0,a.useState)(!1),[M,A]=(0,a.useState)(null),[I,D]=(0,a.useState)(u),F=(0,a.useRef)(null),W=(0,a.useRef)(null),V=(0,a.useRef)(null);function z(e){let t=new URLSearchParams(w.toString());for(let[r,n]of Object.entries(e))void 0===n||""===n?t.delete(r):t.set(r,n);let r=t.toString();T(r?"".concat(g,"?").concat(r):g)}function O(e){z({page:e>0?String(e+1):void 0})}(0,a.useEffect)(()=>{K(function(){try{let e=window.localStorage.getItem(j);if(!e)return y();let t=JSON.parse(e),r=y();for(let e of v)"boolean"==typeof t[e.id]&&(r[e.id]=t[e.id]);return r}catch(e){return y()}}())},[]),(0,a.useEffect)(()=>{window.localStorage.setItem(j,JSON.stringify(L))},[L]),(0,a.useEffect)(()=>{D(u)},[u]),(0,a.useEffect)(()=>{function e(e){var t,r;let n=e.target;(null==(t=F.current)||!t.contains(n))&&(null!=(r=W.current)&&r.contains(n)||P(!1))}return document.addEventListener("mousedown",e),()=>document.removeEventListener("mousedown",e)},[]),(0,a.useLayoutEffect)(()=>{if(!R)return void A(null);function e(){let e=F.current;if(!e)return;let t=e.getBoundingClientRect();A({top:t.bottom+4,right:window.innerWidth-t.right})}return e(),window.addEventListener("scroll",e,!0),window.addEventListener("resize",e),()=>{window.removeEventListener("scroll",e,!0),window.removeEventListener("resize",e)}},[R]),(0,a.useEffect)(()=>()=>{V.current&&(window.clearTimeout(V.current),V.current=null)},[]);let q=v.filter(e=>L[e.id]),H=q.length+1,_=q.length;return(0,n.jsxs)("div",{children:[(0,n.jsxs)("div",{className:"flex items-center justify-between gap-3 mb-3 flex-wrap",children:[(0,n.jsx)("input",{value:I,onChange:e=>{var t;D(t=e.target.value),V.current&&window.clearTimeout(V.current),V.current=window.setTimeout(()=>{z({q:t.trim()||void 0,page:void 0})},300)},placeholder:x("common.searchPlaceholder"),className:"px-3 py-1.5 text-sm rounded-button border border-border bg-bg-surface focus:outline-none focus:border-border-hi w-72 placeholder:text-text-tertiary text-text-primary"}),(0,n.jsxs)("div",{className:"flex items-center gap-3",children:[(0,n.jsx)("span",{className:"text-xs text-text-tertiary tabular-nums",children:x("common.rows",{count:r.toLocaleString()})}),(0,n.jsxs)("div",{className:"relative",children:[(0,n.jsxs)("button",{ref:F,onClick:()=>P(e=>!e),className:"btn","aria-haspopup":"dialog","aria-expanded":R,children:[x("usage.columns.button"),(0,n.jsx)("span",{className:"ml-1 text-text-tertiary tabular-nums",children:_})]}),R&&M&&"undefined"!=typeof document&&(0,p.createPortal)((0,n.jsxs)("div",{ref:W,className:"fixed w-56 card border-border-hi shadow-lg p-2 z-50",style:{top:M.top,right:M.right},role:"dialog",children:[(0,n.jsxs)("div",{className:"flex items-center justify-between px-1.5 pb-1.5 mb-1 border-b border-border",children:[(0,n.jsx)("span",{className:"text-xs text-text-tertiary uppercase tracking-wide",children:x("usage.columns.title")}),(0,n.jsx)("button",{onClick:()=>K(y()),className:"text-xs text-text-tertiary hover:text-text-primary",children:x("usage.columns.reset")})]}),(0,n.jsx)("div",{className:"max-h-72 overflow-auto",children:v.map(e=>(0,n.jsxs)("label",{className:"flex items-center gap-2 px-1.5 py-1.5 text-sm rounded hover:bg-bg-surface-hi cursor-pointer",children:[(0,n.jsx)("input",{type:"checkbox",checked:!!L[e.id],onChange:t=>K(r=>({...r,[e.id]:t.target.checked})),className:"accent-brand"}),(0,n.jsx)("span",{className:"text-text-secondary",children:x(e.labelKey)})]},e.id))})]}),document.body)]}),(0,n.jsx)("button",{onClick:function(){let e=new URLSearchParams(w.toString());window.location.href="/api/export/usage?".concat(e.toString())},className:"btn",children:x("common.exportCsv")})]})]}),(0,n.jsx)("div",{className:(0,c.cn)("card overflow-hidden transition-opacity",k&&"opacity-60 cursor-progress pointer-events-none"),"aria-busy":k,children:(0,n.jsx)(b.H,{children:(0,n.jsxs)("table",{className:"w-full text-sm",children:[(0,n.jsx)("thead",{children:(0,n.jsxs)("tr",{className:"border-b border-border bg-bg-surface-hi/30",children:[(0,n.jsx)(S,{children:(0,n.jsx)("span",{className:"sr-only",children:"expand"})}),q.map(e=>(0,n.jsx)(S,{align:e.align,sorted:!!e.sortKey&&d.key===e.sortKey,dir:d.dir,onClick:e.sortKey?()=>{var t;let r;return t=e.sortKey,r="desc",void(d.key===t&&(r="asc"===d.dir?"desc":"asc"),z({sort:"timestamp"===t?void 0:t,dir:"desc"===r?void 0:r,page:void 0}))}:void 0,children:x(e.labelKey)},e.id))]})}),(0,n.jsxs)("tbody",{children:[t.map(e=>{let t=C.has(e.turnId),r=e.userText.trim()||x("usage.turn.noPrompt");return(0,n.jsx)(N,{turn:e,isOpen:t,onToggle:()=>{var t;return t=e.turnId,void E(e=>{let r=new Set(e);return r.has(t)?r.delete(t):r.add(t),r})},userText:r,expandLabel:x("usage.turn.expand"),collapseLabel:x("usage.turn.collapse"),activeColumns:q,locale:h,t:x,codexFastActive:m},e.turnId)}),0===t.length&&(0,n.jsx)("tr",{children:(0,n.jsx)("td",{colSpan:H,className:"px-3 py-8 text-center text-text-tertiary text-sm",children:x("common.noMatchingRows")})})]})]})})}),i>1&&(0,n.jsxs)("div",{className:"flex items-center justify-between mt-3 text-xs text-text-secondary",children:[(0,n.jsx)("span",{children:x("common.pageOf",{page:l+1,total:i})}),(0,n.jsxs)("div",{className:"flex items-center gap-2",children:[(0,n.jsx)("button",{onClick:()=>O(0),disabled:0===l,className:"btn-ghost disabled:opacity-40",children:x("common.first")}),(0,n.jsx)("button",{onClick:()=>O(l-1),disabled:0===l,className:"btn-ghost disabled:opacity-40",children:x("common.prev")}),(0,n.jsx)("button",{onClick:()=>O(l+1),disabled:l>=i-1,className:"btn-ghost disabled:opacity-40",children:x("common.next")}),(0,n.jsx)("button",{onClick:()=>O(i-1),disabled:l>=i-1,className:"btn-ghost disabled:opacity-40",children:x("common.last")})]})]})]})}function N(e){let{turn:t,isOpen:r,onToggle:a,userText:s,expandLabel:o,collapseLabel:l,activeColumns:i,locale:d,t:u,codexFastActive:m}=e,x=(1===t.models.length?(0,c.P6)(t.models[0]):"".concat((0,c.P6)(t.models[0])," +").concat(t.models.length-1))+(t.efforts.length?1===t.efforts.length?" \xb7 ".concat(t.efforts[0]):" \xb7 ".concat(t.efforts[0],"+").concat(t.efforts.length-1):""),h=t.toolNames.length?t.toolNames.slice(0,3).join(", ")+(t.toolNames.length>3?"…":""):"—";return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsxs)("tr",{className:"border-b border-border last:border-b-0 hover:bg-bg-surface-hi/40 cursor-pointer",onClick:a,children:[(0,n.jsx)("td",{className:"px-2 py-2 text-text-tertiary w-6 text-center select-none",children:(0,n.jsx)("span",{title:r?l:o,className:"inline-block w-4",children:r?"▾":"▸"})}),i.map(e=>(0,n.jsx)("td",{className:(0,c.cn)("px-3 py-2","right"===e.align?"text-right":"text-left"),children:function(e,t,r,a,s,o,l,i){switch(e){case"time":return(0,n.jsx)("span",{className:"num-mono text-text-secondary whitespace-nowrap text-xs",title:"started ".concat((0,c.r6)(t.timestamp),"\nended ").concat((0,c.r6)(t.endTimestamp)),children:(0,c.r6)(t.timestamp)});case"duration":return(0,n.jsx)("span",{className:"num-mono text-text-secondary whitespace-nowrap text-xs",title:"".concat((0,c.r6)(t.timestamp)," → ").concat((0,c.r6)(t.endTimestamp)),children:(0,c.a3)(t.durationMs)});case"prompt":return(0,n.jsx)(g.j,{maxWidth:460,panelClassName:"p-3 text-sm text-text-secondary leading-relaxed",content:(0,n.jsx)("div",{className:"whitespace-pre-wrap break-words",children:s}),children:(0,n.jsx)("span",{className:"block text-text-secondary truncate max-w-[280px]",children:s})});case"model":return(0,n.jsxs)("span",{className:"inline-flex items-center gap-1.5 whitespace-nowrap",children:[(0,n.jsxs)("span",{className:"text-text-primary",children:[r,i&&"codex"===t.source&&(0,n.jsx)("span",{className:"font-semibold text-warning",title:l("usage.badge.fastHint"),children:"\xb7".concat(l("usage.badge.fast"))})]}),t.hasWorkflowSubagents&&(0,n.jsxs)("span",{className:"inline-flex items-center gap-0.5 px-1.5 py-0.5 rounded-full text-[10px] font-semibold leading-none bg-brand/10 text-brand border border-brand/20",title:l("usage.badge.workflowHint",{count:t.workflowSubagentCount}),children:[(0,n.jsx)("svg",{width:"9",height:"9",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":!0,children:(0,n.jsx)("path",{d:"M13 2 3 14h7l-1 8 10-12h-7z"})}),l("usage.badge.workflow"),t.workflowSubagentCount>1?" \xd7".concat(t.workflowSubagentCount):""]})]});case"project":return(0,n.jsx)("span",{className:"block text-text-secondary truncate max-w-[180px]",title:t.cwd,children:t.projectLabel||(0,c.PJ)(t.cwd)});case"session":return(0,n.jsx)("span",{className:"num-mono text-text-tertiary text-xs",title:t.sessionId,children:(0,c.BC)(t.sessionId)});case"calls":return(0,n.jsx)("span",{className:"num-mono text-text-secondary",children:t.callCount});case"input":return(0,n.jsx)("span",{className:"num-mono text-text-secondary",children:(0,c.jh)(t.inputTokens,o)});case"output":return(0,n.jsx)("span",{className:"num-mono text-text-secondary",children:(0,c.jh)(t.outputTokens,o)});case"cacheRead":return(0,n.jsx)("span",{className:"num-mono text-success",children:(0,c.jh)(t.cacheReadTokens,o)});case"cacheWrite":return(0,n.jsx)("span",{className:"num-mono text-text-secondary",children:(0,c.jh)(t.cacheCreationTokens,o)});case"total":return(0,n.jsx)(g.j,{align:"right",maxWidth:300,panelClassName:"p-0 overflow-hidden",content:(0,n.jsx)(k,{row:t,locale:o,t:l}),children:(0,n.jsx)("span",{className:"num-mono text-text-primary font-medium border-b border-dashed border-border hover:border-text-tertiary cursor-help",children:(0,c.jh)(t.totalTokens,o)})});case"cost":return(0,n.jsx)("span",{className:"num-mono text-text-primary font-medium",children:(0,c.l7)(t.cost)});case"tools":return(0,n.jsx)("span",{className:"block text-xs text-text-tertiary truncate max-w-[160px]",title:t.toolNames.join(", "),children:a})}}(e.id,t,x,h,s,d,u,m)},e.id))]}),r&&t.children.map(e=>(0,n.jsxs)("tr",{className:"border-b border-border last:border-b-0 bg-bg-surface-hi/20 text-text-tertiary",children:[(0,n.jsx)("td",{className:"px-2 py-1.5 w-6"}),i.map(r=>(0,n.jsx)("td",{className:(0,c.cn)("px-3 py-1.5","right"===r.align?"text-right":"text-left"),children:function(e,t,r,a,s,o){switch(e){case"time":return(0,n.jsx)("span",{className:"num-mono whitespace-nowrap text-xs inline-block translate-x-5",children:(0,c.r6)(t.timestamp)});case"duration":return(0,n.jsx)("span",{className:"text-xs text-text-tertiary",children:"—"});case"prompt":{var l;let e=(null!=(l=t.directPrompt)?l:"").trim();if(e&&e!==r.trim())return(0,n.jsx)("span",{className:"block text-xs text-text-secondary truncate max-w-[320px]",title:e,children:e});if(!t.toolNames.length)return(0,n.jsx)("span",{className:"text-xs text-text-tertiary",children:"—"});let a=t.toolNames.join(", "),s=t.toolNames.slice(0,3).join(", ")+(t.toolNames.length>3?"…":"");return(0,n.jsx)("span",{className:"block text-xs text-text-secondary truncate max-w-[280px]",title:a,children:s})}case"model":return(0,n.jsxs)("span",{className:"whitespace-nowrap",children:[(0,c.P6)(t.model),t.effort?" \xb7 ".concat(t.effort):"",o&&"codex"===t.source&&(0,n.jsx)("span",{className:"font-semibold text-warning",title:s("usage.badge.fastHint"),children:"\xb7".concat(s("usage.badge.fast"))})]});case"project":return(0,n.jsx)("span",{className:"block truncate max-w-[180px]",title:t.cwd,children:t.projectLabel||(0,c.PJ)(t.cwd)});case"session":return(0,n.jsx)("span",{className:"num-mono text-xs",title:t.sessionId,children:(0,c.BC)(t.sessionId)});case"calls":return(0,n.jsx)("span",{className:"num-mono",children:"1"});case"input":return(0,n.jsx)("span",{className:"num-mono",children:(0,c.jh)(t.inputTokens,a)});case"output":return(0,n.jsx)("span",{className:"num-mono",children:(0,c.jh)(t.outputTokens,a)});case"cacheRead":return(0,n.jsx)("span",{className:"num-mono text-success",children:(0,c.jh)(t.cacheReadTokens,a)});case"cacheWrite":return(0,n.jsx)("span",{className:"num-mono",children:(0,c.jh)(t.cacheCreationTokens,a)});case"total":return(0,n.jsx)(g.j,{align:"right",maxWidth:300,panelClassName:"p-0 overflow-hidden",content:(0,n.jsx)(k,{row:t,locale:a,t:s}),children:(0,n.jsx)("span",{className:"num-mono border-b border-dashed border-border/60 hover:border-text-tertiary cursor-help",children:(0,c.jh)(t.totalTokens,a)})});case"cost":return(0,n.jsx)("span",{className:"num-mono",children:(0,c.l7)(t.cost)});case"tools":return(0,n.jsx)("span",{className:"block text-xs truncate max-w-[160px]",title:t.toolNames.join(", "),children:t.toolNames.length?t.toolNames.join(", "):"—"})}}(r.id,e,t.userText,d,u,m)},r.id))]},e.uuid))]})}function k(e){let{row:t,locale:r,t:s}=e,o=[{key:"input",label:s("usage.col.input"),tokens:t.inputTokens,cost:t.costInput,tone:"text-text-primary",dot:"bg-chart-input"},{key:"output",label:s("usage.col.output"),tokens:t.outputTokens,cost:t.costOutput,tone:"text-text-primary",dot:"bg-chart-output"},{key:"cacheRead",label:s("usage.col.cacheRead"),tokens:t.cacheReadTokens,cost:t.costCacheRead,tone:"text-success",dot:"bg-chart-cache-read"},{key:"cacheWrite",label:s("usage.col.cacheWrite"),tokens:t.cacheCreationTokens,cost:t.costCacheWrite,tone:"text-text-primary",dot:"bg-chart-cache-create"}];return(0,n.jsxs)("div",{className:"text-xs",children:[(0,n.jsx)("div",{className:"px-3 py-2 border-b border-border bg-bg-surface-hi/40 text-text-tertiary uppercase tracking-wide font-medium",children:s("usage.breakdown.title")}),(0,n.jsxs)("div",{className:"px-3 py-2",children:[(0,n.jsxs)("div",{className:"grid grid-cols-[auto_1fr_auto] gap-x-3 gap-y-1.5 items-center",children:[(0,n.jsx)("span",{}),(0,n.jsx)("span",{className:"text-text-tertiary text-[10px] uppercase tracking-wide text-right",children:s("usage.breakdown.headerTokens")}),(0,n.jsx)("span",{className:"text-text-tertiary text-[10px] uppercase tracking-wide text-right",children:s("usage.breakdown.headerCost")}),o.map(e=>(0,n.jsxs)(a.Fragment,{children:[(0,n.jsxs)("span",{className:"inline-flex items-center gap-2 text-text-secondary",children:[(0,n.jsx)("span",{className:(0,c.cn)("w-2 h-2 rounded-sm",e.dot)}),e.label]}),(0,n.jsx)("span",{className:(0,c.cn)("num-mono text-right",e.tone),children:(0,c.jh)(e.tokens,r)}),(0,n.jsx)("span",{className:"num-mono text-right text-text-secondary",children:(0,c.l7)(e.cost)}),"output"===e.key&&t.reasoningTokens>0&&(0,n.jsxs)(a.Fragment,{children:[(0,n.jsxs)("span",{className:"inline-flex items-center gap-2 text-text-tertiary pl-4 text-[11px]",children:[(0,n.jsx)("span",{className:"text-text-tertiary",children:"↳"}),s("usage.breakdown.reasoning")]}),(0,n.jsx)("span",{className:"num-mono text-right text-text-tertiary text-[11px]",children:(0,c.jh)(t.reasoningTokens,r)}),(0,n.jsx)("span",{className:"text-right text-text-tertiary text-[11px]",children:s("usage.breakdown.reasoningNote")})]},"reasoning-detail")]},e.key))]}),(0,n.jsxs)("div",{className:"mt-2 pt-2 border-t border-border grid grid-cols-[auto_1fr_auto] gap-x-3 items-center",children:[(0,n.jsx)("span",{className:"text-text-secondary font-medium",children:s("usage.breakdown.total")}),(0,n.jsx)("span",{className:"num-mono text-right text-text-primary font-medium",children:(0,c.jh)(t.totalTokens,r)}),(0,n.jsx)("span",{className:"num-mono text-right text-text-primary font-medium",children:(0,c.l7)(t.cost)})]})]})]})}function S(e){let{children:t,align:r="left",sorted:a,dir:s,onClick:o}=e;return(0,n.jsx)("th",{className:(0,c.cn)("px-3 py-2 text-xs font-medium text-text-tertiary uppercase tracking-wide whitespace-nowrap","right"===r?"text-right":"text-left",o&&"cursor-pointer hover:text-text-primary select-none"),onClick:o,children:(0,n.jsxs)("span",{className:"inline-flex items-center gap-1",children:[t,a&&(0,n.jsx)("span",{className:"text-[10px]",children:"asc"===s?"▲":"▼"})]})})}var T=r(1189);let C=[{value:"hour",tk:"gran.hour"},{value:"day",tk:"gran.day"},{value:"week",tk:"gran.week"},{value:"month",tk:"gran.month"}];function E(e){let{defaultValue:t="day"}=e,r=(0,o.kj)();return(0,n.jsx)(T.SegmentedPicker,{paramKey:"gran",defaultValue:t,options:C,ariaLabel:r("gran.label")})}let L=new Map;function K(e){let{initial:t,costFootnote:r}=e,u=(0,o.kj)(),{locale:m}=(0,o.s9)(),x=(0,s.useSearchParams)();t&&!L.has(t.url)&&L.set(t.url,t.payload);let p=(0,a.useMemo)(()=>{var e;return(e=x.toString())?"/api/turns?".concat(e):"/api/turns"},[x]),[g,b]=(0,a.useState)(()=>{var e;return null!=(e=L.get(p))?e:null}),[f,v]=(0,a.useState)(!L.has(p)),[j,y]=(0,a.useState)(null),N=(0,a.useRef)(0);if((0,a.useEffect)(()=>{let e=++N.current,t=L.get(p);t?(b(t),v(!1)):v(!0),y(null),fetch(p,{cache:"no-store"}).then(e=>{if(!e.ok)throw Error("HTTP ".concat(e.status));return e.json()}).then(t=>{e===N.current&&(L.set(p,t),b(t),v(!1))}).catch(t=>{e===N.current&&(y(t.message),v(!1))})},[p]),(0,a.useEffect)(()=>{function e(){L.clear(),N.current++;let e=N.current;fetch(p,{cache:"no-store"}).then(e=>e.json()).then(t=>{e===N.current&&(L.set(p,t),b(t))}).catch(()=>{})}return window.addEventListener("ccgauge:refresh",e),()=>window.removeEventListener("ccgauge:refresh",e)},[p]),!g)return j?(0,n.jsxs)("div",{className:"card mt-4 p-6 text-sm text-warning",children:[u("common.empty.title"),": ",j]}):(0,n.jsx)(R,{});if(!g.hasAnyRecords)return(0,n.jsx)(i.pp,{title:u("common.empty.title"),desc:u("common.empty.desc")});let k=g.totals.totalTokens>0?g.totals.cacheReadTokens/Math.max(1,g.totals.cacheReadTokens+g.totals.inputTokens+g.totals.cacheCreationTokens):0;return(0,n.jsxs)("div",{className:f?"opacity-90":"","aria-busy":f,children:[(0,n.jsxs)("div",{className:"usage-overview-block grid grid-cols-2 md:grid-cols-4 gap-4 mt-4",children:[(0,n.jsx)(d,{label:u("usage.kpi.totalTokens"),value:(0,c.jh)(g.totals.totalTokens,m)}),(0,n.jsx)(d,{label:u("usage.kpi.totalCost"),value:(0,c.az)(g.totals.cost),hint:r||void 0}),(0,n.jsx)(d,{label:u("usage.kpi.cacheSaved"),value:(0,c.az)(g.totals.saved),accent:"success"}),(0,n.jsx)(d,{label:u("usage.kpi.cacheHit"),value:(0,c.R8)(k,0),accent:"success"})]}),(0,n.jsx)(i.wn,{title:u("usage.trend"),desc:u("usage.trend.gran",{gran:(0,l.nA)(m,"gran.".concat(g.gran))}),right:(0,n.jsx)(E,{defaultValue:g.gran}),className:"usage-overview-block mt-4",children:(0,n.jsx)(h.TokenStackChart,{data:g.trend})}),(0,n.jsx)(i.wn,{title:u("usage.requests.title"),desc:u("usage.requests.desc"),className:"mt-4",children:(0,n.jsx)(w,{rows:g.turns,totalCount:g.totalCount,page:g.page,pageCount:g.pageCount,sort:g.sort,query:g.query,codexFastActive:g.codexFastActive})})]})}function R(){return(0,n.jsxs)("div",{children:[(0,n.jsx)("div",{className:"usage-overview-block grid grid-cols-2 md:grid-cols-4 gap-4 mt-4",children:Array.from({length:4}).map((e,t)=>(0,n.jsxs)("div",{className:"card p-4",children:[(0,n.jsx)("div",{className:"h-3 w-24 rounded bg-bg-surface-hi/40 animate-pulse"}),(0,n.jsx)("div",{className:"h-7 w-28 mt-3 rounded bg-bg-surface-hi/60 animate-pulse"})]},t))}),(0,n.jsx)("div",{className:"usage-overview-block card mt-4 h-72 bg-bg-surface-hi/30 animate-pulse"}),(0,n.jsx)("div",{className:"card mt-4 p-4 space-y-2",children:Array.from({length:8}).map((e,t)=>(0,n.jsx)("div",{className:"h-7 rounded bg-bg-surface-hi/40 animate-pulse"},t))})]})}},8336:(e,t,r)=>{"use strict";r.d(t,{ModelFilter:()=>l});var n=r(95155),a=r(35850),s=r(25016),o=r(51148);function l(e){let{all:t,selected:r}=e,l=(0,o.kj)();return(0,n.jsx)(a.K,{paramKey:"models",all:t,selected:r,render:s.P6,labelAllKey:"filter.modelAll",labelSingleKey:"filter.modelSingle",labelMultiKey:"filter.modelMulti",ariaLabel:l("filter.modelLabel")})}},14920:(e,t,r)=>{"use strict";r.d(t,{ProjectFilter:()=>l});var n=r(95155),a=r(35850),s=r(25016),o=r(51148);function l(e){let{all:t,selected:r}=e,l=(0,o.kj)();return(0,n.jsx)(a.K,{paramKey:"projects",all:t,selected:r,render:s.PJ,labelAllKey:"filter.projectAll",labelSingleKey:"filter.projectSingle",labelMultiKey:"filter.projectMulti",ariaLabel:l("filter.projectLabel")})}},20857:(e,t,r)=>{"use strict";r.d(t,{H:()=>o});var n=r(95155),a=r(12115),s=r(25016);function o(e){let{children:t,className:r}=e,o=(0,a.useRef)(null),[l,i]=(0,a.useState)(!1),[c,d]=(0,a.useState)(!1);return(0,a.useEffect)(()=>{let e=o.current;if(!e)return;function t(){if(!e)return;let{scrollLeft:t,scrollWidth:r,clientWidth:n}=e;i(t>4),d(t+n<r-4)}t(),e.addEventListener("scroll",t,{passive:!0});let r=new ResizeObserver(t);return r.observe(e),()=>{e.removeEventListener("scroll",t),r.disconnect()}},[]),(0,n.jsxs)("div",{className:(0,s.cn)("relative",r),children:[(0,n.jsx)("div",{ref:o,className:"overflow-x-auto",children:t}),(0,n.jsx)("div",{"aria-hidden":!0,className:(0,s.cn)("pointer-events-none absolute left-0 top-0 bottom-0 w-8 bg-gradient-to-r from-bg-surface to-transparent transition-opacity duration-150",l?"opacity-100":"opacity-0")}),(0,n.jsx)("div",{"aria-hidden":!0,className:(0,s.cn)("pointer-events-none absolute right-0 top-0 bottom-0 w-8 bg-gradient-to-l from-bg-surface to-transparent transition-opacity duration-150",c?"opacity-100":"opacity-0")})]})}},35850:(e,t,r)=>{"use strict";r.d(t,{K:()=>c});var n=r(95155),a=r(20063),s=r(12115),o=r(25016),l=r(51148),i=r(40464);function c(e){let t,{paramKey:r,all:c,selected:d,render:u=e=>e,labelAllKey:m,labelSingleKey:x,labelMultiKey:h,ariaLabel:p,searchThreshold:g=6}=e,b=(0,a.usePathname)(),f=(0,a.useSearchParams)(),v=(0,l.kj)(),{pending:j,navigate:y}=(0,i.q)(),[w,N]=(0,s.useState)(!1),[k,S]=(0,s.useState)(""),[T,C]=(0,s.useState)(0),E=(0,s.useRef)(null),L=(0,s.useRef)(null),K=(0,s.useRef)(null),R=(0,s.useRef)(null),P=(0,s.useId)(),M=(0,s.useId)();(0,s.useEffect)(()=>{if(w)return document.addEventListener("mousedown",e),document.addEventListener("keydown",t),()=>{document.removeEventListener("mousedown",e),document.removeEventListener("keydown",t)};function e(e){E.current&&!E.current.contains(e.target)&&N(!1)}function t(e){if("Escape"===e.key){var t;N(!1),null==(t=L.current)||t.focus()}}},[w]),(0,s.useEffect)(()=>{w&&c.length>=g&&requestAnimationFrame(()=>{var e;return null==(e=K.current)?void 0:e.focus()}),w||(S(""),C(0))},[w,c.length,g]);let A=(0,s.useMemo)(()=>{let e=k.trim().toLowerCase();return e?c.filter(t=>u(t).toLowerCase().includes(e)||t.toLowerCase().includes(e)):c},[c,k,u]);function I(e){let t=new URLSearchParams(f.toString());0===e.size?t.delete(r):t.set(r,Array.from(e).join(","));let n=t.toString();y(n?"".concat(b,"?").concat(n):b)}function D(e){let t=new Set(d);t.has(e)?t.delete(e):t.add(e),I(t)}function F(e){if("ArrowDown"===e.key)e.preventDefault(),C(e=>Math.min(A.length-1,e+1));else if("ArrowUp"===e.key)e.preventDefault(),C(e=>Math.max(0,e-1));else if("Enter"===e.key){e.preventDefault();let t=A[T];t&&D(t)}else"Home"===e.key?(e.preventDefault(),C(0)):"End"===e.key&&(e.preventDefault(),C(A.length-1))}t=0===d.length?v(m):1===d.length?v(x,{value:u(d[0])}):v(h,{count:d.length});let W=c.length>=g;return(0,n.jsxs)("div",{ref:E,className:(0,o.cn)("relative",j&&"opacity-60 cursor-progress"),"aria-busy":j,children:[(0,n.jsxs)("button",{ref:L,id:P,onClick:()=>N(e=>!e),className:"btn focus:outline-none focus-visible:ring-2 focus-visible:ring-brand/40","aria-haspopup":"listbox","aria-expanded":w,"aria-controls":M,"aria-label":p,children:[t,(0,n.jsx)("span",{className:"text-text-tertiary ml-1","aria-hidden":!0,children:"▾"})]}),w&&(0,n.jsxs)("div",{id:M,role:"listbox","aria-multiselectable":"true","aria-labelledby":P,className:"absolute right-0 mt-1 w-72 card border-border-hi shadow-lg z-20 overflow-hidden",children:[d.length>0&&(0,n.jsxs)("div",{className:"px-2 pt-2 pb-1.5 border-b border-border flex flex-wrap gap-1 items-center",children:[d.slice(0,6).map(e=>(0,n.jsxs)("button",{onClick:()=>D(e),className:"inline-flex items-center gap-1 max-w-[160px] pl-2 pr-1.5 py-0.5 text-[11px] rounded-full bg-brand/10 text-brand border border-brand/20 hover:bg-brand/15","aria-label":"Remove ".concat(u(e)),title:u(e),children:[(0,n.jsx)("span",{className:"truncate",children:u(e)}),(0,n.jsx)("span",{"aria-hidden":!0,className:"text-brand/70",children:"\xd7"})]},e)),d.length>6&&(0,n.jsxs)("span",{className:"text-[11px] text-text-tertiary px-1",children:["+",d.length-6]}),(0,n.jsx)("button",{onClick:function(){I(new Set)},className:"ml-auto text-[11px] text-text-tertiary hover:text-text-primary px-1.5 py-0.5",children:v("filter.clearAll")})]}),W&&(0,n.jsx)("div",{className:"p-2 border-b border-border",children:(0,n.jsx)("input",{ref:K,value:k,onChange:e=>{S(e.target.value),C(0)},onKeyDown:e=>{("ArrowDown"===e.key||"ArrowUp"===e.key||"Enter"===e.key||"Home"===e.key||"End"===e.key)&&F(e)},placeholder:v("common.searchPlaceholder"),className:"w-full px-2 py-1 text-sm rounded border border-border bg-bg-surface focus:outline-none focus:border-border-hi placeholder:text-text-tertiary text-text-primary"})}),(0,n.jsxs)("div",{ref:R,onKeyDown:F,className:"max-h-64 overflow-y-auto p-1 outline-none",tabIndex:-1,children:[0===A.length&&(0,n.jsx)("div",{className:"text-xs text-text-tertiary px-2 py-3 text-center",children:v("filter.noOptions")}),A.map((e,t)=>{let r=d.includes(e),a=t===T;return(0,n.jsxs)("button",{role:"option","aria-selected":r,onMouseEnter:()=>C(t),onClick:()=>D(e),className:(0,o.cn)("w-full text-left text-sm px-2 py-1.5 rounded flex items-center gap-2 transition-colors",a?"bg-bg-surface-hi":"hover:bg-bg-surface-hi",r&&"text-text-primary"),children:[(0,n.jsx)("span",{className:(0,o.cn)("w-3.5 h-3.5 rounded-sm border flex items-center justify-center text-[10px] flex-shrink-0",r?"bg-brand border-brand text-white":"border-border-hi"),"aria-hidden":!0,children:r?"✓":""}),(0,n.jsx)("span",{className:"truncate",children:u(e)})]},e)})]})]})]})}},40464:(e,t,r)=>{"use strict";r.d(t,{q:()=>s});var n=r(12115),a=r(20063);function s(){let e=(0,a.useRouter)(),[t,r]=(0,n.useTransition)();return{pending:t,navigate:function(t){r(()=>{e.push(t)})}}}},44512:(e,t,r)=>{"use strict";r.d(t,{OverviewToggle:()=>c});var n=r(95155),a=r(12115),s=r(25016),o=r(51148);let l="data-usage-overview",i="hidden";function c(){let e=(0,o.kj)(),[t,r]=(0,a.useState)(!1);return(0,a.useEffect)(()=>{r(document.documentElement.getAttribute(l)===i)},[]),(0,n.jsxs)("button",{type:"button",onClick:function(){let e=!t;r(e);try{localStorage.setItem("ccgauge.usage.overview.hidden",e?"1":"0")}catch(e){}e?document.documentElement.setAttribute(l,i):document.documentElement.removeAttribute(l)},"aria-pressed":!t,title:e(t?"usage.overview.show":"usage.overview.hide"),className:(0,s.cn)("inline-flex items-center gap-1.5 px-2.5 py-1.5 rounded-button text-xs font-medium","border transition-colors duration-150",t?"border-border bg-bg-surface text-text-secondary hover:text-text-primary hover:bg-bg-surface-hi":"border-brand/40 bg-brand/12 text-brand hover:bg-brand/20 hover:border-brand/60"),children:[(0,n.jsx)(d,{open:!t}),(0,n.jsx)("span",{className:"hidden sm:inline",children:e("usage.overview.label")})]})}function d(e){let{open:t}=e;return(0,n.jsx)("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":!0,children:t?(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)("path",{d:"M2 12s3.5-7 10-7 10 7 10 7-3.5 7-10 7-10-7-10-7Z"}),(0,n.jsx)("circle",{cx:"12",cy:"12",r:"3"})]}):(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)("path",{d:"M9.88 9.88a3 3 0 0 0 4.24 4.24"}),(0,n.jsx)("path",{d:"M10.73 5.08A11 11 0 0 1 12 5c6.5 0 10 7 10 7a13.16 13.16 0 0 1-1.67 2.68"}),(0,n.jsx)("path",{d:"M6.61 6.61A13.526 13.526 0 0 0 2 12s3.5 7 10 7a9.74 9.74 0 0 0 5.39-1.61"}),(0,n.jsx)("line",{x1:"2",y1:"2",x2:"22",y2:"22"})]})})}},46227:(e,t,r)=>{"use strict";r.d(t,{j:()=>l});var n=r(95155),a=r(12115),s=r(47650),o=r(25016);function l(e){let{children:t,content:r,className:l,panelClassName:i,align:c="left",delay:d=100,maxWidth:u=360}=e,m=(0,a.useRef)(null),x=(0,a.useRef)(null),h=(0,a.useRef)(null),[p,g]=(0,a.useState)(null),[b,f]=(0,a.useState)(!1),[v,j]=(0,a.useState)(!1);function y(){h.current&&(window.clearTimeout(h.current),h.current=null),v||(x.current=window.setTimeout(()=>{let e=function(){let e,t=m.current;if(!t)return null;let r=t.getBoundingClientRect(),n=Math.min(u,window.innerWidth-16),a=window.innerHeight-r.bottom<200?"top":"bottom";return"right"===c?(e=Math.min(r.right,window.innerWidth-8))-n<8&&(e=n+8):(e=Math.max(r.left,8))+n>window.innerWidth-8&&(e=window.innerWidth-n-8),{x:e,y:"bottom"===a?r.bottom+8:r.top-8,placement:a,align:c}}();e&&(g(e),j(!0))},d))}function w(){x.current&&(window.clearTimeout(x.current),x.current=null),h.current=window.setTimeout(()=>j(!1),80)}return(0,a.useEffect)(()=>f(!0),[]),(0,a.useEffect)(()=>()=>{x.current&&window.clearTimeout(x.current),h.current&&window.clearTimeout(h.current)},[]),(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)("span",{ref:m,onMouseEnter:y,onMouseLeave:w,onFocus:y,onBlur:w,className:(0,o.cn)("inline-block",l),children:t}),b&&p&&(0,s.createPortal)((0,n.jsx)("div",{onMouseEnter:()=>{h.current&&(window.clearTimeout(h.current),h.current=null)},onMouseLeave:w,style:{position:"fixed",left:"right"===p.align?void 0:p.x,right:"right"===p.align?window.innerWidth-p.x:void 0,top:"bottom"===p.placement?p.y:void 0,bottom:"top"===p.placement?window.innerHeight-p.y:void 0,maxWidth:u,transform:v?"translateY(0) scale(1)":"bottom"===p.placement?"translateY(-4px) scale(0.98)":"translateY(4px) scale(0.98)",opacity:+!!v,transitionProperty:"opacity, transform",transitionDuration:"120ms",transitionTimingFunction:"cubic-bezier(0.16, 1, 0.3, 1)",transformOrigin:"bottom"===p.placement?"top":"bottom",pointerEvents:v?"auto":"none"},className:(0,o.cn)("z-50 card border-border-hi shadow-xl rounded-button",i),children:r}),document.body)]})}},73896:(e,t,r)=>{"use strict";r.d(t,{RangePicker:()=>v});var n=r(95155),a=r(20063),s=r(12115),o=r(25016),l=r(51148),i=r(76243),c=r(76043),d=r(82006);function u(e){let{selected:t,onSelect:r,toDate:a}=e,{locale:s}=(0,l.s9)(),o="zh"===s?c.g:d.c,u=null!=a?a:new Date;return(0,n.jsx)(i.h,{mode:"range",locale:o,selected:t,onSelect:r,endMonth:u,disabled:{after:u},numberOfMonths:1})}var m=r(40464);let x=[{value:"1d",tk:"range.today"},{value:"7d",tk:"range.7d"},{value:"30d",tk:"range.30d"},{value:"90d",tk:"range.90d"},{value:"all",tk:"range.all"}],h=/^\d{4}-\d{2}-\d{2}$/;function p(e){if(!h.test(e)||!h.exec(e))return!1;let t=Number(e.slice(0,4)),r=Number(e.slice(5,7)),n=Number(e.slice(8,10)),a=new Date(t,r-1,n);return!Number.isNaN(a.getTime())&&a.getFullYear()===t&&a.getMonth()===r-1&&a.getDate()===n}function g(e){if(!p(e))return;let t=Number(e.slice(0,4));return new Date(t,Number(e.slice(5,7))-1,Number(e.slice(8,10)))}function b(e){let t=e.getFullYear(),r=String(e.getMonth()+1).padStart(2,"0"),n=String(e.getDate()).padStart(2,"0");return"".concat(t,"-").concat(r,"-").concat(n)}function f(e,t){if(!p(e))return e;let r=new Date(e+"T00:00:00");return new Intl.DateTimeFormat(t,{month:"short",day:"numeric"}).format(r)}function v(e){let{defaultValue:t="7d"}=e,r=(0,a.usePathname)(),i=(0,a.useSearchParams)(),{t:c,locale:d}=(0,l.s9)(),{pending:h,navigate:p}=(0,m.q)(),v=i.get("range")||t,j=x.some(e=>e.value===v),y="custom"===v,w=j?v:y?"custom":t,N=i.get("from")||"",k=i.get("to")||"",[S,T]=(0,s.useState)(!1),[C,E]=(0,s.useState)(()=>({from:g(N),to:g(k)})),L=(0,s.useRef)(null);(0,s.useEffect)(()=>{E({from:g(N),to:g(k)})},[N,k,S]),(0,s.useEffect)(()=>{if(S)return document.addEventListener("mousedown",e),document.addEventListener("keydown",t),()=>{document.removeEventListener("mousedown",e),document.removeEventListener("keydown",t)};function e(e){L.current&&!L.current.contains(e.target)&&T(!1)}function t(e){"Escape"===e.key&&T(!1)}},[S]);let K=y&&N?k?"".concat(f(N,d)," – ").concat(f(k,d)):"".concat(f(N,d)," →"):c("range.custom"),R=(null==C?void 0:C.from)?new Intl.DateTimeFormat(d,{year:"numeric",month:"short",day:"numeric"}).format(C.from):"",P=(null==C?void 0:C.to)?new Intl.DateTimeFormat(d,{year:"numeric",month:"short",day:"numeric"}).format(C.to):"";return(0,n.jsxs)("div",{ref:L,className:(0,o.cn)("flex items-center gap-1",h&&"opacity-60 cursor-progress"),"aria-busy":h,children:[(0,n.jsx)("div",{role:"radiogroup","aria-label":c("range.label"),className:"inline-flex rounded-button border border-border bg-bg-surface p-0.5 gap-0.5",children:x.map(e=>{let t=w===e.value;return(0,n.jsx)("button",{role:"radio","aria-checked":t,tabIndex:t?0:-1,onClick:()=>(function(e){let t=new URLSearchParams(i.toString());t.set("range",e),t.delete("from"),t.delete("to"),p("".concat(r,"?").concat(t.toString())),T(!1)})(e.value),className:(0,o.cn)("px-2.5 py-1 text-xs rounded transition-all","focus:outline-none focus-visible:ring-2 focus-visible:ring-brand/40",t?"bg-brand-strong text-white font-semibold shadow-sm ring-1 ring-brand/40":"text-text-tertiary font-medium hover:text-text-primary hover:bg-bg-surface-hi"),children:c(e.tk)},e.value)})}),(0,n.jsxs)("div",{className:"relative",children:[(0,n.jsxs)("button",{type:"button","aria-haspopup":"dialog","aria-expanded":S,onClick:()=>T(e=>!e),className:(0,o.cn)("px-2.5 py-1 text-xs rounded-button border transition-all inline-flex items-center gap-1","focus:outline-none focus-visible:ring-2 focus-visible:ring-brand/40",y?"bg-brand-strong text-white font-semibold shadow-sm ring-1 ring-brand/40 border-transparent":"border-border bg-bg-surface text-text-tertiary font-medium hover:text-text-primary hover:bg-bg-surface-hi"),children:[(0,n.jsx)("span",{children:K}),(0,n.jsx)("span",{"aria-hidden":!0,className:(0,o.cn)(y?"text-white/80":"text-text-tertiary"),children:"▾"})]}),S&&(0,n.jsxs)("div",{role:"dialog","aria-label":c("range.custom"),className:"absolute right-0 mt-1.5 z-20 w-[324px] rounded-card border border-border-hi bg-bg-elevated shadow-popover",children:[(0,n.jsxs)("div",{className:"grid grid-cols-2 gap-3 px-4 pt-4 pb-3",children:[(0,n.jsxs)("div",{className:"min-w-0",children:[(0,n.jsx)("div",{className:"label",children:c("range.from")}),(0,n.jsx)("div",{className:(0,o.cn)("mt-1 text-sm tabular-nums truncate",(null==C?void 0:C.from)?"text-text-primary font-semibold":"text-text-tertiary"),children:(null==C?void 0:C.from)?R:"—"})]}),(0,n.jsxs)("div",{className:"min-w-0",children:[(0,n.jsx)("div",{className:"label",children:c("range.to")}),(0,n.jsx)("div",{className:(0,o.cn)("mt-1 text-sm tabular-nums truncate",(null==C?void 0:C.to)?"text-text-primary font-semibold":"text-text-tertiary"),children:(null==C?void 0:C.to)?P:"—"})]})]}),(0,n.jsx)("div",{className:"divider-soft"}),(0,n.jsx)("div",{className:"px-3 pt-3 pb-2 flex justify-center",children:(0,n.jsx)(u,{selected:C,onSelect:E})}),(0,n.jsx)("div",{className:"divider-soft"}),(0,n.jsxs)("div",{className:"flex justify-end gap-2 px-4 py-3",children:[(0,n.jsx)("button",{type:"button",onClick:()=>T(!1),className:"btn-ghost text-sm focus:outline-none focus-visible:ring-2 focus-visible:ring-brand/40",children:c("range.cancel")}),(0,n.jsx)("button",{type:"button",onClick:function(){let e=null==C?void 0:C.from;if(!e)return;let t=null==C?void 0:C.to,n=new URLSearchParams(i.toString());n.set("range","custom"),n.set("from",b(e)),t?n.set("to",b(t)):n.delete("to"),p("".concat(r,"?").concat(n.toString())),T(!1)},disabled:!(null==C?void 0:C.from),className:(0,o.cn)("inline-flex items-center justify-center px-3 py-1.5 rounded-button text-sm font-semibold transition-colors","bg-brand-strong text-white","hover:bg-brand-hover","disabled:opacity-40 disabled:cursor-not-allowed disabled:hover:bg-brand-strong","focus:outline-none focus-visible:ring-2 focus-visible:ring-brand/40"),children:c("range.customApply")})]})]})]})]})}},78826:(e,t,r)=>{Promise.resolve().then(r.bind(r,77549)),Promise.resolve().then(r.bind(r,8336)),Promise.resolve().then(r.bind(r,44512)),Promise.resolve().then(r.bind(r,14920)),Promise.resolve().then(r.bind(r,73896)),Promise.resolve().then(r.bind(r,5955))}},e=>{e.O(0,[760,930,253,148,567,441,255,358],()=>e(e.s=78826)),_N_E=e.O()}]);
|