tokentracker-cli 1.0.2 → 1.0.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (96) hide show
  1. package/dashboard/dist/assets/{AchievementBadge-CBGtv8Gf.js → AchievementBadge-mGuF3SZV.js} +1 -1
  2. package/dashboard/dist/assets/{AchievementsPage-DBNXAqHB.js → AchievementsPage-CqgkEdCy.js} +2 -2
  3. package/dashboard/dist/assets/{AchievementsSection-D9ndOgjA.js → AchievementsSection-DVZBBX6U.js} +1 -1
  4. package/dashboard/dist/assets/{BadgeDetailModal-B_xo1k4z.js → BadgeDetailModal-Cv_PJVWo.js} +1 -1
  5. package/dashboard/dist/assets/{BotAnimated-OaYL-NrW.js → BotAnimated-CAqF-G07.js} +1 -1
  6. package/dashboard/dist/assets/{Card-BprDyWQy.js → Card-yUa-1eMj.js} +1 -1
  7. package/dashboard/dist/assets/{ClawdAnimated-DKzj5hnk.js → ClawdAnimated-CMG3gYTO.js} +2 -2
  8. package/dashboard/dist/assets/{CommandPalette-Y7y8uy9B.js → CommandPalette-BENO2SWB.js} +1 -1
  9. package/dashboard/dist/assets/{CommunityStatsModal-DtJjD6Gk.js → CommunityStatsModal-DrzMkmYd.js} +1 -1
  10. package/dashboard/dist/assets/{ConfirmModal-Dnq9wDSB.js → ConfirmModal-BzG_SVcZ.js} +1 -1
  11. package/dashboard/dist/assets/{Controls-B3LyuY9G.js → Controls-DiMs4jCI.js} +1 -1
  12. package/dashboard/dist/assets/{DashboardPage-uyz3GHPG.js → DashboardPage-Bkgu9gBF.js} +1 -1
  13. package/dashboard/dist/assets/{DevicePage-TBvBfX-E.js → DevicePage-JIPbcJj_.js} +1 -1
  14. package/dashboard/dist/assets/{DialogClose-C0xfVNxI.js → DialogClose-CAXMC_Ej.js} +1 -1
  15. package/dashboard/dist/assets/DialogDescription-q53be2If.js +1 -0
  16. package/dashboard/dist/assets/{DialogTitle-h96NnlwF.js → DialogTitle-BThuBA7Z.js} +1 -1
  17. package/dashboard/dist/assets/{FadeIn-BlT9LOhg.js → FadeIn-D_7oApb1.js} +1 -1
  18. package/dashboard/dist/assets/{HeaderGithubStar-BC8PlJFf.js → HeaderGithubStar-BfvlxDLm.js} +1 -1
  19. package/dashboard/dist/assets/{HoverTooltip-D2H0rvOx.js → HoverTooltip-DNdNDNui.js} +1 -1
  20. package/dashboard/dist/assets/{IpCheckPage-Bf9pTUyL.js → IpCheckPage-Bt2v2bcs.js} +1 -1
  21. package/dashboard/dist/assets/{LandingPage-CqFZZcgl.js → LandingPage-CSlXEZtQ.js} +2 -2
  22. package/dashboard/dist/assets/{LeaderboardAvatar-Bglw3mWk.js → LeaderboardAvatar-Dd6Q1LT0.js} +1 -1
  23. package/dashboard/dist/assets/{LeaderboardPage-Ba4rstvv.js → LeaderboardPage-BUf-DcVp.js} +2 -2
  24. package/dashboard/dist/assets/{LeaderboardProfileModal-DITfDxdj.js → LeaderboardProfileModal-BCI81oDf.js} +3 -3
  25. package/dashboard/dist/assets/{LeaderboardProfilePage-9DgMqaVi.js → LeaderboardProfilePage-CrE4dToF.js} +1 -1
  26. package/dashboard/dist/assets/{LimitsPage-Ct5IA5Ny.js → LimitsPage-swNbh5fv.js} +1 -1
  27. package/dashboard/dist/assets/{LocalOnlyNotice-DCgOvXBZ.js → LocalOnlyNotice-BDOSLg08.js} +1 -1
  28. package/dashboard/dist/assets/{LoginCard-Bo3St7wp.js → LoginCard-BJflNfwb.js} +1 -1
  29. package/dashboard/dist/assets/{LoginModal-CqN9Lhx0.js → LoginModal-CxZ6cxtY.js} +1 -1
  30. package/dashboard/dist/assets/{LoginPage-CLvn_ZAo.js → LoginPage-Ds85HImr.js} +1 -1
  31. package/dashboard/dist/assets/{PetPage-B-tmGNaA.js → PetPage-DZbmph67.js} +1 -1
  32. package/dashboard/dist/assets/{PopoverPopup-D0KIhAfw.js → PopoverPopup-JzxAr4q_.js} +1 -1
  33. package/dashboard/dist/assets/{ProviderIcon-DLytDN3-.js → ProviderIcon-MDkXefRU.js} +1 -1
  34. package/dashboard/dist/assets/{ResetPasswordPage-CGVTHdB9.js → ResetPasswordPage-CRvRNlWA.js} +1 -1
  35. package/dashboard/dist/assets/{SegmentedControl-B7gk-3QK.js → SegmentedControl-Bbw7Dypd.js} +1 -1
  36. package/dashboard/dist/assets/{Select-qbqB_qtp.js → Select-D1CFS_EY.js} +1 -1
  37. package/dashboard/dist/assets/{SelectItemText-Qzhp3UFE.js → SelectItemText-CHj4a14t.js} +1 -1
  38. package/dashboard/dist/assets/{ServiceStatusPage-DPe_EeVu.js → ServiceStatusPage-DFJSyj3M.js} +1 -1
  39. package/dashboard/dist/assets/{SessionsPage-Dza7qrmT.js → SessionsPage-BvIA_7Db.js} +1 -1
  40. package/dashboard/dist/assets/{SettingsPage-C_Am0uFM.js → SettingsPage-DxiO3RuB.js} +2 -2
  41. package/dashboard/dist/assets/{SkillsPage-Bsu5m-xp.js → SkillsPage-C1lMnXpP.js} +1 -1
  42. package/dashboard/dist/assets/{TokenGalaxy-COH6RLu3.js → TokenGalaxy-8ml284Vt.js} +1 -1
  43. package/dashboard/dist/assets/{ToolbarRootContext-B_XUhyzz.js → ToolbarRootContext-6-c1WW_C.js} +1 -1
  44. package/dashboard/dist/assets/{TrendMonitor-DMgbTVNO.js → TrendMonitor-Dtb1Vw8P.js} +1 -1
  45. package/dashboard/dist/assets/{WidgetsPage-gQTmgsN6.js → WidgetsPage-DI0m4BOv.js} +1 -1
  46. package/dashboard/dist/assets/{WrappedPage-B5nLQG1F.js → WrappedPage-DlodZhPp.js} +1 -1
  47. package/dashboard/dist/assets/{__vite-browser-external-DUAYhIIg.js → __vite-browser-external-DYzNZTW8.js} +2 -2
  48. package/dashboard/dist/assets/{agent-logos-B92se84f.js → agent-logos-D-NR9sq6.js} +1 -1
  49. package/dashboard/dist/assets/{arrow-up-right-THgpMHTL.js → arrow-up-right-DY2sXgRx.js} +1 -1
  50. package/dashboard/dist/assets/{check-CZ5GlBuF.js → check-iVengRka.js} +1 -1
  51. package/dashboard/dist/assets/{composite-pohmvEEN.js → composite-DdGB3lqE.js} +1 -1
  52. package/dashboard/dist/assets/{copy-BEu6UqzK.js → copy-hls2Bt--.js} +1 -1
  53. package/dashboard/dist/assets/{download-580FSMzx.js → download-BAPBndt2.js} +1 -1
  54. package/dashboard/dist/assets/{external-link-DSl6rKSu.js → external-link-Ca5PZfay.js} +1 -1
  55. package/dashboard/dist/assets/{flame-CuoqhgO0.js → flame-D1yeuyUj.js} +1 -1
  56. package/dashboard/dist/assets/{format-tokens-yngxPaJs.js → format-tokens-CGo6fsIE.js} +1 -1
  57. package/dashboard/dist/assets/{icons-C5P7F226.js → icons-Ba6V3IjJ.js} +1 -1
  58. package/dashboard/dist/assets/{index-CVccZBhd.js → index-BTyWWSgS.js} +1 -1
  59. package/dashboard/dist/assets/{index-1CFe9s91.js → index-C93m3GcS.js} +1 -1
  60. package/dashboard/dist/assets/{index-DkLVCz9v.js → index-CxRQ-BOI.js} +1 -1
  61. package/dashboard/dist/assets/{info-BtYRYa79.js → info-DyDVFBHF.js} +1 -1
  62. package/dashboard/dist/assets/{link-2-D4bPs6lx.js → link-2-gW7EnjBY.js} +1 -1
  63. package/dashboard/dist/assets/{loader-circle-CAcXf7Ue.js → loader-circle-CCBcIYQZ.js} +1 -1
  64. package/dashboard/dist/assets/{maximize-2-B3xxE3HC.js → maximize-2-lQE0Y8sM.js} +1 -1
  65. package/dashboard/dist/assets/{modifiers.esm-DvoWZTDt.js → modifiers.esm-Tonvsf-M.js} +1 -1
  66. package/dashboard/dist/assets/{monitor-smartphone-CkyNQoTv.js → monitor-smartphone-DxmsWtQn.js} +1 -1
  67. package/dashboard/dist/assets/{plus-BCXK4rAO.js → plus-B1xi3Vdy.js} +1 -1
  68. package/dashboard/dist/assets/{provider-display-Y5ggva-H.js → provider-display-DpZdlOXQ.js} +1 -1
  69. package/dashboard/dist/assets/{react-CjlEHr8p.js → react-CXLTMo1j.js} +1 -1
  70. package/dashboard/dist/assets/{search-Dh5kBuL2.js → search-vQged-EC.js} +1 -1
  71. package/dashboard/dist/assets/{skills-api-XhL8INjh.js → skills-api-D7EpxvhF.js} +1 -1
  72. package/dashboard/dist/assets/{sortable.esm-CFa-CzqV.js → sortable.esm-DMH9aB9A.js} +1 -1
  73. package/dashboard/dist/assets/{store-Bt47laU0.js → store-DJbKAU4R.js} +1 -1
  74. package/dashboard/dist/assets/{terminal-BXW29s08.js → terminal-C2TY01x3.js} +1 -1
  75. package/dashboard/dist/assets/{trash-CYw5PqQr.js → trash-G_ESCgKH.js} +1 -1
  76. package/dashboard/dist/assets/{use-community-stats-C5t_95Jj.js → use-community-stats-CIyY98uR.js} +1 -1
  77. package/dashboard/dist/assets/{use-latest-request-guard-CcrXitYE.js → use-latest-request-guard--vNleRV1.js} +1 -1
  78. package/dashboard/dist/assets/{use-limits-display-prefs-DktuWI-1.js → use-limits-display-prefs-BFxVkhZc.js} +1 -1
  79. package/dashboard/dist/assets/{use-ordered-list-DUHxxfXc.js → use-ordered-list-CO0krJmN.js} +1 -1
  80. package/dashboard/dist/assets/use-reduced-motion-B3bqraBN.js +1 -0
  81. package/dashboard/dist/assets/{use-session-efficiency-pref-CDSUns2p.js → use-session-efficiency-pref-CS1rGoPh.js} +1 -1
  82. package/dashboard/dist/assets/{use-transform-DkLOu1mx.js → use-transform-DxSRxn8c.js} +1 -1
  83. package/dashboard/dist/assets/{use-usage-limits-BTbbhOUs.js → use-usage-limits-DQJTSjOH.js} +1 -1
  84. package/dashboard/dist/assets/{useCurrency-C7QiSZUH.js → useCurrency-Dk_equa7.js} +1 -1
  85. package/dashboard/dist/assets/{useTokenFormat-Kv5h6RPd.js → useTokenFormat-C0kEMmzx.js} +1 -1
  86. package/dashboard/dist/assets/{zap-DOdxB6Nn.js → zap-DNBTWu7a.js} +1 -1
  87. package/dashboard/dist/index.html +1 -1
  88. package/dashboard/dist/ip-check.html +1 -1
  89. package/dashboard/dist/leaderboard.html +1 -1
  90. package/dashboard/dist/share.html +1 -1
  91. package/package.json +2 -2
  92. package/src/lib/pricing/curated-overrides.json +30 -0
  93. package/src/lib/pricing/index.js +2 -1
  94. package/src/lib/pricing/seed-snapshot.json +1 -1
  95. package/dashboard/dist/assets/DialogDescription-B1_lWQbi.js +0 -1
  96. package/dashboard/dist/assets/use-reduced-motion-dYTH0OxK.js +0 -1
@@ -1 +1 @@
1
- import{r as s,j as a,d as g,I as x,c as C}from"./__vite-browser-external-DUAYhIIg.js";import{m as u}from"./react-CjlEHr8p.js";import{P as j}from"./ProviderIcon-DLytDN3-.js";import{A as f}from"./index-1CFe9s91.js";function w(n){const e=[...n];for(let o=e.length-1;o>0;o--){const i=Math.floor(Math.random()*(o+1));[e[o],e[i]]=[e[i],e[o]]}return e}function L(n,e){const o=w(n),i=Array.from({length:e},()=>[]);o.forEach((r,m)=>{i[m%e].push(r)});const p=Math.max(...i.map(r=>r.length));return i.forEach(r=>{for(;r.length<p;)r.push(o[Math.floor(Math.random()*o.length)])}),i}const b=g.memo(function({logos:e,index:o,currentTime:i,onHoverChange:p}){x();const[r,m]=s.useState(!1),l=4e3,v=o*400,d=(i+v)%(l*e.length),t=Math.floor(d/l),c=e[t],y=h=>{m(h),p(h)};return a.jsxs("div",{className:"relative flex flex-col items-center",onMouseEnter:()=>y(!0),onMouseLeave:()=>y(!1),children:[a.jsx(u.div,{className:"relative h-8 w-8 sm:h-10 sm:w-10 md:h-12 md:w-12 overflow-hidden",initial:{opacity:0,y:50},animate:{opacity:1,y:0},transition:{delay:o*.1,duration:.5,ease:"easeOut"},children:a.jsx(f,{mode:"wait",children:a.jsx(u.div,{className:"absolute inset-0 flex items-center justify-center",initial:{y:"18%",opacity:0,filter:"blur(4px)"},animate:{y:"0%",opacity:1,filter:"blur(0px)",transition:{type:"tween",ease:[.22,1,.36,1],duration:.9}},exit:{y:"-18%",opacity:0,filter:"blur(4px)",transition:{type:"tween",ease:[.4,0,1,1],duration:.55}},children:a.jsx(j,{provider:c.provider,size:24,className:"object-contain"})},`${c.id}-${t}`)})}),a.jsx(f,{children:r&&a.jsx(u.span,{className:"pointer-events-none absolute -bottom-7 z-10 whitespace-nowrap rounded bg-oai-gray-800 px-2 py-0.5 text-xs font-medium text-oai-gray-100 shadow-lg ring-1 ring-oai-gray-700",initial:{opacity:0,y:-4},animate:{opacity:1,y:0},exit:{opacity:0,y:-4},transition:{duration:.15},children:c.nameKey?C(c.nameKey):c.name})})]})});function E({logos:n,columnCount:e=2}){const[o,i]=s.useState([]),[p,r]=s.useState(0),[m,l]=s.useState(!1);s.useEffect(()=>{i(L(n,e))},[n,e]),s.useEffect(()=>{if(m)return;const d=setInterval(()=>r(t=>t+400),400);return()=>clearInterval(d)},[m]);const v=s.useCallback(d=>{l(d)},[]);return a.jsx("div",{className:"flex gap-2.5 sm:gap-4 text-oai-gray-200",children:o.map((d,t)=>a.jsx(b,{logos:d,index:t,currentTime:p,onHoverChange:v},t))})}const I=[{id:1,name:"Claude Code",provider:"claude"},{id:2,name:"Codex",provider:"codex"},{id:3,name:"Cursor",provider:"cursor"},{id:4,name:"Gemini",provider:"gemini"},{id:5,name:"Antigravity",provider:"antigravity"},{id:6,name:"Kiro",provider:"kiro"},{id:7,name:"OpenCode",provider:"opencode"},{id:8,name:"OpenClaw",provider:"openclaw"},{id:9,name:"Every Code",provider:"every-code"},{id:10,name:"Hermes",provider:"hermes"},{id:11,name:"GitHub Copilot",provider:"copilot"},{id:12,name:"Kimi",provider:"kimi"},{id:13,name:"CodeBuddy",provider:"codebuddy"},{id:14,name:"WorkBuddy",provider:"workbuddy"},{id:15,name:"Grok",provider:"grok"},{id:16,name:"oh-my-pi",provider:"omp"},{id:17,name:"Pi",provider:"pi"},{id:18,name:"Dots",provider:"dots"},{id:19,name:"Prime Agent",provider:"prime-agent"},{id:20,name:"Craft",provider:"craft"},{id:21,name:"Reasonix",provider:"reasonix"},{id:22,name:"Kilo CLI",provider:"kilo-cli"},{id:23,name:"Kilo Code",provider:"kilocode"},{id:24,name:"Roo Code",provider:"roocode"},{id:25,name:"Zed",provider:"zed"},{id:26,name:"Goose",provider:"goose"},{id:27,name:"Droid",provider:"droid"},{id:28,name:"Mimo",provider:"mimo"},{id:29,name:"ZCode",provider:"zcode"},{id:30,name:"Qoder",provider:"qoder"},{id:31,name:"AnythingLLM",provider:"anythingllm"},{id:32,name:"Claude Science",provider:"claude-science"},{id:33,name:"DeepSeek Harness",provider:"dsh"},{id:34,nameKey:"provider.display.trae_work_cn",provider:"trae-cn"},{id:35,name:"AStudio",provider:"acode"},{id:36,name:"LM Studio",provider:"lmstudio"},{id:37,name:"Unsloth Studio",provider:"unsloth"},{id:38,name:"Devin CLI",provider:"devin"},{id:39,nameKey:"provider.display.omo",provider:"omo"},{id:40,nameKey:"provider.display.minimax_code",provider:"minimax-code"}];export{I as A,E as L};
1
+ import{r as s,j as a,d as g,I as x,c as C}from"./__vite-browser-external-DYzNZTW8.js";import{m as u}from"./react-CXLTMo1j.js";import{P as j}from"./ProviderIcon-MDkXefRU.js";import{A as f}from"./index-C93m3GcS.js";function w(n){const e=[...n];for(let o=e.length-1;o>0;o--){const i=Math.floor(Math.random()*(o+1));[e[o],e[i]]=[e[i],e[o]]}return e}function L(n,e){const o=w(n),i=Array.from({length:e},()=>[]);o.forEach((r,m)=>{i[m%e].push(r)});const p=Math.max(...i.map(r=>r.length));return i.forEach(r=>{for(;r.length<p;)r.push(o[Math.floor(Math.random()*o.length)])}),i}const b=g.memo(function({logos:e,index:o,currentTime:i,onHoverChange:p}){x();const[r,m]=s.useState(!1),l=4e3,v=o*400,d=(i+v)%(l*e.length),t=Math.floor(d/l),c=e[t],y=h=>{m(h),p(h)};return a.jsxs("div",{className:"relative flex flex-col items-center",onMouseEnter:()=>y(!0),onMouseLeave:()=>y(!1),children:[a.jsx(u.div,{className:"relative h-8 w-8 sm:h-10 sm:w-10 md:h-12 md:w-12 overflow-hidden",initial:{opacity:0,y:50},animate:{opacity:1,y:0},transition:{delay:o*.1,duration:.5,ease:"easeOut"},children:a.jsx(f,{mode:"wait",children:a.jsx(u.div,{className:"absolute inset-0 flex items-center justify-center",initial:{y:"18%",opacity:0,filter:"blur(4px)"},animate:{y:"0%",opacity:1,filter:"blur(0px)",transition:{type:"tween",ease:[.22,1,.36,1],duration:.9}},exit:{y:"-18%",opacity:0,filter:"blur(4px)",transition:{type:"tween",ease:[.4,0,1,1],duration:.55}},children:a.jsx(j,{provider:c.provider,size:24,className:"object-contain"})},`${c.id}-${t}`)})}),a.jsx(f,{children:r&&a.jsx(u.span,{className:"pointer-events-none absolute -bottom-7 z-10 whitespace-nowrap rounded bg-oai-gray-800 px-2 py-0.5 text-xs font-medium text-oai-gray-100 shadow-lg ring-1 ring-oai-gray-700",initial:{opacity:0,y:-4},animate:{opacity:1,y:0},exit:{opacity:0,y:-4},transition:{duration:.15},children:c.nameKey?C(c.nameKey):c.name})})]})});function E({logos:n,columnCount:e=2}){const[o,i]=s.useState([]),[p,r]=s.useState(0),[m,l]=s.useState(!1);s.useEffect(()=>{i(L(n,e))},[n,e]),s.useEffect(()=>{if(m)return;const d=setInterval(()=>r(t=>t+400),400);return()=>clearInterval(d)},[m]);const v=s.useCallback(d=>{l(d)},[]);return a.jsx("div",{className:"flex gap-2.5 sm:gap-4 text-oai-gray-200",children:o.map((d,t)=>a.jsx(b,{logos:d,index:t,currentTime:p,onHoverChange:v},t))})}const I=[{id:1,name:"Claude Code",provider:"claude"},{id:2,name:"Codex",provider:"codex"},{id:3,name:"Cursor",provider:"cursor"},{id:4,name:"Gemini",provider:"gemini"},{id:5,name:"Antigravity",provider:"antigravity"},{id:6,name:"Kiro",provider:"kiro"},{id:7,name:"OpenCode",provider:"opencode"},{id:8,name:"OpenClaw",provider:"openclaw"},{id:9,name:"Every Code",provider:"every-code"},{id:10,name:"Hermes",provider:"hermes"},{id:11,name:"GitHub Copilot",provider:"copilot"},{id:12,name:"Kimi",provider:"kimi"},{id:13,name:"CodeBuddy",provider:"codebuddy"},{id:14,name:"WorkBuddy",provider:"workbuddy"},{id:15,name:"Grok",provider:"grok"},{id:16,name:"oh-my-pi",provider:"omp"},{id:17,name:"Pi",provider:"pi"},{id:18,name:"Dots",provider:"dots"},{id:19,name:"Prime Agent",provider:"prime-agent"},{id:20,name:"Craft",provider:"craft"},{id:21,name:"Reasonix",provider:"reasonix"},{id:22,name:"Kilo CLI",provider:"kilo-cli"},{id:23,name:"Kilo Code",provider:"kilocode"},{id:24,name:"Roo Code",provider:"roocode"},{id:25,name:"Zed",provider:"zed"},{id:26,name:"Goose",provider:"goose"},{id:27,name:"Droid",provider:"droid"},{id:28,name:"Mimo",provider:"mimo"},{id:29,name:"ZCode",provider:"zcode"},{id:30,name:"Qoder",provider:"qoder"},{id:31,name:"AnythingLLM",provider:"anythingllm"},{id:32,name:"Claude Science",provider:"claude-science"},{id:33,name:"DeepSeek Harness",provider:"dsh"},{id:34,nameKey:"provider.display.trae_work_cn",provider:"trae-cn"},{id:35,name:"AStudio",provider:"acode"},{id:36,name:"LM Studio",provider:"lmstudio"},{id:37,name:"Unsloth Studio",provider:"unsloth"},{id:38,name:"Devin CLI",provider:"devin"},{id:39,nameKey:"provider.display.omo",provider:"omo"},{id:40,nameKey:"provider.display.minimax_code",provider:"minimax-code"}];export{I as A,E as L};
@@ -1 +1 @@
1
- import{m as t}from"./__vite-browser-external-DUAYhIIg.js";const o={name:"arrow-up-right",size:24,node:[["path",{d:"M7 7h10v10",key:"1tivn9"}],["path",{d:"M7 17 17 7",key:"1vkiza"}]]};o.node;const e=t(o);export{e as A};
1
+ import{m as t}from"./__vite-browser-external-DYzNZTW8.js";const o={name:"arrow-up-right",size:24,node:[["path",{d:"M7 7h10v10",key:"1tivn9"}],["path",{d:"M7 17 17 7",key:"1vkiza"}]]};o.node;const e=t(o);export{e as A};
@@ -1 +1 @@
1
- import{m as c}from"./__vite-browser-external-DUAYhIIg.js";const e={name:"check",size:24,node:[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]};e.node;const a=c(e);export{a as C};
1
+ import{m as c}from"./__vite-browser-external-DYzNZTW8.js";const e={name:"check",size:24,node:[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]};e.node;const a=c(e);export{a as C};
@@ -1 +1 @@
1
- import{aH as Gt,bT as Ke,bU as _t,bb as je,ax as D,b9 as Ut,bh as X,bV as Ot,bL as ze,j as Re,bW as Je,r as m,bf as Y,bX as st,bY as Xt,az as it,be as We,bB as Vt,bZ as ct,bj as I,bi as Pe,bA as me,b_ as qe,b$ as fe,c0 as de,aO as w,bk as Kt,c1 as wt,c2 as Ze,bC as qt,bx as ut,br as lt,bt as $t,c3 as jt,c4 as xt,c5 as Qe,aC as Le,aN as Ee,c6 as zt,bw as Jt,c7 as Zt,w as ke,bq as Qt,c8 as Ye,bn as en,bd as De,bo as tn,bg as Ie,bH as Ge,bG as nn,c9 as rn,bE as on,aP as sn,ca as be,aF as cn,aG as un,E as _e,cb as ln,bS as an,bM as fn}from"./__vite-browser-external-DUAYhIIg.js";const dn="data-open",pn="data-closed",gn="data-anchor-hidden",It="data-popup-open",hn="data-pressed",mn={[It]:""},bn={[It]:"",[hn]:""},En={[dn]:""},yn={[pn]:""},Tn={[gn]:""},Zn={open(e){return e?mn:null}},Qn={open(e){return e?bn:null}},vn={open(e){return e?En:yn},anchorHidden(e){return e?Tn:null}},er={...vn,...Gt};function Fe(e,t,n=!0){return e.filter(o=>o.parentId===t).flatMap(o=>[...!n||o.context?.open?[o]:[],...Fe(e,o.id,n)])}function at(e,t){let n=[],r=e.find(o=>o.id===t)?.parentId;for(;r;){const o=e.find(s=>s.id===r);r=o?.parentId,o&&(n=n.concat(o))}return n}function Rn(e){e.preventDefault(),e.stopPropagation()}function Sn(e){return"nativeEvent"in e}function Pt(e){return e.pointerType===""&&e.isTrusted?!0:Ke&&e.pointerType?e.type==="click"&&e.buttons===1:e.detail===0&&!e.pointerType}function Cn(e){return _t?!1:!Ke&&e.width===0&&e.height===0||Ke&&e.width===1&&e.height===1&&e.pressure===0&&e.detail===0&&e.pointerType==="mouse"||e.width<1&&e.height<1&&e.pressure===0&&e.detail===0&&e.pointerType==="touch"}function tr(e,t){const n=["mouse","pen"];return t||n.push("",void 0),n.includes(e)}function On(e){const t=e.type;return t==="click"||t==="mousedown"||t==="keydown"||t==="keyup"}function Ae(e){const t=je(wn,e).current;return t.next=e,D(t.effect),t}function wn(e){const t={current:e,next:e,effect:()=>{t.current=t.next}};return t}let Ne=0;function Ue(e,t={}){const{preventScroll:n=!1,sync:r=!1,shouldFocus:o}=t;cancelAnimationFrame(Ne);function s(){o&&!o()||e?.focus({preventScroll:n})}if(r)return s(),Ut;const i=requestAnimationFrame(s);return Ne=i,()=>{Ne===i&&(cancelAnimationFrame(i),Ne=0)}}const Xe={inert:new WeakMap,"aria-hidden":new WeakMap},ft="data-base-ui-inert",$e={inert:new WeakSet,"aria-hidden":new WeakSet};let xe=new WeakMap,Ve=0;function xn(e){return $e[e]}function kt(e){return e?Ot(e)?e.host:kt(e.parentNode):null}const dt=(e,t)=>t.map(n=>{if(e.contains(n))return n;const r=kt(n);return e.contains(r)?r:null}).filter(n=>n!=null),pt=e=>{const t=new Set;return e.forEach(n=>{let r=n;for(;r&&!t.has(r);)t.add(r),r=r.parentNode}),t},gt=(e,t,n)=>{const r=[],o=s=>{!s||n.has(s)||Array.from(s.children).forEach(i=>{ze(i)!=="script"&&(t.has(i)?o(i):r.push(i))})};return o(e),r};function In(e,t,n,r,{mark:o=!0}){let s=null;r?s="inert":n&&(s="aria-hidden");let i=null,l=null;const a=dt(t,e),f=o?gt(t,pt(a),new Set(a)):[],R=[],O=[];if(s){const d=Xe[s],b=xn(s);l=b,i=d;const C=dt(t,Array.from(t.querySelectorAll("[aria-live]"))),V=a.concat(C);gt(t,pt(V),new Set(V)).forEach(v=>{const T=v.getAttribute(s),j=T!==null&&T!=="false",q=(d.get(v)||0)+1;d.set(v,q),R.push(v),q===1&&j&&b.add(v),j||v.setAttribute(s,s==="inert"?"":"true")})}return o&&f.forEach(d=>{const b=(xe.get(d)||0)+1;xe.set(d,b),O.push(d),b===1&&d.setAttribute(ft,"")}),Ve+=1,()=>{i&&R.forEach(d=>{const C=(i.get(d)||0)-1;i.set(d,C),C||(!l?.has(d)&&s&&d.removeAttribute(s),l?.delete(d))}),o&&O.forEach(d=>{const b=(xe.get(d)||0)-1;xe.set(d,b),b||d.removeAttribute(ft)}),Ve-=1,Ve||(Xe.inert=new WeakMap,Xe["aria-hidden"]=new WeakMap,$e.inert=new WeakSet,$e["aria-hidden"]=new WeakSet,xe=new WeakMap)}}function ht(e,t={}){const{ariaHidden:n=!1,inert:r=!1,mark:o=!0}=t,s=X(e[0]).body;return In(e,s,n,r,{mark:o})}function Ft(){const e=new Map;return{emit(t,n){e.get(t)?.forEach(r=>r(n))},on(t,n){e.has(t)||e.set(t,new Set),e.get(t).add(n)},off(t,n){e.get(t)?.delete(n)}}}class Pn{nodesRef={current:[]};events=Ft();addNode(t){this.nodesRef.current.push(t)}removeNode(t){const n=this.nodesRef.current.findIndex(r=>r===t);n!==-1&&this.nodesRef.current.splice(n,1)}}const Mt=m.createContext(null),At=m.createContext(null),et=()=>m.useContext(Mt)?.id||null,tt=e=>{const t=m.useContext(At);return e??t};function nr(e){const t=Je(),n=tt(e),r=et();return D(()=>{if(!t)return;const o={id:t,parentId:r};return n?.addNode(o),()=>{n?.removeNode(o)}},[n,t,r]),t}function rr(e){const{children:t,id:n}=e,r=et();return Re.jsx(Mt.Provider,{value:m.useMemo(()=>({id:n,parentId:r}),[n,r]),children:t})}function or(e){const{children:t,externalTree:n}=e,r=je(()=>n??new Pn).current;return Re.jsx(At.Provider,{value:r,children:t})}function kn(e,t){const n=Le(Ee(e));return e instanceof n.KeyboardEvent?"keyboard":e instanceof n.FocusEvent?t||"keyboard":"pointerType"in e?e.pointerType||"keyboard":"touches"in e?"touch":e instanceof n.MouseEvent?t||(e.detail===0?"keyboard":"mouse"):""}const mt=20;let pe=[];function nt(){pe=pe.filter(e=>e.deref()?.isConnected)}function bt(e){nt(),e&&ze(e)!=="body"&&(pe.push(new WeakRef(e)),pe.length>mt&&(pe=pe.slice(-mt)))}function Et(){return nt(),pe[pe.length-1]?.deref()}function Fn(e){return e?Qe(e)?e:xt(e)[0]||e:null}function yt(e){if(e.hasAttribute("tabindex")&&!e.hasAttribute("data-tabindex")||!e.getAttribute("role")?.includes("dialog"))return;const n=zt(e).filter(o=>{const s=o.getAttribute("data-tabindex")||"";return Qe(o)||o.hasAttribute("data-tabindex")&&!s.startsWith("-")}),r=e.getAttribute("tabindex");n.length===0?r!=="0"&&(e.setAttribute("tabindex","0"),e.setAttribute("data-tabindex","0")):(r!=="-1"||e.hasAttribute("data-tabindex")&&e.getAttribute("data-tabindex")!=="-1")&&(e.setAttribute("tabindex","-1"),e.setAttribute("data-tabindex","-1"))}function sr(e){const{context:t,children:n,disabled:r=!1,initialFocus:o=!0,returnFocus:s=!0,restoreFocus:i=!1,modal:l=!0,closeOnFocusOut:a=!0,openInteractionType:f="",nextFocusableElement:R,previousFocusableElement:O,beforeContentFocusGuardRef:d,externalTree:b,getInsideElements:C}=e,V="rootStore"in t?t.rootStore:t,F=V.useState("open"),v=V.useState("domReferenceElement"),T=V.useState("floatingElement"),{events:j,dataRef:q}=V.context,$=Y(()=>q.current.floatingContext?.nodeId),le=o===!1,M=st(v)&&le,Q=Ae(o),se=Ae(s),ee=Ae(f),B=Ae(F),G=tt(b),S=Xt(),N=m.useRef(!1),ae=m.useRef(!1),te=m.useRef(!1),ye=m.useRef(null),ie=m.useRef(""),z=m.useRef(""),ge=m.useRef(null),he=m.useRef(null),Se=it(ge,d,S?.beforeInsideRef),Me=it(he,S?.afterInsideRef),E=We(),L=We(),A=Vt(),Te=S!=null,y=ct(T),ne=Y((h=y)=>h?xt(h):[]),re=Y(()=>C?.().filter(h=>h!=null)??[]);m.useEffect(()=>{if(r||!l)return;function h(W){W.key==="Tab"&&w(y,de(X(y)))&&ne().length===0&&!M&&Rn(W)}const P=X(y);return I(P,"keydown",h)},[r,y,l,M,ne]),m.useEffect(()=>{if(r||!F)return;const h=X(y);function P(){te.current=!1}function W(oe){const g=Ee(oe),x=re(),p=w(T,g)||w(v,g)||w(S?.portalNode,g)||x.some(k=>k===g||w(k,g));te.current=!p,z.current=oe.pointerType||"keyboard",g?.closest(`[${Jt}]`)&&(ae.current=!0,L.start(0,()=>{ae.current=!1}))}function _(){z.current="keyboard"}return Pe(I(h,"pointerdown",W,!0),I(h,"pointerup",P,!0),I(h,"pointercancel",P,!0),I(h,"keydown",_,!0),P)},[r,T,v,y,F,S,L,re]),m.useEffect(()=>{if(r||!a)return;const h=X(y);function P(){ae.current=!0,L.start(0,()=>{ae.current=!1})}function W(x){const p=Ee(x);Qe(p)&&(ye.current=p)}function _(x){const p=x.relatedTarget,k=x.currentTarget,K=Ee(x);l&&p==null&&K!=null&&w(T,K)&&bt(K),queueMicrotask(()=>{const J=$(),Z=V.context.triggerElements,Ce=re(),ve=p?.hasAttribute(qe("focus-guard"))&&[ge.current,he.current,S?.beforeInsideRef.current,S?.afterInsideRef.current,S?.beforeOutsideRef.current,S?.afterOutsideRef.current,fe(O),fe(R)].includes(p),u=!(w(v,p)||w(T,p)||w(p,T)||w(S?.portalNode,p)||Ce.some(c=>c===p||w(c,p))||Z.hasMatchingElement(c=>w(c,p))||ve||G&&(Fe(G.nodesRef.current,J).find(c=>w(c.context?.elements.floating,p)||w(c.context?.elements.domReference,p))||at(G.nodesRef.current,J).find(c=>[c.context?.elements.floating,ct(c.context?.elements.floating)].includes(p)||c.context?.elements.domReference===p)));if(k===v&&y&&yt(y),i&&k!==v&&!Zt(K)&&de(h)===h.body){if(me(y)&&(y.focus(),i==="popup")){A.request(()=>{y.focus()});return}const c=ne(),H=ye.current,U=(H&&c.includes(H)?H:null)||c[c.length-1]||y;me(U)&&U.focus()}if(q.current.insideReactTree){q.current.insideReactTree=!1;return}(M||!l)&&p&&u&&!ae.current&&(M||p!==Et())&&(N.current=!0,V.setOpen(!1,ke(Qt,x)))})}function oe(){te.current||(q.current.insideReactTree=!0,E.start(0,()=>{q.current.insideReactTree=!1}))}const g=me(v)?v:null;if(!(!T&&!g))return Pe(g&&I(g,"focusout",_),g&&I(g,"pointerdown",P),T&&I(T,"focusin",W),T&&I(T,"focusout",_),T&&S&&I(T,"focusout",oe,!0))},[r,v,T,y,l,G,S,V,a,i,ne,M,$,q,E,L,A,R,O,re]),m.useEffect(()=>{if(r||!T||!F)return;const h=Array.from(S?.portalNode?.querySelectorAll(`[${qe("portal")}]`)||[]),W=(G?at(G.nodesRef.current,$()):[]).find(k=>st(k.context?.elements.domReference||null))?.context?.elements.domReference,oe=[...[T,...h,ge.current,he.current,S?.beforeOutsideRef.current,S?.afterOutsideRef.current,...re()],W,fe(O),fe(R),M?v:null].filter(k=>k!=null),g=ht(oe,{ariaHidden:l||M,mark:!1}),x=[T,...h].filter(k=>k!=null),p=ht(x);return()=>{p(),g()}},[F,r,v,T,l,S,M,G,$,R,O,re]),D(()=>{if(!F||r||!me(y))return;ie.current="",z.current="";const h=X(y),P=de(h);queueMicrotask(()=>{const W=Q.current,_=typeof W=="function"?W(ee.current||""):W;if(_===void 0||_===!1||w(y,P))return;let g=null;const x=()=>(g==null&&(g=ne(y)),g[0]||y);let p;_===!0||_===null?p=x():p=fe(_),p=p||x();const k=w(y,de(h));Ue(p,{preventScroll:p===y,shouldFocus(){if(!B.current)return!1;if(k)return!0;const K=de(h);return!(K!==p&&w(y,K))}})})},[r,F,y,ne,Q,ee,B]),D(()=>{if(r||!y)return;const h=X(y),P=de(h),W=ee.current==null;bt(P);function _(g){if(g.open||(ie.current=kn(g.nativeEvent,z.current)),g.reason===Kt&&g.nativeEvent.type==="mouseleave"&&(N.current=!0),g.reason===wt)if(g.nested)N.current=!1;else if(Pt(g.nativeEvent)||Cn(g.nativeEvent))N.current=!1;else{let x=!1;X(y).createElement("div").focus({get preventScroll(){return x=!0,!1}}),x?N.current=!1:N.current=!0}}j.on("openchange",_);function oe(g){const x=se.current;let p=typeof x=="function"?x(g):x;if(p===void 0||p===!1)return null;p===null&&(p=!0);const k=v?.isConnected?v:null,K=P?.isConnected&&ze(P)!=="body"?P:null;let J=W?K||k:k||K;return J||(J=Et()||null),typeof p=="boolean"?J:fe(p)||J||null}return()=>{j.off("openchange",_);const g=de(h),x=re(),p=w(T,g)||x.some(Z=>Z===g||w(Z,g))||G&&Fe(G.nodesRef.current,$(),!1).some(Z=>w(Z.context?.elements.floating,g)),k=se.current,K=ie.current,J=oe(K);queueMicrotask(()=>{const Z=Fn(J),Ce=typeof k!="boolean";if(k&&!N.current&&me(Z)&&(!(!Ce&&Z!==g&&g!==h.body)||p)){const ve={preventScroll:!0};K==="keyboard"&&(ve.focusVisible=!0),Z.focus(ve)}N.current=!1})}},[r,T,y,se,ee,j,G,v,$,re]),D(()=>{if(!Ze||F||!T)return;const h=de(X(T));!me(h)||!qt(h)||w(T,h)&&h.blur()},[F,T]),D(()=>{if(!(r||!S))return S.setFocusManagerState({modal:l,closeOnFocusOut:a,open:F,onOpenChange:V.setOpen,domReference:v}),()=>{S.setFocusManagerState(null)}},[r,S,l,F,V,a,v]),D(()=>{if(!(r||!y))return yt(y),()=>{queueMicrotask(nt)}},[r,y]);const ce=!r&&(l?!M:!0)&&(Te||l);return Re.jsxs(m.Fragment,{children:[ce&&Re.jsx(ut,{"data-type":"inside",ref:Se,onFocus:h=>{if(l){const P=ne();Ue(P[P.length-1])}else S?.portalNode&&(N.current=!1,lt(h,S.portalNode)?$t(v)?.focus():fe(O??S.beforeOutsideRef)?.focus())}}),n,ce&&Re.jsx(ut,{"data-type":"inside",ref:Me,onFocus:h=>{l?Ue(ne()[0]):S?.portalNode&&(a&&(N.current=!0),lt(h,S.portalNode)?jt(v)?.focus():fe(R??S.afterOutsideRef)?.focus())}})]})}function Mn(){return!1}function An(e){return{escapeKey:typeof e=="boolean"?e:e?.escapeKey??!1,outsidePress:typeof e=="boolean"?e:e?.outsidePress??!0}}function ir(e,t={}){const{enabled:n=!0,escapeKey:r=!0,outsidePress:o=!0,outsidePressEvent:s="sloppy",referencePress:i=Mn,bubbles:l,externalTree:a}=t,f="rootStore"in e?e.rootStore:e,R=f.useState("open"),O=f.useState("floatingElement"),{dataRef:d,events:b}=f.context,C=tt(a),V=Y(typeof o=="function"?o:()=>!1),F=typeof o=="function"?V:o,v=F!==!1,T=Y(()=>s),{escapeKey:j,outsidePress:q}=An(l),$=m.useRef(!1),le=m.useRef(!1),M=m.useRef(!1),Q=m.useRef(!1),se=m.useRef(!1),ee=m.useRef(""),B=m.useRef(null),G=We(),S=We(),N=Y(()=>{S.clear(),d.current.insideReactTree=!1}),ae=Y(E=>{const L=d.current.floatingContext?.nodeId;return(C?Fe(C.nodesRef.current,L):[]).some(Te=>Te.context?.open&&!Te.context.dataRef.current[E])}),te=Y(E=>Ye(E,f.select("floatingElement"))||Ye(E,f.select("domReferenceElement"))),ye=Y(E=>{i()&&f.setOpen(!1,ke(en,E.nativeEvent))}),ie=Y(E=>{if(!R||!n||!r||E.key!=="Escape"||se.current||!j&&ae("__escapeKeyBubbles"))return;const L=Sn(E)?E.nativeEvent:E,A=ke(tn,L);f.setOpen(!1,A),A.isCanceled||E.preventDefault(),!j&&!A.isPropagationAllowed&&E.stopPropagation()}),z=Y(()=>{d.current.insideReactTree=!0,S.start(0,N)}),ge=Y(E=>{if(!R||!n||E.button!==0)return;const L=Ee(E.nativeEvent);w(f.select("floatingElement"),L)&&($.current||($.current=!0,le.current=!1))}),he=Y(E=>{!R||!n||(E.defaultPrevented||E.nativeEvent.defaultPrevented)&&$.current&&(le.current=!0)});m.useEffect(()=>{function E(L){L.open||(Q.current=!1)}return b.on("openchange",E),()=>{b.off("openchange",E)}},[b]),m.useEffect(()=>{if(!R||!n)return R||(Q.current=!1),N;d.current.__escapeKeyBubbles=j,d.current.__outsidePressBubbles=q;const E=new De,L=new De,A=X(O);function Te(){E.clear(),se.current=!0}function y(){E.start(Ze?5:0,()=>{se.current=!1})}function ne(){M.current=!0,L.start(0,()=>{M.current=!1})}function re(){$.current=!1,le.current=!1}function ce(){const u=ee.current,c=u==="pen"||!u?"mouse":u,H=T(),U=typeof H=="function"?H():H;return typeof U=="string"?U:U[c]}function h(u){const c=ce();return c==="intentional"&&u.type!=="click"||c==="sloppy"&&u.type==="click"}function P(u){const c=d.current.floatingContext?.nodeId,H=C&&Fe(C.nodesRef.current,c).some(U=>Ye(u,U.context?.elements.floating));return te(u)||H}function W(u){if(h(u)){u.type!=="click"&&!te(u)&&(L.clear(),M.current=!1),N();return}if(d.current.insideReactTree){N();return}const c=Ee(u),H=`[${qe("inert")}]`,U=Ie(c)?c.getRootNode():null,Oe=Array.from((Ot(U)?U:X(f.select("floatingElement"))).querySelectorAll(H)),rt=f.context.triggerElements;if(c&&(rt.hasElement(c)||rt.hasMatchingElement(ue=>w(ue,c))))return;let we=Ie(c)?c:null;for(;we&&!Ge(we);){const ue=nn(we);if(Ge(ue)||!Ie(ue))break;we=ue}if(!(Oe.length&&Ie(c)&&!rn(c)&&!w(c,f.select("floatingElement"))&&Oe.every(ue=>!w(we,ue)))){if(me(c)&&!("touches"in u)){const ue=Ge(c),He=on(c),ot=/auto|scroll/,Nt=ue||ot.test(He.overflowX),Wt=ue||ot.test(He.overflowY),Dt=Nt&&c.clientWidth>0&&c.scrollWidth>c.clientWidth,Lt=Wt&&c.clientHeight>0&&c.scrollHeight>c.clientHeight,Bt=He.direction==="rtl",Ht=Lt&&(Bt?u.offsetX<=c.offsetWidth-c.clientWidth:u.offsetX>c.clientWidth),Yt=Dt&&u.offsetY>c.clientHeight;if(Ht||Yt)return}if(!P(u)){if(ce()==="intentional"){if(u.detail!==0&&!Pt(u)&&!Q.current)return;if(M.current){L.clear(),M.current=!1;return}}typeof F=="function"&&!F(u)||ae("__outsidePressBubbles")||(f.setOpen(!1,ke(wt,u)),N())}}}function _(u){ce()!=="sloppy"||u.pointerType==="touch"||!f.select("open")||!n||te(u)||W(u)}function oe(u){if(ce()!=="sloppy"||!f.select("open")||!n||te(u))return;const c=u.touches[0];c&&(B.current={startTime:Date.now(),startX:c.clientX,startY:c.clientY,dismissOnTouchEnd:!1,dismissOnMouseDown:!0},G.start(1e3,()=>{B.current&&(B.current.dismissOnTouchEnd=!1,B.current.dismissOnMouseDown=!1)}))}function g(u,c){const H=Ee(u);if(!H)return;const U=I(H,u.type,()=>{c(u),U()})}function x(u){ee.current="touch",g(u,oe)}function p(u){G.clear(),u.type==="pointerdown"&&(u.button===0&&(Q.current=!0),ee.current=u.pointerType),!(u.type==="mousedown"&&B.current&&!B.current.dismissOnMouseDown)&&g(u,c=>{c.type==="pointerdown"?_(c):W(c)})}function k(u){if(u.type==="pointercancel"&&(Q.current=!1),!$.current)return;const c=le.current;if(re(),ce()==="intentional"){if(u.type==="pointercancel"){c&&ne();return}if(!P(u)){if(c){ne();return}typeof F=="function"&&!F(u)||(L.clear(),M.current=!0,N())}}}function K(u){if(ce()!=="sloppy"||!B.current||te(u))return;const c=u.touches[0];if(!c)return;const H=Math.abs(c.clientX-B.current.startX),U=Math.abs(c.clientY-B.current.startY),Oe=Math.sqrt(H*H+U*U);Oe>5&&(B.current.dismissOnTouchEnd=!0),Oe>10&&(W(u),G.clear(),B.current=null)}function J(u){g(u,K)}function Z(u){ce()!=="sloppy"||!B.current||te(u)||(B.current.dismissOnTouchEnd&&W(u),G.clear(),B.current=null)}function Ce(u){g(u,Z)}const ve=Pe(r&&Pe(I(A,"keydown",ie),I(A,"compositionstart",Te),I(A,"compositionend",y)),v&&Pe(I(A,"click",p,!0),I(A,"pointerdown",p,!0),I(A,"pointerup",k,!0),I(A,"pointercancel",k,!0),I(A,"mousedown",p,!0),I(A,"mouseup",k,!0),I(A,"touchstart",x,{capture:!0,passive:!0}),I(A,"touchmove",J,{capture:!0,passive:!0}),I(A,"touchend",Ce,{capture:!0,passive:!0})));return()=>{ve(),E.clear(),L.clear(),re(),M.current=!1,N()}},[d,O,r,v,F,R,n,j,q,ie,N,T,ae,te,C,f,G]);const Se=m.useMemo(()=>({onKeyDown:ie,onPointerDown:ye,onClick:ye}),[ie,ye]),Me=m.useMemo(()=>({onKeyDown:ie,onPointerDown:he,onMouseDown:he,onClickCapture:z,onMouseDownCapture(E){z(),ge(E)},onPointerDownCapture(E){z(),ge(E)},onMouseUpCapture:z,onTouchEndCapture:z,onTouchMoveCapture:z}),[ie,z,ge,he]);return m.useMemo(()=>n?{reference:Se,floating:Me,trigger:Se}:{},[n,Se,Me])}const Nn={open:e=>e.open,transitionStatus:e=>e.transitionStatus,domReferenceElement:e=>e.domReferenceElement,referenceElement:e=>e.positionReference??e.referenceElement,floatingElement:e=>e.floatingElement,floatingId:e=>e.floatingId};class Wn extends sn{constructor(t){const{syncOnly:n,nested:r,onOpenChange:o,triggerElements:s,...i}=t;super({...i,positionReference:i.referenceElement,domReferenceElement:i.referenceElement},{onOpenChange:o,dataRef:{current:{}},events:Ft(),nested:r,triggerElements:s},Nn),this.syncOnly=n}syncOpenEvent=(t,n)=>{(!t||!this.state.open||n!=null&&On(n))&&(this.context.dataRef.current.openEvent=t?n:void 0)};dispatchOpenChange=(t,n)=>{this.syncOpenEvent(t,n.event);const r={open:t,reason:n.reason,nativeEvent:n.event,nested:this.context.nested,triggerElement:n.trigger};this.context.events.emit("openchange",r)};setOpen=(t,n)=>{if(this.syncOnly){this.context.onOpenChange?.(t,n);return}this.dispatchOpenChange(t,n),this.context.onOpenChange?.(t,n)}}function Dn(e){const{popupStore:t,treatPopupAsFloatingElement:n=!1,floatingRootContext:r,floatingId:o,nested:s,onOpenChange:i}=e,l=t.useState("open"),a=t.useState("activeTriggerElement"),f=t.useState(n?"popupElement":"positionerElement"),R=t.context.triggerElements,O=i,d=m.useRef(null);r===void 0&&d.current===null&&(d.current=new Wn({open:l,transitionStatus:void 0,referenceElement:a,floatingElement:f,triggerElements:R,onOpenChange:O,floatingId:o,syncOnly:!0,nested:s}));const b=r??d.current;return t.useSyncedValue("floatingId",o),D(()=>{const C={open:l,floatingId:o,referenceElement:a,floatingElement:f};Ie(a)&&(C.domReferenceElement=a),b.state.positionReference===b.state.referenceElement&&(C.positionReference=a),b.update(C)},[l,o,a,f,b]),b.context.onOpenChange=O,b.context.nested=s,b}function Ln(e,t=!1,n=!1,r=!1){const[o,s]=m.useState(e&&t?"idle":void 0),[i,l]=m.useState(e&&!r);return e&&!i&&(l(!0),s("starting")),!e&&i&&o!=="ending"&&!n&&s("ending"),!e&&!i&&o==="ending"&&s(void 0),D(()=>{if(!e&&i&&o!=="ending"&&n){const a=be.request(()=>{s("ending")});return()=>{be.cancel(a)}}},[e,i,o,n]),D(()=>{if(!e||t)return;const a=be.request(()=>{s(void 0)});return()=>{be.cancel(a)}},[t,e]),D(()=>{if(!e||!t)return;e&&i&&o!=="idle"&&s("starting");const a=be.request(()=>{s("idle")});return()=>{be.cancel(a)}},[t,e,i,o]),{mounted:i,setMounted:l,transitionStatus:o}}const cr={tabIndex:-1,[ln]:""};function ur(e){return t=>t==="touch"?e.current:!0}function lr(e,t=!1){const n=Je(),r=et()!=null,o=je(()=>e(n,r)).current;return Dn({popupStore:o,treatPopupAsFloatingElement:t,floatingRootContext:o.state.floatingRootContext,floatingId:n,nested:r,onOpenChange:o.setOpen}),o}function ar({handle:e,store:t}){return D(()=>e.attachStore(t),[e,t]),null}function Tt(e){const t=e.context.triggerElements.size;e.select("open")&&e.state.triggerCount!==t&&e.set("triggerCount",t)}function Bn(e,t){const n=m.useRef(null);return Y(r=>{const o=n.current;if(o!==null){if(o.element===r&&o.store===t&&o.id===e)return;n.current=null;const s=o.store;s.context.triggerElements.getById(o.id)===o.element&&(s.context.triggerElements.delete(o.id),Tt(s))}r!==null&&e!==void 0&&(n.current={store:t,id:e,element:r},t.context.triggerElements.add(e,r),Tt(t))})}function fr(e,t,n,r=!1){let o=e.preventUnmountingOnClose;t?o=!1:r&&(o=!0);const s=n?.id??null;let i=e.activeTriggerId,l=e.activeTriggerElement;return(s||t)&&(i=s,l=n??null),{open:t,preventUnmountingOnClose:o,activeTriggerId:i,activeTriggerElement:l}}function dr(e){let t=!1;return e.preventUnmountOnClose=()=>{t=!0},()=>t}function pr(e,t,n,r){const o=n.useState("isMountedByTrigger",e),s=Bn(e,n),i=Y(a=>{const f=n.select("open"),R=n.select("activeTriggerId");if(R===e){const O={activeTriggerElement:a,...f?r:null};n.update(O);return}if(R==null&&f){const O={activeTriggerId:e??null,activeTriggerElement:a,...r};n.update(O)}}),l=Y(a=>{s(a),a&&i(a)});return D(()=>(l(t.current),()=>l(null)),[l,t,n,e]),D(()=>{if(o){const a={activeTriggerElement:t.current,...r};n.update(a)}},[o,n,t,...Object.values(r)]),{registerTrigger:l,isMountedByThisTrigger:o}}function gr(e,t={}){const{closeOnActiveTriggerUnmount:n=!1}=t,r=m.useRef(null),o=e.useState("open"),s=e.useState("triggerCount"),i=e.useState("activeTriggerId"),l=e.useState("activeTriggerElement");D(()=>{if(!o){r.current=null,e.state.triggerCount!==0&&e.set("triggerCount",0);return}const a=e.context.triggerElements.size,f={};e.state.triggerCount!==a&&(f.triggerCount=a);const R=e.select("activeTriggerId");let O=null;if(R){const d=e.context.triggerElements.getById(R);if(d)r.current=R,d!==e.state.activeTriggerElement&&(f.activeTriggerElement=d);else{for(const[b,C]of e.context.triggerElements.entries())if(C===e.state.activeTriggerElement){f.activeTriggerId=b,f.activeTriggerElement=C,r.current=b;break}f.activeTriggerId===void 0&&(r.current===R?O=R:r.current=null)}}else r.current=null;if(!O&&!R&&a===1){const d=e.context.triggerElements.entries().next();if(!d.done){const[b,C]=d.value;f.activeTriggerId=b,f.activeTriggerElement=C,r.current=b}}(f.triggerCount!==void 0||f.activeTriggerId!==void 0||f.activeTriggerElement!==void 0)&&e.update(f),O&&n&&queueMicrotask(()=>{if(e.select("open")&&e.select("activeTriggerId")===O&&!e.context.triggerElements.getById(O)){const d=ke(cn);e.setOpen(!1,d),d.isCanceled||e.update({activeTriggerId:null,activeTriggerElement:null})}})},[o,e,s,i,l,n])}function hr(e,t,n,r){const{mounted:o,setMounted:s,transitionStatus:i}=Ln(e,!1,!1,r),l=t.useState("preventUnmountingOnClose"),a=e?!1:l;t.useSyncedValues({mounted:o,transitionStatus:i,preventUnmountingOnClose:a});const f=Y(()=>{s(!1),t.update({activeTriggerId:null,activeTriggerElement:null,mounted:!1,preventUnmountingOnClose:!1}),n?.(),t.context.onOpenChangeComplete?.(!1)});return un({enabled:o&&!e&&!a,open:e,ref:t.context.popupRef,onComplete(){e||f()}}),{forceUnmount:f,transitionStatus:i}}function mr(e,t){e.useSyncedValues(t),D(()=>()=>{e.update({activeTriggerProps:_e,inactiveTriggerProps:_e,popupProps:_e})},[e])}function br(e,t){D(()=>{!t&&e.state.openMethod!==null&&e.set("openMethod",null)},[t,e]),D(()=>()=>{e.state.openMethod!==null&&e.set("openMethod",null)},[e])}class Er{constructor(){this.idMap=new Map}add(t,n){this.idMap.set(t,n)}delete(t){this.idMap.delete(t)}hasElement(t){for(const n of this.idMap.values())if(n===t)return!0;return!1}hasMatchingElement(t){for(const n of this.idMap.values())if(t(n))return!0;return!1}getById(t){return this.idMap.get(t)}entries(){return this.idMap.entries()}elements(){return this.idMap.values()}get size(){return this.idMap.size}}function yr(e){return Je(e,"base-ui")}const Tr=m.forwardRef(function(t,n){const{cutout:r,...o}=t;let s;if(r){const i=r.getBoundingClientRect();s=`polygon(0% 0%,100% 0%,100% 100%,0% 100%,0% 0%,${i.left}px ${i.top}px,${i.left}px ${i.bottom}px,${i.right}px ${i.bottom}px,${i.right}px ${i.top}px,${i.left}px ${i.top}px)`}return Re.jsx("div",{ref:n,role:"presentation","data-base-ui-inert":"",...o,style:{position:"fixed",inset:0,userSelect:"none",WebkitUserSelect:"none",clipPath:s}})});let vt={},Rt={},St="";function Be(e,t){return fn(e)?e:t}function Ct(e,t,n){return/hidden|clip/.test(e.getComputedStyle(Be(t,n)).overflowY)}function Hn(e){if(typeof document>"u")return!1;const t=X(e);return Le(t).innerWidth-t.documentElement.clientWidth>0}function Yn(e){if(!(typeof CSS<"u"&&CSS.supports&&CSS.supports("scrollbar-gutter","stable"))||typeof document>"u")return!1;const n=X(e),r=n.documentElement,o=n.body,s=Be(r,o),i=s.style.overflowY,l=r.style.scrollbarGutter;r.style.scrollbarGutter="stable",s.style.overflowY="scroll";const a=s.offsetWidth;s.style.overflowY="hidden";const f=s.offsetWidth;return s.style.overflowY=i,r.style.scrollbarGutter=l,a===f}function Gn(e){const t=X(e),n=t.documentElement,r=t.body,o=Be(n,r),s={overflowY:o.style.overflowY,overflowX:o.style.overflowX};return Object.assign(o.style,{overflowY:"hidden",overflowX:"hidden"}),()=>{Object.assign(o.style,s)}}function _n(e){const t=X(e),n=t.documentElement,r=t.body,o=Le(n);let s=0,i=0,l=!1;const a=be.create();if(Ze&&(o.visualViewport?.scale??1)!==1)return()=>{};function f(){const b=o.getComputedStyle(n),C=o.getComputedStyle(r),v=(b.scrollbarGutter||"").includes("both-edges")?"stable both-edges":"stable";s=n.scrollTop,i=n.scrollLeft,vt={scrollbarGutter:n.style.scrollbarGutter,overflowY:n.style.overflowY,overflowX:n.style.overflowX},St=n.style.scrollBehavior,Rt={position:r.style.position,height:r.style.height,width:r.style.width,boxSizing:r.style.boxSizing,overflowY:r.style.overflowY,overflowX:r.style.overflowX,scrollBehavior:r.style.scrollBehavior};const T=n.scrollHeight>n.clientHeight,j=n.scrollWidth>n.clientWidth,q=b.overflowY==="scroll"||C.overflowY==="scroll",$=b.overflowX==="scroll"||C.overflowX==="scroll",le=Math.max(0,o.innerWidth-r.clientWidth),M=Math.max(0,o.innerHeight-r.clientHeight),Q=parseFloat(C.marginTop)+parseFloat(C.marginBottom),se=parseFloat(C.marginLeft)+parseFloat(C.marginRight),ee=Be(n,r);if(l=Yn(e),l){n.style.scrollbarGutter=v,ee.style.overflowY="hidden",ee.style.overflowX="hidden";return}Object.assign(n.style,{scrollbarGutter:v,overflowY:"hidden",overflowX:"hidden"}),(T||q)&&(n.style.overflowY="scroll"),(j||$)&&(n.style.overflowX="scroll"),Object.assign(r.style,{position:"relative",height:Q||M?`calc(100dvh - ${Q+M}px)`:"100dvh",width:se||le?`calc(100vw - ${se+le}px)`:"100vw",boxSizing:"border-box",overflowY:"hidden",overflowX:"hidden",scrollBehavior:"unset"}),r.scrollTop=s,r.scrollLeft=i,n.setAttribute("data-base-ui-scroll-locked",""),n.style.scrollBehavior="unset"}function R(){Object.assign(n.style,vt),Object.assign(r.style,Rt),l||(n.scrollTop=s,n.scrollLeft=i,n.removeAttribute("data-base-ui-scroll-locked"),n.style.scrollBehavior=St)}function O(){R(),a.request(f)}f();const d=I(o,"resize",O);return()=>{a.cancel(),R(),typeof o.removeEventListener=="function"&&d()}}class Un{lockCount=0;restore=null;timeoutLock=De.create();timeoutUnlock=De.create();acquire(t){return this.lockCount+=1,this.lockCount===1&&this.restore===null&&this.timeoutLock.start(0,()=>this.lock(t)),this.release}release=()=>{this.lockCount-=1,this.lockCount===0&&this.restore&&this.timeoutUnlock.start(0,this.unlock)};unlock=()=>{this.lockCount===0&&this.restore&&(this.restore?.(),this.restore=null)};lock(t){if(this.lockCount===0||this.restore!==null)return;const n=X(t),r=n.documentElement,o=n.body,s=Le(r);if(Ct(s,r,o)){const l=new s.MutationObserver(()=>{Ct(s,r,o)||(l.disconnect(),this.restore=null,this.lock(t))}),a={attributes:!0};l.observe(r,a),l.observe(o,a),this.restore=()=>l.disconnect();return}const i=an||!Hn(t);this.restore=i?Gn(t):_n(t)}}const Xn=new Un;function vr(e=!0,t=null){D(()=>{if(e)return Xn.acquire(t)},[e,t])}const Vn="ArrowUp",Kn="ArrowDown",qn="ArrowLeft",$n="ArrowRight",jn="Home",zn="End",Rr=new Set([Vn,Kn,qn,$n,jn,zn]);export{nr as A,rr as B,Rr as C,Cn as D,Ue as E,Wn as F,Rn as G,Pt as H,Tr as I,Er as P,Ln as a,vn as b,ur as c,sr as d,cr as e,ir as f,vr as g,mr as h,fr as i,lr as j,br as k,gr as l,hr as m,ar as n,tr as o,er as p,tt as q,et as r,Fe as s,Zn as t,yr as u,Ae as v,dr as w,or as x,pr as y,Qn as z};
1
+ import{aH as Gt,bT as Ke,bU as _t,bb as je,ax as D,b9 as Ut,bh as X,bV as Ot,bL as ze,j as Re,bW as Je,r as m,bf as Y,bX as st,bY as Xt,az as it,be as We,bB as Vt,bZ as ct,bj as I,bi as Pe,bA as me,b_ as qe,b$ as fe,c0 as de,aO as w,bk as Kt,c1 as wt,c2 as Ze,bC as qt,bx as ut,br as lt,bt as $t,c3 as jt,c4 as xt,c5 as Qe,aC as Le,aN as Ee,c6 as zt,bw as Jt,c7 as Zt,w as ke,bq as Qt,c8 as Ye,bn as en,bd as De,bo as tn,bg as Ie,bH as Ge,bG as nn,c9 as rn,bE as on,aP as sn,ca as be,aF as cn,aG as un,E as _e,cb as ln,bS as an,bM as fn}from"./__vite-browser-external-DYzNZTW8.js";const dn="data-open",pn="data-closed",gn="data-anchor-hidden",It="data-popup-open",hn="data-pressed",mn={[It]:""},bn={[It]:"",[hn]:""},En={[dn]:""},yn={[pn]:""},Tn={[gn]:""},Zn={open(e){return e?mn:null}},Qn={open(e){return e?bn:null}},vn={open(e){return e?En:yn},anchorHidden(e){return e?Tn:null}},er={...vn,...Gt};function Fe(e,t,n=!0){return e.filter(o=>o.parentId===t).flatMap(o=>[...!n||o.context?.open?[o]:[],...Fe(e,o.id,n)])}function at(e,t){let n=[],r=e.find(o=>o.id===t)?.parentId;for(;r;){const o=e.find(s=>s.id===r);r=o?.parentId,o&&(n=n.concat(o))}return n}function Rn(e){e.preventDefault(),e.stopPropagation()}function Sn(e){return"nativeEvent"in e}function Pt(e){return e.pointerType===""&&e.isTrusted?!0:Ke&&e.pointerType?e.type==="click"&&e.buttons===1:e.detail===0&&!e.pointerType}function Cn(e){return _t?!1:!Ke&&e.width===0&&e.height===0||Ke&&e.width===1&&e.height===1&&e.pressure===0&&e.detail===0&&e.pointerType==="mouse"||e.width<1&&e.height<1&&e.pressure===0&&e.detail===0&&e.pointerType==="touch"}function tr(e,t){const n=["mouse","pen"];return t||n.push("",void 0),n.includes(e)}function On(e){const t=e.type;return t==="click"||t==="mousedown"||t==="keydown"||t==="keyup"}function Ae(e){const t=je(wn,e).current;return t.next=e,D(t.effect),t}function wn(e){const t={current:e,next:e,effect:()=>{t.current=t.next}};return t}let Ne=0;function Ue(e,t={}){const{preventScroll:n=!1,sync:r=!1,shouldFocus:o}=t;cancelAnimationFrame(Ne);function s(){o&&!o()||e?.focus({preventScroll:n})}if(r)return s(),Ut;const i=requestAnimationFrame(s);return Ne=i,()=>{Ne===i&&(cancelAnimationFrame(i),Ne=0)}}const Xe={inert:new WeakMap,"aria-hidden":new WeakMap},ft="data-base-ui-inert",$e={inert:new WeakSet,"aria-hidden":new WeakSet};let xe=new WeakMap,Ve=0;function xn(e){return $e[e]}function kt(e){return e?Ot(e)?e.host:kt(e.parentNode):null}const dt=(e,t)=>t.map(n=>{if(e.contains(n))return n;const r=kt(n);return e.contains(r)?r:null}).filter(n=>n!=null),pt=e=>{const t=new Set;return e.forEach(n=>{let r=n;for(;r&&!t.has(r);)t.add(r),r=r.parentNode}),t},gt=(e,t,n)=>{const r=[],o=s=>{!s||n.has(s)||Array.from(s.children).forEach(i=>{ze(i)!=="script"&&(t.has(i)?o(i):r.push(i))})};return o(e),r};function In(e,t,n,r,{mark:o=!0}){let s=null;r?s="inert":n&&(s="aria-hidden");let i=null,l=null;const a=dt(t,e),f=o?gt(t,pt(a),new Set(a)):[],R=[],O=[];if(s){const d=Xe[s],b=xn(s);l=b,i=d;const C=dt(t,Array.from(t.querySelectorAll("[aria-live]"))),V=a.concat(C);gt(t,pt(V),new Set(V)).forEach(v=>{const T=v.getAttribute(s),j=T!==null&&T!=="false",q=(d.get(v)||0)+1;d.set(v,q),R.push(v),q===1&&j&&b.add(v),j||v.setAttribute(s,s==="inert"?"":"true")})}return o&&f.forEach(d=>{const b=(xe.get(d)||0)+1;xe.set(d,b),O.push(d),b===1&&d.setAttribute(ft,"")}),Ve+=1,()=>{i&&R.forEach(d=>{const C=(i.get(d)||0)-1;i.set(d,C),C||(!l?.has(d)&&s&&d.removeAttribute(s),l?.delete(d))}),o&&O.forEach(d=>{const b=(xe.get(d)||0)-1;xe.set(d,b),b||d.removeAttribute(ft)}),Ve-=1,Ve||(Xe.inert=new WeakMap,Xe["aria-hidden"]=new WeakMap,$e.inert=new WeakSet,$e["aria-hidden"]=new WeakSet,xe=new WeakMap)}}function ht(e,t={}){const{ariaHidden:n=!1,inert:r=!1,mark:o=!0}=t,s=X(e[0]).body;return In(e,s,n,r,{mark:o})}function Ft(){const e=new Map;return{emit(t,n){e.get(t)?.forEach(r=>r(n))},on(t,n){e.has(t)||e.set(t,new Set),e.get(t).add(n)},off(t,n){e.get(t)?.delete(n)}}}class Pn{nodesRef={current:[]};events=Ft();addNode(t){this.nodesRef.current.push(t)}removeNode(t){const n=this.nodesRef.current.findIndex(r=>r===t);n!==-1&&this.nodesRef.current.splice(n,1)}}const Mt=m.createContext(null),At=m.createContext(null),et=()=>m.useContext(Mt)?.id||null,tt=e=>{const t=m.useContext(At);return e??t};function nr(e){const t=Je(),n=tt(e),r=et();return D(()=>{if(!t)return;const o={id:t,parentId:r};return n?.addNode(o),()=>{n?.removeNode(o)}},[n,t,r]),t}function rr(e){const{children:t,id:n}=e,r=et();return Re.jsx(Mt.Provider,{value:m.useMemo(()=>({id:n,parentId:r}),[n,r]),children:t})}function or(e){const{children:t,externalTree:n}=e,r=je(()=>n??new Pn).current;return Re.jsx(At.Provider,{value:r,children:t})}function kn(e,t){const n=Le(Ee(e));return e instanceof n.KeyboardEvent?"keyboard":e instanceof n.FocusEvent?t||"keyboard":"pointerType"in e?e.pointerType||"keyboard":"touches"in e?"touch":e instanceof n.MouseEvent?t||(e.detail===0?"keyboard":"mouse"):""}const mt=20;let pe=[];function nt(){pe=pe.filter(e=>e.deref()?.isConnected)}function bt(e){nt(),e&&ze(e)!=="body"&&(pe.push(new WeakRef(e)),pe.length>mt&&(pe=pe.slice(-mt)))}function Et(){return nt(),pe[pe.length-1]?.deref()}function Fn(e){return e?Qe(e)?e:xt(e)[0]||e:null}function yt(e){if(e.hasAttribute("tabindex")&&!e.hasAttribute("data-tabindex")||!e.getAttribute("role")?.includes("dialog"))return;const n=zt(e).filter(o=>{const s=o.getAttribute("data-tabindex")||"";return Qe(o)||o.hasAttribute("data-tabindex")&&!s.startsWith("-")}),r=e.getAttribute("tabindex");n.length===0?r!=="0"&&(e.setAttribute("tabindex","0"),e.setAttribute("data-tabindex","0")):(r!=="-1"||e.hasAttribute("data-tabindex")&&e.getAttribute("data-tabindex")!=="-1")&&(e.setAttribute("tabindex","-1"),e.setAttribute("data-tabindex","-1"))}function sr(e){const{context:t,children:n,disabled:r=!1,initialFocus:o=!0,returnFocus:s=!0,restoreFocus:i=!1,modal:l=!0,closeOnFocusOut:a=!0,openInteractionType:f="",nextFocusableElement:R,previousFocusableElement:O,beforeContentFocusGuardRef:d,externalTree:b,getInsideElements:C}=e,V="rootStore"in t?t.rootStore:t,F=V.useState("open"),v=V.useState("domReferenceElement"),T=V.useState("floatingElement"),{events:j,dataRef:q}=V.context,$=Y(()=>q.current.floatingContext?.nodeId),le=o===!1,M=st(v)&&le,Q=Ae(o),se=Ae(s),ee=Ae(f),B=Ae(F),G=tt(b),S=Xt(),N=m.useRef(!1),ae=m.useRef(!1),te=m.useRef(!1),ye=m.useRef(null),ie=m.useRef(""),z=m.useRef(""),ge=m.useRef(null),he=m.useRef(null),Se=it(ge,d,S?.beforeInsideRef),Me=it(he,S?.afterInsideRef),E=We(),L=We(),A=Vt(),Te=S!=null,y=ct(T),ne=Y((h=y)=>h?xt(h):[]),re=Y(()=>C?.().filter(h=>h!=null)??[]);m.useEffect(()=>{if(r||!l)return;function h(W){W.key==="Tab"&&w(y,de(X(y)))&&ne().length===0&&!M&&Rn(W)}const P=X(y);return I(P,"keydown",h)},[r,y,l,M,ne]),m.useEffect(()=>{if(r||!F)return;const h=X(y);function P(){te.current=!1}function W(oe){const g=Ee(oe),x=re(),p=w(T,g)||w(v,g)||w(S?.portalNode,g)||x.some(k=>k===g||w(k,g));te.current=!p,z.current=oe.pointerType||"keyboard",g?.closest(`[${Jt}]`)&&(ae.current=!0,L.start(0,()=>{ae.current=!1}))}function _(){z.current="keyboard"}return Pe(I(h,"pointerdown",W,!0),I(h,"pointerup",P,!0),I(h,"pointercancel",P,!0),I(h,"keydown",_,!0),P)},[r,T,v,y,F,S,L,re]),m.useEffect(()=>{if(r||!a)return;const h=X(y);function P(){ae.current=!0,L.start(0,()=>{ae.current=!1})}function W(x){const p=Ee(x);Qe(p)&&(ye.current=p)}function _(x){const p=x.relatedTarget,k=x.currentTarget,K=Ee(x);l&&p==null&&K!=null&&w(T,K)&&bt(K),queueMicrotask(()=>{const J=$(),Z=V.context.triggerElements,Ce=re(),ve=p?.hasAttribute(qe("focus-guard"))&&[ge.current,he.current,S?.beforeInsideRef.current,S?.afterInsideRef.current,S?.beforeOutsideRef.current,S?.afterOutsideRef.current,fe(O),fe(R)].includes(p),u=!(w(v,p)||w(T,p)||w(p,T)||w(S?.portalNode,p)||Ce.some(c=>c===p||w(c,p))||Z.hasMatchingElement(c=>w(c,p))||ve||G&&(Fe(G.nodesRef.current,J).find(c=>w(c.context?.elements.floating,p)||w(c.context?.elements.domReference,p))||at(G.nodesRef.current,J).find(c=>[c.context?.elements.floating,ct(c.context?.elements.floating)].includes(p)||c.context?.elements.domReference===p)));if(k===v&&y&&yt(y),i&&k!==v&&!Zt(K)&&de(h)===h.body){if(me(y)&&(y.focus(),i==="popup")){A.request(()=>{y.focus()});return}const c=ne(),H=ye.current,U=(H&&c.includes(H)?H:null)||c[c.length-1]||y;me(U)&&U.focus()}if(q.current.insideReactTree){q.current.insideReactTree=!1;return}(M||!l)&&p&&u&&!ae.current&&(M||p!==Et())&&(N.current=!0,V.setOpen(!1,ke(Qt,x)))})}function oe(){te.current||(q.current.insideReactTree=!0,E.start(0,()=>{q.current.insideReactTree=!1}))}const g=me(v)?v:null;if(!(!T&&!g))return Pe(g&&I(g,"focusout",_),g&&I(g,"pointerdown",P),T&&I(T,"focusin",W),T&&I(T,"focusout",_),T&&S&&I(T,"focusout",oe,!0))},[r,v,T,y,l,G,S,V,a,i,ne,M,$,q,E,L,A,R,O,re]),m.useEffect(()=>{if(r||!T||!F)return;const h=Array.from(S?.portalNode?.querySelectorAll(`[${qe("portal")}]`)||[]),W=(G?at(G.nodesRef.current,$()):[]).find(k=>st(k.context?.elements.domReference||null))?.context?.elements.domReference,oe=[...[T,...h,ge.current,he.current,S?.beforeOutsideRef.current,S?.afterOutsideRef.current,...re()],W,fe(O),fe(R),M?v:null].filter(k=>k!=null),g=ht(oe,{ariaHidden:l||M,mark:!1}),x=[T,...h].filter(k=>k!=null),p=ht(x);return()=>{p(),g()}},[F,r,v,T,l,S,M,G,$,R,O,re]),D(()=>{if(!F||r||!me(y))return;ie.current="",z.current="";const h=X(y),P=de(h);queueMicrotask(()=>{const W=Q.current,_=typeof W=="function"?W(ee.current||""):W;if(_===void 0||_===!1||w(y,P))return;let g=null;const x=()=>(g==null&&(g=ne(y)),g[0]||y);let p;_===!0||_===null?p=x():p=fe(_),p=p||x();const k=w(y,de(h));Ue(p,{preventScroll:p===y,shouldFocus(){if(!B.current)return!1;if(k)return!0;const K=de(h);return!(K!==p&&w(y,K))}})})},[r,F,y,ne,Q,ee,B]),D(()=>{if(r||!y)return;const h=X(y),P=de(h),W=ee.current==null;bt(P);function _(g){if(g.open||(ie.current=kn(g.nativeEvent,z.current)),g.reason===Kt&&g.nativeEvent.type==="mouseleave"&&(N.current=!0),g.reason===wt)if(g.nested)N.current=!1;else if(Pt(g.nativeEvent)||Cn(g.nativeEvent))N.current=!1;else{let x=!1;X(y).createElement("div").focus({get preventScroll(){return x=!0,!1}}),x?N.current=!1:N.current=!0}}j.on("openchange",_);function oe(g){const x=se.current;let p=typeof x=="function"?x(g):x;if(p===void 0||p===!1)return null;p===null&&(p=!0);const k=v?.isConnected?v:null,K=P?.isConnected&&ze(P)!=="body"?P:null;let J=W?K||k:k||K;return J||(J=Et()||null),typeof p=="boolean"?J:fe(p)||J||null}return()=>{j.off("openchange",_);const g=de(h),x=re(),p=w(T,g)||x.some(Z=>Z===g||w(Z,g))||G&&Fe(G.nodesRef.current,$(),!1).some(Z=>w(Z.context?.elements.floating,g)),k=se.current,K=ie.current,J=oe(K);queueMicrotask(()=>{const Z=Fn(J),Ce=typeof k!="boolean";if(k&&!N.current&&me(Z)&&(!(!Ce&&Z!==g&&g!==h.body)||p)){const ve={preventScroll:!0};K==="keyboard"&&(ve.focusVisible=!0),Z.focus(ve)}N.current=!1})}},[r,T,y,se,ee,j,G,v,$,re]),D(()=>{if(!Ze||F||!T)return;const h=de(X(T));!me(h)||!qt(h)||w(T,h)&&h.blur()},[F,T]),D(()=>{if(!(r||!S))return S.setFocusManagerState({modal:l,closeOnFocusOut:a,open:F,onOpenChange:V.setOpen,domReference:v}),()=>{S.setFocusManagerState(null)}},[r,S,l,F,V,a,v]),D(()=>{if(!(r||!y))return yt(y),()=>{queueMicrotask(nt)}},[r,y]);const ce=!r&&(l?!M:!0)&&(Te||l);return Re.jsxs(m.Fragment,{children:[ce&&Re.jsx(ut,{"data-type":"inside",ref:Se,onFocus:h=>{if(l){const P=ne();Ue(P[P.length-1])}else S?.portalNode&&(N.current=!1,lt(h,S.portalNode)?$t(v)?.focus():fe(O??S.beforeOutsideRef)?.focus())}}),n,ce&&Re.jsx(ut,{"data-type":"inside",ref:Me,onFocus:h=>{l?Ue(ne()[0]):S?.portalNode&&(a&&(N.current=!0),lt(h,S.portalNode)?jt(v)?.focus():fe(R??S.afterOutsideRef)?.focus())}})]})}function Mn(){return!1}function An(e){return{escapeKey:typeof e=="boolean"?e:e?.escapeKey??!1,outsidePress:typeof e=="boolean"?e:e?.outsidePress??!0}}function ir(e,t={}){const{enabled:n=!0,escapeKey:r=!0,outsidePress:o=!0,outsidePressEvent:s="sloppy",referencePress:i=Mn,bubbles:l,externalTree:a}=t,f="rootStore"in e?e.rootStore:e,R=f.useState("open"),O=f.useState("floatingElement"),{dataRef:d,events:b}=f.context,C=tt(a),V=Y(typeof o=="function"?o:()=>!1),F=typeof o=="function"?V:o,v=F!==!1,T=Y(()=>s),{escapeKey:j,outsidePress:q}=An(l),$=m.useRef(!1),le=m.useRef(!1),M=m.useRef(!1),Q=m.useRef(!1),se=m.useRef(!1),ee=m.useRef(""),B=m.useRef(null),G=We(),S=We(),N=Y(()=>{S.clear(),d.current.insideReactTree=!1}),ae=Y(E=>{const L=d.current.floatingContext?.nodeId;return(C?Fe(C.nodesRef.current,L):[]).some(Te=>Te.context?.open&&!Te.context.dataRef.current[E])}),te=Y(E=>Ye(E,f.select("floatingElement"))||Ye(E,f.select("domReferenceElement"))),ye=Y(E=>{i()&&f.setOpen(!1,ke(en,E.nativeEvent))}),ie=Y(E=>{if(!R||!n||!r||E.key!=="Escape"||se.current||!j&&ae("__escapeKeyBubbles"))return;const L=Sn(E)?E.nativeEvent:E,A=ke(tn,L);f.setOpen(!1,A),A.isCanceled||E.preventDefault(),!j&&!A.isPropagationAllowed&&E.stopPropagation()}),z=Y(()=>{d.current.insideReactTree=!0,S.start(0,N)}),ge=Y(E=>{if(!R||!n||E.button!==0)return;const L=Ee(E.nativeEvent);w(f.select("floatingElement"),L)&&($.current||($.current=!0,le.current=!1))}),he=Y(E=>{!R||!n||(E.defaultPrevented||E.nativeEvent.defaultPrevented)&&$.current&&(le.current=!0)});m.useEffect(()=>{function E(L){L.open||(Q.current=!1)}return b.on("openchange",E),()=>{b.off("openchange",E)}},[b]),m.useEffect(()=>{if(!R||!n)return R||(Q.current=!1),N;d.current.__escapeKeyBubbles=j,d.current.__outsidePressBubbles=q;const E=new De,L=new De,A=X(O);function Te(){E.clear(),se.current=!0}function y(){E.start(Ze?5:0,()=>{se.current=!1})}function ne(){M.current=!0,L.start(0,()=>{M.current=!1})}function re(){$.current=!1,le.current=!1}function ce(){const u=ee.current,c=u==="pen"||!u?"mouse":u,H=T(),U=typeof H=="function"?H():H;return typeof U=="string"?U:U[c]}function h(u){const c=ce();return c==="intentional"&&u.type!=="click"||c==="sloppy"&&u.type==="click"}function P(u){const c=d.current.floatingContext?.nodeId,H=C&&Fe(C.nodesRef.current,c).some(U=>Ye(u,U.context?.elements.floating));return te(u)||H}function W(u){if(h(u)){u.type!=="click"&&!te(u)&&(L.clear(),M.current=!1),N();return}if(d.current.insideReactTree){N();return}const c=Ee(u),H=`[${qe("inert")}]`,U=Ie(c)?c.getRootNode():null,Oe=Array.from((Ot(U)?U:X(f.select("floatingElement"))).querySelectorAll(H)),rt=f.context.triggerElements;if(c&&(rt.hasElement(c)||rt.hasMatchingElement(ue=>w(ue,c))))return;let we=Ie(c)?c:null;for(;we&&!Ge(we);){const ue=nn(we);if(Ge(ue)||!Ie(ue))break;we=ue}if(!(Oe.length&&Ie(c)&&!rn(c)&&!w(c,f.select("floatingElement"))&&Oe.every(ue=>!w(we,ue)))){if(me(c)&&!("touches"in u)){const ue=Ge(c),He=on(c),ot=/auto|scroll/,Nt=ue||ot.test(He.overflowX),Wt=ue||ot.test(He.overflowY),Dt=Nt&&c.clientWidth>0&&c.scrollWidth>c.clientWidth,Lt=Wt&&c.clientHeight>0&&c.scrollHeight>c.clientHeight,Bt=He.direction==="rtl",Ht=Lt&&(Bt?u.offsetX<=c.offsetWidth-c.clientWidth:u.offsetX>c.clientWidth),Yt=Dt&&u.offsetY>c.clientHeight;if(Ht||Yt)return}if(!P(u)){if(ce()==="intentional"){if(u.detail!==0&&!Pt(u)&&!Q.current)return;if(M.current){L.clear(),M.current=!1;return}}typeof F=="function"&&!F(u)||ae("__outsidePressBubbles")||(f.setOpen(!1,ke(wt,u)),N())}}}function _(u){ce()!=="sloppy"||u.pointerType==="touch"||!f.select("open")||!n||te(u)||W(u)}function oe(u){if(ce()!=="sloppy"||!f.select("open")||!n||te(u))return;const c=u.touches[0];c&&(B.current={startTime:Date.now(),startX:c.clientX,startY:c.clientY,dismissOnTouchEnd:!1,dismissOnMouseDown:!0},G.start(1e3,()=>{B.current&&(B.current.dismissOnTouchEnd=!1,B.current.dismissOnMouseDown=!1)}))}function g(u,c){const H=Ee(u);if(!H)return;const U=I(H,u.type,()=>{c(u),U()})}function x(u){ee.current="touch",g(u,oe)}function p(u){G.clear(),u.type==="pointerdown"&&(u.button===0&&(Q.current=!0),ee.current=u.pointerType),!(u.type==="mousedown"&&B.current&&!B.current.dismissOnMouseDown)&&g(u,c=>{c.type==="pointerdown"?_(c):W(c)})}function k(u){if(u.type==="pointercancel"&&(Q.current=!1),!$.current)return;const c=le.current;if(re(),ce()==="intentional"){if(u.type==="pointercancel"){c&&ne();return}if(!P(u)){if(c){ne();return}typeof F=="function"&&!F(u)||(L.clear(),M.current=!0,N())}}}function K(u){if(ce()!=="sloppy"||!B.current||te(u))return;const c=u.touches[0];if(!c)return;const H=Math.abs(c.clientX-B.current.startX),U=Math.abs(c.clientY-B.current.startY),Oe=Math.sqrt(H*H+U*U);Oe>5&&(B.current.dismissOnTouchEnd=!0),Oe>10&&(W(u),G.clear(),B.current=null)}function J(u){g(u,K)}function Z(u){ce()!=="sloppy"||!B.current||te(u)||(B.current.dismissOnTouchEnd&&W(u),G.clear(),B.current=null)}function Ce(u){g(u,Z)}const ve=Pe(r&&Pe(I(A,"keydown",ie),I(A,"compositionstart",Te),I(A,"compositionend",y)),v&&Pe(I(A,"click",p,!0),I(A,"pointerdown",p,!0),I(A,"pointerup",k,!0),I(A,"pointercancel",k,!0),I(A,"mousedown",p,!0),I(A,"mouseup",k,!0),I(A,"touchstart",x,{capture:!0,passive:!0}),I(A,"touchmove",J,{capture:!0,passive:!0}),I(A,"touchend",Ce,{capture:!0,passive:!0})));return()=>{ve(),E.clear(),L.clear(),re(),M.current=!1,N()}},[d,O,r,v,F,R,n,j,q,ie,N,T,ae,te,C,f,G]);const Se=m.useMemo(()=>({onKeyDown:ie,onPointerDown:ye,onClick:ye}),[ie,ye]),Me=m.useMemo(()=>({onKeyDown:ie,onPointerDown:he,onMouseDown:he,onClickCapture:z,onMouseDownCapture(E){z(),ge(E)},onPointerDownCapture(E){z(),ge(E)},onMouseUpCapture:z,onTouchEndCapture:z,onTouchMoveCapture:z}),[ie,z,ge,he]);return m.useMemo(()=>n?{reference:Se,floating:Me,trigger:Se}:{},[n,Se,Me])}const Nn={open:e=>e.open,transitionStatus:e=>e.transitionStatus,domReferenceElement:e=>e.domReferenceElement,referenceElement:e=>e.positionReference??e.referenceElement,floatingElement:e=>e.floatingElement,floatingId:e=>e.floatingId};class Wn extends sn{constructor(t){const{syncOnly:n,nested:r,onOpenChange:o,triggerElements:s,...i}=t;super({...i,positionReference:i.referenceElement,domReferenceElement:i.referenceElement},{onOpenChange:o,dataRef:{current:{}},events:Ft(),nested:r,triggerElements:s},Nn),this.syncOnly=n}syncOpenEvent=(t,n)=>{(!t||!this.state.open||n!=null&&On(n))&&(this.context.dataRef.current.openEvent=t?n:void 0)};dispatchOpenChange=(t,n)=>{this.syncOpenEvent(t,n.event);const r={open:t,reason:n.reason,nativeEvent:n.event,nested:this.context.nested,triggerElement:n.trigger};this.context.events.emit("openchange",r)};setOpen=(t,n)=>{if(this.syncOnly){this.context.onOpenChange?.(t,n);return}this.dispatchOpenChange(t,n),this.context.onOpenChange?.(t,n)}}function Dn(e){const{popupStore:t,treatPopupAsFloatingElement:n=!1,floatingRootContext:r,floatingId:o,nested:s,onOpenChange:i}=e,l=t.useState("open"),a=t.useState("activeTriggerElement"),f=t.useState(n?"popupElement":"positionerElement"),R=t.context.triggerElements,O=i,d=m.useRef(null);r===void 0&&d.current===null&&(d.current=new Wn({open:l,transitionStatus:void 0,referenceElement:a,floatingElement:f,triggerElements:R,onOpenChange:O,floatingId:o,syncOnly:!0,nested:s}));const b=r??d.current;return t.useSyncedValue("floatingId",o),D(()=>{const C={open:l,floatingId:o,referenceElement:a,floatingElement:f};Ie(a)&&(C.domReferenceElement=a),b.state.positionReference===b.state.referenceElement&&(C.positionReference=a),b.update(C)},[l,o,a,f,b]),b.context.onOpenChange=O,b.context.nested=s,b}function Ln(e,t=!1,n=!1,r=!1){const[o,s]=m.useState(e&&t?"idle":void 0),[i,l]=m.useState(e&&!r);return e&&!i&&(l(!0),s("starting")),!e&&i&&o!=="ending"&&!n&&s("ending"),!e&&!i&&o==="ending"&&s(void 0),D(()=>{if(!e&&i&&o!=="ending"&&n){const a=be.request(()=>{s("ending")});return()=>{be.cancel(a)}}},[e,i,o,n]),D(()=>{if(!e||t)return;const a=be.request(()=>{s(void 0)});return()=>{be.cancel(a)}},[t,e]),D(()=>{if(!e||!t)return;e&&i&&o!=="idle"&&s("starting");const a=be.request(()=>{s("idle")});return()=>{be.cancel(a)}},[t,e,i,o]),{mounted:i,setMounted:l,transitionStatus:o}}const cr={tabIndex:-1,[ln]:""};function ur(e){return t=>t==="touch"?e.current:!0}function lr(e,t=!1){const n=Je(),r=et()!=null,o=je(()=>e(n,r)).current;return Dn({popupStore:o,treatPopupAsFloatingElement:t,floatingRootContext:o.state.floatingRootContext,floatingId:n,nested:r,onOpenChange:o.setOpen}),o}function ar({handle:e,store:t}){return D(()=>e.attachStore(t),[e,t]),null}function Tt(e){const t=e.context.triggerElements.size;e.select("open")&&e.state.triggerCount!==t&&e.set("triggerCount",t)}function Bn(e,t){const n=m.useRef(null);return Y(r=>{const o=n.current;if(o!==null){if(o.element===r&&o.store===t&&o.id===e)return;n.current=null;const s=o.store;s.context.triggerElements.getById(o.id)===o.element&&(s.context.triggerElements.delete(o.id),Tt(s))}r!==null&&e!==void 0&&(n.current={store:t,id:e,element:r},t.context.triggerElements.add(e,r),Tt(t))})}function fr(e,t,n,r=!1){let o=e.preventUnmountingOnClose;t?o=!1:r&&(o=!0);const s=n?.id??null;let i=e.activeTriggerId,l=e.activeTriggerElement;return(s||t)&&(i=s,l=n??null),{open:t,preventUnmountingOnClose:o,activeTriggerId:i,activeTriggerElement:l}}function dr(e){let t=!1;return e.preventUnmountOnClose=()=>{t=!0},()=>t}function pr(e,t,n,r){const o=n.useState("isMountedByTrigger",e),s=Bn(e,n),i=Y(a=>{const f=n.select("open"),R=n.select("activeTriggerId");if(R===e){const O={activeTriggerElement:a,...f?r:null};n.update(O);return}if(R==null&&f){const O={activeTriggerId:e??null,activeTriggerElement:a,...r};n.update(O)}}),l=Y(a=>{s(a),a&&i(a)});return D(()=>(l(t.current),()=>l(null)),[l,t,n,e]),D(()=>{if(o){const a={activeTriggerElement:t.current,...r};n.update(a)}},[o,n,t,...Object.values(r)]),{registerTrigger:l,isMountedByThisTrigger:o}}function gr(e,t={}){const{closeOnActiveTriggerUnmount:n=!1}=t,r=m.useRef(null),o=e.useState("open"),s=e.useState("triggerCount"),i=e.useState("activeTriggerId"),l=e.useState("activeTriggerElement");D(()=>{if(!o){r.current=null,e.state.triggerCount!==0&&e.set("triggerCount",0);return}const a=e.context.triggerElements.size,f={};e.state.triggerCount!==a&&(f.triggerCount=a);const R=e.select("activeTriggerId");let O=null;if(R){const d=e.context.triggerElements.getById(R);if(d)r.current=R,d!==e.state.activeTriggerElement&&(f.activeTriggerElement=d);else{for(const[b,C]of e.context.triggerElements.entries())if(C===e.state.activeTriggerElement){f.activeTriggerId=b,f.activeTriggerElement=C,r.current=b;break}f.activeTriggerId===void 0&&(r.current===R?O=R:r.current=null)}}else r.current=null;if(!O&&!R&&a===1){const d=e.context.triggerElements.entries().next();if(!d.done){const[b,C]=d.value;f.activeTriggerId=b,f.activeTriggerElement=C,r.current=b}}(f.triggerCount!==void 0||f.activeTriggerId!==void 0||f.activeTriggerElement!==void 0)&&e.update(f),O&&n&&queueMicrotask(()=>{if(e.select("open")&&e.select("activeTriggerId")===O&&!e.context.triggerElements.getById(O)){const d=ke(cn);e.setOpen(!1,d),d.isCanceled||e.update({activeTriggerId:null,activeTriggerElement:null})}})},[o,e,s,i,l,n])}function hr(e,t,n,r){const{mounted:o,setMounted:s,transitionStatus:i}=Ln(e,!1,!1,r),l=t.useState("preventUnmountingOnClose"),a=e?!1:l;t.useSyncedValues({mounted:o,transitionStatus:i,preventUnmountingOnClose:a});const f=Y(()=>{s(!1),t.update({activeTriggerId:null,activeTriggerElement:null,mounted:!1,preventUnmountingOnClose:!1}),n?.(),t.context.onOpenChangeComplete?.(!1)});return un({enabled:o&&!e&&!a,open:e,ref:t.context.popupRef,onComplete(){e||f()}}),{forceUnmount:f,transitionStatus:i}}function mr(e,t){e.useSyncedValues(t),D(()=>()=>{e.update({activeTriggerProps:_e,inactiveTriggerProps:_e,popupProps:_e})},[e])}function br(e,t){D(()=>{!t&&e.state.openMethod!==null&&e.set("openMethod",null)},[t,e]),D(()=>()=>{e.state.openMethod!==null&&e.set("openMethod",null)},[e])}class Er{constructor(){this.idMap=new Map}add(t,n){this.idMap.set(t,n)}delete(t){this.idMap.delete(t)}hasElement(t){for(const n of this.idMap.values())if(n===t)return!0;return!1}hasMatchingElement(t){for(const n of this.idMap.values())if(t(n))return!0;return!1}getById(t){return this.idMap.get(t)}entries(){return this.idMap.entries()}elements(){return this.idMap.values()}get size(){return this.idMap.size}}function yr(e){return Je(e,"base-ui")}const Tr=m.forwardRef(function(t,n){const{cutout:r,...o}=t;let s;if(r){const i=r.getBoundingClientRect();s=`polygon(0% 0%,100% 0%,100% 100%,0% 100%,0% 0%,${i.left}px ${i.top}px,${i.left}px ${i.bottom}px,${i.right}px ${i.bottom}px,${i.right}px ${i.top}px,${i.left}px ${i.top}px)`}return Re.jsx("div",{ref:n,role:"presentation","data-base-ui-inert":"",...o,style:{position:"fixed",inset:0,userSelect:"none",WebkitUserSelect:"none",clipPath:s}})});let vt={},Rt={},St="";function Be(e,t){return fn(e)?e:t}function Ct(e,t,n){return/hidden|clip/.test(e.getComputedStyle(Be(t,n)).overflowY)}function Hn(e){if(typeof document>"u")return!1;const t=X(e);return Le(t).innerWidth-t.documentElement.clientWidth>0}function Yn(e){if(!(typeof CSS<"u"&&CSS.supports&&CSS.supports("scrollbar-gutter","stable"))||typeof document>"u")return!1;const n=X(e),r=n.documentElement,o=n.body,s=Be(r,o),i=s.style.overflowY,l=r.style.scrollbarGutter;r.style.scrollbarGutter="stable",s.style.overflowY="scroll";const a=s.offsetWidth;s.style.overflowY="hidden";const f=s.offsetWidth;return s.style.overflowY=i,r.style.scrollbarGutter=l,a===f}function Gn(e){const t=X(e),n=t.documentElement,r=t.body,o=Be(n,r),s={overflowY:o.style.overflowY,overflowX:o.style.overflowX};return Object.assign(o.style,{overflowY:"hidden",overflowX:"hidden"}),()=>{Object.assign(o.style,s)}}function _n(e){const t=X(e),n=t.documentElement,r=t.body,o=Le(n);let s=0,i=0,l=!1;const a=be.create();if(Ze&&(o.visualViewport?.scale??1)!==1)return()=>{};function f(){const b=o.getComputedStyle(n),C=o.getComputedStyle(r),v=(b.scrollbarGutter||"").includes("both-edges")?"stable both-edges":"stable";s=n.scrollTop,i=n.scrollLeft,vt={scrollbarGutter:n.style.scrollbarGutter,overflowY:n.style.overflowY,overflowX:n.style.overflowX},St=n.style.scrollBehavior,Rt={position:r.style.position,height:r.style.height,width:r.style.width,boxSizing:r.style.boxSizing,overflowY:r.style.overflowY,overflowX:r.style.overflowX,scrollBehavior:r.style.scrollBehavior};const T=n.scrollHeight>n.clientHeight,j=n.scrollWidth>n.clientWidth,q=b.overflowY==="scroll"||C.overflowY==="scroll",$=b.overflowX==="scroll"||C.overflowX==="scroll",le=Math.max(0,o.innerWidth-r.clientWidth),M=Math.max(0,o.innerHeight-r.clientHeight),Q=parseFloat(C.marginTop)+parseFloat(C.marginBottom),se=parseFloat(C.marginLeft)+parseFloat(C.marginRight),ee=Be(n,r);if(l=Yn(e),l){n.style.scrollbarGutter=v,ee.style.overflowY="hidden",ee.style.overflowX="hidden";return}Object.assign(n.style,{scrollbarGutter:v,overflowY:"hidden",overflowX:"hidden"}),(T||q)&&(n.style.overflowY="scroll"),(j||$)&&(n.style.overflowX="scroll"),Object.assign(r.style,{position:"relative",height:Q||M?`calc(100dvh - ${Q+M}px)`:"100dvh",width:se||le?`calc(100vw - ${se+le}px)`:"100vw",boxSizing:"border-box",overflowY:"hidden",overflowX:"hidden",scrollBehavior:"unset"}),r.scrollTop=s,r.scrollLeft=i,n.setAttribute("data-base-ui-scroll-locked",""),n.style.scrollBehavior="unset"}function R(){Object.assign(n.style,vt),Object.assign(r.style,Rt),l||(n.scrollTop=s,n.scrollLeft=i,n.removeAttribute("data-base-ui-scroll-locked"),n.style.scrollBehavior=St)}function O(){R(),a.request(f)}f();const d=I(o,"resize",O);return()=>{a.cancel(),R(),typeof o.removeEventListener=="function"&&d()}}class Un{lockCount=0;restore=null;timeoutLock=De.create();timeoutUnlock=De.create();acquire(t){return this.lockCount+=1,this.lockCount===1&&this.restore===null&&this.timeoutLock.start(0,()=>this.lock(t)),this.release}release=()=>{this.lockCount-=1,this.lockCount===0&&this.restore&&this.timeoutUnlock.start(0,this.unlock)};unlock=()=>{this.lockCount===0&&this.restore&&(this.restore?.(),this.restore=null)};lock(t){if(this.lockCount===0||this.restore!==null)return;const n=X(t),r=n.documentElement,o=n.body,s=Le(r);if(Ct(s,r,o)){const l=new s.MutationObserver(()=>{Ct(s,r,o)||(l.disconnect(),this.restore=null,this.lock(t))}),a={attributes:!0};l.observe(r,a),l.observe(o,a),this.restore=()=>l.disconnect();return}const i=an||!Hn(t);this.restore=i?Gn(t):_n(t)}}const Xn=new Un;function vr(e=!0,t=null){D(()=>{if(e)return Xn.acquire(t)},[e,t])}const Vn="ArrowUp",Kn="ArrowDown",qn="ArrowLeft",$n="ArrowRight",jn="Home",zn="End",Rr=new Set([Vn,Kn,qn,$n,jn,zn]);export{nr as A,rr as B,Rr as C,Cn as D,Ue as E,Wn as F,Rn as G,Pt as H,Tr as I,Er as P,Ln as a,vn as b,ur as c,sr as d,cr as e,ir as f,vr as g,mr as h,fr as i,lr as j,br as k,gr as l,hr as m,ar as n,tr as o,er as p,tt as q,et as r,Fe as s,Zn as t,yr as u,Ae as v,dr as w,or as x,pr as y,Qn as z};
@@ -1 +1 @@
1
- import{m as c}from"./__vite-browser-external-DUAYhIIg.js";const e={name:"copy",size:24,node:[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]]};e.node;const t=c(e);export{t as C};
1
+ import{m as c}from"./__vite-browser-external-DYzNZTW8.js";const e={name:"copy",size:24,node:[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]]};e.node;const t=c(e);export{t as C};
@@ -1 +1 @@
1
- import{m as o}from"./__vite-browser-external-DUAYhIIg.js";const a={name:"download",size:24,node:[["path",{d:"M12 15V3",key:"m9g1x1"}],["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["path",{d:"m7 10 5 5 5-5",key:"brsn70"}]]};a.node;const n=o(a);export{n as D};
1
+ import{m as o}from"./__vite-browser-external-DYzNZTW8.js";const a={name:"download",size:24,node:[["path",{d:"M12 15V3",key:"m9g1x1"}],["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["path",{d:"m7 10 5 5 5-5",key:"brsn70"}]]};a.node;const n=o(a);export{n as D};
@@ -1 +1 @@
1
- import{m as e}from"./__vite-browser-external-DUAYhIIg.js";const a={name:"external-link",size:24,node:[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"M10 14 21 3",key:"gplh6r"}],["path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6",key:"a6xqqp"}]]};a.node;const n=e(a);export{n as E};
1
+ import{m as e}from"./__vite-browser-external-DYzNZTW8.js";const a={name:"external-link",size:24,node:[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"M10 14 21 3",key:"gplh6r"}],["path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6",key:"a6xqqp"}]]};a.node;const n=e(a);export{n as E};
@@ -1 +1 @@
1
- import{m as a}from"./__vite-browser-external-DUAYhIIg.js";const e={name:"flame",size:24,node:[["path",{d:"M12 3q1 4 4 6.5t3 5.5a1 1 0 0 1-14 0 5 5 0 0 1 1-3 1 1 0 0 0 5 0c0-2-1.5-3-1.5-5q0-2 2.5-4",key:"1slcih"}]]};e.node;const c=a(e);export{c as F};
1
+ import{m as a}from"./__vite-browser-external-DYzNZTW8.js";const e={name:"flame",size:24,node:[["path",{d:"M12 3q1 4 4 6.5t3 5.5a1 1 0 0 1-14 0 5 5 0 0 1 1-3 1 1 0 0 0 5 0c0-2-1.5-3-1.5-5q0-2 2.5-4",key:"1slcih"}]]};e.node;const c=a(e);export{c as F};
@@ -1 +1 @@
1
- import{l as r}from"./__vite-browser-external-DUAYhIIg.js";function n(o){const t=Number(o)||0;return t>=1e12?`${Number((t/1e12).toFixed(2)).toString()}T`:r(t)}export{n as f};
1
+ import{l as r}from"./__vite-browser-external-DYzNZTW8.js";function n(o){const t=Number(o)||0;return t>=1e12?`${Number((t/1e12).toFixed(2)).toString()}T`:r(t)}export{n as f};
@@ -1 +1 @@
1
- import{j as r}from"./__vite-browser-external-DUAYhIIg.js";function e({className:n}){return r.jsx("svg",{viewBox:"0 0 384 512",className:n,fill:"currentColor","aria-hidden":"true",children:r.jsx("path",{d:"M318.7 268.7c-.2-36.7 16.4-64.4 50-84.8-18.8-26.9-47.2-41.7-84.7-44.6-35.5-2.8-74.3 20.7-88.5 20.7-15 0-49.4-19.7-76.4-19.7C63.3 141.2 4 184.8 4 273.5q0 39.3 14.4 81.2c12.8 36.7 59 126.7 107.2 125.2 25.2-.6 43-17.9 75.8-17.9 31.8 0 48.3 17.9 76.4 17.9 48.6-.7 90.4-82.5 102.6-119.3-65.2-30.7-61.7-90-61.7-91.9zm-56.6-164.2c27.3-32.4 24.8-61.9 24-72.5-24.1 1.4-52 16.4-67.9 34.9-17.5 19.8-27.8 44.3-25.6 71.9 26.1 2 49.9-11.4 69.5-34.3z"})})}function o({className:n}){return r.jsx("svg",{viewBox:"0 0 16 16",className:n,fill:"currentColor","aria-hidden":"true",children:r.jsx("path",{d:"M8 0c4.42 0 8 3.58 8 8a8.013 8.013 0 0 1-5.45 7.59c-.4.08-.55-.17-.55-.38 0-.27.01-1.13.01-2.2 0-.75-.25-1.23-.54-1.48 1.78-.2 3.65-.88 3.65-3.95 0-.88-.31-1.59-.82-2.15.08-.2.36-1.02-.08-2.12 0 0-.67-.22-2.2.82-.64-.18-1.32-.27-2-.27-.68 0-1.36.09-2 .27-1.53-1.03-2.2-.82-2.2-.82-.44 1.1-.16 1.92-.08 2.12-.51.56-.82 1.28-.82 2.15 0 3.06 1.86 3.75 3.64 3.95-.23.2-.44.55-.51 1.07-.46.21-1.61.55-2.33-.66-.15-.24-.6-.83-1.23-.82-.67.01-.27.38.01.53.34.19.73.9.82 1.13.16.45.68 1.31 2.69.94 0 .67.01 1.3.01 1.49 0 .21-.15.45-.55.38A7.995 7.995 0 0 1 0 8c0-4.42 3.58-8 8-8Z"})})}function t({className:n}){return r.jsx("svg",{viewBox:"0 0 24 24",className:n,fill:"currentColor","aria-hidden":"true",children:r.jsx("path",{d:"M3 5.46 10.2 4.5v6.92H3V5.46Zm0 13.08 7.2.96v-6.84H3v5.88Zm8.04 1.08L21 21V12.46h-9.96v7.16ZM11.04 4.38 21 3v8.46h-9.96V4.38Z"})})}export{e as A,o as G,t as W};
1
+ import{j as r}from"./__vite-browser-external-DYzNZTW8.js";function e({className:n}){return r.jsx("svg",{viewBox:"0 0 384 512",className:n,fill:"currentColor","aria-hidden":"true",children:r.jsx("path",{d:"M318.7 268.7c-.2-36.7 16.4-64.4 50-84.8-18.8-26.9-47.2-41.7-84.7-44.6-35.5-2.8-74.3 20.7-88.5 20.7-15 0-49.4-19.7-76.4-19.7C63.3 141.2 4 184.8 4 273.5q0 39.3 14.4 81.2c12.8 36.7 59 126.7 107.2 125.2 25.2-.6 43-17.9 75.8-17.9 31.8 0 48.3 17.9 76.4 17.9 48.6-.7 90.4-82.5 102.6-119.3-65.2-30.7-61.7-90-61.7-91.9zm-56.6-164.2c27.3-32.4 24.8-61.9 24-72.5-24.1 1.4-52 16.4-67.9 34.9-17.5 19.8-27.8 44.3-25.6 71.9 26.1 2 49.9-11.4 69.5-34.3z"})})}function o({className:n}){return r.jsx("svg",{viewBox:"0 0 16 16",className:n,fill:"currentColor","aria-hidden":"true",children:r.jsx("path",{d:"M8 0c4.42 0 8 3.58 8 8a8.013 8.013 0 0 1-5.45 7.59c-.4.08-.55-.17-.55-.38 0-.27.01-1.13.01-2.2 0-.75-.25-1.23-.54-1.48 1.78-.2 3.65-.88 3.65-3.95 0-.88-.31-1.59-.82-2.15.08-.2.36-1.02-.08-2.12 0 0-.67-.22-2.2.82-.64-.18-1.32-.27-2-.27-.68 0-1.36.09-2 .27-1.53-1.03-2.2-.82-2.2-.82-.44 1.1-.16 1.92-.08 2.12-.51.56-.82 1.28-.82 2.15 0 3.06 1.86 3.75 3.64 3.95-.23.2-.44.55-.51 1.07-.46.21-1.61.55-2.33-.66-.15-.24-.6-.83-1.23-.82-.67.01-.27.38.01.53.34.19.73.9.82 1.13.16.45.68 1.31 2.69.94 0 .67.01 1.3.01 1.49 0 .21-.15.45-.55.38A7.995 7.995 0 0 1 0 8c0-4.42 3.58-8 8-8Z"})})}function t({className:n}){return r.jsx("svg",{viewBox:"0 0 24 24",className:n,fill:"currentColor","aria-hidden":"true",children:r.jsx("path",{d:"M3 5.46 10.2 4.5v6.92H3V5.46Zm0 13.08 7.2.96v-6.84H3v5.88Zm8.04 1.08L21 21V12.46h-9.96v7.16ZM11.04 4.38 21 3v8.46h-9.96V4.38Z"})})}export{e as A,o as G,t as W};
@@ -1 +1 @@
1
- import{r as c}from"./__vite-browser-external-DUAYhIIg.js";var u={},p=()=>{window.si||(window.si=function(...i){window.siq=window.siq||[],window.siq.push(i)})},h="@vercel/speed-insights",g="2.0.0";function w(){return typeof window<"u"}function S(){try{const e="production"}catch{}return"production"}function l(){return S()==="development"}function k(e,i){if(!e||!i)return e;let n=e;try{const t=Object.entries(i);for(const[r,o]of t)if(!Array.isArray(o)){const s=d(o);s.test(n)&&(n=n.replace(s,`/[${r}]`))}for(const[r,o]of t)if(Array.isArray(o)){const s=d(o.join("/"));s.test(n)&&(n=n.replace(s,`/[...${r}]`))}return n}catch{return e}}function d(e){return new RegExp(`/${b(e)}(?=[/?#]|$)`)}function b(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function m(e){return e.scriptSrc?f(e.scriptSrc):l()?"https://va.vercel-scripts.com/v1/speed-insights/script.debug.js":e.dsn?"https://va.vercel-scripts.com/v1/speed-insights/script.js":e.basePath?f(`${e.basePath}/speed-insights/script.js`):"/_vercel/speed-insights/script.js"}function E(e,i){var n;let t=e;if(i)try{t={...(n=JSON.parse(i))==null?void 0:n.speedInsights,...e}}catch{}const r={sdkn:h+(t.framework?`/${t.framework}`:""),sdkv:g};return t.sampleRate&&(r.sampleRate=t.sampleRate.toString()),t.route&&(r.route=t.route),l()&&t.debug===!1&&(r.debug="false"),t.dsn&&(r.dsn=t.dsn),t.endpoint?r.endpoint=f(t.endpoint):t.basePath&&(r.endpoint=f(`${t.basePath}/speed-insights/vitals`)),{src:m(t),beforeSend:t.beforeSend,dataset:r}}function f(e){return e.startsWith("http://")||e.startsWith("https://")||e.startsWith("/")?e:`/${e}`}function y(e={},i){var n;if(!w()||e.route===null)return null;p();const{beforeSend:t,src:r,dataset:o}=E(e,i);if(document.head.querySelector(`script[src*="${r}"]`))return null;t&&((n=window.si)==null||n.call(window,"beforeSend",t));const s=document.createElement("script");s.src=r,s.defer=!0;for(const[a,v]of Object.entries(o))s.dataset[a]=v;return s.onerror=()=>{console.log(`[Vercel Speed Insights] Failed to load script from ${r}. Please check if any content blockers are enabled and try again.`)},document.head.appendChild(s),{setRoute:a=>{s.dataset.route=a??void 0}}}function R(){if(!(typeof process>"u"||typeof u>"u"))return u.REACT_APP_VERCEL_OBSERVABILITY_BASEPATH}function _(){if(!(typeof process>"u"||typeof u>"u"))return u.REACT_APP_VERCEL_OBSERVABILITY_CLIENT_CONFIG}function P(e){c.useEffect(()=>{var n;e.beforeSend&&((n=window.si)==null||n.call(window,"beforeSend",e.beforeSend))},[e.beforeSend]);const i=c.useRef(null);return c.useEffect(()=>{if(!i.current){const n=y({framework:e.framework??"react",basePath:e.basePath??R(),...e},e.configString??_());n&&(i.current=n.setRoute)}},[e]),c.useEffect(()=>{i.current&&e.route&&i.current(e.route)},[e.route]),null}export{P as SpeedInsights,k as computeRoute};
1
+ import{r as c}from"./__vite-browser-external-DYzNZTW8.js";var u={},p=()=>{window.si||(window.si=function(...i){window.siq=window.siq||[],window.siq.push(i)})},h="@vercel/speed-insights",g="2.0.0";function w(){return typeof window<"u"}function S(){try{const e="production"}catch{}return"production"}function l(){return S()==="development"}function k(e,i){if(!e||!i)return e;let n=e;try{const t=Object.entries(i);for(const[r,o]of t)if(!Array.isArray(o)){const s=d(o);s.test(n)&&(n=n.replace(s,`/[${r}]`))}for(const[r,o]of t)if(Array.isArray(o)){const s=d(o.join("/"));s.test(n)&&(n=n.replace(s,`/[...${r}]`))}return n}catch{return e}}function d(e){return new RegExp(`/${b(e)}(?=[/?#]|$)`)}function b(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function m(e){return e.scriptSrc?f(e.scriptSrc):l()?"https://va.vercel-scripts.com/v1/speed-insights/script.debug.js":e.dsn?"https://va.vercel-scripts.com/v1/speed-insights/script.js":e.basePath?f(`${e.basePath}/speed-insights/script.js`):"/_vercel/speed-insights/script.js"}function E(e,i){var n;let t=e;if(i)try{t={...(n=JSON.parse(i))==null?void 0:n.speedInsights,...e}}catch{}const r={sdkn:h+(t.framework?`/${t.framework}`:""),sdkv:g};return t.sampleRate&&(r.sampleRate=t.sampleRate.toString()),t.route&&(r.route=t.route),l()&&t.debug===!1&&(r.debug="false"),t.dsn&&(r.dsn=t.dsn),t.endpoint?r.endpoint=f(t.endpoint):t.basePath&&(r.endpoint=f(`${t.basePath}/speed-insights/vitals`)),{src:m(t),beforeSend:t.beforeSend,dataset:r}}function f(e){return e.startsWith("http://")||e.startsWith("https://")||e.startsWith("/")?e:`/${e}`}function y(e={},i){var n;if(!w()||e.route===null)return null;p();const{beforeSend:t,src:r,dataset:o}=E(e,i);if(document.head.querySelector(`script[src*="${r}"]`))return null;t&&((n=window.si)==null||n.call(window,"beforeSend",t));const s=document.createElement("script");s.src=r,s.defer=!0;for(const[a,v]of Object.entries(o))s.dataset[a]=v;return s.onerror=()=>{console.log(`[Vercel Speed Insights] Failed to load script from ${r}. Please check if any content blockers are enabled and try again.`)},document.head.appendChild(s),{setRoute:a=>{s.dataset.route=a??void 0}}}function R(){if(!(typeof process>"u"||typeof u>"u"))return u.REACT_APP_VERCEL_OBSERVABILITY_BASEPATH}function _(){if(!(typeof process>"u"||typeof u>"u"))return u.REACT_APP_VERCEL_OBSERVABILITY_CLIENT_CONFIG}function P(e){c.useEffect(()=>{var n;e.beforeSend&&((n=window.si)==null||n.call(window,"beforeSend",e.beforeSend))},[e.beforeSend]);const i=c.useRef(null);return c.useEffect(()=>{if(!i.current){const n=y({framework:e.framework??"react",basePath:e.basePath??R(),...e},e.configString??_());n&&(i.current=n.setRoute)}},[e]),c.useEffect(()=>{i.current&&e.route&&i.current(e.route)},[e.route]),null}export{P as SpeedInsights,k as computeRoute};
@@ -1,4 +1,4 @@
1
- import{r as n,j as $}from"./__vite-browser-external-DUAYhIIg.js";import{M as D,a as S,u as A,b as F,P as K,c as U,L as W}from"./react-CjlEHr8p.js";function I(e,r){if(typeof e=="function")return e(r);e!=null&&(e.current=r)}function B(...e){return r=>{let t=!1;const o=e.map(l=>{const i=I(l,r);return!t&&typeof i=="function"&&(t=!0),i});if(t)return()=>{for(let l=0;l<o.length;l++){const i=o[l];typeof i=="function"?i():I(e[l],null)}}}}function G(...e){return n.useCallback(B(...e),e)}class V extends n.Component{getSnapshotBeforeUpdate(r){const t=this.props.childRef.current;if(S(t)&&r.isPresent&&!this.props.isPresent&&this.props.pop!==!1){const o=t.offsetParent,l=S(o)&&o.offsetWidth||0,i=S(o)&&o.offsetHeight||0,d=getComputedStyle(t),s=this.props.sizeRef.current;s.height=parseFloat(d.height),s.width=parseFloat(d.width),s.top=t.offsetTop,s.left=t.offsetLeft,s.right=l-s.width-s.left,s.bottom=i-s.height-s.top,s.direction=d.direction}return null}componentDidUpdate(){}render(){return this.props.children}}function X({children:e,isPresent:r,anchorX:t,anchorY:o,root:l,pop:i}){const d=n.useId(),s=n.useRef(null),y=n.useRef({width:0,height:0,top:0,left:0,right:0,bottom:0,direction:"ltr"}),{nonce:E}=n.useContext(D),a=i!==!1?e.props?.ref??e?.ref:void 0,M=G(s,a);return n.useInsertionEffect(()=>{const{width:u,height:p,top:x,left:C,right:f,bottom:R,direction:L}=y.current;if(r||i===!1||!s.current||!u||!p)return;const b=L==="rtl",g=t==="left"?b?`right: ${f}`:`left: ${C}`:b?`left: ${C}`:`right: ${f}`,j=o==="bottom"?`bottom: ${R}`:`top: ${x}`;s.current.dataset.motionPopId=d;const h=document.createElement("style");E&&(h.nonce=E);const P=l??document.head;return P.appendChild(h),h.sheet&&h.sheet.insertRule(`
1
+ import{r as n,j as $}from"./__vite-browser-external-DYzNZTW8.js";import{M as D,a as S,u as A,b as F,P as K,c as U,L as W}from"./react-CXLTMo1j.js";function I(e,r){if(typeof e=="function")return e(r);e!=null&&(e.current=r)}function B(...e){return r=>{let t=!1;const o=e.map(l=>{const i=I(l,r);return!t&&typeof i=="function"&&(t=!0),i});if(t)return()=>{for(let l=0;l<o.length;l++){const i=o[l];typeof i=="function"?i():I(e[l],null)}}}}function G(...e){return n.useCallback(B(...e),e)}class V extends n.Component{getSnapshotBeforeUpdate(r){const t=this.props.childRef.current;if(S(t)&&r.isPresent&&!this.props.isPresent&&this.props.pop!==!1){const o=t.offsetParent,l=S(o)&&o.offsetWidth||0,i=S(o)&&o.offsetHeight||0,d=getComputedStyle(t),s=this.props.sizeRef.current;s.height=parseFloat(d.height),s.width=parseFloat(d.width),s.top=t.offsetTop,s.left=t.offsetLeft,s.right=l-s.width-s.left,s.bottom=i-s.height-s.top,s.direction=d.direction}return null}componentDidUpdate(){}render(){return this.props.children}}function X({children:e,isPresent:r,anchorX:t,anchorY:o,root:l,pop:i}){const d=n.useId(),s=n.useRef(null),y=n.useRef({width:0,height:0,top:0,left:0,right:0,bottom:0,direction:"ltr"}),{nonce:E}=n.useContext(D),a=i!==!1?e.props?.ref??e?.ref:void 0,M=G(s,a);return n.useInsertionEffect(()=>{const{width:u,height:p,top:x,left:C,right:f,bottom:R,direction:L}=y.current;if(r||i===!1||!s.current||!u||!p)return;const b=L==="rtl",g=t==="left"?b?`right: ${f}`:`left: ${C}`:b?`left: ${C}`:`right: ${f}`,j=o==="bottom"?`bottom: ${R}`:`top: ${x}`;s.current.dataset.motionPopId=d;const h=document.createElement("style");E&&(h.nonce=E);const P=l??document.head;return P.appendChild(h),h.sheet&&h.sheet.insertRule(`
2
2
  [data-motion-pop-id="${d}"] {
3
3
  position: absolute !important;
4
4
  width: ${u}px !important;
@@ -1 +1 @@
1
- import{r as u}from"./__vite-browser-external-DUAYhIIg.js";var c={},p=()=>{window.va||(window.va=function(...r){window.vaq||(window.vaq=[]),window.vaq.push(r)})},m="@vercel/analytics",E="2.0.1";function l(){return typeof window<"u"}function w(){try{const e="production"}catch{}return"production"}function y(e="auto"){if(e==="auto"){window.vam=w();return}window.vam=e}function h(){return(l()?window.vam:w())||"production"}function v(){return h()==="production"}function d(){return h()==="development"}function g(e,{[e]:r,...i}){return i}function _(e,r){if(!e)return;let i=e;const n=[];for(const[t,o]of Object.entries(e))typeof o=="object"&&o!==null&&(r.strip?i=g(t,i):n.push(t));if(n.length>0&&!r.strip)throw Error(`The following properties are not valid: ${n.join(", ")}. Only strings, numbers, booleans, and null are allowed.`);return i}function S(e){return e.scriptSrc?a(e.scriptSrc):d()?"https://va.vercel-scripts.com/v1/script.debug.js":e.basePath?a(`${e.basePath}/insights/script.js`):"/_vercel/insights/script.js"}function k(e,r){var i;let n=e;if(r)try{n={...(i=JSON.parse(r))==null?void 0:i.analytics,...e}}catch{}y(n.mode);const t={sdkn:m+(n.framework?`/${n.framework}`:""),sdkv:E};return n.disableAutoTrack&&(t.disableAutoTrack="1"),n.viewEndpoint&&(t.viewEndpoint=a(n.viewEndpoint)),n.eventEndpoint&&(t.eventEndpoint=a(n.eventEndpoint)),n.sessionEndpoint&&(t.sessionEndpoint=a(n.sessionEndpoint)),d()&&n.debug===!1&&(t.debug="false"),n.dsn&&(t.dsn=n.dsn),n.endpoint?t.endpoint=n.endpoint:n.basePath&&(t.endpoint=a(`${n.basePath}/insights`)),{beforeSend:n.beforeSend,src:S(n),dataset:t}}function a(e){return e.startsWith("http://")||e.startsWith("https://")||e.startsWith("/")?e:`/${e}`}function P(e={debug:!0},r){var i;if(!l())return;const{beforeSend:n,src:t,dataset:o}=k(e,r);if(p(),n&&((i=window.va)==null||i.call(window,"beforeSend",n)),document.head.querySelector(`script[src*="${t}"]`))return;const s=document.createElement("script");s.src=t;for(const[f,b]of Object.entries(o))s.dataset[f]=b;s.defer=!0,s.onerror=()=>{const f=d()?"Please check if any ad blockers are enabled and try again.":"Be sure to enable Web Analytics for your project and deploy again. See https://vercel.com/docs/analytics/quickstart for more information.";console.log(`[Vercel Web Analytics] Failed to load script from ${t}. ${f}`)},document.head.appendChild(s)}function C(e,r,i){var n,t;if(!l()){const o="[Vercel Web Analytics] Please import `track` from `@vercel/analytics/server` when using this function in a server environment";if(v())console.warn(o);else throw new Error(o);return}if(!r){(n=window.va)==null||n.call(window,"event",{name:e,options:i});return}try{const o=_(r,{strip:v()});(t=window.va)==null||t.call(window,"event",{name:e,data:o,options:i})}catch(o){o instanceof Error&&d()&&console.error(o)}}function A({route:e,path:r}){var i;(i=window.va)==null||i.call(window,"pageview",{route:e,path:r})}function T(){if(!(typeof process>"u"||typeof c>"u"))return c.REACT_APP_VERCEL_OBSERVABILITY_BASEPATH}function j(){if(!(typeof process>"u"||typeof c>"u"))return c.REACT_APP_VERCEL_OBSERVABILITY_CLIENT_CONFIG}function $(e){return u.useEffect(()=>{var r;e.beforeSend&&((r=window.va)==null||r.call(window,"beforeSend",e.beforeSend))},[e.beforeSend]),u.useEffect(()=>{P({framework:e.framework||"react",basePath:e.basePath??T(),...e.route!==void 0&&{disableAutoTrack:!0},...e},e.configString??j())},[]),u.useEffect(()=>{e.route&&e.path&&A({route:e.route,path:e.path})},[e.route,e.path]),null}export{$ as Analytics,C as track};
1
+ import{r as u}from"./__vite-browser-external-DYzNZTW8.js";var c={},p=()=>{window.va||(window.va=function(...r){window.vaq||(window.vaq=[]),window.vaq.push(r)})},m="@vercel/analytics",E="2.0.1";function l(){return typeof window<"u"}function w(){try{const e="production"}catch{}return"production"}function y(e="auto"){if(e==="auto"){window.vam=w();return}window.vam=e}function h(){return(l()?window.vam:w())||"production"}function v(){return h()==="production"}function d(){return h()==="development"}function g(e,{[e]:r,...i}){return i}function _(e,r){if(!e)return;let i=e;const n=[];for(const[t,o]of Object.entries(e))typeof o=="object"&&o!==null&&(r.strip?i=g(t,i):n.push(t));if(n.length>0&&!r.strip)throw Error(`The following properties are not valid: ${n.join(", ")}. Only strings, numbers, booleans, and null are allowed.`);return i}function S(e){return e.scriptSrc?a(e.scriptSrc):d()?"https://va.vercel-scripts.com/v1/script.debug.js":e.basePath?a(`${e.basePath}/insights/script.js`):"/_vercel/insights/script.js"}function k(e,r){var i;let n=e;if(r)try{n={...(i=JSON.parse(r))==null?void 0:i.analytics,...e}}catch{}y(n.mode);const t={sdkn:m+(n.framework?`/${n.framework}`:""),sdkv:E};return n.disableAutoTrack&&(t.disableAutoTrack="1"),n.viewEndpoint&&(t.viewEndpoint=a(n.viewEndpoint)),n.eventEndpoint&&(t.eventEndpoint=a(n.eventEndpoint)),n.sessionEndpoint&&(t.sessionEndpoint=a(n.sessionEndpoint)),d()&&n.debug===!1&&(t.debug="false"),n.dsn&&(t.dsn=n.dsn),n.endpoint?t.endpoint=n.endpoint:n.basePath&&(t.endpoint=a(`${n.basePath}/insights`)),{beforeSend:n.beforeSend,src:S(n),dataset:t}}function a(e){return e.startsWith("http://")||e.startsWith("https://")||e.startsWith("/")?e:`/${e}`}function P(e={debug:!0},r){var i;if(!l())return;const{beforeSend:n,src:t,dataset:o}=k(e,r);if(p(),n&&((i=window.va)==null||i.call(window,"beforeSend",n)),document.head.querySelector(`script[src*="${t}"]`))return;const s=document.createElement("script");s.src=t;for(const[f,b]of Object.entries(o))s.dataset[f]=b;s.defer=!0,s.onerror=()=>{const f=d()?"Please check if any ad blockers are enabled and try again.":"Be sure to enable Web Analytics for your project and deploy again. See https://vercel.com/docs/analytics/quickstart for more information.";console.log(`[Vercel Web Analytics] Failed to load script from ${t}. ${f}`)},document.head.appendChild(s)}function C(e,r,i){var n,t;if(!l()){const o="[Vercel Web Analytics] Please import `track` from `@vercel/analytics/server` when using this function in a server environment";if(v())console.warn(o);else throw new Error(o);return}if(!r){(n=window.va)==null||n.call(window,"event",{name:e,options:i});return}try{const o=_(r,{strip:v()});(t=window.va)==null||t.call(window,"event",{name:e,data:o,options:i})}catch(o){o instanceof Error&&d()&&console.error(o)}}function A({route:e,path:r}){var i;(i=window.va)==null||i.call(window,"pageview",{route:e,path:r})}function T(){if(!(typeof process>"u"||typeof c>"u"))return c.REACT_APP_VERCEL_OBSERVABILITY_BASEPATH}function j(){if(!(typeof process>"u"||typeof c>"u"))return c.REACT_APP_VERCEL_OBSERVABILITY_CLIENT_CONFIG}function $(e){return u.useEffect(()=>{var r;e.beforeSend&&((r=window.va)==null||r.call(window,"beforeSend",e.beforeSend))},[e.beforeSend]),u.useEffect(()=>{P({framework:e.framework||"react",basePath:e.basePath??T(),...e.route!==void 0&&{disableAutoTrack:!0},...e},e.configString??j())},[]),u.useEffect(()=>{e.route&&e.path&&A({route:e.route,path:e.path})},[e.route,e.path]),null}export{$ as Analytics,C as track};
@@ -1 +1 @@
1
- import{m as o}from"./__vite-browser-external-DUAYhIIg.js";const e={name:"info",size:24,node:[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]]};e.node;const a=o(e);export{a as I};
1
+ import{m as o}from"./__vite-browser-external-DYzNZTW8.js";const e={name:"info",size:24,node:[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]]};e.node;const a=o(e);export{a as I};
@@ -1 +1 @@
1
- import{m as n}from"./__vite-browser-external-DUAYhIIg.js";const e={name:"link-2",size:24,node:[["path",{d:"M9 17H7A5 5 0 0 1 7 7h2",key:"8i5ue5"}],["path",{d:"M15 7h2a5 5 0 1 1 0 10h-2",key:"1b9ql8"}],["line",{x1:"8",x2:"16",y1:"12",y2:"12",key:"1jonct"}]]};e.node;const a=n(e);export{a as L};
1
+ import{m as n}from"./__vite-browser-external-DYzNZTW8.js";const e={name:"link-2",size:24,node:[["path",{d:"M9 17H7A5 5 0 0 1 7 7h2",key:"8i5ue5"}],["path",{d:"M15 7h2a5 5 0 1 1 0 10h-2",key:"1b9ql8"}],["line",{x1:"8",x2:"16",y1:"12",y2:"12",key:"1jonct"}]]};e.node;const a=n(e);export{a as L};
@@ -1 +1 @@
1
- import{m as a}from"./__vite-browser-external-DUAYhIIg.js";const e={name:"loader-circle",size:24,node:[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]],aliases:["loader-2"]};e.node;const c=a(e);export{c as L};
1
+ import{m as a}from"./__vite-browser-external-DYzNZTW8.js";const e={name:"loader-circle",size:24,node:[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]],aliases:["loader-2"]};e.node;const c=a(e);export{c as L};
@@ -1 +1 @@
1
- import{m as e}from"./__vite-browser-external-DUAYhIIg.js";const a={name:"maximize-2",size:24,node:[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"m21 3-7 7",key:"1l2asr"}],["path",{d:"m3 21 7-7",key:"tjx5ai"}],["path",{d:"M9 21H3v-6",key:"wtvkvv"}]]};a.node;const i=e(a);export{i as M};
1
+ import{m as e}from"./__vite-browser-external-DYzNZTW8.js";const a={name:"maximize-2",size:24,node:[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"m21 3-7 7",key:"1l2asr"}],["path",{d:"m3 21 7-7",key:"tjx5ai"}],["path",{d:"M9 21H3v-6",key:"wtvkvv"}]]};a.node;const i=e(a);export{i as M};
@@ -1 +1 @@
1
- import"./__vite-browser-external-DUAYhIIg.js";const s=r=>{let{transform:t}=r;return{...t,y:0}},e=r=>{let{transform:t}=r;return{...t,x:0}};export{e as a,s as r};
1
+ import"./__vite-browser-external-DYzNZTW8.js";const s=r=>{let{transform:t}=r;return{...t,y:0}},e=r=>{let{transform:t}=r;return{...t,x:0}};export{e as a,s as r};
@@ -1 +1 @@
1
- import{m as o}from"./__vite-browser-external-DUAYhIIg.js";const e={name:"monitor-smartphone",size:24,node:[["path",{d:"M18 8V6a2 2 0 0 0-2-2H4a2 2 0 0 0-2 2v7a2 2 0 0 0 2 2h8",key:"10dyio"}],["path",{d:"M10 19v-3.96 3.15",key:"1irgej"}],["path",{d:"M7 19h5",key:"qswx4l"}],["rect",{width:"6",height:"10",x:"16",y:"12",rx:"2",key:"1egngj"}]]};e.node;const a=o(e);export{a as M};
1
+ import{m as o}from"./__vite-browser-external-DYzNZTW8.js";const e={name:"monitor-smartphone",size:24,node:[["path",{d:"M18 8V6a2 2 0 0 0-2-2H4a2 2 0 0 0-2 2v7a2 2 0 0 0 2 2h8",key:"10dyio"}],["path",{d:"M10 19v-3.96 3.15",key:"1irgej"}],["path",{d:"M7 19h5",key:"qswx4l"}],["rect",{width:"6",height:"10",x:"16",y:"12",rx:"2",key:"1egngj"}]]};e.node;const a=o(e);export{a as M};
@@ -1 +1 @@
1
- import{m as a}from"./__vite-browser-external-DUAYhIIg.js";const e={name:"plus",size:24,node:[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]};e.node;const s=a(e);export{s as P};
1
+ import{m as a}from"./__vite-browser-external-DYzNZTW8.js";const e={name:"plus",size:24,node:[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]};e.node;const s=a(e);export{s as P};
@@ -1,4 +1,4 @@
1
- import{m as Ne,r as l,j as e,c as o,$ as qe,a9 as Ke,a3 as Ve,X as Ze,a2 as Je,n as Qe}from"./__vite-browser-external-DUAYhIIg.js";import{u as et}from"./useCurrency-C7QiSZUH.js";import{u as Ee}from"./useTokenFormat-Kv5h6RPd.js";import{M as tt}from"./maximize-2-B3xxE3HC.js";import{T as at}from"./terminal-BXW29s08.js";import{I as rt}from"./info-BtYRYa79.js";const Re={name:"pause",size:24,node:[["rect",{x:"14",y:"3",width:"5",height:"18",rx:"1",key:"kaeet6"}],["rect",{x:"5",y:"3",width:"5",height:"18",rx:"1",key:"1wsw3u"}]]};Re.node;const ot=Ne(Re);const Pe={name:"play",size:24,node:[["path",{d:"M5 5a2 2 0 0 1 3.008-1.728l11.997 6.998a2 2 0 0 1 .003 3.458l-12 7A2 2 0 0 1 5 19z",key:"10ikf1"}]]};Pe.node;const nt=Ne(Pe);const Le={name:"rotate-ccw",size:24,node:[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}]]};Le.node;const st=Ne(Le),ae={emerald:{light:["#ebedf0","#a7f3d0","#6ee7b7","#34d399","#10b981"],dark:["#2d333b","#065f46","#059669","#10b981","#34d399"],gridColor:{light:"rgba(16, 185, 129, 0.12)",dark:"rgba(52, 211, 153, 0.08)"}},ocean:{light:["#f1f5f9","#93c5fd","#60a5fa","#3b82f6","#1d4ed8"],dark:["#1e293b","#1e3a8a","#2563eb","#3b82f6","#60a5fa"],gridColor:{light:"rgba(59, 130, 246, 0.12)",dark:"rgba(96, 165, 250, 0.08)"}},neon:{light:["#faf5ff","#ebd5ff","#c084fc","#a855f7","#7e22ce"],dark:["#2e1065","#581c87","#8b5cf6","#a855f7","#c084fc"],gridColor:{light:"rgba(168, 85, 247, 0.12)",dark:"rgba(192, 132, 252, 0.08)"}},amber:{light:["#fffbeb","#fde68a","#f59e0b","#d97706","#b45309"],dark:["#451a03","#78350f","#b45309","#d97706","#f59e0b"],gridColor:{light:"rgba(245, 158, 11, 0.12)",dark:"rgba(245, 158, 11, 0.08)"}}};function it(s,d){const p=/^#([0-9a-f]{6})$/i.exec(s);if(!p)return s;const c=parseInt(p[1],16),f=c>>16&255,$=c>>8&255,Y=c&255,P=A=>Math.max(0,Math.min(255,Math.round(A*d)));return`rgb(${P(f)}, ${P($)}, ${P(Y)})`}function q(s,d,p,c,f){const $=Math.cos(c),Y=Math.sin(c),P=s*$-d*Y,A=s*Y+d*$,R=p,E=Math.cos(f),S=Math.sin(f),K=P,h=A*E-R*S,v=A*S+R*E;return{x:K,y:h,z:v}}function lt(s,d,p,c,f){return q(s,d,p,c,f)}function De(s,d,p=c=>Number(c).toLocaleString()){const c=p(d);if(s>=4){const f=Math.floor(Math.random()*3)+1;return o(`heatmap.3d.voxel.joke.${f}`,{value:c})}else return s===3?o("heatmap.3d.voxel.level3",{value:c}):s===2?o("heatmap.3d.voxel.level2",{value:c}):s===1?o("heatmap.3d.voxel.level1",{value:c}):o("heatmap.3d.voxel.level0")}function Ae({weeks:s,palette:d="auto",isDark:p=!1,interactive:c=!1,autoRotateInit:f=!1,onResetViewRef:$=null}){const{formatTokens:Y,formatTokensTooltip:P}=Ee(),A=ae[d]||(d==="auto"?ae.emerald:null),R=A?p?A.dark:A.light:Array.isArray(d)?d:p?ae.emerald.dark:ae.emerald.light,E=A?p?A.gridColor.dark:A.gridColor.light:p?"rgba(255,255,255,0.06)":"rgba(0,0,0,0.06)",S=-.2,K=.88,[h,v]=l.useState({yaw:S,pitch:K}),[ie,V]=l.useState(f),[he,L]=l.useState(1),j=c?13:10.5,fe=l.useMemo(()=>{const t=[],r=s.length;if(r===0||!c)return[];for(let n=0;n<=7;n++){const i=(n-3.5)*j,m=q(-r/2*j,i,0,h.yaw,h.pitch),x=q(r/2*j,i,0,h.yaw,h.pitch);t.push({d:`M${m.x},${m.y} L${x.x},${x.y}`,key:`horiz-${n}`})}for(let n=0;n<=r;n+=4){const i=(n-r/2)*j,m=q(i,-3.5*j,0,h.yaw,h.pitch),x=q(i,3.5*j,0,h.yaw,h.pitch);t.push({d:`M${m.x},${m.y} L${x.x},${x.y}`,key:`vert-${n}`})}if(r%4!==0){const n=(r-r/2)*j,i=q(n,-3.5*j,0,h.yaw,h.pitch),m=q(n,3.5*j,0,h.yaw,h.pitch);t.push({d:`M${i.x},${i.y} L${m.x},${m.y}`,key:"vert-last"})}return t},[s.length,h,j,c]);l.useEffect(()=>{$&&($.current={reset:()=>{v({yaw:S,pitch:K}),V(!1),L(1),be()},toggleAutoRotate:t=>{V(t)}})},[$]);const Z=l.useRef(null),F=l.useRef(null),B=l.useRef(!1),le=l.useRef({x:0,y:0}),J=l.useRef({yaw:S,pitch:K}),U=l.useRef({x:0,y:0}),oe=l.useRef({x:0,y:0,time:0}),ne=l.useRef(null),[ge,ye]=l.useState(0),Q=l.useRef(null),se=l.useRef(!0);l.useEffect(()=>(se.current=!0,()=>{se.current=!1}),[]);const be=()=>{Q.current&&cancelAnimationFrame(Q.current),ye(0);const t=performance.now(),r=1200,n=i=>{if(!se.current)return;const m=i-t,x=Math.min(1,m/r),C=1-Math.pow(1-x,3);ye(C),x<1?Q.current=requestAnimationFrame(n):Q.current=null};Q.current=requestAnimationFrame(n)};l.useEffect(()=>(be(),()=>{Q.current&&cancelAnimationFrame(Q.current)}),[c]),l.useEffect(()=>{if(!ie||B.current||typeof window>"u"||typeof window.matchMedia=="function"&&window.matchMedia("(prefers-reduced-motion: reduce)").matches)return;let r;const n=()=>{if(typeof document<"u"&&document.visibilityState==="hidden"){r=requestAnimationFrame(n);return}v(i=>({yaw:i.yaw+.002,pitch:i.pitch})),r=requestAnimationFrame(n)};return r=requestAnimationFrame(n),()=>cancelAnimationFrame(r)},[ie]);const ce=(t,r)=>{c&&(B.current=!0,le.current={x:t,y:r},J.current={yaw:h.yaw,pitch:h.pitch},U.current={x:0,y:0},oe.current={x:t,y:r,time:performance.now()},ne.current&&cancelAnimationFrame(ne.current))},I=(t,r)=>{if(!B.current)return;const n=t-le.current.x,i=r-le.current.y,m=performance.now(),x=m-oe.current.time;x>0&&(U.current={x:(t-oe.current.x)/x,y:(r-oe.current.y)/x}),oe.current={x:t,y:r,time:m};const C=.005,M=J.current.yaw-n*C,k=Math.PI/2.3,b=Math.max(-k,Math.min(k,J.current.pitch-i*C));v({yaw:M,pitch:b})},ve=()=>{if(!B.current)return;B.current=!1;let t=-U.current.x*12,r=-U.current.y*12;const n=.95,i=()=>{B.current||(t*=n,r*=n,!(Math.abs(t)<.01&&Math.abs(r)<.01)&&(v(m=>{const x=m.yaw+t*.005,C=Math.PI/2.3,M=Math.max(-C,Math.min(C,m.pitch+r*.005));return{yaw:x,pitch:M}}),ne.current=requestAnimationFrame(i)))};ne.current=requestAnimationFrame(i)},[g,de]=l.useState(null),[ee,xe]=l.useState({x:0,y:0,shiftX:0}),y=l.useRef(null);l.useEffect(()=>()=>{y.current&&clearTimeout(y.current)},[]),l.useEffect(()=>{if(!c||!F.current)return;const t=n=>{n.preventDefault();const i=-n.deltaY*.0025;L(m=>{const x=m+i;return Math.max(.5,Math.min(3,x))})},r=F.current;return r.addEventListener("wheel",t,{passive:!1}),()=>{r.removeEventListener("wheel",t)}},[c]);const T=l.useMemo(()=>{const t=[];return s.forEach((r,n)=>{(Array.isArray(r)?r:[]).forEach((i,m)=>{i&&t.push({key:i.day||`${n}-${m}`,col:n,row:m,level:i.level||0,value:i.value||0,day:i.day,models:i.models||null})})}),t},[s]),pe=j-(c?1.8:1.5),ke=c?38:28,we=t=>Math.max(1.8,Number(t)/4*ke),te=l.useMemo(()=>{if(T.length===0)return[];const t=s.length;return T.map(r=>{const n=we(r.level),i=Math.sqrt(Math.pow(r.col-t/2,2)+Math.pow(r.row-3.5,2)),m=Math.sqrt(Math.pow(t/2,2)+Math.pow(3.5,2)),x=i/m*.4,C=Math.min(1,Math.max(0,(ge-x)*(1/.6))),M=n*C,k=(r.col-t/2)*j,b=(r.row-3.5)*j,w=pe/2,H=[{x:k-w,y:b-w,z:0},{x:k+w,y:b-w,z:0},{x:k+w,y:b+w,z:0},{x:k-w,y:b+w,z:0},{x:k-w,y:b-w,z:M},{x:k+w,y:b-w,z:M},{x:k+w,y:b+w,z:M},{x:k-w,y:b+w,z:M}].map(X=>q(X.x,X.y,X.z,h.yaw,h.pitch)),ue=q(k,b,M/2,h.yaw,h.pitch),Ue=[{name:"top",indices:[4,5,6,7],scale:1,normal:[0,0,1]},{name:"bottom",indices:[3,2,1,0],scale:.4,normal:[0,0,-1]},{name:"left",indices:[3,0,4,7],scale:.55,normal:[-1,0,0]},{name:"right",indices:[1,2,6,5],scale:.75,normal:[1,0,0]},{name:"front",indices:[0,1,5,4],scale:.85,normal:[0,-1,0]},{name:"back",indices:[2,3,7,6],scale:.65,normal:[0,1,0]}],Ie=R[Math.min(4,Math.max(0,Number(r.level)||0))],ze=[],We=.35,Xe=-.4,Be=.83;return Ue.forEach(X=>{const je=lt(X.normal[0],X.normal[1],X.normal[2],h.yaw,h.pitch);if(je.z>.001){const _e=H[X.indices[0]],Me=H[X.indices[1]],Te=H[X.indices[2]],$e=H[X.indices[3]],Fe=`M${_e.x},${_e.y} L${Me.x},${Me.y} L${Te.x},${Te.y} L${$e.x},${$e.y} Z`,Oe=je.x*We+je.y*Xe+je.z*Be,He=p?.18:0,Ge=X.scale*(.82+.28*Math.max(0,Oe))+He;ze.push({name:X.name,d:Fe,fill:it(Ie,Ge)})}}),{...r,centerProj:ue,renderedFaces:ze}})},[T,h,R,s.length,ge,j,pe,ke]),G=l.useMemo(()=>[...te].sort((t,r)=>t.centerProj.z-r.centerProj.z),[te]),_=l.useMemo(()=>{if(G.length===0)return{minX:-100,minY:-100,maxX:100,maxY:100};let t=1/0,r=1/0,n=-1/0,i=-1/0;return G.forEach(m=>{const x=j*2,C=m.centerProj.x,M=m.centerProj.y;C-x<t&&(t=C-x),C+x>n&&(n=C+x),M-x<r&&(r=M-x),M+x>i&&(i=M+x)}),{minX:t,minY:r,maxX:n,maxY:i}},[G,j]),D=12,me=_.maxX-_.minX+D*2,a=_.maxY-_.minY+D*2,u=me/he,z=a/he,N=_.minX-D+(me-u)/2,W=_.minY-D+(a-z)/2,O=`${N} ${W} ${u} ${z}`;return T.length===0?e.jsx("div",{className:"py-8 text-center text-sm text-oai-gray-500",children:o("heatmap.empty")}):e.jsxs("div",{ref:F,className:`relative select-none outline-none ${c?"cursor-grab active:cursor-grabbing w-full h-full flex items-center justify-center":"w-full overflow-hidden flex justify-center"}`,onMouseDown:t=>{if(!c)return;ce(t.clientX,t.clientY);const r=i=>I(i.clientX,i.clientY),n=()=>{ve(),window.removeEventListener("mousemove",r),window.removeEventListener("mouseup",n)};window.addEventListener("mousemove",r),window.addEventListener("mouseup",n)},onTouchStart:t=>{!c||t.touches.length===0||ce(t.touches[0].clientX,t.touches[0].clientY)},onTouchMove:t=>{!c||t.touches.length===0||I(t.touches[0].clientX,t.touches[0].clientY)},onTouchEnd:()=>{c&&ve()},children:[e.jsxs("svg",{ref:Z,viewBox:O,width:c?"95%":"100%",height:c?"95%":"auto",role:"img","aria-label":o("heatmap.iso.aria")||"3D interactive activity heatmap",style:{display:"block",width:"100%",height:"auto",maxWidth:c?"none":`${me}px`,maxHeight:c?"78vh":"none"},className:"transition-transform duration-300 ease-out",children:[c&&fe.map(t=>e.jsx("path",{d:t.d,fill:"none",stroke:E,strokeWidth:.25,strokeDasharray:"1.5 2.5",strokeLinecap:"round"},t.key)),G.map(t=>{const r=g&&g.key===t.key;return e.jsxs("g",{onMouseEnter:n=>{if(y.current&&(clearTimeout(y.current),y.current=null),de(t),c&&Z.current){const i=q((t.col-s.length/2)*j,(t.row-3.5)*j,we(t.level),h.yaw,h.pitch);let m=0,x=0;const C=Z.current;if(F.current&&typeof C.createSVGPoint=="function"&&typeof C.getScreenCTM=="function")try{const w=C.createSVGPoint();w.x=i.x,w.y=i.y;const re=C.getScreenCTM();if(re){const H=w.matrixTransform(re),ue=F.current.getBoundingClientRect();m=H.x-ue.left,x=H.y-ue.top}}catch{const re=C.getBoundingClientRect(),H=_.maxX-_.minX+D*2,ue=_.maxY-_.minY+D*2;m=(i.x-(_.minX-D))/H*re.width,x=(i.y-(_.minY-D))/ue*re.height}else{const w=C.getBoundingClientRect(),re=_.maxX-_.minX+D*2,H=_.maxY-_.minY+D*2;m=(i.x-(_.minX-D))/re*w.width,x=(i.y-(_.minY-D))/H*w.height}const M=140;let k=0;const b=F.current?F.current.getBoundingClientRect().width:C.getBoundingClientRect().width;m<M?k=M-m:m>b-M&&(k=b-M-m),xe({x:m,y:x,shiftX:k})}},onMouseLeave:()=>{y.current&&clearTimeout(y.current),y.current=setTimeout(()=>{de(null)},150)},className:"transition-all duration-200",style:{filter:r?"brightness(1.15) drop-shadow(0 4px 6px rgba(0,0,0,0.15))":"none",cursor:c?"pointer":"default"},children:[!c&&t.day&&e.jsx("title",{children:o("heatmap.tooltip.tokens",{day:t.day,value:P(t.value)})}),t.renderedFaces.map((n,i)=>e.jsx("path",{d:n.d,fill:n.fill,stroke:n.fill,strokeWidth:.25,strokeLinejoin:"round"},i))]},t.key)})]}),c&&g&&e.jsxs("div",{onMouseEnter:()=>{y.current&&(clearTimeout(y.current),y.current=null)},onMouseLeave:()=>{y.current&&clearTimeout(y.current),y.current=setTimeout(()=>{de(null)},150)},className:"absolute z-[9999] w-0 h-0 transition-all duration-100 ease-out",style:{left:`${ee.x}px`,top:`${ee.y}px`},children:[e.jsxs("div",{className:"absolute left-0 bottom-[10px] backdrop-blur-md bg-white/90 dark:bg-oai-gray-900/90 border border-oai-gray-200/50 dark:border-oai-gray-800/50 shadow-xl rounded-xl p-3.5 max-w-[280px] min-w-[200px] flex flex-col gap-2 animate-in fade-in zoom-in-95 duration-100",style:{transform:`translateX(calc(-50% + ${ee.shiftX}px))`},children:[e.jsxs("div",{className:"flex items-center justify-between border-b border-oai-gray-100 dark:border-oai-gray-800/80 pb-1.5",children:[e.jsx("span",{className:"text-[11px] font-semibold text-oai-gray-500 dark:text-oai-gray-400",children:g.day}),(()=>{const t=g.level===0?p?"#9ca3af":"#6b7280":R[g.level];return e.jsx("span",{className:"text-[10px] px-2 py-0.5 rounded-full font-medium",style:{backgroundColor:t+"22",color:t,border:`1px solid ${t}44`},children:o("heatmap.tooltip.level",{level:g.level})})})()]}),e.jsxs("div",{className:"flex flex-col gap-2",children:[e.jsxs("div",{className:"flex items-baseline gap-1",children:[e.jsx("span",{title:P(g.value),className:"text-lg font-bold text-oai-gray-900 dark:text-white leading-none",children:Y(g.value)}),e.jsx("span",{className:"text-[10px] text-oai-gray-400 uppercase tracking-wider font-semibold",children:o("heatmap.unit.tokens")})]}),g.models&&Object.keys(g.models).length>0?e.jsxs("div",{className:"mt-1.5 border-t border-oai-gray-100 dark:border-oai-gray-800/60 pt-2 flex flex-col gap-1.5",children:[e.jsx("div",{className:"text-[10px] font-semibold text-oai-gray-400 dark:text-oai-gray-500 uppercase tracking-wider",children:o("heatmap.tooltip.model_breakdown")}),e.jsx("div",{className:"flex flex-col gap-2 max-h-[150px] overflow-y-auto pr-1.5 scrollbar-thin",children:Object.entries(g.models).map(([t,r])=>({name:t,val:Number(r)})).sort((t,r)=>r.val-t.val).map(({name:t,val:r})=>{const n=Number(g.value)||1,i=Math.round(r/n*100);return e.jsxs("div",{className:"flex flex-col gap-1",children:[e.jsxs("div",{className:"flex items-center justify-between text-[11px] gap-3",children:[e.jsx("span",{className:"font-medium text-oai-gray-750 dark:text-oai-gray-200 truncate max-w-[120px]",title:t,children:t}),e.jsxs("div",{className:"flex items-center gap-1.5 shrink-0",children:[e.jsx("span",{title:P(r),className:"font-mono text-oai-gray-900 dark:text-oai-gray-100 font-semibold",children:Y(r)}),e.jsxs("span",{className:"text-[9px] text-oai-gray-450 dark:text-oai-gray-500 min-w-[28px] text-right font-medium",children:[i,"%"]})]})]}),e.jsx("div",{className:"w-full h-1 bg-oai-gray-100 dark:bg-oai-gray-800/85 rounded-full overflow-hidden",children:e.jsx("div",{className:"h-full rounded-full transition-all duration-300",style:{width:`${i}%`,backgroundColor:R[4],boxShadow:`0 0 4px ${R[4]}55`}})})]},t)})})]}):e.jsx("p",{className:"text-[11px] text-oai-gray-600 dark:text-oai-gray-300 leading-relaxed font-normal mt-1 border-t border-dashed border-oai-gray-100 dark:border-oai-gray-800/60 pt-1.5",children:De(g.level,g.value,Y)})]})]}),e.jsx("div",{className:"absolute bottom-[6px] left-0 -translate-x-1/2 w-2.5 h-2.5 rotate-45 bg-white dark:bg-oai-gray-900 border-r border-b border-oai-gray-200/50 dark:border-oai-gray-800/50 shadow-sm",style:{marginBottom:"1px"}})]})]})}const ct=12,dt=3,mt=26,ut=["#ebedf0","#a7f3d0","#6ee7b7","#34d399","#10b981"],xt=["#121212","#065f46","#059669","#10b981","#34d399"];function pt(s){if(typeof s!="string")return null;const d=/^(\d{4})-(\d{2})-(\d{2})$/.exec(s.trim());if(!d)return null;const p=new Date(Date.UTC(Number(d[1]),Number(d[2])-1,Number(d[3])));return Number.isFinite(p.getTime())?p:null}function Ye(s,d){return new Date(Date.UTC(s.getUTCFullYear(),s.getUTCMonth(),s.getUTCDate()+d))}function ht(s,d){return Math.floor((Date.UTC(d.getUTCFullYear(),d.getUTCMonth(),d.getUTCDate())-Date.UTC(s.getUTCFullYear(),s.getUTCMonth(),s.getUTCDate()))/864e5)}function ft(s,d){const p=d==="mon"?1:0,c=s.getUTCDay();return Ye(s,-((c-p+7)%7))}function gt(s,d,p,c){if(!s)return[];const f=pt(d)||new Date,$=[];for(let E=11;E>=0;E-=1)$.push(new Date(Date.UTC(f.getUTCFullYear(),f.getUTCMonth()-E,1)));const Y=ft(f,p),P=Ye(Y,-(s-1)*7),A=[],R=new Set;for(const E of $){const S=Math.floor(ht(P,E)/7);S<0||S>=s||R.has(S)||(R.add(S),A.push({label:c[E.getUTCMonth()],index:S}))}return A}function Mt({heatmap:s,timeZoneLabel:d,timeZoneShortLabel:p,hideLegend:c=!1,embedded:f=!1}){const{resolvedTheme:$}=qe(),{currency:Y,rate:P}=et(),{formatTokens:A,formatTokensTooltip:R}=Ee(),E=$==="dark",S=E?xt:ut,K=l.useRef(null),h=l.useRef(null),[v,ie]=l.useState(null),[V,he]=l.useState({x:0,y:0,shiftX:0,flipY:!1}),L=l.useRef(null);l.useEffect(()=>()=>{L.current&&clearTimeout(L.current)},[]);const[j,fe]=l.useState(!1),[Z,F]=l.useState(!1),[B,le]=l.useState(!1),J=l.useRef(null),[U,oe]=l.useState("emerald"),ne=[o("heatmap.month.jan"),o("heatmap.month.feb"),o("heatmap.month.mar"),o("heatmap.month.apr"),o("heatmap.month.may"),o("heatmap.month.jun"),o("heatmap.month.jul"),o("heatmap.month.aug"),o("heatmap.month.sep"),o("heatmap.month.oct"),o("heatmap.month.nov"),o("heatmap.month.dec")],ge=(a,u)=>{if(!u||!u.day)return;L.current&&(clearTimeout(L.current),L.current=null),ie(u);const z=a.currentTarget.getBoundingClientRect(),N=typeof window<"u"?window.innerWidth:1024,W=z.left+z.width/2,O=z.top<300,t=O?z.bottom:z.top,r=140;let n=0;W<r?n=r-W:W>N-r&&(n=N-r-W),he({x:W,y:t,shiftX:n,flipY:O})},ye=()=>{L.current&&clearTimeout(L.current),L.current=setTimeout(()=>{ie(null)},150)},Q=()=>{F(!1),fe(!0)},se=()=>{F(!0)},be=a=>{a.target===a.currentTarget&&Z&&(fe(!1),F(!1))};l.useEffect(()=>{if(!j||Z)return;const a=u=>{u.key==="Escape"&&se()};return window.addEventListener("keydown",a),()=>{window.removeEventListener("keydown",a)}},[j,Z]);const ce=l.useMemo(()=>({emerald:{accentText:"text-emerald-500 dark:text-emerald-400",accentBg:"bg-emerald-500/10 dark:bg-emerald-400/10",accentBorder:"border-emerald-500/20 dark:border-emerald-400/15",hoverBorder:"hover:border-emerald-500/30 dark:hover:border-emerald-400/30",hoverGlow:"hover:shadow-[0_0_20px_-3px_rgba(16,185,129,0.15)] hover:dark:shadow-[0_0_20px_-3px_rgba(52,211,153,0.25)]",rawColor:"#10b981"},ocean:{accentText:"text-blue-500 dark:text-blue-400",accentBg:"bg-blue-500/10 dark:bg-blue-400/10",accentBorder:"border-blue-500/20 dark:border-blue-400/15",hoverBorder:"hover:border-blue-500/30 dark:hover:border-blue-400/30",hoverGlow:"hover:shadow-[0_0_20px_-3px_rgba(59,130,246,0.15)] hover:dark:shadow-[0_0_20px_-3px_rgba(96,165,250,0.25)]",rawColor:"#3b82f6"},neon:{accentText:"text-purple-500 dark:text-purple-400",accentBg:"bg-purple-500/10 dark:bg-purple-400/10",accentBorder:"border-purple-500/20 dark:border-purple-400/15",hoverBorder:"hover:border-purple-500/30 dark:hover:border-purple-400/30",hoverGlow:"hover:shadow-[0_0_20px_-3px_rgba(168,85,247,0.15)] hover:dark:shadow-[0_0_20px_-3px_rgba(192,132,252,0.25)]",rawColor:"#a855f7"},amber:{accentText:"text-amber-500 dark:text-amber-400",accentBg:"bg-amber-500/10 dark:bg-amber-400/10",accentBorder:"border-amber-500/20 dark:border-amber-400/15",hoverBorder:"hover:border-amber-500/30 dark:hover:border-amber-400/30",hoverGlow:"hover:shadow-[0_0_20px_-3px_rgba(245,158,11,0.15)] hover:dark:shadow-[0_0_20px_-3px_rgba(245,158,11,0.25)]",rawColor:"#f59e0b"}}),[]),I=ce[U]||ce.emerald,ve=ae[U]?E?ae[U].dark:ae[U].light:E?ae.emerald.dark:ae.emerald.light,[g,de]=l.useState(()=>{if(f)return"2d";try{return window.localStorage?.getItem("tt:heatmap-view")==="3d"?"3d":"2d"}catch{return"2d"}});l.useEffect(()=>{if(!f)try{window.localStorage?.setItem("tt:heatmap-view",g)}catch{}},[g,f]),l.useEffect(()=>{if(g!=="2d")return;const a=K.current;a&&(a.scrollLeft=a.scrollWidth)},[s?.weeks,g]),l.useEffect(()=>{const a=K.current;if(!a)return;const u=()=>{L.current&&(clearTimeout(L.current),L.current=null),ie(null)};return a.addEventListener("scroll",u),()=>a.removeEventListener("scroll",u)},[]);const ee=s?.week_starts_on==="mon"?"mon":"sun",xe=l.useMemo(()=>{const a=Array.isArray(s?.weeks)?s.weeks:[];if(!a.length)return{weeks:[]};const u=[];for(const z of a)for(const N of Array.isArray(z)?z:[])N?.day&&u.push({day:N.day,total_tokens:N.total_tokens??N.value??0,billable_total_tokens:N.billable_total_tokens??N.value??N.total_tokens??0,models:N.models??null});return Ke({dailyRows:u,weeks:Math.max(52,a.length),to:s?.to,weekStartsOn:ee})},[s?.to,s?.weeks,ee]),y=xe?.weeks||[],T=l.useMemo(()=>{let a=0,u=0,z={day:null,value:0},N=0,W=0;const O=[];y.forEach(k=>{(Array.isArray(k)?k:[]).forEach(b=>{b&&b.day&&O.push(b)})}),O.sort((k,b)=>k.day.localeCompare(b.day)),O.forEach(k=>{const b=Number(k.value)||0;a+=b,b>0?(u++,N++,N>W&&(W=N)):N=0,b>z.value&&(z={day:k.day,value:b})});const t=O.length||365,r=(u/t*100).toFixed(1);let n="heatmap.3d.modal.ai.eval.default",i="heatmap.3d.modal.ai.title.default";a>=15e6?(i="heatmap.3d.modal.ai.title.peak",n="heatmap.3d.modal.ai.eval.peak"):a>=5e6?(i="heatmap.3d.modal.ai.title.heavy",n="heatmap.3d.modal.ai.eval.heavy"):a>=1e6?(i="heatmap.3d.modal.ai.title.core",n="heatmap.3d.modal.ai.eval.core"):a>=2e4&&(i="heatmap.3d.modal.ai.title.steady",n="heatmap.3d.modal.ai.eval.steady");const m=s?.total_cost_usd,x=Number(m),M=m!=null&&(typeof m!="string"||m.trim()!=="")&&Number.isFinite(x)?x:a/15e5;return{totalTokens:a,activeDays:u,activeRate:r,maxSingleDay:z,maxStreak:W,aiEvaluationTitleKey:i,aiEvaluationKey:n,totalCostUsd:M}},[y,s?.total_cost_usd]),Ce=l.useMemo(()=>Ve(T.totalCostUsd,{currency:Y,rate:P}),[T.totalCostUsd,Y,P]),pe=a=>A(a,{mode:Qe.COMPACT,decimals:2}),ke=ee==="mon"?["Mon","Tue","Wed","Thu","Fri","Sat","Sun"].map(a=>o(`heatmap.day.${a.toLowerCase()}`)):["Sun","Mon","Tue","Wed","Thu","Fri","Sat"].map(a=>o(`heatmap.day.${a.toLowerCase()}`)),we=l.useMemo(()=>gt(y.length,xe?.to,ee,ne),[xe?.to,y.length,ee,ne]);if(!y.length)return e.jsx("div",{className:"py-8 text-center text-sm text-oai-gray-500",children:o("heatmap.empty")});const te=f?10:ct,G=f?2:dt,_=f?22:mt,D=_+y.length*te+Math.max(0,y.length-1)*G,me=`${_}px repeat(${y.length}, ${te}px)`;return e.jsxs("div",{ref:h,className:f?"relative":"relative rounded-xl border border-oai-gray-200 dark:border-oai-gray-800 bg-white dark:bg-oai-gray-900 p-5",children:[!f&&e.jsxs("div",{className:"flex items-baseline justify-between mb-3",children:[e.jsx("h3",{className:"text-sm font-medium text-oai-gray-500 dark:text-oai-gray-300 uppercase tracking-wide",children:o("heatmap.title")}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsxs("div",{role:"tablist","aria-label":"Heatmap view",className:"flex rounded-md border border-oai-gray-200 dark:border-oai-gray-800 p-0.5 text-[10px]",children:[e.jsx("button",{type:"button",role:"tab","aria-selected":g==="2d",onClick:()=>de("2d"),className:g==="2d"?"px-2 py-0.5 rounded bg-oai-gray-100 text-oai-black dark:bg-oai-gray-800 dark:text-oai-white font-medium":"px-2 py-0.5 rounded text-oai-gray-500 dark:text-oai-gray-400 hover:text-oai-gray-700 dark:hover:text-oai-gray-200",children:o("heatmap.view.2d")}),e.jsx("button",{type:"button",role:"tab","aria-selected":g==="3d",onClick:()=>de("3d"),className:g==="3d"?"px-2 py-0.5 rounded bg-oai-gray-100 text-oai-black dark:bg-oai-gray-800 dark:text-oai-white font-medium":"px-2 py-0.5 rounded text-oai-gray-500 dark:text-oai-gray-400 hover:text-oai-gray-700 dark:hover:text-oai-gray-200",children:o("heatmap.view.3d")})]}),e.jsx("span",{className:"text-xs text-oai-gray-400 dark:text-oai-gray-450",children:p||o("heatmap.legend.utc")})]})]}),g==="3d"&&e.jsxs("div",{onClick:Q,className:"cursor-pointer group relative overflow-hidden rounded-lg hover:border-oai-gray-350 dark:hover:border-oai-gray-700 border border-transparent transition-all",title:o("heatmap.3d.hover_tip"),children:[e.jsx(Ae,{weeks:y,isDark:E,palette:U}),e.jsx("div",{className:"absolute inset-0 bg-gradient-to-t from-oai-gray-900/5 to-transparent pointer-events-none opacity-0 group-hover:opacity-100 transition-opacity flex items-end justify-center pb-2",children:e.jsxs("span",{className:"text-[10px] bg-white/95 dark:bg-oai-gray-900/95 shadow border border-oai-gray-200/60 dark:border-oai-gray-800/80 px-2.5 py-1 rounded-full font-medium text-oai-gray-500 dark:text-oai-gray-400 flex items-center gap-1 transform translate-y-2 group-hover:translate-y-0 transition-transform duration-200",children:[e.jsx(tt,{size:9}),o("heatmap.3d.hover_tip")]})})]}),g==="2d"&&e.jsx("div",{ref:K,className:`overflow-x-auto overflow-y-hidden heatmap-scroll-thin${f?"":" pb-1"}`,children:e.jsxs("div",{style:{minWidth:D},children:[e.jsxs("div",{className:"grid text-[10px] uppercase text-oai-gray-400 dark:text-oai-gray-400 mb-1",style:{gridTemplateColumns:me,columnGap:G},children:[e.jsx("span",{}),we.map(a=>e.jsx("span",{style:{gridColumnStart:a.index+2},className:"whitespace-nowrap",children:a.label},`${a.label}-${a.index}`))]}),e.jsxs("div",{className:"grid",style:{gridTemplateColumns:me,columnGap:G},children:[e.jsx("div",{className:"grid text-[10px] text-oai-gray-400 dark:text-oai-gray-400 sticky left-0 bg-white dark:bg-oai-gray-900 pr-2",style:{gridTemplateRows:`repeat(7, ${te}px)`,rowGap:G},children:ke.map(a=>e.jsx("span",{className:"leading-none",children:a},a))}),e.jsx("div",{className:"grid",style:{gridAutoFlow:"column",gridTemplateRows:`repeat(7, ${te}px)`,gap:G},children:y.map((a,u)=>(Array.isArray(a)?a:[]).map((z,N)=>{if(!z)return null;const W=z.day||`e-${u}-${N}`,O=Number(z.level)||0,t=S[O]||S[0];return e.jsx("span",{onMouseEnter:r=>ge(r,z),onMouseLeave:ye,className:"rounded-[2px] transition-transform hover:scale-125 hover:z-10 cursor-pointer",style:{width:te,height:te,background:t}},W)}))})]})]})}),!c&&e.jsxs("div",{className:"flex items-center justify-center gap-2 mt-3",children:[e.jsx("span",{className:"text-[10px] text-oai-gray-400 dark:text-oai-gray-400",children:o("heatmap.legend.less")}),e.jsx("div",{className:"flex gap-0.5",children:S.map((a,u)=>e.jsx("span",{className:"rounded-[1px]",style:{width:10,height:10,background:a}},u))}),e.jsx("span",{className:"text-[10px] text-oai-gray-400 dark:text-oai-gray-400",children:o("heatmap.legend.more")})]}),j&&e.jsx("div",{onAnimationEnd:be,onClick:a=>{a.target===a.currentTarget&&se()},className:`fixed inset-0 z-50 flex items-center justify-center p-3 md:p-6 backdrop-blur-md bg-black/15 dark:bg-black/40 ${Z?"animate-tt-fade-out":"animate-tt-fade-in"}`,children:e.jsxs("div",{className:`relative w-full max-w-6xl h-[88vh] backdrop-blur-2xl bg-white/90 dark:bg-oai-gray-900/90 border border-oai-gray-200/50 dark:border-white/10 shadow-2xl rounded-2xl flex flex-col md:flex-row overflow-hidden ${Z?"animate-tt-modal-exit":"animate-tt-modal"}`,children:[e.jsx("button",{type:"button",onClick:se,className:"absolute top-4 right-4 z-50 p-2 rounded-full border border-oai-gray-200/60 dark:border-oai-gray-800/60 bg-white/50 dark:bg-oai-gray-900/50 text-oai-gray-500 dark:text-oai-gray-400 hover:text-oai-gray-900 dark:hover:text-white hover:rotate-90 hover:scale-105 active:scale-95 transition-all duration-300",children:e.jsx(Ze,{size:16})}),e.jsxs("div",{className:"w-full md:w-[340px] border-b md:border-b-0 md:border-r border-zinc-200/50 dark:border-zinc-800/40 p-5 md:p-6 flex flex-col gap-6 overflow-y-auto backdrop-blur-md bg-zinc-50/50 dark:bg-zinc-950/50",children:[e.jsxs("div",{children:[e.jsxs("div",{className:"flex items-center gap-1.5 select-none",children:[e.jsxs("span",{className:"relative flex h-1.5 w-1.5",children:[e.jsx("span",{className:"animate-ping absolute inline-flex h-full w-full rounded-full opacity-75",style:{backgroundColor:I.rawColor}}),e.jsx("span",{className:"relative inline-flex rounded-full h-1.5 w-1.5",style:{backgroundColor:I.rawColor}})]}),e.jsx("span",{className:"text-[9px] font-extrabold uppercase tracking-widest font-mono text-zinc-400 dark:text-zinc-500",children:o("heatmap.3d.modal.eyebrow")})]}),e.jsx("h4",{className:"text-xl font-black text-zinc-900 dark:text-zinc-50 tracking-tight leading-none mt-2 select-none",children:o("heatmap.3d.modal.title")}),e.jsx("p",{className:"text-[11px] leading-relaxed text-zinc-400 dark:text-zinc-500 mt-2 font-normal select-none",children:o("heatmap.3d.modal.desc")})]}),e.jsxs("div",{className:"grid grid-cols-2 gap-x-5 gap-y-5 border-y border-zinc-200/50 dark:border-zinc-800/50 py-5 select-none",children:[e.jsxs("div",{className:"flex flex-col gap-1 relative group cursor-help",children:[e.jsx("div",{className:"absolute left-0 bottom-full mb-2 pointer-events-none opacity-0 translate-y-1 group-hover:opacity-100 group-hover:translate-y-0 transition-all duration-200 z-50",children:e.jsxs("div",{className:"bg-white dark:bg-zinc-950 text-zinc-900 dark:text-zinc-50 text-[10px] font-semibold font-mono rounded-lg px-2.5 py-1.5 shadow-xl border border-zinc-200 dark:border-zinc-800/80 whitespace-nowrap flex flex-col",children:[e.jsx("span",{className:"text-[9px] text-zinc-400 dark:text-zinc-500",children:o("heatmap.3d.modal.stats.precision_total_tokens")}),e.jsxs("span",{className:"mt-0.5 font-bold text-zinc-900 dark:text-zinc-50",children:[R(T.totalTokens)," ",o("heatmap.unit.tokens")]})]})}),e.jsx("span",{className:"text-[9px] font-bold text-zinc-400 dark:text-zinc-500 uppercase tracking-widest font-mono",children:o("heatmap.3d.modal.stats.total_tokens")}),e.jsxs("div",{className:"flex items-baseline gap-1.5",children:[e.jsx("span",{className:"text-xl font-black text-zinc-900 dark:text-zinc-50 tracking-tight font-mono transition-transform duration-200 group-hover:-translate-y-[1px]",children:pe(T.totalTokens)}),e.jsx("div",{className:"opacity-30 group-hover:opacity-60 transition-opacity",children:e.jsx("svg",{width:"24",height:"10",viewBox:"0 0 24 10",fill:"none",children:e.jsx("path",{d:"M1 9C3 7 5 7 7 4C9 1 11 0 13 2C15 4 17 0 23 0",stroke:I.rawColor,strokeWidth:"1.2",strokeLinecap:"round",strokeLinejoin:"round"})})})]})]}),e.jsxs("div",{className:"flex flex-col gap-1 group cursor-default",children:[e.jsx("span",{className:"text-[9px] font-bold text-zinc-400 dark:text-zinc-500 uppercase tracking-widest font-mono",children:o("heatmap.3d.modal.stats.estimated_cost")}),e.jsx("span",{className:"text-xl font-black text-zinc-900 dark:text-zinc-50 tracking-tight font-mono transition-transform duration-200 group-hover:-translate-y-[1px]",children:Ce})]}),e.jsxs("div",{className:"flex flex-col gap-1 group cursor-default",children:[e.jsx("span",{className:"text-[9px] font-bold text-zinc-400 dark:text-zinc-500 uppercase tracking-widest font-mono",children:o("heatmap.3d.modal.stats.active_rate_days")}),e.jsxs("span",{className:"text-xl font-black text-zinc-900 dark:text-zinc-50 tracking-tight font-mono transition-transform duration-200 group-hover:-translate-y-[1px]",children:[T.activeRate,"%"," ",e.jsxs("span",{className:"text-[10px] font-bold text-zinc-400 dark:text-zinc-500 font-mono",children:["(",T.activeDays,o("heatmap.3d.modal.stats.days_suffix"),")"]})]})]}),e.jsxs("div",{className:"flex flex-col gap-1 group cursor-default",children:[e.jsx("span",{className:"text-[9px] font-bold text-zinc-400 dark:text-zinc-500 uppercase tracking-widest font-mono",children:o("heatmap.3d.modal.stats.max_streak")}),e.jsxs("span",{className:"text-xl font-black text-amber-500 tracking-tight font-mono transition-transform duration-200 group-hover:-translate-y-[1px]",children:[T.maxStreak," ",e.jsx("span",{className:"text-[10px] font-bold text-amber-500/80 font-mono",children:o("heatmap.3d.modal.stats.days_suffix")})]})]}),e.jsxs("div",{className:"flex flex-col gap-1 col-span-2 relative group cursor-help",children:[e.jsx("div",{className:"absolute left-0 bottom-full mb-2 pointer-events-none opacity-0 translate-y-1 group-hover:opacity-100 group-hover:translate-y-0 transition-all duration-200 z-50",children:e.jsxs("div",{className:"bg-white dark:bg-zinc-950 text-zinc-900 dark:text-zinc-50 text-[10px] font-semibold font-mono rounded-lg px-2.5 py-1.5 shadow-xl border border-zinc-200 dark:border-zinc-800/80 whitespace-nowrap flex flex-col",children:[e.jsx("span",{className:"text-[9px] text-zinc-400 dark:text-zinc-500",children:o("heatmap.3d.modal.stats.precision_peak_value")}),e.jsx("span",{className:"mt-0.5 font-bold text-zinc-900 dark:text-zinc-50",children:T.maxSingleDay.value>0?`${R(T.maxSingleDay.value)} ${o("heatmap.unit.tokens")}`:o("heatmap.3d.modal.stats.no_data")}),e.jsx("span",{className:"text-[8px] text-zinc-400 dark:text-zinc-500 mt-0.5",children:T.maxSingleDay.day||o("heatmap.3d.modal.stats.no_data")})]})}),e.jsx("span",{className:"text-[9px] font-bold text-zinc-400 dark:text-zinc-500 uppercase tracking-widest font-mono",children:o("heatmap.3d.modal.stats.peak_day")}),e.jsxs("span",{className:"text-xl font-black text-zinc-900 dark:text-zinc-50 tracking-tight font-mono transition-transform duration-200 group-hover:-translate-y-[1px]",children:[T.maxSingleDay.value>0?pe(T.maxSingleDay.value):o("heatmap.3d.modal.stats.no_data")," ",e.jsxs("span",{className:"text-[10px] font-bold text-zinc-400 dark:text-zinc-500 font-mono",children:["(",T.maxSingleDay.day||o("heatmap.3d.modal.stats.no_data"),")"]})]})]})]}),e.jsxs("div",{className:"flex flex-col gap-2.5 py-1",children:[e.jsxs("div",{className:"flex items-center gap-1.5 select-none",children:[e.jsx(at,{size:11,style:{color:I.rawColor}}),e.jsx("span",{className:"text-[9px] font-extrabold uppercase tracking-widest font-mono",style:{color:I.rawColor},children:o(T.aiEvaluationTitleKey)})]}),e.jsxs("div",{className:"pl-3.5 border-l-2 relative transition-all duration-300 group",style:{borderColor:I.rawColor},children:[e.jsx("div",{className:"absolute inset-y-0 left-0 w-[3px] blur-[2px] opacity-15 pointer-events-none rounded-full",style:{backgroundColor:I.rawColor}}),e.jsx("p",{className:"text-[11px] leading-relaxed text-zinc-600 dark:text-zinc-400 font-normal",children:o(T.aiEvaluationKey)})]})]}),e.jsx("div",{className:"mt-auto border-t border-zinc-200/50 dark:border-zinc-800/50 pt-4 select-none",children:e.jsxs("div",{className:"flex flex-col gap-2",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx("span",{className:"text-[9px] font-bold text-zinc-400 dark:text-zinc-500 uppercase tracking-widest font-mono",children:o("heatmap.3d.modal.legend.title")}),e.jsx("span",{className:"text-[10px] font-medium text-zinc-500 dark:text-zinc-400",children:o(`heatmap.3d.modal.palette.${U}`)})]}),e.jsx("div",{className:"flex gap-1",children:ve.map((a,u)=>e.jsx("div",{className:"flex-1 h-1 rounded-[2px]",style:{backgroundColor:a},title:o("heatmap.tooltip.level",{level:u})},u))})]})})]}),e.jsxs("div",{className:"flex-1 h-full relative flex items-center justify-center overflow-hidden p-4",children:[e.jsx("div",{className:"absolute top-1/4 left-1/3 w-96 h-96 rounded-full blur-[130px] pointer-events-none -translate-x-1/2 -translate-y-1/2 transition-all duration-500",style:{backgroundColor:I.rawColor+"15"}}),e.jsx("div",{className:"absolute bottom-1/4 right-1/3 w-80 h-80 rounded-full blur-[120px] pointer-events-none translate-x-1/2 translate-y-1/2 bg-purple-500/[0.04] dark:bg-purple-500/[0.08]"}),e.jsxs("div",{className:"absolute top-4 left-1/2 -translate-x-1/2 flex items-center gap-3 p-1.5 backdrop-blur-md bg-white/70 dark:bg-oai-gray-900/75 border border-oai-gray-200/60 dark:border-oai-gray-800/80 rounded-full shadow-lg z-30 select-none",children:[e.jsx("div",{className:"flex items-center gap-1.5 px-2",children:Object.keys(ce).map(a=>{const u=U===a;return e.jsx("button",{type:"button",onClick:()=>oe(a),title:o(`heatmap.3d.modal.palette.${a}`),className:`w-3.5 h-3.5 rounded-full transition-all duration-200 relative hover:scale-125 ${a==="emerald"?"bg-[#10b981]":a==="ocean"?"bg-[#3b82f6]":a==="neon"?"bg-[#a855f7]":"bg-[#f59e0b]"}`,children:u&&e.jsx("span",{className:"absolute inset-0 rounded-full ring-2 ring-offset-1 ring-offset-white dark:ring-offset-oai-gray-900 ring-oai-gray-900 dark:ring-white scale-110"})},a)})}),e.jsx("div",{className:"w-[1px] h-4 bg-oai-gray-200 dark:bg-oai-gray-800"}),e.jsxs("div",{className:"flex items-center gap-1 pr-1",children:[e.jsx("button",{type:"button",onClick:()=>{const a=!B;le(a),J.current&&J.current.toggleAutoRotate(a)},title:B?o("heatmap.3d.modal.control.pause"):o("heatmap.3d.modal.control.play"),className:`p-1.5 rounded-full transition-all duration-200 hover:bg-oai-gray-100 dark:hover:bg-oai-gray-800 ${B?I.accentText:"text-oai-gray-400 hover:text-oai-gray-600 dark:hover:text-oai-gray-250"}`,children:B?e.jsx(ot,{size:12}):e.jsx(nt,{size:12})}),e.jsx("button",{type:"button",onClick:()=>{le(!1),J.current&&J.current.reset()},title:o("heatmap.3d.modal.control.reset"),className:"p-1.5 rounded-full text-oai-gray-400 hover:text-oai-gray-600 dark:hover:text-oai-gray-250 hover:bg-oai-gray-100 dark:hover:bg-oai-gray-800 transition-all duration-200",children:e.jsx(st,{size:12})})]})]}),e.jsx(Ae,{weeks:y,isDark:E,interactive:!0,palette:U,autoRotateInit:B,onResetViewRef:J}),e.jsxs("div",{className:"absolute bottom-4 right-4 flex items-center gap-1.5 text-[9px] font-bold text-oai-gray-400 bg-white/80 dark:bg-oai-gray-900/80 border border-oai-gray-200/50 dark:border-oai-gray-800/80 rounded-md px-2.5 py-1.5 select-none pointer-events-none backdrop-blur-md shadow-sm",children:[e.jsx(rt,{size:10,className:I.accentText}),e.jsx("span",{children:o("heatmap.3d.modal.footer.tip")})]})]})]})}),v&&!j&&typeof document<"u"&&Je.createPortal(e.jsxs("div",{className:"fixed z-[9999] w-0 h-0 transition-all duration-100 ease-out pointer-events-none",style:{position:"fixed",left:`${V.x}px`,top:`${V.y}px`},children:[e.jsxs("div",{className:`absolute left-0 ${V.flipY?"top-[10px]":"bottom-[10px]"} backdrop-blur-md bg-white/95 dark:bg-oai-gray-900/95 border border-oai-gray-200/50 dark:border-oai-gray-800/50 shadow-xl rounded-xl p-3.5 max-w-[280px] min-w-[200px] flex flex-col gap-2 animate-in fade-in zoom-in-95 duration-100`,style:{transform:`translateX(calc(-50% + ${V.shiftX}px))`},children:[e.jsxs("div",{className:"flex items-center justify-between border-b border-oai-gray-100 dark:border-oai-gray-800/80 pb-1.5",children:[e.jsx("span",{className:"text-[11px] font-semibold text-oai-gray-500 dark:text-oai-gray-400",children:v.day}),(()=>{const a=v.level===0?E?"#9ca3af":"#6b7280":S[v.level];return e.jsx("span",{className:"text-[10px] px-2 py-0.5 rounded-full font-medium",style:{backgroundColor:a+"22",color:a,border:`1px solid ${a}44`},children:o("heatmap.tooltip.level",{level:v.level})})})()]}),e.jsxs("div",{className:"flex flex-col gap-2",children:[e.jsxs("div",{className:"flex items-baseline gap-1",children:[e.jsx("span",{title:R(v.total_tokens??v.value),className:"text-lg font-bold text-oai-gray-900 dark:text-white leading-none",children:A(v.total_tokens??v.value)}),e.jsx("span",{className:"text-[10px] text-oai-gray-400 uppercase tracking-wider font-semibold",children:o("heatmap.unit.tokens")})]}),v.models&&Object.keys(v.models).length>0?e.jsxs("div",{className:"mt-1.5 border-t border-oai-gray-100 dark:border-oai-gray-800/60 pt-2 flex flex-col gap-1.5",children:[e.jsx("div",{className:"text-[10px] font-semibold text-oai-gray-400 dark:text-oai-gray-500 uppercase tracking-wider",children:o("heatmap.tooltip.model_breakdown")}),e.jsx("div",{className:"flex flex-col gap-2 max-h-[150px] overflow-y-auto pr-1.5 oai-scrollbar",children:Object.entries(v.models).map(([a,u])=>({name:a,val:Number(u)})).sort((a,u)=>u.val-a.val).map(({name:a,val:u})=>{const z=Number(v.total_tokens??v.value)||1,N=Math.round(u/z*100);return e.jsxs("div",{className:"flex flex-col gap-1",children:[e.jsxs("div",{className:"flex items-center justify-between text-[11px] gap-3",children:[e.jsx("span",{className:"font-medium text-oai-gray-750 dark:text-oai-gray-200 truncate max-w-[120px]",title:a,children:a}),e.jsxs("div",{className:"flex items-center gap-1.5 shrink-0",children:[e.jsx("span",{title:R(u),className:"font-mono text-oai-gray-900 dark:text-oai-gray-100 font-semibold",children:A(u)}),e.jsxs("span",{className:"text-[9px] text-oai-gray-450 dark:text-oai-gray-500 min-w-[28px] text-right font-medium",children:[N,"%"]})]})]}),e.jsx("div",{className:"w-full h-1 bg-oai-gray-100 dark:bg-oai-gray-800/85 rounded-full overflow-hidden",children:e.jsx("div",{className:"h-full rounded-full transition-all duration-300",style:{width:`${N}%`,backgroundColor:S[4],boxShadow:`0 0 4px ${S[4]}55`}})})]},a)})})]}):e.jsx("p",{className:"text-[11px] text-oai-gray-600 dark:text-oai-gray-300 leading-relaxed font-normal mt-1 border-t border-dashed border-oai-gray-100 dark:border-oai-gray-800/60 pt-1.5",children:De(v.level,v.total_tokens??v.value,A)})]})]}),e.jsx("div",{className:`absolute left-0 -translate-x-1/2 w-2.5 h-2.5 rotate-45 bg-white dark:bg-oai-gray-900 shadow-sm ${V.flipY?"top-[6px] border-l border-t":"bottom-[6px] border-r border-b"} border-oai-gray-200/50 dark:border-oai-gray-800/50`,style:V.flipY?{marginTop:"1px"}:{marginBottom:"1px"}})]}),document.body),e.jsx("style",{children:`
1
+ import{m as Ne,r as l,j as e,c as o,$ as qe,a9 as Ke,a3 as Ve,X as Ze,a2 as Je,n as Qe}from"./__vite-browser-external-DYzNZTW8.js";import{u as et}from"./useCurrency-Dk_equa7.js";import{u as Ee}from"./useTokenFormat-C0kEMmzx.js";import{M as tt}from"./maximize-2-lQE0Y8sM.js";import{T as at}from"./terminal-C2TY01x3.js";import{I as rt}from"./info-DyDVFBHF.js";const Re={name:"pause",size:24,node:[["rect",{x:"14",y:"3",width:"5",height:"18",rx:"1",key:"kaeet6"}],["rect",{x:"5",y:"3",width:"5",height:"18",rx:"1",key:"1wsw3u"}]]};Re.node;const ot=Ne(Re);const Pe={name:"play",size:24,node:[["path",{d:"M5 5a2 2 0 0 1 3.008-1.728l11.997 6.998a2 2 0 0 1 .003 3.458l-12 7A2 2 0 0 1 5 19z",key:"10ikf1"}]]};Pe.node;const nt=Ne(Pe);const Le={name:"rotate-ccw",size:24,node:[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}]]};Le.node;const st=Ne(Le),ae={emerald:{light:["#ebedf0","#a7f3d0","#6ee7b7","#34d399","#10b981"],dark:["#2d333b","#065f46","#059669","#10b981","#34d399"],gridColor:{light:"rgba(16, 185, 129, 0.12)",dark:"rgba(52, 211, 153, 0.08)"}},ocean:{light:["#f1f5f9","#93c5fd","#60a5fa","#3b82f6","#1d4ed8"],dark:["#1e293b","#1e3a8a","#2563eb","#3b82f6","#60a5fa"],gridColor:{light:"rgba(59, 130, 246, 0.12)",dark:"rgba(96, 165, 250, 0.08)"}},neon:{light:["#faf5ff","#ebd5ff","#c084fc","#a855f7","#7e22ce"],dark:["#2e1065","#581c87","#8b5cf6","#a855f7","#c084fc"],gridColor:{light:"rgba(168, 85, 247, 0.12)",dark:"rgba(192, 132, 252, 0.08)"}},amber:{light:["#fffbeb","#fde68a","#f59e0b","#d97706","#b45309"],dark:["#451a03","#78350f","#b45309","#d97706","#f59e0b"],gridColor:{light:"rgba(245, 158, 11, 0.12)",dark:"rgba(245, 158, 11, 0.08)"}}};function it(s,d){const p=/^#([0-9a-f]{6})$/i.exec(s);if(!p)return s;const c=parseInt(p[1],16),f=c>>16&255,$=c>>8&255,Y=c&255,P=A=>Math.max(0,Math.min(255,Math.round(A*d)));return`rgb(${P(f)}, ${P($)}, ${P(Y)})`}function q(s,d,p,c,f){const $=Math.cos(c),Y=Math.sin(c),P=s*$-d*Y,A=s*Y+d*$,R=p,E=Math.cos(f),S=Math.sin(f),K=P,h=A*E-R*S,v=A*S+R*E;return{x:K,y:h,z:v}}function lt(s,d,p,c,f){return q(s,d,p,c,f)}function De(s,d,p=c=>Number(c).toLocaleString()){const c=p(d);if(s>=4){const f=Math.floor(Math.random()*3)+1;return o(`heatmap.3d.voxel.joke.${f}`,{value:c})}else return s===3?o("heatmap.3d.voxel.level3",{value:c}):s===2?o("heatmap.3d.voxel.level2",{value:c}):s===1?o("heatmap.3d.voxel.level1",{value:c}):o("heatmap.3d.voxel.level0")}function Ae({weeks:s,palette:d="auto",isDark:p=!1,interactive:c=!1,autoRotateInit:f=!1,onResetViewRef:$=null}){const{formatTokens:Y,formatTokensTooltip:P}=Ee(),A=ae[d]||(d==="auto"?ae.emerald:null),R=A?p?A.dark:A.light:Array.isArray(d)?d:p?ae.emerald.dark:ae.emerald.light,E=A?p?A.gridColor.dark:A.gridColor.light:p?"rgba(255,255,255,0.06)":"rgba(0,0,0,0.06)",S=-.2,K=.88,[h,v]=l.useState({yaw:S,pitch:K}),[ie,V]=l.useState(f),[he,L]=l.useState(1),j=c?13:10.5,fe=l.useMemo(()=>{const t=[],r=s.length;if(r===0||!c)return[];for(let n=0;n<=7;n++){const i=(n-3.5)*j,m=q(-r/2*j,i,0,h.yaw,h.pitch),x=q(r/2*j,i,0,h.yaw,h.pitch);t.push({d:`M${m.x},${m.y} L${x.x},${x.y}`,key:`horiz-${n}`})}for(let n=0;n<=r;n+=4){const i=(n-r/2)*j,m=q(i,-3.5*j,0,h.yaw,h.pitch),x=q(i,3.5*j,0,h.yaw,h.pitch);t.push({d:`M${m.x},${m.y} L${x.x},${x.y}`,key:`vert-${n}`})}if(r%4!==0){const n=(r-r/2)*j,i=q(n,-3.5*j,0,h.yaw,h.pitch),m=q(n,3.5*j,0,h.yaw,h.pitch);t.push({d:`M${i.x},${i.y} L${m.x},${m.y}`,key:"vert-last"})}return t},[s.length,h,j,c]);l.useEffect(()=>{$&&($.current={reset:()=>{v({yaw:S,pitch:K}),V(!1),L(1),be()},toggleAutoRotate:t=>{V(t)}})},[$]);const Z=l.useRef(null),F=l.useRef(null),B=l.useRef(!1),le=l.useRef({x:0,y:0}),J=l.useRef({yaw:S,pitch:K}),U=l.useRef({x:0,y:0}),oe=l.useRef({x:0,y:0,time:0}),ne=l.useRef(null),[ge,ye]=l.useState(0),Q=l.useRef(null),se=l.useRef(!0);l.useEffect(()=>(se.current=!0,()=>{se.current=!1}),[]);const be=()=>{Q.current&&cancelAnimationFrame(Q.current),ye(0);const t=performance.now(),r=1200,n=i=>{if(!se.current)return;const m=i-t,x=Math.min(1,m/r),C=1-Math.pow(1-x,3);ye(C),x<1?Q.current=requestAnimationFrame(n):Q.current=null};Q.current=requestAnimationFrame(n)};l.useEffect(()=>(be(),()=>{Q.current&&cancelAnimationFrame(Q.current)}),[c]),l.useEffect(()=>{if(!ie||B.current||typeof window>"u"||typeof window.matchMedia=="function"&&window.matchMedia("(prefers-reduced-motion: reduce)").matches)return;let r;const n=()=>{if(typeof document<"u"&&document.visibilityState==="hidden"){r=requestAnimationFrame(n);return}v(i=>({yaw:i.yaw+.002,pitch:i.pitch})),r=requestAnimationFrame(n)};return r=requestAnimationFrame(n),()=>cancelAnimationFrame(r)},[ie]);const ce=(t,r)=>{c&&(B.current=!0,le.current={x:t,y:r},J.current={yaw:h.yaw,pitch:h.pitch},U.current={x:0,y:0},oe.current={x:t,y:r,time:performance.now()},ne.current&&cancelAnimationFrame(ne.current))},I=(t,r)=>{if(!B.current)return;const n=t-le.current.x,i=r-le.current.y,m=performance.now(),x=m-oe.current.time;x>0&&(U.current={x:(t-oe.current.x)/x,y:(r-oe.current.y)/x}),oe.current={x:t,y:r,time:m};const C=.005,M=J.current.yaw-n*C,k=Math.PI/2.3,b=Math.max(-k,Math.min(k,J.current.pitch-i*C));v({yaw:M,pitch:b})},ve=()=>{if(!B.current)return;B.current=!1;let t=-U.current.x*12,r=-U.current.y*12;const n=.95,i=()=>{B.current||(t*=n,r*=n,!(Math.abs(t)<.01&&Math.abs(r)<.01)&&(v(m=>{const x=m.yaw+t*.005,C=Math.PI/2.3,M=Math.max(-C,Math.min(C,m.pitch+r*.005));return{yaw:x,pitch:M}}),ne.current=requestAnimationFrame(i)))};ne.current=requestAnimationFrame(i)},[g,de]=l.useState(null),[ee,xe]=l.useState({x:0,y:0,shiftX:0}),y=l.useRef(null);l.useEffect(()=>()=>{y.current&&clearTimeout(y.current)},[]),l.useEffect(()=>{if(!c||!F.current)return;const t=n=>{n.preventDefault();const i=-n.deltaY*.0025;L(m=>{const x=m+i;return Math.max(.5,Math.min(3,x))})},r=F.current;return r.addEventListener("wheel",t,{passive:!1}),()=>{r.removeEventListener("wheel",t)}},[c]);const T=l.useMemo(()=>{const t=[];return s.forEach((r,n)=>{(Array.isArray(r)?r:[]).forEach((i,m)=>{i&&t.push({key:i.day||`${n}-${m}`,col:n,row:m,level:i.level||0,value:i.value||0,day:i.day,models:i.models||null})})}),t},[s]),pe=j-(c?1.8:1.5),ke=c?38:28,we=t=>Math.max(1.8,Number(t)/4*ke),te=l.useMemo(()=>{if(T.length===0)return[];const t=s.length;return T.map(r=>{const n=we(r.level),i=Math.sqrt(Math.pow(r.col-t/2,2)+Math.pow(r.row-3.5,2)),m=Math.sqrt(Math.pow(t/2,2)+Math.pow(3.5,2)),x=i/m*.4,C=Math.min(1,Math.max(0,(ge-x)*(1/.6))),M=n*C,k=(r.col-t/2)*j,b=(r.row-3.5)*j,w=pe/2,H=[{x:k-w,y:b-w,z:0},{x:k+w,y:b-w,z:0},{x:k+w,y:b+w,z:0},{x:k-w,y:b+w,z:0},{x:k-w,y:b-w,z:M},{x:k+w,y:b-w,z:M},{x:k+w,y:b+w,z:M},{x:k-w,y:b+w,z:M}].map(X=>q(X.x,X.y,X.z,h.yaw,h.pitch)),ue=q(k,b,M/2,h.yaw,h.pitch),Ue=[{name:"top",indices:[4,5,6,7],scale:1,normal:[0,0,1]},{name:"bottom",indices:[3,2,1,0],scale:.4,normal:[0,0,-1]},{name:"left",indices:[3,0,4,7],scale:.55,normal:[-1,0,0]},{name:"right",indices:[1,2,6,5],scale:.75,normal:[1,0,0]},{name:"front",indices:[0,1,5,4],scale:.85,normal:[0,-1,0]},{name:"back",indices:[2,3,7,6],scale:.65,normal:[0,1,0]}],Ie=R[Math.min(4,Math.max(0,Number(r.level)||0))],ze=[],We=.35,Xe=-.4,Be=.83;return Ue.forEach(X=>{const je=lt(X.normal[0],X.normal[1],X.normal[2],h.yaw,h.pitch);if(je.z>.001){const _e=H[X.indices[0]],Me=H[X.indices[1]],Te=H[X.indices[2]],$e=H[X.indices[3]],Fe=`M${_e.x},${_e.y} L${Me.x},${Me.y} L${Te.x},${Te.y} L${$e.x},${$e.y} Z`,Oe=je.x*We+je.y*Xe+je.z*Be,He=p?.18:0,Ge=X.scale*(.82+.28*Math.max(0,Oe))+He;ze.push({name:X.name,d:Fe,fill:it(Ie,Ge)})}}),{...r,centerProj:ue,renderedFaces:ze}})},[T,h,R,s.length,ge,j,pe,ke]),G=l.useMemo(()=>[...te].sort((t,r)=>t.centerProj.z-r.centerProj.z),[te]),_=l.useMemo(()=>{if(G.length===0)return{minX:-100,minY:-100,maxX:100,maxY:100};let t=1/0,r=1/0,n=-1/0,i=-1/0;return G.forEach(m=>{const x=j*2,C=m.centerProj.x,M=m.centerProj.y;C-x<t&&(t=C-x),C+x>n&&(n=C+x),M-x<r&&(r=M-x),M+x>i&&(i=M+x)}),{minX:t,minY:r,maxX:n,maxY:i}},[G,j]),D=12,me=_.maxX-_.minX+D*2,a=_.maxY-_.minY+D*2,u=me/he,z=a/he,N=_.minX-D+(me-u)/2,W=_.minY-D+(a-z)/2,O=`${N} ${W} ${u} ${z}`;return T.length===0?e.jsx("div",{className:"py-8 text-center text-sm text-oai-gray-500",children:o("heatmap.empty")}):e.jsxs("div",{ref:F,className:`relative select-none outline-none ${c?"cursor-grab active:cursor-grabbing w-full h-full flex items-center justify-center":"w-full overflow-hidden flex justify-center"}`,onMouseDown:t=>{if(!c)return;ce(t.clientX,t.clientY);const r=i=>I(i.clientX,i.clientY),n=()=>{ve(),window.removeEventListener("mousemove",r),window.removeEventListener("mouseup",n)};window.addEventListener("mousemove",r),window.addEventListener("mouseup",n)},onTouchStart:t=>{!c||t.touches.length===0||ce(t.touches[0].clientX,t.touches[0].clientY)},onTouchMove:t=>{!c||t.touches.length===0||I(t.touches[0].clientX,t.touches[0].clientY)},onTouchEnd:()=>{c&&ve()},children:[e.jsxs("svg",{ref:Z,viewBox:O,width:c?"95%":"100%",height:c?"95%":"auto",role:"img","aria-label":o("heatmap.iso.aria")||"3D interactive activity heatmap",style:{display:"block",width:"100%",height:"auto",maxWidth:c?"none":`${me}px`,maxHeight:c?"78vh":"none"},className:"transition-transform duration-300 ease-out",children:[c&&fe.map(t=>e.jsx("path",{d:t.d,fill:"none",stroke:E,strokeWidth:.25,strokeDasharray:"1.5 2.5",strokeLinecap:"round"},t.key)),G.map(t=>{const r=g&&g.key===t.key;return e.jsxs("g",{onMouseEnter:n=>{if(y.current&&(clearTimeout(y.current),y.current=null),de(t),c&&Z.current){const i=q((t.col-s.length/2)*j,(t.row-3.5)*j,we(t.level),h.yaw,h.pitch);let m=0,x=0;const C=Z.current;if(F.current&&typeof C.createSVGPoint=="function"&&typeof C.getScreenCTM=="function")try{const w=C.createSVGPoint();w.x=i.x,w.y=i.y;const re=C.getScreenCTM();if(re){const H=w.matrixTransform(re),ue=F.current.getBoundingClientRect();m=H.x-ue.left,x=H.y-ue.top}}catch{const re=C.getBoundingClientRect(),H=_.maxX-_.minX+D*2,ue=_.maxY-_.minY+D*2;m=(i.x-(_.minX-D))/H*re.width,x=(i.y-(_.minY-D))/ue*re.height}else{const w=C.getBoundingClientRect(),re=_.maxX-_.minX+D*2,H=_.maxY-_.minY+D*2;m=(i.x-(_.minX-D))/re*w.width,x=(i.y-(_.minY-D))/H*w.height}const M=140;let k=0;const b=F.current?F.current.getBoundingClientRect().width:C.getBoundingClientRect().width;m<M?k=M-m:m>b-M&&(k=b-M-m),xe({x:m,y:x,shiftX:k})}},onMouseLeave:()=>{y.current&&clearTimeout(y.current),y.current=setTimeout(()=>{de(null)},150)},className:"transition-all duration-200",style:{filter:r?"brightness(1.15) drop-shadow(0 4px 6px rgba(0,0,0,0.15))":"none",cursor:c?"pointer":"default"},children:[!c&&t.day&&e.jsx("title",{children:o("heatmap.tooltip.tokens",{day:t.day,value:P(t.value)})}),t.renderedFaces.map((n,i)=>e.jsx("path",{d:n.d,fill:n.fill,stroke:n.fill,strokeWidth:.25,strokeLinejoin:"round"},i))]},t.key)})]}),c&&g&&e.jsxs("div",{onMouseEnter:()=>{y.current&&(clearTimeout(y.current),y.current=null)},onMouseLeave:()=>{y.current&&clearTimeout(y.current),y.current=setTimeout(()=>{de(null)},150)},className:"absolute z-[9999] w-0 h-0 transition-all duration-100 ease-out",style:{left:`${ee.x}px`,top:`${ee.y}px`},children:[e.jsxs("div",{className:"absolute left-0 bottom-[10px] backdrop-blur-md bg-white/90 dark:bg-oai-gray-900/90 border border-oai-gray-200/50 dark:border-oai-gray-800/50 shadow-xl rounded-xl p-3.5 max-w-[280px] min-w-[200px] flex flex-col gap-2 animate-in fade-in zoom-in-95 duration-100",style:{transform:`translateX(calc(-50% + ${ee.shiftX}px))`},children:[e.jsxs("div",{className:"flex items-center justify-between border-b border-oai-gray-100 dark:border-oai-gray-800/80 pb-1.5",children:[e.jsx("span",{className:"text-[11px] font-semibold text-oai-gray-500 dark:text-oai-gray-400",children:g.day}),(()=>{const t=g.level===0?p?"#9ca3af":"#6b7280":R[g.level];return e.jsx("span",{className:"text-[10px] px-2 py-0.5 rounded-full font-medium",style:{backgroundColor:t+"22",color:t,border:`1px solid ${t}44`},children:o("heatmap.tooltip.level",{level:g.level})})})()]}),e.jsxs("div",{className:"flex flex-col gap-2",children:[e.jsxs("div",{className:"flex items-baseline gap-1",children:[e.jsx("span",{title:P(g.value),className:"text-lg font-bold text-oai-gray-900 dark:text-white leading-none",children:Y(g.value)}),e.jsx("span",{className:"text-[10px] text-oai-gray-400 uppercase tracking-wider font-semibold",children:o("heatmap.unit.tokens")})]}),g.models&&Object.keys(g.models).length>0?e.jsxs("div",{className:"mt-1.5 border-t border-oai-gray-100 dark:border-oai-gray-800/60 pt-2 flex flex-col gap-1.5",children:[e.jsx("div",{className:"text-[10px] font-semibold text-oai-gray-400 dark:text-oai-gray-500 uppercase tracking-wider",children:o("heatmap.tooltip.model_breakdown")}),e.jsx("div",{className:"flex flex-col gap-2 max-h-[150px] overflow-y-auto pr-1.5 scrollbar-thin",children:Object.entries(g.models).map(([t,r])=>({name:t,val:Number(r)})).sort((t,r)=>r.val-t.val).map(({name:t,val:r})=>{const n=Number(g.value)||1,i=Math.round(r/n*100);return e.jsxs("div",{className:"flex flex-col gap-1",children:[e.jsxs("div",{className:"flex items-center justify-between text-[11px] gap-3",children:[e.jsx("span",{className:"font-medium text-oai-gray-750 dark:text-oai-gray-200 truncate max-w-[120px]",title:t,children:t}),e.jsxs("div",{className:"flex items-center gap-1.5 shrink-0",children:[e.jsx("span",{title:P(r),className:"font-mono text-oai-gray-900 dark:text-oai-gray-100 font-semibold",children:Y(r)}),e.jsxs("span",{className:"text-[9px] text-oai-gray-450 dark:text-oai-gray-500 min-w-[28px] text-right font-medium",children:[i,"%"]})]})]}),e.jsx("div",{className:"w-full h-1 bg-oai-gray-100 dark:bg-oai-gray-800/85 rounded-full overflow-hidden",children:e.jsx("div",{className:"h-full rounded-full transition-all duration-300",style:{width:`${i}%`,backgroundColor:R[4],boxShadow:`0 0 4px ${R[4]}55`}})})]},t)})})]}):e.jsx("p",{className:"text-[11px] text-oai-gray-600 dark:text-oai-gray-300 leading-relaxed font-normal mt-1 border-t border-dashed border-oai-gray-100 dark:border-oai-gray-800/60 pt-1.5",children:De(g.level,g.value,Y)})]})]}),e.jsx("div",{className:"absolute bottom-[6px] left-0 -translate-x-1/2 w-2.5 h-2.5 rotate-45 bg-white dark:bg-oai-gray-900 border-r border-b border-oai-gray-200/50 dark:border-oai-gray-800/50 shadow-sm",style:{marginBottom:"1px"}})]})]})}const ct=12,dt=3,mt=26,ut=["#ebedf0","#a7f3d0","#6ee7b7","#34d399","#10b981"],xt=["#121212","#065f46","#059669","#10b981","#34d399"];function pt(s){if(typeof s!="string")return null;const d=/^(\d{4})-(\d{2})-(\d{2})$/.exec(s.trim());if(!d)return null;const p=new Date(Date.UTC(Number(d[1]),Number(d[2])-1,Number(d[3])));return Number.isFinite(p.getTime())?p:null}function Ye(s,d){return new Date(Date.UTC(s.getUTCFullYear(),s.getUTCMonth(),s.getUTCDate()+d))}function ht(s,d){return Math.floor((Date.UTC(d.getUTCFullYear(),d.getUTCMonth(),d.getUTCDate())-Date.UTC(s.getUTCFullYear(),s.getUTCMonth(),s.getUTCDate()))/864e5)}function ft(s,d){const p=d==="mon"?1:0,c=s.getUTCDay();return Ye(s,-((c-p+7)%7))}function gt(s,d,p,c){if(!s)return[];const f=pt(d)||new Date,$=[];for(let E=11;E>=0;E-=1)$.push(new Date(Date.UTC(f.getUTCFullYear(),f.getUTCMonth()-E,1)));const Y=ft(f,p),P=Ye(Y,-(s-1)*7),A=[],R=new Set;for(const E of $){const S=Math.floor(ht(P,E)/7);S<0||S>=s||R.has(S)||(R.add(S),A.push({label:c[E.getUTCMonth()],index:S}))}return A}function Mt({heatmap:s,timeZoneLabel:d,timeZoneShortLabel:p,hideLegend:c=!1,embedded:f=!1}){const{resolvedTheme:$}=qe(),{currency:Y,rate:P}=et(),{formatTokens:A,formatTokensTooltip:R}=Ee(),E=$==="dark",S=E?xt:ut,K=l.useRef(null),h=l.useRef(null),[v,ie]=l.useState(null),[V,he]=l.useState({x:0,y:0,shiftX:0,flipY:!1}),L=l.useRef(null);l.useEffect(()=>()=>{L.current&&clearTimeout(L.current)},[]);const[j,fe]=l.useState(!1),[Z,F]=l.useState(!1),[B,le]=l.useState(!1),J=l.useRef(null),[U,oe]=l.useState("emerald"),ne=[o("heatmap.month.jan"),o("heatmap.month.feb"),o("heatmap.month.mar"),o("heatmap.month.apr"),o("heatmap.month.may"),o("heatmap.month.jun"),o("heatmap.month.jul"),o("heatmap.month.aug"),o("heatmap.month.sep"),o("heatmap.month.oct"),o("heatmap.month.nov"),o("heatmap.month.dec")],ge=(a,u)=>{if(!u||!u.day)return;L.current&&(clearTimeout(L.current),L.current=null),ie(u);const z=a.currentTarget.getBoundingClientRect(),N=typeof window<"u"?window.innerWidth:1024,W=z.left+z.width/2,O=z.top<300,t=O?z.bottom:z.top,r=140;let n=0;W<r?n=r-W:W>N-r&&(n=N-r-W),he({x:W,y:t,shiftX:n,flipY:O})},ye=()=>{L.current&&clearTimeout(L.current),L.current=setTimeout(()=>{ie(null)},150)},Q=()=>{F(!1),fe(!0)},se=()=>{F(!0)},be=a=>{a.target===a.currentTarget&&Z&&(fe(!1),F(!1))};l.useEffect(()=>{if(!j||Z)return;const a=u=>{u.key==="Escape"&&se()};return window.addEventListener("keydown",a),()=>{window.removeEventListener("keydown",a)}},[j,Z]);const ce=l.useMemo(()=>({emerald:{accentText:"text-emerald-500 dark:text-emerald-400",accentBg:"bg-emerald-500/10 dark:bg-emerald-400/10",accentBorder:"border-emerald-500/20 dark:border-emerald-400/15",hoverBorder:"hover:border-emerald-500/30 dark:hover:border-emerald-400/30",hoverGlow:"hover:shadow-[0_0_20px_-3px_rgba(16,185,129,0.15)] hover:dark:shadow-[0_0_20px_-3px_rgba(52,211,153,0.25)]",rawColor:"#10b981"},ocean:{accentText:"text-blue-500 dark:text-blue-400",accentBg:"bg-blue-500/10 dark:bg-blue-400/10",accentBorder:"border-blue-500/20 dark:border-blue-400/15",hoverBorder:"hover:border-blue-500/30 dark:hover:border-blue-400/30",hoverGlow:"hover:shadow-[0_0_20px_-3px_rgba(59,130,246,0.15)] hover:dark:shadow-[0_0_20px_-3px_rgba(96,165,250,0.25)]",rawColor:"#3b82f6"},neon:{accentText:"text-purple-500 dark:text-purple-400",accentBg:"bg-purple-500/10 dark:bg-purple-400/10",accentBorder:"border-purple-500/20 dark:border-purple-400/15",hoverBorder:"hover:border-purple-500/30 dark:hover:border-purple-400/30",hoverGlow:"hover:shadow-[0_0_20px_-3px_rgba(168,85,247,0.15)] hover:dark:shadow-[0_0_20px_-3px_rgba(192,132,252,0.25)]",rawColor:"#a855f7"},amber:{accentText:"text-amber-500 dark:text-amber-400",accentBg:"bg-amber-500/10 dark:bg-amber-400/10",accentBorder:"border-amber-500/20 dark:border-amber-400/15",hoverBorder:"hover:border-amber-500/30 dark:hover:border-amber-400/30",hoverGlow:"hover:shadow-[0_0_20px_-3px_rgba(245,158,11,0.15)] hover:dark:shadow-[0_0_20px_-3px_rgba(245,158,11,0.25)]",rawColor:"#f59e0b"}}),[]),I=ce[U]||ce.emerald,ve=ae[U]?E?ae[U].dark:ae[U].light:E?ae.emerald.dark:ae.emerald.light,[g,de]=l.useState(()=>{if(f)return"2d";try{return window.localStorage?.getItem("tt:heatmap-view")==="3d"?"3d":"2d"}catch{return"2d"}});l.useEffect(()=>{if(!f)try{window.localStorage?.setItem("tt:heatmap-view",g)}catch{}},[g,f]),l.useEffect(()=>{if(g!=="2d")return;const a=K.current;a&&(a.scrollLeft=a.scrollWidth)},[s?.weeks,g]),l.useEffect(()=>{const a=K.current;if(!a)return;const u=()=>{L.current&&(clearTimeout(L.current),L.current=null),ie(null)};return a.addEventListener("scroll",u),()=>a.removeEventListener("scroll",u)},[]);const ee=s?.week_starts_on==="mon"?"mon":"sun",xe=l.useMemo(()=>{const a=Array.isArray(s?.weeks)?s.weeks:[];if(!a.length)return{weeks:[]};const u=[];for(const z of a)for(const N of Array.isArray(z)?z:[])N?.day&&u.push({day:N.day,total_tokens:N.total_tokens??N.value??0,billable_total_tokens:N.billable_total_tokens??N.value??N.total_tokens??0,models:N.models??null});return Ke({dailyRows:u,weeks:Math.max(52,a.length),to:s?.to,weekStartsOn:ee})},[s?.to,s?.weeks,ee]),y=xe?.weeks||[],T=l.useMemo(()=>{let a=0,u=0,z={day:null,value:0},N=0,W=0;const O=[];y.forEach(k=>{(Array.isArray(k)?k:[]).forEach(b=>{b&&b.day&&O.push(b)})}),O.sort((k,b)=>k.day.localeCompare(b.day)),O.forEach(k=>{const b=Number(k.value)||0;a+=b,b>0?(u++,N++,N>W&&(W=N)):N=0,b>z.value&&(z={day:k.day,value:b})});const t=O.length||365,r=(u/t*100).toFixed(1);let n="heatmap.3d.modal.ai.eval.default",i="heatmap.3d.modal.ai.title.default";a>=15e6?(i="heatmap.3d.modal.ai.title.peak",n="heatmap.3d.modal.ai.eval.peak"):a>=5e6?(i="heatmap.3d.modal.ai.title.heavy",n="heatmap.3d.modal.ai.eval.heavy"):a>=1e6?(i="heatmap.3d.modal.ai.title.core",n="heatmap.3d.modal.ai.eval.core"):a>=2e4&&(i="heatmap.3d.modal.ai.title.steady",n="heatmap.3d.modal.ai.eval.steady");const m=s?.total_cost_usd,x=Number(m),M=m!=null&&(typeof m!="string"||m.trim()!=="")&&Number.isFinite(x)?x:a/15e5;return{totalTokens:a,activeDays:u,activeRate:r,maxSingleDay:z,maxStreak:W,aiEvaluationTitleKey:i,aiEvaluationKey:n,totalCostUsd:M}},[y,s?.total_cost_usd]),Ce=l.useMemo(()=>Ve(T.totalCostUsd,{currency:Y,rate:P}),[T.totalCostUsd,Y,P]),pe=a=>A(a,{mode:Qe.COMPACT,decimals:2}),ke=ee==="mon"?["Mon","Tue","Wed","Thu","Fri","Sat","Sun"].map(a=>o(`heatmap.day.${a.toLowerCase()}`)):["Sun","Mon","Tue","Wed","Thu","Fri","Sat"].map(a=>o(`heatmap.day.${a.toLowerCase()}`)),we=l.useMemo(()=>gt(y.length,xe?.to,ee,ne),[xe?.to,y.length,ee,ne]);if(!y.length)return e.jsx("div",{className:"py-8 text-center text-sm text-oai-gray-500",children:o("heatmap.empty")});const te=f?10:ct,G=f?2:dt,_=f?22:mt,D=_+y.length*te+Math.max(0,y.length-1)*G,me=`${_}px repeat(${y.length}, ${te}px)`;return e.jsxs("div",{ref:h,className:f?"relative":"relative rounded-xl border border-oai-gray-200 dark:border-oai-gray-800 bg-white dark:bg-oai-gray-900 p-5",children:[!f&&e.jsxs("div",{className:"flex items-baseline justify-between mb-3",children:[e.jsx("h3",{className:"text-sm font-medium text-oai-gray-500 dark:text-oai-gray-300 uppercase tracking-wide",children:o("heatmap.title")}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsxs("div",{role:"tablist","aria-label":"Heatmap view",className:"flex rounded-md border border-oai-gray-200 dark:border-oai-gray-800 p-0.5 text-[10px]",children:[e.jsx("button",{type:"button",role:"tab","aria-selected":g==="2d",onClick:()=>de("2d"),className:g==="2d"?"px-2 py-0.5 rounded bg-oai-gray-100 text-oai-black dark:bg-oai-gray-800 dark:text-oai-white font-medium":"px-2 py-0.5 rounded text-oai-gray-500 dark:text-oai-gray-400 hover:text-oai-gray-700 dark:hover:text-oai-gray-200",children:o("heatmap.view.2d")}),e.jsx("button",{type:"button",role:"tab","aria-selected":g==="3d",onClick:()=>de("3d"),className:g==="3d"?"px-2 py-0.5 rounded bg-oai-gray-100 text-oai-black dark:bg-oai-gray-800 dark:text-oai-white font-medium":"px-2 py-0.5 rounded text-oai-gray-500 dark:text-oai-gray-400 hover:text-oai-gray-700 dark:hover:text-oai-gray-200",children:o("heatmap.view.3d")})]}),e.jsx("span",{className:"text-xs text-oai-gray-400 dark:text-oai-gray-450",children:p||o("heatmap.legend.utc")})]})]}),g==="3d"&&e.jsxs("div",{onClick:Q,className:"cursor-pointer group relative overflow-hidden rounded-lg hover:border-oai-gray-350 dark:hover:border-oai-gray-700 border border-transparent transition-all",title:o("heatmap.3d.hover_tip"),children:[e.jsx(Ae,{weeks:y,isDark:E,palette:U}),e.jsx("div",{className:"absolute inset-0 bg-gradient-to-t from-oai-gray-900/5 to-transparent pointer-events-none opacity-0 group-hover:opacity-100 transition-opacity flex items-end justify-center pb-2",children:e.jsxs("span",{className:"text-[10px] bg-white/95 dark:bg-oai-gray-900/95 shadow border border-oai-gray-200/60 dark:border-oai-gray-800/80 px-2.5 py-1 rounded-full font-medium text-oai-gray-500 dark:text-oai-gray-400 flex items-center gap-1 transform translate-y-2 group-hover:translate-y-0 transition-transform duration-200",children:[e.jsx(tt,{size:9}),o("heatmap.3d.hover_tip")]})})]}),g==="2d"&&e.jsx("div",{ref:K,className:`overflow-x-auto overflow-y-hidden heatmap-scroll-thin${f?"":" pb-1"}`,children:e.jsxs("div",{style:{minWidth:D},children:[e.jsxs("div",{className:"grid text-[10px] uppercase text-oai-gray-400 dark:text-oai-gray-400 mb-1",style:{gridTemplateColumns:me,columnGap:G},children:[e.jsx("span",{}),we.map(a=>e.jsx("span",{style:{gridColumnStart:a.index+2},className:"whitespace-nowrap",children:a.label},`${a.label}-${a.index}`))]}),e.jsxs("div",{className:"grid",style:{gridTemplateColumns:me,columnGap:G},children:[e.jsx("div",{className:"grid text-[10px] text-oai-gray-400 dark:text-oai-gray-400 sticky left-0 bg-white dark:bg-oai-gray-900 pr-2",style:{gridTemplateRows:`repeat(7, ${te}px)`,rowGap:G},children:ke.map(a=>e.jsx("span",{className:"leading-none",children:a},a))}),e.jsx("div",{className:"grid",style:{gridAutoFlow:"column",gridTemplateRows:`repeat(7, ${te}px)`,gap:G},children:y.map((a,u)=>(Array.isArray(a)?a:[]).map((z,N)=>{if(!z)return null;const W=z.day||`e-${u}-${N}`,O=Number(z.level)||0,t=S[O]||S[0];return e.jsx("span",{onMouseEnter:r=>ge(r,z),onMouseLeave:ye,className:"rounded-[2px] transition-transform hover:scale-125 hover:z-10 cursor-pointer",style:{width:te,height:te,background:t}},W)}))})]})]})}),!c&&e.jsxs("div",{className:"flex items-center justify-center gap-2 mt-3",children:[e.jsx("span",{className:"text-[10px] text-oai-gray-400 dark:text-oai-gray-400",children:o("heatmap.legend.less")}),e.jsx("div",{className:"flex gap-0.5",children:S.map((a,u)=>e.jsx("span",{className:"rounded-[1px]",style:{width:10,height:10,background:a}},u))}),e.jsx("span",{className:"text-[10px] text-oai-gray-400 dark:text-oai-gray-400",children:o("heatmap.legend.more")})]}),j&&e.jsx("div",{onAnimationEnd:be,onClick:a=>{a.target===a.currentTarget&&se()},className:`fixed inset-0 z-50 flex items-center justify-center p-3 md:p-6 backdrop-blur-md bg-black/15 dark:bg-black/40 ${Z?"animate-tt-fade-out":"animate-tt-fade-in"}`,children:e.jsxs("div",{className:`relative w-full max-w-6xl h-[88vh] backdrop-blur-2xl bg-white/90 dark:bg-oai-gray-900/90 border border-oai-gray-200/50 dark:border-white/10 shadow-2xl rounded-2xl flex flex-col md:flex-row overflow-hidden ${Z?"animate-tt-modal-exit":"animate-tt-modal"}`,children:[e.jsx("button",{type:"button",onClick:se,className:"absolute top-4 right-4 z-50 p-2 rounded-full border border-oai-gray-200/60 dark:border-oai-gray-800/60 bg-white/50 dark:bg-oai-gray-900/50 text-oai-gray-500 dark:text-oai-gray-400 hover:text-oai-gray-900 dark:hover:text-white hover:rotate-90 hover:scale-105 active:scale-95 transition-all duration-300",children:e.jsx(Ze,{size:16})}),e.jsxs("div",{className:"w-full md:w-[340px] border-b md:border-b-0 md:border-r border-zinc-200/50 dark:border-zinc-800/40 p-5 md:p-6 flex flex-col gap-6 overflow-y-auto backdrop-blur-md bg-zinc-50/50 dark:bg-zinc-950/50",children:[e.jsxs("div",{children:[e.jsxs("div",{className:"flex items-center gap-1.5 select-none",children:[e.jsxs("span",{className:"relative flex h-1.5 w-1.5",children:[e.jsx("span",{className:"animate-ping absolute inline-flex h-full w-full rounded-full opacity-75",style:{backgroundColor:I.rawColor}}),e.jsx("span",{className:"relative inline-flex rounded-full h-1.5 w-1.5",style:{backgroundColor:I.rawColor}})]}),e.jsx("span",{className:"text-[9px] font-extrabold uppercase tracking-widest font-mono text-zinc-400 dark:text-zinc-500",children:o("heatmap.3d.modal.eyebrow")})]}),e.jsx("h4",{className:"text-xl font-black text-zinc-900 dark:text-zinc-50 tracking-tight leading-none mt-2 select-none",children:o("heatmap.3d.modal.title")}),e.jsx("p",{className:"text-[11px] leading-relaxed text-zinc-400 dark:text-zinc-500 mt-2 font-normal select-none",children:o("heatmap.3d.modal.desc")})]}),e.jsxs("div",{className:"grid grid-cols-2 gap-x-5 gap-y-5 border-y border-zinc-200/50 dark:border-zinc-800/50 py-5 select-none",children:[e.jsxs("div",{className:"flex flex-col gap-1 relative group cursor-help",children:[e.jsx("div",{className:"absolute left-0 bottom-full mb-2 pointer-events-none opacity-0 translate-y-1 group-hover:opacity-100 group-hover:translate-y-0 transition-all duration-200 z-50",children:e.jsxs("div",{className:"bg-white dark:bg-zinc-950 text-zinc-900 dark:text-zinc-50 text-[10px] font-semibold font-mono rounded-lg px-2.5 py-1.5 shadow-xl border border-zinc-200 dark:border-zinc-800/80 whitespace-nowrap flex flex-col",children:[e.jsx("span",{className:"text-[9px] text-zinc-400 dark:text-zinc-500",children:o("heatmap.3d.modal.stats.precision_total_tokens")}),e.jsxs("span",{className:"mt-0.5 font-bold text-zinc-900 dark:text-zinc-50",children:[R(T.totalTokens)," ",o("heatmap.unit.tokens")]})]})}),e.jsx("span",{className:"text-[9px] font-bold text-zinc-400 dark:text-zinc-500 uppercase tracking-widest font-mono",children:o("heatmap.3d.modal.stats.total_tokens")}),e.jsxs("div",{className:"flex items-baseline gap-1.5",children:[e.jsx("span",{className:"text-xl font-black text-zinc-900 dark:text-zinc-50 tracking-tight font-mono transition-transform duration-200 group-hover:-translate-y-[1px]",children:pe(T.totalTokens)}),e.jsx("div",{className:"opacity-30 group-hover:opacity-60 transition-opacity",children:e.jsx("svg",{width:"24",height:"10",viewBox:"0 0 24 10",fill:"none",children:e.jsx("path",{d:"M1 9C3 7 5 7 7 4C9 1 11 0 13 2C15 4 17 0 23 0",stroke:I.rawColor,strokeWidth:"1.2",strokeLinecap:"round",strokeLinejoin:"round"})})})]})]}),e.jsxs("div",{className:"flex flex-col gap-1 group cursor-default",children:[e.jsx("span",{className:"text-[9px] font-bold text-zinc-400 dark:text-zinc-500 uppercase tracking-widest font-mono",children:o("heatmap.3d.modal.stats.estimated_cost")}),e.jsx("span",{className:"text-xl font-black text-zinc-900 dark:text-zinc-50 tracking-tight font-mono transition-transform duration-200 group-hover:-translate-y-[1px]",children:Ce})]}),e.jsxs("div",{className:"flex flex-col gap-1 group cursor-default",children:[e.jsx("span",{className:"text-[9px] font-bold text-zinc-400 dark:text-zinc-500 uppercase tracking-widest font-mono",children:o("heatmap.3d.modal.stats.active_rate_days")}),e.jsxs("span",{className:"text-xl font-black text-zinc-900 dark:text-zinc-50 tracking-tight font-mono transition-transform duration-200 group-hover:-translate-y-[1px]",children:[T.activeRate,"%"," ",e.jsxs("span",{className:"text-[10px] font-bold text-zinc-400 dark:text-zinc-500 font-mono",children:["(",T.activeDays,o("heatmap.3d.modal.stats.days_suffix"),")"]})]})]}),e.jsxs("div",{className:"flex flex-col gap-1 group cursor-default",children:[e.jsx("span",{className:"text-[9px] font-bold text-zinc-400 dark:text-zinc-500 uppercase tracking-widest font-mono",children:o("heatmap.3d.modal.stats.max_streak")}),e.jsxs("span",{className:"text-xl font-black text-amber-500 tracking-tight font-mono transition-transform duration-200 group-hover:-translate-y-[1px]",children:[T.maxStreak," ",e.jsx("span",{className:"text-[10px] font-bold text-amber-500/80 font-mono",children:o("heatmap.3d.modal.stats.days_suffix")})]})]}),e.jsxs("div",{className:"flex flex-col gap-1 col-span-2 relative group cursor-help",children:[e.jsx("div",{className:"absolute left-0 bottom-full mb-2 pointer-events-none opacity-0 translate-y-1 group-hover:opacity-100 group-hover:translate-y-0 transition-all duration-200 z-50",children:e.jsxs("div",{className:"bg-white dark:bg-zinc-950 text-zinc-900 dark:text-zinc-50 text-[10px] font-semibold font-mono rounded-lg px-2.5 py-1.5 shadow-xl border border-zinc-200 dark:border-zinc-800/80 whitespace-nowrap flex flex-col",children:[e.jsx("span",{className:"text-[9px] text-zinc-400 dark:text-zinc-500",children:o("heatmap.3d.modal.stats.precision_peak_value")}),e.jsx("span",{className:"mt-0.5 font-bold text-zinc-900 dark:text-zinc-50",children:T.maxSingleDay.value>0?`${R(T.maxSingleDay.value)} ${o("heatmap.unit.tokens")}`:o("heatmap.3d.modal.stats.no_data")}),e.jsx("span",{className:"text-[8px] text-zinc-400 dark:text-zinc-500 mt-0.5",children:T.maxSingleDay.day||o("heatmap.3d.modal.stats.no_data")})]})}),e.jsx("span",{className:"text-[9px] font-bold text-zinc-400 dark:text-zinc-500 uppercase tracking-widest font-mono",children:o("heatmap.3d.modal.stats.peak_day")}),e.jsxs("span",{className:"text-xl font-black text-zinc-900 dark:text-zinc-50 tracking-tight font-mono transition-transform duration-200 group-hover:-translate-y-[1px]",children:[T.maxSingleDay.value>0?pe(T.maxSingleDay.value):o("heatmap.3d.modal.stats.no_data")," ",e.jsxs("span",{className:"text-[10px] font-bold text-zinc-400 dark:text-zinc-500 font-mono",children:["(",T.maxSingleDay.day||o("heatmap.3d.modal.stats.no_data"),")"]})]})]})]}),e.jsxs("div",{className:"flex flex-col gap-2.5 py-1",children:[e.jsxs("div",{className:"flex items-center gap-1.5 select-none",children:[e.jsx(at,{size:11,style:{color:I.rawColor}}),e.jsx("span",{className:"text-[9px] font-extrabold uppercase tracking-widest font-mono",style:{color:I.rawColor},children:o(T.aiEvaluationTitleKey)})]}),e.jsxs("div",{className:"pl-3.5 border-l-2 relative transition-all duration-300 group",style:{borderColor:I.rawColor},children:[e.jsx("div",{className:"absolute inset-y-0 left-0 w-[3px] blur-[2px] opacity-15 pointer-events-none rounded-full",style:{backgroundColor:I.rawColor}}),e.jsx("p",{className:"text-[11px] leading-relaxed text-zinc-600 dark:text-zinc-400 font-normal",children:o(T.aiEvaluationKey)})]})]}),e.jsx("div",{className:"mt-auto border-t border-zinc-200/50 dark:border-zinc-800/50 pt-4 select-none",children:e.jsxs("div",{className:"flex flex-col gap-2",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx("span",{className:"text-[9px] font-bold text-zinc-400 dark:text-zinc-500 uppercase tracking-widest font-mono",children:o("heatmap.3d.modal.legend.title")}),e.jsx("span",{className:"text-[10px] font-medium text-zinc-500 dark:text-zinc-400",children:o(`heatmap.3d.modal.palette.${U}`)})]}),e.jsx("div",{className:"flex gap-1",children:ve.map((a,u)=>e.jsx("div",{className:"flex-1 h-1 rounded-[2px]",style:{backgroundColor:a},title:o("heatmap.tooltip.level",{level:u})},u))})]})})]}),e.jsxs("div",{className:"flex-1 h-full relative flex items-center justify-center overflow-hidden p-4",children:[e.jsx("div",{className:"absolute top-1/4 left-1/3 w-96 h-96 rounded-full blur-[130px] pointer-events-none -translate-x-1/2 -translate-y-1/2 transition-all duration-500",style:{backgroundColor:I.rawColor+"15"}}),e.jsx("div",{className:"absolute bottom-1/4 right-1/3 w-80 h-80 rounded-full blur-[120px] pointer-events-none translate-x-1/2 translate-y-1/2 bg-purple-500/[0.04] dark:bg-purple-500/[0.08]"}),e.jsxs("div",{className:"absolute top-4 left-1/2 -translate-x-1/2 flex items-center gap-3 p-1.5 backdrop-blur-md bg-white/70 dark:bg-oai-gray-900/75 border border-oai-gray-200/60 dark:border-oai-gray-800/80 rounded-full shadow-lg z-30 select-none",children:[e.jsx("div",{className:"flex items-center gap-1.5 px-2",children:Object.keys(ce).map(a=>{const u=U===a;return e.jsx("button",{type:"button",onClick:()=>oe(a),title:o(`heatmap.3d.modal.palette.${a}`),className:`w-3.5 h-3.5 rounded-full transition-all duration-200 relative hover:scale-125 ${a==="emerald"?"bg-[#10b981]":a==="ocean"?"bg-[#3b82f6]":a==="neon"?"bg-[#a855f7]":"bg-[#f59e0b]"}`,children:u&&e.jsx("span",{className:"absolute inset-0 rounded-full ring-2 ring-offset-1 ring-offset-white dark:ring-offset-oai-gray-900 ring-oai-gray-900 dark:ring-white scale-110"})},a)})}),e.jsx("div",{className:"w-[1px] h-4 bg-oai-gray-200 dark:bg-oai-gray-800"}),e.jsxs("div",{className:"flex items-center gap-1 pr-1",children:[e.jsx("button",{type:"button",onClick:()=>{const a=!B;le(a),J.current&&J.current.toggleAutoRotate(a)},title:B?o("heatmap.3d.modal.control.pause"):o("heatmap.3d.modal.control.play"),className:`p-1.5 rounded-full transition-all duration-200 hover:bg-oai-gray-100 dark:hover:bg-oai-gray-800 ${B?I.accentText:"text-oai-gray-400 hover:text-oai-gray-600 dark:hover:text-oai-gray-250"}`,children:B?e.jsx(ot,{size:12}):e.jsx(nt,{size:12})}),e.jsx("button",{type:"button",onClick:()=>{le(!1),J.current&&J.current.reset()},title:o("heatmap.3d.modal.control.reset"),className:"p-1.5 rounded-full text-oai-gray-400 hover:text-oai-gray-600 dark:hover:text-oai-gray-250 hover:bg-oai-gray-100 dark:hover:bg-oai-gray-800 transition-all duration-200",children:e.jsx(st,{size:12})})]})]}),e.jsx(Ae,{weeks:y,isDark:E,interactive:!0,palette:U,autoRotateInit:B,onResetViewRef:J}),e.jsxs("div",{className:"absolute bottom-4 right-4 flex items-center gap-1.5 text-[9px] font-bold text-oai-gray-400 bg-white/80 dark:bg-oai-gray-900/80 border border-oai-gray-200/50 dark:border-oai-gray-800/80 rounded-md px-2.5 py-1.5 select-none pointer-events-none backdrop-blur-md shadow-sm",children:[e.jsx(rt,{size:10,className:I.accentText}),e.jsx("span",{children:o("heatmap.3d.modal.footer.tip")})]})]})]})}),v&&!j&&typeof document<"u"&&Je.createPortal(e.jsxs("div",{className:"fixed z-[9999] w-0 h-0 transition-all duration-100 ease-out pointer-events-none",style:{position:"fixed",left:`${V.x}px`,top:`${V.y}px`},children:[e.jsxs("div",{className:`absolute left-0 ${V.flipY?"top-[10px]":"bottom-[10px]"} backdrop-blur-md bg-white/95 dark:bg-oai-gray-900/95 border border-oai-gray-200/50 dark:border-oai-gray-800/50 shadow-xl rounded-xl p-3.5 max-w-[280px] min-w-[200px] flex flex-col gap-2 animate-in fade-in zoom-in-95 duration-100`,style:{transform:`translateX(calc(-50% + ${V.shiftX}px))`},children:[e.jsxs("div",{className:"flex items-center justify-between border-b border-oai-gray-100 dark:border-oai-gray-800/80 pb-1.5",children:[e.jsx("span",{className:"text-[11px] font-semibold text-oai-gray-500 dark:text-oai-gray-400",children:v.day}),(()=>{const a=v.level===0?E?"#9ca3af":"#6b7280":S[v.level];return e.jsx("span",{className:"text-[10px] px-2 py-0.5 rounded-full font-medium",style:{backgroundColor:a+"22",color:a,border:`1px solid ${a}44`},children:o("heatmap.tooltip.level",{level:v.level})})})()]}),e.jsxs("div",{className:"flex flex-col gap-2",children:[e.jsxs("div",{className:"flex items-baseline gap-1",children:[e.jsx("span",{title:R(v.total_tokens??v.value),className:"text-lg font-bold text-oai-gray-900 dark:text-white leading-none",children:A(v.total_tokens??v.value)}),e.jsx("span",{className:"text-[10px] text-oai-gray-400 uppercase tracking-wider font-semibold",children:o("heatmap.unit.tokens")})]}),v.models&&Object.keys(v.models).length>0?e.jsxs("div",{className:"mt-1.5 border-t border-oai-gray-100 dark:border-oai-gray-800/60 pt-2 flex flex-col gap-1.5",children:[e.jsx("div",{className:"text-[10px] font-semibold text-oai-gray-400 dark:text-oai-gray-500 uppercase tracking-wider",children:o("heatmap.tooltip.model_breakdown")}),e.jsx("div",{className:"flex flex-col gap-2 max-h-[150px] overflow-y-auto pr-1.5 oai-scrollbar",children:Object.entries(v.models).map(([a,u])=>({name:a,val:Number(u)})).sort((a,u)=>u.val-a.val).map(({name:a,val:u})=>{const z=Number(v.total_tokens??v.value)||1,N=Math.round(u/z*100);return e.jsxs("div",{className:"flex flex-col gap-1",children:[e.jsxs("div",{className:"flex items-center justify-between text-[11px] gap-3",children:[e.jsx("span",{className:"font-medium text-oai-gray-750 dark:text-oai-gray-200 truncate max-w-[120px]",title:a,children:a}),e.jsxs("div",{className:"flex items-center gap-1.5 shrink-0",children:[e.jsx("span",{title:R(u),className:"font-mono text-oai-gray-900 dark:text-oai-gray-100 font-semibold",children:A(u)}),e.jsxs("span",{className:"text-[9px] text-oai-gray-450 dark:text-oai-gray-500 min-w-[28px] text-right font-medium",children:[N,"%"]})]})]}),e.jsx("div",{className:"w-full h-1 bg-oai-gray-100 dark:bg-oai-gray-800/85 rounded-full overflow-hidden",children:e.jsx("div",{className:"h-full rounded-full transition-all duration-300",style:{width:`${N}%`,backgroundColor:S[4],boxShadow:`0 0 4px ${S[4]}55`}})})]},a)})})]}):e.jsx("p",{className:"text-[11px] text-oai-gray-600 dark:text-oai-gray-300 leading-relaxed font-normal mt-1 border-t border-dashed border-oai-gray-100 dark:border-oai-gray-800/60 pt-1.5",children:De(v.level,v.total_tokens??v.value,A)})]})]}),e.jsx("div",{className:`absolute left-0 -translate-x-1/2 w-2.5 h-2.5 rotate-45 bg-white dark:bg-oai-gray-900 shadow-sm ${V.flipY?"top-[6px] border-l border-t":"bottom-[6px] border-r border-b"} border-oai-gray-200/50 dark:border-oai-gray-800/50`,style:V.flipY?{marginTop:"1px"}:{marginBottom:"1px"}})]}),document.body),e.jsx("style",{children:`
2
2
  @keyframes tt-fade-in {
3
3
  from { opacity: 0; }
4
4
  to { opacity: 1; }