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
@@ -1,26 +0,0 @@
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 ee}from"styled-components";var te=p.use,ne=p.useLayoutEffect;function re(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 ie(e){let t=p.useRef(null);return p.useImperativeHandle(e,()=>t.current,[]),t}function w(e){return e[e.length-1]}function ae(e,t){return typeof e==`function`?e(t):e}var T=Object.prototype.hasOwnProperty,oe=Object.prototype.propertyIsEnumerable;function se(e){for(let t in e)if(T.call(e,t))return!0;return!1}var ce=()=>Object.create(null),le=(e,t)=>ue(e,t,ce);function ue(e,t,n=()=>({}),r=0){if(e===t)return e;if(r>500)return t;let i=t,a=me(e)&&me(i);if(!a&&!(fe(e)&&fe(i)))return i;let o=a?e:de(e);if(!o)return i;let s=a?i:de(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:T.call(e,o))&&d++;continue}if(l===null||f===null||typeof l!=`object`||typeof f!=`object`){u[o]=f;continue}let p=ue(l,f,n,r+1);u[o]=p,p===l&&d++}return c===l&&d===c?e:u}function de(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(!oe.call(e,r))return!1;t.push(r)}return t}function fe(e){if(!pe(e))return!1;let t=e.constructor;if(t===void 0)return!0;let n=t.prototype;return!(!pe(n)||!n.hasOwnProperty(`isPrototypeOf`))}function pe(e){return Object.prototype.toString.call(e)===`[object Object]`}function me(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function E(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(!E(e[r],t[r],n))return!1;return!0}if(fe(e)&&fe(t)){let r=n?.ignoreUndefined??!0;if(n?.partial){for(let i in t)if((!r||t[i]!==void 0)&&!E(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||!E(e[o],t[o],n)))return!1;return i===a}return!1}function he(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 ge=/[\x00-\x1f\x7f"<>`{}]/g;function _e(e){return e.replace(ge,e=>`%`+e.charCodeAt(0).toString(16).toUpperCase().padStart(2,`0`))}function ve(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 _e(t)}var ye=[`http:`,`https:`,`mailto:`,`tel:`];function D(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 O=/^[\x00-\x20]*[\\/][\t\n\r]*[\\/]/;function k(e,t){if(!e)return!1;if(O.test(e))return!0;let n=D(e);return n?!t.has(n):!1}function be(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+=ve(e.slice(r,i.index))+i[0],r=n.lastIndex;t+=ve(r?e.slice(r):e)}return t}function A(e){return/\s|[^\u0000-\u007F]/.test(e)?e.replace(/\s|[^\u0000-\u007F]/gu,encodeURIComponent):e}function j(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 M(){throw Error(`Invariant failed`)}function N(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 P=4,F=5;function I(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 L(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=I(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=z(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=B(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=z(r);e.kind=F,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=z(r);e.kind=P,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)L(e,t,r,c,i,a,o,s)}function R(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 z(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 B(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 xe(e,t){let n=z(`/`),r=new Uint16Array(6),i=[];for(let t of e)L(!1,r,t,1,n,0,i);for(let e of i)e.sort(R);t.masksTree=n,t.flatCache=N(1e3)}function V(e,t){e||=`/`;let n=t.flatCache.get(e);if(n!==void 0)return n;let r=Ee(e,t.masksTree);return t.flatCache.set(e,r),r}function Se(e,t,n,r,i){e||=`/`,r||=`/`;let a=t?`case\0${e}`:e,o=i.singleCache.get(a);return o||(o=z(`/`),L(t,new Uint16Array(6),{from:e},1,o,0),i.singleCache.set(a,o)),Ee(r,o,n)}function Ce(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=Ee(e,t.segmentTree,n)}catch(e){if(e instanceof URIError)a=null;else throw e}return a&&(a.branch=Oe(a.route)),t.matchCache.set(r,a),a}function we(e){return e===`/`?e:e.replace(/\/{1,}$/,``)}function Te(e,t=!1,n){let r=z(e.fullPath),i=new Uint16Array(6),a=[],o={},s={},c=0;L(t,i,e,1,r,0,a,e=>{if(n?.(e,c),e.id in o&&M(),o[e.id]=e,c!==0&&e.path){let t=we(e.fullPath);(!s[t]||e.fullPath.endsWith(`/`))&&(s[t]=e)}c++});for(let e of a)e.sort(R);return{processedTree:{segmentTree:r,singleCache:N(1e3),matchCache:N(1e3),flatCache:null,masksTree:null},routesById:o,routesByPath:s}}function Ee(e,t,n=!1){let r=e.split(`/`),i=Ae(e,r,t,n);if(!i)return null;let[a]=De(e,r,i);return{route:i.node.route,rawParams:a}}function De(e,t,n){let r=ke(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===P)break;if(u.kind===F){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 Oe(e){let t=[e];for(;e.parentRoute;)e=e.parentRoute,t.push(e);return t.reverse(),t}function ke(e){let t=Array(e.depth+1);do t[e.depth]=e,e=e.parent;while(e);return t}function Ae(e,t,n,r){if(e===`/`&&n.index)return{node:n.index,skipped:0};let i=!w(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&&!U(l,n))continue;if(i.parse){if(!Me(e,t,n))continue;g=n.rawParams,h=n.extract}r&&i.route&&i.kind!==P&&U(c,n)&&(c=n);let _=u===o;if(_&&(i.route&&(!a||i.kind===P||i.kind===2)&&U(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&&(Me(e,t,n)||(r=!1)),r){if(!p&&!m&&!d&&je(f,o))return n;U(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+H(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+H(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+H(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+H(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 H(e,t){return 2**(e-t-1)}function je(e,t){return e===2**(t-1)-1}function Me(e,t,n){let r,i;try{[r,i]=De(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 U(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===P)>(e.node.kind===P)||t.node.kind===P==(e.node.kind===P)&&t.node.depth>e.node.depth)))}function Ne(e){return W(e.filter(e=>e!==void 0).join(`/`))}function W(e){return e.replace(/\/{2,}/g,`/`)}function Pe(e){return e===`/`?e:e.replace(/^\/{1,}/,``)}function Fe(e){let t=e.length;return t>1&&e[t-1]===`/`?e.replace(/\/{1,}$/,``):e}function Ie(e){return Fe(Pe(e))}function Le(e,t){return e?.endsWith(`/`)&&e!==`/`&&e!==`${t}/`?e.slice(0,-1):e}function Re({base:e,to:t,trailingSlash:n=`never`,cache:r}){if(t.includes(`//`)&&(t=W(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=W(e)),o=e.split(`/`);o.length>1&&w(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&&(w(o)===``?n===`never`&&o.pop():n===`always`&&o.push(``));let s=o.join(`/`),c=(i?W(s):s)||`/`;return a&&r&&r.set(a,c),c}function ze(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 Be(e,t,n){let r=t[e];return typeof r==`string`?e===`_splat`?/^[a-zA-Z0-9\-._~!/]*$/.test(r)?r:r.split(`/`).map(e=>He(e,n)).join(`/`):He(r,n):r}function Ve({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=I(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=Be(`_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=Be(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=Be(i,t,n)??``;l+=`/`+u+f+d;continue}}return e.endsWith(`/`)&&(l+=`/`),{usedParams:a,interpolatedPath:l||`/`,isMissingParams:i}}function He(e,t){let n=encodeURIComponent(e);return t?.(n)??n}var Ue=`Error preloading route! ☝️`;function We({children:e,fallback:t=null}){return x(m.Fragment,{children:Ge()?e:t})}function Ge(){return m.useSyncExternalStore(Ke,()=>!0,()=>!1)}function Ke(){return()=>{}}function qe(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}var Je=typeof Object.is==`function`?Object.is:qe;function Ye(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(Je(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 Xe(e,t){return e===t}function Ze(e,t,n=Xe){let r=h(t=>{if(!e)return()=>{};let{unsubscribe:n}=e.subscribe(t);return n},[e]),i=h(()=>e?.get(),[e]);return Ye(r,i,i,t,n)}function Qe(e){let t=i();return p.useCallback(n=>t.navigate({...n,from:n.from??e?.from}),[e?.from,t])}function $e(e){let t=p.useRef(e);return E(t.current,e,{ignoreUndefined:!1})||(t.current=e),t.current}function et(e,t){return e[0]===t[0]&&e[1]===t[1]}function tt(e,t){let n=typeof e==`string`&&D(e);if(n)return t.has(n)?e:null}function nt(e,t,n,r,i){let a=Le(e.pathname,r),o=Le(t.pathname,r);return(n?.exact?a!==o:!a.startsWith(o)||a.length!==o.length&&a[o.length]!==`/`)||(n?.includeSearch??!0)&&!E(e.search,t.search,{partial:!n?.exact,ignoreUndefined:!n?.explicitUndefined})?!1:!n?.includeHash||i&&e.hash===t.hash}function rt(e,t){let n=i(),r=ie(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:ee,onFocus:te,onMouseEnter:ne,onMouseLeave:w,onTouchStart:T,ignoreBlocker:oe,params:se,search:ce,hash:le,state:ue,mask:de,reloadDocument:fe,unsafeRelative:pe,from:me,_fromLocation:E,...he}=e,ge=c,_e=Ge(),ve=$e(e.search),ye=$e(e.params),O=$e(s),k=p.useMemo(()=>e,[n,e.from,e._fromLocation,e.hash,e.to,ve,ye,e.state,e.mask,e.unsafeRelative]),be=p.useCallback(e=>{let t=tt(ge,n.protocolAllowlist);if(t!==void 0)return[t??void 0];let r=n.buildLocation({_fromLocation:e,...k}),i=lt(r,n,b);return[i,!b&&(!i||D(i))?void 0:nt(e,r,O,n.basepath,_e)]},[O,b,_e,k,n,ge]),[A,j]=Ze(n.stores.location,be,et),M=j===void 0?A:void 0,N=b||A===void 0,P=p.useRef(!1),F=e.reloadDocument||M||N?!1:l??n.options.defaultPreload,I=u??n.options.defaultPreloadDelay??0,L=p.useCallback(()=>{n.preloadRoute(k).catch(e=>{console.warn(e),console.warn(Ue)})},[n,k]),R=p.useCallback(e=>{if(!e){ct(r);return}if(!(e.isIntersecting??F===`intent`)){e.isIntersecting===!1&&ct(r);return}if(!I){L();return}G.has(r)||G.set(r,setTimeout(()=>{G.delete(r),L()},I))},[L,r,F,I]);if(re(r,R,F!==`viewport`),p.useEffect(()=>{P.current||F===`render`&&(L(),P.current=!0)},[L,F]),M)return{...he,ref:r,href:M,...v&&{children:v},...y&&{target:y},...b&&{disabled:b},...x&&{style:x},...S&&{className:S},...C&&{onClick:C},...ee&&{onBlur:ee},...te&&{onFocus:te},...ne&&{onMouseEnter:ne},...w&&{onMouseLeave:w},...T&&{onTouchStart:T}};let z=ae(j?a:o,{})??(j?at:it),B=z.className,xe=S?B?`${S} ${B}`:S:B,V=z.style,Se=x&&V?{...x,...V}:x||V,Ce=e=>{let t=e.currentTarget.getAttribute(`target`),r=y===void 0?t:y;!N&&!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)&&!e.defaultPrevented&&(!r||r===`_self`)&&e.button===0&&(e.preventDefault(),n.navigate({...k,replace:m,resetScroll:g,hashScrollIntoView:f,startTransition:h,viewTransition:_,ignoreBlocker:oe}))},we=()=>{F===`intent`&&L()},Te=()=>{F===`intent`&&ct(r)};return{...he,...z,href:A,ref:r,onClick:K(C,Ce),onBlur:K(ee,Te),onFocus:K(te,R),onMouseEnter:K(ne,R),onMouseLeave:K(w,Te),onTouchStart:K(T,we),disabled:!!N,target:y,...Se&&{style:Se},...xe&&{className:xe},...N&&ot,...j&&st}}var it={},at={className:`active`},ot={role:`link`,"aria-disabled":!0},st={"data-status":`active`,"aria-current":`page`},G=new WeakMap,ct=e=>{clearTimeout(G.get(e)),G.delete(e)},K=(e,t)=>e?n=>n.defaultPrevented||(e(n),n.defaultPrevented||t(n)):t;function lt(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||!k(i,t.protocolAllowlist))return i}var ut=p.forwardRef((e,t)=>{let{_asChild:n,...r}=e,{type:i,...a}=rt(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)}),dt=[`since`,`until`,`state`,`failed`,`provider`,`requestedModel`,`resolvedModel`,`model`,`credentialId`,`apiKeyId`,`errorCode`],ft=e=>JSON.stringify(dt.map(t=>e[t]??null)),pt=e=>{let t={};for(let n of dt){let r=e[n];r!==void 0&&r!==``&&(t[n]=r)}return t},q={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],quotaHistory:e=>[`quota-history`,e.credentialId,e.since,e.until??null],logs:e=>[`logs`,e],logPages:(e,t)=>[`logPages`,t,ft(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,ft(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`]},mt=c({queryKey:q.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 ht(){return d(mt)}function gt(e,t){return e.find(e=>e.id===t)}function _t(){return d({queryKey:q.status,queryFn:({signal:t})=>e(`/api/status`,t),staleTime:3e4})}function vt(){return d({queryKey:q.credentials,queryFn:async({signal:t})=>(await e(`/api/credentials`,t)).credentials})}function yt(t=1e4){return d({queryKey:q.credentialHealth,queryFn:({signal:t})=>e(`/api/credentials/health`,t),refetchInterval:t})}function bt(t,r=!0){return d({queryKey:q.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 xt(){return d({queryKey:q.models,queryFn:async({signal:t})=>(await e(`/api/models`,t)).models})}function St(){return d({queryKey:q.keys,queryFn:async({signal:t})=>(await e(`/api/keys`,t)).keys})}var J={queryKey:q.settings,queryFn:({signal:t})=>e(`/api/settings`,t)};function Ct(){return d({...J,select:e=>e.settings})}function wt(){return d({...J,select:e=>e.bodyLoggingAllowed&&e.settings.bodyLoggingEnabled})}function Tt(){return d({...J,select:e=>e.bodyLoggingAllowed})}function Et(){return d({...J,select:e=>e.dayOffsetMinutes??null})}function Dt(t,r){return d({queryKey:q.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:q.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}}),r)).rows,refetchInterval:r})}var Y=2e3;function kt(t=100,r=Y){return d({queryKey:q.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:q.logPages(t,r),initialPageParam:null,queryFn:async({pageParam:i,signal:a})=>{let o=await e(n(`/api/logs`,{...pt(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:q.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:q.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:q.nodes,queryFn:async({signal:t})=>e(`/api/nodes`,t),refetchInterval:It})}function Rt(){return d({queryKey:q.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:q.snapshots,queryFn:async({signal:t})=>(await e(`/api/database/snapshots`,t)).snapshots,refetchInterval:!1})}function X(e){e.invalidateQueries({queryKey:q.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:q.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:q.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:q.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:q.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:q.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:q.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`,{...pt(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:q.clientQuota,queryFn:async({signal:t})=>(await e(`/api/client/quota`,t)).accounts,refetchInterval:t})}function ln(t,r=!0){return d({queryKey:q.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:q.credentials}),e.invalidateQueries({queryKey:q.credentialHealth})}})}function dn(){return _t().data?.principal?.kind===`admin`}function fn(){let e=f();return u({mutationFn:e=>o(`/api/credentials/quota/refresh`,e),onSuccess:()=>{e.invalidateQueries({queryKey:q.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:q.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:q.credentials}),e.invalidateQueries({queryKey:q.credentialHealth})}})}function gn(){let e=f();return u({mutationFn:e=>a(`/api/models/${encodeURIComponent(e.id)}`,e),onSuccess:()=>e.invalidateQueries({queryKey:q.models})})}function _n(){let e=f();return u({mutationFn:e=>s(`/api/models/${encodeURIComponent(e)}`),onSuccess:()=>e.invalidateQueries({queryKey:q.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:q.keys})})}function bn(){let e=f();return u({mutationFn:({id:e,limits:t})=>a(`/api/keys/${e}/limits`,{limits:t}),onSuccess:()=>e.invalidateQueries({queryKey:q.keys})})}function xn(){let e=f();return u({mutationFn:({id:e,modelAllowlist:t})=>a(`/api/keys/${e}/models`,{modelAllowlist:t}),onSuccess:()=>e.invalidateQueries({queryKey:q.keys})})}function Sn(){let e=f();return u({mutationFn:({id:e,expiresAt:t})=>a(`/api/keys/${e}/expiry`,{expiresAt:t}),onSuccess:()=>e.invalidateQueries({queryKey:q.keys})})}function Cn(){let e=f();return u({mutationFn:e=>s(`/api/keys/${e}`),onSuccess:()=>e.invalidateQueries({queryKey:q.keys})})}function wn(){let e=f();return u({mutationFn:e=>a(`/api/settings`,e),onSuccess:()=>e.invalidateQueries({queryKey:q.settings})})}function Tn(){return u({mutationFn:e=>a(`/api/settings/password`,e)})}function En(){let e=f();return u({mutationFn:e=>a(`/api/settings/viewer-password`,{password:e}),onSuccess:()=>e.invalidateQueries({queryKey:q.status})})}function Dn(){return u({mutationFn:e=>o(`/api/connect/start`,e)})}function On(){let e=f();return u({mutationFn:e=>o(`/api/credentials`,e),onSuccess:()=>e.invalidateQueries({queryKey:q.credentials})})}function kn(){let e=f();return u({mutationFn:e=>o(`/api/connect/finish`,e),onSuccess:()=>e.invalidateQueries({queryKey:q.credentials})})}function An(){return d({queryKey:q.plugins,queryFn:async({signal:t})=>(await e(`/api/plugins`,t)).plugins,staleTime:3e5})}async function jn(e){let t=await r(`/api/connect/poll`,{method:`POST`,body:{flowId:e},accept:[202]});return t.status===202?{status:`pending`}:t.data}var Mn=new Intl.NumberFormat(`en-US`,{notation:`compact`,maximumFractionDigits:1}),Nn=new Intl.NumberFormat(`en-US`);function Pn(e){return Number.isFinite(e)?e<1e4?Nn.format(Math.round(e)):Mn.format(e).toLowerCase():`—`}function Fn(e){return Number.isFinite(e)?e===0?`$0`:e<.01?`$${e.toFixed(4)}`:e<100?`$${e.toFixed(2)}`:`$${Mn.format(e).toLowerCase()}`:`—`}function In(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 Ln(e,t=1){return Number.isFinite(e)?`${(e*100).toFixed(t)}%`:`—`}var Rn=[[6e4,1e3,`s`],[36e5,6e4,`m`],[864e5,36e5,`h`],[1/0,864e5,`d`]];function zn(e){let t=Math.abs(e);if(t<1e3)return`0s`;let n=Rn.find(([e])=>t<e);return n===void 0?`—`:`${Math.floor(t/n[1])}${n[2]}`}function Bn(e,t=Date.now()){if(e==null||!Number.isFinite(e))return`—`;let n=e-t;return Math.abs(n)<5e3?`just now`:n<0?`${zn(n)} ago`:`in ${zn(n)}`}function Vn(e){return new Date(e).toLocaleTimeString(`en-GB`,{hour12:!1})}var Hn=864e5;function Un(e,t){let n=new Date(e),r=n.toLocaleTimeString(`en-GB`,{hour:`2-digit`,minute:`2-digit`,hour12:!1});return Wn(t)?`${n.toLocaleDateString(`en-GB`,{day:`2-digit`,month:`short`})} ${r}`:r}function Wn(e){return e>=Hn}function Gn(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 Kn=[`B`,`KiB`,`MiB`,`GiB`,`TiB`];function qn(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<Kn.length-1;)t/=1024,n+=1;return`${t.toFixed(1)} ${Kn[n]}`}function Jn(e,t=8){return e.length<=t?e:`${e.slice(0,t)}…`}var Yn={fiveHour:18e6,daily:864e5,weekly:6048e5};function Xn(e,t){return t!==null&&t>0?t:Yn[e]}var Zn=6e4;function Z(e,t){return e===null||t===null?e===t:Math.abs(e-t)<=Zn}function Qn(e,t){return e.resetsAt!==null&&e.resetsAt<=t}function $n(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 er(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 tr=(e,t)=>e.revokedAt===null&&(e.expiresAt===null||e.expiresAt>t);function nr(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 rr(e){return e.filter(e=>!Q(e))}function $(e){return Q(e)?!1:e.status>=400||e.errorCode!==null}var ir={ok:`●`,warn:`◐`,down:`○`,idle:`·`,live:`●`};function ar(e){return Q(e)?`live`:$(e)?`down`:`ok`}function or(e){return Q(e)?`in flight`:$(e)?`failed with ${e.status}`:`succeeded`}function sr(e,t){let n=rr(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:nr(r,.5),ttftP95:nr(r,.95),costUsd:a,inputTokens:o,outputTokens:s,cacheReadTokens:c,cacheWriteTokens:l}}function cr(e,t){let n=rr(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=nr(l[e]??[],.5);return c}var lr={tokenRejected:`reconnect needed — provider rejected the refresh token`,expiredNoRefresh:`reconnect needed — token expired with nothing to refresh from`};function ur(e,t,n,r=null){if(!n){let e=r===`tokenRejected`||r===`expiredNoRefresh`;return{state:e?`down`:`idle`,note:e?lr[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 dr={fiveHour:`5h`,daily:`24h`,weekly:`7d`};function fr(e){return Math.max(e,6e4)*3}function pr(e,t,n){return e.observedAt<=0||t-e.observedAt>fr(n)}function mr(e,t){return t?.ratePerHour===void 0||t.ratePerHour===null||e.limit===null||e.limit<=0?null:t.ratePerHour/e.limit}function hr(e,t){return e.find(e=>e.windowType===t)}function gr(e,t,n,r,i){return _r(e,{stale:pr(e,t,n),rolledOver:Qn(e,t),estimateStale:i===void 0||i.stale,survives:i?.survives??null,exhaustsAt:i?.exhaustsAt??null},t,r)}function _r(e,t,n,r){let i=dr[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 ~${zn(t.exhaustsAt-n)}`} · ${a}`}function vr(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 yr(e,t){if(e.usedRatio!==0||t.usedRatio!==0)return!1;let n=Xn(e.windowType,e.windowMs),r=Xn(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 br(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-Xn(e.windowType,e.windowMs)},a=n[n.length-1],o=r!==void 0&&yr(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 xr(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 Sr(e){return e.startsAt===null||e.resetsAt===null?null:{from:{at:e.startsAt,percent:0},to:{at:e.resetsAt,percent:100}}}var Cr=36e5;function wr(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)/Cr);return l<=100?{from:c,to:{at:r,percent:l}}:{from:c,to:{at:i+(100-o)/s*Cr,percent:100}}}var Tr={fiveHour:0,daily:1,weekly:2};function Er(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)=>Tr[e.window.windowType]-Tr[t.window.windowType])}function Dr(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 Or=ee`
2
- 0%, 100% { opacity: 1; }
3
- 50% { opacity: 0.28; }
4
- `,kr=C`
5
- color: ${({theme:e})=>e.color.ok};
6
- animation: ${Or} 1.2s ease-in-out infinite;
7
-
8
- @media (prefers-reduced-motion: reduce) {
9
- animation: none;
10
- }
11
- `,Ar={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:kr},jr=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})=>Ar[e]}
26
- `;function Mr({state:e,label:t,className:n}){return x(jr,{$state:e,className:n,role:`img`,"aria-label":t,title:t,children:ir[e]})}export{rn as $,jt as $t,Vn as A,se as An,Lt as At,Pt as B,Cn as Bt,Xn as C,ye as Cn,St as Ct,er as D,A as Dn,$t as Dt,$n as E,E as En,Zt as Et,Ln as F,O as Fn,fn as Ft,jn as G,bn as Gt,mt as H,Ht,Bn as I,ue as In,Nt as It,Dt as J,Ct as Jt,q as K,xn as Kt,Fn as L,te as Ln,pn as Lt,Gn as M,he as Mn,ht as Mt,zn as N,w as Nn,bt as Nt,qn as O,ae as On,kt as Ot,In as P,le as Pn,mn as Pt,Wt as Q,_t as Qt,Wn as R,ne as Rn,Yt as Rt,xr as S,M as Sn,dn as St,Qn as T,be as Tn,Mt as Tt,gt as U,wn as Ut,Y as V,gn as Vt,At as W,Sn as Wt,Tt as X,Xt,wt as Y,Qt as Yt,Tn as Z,Bt as Zt,br as _,Ce as _n,hn as _t,Sr as a,Ze as an,nn as at,vr as b,Te as bn,vn as bt,Dr as c,ze as cn,Dn as ct,pr as d,Re as dn,yn as dt,un as en,sn as et,or as f,Ie as fn,Vt as ft,_r as g,V as gn,Et as gt,gr as h,Oe as hn,Rt as ht,cr as i,Qe as in,ln as it,Pn as j,k as jn,An as jt,Un as k,D as kn,xt as kt,$ as l,Ve as ln,Ft as lt,wr as m,Fe as mn,vt as mt,dr as n,Ut as nn,on as nt,hr as o,Ye as on,an as ot,ar as p,Pe as pn,yt as pt,zt as q,En as qt,Tr as r,ut as rn,cn as rt,ur as s,We as sn,kn as st,Mr as t,Ot as tn,en as tt,Q as u,Ne as un,On as ut,Er as v,Se as vn,_n as vt,tr as w,j as wn,Jt as wt,sr as x,N as xn,qt as xt,mr as y,xe as yn,Gt as yt,Jn as z,Kt as zt};
@@ -1,70 +0,0 @@
1
- import{F as e,Ft as t,G as n,I as r,Jt as i,Lt as a,Mt as o,Nt as s,Pt as c,St as l,T as u,U as d,_t as f,b as p,c as m,ct as ee,d as h,en as g,h as _,j as v,kt as te,mt as ne,n as y,o as b,pt as x,s as re,st as ie,t as S,ut as ae,v as oe,y as C}from"./Lamp-Dk9XrTCg.js";import{A as w,C as T,S as E,T as D,a as se,b as O,c as k,k as A,o as j,r as M,s as N,y as P}from"./Panel-CsovmtxF.js";import{A as F,D as I,i as ce,r as L,t as R,w as z}from"./Rack-CDUOJkS2.js";import{t as le}from"./CopyValue-DAlmkISB.js";import{t as ue}from"./chevron-down-Bb5ZGvwk.js";import{t as de}from"./chevron-right-hwF5mD6-.js";import{t as fe}from"./plus-BgcHxxIr.js";import{t as pe}from"./rotate-ccw-Do43Argv.js";import{t as me}from"./trash-00950_yY.js";import{t as he}from"./Toggle-CdMD58sy.js";import{t as ge}from"./Chip-D0XSbQUr.js";import{i as B,n as V,r as _e,t as H}from"./Field-DG1317zr.js";import{t as ve}from"./Meter-stpt3vQu.js";import{i as ye,n as U,r as W,t as be}from"./Table-CVDZ69Zx.js";import{n as xe,r as Se,t as Ce}from"./WindowChart-Bqbl-KFO.js";import{Fragment as we,useCallback as G,useEffect as K,useState as q}from"react";import{Fragment as Te,jsx as J,jsxs as Y}from"react/jsx-runtime";import X from"styled-components";var Ee={name:`external-link`,size:24,node:[[`path`,{d:`M15 3h6v6`,key:`1q9fwt`}],[`path`,{d:`M10 14 21 3`,key:`gplh6r`}],[`path`,{d:`M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6`,key:`a6xqqp`}]]};Ee.node;var De=F(Ee),Z={name:`link-2`,size:24,node:[[`path`,{d:`M9 17H7A5 5 0 0 1 7 7h2`,key:`8i5ue5`}],[`path`,{d:`M15 7h2a5 5 0 1 1 0 10h-2`,key:`1b9ql8`}],[`line`,{x1:`8`,x2:`16`,y1:`12`,y2:`12`,key:`1jonct`}]]};Z.node;var Oe=F(Z),Q={name:`refresh-cw`,size:24,node:[[`path`,{d:`M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8`,key:`v9h5vc`}],[`path`,{d:`M21 3v5h-5`,key:`1q7to0`}],[`path`,{d:`M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16`,key:`3uifl3`}],[`path`,{d:`M8 16H3v5`,key:`1cv678`}]]};Q.node;var ke=F(Q);function Ae(e){return e?.authTypes??[]}function je(e){return Ae(e).includes(`oauth`)?`oauth`:`apiKey`}function Me(e){return e[0]?.id??`anthropic`}var $={oauth:`Authorize in the browser`,apiKey:`Paste an API key`};function Ne(e){let t=e?.callback;return t===void 0?`code#state`:`${t.uri}?code=…`}var Pe=X.ol`
2
- display: flex;
3
- flex-direction: column;
4
- gap: ${({theme:e})=>e.space(3)};
5
- `,Fe=X.div`
6
- font-family: ${({theme:e})=>e.font.mono};
7
- font-size: 26px;
8
- letter-spacing: 0.22em;
9
- text-align: center;
10
- padding: ${({theme:e})=>e.space(3)};
11
- background: ${({theme:e})=>e.color.panelSunk};
12
- border: 1px solid ${({theme:e})=>e.color.ruleStrong};
13
- border-radius: ${({theme:e})=>e.radius.control};
14
- `,Ie=X.p`
15
- font-size: 12px;
16
- color: ${({theme:e})=>e.color.down};
17
- `,Le=X.p`
18
- font-size: 12px;
19
- color: ${({theme:e})=>e.color.inkDim};
20
- `;function Re({open:e,credentials:t,credential:r,onOpenChange:i,onConnected:a}){let s=o().data??[],[c,l]=q(()=>r?.provider??Me(s)),u=d(s,c),[f,p]=q(()=>r?.authType??je(d(s,r?.provider??Me(s)))),[m,h]=q(()=>r?.label??``);K(()=>{r&&(l(r.provider),p(r.authType),h(r.label))},[r]);let g=u?.label??c,[_,v]=q(null),[te,ne]=q(``),[y,b]=q(``),x=(t??[]).filter((e,t,n)=>e.provider===`custom`&&n.findIndex(t=>t.provider===`custom`&&t.providerData.endpointId===e.providerData.endpointId)===t),[re,S]=q(``),[oe,C]=q(``),[w,T]=q(`chat_completions`),[se,O]=q(``),[j,M]=q(null),N=ee(),F=ie(),I=ae(),L=G(()=>{v(null),ne(``),b(``),S(``),C(``),T(`chat_completions`),O(``),M(null),h(``),N.reset(),F.reset(),I.reset()},[N,F,I]),R=G(e=>{e||L(),i(e)},[i,L]);return K(()=>{if(_===null||_.kind!==`device`)return;let e=!1,t=async()=>{try{let t=await n(_.flowId);if(e)return;if(t.status===`complete`){L(),i(!1),a();return}}catch(t){if(e)return;M(k(t)),v(null);return}e||(r=setTimeout(()=>void t(),_.pollIntervalMs))},r=setTimeout(()=>void t(),_.pollIntervalMs);return()=>{e=!0,clearTimeout(r)}},[_,a,i,L]),J(ce,{open:e,onOpenChange:R,title:r?`Reconnect ${r.label}`:`Connect an account`,description:`The gateway stores the resulting token encrypted. It is never shown again after this dialog.`,footer:_===null?Y(Te,{children:[J(A,{type:`button`,onClick:()=>R(!1),children:`Cancel`}),J(A,{type:`button`,$variant:`primary`,disabled:N.isPending||I.isPending,onClick:()=>{if(M(null),f===`apiKey`){I.mutate({provider:c,apiKey:se,label:m.trim()||void 0,...c===`custom`?{endpointId:y,endpointLabel:re,origin:oe,protocol:w}:{}},{onSuccess:()=>{L(),i(!1),a()},onError:e=>M(k(e))});return}N.mutate({provider:c,label:m.trim().length===0?g:m.trim(),...r?{credentialId:r.id}:{}},{onSuccess:e=>v(e),onError:e=>M(k(e))})},children:f===`apiKey`?I.isPending?`Adding…`:`Add API key`:N.isPending?`Starting…`:`Start authorization`})]}):_.kind===`device`?J(A,{type:`button`,onClick:()=>R(!1),children:`Cancel`}):Y(Te,{children:[J(A,{type:`button`,onClick:()=>R(!1),children:`Cancel`}),J(A,{type:`button`,$variant:`primary`,disabled:F.isPending||te.trim().length===0,onClick:()=>{_!==null&&(M(null),F.mutate({flowId:_.flowId,code:te.trim()},{onSuccess:()=>{L(),i(!1),a()},onError:e=>M(k(e))}))},children:F.isPending?`Finishing…`:`Finish connecting`})]}),children:Y(Pe,{children:[_===null?Y(D,{$gap:3,children:[r?null:J(H,{label:`Provider`,children:e=>J(B,{...e,value:c,onChange:e=>{let t=e.target.value;l(t),p(je(d(s,t)))},children:s.map(e=>J(`option`,{value:e.id,children:e.label},e.id))})}),r?null:Ae(u).length>1?J(H,{label:`How to connect`,children:e=>J(B,{...e,value:f,onChange:e=>p(e.target.value),children:Ae(u).map(e=>J(`option`,{value:e,children:$[e]},e))})}):null,c===`custom`?Y(Te,{children:[x.length===0?null:J(H,{label:`Existing endpoint`,children:e=>Y(B,{...e,value:y,onChange:e=>{let t=x.find(t=>t.providerData.endpointId===e.target.value);if(t===void 0){b(``),S(``),C(``),T(`chat_completions`);return}b(String(t.providerData.endpointId)),S(String(t.providerData.endpointLabel)),C(String(t.providerData.origin)+String(t.providerData.basePath??``)),T(t.providerData.protocol===`responses`?`responses`:`chat_completions`)},children:[J(`option`,{value:``,children:`Create new endpoint`}),x.map(e=>J(`option`,{value:String(e.providerData.endpointId),children:String(e.providerData.endpointLabel)},String(e.providerData.endpointId)))]})}),J(H,{label:`Endpoint ID`,children:e=>J(V,{...e,value:y,onChange:e=>b(e.target.value)})}),J(H,{label:`Endpoint label`,children:e=>J(V,{...e,value:re,onChange:e=>S(e.target.value)})}),J(H,{label:`Server URL`,children:e=>J(V,{...e,value:oe,placeholder:`https://server.example/api`,onChange:e=>C(e.target.value)})}),oe.trim().toLowerCase().startsWith(`http://`)?J(Ie,{children:`Plaintext transport sends prompts and API keys without TLS.`}):null,J(H,{label:`Protocol`,children:e=>Y(B,{...e,value:w,onChange:e=>T(e.target.value),children:[J(`option`,{value:`chat_completions`,children:`Chat Completions (/v1/chat/completions)`}),J(`option`,{value:`responses`,children:`Responses (/v1/responses)`})]})})]}):null,f===`apiKey`?J(H,{label:`API key`,children:e=>J(V,{...e,type:`password`,value:se,autoComplete:`off`,onChange:e=>O(e.target.value)})}):null,J(H,{label:`Label`,hint:`How this account is named in the rack. Defaults to the provider.`,children:e=>J(V,{...e,value:m,placeholder:g,onChange:e=>h(e.target.value)})})]}):Y(D,{$gap:3,children:[Y(D,{$gap:1,children:[J(P,{children:`Step 1 — authorize`}),J(E,{$gap:2,children:Y(A,{as:`a`,href:_.authorizeUrl,target:`_blank`,rel:`noreferrer noopener`,$variant:`primary`,$size:`sm`,children:[J(De,{}),`Open `,g]})}),J(le,{value:_.authorizeUrl,label:`Copy authorization link`})]}),_.userCode===null?null:Y(D,{$gap:1,children:[J(P,{children:`Step 2 — enter this code`}),J(Fe,{children:_.userCode})]}),_.kind===`device`?Y(Le,{children:[u?.pasteHint??``,` Waiting for authorization…`]}):J(H,{label:`Authorization code`,hint:u?.pasteHint??``,...j===null?{}:{problem:j},children:e=>J(V,{...e,value:te,autoFocus:!0,placeholder:Ne(u),onChange:e=>ne(e.target.value)})})]}),j===null||_?.kind===`pkce`?null:J(Ie,{children:j})]})})}function ze({credentialId:e,windows:t,burn:n,pollIntervalMs:r,now:i}){let a=t.map(e=>({window:e,estimate:b(n,e.windowType),since:Se(p(e))})),o=a.map(e=>e.since).filter(e=>e!==null),c=o.length===0?0:Math.min(...o),l=s({credentialId:e,since:c},o.length>0),u=l.data?.samples??[],d=l.data?.gatewayRates??[],f=l.data?.truncated===!0;return J(D,{$gap:4,children:a.map(e=>J(Be,{window:e.window,estimate:e.estimate,since:e.since,samples:u.filter(t=>t.windowType===e.window.windowType&&t.observedAt>=(e.since??0)),gatewayRate:d.find(t=>t.windowType===e.window.windowType),truncated:f,pollIntervalMs:r,now:i},e.window.windowType))})}function Be({window:e,estimate:t,since:n,samples:r,gatewayRate:i,truncated:a,pollIntervalMs:o,now:s}){let c=e.limit===null?`${v(e.used)} used`:`${v(e.used)} of ${v(e.limit)} used`,l=u(e,s),d=t===void 0||h(e,s,o)||t.stale&&!l;return J(xe,{live:p(e),samples:r.map(p),since:n,now:s,truncated:a&&n!==null&&r.length>0&&(r[0]?.observedAt??0)>n,ratePerHourRatio:C(e,t),exhaustsAt:t?.exhaustsAt??null,survives:t?.survives??null,stale:d,rolledOver:l,spent:c,rateText:t?.ratePerHour===void 0||t.ratePerHour===null?`unknown`:`${v(t.ratePerHour)}/h`,extraFact:J(Ce,{legend:`This gateway accounts for`,value:i?.gatewayRatePerHour===void 0||i.gatewayRatePerHour===null?`unknown`:`${v(i.gatewayRatePerHour)} tokens/h`})})}function Ve({credential:e,busy:t,onOpenChange:n,onConfirm:i}){let o=a(e?.id??null),s=Date.now(),c=(o.data?.credits??[]).filter(e=>e.status===`available`).sort((e,t)=>(e.expiresAt??1/0)-(t.expiresAt??1/0))[0],l=o.isError||o.isFetching?0:o.data?.available??0,u=e===null?``:o.isFetching?`Reading the reset credits this account holds…`:o.isError?`Could not read reset credits for "${e.label}".`:l===0?`"${e.label}" has no reset credits available.`:`Spend one of ${l} reset ${l===1?`credit`:`credits`} on "${e.label}"? Its usage windows go back to zero at the provider, and the credit cannot be returned.`+(c?.expiresAt==null?``:` The credit spent is the one expiring soonest (${r(c.expiresAt,s)}).`);return J(L,{open:e!==null,onOpenChange:n,title:`Reset quota`,body:u,confirmLabel:`Spend reset`,busy:t||c===void 0||l===0,onConfirm:()=>{e!==null&&c!==void 0&&l>0&&i(e,c.id)}})}var He=X(M)`
21
- border-left: 3px solid ${({$provider:e})=>z(e)};
22
- `,Ue=X(V)`
23
- width: 100%;
24
- min-width: 140px;
25
- height: 26px;
26
- font-family: ${({theme:e})=>e.font.sans};
27
- font-size: 12.5px;
28
- background: transparent;
29
- border-color: transparent;
30
-
31
- &:hover:not(:disabled),
32
- &:focus {
33
- background: ${({theme:e})=>e.color.panelSunk};
34
- border-color: ${({theme:e})=>e.color.ruleStrong};
35
- }
36
- `,We=X(_e)`
37
- width: 62px;
38
- height: 26px;
39
- `,Ge=X.span`
40
- display: block;
41
- padding-left: 9px;
42
- font-size: 11px;
43
- color: ${({theme:e})=>e.color.inkDim};
44
- `,Ke=X.div`
45
- margin: 0 0 10px;
46
- min-height: 16px;
47
- font-size: 12px;
48
- color: ${({theme:e})=>e.color.inkDim};
49
- `,qe=X.p`
50
- margin: 0;
51
- `,Je=X.ul`
52
- margin: 4px 0 0;
53
- padding-left: 16px;
54
- list-style: disc;
55
- `,Ye=X.div`
56
- display: grid;
57
- /* Bar, figure, legend. The figure has a column of its own so the legends stay
58
- aligned down the stack whether a window reads 4% or 100%. */
59
- grid-template-columns: 96px 34px 1fr;
60
- align-items: center;
61
- min-width: 208px;
62
- gap: 6px;
63
- `,Xe=X(O)`
64
- font-size: 11px;
65
- text-align: right;
66
- `,Ze=X.div`
67
- display: flex;
68
- flex-direction: column;
69
- gap: 4px;
70
- `;function Qe(){let e=g();return{pending:e.isPending,commit:(t,n)=>{e.mutate({id:t,patch:n})}}}function $e(e,t){if(t===void 0)return` The list of models could not be read, so whether any target is pinned to this account is unknown.`;let n=t.filter(t=>t.targets.some(t=>t.credentialId===e.id)).map(e=>e.id);return n.length===0?``:` ${n.length===1?`The model`:`The models`} ${n.join(`, `)} ${n.length===1?`pins a target`:`pin targets`} to this account. Those targets will fail rather than fall back to another account.`}function et(){let{cadence:n}=I(),a=ne(),s=x(n(1e4,`res:credentials`)),u=i(),p=te(),ee=o(),h=f(),g=t(),v=c(),[ie,ae]=q(null),C=l(),{commit:O}=Qe(),[k,F]=q(!1),[ce,z]=q(null),[le,B]=q([]),[V,_e]=q(new Set),[H,xe]=q(!1),[Se,Ce]=q(null),[G,K]=q(null),[X,Ee]=q(new Set),De=e=>Ee(t=>{let n=new Set(t);return n.delete(e)||n.add(e),n}),Z=a.data??[],Q=e=>Z.find(t=>t.id===e)?.label??e,Ae=e=>{let t=e[0];if(e.length===1&&t!==void 0){let e=Q(t.credentialId);return t.kind===`refreshed`||t.kind===`coalesced`?`Quota refreshed for ${e}.`:t.kind===`noData`?`No quota data reported for ${e}.`:t.kind===`cooldown`?`Quota refresh is cooling down for ${e}.`:t.kind===`unsupported`?`${e} does not report quota.`:t.kind===`disabled`?`${e} is disabled, so it was not probed.`:`Quota refresh failed for ${e}.`}let n=e.filter(e=>e.kind===`refreshed`||e.kind===`coalesced`).length,r=e.filter(e=>e.kind===`failed`).length,i=e.filter(e=>e.kind===`cooldown`).length,a=e.length-n-r-i;return[`Refreshed ${n} ${n===1?`account`:`accounts`}`,r===0?null:`${r} failed`,i===0?null:`${i} cooling down`,a===0?null:`${a} skipped`].filter(e=>e!==null).join(`; `).concat(`.`)},je=e=>e.filter(e=>e.kind===`failed`||e.kind===`cooldown`||e.kind===`noData`).map(e=>`${Q(e.credentialId)}: ${e.kind===`failed`?`failed`:e.kind===`cooldown`?`cooling down`:`no data reported`}`),Me=async e=>{z(null),B([]),e.kind===`all`?xe(!0):_e(t=>{let n=new Set(t);return n.add(e.credentialId),n});try{let t=await g.mutateAsync(e);z(Ae(t.outcomes)),B(t.outcomes.length>1?je(t.outcomes):[])}catch{z(e.kind===`all`?`Quota refresh could not be started.`:`Quota refresh could not be started for ${Q(e.credentialId)}.`)}finally{xe(!1),e.kind===`one`&&_e(t=>{let n=new Set(t);return n.delete(e.credentialId),n})}},$=Date.now(),Ne=ee.data??[],Pe=e=>d(Ne,e)?.order??1/0,Fe=[...new Set(Z.map(e=>e.provider))].sort((e,t)=>Pe(e)-Pe(t)),Ie=e=>d(Ne,e)?.label??e,Le=m(s.data?.health??[],e=>e.credentialId),Be=m(s.data?.quota??[],e=>e.credentialId),et=m(s.data?.burn??[],e=>e.credentialId),tt=u.data?.quotaPollIntervalMs??3e5,nt=Z.filter(e=>e.enabled).length,rt=a.isLoading?`Reading connected accounts…`:Z.length===0?`No provider credentials are connected, so every request fails at the router.`:`${nt} of ${Z.length} accounts are enabled and eligible for routing.`;return Y(Te,{children:[J(R,{legend:`Accounts`,title:`Provider accounts`,summary:rt,actions:Y(E,{$gap:1,children:[C?Y(A,{type:`button`,$variant:`ghost`,disabled:H||V.size>0,onClick:()=>void Me({kind:`all`}),children:[J(ke,{}),H?`Refreshing quota…`:`Refresh all quota`]}):null,Y(A,{type:`button`,$variant:`primary`,onClick:()=>F(!0),children:[J(fe,{}),`Connect an account`]})]})}),Y(Ke,{children:[J(qe,{role:`status`,"aria-live":`polite`,children:ce??``}),le.length===0?null:J(Je,{children:le.map(e=>J(`li`,{children:e},e))})]}),a.isError?J(M,{legend:`Accounts`,children:J(j,{error:a.error,onRetry:()=>void a.refetch()})}):a.isLoading?J(M,{legend:`Accounts`,children:J(N,{rows:5})}):Z.length===0?J(M,{legend:`Accounts`,children:J(se,{legend:`Nothing connected`,message:`Connect a provider account to give the router something to dispatch to. Tokens are encrypted at rest and never shown again.`,action:J(A,{type:`button`,$variant:`primary`,$size:`sm`,onClick:()=>F(!0),children:`Connect an account`})})}):J(D,{$gap:4,children:Fe.map(t=>{let n=Z.filter(e=>e.provider===t);return J(He,{$provider:t,legend:Ie(t),meta:`${n.length} account${n.length===1?``:`s`}`,flush:!0,children:J(T,{children:Y(be,{children:[J(`thead`,{children:Y(`tr`,{children:[J(W,{$width:`24%`,children:`Account`}),J(W,{$width:`20%`,children:`Sign-in`}),J(W,{$align:`right`,$width:`86px`,children:`Tier`}),J(W,{$align:`right`,$width:`94px`,children:`Weight`}),J(W,{$align:`center`,$width:`86px`,children:`Enabled`}),J(W,{$width:`240px`,children:`Quota`}),J(W,{$align:`right`,$width:`130px`,children:`Token expires`}),J(W,{$width:`144px`})]})}),J(`tbody`,{children:n.map(t=>{let n=re(Le.get(t.id)??[],$,t.enabled,t.disabledReason),i=Be.get(t.id)??[],a=et.get(t.id)??[],o=oe(i),s=X.has(t.id);return Y(we,{children:[Y(ye,{children:[Y(U,{children:[Y(E,{$gap:2,children:[J(S,{state:n.state,label:n.note===``?`healthy`:n.note}),J(Ue,{defaultValue:t.label,"aria-label":`Label for ${t.label}`,onBlur:e=>{let n=e.target.value.trim();if(n.length===0||n===t.label){e.target.value=t.label;return}O(t.id,{label:n})}})]}),n.note===``?null:J(Ge,{children:n.note})]}),J(U,{children:Y(E,{$gap:1,children:[J(ge,{children:t.authType===`oauth`?`oauth`:`api key`}),t.accountEmail===null?null:J(P,{children:t.accountEmail})]})}),J(U,{$align:`right`,children:J(We,{min:1,step:1,defaultValue:t.tier,"aria-label":`Tier for ${t.label}`,onBlur:e=>{let n=Number(e.target.value);if(!Number.isInteger(n)||n<1||n===t.tier){e.target.value=String(t.tier);return}O(t.id,{tier:n})}})}),J(U,{$align:`right`,children:J(We,{min:.1,step:.1,defaultValue:t.weight,"aria-label":`Weight for ${t.label}`,onBlur:e=>{let n=Number(e.target.value);if(!Number.isFinite(n)||n<=0||n===t.weight){e.target.value=String(t.weight);return}O(t.id,{weight:n})}})}),J(U,{$align:`center`,children:J(he,{checked:t.enabled,label:`Route to ${t.label}`,onCheckedChange:e=>O(t.id,{enabled:e})})}),J(U,{children:o.length===0?J(P,{children:`unknown`}):J(Ze,{children:o.map(({window:t,fraction:n})=>Y(Ye,{children:[J(ve,{fraction:n,label:`${y[t.windowType]} window, ${Math.round(n*100)}% used`}),J(Xe,{children:e(n,0)}),J(P,{children:_(t,$,tt,r,b(a,t.windowType))})]},t.windowType))})}),J(U,{$align:`right`,$mono:!0,children:t.expiresAt===null?`never`:r(t.expiresAt,$)}),J(U,{$align:`right`,children:Y(E,{$gap:1,$justify:`flex-end`,children:[i.length===0?null:J(w,{type:`button`,$variant:`ghost`,$size:`sm`,"aria-expanded":s,"aria-label":`${s?`Hide`:`Show`} quota history for ${t.label}`,title:`${s?`Hide`:`Show`} quota history for ${t.label}`,onClick:()=>De(t.id),children:J(s?ue:de,{})}),C&&t.authType===`oauth`&&d(Ne,t.provider)?.quotaResets===!0?J(w,{type:`button`,$variant:`ghost`,$size:`sm`,"aria-label":`Reset quota for ${t.label}`,title:`Reset quota for ${t.label}`,onClick:()=>ae(t),children:J(pe,{})}):null,C&&t.authType===`oauth`?J(w,{type:`button`,$variant:`ghost`,$size:`sm`,"aria-label":`Reconnect ${t.label}`,title:`Reconnect ${t.label}`,onClick:()=>Ce(t),children:J(Oe,{})}):null,C?J(w,{type:`button`,$variant:`ghost`,$size:`sm`,disabled:H||V.has(t.id),"aria-label":V.has(t.id)?`Refreshing quota for ${t.label}`:`Refresh quota for ${t.label}`,title:`Refresh quota for ${t.label}`,onClick:()=>void Me({kind:`one`,credentialId:t.id}),children:J(ke,{})}):null,J(w,{type:`button`,$variant:`ghost`,$size:`sm`,"aria-label":`Remove ${t.label}`,title:`Remove ${t.label}`,onClick:()=>K(t),children:J(me,{})})]})})]}),s?J(ye,{children:J(U,{colSpan:9,children:J(ze,{credentialId:t.id,windows:i,burn:a,pollIntervalMs:tt,now:$})})}):null]},t.id)})})]})})},t)})}),J(Re,{open:k||Se!==null,credentials:a.data??[],credential:Se,onOpenChange:e=>{e?F(!0):(F(!1),Ce(null))},onConnected:()=>void a.refetch()}),J(Ve,{credential:ie,busy:v.isPending,onOpenChange:e=>{e||ae(null)},onConfirm:(e,t)=>{z(null),B([]),v.mutate({credentialId:e.id,creditId:t},{onSuccess:t=>z(t.quotaRefreshed?`Quota reset for ${e.label}.`:`Quota reset for ${e.label}; the meter updates at the next poll.`),onError:()=>z(`Quota reset failed for ${e.label}.`),onSettled:()=>ae(null)})}}),J(L,{open:G!==null,onOpenChange:e=>{e||K(null)},title:`Remove account`,body:G===null?``:`Removing "${G.label}" deletes its stored token. Any model target pointing at ${Ie(G.provider)} loses this account, and reconnecting means authorizing again.`+$e(G,p.data),confirmLabel:`Remove account`,busy:h.isPending,onConfirm:()=>{G!==null&&h.mutate(G.id,{onSettled:()=>K(null)})}})]})}var tt=et;export{tt as component};
@@ -1,24 +0,0 @@
1
- import{F as e,Ht as t,M as n,O as r,P as i,Q as a,Zt as o,ft as s,ht as c,j as l,nn as u,q as d,xt as f,yt as p,zt as m}from"./Lamp-Dk9XrTCg.js";import{C as h,E as g,S as _,T as v,a as y,c as b,k as x,o as S,r as C,s as w,v as T,y as E}from"./Panel-CsovmtxF.js";import{A as D,r as O,t as k}from"./Rack-CDUOJkS2.js";import{t as A}from"./trash-00950_yY.js";import{r as j,t as M}from"./Field-DG1317zr.js";import{t as N}from"./Meter-stpt3vQu.js";import{i as P,n as F,r as I,t as L}from"./Table-CVDZ69Zx.js";import{t as R}from"./Readout-DlT5oxGO.js";import{n as z}from"./reasons-Du1OBWAM.js";import{useQueryClient as B}from"@tanstack/react-query";import{useCallback as V,useState as H}from"react";import{Fragment as U,jsx as W,jsxs as G}from"react/jsx-runtime";import K from"styled-components";var q={name:`camera`,size:24,node:[[`path`,{d:`M13.997 4a2 2 0 0 1 1.76 1.05l.486.9A2 2 0 0 0 18.003 7H20a2 2 0 0 1 2 2v9a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V9a2 2 0 0 1 2-2h1.997a2 2 0 0 0 1.759-1.048l.489-.904A2 2 0 0 1 10.004 4z`,key:`18u6gg`}],[`circle`,{cx:`12`,cy:`13`,r:`3`,key:`1vg3eu`}]]};q.node;var J=D(q),Y={name:`minimize-2`,size:24,node:[[`path`,{d:`m14 10 7-7`,key:`oa77jy`}],[`path`,{d:`M20 10h-6V4`,key:`mjg0md`}],[`path`,{d:`m3 21 7-7`,key:`tjx5ai`}],[`path`,{d:`M4 14h6v6`,key:`rmj7iw`}]]};Y.node;var ee=D(Y),X=[{id:`keepLatest`,label:`Snapshots kept`,hint:`How many survive regardless of age. The newest is always kept, whatever both numbers say.`,unit:`files`,max:100},{id:`maxAgeDays`,label:`Maximum age`,hint:`Older snapshots are pruned after every new one and on the hourly maintenance sweep.`,unit:`days`,max:3650}],te=K.p`
2
- font-size: 12px;
3
- color: ${({theme:e})=>e.color.down};
4
- `,ne=K.p`
5
- font-size: 12px;
6
- color: ${({theme:e})=>e.color.ok};
7
- `,re=K.div`
8
- display: grid;
9
- grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
10
- gap: ${({theme:e})=>e.space(3)};
11
- `;function ie(e){let t={};for(let n of X){let r=e[n.id].trim(),i=Number(r);if(r.length===0||!Number.isInteger(i)||i<1)return{ok:!1,problem:`${n.label} must be a whole number of 1 or more.`};if(i>n.max)return{ok:!1,problem:`${n.label} cannot exceed ${n.max}.`};t[n.id]=i}return{ok:!0,policy:t}}function ae({retention:e}){let n=t(),[r,i]=H({}),[a,o]=H(null),[s,c]=H(!1),l={keepLatest:r.keepLatest??(e===void 0?``:String(e.keepLatest)),maxAgeDays:r.maxAgeDays??(e===void 0?``:String(e.maxAgeDays))};return W(C,{legend:`Retention`,actions:W(x,{type:`button`,$size:`sm`,disabled:n.isPending||e===void 0,onClick:()=>{c(!1);let e=ie(l);if(!e.ok){o(e.problem);return}o(null),n.mutate(e.policy,{onSuccess:()=>{c(!0),i({})},onError:e=>o(b(e))})},children:n.isPending?`Saving…`:`Save retention`}),children:G(v,{$gap:3,children:[W(re,{children:X.map(e=>W(M,{label:e.label,hint:e.hint,children:t=>G(_,{$gap:2,children:[W(j,{...t,min:1,max:e.max,step:1,value:l[e.id],onChange:t=>i({...r,[e.id]:t.target.value})}),W(E,{children:e.unit})]})},e.id))}),a===null?null:W(te,{role:`alert`,children:a}),s&&a===null?W(ne,{role:`status`,children:`Retention saved.`}):null]})})}function oe(){let e=B();return V(t=>{if(t.adminPasswordChanged){z(`admin-password-changed`);return}e.invalidateQueries()},[e])}var Z=K.p`
12
- font-size: 12px;
13
- color: ${({theme:e})=>e.color.down};
14
- `,se=K.input`
15
- font-size: 12px;
16
- color: ${({theme:e})=>e.color.inkDim};
17
- max-width: 40ch;
18
- `;function ce(){let e=o(),t=s(),i=m(),a=oe(),c=p(),l=f(),[u,T]=H(null),[E,D]=H(null),[k,A]=H(null),[j,N]=H(!1),R=e.data??[],z=G(x,{type:`button`,$variant:`primary`,$size:`sm`,disabled:t.isPending,onClick:()=>t.mutate(),children:[W(J,{}),t.isPending?`Copying…`:`Take a snapshot`]}),B=G(v,{$gap:2,children:[G(_,{$gap:2,$wrap:!0,children:[W(M,{label:`Database file to import`,hint:`A snapshot taken from this or another OmniGateway. It is checked for integrity and rejected if it is not one of ours.`,children:e=>W(se,{...e,type:`file`,accept:`.sqlite,.db,application/octet-stream`,onChange:e=>A(e.target.files?.[0]??null)})}),W(x,{type:`button`,$variant:`danger`,$size:`sm`,disabled:k===null||l.isPending,onClick:()=>N(!0),children:l.isPending?`Replacing…`:`Import`})]}),l.isError?W(Z,{role:`alert`,children:b(l.error)}):null,i.isError?W(Z,{role:`alert`,children:b(i.error)}):null,t.isError?W(Z,{role:`alert`,children:b(t.error)}):null]});return G(C,{legend:`Snapshots`,meta:`${R.length}`,actions:z,footer:B,flush:!0,children:[e.isError?W(S,{error:e.error,onRetry:()=>void e.refetch()}):e.isLoading?W(`div`,{style:{padding:12},children:W(w,{rows:3})}):R.length===0?W(y,{legend:`No snapshots`,message:`Nothing has been copied yet, so there is nothing to go back to. Take one before a migration or a settings change you are unsure of.`,action:W(x,{type:`button`,$variant:`primary`,$size:`sm`,disabled:t.isPending,onClick:()=>t.mutate(),children:`Take the first snapshot`})}):W(h,{children:G(L,{children:[W(`thead`,{children:G(`tr`,{children:[W(I,{children:`File`}),W(I,{children:`Reason`}),W(I,{$align:`right`,children:`Size`}),W(I,{$align:`right`,children:`Taken`}),W(I,{})]})}),W(`tbody`,{children:R.map(e=>G(P,{children:[W(F,{$mono:!0,children:W(g,{style:{maxWidth:`38ch`,display:`block`},children:e.filename})}),W(F,{children:e.reason}),W(F,{$align:`right`,$mono:!0,children:r(e.sizeBytes)}),W(F,{$align:`right`,$mono:!0,children:n(e.createdAt)}),W(F,{$align:`right`,children:G(_,{$gap:1,$justify:`flex-end`,children:[W(x,{as:`a`,$size:`sm`,href:d(e.id),download:e.filename,children:`Download`}),W(x,{type:`button`,$variant:`danger`,$size:`sm`,onClick:()=>T(e),children:`Restore`}),W(x,{type:`button`,$variant:`danger`,$size:`sm`,onClick:()=>D(e),children:`Delete`})]})})]},e.id))})]})}),W(O,{open:u!==null,onOpenChange:e=>{e||T(null)},title:`Restore database`,body:u===null?``:`Replacing the live database with ${u.filename}. Client requests are refused while the file is swapped, and a copy of the current database is taken first so this can be undone. Captured request bodies are not part of a snapshot and are left where they are.`,confirmLabel:`Restore database`,busy:i.isPending,onConfirm:()=>{u!==null&&i.mutate(u.id,{onSuccess:a,onSettled:()=>T(null)})}}),W(O,{open:E!==null,onOpenChange:e=>{e||D(null)},title:`Delete snapshot`,body:E===null?``:`Deleting ${E.filename} from disk. Download it first if it is the copy you would go back to; there is no other one of it.`,confirmLabel:`Delete snapshot`,busy:c.isPending,onConfirm:()=>{E!==null&&c.mutate(E.id,{onSettled:()=>D(null)})}}),W(O,{open:j,onOpenChange:N,title:`Import database`,body:k===null?``:`Replacing the live database with ${k.name}. It is validated before anything is touched, and a copy of the current database is taken first. If the file carries a different admin password, every session ends and you will be asked to sign in again.`,confirmLabel:`Replace database`,busy:l.isPending,onConfirm:()=>{k!==null&&l.mutate(k,{onSuccess:a,onSettled:()=>N(!1)})}})]})}var Q=K.p`
19
- font-size: 12px;
20
- color: ${({theme:e})=>e.color.ok};
21
- `,$=K.p`
22
- font-size: 12px;
23
- color: ${({theme:e})=>e.color.down};
24
- `;function le(e){try{let{hostname:t,port:n}=new URL(e);return n===``?t:`${t}:${n}`}catch{return e}}function ue(e){try{return new URL(e).pathname.replace(/^\//,``)||`—`}catch{return`—`}}function de(){let t=c(),n=u(),[o,s]=H(!1),d=a(),[f,p]=H(!1),m=t.data,h=m?.engine===`postgres`,g=m===void 0||m.logicalBytes===0?0:m.freePageBytes/m.logicalBytes;return G(U,{children:[W(k,{legend:`Database`,title:`Storage, snapshots, and retention`,summary:t.isLoading?`Measuring the database…`:h?`The Postgres database every replica of this cluster runs from. Back it up with pg_dump; nothing here copies or replaces it.`:`The one SQLite file this gateway runs from, the copies taken of it, and how long they are kept.`}),W(C,{legend:`Size`,meta:m===void 0?void 0:`schema v${m.stats.schemaVersion}`,actions:G(U,{children:[G(x,{type:`button`,$size:`sm`,disabled:d.isPending||m===void 0||m.bodiesBytes===0,onClick:()=>p(!0),children:[W(A,{}),d.isPending?`Clearing…`:`Clear bodies`]}),h?null:G(x,{type:`button`,$size:`sm`,disabled:n.isPending||m===void 0,onClick:()=>s(!0),children:[W(ee,{}),n.isPending?`Compacting…`:`Compact`]})]}),footer:n.isError?W($,{role:`alert`,children:b(n.error)}):d.isError?W($,{role:`alert`,children:b(d.error)}):n.data===void 0?d.data===void 0?void 0:W(Q,{role:`status`,children:`Cleared ${l(d.data.removed)} captured bodies.`}):W(Q,{role:`status`,children:`Compacted, reclaiming ${r(n.data.reclaimedBytes)} in ${i(n.data.durationMs)}.`}),children:t.isError?W(S,{error:t.error,onRetry:()=>void t.refetch()}):m===void 0?W(w,{rows:3}):h?G(T,{$min:`180px`,$stretch:!0,children:[W(R,{legend:`Database`,value:r(m.logicalBytes),unit:`${m.stats.pageCount} blocks of ${r(m.stats.pageSize)}`}),W(R,{legend:`Server`,value:le(m.location),unit:`database ${ue(m.location)}`}),W(R,{legend:`Captured bodies`,value:r(m.bodiesBytes),unit:`the request_bodies table`})]}):G(T,{$min:`180px`,$stretch:!0,children:[W(R,{legend:`Database file`,value:r(m.fileBytes),unit:`${m.stats.pageCount} pages of ${r(m.stats.pageSize)}`,trace:W(N,{fraction:g,label:`${e(g,0)} of the file is reclaimable`})}),W(R,{legend:`Reclaimable`,value:r(m.freePageBytes),unit:`${m.stats.freelistCount} free pages`}),W(R,{legend:`Write-ahead log`,value:r(m.walBytes),unit:`folded into every snapshot`}),W(R,{legend:`Captured bodies`,value:r(m.bodiesBytes),unit:`never in a snapshot`}),W(R,{legend:`Snapshots`,value:r(m.snapshots.totalBytes),unit:`${m.snapshots.count} kept`}),W(R,{legend:`Free disk`,value:r(m.freeDiskBytes),unit:m.freeDiskBytes===null?`not readable here`:`on this filesystem`})]})}),W(C,{legend:`Tables`,meta:h?`row counts are the planner's estimates; dead rows await autovacuum`:`size includes each table's indexes`,children:m===void 0?W(w,{rows:4}):G(L,{children:[W(`thead`,{children:G(P,{children:[W(I,{children:`Table`}),W(I,{$align:`right`,children:`Size`}),W(I,{$align:`right`,children:`Rows`}),h?W(I,{$align:`right`,children:`Dead rows`}):null]})}),W(`tbody`,{children:m.tables.map(e=>G(P,{children:[W(F,{children:e.name}),W(F,{$align:`right`,children:r(e.bytes)}),W(F,{$align:`right`,children:l(e.rows)}),h?W(F,{$align:`right`,children:l(e.deadRows??0)}):null]},e.name))})]})}),h?null:G(U,{children:[W(ce,{}),W(ae,{retention:m?.retention})]}),W(O,{open:f,onOpenChange:p,title:`Clear every captured body?`,body:`Every stored prompt and completion is deleted. The requests themselves stay in the log, with their bodies marked pruned. There is no undo: bodies are never in a snapshot.`,confirmLabel:`Clear captured bodies`,busy:d.isPending,onConfirm:()=>d.mutate(void 0,{onSettled:()=>p(!1)})}),W(O,{open:o,onOpenChange:s,title:`Compact database`,body:`Running VACUUM rewrites the database to give back its free pages. It holds the write lock for as long as it takes, so requests in flight will wait, and it needs room on disk for a second copy while it runs.`,confirmLabel:`Compact database`,busy:n.isPending,onConfirm:()=>n.mutate(void 0,{onSettled:()=>s(!1)})})]})}var fe=de;export{fe as component};
@@ -1,67 +0,0 @@
1
- import{A as e,Ct as t,F as n,I as r,Jt as i,L as a,Ot as o,P as s,c,f as l,h as u,i as d,j as f,kt as p,mt as m,n as h,o as g,p as _,pt as v,rn as y,s as b,t as x,tn as S,u as C,v as ee,x as te,z as w}from"./Lamp-Dk9XrTCg.js";import{C as ne,E as T,S as E,T as D,a as O,b as k,k as A,o as re,r as j,v as M,w as N,y as P}from"./Panel-CsovmtxF.js";import{D as F,S as I,t as ie,w as L}from"./Rack-CDUOJkS2.js";import{n as R,t as ae}from"./TokenBreakdown-BC6nqo1v.js";import{n as oe,t as z}from"./Chip-D0XSbQUr.js";import{t as B}from"./Meter-stpt3vQu.js";import{i as V,n as H,r as U,t as W}from"./Table-CVDZ69Zx.js";import{t as G}from"./Readout-DlT5oxGO.js";import{useMemo as K}from"react";import{Fragment as q,jsx as J,jsxs as Y}from"react/jsx-runtime";import X from"styled-components";var se=X(T)`
2
- font-weight: 500;
3
- display: block;
4
- max-width: 24ch;
5
- `,Z=X.span`
6
- font-size: 11px;
7
- color: ${({theme:e})=>e.color.inkDim};
8
- `,ce=X.div`
9
- display: grid;
10
- grid-template-columns: 72px 1fr;
11
- align-items: center;
12
- gap: 6px;
13
- min-width: 172px;
14
- `,le=X.div`
15
- display: flex;
16
- flex-direction: column;
17
- gap: 4px;
18
- `;function ue(e){let t=null;for(let n of e)n.stale||n.survives!==!1||n.exhaustsAt===null||(t===null||n.exhaustsAt<t)&&(t=n.exhaustsAt);return t}function de(e,t){return e===null?t===null?0:1:t===null?-1:e-t}function fe({credentials:e,health:t,quota:n,burn:i,usage:a,lastUsed:o,quotaPollIntervalMs:s,now:l}){let d=c(t,e=>e.credentialId),p=c(n,e=>e.credentialId),m=c(i,e=>e.credentialId),_=new Map(a.map(e=>[e.key,e])),v={down:0,warn:1,ok:2,idle:3,live:3},S=e.map(e=>{let t=m.get(e.id)??[];return{credential:e,status:b(d.get(e.id)??[],l,e.enabled,e.disabledReason),quota:ee(p.get(e.id)??[]),burn:t,exhaustsAt:ue(t),usage:_.get(e.id)}}).sort((e,t)=>v[e.status.state]-v[t.status.state]||de(e.exhaustsAt,t.exhaustsAt)||e.credential.tier-t.credential.tier);return J(j,{legend:`Accounts`,meta:`${e.length} connected`,flush:!0,actions:J(A,{as:y,to:`/accounts`,$size:`sm`,children:`Manage accounts`}),children:e.length===0?J(O,{legend:`No accounts`,message:`The gateway has no provider credentials, so every request will fail. Connect one to start routing.`,action:J(A,{as:y,to:`/accounts`,$variant:`primary`,$size:`sm`,children:`Connect an account`})}):J(ne,{children:Y(W,{children:[J(`thead`,{children:Y(`tr`,{children:[J(U,{children:`Account`}),J(U,{children:`Provider`}),J(U,{$align:`right`,children:`Tier`}),J(U,{children:`Quota`}),J(U,{$align:`right`,children:`Requests`}),J(U,{$align:`right`,children:`Last used`})]})}),J(`tbody`,{children:S.map(({credential:e,status:t,quota:n,burn:i,usage:a})=>Y(V,{children:[J(H,{children:Y(E,{$gap:2,children:[J(x,{state:t.state,label:t.note===``?`healthy`:t.note}),Y(`div`,{children:[J(se,{children:e.label}),t.note===``?null:J(Z,{children:t.note})]})]})}),J(H,{children:J(oe,{provider:e.provider})}),J(H,{$align:`right`,$mono:!0,children:e.tier}),J(H,{children:n.length===0?J(Z,{children:`unknown`}):J(le,{children:n.map(({window:e,fraction:t})=>Y(ce,{children:[J(B,{fraction:t,label:`${h[e.windowType]} window, ${Math.round(t*100)}% used`}),J(P,{children:u(e,l,s,r,g(i,e.windowType))})]},e.windowType))})}),J(H,{$align:`right`,$mono:!0,children:a===void 0?`—`:f(a.requests)}),J(H,{$align:`right`,$mono:!0,children:r(o[e.id]??null,l)})]},e.id))})]})})})}var pe=X.ul`
19
- display: flex;
20
- flex-direction: column;
21
- `,me=X.li`
22
- display: flex;
23
- align-items: center;
24
- gap: ${({theme:e})=>e.space(2)};
25
- padding: 6px ${({theme:e})=>e.space(3)};
26
- border-bottom: 1px solid ${({theme:e})=>e.color.rule};
27
-
28
- &:last-child {
29
- border-bottom: 0;
30
- }
31
- `,he=X(T)`
32
- font-family: ${({theme:e})=>e.font.mono};
33
- font-size: 12px;
34
- max-width: 30ch;
35
- `,ge=X(T)`
36
- font-family: ${({theme:e})=>e.font.mono};
37
- font-size: 11px;
38
- color: ${({theme:e})=>e.color.inkFaint};
39
- max-width: 16ch;
40
- `,_e=X(k)`
41
- color: ${({theme:e})=>e.color.down};
42
- font-size: 11px;
43
- `;function ve({logs:t,keyNames:n}){let r=t.slice(0,12);return J(j,{legend:`Activity`,meta:`most recent first`,flush:!0,actions:J(A,{as:y,to:`/logs`,$size:`sm`,children:`Open logs`}),children:r.length===0?J(O,{legend:`No traffic yet`,message:`Point a client at this gateway with an API key and the requests will appear here.`}):J(pe,{children:r.map(t=>Y(me,{children:[J(x,{state:_(t),label:l(t)}),J(k,{$dim:!0,children:e(t.at)}),J(he,{title:t.requestedModel,children:t.requestedModel||`—`}),t.resolvedProvider===null?null:J(k,{$dim:!0,style:{color:L(t.resolvedProvider)},children:t.resolvedProvider}),t.apiKeyId===null?null:J(ge,{title:t.apiKeyId,children:n.get(t.apiKeyId)??w(t.apiKeyId)}),J(N,{}),C(t)?J(k,{$dim:!0,"aria-label":`processing`,children:J(ae,{})}):Y(q,{children:[t.errorCode===null?null:J(_e,{children:t.errorCode}),t.attempts>1?Y(k,{$dim:!0,children:[t.attempts,`×`]}):null,J(k,{$dim:!0,children:J(R,{tokens:t})}),J(k,{$dim:!0,children:s(t.durationMs)}),J(k,{$dim:!0,children:a(t.costUsd)})]})]},t.id))})})}var ye=X.ul`
44
- display: flex;
45
- flex-direction: column;
46
- gap: ${({theme:e})=>e.space(3)};
47
- `,be=X(T)`
48
- font-family: ${({theme:e})=>e.font.mono};
49
- font-size: 12.5px;
50
- `,xe=X.div`
51
- display: flex;
52
- height: 5px;
53
- border-radius: 2px;
54
- overflow: hidden;
55
- background: ${({theme:e})=>e.color.panelSunk};
56
- border: 1px solid ${({theme:e})=>e.color.rule};
57
- `,Q=X.div`
58
- flex: ${({$grow:e})=>e} 0 0;
59
- background: ${({$color:e})=>e};
60
- opacity: 0.8;
61
- `,Se=X.div`
62
- flex: ${({$grow:e})=>e} 0 0;
63
- `;function Ce({models:e,logs:t}){let n=new Map;for(let e of t){let t=n.get(e.requestedModel)??{requests:0,costUsd:0};t.requests+=1,t.costUsd+=e.costUsd,n.set(e.requestedModel,t)}let r=Math.max(1,...[...n.values()].map(e=>e.requests)),i=[...e].map(e=>({model:e,used:n.get(e.id)})).sort((e,t)=>(t.used?.requests??0)-(e.used?.requests??0)).slice(0,8);return J(j,{legend:`Models`,meta:`${e.length} configured`,actions:J(A,{as:y,to:`/models`,$size:`sm`,children:`Edit routing`}),children:e.length===0?J(O,{legend:`No models`,message:`Nothing is routable yet. Create a virtual model and point it at one or more provider targets.`,action:J(A,{as:y,to:`/models`,$variant:`primary`,$size:`sm`,children:`Create a model`})}):J(ye,{children:i.map(({model:e,used:t})=>{let n=(t?.requests??0)/r,i=[...new Set(e.targets.map(e=>e.provider))];return Y(`li`,{children:[Y(E,{$gap:2,children:[J(be,{title:e.id,children:e.id}),e.isAlias?J(z,{children:`alias`}):null,J(z,{$tone:`accent`,children:e.strategy}),J(N,{}),J(k,{$dim:!0,children:f(t?.requests??0)}),J(P,{children:`req`}),J(k,{$dim:!0,children:a(t?.costUsd??0)})]}),Y(xe,{style:{marginTop:6},title:`${Math.round(n*100)}% of the busiest model`,children:[i.map(e=>J(Q,{$color:L(e),$grow:n/i.length},e)),J(Se,{$grow:Math.max(0,1-n)})]})]},e.id)})})})}var we=X.div`
64
- display: grid;
65
- grid-template-columns: repeat(auto-fit, minmax(168px, 1fr));
66
- gap: ${({theme:e})=>e.space(3)};
67
- `;function Te({logs:e,windowMs:t,now:r}){let i=e.filter(e=>r-e.at<=t),o=te(i,t),c=d(i,{now:r,spanMs:t,count:32}),l=o.errorRate>=.25?`down`:o.errorRate>=.05?`warn`:`ok`,u=o.inputTokens+o.outputTokens+o.cacheReadTokens+o.cacheWriteTokens;return Y(we,{children:[J(G,{legend:`Requests`,value:f(o.requests),unit:`${o.ratePerMin.toFixed(1)}/min`,trace:J(I,{values:c.map(e=>e.total),overlay:c.map(e=>e.errors),label:`${o.requests} requests, ${o.errors} of them failed`})}),J(G,{legend:`Error rate`,value:n(o.errorRate),unit:`${f(o.errors)} failed`,tone:o.requests===0?`ink`:l,trace:J(I,{values:c.map(e=>e.errors),scaleTo:Math.max(...c.map(e=>e.total)),color:`var(--down)`,label:`${o.errors} failed requests against ${o.requests} total`})}),J(G,{legend:`Total tokens`,value:f(u),unit:J(R,{tokens:o}),trace:J(I,{values:c.map(e=>e.tokens),label:`token volume over the window, ${u.toLocaleString(`en-US`)} total`})}),J(G,{legend:`Time to first token`,value:s(o.ttftP50),unit:`p95 ${s(o.ttftP95)}`,trace:J(I,{values:c.map(e=>e.ttftMs??0),color:`var(--ok)`,label:`median first-token latency, currently ${s(o.ttftP50)}`})}),J(G,{legend:`Spend`,value:a(o.costUsd),unit:`${f(o.inputTokens+o.outputTokens)} tokens`,trace:J(I,{values:c.map(e=>e.costUsd),color:`var(--warn)`,label:`spend over the window, ${a(o.costUsd)} total`})})]})}var $=36e5;function Ee(){let{cadence:e}=F(),n=m(),r=v(e(1e4,`res:credentials`)),a=p(),s=o(500,e(1e4,`res:logs`)),l=t(),u=i(),d=K(()=>{let e=new Map;for(let t of l.data??[])e.set(t.id,t.label);return e},[l.data]),f=Date.now(),h=Math.floor((f-$)/6e4)*6e4,g=S({groupBy:`credential`,since:h},e(6e4,`res:usage`)),_=n.data??[],y=c(r.data?.health??[],e=>e.credentialId),x=_.filter(e=>b(y.get(e.id)??[],f,e.enabled,e.disabledReason).state===`down`),C=n.isLoading||s.isLoading?`Reading the gateway…`:_.length===0?`No accounts are connected, so every request fails at the router.`:x.length>0?`${x.length} account${x.length===1?` is`:`s are`} out of rotation.`:`All ${_.length} accounts are answering. Nothing needs attention.`;return Y(q,{children:[J(ie,{legend:`Rack`,title:`Gateway`,summary:C}),s.isError?J(j,{legend:`Traffic`,children:J(re,{legend:`The gateway did not answer`,error:s.error,onRetry:()=>void s.refetch()})}):Y(D,{$gap:4,children:[J(Te,{logs:s.data??[],windowMs:$,now:f}),J(fe,{credentials:_,health:r.data?.health??[],quota:r.data?.quota??[],burn:r.data?.burn??[],usage:g.data??[],lastUsed:r.data?.lastUsed??{},quotaPollIntervalMs:u.data?.quotaPollIntervalMs??3e5,now:f}),Y(M,{$min:`340px`,$gap:4,children:[J(Ce,{models:a.data??[],logs:s.data??[]}),J(ve,{logs:s.data??[],keyNames:d})]})]})]})}var De=Ee;export{De as component};
@@ -1,107 +0,0 @@
1
- import{Bt as e,Ct as t,Gt as n,Kt as r,M as i,Wt as a,dt as o,kt as s,w as c}from"./Lamp-Dk9XrTCg.js";import{A as l,E as u,S as d,T as f,a as p,b as m,c as h,k as g,n as _,o as v,s as y,t as b,y as x}from"./Panel-CsovmtxF.js";import{A as S,O as C,i as w,r as T,t as E}from"./Rack-CDUOJkS2.js";import{t as D}from"./CopyValue-DAlmkISB.js";import{t as ee}from"./chevron-down-Bb5ZGvwk.js";import{t as O}from"./chevron-right-hwF5mD6-.js";import{t as k}from"./plus-BgcHxxIr.js";import{t as A}from"./Toggle-CdMD58sy.js";import{t as j}from"./Chip-D0XSbQUr.js";import{n as M,r as N,t as P}from"./Field-DG1317zr.js";import{t as F}from"./Meter-stpt3vQu.js";import{i as I,n as L,r as R,t as te}from"./Table-CVDZ69Zx.js";import{a as z,c as ne,d as re,f as ie,i as B,l as ae,n as oe,o as V,r as H,s as U,t as se,u as ce}from"./limits-iRyDMg04.js";import{Fragment as W,useId as le,useState as G}from"react";import{Fragment as K,jsx as q,jsxs as J}from"react/jsx-runtime";import Y from"styled-components";var X={name:`calendar-clock`,size:24,node:[[`path`,{d:`M16 14v2.2l1.6 1`,key:`fo4ql5`}],[`path`,{d:`M16 2v3`,key:`otl347`}],[`path`,{d:`M21 7.338V5a2 2 0 00-2-2H5a2 2 0 00-2 2v14a2 2 0 002 2h2.338`,key:`7hb8p4`}],[`path`,{d:`M3 9h5.859`,key:`numkqi`}],[`path`,{d:`M8 2v3`,key:`1ioesn`}],[`circle`,{cx:`16`,cy:`16`,r:`6`,key:`qoo3c4`}]]};X.node;var ue=S(X),Z={name:`list-checks`,size:24,node:[[`path`,{d:`M13 5h8`,key:`a7qcls`}],[`path`,{d:`M13 12h8`,key:`h98zly`}],[`path`,{d:`M13 19h8`,key:`c3s6r1`}],[`path`,{d:`m3 17 2 2 4-4`,key:`1jhpwq`}],[`path`,{d:`m3 7 2 2 4-4`,key:`1obspn`}]]};Z.node;var de=S(Z);function Q(e,t){return e.revokedAt===null?c(e,t)?`active`:`expired`:`revoked`}function fe(e){if(e===null)return``;let t=new Date(e-new Date(e).getTimezoneOffset()*6e4);return Number.isNaN(t.getTime())?``:t.toISOString().slice(0,16)}function pe(e){let t=e.trim();if(t.length===0)return{at:null};let n=new Date(t).getTime();return Number.isFinite(n)?{at:n}:{problem:`"${e}" is not a date`}}var me=Y.p`
2
- font-size: 12px;
3
- color: ${({theme:e})=>e.color.down};
4
- `,he=Y.p`
5
- font-size: 12px;
6
- color: ${({theme:e})=>e.color.warn};
7
- `;function ge({apiKey:e,onOpenChange:t}){let n=a(),[r,i]=G(()=>fe(e?.expiresAt??null)),[o,s]=G(null),c=()=>{if(e===null)return;let i=pe(r);if(`problem`in i){s(i.problem);return}s(null),n.mutate({id:e.id,expiresAt:i.at},{onSuccess:()=>t(!1),onError:e=>s(h(e))})},l=e!==null&&Q(e,Date.now())===`expired`;return q(w,{open:e!==null,onOpenChange:t,title:`Edit expiry`,description:e===null?void 0:`When "${e.label}" stops being accepted. Leave it blank for never.`,width:`480px`,footer:J(K,{children:[q(g,{type:`button`,onClick:()=>t(!1),children:`Cancel`}),q(g,{type:`button`,$variant:`primary`,disabled:n.isPending,onClick:c,children:n.isPending?`Saving…`:`Save expiry`})]}),children:J(f,{$gap:3,children:[l?q(he,{role:`status`,children:`This key has expired and the gateway is refusing it. Moving the date forward, or clearing it, brings it back.`}):null,q(P,{label:`Expires`,hint:`Your local time. Blank means the key never expires; a date already past expires it now.`,children:e=>q(M,{...e,type:`datetime-local`,value:r,disabled:n.isPending,onChange:e=>i(e.target.value)})}),o===null?null:q(me,{role:`alert`,children:o})]})})}var _e=Y.div`
8
- display: grid;
9
- grid-template-columns: repeat(3, minmax(0, 1fr));
10
- gap: ${({theme:e})=>e.space(2)};
11
- `,ve=Y.p`
12
- font-size: 11px;
13
- color: ${({theme:e})=>e.color.inkDim};
14
- `;function $({draft:e,onChange:t,disabled:n=!1}){return J(f,{$gap:2,children:[q(_e,{children:se.map(r=>{let i=ie(r);return q(P,{label:H(r),children:a=>q(N,{...a,min:r.dimension===`spend`?void 0:1,step:r.dimension===`spend`?`any`:1,disabled:n,value:e[i]??``,placeholder:`none`,onChange:n=>t({...e,[i]:n.target.value})})},i)})}),q(ve,{children:`Blank means no limit. Token and spend ceilings are debited after a response completes, so a key at its ceiling is refused on its next request rather than its current one. Concurrency counts requests in flight right now and resets when the gateway restarts.`})]})}var ye=Y.p`
15
- font-size: 12px;
16
- color: ${({theme:e})=>e.color.down};
17
- `,be=Y.p`
18
- font-size: 12px;
19
- color: ${({theme:e})=>e.color.warn};
20
- `,xe=Y.h3`
21
- font-size: 12px;
22
- font-weight: 600;
23
- color: ${({theme:e})=>e.color.ink};
24
- `,Se=Y(f)`
25
- padding-top: ${({theme:e})=>e.space(2)};
26
- border-top: 1px solid ${({theme:e})=>e.color.rule};
27
- `,Ce=Y.p`
28
- font-size: 11px;
29
- color: ${({theme:e})=>e.color.inkDim};
30
- `;function we({apiKey:e,onOpenChange:t}){let r=n(),i=s(),[a,o]=G(()=>B(e?.limits??{})),[c,l]=G(()=>ce(e?.limits??{})),[u,p]=G(0),[m,_]=G(null),v=le(),y=(i.data??[]).map(e=>e.id),b=(e,t)=>{l(n=>n.map(n=>n.id===e?{...n,...t}:n))};return q(w,{open:e!==null,onOpenChange:t,title:`Edit limits`,description:e===null?void 0:`What "${e.label}" may do per minute, per five hours, and per week. Every field is a ceiling; blank is no limit.`,width:`640px`,footer:J(K,{children:[q(g,{type:`button`,onClick:()=>t(!1),children:`Cancel`}),q(g,{type:`button`,$variant:`primary`,disabled:r.isPending,onClick:()=>{if(e===null)return;let n=z(a);if(`problem`in n){_(n.problem);return}let i=re(c);if(`problem`in i){_(i.problem);return}let o=Object.keys(i.models).length===0?n.limits:{...n.limits,models:i.models};_(null),r.mutate({id:e.id,limits:o},{onSuccess:()=>t(!1),onError:e=>_(h(e))})},children:r.isPending?`Saving…`:`Save limits`})]}),children:J(f,{$gap:3,children:[e?.limits===null?q(be,{role:`status`,children:`The stored limits for this key cannot be read, so the gateway refuses it. Saving here replaces them.`}):null,q($,{draft:a,onChange:o,disabled:r.isPending}),J(f,{$gap:2,children:[q(xe,{children:`Per-model overrides`}),q(x,{children:`A stricter ceiling for one model, matched exactly against the model a request names. It stacks with the limits above: a request for that model must pass both.`}),c.map(t=>{let n=t.model,i=n.trim().length===0?`a new model`:n,a=n.trim().length>0&&e?.modelAllowlist!==null&&e?.modelAllowlist!==void 0&&!e.modelAllowlist.includes(n);return J(Se,{$gap:2,role:`group`,"aria-label":`Override for ${i}`,children:[J(d,{$gap:2,$align:`flex-end`,children:[q(P,{label:`Model`,children:e=>q(M,{...e,list:v,disabled:r.isPending,value:t.model,placeholder:`model name`,onChange:e=>b(t.id,{model:e.target.value})})}),q(g,{type:`button`,$variant:`ghost`,disabled:r.isPending,"aria-label":`Remove override for ${i}`,onClick:()=>l(e=>e.filter(e=>e.id!==t.id)),children:`Remove`})]}),a?J(Ce,{children:[n,` is not in this key's allowed models, so this override applies to no request until it is.`]}):null,q($,{draft:t.slots,onChange:e=>b(t.id,{slots:e}),disabled:r.isPending})]},t.id)}),q(`div`,{children:q(g,{type:`button`,disabled:r.isPending,onClick:()=>{l(e=>[...e,{id:`added-${u}`,model:``,stored:null,slots:B({})}]),p(e=>e+1)},children:`Add model override`})}),q(`datalist`,{id:v,children:y.map(e=>q(`option`,{value:e},e))})]}),m===null?null:q(ye,{role:`alert`,children:m})]})})}var Te=Y.div`
31
- display: flex;
32
- flex-direction: column;
33
- gap: 2px;
34
- max-height: 190px;
35
- overflow-y: auto;
36
- padding: ${({theme:e})=>e.space(1)};
37
- border: 1px solid ${({theme:e})=>e.color.ruleStrong};
38
- border-radius: ${({theme:e})=>e.radius.control};
39
- background: ${({theme:e})=>e.color.panelSunk};
40
- `,Ee=Y.label`
41
- display: flex;
42
- align-items: center;
43
- gap: ${({theme:e})=>e.space(2)};
44
- padding: 4px 6px;
45
- border-radius: 2px;
46
- cursor: pointer;
47
- font-family: ${({theme:e})=>e.font.mono};
48
- font-size: 12px;
49
-
50
- &:hover {
51
- background: ${({theme:e})=>e.color.panelRaised};
52
- }
53
- `,De=Y.p`
54
- font-size: 11px;
55
- color: ${({theme:e})=>e.color.inkDim};
56
- `;function Oe({configured:e,checked:t,onChange:n,disabled:r}){let i=[...new Set([...e,...t])].sort(),a=(e,r)=>{n(r?[...t,e]:t.filter(t=>t!==e))},o=t.filter(t=>!e.includes(t));return J(`div`,{children:[q(Te,{children:i.map(e=>J(Ee,{children:[q(`input`,{type:`checkbox`,disabled:r,"aria-label":e,checked:t.includes(e),onChange:t=>a(e,t.target.checked)}),e]},e))}),o.length>0?q(De,{children:`Some listed models are no longer configured. They stay until you clear them.`}):null,t.length===0?q(x,{children:`With nothing selected this key is allowed no model.`}):null]})}var ke=Y.p`
57
- font-size: 12px;
58
- color: ${({theme:e})=>e.color.down};
59
- `;function Ae({apiKey:e,onOpenChange:t}){let n=r(),i=s(),[a,o]=G(e?.modelAllowlist===null),[c,l]=G(()=>e?.modelAllowlist===null?[]:e?.modelAllowlist??[]),[u,p]=G(null),m=(i.data??[]).map(e=>e.id);return q(w,{open:e!==null,onOpenChange:t,title:`Edit models`,description:e===null?void 0:`Which models "${e.label}" may ask the gateway for. Sent whole on save.`,width:`640px`,footer:J(K,{children:[q(g,{type:`button`,onClick:()=>t(!1),children:`Cancel`}),q(g,{type:`button`,$variant:`primary`,disabled:n.isPending,onClick:()=>{e!==null&&(p(null),n.mutate({id:e.id,modelAllowlist:a?null:c},{onSuccess:()=>t(!1),onError:e=>p(h(e))}))},children:n.isPending?`Saving…`:`Save models`})]}),children:J(f,{$gap:3,children:[J(f,{$gap:2,children:[J(d,{$gap:2,children:[q(A,{checked:a,label:`Allow every model`,onCheckedChange:e=>{o(e),e&&l([])}}),q(x,{as:`span`,children:`Allow every model`})]}),a?null:q(Oe,{configured:m,checked:c,onChange:l,disabled:n.isPending})]}),u===null?null:q(ke,{role:`alert`,children:u})]})})}var je=Y.div`
60
- display: grid;
61
- grid-template-columns: minmax(0, 11rem) minmax(0, 12rem) minmax(0, 1fr) minmax(0, 3.5rem);
62
- align-items: center;
63
- gap: ${({theme:e})=>e.space(2)} ${({theme:e})=>e.space(4)};
64
- `,Me=Y.span`
65
- font-size: 11.5px;
66
- color: ${({theme:e})=>e.color.inkDim};
67
- `,Ne=Y.h4`
68
- font-family: ${({theme:e})=>e.font.mono};
69
- font-size: 12px;
70
- font-weight: 600;
71
- color: ${({theme:e})=>e.color.ink};
72
- `,Pe=Y.p`
73
- font-size: 11px;
74
- color: ${({theme:e})=>e.color.inkDim};
75
- `;function Fe({label:e,readings:t}){let n=ne(t),r=n.some(e=>e.model!==null);return J(f,{$gap:3,children:[n.map(t=>{let n=t.model??`Every model`,i=q(Ie,{label:e,model:t.model,readings:t.readings},n);return r?J(f,{$gap:2,role:`group`,"aria-label":n,children:[q(Ne,{children:n}),i]},n):i}),q(Pe,{children:`Usage counts completed requests still inside each window. Requests in flight are added by the gateway itself and are not shown here. A model's override stacks with the key-wide limits: a request for it must pass both.`})]})}function Ie({label:e,model:t,readings:n}){let r=t===null?e:`${e}, ${t}`;return q(je,{children:n.map(e=>{let t=H({dimension:e.dimension,window:e.window}),n=U(e),i=V(e.dimension,e.limit);return J(W,{children:[q(x,{as:`span`,children:t}),q(m,{children:e.used===null?i:`${V(e.dimension,e.used)} of ${i}`}),n===null?q(Me,{children:`in flight now, counted in the gateway process`}):q(F,{fraction:Math.min(1,n),label:`${r}, ${t}, ${Math.round(n*100)}% used`}),q(m,{children:n===null?`—`:`${Math.round(n*100)}%`})]},t)})})}var Le=Y.p`
76
- font-size: 12px;
77
- color: ${({theme:e})=>e.color.warn};
78
- `,Re=Y.p`
79
- font-size: 11px;
80
- color: ${({theme:e})=>e.color.inkDim};
81
- `,ze=Y.p`
82
- font-size: 12px;
83
- color: ${({theme:e})=>e.color.down};
84
- `,Be=Y.p`
85
- font-size: 12px;
86
- color: ${({theme:e})=>e.color.inkDim};
87
- `,Ve=Y(g)`
88
- gap: 4px;
89
- `;function He({open:e,onOpenChange:t}){let n=s(),r=o(),[i,a]=G(``),[c,l]=G(!0),[u,p]=G([]),[_,v]=G(()=>B({})),[y,b]=G(!1),[S,C]=G(``),[T,E]=G(!1),[k,j]=G(null),[N,F]=G(null),I=()=>{a(``),l(!0),p([]),v(B({})),b(!1),C(``),E(!1),j(null),F(null),r.reset()},L=e=>{e||I(),t(e)},R=Object.values(_).filter(e=>e.trim().length>0).length;return q(w,{open:e,onOpenChange:L,title:k===null?`Create an API key`:`Key created`,description:k===null?`Clients send this key as a bearer token or as x-api-key on every /v1 request.`:void 0,footer:k===null?J(K,{children:[q(g,{type:`button`,onClick:()=>L(!1),children:`Cancel`}),q(g,{type:`button`,$variant:`primary`,disabled:r.isPending,onClick:()=>{let e=z(_);if(`problem`in e){b(!0),F(e.problem);return}let t=pe(S);if(`problem`in t){F(t.problem);return}F(null),r.mutate({label:i.trim().length===0?`api key`:i.trim(),modelAllowlist:c?null:u,limits:e.limits,bodyLoggingOptOut:T,expiresAt:t.at},{onSuccess:e=>j(e),onError:e=>F(h(e))})},children:r.isPending?`Creating…`:`Create key`})]}):q(g,{type:`button`,$variant:`primary`,onClick:()=>L(!1),children:`I have copied the key`}),children:k===null?J(f,{$gap:3,children:[q(P,{label:`Label`,hint:`Names the client this key belongs to, e.g. laptop or CI.`,children:e=>q(M,{...e,value:i,placeholder:`api key`,onChange:e=>a(e.target.value)})}),J(f,{$gap:2,children:[J(d,{$gap:2,children:[q(A,{checked:c,label:`Allow every model`,onCheckedChange:l}),q(x,{as:`span`,children:`Allow every model`})]}),c?null:J(K,{children:[q(Oe,{configured:(n.data??[]).map(e=>e.id),checked:u,onChange:p}),u.length===0?q(Le,{children:`With no model selected this key is allowed nothing and every request it makes will be refused.`}):null]})]}),J(f,{$gap:2,children:[J(d,{$gap:2,children:[J(Ve,{type:`button`,$size:`sm`,"aria-expanded":y,onClick:()=>b(e=>!e),children:[q(y?ee:O,{}),`Limits`]}),q(x,{as:`span`,children:R===0?`no limits; this key is unbounded`:`${R} limit${R===1?``:`s`} set`})]}),y?q($,{draft:_,onChange:v}):null]}),q(P,{label:`Expires`,hint:`Optional. Your local time; blank means the key never expires.`,children:e=>q(M,{...e,type:`datetime-local`,value:S,onChange:e=>C(e.target.value)})}),J(f,{$gap:2,children:[J(d,{$gap:2,children:[q(A,{checked:T,label:`Never record this key's bodies`,onCheckedChange:E}),q(x,{as:`span`,children:`Never record this key's bodies`})]}),q(Re,{children:`Suppresses body capture for this key whatever the gateway setting says. Choose it for a client whose payloads must not be retained. It cannot be changed after the key is created — issue a new key instead.`})]}),N===null?null:q(ze,{role:`alert`,children:N})]}):J(f,{$gap:3,children:[q(Be,{children:`This is the only time the key is shown. The gateway keeps a hash, so a lost key has to be replaced rather than recovered.`}),q(D,{value:k.key,label:`Copy API key`}),J(d,{$gap:2,children:[q(x,{children:`Label`}),q(m,{children:k.label}),q(x,{children:`Prefix`}),q(m,{children:k.prefix})]})]})})}var Ue=Y(d)`
90
- gap: 4px;
91
- flex-wrap: wrap;
92
- max-width: 34ch;
93
- `,We=Y.span`
94
- color: ${({theme:e})=>e.color.inkFaint};
95
- `,Ge=Y.span`
96
- display: block;
97
- font-size: 11px;
98
- color: ${({theme:e})=>e.color.inkDim};
99
- `,Ke=Y.span`
100
- font-size: 11px;
101
- color: ${({theme:e})=>e.color.inkDim};
102
- `,qe=Y.div`
103
- display: flex;
104
- flex-direction: column;
105
- align-items: flex-end;
106
- gap: 2px;
107
- `;function Je(e){if(e===null)return`usage not counted here`;let t=U(e);return`${oe(e)} ${V(e.dimension,e.limit)}, ${t===null?`—`:Math.round(t*100)}% used`}function Ye(){let n=t(),r=e(),[a,o]=G(!1),[s,c]=G(null),[f,m]=G(null),[h,S]=G(null),[w,D]=G(null),[A,M]=G(null),N=Date.now(),P=n.data??[],F=P.filter(e=>Q(e,N)===`active`),z=n.isLoading?`Reading issued keys…`:P.length===0?`No keys exist, so nothing can call this gateway yet.`:`${F.length} active key${F.length===1?``:`s`} of ${P.length} ever issued.`;return J(K,{children:[q(E,{legend:`Keys`,title:`Gateway API keys`,summary:z,actions:J(g,{type:`button`,$variant:`primary`,onClick:()=>o(!0),children:[q(k,{}),`Create a key`]})}),q(b,{legend:`Issued keys`,meta:`${P.length}`,flush:!0,children:n.isError?q(v,{error:n.error,onRetry:()=>void n.refetch()}):n.isLoading?q(`div`,{style:{padding:12},children:q(y,{rows:4})}):P.length===0?q(p,{legend:`No keys`,message:`Create a key and give it to a client. The key is shown once, at creation.`,action:q(g,{type:`button`,$variant:`primary`,$size:`sm`,onClick:()=>o(!0),children:`Create a key`})}):q(_,{children:J(te,{children:[q(`thead`,{children:J(`tr`,{children:[q(R,{children:`Label`}),q(R,{children:`Prefix`}),q(R,{children:`Allowed models`}),q(R,{$align:`right`,children:`Limits`}),q(R,{$align:`right`,children:`Created`}),q(R,{children:`Body capture`}),q(R,{children:`Status`}),q(R,{})]})}),q(`tbody`,{children:P.map(e=>{let t=w===e.id,n=ae(e.limitUsage),r=Q(e,N);return J(W,{children:[J(I,{children:[q(L,{children:q(u,{style:{maxWidth:`24ch`,display:`block`},children:e.label})}),J(L,{$mono:!0,children:[e.prefix,`…`]}),q(L,{children:e.modelAllowlist===null?q(x,{children:`every model`}):e.modelAllowlist.length===0?q(j,{$tone:`down`,children:`no models`}):q(Ue,{children:e.modelAllowlist.map(e=>q(j,{children:e},e))})}),q(L,{$align:`right`,children:e.limits===null?q(j,{$tone:`down`,children:`unreadable`}):e.limitUsage.length===0?q(x,{children:`no limits`}):J(qe,{children:[J(`span`,{children:[e.limitUsage.length,` limit`,e.limitUsage.length===1?``:`s`]}),q(Ke,{children:Je(n)})]})}),q(L,{$align:`right`,$mono:!0,children:i(e.createdAt)}),q(L,{children:e.bodyLoggingOptOut?q(j,{children:`no bodies`}):q(x,{children:`—`})}),J(L,{children:[r===`revoked`?q(We,{title:i(e.revokedAt??0),children:q(j,{children:`revoked`})}):r===`expired`?q(j,{$tone:`down`,children:`expired`}):q(j,{$tone:`ok`,children:`active`}),e.expiresAt===null?null:J(Ge,{children:[r===`expired`?`expired`:`expires`,` `,i(e.expiresAt)]})]}),q(L,{$align:`right`,children:J(d,{$gap:1,$justify:`flex-end`,children:[e.limitUsage.length===0?null:q(l,{type:`button`,$variant:`ghost`,$size:`sm`,"aria-expanded":t,"aria-label":`${t?`Hide`:`Show`} limits for ${e.label}`,title:`${t?`Hide`:`Show`} limits for ${e.label}`,onClick:()=>D(t?null:e.id),children:q(t?ee:O,{})}),e.revokedAt===null?J(K,{children:[q(l,{type:`button`,$variant:`ghost`,$size:`sm`,"aria-label":`Edit models for ${e.label}`,title:`Edit models for ${e.label}`,onClick:()=>m(e),children:q(de,{})}),q(l,{type:`button`,$variant:`ghost`,$size:`sm`,"aria-label":`Edit limits for ${e.label}`,title:`Edit limits for ${e.label}`,onClick:()=>c(e),children:q(C,{})}),q(l,{type:`button`,$variant:`ghost`,$size:`sm`,"aria-label":`Edit expiry for ${e.label}`,title:`Edit expiry for ${e.label}`,onClick:()=>S(e),children:q(ue,{})}),q(g,{type:`button`,$variant:`danger`,$size:`sm`,onClick:()=>M(e),children:`Revoke`})]}):null]})})]}),t?q(I,{children:q(L,{colSpan:8,children:q(Fe,{label:e.label,readings:e.limitUsage})})}):null]},e.id)})})]})})}),q(He,{open:a,onOpenChange:o}),q(we,{apiKey:s,onOpenChange:e=>{e||c(null)}},s?.id??`none`),q(Ae,{apiKey:f,onOpenChange:e=>{e||m(null)}},f?.id??`none`),q(ge,{apiKey:h,onOpenChange:e=>{e||S(null)}},h?.id??`none`),q(T,{open:A!==null,onOpenChange:e=>{e||M(null)},title:`Revoke key`,body:A===null?``:`Revoking "${A.label}" refuses its next request. The key stays listed so past usage keeps its attribution, and it cannot be un-revoked.`,confirmLabel:`Revoke key`,busy:r.isPending,onConfirm:()=>{A!==null&&r.mutate(A.id,{onSettled:()=>M(null)})}})]})}var Xe=Ye;export{Xe as component};
@@ -1,46 +0,0 @@
1
- import{$t as e,Ct as t,It as n,K as r,Tt as i,V as a,W as o,Y as s,j as c,l as ee,mt as l,u}from"./Lamp-Dk9XrTCg.js";import{S as d,T as f,a as p,k as m,n as h,o as g,r as _,s as v,t as y,x as b,y as x}from"./Panel-CsovmtxF.js";import{D as S,i as te,t as C}from"./Rack-CDUOJkS2.js";import{a as w,i as T,n as E,r as D,t as O}from"./RequestTable-i3TtCB9m.js";import{t as k}from"./Chip-D0XSbQUr.js";import{i as A}from"./Field-DG1317zr.js";import{useMemo as j,useRef as M,useState as N}from"react";import{Fragment as P,jsx as F,jsxs as I}from"react/jsx-runtime";import L from"styled-components";var R={none:{legend:`Not captured`,message:`Body capture was not running for this request. It needs OMNI_BODY_LOGGING_ALLOWED in the environment and the body logging setting turned on, and the calling key must not have opted out.`},missing:{legend:`Captured, then lost`,message:`This request was captured, but its artifact is no longer on disk. Retention or the row cap has since pruned it, or something removed the file underneath the gateway.`},corrupt:{legend:`Captured, but unreadable`,message:`This request was captured and the artifact is still on disk, but it failed its checksum or would not decrypt. Changing OMNI_ENCRYPTION_KEY invalidates every artifact written under the old one.`}},z=new Intl.NumberFormat(`en-US`),B=L.p`
2
- font-size: 12px;
3
- color: ${({theme:e})=>e.color.inkDim};
4
- max-width: 62ch;
5
- `,V=L(B)`
6
- border-left: 2px solid ${({theme:e})=>e.color.ruleStrong};
7
- padding-left: ${({theme:e})=>e.space(2)};
8
- `,H=L.h4`
9
- font-size: 11px;
10
- font-weight: 600;
11
- letter-spacing: 0.12em;
12
- text-transform: uppercase;
13
- color: ${({theme:e})=>e.color.inkDim};
14
- margin: 0;
15
- `,U=L.figcaption`
16
- display: flex;
17
- align-items: center;
18
- gap: ${({theme:e})=>e.space(2)};
19
- flex-wrap: wrap;
20
- margin-bottom: 4px;
21
- `,W=L.figure`
22
- margin: 0;
23
- min-width: 0;
24
- `,G=L.pre`
25
- margin: 0;
26
- padding: ${({theme:e})=>e.space(2)};
27
- max-height: 260px;
28
- overflow: auto;
29
- border: 1px solid ${({theme:e})=>e.color.rule};
30
- border-radius: ${({theme:e})=>e.radius.control};
31
- background: ${({theme:e})=>e.color.panelSunk};
32
- font-family: ${({theme:e})=>e.font.mono};
33
- font-size: 11.5px;
34
- line-height: 1.5;
35
- white-space: pre-wrap;
36
- word-break: break-word;
37
- `;function K(e){if(typeof e!=`object`||!e||Array.isArray(e))return null;let t=e;if(t.omitted!==!0||typeof t.reason!=`string`)return null;let n=t.serializedBytes;return{omitted:!0,reason:t.reason,serializedBytes:typeof n==`number`?n:0}}function q({title:e,stage:t,value:n}){let r=K(n);return I(W,{children:[I(U,{children:[F(H,{children:e}),t===void 0?null:F(k,{children:t})]}),r===null?n==null?F(B,{children:`Nothing was recorded for this half — it never happened, or never completed.`}):F(G,{children:JSON.stringify(n,null,2)}):I(B,{children:[`Too large to keep: `,r.reason,`. The payload was`,` `,z.format(r.serializedBytes),` bytes after structural bounding, so it was replaced by this marker rather than written oversized or dropped without a trace.`]})]})}function J({attempt:e}){return I(f,{$gap:2,children:[I(d,{$gap:2,$wrap:!0,children:[I(x,{as:`h3`,children:[`Attempt `,e.attempt,` · `,e.provider]}),e.truncated?F(k,{$tone:`warn`,children:`truncated`}):null]}),F(q,{title:`Request sent to the provider`,stage:`post-RTK`,value:e.request}),F(q,{title:`Response from the provider`,value:e.response}),e.streamChunks===null?null:F(q,{title:`Raw stream frames (${c(e.streamChunks.length)})`,value:e.streamChunks})]})}function Y({body:e}){let t=e.artifact;if(t===null){let t=R[e.detailState===`ready`?`corrupt`:e.detailState];return I(f,{$gap:1,children:[F(x,{children:t.legend}),F(B,{children:t.message})]})}return I(f,{$gap:3,children:[t.attempts.length===0?null:F(V,{children:`The client request below is what arrived at the gateway. Each attempt request is what went upstream after RTK filters ran, so the two are not the same payload — compare them to see what compression actually removed.`}),I(f,{$gap:2,children:[I(d,{$gap:2,$wrap:!0,children:[F(x,{as:`h3`,children:`Client`}),t.client.truncated?F(k,{$tone:`warn`,children:`truncated`}):null]}),F(q,{title:`Request from the client`,stage:`pre-RTK`,value:t.client.request}),F(q,{title:`Response returned to the client`,value:t.client.response})]}),t.attempts.map(e=>F(J,{attempt:e},`${e.attempt}-${e.provider}`)),t.error===null||t.error===void 0?null:F(q,{title:`Error`,value:t.error})]})}function X({requestId:e}){let t=n(e),r=t.data===void 0||t.data.detailState!==`ready`?void 0:`${z.format(t.data.sizeBytes)} bytes on disk`;return F(_,{legend:`Captured bodies`,...r===void 0?{}:{meta:r},...t.data?.truncated===!0?{actions:F(k,{$tone:`warn`,children:`truncated`})}:{},children:t.isError?F(g,{error:t.error,onRetry:()=>void t.refetch()}):t.isPending?F(v,{rows:3}):F(Y,{body:t.data})})}var Z=[50,100,250,500],ne=160,re=L(d)`
38
- gap: ${({theme:e})=>e.space(2)};
39
- flex-wrap: wrap;
40
- `,ie=L(A)`
41
- width: auto;
42
- `,ae=L(d)`
43
- justify-content: center;
44
- gap: ${({theme:e})=>e.space(2)};
45
- padding: ${({theme:e})=>e.space(3)};
46
- `;function Q(){let{cadence:n,live:d}=S(),[f,_]=N(100),[x,k]=N(w),[A,L]=N(null),R=M(!1),z=i(x,f,n(a,`res:logs`)),B=j(()=>(z.data?.pages??[]).flatMap(e=>e.logs),[z.data?.pages]),V=!o(z.data),H=e(r.logPages(x,f)),U=M(null),W=()=>{U.current?.scrollTo({top:0}),H()},G=l(),K=t(),q=s(),J=D(d&&B.some(u)),Y=j(()=>({accounts:new Map((G.data??[]).map(e=>[e.id,e.label])),keys:new Map((K.data??[]).map(e=>[e.id,e.label]))}),[G.data,K.data]),Q=B.filter(ee).length,$=B.filter(u).length;return I(P,{children:[F(C,{legend:`Logs`,title:`Recent requests`,summary:z.isLoading?`Reading the request log…`:`${c(B.length)} requests loaded, ${c(Q)} of them failed${$===0?``:`, ${c($)} still running`}. ${q.data===!0?`Body capture is on: open a request to read what it sent and received.`:`Prompt and response bodies are not being recorded.`}`,actions:I(re,{children:[F(T,{filters:x,onChange:k,operator:!0}),F(ie,{value:f,"aria-label":`How many requests per page`,onChange:e=>_(Number(e.target.value)),children:Z.map(e=>I(`option`,{value:e,children:[e,` per page`]},e))}),V?F(m,{type:`button`,onClick:W,children:`Back to live`}):null]})}),F(y,{legend:`Request log`,meta:`${B.length} shown`,flush:!0,children:z.isError?F(g,{error:z.error,onRetry:()=>void z.refetch()}):z.isLoading?F(`div`,{style:{padding:12},children:F(v,{rows:8})}):B.length===0?F(p,{legend:`Nothing to show`,message:Object.keys(x).length===0?`No requests have reached the gateway yet.`:`No request matches these filters. Clear them to see everything.`}):I(h,{ref:U,"data-testid":`request-log-scroller`,onScroll:e=>{let t=e.currentTarget;t.scrollHeight-t.scrollTop-t.clientHeight>ne||z.hasNextPage&&(R.current||(R.current=!0,z.fetchNextPage().finally(()=>{R.current=!1})))},children:[F(E,{rows:B,now:J,names:Y,onOpen:L}),z.isFetchingNextPage||V?I(ae,{children:[z.isFetchingNextPage?F(b,{children:`Loading older requests…`}):null,V?F(b,{children:`Live updates are paused while older pages are loaded.`}):null]}):null]})}),F(te,{open:A!==null,onOpenChange:e=>{e||L(null)},title:`Request detail`,width:`760px`,footer:F(m,{type:`button`,onClick:()=>L(null),children:`Close`}),children:A===null?null:F(O,{log:A,names:Y,children:F(X,{requestId:A.id})})})]})}var $=Q;export{$ as component};