tokentracker-cli 0.15.1 → 0.15.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.zh-CN.md +6 -4
- package/dashboard/dist/assets/Card-CTRPazyG.js +1 -0
- package/dashboard/dist/assets/DashboardPage-BJVPrOly.js +1 -0
- package/dashboard/dist/assets/FadeIn-NAG8xImb.js +1 -0
- package/dashboard/dist/assets/HeaderGithubStar-CwnC8N_4.js +1 -0
- package/dashboard/dist/assets/IpCheckPage-Bqz8OFmD.js +1 -0
- package/dashboard/dist/assets/LandingPage-Dz7yTDPI.js +4356 -0
- package/dashboard/dist/assets/LeaderboardPage-DX_tP5qi.js +5 -0
- package/dashboard/dist/assets/LeaderboardProfilePage-BI4R73XX.js +1 -0
- package/dashboard/dist/assets/LimitsPage-D15dhSFp.js +2 -0
- package/dashboard/dist/assets/LoginPage-CSWfDVcM.js +1 -0
- package/dashboard/dist/assets/NativeAuthCallbackPage-D6Stzae_.js +1 -0
- package/dashboard/dist/assets/PopoverPopup-DgTXWAeN.js +12 -0
- package/dashboard/dist/assets/ProviderIcon-CEhS41Kz.js +1 -0
- package/dashboard/dist/assets/SettingsPage-CaPVlEzU.js +1 -0
- package/dashboard/dist/assets/SkillsPage-CGH_F5Y0.js +1 -0
- package/dashboard/dist/assets/WidgetsPage-Cjad4Q71.js +1 -0
- package/dashboard/dist/assets/chevron-down-DGOV7_Uw.js +1 -0
- package/dashboard/dist/assets/download-DCjD_Xm9.js +1 -0
- package/dashboard/dist/assets/leaderboard-columns-BK2-Jp3k.js +1 -0
- package/dashboard/dist/assets/{main-B-qohcBn.css → main-Bnr_KT_S.css} +1 -1
- package/dashboard/dist/assets/main-DTrs3jUq.js +612 -0
- package/dashboard/dist/assets/use-limits-display-prefs-rF66WvRU.js +1 -0
- package/dashboard/dist/assets/use-native-settings-DK8RelvO.js +1 -0
- package/dashboard/dist/assets/use-reduced-motion-BsYZLRkk.js +1 -0
- package/dashboard/dist/assets/use-usage-limits-jLzoEy77.js +1 -0
- package/dashboard/dist/index.html +2 -2
- package/dashboard/dist/share.html +2 -2
- package/package.json +1 -1
- package/src/lib/local-api.js +5 -1
- package/src/lib/pricing/seed-snapshot.json +1 -1
- package/dashboard/dist/assets/main-DAAixEqh.js +0 -4982
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{c as ot,r as a,D as r,a7 as on,H as Ue,a5 as Je,aw as Ln,B as T,av as Vn,R as Dn}from"./main-DTrs3jUq.js";import{C as _n}from"./Card-CTRPazyG.js";import{A as Dt,s as Se,n as at,o as Fe,p as $e,q as $t,r as an,t as _e,v as Un,w as Hn,x as Q,y as Fn,z as xe,B as $n,C as Bt,E as Bn,F as tt,c as Me,G as Nt,H as zt,I as zn,J as ln,K as Wn,M as Kn,N as Ke,O as Tt,Q as it,R as Pe,S as Et,T as cn,U as qn,V as se,W as un,X as Yn,Y as Pt,Z as $,_ as _t,$ as Gn,a0 as Xn,a1 as Jn,a2 as Qn,a3 as dn,a4 as fn,a5 as Zn,a6 as er,a7 as Ut,a8 as tr,a9 as nr,a as gn,b as He,aa as rr,ab as At,ac as sr,ad as or,ae as ar,af as ir,ag as lr,ah as cr,ai as ur,aj as dr,ak as mn,al as fr,am as gr,an as Wt,ao as mr,ap as hr,aq as pr,ar as hn,as as xr,at as yr,au as Ct,u as br,D as wr,e as kr,f as vr,g as Rr,h as Sr,i as Nr,L as Be,P as Cr,j as jr,k as Mr,l as Ir,m as Tr}from"./PopoverPopup-DgTXWAeN.js";import{P as yt}from"./ProviderIcon-CEhS41Kz.js";import{C as pn}from"./chevron-down-DGOV7_Uw.js";import{D as Er}from"./download-DCjD_Xm9.js";const Pr=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],nt=ot("check",Pr);const Ar=[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"M10 14 21 3",key:"gplh6r"}],["path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6",key:"a6xqqp"}]],Or=ot("external-link",Ar);const Lr=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]],xn=ot("plus",Lr);const Vr=[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]],Kt=ot("search",Vr);const Dr=[["path",{d:"M10 11v6",key:"nco0om"}],["path",{d:"M14 11v6",key:"outv1u"}],["path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6",key:"miytrc"}],["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2",key:"e791ji"}]],yn=ot("trash-2",Dr);function _r(e){const t=a.useRef(!0);t.current&&(t.current=!1,e())}function qt({controlled:e,default:t,name:n,state:o="value"}){const{current:d}=a.useRef(e!==void 0),[s,l]=a.useState(t),c=d?e:s,x=a.useCallback(p=>{d||l(p)},[]);return[c,x]}function gt(e,t,n){return Math.floor(e/t)!==n}function rt(e,t){return t<0||t>=e.current.length}function jt(e,t){return we(e,{disabledIndices:t})}function Yt(e,t){return we(e,{decrement:!0,startingIndex:e.current.length,disabledIndices:t})}function we(e,{startingIndex:t=-1,decrement:n=!1,disabledIndices:o,amount:d=1}={}){let s=t;do s+=n?-d:d;while(s>=0&&s<=e.current.length-1&&st(e,s,o));return s}function Ur(e,{event:t,orientation:n,loopFocus:o,rtl:d,cols:s,disabledIndices:l,minIndex:c,maxIndex:x,prevIndex:p,stopEvent:f=!1}){let g=p;const y=[],I={};let b=!1;{let u=null,C=-1;e.current.forEach((h,k)=>{if(h==null)return;const P=h.closest('[role="row"]');P&&(b=!0),(P!==u||C===-1)&&(u=P,C+=1,y[C]=[]),y[C].push(k),I[k]=C})}const v=b&&y.length>0&&y.some(u=>u.length!==s);function E(u){if(!v||p===-1)return;const C=I[p];if(C==null)return;const h=y[C].indexOf(p);let k=u==="up"?C-1:C+1;o&&(k<0?k=y.length-1:k>=y.length&&(k=0));const P=new Set;for(;k>=0&&k<y.length&&!P.has(k);){P.add(k);const H=y[k];if(H.length===0){k=u==="up"?k-1:k+1;continue}const Z=Math.min(h,H.length-1);for(let D=Z;D>=0;D-=1){const oe=H[D];if(!st(e,oe,l))return oe}k=u==="up"?k-1:k+1,o&&(k<0?k=y.length-1:k>=y.length&&(k=0))}}if(t.key===Dt){const u=E("up");if(u!==void 0)f&&Se(t),g=u;else{if(f&&Se(t),p===-1)g=x;else if(g=we(e,{startingIndex:g,amount:s,decrement:!0,disabledIndices:l}),o&&(p-s<c||g<0)){const C=p%s,h=x%s,k=x-(h-C);h===C?g=x:g=h>C?k:k-s}rt(e,g)&&(g=p)}}if(t.key===at){const u=E("down");u!==void 0?(f&&Se(t),g=u):(f&&Se(t),p===-1?g=c:(g=we(e,{startingIndex:p,amount:s,disabledIndices:l}),o&&p+s>x&&(g=we(e,{startingIndex:p%s-s,amount:s,disabledIndices:l}))),rt(e,g)&&(g=p))}if(n==="both"){const u=$t(p/s);t.key===(d?Fe:$e)&&(f&&Se(t),p%s!==s-1?(g=we(e,{startingIndex:p,disabledIndices:l}),o&>(g,s,u)&&(g=we(e,{startingIndex:p-p%s-1,disabledIndices:l}))):o&&(g=we(e,{startingIndex:p-p%s-1,disabledIndices:l})),gt(g,s,u)&&(g=p)),t.key===(d?$e:Fe)&&(f&&Se(t),p%s!==0?(g=we(e,{startingIndex:p,decrement:!0,disabledIndices:l}),o&>(g,s,u)&&(g=we(e,{startingIndex:p+(s-p%s),decrement:!0,disabledIndices:l}))):o&&(g=we(e,{startingIndex:p+(s-p%s),decrement:!0,disabledIndices:l})),gt(g,s,u)&&(g=p));const C=$t(x/s)===u;rt(e,g)&&(o&&C?g=t.key===(d?$e:Fe)?x:we(e,{startingIndex:p-p%s-1,disabledIndices:l}):g=p)}return g}function Hr(e,t,n){const o=[];let d=0;return e.forEach(({width:s,height:l},c)=>{let x=!1;for(n&&(d=0);!x;){const p=[];for(let f=0;f<s;f+=1)for(let g=0;g<l;g+=1)p.push(d+f+g*t);d%t+s<=t&&p.every(f=>o[f]==null)?(p.forEach(f=>{o[f]=c}),x=!0):d+=1}}),[...o]}function Fr(e,t,n,o,d){if(e===-1)return-1;const s=n.indexOf(e),l=t[e];switch(d){case"tl":return s;case"tr":return l?s+l.width-1:s;case"bl":return l?s+(l.height-1)*o:s;case"br":return n.lastIndexOf(e);default:return-1}}function $r(e,t){return t.flatMap((n,o)=>e.includes(n)?[o]:[])}function st(e,t,n){if(typeof n=="function")return n(t);if(n)return n.includes(t);const o=e.current[t];return o?o.hasAttribute("disabled")||o.getAttribute("aria-disabled")==="true":!1}const Br="Escape";function wt(e,t,n){switch(e){case"vertical":return t;case"horizontal":return n;default:return t||n}}function mt(e,t){return wt(t,e===Dt||e===at,e===Fe||e===$e)}function Mt(e,t,n){return wt(t,e===at,n?e===Fe:e===$e)||e==="Enter"||e===" "||e===""}function zr(e,t,n){return wt(t,n?e===Fe:e===$e,e===at)}function Wr(e,t,n,o){const d=n?e===$e:e===Fe,s=e===Dt;return t==="both"||t==="horizontal"&&o&&o>1?e===Br:wt(t,d,s)}function Kr(e,t){const n="rootStore"in e?e.rootStore:e,o=n.useState("open"),d=n.useState("floatingElement"),s=n.useState("domReferenceElement"),l=n.context.dataRef,{listRef:c,activeIndex:x,onNavigate:p=()=>{},enabled:f=!0,selectedIndex:g=null,allowEscape:y=!1,loopFocus:I=!1,nested:b=!1,rtl:v=!1,virtual:E=!1,focusItemOnOpen:u="auto",focusItemOnHover:C=!0,openOnArrowKeyDown:h=!0,disabledIndices:k=void 0,orientation:P="vertical",parentOrientation:H,cols:Z=1,scrollItemIntoView:D=!0,itemSizes:oe,dense:ge=!1,id:F,resetOnPointerLeave:Y=!0,externalTree:q}=t,J=an(d),re=_e(J),K=Un(),ee=Hn(q);Q(()=>{l.current.orientation=P},[l,P]);const S=Fn(s),B=a.useRef(u),R=a.useRef(g??-1),M=a.useRef(null),le=a.useRef(!0),O=xe(m=>{p(R.current===-1?null:R.current,m)}),he=a.useRef(O),ae=a.useRef(!!d),A=a.useRef(o),z=a.useRef(!1),ue=a.useRef(!1),ke=_e(k),L=_e(o),ce=_e(D),te=_e(g),pe=_e(Y),ye=xe(()=>{function m(ie){E?ee?.events.emit("virtualfocus",ie):$n(ie,{sync:z.current,preventScroll:!0})}const V=c.current[R.current],N=ue.current;V&&m(V),(z.current?ie=>ie():requestAnimationFrame)(()=>{const ie=c.current[R.current]||V;if(!ie)return;V||m(ie);const de=ce.current;de&&X&&(N||!le.current)&&ie.scrollIntoView?.(typeof de=="boolean"?{block:"nearest",inline:"nearest"}:de)})});Q(()=>{f&&(o&&d?(R.current=g??-1,B.current&&g!=null&&(ue.current=!0,O())):ae.current&&(R.current=-1,he.current()))},[f,o,d,g,O]),Q(()=>{if(f){if(!o){z.current=!1;return}if(d)if(x==null){if(z.current=!1,te.current!=null)return;if(ae.current&&(R.current=-1,ye()),(!A.current||!ae.current)&&B.current&&(M.current!=null||B.current===!0&&M.current==null)){let m=0;const V=()=>{c.current[0]==null?(m<2&&(m?requestAnimationFrame:queueMicrotask)(V),m+=1):(R.current=M.current==null||Mt(M.current,P,v)||b?jt(c):Yt(c),M.current=null,O())};V()}}else rt(c,x)||(R.current=x,ye(),ue.current=!1)}},[f,o,d,x,te,b,c,P,v,O,ye,ke]),Q(()=>{if(!f||d||!ee||E||!ae.current)return;const m=ee.nodesRef.current,V=m.find(ie=>ie.id===K)?.context?.elements.floating,N=Bt(Bn(d)),ne=m.some(ie=>ie.context&&tt(ie.context.elements.floating,N));V&&!ne&&le.current&&V.focus({preventScroll:!0})},[f,d,ee,K,E]),Q(()=>{he.current=O,A.current=o,ae.current=!!d}),Q(()=>{o||(M.current=null,B.current=u)},[o,u]);const me=x!=null,X=a.useMemo(()=>{function m(N){if(!L.current)return;const ne=c.current.indexOf(N.currentTarget);ne!==-1&&R.current!==ne&&(R.current=ne,O(N))}return{onFocus(N){z.current=!0,m(N)},onClick:({currentTarget:N})=>N.focus({preventScroll:!0}),onMouseMove(N){z.current=!0,ue.current=!1,C&&m(N)},onPointerLeave(N){if(!L.current||!le.current||N.pointerType==="touch")return;z.current=!0;const ne=N.relatedTarget;!C||c.current.includes(ne)||pe.current&&(R.current=-1,O(N),E||re.current?.focus({preventScroll:!0}))}}},[L,re,C,c,O,pe,E]),i=a.useCallback(()=>H??ee?.nodesRef.current.find(m=>m.id===K)?.context?.dataRef?.current.orientation,[K,ee,H]),w=xe(m=>{if(le.current=!1,z.current=!0,m.which===229||!L.current&&m.currentTarget===re.current)return;if(b&&Wr(m.key,P,v,Z)){mt(m.key,i())||Se(m),n.setOpen(!1,Me(Nt,m.nativeEvent)),zt(s)&&(E?ee?.events.emit("virtualfocus",s):s.focus());return}const V=R.current,N=jt(c,k),ne=Yt(c,k);if(S||(m.key==="Home"&&(Se(m),R.current=N,O(m)),m.key==="End"&&(Se(m),R.current=ne,O(m))),Z>1){const ie=oe||Array.from({length:c.current.length},()=>({width:1,height:1})),de=Hr(ie,Z,ge),be=de.findIndex(Ne=>Ne!=null&&!st(c,Ne,k)),Re=de.reduce((Ne,Ie,De)=>Ie!=null&&!st(c,Ie,k)?De:Ne,-1),Ve=de[Ur({current:de.map(Ne=>Ne!=null?c.current[Ne]:null)},{event:m,orientation:P,loopFocus:I,rtl:v,cols:Z,disabledIndices:$r([...(typeof k!="function"?k:null)||c.current.map((Ne,Ie)=>st(c,Ie,k)?Ie:void 0),void 0],de),minIndex:be,maxIndex:Re,prevIndex:Fr(R.current>ne?N:R.current,ie,de,Z,m.key===at?"bl":m.key===(v?Fe:$e)?"tr":"tl"),stopEvent:!0})];if(Ve!=null&&(R.current=Ve,O(m)),P==="both")return}if(mt(m.key,P)){if(Se(m),o&&!E&&Bt(m.currentTarget.ownerDocument)===m.currentTarget){R.current=Mt(m.key,P,v)?N:ne,O(m);return}Mt(m.key,P,v)?I?V>=ne?y&&V!==c.current.length?R.current=-1:(z.current=!1,R.current=N):R.current=we(c,{startingIndex:V,disabledIndices:k}):R.current=Math.min(ne,we(c,{startingIndex:V,disabledIndices:k})):I?V<=N?y&&V!==-1?R.current=c.current.length:(z.current=!1,R.current=ne):R.current=we(c,{startingIndex:V,decrement:!0,disabledIndices:k}):R.current=Math.max(N,we(c,{startingIndex:V,decrement:!0,disabledIndices:k})),rt(c,R.current)&&(R.current=-1),O(m)}}),j=a.useMemo(()=>E&&o&&me&&{"aria-activedescendant":`${F}-${x}`},[E,o,me,F,x]),_=a.useMemo(()=>({"aria-orientation":P==="both"?void 0:P,...S?{}:j,onKeyDown(m){if(m.key==="Tab"&&m.shiftKey&&o&&!E){const V=zn(m.nativeEvent);if(V&&!tt(re.current,V))return;Se(m),n.setOpen(!1,Me(ln,m.nativeEvent)),zt(s)&&s.focus();return}w(m)},onPointerMove(){le.current=!0}}),[j,w,re,P,S,n,o,E,s]),G=a.useMemo(()=>{function m(N){u==="auto"&&Wn(N.nativeEvent)&&(B.current=!E)}function V(N){B.current=u,u==="auto"&&Kn(N.nativeEvent)&&(B.current=!0)}return{onKeyDown(N){const ne=n.select("open");le.current=!1;const ie=N.key.startsWith("Arrow"),de=zr(N.key,i(),v),be=mt(N.key,P),Re=(b?de:be)||N.key==="Enter"||N.key.trim()==="";if(E&&ne)return w(N);if(!(!ne&&!h&&ie)){if(Re){const Ve=mt(N.key,i());M.current=b&&Ve?null:N.key}if(b){de&&(Se(N),ne?(R.current=jt(c,ke.current),O(N)):n.setOpen(!0,Me(Nt,N.nativeEvent,N.currentTarget)));return}be&&(te.current!=null&&(R.current=te.current),Se(N),!ne&&h?n.setOpen(!0,Me(Nt,N.nativeEvent,N.currentTarget)):w(N),ne&&O(N))}},onFocus(N){n.select("open")&&!E&&(R.current=-1,O(N))},onPointerDown:V,onPointerEnter:V,onMouseDown:m,onClick:m}},[w,ke,u,c,b,O,n,h,P,i,v,te,E]),ve=a.useMemo(()=>({...j,...G}),[j,G]);return a.useMemo(()=>f?{reference:ve,floating:_,item:X,trigger:G}:{},[f,ve,_,G,X])}function qr(e,t){const n="rootStore"in e?e.rootStore:e,o=n.useState("open"),d=n.context.dataRef,{listRef:s,activeIndex:l,onMatch:c,onTypingChange:x,enabled:p=!0,findMatch:f=null,resetMs:g=750,ignoreKeys:y=Tt,selectedIndex:I=null}=t,b=Ke(),v=a.useRef(""),E=a.useRef(I??l??-1),u=a.useRef(null);Q(()=>{o&&(b.clear(),u.current=null,v.current="")},[o,b]),Q(()=>{o&&v.current===""&&(E.current=I??l??-1)},[o,I,l]);const C=xe(H=>{H?d.current.typing||(d.current.typing=H,x?.(H)):d.current.typing&&(d.current.typing=H,x?.(H))}),h=xe(H=>{function Z(Y,q,J){const re=f?f(q,J):q.find(K=>K?.toLocaleLowerCase().indexOf(J.toLocaleLowerCase())===0);return re?Y.indexOf(re):-1}const D=s.current;if(v.current.length>0&&v.current[0]!==" "&&(Z(D,D,v.current)===-1?C(!1):H.key===" "&&Se(H)),D==null||y.includes(H.key)||H.key.length!==1||H.ctrlKey||H.metaKey||H.altKey)return;o&&H.key!==" "&&(Se(H),C(!0)),D.every(Y=>Y?Y[0]?.toLocaleLowerCase()!==Y[1]?.toLocaleLowerCase():!0)&&v.current===H.key&&(v.current="",E.current=u.current),v.current+=H.key,b.start(g,()=>{v.current="",E.current=u.current,C(!1)});const ge=E.current,F=Z(D,[...D.slice((ge||0)+1),...D.slice(0,(ge||0)+1)],v.current);F!==-1?(c?.(F),u.current=F):H.key!==" "&&(v.current="",C(!1))}),k=a.useMemo(()=>({onKeyDown:h}),[h]),P=a.useMemo(()=>({onKeyDown:h,onKeyUp(H){H.key===" "&&C(!1)}}),[h,C]);return a.useMemo(()=>p?{reference:k,floating:P}:{},[p,k,P])}const bn=a.createContext(null),wn=a.createContext(null);function ze(){const e=a.useContext(bn);if(e===null)throw new Error(it(60));return e}function kn(){const e=a.useContext(wn);if(e===null)throw new Error(it(61));return e}let Gt=(function(e){return e.disabled="data-disabled",e.valid="data-valid",e.invalid="data-invalid",e.touched="data-touched",e.dirty="data-dirty",e.filled="data-filled",e.focused="data-focused",e})({});const Yr={badInput:!1,customError:!1,patternMismatch:!1,rangeOverflow:!1,rangeUnderflow:!1,stepMismatch:!1,tooLong:!1,tooShort:!1,typeMismatch:!1,valid:null,valueMissing:!1},Gr={valid(e){return e===null?null:e?{[Gt.valid]:""}:{[Gt.invalid]:""}}},Xr=a.createContext({invalid:void 0,name:void 0,validityData:{state:Yr,errors:[],error:"",value:"",initialValue:null},setValidityData:Pe,disabled:void 0,touched:!1,setTouched:Pe,dirty:!1,setDirty:Pe,filled:!1,setFilled:Pe,focused:!1,setFocused:Pe,validate:()=>null,validationMode:"onSubmit",validationDebounceTime:0,shouldValidateOnChange:()=>!1,state:{disabled:!1,valid:null,touched:!1,dirty:!1,filled:!1,focused:!1},markedDirtyRef:{current:!1},validation:{getValidationProps:(e=Et)=>e,getInputValidationProps:(e=Et)=>e,inputRef:{current:null},commit:async()=>{}}});function Ht(e=!0){const t=a.useContext(Xr);if(t.setValidityData===Pe&&!e)throw new Error(it(28));return t}const Jr=a.createContext({controlId:void 0,setControlId:Pe,labelId:void 0,setLabelId:Pe,messageIds:[],setMessageIds:Pe,getDescriptionProps:e=>e});function vn(){return a.useContext(Jr)}function Rn(e={}){const{id:t,implicit:n=!1,controlRef:o}=e,{controlId:d,setControlId:s}=vn(),l=cn(t);return Q(()=>{if(!(!n&&!t||s===Pe)){if(n){const c=o?.current;qn(c)&&c.closest("label")!=null?s(t??null):s(d??l)}else t&&s(t);return()=>{t&&s(void 0)}}},[t,o,d,s,n,l]),d??l}const Qr=(e,t)=>Object.is(e,t);function Qe(e,t,n){return e==null||t==null?Object.is(e,t):n(e,t)}function It(e,t,n){return!e||e.length===0?!1:e.some(o=>o===void 0?!1:Qe(o,t,n))}function Ot(e,t,n){return!e||e.length===0?-1:e.findIndex(o=>o===void 0?!1:Qe(o,t,n))}function Zr(e,t,n){return e.filter(o=>!Qe(o,t,n))}function Lt(e){if(e==null)return"";if(typeof e=="string")return e;try{return JSON.stringify(e)}catch{return String(e)}}function Sn(e){return e!=null&&e.length>0&&typeof e[0]=="object"&&e[0]!=null&&"items"in e[0]}function es(e){if(!Array.isArray(e))return e!=null&&!("null"in e);if(Sn(e)){for(const t of e)for(const n of t.items)if(n&&n.value==null&&n.label!=null)return!0;return!1}for(const t of e)if(t&&t.value==null&&t.label!=null)return!0;return!1}function ts(e,t){if(t&&e!=null)return t(e)??"";if(e&&typeof e=="object"){if("label"in e&&e.label!=null)return String(e.label);if("value"in e)return String(e.value)}return Lt(e)}function Xe(e,t){return t&&e!=null?t(e)??"":e&&typeof e=="object"&&"value"in e&&"label"in e?Lt(e.value):Lt(e)}function Nn(e,t,n){function o(){return ts(e,n)}if(n&&e!=null)return n(e);if(e&&typeof e=="object"&&"label"in e&&e.label!=null)return e.label;if(t&&!Array.isArray(t))return t[e]??o();if(Array.isArray(t)){const d=Sn(t)?t.flatMap(s=>s.items):t;if(e==null||typeof e!="object"){const s=d.find(l=>l.value===e);return s&&s.label!=null?s.label:o()}if("value"in e){const s=d.find(l=>l&&l.value===e.value);if(s&&s.label!=null)return s.label}}return o()}function ns(e,t,n){return e.reduce((o,d,s)=>(s>0&&o.push(", "),o.push(r.jsx(a.Fragment,{children:Nn(d,t,n)},s)),o),[])}const U={id:se(e=>e.id),modal:se(e=>e.modal),multiple:se(e=>e.multiple),items:se(e=>e.items),itemToStringLabel:se(e=>e.itemToStringLabel),itemToStringValue:se(e=>e.itemToStringValue),isItemEqualToValue:se(e=>e.isItemEqualToValue),value:se(e=>e.value),hasSelectedValue:se(e=>{const{value:t,multiple:n,itemToStringValue:o}=e;return t==null?!1:n&&Array.isArray(t)?t.length>0:Xe(t,o)!==""}),hasNullItemLabel:se((e,t)=>t?es(e.items):!1),open:se(e=>e.open),mounted:se(e=>e.mounted),forceMount:se(e=>e.forceMount),transitionStatus:se(e=>e.transitionStatus),openMethod:se(e=>e.openMethod),activeIndex:se(e=>e.activeIndex),selectedIndex:se(e=>e.selectedIndex),isActive:se((e,t)=>e.activeIndex===t),isSelected:se((e,t,n)=>{const o=e.isItemEqualToValue,d=e.value;return e.multiple?Array.isArray(d)&&d.some(s=>Qe(s,n,o)):e.selectedIndex===t&&e.selectedIndex!==null?!0:Qe(d,n,o)}),isSelectedByFocus:se((e,t)=>e.selectedIndex===t),popupProps:se(e=>e.popupProps),triggerProps:se(e=>e.triggerProps),triggerElement:se(e=>e.triggerElement),positionerElement:se(e=>e.positionerElement),listElement:se(e=>e.listElement),scrollUpArrowVisible:se(e=>e.scrollUpArrowVisible),scrollDownArrowVisible:se(e=>e.scrollDownArrowVisible),hasScrollArrows:se(e=>e.hasScrollArrows)},rs=a.createContext({formRef:{current:{fields:new Map}},errors:{},clearErrors:Pe,validationMode:"onSubmit",submitAttemptedRef:{current:!1}});function Cn(){return a.useContext(rs)}function ss(e,t){return{...e,state:{...e.state,valid:!t&&e.state.valid}}}function os(e){const{enabled:t=!0,value:n,id:o,name:d,controlRef:s,commit:l}=e,{formRef:c}=Cn(),{invalid:x,markedDirtyRef:p,validityData:f,setValidityData:g}=Ht(),y=xe(e.getValue);Q(()=>{if(!t)return;let I=n;I===void 0&&(I=y()),f.initialValue===null&&I!==null&&g(b=>({...b,initialValue:I}))},[t,g,n,f.initialValue,y]),Q(()=>{!t||!o||c.current.fields.set(o,{getValue:y,name:d,controlRef:s,validityData:ss(f,x),validate(I=!0){let b=n;b===void 0&&(b=y()),p.current=!0,I?on.flushSync(()=>l(b)):l(b)}})},[l,s,t,c,y,o,x,p,d,f,n]),Q(()=>{const I=c.current.fields;return()=>{o&&I.delete(o)}},[c,o])}function as(e,t){const n=a.useRef(e),o=xe(t);Q(()=>{n.current!==e&&o(n.current)},[e,o]),Q(()=>{n.current=e},[e])}function is(e){const{id:t,value:n,defaultValue:o=null,onValueChange:d,open:s,defaultOpen:l=!1,onOpenChange:c,name:x,disabled:p=!1,readOnly:f=!1,required:g=!1,modal:y=!0,actionsRef:I,inputRef:b,onOpenChangeComplete:v,items:E,multiple:u=!1,itemToStringLabel:C,itemToStringValue:h,isItemEqualToValue:k=Qr,highlightItemOnHover:P=!0,children:H}=e,{clearErrors:Z}=Cn(),{setDirty:D,setTouched:oe,setFocused:ge,shouldValidateOnChange:F,validityData:Y,setFilled:q,name:J,disabled:re,validation:K,validationMode:ee}=Ht(),S=Rn({id:t}),B=re||p,R=J??x,[M,le]=qt({controlled:n,default:u?o??Tt:o,name:"Select",state:"value"}),[O,he]=qt({controlled:s,default:l,name:"Select",state:"open"}),ae=a.useRef([]),A=a.useRef([]),z=a.useRef(null),ue=a.useRef(null),ke=a.useRef(0),L=a.useRef(null),ce=a.useRef([]),te=a.useRef(!1),pe=a.useRef(!1),ye=a.useRef(null),me=a.useRef({allowSelectedMouseUp:!1,allowUnselectedMouseUp:!1}),X=a.useRef(!1),{mounted:i,setMounted:w,transitionStatus:j}=un(O),{openMethod:_,triggerProps:G,reset:ve}=Yn(O),m=Pt(()=>new tr({id:S,modal:y,multiple:u,itemToStringLabel:C,itemToStringValue:h,isItemEqualToValue:k,value:M,open:O,mounted:i,transitionStatus:j,items:E,forceMount:!1,openMethod:null,activeIndex:null,selectedIndex:null,popupProps:{},triggerProps:{},triggerElement:null,positionerElement:null,listElement:null,scrollUpArrowVisible:!1,scrollDownArrowVisible:!1,hasScrollArrows:!1})).current,V=$(m,U.activeIndex),N=$(m,U.selectedIndex),ne=$(m,U.triggerElement),ie=$(m,U.positionerElement),de=a.useMemo(()=>u&&Array.isArray(M)&&M.length===0?"":Xe(M,h),[u,M,h]),be=a.useMemo(()=>u&&Array.isArray(M)?M.map(W=>Xe(W,h)):Xe(M,h),[u,M,h]),Re=_e(m.state.triggerElement);os({id:S,commit:K.commit,value:M,controlRef:Re,name:R,getValue:()=>be});const Ve=a.useRef(M);Q(()=>{M!==Ve.current&&m.set("forceMount",!0)},[m,M]),Q(()=>{q(u?Array.isArray(M)&&M.length>0:M!=null)},[u,M,q]),Q(function(){if(O)return;const fe=ce.current;if(u){const Ee=Array.isArray(M)?M:[];if(Ee.length===0){m.set("selectedIndex",null);return}const Ce=Ee[Ee.length-1],ft=Ot(fe,Ce,k);m.set("selectedIndex",ft===-1?null:ft);return}const Te=Ot(fe,M,k);m.set("selectedIndex",Te===-1?null:Te)},[u,O,M,ce,k,m]),as(M,()=>{Z(R),D(M!==Y.initialValue),F()?K.commit(M):K.commit(M,!0)});const Ne=xe((W,fe)=>{if(c?.(W,fe),!fe.isCanceled&&(he(W),!W&&(fe.reason===ln||fe.reason===nr)&&(oe(!0),ge(!1),ee==="onBlur"&&K.commit(M)),!W&&m.state.activeIndex!==null)){const Te=ae.current[m.state.activeIndex];queueMicrotask(()=>{Te?.setAttribute("tabindex","-1")})}}),Ie=xe(()=>{w(!1),m.set("activeIndex",null),ve(),v?.(!1)});_t({enabled:!I,open:O,ref:z,onComplete(){O||Ie()}}),a.useImperativeHandle(I,()=>({unmount:Ie}),[Ie]);const De=xe((W,fe)=>{d?.(W,fe),!fe.isCanceled&&le(W)}),Ae=xe(()=>{const W=m.state.listElement||z.current;if(!W)return;const fe=W.scrollTop,Te=W.scrollTop+W.clientHeight,Ee=fe>1,Ce=Te<W.scrollHeight-1;m.state.scrollUpArrowVisible!==Ee&&m.set("scrollUpArrowVisible",Ee),m.state.scrollDownArrowVisible!==Ce&&m.set("scrollDownArrowVisible",Ce)}),Oe=Gn({open:O,onOpenChange:Ne,elements:{reference:ne,floating:ie}}),lt=Xn(Oe,{enabled:!f&&!B,event:"mousedown"}),Ze=Jn(Oe,{bubbles:!1}),Le=Kr(Oe,{enabled:!f&&!B,listRef:ae,activeIndex:V,selectedIndex:N,disabledIndices:Tt,onNavigate(W){W===null&&!O||m.set("activeIndex",W)},focusItemOnHover:!1}),vt=qr(Oe,{enabled:!f&&!B&&(O||!u),listRef:A,activeIndex:V,selectedIndex:N,onMatch(W){O?m.set("activeIndex",W):De(ce.current[W],Me("none"))},onTypingChange(W){te.current=W}}),{getReferenceProps:qe,getFloatingProps:Ye,getItemProps:ct}=Qn([lt,Ze,Le,vt]),et=a.useMemo(()=>dn(qe(),G,S?{id:S}:Et),[qe,G,S]);_r(()=>{m.update({popupProps:Ye(),triggerProps:et})}),Q(()=>{m.update({id:S,modal:y,multiple:u,value:M,open:O,mounted:i,transitionStatus:j,popupProps:Ye(),triggerProps:et,items:E,itemToStringLabel:C,itemToStringValue:h,isItemEqualToValue:k,openMethod:_})},[m,S,y,u,M,O,i,j,Ye,et,E,C,h,k,_]);const ut=a.useMemo(()=>({store:m,name:R,required:g,disabled:B,readOnly:f,multiple:u,itemToStringLabel:C,itemToStringValue:h,highlightItemOnHover:P,setValue:De,setOpen:Ne,listRef:ae,popupRef:z,scrollHandlerRef:ue,handleScrollArrowVisibility:Ae,scrollArrowsMountedCountRef:ke,getItemProps:ct,events:Oe.context.events,valueRef:L,valuesRef:ce,labelsRef:A,typingRef:te,selectionRef:me,selectedItemTextRef:ye,validation:K,onOpenChangeComplete:v,keyboardActiveRef:pe,alignItemWithTriggerActiveRef:X,initialValueRef:Ve}),[m,R,g,B,f,u,C,h,P,De,Ne,ct,Oe.context.events,K,v,Ae]),dt=fn(b,K.inputRef),Rt=u&&Array.isArray(M)&&M.length>0,St=a.useMemo(()=>!u||!Array.isArray(M)||!R?null:M.map(W=>{const fe=Xe(W,h);return r.jsx("input",{type:"hidden",name:R,value:fe},fe)}),[u,M,R,h]);return r.jsx(bn.Provider,{value:ut,children:r.jsxs(wn.Provider,{value:Oe,children:[H,r.jsx("input",{...K.getInputValidationProps({onFocus(){m.state.triggerElement?.focus({focusVisible:!0})},onChange(W){if(W.nativeEvent.defaultPrevented)return;const fe=W.target.value,Te=Me(Ut,W.nativeEvent);function Ee(){if(u)return;const Ce=ce.current.find(ft=>Xe(ft,h).toLowerCase()===fe.toLowerCase());Ce!=null&&(D(Ce!==Y.initialValue),De(Ce,Te),F()&&K.commit(Ce))}m.set("forceMount",!0),queueMicrotask(Ee)}}),name:u?void 0:R,value:de,disabled:B,required:g&&!Rt,readOnly:f,ref:dt,style:R?Zn:er,tabIndex:-1,"aria-hidden":!0}),St]})})}function ls(e){const t=e.getBoundingClientRect(),n=window.getComputedStyle(e,"::before"),o=window.getComputedStyle(e,"::after");if(!(n.content!=="none"||o.content!=="none"))return t;const s=parseFloat(n.width)||0,l=parseFloat(n.height)||0,c=parseFloat(o.width)||0,x=parseFloat(o.height)||0,p=Math.max(t.width,s,c),f=Math.max(t.height,l,x),g=p-t.width,y=f-t.height;return{left:t.left-g/2,right:t.right+g/2,top:t.top-y/2,bottom:t.bottom+y/2}}const ht=2,cs=400,Xt=200,us={...rr,...Gr,value:()=>null},ds=a.forwardRef(function(t,n){const{render:o,className:d,id:s,disabled:l=!1,nativeButton:c=!0,...x}=t,{setTouched:p,setFocused:f,validationMode:g,state:y,disabled:I}=Ht(),{labelId:b}=vn(),{store:v,setOpen:E,selectionRef:u,validation:C,readOnly:h,required:k,alignItemWithTriggerActiveRef:P,disabled:H,keyboardActiveRef:Z}=ze(),D=I||H||l,oe=$(v,U.open),ge=$(v,U.value),F=$(v,U.triggerProps),Y=$(v,U.positionerElement),q=$(v,U.listElement),J=$(v,U.id),re=$(v,U.hasSelectedValue),K=!re&&oe,ee=$(v,U.hasNullItemLabel,K),S=s??J;Rn({id:S});const B=_e(Y),R=a.useRef(null),{getButtonProps:M,buttonRef:le}=gn({disabled:D,native:c}),O=xe(te=>{v.set("triggerElement",te)}),he=fn(n,R,le,O),ae=Ke(),A=Ke(),z=Ke(),ue=Ke();a.useEffect(()=>{if(oe)return!(re||ee)?z.start(cs,()=>{u.current.allowUnselectedMouseUp=!0,u.current.allowSelectedMouseUp=!0}):ue.start(Xt,()=>{u.current.allowUnselectedMouseUp=!0,z.start(Xt,()=>{u.current.allowSelectedMouseUp=!0})}),()=>{z.clear(),ue.clear()};u.current={allowSelectedMouseUp:!1,allowUnselectedMouseUp:!1},A.clear()},[oe,re,ee,u,A,z,ue]);const ke=a.useMemo(()=>q?.id??an(Y)?.id,[q,Y]),L=dn(F,{id:S,role:"combobox","aria-expanded":oe?"true":"false","aria-haspopup":"listbox","aria-controls":oe?ke:void 0,"aria-labelledby":b,"aria-readonly":h||void 0,"aria-required":k||void 0,tabIndex:D?-1:0,ref:he,onFocus(te){f(!0),oe&&P.current&&E(!1,Me(Ut,te.nativeEvent)),ae.start(0,()=>{v.set("forceMount",!0)})},onBlur(te){tt(Y,te.relatedTarget)||(p(!0),f(!1),g==="onBlur"&&C.commit(ge))},onPointerMove(){Z.current=!1},onKeyDown(){Z.current=!0},onMouseDown(te){if(oe)return;const pe=At(te.currentTarget);function ye(me){if(!R.current)return;const X=me.target;if(tt(R.current,X)||tt(B.current,X)||X===R.current)return;const i=ls(R.current);me.clientX>=i.left-ht&&me.clientX<=i.right+ht&&me.clientY>=i.top-ht&&me.clientY<=i.bottom+ht||E(!1,Me(sr,me))}A.start(0,()=>{pe.addEventListener("mouseup",ye,{once:!0})})}},C.getValidationProps,x,M);L.role="combobox";const ce=a.useMemo(()=>({...y,open:oe,disabled:D,value:ge,readOnly:h,placeholder:!re}),[y,oe,D,ge,h,re]);return He("button",t,{ref:[n,R],state:ce,stateAttributesMapping:us,props:L})}),fs={value:()=>null},gs=a.forwardRef(function(t,n){const{className:o,render:d,children:s,placeholder:l,...c}=t,{store:x,valueRef:p}=ze(),f=$(x,U.value),g=$(x,U.items),y=$(x,U.itemToStringLabel),I=$(x,U.hasSelectedValue),b=!I&&l!=null&&s==null,v=$(x,U.hasNullItemLabel,b),E=a.useMemo(()=>({value:f,placeholder:!I}),[f,I]);let u=null;return typeof s=="function"?u=s(f):s!=null?u=s:!I&&l!=null&&!v?u=l:Array.isArray(f)?u=ns(f,g,y):u=Nn(f,g,y),He("span",t,{state:E,ref:[n,p],props:[{children:u},c],stateAttributesMapping:fs})}),ms=a.forwardRef(function(t,n){const{className:o,render:d,...s}=t,{store:l}=ze(),c=$(l,U.open),x=a.useMemo(()=>({open:c}),[c]);return He("span",t,{state:x,ref:n,props:[{"aria-hidden":!0,children:"▼"},s],stateAttributesMapping:or})}),hs=a.createContext(void 0),ps=a.forwardRef(function(t,n){const{store:o}=ze(),d=$(o,U.mounted),s=$(o,U.forceMount);return d||s?r.jsx(hs.Provider,{value:!0,children:r.jsx(ar,{ref:n,...t})}):null}),jn=a.createContext({register:()=>{},unregister:()=>{},subscribeMapChange:()=>()=>{},elementsRef:{current:[]},nextIndexRef:{current:0}});function xs(){return a.useContext(jn)}function ys(e){const{children:t,elementsRef:n,labelsRef:o,onMapChange:d}=e,s=xe(d),l=a.useRef(0),c=Pt(ws).current,x=Pt(bs).current,[p,f]=a.useState(0),g=a.useRef(p),y=xe((u,C)=>{x.set(u,C??null),g.current+=1,f(g.current)}),I=xe(u=>{x.delete(u),g.current+=1,f(g.current)}),b=a.useMemo(()=>{const u=new Map;return Array.from(x.keys()).filter(h=>h.isConnected).sort(ks).forEach((h,k)=>{const P=x.get(h)??{};u.set(h,{...P,index:k})}),u},[x,p]);Q(()=>{if(typeof MutationObserver!="function"||b.size===0)return;const u=new MutationObserver(C=>{const h=new Set,k=P=>h.has(P)?h.delete(P):h.add(P);C.forEach(P=>{P.removedNodes.forEach(k),P.addedNodes.forEach(k)}),h.size===0&&(g.current+=1,f(g.current))});return b.forEach((C,h)=>{h.parentElement&&u.observe(h.parentElement,{childList:!0})}),()=>{u.disconnect()}},[b]),Q(()=>{g.current===p&&(n.current.length!==b.size&&(n.current.length=b.size),o&&o.current.length!==b.size&&(o.current.length=b.size),l.current=b.size),s(b)},[s,b,n,o,p]),Q(()=>()=>{n.current=[]},[n]),Q(()=>()=>{o&&(o.current=[])},[o]);const v=xe(u=>(c.add(u),()=>{c.delete(u)}));Q(()=>{c.forEach(u=>u(b))},[c,b]);const E=a.useMemo(()=>({register:y,unregister:I,subscribeMapChange:v,elementsRef:n,labelsRef:o,nextIndexRef:l}),[y,I,v,n,o,l]);return r.jsx(jn.Provider,{value:E,children:t})}function bs(){return new Map}function ws(){return new Set}function ks(e,t){const n=e.compareDocumentPosition(t);return n&Node.DOCUMENT_POSITION_FOLLOWING||n&Node.DOCUMENT_POSITION_CONTAINED_BY?-1:n&Node.DOCUMENT_POSITION_PRECEDING||n&Node.DOCUMENT_POSITION_CONTAINS?1:0}const Mn=a.createContext(void 0);function vs(){const e=a.useContext(Mn);if(!e)throw new Error(it(59));return e}function bt(e,t){e&&Object.assign(e.style,t)}const Rs={position:"relative",maxHeight:"100%",overflowX:"hidden",overflowY:"auto"},Ss={position:"fixed"},Ns=a.forwardRef(function(t,n){const{anchor:o,positionMethod:d="absolute",className:s,render:l,side:c="bottom",align:x="center",sideOffset:p=0,alignOffset:f=0,collisionBoundary:g="clipping-ancestors",collisionPadding:y,arrowPadding:I=5,sticky:b=!1,disableAnchorTracking:v,alignItemWithTrigger:E=!0,collisionAvoidance:u=ir,...C}=t,{store:h,listRef:k,labelsRef:P,alignItemWithTriggerActiveRef:H,selectedItemTextRef:Z,valuesRef:D,initialValueRef:oe,popupRef:ge,setValue:F}=ze(),Y=kn(),q=$(h,U.open),J=$(h,U.mounted),re=$(h,U.modal),K=$(h,U.value),ee=$(h,U.openMethod),S=$(h,U.positionerElement),B=$(h,U.triggerElement),R=$(h,U.isItemEqualToValue),M=a.useRef(null),le=a.useRef(null),[O,he]=a.useState(E),ae=J&&O&&ee!=="touch";!J&&O!==E&&he(E),Q(()=>{J||(U.scrollUpArrowVisible(h.state)&&h.set("scrollUpArrowVisible",!1),U.scrollDownArrowVisible(h.state)&&h.set("scrollDownArrowVisible",!1))},[h,J]),a.useImperativeHandle(H,()=>ae),lr((ae||re)&&q&&ee!=="touch",B);const A=cr({anchor:o,floatingRootContext:Y,positionMethod:d,mounted:J,side:c,sideOffset:p,align:x,alignOffset:f,arrowPadding:I,collisionBoundary:g,collisionPadding:y,sticky:b,disableAnchorTracking:v??ae,collisionAvoidance:u,keepMounted:!0}),z=ae?"none":A.side,ue=ae?Ss:A.positionerStyles,ke=a.useMemo(()=>{const X={};return q||(X.pointerEvents="none"),{role:"presentation",hidden:!J,style:{...ue,...X}}},[q,J,ue]),L=a.useMemo(()=>({open:q,side:z,align:A.align,anchorHidden:A.anchorHidden}),[q,z,A.align,A.anchorHidden]),ce=xe(X=>{h.set("positionerElement",X)}),te=He("div",t,{ref:[n,ce],state:L,stateAttributesMapping:mn,props:[ke,C]}),pe=a.useRef(0),ye=xe(X=>{if(X.size===0&&pe.current===0||D.current.length===0)return;const i=pe.current;if(pe.current=X.size,X.size===i)return;const w=Me(Ut);if(i!==0&&!h.state.multiple&&K!==null&&Ot(D.current,K,R)===-1){const _=oe.current,ve=_!=null&&It(D.current,_,R)?_:null;F(ve,w),ve===null&&(h.set("selectedIndex",null),Z.current=null)}if(i!==0&&h.state.multiple&&Array.isArray(K)){const j=K.filter(_=>It(D.current,_,R));(j.length!==K.length||j.some(_=>!It(K,_,R)))&&(F(j,w),j.length===0&&(h.set("selectedIndex",null),Z.current=null))}if(q&&ae){h.update({scrollUpArrowVisible:!1,scrollDownArrowVisible:!1});const j={height:""};bt(S,j),bt(ge.current,j)}}),me=a.useMemo(()=>({...A,side:z,alignItemWithTriggerActive:ae,setControlledAlignItemWithTrigger:he,scrollUpArrowRef:M,scrollDownArrowRef:le}),[A,z,ae,he]);return r.jsx(ys,{elementsRef:k,labelsRef:P,onMapChange:ye,children:r.jsxs(Mn.Provider,{value:me,children:[J&&re&&r.jsx(ur,{inert:dr(!q),cutout:B}),te]})})});function In(e){const t=e.currentTarget.getBoundingClientRect();return t.top+1<=e.clientY&&e.clientY<=t.bottom-1&&t.left+1<=e.clientX&&e.clientX<=t.right-1}const pt="base-ui-disable-scrollbar",Jt={className:pt,getElement(e){return r.jsx("style",{nonce:e,href:pt,precedence:"base-ui:low",children:`.${pt}{scrollbar-width:none}.${pt}::-webkit-scrollbar{display:none}`})}};function Cs(e,t=Number.MIN_SAFE_INTEGER,n=Number.MAX_SAFE_INTEGER){return Math.max(t,Math.min(e,n))}const js=a.createContext(void 0),Ms={disableStyleElements:!1};function Is(){return a.useContext(js)??Ms}const Ts={...mn,...hn},Es=a.forwardRef(function(t,n){const{render:o,className:d,...s}=t,{store:l,popupRef:c,onOpenChangeComplete:x,setOpen:p,valueRef:f,selectedItemTextRef:g,keyboardActiveRef:y,multiple:I,handleScrollArrowVisibility:b,scrollHandlerRef:v,highlightItemOnHover:E}=ze(),{side:u,align:C,alignItemWithTriggerActive:h,setControlledAlignItemWithTrigger:k,scrollDownArrowRef:P,scrollUpArrowRef:H}=vs(),Z=fr()!=null,D=kn(),{nonce:oe,disableStyleElements:ge}=Is(),F=Ke(),Y=$(l,U.id),q=$(l,U.open),J=$(l,U.mounted),re=$(l,U.popupProps),K=$(l,U.transitionStatus),ee=$(l,U.triggerElement),S=$(l,U.positionerElement),B=$(l,U.listElement),R=a.useRef(0),M=a.useRef(!1),le=a.useRef(0),O=a.useRef(!1),he=a.useRef({}),ae=gr(),A=xe(L=>{if(!S||!c.current||!O.current)return;if(M.current||!h){b();return}const ce=S.style.top==="0px",te=S.style.bottom==="0px",pe=S.getBoundingClientRect().height,ye=At(S),me=getComputedStyle(S),X=parseFloat(me.marginTop),i=parseFloat(me.marginBottom),w=Qt(getComputedStyle(c.current)),j=ye.documentElement.clientHeight-X-i,_=L.scrollTop,G=L.scrollHeight,ve=L.clientHeight,m=G-ve;let V=0,N=null,ne=!1;if(ce){const ie=m-_,de=pe+ie,be=Math.min(de,j);V=be,be!==j?N=m:ne=!0}else if(te){const ie=_-0,de=pe+ie,be=Math.min(de,j),Re=de-j;V=be,be!==j?N=0:(ne=!0,_<m&&(N=_-(ie-Re)))}V!==0&&(S.style.height=`${V}px`),N!=null&&(L.scrollTop=N),(ne||V>=w)&&(M.current=!0),b()});a.useImperativeHandle(v,()=>A,[A]),_t({open:q,ref:c,onComplete(){q&&x?.(!0)}});const z=a.useMemo(()=>({open:q,transitionStatus:K,side:u,align:C}),[q,K,u,C]);Q(()=>{!S||!c.current||Object.keys(he.current).length||(he.current={top:S.style.top||"0",left:S.style.left||"0",right:S.style.right,height:S.style.height,bottom:S.style.bottom,minHeight:S.style.minHeight,maxHeight:S.style.maxHeight,marginTop:S.style.marginTop,marginBottom:S.style.marginBottom})},[c,S]),Q(()=>{q||h||(O.current=!1,M.current=!1,R.current=0,le.current=0,bt(S,he.current))},[q,h,S,c]),Q(()=>{const L=c.current;if(!(!q||!ee||!S||!L||l.state.transitionStatus==="ending")){if(!h){O.current=!0,ae.request(b),L.style.removeProperty("--transform-origin");return}queueMicrotask(()=>{const ce=As(L);L.style.removeProperty("--transform-origin");try{const te=getComputedStyle(S),pe=getComputedStyle(L),ye=At(ee),me=Wt(S),X=ee.getBoundingClientRect(),i=S.getBoundingClientRect(),w=X.left,j=X.height,_=B||L,G=_.scrollHeight,ve=parseFloat(pe.borderBottomWidth),m=parseFloat(te.marginTop)||10,V=parseFloat(te.marginBottom)||10,N=parseFloat(te.minHeight)||100,ne=Qt(pe),ie=5,de=5,be=20,Re=ye.documentElement.clientHeight-m-V,Ve=ye.documentElement.clientWidth,Ne=Re-X.bottom+j,Ie=g.current,De=f.current;let Ae,Oe=0,lt=0;if(Ie&&De){const W=De.getBoundingClientRect();Ae=Ie.getBoundingClientRect();const fe=W.left-w,Te=Ae.left-i.left,Ee=W.top-X.top+W.height/2,Ce=Ae.top-i.top+Ae.height/2;Oe=fe-Te,lt=Ce-Ee}const Ze=Ne+lt+V+ve;let Le=Math.min(Re,Ze);const vt=Re-m-V,qe=Ze-Le,Ye=Math.max(ie,w+Oe),ct=Ve-de,et=Math.max(0,Ye+i.width-ct);S.style.left=`${Ye-et}px`,S.style.height=`${Le}px`,S.style.maxHeight="auto",S.style.marginTop=`${m}px`,S.style.marginBottom=`${V}px`,L.style.height="100%";const ut=_.scrollHeight-_.clientHeight,dt=qe>=ut;dt&&(Le=Math.min(Re,i.height)-(qe-ut));const Rt=X.top<be||X.bottom>Re-be||Le<Math.min(G,N),St=(me.visualViewport?.scale??1)!==1&&mr;if(Rt||St){O.current=!0,bt(S,he.current),on.flushSync(()=>k(!1));return}if(dt){const W=Math.max(0,Re-Ze);S.style.top=i.height>=vt?"0":`${W}px`,S.style.height=`${Le}px`,_.scrollTop=_.scrollHeight-_.clientHeight,R.current=Math.max(N,Le)}else S.style.bottom="0",R.current=Math.max(N,Le),_.scrollTop=qe;if(Ae){const W=i.top,fe=i.height,Te=Ae.top+Ae.height/2,Ee=fe>0?(Te-W)/fe*100:50,Ce=Cs(Ee,0,100);L.style.setProperty("--transform-origin",`50% ${Ce}%`)}(R.current===Re||Le>=ne)&&(M.current=!0),b(),setTimeout(()=>{O.current=!0})}finally{ce()}})}},[l,q,S,ee,f,g,c,b,h,k,ae,P,H,B]),a.useEffect(()=>{if(!h||!S||!q)return;const L=Wt(S);function ce(te){p(!1,Me(pr,te))}return L.addEventListener("resize",ce),()=>{L.removeEventListener("resize",ce)}},[p,h,S,q]);const ue={...B?{role:"presentation","aria-orientation":void 0}:{role:"listbox","aria-multiselectable":I||void 0,id:`${Y}-list`},onKeyDown(L){y.current=!0,Z&&yr.has(L.key)&&L.stopPropagation()},onMouseMove(){y.current=!1},onPointerLeave(L){if(!E||In(L)||L.pointerType==="touch")return;const ce=L.currentTarget;F.start(0,()=>{l.set("activeIndex",null),ce.focus({preventScroll:!0})})},onScroll(L){B||v.current?.(L.currentTarget)},...h&&{style:B?{height:"100%"}:Rs}},ke=He("div",t,{ref:[n,c],state:z,stateAttributesMapping:Ts,props:[re,ue,xr(K),{className:!B&&h?Jt.className:void 0},s]});return r.jsxs(a.Fragment,{children:[!ge&&Jt.getElement(oe),r.jsx(hr,{context:D,modal:!1,disabled:!J,restoreFocus:!0,children:ke})]})});function Qt(e){const t=e.maxHeight||"";return t.endsWith("px")&&parseFloat(t)||1/0}const Zt={transform:"none",scale:"1",translate:"0 0"};function Ps(e,t,n){n?e.setProperty(t,n):e.removeProperty(t)}function As(e){const{style:t}=e,n={},o=Object.keys(Zt);for(const d of o)n[d]=t.getPropertyValue(d),t.setProperty(d,Zt[d]);return()=>{for(const d of o)Ps(t,d,n[d])}}let Tn=(function(e){return e[e.None=0]="None",e[e.GuessFromOrder=1]="GuessFromOrder",e})({});function Os(e={}){const{label:t,metadata:n,textRef:o,indexGuessBehavior:d,index:s}=e,{register:l,unregister:c,subscribeMapChange:x,elementsRef:p,labelsRef:f,nextIndexRef:g}=xs(),y=a.useRef(-1),[I,b]=a.useState(s??(d===Tn.GuessFromOrder?()=>{if(y.current===-1){const u=g.current;g.current+=1,y.current=u}return y.current}:-1)),v=a.useRef(null),E=a.useCallback(u=>{if(v.current=u,I!==-1&&u!==null&&(p.current[I]=u,f)){const C=t!==void 0;f.current[I]=C?t:o?.current?.textContent??u.textContent}},[I,p,f,t,o]);return Q(()=>{if(s!=null)return;const u=v.current;if(u)return l(u,n),()=>{c(u)}},[s,l,c,n]),Q(()=>{if(s==null)return x(u=>{const C=v.current?u.get(v.current)?.index:null;C!=null&&b(C)})},[s,x,b]),a.useMemo(()=>({ref:E,index:I}),[I,E])}const En=a.createContext(void 0);function Ft(){const e=a.useContext(En);if(!e)throw new Error(it(57));return e}const en=a.memo(a.forwardRef(function(t,n){const{render:o,className:d,value:s=null,label:l,disabled:c=!1,nativeButton:x=!1,...p}=t,f=a.useRef(null),g=Os({label:l,textRef:f,indexGuessBehavior:Tn.GuessFromOrder}),{store:y,getItemProps:I,setOpen:b,setValue:v,selectionRef:E,typingRef:u,valuesRef:C,keyboardActiveRef:h,multiple:k,highlightItemOnHover:P}=ze(),H=Ke(),Z=$(y,U.isActive,g.index),D=$(y,U.isSelected,g.index,s),oe=$(y,U.isSelectedByFocus,g.index),ge=$(y,U.isItemEqualToValue),F=g.index,Y=F!==-1,q=a.useRef(null),J=_e(F);Q(()=>{if(!Y)return;const A=C.current;return A[F]=s,()=>{delete A[F]}},[Y,F,s,C]),Q(()=>{if(!Y)return;const A=y.state.value;let z=A;k&&Array.isArray(A)&&A.length>0&&(z=A[A.length-1]),z!==void 0&&Qe(z,s,ge)&&y.set("selectedIndex",F)},[Y,F,k,ge,y,s]);const re=a.useMemo(()=>({disabled:c,selected:D,highlighted:Z}),[c,D,Z]),K=I({active:Z,selected:D});K.onFocus=void 0,K.id=void 0;const ee=a.useRef(null),S=a.useRef("mouse"),B=a.useRef(!1),{getButtonProps:R,buttonRef:M}=gn({disabled:c,focusableWhenDisabled:!0,native:x});function le(A){const z=y.state.value;if(k){const ue=Array.isArray(z)?z:[],ke=D?Zr(ue,s,ge):[...ue,s];v(ke,Me(Ct,A))}else v(s,Me(Ct,A)),b(!1,Me(Ct,A))}const O={role:"option","aria-selected":D,tabIndex:Z?0:-1,onFocus(){y.set("activeIndex",F)},onMouseEnter(){!h.current&&y.state.selectedIndex===null&&y.set("activeIndex",F)},onMouseMove(){P&&y.set("activeIndex",F)},onMouseLeave(A){!P||h.current||In(A)||H.start(0,()=>{y.state.activeIndex===F&&y.set("activeIndex",null)})},onTouchStart(){E.current={allowSelectedMouseUp:!1,allowUnselectedMouseUp:!1}},onKeyDown(A){ee.current=A.key,y.set("activeIndex",F)},onClick(A){B.current=!1,!(A.type==="keydown"&&ee.current===null)&&(c||ee.current===" "&&u.current||S.current!=="touch"&&!Z||(ee.current=null,le(A.nativeEvent)))},onPointerEnter(A){S.current=A.pointerType},onPointerDown(A){S.current=A.pointerType,B.current=!0},onMouseUp(A){if(c)return;if(B.current){B.current=!1;return}const z=!E.current.allowSelectedMouseUp&&D,ue=!E.current.allowUnselectedMouseUp&&!D;z||ue||S.current!=="touch"&&!Z||le(A.nativeEvent)}},he=He("div",t,{ref:[M,n,g.ref,q],state:re,props:[K,O,p,R]}),ae=a.useMemo(()=>({selected:D,indexRef:J,textRef:f,selectedByFocus:oe,hasRegistered:Y}),[D,J,f,oe,Y]);return r.jsx(En.Provider,{value:ae,children:he})})),tn=a.forwardRef(function(t,n){const o=t.keepMounted??!1,{selected:d}=Ft();return o||d?r.jsx(Ls,{...t,ref:n}):null}),Ls=a.memo(a.forwardRef((e,t)=>{const{render:n,className:o,keepMounted:d,...s}=e,{selected:l}=Ft(),c=a.useRef(null),{transitionStatus:x,setMounted:p}=un(l),f=a.useMemo(()=>({selected:l,transitionStatus:x}),[l,x]),g=He("span",e,{ref:[t,c],state:f,props:[{"aria-hidden":!0,children:"✔️"},s],stateAttributesMapping:hn});return _t({open:l,ref:c,onComplete(){l||p(!1)}}),g})),nn=a.memo(a.forwardRef(function(t,n){const{indexRef:o,textRef:d,selectedByFocus:s,hasRegistered:l}=Ft(),{selectedItemTextRef:c}=ze(),{className:x,render:p,...f}=t,g=a.useCallback(I=>{if(!I||!l)return;const b=c.current===null||!c.current.isConnected;(s||b&&o.current===0)&&(c.current=I)},[c,o,s,l]);return He("div",t,{ref:[g,n,d],props:f})})),Vs=a.forwardRef(function(t,n){const{render:o,className:d,id:s,...l}=t,{store:c}=br(),x=cn(s);return c.useSyncedValueWithCleanup("descriptionElementId",x),He("p",t,{ref:n,props:[{id:x},l]})});function Ds({open:e,title:t,description:n,confirmLabel:o,cancelLabel:d,destructive:s=!1,busy:l=!1,onConfirm:c,onCancel:x}){return r.jsx(wr,{open:e,onOpenChange:p=>{!p&&!l&&x?.()},children:r.jsxs(kr,{children:[r.jsx(vr,{className:"fixed inset-0 z-[100] bg-black/40 backdrop-blur-[2px] transition-opacity duration-200 ease-out data-[ending-style]:opacity-0 data-[starting-style]:opacity-0"}),r.jsx(Rr,{className:"fixed inset-0 z-[101] flex items-center justify-center p-4",children:r.jsxs(Sr,{className:"relative w-full max-w-md rounded-2xl bg-white p-6 shadow-[0_20px_60px_-20px_rgba(0,0,0,0.25)] ring-1 ring-oai-gray-200 transition-[opacity,transform] duration-[220ms] ease-[cubic-bezier(0.16,1,0.3,1)] data-[ending-style]:translate-y-2 data-[ending-style]:scale-[0.96] data-[ending-style]:opacity-0 data-[starting-style]:translate-y-2 data-[starting-style]:scale-[0.96] data-[starting-style]:opacity-0 dark:bg-oai-gray-950 dark:shadow-[0_20px_60px_-10px_rgba(0,0,0,0.65)] dark:ring-oai-gray-800",children:[r.jsx(Nr,{className:"text-base font-semibold text-oai-black dark:text-white",children:t}),n?r.jsx(Vs,{className:"mt-2 text-sm leading-6 text-oai-gray-600 dark:text-oai-gray-300",children:n}):null,r.jsxs("div",{className:"mt-5 flex justify-end gap-2",children:[r.jsx(Ue,{type:"button",variant:"secondary",size:"sm",disabled:l,onClick:()=>x?.(),children:d}),r.jsx(Ue,{type:"button",size:"sm",disabled:l,onClick:()=>c?.(),className:Je(s&&"!bg-red-600 hover:!bg-red-700 focus-visible:!outline-red-600 dark:!bg-red-600 dark:hover:!bg-red-500"),children:o})]})]})})]})})}function Pn({value:e,onChange:t,placeholder:n,disabled:o=!1,type:d="text",label:s,error:l,className:c="",...x}){const y=`w-full bg-oai-white dark:bg-oai-gray-900 border border-oai-gray-300 dark:border-oai-gray-700 rounded-md text-oai-black dark:text-oai-white placeholder-oai-gray-400 dark:placeholder-oai-gray-500 transition-all duration-200 focus:outline-none focus:border-oai-brand dark:focus:border-oai-brand focus:ring-1 focus:ring-oai-brand/30 ${o?"bg-oai-gray-50 dark:bg-oai-gray-800 text-oai-gray-400 dark:text-oai-gray-400 cursor-not-allowed":""} ${l?"border-oai-error focus:border-oai-error focus:ring-oai-error/30":""} h-10 px-3 text-sm ${c}`;return r.jsxs("div",{className:"w-full",children:[s&&r.jsx("label",{className:"block text-sm font-medium text-oai-gray-700 dark:text-oai-gray-300 mb-1.5 transition-colors duration-200",children:s}),r.jsx("input",{type:d,value:e,onChange:t,placeholder:n,disabled:o,className:y,...x}),l&&r.jsx("p",{className:"mt-1.5 text-sm text-oai-error",children:l})]})}const An="tokentracker-skills";async function kt(e){const t=new URL(`/functions/${An}`,window.location.origin);if(e)for(const[d,s]of Object.entries(e))s!=null&&s!==""&&t.searchParams.set(d,String(s));const n=await fetch(t.toString(),{headers:{Accept:"application/json"},cache:"no-store"}),o=await n.json().catch(()=>null);if(!n.ok)throw new Error(o?.error||`Request failed with HTTP ${n.status}`);return o}async function We(e){const t=await Ln(),n=await fetch(`/functions/${An}`,{method:"POST",headers:{Accept:"application/json","Content-Type":"application/json",...t},cache:"no-store",body:JSON.stringify(e)}),o=await n.json().catch(()=>null);if(!n.ok||o?.ok===!1)throw new Error(o?.error||`Request failed with HTTP ${n.status}`);return o}function _s(){return kt({mode:"installed"})}function Us(e={}){return kt({mode:"discover",...e.force?{force:1}:{}})}function Hs(e,t=0,n=20){return kt({mode:"search",q:e,offset:t,limit:n})}function Fs(){return kt({mode:"repos"})}function $s(e,t){return We({action:"install",skill:e,targets:t})}function Bs(e){return We({action:"uninstall",id:e})}function zs(e){return We({action:"restore",id:e})}function Ws(e,t){return We({action:"set_targets",id:e,targets:t})}function Ks(e,t){return We({action:"import_local",directory:e,targets:t})}function qs(e,t){return We({action:"delete_local",directory:e,targets:t||[]})}function Ys(e){return We({action:"add_repo",repo:e})}function Gs(e,t){return We({action:"remove_repo",owner:e,name:t})}const rn=["claude","codex"],Xs={claude:"bg-orange-500/10 ring-1 ring-orange-500/20 hover:bg-orange-500/20",codex:"bg-emerald-500/10 ring-1 ring-emerald-500/20 hover:bg-emerald-500/20",gemini:"bg-sky-500/10 ring-1 ring-sky-500/20 hover:bg-sky-500/20",opencode:"bg-amber-500/10 ring-1 ring-amber-500/20 hover:bg-amber-500/20",hermes:"bg-indigo-500/10 ring-1 ring-indigo-500/20 hover:bg-indigo-500/20"},Ge="all",je="skillssh";function xt(e){return`${e.repoOwner||"local"}/${e.repoName||"local"}:${e.directory}`}function sn(e){return`install:${xt(e)}`}function Vt(e){return`remove:${e.id||e.directory}`}function On(e,t){return`target:${e}:${t}`}function Js({skill:e,targets:t,busyKey:n,onToggleTarget:o}){const d=new Set(e.targets||[]);return r.jsx("div",{className:"flex flex-wrap gap-1",children:t.map(s=>{const l=d.has(s.id),c=n===On(e.id,s.id),x=l?"skills.target.remove_title":"skills.target.sync_title";return r.jsx("button",{type:"button","aria-pressed":l,"aria-label":T("skills.target.toggle_aria",{target:s.label}),title:T(x,{target:s.label}),disabled:c,onClick:()=>o(e,s.id,!l),className:Je("inline-flex h-8 w-8 items-center justify-center rounded-md transition disabled:cursor-wait disabled:opacity-70",l?Xs[s.id]||"bg-oai-gray-100 dark:bg-oai-gray-800":"opacity-40 grayscale hover:bg-oai-gray-100 hover:opacity-100 hover:grayscale-0 dark:hover:bg-oai-gray-800"),children:c?r.jsx(Be,{className:"h-4 w-4 animate-spin","aria-hidden":!0}):r.jsx(yt,{provider:s.id,size:16})},s.id)})})}function Qs({skill:e,targets:t,busyKey:n,onToggleTarget:o,onRemove:d}){const s=n===Vt(e),l=e.repoOwner&&e.repoName?`${e.repoOwner}/${e.repoName}`:null,c=l?`${e.directory} · ${l}`:e.directory;return r.jsxs("div",{className:"group grid gap-4 px-1 py-3 lg:grid-cols-[minmax(0,1fr)_auto_auto] lg:items-center",children:[r.jsxs("div",{className:"min-w-0",title:c,children:[r.jsx("h2",{className:"truncate text-sm font-semibold text-oai-black dark:text-white",children:e.name||e.directory}),e.description?r.jsx("p",{className:"mt-0.5 line-clamp-2 text-xs text-oai-gray-500 dark:text-oai-gray-400",children:e.description}):null]}),r.jsx(Js,{skill:e,targets:t,busyKey:n,onToggleTarget:o}),r.jsx("button",{type:"button","aria-label":T("skills.action.remove"),title:T("skills.action.remove"),disabled:s,onClick:()=>d(e),className:"inline-flex h-8 w-8 items-center justify-center rounded-md text-oai-gray-400 opacity-0 transition duration-200 hover:bg-red-50 hover:text-red-600 group-hover:opacity-100 focus:opacity-100 disabled:cursor-wait disabled:opacity-100 dark:hover:bg-red-950/30 dark:hover:text-red-300 lg:justify-self-end",children:s?r.jsx(Be,{className:"h-4 w-4 animate-spin","aria-hidden":!0}):r.jsx(yn,{className:"h-4 w-4","aria-hidden":!0})})]})}function Zs({items:e,targets:t,busyKey:n,onToggleTarget:o,onRemove:d}){return r.jsxs("div",{children:[r.jsx("div",{className:"px-1 pb-2 text-xs text-oai-gray-500 dark:text-oai-gray-400",children:T("skills.my.count",{count:e.length})}),r.jsx("div",{className:"divide-y divide-oai-gray-200/70 dark:divide-oai-gray-800/70",children:e.map(s=>r.jsx(Qs,{skill:s,targets:t,busyKey:n,onToggleTarget:o,onRemove:d},s.id||s.key))})]})}const eo={contentVisibility:"auto",containIntrinsicSize:"0 240px"},to=Dn.memo(function({skill:t,installed:n,installing:o,allTargets:d,defaultTargets:s,onInstall:l}){const[c,x]=a.useState(()=>(s||[]).filter(b=>d.some(v=>v.id===b))),p=b=>{x(v=>v.includes(b)?v.filter(E=>E!==b):[...v,b])},f=t.repoOwner&&t.repoName?`${t.repoOwner}/${t.repoName}`:null,g=t.installs!=null?T("skills.card.installs",{count:Number(t.installs||0).toLocaleString()}):null,y=[f,g].filter(Boolean).join(" · "),I=c.length?c.map(b=>d.find(v=>v.id===b)?.label||b).join(", "):T("skills.action.choose_targets");return r.jsxs(_n,{className:"h-full rounded-lg",bodyClassName:"flex h-full flex-col",children:[r.jsxs("div",{className:"flex items-start justify-between gap-3",children:[r.jsxs("div",{className:"min-w-0",children:[t.readmeUrl?r.jsxs("a",{href:t.readmeUrl,target:"_blank",rel:"noopener noreferrer",className:"group inline-flex max-w-full items-center gap-1 truncate text-base font-semibold text-oai-black hover:underline dark:text-white",title:t.readmeUrl,children:[r.jsx("span",{className:"truncate",children:t.name||t.directory}),r.jsx(Or,{className:"h-3.5 w-3.5 shrink-0 text-oai-gray-400 opacity-0 transition-opacity group-hover:opacity-100","aria-hidden":!0})]}):r.jsx("h2",{className:"truncate text-base font-semibold text-oai-black dark:text-white",children:t.name||t.directory}),y?r.jsx("div",{className:"mt-1 truncate text-xs text-oai-gray-500 dark:text-oai-gray-400",children:y}):null]}),n?r.jsxs("span",{className:"inline-flex shrink-0 items-center gap-1 rounded-md bg-oai-black/[0.06] px-2 py-1 text-xs font-medium text-oai-gray-700 ring-1 ring-oai-black/10 dark:bg-white/[0.08] dark:text-oai-gray-200 dark:ring-white/10",children:[r.jsx(nt,{className:"h-3 w-3","aria-hidden":!0}),T("skills.card.installed")]}):null]}),t.description?r.jsx("p",{className:"mt-3 line-clamp-3 text-sm leading-6 text-oai-gray-600 dark:text-oai-gray-300",children:t.description}):null,r.jsx("div",{className:"mt-auto pt-5",children:n?r.jsxs("div",{className:"inline-flex h-8 w-full items-center justify-center gap-1.5 rounded-md bg-oai-black/[0.04] text-sm font-medium text-oai-gray-700 ring-1 ring-inset ring-oai-black/[0.08] dark:bg-white/[0.05] dark:text-oai-gray-200 dark:ring-white/[0.08]",children:[r.jsx(nt,{className:"h-3.5 w-3.5","aria-hidden":!0}),T("skills.card.installed")]}):r.jsxs("div",{className:"flex",children:[r.jsxs(Ue,{type:"button",size:"sm",onClick:()=>l(t,c),disabled:o||c.length===0,className:"flex-1 !rounded-r-none",title:I,children:[o?r.jsx(Be,{className:"mr-1.5 h-3.5 w-3.5 animate-spin","aria-hidden":!0}):r.jsx(Er,{className:"mr-1.5 h-3.5 w-3.5","aria-hidden":!0}),c.length>1?T("skills.action.install_to",{count:c.length}):T("skills.action.install")]}),r.jsxs(Cr,{children:[r.jsx(jr,{disabled:o,"aria-label":T("skills.action.choose_targets"),title:I,className:"inline-flex h-8 items-center justify-center rounded-r-md border-l border-white/20 bg-oai-black px-2 text-white hover:bg-oai-gray-800 disabled:cursor-not-allowed disabled:opacity-60 dark:border-oai-black/20 dark:bg-white dark:text-oai-black dark:hover:bg-oai-gray-200",children:r.jsx(pn,{className:"h-3.5 w-3.5","aria-hidden":!0})}),r.jsx(Mr,{children:r.jsx(Ir,{sideOffset:6,side:"bottom",align:"end",className:"!z-[80]",children:r.jsxs(Tr,{className:"min-w-[200px] rounded-lg bg-white p-1.5 shadow-lg ring-1 ring-oai-gray-200 dark:bg-oai-gray-950 dark:ring-oai-gray-800",children:[r.jsx("div",{className:"px-2 pb-1 pt-0.5 text-[11px] font-medium uppercase tracking-wide text-oai-gray-500 dark:text-oai-gray-400",children:T("skills.target.menu_label")}),d.map(b=>{const v=c.includes(b.id);return r.jsxs("button",{type:"button",onClick:()=>p(b.id),className:Je("flex w-full items-center gap-2 rounded-md px-2 py-1.5 text-sm",v?"bg-oai-gray-100 dark:bg-oai-gray-800":"hover:bg-oai-gray-50 dark:hover:bg-oai-gray-900"),children:[r.jsx(yt,{provider:b.id,size:16,className:v?"":"grayscale opacity-40"}),r.jsx("span",{className:"flex-1 text-left",children:b.label}),v?r.jsx(nt,{className:"h-3.5 w-3.5 text-emerald-500","aria-hidden":!0}):null]},b.id)})]})})})]})]})})]})});function no({repos:e,repoInput:t,onRepoInput:n,busyKey:o,onAdd:d,onRemove:s}){return r.jsxs("div",{className:"rounded-lg border border-oai-gray-200 bg-white p-4 dark:border-oai-gray-800 dark:bg-oai-gray-950",children:[r.jsxs("div",{className:"flex flex-col gap-2 sm:flex-row sm:items-center",children:[r.jsx(Pn,{value:t,onChange:l=>n(l.target.value),placeholder:T("skills.repo.placeholder"),className:"min-w-0 flex-1"}),r.jsxs(Ue,{type:"button",variant:"secondary",size:"md",onClick:d,disabled:o==="repo:add",className:"shrink-0 whitespace-nowrap",children:[o==="repo:add"?r.jsx(Be,{className:"mr-1.5 h-4 w-4 animate-spin","aria-hidden":!0}):r.jsx(xn,{className:"mr-1.5 h-4 w-4","aria-hidden":!0}),T("skills.repo.add")]})]}),e.length?r.jsx("div",{className:"mt-3 divide-y divide-oai-gray-200/70 dark:divide-oai-gray-800/70",children:e.map(l=>{const c=o===`repo:${l.owner}/${l.name}`;return r.jsxs("div",{className:"flex items-center justify-between gap-3 py-2",children:[r.jsxs("div",{className:"min-w-0",children:[r.jsxs("div",{className:"truncate text-sm font-medium text-oai-black dark:text-white",children:[l.owner,"/",l.name]}),r.jsx("div",{className:"text-xs text-oai-gray-500 dark:text-oai-gray-400",children:l.branch})]}),r.jsxs(Ue,{type:"button",variant:"ghost",size:"sm",disabled:c,onClick:()=>s(l),className:"shrink-0",children:[c?r.jsx(Be,{className:"h-3.5 w-3.5 animate-spin","aria-hidden":!0}):r.jsx(yn,{className:"h-3.5 w-3.5","aria-hidden":!0}),r.jsx("span",{className:"sr-only",children:T("skills.repo.remove")})]})]},`${l.owner}/${l.name}`)})}):null]})}function ro(){return typeof window>"u"?"my":new URLSearchParams(window.location.search).get("tab")==="browse"?"browse":"my"}function fo(){const[e,t]=a.useState(ro),[n,o]=a.useState({skills:[],targets:[]}),[d,s]=a.useState([]),[l,c]=a.useState([]),[x,p]=a.useState([]),[f,g]=a.useState(Ge),[y,I]=a.useState(""),[b,v]=a.useState(""),[E,u]=a.useState(""),[C,h]=a.useState(!1),[k,P]=a.useState(""),[H,Z]=a.useState(!0),[D,oe]=a.useState(!1),[ge,F]=a.useState(""),[Y,q]=a.useState(null),[J,re]=a.useState(null),K=a.useMemo(()=>{const i=new Set;for(const w of n.skills||[]){i.add(xt(w).toLowerCase()),w.repoOwner&&w.repoName&&i.add(`${w.repoOwner}/${w.repoName}:${w.sourceDirectory||w.directory}`.toLowerCase());const j=String(w.directory||"").split(/[\\/]/).pop().toLowerCase();j&&i.add(`dir:${j}`)}return i},[n.skills]),ee=a.useCallback(async()=>{const i=await _s();o({skills:i.skills||[],targets:i.targets||[]})},[]),S=a.useCallback(async()=>{const i=await Fs();p(i.repos||[])},[]),B=a.useCallback(async({force:i=!1}={})=>{oe(!0);try{const w=await Us({force:i});s(w.skills||[])}finally{oe(!1)}},[]),R=a.useCallback(async()=>{Z(!0),F("");try{await Promise.all([ee(),S()])}catch(i){F(i?.message||T("skills.error.generic"))}finally{Z(!1)}},[ee,S]),M=a.useCallback(async()=>{await R(),e==="browse"&&f!==je&&B({force:!0}).catch(i=>F(i?.message||T("skills.error.generic")))},[B,R,f,e]);a.useEffect(()=>{R()},[R]),a.useEffect(()=>{e==="browse"&&f!==je&&d.length===0&&B().catch(i=>F(i?.message||T("skills.error.generic")))},[d.length,B,f,e]),a.useEffect(()=>{if(!J)return;const i=setTimeout(()=>re(w=>w?.key===J.key?null:w),J.ttlMs||5e3);return()=>clearTimeout(i)},[J]),a.useEffect(()=>{const i=setTimeout(()=>v(y),200);return()=>clearTimeout(i)},[y]),a.useEffect(()=>{if(typeof window>"u")return;const i=new URLSearchParams(window.location.search),w=i.get("tab");if(e==="my"){if(!w)return;i.delete("tab")}else{if(w===e)return;i.set("tab",e)}const j=i.toString(),_=`${window.location.pathname}${j?`?${j}`:""}${window.location.hash}`;window.history.replaceState({},"",_)},[e]);const le=async(i,w)=>{P(i),F("");try{await w(),await ee()}catch(j){F(j?.message||T("skills.error.generic"))}finally{P("")}},O=(i,w)=>{const j=(w&&w.length?w:rn).filter(_=>(n.targets||[]).some(G=>G.id===_));le(sn(i),async()=>{await $s(i,j);const _=j.map(G=>(n.targets||[]).find(ve=>ve.id===G)?.label||G).join(", ");re({key:`${Date.now()}:install:${xt(i)}`,message:T("skills.toast.installed",{name:i.name||i.directory,targets:_||T("skills.target.none")}),ttlMs:4e3})})},he=i=>{q(i)},ae=()=>{const i=Y;i&&(q(null),le(Vt(i),async()=>{let w=null;i.managed?w=await Bs(i.id):await qs(i.directory,i.targets||[]);const j=!!(w?.trashed&&i.managed&&i.id);re({key:`${Date.now()}:${i.id||i.directory}`,message:T("skills.toast.removed",{name:i.name||i.directory}),undo:j?async()=>{try{await zs(i.id),await ee(),re(null)}catch(_){F(_?.message||T("skills.error.generic"))}}:null,ttlMs:5e3})}))},A=(i,w,j)=>le(On(i.id,w),async()=>{const _=new Set(i.targets||[]);j?_.add(w):_.delete(w),i.managed?await Ws(i.id,Array.from(_)):await Ks(i.directory,Array.from(_))}),z=async()=>{const i=y.trim();if(!(i.length<2)){P("search"),F("");try{const w=await Hs(i);c(w.skills||[])}catch(w){F(w?.message||T("skills.error.generic"))}finally{P("")}}},ue=async()=>{const i=E.trim().replace(/^https:\/\/github\.com\//,"").replace(/\.git$/,""),[w,j]=i.split("/");if(!w||!j){F(T("skills.repo.invalid"));return}await le("repo:add",async()=>{await Ys({owner:w,name:j,branch:"main",enabled:!0}),u(""),await S(),await B()})},ke=async i=>{await le(`repo:${i.owner}/${i.name}`,async()=>{await Gs(i.owner,i.name),await S(),await B()})},L=n.targets||[],ce=n.skills||[],te=a.useMemo(()=>{const i=f===je?l:d,w=f===je||f===Ge?i:i.filter(G=>`${G.repoOwner}/${G.repoName}`===f),j=b.trim().toLowerCase();return(f===je||!j?w:w.filter(G=>(G.name||"").toLowerCase().includes(j)||(G.directory||"").toLowerCase().includes(j)||(G.description||"").toLowerCase().includes(j))).map(G=>{const ve=xt(G).toLowerCase(),m=String(G.directory||"").split(/[\\/]/).pop().toLowerCase(),V=m?`dir:${m}`:"";return{...G,installed:K.has(ve)||V&&K.has(V)}})},[b,d,K,l,f]),pe=r.jsx("div",{className:"flex h-64 items-center justify-center",children:r.jsx(Be,{className:"h-8 w-8 animate-spin text-oai-gray-400","aria-hidden":!0})}),ye=r.jsxs("div",{className:"flex h-64 flex-col items-center justify-center gap-3 px-6 text-center",children:[r.jsx(Be,{className:"h-8 w-8 animate-spin text-oai-gray-400","aria-hidden":!0}),r.jsx("p",{className:"max-w-md text-xs text-oai-gray-500 dark:text-oai-gray-400",children:T("skills.browse.loading_hint")})]}),me=(i,w=null)=>r.jsxs("div",{className:"flex flex-col items-center gap-4 rounded-lg border border-dashed border-oai-gray-200 px-4 py-10 text-center text-sm text-oai-gray-500 dark:border-oai-gray-800 dark:text-oai-gray-400",children:[r.jsx("p",{children:T(i)}),w]});let X;if(H)X=pe;else if(e==="my")X=ce.length?r.jsx(Zs,{items:ce,targets:L,busyKey:k,onToggleTarget:A,onRemove:he}):r.jsxs("div",{className:"flex flex-col items-center gap-4 rounded-lg border border-dashed border-oai-gray-200 px-4 py-10 text-center dark:border-oai-gray-800",children:[L.length>0?r.jsxs("div",{className:"relative h-11 w-80 overflow-hidden","aria-hidden":!0,children:[r.jsx("div",{className:"pointer-events-none absolute inset-0",style:{maskImage:"linear-gradient(to right, transparent 8%, black 20%, black 32%, transparent 44%, transparent 56%, black 68%, black 80%, transparent 92%)",WebkitMaskImage:"linear-gradient(to right, transparent 8%, black 20%, black 32%, transparent 44%, transparent 56%, black 68%, black 80%, transparent 92%)"},children:r.jsx("div",{className:"absolute inset-y-0 left-0 flex w-max items-center animate-marquee-x",style:{filter:"blur(2.5px)"},children:[...L,...L].map((i,w)=>r.jsx("span",{className:"shrink-0 px-3",children:r.jsx(yt,{provider:i.id,size:30})},`b-${w}`))})}),r.jsx("div",{className:"pointer-events-none absolute inset-0",style:{maskImage:"linear-gradient(to right, transparent 28%, black 42%, black 58%, transparent 72%)",WebkitMaskImage:"linear-gradient(to right, transparent 28%, black 42%, black 58%, transparent 72%)"},children:r.jsx("div",{className:"absolute inset-y-0 left-0 flex w-max items-center animate-marquee-x",children:[...L,...L].map((i,w)=>r.jsx("span",{className:"shrink-0 px-3",children:r.jsx(yt,{provider:i.id,size:30})},`c-${w}`))})}),r.jsx("div",{className:"pointer-events-none absolute inset-y-0 left-0 w-20 bg-gradient-to-r from-oai-white to-transparent dark:from-oai-gray-900"}),r.jsx("div",{className:"pointer-events-none absolute inset-y-0 right-0 w-20 bg-gradient-to-l from-oai-white to-transparent dark:from-oai-gray-900"})]}):null,r.jsx("p",{className:"text-sm text-oai-gray-500 dark:text-oai-gray-400",children:T("skills.empty.my")}),r.jsx(Ue,{type:"button",size:"sm",onClick:()=>t("browse"),children:T("skills.empty.my_cta")})]});else{const i=f===je,w=x.length===0&&!i;let j;w?j=r.jsx("div",{className:"rounded-lg border border-dashed border-oai-gray-200 p-6 text-center dark:border-oai-gray-800",children:r.jsx("p",{className:"text-sm text-oai-gray-600 dark:text-oai-gray-300",children:T("skills.browse.empty_sources")})}):D&&!i?j=ye:i&&y.trim().length<2?j=r.jsx("div",{className:"rounded-lg border border-dashed border-oai-gray-200 px-4 py-6 text-center text-sm text-oai-gray-500 dark:border-oai-gray-800 dark:text-oai-gray-400",children:T("skills.browse.hint_skillssh")}):te.length?j=r.jsx("div",{className:"grid grid-cols-1 gap-4 md:grid-cols-2 xl:grid-cols-3",children:te.map(G=>r.jsx("div",{style:eo,children:r.jsx(to,{skill:G,installed:!!G.installed,installing:k===sn(G),allTargets:L,defaultTargets:rn,onInstall:O})},G.id||G.key))}):i?j=me("skills.empty.search"):j=me("skills.empty.browse");const _=w||C?r.jsx("div",{className:"mb-5",children:r.jsx(no,{repos:x,repoInput:E,onRepoInput:u,busyKey:k,onAdd:ue,onRemove:ke})}):null;X=r.jsxs(r.Fragment,{children:[_,j]})}return r.jsxs("div",{className:"flex flex-1 flex-col font-oai text-oai-black antialiased dark:text-oai-white",children:[r.jsx("main",{className:"flex-1 pb-12 pt-8 sm:pb-16 sm:pt-10",children:r.jsxs("div",{className:"mx-auto max-w-6xl px-4 sm:px-6",children:[r.jsxs("div",{className:"mb-6 flex items-end justify-between gap-4",children:[r.jsx("h1",{className:"text-3xl font-semibold tracking-tight text-oai-black dark:text-white sm:text-4xl",children:T("skills.page.title")}),r.jsxs(Ue,{type:"button",variant:"secondary",size:"sm",onClick:M,disabled:H||D,children:[r.jsx(Vn,{className:Je("mr-1.5 h-3.5 w-3.5",(H||D)&&"animate-spin"),"aria-hidden":!0}),T("skills.action.refresh")]})]}),r.jsx("div",{className:"mb-5 flex gap-6 border-b border-oai-gray-200 dark:border-oai-gray-800",children:[["my",T("skills.tab.my")],["browse",T("skills.tab.browse")]].map(([i,w])=>r.jsx("button",{type:"button","aria-pressed":e===i,onClick:()=>t(i),className:Je("-mb-px border-b-2 pb-2 text-sm font-medium transition-colors",e===i?"border-oai-black text-oai-black dark:border-white dark:text-white":"border-transparent text-oai-gray-500 hover:text-oai-black dark:text-oai-gray-400 dark:hover:text-white"),children:w},i))}),ge?r.jsx("div",{className:"mb-4 rounded-lg border border-red-200 bg-red-50 px-4 py-3 text-sm text-red-700 dark:border-red-900/60 dark:bg-red-950/30 dark:text-red-200",children:ge}):null,e==="browse"?r.jsxs("div",{className:"mb-5 flex flex-col gap-3 sm:flex-row sm:items-center",children:[r.jsx("div",{role:"tablist","aria-label":T("skills.source.label"),className:"inline-flex h-10 shrink-0 items-center rounded-md border border-oai-gray-200 bg-oai-white p-1 dark:border-oai-gray-800 dark:bg-oai-gray-900",children:[["repo",T("skills.mode.repo")],["skillssh",T("skills.mode.skillssh")]].map(([i,w])=>{const j=i==="skillssh"==(f===je);return r.jsx("button",{type:"button",role:"tab","aria-selected":j,onClick:()=>{i==="skillssh"?g(je):f===je&&g(Ge)},className:Je("rounded px-3 py-1 text-sm font-medium transition-colors",j?"bg-oai-gray-100 text-oai-black dark:bg-oai-gray-700 dark:text-white":"text-oai-gray-500 hover:text-oai-gray-800 dark:text-oai-gray-400 dark:hover:text-oai-gray-200"),children:w},i)})}),f!==je?r.jsxs(is,{value:f,onValueChange:g,children:[r.jsxs(ds,{"aria-label":T("skills.source.label"),className:"inline-flex h-10 w-44 shrink-0 items-center justify-between gap-2 rounded-md border border-oai-gray-200 bg-oai-white px-3 text-sm text-oai-black focus:outline-none data-[popup-open]:border-oai-gray-300 dark:border-oai-gray-800 dark:bg-oai-gray-900 dark:text-white dark:data-[popup-open]:border-oai-gray-700",children:[r.jsx(gs,{children:i=>i===Ge?T("skills.source.all"):i}),r.jsx(ms,{className:"text-oai-gray-400",children:r.jsx(pn,{className:"h-4 w-4","aria-hidden":!0})})]}),r.jsx(ps,{children:r.jsx(Ns,{sideOffset:4,alignItemWithTrigger:!1,className:"z-[60]",children:r.jsxs(Es,{className:"min-w-[var(--anchor-width)] overflow-hidden rounded-md border border-oai-gray-200 bg-white p-1 shadow-[0_12px_32px_-12px_rgba(0,0,0,0.18)] outline-none transition-[opacity,transform] duration-150 ease-out data-[ending-style]:scale-[0.97] data-[ending-style]:opacity-0 data-[starting-style]:scale-[0.97] data-[starting-style]:opacity-0 dark:border-oai-gray-800 dark:bg-oai-gray-950 dark:shadow-[0_12px_32px_-12px_rgba(0,0,0,0.6)]",children:[r.jsxs(en,{value:Ge,className:"flex cursor-default select-none items-center justify-between gap-2 rounded px-3 py-1.5 text-sm text-oai-black outline-none data-[highlighted]:bg-oai-gray-100 dark:text-white dark:data-[highlighted]:bg-oai-gray-800",children:[r.jsx(nn,{children:T("skills.source.all")}),r.jsx(tn,{children:r.jsx(nt,{className:"h-3.5 w-3.5","aria-hidden":!0})})]}),x.map(i=>{const w=`${i.owner}/${i.name}`;return r.jsxs(en,{value:w,className:"flex cursor-default select-none items-center justify-between gap-2 rounded px-3 py-1.5 text-sm text-oai-black outline-none data-[highlighted]:bg-oai-gray-100 dark:text-white dark:data-[highlighted]:bg-oai-gray-800",children:[r.jsx(nn,{children:w}),r.jsx(tn,{children:r.jsx(nt,{className:"h-3.5 w-3.5","aria-hidden":!0})})]},w)})]})})})]}):null,r.jsxs("div",{className:"relative flex-1",children:[r.jsx(Kt,{className:"pointer-events-none absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-oai-gray-400","aria-hidden":!0}),r.jsx(Pn,{value:y,onChange:i=>I(i.target.value),onKeyDown:i=>{i.key==="Enter"&&f===je&&z()},placeholder:f===je?T("skills.browse.placeholder_skillssh"):f===Ge?T("skills.browse.placeholder_all"):T("skills.browse.placeholder_repo",{repo:f}),className:"pl-9 !border-oai-gray-200 dark:!border-oai-gray-800 focus:!border-oai-gray-400 focus:!ring-oai-gray-400/20 dark:focus:!border-oai-gray-500 dark:focus:!ring-oai-gray-500/20"})]}),f===je?r.jsxs(Ue,{type:"button",onClick:z,disabled:y.trim().length<2||k==="search",className:"focus:!ring-oai-gray-400/30",children:[k==="search"?r.jsx(Be,{className:"mr-1.5 h-4 w-4 animate-spin","aria-hidden":!0}):r.jsx(Kt,{className:"mr-1.5 h-4 w-4","aria-hidden":!0}),T("skills.action.search")]}):r.jsxs(Ue,{type:"button",variant:"secondary",size:"sm",onClick:()=>h(i=>!i),"aria-expanded":C,className:"!h-10 shrink-0 whitespace-nowrap !border-oai-gray-200 dark:!border-oai-gray-800 hover:!border-oai-gray-300 dark:hover:!border-oai-gray-700 hover:!text-oai-black dark:hover:!text-white focus:!ring-oai-gray-400/30",children:[r.jsx(xn,{className:"mr-1.5 h-3.5 w-3.5","aria-hidden":!0}),T("skills.browse.manage_sources"),r.jsx("span",{className:"ml-1.5 rounded bg-oai-gray-100 px-1.5 py-0.5 text-xs font-medium text-oai-gray-600 dark:bg-oai-gray-800 dark:text-oai-gray-300",children:x.length})]})]}):null,X]})}),r.jsx(Ds,{open:!!Y,title:T("skills.confirm.remove_title",{name:Y?.name||Y?.directory||""}),description:Y?Y.managed?T("skills.confirm.remove_managed"):T("skills.confirm.remove_local"):"",confirmLabel:T("skills.action.remove"),cancelLabel:T("shared.action.cancel"),destructive:!0,busy:k===Vt(Y||{}),onCancel:()=>q(null),onConfirm:ae}),J?r.jsx("div",{className:"pointer-events-none fixed inset-x-0 bottom-6 z-[90] flex justify-center px-4",children:r.jsxs("div",{className:"pointer-events-auto flex max-w-md items-center gap-3 rounded-full bg-oai-black px-4 py-2 text-sm text-white shadow-lg dark:bg-white dark:text-oai-black",children:[r.jsx("span",{children:J.message}),J.undo?r.jsx("button",{type:"button",onClick:J.undo,className:"rounded-full px-2 py-0.5 text-xs font-semibold uppercase tracking-wide hover:bg-white/10 dark:hover:bg-oai-black/10",children:T("shared.action.undo")}):null]})}):null]})}export{fo as SkillsPage};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{c as T,D as e,B as o,az as P,ar as I,r as u,aA as B,R as D,a5 as p}from"./main-DTrs3jUq.js";import{u as E,T as K}from"./use-native-settings-DK8RelvO.js";import{F as v,S as z,a as $}from"./FadeIn-NAG8xImb.js";import{D as G}from"./download-DCjD_Xm9.js";import{C as R}from"./chevron-down-DGOV7_Uw.js";import"./Card-CTRPazyG.js";import"./use-reduced-motion-BsYZLRkk.js";const H=[["path",{d:"M7 7h10v10",key:"1tivn9"}],["path",{d:"M7 17 17 7",key:"1vkiza"}]],O=T("arrow-up-right",H),U=["todayTokens","todayCost"],F=[{id:"todayTokens",label:"Today Tokens",shortLabel:"Tokens",category:"tokens"},{id:"todayCost",label:"Today Cost",shortLabel:"Cost",category:"cost"},{id:"last7dTokens",label:"Last 7 Days",shortLabel:"7d",category:"tokens"},{id:"totalTokens",label:"Total Tokens",shortLabel:"Total",category:"tokens"},{id:"totalCost",label:"Total Cost",shortLabel:"All $",category:"cost"},{id:"claude5h",label:"Claude 5h Limit",shortLabel:"Cl 5h",category:"limits"},{id:"claude7d",label:"Claude 7d Limit",shortLabel:"Cl 7d",category:"limits"},{id:"codex5h",label:"Codex 5h Limit",shortLabel:"Cx 5h",category:"limits"},{id:"codex7d",label:"Codex 7d Limit",shortLabel:"Cx 7d",category:"limits"},{id:"cursorPlan",label:"Cursor Plan Limit",shortLabel:"Cu Plan",category:"limits"},{id:"cursorAuto",label:"Cursor Auto Limit",shortLabel:"Cu Auto",category:"limits"},{id:"cursorAPI",label:"Cursor API Limit",shortLabel:"Cu API",category:"limits"},{id:"geminiPro",label:"Gemini Pro Limit",shortLabel:"Gm Pro",category:"limits"},{id:"geminiFlash",label:"Gemini Flash Limit",shortLabel:"Gm Flash",category:"limits"},{id:"geminiLite",label:"Gemini Lite Limit",shortLabel:"Gm Lite",category:"limits"},{id:"kimiWeekly",label:"Kimi Weekly Limit",shortLabel:"Km Wk",category:"limits"},{id:"kimi5h",label:"Kimi 5h Limit",shortLabel:"Km 5h",category:"limits"},{id:"kimiTotal",label:"Kimi Total Limit",shortLabel:"Km Tot",category:"limits"},{id:"kiroMonth",label:"Kiro Monthly Limit",shortLabel:"Kr Mo",category:"limits"},{id:"kiroBonus",label:"Kiro Bonus Limit",shortLabel:"Kr Bn",category:"limits"},{id:"copilotPremium",label:"Copilot Premium Limit",shortLabel:"Co Prem",category:"limits"},{id:"copilotChat",label:"Copilot Chat Limit",shortLabel:"Co Chat",category:"limits"},{id:"antigravityClaude",label:"Antigravity Claude Limit",shortLabel:"Ag Cl",category:"limits"},{id:"antigravityGPro",label:"Antigravity Gemini Pro Limit",shortLabel:"Ag GPro",category:"limits"},{id:"antigravityFlash",label:"Antigravity Flash Limit",shortLabel:"Ag Fl",category:"limits"}];function N(t,i=F,s=2){const a=new Set(i.map(n=>n.id)),l=new Set,r=Array.isArray(t)?t.filter(n=>!a.has(n)||l.has(n)?!1:(l.add(n),!0)):[];return(r.length>0?r:U).slice(0,Math.max(1,Number(s)||2))}const X=264,Y=124,h="ui-rounded, -apple-system, system-ui",L=["#5A8CF2","#9973E6","#4DB8A6","#E68C59"],V={claude:"#C77DFF",codex:"#34C759",cursor:"#FFCC00",gemini:"#0A84FF"};function Z(t){return t>=.9?"#E64D4D":t>=.7?"#D9A633":"#33B866"}function y({size:t="sm",children:i}){const s=t==="lg",a=s?560:264,l=s?32:22;return e.jsx("div",{className:p("flex w-full items-center justify-center rounded-xl bg-oai-gray-100 dark:bg-oai-gray-950/60",s?"py-10 sm:py-14 px-6":"py-6 px-4"),children:e.jsx("div",{className:"overflow-hidden bg-white dark:bg-oai-gray-800 shadow-oai-md dark:shadow-[0_2px_4px_rgba(0,0,0,0.4),0_8px_24px_rgba(0,0,0,0.5)]",style:{width:"100%",maxWidth:a,aspectRatio:`${X} / ${Y}`,borderRadius:l},children:i})})}function q({size:t="sm"}){const i="M0,104 L14,104 C26,98 34,100 44,96 S58,88 68,92 80,100 90,94 102,80 112,82 126,92 136,88 150,74 162,76 178,88 188,86 204,72 216,74 236,84 250,80 L264,80",s=`${i} L264,124 L0,124 Z`,a=`sparkArea-${t}`;return e.jsx(y,{size:t,children:e.jsxs("svg",{viewBox:"0 0 264 124",className:"h-full w-full","aria-hidden":"true",children:[e.jsx("defs",{children:e.jsxs("linearGradient",{id:a,x1:"0",y1:"0",x2:"0",y2:"1",children:[e.jsx("stop",{offset:"0%",stopColor:"#0A84FF",stopOpacity:"0.18"}),e.jsx("stop",{offset:"100%",stopColor:"#0A84FF",stopOpacity:"0"})]})}),e.jsx("text",{x:"14",y:"20",className:"fill-oai-gray-500 dark:fill-oai-gray-400",fontSize:"8",fontWeight:"700",letterSpacing:"0.6",children:"TODAY"}),e.jsx("text",{x:"14",y:"46",className:"fill-oai-black dark:fill-white",fontSize:"22",fontWeight:"700",fontFamily:h,children:"203.2M"}),e.jsx("text",{x:"14",y:"60",className:"fill-oai-gray-500 dark:fill-oai-gray-400",fontSize:"8",fontWeight:"500",fontFamily:h,children:"$129.56 ±0%"}),e.jsx("text",{x:"134",y:"20",className:"fill-oai-gray-500 dark:fill-oai-gray-400",fontSize:"8",fontWeight:"700",letterSpacing:"0.6",children:"7 DAYS"}),e.jsx("text",{x:"134",y:"46",className:"fill-oai-black dark:fill-white",fontSize:"22",fontWeight:"700",fontFamily:h,children:"880.9M"}),e.jsx("text",{x:"134",y:"60",className:"fill-oai-gray-500 dark:fill-oai-gray-400",fontSize:"8",fontWeight:"500",fontFamily:h,children:"$673.61"}),e.jsx("path",{d:s,fill:`url(#${a})`,stroke:"none"}),e.jsx("path",{d:i,fill:"none",stroke:"#0A84FF",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round"})]})})}const C=(()=>{const s=[];for(let a=0;a<26;a++)for(let l=0;l<7;l++){const r=Math.sin((a+1)*12.9898+(l+1)*78.233+17)*43758.5453,c=Math.floor(Math.abs(r-Math.floor(r))*100);s.push({w:a,d:l,v:c})}return s})();function S(t,i){return t<18?i?"#262626":"#e5e5e5":t<38?"rgba(10, 132, 255, 0.28)":t<58?"rgba(10, 132, 255, 0.50)":t<80?"rgba(10, 132, 255, 0.75)":"#0A84FF"}function J(){return e.jsx(y,{children:e.jsxs("svg",{viewBox:"0 0 264 124",className:"h-full w-full","aria-hidden":"true",children:[e.jsx("g",{transform:`translate(${19.5}, 10)`,className:"hidden dark:inline",children:C.map(r=>e.jsx("rect",{x:r.w*(7.5+1.2),y:r.d*(8+1.2),width:7.5,height:8,rx:"1.3",fill:S(r.v,!0)},`d-${r.w}-${r.d}`))}),e.jsx("g",{transform:`translate(${19.5}, 10)`,className:"dark:hidden",children:C.map(r=>e.jsx("rect",{x:r.w*(7.5+1.2),y:r.d*(8+1.2),width:7.5,height:8,rx:"1.3",fill:S(r.v,!1)},`l-${r.w}-${r.d}`))}),e.jsx("text",{x:19.5,y:"102",className:"fill-oai-black dark:fill-white",fontSize:"10",fontWeight:"700",fontFamily:h,children:"10.3B"}),e.jsx("text",{x:19.5+30,y:"102",className:"fill-oai-gray-500 dark:fill-oai-gray-400",fontSize:"9",fontWeight:"500",children:"tokens · 202 active days"})]})})}function Q(){const t=[{name:"claude-opus-4-6",value:"586.4M",pct:59},{name:"claude-sonnet-4-5-20250929",value:"218.7M",pct:22},{name:"gpt-5.4",value:"80.6M",pct:8},{name:"composer-2-fast",value:"52.1M",pct:5}],i=22,s=28,a=14,l=236;return e.jsx(y,{children:e.jsx("svg",{viewBox:"0 0 264 124",className:"h-full w-full","aria-hidden":"true",children:t.map((r,c)=>{const n=s+c*i,g=L[c%L.length];return e.jsxs("g",{children:[e.jsx("circle",{cx:"18",cy:n-3,r:"2.5",fill:g}),e.jsx("text",{x:"26",y:n,className:"fill-oai-black dark:fill-white",fontSize:"9",fontWeight:"500",children:r.name}),e.jsx("text",{x:"218",y:n,textAnchor:"end",className:"fill-oai-gray-500 dark:fill-oai-gray-400",fontSize:"9",fontWeight:"600",fontFamily:h,children:r.value}),e.jsxs("text",{x:"250",y:n,textAnchor:"end",className:"fill-oai-gray-500 dark:fill-oai-gray-400",fontSize:"8",fontWeight:"600",fontFamily:h,children:[r.pct,"%"]}),e.jsx("rect",{x:a,y:n+4,width:l,height:"2.8",rx:"1.4",className:"fill-oai-gray-200 dark:fill-oai-gray-700"}),e.jsx("rect",{x:a,y:n+4,width:Math.max(l*(r.pct/100),4),height:"2.8",rx:"1.4",fill:g})]},r.name)})})})}function ee(){const t=[{label:"Claude · 7d",source:"claude",reset:"in 1d",pct:61},{label:"Claude · 5h",source:"claude",reset:"in 4h 28m",pct:4},{label:"Cursor",source:"cursor",reset:"in 25d",pct:51},{label:"Codex · weekly",source:"codex",reset:"in 1d",pct:32}],i=22,s=28,a=14,l=236;return e.jsx(y,{children:e.jsx("svg",{viewBox:"0 0 264 124",className:"h-full w-full","aria-hidden":"true",children:t.map((r,c)=>{const n=s+c*i,g=V[r.source],b=Z(r.pct/100);return e.jsxs("g",{children:[e.jsx("circle",{cx:"18",cy:n-3,r:"2.5",fill:g}),e.jsx("text",{x:"26",y:n,className:"fill-oai-black dark:fill-white",fontSize:"9",fontWeight:"500",children:r.label}),e.jsx("text",{x:"218",y:n,textAnchor:"end",className:"fill-oai-gray-500 dark:fill-oai-gray-400",fontSize:"8",fontWeight:"500",fontFamily:h,children:r.reset}),e.jsxs("text",{x:"250",y:n,textAnchor:"end",className:"fill-oai-black dark:fill-white",fontSize:"9",fontWeight:"700",fontFamily:h,children:[r.pct,"%"]}),e.jsx("rect",{x:a,y:n+4,width:l,height:"2.8",rx:"1.4",className:"fill-oai-gray-200 dark:fill-oai-gray-700"}),e.jsx("rect",{x:a,y:n+4,width:Math.max(l*(r.pct/100),4),height:"2.8",rx:"1.4",fill:b})]},r.label)})})})}function te(t){switch(t.category){case"cost":return"$8.42";case"limits":return"62%";default:return t.id==="last7dTokens"?"1.8B":"203M"}}function ae(t,i){switch(t){case"todayTokens":return o("menubar.metric.today_tokens");case"todayCost":return o("menubar.metric.today_cost");case"last7dTokens":return o("menubar.metric.last_7d_tokens");case"totalTokens":return o("menubar.metric.total_tokens");case"totalCost":return o("menubar.metric.total_cost");case"claude5h":return o("menubar.metric.claude_5h");case"claude7d":return o("menubar.metric.claude_7d");case"codex5h":return o("menubar.metric.codex_5h");case"codex7d":return o("menubar.metric.codex_7d");default:return i}}function ie(t,i){const s=new Set(i.map(l=>l.id)),a=t.filter(l=>s.has(l));for(const l of i){if(a.length>=2)break;a.includes(l.id)||a.push(l.id)}return a.slice(0,2)}function re({slotConfigs:t,showStats:i}){return e.jsx("div",{className:"flex justify-center rounded-xl bg-gradient-to-b from-oai-gray-100 to-oai-gray-200 px-6 py-8 dark:from-oai-gray-950/80 dark:to-oai-gray-900/80",children:e.jsxs("div",{className:"inline-flex items-stretch rounded-md shadow-[0_1px_3px_rgba(0,0,0,0.18)] ring-1 ring-black/10 dark:ring-white/10 px-3",style:{background:"linear-gradient(180deg, #2c2c2e 0%, #1c1c1e 100%)"},children:[e.jsx("div",{className:"flex items-center pl-2 pr-1 py-2.5",children:e.jsx("img",{src:"/clawd/mini/idle-tight.svg",alt:"","aria-hidden":"true",className:"block shrink-0",style:{height:22,width:"auto"},draggable:"false"})}),i?t.map(({slot:s,item:a},l)=>e.jsxs(D.Fragment,{children:[l>0?e.jsx("span",{className:"my-1 w-px bg-white/20","aria-hidden":"true"}):null,e.jsxs("div",{className:p("flex min-w-[52px] flex-col items-center justify-center py-1.5",l===0?"pl-1 pr-2":"px-2"),children:[e.jsx("span",{className:"text-[13px] font-semibold leading-none tabular-nums text-white",children:a?.previewValue||"--"}),e.jsx("span",{className:"mt-[2px] text-[6px] font-semibold uppercase leading-none text-white/75",children:a?.shortLabel||"Metric"})]})]},s)):null]})})}function se({slot:t,value:i,options:s,disabled:a,onChange:l}){const r=t===0?o("menubar.slot.primary"):o("menubar.slot.secondary");return e.jsxs("label",{className:"flex min-w-0 flex-col gap-1.5",children:[e.jsx("span",{className:"text-[11px] font-semibold uppercase tracking-[0.08em] text-oai-gray-500 dark:text-oai-gray-400",children:r}),e.jsxs("div",{className:"relative",children:[e.jsx("select",{value:i,disabled:a,"aria-label":r,onChange:c=>l(t,c.target.value),className:p("w-full appearance-none rounded-lg border border-oai-gray-200 bg-white px-3 py-2 pr-9 text-sm font-medium text-oai-black transition-colors hover:border-oai-gray-300 dark:border-oai-gray-800 dark:bg-oai-gray-900 dark:text-white dark:hover:border-oai-gray-700",a&&"cursor-not-allowed opacity-50 hover:border-oai-gray-200 dark:hover:border-oai-gray-800"),children:s.map(c=>e.jsx("option",{value:c.id,children:c.displayLabel},c.id))}),e.jsx(R,{className:"pointer-events-none absolute right-3 top-1/2 h-4 w-4 -translate-y-1/2 text-oai-gray-400","aria-hidden":"true"})]})]})}function A({label:t,hint:i,checked:s,disabled:a,onChange:l}){return e.jsxs("div",{className:"flex items-center justify-between gap-3 py-3",children:[e.jsxs("div",{className:"min-w-0",children:[e.jsx("p",{className:"text-sm font-medium text-oai-black dark:text-white",children:t}),i?e.jsx("p",{className:"mt-0.5 text-xs text-oai-gray-500 dark:text-oai-gray-400",children:i}):null]}),e.jsx(K,{checked:s,disabled:a,onChange:l,ariaLabel:t})]})}function le(){const{available:t,settings:i,setSetting:s}=E(),a=u.useMemo(()=>(Array.isArray(i?.menuBarAvailableItems)?i.menuBarAvailableItems:F).map(m=>({...m,displayLabel:ae(m.id,m.label),previewValue:te(m)})),[i?.menuBarAvailableItems]),l=Number(i?.menuBarMaxItems)||2,r=u.useMemo(()=>N(i?.menuBarItems,a,l),[a,l,i?.menuBarItems]),c=u.useMemo(()=>ie(r,a),[a,r]),n=i?.showStats!==!1,g=d=>{s("menuBarItems",N(d,a,l))},b=(d,m)=>{const x=[...c];x[d===0?1:0]!==m&&(x[d]=m,g(x))},k=[0,1].map(d=>{const m=c[d]||a[d]?.id||"",j=c[d===0?1:0],_=a.filter(f=>f.id===m||f.id!==j),W=a.find(f=>f.id===m);return{slot:d,currentValue:m,options:_,item:W}}),w=i?.animatedIcon!==!1;return e.jsxs("article",{className:"rounded-xl border border-oai-gray-200 bg-white p-5 transition-colors duration-200 dark:border-oai-gray-800 dark:bg-oai-gray-900 sm:p-6",children:[e.jsx(re,{slotConfigs:k,showStats:n}),e.jsx("div",{className:"mt-5 grid grid-cols-1 gap-3 sm:grid-cols-2 sm:gap-4",children:k.map(({slot:d,currentValue:m,options:x})=>e.jsx(se,{slot:d,value:m,options:x,disabled:!t||!n,onChange:b},d))}),e.jsxs("div",{className:"mt-5 divide-y divide-oai-gray-100 border-t border-oai-gray-100 dark:divide-oai-gray-800 dark:border-oai-gray-800",children:[e.jsx(A,{label:o("settings.menubar.showStats"),hint:t?o("settings.menubar.showStatsHint"):o("menubar.native_only"),checked:n,disabled:!t,onChange:()=>s("showStats",!n)}),e.jsx(A,{label:o("settings.menubar.animatedIcon"),hint:o("settings.menubar.animatedIconHint"),checked:w,disabled:!t,onChange:()=>s("animatedIcon",!w)})]})]})}function oe(){const[t,i]=u.useState("loading");return u.useEffect(()=>{if(typeof window>"u")return;if(B()){i("native");return}const s=(navigator.userAgent||"").toLowerCase(),a=/mac/.test(s)&&!/iphone|ipad/.test(s);i(a?"mac-web":"other")},[]),t}function ne(){const t=oe();return t==="loading"?e.jsx("div",{className:"h-10 w-40","aria-hidden":"true"}):t==="native"?e.jsxs("button",{type:"button",onClick:()=>P("openWidgetGallery"),className:"inline-flex h-10 items-center gap-2 rounded-lg bg-oai-black px-4 text-sm font-medium text-white transition-colors hover:bg-oai-gray-800 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-oai-brand-500 focus-visible:ring-offset-2 dark:bg-white dark:text-oai-black dark:hover:bg-oai-gray-200",children:[o("widgets.cta.open_gallery"),e.jsx(O,{className:"h-4 w-4","aria-hidden":"true"})]}):t==="mac-web"?e.jsxs("a",{href:"https://github.com/mm7894215/TokenTracker/releases/latest",target:"_blank",rel:"noopener noreferrer",className:"inline-flex h-10 items-center gap-2 rounded-lg bg-oai-black px-4 text-sm font-medium text-white no-underline transition-colors hover:bg-oai-gray-800 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-oai-brand-500 focus-visible:ring-offset-2 dark:bg-white dark:text-oai-black dark:hover:bg-oai-gray-200",children:[e.jsx(G,{className:"h-4 w-4","aria-hidden":"true"}),o("widgets.cta.download")]}):e.jsxs("span",{className:"inline-flex h-10 items-center gap-2 rounded-lg border border-oai-gray-200 bg-oai-gray-50 px-4 text-sm font-medium text-oai-gray-500 dark:border-oai-gray-800 dark:bg-oai-gray-900 dark:text-oai-gray-400",children:[e.jsx(I,{className:"h-4 w-4","aria-hidden":"true"}),o("widgets.cta.macos_only")]})}const ce=[{id:"summary",Preview:q,nameKey:"widgets.summary.name",descKey:"widgets.summary.description"},{id:"heatmap",Preview:J,nameKey:"widgets.heatmap.name",descKey:"widgets.heatmap.description"},{id:"topModels",Preview:Q,nameKey:"widgets.topModels.name",descKey:"widgets.topModels.description"},{id:"limits",Preview:ee,nameKey:"widgets.limits.name",descKey:"widgets.limits.description"}];function de({Preview:t,nameKey:i,descKey:s}){return e.jsxs("article",{className:"flex h-full flex-col rounded-xl border border-oai-gray-200 bg-white p-4 transition-colors duration-200 dark:border-oai-gray-800 dark:bg-oai-gray-900 sm:p-5",children:[e.jsx(t,{}),e.jsxs("div",{className:"mt-4",children:[e.jsx("h3",{className:"text-[15px] font-semibold text-oai-black dark:text-white",children:o(i)}),e.jsx("p",{className:"mt-1.5 text-sm leading-relaxed text-oai-gray-500 dark:text-oai-gray-400",children:o(s)})]})]})}function M({titleKey:t}){return e.jsx("h2",{className:"mb-4 text-xl font-semibold tracking-tight text-oai-black dark:text-white sm:mb-5 sm:text-2xl",children:o(t)})}function be(){return e.jsx("div",{className:"flex flex-col flex-1 text-oai-black dark:text-oai-white font-oai antialiased",children:e.jsx("main",{className:"flex-1 pt-8 sm:pt-10 pb-12 sm:pb-16",children:e.jsxs("div",{className:"mx-auto max-w-5xl px-4 sm:px-6",children:[e.jsx(v,{y:12,children:e.jsxs("header",{className:"mb-10 flex items-start justify-between gap-4 sm:mb-12",children:[e.jsx("h1",{className:"text-3xl font-semibold tracking-tight text-oai-black dark:text-white sm:text-4xl",children:o("widgets.page.title")}),e.jsx("div",{className:"shrink-0",children:e.jsx(ne,{})})]})}),e.jsx(v,{y:12,delay:.06,children:e.jsxs("section",{"aria-label":o("widgets.menubar.section.title"),className:"mb-12 sm:mb-14",children:[e.jsx(M,{titleKey:"widgets.menubar.section.title"}),e.jsx(le,{})]})}),e.jsxs("section",{"aria-label":o("widgets.gallery.section.title"),children:[e.jsx(M,{titleKey:"widgets.gallery.section.title"}),e.jsx(z,{staggerDelay:.08,initialDelay:.04,children:e.jsx("div",{className:"grid grid-cols-1 gap-4 lg:grid-cols-2 lg:gap-5",children:ce.map(({id:t,Preview:i,nameKey:s,descKey:a})=>e.jsx($,{children:e.jsx(de,{Preview:i,nameKey:s,descKey:a})},t))})})]})]})})})}export{be as WidgetsPage};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{c as o}from"./main-DTrs3jUq.js";const n=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],e=o("chevron-down",n);export{e as C};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{c as o}from"./main-DTrs3jUq.js";const a=[["path",{d:"M12 15V3",key:"m9g1x1"}],["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["path",{d:"m7 10 5 5 5-5",key:"brsn70"}]],e=o("download",a);export{e as D};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{R as c,D as n,a5 as i}from"./main-DTrs3jUq.js";function y(e){let r=0;const o=String(e??"");for(let a=0;a<o.length;a+=1)r=Math.imul(31,r)+o.charCodeAt(a)|0;return Math.abs(r)%360}function m(e){const r=String(e??"").trim();if(!r)return"?";const o=r.split(/\s+/).filter(Boolean);if(o.length>=2){const a=o[0][0]||"",t=o[1][0]||"";return`${a}${t}`.toUpperCase()}return r.slice(0,2).toUpperCase()}const g={sm:"h-7 w-7 min-h-7 min-w-7 text-[10px]",md:"h-8 w-8 min-h-8 min-w-8 text-[11px]",lg:"h-14 w-14 min-h-14 min-w-14 text-base"};function h({avatarUrl:e,displayName:r,seed:o,size:a="md",className:t}){const d=g[a]||g.md,p=y(o??r??""),s=typeof e=="string"?e.trim():"",[b,l]=c.useState(!1);return c.useEffect(()=>{l(!1)},[s]),s&&!b?n.jsx("img",{src:s,alt:"",referrerPolicy:"no-referrer",onError:()=>l(!0),className:i("rounded-full object-cover ring-1 ring-white/10",d,t)}):n.jsx("div",{className:i("flex shrink-0 items-center justify-center rounded-full font-semibold text-white ring-1 ring-white/10",d,t),style:{backgroundColor:`hsl(${p} 42% 34%)`},"aria-hidden":!0,children:m(r)})}const u=new Set(["/brand-logos/cursor.svg","/brand-logos/kiro.svg","/brand-logos/copilot.svg"]);function w({iconSrc:e,label:r}){return n.jsxs("span",{className:"inline-flex items-center gap-3",children:[e?n.jsx("img",{src:e,alt:"",width:16,height:16,className:`h-4 w-4 shrink-0 object-contain opacity-90 ${u.has(e)?"dark:invert":""}`}):null,n.jsx("span",{className:"whitespace-nowrap",children:r})]})}const x=[{key:"gpt_tokens",copyKey:"leaderboard.column.codex",icon:"/brand-logos/codex.svg"},{key:"claude_tokens",copyKey:"leaderboard.column.claude",icon:"/brand-logos/claude-code.svg"},{key:"gemini_tokens",copyKey:"leaderboard.column.gemini",icon:"/brand-logos/gemini.svg"},{key:"cursor_tokens",copyKey:"leaderboard.column.cursor",icon:"/brand-logos/cursor.svg"},{key:"kiro_tokens",copyKey:"leaderboard.column.kiro",icon:"/brand-logos/kiro.svg"},{key:"copilot_tokens",copyKey:"leaderboard.column.copilot",icon:"/brand-logos/copilot.svg"},{key:"kimi_tokens",copyKey:"leaderboard.column.kimi",icon:"/brand-logos/kimi.svg"},{key:"opencode_tokens",copyKey:"leaderboard.column.opencode",icon:"/brand-logos/opencode.svg"},{key:"openclaw_tokens",copyKey:"leaderboard.column.openclaw",icon:"/brand-logos/openclaw.svg"},{key:"hermes_tokens",copyKey:"leaderboard.column.hermes",icon:null},{key:"other_tokens",copyKey:"leaderboard.column.supplemental",icon:null}],f="sticky left-0 z-40 w-[72px] min-w-[72px] max-w-[72px] bg-white dark:bg-oai-gray-950 px-4 py-4 align-middle",_="sticky left-[71px] z-40 min-w-[200px] max-w-[min(260px,45vw)] border-l border-r border-oai-gray-200 dark:border-oai-gray-800 bg-white dark:bg-oai-gray-950 px-4 py-4 align-middle",v="sticky left-[71px] z-40 min-w-[6rem] border-l border-r border-oai-gray-200 dark:border-oai-gray-800 bg-white dark:bg-oai-gray-950 px-4 py-4";function K(e){return i("sticky left-0 z-30 w-[72px] min-w-[72px] max-w-[72px] px-4 py-4 whitespace-nowrap",e?"bg-oai-brand-50 dark:bg-emerald-950":"bg-white dark:bg-oai-gray-950 group-hover:bg-oai-gray-50 dark:group-hover:bg-oai-gray-900/60")}function T(e){return i("sticky left-[71px] z-30 hover:z-50 min-w-[200px] max-w-[min(260px,45vw)] border-l border-r border-oai-gray-200 dark:border-oai-gray-800 px-4 py-4 min-w-0",e?"bg-oai-brand-50 dark:bg-emerald-950":"bg-white dark:bg-oai-gray-950 group-hover:bg-oai-gray-50 dark:group-hover:bg-oai-gray-900/60")}function S(e){return i("sticky left-[71px] z-30 min-w-[6rem] border-l border-r border-oai-gray-200 dark:border-oai-gray-800 px-4 py-4 whitespace-nowrap","bg-white dark:bg-oai-gray-950")}export{f as L,_ as a,x as b,T as c,w as d,h as e,S as f,v as g,K as l};
|