tokentracker-cli 1.3.3 → 1.3.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (156) hide show
  1. package/THIRD_PARTY_NOTICES.md +92 -0
  2. package/dashboard/dist/THIRD_PARTY_NOTICES.txt +92 -0
  3. package/dashboard/dist/assets/AchievementBadge-CKjtQp-U.js +1 -0
  4. package/dashboard/dist/assets/AchievementsPage-DpOXrabE.js +2 -0
  5. package/dashboard/dist/assets/{AchievementsSection-CDUUEfIi.js → AchievementsSection-DiXyIoa0.js} +1 -1
  6. package/dashboard/dist/assets/BadgeDetailModal-CILTTkPF.js +1 -0
  7. package/dashboard/dist/assets/{BotAnimated-Dx_vvTtC.js → BotAnimated-CrBHWiRi.js} +1 -1
  8. package/dashboard/dist/assets/Card-DUItW3xI.js +1 -0
  9. package/dashboard/dist/assets/CloudCheckoutPage-C_t_PDlG.js +1 -0
  10. package/dashboard/dist/assets/CloudPage-pvJUrhya.js +1 -0
  11. package/dashboard/dist/assets/CloudUsageExport-DQbDwiyk.js +4 -0
  12. package/dashboard/dist/assets/CommandPalette-BvHilrbV.js +1 -0
  13. package/dashboard/dist/assets/CommunityStatsModal-CizxEYv-.js +1 -0
  14. package/dashboard/dist/assets/{ConfirmModal-BQ-xB1S_.js → ConfirmModal-h9nISVy7.js} +1 -1
  15. package/dashboard/dist/assets/Controls-BjdIonTX.js +1 -0
  16. package/dashboard/dist/assets/DashboardPage-Bxryr4qp.js +1 -0
  17. package/dashboard/dist/assets/DateRangePopover-DpKh-0l8.js +1 -0
  18. package/dashboard/dist/assets/{DevicePage-Dg6XkIaY.js → DevicePage-DUJR9hJC.js} +1 -1
  19. package/dashboard/dist/assets/DialogClose-BmVAmN-o.js +1 -0
  20. package/dashboard/dist/assets/DialogDescription-C0Cgq67g.js +1 -0
  21. package/dashboard/dist/assets/DialogTitle-BsaIbN8k.js +1 -0
  22. package/dashboard/dist/assets/{FadeIn-ChVf45WW.js → FadeIn-BpSt2P_W.js} +1 -1
  23. package/dashboard/dist/assets/{HeaderGithubStar-B740_G7a.js → HeaderGithubStar-Cc_VHB0R.js} +1 -1
  24. package/dashboard/dist/assets/{HoverTooltip-BzP5FudR.js → HoverTooltip-WFd21iP9.js} +1 -1
  25. package/dashboard/dist/assets/{IpCheckPage-BuZH3F14.js → IpCheckPage-C_mUPSRB.js} +1 -1
  26. package/dashboard/dist/assets/LandingPage-DVR8ClZO.js +2 -0
  27. package/dashboard/dist/assets/LeaderboardPage-D8ydzVpn.js +2 -0
  28. package/dashboard/dist/assets/LeaderboardProBadge-BjX4EFl2.js +1 -0
  29. package/dashboard/dist/assets/{LeaderboardProfileModal-OUZvO6u-.js → LeaderboardProfileModal-vbPMNn7W.js} +4 -4
  30. package/dashboard/dist/assets/{LeaderboardProfilePage-bHI1oTEK.js → LeaderboardProfilePage-CqClmuA-.js} +2 -2
  31. package/dashboard/dist/assets/{LimitsPage-DKojB73_.js → LimitsPage-DaRggHge.js} +2 -2
  32. package/dashboard/dist/assets/{LocalOnlyNotice-BaEq6qN7.js → LocalOnlyNotice-B6nDke_u.js} +1 -1
  33. package/dashboard/dist/assets/LoginCard-C28QVjd7.js +1 -0
  34. package/dashboard/dist/assets/LoginModal-Bx1btNhH.js +1 -0
  35. package/dashboard/dist/assets/LoginPage-DVOGNGYI.js +1 -0
  36. package/dashboard/dist/assets/{PetPage-BPBsUHyL.js → PetPage-nOKryTde.js} +1 -1
  37. package/dashboard/dist/assets/PopoverPopup-Ch6NLnu6.js +1 -0
  38. package/dashboard/dist/assets/{ProviderIcon-BshO2uER.js → ProviderIcon-BRY2br-g.js} +1 -1
  39. package/dashboard/dist/assets/{ResetPasswordPage-RTFTD8Dr.js → ResetPasswordPage-ko1OQecQ.js} +1 -1
  40. package/dashboard/dist/assets/Select-Q8mS3_od.js +1 -0
  41. package/dashboard/dist/assets/SelectItemText-C1id8GDj.js +1 -0
  42. package/dashboard/dist/assets/{SelfHostPage-BlwTt8XM.js → SelfHostPage-Dzb2bDiM.js} +1 -1
  43. package/dashboard/dist/assets/{ServiceStatusPage-BkIcJpYK.js → ServiceStatusPage-ewFwz29J.js} +1 -1
  44. package/dashboard/dist/assets/SessionsPage-C6Y8kbnM.js +3 -0
  45. package/dashboard/dist/assets/SessionsPage-GV2fuNmd.css +1 -0
  46. package/dashboard/dist/assets/SettingsPage-nztCXEPs.js +2 -0
  47. package/dashboard/dist/assets/SkillsPage-CcG77tqU.js +1 -0
  48. package/dashboard/dist/assets/{TokenGalaxy-DiXUpXKF.js → TokenGalaxy-D2HDrbQR.js} +1 -1
  49. package/dashboard/dist/assets/TooltipPopup-C_bF2ZwO.js +1 -0
  50. package/dashboard/dist/assets/TrendMonitor-BcyoN5ns.js +19 -0
  51. package/dashboard/dist/assets/WidgetsPage-BirK0U_N.js +1 -0
  52. package/dashboard/dist/assets/{WrappedPage-ClEo-RmR.js → WrappedPage-thsXBuw6.js} +1 -1
  53. package/dashboard/dist/assets/__vite-browser-external-Bq8nj-JV.js +45 -0
  54. package/dashboard/dist/assets/__vite-browser-external-BwmeEfv7.css +1 -0
  55. package/dashboard/dist/assets/agent-logos-CK6SzhI7.js +1 -0
  56. package/dashboard/dist/assets/arrow-left-c_NOSfoq.js +1 -0
  57. package/dashboard/dist/assets/{arrow-right-CwBz5dwb.js → arrow-right-CP7drKCT.js} +1 -1
  58. package/dashboard/dist/assets/{arrow-up-right-jPmRN562.js → arrow-up-right-DQ6QfCpo.js} +1 -1
  59. package/dashboard/dist/assets/calendar-days-D_pxFQvT.js +1 -0
  60. package/dashboard/dist/assets/{check-CKwHc4Hv.js → check-HAS31kTT.js} +1 -1
  61. package/dashboard/dist/assets/chevron-down-BIMuk6oN.js +1 -0
  62. package/dashboard/dist/assets/cloud-checkout-COmDwrUT.js +1 -0
  63. package/dashboard/dist/assets/composite-kLwqpqEk.js +1 -0
  64. package/dashboard/dist/assets/download-9RgsZIiH.js +1 -0
  65. package/dashboard/dist/assets/{external-link-B5yXxdPy.js → external-link-C_gYjHGF.js} +1 -1
  66. package/dashboard/dist/assets/{flame-CKjAluj_.js → flame-BSsCvgT8.js} +1 -1
  67. package/dashboard/dist/assets/{format-tokens-mk49THtv.js → format-tokens-N22Wqv1X.js} +1 -1
  68. package/dashboard/dist/assets/{host-mode-efKlSYjX.js → host-mode-JzrhHX7F.js} +1 -1
  69. package/dashboard/dist/assets/{icons-ZB1ZthjH.js → icons-pK99mIMv.js} +1 -1
  70. package/dashboard/dist/assets/{index-DweUMAUD.js → index-BhviBroj.js} +1 -1
  71. package/dashboard/dist/assets/{index-BImBG3eS.js → index-CmD84EJi.js} +1 -1
  72. package/dashboard/dist/assets/{index-BgdM7kBl.js → index-Dk43KNa6.js} +1 -1
  73. package/dashboard/dist/assets/info-D-RLFnSK.js +1 -0
  74. package/dashboard/dist/assets/{link-2-Dn2soiyd.js → link-2-BiKXW9mV.js} +1 -1
  75. package/dashboard/dist/assets/{loader-circle-CNT630zn.js → loader-circle-KVUaEKV2.js} +1 -1
  76. package/dashboard/dist/assets/{modifiers.esm-WPx0bc2K.js → modifiers.esm-5NK8j3mT.js} +1 -1
  77. package/dashboard/dist/assets/monitor-smartphone-u9yr-_Es.js +1 -0
  78. package/dashboard/dist/assets/play-D0MaDCOx.js +1 -0
  79. package/dashboard/dist/assets/plus-DTJVtoAJ.js +1 -0
  80. package/dashboard/dist/assets/provider-display-YhtG0I9Y.js +42 -0
  81. package/dashboard/dist/assets/{react-B7SkZTgg.js → react-gIVxucOB.js} +1 -1
  82. package/dashboard/dist/assets/safePolygon-C_sPnJ1L.js +1 -0
  83. package/dashboard/dist/assets/{search-Ol3OZBm4.js → search-DdQRwFYV.js} +1 -1
  84. package/dashboard/dist/assets/{server-DFCbznC7.js → server-M0rmbGWy.js} +1 -1
  85. package/dashboard/dist/assets/{shield-check-YcmLwVZ6.js → shield-check-9-sqQKdD.js} +1 -1
  86. package/dashboard/dist/assets/{skills-api-C-9vK884.js → skills-api-B0qBWnuK.js} +1 -1
  87. package/dashboard/dist/assets/{sortable.esm-CKC9NuR-.js → sortable.esm-iqbm7x5D.js} +1 -1
  88. package/dashboard/dist/assets/store-DstuWd4a.js +1 -0
  89. package/dashboard/dist/assets/{terminal-B3_fCLFs.js → terminal-Dz0MxHNG.js} +1 -1
  90. package/dashboard/dist/assets/{trash-CZGfgbFa.js → trash-DBMFOFVz.js} +1 -1
  91. package/dashboard/dist/assets/{use-community-stats-CW-qkYn7.js → use-community-stats-CacbAcUR.js} +1 -1
  92. package/dashboard/dist/assets/{use-latest-request-guard-DHv7vfFE.js → use-latest-request-guard-nBuQVZOR.js} +1 -1
  93. package/dashboard/dist/assets/use-limits-display-prefs-fqg8hs6b.js +1 -0
  94. package/dashboard/dist/assets/{use-native-settings-CWiLqfZh.js → use-native-settings-EAqAFx2x.js} +1 -1
  95. package/dashboard/dist/assets/{use-ordered-list-Df8pw-WJ.js → use-ordered-list-DGLjjU6Q.js} +1 -1
  96. package/dashboard/dist/assets/use-pet-settings-C5MzWHE7.js +2 -0
  97. package/dashboard/dist/assets/use-reduced-motion-DK2oZ2uC.js +1 -0
  98. package/dashboard/dist/assets/{use-transform-BHwEAfmO.js → use-transform-C25eCuz_.js} +1 -1
  99. package/dashboard/dist/assets/{use-usage-limits-CSxFFn3_.js → use-usage-limits-BhqnEai3.js} +1 -1
  100. package/dashboard/dist/assets/{useCurrency-pwClnCZ5.js → useCurrency-t3PYQi1l.js} +1 -1
  101. package/dashboard/dist/assets/usePositioner-C59mj6kG.js +1 -0
  102. package/dashboard/dist/assets/{useTokenFormat-BMvVAe6V.js → useTokenFormat-C0xQsBGf.js} +1 -1
  103. package/dashboard/dist/assets/zap-CyH0tvKM.js +1 -0
  104. package/dashboard/dist/index.html +2 -2
  105. package/dashboard/dist/ip-check.html +2 -2
  106. package/dashboard/dist/leaderboard.html +2 -2
  107. package/dashboard/dist/share.html +2 -2
  108. package/package.json +2 -1
  109. package/src/lib/pricing/seed-snapshot.json +1 -1
  110. package/dashboard/dist/assets/AchievementBadge-BaqdyZaV.js +0 -1
  111. package/dashboard/dist/assets/AchievementsPage-B4Ju0guv.js +0 -2
  112. package/dashboard/dist/assets/BadgeDetailModal-B-XMJAvL.js +0 -1
  113. package/dashboard/dist/assets/Card-D-5mABVt.js +0 -1
  114. package/dashboard/dist/assets/CloudCheckoutPage-BELoh56h.js +0 -1
  115. package/dashboard/dist/assets/CloudPage-CfBruNxe.js +0 -1
  116. package/dashboard/dist/assets/CloudUsageExport-BoFU7xCT.js +0 -4
  117. package/dashboard/dist/assets/CommandPalette-BmmKZWn-.js +0 -1
  118. package/dashboard/dist/assets/CommunityStatsModal-BF77zVhN.js +0 -1
  119. package/dashboard/dist/assets/Controls-BnTeX7T4.js +0 -1
  120. package/dashboard/dist/assets/DashboardPage-BWulHa5J.js +0 -1
  121. package/dashboard/dist/assets/DialogClose-DAyilsH-.js +0 -1
  122. package/dashboard/dist/assets/DialogDescription-j4XnRy6y.js +0 -1
  123. package/dashboard/dist/assets/DialogTitle-B1iNGD2S.js +0 -1
  124. package/dashboard/dist/assets/LandingPage-Dtgq_caz.js +0 -2
  125. package/dashboard/dist/assets/LeaderboardPage-Di1kEg2O.js +0 -2
  126. package/dashboard/dist/assets/LeaderboardProBadge-h8FfR0au.js +0 -1
  127. package/dashboard/dist/assets/LoginCard-Dn5Xy4If.js +0 -1
  128. package/dashboard/dist/assets/LoginModal-C5h-5GOA.js +0 -1
  129. package/dashboard/dist/assets/LoginPage-BpX8Tgjj.js +0 -1
  130. package/dashboard/dist/assets/PopoverPopup-CVTiEVHs.js +0 -1
  131. package/dashboard/dist/assets/Select-CtTceC4T.js +0 -1
  132. package/dashboard/dist/assets/SelectItemText-C7xi8iGp.js +0 -1
  133. package/dashboard/dist/assets/SessionsPage-BngTWN7Q.css +0 -1
  134. package/dashboard/dist/assets/SessionsPage-okHobk_L.js +0 -3
  135. package/dashboard/dist/assets/SettingsPage-C-cc6wcF.js +0 -2
  136. package/dashboard/dist/assets/SkillsPage-D2LlKKJN.js +0 -1
  137. package/dashboard/dist/assets/TrendMonitor-C88S-5aa.js +0 -19
  138. package/dashboard/dist/assets/WidgetsPage-WsEFPNwp.js +0 -1
  139. package/dashboard/dist/assets/__vite-browser-external-DFRX9dp-.css +0 -1
  140. package/dashboard/dist/assets/__vite-browser-external-DUJeOWgd.js +0 -45
  141. package/dashboard/dist/assets/agent-logos-BM9jlReI.js +0 -1
  142. package/dashboard/dist/assets/arrow-left-BEM-HVmC.js +0 -1
  143. package/dashboard/dist/assets/cloud-checkout-nYNHDFoR.js +0 -1
  144. package/dashboard/dist/assets/composite-B4Z3F65o.js +0 -1
  145. package/dashboard/dist/assets/download-CJUnX1Bs.js +0 -1
  146. package/dashboard/dist/assets/info-CyDY7NYM.js +0 -1
  147. package/dashboard/dist/assets/monitor-smartphone-C-qC0RAt.js +0 -1
  148. package/dashboard/dist/assets/plus-Cx82jb7o.js +0 -1
  149. package/dashboard/dist/assets/provider-display-CodMmiRb.js +0 -42
  150. package/dashboard/dist/assets/safePolygon-CKpREa4K.js +0 -1
  151. package/dashboard/dist/assets/store-C9yWYHfg.js +0 -1
  152. package/dashboard/dist/assets/use-limits-display-prefs-NZ-AAYD5.js +0 -1
  153. package/dashboard/dist/assets/use-pet-settings-Bg2CDprr.js +0 -2
  154. package/dashboard/dist/assets/use-reduced-motion-iDZEUyua.js +0 -1
  155. package/dashboard/dist/assets/usePositioner-B0j1orGj.js +0 -1
  156. package/dashboard/dist/assets/zap-DvX2aYx5.js +0 -1
@@ -1 +0,0 @@
1
- import{r as s,j as a,a6 as g,aa as x,c as C}from"./__vite-browser-external-DUJeOWgd.js";import{m as u}from"./react-B7SkZTgg.js";import{P as j}from"./ProviderIcon-BshO2uER.js";import{A as f}from"./index-BImBG3eS.js";function w(d){const e=[...d];for(let i=e.length-1;i>0;i--){const o=Math.floor(Math.random()*(i+1));[e[i],e[o]]=[e[o],e[i]]}return e}function L(d,e){const i=w(d),o=Array.from({length:e},()=>[]);i.forEach((r,m)=>{o[m%e].push(r)});const p=Math.max(...o.map(r=>r.length));return o.forEach(r=>{for(;r.length<p;)r.push(i[Math.floor(Math.random()*i.length)])}),o}const b=g.memo(function({logos:e,index:i,currentTime:o,onHoverChange:p}){x();const[r,m]=s.useState(!1),l=4e3,v=i*400,n=(o+v)%(l*e.length),t=Math.floor(n/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:i*.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 A({logos:d,columnCount:e=2}){const[i,o]=s.useState([]),[p,r]=s.useState(0),[m,l]=s.useState(!1);s.useEffect(()=>{o(L(d,e))},[d,e]),s.useEffect(()=>{if(m)return;const n=setInterval(()=>r(t=>t+400),400);return()=>clearInterval(n)},[m]);const v=s.useCallback(n=>{l(n)},[]);return a.jsx("div",{className:"flex gap-2.5 sm:gap-4 text-oai-gray-200",children:i.map((n,t)=>a.jsx(b,{logos:n,index:t,currentTime:p,onHoverChange:v},t))})}const E=[{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.cline",provider:"cline"},{id:41,nameKey:"provider.display.minimax_code",provider:"minimax-code"},{id:42,nameKey:"provider.display.command_code",provider:"command-code"},{id:43,nameKey:"provider.display.trae",provider:"trae"}];export{E as A,A as L};
@@ -1 +0,0 @@
1
- import{A as o}from"./__vite-browser-external-DUJeOWgd.js";const e={name:"arrow-left",size:24,node:[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]]};e.node;const a=o(e);export{a as A};
@@ -1 +0,0 @@
1
- import{D as u,E as d,F as f,G as l,H as _,I as p}from"./__vite-browser-external-DUJeOWgd.js";const h="tt.cloud.purchase.",g=["sku","provider","request_id","order_id","retry_order_id","retry_request_id"];function s(e){if(!e||typeof e!="object"||Array.isArray(e))return null;const r={};for(const t of g)typeof e[t]=="string"&&e[t].length<=128&&(r[t]=e[t]);return r}function o(e){return`${h}${encodeURIComponent(u()||"unconfigured")}.${e}`}const y=/^[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i;function c(e){try{const r=JSON.parse(localStorage.getItem(o(e))||"null");if(r?.userId!==void 0&&r.userId!==e)return null;const t=s(r);return t?{...t,userId:e}:null}catch{return null}}function a(e,r){try{const t=s(r);if(!t)return;localStorage.setItem(o(e),JSON.stringify(t))}catch{}}function v(e){try{localStorage.removeItem(o(e))}catch{}}function E(e,r,t){const n=c(e);if(n?.sku===r&&n.provider===t&&n.request_id)return n;if(n?.request_id)throw new Error("checkout_request_conflict");const i={sku:r,provider:t,request_id:crypto.randomUUID()};return a(e,i),i}function R(e,r){const t=c(e);if(t?.order_id&&t.order_id!==r.id)throw new Error("checkout_request_conflict");if(t?.request_id&&!t.order_id)throw new Error("checkout_request_conflict");if(t?.retry_order_id===r.id&&t.retry_request_id)return t;const n={...t,sku:r.sku,provider:r.provider,order_id:r.id,retry_order_id:r.id,retry_request_id:crypto.randomUUID()};return a(e,n),n}function m(e,r){return e?e.payment_state==="refunded"?"refunded":e.status==="paid"?r?.status==="active"?"success":r?.status==="expired"?"expired":"activating":["closed","canceled","cancelled"].includes(e.status)?"canceled":e.status==="expired"||e.expires_at&&Date.parse(e.expires_at)<=Date.now()?"expired":e.checkout_url?"awaiting":"creating":"review"}async function q(e){let r;try{r=new URL(e)}catch{throw new Error("invalid_provider_checkout_url")}if(r.username||r.password||r.protocol!=="https:"&&!(r.protocol==="http:"&&["localhost","127.0.0.1"].includes(r.hostname)))throw new Error("invalid_provider_checkout_url");if(d()){const t=f();if(!t)throw new Error("browser_open_failed");await t.postMessage(r.toString())}else if(l()||_()){if(!p({type:"action",name:"openURL",value:r.toString()}))throw new Error("browser_open_failed")}else window.open(r.toString(),"_blank","noopener,noreferrer")}export{y as C,v as a,R as b,m as c,E as g,q as o,c as r,a as s};
@@ -1 +0,0 @@
1
- import{bN as Xt,cF as Ve,cG as Kt,aF as je,aK as L,aD as Vt,aM as X,cH as Ot,bG as ze,j as ve,cI as Je,r as m,aJ as Y,cJ as st,cK as qt,bO as it,aI as We,cL as $t,cM as ct,aO as I,aN as Pe,bw as me,bY as qe,cN as fe,bZ as de,aT as w,aP as wt,cO as xt,bX as Qe,b$ as jt,bq as ut,bk as at,bm as zt,cP as Jt,cQ as It,cR as Ze,bz as Be,aQ as ye,cS as Qt,bp as Zt,cT as en,$ as ke,bh as tn,cU as Ye,be as Pt,aH as Le,bf as kt,aL as Ie,bC as Ge,bB as nn,cV as rn,by as on,bd as sn,cW as be,bT as cn,bv as un,a1 as _e,an,cX as ln,b_ as fn,cY as dn,bH as pn}from"./__vite-browser-external-DUJeOWgd.js";const gn="data-open",hn="data-closed",mn="data-anchor-hidden",Ft="data-popup-open",bn="data-pressed",yn={[Ft]:""},En={[Ft]:"",[bn]:""},Tn={[gn]:""},Rn={[hn]:""},vn={[mn]:""},nr={open(e){return e?yn:null}},rr={open(e){return e?En:null}},Sn={open(e){return e?Tn:Rn},anchorHidden(e){return e?vn:null}},or={...Sn,...Xt};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 lt(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 Cn(e){e.preventDefault(),e.stopPropagation()}function On(e){return"nativeEvent"in e}function Mt(e){return e.pointerType===""&&e.isTrusted?!0:Ve&&e.pointerType?e.type==="click"&&e.buttons===1:e.detail===0&&!e.pointerType}function wn(e){return Kt?!1:!Ve&&e.width===0&&e.height===0||Ve&&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 sr(e,t){const n=["mouse","pen"];return t||n.push("",void 0),n.includes(e)}function xn(e){const t=e.type;return t==="click"||t==="mousedown"||t==="keydown"||t==="keyup"}function Ae(e){const t=je(In,e).current;return t.next=e,L(t.effect),t}function In(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(),Vt;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,Ke=0;function Pn(e){return $e[e]}function At(e){return e?Ot(e)?e.host:At(e.parentNode):null}const dt=(e,t)=>t.map(n=>{if(e.contains(n))return n;const r=At(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 kn(e,t,n,r,{mark:o=!0}){let s=null;r?s="inert":n&&(s="aria-hidden");let i=null,a=null;const l=dt(t,e),f=o?gt(t,pt(l),new Set(l)):[],T=[],v=[];if(s){const d=Xe[s],b=Pn(s);a=b,i=d;const O=dt(t,Array.from(t.querySelectorAll("[aria-live]"))),K=l.concat(O);gt(t,pt(K),new Set(K)).forEach(S=>{const R=S.getAttribute(s),j=R!==null&&R!=="false",q=(d.get(S)||0)+1;d.set(S,q),T.push(S),q===1&&j&&b.add(S),j||S.setAttribute(s,s==="inert"?"":"true")})}return o&&f.forEach(d=>{const b=(xe.get(d)||0)+1;xe.set(d,b),v.push(d),b===1&&d.setAttribute(ft,"")}),Ke+=1,()=>{i&&T.forEach(d=>{const O=(i.get(d)||0)-1;i.set(d,O),O||(!a?.has(d)&&s&&d.removeAttribute(s),a?.delete(d))}),o&&v.forEach(d=>{const b=(xe.get(d)||0)-1;xe.set(d,b),b||d.removeAttribute(ft)}),Ke-=1,Ke||(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 kn(e,s,n,r,{mark:o})}function Nt(){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 Fn{nodesRef={current:[]};events=Nt();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 Wt=m.createContext(null),Lt=m.createContext(null),et=()=>m.useContext(Wt)?.id||null,tt=e=>{const t=m.useContext(Lt);return e??t};function ir(e){const t=Je(),n=tt(e),r=et();return L(()=>{if(!t)return;const o={id:t,parentId:r};return n?.addNode(o),()=>{n?.removeNode(o)}},[n,t,r]),t}function cr(e){const{children:t,id:n}=e,r=et();return ve.jsx(Wt.Provider,{value:m.useMemo(()=>({id:n,parentId:r}),[n,r]),children:t})}function ur(e){const{children:t,externalTree:n}=e,r=je(()=>n??new Fn).current;return ve.jsx(Lt.Provider,{value:r,children:t})}function Mn(e,t){const n=Be(ye(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 yt(){return nt(),pe[pe.length-1]?.deref()}function An(e){return e?Ze(e)?e:It(e)[0]||e:null}function Et(e){if(e.hasAttribute("tabindex")&&!e.hasAttribute("data-tabindex")||!e.getAttribute("role")?.includes("dialog"))return;const n=Qt(e).filter(o=>{const s=o.getAttribute("data-tabindex")||"";return Ze(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 ar(e){const{context:t,children:n,disabled:r=!1,initialFocus:o=!0,returnFocus:s=!0,restoreFocus:i=!1,modal:a=!0,closeOnFocusOut:l=!0,openInteractionType:f="",nextFocusableElement:T,previousFocusableElement:v,beforeContentFocusGuardRef:d,externalTree:b,getInsideElements:O}=e,K="rootStore"in t?t.rootStore:t,F=K.useState("open"),S=K.useState("domReferenceElement"),R=K.useState("floatingElement"),{events:j,dataRef:q}=K.context,$=Y(()=>q.current.floatingContext?.nodeId),ae=o===!1,M=st(S)&&ae,Z=Ae(o),se=Ae(s),ee=Ae(f),D=Ae(F),G=tt(b),C=qt(),N=m.useRef(!1),le=m.useRef(!1),te=m.useRef(!1),Ee=m.useRef(null),ie=m.useRef(""),z=m.useRef(""),ge=m.useRef(null),he=m.useRef(null),Se=it(ge,d,C?.beforeInsideRef),Me=it(he,C?.afterInsideRef),y=We(),B=We(),A=$t(),Te=C!=null,E=ct(R),ne=Y((h=E)=>h?It(h):[]),re=Y(()=>O?.().filter(h=>h!=null)??[]);m.useEffect(()=>{if(r||!a)return;function h(W){W.key==="Tab"&&w(E,de(X(E)))&&ne().length===0&&!M&&Cn(W)}const P=X(E);return I(P,"keydown",h)},[r,E,a,M,ne]),m.useEffect(()=>{if(r||!F)return;const h=X(E);function P(){te.current=!1}function W(oe){const g=ye(oe),x=re(),p=w(R,g)||w(S,g)||w(C?.portalNode,g)||x.some(k=>k===g||w(k,g));te.current=!p,z.current=oe.pointerType||"keyboard",g?.closest(`[${Zt}]`)&&(le.current=!0,B.start(0,()=>{le.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,R,S,E,F,C,B,re]),m.useEffect(()=>{if(r||!l)return;const h=X(E);function P(){le.current=!0,B.start(0,()=>{le.current=!1})}function W(x){const p=ye(x);Ze(p)&&(Ee.current=p)}function _(x){const p=x.relatedTarget,k=x.currentTarget,V=ye(x);a&&p==null&&V!=null&&w(R,V)&&bt(V),queueMicrotask(()=>{const J=$(),Q=K.context.triggerElements,Ce=re(),Re=p?.hasAttribute(qe("focus-guard"))&&[ge.current,he.current,C?.beforeInsideRef.current,C?.afterInsideRef.current,C?.beforeOutsideRef.current,C?.afterOutsideRef.current,fe(v),fe(T)].includes(p),u=!(w(S,p)||w(R,p)||w(p,R)||w(C?.portalNode,p)||Ce.some(c=>c===p||w(c,p))||Q.hasMatchingElement(c=>w(c,p))||Re||G&&(Fe(G.nodesRef.current,J).find(c=>w(c.context?.elements.floating,p)||w(c.context?.elements.domReference,p))||lt(G.nodesRef.current,J).find(c=>[c.context?.elements.floating,ct(c.context?.elements.floating)].includes(p)||c.context?.elements.domReference===p)));if(k===S&&E&&Et(E),i&&k!==S&&!en(V)&&de(h)===h.body){if(me(E)&&(E.focus(),i==="popup")){A.request(()=>{E.focus()});return}const c=ne(),H=Ee.current,U=(H&&c.includes(H)?H:null)||c[c.length-1]||E;me(U)&&U.focus()}if(q.current.insideReactTree){q.current.insideReactTree=!1;return}(M||!a)&&p&&u&&!le.current&&(M||p!==yt())&&(N.current=!0,K.setOpen(!1,ke(tn,x)))})}function oe(){te.current||(q.current.insideReactTree=!0,y.start(0,()=>{q.current.insideReactTree=!1}))}const g=me(S)?S:null;if(!(!R&&!g))return Pe(g&&I(g,"focusout",_),g&&I(g,"pointerdown",P),R&&I(R,"focusin",W),R&&I(R,"focusout",_),R&&C&&I(R,"focusout",oe,!0))},[r,S,R,E,a,G,C,K,l,i,ne,M,$,q,y,B,A,T,v,re]),m.useEffect(()=>{if(r||!R||!F)return;const h=Array.from(C?.portalNode?.querySelectorAll(`[${qe("portal")}]`)||[]),W=(G?lt(G.nodesRef.current,$()):[]).find(k=>st(k.context?.elements.domReference||null))?.context?.elements.domReference,oe=[...[R,...h,ge.current,he.current,C?.beforeOutsideRef.current,C?.afterOutsideRef.current,...re()],W,fe(v),fe(T),M?S:null].filter(k=>k!=null),g=ht(oe,{ariaHidden:a||M,mark:!1}),x=[R,...h].filter(k=>k!=null),p=ht(x);return()=>{p(),g()}},[F,r,S,R,a,C,M,G,$,T,v,re]),L(()=>{if(!F||r||!me(E))return;ie.current="",z.current="";const h=X(E),P=de(h);queueMicrotask(()=>{const W=Z.current,_=typeof W=="function"?W(ee.current||""):W;if(_===void 0||_===!1||w(E,P))return;let g=null;const x=()=>(g==null&&(g=ne(E)),g[0]||E);let p;_===!0||_===null?p=x():p=fe(_),p=p||x();const k=w(E,de(h));Ue(p,{preventScroll:p===E,shouldFocus(){if(!D.current)return!1;if(k)return!0;const V=de(h);return!(V!==p&&w(E,V))}})})},[r,F,E,ne,Z,ee,D]),L(()=>{if(r||!E)return;const h=X(E),P=de(h),W=ee.current==null;bt(P);function _(g){if(g.open||(ie.current=Mn(g.nativeEvent,z.current)),g.reason===wt&&g.nativeEvent.type==="mouseleave"&&(N.current=!0),g.reason===xt)if(g.nested)N.current=!1;else if(Mt(g.nativeEvent)||wn(g.nativeEvent))N.current=!1;else{let x=!1;X(E).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=S?.isConnected?S:null,V=P?.isConnected&&ze(P)!=="body"?P:null;let J=W?V||k:k||V;return J||(J=yt()||null),typeof p=="boolean"?J:fe(p)||J||null}return()=>{j.off("openchange",_);const g=de(h),x=re(),p=w(R,g)||x.some(Q=>Q===g||w(Q,g))||G&&Fe(G.nodesRef.current,$(),!1).some(Q=>w(Q.context?.elements.floating,g)),k=se.current,V=ie.current,J=oe(V);queueMicrotask(()=>{const Q=An(J),Ce=typeof k!="boolean";if(k&&!N.current&&me(Q)&&(!(!Ce&&Q!==g&&g!==h.body)||p)){const Re={preventScroll:!0};V==="keyboard"&&(Re.focusVisible=!0),Q.focus(Re)}N.current=!1})}},[r,R,E,se,ee,j,G,S,$,re]),L(()=>{if(!Qe||F||!R)return;const h=de(X(R));!me(h)||!jt(h)||w(R,h)&&h.blur()},[F,R]),L(()=>{if(!(r||!C))return C.setFocusManagerState({modal:a,closeOnFocusOut:l,open:F,onOpenChange:K.setOpen,domReference:S}),()=>{C.setFocusManagerState(null)}},[r,C,a,F,K,l,S]),L(()=>{if(!(r||!E))return Et(E),()=>{queueMicrotask(nt)}},[r,E]);const ce=!r&&(a?!M:!0)&&(Te||a);return ve.jsxs(m.Fragment,{children:[ce&&ve.jsx(ut,{"data-type":"inside",ref:Se,onFocus:h=>{if(a){const P=ne();Ue(P[P.length-1])}else C?.portalNode&&(N.current=!1,at(h,C.portalNode)?zt(S)?.focus():fe(v??C.beforeOutsideRef)?.focus())}}),n,ce&&ve.jsx(ut,{"data-type":"inside",ref:Me,onFocus:h=>{a?Ue(ne()[0]):C?.portalNode&&(l&&(N.current=!0),at(h,C.portalNode)?Jt(S)?.focus():fe(T??C.afterOutsideRef)?.focus())}})]})}function Nn(){return!1}function Wn(e){return{escapeKey:typeof e=="boolean"?e:e?.escapeKey??!1,outsidePress:typeof e=="boolean"?e:e?.outsidePress??!0}}function lr(e,t={}){const{enabled:n=!0,escapeKey:r=!0,outsidePress:o=!0,outsidePressEvent:s="sloppy",referencePress:i=Nn,bubbles:a,externalTree:l}=t,f="rootStore"in e?e.rootStore:e,T=f.useState("open"),v=f.useState("floatingElement"),{dataRef:d,events:b}=f.context,O=tt(l),K=Y(typeof o=="function"?o:()=>!1),F=typeof o=="function"?K:o,S=F!==!1,R=Y(()=>s),{escapeKey:j,outsidePress:q}=Wn(a),$=m.useRef(!1),ae=m.useRef(!1),M=m.useRef(!1),Z=m.useRef(!1),se=m.useRef(!1),ee=m.useRef(""),D=m.useRef(null),G=We(),C=We(),N=Y(()=>{C.clear(),d.current.insideReactTree=!1}),le=Y(y=>{const B=d.current.floatingContext?.nodeId;return(O?Fe(O.nodesRef.current,B):[]).some(Te=>Te.context?.open&&!Te.context.dataRef.current[y])}),te=Y(y=>Ye(y,f.select("floatingElement"))||Ye(y,f.select("domReferenceElement"))),Ee=Y(y=>{i()&&f.setOpen(!1,ke(Pt,y.nativeEvent))}),ie=Y(y=>{if(!T||!n||!r||y.key!=="Escape"||se.current||!j&&le("__escapeKeyBubbles"))return;const B=On(y)?y.nativeEvent:y,A=ke(kt,B);f.setOpen(!1,A),A.isCanceled||y.preventDefault(),!j&&!A.isPropagationAllowed&&y.stopPropagation()}),z=Y(()=>{d.current.insideReactTree=!0,C.start(0,N)}),ge=Y(y=>{if(!T||!n||y.button!==0)return;const B=ye(y.nativeEvent);w(f.select("floatingElement"),B)&&($.current||($.current=!0,ae.current=!1))}),he=Y(y=>{!T||!n||(y.defaultPrevented||y.nativeEvent.defaultPrevented)&&$.current&&(ae.current=!0)});m.useEffect(()=>{function y(B){B.open||(Z.current=!1)}return b.on("openchange",y),()=>{b.off("openchange",y)}},[b]),m.useEffect(()=>{if(!T||!n)return T||(Z.current=!1),N;d.current.__escapeKeyBubbles=j,d.current.__outsidePressBubbles=q;const y=new Le,B=new Le,A=X(v);function Te(){y.clear(),se.current=!0}function E(){y.start(Qe?5:0,()=>{se.current=!1})}function ne(){M.current=!0,B.start(0,()=>{M.current=!1})}function re(){$.current=!1,ae.current=!1}function ce(){const u=ee.current,c=u==="pen"||!u?"mouse":u,H=R(),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=O&&Fe(O.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)&&(B.clear(),M.current=!1),N();return}if(d.current.insideReactTree){N();return}const c=ye(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/,Bt=ue||ot.test(He.overflowX),Dt=ue||ot.test(He.overflowY),Ht=Bt&&c.clientWidth>0&&c.scrollWidth>c.clientWidth,Yt=Dt&&c.clientHeight>0&&c.scrollHeight>c.clientHeight,Gt=He.direction==="rtl",_t=Yt&&(Gt?u.offsetX<=c.offsetWidth-c.clientWidth:u.offsetX>c.clientWidth),Ut=Ht&&u.offsetY>c.clientHeight;if(_t||Ut)return}if(!P(u)){if(ce()==="intentional"){if(u.detail!==0&&!Mt(u)&&!Z.current)return;if(M.current){B.clear(),M.current=!1;return}}typeof F=="function"&&!F(u)||le("__outsidePressBubbles")||(f.setOpen(!1,ke(xt,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&&(D.current={startTime:Date.now(),startX:c.clientX,startY:c.clientY,dismissOnTouchEnd:!1,dismissOnMouseDown:!0},G.start(1e3,()=>{D.current&&(D.current.dismissOnTouchEnd=!1,D.current.dismissOnMouseDown=!1)}))}function g(u,c){const H=ye(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&&(Z.current=!0),ee.current=u.pointerType),!(u.type==="mousedown"&&D.current&&!D.current.dismissOnMouseDown)&&g(u,c=>{c.type==="pointerdown"?_(c):W(c)})}function k(u){if(u.type==="pointercancel"&&(Z.current=!1),!$.current)return;const c=ae.current;if(re(),ce()==="intentional"){if(u.type==="pointercancel"){c&&ne();return}if(!P(u)){if(c){ne();return}typeof F=="function"&&!F(u)||(B.clear(),M.current=!0,N())}}}function V(u){if(ce()!=="sloppy"||!D.current||te(u))return;const c=u.touches[0];if(!c)return;const H=Math.abs(c.clientX-D.current.startX),U=Math.abs(c.clientY-D.current.startY),Oe=Math.sqrt(H*H+U*U);Oe>5&&(D.current.dismissOnTouchEnd=!0),Oe>10&&(W(u),G.clear(),D.current=null)}function J(u){g(u,V)}function Q(u){ce()!=="sloppy"||!D.current||te(u)||(D.current.dismissOnTouchEnd&&W(u),G.clear(),D.current=null)}function Ce(u){g(u,Q)}const Re=Pe(r&&Pe(I(A,"keydown",ie),I(A,"compositionstart",Te),I(A,"compositionend",E)),S&&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()=>{Re(),y.clear(),B.clear(),re(),M.current=!1,N()}},[d,v,r,S,F,T,n,j,q,ie,N,R,le,te,O,f,G]);const Se=m.useMemo(()=>({onKeyDown:ie,onPointerDown:Ee,onClick:Ee}),[ie,Ee]),Me=m.useMemo(()=>({onKeyDown:ie,onPointerDown:he,onMouseDown:he,onClickCapture:z,onMouseDownCapture(y){z(),ge(y)},onPointerDownCapture(y){z(),ge(y)},onMouseUpCapture:z,onTouchEndCapture:z,onTouchMoveCapture:z}),[ie,z,ge,he]);return m.useMemo(()=>n?{reference:Se,floating:Me,trigger:Se}:{},[n,Se,Me])}const Ln={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 Bn 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:Nt(),nested:r,triggerElements:s},Ln),this.syncOnly=n}syncOpenEvent=(t,n)=>{(!t||!this.state.open||n!=null&&xn(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,a=t.useState("open"),l=t.useState("activeTriggerElement"),f=t.useState(n?"popupElement":"positionerElement"),T=t.context.triggerElements,v=i,d=m.useRef(null);r===void 0&&d.current===null&&(d.current=new Bn({open:a,transitionStatus:void 0,referenceElement:l,floatingElement:f,triggerElements:T,onOpenChange:v,floatingId:o,syncOnly:!0,nested:s}));const b=r??d.current;return t.useSyncedValue("floatingId",o),L(()=>{const O={open:a,floatingId:o,referenceElement:l,floatingElement:f};Ie(l)&&(O.domReferenceElement=l),b.state.positionReference===b.state.referenceElement&&(O.positionReference=l),b.update(O)},[a,o,l,f,b]),b.context.onOpenChange=v,b.context.nested=s,b}function Hn(e,t=!1,n=!1,r=!1){const[o,s]=m.useState(e&&t?"idle":void 0),[i,a]=m.useState(e&&!r);return e&&!i&&(a(!0),s("starting")),!e&&i&&o!=="ending"&&!n&&s("ending"),!e&&!i&&o==="ending"&&s(void 0),L(()=>{if(!e&&i&&o!=="ending"&&n){const l=be.request(()=>{s("ending")});return()=>{be.cancel(l)}}},[e,i,o,n]),L(()=>{if(!e||t)return;const l=be.request(()=>{s(void 0)});return()=>{be.cancel(l)}},[t,e]),L(()=>{if(!e||!t)return;e&&i&&o!=="idle"&&s("starting");const l=be.request(()=>{s("idle")});return()=>{be.cancel(l)}},[t,e,i,o]),{mounted:i,setMounted:a,transitionStatus:o}}const fr={tabIndex:-1,[ln]:""};function dr(e){return t=>t==="touch"?e.current:!0}function pr(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 gr({handle:e,store:t}){return L(()=>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 Yn(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 Gn(e,t,n,r=!1){let o=e.preventUnmountingOnClose;t?o=!1:r&&(o=!0);const s=n?.id??null;let i=e.activeTriggerId,a=e.activeTriggerElement;return(s||t)&&(i=s,a=n??null),{open:t,preventUnmountingOnClose:o,activeTriggerId:i,activeTriggerElement:a}}function _n(e){let t=!1;return e.preventUnmountOnClose=()=>{t=!0},()=>t}function hr(e,t,n,r={}){const o=n.reason,s=o===wt,i=t&&o===fn,a=!t&&(o===Pt||o===kt),l=_n(n);if(e.context.onOpenChange?.(t,n),n.isCanceled)return;r.onBeforeDispatch?.(),e.state.floatingRootContext.dispatchOpenChange(t,n);const f=()=>{const T=Gn(e.state,t,n.trigger,l()),v={...r.extraState,...T};i?v.instantType="focus":a?v.instantType="dismiss":s&&(v.instantType=void 0),e.update(v)};s?an.flushSync(f):f()}function mr(e,t,n,r){const o=n.useState("isMountedByTrigger",e),s=Yn(e,n),i=Y(l=>{const f=n.select("open"),T=n.select("activeTriggerId");if(T===e){const v={activeTriggerElement:l,...f?r:null};n.update(v);return}if(T==null&&f){const v={activeTriggerId:e??null,activeTriggerElement:l,...r};n.update(v)}}),a=Y(l=>{s(l),l&&i(l)});return L(()=>(a(t.current),()=>a(null)),[a,t,n,e]),L(()=>{if(o){const l={activeTriggerElement:t.current,...r};n.update(l)}},[o,n,t,...Object.values(r)]),{registerTrigger:a,isMountedByThisTrigger:o}}function br(e,t={}){const{closeOnActiveTriggerUnmount:n=!1}=t,r=m.useRef(null),o=e.useState("open"),s=e.useState("triggerCount"),i=e.useState("activeTriggerId"),a=e.useState("activeTriggerElement");L(()=>{if(!o){r.current=null,e.state.triggerCount!==0&&e.set("triggerCount",0);return}const l=e.context.triggerElements.size,f={};e.state.triggerCount!==l&&(f.triggerCount=l);const T=e.select("activeTriggerId");let v=null;if(T){const d=e.context.triggerElements.getById(T);if(d)r.current=T,d!==e.state.activeTriggerElement&&(f.activeTriggerElement=d);else{for(const[b,O]of e.context.triggerElements.entries())if(O===e.state.activeTriggerElement){f.activeTriggerId=b,f.activeTriggerElement=O,r.current=b;break}f.activeTriggerId===void 0&&(r.current===T?v=T:r.current=null)}}else r.current=null;if(!v&&!T&&l===1){const d=e.context.triggerElements.entries().next();if(!d.done){const[b,O]=d.value;f.activeTriggerId=b,f.activeTriggerElement=O,r.current=b}}(f.triggerCount!==void 0||f.activeTriggerId!==void 0||f.activeTriggerElement!==void 0)&&e.update(f),v&&n&&queueMicrotask(()=>{if(e.select("open")&&e.select("activeTriggerId")===v&&!e.context.triggerElements.getById(v)){const d=ke(cn);e.setOpen(!1,d),d.isCanceled||e.update({activeTriggerId:null,activeTriggerElement:null})}})},[o,e,s,i,a,n])}function yr(e,t,n,r){const{mounted:o,setMounted:s,transitionStatus:i}=Hn(e,!1,!1,r),a=t.useState("preventUnmountingOnClose"),l=e?!1:a;t.useSyncedValues({mounted:o,transitionStatus:i,preventUnmountingOnClose:l});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&&!l,open:e,ref:t.context.popupRef,onComplete(){e||f()}}),{forceUnmount:f,transitionStatus:i}}function Er(e,t){e.useSyncedValues(t),L(()=>()=>{e.update({activeTriggerProps:_e,inactiveTriggerProps:_e,popupProps:_e})},[e])}function Tr(e,t){L(()=>{!t&&e.state.openMethod!==null&&e.set("openMethod",null)},[t,e]),L(()=>()=>{e.state.openMethod!==null&&e.set("openMethod",null)},[e])}class Rr{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 vr(e){return Je(e,"base-ui")}const Sr=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 ve.jsx("div",{ref:n,role:"presentation","data-base-ui-inert":"",...o,style:{position:"fixed",inset:0,userSelect:"none",WebkitUserSelect:"none",clipPath:s}})});let Rt={},vt={},St="";function De(e,t){return pn(e)?e:t}function Ct(e,t,n){return/hidden|clip/.test(e.getComputedStyle(De(t,n)).overflowY)}function Un(e){if(typeof document>"u")return!1;const t=X(e);return Be(t).innerWidth-t.documentElement.clientWidth>0}function Xn(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=De(r,o),i=s.style.overflowY,a=r.style.scrollbarGutter;r.style.scrollbarGutter="stable",s.style.overflowY="scroll";const l=s.offsetWidth;s.style.overflowY="hidden";const f=s.offsetWidth;return s.style.overflowY=i,r.style.scrollbarGutter=a,l===f}function Kn(e){const t=X(e),n=t.documentElement,r=t.body,o=De(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 Vn(e){const t=X(e),n=t.documentElement,r=t.body,o=Be(n);let s=0,i=0,a=!1;const l=be.create();if(Qe&&(o.visualViewport?.scale??1)!==1)return()=>{};function f(){const b=o.getComputedStyle(n),O=o.getComputedStyle(r),S=(b.scrollbarGutter||"").includes("both-edges")?"stable both-edges":"stable";s=n.scrollTop,i=n.scrollLeft,Rt={scrollbarGutter:n.style.scrollbarGutter,overflowY:n.style.overflowY,overflowX:n.style.overflowX},St=n.style.scrollBehavior,vt={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 R=n.scrollHeight>n.clientHeight,j=n.scrollWidth>n.clientWidth,q=b.overflowY==="scroll"||O.overflowY==="scroll",$=b.overflowX==="scroll"||O.overflowX==="scroll",ae=Math.max(0,o.innerWidth-r.clientWidth),M=Math.max(0,o.innerHeight-r.clientHeight),Z=parseFloat(O.marginTop)+parseFloat(O.marginBottom),se=parseFloat(O.marginLeft)+parseFloat(O.marginRight),ee=De(n,r);if(a=Xn(e),a){n.style.scrollbarGutter=S,ee.style.overflowY="hidden",ee.style.overflowX="hidden";return}Object.assign(n.style,{scrollbarGutter:S,overflowY:"hidden",overflowX:"hidden"}),(R||q)&&(n.style.overflowY="scroll"),(j||$)&&(n.style.overflowX="scroll"),Object.assign(r.style,{position:"relative",height:Z||M?`calc(100dvh - ${Z+M}px)`:"100dvh",width:se||ae?`calc(100vw - ${se+ae}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 T(){Object.assign(n.style,Rt),Object.assign(r.style,vt),a||(n.scrollTop=s,n.scrollLeft=i,n.removeAttribute("data-base-ui-scroll-locked"),n.style.scrollBehavior=St)}function v(){T(),l.request(f)}f();const d=I(o,"resize",v);return()=>{l.cancel(),T(),typeof o.removeEventListener=="function"&&d()}}class qn{lockCount=0;restore=null;timeoutLock=Le.create();timeoutUnlock=Le.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=Be(r);if(Ct(s,r,o)){const a=new s.MutationObserver(()=>{Ct(s,r,o)||(a.disconnect(),this.restore=null,this.lock(t))}),l={attributes:!0};a.observe(r,l),a.observe(o,l),this.restore=()=>a.disconnect();return}const i=dn||!Un(t);this.restore=i?Kn(t):Vn(t)}}const $n=new qn;function Cr(e=!0,t=null){L(()=>{if(e)return $n.acquire(t)},[e,t])}const jn="ArrowUp",zn="ArrowDown",Jn="ArrowLeft",Qn="ArrowRight",Zn="Home",er="End",Or=new Set([jn,zn,Jn,Qn,Zn,er]);export{Cr as A,Hn as B,Or as C,hr as D,wn as E,Bn as F,Ue as G,Cn as H,Sr as I,Mt as J,Rr as P,tt as a,et as b,Ae as c,_n as d,Gn as e,ur as f,Fe as g,Tr as h,sr as i,br as j,yr as k,gr as l,pr as m,lr as n,Er as o,mr as p,rr as q,ir as r,cr as s,nr as t,vr as u,dr as v,ar as w,fr as x,or as y,Sn as z};
@@ -1 +0,0 @@
1
- import{A as o}from"./__vite-browser-external-DUJeOWgd.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 +0,0 @@
1
- import{A as o}from"./__vite-browser-external-DUJeOWgd.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 +0,0 @@
1
- import{A as o}from"./__vite-browser-external-DUJeOWgd.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 +0,0 @@
1
- import{A as a}from"./__vite-browser-external-DUJeOWgd.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,42 +0,0 @@
1
- import{A as Ne,r as l,j as e,c as o,ak as qe,aw as Ke,ax as Ve,X as Ze,an as Je,l as Qe}from"./__vite-browser-external-DUJeOWgd.js";import{u as et}from"./useCurrency-pwClnCZ5.js";import{u as Ee}from"./useTokenFormat-BMvVAe6V.js";import{M as tt,T as at}from"./terminal-B3_fCLFs.js";import{I as rt}from"./info-CyDY7NYM.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,c){const p=/^#([0-9a-f]{6})$/i.exec(s);if(!p)return s;const d=parseInt(p[1],16),f=d>>16&255,$=d>>8&255,Y=d&255,P=A=>Math.max(0,Math.min(255,Math.round(A*c)));return`rgb(${P(f)}, ${P($)}, ${P(Y)})`}function q(s,c,p,d,f){const $=Math.cos(d),Y=Math.sin(d),P=s*$-c*Y,A=s*Y+c*$,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,c,p,d,f){return q(s,c,p,d,f)}function De(s,c,p=d=>Number(d).toLocaleString()){const d=p(c);if(s>=4){const f=Math.floor(Math.random()*3)+1;return o(`heatmap.3d.voxel.joke.${f}`,{value:d})}else return s===3?o("heatmap.3d.voxel.level3",{value:d}):s===2?o("heatmap.3d.voxel.level2",{value:d}):s===1?o("heatmap.3d.voxel.level1",{value:d}):o("heatmap.3d.voxel.level0")}function Ae({weeks:s,palette:c="auto",isDark:p=!1,interactive:d=!1,autoRotateInit:f=!1,onResetViewRef:$=null}){const{formatTokens:Y,formatTokensTooltip:P}=Ee(),A=ae[c]||(c==="auto"?ae.emerald:null),R=A?p?A.dark:A.light:Array.isArray(c)?c: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=d?13:10.5,fe=l.useMemo(()=>{const t=[],r=s.length;if(r===0||!d)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,d]);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)}),[d]),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 de=(t,r)=>{d&&(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,ce]=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(!d||!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)}},[d]);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-(d?1.8:1.5),ke=d?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 ${d?"cursor-grab active:cursor-grabbing w-full h-full flex items-center justify-center":"w-full overflow-hidden flex justify-center"}`,onMouseDown:t=>{if(!d)return;de(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=>{!d||t.touches.length===0||de(t.touches[0].clientX,t.touches[0].clientY)},onTouchMove:t=>{!d||t.touches.length===0||I(t.touches[0].clientX,t.touches[0].clientY)},onTouchEnd:()=>{d&&ve()},children:[e.jsxs("svg",{ref:Z,viewBox:O,width:d?"95%":"100%",height:d?"95%":"auto",role:"img","aria-label":o("heatmap.iso.aria")||"3D interactive activity heatmap",style:{display:"block",width:"100%",height:"auto",maxWidth:d?"none":`${me}px`,maxHeight:d?"78vh":"none"},className:"transition-transform duration-300 ease-out",children:[d&&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),ce(t),d&&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(()=>{ce(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:d?"pointer":"default"},children:[!d&&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)})]}),d&&g&&e.jsxs("div",{onMouseEnter:()=>{y.current&&(clearTimeout(y.current),y.current=null)},onMouseLeave:()=>{y.current&&clearTimeout(y.current),y.current=setTimeout(()=>{ce(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 dt=12,ct=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 c=/^(\d{4})-(\d{2})-(\d{2})$/.exec(s.trim());if(!c)return null;const p=new Date(Date.UTC(Number(c[1]),Number(c[2])-1,Number(c[3])));return Number.isFinite(p.getTime())?p:null}function Ye(s,c){return new Date(Date.UTC(s.getUTCFullYear(),s.getUTCMonth(),s.getUTCDate()+c))}function ht(s,c){return Math.floor((Date.UTC(c.getUTCFullYear(),c.getUTCMonth(),c.getUTCDate())-Date.UTC(s.getUTCFullYear(),s.getUTCMonth(),s.getUTCDate()))/864e5)}function ft(s,c){const p=c==="mon"?1:0,d=s.getUTCDay();return Ye(s,-((d-p+7)%7))}function gt(s,c,p,d){if(!s)return[];const f=pt(c)||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:d[E.getUTCMonth()],index:S}))}return A}function _t({heatmap:s,timeZoneLabel:c,timeZoneShortLabel:p,hideLegend:d=!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 de=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=de[U]||de.emerald,ve=ae[U]?E?ae[U].dark:ae[U].light:E?ae.emerald.dark:ae.emerald.light,[g,ce]=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:dt,G=f?2:ct,_=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:()=>ce("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:()=>ce("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)}))})]})]})}),!d&&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(de).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
- @keyframes tt-fade-in {
3
- from { opacity: 0; }
4
- to { opacity: 1; }
5
- }
6
- @keyframes tt-fade-out {
7
- from { opacity: 1; }
8
- to { opacity: 0; }
9
- }
10
- @keyframes tt-modal-entrance {
11
- from {
12
- opacity: 0;
13
- transform: scale(0.96) translateY(10px);
14
- }
15
- to {
16
- opacity: 1;
17
- transform: scale(1) translateY(0);
18
- }
19
- }
20
- @keyframes tt-modal-exit {
21
- from {
22
- opacity: 1;
23
- transform: scale(1) translateY(0);
24
- }
25
- to {
26
- opacity: 0;
27
- transform: scale(0.96) translateY(10px);
28
- }
29
- }
30
- .animate-tt-fade-in {
31
- animation: tt-fade-in 0.2s cubic-bezier(0.16, 1, 0.3, 1) forwards;
32
- }
33
- .animate-tt-fade-out {
34
- animation: tt-fade-out 0.2s cubic-bezier(0.16, 1, 0.3, 1) forwards;
35
- }
36
- .animate-tt-modal {
37
- animation: tt-modal-entrance 0.3s cubic-bezier(0.34, 1.3, 0.64, 1) forwards;
38
- }
39
- .animate-tt-modal-exit {
40
- animation: tt-modal-exit 0.2s cubic-bezier(0.16, 1, 0.3, 1) forwards;
41
- }
42
- `})]})}const yt={acode:"AStudio",anythingllm:"AnythingLLM",claudescience:"Claude Science",pianthropic:"Pi · Anthropic",pigithubcopilot:"Pi · GitHub Copilot",picopilot:"Pi · Copilot",dots:"Dots",pidots:"Pi · Dots",lmstudio:"LM Studio",unsloth:"Unsloth Studio"},bt={deepseek:"provider.display.deepseek_harness",dsh:"provider.display.deepseek_harness",omp:"provider.display.omp",omo:"provider.display.omo",minimaxcode:"provider.display.minimax_code",commandcode:"provider.display.command_code",trae:"provider.display.trae",traecn:"provider.display.trae_work_cn",traeworkcn:"provider.display.trae_work_cn"};function vt(s){return String(s||"").trim().toLowerCase().replace(/[\s_-]+/g,"")}const kt={ai:"AI",api:"API",cli:"CLI",github:"GitHub",openai:"OpenAI",opencode:"OpenCode",xai:"xAI"};function Se(s){return s.split(/[-_ ]+/).filter(Boolean).map(c=>kt[c.toLowerCase()]??c.charAt(0).toUpperCase()+c.slice(1).toLowerCase()).join(" ")}function Mt(s){const c=String(s||"").trim();if(!c)return"";const p=vt(c);if(p==="primeagent")return"Prime Agent";if(p.startsWith("primeagent")&&p.length>10){const $=Se(c.replace(/^prime[-_ ]?agent[-_ ]?/i,""));return $?`Prime Agent · ${$}`:"Prime Agent"}const d=bt[p];if(d)return o(d);const f=yt[p];if(f)return f;if(/^pi[-_ ]/i.test(c)){const $=Se(c.slice(3));if($)return`Pi · ${$}`}return c.charAt(0).toUpperCase()+c.slice(1)}export{_t as A,Mt as f};
@@ -1 +0,0 @@
1
- import{r as j,aD as we,aE as De,aF as Fe,aG as Le,aH as le,aI as He,aJ as te,aK as Te,aL as q,aM as ae,aN as ue,aO as Z,$ as ee,aP as z,aQ as ge,aR as Xe,aS as Ce,aT as N,an as Ye}from"./__vite-browser-external-DUJeOWgd.js";import{i as fe,a as Pe,b as Ne,g as de,c as ne}from"./composite-B4Z3F65o.js";function _e(e,s){return s!=null&&!fe(s)?0:typeof e=="function"?e():e}function me(e,s,r){const p=_e(e,r);return typeof p=="number"?p:p?.[s]}function Oe(e){return typeof e=="function"?e():e}function Se(e,s){return s||e==="click"||e==="mousedown"}function Be(e){return e?.includes("mouse")&&e!=="mousedown"}function Qe(e){const s=j.useCallback(p=>e===void 0?we:e.subscribeStore(p),[e]),r=j.useCallback(()=>e===void 0?void 0:e.store,[e]);return De.useSyncExternalStore(s,r,()=>e?.serverStore)}class pe{constructor(){this.pointerType=void 0,this.interactedInside=!1,this.handler=void 0,this.blockMouseMove=!0,this.performedPointerEventsMutation=!1,this.pointerEventsScopeElement=null,this.pointerEventsReferenceElement=null,this.pointerEventsFloatingElement=null,this.restTimeoutPending=!1,this.openChangeTimeout=new le,this.restTimeout=new le,this.handleCloseOptions=void 0}static create(){return new pe}dispose=()=>{this.openChangeTimeout.clear(),this.restTimeout.clear()};disposeEffect=()=>this.dispose}const ie=new WeakMap;function ce(e){if(!e.performedPointerEventsMutation)return;const s=e.pointerEventsScopeElement;s&&ie.get(s)===e&&(e.pointerEventsScopeElement?.style.removeProperty("pointer-events"),e.pointerEventsReferenceElement?.style.removeProperty("pointer-events"),e.pointerEventsFloatingElement?.style.removeProperty("pointer-events"),ie.delete(s)),e.performedPointerEventsMutation=!1,e.pointerEventsScopeElement=null,e.pointerEventsReferenceElement=null,e.pointerEventsFloatingElement=null}function be(e,s){const{scopeElement:r,referenceElement:p,floatingElement:c}=s,o=ie.get(r);o&&o!==e&&ce(o),ce(e),e.performedPointerEventsMutation=!0,e.pointerEventsScopeElement=r,e.pointerEventsReferenceElement=p,e.pointerEventsFloatingElement=c,ie.set(r,e),r.style.pointerEvents="none",p.style.pointerEvents="auto",c.style.pointerEvents="auto"}function Me(e){const s=e.context.dataRef.current,r=Fe(()=>s.hoverInteractionState??pe.create()).current;return s.hoverInteractionState||(s.hoverInteractionState=r),Le(s.hoverInteractionState.disposeEffect),s.hoverInteractionState}function $e(e,s={}){const{enabled:r=!0,closeDelay:p=0,nodeId:c}=s,o="rootStore"in e?e.rootStore:e,X=o.useState("open"),b=o.useState("floatingElement"),H=o.useState("domReferenceElement"),{dataRef:Y}=o.context,a=Pe(),M=Ne(),f=Me(o),U=He(),G=te(()=>Se(Y.current.openEvent?.type,f.interactedInside)),i=te(()=>Be(Y.current.openEvent?.type)),D=te(()=>{ce(f)});Te(()=>{X||(f.pointerType=void 0,f.restTimeoutPending=!1,f.interactedInside=!1,D())},[X,f,D]),j.useEffect(()=>D,[D]),Te(()=>{if(r&&X&&f.handleCloseOptions?.blockPointerEvents&&i()&&q(H)&&b){const _=H,F=b,t=ae(b),C=a?.nodesRef.current.find(O=>O.id===M)?.context?.elements.floating;C&&(C.style.pointerEvents="");const k=f.pointerEventsScopeElement!==F?f.pointerEventsScopeElement:null,E=C!==F?C:null,g=f.handleCloseOptions?.getScope?.()??k??E??_.closest("[data-rootownerid]")??t.body;return be(f,{scopeElement:g,referenceElement:_,floatingElement:F}),()=>{D()}}},[r,X,H,b,f,i,a,M,D]),j.useEffect(()=>{if(!r)return;function _(){return!!(a&&M&&de(a.nodesRef.current,M).length>0)}function F(O){const I=me(p,"close",f.pointerType),Q=()=>{o.setOpen(!1,ee(z,O)),a?.events.emit("floating.closed",O)};I?f.openChangeTimeout.start(I,Q):(f.openChangeTimeout.clear(),Q())}function t(O){const I=ge(O);if(!Xe(I)){f.interactedInside=!1;return}f.interactedInside=I?.closest("[aria-haspopup]")!=null}function C(){f.openChangeTimeout.clear(),U.clear(),a?.events.off("floating.closed",E),D()}function k(O){if(_()&&a){a.events.on("floating.closed",E);return}if(Ce(O.relatedTarget,o.context.triggerElements))return;const I=Y.current.floatingContext?.nodeId??c,Q=O.relatedTarget;if(!(a&&I&&q(Q)&&de(a.nodesRef.current,I,!1).some(B=>N(B.context?.elements.floating,Q)))){if(f.handler){f.handler(O);return}D(),i()&&!G()&&F(O)}}function E(O){!a||!M||_()||U.start(0,()=>{a.events.off("floating.closed",E),o.setOpen(!1,ee(z,O)),a.events.emit("floating.closed",O)})}const g=b;return ue(g&&Z(g,"mouseenter",C),g&&Z(g,"mouseleave",k),g&&Z(g,"pointerdown",t,!0),()=>{a?.events.off("floating.closed",E)})},[r,b,o,Y,p,c,i,G,D,f,a,M,U])}const Ae={current:null};function qe(e,s={}){const{enabled:r=!0,delay:p=0,handleClose:c=null,mouseOnly:o=!1,restMs:X=0,move:b=!0,triggerElementRef:H=Ae,externalTree:Y,isActiveTrigger:a=!0,getHandleCloseContext:M,isClosing:f,shouldOpen:U,guardStaleOpen:G=!1}=s,i="rootStore"in e?e.rootStore:e,{dataRef:D,events:_}=i.context,F=Pe(Y),t=Me(i),C=j.useRef(!1),k=ne(c),E=ne(p),g=ne(X),O=ne(r),I=ne(U),Q=ne(f),x=te(()=>Se(D.current.openEvent?.type,t.interactedInside)),B=te(()=>I.current?.()!==!1),$=te((v,u,R)=>{const T=i.context.triggerElements;if(T.hasElement(u))return!v||!N(v,u);if(!q(R))return!1;const J=R;return T.hasMatchingElement(A=>N(A,J))&&(!v||!N(v,J))}),h=te(()=>{if(!t.handler)return;ae(i.select("domReferenceElement")).removeEventListener("mousemove",t.handler),t.handler=void 0}),n=te(()=>{ce(t)});return a&&(t.handleCloseOptions=c?.__options),j.useEffect(()=>h,[h]),j.useEffect(()=>{if(!r)return;function v(u){u.open?C.current=!1:(C.current=u.reason===z,h(),t.openChangeTimeout.clear(),t.restTimeout.clear(),t.blockMouseMove=!0,t.restTimeoutPending=!1)}return _.on("openchange",v),()=>{_.off("openchange",v)}},[r,_,t,h]),j.useEffect(()=>{if(!r)return;function v(d,V=!0){const P=me(E.current,"close",t.pointerType);P?t.openChangeTimeout.start(P,()=>{i.setOpen(!1,ee(z,d)),F?.events.emit("floating.closed",d)}):V&&(t.openChangeTimeout.clear(),i.setOpen(!1,ee(z,d)),F?.events.emit("floating.closed",d))}const u=H.current??(a?i.select("domReferenceElement"):null);if(!q(u))return;function R(d){if(t.openChangeTimeout.clear(),t.blockMouseMove=!1,o&&!fe(t.pointerType))return;const V=Oe(g.current),P=me(E.current,"open",t.pointerType),S=ge(d),l=d.currentTarget??null,w=i.select("domReferenceElement");let y=l;if(q(S)&&!i.context.triggerElements.hasElement(S)){for(const ve of i.context.triggerElements.elements())if(N(ve,S)){y=ve;break}}q(l)&&q(w)&&!i.context.triggerElements.hasElement(l)&&N(l,w)&&(y=w);const L=y==null?!1:$(w,y,S),W=i.select("open"),K=Q.current?.()??i.select("transitionStatus")==="ending",Ee=!W&&K&&C.current,Ie=!L&&q(y)&&q(w)&&N(w,y)&&Ee,ye=V>0&&!P,ke=L&&(W||Ee)||Ie,he=!W||L;if(ke){B()&&i.setOpen(!0,ee(z,d,y));return}ye||(P?t.openChangeTimeout.start(P,()=>{he&&B()&&i.setOpen(!0,ee(z,d,y))}):he&&B()&&i.setOpen(!0,ee(z,d,y)))}function T(d){if(x()){n();return}h();const V=i.select("domReferenceElement"),P=ae(V);t.restTimeout.clear(),t.restTimeoutPending=!1;const S=D.current.floatingContext??M?.();if(Ce(d.relatedTarget,i.context.triggerElements))return;if(k.current&&S){i.select("open")||t.openChangeTimeout.clear();const w=H.current;t.handler=k.current({...S,tree:F,x:d.clientX,y:d.clientY,onClose(){n(),h(),O.current&&!x()&&w===i.select("domReferenceElement")&&v(d,!0)}}),P.addEventListener("mousemove",t.handler),t.handler(d);return}(t.pointerType!=="touch"||!N(i.select("floatingElement"),d.relatedTarget))&&v(d)}function J(d){N(u,d.relatedTarget)||(t.openChangeTimeout.clear(),t.restTimeout.clear(),t.restTimeoutPending=!1)}const A=G?Z(u,"mouseout",J):void 0;return b?ue(Z(u,"mousemove",R,{once:!0}),Z(u,"mouseenter",R),Z(u,"mouseleave",T),A):ue(Z(u,"mouseenter",R),Z(u,"mouseleave",T),A)},[h,n,D,E,i,r,k,t,a,$,x,o,b,g,H,F,O,M,Q,B,G]),j.useMemo(()=>{if(!r)return;function v(u){t.pointerType=u.pointerType}return{onPointerDown:v,onPointerEnter:v,onMouseMove(u){const{nativeEvent:R}=u,T=u.currentTarget,J=i.select("domReferenceElement"),A=i.select("open"),d=$(J,T,u.target);if(o&&!fe(t.pointerType))return;if(A&&d&&t.handleCloseOptions?.blockPointerEvents){const S=i.select("floatingElement");if(S){const l=t.handleCloseOptions?.getScope?.()??T.ownerDocument.body;be(t,{scopeElement:l,referenceElement:T,floatingElement:S})}}const V=Oe(g.current);if(A&&!d||V===0||!d&&t.restTimeoutPending&&u.movementX**2+u.movementY**2<2)return;t.restTimeout.clear();function P(){if(t.restTimeoutPending=!1,x())return;const S=i.select("open");!t.blockMouseMove&&(!S||d)&&B()&&i.setOpen(!0,ee(z,R,T))}t.pointerType==="touch"?Ye.flushSync(()=>{P()}):d&&A?P():(t.restTimeoutPending=!0,t.restTimeout.start(V,P))}}},[r,t,x,$,o,i,g,B])}const Re=.1,Ve=Re*Re,m=.5;function oe(e,s,r,p,c,o){return p>=s!=o>=s&&e<=(c-r)*(s-p)/(o-p)+r}function re(e,s,r,p,c,o,X,b,H,Y){let a=!1;return oe(e,s,r,p,c,o)&&(a=!a),oe(e,s,c,o,X,b)&&(a=!a),oe(e,s,X,b,H,Y)&&(a=!a),oe(e,s,H,Y,r,p)&&(a=!a),a}function We(e,s,r){return e>=r.x&&e<=r.x+r.width&&s>=r.y&&s<=r.y+r.height}function se(e,s,r,p,c,o){const X=Math.min(r,c),b=Math.max(r,c),H=Math.min(p,o),Y=Math.max(p,o);return e>=X&&e<=b&&s>=H&&s<=Y}function Je(e={}){const{blockPointerEvents:s=!1}=e,r=new le,p=({x:c,y:o,placement:X,elements:b,onClose:H,nodeId:Y,tree:a})=>{const M=X?.split("-")[0];let f=!1,U=null,G=null,i=typeof performance<"u"?performance.now():0;function D(F,t){const C=performance.now(),k=C-i;if(U===null||G===null||k===0)return U=F,G=t,i=C,!1;const E=F-U,g=t-G,O=E*E+g*g,I=k*k*Ve;return U=F,G=t,i=C,O<I}function _(){r.clear(),H()}return function(t){r.clear();const C=b.domReference,k=b.floating;if(!C||!k||M==null||c==null||o==null)return;const{clientX:E,clientY:g}=t,O=ge(t),I=t.type==="mouseleave",Q=N(k,O),x=N(C,O);if(Q&&(f=!0,!I))return;if(x&&(f=!1,!I)){f=!0;return}if(I&&q(t.relatedTarget)&&N(k,t.relatedTarget))return;function B(){return!!(a&&de(a.nodesRef.current,Y).length>0)}function $(){B()||_()}if(B())return;const h=C.getBoundingClientRect(),n=k.getBoundingClientRect(),v=c>n.right-n.width/2,u=o>n.bottom-n.height/2,R=n.width>h.width,T=n.height>h.height,J=(R?h:n).left,A=(R?h:n).right,d=(T?h:n).top,V=(T?h:n).bottom;if(M==="top"&&o>=h.bottom-1||M==="bottom"&&o<=h.top+1||M==="left"&&c>=h.right-1||M==="right"&&c<=h.left+1){$();return}let P=!1;switch(M){case"top":P=se(E,g,J,h.top+1,A,n.bottom-1);break;case"bottom":P=se(E,g,J,n.top+1,A,h.bottom-1);break;case"left":P=se(E,g,n.right-1,V,h.left+1,d);break;case"right":P=se(E,g,h.right-1,V,n.left+1,d);break}if(P)return;if(f&&!We(E,g,h)){$();return}if(!I&&D(E,g)){$();return}let S=!1;switch(M){case"top":{const l=R?m/2:m*4,w=R||v?c+l:c-l,y=R?c-l:v?c+l:c-l,L=o+m+1,W=v||R?n.bottom-m:n.top,K=v?R?n.bottom-m:n.top:n.bottom-m;S=re(E,g,w,L,y,L,n.left,W,n.right,K);break}case"bottom":{const l=R?m/2:m*4,w=R||v?c+l:c-l,y=R?c-l:v?c+l:c-l,L=o-m,W=v||R?n.top+m:n.bottom,K=v?R?n.top+m:n.bottom:n.top+m;S=re(E,g,w,L,y,L,n.left,W,n.right,K);break}case"left":{const l=T?m/2:m*4,w=T||u?o+l:o-l,y=T?o-l:u?o+l:o-l,L=c+m+1,W=u||T?n.right-m:n.left,K=u?T?n.right-m:n.left:n.right-m;S=re(E,g,W,n.top,K,n.bottom,L,w,L,y);break}case"right":{const l=T?m/2:m*4,w=T||u?o+l:o-l,y=T?o-l:u?o+l:o-l,L=c-m,W=u||T?n.left+m:n.right,K=u?T?n.left+m:n.right:n.left+m;S=re(E,g,L,w,L,y,W,n.top,K,n.bottom);break}}S?f||r.start(40,$):$()}};return p.__options={...e,blockPointerEvents:s},p}export{qe as a,$e as b,Me as c,me as g,Je as s,Qe as u};
@@ -1 +0,0 @@
1
- import{a1 as r}from"./__vite-browser-external-DUJeOWgd.js";import{F as g}from"./composite-B4Z3F65o.js";function s(e,n,u=!1){return{open:!1,openProp:void 0,mounted:!1,transitionStatus:void 0,floatingRootContext:new g({open:!1,transitionStatus:void 0,floatingElement:null,referenceElement:null,triggerElements:e,floatingId:n,syncOnly:!0,nested:u,onOpenChange:void 0}),floatingId:n,triggerCount:0,preventUnmountingOnClose:!1,payload:void 0,activeTriggerId:null,activeTriggerElement:null,triggerIdProp:void 0,popupElement:null,positionerElement:null,activeTriggerProps:r,inactiveTriggerProps:r,popupProps:r}}const o=e=>e.triggerIdProp??e.activeTriggerId,t=e=>e.openProp??e.open,i=e=>(e.popupElement?.id??e.floatingId)||void 0;function p(e,n){return n!==void 0&&t(e)&&o(e)===n}function l(e,n){return p(e,n)?!0:n!==void 0&&t(e)&&o(e)==null&&e.triggerCount===1}const c={open:t,mounted:e=>e.mounted,transitionStatus:e=>e.transitionStatus,floatingRootContext:e=>e.floatingRootContext,triggerCount:e=>e.triggerCount,preventUnmountingOnClose:e=>e.preventUnmountingOnClose,payload:e=>e.payload,activeTriggerId:o,activeTriggerElement:e=>e.mounted?e.activeTriggerElement:null,popupId:i,isTriggerActive:(e,n)=>n!==void 0&&o(e)===n,isOpenedByTrigger:(e,n)=>p(e,n),isMountedByTrigger:(e,n)=>n!==void 0&&o(e)===n&&e.mounted,triggerProps:(e,n)=>n?e.activeTriggerProps:e.inactiveTriggerProps,triggerPopupId:(e,n)=>l(e,n)?i(e):void 0,popupProps:e=>e.popupProps,popupElement:e=>e.popupElement,positionerElement:e=>e.positionerElement};export{s as c,c as p};
@@ -1 +0,0 @@
1
- import{c as a,r as c,G as V,W as B,U as F,V as H}from"./__vite-browser-external-DUJeOWgd.js";const Q=["claude","codex","cursor","gemini","kimi","kiro","grok","copilot","antigravity","zcode","opencodeGo","commandCode","qoder","qoderCn","codingPlan","agentPlan","devin"],W={claude:"CLAUDE",codex:"CODEX",cursor:"CURSOR",gemini:"GEMINI",kimi:"KIMI",kiro:"KIRO",grok:"GROK",copilot:"COPILOT",antigravity:"ANTIGRAVITY",zcode:"ZCODE",opencodeGo:"OPENCODE",commandCode:"COMMAND-CODE",qoder:"QODER",qoderCn:"QODER-CN",codingPlan:"VOLCANO-ARK",agentPlan:"VOLCANO-ARK",devin:"DEVIN"};function fe(e){return W[e]||null}function me(e){switch(e){case"claude":return a("limits.provider.claude");case"codex":return a("limits.provider.codex");case"cursor":return a("limits.provider.cursor");case"gemini":return a("limits.provider.gemini");case"kimi":return a("limits.provider.kimi");case"kiro":return a("limits.provider.kiro");case"grok":return a("limits.provider.grok");case"copilot":return a("limits.provider.copilot");case"antigravity":return a("limits.provider.antigravity");case"zcode":return a("limits.provider.zcode");case"opencodeGo":return a("limits.provider.opencode_go");case"commandCode":return a("limits.provider.command_code");case"qoder":return a("limits.provider.qoder");case"qoderCn":return a("limits.provider.qoder_cn");case"codingPlan":return a("limits.provider.ark_coding_plan");case"agentPlan":return a("limits.provider.ark_agent_plan");case"devin":return a("limits.provider.devin");default:return String(e||"")}}const m=Q,E="tt.limits.providerOrder",I="tt.limits.providerVisibility",A="tt.limits.displayMode",D="tt.limits.showSubscriptions",O="tt.limits.updatedAt",C="limitsPreferences",X="limitsDisplayMode",Z="tt:limits-prefs-changed",w=Object.freeze({USED:"used",REMAINING:"remaining"}),g=new Set(Object.values(w)),_=new Set([E,I,A,D,O]);function h(){return[...m]}const $=new Set(["devin"]);function b(){return Object.fromEntries(m.map(e=>[e,!$.has(e)]))}function L(e){const r=[];if(Array.isArray(e))for(const o of e)m.includes(o)&&!r.includes(o)&&r.push(o);for(const o of m)r.includes(o)||r.push(o);return r}function P(e){const r=b();if(!e||typeof e!="object"||Array.isArray(e))return r;for(const o of m)typeof e[o]=="boolean"&&(r[o]=e[o]);return r}function ee(e){return g.has(e)?e:w.USED}function k(e){return typeof e=="boolean"?e:!0}function S(e){if(e!=null){if(typeof e=="number")return Number.isSafeInteger(e)?e:void 0;if(typeof e=="string"){const r=e.trim();if(r==="")return;const o=Number(r);return Number.isSafeInteger(o)?o:void 0}}}function y(e={}){const r=e&&typeof e=="object"?e:{};return{displayMode:ee(r.displayMode),providerOrder:L(r.providerOrder),providerVisibility:P(r.providerVisibility),showSubscriptions:k(r.showSubscriptions),updatedAt:S(r.updatedAt)}}function re(){if(typeof window>"u")return h();try{const e=window.localStorage.getItem(E);return L(e?JSON.parse(e):void 0)}catch{return h()}}function R(){if(typeof window>"u")return b();try{const e=window.localStorage.getItem(I);return P(e?JSON.parse(e):void 0)}catch{return b()}}function Se(e){return e===null||_.has(e)}function we(){return R().devin===!0}function te(){if(typeof window>"u")return w.USED;try{const e=window.localStorage.getItem(A);return g.has(e)?e:w.USED}catch{return w.USED}}function ie(){if(typeof window>"u")return!0;try{const e=window.localStorage.getItem(D);return e===null?!0:k(JSON.parse(e))}catch{return!0}}function ne(){if(!(typeof window>"u"))try{return S(window.localStorage.getItem(O))}catch{return}}function oe(){if(typeof window>"u")return!1;try{for(const e of _)if(window.localStorage.getItem(e)!==null)return!0}catch{return!1}return!1}function v(){return y({displayMode:te(),providerOrder:re(),providerVisibility:R(),showSubscriptions:ie(),updatedAt:ne()})}function se(e){if(typeof window>"u")return;const r=y(e);try{window.localStorage.setItem(E,JSON.stringify(r.providerOrder)),window.localStorage.setItem(I,JSON.stringify(r.providerVisibility)),window.localStorage.setItem(A,r.displayMode),window.localStorage.setItem(D,JSON.stringify(r.showSubscriptions)),r.updatedAt===void 0?window.localStorage.removeItem(O):window.localStorage.setItem(O,String(r.updatedAt))}catch(o){console.warn("[tokentracker] limits preferences localStorage write failed:",o)}}function de(e){const r=y(e);return{displayMode:r.displayMode,providerOrder:[...r.providerOrder],providerVisibility:{...r.providerVisibility},showSubscriptions:r.showSubscriptions,updatedAt:r.updatedAt??null}}function ae(...e){let r;for(const d of e){const l=S(d);l!==void 0&&(r=r===void 0?l:Math.max(r,l))}const o=Date.now();return r!==void 0&&o<=r?r+1:o}function ce(e,r){return e.length===r.length&&e.every((o,d)=>o===r[d])}function ue(e,r){return m.every(o=>e[o]===r[o])}function T(e,r){return e.displayMode===r.displayMode&&ce(e.providerOrder,r.providerOrder)&&ue(e.providerVisibility,r.providerVisibility)&&e.showSubscriptions===r.showSubscriptions}function le(e,r){return T(e,r)&&S(e.updatedAt)===S(r.updatedAt)}function N(e,r){const o=S(e.updatedAt),d=S(r.updatedAt);return o!==void 0&&(d===void 0||o>d)}function ye(){const[e,r]=c.useState(v),o=c.useRef(e),d=c.useCallback((i,t={})=>{const n=y(i);return o.current=n,r(n),t.writeLocal&&se(n),typeof window<"u"&&window.dispatchEvent(new CustomEvent(Z)),n},[]),l=c.useCallback(i=>{V()&&B(C,de(i))},[]),u=c.useCallback(i=>{const t=v(),n=N(t,o.current)?d(t):o.current,s=y(i(n));if(T(n,s))return;const p=ae(t.updatedAt,n.updatedAt),f=d({...s,updatedAt:p},{writeLocal:!0});l(f)},[d,l]),U=c.useCallback(i=>{g.has(i)&&u(t=>({...t,displayMode:i}))},[u]),x=c.useCallback(i=>{u(t=>({...t,showSubscriptions:!!i}))},[u]),M=c.useCallback(i=>{if(!g.has(i))return;const t=v();if(t.updatedAt!==void 0){d(t);return}d({...t,displayMode:i,updatedAt:void 0},{writeLocal:!0})},[d]);c.useEffect(()=>{if(!V())return;const i=F(t=>{const n=t?.[C];if(n&&typeof n=="object"){const s=y(n);if(!oe()){d(s,{writeLocal:!0});return}const p=v();if(N(s,p))d(s,{writeLocal:!0});else{const f=d(p);le(s,p)||l(f)}return}M(t?.[X])});return H(),i},[M,d,l]),c.useEffect(()=>{if(typeof window>"u")return;const i=t=>{(t.key===null||_.has(t.key))&&d(v())};return window.addEventListener("storage",i),()=>window.removeEventListener("storage",i)},[d]);const K=c.useCallback(i=>{m.includes(i)&&u(t=>({...t,providerVisibility:{...t.providerVisibility,[i]:!t.providerVisibility[i]}}))},[u]),Y=c.useCallback(i=>{u(t=>{const n=t.providerOrder.indexOf(i);if(n<=0)return t;const s=[...t.providerOrder];return[s[n-1],s[n]]=[s[n],s[n-1]],{...t,providerOrder:s}})},[u]),z=c.useCallback(i=>{u(t=>{const n=t.providerOrder.indexOf(i);if(n<0||n>=t.providerOrder.length-1)return t;const s=[...t.providerOrder];return[s[n],s[n+1]]=[s[n+1],s[n]],{...t,providerOrder:s}})},[u]),G=c.useCallback((i,t)=>{i!==t&&u(n=>{const s=n.providerOrder.indexOf(i),p=n.providerOrder.indexOf(t);if(s<0||p<0)return n;const f=[...n.providerOrder],[J]=f.splice(s,1);return f.splice(p,0,J),{...n,providerOrder:f}})},[u]),q=c.useCallback(()=>{u(()=>({displayMode:w.USED,providerOrder:h(),providerVisibility:b(),showSubscriptions:!0}))},[u]),j=c.useMemo(()=>e.providerOrder.filter(i=>e.providerVisibility[i]!==!1),[e.providerOrder,e.providerVisibility]);return{order:e.providerOrder,visibility:e.providerVisibility,displayMode:e.displayMode,showSubscriptions:e.showSubscriptions,setDisplayMode:U,setShowSubscriptions:x,visibleOrdered:j,toggle:K,moveUp:Y,moveDown:z,moveToward:G,reset:q}}export{Z as L,Se as a,w as b,Q as c,fe as d,we as i,me as l,ye as u};
@@ -1,2 +0,0 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/BotAnimated-Dx_vvTtC.js","assets/__vite-browser-external-DUJeOWgd.js","assets/__vite-browser-external-DFRX9dp-.css","assets/skins-Mc0sI20C.js"])))=>i.map(i=>d[i]);
2
- import{r as s,j as g,a9 as T,P,E as B,aW as M,aX as $,aY as z,aZ as N}from"./__vite-browser-external-DUJeOWgd.js";const I=Object.assign(Object.create(null),{clawd:"clawd",bot:"vector"});function F(e){return I[f(e)]||"atlas"}function f(e){const t=String(e||"").trim().toLowerCase();return/^[a-z0-9](?:[a-z0-9-]{0,62}[a-z0-9])?$/.test(t)?t:"clawd"}const D=.84,U=1.35,V=Object.assign(Object.create(null),{clawd:D,bot:U});function R(e){return V[f(e)]??1}const H={idle:{row:0,durations:[280,110,110,140,140,320]},"running-right":{row:1,durations:[120,120,120,120,120,120,120,220]},"running-left":{row:2,durations:[120,120,120,120,120,120,120,220]},waving:{row:3,durations:[140,140,140,280]},jumping:{row:4,durations:[140,140,140,140,280]},failed:{row:5,durations:[140,140,140,140,140,140,140,240]},waiting:{row:6,durations:[150,150,150,150,150,260]},running:{row:7,durations:[120,120,120,120,120,220]},review:{row:8,durations:[150,150,150,150,150,280]}};function q(e){return["error","disconnected","working-overheated"].includes(e)?"failed":["happy","waking","mini-happy","jumping"].includes(e)?"jumping":["working-typing","working-ultrathink","working-juggling","running"].includes(e)?"running":["working-thinking","working-wizard","review"].includes(e)?"review":["sleeping","idle-doze","mini-sleep","waiting"].includes(e)?"waiting":["mini-peek","waving"].includes(e)?"waving":e==="running-left"||e==="running-right"?e:"idle"}function W(){const[e,t]=s.useState(()=>typeof document>"u"?!0:document.visibilityState!=="hidden");return s.useEffect(()=>{if(typeof document>"u")return;const n=()=>t(document.visibilityState!=="hidden");return document.addEventListener("visibilitychange",n),()=>document.removeEventListener("visibilitychange",n)},[]),e}function K(){const[e,t]=s.useState(()=>typeof window>"u"||typeof window.matchMedia!="function"?!1:window.matchMedia("(prefers-reduced-motion: reduce)").matches);return s.useEffect(()=>{if(typeof window.matchMedia!="function")return;const n=window.matchMedia("(prefers-reduced-motion: reduce)"),i=o=>t(o.matches);return n.addEventListener("change",i),()=>n.removeEventListener("change",i)},[]),e}function X({character:e,pet:t=null,state:n="idle-living",dragState:i=null,size:o=48,className:d="",lookDirectionIndex:l=null}){const r=f(e),u=i==="running-left"||i==="running-right"?i:q(n),c=H[u],a=t?.spriteVersionNumber===2?2:1,p=a===2?11:9,w=a===2&&u==="idle"&&Number.isInteger(l)?(l%16+16)%16:null,h=w==null?c.row:9+Math.floor(w/8),m=w==null?null:w%8,k=K(),b=W(),[y,S]=s.useState(0);s.useEffect(()=>{if(S(0),k||!b||w!=null)return;let E=!1,A=0;const _=C=>{A=window.setTimeout(()=>{if(E)return;const L=(C+1)%c.durations.length;S(L),_(L)},c.durations[C])};return _(0),()=>{E=!0,window.clearTimeout(A)}},[w,k,b,c]);const O=s.useMemo(()=>({width:o*(192/208),height:o,backgroundImage:`url(${t?.assetUrl||`/pets/${r}/spritesheet.webp`})`,backgroundRepeat:"no-repeat",backgroundSize:`800% ${p*100}%`,backgroundPosition:`${(m??y)/7*100}% ${h/(p-1)*100}%`,imageRendering:"pixelated"}),[p,m,h,y,r,t?.assetUrl,o]);return g.jsx("div",{"aria-hidden":"true",className:`pet-atlas-animated ${d}`,style:O})}const G=s.lazy(()=>T(()=>import("./BotAnimated-Dx_vvTtC.js"),__vite__mapDeps([0,1,2,3])).then(e=>({default:e.BotAnimated}))),x={"idle-living":"idle/living.svg","idle-doze":"idle/doze.svg","idle-follow":"idle/follow.svg","idle-look":"idle/look.svg","idle-yawn":"idle/yawn.svg","idle-collapse":"idle/collapse.svg","working-building":"working/building.svg","working-carrying":"working/carrying.svg","working-conducting":"working/conducting.svg","working-confused":"working/confused.svg","working-debugger":"working/debugger.svg","working-juggling":"working/juggling.svg","working-overheated":"working/overheated.svg","working-pushing":"working/pushing.svg","working-sweeping":"working/sweeping.svg","working-thinking":"working/thinking.svg","working-typing":"working/typing.svg","working-ultrathink":"working/ultrathink.svg","working-wizard":"working/wizard.svg","mini-alert":"mini/alert.svg","mini-crabwalk":"mini/crabwalk.svg","mini-enter":"mini/enter.svg","mini-enter-sleep":"mini/enter-sleep.svg","mini-happy":"mini/happy.svg","mini-idle":"mini/idle.svg","mini-peek":"mini/peek.svg","mini-sleep":"mini/sleep.svg","react-double":"react/double.svg","react-drag":"react/drag.svg","react-left":"react/left.svg","react-right":"react/right.svg","collapse-sleep":"sleep/collapse-sleep.svg",sleeping:"sleep/sleeping.svg",wake:"sleep/wake.svg",disconnected:"status/disconnected.svg",error:"status/error.svg",notification:"status/notification.svg",happy:"happy.svg","static-base":"static-base.svg"},v=new Map;async function Y(e){if(v.has(e))return v.get(e);if(typeof fetch!="function")return null;let t;try{t=await fetch(`/clawd/${e}`)}catch{return null}if(!t.ok)return null;const i=(await t.text()).replace(/<svg([^>]*)>/,(o,d)=>`<svg${d.replace(/\s+width="[^"]*"/g,"").replace(/\s+height="[^"]*"/g,"")} width="100%" height="100%">`);return v.set(e,i),i}function Z({state:e="idle-living",size:t=48,className:n=""}){const[i,o]=s.useState(""),d=s.useRef(null),r=J()?"static-base":e,u=x[r]||x["static-base"];return s.useEffect(()=>{let c=!1;return Y(u).then(a=>{!c&&a&&o(a)}),()=>{c=!0}},[u]),s.useEffect(()=>{const c=d.current?.querySelector("svg");if(c)try{const a=c.getBBox();a.width>0&&a.height>0&&c.setAttribute("viewBox",`${a.x-2} ${a.y-2} ${a.width+4} ${a.height+4}`)}catch{}},[i]),g.jsx("div",{ref:d,"aria-hidden":"true",className:`clawd-animated ${n}`,style:{width:t,height:t,display:"inline-flex",alignItems:"center",justifyContent:"center",overflow:"hidden"},dangerouslySetInnerHTML:{__html:i}})}function ae({state:e="idle-living",size:t=48,className:n="",character:i="clawd",pet:o=null,lookDirectionIndex:d=null,botColor:l="auto"}){const r=f(i),u=F(r);return u==="vector"?g.jsx(s.Suspense,{fallback:g.jsx("span",{"aria-hidden":"true",style:{width:t,height:t,display:"inline-block"}}),children:g.jsx(G,{state:e,size:t*R(r),className:n,color:l})}):u==="atlas"?g.jsx(X,{character:r,pet:o,state:e,size:t,className:n,lookDirectionIndex:d}):g.jsx(Z,{state:e,size:t*R(r),className:n})}function J(){const[e,t]=s.useState(()=>typeof window>"u"||typeof window.matchMedia!="function"?!1:window.matchMedia("(prefers-reduced-motion: reduce)").matches);return s.useEffect(()=>{if(typeof window.matchMedia!="function")return;const n=window.matchMedia("(prefers-reduced-motion: reduce)"),i=o=>t(o.matches);return n.addEventListener("change",i),()=>n.removeEventListener("change",i)},[]),e}const le="cercle",Q="neutre",ee="encre",te="creme",ce={light:"#f8fafc",dark:"#0f172a"};function ne(e){return e?te:ee}const j=["auto","bleu","turquoise","vert","ambre","rose","violet"];function de(e,t){const n=String(e||"auto");return n==="auto"||!j.includes(n)?ne(t):n}const ie={"idle-living":{state:"idle",expression:"neutre"},"idle-look":{state:"idle",expression:"curieux"},"idle-follow":{state:"idle",expression:"attentif"},"idle-yawn":{state:"idle",expression:"somnolent"},"static-base":{state:"idle",expression:"neutre"},sleeping:{state:"sleep"},"idle-doze":{state:"sleep"},"idle-collapse":{state:"sleep"},"collapse-sleep":{state:"sleep"},"mini-enter-sleep":{state:"sleep"},"mini-sleep":{state:"sleep"},waiting:{state:"sleep"},"working-typing":{state:"thinking"},"working-thinking":{state:"thinking"},"working-building":{state:"thinking"},"working-debugger":{state:"thinking"},running:{state:"thinking"},review:{state:"thinking"},"working-juggling":{state:"orbit"},"working-wizard":{state:"orbit"},"working-carrying":{state:"orbit"},"working-conducting":{state:"orbit"},"working-ultrathink":{state:"swirl"},"working-overheated":{state:"burst"},"working-confused":{state:"wide"},error:{state:"alert"},disconnected:{state:"alert"},happy:{state:"play"},jumping:{state:"play"},"mini-happy":{state:"play"},waking:{state:"play"},wake:{state:"play"},"react-double":{state:"play"},notification:{state:"notify"},"mini-alert":{state:"notify"},"mini-peek":{state:"wink"},waving:{state:"wink"},"mini-idle":{state:"idle",expression:"neutre"},"mini-enter":{state:"wink"},"running-left":{state:"comet"},"running-right":{state:"comet"},"react-drag":{state:"comet"}},re={state:"idle",expression:Q};function ue(e){return ie[e]||re}const se={visible:!1,character:"clawd",size:"medium",botColor:"auto"};function ge(){const e=(P()||B())&&M(),[t,n]=s.useState(se),[i,o]=s.useState(!1);s.useEffect(()=>{if(!e)return;const l=$(r=>{o(!0),n({visible:!!r.visible,character:f(r.character),size:["small","medium","large"].includes(r.size)?r.size:"medium",botColor:j.includes(r.botColor)?r.botColor:"auto"})});return z(),l},[e]);const d=s.useCallback((l,r)=>{n(u=>({...u,[l]:r})),e&&N(l,r)},[e]);return{available:e,loaded:i,settings:t,setSetting:d}}export{j as B,ae as C,ee as a,te as b,le as c,ce as d,ue as e,F as p,de as r,ge as u};
@@ -1 +0,0 @@
1
- import{r as o}from"./__vite-browser-external-DUJeOWgd.js";import{h as r,i as t,p as s}from"./react-B7SkZTgg.js";function i(){!r.current&&t();const[e]=o.useState(s.current);return e}export{i as u};
@@ -1 +0,0 @@
1
- import{aL as z,bx as oe,bw as me,by as te,bz as U,bA as je,bB as Me,bC as ze,bD as qt,bE as Et,bF as Kt,bG as Ye,bH as Ct,bI as $e,bJ as Ne,bK as gt,bL as Pt,r as b,an as Gt,aK as xe,aJ as Jt,aM as Qt,bM as Zt,a1 as en,_ as tn}from"./__vite-browser-external-DUJeOWgd.js";import{a as nn,c as Ee,z as on}from"./composite-B4Z3F65o.js";const de=Math.min,q=Math.max,Le=Math.round,Ce=Math.floor,K=e=>({x:e,y:e}),sn={left:"right",right:"left",bottom:"top",top:"bottom"};function Mt(e,t,n){return q(e,de(t,n))}function ne(e,t){return typeof e=="function"?e(t):e}function j(e){return e.split("-")[0]}function G(e){return e.split("-")[1]}function Ue(e){return e==="x"?"y":"x"}function qe(e){return e==="y"?"height":"width"}function X(e){const t=e[0];return t==="t"||t==="b"?"y":"x"}function Ke(e){return Ue(X(e))}function rn(e,t,n){n===void 0&&(n=!1);const o=G(e),i=Ke(e),s=qe(i);let r=i==="x"?o===(n?"end":"start")?"right":"left":o==="start"?"bottom":"top";return t.reference[s]>t.floating[s]&&(r=De(r)),[r,De(r)]}function cn(e){const t=De(e);return[Xe(e),t,Xe(t)]}function Xe(e){return e.includes("start")?e.replace("start","end"):e.replace("end","start")}const ht=["left","right"],pt=["right","left"],ln=["top","bottom"],fn=["bottom","top"];function an(e,t,n){switch(e){case"top":case"bottom":return n?t?pt:ht:t?ht:pt;case"left":case"right":return t?ln:fn;default:return[]}}function un(e,t,n,o){const i=G(e);let s=an(j(e),n==="start",o);return i&&(s=s.map(r=>r+"-"+i),t&&(s=s.concat(s.map(Xe)))),s}function De(e){const t=j(e);return sn[t]+e.slice(t.length)}function dn(e){var t,n,o,i;return{top:(t=e.top)!=null?t:0,right:(n=e.right)!=null?n:0,bottom:(o=e.bottom)!=null?o:0,left:(i=e.left)!=null?i:0}}function Lt(e){return typeof e!="number"?dn(e):{top:e,right:e,bottom:e,left:e}}function Te(e){const{x:t,y:n,width:o,height:i}=e;return{width:o,height:i,top:n,left:t,right:t+o,bottom:n+i,x:t,y:n}}function xt(e,t,n){let{reference:o,floating:i}=e;const s=X(t),r=Ke(t),c=qe(r),l=j(t),f=s==="y",u=o.x+o.width/2-i.width/2,g=o.y+o.height/2-i.height/2,d=o[c]/2-i[c]/2;let a;switch(l){case"top":a={x:u,y:o.y-i.height};break;case"bottom":a={x:u,y:o.y+o.height};break;case"right":a={x:o.x+o.width,y:g};break;case"left":a={x:o.x-i.width,y:g};break;default:a={x:o.x,y:o.y}}const m=G(t);return m&&(a[r]+=d*(m==="end"?1:-1)*(n&&f?-1:1)),a}async function mn(e,t){var n;t===void 0&&(t={});const{x:o,y:i,platform:s,rects:r,elements:c,strategy:l}=e,{boundary:f="clippingAncestors",rootBoundary:u="viewport",elementContext:g="floating",altBoundary:d=!1,padding:a=0}=ne(t,e),m=Lt(a),p=c[d?g==="floating"?"reference":"floating":g],w=Te(await s.getClippingRect({element:(n=await(s.isElement==null?void 0:s.isElement(p)))==null||n?p:p.contextElement||await(s.getDocumentElement==null?void 0:s.getDocumentElement(c.floating)),boundary:f,rootBoundary:u,strategy:l})),x=g==="floating"?{x:o,y:i,width:r.floating.width,height:r.floating.height}:r.reference,R=await(s.getOffsetParent==null?void 0:s.getOffsetParent(c.floating)),y=await(s.isElement==null?void 0:s.isElement(R))&&await(s.getScale==null?void 0:s.getScale(R))||{x:1,y:1},A=Te(s.convertOffsetParentRelativeRectToViewportRelativeRect?await s.convertOffsetParentRelativeRectToViewportRelativeRect({elements:c,rect:x,offsetParent:R,strategy:l}):x);return{top:(w.top-A.top+m.top)/y.y,bottom:(A.bottom-w.bottom+m.bottom)/y.y,left:(w.left-A.left+m.left)/y.x,right:(A.right-w.right+m.right)/y.x}}const gn=50,hn=async(e,t,n)=>{const{placement:o="bottom",strategy:i="absolute",middleware:s=[],platform:r}=n,c=r.detectOverflow?r:{...r,detectOverflow:mn},l=await(r.isRTL==null?void 0:r.isRTL(t));let f=await r.getElementRects({reference:e,floating:t,strategy:i}),{x:u,y:g}=xt(f,o,l),d=o,a=0;const m={};for(let h=0;h<s.length;h++){const p=s[h];if(!p)continue;const{name:w,fn:x}=p,{x:R,y,data:A,reset:v}=await x({x:u,y:g,initialPlacement:o,placement:d,strategy:i,middlewareData:m,rects:f,platform:c,elements:{reference:e,floating:t}});u=R??u,g=y??g,m[w]={...m[w],...A},v&&a<gn&&(a++,typeof v=="object"&&(v.placement&&(d=v.placement),v.rects&&(f=v.rects===!0?await r.getElementRects({reference:e,floating:t,strategy:i}):v.rects),{x:u,y:g}=xt(f,d,l)),h=-1)}return{x:u,y:g,placement:d,strategy:i,middlewareData:m}},pn=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var n,o;const{placement:i,middlewareData:s,rects:r,initialPlacement:c,platform:l,elements:f}=t,{mainAxis:u=!0,crossAxis:g=!0,fallbackPlacements:d,fallbackStrategy:a="bestFit",fallbackAxisSideDirection:m="none",flipAlignment:h=!0,...p}=ne(e,t);if((n=s.arrow)!=null&&n.alignmentOffset)return{};const w=j(i),x=X(c),R=j(c)===c,y=await(l.isRTL==null?void 0:l.isRTL(f.floating)),A=d||(R||!h?[De(c)]:cn(c)),v=m!=="none";!d&&v&&A.push(...un(c,h,m,y));const P=[c,...A],S=await l.detectOverflow(t,p),L=[];let M=((o=s.flip)==null?void 0:o.overflows)||[];if(u&&L.push(S[w]),g){const k=rn(i,r,y);L.push(S[k[0]],S[k[1]])}if(M=[...M,{placement:i,overflows:L}],!L.every(k=>k<=0)){var E,$;const k=(((E=s.flip)==null?void 0:E.index)||0)+1,V=P[k];if(V&&(!(g==="alignment"?x!==X(V):!1)||M.every(O=>X(O.placement)===x?O.overflows[0]>0:!0)))return{data:{index:k,overflows:M},reset:{placement:V}};let T=($=M.filter(F=>F.overflows[0]<=0).sort((F,O)=>F.overflows[1]-O.overflows[1])[0])==null?void 0:$.placement;if(!T)switch(a){case"bestFit":{var W;const F=(W=M.filter(O=>{if(v){const H=X(O.placement);return H===x||H==="y"}return!0}).map(O=>[O.placement,O.overflows.filter(H=>H>0).reduce((H,B)=>H+B,0)]).sort((O,H)=>O[1]-H[1])[0])==null?void 0:W[0];F&&(T=F);break}case"initialPlacement":T=c;break}if(i!==T)return{reset:{placement:T}}}return{}}}},Dt=new Set(["left","top"]);async function xn(e,t){const{placement:n,platform:o,elements:i}=e,s=await(o.isRTL==null?void 0:o.isRTL(i.floating)),r=j(n),c=G(n),l=X(n)==="y",f=Dt.has(r)?-1:1,u=s&&l?-1:1,g=ne(t,e);let{mainAxis:d,crossAxis:a,alignmentAxis:m}=typeof g=="number"?{mainAxis:g,crossAxis:0,alignmentAxis:null}:{mainAxis:g.mainAxis||0,crossAxis:g.crossAxis||0,alignmentAxis:g.alignmentAxis};return c&&typeof m=="number"&&(a=c==="end"?m*-1:m),l?{x:a*u,y:d*f}:{x:d*f,y:a*u}}const wn=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,o;const{x:i,y:s,placement:r,middlewareData:c}=t,l=await xn(t,e);return r===((n=c.offset)==null?void 0:n.placement)&&(o=c.arrow)!=null&&o.alignmentOffset?{}:{x:i+l.x,y:s+l.y,data:{...l,placement:r}}}}},yn=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:o,placement:i,platform:s}=t,{mainAxis:r=!0,crossAxis:c=!1,limiter:l={fn:x=>{let{x:R,y}=x;return{x:R,y}}},...f}=ne(e,t),u={x:n,y:o},g=await s.detectOverflow(t,f),d=X(i),a=Ue(d);let m=u[a],h=u[d];const p=(x,R)=>Mt(R+g[x==="y"?"top":"left"],R,R-g[x==="y"?"bottom":"right"]);r&&(m=p(a,m)),c&&(h=p(d,h));const w=l.fn({...t,[a]:m,[d]:h});return{...w,data:{x:w.x-n,y:w.y-o,enabled:{[a]:r,[d]:c}}}}}},bn=function(e){return e===void 0&&(e={}),{options:e,fn(t){var n,o;const{x:i,y:s,placement:r,rects:c,middlewareData:l}=t,{offset:f=0,mainAxis:u=!0,crossAxis:g=!0}=ne(e,t),d={x:i,y:s},a=X(r),m=Ue(a);let h=d[m],p=d[a];const w=ne(f,t),x=typeof w=="number"?{mainAxis:w,crossAxis:0}:{mainAxis:(n=w.mainAxis)!=null?n:0,crossAxis:(o=w.crossAxis)!=null?o:0};if(u){const A=m==="y"?"height":"width",v=c.reference[m]-c.floating[A]+x.mainAxis,P=c.reference[m]+c.reference[A]-x.mainAxis;h<v?h=v:h>P&&(h=P)}if(g){var R,y;const A=m==="y"?"width":"height",v=Dt.has(j(r)),P=c.reference[a]-c.floating[A]+(v&&((R=l.offset)==null?void 0:R[a])||0)+(v?0:x.crossAxis),S=c.reference[a]+c.reference[A]+(v?0:((y=l.offset)==null?void 0:y[a])||0)-(v?x.crossAxis:0);p<P?p=P:p>S&&(p=S)}return{[m]:h,[a]:p}}}},vn=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){const{placement:n,rects:o,platform:i,elements:s}=t,{apply:r=()=>{},...c}=ne(e,t),l=await i.detectOverflow(t,c),f=j(n),u=G(n),g=X(n)==="y",{width:d,height:a}=o.floating;let m,h;f==="top"||f==="bottom"?(m=f,h=u===(await(i.isRTL==null?void 0:i.isRTL(s.floating))?"start":"end")?"left":"right"):(h=f,m=u==="end"?"top":"bottom");const p=a-l.top-l.bottom,w=d-l.left-l.right,x=de(a-l[m],p),R=de(d-l[h],w),y=t.middlewareData.shift,A=!y;let v=x,P=R;y!=null&&y.enabled.x&&(P=w),y!=null&&y.enabled.y&&(v=p),A&&!u&&(g?P=d-2*q(l.left,l.right):v=a-2*q(l.top,l.bottom)),await r({...t,availableWidth:P,availableHeight:v});const S=await i.getDimensions(s.floating);return d!==S.width||a!==S.height?{reset:{rects:!0}}:{}}}};function Tt(e){const t=te(e);let n=parseFloat(t.width)||0,o=parseFloat(t.height)||0;const i=me(e),s=i?e.offsetWidth:n,r=i?e.offsetHeight:o,c=Le(n)!==s||Le(o)!==r;return c&&(n=s,o=r),{width:n,height:o,$:c}}function Ge(e){return z(e)?e:e.contextElement}function ue(e){const t=Ge(e);if(!me(t))return K(1);const n=t.getBoundingClientRect(),{width:o,height:i,$:s}=Tt(t);let r=(s?Le(n.width):n.width)/o,c=(s?Le(n.height):n.height)/i;return(!r||!Number.isFinite(r))&&(r=1),(!c||!Number.isFinite(c))&&(c=1),{x:r,y:c}}const Rn=K(0);function Ft(e){const t=U(e);return!Pt()||!t.visualViewport?Rn:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function An(e,t,n){return t===void 0&&(t=!1),!!n&&t&&n===U(e)}function se(e,t,n,o){t===void 0&&(t=!1),n===void 0&&(n=!1);const i=e.getBoundingClientRect(),s=Ge(e);let r=K(1);t&&(o?z(o)&&(r=ue(o)):r=ue(e));const c=An(s,n,o)?Ft(s):K(0);let l=(i.left+c.x)/r.x,f=(i.top+c.y)/r.y,u=i.width/r.x,g=i.height/r.y;if(s&&o){const d=U(s),a=z(o)?U(o):o;let m=d,h=gt(m);for(;h&&a!==m;){const p=ue(h),w=h.getBoundingClientRect(),x=te(h),R=w.left+(h.clientLeft+parseFloat(x.paddingLeft))*p.x,y=w.top+(h.clientTop+parseFloat(x.paddingTop))*p.y;l*=p.x,f*=p.y,u*=p.x,g*=p.y,l+=R,f+=y,m=U(h),h=gt(m)}}return Te({width:u,height:g,x:l,y:f})}function ke(e,t){const n=$e(e).scrollLeft;return t?t.left+n:se(oe(e)).left+n}function $t(e,t){const n=e.getBoundingClientRect(),o=n.left+t.scrollLeft-ke(e,n),i=n.top+t.scrollTop;return{x:o,y:i}}function On(e){let{elements:t,rect:n,offsetParent:o,strategy:i}=e;const s=i==="fixed",r=oe(o),c=t?je(t.floating):!1;if(o===r||c&&s)return n;let l={scrollLeft:0,scrollTop:0},f=K(1);const u=K(0),g=me(o);if((g||!s)&&((Ye(o)!=="body"||Ct(r))&&(l=$e(o)),g)){const a=se(o);f=ue(o),u.x=a.x+o.clientLeft,u.y=a.y+o.clientTop}const d=r&&!g&&!s?$t(r,l):K(0);return{width:n.width*f.x,height:n.height*f.y,x:n.x*f.x-l.scrollLeft*f.x+u.x+d.x,y:n.y*f.y-l.scrollTop*f.y+u.y+d.y}}function Sn(e){return e.getClientRects?Array.from(e.getClientRects()):[]}function En(e){const t=$e(e),n=e.ownerDocument.body,o=q(e.scrollWidth,e.clientWidth,n.scrollWidth,n.clientWidth),i=q(e.scrollHeight,e.clientHeight,n.scrollHeight,n.clientHeight);let s=-t.scrollLeft+ke(e);const r=-t.scrollTop;return te(n).direction==="rtl"&&(s+=q(e.clientWidth,n.clientWidth)-o),{width:o,height:i,x:s,y:r}}const Cn=25;function Pn(e,t,n){n===void 0&&(n="viewport");const o=n==="layoutViewport",i=U(e),s=oe(e),r=i.visualViewport;let c=s.clientWidth,l=s.clientHeight,f=0,u=0;if(r){const d=!Pt()||t==="fixed";o?d||(f=-r.offsetLeft,u=-r.offsetTop):(c=r.width,l=r.height,d&&(f=r.offsetLeft,u=r.offsetTop))}if(ke(s)<=0){const d=s.ownerDocument,a=d.body,m=getComputedStyle(a),h=d.compatMode==="CSS1Compat"&&parseFloat(m.marginLeft)+parseFloat(m.marginRight)||0,p=Math.abs(s.clientWidth-a.clientWidth-h),w=getComputedStyle(s).scrollbarGutter==="stable both-edges"?p/2:p;w<=Cn&&(c-=w)}return{width:c,height:l,x:f,y:u}}function Mn(e,t){const n=se(e,!0,t==="fixed"),o=n.top+e.clientTop,i=n.left+e.clientLeft,s=ue(e),r=e.clientWidth*s.x,c=e.clientHeight*s.y,l=i*s.x,f=o*s.y;return{width:r,height:c,x:l,y:f}}function wt(e,t,n){let o;if(t==="viewport"||t==="layoutViewport")o=Pn(e,n,t);else if(t==="document")o=En(oe(e));else if(z(t))o=Mn(t,n);else{const i=Ft(e);o={x:t.x-i.x,y:t.y-i.y,width:t.width,height:t.height}}return Te(o)}function Ln(e,t){const n=t.get(e);if(n)return n;let o=Ne(e,[],!1).filter(c=>z(c)&&Ye(c)!=="body"),i=null;const s=te(e).position==="fixed";let r=s?Me(e):e;for(;z(r)&&!ze(r);){const c=te(r),l=Et(r),f=i?i.position:s?"fixed":"";!l&&(f==="fixed"||f==="absolute"&&c.position==="static")?o=o.filter(g=>g!==r):i=c,r=Me(r)}return t.set(e,o),o}function Dn(e){let{element:t,boundary:n,rootBoundary:o,strategy:i}=e;const r=[...n==="clippingAncestors"?je(t)?[]:Ln(t,this._c):[].concat(n),o],c=wt(t,r[0],i);let l=c.top,f=c.right,u=c.bottom,g=c.left;for(let d=1;d<r.length;d++){const a=wt(t,r[d],i);l=q(a.top,l),f=de(a.right,f),u=de(a.bottom,u),g=q(a.left,g)}return{width:f-g,height:u-l,x:g,y:l}}function Tn(e){const{width:t,height:n}=Tt(e);return{width:t,height:n}}function Fn(e,t,n){const o=me(t),i=oe(t),s=n==="fixed",r=se(e,!0,s,t);let c={scrollLeft:0,scrollTop:0};const l=K(0);if((o||!s)&&((Ye(t)!=="body"||Ct(i))&&(c=$e(t)),o)){const d=se(t,!0,s,t);l.x=d.x+t.clientLeft,l.y=d.y+t.clientTop}!o&&i&&(l.x=ke(i));const f=i&&!o&&!s?$t(i,c):K(0),u=r.left+c.scrollLeft-l.x-f.x,g=r.top+c.scrollTop-l.y-f.y;return{x:u,y:g,width:r.width,height:r.height}}function _e(e){return te(e).position==="static"}function yt(e,t){if(!me(e)||te(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return oe(e)===n&&(n=n.ownerDocument.body),n}function kt(e,t){const n=U(e);if(je(e))return n;if(!me(e)){let i=Me(e);for(;i&&!ze(i);){if(z(i)&&!_e(i))return i;i=Me(i)}return n}let o=yt(e,t);for(;o&&qt(o)&&_e(o);)o=yt(o,t);return o&&ze(o)&&_e(o)&&!Et(o)?n:o||Kt(e)||n}const $n=async function(e){const t=this.getOffsetParent||kt,n=this.getDimensions,o=await n(e.floating);return{reference:Fn(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:o.width,height:o.height}}};function kn(e){return te(e).direction==="rtl"}const Wn={convertOffsetParentRelativeRectToViewportRelativeRect:On,getDocumentElement:oe,getClippingRect:Dn,getOffsetParent:kt,getElementRects:$n,getClientRects:Sn,getDimensions:Tn,getScale:ue,isElement:z,isRTL:kn};function Wt(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function Vn(e,t,n){let o=null,i;const s=oe(e);function r(){var u;clearTimeout(i),(u=o)==null||u.disconnect(),o=null}function c(u,g){u===void 0&&(u=!1),g===void 0&&(g=1),r();const d=e.getBoundingClientRect(),{left:a,top:m,width:h,height:p}=d;if(u||t(),!h||!p)return;const w=Ce(m),x=Ce(s.clientWidth-(a+h)),R=Ce(s.clientHeight-(m+p)),y=Ce(a),v={rootMargin:-w+"px "+-x+"px "+-R+"px "+-y+"px",threshold:q(0,de(1,g))||1};let P=!0;function S(L){const M=L[0].intersectionRatio;if(!Wt(d,e.getBoundingClientRect()))return c();if(M!==g){if(!P)return c();M?c(!1,M):i=setTimeout(()=>{c(!1,1e-7)},1e3)}P=!1}try{o=new IntersectionObserver(S,{...v,root:s.ownerDocument})}catch{o=new IntersectionObserver(S,v)}o.observe(e)}const l=U(e),f=()=>c(n);return l.addEventListener("resize",f),c(!0),()=>{l.removeEventListener("resize",f),r()}}function bt(e,t,n,o){o===void 0&&(o={});const{ancestorScroll:i=!0,ancestorResize:s=!0,elementResize:r=typeof ResizeObserver=="function",layoutShift:c=typeof IntersectionObserver=="function",animationFrame:l=!1}=o,f=Ge(e),u=i||s?[...f?Ne(f):[],...t?Ne(t):[]]:[];u.forEach(w=>{i&&w.addEventListener("scroll",n),s&&w.addEventListener("resize",n)});const g=f&&c?Vn(f,n,s):null;let d=-1,a=null;r&&(a=new ResizeObserver(w=>{let[x]=w;x&&x.target===f&&a&&t&&(a.unobserve(t),cancelAnimationFrame(d),d=requestAnimationFrame(()=>{var R;(R=a)==null||R.observe(t)})),n()}),f&&!l&&a.observe(f),t&&a.observe(t));let m,h=l?se(e):null;l&&p();function p(){const w=se(e);h&&!Wt(h,w)&&n(),h=w,m=requestAnimationFrame(p)}return n(),()=>{var w;u.forEach(x=>{i&&x.removeEventListener("scroll",n),s&&x.removeEventListener("resize",n)}),g?.(),(w=a)==null||w.disconnect(),a=null,l&&cancelAnimationFrame(m)}}const Bn=wn,Hn=yn,_n=pn,In=vn,zn=bn,Nn=(e,t,n)=>{const o=new Map,i=n??{},s={...Wn,...i.platform,_c:o};return hn(e,t,{...i,platform:s})};var Xn=typeof document<"u",jn=function(){},Pe=Xn?b.useLayoutEffect:jn;function Fe(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e=="function"&&e.toString()===t.toString())return!0;let n,o,i;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(o=n;o--!==0;)if(!Fe(e[o],t[o]))return!1;return!0}if(i=Object.keys(e),n=i.length,n!==Object.keys(t).length)return!1;for(o=n;o--!==0;)if(!{}.hasOwnProperty.call(t,i[o]))return!1;for(o=n;o--!==0;){const s=i[o];if(!(s==="_owner"&&e.$$typeof)&&!Fe(e[s],t[s]))return!1}return!0}return e!==e&&t!==t}function Vt(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function vt(e,t){const n=Vt(e);return Math.round(t*n)/n}function Ie(e){const t=b.useRef(e);return Pe(()=>{t.current=e}),t}function Yn(e){e===void 0&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:o=[],platform:i,elements:{reference:s,floating:r}={},transform:c=!0,whileElementsMounted:l,open:f}=e,[u,g]=b.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[d,a]=b.useState(o);Fe(d,o)||a(o);const[m,h]=b.useState(null),[p,w]=b.useState(null),x=b.useCallback(O=>{O!==v.current&&(v.current=O,h(O))},[]),R=b.useCallback(O=>{O!==P.current&&(P.current=O,w(O))},[]),y=s||m,A=r||p,v=b.useRef(null),P=b.useRef(null),S=b.useRef(u),L=l!=null,M=Ie(l),E=Ie(i),$=Ie(f),W=b.useCallback(()=>{if(!v.current||!P.current)return;const O={placement:t,strategy:n,middleware:d};E.current&&(O.platform=E.current),Nn(v.current,P.current,O).then(H=>{const B={...H,isPositioned:$.current!==!1};k.current&&!Fe(S.current,B)&&(S.current=B,Gt.flushSync(()=>{g(B)}))})},[d,t,n,E,$]);Pe(()=>{f===!1&&S.current.isPositioned&&(S.current.isPositioned=!1,g(O=>({...O,isPositioned:!1})))},[f]);const k=b.useRef(!1);Pe(()=>(k.current=!0,()=>{k.current=!1}),[]),Pe(()=>{if(y&&(v.current=y),A&&(P.current=A),y&&A){if(M.current)return M.current(y,A,W);W()}},[y,A,W,M,L]);const V=b.useMemo(()=>({reference:v,floating:P,setReference:x,setFloating:R}),[x,R]),T=b.useMemo(()=>({reference:y,floating:A}),[y,A]),F=b.useMemo(()=>{const O={position:n,left:0,top:0};if(!T.floating)return O;const H=vt(T.floating,u.x),B=vt(T.floating,u.y);return c?{...O,transform:"translate("+H+"px, "+B+"px)",...Vt(T.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:H,top:B}},[n,c,T.floating,u.x,u.y]);return b.useMemo(()=>({...u,update:W,refs:V,elements:T,floatingStyles:F}),[u,W,V,T,F])}const Un=(e,t)=>{const n=Bn(e);return{name:n.name,fn:n.fn,options:[e,t]}},qn=(e,t)=>{const n=Hn(e);return{name:n.name,fn:n.fn,options:[e,t]}},Kn=(e,t)=>({fn:zn(e).fn,options:[e,t]}),Gn=(e,t)=>{const n=_n(e);return{name:n.name,fn:n.fn,options:[e,t]}},Jn=(e,t)=>{const n=In(e);return{name:n.name,fn:n.fn,options:[e,t]}};function Qn(e){return Zn(e,e.rootContext)}function Zn(e,t){const{nodeId:n,externalTree:o}=e,i=t.useState("referenceElement"),s=t.useState("floatingElement"),r=t.useState("domReferenceElement"),c=t.useState("open"),l=t.useState("floatingId"),[f,u]=b.useState(null),[g,d]=b.useState(void 0),[a,m]=b.useState(void 0),h=b.useRef(null),p=nn(o),w=b.useMemo(()=>({reference:i,floating:s,domReference:r}),[i,s,r]),x=Yn({...e,elements:{...w,...f&&{reference:f}}}),R=z(g)?g:null,y=a===void 0?t.state.floatingElement:a;t.useSyncedValue("referenceElement",g??null),t.useSyncedValue("domReferenceElement",g===void 0?r:R),t.useSyncedValue("floatingElement",y);const A=b.useCallback(E=>{const $=z(E)?{getBoundingClientRect:()=>E.getBoundingClientRect(),getClientRects:()=>E.getClientRects(),contextElement:E}:E;u($),x.refs.setReference($)},[x.refs]),v=b.useCallback(E=>{(z(E)||E===null)&&(h.current=E,d(E)),(z(x.refs.reference.current)||x.refs.reference.current===null||E!==null&&!z(E))&&x.refs.setReference(E)},[x.refs,d]),P=b.useCallback(E=>{m(E),x.refs.setFloating(E)},[x.refs]),S=b.useMemo(()=>({...x.refs,setReference:v,setFloating:P,setPositionReference:A,domReference:h}),[x.refs,v,P,A]),L=b.useMemo(()=>({...x.elements,domReference:r}),[x.elements,r]),M=b.useMemo(()=>({...x,dataRef:t.context.dataRef,open:c,onOpenChange:t.setOpen,events:t.context.events,floatingId:l,refs:S,elements:L,nodeId:n,rootStore:t}),[x,S,L,n,t,c,l]);return xe(()=>{r&&(h.current=r)},[r]),xe(()=>{t.context.dataRef.current.floatingContext=M;const E=p?.nodesRef.current.find($=>$.id===n);E&&(E.context=M)}),b.useMemo(()=>({...x,context:M,refs:S,elements:L,rootStore:t}),[x,S,L,M,t])}const eo=b.createContext(void 0);function to(){return b.useContext(eo)?.direction??"ltr"}const no=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:o,placement:i,rects:s,platform:r,elements:c,middlewareData:l}=t,{element:f,padding:u=0,offsetParent:g="real"}=ne(e,t)||{};if(f==null)return{};const d=Lt(u),a={x:n,y:o},m=Ke(i),h=qe(m),p=await r.getDimensions(f),w=m==="y",x=w?"top":"left",R=w?"bottom":"right",y=w?"clientHeight":"clientWidth",A=s.reference[h]+s.reference[m]-a[m]-s.floating[h],v=a[m]-s.reference[m],P=g==="real"?await r.getOffsetParent?.(f):c.floating;let S=c.floating[y]||s.floating[h];(!S||!await r.isElement?.(P))&&(S=c.floating[y]||s.floating[h]);const L=A/2-v/2,M=S/2-p[h]/2-1,E=Math.min(d[x],M),$=Math.min(d[R],M),W=E,k=S-p[h]-$,V=S/2-p[h]/2+L,T=Mt(W,V,k),F=!l.arrow&&G(i)!=null&&V!==T&&s.reference[h]/2-(V<W?E:$)-p[h]/2<0,O=F?V<W?V-W:V-k:0;return{[m]:a[m]+O,data:{[m]:T,centerOffset:V-T-O,...F&&{alignmentOffset:O}},reset:F}}}),oo=(e,t)=>{const{name:n,fn:o}=no(e);return{name:n,fn:o,options:[e,t]}},io={name:"hide",async fn(e){const{width:t,height:n,x:o,y:i}=e.rects.reference,s=t===0&&n===0&&o===0&&i===0,r=await e.platform.detectOverflow(e,{elementContext:"reference"});return{data:{referenceHidden:r.top-n>=0||r.right-t>=0||r.bottom-n>=0||r.left-t>=0||s}}}},so={sideX:"left",sideY:"top"},ro="--available-width",co="--available-height",lo="--anchor-width",fo="--anchor-height",ao="--transform-origin",Rt=ro,At=co;function Bt(e,t,n){const o=e==="inline-start"||e==="inline-end";return{top:"top",right:o?n?"inline-start":"inline-end":"right",bottom:"bottom",left:o?n?"inline-end":"inline-start":"left"}[t]}function Ot(e,t,n){const{rects:o,placement:i}=e;return{side:Bt(t,j(i),n),align:G(i)||"center",anchor:{width:o.reference.width,height:o.reference.height},positioner:{width:o.floating.width,height:o.floating.height}}}function po(e){return uo(e,Qn)}function uo(e,t){const{anchor:n,positionMethod:o="absolute",side:i="bottom",sideOffset:s=0,align:r="center",alignOffset:c=0,collisionBoundary:l,collisionPadding:f=5,sticky:u=!1,arrowPadding:g=5,disableAnchorTracking:d=!1,inline:a,keepMounted:m=!1,floatingRootContext:h,mounted:p,collisionAvoidance:w,shift:x,nodeId:R,adaptiveOrigin:y,lazyFlip:A=!1,externalTree:v}=e,[P,S]=b.useState(null);!p&&P!==null&&S(null);const L=w.side||"flip",M=w.align||"flip",E=w.fallbackAxisSide||"end",$=x?.crossAxis??!1,W=x?.rootBoundary,k=typeof n=="function"?n:void 0,V=Jt(k),T=k?V:n,F=Ee(n),O=Ee(p),B=to()==="rtl",we=P||{top:"top",right:"right",bottom:"bottom",left:"left","inline-end":B?"left":"right","inline-start":B?"right":"left"}[i],Ht=r==="center"?we:`${we}-${r}`;let D=f;typeof D=="number"?D={top:D,right:D,bottom:D,left:D}:D&&(D={top:D.top||0,right:D.right||0,bottom:D.bottom||0,left:D.left||0});const J=1,_t=i==="bottom"?J:0,It=i==="top"?J:0,zt=i==="right"?J:0,Nt=i==="left"?J:0,ye={boundary:l==="clipping-ancestors"?"clippingAncestors":l,padding:D},ie=b.useRef(null),We=Ee(s),Ve=Ee(c),Xt=typeof s!="function"?s:0,jt=typeof c!="function"?c:0,re=[];a&&re.push(a),re.push(Un(C=>{const I=Ot(C,i,B),N=typeof We.current=="function"?We.current(I):We.current,_=typeof Ve.current=="function"?Ve.current(I):Ve.current;return{mainAxis:N,crossAxis:_,alignmentAxis:_}},[Xt,jt,B,i]));const Je=M==="none"&&L!=="shift",Qe=!Je&&(u||$||L==="shift"),Ze=L==="none"?null:Gn({...ye,padding:{top:D.top+J+_t,right:D.right+J+Nt,bottom:D.bottom+J+It,left:D.left+J+zt},mainAxis:!$&&L==="flip",crossAxis:M==="flip"?"alignment":!1,fallbackAxisSideDirection:E}),et=Je?null:qn({...ye,rootBoundary:W,mainAxis:M!=="none",crossAxis:Qe,limiter:u||$?void 0:Kn(C=>{if(!ie.current)return{};const{width:I,height:N}=ie.current.getBoundingClientRect(),_=X(j(C.placement)),Z=_==="y"?I:N,Y=_==="y"?D.left+D.right:D.top+D.bottom;return{offset:Z/2+Y/2}})},[ye,u,$,W,D,M]);L==="shift"||M==="shift"||r==="center"?re.push(et,Ze):re.push(Ze,et),re.push(Jn({...ye,apply({elements:{floating:C},availableWidth:I,availableHeight:N,rects:_}){if(!O.current)return;const Z=C.style;Z.setProperty(Rt,`${I}px`),Z.setProperty(At,`${N}px`);const Y=U(C).devicePixelRatio||1,{x:Ae,y:ae,width:Oe,height:ee}=_.reference,he=(Math.round((Ae+Oe)*Y)-Math.round(Ae*Y))/Y,pe=(Math.round((ae+ee)*Y)-Math.round(ae*Y))/Y;Z.setProperty(lo,`${he}px`),Z.setProperty(fo,`${pe}px`)}}),oo(C=>({element:ie.current||Qt(C.elements.floating).createElement("div"),padding:ie.current?g:0,offsetParent:"floating"}),[g]),{name:"transformOrigin",fn(C){const{elements:{floating:I},middlewareData:N,placement:_,platform:Z,rects:Y,y:Ae}=C,ae=j(_),Oe=G(_),ee=X(ae)==="y",he=ie.current,pe=typeof s=="function"?s(Ot(C,i,B)):s;let Se;if(!he&&Oe&&Math.abs(ee?N.shift?.x||0:N.shift?.y||0)<=1)Se=Oe==="start"===(ee&&Z.isRTL?.(I)===!0)?"100%":"0%";else{const Yt=ee?N.arrow?.x||0:N.arrow?.y||0,Ut=ee?he?.clientWidth||0:he?.clientHeight||0;Se=`${Yt+Ut/2}px`}let He=ae==="top"||ae==="left"?`calc(100% + ${pe}px)`:`${-pe}px`;return Qe&&ee&&Math.abs(N.shift?.y||0)>pe&&(He=`${Y.reference.y+Y.reference.height/2-Ae}px`),I.style.setProperty(ao,ee?`${Se} ${He}`:`${He} ${Se}`),{}}},io,y),xe(()=>{!p&&h&&h.update({referenceElement:null,floatingElement:null,domReferenceElement:null,positionReference:null})},[p,h]);const Be=b.useMemo(()=>({ancestorScroll:!d,elementResize:!d&&typeof ResizeObserver<"u",layoutShift:!d&&typeof IntersectionObserver<"u"}),[d]),{refs:ce,elements:ge,x:tt,y:nt,middlewareData:le,update:be,placement:ot,context:it,isPositioned:Q,floatingStyles:st}=t({rootContext:h,open:m?p:void 0,placement:Ht,middleware:re,strategy:o,whileElementsMounted:m?void 0:(...C)=>bt(...C,Be),nodeId:R,externalTree:v}),{sideX:rt,sideY:ct}=le.adaptiveOrigin||so,ve=Q?o:"fixed",lt=b.useMemo(()=>{let C;return Q?y?C={position:ve,[rt]:tt,[ct]:nt}:C={...st,position:ve}:C={position:ve,top:0,left:0},C[Rt]="100vw",C[At]="100vh",Q||(C.opacity=0),C},[y,ve,rt,tt,ct,nt,st,Q]),Re=b.useRef(null);xe(()=>{if(!p)return;const C=F.current,I=typeof C=="function"?C():C,_=(St(I)?I.current:I)||null||null;_!==Re.current&&(ce.setPositionReference(_),Re.current=_)},[p,ce,T,F]),b.useEffect(()=>{if(!p)return;const C=F.current;typeof C!="function"&&St(C)&&C.current!==Re.current&&(ce.setPositionReference(C.current),Re.current=C.current)},[p,ce,T,F]),b.useEffect(()=>{if(m&&p&&ge.reference&&ge.floating)return bt(ge.reference,ge.floating,be,Be)},[m,p,ge,be,Be]);const fe=j(ot),ft=Bt(i,fe,B),at=G(ot)||"center",ut=!!le.hide?.referenceHidden;xe(()=>{A&&p&&Q&&fe!==we&&S(fe)},[A,p,Q,fe,we]);const dt=b.useMemo(()=>({position:"absolute",top:le.arrow?.y,left:le.arrow?.x}),[le.arrow]),mt=le.arrow?.centerOffset!==0;return b.useMemo(()=>({positionerStyles:lt,arrowStyles:dt,arrowRef:ie,arrowUncentered:mt,side:ft,align:at,physicalSide:fe,anchorHidden:ut,refs:ce,context:it,isPositioned:Q,update:be}),[lt,dt,ie,mt,ft,at,fe,ut,ce,it,Q,be])}function St(e){return e!=null&&"current"in e}function mo(e){return e==="starting"?Zt:en}function xo(e,t,{styles:n,transitionStatus:o,props:i,refs:s,hidden:r,inert:c=!1}){const l={...n};return c&&(l.pointerEvents="none"),tn("div",e,{state:t,ref:s,props:[{role:"presentation",hidden:r,style:l},mo(o),i],stateAttributesMapping:on})}export{xo as a,to as b,mo as g,Wn as p,Te as r,po as u};
@@ -1 +0,0 @@
1
- import{A as e}from"./__vite-browser-external-DUJeOWgd.js";const a={name:"zap",size:24,node:[["path",{d:"M15.914 4a1.5 1.5 0 00-2.474-1.561l-9 9A1.5 1.5 0 005.5 14h4.002a.5.5 0 01.471.666L8.086 20a1.5 1.5 0 002.475 1.56l9-9A1.5 1.5 0 0018.5 10h-3.997a.5.5 0 01-.472-.667z",key:"1v7up4"}]]};a.node;const n=e(a);export{n as Z};