omnigateway 0.14.0 → 0.15.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.
Files changed (50) hide show
  1. package/README.md +36 -1
  2. package/bin/omni.js +304 -41
  3. package/gateway.js +570 -44
  4. package/package.json +1 -1
  5. package/public/assets/{Chip-D0XSbQUr.js → Chip-C3dIFd8s.js} +1 -1
  6. package/public/assets/{CopyValue-DAlmkISB.js → CopyValue-DG88CWpN.js} +1 -1
  7. package/public/assets/{Field-DG1317zr.js → Field-EvdVyEqx.js} +30 -12
  8. package/public/assets/Lamp-CL0i4yaa.js +26 -0
  9. package/public/assets/{Rack-CDUOJkS2.js → Rack-DMrfn4-H.js} +5 -5
  10. package/public/assets/{RequestTable-i3TtCB9m.js → RequestTable-CtuuMOT2.js} +3 -3
  11. package/public/assets/{SummaryDeck-DrzTQQo5.js → SummaryDeck-DHsYYpYO.js} +2 -2
  12. package/public/assets/{Toggle-CdMD58sy.js → Toggle-BTie3NY8.js} +1 -1
  13. package/public/assets/{TokenBreakdown-BC6nqo1v.js → TokenBreakdown-Bf0zsKcd.js} +1 -1
  14. package/public/assets/{WindowChart-Bqbl-KFO.js → WindowChart-CaPUJ4GJ.js} +2 -2
  15. package/public/assets/_app.accounts-xCJhRd32.js +70 -0
  16. package/public/assets/{_app.console-BgA6_yPW.js → _app.console-DS37cfIu.js} +2 -2
  17. package/public/assets/_app.database-BCwEMrEA.js +24 -0
  18. package/public/assets/_app.index-DW6wain4.js +67 -0
  19. package/public/assets/_app.keys-CCU2NB3-.js +120 -0
  20. package/public/assets/_app.logs-CRC5qDK3.js +46 -0
  21. package/public/assets/_app.models-B4brzRdK.js +148 -0
  22. package/public/assets/{_app.plugins._pluginId-B825jp0T.js → _app.plugins._pluginId-CD9KXknf.js} +1 -1
  23. package/public/assets/_app.settings-NJSb_L2B.js +88 -0
  24. package/public/assets/_app.usage-BR6a92zI.js +78 -0
  25. package/public/assets/chevron-down-3tlYNJqZ.js +1 -0
  26. package/public/assets/chevron-right-kvaJRnfj.js +1 -0
  27. package/public/assets/client-B9t0CsmA.js +46 -0
  28. package/public/assets/{dist-BBGxva0Y.js → dist-B8iuo_hI.js} +1 -1
  29. package/public/assets/index-6rZSWe9j.js +14 -0
  30. package/public/assets/{login-BBURVBwb.js → login-NuwPF5SS.js} +2 -2
  31. package/public/assets/plus-CVqm87L-.js +1 -0
  32. package/public/assets/{preload-helper-B7KDmXJ9.js → preload-helper-1xe0b53X.js} +1 -1
  33. package/public/assets/{rotate-ccw-Do43Argv.js → rotate-ccw-Dionx_MW.js} +1 -1
  34. package/public/assets/{shared-DDpLUhCp.js → shared-HVgLEGgl.js} +2 -2
  35. package/public/assets/{trash-00950_yY.js → trash-Bsi60qJc.js} +1 -1
  36. package/public/index.html +4 -4
  37. package/public/assets/Lamp-Dk9XrTCg.js +0 -26
  38. package/public/assets/_app.accounts-2syjcpos.js +0 -70
  39. package/public/assets/_app.database-CqSoTi2l.js +0 -24
  40. package/public/assets/_app.index-BV1kJJjA.js +0 -67
  41. package/public/assets/_app.keys-CY65Ov9F.js +0 -107
  42. package/public/assets/_app.logs-PjRK5wqy.js +0 -46
  43. package/public/assets/_app.models-BfmeeB5e.js +0 -148
  44. package/public/assets/_app.settings-CdSQyweb.js +0 -88
  45. package/public/assets/_app.usage--5qFtU1W.js +0 -76
  46. package/public/assets/chevron-down-Bb5ZGvwk.js +0 -1
  47. package/public/assets/chevron-right-hwF5mD6-.js +0 -1
  48. package/public/assets/client-CkeRVeTV.js +0 -39
  49. package/public/assets/index-Ug93No6D.js +0 -14
  50. package/public/assets/plus-BgcHxxIr.js +0 -1
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "omnigateway",
3
- "version": "0.14.0",
3
+ "version": "0.15.0",
4
4
  "description": "Self-hosted AI gateway with Anthropic- and OpenAI-compatible APIs, an admin console, and a CLI",
5
5
  "license": "MIT",
6
6
  "author": "Harismawan <mail@harismawan.com>",
@@ -1,4 +1,4 @@
1
- import{w as e}from"./Rack-CDUOJkS2.js";import{jsx as t}from"react/jsx-runtime";import n from"styled-components";var r={neutral:{fg:`var(--ink-dim)`,bg:`transparent`},ok:{fg:`var(--ok)`,bg:`var(--ok-wash)`},warn:{fg:`var(--warn)`,bg:`var(--warn-wash)`},down:{fg:`var(--down)`,bg:`var(--down-wash)`},accent:{fg:`var(--accent)`,bg:`var(--accent-wash)`}},i=n.span`
1
+ import{w as e}from"./Rack-DMrfn4-H.js";import{jsx as t}from"react/jsx-runtime";import n from"styled-components";var r={neutral:{fg:`var(--ink-dim)`,bg:`transparent`},ok:{fg:`var(--ok)`,bg:`var(--ok-wash)`},warn:{fg:`var(--warn)`,bg:`var(--warn-wash)`},down:{fg:`var(--down)`,bg:`var(--down-wash)`},accent:{fg:`var(--accent)`,bg:`var(--accent-wash)`}},i=n.span`
2
2
  display: inline-flex;
3
3
  align-items: center;
4
4
  line-height: 1;
@@ -1,4 +1,4 @@
1
- import{A as e,T as t}from"./Panel-CsovmtxF.js";import{A as n}from"./Rack-CDUOJkS2.js";import{useCallback as r,useEffect as i,useRef as a,useState as o}from"react";import{jsx as s,jsxs as c}from"react/jsx-runtime";import l from"styled-components";var u={name:`check`,size:24,node:[[`path`,{d:`M20 6 9 17l-5-5`,key:`1gmf2c`}]]};u.node;var d=n(u),f={name:`copy`,size:24,node:[[`rect`,{width:`14`,height:`14`,x:`8`,y:`8`,rx:`2`,ry:`2`,key:`17jyea`}],[`path`,{d:`M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2`,key:`zix9uf`}]]};f.node;var p=n(f);function m(e){if(e===null||typeof getSelection!=`function`)return!1;let t=getSelection();if(t===null)return!1;try{let n=document.createRange();return n.selectNodeContents(e),t.removeAllRanges(),t.addRange(n),!0}catch{return!1}}async function h(e,t){if(typeof navigator<`u`&&navigator.clipboard!==void 0)try{return await navigator.clipboard.writeText(e),`copied`}catch{}let n=m(t??null);if(n&&typeof document.execCommand==`function`)try{if(document.execCommand(`copy`))return`copied`}catch{}return n?`selected`:`failed`}var g=l.div`
1
+ import{A as e,T as t}from"./Panel-CsovmtxF.js";import{A as n}from"./Rack-DMrfn4-H.js";import{useCallback as r,useEffect as i,useRef as a,useState as o}from"react";import{jsx as s,jsxs as c}from"react/jsx-runtime";import l from"styled-components";var u={name:`check`,size:24,node:[[`path`,{d:`M20 6 9 17l-5-5`,key:`1gmf2c`}]]};u.node;var d=n(u),f={name:`copy`,size:24,node:[[`rect`,{width:`14`,height:`14`,x:`8`,y:`8`,rx:`2`,ry:`2`,key:`17jyea`}],[`path`,{d:`M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2`,key:`zix9uf`}]]};f.node;var p=n(f);function m(e){if(e===null||typeof getSelection!=`function`)return!1;let t=getSelection();if(t===null)return!1;try{let n=document.createRange();return n.selectNodeContents(e),t.removeAllRanges(),t.addRange(n),!0}catch{return!1}}async function h(e,t){if(typeof navigator<`u`&&navigator.clipboard!==void 0)try{return await navigator.clipboard.writeText(e),`copied`}catch{}let n=m(t??null);if(n&&typeof document.execCommand==`function`)try{if(document.execCommand(`copy`))return`copied`}catch{}return n?`selected`:`failed`}var g=l.div`
2
2
  display: flex;
3
3
  align-items: stretch;
4
4
  gap: 0;
@@ -24,21 +24,39 @@ import{y as e}from"./Panel-CsovmtxF.js";import{useId as t}from"react";import{jsx
24
24
  &:disabled {
25
25
  opacity: 0.5;
26
26
  }
27
- `;i.textarea`
27
+ `,s=i.textarea`
28
28
  ${a}
29
- min-height: 72px;
29
+ min-height: 120px;
30
30
  padding: 6px 8px;
31
+ resize: vertical;
31
32
  background: ${({theme:e})=>e.color.panelSunk};
32
33
  border: 1px solid ${({theme:e})=>e.color.ruleStrong};
33
34
  color: ${({theme:e})=>e.color.ink};
34
- font-family: ${({theme:e})=>e.font.mono};
35
+ font-family: ${({theme:e})=>e.font.sans};
35
36
  font-size: 12px;
36
- resize: vertical;
37
- `;var s=i.select`
37
+ line-height: 1.5;
38
+
39
+ &:hover:not(:disabled) {
40
+ border-color: ${({theme:e})=>e.color.accent};
41
+ }
42
+
43
+ &:disabled {
44
+ opacity: 0.5;
45
+ }
46
+ `,c=i.select`
38
47
  ${a}
48
+ appearance: none;
39
49
  height: 30px;
40
- padding: 0 6px;
41
- background: ${({theme:e})=>e.color.panelSunk};
50
+ padding: 0 26px 0 8px;
51
+ background-color: ${({theme:e})=>e.color.panelSunk};
52
+ background-image:
53
+ linear-gradient(45deg, transparent 50%, ${({theme:e})=>e.color.inkDim} 50%),
54
+ linear-gradient(135deg, ${({theme:e})=>e.color.inkDim} 50%, transparent 50%);
55
+ background-position:
56
+ calc(100% - 15px) 50%,
57
+ calc(100% - 10px) 50%;
58
+ background-size: 5px 5px;
59
+ background-repeat: no-repeat;
42
60
  border: 1px solid ${({theme:e})=>e.color.ruleStrong};
43
61
  color: ${({theme:e})=>e.color.ink};
44
62
  font-family: ${({theme:e})=>e.font.mono};
@@ -48,18 +66,18 @@ import{y as e}from"./Panel-CsovmtxF.js";import{useId as t}from"react";import{jsx
48
66
  &:hover:not(:disabled) {
49
67
  border-color: ${({theme:e})=>e.color.accent};
50
68
  }
51
- `,c=i.div`
69
+ `,l=i.div`
52
70
  display: flex;
53
71
  flex-direction: column;
54
72
  gap: 4px;
55
73
  min-width: 0;
56
- `,l=i.p`
74
+ `,u=i.p`
57
75
  font-size: 11px;
58
76
  color: ${({theme:e})=>e.color.inkDim};
59
- `,u=i.p`
77
+ `,d=i.p`
60
78
  font-size: 11px;
61
79
  color: ${({theme:e})=>e.color.down};
62
- `;function d({label:i,hint:a,problem:o,children:s}){let d=t(),f=o===void 0?a===void 0?void 0:`${d}-hint`:`${d}-problem`;return r(c,{children:[n(e,{as:`label`,htmlFor:d,children:i}),s({id:d,"aria-describedby":f}),o===void 0?a===void 0?null:n(l,{id:`${d}-hint`,children:a}):n(u,{id:`${d}-problem`,children:o})]})}var f=i(o).attrs({type:`number`,inputMode:`decimal`})`
80
+ `;function f({label:i,hint:a,problem:o,children:s}){let c=t(),f=o===void 0?a===void 0?void 0:`${c}-hint`:`${c}-problem`;return r(l,{children:[n(e,{as:`label`,htmlFor:c,children:i}),s({id:c,"aria-describedby":f}),o===void 0?a===void 0?null:n(u,{id:`${c}-hint`,children:a}):n(d,{id:`${c}-problem`,children:o})]})}var p=i(o).attrs({type:`number`,inputMode:`decimal`})`
63
81
  text-align: right;
64
82
  padding-right: 6px;
65
- `;export{s as i,o as n,f as r,d as t};
83
+ `;export{s as a,c as i,o as n,p as r,f as t};
@@ -0,0 +1,26 @@
1
+ import{d as e,f as t,g as n,h as r,j as i,m as a,p as o,u as s}from"./Panel-CsovmtxF.js";import{queryOptions as c,useInfiniteQuery as l,useMutation as u,useQuery as d,useQueryClient as f}from"@tanstack/react-query";import*as p from"react";import m,{useCallback as h,useDebugValue as g,useEffect as _,useMemo as v,useRef as y,useSyncExternalStore as b}from"react";import{jsx as x}from"react/jsx-runtime";import S,{css as C,keyframes as w}from"styled-components";var T=p.use,E=p.useLayoutEffect;function ee(e,t,n){p.useEffect(()=>{if(!e.current||n||typeof IntersectionObserver!=`function`)return()=>t();let r=new IntersectionObserver(e=>{t(e.pop())},{rootMargin:`100px`});return r.observe(e.current),()=>{r.disconnect(),t()}},[t,n,e])}function te(e){let t=p.useRef(null);return p.useImperativeHandle(e,()=>t.current,[]),t}function D(e){return e[e.length-1]}function ne(e,t){return typeof e==`function`?e(t):e}var O=Object.prototype.hasOwnProperty,re=Object.prototype.propertyIsEnumerable;function ie(e){for(let t in e)if(O.call(e,t))return!0;return!1}var ae=()=>Object.create(null),oe=(e,t)=>se(e,t,ae);function se(e,t,n=()=>({}),r=0){if(e===t)return e;if(r>500)return t;let i=t,a=de(e)&&de(i);if(!a&&!(le(e)&&le(i)))return i;let o=a?e:ce(e);if(!o)return i;let s=a?i:ce(i);if(!s)return i;let c=o.length,l=s.length,u=a?Array(l):n(),d=0;for(let t=0;t<l;t++){let o=a?t:s[t],l=e[o],f=i[o];if(l===f){u[o]=l,(a?t<c:O.call(e,o))&&d++;continue}if(l===null||f===null||typeof l!=`object`||typeof f!=`object`){u[o]=f;continue}let p=se(l,f,n,r+1);u[o]=p,p===l&&d++}return c===l&&d===c?e:u}function ce(e){let t=Object.keys(e);if(t.length!==Object.getOwnPropertyNames(e).length)return!1;let n=Object.getOwnPropertySymbols(e);if(n.length===0)return t;for(let r of n){if(!re.call(e,r))return!1;t.push(r)}return t}function le(e){if(!ue(e))return!1;let t=e.constructor;if(t===void 0)return!0;let n=t.prototype;return!(!ue(n)||!n.hasOwnProperty(`isPrototypeOf`))}function ue(e){return Object.prototype.toString.call(e)===`[object Object]`}function de(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function k(e,t,n){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return!1;for(let r=0,i=e.length;r<i;r++)if(!k(e[r],t[r],n))return!1;return!0}if(le(e)&&le(t)){let r=n?.ignoreUndefined??!0;if(n?.partial){for(let i in t)if((!r||t[i]!==void 0)&&!k(e[i],t[i],n))return!1;return!0}let i=0;if(!r)i=Object.keys(e).length;else for(let t in e)e[t]!==void 0&&i++;let a=0;for(let o in t)if((!r||t[o]!==void 0)&&(a++,a>i||!k(e[o],t[o],n)))return!1;return i===a}return!1}function fe(e){return typeof e?.message==`string`?e.message.startsWith(`Failed to fetch dynamically imported module`)||e.message.startsWith(`error loading dynamically imported module`)||e.message.startsWith(`Importing a module script failed`):!1}var pe=/[\x00-\x1f\x7f"<>`{}]/g;function me(e){return e.replace(pe,e=>`%`+e.charCodeAt(0).toString(16).toUpperCase().padStart(2,`0`))}function he(e){let t;try{t=decodeURI(e)}catch{t=e.replaceAll(/%[0-9A-F]{2}/gi,e=>{try{return decodeURI(e)}catch{return e}})}return me(t)}var ge=[`http:`,`https:`,`mailto:`,`tel:`];function A(e){if(e[0]!==`/`&&e.includes(`:`))return/^[\x00-\x20]*([a-z][a-z\d+.\t\n\r-]*:)/i.exec(e)?.[1]?.replace(/[\t\n\r]/g,``).toLowerCase()}var j=/^[\x00-\x20]*[\\/][\t\n\r]*[\\/]/;function M(e,t){if(!e)return!1;if(j.test(e))return!0;let n=A(e);return n?!t.has(n):!1}function _e(e){if(!e)return e;let t=e;if(/[%\\\x00-\x1f\x7f]/.test(e)){let n=/%25|%5C/gi,r=0,i;for(t=``;(i=n.exec(e))!==null;)t+=he(e.slice(r,i.index))+i[0],r=n.lastIndex;t+=he(r?e.slice(r):e)}return t}function N(e){return/\s|[^\u0000-\u007F]/.test(e)?e.replace(/\s|[^\u0000-\u007F]/gu,encodeURIComponent):e}function P(e,t){if(e===t)return!0;if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(e[n]!==t[n])return!1;return!0}function F(){throw Error(`Invariant failed`)}function I(e){let t=new Map,n,r;return{get(e){let n=t.get(e);if(n)return n.visited=!0,n.value},set(i,a){let o=t.get(i);if(o){o.value=a;return}if(t.size>=e){let e=n?.next().value;for(;!e||e.visited;)e?e.visited=!1:n=t.values(),e=n.next().value;e===r&&(n=void 0),t.delete(e.key)}let s={key:i,value:a,visited:!1};r=s,t.set(i,s)},clear(){t.clear(),n=void 0,r=void 0}}}var L=4,R=5;function z(e,t,n=new Uint16Array(6)){let r=e.indexOf(`/`,t),i=r===-1?e.length:r,a=e.substring(t,i);if(!a||!a.includes(`$`))return n[0]=0,n[1]=t,n[2]=t,n[3]=i,n[4]=i,n[5]=i,n;if(a===`$`){let r=e.length;return n[0]=2,n[1]=t,n[2]=t,n[3]=r,n[4]=r,n[5]=r,n}if(a.charCodeAt(0)===36)return n[0]=1,n[1]=t,n[2]=t+1,n[3]=i,n[4]=i,n[5]=i,n;let o=a.indexOf(`{`),s;if(o!==-1&&o+1<a.length&&(s=a.indexOf(`}`,o))!==-1){let r=a.charCodeAt(o+1);if(r===45){if(o+2<a.length&&a.charCodeAt(o+2)===36){let e=o+3,r=s;if(e<r)return n[0]=3,n[1]=t+o,n[2]=t+e,n[3]=t+r,n[4]=t+s+1,n[5]=i,n}}else if(r===36){let r=o+1,a=o+2;return a===s?(n[0]=2,n[1]=t+o,n[2]=t+r,n[3]=t+a,n[4]=t+s+1,n[5]=e.length,n):(n[0]=1,n[1]=t+o,n[2]=t+a,n[3]=t+s,n[4]=t+s+1,n[5]=i,n)}}return n[0]=0,n[1]=t,n[2]=t,n[3]=i,n[4]=i,n[5]=i,n}function B(e,t,n,r,i,a,o,s){s?.(n);let c=r;{let r=n.fullPath??n.from,s=n.options,l=r.length,u=s?.caseSensitive??e,d=s?.params?.parse??s?.parseParams;for(;c<l;){let e=z(r,c,t),n,s=c,l=e[5];c=l+1,a++;let f=e[0];switch(f){case 0:{let t=r.substring(e[2],e[3]),o=t,s;u?s=i.static??=new Map:(o=t.toLowerCase(),s=i.staticInsensitive??=new Map);let c=s.get(o);if(c)n=c;else{let e=H(r);e.parent=i,e.depth=a,n=e,s.set(o,e)}break}case 1:case 3:case 2:{let t=r.substring(s,e[1]),c=r.substring(e[4],l),p=u&&!!(t||c);u||(t=t.toLowerCase(),c=c.toLowerCase());let m=f===1?i.dynamic:f===3?i.optional:i.wildcard,h=f!==2&&!d&&m?.find(e=>!e.parse&&e.caseSensitive===p&&e.prefix===t&&e.suffix===c);if(h)n=h;else{let e=U(f,r,p,t,c);n=e,e.parent=i,e.depth=a;let s;s=f===1?i.dynamic??=[]:f===3?i.optional??=[]:i.wildcard??=[],s.push(e),s.length===2&&o?.push(s)}break}}i=n}if(d&&n.children&&!n.isRoot&&n.id&&n.id.charCodeAt(n.id.lastIndexOf(`/`)+1)===95){let e=H(r);e.kind=R,e.parent=i,a++,e.depth=a,i.pathless??=[],i.pathless.push(e),i=e}let f=(n.path||!n.children)&&!n.isRoot;if(f&&r.endsWith(`/`)){let e=H(r);e.kind=L,e.parent=i,a++,e.depth=a,i.index=e,i=e}i.parse=d??null,i.priority=s?.params?.priority??0,f&&!i.route&&(i.route=n,i.fullPath=r)}if(n.children)for(let r of n.children)B(e,t,r,c,i,a,o,s)}function V(e,t){if(e.parse&&!t.parse)return-1;if(!e.parse&&t.parse)return 1;if(e.parse&&t.parse&&(e.priority||t.priority))return t.priority-e.priority;if(e.prefix&&t.prefix&&e.prefix!==t.prefix){if(e.prefix.startsWith(t.prefix))return-1;if(t.prefix.startsWith(e.prefix))return 1}if(e.suffix&&t.suffix&&e.suffix!==t.suffix){if(e.suffix.endsWith(t.suffix))return-1;if(t.suffix.endsWith(e.suffix))return 1}return e.prefix&&!t.prefix?-1:!e.prefix&&t.prefix?1:e.suffix&&!t.suffix?-1:!e.suffix&&t.suffix?1:e.caseSensitive&&!t.caseSensitive?-1:!e.caseSensitive&&t.caseSensitive?1:0}function H(e){return{kind:0,depth:0,pathless:null,index:null,static:null,staticInsensitive:null,dynamic:null,optional:null,wildcard:null,route:null,fullPath:e,parent:null,parse:null,priority:0}}function U(e,t,n,r,i){return{kind:e,depth:0,pathless:null,index:null,static:null,staticInsensitive:null,dynamic:null,optional:null,wildcard:null,route:null,fullPath:t,parent:null,parse:null,priority:0,caseSensitive:n,prefix:r,suffix:i}}function ve(e,t){let n=H(`/`),r=new Uint16Array(6),i=[];for(let t of e)B(!1,r,t,1,n,0,i);for(let e of i)e.sort(V);t.masksTree=n,t.flatCache=I(1e3)}function W(e,t){e||=`/`;let n=t.flatCache.get(e);if(n!==void 0)return n;let r=Ce(e,t.masksTree);return t.flatCache.set(e,r),r}function ye(e,t,n,r,i){e||=`/`,r||=`/`;let a=t?`case\0${e}`:e,o=i.singleCache.get(a);return o||(o=H(`/`),B(t,new Uint16Array(6),{from:e},1,o,0),i.singleCache.set(a,o)),Ce(r,o,n)}function be(e,t,n=!1){let r=n?e:`nofuzz\0${e}`,i=t.matchCache.get(r);if(i!==void 0)return i;e||=`/`;let a;try{a=Ce(e,t.segmentTree,n)}catch(e){if(e instanceof URIError)a=null;else throw e}return a&&(a.branch=Te(a.route)),t.matchCache.set(r,a),a}function xe(e){return e===`/`?e:e.replace(/\/{1,}$/,``)}function Se(e,t=!1,n){let r=H(e.fullPath),i=new Uint16Array(6),a=[],o={},s={},c=0;B(t,i,e,1,r,0,a,e=>{if(n?.(e,c),e.id in o&&F(),o[e.id]=e,c!==0&&e.path){let t=xe(e.fullPath);(!s[t]||e.fullPath.endsWith(`/`))&&(s[t]=e)}c++});for(let e of a)e.sort(V);return{processedTree:{segmentTree:r,singleCache:I(1e3),matchCache:I(1e3),flatCache:null,masksTree:null},routesById:o,routesByPath:s}}function Ce(e,t,n=!1){let r=e.split(`/`),i=De(e,r,t,n);if(!i)return null;let[a]=we(e,r,i);return{route:i.node.route,rawParams:a}}function we(e,t,n){let r=Ee(n.node),i=null,a=Object.create(null),o=n.extract?.part??0,s=n.extract?.node??0,c=n.extract?.path??0,l=n.extract?.segment??0;for(;s<r.length;o++,s++,c++,l++){let u=r[s];if(u.kind===L)break;if(u.kind===R){l--,o--,c--;continue}let d=t[o],f=c;if(d&&(c+=d.length),u.kind===1){i??=n.node.fullPath.split(`/`);let e=i[l],t=u.prefix.length;if(e.charCodeAt(t)===123){let n=u.suffix.length,r=e.substring(t+2,e.length-n-1),i=d.substring(t,d.length-n);a[r]=decodeURIComponent(i)}else{let t=e.substring(1);a[t]=decodeURIComponent(d)}}else if(u.kind===3){if(n.skipped&1<<s){o--,c=f-1;continue}i??=n.node.fullPath.split(`/`);let e=i[l],t=u.prefix.length,r=u.suffix.length,p=e.substring(t+3,e.length-r-1),m=u.suffix||u.prefix?d.substring(t,d.length-r):d;m&&(a[p]=decodeURIComponent(m))}else if(u.kind===2){let t=u,n=e.substring(f+t.prefix.length,e.length-t.suffix.length),r=decodeURIComponent(n);a[`*`]=r,a._splat=r;break}}return n.rawParams&&Object.assign(a,n.rawParams),[a,{part:o,node:s,path:c,segment:l}]}function Te(e){let t=[e];for(;e.parentRoute;)e=e.parentRoute,t.push(e);return t.reverse(),t}function Ee(e){let t=Array(e.depth+1);do t[e.depth]=e,e=e.parent;while(e);return t}function De(e,t,n,r){if(e===`/`&&n.index)return{node:n.index,skipped:0};let i=!D(t),a=i&&e!==`/`,o=t.length-+!!i,s=[{node:n,index:1,skipped:0,statics:0,dynamics:0,optionals:0}],c=null,l=null;for(;s.length;){let n=s.pop(),{node:i,index:u,skipped:d,statics:f,dynamics:p,optionals:m}=n,{extract:h,rawParams:g}=n;if(i.kind===2&&i.route&&!Ae(l,n))continue;if(i.parse){if(!ke(e,t,n))continue;g=n.rawParams,h=n.extract}r&&i.route&&i.kind!==L&&Ae(c,n)&&(c=n);let _=u===o;if(_&&(i.route&&(!a||i.kind===L||i.kind===2)&&Ae(l,n)&&(l=n),!i.optional&&!i.wildcard&&!i.index&&!i.pathless))continue;let v=_?void 0:t[u],y;if(_&&i.index){let n={node:i.index,index:u,skipped:d,statics:f,dynamics:p,optionals:m,extract:h,rawParams:g},r=!0;if(i.index.parse&&(ke(e,t,n)||(r=!1)),r){if(!p&&!m&&!d&&Oe(f,o))return n;Ae(l,n)&&(l=n)}}if(i.wildcard)for(let e=i.wildcard.length-1;e>=0;e--){let n=i.wildcard[e],{prefix:r,suffix:a}=n;if(!r||!_&&(n.caseSensitive?v:y??=v.toLowerCase()).startsWith(r)){if(a){if(_)continue;let e=t.slice(u).join(`/`),i=e.slice(-a.length);if((n.caseSensitive?i:i.toLowerCase())!==a||e.length-a.length<r.length)continue}s.push({node:n,index:o,skipped:d,statics:f,dynamics:p,optionals:m,extract:h,rawParams:g})}}if(i.optional){let e=d|1<<i.depth+1;for(let t=i.optional.length-1;t>=0;t--){let n=i.optional[t];s.push({node:n,index:u,skipped:e,statics:f,dynamics:p,optionals:m,extract:h,rawParams:g})}if(!_)for(let e=i.optional.length-1;e>=0;e--){let t=i.optional[e],{prefix:n,suffix:r}=t;if(n||r){let e=t.caseSensitive?v:y??=v.toLowerCase();if(n&&!e.startsWith(n)||r&&e.indexOf(r,e.length-r.length)<n.length)continue}s.push({node:t,index:u+1,skipped:d,statics:f,dynamics:p,optionals:m+G(o,u),extract:h,rawParams:g})}}if(!_&&i.dynamic&&v)for(let e=i.dynamic.length-1;e>=0;e--){let t=i.dynamic[e],{prefix:n,suffix:r}=t;if(n||r){let e=t.caseSensitive?v:y??=v.toLowerCase();if(n&&!e.startsWith(n)||r&&e.indexOf(r,e.length-r.length)<n.length)continue}s.push({node:t,index:u+1,skipped:d,statics:f,dynamics:p+G(o,u),optionals:m,extract:h,rawParams:g})}if(!_&&i.staticInsensitive){let e=i.staticInsensitive.get(y??=v.toLowerCase());e&&s.push({node:e,index:u+1,skipped:d,statics:f+G(o,u),dynamics:p,optionals:m,extract:h,rawParams:g})}if(!_&&i.static){let e=i.static.get(v);e&&s.push({node:e,index:u+1,skipped:d,statics:f+G(o,u),dynamics:p,optionals:m,extract:h,rawParams:g})}if(i.pathless)for(let e=i.pathless.length-1;e>=0;e--){let t=i.pathless[e];s.push({node:t,index:u,skipped:d,statics:f,dynamics:p,optionals:m,extract:h,rawParams:g})}}if(l)return l;if(r&&c){let n=c.index;for(let e=0;e<c.index;e++)n+=t[e].length;let r=n===e.length?`/`:e.slice(n);return c.rawParams??=Object.create(null),c.rawParams[`**`]=decodeURIComponent(r),c}return null}function G(e,t){return 2**(e-t-1)}function Oe(e,t){return e===2**(t-1)-1}function ke(e,t,n){let r,i;try{[r,i]=we(e,t,n)}catch{return null}if(n.rawParams=r,n.extract=i,!n.node.parse)return!0;try{if(n.node.parse(r)===!1)return null}catch{}return!0}function Ae(e,t){return!e||t.statics>e.statics||t.statics===e.statics&&(t.dynamics>e.dynamics||t.dynamics===e.dynamics&&(t.optionals>e.optionals||t.optionals===e.optionals&&((t.node.kind===L)>(e.node.kind===L)||t.node.kind===L==(e.node.kind===L)&&t.node.depth>e.node.depth)))}function je(e){return Me(e.filter(e=>e!==void 0).join(`/`))}function Me(e){return e.replace(/\/{2,}/g,`/`)}function Ne(e){return e===`/`?e:e.replace(/^\/{1,}/,``)}function Pe(e){let t=e.length;return t>1&&e[t-1]===`/`?e.replace(/\/{1,}$/,``):e}function Fe(e){return Pe(Ne(e))}function Ie(e,t){return e?.endsWith(`/`)&&e!==`/`&&e!==`${t}/`?e.slice(0,-1):e}function Le({base:e,to:t,trailingSlash:n=`never`,cache:r}){if(t.includes(`//`)&&(t=Me(t)),t.startsWith(`/`))return t.length===1||n===`preserve`?t:n===`always`?t.endsWith(`/`)?t:`${t}/`:t.endsWith(`/`)?t.slice(0,-1):t;let i=t===`.`,a;if(r){a=i?e:e+`\0`+t;let n=r.get(a);if(n)return n}let o;if(i)o=e.split(`/`);else{for(e.includes(`//`)&&(e=Me(e)),o=e.split(`/`);o.length>1&&D(o)===``;)o.pop();let n=t.split(`/`);for(let e=0,t=n.length;e<t;e++){let r=n[e];r===``?e?e===t-1&&o.push(r):o=[r]:r===`..`?o.length>1?o.pop():o=[``]:r===`.`||o.push(r)}}o.length>1&&(D(o)===``?n===`never`&&o.pop():n===`always`&&o.push(``));let s=o.join(`/`),c=(i?Me(s):s)||`/`;return a&&r&&r.set(a,c),c}function Re(e){let t=new Map(e.map(e=>[encodeURIComponent(e),e])),n=Array.from(t.keys()).map(e=>e.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`)).join(`|`),r=new RegExp(n,`g`);return e=>e.replace(r,e=>t.get(e)??e)}function ze(e,t,n){let r=t[e];return typeof r==`string`?e===`_splat`?/^[a-zA-Z0-9\-._~!/]*$/.test(r)?r:r.split(`/`).map(e=>Ve(e,n)).join(`/`):Ve(r,n):r}function Be({path:e,params:t,decoder:n,...r}){let i=!1,a=Object.create(null);if(!e||e===`/`)return{interpolatedPath:`/`,usedParams:a,isMissingParams:i};if(!e.includes(`$`))return{interpolatedPath:e,usedParams:a,isMissingParams:i};let o=e.length,s=0,c,l=``;for(;s<o;){let r=s;c=z(e,r,c);let o=c[5];if(s=o+1,r===o)continue;let u=c[0];if(u===0){l+=`/`+e.substring(r,o);continue}if(u===2){let s=t._splat;a._splat=s,a[`*`]=s;let u=e.substring(r,c[1]),d=e.substring(c[4],o);if(!s){i=!0,(u||d)&&(l+=`/`+u+d);continue}let f=ze(`_splat`,t,n);l+=`/`+u+f+d;continue}if(u===1){let s=e.substring(c[2],c[3]);!i&&!(s in t)&&(i=!0),a[s]=t[s];let u=e.substring(r,c[1]),d=e.substring(c[4],o),f=ze(s,t,n)??`undefined`;l+=`/`+u+f+d;continue}if(u===3){let i=e.substring(c[2],c[3]),s=t[i];if(s==null)continue;a[i]=s;let u=e.substring(r,c[1]),d=e.substring(c[4],o),f=ze(i,t,n)??``;l+=`/`+u+f+d;continue}}return e.endsWith(`/`)&&(l+=`/`),{usedParams:a,interpolatedPath:l||`/`,isMissingParams:i}}function Ve(e,t){let n=encodeURIComponent(e);return t?.(n)??n}var He=`Error preloading route! ☝️`;function Ue({children:e,fallback:t=null}){return x(m.Fragment,{children:We()?e:t})}function We(){return m.useSyncExternalStore(Ge,()=>!0,()=>!1)}function Ge(){return()=>{}}function Ke(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}var qe=typeof Object.is==`function`?Object.is:Ke;function Je(e,t,n,r,i){let a=y(null),o;a.current===null?(o={hasValue:!1,value:null},a.current=o):o=a.current;let[s,c]=v(()=>{let e=!1,a,s,c=t=>{if(!e){e=!0,a=t;let n=r(t);if(i!==void 0&&o.hasValue){let e=o.value;if(i(e,n))return s=e,e}return s=n,n}let n=s;if(qe(a,t))return n;let c=r(t);return i?.(n,c)?(a=t,n):(a=t,s=c,c)},l=n===void 0?null:n;return[()=>c(t()),l===null?void 0:()=>c(l())]},[t,n,r,i,o]),l=b(e,s,c);return _(()=>{o.hasValue=!0,o.value=l},[l,o]),g(l),l}function Ye(e,t){return e===t}function Xe(e,t,n=Ye){let r=h(t=>{if(!e)return()=>{};let{unsubscribe:n}=e.subscribe(t);return n},[e]),i=h(()=>e?.get(),[e]);return Je(r,i,i,t,n)}function Ze(e){let t=i();return p.useCallback(n=>t.navigate({...n,from:n.from??e?.from}),[e?.from,t])}function Qe(e){let t=p.useRef(e);return k(t.current,e,{ignoreUndefined:!1})||(t.current=e),t.current}function $e(e,t){return e[0]===t[0]&&e[1]===t[1]}function et(e,t){let n=typeof e==`string`&&A(e);if(n)return t.has(n)?e:null}function tt(e,t,n,r,i){let a=Ie(e.pathname,r),o=Ie(t.pathname,r);return(n?.exact?a!==o:!a.startsWith(o)||a.length!==o.length&&a[o.length]!==`/`)||(n?.includeSearch??!0)&&!k(e.search,t.search,{partial:!n?.exact,ignoreUndefined:!n?.explicitUndefined})?!1:!n?.includeHash||i&&e.hash===t.hash}function nt(e,t){let n=i(),r=te(t),{activeProps:a,inactiveProps:o,activeOptions:s,to:c,preload:l,preloadDelay:u,preloadIntentProximity:d,hashScrollIntoView:f,replace:m,startTransition:h,resetScroll:g,viewTransition:_,children:v,target:y,disabled:b,style:x,className:S,onClick:C,onBlur:w,onFocus:T,onMouseEnter:E,onMouseLeave:D,onTouchStart:O,ignoreBlocker:re,params:ie,search:ae,hash:oe,state:se,mask:ce,reloadDocument:le,unsafeRelative:ue,from:de,_fromLocation:k,...fe}=e,pe=c,me=We(),he=Qe(e.search),ge=Qe(e.params),j=Qe(s),M=p.useMemo(()=>e,[n,e.from,e._fromLocation,e.hash,e.to,he,ge,e.state,e.mask,e.unsafeRelative]),_e=p.useCallback(e=>{let t=et(pe,n.protocolAllowlist);if(t!==void 0)return[t??void 0];let r=n.buildLocation({_fromLocation:e,...M}),i=ct(r,n,b);return[i,!b&&(!i||A(i))?void 0:tt(e,r,j,n.basepath,me)]},[j,b,me,M,n,pe]),[N,P]=Xe(n.stores.location,_e,$e),F=P===void 0?N:void 0,I=b||N===void 0,L=p.useRef(!1),R=e.reloadDocument||F||I?!1:l??n.options.defaultPreload,z=u??n.options.defaultPreloadDelay??0,B=p.useCallback(()=>{n.preloadRoute(M).catch(e=>{console.warn(e),console.warn(He)})},[n,M]),V=p.useCallback(e=>{if(!e){st(r);return}if(!(e.isIntersecting??R===`intent`)){e.isIntersecting===!1&&st(r);return}if(!z){B();return}K.has(r)||K.set(r,setTimeout(()=>{K.delete(r),B()},z))},[B,r,R,z]);if(ee(r,V,R!==`viewport`),p.useEffect(()=>{L.current||R===`render`&&(B(),L.current=!0)},[B,R]),F)return{...fe,ref:r,href:F,...v&&{children:v},...y&&{target:y},...b&&{disabled:b},...x&&{style:x},...S&&{className:S},...C&&{onClick:C},...w&&{onBlur:w},...T&&{onFocus:T},...E&&{onMouseEnter:E},...D&&{onMouseLeave:D},...O&&{onTouchStart:O}};let H=ne(P?a:o,{})??(P?it:rt),U=H.className,ve=S?U?`${S} ${U}`:S:U,W=H.style,ye=x&&W?{...x,...W}:x||W,be=e=>{let t=e.currentTarget.getAttribute(`target`),r=y===void 0?t:y;!I&&!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)&&!e.defaultPrevented&&(!r||r===`_self`)&&e.button===0&&(e.preventDefault(),n.navigate({...M,replace:m,resetScroll:g,hashScrollIntoView:f,startTransition:h,viewTransition:_,ignoreBlocker:re}))},xe=()=>{R===`intent`&&B()},Se=()=>{R===`intent`&&st(r)};return{...fe,...H,href:N,ref:r,onClick:q(C,be),onBlur:q(w,Se),onFocus:q(T,V),onMouseEnter:q(E,V),onMouseLeave:q(D,Se),onTouchStart:q(O,xe),disabled:!!I,target:y,...ye&&{style:ye},...ve&&{className:ve},...I&&at,...P&&ot}}var rt={},it={className:`active`},at={role:`link`,"aria-disabled":!0},ot={"data-status":`active`,"aria-current":`page`},K=new WeakMap,st=e=>{clearTimeout(K.get(e)),K.delete(e)},q=(e,t)=>e?n=>n.defaultPrevented||(e(n),n.defaultPrevented||t(n)):t;function ct(e,t,n){if(n)return;let r=e.maskedLocation??e,i=r.external?r.publicHref:t.history.createHref(r.publicHref)||`/`;if(!r.external&&i===r.publicHref||!M(i,t.protocolAllowlist))return i}var lt=p.forwardRef((e,t)=>{let{_asChild:n,...r}=e,{type:i,...a}=nt(r,t),o=typeof r.children==`function`?r.children({isActive:a[`data-status`]===`active`}):r.children;if(!n){let{disabled:e,...t}=a;a=t}return p.createElement(n||`a`,a,o)}),ut=[`since`,`until`,`state`,`failed`,`provider`,`requestedModel`,`resolvedModel`,`model`,`credentialId`,`apiKeyId`,`errorCode`],dt=e=>JSON.stringify(ut.map(t=>e[t]??null)),ft=e=>{let t={};for(let n of ut){let r=e[n];r!==void 0&&r!==``&&(t[n]=r)}return t},J={status:[`status`],credentials:[`credentials`],credentialHealth:[`credentials`,`health`],models:[`models`],keys:[`keys`],settings:[`settings`],agentSetup:(e,t)=>[`agent-setup`,e,t??null],usage:e=>[`usage`,e.grain??`raw`,e.groupBy,e.splitBy??null,e.since,e.until??null,e.credentialId??null,e.apiKeyId??null],quotaHistory:e=>[`quota-history`,e.credentialId,e.since,e.until??null],logs:e=>[`logs`,e],logPages:(e,t)=>[`logPages`,t,dt(e)],requestBody:e=>[`logs`,`body`,e],clientSummary:[`client`,`summary`],clientUsage:e=>[`client`,`usage`,e.grain??`raw`,e.groupBy,e.splitBy??null,e.since,e.until??null],clientLogs:e=>[`client`,`logs`,e],clientLogPages:(e,t)=>[`client`,`logPages`,t,dt(e)],clientQuota:[`client`,`quota`],clientQuotaHistory:e=>[`client`,`quota-history`,e.since,e.until??null],console:(e,t,n)=>[`console`,e,t,n],nodes:[`nodes`],database:[`database`],snapshots:[`database`,`snapshots`],lifecycle:[`lifecycle`],plugins:[`plugins`],catalog:[`catalog`]},pt=c({queryKey:J.catalog,queryFn:async({signal:t})=>{let{providers:n}=await e(`/api/catalog`,t);return[...n].sort((e,t)=>e.order-t.order)},staleTime:3e5});function mt(){return d(pt)}function ht(e,t){return e.find(e=>e.id===t)}function gt(){return d({queryKey:J.status,queryFn:({signal:t})=>e(`/api/status`,t),staleTime:3e4})}function _t(){return d({queryKey:J.credentials,queryFn:async({signal:t})=>(await e(`/api/credentials`,t)).credentials})}function vt(t=1e4){return d({queryKey:J.credentialHealth,queryFn:({signal:t})=>e(`/api/credentials/health`,t),refetchInterval:t})}function yt(t,r=!0){return d({queryKey:J.quotaHistory(t),enabled:r,queryFn:({signal:r})=>e(n(`/api/credentials/quota/history`,{credentialId:t.credentialId,since:t.since,...t.until===void 0?{}:{until:t.until}}),r),refetchInterval:!1})}function bt(){return d({queryKey:J.models,queryFn:async({signal:t})=>(await e(`/api/models`,t)).models})}function xt(){return d({queryKey:J.keys,queryFn:async({signal:t})=>(await e(`/api/keys`,t)).keys})}var St={queryKey:J.settings,queryFn:({signal:t})=>e(`/api/settings`,t)};function Ct(){return d({...St,select:e=>e.settings})}function wt(){return d({...St,select:e=>e.bodyLoggingAllowed&&e.settings.bodyLoggingEnabled})}function Tt(){return d({...St,select:e=>e.bodyLoggingAllowed})}function Et(){return d({...St,select:e=>e.dayOffsetMinutes??null})}function Dt(t,r){return d({queryKey:J.agentSetup(t,r),enabled:r!==void 0,queryFn:async({signal:i})=>(await e(n(`/api/agent-setup`,{client:t,...r??{}}),i)).files})}function Ot(t,r=6e4){return d({queryKey:J.usage(t),queryFn:async({signal:r})=>(await e(n(`/api/usage`,{groupBy:t.groupBy,since:t.since,...t.grain===void 0?{}:{grain:t.grain},...t.splitBy===void 0?{}:{splitBy:t.splitBy},...t.until===void 0?{}:{until:t.until},...t.credentialId===void 0?{}:{credentialId:t.credentialId},...t.apiKeyId===void 0?{}:{apiKeyId:t.apiKeyId}}),r)).rows,refetchInterval:r})}var Y=2e3;function kt(t=100,r=Y){return d({queryKey:J.logs(t),queryFn:async({signal:r})=>(await e(n(`/api/logs`,{limit:t}),r)).logs,refetchInterval:r})}function At(e){if(e===void 0)return!0;let t=e?.pages;return!Array.isArray(t)||t.length<=1}function jt(e){let t=f();return()=>{t.cancelQueries({queryKey:e}).then(()=>{t.setQueryData(e,e=>e===void 0?e:{pages:e.pages.slice(0,1),pageParams:e.pageParams.slice(0,1)})})}}function Mt(t,r=100,i=Y){return l({queryKey:J.logPages(t,r),initialPageParam:null,queryFn:async({pageParam:i,signal:a})=>{let o=await e(n(`/api/logs`,{...ft(t),limit:r,...i===null?{}:{cursor:i}}),a);return{logs:o.logs,nextCursor:o.nextCursor??null}},getNextPageParam:e=>e.nextCursor,refetchInterval:e=>At(e.state.data)?i:!1})}function Nt(t){return d({queryKey:J.requestBody(t??``),enabled:t!==null,queryFn:({signal:n})=>e(`/api/requests/${encodeURIComponent(t??``)}/body`,n),refetchInterval:!1})}var Pt=5e3;function Ft(t=200,r=``,i=Pt,a=``){return d({queryKey:J.console(t,r,a),queryFn:async({signal:i})=>e(n(`/api/console`,{lines:t,...r===``?{}:{level:r},...a===``?{}:{node:a}}),i),refetchInterval:i})}var It=3e4;function Lt(){return d({queryKey:J.nodes,queryFn:async({signal:t})=>e(`/api/nodes`,t),refetchInterval:It})}function Rt(){return d({queryKey:J.database,queryFn:({signal:t})=>e(`/api/database`,t),refetchInterval:!1,refetchOnWindowFocus:!1,staleTime:1/0})}function zt(e){return`/api/database/snapshots/${encodeURIComponent(e)}/download`}function Bt(){return d({queryKey:J.snapshots,queryFn:async({signal:t})=>(await e(`/api/database/snapshots`,t)).snapshots,refetchInterval:!1})}function X(e){e.invalidateQueries({queryKey:J.database})}function Vt(){let e=f();return u({mutationFn:()=>o(`/api/database/snapshots`),onSuccess:()=>X(e)})}function Ht(){let e=f();return u({mutationFn:e=>a(`/api/database/retention`,e),onSuccess:()=>{X(e),e.invalidateQueries({queryKey:J.settings})}})}function Ut(){let e=f();return u({mutationFn:()=>o(`/api/database/vacuum`),onSuccess:()=>X(e)})}function Wt(){let e=f();return u({mutationFn:()=>s(`/api/database/bodies`),onSuccess:()=>{X(e),e.invalidateQueries({queryKey:[`logs`]})}})}function Gt(){let e=f();return u({mutationFn:e=>s(`/api/database/snapshots/${encodeURIComponent(e)}`),onSuccess:()=>X(e)})}function Kt(){return u({mutationFn:e=>o(`/api/database/snapshots/${encodeURIComponent(e)}/restore`)})}function qt(){return u({mutationFn:e=>o(`/api/database/import`,e)})}function Jt(){return d({queryKey:J.lifecycle,queryFn:({signal:t})=>e(`/api/lifecycle`,t),refetchInterval:!1})}function Yt(){return u({mutationFn:()=>o(`/api/lifecycle/restart`)})}function Xt(){return u({mutationFn:()=>o(`/api/lifecycle/shutdown`)})}function Zt(){let e=f();return u({mutationFn:({mode:e,secret:t})=>e===`client`?o(`/api/client/login`,{key:t}):o(`/api/login`,{password:t,...e===`viewer`?{mode:`viewer`}:{}}),onSuccess:()=>e.invalidateQueries()})}function Qt(){let e=f();return u({mutationFn:e=>o(`/api/setup`,{password:e}),onSuccess:()=>e.invalidateQueries()})}function $t(){let e=f();return u({mutationFn:()=>o(`/api/logout`),onSuccess:()=>{e.clear()}})}function en(){let e=f();return u({mutationFn:()=>o(`/api/client/logout`),onSuccess:()=>e.clear()})}var tn={queryKey:J.clientSummary,queryFn:({signal:t})=>e(`/api/client/summary`,t)};function nn(){return d(tn)}function rn(){return d({...tn,select:e=>e.dayOffsetMinutes??null})}function an(t,r=6e4){return d({queryKey:J.clientUsage(t),queryFn:({signal:r})=>e(n(`/api/client/usage`,{groupBy:t.groupBy,since:t.since,...t.grain===void 0?{}:{grain:t.grain},...t.splitBy===void 0?{}:{splitBy:t.splitBy},...t.until===void 0?{}:{until:t.until}}),r),refetchInterval:r})}function on(t=100,r=Y){return d({queryKey:J.clientLogs(t),queryFn:async({signal:r})=>(await e(n(`/api/client/logs`,{limit:t}),r)).logs,refetchInterval:r})}function sn(t,r=100,i=Y){return l({queryKey:J.clientLogPages(t,r),initialPageParam:null,queryFn:async({pageParam:i,signal:a})=>{let{credentialId:o,apiKeyId:s,...c}=t,l=await e(n(`/api/client/logs`,{...ft(c),limit:r,...i===null?{}:{cursor:i}}),a);return{logs:l.logs,nextCursor:l.nextCursor??null}},getNextPageParam:e=>e.nextCursor,refetchInterval:e=>At(e.state.data)?i:!1})}function cn(t=6e4){return d({queryKey:J.clientQuota,queryFn:async({signal:t})=>(await e(`/api/client/quota`,t)).accounts,refetchInterval:t})}function ln(t,r=!0){return d({queryKey:J.clientQuotaHistory(t),enabled:r,queryFn:({signal:r})=>e(n(`/api/client/quota/history`,{since:t.since,...t.until===void 0?{}:{until:t.until}}),r),refetchInterval:3e5})}function un(){let e=f();return u({mutationFn:({id:e,patch:n})=>t(`/api/credentials/${e}`,n),onSuccess:()=>{e.invalidateQueries({queryKey:J.credentials}),e.invalidateQueries({queryKey:J.credentialHealth})}})}function dn(){return gt().data?.principal?.kind===`admin`}function fn(){let e=f();return u({mutationFn:e=>o(`/api/credentials/quota/refresh`,e),onSuccess:()=>{e.invalidateQueries({queryKey:J.credentialHealth}),e.invalidateQueries({queryKey:[`quota-history`]})}})}function pn(t){return d({queryKey:[`credentials`,`resets`,t],queryFn:({signal:n})=>e(`/api/credentials/${t}/resets`,n),enabled:t!==null,staleTime:0})}function mn(){let e=f();return u({mutationFn:({credentialId:e,creditId:t})=>o(`/api/credentials/${e}/resets/redeem`,{creditId:t}),onSuccess:()=>{e.invalidateQueries({queryKey:J.credentialHealth}),e.invalidateQueries({queryKey:[`quota-history`]}),e.invalidateQueries({queryKey:[`credentials`,`resets`]})}})}function hn(){let e=f();return u({mutationFn:e=>s(`/api/credentials/${e}`),onSuccess:()=>{e.invalidateQueries({queryKey:J.credentials}),e.invalidateQueries({queryKey:J.credentialHealth})}})}function gn(){let e=f();return u({mutationFn:e=>a(`/api/models/${encodeURIComponent(e.id)}`,e),onSuccess:()=>e.invalidateQueries({queryKey:J.models})})}function _n(){let e=f();return u({mutationFn:e=>s(`/api/models/${encodeURIComponent(e)}`),onSuccess:()=>e.invalidateQueries({queryKey:J.models})})}function vn(){return u({mutationFn:({modelId:e,need:t})=>o(`/api/models/${encodeURIComponent(e)}/dry-run`,t)})}function yn(){let e=f();return u({mutationFn:e=>o(`/api/keys`,e),onSuccess:()=>e.invalidateQueries({queryKey:J.keys})})}function bn(){let e=f();return u({mutationFn:({id:e,limits:t})=>a(`/api/keys/${e}/limits`,{limits:t}),onSuccess:()=>e.invalidateQueries({queryKey:J.keys})})}function xn(){let e=f();return u({mutationFn:({id:e,modelAllowlist:t})=>a(`/api/keys/${e}/models`,{modelAllowlist:t}),onSuccess:()=>e.invalidateQueries({queryKey:J.keys})})}function Sn(){let e=f();return u({mutationFn:({id:e,expiresAt:t})=>a(`/api/keys/${e}/expiry`,{expiresAt:t}),onSuccess:()=>e.invalidateQueries({queryKey:J.keys})})}function Cn(){let e=f();return u({mutationFn:({id:e,policy:t})=>a(`/api/keys/${e}/guardrail`,{policy:t}),onSuccess:()=>e.invalidateQueries({queryKey:J.keys})})}function wn(){let e=f();return u({mutationFn:e=>s(`/api/keys/${e}`),onSuccess:()=>e.invalidateQueries({queryKey:J.keys})})}function Tn(){let e=f();return u({mutationFn:e=>a(`/api/settings`,e),onSuccess:()=>e.invalidateQueries({queryKey:J.settings})})}function En(){return u({mutationFn:e=>a(`/api/settings/password`,e)})}function Dn(){let e=f();return u({mutationFn:e=>a(`/api/settings/viewer-password`,{password:e}),onSuccess:()=>e.invalidateQueries({queryKey:J.status})})}function On(){return u({mutationFn:e=>o(`/api/connect/start`,e)})}function kn(){let e=f();return u({mutationFn:e=>o(`/api/credentials`,e),onSuccess:()=>e.invalidateQueries({queryKey:J.credentials})})}function An(){let e=f();return u({mutationFn:e=>o(`/api/connect/finish`,e),onSuccess:()=>e.invalidateQueries({queryKey:J.credentials})})}function jn(){return d({queryKey:J.plugins,queryFn:async({signal:t})=>(await e(`/api/plugins`,t)).plugins,staleTime:3e5})}async function Mn(e){let t=await r(`/api/connect/poll`,{method:`POST`,body:{flowId:e},accept:[202]});return t.status===202?{status:`pending`}:t.data}var Nn=new Intl.NumberFormat(`en-US`,{notation:`compact`,maximumFractionDigits:1}),Pn=new Intl.NumberFormat(`en-US`);function Fn(e){return Number.isFinite(e)?e<1e4?Pn.format(Math.round(e)):Nn.format(e).toLowerCase():`—`}function In(e){return Number.isFinite(e)?e===0?`$0`:e<.01?`$${e.toFixed(4)}`:e<100?`$${e.toFixed(2)}`:`$${Nn.format(e).toLowerCase()}`:`—`}function Ln(e){return e==null||!Number.isFinite(e)?`—`:e<1e3?`${Math.round(e)}ms`:e<6e4?`${(e/1e3).toFixed(1)}s`:`${Math.round(e/6e4)}m`}function Rn(e,t=1){return Number.isFinite(e)?`${(e*100).toFixed(t)}%`:`—`}var zn=[[6e4,1e3,`s`],[36e5,6e4,`m`],[864e5,36e5,`h`],[1/0,864e5,`d`]];function Bn(e){let t=Math.abs(e);if(t<1e3)return`0s`;let n=zn.find(([e])=>t<e);return n===void 0?`—`:`${Math.floor(t/n[1])}${n[2]}`}function Vn(e,t=Date.now()){if(e==null||!Number.isFinite(e))return`—`;let n=e-t;return Math.abs(n)<5e3?`just now`:n<0?`${Bn(n)} ago`:`in ${Bn(n)}`}function Hn(e){return new Date(e).toLocaleTimeString(`en-GB`,{hour12:!1})}var Un=864e5;function Wn(e,t){let n=new Date(e),r=n.toLocaleTimeString(`en-GB`,{hour:`2-digit`,minute:`2-digit`,hour12:!1});return Gn(t)?`${n.toLocaleDateString(`en-GB`,{day:`2-digit`,month:`short`})} ${r}`:r}function Gn(e){return e>=Un}function Kn(e){return e==null||!Number.isFinite(e)?`—`:new Date(e).toLocaleString(`en-GB`,{year:`numeric`,month:`short`,day:`2-digit`,hour:`2-digit`,minute:`2-digit`,hour12:!1})}var qn=[`B`,`KiB`,`MiB`,`GiB`,`TiB`];function Jn(e){if(e==null||!Number.isFinite(e))return`—`;if(Math.abs(e)<1024)return`${Math.round(e)} B`;let t=e,n=0;for(;Math.abs(t)>=1024&&n<qn.length-1;)t/=1024,n+=1;return`${t.toFixed(1)} ${qn[n]}`}function Yn(e,t=8){return e.length<=t?e:`${e.slice(0,t)}…`}var Xn={fiveHour:18e6,daily:864e5,weekly:6048e5};function Zn(e,t){return t!==null&&t>0?t:Xn[e]}var Qn=6e4;function Z(e,t){return e===null||t===null?e===t:Math.abs(e-t)<=Qn}function $n(e,t){return e.resetsAt!==null&&e.resetsAt<=t}function er(e,t){return t===void 0?`unknown`:e.observedAt>0&&t.stale?`stale`:t.ratePerHour===null||e.limit===null||e.limit<=0?`unknown`:t.survives===!1&&t.exhaustsAt!==null?`empty`:t.survives===!0?`ok`:`unknown`}function tr(e,t){if(t.provider!==e.provider)return!1;let n=Symbol(`unusable-endpoint`);return(e=>e===void 0||e===``?void 0:e)(e.endpointId)===(e=>{if(e!==void 0)return typeof e==`string`&&e!==``?e:n})(t.providerData.endpointId)?e.credentialId===void 0||t.id===e.credentialId:!1}var nr=4e3,rr=6e4,ir=(e,t)=>e.revokedAt===null&&(e.expiresAt===null||e.expiresAt>t);function ar(e,t){if(e.length===0)return null;let n=[...e].sort((e,t)=>e-t);return n[Math.min(n.length-1,Math.max(0,Math.ceil(t*n.length)-1))]??null}function Q(e){return e.state===`pending`}function or(e){return e.filter(e=>!Q(e))}function $(e){return Q(e)?!1:e.status>=400||e.errorCode!==null}var sr={ok:`●`,warn:`◐`,down:`○`,idle:`·`,live:`●`};function cr(e){return Q(e)?`live`:$(e)?`down`:`ok`}function lr(e){return Q(e)?`in flight`:$(e)?`failed with ${e.status}`:`succeeded`}function ur(e,t){let n=or(e),r=[],i=0,a=0,o=0,s=0,c=0,l=0;for(let e of n)$(e)&&(i+=1),e.ttftMs!==null&&Number.isFinite(e.ttftMs)&&r.push(e.ttftMs),a+=e.costUsd,o+=e.inputTokens,s+=e.outputTokens,c+=e.cacheReadTokens,l+=e.cacheWriteTokens;let u=t/6e4;return{requests:n.length,errors:i,errorRate:n.length===0?0:i/n.length,ratePerMin:u<=0?0:n.length/u,ttftP50:ar(r,.5),ttftP95:ar(r,.95),costUsd:a,inputTokens:o,outputTokens:s,cacheReadTokens:c,cacheWriteTokens:l}}function dr(e,t){let n=or(e),{now:r,spanMs:i,count:a}=t,o=i/a,s=r-i,c=Array.from({length:a},(e,t)=>({at:s+t*o,total:0,errors:0,costUsd:0,tokens:0,ttftMs:null})),l=Array.from({length:a},()=>[]);for(let e of n){if(e.at<s||e.at>r)continue;let t=Math.min(a-1,Math.floor((e.at-s)/o)),n=c[t];n!==void 0&&(n.total+=1,n.costUsd+=e.costUsd,n.tokens+=e.inputTokens+e.outputTokens+e.cacheReadTokens+e.cacheWriteTokens,$(e)&&(n.errors+=1),e.ttftMs!==null&&Number.isFinite(e.ttftMs)&&l[t]?.push(e.ttftMs))}for(let[e,t]of c.entries())t.ttftMs=ar(l[e]??[],.5);return c}var fr={tokenRejected:`reconnect needed — provider rejected the refresh token`,expiredNoRefresh:`reconnect needed — token expired with nothing to refresh from`};function pr(e,t,n,r=null){if(!n){let e=r===`tokenRejected`||r===`expiredNoRefresh`;return{state:e?`down`:`idle`,note:e?fr[r]:`disabled`,consecutiveFailures:0}}let i=`ok`,a=``,o=0;for(let n of e){if(o=Math.max(o,n.consecutiveFailures),n.breakerState===`open`){i=`down`,a=`breaker open`;continue}if(n.rateLimitedUntil!==null&&n.rateLimitedUntil>t&&i!==`down`){i=`warn`,a=`rate limited`;continue}n.breakerState===`halfOpen`&&i===`ok`&&(i=`warn`,a=`probing`)}return{state:i,note:a,consecutiveFailures:o}}var mr={fiveHour:`5h`,daily:`24h`,weekly:`7d`};function hr(e){return Math.max(e,6e4)*3}function gr(e,t,n){return e.observedAt<=0||t-e.observedAt>hr(n)}function _r(e,t){return t?.ratePerHour===void 0||t.ratePerHour===null||e.limit===null||e.limit<=0?null:t.ratePerHour/e.limit}function vr(e,t){return e.find(e=>e.windowType===t)}function yr(e,t,n,r,i){return br(e,{stale:gr(e,t,n),rolledOver:$n(e,t),estimateStale:i===void 0||i.stale,survives:i?.survives??null,exhaustsAt:i?.exhaustsAt??null},t,r)}function br(e,t,n,r){let i=mr[e.windowType];if(e.observedAt<=0)return`${i} · never observed`;if(t.stale)return`${i} · stale, read ${r(e.observedAt,n)}`;if(t.rolledOver)return`${i} · rolled over, waiting for the next reading`;if(e.resetsAt===null)return i;let a=`resets ${r(e.resetsAt,n)}`;return t.estimateStale||t.survives!==!1||t.exhaustsAt===null?`${i} · ${a}`:`${i} · ${t.exhaustsAt<=n?`empty now`:`empty ~${Bn(t.exhaustsAt-n)}`} · ${a}`}function xr(e){return{observedAt:e.observedAt,windowType:e.windowType,windowMs:e.windowMs,resetsAt:e.resetsAt,usedRatio:e.limit===null||e.limit<=0?null:Math.min(1,Math.max(0,e.used/e.limit))}}function Sr(e,t){if(e.usedRatio!==0||t.usedRatio!==0)return!1;let n=Zn(e.windowType,e.windowMs),r=Zn(t.windowType,t.windowMs);return n===r&&Z(e.resetsAt,e.observedAt+n)&&Z(t.resetsAt,t.observedAt+r)&&!Z(t.resetsAt,e.resetsAt)}function Cr(e){let t=e.filter(e=>e.usedRatio!==null).sort((e,t)=>e.observedAt-t.observedAt),n=[],r;for(let e of t){let t={at:e.observedAt,percent:Math.min(100,e.usedRatio*100)},i={resetsAt:e.resetsAt,startsAt:e.resetsAt===null?null:e.resetsAt-Zn(e.windowType,e.windowMs)},a=n[n.length-1],o=r!==void 0&&Sr(r,e);a===void 0||r===void 0||!o&&!Z(e.resetsAt,r.resetsAt)?n.push({key:`window-${n.length}`,points:[t],...i}):(a.points.push(t),a.resetsAt=o?null:i.resetsAt,a.startsAt=o?null:i.startsAt),r=e}return n}function wr(e,t){let{usedRatio:n,observedAt:r}=t;if(n===null)return[...e];let i=e.findLastIndex(e=>Z(e.resetsAt,t.resetsAt)),a=e[i];if(a===void 0)return[...e];let o=a.points[a.points.length-1];if(o===void 0||o.at>=r)return[...e];let s={at:r,percent:Math.min(100,n*100)};return e.map((e,t)=>t===i?{...e,points:[...e.points,s]}:e)}function Tr(e){return e.startsAt===null||e.resetsAt===null?null:{from:{at:e.startsAt,percent:0},to:{at:e.resetsAt,percent:100}}}var Er=36e5;function Dr(e,t){let{usedRatio:n,resetsAt:r,observedAt:i}=e,a=t;if(n===null||r===null||a===null||a<=0)return null;let o=Math.min(100,n*100),s=a*100,c={at:i,percent:o},l=o+s*((r-i)/Er);return l<=100?{from:c,to:{at:r,percent:l}}:{from:c,to:{at:i+(100-o)/s*Er,percent:100}}}var Or={fiveHour:0,daily:1,weekly:2};function kr(e){return e.filter(e=>e.limit!==null&&e.limit>0).map(e=>({window:e,fraction:Math.min(1,e.used/e.limit)})).sort((e,t)=>Or[e.window.windowType]-Or[t.window.windowType])}function Ar(e,t){let n=new Map;for(let r of e){let e=t(r),i=n.get(e);i===void 0?n.set(e,[r]):i.push(r)}return n}var jr=w`
2
+ 0%, 100% { opacity: 1; }
3
+ 50% { opacity: 0.28; }
4
+ `,Mr=C`
5
+ color: ${({theme:e})=>e.color.ok};
6
+ animation: ${jr} 1.2s ease-in-out infinite;
7
+
8
+ @media (prefers-reduced-motion: reduce) {
9
+ animation: none;
10
+ }
11
+ `,Nr={ok:C`
12
+ color: ${({theme:e})=>e.color.ok};
13
+ `,warn:C`
14
+ color: ${({theme:e})=>e.color.warn};
15
+ `,down:C`
16
+ color: ${({theme:e})=>e.color.down};
17
+ `,idle:C`
18
+ color: ${({theme:e})=>e.color.inkFaint};
19
+ `,live:Mr},Pr=S.span`
20
+ font-family: ${({theme:e})=>e.font.mono};
21
+ font-size: 12px;
22
+ line-height: 1;
23
+ flex: none;
24
+ transform: translateY(-1.5px);
25
+ ${({$state:e})=>Nr[e]}
26
+ `;function Fr({state:e,label:t,className:n}){return x(Pr,{$state:e,className:n,role:`img`,"aria-label":t,title:t,children:sr[e]})}export{En as $,Xt as $t,Jn as A,N as An,kt as At,Gn as B,T as Bn,Yt as Bt,nr as C,Se as Cn,qt as Ct,$n as D,P as Dn,Mt as Dt,ir as E,ge as En,Jt as Et,Bn as F,fe as Fn,yt as Ft,ht as G,Tn as Gt,Pt as H,wn as Ht,Ln as I,D as In,mn as It,J,bn as Jt,At as K,Sn as Kt,Rn as L,oe as Ln,fn as Lt,Hn as M,A as Mn,Lt as Mt,Fn as N,ie as Nn,jn as Nt,er as O,_e as On,Zt as Ot,Kn as P,M as Pn,mt as Pt,Tt as Q,Qt,Vn as R,j as Rn,Nt as Rt,wr as S,ve as Sn,vn as St,Zn as T,F as Tn,xt as Tt,Y as U,gn as Ut,Yn as V,E as Vn,Kt as Vt,pt as W,Ht as Wt,Dt as X,Dn as Xt,zt as Y,xn as Yt,wt as Z,Ct as Zt,Cr as _,Pe as _n,Rt as _t,Tr as a,Ut as an,cn as at,xr as b,be as bn,_n as bt,Ar as c,Xe as cn,an as ct,gr as d,Re as dn,Ft as dt,Bt as en,Wt as et,lr as f,Be as fn,kn as ft,br as g,Ne as gn,_t as gt,yr as h,Fe as hn,vt as ht,dr as i,Ot as in,on as it,Wn as j,ne as jn,bt as jt,tr as k,k as kn,$t as kt,$ as l,Je as ln,An as lt,Dr as m,Le as mn,Vt as mt,mr as n,jt as nn,sn as nt,vr as o,lt as on,ln as ot,cr as p,je as pn,yn as pt,Mn as q,Cn as qt,Or as r,un as rn,en as rt,pr as s,Ze as sn,nn as st,Fr as t,gt as tn,rn as tt,Q as u,Ue as un,On as ut,kr as v,Te as vn,Et as vt,rr as w,I as wn,dn as wt,ur as x,ye as xn,Gt as xt,_r as y,W as yn,hn as yt,In as z,se as zn,pn as zt};
@@ -1,4 +1,4 @@
1
- import{Dt as e,F as t,L as n,Ot as r,P as i,Rt as a,Xt as o,i as s,in as c,jt as l,rn as u,t as d,wt as f,x as p}from"./Lamp-Dk9XrTCg.js";import{A as m,D as h,O as g,S as _,T as v,b as y,c as b,k as x,w as S,y as C}from"./Panel-CsovmtxF.js";import*as w from"react";import{createContext as T,createElement as ee,forwardRef as E,use as te,useCallback as ne,useContext as re,useEffect as ie,useId as ae,useMemo as oe,useState as D}from"react";import{Fragment as se,jsx as O,jsxs as k}from"react/jsx-runtime";import A,{ThemeProvider as ce,createGlobalStyle as le,css as ue}from"styled-components";import{LiveProvider as de,useLive as fe}from"@omnigateway/dashboard-sdk";import*as pe from"react-dom";var me=e=>e?.replace(/([a-z0-9])([A-Z])/g,`$1-$2`).toLowerCase();function he(e,t,n=[]){if(t==null)throw Error(`[lucide]: iconNode is required when icon name is used`);return{name:me(e),size:24,node:t,...n.length>0?{aliases:n}:{}}}var ge=e=>{let t=``,n=!1;for(let r of e){if(r===`-`||r===`_`||r<=` `){n=t.length>0;continue}t.length===0?t+=r.toLowerCase():t+=n?r.toUpperCase():r,n=!1}return t},_e=e=>{let t=ge(e);return t.charAt(0).toUpperCase()+t.slice(1)},ve=(...e)=>e.filter((e,t,n)=>!!e&&e.trim()!==``&&n.indexOf(e)===t).join(` `).trim(),j={xmlns:`http://www.w3.org/2000/svg`,width:24,height:24,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,"stroke-width":2,"stroke-linecap":`round`,"stroke-linejoin":`round`};function ye(e){return e!=null}function be(e,t={}){let n=t.attributeNames??{},r=e=>n[e]??e,i=e.size??e.width??j.width,a=e.size??e.height??j.height,o=e.aliases?.filter(e=>typeof e==`string`&&e.trim()!==``).map(e=>`lucide-${e}`)??[],s=[...e.name?[`lucide-${e.name}`]:[],...o],c=t.className?.split(` `).filter(Boolean)??[],l=t.includeDefaultClasses===!1?ve(...c):ve(`lucide`,...s,...c),u=t.absoluteStrokeWidth?Number(t.strokeWidth??j[`stroke-width`])*Number(e.size??e.width??j.width)/Number(t.size??t.width??j.width):t.strokeWidth??j[`stroke-width`];return[`svg`,{...Object.entries(j).reduce((e,[t,n])=>(e[r(t)]=n,e),{}),...`color`in t&&t.color&&{[r(`stroke`)]:t.color},...`size`in t&&ye(t.size)&&{[r(`width`)]:t.size,[r(`height`)]:t.size},...`width`in t&&ye(t.width)&&{[r(`width`)]:t.width},...`height`in t&&ye(t.height)&&{[r(`height`)]:t.height},[r(`stroke-width`)]:u,...l&&{[r(`class`)]:l},[r(`viewBox`)]:`0 0 ${i} ${a}`,...t.hasA11yProp===!1?{[r(`aria-hidden`)]:`true`}:{},...`attributes`in t&&t.attributes},e.node.map(e=>{let[n,i,a]=e,o=t.nonScalingStroke?{[r(`vector-effect`)]:`non-scaling-stroke`,...i}:i;return a?[n,o,a]:[n,o]})]}function xe(e,t={}){return be(e,{...t,attributeNames:{...t.attributeNames,class:`className`,"stroke-width":`strokeWidth`,"stroke-linecap":`strokeLinecap`,"stroke-linejoin":`strokeLinejoin`,"vector-effect":`vectorEffect`}})}var Se=e=>{for(let t in e)if(t.startsWith(`aria-`)||t===`role`||t===`title`)return!0;return!1},Ce=T({}),we=()=>re(Ce),Te=E(({color:e,size:t,width:n,height:r,strokeWidth:i,absoluteStrokeWidth:a,nonScalingStroke:o,className:s=``,children:c,iconNode:l=[],icon:u={node:l,aliases:[],size:24},...d},f)=>{let{size:p=24,strokeWidth:m=2,absoluteStrokeWidth:h=!1,nonScalingStroke:g=!1,color:_=`currentColor`,className:v=``}=we()??{},y=!!c||Se(d),[b,x,S=[]]=xe(u,{color:e??_,width:n??t??p,height:r??t??p,strokeWidth:i??m,absoluteStrokeWidth:a??h,nonScalingStroke:o??g,className:ve(v,s),hasA11yProp:y,attributes:d});return ee(b,{ref:f,...x},[...S.map(([e,t])=>ee(e,t)),...Array.isArray(c)?c:[c]])});function M(e,t=[],n=[]){let r=typeof e==`string`?he(e,t,n):e,i=E(({className:e,...t},n)=>ee(Te,{ref:n,icon:r,className:e,...t}));return r.name&&(i.displayName=_e(r.name)),i}var Ee={name:`activity`,size:24,node:[[`path`,{d:`M22 12h-2.48a2 2 0 0 0-1.93 1.46l-2.35 8.36a.25.25 0 0 1-.48 0L9.24 2.18a.25.25 0 0 0-.48 0l-2.35 8.36A2 2 0 0 1 4.49 12H2`,key:`169zse`}]]};Ee.node;var De=M(Ee),Oe={name:`blocks`,size:24,node:[[`path`,{d:`M10 22V7a1 1 0 0 0-1-1H4a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2v-5a1 1 0 0 0-1-1H2`,key:`1ah6g2`}],[`rect`,{x:`14`,y:`2`,width:`8`,height:`8`,rx:`1`,key:`88lufb`}]]};Oe.node;var ke=M(Oe),Ae={name:`boxes`,size:24,node:[[`path`,{d:`M2.97 12.92A2 2 0 0 0 2 14.63v3.24a2 2 0 0 0 .97 1.71l3 1.8a2 2 0 0 0 2.06 0L12 19v-5.5l-5-3-4.03 2.42Z`,key:`lc1i9w`}],[`path`,{d:`m7 16.5-4.74-2.85`,key:`1o9zyk`}],[`path`,{d:`m7 16.5 5-3`,key:`va8pkn`}],[`path`,{d:`M7 16.5v5.17`,key:`jnp8gn`}],[`path`,{d:`M12 13.5V19l3.97 2.38a2 2 0 0 0 2.06 0l3-1.8a2 2 0 0 0 .97-1.71v-3.24a2 2 0 0 0-.97-1.71L17 10.5l-5 3Z`,key:`8zsnat`}],[`path`,{d:`m17 16.5-5-3`,key:`8arw3v`}],[`path`,{d:`m17 16.5 4.74-2.85`,key:`8rfmw`}],[`path`,{d:`M17 16.5v5.17`,key:`k6z78m`}],[`path`,{d:`M7.97 4.42A2 2 0 0 0 7 6.13v4.37l5 3 5-3V6.13a2 2 0 0 0-.97-1.71l-3-1.8a2 2 0 0 0-2.06 0l-3 1.8Z`,key:`1xygjf`}],[`path`,{d:`M12 8 7.26 5.15`,key:`1vbdud`}],[`path`,{d:`m12 8 4.74-2.85`,key:`3rx089`}],[`path`,{d:`M12 13.5V8`,key:`1io7kd`}]]};Ae.node;var je=M(Ae),Me={name:`cable`,size:24,node:[[`path`,{d:`M17 19a1 1 0 0 1-1-1v-2a2 2 0 0 1 2-2h2a2 2 0 0 1 2 2v2a1 1 0 0 1-1 1z`,key:`trhst0`}],[`path`,{d:`M17 21v-2`,key:`ds4u3f`}],[`path`,{d:`M19 14V6.5a1 1 0 0 0-7 0v11a1 1 0 0 1-7 0V10`,key:`1mo9zo`}],[`path`,{d:`M21 21v-2`,key:`eo0ou`}],[`path`,{d:`M3 5V3`,key:`1k5hjh`}],[`path`,{d:`M4 10a2 2 0 0 1-2-2V6a1 1 0 0 1 1-1h4a1 1 0 0 1 1 1v2a2 2 0 0 1-2 2z`,key:`1dd30t`}],[`path`,{d:`M7 5V3`,key:`1t1388`}]]};Me.node;var Ne=M(Me),Pe={name:`database`,size:24,node:[[`ellipse`,{cx:`12`,cy:`5`,rx:`9`,ry:`3`,key:`msslwz`}],[`path`,{d:`M3 5V19A9 3 0 0 0 21 19V5`,key:`1wlel7`}],[`path`,{d:`M3 12A9 3 0 0 0 21 12`,key:`mv7ke4`}]]};Pe.node;var Fe=M(Pe),Ie={name:`gauge`,size:24,node:[[`path`,{d:`m12 14 4-4`,key:`9kzdfg`}],[`path`,{d:`M3.34 19a10 10 0 1 1 17.32 0`,key:`19p75a`}]]};Ie.node;var Le=M(Ie),Re={name:`key-round`,size:24,node:[[`path`,{d:`M2.586 17.414A2 2 0 0 0 2 18.828V21a1 1 0 0 0 1 1h3a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h1a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h.172a2 2 0 0 0 1.414-.586l.814-.814a6.5 6.5 0 1 0-4-4z`,key:`1s6t7t`}],[`circle`,{cx:`16.5`,cy:`7.5`,r:`.5`,fill:`currentColor`,key:`w0ekpg`}]]};Re.node;var ze=M(Re),Be={name:`log-out`,size:24,node:[[`path`,{d:`m16 17 5-5-5-5`,key:`1bji2h`}],[`path`,{d:`M21 12H9`,key:`dn1m92`}],[`path`,{d:`M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4`,key:`1uf3rs`}]]};Be.node;var Ve=M(Be),He={name:`monitor-cog`,size:24,node:[[`path`,{d:`M12 17v4`,key:`1riwvh`}],[`path`,{d:`m14.305 7.53.923-.382`,key:`1mlnsw`}],[`path`,{d:`m15.228 4.852-.923-.383`,key:`82mpwg`}],[`path`,{d:`m16.852 3.228-.383-.924`,key:`ln4sir`}],[`path`,{d:`m16.852 8.772-.383.923`,key:`1dejw0`}],[`path`,{d:`m19.148 3.228.383-.924`,key:`192kgf`}],[`path`,{d:`m19.53 9.696-.382-.924`,key:`fiavlr`}],[`path`,{d:`m20.772 4.852.924-.383`,key:`1j8mgp`}],[`path`,{d:`m20.772 7.148.924.383`,key:`zix9be`}],[`path`,{d:`M22 13v2a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h7`,key:`1tnzv8`}],[`path`,{d:`M8 21h8`,key:`1ev6f3`}],[`circle`,{cx:`18`,cy:`6`,r:`3`,key:`1h7g24`}]]};He.node;var Ue=M(He),We={name:`moon`,size:24,node:[[`path`,{d:`M20.985 12.486a9 9 0 1 1-9.473-9.472c.405-.022.617.46.402.803a6 6 0 0 0 8.268 8.268c.344-.215.825-.004.803.401`,key:`kfwtm`}]]};We.node;var Ge=M(We),Ke={name:`power`,size:24,node:[[`path`,{d:`M12 2v10`,key:`mnfbl`}],[`path`,{d:`M18.4 6.6a9 9 0 1 1-12.77.04`,key:`obofu9`}]]};Ke.node;var qe=M(Ke),Je={name:`rotate-cw`,size:24,node:[[`path`,{d:`M21 12a9 9 0 1 1-9-9c2.52 0 4.93 1 6.74 2.74L21 8`,key:`1p45f6`}],[`path`,{d:`M21 3v5h-5`,key:`1q7to0`}]]};Je.node;var Ye=M(Je),Xe={name:`scroll-text`,size:24,node:[[`path`,{d:`M15 12h-5`,key:`r7krc0`}],[`path`,{d:`M15 8h-5`,key:`1khuty`}],[`path`,{d:`M19 17V5a2 2 0 0 0-2-2H4`,key:`zz82l3`}],[`path`,{d:`M8 21h12a2 2 0 0 0 2-2v-1a1 1 0 0 0-1-1H11a1 1 0 0 0-1 1v1a2 2 0 1 1-4 0V5a2 2 0 1 0-4 0v2a1 1 0 0 0 1 1h3`,key:`1ph1d7`}]]};Xe.node;var Ze=M(Xe),Qe={name:`sliders-horizontal`,size:24,node:[[`path`,{d:`M10 5H3`,key:`1qgfaw`}],[`path`,{d:`M12 19H3`,key:`yhmn1j`}],[`path`,{d:`M14 3v4`,key:`1sua03`}],[`path`,{d:`M16 17v4`,key:`1q0r14`}],[`path`,{d:`M21 12h-9`,key:`1o4lsq`}],[`path`,{d:`M21 19h-5`,key:`1rlt1p`}],[`path`,{d:`M21 5h-7`,key:`1oszz2`}],[`path`,{d:`M8 10v4`,key:`tgpxqk`}],[`path`,{d:`M8 12H3`,key:`a7s4jb`}]]};Qe.node;var $e=M(Qe),et={name:`sun`,size:24,node:[[`circle`,{cx:`12`,cy:`12`,r:`4`,key:`4exip2`}],[`path`,{d:`M12 2v2`,key:`tus03m`}],[`path`,{d:`M12 20v2`,key:`1lh1kg`}],[`path`,{d:`m4.93 4.93 1.41 1.41`,key:`149t6j`}],[`path`,{d:`m17.66 17.66 1.41 1.41`,key:`ptbguv`}],[`path`,{d:`M2 12h2`,key:`1t8f8n`}],[`path`,{d:`M20 12h2`,key:`1q8mjw`}],[`path`,{d:`m6.34 17.66-1.41 1.41`,key:`1m8zz5`}],[`path`,{d:`m19.07 4.93-1.41 1.41`,key:`1shlcs`}]]};et.node;var tt=M(et),nt={name:`terminal`,size:24,node:[[`path`,{d:`M12 19h8`,key:`baeox8`}],[`path`,{d:`m4 17 6-6-6-6`,key:`1yngyt`}]]};nt.node;var rt=M(nt),it={name:`x`,size:24,node:[[`path`,{d:`M18 6 6 18`,key:`1bl5f8`}],[`path`,{d:`m6 6 12 12`,key:`d8bk6v`}]]};it.node;var at=M(it);function ot(e,t){return e.flatMap(({id:e,colour:n})=>{let r=n?.[t];return typeof r==`string`?[`--p-${e}: ${r};`]:[]}).join(`
1
+ import{$t as e,At as t,Bt as n,Et as r,I as i,L as a,Nt as o,i as s,kt as c,on as l,sn as u,t as d,x as f,z as p}from"./Lamp-CL0i4yaa.js";import{A as m,D as h,O as g,S as _,T as v,b as y,c as b,k as x,w as S,y as C}from"./Panel-CsovmtxF.js";import*as w from"react";import{createContext as T,createElement as ee,forwardRef as E,use as te,useCallback as ne,useContext as re,useEffect as ie,useId as ae,useMemo as oe,useState as D}from"react";import{Fragment as se,jsx as O,jsxs as k}from"react/jsx-runtime";import A,{ThemeProvider as ce,createGlobalStyle as le,css as ue}from"styled-components";import{LiveProvider as de,useLive as fe}from"@omnigateway/dashboard-sdk";import*as pe from"react-dom";var me=e=>e?.replace(/([a-z0-9])([A-Z])/g,`$1-$2`).toLowerCase();function he(e,t,n=[]){if(t==null)throw Error(`[lucide]: iconNode is required when icon name is used`);return{name:me(e),size:24,node:t,...n.length>0?{aliases:n}:{}}}var ge=e=>{let t=``,n=!1;for(let r of e){if(r===`-`||r===`_`||r<=` `){n=t.length>0;continue}t.length===0?t+=r.toLowerCase():t+=n?r.toUpperCase():r,n=!1}return t},_e=e=>{let t=ge(e);return t.charAt(0).toUpperCase()+t.slice(1)},ve=(...e)=>e.filter((e,t,n)=>!!e&&e.trim()!==``&&n.indexOf(e)===t).join(` `).trim(),j={xmlns:`http://www.w3.org/2000/svg`,width:24,height:24,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,"stroke-width":2,"stroke-linecap":`round`,"stroke-linejoin":`round`};function ye(e){return e!=null}function be(e,t={}){let n=t.attributeNames??{},r=e=>n[e]??e,i=e.size??e.width??j.width,a=e.size??e.height??j.height,o=e.aliases?.filter(e=>typeof e==`string`&&e.trim()!==``).map(e=>`lucide-${e}`)??[],s=[...e.name?[`lucide-${e.name}`]:[],...o],c=t.className?.split(` `).filter(Boolean)??[],l=t.includeDefaultClasses===!1?ve(...c):ve(`lucide`,...s,...c),u=t.absoluteStrokeWidth?Number(t.strokeWidth??j[`stroke-width`])*Number(e.size??e.width??j.width)/Number(t.size??t.width??j.width):t.strokeWidth??j[`stroke-width`];return[`svg`,{...Object.entries(j).reduce((e,[t,n])=>(e[r(t)]=n,e),{}),...`color`in t&&t.color&&{[r(`stroke`)]:t.color},...`size`in t&&ye(t.size)&&{[r(`width`)]:t.size,[r(`height`)]:t.size},...`width`in t&&ye(t.width)&&{[r(`width`)]:t.width},...`height`in t&&ye(t.height)&&{[r(`height`)]:t.height},[r(`stroke-width`)]:u,...l&&{[r(`class`)]:l},[r(`viewBox`)]:`0 0 ${i} ${a}`,...t.hasA11yProp===!1?{[r(`aria-hidden`)]:`true`}:{},...`attributes`in t&&t.attributes},e.node.map(e=>{let[n,i,a]=e,o=t.nonScalingStroke?{[r(`vector-effect`)]:`non-scaling-stroke`,...i}:i;return a?[n,o,a]:[n,o]})]}function xe(e,t={}){return be(e,{...t,attributeNames:{...t.attributeNames,class:`className`,"stroke-width":`strokeWidth`,"stroke-linecap":`strokeLinecap`,"stroke-linejoin":`strokeLinejoin`,"vector-effect":`vectorEffect`}})}var Se=e=>{for(let t in e)if(t.startsWith(`aria-`)||t===`role`||t===`title`)return!0;return!1},Ce=T({}),we=()=>re(Ce),Te=E(({color:e,size:t,width:n,height:r,strokeWidth:i,absoluteStrokeWidth:a,nonScalingStroke:o,className:s=``,children:c,iconNode:l=[],icon:u={node:l,aliases:[],size:24},...d},f)=>{let{size:p=24,strokeWidth:m=2,absoluteStrokeWidth:h=!1,nonScalingStroke:g=!1,color:_=`currentColor`,className:v=``}=we()??{},y=!!c||Se(d),[b,x,S=[]]=xe(u,{color:e??_,width:n??t??p,height:r??t??p,strokeWidth:i??m,absoluteStrokeWidth:a??h,nonScalingStroke:o??g,className:ve(v,s),hasA11yProp:y,attributes:d});return ee(b,{ref:f,...x},[...S.map(([e,t])=>ee(e,t)),...Array.isArray(c)?c:[c]])});function M(e,t=[],n=[]){let r=typeof e==`string`?he(e,t,n):e,i=E(({className:e,...t},n)=>ee(Te,{ref:n,icon:r,className:e,...t}));return r.name&&(i.displayName=_e(r.name)),i}var Ee={name:`activity`,size:24,node:[[`path`,{d:`M22 12h-2.48a2 2 0 0 0-1.93 1.46l-2.35 8.36a.25.25 0 0 1-.48 0L9.24 2.18a.25.25 0 0 0-.48 0l-2.35 8.36A2 2 0 0 1 4.49 12H2`,key:`169zse`}]]};Ee.node;var De=M(Ee),Oe={name:`blocks`,size:24,node:[[`path`,{d:`M10 22V7a1 1 0 0 0-1-1H4a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2v-5a1 1 0 0 0-1-1H2`,key:`1ah6g2`}],[`rect`,{x:`14`,y:`2`,width:`8`,height:`8`,rx:`1`,key:`88lufb`}]]};Oe.node;var ke=M(Oe),Ae={name:`boxes`,size:24,node:[[`path`,{d:`M2.97 12.92A2 2 0 0 0 2 14.63v3.24a2 2 0 0 0 .97 1.71l3 1.8a2 2 0 0 0 2.06 0L12 19v-5.5l-5-3-4.03 2.42Z`,key:`lc1i9w`}],[`path`,{d:`m7 16.5-4.74-2.85`,key:`1o9zyk`}],[`path`,{d:`m7 16.5 5-3`,key:`va8pkn`}],[`path`,{d:`M7 16.5v5.17`,key:`jnp8gn`}],[`path`,{d:`M12 13.5V19l3.97 2.38a2 2 0 0 0 2.06 0l3-1.8a2 2 0 0 0 .97-1.71v-3.24a2 2 0 0 0-.97-1.71L17 10.5l-5 3Z`,key:`8zsnat`}],[`path`,{d:`m17 16.5-5-3`,key:`8arw3v`}],[`path`,{d:`m17 16.5 4.74-2.85`,key:`8rfmw`}],[`path`,{d:`M17 16.5v5.17`,key:`k6z78m`}],[`path`,{d:`M7.97 4.42A2 2 0 0 0 7 6.13v4.37l5 3 5-3V6.13a2 2 0 0 0-.97-1.71l-3-1.8a2 2 0 0 0-2.06 0l-3 1.8Z`,key:`1xygjf`}],[`path`,{d:`M12 8 7.26 5.15`,key:`1vbdud`}],[`path`,{d:`m12 8 4.74-2.85`,key:`3rx089`}],[`path`,{d:`M12 13.5V8`,key:`1io7kd`}]]};Ae.node;var je=M(Ae),Me={name:`cable`,size:24,node:[[`path`,{d:`M17 19a1 1 0 0 1-1-1v-2a2 2 0 0 1 2-2h2a2 2 0 0 1 2 2v2a1 1 0 0 1-1 1z`,key:`trhst0`}],[`path`,{d:`M17 21v-2`,key:`ds4u3f`}],[`path`,{d:`M19 14V6.5a1 1 0 0 0-7 0v11a1 1 0 0 1-7 0V10`,key:`1mo9zo`}],[`path`,{d:`M21 21v-2`,key:`eo0ou`}],[`path`,{d:`M3 5V3`,key:`1k5hjh`}],[`path`,{d:`M4 10a2 2 0 0 1-2-2V6a1 1 0 0 1 1-1h4a1 1 0 0 1 1 1v2a2 2 0 0 1-2 2z`,key:`1dd30t`}],[`path`,{d:`M7 5V3`,key:`1t1388`}]]};Me.node;var Ne=M(Me),Pe={name:`database`,size:24,node:[[`ellipse`,{cx:`12`,cy:`5`,rx:`9`,ry:`3`,key:`msslwz`}],[`path`,{d:`M3 5V19A9 3 0 0 0 21 19V5`,key:`1wlel7`}],[`path`,{d:`M3 12A9 3 0 0 0 21 12`,key:`mv7ke4`}]]};Pe.node;var Fe=M(Pe),Ie={name:`gauge`,size:24,node:[[`path`,{d:`m12 14 4-4`,key:`9kzdfg`}],[`path`,{d:`M3.34 19a10 10 0 1 1 17.32 0`,key:`19p75a`}]]};Ie.node;var Le=M(Ie),Re={name:`key-round`,size:24,node:[[`path`,{d:`M2.586 17.414A2 2 0 0 0 2 18.828V21a1 1 0 0 0 1 1h3a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h1a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h.172a2 2 0 0 0 1.414-.586l.814-.814a6.5 6.5 0 1 0-4-4z`,key:`1s6t7t`}],[`circle`,{cx:`16.5`,cy:`7.5`,r:`.5`,fill:`currentColor`,key:`w0ekpg`}]]};Re.node;var ze=M(Re),Be={name:`log-out`,size:24,node:[[`path`,{d:`m16 17 5-5-5-5`,key:`1bji2h`}],[`path`,{d:`M21 12H9`,key:`dn1m92`}],[`path`,{d:`M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4`,key:`1uf3rs`}]]};Be.node;var Ve=M(Be),He={name:`monitor-cog`,size:24,node:[[`path`,{d:`M12 17v4`,key:`1riwvh`}],[`path`,{d:`m14.305 7.53.923-.382`,key:`1mlnsw`}],[`path`,{d:`m15.228 4.852-.923-.383`,key:`82mpwg`}],[`path`,{d:`m16.852 3.228-.383-.924`,key:`ln4sir`}],[`path`,{d:`m16.852 8.772-.383.923`,key:`1dejw0`}],[`path`,{d:`m19.148 3.228.383-.924`,key:`192kgf`}],[`path`,{d:`m19.53 9.696-.382-.924`,key:`fiavlr`}],[`path`,{d:`m20.772 4.852.924-.383`,key:`1j8mgp`}],[`path`,{d:`m20.772 7.148.924.383`,key:`zix9be`}],[`path`,{d:`M22 13v2a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h7`,key:`1tnzv8`}],[`path`,{d:`M8 21h8`,key:`1ev6f3`}],[`circle`,{cx:`18`,cy:`6`,r:`3`,key:`1h7g24`}]]};He.node;var Ue=M(He),We={name:`moon`,size:24,node:[[`path`,{d:`M20.985 12.486a9 9 0 1 1-9.473-9.472c.405-.022.617.46.402.803a6 6 0 0 0 8.268 8.268c.344-.215.825-.004.803.401`,key:`kfwtm`}]]};We.node;var Ge=M(We),Ke={name:`power`,size:24,node:[[`path`,{d:`M12 2v10`,key:`mnfbl`}],[`path`,{d:`M18.4 6.6a9 9 0 1 1-12.77.04`,key:`obofu9`}]]};Ke.node;var qe=M(Ke),Je={name:`rotate-cw`,size:24,node:[[`path`,{d:`M21 12a9 9 0 1 1-9-9c2.52 0 4.93 1 6.74 2.74L21 8`,key:`1p45f6`}],[`path`,{d:`M21 3v5h-5`,key:`1q7to0`}]]};Je.node;var Ye=M(Je),Xe={name:`scroll-text`,size:24,node:[[`path`,{d:`M15 12h-5`,key:`r7krc0`}],[`path`,{d:`M15 8h-5`,key:`1khuty`}],[`path`,{d:`M19 17V5a2 2 0 0 0-2-2H4`,key:`zz82l3`}],[`path`,{d:`M8 21h12a2 2 0 0 0 2-2v-1a1 1 0 0 0-1-1H11a1 1 0 0 0-1 1v1a2 2 0 1 1-4 0V5a2 2 0 1 0-4 0v2a1 1 0 0 0 1 1h3`,key:`1ph1d7`}]]};Xe.node;var Ze=M(Xe),Qe={name:`sliders-horizontal`,size:24,node:[[`path`,{d:`M10 5H3`,key:`1qgfaw`}],[`path`,{d:`M12 19H3`,key:`yhmn1j`}],[`path`,{d:`M14 3v4`,key:`1sua03`}],[`path`,{d:`M16 17v4`,key:`1q0r14`}],[`path`,{d:`M21 12h-9`,key:`1o4lsq`}],[`path`,{d:`M21 19h-5`,key:`1rlt1p`}],[`path`,{d:`M21 5h-7`,key:`1oszz2`}],[`path`,{d:`M8 10v4`,key:`tgpxqk`}],[`path`,{d:`M8 12H3`,key:`a7s4jb`}]]};Qe.node;var $e=M(Qe),et={name:`sun`,size:24,node:[[`circle`,{cx:`12`,cy:`12`,r:`4`,key:`4exip2`}],[`path`,{d:`M12 2v2`,key:`tus03m`}],[`path`,{d:`M12 20v2`,key:`1lh1kg`}],[`path`,{d:`m4.93 4.93 1.41 1.41`,key:`149t6j`}],[`path`,{d:`m17.66 17.66 1.41 1.41`,key:`ptbguv`}],[`path`,{d:`M2 12h2`,key:`1t8f8n`}],[`path`,{d:`M20 12h2`,key:`1q8mjw`}],[`path`,{d:`m6.34 17.66-1.41 1.41`,key:`1m8zz5`}],[`path`,{d:`m19.07 4.93-1.41 1.41`,key:`1shlcs`}]]};et.node;var tt=M(et),nt={name:`terminal`,size:24,node:[[`path`,{d:`M12 19h8`,key:`baeox8`}],[`path`,{d:`m4 17 6-6-6-6`,key:`1yngyt`}]]};nt.node;var rt=M(nt),it={name:`x`,size:24,node:[[`path`,{d:`M18 6 6 18`,key:`1bl5f8`}],[`path`,{d:`m6 6 12 12`,key:`d8bk6v`}]]};it.node;var at=M(it);function ot(e,t){return e.flatMap(({id:e,colour:n})=>{let r=n?.[t];return typeof r==`string`?[`--p-${e}: ${r};`]:[]}).join(`
2
2
  `)}var st=le`
3
3
  :root {
4
4
  ${({$providers:e})=>ot(e,`light`)}
@@ -207,7 +207,7 @@ import{Dt as e,F as t,L as n,Ot as r,P as i,Rt as a,Xt as o,i as s,in as c,jt as
207
207
  letter-spacing: 0.08em;
208
208
  `,jt=A.span`
209
209
  color: ${({theme:e})=>e.color.inkFaint};
210
- `,Mt={push:{name:`live, pushing`,lamp:`live`,head:`LIVE`,tail:`PUSH`,title:`Refreshing on gateway push — pause refreshing`},poll:{name:`live, polling`,lamp:`ok`,head:`LIVE`,tail:`POLL`,title:`Refreshing on a timer — pause refreshing`},paused:{name:`paused`,lamp:`idle`,head:`PAUSED`,tail:null,title:`Resume refreshing`},offline:{name:`offline`,lamp:`down`,head:`OFFLINE`,tail:null,title:`Not refreshing — this session ended, sign in again`}},Nt=[`system`,`light`,`dark`],Pt={system:`Match system theme`,light:`Light theme`,dark:`Dark theme`},Ft=6e5;function It({logs:e,logsFailed:r,signOut:a}){let{live:o,toggle:c,connection:l}=fe(),{mode:u,setMode:f}=yt(),h=Date.now(),g=oe(()=>e.filter(e=>h-e.at<=Ft),[e,h]),_=p(g,Ft),v=s(g,{now:h,spanMs:Ft,count:24}),b=Nt[(Nt.indexOf(u)+1)%Nt.length]??`system`,x=u===`light`?tt:u===`dark`?Ge:Ue,w=Mt[o?l.status===`offline`?`offline`:l.status===`push`?`push`:`poll`:`paused`],T=r||_.errorRate>=.25?`down`:_.errorRate>=.05?`warn`:g.length===0?`idle`:`ok`;return k(wt,{children:[k(Tt,{children:[O(d,{state:T,label:r?`request log unreadable`:`error rate ${t(_.errorRate)}`}),`Omnigateway`]}),k(Et,{children:[k(Ot,{children:[O(C,{children:`req`}),O(kt,{children:O(Ct,{values:v.map(e=>e.total),overlay:v.map(e=>e.errors),height:22,label:`${_.requests} requests in the last 10 minutes`})})]}),k(Dt,{children:[O(C,{children:`rate`}),O(y,{children:_.ratePerMin.toFixed(1)}),O(C,{children:`/min`})]}),k(Dt,{children:[O(C,{children:`err`}),O(y,{style:{color:_.errorRate>=.05?`var(--down)`:void 0},children:t(_.errorRate)})]}),k(Dt,{children:[O(C,{children:`ttft p50`}),O(y,{children:i(_.ttftP50)})]}),k(Dt,{children:[O(C,{children:`spend`}),O(y,{children:n(_.costUsd)})]})]}),O(S,{}),k(At,{type:`button`,$size:`sm`,onClick:c,"aria-pressed":o,"aria-label":w.name,title:w.title,children:[O(d,{state:w.lamp,label:w.name}),w.head,w.tail===null?null:k(se,{children:[O(jt,{"aria-hidden":`true`,children:`·`}),w.tail]})]}),O(m,{type:`button`,$variant:`ghost`,$size:`sm`,onClick:()=>f(b),"aria-label":Pt[u],title:`${Pt[u]} — switch to ${Pt[b].toLowerCase()}`,children:O(x,{})}),O(m,{type:`button`,$variant:`ghost`,$size:`sm`,"aria-label":`Sign out`,title:`Sign out`,disabled:a.pending,onClick:a.run,children:O(Ve,{})})]})}function Lt(){let t=c(),{cadence:n}=fe(),i=e(),a=r(200,n(1e4,`res:logs`));return O(It,{logs:a.data??[],logsFailed:a.isError,signOut:{pending:i.isPending,run:()=>{i.mutate(void 0,{onSuccess:()=>void t({to:`/login`})})}}})}function Rt(e){return`/plugins/${e}`}function zt(e){return e.filter(e=>e.nav!==null&&e.ui!==null).sort((e,t)=>e.id.localeCompare(t.id)).map(e=>({id:e.id,label:e.nav?.label??e.name,disabledReason:Bt(e)}))}function Bt(e){let t=e.ui;return t===null||t.compatible&&t.entry!==null?null:t.reason??`This plugin's interface does not match this gateway.`}var Vt=Object.defineProperty,Ht=(e,t)=>Vt(e,`name`,{value:t,configurable:!0});function Ut(e,t){if(typeof e==`function`)return e(t);e!=null&&(e.current=t)}Ht(Ut,`setRef`);function Wt(...e){return t=>{let n=!1,r=e.map(e=>{let r=Ut(e,t);return!n&&typeof r==`function`&&(n=!0),r});if(n)return()=>{for(let t=0;t<r.length;t++){let n=r[t];typeof n==`function`?n():Ut(e[t],null)}}}}Ht(Wt,`composeRefs`);function N(...e){return w.useCallback(Wt(...e),e)}Ht(N,`useComposedRefs`);var Gt=Object.defineProperty,P=(e,t)=>Gt(e,`name`,{value:t,configurable:!0});function Kt(e){let t=w.forwardRef((t,n)=>{let{children:r,...i}=t,a=null,o=!1,s=[];en(r)&&typeof an==`function`&&(r=an(r._payload)),w.Children.forEach(r,e=>{if(Qt(e)){o=!0;let t=e,n=`child`in t.props?t.props.child:t.props.children;en(n)&&typeof an==`function`&&(n=an(n._payload)),a=Yt(t,n),s.push(a?.props?.children)}else s.push(e)}),a?a=w.cloneElement(a,void 0,s):!o&&w.Children.count(r)===1&&w.isValidElement(r)&&(a=r);let c=a?Zt(a):void 0,l=N(n,c);if(!a){if(r||r===0)throw Error(o?rn(e):nn(e));return r}let u=Xt(i,a.props??{});return a.type!==w.Fragment&&(u.ref=n?l:c),w.cloneElement(a,u)});return t.displayName=`${e}.Slot`,t}P(Kt,`createSlot`);var qt=Symbol.for(`radix.slottable`);function Jt(e){let t=P(e=>`child`in e?e.children(e.child):e.children,`Slottable`);return t.displayName=`${e}.Slottable`,t.__radixId=qt,t}P(Jt,`createSlottable`);var Yt=P((e,t)=>{if(`child`in e.props){let t=e.props.child;return w.isValidElement(t)?w.cloneElement(t,void 0,e.props.children(t.props.children)):null}return w.isValidElement(t)?t:null},`getSlottableElementFromSlottable`);function Xt(e,t){let n={...t};for(let r in t){let i=e[r],a=t[r];/^on[A-Z]/.test(r)?i&&a?n[r]=(...e)=>{let t=a(...e);return i(...e),t}:i&&(n[r]=i):r===`style`?n[r]={...i,...a}:r===`className`&&(n[r]=[i,a].filter(Boolean).join(` `))}return{...e,...n}}P(Xt,`mergeProps`);function Zt(e){let t=Object.getOwnPropertyDescriptor(e.props,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}P(Zt,`getElementRef`);function Qt(e){return w.isValidElement(e)&&typeof e.type==`function`&&`__radixId`in e.type&&e.type.__radixId===qt}P(Qt,`isSlottable`);var $t=Symbol.for(`react.lazy`);function en(e){return typeof e==`object`&&!!e&&`$$typeof`in e&&e.$$typeof===$t&&`_payload`in e&&tn(e._payload)}P(en,`isLazyComponent`);function tn(e){return typeof e==`object`&&!!e&&`then`in e}P(tn,`isPromiseLike`);var nn=P(e=>`${e} failed to slot onto its children. Expected a single React element child or \`Slottable\`.`,`createSlotError`),rn=P(e=>`${e} failed to slot onto its \`Slottable\`. Expected \`Slottable\` to receive a single React element child.`,`createSlottableError`),an=w.use,on=Object.defineProperty,sn=(e,t)=>on(e,`name`,{value:t,configurable:!0}),F=[`a`,`button`,`div`,`form`,`h2`,`h3`,`img`,`input`,`label`,`li`,`nav`,`ol`,`p`,`select`,`span`,`svg`,`ul`].reduce((e,t)=>{let n=Kt(`Primitive.${t}`),r=w.forwardRef((e,r)=>{let{asChild:i,...a}=e,o=i?n:t;return typeof window<`u`&&(window[Symbol.for(`radix-ui`)]=!0),O(o,{...a,ref:r})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{});function cn(e,t){e&&pe.flushSync(()=>e.dispatchEvent(t))}sn(cn,`dispatchDiscreteCustomEvent`);var ln=Object.defineProperty,I=(e,t)=>ln(e,`name`,{value:t,configurable:!0});function un(e,t){let n=w.createContext(t);n.displayName=e+`Context`;let r=I(e=>{let{children:t,...r}=e,i=w.useMemo(()=>r,Object.values(r));return O(n.Provider,{value:i,children:t})},`Provider`);r.displayName=e+`Provider`;function i(r,i={}){let{optional:a=!1}=i,o=w.useContext(n);if(o)return o;if(t!==void 0)return t;if(!a)throw Error(`\`${r}\` must be used within \`${e}\``)}return I(i,`useContext`),[r,i]}I(un,`createContext`);function dn(e,t=[]){let n=[];function r(t,r){let i=w.createContext(r);i.displayName=t+`Context`;let a=n.length;n=[...n,r];let o=I(t=>{let{scope:n,children:r,...o}=t,s=n?.[e]?.[a]||i,c=w.useMemo(()=>o,Object.values(o));return O(s.Provider,{value:c,children:r})},`Provider`);o.displayName=t+`Provider`;function s(n,o,s={}){let{optional:c=!1}=s,l=o?.[e]?.[a]||i,u=w.useContext(l);if(u)return u;if(r!==void 0)return r;if(!c)throw Error(`\`${n}\` must be used within \`${t}\``)}return I(s,`useContext`),[o,s]}I(r,`createContext`);let i=I(()=>{let t=n.map(e=>w.createContext(e));return I(function(n){let r=n?.[e]||t;return w.useMemo(()=>({[`__scope${e}`]:{...n,[e]:r}}),[n,r])},`useScope`)},`createScope`);return i.scopeName=e,[r,fn(i,...t)]}I(dn,`createContextScope`);function fn(...e){let t=e[0];if(e.length===1)return t;let n=I(()=>{let n=e.map(e=>({useScope:e(),scopeName:e.scopeName}));return I(function(e){let r=n.reduce((t,{useScope:n,scopeName:r})=>{let i=n(e)[`__scope${r}`];return{...t,...i}},{});return w.useMemo(()=>({[`__scope${t.scopeName}`]:r}),[r])},`useComposedScopes`)},`createScope`);return n.scopeName=t.scopeName,n}I(fn,`composeContextScopes`);var pn=Object.defineProperty,L=(e,t)=>pn(e,`name`,{value:t,configurable:!0}),mn=!!(typeof window<`u`&&window.document&&window.document.createElement);function R(e,t,{checkForDefaultPrevented:n=!0}={}){return L(function(r){if(e?.(r),n===!1||!r||!r.defaultPrevented)return t?.(r)},`handleEvent`)}L(R,`composeEventHandlers`);function hn(e){if(!mn)throw Error(`Cannot access window outside of the DOM`);return e?.ownerDocument?.defaultView??window}L(hn,`getOwnerWindow`);function gn(e){if(!mn)throw Error(`Cannot access document outside of the DOM`);return e?.ownerDocument??document}L(gn,`getOwnerDocument`);function _n(e,t=!1){let{activeElement:n}=gn(e);if(!n?.nodeName)return null;if(vn(n)&&n.contentDocument)return _n(n.contentDocument.body,t);if(t){let e=n.getAttribute(`aria-activedescendant`);if(e){let t=gn(n).getElementById(e);if(t)return t}}return n}L(_n,`getActiveElement`);function vn(e){return e.tagName===`IFRAME`}L(vn,`isFrame`);var z=globalThis?.document?w.useLayoutEffect:()=>{},yn=Object.defineProperty,bn=(e,t)=>yn(e,`name`,{value:t,configurable:!0}),xn=w.useEffectEvent,Sn=w.useInsertionEffect;function Cn(e){if(typeof xn==`function`)return xn(e);let t=w.useRef(()=>{throw Error(`Cannot call an event handler while rendering.`)});return typeof Sn==`function`?Sn(()=>{t.current=e}):z(()=>{t.current=e}),w.useMemo(()=>((...e)=>t.current?.(...e)),[])}bn(Cn,`useEffectEvent`);var wn=Object.defineProperty,B=(e,t)=>wn(e,`name`,{value:t,configurable:!0}),Tn=w.useInsertionEffect||z;function En({prop:e,defaultProp:t,onChange:n=B(()=>{},`onChange`),caller:r}){let[i,a,o]=Dn({defaultProp:t,onChange:n}),s=e!==void 0;return[s?e:i,w.useCallback(t=>{if(s){let n=On(t)?t(e):t;n!==e&&o.current?.(n)}else a(t)},[s,e,a,o])]}B(En,`useControllableState`);function Dn({defaultProp:e,onChange:t}){let[n,r]=w.useState(e),i=w.useRef(n),a=w.useRef(t);return Tn(()=>{a.current=t},[t]),w.useEffect(()=>{i.current!==n&&(a.current?.(n),i.current=n)},[n,i]),[n,r,a]}B(Dn,`useUncontrolledState`);function On(e){return typeof e==`function`}B(On,`isFunction`);var kn=Symbol(`RADIX:SYNC_STATE`);function An(e,t,n,r){let{prop:i,defaultProp:a,onChange:o,caller:s}=t,c=i!==void 0,l=Cn(o),u=[{...n,state:a}];r&&u.push(r);let[d,f]=w.useReducer((t,n)=>{if(n.type===kn)return{...t,state:n.state};let r=e(t,n);return c&&!Object.is(r.state,t.state)&&l(r.state),r},...u),p=d.state,m=w.useRef(p);w.useEffect(()=>{m.current!==p&&(m.current=p,c||l(p))},[p,m,c]);let h=w.useMemo(()=>i===void 0?d:{...d,state:i},[d,i]);return w.useEffect(()=>{c&&!Object.is(i,d.state)&&f({type:kn,state:i})},[i,d.state,c]),[h,f]}B(An,`useControllableStateReducer`);var jn=Object.defineProperty,V=(e,t)=>jn(e,`name`,{value:t,configurable:!0});function Mn(e,t){return w.useReducer((e,n)=>t[e][n]??e,e)}V(Mn,`useStateMachine`);var Nn=V(e=>{let{present:t,children:n}=e,r=Pn(t),i=typeof n==`function`?n({present:r.isPresent}):w.Children.only(n),a=In(r.ref,Ln(i));return typeof n==`function`||r.isPresent?w.cloneElement(i,{ref:a}):null},`Presence`);function Pn(e){let[t,n]=w.useState(),r=w.useRef(null),i=w.useRef(e),a=w.useRef(`none`),o=w.useRef(void 0),[s,c]=Mn(e?`mounted`:`unmounted`,{mounted:{UNMOUNT:`unmounted`,ANIMATION_OUT:`unmountSuspended`},unmountSuspended:{MOUNT:`mounted`,ANIMATION_END:`unmounted`},unmounted:{MOUNT:`mounted`}});return w.useEffect(()=>{s===`mounted`?(a.current=o.current??H(r.current),o.current=void 0):a.current=`none`},[s]),z(()=>{let t=r.current,n=i.current;if(n!==e){let r=a.current,s=H(t);e?(o.current=s,c(`MOUNT`)):s===`none`||t?.display===`none`?c(`UNMOUNT`):c(n&&r!==s?`ANIMATION_OUT`:`UNMOUNT`),i.current=e}},[e,c]),z(()=>{if(t){let e,n=t.ownerDocument.defaultView??window,o=V(a=>{let o=H(r.current).includes(CSS.escape(a.animationName));if(a.target===t&&o&&(c(`ANIMATION_END`),!i.current)){let r=t.style.animationFillMode;t.style.animationFillMode=`forwards`,e=n.setTimeout(()=>{t.style.animationFillMode===`forwards`&&(t.style.animationFillMode=r)})}},`handleAnimationEnd`),s=V(e=>{e.target===t&&(a.current=H(r.current))},`handleAnimationStart`);return t.addEventListener(`animationstart`,s),t.addEventListener(`animationcancel`,o),t.addEventListener(`animationend`,o),()=>{n.clearTimeout(e),t.removeEventListener(`animationstart`,s),t.removeEventListener(`animationcancel`,o),t.removeEventListener(`animationend`,o)}}c(`ANIMATION_END`)},[t,c]),{isPresent:[`mounted`,`unmountSuspended`].includes(s),ref:w.useCallback(e=>{if(e){let t=getComputedStyle(e);r.current=t,o.current=H(t)}else r.current=null;n(e)},[])}}V(Pn,`usePresence`);function Fn(e,t){if(typeof e==`function`)return e(t);e!=null&&(e.current=t)}V(Fn,`setRef`);function In(...e){let t=w.useRef(e);return t.current=e,w.useCallback(e=>{let n=t.current,r=!1,i=n.map(t=>{let n=Fn(t,e);return!r&&typeof n==`function`&&(r=!0),n});if(r)return()=>{for(let e=0;e<i.length;e++){let t=i[e];typeof t==`function`?t():Fn(n[e],null)}}},[])}V(In,`useStableComposedRefs`);function H(e){return e?.animationName||`none`}V(H,`getAnimationName`);function Ln(e){let t=Object.getOwnPropertyDescriptor(e.props,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}V(Ln,`getElementRef`);var Rn=Object.defineProperty,zn=(e,t)=>Rn(e,`name`,{value:t,configurable:!0}),Bn=w.useId||(()=>void 0),Vn=0;function U(e){let[t,n]=w.useState(Bn());return z(()=>{e||n(e=>e??String(Vn++))},[e]),e||(t?`radix-${t}`:``)}zn(U,`useId`);var Hn=Object.defineProperty,Un=(e,t)=>Hn(e,`name`,{value:t,configurable:!0});function W(e){let t=w.useRef(e);return w.useEffect(()=>{t.current=e}),w.useMemo(()=>((...e)=>t.current?.(...e)),[])}Un(W,`useCallbackRef`);var Wn=Object.defineProperty,G=(e,t)=>Wn(e,`name`,{value:t,configurable:!0}),Gn=`dismissableLayer.update`,Kn=`dismissableLayer.pointerDownOutside`,qn=`dismissableLayer.focusOutside`,Jn,Yn=w.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set,dismissableSurfaces:new Set}),Xn=w.forwardRef(G(function(e,t){let{disableOutsidePointerEvents:n=!1,deferPointerDownOutside:r=!1,onEscapeKeyDown:i,onPointerDownOutside:a,onFocusOutside:o,onInteractOutside:s,onDismiss:c,...l}=e,u=w.useContext(Yn),[d,f]=w.useState(null),p=d?.ownerDocument??globalThis?.document,[,m]=w.useState({}),h=N(t,f),g=Array.from(u.layers),[_]=[...u.layersWithOutsidePointerEventsDisabled].slice(-1),v=_?g.indexOf(_):-1,y=d?g.indexOf(d):-1,b=u.layersWithOutsidePointerEventsDisabled.size>0,x=y>=v,S=w.useRef(!1),C=$n(e=>{a?.(e),s?.(e),e.defaultPrevented||c?.()},{ownerDocument:p,deferPointerDownOutside:r,isDeferredPointerDownOutsideRef:S,dismissableSurfaces:u.dismissableSurfaces,shouldHandlePointerDownOutside:w.useCallback(e=>{if(!(e instanceof Node))return!1;let t=[...u.branches].some(t=>t.contains(e));return x&&!t},[u.branches,x])}),T=er(e=>{if(r&&S.current)return;let t=e.target;[...u.branches].some(e=>e.contains(t))||(o?.(e),s?.(e),e.defaultPrevented||c?.())},p),ee=d?y===g.length-1:!1,E=W(e=>{e.key===`Escape`&&(i?.(e),!e.defaultPrevented&&c&&(e.preventDefault(),c()))});return w.useEffect(()=>{if(ee)return p.addEventListener(`keydown`,E,{capture:!0}),()=>p.removeEventListener(`keydown`,E,{capture:!0})},[p,ee,E]),w.useEffect(()=>{if(d)return n&&(u.layersWithOutsidePointerEventsDisabled.size===0&&(Jn=p.body.style.pointerEvents,p.body.style.pointerEvents=`none`),u.layersWithOutsidePointerEventsDisabled.add(d)),u.layers.add(d),tr(),()=>{n&&(u.layersWithOutsidePointerEventsDisabled.delete(d),u.layersWithOutsidePointerEventsDisabled.size===0&&(p.body.style.pointerEvents=Jn))}},[d,p,n,u]),w.useEffect(()=>()=>{d&&(u.layers.delete(d),u.layersWithOutsidePointerEventsDisabled.delete(d),tr())},[d,u]),w.useEffect(()=>{let e=G(()=>m({}),`handleUpdate`);return document.addEventListener(Gn,e),()=>document.removeEventListener(Gn,e)},[]),O(F.div,{...l,ref:h,style:{pointerEvents:b?x?`auto`:`none`:void 0,...e.style},onFocusCapture:R(e.onFocusCapture,T.onFocusCapture),onBlurCapture:R(e.onBlurCapture,T.onBlurCapture),onPointerDownCapture:R(e.onPointerDownCapture,C.onPointerDownCapture)})},`DismissableLayer`));function Zn(){let e=w.useContext(Yn),[t,n]=w.useState(null);return w.useEffect(()=>{if(t)return e.dismissableSurfaces.add(t),()=>{e.dismissableSurfaces.delete(t)}},[t,e.dismissableSurfaces]),n}G(Zn,`useDismissableLayerSurface`);var Qn=G(()=>!0,`IS_TRUE`);function $n(e,t){let{ownerDocument:n=globalThis?.document,deferPointerDownOutside:r=!1,isDeferredPointerDownOutsideRef:i,dismissableSurfaces:a,shouldHandlePointerDownOutside:o=Qn}=t,s=W(e),c=w.useRef(!1),l=w.useRef(!1),u=w.useRef(new Map),d=w.useRef(()=>{});return w.useEffect(()=>{function e(){l.current=!1,i.current=!1,u.current.clear()}G(e,`resetOutsideInteraction`);function t(){return Array.from(u.current.values()).some(Boolean)}G(t,`isOutsideInteractionIntercepted`);function f(e){if(!l.current)return;let t=e.target;t instanceof Node&&[...a].some(e=>e.contains(t))||u.current.set(e.type,!0),e.type===`click`&&window.setTimeout(()=>{l.current&&d.current()},0)}G(f,`handleInteractionCapture`);function p(e){l.current&&u.current.set(e.type,!1)}G(p,`handleInteractionBubble`);let m=G(a=>{if(a.target&&!c.current){let f=function(){n.removeEventListener(`click`,d.current);let r=t();e(),r||nr(Kn,s,p,{discrete:!0})};if(G(f,`handleAndDispatchPointerDownOutsideEvent`),!o(a.target)){n.removeEventListener(`click`,d.current),e(),c.current=!1;return}let p={originalEvent:a};l.current=!0,i.current=r&&a.button===0,u.current.clear(),!r||a.button!==0?f():(n.removeEventListener(`click`,d.current),d.current=f,n.addEventListener(`click`,d.current,{once:!0}))}else n.removeEventListener(`click`,d.current),e();c.current=!1},`handlePointerDown`),h=[`pointerup`,`mousedown`,`mouseup`,`touchstart`,`touchend`,`click`];for(let e of h)n.addEventListener(e,f,!0),n.addEventListener(e,p);let g=window.setTimeout(()=>{n.addEventListener(`pointerdown`,m)},0);return()=>{window.clearTimeout(g),n.removeEventListener(`pointerdown`,m),n.removeEventListener(`click`,d.current);for(let e of h)n.removeEventListener(e,f,!0),n.removeEventListener(e,p)}},[n,s,r,i,a,o]),{onPointerDownCapture:G(()=>c.current=!0,`onPointerDownCapture`)}}G($n,`usePointerDownOutside`);function er(e,t=globalThis?.document){let n=W(e),r=w.useRef(!1);return w.useEffect(()=>{let e=G(e=>{e.target&&!r.current&&nr(qn,n,{originalEvent:e},{discrete:!1})},`handleFocus`);return t.addEventListener(`focusin`,e),()=>t.removeEventListener(`focusin`,e)},[t,n]),{onFocusCapture:G(()=>r.current=!0,`onFocusCapture`),onBlurCapture:G(()=>r.current=!1,`onBlurCapture`)}}G(er,`useFocusOutside`);function tr(){let e=new CustomEvent(Gn);document.dispatchEvent(e)}G(tr,`dispatchUpdate`);function nr(e,t,n,{discrete:r}){let i=n.originalEvent.target,a=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&i.addEventListener(e,t,{once:!0}),r?cn(i,a):i.dispatchEvent(a)}G(nr,`handleAndDispatchCustomEvent`);var rr=Object.defineProperty,K=(e,t)=>rr(e,`name`,{value:t,configurable:!0}),ir=`focusScope.autoFocusOnMount`,ar=`focusScope.autoFocusOnUnmount`,or={bubbles:!1,cancelable:!0},sr=w.forwardRef(K(function(e,t){let{loop:n=!1,trapped:r=!1,onMountAutoFocus:i,onUnmountAutoFocus:a,...o}=e,[s,c]=w.useState(null),l=W(i),u=W(a),d=w.useRef(null),f=N(t,c),p=w.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;w.useEffect(()=>{if(r){let e=function(e){if(p.paused||!s)return;let t=e.target;s.contains(t)?d.current=t:q(d.current,{select:!0})},t=function(e){if(p.paused||!s)return;let t=e.relatedTarget;t!==null&&(s.contains(t)||q(d.current,{select:!0}))},n=function(e){if(document.activeElement===document.body)for(let t of e)t.removedNodes.length>0&&q(s)};K(e,`handleFocusIn`),K(t,`handleFocusOut`),K(n,`handleMutations`),document.addEventListener(`focusin`,e),document.addEventListener(`focusout`,t);let r=new MutationObserver(n);return s&&r.observe(s,{childList:!0,subtree:!0}),()=>{document.removeEventListener(`focusin`,e),document.removeEventListener(`focusout`,t),r.disconnect()}}},[r,s,p.paused]),w.useEffect(()=>{if(s){mr.add(p);let e=document.activeElement;if(!s.contains(e)){let t=new CustomEvent(ir,or);s.addEventListener(ir,l),s.dispatchEvent(t),t.defaultPrevented||(cr(_r(ur(s)),{select:!0}),document.activeElement===e&&q(s))}return()=>{s.removeEventListener(ir,l),setTimeout(()=>{let t=new CustomEvent(ar,or);s.addEventListener(ar,u),s.dispatchEvent(t),t.defaultPrevented||q(e??document.body,{select:!0}),s.removeEventListener(ar,u),mr.remove(p)},0)}}},[s,l,u,p]);let m=w.useCallback(e=>{if(!n&&!r||p.paused)return;let t=e.key===`Tab`&&!e.altKey&&!e.ctrlKey&&!e.metaKey,i=document.activeElement;if(t&&i){let t=e.currentTarget,[r,a]=lr(t);r&&a?!e.shiftKey&&i===a?(e.preventDefault(),n&&q(r,{select:!0})):e.shiftKey&&i===r&&(e.preventDefault(),n&&q(a,{select:!0})):i===t&&e.preventDefault()}},[n,r,p.paused]);return O(F.div,{tabIndex:-1,...o,ref:f,onKeyDown:m})},`FocusScope`));function cr(e,{select:t=!1}={}){let n=document.activeElement;for(let r of e)if(q(r,{select:t}),document.activeElement!==n)return}K(cr,`focusFirst`);function lr(e){let t=ur(e);return[dr(t,e),dr(t.reverse(),e)]}K(lr,`getTabbableEdges`);function ur(e){let t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:K(e=>{let t=e.tagName===`INPUT`&&e.type===`hidden`;return e.disabled||e.hidden||t?NodeFilter.FILTER_SKIP:e.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP},`acceptNode`)});for(;n.nextNode();)t.push(n.currentNode);return t}K(ur,`getTabbableCandidates`);function dr(e,t){let n=typeof t.checkVisibility==`function`&&t.checkVisibility({checkVisibilityCSS:!0});for(let r of e)if(!(n?!r.checkVisibility({checkVisibilityCSS:!0}):fr(r,{upTo:t})))return r}K(dr,`findVisible`);function fr(e,{upTo:t}){if(getComputedStyle(e).visibility===`hidden`)return!0;for(;e;){if(t!==void 0&&e===t)return!1;if(getComputedStyle(e).display===`none`)return!0;e=e.parentElement}return!1}K(fr,`isHidden`);function pr(e){return e instanceof HTMLInputElement&&`select`in e}K(pr,`isSelectableInput`);function q(e,{select:t=!1}={}){if(e&&e.focus){let n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&pr(e)&&t&&e.select()}}K(q,`focus`);var mr=hr();function hr(){let e=[];return{add(t){let n=e[0];t!==n&&n?.pause(),e=gr(e,t),e.unshift(t)},remove(t){e=gr(e,t),e[0]?.resume()}}}K(hr,`createFocusScopesStack`);function gr(e,t){let n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}K(gr,`arrayRemove`);function _r(e){return e.filter(e=>e.tagName!==`A`)}K(_r,`removeLinks`);var vr=Object.defineProperty,yr=w.forwardRef(((e,t)=>vr(e,`name`,{value:t,configurable:!0}))(function(e,t){let{container:n,...r}=e,[i,a]=w.useState(!1);z(()=>a(!0),[]);let o=n||i&&globalThis?.document?.body;return o?pe.createPortal(O(F.div,{...r,ref:t}),o):null},`Portal`)),br=Object.defineProperty,xr=(e,t)=>br(e,`name`,{value:t,configurable:!0}),Sr=0,Cr=null;function wr(e){return Tr(),e.children}xr(wr,`FocusGuards`);function Tr(){w.useEffect(()=>{Cr||={start:Er(),end:Er()};let{start:e,end:t}=Cr;return document.body.firstElementChild!==e&&document.body.insertAdjacentElement(`afterbegin`,e),document.body.lastElementChild!==t&&document.body.insertAdjacentElement(`beforeend`,t),Sr++,()=>{Sr===1&&(Cr?.start.remove(),Cr?.end.remove(),Cr=null),Sr=Math.max(0,Sr-1)}},[])}xr(Tr,`useFocusGuards`);function Er(){let e=document.createElement(`span`);return e.setAttribute(`data-radix-focus-guard`,``),e.tabIndex=0,e.style.outline=`none`,e.style.opacity=`0`,e.style.position=`fixed`,e.style.pointerEvents=`none`,e}xr(Er,`createFocusGuard`);var J=function(){return J=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n],t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},J.apply(this,arguments)};function Dr(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols==`function`)for(var i=0,r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]]);return n}function Or(e,t,n){if(n||arguments.length===2)for(var r=0,i=t.length,a;r<i;r++)(a||!(r in t))&&(a||=Array.prototype.slice.call(t,0,r),a[r]=t[r]);return e.concat(a||Array.prototype.slice.call(t))}var kr=`right-scroll-bar-position`,Ar=`width-before-scroll-bar`,jr=`with-scroll-bars-hidden`,Mr=`--removed-body-scroll-bar-size`;function Nr(e,t){return typeof e==`function`?e(t):e&&(e.current=t),e}function Pr(e,t){var n=D(function(){return{value:e,callback:t,facade:{get current(){return n.value},set current(e){var t=n.value;t!==e&&(n.value=e,n.callback(e,t))}}}})[0];return n.callback=t,n.facade}var Fr=typeof window<`u`?w.useLayoutEffect:w.useEffect,Ir=new WeakMap;function Lr(e,t){var n=Pr(t||null,function(t){return e.forEach(function(e){return Nr(e,t)})});return Fr(function(){var t=Ir.get(n);if(t){var r=new Set(t),i=new Set(e),a=n.current;r.forEach(function(e){i.has(e)||Nr(e,null)}),i.forEach(function(e){r.has(e)||Nr(e,a)})}Ir.set(n,e)},[e]),n}function Rr(e){return e}function zr(e,t){t===void 0&&(t=Rr);var n=[],r=!1;return{read:function(){if(r)throw Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return n.length?n[n.length-1]:e},useMedium:function(e){var i=t(e,r);return n.push(i),function(){n=n.filter(function(e){return e!==i})}},assignSyncMedium:function(e){for(r=!0;n.length;){var t=n;n=[],t.forEach(e)}n={push:function(t){return e(t)},filter:function(){return n}}},assignMedium:function(e){r=!0;var t=[];if(n.length){var i=n;n=[],i.forEach(e),t=n}var a=function(){var n=t;t=[],n.forEach(e)},o=function(){return Promise.resolve().then(a)};o(),n={push:function(e){t.push(e),o()},filter:function(e){return t=t.filter(e),n}}}}}function Br(e){e===void 0&&(e={});var t=zr(null);return t.options=J({async:!0,ssr:!1},e),t}var Vr=function(e){var t=e.sideCar,n=Dr(e,[`sideCar`]);if(!t)throw Error("Sidecar: please provide `sideCar` property to import the right car");var r=t.read();if(!r)throw Error(`Sidecar medium not found`);return w.createElement(r,J({},n))};Vr.isSideCarExport=!0;function Hr(e,t){return e.useMedium(t),Vr}var Ur=Br(),Wr=function(){},Gr=w.forwardRef(function(e,t){var n=w.useRef(null),r=w.useState({onScrollCapture:Wr,onWheelCapture:Wr,onTouchMoveCapture:Wr}),i=r[0],a=r[1],o=e.forwardProps,s=e.children,c=e.className,l=e.removeScrollBar,u=e.enabled,d=e.shards,f=e.sideCar,p=e.noRelative,m=e.noIsolation,h=e.inert,g=e.allowPinchZoom,_=e.as,v=_===void 0?`div`:_,y=e.gapMode,b=Dr(e,[`forwardProps`,`children`,`className`,`removeScrollBar`,`enabled`,`shards`,`sideCar`,`noRelative`,`noIsolation`,`inert`,`allowPinchZoom`,`as`,`gapMode`]),x=f,S=Lr([n,t]),C=J(J({},b),i);return w.createElement(w.Fragment,null,u&&w.createElement(x,{sideCar:Ur,removeScrollBar:l,shards:d,noRelative:p,noIsolation:m,inert:h,setCallbacks:a,allowPinchZoom:!!g,lockRef:n,gapMode:y}),o?w.cloneElement(w.Children.only(s),J(J({},C),{ref:S})):w.createElement(v,J({},C,{className:c,ref:S}),s))});Gr.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1},Gr.classNames={fullWidth:Ar,zeroRight:kr};var Kr=function(){if(typeof __webpack_nonce__<`u`)return __webpack_nonce__};function qr(){if(!document)return null;var e=document.createElement(`style`);e.type=`text/css`;var t=Kr();return t&&e.setAttribute(`nonce`,t),e}function Jr(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function Yr(e){(document.head||document.getElementsByTagName(`head`)[0]).appendChild(e)}var Xr=function(){var e=0,t=null;return{add:function(n){e==0&&(t=qr())&&(Jr(t,n),Yr(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},Zr=function(){var e=Xr();return function(t,n){w.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},Qr=function(){var e=Zr();return function(t){var n=t.styles,r=t.dynamic;return e(n,r),null}},$r={left:0,top:0,right:0,gap:0},ei=function(e){return parseInt(e||``,10)||0},ti=function(e){var t=window.getComputedStyle(document.body),n=t[e===`padding`?`paddingLeft`:`marginLeft`],r=t[e===`padding`?`paddingTop`:`marginTop`],i=t[e===`padding`?`paddingRight`:`marginRight`];return[ei(n),ei(r),ei(i)]},ni=function(e){if(e===void 0&&(e=`margin`),typeof window>`u`)return $r;var t=ti(e),n=document.documentElement.clientWidth,r=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,r-n+t[2]-t[0])}},ri=Qr(),ii=`data-scroll-locked`,ai=function(e,t,n,r){var i=e.left,a=e.top,o=e.right,s=e.gap;return n===void 0&&(n=`margin`),`
210
+ `,Mt={push:{name:`live, pushing`,lamp:`live`,head:`LIVE`,tail:`PUSH`,title:`Refreshing on gateway push — pause refreshing`},poll:{name:`live, polling`,lamp:`ok`,head:`LIVE`,tail:`POLL`,title:`Refreshing on a timer — pause refreshing`},paused:{name:`paused`,lamp:`idle`,head:`PAUSED`,tail:null,title:`Resume refreshing`},offline:{name:`offline`,lamp:`down`,head:`OFFLINE`,tail:null,title:`Not refreshing — this session ended, sign in again`}},Nt=[`system`,`light`,`dark`],Pt={system:`Match system theme`,light:`Light theme`,dark:`Dark theme`},Ft=6e5;function It({logs:e,logsFailed:t,signOut:n}){let{live:r,toggle:o,connection:c}=fe(),{mode:l,setMode:u}=yt(),h=Date.now(),g=oe(()=>e.filter(e=>h-e.at<=Ft),[e,h]),_=f(g,Ft),v=s(g,{now:h,spanMs:Ft,count:24}),b=Nt[(Nt.indexOf(l)+1)%Nt.length]??`system`,x=l===`light`?tt:l===`dark`?Ge:Ue,w=Mt[r?c.status===`offline`?`offline`:c.status===`push`?`push`:`poll`:`paused`],T=t||_.errorRate>=.25?`down`:_.errorRate>=.05?`warn`:g.length===0?`idle`:`ok`;return k(wt,{children:[k(Tt,{children:[O(d,{state:T,label:t?`request log unreadable`:`error rate ${a(_.errorRate)}`}),`Omnigateway`]}),k(Et,{children:[k(Ot,{children:[O(C,{children:`req`}),O(kt,{children:O(Ct,{values:v.map(e=>e.total),overlay:v.map(e=>e.errors),height:22,label:`${_.requests} requests in the last 10 minutes`})})]}),k(Dt,{children:[O(C,{children:`rate`}),O(y,{children:_.ratePerMin.toFixed(1)}),O(C,{children:`/min`})]}),k(Dt,{children:[O(C,{children:`err`}),O(y,{style:{color:_.errorRate>=.05?`var(--down)`:void 0},children:a(_.errorRate)})]}),k(Dt,{children:[O(C,{children:`ttft p50`}),O(y,{children:i(_.ttftP50)})]}),k(Dt,{children:[O(C,{children:`spend`}),O(y,{children:p(_.costUsd)})]})]}),O(S,{}),k(At,{type:`button`,$size:`sm`,onClick:o,"aria-pressed":r,"aria-label":w.name,title:w.title,children:[O(d,{state:w.lamp,label:w.name}),w.head,w.tail===null?null:k(se,{children:[O(jt,{"aria-hidden":`true`,children:`·`}),w.tail]})]}),O(m,{type:`button`,$variant:`ghost`,$size:`sm`,onClick:()=>u(b),"aria-label":Pt[l],title:`${Pt[l]} — switch to ${Pt[b].toLowerCase()}`,children:O(x,{})}),O(m,{type:`button`,$variant:`ghost`,$size:`sm`,"aria-label":`Sign out`,title:`Sign out`,disabled:n.pending,onClick:n.run,children:O(Ve,{})})]})}function Lt(){let e=u(),{cadence:n}=fe(),r=c(),i=t(200,n(1e4,`res:logs`));return O(It,{logs:i.data??[],logsFailed:i.isError,signOut:{pending:r.isPending,run:()=>{r.mutate(void 0,{onSuccess:()=>void e({to:`/login`})})}}})}function Rt(e){return`/plugins/${e}`}function zt(e){return e.filter(e=>e.nav!==null&&e.ui!==null).sort((e,t)=>e.id.localeCompare(t.id)).map(e=>({id:e.id,label:e.nav?.label??e.name,disabledReason:Bt(e)}))}function Bt(e){let t=e.ui;return t===null||t.compatible&&t.entry!==null?null:t.reason??`This plugin's interface does not match this gateway.`}var Vt=Object.defineProperty,Ht=(e,t)=>Vt(e,`name`,{value:t,configurable:!0});function Ut(e,t){if(typeof e==`function`)return e(t);e!=null&&(e.current=t)}Ht(Ut,`setRef`);function Wt(...e){return t=>{let n=!1,r=e.map(e=>{let r=Ut(e,t);return!n&&typeof r==`function`&&(n=!0),r});if(n)return()=>{for(let t=0;t<r.length;t++){let n=r[t];typeof n==`function`?n():Ut(e[t],null)}}}}Ht(Wt,`composeRefs`);function N(...e){return w.useCallback(Wt(...e),e)}Ht(N,`useComposedRefs`);var Gt=Object.defineProperty,P=(e,t)=>Gt(e,`name`,{value:t,configurable:!0});function Kt(e){let t=w.forwardRef((t,n)=>{let{children:r,...i}=t,a=null,o=!1,s=[];en(r)&&typeof an==`function`&&(r=an(r._payload)),w.Children.forEach(r,e=>{if(Qt(e)){o=!0;let t=e,n=`child`in t.props?t.props.child:t.props.children;en(n)&&typeof an==`function`&&(n=an(n._payload)),a=Yt(t,n),s.push(a?.props?.children)}else s.push(e)}),a?a=w.cloneElement(a,void 0,s):!o&&w.Children.count(r)===1&&w.isValidElement(r)&&(a=r);let c=a?Zt(a):void 0,l=N(n,c);if(!a){if(r||r===0)throw Error(o?rn(e):nn(e));return r}let u=Xt(i,a.props??{});return a.type!==w.Fragment&&(u.ref=n?l:c),w.cloneElement(a,u)});return t.displayName=`${e}.Slot`,t}P(Kt,`createSlot`);var qt=Symbol.for(`radix.slottable`);function Jt(e){let t=P(e=>`child`in e?e.children(e.child):e.children,`Slottable`);return t.displayName=`${e}.Slottable`,t.__radixId=qt,t}P(Jt,`createSlottable`);var Yt=P((e,t)=>{if(`child`in e.props){let t=e.props.child;return w.isValidElement(t)?w.cloneElement(t,void 0,e.props.children(t.props.children)):null}return w.isValidElement(t)?t:null},`getSlottableElementFromSlottable`);function Xt(e,t){let n={...t};for(let r in t){let i=e[r],a=t[r];/^on[A-Z]/.test(r)?i&&a?n[r]=(...e)=>{let t=a(...e);return i(...e),t}:i&&(n[r]=i):r===`style`?n[r]={...i,...a}:r===`className`&&(n[r]=[i,a].filter(Boolean).join(` `))}return{...e,...n}}P(Xt,`mergeProps`);function Zt(e){let t=Object.getOwnPropertyDescriptor(e.props,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}P(Zt,`getElementRef`);function Qt(e){return w.isValidElement(e)&&typeof e.type==`function`&&`__radixId`in e.type&&e.type.__radixId===qt}P(Qt,`isSlottable`);var $t=Symbol.for(`react.lazy`);function en(e){return typeof e==`object`&&!!e&&`$$typeof`in e&&e.$$typeof===$t&&`_payload`in e&&tn(e._payload)}P(en,`isLazyComponent`);function tn(e){return typeof e==`object`&&!!e&&`then`in e}P(tn,`isPromiseLike`);var nn=P(e=>`${e} failed to slot onto its children. Expected a single React element child or \`Slottable\`.`,`createSlotError`),rn=P(e=>`${e} failed to slot onto its \`Slottable\`. Expected \`Slottable\` to receive a single React element child.`,`createSlottableError`),an=w.use,on=Object.defineProperty,sn=(e,t)=>on(e,`name`,{value:t,configurable:!0}),F=[`a`,`button`,`div`,`form`,`h2`,`h3`,`img`,`input`,`label`,`li`,`nav`,`ol`,`p`,`select`,`span`,`svg`,`ul`].reduce((e,t)=>{let n=Kt(`Primitive.${t}`),r=w.forwardRef((e,r)=>{let{asChild:i,...a}=e,o=i?n:t;return typeof window<`u`&&(window[Symbol.for(`radix-ui`)]=!0),O(o,{...a,ref:r})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{});function cn(e,t){e&&pe.flushSync(()=>e.dispatchEvent(t))}sn(cn,`dispatchDiscreteCustomEvent`);var ln=Object.defineProperty,I=(e,t)=>ln(e,`name`,{value:t,configurable:!0});function un(e,t){let n=w.createContext(t);n.displayName=e+`Context`;let r=I(e=>{let{children:t,...r}=e,i=w.useMemo(()=>r,Object.values(r));return O(n.Provider,{value:i,children:t})},`Provider`);r.displayName=e+`Provider`;function i(r,i={}){let{optional:a=!1}=i,o=w.useContext(n);if(o)return o;if(t!==void 0)return t;if(!a)throw Error(`\`${r}\` must be used within \`${e}\``)}return I(i,`useContext`),[r,i]}I(un,`createContext`);function dn(e,t=[]){let n=[];function r(t,r){let i=w.createContext(r);i.displayName=t+`Context`;let a=n.length;n=[...n,r];let o=I(t=>{let{scope:n,children:r,...o}=t,s=n?.[e]?.[a]||i,c=w.useMemo(()=>o,Object.values(o));return O(s.Provider,{value:c,children:r})},`Provider`);o.displayName=t+`Provider`;function s(n,o,s={}){let{optional:c=!1}=s,l=o?.[e]?.[a]||i,u=w.useContext(l);if(u)return u;if(r!==void 0)return r;if(!c)throw Error(`\`${n}\` must be used within \`${t}\``)}return I(s,`useContext`),[o,s]}I(r,`createContext`);let i=I(()=>{let t=n.map(e=>w.createContext(e));return I(function(n){let r=n?.[e]||t;return w.useMemo(()=>({[`__scope${e}`]:{...n,[e]:r}}),[n,r])},`useScope`)},`createScope`);return i.scopeName=e,[r,fn(i,...t)]}I(dn,`createContextScope`);function fn(...e){let t=e[0];if(e.length===1)return t;let n=I(()=>{let n=e.map(e=>({useScope:e(),scopeName:e.scopeName}));return I(function(e){let r=n.reduce((t,{useScope:n,scopeName:r})=>{let i=n(e)[`__scope${r}`];return{...t,...i}},{});return w.useMemo(()=>({[`__scope${t.scopeName}`]:r}),[r])},`useComposedScopes`)},`createScope`);return n.scopeName=t.scopeName,n}I(fn,`composeContextScopes`);var pn=Object.defineProperty,L=(e,t)=>pn(e,`name`,{value:t,configurable:!0}),mn=!!(typeof window<`u`&&window.document&&window.document.createElement);function R(e,t,{checkForDefaultPrevented:n=!0}={}){return L(function(r){if(e?.(r),n===!1||!r||!r.defaultPrevented)return t?.(r)},`handleEvent`)}L(R,`composeEventHandlers`);function hn(e){if(!mn)throw Error(`Cannot access window outside of the DOM`);return e?.ownerDocument?.defaultView??window}L(hn,`getOwnerWindow`);function gn(e){if(!mn)throw Error(`Cannot access document outside of the DOM`);return e?.ownerDocument??document}L(gn,`getOwnerDocument`);function _n(e,t=!1){let{activeElement:n}=gn(e);if(!n?.nodeName)return null;if(vn(n)&&n.contentDocument)return _n(n.contentDocument.body,t);if(t){let e=n.getAttribute(`aria-activedescendant`);if(e){let t=gn(n).getElementById(e);if(t)return t}}return n}L(_n,`getActiveElement`);function vn(e){return e.tagName===`IFRAME`}L(vn,`isFrame`);var z=globalThis?.document?w.useLayoutEffect:()=>{},yn=Object.defineProperty,bn=(e,t)=>yn(e,`name`,{value:t,configurable:!0}),xn=w.useEffectEvent,Sn=w.useInsertionEffect;function Cn(e){if(typeof xn==`function`)return xn(e);let t=w.useRef(()=>{throw Error(`Cannot call an event handler while rendering.`)});return typeof Sn==`function`?Sn(()=>{t.current=e}):z(()=>{t.current=e}),w.useMemo(()=>((...e)=>t.current?.(...e)),[])}bn(Cn,`useEffectEvent`);var wn=Object.defineProperty,B=(e,t)=>wn(e,`name`,{value:t,configurable:!0}),Tn=w.useInsertionEffect||z;function En({prop:e,defaultProp:t,onChange:n=B(()=>{},`onChange`),caller:r}){let[i,a,o]=Dn({defaultProp:t,onChange:n}),s=e!==void 0;return[s?e:i,w.useCallback(t=>{if(s){let n=On(t)?t(e):t;n!==e&&o.current?.(n)}else a(t)},[s,e,a,o])]}B(En,`useControllableState`);function Dn({defaultProp:e,onChange:t}){let[n,r]=w.useState(e),i=w.useRef(n),a=w.useRef(t);return Tn(()=>{a.current=t},[t]),w.useEffect(()=>{i.current!==n&&(a.current?.(n),i.current=n)},[n,i]),[n,r,a]}B(Dn,`useUncontrolledState`);function On(e){return typeof e==`function`}B(On,`isFunction`);var kn=Symbol(`RADIX:SYNC_STATE`);function An(e,t,n,r){let{prop:i,defaultProp:a,onChange:o,caller:s}=t,c=i!==void 0,l=Cn(o),u=[{...n,state:a}];r&&u.push(r);let[d,f]=w.useReducer((t,n)=>{if(n.type===kn)return{...t,state:n.state};let r=e(t,n);return c&&!Object.is(r.state,t.state)&&l(r.state),r},...u),p=d.state,m=w.useRef(p);w.useEffect(()=>{m.current!==p&&(m.current=p,c||l(p))},[p,m,c]);let h=w.useMemo(()=>i===void 0?d:{...d,state:i},[d,i]);return w.useEffect(()=>{c&&!Object.is(i,d.state)&&f({type:kn,state:i})},[i,d.state,c]),[h,f]}B(An,`useControllableStateReducer`);var jn=Object.defineProperty,V=(e,t)=>jn(e,`name`,{value:t,configurable:!0});function Mn(e,t){return w.useReducer((e,n)=>t[e][n]??e,e)}V(Mn,`useStateMachine`);var Nn=V(e=>{let{present:t,children:n}=e,r=Pn(t),i=typeof n==`function`?n({present:r.isPresent}):w.Children.only(n),a=In(r.ref,Ln(i));return typeof n==`function`||r.isPresent?w.cloneElement(i,{ref:a}):null},`Presence`);function Pn(e){let[t,n]=w.useState(),r=w.useRef(null),i=w.useRef(e),a=w.useRef(`none`),o=w.useRef(void 0),[s,c]=Mn(e?`mounted`:`unmounted`,{mounted:{UNMOUNT:`unmounted`,ANIMATION_OUT:`unmountSuspended`},unmountSuspended:{MOUNT:`mounted`,ANIMATION_END:`unmounted`},unmounted:{MOUNT:`mounted`}});return w.useEffect(()=>{s===`mounted`?(a.current=o.current??H(r.current),o.current=void 0):a.current=`none`},[s]),z(()=>{let t=r.current,n=i.current;if(n!==e){let r=a.current,s=H(t);e?(o.current=s,c(`MOUNT`)):s===`none`||t?.display===`none`?c(`UNMOUNT`):c(n&&r!==s?`ANIMATION_OUT`:`UNMOUNT`),i.current=e}},[e,c]),z(()=>{if(t){let e,n=t.ownerDocument.defaultView??window,o=V(a=>{let o=H(r.current).includes(CSS.escape(a.animationName));if(a.target===t&&o&&(c(`ANIMATION_END`),!i.current)){let r=t.style.animationFillMode;t.style.animationFillMode=`forwards`,e=n.setTimeout(()=>{t.style.animationFillMode===`forwards`&&(t.style.animationFillMode=r)})}},`handleAnimationEnd`),s=V(e=>{e.target===t&&(a.current=H(r.current))},`handleAnimationStart`);return t.addEventListener(`animationstart`,s),t.addEventListener(`animationcancel`,o),t.addEventListener(`animationend`,o),()=>{n.clearTimeout(e),t.removeEventListener(`animationstart`,s),t.removeEventListener(`animationcancel`,o),t.removeEventListener(`animationend`,o)}}c(`ANIMATION_END`)},[t,c]),{isPresent:[`mounted`,`unmountSuspended`].includes(s),ref:w.useCallback(e=>{if(e){let t=getComputedStyle(e);r.current=t,o.current=H(t)}else r.current=null;n(e)},[])}}V(Pn,`usePresence`);function Fn(e,t){if(typeof e==`function`)return e(t);e!=null&&(e.current=t)}V(Fn,`setRef`);function In(...e){let t=w.useRef(e);return t.current=e,w.useCallback(e=>{let n=t.current,r=!1,i=n.map(t=>{let n=Fn(t,e);return!r&&typeof n==`function`&&(r=!0),n});if(r)return()=>{for(let e=0;e<i.length;e++){let t=i[e];typeof t==`function`?t():Fn(n[e],null)}}},[])}V(In,`useStableComposedRefs`);function H(e){return e?.animationName||`none`}V(H,`getAnimationName`);function Ln(e){let t=Object.getOwnPropertyDescriptor(e.props,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}V(Ln,`getElementRef`);var Rn=Object.defineProperty,zn=(e,t)=>Rn(e,`name`,{value:t,configurable:!0}),Bn=w.useId||(()=>void 0),Vn=0;function U(e){let[t,n]=w.useState(Bn());return z(()=>{e||n(e=>e??String(Vn++))},[e]),e||(t?`radix-${t}`:``)}zn(U,`useId`);var Hn=Object.defineProperty,Un=(e,t)=>Hn(e,`name`,{value:t,configurable:!0});function W(e){let t=w.useRef(e);return w.useEffect(()=>{t.current=e}),w.useMemo(()=>((...e)=>t.current?.(...e)),[])}Un(W,`useCallbackRef`);var Wn=Object.defineProperty,G=(e,t)=>Wn(e,`name`,{value:t,configurable:!0}),Gn=`dismissableLayer.update`,Kn=`dismissableLayer.pointerDownOutside`,qn=`dismissableLayer.focusOutside`,Jn,Yn=w.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set,dismissableSurfaces:new Set}),Xn=w.forwardRef(G(function(e,t){let{disableOutsidePointerEvents:n=!1,deferPointerDownOutside:r=!1,onEscapeKeyDown:i,onPointerDownOutside:a,onFocusOutside:o,onInteractOutside:s,onDismiss:c,...l}=e,u=w.useContext(Yn),[d,f]=w.useState(null),p=d?.ownerDocument??globalThis?.document,[,m]=w.useState({}),h=N(t,f),g=Array.from(u.layers),[_]=[...u.layersWithOutsidePointerEventsDisabled].slice(-1),v=_?g.indexOf(_):-1,y=d?g.indexOf(d):-1,b=u.layersWithOutsidePointerEventsDisabled.size>0,x=y>=v,S=w.useRef(!1),C=$n(e=>{a?.(e),s?.(e),e.defaultPrevented||c?.()},{ownerDocument:p,deferPointerDownOutside:r,isDeferredPointerDownOutsideRef:S,dismissableSurfaces:u.dismissableSurfaces,shouldHandlePointerDownOutside:w.useCallback(e=>{if(!(e instanceof Node))return!1;let t=[...u.branches].some(t=>t.contains(e));return x&&!t},[u.branches,x])}),T=er(e=>{if(r&&S.current)return;let t=e.target;[...u.branches].some(e=>e.contains(t))||(o?.(e),s?.(e),e.defaultPrevented||c?.())},p),ee=d?y===g.length-1:!1,E=W(e=>{e.key===`Escape`&&(i?.(e),!e.defaultPrevented&&c&&(e.preventDefault(),c()))});return w.useEffect(()=>{if(ee)return p.addEventListener(`keydown`,E,{capture:!0}),()=>p.removeEventListener(`keydown`,E,{capture:!0})},[p,ee,E]),w.useEffect(()=>{if(d)return n&&(u.layersWithOutsidePointerEventsDisabled.size===0&&(Jn=p.body.style.pointerEvents,p.body.style.pointerEvents=`none`),u.layersWithOutsidePointerEventsDisabled.add(d)),u.layers.add(d),tr(),()=>{n&&(u.layersWithOutsidePointerEventsDisabled.delete(d),u.layersWithOutsidePointerEventsDisabled.size===0&&(p.body.style.pointerEvents=Jn))}},[d,p,n,u]),w.useEffect(()=>()=>{d&&(u.layers.delete(d),u.layersWithOutsidePointerEventsDisabled.delete(d),tr())},[d,u]),w.useEffect(()=>{let e=G(()=>m({}),`handleUpdate`);return document.addEventListener(Gn,e),()=>document.removeEventListener(Gn,e)},[]),O(F.div,{...l,ref:h,style:{pointerEvents:b?x?`auto`:`none`:void 0,...e.style},onFocusCapture:R(e.onFocusCapture,T.onFocusCapture),onBlurCapture:R(e.onBlurCapture,T.onBlurCapture),onPointerDownCapture:R(e.onPointerDownCapture,C.onPointerDownCapture)})},`DismissableLayer`));function Zn(){let e=w.useContext(Yn),[t,n]=w.useState(null);return w.useEffect(()=>{if(t)return e.dismissableSurfaces.add(t),()=>{e.dismissableSurfaces.delete(t)}},[t,e.dismissableSurfaces]),n}G(Zn,`useDismissableLayerSurface`);var Qn=G(()=>!0,`IS_TRUE`);function $n(e,t){let{ownerDocument:n=globalThis?.document,deferPointerDownOutside:r=!1,isDeferredPointerDownOutsideRef:i,dismissableSurfaces:a,shouldHandlePointerDownOutside:o=Qn}=t,s=W(e),c=w.useRef(!1),l=w.useRef(!1),u=w.useRef(new Map),d=w.useRef(()=>{});return w.useEffect(()=>{function e(){l.current=!1,i.current=!1,u.current.clear()}G(e,`resetOutsideInteraction`);function t(){return Array.from(u.current.values()).some(Boolean)}G(t,`isOutsideInteractionIntercepted`);function f(e){if(!l.current)return;let t=e.target;t instanceof Node&&[...a].some(e=>e.contains(t))||u.current.set(e.type,!0),e.type===`click`&&window.setTimeout(()=>{l.current&&d.current()},0)}G(f,`handleInteractionCapture`);function p(e){l.current&&u.current.set(e.type,!1)}G(p,`handleInteractionBubble`);let m=G(a=>{if(a.target&&!c.current){let f=function(){n.removeEventListener(`click`,d.current);let r=t();e(),r||nr(Kn,s,p,{discrete:!0})};if(G(f,`handleAndDispatchPointerDownOutsideEvent`),!o(a.target)){n.removeEventListener(`click`,d.current),e(),c.current=!1;return}let p={originalEvent:a};l.current=!0,i.current=r&&a.button===0,u.current.clear(),!r||a.button!==0?f():(n.removeEventListener(`click`,d.current),d.current=f,n.addEventListener(`click`,d.current,{once:!0}))}else n.removeEventListener(`click`,d.current),e();c.current=!1},`handlePointerDown`),h=[`pointerup`,`mousedown`,`mouseup`,`touchstart`,`touchend`,`click`];for(let e of h)n.addEventListener(e,f,!0),n.addEventListener(e,p);let g=window.setTimeout(()=>{n.addEventListener(`pointerdown`,m)},0);return()=>{window.clearTimeout(g),n.removeEventListener(`pointerdown`,m),n.removeEventListener(`click`,d.current);for(let e of h)n.removeEventListener(e,f,!0),n.removeEventListener(e,p)}},[n,s,r,i,a,o]),{onPointerDownCapture:G(()=>c.current=!0,`onPointerDownCapture`)}}G($n,`usePointerDownOutside`);function er(e,t=globalThis?.document){let n=W(e),r=w.useRef(!1);return w.useEffect(()=>{let e=G(e=>{e.target&&!r.current&&nr(qn,n,{originalEvent:e},{discrete:!1})},`handleFocus`);return t.addEventListener(`focusin`,e),()=>t.removeEventListener(`focusin`,e)},[t,n]),{onFocusCapture:G(()=>r.current=!0,`onFocusCapture`),onBlurCapture:G(()=>r.current=!1,`onBlurCapture`)}}G(er,`useFocusOutside`);function tr(){let e=new CustomEvent(Gn);document.dispatchEvent(e)}G(tr,`dispatchUpdate`);function nr(e,t,n,{discrete:r}){let i=n.originalEvent.target,a=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&i.addEventListener(e,t,{once:!0}),r?cn(i,a):i.dispatchEvent(a)}G(nr,`handleAndDispatchCustomEvent`);var rr=Object.defineProperty,K=(e,t)=>rr(e,`name`,{value:t,configurable:!0}),ir=`focusScope.autoFocusOnMount`,ar=`focusScope.autoFocusOnUnmount`,or={bubbles:!1,cancelable:!0},sr=w.forwardRef(K(function(e,t){let{loop:n=!1,trapped:r=!1,onMountAutoFocus:i,onUnmountAutoFocus:a,...o}=e,[s,c]=w.useState(null),l=W(i),u=W(a),d=w.useRef(null),f=N(t,c),p=w.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;w.useEffect(()=>{if(r){let e=function(e){if(p.paused||!s)return;let t=e.target;s.contains(t)?d.current=t:q(d.current,{select:!0})},t=function(e){if(p.paused||!s)return;let t=e.relatedTarget;t!==null&&(s.contains(t)||q(d.current,{select:!0}))},n=function(e){if(document.activeElement===document.body)for(let t of e)t.removedNodes.length>0&&q(s)};K(e,`handleFocusIn`),K(t,`handleFocusOut`),K(n,`handleMutations`),document.addEventListener(`focusin`,e),document.addEventListener(`focusout`,t);let r=new MutationObserver(n);return s&&r.observe(s,{childList:!0,subtree:!0}),()=>{document.removeEventListener(`focusin`,e),document.removeEventListener(`focusout`,t),r.disconnect()}}},[r,s,p.paused]),w.useEffect(()=>{if(s){mr.add(p);let e=document.activeElement;if(!s.contains(e)){let t=new CustomEvent(ir,or);s.addEventListener(ir,l),s.dispatchEvent(t),t.defaultPrevented||(cr(_r(ur(s)),{select:!0}),document.activeElement===e&&q(s))}return()=>{s.removeEventListener(ir,l),setTimeout(()=>{let t=new CustomEvent(ar,or);s.addEventListener(ar,u),s.dispatchEvent(t),t.defaultPrevented||q(e??document.body,{select:!0}),s.removeEventListener(ar,u),mr.remove(p)},0)}}},[s,l,u,p]);let m=w.useCallback(e=>{if(!n&&!r||p.paused)return;let t=e.key===`Tab`&&!e.altKey&&!e.ctrlKey&&!e.metaKey,i=document.activeElement;if(t&&i){let t=e.currentTarget,[r,a]=lr(t);r&&a?!e.shiftKey&&i===a?(e.preventDefault(),n&&q(r,{select:!0})):e.shiftKey&&i===r&&(e.preventDefault(),n&&q(a,{select:!0})):i===t&&e.preventDefault()}},[n,r,p.paused]);return O(F.div,{tabIndex:-1,...o,ref:f,onKeyDown:m})},`FocusScope`));function cr(e,{select:t=!1}={}){let n=document.activeElement;for(let r of e)if(q(r,{select:t}),document.activeElement!==n)return}K(cr,`focusFirst`);function lr(e){let t=ur(e);return[dr(t,e),dr(t.reverse(),e)]}K(lr,`getTabbableEdges`);function ur(e){let t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:K(e=>{let t=e.tagName===`INPUT`&&e.type===`hidden`;return e.disabled||e.hidden||t?NodeFilter.FILTER_SKIP:e.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP},`acceptNode`)});for(;n.nextNode();)t.push(n.currentNode);return t}K(ur,`getTabbableCandidates`);function dr(e,t){let n=typeof t.checkVisibility==`function`&&t.checkVisibility({checkVisibilityCSS:!0});for(let r of e)if(!(n?!r.checkVisibility({checkVisibilityCSS:!0}):fr(r,{upTo:t})))return r}K(dr,`findVisible`);function fr(e,{upTo:t}){if(getComputedStyle(e).visibility===`hidden`)return!0;for(;e;){if(t!==void 0&&e===t)return!1;if(getComputedStyle(e).display===`none`)return!0;e=e.parentElement}return!1}K(fr,`isHidden`);function pr(e){return e instanceof HTMLInputElement&&`select`in e}K(pr,`isSelectableInput`);function q(e,{select:t=!1}={}){if(e&&e.focus){let n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&pr(e)&&t&&e.select()}}K(q,`focus`);var mr=hr();function hr(){let e=[];return{add(t){let n=e[0];t!==n&&n?.pause(),e=gr(e,t),e.unshift(t)},remove(t){e=gr(e,t),e[0]?.resume()}}}K(hr,`createFocusScopesStack`);function gr(e,t){let n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}K(gr,`arrayRemove`);function _r(e){return e.filter(e=>e.tagName!==`A`)}K(_r,`removeLinks`);var vr=Object.defineProperty,yr=w.forwardRef(((e,t)=>vr(e,`name`,{value:t,configurable:!0}))(function(e,t){let{container:n,...r}=e,[i,a]=w.useState(!1);z(()=>a(!0),[]);let o=n||i&&globalThis?.document?.body;return o?pe.createPortal(O(F.div,{...r,ref:t}),o):null},`Portal`)),br=Object.defineProperty,xr=(e,t)=>br(e,`name`,{value:t,configurable:!0}),Sr=0,Cr=null;function wr(e){return Tr(),e.children}xr(wr,`FocusGuards`);function Tr(){w.useEffect(()=>{Cr||={start:Er(),end:Er()};let{start:e,end:t}=Cr;return document.body.firstElementChild!==e&&document.body.insertAdjacentElement(`afterbegin`,e),document.body.lastElementChild!==t&&document.body.insertAdjacentElement(`beforeend`,t),Sr++,()=>{Sr===1&&(Cr?.start.remove(),Cr?.end.remove(),Cr=null),Sr=Math.max(0,Sr-1)}},[])}xr(Tr,`useFocusGuards`);function Er(){let e=document.createElement(`span`);return e.setAttribute(`data-radix-focus-guard`,``),e.tabIndex=0,e.style.outline=`none`,e.style.opacity=`0`,e.style.position=`fixed`,e.style.pointerEvents=`none`,e}xr(Er,`createFocusGuard`);var J=function(){return J=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n],t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},J.apply(this,arguments)};function Dr(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols==`function`)for(var i=0,r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]]);return n}function Or(e,t,n){if(n||arguments.length===2)for(var r=0,i=t.length,a;r<i;r++)(a||!(r in t))&&(a||=Array.prototype.slice.call(t,0,r),a[r]=t[r]);return e.concat(a||Array.prototype.slice.call(t))}var kr=`right-scroll-bar-position`,Ar=`width-before-scroll-bar`,jr=`with-scroll-bars-hidden`,Mr=`--removed-body-scroll-bar-size`;function Nr(e,t){return typeof e==`function`?e(t):e&&(e.current=t),e}function Pr(e,t){var n=D(function(){return{value:e,callback:t,facade:{get current(){return n.value},set current(e){var t=n.value;t!==e&&(n.value=e,n.callback(e,t))}}}})[0];return n.callback=t,n.facade}var Fr=typeof window<`u`?w.useLayoutEffect:w.useEffect,Ir=new WeakMap;function Lr(e,t){var n=Pr(t||null,function(t){return e.forEach(function(e){return Nr(e,t)})});return Fr(function(){var t=Ir.get(n);if(t){var r=new Set(t),i=new Set(e),a=n.current;r.forEach(function(e){i.has(e)||Nr(e,null)}),i.forEach(function(e){r.has(e)||Nr(e,a)})}Ir.set(n,e)},[e]),n}function Rr(e){return e}function zr(e,t){t===void 0&&(t=Rr);var n=[],r=!1;return{read:function(){if(r)throw Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return n.length?n[n.length-1]:e},useMedium:function(e){var i=t(e,r);return n.push(i),function(){n=n.filter(function(e){return e!==i})}},assignSyncMedium:function(e){for(r=!0;n.length;){var t=n;n=[],t.forEach(e)}n={push:function(t){return e(t)},filter:function(){return n}}},assignMedium:function(e){r=!0;var t=[];if(n.length){var i=n;n=[],i.forEach(e),t=n}var a=function(){var n=t;t=[],n.forEach(e)},o=function(){return Promise.resolve().then(a)};o(),n={push:function(e){t.push(e),o()},filter:function(e){return t=t.filter(e),n}}}}}function Br(e){e===void 0&&(e={});var t=zr(null);return t.options=J({async:!0,ssr:!1},e),t}var Vr=function(e){var t=e.sideCar,n=Dr(e,[`sideCar`]);if(!t)throw Error("Sidecar: please provide `sideCar` property to import the right car");var r=t.read();if(!r)throw Error(`Sidecar medium not found`);return w.createElement(r,J({},n))};Vr.isSideCarExport=!0;function Hr(e,t){return e.useMedium(t),Vr}var Ur=Br(),Wr=function(){},Gr=w.forwardRef(function(e,t){var n=w.useRef(null),r=w.useState({onScrollCapture:Wr,onWheelCapture:Wr,onTouchMoveCapture:Wr}),i=r[0],a=r[1],o=e.forwardProps,s=e.children,c=e.className,l=e.removeScrollBar,u=e.enabled,d=e.shards,f=e.sideCar,p=e.noRelative,m=e.noIsolation,h=e.inert,g=e.allowPinchZoom,_=e.as,v=_===void 0?`div`:_,y=e.gapMode,b=Dr(e,[`forwardProps`,`children`,`className`,`removeScrollBar`,`enabled`,`shards`,`sideCar`,`noRelative`,`noIsolation`,`inert`,`allowPinchZoom`,`as`,`gapMode`]),x=f,S=Lr([n,t]),C=J(J({},b),i);return w.createElement(w.Fragment,null,u&&w.createElement(x,{sideCar:Ur,removeScrollBar:l,shards:d,noRelative:p,noIsolation:m,inert:h,setCallbacks:a,allowPinchZoom:!!g,lockRef:n,gapMode:y}),o?w.cloneElement(w.Children.only(s),J(J({},C),{ref:S})):w.createElement(v,J({},C,{className:c,ref:S}),s))});Gr.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1},Gr.classNames={fullWidth:Ar,zeroRight:kr};var Kr=function(){if(typeof __webpack_nonce__<`u`)return __webpack_nonce__};function qr(){if(!document)return null;var e=document.createElement(`style`);e.type=`text/css`;var t=Kr();return t&&e.setAttribute(`nonce`,t),e}function Jr(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function Yr(e){(document.head||document.getElementsByTagName(`head`)[0]).appendChild(e)}var Xr=function(){var e=0,t=null;return{add:function(n){e==0&&(t=qr())&&(Jr(t,n),Yr(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},Zr=function(){var e=Xr();return function(t,n){w.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},Qr=function(){var e=Zr();return function(t){var n=t.styles,r=t.dynamic;return e(n,r),null}},$r={left:0,top:0,right:0,gap:0},ei=function(e){return parseInt(e||``,10)||0},ti=function(e){var t=window.getComputedStyle(document.body),n=t[e===`padding`?`paddingLeft`:`marginLeft`],r=t[e===`padding`?`paddingTop`:`marginTop`],i=t[e===`padding`?`paddingRight`:`marginRight`];return[ei(n),ei(r),ei(i)]},ni=function(e){if(e===void 0&&(e=`margin`),typeof window>`u`)return $r;var t=ti(e),n=document.documentElement.clientWidth,r=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,r-n+t[2]-t[0])}},ri=Qr(),ii=`data-scroll-locked`,ai=function(e,t,n,r){var i=e.left,a=e.top,o=e.right,s=e.gap;return n===void 0&&(n=`margin`),`
211
211
  .${jr} {
212
212
  overflow: hidden ${r};
213
213
  padding-right: ${s}px ${r};
@@ -351,7 +351,7 @@ import{Dt as e,F as t,L as n,Ot as r,P as i,Rt as a,Xt as o,i as s,in as c,jt as
351
351
  font-size: 10.5px;
352
352
  line-height: 1.3;
353
353
  color: ${({theme:e})=>e.color.inkDim};
354
- `,Aa=9e4;async function ja(){try{return(await fetch(`/health`,{cache:`no-store`})).ok}catch{return!1}}function Ma({pollMs:e=750}){let t=f(),n=a(),r=o(),[i,s]=D(null),[c,l]=D(!1),[u,d]=D(!1),[p,m]=D(`idle`),h=t.data;ie(()=>{if(!c)return;let t=!1,n,r=!1,i=0,a=Math.max(1,Math.ceil(Aa/e)),o=async()=>{let s=await ja();if(!t){if(!r&&!s)r=!0,m(`returning`);else if(r&&s){window.location.reload();return}if(i+=1,i>=a){m(`lost`),l(!1);return}n=setTimeout(()=>void o(),e)}};return n=setTimeout(()=>void o(),e),()=>{t=!0,n!==void 0&&clearTimeout(n)}},[c,e]);let g=()=>{m(`leaving`),n.mutate(void 0,{onSuccess:()=>l(!0),onError:()=>m(`idle`)})};return u?k(se,{children:[O(S,{}),h===void 0?null:k(Oa,{children:[`omnigateway v`,h.version]}),O(Sa,{}),O(Ca,{children:k(v,{$gap:1,children:[O(C,{children:`Gateway stopped`}),k(ka,{children:[`Nothing on this screen will update again, and nothing here can start it: that needs`,` `,h?.supervisor===`container`?`the host that runs this container`:`a shell on the machine it runs on`,`.`]})]})})]}):k(se,{children:[O(S,{}),h===void 0?null:k(Oa,{children:[`omnigateway v`,h.version]}),O(Sa,{}),k(Ca,{title:h===void 0?void 0:xa[h.supervisor],children:[k(wa,{type:`button`,$size:`sm`,"aria-label":`Restart gateway`,disabled:h===void 0||!h.canRestart||n.isPending||c,onClick:()=>s(`restart`),children:[O(Ye,{}),`Restart`]}),k(wa,{type:`button`,$size:`sm`,$variant:`danger`,"aria-label":`Shut down gateway`,disabled:h===void 0||!h.canShutdown||r.isPending||c,onClick:()=>s(`shutdown`),children:[O(qe,{}),`Shut down`]}),h?.note===void 0?null:O(Ta,{children:h.note}),p===`leaving`?O(Da,{role:`status`,children:`Restarting. Waiting for the gateway to stop answering.`}):p===`returning`?O(Da,{role:`status`,children:`The gateway has stopped answering. Waiting for it to come back, then this page reloads.`}):p===`lost`?O(Ea,{role:`alert`,children:`The gateway has not come back. Reload this page once it is running again, or check the machine it runs on.`}):null,n.isError?O(Ea,{role:`alert`,children:b(n.error)}):null,r.isError?O(Ea,{role:`alert`,children:b(r.error)}):null]}),O(ba,{open:i===`restart`,onOpenChange:e=>{e||s(null)},title:`Restart gateway`,body:`${h===void 0?``:`${xa[h.supervisor]} `}Requests in flight are dropped when the process goes. This console waits for the gateway to stop answering and to answer again, then reloads itself.`,confirmLabel:`Restart now`,busy:n.isPending,onConfirm:()=>{s(null),g()}}),O(ba,{open:i===`shutdown`,onOpenChange:e=>{e||s(null)},title:`Shut down gateway`,body:h?.supervisor===`container`?`Stopping the only process in this container takes this dashboard with it, and the dashboard is what would have restarted the gateway. Unless the container's restart policy brings it back, getting it running again needs access to the host.`:`The gateway stops serving and stays stopped. This console goes with it, so starting the gateway again needs a shell on the machine it runs on.`,confirmLabel:`Shut down now`,busy:r.isPending,onConfirm:()=>{s(null),r.mutate(void 0,{onSuccess:()=>d(!0)})}})]})}var Na=[{to:`/`,label:`Rack`,blurb:`Live state of every account and model`,Icon:De},{to:`/accounts`,label:`Accounts`,blurb:`Provider credentials and their health`,Icon:Ne},{to:`/models`,label:`Models`,blurb:`Virtual models, targets, and routing`,Icon:je},{to:`/keys`,label:`Keys`,blurb:`Gateway API keys and their limits`,Icon:ze},{to:`/usage`,label:`Usage`,blurb:`Requests, tokens, and spend over time`,Icon:Le},{to:`/logs`,label:`Logs`,blurb:`Recent requests, one row each`,Icon:Ze},{to:`/console`,label:`Console`,blurb:`The gateway's own output, as it was printed`,Icon:rt},{to:`/settings`,label:`Settings`,blurb:`Routing weights, retries, retention`,Icon:$e},{to:`/database`,label:`Database`,blurb:`Size, snapshots, and retention`,Icon:Fe}],Pa=A.nav`
354
+ `,Aa=9e4;async function ja(){try{return(await fetch(`/health`,{cache:`no-store`})).ok}catch{return!1}}function Ma({pollMs:t=750}){let i=r(),a=n(),o=e(),[s,c]=D(null),[l,u]=D(!1),[d,f]=D(!1),[p,m]=D(`idle`),h=i.data;ie(()=>{if(!l)return;let e=!1,n,r=!1,i=0,a=Math.max(1,Math.ceil(Aa/t)),o=async()=>{let s=await ja();if(!e){if(!r&&!s)r=!0,m(`returning`);else if(r&&s){window.location.reload();return}if(i+=1,i>=a){m(`lost`),u(!1);return}n=setTimeout(()=>void o(),t)}};return n=setTimeout(()=>void o(),t),()=>{e=!0,n!==void 0&&clearTimeout(n)}},[l,t]);let g=()=>{m(`leaving`),a.mutate(void 0,{onSuccess:()=>u(!0),onError:()=>m(`idle`)})};return d?k(se,{children:[O(S,{}),h===void 0?null:k(Oa,{children:[`omnigateway v`,h.version]}),O(Sa,{}),O(Ca,{children:k(v,{$gap:1,children:[O(C,{children:`Gateway stopped`}),k(ka,{children:[`Nothing on this screen will update again, and nothing here can start it: that needs`,` `,h?.supervisor===`container`?`the host that runs this container`:`a shell on the machine it runs on`,`.`]})]})})]}):k(se,{children:[O(S,{}),h===void 0?null:k(Oa,{children:[`omnigateway v`,h.version]}),O(Sa,{}),k(Ca,{title:h===void 0?void 0:xa[h.supervisor],children:[k(wa,{type:`button`,$size:`sm`,"aria-label":`Restart gateway`,disabled:h===void 0||!h.canRestart||a.isPending||l,onClick:()=>c(`restart`),children:[O(Ye,{}),`Restart`]}),k(wa,{type:`button`,$size:`sm`,$variant:`danger`,"aria-label":`Shut down gateway`,disabled:h===void 0||!h.canShutdown||o.isPending||l,onClick:()=>c(`shutdown`),children:[O(qe,{}),`Shut down`]}),h?.note===void 0?null:O(Ta,{children:h.note}),p===`leaving`?O(Da,{role:`status`,children:`Restarting. Waiting for the gateway to stop answering.`}):p===`returning`?O(Da,{role:`status`,children:`The gateway has stopped answering. Waiting for it to come back, then this page reloads.`}):p===`lost`?O(Ea,{role:`alert`,children:`The gateway has not come back. Reload this page once it is running again, or check the machine it runs on.`}):null,a.isError?O(Ea,{role:`alert`,children:b(a.error)}):null,o.isError?O(Ea,{role:`alert`,children:b(o.error)}):null]}),O(ba,{open:s===`restart`,onOpenChange:e=>{e||c(null)},title:`Restart gateway`,body:`${h===void 0?``:`${xa[h.supervisor]} `}Requests in flight are dropped when the process goes. This console waits for the gateway to stop answering and to answer again, then reloads itself.`,confirmLabel:`Restart now`,busy:a.isPending,onConfirm:()=>{c(null),g()}}),O(ba,{open:s===`shutdown`,onOpenChange:e=>{e||c(null)},title:`Shut down gateway`,body:h?.supervisor===`container`?`Stopping the only process in this container takes this dashboard with it, and the dashboard is what would have restarted the gateway. Unless the container's restart policy brings it back, getting it running again needs access to the host.`:`The gateway stops serving and stays stopped. This console goes with it, so starting the gateway again needs a shell on the machine it runs on.`,confirmLabel:`Shut down now`,busy:o.isPending,onConfirm:()=>{c(null),o.mutate(void 0,{onSuccess:()=>f(!0)})}})]})}var Na=[{to:`/`,label:`Rack`,blurb:`Live state of every account and model`,Icon:De},{to:`/accounts`,label:`Accounts`,blurb:`Provider credentials and their health`,Icon:Ne},{to:`/models`,label:`Models`,blurb:`Virtual models, targets, and routing`,Icon:je},{to:`/keys`,label:`Keys`,blurb:`Gateway API keys and their limits`,Icon:ze},{to:`/usage`,label:`Usage`,blurb:`Requests, tokens, and spend over time`,Icon:Le},{to:`/logs`,label:`Logs`,blurb:`Recent requests, one row each`,Icon:Ze},{to:`/console`,label:`Console`,blurb:`The gateway's own output, as it was printed`,Icon:rt},{to:`/settings`,label:`Settings`,blurb:`Routing weights, retries, retention`,Icon:$e},{to:`/database`,label:`Database`,blurb:`Size, snapshots, and retention`,Icon:Fe}],Pa=A.nav`
355
355
  grid-area: rail;
356
356
  display: flex;
357
357
  flex-direction: column;
@@ -389,7 +389,7 @@ import{Dt as e,F as t,L as n,Ot as r,P as i,Rt as a,Xt as o,i as s,in as c,jt as
389
389
  flex: none;
390
390
  transform: translateY(-1px);
391
391
  }
392
- `,Ia=A(u)`
392
+ `,Ia=A(l)`
393
393
  ${Fa}
394
394
 
395
395
  &:hover {
@@ -429,7 +429,7 @@ import{Dt as e,F as t,L as n,Ot as r,P as i,Rt as a,Xt as o,i as s,in as c,jt as
429
429
  font-weight: 400;
430
430
  line-height: 1.3;
431
431
  color: ${({theme:e})=>e.color.warn};
432
- `;function Ba(){let e=l();return k(Pa,{"aria-label":`Console sections`,children:[Na.map(({to:e,label:t,blurb:n,Icon:r})=>k(Ia,{to:e,title:n,activeOptions:{exact:e===`/`},children:[O(r,{}),t]},e)),zt(e.data??[]).map(({id:e,label:t,disabledReason:n})=>n===null?k(Ia,{to:Rt(e),title:`Provided by the ${e} plugin`,children:[O(ke,{}),t]},e):k(La,{type:`button`,disabled:!0,children:[O(ke,{}),k(Ra,{children:[t,O(za,{children:n})]})]},e)),O(Ma,{})]})}var Va=A.div`
432
+ `;function Ba(){let e=o();return k(Pa,{"aria-label":`Console sections`,children:[Na.map(({to:e,label:t,blurb:n,Icon:r})=>k(Ia,{to:e,title:n,activeOptions:{exact:e===`/`},children:[O(r,{}),t]},e)),zt(e.data??[]).map(({id:e,label:t,disabledReason:n})=>n===null?k(Ia,{to:Rt(e),title:`Provided by the ${e} plugin`,children:[O(ke,{}),t]},e):k(La,{type:`button`,disabled:!0,children:[O(ke,{}),k(Ra,{children:[t,O(za,{children:n})]})]},e)),O(Ma,{})]})}var Va=A.div`
433
433
  display: grid;
434
434
  grid-template-areas:
435
435
  "chassis chassis"