tokentracker-cli 0.24.8 → 0.25.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (48) hide show
  1. package/dashboard/dist/assets/ActivityHeatmap-CiilYEqW.js +42 -0
  2. package/dashboard/dist/assets/{Card-Bm2ZOfFA.js → Card-BkDHn179.js} +1 -1
  3. package/dashboard/dist/assets/DashboardPage-BwTkSsim.js +1 -0
  4. package/dashboard/dist/assets/{DevicePage-CtqTSoxC.js → DevicePage-DX8aCjtt.js} +1 -1
  5. package/dashboard/dist/assets/DialogTitle-DH5VFL8l.js +12 -0
  6. package/dashboard/dist/assets/{FadeIn-BGmXw8rD.js → FadeIn-CcubhRKW.js} +1 -1
  7. package/dashboard/dist/assets/{IpCheckPage-DLGIFtxp.js → IpCheckPage-BcHkEcE7.js} +1 -1
  8. package/dashboard/dist/assets/{LandingPage-DblVIECc.js → LandingPage-Bnqs_k3p.js} +165 -165
  9. package/dashboard/dist/assets/LeaderboardPage-DV6K7KSV.js +6 -0
  10. package/dashboard/dist/assets/LeaderboardProfileModal-CnbpLjG_.js +1 -0
  11. package/dashboard/dist/assets/LimitsPage-DO53157-.js +2 -0
  12. package/dashboard/dist/assets/LoginPage-1M5RskQE.js +1 -0
  13. package/dashboard/dist/assets/PopoverPopup-BzS6tVnf.js +1 -0
  14. package/dashboard/dist/assets/{ProviderIcon-CyeZHlvD.js → ProviderIcon-C8nYnvzP.js} +1 -1
  15. package/dashboard/dist/assets/SettingsPage-DjoUqFA-.js +1 -0
  16. package/dashboard/dist/assets/SkillsPage-CvOf-_li.js +1 -0
  17. package/dashboard/dist/assets/WidgetsPage-Cc5PRPDd.js +1 -0
  18. package/dashboard/dist/assets/{WrappedPage-Ci0XyXL_.js → WrappedPage-BxuVlF3C.js} +1 -1
  19. package/dashboard/dist/assets/check-r6BrjxcR.js +1 -0
  20. package/dashboard/dist/assets/{chevron-down-BTjZUclo.js → chevron-down-BS2aEE_V.js} +1 -1
  21. package/dashboard/dist/assets/{download-TnEyNsSy.js → download-DtsgF1HV.js} +1 -1
  22. package/dashboard/dist/assets/{info-8F30IXmF.js → info-TG4KyASc.js} +1 -1
  23. package/dashboard/dist/assets/{main-Ch22JpOj.js → main-CR7sCH5H.js} +38 -14
  24. package/dashboard/dist/assets/main-aCzF4R9D.css +1 -0
  25. package/dashboard/dist/assets/{use-limits-display-prefs-Rfcf8uOp.js → use-limits-display-prefs-DgRoQmhK.js} +1 -1
  26. package/dashboard/dist/assets/use-native-settings-BVWj6xAN.js +1 -0
  27. package/dashboard/dist/assets/{use-reduced-motion-lvUJO2cx.js → use-reduced-motion-BsyM6Mgz.js} +1 -1
  28. package/dashboard/dist/assets/{use-usage-limits-BDH7ZuiN.js → use-usage-limits-KGue9hvK.js} +1 -1
  29. package/dashboard/dist/assets/{useCurrency-9qQotA-7.js → useCurrency-BLJima5w.js} +1 -1
  30. package/dashboard/dist/index.html +2 -2
  31. package/dashboard/dist/share.html +2 -2
  32. package/package.json +1 -1
  33. package/src/lib/local-api.js +13 -1
  34. package/src/lib/pricing/seed-snapshot.json +1 -1
  35. package/dashboard/dist/assets/DashboardPage-BCwneqYv.js +0 -42
  36. package/dashboard/dist/assets/HeaderGithubStar-7oF7WLZx.js +0 -1
  37. package/dashboard/dist/assets/LeaderboardPage-BSIiXBXB.js +0 -5
  38. package/dashboard/dist/assets/LeaderboardProfilePage-rnzMxGm7.js +0 -1
  39. package/dashboard/dist/assets/LimitsPage-BIIloMLr.js +0 -2
  40. package/dashboard/dist/assets/LoginPage-K0pFbm2P.js +0 -1
  41. package/dashboard/dist/assets/PopoverPopup-CdYV60oX.js +0 -12
  42. package/dashboard/dist/assets/SettingsPage-CwNF9bwF.js +0 -1
  43. package/dashboard/dist/assets/SkillsPage-DJtcsqCs.js +0 -1
  44. package/dashboard/dist/assets/WidgetsPage-DnQgY7YQ.js +0 -1
  45. package/dashboard/dist/assets/check-CDwpiGWn.js +0 -1
  46. package/dashboard/dist/assets/leaderboard-columns-C6mnviZx.js +0 -1
  47. package/dashboard/dist/assets/main-D_iR1XAB.css +0 -1
  48. package/dashboard/dist/assets/use-native-settings-7r5luMxr.js +0 -1
@@ -1 +0,0 @@
1
- import{r as s,aj as c,C as t}from"./main-Ch22JpOj.js";function u({repo:r="mm7894215/TokenTracker"}){const[a,o]=s.useState(null);return s.useEffect(()=>{if(typeof window>"u")return;const n=typeof window.matchMedia=="function"&&window.matchMedia("(prefers-reduced-motion: reduce)").matches,i=typeof document<"u"&&(document.documentElement?.classList.contains("screenshot-capture")||document.body?.classList.contains("screenshot-capture"));c({prefersReducedMotion:n,screenshotCapture:i})&&fetch(`https://api.github.com/repos/${r}`).then(e=>e.json()).then(e=>{e&&typeof e.stargazers_count=="number"&&o(e.stargazers_count)}).catch(()=>{})},[r]),t.jsxs("a",{href:`https://github.com/${r}`,target:"_blank",rel:"noopener noreferrer",className:"inline-flex shrink-0 items-center gap-2 px-3 py-1.5 rounded-md border border-oai-gray-200 dark:border-oai-gray-700 bg-oai-gray-50 dark:bg-oai-gray-800 hover:bg-oai-gray-100 dark:hover:bg-oai-gray-700 transition-colors no-underline",children:[t.jsx("svg",{height:"16",viewBox:"0 0 16 16",width:"16",className:"shrink-0 fill-oai-gray-700 dark:fill-oai-gray-300",children:t.jsx("path",{d:"M8 0c4.42 0 8 3.58 8 8a8.013 8.013 0 0 1-5.45 7.59c-.4.08-.55-.17-.55-.38 0-.27.01-1.13.01-2.2 0-.75-.25-1.23-.54-1.48 1.78-.2 3.65-.88 3.65-3.95 0-.88-.31-1.59-.82-2.15.08-.2.36-1.02-.08-2.12 0 0-.67-.22-2.2.82-.64-.18-1.32-.27-2-.27-.68 0-1.36.09-2 .27-1.53-1.03-2.2-.82-2.2-.82-.44 1.1-.16 1.92-.08 2.12-.51.56-.82 1.28-.82 2.15 0 3.06 1.86 3.75 3.64 3.95-.23.2-.44.55-.51 1.07-.46.21-1.61.55-2.33-.66-.15-.24-.6-.83-1.23-.82-.67.01-.27.38.01.53.34.19.73.9.82 1.13.16.45.68 1.31 2.69.94 0 .67.01 1.3.01 1.49 0 .21-.15.45-.55.38A7.995 7.995 0 0 1 0 8c0-4.42 3.58-8 8-8Z"})}),t.jsx("span",{className:"text-xs font-medium text-oai-gray-700 dark:text-oai-gray-300 whitespace-nowrap",children:"Star"}),a!==null&&t.jsx("span",{className:"text-xs font-semibold text-oai-gray-900 dark:text-oai-white tabular-nums whitespace-nowrap",children:a})]})}export{u as H};
@@ -1,5 +0,0 @@
1
- import{c as Jr,r as s,R as H,a9 as Ve,C as c,a7 as P,B as y,aa as Zr,ab as Qr,S as en,T as tn,ac as rn,h as nn,j as on,ad as an,V as sn,a5 as It,G as ln,L as cn,H as dn,ae as un,af as fn,ag as Zt,ah as gn,I as hn}from"./main-Ch22JpOj.js";import{P as bn}from"./ProviderIcon-CyeZHlvD.js";import{u as pn}from"./useCurrency-9qQotA-7.js";import{L as vr,a as yr,b as bt,l as _t,c as Tt,d as Lt,e as mn}from"./leaderboard-columns-C6mnviZx.js";import{C as xn}from"./chevron-down-BTjZUclo.js";const vn=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"m12 5 7 7-7 7",key:"xquz4c"}]],yn=Jr("arrow-right",vn);function wn(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];return s.useMemo(()=>n=>{t.forEach(o=>o(n))},t)}const yt=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function Fe(e){const t=Object.prototype.toString.call(e);return t==="[object Window]"||t==="[object global]"}function Wt(e){return"nodeType"in e}function K(e){var t,r;return e?Fe(e)?e:Wt(e)&&(t=(r=e.ownerDocument)==null?void 0:r.defaultView)!=null?t:window:window}function Xt(e){const{Document:t}=K(e);return e instanceof t}function ot(e){return Fe(e)?!1:e instanceof K(e).HTMLElement}function wr(e){return e instanceof K(e).SVGElement}function Ue(e){return e?Fe(e)?e.document:Wt(e)?Xt(e)?e:ot(e)||wr(e)?e.ownerDocument:document:document:document}const pe=yt?s.useLayoutEffect:s.useEffect;function Ht(e){const t=s.useRef(e);return pe(()=>{t.current=e}),s.useCallback(function(){for(var r=arguments.length,n=new Array(r),o=0;o<r;o++)n[o]=arguments[o];return t.current==null?void 0:t.current(...n)},[])}function kn(){const e=s.useRef(null),t=s.useCallback((n,o)=>{e.current=setInterval(n,o)},[]),r=s.useCallback(()=>{e.current!==null&&(clearInterval(e.current),e.current=null)},[]);return[t,r]}function Qe(e,t){t===void 0&&(t=[e]);const r=s.useRef(e);return pe(()=>{r.current!==e&&(r.current=e)},t),r}function at(e,t){const r=s.useRef();return s.useMemo(()=>{const n=e(r.current);return r.current=n,n},[...t])}function pt(e){const t=Ht(e),r=s.useRef(null),n=s.useCallback(o=>{o!==r.current&&t?.(o,r.current),r.current=o},[]);return[r,n]}function Ot(e){const t=s.useRef();return s.useEffect(()=>{t.current=e},[e]),t.current}let Dt={};function it(e,t){return s.useMemo(()=>{if(t)return t;const r=Dt[e]==null?0:Dt[e]+1;return Dt[e]=r,e+"-"+r},[e,t])}function kr(e){return function(t){for(var r=arguments.length,n=new Array(r>1?r-1:0),o=1;o<r;o++)n[o-1]=arguments[o];return n.reduce((a,i)=>{const l=Object.entries(i);for(const[d,u]of l){const g=a[d];g!=null&&(a[d]=g+e*u)}return a},{...t})}}const $e=kr(1),et=kr(-1);function Sn(e){return"clientX"in e&&"clientY"in e}function Kt(e){if(!e)return!1;const{KeyboardEvent:t}=K(e.target);return t&&e instanceof t}function Cn(e){if(!e)return!1;const{TouchEvent:t}=K(e.target);return t&&e instanceof t}function Pt(e){if(Cn(e)){if(e.touches&&e.touches.length){const{clientX:t,clientY:r}=e.touches[0];return{x:t,y:r}}else if(e.changedTouches&&e.changedTouches.length){const{clientX:t,clientY:r}=e.changedTouches[0];return{x:t,y:r}}}return Sn(e)?{x:e.clientX,y:e.clientY}:null}const tt=Object.freeze({Translate:{toString(e){if(!e)return;const{x:t,y:r}=e;return"translate3d("+(t?Math.round(t):0)+"px, "+(r?Math.round(r):0)+"px, 0)"}},Scale:{toString(e){if(!e)return;const{scaleX:t,scaleY:r}=e;return"scaleX("+t+") scaleY("+r+")"}},Transform:{toString(e){if(e)return[tt.Translate.toString(e),tt.Scale.toString(e)].join(" ")}},Transition:{toString(e){let{property:t,duration:r,easing:n}=e;return t+" "+r+"ms "+n}}}),Qt="a,frame,iframe,input:not([type=hidden]):not(:disabled),select:not(:disabled),textarea:not(:disabled),button:not(:disabled),*[tabindex]";function Nn(e){return e.matches(Qt)?e:e.querySelector(Qt)}const Rn={display:"none"};function Dn(e){let{id:t,value:r}=e;return H.createElement("div",{id:t,style:Rn},r)}function En(e){let{id:t,announcement:r,ariaLiveType:n="assertive"}=e;const o={position:"fixed",top:0,left:0,width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0 0 0 0)",clipPath:"inset(100%)",whiteSpace:"nowrap"};return H.createElement("div",{id:t,style:o,role:"status","aria-live":n,"aria-atomic":!0},r)}function jn(){const[e,t]=s.useState("");return{announce:s.useCallback(n=>{n!=null&&t(n)},[]),announcement:e}}const Sr=s.createContext(null);function An(e){const t=s.useContext(Sr);s.useEffect(()=>{if(!t)throw new Error("useDndMonitor must be used within a children of <DndContext>");return t(e)},[e,t])}function Mn(){const[e]=s.useState(()=>new Set),t=s.useCallback(n=>(e.add(n),()=>e.delete(n)),[e]);return[s.useCallback(n=>{let{type:o,event:a}=n;e.forEach(i=>{var l;return(l=i[o])==null?void 0:l.call(i,a)})},[e]),t]}const In={draggable:`
2
- To pick up a draggable item, press the space bar.
3
- While dragging, use the arrow keys to move the item.
4
- Press space again to drop the item in its new position, or press escape to cancel.
5
- `},_n={onDragStart(e){let{active:t}=e;return"Picked up draggable item "+t.id+"."},onDragOver(e){let{active:t,over:r}=e;return r?"Draggable item "+t.id+" was moved over droppable area "+r.id+".":"Draggable item "+t.id+" is no longer over a droppable area."},onDragEnd(e){let{active:t,over:r}=e;return r?"Draggable item "+t.id+" was dropped over droppable area "+r.id:"Draggable item "+t.id+" was dropped."},onDragCancel(e){let{active:t}=e;return"Dragging was cancelled. Draggable item "+t.id+" was dropped."}};function Tn(e){let{announcements:t=_n,container:r,hiddenTextDescribedById:n,screenReaderInstructions:o=In}=e;const{announce:a,announcement:i}=jn(),l=it("DndLiveRegion"),[d,u]=s.useState(!1);if(s.useEffect(()=>{u(!0)},[]),An(s.useMemo(()=>({onDragStart(f){let{active:p}=f;a(t.onDragStart({active:p}))},onDragMove(f){let{active:p,over:b}=f;t.onDragMove&&a(t.onDragMove({active:p,over:b}))},onDragOver(f){let{active:p,over:b}=f;a(t.onDragOver({active:p,over:b}))},onDragEnd(f){let{active:p,over:b}=f;a(t.onDragEnd({active:p,over:b}))},onDragCancel(f){let{active:p,over:b}=f;a(t.onDragCancel({active:p,over:b}))}}),[a,t])),!d)return null;const g=H.createElement(H.Fragment,null,H.createElement(Dn,{id:n,value:o.draggable}),H.createElement(En,{id:l,announcement:i}));return r?Ve.createPortal(g,r):g}var z;(function(e){e.DragStart="dragStart",e.DragMove="dragMove",e.DragEnd="dragEnd",e.DragCancel="dragCancel",e.DragOver="dragOver",e.RegisterDroppable="registerDroppable",e.SetDroppableDisabled="setDroppableDisabled",e.UnregisterDroppable="unregisterDroppable"})(z||(z={}));function mt(){}function er(e,t){return s.useMemo(()=>({sensor:e,options:t??{}}),[e,t])}function Ln(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];return s.useMemo(()=>[...t].filter(n=>n!=null),[...t])}const ue=Object.freeze({x:0,y:0});function Cr(e,t){return Math.sqrt(Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2))}function Nr(e,t){let{data:{value:r}}=e,{data:{value:n}}=t;return r-n}function On(e,t){let{data:{value:r}}=e,{data:{value:n}}=t;return n-r}function tr(e){let{left:t,top:r,height:n,width:o}=e;return[{x:t,y:r},{x:t+o,y:r},{x:t,y:r+n},{x:t+o,y:r+n}]}function Rr(e,t){if(!e||e.length===0)return null;const[r]=e;return r[t]}function rr(e,t,r){return t===void 0&&(t=e.left),r===void 0&&(r=e.top),{x:t+e.width*.5,y:r+e.height*.5}}const Pn=e=>{let{collisionRect:t,droppableRects:r,droppableContainers:n}=e;const o=rr(t,t.left,t.top),a=[];for(const i of n){const{id:l}=i,d=r.get(l);if(d){const u=Cr(rr(d),o);a.push({id:l,data:{droppableContainer:i,value:u}})}}return a.sort(Nr)},zn=e=>{let{collisionRect:t,droppableRects:r,droppableContainers:n}=e;const o=tr(t),a=[];for(const i of n){const{id:l}=i,d=r.get(l);if(d){const u=tr(d),g=o.reduce((p,b,E)=>p+Cr(u[E],b),0),f=Number((g/4).toFixed(4));a.push({id:l,data:{droppableContainer:i,value:f}})}}return a.sort(Nr)};function Bn(e,t){const r=Math.max(t.top,e.top),n=Math.max(t.left,e.left),o=Math.min(t.left+t.width,e.left+e.width),a=Math.min(t.top+t.height,e.top+e.height),i=o-n,l=a-r;if(n<o&&r<a){const d=t.width*t.height,u=e.width*e.height,g=i*l,f=g/(d+u-g);return Number(f.toFixed(4))}return 0}const $n=e=>{let{collisionRect:t,droppableRects:r,droppableContainers:n}=e;const o=[];for(const a of n){const{id:i}=a,l=r.get(i);if(l){const d=Bn(l,t);d>0&&o.push({id:i,data:{droppableContainer:a,value:d}})}}return o.sort(On)};function Fn(e,t,r){return{...e,scaleX:t&&r?t.width/r.width:1,scaleY:t&&r?t.height/r.height:1}}function Dr(e,t){return e&&t?{x:e.left-t.left,y:e.top-t.top}:ue}function Un(e){return function(r){for(var n=arguments.length,o=new Array(n>1?n-1:0),a=1;a<n;a++)o[a-1]=arguments[a];return o.reduce((i,l)=>({...i,top:i.top+e*l.y,bottom:i.bottom+e*l.y,left:i.left+e*l.x,right:i.right+e*l.x}),{...r})}}const Yn=Un(1);function Wn(e){if(e.startsWith("matrix3d(")){const t=e.slice(9,-1).split(/, /);return{x:+t[12],y:+t[13],scaleX:+t[0],scaleY:+t[5]}}else if(e.startsWith("matrix(")){const t=e.slice(7,-1).split(/, /);return{x:+t[4],y:+t[5],scaleX:+t[0],scaleY:+t[3]}}return null}function Xn(e,t,r){const n=Wn(t);if(!n)return e;const{scaleX:o,scaleY:a,x:i,y:l}=n,d=e.left-i-(1-o)*parseFloat(r),u=e.top-l-(1-a)*parseFloat(r.slice(r.indexOf(" ")+1)),g=o?e.width/o:e.width,f=a?e.height/a:e.height;return{width:g,height:f,top:u,right:d+g,bottom:u+f,left:d}}const Hn={ignoreTransform:!1};function Ye(e,t){t===void 0&&(t=Hn);let r=e.getBoundingClientRect();if(t.ignoreTransform){const{transform:u,transformOrigin:g}=K(e).getComputedStyle(e);u&&(r=Xn(r,u,g))}const{top:n,left:o,width:a,height:i,bottom:l,right:d}=r;return{top:n,left:o,width:a,height:i,bottom:l,right:d}}function nr(e){return Ye(e,{ignoreTransform:!0})}function Kn(e){const t=e.innerWidth,r=e.innerHeight;return{top:0,left:0,right:t,bottom:r,width:t,height:r}}function Gn(e,t){return t===void 0&&(t=K(e).getComputedStyle(e)),t.position==="fixed"}function Vn(e,t){t===void 0&&(t=K(e).getComputedStyle(e));const r=/(auto|scroll|overlay)/;return["overflow","overflowX","overflowY"].some(o=>{const a=t[o];return typeof a=="string"?r.test(a):!1})}function wt(e,t){const r=[];function n(o){if(t!=null&&r.length>=t||!o)return r;if(Xt(o)&&o.scrollingElement!=null&&!r.includes(o.scrollingElement))return r.push(o.scrollingElement),r;if(!ot(o)||wr(o)||r.includes(o))return r;const a=K(e).getComputedStyle(o);return o!==e&&Vn(o,a)&&r.push(o),Gn(o,a)?r:n(o.parentNode)}return e?n(e):r}function Er(e){const[t]=wt(e,1);return t??null}function Et(e){return!yt||!e?null:Fe(e)?e:Wt(e)?Xt(e)||e===Ue(e).scrollingElement?window:ot(e)?e:null:null}function jr(e){return Fe(e)?e.scrollX:e.scrollLeft}function Ar(e){return Fe(e)?e.scrollY:e.scrollTop}function zt(e){return{x:jr(e),y:Ar(e)}}var B;(function(e){e[e.Forward=1]="Forward",e[e.Backward=-1]="Backward"})(B||(B={}));function Mr(e){return!yt||!e?!1:e===document.scrollingElement}function Ir(e){const t={x:0,y:0},r=Mr(e)?{height:window.innerHeight,width:window.innerWidth}:{height:e.clientHeight,width:e.clientWidth},n={x:e.scrollWidth-r.width,y:e.scrollHeight-r.height},o=e.scrollTop<=t.y,a=e.scrollLeft<=t.x,i=e.scrollTop>=n.y,l=e.scrollLeft>=n.x;return{isTop:o,isLeft:a,isBottom:i,isRight:l,maxScroll:n,minScroll:t}}const qn={x:.2,y:.2};function Jn(e,t,r,n,o){let{top:a,left:i,right:l,bottom:d}=r;n===void 0&&(n=10),o===void 0&&(o=qn);const{isTop:u,isBottom:g,isLeft:f,isRight:p}=Ir(e),b={x:0,y:0},E={x:0,y:0},m={height:t.height*o.y,width:t.width*o.x};return!u&&a<=t.top+m.height?(b.y=B.Backward,E.y=n*Math.abs((t.top+m.height-a)/m.height)):!g&&d>=t.bottom-m.height&&(b.y=B.Forward,E.y=n*Math.abs((t.bottom-m.height-d)/m.height)),!p&&l>=t.right-m.width?(b.x=B.Forward,E.x=n*Math.abs((t.right-m.width-l)/m.width)):!f&&i<=t.left+m.width&&(b.x=B.Backward,E.x=n*Math.abs((t.left+m.width-i)/m.width)),{direction:b,speed:E}}function Zn(e){if(e===document.scrollingElement){const{innerWidth:a,innerHeight:i}=window;return{top:0,left:0,right:a,bottom:i,width:a,height:i}}const{top:t,left:r,right:n,bottom:o}=e.getBoundingClientRect();return{top:t,left:r,right:n,bottom:o,width:e.clientWidth,height:e.clientHeight}}function _r(e){return e.reduce((t,r)=>$e(t,zt(r)),ue)}function Qn(e){return e.reduce((t,r)=>t+jr(r),0)}function eo(e){return e.reduce((t,r)=>t+Ar(r),0)}function to(e,t){if(t===void 0&&(t=Ye),!e)return;const{top:r,left:n,bottom:o,right:a}=t(e);Er(e)&&(o<=0||a<=0||r>=window.innerHeight||n>=window.innerWidth)&&e.scrollIntoView({block:"center",inline:"center"})}const ro=[["x",["left","right"],Qn],["y",["top","bottom"],eo]];class Gt{constructor(t,r){this.rect=void 0,this.width=void 0,this.height=void 0,this.top=void 0,this.bottom=void 0,this.right=void 0,this.left=void 0;const n=wt(r),o=_r(n);this.rect={...t},this.width=t.width,this.height=t.height;for(const[a,i,l]of ro)for(const d of i)Object.defineProperty(this,d,{get:()=>{const u=l(n),g=o[a]-u;return this.rect[d]+g},enumerable:!0});Object.defineProperty(this,"rect",{enumerable:!1})}}class qe{constructor(t){this.target=void 0,this.listeners=[],this.removeAll=()=>{this.listeners.forEach(r=>{var n;return(n=this.target)==null?void 0:n.removeEventListener(...r)})},this.target=t}add(t,r,n){var o;(o=this.target)==null||o.addEventListener(t,r,n),this.listeners.push([t,r,n])}}function no(e){const{EventTarget:t}=K(e);return e instanceof t?e:Ue(e)}function jt(e,t){const r=Math.abs(e.x),n=Math.abs(e.y);return typeof t=="number"?Math.sqrt(r**2+n**2)>t:"x"in t&&"y"in t?r>t.x&&n>t.y:"x"in t?r>t.x:"y"in t?n>t.y:!1}var ne;(function(e){e.Click="click",e.DragStart="dragstart",e.Keydown="keydown",e.ContextMenu="contextmenu",e.Resize="resize",e.SelectionChange="selectionchange",e.VisibilityChange="visibilitychange"})(ne||(ne={}));function or(e){e.preventDefault()}function oo(e){e.stopPropagation()}var D;(function(e){e.Space="Space",e.Down="ArrowDown",e.Right="ArrowRight",e.Left="ArrowLeft",e.Up="ArrowUp",e.Esc="Escape",e.Enter="Enter",e.Tab="Tab"})(D||(D={}));const Tr={start:[D.Space,D.Enter],cancel:[D.Esc],end:[D.Space,D.Enter,D.Tab]},ao=(e,t)=>{let{currentCoordinates:r}=t;switch(e.code){case D.Right:return{...r,x:r.x+25};case D.Left:return{...r,x:r.x-25};case D.Down:return{...r,y:r.y+25};case D.Up:return{...r,y:r.y-25}}};class Vt{constructor(t){this.props=void 0,this.autoScrollEnabled=!1,this.referenceCoordinates=void 0,this.listeners=void 0,this.windowListeners=void 0,this.props=t;const{event:{target:r}}=t;this.props=t,this.listeners=new qe(Ue(r)),this.windowListeners=new qe(K(r)),this.handleKeyDown=this.handleKeyDown.bind(this),this.handleCancel=this.handleCancel.bind(this),this.attach()}attach(){this.handleStart(),this.windowListeners.add(ne.Resize,this.handleCancel),this.windowListeners.add(ne.VisibilityChange,this.handleCancel),setTimeout(()=>this.listeners.add(ne.Keydown,this.handleKeyDown))}handleStart(){const{activeNode:t,onStart:r}=this.props,n=t.node.current;n&&to(n),r(ue)}handleKeyDown(t){if(Kt(t)){const{active:r,context:n,options:o}=this.props,{keyboardCodes:a=Tr,coordinateGetter:i=ao,scrollBehavior:l="smooth"}=o,{code:d}=t;if(a.end.includes(d)){this.handleEnd(t);return}if(a.cancel.includes(d)){this.handleCancel(t);return}const{collisionRect:u}=n.current,g=u?{x:u.left,y:u.top}:ue;this.referenceCoordinates||(this.referenceCoordinates=g);const f=i(t,{active:r,context:n.current,currentCoordinates:g});if(f){const p=et(f,g),b={x:0,y:0},{scrollableAncestors:E}=n.current;for(const m of E){const x=t.code,{isTop:w,isRight:k,isLeft:v,isBottom:C,maxScroll:j,minScroll:N}=Ir(m),S=Zn(m),R={x:Math.min(x===D.Right?S.right-S.width/2:S.right,Math.max(x===D.Right?S.left:S.left+S.width/2,f.x)),y:Math.min(x===D.Down?S.bottom-S.height/2:S.bottom,Math.max(x===D.Down?S.top:S.top+S.height/2,f.y))},T=x===D.Right&&!k||x===D.Left&&!v,_=x===D.Down&&!C||x===D.Up&&!w;if(T&&R.x!==f.x){const A=m.scrollLeft+p.x,G=x===D.Right&&A<=j.x||x===D.Left&&A>=N.x;if(G&&!p.y){m.scrollTo({left:A,behavior:l});return}G?b.x=m.scrollLeft-A:b.x=x===D.Right?m.scrollLeft-j.x:m.scrollLeft-N.x,b.x&&m.scrollBy({left:-b.x,behavior:l});break}else if(_&&R.y!==f.y){const A=m.scrollTop+p.y,G=x===D.Down&&A<=j.y||x===D.Up&&A>=N.y;if(G&&!p.x){m.scrollTo({top:A,behavior:l});return}G?b.y=m.scrollTop-A:b.y=x===D.Down?m.scrollTop-j.y:m.scrollTop-N.y,b.y&&m.scrollBy({top:-b.y,behavior:l});break}}this.handleMove(t,$e(et(f,this.referenceCoordinates),b))}}}handleMove(t,r){const{onMove:n}=this.props;t.preventDefault(),n(r)}handleEnd(t){const{onEnd:r}=this.props;t.preventDefault(),this.detach(),r()}handleCancel(t){const{onCancel:r}=this.props;t.preventDefault(),this.detach(),r()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll()}}Vt.activators=[{eventName:"onKeyDown",handler:(e,t,r)=>{let{keyboardCodes:n=Tr,onActivation:o}=t,{active:a}=r;const{code:i}=e.nativeEvent;if(n.start.includes(i)){const l=a.activatorNode.current;return l&&e.target!==l?!1:(e.preventDefault(),o?.({event:e.nativeEvent}),!0)}return!1}}];function ar(e){return!!(e&&"distance"in e)}function ir(e){return!!(e&&"delay"in e)}class qt{constructor(t,r,n){var o;n===void 0&&(n=no(t.event.target)),this.props=void 0,this.events=void 0,this.autoScrollEnabled=!0,this.document=void 0,this.activated=!1,this.initialCoordinates=void 0,this.timeoutId=null,this.listeners=void 0,this.documentListeners=void 0,this.windowListeners=void 0,this.props=t,this.events=r;const{event:a}=t,{target:i}=a;this.props=t,this.events=r,this.document=Ue(i),this.documentListeners=new qe(this.document),this.listeners=new qe(n),this.windowListeners=new qe(K(i)),this.initialCoordinates=(o=Pt(a))!=null?o:ue,this.handleStart=this.handleStart.bind(this),this.handleMove=this.handleMove.bind(this),this.handleEnd=this.handleEnd.bind(this),this.handleCancel=this.handleCancel.bind(this),this.handleKeydown=this.handleKeydown.bind(this),this.removeTextSelection=this.removeTextSelection.bind(this),this.attach()}attach(){const{events:t,props:{options:{activationConstraint:r,bypassActivationConstraint:n}}}=this;if(this.listeners.add(t.move.name,this.handleMove,{passive:!1}),this.listeners.add(t.end.name,this.handleEnd),t.cancel&&this.listeners.add(t.cancel.name,this.handleCancel),this.windowListeners.add(ne.Resize,this.handleCancel),this.windowListeners.add(ne.DragStart,or),this.windowListeners.add(ne.VisibilityChange,this.handleCancel),this.windowListeners.add(ne.ContextMenu,or),this.documentListeners.add(ne.Keydown,this.handleKeydown),r){if(n!=null&&n({event:this.props.event,activeNode:this.props.activeNode,options:this.props.options}))return this.handleStart();if(ir(r)){this.timeoutId=setTimeout(this.handleStart,r.delay),this.handlePending(r);return}if(ar(r)){this.handlePending(r);return}}this.handleStart()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll(),setTimeout(this.documentListeners.removeAll,50),this.timeoutId!==null&&(clearTimeout(this.timeoutId),this.timeoutId=null)}handlePending(t,r){const{active:n,onPending:o}=this.props;o(n,t,this.initialCoordinates,r)}handleStart(){const{initialCoordinates:t}=this,{onStart:r}=this.props;t&&(this.activated=!0,this.documentListeners.add(ne.Click,oo,{capture:!0}),this.removeTextSelection(),this.documentListeners.add(ne.SelectionChange,this.removeTextSelection),r(t))}handleMove(t){var r;const{activated:n,initialCoordinates:o,props:a}=this,{onMove:i,options:{activationConstraint:l}}=a;if(!o)return;const d=(r=Pt(t))!=null?r:ue,u=et(o,d);if(!n&&l){if(ar(l)){if(l.tolerance!=null&&jt(u,l.tolerance))return this.handleCancel();if(jt(u,l.distance))return this.handleStart()}if(ir(l)&&jt(u,l.tolerance))return this.handleCancel();this.handlePending(l,u);return}t.cancelable&&t.preventDefault(),i(d)}handleEnd(){const{onAbort:t,onEnd:r}=this.props;this.detach(),this.activated||t(this.props.active),r()}handleCancel(){const{onAbort:t,onCancel:r}=this.props;this.detach(),this.activated||t(this.props.active),r()}handleKeydown(t){t.code===D.Esc&&this.handleCancel()}removeTextSelection(){var t;(t=this.document.getSelection())==null||t.removeAllRanges()}}const io={cancel:{name:"pointercancel"},move:{name:"pointermove"},end:{name:"pointerup"}};class Jt extends qt{constructor(t){const{event:r}=t,n=Ue(r.target);super(t,io,n)}}Jt.activators=[{eventName:"onPointerDown",handler:(e,t)=>{let{nativeEvent:r}=e,{onActivation:n}=t;return!r.isPrimary||r.button!==0?!1:(n?.({event:r}),!0)}}];const so={move:{name:"mousemove"},end:{name:"mouseup"}};var Bt;(function(e){e[e.RightClick=2]="RightClick"})(Bt||(Bt={}));class lo extends qt{constructor(t){super(t,so,Ue(t.event.target))}}lo.activators=[{eventName:"onMouseDown",handler:(e,t)=>{let{nativeEvent:r}=e,{onActivation:n}=t;return r.button===Bt.RightClick?!1:(n?.({event:r}),!0)}}];const At={cancel:{name:"touchcancel"},move:{name:"touchmove"},end:{name:"touchend"}};class co extends qt{constructor(t){super(t,At)}static setup(){return window.addEventListener(At.move.name,t,{capture:!1,passive:!1}),function(){window.removeEventListener(At.move.name,t)};function t(){}}}co.activators=[{eventName:"onTouchStart",handler:(e,t)=>{let{nativeEvent:r}=e,{onActivation:n}=t;const{touches:o}=r;return o.length>1?!1:(n?.({event:r}),!0)}}];var Je;(function(e){e[e.Pointer=0]="Pointer",e[e.DraggableRect=1]="DraggableRect"})(Je||(Je={}));var xt;(function(e){e[e.TreeOrder=0]="TreeOrder",e[e.ReversedTreeOrder=1]="ReversedTreeOrder"})(xt||(xt={}));function uo(e){let{acceleration:t,activator:r=Je.Pointer,canScroll:n,draggingRect:o,enabled:a,interval:i=5,order:l=xt.TreeOrder,pointerCoordinates:d,scrollableAncestors:u,scrollableAncestorRects:g,delta:f,threshold:p}=e;const b=go({delta:f,disabled:!a}),[E,m]=kn(),x=s.useRef({x:0,y:0}),w=s.useRef({x:0,y:0}),k=s.useMemo(()=>{switch(r){case Je.Pointer:return d?{top:d.y,bottom:d.y,left:d.x,right:d.x}:null;case Je.DraggableRect:return o}},[r,o,d]),v=s.useRef(null),C=s.useCallback(()=>{const N=v.current;if(!N)return;const S=x.current.x*w.current.x,R=x.current.y*w.current.y;N.scrollBy(S,R)},[]),j=s.useMemo(()=>l===xt.TreeOrder?[...u].reverse():u,[l,u]);s.useEffect(()=>{if(!a||!u.length||!k){m();return}for(const N of j){if(n?.(N)===!1)continue;const S=u.indexOf(N),R=g[S];if(!R)continue;const{direction:T,speed:_}=Jn(N,R,k,t,p);for(const A of["x","y"])b[A][T[A]]||(_[A]=0,T[A]=0);if(_.x>0||_.y>0){m(),v.current=N,E(C,i),x.current=_,w.current=T;return}}x.current={x:0,y:0},w.current={x:0,y:0},m()},[t,C,n,m,a,i,JSON.stringify(k),JSON.stringify(b),E,u,j,g,JSON.stringify(p)])}const fo={x:{[B.Backward]:!1,[B.Forward]:!1},y:{[B.Backward]:!1,[B.Forward]:!1}};function go(e){let{delta:t,disabled:r}=e;const n=Ot(t);return at(o=>{if(r||!n||!o)return fo;const a={x:Math.sign(t.x-n.x),y:Math.sign(t.y-n.y)};return{x:{[B.Backward]:o.x[B.Backward]||a.x===-1,[B.Forward]:o.x[B.Forward]||a.x===1},y:{[B.Backward]:o.y[B.Backward]||a.y===-1,[B.Forward]:o.y[B.Forward]||a.y===1}}},[r,t,n])}function ho(e,t){const r=t!=null?e.get(t):void 0,n=r?r.node.current:null;return at(o=>{var a;return t==null?null:(a=n??o)!=null?a:null},[n,t])}function bo(e,t){return s.useMemo(()=>e.reduce((r,n)=>{const{sensor:o}=n,a=o.activators.map(i=>({eventName:i.eventName,handler:t(i.handler,n)}));return[...r,...a]},[]),[e,t])}var rt;(function(e){e[e.Always=0]="Always",e[e.BeforeDragging=1]="BeforeDragging",e[e.WhileDragging=2]="WhileDragging"})(rt||(rt={}));var $t;(function(e){e.Optimized="optimized"})($t||($t={}));const sr=new Map;function po(e,t){let{dragging:r,dependencies:n,config:o}=t;const[a,i]=s.useState(null),{frequency:l,measure:d,strategy:u}=o,g=s.useRef(e),f=x(),p=Qe(f),b=s.useCallback(function(w){w===void 0&&(w=[]),!p.current&&i(k=>k===null?w:k.concat(w.filter(v=>!k.includes(v))))},[p]),E=s.useRef(null),m=at(w=>{if(f&&!r)return sr;if(!w||w===sr||g.current!==e||a!=null){const k=new Map;for(let v of e){if(!v)continue;if(a&&a.length>0&&!a.includes(v.id)&&v.rect.current){k.set(v.id,v.rect.current);continue}const C=v.node.current,j=C?new Gt(d(C),C):null;v.rect.current=j,j&&k.set(v.id,j)}return k}return w},[e,a,r,f,d]);return s.useEffect(()=>{g.current=e},[e]),s.useEffect(()=>{f||b()},[r,f]),s.useEffect(()=>{a&&a.length>0&&i(null)},[JSON.stringify(a)]),s.useEffect(()=>{f||typeof l!="number"||E.current!==null||(E.current=setTimeout(()=>{b(),E.current=null},l))},[l,f,b,...n]),{droppableRects:m,measureDroppableContainers:b,measuringScheduled:a!=null};function x(){switch(u){case rt.Always:return!1;case rt.BeforeDragging:return r;default:return!r}}}function Lr(e,t){return at(r=>e?r||(typeof t=="function"?t(e):e):null,[t,e])}function mo(e,t){return Lr(e,t)}function xo(e){let{callback:t,disabled:r}=e;const n=Ht(t),o=s.useMemo(()=>{if(r||typeof window>"u"||typeof window.MutationObserver>"u")return;const{MutationObserver:a}=window;return new a(n)},[n,r]);return s.useEffect(()=>()=>o?.disconnect(),[o]),o}function kt(e){let{callback:t,disabled:r}=e;const n=Ht(t),o=s.useMemo(()=>{if(r||typeof window>"u"||typeof window.ResizeObserver>"u")return;const{ResizeObserver:a}=window;return new a(n)},[r]);return s.useEffect(()=>()=>o?.disconnect(),[o]),o}function vo(e){return new Gt(Ye(e),e)}function lr(e,t,r){t===void 0&&(t=vo);const[n,o]=s.useState(null);function a(){o(d=>{if(!e)return null;if(e.isConnected===!1){var u;return(u=d??r)!=null?u:null}const g=t(e);return JSON.stringify(d)===JSON.stringify(g)?d:g})}const i=xo({callback(d){if(e)for(const u of d){const{type:g,target:f}=u;if(g==="childList"&&f instanceof HTMLElement&&f.contains(e)){a();break}}}}),l=kt({callback:a});return pe(()=>{a(),e?(l?.observe(e),i?.observe(document.body,{childList:!0,subtree:!0})):(l?.disconnect(),i?.disconnect())},[e]),n}function yo(e){const t=Lr(e);return Dr(e,t)}const cr=[];function wo(e){const t=s.useRef(e),r=at(n=>e?n&&n!==cr&&e&&t.current&&e.parentNode===t.current.parentNode?n:wt(e):cr,[e]);return s.useEffect(()=>{t.current=e},[e]),r}function ko(e){const[t,r]=s.useState(null),n=s.useRef(e),o=s.useCallback(a=>{const i=Et(a.target);i&&r(l=>l?(l.set(i,zt(i)),new Map(l)):null)},[]);return s.useEffect(()=>{const a=n.current;if(e!==a){i(a);const l=e.map(d=>{const u=Et(d);return u?(u.addEventListener("scroll",o,{passive:!0}),[u,zt(u)]):null}).filter(d=>d!=null);r(l.length?new Map(l):null),n.current=e}return()=>{i(e),i(a)};function i(l){l.forEach(d=>{const u=Et(d);u?.removeEventListener("scroll",o)})}},[o,e]),s.useMemo(()=>e.length?t?Array.from(t.values()).reduce((a,i)=>$e(a,i),ue):_r(e):ue,[e,t])}function dr(e,t){t===void 0&&(t=[]);const r=s.useRef(null);return s.useEffect(()=>{r.current=null},t),s.useEffect(()=>{const n=e!==ue;n&&!r.current&&(r.current=e),!n&&r.current&&(r.current=null)},[e]),r.current?et(e,r.current):ue}function So(e){s.useEffect(()=>{if(!yt)return;const t=e.map(r=>{let{sensor:n}=r;return n.setup==null?void 0:n.setup()});return()=>{for(const r of t)r?.()}},e.map(t=>{let{sensor:r}=t;return r}))}function Co(e,t){return s.useMemo(()=>e.reduce((r,n)=>{let{eventName:o,handler:a}=n;return r[o]=i=>{a(i,t)},r},{}),[e,t])}function Or(e){return s.useMemo(()=>e?Kn(e):null,[e])}const ur=[];function No(e,t){t===void 0&&(t=Ye);const[r]=e,n=Or(r?K(r):null),[o,a]=s.useState(ur);function i(){a(()=>e.length?e.map(d=>Mr(d)?n:new Gt(t(d),d)):ur)}const l=kt({callback:i});return pe(()=>{l?.disconnect(),i(),e.forEach(d=>l?.observe(d))},[e]),o}function Ro(e){if(!e)return null;if(e.children.length>1)return e;const t=e.children[0];return ot(t)?t:e}function Do(e){let{measure:t}=e;const[r,n]=s.useState(null),o=s.useCallback(u=>{for(const{target:g}of u)if(ot(g)){n(f=>{const p=t(g);return f?{...f,width:p.width,height:p.height}:p});break}},[t]),a=kt({callback:o}),i=s.useCallback(u=>{const g=Ro(u);a?.disconnect(),g&&a?.observe(g),n(g?t(g):null)},[t,a]),[l,d]=pt(i);return s.useMemo(()=>({nodeRef:l,rect:r,setRef:d}),[r,l,d])}const Eo=[{sensor:Jt,options:{}},{sensor:Vt,options:{}}],jo={current:{}},ht={draggable:{measure:nr},droppable:{measure:nr,strategy:rt.WhileDragging,frequency:$t.Optimized},dragOverlay:{measure:Ye}};class Ze extends Map{get(t){var r;return t!=null&&(r=super.get(t))!=null?r:void 0}toArray(){return Array.from(this.values())}getEnabled(){return this.toArray().filter(t=>{let{disabled:r}=t;return!r})}getNodeFor(t){var r,n;return(r=(n=this.get(t))==null?void 0:n.node.current)!=null?r:void 0}}const Ao={activatorEvent:null,active:null,activeNode:null,activeNodeRect:null,collisions:null,containerNodeRect:null,draggableNodes:new Map,droppableRects:new Map,droppableContainers:new Ze,over:null,dragOverlay:{nodeRef:{current:null},rect:null,setRef:mt},scrollableAncestors:[],scrollableAncestorRects:[],measuringConfiguration:ht,measureDroppableContainers:mt,windowRect:null,measuringScheduled:!1},Mo={activatorEvent:null,activators:[],active:null,activeNodeRect:null,ariaDescribedById:{draggable:""},dispatch:mt,draggableNodes:new Map,over:null,measureDroppableContainers:mt},St=s.createContext(Mo),Pr=s.createContext(Ao);function Io(){return{draggable:{active:null,initialCoordinates:{x:0,y:0},nodes:new Map,translate:{x:0,y:0}},droppable:{containers:new Ze}}}function _o(e,t){switch(t.type){case z.DragStart:return{...e,draggable:{...e.draggable,initialCoordinates:t.initialCoordinates,active:t.active}};case z.DragMove:return e.draggable.active==null?e:{...e,draggable:{...e.draggable,translate:{x:t.coordinates.x-e.draggable.initialCoordinates.x,y:t.coordinates.y-e.draggable.initialCoordinates.y}}};case z.DragEnd:case z.DragCancel:return{...e,draggable:{...e.draggable,active:null,initialCoordinates:{x:0,y:0},translate:{x:0,y:0}}};case z.RegisterDroppable:{const{element:r}=t,{id:n}=r,o=new Ze(e.droppable.containers);return o.set(n,r),{...e,droppable:{...e.droppable,containers:o}}}case z.SetDroppableDisabled:{const{id:r,key:n,disabled:o}=t,a=e.droppable.containers.get(r);if(!a||n!==a.key)return e;const i=new Ze(e.droppable.containers);return i.set(r,{...a,disabled:o}),{...e,droppable:{...e.droppable,containers:i}}}case z.UnregisterDroppable:{const{id:r,key:n}=t,o=e.droppable.containers.get(r);if(!o||n!==o.key)return e;const a=new Ze(e.droppable.containers);return a.delete(r),{...e,droppable:{...e.droppable,containers:a}}}default:return e}}function To(e){let{disabled:t}=e;const{active:r,activatorEvent:n,draggableNodes:o}=s.useContext(St),a=Ot(n),i=Ot(r?.id);return s.useEffect(()=>{if(!t&&!n&&a&&i!=null){if(!Kt(a)||document.activeElement===a.target)return;const l=o.get(i);if(!l)return;const{activatorNode:d,node:u}=l;if(!d.current&&!u.current)return;requestAnimationFrame(()=>{for(const g of[d.current,u.current]){if(!g)continue;const f=Nn(g);if(f){f.focus();break}}})}},[n,t,o,i,a]),null}function Lo(e,t){let{transform:r,...n}=t;return e!=null&&e.length?e.reduce((o,a)=>a({transform:o,...n}),r):r}function Oo(e){return s.useMemo(()=>({draggable:{...ht.draggable,...e?.draggable},droppable:{...ht.droppable,...e?.droppable},dragOverlay:{...ht.dragOverlay,...e?.dragOverlay}}),[e?.draggable,e?.droppable,e?.dragOverlay])}function Po(e){let{activeNode:t,measure:r,initialRect:n,config:o=!0}=e;const a=s.useRef(!1),{x:i,y:l}=typeof o=="boolean"?{x:o,y:o}:o;pe(()=>{if(!i&&!l||!t){a.current=!1;return}if(a.current||!n)return;const u=t?.node.current;if(!u||u.isConnected===!1)return;const g=r(u),f=Dr(g,n);if(i||(f.x=0),l||(f.y=0),a.current=!0,Math.abs(f.x)>0||Math.abs(f.y)>0){const p=Er(u);p&&p.scrollBy({top:f.y,left:f.x})}},[t,i,l,n,r])}const zr=s.createContext({...ue,scaleX:1,scaleY:1});var Me;(function(e){e[e.Uninitialized=0]="Uninitialized",e[e.Initializing=1]="Initializing",e[e.Initialized=2]="Initialized"})(Me||(Me={}));const zo=s.memo(function(t){var r,n,o,a;let{id:i,accessibility:l,autoScroll:d=!0,children:u,sensors:g=Eo,collisionDetection:f=$n,measuring:p,modifiers:b,...E}=t;const m=s.useReducer(_o,void 0,Io),[x,w]=m,[k,v]=Mn(),[C,j]=s.useState(Me.Uninitialized),N=C===Me.Initialized,{draggable:{active:S,nodes:R,translate:T},droppable:{containers:_}}=x,A=S!=null?R.get(S):null,G=s.useRef({initial:null,translated:null}),V=s.useMemo(()=>{var W;return S!=null?{id:S,data:(W=A?.data)!=null?W:jo,rect:G}:null},[S,A]),ee=s.useRef(null),[Ie,$]=s.useState(null),[F,Le]=s.useState(null),oe=Qe(E,Object.values(E)),ke=it("DndDescribedBy",i),_e=s.useMemo(()=>_.getEnabled(),[_]),L=Oo(p),{droppableRects:ae,measureDroppableContainers:me,measuringScheduled:Se}=po(_e,{dragging:N,dependencies:[T.x,T.y],config:L.droppable}),O=ho(R,S),xe=s.useMemo(()=>F?Pt(F):null,[F]),fe=qr(),Y=mo(O,L.draggable.measure);Po({activeNode:S!=null?R.get(S):null,config:fe.layoutShiftCompensation,initialRect:Y,measure:L.draggable.measure});const M=lr(O,L.draggable.measure,Y),Ce=lr(O?O.parentElement:null),q=s.useRef({activatorEvent:null,active:null,activeNode:O,collisionRect:null,collisions:null,droppableRects:ae,draggableNodes:R,draggingNode:null,draggingNodeRect:null,droppableContainers:_,over:null,scrollableAncestors:[],scrollAdjustedTranslate:null}),ve=_.getNodeFor((r=q.current.over)==null?void 0:r.id),X=Do({measure:L.dragOverlay.measure}),ie=(n=X.nodeRef.current)!=null?n:O,Ne=N?(o=X.rect)!=null?o:M:null,We=!!(X.nodeRef.current&&X.rect),Xe=yo(We?null:M),Oe=Or(ie?K(ie):null),se=wo(N?ve??O:null),Re=No(se),le=Lo(b,{transform:{x:T.x-Xe.x,y:T.y-Xe.y,scaleX:1,scaleY:1},activatorEvent:F,active:V,activeNodeRect:M,containerNodeRect:Ce,draggingNodeRect:Ne,over:q.current.over,overlayNodeRect:X.rect,scrollableAncestors:se,scrollableAncestorRects:Re,windowRect:Oe}),st=xe?$e(xe,T):null,lt=ko(se),Ct=dr(lt),ct=dr(lt,[M]),ye=$e(le,Ct),De=Ne?Yn(Ne,le):null,ce=V&&De?f({active:V,collisionRect:De,droppableRects:ae,droppableContainers:_e,pointerCoordinates:st}):null,Pe=Rr(ce,"id"),[h,I]=s.useState(null),te=We?le:$e(le,ct),dt=Fn(te,(a=h?.rect)!=null?a:null,M),ze=s.useRef(null),ut=s.useCallback((W,J)=>{let{sensor:Z,options:Ee}=J;if(ee.current==null)return;const re=R.get(ee.current);if(!re)return;const Q=W.nativeEvent,he=new Z({active:ee.current,activeNode:re,event:Q,options:Ee,context:q,onAbort(U){if(!R.get(U))return;const{onDragAbort:be}=oe.current,we={id:U};be?.(we),k({type:"onDragAbort",event:we})},onPending(U,je,be,we){if(!R.get(U))return;const{onDragPending:Ke}=oe.current,Ae={id:U,constraint:je,initialCoordinates:be,offset:we};Ke?.(Ae),k({type:"onDragPending",event:Ae})},onStart(U){const je=ee.current;if(je==null)return;const be=R.get(je);if(!be)return;const{onDragStart:we}=oe.current,He={activatorEvent:Q,active:{id:je,data:be.data,rect:G}};Ve.unstable_batchedUpdates(()=>{we?.(He),j(Me.Initializing),w({type:z.DragStart,initialCoordinates:U,active:je}),k({type:"onDragStart",event:He}),$(ze.current),Le(Q)})},onMove(U){w({type:z.DragMove,coordinates:U})},onEnd:Be(z.DragEnd),onCancel:Be(z.DragCancel)});ze.current=he;function Be(U){return async function(){const{active:be,collisions:we,over:He,scrollAdjustedTranslate:Ke}=q.current;let Ae=null;if(be&&Ke){const{cancelDrop:Ge}=oe.current;Ae={activatorEvent:Q,active:be,collisions:we,delta:Ke,over:He},U===z.DragEnd&&typeof Ge=="function"&&await Promise.resolve(Ge(Ae))&&(U=z.DragCancel)}ee.current=null,Ve.unstable_batchedUpdates(()=>{w({type:U}),j(Me.Uninitialized),I(null),$(null),Le(null),ze.current=null;const Ge=U===z.DragEnd?"onDragEnd":"onDragCancel";if(Ae){const Rt=oe.current[Ge];Rt?.(Ae),k({type:Ge,event:Ae})}})}}},[R]),ge=s.useCallback((W,J)=>(Z,Ee)=>{const re=Z.nativeEvent,Q=R.get(Ee);if(ee.current!==null||!Q||re.dndKit||re.defaultPrevented)return;const he={active:Q};W(Z,J.options,he)===!0&&(re.dndKit={capturedBy:J.sensor},ee.current=Ee,ut(Z,J))},[R,ut]),Nt=bo(g,ge);So(g),pe(()=>{M&&C===Me.Initializing&&j(Me.Initialized)},[M,C]),s.useEffect(()=>{const{onDragMove:W}=oe.current,{active:J,activatorEvent:Z,collisions:Ee,over:re}=q.current;if(!J||!Z)return;const Q={active:J,activatorEvent:Z,collisions:Ee,delta:{x:ye.x,y:ye.y},over:re};Ve.unstable_batchedUpdates(()=>{W?.(Q),k({type:"onDragMove",event:Q})})},[ye.x,ye.y]),s.useEffect(()=>{const{active:W,activatorEvent:J,collisions:Z,droppableContainers:Ee,scrollAdjustedTranslate:re}=q.current;if(!W||ee.current==null||!J||!re)return;const{onDragOver:Q}=oe.current,he=Ee.get(Pe),Be=he&&he.rect.current?{id:he.id,rect:he.rect.current,data:he.data,disabled:he.disabled}:null,U={active:W,activatorEvent:J,collisions:Z,delta:{x:re.x,y:re.y},over:Be};Ve.unstable_batchedUpdates(()=>{I(Be),Q?.(U),k({type:"onDragOver",event:U})})},[Pe]),pe(()=>{q.current={activatorEvent:F,active:V,activeNode:O,collisionRect:De,collisions:ce,droppableRects:ae,draggableNodes:R,draggingNode:ie,draggingNodeRect:Ne,droppableContainers:_,over:h,scrollableAncestors:se,scrollAdjustedTranslate:ye},G.current={initial:Ne,translated:De}},[V,O,ce,De,R,ie,Ne,ae,_,h,se,ye]),uo({...fe,delta:T,draggingRect:De,pointerCoordinates:st,scrollableAncestors:se,scrollableAncestorRects:Re});const Te=s.useMemo(()=>({active:V,activeNode:O,activeNodeRect:M,activatorEvent:F,collisions:ce,containerNodeRect:Ce,dragOverlay:X,draggableNodes:R,droppableContainers:_,droppableRects:ae,over:h,measureDroppableContainers:me,scrollableAncestors:se,scrollableAncestorRects:Re,measuringConfiguration:L,measuringScheduled:Se,windowRect:Oe}),[V,O,M,F,ce,Ce,X,R,_,ae,h,me,se,Re,L,Se,Oe]),Vr=s.useMemo(()=>({activatorEvent:F,activators:Nt,active:V,activeNodeRect:M,ariaDescribedById:{draggable:ke},dispatch:w,draggableNodes:R,over:h,measureDroppableContainers:me}),[F,Nt,V,M,w,ke,R,h,me]);return H.createElement(Sr.Provider,{value:v},H.createElement(St.Provider,{value:Vr},H.createElement(Pr.Provider,{value:Te},H.createElement(zr.Provider,{value:dt},u)),H.createElement(To,{disabled:l?.restoreFocus===!1})),H.createElement(Tn,{...l,hiddenTextDescribedById:ke}));function qr(){const W=Ie?.autoScrollEnabled===!1,J=typeof d=="object"?d.enabled===!1:d===!1,Z=N&&!W&&!J;return typeof d=="object"?{...d,enabled:Z}:{enabled:Z}}}),Bo=s.createContext(null),fr="button",$o="Draggable";function Fo(e){let{id:t,data:r,disabled:n=!1,attributes:o}=e;const a=it($o),{activators:i,activatorEvent:l,active:d,activeNodeRect:u,ariaDescribedById:g,draggableNodes:f,over:p}=s.useContext(St),{role:b=fr,roleDescription:E="draggable",tabIndex:m=0}=o??{},x=d?.id===t,w=s.useContext(x?zr:Bo),[k,v]=pt(),[C,j]=pt(),N=Co(i,t),S=Qe(r);pe(()=>(f.set(t,{id:t,key:a,node:k,activatorNode:C,data:S}),()=>{const T=f.get(t);T&&T.key===a&&f.delete(t)}),[f,t]);const R=s.useMemo(()=>({role:b,tabIndex:m,"aria-disabled":n,"aria-pressed":x&&b===fr?!0:void 0,"aria-roledescription":E,"aria-describedby":g.draggable}),[n,b,m,x,E,g.draggable]);return{active:d,activatorEvent:l,activeNodeRect:u,attributes:R,isDragging:x,listeners:n?void 0:N,node:k,over:p,setNodeRef:v,setActivatorNodeRef:j,transform:w}}function Uo(){return s.useContext(Pr)}const Yo="Droppable",Wo={timeout:25};function Xo(e){let{data:t,disabled:r=!1,id:n,resizeObserverConfig:o}=e;const a=it(Yo),{active:i,dispatch:l,over:d,measureDroppableContainers:u}=s.useContext(St),g=s.useRef({disabled:r}),f=s.useRef(!1),p=s.useRef(null),b=s.useRef(null),{disabled:E,updateMeasurementsFor:m,timeout:x}={...Wo,...o},w=Qe(m??n),k=s.useCallback(()=>{if(!f.current){f.current=!0;return}b.current!=null&&clearTimeout(b.current),b.current=setTimeout(()=>{u(Array.isArray(w.current)?w.current:[w.current]),b.current=null},x)},[x]),v=kt({callback:k,disabled:E||!i}),C=s.useCallback((R,T)=>{v&&(T&&(v.unobserve(T),f.current=!1),R&&v.observe(R))},[v]),[j,N]=pt(C),S=Qe(t);return s.useEffect(()=>{!v||!j.current||(v.disconnect(),f.current=!1,v.observe(j.current))},[j,v]),s.useEffect(()=>(l({type:z.RegisterDroppable,element:{id:n,key:a,disabled:r,node:j,rect:p,data:S}}),()=>l({type:z.UnregisterDroppable,key:a,id:n})),[n]),s.useEffect(()=>{r!==g.current.disabled&&(l({type:z.SetDroppableDisabled,id:n,key:a,disabled:r}),g.current.disabled=r)},[n,a,r,l]),{active:i,rect:p,isOver:d?.id===n,node:j,over:d,setNodeRef:N}}const Ho=e=>{let{transform:t}=e;return{...t,y:0}};function Br(e,t,r){const n=e.slice();return n.splice(r<0?n.length+r:r,0,n.splice(t,1)[0]),n}function Ko(e,t){return e.reduce((r,n,o)=>{const a=t.get(n);return a&&(r[o]=a),r},Array(e.length))}function ft(e){return e!==null&&e>=0}function Go(e,t){if(e===t)return!0;if(e.length!==t.length)return!1;for(let r=0;r<e.length;r++)if(e[r]!==t[r])return!1;return!0}function Vo(e){return typeof e=="boolean"?{draggable:e,droppable:e}:e}const gt={scaleX:1,scaleY:1},qo=e=>{var t;let{rects:r,activeNodeRect:n,activeIndex:o,overIndex:a,index:i}=e;const l=(t=r[o])!=null?t:n;if(!l)return null;const d=Jo(r,i,o);if(i===o){const u=r[a];return u?{x:o<a?u.left+u.width-(l.left+l.width):u.left-l.left,y:0,...gt}:null}return i>o&&i<=a?{x:-l.width-d,y:0,...gt}:i<o&&i>=a?{x:l.width+d,y:0,...gt}:{x:0,y:0,...gt}};function Jo(e,t,r){const n=e[t],o=e[t-1],a=e[t+1];return!n||!o&&!a?0:r<t?o?n.left-(o.left+o.width):a.left-(n.left+n.width):a?a.left-(n.left+n.width):n.left-(o.left+o.width)}const $r=e=>{let{rects:t,activeIndex:r,overIndex:n,index:o}=e;const a=Br(t,n,r),i=t[o],l=a[o];return!l||!i?null:{x:l.left-i.left,y:l.top-i.top,scaleX:l.width/i.width,scaleY:l.height/i.height}},Fr="Sortable",Ur=H.createContext({activeIndex:-1,containerId:Fr,disableTransforms:!1,items:[],overIndex:-1,useDragOverlay:!1,sortedRects:[],strategy:$r,disabled:{draggable:!1,droppable:!1}});function Zo(e){let{children:t,id:r,items:n,strategy:o=$r,disabled:a=!1}=e;const{active:i,dragOverlay:l,droppableRects:d,over:u,measureDroppableContainers:g}=Uo(),f=it(Fr,r),p=l.rect!==null,b=s.useMemo(()=>n.map(N=>typeof N=="object"&&"id"in N?N.id:N),[n]),E=i!=null,m=i?b.indexOf(i.id):-1,x=u?b.indexOf(u.id):-1,w=s.useRef(b),k=!Go(b,w.current),v=x!==-1&&m===-1||k,C=Vo(a);pe(()=>{k&&E&&g(b)},[k,b,E,g]),s.useEffect(()=>{w.current=b},[b]);const j=s.useMemo(()=>({activeIndex:m,containerId:f,disabled:C,disableTransforms:v,items:b,overIndex:x,useDragOverlay:p,sortedRects:Ko(b,d),strategy:o}),[m,f,C.draggable,C.droppable,v,b,x,d,p,o]);return H.createElement(Ur.Provider,{value:j},t)}const Qo=e=>{let{id:t,items:r,activeIndex:n,overIndex:o}=e;return Br(r,n,o).indexOf(t)},ea=e=>{let{containerId:t,isSorting:r,wasDragging:n,index:o,items:a,newIndex:i,previousItems:l,previousContainerId:d,transition:u}=e;return!u||!n||l!==a&&o===i?!1:r?!0:i!==o&&t===d},ta={duration:200,easing:"ease"},Yr="transform",ra=tt.Transition.toString({property:Yr,duration:0,easing:"linear"}),na={roleDescription:"sortable"};function oa(e){let{disabled:t,index:r,node:n,rect:o}=e;const[a,i]=s.useState(null),l=s.useRef(r);return pe(()=>{if(!t&&r!==l.current&&n.current){const d=o.current;if(d){const u=Ye(n.current,{ignoreTransform:!0}),g={x:d.left-u.left,y:d.top-u.top,scaleX:d.width/u.width,scaleY:d.height/u.height};(g.x||g.y)&&i(g)}}r!==l.current&&(l.current=r)},[t,r,n,o]),s.useEffect(()=>{a&&i(null)},[a]),a}function aa(e){let{animateLayoutChanges:t=ea,attributes:r,disabled:n,data:o,getNewIndex:a=Qo,id:i,strategy:l,resizeObserverConfig:d,transition:u=ta}=e;const{items:g,containerId:f,activeIndex:p,disabled:b,disableTransforms:E,sortedRects:m,overIndex:x,useDragOverlay:w,strategy:k}=s.useContext(Ur),v=ia(n,b),C=g.indexOf(i),j=s.useMemo(()=>({sortable:{containerId:f,index:C,items:g},...o}),[f,o,C,g]),N=s.useMemo(()=>g.slice(g.indexOf(i)),[g,i]),{rect:S,node:R,isOver:T,setNodeRef:_}=Xo({id:i,data:j,disabled:v.droppable,resizeObserverConfig:{updateMeasurementsFor:N,...d}}),{active:A,activatorEvent:G,activeNodeRect:V,attributes:ee,setNodeRef:Ie,listeners:$,isDragging:F,over:Le,setActivatorNodeRef:oe,transform:ke}=Fo({id:i,data:j,attributes:{...na,...r},disabled:v.draggable}),_e=wn(_,Ie),L=!!A,ae=L&&!E&&ft(p)&&ft(x),me=!w&&F,Se=me&&ae?ke:null,xe=ae?Se??(l??k)({rects:m,activeNodeRect:V,activeIndex:p,overIndex:x,index:C}):null,fe=ft(p)&&ft(x)?a({id:i,items:g,activeIndex:p,overIndex:x}):C,Y=A?.id,M=s.useRef({activeId:Y,items:g,newIndex:fe,containerId:f}),Ce=g!==M.current.items,q=t({active:A,containerId:f,isDragging:F,isSorting:L,id:i,index:C,items:g,newIndex:M.current.newIndex,previousItems:M.current.items,previousContainerId:M.current.containerId,transition:u,wasDragging:M.current.activeId!=null}),ve=oa({disabled:!q,index:C,node:R,rect:S});return s.useEffect(()=>{L&&M.current.newIndex!==fe&&(M.current.newIndex=fe),f!==M.current.containerId&&(M.current.containerId=f),g!==M.current.items&&(M.current.items=g)},[L,fe,f,g]),s.useEffect(()=>{if(Y===M.current.activeId)return;if(Y&&!M.current.activeId){M.current.activeId=Y;return}const ie=setTimeout(()=>{M.current.activeId=Y},50);return()=>clearTimeout(ie)},[Y]),{active:A,activeIndex:p,attributes:ee,data:j,rect:S,index:C,newIndex:fe,items:g,isOver:T,isSorting:L,isDragging:F,listeners:$,node:R,overIndex:x,over:Le,setNodeRef:_e,setActivatorNodeRef:oe,setDroppableNodeRef:_,setDraggableNodeRef:Ie,transform:ve??xe,transition:X()};function X(){if(ve||Ce&&M.current.newIndex===C)return ra;if(!(me&&!Kt(G)||!u)&&(L||q))return tt.Transition.toString({...u,property:Yr})}}function ia(e,t){var r,n;return typeof e=="boolean"?{draggable:e,droppable:!1}:{draggable:(r=e?.draggable)!=null?r:t.draggable,droppable:(n=e?.droppable)!=null?n:t.droppable}}function vt(e){if(!e)return!1;const t=e.data.current;return!!(t&&"sortable"in t&&typeof t.sortable=="object"&&"containerId"in t.sortable&&"items"in t.sortable&&"index"in t.sortable)}const sa=[D.Down,D.Right,D.Up,D.Left],la=(e,t)=>{let{context:{active:r,collisionRect:n,droppableRects:o,droppableContainers:a,over:i,scrollableAncestors:l}}=t;if(sa.includes(e.code)){if(e.preventDefault(),!r||!n)return;const d=[];a.getEnabled().forEach(f=>{if(!f||f!=null&&f.disabled)return;const p=o.get(f.id);if(p)switch(e.code){case D.Down:n.top<p.top&&d.push(f);break;case D.Up:n.top>p.top&&d.push(f);break;case D.Left:n.left>p.left&&d.push(f);break;case D.Right:n.left<p.left&&d.push(f);break}});const u=zn({collisionRect:n,droppableRects:o,droppableContainers:d});let g=Rr(u,"id");if(g===i?.id&&u.length>1&&(g=u[1].id),g!=null){const f=a.get(r.id),p=a.get(g),b=p?o.get(p.id):null,E=p?.node.current;if(E&&b&&f&&p){const x=wt(E).some((N,S)=>l[S]!==N),w=Wr(f,p),k=ca(f,p),v=x||!w?{x:0,y:0}:{x:k?n.width-b.width:0,y:k?n.height-b.height:0},C={x:b.left,y:b.top};return v.x&&v.y?C:et(C,v)}}}};function Wr(e,t){return!vt(e)||!vt(t)?!1:e.data.current.sortable.containerId===t.data.current.sortable.containerId}function ca(e,t){return!vt(e)||!vt(t)||!Wr(e,t)?!1:e.data.current.sortable.index<t.data.current.sortable.index}function nt(e,{min:t,max:r,fallback:n}){const o=Number(e);if(!Number.isFinite(o))return n;const a=Math.floor(o);return a<t?t:a>r?r:a}function da(e,t){const r=nt(t,{min:0,max:1e6,fallback:0}),n=nt(e,{min:1,max:Math.max(1,r||1),fallback:1});if(r<=1)return[1];const o=new Set([1,r,n-2,n-1,n,n+1,n+2]),a=Array.from(o).filter(d=>Number.isInteger(d)&&d>=1&&d<=r).sort((d,u)=>d-u),i=[];let l=null;for(const d of a)l!=null&&d-l>1&&i.push(null),i.push(d),l=d;return i}function ua({page:e,totalPages:t}){const r=typeof t=="number"&&Number.isFinite(t)&&t>=0,n=r?nt(t,{min:0,max:1e6,fallback:0}):null,o=nt(e,{min:1,max:r?Math.max(1,n||1):1e6,fallback:1}),a=o>1,i=r?o<n:!0;return{canPrev:a,canNext:i,safePage:o,safeTotal:n}}function fa({entries:e,me:t,meLabel:r}){const n=Array.isArray(e)?e:[],o=t&&typeof t.rank=="number"?t.rank:null;return!o||n.some(i=>!!i?.is_me)?n:[{rank:o,is_me:!0,is_pinned:!0,user_id:t?.user_id??null,display_name:r,avatar_url:t?.avatar_url??null,github_url:null,is_public:!1,gpt_tokens:t?.gpt_tokens??"0",claude_tokens:t?.claude_tokens??"0",gemini_tokens:t?.gemini_tokens??"0",cursor_tokens:t?.cursor_tokens??"0",opencode_tokens:t?.opencode_tokens??"0",openclaw_tokens:t?.openclaw_tokens??"0",hermes_tokens:t?.hermes_tokens??"0",kiro_tokens:t?.kiro_tokens??"0",copilot_tokens:t?.copilot_tokens??"0",kimi_tokens:t?.kimi_tokens??"0",other_tokens:t?.other_tokens??"0",total_tokens:t?.total_tokens??"0",estimated_cost_usd:t?.estimated_cost_usd??null},...n]}function ga(e,t){const r=Number(e),n=Number(t);return!Number.isFinite(r)||r<1||!Number.isFinite(n)||n<1?null:Math.ceil(r/n)}function de({className:e}){return c.jsx("div",{className:P("rounded bg-oai-gray-200/70 dark:bg-oai-gray-800/70 animate-pulse",e)})}function ha({index:e}){const t=e<3?"w-24":e<8?"w-20":"w-16",r=e<3?"w-16":"w-12",n=e<5?"w-14":"w-10";return c.jsxs("tr",{className:"group",children:[c.jsx("td",{className:P(_t(!1),"!group-hover:bg-transparent"),children:c.jsx(de,{className:"h-4 w-6"})}),c.jsx("td",{className:P(Tt(!1),"!group-hover:bg-transparent"),children:c.jsxs("div",{className:"flex items-center gap-4",children:[c.jsx(de,{className:"h-8 w-8 min-w-8 rounded-full"}),c.jsx(de,{className:P("h-4",t)})]})}),c.jsx("td",{className:"px-4 py-4 bg-white dark:bg-oai-gray-950",children:c.jsx(de,{className:P("h-4",r)})}),c.jsx("td",{className:"px-4 py-4 bg-white dark:bg-oai-gray-950",children:c.jsx(de,{className:"h-4 w-12"})}),bt.map(o=>c.jsx("td",{className:"px-4 py-4 bg-white dark:bg-oai-gray-950",children:c.jsx(de,{className:P("h-4",n)})},o.key))]})}function ba({rows:e=10}){return c.jsx("div",{className:"w-full overflow-x-auto",children:c.jsxs("table",{className:"min-w-max w-full text-left text-sm",children:[c.jsx("thead",{className:"border-b border-oai-gray-200 dark:border-oai-gray-800",children:c.jsxs("tr",{children:[c.jsx("th",{className:P(vr,"font-medium text-oai-gray-500 dark:text-oai-gray-400"),children:c.jsx(de,{className:"h-3.5 w-6"})}),c.jsx("th",{className:P(yr,"font-medium text-oai-gray-500 dark:text-oai-gray-400"),children:c.jsx(de,{className:"h-3.5 w-12"})}),c.jsx("th",{className:"px-4 py-4",children:c.jsx(de,{className:"h-3.5 w-10"})}),c.jsx("th",{className:"px-4 py-4",children:c.jsx(de,{className:"h-3.5 w-14"})}),bt.map(t=>c.jsx("th",{className:"px-4 py-4",children:c.jsx(de,{className:"h-3.5 w-12"})},t.key))]})}),c.jsx("tbody",{className:"divide-y divide-oai-gray-100 dark:divide-oai-gray-800/50",children:Array.from({length:e},(t,r)=>c.jsx(ha,{index:r},r))})]})})}function pa({id:e,thClassName:t,children:r}){const{attributes:n,listeners:o,setNodeRef:a,transform:i,transition:l,isDragging:d}=aa({id:e}),u=tt.Transform.toString(i)||"";s.useLayoutEffect(()=>{const f=document.querySelectorAll(`td[data-column-key="${e}"]`),p="0 2px 10px rgba(15, 23, 42, 0.10), 0 1px 3px rgba(15, 23, 42, 0.06)";return f.forEach(b=>{b.style.transform=u,b.style.transition=l||"",b.style.zIndex=d?"20":"",b.style.position=u?"relative":"",b.style.boxShadow=d?p:""}),()=>{f.forEach(b=>{b.style.transform="",b.style.transition="",b.style.zIndex="",b.style.position="",b.style.boxShadow=""})}},[e,u,l,d]);const g={transform:u,transition:l,position:u?"relative":void 0,zIndex:d?20:void 0,boxShadow:d?"0 2px 10px rgba(15, 23, 42, 0.10), 0 1px 3px rgba(15, 23, 42, 0.06)":void 0};return c.jsx("th",{ref:a,style:g,className:P(t,"group/col select-none cursor-grab active:cursor-grabbing touch-none"),...n,...o,children:c.jsxs("div",{className:"flex items-center justify-end gap-2",children:[c.jsx("span",{"aria-hidden":"true",className:P("-mr-1 inline-flex h-4 w-3 shrink-0 items-center justify-center text-oai-gray-400 dark:text-oai-gray-600","opacity-0 transition-opacity duration-150 group-hover/col:opacity-100",d&&"opacity-100"),children:c.jsxs("svg",{viewBox:"0 0 8 14",width:"8",height:"14",fill:"currentColor","aria-hidden":"true",children:[c.jsx("circle",{cx:"2",cy:"2",r:"1"}),c.jsx("circle",{cx:"6",cy:"2",r:"1"}),c.jsx("circle",{cx:"2",cy:"7",r:"1"}),c.jsx("circle",{cx:"6",cy:"7",r:"1"}),c.jsx("circle",{cx:"2",cy:"12",r:"1"}),c.jsx("circle",{cx:"6",cy:"12",r:"1"})]})}),r]})})}const Xr="tokentracker.leaderboard.columnOrder.v1";function ma(){if(typeof window>"u")return null;try{const e=window.localStorage.getItem(Xr);if(!e)return null;const t=JSON.parse(e);return Array.isArray(t)?t.filter(r=>typeof r=="string"):null}catch{return null}}function Mt(e){if(!(typeof window>"u"))try{window.localStorage.setItem(Xr,JSON.stringify(e))}catch{}}function gr(e,t){if(!e)return t;const r=new Set(t),n=e.filter(a=>r.has(a)),o=t.filter(a=>!n.includes(a));return[...n,...o]}function xa(e){const t=s.useMemo(()=>e.join("|"),[e]),[r,n]=s.useState(()=>gr(ma(),e));s.useEffect(()=>{n(i=>{const l=gr(i,e);return l.length===i.length&&l.every((u,g)=>u===i[g])?i:(Mt(l),l)})},[t,e]);const o=s.useCallback((i,l)=>{!i||!l||i===l||n(d=>{const u=d.indexOf(i),g=d.indexOf(l);if(u===-1||g===-1)return d;const f=d.slice(),[p]=f.splice(u,1);return f.splice(g,0,p),Mt(f),f})},[]),a=s.useCallback(()=>{Mt(e),n(e)},[e]);return{order:r,reorder:o,reset:a}}function va(e,t){const r=Number(e),n=Number(t);return!Number.isFinite(r)||r<1||!Number.isFinite(n)||n<1?null:Math.min(100,Math.max(1,Math.ceil(r/n*100)))}function Hr(e){return typeof e=="string"?e.trim():""}function ya(e){const t=Hr(e);return t?t.toLowerCase()==="anonymous":!0}function wa({me:e,totalEntries:t,meLabel:r,onJumpToMe:n,canJump:o}){const a=e&&typeof e.rank=="number"?e.rank:null;if(!a)return null;const i=Number(t)||0,l=va(a,i),d=Hr(e?.display_name),u=!d||ya(d)?r||"You":d,g=e?.user_id||u,f=!!o&&typeof n=="function",p=f?"button":"div",b=f?{type:"button",onClick:n,"aria-label":y("leaderboard.summary.jump_to_me")}:{};return c.jsxs(p,{...b,className:P("group inline-flex h-9 items-center gap-2.5 rounded-full border pl-1 pr-3.5 transition-all duration-300 select-none shadow-[0_1px_2px_rgba(0,0,0,0.03)]",f?"border-oai-gray-200 hover:border-oai-brand-400 dark:border-oai-gray-800 dark:hover:border-oai-brand-500/80 bg-oai-gray-50/50 dark:bg-white/[0.02] backdrop-blur-md hover:bg-oai-brand-50/40 dark:hover:bg-oai-brand-950/20 active:scale-[0.97] hover:shadow-[0_4px_12px_rgba(0,0,0,0.05)] dark:hover:shadow-[0_4px_20px_rgba(0,0,0,0.25)] dark:ring-1 dark:ring-white/[0.04] dark:hover:ring-white/[0.08]":"border-oai-gray-100 dark:border-oai-gray-800/60 bg-oai-gray-50/20 dark:bg-white/[0.01] backdrop-blur-sm dark:ring-1 dark:ring-white/[0.02]"),children:[c.jsx(Lt,{size:"sm",avatarUrl:e?.avatar_url,displayName:u,seed:g}),c.jsx("span",{className:"max-w-[120px] truncate text-xs font-semibold text-oai-black dark:text-oai-gray-200 group-hover:text-oai-brand-600 dark:group-hover:text-oai-brand-400 transition-colors",children:u}),c.jsxs("span",{className:"text-xs font-bold tabular-nums text-oai-gray-800 dark:text-white",children:["#",a.toLocaleString()]}),l!=null&&c.jsx("span",{className:P("inline-flex items-center rounded-full px-2 py-0.5 text-[9px] font-extrabold tracking-wider tabular-nums uppercase transition-colors duration-300 ring-1",l<=10?"bg-amber-500/10 text-amber-600 dark:bg-amber-500/15 dark:text-amber-400 ring-amber-500/20":"bg-oai-brand-100/50 text-oai-brand-700 dark:bg-oai-brand-500/10 dark:text-oai-brand-400 ring-oai-brand-500/10"),children:y("leaderboard.summary.percentile",{p:String(l)})}),f?c.jsx(yn,{"aria-hidden":!0,className:"size-3 text-oai-gray-400 transition-all duration-300 group-hover:text-oai-brand-500 dark:text-oai-gray-500 group-hover:translate-x-0.5 group-hover:scale-110"}):c.jsxs("span",{className:"relative flex h-1.5 w-1.5 shrink-0 items-center justify-center ml-1",title:"You are here",children:[c.jsx("span",{className:"absolute inline-flex h-full w-full animate-ping rounded-full bg-emerald-400 opacity-75 duration-1000"}),c.jsx("span",{className:"relative inline-flex h-1.5 w-1.5 rounded-full bg-emerald-500"})]})]})}const Ft=[10,20,50,100],Ut=20,Kr="tokentracker:leaderboard:pageSize";function ka(){if(typeof window>"u")return Ut;try{const e=window.localStorage.getItem(Kr),t=Number(e);if(Ft.includes(t))return t}catch{}return Ut}function hr(e,t,r){const n=Number(e);if(!Number.isFinite(n)||n<=0)return"-";const o=dn(t),a=t===hn?n:n*r;return a>=1e3?`${o}${Math.round(a).toLocaleString()}`:a>=10?`${o}${Math.round(a)}`:`${o}${a.toFixed(2)}`}function br(e,t,r){const n=t?"text-oai-gray-700 dark:text-oai-gray-300":"text-oai-gray-500 dark:text-oai-gray-400",o=t?"bg-oai-brand-50 dark:bg-oai-brand-900/10":"bg-white dark:bg-oai-gray-950 group-hover:bg-oai-gray-50 dark:group-hover:bg-oai-gray-900/60";return r.map(a=>c.jsx("td",{"data-column-key":a.key,className:P("px-4 py-4 whitespace-nowrap text-right tabular-nums",n,o),children:It(e?.[a.key])},a.key))}const Sa={1:{text:"text-amber-600 dark:text-amber-400",badge:"bg-amber-50 dark:bg-amber-900/20"},2:{text:"text-gray-500 dark:text-gray-300",badge:"bg-gray-50 dark:bg-gray-800/40"},3:{text:"text-orange-700 dark:text-orange-400",badge:"bg-orange-50 dark:bg-orange-900/20"}};function pr({rank:e,placeholder:t}){const r=Sa[e];return r?c.jsx("span",{className:P("inline-flex items-center justify-center h-7 w-7 rounded-full text-xs font-bold",r.text,r.badge),children:e}):c.jsx("span",{className:"inline-flex items-center justify-center h-7 w-7 text-sm",children:e??t})}function Yt(e){if(typeof e!="string")return null;const t=e.trim().toLowerCase();return t==="week"||t==="month"||t==="total"?t:null}function Ca(e){if(!e)return y("shared.error.prefix",{error:y("leaderboard.error.unknown")});const t=e?.message||String(e),r=String(t||"").trim()||y("leaderboard.error.unknown");return y("shared.error.prefix",{error:r})}function Gr(e){return typeof e!="string"?"":e.trim()}function Na(e){const t=Gr(e);return t?t.toLowerCase()==="anonymous":!0}function Ra(e,t=""){if(typeof e!="string")return null;const r=e.trim().toLowerCase();if(!r)return null;const n=new URLSearchParams(typeof t=="string"?t:""),o=Yt(n.get("period")),a=o?`?period=${o}`:"";return`/share/pv1-${r}${a}`}function mr(e,t){const r=typeof e?.user_id=="string"?e.user_id.trim():"";return r||`${e?.rank??""}:${t}`}function xr({githubUrl:e}){return c.jsxs("span",{className:"relative inline-flex items-center group/gh shrink-0",children:[c.jsx("a",{href:e,target:"_blank",rel:"noopener noreferrer",onClick:t=>t.stopPropagation(),"aria-label":y("leaderboard.github.aria"),className:"text-oai-black hover:text-oai-gray-500 dark:text-white dark:hover:text-oai-gray-400 transition-colors",children:c.jsx(bn,{provider:"GITHUB",size:16})}),c.jsxs("span",{role:"tooltip",className:"invisible opacity-0 group-hover/gh:visible group-hover/gh:opacity-100 absolute right-0 bottom-full mb-2 whitespace-nowrap rounded-md bg-oai-black dark:bg-oai-gray-700 px-2.5 py-1.5 text-[11px] leading-relaxed text-white shadow-lg transition-opacity duration-150 z-50 before:content-[''] before:absolute before:inset-x-0 before:top-full before:h-2.5",children:[c.jsx("span",{className:"block",children:y("leaderboard.github.tooltipAction")}),c.jsxs("span",{className:"block text-oai-gray-300 dark:text-oai-gray-400",children:[y("leaderboard.github.tooltipPrefix")," ",c.jsx(cn,{to:"/settings",onClick:t=>t.stopPropagation(),className:"text-white underline underline-offset-2 decoration-oai-gray-400 hover:text-oai-brand-300 hover:decoration-oai-brand-300",children:y("leaderboard.github.tooltipSettingsLink")}),y("leaderboard.github.tooltipSuffix")]})]})]})}function Ia({auth:e,signedIn:t,sessionSoftExpired:r}){const n=Zr(),o=Qr(),{openLoginModal:a}=en(),{signedIn:i,loading:l,user:d}=tn(),{currency:u,rate:g}=pn(),f=s.useMemo(()=>rn(),[]),p=nn(),b=t&&!r,E=s.useMemo(()=>b&&(typeof e=="function"||typeof e=="string"||e&&typeof e=="object")?e:null,[e,b]),m=b?E:null,x=b&&on(m),w=y("shared.placeholder.short"),k=s.useMemo(()=>bt.map(h=>h.key),[]),{order:v,reorder:C}=xa(k),j=s.useMemo(()=>{const h=new Map;for(const I of bt)h.set(I.key,I);return h},[]),N=s.useMemo(()=>v.map(h=>j.get(h)).filter(Boolean),[v,j]),S=Ln(er(Jt,{activationConstraint:{distance:6}}),er(Vt,{coordinateGetter:la})),R=s.useCallback(h=>{const{active:I,over:te}=h;!te||I.id===te.id||C(String(I.id),String(te.id))},[C]),[T,_]=s.useState(1),[A,G]=s.useState(ka),V=s.useCallback(h=>{const I=Ft.includes(h)?h:Ut;G(I),_(1);try{window.localStorage.setItem(Kr,String(I))}catch{}},[]),[ee,Ie]=s.useState(0),[$,F]=s.useState(()=>({loading:!1,error:null,data:null})),[Le,oe]=s.useState(()=>an()),[ke,_e]=s.useState(!1),L=s.useMemo(()=>{const h=new URLSearchParams(n?.search||"");return Yt(h.get("period"))||"total"},[n?.search]),ae=n?.search||"",me=h=>{const I=Yt(h);if(!I||I===L)return;const te=new URLSearchParams(n?.search||"");te.set("period",I),_(1),o(`${n?.pathname||"/leaderboard"}?${te.toString()}`,{replace:!0})};s.useEffect(()=>{l||p||i||a()},[i,l,p,a]),s.useEffect(()=>{_(1)},[L]);const Se=s.useMemo(()=>(nt(T,{min:1,max:1e6,fallback:1})-1)*A,[T,A]);s.useEffect(()=>{if(!f&&!p)return;let h=!0;return F(I=>({...I,loading:!0,error:null})),(async()=>{const I=await sn({userId:d?.id||null,period:L,limit:A,offset:Se});h&&F({loading:!1,error:null,data:I})})().catch(I=>{h&&F({loading:!1,error:Ca(I),data:null})}),()=>{h=!1}},[f,d?.id,Se,ee,p,L,A]);const O=$.data,xe=O?.total_pages??null,fe=O?.total_entries??0,Y=O?.page??T,M=s.useMemo(()=>da(Y,xe),[Y,xe]),Ce=O?.from||null,q=O?.to||null,ve=O?.generated_at||null,X=O?.me||null,ie=y("leaderboard.me_label"),Ne=y("leaderboard.anon_label"),We=y("leaderboard.period.week"),Xe=y("leaderboard.period.month"),Oe=y("leaderboard.period.total"),se=L==="month"?Xe:L==="total"?Oe:We,Re=s.useMemo(()=>{const h=Array.isArray(O?.entries)?O.entries:[];return fa({entries:h,me:X,meLabel:ie})},[O?.entries,X,ie]),le=s.useMemo(()=>ga(X?.rank,A),[X?.rank,A]),st=le!=null&&le===Y,lt=s.useCallback(()=>{le!=null&&_(le)},[le]),Ct=async()=>{_e(!0);try{un(!0),oe(!0),await fn(()=>Zt(m));const h=await Zt(m);h&&await gn({accessToken:h,period:L,source:"leaderboard-enable-sync"}),Ie(I=>I+1)}catch(h){console.warn("[tokentracker] sync:",h)}finally{_e(!1)}},{canPrev:ct,canNext:ye}=ua({page:Y,totalPages:xe}),De=Array.isArray(Re)&&Re.length!==0;let ce=null;$.loading?ce=c.jsx(ba,{rows:A}):$.error?ce=c.jsx("div",{className:"px-6 py-12 text-center",children:c.jsx("p",{className:"text-sm text-red-500 dark:text-red-400",children:$.error})}):De?ce=c.jsx(zo,{sensors:S,collisionDetection:Pn,modifiers:[Ho],onDragEnd:R,children:c.jsx("div",{className:"w-full overflow-x-auto",children:c.jsxs("table",{className:"min-w-max w-full text-left text-sm",children:[c.jsx("thead",{className:"border-b border-oai-gray-200 dark:border-oai-gray-800",children:c.jsxs("tr",{children:[c.jsx("th",{className:P(vr,"text-[11px] font-semibold uppercase tracking-wider text-oai-gray-400 dark:text-oai-gray-500"),children:y("leaderboard.column.rank")}),c.jsx("th",{className:P(yr,"text-[11px] font-semibold uppercase tracking-wider text-oai-gray-400 dark:text-oai-gray-500"),children:y("leaderboard.column.user")}),c.jsx("th",{className:"px-4 py-4 text-[11px] font-semibold uppercase tracking-wider text-oai-gray-400 dark:text-oai-gray-500 whitespace-nowrap text-right align-middle",children:y("leaderboard.column.total")}),c.jsx("th",{className:"px-4 py-4 text-[11px] font-semibold uppercase tracking-wider text-oai-gray-400 dark:text-oai-gray-500 whitespace-nowrap text-right align-middle",title:"Based on estimated API pricing, not actual billing",children:y("leaderboard.column.est_cost")}),c.jsx(Zo,{items:v,strategy:qo,children:N.map(h=>c.jsx(pa,{id:h.key,thClassName:"px-4 py-4 text-[11px] font-semibold uppercase tracking-wider text-oai-gray-400 dark:text-oai-gray-500 whitespace-nowrap align-middle",children:c.jsx(mn,{iconSrc:h.icon,label:y(h.copyKey)})},h.key))})]})}),c.jsx("tbody",{className:"divide-y divide-oai-gray-100 dark:divide-oai-gray-800/50",children:Re.map((h,I)=>{if(h?.is_ellipsis){const Te=4+N.length;return c.jsx("tr",{"aria-hidden":"true",children:c.jsx("td",{colSpan:Te,className:"px-4 py-2 text-center text-oai-gray-400 dark:text-oai-gray-600 bg-white dark:bg-oai-gray-950 select-none tracking-[0.4em] text-xs",children:"···"})},`ellipsis-${I}`)}const te=!!h?.is_me,dt=typeof h?.user_id=="string"?h.user_id:null,ze=Gr(h?.display_name),ut=Na(ze)?Ne:ze,ge=te?ie:ut;if(!!dt&&!te&&!!h?.is_public&&Ra(dt,ae),te){const Te=!!h?.is_pinned;return c.jsxs("tr",{className:P("bg-oai-brand-50 dark:bg-oai-brand-900/10 transition-colors",Te?"border-t border-b border-oai-brand-300/40 dark:border-oai-brand-500/20":"border-y border-oai-brand-300/40 dark:border-oai-brand-500/30"),children:[c.jsx("td",{className:P(_t(!0),"relative font-semibold text-oai-brand-600 dark:text-oai-brand-400",Te&&"before:absolute before:left-0 before:top-[15%] before:h-[70%] before:w-[3px] before:rounded-r before:bg-oai-brand-500 dark:before:bg-oai-brand-400"),children:c.jsx(pr,{rank:h?.rank,placeholder:w})}),c.jsx("td",{className:Tt(!0),children:c.jsxs("div",{className:"flex min-w-0 items-center gap-2",children:[c.jsx(Lt,{avatarUrl:h?.avatar_url,displayName:ge,seed:mr(h,ge)}),c.jsx("span",{className:"truncate font-semibold text-oai-black dark:text-oai-white",children:ge}),h?.github_url&&c.jsx(xr,{githubUrl:h.github_url})]})}),c.jsx("td",{className:"px-4 py-4 font-medium text-oai-black dark:text-oai-white whitespace-nowrap text-right tabular-nums bg-oai-brand-50 dark:bg-oai-brand-900/10",children:It(h?.total_tokens)}),c.jsx("td",{className:"px-4 py-4 font-medium text-oai-brand-600 dark:text-oai-brand-400 whitespace-nowrap text-right tabular-nums bg-oai-brand-50 dark:bg-oai-brand-900/10",title:"Based on estimated API pricing, not actual billing",children:hr(h?.estimated_cost_usd,u,g)}),br(h,!0,N)]},`row-${h?.rank}-${ge}${Te?"-pin":""}`)}return c.jsxs("tr",{className:"group transition-colors",children:[c.jsx("td",{className:P(_t(!1),"font-medium text-oai-gray-500 dark:text-oai-gray-400"),children:c.jsx(pr,{rank:h?.rank,placeholder:w})}),c.jsx("td",{className:Tt(!1),children:c.jsxs("div",{className:"flex min-w-0 items-center gap-2",children:[c.jsx(Lt,{avatarUrl:h?.avatar_url,displayName:ge,seed:mr(h,ge)}),c.jsx("span",{className:"truncate font-medium text-oai-gray-800 dark:text-oai-gray-200",children:ge}),h?.github_url&&c.jsx(xr,{githubUrl:h.github_url})]})}),c.jsx("td",{className:"px-4 py-4 font-semibold text-oai-gray-800 dark:text-oai-gray-200 whitespace-nowrap text-right tabular-nums bg-white dark:bg-oai-gray-950 group-hover:bg-oai-gray-50 dark:group-hover:bg-oai-gray-900/60",children:It(h?.total_tokens)}),c.jsx("td",{className:"px-4 py-4 text-oai-gray-500 dark:text-oai-gray-400 whitespace-nowrap text-right tabular-nums bg-white dark:bg-oai-gray-950 group-hover:bg-oai-gray-50 dark:group-hover:bg-oai-gray-900/60",title:"Based on estimated API pricing, not actual billing",children:hr(h?.estimated_cost_usd,u,g)}),br(h,!1,N)]},`row-${h?.rank}-${ge}`)})})]})})}):ce=c.jsx("div",{className:"px-6 py-12 text-center",children:c.jsx("p",{className:"text-sm text-oai-gray-500 dark:text-oai-gray-400",children:y("leaderboard.empty")})});let Pe=null;return typeof xe=="number"?Pe=M.map((h,I)=>h==null?c.jsx("span",{className:"px-2 text-oai-gray-400 dark:text-oai-gray-500",children:y("leaderboard.pagination.ellipsis")},`ellipsis-${I}`):c.jsx("button",{className:P("flex h-8 w-8 items-center justify-center rounded-md text-sm font-medium transition-colors",h===Y?"bg-oai-gray-200 dark:bg-oai-gray-800 text-oai-black dark:text-white":"text-oai-gray-500 dark:text-oai-gray-400 hover:bg-oai-gray-100 dark:hover:bg-oai-gray-800 hover:text-oai-black dark:hover:text-white"),onClick:()=>_(h),disabled:$.loading,children:String(h)},`page-${h}`)):Pe=c.jsx("span",{className:"text-sm text-oai-gray-500 dark:text-oai-gray-400",children:y("leaderboard.pagination.page_unknown",{page:String(Y)})}),c.jsxs("div",{className:"flex flex-col flex-1 text-oai-black dark:text-oai-white font-oai antialiased",children:[c.jsx("main",{className:"flex-1 pt-8 sm:pt-10 pb-12 sm:pb-16",children:c.jsxs("div",{className:"mx-auto max-w-6xl px-4 sm:px-6",children:[c.jsxs("div",{className:"flex flex-col md:flex-row md:items-end justify-between gap-6 mb-8",children:[c.jsxs("div",{children:[c.jsx("h1",{className:"text-3xl sm:text-4xl font-semibold tracking-tight text-oai-black dark:text-white mb-3",children:y("leaderboard.title")}),c.jsxs("p",{className:"text-oai-gray-500 dark:text-oai-gray-400 text-sm sm:text-base",children:[L==="total"?y("leaderboard.range.total"):Ce&&q?y("leaderboard.range",{period:se,from:Ce,to:q}):y("leaderboard.range_loading",{period:se}),ve&&c.jsx("span",{className:"ml-2 pl-2 border-l border-oai-gray-200 dark:border-oai-gray-800 inline-block text-oai-gray-400 dark:text-oai-gray-500 text-xs",children:y("leaderboard.generated_at",{ts:ve})})]})]}),c.jsxs("div",{className:"flex flex-wrap items-center gap-3",children:[c.jsx(wa,{me:X,totalEntries:fe,meLabel:ie,onJumpToMe:lt,canJump:le!=null&&!st&&!$.loading}),c.jsx("div",{className:"inline-flex h-9 p-1 border border-oai-gray-200 dark:border-oai-gray-800 rounded-full items-center relative",children:["week","month","total"].map(h=>{const I=L===h;return c.jsxs("button",{onClick:()=>me(h),disabled:$.loading,className:P("px-4 h-7 text-sm font-medium rounded-full flex items-center justify-center transition-colors relative",I?"text-oai-black dark:text-white":"text-oai-gray-500 dark:text-oai-gray-400 hover:text-oai-gray-800 dark:hover:text-oai-gray-200"),children:[c.jsx("span",{className:"relative z-10",children:h==="week"?We:h==="month"?Xe:Oe}),I&&c.jsx(ln.div,{layoutId:"leaderboard-period-active-bg",className:"absolute inset-0 bg-oai-gray-200 dark:bg-oai-gray-800 rounded-full z-0",transition:{type:"spring",stiffness:380,damping:30}})]},h)})})]})]}),!t&&c.jsxs("div",{className:"mb-6 flex items-center justify-between text-sm",children:[c.jsx("p",{className:"text-oai-gray-500 dark:text-oai-gray-400",children:y("leaderboard.signin_prompt")}),c.jsx("button",{onClick:a,className:"px-3 py-1.5 text-sm font-medium text-oai-gray-600 dark:text-oai-gray-300 border border-oai-gray-300 dark:border-oai-gray-700 rounded-md hover:text-oai-black dark:hover:text-white hover:border-oai-gray-400 dark:hover:border-oai-gray-600 transition-colors",children:y("leaderboard.signin_button")})]}),b&&x&&!Le&&c.jsxs("div",{className:"mb-6 flex items-center justify-between text-sm",children:[c.jsx("p",{className:"text-oai-gray-500 dark:text-oai-gray-400",children:y("leaderboard.sync_prompt")}),c.jsx("button",{onClick:Ct,disabled:ke,className:"px-3 py-1.5 text-sm font-medium text-oai-gray-600 dark:text-oai-gray-300 border border-oai-gray-300 dark:border-oai-gray-700 rounded-md hover:text-oai-black dark:hover:text-white hover:border-oai-gray-400 dark:hover:border-oai-gray-600 disabled:opacity-50 transition-colors",children:ke?y("leaderboard.sync_button.busy"):y("leaderboard.sync_button.idle")})]}),c.jsxs("div",{className:"rounded-xl border border-oai-gray-200 dark:border-oai-gray-800 overflow-hidden",children:[ce,c.jsxs("div",{className:"px-6 py-3 border-t border-oai-gray-200 dark:border-oai-gray-800 flex flex-wrap items-center justify-end gap-x-4 gap-y-2",children:[c.jsxs("div",{className:"flex items-center gap-2 text-sm text-oai-gray-500 dark:text-oai-gray-400",children:[c.jsx("label",{htmlFor:"leaderboard-page-size",className:"whitespace-nowrap",children:y("leaderboard.pagination.page_size_label")}),c.jsxs("div",{className:"relative",children:[c.jsx("select",{id:"leaderboard-page-size",value:A,onChange:h=>V(Number(h.target.value)),disabled:$.loading,className:"appearance-none pl-3 pr-8 py-1 rounded-md bg-white dark:bg-oai-gray-950 border border-oai-gray-300 dark:border-oai-gray-700 text-oai-gray-700 dark:text-oai-gray-300 hover:border-oai-gray-400 dark:hover:border-oai-gray-600 focus:outline-none focus:ring-2 focus:ring-oai-brand-500 disabled:opacity-50 transition-colors",children:Ft.map(h=>c.jsx("option",{value:h,children:h},h))}),c.jsx(xn,{className:"pointer-events-none absolute right-2 top-1/2 -translate-y-1/2 h-3.5 w-3.5 text-oai-gray-500 dark:text-oai-gray-400",strokeWidth:2,"aria-hidden":"true"})]})]}),c.jsx("div",{className:"h-5 w-px bg-oai-gray-200 dark:bg-oai-gray-800","aria-hidden":"true"}),c.jsx("button",{className:P("px-3 py-1.5 text-sm font-medium text-oai-gray-500 dark:text-oai-gray-400 rounded-md transition-colors",ct&&!$.loading?"hover:bg-oai-gray-100 dark:hover:bg-oai-gray-800 hover:text-oai-black dark:hover:text-white":"opacity-50 cursor-not-allowed"),onClick:()=>_(h=>Math.max(1,h-1)),disabled:!ct||$.loading,children:y("leaderboard.pagination.prev")}),c.jsx("div",{className:"flex flex-wrap items-center gap-1",children:Pe}),c.jsx("button",{className:P("px-3 py-1.5 text-sm font-medium text-oai-gray-500 dark:text-oai-gray-400 rounded-md transition-colors",ye&&!$.loading?"hover:bg-oai-gray-100 dark:hover:bg-oai-gray-800 hover:text-oai-black dark:hover:text-white":"opacity-50 cursor-not-allowed"),onClick:()=>_(h=>h+1),disabled:!ye||$.loading,children:y("leaderboard.pagination.next")})]})]})]})}),c.jsx("footer",{className:"border-t border-oai-gray-200 dark:border-oai-gray-900 py-8 transition-colors duration-200",children:c.jsxs("div",{className:"mx-auto flex max-w-6xl items-center justify-between px-4 sm:px-6 text-sm text-oai-gray-400 dark:text-oai-gray-500",children:[c.jsx("p",{children:y("landing.v2.footer.line")}),c.jsx("a",{href:"https://github.com/mm7894215/TokenTracker",className:"text-oai-gray-400 dark:text-oai-gray-500 hover:text-oai-black dark:hover:text-white transition-colors",target:"_blank",rel:"noopener noreferrer",children:y("landing.v2.nav.github")})]})})]})}export{Ia as LeaderboardPage};
@@ -1 +0,0 @@
1
- import{r as n,C as e,aa as D,D as K,ac as W,h as Y,j as Z,ag as G,ai as q,B as a,a7 as L,a5 as B,L as E,a8 as F}from"./main-Ch22JpOj.js";import{H as J}from"./HeaderGithubStar-7oF7WLZx.js";import{b as I,e as Q,l as V,f as X,d as ee,L as re,g as ae}from"./leaderboard-columns-C6mnviZx.js";const y=18;function O(){return e.jsxs("svg",{"aria-hidden":!0,width:y,height:y,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[e.jsx("circle",{cx:"12",cy:"12",r:"4"}),e.jsx("path",{d:"M12 2v2"}),e.jsx("path",{d:"M12 20v2"}),e.jsx("path",{d:"m4.93 4.93 1.41 1.41"}),e.jsx("path",{d:"m17.66 17.66 1.41 1.41"}),e.jsx("path",{d:"M2 12h2"}),e.jsx("path",{d:"M20 12h2"}),e.jsx("path",{d:"m6.34 17.66-1.41 1.41"}),e.jsx("path",{d:"m19.07 4.93-1.41 1.41"})]})}function P(){return e.jsx("svg",{"aria-hidden":!0,width:y,height:y,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:e.jsx("path",{d:"M12 3a6 6 0 0 0 9 9 9 9 0 1 1-9-9Z"})})}function te(){return e.jsxs("svg",{"aria-hidden":!0,width:y,height:y,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[e.jsx("rect",{x:"2",y:"3",width:"20",height:"14",rx:"2"}),e.jsx("path",{d:"M8 21h8"}),e.jsx("path",{d:"M12 17v4"})]})}const oe=[{value:"light",label:"Light",Icon:O},{value:"dark",label:"Dark",Icon:P},{value:"system",label:"System",Icon:te}];function se(r){return r==="dark"?P:O}function ne({theme:r,resolvedTheme:s,onSetTheme:p,className:d="",direction:b="down",align:T="right"}){const[c,k]=n.useState(!1),h=n.useRef(null),x=n.useCallback(()=>k(!1),[]);n.useEffect(()=>{if(!c)return;const t=l=>{h.current&&!h.current.contains(l.target)&&x()};return document.addEventListener("mousedown",t),()=>document.removeEventListener("mousedown",t)},[c,x]),n.useEffect(()=>{if(!c)return;const t=l=>{l.key==="Escape"&&x()};return document.addEventListener("keydown",t),()=>document.removeEventListener("keydown",t)},[c,x]);const i=se(s);return e.jsxs("div",{ref:h,className:`relative ${d}`,children:[e.jsx("button",{type:"button","aria-label":"Theme","aria-expanded":c,onClick:()=>k(t=>!t),className:"flex items-center justify-center w-9 h-9 rounded-lg text-oai-gray-600 dark:text-oai-gray-400 hover:bg-oai-gray-100 dark:hover:bg-oai-gray-800 hover:text-oai-black dark:hover:text-white transition-colors",children:e.jsx(i,{})}),c&&e.jsx("div",{className:`absolute z-50 min-w-[140px] py-1 rounded-lg border border-oai-gray-200 dark:border-oai-gray-800 bg-white dark:bg-oai-gray-900 shadow-lg ${b==="up"?"bottom-full mb-1":"top-full mt-1"} ${T==="left"?"left-0":"right-0"}`,children:oe.map(({value:t,label:l,Icon:j})=>{const m=r===t;return e.jsxs("button",{type:"button",onClick:()=>{p(t),x()},className:`flex w-full items-center gap-2.5 px-3 py-2 text-sm transition-colors ${m?"text-oai-black dark:text-white bg-oai-gray-100 dark:bg-oai-gray-800":"text-oai-gray-600 dark:text-oai-gray-400 hover:bg-oai-gray-50 dark:hover:bg-oai-gray-800/60 hover:text-oai-black dark:hover:text-white"}`,children:[e.jsx(j,{}),e.jsx("span",{children:l})]},t)})})]})}function ie(r){if(!r)return a("shared.error.prefix",{error:a("leaderboard.error.unknown")});const s=r?.message||String(r),p=String(s||"").trim()||a("leaderboard.error.unknown");return a("shared.error.prefix",{error:p})}function le(r){return typeof r!="string"?"":r.trim()}function de(r){if(typeof r!="string")return null;const s=r.trim().toLowerCase();return s==="week"||s==="month"||s==="total"?s:null}function he({auth:r,signedIn:s,sessionSoftExpired:p,userId:d}){const b=D(),{theme:T,resolvedTheme:c,setTheme:k}=K(),h=n.useMemo(()=>W(),[]),x=Y(),i=s&&!p,t=n.useMemo(()=>i&&(typeof r=="function"||typeof r=="string"||r&&typeof r=="object")?r:null,[r,i]),l=i?t:null,j=i&&Z(l),m=n.useMemo(()=>{const o=new URLSearchParams(b?.search||"");return de(o.get("period"))||"week"},[b?.search]),_=b?.search||"",[v,w]=n.useState(()=>({loading:!1,error:null,data:null}));n.useEffect(()=>{if(!h&&!x||!d||i&&!j)return;let o=!0;return w(f=>({...f,loading:!0,error:null})),(async()=>{const f=i?await G(l):null;if(!o)return;const $=await q({accessToken:f,userId:d,period:m});o&&w({loading:!1,error:null,data:$})})().catch(f=>{if(o){if(f?.status===404){w({loading:!1,error:null,data:null});return}w({loading:!1,error:ie(f),data:null})}}),()=>{o=!1}},[i,j,h,l,x,m,d]);const N=v.data,C=N?.from||null,M=N?.to||null,A=N?.generated_at||null,g=N?.entry||null,S=le(g?.display_name)||a("leaderboard.anon_label"),z=a("leaderboard.period.week"),H=a("leaderboard.period.month"),U=a("leaderboard.period.total"),R=m==="month"?H:m==="total"?U:z;let u=null;return d?v.loading?u=e.jsx("div",{className:"px-6 py-12 text-center",children:e.jsx("p",{className:"text-sm text-oai-gray-500 dark:text-oai-gray-400",children:a("leaderboard.loading")})}):v.error?u=e.jsx("div",{className:"px-6 py-12 text-center",children:e.jsx("p",{className:"text-sm text-red-500 dark:text-red-400",children:v.error})}):g?u=e.jsx("div",{className:"w-full overflow-x-auto",children:e.jsxs("table",{className:"min-w-max w-full text-left text-sm",children:[e.jsx("thead",{className:"border-b border-oai-gray-200 dark:border-oai-gray-800",children:e.jsxs("tr",{children:[e.jsx("th",{className:L(re,"font-medium text-oai-gray-500 dark:text-oai-gray-400"),children:a("leaderboard.column.rank")}),e.jsx("th",{className:L(ae,"font-medium text-oai-gray-500 dark:text-oai-gray-400 whitespace-nowrap"),children:a("leaderboard.column.total")}),I.map(o=>e.jsx("th",{className:"px-4 py-4 font-medium text-oai-gray-500 dark:text-oai-gray-400 whitespace-nowrap",children:e.jsx(Q,{iconSrc:o.icon,label:a(o.copyKey)})},o.key))]})}),e.jsx("tbody",{className:"divide-y divide-oai-gray-100 dark:divide-oai-gray-800/50",children:e.jsxs("tr",{className:"transition-colors hover:bg-oai-gray-50 dark:hover:bg-oai-gray-900/60",children:[e.jsx("td",{className:L(V(!1),"font-medium text-oai-gray-500 dark:text-oai-gray-400"),children:g?.rank??a("shared.placeholder.short")}),e.jsx("td",{className:L(X(),"text-oai-gray-700 dark:text-oai-gray-300"),children:B(g?.total_tokens)}),I.map(o=>e.jsx("td",{className:"px-4 py-4 text-oai-gray-500 dark:text-oai-gray-400 whitespace-nowrap",children:B(g?.[o.key])},o.key))]})})]})}):u=e.jsx("div",{className:"px-6 py-12 text-center",children:e.jsx("p",{className:"text-sm text-oai-gray-500 dark:text-oai-gray-400",children:a("leaderboard.empty")})}):u=e.jsx("div",{className:"px-6 py-12 text-center",children:e.jsx("p",{className:"text-sm text-oai-gray-500 dark:text-oai-gray-400",children:a("leaderboard.empty")})}),e.jsxs("div",{className:"flex flex-col min-h-screen bg-oai-white dark:bg-oai-gray-950 text-oai-black dark:text-oai-white font-oai antialiased transition-colors duration-200",children:[e.jsx("header",{className:"sticky top-0 z-50 bg-white/80 dark:bg-oai-gray-950/80 backdrop-blur-md border-b border-oai-gray-200 dark:border-oai-gray-900 transition-colors duration-200",children:e.jsxs("div",{className:"mx-auto flex h-14 max-w-6xl items-center justify-between px-4 sm:px-6",children:[e.jsxs("div",{className:"flex items-center gap-5",children:[e.jsxs(E,{to:"/",className:"flex items-center gap-3 no-underline outline-none rounded focus-visible:ring-2 focus-visible:ring-oai-brand-500 focus-visible:ring-offset-2 dark:ring-offset-oai-gray-950 transition-opacity hover:opacity-80",children:[e.jsx("img",{src:"/app-icon.png",alt:"",width:24,height:24,className:"rounded-md"}),e.jsx("span",{className:"text-sm font-semibold tracking-wide text-oai-black dark:text-white uppercase",children:"Token Tracker"})]}),e.jsx("div",{className:"hidden sm:block",children:e.jsx(J,{})})]}),e.jsxs("div",{className:"flex items-center gap-2 sm:gap-3",children:[e.jsx(E,{to:`/leaderboard${_}`,className:"no-underline inline-flex items-center justify-center h-9 px-5 text-sm font-medium rounded-full shadow-sm ring-1 ring-oai-gray-200 dark:ring-white/10 bg-oai-gray-900 dark:bg-white text-white dark:text-oai-gray-900 hover:bg-oai-gray-800 dark:hover:bg-oai-gray-100 transition-colors",children:a("leaderboard.profile.nav.back")}),e.jsx(ne,{theme:T,resolvedTheme:c,onSetTheme:k}),e.jsx(F,{})]})]})}),e.jsx("main",{className:"flex-1 py-12 sm:py-16",children:e.jsxs("div",{className:"mx-auto max-w-6xl px-4 sm:px-6",children:[e.jsxs("div",{className:"flex flex-col sm:flex-row sm:items-center gap-6 mb-10",children:[e.jsx(ee,{avatarUrl:g?.avatar_url,displayName:S,seed:typeof d=="string"?d:S,size:"lg",className:"shrink-0 ring-2 ring-oai-gray-200 dark:ring-oai-gray-800"}),e.jsxs("div",{className:"min-w-0",children:[e.jsx("h1",{className:"text-3xl sm:text-4xl font-semibold tracking-tight text-oai-black dark:text-white mb-3",children:S}),e.jsxs("p",{className:"text-oai-gray-500 dark:text-oai-gray-400 text-sm sm:text-base",children:[m==="total"?a("leaderboard.range.total"):C&&M?a("leaderboard.range",{period:R,from:C,to:M}):a("leaderboard.range_loading",{period:R}),A&&e.jsx("span",{className:"ml-2 pl-2 border-l border-oai-gray-200 dark:border-oai-gray-800 inline-block text-oai-gray-400 dark:text-oai-gray-500 text-xs",children:a("leaderboard.generated_at",{ts:A})})]})]})]}),e.jsx("div",{className:"rounded-xl border border-oai-gray-200 dark:border-oai-gray-800 overflow-hidden",children:u})]})}),e.jsx("footer",{className:"border-t border-oai-gray-200 dark:border-oai-gray-900 py-8 transition-colors duration-200",children:e.jsxs("div",{className:"mx-auto flex max-w-6xl items-center justify-between px-4 sm:px-6 text-sm text-oai-gray-400 dark:text-oai-gray-500",children:[e.jsx("p",{children:a("landing.v2.footer.line")}),e.jsx(E,{to:`/leaderboard${_}`,className:"text-oai-gray-400 dark:text-oai-gray-500 hover:text-oai-black dark:hover:text-white transition-colors",children:a("leaderboard.profile.nav.back")})]})})]})}export{he as LeaderboardProfilePage};
@@ -1,2 +0,0 @@
1
- import{C as r,a7 as g,B as n,r as j,L as v,ak as k}from"./main-Ch22JpOj.js";import{u as N}from"./use-usage-limits-BDH7ZuiN.js";import{u as L}from"./use-limits-display-prefs-Rfcf8uOp.js";import{C as h}from"./Card-Bm2ZOfFA.js";import{F as E}from"./FadeIn-BGmXw8rD.js";import"./use-reduced-motion-lvUJO2cx.js";const P=[3,2,3,3,2,2,3];function m({className:s}){return r.jsx("div",{className:g("rounded bg-oai-gray-200/70 dark:bg-oai-gray-800/70 animate-pulse",s)})}function C(){return r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsx(m,{className:"h-3 w-12 shrink-0"}),r.jsx(m,{className:"flex-1 h-1.5 rounded-full min-w-0"}),r.jsx(m,{className:"h-3 w-[30px] shrink-0"}),r.jsx(m,{className:"h-3 w-6 shrink-0"})]})}function O({bars:s,index:e}){const i=e%3===0?"w-24":e%3===1?"w-20":"w-[4.5rem]";return r.jsxs("div",{className:"flex flex-col gap-1.5",children:[r.jsxs("div",{className:"flex items-center gap-1.5",children:[r.jsx(m,{className:"h-[14px] w-[14px] rounded shrink-0"}),r.jsx(m,{className:g("h-4",i)})]}),Array.from({length:s},(l,a)=>r.jsx(C,{},a))]})}function T(){return r.jsx(h,{children:r.jsxs("div",{className:"flex flex-col gap-3",children:[r.jsx(m,{className:"h-3.5 w-28"}),P.map((s,e)=>r.jsx(O,{bars:s,index:e},e))]})})}function t(s){if(!s)return null;const e=typeof s=="number"?s*1e3:Date.parse(s);if(!Number.isFinite(e))return null;const i=e-Date.now();if(i<=0)return n("shared.time.now");const l=Math.floor(i/6e4);if(l<60)return`${l}m`;const a=Math.floor(l/60);return a<24?`${a}h`:`${Math.floor(a/24)}d`}function R(s){return s>=90?"bg-red-500":s>=70?"bg-amber-500":"bg-emerald-500"}function o({label:s,pct:e,reset:i}){const l=Math.max(0,Math.min(100,Number(e)||0)),a=Math.round(l),u=l>0&&a===0?Math.max(l,.35):l,x=l>0&&a===0?"<1":String(a);return r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsx("span",{className:"text-[11px] text-oai-gray-500 dark:text-oai-gray-400 w-12 shrink-0",children:s}),r.jsx("div",{className:"flex-1 bg-oai-gray-100 dark:bg-oai-gray-700/50 rounded-full h-1.5 overflow-hidden",children:r.jsx("div",{className:`${R(a)} rounded-full h-full transition-[width] duration-500 ease-out`,style:{width:`${u}%`,minWidth:l>0?"3px":0}})}),r.jsxs("span",{className:"text-[11px] tabular-nums text-oai-gray-500 dark:text-oai-gray-400 w-[30px] text-right shrink-0",children:[x,"%"]}),i?r.jsx("span",{className:"text-[10px] text-oai-gray-400 dark:text-oai-gray-500 w-6 text-right shrink-0",children:i}):null]})}function d({name:s,icon:e,children:i}){const a=e==="/brand-logos/cursor.svg"||e==="/brand-logos/kiro.svg"||e==="/brand-logos/copilot.svg"||e==="/brand-logos/kimi.svg"?"w-[14px] h-[14px] dark:invert":"w-[14px] h-[14px]";return r.jsxs("div",{className:"flex flex-col gap-1.5",children:[r.jsxs("div",{className:"flex items-center gap-1.5",children:[e?r.jsx("img",{src:e,alt:"",className:a}):null,r.jsx("span",{className:"text-sm font-medium text-oai-black dark:text-oai-white",children:s})]}),i]})}const I=["claude","codex","cursor","gemini","kimi","kiro","copilot","antigravity"],S={claude:{name:"Claude",icon:"/brand-logos/claude-code.svg"},codex:{name:"Codex",icon:"/brand-logos/codex.svg"},cursor:{name:"Cursor",icon:"/brand-logos/cursor.svg"},gemini:{name:"Gemini",icon:"/brand-logos/gemini.svg"},kimi:{name:"Kimi",icon:"/brand-logos/kimi.svg"},kiro:{name:"Kiro",icon:"/brand-logos/kiro.svg"},copilot:{name:"GitHub Copilot",icon:"/brand-logos/copilot.svg"},antigravity:{name:"Antigravity",icon:"/brand-logos/antigravity.svg"}};function c({children:s,tone:e="neutral"}){const i=e==="error"?"text-red-600 dark:text-red-400":"text-oai-gray-500 dark:text-oai-gray-400";return r.jsx("div",{className:`text-[11px] leading-snug ${i}`,children:s})}function A(s,e){const i=S[s];if(!i)return null;if(!e?.configured)return r.jsx(d,{name:i.name,icon:i.icon,children:r.jsx(c,{children:n("limits.status.not_connected")})},s);if(e.error)return r.jsx(d,{name:i.name,icon:i.icon,children:r.jsx(c,{tone:"error",children:n("shared.error.prefix",{error:e.error})})},s);switch(s){case"claude":return r.jsxs(d,{name:i.name,icon:i.icon,children:[e.five_hour?r.jsx(o,{label:"5h",pct:e.five_hour.utilization,reset:t(e.five_hour.resets_at)}):null,e.seven_day?r.jsx(o,{label:"7d",pct:e.seven_day.utilization,reset:t(e.seven_day.resets_at)}):null,e.seven_day_opus?r.jsx(o,{label:"Opus",pct:e.seven_day_opus.utilization,reset:t(e.seven_day_opus.resets_at)}):null,!e.five_hour&&!e.seven_day&&!e.seven_day_opus?r.jsx(c,{children:n("limits.status.no_data")}):null]},"claude");case"codex":return r.jsxs(d,{name:i.name,icon:i.icon,children:[e.primary_window?r.jsx(o,{label:"5h",pct:e.primary_window.used_percent,reset:t(e.primary_window.reset_at)}):null,e.secondary_window?r.jsx(o,{label:"7d",pct:e.secondary_window.used_percent,reset:t(e.secondary_window.reset_at)}):null,!e.primary_window&&!e.secondary_window?r.jsx(c,{children:n("limits.status.no_data")}):null]},"codex");case"cursor":return r.jsxs(d,{name:i.name,icon:i.icon,children:[e.primary_window?r.jsx(o,{label:n("limits.label.cursor_plan"),pct:e.primary_window.used_percent,reset:t(e.primary_window.reset_at)}):null,e.secondary_window?r.jsx(o,{label:n("limits.label.cursor_auto"),pct:e.secondary_window.used_percent,reset:t(e.secondary_window.reset_at)}):null,e.tertiary_window?r.jsx(o,{label:n("limits.label.cursor_api"),pct:e.tertiary_window.used_percent,reset:t(e.tertiary_window.reset_at)}):null,!e.primary_window&&!e.secondary_window&&!e.tertiary_window?r.jsx(c,{children:n("limits.status.no_data")}):null]},"cursor");case"gemini":return r.jsxs(d,{name:i.name,icon:i.icon,children:[e.primary_window?r.jsx(o,{label:"Pro",pct:e.primary_window.used_percent,reset:t(e.primary_window.reset_at)}):null,e.secondary_window?r.jsx(o,{label:"Flash",pct:e.secondary_window.used_percent,reset:t(e.secondary_window.reset_at)}):null,e.tertiary_window?r.jsx(o,{label:"Lite",pct:e.tertiary_window.used_percent,reset:t(e.tertiary_window.reset_at)}):null,!e.primary_window&&!e.secondary_window&&!e.tertiary_window?r.jsx(c,{children:n("limits.status.no_data")}):null]},"gemini");case"kimi":return r.jsxs(d,{name:i.name,icon:i.icon,children:[e.primary_window?r.jsx(o,{label:n("limits.label.kimi_weekly"),pct:e.primary_window.used_percent,reset:t(e.primary_window.reset_at)}):null,e.secondary_window?r.jsx(o,{label:n("limits.label.kimi_5h"),pct:e.secondary_window.used_percent,reset:t(e.secondary_window.reset_at)}):null,e.tertiary_window?r.jsx(o,{label:n("limits.label.kimi_total"),pct:e.tertiary_window.used_percent,reset:t(e.tertiary_window.reset_at)}):null,e.parallel_limit?r.jsx(c,{children:n("limits.label.kimi_parallel",{count:e.parallel_limit})}):null,!e.primary_window&&!e.secondary_window&&!e.tertiary_window?r.jsx(c,{children:n("limits.status.no_data")}):null]},"kimi");case"kiro":return r.jsxs(d,{name:i.name,icon:i.icon,children:[e.primary_window?r.jsx(o,{label:n("limits.label.kiro_month"),pct:e.primary_window.used_percent,reset:t(e.primary_window.reset_at)}):null,e.secondary_window?r.jsx(o,{label:n("limits.label.kiro_bonus"),pct:e.secondary_window.used_percent,reset:t(e.secondary_window.reset_at)}):null,!e.primary_window&&!e.secondary_window?r.jsx(c,{children:n("limits.status.no_data")}):null]},"kiro");case"antigravity":return r.jsxs(d,{name:i.name,icon:i.icon,children:[e.primary_window?r.jsx(o,{label:"Claude",pct:e.primary_window.used_percent,reset:t(e.primary_window.reset_at)}):null,e.secondary_window?r.jsx(o,{label:"G Pro",pct:e.secondary_window.used_percent,reset:t(e.secondary_window.reset_at)}):null,e.tertiary_window?r.jsx(o,{label:"Flash",pct:e.tertiary_window.used_percent,reset:t(e.tertiary_window.reset_at)}):null,!e.primary_window&&!e.secondary_window&&!e.tertiary_window?r.jsx(c,{children:n("limits.status.no_data")}):null]},"antigravity");case"copilot":return r.jsxs(d,{name:i.name,icon:i.icon,children:[e.primary_window?r.jsx(o,{label:n("limits.label.copilot_premium"),pct:e.primary_window.used_percent,reset:t(e.primary_window.reset_at)}):null,e.secondary_window?r.jsx(o,{label:n("limits.label.copilot_chat"),pct:e.secondary_window.used_percent,reset:t(e.secondary_window.reset_at)}):null,!e.primary_window&&!e.secondary_window?r.jsx(c,{children:n("limits.status.no_data")}):null,e.otel_has_files||e.otel_enabled?null:r.jsx(D,{defaultDir:e.otel_default_dir})]},"copilot");default:return null}}function D({defaultDir:s}){const[e,i]=j.useState(!1),a=["export COPILOT_OTEL_ENABLED=true","export COPILOT_OTEL_EXPORTER_TYPE=file",`export COPILOT_OTEL_FILE_EXPORTER_PATH="${s||"$HOME/.copilot/otel"}/copilot-otel-$(date +%Y%m%d).jsonl"`].join(`
2
- `),u=async()=>{try{await navigator.clipboard.writeText(a),i(!0),setTimeout(()=>i(!1),1600)}catch{}};return r.jsxs("div",{className:"mt-1 rounded-md border border-amber-300/60 dark:border-amber-700/40 bg-amber-50/50 dark:bg-amber-900/10 px-2.5 py-2 text-[11px] text-oai-gray-600 dark:text-oai-gray-300",children:[r.jsx("div",{className:"font-medium text-oai-gray-700 dark:text-oai-gray-200",children:n("limits.copilot.otelHint.title")}),r.jsx("div",{className:"mt-0.5 leading-snug",children:n("limits.copilot.otelHint.body")}),r.jsx("pre",{className:"mt-1.5 overflow-x-auto rounded bg-oai-gray-100 dark:bg-oai-gray-900/60 px-2 py-1.5 font-mono text-[10.5px] leading-tight whitespace-pre",children:a}),r.jsx("button",{type:"button",onClick:u,className:"mt-1 inline-flex items-center gap-1 rounded border border-oai-gray-300 dark:border-oai-gray-700 px-1.5 py-0.5 text-[10.5px] text-oai-gray-700 dark:text-oai-gray-200 hover:bg-oai-gray-100 dark:hover:bg-oai-gray-800 transition-colors",children:e?n("limits.copilot.otelHint.copied"):n("limits.copilot.otelHint.copy")})]})}function M({claude:s,codex:e,cursor:i,gemini:l,kimi:a,kiro:u,antigravity:x,copilot:b,order:w,visibility:_}){const f={claude:s,codex:e,cursor:i,gemini:l,kimi:a,kiro:u,antigravity:x,copilot:b},y=(Array.isArray(w)&&w.length>0?w:I).filter(p=>!_||_[p]!==!1).map(p=>A(p,f[p])).filter(Boolean);return r.jsx(E,{delay:.15,children:r.jsx(h,{children:r.jsxs("div",{className:"flex flex-col gap-3",children:[r.jsx("h3",{className:"text-sm font-medium text-oai-gray-500 dark:text-oai-gray-300 uppercase tracking-wide",children:n("limits.panel.title")}),y.length>0?y:r.jsx(c,{children:n("limits.status.all_hidden")})]})})})}function V(){const{data:s,error:e,isLoading:i}=N({initialRefresh:!0}),l=L();return r.jsx("div",{className:"flex flex-col flex-1 text-oai-black dark:text-oai-white font-oai antialiased",children:r.jsx("main",{className:"flex-1 pt-8 sm:pt-10 pb-12 sm:pb-16",children:r.jsxs("div",{className:"mx-auto max-w-6xl px-4 sm:px-6",children:[r.jsxs("div",{className:"flex flex-row items-start justify-between gap-4 mb-8",children:[r.jsxs("div",{className:"min-w-0",children:[r.jsx("h1",{className:"text-3xl sm:text-4xl font-semibold tracking-tight text-oai-black dark:text-white mb-3",children:n("nav.limits")}),r.jsx("p",{className:"text-oai-gray-500 dark:text-oai-gray-400 text-sm sm:text-base",children:n("limits.page.subtitle")})]}),r.jsx(v,{to:"/settings","aria-label":n("limits.page.openSettings"),title:n("limits.page.openSettings"),className:"shrink-0 inline-flex h-9 w-9 items-center justify-center rounded-lg border border-oai-gray-200 dark:border-oai-gray-800 text-oai-gray-600 dark:text-oai-gray-400 hover:bg-oai-gray-100 dark:hover:bg-oai-gray-800 hover:text-oai-black dark:hover:text-white transition-colors no-underline focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-oai-brand-500",children:r.jsx(k,{className:"h-4 w-4","aria-hidden":!0})})]}),i?r.jsx(T,{}):r.jsxs(r.Fragment,{children:[e?r.jsx("p",{className:"mb-4 text-sm text-red-500 dark:text-red-400",children:n("shared.error.prefix",{error:e})}):null,r.jsx(M,{claude:s?.claude,codex:s?.codex,cursor:s?.cursor,gemini:s?.gemini,kimi:s?.kimi,kiro:s?.kiro,antigravity:s?.antigravity,copilot:s?.copilot,order:l.order,visibility:l.visibility})]})]})})})}export{V as LimitsPage};
@@ -1 +0,0 @@
1
- import{ab as Y,am as Z,T as ee,r,B as s,C as e,L as G,a7 as v}from"./main-Ch22JpOj.js";function te(n){const a=new URLSearchParams(n).get("next");return typeof a!="string"||a.length===0||!a.startsWith("/")||a.startsWith("//")?"/dashboard":a}const V={google:"Google",github:"GitHub",microsoft:"Microsoft",discord:"Discord",linkedin:"LinkedIn",facebook:"Facebook",instagram:"Instagram",tiktok:"TikTok",apple:"Apple",x:"X",spotify:"Spotify"};function $(n){const a=String(n||"").trim();return V[a]?V[a]:a.replace(/-/g," ")}function ie(){const n=Y(),[a,C]=Z(),{enabled:o,loading:g,signedIn:f,refreshUser:A,signInWithPassword:E,signUp:M,signInWithOAuth:I,getPublicAuthConfig:F}=ee(),m=r.useMemo(()=>te(a.toString()),[a]),[l,j]=r.useState("signin"),[x,H]=r.useState(""),[h,Q]=r.useState(""),[N,X]=r.useState(""),[k,p]=r.useState(!1),[O,c]=r.useState(null),[B,b]=r.useState(null),[S,T]=r.useState(!0),[_,U]=r.useState([]),[P,R]=r.useState([]),[W,z]=r.useState(8);r.useEffect(()=>{const t=a.get("insforge_status"),i=a.get("insforge_type"),u=a.get("insforge_error");t==="success"&&i==="verify_email"?b(s("login.verify_email_success")):t==="error"&&i==="verify_email"&&u&&b(s("shared.error.prefix",{error:u}))},[a]),r.useEffect(()=>{if(!o){T(!1);return}let t=!0;return(async()=>{const{data:i,error:u}=await F();t&&(u||!i?(U(["google","github"]),R([])):(U(Array.isArray(i.oAuthProviders)?i.oAuthProviders:[]),R(Array.isArray(i.customOAuthProviders)?i.customOAuthProviders:[]),typeof i.passwordMinLength=="number"&&i.passwordMinLength>0&&z(i.passwordMinLength)),T(!1))})(),()=>{t=!1}},[o,F]);const d=r.useMemo(()=>a.get("native")==="1",[a]),y=r.useMemo(()=>a.get("provider")||null,[a]);r.useEffect(()=>{if(!(!o||g)&&f){if(d){window.location.href="/auth/native-callback";return}n(m,{replace:!0})}},[o,g,f,n,m,d]),r.useEffect(()=>{o&&A()},[o,A]);const q=r.useMemo(()=>typeof window>"u"||d?"":`${window.location.origin}/`,[d]),D=r.useMemo(()=>typeof window>"u"?"":`${window.location.origin}/`,[]),J=r.useCallback(async t=>{t.preventDefault(),c(null),p(!0);try{if(l==="signup"){const{data:u,error:L}=await M({email:x.trim(),password:h,name:N.trim()||void 0,redirectTo:D});if(L){c(L.message||String(L));return}if(u?.requireEmailVerification){b(s("login.verify_email_pending")),j("signin");return}n(m,{replace:!0});return}const{error:i}=await E({email:x.trim(),password:h});if(i){c(i.message||String(i));return}n(m,{replace:!0})}finally{p(!1)}},[l,x,h,N,M,E,n,m,D]),w=r.useCallback(async t=>{c(null),p(!0);try{const{error:i}=await I(t,q);i&&c(i.message||String(i))}finally{p(!1)}},[I,q]);r.useEffect(()=>{if(d&&typeof window<"u")try{window.sessionStorage.setItem("tokentracker_native_login","1")}catch{}},[d]),r.useEffect(()=>{if(!o||g||f||S||!d||!y)return;[..._,...P].includes(y)&&w(y)},[o,g,f,S,d,y,_,P,w]);const K=r.useCallback(()=>{C(t=>{const i=new URLSearchParams(t);return i.delete("insforge_status"),i.delete("insforge_type"),i.delete("insforge_error"),i},{replace:!0}),b(null)},[C]);return o?e.jsxs("div",{className:"min-h-screen bg-oai-gray-950 text-oai-white font-oai antialiased dark flex flex-col",children:[e.jsx("header",{className:"border-b border-oai-gray-900 px-4 sm:px-6 h-16 flex items-center justify-between",children:e.jsx(G,{to:"/",className:"text-sm font-medium text-oai-gray-400 hover:text-white no-underline focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-oai-brand-500 rounded",children:s("login.back_home")})}),e.jsx("main",{className:"flex-1 flex items-center justify-center px-4 py-12",children:e.jsxs("div",{className:"w-full max-w-md space-y-8",children:[e.jsxs("div",{className:"text-center",children:[e.jsx("h1",{className:"text-2xl font-semibold text-white tracking-tight",children:s("login.title")}),e.jsx("p",{className:"mt-2 text-sm text-oai-gray-500",children:s("login.subtitle")})]}),B?e.jsxs("div",{className:"rounded-lg border border-oai-gray-800 bg-oai-gray-900/50 px-4 py-3 text-sm text-oai-gray-300 flex justify-between gap-3 items-start",role:"status",children:[e.jsx("span",{children:B}),e.jsx("button",{type:"button",onClick:K,className:"shrink-0 text-oai-gray-500 hover:text-white text-xs",children:s("login.dismiss")})]}):null,O?e.jsx("p",{className:"text-sm text-red-400",role:"alert",children:s("shared.error.prefix",{error:O})}):null,e.jsx("div",{className:"space-y-3",children:S?e.jsx("div",{className:"h-11 rounded-lg bg-oai-gray-900 animate-pulse","aria-hidden":!0}):e.jsxs(e.Fragment,{children:[_.map(t=>e.jsx("button",{type:"button",disabled:k,onClick:()=>w(t),className:v("w-full h-11 rounded-lg border border-oai-gray-700 bg-oai-gray-900 text-sm font-medium text-white","hover:bg-oai-gray-800 transition-colors disabled:opacity-50"),children:s("login.oauth.continue",{provider:$(t)})},t)),P.map(t=>e.jsx("button",{type:"button",disabled:k,onClick:()=>w(t),className:v("w-full h-11 rounded-lg border border-oai-gray-700 bg-oai-gray-900 text-sm font-medium text-white","hover:bg-oai-gray-800 transition-colors disabled:opacity-50"),children:s("login.oauth.continue",{provider:$(t)})},t))]})}),e.jsxs("div",{className:"relative",children:[e.jsx("div",{className:"absolute inset-0 flex items-center","aria-hidden":!0,children:e.jsx("span",{className:"w-full border-t border-oai-gray-800"})}),e.jsx("div",{className:"relative flex justify-center text-xs uppercase tracking-wider",children:e.jsx("span",{className:"bg-oai-gray-950 px-3 text-oai-gray-600",children:s("login.divider")})})]}),e.jsxs("div",{className:"flex rounded-lg border border-oai-gray-800 p-0.5 bg-oai-gray-900/50",children:[e.jsx("button",{type:"button",className:v("flex-1 py-2 text-sm font-medium rounded-md transition-colors",l==="signin"?"bg-oai-gray-800 text-white":"text-oai-gray-500 hover:text-oai-gray-300"),onClick:()=>{j("signin"),c(null)},children:s("login.tab.sign_in")}),e.jsx("button",{type:"button",className:v("flex-1 py-2 text-sm font-medium rounded-md transition-colors",l==="signup"?"bg-oai-gray-800 text-white":"text-oai-gray-500 hover:text-oai-gray-300"),onClick:()=>{j("signup"),c(null)},children:s("login.tab.sign_up")})]}),e.jsxs("form",{onSubmit:J,className:"space-y-4",children:[l==="signup"?e.jsxs("div",{children:[e.jsx("label",{htmlFor:"login-name",className:"block text-xs font-medium text-oai-gray-500 mb-1",children:s("login.field.name")}),e.jsx("input",{id:"login-name",type:"text",autoComplete:"name",value:N,onChange:t=>X(t.target.value),className:"w-full h-11 rounded-lg border border-oai-gray-800 bg-oai-gray-900 px-3 text-sm text-white placeholder-oai-gray-600 focus:outline-none focus:ring-2 focus:ring-oai-brand-500",placeholder:s("login.field.name_placeholder")})]}):null,e.jsxs("div",{children:[e.jsx("label",{htmlFor:"login-email",className:"block text-xs font-medium text-oai-gray-500 mb-1",children:s("login.field.email")}),e.jsx("input",{id:"login-email",type:"email",autoComplete:"email",required:!0,value:x,onChange:t=>H(t.target.value),className:"w-full h-11 rounded-lg border border-oai-gray-800 bg-oai-gray-900 px-3 text-sm text-white placeholder-oai-gray-600 focus:outline-none focus:ring-2 focus:ring-oai-brand-500"})]}),e.jsxs("div",{children:[e.jsx("label",{htmlFor:"login-password",className:"block text-xs font-medium text-oai-gray-500 mb-1",children:s("login.field.password")}),e.jsx("input",{id:"login-password",type:"password",autoComplete:l==="signup"?"new-password":"current-password",required:!0,minLength:l==="signup"?W:void 0,value:h,onChange:t=>Q(t.target.value),className:"w-full h-11 rounded-lg border border-oai-gray-800 bg-oai-gray-900 px-3 text-sm text-white placeholder-oai-gray-600 focus:outline-none focus:ring-2 focus:ring-oai-brand-500"}),l==="signup"?e.jsx("p",{className:"mt-1 text-xs text-oai-gray-600",children:s("login.password_hint",{min:String(W)})}):null]}),e.jsx("button",{type:"submit",disabled:k||g,className:"w-full h-11 rounded-lg bg-white text-oai-gray-950 text-sm font-semibold hover:bg-oai-gray-100 transition-colors disabled:opacity-50",children:l==="signup"?s("login.submit.sign_up"):s("login.submit.sign_in")})]})]})})]}):e.jsxs("div",{className:"min-h-screen bg-oai-gray-950 text-oai-white font-oai antialiased dark flex flex-col",children:[e.jsx("header",{className:"border-b border-oai-gray-900 px-4 sm:px-6 py-4",children:e.jsx(G,{to:"/",className:"text-sm font-medium text-oai-gray-400 hover:text-white no-underline",children:s("login.back_home")})}),e.jsx("main",{className:"flex-1 flex items-center justify-center px-4",children:e.jsx("p",{className:"text-oai-gray-400 text-center max-w-md",children:s("login.cloud_only")})})]})}export{ie as LoginPage};