@aidotnet/server-linux-arm64 0.8.0 → 0.9.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bin/astra-server +2 -2
- package/bin/wwwroot/assets/ClientsPage-CT5PiqS3.js +11 -0
- package/bin/wwwroot/assets/KeyPage-DOVrI-UN.js +1 -0
- package/bin/wwwroot/assets/ModelDetailPage-Yu2oJf3R.js +1 -0
- package/bin/wwwroot/assets/ModelsPage-QefK7LU5.js +1 -0
- package/bin/wwwroot/assets/PluginsPage-Dl53KvHU.js +2 -0
- package/bin/wwwroot/assets/PrivacyPage-DmSrQ2Mk.js +1 -0
- package/bin/wwwroot/assets/ProviderDetailPage-BfK0We2G.js +3 -0
- package/bin/wwwroot/assets/ProvidersPage-dKrtvirQ.js +2 -0
- package/bin/wwwroot/assets/SettingsPage-4R3aVJB1.js +2 -0
- package/bin/wwwroot/assets/TokensPage-C1s3mguI.js +1 -0
- package/bin/wwwroot/assets/TrayPanelPage-INGZ1PbI.js +1 -0
- package/bin/wwwroot/assets/TrayPanelView-CQQDnzsO.js +1 -0
- package/bin/wwwroot/assets/alert-D4IPjxz3.js +15 -0
- package/bin/wwwroot/assets/{overlays-Cnf3vGpI.css → alert-DwSJjne8.css} +1 -1
- package/bin/wwwroot/assets/arrow-down-DLYI19GC.js +1 -0
- package/bin/wwwroot/assets/arrow-left-BEIa7s0v.js +1 -0
- package/bin/wwwroot/assets/checkbox-DJG4To3W.js +1 -0
- package/bin/wwwroot/assets/cloud-download-Dx8D0gGR.js +1 -0
- package/bin/wwwroot/assets/confirm-morph-BpM-aHP9.js +1 -0
- package/bin/wwwroot/assets/download-CKu95INa.js +1 -0
- package/bin/wwwroot/assets/ellipsis-D-uqKDgA.js +1 -0
- package/bin/wwwroot/assets/external-link-tQTMyil6.js +1 -0
- package/bin/wwwroot/assets/folder-open-CL6HwOra.js +1 -0
- package/bin/wwwroot/assets/index-CdtIrMPt.js +17 -0
- package/bin/wwwroot/assets/index-nu-lKbLD.css +1 -0
- package/bin/wwwroot/assets/log-out-CZYk_IyX.js +1 -0
- package/bin/wwwroot/assets/overlays-BJrN5PWt.css +1 -0
- package/bin/wwwroot/assets/overlays-BX48Gd4h.js +41 -0
- package/bin/wwwroot/assets/paseo-B9ieOk6E.png +0 -0
- package/bin/wwwroot/assets/pencil-CUO0GAyP.js +1 -0
- package/bin/wwwroot/assets/power-USlcjghz.js +1 -0
- package/bin/wwwroot/assets/radio-cards-CGtNS_WO.js +1 -0
- package/bin/wwwroot/assets/rotate-ccw-Daii8PQN.js +1 -0
- package/bin/wwwroot/index.html +6 -8
- package/package.json +1 -1
- package/bin/wwwroot/assets/ClientsPage-B89Sa7jz.js +0 -11
- package/bin/wwwroot/assets/ModelDetailPage-CIr2VLVH.js +0 -1
- package/bin/wwwroot/assets/ModelsPage-DHoSwTY5.js +0 -1
- package/bin/wwwroot/assets/Page-CnSErb_N.js +0 -3
- package/bin/wwwroot/assets/Page-CsiaycmK.css +0 -1
- package/bin/wwwroot/assets/PluginsPage-54tF_bjG.js +0 -2
- package/bin/wwwroot/assets/PrivacyPage-D5paxuYA.js +0 -1
- package/bin/wwwroot/assets/ProviderDetailPage-DhxcWbc_.js +0 -3
- package/bin/wwwroot/assets/ProvidersPage-DfMcnoYT.js +0 -2
- package/bin/wwwroot/assets/SettingsPage-a1XhJ-l9.js +0 -1
- package/bin/wwwroot/assets/TokensPage-T2w5pi_o.js +0 -1
- package/bin/wwwroot/assets/TrayPanelPage-DOmKXJLy.js +0 -1
- package/bin/wwwroot/assets/TrayPanelView-BcmaqvCD.js +0 -1
- package/bin/wwwroot/assets/arrow-down-CXkFrvO0.js +0 -1
- package/bin/wwwroot/assets/arrow-up-BfREUNOR.js +0 -1
- package/bin/wwwroot/assets/checkbox-RGYPqY5w.js +0 -1
- package/bin/wwwroot/assets/cloud-download-D865MmmV.js +0 -1
- package/bin/wwwroot/assets/confirm-morph-DUNuG_Io.js +0 -1
- package/bin/wwwroot/assets/download-CMr38kbd.js +0 -1
- package/bin/wwwroot/assets/ellipsis-zTWIrsa4.js +0 -1
- package/bin/wwwroot/assets/external-link-BSHuW87X.js +0 -1
- package/bin/wwwroot/assets/folder-open-Ce_7X0wN.js +0 -1
- package/bin/wwwroot/assets/index-PfVyiY3J.js +0 -15
- package/bin/wwwroot/assets/index-uU60OHOr.css +0 -1
- package/bin/wwwroot/assets/log-out-CXVs8bJY.js +0 -1
- package/bin/wwwroot/assets/overlays-D1ZtG8Qn.js +0 -55
- package/bin/wwwroot/assets/pencil-DyidL-8l.js +0 -1
- package/bin/wwwroot/assets/power-CJZylS33.js +0 -1
- package/bin/wwwroot/assets/radio-cards-QHFaDooy.js +0 -1
- package/bin/wwwroot/assets/rotate-ccw-Dr0Xbikv.js +0 -1
- package/bin/wwwroot/assets/use-transform-DvOb1h9g.js +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{G as e,_t as t,at as n,ca as r,ct as i,da as a,ft as o,q as s,rt as c,s as l,sa as u,st as d,v as f}from"./alert-D4IPjxz3.js";import{G as p,H as m,J as h,K as g,Q as _,U as v,V as y,W as b,X as x,Y as S,Z as C,_t as ee,lt as w,q as T}from"./overlays-BX48Gd4h.js";import{t as E}from"./ellipsis-D-uqKDgA.js";import{t as D}from"./rotate-ccw-Daii8PQN.js";import{F as O,R as te,f as k,g as A,j,l as M,m as N}from"./index-CdtIrMPt.js";var P={name:`arrow-down-right`,size:24,node:[[`path`,{d:`m7 7 10 10`,key:`1fmybs`}],[`path`,{d:`M17 7v10H7`,key:`6fjiku`}]]};P.node;var F=t(P),I={name:`arrow-up-right`,size:24,node:[[`path`,{d:`M7 7h10v10`,key:`1tivn9`}],[`path`,{d:`M7 17 17 7`,key:`1vkiza`}]]};I.node;var L=t(I),R={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`}]]};R.node;var z=t(R),B={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`}]]};B.node;var V=t(B),H=a(r(),1),U=u(),W={green:`var(--success)`,orange:`var(--warning)`,red:`var(--danger)`},G=(0,H.forwardRef)(function({prefs:e,state:t,data:r,onCommand:a,onRefresh:s,onCopyAddress:u,onSwitchClient:f,preview:p,tab:m,onTabChange:h,className:g},_){let{t:v}=n(),[y,b]=(0,H.useState)(`overview`),x=t.activity!==null,S=t.running&&!x,C=e=>a?.(e),w=[`overview`];e.sections.quota&&(r.plans.length>0||r.hasSubscriptions)&&w.push(`quota`),e.sections.clients&&r.clients.some(e=>e.enabled)&&w.push(`clients`);let T=m??y,O=w.includes(T)?T:`overview`,k=e=>{b(e),h?.(e)},A=(t.running||x)&&w.length>1,j=r.settings?.gatewayBaseUrl.replace(/^https?:\/\//,``)??(t.port?`127.0.0.1:${t.port}`:``),M=t.activity?v(`tray.status.${t.activity}`):t.running?v(`tray.status.running`):v(`tray.status.stopped`);return(0,U.jsxs)(`div`,{ref:_,className:c(`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,U.jsxs)(`header`,{"data-tray-part":`header`,className:`shrink-0 border-b border-[var(--border)] px-4 pt-3.5 pb-3`,children:[(0,U.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,U.jsx)(l,{tone:x?`orange`:t.running?`green`:`red`}),(0,U.jsx)(`span`,{className:`min-w-0 flex-1 truncate text-[14px] font-semibold`,children:M}),(0,U.jsx)(K,{label:v(`tray.copyAddress`),onClick:u,disabled:!j,children:(0,U.jsx)(o,{className:`size-4`})}),(0,U.jsx)(K,{label:v(`tray.settings`),onClick:()=>C(`open-settings`),children:(0,U.jsx)(ee,{className:`size-4`})}),(0,U.jsx)(K,{label:v(`tray.more`),onClick:()=>C(`menu`),children:(0,U.jsx)(E,{className:`size-4`})}),!p&&(0,U.jsx)(K,{label:v(`common.close`),onClick:()=>C(`hide`),children:(0,U.jsx)(d,{className:`size-4`})})]}),j&&(0,U.jsx)(`div`,{className:`selectable mt-0.5 truncate pl-4 font-mono text-[12px] text-[var(--text-secondary)]`,children:j}),(t.apiVersionMismatch||t.updateAvailable)&&(0,U.jsxs)(`div`,{className:`mt-2 flex flex-wrap gap-1.5 pl-4`,children:[t.apiVersionMismatch&&(0,U.jsxs)(q,{tone:`orange`,children:[(0,U.jsx)(i,{className:`size-3`}),v(`tray.mismatch`)]}),t.updateAvailable&&(0,U.jsx)(`button`,{type:`button`,onClick:()=>C(`check-updates`),className:`cursor-default`,children:(0,U.jsx)(q,{tone:`accent`,children:v(`tray.update`)})})]})]}),(0,U.jsx)(`div`,{"data-tray-part":`tabs`,className:`shrink-0`,children:A&&(0,U.jsx)(J,{tabs:w,active:O,onChange:k})}),(0,U.jsx)(`div`,{className:`scroll min-h-0 flex-1 overflow-y-auto`,children:(0,U.jsx)(`div`,{"data-tray-part":`body`,className:`flex flex-col gap-3 px-4 py-3.5`,children:!t.running&&!x?(0,U.jsx)(re,{onStart:()=>C(`start`)}):(0,U.jsxs)(U.Fragment,{children:[O===`overview`&&(0,U.jsxs)(U.Fragment,{children:[(0,U.jsx)(ne,{prefs:e,data:r,onViewQuota:()=>k(`quota`)}),(0,U.jsx)(ae,{prefs:e,data:r,onRefresh:s}),e.sections.quota&&(0,U.jsx)(se,{data:r,onViewAll:()=>k(`quota`)})]}),O===`quota`&&(0,U.jsx)(ce,{data:r,plain:!0}),O===`clients`&&(0,U.jsx)(ue,{data:r,disabled:!S,onSwitch:f,plain:!0})]})})}),(0,U.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,U.jsxs)(U.Fragment,{children:[(0,U.jsx)(K,{label:v(`tray.restart`),onClick:()=>C(`restart`),disabled:x,children:(0,U.jsx)(D,{className:`size-4`})}),(0,U.jsx)(K,{label:v(`tray.stop`),onClick:()=>C(`stop`),disabled:x,children:(0,U.jsx)(te,{className:`size-4`})})]}):(0,U.jsx)(K,{label:v(`shell.startService`),onClick:()=>C(`start`),disabled:x,children:(0,U.jsx)(V,{className:`size-4`})}),(0,U.jsx)(`div`,{className:`flex-1`}),(0,U.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,U.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,U.jsx)(L,{className:`size-3.5`})]})]})]})});function K({label:e,onClick:t,disabled:n,children:r}){return(0,U.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 q({tone:e,children:t,title:n}){let r={red:`var(--danger)`,orange:`var(--warning)`,accent:`var(--accent)`,neutral:`var(--text-secondary)`}[e];return(0,U.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 J({tabs:e,active:t,onChange:r}){let{t:i}=n(),a={overview:i(`tray.tab.overview`),quota:i(`tray.tab.quota`),clients:i(`tray.clients`)};return(0,U.jsx)(`div`,{role:`tablist`,className:`flex gap-1 px-3 pt-2.5`,children:e.map(e=>(0,U.jsx)(`button`,{type:`button`,role:`tab`,"aria-selected":e===t,onClick:()=>r(e),className:c(`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 Y({tone:e,onClick:t,children:n}){let r=e===`red`?`var(--danger)`:`var(--warning)`,a={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]`,s=(0,U.jsxs)(U.Fragment,{children:[(0,U.jsx)(i,{className:`size-3.5 shrink-0`}),(0,U.jsx)(`span`,{className:`min-w-0 flex-1 truncate`,children:n})]});return t?(0,U.jsxs)(`button`,{type:`button`,onClick:t,className:c(o,`cursor-default`),style:a,children:[s,(0,U.jsx)(O,{className:`size-3.5 shrink-0`})]}):(0,U.jsx)(`div`,{className:o,style:a,children:s})}function ne({prefs:t,data:r,onViewQuota:i}){let{t:a,locale:o}=n(),s=r.summary,c=t.sections.overview&&s?m(s):0,l=t.sections.quota?T(r.plans):null,u=l&&l.row.remaining<30?l:null;return!s||c===0&&!u?null:(0,U.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[c>0&&(0,U.jsx)(Y,{tone:`red`,children:a(`tray.alert.failures`,{count:c,share:e(c/s.requests)})}),u&&(0,U.jsx)(Y,{tone:u.row.remaining<10?`red`:`orange`,onClick:i,children:a(`tray.alert.quota`,{plan:u.plan.providerName,window:Q(u.row,a,o),remaining:`${Math.round(u.row.remaining)}%`})})]})}function re({onStart:e}){let{t}=n();return(0,U.jsxs)(`div`,{className:`flex flex-col items-center gap-2 py-6 text-center`,children:[(0,U.jsx)(`div`,{className:`text-[13px] font-medium`,children:t(`tray.status.stopped`)}),(0,U.jsx)(`div`,{className:`max-w-[260px] text-[12px] text-[var(--text-secondary)]`,children:t(`tray.stoppedHint`)}),(0,U.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,U.jsx)(V,{className:`size-3.5`}),t(`shell.startService`)]})]})}function ie(e=3e4){let[t,n]=(0,H.useState)(()=>Date.now());return(0,H.useEffect)(()=>{let t=setInterval(()=>n(Date.now()),e);return()=>clearInterval(t)},[e]),t}function ae({prefs:t,data:r,onRefresh:i}){let{t:a,locale:o}=n(),c=ie(),l=r.summary,u=t.sections,d=u.overview||u.cost,p=l?l.inputTokens+l.outputTokens:0,m=x(r.updatedAt,o,a(`tray.justNow`),c),h=u.topModel?S(r.top,p):null,g=u.cacheHitRate&&l?M(l.cacheReadTokens,l.inputTokens):null,b=u.compareYesterday&&l?y(p,_(r.daily,new Date(c))):null,C=u.topModel||u.cacheHitRate||u.compareYesterday;return!d&&!u.chart&&!C?null:(0,U.jsxs)(`section`,{className:`flex flex-col gap-3`,children:[(0,U.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,U.jsx)(`span`,{className:`text-[13px] text-[var(--text-secondary)]`,children:a(`tray.today`)}),(0,U.jsx)(`div`,{className:`flex-1`}),m&&(0,U.jsx)(`span`,{className:`text-[12px] text-[var(--text-muted)]`,children:a(`tray.updated`,{time:m})}),(0,U.jsx)(K,{label:a(`common.refresh`),onClick:i,children:(0,U.jsx)(j,{className:`size-3.5`})})]}),l?(0,U.jsxs)(U.Fragment,{children:[d&&(0,U.jsxs)(`div`,{className:`grid auto-cols-fr grid-flow-col gap-px overflow-hidden rounded-[10px] bg-[var(--border)]`,children:[u.overview&&(0,U.jsx)(X,{label:a(`tray.requests`),value:s(l.requests,!0)}),u.overview&&(0,U.jsx)(X,{label:a(`tray.tokens`),value:s(p,!0)}),u.cost&&(0,U.jsx)(X,{label:a(`tray.cost`),value:v(l.costUsd)})]}),u.chart&&(0,U.jsx)(oe,{data:r,now:c}),C&&(0,U.jsxs)(`div`,{className:`flex flex-wrap gap-1.5`,children:[h&&(0,U.jsxs)(Z,{label:a(`tray.topModel`),title:h.model,children:[(0,U.jsx)(`span`,{className:`truncate`,children:h.model}),(0,U.jsxs)(`span`,{className:`shrink-0`,children:[`· `,e(h.share)]})]}),u.cacheHitRate&&(0,U.jsx)(Z,{label:a(`tray.cacheHit`),children:(0,U.jsx)(`span`,{children:g==null?`—`:e(g)})}),u.compareYesterday&&(0,U.jsx)(Z,{label:a(`tray.vsYesterday`),children:b==null?(0,U.jsx)(`span`,{children:`—`}):(0,U.jsxs)(`span`,{className:`inline-flex items-center gap-0.5`,children:[b>=0?(0,U.jsx)(L,{className:`size-3`}):(0,U.jsx)(F,{className:`size-3`}),e(Math.abs(b))]})})]})]}):r.error?(0,U.jsx)(`div`,{className:`text-[12px] text-[var(--danger)]`,children:a(`tray.loadFailed`)}):(0,U.jsx)(f,{lines:2})]})}function X({label:e,value:t}){return(0,U.jsxs)(`div`,{className:`min-w-0 bg-[var(--surface-muted)] px-3 py-2.5`,children:[(0,U.jsx)(`div`,{className:`truncate text-[12px] text-[var(--text-secondary)]`,children:e}),(0,U.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,U.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,U.jsx)(`span`,{className:`shrink-0 text-[var(--text-secondary)]`,children:e}),(0,U.jsx)(`span`,{className:`flex min-w-0 items-center gap-1 font-medium`,children:n})]})}function oe({data:e,now:t}){let{t:r}=n(),i=b(e.hourly,new Date(t)),a=Math.max(1,...i.map(e=>e.value)),o=new Date(t).getHours();return(0,U.jsx)(`div`,{role:`img`,"aria-label":r(`tray.chartLabel`),className:`flex h-16 items-end gap-[3px]`,children:i.map((e,t)=>{let n=e.value>0?Math.max(4,Math.round(e.value/a*64)):2;return(0,U.jsx)(`span`,{title:r(`tray.hourBar`,{hour:`${String(t).padStart(2,`0`)}:00`,count:e.value}),className:`flex-1 rounded-[2px]`,style:{height:n,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 se({data:e,onViewAll:t}){let{t:r,locale:i}=n();if(e.plans.length===0)return e.hasSubscriptions?(0,U.jsx)(`div`,{className:`border-t border-[var(--border)] pt-3 text-[12px] text-[var(--text-muted)]`,children:r(`tray.quotaPending`)}):null;let a=h(e.plans,3),o=e.plans.reduce((e,t)=>e+t.rows.length,0);return(0,U.jsxs)(`section`,{className:`flex flex-col gap-2 border-t border-[var(--border)] pt-3`,children:[(0,U.jsxs)(`div`,{className:`flex items-center text-[12px] text-[var(--text-secondary)]`,children:[(0,U.jsx)(`span`,{className:`flex-1`,children:r(`tray.quotaTightest`)}),o>a.length&&(0,U.jsxs)(`button`,{type:`button`,onClick:t,className:`inline-flex cursor-default items-center gap-0.5 hover:text-[var(--foreground)]`,children:[r(`tray.viewAll`),(0,U.jsx)(O,{className:`size-3`})]})]}),a.map(({plan:e,row:t},n)=>(0,U.jsxs)(`div`,{className:`grid grid-cols-[minmax(0,1fr)_64px_40px_60px] items-center gap-2 text-[12.5px]`,children:[(0,U.jsxs)(`span`,{className:`flex min-w-0 items-center gap-1.5`,children:[(0,U.jsx)(A,{name:e.providerName,icon:e.providerIcon,size:14}),(0,U.jsx)(`span`,{className:`truncate font-medium`,children:e.providerName}),(0,U.jsx)(`span`,{className:`shrink-0 text-[var(--text-secondary)]`,children:Q(t,r,i)})]}),(0,U.jsx)($,{row:t,locale:i})]},`${e.accountId}-${t.kind}-${n}`))]})}function ce({data:e,plain:t}){let{t:r}=n();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,U.jsxs)(`section`,{className:c(`flex flex-col gap-2`,!t&&`border-t border-[var(--border)] pt-3`),children:[(0,U.jsxs)(`div`,{className:`grid grid-cols-[1fr_48px_72px] items-center gap-2 text-[12px] text-[var(--text-secondary)]`,children:[(0,U.jsx)(`span`,{children:r(`tray.quota`)}),(0,U.jsx)(`span`,{className:`text-right`,children:r(`tray.quotaRemaining`)}),(0,U.jsx)(`span`,{className:`text-right`,children:r(`tray.quotaReset`)})]}),e.plans.length===0?(0,U.jsx)(`div`,{className:`text-[12px] text-[var(--text-muted)]`,children:r(`tray.quotaPending`)}):e.plans.map(e=>(0,U.jsx)(le,{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`):C(e.windowMinutes,n)}function $({row:e,locale:t}){let n=e.remaining,r=n===null?void 0:W[p(n)];return(0,U.jsxs)(U.Fragment,{children:[n===null?(0,U.jsx)(`span`,{}):(0,U.jsx)(`span`,{className:`h-1.5 overflow-hidden rounded-full bg-[var(--surface-muted)]`,children:(0,U.jsx)(`span`,{className:`block h-full rounded-full`,style:{width:`${n}%`,background:r}})}),e.amount?(0,U.jsx)(`span`,{className:`num col-span-2 truncate text-right font-medium`,children:w(e.amount.value,e.amount.unit,t)}):(0,U.jsxs)(U.Fragment,{children:[(0,U.jsx)(`span`,{className:`num text-right font-medium`,children:n===null?`—`:`${Math.round(n)}%`}),(0,U.jsx)(`span`,{className:`truncate text-right text-[var(--text-secondary)]`,children:g(e.resetsAt,t)??`—`})]})]})}function le({plan:e,showAccount:t}){let{t:r,locale:i}=n();return(0,U.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[(0,U.jsxs)(`div`,{className:`flex min-w-0 items-center gap-2`,children:[(0,U.jsx)(A,{name:e.providerName,icon:e.providerIcon,size:16}),(0,U.jsx)(`span`,{className:`truncate text-[13px] font-medium`,children:e.providerName}),t&&(0,U.jsx)(`span`,{className:`truncate text-[12px] text-[var(--text-muted)]`,children:e.accountName})]}),e.rows.map((e,t)=>{let n=Q(e,r,i);return(0,U.jsxs)(`div`,{className:`grid grid-cols-[52px_1fr_48px_72px] items-center gap-2 pl-6 text-[12.5px]`,children:[(0,U.jsx)(`span`,{className:`truncate text-[var(--text-secondary)]`,title:n,children:n}),(0,U.jsx)($,{row:e,locale:i})]},`${e.kind}-${t}`)})]})}function ue({data:e,disabled:t,onSwitch:r,plain:i}){let{t:a}=n(),o=e.clients.filter(e=>e.enabled);if(o.length===0)return null;let s=t=>e.providers.find(e=>e.id===t)?.name??a(`tray.unbound`);return(0,U.jsxs)(`section`,{className:c(`flex flex-col gap-1`,!i&&`border-t border-[var(--border)] pt-3`),children:[(0,U.jsx)(`div`,{className:`mb-0.5 text-[12px] text-[var(--text-secondary)]`,children:a(`tray.clients`)}),o.map(e=>(0,U.jsxs)(`button`,{type:`button`,disabled:t||!r,onClick:()=>r?.(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 k&&(0,U.jsx)(N,{kind:e.kind,size:16}),(0,U.jsx)(`span`,{className:`min-w-0 flex-1 truncate`,children:e.name}),(0,U.jsx)(`span`,{className:`max-w-[45%] truncate text-[12px] text-[var(--text-secondary)]`,children:s(e.providerId)}),r&&(0,U.jsx)(z,{className:`size-3.5 shrink-0 text-[var(--text-muted)]`})]},e.kind))]})}export{G as t};
|