omnigateway 0.1.1 → 0.1.3

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.
@@ -1,4 +1,4 @@
1
- import{B as e,D as t,Dt as n,I as r,Kt as i,Ot as a,U as o,j as s}from"./queries-vY5lJqBe.js";import{m as c}from"./Rack-Be09hoVn.js";var l=c(`x`,[[`path`,{d:`M18 6 6 18`,key:`1bl5f8`}],[`path`,{d:`m6 6 12 12`,key:`d8bk6v`}]]),u=i(a(),1),d=Object.defineProperty,f=(e,t)=>d(e,`name`,{value:t,configurable:!0});function p(e,t){if(typeof e==`function`)return e(t);e!=null&&(e.current=t)}f(p,`setRef`);function m(...e){return t=>{let n=!1,r=e.map(e=>{let r=p(e,t);return!n&&typeof r==`function`&&(n=!0),r});if(n)return()=>{for(let t=0;t<r.length;t++){let n=r[t];typeof n==`function`?n():p(e[t],null)}}}}f(m,`composeRefs`);function h(...e){return u.useCallback(m(...e),e)}f(h,`useComposedRefs`);var g=n(),_=i(o(),1),v=Object.defineProperty,y=(e,t)=>v(e,`name`,{value:t,configurable:!0});function b(e){let t=u.forwardRef((t,n)=>{let{children:r,...i}=t,a=null,o=!1,s=[];E(r)&&typeof ie==`function`&&(r=ie(r._payload)),u.Children.forEach(r,e=>{if(ee(e)){o=!0;let t=e,n=`child`in t.props?t.props.child:t.props.children;E(n)&&typeof ie==`function`&&(n=ie(n._payload)),a=C(t,n),s.push(a?.props?.children)}else s.push(e)}),a?a=u.cloneElement(a,void 0,s):!o&&u.Children.count(r)===1&&u.isValidElement(r)&&(a=r);let c=a?T(a):void 0,l=h(n,c);if(!a){if(r||r===0)throw Error(o?re(e):ne(e));return r}let d=w(i,a.props??{});return a.type!==u.Fragment&&(d.ref=n?l:c),u.cloneElement(a,d)});return t.displayName=`${e}.Slot`,t}y(b,`createSlot`);var x=Symbol.for(`radix.slottable`);function S(e){let t=y(e=>`child`in e?e.children(e.child):e.children,`Slottable`);return t.displayName=`${e}.Slottable`,t.__radixId=x,t}y(S,`createSlottable`);var C=y((e,t)=>{if(`child`in e.props){let t=e.props.child;return u.isValidElement(t)?u.cloneElement(t,void 0,e.props.children(t.props.children)):null}return u.isValidElement(t)?t:null},`getSlottableElementFromSlottable`);function w(e,t){let n={...t};for(let r in t){let i=e[r],a=t[r];/^on[A-Z]/.test(r)?i&&a?n[r]=(...e)=>{let t=a(...e);return i(...e),t}:i&&(n[r]=i):r===`style`?n[r]={...i,...a}:r===`className`&&(n[r]=[i,a].filter(Boolean).join(` `))}return{...e,...n}}y(w,`mergeProps`);function T(e){let t=Object.getOwnPropertyDescriptor(e.props,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}y(T,`getElementRef`);function ee(e){return u.isValidElement(e)&&typeof e.type==`function`&&`__radixId`in e.type&&e.type.__radixId===x}y(ee,`isSlottable`);var te=Symbol.for(`react.lazy`);function E(e){return typeof e==`object`&&!!e&&`$$typeof`in e&&e.$$typeof===te&&`_payload`in e&&D(e._payload)}y(E,`isLazyComponent`);function D(e){return typeof e==`object`&&!!e&&`then`in e}y(D,`isPromiseLike`);var ne=y(e=>`${e} failed to slot onto its children. Expected a single React element child or \`Slottable\`.`,`createSlotError`),re=y(e=>`${e} failed to slot onto its \`Slottable\`. Expected \`Slottable\` to receive a single React element child.`,`createSlottableError`),ie=u.use,ae=Object.defineProperty,oe=(e,t)=>ae(e,`name`,{value:t,configurable:!0}),O=[`a`,`button`,`div`,`form`,`h2`,`h3`,`img`,`input`,`label`,`li`,`nav`,`ol`,`p`,`select`,`span`,`svg`,`ul`].reduce((e,t)=>{let n=b(`Primitive.${t}`),r=u.forwardRef((e,r)=>{let{asChild:i,...a}=e,o=i?n:t;return typeof window<`u`&&(window[Symbol.for(`radix-ui`)]=!0),(0,g.jsx)(o,{...a,ref:r})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{});function se(e,t){e&&_.flushSync(()=>e.dispatchEvent(t))}oe(se,`dispatchDiscreteCustomEvent`);var ce=Object.defineProperty,k=(e,t)=>ce(e,`name`,{value:t,configurable:!0});function le(e,t){let n=u.createContext(t);n.displayName=e+`Context`;let r=k(e=>{let{children:t,...r}=e,i=u.useMemo(()=>r,Object.values(r));return(0,g.jsx)(n.Provider,{value:i,children:t})},`Provider`);r.displayName=e+`Provider`;function i(r,i={}){let{optional:a=!1}=i,o=u.useContext(n);if(o)return o;if(t!==void 0)return t;if(!a)throw Error(`\`${r}\` must be used within \`${e}\``)}return k(i,`useContext`),[r,i]}k(le,`createContext`);function ue(e,t=[]){let n=[];function r(t,r){let i=u.createContext(r);i.displayName=t+`Context`;let a=n.length;n=[...n,r];let o=k(t=>{let{scope:n,children:r,...o}=t,s=n?.[e]?.[a]||i,c=u.useMemo(()=>o,Object.values(o));return(0,g.jsx)(s.Provider,{value:c,children:r})},`Provider`);o.displayName=t+`Provider`;function s(n,o,s={}){let{optional:c=!1}=s,l=o?.[e]?.[a]||i,d=u.useContext(l);if(d)return d;if(r!==void 0)return r;if(!c)throw Error(`\`${n}\` must be used within \`${t}\``)}return k(s,`useContext`),[o,s]}k(r,`createContext`);let i=k(()=>{let t=n.map(e=>u.createContext(e));return k(function(n){let r=n?.[e]||t;return u.useMemo(()=>({[`__scope${e}`]:{...n,[e]:r}}),[n,r])},`useScope`)},`createScope`);return i.scopeName=e,[r,de(i,...t)]}k(ue,`createContextScope`);function de(...e){let t=e[0];if(e.length===1)return t;let n=k(()=>{let n=e.map(e=>({useScope:e(),scopeName:e.scopeName}));return k(function(e){let r=n.reduce((t,{useScope:n,scopeName:r})=>{let i=n(e)[`__scope${r}`];return{...t,...i}},{});return u.useMemo(()=>({[`__scope${t.scopeName}`]:r}),[r])},`useComposedScopes`)},`createScope`);return n.scopeName=t.scopeName,n}k(de,`composeContextScopes`);var fe=Object.defineProperty,A=(e,t)=>fe(e,`name`,{value:t,configurable:!0}),pe=!!(typeof window<`u`&&window.document&&window.document.createElement);function j(e,t,{checkForDefaultPrevented:n=!0}={}){return A(function(r){if(e?.(r),n===!1||!r||!r.defaultPrevented)return t?.(r)},`handleEvent`)}A(j,`composeEventHandlers`);function me(e){if(!pe)throw Error(`Cannot access window outside of the DOM`);return e?.ownerDocument?.defaultView??window}A(me,`getOwnerWindow`);function he(e){if(!pe)throw Error(`Cannot access document outside of the DOM`);return e?.ownerDocument??document}A(he,`getOwnerDocument`);function ge(e,t=!1){let{activeElement:n}=he(e);if(!n?.nodeName)return null;if(_e(n)&&n.contentDocument)return ge(n.contentDocument.body,t);if(t){let e=n.getAttribute(`aria-activedescendant`);if(e){let t=he(n).getElementById(e);if(t)return t}}return n}A(ge,`getActiveElement`);function _e(e){return e.tagName===`IFRAME`}A(_e,`isFrame`);var M=globalThis?.document?u.useLayoutEffect:()=>{},ve=Object.defineProperty,ye=(e,t)=>ve(e,`name`,{value:t,configurable:!0}),be=u.useEffectEvent,xe=u.useInsertionEffect;function Se(e){if(typeof be==`function`)return be(e);let t=u.useRef(()=>{throw Error(`Cannot call an event handler while rendering.`)});return typeof xe==`function`?xe(()=>{t.current=e}):M(()=>{t.current=e}),u.useMemo(()=>((...e)=>t.current?.(...e)),[])}ye(Se,`useEffectEvent`);var Ce=Object.defineProperty,N=(e,t)=>Ce(e,`name`,{value:t,configurable:!0}),we=u.useInsertionEffect||M;function Te({prop:e,defaultProp:t,onChange:n=N(()=>{},`onChange`),caller:r}){let[i,a,o]=Ee({defaultProp:t,onChange:n}),s=e!==void 0;return[s?e:i,u.useCallback(t=>{if(s){let n=De(t)?t(e):t;n!==e&&o.current?.(n)}else a(t)},[s,e,a,o])]}N(Te,`useControllableState`);function Ee({defaultProp:e,onChange:t}){let[n,r]=u.useState(e),i=u.useRef(n),a=u.useRef(t);return we(()=>{a.current=t},[t]),u.useEffect(()=>{i.current!==n&&(a.current?.(n),i.current=n)},[n,i]),[n,r,a]}N(Ee,`useUncontrolledState`);function De(e){return typeof e==`function`}N(De,`isFunction`);var Oe=Symbol(`RADIX:SYNC_STATE`);function ke(e,t,n,r){let{prop:i,defaultProp:a,onChange:o,caller:s}=t,c=i!==void 0,l=Se(o),d=[{...n,state:a}];r&&d.push(r);let[f,p]=u.useReducer((t,n)=>{if(n.type===Oe)return{...t,state:n.state};let r=e(t,n);return c&&!Object.is(r.state,t.state)&&l(r.state),r},...d),m=f.state,h=u.useRef(m);u.useEffect(()=>{h.current!==m&&(h.current=m,c||l(m))},[m,h,c]);let g=u.useMemo(()=>i===void 0?f:{...f,state:i},[f,i]);return u.useEffect(()=>{c&&!Object.is(i,f.state)&&p({type:Oe,state:i})},[i,f.state,c]),[g,p]}N(ke,`useControllableStateReducer`);var Ae=Object.defineProperty,P=(e,t)=>Ae(e,`name`,{value:t,configurable:!0});function je(e,t){return u.useReducer((e,n)=>t[e][n]??e,e)}P(je,`useStateMachine`);var Me=P(e=>{let{present:t,children:n}=e,r=Ne(t),i=typeof n==`function`?n({present:r.isPresent}):u.Children.only(n),a=Fe(r.ref,Ie(i));return typeof n==`function`||r.isPresent?u.cloneElement(i,{ref:a}):null},`Presence`);function Ne(e){let[t,n]=u.useState(),r=u.useRef(null),i=u.useRef(e),a=u.useRef(`none`),o=u.useRef(void 0),[s,c]=je(e?`mounted`:`unmounted`,{mounted:{UNMOUNT:`unmounted`,ANIMATION_OUT:`unmountSuspended`},unmountSuspended:{MOUNT:`mounted`,ANIMATION_END:`unmounted`},unmounted:{MOUNT:`mounted`}});return u.useEffect(()=>{s===`mounted`?(a.current=o.current??F(r.current),o.current=void 0):a.current=`none`},[s]),M(()=>{let t=r.current,n=i.current;if(n!==e){let r=a.current,s=F(t);e?(o.current=s,c(`MOUNT`)):s===`none`||t?.display===`none`?c(`UNMOUNT`):c(n&&r!==s?`ANIMATION_OUT`:`UNMOUNT`),i.current=e}},[e,c]),M(()=>{if(t){let e,n=t.ownerDocument.defaultView??window,o=P(a=>{let o=F(r.current).includes(CSS.escape(a.animationName));if(a.target===t&&o&&(c(`ANIMATION_END`),!i.current)){let r=t.style.animationFillMode;t.style.animationFillMode=`forwards`,e=n.setTimeout(()=>{t.style.animationFillMode===`forwards`&&(t.style.animationFillMode=r)})}},`handleAnimationEnd`),s=P(e=>{e.target===t&&(a.current=F(r.current))},`handleAnimationStart`);return t.addEventListener(`animationstart`,s),t.addEventListener(`animationcancel`,o),t.addEventListener(`animationend`,o),()=>{n.clearTimeout(e),t.removeEventListener(`animationstart`,s),t.removeEventListener(`animationcancel`,o),t.removeEventListener(`animationend`,o)}}c(`ANIMATION_END`)},[t,c]),{isPresent:[`mounted`,`unmountSuspended`].includes(s),ref:u.useCallback(e=>{if(e){let t=getComputedStyle(e);r.current=t,o.current=F(t)}else r.current=null;n(e)},[])}}P(Ne,`usePresence`);function Pe(e,t){if(typeof e==`function`)return e(t);e!=null&&(e.current=t)}P(Pe,`setRef`);function Fe(...e){let t=u.useRef(e);return t.current=e,u.useCallback(e=>{let n=t.current,r=!1,i=n.map(t=>{let n=Pe(t,e);return!r&&typeof n==`function`&&(r=!0),n});if(r)return()=>{for(let e=0;e<i.length;e++){let t=i[e];typeof t==`function`?t():Pe(n[e],null)}}},[])}P(Fe,`useStableComposedRefs`);function F(e){return e?.animationName||`none`}P(F,`getAnimationName`);function Ie(e){let t=Object.getOwnPropertyDescriptor(e.props,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}P(Ie,`getElementRef`);var Le=Object.defineProperty,Re=(e,t)=>Le(e,`name`,{value:t,configurable:!0}),ze=u.useId||(()=>void 0),Be=0;function I(e){let[t,n]=u.useState(ze());return M(()=>{e||n(e=>e??String(Be++))},[e]),e||(t?`radix-${t}`:``)}Re(I,`useId`);var Ve=Object.defineProperty,He=(e,t)=>Ve(e,`name`,{value:t,configurable:!0});function L(e){let t=u.useRef(e);return u.useEffect(()=>{t.current=e}),u.useMemo(()=>((...e)=>t.current?.(...e)),[])}He(L,`useCallbackRef`);var Ue=Object.defineProperty,R=(e,t)=>Ue(e,`name`,{value:t,configurable:!0}),We=`dismissableLayer.update`,Ge=`dismissableLayer.pointerDownOutside`,Ke=`dismissableLayer.focusOutside`,qe,Je=u.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set,dismissableSurfaces:new Set}),Ye=u.forwardRef(R(function(e,t){let{disableOutsidePointerEvents:n=!1,deferPointerDownOutside:r=!1,onEscapeKeyDown:i,onPointerDownOutside:a,onFocusOutside:o,onInteractOutside:s,onDismiss:c,...l}=e,d=u.useContext(Je),[f,p]=u.useState(null),m=f?.ownerDocument??globalThis?.document,[,_]=u.useState({}),v=h(t,p),y=Array.from(d.layers),[b]=[...d.layersWithOutsidePointerEventsDisabled].slice(-1),x=b?y.indexOf(b):-1,S=f?y.indexOf(f):-1,C=d.layersWithOutsidePointerEventsDisabled.size>0,w=S>=x,T=u.useRef(!1),ee=Qe(e=>{a?.(e),s?.(e),e.defaultPrevented||c?.()},{ownerDocument:m,deferPointerDownOutside:r,isDeferredPointerDownOutsideRef:T,dismissableSurfaces:d.dismissableSurfaces,shouldHandlePointerDownOutside:u.useCallback(e=>{if(!(e instanceof Node))return!1;let t=[...d.branches].some(t=>t.contains(e));return w&&!t},[d.branches,w])}),te=$e(e=>{if(r&&T.current)return;let t=e.target;[...d.branches].some(e=>e.contains(t))||(o?.(e),s?.(e),e.defaultPrevented||c?.())},m),E=f?S===y.length-1:!1,D=L(e=>{e.key===`Escape`&&(i?.(e),!e.defaultPrevented&&c&&(e.preventDefault(),c()))});return u.useEffect(()=>{if(E)return m.addEventListener(`keydown`,D,{capture:!0}),()=>m.removeEventListener(`keydown`,D,{capture:!0})},[m,E,D]),u.useEffect(()=>{if(f)return n&&(d.layersWithOutsidePointerEventsDisabled.size===0&&(qe=m.body.style.pointerEvents,m.body.style.pointerEvents=`none`),d.layersWithOutsidePointerEventsDisabled.add(f)),d.layers.add(f),et(),()=>{n&&(d.layersWithOutsidePointerEventsDisabled.delete(f),d.layersWithOutsidePointerEventsDisabled.size===0&&(m.body.style.pointerEvents=qe))}},[f,m,n,d]),u.useEffect(()=>()=>{f&&(d.layers.delete(f),d.layersWithOutsidePointerEventsDisabled.delete(f),et())},[f,d]),u.useEffect(()=>{let e=R(()=>_({}),`handleUpdate`);return document.addEventListener(We,e),()=>document.removeEventListener(We,e)},[]),(0,g.jsx)(O.div,{...l,ref:v,style:{pointerEvents:C?w?`auto`:`none`:void 0,...e.style},onFocusCapture:j(e.onFocusCapture,te.onFocusCapture),onBlurCapture:j(e.onBlurCapture,te.onBlurCapture),onPointerDownCapture:j(e.onPointerDownCapture,ee.onPointerDownCapture)})},`DismissableLayer`));function Xe(){let e=u.useContext(Je),[t,n]=u.useState(null);return u.useEffect(()=>{if(t)return e.dismissableSurfaces.add(t),()=>{e.dismissableSurfaces.delete(t)}},[t,e.dismissableSurfaces]),n}R(Xe,`useDismissableLayerSurface`);var Ze=R(()=>!0,`IS_TRUE`);function Qe(e,t){let{ownerDocument:n=globalThis?.document,deferPointerDownOutside:r=!1,isDeferredPointerDownOutsideRef:i,dismissableSurfaces:a,shouldHandlePointerDownOutside:o=Ze}=t,s=L(e),c=u.useRef(!1),l=u.useRef(!1),d=u.useRef(new Map),f=u.useRef(()=>{});return u.useEffect(()=>{function e(){l.current=!1,i.current=!1,d.current.clear()}R(e,`resetOutsideInteraction`);function t(){return Array.from(d.current.values()).some(Boolean)}R(t,`isOutsideInteractionIntercepted`);function u(e){if(!l.current)return;let t=e.target;t instanceof Node&&[...a].some(e=>e.contains(t))||d.current.set(e.type,!0),e.type===`click`&&window.setTimeout(()=>{l.current&&f.current()},0)}R(u,`handleInteractionCapture`);function p(e){l.current&&d.current.set(e.type,!1)}R(p,`handleInteractionBubble`);let m=R(a=>{if(a.target&&!c.current){let u=function(){n.removeEventListener(`click`,f.current);let r=t();e(),r||tt(Ge,s,p,{discrete:!0})};if(R(u,`handleAndDispatchPointerDownOutsideEvent`),!o(a.target)){n.removeEventListener(`click`,f.current),e(),c.current=!1;return}let p={originalEvent:a};l.current=!0,i.current=r&&a.button===0,d.current.clear(),!r||a.button!==0?u():(n.removeEventListener(`click`,f.current),f.current=u,n.addEventListener(`click`,f.current,{once:!0}))}else n.removeEventListener(`click`,f.current),e();c.current=!1},`handlePointerDown`),h=[`pointerup`,`mousedown`,`mouseup`,`touchstart`,`touchend`,`click`];for(let e of h)n.addEventListener(e,u,!0),n.addEventListener(e,p);let g=window.setTimeout(()=>{n.addEventListener(`pointerdown`,m)},0);return()=>{window.clearTimeout(g),n.removeEventListener(`pointerdown`,m),n.removeEventListener(`click`,f.current);for(let e of h)n.removeEventListener(e,u,!0),n.removeEventListener(e,p)}},[n,s,r,i,a,o]),{onPointerDownCapture:R(()=>c.current=!0,`onPointerDownCapture`)}}R(Qe,`usePointerDownOutside`);function $e(e,t=globalThis?.document){let n=L(e),r=u.useRef(!1);return u.useEffect(()=>{let e=R(e=>{e.target&&!r.current&&tt(Ke,n,{originalEvent:e},{discrete:!1})},`handleFocus`);return t.addEventListener(`focusin`,e),()=>t.removeEventListener(`focusin`,e)},[t,n]),{onFocusCapture:R(()=>r.current=!0,`onFocusCapture`),onBlurCapture:R(()=>r.current=!1,`onBlurCapture`)}}R($e,`useFocusOutside`);function et(){let e=new CustomEvent(We);document.dispatchEvent(e)}R(et,`dispatchUpdate`);function tt(e,t,n,{discrete:r}){let i=n.originalEvent.target,a=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&i.addEventListener(e,t,{once:!0}),r?se(i,a):i.dispatchEvent(a)}R(tt,`handleAndDispatchCustomEvent`);var nt=Object.defineProperty,z=(e,t)=>nt(e,`name`,{value:t,configurable:!0}),rt=`focusScope.autoFocusOnMount`,it=`focusScope.autoFocusOnUnmount`,at={bubbles:!1,cancelable:!0},ot=u.forwardRef(z(function(e,t){let{loop:n=!1,trapped:r=!1,onMountAutoFocus:i,onUnmountAutoFocus:a,...o}=e,[s,c]=u.useState(null),l=L(i),d=L(a),f=u.useRef(null),p=h(t,c),m=u.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;u.useEffect(()=>{if(r){let e=function(e){if(m.paused||!s)return;let t=e.target;s.contains(t)?f.current=t:B(f.current,{select:!0})},t=function(e){if(m.paused||!s)return;let t=e.relatedTarget;t!==null&&(s.contains(t)||B(f.current,{select:!0}))},n=function(e){if(document.activeElement===document.body)for(let t of e)t.removedNodes.length>0&&B(s)};z(e,`handleFocusIn`),z(t,`handleFocusOut`),z(n,`handleMutations`),document.addEventListener(`focusin`,e),document.addEventListener(`focusout`,t);let r=new MutationObserver(n);return s&&r.observe(s,{childList:!0,subtree:!0}),()=>{document.removeEventListener(`focusin`,e),document.removeEventListener(`focusout`,t),r.disconnect()}}},[r,s,m.paused]),u.useEffect(()=>{if(s){pt.add(m);let e=document.activeElement;if(!s.contains(e)){let t=new CustomEvent(rt,at);s.addEventListener(rt,l),s.dispatchEvent(t),t.defaultPrevented||(st(gt(lt(s)),{select:!0}),document.activeElement===e&&B(s))}return()=>{s.removeEventListener(rt,l),setTimeout(()=>{let t=new CustomEvent(it,at);s.addEventListener(it,d),s.dispatchEvent(t),t.defaultPrevented||B(e??document.body,{select:!0}),s.removeEventListener(it,d),pt.remove(m)},0)}}},[s,l,d,m]);let _=u.useCallback(e=>{if(!n&&!r||m.paused)return;let t=e.key===`Tab`&&!e.altKey&&!e.ctrlKey&&!e.metaKey,i=document.activeElement;if(t&&i){let t=e.currentTarget,[r,a]=ct(t);r&&a?!e.shiftKey&&i===a?(e.preventDefault(),n&&B(r,{select:!0})):e.shiftKey&&i===r&&(e.preventDefault(),n&&B(a,{select:!0})):i===t&&e.preventDefault()}},[n,r,m.paused]);return(0,g.jsx)(O.div,{tabIndex:-1,...o,ref:p,onKeyDown:_})},`FocusScope`));function st(e,{select:t=!1}={}){let n=document.activeElement;for(let r of e)if(B(r,{select:t}),document.activeElement!==n)return}z(st,`focusFirst`);function ct(e){let t=lt(e);return[ut(t,e),ut(t.reverse(),e)]}z(ct,`getTabbableEdges`);function lt(e){let t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:z(e=>{let t=e.tagName===`INPUT`&&e.type===`hidden`;return e.disabled||e.hidden||t?NodeFilter.FILTER_SKIP:e.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP},`acceptNode`)});for(;n.nextNode();)t.push(n.currentNode);return t}z(lt,`getTabbableCandidates`);function ut(e,t){let n=typeof t.checkVisibility==`function`&&t.checkVisibility({checkVisibilityCSS:!0});for(let r of e)if(!(n?!r.checkVisibility({checkVisibilityCSS:!0}):dt(r,{upTo:t})))return r}z(ut,`findVisible`);function dt(e,{upTo:t}){if(getComputedStyle(e).visibility===`hidden`)return!0;for(;e;){if(t!==void 0&&e===t)return!1;if(getComputedStyle(e).display===`none`)return!0;e=e.parentElement}return!1}z(dt,`isHidden`);function ft(e){return e instanceof HTMLInputElement&&`select`in e}z(ft,`isSelectableInput`);function B(e,{select:t=!1}={}){if(e&&e.focus){let n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&ft(e)&&t&&e.select()}}z(B,`focus`);var pt=mt();function mt(){let e=[];return{add(t){let n=e[0];t!==n&&n?.pause(),e=ht(e,t),e.unshift(t)},remove(t){e=ht(e,t),e[0]?.resume()}}}z(mt,`createFocusScopesStack`);function ht(e,t){let n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}z(ht,`arrayRemove`);function gt(e){return e.filter(e=>e.tagName!==`A`)}z(gt,`removeLinks`);var _t=Object.defineProperty,vt=u.forwardRef(((e,t)=>_t(e,`name`,{value:t,configurable:!0}))(function(e,t){let{container:n,...r}=e,[i,a]=u.useState(!1);M(()=>a(!0),[]);let o=n||i&&globalThis?.document?.body;return o?_.createPortal((0,g.jsx)(O.div,{...r,ref:t}),o):null},`Portal`)),yt=Object.defineProperty,bt=(e,t)=>yt(e,`name`,{value:t,configurable:!0}),V=0,H=null;function xt(e){return St(),e.children}bt(xt,`FocusGuards`);function St(){u.useEffect(()=>{H||={start:Ct(),end:Ct()};let{start:e,end:t}=H;return document.body.firstElementChild!==e&&document.body.insertAdjacentElement(`afterbegin`,e),document.body.lastElementChild!==t&&document.body.insertAdjacentElement(`beforeend`,t),V++,()=>{V===1&&(H?.start.remove(),H?.end.remove(),H=null),V=Math.max(0,V-1)}},[])}bt(St,`useFocusGuards`);function Ct(){let e=document.createElement(`span`);return e.setAttribute(`data-radix-focus-guard`,``),e.tabIndex=0,e.style.outline=`none`,e.style.opacity=`0`,e.style.position=`fixed`,e.style.pointerEvents=`none`,e}bt(Ct,`createFocusGuard`);var U=function(){return U=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n],t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},U.apply(this,arguments)};function wt(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols==`function`)for(var i=0,r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]]);return n}function Tt(e,t,n){if(n||arguments.length===2)for(var r=0,i=t.length,a;r<i;r++)(a||!(r in t))&&(a||=Array.prototype.slice.call(t,0,r),a[r]=t[r]);return e.concat(a||Array.prototype.slice.call(t))}var W=`right-scroll-bar-position`,G=`width-before-scroll-bar`,Et=`with-scroll-bars-hidden`,Dt=`--removed-body-scroll-bar-size`;function Ot(e,t){return typeof e==`function`?e(t):e&&(e.current=t),e}function kt(e,t){var n=(0,u.useState)(function(){return{value:e,callback:t,facade:{get current(){return n.value},set current(e){var t=n.value;t!==e&&(n.value=e,n.callback(e,t))}}}})[0];return n.callback=t,n.facade}var At=typeof window<`u`?u.useLayoutEffect:u.useEffect,jt=new WeakMap;function Mt(e,t){var n=kt(t||null,function(t){return e.forEach(function(e){return Ot(e,t)})});return At(function(){var t=jt.get(n);if(t){var r=new Set(t),i=new Set(e),a=n.current;r.forEach(function(e){i.has(e)||Ot(e,null)}),i.forEach(function(e){r.has(e)||Ot(e,a)})}jt.set(n,e)},[e]),n}function Nt(e){return e}function Pt(e,t){t===void 0&&(t=Nt);var n=[],r=!1;return{read:function(){if(r)throw Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return n.length?n[n.length-1]:e},useMedium:function(e){var i=t(e,r);return n.push(i),function(){n=n.filter(function(e){return e!==i})}},assignSyncMedium:function(e){for(r=!0;n.length;){var t=n;n=[],t.forEach(e)}n={push:function(t){return e(t)},filter:function(){return n}}},assignMedium:function(e){r=!0;var t=[];if(n.length){var i=n;n=[],i.forEach(e),t=n}var a=function(){var n=t;t=[],n.forEach(e)},o=function(){return Promise.resolve().then(a)};o(),n={push:function(e){t.push(e),o()},filter:function(e){return t=t.filter(e),n}}}}}function Ft(e){e===void 0&&(e={});var t=Pt(null);return t.options=U({async:!0,ssr:!1},e),t}var It=function(e){var t=e.sideCar,n=wt(e,[`sideCar`]);if(!t)throw Error("Sidecar: please provide `sideCar` property to import the right car");var r=t.read();if(!r)throw Error(`Sidecar medium not found`);return u.createElement(r,U({},n))};It.isSideCarExport=!0;function Lt(e,t){return e.useMedium(t),It}var Rt=Ft(),zt=function(){},K=u.forwardRef(function(e,t){var n=u.useRef(null),r=u.useState({onScrollCapture:zt,onWheelCapture:zt,onTouchMoveCapture:zt}),i=r[0],a=r[1],o=e.forwardProps,s=e.children,c=e.className,l=e.removeScrollBar,d=e.enabled,f=e.shards,p=e.sideCar,m=e.noRelative,h=e.noIsolation,g=e.inert,_=e.allowPinchZoom,v=e.as,y=v===void 0?`div`:v,b=e.gapMode,x=wt(e,[`forwardProps`,`children`,`className`,`removeScrollBar`,`enabled`,`shards`,`sideCar`,`noRelative`,`noIsolation`,`inert`,`allowPinchZoom`,`as`,`gapMode`]),S=p,C=Mt([n,t]),w=U(U({},x),i);return u.createElement(u.Fragment,null,d&&u.createElement(S,{sideCar:Rt,removeScrollBar:l,shards:f,noRelative:m,noIsolation:h,inert:g,setCallbacks:a,allowPinchZoom:!!_,lockRef:n,gapMode:b}),o?u.cloneElement(u.Children.only(s),U(U({},w),{ref:C})):u.createElement(y,U({},w,{className:c,ref:C}),s))});K.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1},K.classNames={fullWidth:G,zeroRight:W};var Bt,Vt=function(){if(Bt)return Bt;if(typeof __webpack_nonce__<`u`)return __webpack_nonce__};function Ht(){if(!document)return null;var e=document.createElement(`style`);e.type=`text/css`;var t=Vt();return t&&e.setAttribute(`nonce`,t),e}function Ut(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function Wt(e){(document.head||document.getElementsByTagName(`head`)[0]).appendChild(e)}var Gt=function(){var e=0,t=null;return{add:function(n){e==0&&(t=Ht())&&(Ut(t,n),Wt(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},Kt=function(){var e=Gt();return function(t,n){u.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},qt=function(){var e=Kt();return function(t){var n=t.styles,r=t.dynamic;return e(n,r),null}},Jt={left:0,top:0,right:0,gap:0},Yt=function(e){return parseInt(e||``,10)||0},Xt=function(e){var t=window.getComputedStyle(document.body),n=t[e===`padding`?`paddingLeft`:`marginLeft`],r=t[e===`padding`?`paddingTop`:`marginTop`],i=t[e===`padding`?`paddingRight`:`marginRight`];return[Yt(n),Yt(r),Yt(i)]},Zt=function(e){if(e===void 0&&(e=`margin`),typeof window>`u`)return Jt;var t=Xt(e),n=document.documentElement.clientWidth,r=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,r-n+t[2]-t[0])}},Qt=qt(),q=`data-scroll-locked`,$t=function(e,t,n,r){var i=e.left,a=e.top,o=e.right,s=e.gap;return n===void 0&&(n=`margin`),`
1
+ import{B as e,D as t,Dt as n,I as r,Kt as i,Ot as a,U as o,j as s}from"./queries-vY5lJqBe.js";import{m as c}from"./Rack-uDxrjvaz.js";var l=c(`x`,[[`path`,{d:`M18 6 6 18`,key:`1bl5f8`}],[`path`,{d:`m6 6 12 12`,key:`d8bk6v`}]]),u=i(a(),1),d=Object.defineProperty,f=(e,t)=>d(e,`name`,{value:t,configurable:!0});function p(e,t){if(typeof e==`function`)return e(t);e!=null&&(e.current=t)}f(p,`setRef`);function m(...e){return t=>{let n=!1,r=e.map(e=>{let r=p(e,t);return!n&&typeof r==`function`&&(n=!0),r});if(n)return()=>{for(let t=0;t<r.length;t++){let n=r[t];typeof n==`function`?n():p(e[t],null)}}}}f(m,`composeRefs`);function h(...e){return u.useCallback(m(...e),e)}f(h,`useComposedRefs`);var g=n(),_=i(o(),1),v=Object.defineProperty,y=(e,t)=>v(e,`name`,{value:t,configurable:!0});function b(e){let t=u.forwardRef((t,n)=>{let{children:r,...i}=t,a=null,o=!1,s=[];E(r)&&typeof ie==`function`&&(r=ie(r._payload)),u.Children.forEach(r,e=>{if(ee(e)){o=!0;let t=e,n=`child`in t.props?t.props.child:t.props.children;E(n)&&typeof ie==`function`&&(n=ie(n._payload)),a=C(t,n),s.push(a?.props?.children)}else s.push(e)}),a?a=u.cloneElement(a,void 0,s):!o&&u.Children.count(r)===1&&u.isValidElement(r)&&(a=r);let c=a?T(a):void 0,l=h(n,c);if(!a){if(r||r===0)throw Error(o?re(e):ne(e));return r}let d=w(i,a.props??{});return a.type!==u.Fragment&&(d.ref=n?l:c),u.cloneElement(a,d)});return t.displayName=`${e}.Slot`,t}y(b,`createSlot`);var x=Symbol.for(`radix.slottable`);function S(e){let t=y(e=>`child`in e?e.children(e.child):e.children,`Slottable`);return t.displayName=`${e}.Slottable`,t.__radixId=x,t}y(S,`createSlottable`);var C=y((e,t)=>{if(`child`in e.props){let t=e.props.child;return u.isValidElement(t)?u.cloneElement(t,void 0,e.props.children(t.props.children)):null}return u.isValidElement(t)?t:null},`getSlottableElementFromSlottable`);function w(e,t){let n={...t};for(let r in t){let i=e[r],a=t[r];/^on[A-Z]/.test(r)?i&&a?n[r]=(...e)=>{let t=a(...e);return i(...e),t}:i&&(n[r]=i):r===`style`?n[r]={...i,...a}:r===`className`&&(n[r]=[i,a].filter(Boolean).join(` `))}return{...e,...n}}y(w,`mergeProps`);function T(e){let t=Object.getOwnPropertyDescriptor(e.props,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}y(T,`getElementRef`);function ee(e){return u.isValidElement(e)&&typeof e.type==`function`&&`__radixId`in e.type&&e.type.__radixId===x}y(ee,`isSlottable`);var te=Symbol.for(`react.lazy`);function E(e){return typeof e==`object`&&!!e&&`$$typeof`in e&&e.$$typeof===te&&`_payload`in e&&D(e._payload)}y(E,`isLazyComponent`);function D(e){return typeof e==`object`&&!!e&&`then`in e}y(D,`isPromiseLike`);var ne=y(e=>`${e} failed to slot onto its children. Expected a single React element child or \`Slottable\`.`,`createSlotError`),re=y(e=>`${e} failed to slot onto its \`Slottable\`. Expected \`Slottable\` to receive a single React element child.`,`createSlottableError`),ie=u.use,ae=Object.defineProperty,oe=(e,t)=>ae(e,`name`,{value:t,configurable:!0}),O=[`a`,`button`,`div`,`form`,`h2`,`h3`,`img`,`input`,`label`,`li`,`nav`,`ol`,`p`,`select`,`span`,`svg`,`ul`].reduce((e,t)=>{let n=b(`Primitive.${t}`),r=u.forwardRef((e,r)=>{let{asChild:i,...a}=e,o=i?n:t;return typeof window<`u`&&(window[Symbol.for(`radix-ui`)]=!0),(0,g.jsx)(o,{...a,ref:r})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{});function se(e,t){e&&_.flushSync(()=>e.dispatchEvent(t))}oe(se,`dispatchDiscreteCustomEvent`);var ce=Object.defineProperty,k=(e,t)=>ce(e,`name`,{value:t,configurable:!0});function le(e,t){let n=u.createContext(t);n.displayName=e+`Context`;let r=k(e=>{let{children:t,...r}=e,i=u.useMemo(()=>r,Object.values(r));return(0,g.jsx)(n.Provider,{value:i,children:t})},`Provider`);r.displayName=e+`Provider`;function i(r,i={}){let{optional:a=!1}=i,o=u.useContext(n);if(o)return o;if(t!==void 0)return t;if(!a)throw Error(`\`${r}\` must be used within \`${e}\``)}return k(i,`useContext`),[r,i]}k(le,`createContext`);function ue(e,t=[]){let n=[];function r(t,r){let i=u.createContext(r);i.displayName=t+`Context`;let a=n.length;n=[...n,r];let o=k(t=>{let{scope:n,children:r,...o}=t,s=n?.[e]?.[a]||i,c=u.useMemo(()=>o,Object.values(o));return(0,g.jsx)(s.Provider,{value:c,children:r})},`Provider`);o.displayName=t+`Provider`;function s(n,o,s={}){let{optional:c=!1}=s,l=o?.[e]?.[a]||i,d=u.useContext(l);if(d)return d;if(r!==void 0)return r;if(!c)throw Error(`\`${n}\` must be used within \`${t}\``)}return k(s,`useContext`),[o,s]}k(r,`createContext`);let i=k(()=>{let t=n.map(e=>u.createContext(e));return k(function(n){let r=n?.[e]||t;return u.useMemo(()=>({[`__scope${e}`]:{...n,[e]:r}}),[n,r])},`useScope`)},`createScope`);return i.scopeName=e,[r,de(i,...t)]}k(ue,`createContextScope`);function de(...e){let t=e[0];if(e.length===1)return t;let n=k(()=>{let n=e.map(e=>({useScope:e(),scopeName:e.scopeName}));return k(function(e){let r=n.reduce((t,{useScope:n,scopeName:r})=>{let i=n(e)[`__scope${r}`];return{...t,...i}},{});return u.useMemo(()=>({[`__scope${t.scopeName}`]:r}),[r])},`useComposedScopes`)},`createScope`);return n.scopeName=t.scopeName,n}k(de,`composeContextScopes`);var fe=Object.defineProperty,A=(e,t)=>fe(e,`name`,{value:t,configurable:!0}),pe=!!(typeof window<`u`&&window.document&&window.document.createElement);function j(e,t,{checkForDefaultPrevented:n=!0}={}){return A(function(r){if(e?.(r),n===!1||!r||!r.defaultPrevented)return t?.(r)},`handleEvent`)}A(j,`composeEventHandlers`);function me(e){if(!pe)throw Error(`Cannot access window outside of the DOM`);return e?.ownerDocument?.defaultView??window}A(me,`getOwnerWindow`);function he(e){if(!pe)throw Error(`Cannot access document outside of the DOM`);return e?.ownerDocument??document}A(he,`getOwnerDocument`);function ge(e,t=!1){let{activeElement:n}=he(e);if(!n?.nodeName)return null;if(_e(n)&&n.contentDocument)return ge(n.contentDocument.body,t);if(t){let e=n.getAttribute(`aria-activedescendant`);if(e){let t=he(n).getElementById(e);if(t)return t}}return n}A(ge,`getActiveElement`);function _e(e){return e.tagName===`IFRAME`}A(_e,`isFrame`);var M=globalThis?.document?u.useLayoutEffect:()=>{},ve=Object.defineProperty,ye=(e,t)=>ve(e,`name`,{value:t,configurable:!0}),be=u.useEffectEvent,xe=u.useInsertionEffect;function Se(e){if(typeof be==`function`)return be(e);let t=u.useRef(()=>{throw Error(`Cannot call an event handler while rendering.`)});return typeof xe==`function`?xe(()=>{t.current=e}):M(()=>{t.current=e}),u.useMemo(()=>((...e)=>t.current?.(...e)),[])}ye(Se,`useEffectEvent`);var Ce=Object.defineProperty,N=(e,t)=>Ce(e,`name`,{value:t,configurable:!0}),we=u.useInsertionEffect||M;function Te({prop:e,defaultProp:t,onChange:n=N(()=>{},`onChange`),caller:r}){let[i,a,o]=Ee({defaultProp:t,onChange:n}),s=e!==void 0;return[s?e:i,u.useCallback(t=>{if(s){let n=De(t)?t(e):t;n!==e&&o.current?.(n)}else a(t)},[s,e,a,o])]}N(Te,`useControllableState`);function Ee({defaultProp:e,onChange:t}){let[n,r]=u.useState(e),i=u.useRef(n),a=u.useRef(t);return we(()=>{a.current=t},[t]),u.useEffect(()=>{i.current!==n&&(a.current?.(n),i.current=n)},[n,i]),[n,r,a]}N(Ee,`useUncontrolledState`);function De(e){return typeof e==`function`}N(De,`isFunction`);var Oe=Symbol(`RADIX:SYNC_STATE`);function ke(e,t,n,r){let{prop:i,defaultProp:a,onChange:o,caller:s}=t,c=i!==void 0,l=Se(o),d=[{...n,state:a}];r&&d.push(r);let[f,p]=u.useReducer((t,n)=>{if(n.type===Oe)return{...t,state:n.state};let r=e(t,n);return c&&!Object.is(r.state,t.state)&&l(r.state),r},...d),m=f.state,h=u.useRef(m);u.useEffect(()=>{h.current!==m&&(h.current=m,c||l(m))},[m,h,c]);let g=u.useMemo(()=>i===void 0?f:{...f,state:i},[f,i]);return u.useEffect(()=>{c&&!Object.is(i,f.state)&&p({type:Oe,state:i})},[i,f.state,c]),[g,p]}N(ke,`useControllableStateReducer`);var Ae=Object.defineProperty,P=(e,t)=>Ae(e,`name`,{value:t,configurable:!0});function je(e,t){return u.useReducer((e,n)=>t[e][n]??e,e)}P(je,`useStateMachine`);var Me=P(e=>{let{present:t,children:n}=e,r=Ne(t),i=typeof n==`function`?n({present:r.isPresent}):u.Children.only(n),a=Fe(r.ref,Ie(i));return typeof n==`function`||r.isPresent?u.cloneElement(i,{ref:a}):null},`Presence`);function Ne(e){let[t,n]=u.useState(),r=u.useRef(null),i=u.useRef(e),a=u.useRef(`none`),o=u.useRef(void 0),[s,c]=je(e?`mounted`:`unmounted`,{mounted:{UNMOUNT:`unmounted`,ANIMATION_OUT:`unmountSuspended`},unmountSuspended:{MOUNT:`mounted`,ANIMATION_END:`unmounted`},unmounted:{MOUNT:`mounted`}});return u.useEffect(()=>{s===`mounted`?(a.current=o.current??F(r.current),o.current=void 0):a.current=`none`},[s]),M(()=>{let t=r.current,n=i.current;if(n!==e){let r=a.current,s=F(t);e?(o.current=s,c(`MOUNT`)):s===`none`||t?.display===`none`?c(`UNMOUNT`):c(n&&r!==s?`ANIMATION_OUT`:`UNMOUNT`),i.current=e}},[e,c]),M(()=>{if(t){let e,n=t.ownerDocument.defaultView??window,o=P(a=>{let o=F(r.current).includes(CSS.escape(a.animationName));if(a.target===t&&o&&(c(`ANIMATION_END`),!i.current)){let r=t.style.animationFillMode;t.style.animationFillMode=`forwards`,e=n.setTimeout(()=>{t.style.animationFillMode===`forwards`&&(t.style.animationFillMode=r)})}},`handleAnimationEnd`),s=P(e=>{e.target===t&&(a.current=F(r.current))},`handleAnimationStart`);return t.addEventListener(`animationstart`,s),t.addEventListener(`animationcancel`,o),t.addEventListener(`animationend`,o),()=>{n.clearTimeout(e),t.removeEventListener(`animationstart`,s),t.removeEventListener(`animationcancel`,o),t.removeEventListener(`animationend`,o)}}c(`ANIMATION_END`)},[t,c]),{isPresent:[`mounted`,`unmountSuspended`].includes(s),ref:u.useCallback(e=>{if(e){let t=getComputedStyle(e);r.current=t,o.current=F(t)}else r.current=null;n(e)},[])}}P(Ne,`usePresence`);function Pe(e,t){if(typeof e==`function`)return e(t);e!=null&&(e.current=t)}P(Pe,`setRef`);function Fe(...e){let t=u.useRef(e);return t.current=e,u.useCallback(e=>{let n=t.current,r=!1,i=n.map(t=>{let n=Pe(t,e);return!r&&typeof n==`function`&&(r=!0),n});if(r)return()=>{for(let e=0;e<i.length;e++){let t=i[e];typeof t==`function`?t():Pe(n[e],null)}}},[])}P(Fe,`useStableComposedRefs`);function F(e){return e?.animationName||`none`}P(F,`getAnimationName`);function Ie(e){let t=Object.getOwnPropertyDescriptor(e.props,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}P(Ie,`getElementRef`);var Le=Object.defineProperty,Re=(e,t)=>Le(e,`name`,{value:t,configurable:!0}),ze=u.useId||(()=>void 0),Be=0;function I(e){let[t,n]=u.useState(ze());return M(()=>{e||n(e=>e??String(Be++))},[e]),e||(t?`radix-${t}`:``)}Re(I,`useId`);var Ve=Object.defineProperty,He=(e,t)=>Ve(e,`name`,{value:t,configurable:!0});function L(e){let t=u.useRef(e);return u.useEffect(()=>{t.current=e}),u.useMemo(()=>((...e)=>t.current?.(...e)),[])}He(L,`useCallbackRef`);var Ue=Object.defineProperty,R=(e,t)=>Ue(e,`name`,{value:t,configurable:!0}),We=`dismissableLayer.update`,Ge=`dismissableLayer.pointerDownOutside`,Ke=`dismissableLayer.focusOutside`,qe,Je=u.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set,dismissableSurfaces:new Set}),Ye=u.forwardRef(R(function(e,t){let{disableOutsidePointerEvents:n=!1,deferPointerDownOutside:r=!1,onEscapeKeyDown:i,onPointerDownOutside:a,onFocusOutside:o,onInteractOutside:s,onDismiss:c,...l}=e,d=u.useContext(Je),[f,p]=u.useState(null),m=f?.ownerDocument??globalThis?.document,[,_]=u.useState({}),v=h(t,p),y=Array.from(d.layers),[b]=[...d.layersWithOutsidePointerEventsDisabled].slice(-1),x=b?y.indexOf(b):-1,S=f?y.indexOf(f):-1,C=d.layersWithOutsidePointerEventsDisabled.size>0,w=S>=x,T=u.useRef(!1),ee=Qe(e=>{a?.(e),s?.(e),e.defaultPrevented||c?.()},{ownerDocument:m,deferPointerDownOutside:r,isDeferredPointerDownOutsideRef:T,dismissableSurfaces:d.dismissableSurfaces,shouldHandlePointerDownOutside:u.useCallback(e=>{if(!(e instanceof Node))return!1;let t=[...d.branches].some(t=>t.contains(e));return w&&!t},[d.branches,w])}),te=$e(e=>{if(r&&T.current)return;let t=e.target;[...d.branches].some(e=>e.contains(t))||(o?.(e),s?.(e),e.defaultPrevented||c?.())},m),E=f?S===y.length-1:!1,D=L(e=>{e.key===`Escape`&&(i?.(e),!e.defaultPrevented&&c&&(e.preventDefault(),c()))});return u.useEffect(()=>{if(E)return m.addEventListener(`keydown`,D,{capture:!0}),()=>m.removeEventListener(`keydown`,D,{capture:!0})},[m,E,D]),u.useEffect(()=>{if(f)return n&&(d.layersWithOutsidePointerEventsDisabled.size===0&&(qe=m.body.style.pointerEvents,m.body.style.pointerEvents=`none`),d.layersWithOutsidePointerEventsDisabled.add(f)),d.layers.add(f),et(),()=>{n&&(d.layersWithOutsidePointerEventsDisabled.delete(f),d.layersWithOutsidePointerEventsDisabled.size===0&&(m.body.style.pointerEvents=qe))}},[f,m,n,d]),u.useEffect(()=>()=>{f&&(d.layers.delete(f),d.layersWithOutsidePointerEventsDisabled.delete(f),et())},[f,d]),u.useEffect(()=>{let e=R(()=>_({}),`handleUpdate`);return document.addEventListener(We,e),()=>document.removeEventListener(We,e)},[]),(0,g.jsx)(O.div,{...l,ref:v,style:{pointerEvents:C?w?`auto`:`none`:void 0,...e.style},onFocusCapture:j(e.onFocusCapture,te.onFocusCapture),onBlurCapture:j(e.onBlurCapture,te.onBlurCapture),onPointerDownCapture:j(e.onPointerDownCapture,ee.onPointerDownCapture)})},`DismissableLayer`));function Xe(){let e=u.useContext(Je),[t,n]=u.useState(null);return u.useEffect(()=>{if(t)return e.dismissableSurfaces.add(t),()=>{e.dismissableSurfaces.delete(t)}},[t,e.dismissableSurfaces]),n}R(Xe,`useDismissableLayerSurface`);var Ze=R(()=>!0,`IS_TRUE`);function Qe(e,t){let{ownerDocument:n=globalThis?.document,deferPointerDownOutside:r=!1,isDeferredPointerDownOutsideRef:i,dismissableSurfaces:a,shouldHandlePointerDownOutside:o=Ze}=t,s=L(e),c=u.useRef(!1),l=u.useRef(!1),d=u.useRef(new Map),f=u.useRef(()=>{});return u.useEffect(()=>{function e(){l.current=!1,i.current=!1,d.current.clear()}R(e,`resetOutsideInteraction`);function t(){return Array.from(d.current.values()).some(Boolean)}R(t,`isOutsideInteractionIntercepted`);function u(e){if(!l.current)return;let t=e.target;t instanceof Node&&[...a].some(e=>e.contains(t))||d.current.set(e.type,!0),e.type===`click`&&window.setTimeout(()=>{l.current&&f.current()},0)}R(u,`handleInteractionCapture`);function p(e){l.current&&d.current.set(e.type,!1)}R(p,`handleInteractionBubble`);let m=R(a=>{if(a.target&&!c.current){let u=function(){n.removeEventListener(`click`,f.current);let r=t();e(),r||tt(Ge,s,p,{discrete:!0})};if(R(u,`handleAndDispatchPointerDownOutsideEvent`),!o(a.target)){n.removeEventListener(`click`,f.current),e(),c.current=!1;return}let p={originalEvent:a};l.current=!0,i.current=r&&a.button===0,d.current.clear(),!r||a.button!==0?u():(n.removeEventListener(`click`,f.current),f.current=u,n.addEventListener(`click`,f.current,{once:!0}))}else n.removeEventListener(`click`,f.current),e();c.current=!1},`handlePointerDown`),h=[`pointerup`,`mousedown`,`mouseup`,`touchstart`,`touchend`,`click`];for(let e of h)n.addEventListener(e,u,!0),n.addEventListener(e,p);let g=window.setTimeout(()=>{n.addEventListener(`pointerdown`,m)},0);return()=>{window.clearTimeout(g),n.removeEventListener(`pointerdown`,m),n.removeEventListener(`click`,f.current);for(let e of h)n.removeEventListener(e,u,!0),n.removeEventListener(e,p)}},[n,s,r,i,a,o]),{onPointerDownCapture:R(()=>c.current=!0,`onPointerDownCapture`)}}R(Qe,`usePointerDownOutside`);function $e(e,t=globalThis?.document){let n=L(e),r=u.useRef(!1);return u.useEffect(()=>{let e=R(e=>{e.target&&!r.current&&tt(Ke,n,{originalEvent:e},{discrete:!1})},`handleFocus`);return t.addEventListener(`focusin`,e),()=>t.removeEventListener(`focusin`,e)},[t,n]),{onFocusCapture:R(()=>r.current=!0,`onFocusCapture`),onBlurCapture:R(()=>r.current=!1,`onBlurCapture`)}}R($e,`useFocusOutside`);function et(){let e=new CustomEvent(We);document.dispatchEvent(e)}R(et,`dispatchUpdate`);function tt(e,t,n,{discrete:r}){let i=n.originalEvent.target,a=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&i.addEventListener(e,t,{once:!0}),r?se(i,a):i.dispatchEvent(a)}R(tt,`handleAndDispatchCustomEvent`);var nt=Object.defineProperty,z=(e,t)=>nt(e,`name`,{value:t,configurable:!0}),rt=`focusScope.autoFocusOnMount`,it=`focusScope.autoFocusOnUnmount`,at={bubbles:!1,cancelable:!0},ot=u.forwardRef(z(function(e,t){let{loop:n=!1,trapped:r=!1,onMountAutoFocus:i,onUnmountAutoFocus:a,...o}=e,[s,c]=u.useState(null),l=L(i),d=L(a),f=u.useRef(null),p=h(t,c),m=u.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;u.useEffect(()=>{if(r){let e=function(e){if(m.paused||!s)return;let t=e.target;s.contains(t)?f.current=t:B(f.current,{select:!0})},t=function(e){if(m.paused||!s)return;let t=e.relatedTarget;t!==null&&(s.contains(t)||B(f.current,{select:!0}))},n=function(e){if(document.activeElement===document.body)for(let t of e)t.removedNodes.length>0&&B(s)};z(e,`handleFocusIn`),z(t,`handleFocusOut`),z(n,`handleMutations`),document.addEventListener(`focusin`,e),document.addEventListener(`focusout`,t);let r=new MutationObserver(n);return s&&r.observe(s,{childList:!0,subtree:!0}),()=>{document.removeEventListener(`focusin`,e),document.removeEventListener(`focusout`,t),r.disconnect()}}},[r,s,m.paused]),u.useEffect(()=>{if(s){pt.add(m);let e=document.activeElement;if(!s.contains(e)){let t=new CustomEvent(rt,at);s.addEventListener(rt,l),s.dispatchEvent(t),t.defaultPrevented||(st(gt(lt(s)),{select:!0}),document.activeElement===e&&B(s))}return()=>{s.removeEventListener(rt,l),setTimeout(()=>{let t=new CustomEvent(it,at);s.addEventListener(it,d),s.dispatchEvent(t),t.defaultPrevented||B(e??document.body,{select:!0}),s.removeEventListener(it,d),pt.remove(m)},0)}}},[s,l,d,m]);let _=u.useCallback(e=>{if(!n&&!r||m.paused)return;let t=e.key===`Tab`&&!e.altKey&&!e.ctrlKey&&!e.metaKey,i=document.activeElement;if(t&&i){let t=e.currentTarget,[r,a]=ct(t);r&&a?!e.shiftKey&&i===a?(e.preventDefault(),n&&B(r,{select:!0})):e.shiftKey&&i===r&&(e.preventDefault(),n&&B(a,{select:!0})):i===t&&e.preventDefault()}},[n,r,m.paused]);return(0,g.jsx)(O.div,{tabIndex:-1,...o,ref:p,onKeyDown:_})},`FocusScope`));function st(e,{select:t=!1}={}){let n=document.activeElement;for(let r of e)if(B(r,{select:t}),document.activeElement!==n)return}z(st,`focusFirst`);function ct(e){let t=lt(e);return[ut(t,e),ut(t.reverse(),e)]}z(ct,`getTabbableEdges`);function lt(e){let t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:z(e=>{let t=e.tagName===`INPUT`&&e.type===`hidden`;return e.disabled||e.hidden||t?NodeFilter.FILTER_SKIP:e.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP},`acceptNode`)});for(;n.nextNode();)t.push(n.currentNode);return t}z(lt,`getTabbableCandidates`);function ut(e,t){let n=typeof t.checkVisibility==`function`&&t.checkVisibility({checkVisibilityCSS:!0});for(let r of e)if(!(n?!r.checkVisibility({checkVisibilityCSS:!0}):dt(r,{upTo:t})))return r}z(ut,`findVisible`);function dt(e,{upTo:t}){if(getComputedStyle(e).visibility===`hidden`)return!0;for(;e;){if(t!==void 0&&e===t)return!1;if(getComputedStyle(e).display===`none`)return!0;e=e.parentElement}return!1}z(dt,`isHidden`);function ft(e){return e instanceof HTMLInputElement&&`select`in e}z(ft,`isSelectableInput`);function B(e,{select:t=!1}={}){if(e&&e.focus){let n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&ft(e)&&t&&e.select()}}z(B,`focus`);var pt=mt();function mt(){let e=[];return{add(t){let n=e[0];t!==n&&n?.pause(),e=ht(e,t),e.unshift(t)},remove(t){e=ht(e,t),e[0]?.resume()}}}z(mt,`createFocusScopesStack`);function ht(e,t){let n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}z(ht,`arrayRemove`);function gt(e){return e.filter(e=>e.tagName!==`A`)}z(gt,`removeLinks`);var _t=Object.defineProperty,vt=u.forwardRef(((e,t)=>_t(e,`name`,{value:t,configurable:!0}))(function(e,t){let{container:n,...r}=e,[i,a]=u.useState(!1);M(()=>a(!0),[]);let o=n||i&&globalThis?.document?.body;return o?_.createPortal((0,g.jsx)(O.div,{...r,ref:t}),o):null},`Portal`)),yt=Object.defineProperty,bt=(e,t)=>yt(e,`name`,{value:t,configurable:!0}),V=0,H=null;function xt(e){return St(),e.children}bt(xt,`FocusGuards`);function St(){u.useEffect(()=>{H||={start:Ct(),end:Ct()};let{start:e,end:t}=H;return document.body.firstElementChild!==e&&document.body.insertAdjacentElement(`afterbegin`,e),document.body.lastElementChild!==t&&document.body.insertAdjacentElement(`beforeend`,t),V++,()=>{V===1&&(H?.start.remove(),H?.end.remove(),H=null),V=Math.max(0,V-1)}},[])}bt(St,`useFocusGuards`);function Ct(){let e=document.createElement(`span`);return e.setAttribute(`data-radix-focus-guard`,``),e.tabIndex=0,e.style.outline=`none`,e.style.opacity=`0`,e.style.position=`fixed`,e.style.pointerEvents=`none`,e}bt(Ct,`createFocusGuard`);var U=function(){return U=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n],t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},U.apply(this,arguments)};function wt(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols==`function`)for(var i=0,r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]]);return n}function Tt(e,t,n){if(n||arguments.length===2)for(var r=0,i=t.length,a;r<i;r++)(a||!(r in t))&&(a||=Array.prototype.slice.call(t,0,r),a[r]=t[r]);return e.concat(a||Array.prototype.slice.call(t))}var W=`right-scroll-bar-position`,G=`width-before-scroll-bar`,Et=`with-scroll-bars-hidden`,Dt=`--removed-body-scroll-bar-size`;function Ot(e,t){return typeof e==`function`?e(t):e&&(e.current=t),e}function kt(e,t){var n=(0,u.useState)(function(){return{value:e,callback:t,facade:{get current(){return n.value},set current(e){var t=n.value;t!==e&&(n.value=e,n.callback(e,t))}}}})[0];return n.callback=t,n.facade}var At=typeof window<`u`?u.useLayoutEffect:u.useEffect,jt=new WeakMap;function Mt(e,t){var n=kt(t||null,function(t){return e.forEach(function(e){return Ot(e,t)})});return At(function(){var t=jt.get(n);if(t){var r=new Set(t),i=new Set(e),a=n.current;r.forEach(function(e){i.has(e)||Ot(e,null)}),i.forEach(function(e){r.has(e)||Ot(e,a)})}jt.set(n,e)},[e]),n}function Nt(e){return e}function Pt(e,t){t===void 0&&(t=Nt);var n=[],r=!1;return{read:function(){if(r)throw Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return n.length?n[n.length-1]:e},useMedium:function(e){var i=t(e,r);return n.push(i),function(){n=n.filter(function(e){return e!==i})}},assignSyncMedium:function(e){for(r=!0;n.length;){var t=n;n=[],t.forEach(e)}n={push:function(t){return e(t)},filter:function(){return n}}},assignMedium:function(e){r=!0;var t=[];if(n.length){var i=n;n=[],i.forEach(e),t=n}var a=function(){var n=t;t=[],n.forEach(e)},o=function(){return Promise.resolve().then(a)};o(),n={push:function(e){t.push(e),o()},filter:function(e){return t=t.filter(e),n}}}}}function Ft(e){e===void 0&&(e={});var t=Pt(null);return t.options=U({async:!0,ssr:!1},e),t}var It=function(e){var t=e.sideCar,n=wt(e,[`sideCar`]);if(!t)throw Error("Sidecar: please provide `sideCar` property to import the right car");var r=t.read();if(!r)throw Error(`Sidecar medium not found`);return u.createElement(r,U({},n))};It.isSideCarExport=!0;function Lt(e,t){return e.useMedium(t),It}var Rt=Ft(),zt=function(){},K=u.forwardRef(function(e,t){var n=u.useRef(null),r=u.useState({onScrollCapture:zt,onWheelCapture:zt,onTouchMoveCapture:zt}),i=r[0],a=r[1],o=e.forwardProps,s=e.children,c=e.className,l=e.removeScrollBar,d=e.enabled,f=e.shards,p=e.sideCar,m=e.noRelative,h=e.noIsolation,g=e.inert,_=e.allowPinchZoom,v=e.as,y=v===void 0?`div`:v,b=e.gapMode,x=wt(e,[`forwardProps`,`children`,`className`,`removeScrollBar`,`enabled`,`shards`,`sideCar`,`noRelative`,`noIsolation`,`inert`,`allowPinchZoom`,`as`,`gapMode`]),S=p,C=Mt([n,t]),w=U(U({},x),i);return u.createElement(u.Fragment,null,d&&u.createElement(S,{sideCar:Rt,removeScrollBar:l,shards:f,noRelative:m,noIsolation:h,inert:g,setCallbacks:a,allowPinchZoom:!!_,lockRef:n,gapMode:b}),o?u.cloneElement(u.Children.only(s),U(U({},w),{ref:C})):u.createElement(y,U({},w,{className:c,ref:C}),s))});K.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1},K.classNames={fullWidth:G,zeroRight:W};var Bt,Vt=function(){if(Bt)return Bt;if(typeof __webpack_nonce__<`u`)return __webpack_nonce__};function Ht(){if(!document)return null;var e=document.createElement(`style`);e.type=`text/css`;var t=Vt();return t&&e.setAttribute(`nonce`,t),e}function Ut(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function Wt(e){(document.head||document.getElementsByTagName(`head`)[0]).appendChild(e)}var Gt=function(){var e=0,t=null;return{add:function(n){e==0&&(t=Ht())&&(Ut(t,n),Wt(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},Kt=function(){var e=Gt();return function(t,n){u.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},qt=function(){var e=Kt();return function(t){var n=t.styles,r=t.dynamic;return e(n,r),null}},Jt={left:0,top:0,right:0,gap:0},Yt=function(e){return parseInt(e||``,10)||0},Xt=function(e){var t=window.getComputedStyle(document.body),n=t[e===`padding`?`paddingLeft`:`marginLeft`],r=t[e===`padding`?`paddingTop`:`marginTop`],i=t[e===`padding`?`paddingRight`:`marginRight`];return[Yt(n),Yt(r),Yt(i)]},Zt=function(e){if(e===void 0&&(e=`margin`),typeof window>`u`)return Jt;var t=Xt(e),n=document.documentElement.clientWidth,r=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,r-n+t[2]-t[0])}},Qt=qt(),q=`data-scroll-locked`,$t=function(e,t,n,r){var i=e.left,a=e.top,o=e.right,s=e.gap;return n===void 0&&(n=`margin`),`
2
2
  .${Et} {
3
3
  overflow: hidden ${r};
4
4
  padding-right: ${s}px ${r};
@@ -1,4 +1,4 @@
1
- import{B as e,D as t,Dt as n,F as r,H as i,I as a,Kt as o,O as s,Ot as c,P as l,W as u,j as d,k as f,m as p,p as m}from"./queries-vY5lJqBe.js";import{t as h}from"./index-JXZlD4dH.js";import{l as g,r as _,t as v}from"./Lamp-WOotyOTd.js";var y=o(c(),1),b=(...e)=>e.filter((e,t,n)=>!!e&&e.trim()!==``&&n.indexOf(e)===t).join(` `).trim(),x=e=>e.replace(/([a-z0-9])([A-Z])/g,`$1-$2`).toLowerCase(),S=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(e,t,n)=>n?n.toUpperCase():t.toLowerCase()),C=e=>{let t=S(e);return t.charAt(0).toUpperCase()+t.slice(1)},w={xmlns:`http://www.w3.org/2000/svg`,width:24,height:24,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:2,strokeLinecap:`round`,strokeLinejoin:`round`},T=e=>{for(let t in e)if(t.startsWith(`aria-`)||t===`role`||t===`title`)return!0;return!1},E=(0,y.createContext)({}),D=()=>(0,y.useContext)(E),O=(0,y.forwardRef)(({color:e,size:t,strokeWidth:n,absoluteStrokeWidth:r,className:i=``,children:a,iconNode:o,...s},c)=>{let{size:l=24,strokeWidth:u=2,absoluteStrokeWidth:d=!1,color:f=`currentColor`,className:p=``}=D()??{},m=r??d?Number(n??u)*24/Number(t??l):n??u;return(0,y.createElement)(`svg`,{ref:c,...w,width:t??l??w.width,height:t??l??w.height,stroke:e??f,strokeWidth:m,className:b(`lucide`,p,i),...!a&&!T(s)&&{"aria-hidden":`true`},...s},[...o.map(([e,t])=>(0,y.createElement)(e,t)),...Array.isArray(a)?a:[a]])}),k=(e,t)=>{let n=(0,y.forwardRef)(({className:n,...r},i)=>(0,y.createElement)(O,{ref:i,iconNode:t,className:b(`lucide-${x(C(e))}`,`lucide-${e}`,n),...r}));return n.displayName=C(e),n},A=k(`activity`,[[`path`,{d:`M22 12h-2.48a2 2 0 0 0-1.93 1.46l-2.35 8.36a.25.25 0 0 1-.48 0L9.24 2.18a.25.25 0 0 0-.48 0l-2.35 8.36A2 2 0 0 1 4.49 12H2`,key:`169zse`}]]),j=k(`boxes`,[[`path`,{d:`M2.97 12.92A2 2 0 0 0 2 14.63v3.24a2 2 0 0 0 .97 1.71l3 1.8a2 2 0 0 0 2.06 0L12 19v-5.5l-5-3-4.03 2.42Z`,key:`lc1i9w`}],[`path`,{d:`m7 16.5-4.74-2.85`,key:`1o9zyk`}],[`path`,{d:`m7 16.5 5-3`,key:`va8pkn`}],[`path`,{d:`M7 16.5v5.17`,key:`jnp8gn`}],[`path`,{d:`M12 13.5V19l3.97 2.38a2 2 0 0 0 2.06 0l3-1.8a2 2 0 0 0 .97-1.71v-3.24a2 2 0 0 0-.97-1.71L17 10.5l-5 3Z`,key:`8zsnat`}],[`path`,{d:`m17 16.5-5-3`,key:`8arw3v`}],[`path`,{d:`m17 16.5 4.74-2.85`,key:`8rfmw`}],[`path`,{d:`M17 16.5v5.17`,key:`k6z78m`}],[`path`,{d:`M7.97 4.42A2 2 0 0 0 7 6.13v4.37l5 3 5-3V6.13a2 2 0 0 0-.97-1.71l-3-1.8a2 2 0 0 0-2.06 0l-3 1.8Z`,key:`1xygjf`}],[`path`,{d:`M12 8 7.26 5.15`,key:`1vbdud`}],[`path`,{d:`m12 8 4.74-2.85`,key:`3rx089`}],[`path`,{d:`M12 13.5V8`,key:`1io7kd`}]]),ee=k(`cable`,[[`path`,{d:`M17 19a1 1 0 0 1-1-1v-2a2 2 0 0 1 2-2h2a2 2 0 0 1 2 2v2a1 1 0 0 1-1 1z`,key:`trhst0`}],[`path`,{d:`M17 21v-2`,key:`ds4u3f`}],[`path`,{d:`M19 14V6.5a1 1 0 0 0-7 0v11a1 1 0 0 1-7 0V10`,key:`1mo9zo`}],[`path`,{d:`M21 21v-2`,key:`eo0ou`}],[`path`,{d:`M3 5V3`,key:`1k5hjh`}],[`path`,{d:`M4 10a2 2 0 0 1-2-2V6a1 1 0 0 1 1-1h4a1 1 0 0 1 1 1v2a2 2 0 0 1-2 2z`,key:`1dd30t`}],[`path`,{d:`M7 5V3`,key:`1t1388`}]]),te=k(`gauge`,[[`path`,{d:`m12 14 4-4`,key:`9kzdfg`}],[`path`,{d:`M3.34 19a10 10 0 1 1 17.32 0`,key:`19p75a`}]]),ne=k(`key-round`,[[`path`,{d:`M2.586 17.414A2 2 0 0 0 2 18.828V21a1 1 0 0 0 1 1h3a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h1a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h.172a2 2 0 0 0 1.414-.586l.814-.814a6.5 6.5 0 1 0-4-4z`,key:`1s6t7t`}],[`circle`,{cx:`16.5`,cy:`7.5`,r:`.5`,fill:`currentColor`,key:`w0ekpg`}]]),re=k(`log-out`,[[`path`,{d:`m16 17 5-5-5-5`,key:`1bji2h`}],[`path`,{d:`M21 12H9`,key:`dn1m92`}],[`path`,{d:`M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4`,key:`1uf3rs`}]]),ie=k(`monitor-cog`,[[`path`,{d:`M12 17v4`,key:`1riwvh`}],[`path`,{d:`m14.305 7.53.923-.382`,key:`1mlnsw`}],[`path`,{d:`m15.228 4.852-.923-.383`,key:`82mpwg`}],[`path`,{d:`m16.852 3.228-.383-.924`,key:`ln4sir`}],[`path`,{d:`m16.852 8.772-.383.923`,key:`1dejw0`}],[`path`,{d:`m19.148 3.228.383-.924`,key:`192kgf`}],[`path`,{d:`m19.53 9.696-.382-.924`,key:`fiavlr`}],[`path`,{d:`m20.772 4.852.924-.383`,key:`1j8mgp`}],[`path`,{d:`m20.772 7.148.924.383`,key:`zix9be`}],[`path`,{d:`M22 13v2a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h7`,key:`1tnzv8`}],[`path`,{d:`M8 21h8`,key:`1ev6f3`}],[`circle`,{cx:`18`,cy:`6`,r:`3`,key:`1h7g24`}]]),ae=k(`moon`,[[`path`,{d:`M20.985 12.486a9 9 0 1 1-9.473-9.472c.405-.022.617.46.402.803a6 6 0 0 0 8.268 8.268c.344-.215.825-.004.803.401`,key:`kfwtm`}]]),oe=k(`scroll-text`,[[`path`,{d:`M15 12h-5`,key:`r7krc0`}],[`path`,{d:`M15 8h-5`,key:`1khuty`}],[`path`,{d:`M19 17V5a2 2 0 0 0-2-2H4`,key:`zz82l3`}],[`path`,{d:`M8 21h12a2 2 0 0 0 2-2v-1a1 1 0 0 0-1-1H11a1 1 0 0 0-1 1v1a2 2 0 1 1-4 0V5a2 2 0 1 0-4 0v2a1 1 0 0 0 1 1h3`,key:`1ph1d7`}]]),se=k(`sliders-horizontal`,[[`path`,{d:`M10 5H3`,key:`1qgfaw`}],[`path`,{d:`M12 19H3`,key:`yhmn1j`}],[`path`,{d:`M14 3v4`,key:`1sua03`}],[`path`,{d:`M16 17v4`,key:`1q0r14`}],[`path`,{d:`M21 12h-9`,key:`1o4lsq`}],[`path`,{d:`M21 19h-5`,key:`1rlt1p`}],[`path`,{d:`M21 5h-7`,key:`1oszz2`}],[`path`,{d:`M8 10v4`,key:`tgpxqk`}],[`path`,{d:`M8 12H3`,key:`a7s4jb`}]]),ce=k(`sun`,[[`circle`,{cx:`12`,cy:`12`,r:`4`,key:`4exip2`}],[`path`,{d:`M12 2v2`,key:`tus03m`}],[`path`,{d:`M12 20v2`,key:`1lh1kg`}],[`path`,{d:`m4.93 4.93 1.41 1.41`,key:`149t6j`}],[`path`,{d:`m17.66 17.66 1.41 1.41`,key:`ptbguv`}],[`path`,{d:`M2 12h2`,key:`1t8f8n`}],[`path`,{d:`M20 12h2`,key:`1q8mjw`}],[`path`,{d:`m6.34 17.66-1.41 1.41`,key:`1m8zz5`}],[`path`,{d:`m19.07 4.93-1.41 1.41`,key:`1shlcs`}]]),M=new Intl.NumberFormat(`en-US`,{notation:`compact`,maximumFractionDigits:1}),N=new Intl.NumberFormat(`en-US`);function P(e){return Number.isFinite(e)?e<1e4?N.format(Math.round(e)):M.format(e).toLowerCase():`—`}function F(e){return Number.isFinite(e)?e===0?`$0`:e<.01?`$${e.toFixed(4)}`:e<100?`$${e.toFixed(2)}`:`$${M.format(e).toLowerCase()}`:`—`}function I(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 L(e,t=1){return Number.isFinite(e)?`${(e*100).toFixed(t)}%`:`—`}var R=[[6e4,1e3,`s`],[36e5,6e4,`m`],[864e5,36e5,`h`],[1/0,864e5,`d`]];function z(e){let t=Math.abs(e);if(t<1e3)return`0s`;let n=R.find(([e])=>t<e);return n===void 0?`—`:`${Math.floor(t/n[1])}${n[2]}`}function B(e,t=Date.now()){if(e==null||!Number.isFinite(e))return`—`;let n=e-t;return Math.abs(n)<5e3?`just now`:n<0?`${z(n)} ago`:`in ${z(n)}`}function V(e){return new Date(e).toLocaleTimeString(`en-GB`,{hour12:!1})}function H(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})}function U(e,t=8){return e.length<=t?e:`${e.slice(0,t)}…`}var W=n(),G=(0,y.createContext)(null);function le({children:e}){let[t,n]=(0,y.useState)(!0),r=(0,y.useCallback)(()=>n(e=>!e),[]),i=(0,y.useMemo)(()=>({live:t,toggle:r,cadence:e=>t?e:!1}),[t,r]);return(0,W.jsx)(G,{value:i,children:e})}function K(){return(0,y.use)(G)??{live:!1,toggle:()=>{},cadence:()=>!1}}var ue=e.svg`
1
+ import{B as e,D as t,Dt as n,F as r,H as i,I as a,Kt as o,O as s,Ot as c,P as l,W as u,j as d,k as f,m as p,p as m}from"./queries-vY5lJqBe.js";import{t as h}from"./index--dA3FFSN.js";import{l as g,r as _,t as v}from"./Lamp-WOotyOTd.js";var y=o(c(),1),b=(...e)=>e.filter((e,t,n)=>!!e&&e.trim()!==``&&n.indexOf(e)===t).join(` `).trim(),x=e=>e.replace(/([a-z0-9])([A-Z])/g,`$1-$2`).toLowerCase(),S=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(e,t,n)=>n?n.toUpperCase():t.toLowerCase()),C=e=>{let t=S(e);return t.charAt(0).toUpperCase()+t.slice(1)},w={xmlns:`http://www.w3.org/2000/svg`,width:24,height:24,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:2,strokeLinecap:`round`,strokeLinejoin:`round`},T=e=>{for(let t in e)if(t.startsWith(`aria-`)||t===`role`||t===`title`)return!0;return!1},E=(0,y.createContext)({}),D=()=>(0,y.useContext)(E),O=(0,y.forwardRef)(({color:e,size:t,strokeWidth:n,absoluteStrokeWidth:r,className:i=``,children:a,iconNode:o,...s},c)=>{let{size:l=24,strokeWidth:u=2,absoluteStrokeWidth:d=!1,color:f=`currentColor`,className:p=``}=D()??{},m=r??d?Number(n??u)*24/Number(t??l):n??u;return(0,y.createElement)(`svg`,{ref:c,...w,width:t??l??w.width,height:t??l??w.height,stroke:e??f,strokeWidth:m,className:b(`lucide`,p,i),...!a&&!T(s)&&{"aria-hidden":`true`},...s},[...o.map(([e,t])=>(0,y.createElement)(e,t)),...Array.isArray(a)?a:[a]])}),k=(e,t)=>{let n=(0,y.forwardRef)(({className:n,...r},i)=>(0,y.createElement)(O,{ref:i,iconNode:t,className:b(`lucide-${x(C(e))}`,`lucide-${e}`,n),...r}));return n.displayName=C(e),n},A=k(`activity`,[[`path`,{d:`M22 12h-2.48a2 2 0 0 0-1.93 1.46l-2.35 8.36a.25.25 0 0 1-.48 0L9.24 2.18a.25.25 0 0 0-.48 0l-2.35 8.36A2 2 0 0 1 4.49 12H2`,key:`169zse`}]]),j=k(`boxes`,[[`path`,{d:`M2.97 12.92A2 2 0 0 0 2 14.63v3.24a2 2 0 0 0 .97 1.71l3 1.8a2 2 0 0 0 2.06 0L12 19v-5.5l-5-3-4.03 2.42Z`,key:`lc1i9w`}],[`path`,{d:`m7 16.5-4.74-2.85`,key:`1o9zyk`}],[`path`,{d:`m7 16.5 5-3`,key:`va8pkn`}],[`path`,{d:`M7 16.5v5.17`,key:`jnp8gn`}],[`path`,{d:`M12 13.5V19l3.97 2.38a2 2 0 0 0 2.06 0l3-1.8a2 2 0 0 0 .97-1.71v-3.24a2 2 0 0 0-.97-1.71L17 10.5l-5 3Z`,key:`8zsnat`}],[`path`,{d:`m17 16.5-5-3`,key:`8arw3v`}],[`path`,{d:`m17 16.5 4.74-2.85`,key:`8rfmw`}],[`path`,{d:`M17 16.5v5.17`,key:`k6z78m`}],[`path`,{d:`M7.97 4.42A2 2 0 0 0 7 6.13v4.37l5 3 5-3V6.13a2 2 0 0 0-.97-1.71l-3-1.8a2 2 0 0 0-2.06 0l-3 1.8Z`,key:`1xygjf`}],[`path`,{d:`M12 8 7.26 5.15`,key:`1vbdud`}],[`path`,{d:`m12 8 4.74-2.85`,key:`3rx089`}],[`path`,{d:`M12 13.5V8`,key:`1io7kd`}]]),ee=k(`cable`,[[`path`,{d:`M17 19a1 1 0 0 1-1-1v-2a2 2 0 0 1 2-2h2a2 2 0 0 1 2 2v2a1 1 0 0 1-1 1z`,key:`trhst0`}],[`path`,{d:`M17 21v-2`,key:`ds4u3f`}],[`path`,{d:`M19 14V6.5a1 1 0 0 0-7 0v11a1 1 0 0 1-7 0V10`,key:`1mo9zo`}],[`path`,{d:`M21 21v-2`,key:`eo0ou`}],[`path`,{d:`M3 5V3`,key:`1k5hjh`}],[`path`,{d:`M4 10a2 2 0 0 1-2-2V6a1 1 0 0 1 1-1h4a1 1 0 0 1 1 1v2a2 2 0 0 1-2 2z`,key:`1dd30t`}],[`path`,{d:`M7 5V3`,key:`1t1388`}]]),te=k(`gauge`,[[`path`,{d:`m12 14 4-4`,key:`9kzdfg`}],[`path`,{d:`M3.34 19a10 10 0 1 1 17.32 0`,key:`19p75a`}]]),ne=k(`key-round`,[[`path`,{d:`M2.586 17.414A2 2 0 0 0 2 18.828V21a1 1 0 0 0 1 1h3a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h1a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h.172a2 2 0 0 0 1.414-.586l.814-.814a6.5 6.5 0 1 0-4-4z`,key:`1s6t7t`}],[`circle`,{cx:`16.5`,cy:`7.5`,r:`.5`,fill:`currentColor`,key:`w0ekpg`}]]),re=k(`log-out`,[[`path`,{d:`m16 17 5-5-5-5`,key:`1bji2h`}],[`path`,{d:`M21 12H9`,key:`dn1m92`}],[`path`,{d:`M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4`,key:`1uf3rs`}]]),ie=k(`monitor-cog`,[[`path`,{d:`M12 17v4`,key:`1riwvh`}],[`path`,{d:`m14.305 7.53.923-.382`,key:`1mlnsw`}],[`path`,{d:`m15.228 4.852-.923-.383`,key:`82mpwg`}],[`path`,{d:`m16.852 3.228-.383-.924`,key:`ln4sir`}],[`path`,{d:`m16.852 8.772-.383.923`,key:`1dejw0`}],[`path`,{d:`m19.148 3.228.383-.924`,key:`192kgf`}],[`path`,{d:`m19.53 9.696-.382-.924`,key:`fiavlr`}],[`path`,{d:`m20.772 4.852.924-.383`,key:`1j8mgp`}],[`path`,{d:`m20.772 7.148.924.383`,key:`zix9be`}],[`path`,{d:`M22 13v2a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h7`,key:`1tnzv8`}],[`path`,{d:`M8 21h8`,key:`1ev6f3`}],[`circle`,{cx:`18`,cy:`6`,r:`3`,key:`1h7g24`}]]),ae=k(`moon`,[[`path`,{d:`M20.985 12.486a9 9 0 1 1-9.473-9.472c.405-.022.617.46.402.803a6 6 0 0 0 8.268 8.268c.344-.215.825-.004.803.401`,key:`kfwtm`}]]),oe=k(`scroll-text`,[[`path`,{d:`M15 12h-5`,key:`r7krc0`}],[`path`,{d:`M15 8h-5`,key:`1khuty`}],[`path`,{d:`M19 17V5a2 2 0 0 0-2-2H4`,key:`zz82l3`}],[`path`,{d:`M8 21h12a2 2 0 0 0 2-2v-1a1 1 0 0 0-1-1H11a1 1 0 0 0-1 1v1a2 2 0 1 1-4 0V5a2 2 0 1 0-4 0v2a1 1 0 0 0 1 1h3`,key:`1ph1d7`}]]),se=k(`sliders-horizontal`,[[`path`,{d:`M10 5H3`,key:`1qgfaw`}],[`path`,{d:`M12 19H3`,key:`yhmn1j`}],[`path`,{d:`M14 3v4`,key:`1sua03`}],[`path`,{d:`M16 17v4`,key:`1q0r14`}],[`path`,{d:`M21 12h-9`,key:`1o4lsq`}],[`path`,{d:`M21 19h-5`,key:`1rlt1p`}],[`path`,{d:`M21 5h-7`,key:`1oszz2`}],[`path`,{d:`M8 10v4`,key:`tgpxqk`}],[`path`,{d:`M8 12H3`,key:`a7s4jb`}]]),ce=k(`sun`,[[`circle`,{cx:`12`,cy:`12`,r:`4`,key:`4exip2`}],[`path`,{d:`M12 2v2`,key:`tus03m`}],[`path`,{d:`M12 20v2`,key:`1lh1kg`}],[`path`,{d:`m4.93 4.93 1.41 1.41`,key:`149t6j`}],[`path`,{d:`m17.66 17.66 1.41 1.41`,key:`ptbguv`}],[`path`,{d:`M2 12h2`,key:`1t8f8n`}],[`path`,{d:`M20 12h2`,key:`1q8mjw`}],[`path`,{d:`m6.34 17.66-1.41 1.41`,key:`1m8zz5`}],[`path`,{d:`m19.07 4.93-1.41 1.41`,key:`1shlcs`}]]),M=new Intl.NumberFormat(`en-US`,{notation:`compact`,maximumFractionDigits:1}),N=new Intl.NumberFormat(`en-US`);function P(e){return Number.isFinite(e)?e<1e4?N.format(Math.round(e)):M.format(e).toLowerCase():`—`}function F(e){return Number.isFinite(e)?e===0?`$0`:e<.01?`$${e.toFixed(4)}`:e<100?`$${e.toFixed(2)}`:`$${M.format(e).toLowerCase()}`:`—`}function I(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 L(e,t=1){return Number.isFinite(e)?`${(e*100).toFixed(t)}%`:`—`}var R=[[6e4,1e3,`s`],[36e5,6e4,`m`],[864e5,36e5,`h`],[1/0,864e5,`d`]];function z(e){let t=Math.abs(e);if(t<1e3)return`0s`;let n=R.find(([e])=>t<e);return n===void 0?`—`:`${Math.floor(t/n[1])}${n[2]}`}function B(e,t=Date.now()){if(e==null||!Number.isFinite(e))return`—`;let n=e-t;return Math.abs(n)<5e3?`just now`:n<0?`${z(n)} ago`:`in ${z(n)}`}function V(e){return new Date(e).toLocaleTimeString(`en-GB`,{hour12:!1})}function H(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})}function U(e,t=8){return e.length<=t?e:`${e.slice(0,t)}…`}var W=n(),G=(0,y.createContext)(null);function le({children:e}){let[t,n]=(0,y.useState)(!0),r=(0,y.useCallback)(()=>n(e=>!e),[]),i=(0,y.useMemo)(()=>({live:t,toggle:r,cadence:e=>t?e:!1}),[t,r]);return(0,W.jsx)(G,{value:i,children:e})}function K(){return(0,y.use)(G)??{live:!1,toggle:()=>{},cadence:()=>!1}}var ue=e.svg`
2
2
  display: block;
3
3
  width: 100%;
4
4
  height: 100%;
@@ -1,4 +1,4 @@
1
- import{B as e,Dt as t,F as n,Kt as r,Ot as i}from"./queries-vY5lJqBe.js";import{m as a}from"./Rack-Be09hoVn.js";import{a as o,i as s,n as c,o as l,r as u,s as d,t as f}from"./Modal-CXsglS9k.js";var p=a(`plus`,[[`path`,{d:`M5 12h14`,key:`1ays0h`}],[`path`,{d:`M12 5v14`,key:`s699le`}]]),m=r(i(),1),h=Object.defineProperty,g=(e,t)=>h(e,`name`,{value:t,configurable:!0});function _(e){let[t,n]=m.useState(void 0);return u(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});let t=new ResizeObserver(t=>{if(!Array.isArray(t)||!t.length)return;let r=t[0],i,a;if(`borderBoxSize`in r){let e=r.borderBoxSize,t=Array.isArray(e)?e[0]:e;i=t.inlineSize,a=t.blockSize}else i=e.offsetWidth,a=e.offsetHeight;n({width:i,height:a})});return t.observe(e,{box:`border-box`}),()=>t.unobserve(e)}n(void 0)},[e]),t}g(_,`useSize`);var v=t(),y=Object.defineProperty,b=(e,t)=>y(e,`name`,{value:t,configurable:!0}),x=`Switch`,[S,C]=o(x),[w,T]=S(x);function E(e){let{__scopeSwitch:t,checked:n,children:r,defaultChecked:i,disabled:a,form:o,name:s,onCheckedChange:l,required:u,value:d=`on`,internal_do_not_use_render:f}=e,[p,h]=c({prop:n,defaultProp:i??!1,onChange:l,caller:x}),[g,_]=m.useState(null),[y,b]=m.useState(null),S=m.useRef(!1),[C,T]=m.useReducer(e=>e+1,0),E={checked:p,setChecked:h,disabled:a,control:g,setControl:_,name:s,form:o,value:d,hasConsumerStoppedPropagationRef:S,userInteractionCount:C,onUserInteraction:T,required:u,defaultChecked:i,isFormControl:!g||!!o||!!g.closest(`form`),bubbleInput:y,setBubbleInput:b};return(0,v.jsx)(w,{scope:t,...E,children:P(f)?f(E):r})}b(E,`SwitchProvider`);var D=`SwitchTrigger`,O=m.forwardRef(b(function({__scopeSwitch:e,onClick:t,...n},r){let{control:i,form:a,value:o,disabled:c,checked:u,required:f,setControl:p,setChecked:h,hasConsumerStoppedPropagationRef:g,onUserInteraction:_,isFormControl:y,bubbleInput:x}=T(D,e),S=d(r,p),C=m.useRef(u);return m.useEffect(()=>{let e=a?i?.ownerDocument.getElementById(a):i?.form;if(e instanceof HTMLFormElement){let t=b(()=>h(C.current),`reset`);return e.addEventListener(`reset`,t),()=>e.removeEventListener(`reset`,t)}},[i,a,h]),(0,v.jsx)(l.button,{type:`button`,role:`switch`,"aria-checked":u,"aria-required":f,"data-state":F(u),"data-disabled":c?``:void 0,disabled:c,value:o,...n,ref:S,onClick:s(t,e=>{_(),h(e=>!e),x&&y&&(g.current=e.isPropagationStopped(),g.current||e.stopPropagation())})})},`SwitchTrigger`)),k=m.forwardRef(b(function(e,t){let{__scopeSwitch:n,name:r,checked:i,defaultChecked:a,required:o,disabled:s,value:c,onCheckedChange:l,form:u,...d}=e;return(0,v.jsx)(E,{__scopeSwitch:n,checked:i,defaultChecked:a,disabled:s,required:o,onCheckedChange:l,name:r,form:u,value:c,internal_do_not_use_render:({isFormControl:e})=>(0,v.jsxs)(v.Fragment,{children:[(0,v.jsx)(O,{...d,ref:t,__scopeSwitch:n}),e&&(0,v.jsx)(N,{__scopeSwitch:n})]})})},`Switch`)),A=`SwitchThumb`,j=m.forwardRef(b(function(e,t){let{__scopeSwitch:n,...r}=e,i=T(A,n);return(0,v.jsx)(l.span,{"data-state":F(i.checked),"data-disabled":i.disabled?``:void 0,...r,ref:t})},`SwitchThumb`)),M=`SwitchBubbleInput`,N=m.forwardRef(b(function({__scopeSwitch:e,onClick:t,...n},r){let{control:i,hasConsumerStoppedPropagationRef:a,userInteractionCount:o,checked:c,defaultChecked:u,required:f,disabled:p,name:h,value:g,form:y,bubbleInput:b,setBubbleInput:x}=T(M,e),S=d(r,x),C=_(i),w=m.useRef(!1),E=m.useRef(c),D=m.useRef(o);m.useEffect(()=>{let e=b;if(!e)return;let t=window.HTMLInputElement.prototype,n=Object.getOwnPropertyDescriptor(t,`checked`).set,r=o!==D.current;D.current=o;let i=E.current!==c;E.current=c;let s=!(r&&a.current);if(i&&n){w.current=!r;let t=new Event(`click`,{bubbles:s});n.call(e,c),e.dispatchEvent(t),w.current=!1}},[b,c,a,o]);let O=m.useRef(c);return(0,v.jsx)(l.input,{type:`checkbox`,"aria-hidden":!0,defaultChecked:u??O.current,required:f,disabled:p,name:h,value:g,form:y,...n,tabIndex:-1,ref:S,onClick:s(t,e=>{w.current&&e.stopPropagation()}),style:{...n.style,...C,position:`absolute`,pointerEvents:`none`,opacity:0,margin:0,transform:`translateX(-100%)`}})},`SwitchBubbleInput`));function P(e){return typeof e==`function`}b(P,`isFunction`);function F(e){return e?`checked`:`unchecked`}b(F,`getState`);var I=e.p`
1
+ import{B as e,Dt as t,F as n,Kt as r,Ot as i}from"./queries-vY5lJqBe.js";import{m as a}from"./Rack-uDxrjvaz.js";import{a as o,i as s,n as c,o as l,r as u,s as d,t as f}from"./Modal-Crr8uyWt.js";var p=a(`plus`,[[`path`,{d:`M5 12h14`,key:`1ays0h`}],[`path`,{d:`M12 5v14`,key:`s699le`}]]),m=r(i(),1),h=Object.defineProperty,g=(e,t)=>h(e,`name`,{value:t,configurable:!0});function _(e){let[t,n]=m.useState(void 0);return u(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});let t=new ResizeObserver(t=>{if(!Array.isArray(t)||!t.length)return;let r=t[0],i,a;if(`borderBoxSize`in r){let e=r.borderBoxSize,t=Array.isArray(e)?e[0]:e;i=t.inlineSize,a=t.blockSize}else i=e.offsetWidth,a=e.offsetHeight;n({width:i,height:a})});return t.observe(e,{box:`border-box`}),()=>t.unobserve(e)}n(void 0)},[e]),t}g(_,`useSize`);var v=t(),y=Object.defineProperty,b=(e,t)=>y(e,`name`,{value:t,configurable:!0}),x=`Switch`,[S,C]=o(x),[w,T]=S(x);function E(e){let{__scopeSwitch:t,checked:n,children:r,defaultChecked:i,disabled:a,form:o,name:s,onCheckedChange:l,required:u,value:d=`on`,internal_do_not_use_render:f}=e,[p,h]=c({prop:n,defaultProp:i??!1,onChange:l,caller:x}),[g,_]=m.useState(null),[y,b]=m.useState(null),S=m.useRef(!1),[C,T]=m.useReducer(e=>e+1,0),E={checked:p,setChecked:h,disabled:a,control:g,setControl:_,name:s,form:o,value:d,hasConsumerStoppedPropagationRef:S,userInteractionCount:C,onUserInteraction:T,required:u,defaultChecked:i,isFormControl:!g||!!o||!!g.closest(`form`),bubbleInput:y,setBubbleInput:b};return(0,v.jsx)(w,{scope:t,...E,children:P(f)?f(E):r})}b(E,`SwitchProvider`);var D=`SwitchTrigger`,O=m.forwardRef(b(function({__scopeSwitch:e,onClick:t,...n},r){let{control:i,form:a,value:o,disabled:c,checked:u,required:f,setControl:p,setChecked:h,hasConsumerStoppedPropagationRef:g,onUserInteraction:_,isFormControl:y,bubbleInput:x}=T(D,e),S=d(r,p),C=m.useRef(u);return m.useEffect(()=>{let e=a?i?.ownerDocument.getElementById(a):i?.form;if(e instanceof HTMLFormElement){let t=b(()=>h(C.current),`reset`);return e.addEventListener(`reset`,t),()=>e.removeEventListener(`reset`,t)}},[i,a,h]),(0,v.jsx)(l.button,{type:`button`,role:`switch`,"aria-checked":u,"aria-required":f,"data-state":F(u),"data-disabled":c?``:void 0,disabled:c,value:o,...n,ref:S,onClick:s(t,e=>{_(),h(e=>!e),x&&y&&(g.current=e.isPropagationStopped(),g.current||e.stopPropagation())})})},`SwitchTrigger`)),k=m.forwardRef(b(function(e,t){let{__scopeSwitch:n,name:r,checked:i,defaultChecked:a,required:o,disabled:s,value:c,onCheckedChange:l,form:u,...d}=e;return(0,v.jsx)(E,{__scopeSwitch:n,checked:i,defaultChecked:a,disabled:s,required:o,onCheckedChange:l,name:r,form:u,value:c,internal_do_not_use_render:({isFormControl:e})=>(0,v.jsxs)(v.Fragment,{children:[(0,v.jsx)(O,{...d,ref:t,__scopeSwitch:n}),e&&(0,v.jsx)(N,{__scopeSwitch:n})]})})},`Switch`)),A=`SwitchThumb`,j=m.forwardRef(b(function(e,t){let{__scopeSwitch:n,...r}=e,i=T(A,n);return(0,v.jsx)(l.span,{"data-state":F(i.checked),"data-disabled":i.disabled?``:void 0,...r,ref:t})},`SwitchThumb`)),M=`SwitchBubbleInput`,N=m.forwardRef(b(function({__scopeSwitch:e,onClick:t,...n},r){let{control:i,hasConsumerStoppedPropagationRef:a,userInteractionCount:o,checked:c,defaultChecked:u,required:f,disabled:p,name:h,value:g,form:y,bubbleInput:b,setBubbleInput:x}=T(M,e),S=d(r,x),C=_(i),w=m.useRef(!1),E=m.useRef(c),D=m.useRef(o);m.useEffect(()=>{let e=b;if(!e)return;let t=window.HTMLInputElement.prototype,n=Object.getOwnPropertyDescriptor(t,`checked`).set,r=o!==D.current;D.current=o;let i=E.current!==c;E.current=c;let s=!(r&&a.current);if(i&&n){w.current=!r;let t=new Event(`click`,{bubbles:s});n.call(e,c),e.dispatchEvent(t),w.current=!1}},[b,c,a,o]);let O=m.useRef(c);return(0,v.jsx)(l.input,{type:`checkbox`,"aria-hidden":!0,defaultChecked:u??O.current,required:f,disabled:p,name:h,value:g,form:y,...n,tabIndex:-1,ref:S,onClick:s(t,e=>{w.current&&e.stopPropagation()}),style:{...n.style,...C,position:`absolute`,pointerEvents:`none`,opacity:0,margin:0,transform:`translateX(-100%)`}})},`SwitchBubbleInput`));function P(e){return typeof e==`function`}b(P,`isFunction`);function F(e){return e?`checked`:`unchecked`}b(F,`getState`);var I=e.p`
2
2
  font-size: 13px;
3
3
  color: ${({theme:e})=>e.color.inkDim};
4
4
  `;function L({open:e,onOpenChange:t,title:r,body:i,confirmLabel:a,busy:o,onConfirm:s}){return(0,v.jsx)(f,{open:e,onOpenChange:t,title:r,width:`420px`,footer:(0,v.jsxs)(v.Fragment,{children:[(0,v.jsx)(n,{type:`button`,onClick:()=>t(!1),children:`Cancel`}),(0,v.jsx)(n,{type:`button`,$variant:`danger`,disabled:o===!0,onClick:s,children:a})]}),children:(0,v.jsx)(I,{children:i})})}var R=e(k)`
@@ -1 +1 @@
1
- import{Dt as e}from"./queries-vY5lJqBe.js";import{o as t}from"./index-JXZlD4dH.js";import{i as n,n as r}from"./Rack-Be09hoVn.js";var i=e(),a=()=>(0,i.jsx)(n,{children:(0,i.jsx)(r,{children:(0,i.jsx)(t,{})})});export{a as component};
1
+ import{Dt as e}from"./queries-vY5lJqBe.js";import{o as t}from"./index--dA3FFSN.js";import{i as n,n as r}from"./Rack-uDxrjvaz.js";var i=e(),a=()=>(0,i.jsx)(n,{children:(0,i.jsx)(r,{children:(0,i.jsx)(t,{})})});export{a as component};
@@ -0,0 +1,51 @@
1
+ import{A as e,B as t,D as n,Dt as r,F as i,I as a,Kt as o,M as s,Ot as c,S as l,c as u,i as d,k as f,o as p,r as m,s as h,t as g,y as _}from"./queries-vY5lJqBe.js";import{a as v,d as y,l as b,m as x,t as S}from"./Rack-uDxrjvaz.js";import{t as C}from"./CopyValue-bzKz2tiJ.js";import{n as w,r as T,t as ee}from"./Toggle-D0e4C94X.js";import{t as E}from"./trash-2-Cep_aVLx.js";import{t as D}from"./Modal-Crr8uyWt.js";import{a as O,c as te,i as ne,n as re,s as k,t as A}from"./Lamp-WOotyOTd.js";import{t as j}from"./Chip-D0YiqYkz.js";import{i as M,n as N,r as P,t as F}from"./Field-DdscQ9OO.js";import{t as ie}from"./Meter-Bm1oQE2U.js";import{a as I,i as L,n as R,r as z,t as B}from"./States-DPTTYUHL.js";import{i as V,n as H,r as U,t as W}from"./Table-LkPaHBsj.js";import{t as G}from"./catalog-DVRPlBJJ.js";var K=x(`external-link`,[[`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`}]]),q=o(c(),1),J=r(),ae=Object.keys(G),Y={anthropic:`Anthropic`,openai:`OpenAI`,kimi:`Kimi`},X={anthropic:`Authorize in the browser, then paste the code Anthropic shows you.`,openai:`Authorize in the browser. When it redirects to localhost, paste the whole URL.`,kimi:`Enter the code on Kimi's device page. This dialog finishes on its own.`},oe=t.ol`
2
+ display: flex;
3
+ flex-direction: column;
4
+ gap: ${({theme:e})=>e.space(3)};
5
+ `,se=t.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
+ `,ce=t.p`
15
+ font-size: 12px;
16
+ color: ${({theme:e})=>e.color.down};
17
+ `,le=t.p`
18
+ font-size: 12px;
19
+ color: ${({theme:e})=>e.color.inkDim};
20
+ `;function ue({open:e,onOpenChange:t,onConnected:r}){let[a,o]=(0,q.useState)(`anthropic`),[c,l]=(0,q.useState)(``),[u,p]=(0,q.useState)(null),[h,_]=(0,q.useState)(``),[v,y]=(0,q.useState)(null),b=d(),x=m(),S=(0,q.useCallback)(()=>{p(null),_(``),y(null),l(``),b.reset(),x.reset()},[b,x]),w=(0,q.useCallback)(e=>{e||S(),t(e)},[t,S]);return(0,q.useEffect)(()=>{if(u===null||u.kind!==`device`)return;let e=!1,n=async()=>{try{let n=await g(u.flowId);if(e)return;if(n.status===`complete`){S(),t(!1),r();return}}catch(t){if(e)return;y(L(t)),p(null);return}e||(i=setTimeout(()=>void n(),u.pollIntervalMs))},i=setTimeout(()=>void n(),u.pollIntervalMs);return()=>{e=!0,clearTimeout(i)}},[u,r,t,S]),(0,J.jsx)(D,{open:e,onOpenChange:w,title:`Connect an account`,description:`The gateway stores the resulting token encrypted. It is never shown again after this dialog.`,footer:u===null?(0,J.jsxs)(J.Fragment,{children:[(0,J.jsx)(i,{type:`button`,onClick:()=>w(!1),children:`Cancel`}),(0,J.jsx)(i,{type:`button`,$variant:`primary`,disabled:b.isPending,onClick:()=>{y(null),b.mutate({provider:a,label:c.trim().length===0?Y[a]:c.trim()},{onSuccess:e=>p(e),onError:e=>y(L(e))})},children:b.isPending?`Starting…`:`Start authorization`})]}):u.kind===`device`?(0,J.jsx)(i,{type:`button`,onClick:()=>w(!1),children:`Cancel`}):(0,J.jsxs)(J.Fragment,{children:[(0,J.jsx)(i,{type:`button`,onClick:()=>w(!1),children:`Cancel`}),(0,J.jsx)(i,{type:`button`,$variant:`primary`,disabled:x.isPending||h.trim().length===0,onClick:()=>{u!==null&&(y(null),x.mutate({flowId:u.flowId,code:h.trim()},{onSuccess:()=>{S(),t(!1),r()},onError:e=>y(L(e))}))},children:x.isPending?`Finishing…`:`Finish connecting`})]}),children:(0,J.jsxs)(oe,{children:[u===null?(0,J.jsxs)(s,{$gap:3,children:[(0,J.jsx)(F,{label:`Provider`,children:e=>(0,J.jsx)(M,{...e,value:a,onChange:e=>o(e.target.value),children:ae.map(e=>(0,J.jsx)(`option`,{value:e,children:Y[e]},e))})}),(0,J.jsx)(F,{label:`Label`,hint:`How this account is named in the rack. Defaults to the provider.`,children:e=>(0,J.jsx)(N,{...e,value:c,placeholder:Y[a],onChange:e=>l(e.target.value)})})]}):(0,J.jsxs)(s,{$gap:3,children:[(0,J.jsxs)(s,{$gap:1,children:[(0,J.jsx)(n,{children:`Step 1 — authorize`}),(0,J.jsx)(f,{$gap:2,children:(0,J.jsxs)(i,{as:`a`,href:u.authorizeUrl,target:`_blank`,rel:`noreferrer noopener`,$variant:`primary`,$size:`sm`,children:[(0,J.jsx)(K,{}),`Open `,Y[a]]})}),(0,J.jsx)(C,{value:u.authorizeUrl,label:`Copy authorization link`})]}),u.userCode===null?null:(0,J.jsxs)(s,{$gap:1,children:[(0,J.jsx)(n,{children:`Step 2 — enter this code`}),(0,J.jsx)(se,{children:u.userCode})]}),u.kind===`device`?(0,J.jsxs)(le,{children:[X[a],` Waiting for authorization…`]}):(0,J.jsx)(F,{label:`Authorization code`,hint:X[a],...v===null?{}:{problem:v},children:e=>(0,J.jsx)(N,{...e,value:h,autoFocus:!0,placeholder:a===`openai`?`http://localhost:1455/auth/callback?code=…`:`code#state`,onChange:e=>_(e.target.value)})})]}),v===null||u?.kind===`pkce`?null:(0,J.jsx)(ce,{children:v})]})})}var de=[`anthropic`,`openai`,`kimi`],Z={anthropic:`Anthropic`,openai:`OpenAI`,kimi:`Kimi`},fe=t(I)`
21
+ border-left: 3px solid ${({theme:e,$provider:t})=>e.provider[t]};
22
+ `,pe=t(N)`
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
+ `,Q=t(P)`
37
+ width: 62px;
38
+ height: 26px;
39
+ `,me=t.span`
40
+ display: block;
41
+ padding-left: 9px;
42
+ font-size: 11px;
43
+ color: ${({theme:e})=>e.color.inkDim};
44
+ `,he=t(f)`
45
+ min-width: 130px;
46
+ gap: 6px;
47
+ `,ge=t.div`
48
+ display: flex;
49
+ flex-direction: column;
50
+ gap: 4px;
51
+ `;function $(){let e=l();return{pending:e.isPending,commit:(t,n)=>{e.mutate({id:t,patch:n})}}}function _e(){let{cadence:t}=v(),r=h(),o=p(t(1e4)),c=_(),l=u(),{commit:d}=$(),[m,g]=(0,q.useState)(!1),[x,C]=(0,q.useState)(null),D=Date.now(),M=r.data??[],N=O(o.data?.health??[],e=>e.credentialId),P=O(o.data?.quota??[],e=>e.credentialId),F=c.data?.quotaPollIntervalMs??3e5,L=M.filter(e=>e.enabled).length,G=r.isLoading?`Reading connected accounts…`:M.length===0?`No provider credentials are connected, so every request fails at the router.`:`${L} of ${M.length} accounts are enabled and eligible for routing.`;return(0,J.jsxs)(J.Fragment,{children:[(0,J.jsx)(S,{legend:`Accounts`,title:`Provider accounts`,summary:G,actions:(0,J.jsxs)(i,{type:`button`,$variant:`primary`,onClick:()=>g(!0),children:[(0,J.jsx)(T,{}),`Connect an account`]})}),r.isError?(0,J.jsx)(I,{legend:`Accounts`,children:(0,J.jsx)(R,{error:r.error,onRetry:()=>void r.refetch()})}):r.isLoading?(0,J.jsx)(I,{legend:`Accounts`,children:(0,J.jsx)(z,{rows:5})}):M.length===0?(0,J.jsx)(I,{legend:`Accounts`,children:(0,J.jsx)(B,{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:(0,J.jsx)(i,{type:`button`,$variant:`primary`,$size:`sm`,onClick:()=>g(!0),children:`Connect an account`})})}):(0,J.jsx)(s,{$gap:4,children:de.filter(e=>M.some(t=>t.provider===e)).map(t=>{let r=M.filter(e=>e.provider===t);return(0,J.jsx)(fe,{$provider:t,legend:Z[t],meta:`${r.length} account${r.length===1?``:`s`}`,flush:!0,children:(0,J.jsx)(e,{children:(0,J.jsxs)(W,{children:[(0,J.jsx)(`thead`,{children:(0,J.jsxs)(`tr`,{children:[(0,J.jsx)(U,{$width:`24%`,children:`Account`}),(0,J.jsx)(U,{$width:`20%`,children:`Sign-in`}),(0,J.jsx)(U,{$align:`right`,$width:`86px`,children:`Tier`}),(0,J.jsx)(U,{$align:`right`,$width:`94px`,children:`Weight`}),(0,J.jsx)(U,{$align:`center`,$width:`86px`,children:`Enabled`}),(0,J.jsx)(U,{$width:`160px`,children:`Quota`}),(0,J.jsx)(U,{$align:`right`,$width:`88px`,children:`TTFT`}),(0,J.jsx)(U,{$align:`right`,$width:`130px`,children:`Token expires`}),(0,J.jsx)(U,{$width:`48px`})]})}),(0,J.jsx)(`tbody`,{children:r.map(e=>{let t=ne(N.get(e.id)??[],D,e.enabled,e.disabledReason),r=te(P.get(e.id)??[]);return(0,J.jsxs)(V,{children:[(0,J.jsxs)(H,{children:[(0,J.jsxs)(f,{$gap:2,children:[(0,J.jsx)(A,{state:t.state,label:t.note===``?`healthy`:t.note}),(0,J.jsx)(pe,{defaultValue:e.label,"aria-label":`Label for ${e.label}`,onBlur:t=>{let n=t.target.value.trim();if(n.length===0||n===e.label){t.target.value=e.label;return}d(e.id,{label:n})}})]}),t.note===``?null:(0,J.jsx)(me,{children:t.note})]}),(0,J.jsx)(H,{children:(0,J.jsxs)(f,{$gap:1,children:[(0,J.jsx)(j,{children:e.authType===`oauth`?`oauth`:`api key`}),e.accountEmail===null?null:(0,J.jsx)(n,{children:e.accountEmail})]})}),(0,J.jsx)(H,{$align:`right`,children:(0,J.jsx)(Q,{min:1,step:1,defaultValue:e.tier,"aria-label":`Tier for ${e.label}`,onBlur:t=>{let n=Number(t.target.value);if(!Number.isInteger(n)||n<1||n===e.tier){t.target.value=String(e.tier);return}d(e.id,{tier:n})}})}),(0,J.jsx)(H,{$align:`right`,children:(0,J.jsx)(Q,{min:.1,step:.1,defaultValue:e.weight,"aria-label":`Weight for ${e.label}`,onBlur:t=>{let n=Number(t.target.value);if(!Number.isFinite(n)||n<=0||n===e.weight){t.target.value=String(e.weight);return}d(e.id,{weight:n})}})}),(0,J.jsx)(H,{$align:`center`,children:(0,J.jsx)(ee,{checked:e.enabled,label:`Route to ${e.label}`,onCheckedChange:t=>d(e.id,{enabled:t})})}),(0,J.jsx)(H,{children:r.length===0?(0,J.jsx)(n,{children:`unknown`}):(0,J.jsx)(ge,{children:r.map(({window:e,fraction:t})=>(0,J.jsxs)(he,{children:[(0,J.jsx)(ie,{fraction:t,label:`${re[e.windowType]} window, ${Math.round(t*100)}% used`}),(0,J.jsx)(n,{children:k(e,D,F,y)})]},e.windowType))})}),(0,J.jsx)(H,{$align:`right`,$mono:!0,children:b(t.ttftMs)}),(0,J.jsx)(H,{$align:`right`,$mono:!0,children:e.expiresAt===null?`never`:y(e.expiresAt,D)}),(0,J.jsx)(H,{$align:`right`,children:(0,J.jsx)(a,{type:`button`,$variant:`ghost`,$size:`sm`,"aria-label":`Remove ${e.label}`,title:`Remove ${e.label}`,onClick:()=>C(e),children:(0,J.jsx)(E,{})})})]},e.id)})})]})})},t)})}),(0,J.jsx)(ue,{open:m,onOpenChange:g,onConnected:()=>void r.refetch()}),(0,J.jsx)(w,{open:x!==null,onOpenChange:e=>{e||C(null)},title:`Remove account`,body:x===null?``:`Removing "${x.label}" deletes its stored token. Any model target pointing at ${Z[x.provider]} loses this account, and reconnecting means authorizing again.`,confirmLabel:`Remove account`,busy:l.isPending,onConfirm:()=>{x!==null&&l.mutate(x.id,{onSettled:()=>C(null)})}})]})}var ve=_e;export{ve as component};
@@ -1,4 +1,4 @@
1
- import{A as e,B as t,C as n,D as r,Dt as i,E as a,F as o,H as s,M as c,N as l,O as u,h as d,j as f,k as p,m,o as h,s as g,y as _}from"./queries-vY5lJqBe.js";import{a as v,d as y,f as b,l as x,o as S,r as C,s as w,t as T,u as E}from"./Rack-Be09hoVn.js";import{a as D,c as O,i as k,l as ee,n as A,o as j,r as M,s as N,t as P}from"./Lamp-WOotyOTd.js";import{n as F,t as I}from"./Chip-D0YiqYkz.js";import{t as L}from"./Meter-Bm1oQE2U.js";import{a as R,n as z,t as B}from"./States-DPTTYUHL.js";import{i as V,n as H,r as U,t as W}from"./Table-LkPaHBsj.js";import{t as G}from"./Readout-CYg6UOop.js";var K=i(),q=t(l)`
1
+ import{A as e,B as t,C as n,D as r,Dt as i,E as a,F as o,H as s,M as c,N as l,O as u,h as d,j as f,k as p,m,o as h,s as g,y as _}from"./queries-vY5lJqBe.js";import{a as v,d as y,f as b,l as x,o as S,r as C,s as w,t as T,u as E}from"./Rack-uDxrjvaz.js";import{a as D,c as O,i as k,l as ee,n as A,o as j,r as M,s as N,t as P}from"./Lamp-WOotyOTd.js";import{n as F,t as I}from"./Chip-D0YiqYkz.js";import{t as L}from"./Meter-Bm1oQE2U.js";import{a as R,n as z,t as B}from"./States-DPTTYUHL.js";import{i as V,n as H,r as U,t as W}from"./Table-LkPaHBsj.js";import{t as G}from"./Readout-CYg6UOop.js";var K=i(),q=t(l)`
2
2
  font-weight: 500;
3
3
  display: block;
4
4
  max-width: 24ch;
@@ -1,4 +1,4 @@
1
- import{A as e,B as t,D as n,Dt as r,F as i,Kt as a,M as o,N as s,O as c,Ot as l,a as u,d,g as f,h as p,k as m}from"./queries-vY5lJqBe.js";import{c as h,t as g}from"./Rack-Be09hoVn.js";import{t as _}from"./CopyValue-DrPV_Qao.js";import{n as v,r as y,t as b}from"./Toggle-Cd2Jy_Z1.js";import{t as x}from"./Modal-CXsglS9k.js";import{t as S}from"./Chip-D0YiqYkz.js";import{n as C,t as w}from"./Field-DdscQ9OO.js";import{a as T,i as E,n as D,r as O,t as k}from"./States-DPTTYUHL.js";import{i as A,n as j,r as M,t as N}from"./Table-LkPaHBsj.js";var P=a(l(),1),F=r(),I=t.div`
1
+ import{A as e,B as t,D as n,Dt as r,F as i,Kt as a,M as o,N as s,O as c,Ot as l,a as u,d,g as f,h as p,k as m}from"./queries-vY5lJqBe.js";import{c as h,t as g}from"./Rack-uDxrjvaz.js";import{t as _}from"./CopyValue-bzKz2tiJ.js";import{n as v,r as y,t as b}from"./Toggle-D0e4C94X.js";import{t as x}from"./Modal-Crr8uyWt.js";import{t as S}from"./Chip-D0YiqYkz.js";import{n as C,t as w}from"./Field-DdscQ9OO.js";import{a as T,i as E,n as D,r as O,t as k}from"./States-DPTTYUHL.js";import{i as A,n as j,r as M,t as N}from"./Table-LkPaHBsj.js";var P=a(l(),1),F=r(),I=t.div`
2
2
  display: flex;
3
3
  flex-direction: column;
4
4
  gap: 2px;
@@ -1,4 +1,4 @@
1
- import{A as e,B as t,D as n,Dt as r,F as i,Kt as a,M as o,N as s,O as c,Ot as l,k as u,m as d,s as f}from"./queries-vY5lJqBe.js";import{a as p,c as m,f as h,l as g,o as _,p as v,s as y,t as b}from"./Rack-Be09hoVn.js";import{t as x}from"./Modal-CXsglS9k.js";import{o as S,t as C}from"./Lamp-WOotyOTd.js";import{n as w,t as T}from"./Chip-D0YiqYkz.js";import{i as E,n as D}from"./Field-DdscQ9OO.js";import{a as O,n as k,r as A,t as j}from"./States-DPTTYUHL.js";import{i as M,n as N,r as P,t as F}from"./Table-LkPaHBsj.js";var I=a(l(),1),L=r(),R=[50,100,250,500],z=t(u)`
1
+ import{A as e,B as t,D as n,Dt as r,F as i,Kt as a,M as o,N as s,O as c,Ot as l,k as u,m as d,s as f}from"./queries-vY5lJqBe.js";import{a as p,c as m,f as h,l as g,o as _,p as v,s as y,t as b}from"./Rack-uDxrjvaz.js";import{t as x}from"./Modal-Crr8uyWt.js";import{o as S,t as C}from"./Lamp-WOotyOTd.js";import{n as w,t as T}from"./Chip-D0YiqYkz.js";import{i as E,n as D}from"./Field-DdscQ9OO.js";import{a as O,n as k,r as A,t as j}from"./States-DPTTYUHL.js";import{i as M,n as N,r as P,t as F}from"./Table-LkPaHBsj.js";var I=a(l(),1),L=r(),R=[50,100,250,500],z=t(u)`
2
2
  gap: ${({theme:e})=>e.space(2)};
3
3
  flex-wrap: wrap;
4
4
  `,B=t(D)`
@@ -1,4 +1,4 @@
1
- import{B as e,D as t,Dt as n,F as r,I as i,Kt as a,M as o,N as s,O as c,Ot as l,_ as u,h as d,j as f,k as p,l as m,u as h,y as g}from"./queries-vY5lJqBe.js";import{m as _,t as v}from"./Rack-Be09hoVn.js";import{n as y,r as b,t as x}from"./Toggle-Cd2Jy_Z1.js";import{n as S,r as C,t as w}from"./catalog-B1clfKRA.js";import{n as ee,t as T}from"./Chip-D0YiqYkz.js";import{i as E,n as D,r as O,t as k}from"./Field-DdscQ9OO.js";import{t as te}from"./Meter-Bm1oQE2U.js";import{a as A,i as j,n as ne,r as M,t as N}from"./States-DPTTYUHL.js";var re=_(`play`,[[`path`,{d:`M5 5a2 2 0 0 1 3.008-1.728l11.997 6.998a2 2 0 0 1 .003 3.458l-12 7A2 2 0 0 1 5 19z`,key:`10ikf1`}]]),P=_(`rotate-ccw`,[[`path`,{d:`M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8`,key:`1357e3`}],[`path`,{d:`M3 3v5h5`,key:`1xhq8a`}]]),F=a(l(),1),I=n(),L=[`tier`,`health`,`quota`,`cost`,`latency`,`recency`],ie={tier:`How preferred this tier is`,health:`Consecutive failures and breaker state`,quota:`Headroom in the tightest window, against how much of it is left`,cost:`Price against the other candidates`,latency:`Observed time to first token`,recency:`How long this pair has been idle`},ae=e.li`
1
+ import{B as e,D as t,Dt as n,F as r,I as i,Kt as a,M as o,N as s,O as c,Ot as l,_ as u,h as d,j as f,k as p,l as m,u as h,y as g}from"./queries-vY5lJqBe.js";import{m as _,t as v}from"./Rack-uDxrjvaz.js";import{n as y,r as b,t as x}from"./Toggle-D0e4C94X.js";import{t as S}from"./trash-2-Cep_aVLx.js";import{n as C,t as w}from"./Chip-D0YiqYkz.js";import{i as T,n as E,r as D,t as O}from"./Field-DdscQ9OO.js";import{t as ee}from"./Meter-Bm1oQE2U.js";import{a as k,i as A,n as te,r as j,t as M}from"./States-DPTTYUHL.js";import{n as ne,t as N}from"./catalog-DVRPlBJJ.js";var re=_(`play`,[[`path`,{d:`M5 5a2 2 0 0 1 3.008-1.728l11.997 6.998a2 2 0 0 1 .003 3.458l-12 7A2 2 0 0 1 5 19z`,key:`10ikf1`}]]),P=_(`rotate-ccw`,[[`path`,{d:`M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8`,key:`1357e3`}],[`path`,{d:`M3 3v5h5`,key:`1xhq8a`}]]),F=a(l(),1),I=n(),L=[`tier`,`health`,`quota`,`cost`,`latency`,`recency`],ie={tier:`How preferred this tier is`,health:`Consecutive failures and breaker state`,quota:`Headroom in the tightest window, against how much of it is left`,cost:`Price against the other candidates`,latency:`Observed time to first token`,recency:`How long this pair has been idle`},ae=e.li`
2
2
  padding: ${({theme:e})=>e.space(2)} 0;
3
3
  border-bottom: 1px solid ${({theme:e})=>e.color.rule};
4
4
 
@@ -9,7 +9,7 @@ import{B as e,D as t,Dt as n,F as r,I as i,Kt as a,M as o,N as s,O as c,Ot as l,
9
9
  width: 22px;
10
10
  color: ${({theme:e})=>e.color.inkFaint};
11
11
  flex: none;
12
- `,se=e(T)`
12
+ `,se=e(w)`
13
13
  border-color: ${({theme:e})=>e.color.ok};
14
14
  color: ${({theme:e})=>e.color.ok};
15
15
  background: ${({theme:e})=>e.color.okWash};
@@ -46,7 +46,7 @@ import{B as e,D as t,Dt as n,F as r,I as i,Kt as a,M as o,N as s,O as c,Ot as l,
46
46
  `,z=e.p`
47
47
  font-size: 12px;
48
48
  color: ${({theme:e})=>e.color.down};
49
- `;function B(e,t,n){return(e[t]??0)*n[t]}function V({modelId:e}){let[n,i]=(0,F.useState)({tools:!1,images:!1,reasoning:!1}),[a,l]=(0,F.useState)(null),[u,d]=(0,F.useState)(null),m=g(),_=h(),v=m.data?.weights,y=()=>{e!==null&&(d(null),_.mutate({modelId:e,need:n},{onSuccess:e=>l(e),onError:e=>{l(null),d(j(e))}}))},b=new Map(L.map(e=>[e,Math.max(1e-4,...(a?.candidates??[]).map(t=>v===void 0?0:Math.abs(B(t.reasons,e,v))))]));return(0,I.jsx)(A,{legend:`Explain`,meta:e??`no model selected`,actions:(0,I.jsxs)(r,{type:`button`,$size:`sm`,$variant:`primary`,disabled:e===null||_.isPending,onClick:y,children:[(0,I.jsx)(re,{}),_.isPending?`Ranking…`:`Rank candidates`]}),children:(0,I.jsxs)(o,{$gap:3,children:[(0,I.jsxs)(o,{$gap:1,children:[(0,I.jsx)(t,{children:`Pretend the request needs`}),(0,I.jsxs)(fe,{children:[(0,I.jsxs)(R,{children:[(0,I.jsx)(x,{checked:n.tools,label:`Probe request uses tools`,onCheckedChange:e=>i({...n,tools:e})}),`Tools`]}),(0,I.jsxs)(R,{children:[(0,I.jsx)(x,{checked:n.images,label:`Probe request includes an image`,onCheckedChange:e=>i({...n,images:e})}),`Images`]}),(0,I.jsxs)(R,{children:[(0,I.jsx)(x,{checked:n.reasoning,label:`Probe request asks for reasoning`,onCheckedChange:e=>i({...n,reasoning:e})}),`Reasoning`]})]})]}),u===null?null:(0,I.jsx)(z,{children:u}),a===null?(0,I.jsx)(N,{legend:`Not ranked yet`,message:e===null?`Select a model to see which account the router would pick for it.`:`Run the ranking to see which account wins, by how much, and what was filtered out.`}):(0,I.jsxs)(o,{$gap:3,children:[(0,I.jsxs)(p,{$gap:2,$wrap:!0,children:[(0,I.jsx)(T,{$tone:`accent`,children:a.strategy}),a.deterministic?null:(0,I.jsx)(T,{$tone:`warn`,children:`order varies per request`}),(0,I.jsx)(f,{}),(0,I.jsxs)(t,{children:[a.candidates.length,` eligible · `,a.excluded.length,` filtered out`]})]}),a.candidates.length===0?(0,I.jsx)(N,{legend:`Nothing eligible`,message:`Every target was filtered out. The reasons below say which rule removed each one.`}):(0,I.jsx)(`ul`,{children:a.candidates.map((e,n)=>(0,I.jsxs)(ae,{children:[(0,I.jsxs)(p,{$gap:2,children:[(0,I.jsx)(oe,{children:n+1}),(0,I.jsx)(ee,{provider:e.provider}),(0,I.jsx)(s,{style:{maxWidth:`22ch`},children:e.credentialLabel}),(0,I.jsx)(c,{$dim:!0,children:e.model}),(0,I.jsxs)(T,{children:[`tier `,e.tier]}),(0,I.jsx)(f,{}),n===0?(0,I.jsx)(se,{children:`would be used`}):null,(0,I.jsx)(c,{children:e.score.toFixed(2)})]}),v===void 0?null:(0,I.jsx)(ce,{children:L.map(n=>{let r=B(e.reasons,n,v),i=b.get(n)??1;return(0,I.jsxs)(le,{title:ie[n],children:[(0,I.jsxs)(ue,{children:[(0,I.jsx)(t,{children:n}),(0,I.jsx)(c,{$dim:!0,$size:`10.5px`,children:r.toFixed(2)})]}),(0,I.jsx)(te,{fraction:Math.abs(r)/i,height:4,tone:`var(--accent)`,label:`${n} contributes ${r.toFixed(2)} of ${e.score.toFixed(2)}`})]},n)})})]},`${e.credentialId}:${e.model}`))}),a.excluded.length===0?null:(0,I.jsxs)(o,{$gap:1,children:[(0,I.jsx)(t,{children:`Filtered out`}),(0,I.jsx)(`ul`,{children:a.excluded.map(e=>(0,I.jsxs)(de,{children:[(0,I.jsx)(c,{$dim:!0,children:e.model}),(0,I.jsx)(f,{}),(0,I.jsx)(T,{$tone:e.reason.startsWith(`capability`)?`warn`:`down`,children:e.reason})]},`${e.credentialId}:${e.model}:${e.reason}`))})]})]})]})})}var H=[{id:`score`,label:`Best score`,blurb:`Rank every eligible target by the routing weights and take the best one.`},{id:`priority`,label:`Lowest tier`,blurb:`Always prefer the lowest tier. Score only breaks ties inside a tier.`},{id:`roundRobin`,label:`Round robin`,blurb:`Take whichever eligible target has been idle longest, to spread load evenly.`},{id:`weighted`,label:`Weighted draw`,blurb:`Pick at random, biased by weight. The order differs from request to request.`}],U=0;function W(){return U+=1,`target-${U}`}function G(e,t){let n=S(e,t);return n===null?null:{costInput:String(n.input),costOutput:String(n.output),costCacheRead:String(n.cacheRead)}}function K(e=`anthropic`){let t=w[e].defaultModel,n=G(e,t);return{key:W(),provider:e,model:t,tier:`1`,weight:`1`,costInput:n?.costInput??`0`,costOutput:n?.costOutput??`0`,costCacheRead:n?.costCacheRead??``,tools:!0,images:!0,reasoning:!0}}function q(){return{id:``,strategy:`score`,isAlias:!1,targets:[K()]}}function J(e){return{id:e.id,strategy:e.strategy,isAlias:e.isAlias,targets:e.targets.map(e=>({key:W(),provider:e.provider,model:e.model,tier:String(e.tier),weight:String(e.weight),costInput:String(e.costPerMTok.input),costOutput:String(e.costPerMTok.output),costCacheRead:e.costPerMTok.cacheRead===void 0?``:String(e.costPerMTok.cacheRead),tools:e.capabilities.tools,images:e.capabilities.images,reasoning:e.capabilities.reasoning}))}}function pe(e){let t=e.id.trim();if(t.length===0)return{ok:!1,problem:`Give the model a name clients will ask for.`};if(e.targets.length===0)return{ok:!1,problem:`A model needs at least one target to route to.`};let n=[];for(let[t,r]of e.targets.entries()){let e=`Target ${t+1}`,i=r.model.trim();if(i.length===0)return{ok:!1,problem:`${e} needs a provider model name.`};let a=Number(r.tier);if(!Number.isInteger(a)||a<1)return{ok:!1,problem:`${e}: tier must be a whole number of 1 or more.`};let o=Number(r.weight);if(!Number.isFinite(o)||o<=0)return{ok:!1,problem:`${e}: weight must be greater than zero.`};let s=Number(r.costInput),c=Number(r.costOutput);if(!Number.isFinite(s)||s<0||!Number.isFinite(c)||c<0)return{ok:!1,problem:`${e}: prices cannot be negative.`};let l=r.costCacheRead.trim().length>0,u=Number(r.costCacheRead);if(l&&(!Number.isFinite(u)||u<0))return{ok:!1,problem:`${e}: the cache-read price cannot be negative.`};n.push({provider:r.provider,model:i,tier:a,weight:o,costPerMTok:{input:s,output:c,...l?{cacheRead:u}:{}},capabilities:{tools:r.tools,images:r.images,reasoning:r.reasoning}})}return{ok:!0,model:{id:t,strategy:e.strategy,isAlias:e.isAlias,targets:n}}}var me=Object.keys(w),he=e.fieldset`
49
+ `;function B(e,t,n){return(e[t]??0)*n[t]}function V({modelId:e}){let[n,i]=(0,F.useState)({tools:!1,images:!1,reasoning:!1}),[a,l]=(0,F.useState)(null),[u,d]=(0,F.useState)(null),m=g(),_=h(),v=m.data?.weights,y=()=>{e!==null&&(d(null),_.mutate({modelId:e,need:n},{onSuccess:e=>l(e),onError:e=>{l(null),d(A(e))}}))},b=new Map(L.map(e=>[e,Math.max(1e-4,...(a?.candidates??[]).map(t=>v===void 0?0:Math.abs(B(t.reasons,e,v))))]));return(0,I.jsx)(k,{legend:`Explain`,meta:e??`no model selected`,actions:(0,I.jsxs)(r,{type:`button`,$size:`sm`,$variant:`primary`,disabled:e===null||_.isPending,onClick:y,children:[(0,I.jsx)(re,{}),_.isPending?`Ranking…`:`Rank candidates`]}),children:(0,I.jsxs)(o,{$gap:3,children:[(0,I.jsxs)(o,{$gap:1,children:[(0,I.jsx)(t,{children:`Pretend the request needs`}),(0,I.jsxs)(fe,{children:[(0,I.jsxs)(R,{children:[(0,I.jsx)(x,{checked:n.tools,label:`Probe request uses tools`,onCheckedChange:e=>i({...n,tools:e})}),`Tools`]}),(0,I.jsxs)(R,{children:[(0,I.jsx)(x,{checked:n.images,label:`Probe request includes an image`,onCheckedChange:e=>i({...n,images:e})}),`Images`]}),(0,I.jsxs)(R,{children:[(0,I.jsx)(x,{checked:n.reasoning,label:`Probe request asks for reasoning`,onCheckedChange:e=>i({...n,reasoning:e})}),`Reasoning`]})]})]}),u===null?null:(0,I.jsx)(z,{children:u}),a===null?(0,I.jsx)(M,{legend:`Not ranked yet`,message:e===null?`Select a model to see which account the router would pick for it.`:`Run the ranking to see which account wins, by how much, and what was filtered out.`}):(0,I.jsxs)(o,{$gap:3,children:[(0,I.jsxs)(p,{$gap:2,$wrap:!0,children:[(0,I.jsx)(w,{$tone:`accent`,children:a.strategy}),a.deterministic?null:(0,I.jsx)(w,{$tone:`warn`,children:`order varies per request`}),(0,I.jsx)(f,{}),(0,I.jsxs)(t,{children:[a.candidates.length,` eligible · `,a.excluded.length,` filtered out`]})]}),a.candidates.length===0?(0,I.jsx)(M,{legend:`Nothing eligible`,message:`Every target was filtered out. The reasons below say which rule removed each one.`}):(0,I.jsx)(`ul`,{children:a.candidates.map((e,n)=>(0,I.jsxs)(ae,{children:[(0,I.jsxs)(p,{$gap:2,children:[(0,I.jsx)(oe,{children:n+1}),(0,I.jsx)(C,{provider:e.provider}),(0,I.jsx)(s,{style:{maxWidth:`22ch`},children:e.credentialLabel}),(0,I.jsx)(c,{$dim:!0,children:e.model}),(0,I.jsxs)(w,{children:[`tier `,e.tier]}),(0,I.jsx)(f,{}),n===0?(0,I.jsx)(se,{children:`would be used`}):null,(0,I.jsx)(c,{children:e.score.toFixed(2)})]}),v===void 0?null:(0,I.jsx)(ce,{children:L.map(n=>{let r=B(e.reasons,n,v),i=b.get(n)??1;return(0,I.jsxs)(le,{title:ie[n],children:[(0,I.jsxs)(ue,{children:[(0,I.jsx)(t,{children:n}),(0,I.jsx)(c,{$dim:!0,$size:`10.5px`,children:r.toFixed(2)})]}),(0,I.jsx)(ee,{fraction:Math.abs(r)/i,height:4,tone:`var(--accent)`,label:`${n} contributes ${r.toFixed(2)} of ${e.score.toFixed(2)}`})]},n)})})]},`${e.credentialId}:${e.model}`))}),a.excluded.length===0?null:(0,I.jsxs)(o,{$gap:1,children:[(0,I.jsx)(t,{children:`Filtered out`}),(0,I.jsx)(`ul`,{children:a.excluded.map(e=>(0,I.jsxs)(de,{children:[(0,I.jsx)(c,{$dim:!0,children:e.model}),(0,I.jsx)(f,{}),(0,I.jsx)(w,{$tone:e.reason.startsWith(`capability`)?`warn`:`down`,children:e.reason})]},`${e.credentialId}:${e.model}:${e.reason}`))})]})]})]})})}var H=[{id:`score`,label:`Best score`,blurb:`Rank every eligible target by the routing weights and take the best one.`},{id:`priority`,label:`Lowest tier`,blurb:`Always prefer the lowest tier. Score only breaks ties inside a tier.`},{id:`roundRobin`,label:`Round robin`,blurb:`Take whichever eligible target has been idle longest, to spread load evenly.`},{id:`weighted`,label:`Weighted draw`,blurb:`Pick at random, biased by weight. The order differs from request to request.`}],U=0;function W(){return U+=1,`target-${U}`}function G(e,t){let n=ne(e,t);return n===null?null:{costInput:String(n.input),costOutput:String(n.output),costCacheRead:String(n.cacheRead)}}function K(e=`anthropic`){let t=N[e].defaultModel,n=G(e,t);return{key:W(),provider:e,model:t,tier:`1`,weight:`1`,costInput:n?.costInput??`0`,costOutput:n?.costOutput??`0`,costCacheRead:n?.costCacheRead??``,tools:!0,images:!0,reasoning:!0}}function q(){return{id:``,strategy:`score`,isAlias:!1,targets:[K()]}}function J(e){return{id:e.id,strategy:e.strategy,isAlias:e.isAlias,targets:e.targets.map(e=>({key:W(),provider:e.provider,model:e.model,tier:String(e.tier),weight:String(e.weight),costInput:String(e.costPerMTok.input),costOutput:String(e.costPerMTok.output),costCacheRead:e.costPerMTok.cacheRead===void 0?``:String(e.costPerMTok.cacheRead),tools:e.capabilities.tools,images:e.capabilities.images,reasoning:e.capabilities.reasoning}))}}function pe(e){let t=e.id.trim();if(t.length===0)return{ok:!1,problem:`Give the model a name clients will ask for.`};if(e.targets.length===0)return{ok:!1,problem:`A model needs at least one target to route to.`};let n=[];for(let[t,r]of e.targets.entries()){let e=`Target ${t+1}`,i=r.model.trim();if(i.length===0)return{ok:!1,problem:`${e} needs a provider model name.`};let a=Number(r.tier);if(!Number.isInteger(a)||a<1)return{ok:!1,problem:`${e}: tier must be a whole number of 1 or more.`};let o=Number(r.weight);if(!Number.isFinite(o)||o<=0)return{ok:!1,problem:`${e}: weight must be greater than zero.`};let s=Number(r.costInput),c=Number(r.costOutput);if(!Number.isFinite(s)||s<0||!Number.isFinite(c)||c<0)return{ok:!1,problem:`${e}: prices cannot be negative.`};let l=r.costCacheRead.trim().length>0,u=Number(r.costCacheRead);if(l&&(!Number.isFinite(u)||u<0))return{ok:!1,problem:`${e}: the cache-read price cannot be negative.`};n.push({provider:r.provider,model:i,tier:a,weight:o,costPerMTok:{input:s,output:c,...l?{cacheRead:u}:{}},capabilities:{tools:r.tools,images:r.images,reasoning:r.reasoning}})}return{ok:!0,model:{id:t,strategy:e.strategy,isAlias:e.isAlias,targets:n}}}var me=Object.keys(N),he=e.fieldset`
50
50
  border: 1px solid ${({theme:e})=>e.color.rule};
51
51
  border-left: 3px solid ${({theme:e,$provider:t})=>e.provider[t]};
52
52
  border-radius: ${({theme:e})=>e.radius.control};
@@ -84,7 +84,7 @@ import{B as e,D as t,Dt as n,F as r,I as i,Kt as a,M as o,N as s,O as c,Ot as l,
84
84
  align-items: center;
85
85
  gap: 6px;
86
86
  cursor: pointer;
87
- `;function ye({target:e,index:n,onChange:a,onRemove:s,removable:c}){let l=(0,F.useId)(),u=w[e.provider],d=(t,n)=>{a({...e,[t]:n})},m=G(e.provider,e.model),h=t=>{a({...e,...t,...G(t.provider,t.model)??{}})};return(0,I.jsxs)(he,{$provider:e.provider,children:[(0,I.jsxs)(p,{$gap:2,children:[(0,I.jsxs)(t,{as:`legend`,children:[`Target `,n+1]}),(0,I.jsx)(f,{}),(0,I.jsx)(i,{type:`button`,$variant:`ghost`,$size:`sm`,disabled:!c,"aria-label":`Remove target ${n+1}`,title:c?`Remove target ${n+1}`:`A model needs at least one target`,onClick:s,children:(0,I.jsx)(C,{})})]}),(0,I.jsxs)(ge,{children:[(0,I.jsxs)(Y,{children:[(0,I.jsx)(t,{as:`label`,htmlFor:`${l}-provider`,children:`Provider`}),(0,I.jsx)(E,{id:`${l}-provider`,value:e.provider,onChange:t=>{let n=t.target.value,r=w[n].models.some(t=>t.id===e.model);h({provider:n,model:r?e.model:w[n].defaultModel})},children:me.map(e=>(0,I.jsx)(`option`,{value:e,children:e},e))})]}),(0,I.jsxs)(Y,{children:[(0,I.jsx)(t,{as:`label`,htmlFor:`${l}-model`,children:`Provider model`}),(0,I.jsx)(D,{id:`${l}-model`,list:`${l}-catalog`,value:e.model,placeholder:u.defaultModel,onChange:t=>h({provider:e.provider,model:t.target.value})}),(0,I.jsx)(`datalist`,{id:`${l}-catalog`,children:u.models.map(e=>(0,I.jsx)(`option`,{value:e.id,children:e.label},e.id))})]}),(0,I.jsxs)(Y,{children:[(0,I.jsx)(t,{as:`label`,htmlFor:`${l}-tier`,children:`Tier`}),(0,I.jsx)(O,{id:`${l}-tier`,min:1,step:1,value:e.tier,onChange:e=>d(`tier`,e.target.value)})]}),(0,I.jsxs)(Y,{children:[(0,I.jsx)(t,{as:`label`,htmlFor:`${l}-weight`,children:`Weight`}),(0,I.jsx)(O,{id:`${l}-weight`,min:0,step:.1,value:e.weight,onChange:e=>d(`weight`,e.target.value)})]})]}),(0,I.jsxs)(o,{$gap:1,children:[(0,I.jsxs)(p,{$gap:2,children:[(0,I.jsx)(t,{children:`Price per million tokens`}),(0,I.jsx)(f,{}),m===null?(0,I.jsx)(t,{as:`span`,children:`not in the catalog — price it yourself`}):(0,I.jsxs)(r,{type:`button`,$size:`sm`,$variant:`ghost`,disabled:e.costInput===m.costInput&&e.costOutput===m.costOutput&&e.costCacheRead===m.costCacheRead,onClick:()=>a({...e,...m}),children:[(0,I.jsx)(P,{}),`Use list price`]})]}),(0,I.jsxs)(_e,{children:[(0,I.jsxs)(Y,{children:[(0,I.jsx)(t,{as:`label`,htmlFor:`${l}-in`,children:`Input`}),(0,I.jsx)(O,{id:`${l}-in`,min:0,step:.01,value:e.costInput,onChange:e=>d(`costInput`,e.target.value)})]}),(0,I.jsxs)(Y,{children:[(0,I.jsx)(t,{as:`label`,htmlFor:`${l}-out`,children:`Output`}),(0,I.jsx)(O,{id:`${l}-out`,min:0,step:.01,value:e.costOutput,onChange:e=>d(`costOutput`,e.target.value)})]}),(0,I.jsxs)(Y,{children:[(0,I.jsx)(t,{as:`label`,htmlFor:`${l}-cache`,children:`Cache read`}),(0,I.jsx)(O,{id:`${l}-cache`,min:0,step:.01,placeholder:`same as input`,value:e.costCacheRead,onChange:e=>d(`costCacheRead`,e.target.value)})]})]})]}),(0,I.jsxs)(o,{$gap:1,children:[(0,I.jsx)(t,{children:`Capabilities`}),(0,I.jsxs)(ve,{children:[(0,I.jsxs)(X,{children:[(0,I.jsx)(x,{checked:e.tools,label:`Target ${n+1} supports tools`,onCheckedChange:e=>d(`tools`,e)}),`Tools`]}),(0,I.jsxs)(X,{children:[(0,I.jsx)(x,{checked:e.images,label:`Target ${n+1} supports images`,onCheckedChange:e=>d(`images`,e)}),`Images`]}),(0,I.jsxs)(X,{children:[(0,I.jsx)(x,{checked:e.reasoning,label:`Target ${n+1} supports reasoning`,onCheckedChange:e=>d(`reasoning`,e)}),`Reasoning`]})]})]})]})}var Z=e.p`
87
+ `;function ye({target:e,index:n,onChange:a,onRemove:s,removable:c}){let l=(0,F.useId)(),u=N[e.provider],d=(t,n)=>{a({...e,[t]:n})},m=G(e.provider,e.model),h=t=>{a({...e,...t,...G(t.provider,t.model)??{}})};return(0,I.jsxs)(he,{$provider:e.provider,children:[(0,I.jsxs)(p,{$gap:2,children:[(0,I.jsxs)(t,{as:`legend`,children:[`Target `,n+1]}),(0,I.jsx)(f,{}),(0,I.jsx)(i,{type:`button`,$variant:`ghost`,$size:`sm`,disabled:!c,"aria-label":`Remove target ${n+1}`,title:c?`Remove target ${n+1}`:`A model needs at least one target`,onClick:s,children:(0,I.jsx)(S,{})})]}),(0,I.jsxs)(ge,{children:[(0,I.jsxs)(Y,{children:[(0,I.jsx)(t,{as:`label`,htmlFor:`${l}-provider`,children:`Provider`}),(0,I.jsx)(T,{id:`${l}-provider`,value:e.provider,onChange:t=>{let n=t.target.value,r=N[n].models.some(t=>t.id===e.model);h({provider:n,model:r?e.model:N[n].defaultModel})},children:me.map(e=>(0,I.jsx)(`option`,{value:e,children:e},e))})]}),(0,I.jsxs)(Y,{children:[(0,I.jsx)(t,{as:`label`,htmlFor:`${l}-model`,children:`Provider model`}),(0,I.jsx)(E,{id:`${l}-model`,list:`${l}-catalog`,value:e.model,placeholder:u.defaultModel,onChange:t=>h({provider:e.provider,model:t.target.value})}),(0,I.jsx)(`datalist`,{id:`${l}-catalog`,children:u.models.map(e=>(0,I.jsx)(`option`,{value:e.id,children:e.label},e.id))})]}),(0,I.jsxs)(Y,{children:[(0,I.jsx)(t,{as:`label`,htmlFor:`${l}-tier`,children:`Tier`}),(0,I.jsx)(D,{id:`${l}-tier`,min:1,step:1,value:e.tier,onChange:e=>d(`tier`,e.target.value)})]}),(0,I.jsxs)(Y,{children:[(0,I.jsx)(t,{as:`label`,htmlFor:`${l}-weight`,children:`Weight`}),(0,I.jsx)(D,{id:`${l}-weight`,min:0,step:.1,value:e.weight,onChange:e=>d(`weight`,e.target.value)})]})]}),(0,I.jsxs)(o,{$gap:1,children:[(0,I.jsxs)(p,{$gap:2,children:[(0,I.jsx)(t,{children:`Price per million tokens`}),(0,I.jsx)(f,{}),m===null?(0,I.jsx)(t,{as:`span`,children:`not in the catalog — price it yourself`}):(0,I.jsxs)(r,{type:`button`,$size:`sm`,$variant:`ghost`,disabled:e.costInput===m.costInput&&e.costOutput===m.costOutput&&e.costCacheRead===m.costCacheRead,onClick:()=>a({...e,...m}),children:[(0,I.jsx)(P,{}),`Use list price`]})]}),(0,I.jsxs)(_e,{children:[(0,I.jsxs)(Y,{children:[(0,I.jsx)(t,{as:`label`,htmlFor:`${l}-in`,children:`Input`}),(0,I.jsx)(D,{id:`${l}-in`,min:0,step:.01,value:e.costInput,onChange:e=>d(`costInput`,e.target.value)})]}),(0,I.jsxs)(Y,{children:[(0,I.jsx)(t,{as:`label`,htmlFor:`${l}-out`,children:`Output`}),(0,I.jsx)(D,{id:`${l}-out`,min:0,step:.01,value:e.costOutput,onChange:e=>d(`costOutput`,e.target.value)})]}),(0,I.jsxs)(Y,{children:[(0,I.jsx)(t,{as:`label`,htmlFor:`${l}-cache`,children:`Cache read`}),(0,I.jsx)(D,{id:`${l}-cache`,min:0,step:.01,placeholder:`same as input`,value:e.costCacheRead,onChange:e=>d(`costCacheRead`,e.target.value)})]})]})]}),(0,I.jsxs)(o,{$gap:1,children:[(0,I.jsx)(t,{children:`Capabilities`}),(0,I.jsxs)(ve,{children:[(0,I.jsxs)(X,{children:[(0,I.jsx)(x,{checked:e.tools,label:`Target ${n+1} supports tools`,onCheckedChange:e=>d(`tools`,e)}),`Tools`]}),(0,I.jsxs)(X,{children:[(0,I.jsx)(x,{checked:e.images,label:`Target ${n+1} supports images`,onCheckedChange:e=>d(`images`,e)}),`Images`]}),(0,I.jsxs)(X,{children:[(0,I.jsx)(x,{checked:e.reasoning,label:`Target ${n+1} supports reasoning`,onCheckedChange:e=>d(`reasoning`,e)}),`Reasoning`]})]})]})]})}var Z=e.p`
88
88
  font-size: 11.5px;
89
89
  color: ${({theme:e})=>e.color.inkDim};
90
90
  `,be=e.p`
@@ -95,7 +95,7 @@ import{B as e,D as t,Dt as n,F as r,I as i,Kt as a,M as o,N as s,O as c,Ot as l,
95
95
  color: ${({theme:e})=>e.color.ok};
96
96
  `,Q=e(p)`
97
97
  gap: 8px;
98
- `;function Se({model:e,onSaved:n,onDeleted:i}){let[a,s]=(0,F.useState)(()=>e===null?q():J(e)),[c,l]=(0,F.useState)(null),[d,h]=(0,F.useState)(!1),[g,_]=(0,F.useState)(!1),v=u(),S=m(),C=e?.id??null;(0,F.useEffect)(()=>{s(e===null?q():J(e)),l(null),h(!1)},[C]);let w=H.find(e=>e.id===a.strategy);return(0,I.jsxs)(I.Fragment,{children:[(0,I.jsx)(A,{legend:e===null?`New model`:`Edit model`,meta:e===null?void 0:e.id,actions:(0,I.jsxs)(I.Fragment,{children:[e===null?null:(0,I.jsx)(r,{type:`button`,$variant:`danger`,$size:`sm`,onClick:()=>_(!0),children:`Delete`}),(0,I.jsx)(r,{type:`button`,$variant:`primary`,$size:`sm`,disabled:v.isPending,onClick:()=>{h(!1);let e=pe(a);if(!e.ok){l(e.problem);return}l(null),v.mutate(e.model,{onSuccess:()=>{h(!0),n(e.model.id)},onError:e=>l(j(e))})},children:v.isPending?`Saving…`:e===null?`Create model`:`Save changes`})]}),children:(0,I.jsxs)(o,{$gap:3,children:[(0,I.jsx)(k,{label:`Model name`,hint:e===null?`What clients send as the model. Anything not listed here is rejected.`:`Fixed once created. To rename, create a model under the new name and delete this one.`,children:t=>(0,I.jsx)(D,{...t,value:a.id,disabled:e!==null,placeholder:`fast`,onChange:e=>s({...a,id:e.target.value})})}),(0,I.jsx)(k,{label:`Routing strategy`,children:e=>(0,I.jsx)(E,{...e,value:a.strategy,onChange:e=>s({...a,strategy:e.target.value}),children:H.map(e=>(0,I.jsx)(`option`,{value:e.id,children:e.label},e.id))})}),w===void 0?null:(0,I.jsx)(Z,{children:w.blurb}),(0,I.jsxs)(Q,{children:[(0,I.jsx)(x,{checked:a.isAlias,label:`This model is an alias for a provider model name`,onCheckedChange:e=>s({...a,isAlias:e})}),(0,I.jsxs)(o,{$gap:0,children:[(0,I.jsx)(t,{as:`span`,children:`Alias`}),(0,I.jsx)(Z,{children:`Mark this when the name mirrors a provider's own model name.`})]})]}),(0,I.jsxs)(o,{$gap:2,children:[(0,I.jsxs)(p,{children:[(0,I.jsx)(t,{children:`Targets`}),(0,I.jsx)(f,{}),(0,I.jsxs)(r,{type:`button`,$size:`sm`,onClick:()=>s({...a,targets:[...a.targets,K(a.targets.at(-1)?.provider??`anthropic`)]}),children:[(0,I.jsx)(b,{}),`Add target`]})]}),a.targets.map((e,t)=>(0,I.jsx)(ye,{target:e,index:t,removable:a.targets.length>1,onChange:t=>s({...a,targets:a.targets.map(n=>n.key===e.key?t:n)}),onRemove:()=>s({...a,targets:a.targets.filter(t=>t.key!==e.key)})},e.key))]}),c===null?null:(0,I.jsx)(be,{role:`alert`,children:c}),d&&c===null?(0,I.jsx)(xe,{role:`status`,children:`Saved.`}):null]})}),(0,I.jsx)(y,{open:g,onOpenChange:_,title:`Delete model`,body:e===null?``:`Deleting "${e.id}" makes it unroutable. Clients asking for it will get a model-unavailable error, and any key allowlisting it keeps a name that no longer resolves.`,confirmLabel:`Delete model`,busy:S.isPending,onConfirm:()=>{e!==null&&S.mutate(e.id,{onSuccess:()=>{_(!1),i()},onError:e=>{_(!1),l(j(e))}})}})]})}var Ce=e.div`
98
+ `;function Se({model:e,onSaved:n,onDeleted:i}){let[a,s]=(0,F.useState)(()=>e===null?q():J(e)),[c,l]=(0,F.useState)(null),[d,h]=(0,F.useState)(!1),[g,_]=(0,F.useState)(!1),v=u(),S=m(),C=e?.id??null;(0,F.useEffect)(()=>{s(e===null?q():J(e)),l(null),h(!1)},[C]);let w=H.find(e=>e.id===a.strategy);return(0,I.jsxs)(I.Fragment,{children:[(0,I.jsx)(k,{legend:e===null?`New model`:`Edit model`,meta:e===null?void 0:e.id,actions:(0,I.jsxs)(I.Fragment,{children:[e===null?null:(0,I.jsx)(r,{type:`button`,$variant:`danger`,$size:`sm`,onClick:()=>_(!0),children:`Delete`}),(0,I.jsx)(r,{type:`button`,$variant:`primary`,$size:`sm`,disabled:v.isPending,onClick:()=>{h(!1);let e=pe(a);if(!e.ok){l(e.problem);return}l(null),v.mutate(e.model,{onSuccess:()=>{h(!0),n(e.model.id)},onError:e=>l(A(e))})},children:v.isPending?`Saving…`:e===null?`Create model`:`Save changes`})]}),children:(0,I.jsxs)(o,{$gap:3,children:[(0,I.jsx)(O,{label:`Model name`,hint:e===null?`What clients send as the model. Anything not listed here is rejected.`:`Fixed once created. To rename, create a model under the new name and delete this one.`,children:t=>(0,I.jsx)(E,{...t,value:a.id,disabled:e!==null,placeholder:`fast`,onChange:e=>s({...a,id:e.target.value})})}),(0,I.jsx)(O,{label:`Routing strategy`,children:e=>(0,I.jsx)(T,{...e,value:a.strategy,onChange:e=>s({...a,strategy:e.target.value}),children:H.map(e=>(0,I.jsx)(`option`,{value:e.id,children:e.label},e.id))})}),w===void 0?null:(0,I.jsx)(Z,{children:w.blurb}),(0,I.jsxs)(Q,{children:[(0,I.jsx)(x,{checked:a.isAlias,label:`This model is an alias for a provider model name`,onCheckedChange:e=>s({...a,isAlias:e})}),(0,I.jsxs)(o,{$gap:0,children:[(0,I.jsx)(t,{as:`span`,children:`Alias`}),(0,I.jsx)(Z,{children:`Mark this when the name mirrors a provider's own model name.`})]})]}),(0,I.jsxs)(o,{$gap:2,children:[(0,I.jsxs)(p,{children:[(0,I.jsx)(t,{children:`Targets`}),(0,I.jsx)(f,{}),(0,I.jsxs)(r,{type:`button`,$size:`sm`,onClick:()=>s({...a,targets:[...a.targets,K(a.targets.at(-1)?.provider??`anthropic`)]}),children:[(0,I.jsx)(b,{}),`Add target`]})]}),a.targets.map((e,t)=>(0,I.jsx)(ye,{target:e,index:t,removable:a.targets.length>1,onChange:t=>s({...a,targets:a.targets.map(n=>n.key===e.key?t:n)}),onRemove:()=>s({...a,targets:a.targets.filter(t=>t.key!==e.key)})},e.key))]}),c===null?null:(0,I.jsx)(be,{role:`alert`,children:c}),d&&c===null?(0,I.jsx)(xe,{role:`status`,children:`Saved.`}):null]})}),(0,I.jsx)(y,{open:g,onOpenChange:_,title:`Delete model`,body:e===null?``:`Deleting "${e.id}" makes it unroutable. Clients asking for it will get a model-unavailable error, and any key allowlisting it keeps a name that no longer resolves.`,confirmLabel:`Delete model`,busy:S.isPending,onConfirm:()=>{e!==null&&S.mutate(e.id,{onSuccess:()=>{_(!1),i()},onError:e=>{_(!1),l(A(e))}})}})]})}var Ce=e.div`
99
99
  display: grid;
100
100
  grid-template-columns: minmax(230px, 300px) minmax(0, 1fr);
101
101
  gap: ${({theme:e})=>e.space(4)};
@@ -141,4 +141,4 @@ import{B as e,D as t,Dt as n,F as r,I as i,Kt as a,M as o,N as s,O as c,Ot as l,
141
141
  height: 3px;
142
142
  border-radius: 1px;
143
143
  background: ${({$provider:e})=>`var(--p-${e})`};
144
- `,$=`\0new`;function ke(){let e=d(),[n,i]=(0,F.useState)(null),a=e.data??[],o=n===$?null:a.find(e=>e.id===n)??null,s=n===$||n===null&&!e.isLoading&&a.length===0;(0,F.useEffect)(()=>{n===null&&a.length!==0&&i(a[0]?.id??null)},[a,n]);let l=e.isLoading?`Reading configured models…`:a.length===0?`No virtual models exist yet, so no client request can resolve to an upstream.`:`${a.length} model${a.length===1?``:`s`} routing to ${a.reduce((e,t)=>e+t.targets.length,0)} targets.`;return(0,I.jsxs)(I.Fragment,{children:[(0,I.jsx)(v,{legend:`Models`,title:`Virtual models`,summary:l,actions:(0,I.jsxs)(r,{type:`button`,$variant:`primary`,onClick:()=>i($),children:[(0,I.jsx)(b,{}),`New model`]})}),(0,I.jsxs)(Ce,{children:[(0,I.jsx)(A,{legend:`Configured`,meta:`${a.length}`,flush:!0,children:e.isError?(0,I.jsx)(ne,{error:e.error,onRetry:()=>void e.refetch()}):e.isLoading?(0,I.jsx)(`div`,{style:{padding:12},children:(0,I.jsx)(M,{rows:4})}):a.length===0?(0,I.jsx)(N,{legend:`No models`,message:`Create a model to give clients something to ask for.`,action:(0,I.jsx)(r,{type:`button`,$size:`sm`,$variant:`primary`,onClick:()=>i($),children:`New model`})}):(0,I.jsx)(`div`,{children:a.map(e=>{let r=[...new Set(e.targets.map(e=>e.provider))];return(0,I.jsxs)(Te,{type:`button`,$selected:e.id===n,"aria-pressed":e.id===n,onClick:()=>i(e.id),children:[(0,I.jsxs)(p,{$gap:2,style:{width:`100%`},children:[(0,I.jsx)(Ee,{title:e.id,children:e.id}),(0,I.jsx)(f,{}),e.isAlias?(0,I.jsx)(T,{children:`alias`}):null]}),(0,I.jsxs)(p,{$gap:2,style:{width:`100%`},children:[(0,I.jsx)(De,{children:r.map(e=>(0,I.jsx)(Oe,{$provider:e,title:e},e))}),(0,I.jsx)(t,{children:e.strategy}),(0,I.jsx)(f,{}),(0,I.jsxs)(c,{$dim:!0,$size:`11px`,children:[e.targets.length,` target`,e.targets.length===1?``:`s`]})]})]},e.id)})})}),(0,I.jsxs)(we,{children:[o===null&&!s?(0,I.jsx)(A,{legend:`Editor`,children:e.isLoading?(0,I.jsx)(M,{rows:5}):(0,I.jsx)(N,{legend:`Nothing selected`,message:`Pick a model on the left to change its targets, or create a new one.`})}):(0,I.jsx)(Se,{model:o,onSaved:t=>{i(t),e.refetch()},onDeleted:()=>{i(null),e.refetch()}}),(0,I.jsx)(V,{modelId:o?.id??null})]})]})]})}var Ae=ke;export{Ae as component};
144
+ `,$=`\0new`;function ke(){let e=d(),[n,i]=(0,F.useState)(null),a=e.data??[],o=n===$?null:a.find(e=>e.id===n)??null,s=n===$||n===null&&!e.isLoading&&a.length===0;(0,F.useEffect)(()=>{n===null&&a.length!==0&&i(a[0]?.id??null)},[a,n]);let l=e.isLoading?`Reading configured models…`:a.length===0?`No virtual models exist yet, so no client request can resolve to an upstream.`:`${a.length} model${a.length===1?``:`s`} routing to ${a.reduce((e,t)=>e+t.targets.length,0)} targets.`;return(0,I.jsxs)(I.Fragment,{children:[(0,I.jsx)(v,{legend:`Models`,title:`Virtual models`,summary:l,actions:(0,I.jsxs)(r,{type:`button`,$variant:`primary`,onClick:()=>i($),children:[(0,I.jsx)(b,{}),`New model`]})}),(0,I.jsxs)(Ce,{children:[(0,I.jsx)(k,{legend:`Configured`,meta:`${a.length}`,flush:!0,children:e.isError?(0,I.jsx)(te,{error:e.error,onRetry:()=>void e.refetch()}):e.isLoading?(0,I.jsx)(`div`,{style:{padding:12},children:(0,I.jsx)(j,{rows:4})}):a.length===0?(0,I.jsx)(M,{legend:`No models`,message:`Create a model to give clients something to ask for.`,action:(0,I.jsx)(r,{type:`button`,$size:`sm`,$variant:`primary`,onClick:()=>i($),children:`New model`})}):(0,I.jsx)(`div`,{children:a.map(e=>{let r=[...new Set(e.targets.map(e=>e.provider))];return(0,I.jsxs)(Te,{type:`button`,$selected:e.id===n,"aria-pressed":e.id===n,onClick:()=>i(e.id),children:[(0,I.jsxs)(p,{$gap:2,style:{width:`100%`},children:[(0,I.jsx)(Ee,{title:e.id,children:e.id}),(0,I.jsx)(f,{}),e.isAlias?(0,I.jsx)(w,{children:`alias`}):null]}),(0,I.jsxs)(p,{$gap:2,style:{width:`100%`},children:[(0,I.jsx)(De,{children:r.map(e=>(0,I.jsx)(Oe,{$provider:e,title:e},e))}),(0,I.jsx)(t,{children:e.strategy}),(0,I.jsx)(f,{}),(0,I.jsxs)(c,{$dim:!0,$size:`11px`,children:[e.targets.length,` target`,e.targets.length===1?``:`s`]})]})]},e.id)})})}),(0,I.jsxs)(we,{children:[o===null&&!s?(0,I.jsx)(k,{legend:`Editor`,children:e.isLoading?(0,I.jsx)(j,{rows:5}):(0,I.jsx)(M,{legend:`Nothing selected`,message:`Pick a model on the left to change its targets, or create a new one.`})}):(0,I.jsx)(Se,{model:o,onSaved:t=>{i(t),e.refetch()},onDeleted:()=>{i(null),e.refetch()}}),(0,I.jsx)(V,{modelId:o?.id??null})]})]})]})}var Ae=ke;export{Ae as component};
@@ -1,4 +1,4 @@
1
- import{B as e,D as t,Dt as n,F as r,Kt as i,M as a,O as o,Ot as s,j as c,k as l,v as u,y as d}from"./queries-vY5lJqBe.js";import{t as f}from"./Rack-Be09hoVn.js";import{n as p,t as m}from"./Field-DdscQ9OO.js";import{t as h}from"./Meter-Bm1oQE2U.js";import{a as g,i as _,n as v,r as y}from"./States-DPTTYUHL.js";var b=i(s(),1),x=n(),S=[{id:`tier`,label:`Tier`,blurb:`How strongly a lower tier is preferred.`},{id:`health`,label:`Health`,blurb:`Penalty for recent failures and an open breaker.`},{id:`quota`,label:`Quota`,blurb:`Preference for accounts keeping ahead of their window's burn rate.`},{id:`cost`,label:`Cost`,blurb:`Preference for the cheaper target of the candidates.`},{id:`latency`,label:`Latency`,blurb:`Preference for the faster observed first token.`},{id:`recency`,label:`Recency`,blurb:`Preference for accounts that have been idle.`}],C=[{id:`maxAttempts`,label:`Attempts per request`,hint:`How many candidates dispatch may try before giving up. 1 disables failover.`,unit:`attempts`,step:1,min:1},{id:`requestDeadlineMs`,label:`Request deadline`,hint:`How long a single client request may take across all attempts.`,unit:`ms`,step:1e3,min:1},{id:`breakerThreshold`,label:`Breaker threshold`,hint:`Consecutive failures on one account and model before it is taken out of rotation.`,unit:`failures`,step:1,min:1},{id:`breakerCooldownMs`,label:`Breaker cooldown`,hint:`Base wait before a tripped account is probed again. Doubles per extra failure.`,unit:`ms`,step:1e3,min:1},{id:`logRetentionDays`,label:`Log retention`,hint:`How long request rows are kept before maintenance prunes them.`,unit:`days`,step:1,min:1},{id:`quotaPollIntervalMs`,label:`Quota poll interval`,hint:`How often each account's provider is asked for its remaining quota. 0 disables polling. Takes effect on restart.`,unit:`ms`,step:6e4,min:0}],w=e.div`
1
+ import{B as e,D as t,Dt as n,F as r,Kt as i,M as a,O as o,Ot as s,j as c,k as l,v as u,y as d}from"./queries-vY5lJqBe.js";import{t as f}from"./Rack-uDxrjvaz.js";import{n as p,t as m}from"./Field-DdscQ9OO.js";import{t as h}from"./Meter-Bm1oQE2U.js";import{a as g,i as _,n as v,r as y}from"./States-DPTTYUHL.js";var b=i(s(),1),x=n(),S=[{id:`tier`,label:`Tier`,blurb:`How strongly a lower tier is preferred.`},{id:`health`,label:`Health`,blurb:`Penalty for recent failures and an open breaker.`},{id:`quota`,label:`Quota`,blurb:`Preference for accounts keeping ahead of their window's burn rate.`},{id:`cost`,label:`Cost`,blurb:`Preference for the cheaper target of the candidates.`},{id:`latency`,label:`Latency`,blurb:`Preference for the faster observed first token.`},{id:`recency`,label:`Recency`,blurb:`Preference for accounts that have been idle.`}],C=[{id:`maxAttempts`,label:`Attempts per request`,hint:`How many candidates dispatch may try before giving up. 1 disables failover.`,unit:`attempts`,step:1,min:1},{id:`requestDeadlineMs`,label:`Request deadline`,hint:`How long a single client request may take across all attempts.`,unit:`ms`,step:1e3,min:1},{id:`breakerThreshold`,label:`Breaker threshold`,hint:`Consecutive failures on one account and model before it is taken out of rotation.`,unit:`failures`,step:1,min:1},{id:`breakerCooldownMs`,label:`Breaker cooldown`,hint:`Base wait before a tripped account is probed again. Doubles per extra failure.`,unit:`ms`,step:1e3,min:1},{id:`logRetentionDays`,label:`Log retention`,hint:`How long request rows are kept before maintenance prunes them.`,unit:`days`,step:1,min:1},{id:`quotaPollIntervalMs`,label:`Quota poll interval`,hint:`How often each account's provider is asked for its remaining quota. 0 disables polling. Takes effect on restart.`,unit:`ms`,step:6e4,min:0}],w=e.div`
2
2
  display: grid;
3
3
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
4
4
  gap: ${({theme:e})=>e.space(3)};