omniroute 3.0.4 → 3.0.5

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.
Files changed (90) hide show
  1. package/app/.next/BUILD_ID +1 -1
  2. package/app/.next/build-manifest.json +2 -2
  3. package/app/.next/prerender-manifest.json +3 -3
  4. package/app/.next/server/app/(dashboard)/dashboard/a2a/page_client-reference-manifest.js +1 -1
  5. package/app/.next/server/app/(dashboard)/dashboard/agents/page_client-reference-manifest.js +1 -1
  6. package/app/.next/server/app/(dashboard)/dashboard/analytics/page_client-reference-manifest.js +1 -1
  7. package/app/.next/server/app/(dashboard)/dashboard/api-manager/page_client-reference-manifest.js +1 -1
  8. package/app/.next/server/app/(dashboard)/dashboard/audit-log/page_client-reference-manifest.js +1 -1
  9. package/app/.next/server/app/(dashboard)/dashboard/auto-combo/page_client-reference-manifest.js +1 -1
  10. package/app/.next/server/app/(dashboard)/dashboard/cli-tools/page_client-reference-manifest.js +1 -1
  11. package/app/.next/server/app/(dashboard)/dashboard/combos/page_client-reference-manifest.js +1 -1
  12. package/app/.next/server/app/(dashboard)/dashboard/costs/page_client-reference-manifest.js +1 -1
  13. package/app/.next/server/app/(dashboard)/dashboard/endpoint/page_client-reference-manifest.js +1 -1
  14. package/app/.next/server/app/(dashboard)/dashboard/health/page_client-reference-manifest.js +1 -1
  15. package/app/.next/server/app/(dashboard)/dashboard/limits/page_client-reference-manifest.js +1 -1
  16. package/app/.next/server/app/(dashboard)/dashboard/logs/page_client-reference-manifest.js +1 -1
  17. package/app/.next/server/app/(dashboard)/dashboard/mcp/page_client-reference-manifest.js +1 -1
  18. package/app/.next/server/app/(dashboard)/dashboard/media/page_client-reference-manifest.js +1 -1
  19. package/app/.next/server/app/(dashboard)/dashboard/onboarding/page_client-reference-manifest.js +1 -1
  20. package/app/.next/server/app/(dashboard)/dashboard/page_client-reference-manifest.js +1 -1
  21. package/app/.next/server/app/(dashboard)/dashboard/playground/page_client-reference-manifest.js +1 -1
  22. package/app/.next/server/app/(dashboard)/dashboard/profile/page_client-reference-manifest.js +1 -1
  23. package/app/.next/server/app/(dashboard)/dashboard/providers/[id]/page_client-reference-manifest.js +1 -1
  24. package/app/.next/server/app/(dashboard)/dashboard/providers/new/page_client-reference-manifest.js +1 -1
  25. package/app/.next/server/app/(dashboard)/dashboard/providers/page_client-reference-manifest.js +1 -1
  26. package/app/.next/server/app/(dashboard)/dashboard/search-tools/page_client-reference-manifest.js +1 -1
  27. package/app/.next/server/app/(dashboard)/dashboard/settings/page_client-reference-manifest.js +1 -1
  28. package/app/.next/server/app/(dashboard)/dashboard/settings/pricing/page_client-reference-manifest.js +1 -1
  29. package/app/.next/server/app/(dashboard)/dashboard/translator/page_client-reference-manifest.js +1 -1
  30. package/app/.next/server/app/(dashboard)/dashboard/usage/page_client-reference-manifest.js +1 -1
  31. package/app/.next/server/app/400/page_client-reference-manifest.js +1 -1
  32. package/app/.next/server/app/401/page_client-reference-manifest.js +1 -1
  33. package/app/.next/server/app/403/page_client-reference-manifest.js +1 -1
  34. package/app/.next/server/app/408/page_client-reference-manifest.js +1 -1
  35. package/app/.next/server/app/429/page_client-reference-manifest.js +1 -1
  36. package/app/.next/server/app/500/page_client-reference-manifest.js +1 -1
  37. package/app/.next/server/app/502/page_client-reference-manifest.js +1 -1
  38. package/app/.next/server/app/503/page_client-reference-manifest.js +1 -1
  39. package/app/.next/server/app/_global-error.html +2 -2
  40. package/app/.next/server/app/_global-error.rsc +1 -1
  41. package/app/.next/server/app/_global-error.segments/__PAGE__.segment.rsc +1 -1
  42. package/app/.next/server/app/_global-error.segments/_full.segment.rsc +1 -1
  43. package/app/.next/server/app/_global-error.segments/_head.segment.rsc +1 -1
  44. package/app/.next/server/app/_global-error.segments/_index.segment.rsc +1 -1
  45. package/app/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
  46. package/app/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
  47. package/app/.next/server/app/callback/page_client-reference-manifest.js +1 -1
  48. package/app/.next/server/app/docs/page_client-reference-manifest.js +1 -1
  49. package/app/.next/server/app/forbidden/page_client-reference-manifest.js +1 -1
  50. package/app/.next/server/app/forgot-password/page_client-reference-manifest.js +1 -1
  51. package/app/.next/server/app/landing/page_client-reference-manifest.js +1 -1
  52. package/app/.next/server/app/login/page_client-reference-manifest.js +1 -1
  53. package/app/.next/server/app/maintenance/page_client-reference-manifest.js +1 -1
  54. package/app/.next/server/app/offline/page_client-reference-manifest.js +1 -1
  55. package/app/.next/server/app/page_client-reference-manifest.js +1 -1
  56. package/app/.next/server/app/privacy/page_client-reference-manifest.js +1 -1
  57. package/app/.next/server/app/status/page_client-reference-manifest.js +1 -1
  58. package/app/.next/server/app/terms/page_client-reference-manifest.js +1 -1
  59. package/app/.next/server/chunks/[root-of-the-server]__051203a6._.js +1 -1
  60. package/app/.next/server/chunks/[root-of-the-server]__0891af92._.js +1 -1
  61. package/app/.next/server/chunks/[root-of-the-server]__1f2b0d89._.js +1 -1
  62. package/app/.next/server/chunks/[root-of-the-server]__46e00e59._.js +1 -1
  63. package/app/.next/server/chunks/[root-of-the-server]__6e52619e._.js +1 -1
  64. package/app/.next/server/chunks/[root-of-the-server]__7ace0fcd._.js +1 -1
  65. package/app/.next/server/chunks/[root-of-the-server]__7fa4d14e._.js +1 -1
  66. package/app/.next/server/chunks/_05c48915._.js +1 -1
  67. package/app/.next/server/chunks/_06515a8a._.js +1 -1
  68. package/app/.next/server/chunks/_2115d8de._.js +1 -1
  69. package/app/.next/server/chunks/_3ac953eb._.js +1 -1
  70. package/app/.next/server/chunks/_4b8fd853._.js +1 -1
  71. package/app/.next/server/chunks/_68683848._.js +1 -1
  72. package/app/.next/server/chunks/_ee9b677b._.js +1 -1
  73. package/app/.next/server/chunks/ssr/[root-of-the-server]__9ef96d20._.js +1 -1
  74. package/app/.next/server/chunks/ssr/[root-of-the-server]__a6942102._.js +1 -1
  75. package/app/.next/server/chunks/ssr/src_app_(dashboard)_dashboard_936a9ee0._.js +1 -1
  76. package/app/.next/server/pages/500.html +2 -2
  77. package/app/.next/server/server-reference-manifest.js +1 -1
  78. package/app/.next/server/server-reference-manifest.json +1 -1
  79. package/app/.next/static/chunks/{dbc46fb277f133dc.js → 25a3e05da8e1a7ec.js} +1 -1
  80. package/app/.next/static/chunks/3f18998354dd49b9.js +1 -0
  81. package/app/CHANGELOG.md +8 -0
  82. package/app/docs/openapi.yaml +1 -1
  83. package/app/package-lock.json +2 -2
  84. package/app/package.json +1 -1
  85. package/app/src/app/(dashboard)/dashboard/usage/components/ProviderLimits/index.tsx +16 -3
  86. package/package.json +1 -1
  87. package/app/.next/static/chunks/7df0b3c357097db5.js +0 -1
  88. /package/app/.next/static/{TZMQMpHs8mN-4BNVBHMGq → _Ub91T2wbB96WfkKKwhDH}/_buildManifest.js +0 -0
  89. /package/app/.next/static/{TZMQMpHs8mN-4BNVBHMGq → _Ub91T2wbB96WfkKKwhDH}/_clientMiddlewareManifest.json +0 -0
  90. /package/app/.next/static/{TZMQMpHs8mN-4BNVBHMGq → _Ub91T2wbB96WfkKKwhDH}/_ssgManifest.js +0 -0
@@ -0,0 +1 @@
1
+ (globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,565650,e=>{"use strict";e.i(342923),e.i(80173),e.i(907714),e.i(393718),e.i(703166),e.i(454149),e.i(822124),e.i(969353),e.i(635055),e.i(897844),e.i(450222),e.i(647829),e.i(6998),e.i(982131),e.i(116016),e.i(279743),e.i(193464),e.i(548036),e.i(566770),e.i(953789),e.i(8839),e.i(227404),e.i(621745),e.i(567955),e.i(17517),e.i(419947),e.i(323060),e.i(642440),e.i(629342),e.i(816062),e.i(690777),e.i(563201),e.i(115243),e.i(165149),e.i(359505),e.s([],565650)},11477,e=>{"use strict";var t=e.i(393718);e.s(["Card",()=>t.default])},659497,e=>{"use strict";var t=e.i(843476),s=e.i(271645);e.i(565650);var r=e.i(454149),a=e.i(948148),n=e.i(657688),l=e.i(25230),i=e.i(243009);function o(e,t={},s={}){let r=Number(t?.used||0),a=Number(t?.total||0),n=t?.resetAt||null,l=function(e){if(!e)return!1;let t="number"==typeof e?e:"string"==typeof e?Date.parse(e):NaN;return!!Number.isFinite(t)&&Date.now()>=t}(n),c=l?0:r,d=Number.isFinite(a)?a:0,u=(0,i.safePercentage)(t?.remainingPercentage),x=l&&d>0?100:void 0!==u?u:void 0;return{name:e,used:Number.isFinite(c)?c:0,total:d,resetAt:n,staleAfterReset:l,...void 0!==x?{remainingPercentage:x}:{},...s}}function c(e){let t="string"==typeof e?e.trim():"";if(!t)return{key:"unknown",label:"Unknown",variant:"default",rank:0,raw:null};let s=t.toUpperCase();return"CLAUDE CODE"===s||"KIMI CODING"===s||"KIRO"===s?{key:"unknown",label:t,variant:"default",rank:0,raw:t}:s.includes("PRO+")||s.includes("PRO PLUS")||s.includes("PROPLUS")?{key:"plus",label:"Pro+",variant:"secondary",rank:4,raw:t}:s.includes("ENTERPRISE")||s.includes("CORP")||s.includes("ORG")?{key:"enterprise",label:"Enterprise",variant:"info",rank:7,raw:t}:s.includes("TEAM")||s.includes("CHATGPTTEAM")?{key:"team",label:"Team",variant:"info",rank:6,raw:t}:s.includes("BUSINESS")||s.includes("STANDARD")||s.includes("BIZ")?{key:"business",label:"Business",variant:"warning",rank:5,raw:t}:s.includes("STUDENT")?{key:"pro",label:"Student",variant:"primary",rank:3,raw:t}:s.includes("ULTRA")?{key:"ultra",label:"Ultra",variant:"success",rank:4,raw:t}:s.includes("PRO")||s.includes("PREMIUM")?{key:"pro",label:"Pro",variant:"primary",rank:3,raw:t}:s.includes("PLUS")||s.includes("PAID")?{key:"plus",label:"Plus",variant:"secondary",rank:2,raw:t}:s.includes("FREE")||s.includes("BASIC")||s.includes("TRIAL")||s.includes("LEGACY")?{key:"free",label:"Free",variant:"default",rank:1,raw:t}:{key:"unknown",label:t.toLowerCase().split(/[\s_-]+/).map(e=>e.charAt(0).toUpperCase()+e.slice(1)).join(" ")||"Unknown",variant:"default",rank:0,raw:t}}var d=e.i(393718),u=e.i(969353),x=e.i(623249);let m="omniroute:limits:groupBy",p="omniroute:limits:autoRefresh",h="omniroute:limits:expandedGroups",b={antigravity:{label:"Antigravity",color:"#F59E0B"},github:{label:"GitHub Copilot",color:"#333"},kiro:{label:"Kiro AI",color:"#FF6B35"},codex:{label:"OpenAI Codex",color:"#10A37F"},claude:{label:"Claude Code",color:"#D97757"},glm:{label:"GLM (Z.AI)",color:"#4A90D9"},"kimi-coding":{label:"Kimi Coding",color:"#1E3A8A"}},f=[{key:"all",labelKey:"tierAll"},{key:"enterprise",labelKey:"tierEnterprise"},{key:"team",labelKey:"tierTeam"},{key:"business",labelKey:"tierBusiness"},{key:"ultra",labelKey:"tierUltra"},{key:"pro",labelKey:"tierPro"},{key:"plus",labelKey:"tierPlus"},{key:"free",labelKey:"tierFree"},{key:"unknown",labelKey:"tierUnknown"}];function g(){let e,i=(0,a.useTranslations)("usage"),[g,y]=(0,s.useState)([]),[v,j]=(0,s.useState)({}),[k,N]=(0,s.useState)({}),[w,S]=(0,s.useState)({}),[E,C]=(0,s.useState)(()=>"true"===localStorage.getItem(p)),[I,P]=(0,s.useState)(null),[T,A]=(0,s.useState)(!1),[M,R]=(0,s.useState)(120),[O,D]=(0,s.useState)(!0),[q,U]=(0,s.useState)("all"),[F,K]=(0,s.useState)(()=>{let e=localStorage.getItem(m);return"environment"===e||"none"===e?e:"none"}),[L,_]=(0,s.useState)(()=>{try{let e=localStorage.getItem(h);return e?new Set(JSON.parse(e)):new Set}catch{return new Set}}),B=(0,s.useRef)(null),G=(0,s.useRef)(null),$=(0,s.useRef)({}),H=(0,s.useRef)({}),Q=(0,s.useCallback)(async()=>{try{let e=await fetch("/api/providers/client");if(!e.ok)throw Error("Failed");let t=(await e.json()).connections||[];return y(t),t}catch{return y([]),[]}},[]),z=(0,s.useCallback)(async(e,t,s={})=>{let r=s?.force===!0,a=Date.now(),n=$.current[e]||0;if(r||!(a-n<3e4)){$.current[e]=a,N(t=>({...t,[e]:!0})),S(t=>({...t,[e]:null}));try{let s=await fetch(`/api/usage/${e}`);if(!s.ok){let t=(await s.json().catch(()=>({}))).error||s.statusText;if(404===s.status)return;if(401===s.status)return void j(s=>({...s,[e]:{quotas:[],message:t}}));throw Error(`HTTP ${s.status}: ${t}`)}let r=await s.json(),a=function(e,t){if(!t||"object"!=typeof t)return[];let s=[];try{switch(e.toLowerCase()){case"github":t.quotas&&Object.entries(t.quotas).forEach(([e,t])=>{(!t?.unlimited||t?.total&&!(t.total<=0))&&s.push(o(e,t))});break;case"antigravity":t.quotas&&Object.entries(t.quotas).forEach(([e,t])=>{s.push(o(t.displayName||e,t,{modelKey:e}))});break;case"codex":t.quotas&&Object.entries(t.quotas).forEach(([e,t])=>{s.push(o(e,t))});break;case"kiro":t.quotas&&Object.entries(t.quotas).forEach(([e,t])=>{s.push(o(e,t))});break;case"claude":t.message?s.push({name:"error",used:0,total:0,resetAt:null,message:t.message}):t.quotas&&Object.entries(t.quotas).forEach(([e,t])=>{s.push(o(e,t))});break;default:t.quotas&&Object.entries(t.quotas).forEach(([e,t])=>{s.push(o(e,t))})}}catch(t){return console.error(`Error parsing quota data for ${e}:`,t),[]}let r=(0,l.getModelsByProviderId)(e);if(r.length>0){let e=new Map(r.map((e,t)=>[e.id,t]));s.sort((t,s)=>{let r=t.modelKey||t.name,a=s.modelKey||s.name;return(e.get(r)??999)-(e.get(a)??999)})}return s}(t,r);if(a.some(e=>e?.staleAfterReset===!0)){let s=H.current[e]||0;Date.now()-s>=3e4&&(H.current[e]=Date.now(),setTimeout(()=>{z(e,t,{force:!0}).catch(()=>{})},5e3))}j(t=>({...t,[e]:{quotas:a,plan:r.plan||null,message:r.message||null,raw:r}}))}catch(t){S(s=>({...s,[e]:t.message||"Failed to fetch quota"}))}finally{N(t=>({...t,[e]:!1}))}}},[]),J=(0,s.useCallback)(async(e,t)=>{await z(e,t),P(new Date)},[z]),V=(0,s.useCallback)(async()=>{if(!T){A(!0),R(120);try{let e=(await Q()).filter(e=>x.USAGE_SUPPORTED_PROVIDERS.includes(e.provider)&&("oauth"===e.authType||"apikey"===e.authType));await Promise.all(e.map(e=>z(e.id,e.provider))),P(new Date)}catch(e){console.error("Error refreshing all:",e)}finally{A(!1)}}},[T,Q,z]);(0,s.useEffect)(()=>{(async()=>{D(!0),await V(),D(!1)})()},[]),(0,s.useEffect)(()=>{if(!E){B.current&&clearInterval(B.current),G.current&&clearInterval(G.current);return}return B.current=setInterval(V,12e4),G.current=setInterval(()=>{R(e=>e<=1?120:e-1)},1e3),()=>{B.current&&clearInterval(B.current),G.current&&clearInterval(G.current)}},[E,V]),(0,s.useEffect)(()=>{let e=()=>{document.hidden?(B.current&&clearInterval(B.current),G.current&&clearInterval(G.current)):E&&(B.current=setInterval(V,12e4),G.current=setInterval(()=>{R(e=>e<=1?120:e-1)},1e3))};return document.addEventListener("visibilitychange",e),()=>document.removeEventListener("visibilitychange",e)},[E,V]);let W=(0,s.useMemo)(()=>g.filter(e=>x.USAGE_SUPPORTED_PROVIDERS.includes(e.provider)&&("oauth"===e.authType||"apikey"===e.authType)),[g]),Z=(0,s.useMemo)(()=>{let e={antigravity:1,github:2,codex:3,claude:4,kiro:5,glm:6,"kimi-coding":7};return[...W].sort((t,s)=>(e[t.provider]||9)-(e[s.provider]||9))},[W]),Y=(0,s.useMemo)(()=>{let e={};for(let t of Z)e[t.id]=c(v[t.id]?.plan);return e},[Z,v]),X=(0,s.useMemo)(()=>{let e={all:Z.length,enterprise:0,team:0,business:0,ultra:0,pro:0,free:0,unknown:0};for(let t of Z){let s=Y[t.id]?.key||"unknown";e[s]=(e[s]||0)+1}return e},[Z,Y]),ee=(0,s.useMemo)(()=>"all"===q?Z:Z.filter(e=>(Y[e.id]?.key||"unknown")===q),[Z,Y,q]),et=(0,s.useMemo)(()=>{if("environment"!==F)return null;let e=new Map;for(let t of ee){let s=t.providerSpecificData?.tag?.trim()||i("ungrouped");e.has(s)||e.set(s,[]),e.get(s).push(t)}return new Map([...e.entries()].sort(([e],[t])=>e===i("ungrouped")?1:t===i("ungrouped")?-1:e.localeCompare(t)))},[F,ee,i]),es=e=>{K(e),localStorage.setItem(m,e)};return((0,s.useEffect)(()=>{null===localStorage.getItem(m)&&g.some(e=>e.providerSpecificData?.tag?.trim())&&K("environment")},[g]),(0,s.useEffect)(()=>{if("environment"===F&&et&&0===L.size){let e=new Set([...et.keys()]);_(e),localStorage.setItem(h,JSON.stringify([...e]))}},[F,et]),O)?(0,t.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,t.jsx)(r.CardSkeleton,{}),(0,t.jsx)(r.CardSkeleton,{})]}):0===Z.length?(0,t.jsx)(d.default,{padding:"lg",children:(0,t.jsxs)("div",{className:"text-center py-12",children:[(0,t.jsx)("span",{className:"material-symbols-outlined text-[64px] opacity-15",children:"cloud_off"}),(0,t.jsx)("h3",{className:"mt-4 text-lg font-semibold text-text-main",children:i("noProviders")}),(0,t.jsx)("p",{className:"mt-2 text-sm text-text-muted max-w-[400px] mx-auto",children:i("connectProvidersForQuota")})]})}):(0,t.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between flex-wrap gap-3",children:[(0,t.jsxs)("div",{className:"flex items-center gap-3",children:[(0,t.jsx)("h2",{className:"text-lg font-semibold text-text-main m-0",children:i("providerLimits")}),(0,t.jsxs)("span",{className:"text-[13px] text-text-muted",children:[i("accountsCount",{count:ee.length}),ee.length!==Z.length&&` ${i("filteredFromCount",{count:Z.length})}`]})]}),(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsxs)("div",{className:"flex rounded-lg border border-border overflow-hidden",children:[(0,t.jsx)("button",{onClick:()=>es("none"),className:"px-2.5 py-1.5 text-[12px] font-medium cursor-pointer border-none",style:{background:"none"===F?"var(--color-bg-subtle)":"transparent",color:"none"===F?"var(--color-text-main)":"var(--color-text-muted)"},children:i("viewFlat")}),(0,t.jsx)("button",{onClick:()=>es("environment"),className:"px-2.5 py-1.5 text-[12px] font-medium cursor-pointer border-none",style:{background:"environment"===F?"var(--color-bg-subtle)":"transparent",color:"environment"===F?"var(--color-text-main)":"var(--color-text-muted)",borderLeft:"1px solid var(--color-border)"},children:i("viewByEnvironment")})]}),(0,t.jsxs)("button",{onClick:()=>{let e=!E;C(e),localStorage.setItem(p,String(e))},className:"flex items-center gap-1.5 px-3 py-1.5 rounded-lg border border-border bg-transparent cursor-pointer text-text-main text-[13px]",children:[(0,t.jsx)("span",{className:"material-symbols-outlined text-[18px]",style:{color:E?"#22c55e":"var(--text-muted)"},children:E?"toggle_on":"toggle_off"}),i("autoRefresh"),E&&(0,t.jsxs)("span",{className:"text-xs text-text-muted",children:["(",M,"s)"]})]}),(0,t.jsxs)("button",{onClick:V,disabled:T,className:"flex items-center gap-1.5 px-3.5 py-1.5 rounded-lg bg-bg-subtle border border-border text-text-main text-[13px] disabled:opacity-50 disabled:cursor-not-allowed cursor-pointer",children:[(0,t.jsx)("span",{className:`material-symbols-outlined text-[16px] ${T?"animate-spin":""}`,children:"refresh"}),i("refreshAll")]})]})]}),(0,t.jsx)("div",{className:"flex items-center gap-2 flex-wrap",children:f.map(e=>{if("all"!==e.key&&!X[e.key])return null;let s=q===e.key;return(0,t.jsxs)("button",{onClick:()=>U(e.key),className:"inline-flex items-center gap-1.5 px-2.5 py-1 rounded-full text-xs font-semibold cursor-pointer",style:{border:s?"1px solid var(--color-primary, #E54D5E)":"1px solid var(--color-border)",background:s?"rgba(229,77,94,0.1)":"transparent",color:s?"var(--color-primary, #E54D5E)":"var(--color-text-muted)"},children:[(0,t.jsx)("span",{children:i(e.labelKey)}),(0,t.jsx)("span",{className:"opacity-85",children:X[e.key]||0})]},e.key)})}),(0,t.jsxs)("div",{className:"rounded-xl border border-border overflow-hidden bg-bg-subtle",children:[(0,t.jsxs)("div",{className:"items-center px-4 py-2.5 border-b border-border text-[11px] font-semibold uppercase tracking-wider text-text-muted",style:{display:"grid",gridTemplateColumns:"280px 1fr 100px 48px"},children:[(0,t.jsx)("div",{children:i("account")}),(0,t.jsx)("div",{children:i("modelQuotas")}),(0,t.jsx)("div",{className:"text-center",children:i("lastUsed")}),(0,t.jsx)("div",{className:"text-center",children:i("actions")})]}),(e=(e,s)=>{let r=v[e.id],a=k[e.id],l=w[e.id],o=b[e.provider]||{label:e.provider,color:"#666"},d=Y[e.id]||c(null);return(0,t.jsxs)("div",{className:"items-center px-4 py-3.5 transition-[background] duration-150 hover:bg-black/[0.03] dark:hover:bg-white/[0.02]",style:{display:"grid",gridTemplateColumns:"280px 1fr 100px 48px",borderBottom:s?"none":"1px solid var(--color-border)"},children:[(0,t.jsxs)("div",{className:"flex items-center gap-2.5 min-w-0",children:[(0,t.jsx)("div",{className:"w-8 h-8 rounded-lg flex items-center justify-center overflow-hidden shrink-0",children:(0,t.jsx)(n.default,{src:`/providers/${e.provider}.png`,alt:e.provider,width:32,height:32,className:"object-contain",sizes:"32px"})}),(0,t.jsxs)("div",{className:"min-w-0",children:[(0,t.jsx)("div",{className:"text-[13px] font-semibold text-text-main truncate",children:e.name||o.label}),(0,t.jsxs)("div",{className:"flex items-center gap-1.5 mt-0.5",children:[(0,t.jsx)("span",{title:r?.plan?i("rawPlanWithValue",{plan:r.plan}):i("noPlanFromProvider"),children:(0,t.jsx)(u.default,{variant:d.variant,size:"sm",dot:!0,children:d.label})}),(0,t.jsx)("span",{className:"text-[11px] text-text-muted",children:o.label})]})]})]}),(0,t.jsx)("div",{className:"flex flex-wrap gap-x-3 gap-y-1.5 pr-3",children:a?(0,t.jsxs)("div",{className:"flex items-center gap-1.5 text-text-muted text-xs",children:[(0,t.jsx)("span",{className:"material-symbols-outlined animate-spin text-[14px]",children:"progress_activity"}),i("loadingQuotas")]}):l?(0,t.jsxs)("div",{className:"flex items-center gap-1.5 text-xs text-red-500",children:[(0,t.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"error"}),(0,t.jsx)("span",{className:"overflow-hidden text-ellipsis whitespace-nowrap max-w-[300px]",children:l})]}):r?.message&&(!r.quotas||0===r.quotas.length)?(0,t.jsx)("div",{className:"text-xs text-text-muted italic",children:r.message}):r?.quotas?.length>0?r.quotas.map((e,s)=>{var r,a,n;let l=void 0!==e.remainingPercentage?Math.round(e.remainingPercentage):(r=e.used,(a=e.total)&&0!==a?!r||r<0?100:r>=a?0:Math.round((a-r)/a*100):0),i=l>70?{bar:"#22c55e",text:"#22c55e",bg:"rgba(34,197,94,0.12)"}:l>=30?{bar:"#eab308",text:"#eab308",bg:"rgba(234,179,8,0.12)"}:{bar:"#ef4444",text:"#ef4444",bg:"rgba(239,68,68,0.12)"},o=function(e){if(!e)return null;try{let t=new Date(e)-new Date;if(t<=0)return null;let s=Math.floor(t/36e5),r=Math.floor(t%36e5/6e4);if(s>=24){let e=Math.floor(s/24);return`${e}d ${s%24}h`}return`${s}h ${r}m`}catch{return null}}(e.resetAt),c={"gemini-3-pro-high":"G3 Pro","gemini-3-pro-low":"G3 Pro Low","gemini-3-flash":"G3 Flash","gemini-2.5-flash":"G2.5 Flash","claude-opus-4-6-thinking":"Opus 4.6 Tk","claude-opus-4-5-thinking":"Opus 4.5 Tk","claude-opus-4-5":"Opus 4.5","claude-sonnet-4-5-thinking":"Sonnet 4.5 Tk","claude-sonnet-4-5":"Sonnet 4.5",chat:"Chat",completions:"Completions",premium_interactions:"Premium",session:"Session",weekly:"Weekly",agentic_request:"Agentic",agentic_request_freetrial:"Agentic (Trial)"}[n=e.name]||n,d=!0===e.staleAfterReset;return(0,t.jsxs)("div",{className:"flex items-center gap-1.5 min-w-[200px] shrink-0",children:[(0,t.jsx)("span",{className:"text-[11px] font-semibold py-0.5 px-2 rounded whitespace-nowrap min-w-[60px] text-center",style:{background:i.bg,color:i.text},children:c}),d?(0,t.jsx)("span",{className:"text-[10px] text-text-muted whitespace-nowrap",children:"⟳ Refreshing..."}):o?(0,t.jsxs)("span",{className:"text-[10px] text-text-muted whitespace-nowrap",children:["⏱ ",o]}):null,(0,t.jsx)("div",{className:"flex-1 h-1.5 rounded-sm bg-black/[0.06] dark:bg-white/[0.06] min-w-[60px] overflow-hidden",children:(0,t.jsx)("div",{className:"h-full rounded-sm transition-[width] duration-300 ease-out",style:{width:`${Math.min(l,100)}%`,background:i.bar}})}),(0,t.jsxs)("span",{className:"text-[11px] font-semibold min-w-[32px] text-right",style:{color:i.text},children:[l,"%"]})]},s)}):(0,t.jsx)("div",{className:"text-xs text-text-muted italic",children:i("noQuotaData")})}),(0,t.jsx)("div",{className:"text-center text-[11px] text-text-muted",children:I?(0,t.jsx)("span",{children:I.toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"})}):"-"}),(0,t.jsx)("div",{className:"flex justify-center gap-0.5",children:(0,t.jsx)("button",{onClick:()=>J(e.id,e.provider),disabled:a,title:i("refreshQuota"),className:"p-1 rounded-md border-none bg-transparent cursor-pointer disabled:cursor-not-allowed disabled:opacity-30 opacity-60 hover:opacity-100 flex items-center justify-center transition-opacity duration-150",children:(0,t.jsx)("span",{className:`material-symbols-outlined text-[16px] text-text-muted ${a?"animate-spin":""}`,children:"refresh"})})})]},e.id)},et?[...et.entries()].map(([s,r])=>(0,t.jsxs)("div",{className:"border border-border rounded-lg overflow-hidden mb-2",children:[(0,t.jsxs)("button",{onClick:()=>{_(e=>{let t=new Set(e);return t.has(s)?t.delete(s):t.add(s),localStorage.setItem(h,JSON.stringify([...t])),t})},className:"w-full flex items-center gap-2 px-4 py-2.5 bg-bg-subtle hover:bg-black/[0.04] dark:hover:bg-white/[0.05] transition-colors text-left border-none cursor-pointer",children:[(0,t.jsx)("span",{className:"material-symbols-outlined text-[16px] text-text-muted",children:L.has(s)?"expand_less":"expand_more"}),(0,t.jsx)("span",{className:"material-symbols-outlined text-[16px] text-text-muted",children:"folder"}),(0,t.jsx)("span",{className:"text-[12px] font-semibold text-text-main uppercase tracking-wider flex-1",children:s}),(0,t.jsx)("span",{className:"text-[11px] text-text-muted bg-black/[0.04] dark:bg-white/[0.06] px-2 py-0.5 rounded-full",children:r.length})]}),L.has(s)&&(0,t.jsx)("div",{children:r.map((t,s)=>e(t,s===r.length-1))})]},s)):ee.map((t,s)=>e(t,s===ee.length-1))),0===ee.length&&(0,t.jsxs)("div",{className:"py-6 px-4 text-center text-text-muted text-[13px]",children:[i("noAccountsForTierFilter")," ",(0,t.jsx)("strong",{children:i(f.find(e=>e.key===q)?.labelKey||"tierUnknown")}),"."]})]})]})}var y=e.i(11477);function v(){let e=(0,a.useTranslations)("usage"),r=(0,a.useTranslations)("common"),[n,l]=(0,s.useState)({lockouts:[],cacheStats:null}),[i,o]=(0,s.useState)(!0),c=(0,s.useCallback)(async()=>{try{let e=await fetch("/api/rate-limits");e.ok&&l(await e.json())}catch{}finally{o(!1)}},[]);return(0,s.useEffect)(()=>{c();let e=setInterval(c,1e4);return()=>clearInterval(e)},[c]),(0,t.jsx)("div",{className:"flex flex-col gap-4",children:(0,t.jsxs)(y.Card,{children:[(0,t.jsxs)("div",{className:"flex items-center gap-3 mb-4",children:[(0,t.jsx)("div",{className:"p-2 rounded-lg bg-orange-500/10 text-orange-500",children:(0,t.jsx)("span",{className:"material-symbols-outlined text-[20px]","aria-hidden":"true",children:"lock_clock"})}),(0,t.jsxs)("div",{className:"flex-1",children:[(0,t.jsx)("h3",{className:"text-lg font-semibold",children:e("modelLockouts")}),(0,t.jsx)("p",{className:"text-sm text-text-muted",children:e("lockoutsAutoRefreshHint")})]}),n.lockouts.length>0&&(0,t.jsx)("span",{className:"px-2.5 py-1 rounded-full text-xs font-semibold bg-orange-500/10 text-orange-400 border border-orange-500/20",children:e("lockedCount",{count:n.lockouts.length})})]}),0===n.lockouts.length?(0,t.jsxs)("div",{className:"text-center py-6 text-text-muted",children:[(0,t.jsx)("span",{className:"material-symbols-outlined text-[32px] mb-2 block opacity-40","aria-hidden":"true",children:"lock_open"}),(0,t.jsx)("p",{className:"text-sm",children:e("noLockouts")})]}):(0,t.jsx)("div",{className:"flex flex-col gap-2",children:n.lockouts.map((s,a)=>{var n;return(0,t.jsxs)("div",{className:"flex items-center justify-between px-3 py-2.5 rounded-lg bg-orange-500/5 border border-orange-500/15",children:[(0,t.jsxs)("div",{className:"flex items-center gap-3",children:[(0,t.jsx)("span",{className:"material-symbols-outlined text-[16px] text-orange-400","aria-hidden":"true",children:"lock"}),(0,t.jsxs)("div",{children:[(0,t.jsx)("p",{className:"text-sm font-medium",children:s.model}),(0,t.jsxs)("p",{className:"text-xs text-text-muted",children:[e("account"),":"," ",(0,t.jsx)("span",{className:"font-mono",children:s.accountId?.slice(0,12)||r("none")}),s.reason&&(0,t.jsxs)(t.Fragment,{children:[e("reasonSeparator"),s.reason]})]})]})]}),(0,t.jsx)("span",{className:"text-xs font-mono tabular-nums text-orange-400",children:e("timeLeft",{time:(n=s.remainingMs)<1e3?e("durationMillisecondsShort",{value:n}):n<6e4?e("durationSecondsShort",{value:Math.ceil(n/1e3)}):e("durationMinutesShort",{value:Math.ceil(n/6e4)})})})]},a)})})]})})}function j(){let e=(0,a.useTranslations)("usage"),[r,n]=(0,s.useState)({count:0,sessions:[]}),[l,i]=(0,s.useState)(!0),o=(0,s.useCallback)(async()=>{try{let e=await fetch("/api/sessions");e.ok&&n(await e.json())}catch{}finally{i(!1)}},[]);return(0,s.useEffect)(()=>{o();let e=setInterval(o,5e3);return()=>clearInterval(e)},[o]),(0,t.jsxs)(y.Card,{children:[(0,t.jsxs)("div",{className:"flex items-center gap-3 mb-5",children:[(0,t.jsx)("div",{className:"p-2 rounded-lg bg-cyan-500/10 text-cyan-500",children:(0,t.jsx)("span",{className:"material-symbols-outlined text-[20px]","aria-hidden":"true",children:"fingerprint"})}),(0,t.jsxs)("div",{className:"flex-1",children:[(0,t.jsx)("h3",{className:"text-lg font-semibold",children:e("activeSessions")}),(0,t.jsx)("p",{className:"text-sm text-text-muted",children:e("sessionsTrackedHint")})]}),(0,t.jsx)("div",{className:"flex items-center gap-2",children:(0,t.jsxs)("span",{className:"flex items-center gap-1.5 px-3 py-1.5 rounded-full bg-cyan-500/10 border border-cyan-500/20",children:[(0,t.jsx)("span",{className:"w-2 h-2 rounded-full bg-cyan-500 animate-pulse"}),(0,t.jsx)("span",{className:"text-sm font-semibold tabular-nums text-cyan-400",children:r.count})]})})]}),0===r.sessions.length?(0,t.jsxs)("div",{className:"text-center py-8 text-text-muted",children:[(0,t.jsx)("span",{className:"material-symbols-outlined text-[40px] mb-2 block opacity-40","aria-hidden":"true",children:"fingerprint"}),(0,t.jsx)("p",{className:"text-sm",children:e("noSessions")}),(0,t.jsx)("p",{className:"text-xs mt-1",children:e("sessionsHint")})]}):(0,t.jsx)("div",{className:"overflow-x-auto",children:(0,t.jsxs)("table",{className:"w-full text-sm",children:[(0,t.jsx)("thead",{children:(0,t.jsxs)("tr",{className:"border-b border-border/30",children:[(0,t.jsx)("th",{className:"text-left py-2 px-3 text-xs font-semibold text-text-muted uppercase tracking-wider",children:e("session")}),(0,t.jsx)("th",{className:"text-left py-2 px-3 text-xs font-semibold text-text-muted uppercase tracking-wider",children:e("age")}),(0,t.jsx)("th",{className:"text-right py-2 px-3 text-xs font-semibold text-text-muted uppercase tracking-wider",children:e("requests")}),(0,t.jsx)("th",{className:"text-left py-2 px-3 text-xs font-semibold text-text-muted uppercase tracking-wider",children:e("connection")})]})}),(0,t.jsx)("tbody",{children:r.sessions.map(s=>{var r;return(0,t.jsxs)("tr",{className:"border-b border-border/10 hover:bg-surface/20 transition-colors",children:[(0,t.jsx)("td",{className:"py-2.5 px-3",children:(0,t.jsxs)("span",{className:"font-mono text-xs px-2 py-1 rounded bg-surface/40 text-text-muted",children:[s.sessionId.slice(0,12),"…"]})}),(0,t.jsx)("td",{className:"py-2.5 px-3 text-text-muted tabular-nums",children:(r=s.ageMs)<6e4?e("durationSecondsShort",{value:Math.floor(r/1e3)}):r<36e5?e("durationMinutesShort",{value:Math.floor(r/6e4)}):e("durationHoursShort",{value:Math.floor(r/36e5)})}),(0,t.jsx)("td",{className:"py-2.5 px-3 text-right",children:(0,t.jsx)("span",{className:"font-semibold tabular-nums",children:s.requestCount})}),(0,t.jsx)("td",{className:"py-2.5 px-3",children:s.connectionId?(0,t.jsx)("span",{className:"text-xs font-mono text-cyan-400",children:s.connectionId.slice(0,10)}):(0,t.jsx)("span",{className:"text-text-muted/40",children:e("notAvailableSymbol")})})]},s.sessionId)})})]})})]})}function k(){return(0,t.jsxs)("div",{className:"flex flex-col gap-6",children:[(0,t.jsx)(s.Suspense,{fallback:(0,t.jsx)(r.CardSkeleton,{}),children:(0,t.jsx)(g,{})}),(0,t.jsx)(j,{}),(0,t.jsx)(v,{})]})}e.s(["default",()=>k],659497)}]);
package/app/CHANGELOG.md CHANGED
@@ -4,6 +4,14 @@
4
4
 
5
5
  ---
6
6
 
7
+ ## [3.0.5] — 2026-03-25
8
+
9
+ ### ✨ New Features
10
+
11
+ - **Limits UI:** Added tag grouping feature to the connections dashboard to improve visual organization for accounts with custom tags.
12
+
13
+ ---
14
+
7
15
  ## [3.0.4] — 2026-03-25
8
16
 
9
17
  ### 🐛 Bug Fixes
@@ -1,7 +1,7 @@
1
1
  openapi: 3.1.0
2
2
  info:
3
3
  title: OmniRoute API
4
- version: 3.0.4
4
+ version: 3.0.5
5
5
  description: |
6
6
  OmniRoute is a local-first AI API proxy router. It provides an OpenAI-compatible
7
7
  endpoint that routes requests to multiple AI providers with load balancing,
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "omniroute",
3
- "version": "3.0.4",
3
+ "version": "3.0.5",
4
4
  "lockfileVersion": 3,
5
5
  "requires": true,
6
6
  "packages": {
7
7
  "": {
8
8
  "name": "omniroute",
9
- "version": "3.0.4",
9
+ "version": "3.0.5",
10
10
  "hasInstallScript": true,
11
11
  "license": "MIT",
12
12
  "workspaces": [
package/app/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "omniroute",
3
- "version": "3.0.4",
3
+ "version": "3.0.5",
4
4
  "description": "Smart AI Router with auto fallback — route to FREE & cheap models, zero downtime. Works with Cursor, Cline, Claude Desktop, Codex, and any OpenAI-compatible tool.",
5
5
  "type": "module",
6
6
  "bin": {
@@ -334,11 +334,21 @@ export default function ProviderLimits() {
334
334
  if (groupBy !== "environment") return null;
335
335
  const groups = new Map();
336
336
  for (const conn of visibleConnections) {
337
- const key = conn.group || t("ungrouped");
337
+ const key = (conn.providerSpecificData?.tag as string | undefined)?.trim() || t("ungrouped");
338
338
  if (!groups.has(key)) groups.set(key, []);
339
339
  groups.get(key).push(conn);
340
340
  }
341
- return groups;
341
+
342
+ // Convert to sorted array based on tag string (ungrouped at the end)
343
+ const sortedGroups = new Map(
344
+ [...groups.entries()].sort(([a], [b]) => {
345
+ if (a === t("ungrouped")) return 1;
346
+ if (b === t("ungrouped")) return -1;
347
+ return a.localeCompare(b);
348
+ })
349
+ );
350
+
351
+ return sortedGroups;
342
352
  }, [groupBy, visibleConnections, t]);
343
353
 
344
354
  const handleSetGroupBy = (value: "none" | "environment") => {
@@ -359,7 +369,10 @@ export default function ProviderLimits() {
359
369
  useEffect(() => {
360
370
  if (typeof window === "undefined") return;
361
371
  const hasSaved = localStorage.getItem(LS_GROUP_BY) !== null;
362
- if (!hasSaved && connections.some((c) => c.group)) {
372
+ if (
373
+ !hasSaved &&
374
+ connections.some((c) => (c.providerSpecificData?.tag as string | undefined)?.trim())
375
+ ) {
363
376
  setGroupBy("environment");
364
377
  }
365
378
  }, [connections]);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "omniroute",
3
- "version": "3.0.4",
3
+ "version": "3.0.5",
4
4
  "description": "Smart AI Router with auto fallback — route to FREE & cheap models, zero downtime. Works with Cursor, Cline, Claude Desktop, Codex, and any OpenAI-compatible tool.",
5
5
  "type": "module",
6
6
  "bin": {
@@ -1 +0,0 @@
1
- (globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,565650,e=>{"use strict";e.i(342923),e.i(80173),e.i(907714),e.i(393718),e.i(703166),e.i(454149),e.i(822124),e.i(969353),e.i(635055),e.i(897844),e.i(450222),e.i(647829),e.i(6998),e.i(982131),e.i(116016),e.i(279743),e.i(193464),e.i(548036),e.i(566770),e.i(953789),e.i(8839),e.i(227404),e.i(621745),e.i(567955),e.i(17517),e.i(419947),e.i(323060),e.i(642440),e.i(629342),e.i(816062),e.i(690777),e.i(563201),e.i(115243),e.i(165149),e.i(359505),e.s([],565650)},11477,e=>{"use strict";var t=e.i(393718);e.s(["Card",()=>t.default])},659497,e=>{"use strict";var t=e.i(843476),s=e.i(271645);e.i(565650);var r=e.i(454149),a=e.i(948148),n=e.i(657688),l=e.i(25230),i=e.i(243009);function o(e,t={},s={}){let r=Number(t?.used||0),a=Number(t?.total||0),n=t?.resetAt||null,l=function(e){if(!e)return!1;let t="number"==typeof e?e:"string"==typeof e?Date.parse(e):NaN;return!!Number.isFinite(t)&&Date.now()>=t}(n),c=l?0:r,d=Number.isFinite(a)?a:0,u=(0,i.safePercentage)(t?.remainingPercentage),x=l&&d>0?100:void 0!==u?u:void 0;return{name:e,used:Number.isFinite(c)?c:0,total:d,resetAt:n,staleAfterReset:l,...void 0!==x?{remainingPercentage:x}:{},...s}}function c(e){let t="string"==typeof e?e.trim():"";if(!t)return{key:"unknown",label:"Unknown",variant:"default",rank:0,raw:null};let s=t.toUpperCase();return"CLAUDE CODE"===s||"KIMI CODING"===s||"KIRO"===s?{key:"unknown",label:t,variant:"default",rank:0,raw:t}:s.includes("PRO+")||s.includes("PRO PLUS")||s.includes("PROPLUS")?{key:"plus",label:"Pro+",variant:"secondary",rank:4,raw:t}:s.includes("ENTERPRISE")||s.includes("CORP")||s.includes("ORG")?{key:"enterprise",label:"Enterprise",variant:"info",rank:7,raw:t}:s.includes("TEAM")||s.includes("CHATGPTTEAM")?{key:"team",label:"Team",variant:"info",rank:6,raw:t}:s.includes("BUSINESS")||s.includes("STANDARD")||s.includes("BIZ")?{key:"business",label:"Business",variant:"warning",rank:5,raw:t}:s.includes("STUDENT")?{key:"pro",label:"Student",variant:"primary",rank:3,raw:t}:s.includes("ULTRA")?{key:"ultra",label:"Ultra",variant:"success",rank:4,raw:t}:s.includes("PRO")||s.includes("PREMIUM")?{key:"pro",label:"Pro",variant:"primary",rank:3,raw:t}:s.includes("PLUS")||s.includes("PAID")?{key:"plus",label:"Plus",variant:"secondary",rank:2,raw:t}:s.includes("FREE")||s.includes("BASIC")||s.includes("TRIAL")||s.includes("LEGACY")?{key:"free",label:"Free",variant:"default",rank:1,raw:t}:{key:"unknown",label:t.toLowerCase().split(/[\s_-]+/).map(e=>e.charAt(0).toUpperCase()+e.slice(1)).join(" ")||"Unknown",variant:"default",rank:0,raw:t}}var d=e.i(393718),u=e.i(969353),x=e.i(623249);let m="omniroute:limits:groupBy",p="omniroute:limits:autoRefresh",h="omniroute:limits:expandedGroups",b={antigravity:{label:"Antigravity",color:"#F59E0B"},github:{label:"GitHub Copilot",color:"#333"},kiro:{label:"Kiro AI",color:"#FF6B35"},codex:{label:"OpenAI Codex",color:"#10A37F"},claude:{label:"Claude Code",color:"#D97757"},glm:{label:"GLM (Z.AI)",color:"#4A90D9"},"kimi-coding":{label:"Kimi Coding",color:"#1E3A8A"}},f=[{key:"all",labelKey:"tierAll"},{key:"enterprise",labelKey:"tierEnterprise"},{key:"team",labelKey:"tierTeam"},{key:"business",labelKey:"tierBusiness"},{key:"ultra",labelKey:"tierUltra"},{key:"pro",labelKey:"tierPro"},{key:"plus",labelKey:"tierPlus"},{key:"free",labelKey:"tierFree"},{key:"unknown",labelKey:"tierUnknown"}];function g(){let e,i=(0,a.useTranslations)("usage"),[g,y]=(0,s.useState)([]),[v,j]=(0,s.useState)({}),[k,N]=(0,s.useState)({}),[w,S]=(0,s.useState)({}),[E,C]=(0,s.useState)(()=>"true"===localStorage.getItem(p)),[I,P]=(0,s.useState)(null),[T,A]=(0,s.useState)(!1),[R,M]=(0,s.useState)(120),[O,D]=(0,s.useState)(!0),[q,U]=(0,s.useState)("all"),[F,K]=(0,s.useState)(()=>{let e=localStorage.getItem(m);return"environment"===e||"none"===e?e:"none"}),[L,_]=(0,s.useState)(()=>{try{let e=localStorage.getItem(h);return e?new Set(JSON.parse(e)):new Set}catch{return new Set}}),B=(0,s.useRef)(null),G=(0,s.useRef)(null),$=(0,s.useRef)({}),H=(0,s.useRef)({}),Q=(0,s.useCallback)(async()=>{try{let e=await fetch("/api/providers/client");if(!e.ok)throw Error("Failed");let t=(await e.json()).connections||[];return y(t),t}catch{return y([]),[]}},[]),z=(0,s.useCallback)(async(e,t,s={})=>{let r=s?.force===!0,a=Date.now(),n=$.current[e]||0;if(r||!(a-n<3e4)){$.current[e]=a,N(t=>({...t,[e]:!0})),S(t=>({...t,[e]:null}));try{let s=await fetch(`/api/usage/${e}`);if(!s.ok){let t=(await s.json().catch(()=>({}))).error||s.statusText;if(404===s.status)return;if(401===s.status)return void j(s=>({...s,[e]:{quotas:[],message:t}}));throw Error(`HTTP ${s.status}: ${t}`)}let r=await s.json(),a=function(e,t){if(!t||"object"!=typeof t)return[];let s=[];try{switch(e.toLowerCase()){case"github":t.quotas&&Object.entries(t.quotas).forEach(([e,t])=>{(!t?.unlimited||t?.total&&!(t.total<=0))&&s.push(o(e,t))});break;case"antigravity":t.quotas&&Object.entries(t.quotas).forEach(([e,t])=>{s.push(o(t.displayName||e,t,{modelKey:e}))});break;case"codex":t.quotas&&Object.entries(t.quotas).forEach(([e,t])=>{s.push(o(e,t))});break;case"kiro":t.quotas&&Object.entries(t.quotas).forEach(([e,t])=>{s.push(o(e,t))});break;case"claude":t.message?s.push({name:"error",used:0,total:0,resetAt:null,message:t.message}):t.quotas&&Object.entries(t.quotas).forEach(([e,t])=>{s.push(o(e,t))});break;default:t.quotas&&Object.entries(t.quotas).forEach(([e,t])=>{s.push(o(e,t))})}}catch(t){return console.error(`Error parsing quota data for ${e}:`,t),[]}let r=(0,l.getModelsByProviderId)(e);if(r.length>0){let e=new Map(r.map((e,t)=>[e.id,t]));s.sort((t,s)=>{let r=t.modelKey||t.name,a=s.modelKey||s.name;return(e.get(r)??999)-(e.get(a)??999)})}return s}(t,r);if(a.some(e=>e?.staleAfterReset===!0)){let s=H.current[e]||0;Date.now()-s>=3e4&&(H.current[e]=Date.now(),setTimeout(()=>{z(e,t,{force:!0}).catch(()=>{})},5e3))}j(t=>({...t,[e]:{quotas:a,plan:r.plan||null,message:r.message||null,raw:r}}))}catch(t){S(s=>({...s,[e]:t.message||"Failed to fetch quota"}))}finally{N(t=>({...t,[e]:!1}))}}},[]),J=(0,s.useCallback)(async(e,t)=>{await z(e,t),P(new Date)},[z]),V=(0,s.useCallback)(async()=>{if(!T){A(!0),M(120);try{let e=(await Q()).filter(e=>x.USAGE_SUPPORTED_PROVIDERS.includes(e.provider)&&("oauth"===e.authType||"apikey"===e.authType));await Promise.all(e.map(e=>z(e.id,e.provider))),P(new Date)}catch(e){console.error("Error refreshing all:",e)}finally{A(!1)}}},[T,Q,z]);(0,s.useEffect)(()=>{(async()=>{D(!0),await V(),D(!1)})()},[]),(0,s.useEffect)(()=>{if(!E){B.current&&clearInterval(B.current),G.current&&clearInterval(G.current);return}return B.current=setInterval(V,12e4),G.current=setInterval(()=>{M(e=>e<=1?120:e-1)},1e3),()=>{B.current&&clearInterval(B.current),G.current&&clearInterval(G.current)}},[E,V]),(0,s.useEffect)(()=>{let e=()=>{document.hidden?(B.current&&clearInterval(B.current),G.current&&clearInterval(G.current)):E&&(B.current=setInterval(V,12e4),G.current=setInterval(()=>{M(e=>e<=1?120:e-1)},1e3))};return document.addEventListener("visibilitychange",e),()=>document.removeEventListener("visibilitychange",e)},[E,V]);let W=(0,s.useMemo)(()=>g.filter(e=>x.USAGE_SUPPORTED_PROVIDERS.includes(e.provider)&&("oauth"===e.authType||"apikey"===e.authType)),[g]),Z=(0,s.useMemo)(()=>{let e={antigravity:1,github:2,codex:3,claude:4,kiro:5,glm:6,"kimi-coding":7};return[...W].sort((t,s)=>(e[t.provider]||9)-(e[s.provider]||9))},[W]),Y=(0,s.useMemo)(()=>{let e={};for(let t of Z)e[t.id]=c(v[t.id]?.plan);return e},[Z,v]),X=(0,s.useMemo)(()=>{let e={all:Z.length,enterprise:0,team:0,business:0,ultra:0,pro:0,free:0,unknown:0};for(let t of Z){let s=Y[t.id]?.key||"unknown";e[s]=(e[s]||0)+1}return e},[Z,Y]),ee=(0,s.useMemo)(()=>"all"===q?Z:Z.filter(e=>(Y[e.id]?.key||"unknown")===q),[Z,Y,q]),et=(0,s.useMemo)(()=>{if("environment"!==F)return null;let e=new Map;for(let t of ee){let s=t.group||i("ungrouped");e.has(s)||e.set(s,[]),e.get(s).push(t)}return e},[F,ee,i]),es=e=>{K(e),localStorage.setItem(m,e)};return((0,s.useEffect)(()=>{null===localStorage.getItem(m)&&g.some(e=>e.group)&&K("environment")},[g]),(0,s.useEffect)(()=>{if("environment"===F&&et&&0===L.size){let e=new Set([...et.keys()]);_(e),localStorage.setItem(h,JSON.stringify([...e]))}},[F,et]),O)?(0,t.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,t.jsx)(r.CardSkeleton,{}),(0,t.jsx)(r.CardSkeleton,{})]}):0===Z.length?(0,t.jsx)(d.default,{padding:"lg",children:(0,t.jsxs)("div",{className:"text-center py-12",children:[(0,t.jsx)("span",{className:"material-symbols-outlined text-[64px] opacity-15",children:"cloud_off"}),(0,t.jsx)("h3",{className:"mt-4 text-lg font-semibold text-text-main",children:i("noProviders")}),(0,t.jsx)("p",{className:"mt-2 text-sm text-text-muted max-w-[400px] mx-auto",children:i("connectProvidersForQuota")})]})}):(0,t.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between flex-wrap gap-3",children:[(0,t.jsxs)("div",{className:"flex items-center gap-3",children:[(0,t.jsx)("h2",{className:"text-lg font-semibold text-text-main m-0",children:i("providerLimits")}),(0,t.jsxs)("span",{className:"text-[13px] text-text-muted",children:[i("accountsCount",{count:ee.length}),ee.length!==Z.length&&` ${i("filteredFromCount",{count:Z.length})}`]})]}),(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsxs)("div",{className:"flex rounded-lg border border-border overflow-hidden",children:[(0,t.jsx)("button",{onClick:()=>es("none"),className:"px-2.5 py-1.5 text-[12px] font-medium cursor-pointer border-none",style:{background:"none"===F?"var(--color-bg-subtle)":"transparent",color:"none"===F?"var(--color-text-main)":"var(--color-text-muted)"},children:i("viewFlat")}),(0,t.jsx)("button",{onClick:()=>es("environment"),className:"px-2.5 py-1.5 text-[12px] font-medium cursor-pointer border-none",style:{background:"environment"===F?"var(--color-bg-subtle)":"transparent",color:"environment"===F?"var(--color-text-main)":"var(--color-text-muted)",borderLeft:"1px solid var(--color-border)"},children:i("viewByEnvironment")})]}),(0,t.jsxs)("button",{onClick:()=>{let e=!E;C(e),localStorage.setItem(p,String(e))},className:"flex items-center gap-1.5 px-3 py-1.5 rounded-lg border border-border bg-transparent cursor-pointer text-text-main text-[13px]",children:[(0,t.jsx)("span",{className:"material-symbols-outlined text-[18px]",style:{color:E?"#22c55e":"var(--text-muted)"},children:E?"toggle_on":"toggle_off"}),i("autoRefresh"),E&&(0,t.jsxs)("span",{className:"text-xs text-text-muted",children:["(",R,"s)"]})]}),(0,t.jsxs)("button",{onClick:V,disabled:T,className:"flex items-center gap-1.5 px-3.5 py-1.5 rounded-lg bg-bg-subtle border border-border text-text-main text-[13px] disabled:opacity-50 disabled:cursor-not-allowed cursor-pointer",children:[(0,t.jsx)("span",{className:`material-symbols-outlined text-[16px] ${T?"animate-spin":""}`,children:"refresh"}),i("refreshAll")]})]})]}),(0,t.jsx)("div",{className:"flex items-center gap-2 flex-wrap",children:f.map(e=>{if("all"!==e.key&&!X[e.key])return null;let s=q===e.key;return(0,t.jsxs)("button",{onClick:()=>U(e.key),className:"inline-flex items-center gap-1.5 px-2.5 py-1 rounded-full text-xs font-semibold cursor-pointer",style:{border:s?"1px solid var(--color-primary, #E54D5E)":"1px solid var(--color-border)",background:s?"rgba(229,77,94,0.1)":"transparent",color:s?"var(--color-primary, #E54D5E)":"var(--color-text-muted)"},children:[(0,t.jsx)("span",{children:i(e.labelKey)}),(0,t.jsx)("span",{className:"opacity-85",children:X[e.key]||0})]},e.key)})}),(0,t.jsxs)("div",{className:"rounded-xl border border-border overflow-hidden bg-bg-subtle",children:[(0,t.jsxs)("div",{className:"items-center px-4 py-2.5 border-b border-border text-[11px] font-semibold uppercase tracking-wider text-text-muted",style:{display:"grid",gridTemplateColumns:"280px 1fr 100px 48px"},children:[(0,t.jsx)("div",{children:i("account")}),(0,t.jsx)("div",{children:i("modelQuotas")}),(0,t.jsx)("div",{className:"text-center",children:i("lastUsed")}),(0,t.jsx)("div",{className:"text-center",children:i("actions")})]}),(e=(e,s)=>{let r=v[e.id],a=k[e.id],l=w[e.id],o=b[e.provider]||{label:e.provider,color:"#666"},d=Y[e.id]||c(null);return(0,t.jsxs)("div",{className:"items-center px-4 py-3.5 transition-[background] duration-150 hover:bg-black/[0.03] dark:hover:bg-white/[0.02]",style:{display:"grid",gridTemplateColumns:"280px 1fr 100px 48px",borderBottom:s?"none":"1px solid var(--color-border)"},children:[(0,t.jsxs)("div",{className:"flex items-center gap-2.5 min-w-0",children:[(0,t.jsx)("div",{className:"w-8 h-8 rounded-lg flex items-center justify-center overflow-hidden shrink-0",children:(0,t.jsx)(n.default,{src:`/providers/${e.provider}.png`,alt:e.provider,width:32,height:32,className:"object-contain",sizes:"32px"})}),(0,t.jsxs)("div",{className:"min-w-0",children:[(0,t.jsx)("div",{className:"text-[13px] font-semibold text-text-main truncate",children:e.name||o.label}),(0,t.jsxs)("div",{className:"flex items-center gap-1.5 mt-0.5",children:[(0,t.jsx)("span",{title:r?.plan?i("rawPlanWithValue",{plan:r.plan}):i("noPlanFromProvider"),children:(0,t.jsx)(u.default,{variant:d.variant,size:"sm",dot:!0,children:d.label})}),(0,t.jsx)("span",{className:"text-[11px] text-text-muted",children:o.label})]})]})]}),(0,t.jsx)("div",{className:"flex flex-wrap gap-x-3 gap-y-1.5 pr-3",children:a?(0,t.jsxs)("div",{className:"flex items-center gap-1.5 text-text-muted text-xs",children:[(0,t.jsx)("span",{className:"material-symbols-outlined animate-spin text-[14px]",children:"progress_activity"}),i("loadingQuotas")]}):l?(0,t.jsxs)("div",{className:"flex items-center gap-1.5 text-xs text-red-500",children:[(0,t.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"error"}),(0,t.jsx)("span",{className:"overflow-hidden text-ellipsis whitespace-nowrap max-w-[300px]",children:l})]}):r?.message&&(!r.quotas||0===r.quotas.length)?(0,t.jsx)("div",{className:"text-xs text-text-muted italic",children:r.message}):r?.quotas?.length>0?r.quotas.map((e,s)=>{var r,a,n;let l=void 0!==e.remainingPercentage?Math.round(e.remainingPercentage):(r=e.used,(a=e.total)&&0!==a?!r||r<0?100:r>=a?0:Math.round((a-r)/a*100):0),i=l>70?{bar:"#22c55e",text:"#22c55e",bg:"rgba(34,197,94,0.12)"}:l>=30?{bar:"#eab308",text:"#eab308",bg:"rgba(234,179,8,0.12)"}:{bar:"#ef4444",text:"#ef4444",bg:"rgba(239,68,68,0.12)"},o=function(e){if(!e)return null;try{let t=new Date(e)-new Date;if(t<=0)return null;let s=Math.floor(t/36e5),r=Math.floor(t%36e5/6e4);if(s>=24){let e=Math.floor(s/24);return`${e}d ${s%24}h`}return`${s}h ${r}m`}catch{return null}}(e.resetAt),c={"gemini-3-pro-high":"G3 Pro","gemini-3-pro-low":"G3 Pro Low","gemini-3-flash":"G3 Flash","gemini-2.5-flash":"G2.5 Flash","claude-opus-4-6-thinking":"Opus 4.6 Tk","claude-opus-4-5-thinking":"Opus 4.5 Tk","claude-opus-4-5":"Opus 4.5","claude-sonnet-4-5-thinking":"Sonnet 4.5 Tk","claude-sonnet-4-5":"Sonnet 4.5",chat:"Chat",completions:"Completions",premium_interactions:"Premium",session:"Session",weekly:"Weekly",agentic_request:"Agentic",agentic_request_freetrial:"Agentic (Trial)"}[n=e.name]||n,d=!0===e.staleAfterReset;return(0,t.jsxs)("div",{className:"flex items-center gap-1.5 min-w-[200px] shrink-0",children:[(0,t.jsx)("span",{className:"text-[11px] font-semibold py-0.5 px-2 rounded whitespace-nowrap min-w-[60px] text-center",style:{background:i.bg,color:i.text},children:c}),d?(0,t.jsx)("span",{className:"text-[10px] text-text-muted whitespace-nowrap",children:"⟳ Refreshing..."}):o?(0,t.jsxs)("span",{className:"text-[10px] text-text-muted whitespace-nowrap",children:["⏱ ",o]}):null,(0,t.jsx)("div",{className:"flex-1 h-1.5 rounded-sm bg-black/[0.06] dark:bg-white/[0.06] min-w-[60px] overflow-hidden",children:(0,t.jsx)("div",{className:"h-full rounded-sm transition-[width] duration-300 ease-out",style:{width:`${Math.min(l,100)}%`,background:i.bar}})}),(0,t.jsxs)("span",{className:"text-[11px] font-semibold min-w-[32px] text-right",style:{color:i.text},children:[l,"%"]})]},s)}):(0,t.jsx)("div",{className:"text-xs text-text-muted italic",children:i("noQuotaData")})}),(0,t.jsx)("div",{className:"text-center text-[11px] text-text-muted",children:I?(0,t.jsx)("span",{children:I.toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"})}):"-"}),(0,t.jsx)("div",{className:"flex justify-center gap-0.5",children:(0,t.jsx)("button",{onClick:()=>J(e.id,e.provider),disabled:a,title:i("refreshQuota"),className:"p-1 rounded-md border-none bg-transparent cursor-pointer disabled:cursor-not-allowed disabled:opacity-30 opacity-60 hover:opacity-100 flex items-center justify-center transition-opacity duration-150",children:(0,t.jsx)("span",{className:`material-symbols-outlined text-[16px] text-text-muted ${a?"animate-spin":""}`,children:"refresh"})})})]},e.id)},et?[...et.entries()].map(([s,r])=>(0,t.jsxs)("div",{className:"border border-border rounded-lg overflow-hidden mb-2",children:[(0,t.jsxs)("button",{onClick:()=>{_(e=>{let t=new Set(e);return t.has(s)?t.delete(s):t.add(s),localStorage.setItem(h,JSON.stringify([...t])),t})},className:"w-full flex items-center gap-2 px-4 py-2.5 bg-bg-subtle hover:bg-black/[0.04] dark:hover:bg-white/[0.05] transition-colors text-left border-none cursor-pointer",children:[(0,t.jsx)("span",{className:"material-symbols-outlined text-[16px] text-text-muted",children:L.has(s)?"expand_less":"expand_more"}),(0,t.jsx)("span",{className:"material-symbols-outlined text-[16px] text-text-muted",children:"folder"}),(0,t.jsx)("span",{className:"text-[12px] font-semibold text-text-main uppercase tracking-wider flex-1",children:s}),(0,t.jsx)("span",{className:"text-[11px] text-text-muted bg-black/[0.04] dark:bg-white/[0.06] px-2 py-0.5 rounded-full",children:r.length})]}),L.has(s)&&(0,t.jsx)("div",{children:r.map((t,s)=>e(t,s===r.length-1))})]},s)):ee.map((t,s)=>e(t,s===ee.length-1))),0===ee.length&&(0,t.jsxs)("div",{className:"py-6 px-4 text-center text-text-muted text-[13px]",children:[i("noAccountsForTierFilter")," ",(0,t.jsx)("strong",{children:i(f.find(e=>e.key===q)?.labelKey||"tierUnknown")}),"."]})]})]})}var y=e.i(11477);function v(){let e=(0,a.useTranslations)("usage"),r=(0,a.useTranslations)("common"),[n,l]=(0,s.useState)({lockouts:[],cacheStats:null}),[i,o]=(0,s.useState)(!0),c=(0,s.useCallback)(async()=>{try{let e=await fetch("/api/rate-limits");e.ok&&l(await e.json())}catch{}finally{o(!1)}},[]);return(0,s.useEffect)(()=>{c();let e=setInterval(c,1e4);return()=>clearInterval(e)},[c]),(0,t.jsx)("div",{className:"flex flex-col gap-4",children:(0,t.jsxs)(y.Card,{children:[(0,t.jsxs)("div",{className:"flex items-center gap-3 mb-4",children:[(0,t.jsx)("div",{className:"p-2 rounded-lg bg-orange-500/10 text-orange-500",children:(0,t.jsx)("span",{className:"material-symbols-outlined text-[20px]","aria-hidden":"true",children:"lock_clock"})}),(0,t.jsxs)("div",{className:"flex-1",children:[(0,t.jsx)("h3",{className:"text-lg font-semibold",children:e("modelLockouts")}),(0,t.jsx)("p",{className:"text-sm text-text-muted",children:e("lockoutsAutoRefreshHint")})]}),n.lockouts.length>0&&(0,t.jsx)("span",{className:"px-2.5 py-1 rounded-full text-xs font-semibold bg-orange-500/10 text-orange-400 border border-orange-500/20",children:e("lockedCount",{count:n.lockouts.length})})]}),0===n.lockouts.length?(0,t.jsxs)("div",{className:"text-center py-6 text-text-muted",children:[(0,t.jsx)("span",{className:"material-symbols-outlined text-[32px] mb-2 block opacity-40","aria-hidden":"true",children:"lock_open"}),(0,t.jsx)("p",{className:"text-sm",children:e("noLockouts")})]}):(0,t.jsx)("div",{className:"flex flex-col gap-2",children:n.lockouts.map((s,a)=>{var n;return(0,t.jsxs)("div",{className:"flex items-center justify-between px-3 py-2.5 rounded-lg bg-orange-500/5 border border-orange-500/15",children:[(0,t.jsxs)("div",{className:"flex items-center gap-3",children:[(0,t.jsx)("span",{className:"material-symbols-outlined text-[16px] text-orange-400","aria-hidden":"true",children:"lock"}),(0,t.jsxs)("div",{children:[(0,t.jsx)("p",{className:"text-sm font-medium",children:s.model}),(0,t.jsxs)("p",{className:"text-xs text-text-muted",children:[e("account"),":"," ",(0,t.jsx)("span",{className:"font-mono",children:s.accountId?.slice(0,12)||r("none")}),s.reason&&(0,t.jsxs)(t.Fragment,{children:[e("reasonSeparator"),s.reason]})]})]})]}),(0,t.jsx)("span",{className:"text-xs font-mono tabular-nums text-orange-400",children:e("timeLeft",{time:(n=s.remainingMs)<1e3?e("durationMillisecondsShort",{value:n}):n<6e4?e("durationSecondsShort",{value:Math.ceil(n/1e3)}):e("durationMinutesShort",{value:Math.ceil(n/6e4)})})})]},a)})})]})})}function j(){let e=(0,a.useTranslations)("usage"),[r,n]=(0,s.useState)({count:0,sessions:[]}),[l,i]=(0,s.useState)(!0),o=(0,s.useCallback)(async()=>{try{let e=await fetch("/api/sessions");e.ok&&n(await e.json())}catch{}finally{i(!1)}},[]);return(0,s.useEffect)(()=>{o();let e=setInterval(o,5e3);return()=>clearInterval(e)},[o]),(0,t.jsxs)(y.Card,{children:[(0,t.jsxs)("div",{className:"flex items-center gap-3 mb-5",children:[(0,t.jsx)("div",{className:"p-2 rounded-lg bg-cyan-500/10 text-cyan-500",children:(0,t.jsx)("span",{className:"material-symbols-outlined text-[20px]","aria-hidden":"true",children:"fingerprint"})}),(0,t.jsxs)("div",{className:"flex-1",children:[(0,t.jsx)("h3",{className:"text-lg font-semibold",children:e("activeSessions")}),(0,t.jsx)("p",{className:"text-sm text-text-muted",children:e("sessionsTrackedHint")})]}),(0,t.jsx)("div",{className:"flex items-center gap-2",children:(0,t.jsxs)("span",{className:"flex items-center gap-1.5 px-3 py-1.5 rounded-full bg-cyan-500/10 border border-cyan-500/20",children:[(0,t.jsx)("span",{className:"w-2 h-2 rounded-full bg-cyan-500 animate-pulse"}),(0,t.jsx)("span",{className:"text-sm font-semibold tabular-nums text-cyan-400",children:r.count})]})})]}),0===r.sessions.length?(0,t.jsxs)("div",{className:"text-center py-8 text-text-muted",children:[(0,t.jsx)("span",{className:"material-symbols-outlined text-[40px] mb-2 block opacity-40","aria-hidden":"true",children:"fingerprint"}),(0,t.jsx)("p",{className:"text-sm",children:e("noSessions")}),(0,t.jsx)("p",{className:"text-xs mt-1",children:e("sessionsHint")})]}):(0,t.jsx)("div",{className:"overflow-x-auto",children:(0,t.jsxs)("table",{className:"w-full text-sm",children:[(0,t.jsx)("thead",{children:(0,t.jsxs)("tr",{className:"border-b border-border/30",children:[(0,t.jsx)("th",{className:"text-left py-2 px-3 text-xs font-semibold text-text-muted uppercase tracking-wider",children:e("session")}),(0,t.jsx)("th",{className:"text-left py-2 px-3 text-xs font-semibold text-text-muted uppercase tracking-wider",children:e("age")}),(0,t.jsx)("th",{className:"text-right py-2 px-3 text-xs font-semibold text-text-muted uppercase tracking-wider",children:e("requests")}),(0,t.jsx)("th",{className:"text-left py-2 px-3 text-xs font-semibold text-text-muted uppercase tracking-wider",children:e("connection")})]})}),(0,t.jsx)("tbody",{children:r.sessions.map(s=>{var r;return(0,t.jsxs)("tr",{className:"border-b border-border/10 hover:bg-surface/20 transition-colors",children:[(0,t.jsx)("td",{className:"py-2.5 px-3",children:(0,t.jsxs)("span",{className:"font-mono text-xs px-2 py-1 rounded bg-surface/40 text-text-muted",children:[s.sessionId.slice(0,12),"…"]})}),(0,t.jsx)("td",{className:"py-2.5 px-3 text-text-muted tabular-nums",children:(r=s.ageMs)<6e4?e("durationSecondsShort",{value:Math.floor(r/1e3)}):r<36e5?e("durationMinutesShort",{value:Math.floor(r/6e4)}):e("durationHoursShort",{value:Math.floor(r/36e5)})}),(0,t.jsx)("td",{className:"py-2.5 px-3 text-right",children:(0,t.jsx)("span",{className:"font-semibold tabular-nums",children:s.requestCount})}),(0,t.jsx)("td",{className:"py-2.5 px-3",children:s.connectionId?(0,t.jsx)("span",{className:"text-xs font-mono text-cyan-400",children:s.connectionId.slice(0,10)}):(0,t.jsx)("span",{className:"text-text-muted/40",children:e("notAvailableSymbol")})})]},s.sessionId)})})]})})]})}function k(){return(0,t.jsxs)("div",{className:"flex flex-col gap-6",children:[(0,t.jsx)(s.Suspense,{fallback:(0,t.jsx)(r.CardSkeleton,{}),children:(0,t.jsx)(g,{})}),(0,t.jsx)(j,{}),(0,t.jsx)(v,{})]})}e.s(["default",()=>k],659497)}]);