omnigateway 0.5.1 → 0.6.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/README.md +23 -5
- package/bin/omni.js +6430 -5518
- package/gateway.js +6051 -4991
- package/package.json +1 -1
- package/public/assets/Chip-BWxO0uV7.js +32 -0
- package/public/assets/CopyValue-DIR5A6PG.js +27 -0
- package/public/assets/{Field-B2rnk3JM.js → Field-DI5YTYOX.js} +1 -1
- package/public/assets/Lamp-DN2EKL4m.js +25 -0
- package/public/assets/Panel-BCpZVY4U.js +198 -0
- package/public/assets/Rack-B03tpeW-.js +466 -0
- package/public/assets/{Readout-CZfn5JDy.js → Readout-B0TZE8aA.js} +1 -1
- package/public/assets/RequestTable-D4z82uxG.js +11 -0
- package/public/assets/SummaryDeck-CzozuXOu.js +15 -0
- package/public/assets/{Toggle-BvOELhpy.js → Toggle-ByxBCMfb.js} +1 -1
- package/public/assets/TokenBreakdown-BMEiZhRX.js +31 -0
- package/public/assets/{WindowChart-Bvbkz9rt.js → WindowChart-nxC4SCRC.js} +2 -2
- package/public/assets/_app-D9B6OIjd.js +1 -0
- package/public/assets/_app.accounts-BiRGhH3s.js +59 -0
- package/public/assets/{_app.console-C4x5F3d0.js → _app.console-CZiI6B3b.js} +4 -4
- package/public/assets/_app.database-Y3lFDxoP.js +24 -0
- package/public/assets/_app.index-BZCUXxIF.js +62 -0
- package/public/assets/_app.keys-DRfXCzMJ.js +82 -0
- package/public/assets/_app.logs-BQT3kFZr.js +58 -0
- package/public/assets/_app.models-eOJ6ofIb.js +148 -0
- package/public/assets/_app.plugins._pluginId-CtEAGvad.js +2 -0
- package/public/assets/_app.plugins._pluginId-jaswB8Z5.js +20 -0
- package/public/assets/_app.settings-CG63splg.js +58 -0
- package/public/assets/_app.usage-BaT54Vee.js +76 -0
- package/public/assets/{chevron-right-mGs1is3r.js → chevron-right-0adI8395.js} +1 -1
- package/public/assets/client-Pvf9SEam.js +39 -0
- package/public/assets/index-Cn4_VeBU.js +13 -0
- package/public/assets/{login-bJoYdBqx.js → login-BSWCo_Fz.js} +4 -4
- package/public/assets/login-C7v-Fr28.js +2 -0
- package/public/assets/plus-B_f8M9yB.js +1 -0
- package/public/assets/preload-helper-CD37DT-E.js +1 -0
- package/public/assets/{shared-DQOWYTp3.js → shared-dShKzjig.js} +3 -3
- package/public/assets/stream-BXI9HD3l.js +1 -0
- package/public/assets/{trash-2-BDA1rQVQ.js → trash-2-DrDlpCqO.js} +1 -1
- package/public/index.html +8 -4
- package/public/shared/dashboard-sdk.js +1 -1
- package/public/assets/Chip-BltJSw8A.js +0 -32
- package/public/assets/CopyValue-DNNJGDI5.js +0 -27
- package/public/assets/Match-CvkEmOIG.js +0 -1
- package/public/assets/Panel-BeQOQoap.js +0 -25
- package/public/assets/Rack-DdhpgQWD.js +0 -316
- package/public/assets/RequestTable-I1TrD689.js +0 -11
- package/public/assets/States-2kaQxx-s.js +0 -54
- package/public/assets/SummaryDeck-BisdRswW.js +0 -15
- package/public/assets/TokenBreakdown-En1JT4tT.js +0 -31
- package/public/assets/_app-a3VUev6k.js +0 -1
- package/public/assets/_app.accounts-CYPB-7Xt.js +0 -59
- package/public/assets/_app.database-B-9oB52r.js +0 -24
- package/public/assets/_app.index-NBeanmyf.js +0 -62
- package/public/assets/_app.keys-DK9jdOqT.js +0 -82
- package/public/assets/_app.logs-Dr6fApsE.js +0 -58
- package/public/assets/_app.models-CGBQ2QaS.js +0 -148
- package/public/assets/_app.plugins._pluginId-DXzhupNH.js +0 -20
- package/public/assets/_app.settings-zTFRyxhZ.js +0 -58
- package/public/assets/_app.usage-BCCimHY0.js +0 -76
- package/public/assets/catalog-BBKm8Ih8.js +0 -1
- package/public/assets/client-CQGHWD56.js +0 -39
- package/public/assets/index-C3LoGDKu.js +0 -178
- package/public/assets/matchContext-BOenO3J2.js +0 -1
- package/public/assets/plus-Bqi8Y2Xd.js +0 -1
- package/public/assets/queries-GAue98pY.js +0 -145
- package/public/assets/stream-Bu-m1Z1Y.js +0 -1
|
@@ -1,58 +0,0 @@
|
|
|
1
|
-
import{F as e,J as t,Q as n,W as r,c as i,ct as a,dt as o,l as s,lt as c,mt as l,o as u,pt as d,q as f,vt as p}from"./queries-GAue98pY.js";import{t as m}from"./Rack-DdhpgQWD.js";import{t as h}from"./Toggle-BvOELhpy.js";import{i as g,n as _,r as v}from"./States-2kaQxx-s.js";import{i as y,n as b,t as x}from"./Field-B2rnk3JM.js";import{t as S}from"./Meter-stpt3vQu.js";import{t as C}from"./Panel-BeQOQoap.js";import{n as w}from"./reasons-Du1OBWAM.js";import{useEffect as T,useState as E}from"react";import{Fragment as D,jsx as O,jsxs as k}from"react/jsx-runtime";import A from"styled-components";var j=12,M=A.p`
|
|
2
|
-
font-size: 12px;
|
|
3
|
-
color: ${({theme:e})=>e.color.inkDim};
|
|
4
|
-
max-width: 62ch;
|
|
5
|
-
`,N=A.p`
|
|
6
|
-
font-size: 12px;
|
|
7
|
-
color: ${({theme:e})=>e.color.down};
|
|
8
|
-
`,P=A.p`
|
|
9
|
-
font-size: 12px;
|
|
10
|
-
color: ${({theme:e})=>e.color.ok};
|
|
11
|
-
`,F=A(b)`
|
|
12
|
-
width: 260px;
|
|
13
|
-
`;function I(){let e=s(),[t,n]=E(``),[r,i]=E(``),[a,c]=E(``),[u,d]=E(null);return k(l,{$gap:2,children:[O(M,{children:`Changing this signs every session out, including this one, and you will be asked to sign in again with the new password.`}),k(o,{$gap:2,$wrap:!0,$align:`end`,children:[O(x,{label:`Current password`,children:e=>O(F,{...e,type:`password`,autoComplete:`current-password`,value:t,onChange:e=>n(e.target.value)})}),O(x,{label:`New password`,hint:`At least ${j} characters.`,children:e=>O(F,{...e,type:`password`,autoComplete:`new-password`,value:r,onChange:e=>i(e.target.value)})}),O(x,{label:`Repeat new password`,children:e=>O(F,{...e,type:`password`,autoComplete:`new-password`,value:a,onChange:e=>c(e.target.value)})}),O(p,{type:`button`,$variant:`primary`,onClick:()=>{if(r.length<j){d(`A password must be at least ${j} characters.`);return}if(r!==a){d(`The two new passwords do not match.`);return}d(null),e.mutate({current:t,password:r},{onSuccess:()=>w(`password-changed`),onError:e=>d(g(e))})},disabled:e.isPending||t.length===0||r.length===0,children:`Change password`})]}),u===null?null:O(N,{role:`alert`,children:u})]})}function L(){let e=n(),t=f(),[r,i]=E(``),[a,s]=E(null),[c,u]=E(null),d=e.data?.viewerConfigured===!0;return k(l,{$gap:2,children:[k(M,{children:[`A second password that signs in to a read-only console: every screen the operator sees, without mutations, snapshot downloads, or request bodies. Hand it to someone who needs to watch this gateway without being able to change it.`,` `,e.isPending?`Reading whether one is set…`:d?`One is set. Entering a new one replaces it; withdrawing it ends any read-only session immediately.`:`None is set, so nobody can sign in read-only. There is no default password.`]}),k(o,{$gap:2,$wrap:!0,$align:`end`,children:[O(x,{label:d?`Replace read-only password`:`Set read-only password`,hint:`At least ${j} characters.`,children:e=>O(F,{...e,type:`password`,autoComplete:`new-password`,value:r,onChange:e=>i(e.target.value)})}),O(p,{type:`button`,$variant:`primary`,onClick:()=>{if(r.length<j){s(`A password must be at least ${j} characters.`);return}s(null),t.mutate(r,{onSuccess:()=>{i(``),u(d?`Read-only password replaced.`:`Read-only access granted.`)},onError:e=>s(g(e))})},disabled:t.isPending||r.length===0,children:d?`Replace`:`Set`}),d?O(p,{type:`button`,$variant:`danger`,onClick:()=>{s(null),t.mutate(null,{onSuccess:()=>u(`Read-only access withdrawn.`),onError:e=>s(g(e))})},disabled:t.isPending,children:`Withdraw access`}):null]}),a===null?null:O(N,{role:`alert`,children:a}),c===null||a!==null?null:O(P,{role:`status`,children:c})]})}function R(){return O(C,{legend:`Access`,children:k(l,{$gap:4,children:[O(I,{}),O(L,{})]})})}var z=[{id:`claude`,label:`Claude Code`,where:`settings.json under ~/.claude`},{id:`opencode`,label:`opencode`,where:`opencode.json in your project`}],B=A(c)`
|
|
14
|
-
display: block;
|
|
15
|
-
white-space: pre;
|
|
16
|
-
overflow-x: auto;
|
|
17
|
-
padding: 0.75rem;
|
|
18
|
-
background: ${({theme:e})=>e.color.panelSunk};
|
|
19
|
-
border: 1px solid ${({theme:e})=>e.color.rule};
|
|
20
|
-
border-radius: 4px;
|
|
21
|
-
font-size: 0.8125rem;
|
|
22
|
-
line-height: 1.5;
|
|
23
|
-
`,V=A.div`
|
|
24
|
-
color: ${({theme:e})=>e.color.inkDim};
|
|
25
|
-
font-size: 0.8125rem;
|
|
26
|
-
margin-bottom: 0.25rem;
|
|
27
|
-
`,H=A.p`
|
|
28
|
-
color: ${({theme:e})=>e.color.inkDim};
|
|
29
|
-
font-size: 0.8125rem;
|
|
30
|
-
margin: 0;
|
|
31
|
-
`,U=A.div`
|
|
32
|
-
display: grid;
|
|
33
|
-
grid-template-columns: repeat(auto-fit, minmax(10rem, 1fr));
|
|
34
|
-
gap: ${({theme:e})=>e.space(2)};
|
|
35
|
-
`,W=[{key:`defaultModel`,label:`Default model`,required:!0},{key:`fableModel`,label:`Fable model`,required:!1},{key:`opusModel`,label:`Opus model`,required:!1},{key:`sonnetModel`,label:`Sonnet model`,required:!1},{key:`haikuModel`,label:`Haiku model`,required:!1}];function G(){let[t,n]=E(`claude`),[r,i]=E(()=>({claude:{},opencode:{}})),a=e(),s=r[t],d=typeof s.defaultModel==`string`&&s.defaultModel!==``?s:void 0,f=u(t,d),m=z.find(e=>e.id===t);return O(C,{legend:`Agent setup`,children:k(l,{children:[O(o,{children:z.map(e=>O(p,{type:`button`,$variant:e.id===t?`primary`:`ghost`,onClick:()=>n(e.id),children:e.label},e.id))}),k(H,{children:[m?.where,`. The key is a placeholder — paste your own over it. Or run`,` `,k(c,{children:[`omni setup `,t]}),` to write these files directly.`]}),(a.data?.length??0)>0?O(U,{children:W.map(e=>O(x,{label:e.label,children:n=>k(y,{...n,value:s[e.key]??``,onChange:n=>i(r=>({...r,[t]:{...r[t],[e.key]:n.target.value||void 0}})),children:[O(`option`,{value:``,children:e.required?`Choose a pool`:`Not mapped`}),a.data?.map(e=>O(`option`,{value:e.id,children:e.id},e.id))]})},e.key))}):null,a.isLoading?O(v,{rows:2}):f.isError?O(_,{error:f.error,onRetry:()=>void f.refetch()}):f.isLoading?O(v,{rows:4}):(a.data?.length??0)===0?O(H,{children:`No virtual models configured yet, so there is nothing to point a client at.`}):d===void 0?k(H,{children:[`Choose a default model to generate `,m?.label,` settings.`]}):f.data===void 0||f.data.length===0?O(H,{children:`No virtual models configured yet, so there is nothing to point a client at.`}):f.data.map(e=>k(`div`,{children:[O(V,{children:e.path}),O(B,{as:`pre`,children:e.contents.trimEnd()})]},e.path)),f.isError?O(H,{children:g(f.error)}):null]})})}var K=[{id:`tier`,label:`Tier`,blurb:`How strongly a lower tier is preferred.`},{id:`health`,label:`Health`,blurb:`Penalty for recent failures and an open breaker.`},{id:`quota`,label:`Quota`,blurb:`Preference for accounts keeping ahead of their window's burn rate.`},{id:`cost`,label:`Cost`,blurb:`Preference for the cheaper target of the candidates.`},{id:`latency`,label:`Latency`,blurb:`Preference for the faster observed first token.`},{id:`load`,label:`Load`,blurb:`Preference for accounts with fewer requests in flight right now.`}],q=[{id:`maxAttempts`,label:`Attempts per request`,hint:`How many candidates dispatch may try before giving up. 1 disables failover.`,unit:`attempts`,step:1,min:1},{id:`requestDeadlineMs`,label:`Request deadline`,hint:`How long a request may take across all attempts. 0 disables only OmniGateway's deadline.`,unit:`ms`,step:1e3,min:0},{id:`breakerThreshold`,label:`Breaker threshold`,hint:`Consecutive failures on one account and model before it is taken out of rotation.`,unit:`failures`,step:1,min:1},{id:`breakerCooldownMs`,label:`Breaker cooldown`,hint:`Base wait before a tripped account is probed again. Doubles per extra failure.`,unit:`ms`,step:1e3,min:1},{id:`logRetentionDays`,label:`Log retention`,hint:`How long request rows are kept before maintenance prunes them.`,unit:`days`,step:1,min:1},{id:`quotaPollIntervalMs`,label:`Quota poll interval`,hint:`How often each account's provider is asked for its remaining quota. 0 disables polling. Takes effect on restart.`,unit:`ms`,step:6e4,min:0}],J=A.div`
|
|
36
|
-
display: grid;
|
|
37
|
-
grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
|
|
38
|
-
gap: ${({theme:e})=>e.space(3)};
|
|
39
|
-
`,Y=A(l)`
|
|
40
|
-
gap: 6px;
|
|
41
|
-
`,X=A.p`
|
|
42
|
-
font-size: 11px;
|
|
43
|
-
color: ${({theme:e})=>e.color.inkDim};
|
|
44
|
-
`,Z=A.p`
|
|
45
|
-
font-size: 12px;
|
|
46
|
-
color: ${({theme:e})=>e.color.down};
|
|
47
|
-
`,Q=A.p`
|
|
48
|
-
font-size: 12px;
|
|
49
|
-
color: ${({theme:e})=>e.color.ok};
|
|
50
|
-
`,$=A.p`
|
|
51
|
-
font-size: 12px;
|
|
52
|
-
color: ${({theme:e})=>e.color.warn};
|
|
53
|
-
max-width: 72ch;
|
|
54
|
-
|
|
55
|
-
code {
|
|
56
|
-
font-family: ${({theme:e})=>e.font.mono};
|
|
57
|
-
}
|
|
58
|
-
`;function ee(e){let t={};for(let n of K)t[`w.${n.id}`]=String(e.weights[n.id]);for(let n of q)t[n.id]=String(e[n.id]);return t.rtkEnabled=String(e.rtkEnabled),t.autoCacheEnabled=String(e.autoCacheEnabled),t.bodyLoggingEnabled=String(e.bodyLoggingEnabled),t.bodyLoggingCaptureStreamChunks=String(e.bodyLoggingCaptureStreamChunks),t}function te(e){let t={};for(let n of K){let r=(e[`w.${n.id}`]??``).trim(),i=Number(r);if(r.length===0||!Number.isFinite(i))return{ok:!1,problem:`${n.label} must be a number.`};t[n.id]=i}let n={};for(let t of q){let r=(e[t.id]??``).trim(),i=Number(r);if(r.length===0||!Number.isInteger(i)||i<t.min)return{ok:!1,problem:`${t.label} must be a whole number of ${t.min} or more.`};n[t.id]=i}return n.maxAttempts>10?{ok:!1,problem:`Attempts per request cannot exceed 10.`}:{ok:!0,settings:{weights:t,...n,rtkEnabled:e.rtkEnabled===`true`,autoCacheEnabled:e.autoCacheEnabled===`true`,bodyLoggingEnabled:e.bodyLoggingEnabled===`true`,bodyLoggingCaptureStreamChunks:e.bodyLoggingCaptureStreamChunks===`true`}}}function ne(){let e=t(),n=i(),s=r(),[u,f]=E({}),[y,w]=E(null),[A,j]=E(!1);T(()=>{e.data!==void 0&&f(ee(e.data))},[e.data]);let M=Math.max(1e-4,...K.map(e=>Math.abs(Number(u[`w.${e.id}`])||0)));return k(D,{children:[O(m,{legend:`Settings`,title:`Routing and retention`,summary:`These apply to every request the gateway routes. Changes take effect on the next request; nothing is restarted.`,actions:O(p,{type:`button`,$variant:`primary`,disabled:s.isPending||e.isLoading,onClick:()=>{j(!1);let e=te(u);if(!e.ok){w(e.problem);return}w(null),s.mutate(e.settings,{onSuccess:()=>j(!0),onError:e=>w(g(e))})},children:s.isPending?`Saving…`:`Save changes`})}),e.isError?O(C,{legend:`Settings`,children:O(_,{error:e.error,onRetry:()=>void e.refetch()})}):e.isLoading?O(C,{legend:`Settings`,children:O(v,{rows:6})}):k(l,{$gap:4,children:[O(C,{legend:`Scoring weights`,meta:`relative to each other`,footer:k(o,{children:[O(a,{children:`A candidate's score is the sum of each term times its weight, then multiplied by the account and target weights.`}),O(d,{})]}),children:O(J,{children:K.map(e=>{let t=Number(u[`w.${e.id}`])||0;return k(Y,{children:[O(x,{label:e.label,children:t=>O(b,{...t,type:`number`,step:.5,value:u[`w.${e.id}`]??``,onChange:t=>f({...u,[`w.${e.id}`]:t.target.value})})}),O(S,{fraction:Math.abs(t)/M,height:4,tone:`var(--accent)`,label:`${e.label} weight ${t}`}),O(X,{children:e.blurb})]},e.id)})})}),O(C,{legend:`Limits`,children:O(J,{children:q.map(e=>O(Y,{children:O(x,{label:e.label,hint:e.hint,children:t=>k(o,{$gap:2,children:[O(b,{...t,type:`number`,min:e.min,step:e.step,value:u[e.id]??``,onChange:t=>f({...u,[e.id]:t.target.value})}),O(a,{children:e.unit})]})})},e.id))})}),O(C,{legend:`Historical tool results`,children:k(o,{$gap:3,$align:`start`,children:[O(h,{checked:u.rtkEnabled===`true`,onCheckedChange:e=>f({...u,rtkEnabled:String(e)}),label:`Enable RTK compression`}),O(X,{children:`Compress recognized historical non-error tool results before provider dispatch. Confirmed non-shell tools are excluded; unknown-origin results may be compressed only when a built-in detector recognizes a high-confidence shell-output format. Compression is deterministic and lossy. Disabled by default.`})]})}),O(C,{legend:`Prompt caching`,children:k(o,{$gap:3,$align:`start`,children:[O(h,{checked:u.autoCacheEnabled===`true`,onCheckedChange:e=>f({...u,autoCacheEnabled:String(e)}),label:`Add a cache breakpoint when a client sends none`}),O(X,{children:`Anthropic only caches a prompt the request marks, so a client that marks nothing pays full price to resend the same prefix every turn. This marks the end of the system prompt on Anthropic requests that carry no breakpoint of their own. Requests that already mark one are left exactly as they arrived, and prompts too short to be cacheable are skipped. Enabled by default.`})]})}),O(C,{legend:`Request and response bodies`,meta:n.data===!0?`permitted by the environment`:`not permitted`,children:k(l,{$gap:3,children:[n.data===!0?null:k($,{children:[`This gateway was started without `,O(`code`,{children:`OMNI_BODY_LOGGING_ALLOWED`}),`, so nothing below can record anything. Set it in the installation's `,O(`code`,{children:`.env`}),` `,`and restart before turning capture on. Two keys mean an admin session on its own cannot start recording prompts.`]}),k(o,{$gap:3,$align:`start`,children:[O(h,{checked:u.bodyLoggingEnabled===`true`,disabled:n.data!==!0,onCheckedChange:e=>f({...u,bodyLoggingEnabled:String(e)}),label:`Capture request and response bodies`}),O(X,{children:`Stores what each client sent and what each provider returned, encrypted under OMNI_ENCRYPTION_KEY beside the database. Bearer tokens and API keys are masked first and headers are never captured. Bodies expire on the log retention window above, and the newest 100,000 requests are kept whatever that window says. Off by default.`})]}),k(o,{$gap:3,$align:`start`,children:[O(h,{checked:u.bodyLoggingCaptureStreamChunks===`true`,disabled:n.data!==!0||u.bodyLoggingEnabled!==`true`,onCheckedChange:e=>f({...u,bodyLoggingCaptureStreamChunks:String(e)}),label:`Also keep raw stream frames`}),O(X,{children:`Retains the raw SSE frames of each attempt as well as the reassembled response. The only way to debug stream framing itself, and by far the most expensive thing capture can store, so it is gated separately rather than implied.`})]})]})}),y===null?null:O(Z,{role:`alert`,children:y}),A&&y===null?O(Q,{role:`status`,children:`Settings saved.`}):null,O(G,{}),O(R,{}),O(C,{legend:`Known limits`,children:k(l,{$gap:2,children:[k(o,{$gap:2,children:[O(c,{$dim:!0,children:`rate limits`}),O(X,{children:`Per-key rate limits are counted inside one gateway process and reset when it restarts. They are not shared across instances.`})]}),k(o,{$gap:2,children:[O(c,{$dim:!0,children:`logs`}),O(X,{children:`Request rows record routing and token counts only. Prompts and responses are written only when body capture above is on, and to a separate encrypted store; credentials are never written to either.`})]})]})})]})]})}var re=ne;export{re as component};
|
|
@@ -1,76 +0,0 @@
|
|
|
1
|
-
import{$ as e,A as t,At as n,B as r,C as i,Ct as a,D as o,Dt as s,E as c,Et as l,F as u,G as d,H as f,I as p,J as m,K as h,L as g,M as _,N as v,O as y,Ot as b,P as x,Q as S,R as C,S as w,St as T,T as E,Tt as D,U as ee,V as O,W as te,X as ne,Y as re,Z as ie,_ as ae,_t as oe,a as k,at as se,b as ce,bt as le,c as ue,ct as de,d as fe,dt as pe,et as me,f as he,ft as ge,g as _e,gt as ve,h as ye,ht as be,i as xe,it as Se,j as Ce,k as we,kt as Te,l as A,lt as Ee,m as De,mt as Oe,n as ke,nt as Ae,o as je,ot as Me,p as Ne,pt as Pe,q as Fe,r as Ie,rt as Le,s as j,st as Re,t as ze,tt as Be,u as M,ut as Ve,v as N,vt as P,w as He,wt as Ue,x as We,xt as Ge,y as F,yt as Ke,z as qe}from"./shared-DQOWYTp3.js";import{A as Je,C as Ye,F as Xe,ct as Ze,dt as Qe,et as I,ft as $e,ht as et,lt as L,mt as R,st as tt}from"./queries-GAue98pY.js";import{i as nt,n as rt,r as it}from"./index-C3LoGDKu.js";import{i as at,o as ot,t as st}from"./Rack-DdhpgQWD.js";import{B as z,L as ct,P as B,R as lt}from"./States-2kaQxx-s.js";import{t as ut}from"./Panel-BeQOQoap.js";import{i as dt,n as V,r as H,t as ft}from"./Table-CVDZ69Zx.js";import{t as pt}from"./catalog-BBKm8Ih8.js";import{i as U,n as mt,r as ht,t as gt}from"./SummaryDeck-BisdRswW.js";import*as W from"react";import{PureComponent as _t,forwardRef as vt,useMemo as G,useRef as yt,useState as K}from"react";import{jsx as q,jsxs as J}from"react/jsx-runtime";import Y from"styled-components";function bt(e,t){return e.graphicalItems.cartesianItems.find(e=>e.id===t)?.xAxisId??0}function xt(e,t){return e.graphicalItems.cartesianItems.find(e=>e.id===t)?.yAxisId??0}var St=(e,t,n)=>ne(e,`xAxis`,bt(e,t),n),Ct=(e,t,n)=>S(e,`xAxis`,bt(e,t),n),wt=(e,t,n)=>ne(e,`yAxis`,xt(e,t),n),Tt=(e,t,n)=>S(e,`yAxis`,xt(e,t),n),Et=P([Me,St,wt,Ct,Tt],(e,t,n,r,i)=>ve(e,`xAxis`)?pe(t,r,!1):pe(n,i,!1)),Dt=P([e,(e,t)=>t],(e,t)=>e.filter(e=>e.type===`area`).find(e=>e.id===t)),Ot=e=>{var t=Me(e);return ve(t,`xAxis`)?`yAxis`:`xAxis`},kt=(e,t)=>Ot(e)===`yAxis`?xt(e,t):bt(e,t),At=(e,t,n)=>ie(e,Ot(e),kt(e,t),n),jt=P([Dt,At],(e,t)=>{if(e!=null&&t!=null){var n=e.stackId,r=me(e);if(n!=null&&r!=null){var i=(t[n]?.stackedData)?.find(e=>e.key===r);if(i!=null)return i.map(e=>[e[0],e[1]])}}}),Mt=P([Dt,At],(e,t)=>{if(e!=null&&e.stackId!=null&&t!=null){var n=t[e.stackId];if(n!=null)return n.graphicalItems.map(e=>e.dataKey).filter(a)}}),Nt=P([Me,St,wt,Ct,Tt,jt,Le,Et,Dt,Ae,Mt],(e,t,n,r,i,a,o,s,c,l,u)=>{var d=o.chartData,f=o.dataStartIndex,p=o.dataEndIndex;if(!(c==null||e!==`horizontal`&&e!==`vertical`||t==null||n==null||r==null||i==null||r.length===0||i.length===0||s==null)){var m=c.data,h=m&&m.length>0?m:d?.slice(f,p+1);if(h!=null)return fn({layout:e,xAxis:t,yAxis:n,xAxisTicks:r,yAxisTicks:i,dataStartIndex:f,areaSettings:c,stackedData:a,displayedData:h,chartBaseValue:l,bandSize:s,stackDataKeys:u})}}),Pt=[`animationElapsedTime`,`isAnimating`,`isEntrance`,`layout`,`isRange`,`stroke`,`connectNulls`],Ft=[`id`,`baseLine`];function It(){return It=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},It.apply(null,arguments)}function Lt(e,t){if(e==null)return{};var n,r,i=Rt(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function Rt(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}function zt(e){var t=e.alpha,n=e.baseLine,r=e.points,i=e.strokeWidth,a=r[0]?.x,o=r[r.length-1]?.x;if(!oe(a)||!oe(o))return null;var s=t*Math.abs(a-o),c=Math.max(...r.map(e=>e.y||0));return D(n)?c=Math.max(n,c):n&&Array.isArray(n)&&n.length&&(c=Math.max(...n.map(e=>e.y||0),c)),D(c)?W.createElement(`rect`,{x:a<o?a:a-s,y:0,width:s,height:Math.floor(c+(i?parseInt(`${i}`,10):1))}):null}function Bt(e){var t=e.alpha,n=e.baseLine,r=e.points,i=e.strokeWidth,a=r[0]?.y,o=r[r.length-1]?.y;if(!oe(a)||!oe(o))return null;var s=t*Math.abs(a-o),c=Math.max(...r.map(e=>e.x||0));return D(n)?c=Math.max(n,c):n&&Array.isArray(n)&&n.length&&(c=Math.max(...n.map(e=>e.x||0),c)),D(c)?W.createElement(`rect`,{x:0,y:a<o?a:a-s,width:c+(i?parseInt(`${i}`,10):1),height:Math.floor(s)}):null}function Vt(e){var t=e.alpha,n=e.layout,r=e.points,i=e.baseLine,a=e.strokeWidth;return n===`vertical`?W.createElement(Bt,{alpha:t,points:r,baseLine:i,strokeWidth:a}):W.createElement(zt,{alpha:t,points:r,baseLine:i,strokeWidth:a})}function Ht(e){var t=e.animationElapsedTime,n=t===void 0?1:t,r=e.isAnimating,i=r!==void 0&&r,a=e.isEntrance,o=a!==void 0&&a,c=e.layout,l=e.isRange,u=e.stroke,d=e.connectNulls,f=Lt(e,Pt),p=c===`vertical`?`vertical`:`horizontal`,m=d??!1,h=x(),g=f.id,_=f.baseLine,v=Lt(f,Ft),y=Te(v),b=W.createElement(Se,It({},f,{id:g,baseLine:_,connectNulls:m,stroke:`none`,className:`recharts-area-area`,layout:p})),S=u!==`none`&&W.createElement(Se,It({},y,{className:`recharts-area-curve`,layout:p,type:f.type,connectNulls:m,fill:`none`,stroke:u,points:f.points})),C=u!==`none`&&l&&Array.isArray(_)&&W.createElement(Se,It({},y,{className:`recharts-area-curve`,layout:p,type:f.type,connectNulls:m,fill:`none`,stroke:u,points:_}));return o&&(i||n<1)?W.createElement(s,null,W.createElement(`defs`,null,W.createElement(`clipPath`,{id:h},W.createElement(Vt,{alpha:n,points:f.points??[],baseLine:_,layout:p,strokeWidth:f.strokeWidth}))),W.createElement(s,{clipPath:`url(#${h})`},b,S,C)):W.createElement(W.Fragment,null,b,S,C)}var Ut=[`id`],Wt=[`activeDot`,`animationBegin`,`animationDuration`,`animationEasing`,`connectNulls`,`dot`,`fill`,`fillOpacity`,`hide`,`isAnimationActive`,`legendType`,`stroke`,`xAxisId`,`yAxisId`];function Gt(){return Gt=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Gt.apply(null,arguments)}function Kt(e,t){if(e==null)return{};var n,r,i=qt(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function qt(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}function Jt(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function X(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?Jt(Object(n),!0).forEach(function(t){Yt(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Jt(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function Yt(e,t,n){return(t=Xt(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Xt(e){var t=Zt(e,`string`);return typeof t==`symbol`?t:t+``}function Zt(e,t){if(typeof e!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(typeof r!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}var Qt={activeDot:!0,animationBegin:0,animationDuration:1500,animationEasing:`ease`,animationMatchBy:qe,animationInterpolateFn:(e,t)=>e==null?[]:t===1?e.flatMap(e=>e.status===`removed`?[]:[e.next]):e.flatMap(e=>e.status===`matched`?[X(X({},e.next),{},{x:Ge(e.prev.x,e.next.x,t),y:Ge(e.prev.y,e.next.y,t)})]:e.status===`added`?[e.next]:[]),connectNulls:!1,dot:!1,fill:`#3182bd`,fillOpacity:.6,hide:!1,isAnimationActive:`auto`,legendType:`line`,stroke:`#3182bd`,strokeWidth:1,type:`linear`,label:!1,shape:Ht,xAxisId:0,yAxisId:0,zIndex:Be.area};function $t(e,t){return e&&e!==`none`?e:t}var en=e=>{var t=e.dataKey,n=e.name,r=e.stroke,i=e.fill,a=e.legendType;return[{inactive:e.hide,dataKey:t,type:a,color:$t(r,i),value:Oe(n,t),payload:e}]},tn=W.memo(e=>{var t=e.dataKey,n=e.data,r=e.stroke,i=e.strokeWidth,a=e.fill,o=e.name,s=e.hide,c=e.unit,u=e.formatter,d=e.tooltipType,f=e.id,p={dataDefinedOnItem:n,getPosition:l,settings:{stroke:r,strokeWidth:i,fill:a,dataKey:t,nameKey:void 0,name:Oe(o,t),hide:s,type:d,color:$t(r,a),unit:c,formatter:u,graphicalItemId:f}};return W.createElement(O,{tooltipEntrySettings:p})});function nn(e){var t=e.clipPathId,n=e.points,r=e.props,i=r.needClip,a=r.dot,o=r.dataKey,s=Te(r);return W.createElement(Ce,{points:n,dot:a,className:`recharts-area-dots`,dotClassName:`recharts-area-dot`,dataKey:o,baseProps:s,needClip:i,clipPathId:t})}function rn(e){var t=e.showLabels,n=e.children,r=e.points.map(e=>{var t={x:e.x??0,y:e.y??0,width:0,lowerWidth:0,upperWidth:0,height:0};return X(X({},t),{},{value:e.value,payload:e.payload,parentViewBox:void 0,viewBox:t,fill:void 0})});return W.createElement(te,{value:t?r:void 0},n)}function an(e){var t=e.points,n=e.baseLine,r=e.needClip,i=e.clipPathId,a=e.props,o=e.animationElapsedTime,c=e.isAnimating,l=e.isEntrance,u=a.layout,d=a.type,p=a.stroke,m=a.connectNulls,h=a.isRange,g=a.shape,_=a.id,v=Kt(a,Ut),y=X(X({},b(v)),{},{id:_,points:t,connectNulls:m,type:d,baseLine:n,layout:u,stroke:p,isRange:h,animationElapsedTime:o,isAnimating:c,isEntrance:l});return W.createElement(W.Fragment,null,t?.length>1&&W.createElement(s,{clipPath:r?`url(#clipPath-${i})`:void 0},W.createElement(f,{option:g,DefaultShape:Qt.shape,shapeProps:y})),W.createElement(nn,{points:t,props:v,clipPathId:i}))}function on(e,t,n){if(D(e)){var r=D(t)?t:void 0;return Ge(r,e,n)}if(Ue(e)||T(e)){var i=D(t)?t:void 0;return Ge(i,0,n)}return e}function sn(e){var t=e.needClip,n=e.clipPathId,r=e.props,i=e.previousPointsRef,a=e.previousBaselineRef,o=r.points,s=r.baseLine,c=r.isAnimationActive,l=r.animationBegin,f=r.animationDuration,m=r.animationEasing,h=r.animationMatchBy,_=r.animationInterpolateFn,v=G(()=>({points:o,baseLine:s}),[o,s]),y=g(v,a),b=Re(),x=p(r.onAnimationStart,r.onAnimationEnd),S=x.isAnimating,w=x.handleAnimationStart,T=x.handleAnimationEnd,E=y.startValue;if(b==null)return null;var D=Array.isArray(s)&&Array.isArray(E)?C(E,s,h):Array.isArray(s)?C(null,s,h):null;return W.createElement(u,{animationInput:v,animationIdPrefix:`recharts-area-`,items:o,previousItemsRef:i,isAnimationActive:c,animationBegin:l,animationDuration:f,animationEasing:m,onAnimationStart:w,onAnimationEnd:T,animationInterpolateFn:_,animationMatchBy:h,layout:b},(e,i,a)=>{var c=i===1?s:Array.isArray(s)?_(D,i,b):a?s:on(s,E,i);return y.syncStepValue(c,i),W.createElement(rn,{showLabels:!S,points:o},r.children,W.createElement(an,{points:e,baseLine:c,needClip:t,clipPathId:n,props:r,animationElapsedTime:i,isAnimating:S||i<1,isEntrance:a}),W.createElement(d,{label:r.label}))})}function cn(e){var t=e.needClip,n=e.clipPathId,r=e.props,i=yt(null),a=yt();return W.createElement(sn,{needClip:t,clipPathId:n,props:r,previousPointsRef:i,previousBaselineRef:a})}var ln=class extends _t{render(){var e=this.props,t=e.hide,r=e.dot,i=e.points,a=e.className,o=e.top,l=e.left,u=e.needClip,d=e.xAxisId,f=e.yAxisId,p=e.width,h=e.height,g=e.id,_=e.baseLine,v=e.zIndex;if(t)return null;var y=n(`recharts-area`,a),b=g,x=E(r),S=x.r,C=x.strokeWidth,w=ee(r),T=S*2+C,D=u?`url(#clipPath-${w?``:`dots-`}${b})`:void 0;return W.createElement(m,{zIndex:v},W.createElement(s,{className:y},u&&W.createElement(`defs`,null,W.createElement(c,{clipPathId:b,xAxisId:d,yAxisId:f}),!w&&W.createElement(`clipPath`,{id:`clipPath-dots-${b}`},W.createElement(`rect`,{x:l-T/2,y:o-T/2,width:p+T,height:h+T}))),W.createElement(cn,{needClip:u,clipPathId:b,props:this.props})),W.createElement(we,{points:i,mainColor:$t(this.props.stroke,this.props.fill),itemDataKey:this.props.dataKey,activeDot:this.props.activeDot,clipPath:D}),this.props.isRange&&Array.isArray(_)&&W.createElement(we,{points:_,mainColor:$t(this.props.stroke,this.props.fill),itemDataKey:this.props.dataKey,activeDot:this.props.activeDot,clipPath:D}))}};function un(e){var n=e.activeDot,r=e.animationBegin,i=e.animationDuration,a=e.animationEasing,s=e.connectNulls,c=e.dot,l=e.fill,u=e.fillOpacity,d=e.hide,f=e.isAnimationActive,p=e.legendType,m=e.stroke,h=e.xAxisId,g=e.yAxisId,_=Kt(e,Wt),v=de(),y=re(),b=o(h,g).needClip,x=Ve(),S=Ke(t=>Nt(t,e.id,x))??{},C=S.points,w=S.isRange,T=S.baseLine,E=t();if(v!==`horizontal`&&v!==`vertical`||E==null||y!==`AreaChart`&&y!==`ComposedChart`)return null;var D=E.height,ee=E.width,O=E.x,te=E.y;return!C||!C.length?null:W.createElement(ln,Gt({},_,{activeDot:n,animationBegin:r,animationDuration:i,animationEasing:a,baseLine:T,connectNulls:s,dot:c,fill:l,fillOpacity:u,height:D,hide:d,layout:v,isAnimationActive:f,isRange:w,legendType:p,needClip:b,points:C,stroke:m,width:ee,left:O,top:te,xAxisId:h,yAxisId:g}))}var dn=(e,t,n,r,i)=>{var a=n??t;if(D(a))return a;var o=e===`horizontal`?i:r,s=o.scale.domain();if(o.type===`number`){var c=Math.max(s[0],s[1]),l=Math.min(s[0],s[1]);return a===`dataMin`?l:a===`dataMax`||c<0?c:Math.max(Math.min(s[0],s[1]),0)}return a===`dataMin`?s[0]:a===`dataMax`?s[1]:s[0]};function fn(e){var t=e.areaSettings,n=t.connectNulls,r=t.baseValue,i=t.dataKey,a=e.stackedData,o=e.layout,s=e.chartBaseValue,c=e.xAxis,l=e.yAxis,u=e.displayedData,d=e.dataStartIndex,f=e.xAxisTicks,p=e.yAxisTicks,m=e.bandSize,h=e.stackDataKeys,g=a&&a.length,_=dn(o,s,r,c,l),v=o===`horizontal`,y=!1,b=u.map((e,t)=>{var r;if(g)r=a[d+t];else{var o=be(e,i);Array.isArray(o)?(r=o,y=!0):r=[_,o]}var s=r?.[1]??null,u=be(e,i),b=g&&u==null&&h!=null&&h.length>0&&h.every(t=>be(e,t)==null),x=s==null||g&&!n&&u==null||b;return v?{x:ge({axis:c,ticks:f,bandSize:m,entry:e,index:t}),y:x?null:l.scale.map(s)??null,value:r,payload:e}:{x:x?null:c.scale.map(s)??null,y:ge({axis:l,ticks:p,bandSize:m,entry:e,index:t}),value:r,payload:e}});return{points:b,baseLine:(g||y?b.map(e=>{var t=Array.isArray(e.value)?e.value[0]:null;return v?{x:e.x,y:t!=null&&e.y!=null?l.scale.map(t)??null:null,payload:e.payload}:{x:t==null?null:c.scale.map(t)??null,y:e.y,payload:e.payload}}):v?l.scale.map(_):c.scale.map(_))??0,isRange:y}}function pn(e){var t=le(e,Qt),n=Ve();return W.createElement(v,{id:t.id,type:`area`},e=>W.createElement(W.Fragment,null,W.createElement(r,{legendPayload:en(t)}),W.createElement(tn,{dataKey:t.dataKey,data:t.data,stroke:t.stroke,strokeWidth:t.strokeWidth,fill:t.fill,name:t.name,hide:t.hide,unit:t.unit,formatter:t.formatter,tooltipType:t.tooltipType,id:e}),W.createElement(_,{type:`area`,id:e,data:t.data,dataKey:t.dataKey,xAxisId:t.xAxisId,yAxisId:t.yAxisId,zAxisId:0,stackId:Pe(t.stackId),hide:t.hide,barSize:void 0,baseValue:t.baseValue,isPanorama:n,connectNulls:t.connectNulls}),W.createElement(un,Gt({},t,{id:e}))))}var Z=W.memo(pn,se);Z.displayName=`Area`;var mn=[`axis`],hn=vt((e,t)=>W.createElement(We,{chartName:`AreaChart`,defaultTooltipEventType:`axis`,validateTooltipEventTypes:mn,tooltipPayloadSearcher:Fe,categoricalChartProps:e,ref:t})),gn=[`axis`],_n=vt((e,t)=>W.createElement(We,{chartName:`ComposedChart`,defaultTooltipEventType:`axis`,validateTooltipEventTypes:gn,tooltipPayloadSearcher:Fe,categoricalChartProps:e,ref:t})),vn=53,Q=9,$=2,yn=Y.div`
|
|
2
|
-
display: flex;
|
|
3
|
-
gap: ${$}px;
|
|
4
|
-
`,bn=Y.div`
|
|
5
|
-
display: grid;
|
|
6
|
-
grid-template-rows: repeat(7, ${Q}px);
|
|
7
|
-
gap: ${$}px;
|
|
8
|
-
padding-top: ${11}px;
|
|
9
|
-
font-size: 9px;
|
|
10
|
-
color: ${({theme:e})=>e.color.inkFaint};
|
|
11
|
-
`,xn=Y.div`
|
|
12
|
-
line-height: ${Q}px;
|
|
13
|
-
padding-right: 2px;
|
|
14
|
-
text-align: right;
|
|
15
|
-
`,Sn=Y.div`
|
|
16
|
-
display: grid;
|
|
17
|
-
grid-template-columns: repeat(${vn}, ${Q}px);
|
|
18
|
-
gap: ${$}px;
|
|
19
|
-
height: ${Q}px;
|
|
20
|
-
font-size: 9px;
|
|
21
|
-
color: ${({theme:e})=>e.color.inkFaint};
|
|
22
|
-
`,Cn=Y.div`
|
|
23
|
-
white-space: nowrap;
|
|
24
|
-
line-height: ${Q}px;
|
|
25
|
-
`,wn=Y.div`
|
|
26
|
-
display: grid;
|
|
27
|
-
grid-template-columns: repeat(${vn}, ${Q}px);
|
|
28
|
-
gap: ${$}px;
|
|
29
|
-
`,Tn=Y.div`
|
|
30
|
-
display: grid;
|
|
31
|
-
grid-template-rows: repeat(7, ${Q}px);
|
|
32
|
-
gap: ${$}px;
|
|
33
|
-
`,En=Y.div`
|
|
34
|
-
width: ${Q}px;
|
|
35
|
-
height: ${Q}px;
|
|
36
|
-
border-radius: 2px;
|
|
37
|
-
background: ${({$level:e})=>e===0?`var(--panel-sunk)`:`color-mix(in oklch, var(--accent) ${[0,24,46,70,100][e]??100}%, var(--panel-sunk))`};
|
|
38
|
-
border: 1px solid var(--rule);
|
|
39
|
-
visibility: ${({$future:e})=>e?`hidden`:`visible`};
|
|
40
|
-
|
|
41
|
-
&:hover,
|
|
42
|
-
&:focus-visible {
|
|
43
|
-
outline: 1px solid var(--ink-dim);
|
|
44
|
-
outline-offset: 1px;
|
|
45
|
-
}
|
|
46
|
-
`,Dn=Y(Qe)`
|
|
47
|
-
gap: ${$}px;
|
|
48
|
-
`,On=Y(L)`
|
|
49
|
-
color: ${({theme:e})=>e.color.inkDim};
|
|
50
|
-
font-size: 11px;
|
|
51
|
-
`;function kn(e){let t=e.filter(e=>e>0).sort((e,t)=>e-t);if(t.length===0)return[0,0,0];let n=e=>t[Math.min(t.length-1,Math.floor(t.length*e))]??0;return[n(.25),n(.5),n(.75)]}function An(e,[t,n,r]){return e<=0?0:e<=t?1:e<=n?2:e<=r?3:4}function jn({days:e,now:t}){let[n,r]=K(`tokens`),[i,a]=K(null),o=De(n),s=G(()=>{let n=new Map;for(let t of e){let e=Number(t.key);Number.isFinite(e)&&n.set(ae(e),{requests:t.requests,errors:t.errors,costUsd:t.costUsd,inputTokens:t.inputTokens,outputTokens:t.outputTokens,cacheReadTokens:t.cacheReadTokens,cacheWriteTokens:t.cacheWriteTokens,rtkSavedTokens:t.rtkSavedTokens,rtkAppliedRequests:t.rtkAppliedRequests,durationMsSum:t.durationMsSum})}let r=new Date(ae(t));r.setDate(r.getDate()+(6-r.getDay())-370);let i=ae(t);return Array.from({length:vn},()=>Array.from({length:7},()=>{let e=r.getTime();return r.setDate(r.getDate()+1),{at:e,totals:n.get(e)??j,future:e>i}}))},[e,t]),c=s.flat(),l=kn(c.map(e=>o.of({key:``,...e.totals}))),u=c.reduce((e,t)=>ue(e,M(t.totals)),j),d=c.reduce((e,t)=>e+ +(t.totals.requests>0),0),f=(e,t)=>`${e}: ${B(t.requests)} requests, ${B(A(t))} tokens, ${z(t.costUsd)}`;return q(ut,{legend:`Activity`,meta:i===null?`${B(d)} active days`:void 0,actions:q(mt,{children:Ie.map(e=>q(ht,{type:`button`,$size:`sm`,$on:e.id===n,"aria-pressed":e.id===n,onClick:()=>r(e.id),children:e.label},e.id))}),children:J(R,{$gap:2,children:[q($e,{children:q(R,{$gap:1,style:{width:611},children:J(yn,{children:[q(bn,{"aria-hidden":`true`,children:[``,`Mon`,``,`Wed`,``,`Fri`,``].map((e,t)=>q(xn,{children:e},t))}),J(R,{$gap:1,children:[q(Sn,{"aria-hidden":`true`,children:s.map((e,t)=>{let n=e[0],r=s[t-1]?.[0],i=n!==void 0&&(r===void 0||new Date(r.at).getMonth()!==new Date(n.at).getMonth());return q(Cn,{children:i&&n!==void 0?new Date(n.at).toLocaleDateString(`en-GB`,{month:`short`}):``},n?.at??t)})}),q(wn,{role:`grid`,"aria-label":`${o.label} per day over the last year`,children:s.map(e=>q(Tn,{role:`row`,children:e.map(e=>q(En,{role:`gridcell`,tabIndex:-1,"aria-label":f(he(e.at),e.totals),title:f(he(e.at),e.totals),$future:e.future,$level:e.future?0:An(o.of({key:``,...e.totals}),l),onMouseEnter:()=>a(e),onMouseLeave:()=>a(null)},e.at))},e[0]?.at))})]})]})})}),J(Qe,{$justify:`space-between`,$wrap:!0,children:[q(On,{children:i===null?f(`Last 12 months`,u):f(he(i.at),i.totals)}),J(Qe,{$gap:1,children:[q(Ze,{children:`Less`}),q(Dn,{"aria-hidden":`true`,children:[0,1,2,3,4].map(e=>q(En,{$level:e,$future:!1},e))}),q(Ze,{children:`More`})]})]})]})})}function Mn({buckets:e,by:t,since:n,until:r,metric:i,names:a}){let o=F(n,r,t),s=new Map,c=new Map;for(let n of e){let e=n.split??`unknown`;s.set(e,ue(s.get(e)??j,n));let r=c.get(e)??new Map,a=Ne(n.key,t);r.set(a,(r.get(a)??0)+i.of(n)),c.set(e,r)}let l=[...s.entries()].sort((e,t)=>i.of(M(t[1]))-i.of(M(e[1])));return q($e,{children:J(ft,{children:[q(`thead`,{children:J(`tr`,{children:[q(H,{children:`Key`}),q(H,{children:`Trend`}),q(H,{$align:`right`,children:`Requests`}),q(H,{$align:`right`,children:`Failed`}),q(H,{$align:`right`,children:`Tokens`}),q(H,{$align:`right`,children:`Mean`}),q(H,{$align:`right`,children:`Cost`})]})}),q(`tbody`,{children:l.map(([e,t])=>{let n=c.get(e)??new Map,r=e===`unknown`?`Unattributed`:a.get(e)??e;return J(dt,{children:[q(V,{children:q(et,{style:{display:`block`,maxWidth:`28ch`},children:r})}),q(V,{style:{width:120},children:q(at,{values:o.map(e=>n.get(e)??0),height:20,label:`${r}: ${i.format(i.of(M(t)))} over the window`})}),q(V,{$align:`right`,$mono:!0,children:B(t.requests)}),q(V,{$align:`right`,$mono:!0,style:t.errors>0?{color:`var(--down)`}:void 0,children:lt(t.requests===0?0:t.errors/t.requests,0)}),q(V,{$align:`right`,$mono:!0,children:B(A(t))}),q(V,{$align:`right`,$mono:!0,children:ct(t.requests===0?null:t.durationMsSum/t.requests)}),q(V,{$align:`right`,$mono:!0,children:z(t.costUsd)})]},e)})})]})})}var Nn=6,Pn=`__other__`,Fn=`unknown`;function In(e,t){let n=t.get(e);return n===void 0?rt.find(t=>pt[t].models.some(t=>t.id===e))??null:n}function Ln(e,t){return e===null?`var(--ink-faint)`:`color-mix(in oklch, ${nt(e)} ${Math.max(30,100-t*22)}%, var(--panel))`}function Rn({buckets:e,by:t,since:n,until:r,metric:a,providers:o}){let s=[...fe(e,a).entries()],c=s.slice(0,Nn),l=s.slice(Nn),u=[];for(let e of[...rt,null])c.filter(([t])=>In(t,o)===e).forEach(([t,n],r)=>{u.push({name:t,label:t===Fn?`Unresolved`:t,color:Ln(e,r),totals:n})});l.length>0&&u.push({name:Pn,label:`${l.length} more`,color:`var(--ink-faint)`,totals:l.reduce((e,[,t])=>ue(e,M(t)),j)});let d=new Set(c.map(([e])=>e)),f=new Map;for(let n of e){let e=n.split??Fn,r=`${Ne(n.key,t)} ${d.has(e)?e:Pn}`;f.set(r,(f.get(r)??0)+a.of(n))}let p=F(n,r,t).map(e=>{let t={at:e};for(let n of u)t[n.name]=f.get(`${e} ${n.name}`)??0;return t}),m=new Map(u.map(e=>[e.name,e.label]));return J(R,{$gap:2,children:[q(ze,{$height:220,children:q(Ee,{width:`100%`,height:`100%`,children:J(hn,{data:p,margin:{top:4,right:4,bottom:4,left:4},children:[q(y,{stroke:`var(--rule)`,vertical:!1}),q(i,{dataKey:`at`,tickFormatter:e=>N(e,t),tick:{fill:`var(--ink-faint)`,fontSize:10},stroke:`var(--rule-strong)`,interval:`preserveStartEnd`,minTickGap:28}),q(w,{tickFormatter:e=>a.format(e),tick:{fill:`var(--ink-faint)`,fontSize:10},stroke:`var(--rule-strong)`,width:40}),q(h,{cursor:{stroke:`var(--rule-strong)`},content:({active:e,payload:n,label:r})=>{if(e!==!0||n===void 0||n.length===0)return null;let i=n.filter(e=>Number(e.value??0)>0);return J(je,{children:[q(`div`,{children:N(Number(r),t)}),i.length===0?q(`div`,{children:`No ${a.label.toLowerCase()}`}):i.map(e=>J(`div`,{children:[m.get(String(e.dataKey))??String(e.dataKey),` `,a.format(Number(e.value??0))]},String(e.dataKey)))]})}}),u.map(e=>q(Z,{type:`monotone`,dataKey:e.name,stackId:`models`,stroke:e.color,strokeWidth:2,fill:e.color,fillOpacity:.22,isAnimationActive:!1},e.name))]})})}),q(ke,{children:u.map(e=>J(`span`,{children:[q(k,{$color:e.color}),` `,q(et,{title:`${e.label}: ${a.format(a.of(M(e.totals)))} ${a.label.toLowerCase()}`,style:{display:`inline-block`,maxWidth:`24ch`,verticalAlign:`bottom`},children:e.label})]},e.name))})]})}var zn=`unknown`;function Bn(e){let t=rt.find(t=>t===e);return t===void 0?`var(--ink-faint)`:nt(t)}function Vn(e){let t=rt.find(t=>t===e);return t===void 0?`Unresolved`:it[t]}function Hn({buckets:e,by:t,since:n,until:r,metric:a}){let o=fe(e,a),s=[...rt,zn].map(e=>({name:e,totals:o.get(e)})).filter(e=>e.totals!==void 0),c=s.map(e=>e.name),l=F(n,r,t),u=_e(e,l,t,a),d=[...o.values()].reduce((e,t)=>e+t.requests,0);return J(R,{$gap:3,children:[q(ze,{$height:200,children:q(Ee,{width:`100%`,height:`100%`,children:J(hn,{data:u,margin:{top:4,right:4,bottom:4,left:4},children:[q(y,{stroke:`var(--rule)`,vertical:!1}),q(i,{dataKey:`at`,tickFormatter:e=>N(e,t),tick:{fill:`var(--ink-faint)`,fontSize:10},stroke:`var(--rule-strong)`,interval:`preserveStartEnd`,minTickGap:28}),q(w,{tickFormatter:e=>a.format(e),tick:{fill:`var(--ink-faint)`,fontSize:10},stroke:`var(--rule-strong)`,width:48}),q(h,{cursor:{stroke:`var(--rule-strong)`},content:({active:e,payload:n,label:r})=>e!==!0||n===void 0||n.length===0?null:J(je,{children:[q(`div`,{children:N(Number(r),t)}),n.map(e=>J(`div`,{children:[Vn(String(e.dataKey)),` `,a.format(Number(e.value??0))]},String(e.dataKey)))]})}),c.map(e=>q(Z,{type:`monotone`,dataKey:e,stackId:`providers`,stroke:Bn(e),strokeWidth:2,fill:Bn(e),fillOpacity:.22,isAnimationActive:!1},e))]})})}),q(ke,{children:c.map(e=>J(`span`,{children:[q(k,{$color:Bn(e)}),` `,Vn(e)]},e))}),J(ft,{children:[q(`thead`,{children:J(`tr`,{children:[q(H,{children:`Provider`}),q(H,{$align:`right`,children:`Share`}),q(H,{$align:`right`,children:`Requests`}),q(H,{$align:`right`,children:`Failed`}),q(H,{$align:`right`,children:`Tokens`}),q(H,{$align:`right`,children:`Cost`})]})}),q(`tbody`,{children:s.map(({name:e,totals:t})=>J(dt,{children:[J(V,{children:[q(k,{$color:Bn(e)}),` `,Vn(e)]}),q(V,{$align:`right`,$mono:!0,children:lt(d===0?0:t.requests/d,0)}),q(V,{$align:`right`,$mono:!0,children:B(t.requests)}),q(V,{$align:`right`,$mono:!0,style:t.errors>0?{color:`var(--down)`}:void 0,children:B(t.errors)}),q(V,{$align:`right`,$mono:!0,children:B(A(t))}),q(V,{$align:`right`,$mono:!0,children:z(t.costUsd)})]},e))})]})]})}var Un=Y.li`
|
|
52
|
-
display: grid;
|
|
53
|
-
grid-template-columns: minmax(0, 20ch) 1fr auto;
|
|
54
|
-
align-items: center;
|
|
55
|
-
gap: ${({theme:e})=>e.space(2)};
|
|
56
|
-
`,Wn=Y.ol`
|
|
57
|
-
display: flex;
|
|
58
|
-
flex-direction: column;
|
|
59
|
-
gap: ${({theme:e})=>e.space(2)};
|
|
60
|
-
`,Gn=Y.div`
|
|
61
|
-
height: 8px;
|
|
62
|
-
border-radius: 2px;
|
|
63
|
-
background: ${({theme:e})=>e.color.panelSunk};
|
|
64
|
-
border: 1px solid ${({theme:e})=>e.color.rule};
|
|
65
|
-
overflow: hidden;
|
|
66
|
-
`,Kn=Y.div`
|
|
67
|
-
width: ${({$share:e})=>`${Math.max(1.5,e*100)}%`};
|
|
68
|
-
height: 100%;
|
|
69
|
-
border-radius: 0 2px 2px 0;
|
|
70
|
-
background: ${({theme:e,$fault:t})=>t?e.color.down:e.color.accent};
|
|
71
|
-
opacity: 0.85;
|
|
72
|
-
`,qn=Y(et)`
|
|
73
|
-
display: block;
|
|
74
|
-
font-family: ${({theme:e})=>e.font.mono};
|
|
75
|
-
font-size: 12px;
|
|
76
|
-
`,Jn=12;function Yn({buckets:e,metric:t,names:n,unknownLabel:r}){let i=new Map;for(let t of e)i.set(t.key,ue(i.get(t.key)??j,t));let a=e=>e===`unknown`?r??`Unattributed`:n?.get(e)??e,o=[...i.entries()].map(([e,n])=>({name:a(e),entry:n,value:t.of(M(n))})).sort((e,t)=>t.value-e.value),s=o.slice(0,Jn),c=o.slice(Jn),l=s[0]?.value??0;return J(R,{$gap:3,children:[q(Wn,{children:s.map(({name:e,entry:n,value:r})=>J(Un,{children:[q(qn,{title:e,children:e}),q(Gn,{children:q(Kn,{$share:l===0?0:r/l,$fault:n.requests>0&&n.errors===n.requests})}),J(Qe,{$gap:2,children:[q(L,{$size:`12px`,children:t.format(r)}),q(L,{$size:`11px`,$dim:!0,children:z(n.costUsd)})]})]},e))}),c.length===0?null:q(L,{$size:`11px`,$dim:!0,children:`+ ${c.length} more, ${B(c.reduce((e,t)=>e+t.entry.requests,0))} requests`})]})}var Xn=[{id:`inputTokens`,label:`Uncached input`,opacity:.95},{id:`outputTokens`,label:`Output`,opacity:.7},{id:`cacheReadTokens`,label:`Cache read`,opacity:.45},{id:`cacheWriteTokens`,label:`Cache write`,opacity:.22}];function Zn({buckets:e,by:t,since:n,until:r}){let a=new Map;for(let n of e)a.set(Ne(n.key,t),n);let o=F(n,r,t).map(e=>{let t=a.get(e);return{at:e,inputTokens:t?.inputTokens??0,outputTokens:t?.outputTokens??0,cacheReadTokens:t?.cacheReadTokens??0,cacheWriteTokens:t?.cacheWriteTokens??0}}),s=Xn.map(e=>({...e,value:o.reduce((t,n)=>t+n[e.id],0)})),c=s.reduce((e,t)=>e+t.value,0);return J(R,{$gap:3,children:[q(ze,{$height:200,children:q(Ee,{width:`100%`,height:`100%`,children:J(hn,{data:o,margin:{top:4,right:4,bottom:4,left:4},children:[q(y,{stroke:`var(--rule)`,vertical:!1}),q(i,{dataKey:`at`,tickFormatter:e=>N(e,t),tick:{fill:`var(--ink-faint)`,fontSize:10},stroke:`var(--rule-strong)`,interval:`preserveStartEnd`,minTickGap:28}),q(w,{tick:{fill:`var(--ink-faint)`,fontSize:10},stroke:`var(--rule-strong)`,width:44,tickFormatter:e=>B(e)}),q(h,{cursor:{stroke:`var(--rule-strong)`},content:({active:e,payload:n,label:r})=>e!==!0||n===void 0||n.length===0?null:J(je,{children:[q(`div`,{children:N(Number(r),t)}),Xn.map(e=>J(`div`,{children:[e.label,` `,B(Number(n.find(t=>t.dataKey===e.id)?.value??0))]},e.id))]})}),Xn.map(e=>q(Z,{type:`monotone`,dataKey:e.id,stackId:`tokens`,stroke:`var(--accent)`,strokeOpacity:e.opacity,strokeWidth:1.5,fill:`var(--accent)`,fillOpacity:e.opacity*.5,isAnimationActive:!1},e.id))]})})}),q(ke,{children:s.map(e=>J(Qe,{$gap:1,children:[q(k,{$color:`var(--accent)`,style:{opacity:e.opacity}}),q(`span`,{children:e.label}),q(L,{$size:`11px`,children:B(e.value)}),q(L,{$size:`11px`,$dim:!0,children:lt(c===0?0:e.value/c,0)})]},e.id))})]})}function Qn({buckets:e,by:t,since:n,until:r}){let a=new Map;for(let n of e)a.set(Ne(n.key,t),n);let o=F(n,r,t).map(e=>{let n=a.get(e);return{at:e,label:N(e,t),requests:n?.requests??0,errors:n?.errors??0,costUsd:n?.costUsd??0,tokens:n===void 0?0:A(n)}});return J(R,{$gap:2,children:[q(ze,{$height:220,children:q(Ee,{width:`100%`,height:`100%`,children:J(_n,{data:o,margin:{top:4,right:4,bottom:4,left:4},children:[q(y,{stroke:`var(--rule)`,vertical:!1}),q(i,{dataKey:`label`,tick:{fill:`var(--ink-faint)`,fontSize:10},stroke:`var(--rule-strong)`,interval:`preserveStartEnd`,minTickGap:28}),q(w,{tick:{fill:`var(--ink-faint)`,fontSize:10},stroke:`var(--rule-strong)`,width:40}),q(h,{cursor:{stroke:`var(--rule-strong)`},content:({active:e,payload:t})=>{if(e!==!0||t===void 0||t.length===0)return null;let n=t[0]?.payload;return n===void 0?null:J(je,{children:[q(`div`,{children:n.label}),J(`div`,{children:[B(n.requests),` requests`]}),J(`div`,{children:[B(n.errors),` failed`]}),J(`div`,{children:[B(n.tokens),` tokens`]}),q(`div`,{children:z(n.costUsd)})]})}}),q(Z,{type:`monotone`,dataKey:`requests`,stroke:`none`,fill:`var(--accent)`,fillOpacity:.12,isAnimationActive:!1}),q(He,{type:`monotone`,dataKey:`requests`,stroke:`var(--accent)`,strokeWidth:2,dot:!1,activeDot:{r:4,stroke:`var(--panel)`,strokeWidth:2},isAnimationActive:!1}),q(He,{type:`monotone`,dataKey:`errors`,stroke:`var(--down)`,strokeWidth:2,dot:!1,activeDot:{r:4,stroke:`var(--panel)`,strokeWidth:2},isAnimationActive:!1})]})})}),J(ke,{children:[J(`span`,{children:[q(k,{$color:`var(--accent)`}),` Requests`]}),J(`span`,{children:[q(k,{$color:`var(--down)`}),` Failed`]})]})]})}var $n=864e5,er=[{id:`requestedModel`,label:`As requested`,column:`Virtual model`},{id:`model`,label:`As served`,column:`Upstream model`}];function tr(){let{cadence:e}=ot(),[t,n]=K(`24h`),[r,i]=K(`tokens`),[a,o]=K(`model`),s=ye(t),c=De(r),l=G(()=>s.grain===`daily`?ae(Date.now()-s.ms):Math.floor((Date.now()-s.ms)/6e4)*6e4,[s]),u=G(()=>l+s.ms,[l,s]),d=G(()=>ae(Date.now()-371*$n),[]),f={since:l,grain:s.grain},p=I({...f,groupBy:s.by},e(6e4,`res:usage`)),m=I({...f,groupBy:s.by,splitBy:`provider`},e(6e4,`res:usage`)),h=I({...f,groupBy:s.by,splitBy:`model`},e(6e4,`res:usage`)),g=I({...f,groupBy:s.by,splitBy:`apiKey`},e(6e4,`res:usage`)),_=I({...f,groupBy:a},e(6e4,`res:usage`)),v=I({...f,groupBy:`credential`},e(6e4,`res:usage`)),y=I({since:d,grain:`daily`,groupBy:`day`},e(3e5,`res:usage`)),b=Je(),x=Ye(),S=Xe(),C=G(()=>{let e=new Map;for(let t of S.data??[])for(let n of t.targets)e.set(n.model,n.provider);return e},[S.data]),w=G(()=>{let e=new Map;for(let t of b.data??[])e.set(t.id,t.label);return e},[b.data]),T=G(()=>{let e=new Map;for(let t of x.data??[])e.set(t.id,t.label);return e},[x.data]),E=p.data??[],D=ce(E),ee=A(D),O={legend:`Nothing recorded`,message:`No requests landed in this window. Widen the range, or send traffic through the gateway.`};return J(R,{$gap:4,children:[q(st,{legend:`Usage`,title:`Requests, tokens, and spend`,summary:p.isLoading?`Reading usage…`:`${B(D.requests)} requests and ${z(D.costUsd)} over the last ${s.label}.`,actions:q(mt,{children:xe.map(e=>q(ht,{type:`button`,$size:`sm`,$on:e.id===t,"aria-pressed":e.id===t,onClick:()=>n(e.id),children:e.id},e.id))})}),q(gt,{buckets:E,since:l,until:u,by:s.by,rangeLabel:s.label}),q(U,{legend:`Traffic`,meta:s.by===`hour`?`By hour`:`By day`,query:p,isEmpty:E.length===0,empty:O,children:q(Qn,{buckets:E,by:s.by,since:l,until:u})}),q(mt,{children:Ie.map(e=>q(ht,{type:`button`,$size:`sm`,$on:e.id===r,"aria-pressed":e.id===r,onClick:()=>i(e.id),children:`Rank by ${e.label.toLowerCase()}`},e.id))}),q(U,{legend:`Traffic by upstream model`,meta:`${c.label}, ${s.by===`hour`?`by hour`:`by day`}`,query:h,isEmpty:(h.data??[]).length===0,empty:O,children:q(Rn,{buckets:h.data??[],by:s.by,since:l,until:u,metric:c,providers:C})}),J(tt,{$min:`480px`,$gap:4,children:[J(R,{$gap:4,children:[q(U,{legend:`Providers`,meta:c.label,query:m,isEmpty:(m.data??[]).length===0,empty:O,children:q(Hn,{buckets:m.data??[],by:s.by,since:l,until:u,metric:c})}),q(jn,{days:y.data??[],now:Date.now()})]}),J(R,{$gap:4,children:[q(U,{legend:`Token mix`,meta:B(ee),query:p,isEmpty:E.length===0,empty:O,children:q(Zn,{buckets:E,by:s.by,since:l,until:u})}),q(U,{legend:`Models`,meta:er.find(e=>e.id===a)?.column,query:_,isEmpty:(_.data??[]).length===0,empty:O,actions:q(mt,{children:er.map(e=>q(ht,{type:`button`,$size:`sm`,$on:e.id===a,"aria-pressed":e.id===a,onClick:()=>o(e.id),children:e.label},e.id))}),children:q(Yn,{buckets:_.data??[],metric:c})}),q(U,{legend:`Accounts`,meta:c.label,query:v,isEmpty:(v.data??[]).length===0,empty:O,children:q(Yn,{buckets:v.data??[],metric:c,names:T,unknownLabel:`No account`})})]})]}),q(U,{legend:`API keys`,meta:c.label,query:g,isEmpty:(g.data??[]).length===0,empty:O,children:q(Mn,{buckets:g.data??[],by:s.by,since:l,until:u,metric:c,names:w})})]})}var nr=tr;export{nr as component};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
var e={anthropic:{defaultModel:`claude-opus-5`,authTypes:[`oauth`,`apiKey`],models:[{id:`claude-fable-5`,label:`Claude Fable 5`,pricing:{input:10,output:50,cacheRead:1,cacheWrite5m:12.5,cacheWrite1h:20},limits:{contextWindow:1e6,maxOutputTokens:128e3}},{id:`claude-opus-5`,label:`Claude Opus 5`,pricing:{input:5,output:25,cacheRead:.5,cacheWrite5m:6.25,cacheWrite1h:10},limits:{contextWindow:1e6,maxOutputTokens:128e3}},{id:`claude-sonnet-5`,label:`Claude Sonnet 5`,pricing:{input:3,output:15,cacheRead:.3,cacheWrite5m:3.75,cacheWrite1h:6},limits:{contextWindow:1e6,maxOutputTokens:128e3}},{id:`claude-haiku-4-5`,label:`Claude Haiku 4.5`,pricing:{input:1,output:5,cacheRead:.1,cacheWrite5m:1.25,cacheWrite1h:2},limits:{contextWindow:2e5,maxOutputTokens:64e3},reasoningForm:`budget`}]},openai:{defaultModel:`gpt-5.6`,authTypes:[`oauth`,`apiKey`],models:[{id:`gpt-5.6`,label:`GPT-5.6 — routes to Sol`,pricing:{input:5,output:30,cacheRead:.5,cacheWrite5m:0,cacheWrite1h:0},limits:{contextWindow:922e3,maxOutputTokens:128e3},oauthLimits:{contextWindow:272e3,maxOutputTokens:128e3}},{id:`gpt-5.6-sol`,label:`GPT-5.6 Sol — deepest reasoning`,pricing:{input:5,output:30,cacheRead:.5,cacheWrite5m:0,cacheWrite1h:0},limits:{contextWindow:922e3,maxOutputTokens:128e3},oauthLimits:{contextWindow:272e3,maxOutputTokens:128e3}},{id:`gpt-5.6-terra`,label:`GPT-5.6 Terra — balanced`,pricing:{input:2,output:12,cacheRead:.2,cacheWrite5m:0,cacheWrite1h:0},limits:{contextWindow:922e3,maxOutputTokens:128e3},oauthLimits:{contextWindow:272e3,maxOutputTokens:128e3}},{id:`gpt-5.6-luna`,label:`GPT-5.6 Luna — fastest`,pricing:{input:.2,output:1.2,cacheRead:.02,cacheWrite5m:0,cacheWrite1h:0},limits:{contextWindow:922e3,maxOutputTokens:128e3},oauthLimits:{contextWindow:272e3,maxOutputTokens:128e3}}]},kimi:{defaultModel:`k3-256k`,authTypes:[`oauth`,`apiKey`],models:[{id:`k3-256k`,label:`Kimi K3 — 256K`,pricing:{input:3,output:15,cacheRead:.3,cacheWrite5m:0,cacheWrite1h:0},limits:{contextWindow:262144,maxOutputTokens:131072}},{id:`k3`,label:`Kimi K3 — up to 1M`,pricing:{input:3,output:15,cacheRead:.3,cacheWrite5m:0,cacheWrite1h:0},limits:{contextWindow:1048576,maxOutputTokens:131072}},{id:`kimi-for-coding`,label:`Kimi K2.7 Code`,pricing:{input:.95,output:4,cacheRead:.19,cacheWrite5m:0,cacheWrite1h:0},limits:{contextWindow:262144,maxOutputTokens:131072}},{id:`kimi-for-coding-highspeed`,label:`Kimi K2.7 Code — High Speed`,pricing:{input:.95,output:8,cacheRead:.19,cacheWrite5m:0,cacheWrite1h:0},limits:{contextWindow:262144,maxOutputTokens:131072}}]},kilo:{defaultModel:`anthropic/claude-sonnet-5`,authTypes:[`oauth`,`apiKey`],models:[{id:`anthropic/claude-fable-5`,label:`Claude Fable 5`,pricing:{input:10,output:50,cacheRead:1,cacheWrite5m:12.5,cacheWrite1h:12.5},limits:{contextWindow:1e6,maxOutputTokens:128e3}},{id:`anthropic/claude-opus-5`,label:`Claude Opus 5`,pricing:{input:5,output:25,cacheRead:.5,cacheWrite5m:6.25,cacheWrite1h:6.25},limits:{contextWindow:1e6,maxOutputTokens:128e3}},{id:`anthropic/claude-sonnet-5`,label:`Claude Sonnet 5`,pricing:{input:2,output:10,cacheRead:.2,cacheWrite5m:2.5,cacheWrite1h:2.5},limits:{contextWindow:1e6,maxOutputTokens:128e3}},{id:`anthropic/claude-haiku-4.5`,label:`Claude Haiku 4.5`,pricing:{input:1,output:5,cacheRead:.1,cacheWrite5m:1.25,cacheWrite1h:1.25},limits:{contextWindow:2e5,maxOutputTokens:64e3}},{id:`openai/gpt-5.6-sol`,label:`GPT-5.6 Sol`,pricing:{input:5,output:30,cacheRead:.5,cacheWrite5m:6.25,cacheWrite1h:6.25},limits:{contextWindow:105e4,maxOutputTokens:128e3}},{id:`openai/gpt-5.6-terra`,label:`GPT-5.6 Terra`,pricing:{input:2,output:12,cacheRead:.2,cacheWrite5m:2.5,cacheWrite1h:2.5},limits:{contextWindow:105e4,maxOutputTokens:128e3}},{id:`openai/gpt-5.6-luna`,label:`GPT-5.6 Luna`,pricing:{input:.2,output:1.2,cacheRead:.02,cacheWrite5m:.25,cacheWrite1h:.25},limits:{contextWindow:105e4,maxOutputTokens:128e3}},{id:`google/gemini-3.1-pro-preview`,label:`Gemini 3.1 Pro Preview`,pricing:{input:2,output:12,cacheRead:.2,cacheWrite5m:.375,cacheWrite1h:.375},limits:{contextWindow:1048576,maxOutputTokens:65536}},{id:`google/gemini-3.7-flash`,label:`Gemini 3.7 Flash`,pricing:{input:.75,output:3.75,cacheRead:.075,cacheWrite5m:.041667,cacheWrite1h:.041667},limits:{contextWindow:1048576,maxOutputTokens:65536}},{id:`moonshotai/kimi-k3`,label:`Kimi K3`,pricing:{input:3,output:15,cacheRead:.3,cacheWrite5m:0,cacheWrite1h:0},limits:{contextWindow:1048576,maxOutputTokens:131072}},{id:`nvidia/nemotron-3-ultra-550b-a55b:free`,label:`Nemotron 3 Ultra 550B — free`,pricing:{input:0,output:0,cacheRead:0,cacheWrite5m:0,cacheWrite1h:0},limits:{contextWindow:1e6,maxOutputTokens:65536},auth:[`apiKey`]},{id:`nvidia/nemotron-3.5-lightning:free`,label:`Nemotron 3.5 Lightning — free`,pricing:{input:0,output:0,cacheRead:0,cacheWrite5m:0,cacheWrite1h:0},limits:{contextWindow:1e6,maxOutputTokens:65536},auth:[`apiKey`]},{id:`dots-studio/dots-3-note-preview:free`,label:`Dots 3 Note Preview — free`,pricing:{input:0,output:0,cacheRead:0,cacheWrite5m:0,cacheWrite1h:0},limits:{contextWindow:512e3,maxOutputTokens:512e3},auth:[`apiKey`]},{id:`cohere/north-mini-code:free`,label:`North Mini Code — free`,pricing:{input:0,output:0,cacheRead:0,cacheWrite5m:0,cacheWrite1h:0},limits:{contextWindow:256e3,maxOutputTokens:64e3},auth:[`apiKey`]},{id:`nvidia/nemotron-3-nano-omni-30b-a3b-reasoning:free`,label:`Nemotron 3 Nano Omni 30B Reasoning — free`,pricing:{input:0,output:0,cacheRead:0,cacheWrite5m:0,cacheWrite1h:0},limits:{contextWindow:256e3,maxOutputTokens:65536},auth:[`apiKey`]},{id:`stepfun/step-3.7-flash:free`,label:`Step 3.7 Flash — free`,pricing:{input:0,output:0,cacheRead:0,cacheWrite5m:0,cacheWrite1h:0},limits:{contextWindow:262144,maxOutputTokens:262144},auth:[`apiKey`]},{id:`nvidia/nemotron-3-super-120b-a12b:free`,label:`Nemotron 3 Super 120B — free`,pricing:{input:0,output:0,cacheRead:0,cacheWrite5m:0,cacheWrite1h:0},limits:{contextWindow:262144,maxOutputTokens:262144},auth:[`apiKey`]},{id:`tencent/hy3:free`,label:`Tencent HY3 — free`,pricing:{input:0,output:0,cacheRead:0,cacheWrite5m:0,cacheWrite1h:0},limits:{contextWindow:262144,maxOutputTokens:128e3},auth:[`apiKey`]},{id:`poolside/laguna-s-2.1:free`,label:`Laguna S 2.1 — free`,pricing:{input:0,output:0,cacheRead:0,cacheWrite5m:0,cacheWrite1h:0},limits:{contextWindow:262144,maxOutputTokens:32768},auth:[`apiKey`]},{id:`poolside/laguna-xs-2.1:free`,label:`Laguna XS 2.1 — free`,pricing:{input:0,output:0,cacheRead:0,cacheWrite5m:0,cacheWrite1h:0},limits:{contextWindow:262144,maxOutputTokens:32768},auth:[`apiKey`]},{id:`liquid/lfm-2.5-2.6b:free`,label:`LFM 2.5 2.6B — free`,pricing:{input:0,output:0,cacheRead:0,cacheWrite5m:0,cacheWrite1h:0},limits:{contextWindow:128e3,maxOutputTokens:8192},auth:[`apiKey`]},{id:`nvidia/nemotron-3.5-content-safety:free`,label:`Nemotron 3.5 Content Safety — free`,pricing:{input:0,output:0,cacheRead:0,cacheWrite5m:0,cacheWrite1h:0},limits:{contextWindow:128e3,maxOutputTokens:8192},auth:[`apiKey`]},{id:`kilo-auto/frontier`,label:`Kilo Auto — Frontier`,pricing:{input:0,output:0,cacheRead:0,cacheWrite5m:0,cacheWrite1h:0},limits:{contextWindow:1e6,maxOutputTokens:128e3},auth:[`apiKey`]},{id:`kilo-auto/balanced`,label:`Kilo Auto — Balanced`,pricing:{input:0,output:0,cacheRead:0,cacheWrite5m:0,cacheWrite1h:0},limits:{contextWindow:1e6,maxOutputTokens:65536},auth:[`apiKey`]},{id:`kilo-auto/efficient`,label:`Kilo Auto — Efficient`,pricing:{input:0,output:0,cacheRead:0,cacheWrite5m:0,cacheWrite1h:0},limits:{contextWindow:1e6,maxOutputTokens:65536},auth:[`apiKey`]},{id:`kilo-auto/small`,label:`Kilo Auto — Small`,pricing:{input:.05,output:.4,cacheRead:.005,cacheWrite5m:0,cacheWrite1h:0},limits:{contextWindow:262144,maxOutputTokens:32768},auth:[`apiKey`]},{id:`kilo-auto/free`,label:`Kilo Auto — Free`,pricing:{input:0,output:0,cacheRead:0,cacheWrite5m:0,cacheWrite1h:0},limits:{contextWindow:256e3,maxOutputTokens:1e4},auth:[`apiKey`]}]},grok:{defaultModel:`grok-4.6`,authTypes:[`oauth`,`apiKey`],models:[{id:`grok-4.6`,label:`Grok 4.6`,pricing:{input:2,output:6,cacheRead:.5,cacheWrite5m:0,cacheWrite1h:0},limits:{contextWindow:5e5,maxOutputTokens:128e3}},{id:`grok-4.5`,label:`Grok 4.5`,pricing:{input:2,output:6,cacheRead:.3,cacheWrite5m:0,cacheWrite1h:0},limits:{contextWindow:5e5,maxOutputTokens:128e3}},{id:`grok-4.3`,label:`Grok 4.3`,pricing:{input:1.25,output:2.5,cacheRead:.2,cacheWrite5m:0,cacheWrite1h:0},limits:{contextWindow:1e6,maxOutputTokens:128e3}},{id:`grok-4.20-0309-reasoning`,label:`Grok 4.20 — reasoning`,pricing:{input:1.25,output:2.5,cacheRead:.2,cacheWrite5m:0,cacheWrite1h:0},limits:{contextWindow:1e6,maxOutputTokens:128e3}},{id:`grok-4.20-0309-non-reasoning`,label:`Grok 4.20 — non-reasoning`,pricing:{input:1.25,output:2.5,cacheRead:.2,cacheWrite5m:0,cacheWrite1h:0},limits:{contextWindow:1e6,maxOutputTokens:128e3}},{id:`grok-4.20-multi-agent-0309`,label:`Grok 4.20 — multi-agent`,pricing:{input:1.25,output:2.5,cacheRead:.2,cacheWrite5m:0,cacheWrite1h:0},limits:{contextWindow:1e6,maxOutputTokens:128e3}}]},custom:{defaultModel:``,authTypes:[`apiKey`],models:[]}};function t(t,n){return e[t]?.models.find(e=>e.id===n)?.pricing??null}function n(t,n){let r=e[t];return r.models.find(e=>e.id===n)?.auth??r.authTypes}function r(t,n,r=`apiKey`){let i=e[t]?.models.find(e=>e.id===n);return i===void 0?null:(r===`oauth`?i.oauthLimits:void 0)??i.limits}export{t as i,r as n,n as r,e as t};
|
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
import{_ as e,h as t,i as n}from"./shared-DQOWYTp3.js";import{ct as r,d as i,dt as a,f as ee,ft as o,h as te,lt as s,m as ne,mt as c,n as re,p as ie,u as l,ut as u,vt as ae,yt as d}from"./queries-GAue98pY.js";import{c as oe,o as f,r as p,t as se}from"./Rack-DdhpgQWD.js";import{n as ce,t as m}from"./chevron-right-mGs1is3r.js";import{B as h,P as g,R as _,b as v,m as le,n as ue,p as de,r as fe,s as y,z as b}from"./States-2kaQxx-s.js";import{i as x,n as pe}from"./Field-B2rnk3JM.js";import{t as S}from"./Meter-stpt3vQu.js";import{t as me}from"./Panel-BeQOQoap.js";import{i as C,n as w,r as T,t as E}from"./Table-CVDZ69Zx.js";import{n as he,r as ge}from"./WindowChart-Bvbkz9rt.js";import{n as D,t as O}from"./stream-Bu-m1Z1Y.js";import{i as _e,n as ve,r as ye,t as be}from"./RequestTable-I1TrD689.js";import{i as k,n as A,r as xe,t as Se}from"./SummaryDeck-BisdRswW.js";import{Fragment as Ce,useMemo as j,useState as M}from"react";import{jsx as N,jsxs as P}from"react/jsx-runtime";import F from"styled-components";var I=F.div`
|
|
2
|
-
display: grid;
|
|
3
|
-
grid-template-areas:
|
|
4
|
-
"chassis"
|
|
5
|
-
"main";
|
|
6
|
-
grid-template-columns: minmax(0, 1fr);
|
|
7
|
-
grid-template-rows: auto minmax(0, 1fr);
|
|
8
|
-
height: 100vh;
|
|
9
|
-
min-height: 0;
|
|
10
|
-
overflow: hidden;
|
|
11
|
-
`,L=F.main`
|
|
12
|
-
grid-area: main;
|
|
13
|
-
padding: ${({theme:e})=>e.space(4)};
|
|
14
|
-
display: flex;
|
|
15
|
-
flex-direction: column;
|
|
16
|
-
gap: ${({theme:e})=>e.space(4)};
|
|
17
|
-
min-width: 0;
|
|
18
|
-
min-height: 0;
|
|
19
|
-
overflow-y: auto;
|
|
20
|
-
|
|
21
|
-
@media (max-width: 720px) {
|
|
22
|
-
padding: ${({theme:e})=>e.space(3)};
|
|
23
|
-
}
|
|
24
|
-
`;function R({children:e}){let{cadence:t}=f(),n=l(),r=i(200,t(1e4,`res:logs`));return P(I,{"data-testid":`client-shell`,children:[N(p,{logs:r.data??[],logsFailed:r.isError,signOut:{pending:n.isPending,run:()=>{n.mutate(void 0,{onSuccess:()=>window.location.assign(`/login`)})}}}),N(L,{children:e})]})}var z=[20,50,100,250],B={"1m":`per minute`,"5h":`per 5 hours`,"1w":`per week`};function we({reading:e}){let t=e.window===null?`concurrent requests`:`${e.dimension} ${B[e.window]??e.window}`,n=e.dimension===`spend`?h:g,r=e.used===null?null:e.limit===0?1:e.used/e.limit;return P(C,{children:[N(w,{children:t}),N(w,{$align:`right`,$mono:!0,children:e.used===null?N(u,{children:`unknown`}):n(e.used)}),N(w,{$align:`right`,$mono:!0,children:n(e.limit)}),N(w,{children:r===null?null:N(S,{fraction:r,label:`${t}, ${Math.round(Math.min(1,r)*100)}% used`})})]})}function V(e){return{observedAt:e.observedAt,windowType:e.windowType,windowMs:e.windowMs,resetsAt:e.resetsAt,usedRatio:e.usedRatio}}function H(e){return{stale:e.stale,rolledOver:e.rolledOver,estimateStale:e.stale||e.rolledOver,survives:e.survives,exhaustsAt:e.exhaustsAt}}var U=F.div`
|
|
25
|
-
display: flex;
|
|
26
|
-
flex-direction: column;
|
|
27
|
-
gap: 4px;
|
|
28
|
-
`,W=F.div`
|
|
29
|
-
display: grid;
|
|
30
|
-
/* Bar, figure, legend — the accounts page's own three columns, so the two
|
|
31
|
-
screens read the same way and the legends stay aligned down the stack. */
|
|
32
|
-
grid-template-columns: 96px 34px 1fr;
|
|
33
|
-
align-items: center;
|
|
34
|
-
min-width: 208px;
|
|
35
|
-
gap: 6px;
|
|
36
|
-
`,G=F(s)`
|
|
37
|
-
font-size: 11px;
|
|
38
|
-
text-align: right;
|
|
39
|
-
`;function Te({windows:e,open:t,onToggle:n}){let i=e[0],a=e.filter(e=>e.usedRatio!==null);return P(C,{children:[N(w,{children:i.label}),N(w,{children:a.length===0?N(u,{children:`unknown`}):N(U,{children:a.map(e=>P(W,{children:[N(S,{fraction:e.usedRatio,label:`${e.label} ${e.windowType} window, ${Math.round(e.usedRatio*100)}% used`}),N(G,{children:_(e.usedRatio,0)}),N(r,{children:v(e,H(e),Date.now(),b)})]},e.windowType))})}),N(w,{$align:`right`,children:N(d,{type:`button`,$variant:`ghost`,$size:`sm`,"aria-expanded":t,"aria-label":`${t?`Hide`:`Show`} quota history for ${i.label}`,title:`${t?`Hide`:`Show`} quota history for ${i.label}`,onClick:n,children:N(t?ce:m,{})})})]})}function K(){let{cadence:l,live:d}=f(),[p,ce]=M(`24h`),[m,v]=M(`all`),[b,S]=M(``),[D,O]=M(z[0]),[F,I]=M(null),[L,R]=M(null),B=t(p),H=j(()=>B.grain===`daily`?e(Date.now()-B.ms):Math.floor((Date.now()-B.ms)/6e4)*6e4,[B]),U=j(()=>H+B.ms,[H,B]),W=ne(),G={since:H,grain:B.grain},K=te({...G,groupBy:B.by},l(6e4,`res:usage`)),q=te({...G,groupBy:`model`},l(6e4,`res:usage`)),J=i(D,l(re,`res:logs`)),Y=ee(6e4),X=Y.data??[],Ee=j(()=>{let e=new Map;for(let t of X){let n=e.get(t.provider)??new Map,r=n.get(t.credentialId);r===void 0?n.set(t.credentialId,[t]):r.push(t),e.set(t.provider,n)}return[...e.entries()].map(([e,t])=>[e,[...t.entries()].map(([e,t])=>({credentialId:e,windows:[...t].sort((e,t)=>y[e.windowType]-y[t.windowType])}))])},[X]),Z=X.map(e=>ge(V(e))).filter(e=>e!==null),De=Z.length===0?0:Math.floor(Math.min(...Z)/6e4)*6e4,Oe=ie({since:De},L!==null&&Z.length>0),ke=(J.data??[]).some(le),Ae=_e(d&&ke),Q=ye(J.data??[],m,b),je=(J.data??[]).filter(de).length,$=K.data??[],Me=$.reduce((e,t)=>e+t.requests,0),Ne=$.reduce((e,t)=>e+t.costUsd,0);return P(c,{$gap:4,children:[N(se,{legend:`Client`,title:`Your usage`,summary:K.isLoading?`Reading your usage…`:`${g(Me)} requests and ${h(Ne)} over the last ${B.label}.`,actions:N(A,{children:n.map(e=>N(xe,{type:`button`,$size:`sm`,$on:e.id===p,"aria-pressed":e.id===p,onClick:()=>ce(e.id),children:e.id},e.id))})}),N(me,{legend:`Your key`,meta:W.data===void 0?void 0:P(s,{$dim:!0,children:[W.data.prefix,`…`]}),children:W.isPending?N(fe,{rows:2}):W.isError?N(ue,{legend:`Could not read your key`,error:W.error}):P(c,{$gap:2,children:[P(a,{$gap:2,$wrap:!0,children:[N(r,{children:W.data.label}),W.data.bodyLoggingOptOut?N(u,{children:`Request bodies are never stored for this key.`}):null]}),W.data.modelAllowlist===null?N(u,{children:`Every model this gateway serves.`}):W.data.modelAllowlist.length===0?N(u,{children:`No models. This key cannot serve a request.`}):N(a,{$gap:1,$wrap:!0,children:W.data.modelAllowlist.map(e=>N(s,{children:e},e))})]})}),N(Se,{buckets:$,since:H,until:U,by:B.by,rangeLabel:B.label}),N(k,{legend:`By model`,meta:B.label,query:{isLoading:q.isLoading,isError:q.isError,error:q.error,refetch:()=>void q.refetch()},failure:`Could not read usage`,empty:{legend:`No traffic`,message:`Nothing served in this window.`},isEmpty:(q.data??[]).length===0,children:N(o,{children:P(E,{children:[N(`thead`,{children:P(`tr`,{children:[N(T,{children:`Model`}),N(T,{$align:`right`,children:`Requests`}),N(T,{$align:`right`,children:`Tokens`}),N(T,{$align:`right`,children:`Spend`})]})}),N(`tbody`,{children:(q.data??[]).map(e=>P(C,{children:[N(w,{$mono:!0,children:e.key}),N(w,{$align:`right`,$mono:!0,children:g(e.requests)}),N(w,{$align:`right`,$mono:!0,children:g(e.inputTokens+e.outputTokens+e.cacheReadTokens+e.cacheWriteTokens)}),N(w,{$align:`right`,$mono:!0,children:h(e.costUsd)})]},e.key))})]})})}),N(k,{legend:`Your limits`,query:{isLoading:W.isLoading,isError:W.isError,error:W.error,refetch:()=>void W.refetch()},failure:`Could not read your limits`,empty:W.data?.limits===null?{legend:`Limits unreadable`,message:`This key's limits could not be read. Requests are refused until an operator repairs it.`}:{legend:`No limits`,message:`This key is not rate limited.`},isEmpty:W.data?.limits===null||(W.data?.limitUsage.length??0)===0,footer:N(u,{children:`Counted from completed requests, so a burst in flight right now may not be included yet.`}),children:N(o,{children:P(E,{children:[N(`thead`,{children:P(`tr`,{children:[N(T,{children:`Limit`}),N(T,{$align:`right`,children:`Used`}),N(T,{$align:`right`,children:`Ceiling`}),N(T,{$width:`30%`,children:`Consumption`})]})}),N(`tbody`,{children:(W.data?.limitUsage??[]).map(e=>N(we,{reading:e},`${e.dimension}:${e.window??`gauge`}`))})]})})}),N(k,{legend:`Provider headroom`,query:{isLoading:Y.isLoading,isError:Y.isError,error:Y.error,refetch:()=>void Y.refetch()},failure:`Could not read provider headroom`,empty:{legend:`No data`,message:`No provider has reported a usage window.`},isEmpty:X.length===0,footer:N(u,{children:`What each account serving this gateway has left. A request is served by whichever account of a provider can take it.`}),children:N(c,{$gap:4,children:Ee.map(([e,t])=>P(c,{$gap:1,children:[N(r,{children:e}),N(o,{children:P(E,{children:[N(`thead`,{children:P(`tr`,{children:[N(T,{children:`Account`}),N(T,{$width:`60%`,children:`Quota`}),N(T,{})]})}),N(`tbody`,{children:t.map(({credentialId:e,windows:t})=>P(Ce,{children:[N(Te,{windows:t,open:L===e,onToggle:()=>R(L===e?null:e)}),L===e?N(C,{children:N(w,{colSpan:3,children:N(c,{$gap:4,children:t.map(e=>{let t=V(e),n=ge(t),r=(Oe.data?.samples??[]).filter(t=>t.credentialId===e.credentialId&&t.windowType===e.windowType&&t.observedAt>=(n??0));return N(he,{live:t,samples:r.map(e=>({observedAt:e.observedAt,windowType:e.windowType,windowMs:e.windowMs,resetsAt:e.resetsAt,usedRatio:e.usedRatio})),since:n,now:Date.now(),truncated:Oe.data?.truncated===!0&&n!==null&&r.length>0&&(r[0]?.observedAt??0)>n,ratePerHourRatio:e.ratePerHourRatio,exhaustsAt:e.exhaustsAt,survives:e.survives,stale:e.stale,rolledOver:e.rolledOver,spent:e.usedRatio===null?`no ceiling reported`:`${_(e.usedRatio,0)} used`,rateText:e.ratePerHourRatio===null?`unknown`:`${_(e.ratePerHourRatio,1)}/h`},e.windowType)})})})}):null]},e))})]})})]},e))})}),N(k,{legend:`Recent requests`,meta:`${Q.length} shown`,actions:P(A,{children:[N(pe,{value:b,placeholder:`Filter by model or error`,"aria-label":`Filter requests`,style:{width:200},onChange:e=>S(e.target.value)}),P(x,{value:m,"aria-label":`Show which requests`,style:{width:`auto`},onChange:e=>v(e.target.value),children:[N(`option`,{value:`all`,children:`All requests`}),N(`option`,{value:`failed`,children:`Failed only`})]}),N(x,{value:D,"aria-label":`How many requests to fetch`,style:{width:`auto`},onChange:e=>O(Number(e.target.value)),children:z.map(e=>P(`option`,{value:e,children:[`last `,e]},e))})]}),query:{isLoading:J.isLoading,isError:J.isError,error:J.error,refetch:()=>void J.refetch()},failure:`Could not read your requests`,empty:{legend:`No requests`,message:(J.data??[]).length===0?`Nothing served through this key yet.`:`No request in this window matches the filter. Clear it to see everything.`},isEmpty:Q.length===0,footer:P(u,{children:[g(je),` of the last `,g((J.data??[]).length),` failed.`]}),children:N(o,{children:N(ve,{rows:Q,now:Ae,onOpen:I})})}),N(oe,{open:F!==null,onOpenChange:e=>{e||I(null)},title:`Request detail`,width:`640px`,footer:N(ae,{type:`button`,onClick:()=>I(null),children:`Close`}),children:F===null?null:N(be,{log:F})})]})}var q=()=>N(O,{children:N(D,{children:N(R,{children:N(K,{})})})});export{q as component};
|
|
@@ -1,178 +0,0 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/_app-a3VUev6k.js","assets/Match-CvkEmOIG.js","assets/queries-GAue98pY.js","assets/matchContext-BOenO3J2.js","assets/Rack-DdhpgQWD.js","assets/States-2kaQxx-s.js","assets/stream-Bu-m1Z1Y.js","assets/client-CQGHWD56.js","assets/shared-DQOWYTp3.js","assets/chevron-right-mGs1is3r.js","assets/Field-B2rnk3JM.js","assets/Meter-stpt3vQu.js","assets/Panel-BeQOQoap.js","assets/Table-CVDZ69Zx.js","assets/WindowChart-Bvbkz9rt.js","assets/RequestTable-I1TrD689.js","assets/TokenBreakdown-En1JT4tT.js","assets/Chip-BltJSw8A.js","assets/SummaryDeck-BisdRswW.js","assets/Readout-CZfn5JDy.js","assets/login-bJoYdBqx.js","assets/reasons-Du1OBWAM.js","assets/_app.index-NBeanmyf.js","assets/_app.accounts-CYPB-7Xt.js","assets/CopyValue-DNNJGDI5.js","assets/plus-Bqi8Y2Xd.js","assets/trash-2-BDA1rQVQ.js","assets/Toggle-BvOELhpy.js","assets/catalog-BBKm8Ih8.js","assets/_app.console-C4x5F3d0.js","assets/_app.database-B-9oB52r.js","assets/_app.keys-DK9jdOqT.js","assets/_app.logs-Dr6fApsE.js","assets/_app.models-CGBQ2QaS.js","assets/_app.settings-zTFRyxhZ.js","assets/_app.usage-BCCimHY0.js","assets/_app.plugins._pluginId-DXzhupNH.js"])))=>i.map(i=>d[i]);
|
|
2
|
-
import{$t as e,At as t,Bt as n,Dt as r,Ft as i,Gt as a,Ht as o,It as s,Jt as c,Kt as l,Lt as u,Mt as d,Nt as f,Ot as p,Pt as m,Qt as h,Rt as g,St as _,Tt as v,Ut as y,Vt as b,Wt as x,Xt as S,Yt as C,Zt as w,bt as T,ct as E,en as D,i as ee,it as te,jt as ne,kt as re,mt as ie,nn as ae,nt as oe,qt as se,tn as ce,vt as le,wt as ue,xt as de,zt as fe}from"./queries-GAue98pY.js";import{a as pe,i as me,n as he,o as ge,r as _e,t as ve}from"./Match-CvkEmOIG.js";import{n as ye,r as be,t as xe}from"./matchContext-BOenO3J2.js";import{MutationCache as Se,QueryCache as Ce,QueryClient as we,QueryClientProvider as Te}from"@tanstack/react-query";import*as O from"react";import Ee,{StrictMode as De,createContext as Oe,use as ke,useCallback as Ae,useEffect as je,useState as Me}from"react";import{Fragment as Ne,jsx as k,jsxs as Pe}from"react/jsx-runtime";import{createRoot as Fe}from"react-dom/client";import Ie,{ThemeProvider as Le,createGlobalStyle as Re}from"styled-components";(function(){let e=document.createElement(`link`).relList;if(e&&e.supports&&e.supports(`modulepreload`))return;for(let e of document.querySelectorAll(`link[rel="modulepreload"]`))n(e);new MutationObserver(e=>{for(let t of e)if(t.type===`childList`)for(let e of t.addedNodes)e.tagName===`LINK`&&e.rel===`modulepreload`&&n(e)}).observe(document,{childList:!0,subtree:!0});function t(e){let t={};return e.integrity&&(t.integrity=e.integrity),e.referrerPolicy&&(t.referrerPolicy=e.referrerPolicy),t.credentials=e.crossOrigin===`use-credentials`?`include`:e.crossOrigin===`anonymous`?`omit`:`same-origin`,t}function n(e){if(e.ep)return;e.ep=!0;let n=t(e);fetch(e.href,n)}})();function ze(){try{return sessionStorage}catch{return}}var Be=`tsr-scroll-restoration-v1_3`,Ve=ze();function He(){try{return JSON.parse(Ve?.getItem(`tsr-scroll-restoration-v1_3`)||`{}`)}catch{return{}}}function Ue(){try{Ve?.setItem(Be,JSON.stringify(A))}catch{}}var A=He(),We=`data-scroll-restoration-id`,Ge=e=>e.state.__TSR_key||e.href;function Ke(e){let t=e.getAttribute(We);if(t)return`[${We}="${t}"]`;let n=``,r=e,i;for(;i=r.parentNode;){let e=1,t=r;for(;t=t.previousElementSibling;)e++;let a=`${r.localName}:nth-child(${e})`;n=n?`${a} > ${n}`:a,r=i}return n}var qe=!1,Je=`window`;function Ye(e){try{return typeof e==`function`?e():document.querySelector(e)}catch{}}function Xe(e){let t=new Set;for(let n of e){if(n===Je)continue;let e=Ye(n);e&&t.add(e)}return t}function Ze(e,t){let n=t??e.options.scrollRestoration,r=e._scroll;n&&(r.restoring=!0);let i=e.options.getScrollRestorationKey||Ge,a=new Set,o=e=>{let t=A[e]||={};for(let e of a)e===document?t[Je]={scrollX,scrollY}:e.isConnected&&(t[Ke(e)]={scrollX:e.scrollLeft,scrollY:e.scrollTop})};n&&!r.restoration&&(r.restoration=!0,qe=!1,history.scrollRestoration=`manual`,document.addEventListener(`scroll`,e=>{qe||a.add(e.target)},!0),e.subscribe(`onBeforeLoad`,e=>{e.fromLocation&&o(i(e.fromLocation)),a.clear()}),addEventListener(`pagehide`,()=>{o(i(e.stores.resolvedLocation.get()??e.stores.location.get())),Ue()})),!r.reset&&(r.reset=!0,e.subscribe(`onRendered`,t=>{let n=e.options.scrollRestorationBehavior,o=e.options.scrollToTopSelectors,s=r.next,c=r.hash,l;if(a.clear(),r.next=!0,r.hash=!1,typeof e.options.scrollRestoration==`function`&&!e.options.scrollRestoration({location:e.latestLocation}))return;let u=i(t.toLocation),d=t.fromLocation&&i(t.fromLocation);if(r.restoring&&d&&d!==u){let e=A[d];if(e){let t=A[u];for(let n in e){if(n===Je){if(s)continue}else{let e=Ye(n);if(!e||s&&o&&(l??=Xe(o),l.has(e)))continue}t||=A[u]={},t[n]??=e[n]}}}qe=!0;try{let e=t.toLocation.hash,i=t.toLocation.state.__hashScrollIntoViewOptions??!0,a=!1;if(s){!e&&o&&(l??=Xe(o));let t=e&&i&&c,s=r.restoring?A[u]:void 0;if(s)for(let e in s){let{scrollX:r,scrollY:i}=s[e];if(e===Je){if(t)continue;scrollTo({top:i,left:r,behavior:n}),a=!0}else{let t=Ye(e);t&&(t.scrollLeft=r,t.scrollTop=i,l?.delete(t))}}if(!e){let e={top:0,left:0,behavior:n};if(a||scrollTo(e),l)for(let t of l)t.scrollTo(e)}}!a&&e&&i&&document.getElementById(e)?.scrollIntoView(i)}finally{qe=!1}}))}function Qe(e,t=String){let n=new URLSearchParams;for(let r in e){let i=e[r];i!==void 0&&n.set(r,t(i))}return n.toString()}function $e(e){return e?e===`false`?!1:e===`true`?!0:e*0==0&&+e+``===e?+e:e:``}function et(e){let t=new URLSearchParams(e),n=Object.create(null);for(let[e,r]of t.entries()){let t=n[e];t==null?n[e]=$e(r):Array.isArray(t)?t.push($e(r)):n[e]=[t,$e(r)]}return n}var tt=/^(?:\s|["[{\d-]|fa|nu|tr)/,nt=it(JSON.parse),rt=at(JSON.stringify,JSON.parse);function it(e){return t=>{t[0]===`?`&&(t=t.substring(1));let n=et(t);for(let t in n){let r=n[t];if(typeof r==`string`)try{n[t]=e(r)}catch{}}return n}}function at(e,t){let n=t===JSON.parse;function r(r){if(r&&typeof r==`object`)try{return e(r)}catch{}else if(t&&typeof r==`string`){if(n&&!tt.test(r))return r;try{return t(r),e(r)}catch{}}return r}return e=>{let t=Qe(e,r);return t?`?${t}`:``}}function j(e){if(e.statusCode=e.statusCode||e.code||307,!e._builtLocation&&!e.reloadDocument&&typeof e.href==`string`)try{new URL(e.href),e.reloadDocument=!0}catch{}let t=new Headers(e.headers);e.href&&t.get(`Location`)===null&&t.set(`Location`,e.href);let n=new Response(null,{status:e.statusCode,headers:t});if(n.options=e,e.throw)throw n;return n}function ot(e){return e instanceof Response&&!!e.options}function st(e){return{input:({url:t})=>{for(let n of e)t=lt(n,t);return t},output:({url:t})=>{for(let n=e.length-1;n>=0;n--)t=ut(e[n],t);return t}}}function ct(e){let n=d(e.basepath),r=`/${n}`,i=e.caseSensitive?r:r.toLowerCase(),a=`${i}/`;return{input:({url:t})=>{let n=e.caseSensitive?t.pathname:t.pathname.toLowerCase();return n===i?t.pathname=`/`:n.startsWith(a)&&(t.pathname=t.pathname.slice(r.length)),t},output:({url:e})=>(e.pathname=t([`/`,n,e.pathname]),e)}}function lt(e,t){let n=e?.input?.({url:t});if(n){if(typeof n==`string`)return new URL(n);if(n instanceof URL)return n}return t}function ut(e,t){let n=e?.output?.({url:t});if(n){if(typeof n==`string`)return new URL(n);if(n instanceof URL)return n}return t}function dt(e,t){let{createMutableStore:n,createReadonlyStore:r,batch:i}=t,a=new Map,o=n(`idle`),s=n(e),c=n(void 0),l=n([]),u=r(()=>l.get().map(e=>a.get(e).get())),d=r(()=>({status:o.get(),isLoading:o.get()===`pending`,matches:u.get(),location:s.get(),resolvedLocation:c.get()}));function f(e){let t=a.get(e);return t||(t=n(void 0),a.set(e,t)),t}let p={status:o,location:s,resolvedLocation:c,ids:l,matches:u,byRoute:a,__store:d,getMatchStore:f,setMatches:m};function m(e){let t=l.get(),n=e.map(e=>e.routeId);i(()=>{x(t,n)||l.set(n);for(let e of t)n.includes(e)||a.get(e).set(()=>void 0);for(let t of e){let e=f(t.routeId);e.get()!==t&&e.set(t)}})}return p}var M=`__TSR_index`,ft=`popstate`,pt=`beforeunload`;function mt(e){let t=e.getLocation(),n=new Set,r=r=>{t=e.getLocation(),n.forEach(e=>e({location:t,action:r}))},i=n=>{e.notifyOnIndexChange??!0?r(n):t=e.getLocation()},a=async({task:n,navigateOpts:r,...i})=>{if(r?.ignoreBlocker??!1){n();return}let a=e.getBlockers?.()??[],o=i.type===`PUSH`||i.type===`REPLACE`;if(typeof document<`u`&&a.length&&o)for(let n of a){let r=vt(i.path,i.state);if(await n.blockerFn({currentLocation:t,nextLocation:r,action:i.type})){e.onBlocked?.();return}}n()};return{get location(){return t},get length(){return e.getLength()},subscribers:n,subscribe:e=>(n.add(e),()=>{n.delete(e)}),push:(n,i,o)=>{let s=t.state[M];i=ht(s+1,i),a({task:()=>{e.pushState(n,i),r({type:`PUSH`})},navigateOpts:o,type:`PUSH`,path:n,state:i})},replace:(n,i,o)=>{let s=t.state[M];i=ht(s,i),a({task:()=>{e.replaceState(n,i),r({type:`REPLACE`})},navigateOpts:o,type:`REPLACE`,path:n,state:i})},go:(t,n)=>{a({task:()=>{e.go(t),i({type:`GO`,index:t})},navigateOpts:n,type:`GO`})},back:t=>{a({task:()=>{e.back(t?.ignoreBlocker??!1),i({type:`BACK`})},navigateOpts:t,type:`BACK`})},forward:t=>{a({task:()=>{e.forward(t?.ignoreBlocker??!1),i({type:`FORWARD`})},navigateOpts:t,type:`FORWARD`})},canGoBack:()=>t.state[M]!==0,createHref:t=>e.createHref(t),block:t=>{if(!e.setBlockers)return()=>{};let n=e.getBlockers?.()??[];return e.setBlockers([...n,t]),()=>{let n=e.getBlockers?.()??[];e.setBlockers?.(n.filter(e=>e!==t))}},flush:()=>e.flush?.(),destroy:()=>e.destroy?.(),notify:r}}function ht(e,t){t||={};let n=yt();return{...t,key:n,__TSR_key:n,[M]:e}}function gt(e){let t=e?.window??(typeof document<`u`?window:void 0),n=t.history.pushState,r=t.history.replaceState,i=[],a=()=>i,o=e=>i=e,s=e?.createHref??(e=>e),c=e?.parseLocation??(()=>vt(`${t.location.pathname}${t.location.search}${t.location.hash}`,t.history.state));if(!t.history.state?.__TSR_key&&!t.history.state?.key){let e=yt();t.history.replaceState({[M]:0,key:e,__TSR_key:e},``)}let l=c(),u,d=!1,f=!1,p=!1,m=!1,h=()=>l,g,_=()=>{g&&(S._ignoreSubscribers=!0,(g[2]?t.history.pushState:t.history.replaceState)(g[1],``,g[0]),S._ignoreSubscribers=!1,g=void 0,u=void 0)},v=(e,t,n)=>{let r=s(t),i=!!g;i||(u=l),l=vt(t,n),g=[r,n,g?.[2]||e],i||queueMicrotask(()=>_())},y=e=>{l=c(),S.notify({type:e})},b=async()=>{if(f){f=!1;return}let e=c(),n=e.state[M]-l.state[M],r=n===1,i=n===-1,o=!r&&!i||d;d=!1;let s=o?`GO`:i?`BACK`:`FORWARD`,u=o?{type:`GO`,index:n}:{type:i?`BACK`:`FORWARD`};if(p)p=!1;else{let n=a();if(typeof document<`u`&&n.length){for(let r of n)if(await r.blockerFn({currentLocation:l,nextLocation:e,action:s})){f=!0,t.history.go(1),S.notify(u);return}}}l=c(),S.notify(u)},x=e=>{if(m){m=!1;return}let t=!1,n=a();if(typeof document<`u`&&n.length)for(let e of n){let n=e.enableBeforeUnload??!0;if(n===!0){t=!0;break}if(typeof n==`function`&&n()===!0){t=!0;break}}if(t)return e.preventDefault(),e.returnValue=``},S=mt({getLocation:h,getLength:()=>t.history.length,pushState:(e,t)=>v(!0,e,t),replaceState:(e,t)=>v(!1,e,t),back:e=>(e&&(p=!0),m=!0,t.history.back()),forward:e=>{e&&(p=!0),m=!0,t.history.forward()},go:e=>{d=!0,t.history.go(e)},createHref:e=>s(e),flush:_,destroy:()=>{t.history.pushState=n,t.history.replaceState=r,t.removeEventListener(pt,x,{capture:!0}),t.removeEventListener(ft,b)},onBlocked:()=>{u&&l!==u&&(l=u)},getBlockers:a,setBlockers:o,notifyOnIndexChange:!1});return t.addEventListener(pt,x,{capture:!0}),t.addEventListener(ft,b),t.history.pushState=function(...e){let r=n.apply(t.history,e);return S._ignoreSubscribers||y(`PUSH`),r},t.history.replaceState=function(...e){let n=r.apply(t.history,e);return S._ignoreSubscribers||y(`REPLACE`),n},S}function _t(e){let t=e.replace(/[\x00-\x1f\x7f]/g,``);return t.startsWith(`//`)&&(t=`/`+t.replace(/^\/+/,``)),t}function vt(e,t){let n=_t(e),r=n.indexOf(`#`),i=n.indexOf(`?`),a=yt();return{href:n,pathname:n.substring(0,r>0?i>0?Math.min(r,i):r:i>0?i:n.length),hash:r>-1?n.substring(r):``,search:i>-1?n.slice(i,r===-1?void 0:r):``,state:t||{[M]:0,key:a,__TSR_key:a}}}function yt(){return(Math.random()+1).toString(36).substring(7)}function bt(e){return e.options.loader||e.options.beforeLoad||e.lazyFn||e.options.component?.preload||e.options.pendingComponent?.preload}function xt(e,t){return{fromLocation:t,toLocation:e,pathChanged:t?.pathname!==e.pathname,hrefChanged:t?.href!==e.href,hashChanged:t?.hash!==e.hash}}function St({key:e,__TSR_key:t,__TSR_index:n,__hashScrollIntoViewOptions:r,...i}){return i}function Ct(e,t,n,r){for(let i of t){if(r?.()===!1)return;n.some(e=>e.routeId===i.routeId)||e.routesById[i.routeId].options.onLeave?.(i)}for(let i of n){if(r?.()===!1)return;e.routesById[i.routeId].options[t.some(e=>e.routeId===i.routeId)?`onStay`:`onEnter`]?.(i)}}var wt=class{constructor(t,i){this.tempLocationKey=`${Math.round(Math.random()*1e7)}`,this._scroll={next:!0},this.subscribers=new Set,this._cache=new Map,this._committed=[],this.routeBranchCache=new WeakMap,this.lightweightCache=new WeakMap,this.startTransition=async e=>(e(),!1),this.update=e=>{let t=this.options,n=this.basepath??t?.basepath??`/`,r=this.basepath===void 0,i=t?.rewrite;if(this.options={...t,...e},this.isServer=this.options.isServer??!1??typeof document>`u`,this.protocolAllowlist=new Set(this.options.protocolAllowlist),this.options.pathParamsAllowedCharacters&&(this.pathParamsDecoder=p(this.options.pathParamsAllowedCharacters)),(!this.history||this.options.history&&this.options.history!==this.history)&&(this.history=this.options.history?this.options.history:gt()),this.origin=this.options.origin,this.origin||=window?.origin&&window.origin!==`null`?window.origin:`http://localhost`,this.history&&this.updateLatestLocation(),this.options.routeTree!==this.routeTree){this.routeTree=this.options.routeTree;let e;this.resolvePathCache=b(1e3),e=this.buildRouteTree(),this.setRoutes(e)}if(!this.stores&&this.latestLocation){let e=this.getStoreConfig(this);this.batch=e.batch,this.stores=dt(this.latestLocation,e),Ze(this)}let a=this.options.basepath??`/`,o=this.options.rewrite;if(r||n!==a||i!==o){this.basepath=a;let e=[],t=d(a);t&&t!==`/`&&e.push(ct({basepath:a})),o&&e.push(o),this.rewrite=e.length===0?void 0:e.length===1?e[0]:st(e),this.history&&this.updateLatestLocation(),this.stores&&this.stores.location.set(this.latestLocation)}},this.updateLatestLocation=()=>{this.latestLocation=this.parseLocation(this.history.location,this.latestLocation)},this.buildRouteTree=()=>{let e=n(this.routeTree,this.options.caseSensitive,(e,t)=>{e.init({originalIndex:t})});return this.options.routeMasks&&fe(this.options.routeMasks,e.processedTree),e},this.subscribe=(e,t)=>{let n={eventType:e,fn:t};return this.subscribers.add(n),()=>{this.subscribers.delete(n)}},this.emit=e=>{for(let t of this.subscribers)if(t.eventType===e.type)try{t.fn(e)}catch(e){console.error(e)}},this.parseLocation=(t,n)=>{let r=({pathname:t,search:r,hash:i,href:o,state:s})=>{if(!this.rewrite&&!/[ \x00-\x1f\x7f\u0080-\uffff]/.test(t)){let o=this.options.parseSearch(r),c=this.options.stringifySearch(o);return{href:t+c+i,publicHref:t+c+i,pathname:a(t).path,external:!1,searchStr:c,search:e(n?.search,o),hash:a(i.slice(1)).path,state:D(n?.state,s)}}let c=new URL(o,this.origin),l=lt(this.rewrite,c),u=this.options.parseSearch(l.search),d=this.options.stringifySearch(u);return l.search=d,{href:l.href.replace(l.origin,``),publicHref:o,pathname:a(l.pathname).path,external:!!this.rewrite&&l.origin!==this.origin,searchStr:d,search:e(n?.search,u),hash:a(l.hash.slice(1)).path,state:D(n?.state,s)}},i=r(t),{__tempLocation:o,__tempKey:s}=i.state;if(o&&(!s||s===this.tempLocationKey)){let e=r(o);return e.state.key=i.state.key,e.state.__TSR_key=i.state.__TSR_key,delete e.state.__tempLocation,{...e,maskedLocation:i}}return i},this.resolvePathWithBase=(e,t)=>ne({base:e,to:t.includes(`//`)?r(t):t,trailingSlash:this.options.trailingSlash,cache:this.resolvePathCache}),this.matchRoutes=(e,t,n)=>typeof e==`string`?this.matchRoutesInternal({pathname:e,search:t},n):this.matchRoutesInternal(e,t),this.getMatchedRoutes=e=>{let t=Object.create(null),n=u(m(e),this.processedTree,!0);return n&&Object.assign(t,n.rawParams),[n?.branch||[this.routesById.__root__],t,n?.route]},this.buildLocation=t=>{let n=(n={})=>{let r=n._fromLocation||this._pendingLocation||this.latestLocation,i=this.matchRoutesLightweight(r);n.from;let o=n.unsafeRelative===`path`?r.pathname:n.from??i[1],s=n.to?`${n.to}`:void 0,l=i[2],u=Object.assign(Object.create(null),i[3]),d=s?.charCodeAt(0)===47?`/`:this.resolvePathWithBase(o,`.`),f=s?this.resolvePathWithBase(d,s):d,p=At(n.params,u),h=this.routesByPath[m(f)],g;if(h)g=this.getRouteBranch(h);else if(f.includes(`$`))g=[];else{let[e,t,n]=this.getMatchedRoutes(f);g=e,this.options.notFoundRoute&&(!n||n.path!==`/`&&t[`**`])&&(g=[...g,this.options.notFoundRoute])}if(g.length&&C(p))for(let e of g){let t=e.options.params?.stringify??e.options.stringifyParams;if(t)try{Object.assign(p,t(p))}catch{}}let _=t.leaveParams?f:a(re({path:f,params:p,decoder:this.pathParamsDecoder,server:this.isServer}).interpolatedPath).path,v=l;if(t._includeValidateSearch&&this.options.search?.strict){let e={};g.forEach(t=>{if(t.options.validateSearch)try{Object.assign(e,Dt(t.options.validateSearch,{...e,...v}))}catch{}}),v=e}v=Ot(v,n,g,t._includeValidateSearch),v=e(l,v);let y=this.options.stringifySearch(v),b=n.hash===!0?r.hash:n.hash?c(n.hash,r.hash):void 0,x=b?`#${b}`:``,S=n.state===!0?r.state:n.state?c(n.state,r.state):{};S=D(r.state,S);let w=`${_}${y}${x}`,T,E,ee=!1;if(this.rewrite){let e=new URL(w,this.origin),t=ut(this.rewrite,e);T=e.href.replace(e.origin,``),t.origin===this.origin?E=t.pathname+t.search+t.hash:(E=t.href,ee=!0)}else T=se(w),E=T;return{publicHref:E,href:T,pathname:_,search:v,searchStr:y,state:S,hash:b??``,external:ee,unmaskOnReload:n.unmaskOnReload}},r=(e={},r)=>{let i=n(e),a=r?n(r):void 0;if(!a){let e=Object.create(null);if(this.options.routeMasks){let o=s(i.pathname,this.processedTree);if(o){Object.assign(e,o.rawParams);let{from:i,params:s,...c}=o.route,l=At(s,e);r={from:t.from,...c,params:l},a=n(r)}}}return a&&(i.maskedLocation=a),i};return t.mask?r(t,{from:t.from,...t.mask}):r(t)},this.commitLocation=async({viewTransition:e,ignoreBlocker:t,...n})=>{let r,i=m(this.latestLocation.href)===m(n.href)&&l(St(n.state),St(this.latestLocation.state)),a=this._commitPromise,o,s=new Promise(e=>{o=e});if(s.resolve=()=>{o(),a?.resolve()},this._commitPromise=s,i)this.load();else{let{maskedLocation:i,hashScrollIntoView:a,...o}=n;i&&(o={...i,state:{...i.state,__tempKey:void 0,__tempLocation:{...o,search:o.searchStr,state:{...o.state,__tempKey:void 0,__tempLocation:void 0,__TSR_key:void 0,key:void 0}}}},(o.unmaskOnReload??this.options.unmaskOnReload??!1)&&(o.state.__tempKey=this.tempLocationKey)),o.state.__hashScrollIntoViewOptions=a??this.options.defaultHashScrollIntoView??!0,this.shouldViewTransition=e,r=n.replace?`REPLACE`:`PUSH`,this.history[r===`REPLACE`?`replace`:`push`](o.publicHref,o.state,{ignoreBlocker:t}),this.history.subscribers.size||this.load({action:{type:r}})}return this._scroll.next=n.resetScroll??!0,this._commitPromise},this.buildAndCommitLocation=({replace:e,resetScroll:t,hashScrollIntoView:n,viewTransition:r,ignoreBlocker:i,_redirects:a,href:o,...s}={})=>{if(o){let t=this.history.location.state.__TSR_index,n=vt(o,{__TSR_index:e?t:t+1}),r=new URL(n.pathname,this.origin);s.to=lt(this.rewrite,r).pathname,s.search=this.options.parseSearch(n.search),s.hash=n.hash.slice(1)}let c=this.buildLocation({...s,_includeValidateSearch:!0});a&&(c._redirects=a),this._pendingLocation=c;let l=this.commitLocation({...c,viewTransition:r,replace:e,resetScroll:t,hashScrollIntoView:n,ignoreBlocker:i});return queueMicrotask(()=>{this._pendingLocation===c&&(this._pendingLocation=void 0)}),l},this.navigate=async({to:e,reloadDocument:t,href:n,publicHref:r,...i})=>{let a=!1;if(n)try{new URL(`${n}`),a=!0}catch{}if(a&&!t&&(t=!0),t){if(e!==void 0||!n){let t=this.buildLocation({to:e,...i});n??=t.publicHref,r??=t.publicHref}let t=!a&&r?r:n;if(S(t,this.protocolAllowlist))return;if(!i.ignoreBlocker){let e=this.history.getBlockers?.()??[];for(let t of e)if(t?.blockerFn&&await t.blockerFn({currentLocation:this.latestLocation,nextLocation:this.latestLocation,action:`PUSH`}))return}i.replace?window.location.replace(t):window.location.href=t;return}return this.buildAndCommitLocation({...i,href:n,to:e,_isNavigate:!0})},this.load=async e=>{this.updateLatestLocation(),e?.action&&(this._scroll.hash=e.action.type===`PUSH`||e.action.type===`REPLACE`),await ln(this,e)},this.startViewTransition=e=>{let t=this.shouldViewTransition??this.options.defaultViewTransition;if(this.shouldViewTransition=void 0,t&&typeof document.startViewTransition==`function`){let n;if(typeof t==`object`&&window.CSS?.supports?.(`selector(:active-view-transition-type(a))`)){let r=this.latestLocation,i=this.stores.resolvedLocation.get(),a=typeof t.types==`function`?t.types(xt(r,i)):t.types;if(a===!1)return e();n={update:e,types:a}}else n=e;return document.startViewTransition(n).updateCallbackDone}return e()},this.invalidate=e=>{let t=this._committed,n=e?.filter,r=this._preloads,i=new Set([...t,...this._cache.values(),...[...r?.values()??[]].flat(),...this._tx?.[3]??[]].filter(e=>!n||n(e)).map(e=>e.id)),a=[];for(let[e,t]of r??[])t.some(e=>i.has(e.id))&&(r.delete(e),a.push(e));let o=t=>{if(i.has(t.id)){let n=this.routesById[t.routeId],r={...t,invalid:!0,...(e?.forcePending||t.status===`error`||t.status===`notFound`)&&bt(n)?{status:`pending`,error:void 0}:void 0};return t._flight=void 0,r}return t};this._committed=t.map(o);for(let[t,n]of this._cache)i.has(t)&&(n.invalid=!0,e?.forcePending&&(n.status=`pending`));for(let e of i)this._flights?.delete(e);for(let e of a)e.abort();return this.shouldViewTransition=!1,this.load({sync:e?.sync})},this.resolveRedirect=e=>{let t=e.headers.get(`Location`);if(!e.options.href||e.options._builtLocation){let t=(e.options._builtLocation??this.buildLocation(e.options)).publicHref||`/`;e.options.href=t,e.headers.set(`Location`,t)}else if(t)try{let n=new URL(t);if(this.origin&&n.origin===this.origin){let t=n.pathname+n.search+n.hash;e.options.href=t,e.headers.set(`Location`,t)}}catch{}if(e.options.href&&!e.options._builtLocation&&S(e.options.href,this.protocolAllowlist))throw Error(`Redirect blocked: unsafe protocol`);return e.headers.get(`Location`)||e.headers.set(`Location`,e.options.href),e},this.clearCache=e=>{let t=this._cache,n=this._preloads,r=e?.filter,i=[],a=[];for(let[e,n]of t)(!r||r(n))&&(a.push(e),i.push(n));let o=[];for(let[e,t]of n??[])(!r||t.some(r))&&(o.push(e),i.push(...t));for(let e of a)t.delete(e);for(let e of o)n.delete(e);for(let e of i){let t=e._flight;e._flight=void 0,t&&!--t[2]&&(this._flights?.get(e.id)===t&&this._flights.delete(e.id),o.push(t[1]))}for(let e of o)e.abort()},this.loadRouteChunk=N,this.preloadRoute=e=>un(this,e),this.matchRoute=(e,t)=>{let n={...e,to:e.to?this.resolvePathWithBase(e.from||``,e.to):void 0,params:e.params||{},leaveParams:!0},r=this.buildLocation(n),i=this.stores.status.get()===`pending`;if(t?.pending&&!i)return!1;let a=t?.pending??!i?this.latestLocation:this.stores.resolvedLocation.get()||this.stores.location.get(),o=g(r.pathname,t?.caseSensitive??!1,t?.fuzzy??!1,a.pathname,this.processedTree);return!o||e.params&&!l(o.rawParams,e.params,{partial:!0})?!1:t?.includeSearch??!0?l(a.search,r.search,{partial:!0})?o.rawParams:!1:o.rawParams},this.getStoreConfig=i,this.update({defaultPreloadDelay:50,defaultPendingMs:1e3,defaultPendingMinMs:500,context:void 0,...t,caseSensitive:t.caseSensitive??!1,notFoundMode:t.notFoundMode??`fuzzy`,stringifySearch:t.stringifySearch??rt,parseSearch:t.parseSearch??nt,protocolAllowlist:t.protocolAllowlist??y}),self.__TSR_ROUTER__=this}isShell(){return!!this.options.isShell}get state(){return this.stores.__store.get()}setRoutes({routesById:e,routesByPath:t,processedTree:n}){this.routesById=e,this.routesByPath=t,this.processedTree=n;let r=this.options.notFoundRoute;r&&(r.init({originalIndex:99999999999}),this.routesById[r.id]=r)}getRouteBranch(e){let t=this.routeBranchCache.get(e);return t||(t=i(e),this.routeBranchCache.set(e,t)),t}matchRoutesInternal(t,n){let[r,i,a]=this.getMatchedRoutes(t.pathname),o=r,s=!1;(a?a.path!==`/`&&i[`**`]:m(t.pathname))&&(this.options.notFoundRoute?o=[...o,this.options.notFoundRoute]:s=!0);let c=s?kt(this.options.notFoundMode,o):void 0,l=Array(o.length),u=this._committed,d=(e,t)=>{let n=u[t];return n?.routeId===e.id?n:e===this.options.notFoundRoute?u.find(t=>t.routeId===e.id):void 0},f;for(let r=0;r<o.length;r++){let a=o[r],s=l[r-1],u,p,m;{let e=s?.search??t.search,r=s?._strictSearch??void 0;try{let t=Dt(a.options.validateSearch,{...e})??void 0;u={...e,...t},p={...r,...t}}catch(t){let r=t;if(t instanceof Tt||(r=new Tt(t.message,{cause:t})),n?.throwOnError)throw r;u=e,p={},m=r}}let h=``,g=``;try{h=a.options.loaderDeps?.({search:u})??``,g=h&&JSON.stringify(h)||``}catch(e){if(n?.throwOnError)throw e;m??=e}let{interpolatedPath:_,usedParams:v}=re({path:a.fullPath,params:i,decoder:this.pathParamsDecoder,server:this.isServer}),y=a.id+_+g,b=d(a,r),x=this._cache.get(y)??(b?.id===y?b:void 0);f=x?._strictParams??Object.assign(v,f);let S;if(!x)try{jt(a,f)}catch(e){if(S=ge(e)||ot(e)?e:new Et(e.message,{cause:e}),n?.throwOnError)throw S}let C=b?`stay`:`enter`,w;if(x)w={...x,cause:C,search:e(b?b.search:x.search,u),_strictSearch:p,searchError:m};else{let t=bt(a)?`pending`:`success`;w={id:y,ssr:a.options.ssr,index:r,routeId:a.id,params:b?.params??f,_strictParams:f,pathname:_,updatedAt:Date.now(),search:b?e(b.search,u):u,_strictSearch:p,searchError:m,status:t,isFetching:!1,error:void 0,paramsError:S,context:{},abortController:n?._controller??new AbortController,cause:C,loaderDeps:b?D(b.loaderDeps,h):h,invalid:!1,preload:!1,staticData:a.options.staticData||{},fullPath:a.fullPath}}let T=c===a.id;w._notFound&&!T&&(w.error=void 0),w._notFound=T,l[r]=w}for(let t=0;t<l.length;t++){let r=l[t];r.params=r.cause===`stay`?e(r.params,f):f,n?._controller&&(r.context={})}return l}matchRoutesLightweight(e){let t=h(this.stores.ids.get()),n=t?this.stores.byRoute.get(t).get():void 0,r=n?.id,i=this.lightweightCache.get(e);if(i&&i[0]===r)return i[1];let[a,o]=this.getMatchedRoutes(e.pathname),s=h(a),c={...e.search};for(let e of a)try{Object.assign(c,Dt(e.options.validateSearch,c))}catch{}let l=n&&n.routeId===s.id&&n.pathname===e.pathname,u;if(l)u=n.params;else{let e=Object.assign(Object.create(null),o);for(let t of a)try{jt(t,e)}catch{}u=e}let d=[a,s.fullPath,c,u];return this.lightweightCache.set(e,[r,d]),d}},Tt=class extends Error{},Et=class extends Error{};function Dt(e,t){if(e==null)return{};if(`~standard`in e){let n=e[`~standard`].validate(t);if(n instanceof Promise)throw new Tt(`Async validation not supported`);if(n.issues)throw new Tt(JSON.stringify(n.issues,void 0,2),{cause:n});return n.value}return`parse`in e?e.parse(t):typeof e==`function`?e(t):{}}function Ot(e,t,n,r){let i=[];for(let e of n){let t=e.options;`search`in t?t.search?.middlewares&&i.push(...t.search.middlewares):(t.preSearchFilters||t.postSearchFilters)&&i.push(({search:e,next:n})=>{let r=n(t.preSearchFilters?t.preSearchFilters.reduce((e,t)=>t(e),e):e);return t.postSearchFilters?t.postSearchFilters.reduce((e,t)=>t(e),r):r});let n=t.validateSearch;n&&i.push(({search:e,next:t,meta:i})=>{let a=t(e);if(r)try{let e=Dt(n,a);if(i&&e)for(let t in e)t in a||(i.defaulted||=new Map).set(t,e[t]);return{...a,...e}}catch{}return a})}let a=(e,n,r)=>{if(e>=i.length){if(!t.search)return{};if(t.search===!0)return n;let e=c(t.search,n);return r&&(r.explicit=e),e}return i[e]({search:n,next:(t,n)=>{if(n){let n=r||{};return{search:a(e+1,t,n),meta:n}}return a(e+1,t,r)},meta:r})};return a(0,e)}function kt(e,t){if(e!==`root`){let e;for(let n=t.length-1;n>=0;n--){let r=t[n];if(r.options.notFoundComponent)return r.id;e||=r.children&&r.id}if(e)return e}return be}function At(e,t){return e===!1||e===null?Object.create(null):(e??!0)===!0?t:Object.assign(t,c(e,t))}function jt(e,t){let n=e.options.params?.parse??e.options.parseParams;n&&Object.assign(t,n(t))}function Mt(e,t){return e.options[t]?.preload?.()}function Nt(e,t){let n=Mt(e,`component`),r=Mt(e,`pendingComponent`),i=t&&r?r.then(t):r;return t&&!r&&t(),n&&i?Promise.all([n,i]).then(()=>{}):n??i}function N(e,t,n){let r=()=>t===!1?void 0:t?Mt(e,t):Nt(e,n),i=e._lazy;if(i)return i===!0?r():i.then(r);if(!e.lazyFn)return r();let a=e.lazyFn().then(t=>{{let{id:n,...r}=t.options;Object.assign(e.options,r),e._lazy=!0}},t=>{throw e._lazy=void 0,t});return e._lazy=a,a.then(r)}function Pt(e){let t=e.findIndex(e=>e.status!==`success`||e._notFound)+1;return t&&t<e.length?e.slice(0,t):e}var P=0,F=1,Ft=2,I=3,L=4;function R(e){return typeof e[0]==`number`}function z(e,t){return t.aborted?Promise.race([Promise.reject(t),e]):new Promise((n,r)=>{let i=()=>r(t);t.addEventListener(`abort`,i,{once:!0}),Promise.resolve(e).then(n,r).finally(()=>t.removeEventListener(`abort`,i))})}function B(e,t){return e.routesById[t.routeId]}function V(e,t,n){return ot(e)?[I,e]:ge(e)?(e.routeId||=n,[Ft,e]):(t&&typeof e?.then==`function`&&(e=Error(`A Promise was thrown`,{cause:e})),t?[F,e]:[P,e])}function It(e,t){let n=V(t,!0,e.id);if(n[0]!==F)return n;try{e.options.onError?.(n[1])}catch(t){n=V(t,!0,e.id)}return n}function H(e,t,n){return n[0].signal.aborted||!n[2]()?(n[0].abort(),[L]):It(e,t)}function Lt(e,t){return n=>e.navigate({...n,_fromLocation:t})}async function Rt(e,t,n,r,i,a){let[o,s]=t,c=n[0].signal,l=!!n[4];for(let t=n[7]??0;t<r;t++){let r=s[t],i=B(e,r);r.abortController=n[0];let u=s[t-1]?.context??e.options.context??{},d={params:r.params,location:o,navigate:Lt(e,o),buildLocation:e.buildLocation,cause:l?`preload`:r.cause,abortController:n[0],preload:l,matches:s,routeId:i.id},f=u;try{let e=r._ctx;!e&&i.options.context&&(e=r._ctx=i.options.context({...d,deps:r.loaderDeps,context:u})||{}),f={...u,...e},r.context=f}catch(a){return U(e,r),[t,H(i,a,n)]}if(c.aborted||!n[2]())return n[0].abort(),[t,[L]];let p=r.paramsError??r.searchError;if(p!==void 0)return U(e,r),[t,H(i,p,n)];let m=i.options.beforeLoad;if(!m)continue;let h={...d,search:r.search,context:f,...e.options.additionalContext},g=r.status;g===`success`&&t>=a&&(r.status=`pending`),n[8]?.();try{Vt(e,r,`beforeLoad`,n[0]);let a=await z(m(h),c);if(!n[2]())return n[0].abort(),[t,[L]];let o=V(a,!1,i.id);if(o[0]!==P)return U(e,r),[t,o];r.context={...f,...a}}catch(a){return U(e,r),[t,H(i,a,n)]}finally{g===`success`&&r.status===`pending`&&(r.status=`success`),Vt(e,r,!1,n[0])}}i()}function zt(e,t,n){if(!(!n||--n[2])){if(e._flights?.get(t.id)===n){let n=e._tx;if(n&&!n[0].signal.aborted&&!n[3].includes(t)&&n[3].some(e=>e.id===t.id)&&n[3].some(e=>e.isFetching===`beforeLoad`))return;e._flights.delete(t.id)}return n[1]}}function U(e,t){let n=t._flight;t._flight=void 0,zt(e,t,n)?.abort()}function W(e,t,n,r){let i=[];for(let a of t)if(!n?.includes(a)){let t=a._flight;if(a._flight=void 0,r&&t?.[2]===1&&e._flights?.get(a.id)===t&&n?.some(e=>e.id===a.id))t[2]=0;else{let n=zt(e,a,t);n&&i.push(n)}}for(let e of i)e.abort()}function Bt(e){for(let t of e){let e=t._flight;e&&e[2]++}}function Vt(e,t,n,r){if(t.isFetching=n,r&&e._tx?.[0]!==r)return;let i=e.stores.byRoute.get(t.routeId),a=i?.get();a?.id===t.id&&i.set({...a,isFetching:n})}function Ht(e,t,n,r,i,a,o){let s=t[0];return{params:n.params,location:s,navigate:Lt(e,s),cause:o?`preload`:n.cause,abortController:i,preload:o,deps:n.loaderDeps,parentMatchPromise:a,context:n.context,route:r,...e.options.additionalContext}}async function Ut(e,t,n,r,i,a,o,s){let c=s.signal;if(c.aborted)return[L];if(!i)return[P,void 0];let l=n._flight;Vt(e,n,`loader`,s);try{if(!l){let s=new AbortController;l=[Promise.resolve().then(()=>i(Ht(e,t,n,r,s,a,o))).then(e=>V(e,!1,r.id),e=>V(e,!0,r.id)).then(t=>(t[0]!==P&&e._flights?.get(n.id)===l&&(e._flights.delete(n.id),l[2]||s.abort()),t[0]===F&&l[2]?It(r,t[1]):t)),s,1],(e._flights??=new Map).set(n.id,l)}return n._flight=l,n.abortController=l[1],await z(l[0],c)}catch(t){if(t!==c)throw t;return U(e,n),[L]}finally{Vt(e,n,!1,s)}}function Wt(e,t,n){t[0]===P?(e.loaderData=t[1],e.error=void 0,e.status=`success`,e.invalid=!1,e.updatedAt=Date.now(),e.preload=n):t[0]!==I&&(e.status=`success`,e.error=void 0,e.invalid=!0)}function Gt(e,t,n){let r=e._cache.get(t.id);if(r!==n||e._committed.some(e=>e.id===t.id&&e._flight===t._flight))return;let i={...t,_notFound:void 0,context:{}};i._flight&&i._flight[2]++,e._cache.set(t.id,i),r&&U(e,r)}function Kt(e,t){return t[0]===F||t[0]===Ft?{...e,status:t[0]===F?`error`:`notFound`,error:t[1],_flight:void 0}:e}function qt(e,t,n,r,i,a,o){let s=t[1][n],c=B(e,s),l=!!a[4],u=l?e._cache.get(s.id):void 0,d,f=!1,p;try{if(s.status===`success`&&(d=c.options.shouldReload,typeof d==`function`&&(d=d(Ht(e,t,s,c,a[0],i,l))),a[2]()||(a[0].abort(),p=[L])),!p)if(s.status!==`success`)f=!0;else{let t=a[4]||s.preload?c.options.preloadStaleTime??e.options.defaultPreloadStaleTime??3e4:c.options.staleTime??e.options.defaultStaleTime??0;f=!!(s.invalid||d||d===void 0&&Date.now()-s.updatedAt>=t&&(a[6]||s.cause===`enter`||a[3].some(e=>e.routeId===s.routeId&&e.id!==s.id)))}}catch(t){s.invalid=!0,U(e,s),p=H(c,t,a)}let m=c.options.loader,h=typeof m==`function`?m:m?.handler,g=(!l||c.options.preload!==!1)&&m?e._flights?.get(s.id):void 0;g===s._flight||p?g=void 0:g&&!f&&!l&&d===void 0?f=!0:f||(g=void 0);let _=!!(m&&f&&s.status===`success`&&!l&&!a[5]&&((typeof m==`function`?void 0:m?.staleReloadMode)??e.options.defaultStaleReloadMode)!==`blocking`),v=f&&(!l||c.options.preload!==!1),y=v&&!_&&(s.status!==`success`||!!m),b=c.lazyFn&&c._lazy!==!0?a[8]:void 0;if(v&&!m&&(s.invalid=!1,s.updatedAt=Date.now()),g&&g[2]++,y){let t=s._flight;s._flight=g,zt(e,s,t)?.abort(),s.status===`success`&&n>=o&&(s.status=`pending`),a[8]?.()}v||(s.isFetching=!1);let x=(p?Promise.resolve(p):y?Ut(e,t,s,c,h,i,l,a[0]):Promise.resolve([P,s.loaderData])).then(t=>(y&&(Wt(s,t,l),t[0]===P&&(l&&m&&!a[0].signal.aborted&&Gt(e,s,u),s.status=`pending`)),t)),S=z(Promise.resolve().then(()=>N(c,void 0,b)),a[0].signal).then(()=>void 0,e=>[n,H(c,e,a)]).then(e=>x.then(t=>(y&&!e&&t[0]===P&&s.status===`pending`&&a[2]()&&(s.status=`success`,a[8]?.()),e)));if(r.push([n,x,S]),!_)return x.then(e=>Kt(s,e));let C={...s,status:`pending`,preload:!1,_flight:g};s.invalid=!1,s.isFetching=`loader`;let w=Ut(e,t,C,c,h,i,!1,a[0]).then(e=>(s.isFetching=!1,Wt(C,e,!1),e));return(t[2]??=[]).push([n,w,S,C]),w.then(e=>Kt(C,e))}async function Jt(e,t,n,r,i=0){let a=n?.[1][1],o=a?.routeId?t.findIndex(e=>e.routeId===a.routeId):n?.[0]??t.length-1;o<0&&(o=0);for(let n=o;n>=0;n--){let i=B(e,t[n]),a=N(i,!1);if(a)try{await z(a,r)}catch(e){if(e===r)throw e}if(i.options.notFoundComponent)return n}return a?.routeId?o:i}function G(e,t){t[2]&&=(W(e,t[2].map(e=>e[3])),void 0)}async function Yt(e,t,n,r){let i;try{await Promise.all(e.map(e=>e[1].then(async t=>{let a=e[0];if(!(r&&a>=await r)){if(t[0]>=I)throw[a,t];!i&&t[0]!==P&&(i=[a,t],await Promise.all((n??[]).map(e=>{if(!(e[0]<=a))return e[1].then(t=>{if(t[0]===I)throw[e[0],t]})})))}})))}catch(e){return e}return t??i}async function Xt(e,t,n,r,i,a,o){let s=t[1],c=await a,l=!1,u=s.findIndex(e=>e._notFound),d=t=>t[1][0]===Ft?Jt(e,s,t,r.signal):t[0],f=u<0?s.length:u;if((c?.[1][0]??0)>=I)f=0;else if(c){f=c[2]??=await d(c);for(let e of n){if(e[0]>=f)break;let t=await e[1];if(t[0]!==P&&t[0]<I&&!(`loaderData`in s[e[0]])){c=[e[0],t],f=c[2]=await d(c);break}}}for(let e of n){if(e[0]>=f)break;let t=await e[2];if(t){c=t;break}}if((c?.[1][0]??0)>=I){let n=c[1];if(n[0]!==I||n[1].options.reloadDocument||i<20)return G(e,t),n;l=!0,c=[0,[F,Error(`Too many redirects`)]]}let p=c?c[2]??await d(c):u;if(p>=0){let i=c?.[1],a=i?.[0],u=s[p],d=i?.[1],f=()=>{i&&(u._notFound=void 0,a===F?u.status=`error`:(d.routeId=u.routeId,u.routeId===e.routeTree.id?(u.status=`success`,u._notFound=!0):u.status=`notFound`),u.error=d,u.isFetching=!1)};f();let m=B(e,u);try{await z(i?Promise.resolve().then(()=>N(m,a===F?`errorComponent`:`notFoundComponent`)):Promise.all([N(m),N(m,`notFoundComponent`)]),r.signal)}catch(n){if(n===r.signal)return G(e,t),[L]}i?l&&(r.abort(),await Promise.all([...n.map(e=>e[1]),...n.map(e=>e[2]),...(t[2]??[]).map(e=>e[1])]),G(e,t),W(e,s),f()):(u.status=`success`,o?.())}return t}async function Zt(e,t,n,r=0,i=t[1].length){let a=t[1];for(let t=r;t<i;t++){let r=a[t],i=B(e,r).options;if(i.head||i.scripts)try{let t={ssr:e.options.ssr,matches:a,match:r,params:r.params,loaderData:r.loaderData},[o,s]=await z(Promise.all([i.head?.(t),i.scripts?.(t)]),n);r.meta=o?.meta,r.links=o?.links,r.headScripts=o?.scripts,r.styles=o?.styles,r.scripts=s}catch(e){if(e===n)break;console.error(e)}if(r.status!==`success`||r._notFound)break}return t}async function Qt(e,t,n,r){let i=[t,n],a=e.stores.matches.get(),o=n.findIndex(e=>e._notFound);if(e.options.notFoundMode!==`root`&&o>=0){let t=await Jt(e,i[1],void 0,r[0].signal,o);t!==o&&(n[o]._notFound=void 0,n[t]._notFound=!0),o=t}let s=o<0?n.length:o+1,c=0;for(;c<s&&c!==o;){let e=n[c],t=r[3][c],i=a[c];if(t?.id!==e.id||t.status!==`success`||t._notFound||e.preload||i?.id!==e.id||i.status!==`success`||i._notFound)break;c++}let l=[],u=r[7]??0,d=u?Promise.resolve(i[1][u-1]):void 0,f=()=>{for(let t=u;t<s&&!r[0].signal.aborted;t++)d=qt(e,i,t,l,d,r,c)},p=await Rt(e,i,r,s,f,c);if(p&&(r[5]=!0,s=p[0],p[1][0]===Ft?(p[2]=await Jt(e,i[1],p,r[0].signal),s=Math.min(s,p[2]+1)):p[1][0]>=I&&(s=0),f()),r[2]()&&!r[4]){let t=[];for(let[n,r]of e._flights??[])r[2]||(e._flights.delete(n),t.push(r[1]));for(let e of t)e.abort()}let m;try{let t=Xt(e,i,l,r[0],r[1],Yt(l,p,i[2]),r[8]);i[2]?.length&&(i[3]=Yt(i[2],void 0,void 0,t.then(e=>R(e)?0:Pt(e[1]).length,()=>0))),m=await t}catch(t){throw G(e,i),t}return R(m)?m:Zt(e,m,r[0].signal,r[7]===m[1].length?r[7]:0)}function $t(e,t){if(e._tx!==t)return;let n=e._pending,r=!1,i=n?.[0][3][n[1]]?.id;n?.[0]!==t&&(n&&t[3][n[1]]?.id===i?(n[0]=t,r=!0):(clearTimeout(n?.[3]),e._pending=n=void 0));let a=t[3],o=e.stores.matches.get(),s=-1,c,l,u,d=!1;for(let t=0;t<a.length;t++){let n=a[t],r=n.status===`success`;if(d=o[t]?.id===n.id&&o[t]?.status===`pending`,r&&!d)continue;let i=B(e,n);if(c=r&&d||n.invalid?0:i.options.pendingMs??e.options.defaultPendingMs,u=i.options.pendingComponent??e.options.defaultPendingComponent,!u||typeof c!=`number`||c===1/0)return;s=t,l=i.options.pendingMinMs??e.options.defaultPendingMinMs??0;break}if(s<0)return;let f=a[s].id;if((!n||n[1]!==s||i!==f)&&(clearTimeout(n?.[3]),e._pending=n=[t,s,d?Date.now()+l:t[4]+c,void 0,d?Promise.resolve(!0):void 0,u]),n[4]&&!r&&n[5]===u)return;if(n[5]=u,!n[4]){clearTimeout(n[3]);let r=n[2]-Date.now();if(r>0){n[3]=setTimeout(()=>$t(e,t),r);return}n[2]=0}let p=a.map(e=>({...e,_flight:void 0}));p[s].status=`pending`;let m=e.startTransition(()=>e.stores.setMatches(p),p).then(t=>(t&&e._pending===n&&n[4]===m&&!n[2]&&(n[2]=Date.now()+l),t));n[4]=m}function en(e,t){let n=e._pending;n?.[0]===t&&(clearTimeout(n[3]),e._pending=void 0)}function tn(e,t){e._committed=t,e.stores.setMatches(t)}function nn(e,t){W(e,t[1]),G(e,t)}function rn(e,t,n,r){let i=e._committed,a=e._cache;for(let e of n)e.preload=!1,r&&(e._assetEnd=void 0);let o=Pt(n).length,s=new Map,c=Date.now();for(let t of[...i,...a.values()]){if(t.status!==`success`||n.some((e,n)=>e.id===t.id&&(n<o||e.status===`success`)))continue;let r=B(e,t);!r.options.loader||c-t.updatedAt>=(t.preload?r.options.preloadGcTime??e.options.defaultPreloadGcTime??3e5:r.options.gcTime??e.options.defaultGcTime??3e5)||s.set(t.id,a.get(t.id)===t?t:{...t,_flight:void 0,isFetching:!1,context:{}})}t[3]=[],e._cache=s,tn(e,n),W(e,[...a.values(),...i],[...n,...s.values()]),Ct(e,i,n,()=>e._tx===t)}async function K(e,t){let n=e._tx;for(;n&&n!==t;){if(await n[5],e._tx===n)return;n=e._tx}}async function an(e,t,n){await e.navigate({...n.options,replace:!0,ignoreBlocker:!0,_redirects:t[1]+1})}function on(e,t){en(e,t),t[0].abort(),W(e,t[3]),t[3]=[],e._tx===t&&(e.batch(()=>{e.stores.status.set(`idle`),e.stores.setMatches(e._committed)}),e._tx===t&&(e._commitPromise?.resolve(),e._commitPromise=void 0))}async function sn(e,t,n,r,i){let a=n.map(e=>({...e}));Bt(a);for(let t of r)U(e,a[t[0]]),a[t[0]]=t[3];let o=[t[2],a],s;try{s=await Xt(e,o,r,t[0],t[1],i)}catch(t){throw W(e,a),t}if(R(s)){W(e,a),s[0]===I&&e._tx===t&&e._committed===n&&await an(e,t,s[1]);return}let c=await Zt(e,s,t[0].signal);if(e._tx!==t||e._committed!==n){W(e,c[1]);return}for(let t of c[1]){let n=e._cache.get(t.id);n?._flight&&n._flight===t._flight&&(e._cache.delete(t.id),U(e,n))}tn(e,c[1]),W(e,n,c[1])}async function cn(e,t,n,r,i,a){let o=[t[0],t[1],()=>e._tx===t&&!!t[3].length,e._committed,void 0,i,n,a,r],s=await Qt(e,t[2],t[3],o);if(R(s)){s[0]===I&&e._tx===t?(en(e,t),W(e,t[3]),t[3]=[],e._tx===t&&await an(e,t,s[1])):on(e,t);return}let c=e._pending;if(c?.[0]===t&&(clearTimeout(c[3]),c[4])){let n=t[0].signal,r=!1;try{r=await z(c[4],n)}catch(e){if(e!==n)throw e}if(r&&e._pending===c&&c[0]===t){let e=c[2]-Date.now();if(e>0){try{await z(new Promise(t=>{c[3]=setTimeout(t,e)}),n)}catch{}clearTimeout(c[3])}}}if(e._tx!==t){en(e,t),nn(e,s);return}let l=t[2],u=xt(l,e.stores.resolvedLocation.get()),d=s[2];await e.startViewTransition(async()=>{if(e._tx!==t){nn(e,s);return}let n=await e.startTransition(()=>{en(e,t),rn(e,t,s[1],a),e._tx===t&&(e.emit({type:`onLoad`,...u}),e._tx===t&&e.emit({type:`onBeforeRouteMount`,...u}))},s[1]);if(e._tx!==t){G(e,s);return}d?.length&&sn(e,t,s[1],d,s[3]).catch(console.error),e.batch(()=>{e.stores.resolvedLocation.set(l),e.stores.status.set(`idle`),e._tx===t&&e.emit({type:`onResolved`,...u}),n&&e._tx===t&&e.emit({type:`onRendered`,...u})}),e._tx===t&&(e._commitPromise?.resolve(),e._commitPromise=void 0)})}async function ln(e,t){let n=e._tx,r=e.stores.resolvedLocation.get(),i=r??e.stores.location.get(),a=e.latestLocation,o=e._pendingLocation,s=o?.href===a.href?o._redirects??0:0,c=e._handoff,l=c?.[0](),u=new AbortController,d=e._preflight;if(e._preflight=u,l||c?.[1](),d?.abort(),u.signal.aborted){await K(e,n);return}let f=xt(a,r);if(e.emit({type:`onBeforeNavigate`,...f}),u.signal.aborted||e.emit({type:`onBeforeLoad`,...f}),u.signal.aborted){await K(e,n);return}let p=i.href===a.href,m,h=u;try{m=e.matchRoutes(a,{_controller:u}),Bt(m)}catch(t){if(u.abort(),!ot(t)){await K(e),e._commitPromise?.resolve(),e._commitPromise=void 0;return}await e.navigate({...t.options,replace:!0,ignoreBlocker:!0}),await K(e,n);return}let g=l?c[1](m):void 0;if(g?h=l:l?.abort(),u.signal.aborted){W(e,m),await K(e,n);return}e._preflight=void 0;let _=[h,s,a,m,Date.now(),Promise.resolve().then(()=>cn(e,_,p,()=>$t(e,_),t?.sync,g)).catch(()=>{e._tx===_&&on(e,_)})];if(e._tx=_,n){for(let t of e.stores.matches.get()){if(e._tx!==_)break;t.isFetching&&Vt(e,t,!1)}n[0].abort(),W(e,n[3],_[3],!0)}if(e._tx!==_){W(e,_[3]),_[3]=[],await K(e,_);return}e.batch(()=>{e.stores.status.set(`pending`),e.stores.location.set(a)}),!r&&!m.some(e=>e._notFound)&&$t(e,_);try{await _[5]}finally{await K(e,_)}}async function un(e,t,n=0){if(n>20)return;let r=t._builtLocation??e.buildLocation(t),i=e._committed,a=new AbortController,o;try{o=e.matchRoutes(r,{_controller:a}),Bt(o)}catch(e){a.abort(),ge(e)||console.error(e);return}(e._preloads??=new Map).set(a,o);let s;try{let t;try{t=await Qt(e,r,o,[a,n,()=>!0,i,!0])}finally{s=e._preloads.delete(a),W(e,o),a.abort()}if(!R(t))return t[1];if(s&&t[0]===I&&!t[1].options.reloadDocument)return un(e,{...t[1].options,_fromLocation:r},n+1)}catch(e){ge(e)||console.error(e)}}var dn=class{get to(){return this._to}get id(){return this._id}get path(){return this._path}get fullPath(){return this._fullPath}constructor(e){if(this.init=e=>{this.originalIndex=e.originalIndex;let n=this.options,r=!n?.path&&!n?.id;this.parentRoute=this.options.getParentRoute?.(),r?this._path=be:this.parentRoute||o();let i=r?be:n?.path;i&&i!==`/`&&(i=f(i));let a=n?.id||i,s=r?be:t([this.parentRoute.id===`__root__`?``:this.parentRoute.id,a]);i===`__root__`&&(i=`/`),s!==`__root__`&&(s=t([`/`,s]));let c=s===`__root__`?`/`:t([this.parentRoute.fullPath,i]);this._path=i,this._id=s,this._fullPath=c,this._to=m(c)},this.addChildren=e=>this._addFileChildren(e),this._addFileChildren=e=>(Array.isArray(e)&&(this.children=e),typeof e==`object`&&e&&(this.children=Object.values(e)),this),this._addFileTypes=()=>this,this.updateLoader=e=>(Object.assign(this.options,e),this),this.update=e=>(Object.assign(this.options,e),this),this.lazy=e=>(this.lazyFn=e,this),this.redirect=e=>j({from:this.fullPath,...e}),this.options=e||{},this.isRoot=!e?.getParentRoute,e?.id&&e?.path)throw Error(`Route cannot have both an 'id' and a 'path' option.`)}},fn=class extends dn{constructor(e){super(e)}},q=(e=>(e[e.None=0]=`None`,e[e.Mutable=1]=`Mutable`,e[e.Watching=2]=`Watching`,e[e.RecursedCheck=4]=`RecursedCheck`,e[e.Recursed=8]=`Recursed`,e[e.Dirty=16]=`Dirty`,e[e.Pending=32]=`Pending`,e))(q||{});function pn({update:e,notify:t,unwatched:n}){return{link:r,unlink:i,propagate:a,checkDirty:o,shallowPropagate:s};function r(e,t,n){let r=t.depsTail;if(r!==void 0&&r.dep===e)return;let i=r===void 0?t.deps:r.nextDep;if(i!==void 0&&i.dep===e){i.version=n,t.depsTail=i;return}let a=e.subsTail;if(a!==void 0&&a.version===n&&a.sub===t)return;let o=t.depsTail=e.subsTail={version:n,dep:e,sub:t,prevDep:r,nextDep:i,prevSub:a,nextSub:void 0};i!==void 0&&(i.prevDep=o),r===void 0?t.deps=o:r.nextDep=o,a===void 0?e.subs=o:a.nextSub=o}function i(e,t=e.sub){let r=e.dep,i=e.prevDep,a=e.nextDep,o=e.nextSub,s=e.prevSub;return a===void 0?t.depsTail=i:a.prevDep=i,i===void 0?t.deps=a:i.nextDep=a,o===void 0?r.subsTail=s:o.prevSub=s,s===void 0?(r.subs=o)===void 0&&n(r):s.nextSub=o,a}function a(e){let n=e.nextSub,r;top:do{let i=e.sub,a=i.flags;if(a&60?a&12?a&4?!(a&48)&&c(e,i)?(i.flags=a|40,a&=1):a=0:i.flags=a&-9|32:a=0:i.flags=a|32,a&2&&t(i),a&1){let t=i.subs;if(t!==void 0){let i=(e=t).nextSub;i!==void 0&&(r={value:n,prev:r},n=i);continue}}if((e=n)!==void 0){n=e.nextSub;continue}for(;r!==void 0;)if(e=r.value,r=r.prev,e!==void 0){n=e.nextSub;continue top}break}while(!0)}function o(t,n){let r,i=0,a=!1;top:do{let o=t.dep,c=o.flags;if(n.flags&16)a=!0;else if((c&17)==17){if(e(o)){let e=o.subs;e.nextSub!==void 0&&s(e),a=!0}}else if((c&33)==33){(t.nextSub!==void 0||t.prevSub!==void 0)&&(r={value:t,prev:r}),t=o.deps,n=o,++i;continue}if(!a){let e=t.nextDep;if(e!==void 0){t=e;continue}}for(;i--;){let i=n.subs,o=i.nextSub!==void 0;if(o?(t=r.value,r=r.prev):t=i,a){if(e(n)){o&&s(i),n=t.sub;continue}a=!1}else n.flags&=-33;n=t.sub;let c=t.nextDep;if(c!==void 0){t=c;continue top}}return a}while(!0)}function s(e){do{let n=e.sub,r=n.flags;(r&48)==32&&(n.flags=r|16,(r&6)==2&&t(n))}while((e=e.nextSub)!==void 0)}function c(e,t){let n=t.depsTail;for(;n!==void 0;){if(n===e)return!0;n=n.prevDep}return!1}}function mn(e,t,n){let r=typeof e==`object`,i=r?e:void 0;return{next:(r?e.next:e)?.bind(i),error:(r?e.error:t)?.bind(i),complete:(r?e.complete:n)?.bind(i)}}var hn=[],gn=0,{link:_n,unlink:vn,propagate:yn,checkDirty:bn,shallowPropagate:xn}=pn({update(e){return e._update()},notify(e){hn[Cn++]=e,e.flags&=~q.Watching},unwatched(e){e.depsTail!==void 0&&(e.depsTail=void 0,e.flags=q.Mutable|q.Dirty,En(e))}}),Sn=0,Cn=0,J,wn=0;function Tn(e){try{++wn,e()}finally{--wn||Dn()}}function En(e){let t=e.depsTail,n=t===void 0?e.deps:t.nextDep;for(;n!==void 0;)n=vn(n,e)}function Dn(){if(!(wn>0)){for(;Sn<Cn;){let e=hn[Sn];hn[Sn++]=void 0,e.notify()}Sn=0,Cn=0}}function On(e,t){let n=typeof e==`function`,r=e,i={_snapshot:n?void 0:e,subs:void 0,subsTail:void 0,deps:void 0,depsTail:void 0,flags:n?q.None:q.Mutable,get(){return J!==void 0&&_n(i,J,gn),i._snapshot},subscribe(e){let t=mn(e),n={current:!1},r=kn(()=>{i.get(),n.current?t.next?.(i._snapshot):n.current=!0});return{unsubscribe:()=>{r.stop()}}},_update(e){let a=J,o=t?.compare??Object.is;if(n)J=i,++gn,i.depsTail=void 0;else if(e===void 0)return!1;n&&(i.flags=q.Mutable|q.RecursedCheck);try{let t=i._snapshot,a=typeof e==`function`?e(t):e===void 0&&n?r(t):e;return t===void 0||!o(t,a)?(i._snapshot=a,!0):!1}finally{J=a,n&&(i.flags&=~q.RecursedCheck),En(i)}}};return n?(i.flags=q.Mutable|q.Dirty,i.get=function(){let e=i.flags;if(e&q.Dirty||e&q.Pending&&bn(i.deps,i)){if(i._update()){let e=i.subs;e!==void 0&&xn(e)}}else e&q.Pending&&(i.flags=e&~q.Pending);return J!==void 0&&_n(i,J,gn),i._snapshot}):i.set=function(e){if(i._update(e)){let e=i.subs;e!==void 0&&(yn(e),xn(e),Dn())}},i}function kn(e){let t=()=>{let t=J;J=n,++gn,n.depsTail=void 0,n.flags=q.Watching|q.RecursedCheck;try{return e()}finally{J=t,n.flags&=~q.RecursedCheck,En(n)}},n={deps:void 0,depsTail:void 0,subs:void 0,subsTail:void 0,flags:q.Watching|q.RecursedCheck,notify(){let e=this.flags;e&q.Dirty||e&q.Pending&&bn(this.deps,this)?t():this.flags=q.Watching},stop(){this.flags=q.None,this.depsTail=void 0,En(this)}};return t(),n}var An={};function jn(e,t){let n=O.useRef();return r=>{let i=e?.select?e.select(r):r;return e?.structuralSharing??t.options.defaultStructuralSharing?n.current=D(n.current,i):i}}function Y(e){let t=ue(),n=O.useContext(e.from?xe:ye),r=e.from??n,i=t.stores.getMatchStore(r),a=jn(e,t),s=_(i,e=>e?a(e):An);if(s!==An)return s;(e.shouldThrow??!0)&&o()}function Mn(e){return Y({from:e.from,strict:e.strict,structuralSharing:e.structuralSharing,select:t=>e.select?e.select(t.loaderData):t.loaderData})}function Nn(e){let{select:t,...n}=e;return Y({...n,select:e=>t?t(e.loaderDeps):e.loaderDeps})}function Pn(e){return Y({from:e.from,shouldThrow:e.shouldThrow,structuralSharing:e.structuralSharing,strict:e.strict,select:t=>{let n=e.strict===!1?t.params:t._strictParams;return e.select?e.select(n):n}})}function Fn(e){return Y({from:e.from,strict:e.strict,shouldThrow:e.shouldThrow,structuralSharing:e.structuralSharing,select:t=>e.select?e.select(t.search):t.search})}function In(e){return Y({...e,select:t=>e.select?e.select(t.context):t.context})}var Ln=class extends dn{constructor(e){super(e),this.useMatch=e=>Y({select:e?.select,from:this.id,structuralSharing:e?.structuralSharing}),this.useRouteContext=e=>In({...e,from:this.id}),this.useSearch=e=>Fn({select:e?.select,structuralSharing:e?.structuralSharing,from:this.id}),this.useParams=e=>Pn({select:e?.select,structuralSharing:e?.structuralSharing,from:this.id}),this.useLoaderDeps=e=>Nn({...e,from:this.id}),this.useLoaderData=e=>Mn({...e,from:this.id}),this.useNavigate=()=>de({from:this.fullPath}),this.Link=Ee.forwardRef((e,t)=>k(T,{ref:t,from:this.fullPath,...e}))}};function Rn(e){return new Ln(e)}function zn(){return e=>Vn(e)}var Bn=class extends fn{constructor(e){super(e),this.useMatch=e=>Y({select:e?.select,from:this.id,structuralSharing:e?.structuralSharing}),this.useRouteContext=e=>In({...e,from:this.id}),this.useSearch=e=>Fn({select:e?.select,structuralSharing:e?.structuralSharing,from:this.id}),this.useParams=e=>Pn({select:e?.select,structuralSharing:e?.structuralSharing,from:this.id}),this.useLoaderDeps=e=>Nn({...e,from:this.id}),this.useLoaderData=e=>Mn({...e,from:this.id}),this.useNavigate=()=>de({from:this.fullPath}),this.Link=Ee.forwardRef((e,t)=>k(T,{ref:t,from:this.fullPath,...e}))}};function Vn(e){return new Bn(e)}function X(e){return e=>{let t=Rn(e);return t.isRoot=!1,t}}function Z(e,t){let n,r,i,a=()=>(n||=(i=void 0,e().then(e=>{n=void 0,r=e[t??`default`]}).catch(e=>{n=void 0,i=e})),n),o=function(e){if(i){if(w(i)&&typeof sessionStorage<`u`){let e=`tanstack_router_reload:${i.message}`;if(!sessionStorage.getItem(e))throw sessionStorage.setItem(e,`1`),window.location.reload(),new Promise(()=>{})}throw i}if(!r)if(ce)ce(a());else throw a();return O.createElement(r,e)};return o.preload=a,o}function Hn(e,t){let n=e[1];e.length=0,n?.(t)}function Un({t:e}){let t=ue(),n=t._rendered??=[];return t.startTransition=(r,i)=>new Promise((a,o)=>{Hn(n,!1),n.push(i,a),e(t),O.startTransition(()=>{try{r()}catch(e){n[1]===a&&(n.length=0),o(e)}})}),ae(()=>{let e=t.history.subscribe(t.load);t.updateLatestLocation();let r=t.latestLocation,i=t.buildLocation({to:r.pathname,search:!0,params:!0,hash:!0,state:!0,_includeValidateSearch:!0});if(m(r.publicHref)!==m(i.publicHref))return t.commitLocation({...i,replace:!0,ignoreBlocker:!0}),e;let a=t.stores.resolvedLocation.get();return a?.href===r.href&&a.state.__TSR_key===r.state.__TSR_key?n.push(t.stores.matches.get(),e=>{e&&t.emit({type:`onRendered`,...xt(a,a)})}):t._tx||t.load().catch(console.error),e},[t,t.history]),null}function Wn(){let e=ue(),t=e.routesById[be],n=_e(e,t),r=e.ssr?me:O.Suspense,i=Pe(Ne,{children:[k(Un,{t:O.useState()[1]}),k(r,{fallback:n,children:k(Gn,{})})]});return e.options.InnerWrap?k(e.options.InnerWrap,{children:i}):i}function Gn(){let e=ue(),t=e._rendered,n=_(e.stores.matches,e=>t[0]??e),r=n[0],i=r?.routeId;ae(()=>{t[0]===n&&Hn(t,!0)},[t,n]);let a=i?k(ve,{routeId:i}):null;return k(ye.Provider,{value:i,children:e.options.disableGlobalCatchBoundary?a:k(pe,{getResetKey:()=>r,onCatch:void 0,children:a})})}var Kn=e=>({createMutableStore:On,createReadonlyStore:On,batch:Tn}),qn=e=>new Jn(e),Jn=class extends wt{constructor(e){super(e,Kn)}};function Yn({router:e,children:t,...n}){C(n)&&e.update({...e.options,...n,context:{...e.options.context,...n.context}});let r=k(v.Provider,{value:e,children:t});return e.options.Wrap?k(e.options.Wrap,{children:r}):r}function Xn({router:e,...t}){return k(Yn,{router:e,...t,children:k(Wn,{})})}var Zn=Ie.div`
|
|
3
|
-
display: flex;
|
|
4
|
-
align-items: center;
|
|
5
|
-
justify-content: center;
|
|
6
|
-
min-height: 100vh;
|
|
7
|
-
padding: ${({theme:e})=>e.space(4)};
|
|
8
|
-
text-align: center;
|
|
9
|
-
`,Qn=Ie.p`
|
|
10
|
-
font-size: 13px;
|
|
11
|
-
color: ${({theme:e})=>e.color.inkDim};
|
|
12
|
-
max-width: 48ch;
|
|
13
|
-
`,$n=zn()({component:he,notFoundComponent:()=>k(Zn,{children:Pe(ie,{$gap:3,style:{alignItems:`center`},children:[k(E,{children:`Not found`}),k(Qn,{children:`This console has no screen at that address.`}),k(le,{as:`a`,href:`/`,$variant:`primary`,$size:`sm`,children:`Back to the rack`})]})})});async function er(e){return e.queryClient.ensureQueryData({queryKey:ee.status,queryFn:()=>te(`/api/status`),revalidateIfStale:!0})}function tr(e){let t=e.principal;return e.authenticated!==!0||t==null?`/login`:t.kind===`client`?`/client`:t.kind===`admin`||t.kind===`viewer`?`/`:`/login`}function nr(e,t){let n=tr(e);if(n===`/login`)throw j({to:`/login`,search:{next:t}});if(n!==`/`)throw j({to:n})}function rr(e,t){let n=tr(e);if(n===`/login`)throw j({to:`/login`,search:{next:t}});if(n!==`/client`)throw j({to:n})}var ir=`modulepreload`,ar=function(e){return`/`+e},or={},Q=function(e,t,n){let r=Promise.resolve();if(t&&t.length>0){let e=document.getElementsByTagName(`link`),i=document.querySelector(`meta[property=csp-nonce]`),a=i?.nonce||i?.getAttribute(`nonce`);function o(e){return Promise.all(e.map(e=>Promise.resolve(e).then(e=>({status:`fulfilled`,value:e}),e=>({status:`rejected`,reason:e}))))}function s(e){return import.meta.resolve?import.meta.resolve(e):new URL(e,import.meta.url).href}r=o(t.map(t=>{if(t=ar(t,n),t=s(t),t in or)return;or[t]=!0;let r=t.endsWith(`.css`);for(let n=e.length-1;n>=0;n--){let i=e[n];if(i.href===t&&(!r||i.rel===`stylesheet`))return}let i=document.createElement(`link`);if(i.rel=r?`stylesheet`:ir,r||(i.as=`script`),i.crossOrigin=``,i.href=t,a&&i.setAttribute(`nonce`,a),document.head.appendChild(i),r)return new Promise((e,n)=>{i.addEventListener(`load`,e),i.addEventListener(`error`,()=>n(Error(`Unable to preload CSS for ${t}`)))})}))}function i(e){let t=new Event(`vite:preloadError`,{cancelable:!0});if(t.payload=e,window.dispatchEvent(t),!t.defaultPrevented)throw e}return r.then(t=>{for(let e of t||[])e.status===`rejected`&&i(e.reason);return e().catch(i)})},sr=X(`/_app`)({beforeLoad:async({context:e,location:t})=>{nr(await er(e),t.href)},component:Z(()=>Q(()=>import(`./_app-a3VUev6k.js`),__vite__mapDeps([0,1,2,3,4,5,6])),`component`)}),cr=X(`/client`)({beforeLoad:async({context:e,location:t})=>{rr(await er(e),t.href)},component:Z(()=>Q(()=>import(`./client-CQGHWD56.js`),__vite__mapDeps([7,8,2,5,4,9,10,11,12,13,14,6,15,16,17,18,19])),`component`)}),lr=X(`/login`)({validateSearch:e=>({...typeof e.next==`string`?{next:e.next}:{},...typeof e.reason==`string`?{reason:e.reason}:{}}),component:Z(()=>Q(()=>import(`./login-bJoYdBqx.js`),__vite__mapDeps([20,2,5,10,12,21])),`component`)}),ur=X(`/_app/`)({component:Z(()=>Q(()=>import(`./_app.index-NBeanmyf.js`),__vite__mapDeps([22,2,4,5,16,17,11,12,13,19])),`component`)}),dr=X(`/_app/accounts`)({component:Z(()=>Q(()=>import(`./_app.accounts-CYPB-7Xt.js`),__vite__mapDeps([23,2,4,5,24,9,25,26,27,17,10,11,12,13,28,14,8])),`component`)}),fr=X(`/_app/console`)({component:Z(()=>Q(()=>import(`./_app.console-C4x5F3d0.js`),__vite__mapDeps([29,2,4,5,10,12,6])),`component`)}),pr=X(`/_app/database`)({component:Z(()=>Q(()=>import(`./_app.database-B-9oB52r.js`),__vite__mapDeps([30,2,4,5,10,11,12,13,19,21])),`component`)}),mr=X(`/_app/keys`)({component:Z(()=>Q(()=>import(`./_app.keys-DK9jdOqT.js`),__vite__mapDeps([31,2,4,5,24,9,25,27,17,10,11,12,13])),`component`)}),hr=X(`/_app/logs`)({component:Z(()=>Q(()=>import(`./_app.logs-Dr6fApsE.js`),__vite__mapDeps([32,2,4,5,17,10,12,15,16,13])),`component`)}),gr=X(`/_app/models`)({component:Z(()=>Q(()=>import(`./_app.models-CGBQ2QaS.js`),__vite__mapDeps([33,2,4,5,25,26,27,17,10,11,12,28])),`component`)}),_r=X(`/_app/settings`)({component:Z(()=>Q(()=>import(`./_app.settings-zTFRyxhZ.js`),__vite__mapDeps([34,2,4,5,27,10,11,12,21])),`component`)}),vr=X(`/_app/usage`)({component:Z(()=>Q(()=>import(`./_app.usage-BCCimHY0.js`),__vite__mapDeps([35,8,2,5,4,12,13,28,18,19])),`component`)}),yr=X(`/_app/plugins/$pluginId`)({component:Z(()=>Q(()=>import(`./_app.plugins._pluginId-DXzhupNH.js`),__vite__mapDeps([36,2,4,5,12])),`component`)}),$=sr.update({id:`/_app`,getParentRoute:()=>$n}),br=cr.update({id:`/client`,path:`/client`,getParentRoute:()=>$n}),xr=lr.update({id:`/login`,path:`/login`,getParentRoute:()=>$n}),Sr=ur.update({id:`/`,path:`/`,getParentRoute:()=>$}),Cr={AppAccountsRoute:dr.update({id:`/accounts`,path:`/accounts`,getParentRoute:()=>$}),AppConsoleRoute:fr.update({id:`/console`,path:`/console`,getParentRoute:()=>$}),AppDatabaseRoute:pr.update({id:`/database`,path:`/database`,getParentRoute:()=>$}),AppKeysRoute:mr.update({id:`/keys`,path:`/keys`,getParentRoute:()=>$}),AppLogsRoute:hr.update({id:`/logs`,path:`/logs`,getParentRoute:()=>$}),AppModelsRoute:gr.update({id:`/models`,path:`/models`,getParentRoute:()=>$}),AppSettingsRoute:_r.update({id:`/settings`,path:`/settings`,getParentRoute:()=>$}),AppUsageRoute:vr.update({id:`/usage`,path:`/usage`,getParentRoute:()=>$}),AppIndexRoute:Sr,AppPluginsPluginIdRoute:yr.update({id:`/plugins/$pluginId`,path:`/plugins/$pluginId`,getParentRoute:()=>$})},wr={AppRoute:$._addFileChildren(Cr),ClientRoute:br,LoginRoute:xr},Tr=$n._addFileChildren(wr)._addFileTypes();function Er(e){let t=t=>{!(t instanceof oe)||!t.isUnauthenticated||e.isLoginRoute()||e.onUnauthenticated()};return new we({queryCache:new Ce({onError:t}),mutationCache:new Se({onError:t}),defaultOptions:{queries:{retry:(e,t)=>t instanceof oe&&t.isUnauthenticated?!1:e<2,staleTime:5e3,refetchOnWindowFocus:!0},mutations:{retry:!1}}})}var Dr=Re`
|
|
14
|
-
:root {
|
|
15
|
-
color-scheme: light;
|
|
16
|
-
|
|
17
|
-
--rack: oklch(0.962 0.004 258);
|
|
18
|
-
--panel: oklch(1 0 0);
|
|
19
|
-
--panel-sunk: oklch(0.972 0.004 258);
|
|
20
|
-
--panel-raised: oklch(0.988 0.003 258);
|
|
21
|
-
--rule: oklch(0.9 0.006 258);
|
|
22
|
-
--rule-strong: oklch(0.82 0.008 258);
|
|
23
|
-
|
|
24
|
-
--ink: oklch(0.22 0.017 258);
|
|
25
|
-
--ink-dim: oklch(0.45 0.015 258);
|
|
26
|
-
--ink-faint: oklch(0.62 0.012 258);
|
|
27
|
-
|
|
28
|
-
--accent: oklch(0.52 0.17 262);
|
|
29
|
-
--accent-ink: oklch(0.99 0 0);
|
|
30
|
-
--accent-wash: oklch(0.52 0.17 262 / 0.11);
|
|
31
|
-
|
|
32
|
-
--ok: oklch(0.52 0.13 162);
|
|
33
|
-
--warn: oklch(0.58 0.13 72);
|
|
34
|
-
--down: oklch(0.53 0.2 27);
|
|
35
|
-
--ok-wash: oklch(0.52 0.13 162 / 0.12);
|
|
36
|
-
--warn-wash: oklch(0.58 0.13 72 / 0.14);
|
|
37
|
-
--down-wash: oklch(0.53 0.2 27 / 0.11);
|
|
38
|
-
|
|
39
|
-
--p-anthropic: oklch(0.56 0.13 45);
|
|
40
|
-
--p-openai: oklch(0.5 0.09 190);
|
|
41
|
-
--p-kimi: oklch(0.53 0.17 330);
|
|
42
|
-
/* Kilo takes the arc between openai and the accent: 224 is ~34deg from
|
|
43
|
-
openai and ~38 from the accent blue, and — the point — 106 from kimi.
|
|
44
|
-
Kimi and kilo are one letter apart and sit next to each other in every
|
|
45
|
-
list the console draws, so they are the one pair that must not also be
|
|
46
|
-
neighbours in hue. The other free arc, ~296, is 34 from kimi and would
|
|
47
|
-
have done the opposite. */
|
|
48
|
-
--p-kilo: oklch(0.52 0.14 224);
|
|
49
|
-
/* xAI's own identity is achromatic, and the neutral slot is already
|
|
50
|
-
custom's, so grok takes the widest free arc of the wheel instead: 125 is
|
|
51
|
-
~70deg from both anthropic and openai and ~145 from kimi, which is what
|
|
52
|
-
keeps five series apart in the usage charts. */
|
|
53
|
-
--p-grok: oklch(0.52 0.14 125);
|
|
54
|
-
--p-custom: oklch(0.5 0.03 258);
|
|
55
|
-
|
|
56
|
-
--grid-line: oklch(0.22 0.017 258 / 0.055);
|
|
57
|
-
--shadow: 0 1px 2px oklch(0.22 0.017 258 / 0.06);
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
.dark {
|
|
61
|
-
color-scheme: dark;
|
|
62
|
-
|
|
63
|
-
--rack: oklch(0.163 0.013 258);
|
|
64
|
-
--panel: oklch(0.204 0.013 258);
|
|
65
|
-
--panel-sunk: oklch(0.183 0.013 258);
|
|
66
|
-
--panel-raised: oklch(0.246 0.013 258);
|
|
67
|
-
--rule: oklch(0.3 0.012 258);
|
|
68
|
-
--rule-strong: oklch(0.4 0.014 258);
|
|
69
|
-
|
|
70
|
-
--ink: oklch(0.94 0.006 250);
|
|
71
|
-
--ink-dim: oklch(0.72 0.011 253);
|
|
72
|
-
--ink-faint: oklch(0.55 0.012 255);
|
|
73
|
-
|
|
74
|
-
--accent: oklch(0.74 0.13 262);
|
|
75
|
-
--accent-ink: oklch(0.17 0.02 262);
|
|
76
|
-
--accent-wash: oklch(0.74 0.13 262 / 0.18);
|
|
77
|
-
|
|
78
|
-
--ok: oklch(0.75 0.14 162);
|
|
79
|
-
--warn: oklch(0.82 0.14 80);
|
|
80
|
-
--down: oklch(0.68 0.19 25);
|
|
81
|
-
--ok-wash: oklch(0.75 0.14 162 / 0.16);
|
|
82
|
-
--warn-wash: oklch(0.82 0.14 80 / 0.16);
|
|
83
|
-
--down-wash: oklch(0.68 0.19 25 / 0.16);
|
|
84
|
-
|
|
85
|
-
--p-anthropic: oklch(0.74 0.12 48);
|
|
86
|
-
--p-openai: oklch(0.76 0.1 190);
|
|
87
|
-
--p-kimi: oklch(0.72 0.16 330);
|
|
88
|
-
--p-kilo: oklch(0.74 0.14 224);
|
|
89
|
-
--p-grok: oklch(0.74 0.14 125);
|
|
90
|
-
--p-custom: oklch(0.72 0.03 258);
|
|
91
|
-
|
|
92
|
-
--grid-line: oklch(0.94 0.006 250 / 0.045);
|
|
93
|
-
--shadow: 0 1px 2px oklch(0 0 0 / 0.3);
|
|
94
|
-
}
|
|
95
|
-
|
|
96
|
-
*,
|
|
97
|
-
*::before,
|
|
98
|
-
*::after {
|
|
99
|
-
box-sizing: border-box;
|
|
100
|
-
}
|
|
101
|
-
|
|
102
|
-
html,
|
|
103
|
-
body,
|
|
104
|
-
#root {
|
|
105
|
-
height: 100%;
|
|
106
|
-
}
|
|
107
|
-
|
|
108
|
-
html {
|
|
109
|
-
background: ${({theme:e})=>e.color.rack};
|
|
110
|
-
}
|
|
111
|
-
|
|
112
|
-
body {
|
|
113
|
-
margin: 0;
|
|
114
|
-
background: ${({theme:e})=>e.color.rack};
|
|
115
|
-
color: ${({theme:e})=>e.color.ink};
|
|
116
|
-
font-family: ${({theme:e})=>e.font.sans};
|
|
117
|
-
font-size: 14px;
|
|
118
|
-
line-height: 1.45;
|
|
119
|
-
-webkit-font-smoothing: antialiased;
|
|
120
|
-
}
|
|
121
|
-
|
|
122
|
-
h1, h2, h3, h4, p, figure, dl, dd {
|
|
123
|
-
margin: 0;
|
|
124
|
-
}
|
|
125
|
-
|
|
126
|
-
ul, ol {
|
|
127
|
-
margin: 0;
|
|
128
|
-
padding: 0;
|
|
129
|
-
list-style: none;
|
|
130
|
-
}
|
|
131
|
-
|
|
132
|
-
button, input, select, textarea {
|
|
133
|
-
font: inherit;
|
|
134
|
-
color: inherit;
|
|
135
|
-
}
|
|
136
|
-
|
|
137
|
-
a {
|
|
138
|
-
color: inherit;
|
|
139
|
-
text-decoration: none;
|
|
140
|
-
}
|
|
141
|
-
|
|
142
|
-
:focus-visible {
|
|
143
|
-
outline: 2px solid ${({theme:e})=>e.color.accent};
|
|
144
|
-
outline-offset: 1px;
|
|
145
|
-
border-radius: 2px;
|
|
146
|
-
}
|
|
147
|
-
|
|
148
|
-
::selection {
|
|
149
|
-
background: ${({theme:e})=>e.color.accentWash};
|
|
150
|
-
}
|
|
151
|
-
|
|
152
|
-
::-webkit-scrollbar {
|
|
153
|
-
width: 10px;
|
|
154
|
-
height: 10px;
|
|
155
|
-
}
|
|
156
|
-
|
|
157
|
-
::-webkit-scrollbar-track {
|
|
158
|
-
background: transparent;
|
|
159
|
-
}
|
|
160
|
-
|
|
161
|
-
::-webkit-scrollbar-thumb {
|
|
162
|
-
background: ${({theme:e})=>e.color.ruleStrong};
|
|
163
|
-
border: 3px solid transparent;
|
|
164
|
-
background-clip: padding-box;
|
|
165
|
-
border-radius: 6px;
|
|
166
|
-
}
|
|
167
|
-
|
|
168
|
-
@media (prefers-reduced-motion: reduce) {
|
|
169
|
-
*,
|
|
170
|
-
*::before,
|
|
171
|
-
*::after {
|
|
172
|
-
animation-duration: 0.01ms !important;
|
|
173
|
-
animation-iteration-count: 1 !important;
|
|
174
|
-
transition-duration: 0.01ms !important;
|
|
175
|
-
scroll-behavior: auto !important;
|
|
176
|
-
}
|
|
177
|
-
}
|
|
178
|
-
`,Or={color:{rack:`var(--rack)`,panel:`var(--panel)`,panelSunk:`var(--panel-sunk)`,panelRaised:`var(--panel-raised)`,rule:`var(--rule)`,ruleStrong:`var(--rule-strong)`,ink:`var(--ink)`,inkDim:`var(--ink-dim)`,inkFaint:`var(--ink-faint)`,accent:`var(--accent)`,accentInk:`var(--accent-ink)`,accentWash:`var(--accent-wash)`,ok:`var(--ok)`,warn:`var(--warn)`,down:`var(--down)`,okWash:`var(--ok-wash)`,warnWash:`var(--warn-wash)`,downWash:`var(--down-wash)`,shadow:`var(--shadow)`},provider:{anthropic:`var(--p-anthropic)`,openai:`var(--p-openai)`,kimi:`var(--p-kimi)`,kilo:`var(--p-kilo)`,grok:`var(--p-grok)`,custom:`var(--p-custom)`},font:{sans:`"Archivo Variable", ui-sans-serif, system-ui, sans-serif`,mono:`"Spline Sans Mono Variable", ui-monospace, "SF Mono", Menlo, monospace`},radius:{panel:`4px`,control:`3px`,chip:`2px`},space:e=>`${e*4}px`,z:{rail:20,chassis:30,overlay:40,dialog:50,toast:60}},kr=[`anthropic`,`openai`,`kimi`,`kilo`,`grok`,`custom`],Ar={anthropic:`Anthropic`,openai:`OpenAI`,kimi:`Kimi`,kilo:`Kilo`,grok:`Grok`,custom:`OpenAI Compatible`};function jr(e){return Or.provider[e]}var Mr=`omni-theme`;function Nr(e){return e===`light`||e===`dark`||e===`system`}function Pr(){try{let e=localStorage.getItem(Mr);return Nr(e)?e:`system`}catch{return`system`}}function Fr(){return typeof matchMedia==`function`&&matchMedia(`(prefers-color-scheme: dark)`).matches}function Ir(e){return e===`system`?Fr()?`dark`:`light`:e}function Lr(e){let t=document.documentElement;t.classList.toggle(`dark`,e===`dark`),t.dataset.theme=e}var Rr=Oe(null);function zr(){let e=ke(Rr);if(e===null)throw Error(`useTheme must be used inside <ThemeProvider>`);return e}function Br({children:e}){let[t,n]=Me(Pr),[r,i]=Me(()=>Ir(Pr())),a=Ae(e=>{n(e);try{localStorage.setItem(Mr,e)}catch{}},[]);return je(()=>{let e=Ir(t);i(e),Lr(e)},[t]),je(()=>{if(t!==`system`||typeof matchMedia!=`function`)return;let e=matchMedia(`(prefers-color-scheme: dark)`),n=()=>{let e=Fr()?`dark`:`light`;i(e),Lr(e)};return e.addEventListener(`change`,n),()=>e.removeEventListener(`change`,n)},[t]),k(Rr,{value:{mode:t,resolved:r,setMode:a},children:Pe(Le,{theme:Or,children:[k(Dr,{}),e]})})}var Vr,Hr=Er({isLoginRoute:()=>Vr.state.location.pathname===`/login`,onUnauthenticated:()=>void Vr.navigate({to:`/login`})});Vr=qn({routeTree:Tr,context:{queryClient:Hr}});var Ur=document.getElementById(`root`);if(Ur===null)throw Error(`#root is missing from index.html`);Fe(Ur).render(k(De,{children:k(Br,{children:k(Te,{client:Hr,children:k(Xn,{router:Vr})})})}));export{yr as a,jr as i,kr as n,lr as o,Ar as r,Q as s,zr as t};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import*as e from"react";var t=`__root__`,n=e.createContext(void 0),r=e.createContext(void 0);export{n,t as r,r as t};
|