PageSourceSearch

https://xyc.ai/static/js/async/416.03897561a4.js

js xyc.ai collected 2026-10-05 14:39:09 UTC 26,887 bytes, 1 lines download raw bytes

1"use strict";(self.rspackChunknewapi_web=self.rspackChunknewapi_web||[]).push([[416],{58246(e,t,r){let n;r.d(t,{F:()=>M});var s,a,o,l=r(68413),i=function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&0>t.indexOf(n)&&(r[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var s=0;for(n=Object.getOwnPropertySymbols(e);s<n.length;s++)0>t.indexOf(n[s])&&Object.prototype.propertyIsEnumerable.call(e,n[s])&&(r[n[s]]=e[n[s]])}return r};let d=l.createContext(null);d.displayName="ChartContext";var c=r(33049),u=r(23017),m=r(42496),h=r(63574),p=r(7e4);let x=e=>{let t=[];return l.Children.forEach(e,e=>{(0,c.A)(e)||((0,p.isFragment)(e)?t=t.concat(x(e.props.children)):t.push(e))}),t},g={onPointerDown:"pointerdown",onPointerUp:"pointerup",onPointerUpOutside:"pointerupoutside",onPointerTap:"pointertap",onPointerOver:"pointerover",onPointerMove:"pointermove",onPointerEnter:"pointerenter",onPointerLeave:"pointerleave",onPointerOut:"pointerout",onMouseDown:"mousedown",onMouseUp:"mouseup",onMouseUpOutside:"mouseupoutside",onMouseMove:"mousemove",onMouseOver:"mouseover",onMouseOut:"mouseout",onMouseEnter:"mouseenter",onMouseLeave:"mouseleave",onPinch:"pinch",onPinchStart:"pinchstart",onPinchEnd:"pinchend",onPan:"pan",onPanStart:"panstart",onPanEnd:"panend",onDrag:"drag",onDragStart:"dragstart",onDragEnter:"dragenter",onDragLeave:"dragleave",onDragOver:"dragover",onDragEnd:"dragend",onRightDown:"rightdown",onRightUp:"rightup",onRightUpOutside:"rightupoutside",onTouchStart:"touchstart",onTouchEnd:"touchend",onTouchEndOutside:"touchendoutside",onTouchMove:"touchmove",onTouchCancel:"touchcancel",onPress:"press",onPressUp:"pressup",onPressEnd:"pressend",onSwipe:"swipe",onDrop:"drop",onWeel:"wheel",onClick:"click",onDblClick:"dblclick"},f=Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},{onLegendItemHover:"legendItemHover",onLegendItemUnHover:"legendItemUnHover",onLegendItemClick:"legendItemClick",onLegendFilter:"legendFilter",onLegendSelectedDataChange:"legendSelectedDataChange"}),{onBrushStart:"brushStart",onBrushChange:"brushChange",onBrushEnd:"brushEnd",onBrushClear:"brushClear"}),{onPlayerPlay:"playerPlay",onPlayerPause:"playerPause",onPlayerEnd:"playerEnd",onPlayerChange:"playerChange",onPlayerForward:"playerForward",onPlayerBackward:"playerBackward"}),{onDataZoomChange:"dataZoomChange"}),{onScrollBarChange:"scrollBarChange"}),{onDimensionHover:"dimensionHover",onDimensionClick:"dimensionCl
1ick"}),{onInitialized:"initialized",onRendered:"rendered",onRenderFinished:"renderFinished",onAnimationFinished:"animationFinished",onLayoutStart:"layoutStart",onLayoutEnd:"layoutEnd"}),{onDrill:"drill"}),g),b=Object.keys(f).concat(Object.keys(g).map(e=>`${e}Filter`));Object.keys(g),Object.keys(g).reduce((e,t)=>(e[g[t]]=t,e),{});let v=(e,t=g)=>{let r={};return Object.keys(e).forEach(n=>{t[n]&&e[n]&&(r[n]=e[n])}),r},y=(e,t,r,n=g)=>{if(!t&&!r||!e)return!1;let s=r?v(r,n):null,a=t?v(t,n):null;return s&&Object.keys(s).forEach(t=>{a&&a[t]&&a[t]===s[t]||e.off(n[t],s[t])}),a&&Object.keys(a).forEach(r=>{if(!s||!s[r]||s[r]!==a[r]){let s=t[`${r}Filter`];s?e.on(n[r],s,a[r]):e.on(n[r],a[r])}}),!0};var j=r(75024);let N=`${j.H}_REACT_TOOLTIP`;var k=r(60140);let w=["children","hooks","ref",...b,"vchartConstructor","vchartConstrouctor","useSyncRender","skipFunctionDiff","onError","onReady","spec","container","options","morphConfig"],O={morph:!1,enableExitAnimation:!1},C=(e,t)=>`${e&&e.type&&(e.type.displayName||e.type.name)}-${t}`,F=l.forwardRef((e,t)=>{let[r,n]=(0,l.useState)(0),s=(0,l.useRef)({});(0,l.useImperativeHandle)(t,()=>{var e;return null==(e=s.current)?void 0:e.chart});let a=!!e.spec,o=(0,l.useRef)(!1),i=(0,l.useRef)((0,u.A)(e,w)),p=(0,l.useRef)(null),g=l.useRef(null),b=!!e.skipFunctionDiff,[v,j]=(0,l.useState)(null),F=e=>{let t;a&&e.spec?(t=e.spec,(0,m.A)(e.data)&&(t=Object.assign(Object.assign({},e.spec),{data:e.data}))):t=Object.assign(Object.assign({},i.current),p.current);let r=((e,t,r)=>{var n,s,a;let o,i=Object.assign({},null!=r?r:{});if((null==r?void 0:r.tooltipRender)?(o=r.tooltipRender,delete i.tooltipRender):t.tooltipRender&&(o=t.tooltipRender),o){let d;if((null==r?void 0:r.reserveDefaultTooltip)?(d=r.reserveDefaultTooltip,delete i.reserveDefaultTooltip):d=t.reserveDefaultTooltip,!d){let e=Object.assign({},null!=(s=null==(n=i.style)?void 0:n.panel)?s:{});e.padding=0,e.border=Object.assign(Object.assign({},e.border),{radius:0}),e.backgroundColor="unset",i.style=Object.assign(Object.assign({},null!=(a=i.style)?a:{}),{panel:e})}return Object.assign(Object.assign({},i),{updateElement:(t,r,n)=>{let{changePositionOnly:s}=n;if(!s){if(!d){t.style.width="auto",t.style.height="auto",t.style.minHeight="auto";for(let e=0;e<t.children.length;e++){let r=t.children[e];r.className!==N&&"none"!==r.style.display&&(r.style.display="none")}}e((0,k.createPortal)(l.createElement("div",{className:N},o(t,r,n)),t))}}})}return r})(j,e,t.tooltip);return r&&(t.tooltip=r),t},M=t=>{!o.current&&s.current&&s.current.chart&&(t&&y(s.current.chart,e,g.current,f),n(r+1),e.onReady&&e.onReady(s.current.chart,0===r))};return(0,l.useEffect)(()=>{var t,r,n,l;let d,m=a?null:(d={},x(e.children).map((e,t)=>{let r=e&&e.type&&e.type.parseSpec;if(r&&e.props){let n=r((0,c.A)(e.props.componentId)?Object.assign(Object.assign({},e.props),{componentId:C(e,t)}):e.props);n.isSingle?d[n.specName]=n.spec:(d[n.specName]||(d[n.specName]=[]),d[n.specName].push(n.spec))}}),d);if(!(null==(t=s.current)?void 0:t.chart)){let t;return a||(p.current=m),t=new(null!=(l=e.vchartConstructor)?l:e.vchartConstrouctor)(F(e),Object.assign(Object.assign({},e.options),{onError:e.onError,autoFit:!0,dom:e.container})),s.current=Object.assign(Object.assign({},s.current),{chart:t}),o.current=!1,s.current.chart&&(y(s.current.chart,e,g.current,f),s.current.chart.renderSync({reuse:!1}),M()),void(g.current=e)}if(a)return void((0,h.n)(g.current.spec,e.spec,{skipFunction:b})?g.current.data!==e.data&&(s.current.chart.updateFullDataSync(e.data),M(!0),g.current=e):(s.current.chart.updateSpecSync(F(e),void 0,null!=(r=e.morphConfig)?r:O),M(!0),g.current=e));let v=(0,u.A)(e,w);(0,h.n)(v,i.current,{skipFunction:b})&&(0,h.n)(m,p.current,{skipFunction:b})||(i.current=v,p.current=m,s.current.chart.updateSpecSync(F(e),void 0,null!=(n=e.morphConfig)?n:O),M(!0),g.current=e)},[e]),(0,l.useEffect)(()=>()=>{s&&s.current&&s.current.chart&&(s.current.chart.release(),s.current.chart=null),g.current=null,o.current=!0},[]),l.createElement(d.Provider,{value:s.current},x(e.children).map((e,t)=>{if("string"==typeof e)return null;let n=C(e,t);return l.createElement(l.Fragment,{key:n},l.cloneElement(e,{updateId:r,componentId:n}
1))}),v)}),M=(s="VChart",a={vchartConstructor:r(59668).Ay$},o&&o.length&&a.vchartConstructor&&a.vchartConstructor.useRegisters(o),(n=function(e,t="ChartContainer",r){let n=l.forwardRef((t,n)=>{let s=(0,l.useRef)(null),[a,o]=(0,l.useState)(!1),{className:d,style:c,width:u,height:m,id:h}=t,p=i(t,["className","style","width","height","id"]);return(0,l.useLayoutEffect)(()=>{o(!0)},[]),l.createElement("div",{ref:s,id:null==h?void 0:h.toString(),className:d,style:Object.assign({position:"relative",height:m||"100%",width:u||"100%"},c)},a?l.createElement(e,Object.assign({ref:n,container:s.current},r?r(p):p)):l.createElement(l.Fragment,null))});return n.displayName=t||e.name,n}(F,s,e=>a?Object.assign(e,a):e)).displayName=s,n)},38417(e,t,r){r.d(t,{Y:()=>a});var n=r(72361),s=r(28277);function a(e){let t,r,a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:20;if(!e||"string"!=typeof e)return(0,n.jsx)("div",{className:"bg-muted text-muted-foreground flex items-center justify-center rounded-full text-xs font-medium",style:{width:a,height:a},children:"?"});let o=e.trim();if(o.startsWith("local:"))return(0,n.jsx)("img",{src:`/logos/${o.slice(6)}`,alt:"","aria-hidden":"true",width:a,height:a,className:"dark:invert",style:{width:a,height:a}});if(!o)return(0,n.jsx)("div",{className:"bg-muted text-muted-foreground flex items-center justify-center rounded-full text-xs font-medium",style:{width:a,height:a},children:"?"});let l=o.split("."),i=l[0],d=s[i];if(d&&l.length>1&&d[l[1]]?(t=d[l[1]],r=2):(t=s[i],r=l.length>1&&/^[A-Z]/.test(l[1])?2:1),!t||"function"!=typeof t&&"object"!=typeof t){let e=o.charAt(0).toUpperCase();return(0,n.jsx)("div",{className:"bg-muted text-muted-foreground flex items-center justify-center rounded-full text-xs font-medium",style:{width:a,height:a},children:e})}let c={};for(let e=r;e<l.length;e++){let t=l[e];if(!t)continue;let r=t.indexOf("=");if(-1===r){c[t.trim()]=!0;continue}let n=t.slice(0,r).trim(),s=t.slice(r+1).trim();c[n]=function(e){if(null==e)return!0;let t=String(e).trim();return(t.startsWith("{")&&t.endsWith("}")&&(t=t.slice(1,-1).trim()),t.startsWith('"')&&t.endsWith('"')||t.startsWith("'")&&t.endsWith("'"))?t.slice(1,-1):"true"===t||"false"!==t&&(/^-?\d+(?:\.\d+)?$/.test(t)?Number(t):t)}(s)}return null==c.size&&null!=a&&(c.size=a),(0,n.jsx)(t,{...c})}},96087(e,t,r){r.d(t,{R:()=>o});var n=r(68413),s=r(4288);let a=null;function o(){let{resolvedTheme:e}=(0,s.D)(),[t,o]=(0,n.useState)(!1),l=(0,n.useRef)(null);return(0,n.useEffect)(()=>{let t=!1;return(async()=>{o(!1),a||(a=r.e(3573).then(r.bind(r,59668)).then(e=>e.ThemeManager));let n=await a;t||(l.current=n,n.setCurrentTheme("dark"===e?"dark":"light"),o(!0))})(),()=>{t=!0}},[e]),{resolvedTheme:e,themeReady:t}}},77935(e,t,r){r.d(t,{X:()=>n});let n={mode:"desktop-browser"}},12483(e,t,r){r.r(t),r.d(t,{component:()=>U});var n=r(72361),s=r(45064),a=r(82799),o=r(6702),l=r(18434),i=r(67267),d=r(20769),c=r(71114),u=r(81204);function m(e){return(0,n.jsx)(c.N_,{to:"/pricing/$modelId",params:{modelId:e.modelName},className:(0,u.cn)("decoration-foreground/30 hover:decoration-foreground underline decoration-1 underline-offset-4 transition-colors",e.className),children:e.children??e.modelName})}function h(e){return(0,n.jsx)(c.N_,{to:"/pricing",search:{vendor:e.vendor},className:(0,u.cn)("hover:text-foreground underline decoration-current/40 decoration-1 underline-offset-2 transition-colors hover:decoration-current",e.className),children:e.children??e.vendor})}function p(e){let t=e.value;if(!Number.isFinite(t)||0===t)return(0,n.jsx)("span",{className:(0,u.cn)("text-muted-foreground/80 font-mono tabular-nums",e.className),children:"0%"});let r=t>0;return(0,n.jsxs)("span",{className:(0,u.cn)("font-mono tabular-nums",r?"text-emerald-600 dark:text-emerald-400":"text-red-600 dark:text-red-400",e.className),children:[r?"↑":"↓",Math.abs(t).toFixed(Math.abs(t)>=100?0:1),"%"]})}var x=r(68413),g=r(58246),f=r(61631),b=r(96087),v=r(77935);function y(e){return!Number.isFinite(e)||e<=0?"0":e>=1e12?`${(e/1e12).toFixed(2)}T`:e>=1e9?`${(e/1e9).toFixed(e>=1e10?1:2)}B`:e>=1e6?`${(e/1e6).toFixed(e>=1e7?1:2)}M`:e>=1e3?`${(e/1e3).toFixed(e>=1e4?0:1)}
1K`:e.toLocaleString()}let j={today:"Token share by model author across the last 24 hours",week:"Token share by model author across the past few weeks",month:"Token share by model author across the past month",year:"Token share by model author across the past year",all:"Token share by model author since launch"},N={OpenAI:"#10a37f",Anthropic:"#d97757",Google:"#4285f4",DeepSeek:"#7c5cff",Alibaba:"#ff9900",xAI:"#1f2937",Meta:"#1877f2",Moonshot:"#0ea5e9",Zhipu:"#06b6d4",Mistral:"#ff7000",ByteDance:"#3b82f6",Tencent:"#22c55e",MiniMax:"#a855f7",Cohere:"#fb923c",Baidu:"#ef4444",Others:"#94a3b8"},k=["#0ea5e9","#22c55e","#a855f7","#f97316","#14b8a6","#eab308","#60a5fa","#84cc16","#6366f1","#10b981","#f43f5e","#0891b2","#94a3b8"];function w(e){let{t}=(0,o.Bd)(),{resolvedTheme:r,themeReady:s}=(0,b.R)(),a="dark"===r?"rgba(255, 255, 255, 0.68)":"rgba(15, 23, 42, 0.58)",l="dark"===r?"rgba(255, 255, 255, 0.12)":"rgba(15, 23, 42, 0.12)",i=(0,x.useMemo)(()=>(function(e){let t={},r=0;for(let n of e)N[n]?t[n]=N[n]:(t[n]=k[r%k.length],r+=1);return t})(e.history.vendors.map(e=>e.name)),[e.history]),d=(0,x.useMemo)(()=>{let t=new Map(e.history.vendors.map((e,t)=>[e.name,t]));return[...e.history.points].sort((e,r)=>{let n=e.ts.localeCompare(r.ts);return 0!==n?n:(t.get(e.vendor)??999)-(t.get(r.vendor)??999)})},[e.history]),c=(0,x.useMemo)(()=>0===d.length?null:{type:"bar",data:[{id:"vendor-share",values:d}],xField:"label",yField:"share",seriesField:"vendor",stack:!0,paddingInner:.12,legends:{visible:!1},color:{specified:i},axes:[{orient:"bottom",label:{style:{fill:a,fontSize:10},autoHide:!0,autoLimit:!0},tick:{visible:!1}},{orient:"left",min:0,max:1,label:{formatMethod:e=>`${Math.round(100*Number(e))}%`,style:{fill:a,fontSize:10}},grid:{visible:!0,style:{lineDash:[3,3],stroke:l}}}],tooltip:{mark:{content:[{key:e=>String(e?.vendor??""),value:e=>`${(100*Number(e?.share)).toFixed(1)}% \xb7 ${y(Number(e?.tokens)||0)}`}]},dimension:{title:{value:e=>String(e?.label??"")},content:[{key:e=>String(e?.vendor??""),value:e=>Number(e?.share)||0}],updateContent:e=>e.filter(e=>Number(e.value)>.001).sort((e,t)=>Number(t.value)-Number(e.value)).map(e=>({key:e.key,value:`${(100*Number(e.value)).toFixed(1)}%`}))}},animationAppear:{duration:500}},[l,a,i,d]),u=e.rows.slice(0,12),m=Math.ceil(u.length/2),h=u.slice(0,m),p=u.slice(m);return(0,n.jsxs)("section",{className:"bg-card overflow-hidden rounded-lg border",children:[(0,n.jsxs)("header",{className:"px-5 py-4",children:[(0,n.jsxs)("h2",{className:"text-foreground inline-flex items-center gap-2 text-base font-semibold",children:[(0,n.jsx)(f.rW1,{className:"text-primary size-4"}),t("Market Share")]}),(0,n.jsx)("p",{className:"text-muted-foreground mt-1 text-sm",children:t(j[e.period])})]}),(0,n.jsx)("div",{className:"px-5 pb-5",children:(0,n.jsx)("div",{className:"h-60 sm:h-72",children:s&&c?(0,n.jsx)(g.F,{spec:{...c,theme:"dark"===r?"dark":"light",background:"transparent"},option:v.X},`vendor-share-${r}-${e.period}`):(0,n.jsx)("div",{className:"text-muted-foreground/80 flex h-full items-center justify-center text-xs",children:t("No history data available")})})}),(0,n.jsxs)("div",{className:"border-t",children:[(0,n.jsxs)("header",{className:"px-5 pt-4 pb-2",children:[(0,n.jsx)("h3",{className:"text-foreground text-sm font-semibold",children:t("By model author")}),(0,n.jsx)("p",{className:"text-muted-foreground/80 mt-0.5 text-xs",children:t("Vendors ranked by aggregated token volume")})]}),0===u.length?(0,n.jsx)("div",{className:"text-muted-foreground/80 px-5 py-8 text-center text-sm",children:t("No vendor data available")}):(0,n.jsxs)("div",{className:"grid grid-cols-1 gap-x-8 px-5 pt-1 pb-4 md:grid-cols-2",children:[(0,n.jsx)(O,{rows:h,colourMap:i}),p.length>0&&(0,n.jsx)(O,{rows:p,colourMap:i})]})]})]})}function O(e){return(0,n.jsx)("ul",{children:e.rows.map(t=>{var r;return(0,n.jsxs)("li",{className:"flex items-center gap-3 py-2.5",children:[(0,n.jsxs)("span",{className:"text-muted-foreground/80 w-6 shrink-0 text-right font-mono text-xs tabular-nums",children:[t.rank,"."]}),(0,n.jsx)("span",{"aria-hidden":!0,className:"size-2.5 shrink-0 rounded-full",style:{backgroundColor:e.colourMap[t.vend
1or]??"#94a3b8"}}),(0,n.jsx)(h,{vendor:t.vendor,className:"text-foreground min-w-0 flex-1 truncate text-sm font-medium",children:t.vendor}),(0,n.jsxs)("div",{className:"shrink-0 text-right",children:[(0,n.jsx)("div",{className:"text-foreground font-mono text-sm font-semibold tabular-nums",children:y(t.total_tokens)}),(0,n.jsx)("div",{className:"text-muted-foreground/80 font-mono text-[11px] tabular-nums",children:!Number.isFinite(r=t.share)||r<=0?"0%":r<.001?"<0.1%":`${(100*r).toFixed(r<.01?2:1)}%`})]})]},t.vendor)})})}var C=r(38417);function F(e){let t=e.limit?e.rows.slice(0,e.limit):e.rows,r=Math.ceil(t.length/2),s=t.slice(0,r),a=t.slice(r),o=e.variant??"default";return 0===t.length?null:(0,n.jsxs)("div",{className:"grid grid-cols-1 gap-x-8 md:grid-cols-2",children:[(0,n.jsx)(M,{rows:s,variant:o}),a.length>0&&(0,n.jsx)(M,{rows:a,variant:o})]})}function M(e){let{t}=(0,o.Bd)(),r="compact"===e.variant;return(0,n.jsx)("ul",{children:e.rows.map(e=>(0,n.jsxs)("li",{className:r?"flex items-center gap-3 py-2":"flex items-center gap-3 py-2.5",children:[(0,n.jsxs)("span",{className:"text-muted-foreground/80 w-6 shrink-0 text-right font-mono text-xs tabular-nums",children:[e.rank,"."]}),(0,n.jsx)("span",{className:"shrink-0",children:(0,C.Y)(e.vendor_icon,r?20:22)}),(0,n.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,n.jsx)(m,{modelName:e.model_name,className:r?"text-foreground block truncate font-mono text-xs font-medium":"text-foreground block truncate font-mono text-sm font-medium",children:e.model_name}),(0,n.jsxs)("p",{className:r?"text-muted-foreground/80 truncate text-[11px] italic":"text-muted-foreground/80 truncate text-xs italic",children:[t("by")," ",(0,n.jsx)(h,{vendor:e.vendor,children:e.vendor.toLowerCase()})]})]}),(0,n.jsxs)("div",{className:"shrink-0 text-right",children:[(0,n.jsxs)("div",{className:r?"text-foreground font-mono text-xs font-semibold tabular-nums":"text-foreground font-mono text-sm font-semibold tabular-nums",children:[y(e.total_tokens),!r&&(0,n.jsxs)(n.Fragment,{children:[" ",(0,n.jsx)("span",{className:"text-muted-foreground/80 font-normal",children:t("tokens")})]})]}),(0,n.jsx)(p,{value:e.growth_pct,className:r?"text-[10px]":"text-[11px]"})]})]},e.model_name))})}let S={today:"Hourly token usage by model across the last 24 hours",week:"Weekly token usage by model across the past few weeks",month:"Daily token usage by model across the past month",year:"Weekly token usage by model across the past year",all:"Token usage by model since launch"};function E(e){let{t}=(0,o.Bd)(),{resolvedTheme:r,themeReady:s}=(0,b.R)(),a="dark"===r?"rgba(255, 255, 255, 0.68)":"rgba(15, 23, 42, 0.58)",l="dark"===r?"rgba(255, 255, 255, 0.12)":"rgba(15, 23, 42, 0.12)",i=(0,x.useMemo)(()=>{let t=new Map(e.history.models.map((e,t)=>[e.name,t]));return[...e.history.points].sort((e,r)=>{let n=e.ts.localeCompare(r.ts);return 0!==n?n:(t.get(e.model)??999)-(t.get(r.model)??999)})},[e.history]),d=(0,x.useMemo)(()=>e.rows.reduce((e,t)=>e+t.total_tokens,0),[e.rows]),c=(0,x.useMemo)(()=>0===i.length?null:{type:"bar",data:[{id:"models-history",values:i}],xField:"label",yField:"tokens",seriesField:"model",stack:!0,legends:{visible:!1},axes:[{orient:"bottom",label:{style:{fill:a,fontSize:10},autoHide:!0,autoLimit:!0},tick:{visible:!1}},{orient:"left",label:{formatMethod:e=>y(Number(e)),style:{fill:a,fontSize:10}},grid:{visible:!0,style:{lineDash:[3,3],stroke:l}}}],tooltip:{mark:{content:[{key:e=>String(e?.model??""),value:e=>y(Number(e?.tokens)||0)}]},dimension:{title:{value:e=>String(e?.label??"")},content:[{key:e=>String(e?.model??""),value:e=>Number(e?.tokens)||0}],updateContent:e=>{e.sort((e,t)=>Number(t.value)-Number(e.value));let r=e.reduce((e,t)=>e+(Number(t.value)||0),0),n=e.slice(0,10),s=e.slice(10),a=n.map(e=>({key:e.key,value:y(Number(e.value)||0)}));if(s.length>0){let e=s.reduce((e,t)=>e+(Number(t.value)||0),0);a.push({key:t("+{{count}} more",{count:s.length}),value:y(e)})}return a.unshift({key:t("Total:"),value:y(r)}),a}}},animationAppear:{duration:500}},[l,a,i,t]);return(0,n.jsxs)("section",{className:"bg-card overflow-hidden rounded-lg border",children:[(0,n.jsxs)("header",{className:"flex items-start justify-between gap-4 px-5 py-4",children:[(0,n.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,n.jsxs)("h2",{className:"text-foreground inline-flex items-center gap-2 text-base font-semibold",children:[(0,n.jsx)(f.VH9,{className:"text-primary size-4"}),t("Top Models")]}),(0,n.jsx)("p",{className:"text-muted-foreground mt-1 text-sm",children:t(S[e.period])})]}),(0,n.jsxs)("div",{className:"shrink-0 text-right",children:[(0,n.jsx)("div",{className:"text-foreground font-mono text-2xl font-semibold tabular-nums",children:y(d)}
1),(0,n.jsx)("div",{className:"text-muted-foreground/80 text-[10px] font-medium tracking-widest uppercase",children:t("tokens")})]})]}),(0,n.jsx)("div",{className:"px-5 pb-5",children:(0,n.jsx)("div",{className:"h-60 sm:h-72",children:s&&c?(0,n.jsx)(g.F,{spec:{...c,theme:"dark"===r?"dark":"light",background:"transparent"},option:v.X},`models-history-${r}-${e.period}`):(0,n.jsx)("div",{className:"text-muted-foreground/80 flex h-full items-center justify-center text-xs",children:t("No history data available")})})}),(0,n.jsxs)("div",{className:"border-t",children:[(0,n.jsxs)("header",{className:"px-5 pt-4 pb-2",children:[(0,n.jsxs)("h3",{className:"text-foreground inline-flex items-center gap-2 text-sm font-semibold",children:[(0,n.jsx)(f.XsU,{className:"size-3.5 text-amber-500"}),t("LLM Leaderboard")]}),(0,n.jsx)("p",{className:"text-muted-foreground/80 mt-0.5 text-xs",children:t("Compare the most popular models on the platform")})]}),0===e.rows.length?(0,n.jsx)("div",{className:"text-muted-foreground/80 px-5 py-8 text-center text-sm",children:t("No models match the selected filters")}):(0,n.jsx)("div",{className:"px-5 pt-1 pb-4",children:(0,n.jsx)(F,{rows:e.rows})})]})]})}function P(e){let{t}=(0,o.Bd)();return(0,n.jsxs)("section",{className:"grid grid-cols-1 gap-4 lg:grid-cols-2",children:[(0,n.jsx)(D,{title:t("Trending up"),description:t("Models climbing the leaderboard"),icon:(0,n.jsx)(f.ntg,{className:"size-4 text-emerald-500"}),children:0===e.movers.length?(0,n.jsx)(R,{label:t("No notable climbers right now")}):(0,n.jsx)("ul",{children:e.movers.map(e=>(0,n.jsx)(T,{row:e,intent:"up"},e.model_name))})}),(0,n.jsx)(D,{title:t("Trending down"),description:t("Models losing positions"),icon:(0,n.jsx)(f.klo,{className:"size-4 text-red-500"}),children:0===e.droppers.length?(0,n.jsx)(R,{label:t("No notable drops right now")}):(0,n.jsx)("ul",{children:e.droppers.map(e=>(0,n.jsx)(T,{row:e,intent:"down"},e.model_name))})})]})}function D(e){return(0,n.jsxs)("div",{className:"bg-card overflow-hidden rounded-lg border",children:[(0,n.jsxs)("header",{className:"border-b px-4 py-3",children:[(0,n.jsxs)("h3",{className:"text-foreground inline-flex items-center gap-2 text-sm font-semibold",children:[e.icon,e.title]}),(0,n.jsx)("p",{className:"text-muted-foreground/80 mt-0.5 text-xs",children:e.description})]}),(0,n.jsx)("div",{className:"py-1",children:e.children})]})}function R(e){return(0,n.jsx)("div",{className:"text-muted-foreground/80 px-4 py-6 text-center text-xs",children:e.label})}function T(e){return(0,n.jsxs)("li",{className:"flex items-center gap-3 px-4 py-2",children:[(0,n.jsx)("span",{className:"shrink-0",children:(0,C.Y)(e.row.vendor_icon,20)}),(0,n.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,n.jsx)(m,{modelName:e.row.model_name,className:"text-foreground block truncate font-mono text-xs font-medium",children:e.row.model_name}),(0,n.jsxs)("p",{className:"text-muted-foreground/80 truncate text-[11px]",children:["#",e.row.current_rank," ·"," ",(0,n.jsx)(h,{vendor:e.row.vendor,children:e.row.vendor.toLowerCase()})]})]}),(0,n.jsxs)("span",{className:(0,u.cn)("inline-flex shrink-0 items-center gap-0.5 font-mono text-xs font-semibold tabular-nums","up"===e.intent?"text-emerald-600 dark:text-emerald-400":"text-red-600 dark:text-red-400"),children:["up"===e.intent?(0,n.jsx)(f.F1e,{className:"size-3"}):(0,n.jsx)(f.gHb,{className:"size-3"}),Math.abs(e.row.rank_delta)]})]})}let _=[{id:"today",labelKey:"Today"},{id:"week",labelKey:"Week"},{id:"month",labelKey:"Month"},{id:"year",labelKey:"Year"},{id:"all",labelKey:"All-time"}];function I(e){let{t}=(0,o.Bd)();return(0,n.jsxs)("section",{className:"space-y-5",children:[(0,n.jsxs)("div",{className:"space-y-2",children:[(0,n.jsx)("p",{className:"text-muted-foreground text-xs font-medium tracking-widest uppercase",children:t("Leaderboards")}),(0,n.jsx)("h1",{className:"text-[clamp(1.75rem,4vw,2.5rem)] leading-[1.15] font-bold tracking-tight",children:t("Rankings")}),(0,n.jsx)("p",{className:"text-muted-foreground/80 max-w-2xl text-sm",children:t("Discover the most-used models and rising vendors on the platform, updated from live usage data.")})]}),(0,n.jsx)("div",{role:"tablist","aria-label":t("Period"),className:"border-border/60 flex items-center border-b",children:_.map(r=>{let s=e.period===r.id;return(0,n.jsxs)("button",{role:"tab",type:"button","aria-selected":s,onClick:()=>e.onPeriodChange(r.id),className:(0,u.cn)("focus-visible:ring-ring/40 relative -mb-px rounded-sm px-3 py-2 text-sm font-medium transition-colors focus-visible:ring-2 focus-visible:outline-none",s?"text-foreground":"text-muted-foreground hover:text-foreground"),children:[t(r.labelKey),(0,n.jsx)("span",{"aria-hidden":!0,
1className:(0,u.cn)("bg-foreground absolute inset-x-3 -bottom-px h-[2px] rounded-full transition-opacity",s?"opacity-100":"opacity-0")})]},r.id)})})]})}var L=r(53540),$=r(64577);async function B(e){return(await $.FH.get("/api/rankings",{params:{period:e}})).data}let A=["today","week","month","year","all"];function z(){return(0,n.jsxs)("div",{className:"space-y-6",children:[(0,n.jsx)(l.E,{className:"h-[420px] w-full rounded-xl"}),(0,n.jsx)(l.E,{className:"h-[360px] w-full rounded-xl"}),(0,n.jsx)(l.E,{className:"h-[180px] w-full rounded-xl"})]})}function H(e){let{t}=(0,o.Bd)();return(0,n.jsxs)("div",{className:"bg-card rounded-xl border border-dashed px-6 py-12 text-center",children:[(0,n.jsx)("h2",{className:"text-foreground text-base font-semibold",children:t("Unable to load rankings")}),(0,n.jsx)("p",{className:"text-muted-foreground mx-auto mt-2 max-w-md text-sm",children:e.message})]})}let U=function(){let{t:e}=(0,o.Bd)(),t=(0,s.S)({from:"/rankings/"}),r=(0,a.Z)(),l=A.includes(t.period)?t.period:"week",c=(0,L.I)({queryKey:["rankings",l],queryFn:()=>B(l),staleTime:3e5}),u=c.data?.data;return(0,n.jsx)(i.si,{showMainContainer:!1,children:(0,n.jsxs)("div",{className:"relative",children:[(0,n.jsx)("div",{"aria-hidden":!0,className:"pointer-events-none absolute inset-x-0 top-0 h-[600px] opacity-20 dark:opacity-[0.10]",style:{background:"radial-gradient(ellipse 60% 50% at 20% 20%, oklch(0.72 0.18 250 / 80%) 0%, transparent 70%), radial-gradient(ellipse 50% 40% at 80% 15%, oklch(0.65 0.15 200 / 60%) 0%, transparent 70%), radial-gradient(ellipse 40% 35% at 50% 70%, oklch(0.70 0.12 280 / 40%) 0%, transparent 70%)",maskImage:"linear-gradient(to bottom, black 40%, transparent 100%)",WebkitMaskImage:"linear-gradient(to bottom, black 40%, transparent 100%)"}}),(0,n.jsxs)(d.Z_,{className:"relative mx-auto w-full max-w-[1280px] space-y-8 px-3 pt-16 pb-10 sm:px-6 sm:pt-20 sm:pb-12 xl:px-8",children:[(0,n.jsx)(I,{period:l,onPeriodChange:e=>{r({to:"/rankings",search:t=>({...t,period:e})})}}),c.isLoading?(0,n.jsx)(z,{}):u?(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(E,{history:u.models_history,rows:u.models,period:l}),(0,n.jsx)(w,{history:u.vendor_share_history,rows:u.vendors,period:l}),(0,n.jsx)(P,{movers:u.top_movers,droppers:u.top_droppers})]}):(0,n.jsx)(H,{message:c.error instanceof Error?c.error.message:e("Unable to load rankings data")})]})]})})}}}]);

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.