1import{a as ke,u as Ne,q as Se,c as Ce,b as oe,t as n,j as e}from"./index-CZrt0PfL.js";import{b as o,R as we}from"./vchart-vendor-BG0XOKAT.js";import{B as Me,h as Le,a as ce}from"./BrandIcon-BpYYYcla.js";import{S as B}from"./SiteBadgeLink-D5U01ahR.js";import{M as ze}from"./ModernSelect-QLk4DW4I.js";import{R as de}from"./ResponsiveFilterPanel-P_4nI-bf.js";import{g as R}from"./modelBrand-BN8XqQO-.js";function he(i){return i.trim().toLowerCase()}function We(i){return!!(typeof i.description=="string"&&i.description.trim().length>0||Array.isArray(i.tags)&&i.tags.length>0||Array.isArray(i.supportedEndpointTypes)&&i.supportedEndpointTypes.length>0||Array.isArray(i.pricingSources)&&i.pricingSources.length>0)}function $e(i){return i.some(c=>!We(c))}function Ie(i,c){const x=new Map;for(const m of c)x.set(he(m.name),m);return i.map(m=>{const g=x.get(he(m.name));return g?{...m,description:g.description??null,tags:Array.isArray(g.tags)?g.tags:[],supportedEndpointTypes:Array.isArray(g.supportedEndpointTypes)?g.supportedEndpointTypes:[],pricingSources:Array.isArray(g.pricingSources)?g.pricingSources:[]}:m})}function N(i){return typeof i=="number"&&Number.isFinite(i)}function H(i){return N(i)?i>=3e3?"var(--color-danger)":i>=2e3?"color-mix(in srgb, var(--color-warning) 30%, var(--color-danger))":i>=1500?"color-mix(in srgb, var(--color-warning) 60%, var(--color-danger))":i>=1e3?"var(--color-warning)":i>500?"color-mix(in srgb, var(--color-success) 60%, var(--color-warning))":"var(--color-success)":"var(--color-text-muted)"}function ue(i){return N(i)?i>=3e3?"badge-error":i>=1e3?"badge-warning":"badge-success":"badge-muted"}function Q(i){return N(i)?`${i}ms`:"â"}function pe(i){return i==null?"badge-muted":i>=90?"badge-success":i>=60?"badge-warning":"badge-error"}function ge(i,c){return i.description&&i.description.trim().length>0?i.description:c?n("æ£å¨å 载模åå
æ°æ®..."):i.tags.length>0||i.supportedEndpointTypes.length>0||i.pricingSources.length>0?n("䏿¸¸æªæä¾æè¿°ææ¬ï¼ä½å·²åæ¥æ ç¾ãè½åæä»·æ ¼ä¿¡æ¯ã"):n("å½å䏿¸¸ä»
è¿å模å IDï¼æªè¿åæè¿°å段ã")}function xe(i){return i.quotaType===0?`${i.inputPerMillion??0}/${i.outputPerMillion??0} USD / 1M`:i.perCallInput!=null||i.perCallOutput!=null?`${i.perCallInput??0}/${i.perCallOutput??0} USD / call`:`${i.perCallTotal??0} USD / call`}const Be=[10,20,50];function Re(i,c,x,m){if(x==="name"){const d=i.name.localeCompare(c.name);return m==="asc"?d:-d}const g=d=>x==="successRate"?d.successRate??-1:x==="avgLatency"?N(d.avgLatency)?d.avgLatency:m==="asc"?Number.POSITIVE_INFINITY:Number.NEGATIVE_INFINITY:d[x]??0,j=g(i),S=g(c);return j===S?i.name.localeCompare(c.name):m==="desc"?S-j:j-S}function De(){const i=ke(),[c,x]=o.useState({models:[]}),[m,g]=o.useState(!0),[j,S]=o.useState(""),[d,C]=o.useState("accountCount"),[v,k]=o.useState("desc"),[p,X]=o.useState(null),[h,A]=o.useState(null),[Z,J]=o.useState(null),[W,D]=o.useState("card"),[me,T]=o.useState(1),[w,fe]=o.useState(20),[ee,se]=o.useState(null),[_,F]=o.use
1State(!1),[te,E]=o.useState(!1),[y,q]=o.useState(!1),f=Ne(),ne=Se(!f&&!_,220),M=o.useRef(0),$=o.useRef(0),ae=Ce(),O=o.useMemo(()=>{const s=new Map;for(const a of c.models)for(const t of a.pricingSources||[]){const r=String(t.siteName||"").trim(),l=Number(t.siteId);!r||!Number.isFinite(l)||l<=0||s.has(r)||s.set(r,Math.trunc(l))}return s},[c.models]),V=o.useCallback(async(s=!1)=>{var t;const a=++M.current;$.current+=1,q(!1),g(!0);try{const r=await oe.getModelsMarketplace({refresh:s,includePricing:!1});if(a!==M.current)return null;const l=r;return x(l),s&&((t=l.meta)!=null&&t.refreshRequested)&&(l.meta.refreshReused?i.info(n("模å广åºå·æ°è¿è¡ä¸")):l.meta.refreshQueued&&i.info(n("å·²å¼å§å·æ°æ¨¡å广åº"))),l}catch{return a!==M.current||x({models:[]}),null}finally{a===M.current&&g(!1)}},[i]),P=o.useCallback(async s=>{if(!$e(s))return;const a=++$.current,t=M.current;q(!0);try{const r=await oe.getModelsMarketplace({includePricing:!0});if(a!==$.current||t!==M.current)return;const l=r;x(u=>({...u,models:Ie(u.models,l.models),meta:l.meta??u.meta}))}catch{}finally{a===$.current&&q(!1)}},[]);o.useEffect(()=>{f&&(W!=="card"&&D("card"),_||F(!0))},[_,f,W]),o.useEffect(()=>{let s=!1,a=null;return(async()=>{const r=await V(!1);!r||s||(a=setTimeout(()=>{s||P(r.models)},1200))})(),()=>{s=!0,a&&clearTimeout(a),$.current+=1}},[P,V]);const je=o.useCallback(()=>{(async()=>{const s=await V(!0);s&&setTimeout(()=>{P(s.models)},600)})()},[P,V]);o.useEffect(()=>{const s=new URLSearchParams(ae.search).get("q")||"";S(s)},[ae.search]);const U=o.useMemo(()=>{const s=new Map;let a=0;for(const r of c.models){const l=R(r.name);if(l){const u=s.get(l.name);u?u.count++:s.set(l.name,{count:1,brand:l})}else a++}return{list:[...s.entries()].sort((r,l)=>l[1].count-r[1].count),otherCount:a}},[c.models]),ye=o.useMemo(()=>{const s=new Map;for(const a of c.models)for(const t of a.accounts)s.set(t.site,(s.get(t.site)||0)+1);return[...s.entries()].sort((a,t)=>t[1]-a[1])},[c.models]),I=o.useMemo(()=>{let s=c.models;if(h&&(h==="__other__"?s=s.filter(a=>!R(a.name)):s=s.filter(a=>{var t;return((t=R(a.name))==null?void 0:t.name)===h})),p&&(s=s.filter(a=>a.accounts.some(t=>t.site===p))),j){const a=j.toLowerCase();s=s.filter(t=>t.name.toLowerCase().includes(a))}return s},[c.models,j,p,h]),L=o.useMemo(()=>[...p?I.map(a=>{const t=a.accounts.filter(u=>u.site===p),r=a.pricingSources.filter(u=>u.siteName===p),l=t.map(u=>u.latency).filter(N);return{...a,accounts:t,pricingSources:r,accountCount:t.length,tokenCount:t.reduce((u,K)=>u+K.tokens.length,0),avgLatency:l.length>0?Math.round(l.reduce((u,K)=>u+K,0)/l.length):null}}):I].sort((a,t)=>Re(a,t,d,v)),[I,p,d,v]),z=Math.max(1,Math.ceil(L.length/w)),b=Math.min(me,z),ie=L.slice((b-1)*w,b*w);o.useEffect(()=>{T(1)},[j,p,h,w]);const ve=L.reduce((s,a)=>s+a.accountCount,0),be=(()=>{const s=new Set;for(const a of L)for(const t of a.accounts)s.add(t.id);return s.size})(),G=L.map(s=>s.avgLatency).filter(N),re=G.length>0?Math.round(G.reduce((s,a)=>s+a,0)/G.length):null,le=s=>{navigator.clipboard.writeText(s).catch(()=>{}),se(s),setTimeout(()=>se(null),1500)},Y=e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"filter-panel-section",children:[e.jsxs("div",{className:"filter-panel-title",children:[n("åç"),h&&e.jsx("button",{onClick:()=>A(null),children:n("éç½®")})]}),e.jsxs("div",{className:`filter-item ${h?"":"active"}`,onClick:()=>A(null),children:[e.jsx("span",{className:"filter-item-icon",style:{background:"var(--color-primary-light)",color:"var(--color-primary)"},children:"â"}),n("å
¨é¨åç"),e.jsx("span",{className:"filter-item-count",children:c.models.length})]}),U.list.map(([s,{count:a,brand:t}])=>e.jsxs("div",{className:`filter-item ${h===s?"active":""}`,onClick:()=>A(h===s?null:s),children:[e.jsx("span",{className:"filter-item-icon",style:{background:"var(--color-bg)",borderRadius:4,overflow:"hidden",display:"flex",alignItems:"center",justifyContent:"center"},children:e.jsx(Me,{brand:t,size:14,fallbackText:s})}),e.jsx("span",{style:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:s}),e.jsx("span",{className:"filter-item-count",children:a})]},s)),U.otherCount>0&&e.jsxs("div",{className:`filter-item ${h==="__other__"?"active":""}`,onClick:()=>A(h==="__other__"?null:"__other__"),children:[e.jsx("span",{className:"filter-item-icon",style:{background:"var(--color-bg)",color:"var(--color-text-muted)",fontSize:10,borderRadius:4},children:"?"}),n("å
¶ä»"),e.jsx("span",{className:"filter-item-count",children:U.otherCount})]})]}),e.jsxs("div",{className:"filter-panel-section",children:[e.jsxs("div",{className:"filter-panel-title",children:[n("ä¾åºå"),p&&e.jsx("button",{onClick:()=>X(null),children:n("éç½®")})]}),ye.map(([s,a])=>e.jsxs("div",{className:`filter-item ${p===s?"active":""}`,onClick:()=>X(p===s?null:s),children:[e.jsx("span",{className:"filter-item-icon",style:{background:Le(s),color:"white",fontSize:9,borderRadius:4},children:s.slice(0,2).toUpperCase()}),e.jsx("span",{style:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:s}),e.jsx("span",{className:"filter-item-count",children:a})]},s))]}),e.jsxs("div",{className:"filter-panel-section",children:[e.jsx("div",{className:"filter-panel-title",children:n("æåºæ¹å¼")}),[{key:"accountCount",label:n("è´¦å·æ°")},{key:"tokenCount",label:n("ä»¤çæ°")},{key:"avgLatency",label:n("å»¶è¿")},{key:"successRate",label:n("æåç")},{key:"name",label:n("åç§°")}].map(s=>e.jsxs("div",{className:`filter-item ${d===s.key?"active":""}`,onClick:()=>{d===s.key?k(a=>a==="asc"?"desc":"asc"):(C(s.key),k(s.key==="name"?"asc":"desc"))},children:[s.label,d===s.key&&e.jsx("span",{style:{marginLeft:"auto",fontSize:11,color:"var(--color-primary)"},children:v==="desc"?"â":"â"})]},s.key))]})]});return m?e.jsxs("div",{className:"animate-fade-in",style:{display:"flex",gap:24,minHeight:400},children:[!f&&e.jsx("div",{style:{width:240},children:[...Array(6)].map((s,a)=>e.jsx("div",{className:"skeleton",style:{height:28,marginBottom:8,borderRadius:8}},a))}),e.jsxs("div",{style:{flex:1,minWidth:0},children:[e.jsxs("div",{className:"page-header",style:{marginBottom:16},children:[e.jsxs("div",{children:[e.jsx("div",{className:"skeleton",style:{width:220,height:28,marginBottom:8}}),e.jsx("div",{className:"skeleton",style:{width:160,height:16}})]}),e.jsx("div",{className:"page-actions",children:f&&e.jsxs("button",{className:"btn btn-ghost",style:{border:"1px solid var(--color-border)",padding:"6px 12px"},onClick:()=>E(!0),children:[e.jsx("svg",{width:"14",height:"14",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M3 4a1 1 0 011-1h16a1 1 0 011 1v2.586a1 1 0 01-.293.707l-6.414 6.414a1 1 0 00-.293.707V17l-4 4v-6.586a1 1 0 00-.293-.707L3.293 7.293A1 1 0 013 6.586V4z"})}),n("çé")]})})]}),e.jsx(de,{isMobile:f,mobileOpen:te,onMobileClose:()=>E(!1),mobileTitle:n("ç鿍¡å"),mobileContent:Y}),[...Array(4)].map((s,a)=>e.jsx("div",{className:"skeleton",style:{height:100,marginBottom:12,borderRadius:12}},a))]})]}):e.jsxs("div",{className:"animate-fade-in",style:{display:"flex",gap:24,minHeight:400},children:[!f&&ne.shouldRender&&e.jsxs("div",{className:`filter-panel filter-collapsible ${ne.isVisible?"":"is-closing"}`.trim(),children:[Y,e.jsx("button",{className:"btn btn-ghost",style:{width:"100%",fontSize:12,padding:"6px 10px",marginTop:8,justifyContent:"center",border:"1px solid var(--color-border)"},onClick:()=>F(!0),children:n("æ¶èµ·")})]}),e.jsxs("div",{style:{flex:1,minWidth:0},children:[e.jsxs("div",{className:"page-header",style:{marginBottom:16},children:[e.jsxs("div",{children:[e.jsxs("h2",{className:"page-title",style:{display:"flex",alignItems:"center",gap:8},children:[h||p||n("模å广åº"),e.jsxs("span",{className:"badge badge-info",style:{fontSize:12,fontWeight:500},children:[n("å
±")," ",I.length," ",n("个模å")]})]}),(h||p)&&e.jsx("p",{style:{fontSize:12,color:"var(--color-text-muted)",margin:"4px 0 0"},children:h&&h!=="__other__"?`${n("æ¥ç")} ${h} ${n("åççæææ¨¡å")}`:p?`${n("æ¥èªä¾åºå")}
1 ${p} ${n("çæ¨¡å")}`:n("å
¶ä»æªå½ç±»ç模å")})]}),e.jsxs("div",{className:"page-actions",children:[(f||_)&&e.jsxs("button",{className:"btn btn-ghost",style:{border:"1px solid var(--color-border)",padding:"6px 12px"},onClick:()=>{if(f){E(!0);return}F(!1)},children:[e.jsx("svg",{width:"14",height:"14",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M3 4a1 1 0 011-1h16a1 1 0 011 1v2.586a1 1 0 01-.293.707l-6.414 6.414a1 1 0 00-.293.707V17l-4 4v-6.586a1 1 0 00-.293-.707L3.293 7.293A1 1 0 013 6.586V4z"})}),n("çé")]}),e.jsx("button",{onClick:je,className:"btn btn-ghost",style:{border:"1px solid var(--color-border)",padding:"6px 12px"},children:e.jsx("svg",{width:"14",height:"14",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M4 4v5h.582m15.356 2A8.001 8.001 0 004.582 9m0 0H9m11 11v-5h-.581m0 0a8.003 8.003 0 01-15.357-2m15.357 2H15"})})}),y&&e.jsx("span",{className:"badge badge-muted",style:{fontSize:11},children:n("å è½½å
æ°æ®ä¸...")}),!f&&e.jsxs("div",{className:"view-toggle",children:[e.jsx("button",{className:`view-toggle-btn ${W==="card"?"active":""}`,onClick:()=>D("card"),"data-tooltip":n("å¡çè§å¾"),"aria-label":n("å¡çè§å¾"),children:e.jsx("svg",{width:"14",height:"14",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M4 6h16M4 10h16M4 14h16M4 18h16"})})}),e.jsx("button",{className:`view-toggle-btn ${W==="table"?"active":""}`,onClick:()=>D("table"),"data-tooltip":n("è¡¨æ ¼è§å¾"),"aria-label":n("è¡¨æ ¼è§å¾"),children:e.jsx("svg",{width:"14",height:"14",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M3 10h18M3 14h18M3 6h18M3 18h18M10 3v18M14 3v18"})})})]})]})]}),e.jsx(de,{isMobile:f,mobileOpen:te,onMobileClose:()=>E(!1),mobileTitle:n("ç鿍¡å"),mobileContent:Y}),e.jsxs("div",{className:"toolbar",children:[e.jsxs("div",{className:"toolbar-search",children:[e.jsx("svg",{width:"14",height:"14",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0z"})}),e.jsx("input",{value:j,onChange:s=>S(s.target.value),placeholder:n("æç´¢æ¨¡åï¼æ¯æåç§°çæ®µï¼")})]}),e.jsxs("div",{style:{display:"flex",gap:16,fontSize:12,color:"var(--color-text-muted)",alignItems:"center"},children:[e.jsxs("span",{"data-tooltip":n("æææ¨¡å accountCount 累计å¼ï¼åä¸è´¦å·å¨å¤ä¸ªæ¨¡åä¸ä¼éå¤è®¡æ°"),children:[n("è¦çæ¡£ä½")," ",e.jsx("b",{style:{color:"var(--color-text-primary)"},children:ve})]}),e.jsxs("span",{"data-tooltip":n("å½åçéèå´å
å»éåçå¯ä¸è´¦å·æ°"),children:[n("å»éè´¦å·")," ",e.jsx("b",{style:{color:"var(--color-text-primary)"},children:be})]}),e.jsxs("span",{children:[n("å¹³åå»¶è¿")," ",e.jsx("b",{style:{color:H(re)},children:Q(re)})]})]})]}),L.length===0?e.jsxs("div",{className:"empty-state",children:[e.jsx("div",{className:"empty-state-icon",children:e.jsx("svg",{width:"40",height:"40",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1,d:"M19.428 15.428a2 2 0 00-1.022-.547l-2.387-.477a6 6 0 00-3.86.517l-.318.158a6 6 0 01-3.86.517L6.05 15.21a2 2 0 00-1.806.547M8 4h8l-1 1v5.172a2 2 0 00.586 1.414l5 5c1.26 1.26.367 3.414-1.415 3.414H4.828c-1.782 0-2.674-2.154-1.414-3.414l5-5A2 2 0 009 10.172V5L8 4z"})})}),e.jsx("div",{className:"empty-state-title",children:n("ææ æ¨¡åç»æ")}),e.jsx("div",{className:"empty-state-desc",children:n("请å
æ£æ¥ç«ç¹ä¸è´¦å·ç¶æï¼ç¶åç¹å»å·æ°ã")})]}):W==="card"?e.jsx("div",{children:ie.map(s=>{const a=Z===s.name;return e.jsxs("div",{className:"model-card",onClick:()=>J(a?null:s.name),children:[e.jsxs("div",{className:"model-card-header",children:[e.jsx(ce,{model:s.name,size:44}),e.jsxs("div",{className:"model-card-info",children:[e.jsx("div",{className:"model-card-name",children:s.name}),e.jsxs("div",{className:"model-card-meta",children:[e.jsxs("span",{children:[e.jsx("svg",{width:"12",height:"12",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M17 20h5v-2a3 3 0 00-5.356-1.857M17 20H7m10 0v-2c0-.656-.126-1.283-.356-1.857M7 20H2v-2a3 3 0 015.356-1.857M7 20v-2c0-.656.126-1.283.356-1.857m0 0a5.002 5.002 0 019.288 0M15 7a3 3 0 11-6 0 3 3 0 016 0z"})}),s.accountCount," ",n("个账å·")]}),e.jsxs("span",{children:[e.jsx("svg",{width:"12",height:"12",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M15 7a2 2 0 012 2m4 0a6 6 0 01-7.743 5.743L11 17H9v2H7v2H4a1 1 0 01-1-1v-2.586a1 1 0 01.293-.707l5.964-5.964A6 6 0 1121 9z"})}),s.tokenCount," ",n("令ç")]}),e.jsxs("span",{className:`badge ${ue(s.avgLatency)}`,style:{fontVariantNumeric:"tabular-nums"},"data-tooltip":n("å¹³åå»¶è¿"),children:[n("å»¶è¿")," ",Q(s.avgLatency)]}),e.jsxs("span",{className:`badge ${pe(s.successRate)}`,style:{fontVariantNumeric:"tabular-nums"},"data-tooltip":n("æåç"),children:[n("æåç")," ",s.successRate!=null?`${s.successRate}%`:"â"]})]})]}),e.jsxs("div",{className:"model-card-actions",onClick:t=>t.stopPropagation(),children:[e.jsx("button",{className:"model-card-action-btn","data-tooltip":n("å¤å¶æ¨¡åå"),"aria-label":n("å¤å¶æ¨¡åå"),onClick:()=>le(s.name),children:ee===s.name?e.jsx("svg",{width:"14",height:"14",fill:"none",viewBox:"0 0 24 24",stroke:"var(--color-success)",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M5 13l4 4L19 7"})}):e.jsx("svg",{width:"14",height:"14",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M8 16H6a2 2 0 01-2-2V6a2 2 0 012-2h8a2 2 0 012 2v2m-6 12h8a2 2 0 002-2v-8a2 2 0 00-2-2h-8a2 2 0 00-2 2v8a2 2 0 002 2z"})})}),e.jsx("button",{className:"model-card-action-btn","data-tooltip":a?n("æ¶èµ·"):n("å±å¼"),"aria-label":a?n("æ¶èµ·"):n("å±å¼"),children:e.jsx("svg",{width:"14",height:"14",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",style:{transform:a?"rotate(180deg)":"none",transition:"transform 0.2s"},children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M19 9l-7 7-7-7"})})})]})]}),e.jsxs("div",{className:"model-card-tags",children:[R(s.name)&&e.jsx("span",{className:"model-tag model-tag-purple",children:R(s.name).name}),s.accounts.map(t=>t.site).filter((t,r,l)=>l.indexOf(t)===r).map(t=>e.jsx("span",{className:"model-tag model-tag-blue",children:t},t)),s.successRate!=null&&s.successRate>=90&&e.jsx("span",{className:"model-tag model-tag-green",children:n("å¥åº·")}),s.successRate!=null&&s.successRate<60&&e.jsx("span",{className:"model-tag model-tag-orange",children:n("é£é©")}),N(s.avgLatency)&&s.avgLatency<=500&&e.jsx("span",{className:"model-tag model-tag-purple",children:n("ä½å»¶è¿")})]}),a?e.jsx("div",{className:"anim-collapse is-open",onClick:t=>t.stopPropagation(),children:e.jsx("div",{className:"anim-collapse-inner",children:e.jsxs("div",{className:"model-card-expand",children:[e.jsxs("div",{style:{display:"grid",gap:8,marginBottom:10},children:[e.jsxs("div",{className:"card",style:{padding:10},children:[e.jsx("div",{style:{fontSize:12,fontWeight:600,marginBottom:6},children:n("åºç¡ä¿¡æ¯")}),e.jsx("div",{style:{fontSize:12,color:"var(--color-text-secondary)",lineHeight:1.6},children:ge(s,y)}),e.jsx("div",{style:{display:"flex",gap:6,flexWrap:"wrap",marginTop:8},children:s.tags.length>0?s.tags.map(t=>e.jsx("span",{className:"badge badge-info",children:t},t)):e.jsx("span",{className:"badge badge-muted",children:y?n("å è½½å
æ°æ®ä¸..."):n("ææ æ ç¾")})})]}),e.jsxs("div",{className:"card",style:{padding:10},children:[e.jsx("div",{style:{fontSize:12,fontWeight:600,marginBottom:6},children:n("æ¥å£è½å")}),e.jsx("div",{style:{display:"flex",gap:6,flexWrap:"wrap"},children:s.supportedEndpointTypes.length>0?s.supportedEndpointTypes.map(t=>e.jsx("span",{className:"badge badge-success",children:t},t)):e.jsx("span",{className:"badge badge-muted",children:y?n("å è½½å
æ°æ®ä¸..."):n("æªæä¾")})})]}),e.jsxs("div",{className:"card",style:{padding:10},children:[e.jsx("div",{style:{fontSize:12,fontWeight:600,marginBottom:6},children:n("åç»è®¡è´¹")}),s.pricingSources.length>0?e.jsx("div",{style:{display:"grid",gap:8},children:s.pricingSources.map(t=>e.jsxs("div",{style:{border:"1px solid var(--color-border-light)",borderRadius:8,padding:8},children:[e.jsxs("div",{style:{fontSize:12,marginBottom:6},children:[e.jsx(B,{siteId:t.siteId,siteName:t.siteName,badgeStyle:{fontSize:11}})," · ",t.username||`ID:${t.accountId}`]}),e.jsx("div",{style:{display:"flex",gap:6,flexWrap:"wrap"},children:Object.entries(t.groupPricing).map(([r,l])=>e.jsxs("span",{className:"badge badge-info",children:[r,": ",xe(l)]},r))})]},`${t.siteId}-${t.accountId}`))}):e.jsx("span",{className:"badge badge-muted",children:y?n("æ£å¨å è½½ä»·æ ¼å
æ°æ®..."):n("ææ ä»·æ ¼å
æ°æ®")})]})]}),f?e.jsxs("div",{style:{display:"grid",gap:8},children:[e.jsx("div",{style:{fontSize:12,fontWeight:600,color:"var(--color-text-secondary)"},children:n("è´¦å·æç»")}),s.accounts.map(t=>e.jsxs("div",{className:"card",style:{padding:10,display:"grid",gap:8},children:[e.jsxs("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",gap:8,flexWrap:"wrap"},children:[e.jsx(B,{siteId:O.get(t.site),siteName:t.site,badgeClassName:"badge badge-info",badgeStyle:{fontSize:11}}),e.jsx("span",{style:{fontSize:12,color:"var(--color-text-secondary)"},children:t.username||`ID:${t.id}`})]}),e.jsxs("div",{style:{display:"grid",gap:6},children:[e.jsxs("div",{style:{display:"flex",justifyContent:"space-between",gap:12,fontSize:12},children:[e.jsx("span",{style:{color:"var(--color-text-muted)"},children:n("å»¶è¿")}),e.jsx("span",{style:{color:H(t.latency),fontVariantNumeric:"tabular-nums"},children:t.latency!=null?`${t.latency}ms`:"â"})]}),e.jsxs("div",{style:{display:"flex",justifyContent:"space-between",gap:12,fontSize:12},children:[e.jsx("span",{style:{color:"var(--color-text-muted)"},children:n("ä½é¢")}),e.jsxs("span",{style:{fontVariantNumeric:"tabular-nums"},children:["$",(t.balance||0).toFixed(2)]})]}),e.jsxs("div",{style:{display:"grid",gap:6},children:[e.jsx("span",{style:{fontSize:12,color:"var(--color-text-muted)"},children:n("令ç")}),e.jsx("div",{style:{display:"flex",gap:4,flexWrap:"wrap"},children:t.tokens.length>0?t.tokens.map(r=>e.jsx("span",{className:`badge ${r.isDefault?"badge-success":"badge-muted"}`,style:{fontSize:11},children:r.name},r.id)):e.jsx("span",{style:{color:"var(--color-text-muted)",fontSize:12},children:"â"})})]})]})]},t.id))]}):e.jsxs("table",{className:"data-table",style:{width:"100%"},children:[e.jsx("thead",{children:e.jsxs("tr",{children:[e.jsx("th",{style:{fontWeight:500},children:n("ç«ç¹")}),e.jsx("th",{style:{fontWeight:500},children:n("è´¦å·")}),e.jsx("th",{style:{fontWeight:500},children:n("令ç")}),e.jsx("th",{style:{fontWeight:500},children:n("å»¶è¿")}),e.jsx("th",{style:{fontWeight:500},children:n("ä½é¢")})]})}),e.jsx("tbody",{children:s.accounts.map(t=>e.jsxs("tr",{children:[e.jsx("td",{children:e.jsx(B,{siteId:O.get(t.site),siteName:t.site,badgeClassName:"badge badge-info",badgeStyle:{fontSize:11}})}),e.jsx("td",{style:{fontSize:12},children:t.username||`ID:${t.id}`}),e.jsx("td",{style:{display:"flex",gap:4,flexWrap:"wrap"},children:t.tokens.length>0?t.tokens.map(r=>e.jsx("span",{className:`badge ${r.isDefault?"badge-success":"badge-muted"}`,style:{fontSize:11},children:r.name},r.id)):e.jsx("span",{style:{color:"var(--color-text-muted)"},children:"â"})}),e.jsx("td",{children:t.latency!=null?e.jsxs("span",{style:{color:H(t.latency),fontVariantNumeric:"tabular-nums",fontSize:12},children:[t.latency,"ms"]}):"â"}),e.jsxs("td",{style:{fontVariantNumeric:"tabular-nums",fontSize:12},children:["$",(t.balance||0).toFixed(2)]})]},t.id))})]})]})})}):null]},s.name)})}):e.jsx("div",{className:"card",style:{overflowX:"auto"},children:e.jsxs("table",{className:"data-table",style:{width:"100%"},children:[e.jsx("thead",{children:e.jsxs("tr",{children:[e.jsx("th",{style:{width:44}}),e.jsxs("th",{style:{cursor:"pointer"},onClick:()=>{C("name"),k(s=>s==="asc"?"desc":"asc")},children:[n("模ååç§°")," ",d==="name"?v==="desc"?"â":"â":""]}),e.jsxs("th",{style:{cursor:"pointer"},onClick:()=>{C("accountCount"),k(s=>s==="asc"?"desc":"asc")},children:[n("è´¦å·æ°")," ",d==="accountCount"?v==="desc"?"â":"â":""]}),e.jsxs("th",{style:{cursor:"pointer"},onClick:()=>{C("tokenCount"),k(s=>s==="asc"?"desc":"asc")},children:[n("ä»¤çæ°")," ",d==="tokenCount"?v==="desc"?"â":"â":""]}),e.jsxs("th",{style:{cursor:"pointer"},onClick:()=>{C("avgLatency"),k(s=>s==="asc"?"desc":"asc")},children:[n("å»¶è¿")," ",d==="avgLatency"?v==="desc"?"â":"â":""]}),e.jsxs("th",{style:{cursor:"pointer"},onClick:()=>{C("successRate"),k(s=>s==="asc"?"desc":"asc")},children:[n("æåç")," ",d==="successRate"?v==="desc"?"â":"â":""]}),e.jsx("th",{style:{width:60},children:n("æä½")})]})}),e.jsx("tbody",{children:ie.map(s=>{const a=Z===s.name;return e.jsxs(we.Fragment,{children:[e.jsxs("tr",{onClick:()=>J(a?null:s.name),style:{cursor:"pointer"},children:[e.jsx("td",{children:e.jsx(ce,{model:s.name,size:28})}),e.jsx("td",{children:e.jsx("code",{style:{fontSize:12,padding:"3px 8px",background:"var(--color-bg)",borderRadius:4,border:"1px solid var(--color-border-light)"},children:s.name})}),e.jsx("td",{children:e.jsx("span",{className:"badge badge-info",children:s.accountCount})}),e.jsx("td",{children:e.jsx("span",{className:"badge badge-muted",children:s.tokenCount})}),e.jsx("td",{children:e.jsx("span",{className:`badge ${ue(s.avgLatency)}`,style:{fontSize:12,fontVariantNumeric:"tabular-nums"},children:Q(s.avgLatency)})}),e.jsx("td",{children:e.jsx("span",{className:`badge ${pe(s.successRate)}`,style:{fontSize:12,fontWeight:600,fontVariantNumeric:"tabular-nums"},children:s.successRate!=null?`${s.successRate}%`:"â"})}),e.jsx("td",{onClick:t=>t.stopPropagation(),children:e.jsx("button",{className:"model-card-action-btn","data-tooltip":n("å¤å¶"),"aria-label":n("å¤å¶"),onClick:()=>le(s.name),children:ee===s.name?e.jsx("svg",{width:"12",height:"12",fill:"none",viewBox:"0 0 24 24",stroke:"var(--color-success)",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M5 13l4 4L19 7"})}):e.jsx("svg",{width:"12",height:"12",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M8 16H6a2 2 0 01-2-2V6a2 2 0 012-2h8a2 2 0 012 2v2m-6 12h8a2 2 0 002-2v-8a2 2 0 00-2-2h-8a2 2 0 00-2 2v8a2 2 0 002 2z"})})})})]}),a?e.jsx("tr",{className:"log-detail-row",children:e.jsx("td",{colSpan:7,style:{padding:0},children:e.jsx("div",{className:"anim-collapse is-open",children:e.jsx("div",{className:"anim-collapse-inner",children:e.jsxs("div",{style:{padding:"12px 16px 12px 54px"},children:[e.jsxs("div",{style:{display:"grid",gap:8,marginBottom:10},children:[e.jsxs("div",{className:"card",style:{padding:10},children:[e.jsx("div",{style:{fontSize:12,fontWeight:600,marginBottom:6},children:n("åºç¡ä¿¡æ¯")}),e.jsx("div",{style:{fontSize:12,color:"var(--color-text-secondary)",lineHeight:1.6},children:ge(s,y)}),e.jsx("div",{style:{display:"flex",gap:6,flexWrap:"wrap",marginTop:8},children:s.tags.length>0?s.tags.map(t=>e.jsx("span",{className:"badge badge-info",children:t},t)):e.jsx("span",{className:"badge badge-muted",children:y?n("å è½½å
æ°æ®ä¸..."):n("ææ æ ç¾")})})]}),e.jsxs("div",{className:"card",style:{padding:10},children:[e.jsx("div",{style:{fontSize:12,fontWeight:600,marginBottom:6},children:n("æ¥å£è½å")}),e.jsx("div",{style:{display:"flex",gap:6,flexWrap:"wrap"},children:s.supportedEndpointTypes.length>0?s.supportedEndpointTypes.map(t=>e.jsx("span",{className:"badge badge-success",children:t},t)):e.jsx("span
1",{className:"badge badge-muted",children:y?n("å è½½å
æ°æ®ä¸..."):n("æªæä¾")})})]}),e.jsxs("div",{className:"card",style:{padding:10},children:[e.jsx("div",{style:{fontSize:12,fontWeight:600,marginBottom:6},children:n("åç»è®¡è´¹")}),s.pricingSources.length>0?e.jsx("div",{style:{display:"grid",gap:8},children:s.pricingSources.map(t=>e.jsxs("div",{style:{border:"1px solid var(--color-border-light)",borderRadius:8,padding:8},children:[e.jsxs("div",{style:{fontSize:12,marginBottom:6},children:[e.jsx(B,{siteId:t.siteId,siteName:t.siteName,badgeStyle:{fontSize:11}})," · ",t.username||`ID:${t.accountId}`]}),e.jsx("div",{style:{display:"flex",gap:6,flexWrap:"wrap"},children:Object.entries(t.groupPricing).map(([r,l])=>e.jsxs("span",{className:"badge badge-info",children:[r,": ",xe(l)]},r))})]},`${t.siteId}-${t.accountId}`))}):e.jsx("span",{className:"badge badge-muted",children:y?n("æ£å¨å è½½ä»·æ ¼å
æ°æ®..."):n("ææ ä»·æ ¼å
æ°æ®")})]})]}),e.jsxs("table",{style:{width:"100%",fontSize:12,borderCollapse:"collapse"},children:[e.jsx("thead",{children:e.jsxs("tr",{style:{color:"var(--color-text-muted)"},children:[e.jsx("th",{style:{textAlign:"left",padding:"6px 8px",fontWeight:500},children:n("ç«ç¹")}),e.jsx("th",{style:{textAlign:"left",padding:"6px 8px",fontWeight:500},children:n("è´¦å·")}),e.jsx("th",{style:{textAlign:"left",padding:"6px 8px",fontWeight:500},children:n("令ç")}),e.jsx("th",{style:{textAlign:"left",padding:"6px 8px",fontWeight:500},children:n("å»¶è¿")}),e.jsx("th",{style:{textAlign:"left",padding:"6px 8px",fontWeight:500},children:n("ä½é¢")})]})}),e.jsx("tbody",{children:s.accounts.map(t=>e.jsxs("tr",{style:{borderTop:"1px solid var(--color-border-light)"},children:[e.jsx("td",{style:{padding:8},children:e.jsx(B,{siteId:O.get(t.site),siteName:t.site,badgeClassName:"badge badge-info",badgeStyle:{fontSize:11}})}),e.jsx("td",{style:{padding:8},children:t.username||`ID:${t.id}`}),e.jsx("td",{style:{padding:8,display:"flex",gap:4,flexWrap:"wrap"},children:t.tokens.length>0?t.tokens.map(r=>e.jsx("span",{className:`badge ${r.isDefault?"badge-success":"badge-info"}`,children:r.name},r.id)):"â"}),e.jsx("td",{style:{padding:8,color:t.latency!=null?H(t.latency):"var(--color-text-muted)"},children:t.latency!=null?`${t.latency}ms`:"â"}),e.jsxs("td",{style:{padding:8},children:["$",(t.balance||0).toFixed(2)]})]},t.id))})]})]})})})})}):null]},s.name)})})]})}),I.length>0&&e.jsxs("div",{className:"pagination",children:[e.jsx("button",{className:"pagination-btn",disabled:b<=1,onClick:()=>T(s=>s-1),children:e.jsx("svg",{width:"14",height:"14",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M15 19l-7-7 7-7"})})}),Array.from({length:Math.min(z,7)},(s,a)=>{let t;return z<=7||b<=4?t=a+1:b>=z-3?t=z-6+a:t=b-3+a,e.jsx("button",{className:`pagination-btn ${b===t?"active":""}`,onClick:()=>T(t),children:t},t)}),e.jsx("button",{className:"pagination-btn",disabled:b>=z,onClick:()=>T(s=>s+1),children:e.jsx("svg",{width:"14",height:"14",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M9 5l7 7-7 7"})})}),e.jsxs("div",{className:"pagination-size",children:[n("æ¯é¡µæ¡æ°"),":",e.jsx("div",{style:{minWidth:86},children:e.jsx(ze,{size:"sm",value:String(w),onChange:s=>fe(Number(s)),options:Be.map(s=>({value:String(s),label:String(s)})),placeholder:String(w)})})]})]})]})]})}export{De as default};
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.