@aidotnet/server-linux-x64 0.14.3101 → 0.14.3103
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/bin/astra-server +2 -2
- package/bin/wwwroot/assets/ClientsPage-CbisrdvY.js +9 -0
- package/bin/wwwroot/assets/KeyPage-BJkqoRws.js +1 -0
- package/bin/wwwroot/assets/McpPage-lDbAQFBD.js +3 -0
- package/bin/wwwroot/assets/ModelDetailPage-2SDue3md.js +1 -0
- package/bin/wwwroot/assets/ModelsPage-Djwi1_69.js +1 -0
- package/bin/wwwroot/assets/PluginsPage-Cr3_QueY.js +2 -0
- package/bin/wwwroot/assets/PrivacyPage-K20lHsrR.js +1 -0
- package/bin/wwwroot/assets/ProviderDetailPage-dCLgz9IA.js +3 -0
- package/bin/wwwroot/assets/ProvidersPage-B3UD_FXO.js +3 -0
- package/bin/wwwroot/assets/SettingsPage-BOv88_uQ.js +2 -0
- package/bin/wwwroot/assets/SmartRoutingPage-DUdAF-mO.js +2 -0
- package/bin/wwwroot/assets/TokenDetailPage-DAFuMypb.js +1 -0
- package/bin/wwwroot/assets/{TokenPoolEditor-DfmDnnxw.js → TokenPoolEditor-CGc4q0xj.js} +1 -1
- package/bin/wwwroot/assets/TokensPage-BAszgNt-.js +1 -0
- package/bin/wwwroot/assets/TracesPage-zR4Nhppl.js +8 -0
- package/bin/wwwroot/assets/{TrayPanelPage-xke1V9tu.js → TrayPanelPage-BzWJbHrV.js} +1 -1
- package/bin/wwwroot/assets/TrayPanelView-C8TTq4KZ.js +1 -0
- package/bin/wwwroot/assets/alert-BKRTQ9va.js +15 -0
- package/bin/wwwroot/assets/{arrow-down-DeIGdMUk.js → arrow-down-4QyszMPK.js} +1 -1
- package/bin/wwwroot/assets/{arrow-left-DX1c-nYY.js → arrow-left-CgusYKe5.js} +1 -1
- package/bin/wwwroot/assets/{arrow-up-right-D--u8dK5.js → arrow-up-right-CgKLuRMO.js} +1 -1
- package/bin/wwwroot/assets/{chart-column-zt3ZRFLH.js → chart-column-DrO0zSNb.js} +1 -1
- package/bin/wwwroot/assets/{checkbox-BJe8ekJy.js → checkbox-JghCvxwP.js} +1 -1
- package/bin/wwwroot/assets/{cloud-download-DWw6s5ag.js → cloud-download-Cq6X58YR.js} +1 -1
- package/bin/wwwroot/assets/confirm-morph-bdMiffHC.js +1 -0
- package/bin/wwwroot/assets/{ellipsis-BH_FL485.js → ellipsis-C09AxsS6.js} +1 -1
- package/bin/wwwroot/assets/{external-link-Bb6sx3jt.js → external-link-B54WZqyE.js} +1 -1
- package/bin/wwwroot/assets/{folder-open-Bcx5mAII.js → folder-open-DbnPnrzj.js} +1 -1
- package/bin/wwwroot/assets/index-8z9hfQDF.css +1 -0
- package/bin/wwwroot/assets/index-Cj8lNw6g.js +120 -0
- package/bin/wwwroot/assets/{log-out-Ch09k2bC.js → log-out-ZnLW7wzx.js} +1 -1
- package/bin/wwwroot/assets/minus-DosBdkUl.js +1 -0
- package/bin/wwwroot/assets/overlays-CizKmvVN.js +41 -0
- package/bin/wwwroot/assets/{pencil-fY6CohHT.js → pencil-BuVygJ9-.js} +1 -1
- package/bin/wwwroot/assets/{power-B9MMcl6Y.js → power-CfEiSxDi.js} +1 -1
- package/bin/wwwroot/assets/radio-cards-6WsHN05O.js +1 -0
- package/bin/wwwroot/assets/{rotate-ccw-DsmSscuv.js → rotate-ccw-BhDSBCvo.js} +1 -1
- package/bin/wwwroot/assets/{sortable.esm-CO34h2h7.js → sortable.esm-4hCCGHPl.js} +1 -1
- package/bin/wwwroot/index.html +4 -4
- package/package.json +1 -1
- package/bin/wwwroot/assets/ClientsPage-BsCvaS4d.js +0 -9
- package/bin/wwwroot/assets/KeyPage-bkK0B_mk.js +0 -1
- package/bin/wwwroot/assets/ModelDetailPage-BEVSPYM6.js +0 -1
- package/bin/wwwroot/assets/ModelsPage-BGij6zvC.js +0 -1
- package/bin/wwwroot/assets/PluginsPage-dVUvE8Lf.js +0 -2
- package/bin/wwwroot/assets/PrivacyPage-B-YBfQ6J.js +0 -1
- package/bin/wwwroot/assets/ProviderDetailPage-CQQdpDSf.js +0 -3
- package/bin/wwwroot/assets/ProvidersPage-BwigLnKs.js +0 -3
- package/bin/wwwroot/assets/SettingsPage-CvpROKS2.js +0 -2
- package/bin/wwwroot/assets/SmartRoutingPage-CYh7mRot.js +0 -2
- package/bin/wwwroot/assets/TokenDetailPage-GwSz8QI6.js +0 -1
- package/bin/wwwroot/assets/TokensPage-0hOOzLVU.js +0 -1
- package/bin/wwwroot/assets/TracesPage-A45sREZP.js +0 -8
- package/bin/wwwroot/assets/TrayPanelView-CHh9-E76.js +0 -1
- package/bin/wwwroot/assets/alert-CuKAE1Sv.js +0 -15
- package/bin/wwwroot/assets/confirm-morph-DGAHV4QP.js +0 -1
- package/bin/wwwroot/assets/download-DR9BLMVt.js +0 -1
- package/bin/wwwroot/assets/index-CKrvKDIJ.js +0 -17
- package/bin/wwwroot/assets/index-CpGX4nAj.css +0 -1
- package/bin/wwwroot/assets/minus-UfPYsFrp.js +0 -1
- package/bin/wwwroot/assets/overlays-DeHu6TU_.js +0 -41
- package/bin/wwwroot/assets/radio-cards-Rq9vGqnw.js +0 -1
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{Ba as e,Ua as t,Y as n,ct as r,dt as i,ft as a,gt as o,ot as s,q as c,s as l,v as u,xt as d,za as f}from"./alert-CuKAE1Sv.js";import{B as p,F as m,H as h,I as g,L as _,N as v,P as y,R as b,U as x,V as S,W as C,lt as w,tt as T,z as E}from"./overlays-DeHu6TU_.js";import{t as D}from"./arrow-up-right-D--u8dK5.js";import{t as ee}from"./ellipsis-BH_FL485.js";import{t as te}from"./rotate-ccw-DsmSscuv.js";import{K as O,U as k,_ as A,m as j,x as M,y as N,z as P}from"./index-CKrvKDIJ.js";var F={name:`arrow-down-right`,size:24,node:[[`path`,{d:`m7 7 10 10`,key:`1fmybs`}],[`path`,{d:`M17 7v10H7`,key:`6fjiku`}]]};F.node;var I=d(F),L={name:`chevrons-up-down`,size:24,node:[[`path`,{d:`m7 15 5 5 5-5`,key:`1hf1tw`}],[`path`,{d:`m7 9 5-5 5 5`,key:`sgt6xg`}]]};L.node;var ne=d(L),R={name:`play`,size:24,node:[[`path`,{d:`M5 5a2 2 0 0 1 3.008-1.728l11.997 6.998a2 2 0 0 1 .003 3.458l-12 7A2 2 0 0 1 5 19z`,key:`10ikf1`}]]};R.node;var z=d(R),B=t(e(),1),V=f(),H={green:`var(--success)`,orange:`var(--warning)`,red:`var(--danger)`},re=(0,B.forwardRef)(function({prefs:e,state:t,data:n,onCommand:c,onRefresh:u,onCopyAddress:d,onSwitchClient:f,preview:p,tab:m,onTabChange:h,className:g},_){let{t:v}=r(),[y,b]=(0,B.useState)(`overview`),x=t.activity!==null,S=t.running&&!x,C=e=>c?.(e),T=[`overview`];e.sections.quota&&(n.plans.length>0||n.hasSubscriptions)&&T.push(`quota`),e.sections.clients&&n.clients.some(e=>e.enabled)&&T.push(`clients`);let E=m??y,k=T.includes(E)?E:`overview`,A=e=>{b(e),h?.(e)},j=(t.running||x)&&T.length>1,M=n.settings?.gatewayBaseUrl.replace(/^https?:\/\//,``)??(t.port?`127.0.0.1:${t.port}`:``),N=t.activity?v(`tray.status.${t.activity}`):t.running?v(`tray.status.running`):v(`tray.status.stopped`);return(0,V.jsxs)(`div`,{ref:_,className:s(`chrome flex max-h-full flex-col overflow-hidden rounded-[14px] border border-[var(--border-strong)] bg-[var(--surface-raised)] text-[13px] text-[var(--foreground)]`,g),children:[(0,V.jsxs)(`header`,{"data-tray-part":`header`,className:`shrink-0 border-b border-[var(--border)] px-4 pt-3.5 pb-3`,children:[(0,V.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,V.jsx)(l,{tone:x?`orange`:t.running?`green`:`red`}),(0,V.jsx)(`span`,{className:`min-w-0 flex-1 truncate text-[14px] font-semibold`,children:N}),(0,V.jsx)(U,{label:v(`tray.copyAddress`),onClick:d,disabled:!M,children:(0,V.jsx)(o,{className:`size-4`})}),(0,V.jsx)(U,{label:v(`tray.settings`),onClick:()=>C(`open-settings`),children:(0,V.jsx)(w,{className:`size-4`})}),(0,V.jsx)(U,{label:v(`tray.more`),onClick:()=>C(`menu`),children:(0,V.jsx)(ee,{className:`size-4`})}),!p&&(0,V.jsx)(U,{label:v(`common.close`),onClick:()=>C(`hide`),children:(0,V.jsx)(i,{className:`size-4`})})]}),M&&(0,V.jsx)(`div`,{className:`selectable mt-0.5 truncate pl-4 font-mono text-[12px] text-[var(--text-secondary)]`,children:M}),(t.apiVersionMismatch||t.updateAvailable)&&(0,V.jsxs)(`div`,{className:`mt-2 flex flex-wrap gap-1.5 pl-4`,children:[t.apiVersionMismatch&&(0,V.jsxs)(W,{tone:`orange`,children:[(0,V.jsx)(a,{className:`size-3`}),v(`tray.mismatch`)]}),t.updateAvailable&&(0,V.jsx)(`button`,{type:`button`,onClick:()=>C(`check-updates`),className:`cursor-default`,children:(0,V.jsx)(W,{tone:`accent`,children:v(`tray.update`)})})]})]}),(0,V.jsx)(`div`,{"data-tray-part":`tabs`,className:`shrink-0`,children:j&&(0,V.jsx)(G,{tabs:T,active:k,onChange:A})}),(0,V.jsx)(`div`,{className:`scroll min-h-0 flex-1 overflow-y-auto`,children:(0,V.jsx)(`div`,{"data-tray-part":`body`,className:`flex flex-col gap-3 px-4 py-3.5`,children:!t.running&&!x?(0,V.jsx)(J,{onStart:()=>C(`start`)}):(0,V.jsxs)(V.Fragment,{children:[k===`overview`&&(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(q,{prefs:e,data:n,onViewQuota:()=>A(`quota`)}),(0,V.jsx)(ie,{prefs:e,data:n,onRefresh:u}),e.sections.quota&&(0,V.jsx)(oe,{data:n,onViewAll:()=>A(`quota`)})]}),k===`quota`&&(0,V.jsx)(se,{data:n,plain:!0}),k===`clients`&&(0,V.jsx)(le,{data:n,disabled:!S,onSwitch:f,plain:!0})]})})}),(0,V.jsxs)(`footer`,{"data-tray-part":`footer`,className:`flex shrink-0 items-center gap-1 border-t border-[var(--border)] px-3 py-2.5`,children:[t.running?(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(U,{label:v(`tray.restart`),onClick:()=>C(`restart`),disabled:x,children:(0,V.jsx)(te,{className:`size-4`})}),(0,V.jsx)(U,{label:v(`tray.stop`),onClick:()=>C(`stop`),disabled:x,children:(0,V.jsx)(O,{className:`size-4`})})]}):(0,V.jsx)(U,{label:v(`shell.startService`),onClick:()=>C(`start`),disabled:x,children:(0,V.jsx)(z,{className:`size-4`})}),(0,V.jsx)(`div`,{className:`flex-1`}),(0,V.jsx)(`button`,{type:`button`,onClick:()=>C(`quit`),className:`h-8 cursor-default rounded-[8px] px-2.5 text-[13px] text-[var(--text-secondary)] transition-colors hover:bg-[var(--surface-muted)] hover:text-[var(--foreground)]`,children:v(`tray.quit`)}),(0,V.jsxs)(`button`,{type:`button`,onClick:()=>C(`open`),className:`inline-flex h-8 cursor-default items-center gap-1.5 rounded-[8px] border border-[var(--border-strong)] px-3 text-[13px] font-medium transition-colors hover:bg-[var(--surface-muted)]`,children:[v(`tray.open`),(0,V.jsx)(D,{className:`size-3.5`})]})]})]})});function U({label:e,onClick:t,disabled:n,children:r}){return(0,V.jsx)(`button`,{type:`button`,title:e,"aria-label":e,disabled:n,onClick:t,className:`inline-flex size-8 shrink-0 cursor-default items-center justify-center rounded-[8px] text-[var(--text-secondary)] transition-colors hover:bg-[var(--surface-muted)] hover:text-[var(--foreground)] disabled:opacity-40 disabled:hover:bg-transparent`,children:r})}function W({tone:e,children:t,title:n}){let r={red:`var(--danger)`,orange:`var(--warning)`,accent:`var(--accent)`,neutral:`var(--text-secondary)`}[e];return(0,V.jsx)(`span`,{title:n,className:`inline-flex max-w-full items-center gap-1 rounded-[6px] border px-1.5 py-px text-[11.5px] leading-[18px] whitespace-nowrap`,style:{color:r,borderColor:`color-mix(in oklab, ${r} 45%, transparent)`,background:`color-mix(in oklab, ${r} 10%, transparent)`},children:t})}function G({tabs:e,active:t,onChange:n}){let{t:i}=r(),a={overview:i(`tray.tab.overview`),quota:i(`tray.tab.quota`),clients:i(`tray.clients`)};return(0,V.jsx)(`div`,{role:`tablist`,className:`flex gap-1 px-3 pt-2.5`,children:e.map(e=>(0,V.jsx)(`button`,{type:`button`,role:`tab`,"aria-selected":e===t,onClick:()=>n(e),className:s(`h-7 cursor-default rounded-[7px] px-2.5 text-[12.5px] transition-colors`,e===t?`bg-[var(--surface-muted)] font-medium text-[var(--foreground)]`:`text-[var(--text-secondary)] hover:text-[var(--foreground)]`),children:a[e]},e))})}function K({tone:e,onClick:t,children:n}){let r=e===`red`?`var(--danger)`:`var(--warning)`,i={color:r,borderColor:`color-mix(in oklab, ${r} 45%, transparent)`,background:`color-mix(in oklab, ${r} 10%, transparent)`},o=`flex w-full items-center gap-1.5 rounded-[8px] border px-2.5 py-1.5 text-left text-[12.5px]`,c=(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(a,{className:`size-3.5 shrink-0`}),(0,V.jsx)(`span`,{className:`min-w-0 flex-1 truncate`,children:n})]});return t?(0,V.jsxs)(`button`,{type:`button`,onClick:t,className:s(o,`cursor-default`),style:i,children:[c,(0,V.jsx)(k,{className:`size-3.5 shrink-0`})]}):(0,V.jsx)(`div`,{className:o,style:i,children:c})}function q({prefs:e,data:t,onViewQuota:n}){let{t:i,locale:a}=r(),o=t.summary,s=e.sections.overview&&o?y(o):0,l=e.sections.quota?E(t.plans):null,u=l&&l.row.remaining<30?l:null;return!o||s===0&&!u?null:(0,V.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[s>0&&(0,V.jsx)(K,{tone:`red`,children:i(`tray.alert.failures`,{count:s,share:c(s/o.requests)})}),u&&(0,V.jsx)(K,{tone:u.row.remaining<10?`red`:`orange`,onClick:n,children:i(`tray.alert.quota`,{plan:u.plan.providerName,window:Q(u.row,i,a),remaining:`${Math.round(u.row.remaining)}%`})})]})}function J({onStart:e}){let{t}=r();return(0,V.jsxs)(`div`,{className:`flex flex-col items-center gap-2 py-6 text-center`,children:[(0,V.jsx)(`div`,{className:`text-[13px] font-medium`,children:t(`tray.status.stopped`)}),(0,V.jsx)(`div`,{className:`max-w-[260px] text-[12px] text-[var(--text-secondary)]`,children:t(`tray.stoppedHint`)}),(0,V.jsxs)(`button`,{type:`button`,onClick:e,className:`mt-1 inline-flex h-8 cursor-default items-center gap-1.5 rounded-[8px] bg-[var(--accent)] px-3 text-[13px] font-medium text-[var(--on-accent)]`,children:[(0,V.jsx)(z,{className:`size-3.5`}),t(`shell.startService`)]})]})}function Y(e=3e4){let[t,n]=(0,B.useState)(()=>Date.now());return(0,B.useEffect)(()=>{let t=setInterval(()=>n(Date.now()),e);return()=>clearInterval(t)},[e]),t}function ie({prefs:e,data:t,onRefresh:i}){let{t:a,locale:o}=r(),s=Y(),l=t.summary,d=e.sections,f=d.overview||d.cost,p=l?l.inputTokens+l.outputTokens:0,g=h(t.updatedAt,o,a(`tray.justNow`),s),_=d.topModel?S(t.top,p):null,y=d.cacheHitRate&&l?j(l.cacheReadTokens,l.inputTokens):null,b=d.compareYesterday&&l?v(p,C(t.daily,new Date(s))):null,x=d.topModel||d.cacheHitRate||d.compareYesterday;return!f&&!d.chart&&!x?null:(0,V.jsxs)(`section`,{className:`flex flex-col gap-3`,children:[(0,V.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,V.jsx)(`span`,{className:`text-[13px] text-[var(--text-secondary)]`,children:a(`tray.today`)}),(0,V.jsx)(`div`,{className:`flex-1`}),g&&(0,V.jsx)(`span`,{className:`text-[12px] text-[var(--text-muted)]`,children:a(`tray.updated`,{time:g})}),(0,V.jsx)(U,{label:a(`common.refresh`),onClick:i,children:(0,V.jsx)(P,{className:`size-3.5`})})]}),l?(0,V.jsxs)(V.Fragment,{children:[f&&(0,V.jsxs)(`div`,{className:`grid auto-cols-fr grid-flow-col gap-px overflow-hidden rounded-[10px] bg-[var(--border)]`,children:[d.overview&&(0,V.jsx)(X,{label:a(`tray.requests`),value:n(l.requests,!0)}),d.overview&&(0,V.jsx)(X,{label:a(`tray.tokens`),value:n(p,!0)}),d.cost&&(0,V.jsx)(X,{label:a(`tray.cost`),value:m(l.costUsd)})]}),d.chart&&(0,V.jsx)(ae,{data:t,now:s}),x&&(0,V.jsxs)(`div`,{className:`flex flex-wrap gap-1.5`,children:[_&&(0,V.jsxs)(Z,{label:a(`tray.topModel`),title:_.model,children:[(0,V.jsx)(`span`,{className:`truncate`,children:_.model}),(0,V.jsxs)(`span`,{className:`shrink-0`,children:[`· `,c(_.share)]})]}),d.cacheHitRate&&(0,V.jsx)(Z,{label:a(`tray.cacheHit`),children:(0,V.jsx)(`span`,{children:y==null?`—`:c(y)})}),d.compareYesterday&&(0,V.jsx)(Z,{label:a(`tray.vsYesterday`),children:b==null?(0,V.jsx)(`span`,{children:`—`}):(0,V.jsxs)(`span`,{className:`inline-flex items-center gap-0.5`,children:[b>=0?(0,V.jsx)(D,{className:`size-3`}):(0,V.jsx)(I,{className:`size-3`}),c(Math.abs(b))]})})]})]}):t.error?(0,V.jsx)(`div`,{className:`text-[12px] text-[var(--danger)]`,children:a(`tray.loadFailed`)}):(0,V.jsx)(u,{lines:2})]})}function X({label:e,value:t}){return(0,V.jsxs)(`div`,{className:`min-w-0 bg-[var(--surface-muted)] px-3 py-2.5`,children:[(0,V.jsx)(`div`,{className:`truncate text-[12px] text-[var(--text-secondary)]`,children:e}),(0,V.jsx)(`div`,{className:`num mt-0.5 truncate text-[20px] leading-tight font-semibold`,title:t,children:t})]})}function Z({label:e,title:t,children:n}){return(0,V.jsxs)(`span`,{title:t,className:`inline-flex max-w-full min-w-0 items-center gap-1.5 rounded-[7px] border border-[var(--border)] px-2 py-0.5 text-[12px]`,children:[(0,V.jsx)(`span`,{className:`shrink-0 text-[var(--text-secondary)]`,children:e}),(0,V.jsx)(`span`,{className:`flex min-w-0 items-center gap-1 font-medium`,children:n})]})}function ae({data:e,now:t}){let{t:n}=r(),i=g(e.hourly,new Date(t)),a=Math.max(1,...i.map(e=>e.value)),o=new Date(t).getHours();return(0,V.jsx)(`div`,{role:`img`,"aria-label":n(`tray.chartLabel`),className:`flex h-16 items-end gap-[3px]`,children:i.map((e,t)=>{let r=e.value>0?Math.max(4,Math.round(e.value/a*64)):2;return(0,V.jsx)(`span`,{title:n(`tray.hourBar`,{hour:`${String(t).padStart(2,`0`)}:00`,count:e.value}),className:`flex-1 rounded-[2px]`,style:{height:r,background:t===o?`var(--accent)`:e.value>0?`color-mix(in oklab, var(--foreground) 32%, transparent)`:`var(--border)`,opacity:t>o?.5:1}},e.bucket)})})}function oe({data:e,onViewAll:t}){let{t:n,locale:i}=r();if(e.plans.length===0)return e.hasSubscriptions?(0,V.jsx)(`div`,{className:`border-t border-[var(--border)] pt-3 text-[12px] text-[var(--text-muted)]`,children:n(`tray.quotaPending`)}):null;let a=p(e.plans,3),o=e.plans.reduce((e,t)=>e+t.rows.length,0);return(0,V.jsxs)(`section`,{className:`flex flex-col gap-2 border-t border-[var(--border)] pt-3`,children:[(0,V.jsxs)(`div`,{className:`flex items-center text-[12px] text-[var(--text-secondary)]`,children:[(0,V.jsx)(`span`,{className:`flex-1`,children:n(`tray.quotaTightest`)}),o>a.length&&(0,V.jsxs)(`button`,{type:`button`,onClick:t,className:`inline-flex cursor-default items-center gap-0.5 hover:text-[var(--foreground)]`,children:[n(`tray.viewAll`),(0,V.jsx)(k,{className:`size-3`})]})]}),a.map(({plan:e,row:t},r)=>(0,V.jsxs)(`div`,{className:`grid grid-cols-[minmax(0,1fr)_64px_40px_60px] items-center gap-2 text-[12.5px]`,children:[(0,V.jsxs)(`span`,{className:`flex min-w-0 items-center gap-1.5`,children:[(0,V.jsx)(M,{name:e.providerName,icon:e.providerIcon,size:14}),(0,V.jsx)(`span`,{className:`truncate font-medium`,children:e.providerName}),(0,V.jsx)(`span`,{className:`shrink-0 text-[var(--text-secondary)]`,children:Q(t,n,i)})]}),(0,V.jsx)($,{row:t,locale:i})]},`${e.accountId}-${t.kind}-${r}`))]})}function se({data:e,plain:t}){let{t:n}=r();if(e.plans.length===0&&!e.hasSubscriptions)return null;let i=new Map;for(let t of e.plans)i.set(t.providerId,(i.get(t.providerId)??0)+1);return(0,V.jsxs)(`section`,{className:s(`flex flex-col gap-2`,!t&&`border-t border-[var(--border)] pt-3`),children:[(0,V.jsxs)(`div`,{className:`grid grid-cols-[1fr_48px_72px] items-center gap-2 text-[12px] text-[var(--text-secondary)]`,children:[(0,V.jsx)(`span`,{children:n(`tray.quota`)}),(0,V.jsx)(`span`,{className:`text-right`,children:n(`tray.quotaRemaining`)}),(0,V.jsx)(`span`,{className:`text-right`,children:n(`tray.quotaReset`)})]}),e.plans.length===0?(0,V.jsx)(`div`,{className:`text-[12px] text-[var(--text-muted)]`,children:n(`tray.quotaPending`)}):e.plans.map(e=>(0,V.jsx)(ce,{plan:e,showAccount:(i.get(e.providerId)??0)>1},e.accountId))]})}function Q(e,t,n){return e.kind===`balance`?e.label??t(`tray.quotaBalance`):e.kind===`credits`||e.windowMinutes==null?t(`tray.quotaCredits`):x(e.windowMinutes,n)}function $({row:e,locale:t}){let n=e.remaining,r=n===null?void 0:H[_(n)];return(0,V.jsxs)(V.Fragment,{children:[n===null?(0,V.jsx)(`span`,{}):(0,V.jsx)(`span`,{className:`h-1.5 overflow-hidden rounded-full bg-[var(--surface-muted)]`,children:(0,V.jsx)(`span`,{className:`block h-full rounded-full`,style:{width:`${n}%`,background:r}})}),e.amount?(0,V.jsx)(`span`,{className:`num col-span-2 truncate text-right font-medium`,children:T(e.amount.value,e.amount.unit,t)}):(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(`span`,{className:`num text-right font-medium`,children:n===null?`—`:`${Math.round(n)}%`}),(0,V.jsx)(`span`,{className:`truncate text-right text-[var(--text-secondary)]`,children:b(e.resetsAt,t)??`—`})]})]})}function ce({plan:e,showAccount:t}){let{t:n,locale:i}=r();return(0,V.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[(0,V.jsxs)(`div`,{className:`flex min-w-0 items-center gap-2`,children:[(0,V.jsx)(M,{name:e.providerName,icon:e.providerIcon,size:16}),(0,V.jsx)(`span`,{className:`truncate text-[13px] font-medium`,children:e.providerName}),t&&(0,V.jsx)(`span`,{className:`truncate text-[12px] text-[var(--text-muted)]`,children:e.accountName})]}),e.rows.map((e,t)=>{let r=Q(e,n,i);return(0,V.jsxs)(`div`,{className:`grid grid-cols-[52px_1fr_48px_72px] items-center gap-2 pl-6 text-[12.5px]`,children:[(0,V.jsx)(`span`,{className:`truncate text-[var(--text-secondary)]`,title:r,children:r}),(0,V.jsx)($,{row:e,locale:i})]},`${e.kind}-${t}`)})]})}function le({data:e,disabled:t,onSwitch:n,plain:i}){let{t:a}=r(),o=e.clients.filter(e=>e.enabled);if(o.length===0)return null;let c=t=>e.providers.find(e=>e.id===t)?.name??a(`tray.unbound`);return(0,V.jsxs)(`section`,{className:s(`flex flex-col gap-1`,!i&&`border-t border-[var(--border)] pt-3`),children:[(0,V.jsx)(`div`,{className:`mb-0.5 text-[12px] text-[var(--text-secondary)]`,children:a(`tray.clients`)}),o.map(e=>(0,V.jsxs)(`button`,{type:`button`,disabled:t||!n,onClick:()=>n?.(e),"aria-label":a(`tray.switchProvider`,{client:e.name}),className:`-mx-2 flex h-8 cursor-default items-center gap-2 rounded-[8px] px-2 text-left transition-colors enabled:hover:bg-[var(--surface-muted)]`,children:[e.kind in A&&(0,V.jsx)(N,{kind:e.kind,size:16}),(0,V.jsx)(`span`,{className:`min-w-0 flex-1 truncate`,children:e.name}),(0,V.jsx)(`span`,{className:`max-w-[45%] truncate text-[12px] text-[var(--text-secondary)]`,children:c(e.providerId)}),n&&(0,V.jsx)(ne,{className:`size-3.5 shrink-0 text-[var(--text-muted)]`})]},e.kind))]})}export{re as t};
|