@sigmashake/ssg 0.29.7 → 0.29.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +6 -6
- package/public/assets/app.js +16 -16
package/public/assets/app.js
CHANGED
|
@@ -1,22 +1,22 @@
|
|
|
1
|
-
var e=Object.create,t=Object.defineProperty,n=Object.getOwnPropertyDescriptor,r=Object.getOwnPropertyNames,i=Object.getPrototypeOf,a=Object.prototype.hasOwnProperty,o=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),s=(e,i,o,s)=>{if(i&&typeof i==`object`||typeof i==`function`)for(var c=r(i),l=0,u=c.length,d;l<u;l++)d=c[l],!a.call(e,d)&&d!==o&&t(e,d,{get:(e=>i[e]).bind(null,d),enumerable:!(s=n(i,d))||s.enumerable});return e},c=(n,r,a)=>(a=n==null?{}:e(i(n)),s(r||!n||!n.__esModule?t(a,`default`,{value:n,enumerable:!0}):a,n));(function(){let e=document.createElement(`link`).relList;if(e&&e.supports&&e.supports(`modulepreload`))return;for(let e of document.querySelectorAll(`link[rel="modulepreload"]`))n(e);new MutationObserver(e=>{for(let t of e)if(t.type===`childList`)for(let e of t.addedNodes)e.tagName===`LINK`&&e.rel===`modulepreload`&&n(e)}).observe(document,{childList:!0,subtree:!0});function t(e){let t={};return e.integrity&&(t.integrity=e.integrity),e.referrerPolicy&&(t.referrerPolicy=e.referrerPolicy),e.crossOrigin===`use-credentials`?t.credentials=`include`:e.crossOrigin===`anonymous`?t.credentials=`omit`:t.credentials=`same-origin`,t}function n(e){if(e.ep)return;e.ep=!0;let n=t(e);fetch(e.href,n)}})();var l=o((e=>{var t=Symbol.for(`react.transitional.element`),n=Symbol.for(`react.portal`),r=Symbol.for(`react.fragment`),i=Symbol.for(`react.strict_mode`),a=Symbol.for(`react.profiler`),o=Symbol.for(`react.consumer`),s=Symbol.for(`react.context`),c=Symbol.for(`react.forward_ref`),l=Symbol.for(`react.suspense`),u=Symbol.for(`react.memo`),d=Symbol.for(`react.lazy`),f=Symbol.for(`react.activity`),p=Symbol.iterator;function m(e){return typeof e!=`object`||!e?null:(e=p&&e[p]||e[`@@iterator`],typeof e==`function`?e:null)}var h={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},g=Object.assign,_={};function v(e,t,n){this.props=e,this.context=t,this.refs=_,this.updater=n||h}v.prototype.isReactComponent={},v.prototype.setState=function(e,t){if(typeof e!=`object`&&typeof e!=`function`&&e!=null)throw Error(`takes an object of state variables to update or a function which returns an object of state variables.`);this.updater.enqueueSetState(this,e,t,`setState`)},v.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,`forceUpdate`)};function y(){}y.prototype=v.prototype;function b(e,t,n){this.props=e,this.context=t,this.refs=_,this.updater=n||h}var x=b.prototype=new y;x.constructor=b,g(x,v.prototype),x.isPureReactComponent=!0;var S=Array.isArray;function C(){}var w={H:null,A:null,T:null,S:null},T=Object.prototype.hasOwnProperty;function E(e,n,r){var i=r.ref;return{$$typeof:t,type:e,key:n,ref:i===void 0?null:i,props:r}}function D(e,t){return E(e.type,t,e.props)}function O(e){return typeof e==`object`&&!!e&&e.$$typeof===t}function k(e){var t={"=":`=0`,":":`=2`};return`$`+e.replace(/[=:]/g,function(e){return t[e]})}var A=/\/+/g;function j(e,t){return typeof e==`object`&&e&&e.key!=null?k(``+e.key):t.toString(36)}function M(e){switch(e.status){case`fulfilled`:return e.value;case`rejected`:throw e.reason;default:switch(typeof e.status==`string`?e.then(C,C):(e.status=`pending`,e.then(function(t){e.status===`pending`&&(e.status=`fulfilled`,e.value=t)},function(t){e.status===`pending`&&(e.status=`rejected`,e.reason=t)})),e.status){case`fulfilled`:return e.value;case`rejected`:throw e.reason}}throw e}function ee(e,r,i,a,o){var s=typeof e;(s===`undefined`||s===`boolean`)&&(e=null);var c=!1;if(e===null)c=!0;else switch(s){case`bigint`:case`string`:case`number`:c=!0;break;case`object`:switch(e.$$typeof){case t:case n:c=!0;break;case d:return c=e._init,ee(c(e._payload),r,i,a,o)}}if(c)return o=o(e),c=a===``?`.`+j(e,0):a,S(o)?(i=``,c!=null&&(i=c.replace(A,`$&/`)+`/`),ee(o,r,i,``,function(e){return e})):o!=null&&(O(o)&&(o=D(o,i+(o.key==null||e&&e.key===o.key?``:(``+o.key).replace(A,`$&/`)+`/`)+c)),r.push(o)),1;c=0;var l=a===``?`.`:a+`:`;if(S(e))for(var u=0;u<e.length;u++)a=e[u],s=l+j(a,u),c+=ee(a,r,i,s,o);else if(u=m(e),typeof u==`function`)for(e=u.call(e),u=0;!(a=e.next()).done;)a=a.value,s=l+j(a,u++),c+=ee(a,r,i,s,o);else if(s===`object`){if(typeof e.then==`function`)return ee(M(e),r,i,a,o);throw r=String(e),Error(`Objects are not valid as a React child (found: `+(r===`[object Object]`?`object with keys {`+Object.keys(e).join(`, `)+`}`:r)+`). If you meant to render a collection of children, use an array instead.`)}return c}function te(e,t,n){if(e==null)return e;var r=[],i=0;return ee(e,r,``,``,function(e){return t.call(n,e,i++)}),r}function ne(e){if(e._status===-1){var t=e._result;t=t(),t.then(function(t){(e._status===0||e._status===-1)&&(e._status=1,e._result=t)},function(t){(e._status===0||e._status===-1)&&(e._status=2,e._result=t)}),e._status===-1&&(e._status=0,e._result=t)}if(e._status===1)return e._result.default;throw e._result}var N=typeof reportError==`function`?reportError:function(e){if(typeof window==`object`&&typeof window.ErrorEvent==`function`){var t=new window.ErrorEvent(`error`,{bubbles:!0,cancelable:!0,message:typeof e==`object`&&e&&typeof e.message==`string`?String(e.message):String(e),error:e});if(!window.dispatchEvent(t))return}else if(typeof process==`object`&&typeof process.emit==`function`){process.emit(`uncaughtException`,e);return}console.error(e)},P={map:te,forEach:function(e,t,n){te(e,function(){t.apply(this,arguments)},n)},count:function(e){var t=0;return te(e,function(){t++}),t},toArray:function(e){return te(e,function(e){return e})||[]},only:function(e){if(!O(e))throw Error(`React.Children.only expected to receive a single React element child.`);return e}};e.Activity=f,e.Children=P,e.Component=v,e.Fragment=r,e.Profiler=a,e.PureComponent=b,e.StrictMode=i,e.Suspense=l,e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=w,e.__COMPILER_RUNTIME={__proto__:null,c:function(e){return w.H.useMemoCache(e)}},e.cache=function(e){return function(){return e.apply(null,arguments)}},e.cacheSignal=function(){return null},e.cloneElement=function(e,t,n){if(e==null)throw Error(`The argument must be a React element, but you passed `+e+`.`);var r=g({},e.props),i=e.key;if(t!=null)for(a in t.key!==void 0&&(i=``+t.key),t)!T.call(t,a)||a===`key`||a===`__self`||a===`__source`||a===`ref`&&t.ref===void 0||(r[a]=t[a]);var a=arguments.length-2;if(a===1)r.children=n;else if(1<a){for(var o=Array(a),s=0;s<a;s++)o[s]=arguments[s+2];r.children=o}return E(e.type,i,r)},e.createContext=function(e){return e={$$typeof:s,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null},e.Provider=e,e.Consumer={$$typeof:o,_context:e},e},e.createElement=function(e,t,n){var r,i={},a=null;if(t!=null)for(r in t.key!==void 0&&(a=``+t.key),t)T.call(t,r)&&r!==`key`&&r!==`__self`&&r!==`__source`&&(i[r]=t[r]);var o=arguments.length-2;if(o===1)i.children=n;else if(1<o){for(var s=Array(o),c=0;c<o;c++)s[c]=arguments[c+2];i.children=s}if(e&&e.defaultProps)for(r in o=e.defaultProps,o)i[r]===void 0&&(i[r]=o[r]);return E(e,a,i)},e.createRef=function(){return{current:null}},e.forwardRef=function(e){return{$$typeof:c,render:e}},e.isValidElement=O,e.lazy=function(e){return{$$typeof:d,_payload:{_status:-1,_result:e},_init:ne}},e.memo=function(e,t){return{$$typeof:u,type:e,compare:t===void 0?null:t}},e.startTransition=function(e){var t=w.T,n={};w.T=n;try{var r=e(),i=w.S;i!==null&&i(n,r),typeof r==`object`&&r&&typeof r.then==`function`&&r.then(C,N)}catch(e){N(e)}finally{t!==null&&n.types!==null&&(t.types=n.types),w.T=t}},e.unstable_useCacheRefresh=function(){return w.H.useCacheRefresh()},e.use=function(e){return w.H.use(e)},e.useActionState=function(e,t,n){return w.H.useActionState(e,t,n)},e.useCallback=function(e,t){return w.H.useCallback(e,t)},e.useContext=function(e){return w.H.useContext(e)},e.useDebugValue=function(){},e.useDeferredValue=function(e,t){return w.H.useDeferredValue(e,t)},e.useEffect=function(e,t){return w.H.useEffect(e,t)},e.useEffectEvent=function(e){return w.H.useEffectEvent(e)},e.useId=function(){return w.H.useId()},e.useImperativeHandle=function(e,t,n){return w.H.useImperativeHandle(e,t,n)},e.useInsertionEffect=function(e,t){return w.H.useInsertionEffect(e,t)},e.useLayoutEffect=function(e,t){return w.H.useLayoutEffect(e,t)},e.useMemo=function(e,t){return w.H.useMemo(e,t)},e.useOptimistic=function(e,t){return w.H.useOptimistic(e,t)},e.useReducer=function(e,t,n){return w.H.useReducer(e,t,n)},e.useRef=function(e){return w.H.useRef(e)},e.useState=function(e){return w.H.useState(e)},e.useSyncExternalStore=function(e,t,n){return w.H.useSyncExternalStore(e,t,n)},e.useTransition=function(){return w.H.useTransition()},e.version=`19.2.4`})),u=o(((e,t)=>{t.exports=l()})),d=o((e=>{function t(e,t){var n=e.length;e.push(t);a:for(;0<n;){var r=n-1>>>1,a=e[r];if(0<i(a,t))e[r]=t,e[n]=a,n=r;else break a}}function n(e){return e.length===0?null:e[0]}function r(e){if(e.length===0)return null;var t=e[0],n=e.pop();if(n!==t){e[0]=n;a:for(var r=0,a=e.length,o=a>>>1;r<o;){var s=2*(r+1)-1,c=e[s],l=s+1,u=e[l];if(0>i(c,n))l<a&&0>i(u,c)?(e[r]=u,e[l]=n,r=l):(e[r]=c,e[s]=n,r=s);else if(l<a&&0>i(u,n))e[r]=u,e[l]=n,r=l;else break a}}return t}function i(e,t){var n=e.sortIndex-t.sortIndex;return n===0?e.id-t.id:n}if(e.unstable_now=void 0,typeof performance==`object`&&typeof performance.now==`function`){var a=performance;e.unstable_now=function(){return a.now()}}else{var o=Date,s=o.now();e.unstable_now=function(){return o.now()-s}}var c=[],l=[],u=1,d=null,f=3,p=!1,m=!1,h=!1,g=!1,_=typeof setTimeout==`function`?setTimeout:null,v=typeof clearTimeout==`function`?clearTimeout:null,y=typeof setImmediate<`u`?setImmediate:null;function b(e){for(var i=n(l);i!==null;){if(i.callback===null)r(l);else if(i.startTime<=e)r(l),i.sortIndex=i.expirationTime,t(c,i);else break;i=n(l)}}function x(e){if(h=!1,b(e),!m)if(n(c)!==null)m=!0,S||(S=!0,O());else{var t=n(l);t!==null&&j(x,t.startTime-e)}}var S=!1,C=-1,w=5,T=-1;function E(){return g?!0:!(e.unstable_now()-T<w)}function D(){if(g=!1,S){var t=e.unstable_now();T=t;var i=!0;try{a:{m=!1,h&&(h=!1,v(C),C=-1),p=!0;var a=f;try{b:{for(b(t),d=n(c);d!==null&&!(d.expirationTime>t&&E());){var o=d.callback;if(typeof o==`function`){d.callback=null,f=d.priorityLevel;var s=o(d.expirationTime<=t);if(t=e.unstable_now(),typeof s==`function`){d.callback=s,b(t),i=!0;break b}d===n(c)&&r(c),b(t)}else r(c);d=n(c)}if(d!==null)i=!0;else{var u=n(l);u!==null&&j(x,u.startTime-t),i=!1}}break a}finally{d=null,f=a,p=!1}i=void 0}}finally{i?O():S=!1}}}var O;if(typeof y==`function`)O=function(){y(D)};else if(typeof MessageChannel<`u`){var k=new MessageChannel,A=k.port2;k.port1.onmessage=D,O=function(){A.postMessage(null)}}else O=function(){_(D,0)};function j(t,n){C=_(function(){t(e.unstable_now())},n)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(e){e.callback=null},e.unstable_forceFrameRate=function(e){0>e||125<e?console.error(`forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported`):w=0<e?Math.floor(1e3/e):5},e.unstable_getCurrentPriorityLevel=function(){return f},e.unstable_next=function(e){switch(f){case 1:case 2:case 3:var t=3;break;default:t=f}var n=f;f=t;try{return e()}finally{f=n}},e.unstable_requestPaint=function(){g=!0},e.unstable_runWithPriority=function(e,t){switch(e){case 1:case 2:case 3:case 4:case 5:break;default:e=3}var n=f;f=e;try{return t()}finally{f=n}},e.unstable_scheduleCallback=function(r,i,a){var o=e.unstable_now();switch(typeof a==`object`&&a?(a=a.delay,a=typeof a==`number`&&0<a?o+a:o):a=o,r){case 1:var s=-1;break;case 2:s=250;break;case 5:s=1073741823;break;case 4:s=1e4;break;default:s=5e3}return s=a+s,r={id:u++,callback:i,priorityLevel:r,startTime:a,expirationTime:s,sortIndex:-1},a>o?(r.sortIndex=a,t(l,r),n(c)===null&&r===n(l)&&(h?(v(C),C=-1):h=!0,j(x,a-o))):(r.sortIndex=s,t(c,r),m||p||(m=!0,S||(S=!0,O()))),r},e.unstable_shouldYield=E,e.unstable_wrapCallback=function(e){var t=f;return function(){var n=f;f=t;try{return e.apply(this,arguments)}finally{f=n}}}})),f=o(((e,t)=>{t.exports=d()})),p=o((e=>{var t=u();function n(e){var t=`https://react.dev/errors/`+e;if(1<arguments.length){t+=`?args[]=`+encodeURIComponent(arguments[1]);for(var n=2;n<arguments.length;n++)t+=`&args[]=`+encodeURIComponent(arguments[n])}return`Minified React error #`+e+`; visit `+t+` for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`}function r(){}var i={d:{f:r,r:function(){throw Error(n(522))},D:r,C:r,L:r,m:r,X:r,S:r,M:r},p:0,findDOMNode:null},a=Symbol.for(`react.portal`);function o(e,t,n){var r=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:a,key:r==null?null:``+r,children:e,containerInfo:t,implementation:n}}var s=t.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function c(e,t){if(e===`font`)return``;if(typeof t==`string`)return t===`use-credentials`?t:``}e.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=i,e.createPortal=function(e,t){var r=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!t||t.nodeType!==1&&t.nodeType!==9&&t.nodeType!==11)throw Error(n(299));return o(e,t,null,r)},e.flushSync=function(e){var t=s.T,n=i.p;try{if(s.T=null,i.p=2,e)return e()}finally{s.T=t,i.p=n,i.d.f()}},e.preconnect=function(e,t){typeof e==`string`&&(t?(t=t.crossOrigin,t=typeof t==`string`?t===`use-credentials`?t:``:void 0):t=null,i.d.C(e,t))},e.prefetchDNS=function(e){typeof e==`string`&&i.d.D(e)},e.preinit=function(e,t){if(typeof e==`string`&&t&&typeof t.as==`string`){var n=t.as,r=c(n,t.crossOrigin),a=typeof t.integrity==`string`?t.integrity:void 0,o=typeof t.fetchPriority==`string`?t.fetchPriority:void 0;n===`style`?i.d.S(e,typeof t.precedence==`string`?t.precedence:void 0,{crossOrigin:r,integrity:a,fetchPriority:o}):n===`script`&&i.d.X(e,{crossOrigin:r,integrity:a,fetchPriority:o,nonce:typeof t.nonce==`string`?t.nonce:void 0})}},e.preinitModule=function(e,t){if(typeof e==`string`)if(typeof t==`object`&&t){if(t.as==null||t.as===`script`){var n=c(t.as,t.crossOrigin);i.d.M(e,{crossOrigin:n,integrity:typeof t.integrity==`string`?t.integrity:void 0,nonce:typeof t.nonce==`string`?t.nonce:void 0})}}else t??i.d.M(e)},e.preload=function(e,t){if(typeof e==`string`&&typeof t==`object`&&t&&typeof t.as==`string`){var n=t.as,r=c(n,t.crossOrigin);i.d.L(e,n,{crossOrigin:r,integrity:typeof t.integrity==`string`?t.integrity:void 0,nonce:typeof t.nonce==`string`?t.nonce:void 0,type:typeof t.type==`string`?t.type:void 0,fetchPriority:typeof t.fetchPriority==`string`?t.fetchPriority:void 0,referrerPolicy:typeof t.referrerPolicy==`string`?t.referrerPolicy:void 0,imageSrcSet:typeof t.imageSrcSet==`string`?t.imageSrcSet:void 0,imageSizes:typeof t.imageSizes==`string`?t.imageSizes:void 0,media:typeof t.media==`string`?t.media:void 0})}},e.preloadModule=function(e,t){if(typeof e==`string`)if(t){var n=c(t.as,t.crossOrigin);i.d.m(e,{as:typeof t.as==`string`&&t.as!==`script`?t.as:void 0,crossOrigin:n,integrity:typeof t.integrity==`string`?t.integrity:void 0})}else i.d.m(e)},e.requestFormReset=function(e){i.d.r(e)},e.unstable_batchedUpdates=function(e,t){return e(t)},e.useFormState=function(e,t,n){return s.H.useFormState(e,t,n)},e.useFormStatus=function(){return s.H.useHostTransitionStatus()},e.version=`19.2.4`})),m=o(((e,t)=>{function n(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>`u`||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!=`function`))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(n)}catch(e){console.error(e)}}n(),t.exports=p()})),h=o((e=>{var t=f(),n=u(),r=m();function i(e){var t=`https://react.dev/errors/`+e;if(1<arguments.length){t+=`?args[]=`+encodeURIComponent(arguments[1]);for(var n=2;n<arguments.length;n++)t+=`&args[]=`+encodeURIComponent(arguments[n])}return`Minified React error #`+e+`; visit `+t+` for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`}function a(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function o(e){var t=e,n=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do t=e,t.flags&4098&&(n=t.return),e=t.return;while(e)}return t.tag===3?n:null}function s(e){if(e.tag===13){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function c(e){if(e.tag===31){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function l(e){if(o(e)!==e)throw Error(i(188))}function d(e){var t=e.alternate;if(!t){if(t=o(e),t===null)throw Error(i(188));return t===e?e:null}for(var n=e,r=t;;){var a=n.return;if(a===null)break;var s=a.alternate;if(s===null){if(r=a.return,r!==null){n=r;continue}break}if(a.child===s.child){for(s=a.child;s;){if(s===n)return l(a),e;if(s===r)return l(a),t;s=s.sibling}throw Error(i(188))}if(n.return!==r.return)n=a,r=s;else{for(var c=!1,u=a.child;u;){if(u===n){c=!0,n=a,r=s;break}if(u===r){c=!0,r=a,n=s;break}u=u.sibling}if(!c){for(u=s.child;u;){if(u===n){c=!0,n=s,r=a;break}if(u===r){c=!0,r=s,n=a;break}u=u.sibling}if(!c)throw Error(i(189))}}if(n.alternate!==r)throw Error(i(190))}if(n.tag!==3)throw Error(i(188));return n.stateNode.current===n?e:t}function p(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e;for(e=e.child;e!==null;){if(t=p(e),t!==null)return t;e=e.sibling}return null}var h=Object.assign,g=Symbol.for(`react.element`),_=Symbol.for(`react.transitional.element`),v=Symbol.for(`react.portal`),y=Symbol.for(`react.fragment`),b=Symbol.for(`react.strict_mode`),x=Symbol.for(`react.profiler`),S=Symbol.for(`react.consumer`),C=Symbol.for(`react.context`),w=Symbol.for(`react.forward_ref`),T=Symbol.for(`react.suspense`),E=Symbol.for(`react.suspense_list`),D=Symbol.for(`react.memo`),O=Symbol.for(`react.lazy`),k=Symbol.for(`react.activity`),A=Symbol.for(`react.memo_cache_sentinel`),j=Symbol.iterator;function M(e){return typeof e!=`object`||!e?null:(e=j&&e[j]||e[`@@iterator`],typeof e==`function`?e:null)}var ee=Symbol.for(`react.client.reference`);function te(e){if(e==null)return null;if(typeof e==`function`)return e.$$typeof===ee?null:e.displayName||e.name||null;if(typeof e==`string`)return e;switch(e){case y:return`Fragment`;case x:return`Profiler`;case b:return`StrictMode`;case T:return`Suspense`;case E:return`SuspenseList`;case k:return`Activity`}if(typeof e==`object`)switch(e.$$typeof){case v:return`Portal`;case C:return e.displayName||`Context`;case S:return(e._context.displayName||`Context`)+`.Consumer`;case w:var t=e.render;return e=e.displayName,e||=(e=t.displayName||t.name||``,e===``?`ForwardRef`:`ForwardRef(`+e+`)`),e;case D:return t=e.displayName||null,t===null?te(e.type)||`Memo`:t;case O:t=e._payload,e=e._init;try{return te(e(t))}catch{}}return null}var ne=Array.isArray,N=n.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,P=r.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,re={pending:!1,data:null,method:null,action:null},ie=[],ae=-1;function F(e){return{current:e}}function I(e){0>ae||(e.current=ie[ae],ie[ae]=null,ae--)}function L(e,t){ae++,ie[ae]=e.current,e.current=t}var oe=F(null),se=F(null),ce=F(null),le=F(null);function ue(e,t){switch(L(ce,t),L(se,e),L(oe,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?Vd(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=Vd(t),e=Hd(t,e);else switch(e){case`svg`:e=1;break;case`math`:e=2;break;default:e=0}}I(oe),L(oe,e)}function de(){I(oe),I(se),I(ce)}function fe(e){e.memoizedState!==null&&L(le,e);var t=oe.current,n=Hd(t,e.type);t!==n&&(L(se,e),L(oe,n))}function pe(e){se.current===e&&(I(oe),I(se)),le.current===e&&(I(le),Qf._currentValue=re)}var me,he;function ge(e){if(me===void 0)try{throw Error()}catch(e){var t=e.stack.trim().match(/\n( *(at )?)/);me=t&&t[1]||``,he=-1<e.stack.indexOf(`
|
|
1
|
+
var e=Object.create,t=Object.defineProperty,n=Object.getOwnPropertyDescriptor,r=Object.getOwnPropertyNames,a=Object.getPrototypeOf,o=Object.prototype.hasOwnProperty,s=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),c=(e,a,s,c)=>{if(a&&typeof a==`object`||typeof a==`function`)for(var l=r(a),u=0,d=l.length,f;u<d;u++)f=l[u],!o.call(e,f)&&f!==s&&t(e,f,{get:(e=>a[e]).bind(null,f),enumerable:!(c=n(a,f))||c.enumerable});return e},l=(n,r,o)=>(o=n==null?{}:e(a(n)),c(r||!n||!n.__esModule?t(o,`default`,{value:n,enumerable:!0}):o,n));(function(){let e=document.createElement(`link`).relList;if(e&&e.supports&&e.supports(`modulepreload`))return;for(let e of document.querySelectorAll(`link[rel="modulepreload"]`))n(e);new MutationObserver(e=>{for(let t of e)if(t.type===`childList`)for(let e of t.addedNodes)e.tagName===`LINK`&&e.rel===`modulepreload`&&n(e)}).observe(document,{childList:!0,subtree:!0});function t(e){let t={};return e.integrity&&(t.integrity=e.integrity),e.referrerPolicy&&(t.referrerPolicy=e.referrerPolicy),e.crossOrigin===`use-credentials`?t.credentials=`include`:e.crossOrigin===`anonymous`?t.credentials=`omit`:t.credentials=`same-origin`,t}function n(e){if(e.ep)return;e.ep=!0;let n=t(e);fetch(e.href,n)}})();var u=s((e=>{var t=Symbol.for(`react.transitional.element`),n=Symbol.for(`react.portal`),r=Symbol.for(`react.fragment`),a=Symbol.for(`react.strict_mode`),o=Symbol.for(`react.profiler`),s=Symbol.for(`react.consumer`),c=Symbol.for(`react.context`),l=Symbol.for(`react.forward_ref`),u=Symbol.for(`react.suspense`),d=Symbol.for(`react.memo`),f=Symbol.for(`react.lazy`),p=Symbol.for(`react.activity`),m=Symbol.iterator;function h(e){return typeof e!=`object`||!e?null:(e=m&&e[m]||e[`@@iterator`],typeof e==`function`?e:null)}var g={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},_=Object.assign,v={};function y(e,t,n){this.props=e,this.context=t,this.refs=v,this.updater=n||g}y.prototype.isReactComponent={},y.prototype.setState=function(e,t){if(typeof e!=`object`&&typeof e!=`function`&&e!=null)throw Error(`takes an object of state variables to update or a function which returns an object of state variables.`);this.updater.enqueueSetState(this,e,t,`setState`)},y.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,`forceUpdate`)};function b(){}b.prototype=y.prototype;function x(e,t,n){this.props=e,this.context=t,this.refs=v,this.updater=n||g}var S=x.prototype=new b;S.constructor=x,_(S,y.prototype),S.isPureReactComponent=!0;var C=Array.isArray;function w(){}var T={H:null,A:null,T:null,S:null},E=Object.prototype.hasOwnProperty;function D(e,n,r){var a=r.ref;return{$$typeof:t,type:e,key:n,ref:a===void 0?null:a,props:r}}function O(e,t){return D(e.type,t,e.props)}function k(e){return typeof e==`object`&&!!e&&e.$$typeof===t}function A(e){var t={"=":`=0`,":":`=2`};return`$`+e.replace(/[=:]/g,function(e){return t[e]})}var ee=/\/+/g;function j(e,t){return typeof e==`object`&&e&&e.key!=null?A(``+e.key):t.toString(36)}function M(e){switch(e.status){case`fulfilled`:return e.value;case`rejected`:throw e.reason;default:switch(typeof e.status==`string`?e.then(w,w):(e.status=`pending`,e.then(function(t){e.status===`pending`&&(e.status=`fulfilled`,e.value=t)},function(t){e.status===`pending`&&(e.status=`rejected`,e.reason=t)})),e.status){case`fulfilled`:return e.value;case`rejected`:throw e.reason}}throw e}function te(e,r,a,o,s){var c=typeof e;(c===`undefined`||c===`boolean`)&&(e=null);var l=!1;if(e===null)l=!0;else switch(c){case`bigint`:case`string`:case`number`:l=!0;break;case`object`:switch(e.$$typeof){case t:case n:l=!0;break;case f:return l=e._init,te(l(e._payload),r,a,o,s)}}if(l)return s=s(e),l=o===``?`.`+j(e,0):o,C(s)?(a=``,l!=null&&(a=l.replace(ee,`$&/`)+`/`),te(s,r,a,``,function(e){return e})):s!=null&&(k(s)&&(s=O(s,a+(s.key==null||e&&e.key===s.key?``:(``+s.key).replace(ee,`$&/`)+`/`)+l)),r.push(s)),1;l=0;var u=o===``?`.`:o+`:`;if(C(e))for(var d=0;d<e.length;d++)o=e[d],c=u+j(o,d),l+=te(o,r,a,c,s);else if(d=h(e),typeof d==`function`)for(e=d.call(e),d=0;!(o=e.next()).done;)o=o.value,c=u+j(o,d++),l+=te(o,r,a,c,s);else if(c===`object`){if(typeof e.then==`function`)return te(M(e),r,a,o,s);throw r=String(e),Error(`Objects are not valid as a React child (found: `+(r===`[object Object]`?`object with keys {`+Object.keys(e).join(`, `)+`}`:r)+`). If you meant to render a collection of children, use an array instead.`)}return l}function ne(e,t,n){if(e==null)return e;var r=[],a=0;return te(e,r,``,``,function(e){return t.call(n,e,a++)}),r}function re(e){if(e._status===-1){var t=e._result;t=t(),t.then(function(t){(e._status===0||e._status===-1)&&(e._status=1,e._result=t)},function(t){(e._status===0||e._status===-1)&&(e._status=2,e._result=t)}),e._status===-1&&(e._status=0,e._result=t)}if(e._status===1)return e._result.default;throw e._result}var N=typeof reportError==`function`?reportError:function(e){if(typeof window==`object`&&typeof window.ErrorEvent==`function`){var t=new window.ErrorEvent(`error`,{bubbles:!0,cancelable:!0,message:typeof e==`object`&&e&&typeof e.message==`string`?String(e.message):String(e),error:e});if(!window.dispatchEvent(t))return}else if(typeof process==`object`&&typeof process.emit==`function`){process.emit(`uncaughtException`,e);return}console.error(e)},P={map:ne,forEach:function(e,t,n){ne(e,function(){t.apply(this,arguments)},n)},count:function(e){var t=0;return ne(e,function(){t++}),t},toArray:function(e){return ne(e,function(e){return e})||[]},only:function(e){if(!k(e))throw Error(`React.Children.only expected to receive a single React element child.`);return e}};e.Activity=p,e.Children=P,e.Component=y,e.Fragment=r,e.Profiler=o,e.PureComponent=x,e.StrictMode=a,e.Suspense=u,e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=T,e.__COMPILER_RUNTIME={__proto__:null,c:function(e){return T.H.useMemoCache(e)}},e.cache=function(e){return function(){return e.apply(null,arguments)}},e.cacheSignal=function(){return null},e.cloneElement=function(e,t,n){if(e==null)throw Error(`The argument must be a React element, but you passed `+e+`.`);var r=_({},e.props),a=e.key;if(t!=null)for(o in t.key!==void 0&&(a=``+t.key),t)!E.call(t,o)||o===`key`||o===`__self`||o===`__source`||o===`ref`&&t.ref===void 0||(r[o]=t[o]);var o=arguments.length-2;if(o===1)r.children=n;else if(1<o){for(var s=Array(o),c=0;c<o;c++)s[c]=arguments[c+2];r.children=s}return D(e.type,a,r)},e.createContext=function(e){return e={$$typeof:c,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null},e.Provider=e,e.Consumer={$$typeof:s,_context:e},e},e.createElement=function(e,t,n){var r,a={},o=null;if(t!=null)for(r in t.key!==void 0&&(o=``+t.key),t)E.call(t,r)&&r!==`key`&&r!==`__self`&&r!==`__source`&&(a[r]=t[r]);var s=arguments.length-2;if(s===1)a.children=n;else if(1<s){for(var c=Array(s),l=0;l<s;l++)c[l]=arguments[l+2];a.children=c}if(e&&e.defaultProps)for(r in s=e.defaultProps,s)a[r]===void 0&&(a[r]=s[r]);return D(e,o,a)},e.createRef=function(){return{current:null}},e.forwardRef=function(e){return{$$typeof:l,render:e}},e.isValidElement=k,e.lazy=function(e){return{$$typeof:f,_payload:{_status:-1,_result:e},_init:re}},e.memo=function(e,t){return{$$typeof:d,type:e,compare:t===void 0?null:t}},e.startTransition=function(e){var t=T.T,n={};T.T=n;try{var r=e(),a=T.S;a!==null&&a(n,r),typeof r==`object`&&r&&typeof r.then==`function`&&r.then(w,N)}catch(e){N(e)}finally{t!==null&&n.types!==null&&(t.types=n.types),T.T=t}},e.unstable_useCacheRefresh=function(){return T.H.useCacheRefresh()},e.use=function(e){return T.H.use(e)},e.useActionState=function(e,t,n){return T.H.useActionState(e,t,n)},e.useCallback=function(e,t){return T.H.useCallback(e,t)},e.useContext=function(e){return T.H.useContext(e)},e.useDebugValue=function(){},e.useDeferredValue=function(e,t){return T.H.useDeferredValue(e,t)},e.useEffect=function(e,t){return T.H.useEffect(e,t)},e.useEffectEvent=function(e){return T.H.useEffectEvent(e)},e.useId=function(){return T.H.useId()},e.useImperativeHandle=function(e,t,n){return T.H.useImperativeHandle(e,t,n)},e.useInsertionEffect=function(e,t){return T.H.useInsertionEffect(e,t)},e.useLayoutEffect=function(e,t){return T.H.useLayoutEffect(e,t)},e.useMemo=function(e,t){return T.H.useMemo(e,t)},e.useOptimistic=function(e,t){return T.H.useOptimistic(e,t)},e.useReducer=function(e,t,n){return T.H.useReducer(e,t,n)},e.useRef=function(e){return T.H.useRef(e)},e.useState=function(e){return T.H.useState(e)},e.useSyncExternalStore=function(e,t,n){return T.H.useSyncExternalStore(e,t,n)},e.useTransition=function(){return T.H.useTransition()},e.version=`19.2.4`})),d=s(((e,t)=>{t.exports=u()})),f=s((e=>{function t(e,t){var n=e.length;e.push(t);a:for(;0<n;){var r=n-1>>>1,o=e[r];if(0<a(o,t))e[r]=t,e[n]=o,n=r;else break a}}function n(e){return e.length===0?null:e[0]}function r(e){if(e.length===0)return null;var t=e[0],n=e.pop();if(n!==t){e[0]=n;a:for(var r=0,o=e.length,s=o>>>1;r<s;){var c=2*(r+1)-1,l=e[c],u=c+1,d=e[u];if(0>a(l,n))u<o&&0>a(d,l)?(e[r]=d,e[u]=n,r=u):(e[r]=l,e[c]=n,r=c);else if(u<o&&0>a(d,n))e[r]=d,e[u]=n,r=u;else break a}}return t}function a(e,t){var n=e.sortIndex-t.sortIndex;return n===0?e.id-t.id:n}if(e.unstable_now=void 0,typeof performance==`object`&&typeof performance.now==`function`){var o=performance;e.unstable_now=function(){return o.now()}}else{var s=Date,c=s.now();e.unstable_now=function(){return s.now()-c}}var l=[],u=[],d=1,f=null,p=3,m=!1,h=!1,g=!1,_=!1,v=typeof setTimeout==`function`?setTimeout:null,y=typeof clearTimeout==`function`?clearTimeout:null,b=typeof setImmediate<`u`?setImmediate:null;function x(e){for(var a=n(u);a!==null;){if(a.callback===null)r(u);else if(a.startTime<=e)r(u),a.sortIndex=a.expirationTime,t(l,a);else break;a=n(u)}}function S(e){if(g=!1,x(e),!h)if(n(l)!==null)h=!0,C||(C=!0,k());else{var t=n(u);t!==null&&j(S,t.startTime-e)}}var C=!1,w=-1,T=5,E=-1;function D(){return _?!0:!(e.unstable_now()-E<T)}function O(){if(_=!1,C){var t=e.unstable_now();E=t;var a=!0;try{a:{h=!1,g&&(g=!1,y(w),w=-1),m=!0;var o=p;try{b:{for(x(t),f=n(l);f!==null&&!(f.expirationTime>t&&D());){var s=f.callback;if(typeof s==`function`){f.callback=null,p=f.priorityLevel;var c=s(f.expirationTime<=t);if(t=e.unstable_now(),typeof c==`function`){f.callback=c,x(t),a=!0;break b}f===n(l)&&r(l),x(t)}else r(l);f=n(l)}if(f!==null)a=!0;else{var d=n(u);d!==null&&j(S,d.startTime-t),a=!1}}break a}finally{f=null,p=o,m=!1}a=void 0}}finally{a?k():C=!1}}}var k;if(typeof b==`function`)k=function(){b(O)};else if(typeof MessageChannel<`u`){var A=new MessageChannel,ee=A.port2;A.port1.onmessage=O,k=function(){ee.postMessage(null)}}else k=function(){v(O,0)};function j(t,n){w=v(function(){t(e.unstable_now())},n)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(e){e.callback=null},e.unstable_forceFrameRate=function(e){0>e||125<e?console.error(`forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported`):T=0<e?Math.floor(1e3/e):5},e.unstable_getCurrentPriorityLevel=function(){return p},e.unstable_next=function(e){switch(p){case 1:case 2:case 3:var t=3;break;default:t=p}var n=p;p=t;try{return e()}finally{p=n}},e.unstable_requestPaint=function(){_=!0},e.unstable_runWithPriority=function(e,t){switch(e){case 1:case 2:case 3:case 4:case 5:break;default:e=3}var n=p;p=e;try{return t()}finally{p=n}},e.unstable_scheduleCallback=function(r,a,o){var s=e.unstable_now();switch(typeof o==`object`&&o?(o=o.delay,o=typeof o==`number`&&0<o?s+o:s):o=s,r){case 1:var c=-1;break;case 2:c=250;break;case 5:c=1073741823;break;case 4:c=1e4;break;default:c=5e3}return c=o+c,r={id:d++,callback:a,priorityLevel:r,startTime:o,expirationTime:c,sortIndex:-1},o>s?(r.sortIndex=o,t(u,r),n(l)===null&&r===n(u)&&(g?(y(w),w=-1):g=!0,j(S,o-s))):(r.sortIndex=c,t(l,r),h||m||(h=!0,C||(C=!0,k()))),r},e.unstable_shouldYield=D,e.unstable_wrapCallback=function(e){var t=p;return function(){var n=p;p=t;try{return e.apply(this,arguments)}finally{p=n}}}})),p=s(((e,t)=>{t.exports=f()})),m=s((e=>{var t=d();function n(e){var t=`https://react.dev/errors/`+e;if(1<arguments.length){t+=`?args[]=`+encodeURIComponent(arguments[1]);for(var n=2;n<arguments.length;n++)t+=`&args[]=`+encodeURIComponent(arguments[n])}return`Minified React error #`+e+`; visit `+t+` for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`}function r(){}var a={d:{f:r,r:function(){throw Error(n(522))},D:r,C:r,L:r,m:r,X:r,S:r,M:r},p:0,findDOMNode:null},o=Symbol.for(`react.portal`);function s(e,t,n){var r=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:o,key:r==null?null:``+r,children:e,containerInfo:t,implementation:n}}var c=t.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function l(e,t){if(e===`font`)return``;if(typeof t==`string`)return t===`use-credentials`?t:``}e.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=a,e.createPortal=function(e,t){var r=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!t||t.nodeType!==1&&t.nodeType!==9&&t.nodeType!==11)throw Error(n(299));return s(e,t,null,r)},e.flushSync=function(e){var t=c.T,n=a.p;try{if(c.T=null,a.p=2,e)return e()}finally{c.T=t,a.p=n,a.d.f()}},e.preconnect=function(e,t){typeof e==`string`&&(t?(t=t.crossOrigin,t=typeof t==`string`?t===`use-credentials`?t:``:void 0):t=null,a.d.C(e,t))},e.prefetchDNS=function(e){typeof e==`string`&&a.d.D(e)},e.preinit=function(e,t){if(typeof e==`string`&&t&&typeof t.as==`string`){var n=t.as,r=l(n,t.crossOrigin),o=typeof t.integrity==`string`?t.integrity:void 0,s=typeof t.fetchPriority==`string`?t.fetchPriority:void 0;n===`style`?a.d.S(e,typeof t.precedence==`string`?t.precedence:void 0,{crossOrigin:r,integrity:o,fetchPriority:s}):n===`script`&&a.d.X(e,{crossOrigin:r,integrity:o,fetchPriority:s,nonce:typeof t.nonce==`string`?t.nonce:void 0})}},e.preinitModule=function(e,t){if(typeof e==`string`)if(typeof t==`object`&&t){if(t.as==null||t.as===`script`){var n=l(t.as,t.crossOrigin);a.d.M(e,{crossOrigin:n,integrity:typeof t.integrity==`string`?t.integrity:void 0,nonce:typeof t.nonce==`string`?t.nonce:void 0})}}else t??a.d.M(e)},e.preload=function(e,t){if(typeof e==`string`&&typeof t==`object`&&t&&typeof t.as==`string`){var n=t.as,r=l(n,t.crossOrigin);a.d.L(e,n,{crossOrigin:r,integrity:typeof t.integrity==`string`?t.integrity:void 0,nonce:typeof t.nonce==`string`?t.nonce:void 0,type:typeof t.type==`string`?t.type:void 0,fetchPriority:typeof t.fetchPriority==`string`?t.fetchPriority:void 0,referrerPolicy:typeof t.referrerPolicy==`string`?t.referrerPolicy:void 0,imageSrcSet:typeof t.imageSrcSet==`string`?t.imageSrcSet:void 0,imageSizes:typeof t.imageSizes==`string`?t.imageSizes:void 0,media:typeof t.media==`string`?t.media:void 0})}},e.preloadModule=function(e,t){if(typeof e==`string`)if(t){var n=l(t.as,t.crossOrigin);a.d.m(e,{as:typeof t.as==`string`&&t.as!==`script`?t.as:void 0,crossOrigin:n,integrity:typeof t.integrity==`string`?t.integrity:void 0})}else a.d.m(e)},e.requestFormReset=function(e){a.d.r(e)},e.unstable_batchedUpdates=function(e,t){return e(t)},e.useFormState=function(e,t,n){return c.H.useFormState(e,t,n)},e.useFormStatus=function(){return c.H.useHostTransitionStatus()},e.version=`19.2.4`})),h=s(((e,t)=>{function n(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>`u`||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!=`function`))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(n)}catch(e){console.error(e)}}n(),t.exports=m()})),g=s((e=>{var t=p(),n=d(),r=h();function a(e){var t=`https://react.dev/errors/`+e;if(1<arguments.length){t+=`?args[]=`+encodeURIComponent(arguments[1]);for(var n=2;n<arguments.length;n++)t+=`&args[]=`+encodeURIComponent(arguments[n])}return`Minified React error #`+e+`; visit `+t+` for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`}function o(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function s(e){var t=e,n=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do t=e,t.flags&4098&&(n=t.return),e=t.return;while(e)}return t.tag===3?n:null}function c(e){if(e.tag===13){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function l(e){if(e.tag===31){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function u(e){if(s(e)!==e)throw Error(a(188))}function f(e){var t=e.alternate;if(!t){if(t=s(e),t===null)throw Error(a(188));return t===e?e:null}for(var n=e,r=t;;){var o=n.return;if(o===null)break;var c=o.alternate;if(c===null){if(r=o.return,r!==null){n=r;continue}break}if(o.child===c.child){for(c=o.child;c;){if(c===n)return u(o),e;if(c===r)return u(o),t;c=c.sibling}throw Error(a(188))}if(n.return!==r.return)n=o,r=c;else{for(var l=!1,d=o.child;d;){if(d===n){l=!0,n=o,r=c;break}if(d===r){l=!0,r=o,n=c;break}d=d.sibling}if(!l){for(d=c.child;d;){if(d===n){l=!0,n=c,r=o;break}if(d===r){l=!0,r=c,n=o;break}d=d.sibling}if(!l)throw Error(a(189))}}if(n.alternate!==r)throw Error(a(190))}if(n.tag!==3)throw Error(a(188));return n.stateNode.current===n?e:t}function m(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e;for(e=e.child;e!==null;){if(t=m(e),t!==null)return t;e=e.sibling}return null}var g=Object.assign,_=Symbol.for(`react.element`),v=Symbol.for(`react.transitional.element`),y=Symbol.for(`react.portal`),b=Symbol.for(`react.fragment`),x=Symbol.for(`react.strict_mode`),S=Symbol.for(`react.profiler`),C=Symbol.for(`react.consumer`),w=Symbol.for(`react.context`),T=Symbol.for(`react.forward_ref`),E=Symbol.for(`react.suspense`),D=Symbol.for(`react.suspense_list`),O=Symbol.for(`react.memo`),k=Symbol.for(`react.lazy`),A=Symbol.for(`react.activity`),ee=Symbol.for(`react.memo_cache_sentinel`),j=Symbol.iterator;function M(e){return typeof e!=`object`||!e?null:(e=j&&e[j]||e[`@@iterator`],typeof e==`function`?e:null)}var te=Symbol.for(`react.client.reference`);function ne(e){if(e==null)return null;if(typeof e==`function`)return e.$$typeof===te?null:e.displayName||e.name||null;if(typeof e==`string`)return e;switch(e){case b:return`Fragment`;case S:return`Profiler`;case x:return`StrictMode`;case E:return`Suspense`;case D:return`SuspenseList`;case A:return`Activity`}if(typeof e==`object`)switch(e.$$typeof){case y:return`Portal`;case w:return e.displayName||`Context`;case C:return(e._context.displayName||`Context`)+`.Consumer`;case T:var t=e.render;return e=e.displayName,e||=(e=t.displayName||t.name||``,e===``?`ForwardRef`:`ForwardRef(`+e+`)`),e;case O:return t=e.displayName||null,t===null?ne(e.type)||`Memo`:t;case k:t=e._payload,e=e._init;try{return ne(e(t))}catch{}}return null}var re=Array.isArray,N=n.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,P=r.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,ie={pending:!1,data:null,method:null,action:null},ae=[],oe=-1;function F(e){return{current:e}}function I(e){0>oe||(e.current=ae[oe],ae[oe]=null,oe--)}function L(e,t){oe++,ae[oe]=e.current,e.current=t}var se=F(null),R=F(null),ce=F(null),le=F(null);function ue(e,t){switch(L(ce,t),L(R,e),L(se,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?Hd(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=Hd(t),e=Ud(t,e);else switch(e){case`svg`:e=1;break;case`math`:e=2;break;default:e=0}}I(se),L(se,e)}function de(){I(se),I(R),I(ce)}function fe(e){e.memoizedState!==null&&L(le,e);var t=se.current,n=Ud(t,e.type);t!==n&&(L(R,e),L(se,n))}function pe(e){R.current===e&&(I(se),I(R)),le.current===e&&(I(le),$f._currentValue=ie)}var me,he;function ge(e){if(me===void 0)try{throw Error()}catch(e){var t=e.stack.trim().match(/\n( *(at )?)/);me=t&&t[1]||``,he=-1<e.stack.indexOf(`
|
|
2
2
|
at`)?` (<anonymous>)`:-1<e.stack.indexOf(`@`)?`@unknown:0:0`:``}return`
|
|
3
|
-
`+me+e+he}var _e=!1;function ve(e,t){if(!e||_e)return``;_e=!0;var n=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var r={DetermineComponentFrameRoot:function(){try{if(t){var n=function(){throw Error()};if(Object.defineProperty(n.prototype,`props`,{set:function(){throw Error()}}),typeof Reflect==`object`&&Reflect.construct){try{Reflect.construct(n,[])}catch(e){var r=e}Reflect.construct(e,[],n)}else{try{n.call()}catch(e){r=e}e.call(n.prototype)}}else{try{throw Error()}catch(e){r=e}(n=e())&&typeof n.catch==`function`&&n.catch(function(){})}}catch(e){if(e&&r&&typeof e.stack==`string`)return[e.stack,r.stack]}return[null,null]}};r.DetermineComponentFrameRoot.displayName=`DetermineComponentFrameRoot`;var
|
|
4
|
-
`),
|
|
5
|
-
`);for(
|
|
6
|
-
`+
|
|
3
|
+
`+me+e+he}var _e=!1;function ve(e,t){if(!e||_e)return``;_e=!0;var n=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var r={DetermineComponentFrameRoot:function(){try{if(t){var n=function(){throw Error()};if(Object.defineProperty(n.prototype,`props`,{set:function(){throw Error()}}),typeof Reflect==`object`&&Reflect.construct){try{Reflect.construct(n,[])}catch(e){var r=e}Reflect.construct(e,[],n)}else{try{n.call()}catch(e){r=e}e.call(n.prototype)}}else{try{throw Error()}catch(e){r=e}(n=e())&&typeof n.catch==`function`&&n.catch(function(){})}}catch(e){if(e&&r&&typeof e.stack==`string`)return[e.stack,r.stack]}return[null,null]}};r.DetermineComponentFrameRoot.displayName=`DetermineComponentFrameRoot`;var a=Object.getOwnPropertyDescriptor(r.DetermineComponentFrameRoot,`name`);a&&a.configurable&&Object.defineProperty(r.DetermineComponentFrameRoot,`name`,{value:`DetermineComponentFrameRoot`});var o=r.DetermineComponentFrameRoot(),s=o[0],c=o[1];if(s&&c){var l=s.split(`
|
|
4
|
+
`),u=c.split(`
|
|
5
|
+
`);for(a=r=0;r<l.length&&!l[r].includes(`DetermineComponentFrameRoot`);)r++;for(;a<u.length&&!u[a].includes(`DetermineComponentFrameRoot`);)a++;if(r===l.length||a===u.length)for(r=l.length-1,a=u.length-1;1<=r&&0<=a&&l[r]!==u[a];)a--;for(;1<=r&&0<=a;r--,a--)if(l[r]!==u[a]){if(r!==1||a!==1)do if(r--,a--,0>a||l[r]!==u[a]){var d=`
|
|
6
|
+
`+l[r].replace(` at new `,` at `);return e.displayName&&d.includes(`<anonymous>`)&&(d=d.replace(`<anonymous>`,e.displayName)),d}while(1<=r&&0<=a);break}}}finally{_e=!1,Error.prepareStackTrace=n}return(n=e?e.displayName||e.name:``)?ge(n):``}function ye(e,t){switch(e.tag){case 26:case 27:case 5:return ge(e.type);case 16:return ge(`Lazy`);case 13:return e.child!==t&&t!==null?ge(`Suspense Fallback`):ge(`Suspense`);case 19:return ge(`SuspenseList`);case 0:case 15:return ve(e.type,!1);case 11:return ve(e.type.render,!1);case 1:return ve(e.type,!0);case 31:return ge(`Activity`);default:return``}}function be(e){try{var t=``,n=null;do t+=ye(e,n),n=e,e=e.return;while(e);return t}catch(e){return`
|
|
7
7
|
Error generating stack: `+e.message+`
|
|
8
|
-
`+e.stack}}var xe=Object.prototype.hasOwnProperty,Se=t.unstable_scheduleCallback,Ce=t.unstable_cancelCallback,we=t.unstable_shouldYield,Te=t.unstable_requestPaint,Ee=t.unstable_now,De=t.unstable_getCurrentPriorityLevel,Oe=t.unstable_ImmediatePriority,ke=t.unstable_UserBlockingPriority,Ae=t.unstable_NormalPriority,je=t.unstable_LowPriority,R=t.unstable_IdlePriority,Me=t.log,Ne=t.unstable_setDisableYieldValue,Pe=null,Fe=null;function Ie(e){if(typeof Me==`function`&&Ne(e),Fe&&typeof Fe.setStrictMode==`function`)try{Fe.setStrictMode(Pe,e)}catch{}}var Le=Math.clz32?Math.clz32:Be,Re=Math.log,ze=Math.LN2;function Be(e){return e>>>=0,e===0?32:31-(Re(e)/ze|0)|0}var Ve=256,He=262144,Ue=4194304;function We(e){var t=e&42;if(t!==0)return t;switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return e&261888;case 262144:case 524288:case 1048576:case 2097152:return e&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return e&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return e}}function Ge(e,t,n){var r=e.pendingLanes;if(r===0)return 0;var i=0,a=e.suspendedLanes,o=e.pingedLanes;e=e.warmLanes;var s=r&134217727;return s===0?(s=r&~a,s===0?o===0?n||(n=r&~e,n!==0&&(i=We(n))):i=We(o):i=We(s)):(r=s&~a,r===0?(o&=s,o===0?n||(n=s&~e,n!==0&&(i=We(n))):i=We(o)):i=We(r)),i===0?0:t!==0&&t!==i&&(t&a)===0&&(a=i&-i,n=t&-t,a>=n||a===32&&n&4194048)?t:i}function Ke(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function qe(e,t){switch(e){case 1:case 2:case 4:case 8:case 64:return t+250;case 16:case 32:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return t+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function Je(){var e=Ue;return Ue<<=1,!(Ue&62914560)&&(Ue=4194304),e}function Ye(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function Xe(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function Ze(e,t,n,r,i,a){var o=e.pendingLanes;e.pendingLanes=n,e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0,e.expiredLanes&=n,e.entangledLanes&=n,e.errorRecoveryDisabledLanes&=n,e.shellSuspendCounter=0;var s=e.entanglements,c=e.expirationTimes,l=e.hiddenUpdates;for(n=o&~n;0<n;){var u=31-Le(n),d=1<<u;s[u]=0,c[u]=-1;var f=l[u];if(f!==null)for(l[u]=null,u=0;u<f.length;u++){var p=f[u];p!==null&&(p.lane&=-536870913)}n&=~d}r!==0&&Qe(e,r,0),a!==0&&i===0&&e.tag!==0&&(e.suspendedLanes|=a&~(o&~t))}function Qe(e,t,n){e.pendingLanes|=t,e.suspendedLanes&=~t;var r=31-Le(t);e.entangledLanes|=t,e.entanglements[r]=e.entanglements[r]|1073741824|n&261930}function $e(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var r=31-Le(n),i=1<<r;i&t|e[r]&t&&(e[r]|=t),n&=~i}}function et(e,t){var n=t&-t;return n=n&42?1:tt(n),(n&(e.suspendedLanes|t))===0?n:0}function tt(e){switch(e){case 2:e=1;break;case 8:e=4;break;case 32:e=16;break;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:e=128;break;case 268435456:e=134217728;break;default:e=0}return e}function nt(e){return e&=-e,2<e?8<e?e&134217727?32:268435456:8:2}function rt(){var e=P.p;return e===0?(e=window.event,e===void 0?32:mp(e.type)):e}function it(e,t){var n=P.p;try{return P.p=e,t()}finally{P.p=n}}var at=Math.random().toString(36).slice(2),ot=`__reactFiber$`+at,st=`__reactProps$`+at,ct=`__reactContainer$`+at,lt=`__reactEvents$`+at,ut=`__reactListeners$`+at,dt=`__reactHandles$`+at,ft=`__reactResources$`+at,pt=`__reactMarker$`+at;function mt(e){delete e[ot],delete e[st],delete e[lt],delete e[ut],delete e[dt]}function ht(e){var t=e[ot];if(t)return t;for(var n=e.parentNode;n;){if(t=n[ct]||n[ot]){if(n=t.alternate,t.child!==null||n!==null&&n.child!==null)for(e=df(e);e!==null;){if(n=e[ot])return n;e=df(e)}return t}e=n,n=e.parentNode}return null}function gt(e){if(e=e[ot]||e[ct]){var t=e.tag;if(t===5||t===6||t===13||t===31||t===26||t===27||t===3)return e}return null}function _t(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e.stateNode;throw Error(i(33))}function vt(e){var t=e[ft];return t||=e[ft]={hoistableStyles:new Map,hoistableScripts:new Map},t}function yt(e){e[pt]=!0}var bt=new Set,xt={};function St(e,t){Ct(e,t),Ct(e+`Capture`,t)}function Ct(e,t){for(xt[e]=t,e=0;e<t.length;e++)bt.add(t[e])}var wt=RegExp(`^[:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD][:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD\\-.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040]*$`),Tt={},Et={};function Dt(e){return xe.call(Et,e)?!0:xe.call(Tt,e)?!1:wt.test(e)?Et[e]=!0:(Tt[e]=!0,!1)}function Ot(e,t,n){if(Dt(t))if(n===null)e.removeAttribute(t);else{switch(typeof n){case`undefined`:case`function`:case`symbol`:e.removeAttribute(t);return;case`boolean`:var r=t.toLowerCase().slice(0,5);if(r!==`data-`&&r!==`aria-`){e.removeAttribute(t);return}}e.setAttribute(t,``+n)}}function kt(e,t,n){if(n===null)e.removeAttribute(t);else{switch(typeof n){case`undefined`:case`function`:case`symbol`:case`boolean`:e.removeAttribute(t);return}e.setAttribute(t,``+n)}}function At(e,t,n,r){if(r===null)e.removeAttribute(n);else{switch(typeof r){case`undefined`:case`function`:case`symbol`:case`boolean`:e.removeAttribute(n);return}e.setAttributeNS(t,n,``+r)}}function jt(e){switch(typeof e){case`bigint`:case`boolean`:case`number`:case`string`:case`undefined`:return e;case`object`:return e;default:return``}}function Mt(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()===`input`&&(t===`checkbox`||t===`radio`)}function Nt(e,t,n){var r=Object.getOwnPropertyDescriptor(e.constructor.prototype,t);if(!e.hasOwnProperty(t)&&r!==void 0&&typeof r.get==`function`&&typeof r.set==`function`){var i=r.get,a=r.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return i.call(this)},set:function(e){n=``+e,a.call(this,e)}}),Object.defineProperty(e,t,{enumerable:r.enumerable}),{getValue:function(){return n},setValue:function(e){n=``+e},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function Pt(e){if(!e._valueTracker){var t=Mt(e)?`checked`:`value`;e._valueTracker=Nt(e,t,``+e[t])}}function Ft(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r=``;return e&&(r=Mt(e)?e.checked?`true`:`false`:e.value),e=r,e===n?!1:(t.setValue(e),!0)}function It(e){if(e||=typeof document<`u`?document:void 0,e===void 0)return null;try{return e.activeElement||e.body}catch{return e.body}}var Lt=/[\n"\\]/g;function Rt(e){return e.replace(Lt,function(e){return`\\`+e.charCodeAt(0).toString(16)+` `})}function zt(e,t,n,r,i,a,o,s){e.name=``,o!=null&&typeof o!=`function`&&typeof o!=`symbol`&&typeof o!=`boolean`?e.type=o:e.removeAttribute(`type`),t==null?o!==`submit`&&o!==`reset`||e.removeAttribute(`value`):o===`number`?(t===0&&e.value===``||e.value!=t)&&(e.value=``+jt(t)):e.value!==``+jt(t)&&(e.value=``+jt(t)),t==null?n==null?r!=null&&e.removeAttribute(`value`):Vt(e,o,jt(n)):Vt(e,o,jt(t)),i==null&&a!=null&&(e.defaultChecked=!!a),i!=null&&(e.checked=i&&typeof i!=`function`&&typeof i!=`symbol`),s!=null&&typeof s!=`function`&&typeof s!=`symbol`&&typeof s!=`boolean`?e.name=``+jt(s):e.removeAttribute(`name`)}function Bt(e,t,n,r,i,a,o,s){if(a!=null&&typeof a!=`function`&&typeof a!=`symbol`&&typeof a!=`boolean`&&(e.type=a),t!=null||n!=null){if(!(a!==`submit`&&a!==`reset`||t!=null)){Pt(e);return}n=n==null?``:``+jt(n),t=t==null?n:``+jt(t),s||t===e.value||(e.value=t),e.defaultValue=t}r??=i,r=typeof r!=`function`&&typeof r!=`symbol`&&!!r,e.checked=s?e.checked:!!r,e.defaultChecked=!!r,o!=null&&typeof o!=`function`&&typeof o!=`symbol`&&typeof o!=`boolean`&&(e.name=o),Pt(e)}function Vt(e,t,n){t===`number`&&It(e.ownerDocument)===e||e.defaultValue===``+n||(e.defaultValue=``+n)}function Ht(e,t,n,r){if(e=e.options,t){t={};for(var i=0;i<n.length;i++)t[`$`+n[i]]=!0;for(n=0;n<e.length;n++)i=t.hasOwnProperty(`$`+e[n].value),e[n].selected!==i&&(e[n].selected=i),i&&r&&(e[n].defaultSelected=!0)}else{for(n=``+jt(n),t=null,i=0;i<e.length;i++){if(e[i].value===n){e[i].selected=!0,r&&(e[i].defaultSelected=!0);return}t!==null||e[i].disabled||(t=e[i])}t!==null&&(t.selected=!0)}}function Ut(e,t,n){if(t!=null&&(t=``+jt(t),t!==e.value&&(e.value=t),n==null)){e.defaultValue!==t&&(e.defaultValue=t);return}e.defaultValue=n==null?``:``+jt(n)}function Wt(e,t,n,r){if(t==null){if(r!=null){if(n!=null)throw Error(i(92));if(ne(r)){if(1<r.length)throw Error(i(93));r=r[0]}n=r}n??=``,t=n}n=jt(t),e.defaultValue=n,r=e.textContent,r===n&&r!==``&&r!==null&&(e.value=r),Pt(e)}function Gt(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var Kt=new Set(`animationIterationCount aspectRatio borderImageOutset borderImageSlice borderImageWidth boxFlex boxFlexGroup boxOrdinalGroup columnCount columns flex flexGrow flexPositive flexShrink flexNegative flexOrder gridArea gridRow gridRowEnd gridRowSpan gridRowStart gridColumn gridColumnEnd gridColumnSpan gridColumnStart fontWeight lineClamp lineHeight opacity order orphans scale tabSize widows zIndex zoom fillOpacity floodOpacity stopOpacity strokeDasharray strokeDashoffset strokeMiterlimit strokeOpacity strokeWidth MozAnimationIterationCount MozBoxFlex MozBoxFlexGroup MozLineClamp msAnimationIterationCount msFlex msZoom msFlexGrow msFlexNegative msFlexOrder msFlexPositive msFlexShrink msGridColumn msGridColumnSpan msGridRow msGridRowSpan WebkitAnimationIterationCount WebkitBoxFlex WebKitBoxFlexGroup WebkitBoxOrdinalGroup WebkitColumnCount WebkitColumns WebkitFlex WebkitFlexGrow WebkitFlexPositive WebkitFlexShrink WebkitLineClamp`.split(` `));function qt(e,t,n){var r=t.indexOf(`--`)===0;n==null||typeof n==`boolean`||n===``?r?e.setProperty(t,``):t===`float`?e.cssFloat=``:e[t]=``:r?e.setProperty(t,n):typeof n!=`number`||n===0||Kt.has(t)?t===`float`?e.cssFloat=n:e[t]=(``+n).trim():e[t]=n+`px`}function Jt(e,t,n){if(t!=null&&typeof t!=`object`)throw Error(i(62));if(e=e.style,n!=null){for(var r in n)!n.hasOwnProperty(r)||t!=null&&t.hasOwnProperty(r)||(r.indexOf(`--`)===0?e.setProperty(r,``):r===`float`?e.cssFloat=``:e[r]=``);for(var a in t)r=t[a],t.hasOwnProperty(a)&&n[a]!==r&&qt(e,a,r)}else for(var o in t)t.hasOwnProperty(o)&&qt(e,o,t[o])}function Yt(e){if(e.indexOf(`-`)===-1)return!1;switch(e){case`annotation-xml`:case`color-profile`:case`font-face`:case`font-face-src`:case`font-face-uri`:case`font-face-format`:case`font-face-name`:case`missing-glyph`:return!1;default:return!0}}var Xt=new Map([[`acceptCharset`,`accept-charset`],[`htmlFor`,`for`],[`httpEquiv`,`http-equiv`],[`crossOrigin`,`crossorigin`],[`accentHeight`,`accent-height`],[`alignmentBaseline`,`alignment-baseline`],[`arabicForm`,`arabic-form`],[`baselineShift`,`baseline-shift`],[`capHeight`,`cap-height`],[`clipPath`,`clip-path`],[`clipRule`,`clip-rule`],[`colorInterpolation`,`color-interpolation`],[`colorInterpolationFilters`,`color-interpolation-filters`],[`colorProfile`,`color-profile`],[`colorRendering`,`color-rendering`],[`dominantBaseline`,`dominant-baseline`],[`enableBackground`,`enable-background`],[`fillOpacity`,`fill-opacity`],[`fillRule`,`fill-rule`],[`floodColor`,`flood-color`],[`floodOpacity`,`flood-opacity`],[`fontFamily`,`font-family`],[`fontSize`,`font-size`],[`fontSizeAdjust`,`font-size-adjust`],[`fontStretch`,`font-stretch`],[`fontStyle`,`font-style`],[`fontVariant`,`font-variant`],[`fontWeight`,`font-weight`],[`glyphName`,`glyph-name`],[`glyphOrientationHorizontal`,`glyph-orientation-horizontal`],[`glyphOrientationVertical`,`glyph-orientation-vertical`],[`horizAdvX`,`horiz-adv-x`],[`horizOriginX`,`horiz-origin-x`],[`imageRendering`,`image-rendering`],[`letterSpacing`,`letter-spacing`],[`lightingColor`,`lighting-color`],[`markerEnd`,`marker-end`],[`markerMid`,`marker-mid`],[`markerStart`,`marker-start`],[`overlinePosition`,`overline-position`],[`overlineThickness`,`overline-thickness`],[`paintOrder`,`paint-order`],[`panose-1`,`panose-1`],[`pointerEvents`,`pointer-events`],[`renderingIntent`,`rendering-intent`],[`shapeRendering`,`shape-rendering`],[`stopColor`,`stop-color`],[`stopOpacity`,`stop-opacity`],[`strikethroughPosition`,`strikethrough-position`],[`strikethroughThickness`,`strikethrough-thickness`],[`strokeDasharray`,`stroke-dasharray`],[`strokeDashoffset`,`stroke-dashoffset`],[`strokeLinecap`,`stroke-linecap`],[`strokeLinejoin`,`stroke-linejoin`],[`strokeMiterlimit`,`stroke-miterlimit`],[`strokeOpacity`,`stroke-opacity`],[`strokeWidth`,`stroke-width`],[`textAnchor`,`text-anchor`],[`textDecoration`,`text-decoration`],[`textRendering`,`text-rendering`],[`transformOrigin`,`transform-origin`],[`underlinePosition`,`underline-position`],[`underlineThickness`,`underline-thickness`],[`unicodeBidi`,`unicode-bidi`],[`unicodeRange`,`unicode-range`],[`unitsPerEm`,`units-per-em`],[`vAlphabetic`,`v-alphabetic`],[`vHanging`,`v-hanging`],[`vIdeographic`,`v-ideographic`],[`vMathematical`,`v-mathematical`],[`vectorEffect`,`vector-effect`],[`vertAdvY`,`vert-adv-y`],[`vertOriginX`,`vert-origin-x`],[`vertOriginY`,`vert-origin-y`],[`wordSpacing`,`word-spacing`],[`writingMode`,`writing-mode`],[`xmlnsXlink`,`xmlns:xlink`],[`xHeight`,`x-height`]]),Zt=/^[\u0000-\u001F ]*j[\r\n\t]*a[\r\n\t]*v[\r\n\t]*a[\r\n\t]*s[\r\n\t]*c[\r\n\t]*r[\r\n\t]*i[\r\n\t]*p[\r\n\t]*t[\r\n\t]*:/i;function Qt(e){return Zt.test(``+e)?`javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')`:e}function $t(){}var en=null;function tn(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var nn=null,rn=null;function an(e){var t=gt(e);if(t&&(e=t.stateNode)){var n=e[st]||null;a:switch(e=t.stateNode,t.type){case`input`:if(zt(e,n.value,n.defaultValue,n.defaultValue,n.checked,n.defaultChecked,n.type,n.name),t=n.name,n.type===`radio`&&t!=null){for(n=e;n.parentNode;)n=n.parentNode;for(n=n.querySelectorAll(`input[name="`+Rt(``+t)+`"][type="radio"]`),t=0;t<n.length;t++){var r=n[t];if(r!==e&&r.form===e.form){var a=r[st]||null;if(!a)throw Error(i(90));zt(r,a.value,a.defaultValue,a.defaultValue,a.checked,a.defaultChecked,a.type,a.name)}}for(t=0;t<n.length;t++)r=n[t],r.form===e.form&&Ft(r)}break a;case`textarea`:Ut(e,n.value,n.defaultValue);break a;case`select`:t=n.value,t!=null&&Ht(e,!!n.multiple,t,!1)}}}var on=!1;function sn(e,t,n){if(on)return e(t,n);on=!0;try{return e(t)}finally{if(on=!1,(nn!==null||rn!==null)&&(vu(),nn&&(t=nn,e=rn,rn=nn=null,an(t),e)))for(t=0;t<e.length;t++)an(e[t])}}function cn(e,t){var n=e.stateNode;if(n===null)return null;var r=n[st]||null;if(r===null)return null;n=r[t];a:switch(t){case`onClick`:case`onClickCapture`:case`onDoubleClick`:case`onDoubleClickCapture`:case`onMouseDown`:case`onMouseDownCapture`:case`onMouseMove`:case`onMouseMoveCapture`:case`onMouseUp`:case`onMouseUpCapture`:case`onMouseEnter`:(r=!r.disabled)||(e=e.type,r=!(e===`button`||e===`input`||e===`select`||e===`textarea`)),e=!r;break a;default:e=!1}if(e)return null;if(n&&typeof n!=`function`)throw Error(i(231,t,typeof n));return n}var ln=!(typeof window>`u`||window.document===void 0||window.document.createElement===void 0),un=!1;if(ln)try{var dn={};Object.defineProperty(dn,`passive`,{get:function(){un=!0}}),window.addEventListener(`test`,dn,dn),window.removeEventListener(`test`,dn,dn)}catch{un=!1}var fn=null,pn=null,mn=null;function hn(){if(mn)return mn;var e,t=pn,n=t.length,r,i=`value`in fn?fn.value:fn.textContent,a=i.length;for(e=0;e<n&&t[e]===i[e];e++);var o=n-e;for(r=1;r<=o&&t[n-r]===i[a-r];r++);return mn=i.slice(e,1<r?1-r:void 0)}function gn(e){var t=e.keyCode;return`charCode`in e?(e=e.charCode,e===0&&t===13&&(e=13)):e=t,e===10&&(e=13),32<=e||e===13?e:0}function _n(){return!0}function vn(){return!1}function yn(e){function t(t,n,r,i,a){for(var o in this._reactName=t,this._targetInst=r,this.type=n,this.nativeEvent=i,this.target=a,this.currentTarget=null,e)e.hasOwnProperty(o)&&(t=e[o],this[o]=t?t(i):i[o]);return this.isDefaultPrevented=(i.defaultPrevented==null?!1===i.returnValue:i.defaultPrevented)?_n:vn,this.isPropagationStopped=vn,this}return h(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var e=this.nativeEvent;e&&(e.preventDefault?e.preventDefault():typeof e.returnValue!=`unknown`&&(e.returnValue=!1),this.isDefaultPrevented=_n)},stopPropagation:function(){var e=this.nativeEvent;e&&(e.stopPropagation?e.stopPropagation():typeof e.cancelBubble!=`unknown`&&(e.cancelBubble=!0),this.isPropagationStopped=_n)},persist:function(){},isPersistent:_n}),t}var bn={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},xn=yn(bn),Sn=h({},bn,{view:0,detail:0}),Cn=yn(Sn),wn,Tn,En,z=h({},Sn,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:B,button:0,buttons:0,relatedTarget:function(e){return e.relatedTarget===void 0?e.fromElement===e.srcElement?e.toElement:e.fromElement:e.relatedTarget},movementX:function(e){return`movementX`in e?e.movementX:(e!==En&&(En&&e.type===`mousemove`?(wn=e.screenX-En.screenX,Tn=e.screenY-En.screenY):Tn=wn=0,En=e),wn)},movementY:function(e){return`movementY`in e?e.movementY:Tn}}),Dn=yn(z),On=yn(h({},z,{dataTransfer:0})),kn=yn(h({},Sn,{relatedTarget:0})),An=yn(h({},bn,{animationName:0,elapsedTime:0,pseudoElement:0})),jn=yn(h({},bn,{clipboardData:function(e){return`clipboardData`in e?e.clipboardData:window.clipboardData}})),Mn=yn(h({},bn,{data:0})),Nn={Esc:`Escape`,Spacebar:` `,Left:`ArrowLeft`,Up:`ArrowUp`,Right:`ArrowRight`,Down:`ArrowDown`,Del:`Delete`,Win:`OS`,Menu:`ContextMenu`,Apps:`ContextMenu`,Scroll:`ScrollLock`,MozPrintableKey:`Unidentified`},Pn={8:`Backspace`,9:`Tab`,12:`Clear`,13:`Enter`,16:`Shift`,17:`Control`,18:`Alt`,19:`Pause`,20:`CapsLock`,27:`Escape`,32:` `,33:`PageUp`,34:`PageDown`,35:`End`,36:`Home`,37:`ArrowLeft`,38:`ArrowUp`,39:`ArrowRight`,40:`ArrowDown`,45:`Insert`,46:`Delete`,112:`F1`,113:`F2`,114:`F3`,115:`F4`,116:`F5`,117:`F6`,118:`F7`,119:`F8`,120:`F9`,121:`F10`,122:`F11`,123:`F12`,144:`NumLock`,145:`ScrollLock`,224:`Meta`},Fn={Alt:`altKey`,Control:`ctrlKey`,Meta:`metaKey`,Shift:`shiftKey`};function In(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=Fn[e])?!!t[e]:!1}function B(){return In}var Ln=yn(h({},Sn,{key:function(e){if(e.key){var t=Nn[e.key]||e.key;if(t!==`Unidentified`)return t}return e.type===`keypress`?(e=gn(e),e===13?`Enter`:String.fromCharCode(e)):e.type===`keydown`||e.type===`keyup`?Pn[e.keyCode]||`Unidentified`:``},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:B,charCode:function(e){return e.type===`keypress`?gn(e):0},keyCode:function(e){return e.type===`keydown`||e.type===`keyup`?e.keyCode:0},which:function(e){return e.type===`keypress`?gn(e):e.type===`keydown`||e.type===`keyup`?e.keyCode:0}})),Rn=yn(h({},z,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0})),zn=yn(h({},Sn,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:B})),Bn=yn(h({},bn,{propertyName:0,elapsedTime:0,pseudoElement:0})),Vn=yn(h({},z,{deltaX:function(e){return`deltaX`in e?e.deltaX:`wheelDeltaX`in e?-e.wheelDeltaX:0},deltaY:function(e){return`deltaY`in e?e.deltaY:`wheelDeltaY`in e?-e.wheelDeltaY:`wheelDelta`in e?-e.wheelDelta:0},deltaZ:0,deltaMode:0})),Hn=yn(h({},bn,{newState:0,oldState:0})),Un=[9,13,27,32],V=ln&&`CompositionEvent`in window,Wn=null;ln&&`documentMode`in document&&(Wn=document.documentMode);var Gn=ln&&`TextEvent`in window&&!Wn,Kn=ln&&(!V||Wn&&8<Wn&&11>=Wn),qn=` `,Jn=!1;function Yn(e,t){switch(e){case`keyup`:return Un.indexOf(t.keyCode)!==-1;case`keydown`:return t.keyCode!==229;case`keypress`:case`mousedown`:case`focusout`:return!0;default:return!1}}function Xn(e){return e=e.detail,typeof e==`object`&&`data`in e?e.data:null}var Zn=!1;function Qn(e,t){switch(e){case`compositionend`:return Xn(t);case`keypress`:return t.which===32?(Jn=!0,qn):null;case`textInput`:return e=t.data,e===qn&&Jn?null:e;default:return null}}function $n(e,t){if(Zn)return e===`compositionend`||!V&&Yn(e,t)?(e=hn(),mn=pn=fn=null,Zn=!1,e):null;switch(e){case`paste`:return null;case`keypress`:if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1<t.char.length)return t.char;if(t.which)return String.fromCharCode(t.which)}return null;case`compositionend`:return Kn&&t.locale!==`ko`?null:t.data;default:return null}}var er={color:!0,date:!0,datetime:!0,"datetime-local":!0,email:!0,month:!0,number:!0,password:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0};function tr(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t===`input`?!!er[e.type]:t===`textarea`}function nr(e,t,n,r){nn?rn?rn.push(r):rn=[r]:nn=r,t=Td(t,`onChange`),0<t.length&&(n=new xn(`onChange`,`change`,null,n,r),e.push({event:n,listeners:t}))}var rr=null,ir=null;function ar(e){vd(e,0)}function or(e){if(Ft(_t(e)))return e}function sr(e,t){if(e===`change`)return t}var H=!1;if(ln){var cr;if(ln){var lr=`oninput`in document;if(!lr){var ur=document.createElement(`div`);ur.setAttribute(`oninput`,`return;`),lr=typeof ur.oninput==`function`}cr=lr}else cr=!1;H=cr&&(!document.documentMode||9<document.documentMode)}function dr(){rr&&(rr.detachEvent(`onpropertychange`,U),ir=rr=null)}function U(e){if(e.propertyName===`value`&&or(ir)){var t=[];nr(t,ir,e,tn(e)),sn(ar,t)}}function fr(e,t,n){e===`focusin`?(dr(),rr=t,ir=n,rr.attachEvent(`onpropertychange`,U)):e===`focusout`&&dr()}function W(e){if(e===`selectionchange`||e===`keyup`||e===`keydown`)return or(ir)}function G(e,t){if(e===`click`)return or(t)}function K(e,t){if(e===`input`||e===`change`)return or(t)}function pr(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}var q=typeof Object.is==`function`?Object.is:pr;function mr(e,t){if(q(e,t))return!0;if(typeof e!=`object`||!e||typeof t!=`object`||!t)return!1;var n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(r=0;r<n.length;r++){var i=n[r];if(!xe.call(t,i)||!q(e[i],t[i]))return!1}return!0}function hr(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function J(e,t){var n=hr(e);e=0;for(var r;n;){if(n.nodeType===3){if(r=e+n.textContent.length,e<=t&&r>=t)return{node:n,offset:t-e};e=r}a:{for(;n;){if(n.nextSibling){n=n.nextSibling;break a}n=n.parentNode}n=void 0}n=hr(n)}}function gr(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?gr(e,t.parentNode):`contains`in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function _r(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=It(e.document);t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href==`string`}catch{n=!1}if(n)e=t.contentWindow;else break;t=It(e.document)}return t}function vr(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t===`input`&&(e.type===`text`||e.type===`search`||e.type===`tel`||e.type===`url`||e.type===`password`)||t===`textarea`||e.contentEditable===`true`)}var yr=ln&&`documentMode`in document&&11>=document.documentMode,br=null,xr=null,Sr=null,Cr=!1;function wr(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;Cr||br==null||br!==It(r)||(r=br,`selectionStart`in r&&vr(r)?r={start:r.selectionStart,end:r.selectionEnd}:(r=(r.ownerDocument&&r.ownerDocument.defaultView||window).getSelection(),r={anchorNode:r.anchorNode,anchorOffset:r.anchorOffset,focusNode:r.focusNode,focusOffset:r.focusOffset}),Sr&&mr(Sr,r)||(Sr=r,r=Td(xr,`onSelect`),0<r.length&&(t=new xn(`onSelect`,`select`,null,t,n),e.push({event:t,listeners:r}),t.target=br)))}function Tr(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n[`Webkit`+e]=`webkit`+t,n[`Moz`+e]=`moz`+t,n}var Er={animationend:Tr(`Animation`,`AnimationEnd`),animationiteration:Tr(`Animation`,`AnimationIteration`),animationstart:Tr(`Animation`,`AnimationStart`),transitionrun:Tr(`Transition`,`TransitionRun`),transitionstart:Tr(`Transition`,`TransitionStart`),transitioncancel:Tr(`Transition`,`TransitionCancel`),transitionend:Tr(`Transition`,`TransitionEnd`)},Dr={},Or={};ln&&(Or=document.createElement(`div`).style,`AnimationEvent`in window||(delete Er.animationend.animation,delete Er.animationiteration.animation,delete Er.animationstart.animation),`TransitionEvent`in window||delete Er.transitionend.transition);function kr(e){if(Dr[e])return Dr[e];if(!Er[e])return e;var t=Er[e],n;for(n in t)if(t.hasOwnProperty(n)&&n in Or)return Dr[e]=t[n];return e}var Ar=kr(`animationend`),jr=kr(`animationiteration`),Mr=kr(`animationstart`),Nr=kr(`transitionrun`),Pr=kr(`transitionstart`),Fr=kr(`transitioncancel`),Ir=kr(`transitionend`),Lr=new Map,Rr=`abort auxClick beforeToggle cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel`.split(` `);Rr.push(`scrollEnd`);function zr(e,t){Lr.set(e,t),St(t,[e])}var Br=typeof reportError==`function`?reportError:function(e){if(typeof window==`object`&&typeof window.ErrorEvent==`function`){var t=new window.ErrorEvent(`error`,{bubbles:!0,cancelable:!0,message:typeof e==`object`&&e&&typeof e.message==`string`?String(e.message):String(e),error:e});if(!window.dispatchEvent(t))return}else if(typeof process==`object`&&typeof process.emit==`function`){process.emit(`uncaughtException`,e);return}console.error(e)},Vr=[],Hr=0,Ur=0;function Wr(){for(var e=Hr,t=Ur=Hr=0;t<e;){var n=Vr[t];Vr[t++]=null;var r=Vr[t];Vr[t++]=null;var i=Vr[t];Vr[t++]=null;var a=Vr[t];if(Vr[t++]=null,r!==null&&i!==null){var o=r.pending;o===null?i.next=i:(i.next=o.next,o.next=i),r.pending=i}a!==0&&Jr(n,i,a)}}function Gr(e,t,n,r){Vr[Hr++]=e,Vr[Hr++]=t,Vr[Hr++]=n,Vr[Hr++]=r,Ur|=r,e.lanes|=r,e=e.alternate,e!==null&&(e.lanes|=r)}function Kr(e,t,n,r){return Gr(e,t,n,r),Yr(e)}function qr(e,t){return Gr(e,null,null,t),Yr(e)}function Jr(e,t,n){e.lanes|=n;var r=e.alternate;r!==null&&(r.lanes|=n);for(var i=!1,a=e.return;a!==null;)a.childLanes|=n,r=a.alternate,r!==null&&(r.childLanes|=n),a.tag===22&&(e=a.stateNode,e===null||e._visibility&1||(i=!0)),e=a,a=a.return;return e.tag===3?(a=e.stateNode,i&&t!==null&&(i=31-Le(n),e=a.hiddenUpdates,r=e[i],r===null?e[i]=[t]:r.push(t),t.lane=n|536870912),a):null}function Yr(e){if(50<lu)throw lu=0,uu=null,Error(i(185));for(var t=e.return;t!==null;)e=t,t=e.return;return e.tag===3?e.stateNode:null}var Xr={};function Zr(e,t,n,r){this.tag=e,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=r,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Qr(e,t,n,r){return new Zr(e,t,n,r)}function $r(e){return e=e.prototype,!(!e||!e.isReactComponent)}function ei(e,t){var n=e.alternate;return n===null?(n=Qr(e.tag,t,e.key,e.mode),n.elementType=e.elementType,n.type=e.type,n.stateNode=e.stateNode,n.alternate=e,e.alternate=n):(n.pendingProps=t,n.type=e.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=e.flags&65011712,n.childLanes=e.childLanes,n.lanes=e.lanes,n.child=e.child,n.memoizedProps=e.memoizedProps,n.memoizedState=e.memoizedState,n.updateQueue=e.updateQueue,t=e.dependencies,n.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},n.sibling=e.sibling,n.index=e.index,n.ref=e.ref,n.refCleanup=e.refCleanup,n}function ti(e,t){e.flags&=65011714;var n=e.alternate;return n===null?(e.childLanes=0,e.lanes=t,e.child=null,e.subtreeFlags=0,e.memoizedProps=null,e.memoizedState=null,e.updateQueue=null,e.dependencies=null,e.stateNode=null):(e.childLanes=n.childLanes,e.lanes=n.lanes,e.child=n.child,e.subtreeFlags=0,e.deletions=null,e.memoizedProps=n.memoizedProps,e.memoizedState=n.memoizedState,e.updateQueue=n.updateQueue,e.type=n.type,t=n.dependencies,e.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext}),e}function ni(e,t,n,r,a,o){var s=0;if(r=e,typeof e==`function`)$r(e)&&(s=1);else if(typeof e==`string`)s=Uf(e,n,oe.current)?26:e===`html`||e===`head`||e===`body`?27:5;else a:switch(e){case k:return e=Qr(31,n,t,a),e.elementType=k,e.lanes=o,e;case y:return ri(n.children,a,o,t);case b:s=8,a|=24;break;case x:return e=Qr(12,n,t,a|2),e.elementType=x,e.lanes=o,e;case T:return e=Qr(13,n,t,a),e.elementType=T,e.lanes=o,e;case E:return e=Qr(19,n,t,a),e.elementType=E,e.lanes=o,e;default:if(typeof e==`object`&&e)switch(e.$$typeof){case C:s=10;break a;case S:s=9;break a;case w:s=11;break a;case D:s=14;break a;case O:s=16,r=null;break a}s=29,n=Error(i(130,e===null?`null`:typeof e,``)),r=null}return t=Qr(s,n,t,a),t.elementType=e,t.type=r,t.lanes=o,t}function ri(e,t,n,r){return e=Qr(7,e,r,t),e.lanes=n,e}function ii(e,t,n){return e=Qr(6,e,null,t),e.lanes=n,e}function ai(e){var t=Qr(18,null,null,0);return t.stateNode=e,t}function oi(e,t,n){return t=Qr(4,e.children===null?[]:e.children,e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}var si=new WeakMap;function ci(e,t){if(typeof e==`object`&&e){var n=si.get(e);return n===void 0?(t={value:e,source:t,stack:be(t)},si.set(e,t),t):n}return{value:e,source:t,stack:be(t)}}var li=[],ui=0,di=null,fi=0,pi=[],mi=0,hi=null,gi=1,_i=``;function vi(e,t){li[ui++]=fi,li[ui++]=di,di=e,fi=t}function yi(e,t,n){pi[mi++]=gi,pi[mi++]=_i,pi[mi++]=hi,hi=e;var r=gi;e=_i;var i=32-Le(r)-1;r&=~(1<<i),n+=1;var a=32-Le(t)+i;if(30<a){var o=i-i%5;a=(r&(1<<o)-1).toString(32),r>>=o,i-=o,gi=1<<32-Le(t)+i|n<<i|r,_i=a+e}else gi=1<<a|n<<i|r,_i=e}function bi(e){e.return!==null&&(vi(e,1),yi(e,1,0))}function xi(e){for(;e===di;)di=li[--ui],li[ui]=null,fi=li[--ui],li[ui]=null;for(;e===hi;)hi=pi[--mi],pi[mi]=null,_i=pi[--mi],pi[mi]=null,gi=pi[--mi],pi[mi]=null}function Si(e,t){pi[mi++]=gi,pi[mi++]=_i,pi[mi++]=hi,gi=t.id,_i=t.overflow,hi=e}var Ci=null,wi=null,Y=!1,Ti=null,Ei=!1,Di=Error(i(519));function Oi(e){throw Pi(ci(Error(i(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?`text`:`HTML`,``)),e)),Di}function ki(e){var t=e.stateNode,n=e.type,r=e.memoizedProps;switch(t[ot]=e,t[st]=r,n){case`dialog`:$(`cancel`,t),$(`close`,t);break;case`iframe`:case`object`:case`embed`:$(`load`,t);break;case`video`:case`audio`:for(n=0;n<gd.length;n++)$(gd[n],t);break;case`source`:$(`error`,t);break;case`img`:case`image`:case`link`:$(`error`,t),$(`load`,t);break;case`details`:$(`toggle`,t);break;case`input`:$(`invalid`,t),Bt(t,r.value,r.defaultValue,r.checked,r.defaultChecked,r.type,r.name,!0);break;case`select`:$(`invalid`,t);break;case`textarea`:$(`invalid`,t),Wt(t,r.value,r.defaultValue,r.children)}n=r.children,typeof n!=`string`&&typeof n!=`number`&&typeof n!=`bigint`||t.textContent===``+n||!0===r.suppressHydrationWarning||jd(t.textContent,n)?(r.popover!=null&&($(`beforetoggle`,t),$(`toggle`,t)),r.onScroll!=null&&$(`scroll`,t),r.onScrollEnd!=null&&$(`scrollend`,t),r.onClick!=null&&(t.onclick=$t),t=!0):t=!1,t||Oi(e,!0)}function Ai(e){for(Ci=e.return;Ci;)switch(Ci.tag){case 5:case 31:case 13:Ei=!1;return;case 27:case 3:Ei=!0;return;default:Ci=Ci.return}}function ji(e){if(e!==Ci)return!1;if(!Y)return Ai(e),Y=!0,!1;var t=e.tag,n;if((n=t!==3&&t!==27)&&((n=t===5)&&(n=e.type,n=!(n!==`form`&&n!==`button`)||Ud(e.type,e.memoizedProps)),n=!n),n&&wi&&Oi(e),Ai(e),t===13){if(e=e.memoizedState,e=e===null?null:e.dehydrated,!e)throw Error(i(317));wi=uf(e)}else if(t===31){if(e=e.memoizedState,e=e===null?null:e.dehydrated,!e)throw Error(i(317));wi=uf(e)}else t===27?(t=wi,Zd(e.type)?(e=lf,lf=null,wi=e):wi=t):wi=Ci?cf(e.stateNode.nextSibling):null;return!0}function Mi(){wi=Ci=null,Y=!1}function Ni(){var e=Ti;return e!==null&&(Yl===null?Yl=e:Yl.push.apply(Yl,e),Ti=null),e}function Pi(e){Ti===null?Ti=[e]:Ti.push(e)}var Fi=F(null),Ii=null,Li=null;function Ri(e,t,n){L(Fi,t._currentValue),t._currentValue=n}function zi(e){e._currentValue=Fi.current,I(Fi)}function Bi(e,t,n){for(;e!==null;){var r=e.alternate;if((e.childLanes&t)===t?r!==null&&(r.childLanes&t)!==t&&(r.childLanes|=t):(e.childLanes|=t,r!==null&&(r.childLanes|=t)),e===n)break;e=e.return}}function Vi(e,t,n,r){var a=e.child;for(a!==null&&(a.return=e);a!==null;){var o=a.dependencies;if(o!==null){var s=a.child;o=o.firstContext;a:for(;o!==null;){var c=o;o=a;for(var l=0;l<t.length;l++)if(c.context===t[l]){o.lanes|=n,c=o.alternate,c!==null&&(c.lanes|=n),Bi(o.return,n,e),r||(s=null);break a}o=c.next}}else if(a.tag===18){if(s=a.return,s===null)throw Error(i(341));s.lanes|=n,o=s.alternate,o!==null&&(o.lanes|=n),Bi(s,n,e),s=null}else s=a.child;if(s!==null)s.return=a;else for(s=a;s!==null;){if(s===e){s=null;break}if(a=s.sibling,a!==null){a.return=s.return,s=a;break}s=s.return}a=s}}function Hi(e,t,n,r){e=null;for(var a=t,o=!1;a!==null;){if(!o){if(a.flags&524288)o=!0;else if(a.flags&262144)break}if(a.tag===10){var s=a.alternate;if(s===null)throw Error(i(387));if(s=s.memoizedProps,s!==null){var c=a.type;q(a.pendingProps.value,s.value)||(e===null?e=[c]:e.push(c))}}else if(a===le.current){if(s=a.alternate,s===null)throw Error(i(387));s.memoizedState.memoizedState!==a.memoizedState.memoizedState&&(e===null?e=[Qf]:e.push(Qf))}a=a.return}e!==null&&Vi(t,e,n,r),t.flags|=262144}function Ui(e){for(e=e.firstContext;e!==null;){if(!q(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function Wi(e){Ii=e,Li=null,e=e.dependencies,e!==null&&(e.firstContext=null)}function Gi(e){return qi(Ii,e)}function Ki(e,t){return Ii===null&&Wi(e),qi(e,t)}function qi(e,t){var n=t._currentValue;if(t={context:t,memoizedValue:n,next:null},Li===null){if(e===null)throw Error(i(308));Li=t,e.dependencies={lanes:0,firstContext:t},e.flags|=524288}else Li=Li.next=t;return n}var Ji=typeof AbortController<`u`?AbortController:function(){var e=[],t=this.signal={aborted:!1,addEventListener:function(t,n){e.push(n)}};this.abort=function(){t.aborted=!0,e.forEach(function(e){return e()})}},Yi=t.unstable_scheduleCallback,Xi=t.unstable_NormalPriority,Zi={$$typeof:C,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function Qi(){return{controller:new Ji,data:new Map,refCount:0}}function $i(e){e.refCount--,e.refCount===0&&Yi(Xi,function(){e.controller.abort()})}var ea=null,ta=0,na=0,ra=null;function ia(e,t){if(ea===null){var n=ea=[];ta=0,na=ud(),ra={status:`pending`,value:void 0,then:function(e){n.push(e)}}}return ta++,t.then(aa,aa),t}function aa(){if(--ta===0&&ea!==null){ra!==null&&(ra.status=`fulfilled`);var e=ea;ea=null,na=0,ra=null;for(var t=0;t<e.length;t++)(0,e[t])()}}function oa(e,t){var n=[],r={status:`pending`,value:null,reason:null,then:function(e){n.push(e)}};return e.then(function(){r.status=`fulfilled`,r.value=t;for(var e=0;e<n.length;e++)(0,n[e])(t)},function(e){for(r.status=`rejected`,r.reason=e,e=0;e<n.length;e++)(0,n[e])(void 0)}),r}var sa=N.S;N.S=function(e,t){Ql=Ee(),typeof t==`object`&&t&&typeof t.then==`function`&&ia(e,t),sa!==null&&sa(e,t)};var ca=F(null);function la(){var e=ca.current;return e===null?Fl.pooledCache:e}function ua(e,t){t===null?L(ca,ca.current):L(ca,t.pool)}function da(){var e=la();return e===null?null:{parent:Zi._currentValue,pool:e}}var fa=Error(i(460)),pa=Error(i(474)),ma=Error(i(542)),ha={then:function(){}};function ga(e){return e=e.status,e===`fulfilled`||e===`rejected`}function _a(e,t,n){switch(n=e[n],n===void 0?e.push(t):n!==t&&(t.then($t,$t),t=n),t.status){case`fulfilled`:return t.value;case`rejected`:throw e=t.reason,xa(e),e;default:if(typeof t.status==`string`)t.then($t,$t);else{if(e=Fl,e!==null&&100<e.shellSuspendCounter)throw Error(i(482));e=t,e.status=`pending`,e.then(function(e){if(t.status===`pending`){var n=t;n.status=`fulfilled`,n.value=e}},function(e){if(t.status===`pending`){var n=t;n.status=`rejected`,n.reason=e}})}switch(t.status){case`fulfilled`:return t.value;case`rejected`:throw e=t.reason,xa(e),e}throw ya=t,fa}}function va(e){try{var t=e._init;return t(e._payload)}catch(e){throw typeof e==`object`&&e&&typeof e.then==`function`?(ya=e,fa):e}}var ya=null;function ba(){if(ya===null)throw Error(i(459));var e=ya;return ya=null,e}function xa(e){if(e===fa||e===ma)throw Error(i(483))}var Sa=null,Ca=0;function wa(e){var t=Ca;return Ca+=1,Sa===null&&(Sa=[]),_a(Sa,e,t)}function Ta(e,t){t=t.props.ref,e.ref=t===void 0?null:t}function Ea(e,t){throw t.$$typeof===g?Error(i(525)):(e=Object.prototype.toString.call(t),Error(i(31,e===`[object Object]`?`object with keys {`+Object.keys(t).join(`, `)+`}`:e)))}function Da(e){function t(t,n){if(e){var r=t.deletions;r===null?(t.deletions=[n],t.flags|=16):r.push(n)}}function n(n,r){if(!e)return null;for(;r!==null;)t(n,r),r=r.sibling;return null}function r(e){for(var t=new Map;e!==null;)e.key===null?t.set(e.index,e):t.set(e.key,e),e=e.sibling;return t}function a(e,t){return e=ei(e,t),e.index=0,e.sibling=null,e}function o(t,n,r){return t.index=r,e?(r=t.alternate,r===null?(t.flags|=67108866,n):(r=r.index,r<n?(t.flags|=67108866,n):r)):(t.flags|=1048576,n)}function s(t){return e&&t.alternate===null&&(t.flags|=67108866),t}function c(e,t,n,r){return t===null||t.tag!==6?(t=ii(n,e.mode,r),t.return=e,t):(t=a(t,n),t.return=e,t)}function l(e,t,n,r){var i=n.type;return i===y?d(e,t,n.props.children,r,n.key):t!==null&&(t.elementType===i||typeof i==`object`&&i&&i.$$typeof===O&&va(i)===t.type)?(t=a(t,n.props),Ta(t,n),t.return=e,t):(t=ni(n.type,n.key,n.props,null,e.mode,r),Ta(t,n),t.return=e,t)}function u(e,t,n,r){return t===null||t.tag!==4||t.stateNode.containerInfo!==n.containerInfo||t.stateNode.implementation!==n.implementation?(t=oi(n,e.mode,r),t.return=e,t):(t=a(t,n.children||[]),t.return=e,t)}function d(e,t,n,r,i){return t===null||t.tag!==7?(t=ri(n,e.mode,r,i),t.return=e,t):(t=a(t,n),t.return=e,t)}function f(e,t,n){if(typeof t==`string`&&t!==``||typeof t==`number`||typeof t==`bigint`)return t=ii(``+t,e.mode,n),t.return=e,t;if(typeof t==`object`&&t){switch(t.$$typeof){case _:return n=ni(t.type,t.key,t.props,null,e.mode,n),Ta(n,t),n.return=e,n;case v:return t=oi(t,e.mode,n),t.return=e,t;case O:return t=va(t),f(e,t,n)}if(ne(t)||M(t))return t=ri(t,e.mode,n,null),t.return=e,t;if(typeof t.then==`function`)return f(e,wa(t),n);if(t.$$typeof===C)return f(e,Ki(e,t),n);Ea(e,t)}return null}function p(e,t,n,r){var i=t===null?null:t.key;if(typeof n==`string`&&n!==``||typeof n==`number`||typeof n==`bigint`)return i===null?c(e,t,``+n,r):null;if(typeof n==`object`&&n){switch(n.$$typeof){case _:return n.key===i?l(e,t,n,r):null;case v:return n.key===i?u(e,t,n,r):null;case O:return n=va(n),p(e,t,n,r)}if(ne(n)||M(n))return i===null?d(e,t,n,r,null):null;if(typeof n.then==`function`)return p(e,t,wa(n),r);if(n.$$typeof===C)return p(e,t,Ki(e,n),r);Ea(e,n)}return null}function m(e,t,n,r,i){if(typeof r==`string`&&r!==``||typeof r==`number`||typeof r==`bigint`)return e=e.get(n)||null,c(t,e,``+r,i);if(typeof r==`object`&&r){switch(r.$$typeof){case _:return e=e.get(r.key===null?n:r.key)||null,l(t,e,r,i);case v:return e=e.get(r.key===null?n:r.key)||null,u(t,e,r,i);case O:return r=va(r),m(e,t,n,r,i)}if(ne(r)||M(r))return e=e.get(n)||null,d(t,e,r,i,null);if(typeof r.then==`function`)return m(e,t,n,wa(r),i);if(r.$$typeof===C)return m(e,t,n,Ki(t,r),i);Ea(t,r)}return null}function h(i,a,s,c){for(var l=null,u=null,d=a,h=a=0,g=null;d!==null&&h<s.length;h++){d.index>h?(g=d,d=null):g=d.sibling;var _=p(i,d,s[h],c);if(_===null){d===null&&(d=g);break}e&&d&&_.alternate===null&&t(i,d),a=o(_,a,h),u===null?l=_:u.sibling=_,u=_,d=g}if(h===s.length)return n(i,d),Y&&vi(i,h),l;if(d===null){for(;h<s.length;h++)d=f(i,s[h],c),d!==null&&(a=o(d,a,h),u===null?l=d:u.sibling=d,u=d);return Y&&vi(i,h),l}for(d=r(d);h<s.length;h++)g=m(d,i,h,s[h],c),g!==null&&(e&&g.alternate!==null&&d.delete(g.key===null?h:g.key),a=o(g,a,h),u===null?l=g:u.sibling=g,u=g);return e&&d.forEach(function(e){return t(i,e)}),Y&&vi(i,h),l}function g(a,s,c,l){if(c==null)throw Error(i(151));for(var u=null,d=null,h=s,g=s=0,_=null,v=c.next();h!==null&&!v.done;g++,v=c.next()){h.index>g?(_=h,h=null):_=h.sibling;var y=p(a,h,v.value,l);if(y===null){h===null&&(h=_);break}e&&h&&y.alternate===null&&t(a,h),s=o(y,s,g),d===null?u=y:d.sibling=y,d=y,h=_}if(v.done)return n(a,h),Y&&vi(a,g),u;if(h===null){for(;!v.done;g++,v=c.next())v=f(a,v.value,l),v!==null&&(s=o(v,s,g),d===null?u=v:d.sibling=v,d=v);return Y&&vi(a,g),u}for(h=r(h);!v.done;g++,v=c.next())v=m(h,a,g,v.value,l),v!==null&&(e&&v.alternate!==null&&h.delete(v.key===null?g:v.key),s=o(v,s,g),d===null?u=v:d.sibling=v,d=v);return e&&h.forEach(function(e){return t(a,e)}),Y&&vi(a,g),u}function b(e,r,o,c){if(typeof o==`object`&&o&&o.type===y&&o.key===null&&(o=o.props.children),typeof o==`object`&&o){switch(o.$$typeof){case _:a:{for(var l=o.key;r!==null;){if(r.key===l){if(l=o.type,l===y){if(r.tag===7){n(e,r.sibling),c=a(r,o.props.children),c.return=e,e=c;break a}}else if(r.elementType===l||typeof l==`object`&&l&&l.$$typeof===O&&va(l)===r.type){n(e,r.sibling),c=a(r,o.props),Ta(c,o),c.return=e,e=c;break a}n(e,r);break}else t(e,r);r=r.sibling}o.type===y?(c=ri(o.props.children,e.mode,c,o.key),c.return=e,e=c):(c=ni(o.type,o.key,o.props,null,e.mode,c),Ta(c,o),c.return=e,e=c)}return s(e);case v:a:{for(l=o.key;r!==null;){if(r.key===l)if(r.tag===4&&r.stateNode.containerInfo===o.containerInfo&&r.stateNode.implementation===o.implementation){n(e,r.sibling),c=a(r,o.children||[]),c.return=e,e=c;break a}else{n(e,r);break}else t(e,r);r=r.sibling}c=oi(o,e.mode,c),c.return=e,e=c}return s(e);case O:return o=va(o),b(e,r,o,c)}if(ne(o))return h(e,r,o,c);if(M(o)){if(l=M(o),typeof l!=`function`)throw Error(i(150));return o=l.call(o),g(e,r,o,c)}if(typeof o.then==`function`)return b(e,r,wa(o),c);if(o.$$typeof===C)return b(e,r,Ki(e,o),c);Ea(e,o)}return typeof o==`string`&&o!==``||typeof o==`number`||typeof o==`bigint`?(o=``+o,r!==null&&r.tag===6?(n(e,r.sibling),c=a(r,o),c.return=e,e=c):(n(e,r),c=ii(o,e.mode,c),c.return=e,e=c),s(e)):n(e,r)}return function(e,t,n,r){try{Ca=0;var i=b(e,t,n,r);return Sa=null,i}catch(t){if(t===fa||t===ma)throw t;var a=Qr(29,t,null,e.mode);return a.lanes=r,a.return=e,a}}}var Oa=Da(!0),ka=Da(!1),Aa=!1;function ja(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Ma(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,callbacks:null})}function Na(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function Pa(e,t,n){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,Pl&2){var i=r.pending;return i===null?t.next=t:(t.next=i.next,i.next=t),r.pending=t,t=Yr(e),Jr(e,null,n),t}return Gr(e,r,t,n),Yr(e)}function Fa(e,t,n){if(t=t.updateQueue,t!==null&&(t=t.shared,n&4194048)){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,$e(e,n)}}function Ia(e,t){var n=e.updateQueue,r=e.alternate;if(r!==null&&(r=r.updateQueue,n===r)){var i=null,a=null;if(n=n.firstBaseUpdate,n!==null){do{var o={lane:n.lane,tag:n.tag,payload:n.payload,callback:null,next:null};a===null?i=a=o:a=a.next=o,n=n.next}while(n!==null);a===null?i=a=t:a=a.next=t}else i=a=t;n={baseState:r.baseState,firstBaseUpdate:i,lastBaseUpdate:a,shared:r.shared,callbacks:r.callbacks},e.updateQueue=n;return}e=n.lastBaseUpdate,e===null?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}var La=!1;function Ra(){if(La){var e=ra;if(e!==null)throw e}}function za(e,t,n,r){La=!1;var i=e.updateQueue;Aa=!1;var a=i.firstBaseUpdate,o=i.lastBaseUpdate,s=i.shared.pending;if(s!==null){i.shared.pending=null;var c=s,l=c.next;c.next=null,o===null?a=l:o.next=l,o=c;var u=e.alternate;u!==null&&(u=u.updateQueue,s=u.lastBaseUpdate,s!==o&&(s===null?u.firstBaseUpdate=l:s.next=l,u.lastBaseUpdate=c))}if(a!==null){var d=i.baseState;o=0,u=l=c=null,s=a;do{var f=s.lane&-536870913,p=f!==s.lane;if(p?(Q&f)===f:(r&f)===f){f!==0&&f===na&&(La=!0),u!==null&&(u=u.next={lane:0,tag:s.tag,payload:s.payload,callback:null,next:null});a:{var m=e,g=s;f=t;var _=n;switch(g.tag){case 1:if(m=g.payload,typeof m==`function`){d=m.call(_,d,f);break a}d=m;break a;case 3:m.flags=m.flags&-65537|128;case 0:if(m=g.payload,f=typeof m==`function`?m.call(_,d,f):m,f==null)break a;d=h({},d,f);break a;case 2:Aa=!0}}f=s.callback,f!==null&&(e.flags|=64,p&&(e.flags|=8192),p=i.callbacks,p===null?i.callbacks=[f]:p.push(f))}else p={lane:f,tag:s.tag,payload:s.payload,callback:s.callback,next:null},u===null?(l=u=p,c=d):u=u.next=p,o|=f;if(s=s.next,s===null){if(s=i.shared.pending,s===null)break;p=s,s=p.next,p.next=null,i.lastBaseUpdate=p,i.shared.pending=null}}while(1);u===null&&(c=d),i.baseState=c,i.firstBaseUpdate=l,i.lastBaseUpdate=u,a===null&&(i.shared.lanes=0),Ul|=o,e.lanes=o,e.memoizedState=d}}function Ba(e,t){if(typeof e!=`function`)throw Error(i(191,e));e.call(t)}function Va(e,t){var n=e.callbacks;if(n!==null)for(e.callbacks=null,e=0;e<n.length;e++)Ba(n[e],t)}var Ha=F(null),Ua=F(0);function Wa(e,t){e=Vl,L(Ua,e),L(Ha,t),Vl=e|t.baseLanes}function Ga(){L(Ua,Vl),L(Ha,Ha.current)}function Ka(){Vl=Ua.current,I(Ha),I(Ua)}var qa=F(null),Ja=null;function Ya(e){var t=e.alternate;L(eo,eo.current&1),L(qa,e),Ja===null&&(t===null||Ha.current!==null||t.memoizedState!==null)&&(Ja=e)}function Xa(e){L(eo,eo.current),L(qa,e),Ja===null&&(Ja=e)}function Za(e){e.tag===22?(L(eo,eo.current),L(qa,e),Ja===null&&(Ja=e)):Qa(e)}function Qa(){L(eo,eo.current),L(qa,qa.current)}function $a(e){I(qa),Ja===e&&(Ja=null),I(eo)}var eo=F(0);function to(e){for(var t=e;t!==null;){if(t.tag===13){var n=t.memoizedState;if(n!==null&&(n=n.dehydrated,n===null||af(n)||of(n)))return t}else if(t.tag===19&&(t.memoizedProps.revealOrder===`forwards`||t.memoizedProps.revealOrder===`backwards`||t.memoizedProps.revealOrder===`unstable_legacy-backwards`||t.memoizedProps.revealOrder===`together`)){if(t.flags&128)return t}else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}var no=0,X=null,ro=null,io=null,ao=!1,oo=!1,so=!1,co=0,lo=0,uo=null,fo=0;function po(){throw Error(i(321))}function mo(e,t){if(t===null)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!q(e[n],t[n]))return!1;return!0}function ho(e,t,n,r,i,a){return no=a,X=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,N.H=e===null||e.memoizedState===null?Ms:Ns,so=!1,a=n(r,i),so=!1,oo&&(a=_o(t,n,r,i)),go(e),a}function go(e){N.H=js;var t=ro!==null&&ro.next!==null;if(no=0,io=ro=X=null,ao=!1,lo=0,uo=null,t)throw Error(i(300));e===null||Xs||(e=e.dependencies,e!==null&&Ui(e)&&(Xs=!0))}function _o(e,t,n,r){X=e;var a=0;do{if(oo&&(uo=null),lo=0,oo=!1,25<=a)throw Error(i(301));if(a+=1,io=ro=null,e.updateQueue!=null){var o=e.updateQueue;o.lastEffect=null,o.events=null,o.stores=null,o.memoCache!=null&&(o.memoCache.index=0)}N.H=Ps,o=t(n,r)}while(oo);return o}function vo(){var e=N.H,t=e.useState()[0];return t=typeof t.then==`function`?To(t):t,e=e.useState()[0],(ro===null?null:ro.memoizedState)!==e&&(X.flags|=1024),t}function yo(){var e=co!==0;return co=0,e}function bo(e,t,n){t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~n}function xo(e){if(ao){for(e=e.memoizedState;e!==null;){var t=e.queue;t!==null&&(t.pending=null),e=e.next}ao=!1}no=0,io=ro=X=null,oo=!1,lo=co=0,uo=null}function So(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return io===null?X.memoizedState=io=e:io=io.next=e,io}function Co(){if(ro===null){var e=X.alternate;e=e===null?null:e.memoizedState}else e=ro.next;var t=io===null?X.memoizedState:io.next;if(t!==null)io=t,ro=e;else{if(e===null)throw X.alternate===null?Error(i(467)):Error(i(310));ro=e,e={memoizedState:ro.memoizedState,baseState:ro.baseState,baseQueue:ro.baseQueue,queue:ro.queue,next:null},io===null?X.memoizedState=io=e:io=io.next=e}return io}function wo(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function To(e){var t=lo;return lo+=1,uo===null&&(uo=[]),e=_a(uo,e,t),t=X,(io===null?t.memoizedState:io.next)===null&&(t=t.alternate,N.H=t===null||t.memoizedState===null?Ms:Ns),e}function Eo(e){if(typeof e==`object`&&e){if(typeof e.then==`function`)return To(e);if(e.$$typeof===C)return Gi(e)}throw Error(i(438,String(e)))}function Do(e){var t=null,n=X.updateQueue;if(n!==null&&(t=n.memoCache),t==null){var r=X.alternate;r!==null&&(r=r.updateQueue,r!==null&&(r=r.memoCache,r!=null&&(t={data:r.data.map(function(e){return e.slice()}),index:0})))}if(t??={data:[],index:0},n===null&&(n=wo(),X.updateQueue=n),n.memoCache=t,n=t.data[t.index],n===void 0)for(n=t.data[t.index]=Array(e),r=0;r<e;r++)n[r]=A;return t.index++,n}function Oo(e,t){return typeof t==`function`?t(e):t}function ko(e){return Ao(Co(),ro,e)}function Ao(e,t,n){var r=e.queue;if(r===null)throw Error(i(311));r.lastRenderedReducer=n;var a=e.baseQueue,o=r.pending;if(o!==null){if(a!==null){var s=a.next;a.next=o.next,o.next=s}t.baseQueue=a=o,r.pending=null}if(o=e.baseState,a===null)e.memoizedState=o;else{t=a.next;var c=s=null,l=null,u=t,d=!1;do{var f=u.lane&-536870913;if(f===u.lane?(no&f)===f:(Q&f)===f){var p=u.revertLane;if(p===0)l!==null&&(l=l.next={lane:0,revertLane:0,gesture:null,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null}),f===na&&(d=!0);else if((no&p)===p){u=u.next,p===na&&(d=!0);continue}else f={lane:0,revertLane:u.revertLane,gesture:null,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null},l===null?(c=l=f,s=o):l=l.next=f,X.lanes|=p,Ul|=p;f=u.action,so&&n(o,f),o=u.hasEagerState?u.eagerState:n(o,f)}else p={lane:f,revertLane:u.revertLane,gesture:u.gesture,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null},l===null?(c=l=p,s=o):l=l.next=p,X.lanes|=f,Ul|=f;u=u.next}while(u!==null&&u!==t);if(l===null?s=o:l.next=c,!q(o,e.memoizedState)&&(Xs=!0,d&&(n=ra,n!==null)))throw n;e.memoizedState=o,e.baseState=s,e.baseQueue=l,r.lastRenderedState=o}return a===null&&(r.lanes=0),[e.memoizedState,r.dispatch]}function jo(e){var t=Co(),n=t.queue;if(n===null)throw Error(i(311));n.lastRenderedReducer=e;var r=n.dispatch,a=n.pending,o=t.memoizedState;if(a!==null){n.pending=null;var s=a=a.next;do o=e(o,s.action),s=s.next;while(s!==a);q(o,t.memoizedState)||(Xs=!0),t.memoizedState=o,t.baseQueue===null&&(t.baseState=o),n.lastRenderedState=o}return[o,r]}function Mo(e,t,n){var r=X,a=Co(),o=Y;if(o){if(n===void 0)throw Error(i(407));n=n()}else n=t();var s=!q((ro||a).memoizedState,n);if(s&&(a.memoizedState=n,Xs=!0),a=a.queue,rs(Fo.bind(null,r,a,e),[e]),a.getSnapshot!==t||s||io!==null&&io.memoizedState.tag&1){if(r.flags|=2048,Qo(9,{destroy:void 0},Po.bind(null,r,a,n,t),null),Fl===null)throw Error(i(349));o||no&127||No(r,t,n)}return n}function No(e,t,n){e.flags|=16384,e={getSnapshot:t,value:n},t=X.updateQueue,t===null?(t=wo(),X.updateQueue=t,t.stores=[e]):(n=t.stores,n===null?t.stores=[e]:n.push(e))}function Po(e,t,n,r){t.value=n,t.getSnapshot=r,Io(t)&&Lo(e)}function Fo(e,t,n){return n(function(){Io(t)&&Lo(e)})}function Io(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!q(e,n)}catch{return!0}}function Lo(e){var t=qr(e,2);t!==null&&pu(t,e,2)}function Ro(e){var t=So();if(typeof e==`function`){var n=e;if(e=n(),so){Ie(!0);try{n()}finally{Ie(!1)}}}return t.memoizedState=t.baseState=e,t.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Oo,lastRenderedState:e},t}function zo(e,t,n,r){return e.baseState=n,Ao(e,ro,typeof r==`function`?r:Oo)}function Bo(e,t,n,r,a){if(Os(e))throw Error(i(485));if(e=t.action,e!==null){var o={payload:a,action:e,next:null,isTransition:!0,status:`pending`,value:null,reason:null,listeners:[],then:function(e){o.listeners.push(e)}};N.T===null?o.isTransition=!1:n(!0),r(o),n=t.pending,n===null?(o.next=t.pending=o,Vo(t,o)):(o.next=n.next,t.pending=n.next=o)}}function Vo(e,t){var n=t.action,r=t.payload,i=e.state;if(t.isTransition){var a=N.T,o={};N.T=o;try{var s=n(i,r),c=N.S;c!==null&&c(o,s),Ho(e,t,s)}catch(n){Wo(e,t,n)}finally{a!==null&&o.types!==null&&(a.types=o.types),N.T=a}}else try{a=n(i,r),Ho(e,t,a)}catch(n){Wo(e,t,n)}}function Ho(e,t,n){typeof n==`object`&&n&&typeof n.then==`function`?n.then(function(n){Uo(e,t,n)},function(n){return Wo(e,t,n)}):Uo(e,t,n)}function Uo(e,t,n){t.status=`fulfilled`,t.value=n,Go(t),e.state=n,t=e.pending,t!==null&&(n=t.next,n===t?e.pending=null:(n=n.next,t.next=n,Vo(e,n)))}function Wo(e,t,n){var r=e.pending;if(e.pending=null,r!==null){r=r.next;do t.status=`rejected`,t.reason=n,Go(t),t=t.next;while(t!==r)}e.action=null}function Go(e){e=e.listeners;for(var t=0;t<e.length;t++)(0,e[t])()}function Ko(e,t){return t}function qo(e,t){if(Y){var n=Fl.formState;if(n!==null){a:{var r=X;if(Y){if(wi){b:{for(var i=wi,a=Ei;i.nodeType!==8;){if(!a){i=null;break b}if(i=cf(i.nextSibling),i===null){i=null;break b}}a=i.data,i=a===`F!`||a===`F`?i:null}if(i){wi=cf(i.nextSibling),r=i.data===`F!`;break a}}Oi(r)}r=!1}r&&(t=n[0])}}return n=So(),n.memoizedState=n.baseState=t,r={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Ko,lastRenderedState:t},n.queue=r,n=Ts.bind(null,X,r),r.dispatch=n,r=Ro(!1),a=Ds.bind(null,X,!1,r.queue),r=So(),i={state:t,dispatch:null,action:e,pending:null},r.queue=i,n=Bo.bind(null,X,i,a,n),i.dispatch=n,r.memoizedState=e,[t,n,!1]}function Jo(e){return Yo(Co(),ro,e)}function Yo(e,t,n){if(t=Ao(e,t,Ko)[0],e=ko(Oo)[0],typeof t==`object`&&t&&typeof t.then==`function`)try{var r=To(t)}catch(e){throw e===fa?ma:e}else r=t;t=Co();var i=t.queue,a=i.dispatch;return n!==t.memoizedState&&(X.flags|=2048,Qo(9,{destroy:void 0},Xo.bind(null,i,n),null)),[r,a,e]}function Xo(e,t){e.action=t}function Zo(e){var t=Co(),n=ro;if(n!==null)return Yo(t,n,e);Co(),t=t.memoizedState,n=Co();var r=n.queue.dispatch;return n.memoizedState=e,[t,r,!1]}function Qo(e,t,n,r){return e={tag:e,create:n,deps:r,inst:t,next:null},t=X.updateQueue,t===null&&(t=wo(),X.updateQueue=t),n=t.lastEffect,n===null?t.lastEffect=e.next=e:(r=n.next,n.next=e,e.next=r,t.lastEffect=e),e}function $o(){return Co().memoizedState}function es(e,t,n,r){var i=So();X.flags|=e,i.memoizedState=Qo(1|t,{destroy:void 0},n,r===void 0?null:r)}function ts(e,t,n,r){var i=Co();r=r===void 0?null:r;var a=i.memoizedState.inst;ro!==null&&r!==null&&mo(r,ro.memoizedState.deps)?i.memoizedState=Qo(t,a,n,r):(X.flags|=e,i.memoizedState=Qo(1|t,a,n,r))}function ns(e,t){es(8390656,8,e,t)}function rs(e,t){ts(2048,8,e,t)}function is(e){X.flags|=4;var t=X.updateQueue;if(t===null)t=wo(),X.updateQueue=t,t.events=[e];else{var n=t.events;n===null?t.events=[e]:n.push(e)}}function as(e){var t=Co().memoizedState;return is({ref:t,nextImpl:e}),function(){if(Pl&2)throw Error(i(440));return t.impl.apply(void 0,arguments)}}function os(e,t){return ts(4,2,e,t)}function ss(e,t){return ts(4,4,e,t)}function cs(e,t){if(typeof t==`function`){e=e();var n=t(e);return function(){typeof n==`function`?n():t(null)}}if(t!=null)return e=e(),t.current=e,function(){t.current=null}}function ls(e,t,n){n=n==null?null:n.concat([e]),ts(4,4,cs.bind(null,t,e),n)}function us(){}function ds(e,t){var n=Co();t=t===void 0?null:t;var r=n.memoizedState;return t!==null&&mo(t,r[1])?r[0]:(n.memoizedState=[e,t],e)}function fs(e,t){var n=Co();t=t===void 0?null:t;var r=n.memoizedState;if(t!==null&&mo(t,r[1]))return r[0];if(r=e(),so){Ie(!0);try{e()}finally{Ie(!1)}}return n.memoizedState=[r,t],r}function ps(e,t,n){return n===void 0||no&1073741824&&!(Q&261930)?e.memoizedState=t:(e.memoizedState=n,e=fu(),X.lanes|=e,Ul|=e,n)}function ms(e,t,n,r){return q(n,t)?n:Ha.current===null?!(no&42)||no&1073741824&&!(Q&261930)?(Xs=!0,e.memoizedState=n):(e=fu(),X.lanes|=e,Ul|=e,t):(e=ps(e,n,r),q(e,t)||(Xs=!0),e)}function hs(e,t,n,r,i){var a=P.p;P.p=a!==0&&8>a?a:8;var o=N.T,s={};N.T=s,Ds(e,!1,t,n);try{var c=i(),l=N.S;l!==null&&l(s,c),typeof c==`object`&&c&&typeof c.then==`function`?Es(e,t,oa(c,r),du(e)):Es(e,t,r,du(e))}catch(n){Es(e,t,{then:function(){},status:`rejected`,reason:n},du())}finally{P.p=a,o!==null&&s.types!==null&&(o.types=s.types),N.T=o}}function gs(){}function _s(e,t,n,r){if(e.tag!==5)throw Error(i(476));var a=vs(e).queue;hs(e,a,t,re,n===null?gs:function(){return ys(e),n(r)})}function vs(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:re,baseState:re,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Oo,lastRenderedState:re},next:null};var n={};return t.next={memoizedState:n,baseState:n,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Oo,lastRenderedState:n},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function ys(e){var t=vs(e);t.next===null&&(t=e.alternate.memoizedState),Es(e,t.next.queue,{},du())}function bs(){return Gi(Qf)}function xs(){return Co().memoizedState}function Ss(){return Co().memoizedState}function Cs(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var n=du();e=Na(n);var r=Pa(t,e,n);r!==null&&(pu(r,t,n),Fa(r,t,n)),t={cache:Qi()},e.payload=t;return}t=t.return}}function ws(e,t,n){var r=du();n={lane:r,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null},Os(e)?ks(t,n):(n=Kr(e,t,n,r),n!==null&&(pu(n,e,r),As(n,t,r)))}function Ts(e,t,n){Es(e,t,n,du())}function Es(e,t,n,r){var i={lane:r,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null};if(Os(e))ks(t,i);else{var a=e.alternate;if(e.lanes===0&&(a===null||a.lanes===0)&&(a=t.lastRenderedReducer,a!==null))try{var o=t.lastRenderedState,s=a(o,n);if(i.hasEagerState=!0,i.eagerState=s,q(s,o))return Gr(e,t,i,0),Fl===null&&Wr(),!1}catch{}if(n=Kr(e,t,i,r),n!==null)return pu(n,e,r),As(n,t,r),!0}return!1}function Ds(e,t,n,r){if(r={lane:2,revertLane:ud(),gesture:null,action:r,hasEagerState:!1,eagerState:null,next:null},Os(e)){if(t)throw Error(i(479))}else t=Kr(e,n,r,2),t!==null&&pu(t,e,2)}function Os(e){var t=e.alternate;return e===X||t!==null&&t===X}function ks(e,t){oo=ao=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function As(e,t,n){if(n&4194048){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,$e(e,n)}}var js={readContext:Gi,use:Eo,useCallback:po,useContext:po,useEffect:po,useImperativeHandle:po,useLayoutEffect:po,useInsertionEffect:po,useMemo:po,useReducer:po,useRef:po,useState:po,useDebugValue:po,useDeferredValue:po,useTransition:po,useSyncExternalStore:po,useId:po,useHostTransitionStatus:po,useFormState:po,useActionState:po,useOptimistic:po,useMemoCache:po,useCacheRefresh:po};js.useEffectEvent=po;var Ms={readContext:Gi,use:Eo,useCallback:function(e,t){return So().memoizedState=[e,t===void 0?null:t],e},useContext:Gi,useEffect:ns,useImperativeHandle:function(e,t,n){n=n==null?null:n.concat([e]),es(4194308,4,cs.bind(null,t,e),n)},useLayoutEffect:function(e,t){return es(4194308,4,e,t)},useInsertionEffect:function(e,t){es(4,2,e,t)},useMemo:function(e,t){var n=So();t=t===void 0?null:t;var r=e();if(so){Ie(!0);try{e()}finally{Ie(!1)}}return n.memoizedState=[r,t],r},useReducer:function(e,t,n){var r=So();if(n!==void 0){var i=n(t);if(so){Ie(!0);try{n(t)}finally{Ie(!1)}}}else i=t;return r.memoizedState=r.baseState=i,e={pending:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:i},r.queue=e,e=e.dispatch=ws.bind(null,X,e),[r.memoizedState,e]},useRef:function(e){var t=So();return e={current:e},t.memoizedState=e},useState:function(e){e=Ro(e);var t=e.queue,n=Ts.bind(null,X,t);return t.dispatch=n,[e.memoizedState,n]},useDebugValue:us,useDeferredValue:function(e,t){return ps(So(),e,t)},useTransition:function(){var e=Ro(!1);return e=hs.bind(null,X,e.queue,!0,!1),So().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,n){var r=X,a=So();if(Y){if(n===void 0)throw Error(i(407));n=n()}else{if(n=t(),Fl===null)throw Error(i(349));Q&127||No(r,t,n)}a.memoizedState=n;var o={value:n,getSnapshot:t};return a.queue=o,ns(Fo.bind(null,r,o,e),[e]),r.flags|=2048,Qo(9,{destroy:void 0},Po.bind(null,r,o,n,t),null),n},useId:function(){var e=So(),t=Fl.identifierPrefix;if(Y){var n=_i,r=gi;n=(r&~(1<<32-Le(r)-1)).toString(32)+n,t=`_`+t+`R_`+n,n=co++,0<n&&(t+=`H`+n.toString(32)),t+=`_`}else n=fo++,t=`_`+t+`r_`+n.toString(32)+`_`;return e.memoizedState=t},useHostTransitionStatus:bs,useFormState:qo,useActionState:qo,useOptimistic:function(e){var t=So();t.memoizedState=t.baseState=e;var n={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return t.queue=n,t=Ds.bind(null,X,!0,n),n.dispatch=t,[e,t]},useMemoCache:Do,useCacheRefresh:function(){return So().memoizedState=Cs.bind(null,X)},useEffectEvent:function(e){var t=So(),n={impl:e};return t.memoizedState=n,function(){if(Pl&2)throw Error(i(440));return n.impl.apply(void 0,arguments)}}},Ns={readContext:Gi,use:Eo,useCallback:ds,useContext:Gi,useEffect:rs,useImperativeHandle:ls,useInsertionEffect:os,useLayoutEffect:ss,useMemo:fs,useReducer:ko,useRef:$o,useState:function(){return ko(Oo)},useDebugValue:us,useDeferredValue:function(e,t){return ms(Co(),ro.memoizedState,e,t)},useTransition:function(){var e=ko(Oo)[0],t=Co().memoizedState;return[typeof e==`boolean`?e:To(e),t]},useSyncExternalStore:Mo,useId:xs,useHostTransitionStatus:bs,useFormState:Jo,useActionState:Jo,useOptimistic:function(e,t){return zo(Co(),ro,e,t)},useMemoCache:Do,useCacheRefresh:Ss};Ns.useEffectEvent=as;var Ps={readContext:Gi,use:Eo,useCallback:ds,useContext:Gi,useEffect:rs,useImperativeHandle:ls,useInsertionEffect:os,useLayoutEffect:ss,useMemo:fs,useReducer:jo,useRef:$o,useState:function(){return jo(Oo)},useDebugValue:us,useDeferredValue:function(e,t){var n=Co();return ro===null?ps(n,e,t):ms(n,ro.memoizedState,e,t)},useTransition:function(){var e=jo(Oo)[0],t=Co().memoizedState;return[typeof e==`boolean`?e:To(e),t]},useSyncExternalStore:Mo,useId:xs,useHostTransitionStatus:bs,useFormState:Zo,useActionState:Zo,useOptimistic:function(e,t){var n=Co();return ro===null?(n.baseState=e,[e,n.queue.dispatch]):zo(n,ro,e,t)},useMemoCache:Do,useCacheRefresh:Ss};Ps.useEffectEvent=as;function Fs(e,t,n,r){t=e.memoizedState,n=n(r,t),n=n==null?t:h({},t,n),e.memoizedState=n,e.lanes===0&&(e.updateQueue.baseState=n)}var Is={enqueueSetState:function(e,t,n){e=e._reactInternals;var r=du(),i=Na(r);i.payload=t,n!=null&&(i.callback=n),t=Pa(e,i,r),t!==null&&(pu(t,e,r),Fa(t,e,r))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var r=du(),i=Na(r);i.tag=1,i.payload=t,n!=null&&(i.callback=n),t=Pa(e,i,r),t!==null&&(pu(t,e,r),Fa(t,e,r))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=du(),r=Na(n);r.tag=2,t!=null&&(r.callback=t),t=Pa(e,r,n),t!==null&&(pu(t,e,n),Fa(t,e,n))}};function Ls(e,t,n,r,i,a,o){return e=e.stateNode,typeof e.shouldComponentUpdate==`function`?e.shouldComponentUpdate(r,a,o):t.prototype&&t.prototype.isPureReactComponent?!mr(n,r)||!mr(i,a):!0}function Rs(e,t,n,r){e=t.state,typeof t.componentWillReceiveProps==`function`&&t.componentWillReceiveProps(n,r),typeof t.UNSAFE_componentWillReceiveProps==`function`&&t.UNSAFE_componentWillReceiveProps(n,r),t.state!==e&&Is.enqueueReplaceState(t,t.state,null)}function zs(e,t){var n=t;if(`ref`in t)for(var r in n={},t)r!==`ref`&&(n[r]=t[r]);if(e=e.defaultProps)for(var i in n===t&&(n=h({},n)),e)n[i]===void 0&&(n[i]=e[i]);return n}function Bs(e){Br(e)}function Vs(e){console.error(e)}function Hs(e){Br(e)}function Us(e,t){try{var n=e.onUncaughtError;n(t.value,{componentStack:t.stack})}catch(e){setTimeout(function(){throw e})}}function Ws(e,t,n){try{var r=e.onCaughtError;r(n.value,{componentStack:n.stack,errorBoundary:t.tag===1?t.stateNode:null})}catch(e){setTimeout(function(){throw e})}}function Gs(e,t,n){return n=Na(n),n.tag=3,n.payload={element:null},n.callback=function(){Us(e,t)},n}function Ks(e){return e=Na(e),e.tag=3,e}function qs(e,t,n,r){var i=n.type.getDerivedStateFromError;if(typeof i==`function`){var a=r.value;e.payload=function(){return i(a)},e.callback=function(){Ws(t,n,r)}}var o=n.stateNode;o!==null&&typeof o.componentDidCatch==`function`&&(e.callback=function(){Ws(t,n,r),typeof i!=`function`&&(tu===null?tu=new Set([this]):tu.add(this));var e=r.stack;this.componentDidCatch(r.value,{componentStack:e===null?``:e})})}function Js(e,t,n,r,a){if(n.flags|=32768,typeof r==`object`&&r&&typeof r.then==`function`){if(t=n.alternate,t!==null&&Hi(t,n,a,!0),n=qa.current,n!==null){switch(n.tag){case 31:case 13:return Ja===null?Tu():n.alternate===null&&Hl===0&&(Hl=3),n.flags&=-257,n.flags|=65536,n.lanes=a,r===ha?n.flags|=16384:(t=n.updateQueue,t===null?n.updateQueue=new Set([r]):t.add(r),Wu(e,r,a)),!1;case 22:return n.flags|=65536,r===ha?n.flags|=16384:(t=n.updateQueue,t===null?(t={transitions:null,markerInstances:null,retryQueue:new Set([r])},n.updateQueue=t):(n=t.retryQueue,n===null?t.retryQueue=new Set([r]):n.add(r)),Wu(e,r,a)),!1}throw Error(i(435,n.tag))}return Wu(e,r,a),Tu(),!1}if(Y)return t=qa.current,t===null?(r!==Di&&(t=Error(i(423),{cause:r}),Pi(ci(t,n))),e=e.current.alternate,e.flags|=65536,a&=-a,e.lanes|=a,r=ci(r,n),a=Gs(e.stateNode,r,a),Ia(e,a),Hl!==4&&(Hl=2)):(!(t.flags&65536)&&(t.flags|=256),t.flags|=65536,t.lanes=a,r!==Di&&(e=Error(i(422),{cause:r}),Pi(ci(e,n)))),!1;var o=Error(i(520),{cause:r});if(o=ci(o,n),Jl===null?Jl=[o]:Jl.push(o),Hl!==4&&(Hl=2),t===null)return!0;r=ci(r,n),n=t;do{switch(n.tag){case 3:return n.flags|=65536,e=a&-a,n.lanes|=e,e=Gs(n.stateNode,r,e),Ia(n,e),!1;case 1:if(t=n.type,o=n.stateNode,!(n.flags&128)&&(typeof t.getDerivedStateFromError==`function`||o!==null&&typeof o.componentDidCatch==`function`&&(tu===null||!tu.has(o))))return n.flags|=65536,a&=-a,n.lanes|=a,a=Ks(a),qs(a,e,n,r),Ia(n,a),!1}n=n.return}while(n!==null);return!1}var Ys=Error(i(461)),Xs=!1;function Zs(e,t,n,r){t.child=e===null?ka(t,null,n,r):Oa(t,e.child,n,r)}function Qs(e,t,n,r,i){n=n.render;var a=t.ref;if(`ref`in r){var o={};for(var s in r)s!==`ref`&&(o[s]=r[s])}else o=r;return Wi(t),r=ho(e,t,n,o,a,i),s=yo(),e!==null&&!Xs?(bo(e,t,i),Sc(e,t,i)):(Y&&s&&bi(t),t.flags|=1,Zs(e,t,r,i),t.child)}function $s(e,t,n,r,i){if(e===null){var a=n.type;return typeof a==`function`&&!$r(a)&&a.defaultProps===void 0&&n.compare===null?(t.tag=15,t.type=a,ec(e,t,a,r,i)):(e=ni(n.type,null,r,t,t.mode,i),e.ref=t.ref,e.return=t,t.child=e)}if(a=e.child,!Cc(e,i)){var o=a.memoizedProps;if(n=n.compare,n=n===null?mr:n,n(o,r)&&e.ref===t.ref)return Sc(e,t,i)}return t.flags|=1,e=ei(a,r),e.ref=t.ref,e.return=t,t.child=e}function ec(e,t,n,r,i){if(e!==null){var a=e.memoizedProps;if(mr(a,r)&&e.ref===t.ref)if(Xs=!1,t.pendingProps=r=a,Cc(e,i))e.flags&131072&&(Xs=!0);else return t.lanes=e.lanes,Sc(e,t,i)}return cc(e,t,n,r,i)}function tc(e,t,n,r){var i=r.children,a=e===null?null:e.memoizedState;if(e===null&&t.stateNode===null&&(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),r.mode===`hidden`){if(t.flags&128){if(a=a===null?n:a.baseLanes|n,e!==null){for(r=t.child=e.child,i=0;r!==null;)i=i|r.lanes|r.childLanes,r=r.sibling;r=i&~a}else r=0,t.child=null;return rc(e,t,a,n,r)}if(n&536870912)t.memoizedState={baseLanes:0,cachePool:null},e!==null&&ua(t,a===null?null:a.cachePool),a===null?Ga():Wa(t,a),Za(t);else return r=t.lanes=536870912,rc(e,t,a===null?n:a.baseLanes|n,n,r)}else a===null?(e!==null&&ua(t,null),Ga(),Qa(t)):(ua(t,a.cachePool),Wa(t,a),Qa(t),t.memoizedState=null);return Zs(e,t,i,n),t.child}function nc(e,t){return e!==null&&e.tag===22||t.stateNode!==null||(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),t.sibling}function rc(e,t,n,r,i){var a=la();return a=a===null?null:{parent:Zi._currentValue,pool:a},t.memoizedState={baseLanes:n,cachePool:a},e!==null&&ua(t,null),Ga(),Za(t),e!==null&&Hi(e,t,r,!0),t.childLanes=i,null}function ic(e,t){return t=_c({mode:t.mode,children:t.children},e.mode),t.ref=e.ref,e.child=t,t.return=e,t}function ac(e,t,n){return Oa(t,e.child,null,n),e=ic(t,t.pendingProps),e.flags|=2,$a(t),t.memoizedState=null,e}function oc(e,t,n){var r=t.pendingProps,a=(t.flags&128)!=0;if(t.flags&=-129,e===null){if(Y){if(r.mode===`hidden`)return e=ic(t,r),t.lanes=536870912,nc(null,e);if(Xa(t),(e=wi)?(e=rf(e,Ei),e=e!==null&&e.data===`&`?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:hi===null?null:{id:gi,overflow:_i},retryLane:536870912,hydrationErrors:null},n=ai(e),n.return=t,t.child=n,Ci=t,wi=null)):e=null,e===null)throw Oi(t);return t.lanes=536870912,null}return ic(t,r)}var o=e.memoizedState;if(o!==null){var s=o.dehydrated;if(Xa(t),a)if(t.flags&256)t.flags&=-257,t=ac(e,t,n);else if(t.memoizedState!==null)t.child=e.child,t.flags|=128,t=null;else throw Error(i(558));else if(Xs||Hi(e,t,n,!1),a=(n&e.childLanes)!==0,Xs||a){if(r=Fl,r!==null&&(s=et(r,n),s!==0&&s!==o.retryLane))throw o.retryLane=s,qr(e,s),pu(r,e,s),Ys;Tu(),t=ac(e,t,n)}else e=o.treeContext,wi=cf(s.nextSibling),Ci=t,Y=!0,Ti=null,Ei=!1,e!==null&&Si(t,e),t=ic(t,r),t.flags|=4096;return t}return e=ei(e.child,{mode:r.mode,children:r.children}),e.ref=t.ref,t.child=e,e.return=t,e}function sc(e,t){var n=t.ref;if(n===null)e!==null&&e.ref!==null&&(t.flags|=4194816);else{if(typeof n!=`function`&&typeof n!=`object`)throw Error(i(284));(e===null||e.ref!==n)&&(t.flags|=4194816)}}function cc(e,t,n,r,i){return Wi(t),n=ho(e,t,n,r,void 0,i),r=yo(),e!==null&&!Xs?(bo(e,t,i),Sc(e,t,i)):(Y&&r&&bi(t),t.flags|=1,Zs(e,t,n,i),t.child)}function lc(e,t,n,r,i,a){return Wi(t),t.updateQueue=null,n=_o(t,r,n,i),go(e),r=yo(),e!==null&&!Xs?(bo(e,t,a),Sc(e,t,a)):(Y&&r&&bi(t),t.flags|=1,Zs(e,t,n,a),t.child)}function uc(e,t,n,r,i){if(Wi(t),t.stateNode===null){var a=Xr,o=n.contextType;typeof o==`object`&&o&&(a=Gi(o)),a=new n(r,a),t.memoizedState=a.state!==null&&a.state!==void 0?a.state:null,a.updater=Is,t.stateNode=a,a._reactInternals=t,a=t.stateNode,a.props=r,a.state=t.memoizedState,a.refs={},ja(t),o=n.contextType,a.context=typeof o==`object`&&o?Gi(o):Xr,a.state=t.memoizedState,o=n.getDerivedStateFromProps,typeof o==`function`&&(Fs(t,n,o,r),a.state=t.memoizedState),typeof n.getDerivedStateFromProps==`function`||typeof a.getSnapshotBeforeUpdate==`function`||typeof a.UNSAFE_componentWillMount!=`function`&&typeof a.componentWillMount!=`function`||(o=a.state,typeof a.componentWillMount==`function`&&a.componentWillMount(),typeof a.UNSAFE_componentWillMount==`function`&&a.UNSAFE_componentWillMount(),o!==a.state&&Is.enqueueReplaceState(a,a.state,null),za(t,r,a,i),Ra(),a.state=t.memoizedState),typeof a.componentDidMount==`function`&&(t.flags|=4194308),r=!0}else if(e===null){a=t.stateNode;var s=t.memoizedProps,c=zs(n,s);a.props=c;var l=a.context,u=n.contextType;o=Xr,typeof u==`object`&&u&&(o=Gi(u));var d=n.getDerivedStateFromProps;u=typeof d==`function`||typeof a.getSnapshotBeforeUpdate==`function`,s=t.pendingProps!==s,u||typeof a.UNSAFE_componentWillReceiveProps!=`function`&&typeof a.componentWillReceiveProps!=`function`||(s||l!==o)&&Rs(t,a,r,o),Aa=!1;var f=t.memoizedState;a.state=f,za(t,r,a,i),Ra(),l=t.memoizedState,s||f!==l||Aa?(typeof d==`function`&&(Fs(t,n,d,r),l=t.memoizedState),(c=Aa||Ls(t,n,c,r,f,l,o))?(u||typeof a.UNSAFE_componentWillMount!=`function`&&typeof a.componentWillMount!=`function`||(typeof a.componentWillMount==`function`&&a.componentWillMount(),typeof a.UNSAFE_componentWillMount==`function`&&a.UNSAFE_componentWillMount()),typeof a.componentDidMount==`function`&&(t.flags|=4194308)):(typeof a.componentDidMount==`function`&&(t.flags|=4194308),t.memoizedProps=r,t.memoizedState=l),a.props=r,a.state=l,a.context=o,r=c):(typeof a.componentDidMount==`function`&&(t.flags|=4194308),r=!1)}else{a=t.stateNode,Ma(e,t),o=t.memoizedProps,u=zs(n,o),a.props=u,d=t.pendingProps,f=a.context,l=n.contextType,c=Xr,typeof l==`object`&&l&&(c=Gi(l)),s=n.getDerivedStateFromProps,(l=typeof s==`function`||typeof a.getSnapshotBeforeUpdate==`function`)||typeof a.UNSAFE_componentWillReceiveProps!=`function`&&typeof a.componentWillReceiveProps!=`function`||(o!==d||f!==c)&&Rs(t,a,r,c),Aa=!1,f=t.memoizedState,a.state=f,za(t,r,a,i),Ra();var p=t.memoizedState;o!==d||f!==p||Aa||e!==null&&e.dependencies!==null&&Ui(e.dependencies)?(typeof s==`function`&&(Fs(t,n,s,r),p=t.memoizedState),(u=Aa||Ls(t,n,u,r,f,p,c)||e!==null&&e.dependencies!==null&&Ui(e.dependencies))?(l||typeof a.UNSAFE_componentWillUpdate!=`function`&&typeof a.componentWillUpdate!=`function`||(typeof a.componentWillUpdate==`function`&&a.componentWillUpdate(r,p,c),typeof a.UNSAFE_componentWillUpdate==`function`&&a.UNSAFE_componentWillUpdate(r,p,c)),typeof a.componentDidUpdate==`function`&&(t.flags|=4),typeof a.getSnapshotBeforeUpdate==`function`&&(t.flags|=1024)):(typeof a.componentDidUpdate!=`function`||o===e.memoizedProps&&f===e.memoizedState||(t.flags|=4),typeof a.getSnapshotBeforeUpdate!=`function`||o===e.memoizedProps&&f===e.memoizedState||(t.flags|=1024),t.memoizedProps=r,t.memoizedState=p),a.props=r,a.state=p,a.context=c,r=u):(typeof a.componentDidUpdate!=`function`||o===e.memoizedProps&&f===e.memoizedState||(t.flags|=4),typeof a.getSnapshotBeforeUpdate!=`function`||o===e.memoizedProps&&f===e.memoizedState||(t.flags|=1024),r=!1)}return a=r,sc(e,t),r=(t.flags&128)!=0,a||r?(a=t.stateNode,n=r&&typeof n.getDerivedStateFromError!=`function`?null:a.render(),t.flags|=1,e!==null&&r?(t.child=Oa(t,e.child,null,i),t.child=Oa(t,null,n,i)):Zs(e,t,n,i),t.memoizedState=a.state,e=t.child):e=Sc(e,t,i),e}function dc(e,t,n,r){return Mi(),t.flags|=256,Zs(e,t,n,r),t.child}var fc={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function pc(e){return{baseLanes:e,cachePool:da()}}function mc(e,t,n){return e=e===null?0:e.childLanes&~n,t&&(e|=Kl),e}function hc(e,t,n){var r=t.pendingProps,a=!1,o=(t.flags&128)!=0,s;if((s=o)||(s=e!==null&&e.memoizedState===null?!1:(eo.current&2)!=0),s&&(a=!0,t.flags&=-129),s=(t.flags&32)!=0,t.flags&=-33,e===null){if(Y){if(a?Ya(t):Qa(t),(e=wi)?(e=rf(e,Ei),e=e!==null&&e.data!==`&`?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:hi===null?null:{id:gi,overflow:_i},retryLane:536870912,hydrationErrors:null},n=ai(e),n.return=t,t.child=n,Ci=t,wi=null)):e=null,e===null)throw Oi(t);return of(e)?t.lanes=32:t.lanes=536870912,null}var c=r.children;return r=r.fallback,a?(Qa(t),a=t.mode,c=_c({mode:`hidden`,children:c},a),r=ri(r,a,n,null),c.return=t,r.return=t,c.sibling=r,t.child=c,r=t.child,r.memoizedState=pc(n),r.childLanes=mc(e,s,n),t.memoizedState=fc,nc(null,r)):(Ya(t),gc(t,c))}var l=e.memoizedState;if(l!==null&&(c=l.dehydrated,c!==null)){if(o)t.flags&256?(Ya(t),t.flags&=-257,t=vc(e,t,n)):t.memoizedState===null?(Qa(t),c=r.fallback,a=t.mode,r=_c({mode:`visible`,children:r.children},a),c=ri(c,a,n,null),c.flags|=2,r.return=t,c.return=t,r.sibling=c,t.child=r,Oa(t,e.child,null,n),r=t.child,r.memoizedState=pc(n),r.childLanes=mc(e,s,n),t.memoizedState=fc,t=nc(null,r)):(Qa(t),t.child=e.child,t.flags|=128,t=null);else if(Ya(t),of(c)){if(s=c.nextSibling&&c.nextSibling.dataset,s)var u=s.dgst;s=u,r=Error(i(419)),r.stack=``,r.digest=s,Pi({value:r,source:null,stack:null}),t=vc(e,t,n)}else if(Xs||Hi(e,t,n,!1),s=(n&e.childLanes)!==0,Xs||s){if(s=Fl,s!==null&&(r=et(s,n),r!==0&&r!==l.retryLane))throw l.retryLane=r,qr(e,r),pu(s,e,r),Ys;af(c)||Tu(),t=vc(e,t,n)}else af(c)?(t.flags|=192,t.child=e.child,t=null):(e=l.treeContext,wi=cf(c.nextSibling),Ci=t,Y=!0,Ti=null,Ei=!1,e!==null&&Si(t,e),t=gc(t,r.children),t.flags|=4096);return t}return a?(Qa(t),c=r.fallback,a=t.mode,l=e.child,u=l.sibling,r=ei(l,{mode:`hidden`,children:r.children}),r.subtreeFlags=l.subtreeFlags&65011712,u===null?(c=ri(c,a,n,null),c.flags|=2):c=ei(u,c),c.return=t,r.return=t,r.sibling=c,t.child=r,nc(null,r),r=t.child,c=e.child.memoizedState,c===null?c=pc(n):(a=c.cachePool,a===null?a=da():(l=Zi._currentValue,a=a.parent===l?a:{parent:l,pool:l}),c={baseLanes:c.baseLanes|n,cachePool:a}),r.memoizedState=c,r.childLanes=mc(e,s,n),t.memoizedState=fc,nc(e.child,r)):(Ya(t),n=e.child,e=n.sibling,n=ei(n,{mode:`visible`,children:r.children}),n.return=t,n.sibling=null,e!==null&&(s=t.deletions,s===null?(t.deletions=[e],t.flags|=16):s.push(e)),t.child=n,t.memoizedState=null,n)}function gc(e,t){return t=_c({mode:`visible`,children:t},e.mode),t.return=e,e.child=t}function _c(e,t){return e=Qr(22,e,null,t),e.lanes=0,e}function vc(e,t,n){return Oa(t,e.child,null,n),e=gc(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function yc(e,t,n){e.lanes|=t;var r=e.alternate;r!==null&&(r.lanes|=t),Bi(e.return,t,n)}function bc(e,t,n,r,i,a){var o=e.memoizedState;o===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:r,tail:n,tailMode:i,treeForkCount:a}:(o.isBackwards=t,o.rendering=null,o.renderingStartTime=0,o.last=r,o.tail=n,o.tailMode=i,o.treeForkCount=a)}function xc(e,t,n){var r=t.pendingProps,i=r.revealOrder,a=r.tail;r=r.children;var o=eo.current,s=(o&2)!=0;if(s?(o=o&1|2,t.flags|=128):o&=1,L(eo,o),Zs(e,t,r,n),r=Y?fi:0,!s&&e!==null&&e.flags&128)a:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&yc(e,n,t);else if(e.tag===19)yc(e,n,t);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break a;for(;e.sibling===null;){if(e.return===null||e.return===t)break a;e=e.return}e.sibling.return=e.return,e=e.sibling}switch(i){case`forwards`:for(n=t.child,i=null;n!==null;)e=n.alternate,e!==null&&to(e)===null&&(i=n),n=n.sibling;n=i,n===null?(i=t.child,t.child=null):(i=n.sibling,n.sibling=null),bc(t,!1,i,n,a,r);break;case`backwards`:case`unstable_legacy-backwards`:for(n=null,i=t.child,t.child=null;i!==null;){if(e=i.alternate,e!==null&&to(e)===null){t.child=i;break}e=i.sibling,i.sibling=n,n=i,i=e}bc(t,!0,n,null,a,r);break;case`together`:bc(t,!1,null,null,void 0,r);break;default:t.memoizedState=null}return t.child}function Sc(e,t,n){if(e!==null&&(t.dependencies=e.dependencies),Ul|=t.lanes,(n&t.childLanes)===0)if(e!==null){if(Hi(e,t,n,!1),(n&t.childLanes)===0)return null}else return null;if(e!==null&&t.child!==e.child)throw Error(i(153));if(t.child!==null){for(e=t.child,n=ei(e,e.pendingProps),t.child=n,n.return=t;e.sibling!==null;)e=e.sibling,n=n.sibling=ei(e,e.pendingProps),n.return=t;n.sibling=null}return t.child}function Cc(e,t){return(e.lanes&t)===0?(e=e.dependencies,!!(e!==null&&Ui(e))):!0}function wc(e,t,n){switch(t.tag){case 3:ue(t,t.stateNode.containerInfo),Ri(t,Zi,e.memoizedState.cache),Mi();break;case 27:case 5:fe(t);break;case 4:ue(t,t.stateNode.containerInfo);break;case 10:Ri(t,t.type,t.memoizedProps.value);break;case 31:if(t.memoizedState!==null)return t.flags|=128,Xa(t),null;break;case 13:var r=t.memoizedState;if(r!==null)return r.dehydrated===null?(n&t.child.childLanes)===0?(Ya(t),e=Sc(e,t,n),e===null?null:e.sibling):hc(e,t,n):(Ya(t),t.flags|=128,null);Ya(t);break;case 19:var i=(e.flags&128)!=0;if(r=(n&t.childLanes)!==0,r||=(Hi(e,t,n,!1),(n&t.childLanes)!==0),i){if(r)return xc(e,t,n);t.flags|=128}if(i=t.memoizedState,i!==null&&(i.rendering=null,i.tail=null,i.lastEffect=null),L(eo,eo.current),r)break;return null;case 22:return t.lanes=0,tc(e,t,n,t.pendingProps);case 24:Ri(t,Zi,e.memoizedState.cache)}return Sc(e,t,n)}function Tc(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps)Xs=!0;else{if(!Cc(e,n)&&!(t.flags&128))return Xs=!1,wc(e,t,n);Xs=!!(e.flags&131072)}else Xs=!1,Y&&t.flags&1048576&&yi(t,fi,t.index);switch(t.lanes=0,t.tag){case 16:a:{var r=t.pendingProps;if(e=va(t.elementType),t.type=e,typeof e==`function`)$r(e)?(r=zs(e,r),t.tag=1,t=uc(null,t,e,r,n)):(t.tag=0,t=cc(null,t,e,r,n));else{if(e!=null){var a=e.$$typeof;if(a===w){t.tag=11,t=Qs(null,t,e,r,n);break a}else if(a===D){t.tag=14,t=$s(null,t,e,r,n);break a}}throw t=te(e)||e,Error(i(306,t,``))}}return t;case 0:return cc(e,t,t.type,t.pendingProps,n);case 1:return r=t.type,a=zs(r,t.pendingProps),uc(e,t,r,a,n);case 3:a:{if(ue(t,t.stateNode.containerInfo),e===null)throw Error(i(387));r=t.pendingProps;var o=t.memoizedState;a=o.element,Ma(e,t),za(t,r,null,n);var s=t.memoizedState;if(r=s.cache,Ri(t,Zi,r),r!==o.cache&&Vi(t,[Zi],n,!0),Ra(),r=s.element,o.isDehydrated)if(o={element:r,isDehydrated:!1,cache:s.cache},t.updateQueue.baseState=o,t.memoizedState=o,t.flags&256){t=dc(e,t,r,n);break a}else if(r!==a){a=ci(Error(i(424)),t),Pi(a),t=dc(e,t,r,n);break a}else{switch(e=t.stateNode.containerInfo,e.nodeType){case 9:e=e.body;break;default:e=e.nodeName===`HTML`?e.ownerDocument.body:e}for(wi=cf(e.firstChild),Ci=t,Y=!0,Ti=null,Ei=!0,n=ka(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling}else{if(Mi(),r===a){t=Sc(e,t,n);break a}Zs(e,t,r,n)}t=t.child}return t;case 26:return sc(e,t),e===null?(n=kf(t.type,null,t.pendingProps,null))?t.memoizedState=n:Y||(n=t.type,e=t.pendingProps,r=Bd(ce.current).createElement(n),r[ot]=t,r[st]=e,Pd(r,n,e),yt(r),t.stateNode=r):t.memoizedState=kf(t.type,e.memoizedProps,t.pendingProps,e.memoizedState),null;case 27:return fe(t),e===null&&Y&&(r=t.stateNode=ff(t.type,t.pendingProps,ce.current),Ci=t,Ei=!0,a=wi,Zd(t.type)?(lf=a,wi=cf(r.firstChild)):wi=a),Zs(e,t,t.pendingProps.children,n),sc(e,t),e===null&&(t.flags|=4194304),t.child;case 5:return e===null&&Y&&((a=r=wi)&&(r=tf(r,t.type,t.pendingProps,Ei),r===null?a=!1:(t.stateNode=r,Ci=t,wi=cf(r.firstChild),Ei=!1,a=!0)),a||Oi(t)),fe(t),a=t.type,o=t.pendingProps,s=e===null?null:e.memoizedProps,r=o.children,Ud(a,o)?r=null:s!==null&&Ud(a,s)&&(t.flags|=32),t.memoizedState!==null&&(a=ho(e,t,vo,null,null,n),Qf._currentValue=a),sc(e,t),Zs(e,t,r,n),t.child;case 6:return e===null&&Y&&((e=n=wi)&&(n=nf(n,t.pendingProps,Ei),n===null?e=!1:(t.stateNode=n,Ci=t,wi=null,e=!0)),e||Oi(t)),null;case 13:return hc(e,t,n);case 4:return ue(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=Oa(t,null,r,n):Zs(e,t,r,n),t.child;case 11:return Qs(e,t,t.type,t.pendingProps,n);case 7:return Zs(e,t,t.pendingProps,n),t.child;case 8:return Zs(e,t,t.pendingProps.children,n),t.child;case 12:return Zs(e,t,t.pendingProps.children,n),t.child;case 10:return r=t.pendingProps,Ri(t,t.type,r.value),Zs(e,t,r.children,n),t.child;case 9:return a=t.type._context,r=t.pendingProps.children,Wi(t),a=Gi(a),r=r(a),t.flags|=1,Zs(e,t,r,n),t.child;case 14:return $s(e,t,t.type,t.pendingProps,n);case 15:return ec(e,t,t.type,t.pendingProps,n);case 19:return xc(e,t,n);case 31:return oc(e,t,n);case 22:return tc(e,t,n,t.pendingProps);case 24:return Wi(t),r=Gi(Zi),e===null?(a=la(),a===null&&(a=Fl,o=Qi(),a.pooledCache=o,o.refCount++,o!==null&&(a.pooledCacheLanes|=n),a=o),t.memoizedState={parent:r,cache:a},ja(t),Ri(t,Zi,a)):((e.lanes&n)!==0&&(Ma(e,t),za(t,null,null,n),Ra()),a=e.memoizedState,o=t.memoizedState,a.parent===r?(r=o.cache,Ri(t,Zi,r),r!==a.cache&&Vi(t,[Zi],n,!0)):(a={parent:r,cache:r},t.memoizedState=a,t.lanes===0&&(t.memoizedState=t.updateQueue.baseState=a),Ri(t,Zi,r))),Zs(e,t,t.pendingProps.children,n),t.child;case 29:throw t.pendingProps}throw Error(i(156,t.tag))}function Ec(e){e.flags|=4}function Dc(e,t,n,r,i){if((t=(e.mode&32)!=0)&&(t=!1),t){if(e.flags|=16777216,(i&335544128)===i)if(e.stateNode.complete)e.flags|=8192;else if(Su())e.flags|=8192;else throw ya=ha,pa}else e.flags&=-16777217}function Oc(e,t){if(t.type!==`stylesheet`||t.state.loading&4)e.flags&=-16777217;else if(e.flags|=16777216,!Wf(t))if(Su())e.flags|=8192;else throw ya=ha,pa}function kc(e,t){t!==null&&(e.flags|=4),e.flags&16384&&(t=e.tag===22?536870912:Je(),e.lanes|=t,ql|=t)}function Ac(e,t){if(!Y)switch(e.tailMode){case`hidden`:t=e.tail;for(var n=null;t!==null;)t.alternate!==null&&(n=t),t=t.sibling;n===null?e.tail=null:n.sibling=null;break;case`collapsed`:n=e.tail;for(var r=null;n!==null;)n.alternate!==null&&(r=n),n=n.sibling;r===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:r.sibling=null}}function jc(e){var t=e.alternate!==null&&e.alternate.child===e.child,n=0,r=0;if(t)for(var i=e.child;i!==null;)n|=i.lanes|i.childLanes,r|=i.subtreeFlags&65011712,r|=i.flags&65011712,i.return=e,i=i.sibling;else for(i=e.child;i!==null;)n|=i.lanes|i.childLanes,r|=i.subtreeFlags,r|=i.flags,i.return=e,i=i.sibling;return e.subtreeFlags|=r,e.childLanes=n,t}function Mc(e,t,n){var r=t.pendingProps;switch(xi(t),t.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return jc(t),null;case 1:return jc(t),null;case 3:return n=t.stateNode,r=null,e!==null&&(r=e.memoizedState.cache),t.memoizedState.cache!==r&&(t.flags|=2048),zi(Zi),de(),n.pendingContext&&(n.context=n.pendingContext,n.pendingContext=null),(e===null||e.child===null)&&(ji(t)?Ec(t):e===null||e.memoizedState.isDehydrated&&!(t.flags&256)||(t.flags|=1024,Ni())),jc(t),null;case 26:var a=t.type,o=t.memoizedState;return e===null?(Ec(t),o===null?(jc(t),Dc(t,a,null,r,n)):(jc(t),Oc(t,o))):o?o===e.memoizedState?(jc(t),t.flags&=-16777217):(Ec(t),jc(t),Oc(t,o)):(e=e.memoizedProps,e!==r&&Ec(t),jc(t),Dc(t,a,e,r,n)),null;case 27:if(pe(t),n=ce.current,a=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==r&&Ec(t);else{if(!r){if(t.stateNode===null)throw Error(i(166));return jc(t),null}e=oe.current,ji(t)?ki(t,e):(e=ff(a,r,n),t.stateNode=e,Ec(t))}return jc(t),null;case 5:if(pe(t),a=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==r&&Ec(t);else{if(!r){if(t.stateNode===null)throw Error(i(166));return jc(t),null}if(o=oe.current,ji(t))ki(t,o);else{var s=Bd(ce.current);switch(o){case 1:o=s.createElementNS(`http://www.w3.org/2000/svg`,a);break;case 2:o=s.createElementNS(`http://www.w3.org/1998/Math/MathML`,a);break;default:switch(a){case`svg`:o=s.createElementNS(`http://www.w3.org/2000/svg`,a);break;case`math`:o=s.createElementNS(`http://www.w3.org/1998/Math/MathML`,a);break;case`script`:o=s.createElement(`div`),o.innerHTML=`<script><\/script>`,o=o.removeChild(o.firstChild);break;case`select`:o=typeof r.is==`string`?s.createElement(`select`,{is:r.is}):s.createElement(`select`),r.multiple?o.multiple=!0:r.size&&(o.size=r.size);break;default:o=typeof r.is==`string`?s.createElement(a,{is:r.is}):s.createElement(a)}}o[ot]=t,o[st]=r;a:for(s=t.child;s!==null;){if(s.tag===5||s.tag===6)o.appendChild(s.stateNode);else if(s.tag!==4&&s.tag!==27&&s.child!==null){s.child.return=s,s=s.child;continue}if(s===t)break a;for(;s.sibling===null;){if(s.return===null||s.return===t)break a;s=s.return}s.sibling.return=s.return,s=s.sibling}t.stateNode=o;a:switch(Pd(o,a,r),a){case`button`:case`input`:case`select`:case`textarea`:r=!!r.autoFocus;break a;case`img`:r=!0;break a;default:r=!1}r&&Ec(t)}}return jc(t),Dc(t,t.type,e===null?null:e.memoizedProps,t.pendingProps,n),null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==r&&Ec(t);else{if(typeof r!=`string`&&t.stateNode===null)throw Error(i(166));if(e=ce.current,ji(t)){if(e=t.stateNode,n=t.memoizedProps,r=null,a=Ci,a!==null)switch(a.tag){case 27:case 5:r=a.memoizedProps}e[ot]=t,e=!!(e.nodeValue===n||r!==null&&!0===r.suppressHydrationWarning||jd(e.nodeValue,n)),e||Oi(t,!0)}else e=Bd(e).createTextNode(r),e[ot]=t,t.stateNode=e}return jc(t),null;case 31:if(n=t.memoizedState,e===null||e.memoizedState!==null){if(r=ji(t),n!==null){if(e===null){if(!r)throw Error(i(318));if(e=t.memoizedState,e=e===null?null:e.dehydrated,!e)throw Error(i(557));e[ot]=t}else Mi(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;jc(t),e=!1}else n=Ni(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=n),e=!0;if(!e)return t.flags&256?($a(t),t):($a(t),null);if(t.flags&128)throw Error(i(558))}return jc(t),null;case 13:if(r=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(a=ji(t),r!==null&&r.dehydrated!==null){if(e===null){if(!a)throw Error(i(318));if(a=t.memoizedState,a=a===null?null:a.dehydrated,!a)throw Error(i(317));a[ot]=t}else Mi(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;jc(t),a=!1}else a=Ni(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=a),a=!0;if(!a)return t.flags&256?($a(t),t):($a(t),null)}return $a(t),t.flags&128?(t.lanes=n,t):(n=r!==null,e=e!==null&&e.memoizedState!==null,n&&(r=t.child,a=null,r.alternate!==null&&r.alternate.memoizedState!==null&&r.alternate.memoizedState.cachePool!==null&&(a=r.alternate.memoizedState.cachePool.pool),o=null,r.memoizedState!==null&&r.memoizedState.cachePool!==null&&(o=r.memoizedState.cachePool.pool),o!==a&&(r.flags|=2048)),n!==e&&n&&(t.child.flags|=8192),kc(t,t.updateQueue),jc(t),null);case 4:return de(),e===null&&xd(t.stateNode.containerInfo),jc(t),null;case 10:return zi(t.type),jc(t),null;case 19:if(I(eo),r=t.memoizedState,r===null)return jc(t),null;if(a=(t.flags&128)!=0,o=r.rendering,o===null)if(a)Ac(r,!1);else{if(Hl!==0||e!==null&&e.flags&128)for(e=t.child;e!==null;){if(o=to(e),o!==null){for(t.flags|=128,Ac(r,!1),e=o.updateQueue,t.updateQueue=e,kc(t,e),t.subtreeFlags=0,e=n,n=t.child;n!==null;)ti(n,e),n=n.sibling;return L(eo,eo.current&1|2),Y&&vi(t,r.treeForkCount),t.child}e=e.sibling}r.tail!==null&&Ee()>$l&&(t.flags|=128,a=!0,Ac(r,!1),t.lanes=4194304)}else{if(!a)if(e=to(o),e!==null){if(t.flags|=128,a=!0,e=e.updateQueue,t.updateQueue=e,kc(t,e),Ac(r,!0),r.tail===null&&r.tailMode===`hidden`&&!o.alternate&&!Y)return jc(t),null}else 2*Ee()-r.renderingStartTime>$l&&n!==536870912&&(t.flags|=128,a=!0,Ac(r,!1),t.lanes=4194304);r.isBackwards?(o.sibling=t.child,t.child=o):(e=r.last,e===null?t.child=o:e.sibling=o,r.last=o)}return r.tail===null?(jc(t),null):(e=r.tail,r.rendering=e,r.tail=e.sibling,r.renderingStartTime=Ee(),e.sibling=null,n=eo.current,L(eo,a?n&1|2:n&1),Y&&vi(t,r.treeForkCount),e);case 22:case 23:return $a(t),Ka(),r=t.memoizedState!==null,e===null?r&&(t.flags|=8192):e.memoizedState!==null!==r&&(t.flags|=8192),r?n&536870912&&!(t.flags&128)&&(jc(t),t.subtreeFlags&6&&(t.flags|=8192)):jc(t),n=t.updateQueue,n!==null&&kc(t,n.retryQueue),n=null,e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(n=e.memoizedState.cachePool.pool),r=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(r=t.memoizedState.cachePool.pool),r!==n&&(t.flags|=2048),e!==null&&I(ca),null;case 24:return n=null,e!==null&&(n=e.memoizedState.cache),t.memoizedState.cache!==n&&(t.flags|=2048),zi(Zi),jc(t),null;case 25:return null;case 30:return null}throw Error(i(156,t.tag))}function Nc(e,t){switch(xi(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return zi(Zi),de(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return pe(t),null;case 31:if(t.memoizedState!==null){if($a(t),t.alternate===null)throw Error(i(340));Mi()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 13:if($a(t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(i(340));Mi()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return I(eo),null;case 4:return de(),null;case 10:return zi(t.type),null;case 22:case 23:return $a(t),Ka(),e!==null&&I(ca),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return zi(Zi),null;case 25:return null;default:return null}}function Pc(e,t){switch(xi(t),t.tag){case 3:zi(Zi),de();break;case 26:case 27:case 5:pe(t);break;case 4:de();break;case 31:t.memoizedState!==null&&$a(t);break;case 13:$a(t);break;case 19:I(eo);break;case 10:zi(t.type);break;case 22:case 23:$a(t),Ka(),e!==null&&I(ca);break;case 24:zi(Zi)}}function Fc(e,t){try{var n=t.updateQueue,r=n===null?null:n.lastEffect;if(r!==null){var i=r.next;n=i;do{if((n.tag&e)===e){r=void 0;var a=n.create,o=n.inst;r=a(),o.destroy=r}n=n.next}while(n!==i)}}catch(e){Uu(t,t.return,e)}}function Ic(e,t,n){try{var r=t.updateQueue,i=r===null?null:r.lastEffect;if(i!==null){var a=i.next;r=a;do{if((r.tag&e)===e){var o=r.inst,s=o.destroy;if(s!==void 0){o.destroy=void 0,i=t;var c=n,l=s;try{l()}catch(e){Uu(i,c,e)}}}r=r.next}while(r!==a)}}catch(e){Uu(t,t.return,e)}}function Lc(e){var t=e.updateQueue;if(t!==null){var n=e.stateNode;try{Va(t,n)}catch(t){Uu(e,e.return,t)}}}function Rc(e,t,n){n.props=zs(e.type,e.memoizedProps),n.state=e.memoizedState;try{n.componentWillUnmount()}catch(n){Uu(e,t,n)}}function zc(e,t){try{var n=e.ref;if(n!==null){switch(e.tag){case 26:case 27:case 5:var r=e.stateNode;break;case 30:r=e.stateNode;break;default:r=e.stateNode}typeof n==`function`?e.refCleanup=n(r):n.current=r}}catch(n){Uu(e,t,n)}}function Bc(e,t){var n=e.ref,r=e.refCleanup;if(n!==null)if(typeof r==`function`)try{r()}catch(n){Uu(e,t,n)}finally{e.refCleanup=null,e=e.alternate,e!=null&&(e.refCleanup=null)}else if(typeof n==`function`)try{n(null)}catch(n){Uu(e,t,n)}else n.current=null}function Vc(e){var t=e.type,n=e.memoizedProps,r=e.stateNode;try{a:switch(t){case`button`:case`input`:case`select`:case`textarea`:n.autoFocus&&r.focus();break a;case`img`:n.src?r.src=n.src:n.srcSet&&(r.srcset=n.srcSet)}}catch(t){Uu(e,e.return,t)}}function Hc(e,t,n){try{var r=e.stateNode;Fd(r,e.type,n,t),r[st]=t}catch(t){Uu(e,e.return,t)}}function Uc(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&Zd(e.type)||e.tag===4}function Wc(e){a:for(;;){for(;e.sibling===null;){if(e.return===null||Uc(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.tag===27&&Zd(e.type)||e.flags&2||e.child===null||e.tag===4)continue a;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function Gc(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?(n.nodeType===9?n.body:n.nodeName===`HTML`?n.ownerDocument.body:n).insertBefore(e,t):(t=n.nodeType===9?n.body:n.nodeName===`HTML`?n.ownerDocument.body:n,t.appendChild(e),n=n._reactRootContainer,n!=null||t.onclick!==null||(t.onclick=$t));else if(r!==4&&(r===27&&Zd(e.type)&&(n=e.stateNode,t=null),e=e.child,e!==null))for(Gc(e,t,n),e=e.sibling;e!==null;)Gc(e,t,n),e=e.sibling}function Kc(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.insertBefore(e,t):n.appendChild(e);else if(r!==4&&(r===27&&Zd(e.type)&&(n=e.stateNode),e=e.child,e!==null))for(Kc(e,t,n),e=e.sibling;e!==null;)Kc(e,t,n),e=e.sibling}function qc(e){var t=e.stateNode,n=e.memoizedProps;try{for(var r=e.type,i=t.attributes;i.length;)t.removeAttributeNode(i[0]);Pd(t,r,n),t[ot]=e,t[st]=n}catch(t){Uu(e,e.return,t)}}var Jc=!1,Yc=!1,Xc=!1,Zc=typeof WeakSet==`function`?WeakSet:Set,Qc=null;function $c(e,t){if(e=e.containerInfo,Rd=sp,e=_r(e),vr(e)){if(`selectionStart`in e)var n={start:e.selectionStart,end:e.selectionEnd};else a:{n=(n=e.ownerDocument)&&n.defaultView||window;var r=n.getSelection&&n.getSelection();if(r&&r.rangeCount!==0){n=r.anchorNode;var a=r.anchorOffset,o=r.focusNode;r=r.focusOffset;try{n.nodeType,o.nodeType}catch{n=null;break a}var s=0,c=-1,l=-1,u=0,d=0,f=e,p=null;b:for(;;){for(var m;f!==n||a!==0&&f.nodeType!==3||(c=s+a),f!==o||r!==0&&f.nodeType!==3||(l=s+r),f.nodeType===3&&(s+=f.nodeValue.length),(m=f.firstChild)!==null;)p=f,f=m;for(;;){if(f===e)break b;if(p===n&&++u===a&&(c=s),p===o&&++d===r&&(l=s),(m=f.nextSibling)!==null)break;f=p,p=f.parentNode}f=m}n=c===-1||l===-1?null:{start:c,end:l}}else n=null}n||={start:0,end:0}}else n=null;for(zd={focusedElem:e,selectionRange:n},sp=!1,Qc=t;Qc!==null;)if(t=Qc,e=t.child,t.subtreeFlags&1028&&e!==null)e.return=t,Qc=e;else for(;Qc!==null;){switch(t=Qc,o=t.alternate,e=t.flags,t.tag){case 0:if(e&4&&(e=t.updateQueue,e=e===null?null:e.events,e!==null))for(n=0;n<e.length;n++)a=e[n],a.ref.impl=a.nextImpl;break;case 11:case 15:break;case 1:if(e&1024&&o!==null){e=void 0,n=t,a=o.memoizedProps,o=o.memoizedState,r=n.stateNode;try{var h=zs(n.type,a);e=r.getSnapshotBeforeUpdate(h,o),r.__reactInternalSnapshotBeforeUpdate=e}catch(e){Uu(n,n.return,e)}}break;case 3:if(e&1024){if(e=t.stateNode.containerInfo,n=e.nodeType,n===9)ef(e);else if(n===1)switch(e.nodeName){case`HEAD`:case`HTML`:case`BODY`:ef(e);break;default:e.textContent=``}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if(e&1024)throw Error(i(163))}if(e=t.sibling,e!==null){e.return=t.return,Qc=e;break}Qc=t.return}}function el(e,t,n){var r=n.flags;switch(n.tag){case 0:case 11:case 15:hl(e,n),r&4&&Fc(5,n);break;case 1:if(hl(e,n),r&4)if(e=n.stateNode,t===null)try{e.componentDidMount()}catch(e){Uu(n,n.return,e)}else{var i=zs(n.type,t.memoizedProps);t=t.memoizedState;try{e.componentDidUpdate(i,t,e.__reactInternalSnapshotBeforeUpdate)}catch(e){Uu(n,n.return,e)}}r&64&&Lc(n),r&512&&zc(n,n.return);break;case 3:if(hl(e,n),r&64&&(e=n.updateQueue,e!==null)){if(t=null,n.child!==null)switch(n.child.tag){case 27:case 5:t=n.child.stateNode;break;case 1:t=n.child.stateNode}try{Va(e,t)}catch(e){Uu(n,n.return,e)}}break;case 27:t===null&&r&4&&qc(n);case 26:case 5:hl(e,n),t===null&&r&4&&Vc(n),r&512&&zc(n,n.return);break;case 12:hl(e,n);break;case 31:hl(e,n),r&4&&ol(e,n);break;case 13:hl(e,n),r&4&&sl(e,n),r&64&&(e=n.memoizedState,e!==null&&(e=e.dehydrated,e!==null&&(n=qu.bind(null,n),sf(e,n))));break;case 22:if(r=n.memoizedState!==null||Jc,!r){t=t!==null&&t.memoizedState!==null||Yc,i=Jc;var a=Yc;Jc=r,(Yc=t)&&!a?_l(e,n,(n.subtreeFlags&8772)!=0):hl(e,n),Jc=i,Yc=a}break;case 30:break;default:hl(e,n)}}function tl(e){var t=e.alternate;t!==null&&(e.alternate=null,tl(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&mt(t)),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}var nl=null,rl=!1;function il(e,t,n){for(n=n.child;n!==null;)al(e,t,n),n=n.sibling}function al(e,t,n){if(Fe&&typeof Fe.onCommitFiberUnmount==`function`)try{Fe.onCommitFiberUnmount(Pe,n)}catch{}switch(n.tag){case 26:Yc||Bc(n,t),il(e,t,n),n.memoizedState?n.memoizedState.count--:n.stateNode&&(n=n.stateNode,n.parentNode.removeChild(n));break;case 27:Yc||Bc(n,t);var r=nl,i=rl;Zd(n.type)&&(nl=n.stateNode,rl=!1),il(e,t,n),pf(n.stateNode),nl=r,rl=i;break;case 5:Yc||Bc(n,t);case 6:if(r=nl,i=rl,nl=null,il(e,t,n),nl=r,rl=i,nl!==null)if(rl)try{(nl.nodeType===9?nl.body:nl.nodeName===`HTML`?nl.ownerDocument.body:nl).removeChild(n.stateNode)}catch(e){Uu(n,t,e)}else try{nl.removeChild(n.stateNode)}catch(e){Uu(n,t,e)}break;case 18:nl!==null&&(rl?(e=nl,Qd(e.nodeType===9?e.body:e.nodeName===`HTML`?e.ownerDocument.body:e,n.stateNode),Np(e)):Qd(nl,n.stateNode));break;case 4:r=nl,i=rl,nl=n.stateNode.containerInfo,rl=!0,il(e,t,n),nl=r,rl=i;break;case 0:case 11:case 14:case 15:Ic(2,n,t),Yc||Ic(4,n,t),il(e,t,n);break;case 1:Yc||(Bc(n,t),r=n.stateNode,typeof r.componentWillUnmount==`function`&&Rc(n,t,r)),il(e,t,n);break;case 21:il(e,t,n);break;case 22:Yc=(r=Yc)||n.memoizedState!==null,il(e,t,n),Yc=r;break;default:il(e,t,n)}}function ol(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null))){e=e.dehydrated;try{Np(e)}catch(e){Uu(t,t.return,e)}}}function sl(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null&&(e=e.dehydrated,e!==null))))try{Np(e)}catch(e){Uu(t,t.return,e)}}function cl(e){switch(e.tag){case 31:case 13:case 19:var t=e.stateNode;return t===null&&(t=e.stateNode=new Zc),t;case 22:return e=e.stateNode,t=e._retryCache,t===null&&(t=e._retryCache=new Zc),t;default:throw Error(i(435,e.tag))}}function ll(e,t){var n=cl(e);t.forEach(function(t){if(!n.has(t)){n.add(t);var r=Ju.bind(null,e,t);t.then(r,r)}})}function ul(e,t){var n=t.deletions;if(n!==null)for(var r=0;r<n.length;r++){var a=n[r],o=e,s=t,c=s;a:for(;c!==null;){switch(c.tag){case 27:if(Zd(c.type)){nl=c.stateNode,rl=!1;break a}break;case 5:nl=c.stateNode,rl=!1;break a;case 3:case 4:nl=c.stateNode.containerInfo,rl=!0;break a}c=c.return}if(nl===null)throw Error(i(160));al(o,s,a),nl=null,rl=!1,o=a.alternate,o!==null&&(o.return=null),a.return=null}if(t.subtreeFlags&13886)for(t=t.child;t!==null;)fl(t,e),t=t.sibling}var dl=null;function fl(e,t){var n=e.alternate,r=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:ul(t,e),pl(e),r&4&&(Ic(3,e,e.return),Fc(3,e),Ic(5,e,e.return));break;case 1:ul(t,e),pl(e),r&512&&(Yc||n===null||Bc(n,n.return)),r&64&&Jc&&(e=e.updateQueue,e!==null&&(r=e.callbacks,r!==null&&(n=e.shared.hiddenCallbacks,e.shared.hiddenCallbacks=n===null?r:n.concat(r))));break;case 26:var a=dl;if(ul(t,e),pl(e),r&512&&(Yc||n===null||Bc(n,n.return)),r&4){var o=n===null?null:n.memoizedState;if(r=e.memoizedState,n===null)if(r===null)if(e.stateNode===null){a:{r=e.type,n=e.memoizedProps,a=a.ownerDocument||a;b:switch(r){case`title`:o=a.getElementsByTagName(`title`)[0],(!o||o[pt]||o[ot]||o.namespaceURI===`http://www.w3.org/2000/svg`||o.hasAttribute(`itemprop`))&&(o=a.createElement(r),a.head.insertBefore(o,a.querySelector(`head > title`))),Pd(o,r,n),o[ot]=e,yt(o),r=o;break a;case`link`:var s=Vf(`link`,`href`,a).get(r+(n.href||``));if(s){for(var c=0;c<s.length;c++)if(o=s[c],o.getAttribute(`href`)===(n.href==null||n.href===``?null:n.href)&&o.getAttribute(`rel`)===(n.rel==null?null:n.rel)&&o.getAttribute(`title`)===(n.title==null?null:n.title)&&o.getAttribute(`crossorigin`)===(n.crossOrigin==null?null:n.crossOrigin)){s.splice(c,1);break b}}o=a.createElement(r),Pd(o,r,n),a.head.appendChild(o);break;case`meta`:if(s=Vf(`meta`,`content`,a).get(r+(n.content||``))){for(c=0;c<s.length;c++)if(o=s[c],o.getAttribute(`content`)===(n.content==null?null:``+n.content)&&o.getAttribute(`name`)===(n.name==null?null:n.name)&&o.getAttribute(`property`)===(n.property==null?null:n.property)&&o.getAttribute(`http-equiv`)===(n.httpEquiv==null?null:n.httpEquiv)&&o.getAttribute(`charset`)===(n.charSet==null?null:n.charSet)){s.splice(c,1);break b}}o=a.createElement(r),Pd(o,r,n),a.head.appendChild(o);break;default:throw Error(i(468,r))}o[ot]=e,yt(o),r=o}e.stateNode=r}else Hf(a,e.type,e.stateNode);else e.stateNode=If(a,r,e.memoizedProps);else o===r?r===null&&e.stateNode!==null&&Hc(e,e.memoizedProps,n.memoizedProps):(o===null?n.stateNode!==null&&(n=n.stateNode,n.parentNode.removeChild(n)):o.count--,r===null?Hf(a,e.type,e.stateNode):If(a,r,e.memoizedProps))}break;case 27:ul(t,e),pl(e),r&512&&(Yc||n===null||Bc(n,n.return)),n!==null&&r&4&&Hc(e,e.memoizedProps,n.memoizedProps);break;case 5:if(ul(t,e),pl(e),r&512&&(Yc||n===null||Bc(n,n.return)),e.flags&32){a=e.stateNode;try{Gt(a,``)}catch(t){Uu(e,e.return,t)}}r&4&&e.stateNode!=null&&(a=e.memoizedProps,Hc(e,a,n===null?a:n.memoizedProps)),r&1024&&(Xc=!0);break;case 6:if(ul(t,e),pl(e),r&4){if(e.stateNode===null)throw Error(i(162));r=e.memoizedProps,n=e.stateNode;try{n.nodeValue=r}catch(t){Uu(e,e.return,t)}}break;case 3:if(Bf=null,a=dl,dl=gf(t.containerInfo),ul(t,e),dl=a,pl(e),r&4&&n!==null&&n.memoizedState.isDehydrated)try{Np(t.containerInfo)}catch(t){Uu(e,e.return,t)}Xc&&(Xc=!1,ml(e));break;case 4:r=dl,dl=gf(e.stateNode.containerInfo),ul(t,e),pl(e),dl=r;break;case 12:ul(t,e),pl(e);break;case 31:ul(t,e),pl(e),r&4&&(r=e.updateQueue,r!==null&&(e.updateQueue=null,ll(e,r)));break;case 13:ul(t,e),pl(e),e.child.flags&8192&&e.memoizedState!==null!=(n!==null&&n.memoizedState!==null)&&(Zl=Ee()),r&4&&(r=e.updateQueue,r!==null&&(e.updateQueue=null,ll(e,r)));break;case 22:a=e.memoizedState!==null;var l=n!==null&&n.memoizedState!==null,u=Jc,d=Yc;if(Jc=u||a,Yc=d||l,ul(t,e),Yc=d,Jc=u,pl(e),r&8192)a:for(t=e.stateNode,t._visibility=a?t._visibility&-2:t._visibility|1,a&&(n===null||l||Jc||Yc||gl(e)),n=null,t=e;;){if(t.tag===5||t.tag===26){if(n===null){l=n=t;try{if(o=l.stateNode,a)s=o.style,typeof s.setProperty==`function`?s.setProperty(`display`,`none`,`important`):s.display=`none`;else{c=l.stateNode;var f=l.memoizedProps.style,p=f!=null&&f.hasOwnProperty(`display`)?f.display:null;c.style.display=p==null||typeof p==`boolean`?``:(``+p).trim()}}catch(e){Uu(l,l.return,e)}}}else if(t.tag===6){if(n===null){l=t;try{l.stateNode.nodeValue=a?``:l.memoizedProps}catch(e){Uu(l,l.return,e)}}}else if(t.tag===18){if(n===null){l=t;try{var m=l.stateNode;a?$d(m,!0):$d(l.stateNode,!1)}catch(e){Uu(l,l.return,e)}}}else if((t.tag!==22&&t.tag!==23||t.memoizedState===null||t===e)&&t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break a;for(;t.sibling===null;){if(t.return===null||t.return===e)break a;n===t&&(n=null),t=t.return}n===t&&(n=null),t.sibling.return=t.return,t=t.sibling}r&4&&(r=e.updateQueue,r!==null&&(n=r.retryQueue,n!==null&&(r.retryQueue=null,ll(e,n))));break;case 19:ul(t,e),pl(e),r&4&&(r=e.updateQueue,r!==null&&(e.updateQueue=null,ll(e,r)));break;case 30:break;case 21:break;default:ul(t,e),pl(e)}}function pl(e){var t=e.flags;if(t&2){try{for(var n,r=e.return;r!==null;){if(Uc(r)){n=r;break}r=r.return}if(n==null)throw Error(i(160));switch(n.tag){case 27:var a=n.stateNode;Kc(e,Wc(e),a);break;case 5:var o=n.stateNode;n.flags&32&&(Gt(o,``),n.flags&=-33),Kc(e,Wc(e),o);break;case 3:case 4:var s=n.stateNode.containerInfo;Gc(e,Wc(e),s);break;default:throw Error(i(161))}}catch(t){Uu(e,e.return,t)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function ml(e){if(e.subtreeFlags&1024)for(e=e.child;e!==null;){var t=e;ml(t),t.tag===5&&t.flags&1024&&t.stateNode.reset(),e=e.sibling}}function hl(e,t){if(t.subtreeFlags&8772)for(t=t.child;t!==null;)el(e,t.alternate,t),t=t.sibling}function gl(e){for(e=e.child;e!==null;){var t=e;switch(t.tag){case 0:case 11:case 14:case 15:Ic(4,t,t.return),gl(t);break;case 1:Bc(t,t.return);var n=t.stateNode;typeof n.componentWillUnmount==`function`&&Rc(t,t.return,n),gl(t);break;case 27:pf(t.stateNode);case 26:case 5:Bc(t,t.return),gl(t);break;case 22:t.memoizedState===null&&gl(t);break;case 30:gl(t);break;default:gl(t)}e=e.sibling}}function _l(e,t,n){for(n&&=(t.subtreeFlags&8772)!=0,t=t.child;t!==null;){var r=t.alternate,i=e,a=t,o=a.flags;switch(a.tag){case 0:case 11:case 15:_l(i,a,n),Fc(4,a);break;case 1:if(_l(i,a,n),r=a,i=r.stateNode,typeof i.componentDidMount==`function`)try{i.componentDidMount()}catch(e){Uu(r,r.return,e)}if(r=a,i=r.updateQueue,i!==null){var s=r.stateNode;try{var c=i.shared.hiddenCallbacks;if(c!==null)for(i.shared.hiddenCallbacks=null,i=0;i<c.length;i++)Ba(c[i],s)}catch(e){Uu(r,r.return,e)}}n&&o&64&&Lc(a),zc(a,a.return);break;case 27:qc(a);case 26:case 5:_l(i,a,n),n&&r===null&&o&4&&Vc(a),zc(a,a.return);break;case 12:_l(i,a,n);break;case 31:_l(i,a,n),n&&o&4&&ol(i,a);break;case 13:_l(i,a,n),n&&o&4&&sl(i,a);break;case 22:a.memoizedState===null&&_l(i,a,n),zc(a,a.return);break;case 30:break;default:_l(i,a,n)}t=t.sibling}}function vl(e,t){var n=null;e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(n=e.memoizedState.cachePool.pool),e=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(e=t.memoizedState.cachePool.pool),e!==n&&(e!=null&&e.refCount++,n!=null&&$i(n))}function yl(e,t){e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&$i(e))}function bl(e,t,n,r){if(t.subtreeFlags&10256)for(t=t.child;t!==null;)xl(e,t,n,r),t=t.sibling}function xl(e,t,n,r){var i=t.flags;switch(t.tag){case 0:case 11:case 15:bl(e,t,n,r),i&2048&&Fc(9,t);break;case 1:bl(e,t,n,r);break;case 3:bl(e,t,n,r),i&2048&&(e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&$i(e)));break;case 12:if(i&2048){bl(e,t,n,r),e=t.stateNode;try{var a=t.memoizedProps,o=a.id,s=a.onPostCommit;typeof s==`function`&&s(o,t.alternate===null?`mount`:`update`,e.passiveEffectDuration,-0)}catch(e){Uu(t,t.return,e)}}else bl(e,t,n,r);break;case 31:bl(e,t,n,r);break;case 13:bl(e,t,n,r);break;case 23:break;case 22:a=t.stateNode,o=t.alternate,t.memoizedState===null?a._visibility&2?bl(e,t,n,r):(a._visibility|=2,Sl(e,t,n,r,(t.subtreeFlags&10256)!=0||!1)):a._visibility&2?bl(e,t,n,r):Cl(e,t),i&2048&&vl(o,t);break;case 24:bl(e,t,n,r),i&2048&&yl(t.alternate,t);break;default:bl(e,t,n,r)}}function Sl(e,t,n,r,i){for(i&&=(t.subtreeFlags&10256)!=0||!1,t=t.child;t!==null;){var a=e,o=t,s=n,c=r,l=o.flags;switch(o.tag){case 0:case 11:case 15:Sl(a,o,s,c,i),Fc(8,o);break;case 23:break;case 22:var u=o.stateNode;o.memoizedState===null?(u._visibility|=2,Sl(a,o,s,c,i)):u._visibility&2?Sl(a,o,s,c,i):Cl(a,o),i&&l&2048&&vl(o.alternate,o);break;case 24:Sl(a,o,s,c,i),i&&l&2048&&yl(o.alternate,o);break;default:Sl(a,o,s,c,i)}t=t.sibling}}function Cl(e,t){if(t.subtreeFlags&10256)for(t=t.child;t!==null;){var n=e,r=t,i=r.flags;switch(r.tag){case 22:Cl(n,r),i&2048&&vl(r.alternate,r);break;case 24:Cl(n,r),i&2048&&yl(r.alternate,r);break;default:Cl(n,r)}t=t.sibling}}var wl=8192;function Tl(e,t,n){if(e.subtreeFlags&wl)for(e=e.child;e!==null;)El(e,t,n),e=e.sibling}function El(e,t,n){switch(e.tag){case 26:Tl(e,t,n),e.flags&wl&&e.memoizedState!==null&&Gf(n,dl,e.memoizedState,e.memoizedProps);break;case 5:Tl(e,t,n);break;case 3:case 4:var r=dl;dl=gf(e.stateNode.containerInfo),Tl(e,t,n),dl=r;break;case 22:e.memoizedState===null&&(r=e.alternate,r!==null&&r.memoizedState!==null?(r=wl,wl=16777216,Tl(e,t,n),wl=r):Tl(e,t,n));break;default:Tl(e,t,n)}}function Dl(e){var t=e.alternate;if(t!==null&&(e=t.child,e!==null)){t.child=null;do t=e.sibling,e.sibling=null,e=t;while(e!==null)}}function Ol(e){var t=e.deletions;if(e.flags&16){if(t!==null)for(var n=0;n<t.length;n++){var r=t[n];Qc=r,jl(r,e)}Dl(e)}if(e.subtreeFlags&10256)for(e=e.child;e!==null;)kl(e),e=e.sibling}function kl(e){switch(e.tag){case 0:case 11:case 15:Ol(e),e.flags&2048&&Ic(9,e,e.return);break;case 3:Ol(e);break;case 12:Ol(e);break;case 22:var t=e.stateNode;e.memoizedState!==null&&t._visibility&2&&(e.return===null||e.return.tag!==13)?(t._visibility&=-3,Al(e)):Ol(e);break;default:Ol(e)}}function Al(e){var t=e.deletions;if(e.flags&16){if(t!==null)for(var n=0;n<t.length;n++){var r=t[n];Qc=r,jl(r,e)}Dl(e)}for(e=e.child;e!==null;){switch(t=e,t.tag){case 0:case 11:case 15:Ic(8,t,t.return),Al(t);break;case 22:n=t.stateNode,n._visibility&2&&(n._visibility&=-3,Al(t));break;default:Al(t)}e=e.sibling}}function jl(e,t){for(;Qc!==null;){var n=Qc;switch(n.tag){case 0:case 11:case 15:Ic(8,n,t);break;case 23:case 22:if(n.memoizedState!==null&&n.memoizedState.cachePool!==null){var r=n.memoizedState.cachePool.pool;r!=null&&r.refCount++}break;case 24:$i(n.memoizedState.cache)}if(r=n.child,r!==null)r.return=n,Qc=r;else a:for(n=e;Qc!==null;){r=Qc;var i=r.sibling,a=r.return;if(tl(r),r===n){Qc=null;break a}if(i!==null){i.return=a,Qc=i;break a}Qc=a}}}var Ml={getCacheForType:function(e){var t=Gi(Zi),n=t.data.get(e);return n===void 0&&(n=e(),t.data.set(e,n)),n},cacheSignal:function(){return Gi(Zi).controller.signal}},Nl=typeof WeakMap==`function`?WeakMap:Map,Pl=0,Fl=null,Z=null,Q=0,Il=0,Ll=null,Rl=!1,zl=!1,Bl=!1,Vl=0,Hl=0,Ul=0,Wl=0,Gl=0,Kl=0,ql=0,Jl=null,Yl=null,Xl=!1,Zl=0,Ql=0,$l=1/0,eu=null,tu=null,nu=0,ru=null,iu=null,au=0,ou=0,su=null,cu=null,lu=0,uu=null;function du(){return Pl&2&&Q!==0?Q&-Q:N.T===null?rt():ud()}function fu(){if(Kl===0)if(!(Q&536870912)||Y){var e=He;He<<=1,!(He&3932160)&&(He=262144),Kl=e}else Kl=536870912;return e=qa.current,e!==null&&(e.flags|=32),Kl}function pu(e,t,n){(e===Fl&&(Il===2||Il===9)||e.cancelPendingCommit!==null)&&(bu(e,0),_u(e,Q,Kl,!1)),Xe(e,n),(!(Pl&2)||e!==Fl)&&(e===Fl&&(!(Pl&2)&&(Wl|=n),Hl===4&&_u(e,Q,Kl,!1)),nd(e))}function mu(e,t,n){if(Pl&6)throw Error(i(327));var r=!n&&(t&127)==0&&(t&e.expiredLanes)===0||Ke(e,t),a=r?Ou(e,t):Eu(e,t,!0),o=r;do{if(a===0){zl&&!r&&_u(e,t,0,!1);break}else{if(n=e.current.alternate,o&&!gu(n)){a=Eu(e,t,!1),o=!1;continue}if(a===2){if(o=t,e.errorRecoveryDisabledLanes&o)var s=0;else s=e.pendingLanes&-536870913,s=s===0?s&536870912?536870912:0:s;if(s!==0){t=s;a:{var c=e;a=Jl;var l=c.current.memoizedState.isDehydrated;if(l&&(bu(c,s).flags|=256),s=Eu(c,s,!1),s!==2){if(Bl&&!l){c.errorRecoveryDisabledLanes|=o,Wl|=o,a=4;break a}o=Yl,Yl=a,o!==null&&(Yl===null?Yl=o:Yl.push.apply(Yl,o))}a=s}if(o=!1,a!==2)continue}}if(a===1){bu(e,0),_u(e,t,0,!0);break}a:{switch(r=e,o=a,o){case 0:case 1:throw Error(i(345));case 4:if((t&4194048)!==t)break;case 6:_u(r,t,Kl,!Rl);break a;case 2:Yl=null;break;case 3:case 5:break;default:throw Error(i(329))}if((t&62914560)===t&&(a=Zl+300-Ee(),10<a)){if(_u(r,t,Kl,!Rl),Ge(r,0,!0)!==0)break a;au=t,r.timeoutHandle=Kd(hu.bind(null,r,n,Yl,eu,Xl,t,Kl,Wl,ql,Rl,o,`Throttled`,-0,0),a);break a}hu(r,n,Yl,eu,Xl,t,Kl,Wl,ql,Rl,o,null,-0,0)}}break}while(1);nd(e)}function hu(e,t,n,r,i,a,o,s,c,l,u,d,f,p){if(e.timeoutHandle=-1,d=t.subtreeFlags,d&8192||(d&16785408)==16785408){d={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:$t},El(t,a,d);var m=(a&62914560)===a?Zl-Ee():(a&4194048)===a?Ql-Ee():0;if(m=qf(d,m),m!==null){au=a,e.cancelPendingCommit=m(Fu.bind(null,e,t,a,n,r,i,o,s,c,u,d,null,f,p)),_u(e,a,o,!l);return}}Fu(e,t,a,n,r,i,o,s,c)}function gu(e){for(var t=e;;){var n=t.tag;if((n===0||n===11||n===15)&&t.flags&16384&&(n=t.updateQueue,n!==null&&(n=n.stores,n!==null)))for(var r=0;r<n.length;r++){var i=n[r],a=i.getSnapshot;i=i.value;try{if(!q(a(),i))return!1}catch{return!1}}if(n=t.child,t.subtreeFlags&16384&&n!==null)n.return=t,t=n;else{if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return!0;t=t.return}t.sibling.return=t.return,t=t.sibling}}return!0}function _u(e,t,n,r){t&=~Gl,t&=~Wl,e.suspendedLanes|=t,e.pingedLanes&=~t,r&&(e.warmLanes|=t),r=e.expirationTimes;for(var i=t;0<i;){var a=31-Le(i),o=1<<a;r[a]=-1,i&=~o}n!==0&&Qe(e,n,t)}function vu(){return Pl&6?!0:(rd(0,!1),!1)}function yu(){if(Z!==null){if(Il===0)var e=Z.return;else e=Z,Li=Ii=null,xo(e),Sa=null,Ca=0,e=Z;for(;e!==null;)Pc(e.alternate,e),e=e.return;Z=null}}function bu(e,t){var n=e.timeoutHandle;n!==-1&&(e.timeoutHandle=-1,qd(n)),n=e.cancelPendingCommit,n!==null&&(e.cancelPendingCommit=null,n()),au=0,yu(),Fl=e,Z=n=ei(e.current,null),Q=t,Il=0,Ll=null,Rl=!1,zl=Ke(e,t),Bl=!1,ql=Kl=Gl=Wl=Ul=Hl=0,Yl=Jl=null,Xl=!1,t&8&&(t|=t&32);var r=e.entangledLanes;if(r!==0)for(e=e.entanglements,r&=t;0<r;){var i=31-Le(r),a=1<<i;t|=e[i],r&=~a}return Vl=t,Wr(),n}function xu(e,t){X=null,N.H=js,t===fa||t===ma?(t=ba(),Il=3):t===pa?(t=ba(),Il=4):Il=t===Ys?8:typeof t==`object`&&t&&typeof t.then==`function`?6:1,Ll=t,Z===null&&(Hl=1,Us(e,ci(t,e.current)))}function Su(){var e=qa.current;return e===null?!0:(Q&4194048)===Q?Ja===null:(Q&62914560)===Q||Q&536870912?e===Ja:!1}function Cu(){var e=N.H;return N.H=js,e===null?js:e}function wu(){var e=N.A;return N.A=Ml,e}function Tu(){Hl=4,Rl||(Q&4194048)!==Q&&qa.current!==null||(zl=!0),!(Ul&134217727)&&!(Wl&134217727)||Fl===null||_u(Fl,Q,Kl,!1)}function Eu(e,t,n){var r=Pl;Pl|=2;var i=Cu(),a=wu();(Fl!==e||Q!==t)&&(eu=null,bu(e,t)),t=!1;var o=Hl;a:do try{if(Il!==0&&Z!==null){var s=Z,c=Ll;switch(Il){case 8:yu(),o=6;break a;case 3:case 2:case 9:case 6:qa.current===null&&(t=!0);var l=Il;if(Il=0,Ll=null,Mu(e,s,c,l),n&&zl){o=0;break a}break;default:l=Il,Il=0,Ll=null,Mu(e,s,c,l)}}Du(),o=Hl;break}catch(t){xu(e,t)}while(1);return t&&e.shellSuspendCounter++,Li=Ii=null,Pl=r,N.H=i,N.A=a,Z===null&&(Fl=null,Q=0,Wr()),o}function Du(){for(;Z!==null;)Au(Z)}function Ou(e,t){var n=Pl;Pl|=2;var r=Cu(),a=wu();Fl!==e||Q!==t?(eu=null,$l=Ee()+500,bu(e,t)):zl=Ke(e,t);a:do try{if(Il!==0&&Z!==null){t=Z;var o=Ll;b:switch(Il){case 1:Il=0,Ll=null,Mu(e,t,o,1);break;case 2:case 9:if(ga(o)){Il=0,Ll=null,ju(t);break}t=function(){Il!==2&&Il!==9||Fl!==e||(Il=7),nd(e)},o.then(t,t);break a;case 3:Il=7;break a;case 4:Il=5;break a;case 7:ga(o)?(Il=0,Ll=null,ju(t)):(Il=0,Ll=null,Mu(e,t,o,7));break;case 5:var s=null;switch(Z.tag){case 26:s=Z.memoizedState;case 5:case 27:var c=Z;if(s?Wf(s):c.stateNode.complete){Il=0,Ll=null;var l=c.sibling;if(l!==null)Z=l;else{var u=c.return;u===null?Z=null:(Z=u,Nu(u))}break b}}Il=0,Ll=null,Mu(e,t,o,5);break;case 6:Il=0,Ll=null,Mu(e,t,o,6);break;case 8:yu(),Hl=6;break a;default:throw Error(i(462))}}ku();break}catch(t){xu(e,t)}while(1);return Li=Ii=null,N.H=r,N.A=a,Pl=n,Z===null?(Fl=null,Q=0,Wr(),Hl):0}function ku(){for(;Z!==null&&!we();)Au(Z)}function Au(e){var t=Tc(e.alternate,e,Vl);e.memoizedProps=e.pendingProps,t===null?Nu(e):Z=t}function ju(e){var t=e,n=t.alternate;switch(t.tag){case 15:case 0:t=lc(n,t,t.pendingProps,t.type,void 0,Q);break;case 11:t=lc(n,t,t.pendingProps,t.type.render,t.ref,Q);break;case 5:xo(t);default:Pc(n,t),t=Z=ti(t,Vl),t=Tc(n,t,Vl)}e.memoizedProps=e.pendingProps,t===null?Nu(e):Z=t}function Mu(e,t,n,r){Li=Ii=null,xo(t),Sa=null,Ca=0;var i=t.return;try{if(Js(e,i,t,n,Q)){Hl=1,Us(e,ci(n,e.current)),Z=null;return}}catch(t){if(i!==null)throw Z=i,t;Hl=1,Us(e,ci(n,e.current)),Z=null;return}t.flags&32768?(Y||r===1?e=!0:zl||Q&536870912?e=!1:(Rl=e=!0,(r===2||r===9||r===3||r===6)&&(r=qa.current,r!==null&&r.tag===13&&(r.flags|=16384))),Pu(t,e)):Nu(t)}function Nu(e){var t=e;do{if(t.flags&32768){Pu(t,Rl);return}e=t.return;var n=Mc(t.alternate,t,Vl);if(n!==null){Z=n;return}if(t=t.sibling,t!==null){Z=t;return}Z=t=e}while(t!==null);Hl===0&&(Hl=5)}function Pu(e,t){do{var n=Nc(e.alternate,e);if(n!==null){n.flags&=32767,Z=n;return}if(n=e.return,n!==null&&(n.flags|=32768,n.subtreeFlags=0,n.deletions=null),!t&&(e=e.sibling,e!==null)){Z=e;return}Z=e=n}while(e!==null);Hl=6,Z=null}function Fu(e,t,n,r,a,o,s,c,l){e.cancelPendingCommit=null;do Bu();while(nu!==0);if(Pl&6)throw Error(i(327));if(t!==null){if(t===e.current)throw Error(i(177));if(o=t.lanes|t.childLanes,o|=Ur,Ze(e,n,o,s,c,l),e===Fl&&(Z=Fl=null,Q=0),iu=t,ru=e,au=n,ou=o,su=a,cu=r,t.subtreeFlags&10256||t.flags&10256?(e.callbackNode=null,e.callbackPriority=0,Yu(Ae,function(){return Vu(),null})):(e.callbackNode=null,e.callbackPriority=0),r=(t.flags&13878)!=0,t.subtreeFlags&13878||r){r=N.T,N.T=null,a=P.p,P.p=2,s=Pl,Pl|=4;try{$c(e,t,n)}finally{Pl=s,P.p=a,N.T=r}}nu=1,Iu(),Lu(),Ru()}}function Iu(){if(nu===1){nu=0;var e=ru,t=iu,n=(t.flags&13878)!=0;if(t.subtreeFlags&13878||n){n=N.T,N.T=null;var r=P.p;P.p=2;var i=Pl;Pl|=4;try{fl(t,e);var a=zd,o=_r(e.containerInfo),s=a.focusedElem,c=a.selectionRange;if(o!==s&&s&&s.ownerDocument&&gr(s.ownerDocument.documentElement,s)){if(c!==null&&vr(s)){var l=c.start,u=c.end;if(u===void 0&&(u=l),`selectionStart`in s)s.selectionStart=l,s.selectionEnd=Math.min(u,s.value.length);else{var d=s.ownerDocument||document,f=d&&d.defaultView||window;if(f.getSelection){var p=f.getSelection(),m=s.textContent.length,h=Math.min(c.start,m),g=c.end===void 0?h:Math.min(c.end,m);!p.extend&&h>g&&(o=g,g=h,h=o);var _=J(s,h),v=J(s,g);if(_&&v&&(p.rangeCount!==1||p.anchorNode!==_.node||p.anchorOffset!==_.offset||p.focusNode!==v.node||p.focusOffset!==v.offset)){var y=d.createRange();y.setStart(_.node,_.offset),p.removeAllRanges(),h>g?(p.addRange(y),p.extend(v.node,v.offset)):(y.setEnd(v.node,v.offset),p.addRange(y))}}}}for(d=[],p=s;p=p.parentNode;)p.nodeType===1&&d.push({element:p,left:p.scrollLeft,top:p.scrollTop});for(typeof s.focus==`function`&&s.focus(),s=0;s<d.length;s++){var b=d[s];b.element.scrollLeft=b.left,b.element.scrollTop=b.top}}sp=!!Rd,zd=Rd=null}finally{Pl=i,P.p=r,N.T=n}}e.current=t,nu=2}}function Lu(){if(nu===2){nu=0;var e=ru,t=iu,n=(t.flags&8772)!=0;if(t.subtreeFlags&8772||n){n=N.T,N.T=null;var r=P.p;P.p=2;var i=Pl;Pl|=4;try{el(e,t.alternate,t)}finally{Pl=i,P.p=r,N.T=n}}nu=3}}function Ru(){if(nu===4||nu===3){nu=0,Te();var e=ru,t=iu,n=au,r=cu;t.subtreeFlags&10256||t.flags&10256?nu=5:(nu=0,iu=ru=null,zu(e,e.pendingLanes));var i=e.pendingLanes;if(i===0&&(tu=null),nt(n),t=t.stateNode,Fe&&typeof Fe.onCommitFiberRoot==`function`)try{Fe.onCommitFiberRoot(Pe,t,void 0,(t.current.flags&128)==128)}catch{}if(r!==null){t=N.T,i=P.p,P.p=2,N.T=null;try{for(var a=e.onRecoverableError,o=0;o<r.length;o++){var s=r[o];a(s.value,{componentStack:s.stack})}}finally{N.T=t,P.p=i}}au&3&&Bu(),nd(e),i=e.pendingLanes,n&261930&&i&42?e===uu?lu++:(lu=0,uu=e):lu=0,rd(0,!1)}}function zu(e,t){(e.pooledCacheLanes&=t)===0&&(t=e.pooledCache,t!=null&&(e.pooledCache=null,$i(t)))}function Bu(){return Iu(),Lu(),Ru(),Vu()}function Vu(){if(nu!==5)return!1;var e=ru,t=ou;ou=0;var n=nt(au),r=N.T,a=P.p;try{P.p=32>n?32:n,N.T=null,n=su,su=null;var o=ru,s=au;if(nu=0,iu=ru=null,au=0,Pl&6)throw Error(i(331));var c=Pl;if(Pl|=4,kl(o.current),xl(o,o.current,s,n),Pl=c,rd(0,!1),Fe&&typeof Fe.onPostCommitFiberRoot==`function`)try{Fe.onPostCommitFiberRoot(Pe,o)}catch{}return!0}finally{P.p=a,N.T=r,zu(e,t)}}function Hu(e,t,n){t=ci(n,t),t=Gs(e.stateNode,t,2),e=Pa(e,t,2),e!==null&&(Xe(e,2),nd(e))}function Uu(e,t,n){if(e.tag===3)Hu(e,e,n);else for(;t!==null;){if(t.tag===3){Hu(t,e,n);break}else if(t.tag===1){var r=t.stateNode;if(typeof t.type.getDerivedStateFromError==`function`||typeof r.componentDidCatch==`function`&&(tu===null||!tu.has(r))){e=ci(n,e),n=Ks(2),r=Pa(t,n,2),r!==null&&(qs(n,r,t,e),Xe(r,2),nd(r));break}}t=t.return}}function Wu(e,t,n){var r=e.pingCache;if(r===null){r=e.pingCache=new Nl;var i=new Set;r.set(t,i)}else i=r.get(t),i===void 0&&(i=new Set,r.set(t,i));i.has(n)||(Bl=!0,i.add(n),e=Gu.bind(null,e,t,n),t.then(e,e))}function Gu(e,t,n){var r=e.pingCache;r!==null&&r.delete(t),e.pingedLanes|=e.suspendedLanes&n,e.warmLanes&=~n,Fl===e&&(Q&n)===n&&(Hl===4||Hl===3&&(Q&62914560)===Q&&300>Ee()-Zl?!(Pl&2)&&bu(e,0):Gl|=n,ql===Q&&(ql=0)),nd(e)}function Ku(e,t){t===0&&(t=Je()),e=qr(e,t),e!==null&&(Xe(e,t),nd(e))}function qu(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),Ku(e,n)}function Ju(e,t){var n=0;switch(e.tag){case 31:case 13:var r=e.stateNode,a=e.memoizedState;a!==null&&(n=a.retryLane);break;case 19:r=e.stateNode;break;case 22:r=e.stateNode._retryCache;break;default:throw Error(i(314))}r!==null&&r.delete(t),Ku(e,n)}function Yu(e,t){return Se(e,t)}var Xu=null,Zu=null,Qu=!1,$u=!1,ed=!1,td=0;function nd(e){e!==Zu&&e.next===null&&(Zu===null?Xu=Zu=e:Zu=Zu.next=e),$u=!0,Qu||(Qu=!0,ld())}function rd(e,t){if(!ed&&$u){ed=!0;do for(var n=!1,r=Xu;r!==null;){if(!t)if(e!==0){var i=r.pendingLanes;if(i===0)var a=0;else{var o=r.suspendedLanes,s=r.pingedLanes;a=(1<<31-Le(42|e)+1)-1,a&=i&~(o&~s),a=a&201326741?a&201326741|1:a?a|2:0}a!==0&&(n=!0,cd(r,a))}else a=Q,a=Ge(r,r===Fl?a:0,r.cancelPendingCommit!==null||r.timeoutHandle!==-1),!(a&3)||Ke(r,a)||(n=!0,cd(r,a));r=r.next}while(n);ed=!1}}function id(){ad()}function ad(){$u=Qu=!1;var e=0;td!==0&&Gd()&&(e=td);for(var t=Ee(),n=null,r=Xu;r!==null;){var i=r.next,a=od(r,t);a===0?(r.next=null,n===null?Xu=i:n.next=i,i===null&&(Zu=n)):(n=r,(e!==0||a&3)&&($u=!0)),r=i}nu!==0&&nu!==5||rd(e,!1),td!==0&&(td=0)}function od(e,t){for(var n=e.suspendedLanes,r=e.pingedLanes,i=e.expirationTimes,a=e.pendingLanes&-62914561;0<a;){var o=31-Le(a),s=1<<o,c=i[o];c===-1?((s&n)===0||(s&r)!==0)&&(i[o]=qe(s,t)):c<=t&&(e.expiredLanes|=s),a&=~s}if(t=Fl,n=Q,n=Ge(e,e===t?n:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),r=e.callbackNode,n===0||e===t&&(Il===2||Il===9)||e.cancelPendingCommit!==null)return r!==null&&r!==null&&Ce(r),e.callbackNode=null,e.callbackPriority=0;if(!(n&3)||Ke(e,n)){if(t=n&-n,t===e.callbackPriority)return t;switch(r!==null&&Ce(r),nt(n)){case 2:case 8:n=ke;break;case 32:n=Ae;break;case 268435456:n=R;break;default:n=Ae}return r=sd.bind(null,e),n=Se(n,r),e.callbackPriority=t,e.callbackNode=n,t}return r!==null&&r!==null&&Ce(r),e.callbackPriority=2,e.callbackNode=null,2}function sd(e,t){if(nu!==0&&nu!==5)return e.callbackNode=null,e.callbackPriority=0,null;var n=e.callbackNode;if(Bu()&&e.callbackNode!==n)return null;var r=Q;return r=Ge(e,e===Fl?r:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),r===0?null:(mu(e,r,t),od(e,Ee()),e.callbackNode!=null&&e.callbackNode===n?sd.bind(null,e):null)}function cd(e,t){if(Bu())return null;mu(e,t,!0)}function ld(){Yd(function(){Pl&6?Se(Oe,id):ad()})}function ud(){if(td===0){var e=na;e===0&&(e=Ve,Ve<<=1,!(Ve&261888)&&(Ve=256)),td=e}return td}function dd(e){return e==null||typeof e==`symbol`||typeof e==`boolean`?null:typeof e==`function`?e:Qt(``+e)}function fd(e,t){var n=t.ownerDocument.createElement(`input`);return n.name=t.name,n.value=t.value,e.id&&n.setAttribute(`form`,e.id),t.parentNode.insertBefore(n,t),e=new FormData(e),n.parentNode.removeChild(n),e}function pd(e,t,n,r,i){if(t===`submit`&&n&&n.stateNode===i){var a=dd((i[st]||null).action),o=r.submitter;o&&(t=(t=o[st]||null)?dd(t.formAction):o.getAttribute(`formAction`),t!==null&&(a=t,o=null));var s=new xn(`action`,`action`,null,r,i);e.push({event:s,listeners:[{instance:null,listener:function(){if(r.defaultPrevented){if(td!==0){var e=o?fd(i,o):new FormData(i);_s(n,{pending:!0,data:e,method:i.method,action:a},null,e)}}else typeof a==`function`&&(s.preventDefault(),e=o?fd(i,o):new FormData(i),_s(n,{pending:!0,data:e,method:i.method,action:a},a,e))},currentTarget:i}]})}}for(var md=0;md<Rr.length;md++){var hd=Rr[md];zr(hd.toLowerCase(),`on`+(hd[0].toUpperCase()+hd.slice(1)))}zr(Ar,`onAnimationEnd`),zr(jr,`onAnimationIteration`),zr(Mr,`onAnimationStart`),zr(`dblclick`,`onDoubleClick`),zr(`focusin`,`onFocus`),zr(`focusout`,`onBlur`),zr(Nr,`onTransitionRun`),zr(Pr,`onTransitionStart`),zr(Fr,`onTransitionCancel`),zr(Ir,`onTransitionEnd`),Ct(`onMouseEnter`,[`mouseout`,`mouseover`]),Ct(`onMouseLeave`,[`mouseout`,`mouseover`]),Ct(`onPointerEnter`,[`pointerout`,`pointerover`]),Ct(`onPointerLeave`,[`pointerout`,`pointerover`]),St(`onChange`,`change click focusin focusout input keydown keyup selectionchange`.split(` `)),St(`onSelect`,`focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange`.split(` `)),St(`onBeforeInput`,[`compositionend`,`keypress`,`textInput`,`paste`]),St(`onCompositionEnd`,`compositionend focusout keydown keypress keyup mousedown`.split(` `)),St(`onCompositionStart`,`compositionstart focusout keydown keypress keyup mousedown`.split(` `)),St(`onCompositionUpdate`,`compositionupdate focusout keydown keypress keyup mousedown`.split(` `));var gd=`abort canplay canplaythrough durationchange emptied encrypted ended error loadeddata loadedmetadata loadstart pause play playing progress ratechange resize seeked seeking stalled suspend timeupdate volumechange waiting`.split(` `),_d=new Set(`beforetoggle cancel close invalid load scroll scrollend toggle`.split(` `).concat(gd));function vd(e,t){t=(t&4)!=0;for(var n=0;n<e.length;n++){var r=e[n],i=r.event;r=r.listeners;a:{var a=void 0;if(t)for(var o=r.length-1;0<=o;o--){var s=r[o],c=s.instance,l=s.currentTarget;if(s=s.listener,c!==a&&i.isPropagationStopped())break a;a=s,i.currentTarget=l;try{a(i)}catch(e){Br(e)}i.currentTarget=null,a=c}else for(o=0;o<r.length;o++){if(s=r[o],c=s.instance,l=s.currentTarget,s=s.listener,c!==a&&i.isPropagationStopped())break a;a=s,i.currentTarget=l;try{a(i)}catch(e){Br(e)}i.currentTarget=null,a=c}}}}function $(e,t){var n=t[lt];n===void 0&&(n=t[lt]=new Set);var r=e+`__bubble`;n.has(r)||(Sd(t,e,2,!1),n.add(r))}function yd(e,t,n){var r=0;t&&(r|=4),Sd(n,e,r,t)}var bd=`_reactListening`+Math.random().toString(36).slice(2);function xd(e){if(!e[bd]){e[bd]=!0,bt.forEach(function(t){t!==`selectionchange`&&(_d.has(t)||yd(t,!1,e),yd(t,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[bd]||(t[bd]=!0,yd(`selectionchange`,!1,t))}}function Sd(e,t,n,r){switch(mp(t)){case 2:var i=cp;break;case 8:i=lp;break;default:i=up}n=i.bind(null,t,n,e),i=void 0,!un||t!==`touchstart`&&t!==`touchmove`&&t!==`wheel`||(i=!0),r?i===void 0?e.addEventListener(t,n,!0):e.addEventListener(t,n,{capture:!0,passive:i}):i===void 0?e.addEventListener(t,n,!1):e.addEventListener(t,n,{passive:i})}function Cd(e,t,n,r,i){var a=r;if(!(t&1)&&!(t&2)&&r!==null)a:for(;;){if(r===null)return;var s=r.tag;if(s===3||s===4){var c=r.stateNode.containerInfo;if(c===i)break;if(s===4)for(s=r.return;s!==null;){var l=s.tag;if((l===3||l===4)&&s.stateNode.containerInfo===i)return;s=s.return}for(;c!==null;){if(s=ht(c),s===null)return;if(l=s.tag,l===5||l===6||l===26||l===27){r=a=s;continue a}c=c.parentNode}}r=r.return}sn(function(){var r=a,i=tn(n),s=[];a:{var c=Lr.get(e);if(c!==void 0){var l=xn,u=e;switch(e){case`keypress`:if(gn(n)===0)break a;case`keydown`:case`keyup`:l=Ln;break;case`focusin`:u=`focus`,l=kn;break;case`focusout`:u=`blur`,l=kn;break;case`beforeblur`:case`afterblur`:l=kn;break;case`click`:if(n.button===2)break a;case`auxclick`:case`dblclick`:case`mousedown`:case`mousemove`:case`mouseup`:case`mouseout`:case`mouseover`:case`contextmenu`:l=Dn;break;case`drag`:case`dragend`:case`dragenter`:case`dragexit`:case`dragleave`:case`dragover`:case`dragstart`:case`drop`:l=On;break;case`touchcancel`:case`touchend`:case`touchmove`:case`touchstart`:l=zn;break;case Ar:case jr:case Mr:l=An;break;case Ir:l=Bn;break;case`scroll`:case`scrollend`:l=Cn;break;case`wheel`:l=Vn;break;case`copy`:case`cut`:case`paste`:l=jn;break;case`gotpointercapture`:case`lostpointercapture`:case`pointercancel`:case`pointerdown`:case`pointermove`:case`pointerout`:case`pointerover`:case`pointerup`:l=Rn;break;case`toggle`:case`beforetoggle`:l=Hn}var d=(t&4)!=0,f=!d&&(e===`scroll`||e===`scrollend`),p=d?c===null?null:c+`Capture`:c;d=[];for(var m=r,h;m!==null;){var g=m;if(h=g.stateNode,g=g.tag,g!==5&&g!==26&&g!==27||h===null||p===null||(g=cn(m,p),g!=null&&d.push(wd(m,g,h))),f)break;m=m.return}0<d.length&&(c=new l(c,u,null,n,i),s.push({event:c,listeners:d}))}}if(!(t&7)){a:{if(c=e===`mouseover`||e===`pointerover`,l=e===`mouseout`||e===`pointerout`,c&&n!==en&&(u=n.relatedTarget||n.fromElement)&&(ht(u)||u[ct]))break a;if((l||c)&&(c=i.window===i?i:(c=i.ownerDocument)?c.defaultView||c.parentWindow:window,l?(u=n.relatedTarget||n.toElement,l=r,u=u?ht(u):null,u!==null&&(f=o(u),d=u.tag,u!==f||d!==5&&d!==27&&d!==6)&&(u=null)):(l=null,u=r),l!==u)){if(d=Dn,g=`onMouseLeave`,p=`onMouseEnter`,m=`mouse`,(e===`pointerout`||e===`pointerover`)&&(d=Rn,g=`onPointerLeave`,p=`onPointerEnter`,m=`pointer`),f=l==null?c:_t(l),h=u==null?c:_t(u),c=new d(g,m+`leave`,l,n,i),c.target=f,c.relatedTarget=h,g=null,ht(i)===r&&(d=new d(p,m+`enter`,u,n,i),d.target=h,d.relatedTarget=f,g=d),f=g,l&&u)b:{for(d=Ed,p=l,m=u,h=0,g=p;g;g=d(g))h++;g=0;for(var _=m;_;_=d(_))g++;for(;0<h-g;)p=d(p),h--;for(;0<g-h;)m=d(m),g--;for(;h--;){if(p===m||m!==null&&p===m.alternate){d=p;break b}p=d(p),m=d(m)}d=null}else d=null;l!==null&&Dd(s,c,l,d,!1),u!==null&&f!==null&&Dd(s,f,u,d,!0)}}a:{if(c=r?_t(r):window,l=c.nodeName&&c.nodeName.toLowerCase(),l===`select`||l===`input`&&c.type===`file`)var v=sr;else if(tr(c))if(H)v=K;else{v=W;var y=fr}else l=c.nodeName,!l||l.toLowerCase()!==`input`||c.type!==`checkbox`&&c.type!==`radio`?r&&Yt(r.elementType)&&(v=sr):v=G;if(v&&=v(e,r)){nr(s,v,n,i);break a}y&&y(e,c,r),e===`focusout`&&r&&c.type===`number`&&r.memoizedProps.value!=null&&Vt(c,`number`,c.value)}switch(y=r?_t(r):window,e){case`focusin`:(tr(y)||y.contentEditable===`true`)&&(br=y,xr=r,Sr=null);break;case`focusout`:Sr=xr=br=null;break;case`mousedown`:Cr=!0;break;case`contextmenu`:case`mouseup`:case`dragend`:Cr=!1,wr(s,n,i);break;case`selectionchange`:if(yr)break;case`keydown`:case`keyup`:wr(s,n,i)}var b;if(V)b:{switch(e){case`compositionstart`:var x=`onCompositionStart`;break b;case`compositionend`:x=`onCompositionEnd`;break b;case`compositionupdate`:x=`onCompositionUpdate`;break b}x=void 0}else Zn?Yn(e,n)&&(x=`onCompositionEnd`):e===`keydown`&&n.keyCode===229&&(x=`onCompositionStart`);x&&(Kn&&n.locale!==`ko`&&(Zn||x!==`onCompositionStart`?x===`onCompositionEnd`&&Zn&&(b=hn()):(fn=i,pn=`value`in fn?fn.value:fn.textContent,Zn=!0)),y=Td(r,x),0<y.length&&(x=new Mn(x,e,null,n,i),s.push({event:x,listeners:y}),b?x.data=b:(b=Xn(n),b!==null&&(x.data=b)))),(b=Gn?Qn(e,n):$n(e,n))&&(x=Td(r,`onBeforeInput`),0<x.length&&(y=new Mn(`onBeforeInput`,`beforeinput`,null,n,i),s.push({event:y,listeners:x}),y.data=b)),pd(s,e,r,n,i)}vd(s,t)})}function wd(e,t,n){return{instance:e,listener:t,currentTarget:n}}function Td(e,t){for(var n=t+`Capture`,r=[];e!==null;){var i=e,a=i.stateNode;if(i=i.tag,i!==5&&i!==26&&i!==27||a===null||(i=cn(e,n),i!=null&&r.unshift(wd(e,i,a)),i=cn(e,t),i!=null&&r.push(wd(e,i,a))),e.tag===3)return r;e=e.return}return[]}function Ed(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5&&e.tag!==27);return e||null}function Dd(e,t,n,r,i){for(var a=t._reactName,o=[];n!==null&&n!==r;){var s=n,c=s.alternate,l=s.stateNode;if(s=s.tag,c!==null&&c===r)break;s!==5&&s!==26&&s!==27||l===null||(c=l,i?(l=cn(n,a),l!=null&&o.unshift(wd(n,l,c))):i||(l=cn(n,a),l!=null&&o.push(wd(n,l,c)))),n=n.return}o.length!==0&&e.push({event:t,listeners:o})}var Od=/\r\n?/g,kd=/\u0000|\uFFFD/g;function Ad(e){return(typeof e==`string`?e:``+e).replace(Od,`
|
|
9
|
-
`).replace(kd,``)}function jd(e,t){return t=Ad(t),Ad(e)===t}function Md(e,t,n,r,a,o){switch(n){case`children`:typeof r==`string`?t===`body`||t===`textarea`&&r===``||Gt(e,r):(typeof r==`number`||typeof r==`bigint`)&&t!==`body`&&Gt(e,``+r);break;case`className`:kt(e,`class`,r);break;case`tabIndex`:kt(e,`tabindex`,r);break;case`dir`:case`role`:case`viewBox`:case`width`:case`height`:kt(e,n,r);break;case`style`:Jt(e,r,o);break;case`data`:if(t!==`object`){kt(e,`data`,r);break}case`src`:case`href`:if(r===``&&(t!==`a`||n!==`href`)){e.removeAttribute(n);break}if(r==null||typeof r==`function`||typeof r==`symbol`||typeof r==`boolean`){e.removeAttribute(n);break}r=Qt(``+r),e.setAttribute(n,r);break;case`action`:case`formAction`:if(typeof r==`function`){e.setAttribute(n,`javascript:throw new Error('A React form was unexpectedly submitted. If you called form.submit() manually, consider using form.requestSubmit() instead. If you\\'re trying to use event.stopPropagation() in a submit event handler, consider also calling event.preventDefault().')`);break}else typeof o==`function`&&(n===`formAction`?(t!==`input`&&Md(e,t,`name`,a.name,a,null),Md(e,t,`formEncType`,a.formEncType,a,null),Md(e,t,`formMethod`,a.formMethod,a,null),Md(e,t,`formTarget`,a.formTarget,a,null)):(Md(e,t,`encType`,a.encType,a,null),Md(e,t,`method`,a.method,a,null),Md(e,t,`target`,a.target,a,null)));if(r==null||typeof r==`symbol`||typeof r==`boolean`){e.removeAttribute(n);break}r=Qt(``+r),e.setAttribute(n,r);break;case`onClick`:r!=null&&(e.onclick=$t);break;case`onScroll`:r!=null&&$(`scroll`,e);break;case`onScrollEnd`:r!=null&&$(`scrollend`,e);break;case`dangerouslySetInnerHTML`:if(r!=null){if(typeof r!=`object`||!(`__html`in r))throw Error(i(61));if(n=r.__html,n!=null){if(a.children!=null)throw Error(i(60));e.innerHTML=n}}break;case`multiple`:e.multiple=r&&typeof r!=`function`&&typeof r!=`symbol`;break;case`muted`:e.muted=r&&typeof r!=`function`&&typeof r!=`symbol`;break;case`suppressContentEditableWarning`:case`suppressHydrationWarning`:case`defaultValue`:case`defaultChecked`:case`innerHTML`:case`ref`:break;case`autoFocus`:break;case`xlinkHref`:if(r==null||typeof r==`function`||typeof r==`boolean`||typeof r==`symbol`){e.removeAttribute(`xlink:href`);break}n=Qt(``+r),e.setAttributeNS(`http://www.w3.org/1999/xlink`,`xlink:href`,n);break;case`contentEditable`:case`spellCheck`:case`draggable`:case`value`:case`autoReverse`:case`externalResourcesRequired`:case`focusable`:case`preserveAlpha`:r!=null&&typeof r!=`function`&&typeof r!=`symbol`?e.setAttribute(n,``+r):e.removeAttribute(n);break;case`inert`:case`allowFullScreen`:case`async`:case`autoPlay`:case`controls`:case`default`:case`defer`:case`disabled`:case`disablePictureInPicture`:case`disableRemotePlayback`:case`formNoValidate`:case`hidden`:case`loop`:case`noModule`:case`noValidate`:case`open`:case`playsInline`:case`readOnly`:case`required`:case`reversed`:case`scoped`:case`seamless`:case`itemScope`:r&&typeof r!=`function`&&typeof r!=`symbol`?e.setAttribute(n,``):e.removeAttribute(n);break;case`capture`:case`download`:!0===r?e.setAttribute(n,``):!1!==r&&r!=null&&typeof r!=`function`&&typeof r!=`symbol`?e.setAttribute(n,r):e.removeAttribute(n);break;case`cols`:case`rows`:case`size`:case`span`:r!=null&&typeof r!=`function`&&typeof r!=`symbol`&&!isNaN(r)&&1<=r?e.setAttribute(n,r):e.removeAttribute(n);break;case`rowSpan`:case`start`:r==null||typeof r==`function`||typeof r==`symbol`||isNaN(r)?e.removeAttribute(n):e.setAttribute(n,r);break;case`popover`:$(`beforetoggle`,e),$(`toggle`,e),Ot(e,`popover`,r);break;case`xlinkActuate`:At(e,`http://www.w3.org/1999/xlink`,`xlink:actuate`,r);break;case`xlinkArcrole`:At(e,`http://www.w3.org/1999/xlink`,`xlink:arcrole`,r);break;case`xlinkRole`:At(e,`http://www.w3.org/1999/xlink`,`xlink:role`,r);break;case`xlinkShow`:At(e,`http://www.w3.org/1999/xlink`,`xlink:show`,r);break;case`xlinkTitle`:At(e,`http://www.w3.org/1999/xlink`,`xlink:title`,r);break;case`xlinkType`:At(e,`http://www.w3.org/1999/xlink`,`xlink:type`,r);break;case`xmlBase`:At(e,`http://www.w3.org/XML/1998/namespace`,`xml:base`,r);break;case`xmlLang`:At(e,`http://www.w3.org/XML/1998/namespace`,`xml:lang`,r);break;case`xmlSpace`:At(e,`http://www.w3.org/XML/1998/namespace`,`xml:space`,r);break;case`is`:Ot(e,`is`,r);break;case`innerText`:case`textContent`:break;default:(!(2<n.length)||n[0]!==`o`&&n[0]!==`O`||n[1]!==`n`&&n[1]!==`N`)&&(n=Xt.get(n)||n,Ot(e,n,r))}}function Nd(e,t,n,r,a,o){switch(n){case`style`:Jt(e,r,o);break;case`dangerouslySetInnerHTML`:if(r!=null){if(typeof r!=`object`||!(`__html`in r))throw Error(i(61));if(n=r.__html,n!=null){if(a.children!=null)throw Error(i(60));e.innerHTML=n}}break;case`children`:typeof r==`string`?Gt(e,r):(typeof r==`number`||typeof r==`bigint`)&&Gt(e,``+r);break;case`onScroll`:r!=null&&$(`scroll`,e);break;case`onScrollEnd`:r!=null&&$(`scrollend`,e);break;case`onClick`:r!=null&&(e.onclick=$t);break;case`suppressContentEditableWarning`:case`suppressHydrationWarning`:case`innerHTML`:case`ref`:break;case`innerText`:case`textContent`:break;default:if(!xt.hasOwnProperty(n))a:{if(n[0]===`o`&&n[1]===`n`&&(a=n.endsWith(`Capture`),t=n.slice(2,a?n.length-7:void 0),o=e[st]||null,o=o==null?null:o[n],typeof o==`function`&&e.removeEventListener(t,o,a),typeof r==`function`)){typeof o!=`function`&&o!==null&&(n in e?e[n]=null:e.hasAttribute(n)&&e.removeAttribute(n)),e.addEventListener(t,r,a);break a}n in e?e[n]=r:!0===r?e.setAttribute(n,``):Ot(e,n,r)}}}function Pd(e,t,n){switch(t){case`div`:case`span`:case`svg`:case`path`:case`a`:case`g`:case`p`:case`li`:break;case`img`:$(`error`,e),$(`load`,e);var r=!1,a=!1,o;for(o in n)if(n.hasOwnProperty(o)){var s=n[o];if(s!=null)switch(o){case`src`:r=!0;break;case`srcSet`:a=!0;break;case`children`:case`dangerouslySetInnerHTML`:throw Error(i(137,t));default:Md(e,t,o,s,n,null)}}a&&Md(e,t,`srcSet`,n.srcSet,n,null),r&&Md(e,t,`src`,n.src,n,null);return;case`input`:$(`invalid`,e);var c=o=s=a=null,l=null,u=null;for(r in n)if(n.hasOwnProperty(r)){var d=n[r];if(d!=null)switch(r){case`name`:a=d;break;case`type`:s=d;break;case`checked`:l=d;break;case`defaultChecked`:u=d;break;case`value`:o=d;break;case`defaultValue`:c=d;break;case`children`:case`dangerouslySetInnerHTML`:if(d!=null)throw Error(i(137,t));break;default:Md(e,t,r,d,n,null)}}Bt(e,o,c,l,u,s,a,!1);return;case`select`:for(a in $(`invalid`,e),r=s=o=null,n)if(n.hasOwnProperty(a)&&(c=n[a],c!=null))switch(a){case`value`:o=c;break;case`defaultValue`:s=c;break;case`multiple`:r=c;default:Md(e,t,a,c,n,null)}t=o,n=s,e.multiple=!!r,t==null?n!=null&&Ht(e,!!r,n,!0):Ht(e,!!r,t,!1);return;case`textarea`:for(s in $(`invalid`,e),o=a=r=null,n)if(n.hasOwnProperty(s)&&(c=n[s],c!=null))switch(s){case`value`:r=c;break;case`defaultValue`:a=c;break;case`children`:o=c;break;case`dangerouslySetInnerHTML`:if(c!=null)throw Error(i(91));break;default:Md(e,t,s,c,n,null)}Wt(e,r,a,o);return;case`option`:for(l in n)if(n.hasOwnProperty(l)&&(r=n[l],r!=null))switch(l){case`selected`:e.selected=r&&typeof r!=`function`&&typeof r!=`symbol`;break;default:Md(e,t,l,r,n,null)}return;case`dialog`:$(`beforetoggle`,e),$(`toggle`,e),$(`cancel`,e),$(`close`,e);break;case`iframe`:case`object`:$(`load`,e);break;case`video`:case`audio`:for(r=0;r<gd.length;r++)$(gd[r],e);break;case`image`:$(`error`,e),$(`load`,e);break;case`details`:$(`toggle`,e);break;case`embed`:case`source`:case`link`:$(`error`,e),$(`load`,e);case`area`:case`base`:case`br`:case`col`:case`hr`:case`keygen`:case`meta`:case`param`:case`track`:case`wbr`:case`menuitem`:for(u in n)if(n.hasOwnProperty(u)&&(r=n[u],r!=null))switch(u){case`children`:case`dangerouslySetInnerHTML`:throw Error(i(137,t));default:Md(e,t,u,r,n,null)}return;default:if(Yt(t)){for(d in n)n.hasOwnProperty(d)&&(r=n[d],r!==void 0&&Nd(e,t,d,r,n,void 0));return}}for(c in n)n.hasOwnProperty(c)&&(r=n[c],r!=null&&Md(e,t,c,r,n,null))}function Fd(e,t,n,r){switch(t){case`div`:case`span`:case`svg`:case`path`:case`a`:case`g`:case`p`:case`li`:break;case`input`:var a=null,o=null,s=null,c=null,l=null,u=null,d=null;for(m in n){var f=n[m];if(n.hasOwnProperty(m)&&f!=null)switch(m){case`checked`:break;case`value`:break;case`defaultValue`:l=f;default:r.hasOwnProperty(m)||Md(e,t,m,null,r,f)}}for(var p in r){var m=r[p];if(f=n[p],r.hasOwnProperty(p)&&(m!=null||f!=null))switch(p){case`type`:o=m;break;case`name`:a=m;break;case`checked`:u=m;break;case`defaultChecked`:d=m;break;case`value`:s=m;break;case`defaultValue`:c=m;break;case`children`:case`dangerouslySetInnerHTML`:if(m!=null)throw Error(i(137,t));break;default:m!==f&&Md(e,t,p,m,r,f)}}zt(e,s,c,l,u,d,o,a);return;case`select`:for(o in m=s=c=p=null,n)if(l=n[o],n.hasOwnProperty(o)&&l!=null)switch(o){case`value`:break;case`multiple`:m=l;default:r.hasOwnProperty(o)||Md(e,t,o,null,r,l)}for(a in r)if(o=r[a],l=n[a],r.hasOwnProperty(a)&&(o!=null||l!=null))switch(a){case`value`:p=o;break;case`defaultValue`:c=o;break;case`multiple`:s=o;default:o!==l&&Md(e,t,a,o,r,l)}t=c,n=s,r=m,p==null?!!r!=!!n&&(t==null?Ht(e,!!n,n?[]:``,!1):Ht(e,!!n,t,!0)):Ht(e,!!n,p,!1);return;case`textarea`:for(c in m=p=null,n)if(a=n[c],n.hasOwnProperty(c)&&a!=null&&!r.hasOwnProperty(c))switch(c){case`value`:break;case`children`:break;default:Md(e,t,c,null,r,a)}for(s in r)if(a=r[s],o=n[s],r.hasOwnProperty(s)&&(a!=null||o!=null))switch(s){case`value`:p=a;break;case`defaultValue`:m=a;break;case`children`:break;case`dangerouslySetInnerHTML`:if(a!=null)throw Error(i(91));break;default:a!==o&&Md(e,t,s,a,r,o)}Ut(e,p,m);return;case`option`:for(var h in n)if(p=n[h],n.hasOwnProperty(h)&&p!=null&&!r.hasOwnProperty(h))switch(h){case`selected`:e.selected=!1;break;default:Md(e,t,h,null,r,p)}for(l in r)if(p=r[l],m=n[l],r.hasOwnProperty(l)&&p!==m&&(p!=null||m!=null))switch(l){case`selected`:e.selected=p&&typeof p!=`function`&&typeof p!=`symbol`;break;default:Md(e,t,l,p,r,m)}return;case`img`:case`link`:case`area`:case`base`:case`br`:case`col`:case`embed`:case`hr`:case`keygen`:case`meta`:case`param`:case`source`:case`track`:case`wbr`:case`menuitem`:for(var g in n)p=n[g],n.hasOwnProperty(g)&&p!=null&&!r.hasOwnProperty(g)&&Md(e,t,g,null,r,p);for(u in r)if(p=r[u],m=n[u],r.hasOwnProperty(u)&&p!==m&&(p!=null||m!=null))switch(u){case`children`:case`dangerouslySetInnerHTML`:if(p!=null)throw Error(i(137,t));break;default:Md(e,t,u,p,r,m)}return;default:if(Yt(t)){for(var _ in n)p=n[_],n.hasOwnProperty(_)&&p!==void 0&&!r.hasOwnProperty(_)&&Nd(e,t,_,void 0,r,p);for(d in r)p=r[d],m=n[d],!r.hasOwnProperty(d)||p===m||p===void 0&&m===void 0||Nd(e,t,d,p,r,m);return}}for(var v in n)p=n[v],n.hasOwnProperty(v)&&p!=null&&!r.hasOwnProperty(v)&&Md(e,t,v,null,r,p);for(f in r)p=r[f],m=n[f],!r.hasOwnProperty(f)||p===m||p==null&&m==null||Md(e,t,f,p,r,m)}function Id(e){switch(e){case`css`:case`script`:case`font`:case`img`:case`image`:case`input`:case`link`:return!0;default:return!1}}function Ld(){if(typeof performance.getEntriesByType==`function`){for(var e=0,t=0,n=performance.getEntriesByType(`resource`),r=0;r<n.length;r++){var i=n[r],a=i.transferSize,o=i.initiatorType,s=i.duration;if(a&&s&&Id(o)){for(o=0,s=i.responseEnd,r+=1;r<n.length;r++){var c=n[r],l=c.startTime;if(l>s)break;var u=c.transferSize,d=c.initiatorType;u&&Id(d)&&(c=c.responseEnd,o+=u*(c<s?1:(s-l)/(c-l)))}if(--r,t+=8*(a+o)/(i.duration/1e3),e++,10<e)break}}if(0<e)return t/e/1e6}return navigator.connection&&(e=navigator.connection.downlink,typeof e==`number`)?e:5}var Rd=null,zd=null;function Bd(e){return e.nodeType===9?e:e.ownerDocument}function Vd(e){switch(e){case`http://www.w3.org/2000/svg`:return 1;case`http://www.w3.org/1998/Math/MathML`:return 2;default:return 0}}function Hd(e,t){if(e===0)switch(t){case`svg`:return 1;case`math`:return 2;default:return 0}return e===1&&t===`foreignObject`?0:e}function Ud(e,t){return e===`textarea`||e===`noscript`||typeof t.children==`string`||typeof t.children==`number`||typeof t.children==`bigint`||typeof t.dangerouslySetInnerHTML==`object`&&t.dangerouslySetInnerHTML!==null&&t.dangerouslySetInnerHTML.__html!=null}var Wd=null;function Gd(){var e=window.event;return e&&e.type===`popstate`?e===Wd?!1:(Wd=e,!0):(Wd=null,!1)}var Kd=typeof setTimeout==`function`?setTimeout:void 0,qd=typeof clearTimeout==`function`?clearTimeout:void 0,Jd=typeof Promise==`function`?Promise:void 0,Yd=typeof queueMicrotask==`function`?queueMicrotask:Jd===void 0?Kd:function(e){return Jd.resolve(null).then(e).catch(Xd)};function Xd(e){setTimeout(function(){throw e})}function Zd(e){return e===`head`}function Qd(e,t){var n=t,r=0;do{var i=n.nextSibling;if(e.removeChild(n),i&&i.nodeType===8)if(n=i.data,n===`/$`||n===`/&`){if(r===0){e.removeChild(i),Np(t);return}r--}else if(n===`$`||n===`$?`||n===`$~`||n===`$!`||n===`&`)r++;else if(n===`html`)pf(e.ownerDocument.documentElement);else if(n===`head`){n=e.ownerDocument.head,pf(n);for(var a=n.firstChild;a;){var o=a.nextSibling,s=a.nodeName;a[pt]||s===`SCRIPT`||s===`STYLE`||s===`LINK`&&a.rel.toLowerCase()===`stylesheet`||n.removeChild(a),a=o}}else n===`body`&&pf(e.ownerDocument.body);n=i}while(n);Np(t)}function $d(e,t){var n=e;e=0;do{var r=n.nextSibling;if(n.nodeType===1?t?(n._stashedDisplay=n.style.display,n.style.display=`none`):(n.style.display=n._stashedDisplay||``,n.getAttribute(`style`)===``&&n.removeAttribute(`style`)):n.nodeType===3&&(t?(n._stashedText=n.nodeValue,n.nodeValue=``):n.nodeValue=n._stashedText||``),r&&r.nodeType===8)if(n=r.data,n===`/$`){if(e===0)break;e--}else n!==`$`&&n!==`$?`&&n!==`$~`&&n!==`$!`||e++;n=r}while(n)}function ef(e){var t=e.firstChild;for(t&&t.nodeType===10&&(t=t.nextSibling);t;){var n=t;switch(t=t.nextSibling,n.nodeName){case`HTML`:case`HEAD`:case`BODY`:ef(n),mt(n);continue;case`SCRIPT`:case`STYLE`:continue;case`LINK`:if(n.rel.toLowerCase()===`stylesheet`)continue}e.removeChild(n)}}function tf(e,t,n,r){for(;e.nodeType===1;){var i=n;if(e.nodeName.toLowerCase()!==t.toLowerCase()){if(!r&&(e.nodeName!==`INPUT`||e.type!==`hidden`))break}else if(!r)if(t===`input`&&e.type===`hidden`){var a=i.name==null?null:``+i.name;if(i.type===`hidden`&&e.getAttribute(`name`)===a)return e}else return e;else if(!e[pt])switch(t){case`meta`:if(!e.hasAttribute(`itemprop`))break;return e;case`link`:if(a=e.getAttribute(`rel`),a===`stylesheet`&&e.hasAttribute(`data-precedence`)||a!==i.rel||e.getAttribute(`href`)!==(i.href==null||i.href===``?null:i.href)||e.getAttribute(`crossorigin`)!==(i.crossOrigin==null?null:i.crossOrigin)||e.getAttribute(`title`)!==(i.title==null?null:i.title))break;return e;case`style`:if(e.hasAttribute(`data-precedence`))break;return e;case`script`:if(a=e.getAttribute(`src`),(a!==(i.src==null?null:i.src)||e.getAttribute(`type`)!==(i.type==null?null:i.type)||e.getAttribute(`crossorigin`)!==(i.crossOrigin==null?null:i.crossOrigin))&&a&&e.hasAttribute(`async`)&&!e.hasAttribute(`itemprop`))break;return e;default:return e}if(e=cf(e.nextSibling),e===null)break}return null}function nf(e,t,n){if(t===``)return null;for(;e.nodeType!==3;)if((e.nodeType!==1||e.nodeName!==`INPUT`||e.type!==`hidden`)&&!n||(e=cf(e.nextSibling),e===null))return null;return e}function rf(e,t){for(;e.nodeType!==8;)if((e.nodeType!==1||e.nodeName!==`INPUT`||e.type!==`hidden`)&&!t||(e=cf(e.nextSibling),e===null))return null;return e}function af(e){return e.data===`$?`||e.data===`$~`}function of(e){return e.data===`$!`||e.data===`$?`&&e.ownerDocument.readyState!==`loading`}function sf(e,t){var n=e.ownerDocument;if(e.data===`$~`)e._reactRetry=t;else if(e.data!==`$?`||n.readyState!==`loading`)t();else{var r=function(){t(),n.removeEventListener(`DOMContentLoaded`,r)};n.addEventListener(`DOMContentLoaded`,r),e._reactRetry=r}}function cf(e){for(;e!=null;e=e.nextSibling){var t=e.nodeType;if(t===1||t===3)break;if(t===8){if(t=e.data,t===`$`||t===`$!`||t===`$?`||t===`$~`||t===`&`||t===`F!`||t===`F`)break;if(t===`/$`||t===`/&`)return null}}return e}var lf=null;function uf(e){e=e.nextSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n===`/$`||n===`/&`){if(t===0)return cf(e.nextSibling);t--}else n!==`$`&&n!==`$!`&&n!==`$?`&&n!==`$~`&&n!==`&`||t++}e=e.nextSibling}return null}function df(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n===`$`||n===`$!`||n===`$?`||n===`$~`||n===`&`){if(t===0)return e;t--}else n!==`/$`&&n!==`/&`||t++}e=e.previousSibling}return null}function ff(e,t,n){switch(t=Bd(n),e){case`html`:if(e=t.documentElement,!e)throw Error(i(452));return e;case`head`:if(e=t.head,!e)throw Error(i(453));return e;case`body`:if(e=t.body,!e)throw Error(i(454));return e;default:throw Error(i(451))}}function pf(e){for(var t=e.attributes;t.length;)e.removeAttributeNode(t[0]);mt(e)}var mf=new Map,hf=new Set;function gf(e){return typeof e.getRootNode==`function`?e.getRootNode():e.nodeType===9?e:e.ownerDocument}var _f=P.d;P.d={f:vf,r:yf,D:Sf,C:Cf,L:wf,m:Tf,X:Df,S:Ef,M:Of};function vf(){var e=_f.f(),t=vu();return e||t}function yf(e){var t=gt(e);t!==null&&t.tag===5&&t.type===`form`?ys(t):_f.r(e)}var bf=typeof document>`u`?null:document;function xf(e,t,n){var r=bf;if(r&&typeof t==`string`&&t){var i=Rt(t);i=`link[rel="`+e+`"][href="`+i+`"]`,typeof n==`string`&&(i+=`[crossorigin="`+n+`"]`),hf.has(i)||(hf.add(i),e={rel:e,crossOrigin:n,href:t},r.querySelector(i)===null&&(t=r.createElement(`link`),Pd(t,`link`,e),yt(t),r.head.appendChild(t)))}}function Sf(e){_f.D(e),xf(`dns-prefetch`,e,null)}function Cf(e,t){_f.C(e,t),xf(`preconnect`,e,t)}function wf(e,t,n){_f.L(e,t,n);var r=bf;if(r&&e&&t){var i=`link[rel="preload"][as="`+Rt(t)+`"]`;t===`image`&&n&&n.imageSrcSet?(i+=`[imagesrcset="`+Rt(n.imageSrcSet)+`"]`,typeof n.imageSizes==`string`&&(i+=`[imagesizes="`+Rt(n.imageSizes)+`"]`)):i+=`[href="`+Rt(e)+`"]`;var a=i;switch(t){case`style`:a=Af(e);break;case`script`:a=Pf(e)}mf.has(a)||(e=h({rel:`preload`,href:t===`image`&&n&&n.imageSrcSet?void 0:e,as:t},n),mf.set(a,e),r.querySelector(i)!==null||t===`style`&&r.querySelector(jf(a))||t===`script`&&r.querySelector(Ff(a))||(t=r.createElement(`link`),Pd(t,`link`,e),yt(t),r.head.appendChild(t)))}}function Tf(e,t){_f.m(e,t);var n=bf;if(n&&e){var r=t&&typeof t.as==`string`?t.as:`script`,i=`link[rel="modulepreload"][as="`+Rt(r)+`"][href="`+Rt(e)+`"]`,a=i;switch(r){case`audioworklet`:case`paintworklet`:case`serviceworker`:case`sharedworker`:case`worker`:case`script`:a=Pf(e)}if(!mf.has(a)&&(e=h({rel:`modulepreload`,href:e},t),mf.set(a,e),n.querySelector(i)===null)){switch(r){case`audioworklet`:case`paintworklet`:case`serviceworker`:case`sharedworker`:case`worker`:case`script`:if(n.querySelector(Ff(a)))return}r=n.createElement(`link`),Pd(r,`link`,e),yt(r),n.head.appendChild(r)}}}function Ef(e,t,n){_f.S(e,t,n);var r=bf;if(r&&e){var i=vt(r).hoistableStyles,a=Af(e);t||=`default`;var o=i.get(a);if(!o){var s={loading:0,preload:null};if(o=r.querySelector(jf(a)))s.loading=5;else{e=h({rel:`stylesheet`,href:e,"data-precedence":t},n),(n=mf.get(a))&&Rf(e,n);var c=o=r.createElement(`link`);yt(c),Pd(c,`link`,e),c._p=new Promise(function(e,t){c.onload=e,c.onerror=t}),c.addEventListener(`load`,function(){s.loading|=1}),c.addEventListener(`error`,function(){s.loading|=2}),s.loading|=4,Lf(o,t,r)}o={type:`stylesheet`,instance:o,count:1,state:s},i.set(a,o)}}}function Df(e,t){_f.X(e,t);var n=bf;if(n&&e){var r=vt(n).hoistableScripts,i=Pf(e),a=r.get(i);a||(a=n.querySelector(Ff(i)),a||(e=h({src:e,async:!0},t),(t=mf.get(i))&&zf(e,t),a=n.createElement(`script`),yt(a),Pd(a,`link`,e),n.head.appendChild(a)),a={type:`script`,instance:a,count:1,state:null},r.set(i,a))}}function Of(e,t){_f.M(e,t);var n=bf;if(n&&e){var r=vt(n).hoistableScripts,i=Pf(e),a=r.get(i);a||(a=n.querySelector(Ff(i)),a||(e=h({src:e,async:!0,type:`module`},t),(t=mf.get(i))&&zf(e,t),a=n.createElement(`script`),yt(a),Pd(a,`link`,e),n.head.appendChild(a)),a={type:`script`,instance:a,count:1,state:null},r.set(i,a))}}function kf(e,t,n,r){var a=(a=ce.current)?gf(a):null;if(!a)throw Error(i(446));switch(e){case`meta`:case`title`:return null;case`style`:return typeof n.precedence==`string`&&typeof n.href==`string`?(t=Af(n.href),n=vt(a).hoistableStyles,r=n.get(t),r||(r={type:`style`,instance:null,count:0,state:null},n.set(t,r)),r):{type:`void`,instance:null,count:0,state:null};case`link`:if(n.rel===`stylesheet`&&typeof n.href==`string`&&typeof n.precedence==`string`){e=Af(n.href);var o=vt(a).hoistableStyles,s=o.get(e);if(s||(a=a.ownerDocument||a,s={type:`stylesheet`,instance:null,count:0,state:{loading:0,preload:null}},o.set(e,s),(o=a.querySelector(jf(e)))&&!o._p&&(s.instance=o,s.state.loading=5),mf.has(e)||(n={rel:`preload`,as:`style`,href:n.href,crossOrigin:n.crossOrigin,integrity:n.integrity,media:n.media,hrefLang:n.hrefLang,referrerPolicy:n.referrerPolicy},mf.set(e,n),o||Nf(a,e,n,s.state))),t&&r===null)throw Error(i(528,``));return s}if(t&&r!==null)throw Error(i(529,``));return null;case`script`:return t=n.async,n=n.src,typeof n==`string`&&t&&typeof t!=`function`&&typeof t!=`symbol`?(t=Pf(n),n=vt(a).hoistableScripts,r=n.get(t),r||(r={type:`script`,instance:null,count:0,state:null},n.set(t,r)),r):{type:`void`,instance:null,count:0,state:null};default:throw Error(i(444,e))}}function Af(e){return`href="`+Rt(e)+`"`}function jf(e){return`link[rel="stylesheet"][`+e+`]`}function Mf(e){return h({},e,{"data-precedence":e.precedence,precedence:null})}function Nf(e,t,n,r){e.querySelector(`link[rel="preload"][as="style"][`+t+`]`)?r.loading=1:(t=e.createElement(`link`),r.preload=t,t.addEventListener(`load`,function(){return r.loading|=1}),t.addEventListener(`error`,function(){return r.loading|=2}),Pd(t,`link`,n),yt(t),e.head.appendChild(t))}function Pf(e){return`[src="`+Rt(e)+`"]`}function Ff(e){return`script[async]`+e}function If(e,t,n){if(t.count++,t.instance===null)switch(t.type){case`style`:var r=e.querySelector(`style[data-href~="`+Rt(n.href)+`"]`);if(r)return t.instance=r,yt(r),r;var a=h({},n,{"data-href":n.href,"data-precedence":n.precedence,href:null,precedence:null});return r=(e.ownerDocument||e).createElement(`style`),yt(r),Pd(r,`style`,a),Lf(r,n.precedence,e),t.instance=r;case`stylesheet`:a=Af(n.href);var o=e.querySelector(jf(a));if(o)return t.state.loading|=4,t.instance=o,yt(o),o;r=Mf(n),(a=mf.get(a))&&Rf(r,a),o=(e.ownerDocument||e).createElement(`link`),yt(o);var s=o;return s._p=new Promise(function(e,t){s.onload=e,s.onerror=t}),Pd(o,`link`,r),t.state.loading|=4,Lf(o,n.precedence,e),t.instance=o;case`script`:return o=Pf(n.src),(a=e.querySelector(Ff(o)))?(t.instance=a,yt(a),a):(r=n,(a=mf.get(o))&&(r=h({},n),zf(r,a)),e=e.ownerDocument||e,a=e.createElement(`script`),yt(a),Pd(a,`link`,r),e.head.appendChild(a),t.instance=a);case`void`:return null;default:throw Error(i(443,t.type))}else t.type===`stylesheet`&&!(t.state.loading&4)&&(r=t.instance,t.state.loading|=4,Lf(r,n.precedence,e));return t.instance}function Lf(e,t,n){for(var r=n.querySelectorAll(`link[rel="stylesheet"][data-precedence],style[data-precedence]`),i=r.length?r[r.length-1]:null,a=i,o=0;o<r.length;o++){var s=r[o];if(s.dataset.precedence===t)a=s;else if(a!==i)break}a?a.parentNode.insertBefore(e,a.nextSibling):(t=n.nodeType===9?n.head:n,t.insertBefore(e,t.firstChild))}function Rf(e,t){e.crossOrigin??=t.crossOrigin,e.referrerPolicy??=t.referrerPolicy,e.title??=t.title}function zf(e,t){e.crossOrigin??=t.crossOrigin,e.referrerPolicy??=t.referrerPolicy,e.integrity??=t.integrity}var Bf=null;function Vf(e,t,n){if(Bf===null){var r=new Map,i=Bf=new Map;i.set(n,r)}else i=Bf,r=i.get(n),r||(r=new Map,i.set(n,r));if(r.has(e))return r;for(r.set(e,null),n=n.getElementsByTagName(e),i=0;i<n.length;i++){var a=n[i];if(!(a[pt]||a[ot]||e===`link`&&a.getAttribute(`rel`)===`stylesheet`)&&a.namespaceURI!==`http://www.w3.org/2000/svg`){var o=a.getAttribute(t)||``;o=e+o;var s=r.get(o);s?s.push(a):r.set(o,[a])}}return r}function Hf(e,t,n){e=e.ownerDocument||e,e.head.insertBefore(n,t===`title`?e.querySelector(`head > title`):null)}function Uf(e,t,n){if(n===1||t.itemProp!=null)return!1;switch(e){case`meta`:case`title`:return!0;case`style`:if(typeof t.precedence!=`string`||typeof t.href!=`string`||t.href===``)break;return!0;case`link`:if(typeof t.rel!=`string`||typeof t.href!=`string`||t.href===``||t.onLoad||t.onError)break;switch(t.rel){case`stylesheet`:return e=t.disabled,typeof t.precedence==`string`&&e==null;default:return!0}case`script`:if(t.async&&typeof t.async!=`function`&&typeof t.async!=`symbol`&&!t.onLoad&&!t.onError&&t.src&&typeof t.src==`string`)return!0}return!1}function Wf(e){return!(e.type===`stylesheet`&&!(e.state.loading&3))}function Gf(e,t,n,r){if(n.type===`stylesheet`&&(typeof r.media!=`string`||!1!==matchMedia(r.media).matches)&&!(n.state.loading&4)){if(n.instance===null){var i=Af(r.href),a=t.querySelector(jf(i));if(a){t=a._p,typeof t==`object`&&t&&typeof t.then==`function`&&(e.count++,e=Jf.bind(e),t.then(e,e)),n.state.loading|=4,n.instance=a,yt(a);return}a=t.ownerDocument||t,r=Mf(r),(i=mf.get(i))&&Rf(r,i),a=a.createElement(`link`),yt(a);var o=a;o._p=new Promise(function(e,t){o.onload=e,o.onerror=t}),Pd(a,`link`,r),n.instance=a}e.stylesheets===null&&(e.stylesheets=new Map),e.stylesheets.set(n,t),(t=n.state.preload)&&!(n.state.loading&3)&&(e.count++,n=Jf.bind(e),t.addEventListener(`load`,n),t.addEventListener(`error`,n))}}var Kf=0;function qf(e,t){return e.stylesheets&&e.count===0&&Xf(e,e.stylesheets),0<e.count||0<e.imgCount?function(n){var r=setTimeout(function(){if(e.stylesheets&&Xf(e,e.stylesheets),e.unsuspend){var t=e.unsuspend;e.unsuspend=null,t()}},6e4+t);0<e.imgBytes&&Kf===0&&(Kf=62500*Ld());var i=setTimeout(function(){if(e.waitingForImages=!1,e.count===0&&(e.stylesheets&&Xf(e,e.stylesheets),e.unsuspend)){var t=e.unsuspend;e.unsuspend=null,t()}},(e.imgBytes>Kf?50:800)+t);return e.unsuspend=n,function(){e.unsuspend=null,clearTimeout(r),clearTimeout(i)}}:null}function Jf(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)Xf(this,this.stylesheets);else if(this.unsuspend){var e=this.unsuspend;this.unsuspend=null,e()}}}var Yf=null;function Xf(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,Yf=new Map,t.forEach(Zf,e),Yf=null,Jf.call(e))}function Zf(e,t){if(!(t.state.loading&4)){var n=Yf.get(e);if(n)var r=n.get(null);else{n=new Map,Yf.set(e,n);for(var i=e.querySelectorAll(`link[data-precedence],style[data-precedence]`),a=0;a<i.length;a++){var o=i[a];(o.nodeName===`LINK`||o.getAttribute(`media`)!==`not all`)&&(n.set(o.dataset.precedence,o),r=o)}r&&n.set(null,r)}i=t.instance,o=i.getAttribute(`data-precedence`),a=n.get(o)||r,a===r&&n.set(null,i),n.set(o,i),this.count++,r=Jf.bind(this),i.addEventListener(`load`,r),i.addEventListener(`error`,r),a?a.parentNode.insertBefore(i,a.nextSibling):(e=e.nodeType===9?e.head:e,e.insertBefore(i,e.firstChild)),t.state.loading|=4}}var Qf={$$typeof:C,Provider:null,Consumer:null,_currentValue:re,_currentValue2:re,_threadCount:0};function $f(e,t,n,r,i,a,o,s,c){this.tag=1,this.containerInfo=e,this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.next=this.pendingContext=this.context=this.cancelPendingCommit=null,this.callbackPriority=0,this.expirationTimes=Ye(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Ye(0),this.hiddenUpdates=Ye(null),this.identifierPrefix=r,this.onUncaughtError=i,this.onCaughtError=a,this.onRecoverableError=o,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=c,this.incompleteTransitions=new Map}function ep(e,t,n,r,i,a,o,s,c,l,u,d){return e=new $f(e,t,n,o,c,l,u,d,s),t=1,!0===a&&(t|=24),a=Qr(3,null,null,t),e.current=a,a.stateNode=e,t=Qi(),t.refCount++,e.pooledCache=t,t.refCount++,a.memoizedState={element:r,isDehydrated:n,cache:t},ja(a),e}function tp(e){return e?(e=Xr,e):Xr}function np(e,t,n,r,i,a){i=tp(i),r.context===null?r.context=i:r.pendingContext=i,r=Na(t),r.payload={element:n},a=a===void 0?null:a,a!==null&&(r.callback=a),n=Pa(e,r,t),n!==null&&(pu(n,e,t),Fa(n,e,t))}function rp(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var n=e.retryLane;e.retryLane=n!==0&&n<t?n:t}}function ip(e,t){rp(e,t),(e=e.alternate)&&rp(e,t)}function ap(e){if(e.tag===13||e.tag===31){var t=qr(e,67108864);t!==null&&pu(t,e,67108864),ip(e,67108864)}}function op(e){if(e.tag===13||e.tag===31){var t=du();t=tt(t);var n=qr(e,t);n!==null&&pu(n,e,t),ip(e,t)}}var sp=!0;function cp(e,t,n,r){var i=N.T;N.T=null;var a=P.p;try{P.p=2,up(e,t,n,r)}finally{P.p=a,N.T=i}}function lp(e,t,n,r){var i=N.T;N.T=null;var a=P.p;try{P.p=8,up(e,t,n,r)}finally{P.p=a,N.T=i}}function up(e,t,n,r){if(sp){var i=dp(r);if(i===null)Cd(e,t,r,fp,n),Cp(e,r);else if(Tp(i,e,t,n,r))r.stopPropagation();else if(Cp(e,r),t&4&&-1<Sp.indexOf(e)){for(;i!==null;){var a=gt(i);if(a!==null)switch(a.tag){case 3:if(a=a.stateNode,a.current.memoizedState.isDehydrated){var o=We(a.pendingLanes);if(o!==0){var s=a;for(s.pendingLanes|=2,s.entangledLanes|=2;o;){var c=1<<31-Le(o);s.entanglements[1]|=c,o&=~c}nd(a),!(Pl&6)&&($l=Ee()+500,rd(0,!1))}}break;case 31:case 13:s=qr(a,2),s!==null&&pu(s,a,2),vu(),ip(a,2)}if(a=dp(r),a===null&&Cd(e,t,r,fp,n),a===i)break;i=a}i!==null&&r.stopPropagation()}else Cd(e,t,r,null,n)}}function dp(e){return e=tn(e),pp(e)}var fp=null;function pp(e){if(fp=null,e=ht(e),e!==null){var t=o(e);if(t===null)e=null;else{var n=t.tag;if(n===13){if(e=s(t),e!==null)return e;e=null}else if(n===31){if(e=c(t),e!==null)return e;e=null}else if(n===3){if(t.stateNode.current.memoizedState.isDehydrated)return t.tag===3?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null)}}return fp=e,null}function mp(e){switch(e){case`beforetoggle`:case`cancel`:case`click`:case`close`:case`contextmenu`:case`copy`:case`cut`:case`auxclick`:case`dblclick`:case`dragend`:case`dragstart`:case`drop`:case`focusin`:case`focusout`:case`input`:case`invalid`:case`keydown`:case`keypress`:case`keyup`:case`mousedown`:case`mouseup`:case`paste`:case`pause`:case`play`:case`pointercancel`:case`pointerdown`:case`pointerup`:case`ratechange`:case`reset`:case`resize`:case`seeked`:case`submit`:case`toggle`:case`touchcancel`:case`touchend`:case`touchstart`:case`volumechange`:case`change`:case`selectionchange`:case`textInput`:case`compositionstart`:case`compositionend`:case`compositionupdate`:case`beforeblur`:case`afterblur`:case`beforeinput`:case`blur`:case`fullscreenchange`:case`focus`:case`hashchange`:case`popstate`:case`select`:case`selectstart`:return 2;case`drag`:case`dragenter`:case`dragexit`:case`dragleave`:case`dragover`:case`mousemove`:case`mouseout`:case`mouseover`:case`pointermove`:case`pointerout`:case`pointerover`:case`scroll`:case`touchmove`:case`wheel`:case`mouseenter`:case`mouseleave`:case`pointerenter`:case`pointerleave`:return 8;case`message`:switch(De()){case Oe:return 2;case ke:return 8;case Ae:case je:return 32;case R:return 268435456;default:return 32}default:return 32}}var hp=!1,gp=null,_p=null,vp=null,yp=new Map,bp=new Map,xp=[],Sp=`mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset`.split(` `);function Cp(e,t){switch(e){case`focusin`:case`focusout`:gp=null;break;case`dragenter`:case`dragleave`:_p=null;break;case`mouseover`:case`mouseout`:vp=null;break;case`pointerover`:case`pointerout`:yp.delete(t.pointerId);break;case`gotpointercapture`:case`lostpointercapture`:bp.delete(t.pointerId)}}function wp(e,t,n,r,i,a){return e===null||e.nativeEvent!==a?(e={blockedOn:t,domEventName:n,eventSystemFlags:r,nativeEvent:a,targetContainers:[i]},t!==null&&(t=gt(t),t!==null&&ap(t)),e):(e.eventSystemFlags|=r,t=e.targetContainers,i!==null&&t.indexOf(i)===-1&&t.push(i),e)}function Tp(e,t,n,r,i){switch(t){case`focusin`:return gp=wp(gp,e,t,n,r,i),!0;case`dragenter`:return _p=wp(_p,e,t,n,r,i),!0;case`mouseover`:return vp=wp(vp,e,t,n,r,i),!0;case`pointerover`:var a=i.pointerId;return yp.set(a,wp(yp.get(a)||null,e,t,n,r,i)),!0;case`gotpointercapture`:return a=i.pointerId,bp.set(a,wp(bp.get(a)||null,e,t,n,r,i)),!0}return!1}function Ep(e){var t=ht(e.target);if(t!==null){var n=o(t);if(n!==null){if(t=n.tag,t===13){if(t=s(n),t!==null){e.blockedOn=t,it(e.priority,function(){op(n)});return}}else if(t===31){if(t=c(n),t!==null){e.blockedOn=t,it(e.priority,function(){op(n)});return}}else if(t===3&&n.stateNode.current.memoizedState.isDehydrated){e.blockedOn=n.tag===3?n.stateNode.containerInfo:null;return}}}e.blockedOn=null}function Dp(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var n=dp(e.nativeEvent);if(n===null){n=e.nativeEvent;var r=new n.constructor(n.type,n);en=r,n.target.dispatchEvent(r),en=null}else return t=gt(n),t!==null&&ap(t),e.blockedOn=n,!1;t.shift()}return!0}function Op(e,t,n){Dp(e)&&n.delete(t)}function kp(){hp=!1,gp!==null&&Dp(gp)&&(gp=null),_p!==null&&Dp(_p)&&(_p=null),vp!==null&&Dp(vp)&&(vp=null),yp.forEach(Op),bp.forEach(Op)}function Ap(e,n){e.blockedOn===n&&(e.blockedOn=null,hp||(hp=!0,t.unstable_scheduleCallback(t.unstable_NormalPriority,kp)))}var jp=null;function Mp(e){jp!==e&&(jp=e,t.unstable_scheduleCallback(t.unstable_NormalPriority,function(){jp===e&&(jp=null);for(var t=0;t<e.length;t+=3){var n=e[t],r=e[t+1],i=e[t+2];if(typeof r!=`function`){if(pp(r||n)===null)continue;break}var a=gt(n);a!==null&&(e.splice(t,3),t-=3,_s(a,{pending:!0,data:i,method:n.method,action:r},r,i))}}))}function Np(e){function t(t){return Ap(t,e)}gp!==null&&Ap(gp,e),_p!==null&&Ap(_p,e),vp!==null&&Ap(vp,e),yp.forEach(t),bp.forEach(t);for(var n=0;n<xp.length;n++){var r=xp[n];r.blockedOn===e&&(r.blockedOn=null)}for(;0<xp.length&&(n=xp[0],n.blockedOn===null);)Ep(n),n.blockedOn===null&&xp.shift();if(n=(e.ownerDocument||e).$$reactFormReplay,n!=null)for(r=0;r<n.length;r+=3){var i=n[r],a=n[r+1],o=i[st]||null;if(typeof a==`function`)o||Mp(n);else if(o){var s=null;if(a&&a.hasAttribute(`formAction`)){if(i=a,o=a[st]||null)s=o.formAction;else if(pp(i)!==null)continue}else s=o.action;typeof s==`function`?n[r+1]=s:(n.splice(r,3),r-=3),Mp(n)}}}function Pp(){function e(e){e.canIntercept&&e.info===`react-transition`&&e.intercept({handler:function(){return new Promise(function(e){return i=e})},focusReset:`manual`,scroll:`manual`})}function t(){i!==null&&(i(),i=null),r||setTimeout(n,20)}function n(){if(!r&&!navigation.transition){var e=navigation.currentEntry;e&&e.url!=null&&navigation.navigate(e.url,{state:e.getState(),info:`react-transition`,history:`replace`})}}if(typeof navigation==`object`){var r=!1,i=null;return navigation.addEventListener(`navigate`,e),navigation.addEventListener(`navigatesuccess`,t),navigation.addEventListener(`navigateerror`,t),setTimeout(n,100),function(){r=!0,navigation.removeEventListener(`navigate`,e),navigation.removeEventListener(`navigatesuccess`,t),navigation.removeEventListener(`navigateerror`,t),i!==null&&(i(),i=null)}}}function Fp(e){this._internalRoot=e}Ip.prototype.render=Fp.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(i(409));var n=t.current;np(n,du(),e,t,null,null)},Ip.prototype.unmount=Fp.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;np(e.current,2,null,e,null,null),vu(),t[ct]=null}};function Ip(e){this._internalRoot=e}Ip.prototype.unstable_scheduleHydration=function(e){if(e){var t=rt();e={blockedOn:null,target:e,priority:t};for(var n=0;n<xp.length&&t!==0&&t<xp[n].priority;n++);xp.splice(n,0,e),n===0&&Ep(e)}};var Lp=n.version;if(Lp!==`19.2.4`)throw Error(i(527,Lp,`19.2.4`));P.findDOMNode=function(e){var t=e._reactInternals;if(t===void 0)throw typeof e.render==`function`?Error(i(188)):(e=Object.keys(e).join(`,`),Error(i(268,e)));return e=d(t),e=e===null?null:p(e),e=e===null?null:e.stateNode,e};var Rp={bundleType:0,version:`19.2.4`,rendererPackageName:`react-dom`,currentDispatcherRef:N,reconcilerVersion:`19.2.4`};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<`u`){var zp=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!zp.isDisabled&&zp.supportsFiber)try{Pe=zp.inject(Rp),Fe=zp}catch{}}e.createRoot=function(e,t){if(!a(e))throw Error(i(299));var n=!1,r=``,o=Bs,s=Vs,c=Hs;return t!=null&&(!0===t.unstable_strictMode&&(n=!0),t.identifierPrefix!==void 0&&(r=t.identifierPrefix),t.onUncaughtError!==void 0&&(o=t.onUncaughtError),t.onCaughtError!==void 0&&(s=t.onCaughtError),t.onRecoverableError!==void 0&&(c=t.onRecoverableError)),t=ep(e,1,!1,null,null,n,r,null,o,s,c,Pp),e[ct]=t.current,xd(e),new Fp(t)}})),g=c(o(((e,t)=>{function n(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>`u`||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!=`function`))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(n)}catch(e){console.error(e)}}n(),t.exports=h()}))(),1),_=c(u(),1),v=500,y=200,b=3e3,x=1e3,S=3e4,C=Object.freeze({counters:Object.freeze({}),latestBurst:null,burstRing:Object.freeze([]),burstSeq:0,lifecycleRing:Object.freeze([]),connectionSeq:0,connected:!1,reconnectAttempts:0,lastErrorAt:null,reconnectDelayMs:x}),w=new Set,T={},E=[],D=[],O=!1,k=!1,A=null,j=null,M=null,ee=!1,te=typeof localStorage<`u`&&localStorage.getItem(`DEBUG_SSE`)===`1`;function ne(e,t){te&&(t?console.debug(`[ssg-sse] ${e}`,t):console.debug(`[ssg-sse] ${e}`))}function N(){ee||(ee=!0,queueMicrotask(P))}function P(){ee=!1;let e=Object.keys(T),t=E,n=D,r=O,i=A!==null||j!==null||M!==null;if(e.length===0&&t.length===0&&n.length===0&&!r&&!i)return;let a=C.counters;if(e.length>0){let t={...C.counters};for(let n of e)t[n]=(t[n]??0)+(T[n]??0);a=Object.freeze(t),T={}}let o=C.burstRing,s=C.latestBurst,c=C.burstSeq;if(t.length>0){let e=C.burstRing.length+t.length>v?[...C.burstRing,...t].slice(-v):[...C.burstRing,...t];o=Object.freeze(e),s=t[t.length-1]??s,c=C.burstSeq+t.length,E=[]}let l=C.lifecycleRing;if(n.length>0){let e=C.lifecycleRing.length+n.length>y?[...C.lifecycleRing,...n].slice(-y):[...C.lifecycleRing,...n];l=Object.freeze(e),D=[]}let u=C.connected,d=C.connectionSeq;r&&(u=k,d=C.connectionSeq+1,O=!1);let f=C.reconnectAttempts,p=C.lastErrorAt,m=C.reconnectDelayMs;A!==null&&(f=A,A=null),j!==null&&(p=j,j=null),M!==null&&(m=M,M=null),C=Object.freeze({counters:a,latestBurst:s,burstRing:o,burstSeq:c,lifecycleRing:l,connectionSeq:d,connected:u,reconnectAttempts:f,lastErrorAt:p,reconnectDelayMs:m});for(let e of w)e()}var re=null,ie=0,ae=new Set,F=new Map,I=null,L=x,oe=null;function se(e,t){if(e===`eval-burst`){try{let e=JSON.parse(t.data);Array.isArray(e?.bursts)&&(E.push(...e.bursts),N())}catch{}return}if(e===`session-lifecycle`){try{let e=JSON.parse(t.data);Array.isArray(e?.events)&&e.events.length>0&&(D.push(...e.events),N())}catch{}return}T[e]=(T[e]??0)+1,N()}function ce(e){if(!re||F.has(e))return;let t=t=>se(e,t);re.addEventListener(e,t),F.set(e,t)}var le=0,ue=0,de=2e3;function fe(){if(re)return;ne(`opening EventSource`,{url:`/api/events`}),ue=Date.now();let e=new EventSource(`/api/events`);re=e,F.clear();for(let e of ae)ce(e);e.onopen=()=>{let e=C.lastErrorAt!==null;L=x,le=0,A=0,M=x,O=!0,k=!0,N(),e&&Ce(`reconnect`),ne(`connected`)},e.onerror=()=>{e.close(),re=null,F.clear(),O=!0,k=!1,j=Date.now(),N(),le===0&&Date.now()-ue<de?ne(`first-open interrupted (page-load race) — reconnect in ${L}ms`):console.warn(`[ssg-sse] EventSource error — reconnect in ${L}ms (attempt ${le+1})`),ie>0&&(I=setTimeout(()=>{I=null,ie>0&&fe()},L),le++,A=le,L=Math.min(L*2,S),M=L,N())}}function pe(){I&&=(clearTimeout(I),null),re?.close(),re=null,F.clear(),L=x,le=0,A=0,M=x,O=!0,k=!1,N()}typeof document<`u`&&document.addEventListener(`visibilitychange`,()=>{document.visibilityState===`visible`&&ie!==0&&(re||(I&&=(clearTimeout(I),null),ne(`visibilitychange → reconnecting`),fe()))});function me(){for(let e of ae)e!==`eval-burst`&&(T[e]=(T[e]??0)+1);N()}function he(e){return w.add(e),()=>{w.delete(e)}}function ge(){return C}var _e=2e3,ve=1e4,ye=1440*60*1e3,be=500,xe=0,Se=null;function Ce(e){let t=Date.now();if(t-xe<ve){ne(`hydrate skipped (cooldown)`,{reason:e});return}if(Se)return;let n=t-ye,r=C.burstRing[C.burstRing.length-1],i=C.burstRing.length>0&&r!==void 0?r.ts_ms+1:n,a=e===`reconnect`?Math.max(i,n):n,o=t;if(a>=o)return;xe=t;let s=new AbortController;Se=s,ne(`hydrate start`,{reason:e,since:a,until:o,ringLen:C.burstRing.length}),(async()=>{let t=a,n=0;try{for(;n<_e&&t<o&&!s.signal.aborted;){let r=Math.min(be,_e-n),i=await fetch(`/api/json/graph/backfill?since_ms=${t}&until_ms=${o}&limit=${r}`,{signal:s.signal,credentials:`same-origin`});if(!i.ok)break;let a=await i.json();if(!Array.isArray(a.bursts)||a.bursts.length===0||(E.push(...a.bursts),N(),n+=a.bursts.length,ne(`hydrate page`,{reason:e,page:n,count:a.bursts.length}),a.bursts.length<r))break;let c=a.bursts[a.bursts.length-1];if(c===void 0)break;t=c.ts_ms+1}ne(`hydrate done`,{reason:e,fetched:n})}catch(t){t.name!==`AbortError`&&console.warn(`[ssg-sse] ring hydration failed (${e})`,t)}finally{Se=null}})()}function we(e){for(let t of e)ae.add(t),ce(t);return ie++,ie===1&&(Ce(`initial`),fe(),oe=setInterval(me,b)),()=>{ie--,ie===0&&(pe(),oe&&=(clearInterval(oe),null))}}var Te=Object.freeze([`eval-burst`,`counters-updated`]);function Ee(){(0,_.useEffect)(()=>we(Te),[])}function De(){return Ee(),(0,_.useSyncExternalStore)(he,ge).latestBurst}function Oe(){return Ee(),(0,_.useSyncExternalStore)(he,ge).burstRing}function ke(){return Ee(),(0,_.useSyncExternalStore)(he,ge).burstSeq}function Ae(){let e=document.querySelector(`meta[name="ssg-csrf"]`)?.content??``;return e?{"X-SigmaShake-Token":e}:{}}function je(e){let t=(0,_.useSyncExternalStore)(he,ge),n=e.join(`,`);(0,_.useEffect)(()=>we(e),[n]);let r=(0,_.useRef)({});return(0,_.useMemo)(()=>{let n={},i=!1;for(let a of e){let e=t.counters[a]??0;n[a]=e,r.current[a]!==e&&(i=!0)}return!i&&Object.keys(r.current).length===e.length?r.current:(r.current=n,n)},[t,n])}function R(e,t=[]){let[n,r]=(0,_.useState)({data:null,loading:!0,error:null}),[i,a]=(0,_.useState)(0),o=(0,_.useRef)(null),s=(0,_.useCallback)(()=>{a(e=>e+1)},[]);return(0,_.useEffect)(()=>{let t=new AbortController;return o.current=t,r(e=>({...e,loading:!0,error:null})),fetch(e,{signal:t.signal}).then(async e=>{if(!e.ok)throw Error(`HTTP ${e.status}`);return e.json()}).then(e=>{t.signal.aborted||r({data:e,loading:!1,error:null})}).catch(e=>{if(t.signal.aborted)return;let n=e instanceof Error?e.message:String(e);r(e=>({...e,loading:!1,error:n}))}),()=>{t.abort()}},[e,i,...t]),{...n,refetch:s}}var Me=e=>e,Ne=e=>({in:t=>t**+e,out:t=>1-(1-t)**e,inOut:t=>t<.5?(2*t)**e/2:1-(-2*t+2)**e/2}),Pe=Ne(2),Fe=Ne(3),Ie=Ne(4),Le=Ne(5),Re={in:e=>1-Math.cos(e*Math.PI/2),out:e=>Math.sin(e*Math.PI/2),inOut:e=>-(Math.cos(Math.PI*e)-1)/2},ze={in:e=>e===0?0:2**(10*e-10),out:e=>e===1?1:1-2**(-10*e),inOut:e=>e===0?0:e===1?1:e<.5?2**(20*e-10)/2:(2-2**(-20*e+10))/2},Be={in:e=>1-Math.sqrt(1-e**2),out:e=>Math.sqrt(1-(e-1)**2),inOut:e=>e<.5?(1-Math.sqrt(1-(2*e)**2))/2:(Math.sqrt(1-(-2*e+2)**2)+1)/2};function Ve(e=1.70158){let t=e;return e=>e*e*((t+1)*e-t)}function He(e=1.70158){let t=e;return e=>{let n=e-1;return n*n*((t+1)*n+t)+1}}function Ue(e=1.70158){let t=e*1.525;return e=>e<.5?(2*e)**2*((t+1)*2*e-t)/2:((2*e-2)**2*((t+1)*(e*2-2)+t)+2)/2}function We(e=1,t=.3){let n=Math.max(e,1),r=Math.max(t,.08),i=r/(Math.PI*2)*Math.asin(1/n);return e=>e===0?0:e===1?1:n*2**(-10*e)*Math.sin((e-i)*(Math.PI*2)/r)+1}function Ge(e=1,t=.3){let n=Math.max(e,1),r=Math.max(t,.08),i=r/(Math.PI*2)*Math.asin(1/n);return e=>e===0?0:e===1?1:-(n*2**(10*(e-1))*Math.sin((e-1-i)*(Math.PI*2)/r))}function Ke(e=1,t=.45){let n=Math.max(e,1),r=Math.max(t,.08),i=r/(Math.PI*2)*Math.asin(1/n);return e=>{if(e===0)return 0;if(e===1)return 1;let t=e*2;return t<1?-.5*(n*2**(10*(t-1))*Math.sin((t-1-i)*(Math.PI*2)/r)):n*2**(-10*(t-1))*Math.sin((t-1-i)*(Math.PI*2)/r)*.5+1}}var qe=7.5625,Je=2.75,Ye=e=>{if(e<1/Je)return qe*e*e;if(e<2/Je){let t=e-1.5/Je;return qe*t*t+.75}if(e<2.5/Je){let t=e-2.25/Je;return qe*t*t+.9375}let t=e-2.625/Je;return qe*t*t+.984375},Xe=e=>1-Ye(1-e),Ze=e=>e<.5?(1-Ye(1-2*e))/2:(1+Ye(2*e-1))/2;function Qe(e){let t=Math.max(1,Math.floor(e));return e=>e>=1?1:e<=0?0:Math.floor(e*t)/t}function $e(e,t,n,r){let i=3*e,a=3*(n-e)-i,o=1-i-a,s=3*t,c=3*(r-t)-s,l=1-s-c,u=e=>((o*e+a)*e+i)*e,d=e=>((l*e+c)*e+s)*e,f=e=>(3*o*e+2*a)*e+i,p=e=>{let t=e;for(let n=0;n<8;n++){let n=u(t)-e;if(Math.abs(n)<1e-5)return t;let r=f(t);if(Math.abs(r)<1e-6)break;t-=n/r}let n=0,r=1;for(t=e;n<r;){let i=u(t);if(Math.abs(i-e)<1e-5)return t;e>i?n=t:r=t,t=(n+r)/2}return t};return e=>e<=0?0:e>=1?1:d(p(e))}function et(e={}){let t=Math.max(1,e.stiffness??100),n=Math.max(0,e.damping??10),r=Math.max(.01,e.mass??1),i=e.velocity??0,a=Math.sqrt(t/r),o=n/(2*Math.sqrt(t*r)),s;if(o<1){let e=a*Math.sqrt(1-o*o),t=(o*a+-i)/e;s=n=>1-Math.exp(-o*a*n)*(1*Math.cos(e*n)+t*Math.sin(e*n))}else if(o===1){let e=a+-i;s=t=>1-Math.exp(-a*t)*(1+e*t)}else{let e=Math.sqrt(o*o-1),t=-a*(o-e),n=-a*(o+e),r=(n- -i)/(n-t),c=1-r;s=e=>1-(r*Math.exp(t*e)+c*Math.exp(n*e))}let c=400;for(let e=16;e<=4e3;e+=16){let t=s(e/1e3);if(Math.abs(1-t)<.005){let t=s((e-16)/1e3);if(Math.abs(1-t)<.005){c=e;break}}c=e}let l=c/1e3;return{duration:c,fn:e=>s(Math.max(0,Math.min(1,e))*l)}}var tt={linear:Me,inQuad:Pe.in,outQuad:Pe.out,inOutQuad:Pe.inOut,inCubic:Fe.in,outCubic:Fe.out,inOutCubic:Fe.inOut,inQuart:Ie.in,outQuart:Ie.out,inOutQuart:Ie.inOut,inQuint:Le.in,outQuint:Le.out,inOutQuint:Le.inOut,inSine:Re.in,outSine:Re.out,inOutSine:Re.inOut,inExpo:ze.in,outExpo:ze.out,inOutExpo:ze.inOut,inCirc:Be.in,outCirc:Be.out,inOutCirc:Be.inOut,inBack:Ve(),outBack:He(),inOutBack:Ue(),inElastic:Ge(),outElastic:We(),inOutElastic:Ke(),inBounce:Xe,outBounce:Ye,inOutBounce:Ze};function nt(e){if(typeof e==`function`)return e;if(e===void 0)return tt.outCubic;let t=tt[e];if(t)return t;let n=e.match(/^(\w+)\(([^)]*)\)$/);if(n){let e=n[1],t=n[2].split(`,`).map(e=>parseFloat(e.trim())).filter(e=>!Number.isNaN(e));switch(e){case`outElastic`:return We(t[0],t[1]);case`inElastic`:return Ge(t[0],t[1]);case`inOutElastic`:return Ke(t[0],t[1]);case`outBack`:return He(t[0]);case`inBack`:return Ve(t[0]);case`inOutBack`:return Ue(t[0]);case`steps`:return Qe(t[0]??4);case`cubicBezier`:return t.length>=4?$e(t[0],t[1],t[2],t[3]):tt.outCubic;default:return tt.outCubic}}return tt.outCubic}function rt(e,t){if(t<=1||e===void 0||e===`first`)return 0;if(e===`last`)return t-1;if(e===`center`)return(t-1)/2;let n=Math.floor(e);return n<0?0:n>t-1?t-1:n}function it(e,t={}){let n=t.start??0,r=t.direction===`reverse`;return(i,a)=>{if(a<=0)return n;let o=rt(t.from,a),s=Math.abs(i-o),c=Math.max(o,a-1-o),l=c===0?0:s/c,u=r?1-l:l,d;if(Array.isArray(e)){let[t,n]=e;d=t+u*(n-t)}else d=(r?c-s:s)*e;return n+d}}var at=new Set,ot=0;function st(){ot===0&&(typeof requestAnimationFrame>`u`||(ot=requestAnimationFrame(ct)))}function ct(e){for(let t of at){let n=t.state;if(!(!n.playing||n.completed)){if(n.lastFrame<0?n.deltaTime=0:n.deltaTime=Math.max(0,e-n.lastFrame),n.lastFrame=e,n.currentTime=Math.max(0,e-n.playStartAt),n.duration>0)for(;n.currentTime>=n.duration;){let e=n.loop===!0?1/0:typeof n.loop==`number`?Math.max(1,n.loop):1;if(n.iterationCount+1>=e){n.currentTime=n.duration,n.completed=!0,n.playing=!1,n.onUpdate?.(t.self),n.onComplete?.(t.self);break}n.currentTime-=n.duration,n.playStartAt+=n.duration,n.iterationCount+=1,n.onLoop?.(t.self)}n.completed||n.onUpdate?.(t.self)}}for(let e of[...at])e.state.completed&&at.delete(e);if(at.size===0){ot=0;return}ot=requestAnimationFrame(ct)}function lt(e={}){let t={duration:e.duration??0,loop:e.loop??!1,onUpdate:e.onUpdate,onComplete:e.onComplete,onLoop:e.onLoop,currentTime:0,deltaTime:0,iterationCount:0,completed:!1,playing:!1,lastFrame:-1,playStartAt:-1},n={play(){if(!(t.completed||t.playing)){if(pt()){t.playing=!0,t.lastFrame=-1,t.onUpdate?.(n),t.duration>0&&t.loop===!1?(t.currentTime=t.duration,t.completed=!0,t.playing=!1,t.onUpdate?.(n),t.onComplete?.(n)):t.playing=!1;return}t.playing=!0,t.playStartAt=(typeof performance<`u`?performance.now():Date.now())-t.currentTime,t.lastFrame=-1,at.add({state:t,self:n}),st()}},pause(){t.playing&&(t.playing=!1,t.lastFrame=-1)},cancel(){t.playing=!1,t.completed=!0,t.lastFrame=-1;for(let e of at)if(e.state===t){at.delete(e);break}},seek(e){if(t.completed)return;let n=t.duration>0?Math.max(0,Math.min(t.duration,e)):Math.max(0,e);t.currentTime=n,t.playStartAt=(typeof performance<`u`?performance.now():Date.now())-n,t.lastFrame=-1},get currentTime(){return t.currentTime},get deltaTime(){return t.deltaTime},get iterationCount(){return t.iterationCount},get progress(){return t.duration>0?Math.max(0,Math.min(1,t.currentTime/t.duration)):NaN},get completed(){return t.completed},get playing(){return t.playing}};return e.autoplay!==!1&&n.play(),n}var ut=new Set([`duration`,`delay`,`ease`,`loop`,`alternate`,`onBegin`,`onUpdate`,`onComplete`]);function dt(e){if(typeof e==`number`||typeof e==`string`)return e;if(Array.isArray(e)&&e.length===2){let[t,n]=e;if((typeof t==`number`||typeof t==`string`)&&(typeof n==`number`||typeof n==`string`))return[t,n]}return null}function ft(e){return e?typeof e==`string`?typeof document>`u`?[]:Array.from(document.querySelectorAll(e)):e instanceof Element?[e]:`length`in e?Array.from(e):[]:[]}function pt(){return typeof window>`u`||!window.matchMedia?!1:window.matchMedia(`(prefers-reduced-motion: reduce)`).matches}var mt=/^(-?\d*\.?\d+)([a-z%]*)$/i;function ht(e){if(typeof e==`number`)return{value:e,unit:``};let t=e.trim().match(mt);return t?{value:parseFloat(t[1]),unit:t[2]??``}:{value:0,unit:``}}function gt(e){return e.unit===``?`${e.value}`:`${e.value}${e.unit}`}var _t=new Set([`translate`,`translateX`,`translateY`,`translateZ`,`scale`,`scaleX`,`scaleY`,`scaleZ`,`rotate`,`rotateX`,`rotateY`,`rotateZ`,`skew`,`skewX`,`skewY`]),vt=new WeakMap;function yt(e){let t=vt.get(e);return t||(t={values:{}},vt.set(e,t)),t}function bt(e){let t=[];for(let[n,r]of Object.entries(e.values)){let e=r.unit||(n.startsWith(`rotate`)||n.startsWith(`skew`)?`deg`:n.startsWith(`translate`)?`px`:``);t.push(`${n}(${r.value}${e})`)}return t.join(` `)}function xt(e,t,n){if(_t.has(t)){let r=yt(e);r.values[t]=n,e.style.transform=bt(r);return}if(t===`opacity`){e.style.opacity=`${n.value}`;return}e.style.setProperty(t,gt(n))}function St(e,t){return _t.has(t)?yt(e).values[t]||{value:t.startsWith(`scale`)?1:0,unit:``}:ht(e.style.getPropertyValue(t)||(typeof window<`u`?window.getComputedStyle(e).getPropertyValue(t):``)||(t===`opacity`?`1`:`0`))}function Ct(e,t,n){return e+(t-e)*n}function wt(e,t,n){return e===void 0?0:typeof e==`number`?e:e(t,n)}function Tt(e){if(e&&typeof e==`object`&&`spring`in e){let t=et(e.spring);return{ease:t.fn,duration:t.duration}}return{ease:nt(e),duration:null}}var Et=0,Dt=new Set;function Ot(e){for(let t of Dt){if(t.done||e<t.start)continue;let{target:n,options:r}=t,i=e-t.start,a=Math.max(1,n.duration),o=r.loop??!1,s=r.alternate===!0,c=o===!0?1/0:typeof o==`number`?Math.max(1,o):1,l=Math.floor(i/a),u=(i-l*a)/a,d=s&&l%2==1?1-u:u;if(l>=c){for(let e of n.props)xt(n.el,e.name,kt(e.from,e.to,s&&c%2==0?0:1));r.onUpdate?.(1,n.el,n.index),r.onComplete?.(n.el,n.index),t.done=!0;continue}for(let e of n.props){let t=e.ease(Math.max(0,Math.min(1,d)));n.el!==null&&xt(n.el,e.name,kt(e.from,e.to,t))}n.el!==null&&r.onUpdate?.(d,n.el,n.index)}for(let e of[...Dt])e.done&&Dt.delete(e);if(Dt.size===0){Et=0;return}Et=requestAnimationFrame(Ot)}function kt(e,t,n){let r=e.unit||t.unit;return{value:Ct(e.value,t.value,n),unit:r}}function At(){Et===0&&(typeof requestAnimationFrame>`u`||(Et=requestAnimationFrame(Ot)))}function jt(e,t){let n=ft(e),r=n.length,i=Object.keys(t).filter(e=>!ut.has(e)),a=pt(),{ease:o,duration:s}=Tt(t.ease),c=t.duration??s??400,l=[],u=[],d=typeof performance<`u`?performance.now():Date.now(),f=(e,n)=>{let a=[];for(let n of i){let r=t[n];if(r===void 0)continue;let i=dt(r);if(i===null)continue;let s,c;Array.isArray(i)?(s=ht(i[0]),c=ht(i[1])):(s=St(e,n),c=ht(i)),a.push({name:n,from:s,to:c,ease:o})}return{el:e,index:n,props:a,duration:c,delay:wt(t.delay,n,r)}};if(n.length===0)return{cancel:()=>{},finished:Promise.resolve(),get done(){return!0}};let p=!1;for(let e=0;e<n.length;e++){let r=n[e],i=f(r,e),o=d+i.delay;if(t.onBegin?.(r,e),a){for(let e of i.props)xt(r,e.name,e.to);t.onUpdate?.(1,r,e),t.onComplete?.(r,e),u.push(Promise.resolve());continue}for(let e of i.props)xt(r,e.name,e.from);let s={target:i,start:o,options:t,done:!1};l.push(s),Dt.add(s),u.push(new Promise(e=>{let n=t.onComplete,r=(t,r)=>{try{n?.(t,r)}finally{e()}};s.options={...t,onComplete:r}}))}return At(),{cancel(){if(!p){p=!0;for(let e of l)e.done=!0,Dt.delete(e)}},finished:Promise.all(u).then(()=>void 0),get done(){return p||l.every(e=>e.done)}}}function Mt(e={}){let t=(0,_.useRef)(null),n=(0,_.useRef)(!1),r=(0,_.useCallback)(()=>{if(n.current)return;let r=t.current;if(!r)return;let i=r.querySelectorAll(`[data-reveal]`);if(i.length===0)return;if(n.current=!0,pt()){i.forEach(e=>{e.style.opacity=`1`,e.style.transform=``});return}let a=e.staggerMs??40,o=e.maxStaggerMs??320,s=Math.min(a,Math.max(10,o/i.length)),c=e.translateY??14,l=e.durationMs??520,u=e.from??`center`;i.forEach(e=>{e.style.opacity=`0`,e.style.transform=`translateY(${c}px)`,e.style.willChange=`transform, opacity`}),jt(Array.from(i),{opacity:[0,1],translateY:[c,0],duration:l,ease:`outBack(1.2)`,delay:it(s,{from:u}),onComplete:e=>{e.style.willChange=``}})},[e.staggerMs,e.maxStaggerMs,e.durationMs,e.translateY,e.from]);return(0,_.useEffect)(()=>{let n=t.current;if(!n)return;if(typeof IntersectionObserver>`u`){r();return}let i=!1,a=new IntersectionObserver(e=>{for(let t of e)if(t.isIntersecting&&!i){r(),a.disconnect();return}},{threshold:.08});a.observe(n);let o=n.querySelectorAll(`[data-reveal]`);if(!pt()){let t=e.translateY??14;o.forEach(e=>{e.style.opacity=`0`,e.style.transform=`translateY(${t}px)`})}let s=n.getBoundingClientRect();return s.top<(window.innerHeight||document.documentElement.clientHeight)&&s.bottom>0&&(r(),a.disconnect()),()=>{i=!0,a.disconnect()}},[r,e.translateY]),t}function Nt(e){var t,n,r=``;if(typeof e==`string`||typeof e==`number`)r+=e;else if(typeof e==`object`)if(Array.isArray(e)){var i=e.length;for(t=0;t<i;t++)e[t]&&(n=Nt(e[t]))&&(r&&(r+=` `),r+=n)}else for(n in e)e[n]&&(r&&(r+=` `),r+=n);return r}function Pt(){for(var e,t,n=0,r=``,i=arguments.length;n<i;n++)(e=arguments[n])&&(t=Nt(e))&&(r&&(r+=` `),r+=t);return r}var Ft=e=>typeof e==`boolean`?`${e}`:e===0?`0`:e,It=Pt,Lt=(e,t)=>n=>{if(t?.variants==null)return It(e,n?.class,n?.className);let{variants:r,defaultVariants:i}=t,a=Object.keys(r).map(e=>{let t=n?.[e],a=i?.[e];if(t===null)return null;let o=Ft(t)||Ft(a);return r[e][o]}),o=n&&Object.entries(n).reduce((e,t)=>{let[n,r]=t;return r===void 0||(e[n]=r),e},{});return It(e,a,t?.compoundVariants?.reduce((e,t)=>{let{class:n,className:r,...a}=t;return Object.entries(a).every(e=>{let[t,n]=e;return Array.isArray(n)?n.includes({...i,...o}[t]):{...i,...o}[t]===n})?[...e,n,r]:e},[]),n?.class,n?.className)},Rt=(e,t)=>{let n=Array(e.length+t.length);for(let t=0;t<e.length;t++)n[t]=e[t];for(let r=0;r<t.length;r++)n[e.length+r]=t[r];return n},zt=(e,t)=>({classGroupId:e,validator:t}),Bt=(e=new Map,t=null,n)=>({nextPart:e,validators:t,classGroupId:n}),Vt=`-`,Ht=[],Ut=`arbitrary..`,Wt=e=>{let t=qt(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:e=>{if(e.startsWith(`[`)&&e.endsWith(`]`))return Kt(e);let n=e.split(Vt);return Gt(n,n[0]===``&&n.length>1?1:0,t)},getConflictingClassGroupIds:(e,t)=>{if(t){let t=r[e],i=n[e];return t?i?Rt(i,t):t:i||Ht}return n[e]||Ht}}},Gt=(e,t,n)=>{if(e.length-t===0)return n.classGroupId;let r=e[t],i=n.nextPart.get(r);if(i){let n=Gt(e,t+1,i);if(n)return n}let a=n.validators;if(a===null)return;let o=t===0?e.join(Vt):e.slice(t).join(Vt),s=a.length;for(let e=0;e<s;e++){let t=a[e];if(t.validator(o))return t.classGroupId}},Kt=e=>e.slice(1,-1).indexOf(`:`)===-1?void 0:(()=>{let t=e.slice(1,-1),n=t.indexOf(`:`),r=t.slice(0,n);return r?Ut+r:void 0})(),qt=e=>{let{theme:t,classGroups:n}=e;return Jt(n,t)},Jt=(e,t)=>{let n=Bt();for(let r in e){let i=e[r];Yt(i,n,r,t)}return n},Yt=(e,t,n,r)=>{let i=e.length;for(let a=0;a<i;a++){let i=e[a];Xt(i,t,n,r)}},Xt=(e,t,n,r)=>{if(typeof e==`string`){Zt(e,t,n);return}if(typeof e==`function`){Qt(e,t,n,r);return}$t(e,t,n,r)},Zt=(e,t,n)=>{let r=e===``?t:en(t,e);r.classGroupId=n},Qt=(e,t,n,r)=>{if(tn(e)){Yt(e(r),t,n,r);return}t.validators===null&&(t.validators=[]),t.validators.push(zt(n,e))},$t=(e,t,n,r)=>{let i=Object.entries(e),a=i.length;for(let e=0;e<a;e++){let[a,o]=i[e];Yt(o,en(t,a),n,r)}},en=(e,t)=>{let n=e,r=t.split(Vt),i=r.length;for(let e=0;e<i;e++){let t=r[e],i=n.nextPart.get(t);i||(i=Bt(),n.nextPart.set(t,i)),n=i}return n},tn=e=>`isThemeGetter`in e&&e.isThemeGetter===!0,nn=e=>{if(e<1)return{get:()=>void 0,set:()=>{}};let t=0,n=Object.create(null),r=Object.create(null),i=(i,a)=>{n[i]=a,t++,t>e&&(t=0,r=n,n=Object.create(null))};return{get(e){let t=n[e];if(t!==void 0)return t;if((t=r[e])!==void 0)return i(e,t),t},set(e,t){e in n?n[e]=t:i(e,t)}}},rn=`!`,an=`:`,on=[],sn=(e,t,n,r,i)=>({modifiers:e,hasImportantModifier:t,baseClassName:n,maybePostfixModifierPosition:r,isExternal:i}),cn=e=>{let{prefix:t,experimentalParseClassName:n}=e,r=e=>{let t=[],n=0,r=0,i=0,a,o=e.length;for(let s=0;s<o;s++){let o=e[s];if(n===0&&r===0){if(o===an){t.push(e.slice(i,s)),i=s+1;continue}if(o===`/`){a=s;continue}}o===`[`?n++:o===`]`?n--:o===`(`?r++:o===`)`&&r--}let s=t.length===0?e:e.slice(i),c=s,l=!1;s.endsWith(rn)?(c=s.slice(0,-1),l=!0):s.startsWith(rn)&&(c=s.slice(1),l=!0);let u=a&&a>i?a-i:void 0;return sn(t,l,c,u)};if(t){let e=t+an,n=r;r=t=>t.startsWith(e)?n(t.slice(e.length)):sn(on,!1,t,void 0,!0)}if(n){let e=r;r=t=>n({className:t,parseClassName:e})}return r},ln=e=>{let t=new Map;return e.orderSensitiveModifiers.forEach((e,n)=>{t.set(e,1e6+n)}),e=>{let n=[],r=[];for(let i=0;i<e.length;i++){let a=e[i],o=a[0]===`[`,s=t.has(a);o||s?(r.length>0&&(r.sort(),n.push(...r),r=[]),n.push(a)):r.push(a)}return r.length>0&&(r.sort(),n.push(...r)),n}},un=e=>({cache:nn(e.cacheSize),parseClassName:cn(e),sortModifiers:ln(e),...Wt(e)}),dn=/\s+/,fn=(e,t)=>{let{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:i,sortModifiers:a}=t,o=[],s=e.trim().split(dn),c=``;for(let e=s.length-1;e>=0;--e){let t=s[e],{isExternal:l,modifiers:u,hasImportantModifier:d,baseClassName:f,maybePostfixModifierPosition:p}=n(t);if(l){c=t+(c.length>0?` `+c:c);continue}let m=!!p,h=r(m?f.substring(0,p):f);if(!h){if(!m){c=t+(c.length>0?` `+c:c);continue}if(h=r(f),!h){c=t+(c.length>0?` `+c:c);continue}m=!1}let g=u.length===0?``:u.length===1?u[0]:a(u).join(`:`),_=d?g+rn:g,v=_+h;if(o.indexOf(v)>-1)continue;o.push(v);let y=i(h,m);for(let e=0;e<y.length;++e){let t=y[e];o.push(_+t)}c=t+(c.length>0?` `+c:c)}return c},pn=(...e)=>{let t=0,n,r,i=``;for(;t<e.length;)(n=e[t++])&&(r=mn(n))&&(i&&(i+=` `),i+=r);return i},mn=e=>{if(typeof e==`string`)return e;let t,n=``;for(let r=0;r<e.length;r++)e[r]&&(t=mn(e[r]))&&(n&&(n+=` `),n+=t);return n},hn=(e,...t)=>{let n,r,i,a,o=o=>(n=un(t.reduce((e,t)=>t(e),e())),r=n.cache.get,i=n.cache.set,a=s,s(o)),s=e=>{let t=r(e);if(t)return t;let a=fn(e,n);return i(e,a),a};return a=o,(...e)=>a(pn(...e))},gn=[],_n=e=>{let t=t=>t[e]||gn;return t.isThemeGetter=!0,t},vn=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,yn=/^\((?:(\w[\w-]*):)?(.+)\)$/i,bn=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,xn=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,Sn=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,Cn=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,wn=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,Tn=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,En=e=>bn.test(e),z=e=>!!e&&!Number.isNaN(Number(e)),Dn=e=>!!e&&Number.isInteger(Number(e)),On=e=>e.endsWith(`%`)&&z(e.slice(0,-1)),kn=e=>xn.test(e),An=()=>!0,jn=e=>Sn.test(e)&&!Cn.test(e),Mn=()=>!1,Nn=e=>wn.test(e),Pn=e=>Tn.test(e),Fn=e=>!B(e)&&!V(e),In=e=>Zn(e,tr,Mn),B=e=>vn.test(e),Ln=e=>Zn(e,nr,jn),Rn=e=>Zn(e,rr,z),zn=e=>Zn(e,ar,An),Bn=e=>Zn(e,ir,Mn),Vn=e=>Zn(e,$n,Mn),Hn=e=>Zn(e,er,Pn),Un=e=>Zn(e,or,Nn),V=e=>yn.test(e),Wn=e=>Qn(e,nr),Gn=e=>Qn(e,ir),Kn=e=>Qn(e,$n),qn=e=>Qn(e,tr),Jn=e=>Qn(e,er),Yn=e=>Qn(e,or,!0),Xn=e=>Qn(e,ar,!0),Zn=(e,t,n)=>{let r=vn.exec(e);return r?r[1]?t(r[1]):n(r[2]):!1},Qn=(e,t,n=!1)=>{let r=yn.exec(e);return r?r[1]?t(r[1]):n:!1},$n=e=>e===`position`||e===`percentage`,er=e=>e===`image`||e===`url`,tr=e=>e===`length`||e===`size`||e===`bg-size`,nr=e=>e===`length`,rr=e=>e===`number`,ir=e=>e===`family-name`,ar=e=>e===`number`||e===`weight`,or=e=>e===`shadow`,sr=hn(()=>{let e=_n(`color`),t=_n(`font`),n=_n(`text`),r=_n(`font-weight`),i=_n(`tracking`),a=_n(`leading`),o=_n(`breakpoint`),s=_n(`container`),c=_n(`spacing`),l=_n(`radius`),u=_n(`shadow`),d=_n(`inset-shadow`),f=_n(`text-shadow`),p=_n(`drop-shadow`),m=_n(`blur`),h=_n(`perspective`),g=_n(`aspect`),_=_n(`ease`),v=_n(`animate`),y=()=>[`auto`,`avoid`,`all`,`avoid-page`,`page`,`left`,`right`,`column`],b=()=>[`center`,`top`,`bottom`,`left`,`right`,`top-left`,`left-top`,`top-right`,`right-top`,`bottom-right`,`right-bottom`,`bottom-left`,`left-bottom`],x=()=>[...b(),V,B],S=()=>[`auto`,`hidden`,`clip`,`visible`,`scroll`],C=()=>[`auto`,`contain`,`none`],w=()=>[V,B,c],T=()=>[En,`full`,`auto`,...w()],E=()=>[Dn,`none`,`subgrid`,V,B],D=()=>[`auto`,{span:[`full`,Dn,V,B]},Dn,V,B],O=()=>[Dn,`auto`,V,B],k=()=>[`auto`,`min`,`max`,`fr`,V,B],A=()=>[`start`,`end`,`center`,`between`,`around`,`evenly`,`stretch`,`baseline`,`center-safe`,`end-safe`],j=()=>[`start`,`end`,`center`,`stretch`,`center-safe`,`end-safe`],M=()=>[`auto`,...w()],ee=()=>[En,`auto`,`full`,`dvw`,`dvh`,`lvw`,`lvh`,`svw`,`svh`,`min`,`max`,`fit`,...w()],te=()=>[En,`screen`,`full`,`dvw`,`lvw`,`svw`,`min`,`max`,`fit`,...w()],ne=()=>[En,`screen`,`full`,`lh`,`dvh`,`lvh`,`svh`,`min`,`max`,`fit`,...w()],N=()=>[e,V,B],P=()=>[...b(),Kn,Vn,{position:[V,B]}],re=()=>[`no-repeat`,{repeat:[``,`x`,`y`,`space`,`round`]}],ie=()=>[`auto`,`cover`,`contain`,qn,In,{size:[V,B]}],ae=()=>[On,Wn,Ln],F=()=>[``,`none`,`full`,l,V,B],I=()=>[``,z,Wn,Ln],L=()=>[`solid`,`dashed`,`dotted`,`double`],oe=()=>[`normal`,`multiply`,`screen`,`overlay`,`darken`,`lighten`,`color-dodge`,`color-burn`,`hard-light`,`soft-light`,`difference`,`exclusion`,`hue`,`saturation`,`color`,`luminosity`],se=()=>[z,On,Kn,Vn],ce=()=>[``,`none`,m,V,B],le=()=>[`none`,z,V,B],ue=()=>[`none`,z,V,B],de=()=>[z,V,B],fe=()=>[En,`full`,...w()];return{cacheSize:500,theme:{animate:[`spin`,`ping`,`pulse`,`bounce`],aspect:[`video`],blur:[kn],breakpoint:[kn],color:[An],container:[kn],"drop-shadow":[kn],ease:[`in`,`out`,`in-out`],font:[Fn],"font-weight":[`thin`,`extralight`,`light`,`normal`,`medium`,`semibold`,`bold`,`extrabold`,`black`],"inset-shadow":[kn],leading:[`none`,`tight`,`snug`,`normal`,`relaxed`,`loose`],perspective:[`dramatic`,`near`,`normal`,`midrange`,`distant`,`none`],radius:[kn],shadow:[kn],spacing:[`px`,z],text:[kn],"text-shadow":[kn],tracking:[`tighter`,`tight`,`normal`,`wide`,`wider`,`widest`]},classGroups:{aspect:[{aspect:[`auto`,`square`,En,B,V,g]}],container:[`container`],columns:[{columns:[z,B,V,s]}],"break-after":[{"break-after":y()}],"break-before":[{"break-before":y()}],"break-inside":[{"break-inside":[`auto`,`avoid`,`avoid-page`,`avoid-column`]}],"box-decoration":[{"box-decoration":[`slice`,`clone`]}],box:[{box:[`border`,`content`]}],display:[`block`,`inline-block`,`inline`,`flex`,`inline-flex`,`table`,`inline-table`,`table-caption`,`table-cell`,`table-column`,`table-column-group`,`table-footer-group`,`table-header-group`,`table-row-group`,`table-row`,`flow-root`,`grid`,`inline-grid`,`contents`,`list-item`,`hidden`],sr:[`sr-only`,`not-sr-only`],float:[{float:[`right`,`left`,`none`,`start`,`end`]}],clear:[{clear:[`left`,`right`,`both`,`none`,`start`,`end`]}],isolation:[`isolate`,`isolation-auto`],"object-fit":[{object:[`contain`,`cover`,`fill`,`none`,`scale-down`]}],"object-position":[{object:x()}],overflow:[{overflow:S()}],"overflow-x":[{"overflow-x":S()}],"overflow-y":[{"overflow-y":S()}],overscroll:[{overscroll:C()}],"overscroll-x":[{"overscroll-x":C()}],"overscroll-y":[{"overscroll-y":C()}],position:[`static`,`fixed`,`absolute`,`relative`,`sticky`],inset:[{inset:T()}],"inset-x":[{"inset-x":T()}],"inset-y":[{"inset-y":T()}],start:[{"inset-s":T(),start:T()}],end:[{"inset-e":T(),end:T()}],"inset-bs":[{"inset-bs":T()}],"inset-be":[{"inset-be":T()}],top:[{top:T()}],right:[{right:T()}],bottom:[{bottom:T()}],left:[{left:T()}],visibility:[`visible`,`invisible`,`collapse`],z:[{z:[Dn,`auto`,V,B]}],basis:[{basis:[En,`full`,`auto`,s,...w()]}],"flex-direction":[{flex:[`row`,`row-reverse`,`col`,`col-reverse`]}],"flex-wrap":[{flex:[`nowrap`,`wrap`,`wrap-reverse`]}],flex:[{flex:[z,En,`auto`,`initial`,`none`,B]}],grow:[{grow:[``,z,V,B]}],shrink:[{shrink:[``,z,V,B]}],order:[{order:[Dn,`first`,`last`,`none`,V,B]}],"grid-cols":[{"grid-cols":E()}],"col-start-end":[{col:D()}],"col-start":[{"col-start":O()}],"col-end":[{"col-end":O()}],"grid-rows":[{"grid-rows":E()}],"row-start-end":[{row:D()}],"row-start":[{"row-start":O()}],"row-end":[{"row-end":O()}],"grid-flow":[{"grid-flow":[`row`,`col`,`dense`,`row-dense`,`col-dense`]}],"auto-cols":[{"auto-cols":k()}],"auto-rows":[{"auto-rows":k()}],gap:[{gap:w()}],"gap-x":[{"gap-x":w()}],"gap-y":[{"gap-y":w()}],"justify-content":[{justify:[...A(),`normal`]}],"justify-items":[{"justify-items":[...j(),`normal`]}],"justify-self":[{"justify-self":[`auto`,...j()]}],"align-content":[{content:[`normal`,...A()]}],"align-items":[{items:[...j(),{baseline:[``,`last`]}]}],"align-self":[{self:[`auto`,...j(),{baseline:[``,`last`]}]}],"place-content":[{"place-content":A()}],"place-items":[{"place-items":[...j(),`baseline`]}],"place-self":[{"place-self":[`auto`,...j()]}],p:[{p:w()}],px:[{px:w()}],py:[{py:w()}],ps:[{ps:w()}],pe:[{pe:w()}],pbs:[{pbs:w()}],pbe:[{pbe:w()}],pt:[{pt:w()}],pr:[{pr:w()}],pb:[{pb:w()}],pl:[{pl:w()}],m:[{m:M()}],mx:[{mx:M()}],my:[{my:M()}],ms:[{ms:M()}],me:[{me:M()}],mbs:[{mbs:M()}],mbe:[{mbe:M()}],mt:[{mt:M()}],mr:[{mr:M()}],mb:[{mb:M()}],ml:[{ml:M()}],"space-x":[{"space-x":w()}],"space-x-reverse":[`space-x-reverse`],"space-y":[{"space-y":w()}],"space-y-reverse":[`space-y-reverse`],size:[{size:ee()}],"inline-size":[{inline:[`auto`,...te()]}],"min-inline-size":[{"min-inline":[`auto`,...te()]}],"max-inline-size":[{"max-inline":[`none`,...te()]}],"block-size":[{block:[`auto`,...ne()]}],"min-block-size":[{"min-block":[`auto`,...ne()]}],"max-block-size":[{"max-block":[`none`,...ne()]}],w:[{w:[s,`screen`,...ee()]}],"min-w":[{"min-w":[s,`screen`,`none`,...ee()]}],"max-w":[{"max-w":[s,`screen`,`none`,`prose`,{screen:[o]},...ee()]}],h:[{h:[`screen`,`lh`,...ee()]}],"min-h":[{"min-h":[`screen`,`lh`,`none`,...ee()]}],"max-h":[{"max-h":[`screen`,`lh`,...ee()]}],"font-size":[{text:[`base`,n,Wn,Ln]}],"font-smoothing":[`antialiased`,`subpixel-antialiased`],"font-style":[`italic`,`not-italic`],"font-weight":[{font:[r,Xn,zn]}],"font-stretch":[{"font-stretch":[`ultra-condensed`,`extra-condensed`,`condensed`,`semi-condensed`,`normal`,`semi-expanded`,`expanded`,`extra-expanded`,`ultra-expanded`,On,B]}],"font-family":[{font:[Gn,Bn,t]}],"font-features":[{"font-features":[B]}],"fvn-normal":[`normal-nums`],"fvn-ordinal":[`ordinal`],"fvn-slashed-zero":[`slashed-zero`],"fvn-figure":[`lining-nums`,`oldstyle-nums`],"fvn-spacing":[`proportional-nums`,`tabular-nums`],"fvn-fraction":[`diagonal-fractions`,`stacked-fractions`],tracking:[{tracking:[i,V,B]}],"line-clamp":[{"line-clamp":[z,`none`,V,Rn]}],leading:[{leading:[a,...w()]}],"list-image":[{"list-image":[`none`,V,B]}],"list-style-position":[{list:[`inside`,`outside`]}],"list-style-type":[{list:[`disc`,`decimal`,`none`,V,B]}],"text-alignment":[{text:[`left`,`center`,`right`,`justify`,`start`,`end`]}],"placeholder-color":[{placeholder:N()}],"text-color":[{text:N()}],"text-decoration":[`underline`,`overline`,`line-through`,`no-underline`],"text-decoration-style":[{decoration:[...L(),`wavy`]}],"text-decoration-thickness":[{decoration:[z,`from-font`,`auto`,V,Ln]}],"text-decoration-color":[{decoration:N()}],"underline-offset":[{"underline-offset":[z,`auto`,V,B]}],"text-transform":[`uppercase`,`lowercase`,`capitalize`,`normal-case`],"text-overflow":[`truncate`,`text-ellipsis`,`text-clip`],"text-wrap":[{text:[`wrap`,`nowrap`,`balance`,`pretty`]}],indent:[{indent:w()}],"vertical-align":[{align:[`baseline`,`top`,`middle`,`bottom`,`text-top`,`text-bottom`,`sub`,`super`,V,B]}],whitespace:[{whitespace:[`normal`,`nowrap`,`pre`,`pre-line`,`pre-wrap`,`break-spaces`]}],break:[{break:[`normal`,`words`,`all`,`keep`]}],wrap:[{wrap:[`break-word`,`anywhere`,`normal`]}],hyphens:[{hyphens:[`none`,`manual`,`auto`]}],content:[{content:[`none`,V,B]}],"bg-attachment":[{bg:[`fixed`,`local`,`scroll`]}],"bg-clip":[{"bg-clip":[`border`,`padding`,`content`,`text`]}],"bg-origin":[{"bg-origin":[`border`,`padding`,`content`]}],"bg-position":[{bg:P()}],"bg-repeat":[{bg:re()}],"bg-size":[{bg:ie()}],"bg-image":[{bg:[`none`,{linear:[{to:[`t`,`tr`,`r`,`br`,`b`,`bl`,`l`,`tl`]},Dn,V,B],radial:[``,V,B],conic:[Dn,V,B]},Jn,Hn]}],"bg-color":[{bg:N()}],"gradient-from-pos":[{from:ae()}],"gradient-via-pos":[{via:ae()}],"gradient-to-pos":[{to:ae()}],"gradient-from":[{from:N()}],"gradient-via":[{via:N()}],"gradient-to":[{to:N()}],rounded:[{rounded:F()}],"rounded-s":[{"rounded-s":F()}],"rounded-e":[{"rounded-e":F()}],"rounded-t":[{"rounded-t":F()}],"rounded-r":[{"rounded-r":F()}],"rounded-b":[{"rounded-b":F()}],"rounded-l":[{"rounded-l":F()}],"rounded-ss":[{"rounded-ss":F()}],"rounded-se":[{"rounded-se":F()}],"rounded-ee":[{"rounded-ee":F()}],"rounded-es":[{"rounded-es":F()}],"rounded-tl":[{"rounded-tl":F()}],"rounded-tr":[{"rounded-tr":F()}],"rounded-br":[{"rounded-br":F()}],"rounded-bl":[{"rounded-bl":F()}],"border-w":[{border:I()}],"border-w-x":[{"border-x":I()}],"border-w-y":[{"border-y":I()}],"border-w-s":[{"border-s":I()}],"border-w-e":[{"border-e":I()}],"border-w-bs":[{"border-bs":I()}],"border-w-be":[{"border-be":I()}],"border-w-t":[{"border-t":I()}],"border-w-r":[{"border-r":I()}],"border-w-b":[{"border-b":I()}],"border-w-l":[{"border-l":I()}],"divide-x":[{"divide-x":I()}],"divide-x-reverse":[`divide-x-reverse`],"divide-y":[{"divide-y":I()}],"divide-y-reverse":[`divide-y-reverse`],"border-style":[{border:[...L(),`hidden`,`none`]}],"divide-style":[{divide:[...L(),`hidden`,`none`]}],"border-color":[{border:N()}],"border-color-x":[{"border-x":N()}],"border-color-y":[{"border-y":N()}],"border-color-s":[{"border-s":N()}],"border-color-e":[{"border-e":N()}],"border-color-bs":[{"border-bs":N()}],"border-color-be":[{"border-be":N()}],"border-color-t":[{"border-t":N()}],"border-color-r":[{"border-r":N()}],"border-color-b":[{"border-b":N()}],"border-color-l":[{"border-l":N()}],"divide-color":[{divide:N()}],"outline-style":[{outline:[...L(),`none`,`hidden`]}],"outline-offset":[{"outline-offset":[z,V,B]}],"outline-w":[{outline:[``,z,Wn,Ln]}],"outline-color":[{outline:N()}],shadow:[{shadow:[``,`none`,u,Yn,Un]}],"shadow-color":[{shadow:N()}],"inset-shadow":[{"inset-shadow":[`none`,d,Yn,Un]}],"inset-shadow-color":[{"inset-shadow":N()}],"ring-w":[{ring:I()}],"ring-w-inset":[`ring-inset`],"ring-color":[{ring:N()}],"ring-offset-w":[{"ring-offset":[z,Ln]}],"ring-offset-color":[{"ring-offset":N()}],"inset-ring-w":[{"inset-ring":I()}],"inset-ring-color":[{"inset-ring":N()}],"text-shadow":[{"text-shadow":[`none`,f,Yn,Un]}],"text-shadow-color":[{"text-shadow":N()}],opacity:[{opacity:[z,V,B]}],"mix-blend":[{"mix-blend":[...oe(),`plus-darker`,`plus-lighter`]}],"bg-blend":[{"bg-blend":oe()}],"mask-clip":[{"mask-clip":[`border`,`padding`,`content`,`fill`,`stroke`,`view`]},`mask-no-clip`],"mask-composite":[{mask:[`add`,`subtract`,`intersect`,`exclude`]}],"mask-image-linear-pos":[{"mask-linear":[z]}],"mask-image-linear-from-pos":[{"mask-linear-from":se()}],"mask-image-linear-to-pos":[{"mask-linear-to":se()}],"mask-image-linear-from-color":[{"mask-linear-from":N()}],"mask-image-linear-to-color":[{"mask-linear-to":N()}],"mask-image-t-from-pos":[{"mask-t-from":se()}],"mask-image-t-to-pos":[{"mask-t-to":se()}],"mask-image-t-from-color":[{"mask-t-from":N()}],"mask-image-t-to-color":[{"mask-t-to":N()}],"mask-image-r-from-pos":[{"mask-r-from":se()}],"mask-image-r-to-pos":[{"mask-r-to":se()}],"mask-image-r-from-color":[{"mask-r-from":N()}],"mask-image-r-to-color":[{"mask-r-to":N()}],"mask-image-b-from-pos":[{"mask-b-from":se()}],"mask-image-b-to-pos":[{"mask-b-to":se()}],"mask-image-b-from-color":[{"mask-b-from":N()}],"mask-image-b-to-color":[{"mask-b-to":N()}],"mask-image-l-from-pos":[{"mask-l-from":se()}],"mask-image-l-to-pos":[{"mask-l-to":se()}],"mask-image-l-from-color":[{"mask-l-from":N()}],"mask-image-l-to-color":[{"mask-l-to":N()}],"mask-image-x-from-pos":[{"mask-x-from":se()}],"mask-image-x-to-pos":[{"mask-x-to":se()}],"mask-image-x-from-color":[{"mask-x-from":N()}],"mask-image-x-to-color":[{"mask-x-to":N()}],"mask-image-y-from-pos":[{"mask-y-from":se()}],"mask-image-y-to-pos":[{"mask-y-to":se()}],"mask-image-y-from-color":[{"mask-y-from":N()}],"mask-image-y-to-color":[{"mask-y-to":N()}],"mask-image-radial":[{"mask-radial":[V,B]}],"mask-image-radial-from-pos":[{"mask-radial-from":se()}],"mask-image-radial-to-pos":[{"mask-radial-to":se()}],"mask-image-radial-from-color":[{"mask-radial-from":N()}],"mask-image-radial-to-color":[{"mask-radial-to":N()}],"mask-image-radial-shape":[{"mask-radial":[`circle`,`ellipse`]}],"mask-image-radial-size":[{"mask-radial":[{closest:[`side`,`corner`],farthest:[`side`,`corner`]}]}],"mask-image-radial-pos":[{"mask-radial-at":b()}],"mask-image-conic-pos":[{"mask-conic":[z]}],"mask-image-conic-from-pos":[{"mask-conic-from":se()}],"mask-image-conic-to-pos":[{"mask-conic-to":se()}],"mask-image-conic-from-color":[{"mask-conic-from":N()}],"mask-image-conic-to-color":[{"mask-conic-to":N()}],"mask-mode":[{mask:[`alpha`,`luminance`,`match`]}],"mask-origin":[{"mask-origin":[`border`,`padding`,`content`,`fill`,`stroke`,`view`]}],"mask-position":[{mask:P()}],"mask-repeat":[{mask:re()}],"mask-size":[{mask:ie()}],"mask-type":[{"mask-type":[`alpha`,`luminance`]}],"mask-image":[{mask:[`none`,V,B]}],filter:[{filter:[``,`none`,V,B]}],blur:[{blur:ce()}],brightness:[{brightness:[z,V,B]}],contrast:[{contrast:[z,V,B]}],"drop-shadow":[{"drop-shadow":[``,`none`,p,Yn,Un]}],"drop-shadow-color":[{"drop-shadow":N()}],grayscale:[{grayscale:[``,z,V,B]}],"hue-rotate":[{"hue-rotate":[z,V,B]}],invert:[{invert:[``,z,V,B]}],saturate:[{saturate:[z,V,B]}],sepia:[{sepia:[``,z,V,B]}],"backdrop-filter":[{"backdrop-filter":[``,`none`,V,B]}],"backdrop-blur":[{"backdrop-blur":ce()}],"backdrop-brightness":[{"backdrop-brightness":[z,V,B]}],"backdrop-contrast":[{"backdrop-contrast":[z,V,B]}],"backdrop-grayscale":[{"backdrop-grayscale":[``,z,V,B]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[z,V,B]}],"backdrop-invert":[{"backdrop-invert":[``,z,V,B]}],"backdrop-opacity":[{"backdrop-opacity":[z,V,B]}],"backdrop-saturate":[{"backdrop-saturate":[z,V,B]}],"backdrop-sepia":[{"backdrop-sepia":[``,z,V,B]}],"border-collapse":[{border:[`collapse`,`separate`]}],"border-spacing":[{"border-spacing":w()}],"border-spacing-x":[{"border-spacing-x":w()}],"border-spacing-y":[{"border-spacing-y":w()}],"table-layout":[{table:[`auto`,`fixed`]}],caption:[{caption:[`top`,`bottom`]}],transition:[{transition:[``,`all`,`colors`,`opacity`,`shadow`,`transform`,`none`,V,B]}],"transition-behavior":[{transition:[`normal`,`discrete`]}],duration:[{duration:[z,`initial`,V,B]}],ease:[{ease:[`linear`,`initial`,_,V,B]}],delay:[{delay:[z,V,B]}],animate:[{animate:[`none`,v,V,B]}],backface:[{backface:[`hidden`,`visible`]}],perspective:[{perspective:[h,V,B]}],"perspective-origin":[{"perspective-origin":x()}],rotate:[{rotate:le()}],"rotate-x":[{"rotate-x":le()}],"rotate-y":[{"rotate-y":le()}],"rotate-z":[{"rotate-z":le()}],scale:[{scale:ue()}],"scale-x":[{"scale-x":ue()}],"scale-y":[{"scale-y":ue()}],"scale-z":[{"scale-z":ue()}],"scale-3d":[`scale-3d`],skew:[{skew:de()}],"skew-x":[{"skew-x":de()}],"skew-y":[{"skew-y":de()}],transform:[{transform:[V,B,``,`none`,`gpu`,`cpu`]}],"transform-origin":[{origin:x()}],"transform-style":[{transform:[`3d`,`flat`]}],translate:[{translate:fe()}],"translate-x":[{"translate-x":fe()}],"translate-y":[{"translate-y":fe()}],"translate-z":[{"translate-z":fe()}],"translate-none":[`translate-none`],accent:[{accent:N()}],appearance:[{appearance:[`none`,`auto`]}],"caret-color":[{caret:N()}],"color-scheme":[{scheme:[`normal`,`dark`,`light`,`light-dark`,`only-dark`,`only-light`]}],cursor:[{cursor:[`auto`,`default`,`pointer`,`wait`,`text`,`move`,`help`,`not-allowed`,`none`,`context-menu`,`progress`,`cell`,`crosshair`,`vertical-text`,`alias`,`copy`,`no-drop`,`grab`,`grabbing`,`all-scroll`,`col-resize`,`row-resize`,`n-resize`,`e-resize`,`s-resize`,`w-resize`,`ne-resize`,`nw-resize`,`se-resize`,`sw-resize`,`ew-resize`,`ns-resize`,`nesw-resize`,`nwse-resize`,`zoom-in`,`zoom-out`,V,B]}],"field-sizing":[{"field-sizing":[`fixed`,`content`]}],"pointer-events":[{"pointer-events":[`auto`,`none`]}],resize:[{resize:[`none`,``,`y`,`x`]}],"scroll-behavior":[{scroll:[`auto`,`smooth`]}],"scroll-m":[{"scroll-m":w()}],"scroll-mx":[{"scroll-mx":w()}],"scroll-my":[{"scroll-my":w()}],"scroll-ms":[{"scroll-ms":w()}],"scroll-me":[{"scroll-me":w()}],"scroll-mbs":[{"scroll-mbs":w()}],"scroll-mbe":[{"scroll-mbe":w()}],"scroll-mt":[{"scroll-mt":w()}],"scroll-mr":[{"scroll-mr":w()}],"scroll-mb":[{"scroll-mb":w()}],"scroll-ml":[{"scroll-ml":w()}],"scroll-p":[{"scroll-p":w()}],"scroll-px":[{"scroll-px":w()}],"scroll-py":[{"scroll-py":w()}],"scroll-ps":[{"scroll-ps":w()}],"scroll-pe":[{"scroll-pe":w()}],"scroll-pbs":[{"scroll-pbs":w()}],"scroll-pbe":[{"scroll-pbe":w()}],"scroll-pt":[{"scroll-pt":w()}],"scroll-pr":[{"scroll-pr":w()}],"scroll-pb":[{"scroll-pb":w()}],"scroll-pl":[{"scroll-pl":w()}],"snap-align":[{snap:[`start`,`end`,`center`,`align-none`]}],"snap-stop":[{snap:[`normal`,`always`]}],"snap-type":[{snap:[`none`,`x`,`y`,`both`]}],"snap-strictness":[{snap:[`mandatory`,`proximity`]}],touch:[{touch:[`auto`,`none`,`manipulation`]}],"touch-x":[{"touch-pan":[`x`,`left`,`right`]}],"touch-y":[{"touch-pan":[`y`,`up`,`down`]}],"touch-pz":[`touch-pinch-zoom`],select:[{select:[`none`,`text`,`all`,`auto`]}],"will-change":[{"will-change":[`auto`,`scroll`,`contents`,`transform`,V,B]}],fill:[{fill:[`none`,...N()]}],"stroke-w":[{stroke:[z,Wn,Ln,Rn]}],stroke:[{stroke:[`none`,...N()]}],"forced-color-adjust":[{"forced-color-adjust":[`auto`,`none`]}]},conflictingClassGroups:{overflow:[`overflow-x`,`overflow-y`],overscroll:[`overscroll-x`,`overscroll-y`],inset:[`inset-x`,`inset-y`,`inset-bs`,`inset-be`,`start`,`end`,`top`,`right`,`bottom`,`left`],"inset-x":[`right`,`left`],"inset-y":[`top`,`bottom`],flex:[`basis`,`grow`,`shrink`],gap:[`gap-x`,`gap-y`],p:[`px`,`py`,`ps`,`pe`,`pbs`,`pbe`,`pt`,`pr`,`pb`,`pl`],px:[`pr`,`pl`],py:[`pt`,`pb`],m:[`mx`,`my`,`ms`,`me`,`mbs`,`mbe`,`mt`,`mr`,`mb`,`ml`],mx:[`mr`,`ml`],my:[`mt`,`mb`],size:[`w`,`h`],"font-size":[`leading`],"fvn-normal":[`fvn-ordinal`,`fvn-slashed-zero`,`fvn-figure`,`fvn-spacing`,`fvn-fraction`],"fvn-ordinal":[`fvn-normal`],"fvn-slashed-zero":[`fvn-normal`],"fvn-figure":[`fvn-normal`],"fvn-spacing":[`fvn-normal`],"fvn-fraction":[`fvn-normal`],"line-clamp":[`display`,`overflow`],rounded:[`rounded-s`,`rounded-e`,`rounded-t`,`rounded-r`,`rounded-b`,`rounded-l`,`rounded-ss`,`rounded-se`,`rounded-ee`,`rounded-es`,`rounded-tl`,`rounded-tr`,`rounded-br`,`rounded-bl`],"rounded-s":[`rounded-ss`,`rounded-es`],"rounded-e":[`rounded-se`,`rounded-ee`],"rounded-t":[`rounded-tl`,`rounded-tr`],"rounded-r":[`rounded-tr`,`rounded-br`],"rounded-b":[`rounded-br`,`rounded-bl`],"rounded-l":[`rounded-tl`,`rounded-bl`],"border-spacing":[`border-spacing-x`,`border-spacing-y`],"border-w":[`border-w-x`,`border-w-y`,`border-w-s`,`border-w-e`,`border-w-bs`,`border-w-be`,`border-w-t`,`border-w-r`,`border-w-b`,`border-w-l`],"border-w-x":[`border-w-r`,`border-w-l`],"border-w-y":[`border-w-t`,`border-w-b`],"border-color":[`border-color-x`,`border-color-y`,`border-color-s`,`border-color-e`,`border-color-bs`,`border-color-be`,`border-color-t`,`border-color-r`,`border-color-b`,`border-color-l`],"border-color-x":[`border-color-r`,`border-color-l`],"border-color-y":[`border-color-t`,`border-color-b`],translate:[`translate-x`,`translate-y`,`translate-none`],"translate-none":[`translate`,`translate-x`,`translate-y`,`translate-z`],"scroll-m":[`scroll-mx`,`scroll-my`,`scroll-ms`,`scroll-me`,`scroll-mbs`,`scroll-mbe`,`scroll-mt`,`scroll-mr`,`scroll-mb`,`scroll-ml`],"scroll-mx":[`scroll-mr`,`scroll-ml`],"scroll-my":[`scroll-mt`,`scroll-mb`],"scroll-p":[`scroll-px`,`scroll-py`,`scroll-ps`,`scroll-pe`,`scroll-pbs`,`scroll-pbe`,`scroll-pt`,`scroll-pr`,`scroll-pb`,`scroll-pl`],"scroll-px":[`scroll-pr`,`scroll-pl`],"scroll-py":[`scroll-pt`,`scroll-pb`],touch:[`touch-x`,`touch-y`,`touch-pz`],"touch-x":[`touch`],"touch-y":[`touch`],"touch-pz":[`touch`]},conflictingClassGroupModifiers:{"font-size":[`leading`]},orderSensitiveModifiers:[`*`,`**`,`after`,`backdrop`,`before`,`details-content`,`file`,`first-letter`,`first-line`,`marker`,`placeholder`,`selection`]}});function H(...e){return sr(Pt(e))}function cr(e){let t=Math.max(0,Math.floor((Date.now()-e*1e3)/1e3));if(t<60)return`${t}s ago`;let n=Math.floor(t/60);if(n<60)return`${n}m ago`;let r=Math.floor(n/60);if(r<24)return`${r}h ago`;let i=Math.floor(r/24);return i<30?`${i}d ago`:`${Math.floor(i/30)}mo ago`}function lr(e){return new Date(e*1e3).toLocaleString(void 0,{year:`numeric`,month:`short`,day:`numeric`,hour:`2-digit`,minute:`2-digit`,second:`2-digit`})}function ur(e,t){try{let e=JSON.parse(t);if(!e||typeof e!=`object`)return t;for(let t of[`command`,`CommandLine`,`Input`,`query`,`Task`,`Prompt`])if(typeof e[t]==`string`&&e[t].length>0)return e[t];for(let t of[`file_path`,`path`,`TargetFile`,`AbsolutePath`,`SearchPath`,`DirectoryPath`,`Url`,`ImageName`])if(typeof e[t]==`string`&&e[t].length>0)return e[t];for(let t of Object.values(e))if(typeof t==`string`&&t.length>0)return t;return``}catch{return t}}var dr=o((e=>{var t=Symbol.for(`react.transitional.element`),n=Symbol.for(`react.fragment`);function r(e,n,r){var i=null;if(r!==void 0&&(i=``+r),n.key!==void 0&&(i=``+n.key),`key`in n)for(var a in r={},n)a!==`key`&&(r[a]=n[a]);else r=n;return n=r.ref,{$$typeof:t,type:e,key:i,ref:n===void 0?null:n,props:r}}e.Fragment=n,e.jsx=r,e.jsxs=r})),U=o(((e,t)=>{t.exports=dr()}))(),fr=Lt(`flex flex-col min-h-0 overflow-hidden rounded-sm border bg-[var(--color-surface-1)] border-[var(--color-line-1)]`,{variants:{variant:{default:``,interactive:`hover:border-[var(--color-line-2)] hover:bg-[var(--color-surface-2)] transition-colors cursor-pointer`,flush:`bg-transparent border-[var(--color-line-0)]`}},defaultVariants:{variant:`default`}});function W({className:e,variant:t,...n}){return(0,U.jsx)(`div`,{className:H(fr({variant:t,className:e})),...n})}function G({className:e,...t}){return(0,U.jsx)(`div`,{className:H(`flex items-center justify-between gap-2 px-3 pt-2 pb-1 shrink-0`,e),...t})}function K({className:e,...t}){return(0,U.jsx)(`div`,{className:H(`px-3 py-3 flex-1 min-h-0 overflow-auto`,e),...t})}var pr=Lt(`inline-flex items-center gap-1 rounded-sm px-1.5 py-0.5 text-[10px] font-mono font-medium leading-none tracking-wide uppercase border whitespace-nowrap`,{variants:{variant:{green:`bg-emerald-500/8 text-emerald-300 border-emerald-500/25`,red:`bg-red-500/8 text-red-300 border-red-500/25`,amber:`bg-amber-500/10 text-amber-300 border-amber-500/30`,blue:`bg-sky-500/8 text-sky-300 border-sky-500/25`,gray:`bg-[var(--color-surface-2)] text-[var(--color-fg-3)] border-[var(--color-line-1)]`,purple:`bg-violet-500/8 text-violet-300 border-violet-500/25`,outline:`bg-transparent text-[var(--color-fg-3)] border-[var(--color-line-1)]`}},defaultVariants:{variant:`outline`}});function q({className:e,variant:t,...n}){return(0,U.jsx)(`span`,{className:H(pr({variant:t,className:e})),...n})}var mr=Lt(`relative inline-flex items-center justify-center gap-1.5 whitespace-nowrap rounded-sm text-xs font-medium tracking-wide transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-[var(--color-brand)] focus-visible:ring-offset-1 focus-visible:ring-offset-[var(--color-surface-0)] disabled:pointer-events-none disabled:opacity-40 cursor-pointer overflow-hidden`,{variants:{variant:{primary:`bg-[var(--color-brand)] text-black hover:bg-[var(--color-brand-hover)]`,secondary:`bg-[var(--color-surface-1)] border border-[var(--color-line-1)] text-[var(--color-fg-1)] hover:border-[var(--color-line-2)] hover:bg-[var(--color-surface-2)]`,ghost:`text-[var(--color-fg-2)] hover:text-[var(--color-fg-0)] hover:bg-[var(--color-surface-2)] border border-transparent`,danger:`bg-red-500/5 border border-red-500/30 text-red-300 hover:border-red-500/60 hover:bg-red-500/10 hover:text-red-200`},size:{sm:`h-6 px-2`,md:`h-8 px-3`,icon:`h-7 w-7 p-0`}},defaultVariants:{variant:`primary`,size:`md`}});function hr(e,t){if(pt())return;let n=e.getBoundingClientRect(),r=Math.hypot(n.width,n.height),i=document.createElement(`span`);i.style.position=`absolute`,i.style.left=`${t.clientX-n.left-r/2}px`,i.style.top=`${t.clientY-n.top-r/2}px`,i.style.width=`${r}px`,i.style.height=`${r}px`,i.style.borderRadius=`50%`,i.style.pointerEvents=`none`,i.style.background=`currentColor`,i.style.opacity=`0.22`,i.style.transform=`scale(0)`,i.style.mixBlendMode=`screen`,e.appendChild(i),jt(i,{scale:[0,1],opacity:[.22,0],duration:540,ease:`outExpo`,onComplete:()=>{i.remove()}})}var J=_.forwardRef(({className:e,variant:t,size:n,onMouseDown:r,onClick:i,...a},o)=>(0,U.jsx)(`button`,{ref:o,className:H(mr({variant:t,size:n,className:e})),onMouseDown:e=>{hr(e.currentTarget,e),r?.(e)},onClick:i,...a}));J.displayName=`Button`;var gr=e=>Math.round(e).toLocaleString(void 0,{useGrouping:!0});function _r(e,t){if(e===`cubic`)return{ease:Fe.out,durationMs:t};if(e===`elastic`)return{ease:We(1.05,.45),durationMs:t};let n=et({stiffness:180,damping:22,mass:1});return{ease:n.fn,durationMs:n.duration}}function vr({value:e,duration:t=320,format:n=gr,curve:r=`spring`,className:i}){let[a,o]=(0,_.useState)(e),s=(0,_.useRef)(e),c=(0,_.useRef)(e),l=(0,_.useRef)(0),u=(0,_.useRef)(null),d=(0,_.useRef)(pt());return(0,_.useEffect)(()=>{if(c.current===e)return;if(d.current){c.current=e,s.current=e,o(e);return}s.current=a,c.current=e,l.current=performance.now(),u.current!==null&&cancelAnimationFrame(u.current);let{ease:n,durationMs:i}=_r(r,t),f=e=>{let t=Math.min(1,(e-l.current)/i),r=n(t);o(s.current+(c.current-s.current)*r),t<1?u.current=requestAnimationFrame(f):u.current=null};return u.current=requestAnimationFrame(f),()=>{u.current!==null&&(cancelAnimationFrame(u.current),u.current=null)}},[e,t,r]),(0,U.jsx)(`span`,{className:H(`tabular-nums`,i),children:n(a)})}function yr({data:e,width:t=80,height:n=24,color:r=`#38bdf8`,threshold:i,maxValue:a}){if(e.length<2)return(0,U.jsx)(`svg`,{width:t,height:n,className:`shrink-0`,children:(0,U.jsx)(`line`,{x1:0,y1:n/2,x2:t,y2:n/2,stroke:`var(--color-line-2)`,strokeWidth:1})});let o=a??Math.max(...e,1),s=t-2,c=n-2,l=e.map((t,n)=>{let r=1+n/(e.length-1)*s,i=1+c-t/o*c;return`${r.toFixed(1)},${i.toFixed(1)}`}),u=i===void 0?null:1+c-Math.min(i,o)/o*c;return(0,U.jsxs)(`svg`,{width:t,height:n,className:`shrink-0`,children:[(0,U.jsx)(`polyline`,{points:l.join(` `),fill:`none`,stroke:r,strokeWidth:1.5,strokeLinejoin:`round`,strokeLinecap:`round`}),u!==null&&(0,U.jsx)(`line`,{x1:1,y1:u,x2:t-1,y2:u,stroke:`var(--color-brand)`,strokeWidth:1,strokeDasharray:`3,2`,opacity:.7})]})}function br(){return typeof window>`u`||!window.matchMedia?!1:window.matchMedia(`(prefers-reduced-motion: reduce)`).matches}function xr({value:e,samples:t,maxValue:n,width:r=320,height:i=64,windowMs:a=6e4,color:o=`var(--color-brand)`,fillColor:s=`rgba(245, 158, 11, 0.12)`,className:c}){let l=(0,_.useRef)(null),u=(0,_.useRef)(null),d=(0,_.useRef)([]),f=(0,_.useRef)(t??null),p=(0,_.useRef)(e??0),m=(0,_.useRef)(br());return(0,_.useEffect)(()=>{f.current=t??null},[t]),(0,_.useEffect)(()=>{t===void 0&&e!==void 0&&e!==p.current&&(p.current=e,d.current.push({ts:Date.now(),v:e}),d.current.length>600&&d.current.splice(0,d.current.length-600))},[e,t]),(0,_.useEffect)(()=>{let e=0,t=!1,o=()=>{let s=Date.now(),c=s-a,h;if(f.current){let e=f.current;h=[];for(let t of e)t.ts>=c&&h.push(t)}else{let e=d.current;for(;e.length>1&&e[1].ts<c;)e.shift();(e.length===0||e[e.length-1].ts<s-200)&&e.push({ts:s,v:p.current}),h=e.filter(e=>e.ts>=c)}if(h.length<2)l.current&&l.current.setAttribute(`points`,``),u.current&&u.current.setAttribute(`points`,``);else{let e=n??Math.max(1,...h.map(e=>e.v)),t=[];for(let n of h){let o=(n.ts-c)/a*r,s=i-n.v/e*(i-2)-1;t.push(`${o.toFixed(1)},${s.toFixed(1)}`)}let o=t.join(` `);if(l.current&&l.current.setAttribute(`points`,o),u.current){let e=t[0].split(`,`),n=t[t.length-1].split(`,`),r=`${e[0]},${i} ${o} ${n[0]},${i}`;u.current.setAttribute(`points`,r)}}t||(e=m.current?window.setTimeout(o,500):requestAnimationFrame(o))};return e=m.current?window.setTimeout(o,500):requestAnimationFrame(o),()=>{t=!0,m.current?clearTimeout(e):cancelAnimationFrame(e)}},[r,i,a,n]),(0,U.jsxs)(`svg`,{width:`100%`,height:i,viewBox:`0 0 ${r} ${i}`,className:H(`block`,c),preserveAspectRatio:`none`,children:[(0,U.jsx)(`polygon`,{ref:u,fill:s,stroke:`none`}),(0,U.jsx)(`polyline`,{ref:l,fill:`none`,stroke:o,strokeWidth:1.5,strokeLinejoin:`round`,strokeLinecap:`round`})]})}var Sr=Lt(`hero-metric relative flex flex-col gap-2 rounded-sm border bg-[var(--color-surface-1)] border-[var(--color-line-1)] px-4 py-3 overflow-hidden`,{variants:{tone:{neutral:`hero-metric--neutral`,amber:`hero-metric--amber`,green:`hero-metric--green`,red:`hero-metric--red`,blue:`hero-metric--blue`,purple:`hero-metric--purple`,gray:`hero-metric--gray`}},defaultVariants:{tone:`neutral`}}),Cr={neutral:`var(--color-fg-1)`,amber:`var(--color-brand)`,green:`#34d399`,red:`#f87171`,blue:`#38bdf8`,purple:`#a78bfa`,gray:`var(--color-fg-3)`},wr={neutral:`rgba(214, 215, 217, 0.10)`,amber:`rgba(245, 158, 11, 0.14)`,green:`rgba(52, 211, 153, 0.14)`,red:`rgba(248, 113, 113, 0.14)`,blue:`rgba(56, 189, 248, 0.14)`,purple:`rgba(167, 139, 250, 0.14)`,gray:`rgba(110, 112, 118, 0.10)`},Tr={neutral:`text-[var(--color-fg-0)]`,amber:`text-amber-300`,green:`text-emerald-300`,red:`text-red-300`,blue:`text-sky-300`,purple:`text-violet-300`,gray:`text-[var(--color-fg-2)]`},Er=1e3,Dr=.35;function Or(e,t,n){let r=Date.now(),i=r-n,a=Math.max(2,Math.floor(n/Er)),o=Array(a).fill(0);for(let n of e){if(t&&!t(n)||n.ts_ms<i||n.ts_ms>r)continue;let e=a-1-Math.floor((r-n.ts_ms)/Er);e>=0&&e<a&&o[e]++}let s=Array(a),c=o[0];for(let e=0;e<a;e++)c=Dr*o[e]+(1-Dr)*c,s[e]={ts:i+(e+1)*Er,v:c};return s}function kr({label:e,value:t,series:n,burstRing:r,filter:i,sparkWindowMs:a=6e4,sub:o,tone:s,format:c,className:l,...u}){let d=s??`neutral`,f=Cr[d]??Cr.neutral,p=wr[d]??wr.neutral,m=Tr[d]??Tr.neutral,h=(0,_.useRef)(null),g=(0,_.useRef)(t);(0,_.useEffect)(()=>{if(g.current===t)return;g.current=t;let e=h.current;e&&jt(e,{"--tick":[0,1],duration:160,ease:`outCubic`,onComplete:()=>{jt(e,{"--tick":[1,0],duration:520,ease:`outElastic(1, 0.6)`,onComplete:e=>{e.style.removeProperty(`--tick`)}})}})},[t]);let v=(0,_.useMemo)(()=>r?Or(r,i,a):null,[r,i,a]),y=v!==null,b=!y&&n&&n.length>=2;return(0,U.jsxs)(`div`,{ref:h,className:H(Sr({tone:s,className:l})),...u,children:[(0,U.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,U.jsx)(`span`,{className:`overline`,children:e}),o?(0,U.jsx)(`span`,{className:`text-[10px] font-mono text-[var(--color-fg-3)] tabular-nums`,children:o}):null]}),(0,U.jsxs)(`div`,{className:`flex items-end justify-between gap-3`,children:[(0,U.jsx)(vr,{value:t,format:c,className:H(`text-[2.4rem] leading-none font-semibold tracking-tight`,m)}),y?(0,U.jsx)(xr,{samples:v,width:108,height:36,windowMs:a,color:f,fillColor:p,className:`shrink-0`}):b?(0,U.jsx)(yr,{data:n,width:96,height:28,color:f}):null]})]})}var Ar=135,jr=405,Mr=jr-Ar,Nr=`#34d399`,Pr=`#f59e0b`,Fr=`#ef4444`;function Ir(e,t,n,r){let i=(r-90)*(Math.PI/180);return{x:e+n*Math.cos(i),y:t+n*Math.sin(i)}}function Lr(e,t,n,r,i){let a=Ir(e,t,n,r),o=Ir(e,t,n,i),s=i-r>180?1:0;return`M ${a.x.toFixed(2)} ${a.y.toFixed(2)} A ${n} ${n} 0 ${s} 1 ${o.x.toFixed(2)} ${o.y.toFixed(2)}`}function Rr(e,t){return Ar+Math.max(0,Math.min(1,e/Math.max(t,1e-9)))*Mr}function zr(e,t,n){return e+(t-e)*n}function Br(e){let t=parseInt(e.slice(1),16);return[t>>16&255,t>>8&255,t&255]}function Vr(e,t,n){let[r,i,a]=Br(e),[o,s,c]=Br(t);return`rgb(${Math.round(zr(r,o,n))},${Math.round(zr(i,s,n))},${Math.round(zr(a,c,n))})`}function Hr(e,t,n){let r=.04;return e<t-r?Nr:e<t+r?Vr(Nr,Pr,(e-(t-r))/(r*2)):e<n-r?Pr:e<n+r?Vr(Pr,Fr,(e-(n-r))/(r*2)):Fr}function Ur(){return typeof window>`u`||!window.matchMedia?!1:window.matchMedia(`(prefers-reduced-motion: reduce)`).matches}var Wr=0;function Gr(){return Wr=Wr+1|0,Wr.toString(36)}function Kr(){if(typeof crypto<`u`&&crypto.getRandomValues){let e=new Uint32Array(1);return crypto.getRandomValues(e),e[0]/4294967296*Math.PI*2}return 0}function qr({value:e,max:t,warnAt:n=.7,critAt:r=.9,marker50:i,marker99:a,label:o,display:s,displayFormat:c,scaleLabels:l,mode:u=`needle`,size:d=180,className:f,revLights:p=!0,revLightCount:m=20}){let h=Math.ceil(u===`needle`&&l!==void 0?d*.2:d*.08),g=-h,v=-h,y=d+h*2,b=d+h*2,x=d/2,S=d/2,C=d*.42,w=Math.max(0,Math.min(1,e/Math.max(t,1e-9))),T=(0,_.useMemo)(()=>Lr(x,S,C,Ar,jr),[x,S,C]),E=(0,_.useMemo)(()=>Lr(x,S,C-8,Ar,jr),[x,S,C]),D=Ar+n*Mr,O=Ar+r*Mr,k=(0,_.useMemo)(()=>Lr(x,S,C,Ar,D),[x,S,C,D]),A=(0,_.useMemo)(()=>Lr(x,S,C,D,O),[x,S,C,D,O]),j=(0,_.useMemo)(()=>Lr(x,S,C,O,jr),[x,S,C,O]),M=(0,_.useMemo)(()=>Lr(x,S,C-14,300,420),[x,S,C]),ee=Ar+w*Mr,te=(0,_.useMemo)(()=>Lr(x,S,C,Ar,Math.max(Ar+.01,ee)),[x,S,C,ee]),ne=Hr(w,n,r),N=(0,_.useMemo)(()=>Gr(),[]),P=`lgf-${N}`,re=`lgfn-${N}`,ie=`lgb-${N}`,ae=`lgd-${N}`,F=`lgh-${N}`,I=`lgg-${N}`,L=`lgl-${N}`,oe=(0,_.useMemo)(()=>{if(u!==`needle`)return[];let e=[];for(let t=0;t<=10;t++)e.push(Ar+t/10*Mr);return e},[u]),se=(0,_.useMemo)(()=>{if(u!==`needle`)return[];let e=[];for(let t=0;t<=40;t++)t%4!=0&&e.push(Ar+t/40*Mr);return e},[u]),ce=(0,_.useRef)(null),le=(0,_.useRef)(null),ue=(0,_.useRef)(null),de=(0,_.useRef)(null),fe=(0,_.useRef)(null),pe=(0,_.useRef)(null),me=(0,_.useRef)(null),he=(0,_.useRef)(null),ge=(0,_.useRef)([]),_e=(0,_.useRef)(e),ve=(0,_.useRef)(t),ye=(0,_.useRef)(n),be=(0,_.useRef)(r);(0,_.useEffect)(()=>{_e.current=e,ve.current=t,ye.current=n,be.current=r},[e,t,n,r]);let xe=(0,_.useMemo)(()=>{if(!p||u!==`needle`)return[];let e=Math.max(4,m),t=C-11,n=[];for(let r=0;r<e;r++){let i=Ar+(r+.5)/e*Mr;n.push(Ir(x,S,t,i))}return n},[p,m,u,x,S,C]);ge.current.length!==xe.length&&(ge.current.length=xe.length);let Se=x+C-6,Ce=x+d*.04,we=Math.max(2,d*.016),Te=`${Se},${S} ${Ce},${S-we} ${Ce},${S+we}`,Ee=x-d*.04,De=x-C*.24,Oe=Math.max(1.4,d*.012),ke=`${De},${S} ${Ee},${S-Oe} ${Ee},${S+Oe}`,Ae=d*.48,je=d*.17,R=x-Ae/2,Me=S+d*.16,Ne=Me+je*.68;return(0,_.useEffect)(()=>{let e=Ur(),t=0,n=!1,r=performance.now(),i=Kr(),a=Kr(),o=Kr(),s=_e.current,l=0,d=_e.current,f=0,m=_e.current,h=g=>{let _=(g-r)/1e3;r=g;let v=Math.min(.04,Math.max(.001,_)),y=_e.current,b=ve.current,w=ye.current,T=be.current,E=Math.max(b,1e-9),D=y;if(!e&&u===`needle`){let e=Math.max(0,Math.min(1,s/E)),t=g/1e3,n=(E*.004+E*.016*e*e)*(Math.sin(t*8.7+i)*.46+Math.sin(t*14.3+a)*.31+Math.sin(t*23.7+o)*.23);D=Math.max(0,Math.min(b,y+n))}if(e)s=y,d=y,m=y,l=0,f=0;else{let e=v/2;for(let t=0;t<2;t++){let t=-210*(s-D)-22*l;l+=t*e,s+=l*e;let n=-55*(d-s)-13*f;f+=n*e,d+=f*e}let t=1-Math.exp(-v*8);m+=(y-m)*t,Math.abs(m-y)<E*1e-5&&(m=y)}let O=Math.max(0,Math.min(1,s/Math.max(b,1e-9))),k=Ar+O*Mr,A=Ar+Math.max(0,Math.min(1,d/Math.max(b,1e-9)))*Mr,j=Hr(O,w,T);if(ce.current&&ce.current.setAttribute(`transform`,`rotate(${(k-90).toFixed(3)} ${x} ${S})`),le.current&&le.current.setAttribute(`fill`,j),ue.current&&ue.current.setAttribute(`fill`,j),de.current&&de.current.setAttribute(`stroke`,j),fe.current&&fe.current.setAttribute(`transform`,`rotate(${(A-90).toFixed(3)} ${x} ${S})`),pe.current&&pe.current.setAttribute(`fill`,j),me.current&&c&&(me.current.textContent=c(m)),he.current&&u===`ring`){let e=Math.max(Ar+.01,k);he.current.setAttribute(`d`,Lr(x,S,C,Ar,e)),he.current.setAttribute(`stroke`,j)}if(p&&u===`needle`){let e=ge.current,t=e.length;if(t>0){let n=1/t;for(let r=0;r<t;r++){let i=e[r];if(!i)continue;let a=(r+.5)/t,o=O-a,s=Math.max(0,Math.min(1,.5+o/n));i.setAttribute(`fill`,Hr(a,w,T)),i.setAttribute(`opacity`,s.toFixed(3))}}}n||(t=requestAnimationFrame(h))};return t=requestAnimationFrame(h),()=>{n=!0,cancelAnimationFrame(t)}},[x,S,C,u,p,c]),(0,U.jsxs)(`div`,{className:H(`flex flex-col items-center justify-center gap-1 min-h-0 min-w-0`,f),children:[(0,U.jsxs)(`svg`,{width:y,height:b,viewBox:`${g} ${v} ${y} ${b}`,preserveAspectRatio:`xMidYMid meet`,className:`block max-w-full max-h-full min-h-0`,children:[(0,U.jsxs)(`defs`,{children:[(0,U.jsxs)(`filter`,{id:P,x:`-40%`,y:`-40%`,width:`180%`,height:`180%`,children:[(0,U.jsx)(`feGaussianBlur`,{stdDeviation:`1.2`,result:`blur`}),(0,U.jsxs)(`feMerge`,{children:[(0,U.jsx)(`feMergeNode`,{in:`blur`}),(0,U.jsx)(`feMergeNode`,{in:`SourceGraphic`})]})]}),(0,U.jsxs)(`filter`,{id:re,x:`-60%`,y:`-60%`,width:`220%`,height:`220%`,children:[(0,U.jsx)(`feGaussianBlur`,{stdDeviation:`2.2`,result:`nb`}),(0,U.jsxs)(`feMerge`,{children:[(0,U.jsx)(`feMergeNode`,{in:`nb`}),(0,U.jsx)(`feMergeNode`,{in:`SourceGraphic`})]})]}),(0,U.jsxs)(`radialGradient`,{id:ie,cx:`50%`,cy:`32%`,r:`80%`,children:[(0,U.jsx)(`stop`,{offset:`0%`,stopColor:`#4e535d`}),(0,U.jsx)(`stop`,{offset:`55%`,stopColor:`#2a2e36`}),(0,U.jsx)(`stop`,{offset:`100%`,stopColor:`#0b0d11`})]}),(0,U.jsxs)(`radialGradient`,{id:ae,cx:`50%`,cy:`45%`,r:`75%`,children:[(0,U.jsx)(`stop`,{offset:`0%`,stopColor:`#1b1f27`}),(0,U.jsx)(`stop`,{offset:`80%`,stopColor:`#0a0c10`}),(0,U.jsx)(`stop`,{offset:`100%`,stopColor:`#05060a`})]}),(0,U.jsxs)(`radialGradient`,{id:F,cx:`40%`,cy:`30%`,r:`70%`,children:[(0,U.jsx)(`stop`,{offset:`0%`,stopColor:`#f4f5f8`}),(0,U.jsx)(`stop`,{offset:`45%`,stopColor:`#aab1bd`}),(0,U.jsx)(`stop`,{offset:`100%`,stopColor:`#1c1f26`})]}),(0,U.jsxs)(`linearGradient`,{id:I,x1:`50%`,y1:`0%`,x2:`50%`,y2:`100%`,children:[(0,U.jsx)(`stop`,{offset:`0%`,stopColor:`#ffffff`,stopOpacity:`0.22`}),(0,U.jsx)(`stop`,{offset:`100%`,stopColor:`#ffffff`,stopOpacity:`0`})]}),(0,U.jsxs)(`linearGradient`,{id:L,x1:`50%`,y1:`0%`,x2:`50%`,y2:`100%`,children:[(0,U.jsx)(`stop`,{offset:`0%`,stopColor:`#0a0c11`}),(0,U.jsx)(`stop`,{offset:`100%`,stopColor:`#15181f`})]})]}),u===`needle`?(0,U.jsxs)(U.Fragment,{children:[(0,U.jsx)(`circle`,{cx:x,cy:S,r:C+12,fill:`url(#${ie})`,stroke:`#000`,strokeOpacity:.55,strokeWidth:1}),(0,U.jsx)(`circle`,{cx:x,cy:S,r:C+5,fill:`none`,stroke:`#0a0c11`,strokeWidth:1}),(0,U.jsx)(`circle`,{cx:x,cy:S,r:C-2,fill:`url(#${ae})`})]}):null,(0,U.jsx)(`path`,{d:T,fill:`none`,stroke:`var(--color-line-1)`,strokeWidth:u===`ring`?12:3,strokeLinecap:`round`,opacity:u===`ring`?1:.35}),u===`needle`?(0,U.jsx)(`path`,{d:E,fill:`none`,stroke:`var(--color-line-0)`,strokeWidth:1,strokeLinecap:`round`,opacity:.55}):null,u===`needle`?(0,U.jsxs)(U.Fragment,{children:[(0,U.jsx)(`path`,{d:k,fill:`none`,stroke:Nr,strokeWidth:5,strokeLinecap:`round`,opacity:.78}),(0,U.jsx)(`path`,{d:A,fill:`none`,stroke:Pr,strokeWidth:5,strokeLinecap:`round`,opacity:.82}),(0,U.jsx)(`path`,{d:j,fill:`none`,stroke:Fr,strokeWidth:5,strokeLinecap:`round`,opacity:.9}),se.map((e,t)=>{let n=Ir(x,S,C-4,e),r=Ir(x,S,C+2,e);return(0,U.jsx)(`line`,{x1:n.x,y1:n.y,x2:r.x,y2:r.y,stroke:`var(--color-fg-4)`,strokeWidth:.9,strokeLinecap:`round`,opacity:.7},`mi-${t}`)}),oe.map((e,t)=>{let n=Ir(x,S,C-8,e),r=Ir(x,S,C+4,e);return(0,U.jsx)(`line`,{x1:n.x,y1:n.y,x2:r.x,y2:r.y,stroke:`var(--color-fg-2)`,strokeWidth:1.8,strokeLinecap:`round`},`ma-${t}`)}),p?xe.map((e,t)=>(0,U.jsx)(`circle`,{ref:e=>{ge.current[t]=e},cx:e.x,cy:e.y,r:Math.max(1.6,d*.013),fill:Nr,opacity:0,filter:`url(#${P})`},t)):null,i===void 0?null:(0,U.jsx)(Jr,{cx:x,cy:S,r:C,angle:Rr(i,t),emphasis:!0}),a===void 0?null:(0,U.jsx)(Jr,{cx:x,cy:S,r:C,angle:Rr(a,t),emphasis:!0}),l?(0,U.jsxs)(U.Fragment,{children:[(0,U.jsx)(Yr,{cx:x,cy:S,r:C,angle:D,text:l(n),size:d}),(0,U.jsx)(Yr,{cx:x,cy:S,r:C,angle:O,text:l(r),size:d}),(0,U.jsx)(Yr,{cx:x,cy:S,r:C,angle:jr,text:l(1),size:d})]}):null,(0,U.jsx)(`path`,{d:M,fill:`none`,stroke:`url(#${I})`,strokeWidth:d*.14,strokeLinecap:`butt`}),c||s!==void 0?(0,U.jsxs)(U.Fragment,{children:[(0,U.jsx)(`rect`,{x:R,y:Me,width:Ae,height:je,rx:d*.022,ry:d*.022,fill:`url(#${L})`,stroke:`#242a33`,strokeWidth:1}),(0,U.jsx)(`rect`,{x:R+1,y:Me+1,width:Ae-2,height:1,fill:`#ffffff`,opacity:.08})]}):null,(0,U.jsx)(`g`,{ref:fe,opacity:.28,children:(0,U.jsx)(`polygon`,{ref:pe,points:Te,fill:ne,filter:`url(#${re})`})}),(0,U.jsxs)(`g`,{ref:ce,children:[(0,U.jsx)(`polygon`,{ref:le,points:Te,fill:ne,stroke:`#05070a`,strokeWidth:.6,filter:`url(#${re})`}),(0,U.jsx)(`polygon`,{ref:ue,points:ke,fill:ne,opacity:.7})]}),(0,U.jsx)(`circle`,{cx:x,cy:S,r:d*.06,fill:`url(#${F})`,stroke:`#06080c`,strokeWidth:1}),(0,U.jsx)(`circle`,{ref:de,cx:x,cy:S,r:d*.036,fill:`#0a0c11`,stroke:ne,strokeWidth:1.4}),(0,U.jsx)(`circle`,{cx:x,cy:S,r:d*.012,fill:`#f5f7fb`,opacity:.9})]}):(0,U.jsx)(`path`,{ref:he,d:te,fill:`none`,stroke:ne,strokeWidth:12,strokeLinecap:`round`}),u===`needle`&&(c||s!==void 0)?c?(0,U.jsx)(`text`,{ref:me,x,y:Ne,textAnchor:`middle`,dominantBaseline:`middle`,className:`font-mono tabular-nums`,fontSize:d*.1,fontWeight:600,fill:`#e8ecf3`,children:c(e)}):(0,U.jsx)(`text`,{x,y:Ne,textAnchor:`middle`,dominantBaseline:`middle`,className:`font-mono tabular-nums`,fontSize:d*.1,fontWeight:600,fill:`#e8ecf3`,children:s}):c?(0,U.jsx)(`text`,{ref:me,x,y:S+4,textAnchor:`middle`,className:`font-mono tabular-nums`,fontSize:d*.13,fill:`var(--color-fg-0)`,children:c(e)}):s===void 0?null:(0,U.jsx)(`text`,{x,y:S+4,textAnchor:`middle`,className:`font-mono tabular-nums`,fontSize:d*.13,fill:`var(--color-fg-0)`,children:s})]}),o?(0,U.jsx)(`span`,{className:`overline shrink-0 tracking-[0.12em] uppercase`,children:o}):null]})}function Jr({cx:e,cy:t,r:n,angle:r,emphasis:i=!1}){let a=Ir(e,t,n-(i?10:6),r),o=Ir(e,t,n+(i?8:6),r);return(0,U.jsx)(`line`,{x1:a.x,y1:a.y,x2:o.x,y2:o.y,stroke:i?`var(--color-fg-1)`:`var(--color-fg-2)`,strokeWidth:i?2:1.5,strokeLinecap:`round`})}function Yr({cx:e,cy:t,r:n,angle:r,text:i,size:a}){let o=Ir(e,t,n+Math.max(16,a*.1),r),s=r>=135&&r<215?`end`:r>=325?`start`:`middle`;return(0,U.jsx)(`text`,{x:o.x,y:o.y,textAnchor:s,dominantBaseline:`middle`,className:`font-mono tabular-nums`,fontSize:a*.062,fontWeight:600,fill:`var(--color-fg-2)`,stroke:`var(--color-bg-0)`,strokeWidth:3,paintOrder:`stroke`,children:i})}var Xr={containerPaddingY:24,containerPaddingX:24,topToTrendGap:12,scatterHeaderH:18,scatterLegendH:16,scatterInnerGap:8,trendRowH:28,trendRowGap:6,trendTopPad:9,scatterAbsoluteMin:60,scatterAcceptableMin:70,gaugeFootprintFactor:1.36,gaugeAbsoluteMin:84,gaugeAbsoluteMax:240};function Zr(e,t,n=200){let r=Math.max(0,Math.floor(e)),i=Math.max(0,Math.floor(t)),a=Math.max(0,r-Xr.containerPaddingX),o=Math.max(0,i-Xr.containerPaddingY),s=o-(Xr.trendRowH*3+Xr.trendRowGap*2+Xr.trendTopPad+Xr.topToTrendGap),c=s-Xr.scatterHeaderH-Xr.scatterLegendH-Xr.scatterInnerGap>=Xr.scatterAcceptableMin,l=c?s:o,u=l-Xr.scatterHeaderH-Xr.scatterLegendH-Xr.scatterInnerGap,d=u>=Xr.scatterAbsoluteMin,f=u>=Xr.scatterAbsoluteMin&&l>=140,p=Math.floor(l/Xr.gaugeFootprintFactor),m=Math.floor(a*.45/Xr.gaugeFootprintFactor),h=Math.max(Xr.gaugeAbsoluteMin,Math.min(Xr.gaugeAbsoluteMax,n,p,m)),g=Math.ceil(h*Xr.gaugeFootprintFactor+8),_=l-(d?Xr.scatterHeaderH:0)-(f?Xr.scatterLegendH:0)-Xr.scatterInnerGap;return{gaugeSize:h,gaugeColumnMaxWidth:g,scatterMinHeight:Math.max(Xr.scatterAbsoluteMin,Math.min(160,_)),showTrendRows:c,showScatterHeader:d,showLegend:f,variant:o>=480?`wide`:o>=300?`normal`:`compact`}}var Qr={allow:`#34d399`,block:`#ef4444`,ask:`#f59e0b`,log:`#a78bfa`,force:`#38bdf8`,shadow:`#6e7076`};function $r(e){return!Number.isFinite(e)||e<=0?`—`:e<1e3?`${e} ns`:e<1e6?`${(e/1e3).toFixed(1)} µs`:`${(e/1e6).toFixed(2)} ms`}function ei({latency:e,bursts:t,gaugeMaxMs:n=10,windowMs:r=3e4,trendWindowSec:i=60,gaugeSize:a=200,compact:o=!1,className:s}){let c=e?e.p50_ns/1e6:0,l=e?e.p95_ns/1e6:0,u=e?e.p99_ns/1e6:0,d=(0,_.useRef)(null),[f,p]=(0,_.useState)((0,_.useMemo)(()=>Zr(a*2,a*2,a),[a]));(0,_.useEffect)(()=>{let e=d.current;if(!e||typeof ResizeObserver>`u`)return;let t=0,n=0,r=0,i=e=>{let t=Math.round(e.width),i=Math.round(e.height);t===n&&i===r||(n=t,r=i,p(Zr(t,i,a)))};i(e.getBoundingClientRect());let o=new ResizeObserver(e=>{let n=e[0];n&&(t&&cancelAnimationFrame(t),t=requestAnimationFrame(()=>{i(n.contentRect)}))});return o.observe(e),()=>{t&&cancelAnimationFrame(t),o.disconnect()}},[a]);let m=(0,_.useRef)(null),h=(0,_.useRef)([]),g=(0,_.useRef)(0);(0,_.useEffect)(()=>{if(t.length===0)return;let e=h.current,n=g.current,i=n;for(let r of t)r.ts_ms<=n||(e.push({ts:r.ts_ms,durationNs:r.duration_ns,color:Qr[r.decision]??`#6e7076`}),r.ts_ms>i&&(i=r.ts_ms));g.current=i;let a=Date.now()-r*2;for(;e.length&&e[0].ts<a;)e.shift()},[t,r]),(0,_.useEffect)(()=>{let e=m.current;if(!e)return;let t=e.getContext(`2d`);if(!t)return;let i=0,a=!1,o=0,s=0,c=0,l=8e3,u=.25,d=1e3,f=n*1e6,p=Math.log10(d),g=Math.log10(f),_=()=>{let n=window.devicePixelRatio||1,m=e.clientWidth,v=e.clientHeight;if(m===0||v===0){a||(i=requestAnimationFrame(_));return}(m!==s||v!==c||n!==o)&&(e.width=Math.floor(m*n),e.height=Math.floor(v*n),t.setTransform(n,0,0,n,0,0),s=m,c=v,o=n),t.clearRect(0,0,m,v),t.strokeStyle=`rgba(110, 112, 118, 0.18)`,t.lineWidth=1,t.setLineDash([2,4]);let y=[{ns:1e5,label:`100µs`},{ns:1e6,label:`1ms`},{ns:1e7,label:`10ms`}];t.font=`9px ui-monospace, SFMono-Regular, Menlo, monospace`,t.textBaseline=`middle`,t.fillStyle=`rgba(110, 112, 118, 0.7)`;for(let e of y){if(e.ns<d||e.ns>f)continue;let n=v-(Math.log10(e.ns)-p)/(g-p)*v;t.beginPath(),t.moveTo(0,n),t.lineTo(m-28,n),t.stroke(),t.fillText(e.label,m-26,n)}t.setLineDash([]);let b=Date.now(),x=b-r,S=h.current;for(;S.length&&S[0].ts<x;)S.shift();t.globalCompositeOperation=`source-over`;for(let e of S){let n=(e.ts-x)/r*m,i=Math.max(d,Math.min(f,e.durationNs)),a=v-(Math.log10(i)-p)/(g-p)*v,o=b-e.ts,s;if(o<=l)s=1-o/l*(1-u);else{let e=r-l;s=e>0?Math.max(0,u*(1-(o-l)/e)):0}s<=0||(t.globalAlpha=s,t.fillStyle=e.color,t.beginPath(),t.arc(n,a,2.5,0,Math.PI*2),t.fill())}t.globalAlpha=1,t.fillStyle=`rgba(110, 112, 118, 0.55)`,t.font=`9px ui-monospace, SFMono-Regular, Menlo, monospace`,t.textBaseline=`bottom`,t.textAlign=`left`,t.fillText(`← ${Math.round(r/1e3)} s ago`,4,v-2),t.textAlign=`right`,t.fillText(`now →`,m-4,v-2),t.textAlign=`left`,a||(i=requestAnimationFrame(_))};return i=requestAnimationFrame(_),()=>{a=!0,cancelAnimationFrame(i)}},[r,n]);let v=(0,_.useRef)({p50:[],p95:[],p99:[]});(0,_.useEffect)(()=>{if(!e)return;let t=v.current,n=Date.now(),r=n-i*1e3,a=(e,t)=>{let i=t/1e6;for(e.length===0&&e.push({ts:r,v:i}),e.push({ts:n,v:i});e.length>1&&e[0].ts<r;)e.shift()};a(t.p50,e.p50_ns),a(t.p95,e.p95_ns),a(t.p99,e.p99_ns)},[e,i]);let y=(0,_.useMemo)(()=>{let e=v.current;return{p50:[...e.p50],p95:[...e.p95],p99:[...e.p99]}},[e]);return(0,U.jsxs)(`div`,{ref:d,"data-lt-variant":f.variant,className:H(`flex h-full min-h-0 flex-col gap-3 overflow-hidden rounded-sm border bg-[var(--color-surface-1)] border-[var(--color-line-1)] p-3`,s),children:[(0,U.jsxs)(`div`,{className:H(`grid gap-3 min-h-0 flex-1`,`grid-cols-[auto_1fr]`),children:[(0,U.jsx)(`div`,{className:`flex items-stretch justify-center overflow-hidden min-h-0 min-w-0`,style:{maxWidth:f.gaugeColumnMaxWidth},children:(0,U.jsx)(qr,{value:l,max:n,warnAt:Math.min(.85,.5/n),critAt:Math.min(.92,2/n),marker50:c,marker99:u,displayFormat:e=>$r(e*1e6),scaleLabels:f.gaugeSize>=130?e=>$r(e*n*1e6):void 0,size:f.gaugeSize,label:`p95 latency`})}),(0,U.jsxs)(`div`,{className:`flex flex-col gap-1 min-w-0 min-h-0 flex-1`,children:[f.showScatterHeader?(0,U.jsxs)(`div`,{className:`flex items-center justify-between gap-3 shrink-0 min-w-0`,children:[(0,U.jsx)(`span`,{className:`overline truncate min-w-0`,children:`live trace · 30 s scatter`}),(0,U.jsxs)(`span`,{className:`text-[10px] font-mono text-[var(--color-fg-4)] shrink min-w-0 truncate text-right`,children:[h.current.length,` live · log-Y`]})]}):null,f.showLegend?(0,U.jsx)(`div`,{className:`shrink-0`,children:(0,U.jsx)(ti,{})}):null,(0,U.jsx)(`canvas`,{ref:m,"data-testid":`latency-scatter-canvas`,className:`block w-full flex-1 min-h-0 rounded-sm bg-[var(--color-surface-0)] border border-[var(--color-line-0)]`,style:{minHeight:f.scatterMinHeight}})]})]}),f.showTrendRows?(0,U.jsxs)(`div`,{"data-testid":`latency-trend-rows`,className:`grid grid-cols-1 gap-1.5 pt-2 border-t border-[var(--color-line-0)]`,children:[(0,U.jsx)(ni,{label:`p50 · median`,value:$r(e?.p50_ns??0),color:`#34d399`,fill:`rgba(52, 211, 153, 0.14)`,samples:y.p50,windowMs:i*1e3}),(0,U.jsx)(ni,{label:`p95 · 95th`,value:$r(e?.p95_ns??0),color:`#38bdf8`,fill:`rgba(56, 189, 248, 0.14)`,samples:y.p95,windowMs:i*1e3}),(0,U.jsx)(ni,{label:`p99 · 99th`,value:$r(e?.p99_ns??0),color:`#6366f1`,fill:`rgba(99, 102, 241, 0.14)`,samples:y.p99,windowMs:i*1e3})]}):null]})}function ti(){return(0,U.jsx)(`div`,{className:`flex flex-wrap items-center gap-x-3 gap-y-1 text-[10px] font-mono text-[var(--color-fg-4)]`,children:[{key:`allow`,color:Qr.allow},{key:`ask`,color:Qr.ask},{key:`block`,color:Qr.block},{key:`force`,color:Qr.force},{key:`log`,color:Qr.log},{key:`shadow`,color:Qr.shadow}].map(e=>(0,U.jsxs)(`span`,{className:`inline-flex items-center gap-1`,children:[(0,U.jsx)(`span`,{className:`inline-block h-1.5 w-1.5 rounded-full`,style:{background:e.color}}),(0,U.jsx)(`span`,{className:`uppercase tracking-wide`,children:e.key})]},e.key))})}function ni({label:e,value:t,color:n,fill:r,samples:i,windowMs:a}){return(0,U.jsxs)(`div`,{className:`grid grid-cols-[72px_minmax(0,1fr)_92px] items-center gap-2`,children:[(0,U.jsx)(`span`,{className:`overline text-right truncate min-w-0`,children:e}),(0,U.jsx)(xr,{samples:i,width:1200,height:28,windowMs:a,color:n,fillColor:r,className:`w-full h-7`}),(0,U.jsx)(`span`,{className:`text-[11px] font-mono tabular-nums text-right truncate min-w-0`,style:{color:n},title:t,children:t})]})}function ri({counters:e,className:t,showLegend:n=!0}){let r=[{key:`allow`,label:`Allow`,value:e.allow,color:`#34d399`,textClass:`text-emerald-300`},{key:`ask`,label:`Ask`,value:e.ask,color:`#f59e0b`,textClass:`text-amber-300`},{key:`block`,label:`Block`,value:e.block,color:`#ef4444`,textClass:`text-red-300`},{key:`force`,label:`Force`,value:e.force,color:`#38bdf8`,textClass:`text-sky-300`},{key:`log`,label:`Log`,value:e.log,color:`#a78bfa`,textClass:`text-violet-300`},{key:`shadow`,label:`Shadow`,value:e.shadow,color:`#6e7076`,textClass:`text-[var(--color-fg-3)]`}],i=r.reduce((e,t)=>e+t.value,0),a=(0,_.useRef)(null),o=(0,_.useRef)({});return(0,_.useEffect)(()=>{let e=a.current;if(!e)return;let t=e.querySelectorAll(`[data-seg]`);if(t.length===0)return;let n=pt();t.forEach(e=>{let t=e.dataset.seg,a=r.find(e=>e.key===t);if(!a)return;let s=i===0?0:a.value/i*100,c=o.current[t]??0;if(n||Math.abs(c-s)<.01)e.style.width=`${s}%`;else{let t=s>c?`outExpo`:`outElastic(1.02, 0.4)`;jt(e,{width:[`${c}%`,`${s}%`],duration:480,ease:t})}o.current[t]=s})},[e,i]),(0,U.jsxs)(`div`,{className:H(`flex flex-col gap-2`,t),children:[(0,U.jsx)(`div`,{ref:a,className:`flex h-3 w-full overflow-hidden rounded-sm border border-[var(--color-line-1)] bg-[var(--color-surface-2)]`,children:i===0?(0,U.jsx)(`div`,{className:`w-full bg-[var(--color-surface-3)]`}):r.map(e=>(0,U.jsx)(`div`,{"data-seg":e.key,style:{width:`${i===0?0:e.value/i*100}%`,background:e.color}},e.key))}),n?(0,U.jsx)(`div`,{className:`grid grid-cols-2 gap-x-3 gap-y-1 text-[11px] font-mono`,children:r.map(e=>(0,U.jsxs)(`div`,{className:`flex items-center justify-between gap-2 min-w-0`,children:[(0,U.jsxs)(`span`,{className:`flex items-center gap-1.5 min-w-0`,children:[(0,U.jsx)(`span`,{className:`h-2 w-2 shrink-0 rounded-sm`,style:{background:e.color}}),(0,U.jsx)(`span`,{className:H(`uppercase tracking-wide truncate`,e.textClass),children:e.label})]}),(0,U.jsx)(vr,{value:e.value,className:`shrink-0 tabular-nums text-[var(--color-fg-1)]`})]},e.key))}):null]})}function ii(e){return e<60?`${Math.floor(e)}s`:e<3600?`${Math.floor(e/60)}m ${Math.floor(e%60)}s`:e<86400?`${Math.floor(e/3600)}h ${Math.floor(e%3600/60)}m`:`${Math.floor(e/86400)}d ${Math.floor(e%86400/3600)}h`}function ai(e,t){if(t===void 0||t<=0)return`var(--color-brand)`;let n=e/t;return n>=.9?`#ef4444`:n>=.7?`#f59e0b`:`#34d399`}function oi(e){return e===`#ef4444`?`rgba(239, 68, 68, 0.14)`:e===`#f59e0b`?`rgba(245, 158, 11, 0.14)`:e===`#34d399`?`rgba(52, 211, 153, 0.14)`:e===`#a78bfa`?`rgba(167, 139, 250, 0.14)`:`rgba(245, 158, 11, 0.12)`}function si(e,t){if(e.length===0)return[];let n=Date.now(),r=t/Math.max(1,e.length),i=Array(e.length);for(let t=0;t<e.length;t++)i[t]={ts:n-(e.length-1-t)*r,v:e[t]};return i}function ci({cpuPct:e,cpuSeries:t,cpuLimit:n,memMb:r,memSeries:i,memLimit:a,heapUsedMb:o,heapTotalMb:s,heapSeries:c,uptimeSec:l,className:u}){let d=6e4,f=ai(e,n),p=ai(r,a),m=`#a78bfa`,h=(0,_.useMemo)(()=>si(t,d),[t]),g=(0,_.useMemo)(()=>si(i,d),[i]),v=(0,_.useMemo)(()=>si(c,d),[c]),y=(0,_.useRef)([]);(0,_.useEffect)(()=>{let e=y.current.filter(e=>!!e);if(e.length===0)return;e.forEach(e=>{e.style.opacity=`0`,e.style.transform=`translateY(28px) scale(0.94)`});let t=jt(e,{translateY:[28,0],scale:[.94,1],opacity:[0,1],duration:720,delay:it(140),ease:`outBack(1.25)`,onComplete:e=>{e.style.transform=``}});return()=>t.cancel()},[]);let b=n!==void 0&&n>0&&e>=n*.9,x=a!==void 0&&a>0&&r>=a*.9;return(0,U.jsx)(`div`,{className:H(`rounded-sm border bg-[var(--color-surface-1)] border-[var(--color-line-1)] p-3`,u),children:(0,U.jsxs)(`div`,{className:`grid grid-cols-2 lg:grid-cols-4 gap-3`,children:[(0,U.jsx)(li,{registerRef:e=>y.current[0]=e,label:`CPU`,color:f,fill:oi(f),pulse:b,valueNode:(0,U.jsxs)(`span`,{children:[(0,U.jsx)(vr,{value:e,format:e=>e.toFixed(1),className:`text-[var(--color-fg-0)]`}),(0,U.jsx)(`span`,{className:`text-[var(--color-fg-3)] ml-1.5 text-base`,children:`%`})]}),subText:n?`limit ${n}%`:void 0,samples:h,maxValue:100,windowMs:d}),(0,U.jsx)(li,{registerRef:e=>y.current[1]=e,label:`Memory`,color:p,fill:oi(p),pulse:x,valueNode:(0,U.jsxs)(`span`,{children:[(0,U.jsx)(vr,{value:r,format:e=>e.toFixed(0),className:`text-[var(--color-fg-0)]`}),(0,U.jsx)(`span`,{className:`text-[var(--color-fg-3)] ml-1.5 text-base`,children:`MB`})]}),subText:a?`limit ${a} MB`:void 0,samples:g,maxValue:a?a*1.1:void 0,windowMs:d}),(0,U.jsx)(li,{registerRef:e=>y.current[2]=e,label:`Heap`,color:m,fill:oi(m),valueNode:(0,U.jsxs)(`span`,{children:[(0,U.jsx)(vr,{value:o,format:e=>e.toFixed(0),className:`text-[var(--color-fg-0)]`}),(0,U.jsxs)(`span`,{className:`text-[var(--color-fg-3)] ml-1.5 text-base`,children:[`/ `,s.toFixed(0),` MB`]})]}),subText:s>0?`${(o/s*100).toFixed(0)}% used`:void 0,samples:v,maxValue:s>0?s:void 0,windowMs:d}),(0,U.jsx)(li,{registerRef:e=>y.current[3]=e,label:`Uptime`,color:`var(--color-fg-2)`,fill:`rgba(214, 215, 217, 0.04)`,valueNode:(0,U.jsx)(`span`,{className:`text-[var(--color-fg-0)] tabular-nums`,children:ii(l)}),subText:`since daemon start`})]})})}function li({label:e,valueNode:t,subText:n,color:r,fill:i,samples:a,maxValue:o,windowMs:s,pulse:c,registerRef:l}){let u=(0,_.useRef)(null);return(0,_.useEffect)(()=>{if(!c||!u.current)return;let e=!1,t=null,n=()=>{e||!u.current||(t=jt(u.current,{"--breach":[0,1],duration:420,ease:`outCubic`,onComplete:()=>{e||!u.current||(t=jt(u.current,{"--breach":[1,0],duration:560,ease:`outCubic`,onComplete:()=>{e||n()}}))}}))};return n(),()=>{e=!0,t?.cancel();let n=u.current;n&&n.style.removeProperty(`--breach`)}},[c]),(0,U.jsxs)(`div`,{ref:e=>{u.current=e,l(e)},className:`flex flex-col gap-2 rounded-sm border bg-[var(--color-surface-0)] border-[var(--color-line-1)] px-4 py-3 min-h-[140px] system-pulse__tile`,"data-breach":c?`true`:void 0,children:[(0,U.jsxs)(`div`,{className:`flex items-baseline justify-between`,children:[(0,U.jsx)(`span`,{className:`overline`,children:e}),n?(0,U.jsx)(`span`,{className:`text-[10px] font-mono text-[var(--color-fg-4)] tabular-nums`,children:n}):null]}),(0,U.jsx)(`span`,{className:`text-[1.9rem] leading-none font-semibold tracking-tight font-mono`,style:{color:r},children:t}),a&&a.length>=2?(0,U.jsx)(`div`,{className:`mt-auto`,children:(0,U.jsx)(xr,{samples:a,width:320,height:64,windowMs:s??6e4,color:r,fillColor:i,maxValue:o,className:`w-full`})}):(0,U.jsx)(`div`,{className:`mt-auto h-[64px] flex items-end`,children:(0,U.jsx)(`span`,{className:`text-[10px] font-mono text-[var(--color-fg-4)]`,children:`— no series —`})})]})}var ui=Lt(`relative font-mono text-[11px] overflow-hidden border bg-[var(--color-surface-1)] border-[var(--color-line-1)] rounded-sm`,{variants:{density:{compact:``,roomy:`text-[12px]`}},defaultVariants:{density:`compact`}}),di={allow:`#34d399`,block:`#ef4444`,ask:`#f59e0b`,log:`#a78bfa`,force:`#38bdf8`,shadow:`#6e7076`},fi={allow:`text-emerald-300`,block:`text-red-300`,ask:`text-amber-300`,log:`text-violet-300`,force:`text-sky-300`,shadow:`text-[var(--color-fg-3)]`};function pi(e){let t=new Date(e);return`${String(t.getHours()).padStart(2,`0`)}:${String(t.getMinutes()).padStart(2,`0`)}:${String(t.getSeconds()).padStart(2,`0`)}.${String(t.getMilliseconds()).padStart(3,`0`)}`}function mi(e){return e<1e3?`${e} ns`:e<1e6?`${(e/1e3).toFixed(1)} µs`:e<1e9?`${(e/1e6).toFixed(2)} ms`:`${(e/1e9).toFixed(2)} s`}function hi(e){return e.variant===`raw`?(0,U.jsx)(_i,{...e}):(0,U.jsx)(gi,{...e})}function gi({bursts:e,windowSize:t=60,filterDecision:n,filterClient:r,className:i,density:a,height:o=260}){let[s,c]=(0,_.useState)(!1),l=(0,_.useRef)(null),u=(0,_.useMemo)(()=>{let i=e;n&&(i=i.filter(e=>e.decision===n)),r&&(i=i.filter(e=>e.client===r));let a=i.slice(-t),o=Array(a.length);for(let e=0;e<a.length;e++)o[e]=a[a.length-1-e];return o},[e,n,r,t]);s?l.current===null&&(l.current=u):l.current=null;let d=s&&l.current?l.current:u,f=(0,_.useRef)(null),p=(0,_.useRef)(0);return(0,_.useLayoutEffect)(()=>{if(s)return;let e=d[0];if(!e||e.ts_ms===p.current)return;p.current=e.ts_ms;let t=f.current;t&&(pt()||jt(t,{translateX:[-10,0],opacity:[0,1],duration:220,ease:`outExpo`}))},[d,s]),(0,U.jsxs)(`div`,{className:H(ui({density:a,className:i})),onMouseEnter:()=>c(!0),onMouseLeave:()=>c(!1),children:[(0,U.jsx)(`div`,{className:`overflow-auto`,style:{height:o},children:d.length===0?(0,U.jsx)(`div`,{className:`px-3 py-4 text-[var(--color-fg-4)]`,children:`— waiting for events —`}):d.map((e,t)=>(0,U.jsxs)(`div`,{ref:t===0?f:void 0,className:`telemetry-row grid items-center gap-2 px-3 py-1 border-b border-[var(--color-line-0)] last:border-b-0 hover:bg-[var(--color-surface-2)]`,style:{gridTemplateColumns:`90px 56px 1fr 1fr 80px 90px`,borderLeft:`3px solid ${di[e.decision]??`#666`}`},children:[(0,U.jsx)(`span`,{className:`text-[var(--color-fg-3)] tabular-nums`,children:pi(e.ts_ms)}),(0,U.jsx)(`span`,{className:H(`uppercase tracking-wide font-medium`,fi[e.decision]??`text-[var(--color-fg-2)]`),children:e.decision}),(0,U.jsx)(`span`,{className:`text-[var(--color-fg-1)] truncate`,children:e.tool||`—`}),(0,U.jsx)(`span`,{className:`text-[var(--color-fg-2)] truncate`,children:e.rule_id??`—`}),(0,U.jsx)(`span`,{className:`text-[var(--color-fg-2)] tabular-nums text-right`,children:mi(e.duration_ns)}),(0,U.jsx)(`span`,{className:`text-[var(--color-fg-3)] truncate text-right`,children:e.client})]},`${e.ts_ms}-${t}`))}),s?(0,U.jsx)(vi,{}):null]})}function _i({lines:e,windowSize:t=300,className:n,density:r,height:i=260}){let[a,o]=(0,_.useState)(!1),s=(0,_.useRef)(null),c=(0,_.useMemo)(()=>{let n=e.slice(-t),r=Array(n.length);for(let e=0;e<n.length;e++)r[e]=n[n.length-1-e];return r},[e,t]);a?s.current===null&&(s.current=c):s.current=null;let l=a&&s.current?s.current:c;return(0,U.jsxs)(`div`,{className:H(ui({density:r,className:n})),onMouseEnter:()=>o(!0),onMouseLeave:()=>o(!1),children:[(0,U.jsx)(`div`,{className:`overflow-auto px-3 py-2 leading-relaxed text-[var(--color-fg-2)] whitespace-pre`,style:{height:i},children:l.length===0?(0,U.jsx)(`span`,{className:`text-[var(--color-fg-4)]`,children:`— empty —`}):l.map((e,t)=>(0,U.jsx)(`div`,{className:`hover:bg-[var(--color-surface-2)]`,children:e},`${t}-${e.length}`))}),a?(0,U.jsx)(vi,{}):null]})}function vi(){return(0,U.jsx)(`span`,{className:`absolute top-1 right-2 text-[10px] uppercase tracking-wider font-mono text-[var(--color-brand)] bg-[var(--color-surface-0)] px-1.5 py-0.5 border border-[var(--color-brand)]/40 rounded-sm`,children:`paused`})}var yi=(...e)=>e.filter((e,t,n)=>!!e&&e.trim()!==``&&n.indexOf(e)===t).join(` `).trim(),bi=e=>e.replace(/([a-z0-9])([A-Z])/g,`$1-$2`).toLowerCase(),xi=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(e,t,n)=>n?n.toUpperCase():t.toLowerCase()),Si=e=>{let t=xi(e);return t.charAt(0).toUpperCase()+t.slice(1)},Ci={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`},wi=e=>{for(let t in e)if(t.startsWith(`aria-`)||t===`role`||t===`title`)return!0;return!1},Y=(0,_.forwardRef)(({color:e=`currentColor`,size:t=24,strokeWidth:n=2,absoluteStrokeWidth:r,className:i=``,children:a,iconNode:o,...s},c)=>(0,_.createElement)(`svg`,{ref:c,...Ci,width:t,height:t,stroke:e,strokeWidth:r?Number(n)*24/Number(t):n,className:yi(`lucide`,i),...!a&&!wi(s)&&{"aria-hidden":`true`},...s},[...o.map(([e,t])=>(0,_.createElement)(e,t)),...Array.isArray(a)?a:[a]])),Ti=(e,t)=>{let n=(0,_.forwardRef)(({className:n,...r},i)=>(0,_.createElement)(Y,{ref:i,iconNode:t,className:yi(`lucide-${bi(Si(e))}`,`lucide-${e}`,n),...r}));return n.displayName=Si(e),n},Ei=Ti(`check`,[[`path`,{d:`M20 6 9 17l-5-5`,key:`1gmf2c`}]]),Di=Ti(`download`,[[`path`,{d:`M12 15V3`,key:`m9g1x1`}],[`path`,{d:`M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4`,key:`ih7n3h`}],[`path`,{d:`m7 10 5 5 5-5`,key:`brsn70`}]]),Oi=Ti(`grip-horizontal`,[[`circle`,{cx:`12`,cy:`9`,r:`1`,key:`124mty`}],[`circle`,{cx:`19`,cy:`9`,r:`1`,key:`1ruzo2`}],[`circle`,{cx:`5`,cy:`9`,r:`1`,key:`1a8b28`}],[`circle`,{cx:`12`,cy:`15`,r:`1`,key:`1e56xg`}],[`circle`,{cx:`19`,cy:`15`,r:`1`,key:`1a92ep`}],[`circle`,{cx:`5`,cy:`15`,r:`1`,key:`5r1jwy`}]]),ki=Ti(`pencil`,[[`path`,{d:`M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z`,key:`1a8usu`}],[`path`,{d:`m15 5 4 4`,key:`1mk7zo`}]]),Ai=Ti(`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`}]]),ji=Ti(`save`,[[`path`,{d:`M15.2 3a2 2 0 0 1 1.4.6l3.8 3.8a2 2 0 0 1 .6 1.4V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2z`,key:`1c8476`}],[`path`,{d:`M17 21v-7a1 1 0 0 0-1-1H8a1 1 0 0 0-1 1v7`,key:`1ydtos`}],[`path`,{d:`M7 3v4a1 1 0 0 0 1 1h7`,key:`t51u73`}]]),Mi=Ti(`trash-2`,[[`path`,{d:`M10 11v6`,key:`nco0om`}],[`path`,{d:`M14 11v6`,key:`outv1u`}],[`path`,{d:`M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6`,key:`miytrc`}],[`path`,{d:`M3 6h18`,key:`d0wm0j`}],[`path`,{d:`M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2`,key:`e791ji`}]]),Ni=Ti(`upload`,[[`path`,{d:`M12 3v12`,key:`1x0j5s`}],[`path`,{d:`m17 8-5-5-5 5`,key:`7q97r8`}],[`path`,{d:`M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4`,key:`ih7n3h`}]]),Pi=Ti(`x`,[[`path`,{d:`M18 6 6 18`,key:`1bl5f8`}],[`path`,{d:`m6 6 12 12`,key:`d8bk6v`}]]),Fi=[`hero-metrics`,`graph`,`latency-trace`,`throughput`,`decision-mix`,`telemetry-feed`,`system-pulse`,`pending-approvals`,`recent-blocks`],Ii={"hero-metrics":`Hero metrics`,graph:`Graph intelligence`,"latency-trace":`Latency trace`,throughput:`Throughput`,"decision-mix":`Decision mix`,"telemetry-feed":`Telemetry feed`,"system-pulse":`System pulse`,"pending-approvals":`Pending approvals`,"recent-blocks":`Recent blocks`},Li={"hero-metrics":{minW:6,minH:1,defaultW:12,defaultH:1},graph:{minW:4,minH:3,defaultW:8,defaultH:5},"latency-trace":{minW:4,minH:3,defaultW:8,defaultH:4},throughput:{minW:2,minH:2,defaultW:4,defaultH:2},"decision-mix":{minW:2,minH:2,defaultW:4,defaultH:2},"telemetry-feed":{minW:6,minH:3,defaultW:12,defaultH:4},"system-pulse":{minW:4,minH:3,defaultW:12,defaultH:3},"pending-approvals":{minW:3,minH:2,defaultW:6,defaultH:3},"recent-blocks":{minW:3,minH:2,defaultW:6,defaultH:3}};function Ri({panel:e,isEditing:t,children:n,drag:r}){let i=(0,_.useRef)(null),a={gridColumn:`${e.x+1} / span ${e.w}`,gridRow:`${e.y+1} / span ${e.h}`};return(0,U.jsxs)(`div`,{ref:i,className:`grid-panel ${t?`grid-panel--edit`:``}`,style:a,role:t?`region`:void 0,"aria-label":t?Ii[e.id]:void 0,tabIndex:t?0:void 0,onKeyDown:t?t=>r.onPanelKeyDown(t,e.id):void 0,"data-panel-id":e.id,children:[t&&(0,U.jsx)(`button`,{type:`button`,className:`grid-panel__drag-handle`,title:`Drag ${Ii[e.id]} (or Arrow keys)`,"aria-label":`Drag ${Ii[e.id]}`,onPointerDown:t=>{let n=i.current;n&&r.onDragPointerDown(t,e.id,n)},children:(0,U.jsx)(Oi,{size:12,strokeWidth:2})}),(0,U.jsx)(`div`,{className:`grid-panel__content`,"data-reveal":t?void 0:``,children:n}),t&&(0,U.jsx)(`button`,{type:`button`,className:`grid-panel__resize-handle`,title:`Resize ${Ii[e.id]} (or Shift+Arrow keys)`,"aria-label":`Resize ${Ii[e.id]}`,onPointerDown:t=>{let n=i.current;n&&r.onResizePointerDown(t,e.id,n)},children:(0,U.jsxs)(`svg`,{width:`10`,height:`10`,viewBox:`0 0 10 10`,"aria-hidden":!0,children:[(0,U.jsx)(`path`,{d:`M10 0 L10 10 L0 10 Z`,fill:`currentColor`,fillOpacity:`0.4`}),(0,U.jsx)(`path`,{d:`M3 10 L10 3 M6 10 L10 6 M9 10 L10 9`,stroke:`currentColor`,strokeWidth:`0.8`,fill:`none`})]})})]})}var zi=(0,_.memo)(Ri);function Bi(e){let t=getComputedStyle(e),n=e.getBoundingClientRect(),r=parseFloat(t.rowGap||t.gap||`0`)||0,i=r*11;return{cellWidthPx:(n.width-i)/12+r,cellHeightPx:72+r}}function Vi(e){let t=(0,_.useRef)(null),n=(0,_.useRef)(e);n.current=e;let r=(0,_.useCallback)(()=>{let e=t.current;if(e){e.element.style.transform=``,e.element.style.width=``,e.element.style.height=``,e.element.style.zIndex=``,e.element.classList.remove(`grid-panel--dragging`),e.element.classList.remove(`grid-panel--resizing`);try{e.element.releasePointerCapture(e.pointerId)}catch{}t.current=null}},[]);(0,_.useEffect)(()=>{function e(e){let n=t.current;if(!n||e.pointerId!==n.pointerId)return;let r=e.clientX-n.startPointerX,i=e.clientY-n.startPointerY;if(n.mode===`drag`)n.element.style.transform=`translate3d(${r}px, ${i}px, 0)`;else{let e=Li[n.startPanel.id],t=e.minW*n.cellWidthPx-n.cellWidthPx+40,a=e.minH*n.cellHeightPx-n.cellHeightPx+40,o=Math.max(t,n.startRectW+r),s=Math.max(a,n.startRectH+i);n.element.style.width=`${o}px`,n.element.style.height=`${s}px`}}function i(e,t,n){let r=Li[e.startPanel.id];if(e.mode===`drag`){let r=Math.round(t/e.cellWidthPx),i=Math.round(n/e.cellHeightPx),a=e.startPanel.x+r,o=e.startPanel.y+i;return a<0&&(a=0),a+e.startPanel.w>12&&(a=12-e.startPanel.w),o<0&&(o=0),{id:e.id,x:a,y:o,w:e.startPanel.w,h:e.startPanel.h}}let i=Math.round(t/e.cellWidthPx),a=Math.round(n/e.cellHeightPx),o=e.startPanel.w+i,s=e.startPanel.h+a;return o<r.minW&&(o=r.minW),s<r.minH&&(s=r.minH),e.startPanel.x+o>12&&(o=12-e.startPanel.x),{id:e.id,x:e.startPanel.x,y:e.startPanel.y,w:o,h:s}}function a(e){let a=t.current;if(!a||e.pointerId!==a.pointerId)return;let o=i(a,e.clientX-a.startPointerX,e.clientY-a.startPointerY);r(),o.x===a.startPanel.x&&o.y===a.startPanel.y&&o.w===a.startPanel.w&&o.h===a.startPanel.h||n.current.onCommit(o)}function o(e){let n=t.current;!n||e.pointerId!==n.pointerId||r()}function s(e){e.key===`Escape`&&t.current&&r()}function c(){document.visibilityState===`hidden`&&t.current&&r()}return document.addEventListener(`pointermove`,e),document.addEventListener(`pointerup`,a),document.addEventListener(`pointercancel`,o),document.addEventListener(`keydown`,s),document.addEventListener(`visibilitychange`,c),()=>{document.removeEventListener(`pointermove`,e),document.removeEventListener(`pointerup`,a),document.removeEventListener(`pointercancel`,o),document.removeEventListener(`keydown`,s),document.removeEventListener(`visibilitychange`,c),t.current&&r()}},[r]);let i=(0,_.useCallback)((e,r,i,a)=>{if(!n.current.enabled||t.current)return;let o=n.current.getPanel(r),s=n.current.gridRef.current;if(!o||!s)return;e.preventDefault(),e.stopPropagation();let{cellWidthPx:c,cellHeightPx:l}=Bi(s),u=i.getBoundingClientRect();t.current={id:r,mode:a,startPointerX:e.clientX,startPointerY:e.clientY,startPanel:o,element:i,cellWidthPx:c,cellHeightPx:l,pointerId:e.pointerId,startRectW:u.width,startRectH:u.height},i.classList.add(a===`drag`?`grid-panel--dragging`:`grid-panel--resizing`),i.style.zIndex=`10`;try{i.setPointerCapture(e.pointerId)}catch{}},[]);return{onDragPointerDown:(0,_.useCallback)((e,t,n)=>i(e,t,n,`drag`),[i]),onResizePointerDown:(0,_.useCallback)((e,t,n)=>i(e,t,n,`resize`),[i]),onPanelKeyDown:(0,_.useCallback)((e,t)=>{if(!n.current.enabled)return;let r=n.current.getPanel(t);if(!r)return;let i=e.shiftKey,a=0,o=0;switch(e.key){case`ArrowLeft`:a=-1;break;case`ArrowRight`:a=1;break;case`ArrowUp`:o=-1;break;case`ArrowDown`:o=1;break;default:return}e.preventDefault(),e.stopPropagation();let s=Li[t];if(i){let e=r.w+a,i=r.h+o;if(e<s.minW&&(e=s.minW),i<s.minH&&(i=s.minH),r.x+e>12&&(e=12-r.x),e===r.w&&i===r.h)return;n.current.onCommit({id:t,x:r.x,y:r.y,w:e,h:i})}else{let e=r.x+a,i=r.y+o;if(e<0&&(e=0),e+r.w>12&&(e=12-r.w),i<0&&(i=0),e===r.x&&i===r.y)return;n.current.onCommit({id:t,x:e,y:i,w:r.w,h:r.h})}},[]),isGesturing:(0,_.useCallback)(()=>t.current!==null,[])}}function Hi(e,t){return e.x<t.x+t.w&&e.x+e.w>t.x&&e.y<t.y+t.h&&e.y+e.h>t.y}function Ui(e){return{id:e.id,x:e.x,y:e.y,w:e.w,h:e.h}}function Wi(e,t){let n=[Ui(e)],r=t.map(Ui);r.sort((e,t)=>e.y===t.y?e.x-t.x:e.y-t.y);for(let e of r){for(;;){let t=!1;for(let r of n)if(Hi(e,r)){let n=r.y+r.h;n>e.y&&(e.y=n,t=!0)}if(!t)break}n.push(e)}return n}function Gi(e){if(e.length===0)return[];let t=[...e].map(Ui).sort((e,t)=>e.y===t.y?e.x-t.x:e.y-t.y),n=[];for(let e of t){let t=!0;for(;t;){t=!1;for(let r of n)Hi(e,r)&&(e.y=r.y+r.h,t=!0)}n.push(e)}return n}function Ki(e,t,n){let r=e.findIndex(e=>e.id===t);if(r===-1)return{panels:e.map(Ui)};let i=Wi({id:e[r].id,x:n.x,y:n.y,w:n.w,h:n.h},e.filter((e,t)=>t!==r)),a=new Map(i.map(e=>[e.id,e]));return{panels:Gi(e.map(e=>a.get(e.id)).filter(Boolean))}}function qi({panels:e,isEditing:t,renderers:n,onPanelsChange:r}){let i=(0,_.useRef)(null),a=(0,_.useRef)(e);a.current=e;let o=(0,_.useMemo)(()=>{let t=new Map;for(let n of e)t.set(n.id,n);return t},[e]),s=Vi({gridRef:i,getPanel:(0,_.useCallback)(e=>o.get(e),[o]),onCommit:(0,_.useCallback)(e=>{let t=a.current,{panels:n}=Ki(t,e.id,{x:e.x,y:e.y,w:e.w,h:e.h});r(n)},[r]),enabled:t});return(0,U.jsx)(`div`,{ref:i,className:`grid-layout ${t?`grid-layout--editing`:``}`,"aria-live":t?`polite`:void 0,children:e.map(e=>(0,U.jsx)(zi,{panel:e,isEditing:t,drag:s,children:n[e.id]()},e.id))})}function Ji({manager:e,isEditing:t,onToggleEditing:n}){let{config:r,activeLayout:i,canAddUserLayout:a,saveError:o,selectLayout:s,saveAs:c,renameActive:l,deleteLayout:u,resetActive:d,exportConfig:f,importConfig:p}=e,[m,h]=(0,_.useState)(null),[g,v]=(0,_.useState)(!1),[y,b]=(0,_.useState)(``),[x,S]=(0,_.useState)(!1),[C,w]=(0,_.useState)(i.name),[T,E]=(0,_.useState)(!1),[D,O]=(0,_.useState)(!1),k=(0,_.useRef)(null);(0,_.useEffect)(()=>{w(i.name)},[i.name]),(0,_.useEffect)(()=>{o&&h(o)},[o]),(0,_.useEffect)(()=>{if(!m)return;let e=setTimeout(()=>h(null),4e3);return()=>clearTimeout(e)},[m]);function A(){y.trim()&&(c(y.trim()),b(``),v(!1),h(`Saved "${y.trim()}"`))}function j(){C.trim()&&(l(C.trim()),S(!1),h(`Renamed`))}function M(){let e=i.name;u(i.id),O(!1),h(`Deleted "${e}"`)}function ee(){d(),E(!1),h(`Reset to default`)}function te(){let e=f(),t=new Blob([e],{type:`application/json`}),n=URL.createObjectURL(t),r=new Date().toISOString().slice(0,10),i=document.createElement(`a`);i.href=n,i.download=`ssg-layout-${r}.json`,i.click(),URL.revokeObjectURL(n),h(`Layout exported`)}function ne(e){let t=e.target.files?.[0];e.target.value=``,t&&t.text().then(e=>{h(p(e).message)}).catch(()=>h(`Import failed: could not read file`))}return(0,U.jsxs)(`div`,{className:`flex items-center justify-between gap-3 rounded-sm border border-[var(--color-line-1)] bg-[var(--color-surface-1)] px-3 py-2`,children:[(0,U.jsxs)(`div`,{className:`flex items-center gap-3 min-w-0`,children:[(0,U.jsx)(`span`,{className:`overline shrink-0`,children:`layout`}),(0,U.jsxs)(`select`,{value:r.activeLayoutId,onChange:e=>s(e.target.value),className:`bg-[var(--color-surface-2)] border border-[var(--color-line-1)] rounded-sm px-2 py-1 text-[11px] font-mono text-[var(--color-fg-1)] hover:border-[var(--color-line-2)] focus:outline-none focus:ring-1 focus:ring-[var(--color-brand)] cursor-pointer`,"aria-label":`Select layout`,children:[(0,U.jsx)(`optgroup`,{label:`Built-in`,children:r.layouts.filter(e=>e.builtIn).map(e=>(0,U.jsx)(`option`,{value:e.id,children:e.name},e.id))}),r.layouts.some(e=>!e.builtIn)&&(0,U.jsx)(`optgroup`,{label:`Your layouts`,children:r.layouts.filter(e=>!e.builtIn).map(e=>(0,U.jsx)(`option`,{value:e.id,children:e.name},e.id))})]}),i.builtIn&&(0,U.jsx)(`span`,{className:`chip text-[var(--color-fg-3)]`,title:`Built-in preset`,children:`built-in`})]}),(0,U.jsx)(`div`,{className:`flex items-center gap-1.5 shrink-0`,children:t?(0,U.jsxs)(U.Fragment,{children:[(0,U.jsxs)(J,{variant:`secondary`,size:`sm`,onClick:()=>v(!0),disabled:!a,title:a?`Save the current arrangement as a new preset`:`Layout limit reached — delete one first`,children:[(0,U.jsx)(ji,{size:11,strokeWidth:2.25}),`Save as`]}),!i.builtIn&&(0,U.jsxs)(U.Fragment,{children:[(0,U.jsxs)(J,{variant:`ghost`,size:`sm`,onClick:()=>{w(i.name),S(!0)},children:[(0,U.jsx)(ki,{size:11,strokeWidth:2.25}),`Rename`]}),(0,U.jsxs)(J,{variant:`ghost`,size:`sm`,onClick:()=>O(!0),children:[(0,U.jsx)(Mi,{size:11,strokeWidth:2.25}),`Delete`]})]}),(0,U.jsxs)(J,{variant:`ghost`,size:`sm`,onClick:()=>E(!0),title:`Replace the current layout with the Default preset`,children:[(0,U.jsx)(Ai,{size:11,strokeWidth:2.25}),`Reset`]}),(0,U.jsxs)(J,{variant:`ghost`,size:`sm`,onClick:te,title:`Download current layouts as JSON`,children:[(0,U.jsx)(Di,{size:11,strokeWidth:2.25}),`Export`]}),(0,U.jsxs)(J,{variant:`ghost`,size:`sm`,onClick:()=>k.current?.click(),title:`Load layouts from a JSON file`,children:[(0,U.jsx)(Ni,{size:11,strokeWidth:2.25}),`Import`]}),(0,U.jsx)(`input`,{ref:k,type:`file`,accept:`application/json,.json`,onChange:ne,className:`hidden`,"aria-hidden":!0}),(0,U.jsxs)(J,{variant:`primary`,size:`sm`,onClick:()=>n(!1),children:[(0,U.jsx)(Ei,{size:11,strokeWidth:2.5}),`Done`]})]}):(0,U.jsxs)(J,{variant:`secondary`,size:`sm`,onClick:()=>n(!0),children:[(0,U.jsx)(ki,{size:11,strokeWidth:2.25}),`Edit layout`]})}),g&&(0,U.jsx)(Yi,{title:`Save layout as`,value:y,placeholder:`My dashboard`,onChange:b,onConfirm:A,onCancel:()=>{v(!1),b(``)},confirmLabel:`Save`}),x&&(0,U.jsx)(Yi,{title:`Rename layout`,value:C,placeholder:i.name,onChange:w,onConfirm:j,onCancel:()=>S(!1),confirmLabel:`Rename`}),T&&(0,U.jsx)(Xi,{title:`Reset this layout?`,body:`The current arrangement will be replaced with the Default preset. Saved layouts are not affected.`,confirmLabel:`Reset`,onConfirm:ee,onCancel:()=>E(!1),destructive:!1}),D&&(0,U.jsx)(Xi,{title:`Delete "${i.name}"?`,body:`This layout will be removed. You can always recreate it via Save as.`,confirmLabel:`Delete`,onConfirm:M,onCancel:()=>O(!1),destructive:!0}),m&&(0,U.jsx)(`div`,{role:`status`,className:`fixed bottom-5 left-1/2 -translate-x-1/2 z-50 rounded-sm border border-[var(--color-line-2)] bg-[var(--color-surface-3)] px-3 py-2 text-[11px] font-mono text-[var(--color-fg-1)] shadow-lg`,children:m})]})}function Yi({title:e,value:t,placeholder:n,onChange:r,onConfirm:i,onCancel:a,confirmLabel:o}){return(0,U.jsx)(`div`,{role:`dialog`,"aria-modal":!0,"aria-label":e,className:`fixed inset-0 z-50 flex items-center justify-center bg-black/60 backdrop-blur-sm`,onClick:a,children:(0,U.jsxs)(`div`,{onClick:e=>e.stopPropagation(),className:`w-80 rounded-sm border border-[var(--color-line-2)] bg-[var(--color-surface-2)] p-4`,children:[(0,U.jsx)(`div`,{className:`overline mb-2`,children:e}),(0,U.jsx)(`input`,{value:t,onChange:e=>r(e.target.value),placeholder:n,autoFocus:!0,onKeyDown:e=>{e.key===`Enter`&&i(),e.key===`Escape`&&a()},className:`w-full bg-[var(--color-surface-1)] border border-[var(--color-line-1)] rounded-sm px-2 py-1.5 text-[13px] font-mono text-[var(--color-fg-1)] focus:outline-none focus:border-[var(--color-brand)]`}),(0,U.jsxs)(`div`,{className:`mt-3 flex justify-end gap-2`,children:[(0,U.jsxs)(J,{variant:`ghost`,size:`sm`,onClick:a,children:[(0,U.jsx)(Pi,{size:11,strokeWidth:2.25}),`Cancel`]}),(0,U.jsx)(J,{variant:`primary`,size:`sm`,onClick:i,children:o})]})]})})}function Xi({title:e,body:t,confirmLabel:n,destructive:r,onConfirm:i,onCancel:a}){return(0,U.jsx)(`div`,{role:`dialog`,"aria-modal":!0,"aria-label":e,className:`fixed inset-0 z-50 flex items-center justify-center bg-black/60 backdrop-blur-sm`,onClick:a,children:(0,U.jsxs)(`div`,{onClick:e=>e.stopPropagation(),className:`w-96 rounded-sm border border-[var(--color-line-2)] bg-[var(--color-surface-2)] p-4`,children:[(0,U.jsx)(`div`,{className:`overline mb-2`,children:e}),(0,U.jsx)(`p`,{className:`text-[12px] text-[var(--color-fg-2)] leading-relaxed`,children:t}),(0,U.jsxs)(`div`,{className:`mt-4 flex justify-end gap-2`,children:[(0,U.jsx)(J,{variant:`ghost`,size:`sm`,onClick:a,children:`Cancel`}),(0,U.jsx)(J,{variant:r?`danger`:`primary`,size:`sm`,onClick:i,children:n})]})]})})}var Zi={default:`builtin-default`,focusLatency:`builtin-focus-latency`,focusApprovals:`builtin-focus-approvals`,compact:`builtin-compact`},Qi={id:Zi.default,name:`Default`,builtIn:!0,panels:[{id:`hero-metrics`,x:0,y:0,w:12,h:1},{id:`graph`,x:0,y:1,w:8,h:5},{id:`latency-trace`,x:8,y:1,w:4,h:3},{id:`throughput`,x:8,y:4,w:2,h:2},{id:`decision-mix`,x:10,y:4,w:2,h:2},{id:`telemetry-feed`,x:0,y:6,w:12,h:3},{id:`system-pulse`,x:0,y:9,w:12,h:3},{id:`pending-approvals`,x:0,y:12,w:6,h:3},{id:`recent-blocks`,x:6,y:12,w:6,h:3}]},$i={id:Zi.focusLatency,name:`Focus · Latency`,builtIn:!0,panels:[{id:`hero-metrics`,x:0,y:0,w:12,h:1},{id:`latency-trace`,x:0,y:1,w:8,h:5},{id:`graph`,x:8,y:1,w:4,h:5},{id:`throughput`,x:0,y:6,w:6,h:2},{id:`decision-mix`,x:6,y:6,w:6,h:2},{id:`system-pulse`,x:0,y:8,w:12,h:3},{id:`telemetry-feed`,x:0,y:11,w:12,h:3},{id:`pending-approvals`,x:0,y:14,w:6,h:2},{id:`recent-blocks`,x:6,y:14,w:6,h:2}]},ea={id:Zi.focusApprovals,name:`Focus · Approvals`,builtIn:!0,panels:[{id:`pending-approvals`,x:0,y:0,w:8,h:4},{id:`graph`,x:8,y:0,w:4,h:4},{id:`recent-blocks`,x:0,y:4,w:12,h:3},{id:`hero-metrics`,x:0,y:7,w:12,h:1},{id:`latency-trace`,x:0,y:8,w:6,h:3},{id:`telemetry-feed`,x:6,y:8,w:6,h:3},{id:`system-pulse`,x:0,y:11,w:12,h:3},{id:`throughput`,x:0,y:14,w:6,h:2},{id:`decision-mix`,x:6,y:14,w:6,h:2}]},ta={id:Zi.compact,name:`Compact`,builtIn:!0,panels:[{id:`hero-metrics`,x:0,y:0,w:12,h:1},{id:`graph`,x:0,y:1,w:8,h:3},{id:`latency-trace`,x:8,y:1,w:4,h:3},{id:`system-pulse`,x:0,y:4,w:12,h:3},{id:`throughput`,x:0,y:7,w:4,h:2},{id:`decision-mix`,x:4,y:7,w:4,h:2},{id:`telemetry-feed`,x:0,y:9,w:12,h:3},{id:`pending-approvals`,x:0,y:12,w:6,h:2},{id:`recent-blocks`,x:6,y:12,w:6,h:2}]},na=Object.freeze([Qi,$i,ea,ta]);function ra(){return na.map(e=>({...e,panels:e.panels.map(e=>({...e}))}))}function ia(){return{version:1,activeLayoutId:Zi.default,layouts:ra()}}function aa(e){return Object.values(Zi).includes(e)}var oa=new Set(Fi),sa=new Set(na.map(e=>e.id));function ca(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function la(e,t,n,r){if(typeof e!=`number`||!Number.isFinite(e))return r;let i=Math.floor(e);return i<t?t:i>n?n:i}function ua(e,t){let n=(typeof e==`string`?e:``).replace(/[\u0000-\u001F\u007F]/g,``).trim();return n.length===0?t:n.slice(0,40)}function da(e){let t=e.find(e=>e.id===`system-pulse`);if(!t||t.h>=3)return e;let n=3-t.h,r=t.y+t.h;return e.map(e=>e.id===`system-pulse`?{...e,h:3}:e.y>=r?{...e,y:e.y+n}:e)}function fa(e){for(let t=0;t<e.length;t++){let n=e[t];for(let r=t+1;r<e.length;r++){let t=e[r];if(n.x<t.x+t.w&&n.x+n.w>t.x&&n.y<t.y+t.h&&n.y+n.h>t.y)return!0}}return!1}function pa(e){if(!ca(e))return null;let{id:t}=e;if(typeof t!=`string`||!oa.has(t))return null;let n=t,r=Li[n],i=la(e.x,0,11,0),a=la(e.w,r.minW,12,r.defaultW);return{id:n,x:i+a>12?12-a:i,y:la(e.y,0,999,0),w:a,h:la(e.h,r.minH,99,r.defaultH)}}function ma(e,t){if(!ca(e))return{layout:null,droppedPanels:0};let n=typeof e.id==`string`&&e.id.length>0?e.id:null;if(!n)return{layout:null,droppedPanels:0};let r=ua(e.name,t),i=sa.has(n),a=e.panels;if(!Array.isArray(a))return{layout:null,droppedPanels:0};let o=new Set,s=[],c=0;for(let e of a){let t=pa(e);if(!t){c+=1;continue}if(o.has(t.id)){c+=1;continue}o.add(t.id),s.push(t)}return s.length===0?{layout:null,droppedPanels:c}:{layout:{id:n,name:r,builtIn:i,panels:da(s)},droppedPanels:c}}function ha(e){if(!ca(e)||e.version!==1)return{config:ia(),droppedPanels:0,prunedLayouts:0,fellBackToDefault:!0};let t=e.layouts;if(!Array.isArray(t)||t.length===0)return{config:ia(),droppedPanels:0,prunedLayouts:0,fellBackToDefault:!0};let n=[],r=0,i=0,a=0;for(let e of t){let{layout:t,droppedPanels:o}=ma(e,`Layout ${n.length+1}`);if(r+=o,t){if(!t.builtIn){if(i>=12){a+=1;continue}i+=1}n.push(t)}}if(n.length===0)return{config:ia(),droppedPanels:r,prunedLayouts:a,fellBackToDefault:!0};let o=new Set(n.map(e=>e.id));for(let e of na)o.has(e.id)||n.push({...e,panels:e.panels.map(e=>({...e}))});let s=new Map(na.map(e=>[e.id,e])),c=0,l=0;for(let e=0;e<n.length;e++){let t=n[e],r=s.get(t.id);if(!r)continue;if(fa(t.panels)){n[e]={...r,panels:r.panels.map(e=>({...e}))},l+=1;continue}let i=new Set(t.panels.map(e=>e.id)),a=r.panels.filter(e=>!i.has(e.id));if(a.length===0)continue;let o=t.panels.reduce((e,t)=>Math.max(e,t.y+t.h),0);for(let e of a)t.panels.push({id:e.id,x:0,y:o,w:e.w,h:e.h}),o+=e.h,c+=1}let u=e.activeLayoutId;return{config:{version:1,activeLayoutId:typeof u==`string`&&n.some(e=>e.id===u)?u:na[0].id,layouts:n},droppedPanels:r,prunedLayouts:a,fellBackToDefault:!1,backfilledPanels:c,refreshedBuiltins:l}}var ga=`ssg:dashboard-layout:v1`,_a=300;function va(){if(typeof localStorage>`u`)return null;try{let e=`__ssg_probe__`;return localStorage.setItem(e,`1`),localStorage.removeItem(e),localStorage}catch{return null}}var ya;function ba(){return ya===void 0&&(ya=va()),ya}function xa(){let e=ba();if(!e)return{config:ia(),droppedPanels:0,prunedLayouts:0,fellBackToDefault:!1};let t=null;try{t=e.getItem(ga)}catch{t=null}if(t===null)return{config:ia(),droppedPanels:0,prunedLayouts:0,fellBackToDefault:!1};let n=null;try{n=JSON.parse(t)}catch{return{config:ia(),droppedPanels:0,prunedLayouts:0,fellBackToDefault:!0}}return ha(n)}var Sa=null,Ca=null,wa=null;function Ta(e){return wa=e,()=>{wa===e&&(wa=null)}}function Ea(e){wa?wa(e):typeof console<`u`&&console.warn(`[ssg-layout]`,e)}function Da(){if(Ca=null,!Sa)return;let e=ba();if(!e){Sa=null;return}let t=Sa;Sa=null;try{e.setItem(ga,JSON.stringify(t))}catch(e){e instanceof Error&&e.name===`QuotaExceededError`?Ea(`Layout storage full — save skipped`):Ea(`Layout save failed: ${e instanceof Error?e.message:String(e)}`)}}function Oa(e){Sa=e,Ca===null&&(Ca=setTimeout(Da,_a))}function ka(e){Sa=e,Ca!==null&&(clearTimeout(Ca),Ca=null),Da()}function Aa(e){let t=0;for(let n of e.layouts)n.builtIn||(t+=1);return t}function ja(e){return e.map(e=>({...e}))}function Ma(){return`user-`+Math.random().toString(16).slice(2,11)}function Na(){let[e,t]=(0,_.useState)(()=>xa().config),[n,r]=(0,_.useState)(null);(0,_.useEffect)(()=>Ta(e=>r(e)),[]),(0,_.useEffect)(()=>{Oa(e)},[e]);let i=e.layouts.find(t=>t.id===e.activeLayoutId)??e.layouts[0]??ra()[0],a=Aa(e)<12,o=(0,_.useCallback)(e=>{t(t=>t.layouts.some(t=>t.id===e)?{...t,activeLayoutId:e}:t)},[]),s=(0,_.useCallback)(e=>{t(t=>{let n=t.activeLayoutId;return{...t,layouts:t.layouts.map(t=>t.id===n?{...t,panels:ja(e)}:t)}})},[]),c=(0,_.useCallback)(e=>{let n=e.trim();n&&t(e=>{if(Aa(e)>=12)return e;let t=e.layouts.find(t=>t.id===e.activeLayoutId)??e.layouts[0];if(!t)return e;let r={id:Ma(),name:n,builtIn:!1,panels:ja(t.panels)};return{...e,activeLayoutId:r.id,layouts:[...e.layouts,r]}})},[]),l=(0,_.useCallback)(e=>{let n=e.trim();n&&t(e=>({...e,layouts:e.layouts.map(t=>t.id===e.activeLayoutId&&!t.builtIn?{...t,name:n}:t)}))},[]),u=(0,_.useCallback)(e=>{t(t=>{let n=t.layouts.find(t=>t.id===e);if(!n||n.builtIn)return t;let r=t.layouts.filter(t=>t.id!==e),i=t.activeLayoutId===e?r[0]?.id??na[0].id:t.activeLayoutId;return{...t,activeLayoutId:i,layouts:r}})},[]),d=(0,_.useCallback)(()=>{t(e=>{let t=e.layouts.find(t=>t.id===e.activeLayoutId);if(!t)return e;let n=aa(t.id)?na.find(e=>e.id===t.id):na[0];return n?{...e,layouts:e.layouts.map(e=>e.id===t.id?{...e,panels:ja(n.panels)}:e)}:e})},[]),f=(0,_.useCallback)(()=>JSON.stringify(e,null,2),[e]),p=(0,_.useCallback)(e=>{let n;try{n=JSON.parse(e)}catch{return{ok:!1,message:`Import failed: not valid JSON`}}let r=ha(n);if(r.fellBackToDefault)return{ok:!1,message:`Import rejected: schema invalid, no changes applied`};t(r.config),ka(r.config);let i=[`Layout imported`];return r.droppedPanels>0&&i.push(`${r.droppedPanels} unrecognized panel(s) dropped`),r.prunedLayouts>0&&i.push(`${r.prunedLayouts} excess layout(s) pruned`),{ok:!0,message:i.join(` · `)}},[]);return(0,_.useEffect)(()=>{e.layouts.length===0&&t(ia())},[e.layouts.length]),{config:e,activeLayout:i,canAddUserLayout:a,saveError:n,selectLayout:o,updateActivePanels:s,saveAs:c,renameActive:l,deleteLayout:u,resetActive:d,exportConfig:f,importConfig:p}}var Pa=new Set([`compact`,`end`,`stop`,`subagent-stop`,`close`]),Fa=Object.freeze([`session-lifecycle`]);function Ia(e){(0,_.useEffect)(()=>we(Fa),[]);let t=(0,_.useSyncExternalStore)(he,ge),[n,r]=(0,_.useState)(new Map),i=(0,_.useRef)(0);(0,_.useEffect)(()=>{let e=t.lifecycleRing;if(e.length<=i.current)return;let n=e.slice(i.current);i.current=e.length,La(n,r)},[t.lifecycleRing]);let a=(0,_.useRef)(void 0);return(0,_.useEffect)(()=>{!e||e===a.current||(a.current=e,La(e,r))},[e]),{closedAt:n,isBurstActive(e,t){let r=n.get(e);return r===void 0||t>r}}}function La(e,t){let n=e.filter(e=>Pa.has(e.event));n.length!==0&&t(e=>{let t=!1,r=new Map(e);for(let e of n){let n=r.get(e.session_key);(n===void 0||e.ts_ms>n)&&(r.set(e.session_key,e.ts_ms),t=!0)}return t?r:e})}function Ra(e){return`${e.client}:${e.agent_id??`solo`}`}var za=Object.freeze({allow:`#22c55e`,block:`#ef4444`,ask:`#f59e0b`,log:`#60a5fa`,force:`#a855f7`,shadow:`#6b7280`}),Ba=5*6e4,Va=1200,Ha=10*6e4,Ua=1440*60*1e3;function Wa(e,t){if(e.length===0)return t.slice();if(t.length===0)return e.slice();let n=new Set,r=[],i=0,a=0;for(;i<e.length&&a<t.length;){let o=e[i].ts_ms<=t[a].ts_ms?e[i++]:t[a++],s=Ga(o);n.has(s)||(n.add(s),r.push(o))}for(;i<e.length;i++){let t=Ga(e[i]);n.has(t)||(n.add(t),r.push(e[i]))}for(;a<t.length;a++){let e=Ga(t[a]);n.has(e)||(n.add(e),r.push(t[a]))}return r}function Ga(e){return e.audit_id??`${e.ts_ms}:${e.tool}:${e.client}`}function Ka(e,t){if(e.length===0)return t.slice();if(t.length===0)return e.slice();let n=new Set,r=[];for(let i of[...e,...t]){let e=`${i.session_key}:${i.ts_ms}:${i.event}`;n.has(e)||(n.add(e),r.push(i))}return r}function qa(e,t,n,r=200,i=Ha,a=8){let o=new Map,s=new Map;for(let r of e){if(r.ts_ms>n)break;let e=Ra(r);if(!t(e,r.ts_ms))continue;let i=o.get(e);i?i.push(r):o.set(e,[r]);let a=s.get(e);(a===void 0||r.ts_ms>a)&&s.set(e,r.ts_ms)}let c=n-i,l=[];for(let[e,t]of s)t<c&&l.push(e);for(let e of l)o.delete(e),s.delete(e);if(o.size>a){let e=new Set(Array.from(s.entries()).sort((e,t)=>t[1]-e[1]).slice(0,a).map(([e])=>e));for(let t of[...o.keys()])e.has(t)||o.delete(t)}let u=[];for(let e of o.values()){let t=e.length>r?e.slice(-r):e;u.push(...t)}return u.sort((e,t)=>e.ts_ms-t.ts_ms),u}function Ja(e={}){let t=e.windowMs??12e4,n=Oe(),r=ke(),[i,a]=(0,_.useState)(()=>({mode:`live`,playhead_ms:Date.now(),window_ms:t})),[o,s]=(0,_.useState)([]),[c,l]=(0,_.useState)([]),[u,d]=(0,_.useState)(!1),f=(0,_.useRef)(null),p=(0,_.useRef)(null);(0,_.useEffect)(()=>{if(i.mode!==`live`)return;let e=n.length>0?n[n.length-1].ts_ms:Date.now();e!==i.playhead_ms&&a(t=>({...t,playhead_ms:e}))},[i.mode,i.playhead_ms,n,r]);let m=(0,_.useMemo)(()=>Wa(o,n),[o,n,r]),{isBurstActive:h}=Ia(c),g=(0,_.useMemo)(()=>qa(m,h,i.playhead_ms),[m,h,i.playhead_ms]),v=m.length>0?m[0].ts_ms:i.playhead_ms,y=m.length>0?m[m.length-1].ts_ms:i.playhead_ms,b=(0,_.useCallback)(async e=>{if(p.current)return;let t=v,n=Math.min(t,(f.current??Date.now())-e);if(n>=t)return;let r=new AbortController;p.current=r,d(!0);try{let e=await fetch(`/api/json/graph/backfill?since_ms=${n}&until_ms=${t}&limit=500`,{signal:r.signal,credentials:`same-origin`});if(!e.ok)throw Error(`backfill ${e.status}`);let i=await e.json();Array.isArray(i.bursts)&&i.bursts.length>0&&s(e=>Wa(e,i.bursts)),Array.isArray(i.lifecycle)&&i.lifecycle.length>0&&l(e=>Ka(e,i.lifecycle)),f.current=n}catch(e){e.name!==`AbortError`&&console.warn(`[graph] backfill failed`,e)}finally{p.current=null,d(!1)}},[v]);(0,_.useEffect)(()=>{i.playhead_ms-v<i.window_ms*.5&&b(Ba)},[i.mode,i.playhead_ms,i.window_ms,v,b]);let x=(0,_.useRef)(!1);(0,_.useEffect)(()=>{x.current||(x.current=!0,b(Ua))},[]),(0,_.useEffect)(()=>()=>{p.current?.abort(),p.current=null},[]);let S=(0,_.useCallback)(e=>{a(t=>e===`live`?{...t,mode:`live`}:{...t,mode:e})},[]),C=(0,_.useCallback)(e=>{a(t=>({...t,mode:t.mode===`live`?`scrubbing`:t.mode,playhead_ms:e}))},[]),w=(0,_.useCallback)(e=>{a(t=>({...t,window_ms:Math.max(1e3,e)}))},[]),T=(0,_.useCallback)(()=>{a(e=>({...e,mode:`live`,playhead_ms:Date.now()}))},[]),E=(0,_.useCallback)(()=>{a(e=>({...e,mode:`live`,playhead_ms:Date.now(),window_ms:Ua})),b(Ua)},[b]);return{snapshot:(0,_.useMemo)(()=>({bursts:g,playback:i,oldest_known_ms:v,newest_known_ms:y,loading_backfill:u}),[g,i,v,y,u]),allBursts:m,setMode:S,setPlayhead:C,setWindow:w,jumpToLive:T,requestBackfill:b,jumpTo24h:E}}var Ya=2.3999632297286535,Xa=28,Za=22,Qa=.4,$a=20,eo=8,to=24,no=2*Math.PI/6e4,X=.2,ro=.82;function io(e,t,n,r=0){let i=new Map;for(let t of e){if(t.exitingAt!=null)continue;let e=i.get(t.session);e?e.push(t):i.set(t.session,[t])}if(i.size===0)return;for(let e of i.values())e.sort((e,t)=>e.ts_ms-t.ts_ms);let a=Math.min(t,n)-to,o=Array.from(i.keys()).sort(),s=o.length,c=0;for(let e of i.values())e.length>c&&(c=e.length);let l=Math.max(1,Math.min(Za,(a-Xa)/Math.max(1,c-1))),u=Xa,d=Xa+l,f=(u*u+d*d-$a*$a)/(2*u*d),p=Math.max(Qa,Math.acos(Math.min(1,Math.max(-1,f))));if(s<=eo)for(let e=0;e<s;e++){let a=o[e];if(a===void 0)continue;let c=i.get(a);if(!c)continue;let u=e*2*Math.PI/s+r;for(let e=0;e<c.length;e++){let r=c[e];if(!r)continue;let i=u+e*p,a=Xa+e*l;r.tx=t+a*Math.cos(i),r.ty=n+a*Math.sin(i)}}else{let e=[];for(let t of i.values())for(let n of t)e.push(n);e.sort((e,t)=>e.ts_ms-t.ts_ms);let o=Math.max(1,Math.min(Za,(a-Xa)/Math.max(1,e.length-1)));for(let i=0;i<e.length;i++){let a=e[i];if(!a)continue;let s=i*Ya+r,c=Xa+i*o;a.tx=t+c*Math.cos(s),a.ty=n+c*Math.sin(s)}}}function ao(e,t){for(let n of e)n.tx==null||n.ty==null||(n.vx=(n.vx+(n.tx-n.x)*X*t)*ro,n.vy=(n.vy+(n.ty-n.y)*X*t)*ro,n.x+=n.vx*t,n.y+=n.vy*t)}var oo=Object.freeze({repulsion:2500,springLength:80,springStiffness:.04,damping:.85,centeringStrength:.005,sessionCohesion:.01,width:800,height:600});function so(e){let t=new Map;for(let n of e){let e=t.get(n.session);e?(e.x+=n.x,e.y+=n.y,e.n+=1):t.set(n.session,{x:n.x,y:n.y,n:1})}for(let e of t.values())e.x/=e.n,e.y/=e.n;return t}function co(e,t,n,r){if(e.length===0)return;let i=new Map;for(let t of e)i.set(t.id,t);let a=so(e),o=n.width/2,s=n.height/2;for(let t of e)t.vx*=n.damping,t.vy*=n.damping;for(let t=0;t<e.length;t++){let i=e[t];if(i)for(let a=t+1;a<e.length;a++){let t=e[a];if(!t)continue;let o=i.x-t.x,s=i.y-t.y,c=o*o+s*s;c<1&&(c=1);let l=n.repulsion/c,u=Math.sqrt(c),d=o/u*l,f=s/u*l;i.vx+=d*r,i.vy+=f*r,t.vx-=d*r,t.vy-=f*r}}for(let e of t){let t=i.get(e.source),a=i.get(e.target);if(!t||!a)continue;let o=a.x-t.x,s=a.y-t.y,c=Math.sqrt(o*o+s*s)||1,l=(c-n.springLength)*n.springStiffness,u=o/c*l,d=s/c*l;t.vx+=u*r,t.vy+=d*r,a.vx-=u*r,a.vy-=d*r}for(let t of e){t.vx+=(o-t.x)*n.centeringStrength*r,t.vy+=(s-t.y)*n.centeringStrength*r;let e=a.get(t.session);e&&(t.vx+=(e.x-t.x)*n.sessionCohesion*r,t.vy+=(e.y-t.y)*n.sessionCohesion*r)}for(let t of e)t.vx>20&&(t.vx=20),t.vx<-20&&(t.vx=-20),t.vy>20&&(t.vy=20),t.vy<-20&&(t.vy=-20),t.x+=t.vx*r,t.y+=t.vy*r,t.x<20?(t.x=20,t.vx=Math.abs(t.vx)*.5):t.x>n.width-20&&(t.x=n.width-20,t.vx=-Math.abs(t.vx)*.5),t.y<20?(t.y=20,t.vy=Math.abs(t.vy)*.5):t.y>n.height-20&&(t.y=n.height-20,t.vy=-Math.abs(t.vy)*.5)}function lo(e,t){let n=[],r=new Map;for(let t of e){let e=r.get(t.session);e?e.push(t):r.set(t.session,[t])}for(let e of r.values()){e.sort((e,t)=>e.ts_ms-t.ts_ms);for(let r=1;r<e.length;r++){let i=e[r-1],a=e[r];!i||!a||a.ts_ms-i.ts_ms<=t&&n.push({source:i.id,target:a.id,kind:`session`})}}return n}function uo(e){let t=e|0;return()=>{t=t+1831565813|0;let e=t;return e=Math.imul(e^e>>>15,e|1),e^=e+Math.imul(e^e>>>7,e|61),((e^e>>>14)>>>0)/4294967296}}var fo={"claude-code":`C`,"claude-code-ide":`C`,cursor:`>`,copilot:`H`,codex:`X`,pi:`P`,gemini:`G`,antigravity:`A`};function po(e){return fo[e.toLowerCase()]??`.`}function mo(e){let t=0;for(let n=0;n<e.length;n++)t=Math.imul(t,31)+e.charCodeAt(n)|0;return(t>>>0)%360}function ho(e,t){for(let[n,r]of t){let{x:t,y:i,n:a}=r,o=50+Math.min(a,12)*7,s=mo(n),c=e.createRadialGradient(t,i,0,t,i,o);c.addColorStop(0,`hsla(${s},80%,55%,0.10)`),c.addColorStop(1,`hsla(${s},80%,55%,0)`),e.fillStyle=c,e.beginPath(),e.arc(t,i,o,0,Math.PI*2),e.fill()}}var go={block:{spikes:4,maxR:22},force:{spikes:8,maxR:32}};function _o(e,t,n,r,i,a){let o=go[i];if(!o)return;let{spikes:s,maxR:c}=o,l=c*r,u=Math.max(0,1-r)*.75;if(u<=0)return;let d=za[i]??`#6b7280`;e.save(),e.globalAlpha=u,e.strokeStyle=d,e.lineWidth=1.5,e.translate(t,n),e.rotate(a);let f=l*.28;e.beginPath();for(let t=0;t<s;t++){let n=t/s*Math.PI*2,r=n+Math.PI/s;t===0&&e.moveTo(Math.cos(r)*f,Math.sin(r)*f),e.lineTo(Math.cos(n)*l,Math.sin(n)*l),e.lineTo(Math.cos(r)*f,Math.sin(r)*f)}e.closePath(),e.stroke(),e.restore()}function vo(e,t,n,r,i,a,o){let s=8+a*r,c=Math.max(0,1-r)*o;c<=0||(e.save(),e.globalAlpha=c,e.fillStyle=i,e.beginPath(),e.arc(t,n,s,0,Math.PI*2),e.fill(),e.restore())}var yo=`9px ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace`,bo=`bold 10px ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace`;function xo(e,t,n,r,i,a,o){let s=(r.split(`:`)[0]??r).slice(0,18),c=po(s),l=mo(r),u=za[o]??`#6b7280`;e.save(),e.textAlign=`center`;let d=`[${c}] ${s}`,f=`${i.length>14?i.slice(0,14):i} · ${a}`;e.font=bo;let p=e.measureText(d).width;e.font=yo;let m=e.measureText(f).width,h=Math.max(p,m)+10;e.globalAlpha=.82,e.fillStyle=`hsla(${l},25%,5%,0.92)`,e.fillRect(t-h/2,n-2,h,28),e.globalAlpha=.92,e.fillStyle=`hsla(${l},78%,70%,1)`,e.font=bo,e.fillText(d,t,n+10),e.globalAlpha=.72,e.fillStyle=u,e.font=yo,e.fillText(f,t,n+21),e.restore()}function So(e,t,n,r,i,a,o){let s=r-t,c=i-n;if(Math.sqrt(s*s+c*c)<24)return;let l=Math.atan2(c,s),u=3.5,d=r-Math.cos(l)*9,f=i-Math.sin(l)*9;e.save(),e.globalAlpha=o*.85,e.fillStyle=a,e.translate(d,f),e.rotate(l),e.beginPath(),e.moveTo(0,0),e.lineTo(-6,-u),e.lineTo(-6,u),e.closePath(),e.fill(),e.restore()}var Co=240,wo=Array.from({length:Co},()=>({x:0,y:0,vx:0,vy:0,life:0,decay:.02,color:`#fff`,size:2})),To=0;function Eo(e,t,n,r,i=6){let a=uo(r);for(let r=0;r<i;r++){let o=To%Co;To++;let s=wo[o];if(!s)continue;let c=r/i*Math.PI*2+a()*.6,l=1.2+a()*2;s.x=e+(a()-.5)*4,s.y=t+(a()-.5)*4,s.vx=Math.cos(c)*l,s.vy=Math.sin(c)*l,s.life=1,s.decay=.016+a()*.014,s.color=n,s.size=1.5+a()*2}}function Do(e){for(let t of wo){if(t.life<=0)continue;t.x+=t.vx,t.y+=t.vy,t.vx*=.93,t.vy*=.93,t.life-=t.decay;let n=Math.max(0,t.life)*.65;n<=0||(e.globalAlpha=n,e.fillStyle=t.color,e.beginPath(),e.arc(t.x,t.y,Math.max(.1,t.size),0,Math.PI*2),e.fill())}e.globalAlpha=1}function Oo(){return{amplitude:0,startedAt:0,durationMs:0}}function ko(e,t,n){e.amplitude=t,e.startedAt=performance.now(),e.durationMs=n}function Ao(e,t,n){if(t.amplitude<=0)return!1;let r=performance.now()-t.startedAt;if(r>=t.durationMs)return!1;let i=t.amplitude*Math.max(0,1-r/t.durationMs);return e.translate((n()-.5)*i*2,(n()-.5)*i*2),!0}var jo=420,Mo=He(1.7),No=620,Po=We(1.2,.5),Fo=et({stiffness:90,damping:7,mass:1}),Io=2,Lo=150,Ro=!1,zo=!1;function Bo(){if(zo||typeof window>`u`)return;zo=!0;let e=navigator;typeof e.getBattery==`function`&&e.getBattery().then(e=>{let t=()=>{Ro=!e.charging&&e.level<.2};t(),e.addEventListener(`chargingchange`,t),e.addEventListener(`levelchange`,t)}).catch(()=>{})}function Vo(){return typeof window>`u`?!1:window.matchMedia?.(`(prefers-reduced-motion: reduce)`).matches||navigator.connection?.saveData?!0:Ro}var Ho=typeof window<`u`&&new URLSearchParams(window.location.search).get(`fullrate`)===`1`;function Uo(e,t,n,r){let i=new Map;for(let t of e)i.set(t.id,t);let a=new Set,o=[];for(let e=0;e<t.length;e++){let s=t[e],c=s.audit_id??`${s.ts_ms}:${s.tool}:${e}`;a.add(c);let l=i.get(c);if(l)l.burst=s,l.exitingAt=void 0,o.push(l);else{let t=uo(s.ts_ms^e),i=n*.6+(t()-.5)*60,a=r/2+(t()-.5)*40,l=Ra(s);o.push({id:c,burst:s,ts_ms:s.ts_ms,session:l,x:i,y:a,vx:(t()-.5)*2,vy:(t()-.5)*2,age:0,tx:i,ty:a})}}let s=performance.now();for(let t of e)a.has(t.id)||(t.exitingAt??=s,s-t.exitingAt<1200&&o.push(t));return o}function Wo(e){let{bursts:t,paused:n,selectedId:r,onSelect:i,burstSeq:a,layout:o=`spiral`,compact:s=!1,onFrameTime:c}=e,l=(0,_.useRef)(c);l.current=c;let u=(0,_.useRef)(null),d=(0,_.useRef)([]),f=(0,_.useRef)([]),p=(0,_.useRef)({...oo}),m=(0,_.useRef)(null),h=(0,_.useRef)(Oo()),[g,v]=(0,_.useState)({w:800,h:560}),y=(0,_.useRef)(null);(0,_.useEffect)(()=>{let e=u.current?.parentElement;if(!e)return;let t=new ResizeObserver(e=>{for(let t of e){let{width:e,height:n}=t.contentRect;v({w:Math.max(40,e),h:Math.max(40,n)})}});return t.observe(e),()=>t.disconnect()},[]),(0,_.useEffect)(()=>{let e=new Map;for(let t of d.current)e.set(t.id,t);if(d.current=Uo(d.current,t,g.w,g.h),o===`spiral`){io(d.current,g.w/2,g.h/2,performance.now()*no);for(let t of d.current)!e.has(t.id)&&t.tx!=null&&t.ty!=null&&(t.x=t.tx,t.y=t.ty)}if(f.current=lo(d.current,12e4),p.current.width=g.w,p.current.height=g.h,!pt())for(let t=0;t<d.current.length;t++){let n=d.current[t];if(!n||e.has(n.id))continue;let r=za[n.burst.decision]??`#6b7280`;Eo(n.x,n.y,r,n.burst.ts_ms^t),n.burst.decision===`block`?ko(h.current,4,280):n.burst.decision===`force`&&ko(h.current,6,280)}},[t,g.w,g.h,a,o]),(0,_.useEffect)(()=>{let e=u.current;if(!e)return;let t=e.getContext(`2d`);if(!t)return;Bo();let i=0,a=performance.now(),c=0,_=0,v=0,b=.1,x=!1,S=()=>{let u=performance.now();if(!Ho&&Vo()){if(c^=1,c===1){i=requestAnimationFrame(S);return}}else c!==0&&(c=0);let C=u,w=Math.min(50,C-a);a=C;let T=Math.max(.5,Math.min(2,w/16.67)),E=d.current,D=f.current;if(!n){let e=o===`force`&&E.length<=Lo;o===`force`&&E.length>Lo&&!x&&(x=!0,console.warn(`[graph] force layout exceeded ${Lo} nodes — falling back to spiral to protect frame budget`)),e?co(E,D,p.current,T):(io(E,p.current.width/2,p.current.height/2,C*no),ao(E,T))}for(let e of E)e.age<1&&(e.age=Math.min(1,e.age+w/jo));let O=Math.min(window.devicePixelRatio||1,Io),k=g.w,A=g.h;(e.width!==k*O||e.height!==A*O)&&(e.width=k*O,e.height=A*O,e.style.width=`${k}px`,e.style.height=`${A}px`,t.scale(O,O)),t.fillStyle=`#0a0a0f`,t.fillRect(0,0,k,A);let j=`${k}x${A}`,M=y.current?.key===j?y.current.grad:null;M||(M=t.createRadialGradient(k/2,A/2,0,k/2,A/2,Math.max(k,A)/1.2),M.addColorStop(0,`rgba(56, 189, 248, 0.06)`),M.addColorStop(1,`rgba(0, 0, 0, 0)`),y.current={key:j,grad:M}),t.fillStyle=M,t.fillRect(0,0,k,A);let ee=pt();if(t.save(),!ee){let e=uo((h.current.startedAt+C)*.01|0);Ao(t,h.current,e)}if(!s){let e=so(E);if(ho(t,e),!ee){let n=new Map,r=new Map;for(let e of E)e.exitingAt??(r.set(e.session,(r.get(e.session)??0)+1),n.set(e.session,e));for(let[i,a]of e){let e=n.get(i),o=r.get(i)??0;if(!e||o===0)continue;let s=50+Math.min(a.n,12)*7;xo(t,a.x,a.y-s-34,i,e.burst.tool,o,e.burst.decision)}}}let te=e=>e.exitingAt==null?1:Math.max(0,1-(C-e.exitingAt)/Va);ee||Do(t);let ne=new Map;for(let e of E)ne.set(e.id,e);t.lineWidth=2,t.lineCap=`round`,t.lineJoin=`round`;for(let e=0;e<D.length;e++){let n=D[e],r=ne.get(n.source),i=ne.get(n.target);if(!r||!i)continue;let a=za[i.burst.decision]??`#6b7280`,o=Math.min(te(r),te(i));if(o<=0)continue;if(t.globalAlpha=o,t.strokeStyle=a+`aa`,t.beginPath(),t.moveTo(r.x,r.y),t.lineTo(i.x,i.y),t.stroke(),!ee){let n=(C/1800+e*.618033)%1,s=r.x+(i.x-r.x)*n,c=r.y+(i.y-r.y)*n;t.save(),t.globalAlpha=o*Math.sin(n*Math.PI)*.9,t.fillStyle=a,t.beginPath(),t.arc(s,c,2.5,0,Math.PI*2),t.fill(),t.restore(),So(t,r.x,r.y,i.x,i.y,a,o)}let s=i.ts_ms-r.ts_ms,c=s<1e3?`${s}ms`:s<6e4?`${(s/1e3).toFixed(1)}s`:`${Math.floor(s/6e4)}m${Math.floor(s%6e4/1e3)}s`,l=(r.x+i.x)/2,u=(r.y+i.y)/2;t.save(),t.globalAlpha=o*.65,t.font=`8px ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace`,t.fillStyle=`#94a3b8`,t.textAlign=`center`,t.textBaseline=`middle`,t.fillText(c,l,u-7),t.restore()}t.globalAlpha=1;let N=new Set,P=new Set;if(n){let e=0;for(let t=E.length-1;t>=0&&e<5;t--){let n=E[t];!n||n.exitingAt!=null||(P.add(n.id),e++)}}else{let e=0,t=0;for(let n=E.length-1;n>=0;n--){let r=E[n];if(!(!r||r.exitingAt!=null)&&(e<10&&(N.add(r.id),e++),t<5&&(P.add(r.id),t++),e>=10&&t>=5))break}}let re=r,ie=m.current;for(let e of E){let n=te(e);if(n<=0)continue;t.globalAlpha=n;let r=Math.min(1,e.age),i=Mo(r),a=(6+2*Math.min(1,e.age))*i,o=za[e.burst.decision]??`#6b7280`;if((e.id===re||e.id===ie)&&(t.beginPath(),t.arc(e.x,e.y,a+6,0,Math.PI*2),t.fillStyle=o+`33`,t.fill()),!ee)if(e.burst.decision===`block`||e.burst.decision===`force`){let n=r;_o(t,e.x,e.y,n,e.burst.decision,C*.002)}else e.burst.decision===`allow`?vo(t,e.x,e.y,r,`#22c55e`,14,.3):e.burst.decision===`ask`&&vo(t,e.x,e.y,r,`#f59e0b`,14,.45);if(e.burst.decision===`block`||e.burst.decision===`force`){let n=r*jo;if(n<No){let r=n/No,i=a+16*Po(r),s=Math.max(0,1-r)*.75;t.beginPath(),t.arc(e.x,e.y,i,0,Math.PI*2),t.strokeStyle=o+Math.floor(s*255).toString(16).padStart(2,`0`),t.lineWidth=1.5,t.stroke()}}let s=!ee&&N.has(e.id);if(s&&(t.save(),t.shadowColor=o,t.shadowBlur=18*(1-r*.5)),t.beginPath(),t.arc(e.x,e.y,Math.max(.1,a),0,Math.PI*2),t.fillStyle=o,t.fill(),s&&(t.shadowBlur=0,t.restore()),t.strokeStyle=`#00000066`,t.lineWidth=1,t.stroke(),P.has(e.id)){t.font=`9px ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace`,t.textAlign=`center`,t.fillStyle=o+`cc`,t.fillText(po(e.burst.client),e.x,e.y-a-3);let n=e.burst.tool.length>12?e.burst.tool.slice(0,12):e.burst.tool;t.fillStyle=o+`88`,t.fillText(n,e.x,e.y+a+11),t.textAlign=`left`}(e.id===re||e.id===ie)&&(t.font=`11px ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace`,t.fillStyle=`#e0e7ff`,t.fillText(e.burst.tool,e.x+a+6,e.y+3))}if(t.globalAlpha=1,E.length>0&&!n){let e=null;for(let t=E.length-1;t>=0;t--)if(E[t].exitingAt==null){e=E[t];break}if(e){let n=1100,r=C%n/n,i=10+Fo.fn(r)*6,a=Math.max(0,1-r)*.9,o=Math.floor(a*200).toString(16).padStart(2,`0`);t.beginPath(),t.arc(e.x,e.y,i,0,Math.PI*2),t.strokeStyle=`#38bdf8${o}`,t.lineWidth=2,t.stroke()}}t.restore();let ae=performance.now()-u;_=_===0?ae:_*(1-b)+ae*b;let F=l.current;F&&C-v>1e3&&(v=C,F(_)),i=requestAnimationFrame(S)};return i=requestAnimationFrame(S),()=>cancelAnimationFrame(i)},[n,r,g.w,g.h,o,s]);function b(e,t){let n=u.current;if(!n)return null;let r=n.getBoundingClientRect(),i=e-r.left,a=t-r.top,o=null,s=200;for(let e of d.current){let t=e.x-i,n=e.y-a,r=t*t+n*n;r<s&&(s=r,o=e.id)}return o}return(0,U.jsxs)(`div`,{className:`relative w-full h-full rounded-sm border border-[var(--color-line-1)] overflow-hidden bg-black`,children:[(0,U.jsx)(`canvas`,{ref:u,className:`block w-full h-full cursor-crosshair`,onMouseMove:e=>{m.current=b(e.clientX,e.clientY)},onMouseLeave:()=>{m.current=null},onClick:e=>{i(b(e.clientX,e.clientY))}}),t.length===0&&(0,U.jsxs)(`div`,{className:`absolute inset-0 flex flex-col items-center justify-center pointer-events-none px-4 text-center`,children:[(0,U.jsx)(`p`,{className:`overline mb-2 text-[var(--color-fg-3)]`,children:`graph · idle`}),(0,U.jsxs)(`p`,{className:`text-[11px] font-mono text-[var(--color-fg-4)] max-w-[260px]`,children:[`Each dot = one tool call an AI agent made.`,(0,U.jsx)(`br`,{}),`Color = the ssg rule decision · line = same agent's sequence.`]})]})]})}var Go=3e4,Ko=6e4,qo=5e3;function Jo(e){let t=Date.now(),n=e.length>0?e[e.length-1]:null;if(!n||t-n.ts_ms>qo||!n)return{idle:!0,client:``,tool:``,ruleId:null,decision:``,evalsPerSec:`0.0`,allowPct:0,agents:0,topRules:[]};let r=e.filter(e=>t-e.ts_ms<=Go),i=r.filter(e=>e.decision===`allow`).length,a=r.length>0?Math.round(i/r.length*100):0,o=(r.length/(Go/1e3)).toFixed(1),s=new Set(r.map(e=>`${e.client}:${e.agent_id??`solo`}`)).size,c=e.filter(e=>t-e.ts_ms<=Ko&&e.rule_id),l=new Map;for(let e of c){let t=e.rule_id;t&&l.set(t,(l.get(t)??0)+1)}let u=[...l.entries()].sort((e,t)=>t[1]-e[1]).slice(0,4).map(([e])=>e);return{idle:!1,client:n.client,tool:n.tool,ruleId:n.rule_id,decision:n.decision,evalsPerSec:o,allowPct:a,agents:s,topRules:u}}var Yo={allow:`ALLOW`,block:`BLOCK`,ask:`ASK`,log:`LOG`,force:`FORCE`,shadow:`SHADOW`},Xo={allow:`#22c55e`,block:`#ef4444`,ask:`#f59e0b`,log:`#60a5fa`,force:`#a855f7`,shadow:`#6b7280`};function Zo({className:e}){let t=Oe(),n=ke(),r=(0,_.useRef)(-1),i=(0,_.useRef)(null),a=(0,_.useMemo)(()=>{if(r.current===n&&i.current)return i.current;r.current=n;let e=Jo(t);return i.current=e,e},[t,n]),o=a.decision?Xo[a.decision]??`#6b7280`:`#6b7280`,s=a.decision?Yo[a.decision]??a.decision:``,c=a.client?po(a.client):``;return a.idle?(0,U.jsxs)(`div`,{className:H(`pointer-events-none select-none`,`flex items-center justify-center gap-2`,`px-4 py-2 rounded-sm`,`bg-[#0a0a0f]/80 backdrop-blur-sm`,`border border-[var(--color-line-1,#242424)]`,`font-mono text-[11px] text-[var(--color-fg-4,#5a6071)]`,e),children:[(0,U.jsx)(`span`,{className:`status-dot bg-[var(--color-fg-4)] pulse-soft`}),(0,U.jsx)(`span`,{className:`uppercase tracking-wider`,children:`waiting for activity`})]}):(0,U.jsxs)(`div`,{className:H(`pointer-events-none select-none`,`flex flex-col gap-1 px-4 py-2.5 rounded-sm`,`bg-[#0a0a0f]/88 backdrop-blur-sm`,`border border-[var(--color-line-1,#242424)]`,`font-mono min-w-[280px] max-w-[460px]`,e),children:[(0,U.jsxs)(`div`,{className:`flex items-center gap-2 text-[10px] uppercase tracking-widest text-[var(--color-fg-4,#5a6071)]`,children:[(0,U.jsx)(`span`,{className:`status-dot bg-emerald-400 pulse-soft`}),(0,U.jsx)(`span`,{children:`now evaluating`}),(0,U.jsxs)(`span`,{className:`ml-auto tabular-nums`,children:[a.evalsPerSec,`/s · `,a.allowPct,`% allow · `,a.agents,` `,a.agents===1?`agent`:`agents`]})]}),(0,U.jsxs)(`div`,{className:`flex items-center gap-2 text-[14px] text-[var(--color-fg-0,#f5f5f5)] tracking-tight`,children:[(0,U.jsxs)(`span`,{className:`text-[var(--color-fg-3)] text-[11px] tabular-nums`,children:[`[`,c,`]`]}),(0,U.jsx)(`span`,{className:`text-sky-300`,children:a.client}),(0,U.jsx)(`span`,{className:`text-[var(--color-fg-3)]`,children:`·`}),(0,U.jsx)(`span`,{className:`text-white font-semibold`,children:a.tool}),a.ruleId&&(0,U.jsxs)(U.Fragment,{children:[(0,U.jsx)(`span`,{className:`text-[var(--color-fg-3)]`,children:`->`}),(0,U.jsx)(`span`,{className:`text-[var(--color-fg-2)] text-[12px]`,children:a.ruleId})]}),(0,U.jsx)(`span`,{className:`ml-auto text-[13px] font-bold tabular-nums`,style:{color:o},children:s})]}),a.topRules.length>0&&(0,U.jsxs)(`div`,{className:`flex items-center gap-1.5 text-[10px] text-[var(--color-fg-4)]`,children:[(0,U.jsx)(`span`,{className:`uppercase tracking-wider text-[9px]`,children:`rules`}),a.topRules.map(e=>(0,U.jsx)(`span`,{className:`px-1 py-0.5 rounded-sm bg-[var(--color-surface-2,#121212)] text-[var(--color-fg-3)]`,children:e},e))]})]})}function Qo(){let e=Oe(),t=ke(),[n,r]=(0,_.useState)(null),{isBurstActive:i}=Ia(),a=(0,_.useMemo)(()=>qa(e,i,Date.now()),[e,i,t]),o=(0,_.useMemo)(()=>{let e=new Map;for(let t of a){let n=`${t.client}:${t.agent_id??`solo`}`,r=e.get(n);r?r.count+=1:e.set(n,{client:t.client,count:1})}return e},[a]),s=(0,_.useMemo)(()=>{let e={allow:0,block:0,ask:0,other:0};for(let t of a)t.decision===`allow`?e.allow++:t.decision===`block`||t.decision===`force`?e.block++:t.decision===`ask`?e.ask++:e.other++;return e},[a]),c=(0,_.useMemo)(()=>{let e=new Set,t=0;for(let n of a)n.rule_id&&(e.add(n.rule_id),t+=1);return{distinct:e.size,matched:t,topRule:e.values().next().value}},[a]);return(0,U.jsxs)(`div`,{className:`flex flex-col h-full min-h-0 rounded-sm border border-[var(--color-line-1)] bg-[var(--color-surface-1)]`,children:[(0,U.jsxs)(`header`,{className:`flex items-center gap-2 px-3 py-1.5 border-b border-[var(--color-line-1)]`,children:[(0,U.jsx)(`span`,{className:`overline text-[var(--color-fg-3)]`,children:`graph · live`}),(0,U.jsxs)(`span`,{className:`flex items-center gap-1 text-[10px] font-mono text-[var(--color-fg-4)]`,children:[(0,U.jsx)(`span`,{className:`status-dot bg-emerald-400 pulse-soft`}),a.length]}),(0,U.jsxs)(`span`,{className:`flex items-center gap-1.5 text-[10px] font-mono`,children:[(0,U.jsx)(`span`,{className:`w-1.5 h-1.5 rounded-full`,style:{background:za.allow}}),(0,U.jsx)(`span`,{className:`text-[var(--color-fg-3)] tabular-nums`,children:s.allow}),(0,U.jsx)(`span`,{className:`w-1.5 h-1.5 rounded-full ml-1`,style:{background:za.block}}),(0,U.jsx)(`span`,{className:`text-[var(--color-fg-3)] tabular-nums`,children:s.block}),(0,U.jsx)(`span`,{className:`w-1.5 h-1.5 rounded-full ml-1`,style:{background:za.ask}}),(0,U.jsx)(`span`,{className:`text-[var(--color-fg-3)] tabular-nums`,children:s.ask})]}),(0,U.jsx)(`span`,{className:`flex-1`}),(0,U.jsxs)(`span`,{className:`chip text-violet-300 border-violet-500/30`,title:`${c.matched} tool calls matched ${c.distinct} ssg ${c.distinct===1?`rule`:`rules`} in active sessions`,children:[c.distinct,` `,c.distinct===1?`rule`:`rules`]}),(0,U.jsxs)(`span`,{className:`chip text-[var(--color-fg-3)] border-[var(--color-line-1)]`,title:o.size===0?`no active agents`:Array.from(o.entries()).map(([e,t])=>`${e}: ${t.count}`).join(`
|
|
10
|
-
`),children:[o.size,` `,o.size===1?`agent`:`agents`]}),(0,U.jsx)(`a`,{href:`/graph`,className:`text-[10px] font-mono uppercase tracking-wider text-sky-300 hover:text-sky-200`,title:`Open full /graph page`,children:`expand ↗`})]}),(0,U.jsxs)(`div`,{className:`flex-1 min-h-0 relative`,children:[(0,U.jsx)(Wo,{bursts:a,paused:!1,selectedId:n,onSelect:r,burstSeq:t,layout:`spiral`}),(0,U.jsx)(Zo,{className:`absolute bottom-2 left-2 z-10 max-w-[calc(100%-1rem)]`})]})]})}var $o=`ssg.sfx.enabled`;function es(){if(typeof window>`u`)return!1;try{return window.localStorage.getItem($o)===`true`}catch{return!1}}function ts(e){if(!(typeof window>`u`))try{window.localStorage.setItem($o,String(e))}catch{}}function ns(e,t,n,r,i,a,o=`sine`){try{let s=e.createOscillator(),c=e.createGain(),l=i/1e3;s.type=o,s.frequency.setValueAtTime(n,e.currentTime),s.frequency.exponentialRampToValueAtTime(Math.max(1,r),e.currentTime+l),c.gain.setValueAtTime(a,e.currentTime),c.gain.exponentialRampToValueAtTime(.001,e.currentTime+l),s.connect(c),c.connect(t),s.start(e.currentTime),s.stop(e.currentTime+l+.02)}catch{}}function rs(){let[e,t]=(0,_.useState)(es),n=(0,_.useRef)(null),r=(0,_.useRef)(null);return(0,_.useEffect)(()=>{let t=()=>{let t=n.current;t&&(document.hidden?t.suspend().catch(()=>{}):e&&t.resume().catch(()=>{}))};return document.addEventListener(`visibilitychange`,t),()=>document.removeEventListener(`visibilitychange`,t)},[e]),{enabled:e,toggle:(0,_.useCallback)(()=>{t(e=>{let t=!e;if(ts(t),t){if(!n.current)try{let e=new AudioContext,t=e.createGain();t.gain.value=.8,t.connect(e.destination),n.current=e,r.current=t}catch{}n.current?.resume().catch(()=>{})}else n.current?.suspend().catch(()=>{});return t})},[]),play:(0,_.useCallback)(t=>{if(!e)return;let i=n.current,a=r.current;if(!(!i||!a||i.state===`suspended`))switch(t){case`block`:ns(i,a,110,55,150,.08);break;case`force`:ns(i,a,80,40,200,.1),ns(i,a,160,80,200,.05,`square`);break;case`milestone`:{ns(i,a,660,880,100,.06);let e=i,t=a;setTimeout(()=>{e.state!==`suspended`&&ns(e,t,880,1320,100,.05)},115);break}case`record`:ns(i,a,880,1320,350,.07);break}},[e])}}function is(e){return!Number.isFinite(e)||e<=0?`—`:e<1e3?`${e} ns`:e<1e6?`${(e/1e3).toFixed(1)} µs`:`${(e/1e6).toFixed(2)} ms`}async function as(e,t){await fetch(`/api/decide/${e}?decision=${t}`,{method:`POST`,headers:Ae()})}var os=e=>!0,ss=e=>e.decision===`allow`,cs=e=>e.decision===`block`,ls=e=>e.decision===`ask`,us=e=>e.decision===`force`,ds=e=>e.decision===`log`;function fs(){let e=new Date;return e.setHours(0,0,0,0),e.getTime()}function ps(){let e=je([`counters-updated`,`activity-updated`,`pending-changed`,`runtime-tick`]),t=De(),n=ke(),r=Oe(),i=rs();(0,_.useEffect)(()=>{t&&(t.decision===`block`?i.play(`block`):t.decision===`force`&&i.play(`force`))},[n]);let[a,o]=(0,_.useState)(()=>fs());(0,_.useEffect)(()=>{let e=()=>{if(document.visibilityState!==`visible`)return;let e=fs();o(t=>e===t?t:e)};return document.addEventListener(`visibilitychange`,e),()=>document.removeEventListener(`visibilitychange`,e)},[]);let{data:s}=R(`/api/state/counters?since_ms=${a}`,[e[`counters-updated`],a]),{data:c}=R(`/api/state/runtime`,[e[`runtime-tick`]]),{data:l}=R(`/api/json/limits`,[e[`runtime-tick`]]),{data:u,refetch:d}=R(`/api/json/pending`,[e[`pending-changed`]]),{data:f}=R(`/api/json/blocked`,[e[`activity-updated`]]),p=Na(),[m,h]=(0,_.useState)(!1),g=(0,_.useMemo)(()=>{let e=s?.allow??0,n=s?.block??0,r=s?.ask??0,i=s?.log??0,a=s?.force??0,o=e+n+r+i+a,c=t?.counters.total??0;return t&&c>=o&&t?{allow:t.counters.allow,block:t.counters.block,ask:t.counters.ask,log:t.counters.log,force:t.counters.force,shadow:t.counters.shadow,total:t.counters.total}:{allow:e,block:n,ask:r,log:i,force:a,shadow:0,total:o}},[t,s]),v=(0,_.useMemo)(()=>{if(r.length===0)return 0;let e=Date.now()-1e4;return r.filter(t=>t.ts_ms>=e).length/10},[r]),y=c?.history?.cpu_pct??[],b=c?.history?.memory_rss_mb??[],x=[],S=c?.latency,C=(0,_.useMemo)(()=>({"hero-metrics":()=>(0,U.jsx)(`div`,{className:`grid-bleed rounded-sm border border-[var(--color-line-1)] bg-[var(--color-surface-1)] p-3 h-full`,children:(0,U.jsxs)(`div`,{className:`grid grid-cols-2 sm:grid-cols-3 lg:grid-cols-6 gap-3 h-full`,children:[(0,U.jsx)(kr,{label:`Total`,value:g.total,tone:`amber`,sub:t?is(t.duration_ns):void 0,burstRing:r,filter:os}),(0,U.jsx)(kr,{label:`Allow`,value:g.allow,tone:`green`,burstRing:r,filter:ss}),(0,U.jsx)(kr,{label:`Block`,value:g.block,tone:`red`,burstRing:r,filter:cs}),(0,U.jsx)(kr,{label:`Ask`,value:g.ask,tone:`amber`,burstRing:r,filter:ls}),(0,U.jsx)(kr,{label:`Force`,value:g.force,tone:`blue`,burstRing:r,filter:us}),(0,U.jsx)(kr,{label:`Log`,value:g.log,tone:`purple`,burstRing:r,filter:ds})]})}),graph:()=>(0,U.jsx)(Qo,{}),"latency-trace":()=>(0,U.jsx)(ei,{latency:S,bursts:r,gaugeMaxMs:10,windowMs:3e4,trendWindowSec:60,gaugeSize:200}),throughput:()=>(0,U.jsxs)(W,{className:`h-full`,children:[(0,U.jsxs)(G,{children:[(0,U.jsx)(`span`,{className:`overline`,children:`throughput · evals/s`}),(0,U.jsxs)(q,{variant:`blue`,children:[v.toFixed(1),`/s`]})]}),(0,U.jsxs)(K,{children:[(0,U.jsx)(xr,{value:v,width:360,height:96,windowMs:6e4,className:`w-full`}),(0,U.jsx)(`p`,{className:`overline mt-2 text-center`,children:`60-second rolling window`})]})]}),"decision-mix":()=>(0,U.jsxs)(W,{className:`h-full`,children:[(0,U.jsxs)(G,{children:[(0,U.jsx)(`span`,{className:`overline`,children:`decision mix`}),(0,U.jsx)(q,{variant:`gray`,children:g.total.toLocaleString()})]}),(0,U.jsx)(K,{children:(0,U.jsx)(ri,{counters:{allow:g.allow,block:g.block,ask:g.ask,log:g.log,force:g.force,shadow:g.shadow}})})]}),"telemetry-feed":()=>(0,U.jsxs)(W,{variant:`flush`,className:`h-full flex flex-col`,children:[(0,U.jsxs)(G,{children:[(0,U.jsx)(`span`,{className:`overline`,children:`telemetry · live · newest first`}),(0,U.jsxs)(`span`,{className:`text-[10px] font-mono text-[var(--color-fg-3)]`,children:[`hover to pause · scroll for history · `,r.length,` events buffered`]})]}),(0,U.jsx)(K,{className:`p-0 flex-1 min-h-0`,children:(0,U.jsx)(hi,{variant:`decision`,bursts:r,windowSize:80,height:360,className:`border-0 rounded-none`})})]}),"system-pulse":()=>(0,U.jsx)(ci,{cpuPct:c?.cpu_pct??0,cpuSeries:y,cpuLimit:l?.config.cpuLimitPct,memMb:c?.memory_rss_mb??0,memSeries:b,memLimit:l?.config.memoryLimitMb,heapUsedMb:c?.heap_used_mb??0,heapTotalMb:c?.heap_total_mb??0,heapSeries:x,uptimeSec:(c?.uptime_ms??0)/1e3}),"pending-approvals":()=>(0,U.jsxs)(W,{className:`h-full`,children:[(0,U.jsxs)(G,{children:[(0,U.jsx)(`span`,{className:`overline`,children:`pending approvals`}),(0,U.jsx)(q,{variant:u&&u.length>0?`amber`:`gray`,children:u?.length??0})]}),(0,U.jsx)(K,{children:u&&u.length>0?(0,U.jsx)(`ul`,{className:`space-y-2`,children:u.slice(0,5).map(e=>(0,U.jsxs)(`li`,{className:`flex items-center justify-between gap-2 border-b border-[var(--color-line-0)] last:border-b-0 py-1.5 text-[12px] font-mono`,children:[(0,U.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,U.jsxs)(`div`,{className:`text-[var(--color-fg-1)] truncate`,children:[e.toolCall.tool,` · `,e.ruleId]}),(0,U.jsx)(`div`,{className:`text-[var(--color-fg-3)] text-[11px] truncate`,children:ur(e.toolCall.tool,JSON.stringify(e.toolCall.input??{}))})]}),(0,U.jsxs)(`div`,{className:`flex gap-1 shrink-0`,children:[(0,U.jsx)(J,{size:`sm`,variant:`primary`,onClick:()=>as(e.id,`allow`).then(d),children:`allow`}),(0,U.jsx)(J,{size:`sm`,variant:`ghost`,onClick:()=>as(e.id,`block`).then(d),children:`block`})]})]},e.id))}):(0,U.jsx)(`p`,{className:`text-[11px] font-mono text-[var(--color-fg-4)] py-3 text-center`,children:`— no pending approvals —`})})]}),"recent-blocks":()=>(0,U.jsxs)(W,{className:`h-full`,children:[(0,U.jsxs)(G,{children:[(0,U.jsx)(`span`,{className:`overline`,children:`recent blocks & forces`}),(0,U.jsx)(q,{variant:f&&f.length>0?`red`:`gray`,children:f?.length??0})]}),(0,U.jsx)(K,{children:f&&f.length>0?(0,U.jsx)(`ul`,{className:`space-y-1.5`,children:f.slice(0,6).map((e,t)=>(0,U.jsxs)(`li`,{className:`flex items-center gap-2 text-[12px] font-mono border-b border-[var(--color-line-0)] last:border-b-0 py-1.5`,children:[(0,U.jsx)(q,{variant:e.decision===`force`?`amber`:`red`,children:e.decision}),(0,U.jsx)(`span`,{className:`text-[var(--color-fg-1)] truncate flex-1`,children:ur(e.tool,e.input)}),(0,U.jsx)(`span`,{className:`text-[var(--color-fg-3)] truncate text-[11px] max-w-[120px]`,children:e.rule_id??`—`})]},`${e.timestamp}-${t}`))}):(0,U.jsx)(`p`,{className:`text-[11px] font-mono text-[var(--color-fg-4)] py-3 text-center`,children:`— no recent blocks —`})})]})}),[g,t,r,S,v,c,y,b,x,l,u,f,d]),w=Mt({from:`first`,translateY:22,durationMs:640,staggerMs:80,maxStaggerMs:520});return(0,U.jsxs)(`div`,{ref:m?void 0:w,className:`space-y-5`,children:[(0,U.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,U.jsx)(`div`,{className:`flex-1`,children:(0,U.jsx)(Ji,{manager:p,isEditing:m,onToggleEditing:h})}),(0,U.jsx)(`button`,{type:`button`,onClick:i.toggle,className:`chip cursor-pointer hover:border-sky-500/50 hover:text-sky-300 transition-colors shrink-0`,title:i.enabled?`Mute stream sounds`:`Enable stream sounds`,children:i.enabled?`SFX ON`:`SFX OFF`})]}),(0,U.jsx)(qi,{panels:p.activeLayout.panels,isEditing:m,renderers:C,onPanelsChange:p.updateActivePanels})]})}function ms({val:e}){return e==null?(0,U.jsx)(`span`,{className:`text-[var(--color-fg-4)] italic font-mono text-xs`,children:`null`}):typeof e==`boolean`?(0,U.jsx)(`span`,{className:`inline-block font-mono text-[10px] font-medium uppercase tracking-wider px-1.5 py-0.5 rounded-sm border ${e?`bg-emerald-500/8 text-emerald-300 border-emerald-500/25`:`bg-red-500/8 text-red-300 border-red-500/25`}`,children:e.toString()}):typeof e==`number`?(0,U.jsx)(`span`,{className:`font-mono tabular-nums text-violet-300 text-xs`,children:e}):typeof e==`string`?e.length===0?(0,U.jsx)(`span`,{className:`text-[var(--color-fg-4)] italic text-xs font-mono`,children:`empty string`}):e.length>200?(0,U.jsx)(`pre`,{className:`text-[11px] font-mono text-[var(--color-fg-1)] whitespace-pre-wrap break-all bg-[var(--color-surface-0)] border border-[var(--color-line-1)] rounded-sm p-2 max-h-40 overflow-y-auto`,children:e}):(0,U.jsx)(`span`,{className:`font-mono text-xs text-[var(--color-fg-1)] break-all`,children:e}):(0,U.jsx)(`pre`,{className:`text-[11px] font-mono text-[var(--color-fg-1)] whitespace-pre-wrap break-all bg-[var(--color-surface-0)] border border-[var(--color-line-1)] rounded-sm p-2 max-h-40 overflow-y-auto`,children:JSON.stringify(e,null,2)})}function hs({inputJson:e}){let t=[];try{let n=JSON.parse(e);n&&typeof n==`object`&&!Array.isArray(n)&&(t=Object.entries(n))}catch{return(0,U.jsx)(`pre`,{className:`text-[11px] font-mono text-[var(--color-fg-1)] whitespace-pre-wrap break-all bg-[var(--color-surface-0)] border border-[var(--color-line-1)] rounded-sm p-2`,children:e})}return t.length===0?(0,U.jsx)(`span`,{className:`text-[var(--color-fg-4)] text-xs italic font-mono`,children:`no input fields`}):(0,U.jsx)(`div`,{className:`rounded-sm border border-[var(--color-line-1)] overflow-hidden text-xs`,children:t.map(([e,t],n)=>(0,U.jsxs)(`div`,{className:`flex gap-0 ${n>0?`border-t border-[var(--color-line-0)]`:``}`,children:[(0,U.jsx)(`div`,{className:`w-40 shrink-0 px-3 py-2 bg-[var(--color-surface-0)] text-[var(--color-fg-3)] font-mono text-[11px] border-r border-[var(--color-line-0)] select-none`,children:e}),(0,U.jsx)(`div`,{className:`flex-1 min-w-0 px-3 py-2 leading-relaxed`,children:(0,U.jsx)(ms,{val:t})})]},e))})}var gs={allow:`green`,block:`red`,force:`amber`,ask:`blue`,log:`gray`},_s={allow:`border-l-emerald-500/60`,block:`border-l-red-500/60`,force:`border-l-amber-400/60`,ask:`border-l-sky-500/60`,log:`border-l-[var(--color-line-2)]`};function vs(e){return e==null?null:e<1e6?`${(e/1e3).toFixed(0)}µs`:`${(e/1e6).toFixed(1)}ms`}function ys({label:e,value:t,mono:n,children:r}){return(0,U.jsxs)(`div`,{children:[(0,U.jsx)(`div`,{className:`overline mb-1`,children:e}),r??(0,U.jsx)(`span`,{className:`text-[var(--color-fg-1)] text-xs ${n?`font-mono`:``} break-all`,children:t??`—`})]})}function bs({text:e}){let[t,n]=(0,_.useState)(!1);return(0,U.jsx)(`button`,{onClick:async t=>{t.stopPropagation();try{await navigator.clipboard.writeText(e),n(!0),setTimeout(()=>n(!1),1500)}catch{}},className:`text-[10px] font-mono uppercase tracking-wider text-[var(--color-fg-3)] hover:text-[var(--color-fg-1)] border border-[var(--color-line-1)] hover:border-[var(--color-line-2)] rounded-sm px-2 py-1 transition-colors cursor-pointer`,children:t?`✓ copied`:`copy json`})}function xs({row:e,defaultExpanded:t=!1}){let[n,r]=(0,_.useState)(t),i=(0,_.useRef)(null),a=(0,_.useRef)(!0),o=ur(e.tool,e.input),s=gs[e.decision]??`gray`,c=_s[e.decision]??`border-l-[var(--color-line-2)]`,l=lr(e.timestamp),u=vs(e.duration_ns);(0,_.useEffect)(()=>{let e=i.current;if(e){if(a.current){a.current=!1,n||(e.style.maxHeight=`0`,e.style.opacity=`0`);return}if(pt()){e.style.maxHeight=n?`none`:`0`,e.style.opacity=n?`1`:`0`;return}if(n){let t=e.scrollHeight;jt(e,{"max-height":[`0px`,`${t}px`],opacity:[0,1],translateY:[-6,0],duration:260,ease:`outCubic`,onComplete:()=>{e.style.maxHeight=`none`}})}else{let t=e.scrollHeight;jt(e,{"max-height":[`${t}px`,`0px`],opacity:[1,0],duration:180,ease:`outCubic`})}}},[n]);let d=(()=>{try{return JSON.stringify(JSON.parse(e.input),null,2)}catch{return e.input}})();return(0,U.jsxs)(`div`,{className:`border border-[var(--color-line-1)] border-l-2 ${c} rounded-sm bg-[var(--color-surface-1)] overflow-hidden transition-colors hover:border-[var(--color-line-2)] hover:border-l-2`,children:[(0,U.jsxs)(`div`,{className:`flex items-center gap-3 px-3 py-2 cursor-pointer select-none group`,onClick:()=>r(e=>!e),role:`button`,"aria-expanded":n,children:[(0,U.jsx)(`svg`,{className:`shrink-0 text-[var(--color-fg-4)] group-hover:text-[var(--color-fg-2)] transition-all ${n?`rotate-90`:``}`,width:`10`,height:`10`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2.5`,strokeLinecap:`round`,strokeLinejoin:`round`,children:(0,U.jsx)(`polyline`,{points:`9 18 15 12 9 6`})}),(0,U.jsx)(`time`,{className:`shrink-0 font-mono text-[11px] text-[var(--color-fg-3)] w-14 tabular-nums`,title:l,dateTime:new Date(e.timestamp*1e3).toISOString(),children:cr(e.timestamp)}),(0,U.jsx)(q,{variant:s,className:`shrink-0`,children:e.decision}),(0,U.jsx)(`code`,{className:`shrink-0 text-[11px] text-[var(--color-brand)] font-mono`,children:e.tool}),o&&(0,U.jsx)(`span`,{className:`flex-1 min-w-0 text-[11px] text-[var(--color-fg-2)] font-mono truncate`,title:o,children:o}),(0,U.jsx)(`span`,{className:`shrink-0 text-[10px] font-mono text-[var(--color-fg-4)] ml-auto pl-2 uppercase tracking-wider`,title:e.client?`client: ${e.client}`:`client: unidentified`,children:e.client??`—`})]}),(0,U.jsx)(`div`,{ref:i,className:`border-t border-[var(--color-line-0)] overflow-hidden`,style:{maxHeight:n?`none`:`0`,opacity:n?1:0},"aria-hidden":!n,children:n&&(0,U.jsxs)(`div`,{className:`px-3 py-3 space-y-4`,children:[(0,U.jsxs)(`div`,{className:`grid grid-cols-2 sm:grid-cols-3 lg:grid-cols-4 gap-x-6 gap-y-3`,children:[(0,U.jsx)(ys,{label:`Timestamp`,value:l}),(0,U.jsx)(ys,{label:`Decision`,children:(0,U.jsx)(q,{variant:s,children:e.decision})}),(0,U.jsx)(ys,{label:`Tool`,children:(0,U.jsx)(`code`,{className:`text-xs font-mono text-[var(--color-brand)]`,children:e.tool})}),e.client&&(0,U.jsx)(ys,{label:`Client`,value:e.client}),e.rule_id&&(0,U.jsx)(ys,{label:`Rule ID`,children:(0,U.jsx)(`a`,{href:`/rules?highlight=${encodeURIComponent(e.rule_id)}`,className:`text-xs text-[var(--color-brand)] hover:underline font-mono`,onClick:e=>e.stopPropagation(),children:e.rule_id})}),e.source_file&&(0,U.jsx)(ys,{label:`Source File`,value:e.source_file,mono:!0}),u&&(0,U.jsx)(ys,{label:`Latency`,value:u,mono:!0}),e.rules_evaluated!=null&&(0,U.jsx)(ys,{label:`Rules Evaluated`,value:`${e.rules_evaluated}`,mono:!0})]}),(0,U.jsxs)(`div`,{children:[(0,U.jsx)(`div`,{className:`overline mb-2`,children:`Tool Input`}),(0,U.jsx)(hs,{inputJson:e.input})]}),(0,U.jsxs)(`div`,{className:`flex items-center justify-between`,children:[e.rule_id?(0,U.jsx)(`a`,{href:`/rules?highlight=${encodeURIComponent(e.rule_id)}`,className:`text-[10px] font-mono uppercase tracking-wider text-[var(--color-brand)]/70 hover:text-[var(--color-brand)] transition-colors`,onClick:e=>e.stopPropagation(),children:`→ view rule`}):(0,U.jsx)(`span`,{}),(0,U.jsx)(bs,{text:d})]})]})})]})}function Ss({className:e,children:t,...n}){return(0,U.jsx)(`pre`,{className:H(`bg-[var(--color-surface-0)] border border-[var(--color-line-1)] rounded-sm px-3 py-2 text-[11px] leading-relaxed font-mono text-[var(--color-fg-1)] overflow-x-auto whitespace-pre-wrap break-all`,e),...n,children:t})}var Cs={neutral:`text-[var(--color-fg-0)]`,green:`text-emerald-300`,red:`text-red-300`,amber:`text-amber-300`,blue:`text-sky-300`,purple:`text-violet-300`,gray:`text-[var(--color-fg-3)]`},ws={neutral:`bg-[var(--color-fg-3)]`,green:`bg-emerald-500`,red:`bg-red-500`,amber:`bg-[var(--color-brand)]`,blue:`bg-sky-500`,purple:`bg-violet-500`,gray:`bg-[var(--color-line-2)]`},Ts=[{label:`User code`,color:`#451a03`},{label:`Runtime (bun:/node:)`,color:`#172554`},{label:`Native/other`,color:`#1f2937`},{label:`GC/idle`,color:`#450a0a`}];function Es({label:e,value:t,sub:n,tone:r=`neutral`,align:i=`left`,labelPlacement:a=`above`,labelClassName:o,valueClassName:s,subClassName:c}){let l=(0,U.jsx)(`div`,{className:H(a===`above`?`overline mb-1.5`:`mt-1 text-[11px] text-[var(--color-fg-3)]`,o),children:e});return(0,U.jsxs)(U.Fragment,{children:[a===`above`&&l,(0,U.jsx)(`div`,{className:H(`font-mono font-medium tabular-nums`,i===`center`&&`text-center`,Cs[r],s),children:t}),a===`below`&&l,n&&(0,U.jsx)(`div`,{className:H(`mt-1 text-[10px] font-mono text-[var(--color-fg-3)]`,i===`center`&&`text-center`,c),children:n})]})}function Ds({className:e,contentClassName:t,label:n,value:r,sub:i,tone:a,align:o,labelPlacement:s,labelClassName:c,valueClassName:l,subClassName:u,...d}){return(0,U.jsx)(W,{className:e,...d,children:(0,U.jsx)(K,{className:H(`py-3`,o===`center`&&`text-center`,t),children:(0,U.jsx)(Es,{label:n,value:r,sub:i,tone:a,align:o,labelPlacement:s,labelClassName:c,valueClassName:l,subClassName:u})})})}function Os({className:e,...t}){return(0,U.jsx)(`div`,{className:H(`rounded-sm border border-[var(--color-line-0)] bg-[var(--color-surface-1)] p-3`,t.align===`center`&&`text-center`,e),children:(0,U.jsx)(Es,{...t})})}function ks({pct:e,tone:t=`green`,markerPct:n,className:r,barClassName:i,markerTitle:a}){let o=Math.max(0,Math.min(100,e)),s=n===void 0?null:Math.max(0,Math.min(100,n));return(0,U.jsxs)(`div`,{className:H(`relative w-full overflow-hidden rounded-sm bg-[var(--color-surface-3)]`,r),children:[(0,U.jsx)(`div`,{className:H(`h-full rounded-sm transition-all duration-500`,ws[t],i),style:{width:`${o}%`}}),s!==null&&(0,U.jsx)(`div`,{className:`absolute top-0 h-full w-0.5 bg-[var(--color-brand)]/70`,style:{left:`${s}%`},title:a})]})}function As({label:e,value:t,tone:n=`neutral`,breached:r=!1,breachLabel:i=`limit exceeded`,trendData:a,trendColor:o,threshold:s,maxValue:c,footer:l,className:u,valueClassName:d}){return(0,U.jsxs)(W,{className:u,children:[(0,U.jsxs)(G,{className:`py-2`,children:[(0,U.jsx)(`span`,{className:`overline`,children:e}),r&&(0,U.jsx)(`span`,{className:`text-[10px] font-mono uppercase tracking-wider text-red-300`,children:i})]}),(0,U.jsxs)(K,{children:[(0,U.jsxs)(`div`,{className:`flex items-center justify-between gap-3`,children:[(0,U.jsx)(`div`,{className:H(`text-2xl font-mono font-medium tabular-nums`,Cs[n],d),children:t}),(a?.length??0)>1&&o&&(0,U.jsx)(yr,{data:a??[],width:80,height:28,color:o,threshold:s,maxValue:c})]}),l]})]})}function js({profile:e,children:t}){return(0,U.jsxs)(`div`,{className:`space-y-2`,children:[(0,U.jsxs)(`div`,{className:`flex items-center gap-4 text-[11px] font-mono text-[var(--color-fg-3)]`,children:[(0,U.jsxs)(`span`,{children:[`nodes:`,` `,(0,U.jsx)(`span`,{className:`text-[var(--color-fg-1)]`,children:e.nodes.length})]}),(0,U.jsxs)(`span`,{children:[`duration:`,` `,(0,U.jsxs)(`span`,{className:`text-[var(--color-fg-1)]`,children:[((e.endTime-e.startTime)/1e3).toFixed(0),`ms`]})]}),(0,U.jsxs)(`span`,{children:[`samples:`,` `,(0,U.jsx)(`span`,{className:`text-[var(--color-fg-1)]`,children:e.samples?.length??0})]})]}),(0,U.jsx)(`div`,{className:`flex gap-3 text-[10px] font-mono text-[var(--color-fg-3)]`,children:Ts.map(e=>(0,U.jsxs)(`span`,{className:`flex items-center`,children:[(0,U.jsx)(`span`,{className:`mr-1 inline-block h-2.5 w-2.5 rounded-[1px]`,style:{background:e.color}}),e.label]},e.label))}),t]})}function Ms({memory:e,formatValue:t}){return(0,U.jsx)(`div`,{className:`grid grid-cols-4 gap-3`,children:[{label:`RSS`,value:t(e.rss)},{label:`Heap Total`,value:t(e.heapTotal)},{label:`Heap Used`,value:t(e.heapUsed)},{label:`External`,value:t(e.external)}].map(e=>(0,U.jsx)(Os,{align:`center`,label:e.label,value:e.value,valueClassName:`text-lg font-medium text-[var(--color-fg-0)]`},e.label))})}var Ns=3;function Ps(e){return e===null?`—`:e<1e6?`${(e/1e3).toFixed(0)}µs`:`${(e/1e6).toFixed(1)}ms`}var Fs=[`counters-updated`,`activity-updated`,`pending-changed`,`runtime-tick`,`limits-breach`];function Is({info:e}){let t=e.tier===`pro`||e.tier===`enterprise`,n=e.status===`needs_reauth`,r=e.pct_used??0,i=r>=90?`bg-red-500`:r>=70?`bg-amber-500`:`bg-emerald-500`;return(0,U.jsxs)(W,{className:n?`border-l-2 border-l-amber-500/70`:t?`border-l-2 border-l-emerald-500/70`:`border-l-2 border-l-sky-500/70`,children:[(0,U.jsxs)(G,{children:[(0,U.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,U.jsx)(`span`,{className:`text-xs font-mono uppercase tracking-wider text-[var(--color-fg-3)]`,children:`license`}),(0,U.jsx)(q,{variant:t?`green`:n?`amber`:`blue`,children:e.tier_label}),e.fleet_enrolled&&(0,U.jsx)(q,{variant:`gray`,children:`fleet`})]}),e.email&&(0,U.jsx)(`span`,{className:`text-xs text-[var(--color-fg-3)]`,children:e.email})]}),(0,U.jsxs)(K,{className:`space-y-3`,children:[n&&e.detail&&(0,U.jsxs)(`div`,{className:`rounded border border-amber-500/40 bg-amber-500/10 px-3 py-2 text-xs text-amber-200`,children:[e.detail,` — run `,(0,U.jsx)(`code`,{className:`font-mono`,children:`ssg auth login`})]}),(0,U.jsxs)(`div`,{children:[(0,U.jsxs)(`div`,{className:`flex justify-between text-xs text-[var(--color-fg-2)]`,children:[(0,U.jsx)(`span`,{children:`evals today`}),(0,U.jsxs)(`span`,{children:[e.evals_today.toLocaleString(),e.eval_daily_limit!==null&&(0,U.jsxs)(U.Fragment,{children:[(0,U.jsx)(`span`,{className:`text-[var(--color-fg-3)]`,children:` / `}),e.eval_daily_limit.toLocaleString()]}),e.eval_daily_limit===null&&(0,U.jsx)(`span`,{className:`text-[var(--color-fg-3)]`,children:` · unlimited`})]})]}),e.eval_daily_limit!==null&&(0,U.jsx)(`div`,{className:`mt-1 h-1.5 w-full overflow-hidden rounded-full bg-[var(--color-bg-2)]`,children:(0,U.jsx)(`div`,{className:`h-full transition-all ${i}`,style:{width:`${r}%`}})})]}),!t&&(0,U.jsxs)(`a`,{href:e.upgrade_url,target:`_blank`,rel:`noopener noreferrer`,className:`inline-flex items-center gap-1 text-xs text-[var(--color-brand)] hover:underline`,children:[`Upgrade to Pro · $`,e.pricing.pro_monthly_usd,`/mo →`]}),t&&e.retention_days>0&&(0,U.jsxs)(`div`,{className:`text-[10px] text-[var(--color-fg-3)] font-mono uppercase tracking-wider`,children:[`cloud retention: `,e.retention_days,` days`]})]})]})}function Ls(e){return new Date(e*1e3).toLocaleTimeString()}async function Rs(e,t){await fetch(`/api/decide/${e}?decision=${t}`,{method:`POST`,headers:Ae()})}async function zs(e,t){let n=await fetch(`/api/rules/toggle`,{method:`POST`,headers:{"Content-Type":`application/json`,Accept:`application/json`,...Ae()},body:JSON.stringify({ruleId:e,file:t})});if(!n.ok)throw Error(`Toggle failed: ${n.status}`)}async function Bs(e,t){let n=await fetch(`/api/rules/toggle`,{method:`POST`,headers:{"Content-Type":`application/json`,Accept:`application/json`,...Ae()},body:JSON.stringify({ruleId:e,file:t})});if(!n.ok)throw Error(`Toggle failed: ${n.status}`)}async function Vs(e,t){let n=await fetch(`/api/rules/update-decision`,{method:`POST`,headers:{"Content-Type":`application/json`,...Ae()},body:JSON.stringify({ruleId:e,file:t,decision:`ask`})});if(!n.ok)throw Error(`Update decision failed: ${n.status}`)}async function Hs(e,t){let n=await fetch(`/api/rules/update-decision`,{method:`POST`,headers:{"Content-Type":`application/json`,...Ae()},body:JSON.stringify({ruleId:e,file:t,decision:`block`})});if(!n.ok)throw Error(`Update decision failed: ${n.status}`)}function Us({ruleId:e}){return e?(0,U.jsx)(`a`,{href:`/rules?highlight=${encodeURIComponent(e)}`,className:`text-[var(--color-brand)] hover:underline text-xs font-mono break-all`,title:`Go to rule: ${e}`,children:e}):(0,U.jsx)(`span`,{className:`text-[var(--color-fg-4)]`,children:`—`})}function Ws({title:e,right:t}){return(0,U.jsxs)(`div`,{className:`flex items-center justify-between mb-3`,children:[(0,U.jsx)(`h2`,{className:`overline text-[11px]`,children:e}),t]})}function Gs({children:e}){return(0,U.jsx)(`div`,{className:`rounded-sm border border-dashed border-[var(--color-line-1)] bg-[var(--color-surface-1)]/50 px-4 py-6 text-center text-[11px] font-mono text-[var(--color-fg-3)]`,children:e})}function Ks({item:e,onDisable:t,onChangeToAsk:n,onUndo:r}){let[i,a]=(0,_.useState)(!1),[o,s]=(0,_.useState)(`idle`),[c,l]=(0,_.useState)(!1),u=ur(e.tool,e.input),d=e.rule_id&&e.source_file,f=e.decision===`force`?`force`:`block`,p=f===`force`?`amber`:`red`,m=async()=>{s(`loading`);try{await n(),s(`done-ask`)}catch{s(`error`)}},h=async()=>{s(`loading`);try{await t(),s(`done-disable`)}catch{s(`error`)}},g=async()=>{l(!0);try{await r(o===`done-disable`?`disable`:`ask`),s(`idle`)}catch{}finally{l(!1)}},v=o===`done-ask`||o===`done-disable`;return(0,U.jsx)(W,{className:`border-l-2 ${v?`border-l-[var(--color-line-1)]`:f===`force`?`border-l-amber-400/60`:`border-l-red-500/60`} ${v?`opacity-60`:``}`,children:(0,U.jsxs)(`div`,{className:`px-3 py-3`,children:[v&&(0,U.jsxs)(`div`,{className:`flex items-center justify-between rounded-sm px-2.5 py-1.5 mb-3 text-[11px] font-mono ${o===`done-ask`?`bg-sky-500/5 border border-sky-500/25 text-sky-300`:`bg-amber-500/5 border border-amber-500/25 text-amber-300`}`,children:[(0,U.jsx)(`span`,{className:`truncate`,children:o===`done-ask`?`✓ rule "${e.rule_id}" → ask · prompts next time`:`✓ rule "${e.rule_id}" disabled · no longer blocks`}),(0,U.jsx)(`button`,{onClick:g,disabled:c,className:`ml-3 shrink-0 px-2 py-0.5 rounded-sm border border-current/40 hover:bg-white/5 transition-colors cursor-pointer disabled:opacity-50 uppercase tracking-wider text-[10px]`,children:c?`…`:`↩ undo`})]}),o===`error`&&(0,U.jsxs)(`div`,{className:`flex items-center justify-between rounded-sm px-2.5 py-1.5 mb-3 text-[11px] font-mono bg-red-500/5 border border-red-500/25 text-red-300`,children:[(0,U.jsx)(`span`,{children:`failed to update rule — check server logs`}),(0,U.jsx)(`button`,{onClick:()=>s(`idle`),className:`ml-3 shrink-0 px-2 py-0.5 rounded-sm border border-current/40 hover:bg-white/5 transition-colors cursor-pointer uppercase tracking-wider text-[10px]`,children:`retry`})]}),(0,U.jsxs)(`div`,{className:`flex items-start justify-between gap-3`,children:[(0,U.jsxs)(`div`,{className:`flex-1 min-w-0`,children:[(0,U.jsxs)(`div`,{className:`flex items-center gap-2 mb-1.5 flex-wrap`,children:[(0,U.jsx)(q,{variant:v?o===`done-ask`?`blue`:`gray`:p,children:v?o===`done-ask`?`ask`:`disabled`:f}),(0,U.jsx)(`code`,{className:`text-[var(--color-brand)] text-xs font-mono`,children:e.tool}),(0,U.jsx)(`span`,{className:`text-[var(--color-fg-4)] text-xs`,children:`·`}),(0,U.jsx)(`span`,{className:`text-[var(--color-fg-3)] text-[11px] font-mono tabular-nums`,children:Ls(e.timestamp)}),e.repeat_count>1&&(0,U.jsxs)(q,{variant:`gray`,children:[`×`,e.repeat_count]})]}),(0,U.jsx)(`div`,{className:`text-xs font-mono truncate cursor-pointer hover:text-[var(--color-fg-0)] transition-colors ${v?`text-[var(--color-fg-4)] line-through`:`text-[var(--color-fg-1)]`}`,title:u,onClick:()=>a(e=>!e),children:u})]}),d&&!v&&o!==`error`&&(0,U.jsxs)(`div`,{className:`flex items-center gap-1.5 shrink-0 pt-0.5`,children:[(0,U.jsxs)(`button`,{onClick:m,disabled:o===`loading`,className:`inline-flex items-center gap-1 h-7 px-2.5 rounded-sm text-[11px] font-medium uppercase tracking-wider bg-sky-500/8 text-sky-300 border border-sky-500/25 hover:bg-sky-500/15 hover:border-sky-500/40 transition-colors cursor-pointer disabled:opacity-50 disabled:cursor-not-allowed`,children:[o===`loading`?(0,U.jsx)(`span`,{className:`animate-spin`,children:`⟳`}):(0,U.jsxs)(`svg`,{width:`11`,height:`11`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2.5`,strokeLinecap:`round`,strokeLinejoin:`round`,children:[(0,U.jsx)(`circle`,{cx:`12`,cy:`12`,r:`10`}),(0,U.jsx)(`path`,{d:`M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3`}),(0,U.jsx)(`line`,{x1:`12`,y1:`17`,x2:`12.01`,y2:`17`})]}),`ask instead`]}),(0,U.jsxs)(`button`,{onClick:h,disabled:o===`loading`,className:`inline-flex items-center gap-1 h-7 px-2.5 rounded-sm text-[11px] font-medium uppercase tracking-wider bg-red-500/8 text-red-300 border border-red-500/25 hover:bg-red-500/15 hover:border-red-500/40 transition-colors cursor-pointer disabled:opacity-50 disabled:cursor-not-allowed`,children:[o===`loading`?(0,U.jsx)(`span`,{className:`animate-spin`,children:`⟳`}):(0,U.jsxs)(`svg`,{width:`11`,height:`11`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2.5`,strokeLinecap:`round`,strokeLinejoin:`round`,children:[(0,U.jsx)(`circle`,{cx:`12`,cy:`12`,r:`10`}),(0,U.jsx)(`line`,{x1:`15`,y1:`9`,x2:`9`,y2:`15`}),(0,U.jsx)(`line`,{x1:`9`,y1:`9`,x2:`15`,y2:`15`})]}),`disable rule`]})]})]}),(0,U.jsxs)(`div`,{className:`flex flex-wrap items-center gap-x-4 gap-y-1 mt-2 text-[11px] font-mono`,children:[e.rule_id&&(0,U.jsxs)(`span`,{className:`flex items-center gap-1`,children:[(0,U.jsx)(`span`,{className:`text-[var(--color-fg-4)] uppercase tracking-wider text-[10px]`,children:`rule`}),(0,U.jsx)(Us,{ruleId:e.rule_id})]}),e.source_file&&(0,U.jsxs)(`span`,{className:`flex items-center gap-1`,children:[(0,U.jsx)(`span`,{className:`text-[var(--color-fg-4)] uppercase tracking-wider text-[10px]`,children:`src`}),(0,U.jsx)(`span`,{className:`text-[var(--color-fg-2)]`,children:e.source_file})]}),e.rules_evaluated!==null&&(0,U.jsxs)(`span`,{className:`flex items-center gap-1`,children:[(0,U.jsx)(`span`,{className:`text-[var(--color-fg-4)] uppercase tracking-wider text-[10px]`,children:`evals`}),(0,U.jsx)(`span`,{className:`text-[var(--color-fg-2)] tabular-nums`,children:e.rules_evaluated})]}),(0,U.jsxs)(`span`,{className:`flex items-center gap-1`,children:[(0,U.jsx)(`span`,{className:`text-[var(--color-fg-4)] uppercase tracking-wider text-[10px]`,children:`latency`}),(0,U.jsx)(`span`,{className:`text-[var(--color-fg-2)] tabular-nums`,children:Ps(e.duration_ns)})]}),(0,U.jsx)(`button`,{onClick:()=>a(e=>!e),className:`text-[var(--color-fg-3)] hover:text-[var(--color-fg-0)] transition-colors ml-auto cursor-pointer uppercase tracking-wider text-[10px]`,children:i?`▾ hide`:`▸ details`})]}),i&&(0,U.jsxs)(`div`,{className:`mt-3 pt-3 border-t border-[var(--color-line-0)]`,children:[(0,U.jsx)(`div`,{className:`overline mb-2`,children:`full input`}),(0,U.jsx)(Ss,{children:(()=>{try{return JSON.stringify(JSON.parse(e.input),null,2)}catch{return e.input}})()})]})]})})}function qs(){let e=je(Fs),t=[e[`counters-updated`],e[`activity-updated`],e[`pending-changed`]],{data:n}=R(`/api/state/counters`,t),{data:r,refetch:i}=R(`/api/json/pending`,t),{data:a,refetch:o}=R(`/api/json/blocked`,t),{data:s}=R(`/api/state/activity`,t),{data:c}=R(`/api/state/runtime`,[e[`runtime-tick`]]),{data:l}=R(`/api/json/limits`,[e[`limits-breach`]]),{data:u}=R(`/api/json/license`,[e[`activity-updated`]]),[d,f]=(0,_.useState)(!1),p=a?.reduce((e,t)=>e+t.repeat_count,0)??0,m=[{label:`allow`,value:n?.allow??0,tone:`green`},{label:`block`,value:(n?.block??0)+(n?.force??0),tone:`red`},{label:`force`,value:n?.force??0,tone:`amber`},{label:`pending`,value:n?.pending??0,tone:`blue`},{label:`log`,value:n?.log??0,tone:`gray`}];return(0,U.jsxs)(`div`,{ref:Mt({from:`first`}),className:`space-y-8`,children:[(0,U.jsx)(`div`,{className:`grid grid-cols-5 gap-2`,children:m.map(e=>(0,U.jsx)(Ds,{align:`left`,label:e.label,value:e.value,tone:e.tone,labelPlacement:`above`,contentClassName:`py-3`,valueClassName:`text-2xl font-medium`,"data-reveal":!0},e.label))}),u&&(0,U.jsx)(`div`,{"data-reveal":!0,children:(0,U.jsx)(Is,{info:u})}),c&&(0,U.jsxs)(`div`,{"data-reveal":!0,className:`grid grid-cols-2 gap-2`,children:[(0,U.jsx)(As,{label:`cpu`,value:`${c.cpu_pct??`—`}%`,tone:l?.breaches.cpu?`red`:(c.cpu_pct??0)>=60?`amber`:`green`,breached:l?.breaches.cpu??!1,trendData:c.history?.cpu_pct,trendColor:l?.breaches.cpu?`#f87171`:`#34d399`,threshold:l?.config.cpuLimitPct,maxValue:100,className:l?.breaches.cpu?`border-red-500/40`:``,footer:(0,U.jsx)(`a`,{href:`/monitor`,className:`mt-1 block text-[10px] font-mono uppercase tracking-wider text-[var(--color-fg-3)] hover:text-[var(--color-brand)]`,children:`view details →`})}),(0,U.jsx)(As,{label:`memory rss`,value:(0,U.jsxs)(U.Fragment,{children:[c.memory_rss_mb??`—`,(0,U.jsx)(`span`,{className:`ml-1 text-sm text-[var(--color-fg-3)]`,children:`MB`})]}),tone:l?.breaches.memory?`red`:`neutral`,breached:l?.breaches.memory??!1,trendData:c.history?.memory_rss_mb,trendColor:l?.breaches.memory?`#f87171`:`#38bdf8`,threshold:l?.config.memoryLimitMb,className:l?.breaches.memory?`border-red-500/40`:``,footer:(0,U.jsx)(`a`,{href:`/monitor`,className:`mt-1 block text-[10px] font-mono uppercase tracking-wider text-[var(--color-fg-3)] hover:text-[var(--color-brand)]`,children:`view details →`})})]}),(0,U.jsxs)(`section`,{"data-reveal":!0,children:[(0,U.jsx)(Ws,{title:`pending approvals`}),!r||r.length===0?(0,U.jsx)(Gs,{children:`no pending approvals`}):(0,U.jsx)(`div`,{className:`space-y-2`,children:r.map(e=>(0,U.jsxs)(W,{className:`border-l-2 border-l-sky-500/50`,children:[(0,U.jsxs)(G,{children:[(0,U.jsx)(`span`,{className:`text-sm text-[var(--color-fg-0)]`,children:e.ruleMessage}),(0,U.jsxs)(`div`,{className:`flex gap-2`,children:[(0,U.jsx)(J,{size:`sm`,variant:`primary`,onClick:async()=>{await Rs(e.id,`allow`),i()},children:`approve`}),(0,U.jsx)(J,{size:`sm`,variant:`danger`,onClick:async()=>{await Rs(e.id,`block`),i()},children:`deny`})]})]}),(0,U.jsxs)(K,{className:`space-y-2 text-xs`,children:[(0,U.jsxs)(`div`,{className:`flex gap-2 items-center`,children:[(0,U.jsx)(`span`,{className:`overline`,children:`tool`}),(0,U.jsx)(`code`,{className:`text-[var(--color-brand)] font-mono`,children:e.toolCall.tool})]}),e.prompt&&(0,U.jsxs)(`div`,{className:`flex gap-2 items-start`,children:[(0,U.jsx)(`span`,{className:`overline pt-0.5`,children:`prompt`}),(0,U.jsx)(`span`,{className:`text-[var(--color-fg-1)] truncate`,children:e.prompt})]}),(0,U.jsx)(Ss,{children:JSON.stringify(e.toolCall.input,null,2)})]})]},e.id))})]}),a&&a.length>0&&(0,U.jsxs)(`section`,{"data-reveal":!0,children:[(0,U.jsx)(Ws,{title:`blocked actions`,right:(0,U.jsxs)(`span`,{className:`text-[11px] font-mono text-[var(--color-fg-3)]`,children:[a.length,` active`,p>a.length?` · ${p} total hits`:``]})}),(0,U.jsx)(`div`,{className:`space-y-2`,children:(d?a:a.slice(0,Ns)).map(e=>(0,U.jsx)(Ks,{item:e,onDisable:async()=>{await zs(e.rule_id,e.source_file),o()},onChangeToAsk:async()=>{await Vs(e.rule_id,e.source_file),o()},onUndo:async t=>{t===`disable`?await Bs(e.rule_id,e.source_file):await Hs(e.rule_id,e.source_file),o()}},`${e.decision}:${e.rule_id??`none`}:${e.tool}:${e.timestamp}:${e.input}`))}),a.length>Ns&&(0,U.jsx)(`div`,{className:`mt-3 flex justify-center`,children:(0,U.jsx)(J,{size:`sm`,variant:`secondary`,onClick:()=>f(e=>!e),children:d?`↑ show less`:`↓ show ${a.length-Ns} more`})})]}),(0,U.jsxs)(`section`,{"data-reveal":!0,children:[(0,U.jsx)(Ws,{title:`recent audit log`,right:s&&s.length>0?(0,U.jsx)(`a`,{href:`/audit`,className:`text-[11px] font-mono uppercase tracking-wider text-[var(--color-fg-3)] hover:text-[var(--color-brand)] transition-colors`,children:`view all →`}):void 0}),!s||s.length===0?(0,U.jsx)(Gs,{children:`no audit entries yet`}):(0,U.jsx)(`div`,{className:`space-y-1.5`,children:s.slice(0,15).map(e=>(0,U.jsx)(xs,{row:e},e.id))})]})]})}var Js=[`rules-changed`],Ys=[`block`,`ask`,`log`,`allow`,`force`,`shadow`],Xs={block:`text-red-300`,deny:`text-red-300`,ask:`text-sky-300`,allow:`text-emerald-300`,log:`text-[var(--color-fg-3)]`,force:`text-amber-300`,shadow:`text-violet-300`};async function Zs(e,t){await fetch(`/api/rules/toggle`,{method:`POST`,headers:{"Content-Type":`application/json`,Accept:`application/json`,...Ae()},body:JSON.stringify({ruleId:e,file:t})})}async function Qs(e,t,n){await fetch(`/api/rules/update-decision`,{method:`POST`,headers:{"Content-Type":`application/json`,...Ae()},body:JSON.stringify({ruleId:e,file:t,decision:n})})}function $s({rule:e,file:t,onToggle:n}){let[r,i]=(0,_.useState)(!1),a=(0,_.useRef)(null),o=(0,_.useCallback)(()=>{if(!e.enabled){n();return}i(!0),a.current=setTimeout(()=>i(!1),3e3)},[e.enabled,n]);return(0,_.useEffect)(()=>()=>{a.current&&clearTimeout(a.current)},[]),r?(0,U.jsxs)(`div`,{className:`flex items-center gap-1.5 shrink-0`,children:[(0,U.jsx)(`button`,{onClick:()=>{i(!1),n()},className:`text-[11px] font-mono uppercase tracking-wider bg-red-500/8 border border-red-500/30 text-red-300 hover:bg-red-500/15 rounded-sm px-2 py-0.5 cursor-pointer transition-colors`,children:`disable`}),(0,U.jsx)(`button`,{onClick:()=>i(!1),className:`text-[11px] font-mono uppercase tracking-wider text-[var(--color-fg-3)] hover:text-[var(--color-fg-1)] cursor-pointer`,children:`cancel`})]}):(0,U.jsxs)(`label`,{className:`flex items-center gap-2 cursor-pointer shrink-0`,children:[(0,U.jsx)(`input`,{type:`checkbox`,className:`w-3.5 h-3.5 accent-[var(--color-brand)] cursor-pointer`,checked:e.enabled,onChange:o}),(0,U.jsx)(`span`,{className:`text-[10px] font-mono uppercase tracking-wider ${e.enabled?`text-[var(--color-fg-1)]`:`text-[var(--color-fg-4)]`}`,children:e.enabled?`on`:`off`})]})}function ec(){let[e,t]=(0,_.useState)(null),[n,r]=(0,_.useState)(!1),[i,a]=(0,_.useState)(!1);(0,_.useEffect)(()=>{let e=!1;return(async()=>{try{let n=await fetch(`/api/json/rule-write-enforcement`,{headers:{Accept:`application/json`}});if(!n.ok)return;let r=await n.json();!e&&typeof r.enforced==`boolean`&&t(r.enforced)}catch{}})(),()=>{e=!0}},[]);async function o(e){r(!0);try{let n=await fetch(`/api/json/rule-write-enforcement`,{method:`POST`,headers:{"Content-Type":`application/json`,...Ae()},body:JSON.stringify({enforced:e})});if(n.ok){let e=await n.json();typeof e.enforced==`boolean`&&t(e.enforced)}}finally{r(!1),a(!1)}}if(e===null)return null;let s=!e;return(0,U.jsx)(W,{className:s?`border-amber-500/40 bg-amber-500/5`:`border-[var(--color-line-1)]`,children:(0,U.jsx)(K,{className:`px-3 py-2.5`,children:(0,U.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,U.jsxs)(`div`,{className:`flex-1 min-w-0`,children:[(0,U.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,U.jsx)(`span`,{className:`text-[11px] font-mono uppercase tracking-wider text-[var(--color-fg-1)]`,children:`rule-write protection`}),(0,U.jsx)(`span`,{className:`text-[11px] font-mono uppercase tracking-wider ${s?`text-amber-300`:`text-emerald-300`}`,children:s?`disabled`:`enforced`})]}),(0,U.jsx)(`p`,{className:`text-[11px] text-[var(--color-fg-3)] mt-1 leading-snug`,children:s?`Agents can currently Write/Edit .rules files. Turn this back on when you finish authoring.`:`Agents cannot Write/Edit/MultiEdit any .sigmashake/rules/**/*.rules file. Disable only when curating rulesets.`})]}),(0,U.jsx)(`div`,{className:`shrink-0`,children:i?(0,U.jsxs)(`div`,{className:`flex items-center gap-1.5`,children:[(0,U.jsx)(`button`,{onClick:()=>o(!1),disabled:n,className:`text-[11px] font-mono uppercase tracking-wider bg-amber-500/10 border border-amber-500/40 text-amber-200 hover:bg-amber-500/20 rounded-sm px-2 py-0.5 cursor-pointer transition-colors disabled:opacity-50`,children:`disable`}),(0,U.jsx)(`button`,{onClick:()=>a(!1),disabled:n,className:`text-[11px] font-mono uppercase tracking-wider text-[var(--color-fg-3)] hover:text-[var(--color-fg-1)] cursor-pointer disabled:opacity-50`,children:`cancel`})]}):(0,U.jsx)(`button`,{onClick:()=>{e?a(!0):o(!0)},disabled:n,className:`text-[11px] font-mono uppercase tracking-wider border rounded-sm px-2.5 py-0.5 cursor-pointer transition-colors disabled:opacity-50 ${s?`bg-emerald-500/10 border-emerald-500/40 text-emerald-200 hover:bg-emerald-500/20`:`bg-[var(--color-surface-1)] border-[var(--color-line-1)] text-[var(--color-fg-1)] hover:bg-[var(--color-surface-2)]`}`,children:s?`enable`:`disable`})})]})})})}function tc(){let{data:e,refetch:t}=R(`/api/json/rules`,[je(Js)[`rules-changed`]]),[n,r]=(0,_.useState)(``),i=new URLSearchParams(window.location.search).get(`highlight`)??``,a=(0,_.useRef)(null);if((0,_.useEffect)(()=>{a.current&&a.current.scrollIntoView({behavior:`smooth`,block:`center`})},[e,i]),!e)return(0,U.jsx)(`p`,{className:`text-[11px] font-mono uppercase tracking-wider text-[var(--color-fg-3)]`,children:`loading rules…`});if(e.rulesets.length===0)return(0,U.jsxs)(`div`,{className:`rounded-sm border border-dashed border-[var(--color-line-1)] bg-[var(--color-surface-1)]/50 p-10 text-center`,children:[(0,U.jsx)(`p`,{className:`text-sm text-[var(--color-fg-2)] mb-2`,children:`No .rules files found.`}),(0,U.jsx)(`a`,{href:`/hub`,className:`text-[11px] font-mono uppercase tracking-wider text-[var(--color-brand)] hover:underline`,children:`→ browse hub to install rulesets`})]});let o=n.toLowerCase(),s=e.rulesets.map(e=>({...e,rules:o?e.rules.filter(e=>e.id.toLowerCase().includes(o)||e.message.toLowerCase().includes(o)):e.rules})).filter(e=>!o||e.rules.length>0),c=e.rulesets.reduce((e,t)=>e+t.rules.length,0),l=e.rulesets.reduce((e,t)=>e+t.rules.filter(e=>e.enabled).length,0);return(0,U.jsxs)(`div`,{className:`space-y-5`,children:[(0,U.jsxs)(`div`,{className:`flex items-center gap-4`,children:[(0,U.jsxs)(`div`,{children:[(0,U.jsx)(`h1`,{className:`overline text-[11px]`,children:`rules`}),(0,U.jsxs)(`div`,{className:`flex items-baseline gap-3 mt-1`,children:[(0,U.jsxs)(`span`,{className:`font-mono text-sm text-[var(--color-fg-0)] tabular-nums`,children:[l,(0,U.jsxs)(`span`,{className:`text-[var(--color-fg-4)]`,children:[`/`,c]}),(0,U.jsx)(`span`,{className:`text-[var(--color-fg-3)] ml-1.5 text-[11px] uppercase tracking-wider`,children:`active`})]}),(0,U.jsx)(`span`,{className:`text-[var(--color-fg-4)]`,children:`·`}),(0,U.jsxs)(`span`,{className:`font-mono text-[11px] text-[var(--color-fg-3)] uppercase tracking-wider`,children:[e.files.length,` file`,e.files.length===1?``:`s`]})]})]}),(0,U.jsx)(`div`,{className:`ml-auto relative`,children:(0,U.jsx)(`input`,{type:`text`,placeholder:`search rules…`,value:n,onChange:e=>r(e.target.value),className:`bg-[var(--color-surface-1)] border border-[var(--color-line-1)] text-[var(--color-fg-1)] text-xs rounded-sm px-2.5 py-1.5 w-56 focus:outline-none focus:border-[var(--color-brand)]/50 placeholder:text-[var(--color-fg-4)] font-mono`})})]}),(0,U.jsx)(ec,{}),s.length===0&&(0,U.jsxs)(`div`,{className:`rounded-sm border border-dashed border-[var(--color-line-1)] px-4 py-6 text-center text-[11px] font-mono text-[var(--color-fg-3)]`,children:[`no rules match "`,n,`"`]}),(0,U.jsx)(`div`,{className:`space-y-3`,children:s.map(e=>{let n=e.rules.some(e=>e.id===i),r=e.rules.filter(e=>e.enabled).length;return(0,U.jsx)(W,{children:(0,U.jsxs)(`details`,{open:n||!o,children:[(0,U.jsxs)(`summary`,{className:`flex items-center gap-2 px-3 py-2 cursor-pointer list-none select-none hover:bg-[var(--color-surface-2)]/70 border-b border-[var(--color-line-0)]`,children:[(0,U.jsxs)(`svg`,{className:`text-[var(--color-fg-3)] shrink-0`,width:`12`,height:`12`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2`,children:[(0,U.jsx)(`path`,{d:`M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z`}),(0,U.jsx)(`polyline`,{points:`14 2 14 8 20 8`})]}),(0,U.jsx)(`code`,{className:`text-xs text-[var(--color-fg-0)] font-mono`,children:e.file}),(0,U.jsxs)(`span`,{className:`ml-auto font-mono text-[11px] text-[var(--color-fg-3)] tabular-nums`,children:[r,(0,U.jsxs)(`span`,{className:`text-[var(--color-fg-4)]`,children:[`/`,e.rules.length]})]})]}),(0,U.jsxs)(K,{className:`py-0`,children:[e.rules.length===0?(0,U.jsx)(`p`,{className:`text-[11px] font-mono text-[var(--color-fg-3)] py-3`,children:`no rules in this file`}):(0,U.jsx)(`div`,{className:`divide-y divide-[var(--color-line-0)]`,children:e.rules.map(n=>{let r=n.id===i;return(0,U.jsxs)(`div`,{ref:r?a:null,className:`py-2.5 flex items-start justify-between gap-4 ${r?`bg-amber-400/8 border-l-2 border-l-amber-400/60 -mx-3 px-3 -my-px`:``}`,children:[(0,U.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,U.jsxs)(`div`,{className:`flex items-center gap-2 mb-1 flex-wrap`,children:[(0,U.jsx)(`select`,{value:n.decision,onChange:async r=>{await Qs(n.id,e.file,r.target.value),t()},className:`bg-[var(--color-surface-0)] border border-[var(--color-line-1)] rounded-sm px-1.5 py-0.5 text-[11px] font-mono uppercase tracking-wider cursor-pointer focus:outline-none focus:border-[var(--color-brand)]/50 ${Xs[n.decision]??`text-[var(--color-fg-2)]`}`,children:Ys.map(e=>(0,U.jsx)(`option`,{value:e,children:e},e))}),(0,U.jsx)(`code`,{className:`text-xs font-mono text-[var(--color-fg-0)] break-all`,children:n.id})]}),(0,U.jsx)(`p`,{className:`text-xs text-[var(--color-fg-2)] truncate`,children:n.message})]}),(0,U.jsx)($s,{rule:n,file:e.file,onToggle:async()=>{await Zs(n.id,e.file),t()}})]},n.id)})}),e.content&&(0,U.jsxs)(`details`,{className:`mt-3 pb-3`,children:[(0,U.jsx)(`summary`,{className:`overline cursor-pointer hover:text-[var(--color-fg-1)] select-none`,children:`raw source`}),(0,U.jsx)(`pre`,{className:`mt-2 p-3 bg-[var(--color-surface-0)] border border-[var(--color-line-0)] rounded-sm text-[11px] text-[var(--color-fg-2)] overflow-x-auto whitespace-pre-wrap break-words font-mono`,children:e.content})]})]})]})},e.file)})})]})}var nc=[``,`allow`,`block`,`force`,`ask`,`log`],rc=[``,`claude-code`,`gemini`,`antigravity`,`cursor`,`copilot`,`codex`,`pi`,`generic`],ic=50;function ac(){let[e,t]=(0,_.useState)(``),[n,r]=(0,_.useState)(``),[i,a]=(0,_.useState)(``),[o,s]=(0,_.useState)(``),[c,l]=(0,_.useState)(ic),u=je([`activity-updated`]),d=new URLSearchParams;e&&d.set(`decision`,e),n&&d.set(`tool`,n),i&&d.set(`client`,i);let{data:f,loading:p,error:m}=R(`/api/state/activity${d.size?`?`+d:``}`,[u[`activity-updated`],e,n,i]),h=e=>t=>{e(t.target.value),l(ic)},g=(0,_.useMemo)(()=>{if(!f)return[];let e=o.trim().toLowerCase();return e?f.filter(t=>t.tool.toLowerCase().includes(e)||t.decision.toLowerCase().includes(e)||(t.rule_id??``).toLowerCase().includes(e)||(t.client??``).toLowerCase().includes(e)||(t.source_file??``).toLowerCase().includes(e)||t.input.toLowerCase().includes(e)):f},[f,o]),v=g.slice(0,c),y=g.length>c,b=f?.length??0,x=g.length,S=`bg-[var(--color-surface-1)] border border-[var(--color-line-1)] text-[var(--color-fg-1)] text-[11px] font-mono rounded-sm px-2 py-1.5 focus:outline-none focus:border-[var(--color-brand)]/50 cursor-pointer`;return(0,U.jsxs)(`div`,{className:`space-y-4`,children:[(0,U.jsxs)(`div`,{className:`flex flex-col gap-2 sm:flex-row sm:items-start sm:justify-between`,children:[(0,U.jsxs)(`div`,{children:[(0,U.jsx)(`h1`,{className:`overline text-[11px]`,children:`audit log`}),f&&(0,U.jsx)(`p`,{className:`font-mono text-[11px] text-[var(--color-fg-3)] mt-1 tabular-nums`,children:o&&x!==b?`${x}/${b} events match`:`${b} events`})]}),(0,U.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,U.jsx)(`select`,{id:`audit-filter-decision`,value:e,onChange:h(t),className:S,children:nc.map(e=>(0,U.jsx)(`option`,{value:e,children:e||`all decisions`},e))}),(0,U.jsx)(`select`,{id:`audit-filter-client`,value:i,onChange:h(a),className:S,children:rc.map(e=>(0,U.jsx)(`option`,{value:e,children:e||`all clients`},e))}),(0,U.jsx)(`input`,{id:`audit-filter-tool`,type:`text`,placeholder:`filter by tool…`,value:n,onChange:h(r),className:`bg-[var(--color-surface-1)] border border-[var(--color-line-1)] text-[var(--color-fg-1)] text-[11px] font-mono rounded-sm px-2.5 py-1.5 w-36 focus:outline-none focus:border-[var(--color-brand)]/50 placeholder:text-[var(--color-fg-4)]`})]})]}),(0,U.jsxs)(`div`,{className:`relative`,children:[(0,U.jsxs)(`svg`,{className:`absolute left-3 top-1/2 -translate-y-1/2 text-[var(--color-fg-4)] pointer-events-none`,width:`13`,height:`13`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`,children:[(0,U.jsx)(`circle`,{cx:`11`,cy:`11`,r:`8`}),(0,U.jsx)(`line`,{x1:`21`,y1:`21`,x2:`16.65`,y2:`16.65`})]}),(0,U.jsx)(`input`,{id:`audit-search`,type:`text`,placeholder:`search tool, command, path, rule id, input fields…`,value:o,onChange:e=>{s(e.target.value),l(ic)},className:`w-full bg-[var(--color-surface-1)] border border-[var(--color-line-1)] text-[var(--color-fg-1)] text-sm rounded-sm pl-9 pr-10 py-2.5 focus:outline-none focus:border-[var(--color-brand)]/50 placeholder:text-[var(--color-fg-4)] font-mono transition-colors`}),o&&(0,U.jsx)(`button`,{onClick:()=>{s(``),l(ic)},className:`absolute right-3 top-1/2 -translate-y-1/2 text-[var(--color-fg-4)] hover:text-[var(--color-fg-1)] transition-colors cursor-pointer`,title:`Clear search`,children:(0,U.jsxs)(`svg`,{width:`13`,height:`13`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2.5`,strokeLinecap:`round`,strokeLinejoin:`round`,children:[(0,U.jsx)(`line`,{x1:`18`,y1:`6`,x2:`6`,y2:`18`}),(0,U.jsx)(`line`,{x1:`6`,y1:`6`,x2:`18`,y2:`18`})]})})]}),f&&f.length>0&&(0,U.jsxs)(`div`,{className:`flex items-center gap-3 px-3 font-mono text-[10px] uppercase tracking-widest text-[var(--color-fg-4)] select-none`,children:[(0,U.jsx)(`span`,{className:`w-3`}),(0,U.jsx)(`span`,{className:`w-14`,children:`time`}),(0,U.jsx)(`span`,{className:`w-14`,children:`decision`}),(0,U.jsx)(`span`,{className:`w-28`,children:`tool`}),(0,U.jsx)(`span`,{className:`flex-1`,children:`preview`}),(0,U.jsx)(`span`,{children:`client`})]}),m&&(0,U.jsxs)(`p`,{className:`text-sm text-red-300 font-mono`,children:[`failed to load audit log: `,m]}),p&&!f&&(0,U.jsx)(`div`,{className:`space-y-1.5`,children:Array.from({length:10}).map((e,t)=>(0,U.jsx)(`div`,{className:`h-9 bg-[var(--color-surface-1)] rounded-sm border border-[var(--color-line-0)] border-l-2 border-l-[var(--color-line-2)] shimmer`},t))}),!p&&!m&&g.length===0&&(0,U.jsxs)(`div`,{className:`rounded-sm border border-dashed border-[var(--color-line-1)] py-16 flex flex-col items-center justify-center text-center`,children:[(0,U.jsxs)(`svg`,{className:`text-[var(--color-fg-4)] mb-3`,width:`32`,height:`32`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`1.5`,strokeLinecap:`round`,strokeLinejoin:`round`,children:[(0,U.jsx)(`circle`,{cx:`11`,cy:`11`,r:`8`}),(0,U.jsx)(`line`,{x1:`21`,y1:`21`,x2:`16.65`,y2:`16.65`})]}),(0,U.jsx)(`p`,{className:`text-xs font-mono text-[var(--color-fg-3)] uppercase tracking-wider`,children:o?`no events match your search`:`no audit entries yet`}),o&&(0,U.jsx)(`button`,{onClick:()=>s(``),className:`mt-3 text-[11px] font-mono uppercase tracking-wider text-[var(--color-brand)] hover:underline cursor-pointer`,children:`clear search`})]}),v.length>0&&(0,U.jsxs)(U.Fragment,{children:[(0,U.jsx)(`div`,{className:`space-y-1.5`,children:v.map(e=>(0,U.jsx)(xs,{row:e},e.id))}),y&&(0,U.jsxs)(`div`,{className:`flex items-center justify-center gap-4 pt-2`,children:[(0,U.jsxs)(`button`,{onClick:()=>l(e=>e+ic),className:`text-[11px] font-mono uppercase tracking-wider text-[var(--color-fg-2)] hover:text-[var(--color-fg-0)] border border-[var(--color-line-1)] hover:border-[var(--color-line-2)] rounded-sm px-4 py-1.5 transition-colors cursor-pointer`,children:[`show`,` `,Math.min(ic,g.length-c),` more`]}),(0,U.jsxs)(`span`,{className:`text-[11px] font-mono text-[var(--color-fg-4)] tabular-nums`,children:[c,` / `,g.length]})]})]})]})}var oc={allow:`green`,block:`red`,force:`amber`,ask:`blue`,log:`gray`},sc=[`all`,`allow`,`block`,`force`,`log`],cc={allow:`text-emerald-300`,block:`text-red-300`,force:`text-amber-300`,log:`text-[var(--color-fg-3)]`};function lc(e){return new Date(e*1e3).toLocaleString()}function uc(e,t){if(!t)return``;let n=t-e;return n<60?`${n}s`:`${Math.round(n/60)}m`}async function dc(e,t){await fetch(`/api/decide/${e}?decision=${t}`,{method:`POST`,headers:Ae()})}function fc(e){try{let t=JSON.parse(e).input;return t&&typeof t==`object`?ur(``,JSON.stringify(t)):ur(``,e)}catch{return e.slice(0,80)}}function pc(e){try{let t=JSON.parse(e);return t.input===void 0?JSON.stringify(JSON.parse(e),null,2):JSON.stringify(t.input,null,2)}catch{return e}}function mc({label:e,value:t,tone:n}){return(0,U.jsxs)(`div`,{className:`flex items-baseline gap-1.5`,children:[(0,U.jsx)(`span`,{className:`font-mono text-sm tabular-nums ${n??`text-[var(--color-fg-0)]`}`,children:t}),(0,U.jsx)(`span`,{className:`font-mono text-[10px] uppercase tracking-wider text-[var(--color-fg-3)]`,children:e})]})}function hc(){let e=je([`pending-changed`]),{data:t,refetch:n}=R(`/api/json/pending`,[e[`pending-changed`]]),{data:r}=R(`/api/json/approvals`,[e[`pending-changed`]]),[i,a]=(0,_.useState)(`all`),[o,s]=(0,_.useState)(``),[c,l]=(0,_.useState)(new Set),u=Math.floor(Date.now()/1e3),d=(r??[]).filter(e=>e.created_at>=u-86400).length,f=(r??[]).reduce((e,t)=>(e[t.decision]=(e[t.decision]??0)+1,e),{}),p=(r??[]).filter(e=>{if(i!==`all`&&e.decision!==i)return!1;if(o){let t=o.toLowerCase(),n=fc(e.input).toLowerCase();if(!e.tool.toLowerCase().includes(t)&&!e.rule_id.toLowerCase().includes(t)&&!(e.rule_message??``).toLowerCase().includes(t)&&!n.includes(t))return!1}return!0});function m(e){l(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n})}return(0,U.jsxs)(`div`,{className:`space-y-6`,children:[(0,U.jsxs)(`div`,{children:[(0,U.jsx)(`h1`,{className:`overline text-[11px]`,children:`approvals`}),(0,U.jsx)(`p`,{className:`text-xs text-[var(--color-fg-3)] mt-1 font-mono`,children:`approve or deny pending tool calls · review past decisions`})]}),(0,U.jsxs)(`div`,{className:`flex flex-wrap items-center gap-5 px-3 py-2.5 rounded-sm border border-[var(--color-line-0)] bg-[var(--color-surface-1)]/60`,children:[(0,U.jsx)(mc,{label:`pending`,value:t?.length??0,tone:`text-amber-300`}),(0,U.jsx)(`span`,{className:`text-[var(--color-line-2)]`,children:`|`}),[`allow`,`block`,`force`,`log`].map(e=>(0,U.jsx)(mc,{label:e,value:f[e]??0,tone:cc[e]},e)),(0,U.jsx)(`span`,{className:`text-[var(--color-line-2)]`,children:`|`}),(0,U.jsx)(mc,{label:`last 24h`,value:d})]}),t&&t.length>0&&(0,U.jsxs)(`section`,{children:[(0,U.jsx)(`div`,{className:`flex items-center justify-between mb-3`,children:(0,U.jsxs)(`h2`,{className:`overline text-[11px]`,children:[`pending · `,t.length]})}),(0,U.jsx)(`div`,{className:`space-y-2`,children:t.map(e=>(0,U.jsxs)(W,{className:`border-l-2 border-l-amber-400/60`,children:[(0,U.jsxs)(G,{children:[(0,U.jsx)(`span`,{className:`text-sm text-[var(--color-fg-0)]`,children:e.ruleMessage}),(0,U.jsxs)(`div`,{className:`flex gap-2`,children:[(0,U.jsx)(J,{size:`sm`,variant:`primary`,onClick:async()=>{await dc(e.id,`allow`),n()},children:`approve`}),(0,U.jsx)(J,{size:`sm`,variant:`danger`,onClick:async()=>{await dc(e.id,`block`),n()},children:`deny`})]})]}),(0,U.jsxs)(K,{className:`space-y-2 text-xs`,children:[(0,U.jsxs)(`div`,{className:`flex gap-3 flex-wrap items-center`,children:[(0,U.jsx)(`span`,{className:`overline`,children:`tool`}),(0,U.jsx)(`code`,{className:`text-[var(--color-brand)] font-mono`,children:e.toolCall.tool}),(0,U.jsx)(`span`,{className:`overline ml-2`,children:`rule`}),(0,U.jsx)(`span`,{className:`font-mono text-[var(--color-fg-2)]`,children:e.ruleId})]}),e.prompt&&(0,U.jsxs)(`div`,{className:`flex gap-2 items-start`,children:[(0,U.jsx)(`span`,{className:`overline pt-0.5 shrink-0`,children:`why`}),(0,U.jsx)(`span`,{className:`text-[var(--color-fg-1)]`,children:e.prompt})]}),(0,U.jsx)(Ss,{children:JSON.stringify(e.toolCall.input,null,2)})]})]},e.id))})]}),(0,U.jsxs)(`section`,{children:[(0,U.jsxs)(`div`,{className:`flex items-center justify-between mb-3 gap-3 flex-wrap`,children:[(0,U.jsx)(`h2`,{className:`overline text-[11px]`,children:`history`}),(0,U.jsxs)(`div`,{className:`flex items-center gap-2 flex-wrap`,children:[(0,U.jsx)(`div`,{className:`flex gap-0.5 rounded-sm border border-[var(--color-line-1)] p-0.5 bg-[var(--color-surface-1)]`,children:sc.map(e=>(0,U.jsx)(`button`,{onClick:()=>a(e),className:`px-2 py-0.5 rounded-sm text-[11px] font-mono uppercase tracking-wider transition-colors cursor-pointer ${i===e?`bg-[var(--color-brand)]/10 text-[var(--color-brand)] border border-[var(--color-brand)]/30`:`text-[var(--color-fg-3)] hover:text-[var(--color-fg-1)] border border-transparent`}`,children:e},e))}),(0,U.jsx)(`input`,{type:`text`,placeholder:`search tool, rule, command…`,value:o,onChange:e=>s(e.target.value),className:`text-xs font-mono bg-[var(--color-surface-1)] border border-[var(--color-line-1)] rounded-sm px-2.5 py-1 text-[var(--color-fg-1)] placeholder-[var(--color-fg-4)] focus:outline-none focus:border-[var(--color-brand)]/50 w-48`})]})]}),!r||r.length===0?(0,U.jsx)(`div`,{className:`rounded-sm border border-dashed border-[var(--color-line-1)] px-4 py-6 text-center text-[11px] font-mono text-[var(--color-fg-3)]`,children:`no approval history yet`}):p.length===0?(0,U.jsx)(`div`,{className:`rounded-sm border border-dashed border-[var(--color-line-1)] px-4 py-6 text-center text-[11px] font-mono text-[var(--color-fg-3)]`,children:`no results match your filter`}):(0,U.jsx)(W,{children:(0,U.jsx)(`div`,{className:`divide-y divide-[var(--color-line-0)]`,children:p.map(e=>{let t=c.has(e.id),n=fc(e.input),r=uc(e.created_at,e.resolved_at);return(0,U.jsxs)(`div`,{children:[(0,U.jsxs)(`button`,{onClick:()=>m(e.id),className:`w-full text-left px-3 py-2 flex items-center gap-3 hover:bg-[var(--color-surface-2)]/60 transition-colors cursor-pointer`,children:[(0,U.jsx)(`span`,{className:`text-[var(--color-fg-4)] text-[10px] w-2.5 shrink-0`,children:t?`▼`:`▶`}),(0,U.jsx)(`span`,{className:`text-[10px] font-mono text-[var(--color-fg-3)] whitespace-nowrap shrink-0 w-36 tabular-nums`,children:lc(e.resolved_at??e.created_at)}),(0,U.jsx)(`span`,{className:`shrink-0`,children:(0,U.jsx)(q,{variant:oc[e.decision]??`gray`,children:e.decision})}),(0,U.jsx)(`code`,{className:`text-xs text-[var(--color-brand)] shrink-0 font-mono`,children:e.tool}),(0,U.jsx)(`span`,{className:`text-xs text-[var(--color-fg-2)] truncate flex-1 min-w-0`,children:e.rule_message||e.rule_id||`—`}),n&&(0,U.jsx)(`span`,{className:`text-[11px] text-[var(--color-fg-3)] font-mono truncate max-w-[180px] shrink-0 hidden md:block`,children:n}),r&&(0,U.jsxs)(`span`,{className:`text-[10px] font-mono text-[var(--color-fg-4)] shrink-0`,children:[`Δ`,r]})]}),t&&(0,U.jsxs)(`div`,{className:`px-3 pb-3 pt-1 space-y-2 bg-[var(--color-surface-0)]`,children:[(0,U.jsxs)(`div`,{className:`flex flex-wrap gap-x-4 gap-y-1 text-xs font-mono`,children:[(0,U.jsxs)(`span`,{children:[(0,U.jsx)(`span`,{className:`text-[var(--color-fg-4)] uppercase tracking-wider text-[10px]`,children:`rule`}),` `,(0,U.jsx)(`span`,{className:`text-[var(--color-fg-1)]`,children:e.rule_id||`—`})]}),(0,U.jsxs)(`span`,{children:[(0,U.jsx)(`span`,{className:`text-[var(--color-fg-4)] uppercase tracking-wider text-[10px]`,children:`created`}),` `,(0,U.jsx)(`span`,{className:`text-[var(--color-fg-1)]`,children:lc(e.created_at)})]}),e.resolved_at&&(0,U.jsxs)(`span`,{children:[(0,U.jsx)(`span`,{className:`text-[var(--color-fg-4)] uppercase tracking-wider text-[10px]`,children:`resolved`}),` `,(0,U.jsx)(`span`,{className:`text-[var(--color-fg-1)]`,children:lc(e.resolved_at)})]})]}),e.prompt&&(0,U.jsxs)(`div`,{className:`text-xs flex gap-2 items-start`,children:[(0,U.jsx)(`span`,{className:`overline pt-0.5 shrink-0`,children:`why`}),(0,U.jsx)(`span`,{className:`text-[var(--color-fg-1)]`,children:e.prompt})]}),(0,U.jsx)(Ss,{children:pc(e.input)})]})]},e.id)})})})]})]})}function gc(){let{data:e,refetch:t}=R(`/api/json/inspector-targets`),[n,r]=(0,_.useState)(!1),[i,a]=(0,_.useState)(!1),[o,s]=(0,_.useState)(null),c=(0,_.useRef)(null),l=(0,_.useRef)(1),u=(0,_.useRef)(new Map),d=(0,_.useRef)(new Map),f=(0,_.useCallback)(()=>{let e=c.current;if(c.current=null,e)try{e.close()}catch{}r(!1),a(!1),s(null)},[]),p=(0,_.useCallback)(e=>{c.current&&f(),a(!0),s(null);let t=new WebSocket(`/ws/inspector?target=${encodeURIComponent(e)}`);c.current=t,t.onopen=()=>{r(!0),a(!1),s(null)},t.onclose=()=>{c.current=null,r(!1),a(!1)},t.onerror=()=>{a(!1),s(`Connection failed — is the inspector running with the correct target ID?`)},t.onmessage=e=>{try{let t=JSON.parse(e.data);if(t.id!=null){let e=u.current.get(t.id);e&&(u.current.delete(t.id),e(t.result))}else if(t.method){let e=d.current.get(t.method);if(e)for(let n of e)n(t.params)}}catch{}}},[f]),m=(0,_.useCallback)((e,t)=>new Promise((n,r)=>{let i=c.current;if(!i||i.readyState!==WebSocket.OPEN){r(Error(`Not connected`));return}let a=l.current++;u.current.set(a,e=>n(e)),i.send(JSON.stringify({id:a,method:e,params:t})),setTimeout(()=>{u.current.has(a)&&(u.current.delete(a),r(Error(`Command timed out`)))},1e4)}),[]),h=(0,_.useCallback)((e,t)=>{let n=d.current.get(e);return n||(n=new Set,d.current.set(e,n)),n.add(t),()=>{d.current.get(e)?.delete(t)}},[]),g=(0,_.useRef)(!1);return(0,_.useEffect)(()=>{e?.active&&e?.target&&!n&&!i&&!g.current&&(g.current=!0,p(e.target.id))},[e?.active,e?.target?.id,n,i,p]),(0,_.useEffect)(()=>()=>{f()},[f]),{active:e?.active??!1,bunVersion:e?.version?.[`Bun-Version`]??null,preconfiguredTarget:e?.target??null,connected:n,connecting:i,error:o,connect:p,disconnect:f,sendCommand:m,onEvent:h,refetch:t}}var _c=18,vc=5e-4;function yc(e,t){return t===`(garbage collector)`||t===`(idle)`?`#450a0a`:e?e.startsWith(`node:`)||e.startsWith(`bun:`)?`#172554`:e.startsWith(`file:`)||e.startsWith(`/`)||e.includes(`.ts`)||e.includes(`.js`)?`#451a03`:`#1f2937`:`#1f2937`}function bc(e,t){return t===`(garbage collector)`||t===`(idle)`?`#fca5a5`:e?e.startsWith(`node:`)||e.startsWith(`bun:`)?`#93c5fd`:e.startsWith(`file:`)||e.startsWith(`/`)||e.includes(`.ts`)||e.includes(`.js`)?`#fbbf24`:`#6b7280`:`#6b7280`}function xc(e,t){let n=new Map;for(let t of e.nodes)n.set(t.id,t);let r=new Map;function i(e){let t=n.get(e);if(!t)return 0;let a=t.hitCount??0;for(let e of t.children??[])a+=i(e);return r.set(e,a),a}let a=e.nodes[0];if(!a)return[];i(a.id);let o=t??a.id,s=r.get(o)??0;if(s===0)return[];let c=[];function l(e,t,i){let a=n.get(e);if(!a)return;let o=r.get(e)??0,u=o/s;if(u<vc)return;c.push({x:i,width:u,depth:t,node:a,subtreeHits:o});let d=i;for(let e of a.children??[]){let n=(r.get(e)??0)/s;l(e,t+1,d),d+=n}}return l(o,0,0),c}function Sc(e){return e<1e3?`${e}µs`:e<1e6?`${(e/1e3).toFixed(1)}ms`:`${(e/1e6).toFixed(2)}s`}function Cc({profile:e}){let t=(0,_.useRef)(null),[n,r]=(0,_.useState)(800),[i,a]=(0,_.useState)(null),[o,s]=(0,_.useState)(null);(0,_.useEffect)(()=>{let e=t.current;if(!e)return;let n=new ResizeObserver(e=>{let t=e[0]?.contentRect.width;t&&r(t)});return n.observe(e),r(e.clientWidth||800),()=>n.disconnect()},[]);let c=xc(e,i),l=(c.reduce((e,t)=>Math.max(e,t.depth),0)+1)*_c+4,u=e.endTime-e.startTime,d=(0,_.useCallback)(e=>{a(t=>t===e.node.id?null:e.node.id),s(null)},[]);return c.length===0?(0,U.jsx)(`p`,{className:`text-xs text-[#555] py-2`,children:`No samples — profile may be empty.`}):(0,U.jsxs)(`div`,{className:`relative select-none`,children:[i!==null&&(0,U.jsx)(`button`,{onClick:()=>a(null),className:`mb-2 text-xs text-amber-400 hover:underline`,children:`← Reset zoom`}),(0,U.jsx)(`div`,{ref:t,className:`overflow-x-hidden`,children:(0,U.jsx)(`svg`,{width:n,height:l,onMouseLeave:()=>s(null),children:c.map((e,t)=>{let r=e.x*n,a=Math.max(e.width*n,1),o=e.depth*_c+1,c=e.node.callFrame.functionName||`(anonymous)`,l=e.node.callFrame.url,f=i===e.node.id;return(0,U.jsxs)(`g`,{children:[(0,U.jsx)(`rect`,{x:r,y:o,width:a,height:_c-1,fill:f?`#92400e`:yc(l,c),stroke:`#080808`,strokeWidth:.5,style:{cursor:`pointer`},onClick:()=>d(e),onMouseMove:t=>s({clientX:t.clientX,clientY:t.clientY,rect:e,totalDuration:u})}),a>24&&(0,U.jsx)(`text`,{x:r+2,y:o+_c-5,fontSize:9,fill:bc(l,c),style:{pointerEvents:`none`,userSelect:`none`},clipPath:`url(#fc-clip-${t})`,children:c}),a>24&&(0,U.jsx)(`clipPath`,{id:`fc-clip-${t}`,children:(0,U.jsx)(`rect`,{x:r,y:o,width:a,height:_c})})]},t)})})}),o&&(0,U.jsxs)(`div`,{className:`fixed z-50 bg-[#111] border border-[#2a2a2a] rounded-lg p-2.5 text-xs shadow-xl pointer-events-none`,style:{left:o.clientX+14,top:o.clientY-8,maxWidth:320},children:[(0,U.jsx)(`div`,{className:`font-mono text-amber-400 truncate font-medium`,children:o.rect.node.callFrame.functionName||`(anonymous)`}),o.rect.node.callFrame.url&&(0,U.jsxs)(`div`,{className:`text-[#666] truncate mt-0.5 text-[10px]`,children:[o.rect.node.callFrame.url,`:`,o.rect.node.callFrame.lineNumber]}),(0,U.jsxs)(`div`,{className:`mt-1.5 space-y-0.5 text-[#aaa]`,children:[(0,U.jsxs)(`div`,{children:[`Samples:`,` `,(0,U.jsx)(`span`,{className:`text-white tabular-nums`,children:o.rect.subtreeHits})]}),(0,U.jsxs)(`div`,{children:[`Time share:`,` `,(0,U.jsxs)(`span`,{className:`text-white tabular-nums`,children:[(o.rect.width*100).toFixed(1),`%`]})]}),u>0&&(0,U.jsxs)(`div`,{children:[`Est. duration:`,` `,(0,U.jsx)(`span`,{className:`text-white tabular-nums`,children:Sc(Math.round(o.rect.width*u))})]})]}),o.rect.node.deoptReason&&(0,U.jsxs)(`div`,{className:`text-red-400 mt-1.5 text-[10px]`,children:[`⚠ `,o.rect.node.deoptReason]}),(0,U.jsx)(`div`,{className:`text-[#555] mt-1.5 text-[10px]`,children:`Click to zoom · click again to reset`})]})]})}function wc(e){return e<1e6?`${(e/1e3).toFixed(0)}µs`:e<1e9?`${(e/1e6).toFixed(1)}ms`:`${(e/1e9).toFixed(2)}s`}function Tc(e){return new Date(e*1e3).toLocaleString()}var Ec={critical:`red`,high:`red`,medium:`amber`,low:`blue`},Dc={critical:`border-l-red-500/70`,high:`border-l-red-500/50`,medium:`border-l-amber-400/60`,low:`border-l-sky-400/50`};function Oc(){let{data:e}=R(`/api/json/profile`);if(!e)return(0,U.jsx)(`p`,{className:`text-[11px] font-mono uppercase tracking-wider text-[var(--color-fg-3)]`,children:`loading profile…`});let{diagnosis:t,sessions:n}=e;return!t||t.analyzed_evals===0?(0,U.jsx)(`div`,{className:`rounded-sm border border-dashed border-[var(--color-line-1)] bg-[var(--color-surface-1)]/50 px-4 py-6 text-center`,children:(0,U.jsxs)(`p`,{className:`text-[12px] text-[var(--color-fg-2)] font-mono`,children:[`no eval data yet — run`,` `,(0,U.jsx)(`code`,{className:`text-[var(--color-brand)]`,children:`ssg eval`}),` to start recording`]})}):(0,U.jsxs)(`div`,{className:`space-y-5`,children:[(0,U.jsx)(`div`,{className:`grid grid-cols-2 lg:grid-cols-4 gap-2`,children:[{label:`evals analyzed`,value:String(t.analyzed_evals)},{label:`median (inside)`,value:wc(t.median_eval_ns)},{label:`p99 (inside)`,value:wc(t.p99_eval_ns)},{label:`bottleneck`,value:t.bottleneck??`—`}].map(e=>(0,U.jsx)(Ds,{label:e.label,value:e.value,labelPlacement:`above`,valueClassName:`text-xl font-medium tabular-nums text-[var(--color-fg-0)]`},e.label))}),t.phases.length>0&&(0,U.jsxs)(W,{children:[(0,U.jsx)(G,{children:(0,U.jsx)(`span`,{className:`overline`,children:`phase breakdown`})}),(0,U.jsx)(K,{children:(0,U.jsx)(`div`,{className:`space-y-2`,children:t.phases.filter(e=>e.median_ns>0).map(e=>{let n=e.name===t.bottleneck;return(0,U.jsxs)(`div`,{className:`flex items-center gap-3 text-xs`,children:[(0,U.jsx)(`span`,{className:`w-28 font-mono truncate ${n?`text-[var(--color-brand)] font-medium`:`text-[var(--color-fg-2)]`}`,title:n?`bottleneck`:void 0,children:e.name}),(0,U.jsx)(ks,{pct:Math.min(e.pct_of_total,100),tone:n?`amber`:`gray`,className:`h-1 flex-1`}),(0,U.jsx)(`span`,{className:`w-16 text-right text-[var(--color-fg-1)] tabular-nums font-mono`,children:wc(e.median_ns)}),(0,U.jsxs)(`span`,{className:`w-10 text-right text-[var(--color-fg-3)] tabular-nums font-mono`,children:[e.pct_of_total,`%`]}),(0,U.jsxs)(`span`,{className:`w-20 text-right text-[var(--color-fg-4)] tabular-nums font-mono text-[10px]`,children:[`p95 `,wc(e.p95_ns)]})]},e.name)})})})]}),t.recommendations.length>0&&(0,U.jsxs)(W,{children:[(0,U.jsx)(G,{children:(0,U.jsxs)(`span`,{className:`overline`,children:[`recommendations · `,t.recommendations.length]})}),(0,U.jsx)(K,{className:`space-y-2`,children:t.recommendations.map((e,t)=>(0,U.jsxs)(`div`,{className:`border border-[var(--color-line-1)] bg-[var(--color-surface-0)] rounded-sm px-3 py-2.5 border-l-2 ${Dc[e.severity]??`border-l-[var(--color-line-2)]`}`,children:[(0,U.jsxs)(`div`,{className:`flex items-center gap-2 mb-1.5`,children:[(0,U.jsx)(q,{variant:Ec[e.severity]??`gray`,children:e.severity}),(0,U.jsx)(`span`,{className:`text-[10px] font-mono uppercase tracking-wider text-[var(--color-fg-3)]`,children:e.type})]}),(0,U.jsx)(`p`,{className:`text-sm text-[var(--color-fg-1)] leading-relaxed`,children:e.message}),e.fix_command&&(0,U.jsxs)(`code`,{className:`text-[11px] text-[var(--color-brand)] font-mono mt-1.5 block`,children:[`$ `,e.fix_command]})]},t))})]}),t.anomalies.length>0&&(0,U.jsxs)(W,{children:[(0,U.jsx)(G,{children:(0,U.jsxs)(`span`,{className:`overline`,children:[`anomalies · `,t.anomalies.length]})}),(0,U.jsx)(K,{children:(0,U.jsx)(`div`,{className:`divide-y divide-[var(--color-line-0)]`,children:t.anomalies.map((e,t)=>(0,U.jsxs)(`div`,{className:`py-2 flex items-center gap-4 text-xs font-mono`,children:[(0,U.jsx)(`span`,{className:`w-24 text-[var(--color-brand)] uppercase tracking-wider text-[10px]`,children:e.type}),(0,U.jsxs)(`span`,{className:`w-10 tabular-nums text-[var(--color-fg-1)]`,children:[e.count,`×`]}),(0,U.jsxs)(`span`,{className:`w-20 tabular-nums text-[var(--color-fg-1)]`,children:[e.max_ms,`ms max`]}),(0,U.jsx)(`span`,{className:`text-[var(--color-fg-3)]`,children:e.likely_cause})]},t))})})]}),n.length>0&&(0,U.jsxs)(W,{children:[(0,U.jsxs)(G,{className:`flex items-center justify-between`,children:[(0,U.jsx)(`span`,{className:`overline`,children:`session history`}),(0,U.jsxs)(`span`,{className:`text-[10px] font-mono text-[var(--color-fg-3)] tabular-nums`,children:[n.length,` session`,n.length===1?``:`s`]})]}),(0,U.jsx)(K,{className:`p-0`,children:(0,U.jsx)(`div`,{className:`divide-y divide-[var(--color-line-0)]`,children:[...n].reverse().map((e,t)=>(0,U.jsxs)(`div`,{className:`px-4 py-2.5 flex flex-wrap items-center gap-x-5 gap-y-1 text-xs ${e.is_current?`bg-amber-400/[0.04] border-l-2 border-l-amber-400/60`:``}`,children:[(0,U.jsxs)(`div`,{className:`flex items-center gap-2 w-48 shrink-0`,children:[(0,U.jsx)(`span`,{className:`text-[var(--color-fg-3)] tabular-nums font-mono`,children:Tc(e.start_ts)}),e.is_current&&(0,U.jsx)(q,{variant:`amber`,children:`current`})]}),(0,U.jsxs)(`span`,{className:`text-[var(--color-fg-2)] tabular-nums font-mono w-20`,children:[e.evals,` eval`,e.evals===1?``:`s`]}),(0,U.jsxs)(`span`,{className:`text-emerald-300 tabular-nums font-mono`,children:[e.allowed,` allow`]}),e.blocked>0&&(0,U.jsxs)(`span`,{className:`text-red-300 tabular-nums font-mono`,children:[e.blocked,` block (`,e.block_rate_pct,`%)`]}),e.asked>0&&(0,U.jsxs)(`span`,{className:`text-sky-300 tabular-nums font-mono`,children:[e.asked,` ask`]}),e.forced>0&&(0,U.jsxs)(`span`,{className:`text-violet-300 tabular-nums font-mono`,children:[e.forced,` force`]}),e.avg_ns>0&&(0,U.jsxs)(`span`,{className:`text-[var(--color-fg-3)] tabular-nums ml-auto font-mono`,children:[`avg `,wc(e.avg_ns)]}),e.top_rule&&(0,U.jsxs)(`a`,{href:`/rules?highlight=${encodeURIComponent(e.top_rule)}`,className:`text-[var(--color-fg-4)] hover:text-[var(--color-brand)] font-mono truncate max-w-xs transition-colors w-full pl-48`,title:`most blocked rule: ${e.top_rule}`,children:[`top block: `,e.top_rule]})]},t))})})]})]})}var kc={log:`text-[var(--color-fg-1)]`,info:`text-sky-300`,warn:`text-amber-300`,error:`text-red-300`,debug:`text-[var(--color-fg-3)]`};function Ac(e){return e.value==null?e.description?e.description:`[${e.type}]`:String(e.value)}function jc(){let e=gc(),[t,n]=(0,_.useState)(!1),[r,i]=(0,_.useState)(null),[a,o]=(0,_.useState)([]),[s,c]=(0,_.useState)(null),[l,u]=(0,_.useState)(!1),d=(0,_.useRef)(null),f=(0,_.useRef)(0);(0,_.useEffect)(()=>{d.current?.scrollIntoView({behavior:`smooth`})},[a]),(0,_.useEffect)(()=>{if(e.connected)return e.sendCommand(`Runtime.enable`).catch(()=>{}),e.onEvent(`Runtime.consoleAPICalled`,e=>{let t=e;o(e=>{let n=[...e,{id:f.current++,type:t.type??`log`,args:t.args??[],timestamp:t.timestamp??Date.now()}];return n.length>500?n.slice(-500):n})})},[e.connected]);let p=(0,_.useCallback)(()=>{e.preconfiguredTarget&&e.connect(e.preconfiguredTarget.id)},[e]),m=(0,_.useCallback)(async()=>{try{await e.sendCommand(`Profiler.enable`),await e.sendCommand(`Profiler.start`),n(!0),i(null)}catch(e){console.error(`Profiler.start failed:`,e)}},[e]),h=(0,_.useCallback)(async()=>{try{let t=await e.sendCommand(`Profiler.stop`);n(!1),i(t.profile)}catch(e){console.error(`Profiler.stop failed:`,e),n(!1)}},[e]),g=(0,_.useCallback)(async()=>{u(!0);try{let t=await e.sendCommand(`Runtime.evaluate`,{expression:`JSON.stringify(process.memoryUsage())`,returnByValue:!0});c(JSON.parse(t.result.value))}catch{}finally{u(!1)}},[e]);function v(e){return e<1024?`${e}B`:e<1024*1024?`${(e/1024).toFixed(1)}KB`:`${(e/1024/1024).toFixed(1)}MB`}let y=e.connected?`connected${e.bunVersion?` · bun v${e.bunVersion}`:``}`:e.connecting?`connecting…`:e.active?`inspector active, connecting…`:`inspector not available`,b=e.connected?`bg-emerald-400`:e.connecting?`bg-amber-400 pulse-soft`:e.active?`bg-sky-400`:`bg-[var(--color-line-2)]`;return(0,U.jsxs)(`div`,{className:`space-y-5`,children:[(0,U.jsxs)(W,{children:[(0,U.jsxs)(G,{className:`flex items-center justify-between`,children:[(0,U.jsx)(`span`,{className:`overline`,children:`runtime inspector`}),(0,U.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,U.jsxs)(`span`,{className:`flex items-center gap-1.5 text-[11px] font-mono text-[var(--color-fg-2)]`,children:[(0,U.jsx)(`span`,{className:`inline-block w-1.5 h-1.5 rounded-full ${b}`}),y]}),e.connected?(0,U.jsx)(J,{variant:`ghost`,size:`sm`,onClick:e.disconnect,children:`disconnect`}):(0,U.jsx)(J,{variant:`ghost`,size:`sm`,onClick:e.preconfiguredTarget?p:e.refetch,disabled:e.connecting,children:e.preconfiguredTarget?`reconnect`:`refresh`})]})]}),e.error&&(0,U.jsx)(K,{children:(0,U.jsx)(`p`,{className:`text-xs text-red-300 font-mono`,children:e.error})})]}),e.connected&&(0,U.jsxs)(U.Fragment,{children:[(0,U.jsxs)(W,{children:[(0,U.jsxs)(G,{className:`flex items-center justify-between`,children:[(0,U.jsx)(`span`,{className:`overline`,children:`cpu profiler`}),(0,U.jsxs)(`div`,{className:`flex items-center gap-2`,children:[t&&(0,U.jsxs)(`span`,{className:`text-[10px] font-mono uppercase tracking-wider text-red-300 flex items-center gap-1.5`,children:[(0,U.jsx)(`span`,{className:`inline-block w-1.5 h-1.5 rounded-full bg-red-400 pulse-soft`}),`recording`]}),t?(0,U.jsx)(J,{variant:`danger`,size:`sm`,onClick:h,children:`stop & render`}):(0,U.jsx)(J,{variant:`primary`,size:`sm`,onClick:m,children:`start recording`})]})]}),(0,U.jsx)(K,{children:r?(0,U.jsx)(js,{profile:r,children:(0,U.jsx)(`div`,{className:`bg-[var(--color-surface-0)] border border-[var(--color-line-1)] rounded-sm p-2 overflow-x-hidden`,children:(0,U.jsx)(Cc,{profile:r})})}):(0,U.jsx)(`p`,{className:`text-[11px] font-mono text-[var(--color-fg-3)]`,children:t?`recording… perform actions in ssg, then stop.`:`click start recording, perform actions, then stop.`})})]}),(0,U.jsxs)(W,{children:[(0,U.jsxs)(G,{className:`flex items-center justify-between`,children:[(0,U.jsx)(`span`,{className:`overline`,children:`memory`}),(0,U.jsx)(J,{variant:`ghost`,size:`sm`,onClick:g,disabled:l,children:l?`…`:`refresh`})]}),(0,U.jsx)(K,{children:s?(0,U.jsx)(Ms,{memory:s,formatValue:v}):(0,U.jsx)(`p`,{className:`text-[11px] font-mono text-[var(--color-fg-3)]`,children:`click refresh to fetch process.memoryUsage().`})})]}),(0,U.jsxs)(W,{children:[(0,U.jsxs)(G,{className:`flex items-center justify-between`,children:[(0,U.jsx)(`span`,{className:`overline`,children:`console`}),(0,U.jsx)(J,{variant:`ghost`,size:`sm`,onClick:()=>o([]),children:`clear`})]}),(0,U.jsx)(K,{children:(0,U.jsxs)(`div`,{className:`bg-[var(--color-surface-0)] border border-[var(--color-line-1)] rounded-sm p-2 h-56 overflow-y-auto font-mono text-[11px]`,children:[a.length===0?(0,U.jsx)(`p`,{className:`text-[var(--color-fg-4)]`,children:`console output will appear here…`}):a.map(e=>(0,U.jsxs)(`div`,{className:`py-0.5 border-b border-[var(--color-line-0)] ${kc[e.type]??`text-[var(--color-fg-1)]`}`,children:[(0,U.jsxs)(`span`,{className:`text-[var(--color-fg-4)] mr-2 uppercase tracking-wider`,children:[`[`,e.type,`]`]}),e.args.map(Ac).join(` `)]},e.id)),(0,U.jsx)(`div`,{ref:d})]})})]})]}),!e.connected&&!e.connecting&&(0,U.jsx)(`div`,{className:`rounded-sm border border-dashed border-[var(--color-line-1)] bg-[var(--color-surface-1)]/50 px-4 py-6 text-center`,children:(0,U.jsx)(`p`,{className:`text-[11px] font-mono text-[var(--color-fg-3)]`,children:e.active?`waiting for inspector connection…`:`inspector auto-starts with ssg serve. profiler, memory, and console appear here once connected.`})})]})}function Mc({active:e,onClick:t,children:n}){return(0,U.jsxs)(`button`,{onClick:t,className:`relative px-3 h-9 text-[11px] font-mono uppercase tracking-wider transition-colors cursor-pointer ${e?`text-[var(--color-fg-0)]`:`text-[var(--color-fg-3)] hover:text-[var(--color-fg-1)]`}`,children:[n,e&&(0,U.jsx)(`span`,{className:`absolute inset-x-2 -bottom-px h-px bg-[var(--color-brand)]`})]})}function Nc(){let[e,t]=(0,_.useState)(`eval`);return(0,U.jsxs)(`div`,{className:`space-y-0`,children:[(0,U.jsxs)(`div`,{className:`flex items-center border-b border-[var(--color-line-0)] mb-5`,children:[(0,U.jsx)(Mc,{active:e===`eval`,onClick:()=>t(`eval`),children:`eval profile`}),(0,U.jsx)(Mc,{active:e===`inspector`,onClick:()=>t(`inspector`),children:`runtime inspector`})]}),e===`eval`?(0,U.jsx)(Oc,{}):(0,U.jsx)(jc,{})]})}function Pc(e){return e>=1e6?`${(e/1e6).toFixed(1)}M`:e>=1e3?`${(e/1e3).toFixed(1)}k`:String(e)}var Fc=[{value:`downloads`,label:`most downloaded`},{value:`newest`,label:`newest`},{value:`rules`,label:`most rules`}],Ic=[``,`critical`,`high`,`medium`,`low`],Lc=[``,`deny`,`ask`,`allow`,`log`];function Rc(){return(0,U.jsxs)(`div`,{className:`rounded-sm border border-[var(--color-line-0)] bg-[var(--color-surface-1)] p-4 space-y-3 shimmer`,children:[(0,U.jsx)(`div`,{className:`h-4 bg-[var(--color-surface-3)] rounded-sm w-2/3`}),(0,U.jsx)(`div`,{className:`h-3 bg-[var(--color-surface-2)] rounded-sm w-1/3`}),(0,U.jsxs)(`div`,{className:`flex gap-1.5`,children:[(0,U.jsx)(`div`,{className:`h-5 bg-[var(--color-surface-3)] rounded-sm w-14`}),(0,U.jsx)(`div`,{className:`h-5 bg-[var(--color-surface-3)] rounded-sm w-10`})]}),(0,U.jsx)(`div`,{className:`h-7 bg-[var(--color-surface-3)] rounded-sm`})]})}function zc({tech:e}){return(0,U.jsx)(`span`,{className:`inline-flex items-center px-1.5 py-0.5 rounded-sm text-[10px] font-mono uppercase tracking-wider border ${{typescript:`bg-sky-500/8 text-sky-300 border-sky-500/25`,ts:`bg-sky-500/8 text-sky-300 border-sky-500/25`,javascript:`bg-amber-500/8 text-amber-300 border-amber-500/25`,js:`bg-amber-500/8 text-amber-300 border-amber-500/25`,python:`bg-emerald-500/8 text-emerald-300 border-emerald-500/25`,rust:`bg-orange-500/8 text-orange-300 border-orange-500/25`,go:`bg-cyan-500/8 text-cyan-300 border-cyan-500/25`,bash:`bg-violet-500/8 text-violet-300 border-violet-500/25`}[e.toLowerCase()]??`bg-[var(--color-surface-2)] text-[var(--color-fg-3)] border-[var(--color-line-1)]`}`,children:e})}function Bc({rs:e,installingId:t,onInstall:n,flashId:r}){let i=t===e.id,a=r===e.id;return(0,U.jsxs)(`div`,{className:`group relative flex flex-col rounded-sm border bg-[var(--color-surface-1)] transition-colors overflow-hidden
|
|
8
|
+
`+e.stack}}var xe=Object.prototype.hasOwnProperty,Se=t.unstable_scheduleCallback,Ce=t.unstable_cancelCallback,we=t.unstable_shouldYield,Te=t.unstable_requestPaint,Ee=t.unstable_now,De=t.unstable_getCurrentPriorityLevel,Oe=t.unstable_ImmediatePriority,ke=t.unstable_UserBlockingPriority,Ae=t.unstable_NormalPriority,je=t.unstable_LowPriority,z=t.unstable_IdlePriority,Me=t.log,Ne=t.unstable_setDisableYieldValue,Pe=null,Fe=null;function Ie(e){if(typeof Me==`function`&&Ne(e),Fe&&typeof Fe.setStrictMode==`function`)try{Fe.setStrictMode(Pe,e)}catch{}}var Le=Math.clz32?Math.clz32:Be,Re=Math.log,ze=Math.LN2;function Be(e){return e>>>=0,e===0?32:31-(Re(e)/ze|0)|0}var Ve=256,He=262144,Ue=4194304;function We(e){var t=e&42;if(t!==0)return t;switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return e&261888;case 262144:case 524288:case 1048576:case 2097152:return e&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return e&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return e}}function Ge(e,t,n){var r=e.pendingLanes;if(r===0)return 0;var a=0,o=e.suspendedLanes,s=e.pingedLanes;e=e.warmLanes;var c=r&134217727;return c===0?(c=r&~o,c===0?s===0?n||(n=r&~e,n!==0&&(a=We(n))):a=We(s):a=We(c)):(r=c&~o,r===0?(s&=c,s===0?n||(n=c&~e,n!==0&&(a=We(n))):a=We(s)):a=We(r)),a===0?0:t!==0&&t!==a&&(t&o)===0&&(o=a&-a,n=t&-t,o>=n||o===32&&n&4194048)?t:a}function Ke(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function qe(e,t){switch(e){case 1:case 2:case 4:case 8:case 64:return t+250;case 16:case 32:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return t+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function Je(){var e=Ue;return Ue<<=1,!(Ue&62914560)&&(Ue=4194304),e}function Ye(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function Xe(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function Ze(e,t,n,r,a,o){var s=e.pendingLanes;e.pendingLanes=n,e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0,e.expiredLanes&=n,e.entangledLanes&=n,e.errorRecoveryDisabledLanes&=n,e.shellSuspendCounter=0;var c=e.entanglements,l=e.expirationTimes,u=e.hiddenUpdates;for(n=s&~n;0<n;){var d=31-Le(n),f=1<<d;c[d]=0,l[d]=-1;var p=u[d];if(p!==null)for(u[d]=null,d=0;d<p.length;d++){var m=p[d];m!==null&&(m.lane&=-536870913)}n&=~f}r!==0&&Qe(e,r,0),o!==0&&a===0&&e.tag!==0&&(e.suspendedLanes|=o&~(s&~t))}function Qe(e,t,n){e.pendingLanes|=t,e.suspendedLanes&=~t;var r=31-Le(t);e.entangledLanes|=t,e.entanglements[r]=e.entanglements[r]|1073741824|n&261930}function $e(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var r=31-Le(n),a=1<<r;a&t|e[r]&t&&(e[r]|=t),n&=~a}}function et(e,t){var n=t&-t;return n=n&42?1:tt(n),(n&(e.suspendedLanes|t))===0?n:0}function tt(e){switch(e){case 2:e=1;break;case 8:e=4;break;case 32:e=16;break;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:e=128;break;case 268435456:e=134217728;break;default:e=0}return e}function nt(e){return e&=-e,2<e?8<e?e&134217727?32:268435456:8:2}function rt(){var e=P.p;return e===0?(e=window.event,e===void 0?32:hp(e.type)):e}function it(e,t){var n=P.p;try{return P.p=e,t()}finally{P.p=n}}var at=Math.random().toString(36).slice(2),ot=`__reactFiber$`+at,st=`__reactProps$`+at,ct=`__reactContainer$`+at,lt=`__reactEvents$`+at,ut=`__reactListeners$`+at,dt=`__reactHandles$`+at,ft=`__reactResources$`+at,pt=`__reactMarker$`+at;function mt(e){delete e[ot],delete e[st],delete e[lt],delete e[ut],delete e[dt]}function ht(e){var t=e[ot];if(t)return t;for(var n=e.parentNode;n;){if(t=n[ct]||n[ot]){if(n=t.alternate,t.child!==null||n!==null&&n.child!==null)for(e=ff(e);e!==null;){if(n=e[ot])return n;e=ff(e)}return t}e=n,n=e.parentNode}return null}function gt(e){if(e=e[ot]||e[ct]){var t=e.tag;if(t===5||t===6||t===13||t===31||t===26||t===27||t===3)return e}return null}function _t(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e.stateNode;throw Error(a(33))}function vt(e){var t=e[ft];return t||=e[ft]={hoistableStyles:new Map,hoistableScripts:new Map},t}function yt(e){e[pt]=!0}var bt=new Set,xt={};function St(e,t){Ct(e,t),Ct(e+`Capture`,t)}function Ct(e,t){for(xt[e]=t,e=0;e<t.length;e++)bt.add(t[e])}var wt=RegExp(`^[:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD][:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD\\-.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040]*$`),Tt={},Et={};function Dt(e){return xe.call(Et,e)?!0:xe.call(Tt,e)?!1:wt.test(e)?Et[e]=!0:(Tt[e]=!0,!1)}function Ot(e,t,n){if(Dt(t))if(n===null)e.removeAttribute(t);else{switch(typeof n){case`undefined`:case`function`:case`symbol`:e.removeAttribute(t);return;case`boolean`:var r=t.toLowerCase().slice(0,5);if(r!==`data-`&&r!==`aria-`){e.removeAttribute(t);return}}e.setAttribute(t,``+n)}}function kt(e,t,n){if(n===null)e.removeAttribute(t);else{switch(typeof n){case`undefined`:case`function`:case`symbol`:case`boolean`:e.removeAttribute(t);return}e.setAttribute(t,``+n)}}function At(e,t,n,r){if(r===null)e.removeAttribute(n);else{switch(typeof r){case`undefined`:case`function`:case`symbol`:case`boolean`:e.removeAttribute(n);return}e.setAttributeNS(t,n,``+r)}}function jt(e){switch(typeof e){case`bigint`:case`boolean`:case`number`:case`string`:case`undefined`:return e;case`object`:return e;default:return``}}function Mt(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()===`input`&&(t===`checkbox`||t===`radio`)}function Nt(e,t,n){var r=Object.getOwnPropertyDescriptor(e.constructor.prototype,t);if(!e.hasOwnProperty(t)&&r!==void 0&&typeof r.get==`function`&&typeof r.set==`function`){var a=r.get,o=r.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return a.call(this)},set:function(e){n=``+e,o.call(this,e)}}),Object.defineProperty(e,t,{enumerable:r.enumerable}),{getValue:function(){return n},setValue:function(e){n=``+e},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function Pt(e){if(!e._valueTracker){var t=Mt(e)?`checked`:`value`;e._valueTracker=Nt(e,t,``+e[t])}}function Ft(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r=``;return e&&(r=Mt(e)?e.checked?`true`:`false`:e.value),e=r,e===n?!1:(t.setValue(e),!0)}function It(e){if(e||=typeof document<`u`?document:void 0,e===void 0)return null;try{return e.activeElement||e.body}catch{return e.body}}var Lt=/[\n"\\]/g;function Rt(e){return e.replace(Lt,function(e){return`\\`+e.charCodeAt(0).toString(16)+` `})}function zt(e,t,n,r,a,o,s,c){e.name=``,s!=null&&typeof s!=`function`&&typeof s!=`symbol`&&typeof s!=`boolean`?e.type=s:e.removeAttribute(`type`),t==null?s!==`submit`&&s!==`reset`||e.removeAttribute(`value`):s===`number`?(t===0&&e.value===``||e.value!=t)&&(e.value=``+jt(t)):e.value!==``+jt(t)&&(e.value=``+jt(t)),t==null?n==null?r!=null&&e.removeAttribute(`value`):Vt(e,s,jt(n)):Vt(e,s,jt(t)),a==null&&o!=null&&(e.defaultChecked=!!o),a!=null&&(e.checked=a&&typeof a!=`function`&&typeof a!=`symbol`),c!=null&&typeof c!=`function`&&typeof c!=`symbol`&&typeof c!=`boolean`?e.name=``+jt(c):e.removeAttribute(`name`)}function Bt(e,t,n,r,a,o,s,c){if(o!=null&&typeof o!=`function`&&typeof o!=`symbol`&&typeof o!=`boolean`&&(e.type=o),t!=null||n!=null){if(!(o!==`submit`&&o!==`reset`||t!=null)){Pt(e);return}n=n==null?``:``+jt(n),t=t==null?n:``+jt(t),c||t===e.value||(e.value=t),e.defaultValue=t}r??=a,r=typeof r!=`function`&&typeof r!=`symbol`&&!!r,e.checked=c?e.checked:!!r,e.defaultChecked=!!r,s!=null&&typeof s!=`function`&&typeof s!=`symbol`&&typeof s!=`boolean`&&(e.name=s),Pt(e)}function Vt(e,t,n){t===`number`&&It(e.ownerDocument)===e||e.defaultValue===``+n||(e.defaultValue=``+n)}function Ht(e,t,n,r){if(e=e.options,t){t={};for(var a=0;a<n.length;a++)t[`$`+n[a]]=!0;for(n=0;n<e.length;n++)a=t.hasOwnProperty(`$`+e[n].value),e[n].selected!==a&&(e[n].selected=a),a&&r&&(e[n].defaultSelected=!0)}else{for(n=``+jt(n),t=null,a=0;a<e.length;a++){if(e[a].value===n){e[a].selected=!0,r&&(e[a].defaultSelected=!0);return}t!==null||e[a].disabled||(t=e[a])}t!==null&&(t.selected=!0)}}function Ut(e,t,n){if(t!=null&&(t=``+jt(t),t!==e.value&&(e.value=t),n==null)){e.defaultValue!==t&&(e.defaultValue=t);return}e.defaultValue=n==null?``:``+jt(n)}function Wt(e,t,n,r){if(t==null){if(r!=null){if(n!=null)throw Error(a(92));if(re(r)){if(1<r.length)throw Error(a(93));r=r[0]}n=r}n??=``,t=n}n=jt(t),e.defaultValue=n,r=e.textContent,r===n&&r!==``&&r!==null&&(e.value=r),Pt(e)}function Gt(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var Kt=new Set(`animationIterationCount aspectRatio borderImageOutset borderImageSlice borderImageWidth boxFlex boxFlexGroup boxOrdinalGroup columnCount columns flex flexGrow flexPositive flexShrink flexNegative flexOrder gridArea gridRow gridRowEnd gridRowSpan gridRowStart gridColumn gridColumnEnd gridColumnSpan gridColumnStart fontWeight lineClamp lineHeight opacity order orphans scale tabSize widows zIndex zoom fillOpacity floodOpacity stopOpacity strokeDasharray strokeDashoffset strokeMiterlimit strokeOpacity strokeWidth MozAnimationIterationCount MozBoxFlex MozBoxFlexGroup MozLineClamp msAnimationIterationCount msFlex msZoom msFlexGrow msFlexNegative msFlexOrder msFlexPositive msFlexShrink msGridColumn msGridColumnSpan msGridRow msGridRowSpan WebkitAnimationIterationCount WebkitBoxFlex WebKitBoxFlexGroup WebkitBoxOrdinalGroup WebkitColumnCount WebkitColumns WebkitFlex WebkitFlexGrow WebkitFlexPositive WebkitFlexShrink WebkitLineClamp`.split(` `));function qt(e,t,n){var r=t.indexOf(`--`)===0;n==null||typeof n==`boolean`||n===``?r?e.setProperty(t,``):t===`float`?e.cssFloat=``:e[t]=``:r?e.setProperty(t,n):typeof n!=`number`||n===0||Kt.has(t)?t===`float`?e.cssFloat=n:e[t]=(``+n).trim():e[t]=n+`px`}function Jt(e,t,n){if(t!=null&&typeof t!=`object`)throw Error(a(62));if(e=e.style,n!=null){for(var r in n)!n.hasOwnProperty(r)||t!=null&&t.hasOwnProperty(r)||(r.indexOf(`--`)===0?e.setProperty(r,``):r===`float`?e.cssFloat=``:e[r]=``);for(var o in t)r=t[o],t.hasOwnProperty(o)&&n[o]!==r&&qt(e,o,r)}else for(var s in t)t.hasOwnProperty(s)&&qt(e,s,t[s])}function Yt(e){if(e.indexOf(`-`)===-1)return!1;switch(e){case`annotation-xml`:case`color-profile`:case`font-face`:case`font-face-src`:case`font-face-uri`:case`font-face-format`:case`font-face-name`:case`missing-glyph`:return!1;default:return!0}}var Xt=new Map([[`acceptCharset`,`accept-charset`],[`htmlFor`,`for`],[`httpEquiv`,`http-equiv`],[`crossOrigin`,`crossorigin`],[`accentHeight`,`accent-height`],[`alignmentBaseline`,`alignment-baseline`],[`arabicForm`,`arabic-form`],[`baselineShift`,`baseline-shift`],[`capHeight`,`cap-height`],[`clipPath`,`clip-path`],[`clipRule`,`clip-rule`],[`colorInterpolation`,`color-interpolation`],[`colorInterpolationFilters`,`color-interpolation-filters`],[`colorProfile`,`color-profile`],[`colorRendering`,`color-rendering`],[`dominantBaseline`,`dominant-baseline`],[`enableBackground`,`enable-background`],[`fillOpacity`,`fill-opacity`],[`fillRule`,`fill-rule`],[`floodColor`,`flood-color`],[`floodOpacity`,`flood-opacity`],[`fontFamily`,`font-family`],[`fontSize`,`font-size`],[`fontSizeAdjust`,`font-size-adjust`],[`fontStretch`,`font-stretch`],[`fontStyle`,`font-style`],[`fontVariant`,`font-variant`],[`fontWeight`,`font-weight`],[`glyphName`,`glyph-name`],[`glyphOrientationHorizontal`,`glyph-orientation-horizontal`],[`glyphOrientationVertical`,`glyph-orientation-vertical`],[`horizAdvX`,`horiz-adv-x`],[`horizOriginX`,`horiz-origin-x`],[`imageRendering`,`image-rendering`],[`letterSpacing`,`letter-spacing`],[`lightingColor`,`lighting-color`],[`markerEnd`,`marker-end`],[`markerMid`,`marker-mid`],[`markerStart`,`marker-start`],[`overlinePosition`,`overline-position`],[`overlineThickness`,`overline-thickness`],[`paintOrder`,`paint-order`],[`panose-1`,`panose-1`],[`pointerEvents`,`pointer-events`],[`renderingIntent`,`rendering-intent`],[`shapeRendering`,`shape-rendering`],[`stopColor`,`stop-color`],[`stopOpacity`,`stop-opacity`],[`strikethroughPosition`,`strikethrough-position`],[`strikethroughThickness`,`strikethrough-thickness`],[`strokeDasharray`,`stroke-dasharray`],[`strokeDashoffset`,`stroke-dashoffset`],[`strokeLinecap`,`stroke-linecap`],[`strokeLinejoin`,`stroke-linejoin`],[`strokeMiterlimit`,`stroke-miterlimit`],[`strokeOpacity`,`stroke-opacity`],[`strokeWidth`,`stroke-width`],[`textAnchor`,`text-anchor`],[`textDecoration`,`text-decoration`],[`textRendering`,`text-rendering`],[`transformOrigin`,`transform-origin`],[`underlinePosition`,`underline-position`],[`underlineThickness`,`underline-thickness`],[`unicodeBidi`,`unicode-bidi`],[`unicodeRange`,`unicode-range`],[`unitsPerEm`,`units-per-em`],[`vAlphabetic`,`v-alphabetic`],[`vHanging`,`v-hanging`],[`vIdeographic`,`v-ideographic`],[`vMathematical`,`v-mathematical`],[`vectorEffect`,`vector-effect`],[`vertAdvY`,`vert-adv-y`],[`vertOriginX`,`vert-origin-x`],[`vertOriginY`,`vert-origin-y`],[`wordSpacing`,`word-spacing`],[`writingMode`,`writing-mode`],[`xmlnsXlink`,`xmlns:xlink`],[`xHeight`,`x-height`]]),Zt=/^[\u0000-\u001F ]*j[\r\n\t]*a[\r\n\t]*v[\r\n\t]*a[\r\n\t]*s[\r\n\t]*c[\r\n\t]*r[\r\n\t]*i[\r\n\t]*p[\r\n\t]*t[\r\n\t]*:/i;function Qt(e){return Zt.test(``+e)?`javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')`:e}function $t(){}var en=null;function tn(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var nn=null,rn=null;function an(e){var t=gt(e);if(t&&(e=t.stateNode)){var n=e[st]||null;a:switch(e=t.stateNode,t.type){case`input`:if(zt(e,n.value,n.defaultValue,n.defaultValue,n.checked,n.defaultChecked,n.type,n.name),t=n.name,n.type===`radio`&&t!=null){for(n=e;n.parentNode;)n=n.parentNode;for(n=n.querySelectorAll(`input[name="`+Rt(``+t)+`"][type="radio"]`),t=0;t<n.length;t++){var r=n[t];if(r!==e&&r.form===e.form){var o=r[st]||null;if(!o)throw Error(a(90));zt(r,o.value,o.defaultValue,o.defaultValue,o.checked,o.defaultChecked,o.type,o.name)}}for(t=0;t<n.length;t++)r=n[t],r.form===e.form&&Ft(r)}break a;case`textarea`:Ut(e,n.value,n.defaultValue);break a;case`select`:t=n.value,t!=null&&Ht(e,!!n.multiple,t,!1)}}}var on=!1;function sn(e,t,n){if(on)return e(t,n);on=!0;try{return e(t)}finally{if(on=!1,(nn!==null||rn!==null)&&(yu(),nn&&(t=nn,e=rn,rn=nn=null,an(t),e)))for(t=0;t<e.length;t++)an(e[t])}}function cn(e,t){var n=e.stateNode;if(n===null)return null;var r=n[st]||null;if(r===null)return null;n=r[t];a:switch(t){case`onClick`:case`onClickCapture`:case`onDoubleClick`:case`onDoubleClickCapture`:case`onMouseDown`:case`onMouseDownCapture`:case`onMouseMove`:case`onMouseMoveCapture`:case`onMouseUp`:case`onMouseUpCapture`:case`onMouseEnter`:(r=!r.disabled)||(e=e.type,r=!(e===`button`||e===`input`||e===`select`||e===`textarea`)),e=!r;break a;default:e=!1}if(e)return null;if(n&&typeof n!=`function`)throw Error(a(231,t,typeof n));return n}var ln=!(typeof window>`u`||window.document===void 0||window.document.createElement===void 0),un=!1;if(ln)try{var dn={};Object.defineProperty(dn,`passive`,{get:function(){un=!0}}),window.addEventListener(`test`,dn,dn),window.removeEventListener(`test`,dn,dn)}catch{un=!1}var fn=null,pn=null,mn=null;function hn(){if(mn)return mn;var e,t=pn,n=t.length,r,a=`value`in fn?fn.value:fn.textContent,o=a.length;for(e=0;e<n&&t[e]===a[e];e++);var s=n-e;for(r=1;r<=s&&t[n-r]===a[o-r];r++);return mn=a.slice(e,1<r?1-r:void 0)}function gn(e){var t=e.keyCode;return`charCode`in e?(e=e.charCode,e===0&&t===13&&(e=13)):e=t,e===10&&(e=13),32<=e||e===13?e:0}function _n(){return!0}function vn(){return!1}function yn(e){function t(t,n,r,a,o){for(var s in this._reactName=t,this._targetInst=r,this.type=n,this.nativeEvent=a,this.target=o,this.currentTarget=null,e)e.hasOwnProperty(s)&&(t=e[s],this[s]=t?t(a):a[s]);return this.isDefaultPrevented=(a.defaultPrevented==null?!1===a.returnValue:a.defaultPrevented)?_n:vn,this.isPropagationStopped=vn,this}return g(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var e=this.nativeEvent;e&&(e.preventDefault?e.preventDefault():typeof e.returnValue!=`unknown`&&(e.returnValue=!1),this.isDefaultPrevented=_n)},stopPropagation:function(){var e=this.nativeEvent;e&&(e.stopPropagation?e.stopPropagation():typeof e.cancelBubble!=`unknown`&&(e.cancelBubble=!0),this.isPropagationStopped=_n)},persist:function(){},isPersistent:_n}),t}var bn={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},xn=yn(bn),B=g({},bn,{view:0,detail:0}),Sn=yn(B),Cn,wn,Tn,En=g({},B,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:In,button:0,buttons:0,relatedTarget:function(e){return e.relatedTarget===void 0?e.fromElement===e.srcElement?e.toElement:e.fromElement:e.relatedTarget},movementX:function(e){return`movementX`in e?e.movementX:(e!==Tn&&(Tn&&e.type===`mousemove`?(Cn=e.screenX-Tn.screenX,wn=e.screenY-Tn.screenY):wn=Cn=0,Tn=e),Cn)},movementY:function(e){return`movementY`in e?e.movementY:wn}}),Dn=yn(En),On=yn(g({},En,{dataTransfer:0})),kn=yn(g({},B,{relatedTarget:0})),An=yn(g({},bn,{animationName:0,elapsedTime:0,pseudoElement:0})),jn=yn(g({},bn,{clipboardData:function(e){return`clipboardData`in e?e.clipboardData:window.clipboardData}})),V=yn(g({},bn,{data:0})),Mn={Esc:`Escape`,Spacebar:` `,Left:`ArrowLeft`,Up:`ArrowUp`,Right:`ArrowRight`,Down:`ArrowDown`,Del:`Delete`,Win:`OS`,Menu:`ContextMenu`,Apps:`ContextMenu`,Scroll:`ScrollLock`,MozPrintableKey:`Unidentified`},Nn={8:`Backspace`,9:`Tab`,12:`Clear`,13:`Enter`,16:`Shift`,17:`Control`,18:`Alt`,19:`Pause`,20:`CapsLock`,27:`Escape`,32:` `,33:`PageUp`,34:`PageDown`,35:`End`,36:`Home`,37:`ArrowLeft`,38:`ArrowUp`,39:`ArrowRight`,40:`ArrowDown`,45:`Insert`,46:`Delete`,112:`F1`,113:`F2`,114:`F3`,115:`F4`,116:`F5`,117:`F6`,118:`F7`,119:`F8`,120:`F9`,121:`F10`,122:`F11`,123:`F12`,144:`NumLock`,145:`ScrollLock`,224:`Meta`},Pn={Alt:`altKey`,Control:`ctrlKey`,Meta:`metaKey`,Shift:`shiftKey`};function Fn(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=Pn[e])?!!t[e]:!1}function In(){return Fn}var Ln=yn(g({},B,{key:function(e){if(e.key){var t=Mn[e.key]||e.key;if(t!==`Unidentified`)return t}return e.type===`keypress`?(e=gn(e),e===13?`Enter`:String.fromCharCode(e)):e.type===`keydown`||e.type===`keyup`?Nn[e.keyCode]||`Unidentified`:``},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:In,charCode:function(e){return e.type===`keypress`?gn(e):0},keyCode:function(e){return e.type===`keydown`||e.type===`keyup`?e.keyCode:0},which:function(e){return e.type===`keypress`?gn(e):e.type===`keydown`||e.type===`keyup`?e.keyCode:0}})),Rn=yn(g({},En,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0})),H=yn(g({},B,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:In})),zn=yn(g({},bn,{propertyName:0,elapsedTime:0,pseudoElement:0})),Bn=yn(g({},En,{deltaX:function(e){return`deltaX`in e?e.deltaX:`wheelDeltaX`in e?-e.wheelDeltaX:0},deltaY:function(e){return`deltaY`in e?e.deltaY:`wheelDeltaY`in e?-e.wheelDeltaY:`wheelDelta`in e?-e.wheelDelta:0},deltaZ:0,deltaMode:0})),Vn=yn(g({},bn,{newState:0,oldState:0})),Hn=[9,13,27,32],Un=ln&&`CompositionEvent`in window,Wn=null;ln&&`documentMode`in document&&(Wn=document.documentMode);var Gn=ln&&`TextEvent`in window&&!Wn,Kn=ln&&(!Un||Wn&&8<Wn&&11>=Wn),qn=` `,Jn=!1;function Yn(e,t){switch(e){case`keyup`:return Hn.indexOf(t.keyCode)!==-1;case`keydown`:return t.keyCode!==229;case`keypress`:case`mousedown`:case`focusout`:return!0;default:return!1}}function Xn(e){return e=e.detail,typeof e==`object`&&`data`in e?e.data:null}var Zn=!1;function Qn(e,t){switch(e){case`compositionend`:return Xn(t);case`keypress`:return t.which===32?(Jn=!0,qn):null;case`textInput`:return e=t.data,e===qn&&Jn?null:e;default:return null}}function $n(e,t){if(Zn)return e===`compositionend`||!Un&&Yn(e,t)?(e=hn(),mn=pn=fn=null,Zn=!1,e):null;switch(e){case`paste`:return null;case`keypress`:if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1<t.char.length)return t.char;if(t.which)return String.fromCharCode(t.which)}return null;case`compositionend`:return Kn&&t.locale!==`ko`?null:t.data;default:return null}}var er={color:!0,date:!0,datetime:!0,"datetime-local":!0,email:!0,month:!0,number:!0,password:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0};function tr(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t===`input`?!!er[e.type]:t===`textarea`}function nr(e,t,n,r){nn?rn?rn.push(r):rn=[r]:nn=r,t=Ed(t,`onChange`),0<t.length&&(n=new xn(`onChange`,`change`,null,n,r),e.push({event:n,listeners:t}))}var U=null,rr=null;function ir(e){yd(e,0)}function ar(e){if(Ft(_t(e)))return e}function or(e,t){if(e===`change`)return t}var W=!1;if(ln){var sr;if(ln){var G=`oninput`in document;if(!G){var K=document.createElement(`div`);K.setAttribute(`oninput`,`return;`),G=typeof K.oninput==`function`}sr=G}else sr=!1;W=sr&&(!document.documentMode||9<document.documentMode)}function q(){U&&(U.detachEvent(`onpropertychange`,cr),rr=U=null)}function cr(e){if(e.propertyName===`value`&&ar(rr)){var t=[];nr(t,rr,e,tn(e)),sn(ir,t)}}function lr(e,t,n){e===`focusin`?(q(),U=t,rr=n,U.attachEvent(`onpropertychange`,cr)):e===`focusout`&&q()}function ur(e){if(e===`selectionchange`||e===`keyup`||e===`keydown`)return ar(rr)}function dr(e,t){if(e===`click`)return ar(t)}function J(e,t){if(e===`input`||e===`change`)return ar(t)}function fr(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}var pr=typeof Object.is==`function`?Object.is:fr;function mr(e,t){if(pr(e,t))return!0;if(typeof e!=`object`||!e||typeof t!=`object`||!t)return!1;var n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(r=0;r<n.length;r++){var a=n[r];if(!xe.call(t,a)||!pr(e[a],t[a]))return!1}return!0}function hr(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function gr(e,t){var n=hr(e);e=0;for(var r;n;){if(n.nodeType===3){if(r=e+n.textContent.length,e<=t&&r>=t)return{node:n,offset:t-e};e=r}a:{for(;n;){if(n.nextSibling){n=n.nextSibling;break a}n=n.parentNode}n=void 0}n=hr(n)}}function _r(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?_r(e,t.parentNode):`contains`in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function vr(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=It(e.document);t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href==`string`}catch{n=!1}if(n)e=t.contentWindow;else break;t=It(e.document)}return t}function yr(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t===`input`&&(e.type===`text`||e.type===`search`||e.type===`tel`||e.type===`url`||e.type===`password`)||t===`textarea`||e.contentEditable===`true`)}var br=ln&&`documentMode`in document&&11>=document.documentMode,xr=null,Sr=null,Cr=null,wr=!1;function Tr(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;wr||xr==null||xr!==It(r)||(r=xr,`selectionStart`in r&&yr(r)?r={start:r.selectionStart,end:r.selectionEnd}:(r=(r.ownerDocument&&r.ownerDocument.defaultView||window).getSelection(),r={anchorNode:r.anchorNode,anchorOffset:r.anchorOffset,focusNode:r.focusNode,focusOffset:r.focusOffset}),Cr&&mr(Cr,r)||(Cr=r,r=Ed(Sr,`onSelect`),0<r.length&&(t=new xn(`onSelect`,`select`,null,t,n),e.push({event:t,listeners:r}),t.target=xr)))}function Er(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n[`Webkit`+e]=`webkit`+t,n[`Moz`+e]=`moz`+t,n}var Dr={animationend:Er(`Animation`,`AnimationEnd`),animationiteration:Er(`Animation`,`AnimationIteration`),animationstart:Er(`Animation`,`AnimationStart`),transitionrun:Er(`Transition`,`TransitionRun`),transitionstart:Er(`Transition`,`TransitionStart`),transitioncancel:Er(`Transition`,`TransitionCancel`),transitionend:Er(`Transition`,`TransitionEnd`)},Or={},kr={};ln&&(kr=document.createElement(`div`).style,`AnimationEvent`in window||(delete Dr.animationend.animation,delete Dr.animationiteration.animation,delete Dr.animationstart.animation),`TransitionEvent`in window||delete Dr.transitionend.transition);function Ar(e){if(Or[e])return Or[e];if(!Dr[e])return e;var t=Dr[e],n;for(n in t)if(t.hasOwnProperty(n)&&n in kr)return Or[e]=t[n];return e}var jr=Ar(`animationend`),Mr=Ar(`animationiteration`),Nr=Ar(`animationstart`),Pr=Ar(`transitionrun`),Fr=Ar(`transitionstart`),Ir=Ar(`transitioncancel`),Lr=Ar(`transitionend`),Rr=new Map,zr=`abort auxClick beforeToggle cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel`.split(` `);zr.push(`scrollEnd`);function Br(e,t){Rr.set(e,t),St(t,[e])}var Vr=typeof reportError==`function`?reportError:function(e){if(typeof window==`object`&&typeof window.ErrorEvent==`function`){var t=new window.ErrorEvent(`error`,{bubbles:!0,cancelable:!0,message:typeof e==`object`&&e&&typeof e.message==`string`?String(e.message):String(e),error:e});if(!window.dispatchEvent(t))return}else if(typeof process==`object`&&typeof process.emit==`function`){process.emit(`uncaughtException`,e);return}console.error(e)},Hr=[],Ur=0,Wr=0;function Gr(){for(var e=Ur,t=Wr=Ur=0;t<e;){var n=Hr[t];Hr[t++]=null;var r=Hr[t];Hr[t++]=null;var a=Hr[t];Hr[t++]=null;var o=Hr[t];if(Hr[t++]=null,r!==null&&a!==null){var s=r.pending;s===null?a.next=a:(a.next=s.next,s.next=a),r.pending=a}o!==0&&Yr(n,a,o)}}function Kr(e,t,n,r){Hr[Ur++]=e,Hr[Ur++]=t,Hr[Ur++]=n,Hr[Ur++]=r,Wr|=r,e.lanes|=r,e=e.alternate,e!==null&&(e.lanes|=r)}function qr(e,t,n,r){return Kr(e,t,n,r),Xr(e)}function Jr(e,t){return Kr(e,null,null,t),Xr(e)}function Yr(e,t,n){e.lanes|=n;var r=e.alternate;r!==null&&(r.lanes|=n);for(var a=!1,o=e.return;o!==null;)o.childLanes|=n,r=o.alternate,r!==null&&(r.childLanes|=n),o.tag===22&&(e=o.stateNode,e===null||e._visibility&1||(a=!0)),e=o,o=o.return;return e.tag===3?(o=e.stateNode,a&&t!==null&&(a=31-Le(n),e=o.hiddenUpdates,r=e[a],r===null?e[a]=[t]:r.push(t),t.lane=n|536870912),o):null}function Xr(e){if(50<uu)throw uu=0,du=null,Error(a(185));for(var t=e.return;t!==null;)e=t,t=e.return;return e.tag===3?e.stateNode:null}var Zr={};function Qr(e,t,n,r){this.tag=e,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=r,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function $r(e,t,n,r){return new Qr(e,t,n,r)}function ei(e){return e=e.prototype,!(!e||!e.isReactComponent)}function ti(e,t){var n=e.alternate;return n===null?(n=$r(e.tag,t,e.key,e.mode),n.elementType=e.elementType,n.type=e.type,n.stateNode=e.stateNode,n.alternate=e,e.alternate=n):(n.pendingProps=t,n.type=e.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=e.flags&65011712,n.childLanes=e.childLanes,n.lanes=e.lanes,n.child=e.child,n.memoizedProps=e.memoizedProps,n.memoizedState=e.memoizedState,n.updateQueue=e.updateQueue,t=e.dependencies,n.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},n.sibling=e.sibling,n.index=e.index,n.ref=e.ref,n.refCleanup=e.refCleanup,n}function ni(e,t){e.flags&=65011714;var n=e.alternate;return n===null?(e.childLanes=0,e.lanes=t,e.child=null,e.subtreeFlags=0,e.memoizedProps=null,e.memoizedState=null,e.updateQueue=null,e.dependencies=null,e.stateNode=null):(e.childLanes=n.childLanes,e.lanes=n.lanes,e.child=n.child,e.subtreeFlags=0,e.deletions=null,e.memoizedProps=n.memoizedProps,e.memoizedState=n.memoizedState,e.updateQueue=n.updateQueue,e.type=n.type,t=n.dependencies,e.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext}),e}function ri(e,t,n,r,o,s){var c=0;if(r=e,typeof e==`function`)ei(e)&&(c=1);else if(typeof e==`string`)c=Wf(e,n,se.current)?26:e===`html`||e===`head`||e===`body`?27:5;else a:switch(e){case A:return e=$r(31,n,t,o),e.elementType=A,e.lanes=s,e;case b:return ii(n.children,o,s,t);case x:c=8,o|=24;break;case S:return e=$r(12,n,t,o|2),e.elementType=S,e.lanes=s,e;case E:return e=$r(13,n,t,o),e.elementType=E,e.lanes=s,e;case D:return e=$r(19,n,t,o),e.elementType=D,e.lanes=s,e;default:if(typeof e==`object`&&e)switch(e.$$typeof){case w:c=10;break a;case C:c=9;break a;case T:c=11;break a;case O:c=14;break a;case k:c=16,r=null;break a}c=29,n=Error(a(130,e===null?`null`:typeof e,``)),r=null}return t=$r(c,n,t,o),t.elementType=e,t.type=r,t.lanes=s,t}function ii(e,t,n,r){return e=$r(7,e,r,t),e.lanes=n,e}function ai(e,t,n){return e=$r(6,e,null,t),e.lanes=n,e}function oi(e){var t=$r(18,null,null,0);return t.stateNode=e,t}function si(e,t,n){return t=$r(4,e.children===null?[]:e.children,e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}var ci=new WeakMap;function li(e,t){if(typeof e==`object`&&e){var n=ci.get(e);return n===void 0?(t={value:e,source:t,stack:be(t)},ci.set(e,t),t):n}return{value:e,source:t,stack:be(t)}}var ui=[],di=0,fi=null,pi=0,mi=[],hi=0,gi=null,_i=1,vi=``;function yi(e,t){ui[di++]=pi,ui[di++]=fi,fi=e,pi=t}function bi(e,t,n){mi[hi++]=_i,mi[hi++]=vi,mi[hi++]=gi,gi=e;var r=_i;e=vi;var a=32-Le(r)-1;r&=~(1<<a),n+=1;var o=32-Le(t)+a;if(30<o){var s=a-a%5;o=(r&(1<<s)-1).toString(32),r>>=s,a-=s,_i=1<<32-Le(t)+a|n<<a|r,vi=o+e}else _i=1<<o|n<<a|r,vi=e}function xi(e){e.return!==null&&(yi(e,1),bi(e,1,0))}function Si(e){for(;e===fi;)fi=ui[--di],ui[di]=null,pi=ui[--di],ui[di]=null;for(;e===gi;)gi=mi[--hi],mi[hi]=null,vi=mi[--hi],mi[hi]=null,_i=mi[--hi],mi[hi]=null}function Ci(e,t){mi[hi++]=_i,mi[hi++]=vi,mi[hi++]=gi,_i=t.id,vi=t.overflow,gi=e}var wi=null,Ti=null,Y=!1,Ei=null,Di=!1,Oi=Error(a(519));function ki(e){throw Fi(li(Error(a(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?`text`:`HTML`,``)),e)),Oi}function Ai(e){var t=e.stateNode,n=e.type,r=e.memoizedProps;switch(t[ot]=e,t[st]=r,n){case`dialog`:$(`cancel`,t),$(`close`,t);break;case`iframe`:case`object`:case`embed`:$(`load`,t);break;case`video`:case`audio`:for(n=0;n<_d.length;n++)$(_d[n],t);break;case`source`:$(`error`,t);break;case`img`:case`image`:case`link`:$(`error`,t),$(`load`,t);break;case`details`:$(`toggle`,t);break;case`input`:$(`invalid`,t),Bt(t,r.value,r.defaultValue,r.checked,r.defaultChecked,r.type,r.name,!0);break;case`select`:$(`invalid`,t);break;case`textarea`:$(`invalid`,t),Wt(t,r.value,r.defaultValue,r.children)}n=r.children,typeof n!=`string`&&typeof n!=`number`&&typeof n!=`bigint`||t.textContent===``+n||!0===r.suppressHydrationWarning||Md(t.textContent,n)?(r.popover!=null&&($(`beforetoggle`,t),$(`toggle`,t)),r.onScroll!=null&&$(`scroll`,t),r.onScrollEnd!=null&&$(`scrollend`,t),r.onClick!=null&&(t.onclick=$t),t=!0):t=!1,t||ki(e,!0)}function ji(e){for(wi=e.return;wi;)switch(wi.tag){case 5:case 31:case 13:Di=!1;return;case 27:case 3:Di=!0;return;default:wi=wi.return}}function Mi(e){if(e!==wi)return!1;if(!Y)return ji(e),Y=!0,!1;var t=e.tag,n;if((n=t!==3&&t!==27)&&((n=t===5)&&(n=e.type,n=!(n!==`form`&&n!==`button`)||Wd(e.type,e.memoizedProps)),n=!n),n&&Ti&&ki(e),ji(e),t===13){if(e=e.memoizedState,e=e===null?null:e.dehydrated,!e)throw Error(a(317));Ti=df(e)}else if(t===31){if(e=e.memoizedState,e=e===null?null:e.dehydrated,!e)throw Error(a(317));Ti=df(e)}else t===27?(t=Ti,Qd(e.type)?(e=uf,uf=null,Ti=e):Ti=t):Ti=wi?lf(e.stateNode.nextSibling):null;return!0}function Ni(){Ti=wi=null,Y=!1}function Pi(){var e=Ei;return e!==null&&(Xl===null?Xl=e:Xl.push.apply(Xl,e),Ei=null),e}function Fi(e){Ei===null?Ei=[e]:Ei.push(e)}var Ii=F(null),Li=null,Ri=null;function zi(e,t,n){L(Ii,t._currentValue),t._currentValue=n}function Bi(e){e._currentValue=Ii.current,I(Ii)}function Vi(e,t,n){for(;e!==null;){var r=e.alternate;if((e.childLanes&t)===t?r!==null&&(r.childLanes&t)!==t&&(r.childLanes|=t):(e.childLanes|=t,r!==null&&(r.childLanes|=t)),e===n)break;e=e.return}}function Hi(e,t,n,r){var o=e.child;for(o!==null&&(o.return=e);o!==null;){var s=o.dependencies;if(s!==null){var c=o.child;s=s.firstContext;a:for(;s!==null;){var l=s;s=o;for(var u=0;u<t.length;u++)if(l.context===t[u]){s.lanes|=n,l=s.alternate,l!==null&&(l.lanes|=n),Vi(s.return,n,e),r||(c=null);break a}s=l.next}}else if(o.tag===18){if(c=o.return,c===null)throw Error(a(341));c.lanes|=n,s=c.alternate,s!==null&&(s.lanes|=n),Vi(c,n,e),c=null}else c=o.child;if(c!==null)c.return=o;else for(c=o;c!==null;){if(c===e){c=null;break}if(o=c.sibling,o!==null){o.return=c.return,c=o;break}c=c.return}o=c}}function Ui(e,t,n,r){e=null;for(var o=t,s=!1;o!==null;){if(!s){if(o.flags&524288)s=!0;else if(o.flags&262144)break}if(o.tag===10){var c=o.alternate;if(c===null)throw Error(a(387));if(c=c.memoizedProps,c!==null){var l=o.type;pr(o.pendingProps.value,c.value)||(e===null?e=[l]:e.push(l))}}else if(o===le.current){if(c=o.alternate,c===null)throw Error(a(387));c.memoizedState.memoizedState!==o.memoizedState.memoizedState&&(e===null?e=[$f]:e.push($f))}o=o.return}e!==null&&Hi(t,e,n,r),t.flags|=262144}function Wi(e){for(e=e.firstContext;e!==null;){if(!pr(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function Gi(e){Li=e,Ri=null,e=e.dependencies,e!==null&&(e.firstContext=null)}function Ki(e){return Ji(Li,e)}function qi(e,t){return Li===null&&Gi(e),Ji(e,t)}function Ji(e,t){var n=t._currentValue;if(t={context:t,memoizedValue:n,next:null},Ri===null){if(e===null)throw Error(a(308));Ri=t,e.dependencies={lanes:0,firstContext:t},e.flags|=524288}else Ri=Ri.next=t;return n}var Yi=typeof AbortController<`u`?AbortController:function(){var e=[],t=this.signal={aborted:!1,addEventListener:function(t,n){e.push(n)}};this.abort=function(){t.aborted=!0,e.forEach(function(e){return e()})}},Xi=t.unstable_scheduleCallback,Zi=t.unstable_NormalPriority,Qi={$$typeof:w,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function $i(){return{controller:new Yi,data:new Map,refCount:0}}function ea(e){e.refCount--,e.refCount===0&&Xi(Zi,function(){e.controller.abort()})}var ta=null,na=0,ra=0,ia=null;function aa(e,t){if(ta===null){var n=ta=[];na=0,ra=dd(),ia={status:`pending`,value:void 0,then:function(e){n.push(e)}}}return na++,t.then(oa,oa),t}function oa(){if(--na===0&&ta!==null){ia!==null&&(ia.status=`fulfilled`);var e=ta;ta=null,ra=0,ia=null;for(var t=0;t<e.length;t++)(0,e[t])()}}function sa(e,t){var n=[],r={status:`pending`,value:null,reason:null,then:function(e){n.push(e)}};return e.then(function(){r.status=`fulfilled`,r.value=t;for(var e=0;e<n.length;e++)(0,n[e])(t)},function(e){for(r.status=`rejected`,r.reason=e,e=0;e<n.length;e++)(0,n[e])(void 0)}),r}var ca=N.S;N.S=function(e,t){$l=Ee(),typeof t==`object`&&t&&typeof t.then==`function`&&aa(e,t),ca!==null&&ca(e,t)};var la=F(null);function ua(){var e=la.current;return e===null?Il.pooledCache:e}function da(e,t){t===null?L(la,la.current):L(la,t.pool)}function fa(){var e=ua();return e===null?null:{parent:Qi._currentValue,pool:e}}var pa=Error(a(460)),ma=Error(a(474)),ha=Error(a(542)),ga={then:function(){}};function _a(e){return e=e.status,e===`fulfilled`||e===`rejected`}function va(e,t,n){switch(n=e[n],n===void 0?e.push(t):n!==t&&(t.then($t,$t),t=n),t.status){case`fulfilled`:return t.value;case`rejected`:throw e=t.reason,Sa(e),e;default:if(typeof t.status==`string`)t.then($t,$t);else{if(e=Il,e!==null&&100<e.shellSuspendCounter)throw Error(a(482));e=t,e.status=`pending`,e.then(function(e){if(t.status===`pending`){var n=t;n.status=`fulfilled`,n.value=e}},function(e){if(t.status===`pending`){var n=t;n.status=`rejected`,n.reason=e}})}switch(t.status){case`fulfilled`:return t.value;case`rejected`:throw e=t.reason,Sa(e),e}throw ba=t,pa}}function ya(e){try{var t=e._init;return t(e._payload)}catch(e){throw typeof e==`object`&&e&&typeof e.then==`function`?(ba=e,pa):e}}var ba=null;function xa(){if(ba===null)throw Error(a(459));var e=ba;return ba=null,e}function Sa(e){if(e===pa||e===ha)throw Error(a(483))}var Ca=null,wa=0;function Ta(e){var t=wa;return wa+=1,Ca===null&&(Ca=[]),va(Ca,e,t)}function Ea(e,t){t=t.props.ref,e.ref=t===void 0?null:t}function Da(e,t){throw t.$$typeof===_?Error(a(525)):(e=Object.prototype.toString.call(t),Error(a(31,e===`[object Object]`?`object with keys {`+Object.keys(t).join(`, `)+`}`:e)))}function Oa(e){function t(t,n){if(e){var r=t.deletions;r===null?(t.deletions=[n],t.flags|=16):r.push(n)}}function n(n,r){if(!e)return null;for(;r!==null;)t(n,r),r=r.sibling;return null}function r(e){for(var t=new Map;e!==null;)e.key===null?t.set(e.index,e):t.set(e.key,e),e=e.sibling;return t}function o(e,t){return e=ti(e,t),e.index=0,e.sibling=null,e}function s(t,n,r){return t.index=r,e?(r=t.alternate,r===null?(t.flags|=67108866,n):(r=r.index,r<n?(t.flags|=67108866,n):r)):(t.flags|=1048576,n)}function c(t){return e&&t.alternate===null&&(t.flags|=67108866),t}function l(e,t,n,r){return t===null||t.tag!==6?(t=ai(n,e.mode,r),t.return=e,t):(t=o(t,n),t.return=e,t)}function u(e,t,n,r){var a=n.type;return a===b?f(e,t,n.props.children,r,n.key):t!==null&&(t.elementType===a||typeof a==`object`&&a&&a.$$typeof===k&&ya(a)===t.type)?(t=o(t,n.props),Ea(t,n),t.return=e,t):(t=ri(n.type,n.key,n.props,null,e.mode,r),Ea(t,n),t.return=e,t)}function d(e,t,n,r){return t===null||t.tag!==4||t.stateNode.containerInfo!==n.containerInfo||t.stateNode.implementation!==n.implementation?(t=si(n,e.mode,r),t.return=e,t):(t=o(t,n.children||[]),t.return=e,t)}function f(e,t,n,r,a){return t===null||t.tag!==7?(t=ii(n,e.mode,r,a),t.return=e,t):(t=o(t,n),t.return=e,t)}function p(e,t,n){if(typeof t==`string`&&t!==``||typeof t==`number`||typeof t==`bigint`)return t=ai(``+t,e.mode,n),t.return=e,t;if(typeof t==`object`&&t){switch(t.$$typeof){case v:return n=ri(t.type,t.key,t.props,null,e.mode,n),Ea(n,t),n.return=e,n;case y:return t=si(t,e.mode,n),t.return=e,t;case k:return t=ya(t),p(e,t,n)}if(re(t)||M(t))return t=ii(t,e.mode,n,null),t.return=e,t;if(typeof t.then==`function`)return p(e,Ta(t),n);if(t.$$typeof===w)return p(e,qi(e,t),n);Da(e,t)}return null}function m(e,t,n,r){var a=t===null?null:t.key;if(typeof n==`string`&&n!==``||typeof n==`number`||typeof n==`bigint`)return a===null?l(e,t,``+n,r):null;if(typeof n==`object`&&n){switch(n.$$typeof){case v:return n.key===a?u(e,t,n,r):null;case y:return n.key===a?d(e,t,n,r):null;case k:return n=ya(n),m(e,t,n,r)}if(re(n)||M(n))return a===null?f(e,t,n,r,null):null;if(typeof n.then==`function`)return m(e,t,Ta(n),r);if(n.$$typeof===w)return m(e,t,qi(e,n),r);Da(e,n)}return null}function h(e,t,n,r,a){if(typeof r==`string`&&r!==``||typeof r==`number`||typeof r==`bigint`)return e=e.get(n)||null,l(t,e,``+r,a);if(typeof r==`object`&&r){switch(r.$$typeof){case v:return e=e.get(r.key===null?n:r.key)||null,u(t,e,r,a);case y:return e=e.get(r.key===null?n:r.key)||null,d(t,e,r,a);case k:return r=ya(r),h(e,t,n,r,a)}if(re(r)||M(r))return e=e.get(n)||null,f(t,e,r,a,null);if(typeof r.then==`function`)return h(e,t,n,Ta(r),a);if(r.$$typeof===w)return h(e,t,n,qi(t,r),a);Da(t,r)}return null}function g(a,o,c,l){for(var u=null,d=null,f=o,g=o=0,_=null;f!==null&&g<c.length;g++){f.index>g?(_=f,f=null):_=f.sibling;var v=m(a,f,c[g],l);if(v===null){f===null&&(f=_);break}e&&f&&v.alternate===null&&t(a,f),o=s(v,o,g),d===null?u=v:d.sibling=v,d=v,f=_}if(g===c.length)return n(a,f),Y&&yi(a,g),u;if(f===null){for(;g<c.length;g++)f=p(a,c[g],l),f!==null&&(o=s(f,o,g),d===null?u=f:d.sibling=f,d=f);return Y&&yi(a,g),u}for(f=r(f);g<c.length;g++)_=h(f,a,g,c[g],l),_!==null&&(e&&_.alternate!==null&&f.delete(_.key===null?g:_.key),o=s(_,o,g),d===null?u=_:d.sibling=_,d=_);return e&&f.forEach(function(e){return t(a,e)}),Y&&yi(a,g),u}function _(o,c,l,u){if(l==null)throw Error(a(151));for(var d=null,f=null,g=c,_=c=0,v=null,y=l.next();g!==null&&!y.done;_++,y=l.next()){g.index>_?(v=g,g=null):v=g.sibling;var b=m(o,g,y.value,u);if(b===null){g===null&&(g=v);break}e&&g&&b.alternate===null&&t(o,g),c=s(b,c,_),f===null?d=b:f.sibling=b,f=b,g=v}if(y.done)return n(o,g),Y&&yi(o,_),d;if(g===null){for(;!y.done;_++,y=l.next())y=p(o,y.value,u),y!==null&&(c=s(y,c,_),f===null?d=y:f.sibling=y,f=y);return Y&&yi(o,_),d}for(g=r(g);!y.done;_++,y=l.next())y=h(g,o,_,y.value,u),y!==null&&(e&&y.alternate!==null&&g.delete(y.key===null?_:y.key),c=s(y,c,_),f===null?d=y:f.sibling=y,f=y);return e&&g.forEach(function(e){return t(o,e)}),Y&&yi(o,_),d}function x(e,r,s,l){if(typeof s==`object`&&s&&s.type===b&&s.key===null&&(s=s.props.children),typeof s==`object`&&s){switch(s.$$typeof){case v:a:{for(var u=s.key;r!==null;){if(r.key===u){if(u=s.type,u===b){if(r.tag===7){n(e,r.sibling),l=o(r,s.props.children),l.return=e,e=l;break a}}else if(r.elementType===u||typeof u==`object`&&u&&u.$$typeof===k&&ya(u)===r.type){n(e,r.sibling),l=o(r,s.props),Ea(l,s),l.return=e,e=l;break a}n(e,r);break}else t(e,r);r=r.sibling}s.type===b?(l=ii(s.props.children,e.mode,l,s.key),l.return=e,e=l):(l=ri(s.type,s.key,s.props,null,e.mode,l),Ea(l,s),l.return=e,e=l)}return c(e);case y:a:{for(u=s.key;r!==null;){if(r.key===u)if(r.tag===4&&r.stateNode.containerInfo===s.containerInfo&&r.stateNode.implementation===s.implementation){n(e,r.sibling),l=o(r,s.children||[]),l.return=e,e=l;break a}else{n(e,r);break}else t(e,r);r=r.sibling}l=si(s,e.mode,l),l.return=e,e=l}return c(e);case k:return s=ya(s),x(e,r,s,l)}if(re(s))return g(e,r,s,l);if(M(s)){if(u=M(s),typeof u!=`function`)throw Error(a(150));return s=u.call(s),_(e,r,s,l)}if(typeof s.then==`function`)return x(e,r,Ta(s),l);if(s.$$typeof===w)return x(e,r,qi(e,s),l);Da(e,s)}return typeof s==`string`&&s!==``||typeof s==`number`||typeof s==`bigint`?(s=``+s,r!==null&&r.tag===6?(n(e,r.sibling),l=o(r,s),l.return=e,e=l):(n(e,r),l=ai(s,e.mode,l),l.return=e,e=l),c(e)):n(e,r)}return function(e,t,n,r){try{wa=0;var a=x(e,t,n,r);return Ca=null,a}catch(t){if(t===pa||t===ha)throw t;var o=$r(29,t,null,e.mode);return o.lanes=r,o.return=e,o}}}var ka=Oa(!0),Aa=Oa(!1),ja=!1;function Ma(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Na(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,callbacks:null})}function Pa(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function Fa(e,t,n){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,Fl&2){var a=r.pending;return a===null?t.next=t:(t.next=a.next,a.next=t),r.pending=t,t=Xr(e),Yr(e,null,n),t}return Kr(e,r,t,n),Xr(e)}function Ia(e,t,n){if(t=t.updateQueue,t!==null&&(t=t.shared,n&4194048)){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,$e(e,n)}}function La(e,t){var n=e.updateQueue,r=e.alternate;if(r!==null&&(r=r.updateQueue,n===r)){var a=null,o=null;if(n=n.firstBaseUpdate,n!==null){do{var s={lane:n.lane,tag:n.tag,payload:n.payload,callback:null,next:null};o===null?a=o=s:o=o.next=s,n=n.next}while(n!==null);o===null?a=o=t:o=o.next=t}else a=o=t;n={baseState:r.baseState,firstBaseUpdate:a,lastBaseUpdate:o,shared:r.shared,callbacks:r.callbacks},e.updateQueue=n;return}e=n.lastBaseUpdate,e===null?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}var Ra=!1;function za(){if(Ra){var e=ia;if(e!==null)throw e}}function Ba(e,t,n,r){Ra=!1;var a=e.updateQueue;ja=!1;var o=a.firstBaseUpdate,s=a.lastBaseUpdate,c=a.shared.pending;if(c!==null){a.shared.pending=null;var l=c,u=l.next;l.next=null,s===null?o=u:s.next=u,s=l;var d=e.alternate;d!==null&&(d=d.updateQueue,c=d.lastBaseUpdate,c!==s&&(c===null?d.firstBaseUpdate=u:c.next=u,d.lastBaseUpdate=l))}if(o!==null){var f=a.baseState;s=0,d=u=l=null,c=o;do{var p=c.lane&-536870913,m=p!==c.lane;if(m?(Q&p)===p:(r&p)===p){p!==0&&p===ra&&(Ra=!0),d!==null&&(d=d.next={lane:0,tag:c.tag,payload:c.payload,callback:null,next:null});a:{var h=e,_=c;p=t;var v=n;switch(_.tag){case 1:if(h=_.payload,typeof h==`function`){f=h.call(v,f,p);break a}f=h;break a;case 3:h.flags=h.flags&-65537|128;case 0:if(h=_.payload,p=typeof h==`function`?h.call(v,f,p):h,p==null)break a;f=g({},f,p);break a;case 2:ja=!0}}p=c.callback,p!==null&&(e.flags|=64,m&&(e.flags|=8192),m=a.callbacks,m===null?a.callbacks=[p]:m.push(p))}else m={lane:p,tag:c.tag,payload:c.payload,callback:c.callback,next:null},d===null?(u=d=m,l=f):d=d.next=m,s|=p;if(c=c.next,c===null){if(c=a.shared.pending,c===null)break;m=c,c=m.next,m.next=null,a.lastBaseUpdate=m,a.shared.pending=null}}while(1);d===null&&(l=f),a.baseState=l,a.firstBaseUpdate=u,a.lastBaseUpdate=d,o===null&&(a.shared.lanes=0),Wl|=s,e.lanes=s,e.memoizedState=f}}function Va(e,t){if(typeof e!=`function`)throw Error(a(191,e));e.call(t)}function Ha(e,t){var n=e.callbacks;if(n!==null)for(e.callbacks=null,e=0;e<n.length;e++)Va(n[e],t)}var Ua=F(null),Wa=F(0);function Ga(e,t){e=Hl,L(Wa,e),L(Ua,t),Hl=e|t.baseLanes}function Ka(){L(Wa,Hl),L(Ua,Ua.current)}function qa(){Hl=Wa.current,I(Ua),I(Wa)}var Ja=F(null),Ya=null;function Xa(e){var t=e.alternate;L(to,to.current&1),L(Ja,e),Ya===null&&(t===null||Ua.current!==null||t.memoizedState!==null)&&(Ya=e)}function Za(e){L(to,to.current),L(Ja,e),Ya===null&&(Ya=e)}function Qa(e){e.tag===22?(L(to,to.current),L(Ja,e),Ya===null&&(Ya=e)):$a(e)}function $a(){L(to,to.current),L(Ja,Ja.current)}function eo(e){I(Ja),Ya===e&&(Ya=null),I(to)}var to=F(0);function no(e){for(var t=e;t!==null;){if(t.tag===13){var n=t.memoizedState;if(n!==null&&(n=n.dehydrated,n===null||of(n)||sf(n)))return t}else if(t.tag===19&&(t.memoizedProps.revealOrder===`forwards`||t.memoizedProps.revealOrder===`backwards`||t.memoizedProps.revealOrder===`unstable_legacy-backwards`||t.memoizedProps.revealOrder===`together`)){if(t.flags&128)return t}else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}var ro=0,X=null,io=null,ao=null,oo=!1,so=!1,co=!1,lo=0,uo=0,fo=null,po=0;function mo(){throw Error(a(321))}function ho(e,t){if(t===null)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!pr(e[n],t[n]))return!1;return!0}function go(e,t,n,r,a,o){return ro=o,X=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,N.H=e===null||e.memoizedState===null?Ns:Ps,co=!1,o=n(r,a),co=!1,so&&(o=vo(t,n,r,a)),_o(e),o}function _o(e){N.H=Ms;var t=io!==null&&io.next!==null;if(ro=0,ao=io=X=null,oo=!1,uo=0,fo=null,t)throw Error(a(300));e===null||Zs||(e=e.dependencies,e!==null&&Wi(e)&&(Zs=!0))}function vo(e,t,n,r){X=e;var o=0;do{if(so&&(fo=null),uo=0,so=!1,25<=o)throw Error(a(301));if(o+=1,ao=io=null,e.updateQueue!=null){var s=e.updateQueue;s.lastEffect=null,s.events=null,s.stores=null,s.memoCache!=null&&(s.memoCache.index=0)}N.H=Fs,s=t(n,r)}while(so);return s}function yo(){var e=N.H,t=e.useState()[0];return t=typeof t.then==`function`?Eo(t):t,e=e.useState()[0],(io===null?null:io.memoizedState)!==e&&(X.flags|=1024),t}function bo(){var e=lo!==0;return lo=0,e}function xo(e,t,n){t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~n}function So(e){if(oo){for(e=e.memoizedState;e!==null;){var t=e.queue;t!==null&&(t.pending=null),e=e.next}oo=!1}ro=0,ao=io=X=null,so=!1,uo=lo=0,fo=null}function Co(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return ao===null?X.memoizedState=ao=e:ao=ao.next=e,ao}function wo(){if(io===null){var e=X.alternate;e=e===null?null:e.memoizedState}else e=io.next;var t=ao===null?X.memoizedState:ao.next;if(t!==null)ao=t,io=e;else{if(e===null)throw X.alternate===null?Error(a(467)):Error(a(310));io=e,e={memoizedState:io.memoizedState,baseState:io.baseState,baseQueue:io.baseQueue,queue:io.queue,next:null},ao===null?X.memoizedState=ao=e:ao=ao.next=e}return ao}function To(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function Eo(e){var t=uo;return uo+=1,fo===null&&(fo=[]),e=va(fo,e,t),t=X,(ao===null?t.memoizedState:ao.next)===null&&(t=t.alternate,N.H=t===null||t.memoizedState===null?Ns:Ps),e}function Do(e){if(typeof e==`object`&&e){if(typeof e.then==`function`)return Eo(e);if(e.$$typeof===w)return Ki(e)}throw Error(a(438,String(e)))}function Oo(e){var t=null,n=X.updateQueue;if(n!==null&&(t=n.memoCache),t==null){var r=X.alternate;r!==null&&(r=r.updateQueue,r!==null&&(r=r.memoCache,r!=null&&(t={data:r.data.map(function(e){return e.slice()}),index:0})))}if(t??={data:[],index:0},n===null&&(n=To(),X.updateQueue=n),n.memoCache=t,n=t.data[t.index],n===void 0)for(n=t.data[t.index]=Array(e),r=0;r<e;r++)n[r]=ee;return t.index++,n}function ko(e,t){return typeof t==`function`?t(e):t}function Ao(e){return jo(wo(),io,e)}function jo(e,t,n){var r=e.queue;if(r===null)throw Error(a(311));r.lastRenderedReducer=n;var o=e.baseQueue,s=r.pending;if(s!==null){if(o!==null){var c=o.next;o.next=s.next,s.next=c}t.baseQueue=o=s,r.pending=null}if(s=e.baseState,o===null)e.memoizedState=s;else{t=o.next;var l=c=null,u=null,d=t,f=!1;do{var p=d.lane&-536870913;if(p===d.lane?(ro&p)===p:(Q&p)===p){var m=d.revertLane;if(m===0)u!==null&&(u=u.next={lane:0,revertLane:0,gesture:null,action:d.action,hasEagerState:d.hasEagerState,eagerState:d.eagerState,next:null}),p===ra&&(f=!0);else if((ro&m)===m){d=d.next,m===ra&&(f=!0);continue}else p={lane:0,revertLane:d.revertLane,gesture:null,action:d.action,hasEagerState:d.hasEagerState,eagerState:d.eagerState,next:null},u===null?(l=u=p,c=s):u=u.next=p,X.lanes|=m,Wl|=m;p=d.action,co&&n(s,p),s=d.hasEagerState?d.eagerState:n(s,p)}else m={lane:p,revertLane:d.revertLane,gesture:d.gesture,action:d.action,hasEagerState:d.hasEagerState,eagerState:d.eagerState,next:null},u===null?(l=u=m,c=s):u=u.next=m,X.lanes|=p,Wl|=p;d=d.next}while(d!==null&&d!==t);if(u===null?c=s:u.next=l,!pr(s,e.memoizedState)&&(Zs=!0,f&&(n=ia,n!==null)))throw n;e.memoizedState=s,e.baseState=c,e.baseQueue=u,r.lastRenderedState=s}return o===null&&(r.lanes=0),[e.memoizedState,r.dispatch]}function Mo(e){var t=wo(),n=t.queue;if(n===null)throw Error(a(311));n.lastRenderedReducer=e;var r=n.dispatch,o=n.pending,s=t.memoizedState;if(o!==null){n.pending=null;var c=o=o.next;do s=e(s,c.action),c=c.next;while(c!==o);pr(s,t.memoizedState)||(Zs=!0),t.memoizedState=s,t.baseQueue===null&&(t.baseState=s),n.lastRenderedState=s}return[s,r]}function No(e,t,n){var r=X,o=wo(),s=Y;if(s){if(n===void 0)throw Error(a(407));n=n()}else n=t();var c=!pr((io||o).memoizedState,n);if(c&&(o.memoizedState=n,Zs=!0),o=o.queue,is(Io.bind(null,r,o,e),[e]),o.getSnapshot!==t||c||ao!==null&&ao.memoizedState.tag&1){if(r.flags|=2048,$o(9,{destroy:void 0},Fo.bind(null,r,o,n,t),null),Il===null)throw Error(a(349));s||ro&127||Po(r,t,n)}return n}function Po(e,t,n){e.flags|=16384,e={getSnapshot:t,value:n},t=X.updateQueue,t===null?(t=To(),X.updateQueue=t,t.stores=[e]):(n=t.stores,n===null?t.stores=[e]:n.push(e))}function Fo(e,t,n,r){t.value=n,t.getSnapshot=r,Lo(t)&&Ro(e)}function Io(e,t,n){return n(function(){Lo(t)&&Ro(e)})}function Lo(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!pr(e,n)}catch{return!0}}function Ro(e){var t=Jr(e,2);t!==null&&mu(t,e,2)}function zo(e){var t=Co();if(typeof e==`function`){var n=e;if(e=n(),co){Ie(!0);try{n()}finally{Ie(!1)}}}return t.memoizedState=t.baseState=e,t.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:ko,lastRenderedState:e},t}function Bo(e,t,n,r){return e.baseState=n,jo(e,io,typeof r==`function`?r:ko)}function Vo(e,t,n,r,o){if(ks(e))throw Error(a(485));if(e=t.action,e!==null){var s={payload:o,action:e,next:null,isTransition:!0,status:`pending`,value:null,reason:null,listeners:[],then:function(e){s.listeners.push(e)}};N.T===null?s.isTransition=!1:n(!0),r(s),n=t.pending,n===null?(s.next=t.pending=s,Ho(t,s)):(s.next=n.next,t.pending=n.next=s)}}function Ho(e,t){var n=t.action,r=t.payload,a=e.state;if(t.isTransition){var o=N.T,s={};N.T=s;try{var c=n(a,r),l=N.S;l!==null&&l(s,c),Uo(e,t,c)}catch(n){Go(e,t,n)}finally{o!==null&&s.types!==null&&(o.types=s.types),N.T=o}}else try{o=n(a,r),Uo(e,t,o)}catch(n){Go(e,t,n)}}function Uo(e,t,n){typeof n==`object`&&n&&typeof n.then==`function`?n.then(function(n){Wo(e,t,n)},function(n){return Go(e,t,n)}):Wo(e,t,n)}function Wo(e,t,n){t.status=`fulfilled`,t.value=n,Ko(t),e.state=n,t=e.pending,t!==null&&(n=t.next,n===t?e.pending=null:(n=n.next,t.next=n,Ho(e,n)))}function Go(e,t,n){var r=e.pending;if(e.pending=null,r!==null){r=r.next;do t.status=`rejected`,t.reason=n,Ko(t),t=t.next;while(t!==r)}e.action=null}function Ko(e){e=e.listeners;for(var t=0;t<e.length;t++)(0,e[t])()}function qo(e,t){return t}function Jo(e,t){if(Y){var n=Il.formState;if(n!==null){a:{var r=X;if(Y){if(Ti){b:{for(var a=Ti,o=Di;a.nodeType!==8;){if(!o){a=null;break b}if(a=lf(a.nextSibling),a===null){a=null;break b}}o=a.data,a=o===`F!`||o===`F`?a:null}if(a){Ti=lf(a.nextSibling),r=a.data===`F!`;break a}}ki(r)}r=!1}r&&(t=n[0])}}return n=Co(),n.memoizedState=n.baseState=t,r={pending:null,lanes:0,dispatch:null,lastRenderedReducer:qo,lastRenderedState:t},n.queue=r,n=Es.bind(null,X,r),r.dispatch=n,r=zo(!1),o=Os.bind(null,X,!1,r.queue),r=Co(),a={state:t,dispatch:null,action:e,pending:null},r.queue=a,n=Vo.bind(null,X,a,o,n),a.dispatch=n,r.memoizedState=e,[t,n,!1]}function Yo(e){return Xo(wo(),io,e)}function Xo(e,t,n){if(t=jo(e,t,qo)[0],e=Ao(ko)[0],typeof t==`object`&&t&&typeof t.then==`function`)try{var r=Eo(t)}catch(e){throw e===pa?ha:e}else r=t;t=wo();var a=t.queue,o=a.dispatch;return n!==t.memoizedState&&(X.flags|=2048,$o(9,{destroy:void 0},Zo.bind(null,a,n),null)),[r,o,e]}function Zo(e,t){e.action=t}function Qo(e){var t=wo(),n=io;if(n!==null)return Xo(t,n,e);wo(),t=t.memoizedState,n=wo();var r=n.queue.dispatch;return n.memoizedState=e,[t,r,!1]}function $o(e,t,n,r){return e={tag:e,create:n,deps:r,inst:t,next:null},t=X.updateQueue,t===null&&(t=To(),X.updateQueue=t),n=t.lastEffect,n===null?t.lastEffect=e.next=e:(r=n.next,n.next=e,e.next=r,t.lastEffect=e),e}function es(){return wo().memoizedState}function ts(e,t,n,r){var a=Co();X.flags|=e,a.memoizedState=$o(1|t,{destroy:void 0},n,r===void 0?null:r)}function ns(e,t,n,r){var a=wo();r=r===void 0?null:r;var o=a.memoizedState.inst;io!==null&&r!==null&&ho(r,io.memoizedState.deps)?a.memoizedState=$o(t,o,n,r):(X.flags|=e,a.memoizedState=$o(1|t,o,n,r))}function rs(e,t){ts(8390656,8,e,t)}function is(e,t){ns(2048,8,e,t)}function as(e){X.flags|=4;var t=X.updateQueue;if(t===null)t=To(),X.updateQueue=t,t.events=[e];else{var n=t.events;n===null?t.events=[e]:n.push(e)}}function os(e){var t=wo().memoizedState;return as({ref:t,nextImpl:e}),function(){if(Fl&2)throw Error(a(440));return t.impl.apply(void 0,arguments)}}function ss(e,t){return ns(4,2,e,t)}function cs(e,t){return ns(4,4,e,t)}function ls(e,t){if(typeof t==`function`){e=e();var n=t(e);return function(){typeof n==`function`?n():t(null)}}if(t!=null)return e=e(),t.current=e,function(){t.current=null}}function us(e,t,n){n=n==null?null:n.concat([e]),ns(4,4,ls.bind(null,t,e),n)}function ds(){}function fs(e,t){var n=wo();t=t===void 0?null:t;var r=n.memoizedState;return t!==null&&ho(t,r[1])?r[0]:(n.memoizedState=[e,t],e)}function ps(e,t){var n=wo();t=t===void 0?null:t;var r=n.memoizedState;if(t!==null&&ho(t,r[1]))return r[0];if(r=e(),co){Ie(!0);try{e()}finally{Ie(!1)}}return n.memoizedState=[r,t],r}function ms(e,t,n){return n===void 0||ro&1073741824&&!(Q&261930)?e.memoizedState=t:(e.memoizedState=n,e=pu(),X.lanes|=e,Wl|=e,n)}function hs(e,t,n,r){return pr(n,t)?n:Ua.current===null?!(ro&42)||ro&1073741824&&!(Q&261930)?(Zs=!0,e.memoizedState=n):(e=pu(),X.lanes|=e,Wl|=e,t):(e=ms(e,n,r),pr(e,t)||(Zs=!0),e)}function gs(e,t,n,r,a){var o=P.p;P.p=o!==0&&8>o?o:8;var s=N.T,c={};N.T=c,Os(e,!1,t,n);try{var l=a(),u=N.S;u!==null&&u(c,l),typeof l==`object`&&l&&typeof l.then==`function`?Ds(e,t,sa(l,r),fu(e)):Ds(e,t,r,fu(e))}catch(n){Ds(e,t,{then:function(){},status:`rejected`,reason:n},fu())}finally{P.p=o,s!==null&&c.types!==null&&(s.types=c.types),N.T=s}}function _s(){}function vs(e,t,n,r){if(e.tag!==5)throw Error(a(476));var o=ys(e).queue;gs(e,o,t,ie,n===null?_s:function(){return bs(e),n(r)})}function ys(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:ie,baseState:ie,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:ko,lastRenderedState:ie},next:null};var n={};return t.next={memoizedState:n,baseState:n,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:ko,lastRenderedState:n},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function bs(e){var t=ys(e);t.next===null&&(t=e.alternate.memoizedState),Ds(e,t.next.queue,{},fu())}function xs(){return Ki($f)}function Ss(){return wo().memoizedState}function Cs(){return wo().memoizedState}function ws(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var n=fu();e=Pa(n);var r=Fa(t,e,n);r!==null&&(mu(r,t,n),Ia(r,t,n)),t={cache:$i()},e.payload=t;return}t=t.return}}function Ts(e,t,n){var r=fu();n={lane:r,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null},ks(e)?As(t,n):(n=qr(e,t,n,r),n!==null&&(mu(n,e,r),js(n,t,r)))}function Es(e,t,n){Ds(e,t,n,fu())}function Ds(e,t,n,r){var a={lane:r,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null};if(ks(e))As(t,a);else{var o=e.alternate;if(e.lanes===0&&(o===null||o.lanes===0)&&(o=t.lastRenderedReducer,o!==null))try{var s=t.lastRenderedState,c=o(s,n);if(a.hasEagerState=!0,a.eagerState=c,pr(c,s))return Kr(e,t,a,0),Il===null&&Gr(),!1}catch{}if(n=qr(e,t,a,r),n!==null)return mu(n,e,r),js(n,t,r),!0}return!1}function Os(e,t,n,r){if(r={lane:2,revertLane:dd(),gesture:null,action:r,hasEagerState:!1,eagerState:null,next:null},ks(e)){if(t)throw Error(a(479))}else t=qr(e,n,r,2),t!==null&&mu(t,e,2)}function ks(e){var t=e.alternate;return e===X||t!==null&&t===X}function As(e,t){so=oo=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function js(e,t,n){if(n&4194048){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,$e(e,n)}}var Ms={readContext:Ki,use:Do,useCallback:mo,useContext:mo,useEffect:mo,useImperativeHandle:mo,useLayoutEffect:mo,useInsertionEffect:mo,useMemo:mo,useReducer:mo,useRef:mo,useState:mo,useDebugValue:mo,useDeferredValue:mo,useTransition:mo,useSyncExternalStore:mo,useId:mo,useHostTransitionStatus:mo,useFormState:mo,useActionState:mo,useOptimistic:mo,useMemoCache:mo,useCacheRefresh:mo};Ms.useEffectEvent=mo;var Ns={readContext:Ki,use:Do,useCallback:function(e,t){return Co().memoizedState=[e,t===void 0?null:t],e},useContext:Ki,useEffect:rs,useImperativeHandle:function(e,t,n){n=n==null?null:n.concat([e]),ts(4194308,4,ls.bind(null,t,e),n)},useLayoutEffect:function(e,t){return ts(4194308,4,e,t)},useInsertionEffect:function(e,t){ts(4,2,e,t)},useMemo:function(e,t){var n=Co();t=t===void 0?null:t;var r=e();if(co){Ie(!0);try{e()}finally{Ie(!1)}}return n.memoizedState=[r,t],r},useReducer:function(e,t,n){var r=Co();if(n!==void 0){var a=n(t);if(co){Ie(!0);try{n(t)}finally{Ie(!1)}}}else a=t;return r.memoizedState=r.baseState=a,e={pending:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:a},r.queue=e,e=e.dispatch=Ts.bind(null,X,e),[r.memoizedState,e]},useRef:function(e){var t=Co();return e={current:e},t.memoizedState=e},useState:function(e){e=zo(e);var t=e.queue,n=Es.bind(null,X,t);return t.dispatch=n,[e.memoizedState,n]},useDebugValue:ds,useDeferredValue:function(e,t){return ms(Co(),e,t)},useTransition:function(){var e=zo(!1);return e=gs.bind(null,X,e.queue,!0,!1),Co().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,n){var r=X,o=Co();if(Y){if(n===void 0)throw Error(a(407));n=n()}else{if(n=t(),Il===null)throw Error(a(349));Q&127||Po(r,t,n)}o.memoizedState=n;var s={value:n,getSnapshot:t};return o.queue=s,rs(Io.bind(null,r,s,e),[e]),r.flags|=2048,$o(9,{destroy:void 0},Fo.bind(null,r,s,n,t),null),n},useId:function(){var e=Co(),t=Il.identifierPrefix;if(Y){var n=vi,r=_i;n=(r&~(1<<32-Le(r)-1)).toString(32)+n,t=`_`+t+`R_`+n,n=lo++,0<n&&(t+=`H`+n.toString(32)),t+=`_`}else n=po++,t=`_`+t+`r_`+n.toString(32)+`_`;return e.memoizedState=t},useHostTransitionStatus:xs,useFormState:Jo,useActionState:Jo,useOptimistic:function(e){var t=Co();t.memoizedState=t.baseState=e;var n={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return t.queue=n,t=Os.bind(null,X,!0,n),n.dispatch=t,[e,t]},useMemoCache:Oo,useCacheRefresh:function(){return Co().memoizedState=ws.bind(null,X)},useEffectEvent:function(e){var t=Co(),n={impl:e};return t.memoizedState=n,function(){if(Fl&2)throw Error(a(440));return n.impl.apply(void 0,arguments)}}},Ps={readContext:Ki,use:Do,useCallback:fs,useContext:Ki,useEffect:is,useImperativeHandle:us,useInsertionEffect:ss,useLayoutEffect:cs,useMemo:ps,useReducer:Ao,useRef:es,useState:function(){return Ao(ko)},useDebugValue:ds,useDeferredValue:function(e,t){return hs(wo(),io.memoizedState,e,t)},useTransition:function(){var e=Ao(ko)[0],t=wo().memoizedState;return[typeof e==`boolean`?e:Eo(e),t]},useSyncExternalStore:No,useId:Ss,useHostTransitionStatus:xs,useFormState:Yo,useActionState:Yo,useOptimistic:function(e,t){return Bo(wo(),io,e,t)},useMemoCache:Oo,useCacheRefresh:Cs};Ps.useEffectEvent=os;var Fs={readContext:Ki,use:Do,useCallback:fs,useContext:Ki,useEffect:is,useImperativeHandle:us,useInsertionEffect:ss,useLayoutEffect:cs,useMemo:ps,useReducer:Mo,useRef:es,useState:function(){return Mo(ko)},useDebugValue:ds,useDeferredValue:function(e,t){var n=wo();return io===null?ms(n,e,t):hs(n,io.memoizedState,e,t)},useTransition:function(){var e=Mo(ko)[0],t=wo().memoizedState;return[typeof e==`boolean`?e:Eo(e),t]},useSyncExternalStore:No,useId:Ss,useHostTransitionStatus:xs,useFormState:Qo,useActionState:Qo,useOptimistic:function(e,t){var n=wo();return io===null?(n.baseState=e,[e,n.queue.dispatch]):Bo(n,io,e,t)},useMemoCache:Oo,useCacheRefresh:Cs};Fs.useEffectEvent=os;function Is(e,t,n,r){t=e.memoizedState,n=n(r,t),n=n==null?t:g({},t,n),e.memoizedState=n,e.lanes===0&&(e.updateQueue.baseState=n)}var Ls={enqueueSetState:function(e,t,n){e=e._reactInternals;var r=fu(),a=Pa(r);a.payload=t,n!=null&&(a.callback=n),t=Fa(e,a,r),t!==null&&(mu(t,e,r),Ia(t,e,r))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var r=fu(),a=Pa(r);a.tag=1,a.payload=t,n!=null&&(a.callback=n),t=Fa(e,a,r),t!==null&&(mu(t,e,r),Ia(t,e,r))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=fu(),r=Pa(n);r.tag=2,t!=null&&(r.callback=t),t=Fa(e,r,n),t!==null&&(mu(t,e,n),Ia(t,e,n))}};function Rs(e,t,n,r,a,o,s){return e=e.stateNode,typeof e.shouldComponentUpdate==`function`?e.shouldComponentUpdate(r,o,s):t.prototype&&t.prototype.isPureReactComponent?!mr(n,r)||!mr(a,o):!0}function zs(e,t,n,r){e=t.state,typeof t.componentWillReceiveProps==`function`&&t.componentWillReceiveProps(n,r),typeof t.UNSAFE_componentWillReceiveProps==`function`&&t.UNSAFE_componentWillReceiveProps(n,r),t.state!==e&&Ls.enqueueReplaceState(t,t.state,null)}function Bs(e,t){var n=t;if(`ref`in t)for(var r in n={},t)r!==`ref`&&(n[r]=t[r]);if(e=e.defaultProps)for(var a in n===t&&(n=g({},n)),e)n[a]===void 0&&(n[a]=e[a]);return n}function Vs(e){Vr(e)}function Hs(e){console.error(e)}function Us(e){Vr(e)}function Ws(e,t){try{var n=e.onUncaughtError;n(t.value,{componentStack:t.stack})}catch(e){setTimeout(function(){throw e})}}function Gs(e,t,n){try{var r=e.onCaughtError;r(n.value,{componentStack:n.stack,errorBoundary:t.tag===1?t.stateNode:null})}catch(e){setTimeout(function(){throw e})}}function Ks(e,t,n){return n=Pa(n),n.tag=3,n.payload={element:null},n.callback=function(){Ws(e,t)},n}function qs(e){return e=Pa(e),e.tag=3,e}function Js(e,t,n,r){var a=n.type.getDerivedStateFromError;if(typeof a==`function`){var o=r.value;e.payload=function(){return a(o)},e.callback=function(){Gs(t,n,r)}}var s=n.stateNode;s!==null&&typeof s.componentDidCatch==`function`&&(e.callback=function(){Gs(t,n,r),typeof a!=`function`&&(nu===null?nu=new Set([this]):nu.add(this));var e=r.stack;this.componentDidCatch(r.value,{componentStack:e===null?``:e})})}function Ys(e,t,n,r,o){if(n.flags|=32768,typeof r==`object`&&r&&typeof r.then==`function`){if(t=n.alternate,t!==null&&Ui(t,n,o,!0),n=Ja.current,n!==null){switch(n.tag){case 31:case 13:return Ya===null?Eu():n.alternate===null&&Ul===0&&(Ul=3),n.flags&=-257,n.flags|=65536,n.lanes=o,r===ga?n.flags|=16384:(t=n.updateQueue,t===null?n.updateQueue=new Set([r]):t.add(r),Gu(e,r,o)),!1;case 22:return n.flags|=65536,r===ga?n.flags|=16384:(t=n.updateQueue,t===null?(t={transitions:null,markerInstances:null,retryQueue:new Set([r])},n.updateQueue=t):(n=t.retryQueue,n===null?t.retryQueue=new Set([r]):n.add(r)),Gu(e,r,o)),!1}throw Error(a(435,n.tag))}return Gu(e,r,o),Eu(),!1}if(Y)return t=Ja.current,t===null?(r!==Oi&&(t=Error(a(423),{cause:r}),Fi(li(t,n))),e=e.current.alternate,e.flags|=65536,o&=-o,e.lanes|=o,r=li(r,n),o=Ks(e.stateNode,r,o),La(e,o),Ul!==4&&(Ul=2)):(!(t.flags&65536)&&(t.flags|=256),t.flags|=65536,t.lanes=o,r!==Oi&&(e=Error(a(422),{cause:r}),Fi(li(e,n)))),!1;var s=Error(a(520),{cause:r});if(s=li(s,n),Yl===null?Yl=[s]:Yl.push(s),Ul!==4&&(Ul=2),t===null)return!0;r=li(r,n),n=t;do{switch(n.tag){case 3:return n.flags|=65536,e=o&-o,n.lanes|=e,e=Ks(n.stateNode,r,e),La(n,e),!1;case 1:if(t=n.type,s=n.stateNode,!(n.flags&128)&&(typeof t.getDerivedStateFromError==`function`||s!==null&&typeof s.componentDidCatch==`function`&&(nu===null||!nu.has(s))))return n.flags|=65536,o&=-o,n.lanes|=o,o=qs(o),Js(o,e,n,r),La(n,o),!1}n=n.return}while(n!==null);return!1}var Xs=Error(a(461)),Zs=!1;function Qs(e,t,n,r){t.child=e===null?Aa(t,null,n,r):ka(t,e.child,n,r)}function $s(e,t,n,r,a){n=n.render;var o=t.ref;if(`ref`in r){var s={};for(var c in r)c!==`ref`&&(s[c]=r[c])}else s=r;return Gi(t),r=go(e,t,n,s,o,a),c=bo(),e!==null&&!Zs?(xo(e,t,a),Cc(e,t,a)):(Y&&c&&xi(t),t.flags|=1,Qs(e,t,r,a),t.child)}function ec(e,t,n,r,a){if(e===null){var o=n.type;return typeof o==`function`&&!ei(o)&&o.defaultProps===void 0&&n.compare===null?(t.tag=15,t.type=o,tc(e,t,o,r,a)):(e=ri(n.type,null,r,t,t.mode,a),e.ref=t.ref,e.return=t,t.child=e)}if(o=e.child,!wc(e,a)){var s=o.memoizedProps;if(n=n.compare,n=n===null?mr:n,n(s,r)&&e.ref===t.ref)return Cc(e,t,a)}return t.flags|=1,e=ti(o,r),e.ref=t.ref,e.return=t,t.child=e}function tc(e,t,n,r,a){if(e!==null){var o=e.memoizedProps;if(mr(o,r)&&e.ref===t.ref)if(Zs=!1,t.pendingProps=r=o,wc(e,a))e.flags&131072&&(Zs=!0);else return t.lanes=e.lanes,Cc(e,t,a)}return lc(e,t,n,r,a)}function nc(e,t,n,r){var a=r.children,o=e===null?null:e.memoizedState;if(e===null&&t.stateNode===null&&(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),r.mode===`hidden`){if(t.flags&128){if(o=o===null?n:o.baseLanes|n,e!==null){for(r=t.child=e.child,a=0;r!==null;)a=a|r.lanes|r.childLanes,r=r.sibling;r=a&~o}else r=0,t.child=null;return ic(e,t,o,n,r)}if(n&536870912)t.memoizedState={baseLanes:0,cachePool:null},e!==null&&da(t,o===null?null:o.cachePool),o===null?Ka():Ga(t,o),Qa(t);else return r=t.lanes=536870912,ic(e,t,o===null?n:o.baseLanes|n,n,r)}else o===null?(e!==null&&da(t,null),Ka(),$a(t)):(da(t,o.cachePool),Ga(t,o),$a(t),t.memoizedState=null);return Qs(e,t,a,n),t.child}function rc(e,t){return e!==null&&e.tag===22||t.stateNode!==null||(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),t.sibling}function ic(e,t,n,r,a){var o=ua();return o=o===null?null:{parent:Qi._currentValue,pool:o},t.memoizedState={baseLanes:n,cachePool:o},e!==null&&da(t,null),Ka(),Qa(t),e!==null&&Ui(e,t,r,!0),t.childLanes=a,null}function ac(e,t){return t=vc({mode:t.mode,children:t.children},e.mode),t.ref=e.ref,e.child=t,t.return=e,t}function oc(e,t,n){return ka(t,e.child,null,n),e=ac(t,t.pendingProps),e.flags|=2,eo(t),t.memoizedState=null,e}function sc(e,t,n){var r=t.pendingProps,o=(t.flags&128)!=0;if(t.flags&=-129,e===null){if(Y){if(r.mode===`hidden`)return e=ac(t,r),t.lanes=536870912,rc(null,e);if(Za(t),(e=Ti)?(e=af(e,Di),e=e!==null&&e.data===`&`?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:gi===null?null:{id:_i,overflow:vi},retryLane:536870912,hydrationErrors:null},n=oi(e),n.return=t,t.child=n,wi=t,Ti=null)):e=null,e===null)throw ki(t);return t.lanes=536870912,null}return ac(t,r)}var s=e.memoizedState;if(s!==null){var c=s.dehydrated;if(Za(t),o)if(t.flags&256)t.flags&=-257,t=oc(e,t,n);else if(t.memoizedState!==null)t.child=e.child,t.flags|=128,t=null;else throw Error(a(558));else if(Zs||Ui(e,t,n,!1),o=(n&e.childLanes)!==0,Zs||o){if(r=Il,r!==null&&(c=et(r,n),c!==0&&c!==s.retryLane))throw s.retryLane=c,Jr(e,c),mu(r,e,c),Xs;Eu(),t=oc(e,t,n)}else e=s.treeContext,Ti=lf(c.nextSibling),wi=t,Y=!0,Ei=null,Di=!1,e!==null&&Ci(t,e),t=ac(t,r),t.flags|=4096;return t}return e=ti(e.child,{mode:r.mode,children:r.children}),e.ref=t.ref,t.child=e,e.return=t,e}function cc(e,t){var n=t.ref;if(n===null)e!==null&&e.ref!==null&&(t.flags|=4194816);else{if(typeof n!=`function`&&typeof n!=`object`)throw Error(a(284));(e===null||e.ref!==n)&&(t.flags|=4194816)}}function lc(e,t,n,r,a){return Gi(t),n=go(e,t,n,r,void 0,a),r=bo(),e!==null&&!Zs?(xo(e,t,a),Cc(e,t,a)):(Y&&r&&xi(t),t.flags|=1,Qs(e,t,n,a),t.child)}function uc(e,t,n,r,a,o){return Gi(t),t.updateQueue=null,n=vo(t,r,n,a),_o(e),r=bo(),e!==null&&!Zs?(xo(e,t,o),Cc(e,t,o)):(Y&&r&&xi(t),t.flags|=1,Qs(e,t,n,o),t.child)}function dc(e,t,n,r,a){if(Gi(t),t.stateNode===null){var o=Zr,s=n.contextType;typeof s==`object`&&s&&(o=Ki(s)),o=new n(r,o),t.memoizedState=o.state!==null&&o.state!==void 0?o.state:null,o.updater=Ls,t.stateNode=o,o._reactInternals=t,o=t.stateNode,o.props=r,o.state=t.memoizedState,o.refs={},Ma(t),s=n.contextType,o.context=typeof s==`object`&&s?Ki(s):Zr,o.state=t.memoizedState,s=n.getDerivedStateFromProps,typeof s==`function`&&(Is(t,n,s,r),o.state=t.memoizedState),typeof n.getDerivedStateFromProps==`function`||typeof o.getSnapshotBeforeUpdate==`function`||typeof o.UNSAFE_componentWillMount!=`function`&&typeof o.componentWillMount!=`function`||(s=o.state,typeof o.componentWillMount==`function`&&o.componentWillMount(),typeof o.UNSAFE_componentWillMount==`function`&&o.UNSAFE_componentWillMount(),s!==o.state&&Ls.enqueueReplaceState(o,o.state,null),Ba(t,r,o,a),za(),o.state=t.memoizedState),typeof o.componentDidMount==`function`&&(t.flags|=4194308),r=!0}else if(e===null){o=t.stateNode;var c=t.memoizedProps,l=Bs(n,c);o.props=l;var u=o.context,d=n.contextType;s=Zr,typeof d==`object`&&d&&(s=Ki(d));var f=n.getDerivedStateFromProps;d=typeof f==`function`||typeof o.getSnapshotBeforeUpdate==`function`,c=t.pendingProps!==c,d||typeof o.UNSAFE_componentWillReceiveProps!=`function`&&typeof o.componentWillReceiveProps!=`function`||(c||u!==s)&&zs(t,o,r,s),ja=!1;var p=t.memoizedState;o.state=p,Ba(t,r,o,a),za(),u=t.memoizedState,c||p!==u||ja?(typeof f==`function`&&(Is(t,n,f,r),u=t.memoizedState),(l=ja||Rs(t,n,l,r,p,u,s))?(d||typeof o.UNSAFE_componentWillMount!=`function`&&typeof o.componentWillMount!=`function`||(typeof o.componentWillMount==`function`&&o.componentWillMount(),typeof o.UNSAFE_componentWillMount==`function`&&o.UNSAFE_componentWillMount()),typeof o.componentDidMount==`function`&&(t.flags|=4194308)):(typeof o.componentDidMount==`function`&&(t.flags|=4194308),t.memoizedProps=r,t.memoizedState=u),o.props=r,o.state=u,o.context=s,r=l):(typeof o.componentDidMount==`function`&&(t.flags|=4194308),r=!1)}else{o=t.stateNode,Na(e,t),s=t.memoizedProps,d=Bs(n,s),o.props=d,f=t.pendingProps,p=o.context,u=n.contextType,l=Zr,typeof u==`object`&&u&&(l=Ki(u)),c=n.getDerivedStateFromProps,(u=typeof c==`function`||typeof o.getSnapshotBeforeUpdate==`function`)||typeof o.UNSAFE_componentWillReceiveProps!=`function`&&typeof o.componentWillReceiveProps!=`function`||(s!==f||p!==l)&&zs(t,o,r,l),ja=!1,p=t.memoizedState,o.state=p,Ba(t,r,o,a),za();var m=t.memoizedState;s!==f||p!==m||ja||e!==null&&e.dependencies!==null&&Wi(e.dependencies)?(typeof c==`function`&&(Is(t,n,c,r),m=t.memoizedState),(d=ja||Rs(t,n,d,r,p,m,l)||e!==null&&e.dependencies!==null&&Wi(e.dependencies))?(u||typeof o.UNSAFE_componentWillUpdate!=`function`&&typeof o.componentWillUpdate!=`function`||(typeof o.componentWillUpdate==`function`&&o.componentWillUpdate(r,m,l),typeof o.UNSAFE_componentWillUpdate==`function`&&o.UNSAFE_componentWillUpdate(r,m,l)),typeof o.componentDidUpdate==`function`&&(t.flags|=4),typeof o.getSnapshotBeforeUpdate==`function`&&(t.flags|=1024)):(typeof o.componentDidUpdate!=`function`||s===e.memoizedProps&&p===e.memoizedState||(t.flags|=4),typeof o.getSnapshotBeforeUpdate!=`function`||s===e.memoizedProps&&p===e.memoizedState||(t.flags|=1024),t.memoizedProps=r,t.memoizedState=m),o.props=r,o.state=m,o.context=l,r=d):(typeof o.componentDidUpdate!=`function`||s===e.memoizedProps&&p===e.memoizedState||(t.flags|=4),typeof o.getSnapshotBeforeUpdate!=`function`||s===e.memoizedProps&&p===e.memoizedState||(t.flags|=1024),r=!1)}return o=r,cc(e,t),r=(t.flags&128)!=0,o||r?(o=t.stateNode,n=r&&typeof n.getDerivedStateFromError!=`function`?null:o.render(),t.flags|=1,e!==null&&r?(t.child=ka(t,e.child,null,a),t.child=ka(t,null,n,a)):Qs(e,t,n,a),t.memoizedState=o.state,e=t.child):e=Cc(e,t,a),e}function fc(e,t,n,r){return Ni(),t.flags|=256,Qs(e,t,n,r),t.child}var pc={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function mc(e){return{baseLanes:e,cachePool:fa()}}function hc(e,t,n){return e=e===null?0:e.childLanes&~n,t&&(e|=ql),e}function gc(e,t,n){var r=t.pendingProps,o=!1,s=(t.flags&128)!=0,c;if((c=s)||(c=e!==null&&e.memoizedState===null?!1:(to.current&2)!=0),c&&(o=!0,t.flags&=-129),c=(t.flags&32)!=0,t.flags&=-33,e===null){if(Y){if(o?Xa(t):$a(t),(e=Ti)?(e=af(e,Di),e=e!==null&&e.data!==`&`?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:gi===null?null:{id:_i,overflow:vi},retryLane:536870912,hydrationErrors:null},n=oi(e),n.return=t,t.child=n,wi=t,Ti=null)):e=null,e===null)throw ki(t);return sf(e)?t.lanes=32:t.lanes=536870912,null}var l=r.children;return r=r.fallback,o?($a(t),o=t.mode,l=vc({mode:`hidden`,children:l},o),r=ii(r,o,n,null),l.return=t,r.return=t,l.sibling=r,t.child=l,r=t.child,r.memoizedState=mc(n),r.childLanes=hc(e,c,n),t.memoizedState=pc,rc(null,r)):(Xa(t),_c(t,l))}var u=e.memoizedState;if(u!==null&&(l=u.dehydrated,l!==null)){if(s)t.flags&256?(Xa(t),t.flags&=-257,t=yc(e,t,n)):t.memoizedState===null?($a(t),l=r.fallback,o=t.mode,r=vc({mode:`visible`,children:r.children},o),l=ii(l,o,n,null),l.flags|=2,r.return=t,l.return=t,r.sibling=l,t.child=r,ka(t,e.child,null,n),r=t.child,r.memoizedState=mc(n),r.childLanes=hc(e,c,n),t.memoizedState=pc,t=rc(null,r)):($a(t),t.child=e.child,t.flags|=128,t=null);else if(Xa(t),sf(l)){if(c=l.nextSibling&&l.nextSibling.dataset,c)var d=c.dgst;c=d,r=Error(a(419)),r.stack=``,r.digest=c,Fi({value:r,source:null,stack:null}),t=yc(e,t,n)}else if(Zs||Ui(e,t,n,!1),c=(n&e.childLanes)!==0,Zs||c){if(c=Il,c!==null&&(r=et(c,n),r!==0&&r!==u.retryLane))throw u.retryLane=r,Jr(e,r),mu(c,e,r),Xs;of(l)||Eu(),t=yc(e,t,n)}else of(l)?(t.flags|=192,t.child=e.child,t=null):(e=u.treeContext,Ti=lf(l.nextSibling),wi=t,Y=!0,Ei=null,Di=!1,e!==null&&Ci(t,e),t=_c(t,r.children),t.flags|=4096);return t}return o?($a(t),l=r.fallback,o=t.mode,u=e.child,d=u.sibling,r=ti(u,{mode:`hidden`,children:r.children}),r.subtreeFlags=u.subtreeFlags&65011712,d===null?(l=ii(l,o,n,null),l.flags|=2):l=ti(d,l),l.return=t,r.return=t,r.sibling=l,t.child=r,rc(null,r),r=t.child,l=e.child.memoizedState,l===null?l=mc(n):(o=l.cachePool,o===null?o=fa():(u=Qi._currentValue,o=o.parent===u?o:{parent:u,pool:u}),l={baseLanes:l.baseLanes|n,cachePool:o}),r.memoizedState=l,r.childLanes=hc(e,c,n),t.memoizedState=pc,rc(e.child,r)):(Xa(t),n=e.child,e=n.sibling,n=ti(n,{mode:`visible`,children:r.children}),n.return=t,n.sibling=null,e!==null&&(c=t.deletions,c===null?(t.deletions=[e],t.flags|=16):c.push(e)),t.child=n,t.memoizedState=null,n)}function _c(e,t){return t=vc({mode:`visible`,children:t},e.mode),t.return=e,e.child=t}function vc(e,t){return e=$r(22,e,null,t),e.lanes=0,e}function yc(e,t,n){return ka(t,e.child,null,n),e=_c(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function bc(e,t,n){e.lanes|=t;var r=e.alternate;r!==null&&(r.lanes|=t),Vi(e.return,t,n)}function xc(e,t,n,r,a,o){var s=e.memoizedState;s===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:r,tail:n,tailMode:a,treeForkCount:o}:(s.isBackwards=t,s.rendering=null,s.renderingStartTime=0,s.last=r,s.tail=n,s.tailMode=a,s.treeForkCount=o)}function Sc(e,t,n){var r=t.pendingProps,a=r.revealOrder,o=r.tail;r=r.children;var s=to.current,c=(s&2)!=0;if(c?(s=s&1|2,t.flags|=128):s&=1,L(to,s),Qs(e,t,r,n),r=Y?pi:0,!c&&e!==null&&e.flags&128)a:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&bc(e,n,t);else if(e.tag===19)bc(e,n,t);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break a;for(;e.sibling===null;){if(e.return===null||e.return===t)break a;e=e.return}e.sibling.return=e.return,e=e.sibling}switch(a){case`forwards`:for(n=t.child,a=null;n!==null;)e=n.alternate,e!==null&&no(e)===null&&(a=n),n=n.sibling;n=a,n===null?(a=t.child,t.child=null):(a=n.sibling,n.sibling=null),xc(t,!1,a,n,o,r);break;case`backwards`:case`unstable_legacy-backwards`:for(n=null,a=t.child,t.child=null;a!==null;){if(e=a.alternate,e!==null&&no(e)===null){t.child=a;break}e=a.sibling,a.sibling=n,n=a,a=e}xc(t,!0,n,null,o,r);break;case`together`:xc(t,!1,null,null,void 0,r);break;default:t.memoizedState=null}return t.child}function Cc(e,t,n){if(e!==null&&(t.dependencies=e.dependencies),Wl|=t.lanes,(n&t.childLanes)===0)if(e!==null){if(Ui(e,t,n,!1),(n&t.childLanes)===0)return null}else return null;if(e!==null&&t.child!==e.child)throw Error(a(153));if(t.child!==null){for(e=t.child,n=ti(e,e.pendingProps),t.child=n,n.return=t;e.sibling!==null;)e=e.sibling,n=n.sibling=ti(e,e.pendingProps),n.return=t;n.sibling=null}return t.child}function wc(e,t){return(e.lanes&t)===0?(e=e.dependencies,!!(e!==null&&Wi(e))):!0}function Tc(e,t,n){switch(t.tag){case 3:ue(t,t.stateNode.containerInfo),zi(t,Qi,e.memoizedState.cache),Ni();break;case 27:case 5:fe(t);break;case 4:ue(t,t.stateNode.containerInfo);break;case 10:zi(t,t.type,t.memoizedProps.value);break;case 31:if(t.memoizedState!==null)return t.flags|=128,Za(t),null;break;case 13:var r=t.memoizedState;if(r!==null)return r.dehydrated===null?(n&t.child.childLanes)===0?(Xa(t),e=Cc(e,t,n),e===null?null:e.sibling):gc(e,t,n):(Xa(t),t.flags|=128,null);Xa(t);break;case 19:var a=(e.flags&128)!=0;if(r=(n&t.childLanes)!==0,r||=(Ui(e,t,n,!1),(n&t.childLanes)!==0),a){if(r)return Sc(e,t,n);t.flags|=128}if(a=t.memoizedState,a!==null&&(a.rendering=null,a.tail=null,a.lastEffect=null),L(to,to.current),r)break;return null;case 22:return t.lanes=0,nc(e,t,n,t.pendingProps);case 24:zi(t,Qi,e.memoizedState.cache)}return Cc(e,t,n)}function Ec(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps)Zs=!0;else{if(!wc(e,n)&&!(t.flags&128))return Zs=!1,Tc(e,t,n);Zs=!!(e.flags&131072)}else Zs=!1,Y&&t.flags&1048576&&bi(t,pi,t.index);switch(t.lanes=0,t.tag){case 16:a:{var r=t.pendingProps;if(e=ya(t.elementType),t.type=e,typeof e==`function`)ei(e)?(r=Bs(e,r),t.tag=1,t=dc(null,t,e,r,n)):(t.tag=0,t=lc(null,t,e,r,n));else{if(e!=null){var o=e.$$typeof;if(o===T){t.tag=11,t=$s(null,t,e,r,n);break a}else if(o===O){t.tag=14,t=ec(null,t,e,r,n);break a}}throw t=ne(e)||e,Error(a(306,t,``))}}return t;case 0:return lc(e,t,t.type,t.pendingProps,n);case 1:return r=t.type,o=Bs(r,t.pendingProps),dc(e,t,r,o,n);case 3:a:{if(ue(t,t.stateNode.containerInfo),e===null)throw Error(a(387));r=t.pendingProps;var s=t.memoizedState;o=s.element,Na(e,t),Ba(t,r,null,n);var c=t.memoizedState;if(r=c.cache,zi(t,Qi,r),r!==s.cache&&Hi(t,[Qi],n,!0),za(),r=c.element,s.isDehydrated)if(s={element:r,isDehydrated:!1,cache:c.cache},t.updateQueue.baseState=s,t.memoizedState=s,t.flags&256){t=fc(e,t,r,n);break a}else if(r!==o){o=li(Error(a(424)),t),Fi(o),t=fc(e,t,r,n);break a}else{switch(e=t.stateNode.containerInfo,e.nodeType){case 9:e=e.body;break;default:e=e.nodeName===`HTML`?e.ownerDocument.body:e}for(Ti=lf(e.firstChild),wi=t,Y=!0,Ei=null,Di=!0,n=Aa(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling}else{if(Ni(),r===o){t=Cc(e,t,n);break a}Qs(e,t,r,n)}t=t.child}return t;case 26:return cc(e,t),e===null?(n=Af(t.type,null,t.pendingProps,null))?t.memoizedState=n:Y||(n=t.type,e=t.pendingProps,r=Vd(ce.current).createElement(n),r[ot]=t,r[st]=e,Fd(r,n,e),yt(r),t.stateNode=r):t.memoizedState=Af(t.type,e.memoizedProps,t.pendingProps,e.memoizedState),null;case 27:return fe(t),e===null&&Y&&(r=t.stateNode=pf(t.type,t.pendingProps,ce.current),wi=t,Di=!0,o=Ti,Qd(t.type)?(uf=o,Ti=lf(r.firstChild)):Ti=o),Qs(e,t,t.pendingProps.children,n),cc(e,t),e===null&&(t.flags|=4194304),t.child;case 5:return e===null&&Y&&((o=r=Ti)&&(r=nf(r,t.type,t.pendingProps,Di),r===null?o=!1:(t.stateNode=r,wi=t,Ti=lf(r.firstChild),Di=!1,o=!0)),o||ki(t)),fe(t),o=t.type,s=t.pendingProps,c=e===null?null:e.memoizedProps,r=s.children,Wd(o,s)?r=null:c!==null&&Wd(o,c)&&(t.flags|=32),t.memoizedState!==null&&(o=go(e,t,yo,null,null,n),$f._currentValue=o),cc(e,t),Qs(e,t,r,n),t.child;case 6:return e===null&&Y&&((e=n=Ti)&&(n=rf(n,t.pendingProps,Di),n===null?e=!1:(t.stateNode=n,wi=t,Ti=null,e=!0)),e||ki(t)),null;case 13:return gc(e,t,n);case 4:return ue(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=ka(t,null,r,n):Qs(e,t,r,n),t.child;case 11:return $s(e,t,t.type,t.pendingProps,n);case 7:return Qs(e,t,t.pendingProps,n),t.child;case 8:return Qs(e,t,t.pendingProps.children,n),t.child;case 12:return Qs(e,t,t.pendingProps.children,n),t.child;case 10:return r=t.pendingProps,zi(t,t.type,r.value),Qs(e,t,r.children,n),t.child;case 9:return o=t.type._context,r=t.pendingProps.children,Gi(t),o=Ki(o),r=r(o),t.flags|=1,Qs(e,t,r,n),t.child;case 14:return ec(e,t,t.type,t.pendingProps,n);case 15:return tc(e,t,t.type,t.pendingProps,n);case 19:return Sc(e,t,n);case 31:return sc(e,t,n);case 22:return nc(e,t,n,t.pendingProps);case 24:return Gi(t),r=Ki(Qi),e===null?(o=ua(),o===null&&(o=Il,s=$i(),o.pooledCache=s,s.refCount++,s!==null&&(o.pooledCacheLanes|=n),o=s),t.memoizedState={parent:r,cache:o},Ma(t),zi(t,Qi,o)):((e.lanes&n)!==0&&(Na(e,t),Ba(t,null,null,n),za()),o=e.memoizedState,s=t.memoizedState,o.parent===r?(r=s.cache,zi(t,Qi,r),r!==o.cache&&Hi(t,[Qi],n,!0)):(o={parent:r,cache:r},t.memoizedState=o,t.lanes===0&&(t.memoizedState=t.updateQueue.baseState=o),zi(t,Qi,r))),Qs(e,t,t.pendingProps.children,n),t.child;case 29:throw t.pendingProps}throw Error(a(156,t.tag))}function Dc(e){e.flags|=4}function Oc(e,t,n,r,a){if((t=(e.mode&32)!=0)&&(t=!1),t){if(e.flags|=16777216,(a&335544128)===a)if(e.stateNode.complete)e.flags|=8192;else if(Cu())e.flags|=8192;else throw ba=ga,ma}else e.flags&=-16777217}function kc(e,t){if(t.type!==`stylesheet`||t.state.loading&4)e.flags&=-16777217;else if(e.flags|=16777216,!Gf(t))if(Cu())e.flags|=8192;else throw ba=ga,ma}function Ac(e,t){t!==null&&(e.flags|=4),e.flags&16384&&(t=e.tag===22?536870912:Je(),e.lanes|=t,Jl|=t)}function jc(e,t){if(!Y)switch(e.tailMode){case`hidden`:t=e.tail;for(var n=null;t!==null;)t.alternate!==null&&(n=t),t=t.sibling;n===null?e.tail=null:n.sibling=null;break;case`collapsed`:n=e.tail;for(var r=null;n!==null;)n.alternate!==null&&(r=n),n=n.sibling;r===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:r.sibling=null}}function Mc(e){var t=e.alternate!==null&&e.alternate.child===e.child,n=0,r=0;if(t)for(var a=e.child;a!==null;)n|=a.lanes|a.childLanes,r|=a.subtreeFlags&65011712,r|=a.flags&65011712,a.return=e,a=a.sibling;else for(a=e.child;a!==null;)n|=a.lanes|a.childLanes,r|=a.subtreeFlags,r|=a.flags,a.return=e,a=a.sibling;return e.subtreeFlags|=r,e.childLanes=n,t}function Nc(e,t,n){var r=t.pendingProps;switch(Si(t),t.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Mc(t),null;case 1:return Mc(t),null;case 3:return n=t.stateNode,r=null,e!==null&&(r=e.memoizedState.cache),t.memoizedState.cache!==r&&(t.flags|=2048),Bi(Qi),de(),n.pendingContext&&(n.context=n.pendingContext,n.pendingContext=null),(e===null||e.child===null)&&(Mi(t)?Dc(t):e===null||e.memoizedState.isDehydrated&&!(t.flags&256)||(t.flags|=1024,Pi())),Mc(t),null;case 26:var o=t.type,s=t.memoizedState;return e===null?(Dc(t),s===null?(Mc(t),Oc(t,o,null,r,n)):(Mc(t),kc(t,s))):s?s===e.memoizedState?(Mc(t),t.flags&=-16777217):(Dc(t),Mc(t),kc(t,s)):(e=e.memoizedProps,e!==r&&Dc(t),Mc(t),Oc(t,o,e,r,n)),null;case 27:if(pe(t),n=ce.current,o=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==r&&Dc(t);else{if(!r){if(t.stateNode===null)throw Error(a(166));return Mc(t),null}e=se.current,Mi(t)?Ai(t,e):(e=pf(o,r,n),t.stateNode=e,Dc(t))}return Mc(t),null;case 5:if(pe(t),o=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==r&&Dc(t);else{if(!r){if(t.stateNode===null)throw Error(a(166));return Mc(t),null}if(s=se.current,Mi(t))Ai(t,s);else{var c=Vd(ce.current);switch(s){case 1:s=c.createElementNS(`http://www.w3.org/2000/svg`,o);break;case 2:s=c.createElementNS(`http://www.w3.org/1998/Math/MathML`,o);break;default:switch(o){case`svg`:s=c.createElementNS(`http://www.w3.org/2000/svg`,o);break;case`math`:s=c.createElementNS(`http://www.w3.org/1998/Math/MathML`,o);break;case`script`:s=c.createElement(`div`),s.innerHTML=`<script><\/script>`,s=s.removeChild(s.firstChild);break;case`select`:s=typeof r.is==`string`?c.createElement(`select`,{is:r.is}):c.createElement(`select`),r.multiple?s.multiple=!0:r.size&&(s.size=r.size);break;default:s=typeof r.is==`string`?c.createElement(o,{is:r.is}):c.createElement(o)}}s[ot]=t,s[st]=r;a:for(c=t.child;c!==null;){if(c.tag===5||c.tag===6)s.appendChild(c.stateNode);else if(c.tag!==4&&c.tag!==27&&c.child!==null){c.child.return=c,c=c.child;continue}if(c===t)break a;for(;c.sibling===null;){if(c.return===null||c.return===t)break a;c=c.return}c.sibling.return=c.return,c=c.sibling}t.stateNode=s;a:switch(Fd(s,o,r),o){case`button`:case`input`:case`select`:case`textarea`:r=!!r.autoFocus;break a;case`img`:r=!0;break a;default:r=!1}r&&Dc(t)}}return Mc(t),Oc(t,t.type,e===null?null:e.memoizedProps,t.pendingProps,n),null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==r&&Dc(t);else{if(typeof r!=`string`&&t.stateNode===null)throw Error(a(166));if(e=ce.current,Mi(t)){if(e=t.stateNode,n=t.memoizedProps,r=null,o=wi,o!==null)switch(o.tag){case 27:case 5:r=o.memoizedProps}e[ot]=t,e=!!(e.nodeValue===n||r!==null&&!0===r.suppressHydrationWarning||Md(e.nodeValue,n)),e||ki(t,!0)}else e=Vd(e).createTextNode(r),e[ot]=t,t.stateNode=e}return Mc(t),null;case 31:if(n=t.memoizedState,e===null||e.memoizedState!==null){if(r=Mi(t),n!==null){if(e===null){if(!r)throw Error(a(318));if(e=t.memoizedState,e=e===null?null:e.dehydrated,!e)throw Error(a(557));e[ot]=t}else Ni(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;Mc(t),e=!1}else n=Pi(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=n),e=!0;if(!e)return t.flags&256?(eo(t),t):(eo(t),null);if(t.flags&128)throw Error(a(558))}return Mc(t),null;case 13:if(r=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(o=Mi(t),r!==null&&r.dehydrated!==null){if(e===null){if(!o)throw Error(a(318));if(o=t.memoizedState,o=o===null?null:o.dehydrated,!o)throw Error(a(317));o[ot]=t}else Ni(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;Mc(t),o=!1}else o=Pi(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=o),o=!0;if(!o)return t.flags&256?(eo(t),t):(eo(t),null)}return eo(t),t.flags&128?(t.lanes=n,t):(n=r!==null,e=e!==null&&e.memoizedState!==null,n&&(r=t.child,o=null,r.alternate!==null&&r.alternate.memoizedState!==null&&r.alternate.memoizedState.cachePool!==null&&(o=r.alternate.memoizedState.cachePool.pool),s=null,r.memoizedState!==null&&r.memoizedState.cachePool!==null&&(s=r.memoizedState.cachePool.pool),s!==o&&(r.flags|=2048)),n!==e&&n&&(t.child.flags|=8192),Ac(t,t.updateQueue),Mc(t),null);case 4:return de(),e===null&&Sd(t.stateNode.containerInfo),Mc(t),null;case 10:return Bi(t.type),Mc(t),null;case 19:if(I(to),r=t.memoizedState,r===null)return Mc(t),null;if(o=(t.flags&128)!=0,s=r.rendering,s===null)if(o)jc(r,!1);else{if(Ul!==0||e!==null&&e.flags&128)for(e=t.child;e!==null;){if(s=no(e),s!==null){for(t.flags|=128,jc(r,!1),e=s.updateQueue,t.updateQueue=e,Ac(t,e),t.subtreeFlags=0,e=n,n=t.child;n!==null;)ni(n,e),n=n.sibling;return L(to,to.current&1|2),Y&&yi(t,r.treeForkCount),t.child}e=e.sibling}r.tail!==null&&Ee()>eu&&(t.flags|=128,o=!0,jc(r,!1),t.lanes=4194304)}else{if(!o)if(e=no(s),e!==null){if(t.flags|=128,o=!0,e=e.updateQueue,t.updateQueue=e,Ac(t,e),jc(r,!0),r.tail===null&&r.tailMode===`hidden`&&!s.alternate&&!Y)return Mc(t),null}else 2*Ee()-r.renderingStartTime>eu&&n!==536870912&&(t.flags|=128,o=!0,jc(r,!1),t.lanes=4194304);r.isBackwards?(s.sibling=t.child,t.child=s):(e=r.last,e===null?t.child=s:e.sibling=s,r.last=s)}return r.tail===null?(Mc(t),null):(e=r.tail,r.rendering=e,r.tail=e.sibling,r.renderingStartTime=Ee(),e.sibling=null,n=to.current,L(to,o?n&1|2:n&1),Y&&yi(t,r.treeForkCount),e);case 22:case 23:return eo(t),qa(),r=t.memoizedState!==null,e===null?r&&(t.flags|=8192):e.memoizedState!==null!==r&&(t.flags|=8192),r?n&536870912&&!(t.flags&128)&&(Mc(t),t.subtreeFlags&6&&(t.flags|=8192)):Mc(t),n=t.updateQueue,n!==null&&Ac(t,n.retryQueue),n=null,e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(n=e.memoizedState.cachePool.pool),r=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(r=t.memoizedState.cachePool.pool),r!==n&&(t.flags|=2048),e!==null&&I(la),null;case 24:return n=null,e!==null&&(n=e.memoizedState.cache),t.memoizedState.cache!==n&&(t.flags|=2048),Bi(Qi),Mc(t),null;case 25:return null;case 30:return null}throw Error(a(156,t.tag))}function Pc(e,t){switch(Si(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return Bi(Qi),de(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return pe(t),null;case 31:if(t.memoizedState!==null){if(eo(t),t.alternate===null)throw Error(a(340));Ni()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 13:if(eo(t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(a(340));Ni()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return I(to),null;case 4:return de(),null;case 10:return Bi(t.type),null;case 22:case 23:return eo(t),qa(),e!==null&&I(la),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return Bi(Qi),null;case 25:return null;default:return null}}function Fc(e,t){switch(Si(t),t.tag){case 3:Bi(Qi),de();break;case 26:case 27:case 5:pe(t);break;case 4:de();break;case 31:t.memoizedState!==null&&eo(t);break;case 13:eo(t);break;case 19:I(to);break;case 10:Bi(t.type);break;case 22:case 23:eo(t),qa(),e!==null&&I(la);break;case 24:Bi(Qi)}}function Ic(e,t){try{var n=t.updateQueue,r=n===null?null:n.lastEffect;if(r!==null){var a=r.next;n=a;do{if((n.tag&e)===e){r=void 0;var o=n.create,s=n.inst;r=o(),s.destroy=r}n=n.next}while(n!==a)}}catch(e){Wu(t,t.return,e)}}function Lc(e,t,n){try{var r=t.updateQueue,a=r===null?null:r.lastEffect;if(a!==null){var o=a.next;r=o;do{if((r.tag&e)===e){var s=r.inst,c=s.destroy;if(c!==void 0){s.destroy=void 0,a=t;var l=n,u=c;try{u()}catch(e){Wu(a,l,e)}}}r=r.next}while(r!==o)}}catch(e){Wu(t,t.return,e)}}function Rc(e){var t=e.updateQueue;if(t!==null){var n=e.stateNode;try{Ha(t,n)}catch(t){Wu(e,e.return,t)}}}function zc(e,t,n){n.props=Bs(e.type,e.memoizedProps),n.state=e.memoizedState;try{n.componentWillUnmount()}catch(n){Wu(e,t,n)}}function Bc(e,t){try{var n=e.ref;if(n!==null){switch(e.tag){case 26:case 27:case 5:var r=e.stateNode;break;case 30:r=e.stateNode;break;default:r=e.stateNode}typeof n==`function`?e.refCleanup=n(r):n.current=r}}catch(n){Wu(e,t,n)}}function Vc(e,t){var n=e.ref,r=e.refCleanup;if(n!==null)if(typeof r==`function`)try{r()}catch(n){Wu(e,t,n)}finally{e.refCleanup=null,e=e.alternate,e!=null&&(e.refCleanup=null)}else if(typeof n==`function`)try{n(null)}catch(n){Wu(e,t,n)}else n.current=null}function Hc(e){var t=e.type,n=e.memoizedProps,r=e.stateNode;try{a:switch(t){case`button`:case`input`:case`select`:case`textarea`:n.autoFocus&&r.focus();break a;case`img`:n.src?r.src=n.src:n.srcSet&&(r.srcset=n.srcSet)}}catch(t){Wu(e,e.return,t)}}function Uc(e,t,n){try{var r=e.stateNode;Id(r,e.type,n,t),r[st]=t}catch(t){Wu(e,e.return,t)}}function Wc(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&Qd(e.type)||e.tag===4}function Gc(e){a:for(;;){for(;e.sibling===null;){if(e.return===null||Wc(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.tag===27&&Qd(e.type)||e.flags&2||e.child===null||e.tag===4)continue a;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function Kc(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?(n.nodeType===9?n.body:n.nodeName===`HTML`?n.ownerDocument.body:n).insertBefore(e,t):(t=n.nodeType===9?n.body:n.nodeName===`HTML`?n.ownerDocument.body:n,t.appendChild(e),n=n._reactRootContainer,n!=null||t.onclick!==null||(t.onclick=$t));else if(r!==4&&(r===27&&Qd(e.type)&&(n=e.stateNode,t=null),e=e.child,e!==null))for(Kc(e,t,n),e=e.sibling;e!==null;)Kc(e,t,n),e=e.sibling}function qc(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.insertBefore(e,t):n.appendChild(e);else if(r!==4&&(r===27&&Qd(e.type)&&(n=e.stateNode),e=e.child,e!==null))for(qc(e,t,n),e=e.sibling;e!==null;)qc(e,t,n),e=e.sibling}function Jc(e){var t=e.stateNode,n=e.memoizedProps;try{for(var r=e.type,a=t.attributes;a.length;)t.removeAttributeNode(a[0]);Fd(t,r,n),t[ot]=e,t[st]=n}catch(t){Wu(e,e.return,t)}}var Yc=!1,Xc=!1,Zc=!1,Qc=typeof WeakSet==`function`?WeakSet:Set,$c=null;function el(e,t){if(e=e.containerInfo,zd=cp,e=vr(e),yr(e)){if(`selectionStart`in e)var n={start:e.selectionStart,end:e.selectionEnd};else a:{n=(n=e.ownerDocument)&&n.defaultView||window;var r=n.getSelection&&n.getSelection();if(r&&r.rangeCount!==0){n=r.anchorNode;var o=r.anchorOffset,s=r.focusNode;r=r.focusOffset;try{n.nodeType,s.nodeType}catch{n=null;break a}var c=0,l=-1,u=-1,d=0,f=0,p=e,m=null;b:for(;;){for(var h;p!==n||o!==0&&p.nodeType!==3||(l=c+o),p!==s||r!==0&&p.nodeType!==3||(u=c+r),p.nodeType===3&&(c+=p.nodeValue.length),(h=p.firstChild)!==null;)m=p,p=h;for(;;){if(p===e)break b;if(m===n&&++d===o&&(l=c),m===s&&++f===r&&(u=c),(h=p.nextSibling)!==null)break;p=m,m=p.parentNode}p=h}n=l===-1||u===-1?null:{start:l,end:u}}else n=null}n||={start:0,end:0}}else n=null;for(Bd={focusedElem:e,selectionRange:n},cp=!1,$c=t;$c!==null;)if(t=$c,e=t.child,t.subtreeFlags&1028&&e!==null)e.return=t,$c=e;else for(;$c!==null;){switch(t=$c,s=t.alternate,e=t.flags,t.tag){case 0:if(e&4&&(e=t.updateQueue,e=e===null?null:e.events,e!==null))for(n=0;n<e.length;n++)o=e[n],o.ref.impl=o.nextImpl;break;case 11:case 15:break;case 1:if(e&1024&&s!==null){e=void 0,n=t,o=s.memoizedProps,s=s.memoizedState,r=n.stateNode;try{var g=Bs(n.type,o);e=r.getSnapshotBeforeUpdate(g,s),r.__reactInternalSnapshotBeforeUpdate=e}catch(e){Wu(n,n.return,e)}}break;case 3:if(e&1024){if(e=t.stateNode.containerInfo,n=e.nodeType,n===9)tf(e);else if(n===1)switch(e.nodeName){case`HEAD`:case`HTML`:case`BODY`:tf(e);break;default:e.textContent=``}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if(e&1024)throw Error(a(163))}if(e=t.sibling,e!==null){e.return=t.return,$c=e;break}$c=t.return}}function tl(e,t,n){var r=n.flags;switch(n.tag){case 0:case 11:case 15:gl(e,n),r&4&&Ic(5,n);break;case 1:if(gl(e,n),r&4)if(e=n.stateNode,t===null)try{e.componentDidMount()}catch(e){Wu(n,n.return,e)}else{var a=Bs(n.type,t.memoizedProps);t=t.memoizedState;try{e.componentDidUpdate(a,t,e.__reactInternalSnapshotBeforeUpdate)}catch(e){Wu(n,n.return,e)}}r&64&&Rc(n),r&512&&Bc(n,n.return);break;case 3:if(gl(e,n),r&64&&(e=n.updateQueue,e!==null)){if(t=null,n.child!==null)switch(n.child.tag){case 27:case 5:t=n.child.stateNode;break;case 1:t=n.child.stateNode}try{Ha(e,t)}catch(e){Wu(n,n.return,e)}}break;case 27:t===null&&r&4&&Jc(n);case 26:case 5:gl(e,n),t===null&&r&4&&Hc(n),r&512&&Bc(n,n.return);break;case 12:gl(e,n);break;case 31:gl(e,n),r&4&&sl(e,n);break;case 13:gl(e,n),r&4&&cl(e,n),r&64&&(e=n.memoizedState,e!==null&&(e=e.dehydrated,e!==null&&(n=Ju.bind(null,n),cf(e,n))));break;case 22:if(r=n.memoizedState!==null||Yc,!r){t=t!==null&&t.memoizedState!==null||Xc,a=Yc;var o=Xc;Yc=r,(Xc=t)&&!o?vl(e,n,(n.subtreeFlags&8772)!=0):gl(e,n),Yc=a,Xc=o}break;case 30:break;default:gl(e,n)}}function nl(e){var t=e.alternate;t!==null&&(e.alternate=null,nl(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&mt(t)),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}var rl=null,il=!1;function al(e,t,n){for(n=n.child;n!==null;)ol(e,t,n),n=n.sibling}function ol(e,t,n){if(Fe&&typeof Fe.onCommitFiberUnmount==`function`)try{Fe.onCommitFiberUnmount(Pe,n)}catch{}switch(n.tag){case 26:Xc||Vc(n,t),al(e,t,n),n.memoizedState?n.memoizedState.count--:n.stateNode&&(n=n.stateNode,n.parentNode.removeChild(n));break;case 27:Xc||Vc(n,t);var r=rl,a=il;Qd(n.type)&&(rl=n.stateNode,il=!1),al(e,t,n),mf(n.stateNode),rl=r,il=a;break;case 5:Xc||Vc(n,t);case 6:if(r=rl,a=il,rl=null,al(e,t,n),rl=r,il=a,rl!==null)if(il)try{(rl.nodeType===9?rl.body:rl.nodeName===`HTML`?rl.ownerDocument.body:rl).removeChild(n.stateNode)}catch(e){Wu(n,t,e)}else try{rl.removeChild(n.stateNode)}catch(e){Wu(n,t,e)}break;case 18:rl!==null&&(il?(e=rl,$d(e.nodeType===9?e.body:e.nodeName===`HTML`?e.ownerDocument.body:e,n.stateNode),Pp(e)):$d(rl,n.stateNode));break;case 4:r=rl,a=il,rl=n.stateNode.containerInfo,il=!0,al(e,t,n),rl=r,il=a;break;case 0:case 11:case 14:case 15:Lc(2,n,t),Xc||Lc(4,n,t),al(e,t,n);break;case 1:Xc||(Vc(n,t),r=n.stateNode,typeof r.componentWillUnmount==`function`&&zc(n,t,r)),al(e,t,n);break;case 21:al(e,t,n);break;case 22:Xc=(r=Xc)||n.memoizedState!==null,al(e,t,n),Xc=r;break;default:al(e,t,n)}}function sl(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null))){e=e.dehydrated;try{Pp(e)}catch(e){Wu(t,t.return,e)}}}function cl(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null&&(e=e.dehydrated,e!==null))))try{Pp(e)}catch(e){Wu(t,t.return,e)}}function ll(e){switch(e.tag){case 31:case 13:case 19:var t=e.stateNode;return t===null&&(t=e.stateNode=new Qc),t;case 22:return e=e.stateNode,t=e._retryCache,t===null&&(t=e._retryCache=new Qc),t;default:throw Error(a(435,e.tag))}}function ul(e,t){var n=ll(e);t.forEach(function(t){if(!n.has(t)){n.add(t);var r=Yu.bind(null,e,t);t.then(r,r)}})}function dl(e,t){var n=t.deletions;if(n!==null)for(var r=0;r<n.length;r++){var o=n[r],s=e,c=t,l=c;a:for(;l!==null;){switch(l.tag){case 27:if(Qd(l.type)){rl=l.stateNode,il=!1;break a}break;case 5:rl=l.stateNode,il=!1;break a;case 3:case 4:rl=l.stateNode.containerInfo,il=!0;break a}l=l.return}if(rl===null)throw Error(a(160));ol(s,c,o),rl=null,il=!1,s=o.alternate,s!==null&&(s.return=null),o.return=null}if(t.subtreeFlags&13886)for(t=t.child;t!==null;)pl(t,e),t=t.sibling}var fl=null;function pl(e,t){var n=e.alternate,r=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:dl(t,e),ml(e),r&4&&(Lc(3,e,e.return),Ic(3,e),Lc(5,e,e.return));break;case 1:dl(t,e),ml(e),r&512&&(Xc||n===null||Vc(n,n.return)),r&64&&Yc&&(e=e.updateQueue,e!==null&&(r=e.callbacks,r!==null&&(n=e.shared.hiddenCallbacks,e.shared.hiddenCallbacks=n===null?r:n.concat(r))));break;case 26:var o=fl;if(dl(t,e),ml(e),r&512&&(Xc||n===null||Vc(n,n.return)),r&4){var s=n===null?null:n.memoizedState;if(r=e.memoizedState,n===null)if(r===null)if(e.stateNode===null){a:{r=e.type,n=e.memoizedProps,o=o.ownerDocument||o;b:switch(r){case`title`:s=o.getElementsByTagName(`title`)[0],(!s||s[pt]||s[ot]||s.namespaceURI===`http://www.w3.org/2000/svg`||s.hasAttribute(`itemprop`))&&(s=o.createElement(r),o.head.insertBefore(s,o.querySelector(`head > title`))),Fd(s,r,n),s[ot]=e,yt(s),r=s;break a;case`link`:var c=Hf(`link`,`href`,o).get(r+(n.href||``));if(c){for(var l=0;l<c.length;l++)if(s=c[l],s.getAttribute(`href`)===(n.href==null||n.href===``?null:n.href)&&s.getAttribute(`rel`)===(n.rel==null?null:n.rel)&&s.getAttribute(`title`)===(n.title==null?null:n.title)&&s.getAttribute(`crossorigin`)===(n.crossOrigin==null?null:n.crossOrigin)){c.splice(l,1);break b}}s=o.createElement(r),Fd(s,r,n),o.head.appendChild(s);break;case`meta`:if(c=Hf(`meta`,`content`,o).get(r+(n.content||``))){for(l=0;l<c.length;l++)if(s=c[l],s.getAttribute(`content`)===(n.content==null?null:``+n.content)&&s.getAttribute(`name`)===(n.name==null?null:n.name)&&s.getAttribute(`property`)===(n.property==null?null:n.property)&&s.getAttribute(`http-equiv`)===(n.httpEquiv==null?null:n.httpEquiv)&&s.getAttribute(`charset`)===(n.charSet==null?null:n.charSet)){c.splice(l,1);break b}}s=o.createElement(r),Fd(s,r,n),o.head.appendChild(s);break;default:throw Error(a(468,r))}s[ot]=e,yt(s),r=s}e.stateNode=r}else Uf(o,e.type,e.stateNode);else e.stateNode=Lf(o,r,e.memoizedProps);else s===r?r===null&&e.stateNode!==null&&Uc(e,e.memoizedProps,n.memoizedProps):(s===null?n.stateNode!==null&&(n=n.stateNode,n.parentNode.removeChild(n)):s.count--,r===null?Uf(o,e.type,e.stateNode):Lf(o,r,e.memoizedProps))}break;case 27:dl(t,e),ml(e),r&512&&(Xc||n===null||Vc(n,n.return)),n!==null&&r&4&&Uc(e,e.memoizedProps,n.memoizedProps);break;case 5:if(dl(t,e),ml(e),r&512&&(Xc||n===null||Vc(n,n.return)),e.flags&32){o=e.stateNode;try{Gt(o,``)}catch(t){Wu(e,e.return,t)}}r&4&&e.stateNode!=null&&(o=e.memoizedProps,Uc(e,o,n===null?o:n.memoizedProps)),r&1024&&(Zc=!0);break;case 6:if(dl(t,e),ml(e),r&4){if(e.stateNode===null)throw Error(a(162));r=e.memoizedProps,n=e.stateNode;try{n.nodeValue=r}catch(t){Wu(e,e.return,t)}}break;case 3:if(Vf=null,o=fl,fl=_f(t.containerInfo),dl(t,e),fl=o,ml(e),r&4&&n!==null&&n.memoizedState.isDehydrated)try{Pp(t.containerInfo)}catch(t){Wu(e,e.return,t)}Zc&&(Zc=!1,hl(e));break;case 4:r=fl,fl=_f(e.stateNode.containerInfo),dl(t,e),ml(e),fl=r;break;case 12:dl(t,e),ml(e);break;case 31:dl(t,e),ml(e),r&4&&(r=e.updateQueue,r!==null&&(e.updateQueue=null,ul(e,r)));break;case 13:dl(t,e),ml(e),e.child.flags&8192&&e.memoizedState!==null!=(n!==null&&n.memoizedState!==null)&&(Ql=Ee()),r&4&&(r=e.updateQueue,r!==null&&(e.updateQueue=null,ul(e,r)));break;case 22:o=e.memoizedState!==null;var u=n!==null&&n.memoizedState!==null,d=Yc,f=Xc;if(Yc=d||o,Xc=f||u,dl(t,e),Xc=f,Yc=d,ml(e),r&8192)a:for(t=e.stateNode,t._visibility=o?t._visibility&-2:t._visibility|1,o&&(n===null||u||Yc||Xc||_l(e)),n=null,t=e;;){if(t.tag===5||t.tag===26){if(n===null){u=n=t;try{if(s=u.stateNode,o)c=s.style,typeof c.setProperty==`function`?c.setProperty(`display`,`none`,`important`):c.display=`none`;else{l=u.stateNode;var p=u.memoizedProps.style,m=p!=null&&p.hasOwnProperty(`display`)?p.display:null;l.style.display=m==null||typeof m==`boolean`?``:(``+m).trim()}}catch(e){Wu(u,u.return,e)}}}else if(t.tag===6){if(n===null){u=t;try{u.stateNode.nodeValue=o?``:u.memoizedProps}catch(e){Wu(u,u.return,e)}}}else if(t.tag===18){if(n===null){u=t;try{var h=u.stateNode;o?ef(h,!0):ef(u.stateNode,!1)}catch(e){Wu(u,u.return,e)}}}else if((t.tag!==22&&t.tag!==23||t.memoizedState===null||t===e)&&t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break a;for(;t.sibling===null;){if(t.return===null||t.return===e)break a;n===t&&(n=null),t=t.return}n===t&&(n=null),t.sibling.return=t.return,t=t.sibling}r&4&&(r=e.updateQueue,r!==null&&(n=r.retryQueue,n!==null&&(r.retryQueue=null,ul(e,n))));break;case 19:dl(t,e),ml(e),r&4&&(r=e.updateQueue,r!==null&&(e.updateQueue=null,ul(e,r)));break;case 30:break;case 21:break;default:dl(t,e),ml(e)}}function ml(e){var t=e.flags;if(t&2){try{for(var n,r=e.return;r!==null;){if(Wc(r)){n=r;break}r=r.return}if(n==null)throw Error(a(160));switch(n.tag){case 27:var o=n.stateNode;qc(e,Gc(e),o);break;case 5:var s=n.stateNode;n.flags&32&&(Gt(s,``),n.flags&=-33),qc(e,Gc(e),s);break;case 3:case 4:var c=n.stateNode.containerInfo;Kc(e,Gc(e),c);break;default:throw Error(a(161))}}catch(t){Wu(e,e.return,t)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function hl(e){if(e.subtreeFlags&1024)for(e=e.child;e!==null;){var t=e;hl(t),t.tag===5&&t.flags&1024&&t.stateNode.reset(),e=e.sibling}}function gl(e,t){if(t.subtreeFlags&8772)for(t=t.child;t!==null;)tl(e,t.alternate,t),t=t.sibling}function _l(e){for(e=e.child;e!==null;){var t=e;switch(t.tag){case 0:case 11:case 14:case 15:Lc(4,t,t.return),_l(t);break;case 1:Vc(t,t.return);var n=t.stateNode;typeof n.componentWillUnmount==`function`&&zc(t,t.return,n),_l(t);break;case 27:mf(t.stateNode);case 26:case 5:Vc(t,t.return),_l(t);break;case 22:t.memoizedState===null&&_l(t);break;case 30:_l(t);break;default:_l(t)}e=e.sibling}}function vl(e,t,n){for(n&&=(t.subtreeFlags&8772)!=0,t=t.child;t!==null;){var r=t.alternate,a=e,o=t,s=o.flags;switch(o.tag){case 0:case 11:case 15:vl(a,o,n),Ic(4,o);break;case 1:if(vl(a,o,n),r=o,a=r.stateNode,typeof a.componentDidMount==`function`)try{a.componentDidMount()}catch(e){Wu(r,r.return,e)}if(r=o,a=r.updateQueue,a!==null){var c=r.stateNode;try{var l=a.shared.hiddenCallbacks;if(l!==null)for(a.shared.hiddenCallbacks=null,a=0;a<l.length;a++)Va(l[a],c)}catch(e){Wu(r,r.return,e)}}n&&s&64&&Rc(o),Bc(o,o.return);break;case 27:Jc(o);case 26:case 5:vl(a,o,n),n&&r===null&&s&4&&Hc(o),Bc(o,o.return);break;case 12:vl(a,o,n);break;case 31:vl(a,o,n),n&&s&4&&sl(a,o);break;case 13:vl(a,o,n),n&&s&4&&cl(a,o);break;case 22:o.memoizedState===null&&vl(a,o,n),Bc(o,o.return);break;case 30:break;default:vl(a,o,n)}t=t.sibling}}function yl(e,t){var n=null;e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(n=e.memoizedState.cachePool.pool),e=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(e=t.memoizedState.cachePool.pool),e!==n&&(e!=null&&e.refCount++,n!=null&&ea(n))}function bl(e,t){e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&ea(e))}function xl(e,t,n,r){if(t.subtreeFlags&10256)for(t=t.child;t!==null;)Sl(e,t,n,r),t=t.sibling}function Sl(e,t,n,r){var a=t.flags;switch(t.tag){case 0:case 11:case 15:xl(e,t,n,r),a&2048&&Ic(9,t);break;case 1:xl(e,t,n,r);break;case 3:xl(e,t,n,r),a&2048&&(e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&ea(e)));break;case 12:if(a&2048){xl(e,t,n,r),e=t.stateNode;try{var o=t.memoizedProps,s=o.id,c=o.onPostCommit;typeof c==`function`&&c(s,t.alternate===null?`mount`:`update`,e.passiveEffectDuration,-0)}catch(e){Wu(t,t.return,e)}}else xl(e,t,n,r);break;case 31:xl(e,t,n,r);break;case 13:xl(e,t,n,r);break;case 23:break;case 22:o=t.stateNode,s=t.alternate,t.memoizedState===null?o._visibility&2?xl(e,t,n,r):(o._visibility|=2,Cl(e,t,n,r,(t.subtreeFlags&10256)!=0||!1)):o._visibility&2?xl(e,t,n,r):wl(e,t),a&2048&&yl(s,t);break;case 24:xl(e,t,n,r),a&2048&&bl(t.alternate,t);break;default:xl(e,t,n,r)}}function Cl(e,t,n,r,a){for(a&&=(t.subtreeFlags&10256)!=0||!1,t=t.child;t!==null;){var o=e,s=t,c=n,l=r,u=s.flags;switch(s.tag){case 0:case 11:case 15:Cl(o,s,c,l,a),Ic(8,s);break;case 23:break;case 22:var d=s.stateNode;s.memoizedState===null?(d._visibility|=2,Cl(o,s,c,l,a)):d._visibility&2?Cl(o,s,c,l,a):wl(o,s),a&&u&2048&&yl(s.alternate,s);break;case 24:Cl(o,s,c,l,a),a&&u&2048&&bl(s.alternate,s);break;default:Cl(o,s,c,l,a)}t=t.sibling}}function wl(e,t){if(t.subtreeFlags&10256)for(t=t.child;t!==null;){var n=e,r=t,a=r.flags;switch(r.tag){case 22:wl(n,r),a&2048&&yl(r.alternate,r);break;case 24:wl(n,r),a&2048&&bl(r.alternate,r);break;default:wl(n,r)}t=t.sibling}}var Tl=8192;function El(e,t,n){if(e.subtreeFlags&Tl)for(e=e.child;e!==null;)Dl(e,t,n),e=e.sibling}function Dl(e,t,n){switch(e.tag){case 26:El(e,t,n),e.flags&Tl&&e.memoizedState!==null&&Kf(n,fl,e.memoizedState,e.memoizedProps);break;case 5:El(e,t,n);break;case 3:case 4:var r=fl;fl=_f(e.stateNode.containerInfo),El(e,t,n),fl=r;break;case 22:e.memoizedState===null&&(r=e.alternate,r!==null&&r.memoizedState!==null?(r=Tl,Tl=16777216,El(e,t,n),Tl=r):El(e,t,n));break;default:El(e,t,n)}}function Ol(e){var t=e.alternate;if(t!==null&&(e=t.child,e!==null)){t.child=null;do t=e.sibling,e.sibling=null,e=t;while(e!==null)}}function kl(e){var t=e.deletions;if(e.flags&16){if(t!==null)for(var n=0;n<t.length;n++){var r=t[n];$c=r,Ml(r,e)}Ol(e)}if(e.subtreeFlags&10256)for(e=e.child;e!==null;)Al(e),e=e.sibling}function Al(e){switch(e.tag){case 0:case 11:case 15:kl(e),e.flags&2048&&Lc(9,e,e.return);break;case 3:kl(e);break;case 12:kl(e);break;case 22:var t=e.stateNode;e.memoizedState!==null&&t._visibility&2&&(e.return===null||e.return.tag!==13)?(t._visibility&=-3,jl(e)):kl(e);break;default:kl(e)}}function jl(e){var t=e.deletions;if(e.flags&16){if(t!==null)for(var n=0;n<t.length;n++){var r=t[n];$c=r,Ml(r,e)}Ol(e)}for(e=e.child;e!==null;){switch(t=e,t.tag){case 0:case 11:case 15:Lc(8,t,t.return),jl(t);break;case 22:n=t.stateNode,n._visibility&2&&(n._visibility&=-3,jl(t));break;default:jl(t)}e=e.sibling}}function Ml(e,t){for(;$c!==null;){var n=$c;switch(n.tag){case 0:case 11:case 15:Lc(8,n,t);break;case 23:case 22:if(n.memoizedState!==null&&n.memoizedState.cachePool!==null){var r=n.memoizedState.cachePool.pool;r!=null&&r.refCount++}break;case 24:ea(n.memoizedState.cache)}if(r=n.child,r!==null)r.return=n,$c=r;else a:for(n=e;$c!==null;){r=$c;var a=r.sibling,o=r.return;if(nl(r),r===n){$c=null;break a}if(a!==null){a.return=o,$c=a;break a}$c=o}}}var Nl={getCacheForType:function(e){var t=Ki(Qi),n=t.data.get(e);return n===void 0&&(n=e(),t.data.set(e,n)),n},cacheSignal:function(){return Ki(Qi).controller.signal}},Pl=typeof WeakMap==`function`?WeakMap:Map,Fl=0,Il=null,Z=null,Q=0,Ll=0,Rl=null,zl=!1,Bl=!1,Vl=!1,Hl=0,Ul=0,Wl=0,Gl=0,Kl=0,ql=0,Jl=0,Yl=null,Xl=null,Zl=!1,Ql=0,$l=0,eu=1/0,tu=null,nu=null,ru=0,iu=null,au=null,ou=0,su=0,cu=null,lu=null,uu=0,du=null;function fu(){return Fl&2&&Q!==0?Q&-Q:N.T===null?rt():dd()}function pu(){if(ql===0)if(!(Q&536870912)||Y){var e=He;He<<=1,!(He&3932160)&&(He=262144),ql=e}else ql=536870912;return e=Ja.current,e!==null&&(e.flags|=32),ql}function mu(e,t,n){(e===Il&&(Ll===2||Ll===9)||e.cancelPendingCommit!==null)&&(xu(e,0),vu(e,Q,ql,!1)),Xe(e,n),(!(Fl&2)||e!==Il)&&(e===Il&&(!(Fl&2)&&(Gl|=n),Ul===4&&vu(e,Q,ql,!1)),rd(e))}function hu(e,t,n){if(Fl&6)throw Error(a(327));var r=!n&&(t&127)==0&&(t&e.expiredLanes)===0||Ke(e,t),o=r?ku(e,t):Du(e,t,!0),s=r;do{if(o===0){Bl&&!r&&vu(e,t,0,!1);break}else{if(n=e.current.alternate,s&&!_u(n)){o=Du(e,t,!1),s=!1;continue}if(o===2){if(s=t,e.errorRecoveryDisabledLanes&s)var c=0;else c=e.pendingLanes&-536870913,c=c===0?c&536870912?536870912:0:c;if(c!==0){t=c;a:{var l=e;o=Yl;var u=l.current.memoizedState.isDehydrated;if(u&&(xu(l,c).flags|=256),c=Du(l,c,!1),c!==2){if(Vl&&!u){l.errorRecoveryDisabledLanes|=s,Gl|=s,o=4;break a}s=Xl,Xl=o,s!==null&&(Xl===null?Xl=s:Xl.push.apply(Xl,s))}o=c}if(s=!1,o!==2)continue}}if(o===1){xu(e,0),vu(e,t,0,!0);break}a:{switch(r=e,s=o,s){case 0:case 1:throw Error(a(345));case 4:if((t&4194048)!==t)break;case 6:vu(r,t,ql,!zl);break a;case 2:Xl=null;break;case 3:case 5:break;default:throw Error(a(329))}if((t&62914560)===t&&(o=Ql+300-Ee(),10<o)){if(vu(r,t,ql,!zl),Ge(r,0,!0)!==0)break a;ou=t,r.timeoutHandle=qd(gu.bind(null,r,n,Xl,tu,Zl,t,ql,Gl,Jl,zl,s,`Throttled`,-0,0),o);break a}gu(r,n,Xl,tu,Zl,t,ql,Gl,Jl,zl,s,null,-0,0)}}break}while(1);rd(e)}function gu(e,t,n,r,a,o,s,c,l,u,d,f,p,m){if(e.timeoutHandle=-1,f=t.subtreeFlags,f&8192||(f&16785408)==16785408){f={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:$t},Dl(t,o,f);var h=(o&62914560)===o?Ql-Ee():(o&4194048)===o?$l-Ee():0;if(h=Jf(f,h),h!==null){ou=o,e.cancelPendingCommit=h(Iu.bind(null,e,t,o,n,r,a,s,c,l,d,f,null,p,m)),vu(e,o,s,!u);return}}Iu(e,t,o,n,r,a,s,c,l)}function _u(e){for(var t=e;;){var n=t.tag;if((n===0||n===11||n===15)&&t.flags&16384&&(n=t.updateQueue,n!==null&&(n=n.stores,n!==null)))for(var r=0;r<n.length;r++){var a=n[r],o=a.getSnapshot;a=a.value;try{if(!pr(o(),a))return!1}catch{return!1}}if(n=t.child,t.subtreeFlags&16384&&n!==null)n.return=t,t=n;else{if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return!0;t=t.return}t.sibling.return=t.return,t=t.sibling}}return!0}function vu(e,t,n,r){t&=~Kl,t&=~Gl,e.suspendedLanes|=t,e.pingedLanes&=~t,r&&(e.warmLanes|=t),r=e.expirationTimes;for(var a=t;0<a;){var o=31-Le(a),s=1<<o;r[o]=-1,a&=~s}n!==0&&Qe(e,n,t)}function yu(){return Fl&6?!0:(id(0,!1),!1)}function bu(){if(Z!==null){if(Ll===0)var e=Z.return;else e=Z,Ri=Li=null,So(e),Ca=null,wa=0,e=Z;for(;e!==null;)Fc(e.alternate,e),e=e.return;Z=null}}function xu(e,t){var n=e.timeoutHandle;n!==-1&&(e.timeoutHandle=-1,Jd(n)),n=e.cancelPendingCommit,n!==null&&(e.cancelPendingCommit=null,n()),ou=0,bu(),Il=e,Z=n=ti(e.current,null),Q=t,Ll=0,Rl=null,zl=!1,Bl=Ke(e,t),Vl=!1,Jl=ql=Kl=Gl=Wl=Ul=0,Xl=Yl=null,Zl=!1,t&8&&(t|=t&32);var r=e.entangledLanes;if(r!==0)for(e=e.entanglements,r&=t;0<r;){var a=31-Le(r),o=1<<a;t|=e[a],r&=~o}return Hl=t,Gr(),n}function Su(e,t){X=null,N.H=Ms,t===pa||t===ha?(t=xa(),Ll=3):t===ma?(t=xa(),Ll=4):Ll=t===Xs?8:typeof t==`object`&&t&&typeof t.then==`function`?6:1,Rl=t,Z===null&&(Ul=1,Ws(e,li(t,e.current)))}function Cu(){var e=Ja.current;return e===null?!0:(Q&4194048)===Q?Ya===null:(Q&62914560)===Q||Q&536870912?e===Ya:!1}function wu(){var e=N.H;return N.H=Ms,e===null?Ms:e}function Tu(){var e=N.A;return N.A=Nl,e}function Eu(){Ul=4,zl||(Q&4194048)!==Q&&Ja.current!==null||(Bl=!0),!(Wl&134217727)&&!(Gl&134217727)||Il===null||vu(Il,Q,ql,!1)}function Du(e,t,n){var r=Fl;Fl|=2;var a=wu(),o=Tu();(Il!==e||Q!==t)&&(tu=null,xu(e,t)),t=!1;var s=Ul;a:do try{if(Ll!==0&&Z!==null){var c=Z,l=Rl;switch(Ll){case 8:bu(),s=6;break a;case 3:case 2:case 9:case 6:Ja.current===null&&(t=!0);var u=Ll;if(Ll=0,Rl=null,Nu(e,c,l,u),n&&Bl){s=0;break a}break;default:u=Ll,Ll=0,Rl=null,Nu(e,c,l,u)}}Ou(),s=Ul;break}catch(t){Su(e,t)}while(1);return t&&e.shellSuspendCounter++,Ri=Li=null,Fl=r,N.H=a,N.A=o,Z===null&&(Il=null,Q=0,Gr()),s}function Ou(){for(;Z!==null;)ju(Z)}function ku(e,t){var n=Fl;Fl|=2;var r=wu(),o=Tu();Il!==e||Q!==t?(tu=null,eu=Ee()+500,xu(e,t)):Bl=Ke(e,t);a:do try{if(Ll!==0&&Z!==null){t=Z;var s=Rl;b:switch(Ll){case 1:Ll=0,Rl=null,Nu(e,t,s,1);break;case 2:case 9:if(_a(s)){Ll=0,Rl=null,Mu(t);break}t=function(){Ll!==2&&Ll!==9||Il!==e||(Ll=7),rd(e)},s.then(t,t);break a;case 3:Ll=7;break a;case 4:Ll=5;break a;case 7:_a(s)?(Ll=0,Rl=null,Mu(t)):(Ll=0,Rl=null,Nu(e,t,s,7));break;case 5:var c=null;switch(Z.tag){case 26:c=Z.memoizedState;case 5:case 27:var l=Z;if(c?Gf(c):l.stateNode.complete){Ll=0,Rl=null;var u=l.sibling;if(u!==null)Z=u;else{var d=l.return;d===null?Z=null:(Z=d,Pu(d))}break b}}Ll=0,Rl=null,Nu(e,t,s,5);break;case 6:Ll=0,Rl=null,Nu(e,t,s,6);break;case 8:bu(),Ul=6;break a;default:throw Error(a(462))}}Au();break}catch(t){Su(e,t)}while(1);return Ri=Li=null,N.H=r,N.A=o,Fl=n,Z===null?(Il=null,Q=0,Gr(),Ul):0}function Au(){for(;Z!==null&&!we();)ju(Z)}function ju(e){var t=Ec(e.alternate,e,Hl);e.memoizedProps=e.pendingProps,t===null?Pu(e):Z=t}function Mu(e){var t=e,n=t.alternate;switch(t.tag){case 15:case 0:t=uc(n,t,t.pendingProps,t.type,void 0,Q);break;case 11:t=uc(n,t,t.pendingProps,t.type.render,t.ref,Q);break;case 5:So(t);default:Fc(n,t),t=Z=ni(t,Hl),t=Ec(n,t,Hl)}e.memoizedProps=e.pendingProps,t===null?Pu(e):Z=t}function Nu(e,t,n,r){Ri=Li=null,So(t),Ca=null,wa=0;var a=t.return;try{if(Ys(e,a,t,n,Q)){Ul=1,Ws(e,li(n,e.current)),Z=null;return}}catch(t){if(a!==null)throw Z=a,t;Ul=1,Ws(e,li(n,e.current)),Z=null;return}t.flags&32768?(Y||r===1?e=!0:Bl||Q&536870912?e=!1:(zl=e=!0,(r===2||r===9||r===3||r===6)&&(r=Ja.current,r!==null&&r.tag===13&&(r.flags|=16384))),Fu(t,e)):Pu(t)}function Pu(e){var t=e;do{if(t.flags&32768){Fu(t,zl);return}e=t.return;var n=Nc(t.alternate,t,Hl);if(n!==null){Z=n;return}if(t=t.sibling,t!==null){Z=t;return}Z=t=e}while(t!==null);Ul===0&&(Ul=5)}function Fu(e,t){do{var n=Pc(e.alternate,e);if(n!==null){n.flags&=32767,Z=n;return}if(n=e.return,n!==null&&(n.flags|=32768,n.subtreeFlags=0,n.deletions=null),!t&&(e=e.sibling,e!==null)){Z=e;return}Z=e=n}while(e!==null);Ul=6,Z=null}function Iu(e,t,n,r,o,s,c,l,u){e.cancelPendingCommit=null;do Vu();while(ru!==0);if(Fl&6)throw Error(a(327));if(t!==null){if(t===e.current)throw Error(a(177));if(s=t.lanes|t.childLanes,s|=Wr,Ze(e,n,s,c,l,u),e===Il&&(Z=Il=null,Q=0),au=t,iu=e,ou=n,su=s,cu=o,lu=r,t.subtreeFlags&10256||t.flags&10256?(e.callbackNode=null,e.callbackPriority=0,Xu(Ae,function(){return Hu(),null})):(e.callbackNode=null,e.callbackPriority=0),r=(t.flags&13878)!=0,t.subtreeFlags&13878||r){r=N.T,N.T=null,o=P.p,P.p=2,c=Fl,Fl|=4;try{el(e,t,n)}finally{Fl=c,P.p=o,N.T=r}}ru=1,Lu(),Ru(),zu()}}function Lu(){if(ru===1){ru=0;var e=iu,t=au,n=(t.flags&13878)!=0;if(t.subtreeFlags&13878||n){n=N.T,N.T=null;var r=P.p;P.p=2;var a=Fl;Fl|=4;try{pl(t,e);var o=Bd,s=vr(e.containerInfo),c=o.focusedElem,l=o.selectionRange;if(s!==c&&c&&c.ownerDocument&&_r(c.ownerDocument.documentElement,c)){if(l!==null&&yr(c)){var u=l.start,d=l.end;if(d===void 0&&(d=u),`selectionStart`in c)c.selectionStart=u,c.selectionEnd=Math.min(d,c.value.length);else{var f=c.ownerDocument||document,p=f&&f.defaultView||window;if(p.getSelection){var m=p.getSelection(),h=c.textContent.length,g=Math.min(l.start,h),_=l.end===void 0?g:Math.min(l.end,h);!m.extend&&g>_&&(s=_,_=g,g=s);var v=gr(c,g),y=gr(c,_);if(v&&y&&(m.rangeCount!==1||m.anchorNode!==v.node||m.anchorOffset!==v.offset||m.focusNode!==y.node||m.focusOffset!==y.offset)){var b=f.createRange();b.setStart(v.node,v.offset),m.removeAllRanges(),g>_?(m.addRange(b),m.extend(y.node,y.offset)):(b.setEnd(y.node,y.offset),m.addRange(b))}}}}for(f=[],m=c;m=m.parentNode;)m.nodeType===1&&f.push({element:m,left:m.scrollLeft,top:m.scrollTop});for(typeof c.focus==`function`&&c.focus(),c=0;c<f.length;c++){var x=f[c];x.element.scrollLeft=x.left,x.element.scrollTop=x.top}}cp=!!zd,Bd=zd=null}finally{Fl=a,P.p=r,N.T=n}}e.current=t,ru=2}}function Ru(){if(ru===2){ru=0;var e=iu,t=au,n=(t.flags&8772)!=0;if(t.subtreeFlags&8772||n){n=N.T,N.T=null;var r=P.p;P.p=2;var a=Fl;Fl|=4;try{tl(e,t.alternate,t)}finally{Fl=a,P.p=r,N.T=n}}ru=3}}function zu(){if(ru===4||ru===3){ru=0,Te();var e=iu,t=au,n=ou,r=lu;t.subtreeFlags&10256||t.flags&10256?ru=5:(ru=0,au=iu=null,Bu(e,e.pendingLanes));var a=e.pendingLanes;if(a===0&&(nu=null),nt(n),t=t.stateNode,Fe&&typeof Fe.onCommitFiberRoot==`function`)try{Fe.onCommitFiberRoot(Pe,t,void 0,(t.current.flags&128)==128)}catch{}if(r!==null){t=N.T,a=P.p,P.p=2,N.T=null;try{for(var o=e.onRecoverableError,s=0;s<r.length;s++){var c=r[s];o(c.value,{componentStack:c.stack})}}finally{N.T=t,P.p=a}}ou&3&&Vu(),rd(e),a=e.pendingLanes,n&261930&&a&42?e===du?uu++:(uu=0,du=e):uu=0,id(0,!1)}}function Bu(e,t){(e.pooledCacheLanes&=t)===0&&(t=e.pooledCache,t!=null&&(e.pooledCache=null,ea(t)))}function Vu(){return Lu(),Ru(),zu(),Hu()}function Hu(){if(ru!==5)return!1;var e=iu,t=su;su=0;var n=nt(ou),r=N.T,o=P.p;try{P.p=32>n?32:n,N.T=null,n=cu,cu=null;var s=iu,c=ou;if(ru=0,au=iu=null,ou=0,Fl&6)throw Error(a(331));var l=Fl;if(Fl|=4,Al(s.current),Sl(s,s.current,c,n),Fl=l,id(0,!1),Fe&&typeof Fe.onPostCommitFiberRoot==`function`)try{Fe.onPostCommitFiberRoot(Pe,s)}catch{}return!0}finally{P.p=o,N.T=r,Bu(e,t)}}function Uu(e,t,n){t=li(n,t),t=Ks(e.stateNode,t,2),e=Fa(e,t,2),e!==null&&(Xe(e,2),rd(e))}function Wu(e,t,n){if(e.tag===3)Uu(e,e,n);else for(;t!==null;){if(t.tag===3){Uu(t,e,n);break}else if(t.tag===1){var r=t.stateNode;if(typeof t.type.getDerivedStateFromError==`function`||typeof r.componentDidCatch==`function`&&(nu===null||!nu.has(r))){e=li(n,e),n=qs(2),r=Fa(t,n,2),r!==null&&(Js(n,r,t,e),Xe(r,2),rd(r));break}}t=t.return}}function Gu(e,t,n){var r=e.pingCache;if(r===null){r=e.pingCache=new Pl;var a=new Set;r.set(t,a)}else a=r.get(t),a===void 0&&(a=new Set,r.set(t,a));a.has(n)||(Vl=!0,a.add(n),e=Ku.bind(null,e,t,n),t.then(e,e))}function Ku(e,t,n){var r=e.pingCache;r!==null&&r.delete(t),e.pingedLanes|=e.suspendedLanes&n,e.warmLanes&=~n,Il===e&&(Q&n)===n&&(Ul===4||Ul===3&&(Q&62914560)===Q&&300>Ee()-Ql?!(Fl&2)&&xu(e,0):Kl|=n,Jl===Q&&(Jl=0)),rd(e)}function qu(e,t){t===0&&(t=Je()),e=Jr(e,t),e!==null&&(Xe(e,t),rd(e))}function Ju(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),qu(e,n)}function Yu(e,t){var n=0;switch(e.tag){case 31:case 13:var r=e.stateNode,o=e.memoizedState;o!==null&&(n=o.retryLane);break;case 19:r=e.stateNode;break;case 22:r=e.stateNode._retryCache;break;default:throw Error(a(314))}r!==null&&r.delete(t),qu(e,n)}function Xu(e,t){return Se(e,t)}var Zu=null,Qu=null,$u=!1,ed=!1,td=!1,nd=0;function rd(e){e!==Qu&&e.next===null&&(Qu===null?Zu=Qu=e:Qu=Qu.next=e),ed=!0,$u||($u=!0,ud())}function id(e,t){if(!td&&ed){td=!0;do for(var n=!1,r=Zu;r!==null;){if(!t)if(e!==0){var a=r.pendingLanes;if(a===0)var o=0;else{var s=r.suspendedLanes,c=r.pingedLanes;o=(1<<31-Le(42|e)+1)-1,o&=a&~(s&~c),o=o&201326741?o&201326741|1:o?o|2:0}o!==0&&(n=!0,ld(r,o))}else o=Q,o=Ge(r,r===Il?o:0,r.cancelPendingCommit!==null||r.timeoutHandle!==-1),!(o&3)||Ke(r,o)||(n=!0,ld(r,o));r=r.next}while(n);td=!1}}function ad(){od()}function od(){ed=$u=!1;var e=0;nd!==0&&Kd()&&(e=nd);for(var t=Ee(),n=null,r=Zu;r!==null;){var a=r.next,o=sd(r,t);o===0?(r.next=null,n===null?Zu=a:n.next=a,a===null&&(Qu=n)):(n=r,(e!==0||o&3)&&(ed=!0)),r=a}ru!==0&&ru!==5||id(e,!1),nd!==0&&(nd=0)}function sd(e,t){for(var n=e.suspendedLanes,r=e.pingedLanes,a=e.expirationTimes,o=e.pendingLanes&-62914561;0<o;){var s=31-Le(o),c=1<<s,l=a[s];l===-1?((c&n)===0||(c&r)!==0)&&(a[s]=qe(c,t)):l<=t&&(e.expiredLanes|=c),o&=~c}if(t=Il,n=Q,n=Ge(e,e===t?n:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),r=e.callbackNode,n===0||e===t&&(Ll===2||Ll===9)||e.cancelPendingCommit!==null)return r!==null&&r!==null&&Ce(r),e.callbackNode=null,e.callbackPriority=0;if(!(n&3)||Ke(e,n)){if(t=n&-n,t===e.callbackPriority)return t;switch(r!==null&&Ce(r),nt(n)){case 2:case 8:n=ke;break;case 32:n=Ae;break;case 268435456:n=z;break;default:n=Ae}return r=cd.bind(null,e),n=Se(n,r),e.callbackPriority=t,e.callbackNode=n,t}return r!==null&&r!==null&&Ce(r),e.callbackPriority=2,e.callbackNode=null,2}function cd(e,t){if(ru!==0&&ru!==5)return e.callbackNode=null,e.callbackPriority=0,null;var n=e.callbackNode;if(Vu()&&e.callbackNode!==n)return null;var r=Q;return r=Ge(e,e===Il?r:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),r===0?null:(hu(e,r,t),sd(e,Ee()),e.callbackNode!=null&&e.callbackNode===n?cd.bind(null,e):null)}function ld(e,t){if(Vu())return null;hu(e,t,!0)}function ud(){Xd(function(){Fl&6?Se(Oe,ad):od()})}function dd(){if(nd===0){var e=ra;e===0&&(e=Ve,Ve<<=1,!(Ve&261888)&&(Ve=256)),nd=e}return nd}function fd(e){return e==null||typeof e==`symbol`||typeof e==`boolean`?null:typeof e==`function`?e:Qt(``+e)}function pd(e,t){var n=t.ownerDocument.createElement(`input`);return n.name=t.name,n.value=t.value,e.id&&n.setAttribute(`form`,e.id),t.parentNode.insertBefore(n,t),e=new FormData(e),n.parentNode.removeChild(n),e}function md(e,t,n,r,a){if(t===`submit`&&n&&n.stateNode===a){var o=fd((a[st]||null).action),s=r.submitter;s&&(t=(t=s[st]||null)?fd(t.formAction):s.getAttribute(`formAction`),t!==null&&(o=t,s=null));var c=new xn(`action`,`action`,null,r,a);e.push({event:c,listeners:[{instance:null,listener:function(){if(r.defaultPrevented){if(nd!==0){var e=s?pd(a,s):new FormData(a);vs(n,{pending:!0,data:e,method:a.method,action:o},null,e)}}else typeof o==`function`&&(c.preventDefault(),e=s?pd(a,s):new FormData(a),vs(n,{pending:!0,data:e,method:a.method,action:o},o,e))},currentTarget:a}]})}}for(var hd=0;hd<zr.length;hd++){var gd=zr[hd];Br(gd.toLowerCase(),`on`+(gd[0].toUpperCase()+gd.slice(1)))}Br(jr,`onAnimationEnd`),Br(Mr,`onAnimationIteration`),Br(Nr,`onAnimationStart`),Br(`dblclick`,`onDoubleClick`),Br(`focusin`,`onFocus`),Br(`focusout`,`onBlur`),Br(Pr,`onTransitionRun`),Br(Fr,`onTransitionStart`),Br(Ir,`onTransitionCancel`),Br(Lr,`onTransitionEnd`),Ct(`onMouseEnter`,[`mouseout`,`mouseover`]),Ct(`onMouseLeave`,[`mouseout`,`mouseover`]),Ct(`onPointerEnter`,[`pointerout`,`pointerover`]),Ct(`onPointerLeave`,[`pointerout`,`pointerover`]),St(`onChange`,`change click focusin focusout input keydown keyup selectionchange`.split(` `)),St(`onSelect`,`focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange`.split(` `)),St(`onBeforeInput`,[`compositionend`,`keypress`,`textInput`,`paste`]),St(`onCompositionEnd`,`compositionend focusout keydown keypress keyup mousedown`.split(` `)),St(`onCompositionStart`,`compositionstart focusout keydown keypress keyup mousedown`.split(` `)),St(`onCompositionUpdate`,`compositionupdate focusout keydown keypress keyup mousedown`.split(` `));var _d=`abort canplay canplaythrough durationchange emptied encrypted ended error loadeddata loadedmetadata loadstart pause play playing progress ratechange resize seeked seeking stalled suspend timeupdate volumechange waiting`.split(` `),vd=new Set(`beforetoggle cancel close invalid load scroll scrollend toggle`.split(` `).concat(_d));function yd(e,t){t=(t&4)!=0;for(var n=0;n<e.length;n++){var r=e[n],a=r.event;r=r.listeners;a:{var o=void 0;if(t)for(var s=r.length-1;0<=s;s--){var c=r[s],l=c.instance,u=c.currentTarget;if(c=c.listener,l!==o&&a.isPropagationStopped())break a;o=c,a.currentTarget=u;try{o(a)}catch(e){Vr(e)}a.currentTarget=null,o=l}else for(s=0;s<r.length;s++){if(c=r[s],l=c.instance,u=c.currentTarget,c=c.listener,l!==o&&a.isPropagationStopped())break a;o=c,a.currentTarget=u;try{o(a)}catch(e){Vr(e)}a.currentTarget=null,o=l}}}}function $(e,t){var n=t[lt];n===void 0&&(n=t[lt]=new Set);var r=e+`__bubble`;n.has(r)||(Cd(t,e,2,!1),n.add(r))}function bd(e,t,n){var r=0;t&&(r|=4),Cd(n,e,r,t)}var xd=`_reactListening`+Math.random().toString(36).slice(2);function Sd(e){if(!e[xd]){e[xd]=!0,bt.forEach(function(t){t!==`selectionchange`&&(vd.has(t)||bd(t,!1,e),bd(t,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[xd]||(t[xd]=!0,bd(`selectionchange`,!1,t))}}function Cd(e,t,n,r){switch(hp(t)){case 2:var a=lp;break;case 8:a=up;break;default:a=dp}n=a.bind(null,t,n,e),a=void 0,!un||t!==`touchstart`&&t!==`touchmove`&&t!==`wheel`||(a=!0),r?a===void 0?e.addEventListener(t,n,!0):e.addEventListener(t,n,{capture:!0,passive:a}):a===void 0?e.addEventListener(t,n,!1):e.addEventListener(t,n,{passive:a})}function wd(e,t,n,r,a){var o=r;if(!(t&1)&&!(t&2)&&r!==null)a:for(;;){if(r===null)return;var c=r.tag;if(c===3||c===4){var l=r.stateNode.containerInfo;if(l===a)break;if(c===4)for(c=r.return;c!==null;){var u=c.tag;if((u===3||u===4)&&c.stateNode.containerInfo===a)return;c=c.return}for(;l!==null;){if(c=ht(l),c===null)return;if(u=c.tag,u===5||u===6||u===26||u===27){r=o=c;continue a}l=l.parentNode}}r=r.return}sn(function(){var r=o,a=tn(n),c=[];a:{var l=Rr.get(e);if(l!==void 0){var u=xn,d=e;switch(e){case`keypress`:if(gn(n)===0)break a;case`keydown`:case`keyup`:u=Ln;break;case`focusin`:d=`focus`,u=kn;break;case`focusout`:d=`blur`,u=kn;break;case`beforeblur`:case`afterblur`:u=kn;break;case`click`:if(n.button===2)break a;case`auxclick`:case`dblclick`:case`mousedown`:case`mousemove`:case`mouseup`:case`mouseout`:case`mouseover`:case`contextmenu`:u=Dn;break;case`drag`:case`dragend`:case`dragenter`:case`dragexit`:case`dragleave`:case`dragover`:case`dragstart`:case`drop`:u=On;break;case`touchcancel`:case`touchend`:case`touchmove`:case`touchstart`:u=H;break;case jr:case Mr:case Nr:u=An;break;case Lr:u=zn;break;case`scroll`:case`scrollend`:u=Sn;break;case`wheel`:u=Bn;break;case`copy`:case`cut`:case`paste`:u=jn;break;case`gotpointercapture`:case`lostpointercapture`:case`pointercancel`:case`pointerdown`:case`pointermove`:case`pointerout`:case`pointerover`:case`pointerup`:u=Rn;break;case`toggle`:case`beforetoggle`:u=Vn}var f=(t&4)!=0,p=!f&&(e===`scroll`||e===`scrollend`),m=f?l===null?null:l+`Capture`:l;f=[];for(var h=r,g;h!==null;){var _=h;if(g=_.stateNode,_=_.tag,_!==5&&_!==26&&_!==27||g===null||m===null||(_=cn(h,m),_!=null&&f.push(Td(h,_,g))),p)break;h=h.return}0<f.length&&(l=new u(l,d,null,n,a),c.push({event:l,listeners:f}))}}if(!(t&7)){a:{if(l=e===`mouseover`||e===`pointerover`,u=e===`mouseout`||e===`pointerout`,l&&n!==en&&(d=n.relatedTarget||n.fromElement)&&(ht(d)||d[ct]))break a;if((u||l)&&(l=a.window===a?a:(l=a.ownerDocument)?l.defaultView||l.parentWindow:window,u?(d=n.relatedTarget||n.toElement,u=r,d=d?ht(d):null,d!==null&&(p=s(d),f=d.tag,d!==p||f!==5&&f!==27&&f!==6)&&(d=null)):(u=null,d=r),u!==d)){if(f=Dn,_=`onMouseLeave`,m=`onMouseEnter`,h=`mouse`,(e===`pointerout`||e===`pointerover`)&&(f=Rn,_=`onPointerLeave`,m=`onPointerEnter`,h=`pointer`),p=u==null?l:_t(u),g=d==null?l:_t(d),l=new f(_,h+`leave`,u,n,a),l.target=p,l.relatedTarget=g,_=null,ht(a)===r&&(f=new f(m,h+`enter`,d,n,a),f.target=g,f.relatedTarget=p,_=f),p=_,u&&d)b:{for(f=Dd,m=u,h=d,g=0,_=m;_;_=f(_))g++;_=0;for(var v=h;v;v=f(v))_++;for(;0<g-_;)m=f(m),g--;for(;0<_-g;)h=f(h),_--;for(;g--;){if(m===h||h!==null&&m===h.alternate){f=m;break b}m=f(m),h=f(h)}f=null}else f=null;u!==null&&Od(c,l,u,f,!1),d!==null&&p!==null&&Od(c,p,d,f,!0)}}a:{if(l=r?_t(r):window,u=l.nodeName&&l.nodeName.toLowerCase(),u===`select`||u===`input`&&l.type===`file`)var y=or;else if(tr(l))if(W)y=J;else{y=ur;var b=lr}else u=l.nodeName,!u||u.toLowerCase()!==`input`||l.type!==`checkbox`&&l.type!==`radio`?r&&Yt(r.elementType)&&(y=or):y=dr;if(y&&=y(e,r)){nr(c,y,n,a);break a}b&&b(e,l,r),e===`focusout`&&r&&l.type===`number`&&r.memoizedProps.value!=null&&Vt(l,`number`,l.value)}switch(b=r?_t(r):window,e){case`focusin`:(tr(b)||b.contentEditable===`true`)&&(xr=b,Sr=r,Cr=null);break;case`focusout`:Cr=Sr=xr=null;break;case`mousedown`:wr=!0;break;case`contextmenu`:case`mouseup`:case`dragend`:wr=!1,Tr(c,n,a);break;case`selectionchange`:if(br)break;case`keydown`:case`keyup`:Tr(c,n,a)}var x;if(Un)b:{switch(e){case`compositionstart`:var S=`onCompositionStart`;break b;case`compositionend`:S=`onCompositionEnd`;break b;case`compositionupdate`:S=`onCompositionUpdate`;break b}S=void 0}else Zn?Yn(e,n)&&(S=`onCompositionEnd`):e===`keydown`&&n.keyCode===229&&(S=`onCompositionStart`);S&&(Kn&&n.locale!==`ko`&&(Zn||S!==`onCompositionStart`?S===`onCompositionEnd`&&Zn&&(x=hn()):(fn=a,pn=`value`in fn?fn.value:fn.textContent,Zn=!0)),b=Ed(r,S),0<b.length&&(S=new V(S,e,null,n,a),c.push({event:S,listeners:b}),x?S.data=x:(x=Xn(n),x!==null&&(S.data=x)))),(x=Gn?Qn(e,n):$n(e,n))&&(S=Ed(r,`onBeforeInput`),0<S.length&&(b=new V(`onBeforeInput`,`beforeinput`,null,n,a),c.push({event:b,listeners:S}),b.data=x)),md(c,e,r,n,a)}yd(c,t)})}function Td(e,t,n){return{instance:e,listener:t,currentTarget:n}}function Ed(e,t){for(var n=t+`Capture`,r=[];e!==null;){var a=e,o=a.stateNode;if(a=a.tag,a!==5&&a!==26&&a!==27||o===null||(a=cn(e,n),a!=null&&r.unshift(Td(e,a,o)),a=cn(e,t),a!=null&&r.push(Td(e,a,o))),e.tag===3)return r;e=e.return}return[]}function Dd(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5&&e.tag!==27);return e||null}function Od(e,t,n,r,a){for(var o=t._reactName,s=[];n!==null&&n!==r;){var c=n,l=c.alternate,u=c.stateNode;if(c=c.tag,l!==null&&l===r)break;c!==5&&c!==26&&c!==27||u===null||(l=u,a?(u=cn(n,o),u!=null&&s.unshift(Td(n,u,l))):a||(u=cn(n,o),u!=null&&s.push(Td(n,u,l)))),n=n.return}s.length!==0&&e.push({event:t,listeners:s})}var kd=/\r\n?/g,Ad=/\u0000|\uFFFD/g;function jd(e){return(typeof e==`string`?e:``+e).replace(kd,`
|
|
9
|
+
`).replace(Ad,``)}function Md(e,t){return t=jd(t),jd(e)===t}function Nd(e,t,n,r,o,s){switch(n){case`children`:typeof r==`string`?t===`body`||t===`textarea`&&r===``||Gt(e,r):(typeof r==`number`||typeof r==`bigint`)&&t!==`body`&&Gt(e,``+r);break;case`className`:kt(e,`class`,r);break;case`tabIndex`:kt(e,`tabindex`,r);break;case`dir`:case`role`:case`viewBox`:case`width`:case`height`:kt(e,n,r);break;case`style`:Jt(e,r,s);break;case`data`:if(t!==`object`){kt(e,`data`,r);break}case`src`:case`href`:if(r===``&&(t!==`a`||n!==`href`)){e.removeAttribute(n);break}if(r==null||typeof r==`function`||typeof r==`symbol`||typeof r==`boolean`){e.removeAttribute(n);break}r=Qt(``+r),e.setAttribute(n,r);break;case`action`:case`formAction`:if(typeof r==`function`){e.setAttribute(n,`javascript:throw new Error('A React form was unexpectedly submitted. If you called form.submit() manually, consider using form.requestSubmit() instead. If you\\'re trying to use event.stopPropagation() in a submit event handler, consider also calling event.preventDefault().')`);break}else typeof s==`function`&&(n===`formAction`?(t!==`input`&&Nd(e,t,`name`,o.name,o,null),Nd(e,t,`formEncType`,o.formEncType,o,null),Nd(e,t,`formMethod`,o.formMethod,o,null),Nd(e,t,`formTarget`,o.formTarget,o,null)):(Nd(e,t,`encType`,o.encType,o,null),Nd(e,t,`method`,o.method,o,null),Nd(e,t,`target`,o.target,o,null)));if(r==null||typeof r==`symbol`||typeof r==`boolean`){e.removeAttribute(n);break}r=Qt(``+r),e.setAttribute(n,r);break;case`onClick`:r!=null&&(e.onclick=$t);break;case`onScroll`:r!=null&&$(`scroll`,e);break;case`onScrollEnd`:r!=null&&$(`scrollend`,e);break;case`dangerouslySetInnerHTML`:if(r!=null){if(typeof r!=`object`||!(`__html`in r))throw Error(a(61));if(n=r.__html,n!=null){if(o.children!=null)throw Error(a(60));e.innerHTML=n}}break;case`multiple`:e.multiple=r&&typeof r!=`function`&&typeof r!=`symbol`;break;case`muted`:e.muted=r&&typeof r!=`function`&&typeof r!=`symbol`;break;case`suppressContentEditableWarning`:case`suppressHydrationWarning`:case`defaultValue`:case`defaultChecked`:case`innerHTML`:case`ref`:break;case`autoFocus`:break;case`xlinkHref`:if(r==null||typeof r==`function`||typeof r==`boolean`||typeof r==`symbol`){e.removeAttribute(`xlink:href`);break}n=Qt(``+r),e.setAttributeNS(`http://www.w3.org/1999/xlink`,`xlink:href`,n);break;case`contentEditable`:case`spellCheck`:case`draggable`:case`value`:case`autoReverse`:case`externalResourcesRequired`:case`focusable`:case`preserveAlpha`:r!=null&&typeof r!=`function`&&typeof r!=`symbol`?e.setAttribute(n,``+r):e.removeAttribute(n);break;case`inert`:case`allowFullScreen`:case`async`:case`autoPlay`:case`controls`:case`default`:case`defer`:case`disabled`:case`disablePictureInPicture`:case`disableRemotePlayback`:case`formNoValidate`:case`hidden`:case`loop`:case`noModule`:case`noValidate`:case`open`:case`playsInline`:case`readOnly`:case`required`:case`reversed`:case`scoped`:case`seamless`:case`itemScope`:r&&typeof r!=`function`&&typeof r!=`symbol`?e.setAttribute(n,``):e.removeAttribute(n);break;case`capture`:case`download`:!0===r?e.setAttribute(n,``):!1!==r&&r!=null&&typeof r!=`function`&&typeof r!=`symbol`?e.setAttribute(n,r):e.removeAttribute(n);break;case`cols`:case`rows`:case`size`:case`span`:r!=null&&typeof r!=`function`&&typeof r!=`symbol`&&!isNaN(r)&&1<=r?e.setAttribute(n,r):e.removeAttribute(n);break;case`rowSpan`:case`start`:r==null||typeof r==`function`||typeof r==`symbol`||isNaN(r)?e.removeAttribute(n):e.setAttribute(n,r);break;case`popover`:$(`beforetoggle`,e),$(`toggle`,e),Ot(e,`popover`,r);break;case`xlinkActuate`:At(e,`http://www.w3.org/1999/xlink`,`xlink:actuate`,r);break;case`xlinkArcrole`:At(e,`http://www.w3.org/1999/xlink`,`xlink:arcrole`,r);break;case`xlinkRole`:At(e,`http://www.w3.org/1999/xlink`,`xlink:role`,r);break;case`xlinkShow`:At(e,`http://www.w3.org/1999/xlink`,`xlink:show`,r);break;case`xlinkTitle`:At(e,`http://www.w3.org/1999/xlink`,`xlink:title`,r);break;case`xlinkType`:At(e,`http://www.w3.org/1999/xlink`,`xlink:type`,r);break;case`xmlBase`:At(e,`http://www.w3.org/XML/1998/namespace`,`xml:base`,r);break;case`xmlLang`:At(e,`http://www.w3.org/XML/1998/namespace`,`xml:lang`,r);break;case`xmlSpace`:At(e,`http://www.w3.org/XML/1998/namespace`,`xml:space`,r);break;case`is`:Ot(e,`is`,r);break;case`innerText`:case`textContent`:break;default:(!(2<n.length)||n[0]!==`o`&&n[0]!==`O`||n[1]!==`n`&&n[1]!==`N`)&&(n=Xt.get(n)||n,Ot(e,n,r))}}function Pd(e,t,n,r,o,s){switch(n){case`style`:Jt(e,r,s);break;case`dangerouslySetInnerHTML`:if(r!=null){if(typeof r!=`object`||!(`__html`in r))throw Error(a(61));if(n=r.__html,n!=null){if(o.children!=null)throw Error(a(60));e.innerHTML=n}}break;case`children`:typeof r==`string`?Gt(e,r):(typeof r==`number`||typeof r==`bigint`)&&Gt(e,``+r);break;case`onScroll`:r!=null&&$(`scroll`,e);break;case`onScrollEnd`:r!=null&&$(`scrollend`,e);break;case`onClick`:r!=null&&(e.onclick=$t);break;case`suppressContentEditableWarning`:case`suppressHydrationWarning`:case`innerHTML`:case`ref`:break;case`innerText`:case`textContent`:break;default:if(!xt.hasOwnProperty(n))a:{if(n[0]===`o`&&n[1]===`n`&&(o=n.endsWith(`Capture`),t=n.slice(2,o?n.length-7:void 0),s=e[st]||null,s=s==null?null:s[n],typeof s==`function`&&e.removeEventListener(t,s,o),typeof r==`function`)){typeof s!=`function`&&s!==null&&(n in e?e[n]=null:e.hasAttribute(n)&&e.removeAttribute(n)),e.addEventListener(t,r,o);break a}n in e?e[n]=r:!0===r?e.setAttribute(n,``):Ot(e,n,r)}}}function Fd(e,t,n){switch(t){case`div`:case`span`:case`svg`:case`path`:case`a`:case`g`:case`p`:case`li`:break;case`img`:$(`error`,e),$(`load`,e);var r=!1,o=!1,s;for(s in n)if(n.hasOwnProperty(s)){var c=n[s];if(c!=null)switch(s){case`src`:r=!0;break;case`srcSet`:o=!0;break;case`children`:case`dangerouslySetInnerHTML`:throw Error(a(137,t));default:Nd(e,t,s,c,n,null)}}o&&Nd(e,t,`srcSet`,n.srcSet,n,null),r&&Nd(e,t,`src`,n.src,n,null);return;case`input`:$(`invalid`,e);var l=s=c=o=null,u=null,d=null;for(r in n)if(n.hasOwnProperty(r)){var f=n[r];if(f!=null)switch(r){case`name`:o=f;break;case`type`:c=f;break;case`checked`:u=f;break;case`defaultChecked`:d=f;break;case`value`:s=f;break;case`defaultValue`:l=f;break;case`children`:case`dangerouslySetInnerHTML`:if(f!=null)throw Error(a(137,t));break;default:Nd(e,t,r,f,n,null)}}Bt(e,s,l,u,d,c,o,!1);return;case`select`:for(o in $(`invalid`,e),r=c=s=null,n)if(n.hasOwnProperty(o)&&(l=n[o],l!=null))switch(o){case`value`:s=l;break;case`defaultValue`:c=l;break;case`multiple`:r=l;default:Nd(e,t,o,l,n,null)}t=s,n=c,e.multiple=!!r,t==null?n!=null&&Ht(e,!!r,n,!0):Ht(e,!!r,t,!1);return;case`textarea`:for(c in $(`invalid`,e),s=o=r=null,n)if(n.hasOwnProperty(c)&&(l=n[c],l!=null))switch(c){case`value`:r=l;break;case`defaultValue`:o=l;break;case`children`:s=l;break;case`dangerouslySetInnerHTML`:if(l!=null)throw Error(a(91));break;default:Nd(e,t,c,l,n,null)}Wt(e,r,o,s);return;case`option`:for(u in n)if(n.hasOwnProperty(u)&&(r=n[u],r!=null))switch(u){case`selected`:e.selected=r&&typeof r!=`function`&&typeof r!=`symbol`;break;default:Nd(e,t,u,r,n,null)}return;case`dialog`:$(`beforetoggle`,e),$(`toggle`,e),$(`cancel`,e),$(`close`,e);break;case`iframe`:case`object`:$(`load`,e);break;case`video`:case`audio`:for(r=0;r<_d.length;r++)$(_d[r],e);break;case`image`:$(`error`,e),$(`load`,e);break;case`details`:$(`toggle`,e);break;case`embed`:case`source`:case`link`:$(`error`,e),$(`load`,e);case`area`:case`base`:case`br`:case`col`:case`hr`:case`keygen`:case`meta`:case`param`:case`track`:case`wbr`:case`menuitem`:for(d in n)if(n.hasOwnProperty(d)&&(r=n[d],r!=null))switch(d){case`children`:case`dangerouslySetInnerHTML`:throw Error(a(137,t));default:Nd(e,t,d,r,n,null)}return;default:if(Yt(t)){for(f in n)n.hasOwnProperty(f)&&(r=n[f],r!==void 0&&Pd(e,t,f,r,n,void 0));return}}for(l in n)n.hasOwnProperty(l)&&(r=n[l],r!=null&&Nd(e,t,l,r,n,null))}function Id(e,t,n,r){switch(t){case`div`:case`span`:case`svg`:case`path`:case`a`:case`g`:case`p`:case`li`:break;case`input`:var o=null,s=null,c=null,l=null,u=null,d=null,f=null;for(h in n){var p=n[h];if(n.hasOwnProperty(h)&&p!=null)switch(h){case`checked`:break;case`value`:break;case`defaultValue`:u=p;default:r.hasOwnProperty(h)||Nd(e,t,h,null,r,p)}}for(var m in r){var h=r[m];if(p=n[m],r.hasOwnProperty(m)&&(h!=null||p!=null))switch(m){case`type`:s=h;break;case`name`:o=h;break;case`checked`:d=h;break;case`defaultChecked`:f=h;break;case`value`:c=h;break;case`defaultValue`:l=h;break;case`children`:case`dangerouslySetInnerHTML`:if(h!=null)throw Error(a(137,t));break;default:h!==p&&Nd(e,t,m,h,r,p)}}zt(e,c,l,u,d,f,s,o);return;case`select`:for(s in h=c=l=m=null,n)if(u=n[s],n.hasOwnProperty(s)&&u!=null)switch(s){case`value`:break;case`multiple`:h=u;default:r.hasOwnProperty(s)||Nd(e,t,s,null,r,u)}for(o in r)if(s=r[o],u=n[o],r.hasOwnProperty(o)&&(s!=null||u!=null))switch(o){case`value`:m=s;break;case`defaultValue`:l=s;break;case`multiple`:c=s;default:s!==u&&Nd(e,t,o,s,r,u)}t=l,n=c,r=h,m==null?!!r!=!!n&&(t==null?Ht(e,!!n,n?[]:``,!1):Ht(e,!!n,t,!0)):Ht(e,!!n,m,!1);return;case`textarea`:for(l in h=m=null,n)if(o=n[l],n.hasOwnProperty(l)&&o!=null&&!r.hasOwnProperty(l))switch(l){case`value`:break;case`children`:break;default:Nd(e,t,l,null,r,o)}for(c in r)if(o=r[c],s=n[c],r.hasOwnProperty(c)&&(o!=null||s!=null))switch(c){case`value`:m=o;break;case`defaultValue`:h=o;break;case`children`:break;case`dangerouslySetInnerHTML`:if(o!=null)throw Error(a(91));break;default:o!==s&&Nd(e,t,c,o,r,s)}Ut(e,m,h);return;case`option`:for(var g in n)if(m=n[g],n.hasOwnProperty(g)&&m!=null&&!r.hasOwnProperty(g))switch(g){case`selected`:e.selected=!1;break;default:Nd(e,t,g,null,r,m)}for(u in r)if(m=r[u],h=n[u],r.hasOwnProperty(u)&&m!==h&&(m!=null||h!=null))switch(u){case`selected`:e.selected=m&&typeof m!=`function`&&typeof m!=`symbol`;break;default:Nd(e,t,u,m,r,h)}return;case`img`:case`link`:case`area`:case`base`:case`br`:case`col`:case`embed`:case`hr`:case`keygen`:case`meta`:case`param`:case`source`:case`track`:case`wbr`:case`menuitem`:for(var _ in n)m=n[_],n.hasOwnProperty(_)&&m!=null&&!r.hasOwnProperty(_)&&Nd(e,t,_,null,r,m);for(d in r)if(m=r[d],h=n[d],r.hasOwnProperty(d)&&m!==h&&(m!=null||h!=null))switch(d){case`children`:case`dangerouslySetInnerHTML`:if(m!=null)throw Error(a(137,t));break;default:Nd(e,t,d,m,r,h)}return;default:if(Yt(t)){for(var v in n)m=n[v],n.hasOwnProperty(v)&&m!==void 0&&!r.hasOwnProperty(v)&&Pd(e,t,v,void 0,r,m);for(f in r)m=r[f],h=n[f],!r.hasOwnProperty(f)||m===h||m===void 0&&h===void 0||Pd(e,t,f,m,r,h);return}}for(var y in n)m=n[y],n.hasOwnProperty(y)&&m!=null&&!r.hasOwnProperty(y)&&Nd(e,t,y,null,r,m);for(p in r)m=r[p],h=n[p],!r.hasOwnProperty(p)||m===h||m==null&&h==null||Nd(e,t,p,m,r,h)}function Ld(e){switch(e){case`css`:case`script`:case`font`:case`img`:case`image`:case`input`:case`link`:return!0;default:return!1}}function Rd(){if(typeof performance.getEntriesByType==`function`){for(var e=0,t=0,n=performance.getEntriesByType(`resource`),r=0;r<n.length;r++){var a=n[r],o=a.transferSize,s=a.initiatorType,c=a.duration;if(o&&c&&Ld(s)){for(s=0,c=a.responseEnd,r+=1;r<n.length;r++){var l=n[r],u=l.startTime;if(u>c)break;var d=l.transferSize,f=l.initiatorType;d&&Ld(f)&&(l=l.responseEnd,s+=d*(l<c?1:(c-u)/(l-u)))}if(--r,t+=8*(o+s)/(a.duration/1e3),e++,10<e)break}}if(0<e)return t/e/1e6}return navigator.connection&&(e=navigator.connection.downlink,typeof e==`number`)?e:5}var zd=null,Bd=null;function Vd(e){return e.nodeType===9?e:e.ownerDocument}function Hd(e){switch(e){case`http://www.w3.org/2000/svg`:return 1;case`http://www.w3.org/1998/Math/MathML`:return 2;default:return 0}}function Ud(e,t){if(e===0)switch(t){case`svg`:return 1;case`math`:return 2;default:return 0}return e===1&&t===`foreignObject`?0:e}function Wd(e,t){return e===`textarea`||e===`noscript`||typeof t.children==`string`||typeof t.children==`number`||typeof t.children==`bigint`||typeof t.dangerouslySetInnerHTML==`object`&&t.dangerouslySetInnerHTML!==null&&t.dangerouslySetInnerHTML.__html!=null}var Gd=null;function Kd(){var e=window.event;return e&&e.type===`popstate`?e===Gd?!1:(Gd=e,!0):(Gd=null,!1)}var qd=typeof setTimeout==`function`?setTimeout:void 0,Jd=typeof clearTimeout==`function`?clearTimeout:void 0,Yd=typeof Promise==`function`?Promise:void 0,Xd=typeof queueMicrotask==`function`?queueMicrotask:Yd===void 0?qd:function(e){return Yd.resolve(null).then(e).catch(Zd)};function Zd(e){setTimeout(function(){throw e})}function Qd(e){return e===`head`}function $d(e,t){var n=t,r=0;do{var a=n.nextSibling;if(e.removeChild(n),a&&a.nodeType===8)if(n=a.data,n===`/$`||n===`/&`){if(r===0){e.removeChild(a),Pp(t);return}r--}else if(n===`$`||n===`$?`||n===`$~`||n===`$!`||n===`&`)r++;else if(n===`html`)mf(e.ownerDocument.documentElement);else if(n===`head`){n=e.ownerDocument.head,mf(n);for(var o=n.firstChild;o;){var s=o.nextSibling,c=o.nodeName;o[pt]||c===`SCRIPT`||c===`STYLE`||c===`LINK`&&o.rel.toLowerCase()===`stylesheet`||n.removeChild(o),o=s}}else n===`body`&&mf(e.ownerDocument.body);n=a}while(n);Pp(t)}function ef(e,t){var n=e;e=0;do{var r=n.nextSibling;if(n.nodeType===1?t?(n._stashedDisplay=n.style.display,n.style.display=`none`):(n.style.display=n._stashedDisplay||``,n.getAttribute(`style`)===``&&n.removeAttribute(`style`)):n.nodeType===3&&(t?(n._stashedText=n.nodeValue,n.nodeValue=``):n.nodeValue=n._stashedText||``),r&&r.nodeType===8)if(n=r.data,n===`/$`){if(e===0)break;e--}else n!==`$`&&n!==`$?`&&n!==`$~`&&n!==`$!`||e++;n=r}while(n)}function tf(e){var t=e.firstChild;for(t&&t.nodeType===10&&(t=t.nextSibling);t;){var n=t;switch(t=t.nextSibling,n.nodeName){case`HTML`:case`HEAD`:case`BODY`:tf(n),mt(n);continue;case`SCRIPT`:case`STYLE`:continue;case`LINK`:if(n.rel.toLowerCase()===`stylesheet`)continue}e.removeChild(n)}}function nf(e,t,n,r){for(;e.nodeType===1;){var a=n;if(e.nodeName.toLowerCase()!==t.toLowerCase()){if(!r&&(e.nodeName!==`INPUT`||e.type!==`hidden`))break}else if(!r)if(t===`input`&&e.type===`hidden`){var o=a.name==null?null:``+a.name;if(a.type===`hidden`&&e.getAttribute(`name`)===o)return e}else return e;else if(!e[pt])switch(t){case`meta`:if(!e.hasAttribute(`itemprop`))break;return e;case`link`:if(o=e.getAttribute(`rel`),o===`stylesheet`&&e.hasAttribute(`data-precedence`)||o!==a.rel||e.getAttribute(`href`)!==(a.href==null||a.href===``?null:a.href)||e.getAttribute(`crossorigin`)!==(a.crossOrigin==null?null:a.crossOrigin)||e.getAttribute(`title`)!==(a.title==null?null:a.title))break;return e;case`style`:if(e.hasAttribute(`data-precedence`))break;return e;case`script`:if(o=e.getAttribute(`src`),(o!==(a.src==null?null:a.src)||e.getAttribute(`type`)!==(a.type==null?null:a.type)||e.getAttribute(`crossorigin`)!==(a.crossOrigin==null?null:a.crossOrigin))&&o&&e.hasAttribute(`async`)&&!e.hasAttribute(`itemprop`))break;return e;default:return e}if(e=lf(e.nextSibling),e===null)break}return null}function rf(e,t,n){if(t===``)return null;for(;e.nodeType!==3;)if((e.nodeType!==1||e.nodeName!==`INPUT`||e.type!==`hidden`)&&!n||(e=lf(e.nextSibling),e===null))return null;return e}function af(e,t){for(;e.nodeType!==8;)if((e.nodeType!==1||e.nodeName!==`INPUT`||e.type!==`hidden`)&&!t||(e=lf(e.nextSibling),e===null))return null;return e}function of(e){return e.data===`$?`||e.data===`$~`}function sf(e){return e.data===`$!`||e.data===`$?`&&e.ownerDocument.readyState!==`loading`}function cf(e,t){var n=e.ownerDocument;if(e.data===`$~`)e._reactRetry=t;else if(e.data!==`$?`||n.readyState!==`loading`)t();else{var r=function(){t(),n.removeEventListener(`DOMContentLoaded`,r)};n.addEventListener(`DOMContentLoaded`,r),e._reactRetry=r}}function lf(e){for(;e!=null;e=e.nextSibling){var t=e.nodeType;if(t===1||t===3)break;if(t===8){if(t=e.data,t===`$`||t===`$!`||t===`$?`||t===`$~`||t===`&`||t===`F!`||t===`F`)break;if(t===`/$`||t===`/&`)return null}}return e}var uf=null;function df(e){e=e.nextSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n===`/$`||n===`/&`){if(t===0)return lf(e.nextSibling);t--}else n!==`$`&&n!==`$!`&&n!==`$?`&&n!==`$~`&&n!==`&`||t++}e=e.nextSibling}return null}function ff(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n===`$`||n===`$!`||n===`$?`||n===`$~`||n===`&`){if(t===0)return e;t--}else n!==`/$`&&n!==`/&`||t++}e=e.previousSibling}return null}function pf(e,t,n){switch(t=Vd(n),e){case`html`:if(e=t.documentElement,!e)throw Error(a(452));return e;case`head`:if(e=t.head,!e)throw Error(a(453));return e;case`body`:if(e=t.body,!e)throw Error(a(454));return e;default:throw Error(a(451))}}function mf(e){for(var t=e.attributes;t.length;)e.removeAttributeNode(t[0]);mt(e)}var hf=new Map,gf=new Set;function _f(e){return typeof e.getRootNode==`function`?e.getRootNode():e.nodeType===9?e:e.ownerDocument}var vf=P.d;P.d={f:yf,r:bf,D:Cf,C:wf,L:Tf,m:Ef,X:Of,S:Df,M:kf};function yf(){var e=vf.f(),t=yu();return e||t}function bf(e){var t=gt(e);t!==null&&t.tag===5&&t.type===`form`?bs(t):vf.r(e)}var xf=typeof document>`u`?null:document;function Sf(e,t,n){var r=xf;if(r&&typeof t==`string`&&t){var a=Rt(t);a=`link[rel="`+e+`"][href="`+a+`"]`,typeof n==`string`&&(a+=`[crossorigin="`+n+`"]`),gf.has(a)||(gf.add(a),e={rel:e,crossOrigin:n,href:t},r.querySelector(a)===null&&(t=r.createElement(`link`),Fd(t,`link`,e),yt(t),r.head.appendChild(t)))}}function Cf(e){vf.D(e),Sf(`dns-prefetch`,e,null)}function wf(e,t){vf.C(e,t),Sf(`preconnect`,e,t)}function Tf(e,t,n){vf.L(e,t,n);var r=xf;if(r&&e&&t){var a=`link[rel="preload"][as="`+Rt(t)+`"]`;t===`image`&&n&&n.imageSrcSet?(a+=`[imagesrcset="`+Rt(n.imageSrcSet)+`"]`,typeof n.imageSizes==`string`&&(a+=`[imagesizes="`+Rt(n.imageSizes)+`"]`)):a+=`[href="`+Rt(e)+`"]`;var o=a;switch(t){case`style`:o=jf(e);break;case`script`:o=Ff(e)}hf.has(o)||(e=g({rel:`preload`,href:t===`image`&&n&&n.imageSrcSet?void 0:e,as:t},n),hf.set(o,e),r.querySelector(a)!==null||t===`style`&&r.querySelector(Mf(o))||t===`script`&&r.querySelector(If(o))||(t=r.createElement(`link`),Fd(t,`link`,e),yt(t),r.head.appendChild(t)))}}function Ef(e,t){vf.m(e,t);var n=xf;if(n&&e){var r=t&&typeof t.as==`string`?t.as:`script`,a=`link[rel="modulepreload"][as="`+Rt(r)+`"][href="`+Rt(e)+`"]`,o=a;switch(r){case`audioworklet`:case`paintworklet`:case`serviceworker`:case`sharedworker`:case`worker`:case`script`:o=Ff(e)}if(!hf.has(o)&&(e=g({rel:`modulepreload`,href:e},t),hf.set(o,e),n.querySelector(a)===null)){switch(r){case`audioworklet`:case`paintworklet`:case`serviceworker`:case`sharedworker`:case`worker`:case`script`:if(n.querySelector(If(o)))return}r=n.createElement(`link`),Fd(r,`link`,e),yt(r),n.head.appendChild(r)}}}function Df(e,t,n){vf.S(e,t,n);var r=xf;if(r&&e){var a=vt(r).hoistableStyles,o=jf(e);t||=`default`;var s=a.get(o);if(!s){var c={loading:0,preload:null};if(s=r.querySelector(Mf(o)))c.loading=5;else{e=g({rel:`stylesheet`,href:e,"data-precedence":t},n),(n=hf.get(o))&&zf(e,n);var l=s=r.createElement(`link`);yt(l),Fd(l,`link`,e),l._p=new Promise(function(e,t){l.onload=e,l.onerror=t}),l.addEventListener(`load`,function(){c.loading|=1}),l.addEventListener(`error`,function(){c.loading|=2}),c.loading|=4,Rf(s,t,r)}s={type:`stylesheet`,instance:s,count:1,state:c},a.set(o,s)}}}function Of(e,t){vf.X(e,t);var n=xf;if(n&&e){var r=vt(n).hoistableScripts,a=Ff(e),o=r.get(a);o||(o=n.querySelector(If(a)),o||(e=g({src:e,async:!0},t),(t=hf.get(a))&&Bf(e,t),o=n.createElement(`script`),yt(o),Fd(o,`link`,e),n.head.appendChild(o)),o={type:`script`,instance:o,count:1,state:null},r.set(a,o))}}function kf(e,t){vf.M(e,t);var n=xf;if(n&&e){var r=vt(n).hoistableScripts,a=Ff(e),o=r.get(a);o||(o=n.querySelector(If(a)),o||(e=g({src:e,async:!0,type:`module`},t),(t=hf.get(a))&&Bf(e,t),o=n.createElement(`script`),yt(o),Fd(o,`link`,e),n.head.appendChild(o)),o={type:`script`,instance:o,count:1,state:null},r.set(a,o))}}function Af(e,t,n,r){var o=(o=ce.current)?_f(o):null;if(!o)throw Error(a(446));switch(e){case`meta`:case`title`:return null;case`style`:return typeof n.precedence==`string`&&typeof n.href==`string`?(t=jf(n.href),n=vt(o).hoistableStyles,r=n.get(t),r||(r={type:`style`,instance:null,count:0,state:null},n.set(t,r)),r):{type:`void`,instance:null,count:0,state:null};case`link`:if(n.rel===`stylesheet`&&typeof n.href==`string`&&typeof n.precedence==`string`){e=jf(n.href);var s=vt(o).hoistableStyles,c=s.get(e);if(c||(o=o.ownerDocument||o,c={type:`stylesheet`,instance:null,count:0,state:{loading:0,preload:null}},s.set(e,c),(s=o.querySelector(Mf(e)))&&!s._p&&(c.instance=s,c.state.loading=5),hf.has(e)||(n={rel:`preload`,as:`style`,href:n.href,crossOrigin:n.crossOrigin,integrity:n.integrity,media:n.media,hrefLang:n.hrefLang,referrerPolicy:n.referrerPolicy},hf.set(e,n),s||Pf(o,e,n,c.state))),t&&r===null)throw Error(a(528,``));return c}if(t&&r!==null)throw Error(a(529,``));return null;case`script`:return t=n.async,n=n.src,typeof n==`string`&&t&&typeof t!=`function`&&typeof t!=`symbol`?(t=Ff(n),n=vt(o).hoistableScripts,r=n.get(t),r||(r={type:`script`,instance:null,count:0,state:null},n.set(t,r)),r):{type:`void`,instance:null,count:0,state:null};default:throw Error(a(444,e))}}function jf(e){return`href="`+Rt(e)+`"`}function Mf(e){return`link[rel="stylesheet"][`+e+`]`}function Nf(e){return g({},e,{"data-precedence":e.precedence,precedence:null})}function Pf(e,t,n,r){e.querySelector(`link[rel="preload"][as="style"][`+t+`]`)?r.loading=1:(t=e.createElement(`link`),r.preload=t,t.addEventListener(`load`,function(){return r.loading|=1}),t.addEventListener(`error`,function(){return r.loading|=2}),Fd(t,`link`,n),yt(t),e.head.appendChild(t))}function Ff(e){return`[src="`+Rt(e)+`"]`}function If(e){return`script[async]`+e}function Lf(e,t,n){if(t.count++,t.instance===null)switch(t.type){case`style`:var r=e.querySelector(`style[data-href~="`+Rt(n.href)+`"]`);if(r)return t.instance=r,yt(r),r;var o=g({},n,{"data-href":n.href,"data-precedence":n.precedence,href:null,precedence:null});return r=(e.ownerDocument||e).createElement(`style`),yt(r),Fd(r,`style`,o),Rf(r,n.precedence,e),t.instance=r;case`stylesheet`:o=jf(n.href);var s=e.querySelector(Mf(o));if(s)return t.state.loading|=4,t.instance=s,yt(s),s;r=Nf(n),(o=hf.get(o))&&zf(r,o),s=(e.ownerDocument||e).createElement(`link`),yt(s);var c=s;return c._p=new Promise(function(e,t){c.onload=e,c.onerror=t}),Fd(s,`link`,r),t.state.loading|=4,Rf(s,n.precedence,e),t.instance=s;case`script`:return s=Ff(n.src),(o=e.querySelector(If(s)))?(t.instance=o,yt(o),o):(r=n,(o=hf.get(s))&&(r=g({},n),Bf(r,o)),e=e.ownerDocument||e,o=e.createElement(`script`),yt(o),Fd(o,`link`,r),e.head.appendChild(o),t.instance=o);case`void`:return null;default:throw Error(a(443,t.type))}else t.type===`stylesheet`&&!(t.state.loading&4)&&(r=t.instance,t.state.loading|=4,Rf(r,n.precedence,e));return t.instance}function Rf(e,t,n){for(var r=n.querySelectorAll(`link[rel="stylesheet"][data-precedence],style[data-precedence]`),a=r.length?r[r.length-1]:null,o=a,s=0;s<r.length;s++){var c=r[s];if(c.dataset.precedence===t)o=c;else if(o!==a)break}o?o.parentNode.insertBefore(e,o.nextSibling):(t=n.nodeType===9?n.head:n,t.insertBefore(e,t.firstChild))}function zf(e,t){e.crossOrigin??=t.crossOrigin,e.referrerPolicy??=t.referrerPolicy,e.title??=t.title}function Bf(e,t){e.crossOrigin??=t.crossOrigin,e.referrerPolicy??=t.referrerPolicy,e.integrity??=t.integrity}var Vf=null;function Hf(e,t,n){if(Vf===null){var r=new Map,a=Vf=new Map;a.set(n,r)}else a=Vf,r=a.get(n),r||(r=new Map,a.set(n,r));if(r.has(e))return r;for(r.set(e,null),n=n.getElementsByTagName(e),a=0;a<n.length;a++){var o=n[a];if(!(o[pt]||o[ot]||e===`link`&&o.getAttribute(`rel`)===`stylesheet`)&&o.namespaceURI!==`http://www.w3.org/2000/svg`){var s=o.getAttribute(t)||``;s=e+s;var c=r.get(s);c?c.push(o):r.set(s,[o])}}return r}function Uf(e,t,n){e=e.ownerDocument||e,e.head.insertBefore(n,t===`title`?e.querySelector(`head > title`):null)}function Wf(e,t,n){if(n===1||t.itemProp!=null)return!1;switch(e){case`meta`:case`title`:return!0;case`style`:if(typeof t.precedence!=`string`||typeof t.href!=`string`||t.href===``)break;return!0;case`link`:if(typeof t.rel!=`string`||typeof t.href!=`string`||t.href===``||t.onLoad||t.onError)break;switch(t.rel){case`stylesheet`:return e=t.disabled,typeof t.precedence==`string`&&e==null;default:return!0}case`script`:if(t.async&&typeof t.async!=`function`&&typeof t.async!=`symbol`&&!t.onLoad&&!t.onError&&t.src&&typeof t.src==`string`)return!0}return!1}function Gf(e){return!(e.type===`stylesheet`&&!(e.state.loading&3))}function Kf(e,t,n,r){if(n.type===`stylesheet`&&(typeof r.media!=`string`||!1!==matchMedia(r.media).matches)&&!(n.state.loading&4)){if(n.instance===null){var a=jf(r.href),o=t.querySelector(Mf(a));if(o){t=o._p,typeof t==`object`&&t&&typeof t.then==`function`&&(e.count++,e=Yf.bind(e),t.then(e,e)),n.state.loading|=4,n.instance=o,yt(o);return}o=t.ownerDocument||t,r=Nf(r),(a=hf.get(a))&&zf(r,a),o=o.createElement(`link`),yt(o);var s=o;s._p=new Promise(function(e,t){s.onload=e,s.onerror=t}),Fd(o,`link`,r),n.instance=o}e.stylesheets===null&&(e.stylesheets=new Map),e.stylesheets.set(n,t),(t=n.state.preload)&&!(n.state.loading&3)&&(e.count++,n=Yf.bind(e),t.addEventListener(`load`,n),t.addEventListener(`error`,n))}}var qf=0;function Jf(e,t){return e.stylesheets&&e.count===0&&Zf(e,e.stylesheets),0<e.count||0<e.imgCount?function(n){var r=setTimeout(function(){if(e.stylesheets&&Zf(e,e.stylesheets),e.unsuspend){var t=e.unsuspend;e.unsuspend=null,t()}},6e4+t);0<e.imgBytes&&qf===0&&(qf=62500*Rd());var a=setTimeout(function(){if(e.waitingForImages=!1,e.count===0&&(e.stylesheets&&Zf(e,e.stylesheets),e.unsuspend)){var t=e.unsuspend;e.unsuspend=null,t()}},(e.imgBytes>qf?50:800)+t);return e.unsuspend=n,function(){e.unsuspend=null,clearTimeout(r),clearTimeout(a)}}:null}function Yf(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)Zf(this,this.stylesheets);else if(this.unsuspend){var e=this.unsuspend;this.unsuspend=null,e()}}}var Xf=null;function Zf(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,Xf=new Map,t.forEach(Qf,e),Xf=null,Yf.call(e))}function Qf(e,t){if(!(t.state.loading&4)){var n=Xf.get(e);if(n)var r=n.get(null);else{n=new Map,Xf.set(e,n);for(var a=e.querySelectorAll(`link[data-precedence],style[data-precedence]`),o=0;o<a.length;o++){var s=a[o];(s.nodeName===`LINK`||s.getAttribute(`media`)!==`not all`)&&(n.set(s.dataset.precedence,s),r=s)}r&&n.set(null,r)}a=t.instance,s=a.getAttribute(`data-precedence`),o=n.get(s)||r,o===r&&n.set(null,a),n.set(s,a),this.count++,r=Yf.bind(this),a.addEventListener(`load`,r),a.addEventListener(`error`,r),o?o.parentNode.insertBefore(a,o.nextSibling):(e=e.nodeType===9?e.head:e,e.insertBefore(a,e.firstChild)),t.state.loading|=4}}var $f={$$typeof:w,Provider:null,Consumer:null,_currentValue:ie,_currentValue2:ie,_threadCount:0};function ep(e,t,n,r,a,o,s,c,l){this.tag=1,this.containerInfo=e,this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.next=this.pendingContext=this.context=this.cancelPendingCommit=null,this.callbackPriority=0,this.expirationTimes=Ye(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Ye(0),this.hiddenUpdates=Ye(null),this.identifierPrefix=r,this.onUncaughtError=a,this.onCaughtError=o,this.onRecoverableError=s,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=l,this.incompleteTransitions=new Map}function tp(e,t,n,r,a,o,s,c,l,u,d,f){return e=new ep(e,t,n,s,l,u,d,f,c),t=1,!0===o&&(t|=24),o=$r(3,null,null,t),e.current=o,o.stateNode=e,t=$i(),t.refCount++,e.pooledCache=t,t.refCount++,o.memoizedState={element:r,isDehydrated:n,cache:t},Ma(o),e}function np(e){return e?(e=Zr,e):Zr}function rp(e,t,n,r,a,o){a=np(a),r.context===null?r.context=a:r.pendingContext=a,r=Pa(t),r.payload={element:n},o=o===void 0?null:o,o!==null&&(r.callback=o),n=Fa(e,r,t),n!==null&&(mu(n,e,t),Ia(n,e,t))}function ip(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var n=e.retryLane;e.retryLane=n!==0&&n<t?n:t}}function ap(e,t){ip(e,t),(e=e.alternate)&&ip(e,t)}function op(e){if(e.tag===13||e.tag===31){var t=Jr(e,67108864);t!==null&&mu(t,e,67108864),ap(e,67108864)}}function sp(e){if(e.tag===13||e.tag===31){var t=fu();t=tt(t);var n=Jr(e,t);n!==null&&mu(n,e,t),ap(e,t)}}var cp=!0;function lp(e,t,n,r){var a=N.T;N.T=null;var o=P.p;try{P.p=2,dp(e,t,n,r)}finally{P.p=o,N.T=a}}function up(e,t,n,r){var a=N.T;N.T=null;var o=P.p;try{P.p=8,dp(e,t,n,r)}finally{P.p=o,N.T=a}}function dp(e,t,n,r){if(cp){var a=fp(r);if(a===null)wd(e,t,r,pp,n),wp(e,r);else if(Ep(a,e,t,n,r))r.stopPropagation();else if(wp(e,r),t&4&&-1<Cp.indexOf(e)){for(;a!==null;){var o=gt(a);if(o!==null)switch(o.tag){case 3:if(o=o.stateNode,o.current.memoizedState.isDehydrated){var s=We(o.pendingLanes);if(s!==0){var c=o;for(c.pendingLanes|=2,c.entangledLanes|=2;s;){var l=1<<31-Le(s);c.entanglements[1]|=l,s&=~l}rd(o),!(Fl&6)&&(eu=Ee()+500,id(0,!1))}}break;case 31:case 13:c=Jr(o,2),c!==null&&mu(c,o,2),yu(),ap(o,2)}if(o=fp(r),o===null&&wd(e,t,r,pp,n),o===a)break;a=o}a!==null&&r.stopPropagation()}else wd(e,t,r,null,n)}}function fp(e){return e=tn(e),mp(e)}var pp=null;function mp(e){if(pp=null,e=ht(e),e!==null){var t=s(e);if(t===null)e=null;else{var n=t.tag;if(n===13){if(e=c(t),e!==null)return e;e=null}else if(n===31){if(e=l(t),e!==null)return e;e=null}else if(n===3){if(t.stateNode.current.memoizedState.isDehydrated)return t.tag===3?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null)}}return pp=e,null}function hp(e){switch(e){case`beforetoggle`:case`cancel`:case`click`:case`close`:case`contextmenu`:case`copy`:case`cut`:case`auxclick`:case`dblclick`:case`dragend`:case`dragstart`:case`drop`:case`focusin`:case`focusout`:case`input`:case`invalid`:case`keydown`:case`keypress`:case`keyup`:case`mousedown`:case`mouseup`:case`paste`:case`pause`:case`play`:case`pointercancel`:case`pointerdown`:case`pointerup`:case`ratechange`:case`reset`:case`resize`:case`seeked`:case`submit`:case`toggle`:case`touchcancel`:case`touchend`:case`touchstart`:case`volumechange`:case`change`:case`selectionchange`:case`textInput`:case`compositionstart`:case`compositionend`:case`compositionupdate`:case`beforeblur`:case`afterblur`:case`beforeinput`:case`blur`:case`fullscreenchange`:case`focus`:case`hashchange`:case`popstate`:case`select`:case`selectstart`:return 2;case`drag`:case`dragenter`:case`dragexit`:case`dragleave`:case`dragover`:case`mousemove`:case`mouseout`:case`mouseover`:case`pointermove`:case`pointerout`:case`pointerover`:case`scroll`:case`touchmove`:case`wheel`:case`mouseenter`:case`mouseleave`:case`pointerenter`:case`pointerleave`:return 8;case`message`:switch(De()){case Oe:return 2;case ke:return 8;case Ae:case je:return 32;case z:return 268435456;default:return 32}default:return 32}}var gp=!1,_p=null,vp=null,yp=null,bp=new Map,xp=new Map,Sp=[],Cp=`mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset`.split(` `);function wp(e,t){switch(e){case`focusin`:case`focusout`:_p=null;break;case`dragenter`:case`dragleave`:vp=null;break;case`mouseover`:case`mouseout`:yp=null;break;case`pointerover`:case`pointerout`:bp.delete(t.pointerId);break;case`gotpointercapture`:case`lostpointercapture`:xp.delete(t.pointerId)}}function Tp(e,t,n,r,a,o){return e===null||e.nativeEvent!==o?(e={blockedOn:t,domEventName:n,eventSystemFlags:r,nativeEvent:o,targetContainers:[a]},t!==null&&(t=gt(t),t!==null&&op(t)),e):(e.eventSystemFlags|=r,t=e.targetContainers,a!==null&&t.indexOf(a)===-1&&t.push(a),e)}function Ep(e,t,n,r,a){switch(t){case`focusin`:return _p=Tp(_p,e,t,n,r,a),!0;case`dragenter`:return vp=Tp(vp,e,t,n,r,a),!0;case`mouseover`:return yp=Tp(yp,e,t,n,r,a),!0;case`pointerover`:var o=a.pointerId;return bp.set(o,Tp(bp.get(o)||null,e,t,n,r,a)),!0;case`gotpointercapture`:return o=a.pointerId,xp.set(o,Tp(xp.get(o)||null,e,t,n,r,a)),!0}return!1}function Dp(e){var t=ht(e.target);if(t!==null){var n=s(t);if(n!==null){if(t=n.tag,t===13){if(t=c(n),t!==null){e.blockedOn=t,it(e.priority,function(){sp(n)});return}}else if(t===31){if(t=l(n),t!==null){e.blockedOn=t,it(e.priority,function(){sp(n)});return}}else if(t===3&&n.stateNode.current.memoizedState.isDehydrated){e.blockedOn=n.tag===3?n.stateNode.containerInfo:null;return}}}e.blockedOn=null}function Op(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var n=fp(e.nativeEvent);if(n===null){n=e.nativeEvent;var r=new n.constructor(n.type,n);en=r,n.target.dispatchEvent(r),en=null}else return t=gt(n),t!==null&&op(t),e.blockedOn=n,!1;t.shift()}return!0}function kp(e,t,n){Op(e)&&n.delete(t)}function Ap(){gp=!1,_p!==null&&Op(_p)&&(_p=null),vp!==null&&Op(vp)&&(vp=null),yp!==null&&Op(yp)&&(yp=null),bp.forEach(kp),xp.forEach(kp)}function jp(e,n){e.blockedOn===n&&(e.blockedOn=null,gp||(gp=!0,t.unstable_scheduleCallback(t.unstable_NormalPriority,Ap)))}var Mp=null;function Np(e){Mp!==e&&(Mp=e,t.unstable_scheduleCallback(t.unstable_NormalPriority,function(){Mp===e&&(Mp=null);for(var t=0;t<e.length;t+=3){var n=e[t],r=e[t+1],a=e[t+2];if(typeof r!=`function`){if(mp(r||n)===null)continue;break}var o=gt(n);o!==null&&(e.splice(t,3),t-=3,vs(o,{pending:!0,data:a,method:n.method,action:r},r,a))}}))}function Pp(e){function t(t){return jp(t,e)}_p!==null&&jp(_p,e),vp!==null&&jp(vp,e),yp!==null&&jp(yp,e),bp.forEach(t),xp.forEach(t);for(var n=0;n<Sp.length;n++){var r=Sp[n];r.blockedOn===e&&(r.blockedOn=null)}for(;0<Sp.length&&(n=Sp[0],n.blockedOn===null);)Dp(n),n.blockedOn===null&&Sp.shift();if(n=(e.ownerDocument||e).$$reactFormReplay,n!=null)for(r=0;r<n.length;r+=3){var a=n[r],o=n[r+1],s=a[st]||null;if(typeof o==`function`)s||Np(n);else if(s){var c=null;if(o&&o.hasAttribute(`formAction`)){if(a=o,s=o[st]||null)c=s.formAction;else if(mp(a)!==null)continue}else c=s.action;typeof c==`function`?n[r+1]=c:(n.splice(r,3),r-=3),Np(n)}}}function Fp(){function e(e){e.canIntercept&&e.info===`react-transition`&&e.intercept({handler:function(){return new Promise(function(e){return a=e})},focusReset:`manual`,scroll:`manual`})}function t(){a!==null&&(a(),a=null),r||setTimeout(n,20)}function n(){if(!r&&!navigation.transition){var e=navigation.currentEntry;e&&e.url!=null&&navigation.navigate(e.url,{state:e.getState(),info:`react-transition`,history:`replace`})}}if(typeof navigation==`object`){var r=!1,a=null;return navigation.addEventListener(`navigate`,e),navigation.addEventListener(`navigatesuccess`,t),navigation.addEventListener(`navigateerror`,t),setTimeout(n,100),function(){r=!0,navigation.removeEventListener(`navigate`,e),navigation.removeEventListener(`navigatesuccess`,t),navigation.removeEventListener(`navigateerror`,t),a!==null&&(a(),a=null)}}}function Ip(e){this._internalRoot=e}Lp.prototype.render=Ip.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(a(409));var n=t.current;rp(n,fu(),e,t,null,null)},Lp.prototype.unmount=Ip.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;rp(e.current,2,null,e,null,null),yu(),t[ct]=null}};function Lp(e){this._internalRoot=e}Lp.prototype.unstable_scheduleHydration=function(e){if(e){var t=rt();e={blockedOn:null,target:e,priority:t};for(var n=0;n<Sp.length&&t!==0&&t<Sp[n].priority;n++);Sp.splice(n,0,e),n===0&&Dp(e)}};var Rp=n.version;if(Rp!==`19.2.4`)throw Error(a(527,Rp,`19.2.4`));P.findDOMNode=function(e){var t=e._reactInternals;if(t===void 0)throw typeof e.render==`function`?Error(a(188)):(e=Object.keys(e).join(`,`),Error(a(268,e)));return e=f(t),e=e===null?null:m(e),e=e===null?null:e.stateNode,e};var zp={bundleType:0,version:`19.2.4`,rendererPackageName:`react-dom`,currentDispatcherRef:N,reconcilerVersion:`19.2.4`};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<`u`){var Bp=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Bp.isDisabled&&Bp.supportsFiber)try{Pe=Bp.inject(zp),Fe=Bp}catch{}}e.createRoot=function(e,t){if(!o(e))throw Error(a(299));var n=!1,r=``,s=Vs,c=Hs,l=Us;return t!=null&&(!0===t.unstable_strictMode&&(n=!0),t.identifierPrefix!==void 0&&(r=t.identifierPrefix),t.onUncaughtError!==void 0&&(s=t.onUncaughtError),t.onCaughtError!==void 0&&(c=t.onCaughtError),t.onRecoverableError!==void 0&&(l=t.onRecoverableError)),t=tp(e,1,!1,null,null,n,r,null,s,c,l,Fp),e[ct]=t.current,Sd(e),new Ip(t)}})),_=l(s(((e,t)=>{function n(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>`u`||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!=`function`))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(n)}catch(e){console.error(e)}}n(),t.exports=g()}))(),1),v=l(d(),1),y=500,b=200,x=3e3,S=1e3,C=3e4,w=Object.freeze({counters:Object.freeze({}),latestBurst:null,burstRing:Object.freeze([]),burstSeq:0,lifecycleRing:Object.freeze([]),connectionSeq:0,connected:!1,reconnectAttempts:0,lastErrorAt:null,reconnectDelayMs:S}),T=new Set,E={},D=[],O=[],k=!1,A=!1,ee=null,j=null,M=null,te=!1,ne=typeof localStorage<`u`&&localStorage.getItem(`DEBUG_SSE`)===`1`;function re(e,t){ne&&(t?console.debug(`[ssg-sse] ${e}`,t):console.debug(`[ssg-sse] ${e}`))}function N(){te||(te=!0,queueMicrotask(P))}function P(){te=!1;let e=Object.keys(E),t=D,n=O,r=k,a=ee!==null||j!==null||M!==null;if(e.length===0&&t.length===0&&n.length===0&&!r&&!a)return;let o=w.counters;if(e.length>0){let t={...w.counters};for(let n of e)t[n]=(t[n]??0)+(E[n]??0);o=Object.freeze(t),E={}}let s=w.burstRing,c=w.latestBurst,l=w.burstSeq;if(t.length>0){let e=w.burstRing.length+t.length>y?[...w.burstRing,...t].slice(-y):[...w.burstRing,...t];s=Object.freeze(e),c=t[t.length-1]??c,l=w.burstSeq+t.length,D=[]}let u=w.lifecycleRing;if(n.length>0){let e=w.lifecycleRing.length+n.length>b?[...w.lifecycleRing,...n].slice(-b):[...w.lifecycleRing,...n];u=Object.freeze(e),O=[]}let d=w.connected,f=w.connectionSeq;r&&(d=A,f=w.connectionSeq+1,k=!1);let p=w.reconnectAttempts,m=w.lastErrorAt,h=w.reconnectDelayMs;ee!==null&&(p=ee,ee=null),j!==null&&(m=j,j=null),M!==null&&(h=M,M=null),w=Object.freeze({counters:o,latestBurst:c,burstRing:s,burstSeq:l,lifecycleRing:u,connectionSeq:f,connected:d,reconnectAttempts:p,lastErrorAt:m,reconnectDelayMs:h});for(let e of T)e()}var ie=null,ae=0,oe=new Set,F=new Map,I=null,L=S,se=null;function R(e,t){if(e===`eval-burst`){try{let e=JSON.parse(t.data);Array.isArray(e?.bursts)&&(D.push(...e.bursts),N())}catch{}return}if(e===`session-lifecycle`){try{let e=JSON.parse(t.data);Array.isArray(e?.events)&&e.events.length>0&&(O.push(...e.events),N())}catch{}return}E[e]=(E[e]??0)+1,N()}function ce(e){if(!ie||F.has(e))return;let t=t=>R(e,t);ie.addEventListener(e,t),F.set(e,t)}var le=0,ue=0,de=2e3;function fe(){if(ie)return;re(`opening EventSource`,{url:`/api/events`}),ue=Date.now();let e=new EventSource(`/api/events`);ie=e,F.clear();for(let e of oe)ce(e);e.onopen=()=>{let e=w.lastErrorAt!==null;L=S,le=0,ee=0,M=S,k=!0,A=!0,N(),e&&Ce(`reconnect`),re(`connected`)},e.onerror=()=>{e.close(),ie=null,F.clear(),k=!0,A=!1,j=Date.now(),N(),le===0&&Date.now()-ue<de?re(`first-open interrupted (page-load race) — reconnect in ${L}ms`):console.warn(`[ssg-sse] EventSource error — reconnect in ${L}ms (attempt ${le+1})`),ae>0&&(I=setTimeout(()=>{I=null,ae>0&&fe()},L),le++,ee=le,L=Math.min(L*2,C),M=L,N())}}function pe(){I&&=(clearTimeout(I),null),ie?.close(),ie=null,F.clear(),L=S,le=0,ee=0,M=S,k=!0,A=!1,N()}typeof document<`u`&&document.addEventListener(`visibilitychange`,()=>{document.visibilityState===`visible`&&ae!==0&&(ie||(I&&=(clearTimeout(I),null),re(`visibilitychange → reconnecting`),fe()))});function me(){for(let e of oe)e!==`eval-burst`&&(E[e]=(E[e]??0)+1);N()}function he(e){return T.add(e),()=>{T.delete(e)}}function ge(){return w}var _e=2e3,ve=1e4,ye=1440*60*1e3,be=500,xe=0,Se=null;function Ce(e){let t=Date.now();if(t-xe<ve){re(`hydrate skipped (cooldown)`,{reason:e});return}if(Se)return;let n=t-ye,r=w.burstRing[w.burstRing.length-1],a=w.burstRing.length>0&&r!==void 0?r.ts_ms+1:n,o=e===`reconnect`?Math.max(a,n):n,s=t;if(o>=s)return;xe=t;let c=new AbortController;Se=c,re(`hydrate start`,{reason:e,since:o,until:s,ringLen:w.burstRing.length}),(async()=>{let t=o,n=0;try{for(;n<_e&&t<s&&!c.signal.aborted;){let r=Math.min(be,_e-n),a=await fetch(`/api/json/graph/backfill?since_ms=${t}&until_ms=${s}&limit=${r}`,{signal:c.signal,credentials:`same-origin`});if(!a.ok)break;let o=await a.json();if(!Array.isArray(o.bursts)||o.bursts.length===0||(D.push(...o.bursts),N(),n+=o.bursts.length,re(`hydrate page`,{reason:e,page:n,count:o.bursts.length}),o.bursts.length<r))break;let l=o.bursts[o.bursts.length-1];if(l===void 0)break;t=l.ts_ms+1}re(`hydrate done`,{reason:e,fetched:n})}catch(t){t.name!==`AbortError`&&console.warn(`[ssg-sse] ring hydration failed (${e})`,t)}finally{Se=null}})()}function we(e){for(let t of e)oe.add(t),ce(t);return ae++,ae===1&&(Ce(`initial`),fe(),se=setInterval(me,x)),()=>{ae--,ae===0&&(pe(),se&&=(clearInterval(se),null))}}var Te=Object.freeze([`eval-burst`,`counters-updated`]);function Ee(){(0,v.useEffect)(()=>we(Te),[])}function De(){return Ee(),(0,v.useSyncExternalStore)(he,ge).latestBurst}function Oe(){return Ee(),(0,v.useSyncExternalStore)(he,ge).burstRing}function ke(){return Ee(),(0,v.useSyncExternalStore)(he,ge).burstSeq}function Ae(){let e=document.querySelector(`meta[name="ssg-csrf"]`)?.content??``;return e?{"X-SigmaShake-Token":e}:{}}function je(e){let t=(0,v.useSyncExternalStore)(he,ge),n=e.join(`,`);(0,v.useEffect)(()=>we(e),[n]);let r=(0,v.useRef)({});return(0,v.useMemo)(()=>{let n={},a=!1;for(let o of e){let e=t.counters[o]??0;n[o]=e,r.current[o]!==e&&(a=!0)}return!a&&Object.keys(r.current).length===e.length?r.current:(r.current=n,n)},[t,n])}function z(e,t=[]){let[n,r]=(0,v.useState)({data:null,loading:!0,error:null}),[a,o]=(0,v.useState)(0),s=(0,v.useRef)(null),c=(0,v.useCallback)(()=>{o(e=>e+1)},[]);return(0,v.useEffect)(()=>{let t=new AbortController;return s.current=t,r(e=>({...e,loading:!0,error:null})),fetch(e,{signal:t.signal}).then(async e=>{if(!e.ok)throw Error(`HTTP ${e.status}`);return e.json()}).then(e=>{t.signal.aborted||r({data:e,loading:!1,error:null})}).catch(e=>{if(t.signal.aborted)return;let n=e instanceof Error?e.message:String(e);r(e=>({...e,loading:!1,error:n}))}),()=>{t.abort()}},[e,a,...t]),{...n,refetch:c}}var Me=e=>e,Ne=e=>({in:t=>t**+e,out:t=>1-(1-t)**e,inOut:t=>t<.5?(2*t)**e/2:1-(-2*t+2)**e/2}),Pe=Ne(2),Fe=Ne(3),Ie=Ne(4),Le=Ne(5),Re={in:e=>1-Math.cos(e*Math.PI/2),out:e=>Math.sin(e*Math.PI/2),inOut:e=>-(Math.cos(Math.PI*e)-1)/2},ze={in:e=>e===0?0:2**(10*e-10),out:e=>e===1?1:1-2**(-10*e),inOut:e=>e===0?0:e===1?1:e<.5?2**(20*e-10)/2:(2-2**(-20*e+10))/2},Be={in:e=>1-Math.sqrt(1-e**2),out:e=>Math.sqrt(1-(e-1)**2),inOut:e=>e<.5?(1-Math.sqrt(1-(2*e)**2))/2:(Math.sqrt(1-(-2*e+2)**2)+1)/2};function Ve(e=1.70158){let t=e;return e=>e*e*((t+1)*e-t)}function He(e=1.70158){let t=e;return e=>{let n=e-1;return n*n*((t+1)*n+t)+1}}function Ue(e=1.70158){let t=e*1.525;return e=>e<.5?(2*e)**2*((t+1)*2*e-t)/2:((2*e-2)**2*((t+1)*(e*2-2)+t)+2)/2}function We(e=1,t=.3){let n=Math.max(e,1),r=Math.max(t,.08),a=r/(Math.PI*2)*Math.asin(1/n);return e=>e===0?0:e===1?1:n*2**(-10*e)*Math.sin((e-a)*(Math.PI*2)/r)+1}function Ge(e=1,t=.3){let n=Math.max(e,1),r=Math.max(t,.08),a=r/(Math.PI*2)*Math.asin(1/n);return e=>e===0?0:e===1?1:-(n*2**(10*(e-1))*Math.sin((e-1-a)*(Math.PI*2)/r))}function Ke(e=1,t=.45){let n=Math.max(e,1),r=Math.max(t,.08),a=r/(Math.PI*2)*Math.asin(1/n);return e=>{if(e===0)return 0;if(e===1)return 1;let t=e*2;return t<1?-.5*(n*2**(10*(t-1))*Math.sin((t-1-a)*(Math.PI*2)/r)):n*2**(-10*(t-1))*Math.sin((t-1-a)*(Math.PI*2)/r)*.5+1}}var qe=7.5625,Je=2.75,Ye=e=>{if(e<1/Je)return qe*e*e;if(e<2/Je){let t=e-1.5/Je;return qe*t*t+.75}if(e<2.5/Je){let t=e-2.25/Je;return qe*t*t+.9375}let t=e-2.625/Je;return qe*t*t+.984375},Xe=e=>1-Ye(1-e),Ze=e=>e<.5?(1-Ye(1-2*e))/2:(1+Ye(2*e-1))/2;function Qe(e){let t=Math.max(1,Math.floor(e));return e=>e>=1?1:e<=0?0:Math.floor(e*t)/t}function $e(e,t,n,r){let a=3*e,o=3*(n-e)-a,s=1-a-o,c=3*t,l=3*(r-t)-c,u=1-c-l,d=e=>((s*e+o)*e+a)*e,f=e=>((u*e+l)*e+c)*e,p=e=>(3*s*e+2*o)*e+a,m=e=>{let t=e;for(let n=0;n<8;n++){let n=d(t)-e;if(Math.abs(n)<1e-5)return t;let r=p(t);if(Math.abs(r)<1e-6)break;t-=n/r}let n=0,r=1;for(t=e;n<r;){let a=d(t);if(Math.abs(a-e)<1e-5)return t;e>a?n=t:r=t,t=(n+r)/2}return t};return e=>e<=0?0:e>=1?1:f(m(e))}function et(e={}){let t=Math.max(1,e.stiffness??100),n=Math.max(0,e.damping??10),r=Math.max(.01,e.mass??1),a=e.velocity??0,o=Math.sqrt(t/r),s=n/(2*Math.sqrt(t*r)),c;if(s<1){let e=o*Math.sqrt(1-s*s),t=(s*o+-a)/e;c=n=>1-Math.exp(-s*o*n)*(1*Math.cos(e*n)+t*Math.sin(e*n))}else if(s===1){let e=o+-a;c=t=>1-Math.exp(-o*t)*(1+e*t)}else{let e=Math.sqrt(s*s-1),t=-o*(s-e),n=-o*(s+e),r=(n- -a)/(n-t),l=1-r;c=e=>1-(r*Math.exp(t*e)+l*Math.exp(n*e))}let l=400;for(let e=16;e<=4e3;e+=16){let t=c(e/1e3);if(Math.abs(1-t)<.005){let t=c((e-16)/1e3);if(Math.abs(1-t)<.005){l=e;break}}l=e}let u=l/1e3;return{duration:l,fn:e=>c(Math.max(0,Math.min(1,e))*u)}}var tt={linear:Me,inQuad:Pe.in,outQuad:Pe.out,inOutQuad:Pe.inOut,inCubic:Fe.in,outCubic:Fe.out,inOutCubic:Fe.inOut,inQuart:Ie.in,outQuart:Ie.out,inOutQuart:Ie.inOut,inQuint:Le.in,outQuint:Le.out,inOutQuint:Le.inOut,inSine:Re.in,outSine:Re.out,inOutSine:Re.inOut,inExpo:ze.in,outExpo:ze.out,inOutExpo:ze.inOut,inCirc:Be.in,outCirc:Be.out,inOutCirc:Be.inOut,inBack:Ve(),outBack:He(),inOutBack:Ue(),inElastic:Ge(),outElastic:We(),inOutElastic:Ke(),inBounce:Xe,outBounce:Ye,inOutBounce:Ze};function nt(e){if(typeof e==`function`)return e;if(e===void 0)return tt.outCubic;let t=tt[e];if(t)return t;let n=e.match(/^(\w+)\(([^)]*)\)$/);if(n){let e=n[1],t=n[2].split(`,`).map(e=>parseFloat(e.trim())).filter(e=>!Number.isNaN(e));switch(e){case`outElastic`:return We(t[0],t[1]);case`inElastic`:return Ge(t[0],t[1]);case`inOutElastic`:return Ke(t[0],t[1]);case`outBack`:return He(t[0]);case`inBack`:return Ve(t[0]);case`inOutBack`:return Ue(t[0]);case`steps`:return Qe(t[0]??4);case`cubicBezier`:return t.length>=4?$e(t[0],t[1],t[2],t[3]):tt.outCubic;default:return tt.outCubic}}return tt.outCubic}function rt(e,t){if(t<=1||e===void 0||e===`first`)return 0;if(e===`last`)return t-1;if(e===`center`)return(t-1)/2;let n=Math.floor(e);return n<0?0:n>t-1?t-1:n}function it(e,t={}){let n=t.start??0,r=t.direction===`reverse`;return(a,o)=>{if(o<=0)return n;let s=rt(t.from,o),c=Math.abs(a-s),l=Math.max(s,o-1-s),u=l===0?0:c/l,d=r?1-u:u,f;if(Array.isArray(e)){let[t,n]=e;f=t+d*(n-t)}else f=(r?l-c:c)*e;return n+f}}var at=new Set([`duration`,`delay`,`ease`,`loop`,`alternate`,`onBegin`,`onUpdate`,`onComplete`]);function ot(e){if(typeof e==`number`||typeof e==`string`)return e;if(Array.isArray(e)&&e.length===2){let[t,n]=e;if((typeof t==`number`||typeof t==`string`)&&(typeof n==`number`||typeof n==`string`))return[t,n]}return null}function st(e){return e?typeof e==`string`?typeof document>`u`?[]:Array.from(document.querySelectorAll(e)):e instanceof Element?[e]:`length`in e?Array.from(e):[]:[]}function ct(){return typeof window>`u`||!window.matchMedia?!1:window.matchMedia(`(prefers-reduced-motion: reduce)`).matches}var lt=/^(-?\d*\.?\d+)([a-z%]*)$/i;function ut(e){if(typeof e==`number`)return{value:e,unit:``};let t=e.trim().match(lt);return t?{value:parseFloat(t[1]),unit:t[2]??``}:{value:0,unit:``}}function dt(e){return e.unit===``?`${e.value}`:`${e.value}${e.unit}`}var ft=new Set([`translate`,`translateX`,`translateY`,`translateZ`,`scale`,`scaleX`,`scaleY`,`scaleZ`,`rotate`,`rotateX`,`rotateY`,`rotateZ`,`skew`,`skewX`,`skewY`]),pt=new WeakMap;function mt(e){let t=pt.get(e);return t||(t={values:{}},pt.set(e,t)),t}function ht(e){let t=[];for(let[n,r]of Object.entries(e.values)){let e=r.unit||(n.startsWith(`rotate`)||n.startsWith(`skew`)?`deg`:n.startsWith(`translate`)?`px`:``);t.push(`${n}(${r.value}${e})`)}return t.join(` `)}function gt(e,t,n){if(ft.has(t)){let r=mt(e);r.values[t]=n,e.style.transform=ht(r);return}if(t===`opacity`){e.style.opacity=`${n.value}`;return}e.style.setProperty(t,dt(n))}function _t(e,t){return ft.has(t)?mt(e).values[t]||{value:t.startsWith(`scale`)?1:0,unit:``}:ut(e.style.getPropertyValue(t)||(typeof window<`u`?window.getComputedStyle(e).getPropertyValue(t):``)||(t===`opacity`?`1`:`0`))}function vt(e,t,n){return e+(t-e)*n}function yt(e,t,n){return e===void 0?0:typeof e==`number`?e:e(t,n)}function bt(e){if(e&&typeof e==`object`&&`spring`in e){let t=et(e.spring);return{ease:t.fn,duration:t.duration}}return{ease:nt(e),duration:null}}var xt=0,St=new Set;function Ct(e){for(let t of St){if(t.done||e<t.start)continue;let{target:n,options:r}=t,a=e-t.start,o=Math.max(1,n.duration),s=r.loop??!1,c=r.alternate===!0,l=s===!0?1/0:typeof s==`number`?Math.max(1,s):1,u=Math.floor(a/o),d=(a-u*o)/o,f=c&&u%2==1?1-d:d;if(u>=l){for(let e of n.props)gt(n.el,e.name,wt(e.from,e.to,c&&l%2==0?0:1));r.onUpdate?.(1,n.el,n.index),r.onComplete?.(n.el,n.index),t.done=!0;continue}for(let e of n.props){let t=e.ease(Math.max(0,Math.min(1,f)));n.el!==null&>(n.el,e.name,wt(e.from,e.to,t))}n.el!==null&&r.onUpdate?.(f,n.el,n.index)}for(let e of[...St])e.done&&St.delete(e);if(St.size===0){xt=0;return}xt=requestAnimationFrame(Ct)}function wt(e,t,n){let r=e.unit||t.unit;return{value:vt(e.value,t.value,n),unit:r}}function Tt(){xt===0&&(typeof requestAnimationFrame>`u`||(xt=requestAnimationFrame(Ct)))}function Et(e,t){let n=st(e),r=n.length,a=Object.keys(t).filter(e=>!at.has(e)),o=ct(),{ease:s,duration:c}=bt(t.ease),l=t.duration??c??400,u=[],d=[],f=typeof performance<`u`?performance.now():Date.now(),p=(e,n)=>{let o=[];for(let n of a){let r=t[n];if(r===void 0)continue;let a=ot(r);if(a===null)continue;let c,l;Array.isArray(a)?(c=ut(a[0]),l=ut(a[1])):(c=_t(e,n),l=ut(a)),o.push({name:n,from:c,to:l,ease:s})}return{el:e,index:n,props:o,duration:l,delay:yt(t.delay,n,r)}};if(n.length===0)return{cancel:()=>{},finished:Promise.resolve(),get done(){return!0}};let m=!1;for(let e=0;e<n.length;e++){let r=n[e],a=p(r,e),s=f+a.delay;if(t.onBegin?.(r,e),o){for(let e of a.props)gt(r,e.name,e.to);t.onUpdate?.(1,r,e),t.onComplete?.(r,e),d.push(Promise.resolve());continue}for(let e of a.props)gt(r,e.name,e.from);let c={target:a,start:s,options:t,done:!1};u.push(c),St.add(c),d.push(new Promise(e=>{let n=t.onComplete,r=(t,r)=>{try{n?.(t,r)}finally{e()}};c.options={...t,onComplete:r}}))}return Tt(),{cancel(){if(!m){m=!0;for(let e of u)e.done=!0,St.delete(e)}},finished:Promise.all(d).then(()=>void 0),get done(){return m||u.every(e=>e.done)}}}function Dt(e={}){let t=(0,v.useRef)(null),n=(0,v.useRef)(!1),r=(0,v.useCallback)(()=>{if(n.current)return;let r=t.current;if(!r)return;let a=r.querySelectorAll(`[data-reveal]`);if(a.length===0)return;if(n.current=!0,ct()){a.forEach(e=>{e.style.opacity=`1`,e.style.transform=``});return}let o=e.staggerMs??40,s=e.maxStaggerMs??320,c=Math.min(o,Math.max(10,s/a.length)),l=e.translateY??14,u=e.durationMs??520,d=e.from??`center`;a.forEach(e=>{e.style.opacity=`0`,e.style.transform=`translateY(${l}px)`,e.style.willChange=`transform, opacity`}),Et(Array.from(a),{opacity:[0,1],translateY:[l,0],duration:u,ease:`outBack(1.2)`,delay:it(c,{from:d}),onComplete:e=>{e.style.willChange=``}})},[e.staggerMs,e.maxStaggerMs,e.durationMs,e.translateY,e.from]);return(0,v.useEffect)(()=>{let n=t.current;if(!n)return;if(typeof IntersectionObserver>`u`){r();return}let a=!1,o=new IntersectionObserver(e=>{for(let t of e)if(t.isIntersecting&&!a){r(),o.disconnect();return}},{threshold:.08});o.observe(n);let s=n.querySelectorAll(`[data-reveal]`);if(!ct()){let t=e.translateY??14;s.forEach(e=>{e.style.opacity=`0`,e.style.transform=`translateY(${t}px)`})}let c=n.getBoundingClientRect();return c.top<(window.innerHeight||document.documentElement.clientHeight)&&c.bottom>0&&(r(),o.disconnect()),()=>{a=!0,o.disconnect()}},[r,e.translateY]),t}function Ot(e){var t,n,r=``;if(typeof e==`string`||typeof e==`number`)r+=e;else if(typeof e==`object`)if(Array.isArray(e)){var a=e.length;for(t=0;t<a;t++)e[t]&&(n=Ot(e[t]))&&(r&&(r+=` `),r+=n)}else for(n in e)e[n]&&(r&&(r+=` `),r+=n);return r}function kt(){for(var e,t,n=0,r=``,a=arguments.length;n<a;n++)(e=arguments[n])&&(t=Ot(e))&&(r&&(r+=` `),r+=t);return r}var At=e=>typeof e==`boolean`?`${e}`:e===0?`0`:e,jt=kt,Mt=(e,t)=>n=>{if(t?.variants==null)return jt(e,n?.class,n?.className);let{variants:r,defaultVariants:a}=t,o=Object.keys(r).map(e=>{let t=n?.[e],o=a?.[e];if(t===null)return null;let s=At(t)||At(o);return r[e][s]}),s=n&&Object.entries(n).reduce((e,t)=>{let[n,r]=t;return r===void 0||(e[n]=r),e},{});return jt(e,o,t?.compoundVariants?.reduce((e,t)=>{let{class:n,className:r,...o}=t;return Object.entries(o).every(e=>{let[t,n]=e;return Array.isArray(n)?n.includes({...a,...s}[t]):{...a,...s}[t]===n})?[...e,n,r]:e},[]),n?.class,n?.className)},Nt=(e,t)=>{let n=Array(e.length+t.length);for(let t=0;t<e.length;t++)n[t]=e[t];for(let r=0;r<t.length;r++)n[e.length+r]=t[r];return n},Pt=(e,t)=>({classGroupId:e,validator:t}),Ft=(e=new Map,t=null,n)=>({nextPart:e,validators:t,classGroupId:n}),It=`-`,Lt=[],Rt=`arbitrary..`,zt=e=>{let t=Ht(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:e=>{if(e.startsWith(`[`)&&e.endsWith(`]`))return Vt(e);let n=e.split(It);return Bt(n,n[0]===``&&n.length>1?1:0,t)},getConflictingClassGroupIds:(e,t)=>{if(t){let t=r[e],a=n[e];return t?a?Nt(a,t):t:a||Lt}return n[e]||Lt}}},Bt=(e,t,n)=>{if(e.length-t===0)return n.classGroupId;let r=e[t],a=n.nextPart.get(r);if(a){let n=Bt(e,t+1,a);if(n)return n}let o=n.validators;if(o===null)return;let s=t===0?e.join(It):e.slice(t).join(It),c=o.length;for(let e=0;e<c;e++){let t=o[e];if(t.validator(s))return t.classGroupId}},Vt=e=>e.slice(1,-1).indexOf(`:`)===-1?void 0:(()=>{let t=e.slice(1,-1),n=t.indexOf(`:`),r=t.slice(0,n);return r?Rt+r:void 0})(),Ht=e=>{let{theme:t,classGroups:n}=e;return Ut(n,t)},Ut=(e,t)=>{let n=Ft();for(let r in e){let a=e[r];Wt(a,n,r,t)}return n},Wt=(e,t,n,r)=>{let a=e.length;for(let o=0;o<a;o++){let a=e[o];Gt(a,t,n,r)}},Gt=(e,t,n,r)=>{if(typeof e==`string`){Kt(e,t,n);return}if(typeof e==`function`){qt(e,t,n,r);return}Jt(e,t,n,r)},Kt=(e,t,n)=>{let r=e===``?t:Yt(t,e);r.classGroupId=n},qt=(e,t,n,r)=>{if(Xt(e)){Wt(e(r),t,n,r);return}t.validators===null&&(t.validators=[]),t.validators.push(Pt(n,e))},Jt=(e,t,n,r)=>{let a=Object.entries(e),o=a.length;for(let e=0;e<o;e++){let[o,s]=a[e];Wt(s,Yt(t,o),n,r)}},Yt=(e,t)=>{let n=e,r=t.split(It),a=r.length;for(let e=0;e<a;e++){let t=r[e],a=n.nextPart.get(t);a||(a=Ft(),n.nextPart.set(t,a)),n=a}return n},Xt=e=>`isThemeGetter`in e&&e.isThemeGetter===!0,Zt=e=>{if(e<1)return{get:()=>void 0,set:()=>{}};let t=0,n=Object.create(null),r=Object.create(null),a=(a,o)=>{n[a]=o,t++,t>e&&(t=0,r=n,n=Object.create(null))};return{get(e){let t=n[e];if(t!==void 0)return t;if((t=r[e])!==void 0)return a(e,t),t},set(e,t){e in n?n[e]=t:a(e,t)}}},Qt=`!`,$t=`:`,en=[],tn=(e,t,n,r,a)=>({modifiers:e,hasImportantModifier:t,baseClassName:n,maybePostfixModifierPosition:r,isExternal:a}),nn=e=>{let{prefix:t,experimentalParseClassName:n}=e,r=e=>{let t=[],n=0,r=0,a=0,o,s=e.length;for(let c=0;c<s;c++){let s=e[c];if(n===0&&r===0){if(s===$t){t.push(e.slice(a,c)),a=c+1;continue}if(s===`/`){o=c;continue}}s===`[`?n++:s===`]`?n--:s===`(`?r++:s===`)`&&r--}let c=t.length===0?e:e.slice(a),l=c,u=!1;c.endsWith(Qt)?(l=c.slice(0,-1),u=!0):c.startsWith(Qt)&&(l=c.slice(1),u=!0);let d=o&&o>a?o-a:void 0;return tn(t,u,l,d)};if(t){let e=t+$t,n=r;r=t=>t.startsWith(e)?n(t.slice(e.length)):tn(en,!1,t,void 0,!0)}if(n){let e=r;r=t=>n({className:t,parseClassName:e})}return r},rn=e=>{let t=new Map;return e.orderSensitiveModifiers.forEach((e,n)=>{t.set(e,1e6+n)}),e=>{let n=[],r=[];for(let a=0;a<e.length;a++){let o=e[a],s=o[0]===`[`,c=t.has(o);s||c?(r.length>0&&(r.sort(),n.push(...r),r=[]),n.push(o)):r.push(o)}return r.length>0&&(r.sort(),n.push(...r)),n}},an=e=>({cache:Zt(e.cacheSize),parseClassName:nn(e),sortModifiers:rn(e),...zt(e)}),on=/\s+/,sn=(e,t)=>{let{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:a,sortModifiers:o}=t,s=[],c=e.trim().split(on),l=``;for(let e=c.length-1;e>=0;--e){let t=c[e],{isExternal:u,modifiers:d,hasImportantModifier:f,baseClassName:p,maybePostfixModifierPosition:m}=n(t);if(u){l=t+(l.length>0?` `+l:l);continue}let h=!!m,g=r(h?p.substring(0,m):p);if(!g){if(!h){l=t+(l.length>0?` `+l:l);continue}if(g=r(p),!g){l=t+(l.length>0?` `+l:l);continue}h=!1}let _=d.length===0?``:d.length===1?d[0]:o(d).join(`:`),v=f?_+Qt:_,y=v+g;if(s.indexOf(y)>-1)continue;s.push(y);let b=a(g,h);for(let e=0;e<b.length;++e){let t=b[e];s.push(v+t)}l=t+(l.length>0?` `+l:l)}return l},cn=(...e)=>{let t=0,n,r,a=``;for(;t<e.length;)(n=e[t++])&&(r=ln(n))&&(a&&(a+=` `),a+=r);return a},ln=e=>{if(typeof e==`string`)return e;let t,n=``;for(let r=0;r<e.length;r++)e[r]&&(t=ln(e[r]))&&(n&&(n+=` `),n+=t);return n},un=(e,...t)=>{let n,r,a,o,s=s=>(n=an(t.reduce((e,t)=>t(e),e())),r=n.cache.get,a=n.cache.set,o=c,c(s)),c=e=>{let t=r(e);if(t)return t;let o=sn(e,n);return a(e,o),o};return o=s,(...e)=>o(cn(...e))},dn=[],fn=e=>{let t=t=>t[e]||dn;return t.isThemeGetter=!0,t},pn=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,mn=/^\((?:(\w[\w-]*):)?(.+)\)$/i,hn=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,gn=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,_n=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,vn=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,yn=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,bn=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,xn=e=>hn.test(e),B=e=>!!e&&!Number.isNaN(Number(e)),Sn=e=>!!e&&Number.isInteger(Number(e)),Cn=e=>e.endsWith(`%`)&&B(e.slice(0,-1)),wn=e=>gn.test(e),Tn=()=>!0,En=e=>_n.test(e)&&!vn.test(e),Dn=()=>!1,On=e=>yn.test(e),kn=e=>bn.test(e),An=e=>!V(e)&&!H(e),jn=e=>Kn(e,Xn,Dn),V=e=>pn.test(e),Mn=e=>Kn(e,Zn,En),Nn=e=>Kn(e,Qn,B),Pn=e=>Kn(e,er,Tn),Fn=e=>Kn(e,$n,Dn),In=e=>Kn(e,Jn,Dn),Ln=e=>Kn(e,Yn,kn),Rn=e=>Kn(e,tr,On),H=e=>mn.test(e),zn=e=>qn(e,Zn),Bn=e=>qn(e,$n),Vn=e=>qn(e,Jn),Hn=e=>qn(e,Xn),Un=e=>qn(e,Yn),Wn=e=>qn(e,tr,!0),Gn=e=>qn(e,er,!0),Kn=(e,t,n)=>{let r=pn.exec(e);return r?r[1]?t(r[1]):n(r[2]):!1},qn=(e,t,n=!1)=>{let r=mn.exec(e);return r?r[1]?t(r[1]):n:!1},Jn=e=>e===`position`||e===`percentage`,Yn=e=>e===`image`||e===`url`,Xn=e=>e===`length`||e===`size`||e===`bg-size`,Zn=e=>e===`length`,Qn=e=>e===`number`,$n=e=>e===`family-name`,er=e=>e===`number`||e===`weight`,tr=e=>e===`shadow`,nr=un(()=>{let e=fn(`color`),t=fn(`font`),n=fn(`text`),r=fn(`font-weight`),a=fn(`tracking`),o=fn(`leading`),s=fn(`breakpoint`),c=fn(`container`),l=fn(`spacing`),u=fn(`radius`),d=fn(`shadow`),f=fn(`inset-shadow`),p=fn(`text-shadow`),m=fn(`drop-shadow`),h=fn(`blur`),g=fn(`perspective`),_=fn(`aspect`),v=fn(`ease`),y=fn(`animate`),b=()=>[`auto`,`avoid`,`all`,`avoid-page`,`page`,`left`,`right`,`column`],x=()=>[`center`,`top`,`bottom`,`left`,`right`,`top-left`,`left-top`,`top-right`,`right-top`,`bottom-right`,`right-bottom`,`bottom-left`,`left-bottom`],S=()=>[...x(),H,V],C=()=>[`auto`,`hidden`,`clip`,`visible`,`scroll`],w=()=>[`auto`,`contain`,`none`],T=()=>[H,V,l],E=()=>[xn,`full`,`auto`,...T()],D=()=>[Sn,`none`,`subgrid`,H,V],O=()=>[`auto`,{span:[`full`,Sn,H,V]},Sn,H,V],k=()=>[Sn,`auto`,H,V],A=()=>[`auto`,`min`,`max`,`fr`,H,V],ee=()=>[`start`,`end`,`center`,`between`,`around`,`evenly`,`stretch`,`baseline`,`center-safe`,`end-safe`],j=()=>[`start`,`end`,`center`,`stretch`,`center-safe`,`end-safe`],M=()=>[`auto`,...T()],te=()=>[xn,`auto`,`full`,`dvw`,`dvh`,`lvw`,`lvh`,`svw`,`svh`,`min`,`max`,`fit`,...T()],ne=()=>[xn,`screen`,`full`,`dvw`,`lvw`,`svw`,`min`,`max`,`fit`,...T()],re=()=>[xn,`screen`,`full`,`lh`,`dvh`,`lvh`,`svh`,`min`,`max`,`fit`,...T()],N=()=>[e,H,V],P=()=>[...x(),Vn,In,{position:[H,V]}],ie=()=>[`no-repeat`,{repeat:[``,`x`,`y`,`space`,`round`]}],ae=()=>[`auto`,`cover`,`contain`,Hn,jn,{size:[H,V]}],oe=()=>[Cn,zn,Mn],F=()=>[``,`none`,`full`,u,H,V],I=()=>[``,B,zn,Mn],L=()=>[`solid`,`dashed`,`dotted`,`double`],se=()=>[`normal`,`multiply`,`screen`,`overlay`,`darken`,`lighten`,`color-dodge`,`color-burn`,`hard-light`,`soft-light`,`difference`,`exclusion`,`hue`,`saturation`,`color`,`luminosity`],R=()=>[B,Cn,Vn,In],ce=()=>[``,`none`,h,H,V],le=()=>[`none`,B,H,V],ue=()=>[`none`,B,H,V],de=()=>[B,H,V],fe=()=>[xn,`full`,...T()];return{cacheSize:500,theme:{animate:[`spin`,`ping`,`pulse`,`bounce`],aspect:[`video`],blur:[wn],breakpoint:[wn],color:[Tn],container:[wn],"drop-shadow":[wn],ease:[`in`,`out`,`in-out`],font:[An],"font-weight":[`thin`,`extralight`,`light`,`normal`,`medium`,`semibold`,`bold`,`extrabold`,`black`],"inset-shadow":[wn],leading:[`none`,`tight`,`snug`,`normal`,`relaxed`,`loose`],perspective:[`dramatic`,`near`,`normal`,`midrange`,`distant`,`none`],radius:[wn],shadow:[wn],spacing:[`px`,B],text:[wn],"text-shadow":[wn],tracking:[`tighter`,`tight`,`normal`,`wide`,`wider`,`widest`]},classGroups:{aspect:[{aspect:[`auto`,`square`,xn,V,H,_]}],container:[`container`],columns:[{columns:[B,V,H,c]}],"break-after":[{"break-after":b()}],"break-before":[{"break-before":b()}],"break-inside":[{"break-inside":[`auto`,`avoid`,`avoid-page`,`avoid-column`]}],"box-decoration":[{"box-decoration":[`slice`,`clone`]}],box:[{box:[`border`,`content`]}],display:[`block`,`inline-block`,`inline`,`flex`,`inline-flex`,`table`,`inline-table`,`table-caption`,`table-cell`,`table-column`,`table-column-group`,`table-footer-group`,`table-header-group`,`table-row-group`,`table-row`,`flow-root`,`grid`,`inline-grid`,`contents`,`list-item`,`hidden`],sr:[`sr-only`,`not-sr-only`],float:[{float:[`right`,`left`,`none`,`start`,`end`]}],clear:[{clear:[`left`,`right`,`both`,`none`,`start`,`end`]}],isolation:[`isolate`,`isolation-auto`],"object-fit":[{object:[`contain`,`cover`,`fill`,`none`,`scale-down`]}],"object-position":[{object:S()}],overflow:[{overflow:C()}],"overflow-x":[{"overflow-x":C()}],"overflow-y":[{"overflow-y":C()}],overscroll:[{overscroll:w()}],"overscroll-x":[{"overscroll-x":w()}],"overscroll-y":[{"overscroll-y":w()}],position:[`static`,`fixed`,`absolute`,`relative`,`sticky`],inset:[{inset:E()}],"inset-x":[{"inset-x":E()}],"inset-y":[{"inset-y":E()}],start:[{"inset-s":E(),start:E()}],end:[{"inset-e":E(),end:E()}],"inset-bs":[{"inset-bs":E()}],"inset-be":[{"inset-be":E()}],top:[{top:E()}],right:[{right:E()}],bottom:[{bottom:E()}],left:[{left:E()}],visibility:[`visible`,`invisible`,`collapse`],z:[{z:[Sn,`auto`,H,V]}],basis:[{basis:[xn,`full`,`auto`,c,...T()]}],"flex-direction":[{flex:[`row`,`row-reverse`,`col`,`col-reverse`]}],"flex-wrap":[{flex:[`nowrap`,`wrap`,`wrap-reverse`]}],flex:[{flex:[B,xn,`auto`,`initial`,`none`,V]}],grow:[{grow:[``,B,H,V]}],shrink:[{shrink:[``,B,H,V]}],order:[{order:[Sn,`first`,`last`,`none`,H,V]}],"grid-cols":[{"grid-cols":D()}],"col-start-end":[{col:O()}],"col-start":[{"col-start":k()}],"col-end":[{"col-end":k()}],"grid-rows":[{"grid-rows":D()}],"row-start-end":[{row:O()}],"row-start":[{"row-start":k()}],"row-end":[{"row-end":k()}],"grid-flow":[{"grid-flow":[`row`,`col`,`dense`,`row-dense`,`col-dense`]}],"auto-cols":[{"auto-cols":A()}],"auto-rows":[{"auto-rows":A()}],gap:[{gap:T()}],"gap-x":[{"gap-x":T()}],"gap-y":[{"gap-y":T()}],"justify-content":[{justify:[...ee(),`normal`]}],"justify-items":[{"justify-items":[...j(),`normal`]}],"justify-self":[{"justify-self":[`auto`,...j()]}],"align-content":[{content:[`normal`,...ee()]}],"align-items":[{items:[...j(),{baseline:[``,`last`]}]}],"align-self":[{self:[`auto`,...j(),{baseline:[``,`last`]}]}],"place-content":[{"place-content":ee()}],"place-items":[{"place-items":[...j(),`baseline`]}],"place-self":[{"place-self":[`auto`,...j()]}],p:[{p:T()}],px:[{px:T()}],py:[{py:T()}],ps:[{ps:T()}],pe:[{pe:T()}],pbs:[{pbs:T()}],pbe:[{pbe:T()}],pt:[{pt:T()}],pr:[{pr:T()}],pb:[{pb:T()}],pl:[{pl:T()}],m:[{m:M()}],mx:[{mx:M()}],my:[{my:M()}],ms:[{ms:M()}],me:[{me:M()}],mbs:[{mbs:M()}],mbe:[{mbe:M()}],mt:[{mt:M()}],mr:[{mr:M()}],mb:[{mb:M()}],ml:[{ml:M()}],"space-x":[{"space-x":T()}],"space-x-reverse":[`space-x-reverse`],"space-y":[{"space-y":T()}],"space-y-reverse":[`space-y-reverse`],size:[{size:te()}],"inline-size":[{inline:[`auto`,...ne()]}],"min-inline-size":[{"min-inline":[`auto`,...ne()]}],"max-inline-size":[{"max-inline":[`none`,...ne()]}],"block-size":[{block:[`auto`,...re()]}],"min-block-size":[{"min-block":[`auto`,...re()]}],"max-block-size":[{"max-block":[`none`,...re()]}],w:[{w:[c,`screen`,...te()]}],"min-w":[{"min-w":[c,`screen`,`none`,...te()]}],"max-w":[{"max-w":[c,`screen`,`none`,`prose`,{screen:[s]},...te()]}],h:[{h:[`screen`,`lh`,...te()]}],"min-h":[{"min-h":[`screen`,`lh`,`none`,...te()]}],"max-h":[{"max-h":[`screen`,`lh`,...te()]}],"font-size":[{text:[`base`,n,zn,Mn]}],"font-smoothing":[`antialiased`,`subpixel-antialiased`],"font-style":[`italic`,`not-italic`],"font-weight":[{font:[r,Gn,Pn]}],"font-stretch":[{"font-stretch":[`ultra-condensed`,`extra-condensed`,`condensed`,`semi-condensed`,`normal`,`semi-expanded`,`expanded`,`extra-expanded`,`ultra-expanded`,Cn,V]}],"font-family":[{font:[Bn,Fn,t]}],"font-features":[{"font-features":[V]}],"fvn-normal":[`normal-nums`],"fvn-ordinal":[`ordinal`],"fvn-slashed-zero":[`slashed-zero`],"fvn-figure":[`lining-nums`,`oldstyle-nums`],"fvn-spacing":[`proportional-nums`,`tabular-nums`],"fvn-fraction":[`diagonal-fractions`,`stacked-fractions`],tracking:[{tracking:[a,H,V]}],"line-clamp":[{"line-clamp":[B,`none`,H,Nn]}],leading:[{leading:[o,...T()]}],"list-image":[{"list-image":[`none`,H,V]}],"list-style-position":[{list:[`inside`,`outside`]}],"list-style-type":[{list:[`disc`,`decimal`,`none`,H,V]}],"text-alignment":[{text:[`left`,`center`,`right`,`justify`,`start`,`end`]}],"placeholder-color":[{placeholder:N()}],"text-color":[{text:N()}],"text-decoration":[`underline`,`overline`,`line-through`,`no-underline`],"text-decoration-style":[{decoration:[...L(),`wavy`]}],"text-decoration-thickness":[{decoration:[B,`from-font`,`auto`,H,Mn]}],"text-decoration-color":[{decoration:N()}],"underline-offset":[{"underline-offset":[B,`auto`,H,V]}],"text-transform":[`uppercase`,`lowercase`,`capitalize`,`normal-case`],"text-overflow":[`truncate`,`text-ellipsis`,`text-clip`],"text-wrap":[{text:[`wrap`,`nowrap`,`balance`,`pretty`]}],indent:[{indent:T()}],"vertical-align":[{align:[`baseline`,`top`,`middle`,`bottom`,`text-top`,`text-bottom`,`sub`,`super`,H,V]}],whitespace:[{whitespace:[`normal`,`nowrap`,`pre`,`pre-line`,`pre-wrap`,`break-spaces`]}],break:[{break:[`normal`,`words`,`all`,`keep`]}],wrap:[{wrap:[`break-word`,`anywhere`,`normal`]}],hyphens:[{hyphens:[`none`,`manual`,`auto`]}],content:[{content:[`none`,H,V]}],"bg-attachment":[{bg:[`fixed`,`local`,`scroll`]}],"bg-clip":[{"bg-clip":[`border`,`padding`,`content`,`text`]}],"bg-origin":[{"bg-origin":[`border`,`padding`,`content`]}],"bg-position":[{bg:P()}],"bg-repeat":[{bg:ie()}],"bg-size":[{bg:ae()}],"bg-image":[{bg:[`none`,{linear:[{to:[`t`,`tr`,`r`,`br`,`b`,`bl`,`l`,`tl`]},Sn,H,V],radial:[``,H,V],conic:[Sn,H,V]},Un,Ln]}],"bg-color":[{bg:N()}],"gradient-from-pos":[{from:oe()}],"gradient-via-pos":[{via:oe()}],"gradient-to-pos":[{to:oe()}],"gradient-from":[{from:N()}],"gradient-via":[{via:N()}],"gradient-to":[{to:N()}],rounded:[{rounded:F()}],"rounded-s":[{"rounded-s":F()}],"rounded-e":[{"rounded-e":F()}],"rounded-t":[{"rounded-t":F()}],"rounded-r":[{"rounded-r":F()}],"rounded-b":[{"rounded-b":F()}],"rounded-l":[{"rounded-l":F()}],"rounded-ss":[{"rounded-ss":F()}],"rounded-se":[{"rounded-se":F()}],"rounded-ee":[{"rounded-ee":F()}],"rounded-es":[{"rounded-es":F()}],"rounded-tl":[{"rounded-tl":F()}],"rounded-tr":[{"rounded-tr":F()}],"rounded-br":[{"rounded-br":F()}],"rounded-bl":[{"rounded-bl":F()}],"border-w":[{border:I()}],"border-w-x":[{"border-x":I()}],"border-w-y":[{"border-y":I()}],"border-w-s":[{"border-s":I()}],"border-w-e":[{"border-e":I()}],"border-w-bs":[{"border-bs":I()}],"border-w-be":[{"border-be":I()}],"border-w-t":[{"border-t":I()}],"border-w-r":[{"border-r":I()}],"border-w-b":[{"border-b":I()}],"border-w-l":[{"border-l":I()}],"divide-x":[{"divide-x":I()}],"divide-x-reverse":[`divide-x-reverse`],"divide-y":[{"divide-y":I()}],"divide-y-reverse":[`divide-y-reverse`],"border-style":[{border:[...L(),`hidden`,`none`]}],"divide-style":[{divide:[...L(),`hidden`,`none`]}],"border-color":[{border:N()}],"border-color-x":[{"border-x":N()}],"border-color-y":[{"border-y":N()}],"border-color-s":[{"border-s":N()}],"border-color-e":[{"border-e":N()}],"border-color-bs":[{"border-bs":N()}],"border-color-be":[{"border-be":N()}],"border-color-t":[{"border-t":N()}],"border-color-r":[{"border-r":N()}],"border-color-b":[{"border-b":N()}],"border-color-l":[{"border-l":N()}],"divide-color":[{divide:N()}],"outline-style":[{outline:[...L(),`none`,`hidden`]}],"outline-offset":[{"outline-offset":[B,H,V]}],"outline-w":[{outline:[``,B,zn,Mn]}],"outline-color":[{outline:N()}],shadow:[{shadow:[``,`none`,d,Wn,Rn]}],"shadow-color":[{shadow:N()}],"inset-shadow":[{"inset-shadow":[`none`,f,Wn,Rn]}],"inset-shadow-color":[{"inset-shadow":N()}],"ring-w":[{ring:I()}],"ring-w-inset":[`ring-inset`],"ring-color":[{ring:N()}],"ring-offset-w":[{"ring-offset":[B,Mn]}],"ring-offset-color":[{"ring-offset":N()}],"inset-ring-w":[{"inset-ring":I()}],"inset-ring-color":[{"inset-ring":N()}],"text-shadow":[{"text-shadow":[`none`,p,Wn,Rn]}],"text-shadow-color":[{"text-shadow":N()}],opacity:[{opacity:[B,H,V]}],"mix-blend":[{"mix-blend":[...se(),`plus-darker`,`plus-lighter`]}],"bg-blend":[{"bg-blend":se()}],"mask-clip":[{"mask-clip":[`border`,`padding`,`content`,`fill`,`stroke`,`view`]},`mask-no-clip`],"mask-composite":[{mask:[`add`,`subtract`,`intersect`,`exclude`]}],"mask-image-linear-pos":[{"mask-linear":[B]}],"mask-image-linear-from-pos":[{"mask-linear-from":R()}],"mask-image-linear-to-pos":[{"mask-linear-to":R()}],"mask-image-linear-from-color":[{"mask-linear-from":N()}],"mask-image-linear-to-color":[{"mask-linear-to":N()}],"mask-image-t-from-pos":[{"mask-t-from":R()}],"mask-image-t-to-pos":[{"mask-t-to":R()}],"mask-image-t-from-color":[{"mask-t-from":N()}],"mask-image-t-to-color":[{"mask-t-to":N()}],"mask-image-r-from-pos":[{"mask-r-from":R()}],"mask-image-r-to-pos":[{"mask-r-to":R()}],"mask-image-r-from-color":[{"mask-r-from":N()}],"mask-image-r-to-color":[{"mask-r-to":N()}],"mask-image-b-from-pos":[{"mask-b-from":R()}],"mask-image-b-to-pos":[{"mask-b-to":R()}],"mask-image-b-from-color":[{"mask-b-from":N()}],"mask-image-b-to-color":[{"mask-b-to":N()}],"mask-image-l-from-pos":[{"mask-l-from":R()}],"mask-image-l-to-pos":[{"mask-l-to":R()}],"mask-image-l-from-color":[{"mask-l-from":N()}],"mask-image-l-to-color":[{"mask-l-to":N()}],"mask-image-x-from-pos":[{"mask-x-from":R()}],"mask-image-x-to-pos":[{"mask-x-to":R()}],"mask-image-x-from-color":[{"mask-x-from":N()}],"mask-image-x-to-color":[{"mask-x-to":N()}],"mask-image-y-from-pos":[{"mask-y-from":R()}],"mask-image-y-to-pos":[{"mask-y-to":R()}],"mask-image-y-from-color":[{"mask-y-from":N()}],"mask-image-y-to-color":[{"mask-y-to":N()}],"mask-image-radial":[{"mask-radial":[H,V]}],"mask-image-radial-from-pos":[{"mask-radial-from":R()}],"mask-image-radial-to-pos":[{"mask-radial-to":R()}],"mask-image-radial-from-color":[{"mask-radial-from":N()}],"mask-image-radial-to-color":[{"mask-radial-to":N()}],"mask-image-radial-shape":[{"mask-radial":[`circle`,`ellipse`]}],"mask-image-radial-size":[{"mask-radial":[{closest:[`side`,`corner`],farthest:[`side`,`corner`]}]}],"mask-image-radial-pos":[{"mask-radial-at":x()}],"mask-image-conic-pos":[{"mask-conic":[B]}],"mask-image-conic-from-pos":[{"mask-conic-from":R()}],"mask-image-conic-to-pos":[{"mask-conic-to":R()}],"mask-image-conic-from-color":[{"mask-conic-from":N()}],"mask-image-conic-to-color":[{"mask-conic-to":N()}],"mask-mode":[{mask:[`alpha`,`luminance`,`match`]}],"mask-origin":[{"mask-origin":[`border`,`padding`,`content`,`fill`,`stroke`,`view`]}],"mask-position":[{mask:P()}],"mask-repeat":[{mask:ie()}],"mask-size":[{mask:ae()}],"mask-type":[{"mask-type":[`alpha`,`luminance`]}],"mask-image":[{mask:[`none`,H,V]}],filter:[{filter:[``,`none`,H,V]}],blur:[{blur:ce()}],brightness:[{brightness:[B,H,V]}],contrast:[{contrast:[B,H,V]}],"drop-shadow":[{"drop-shadow":[``,`none`,m,Wn,Rn]}],"drop-shadow-color":[{"drop-shadow":N()}],grayscale:[{grayscale:[``,B,H,V]}],"hue-rotate":[{"hue-rotate":[B,H,V]}],invert:[{invert:[``,B,H,V]}],saturate:[{saturate:[B,H,V]}],sepia:[{sepia:[``,B,H,V]}],"backdrop-filter":[{"backdrop-filter":[``,`none`,H,V]}],"backdrop-blur":[{"backdrop-blur":ce()}],"backdrop-brightness":[{"backdrop-brightness":[B,H,V]}],"backdrop-contrast":[{"backdrop-contrast":[B,H,V]}],"backdrop-grayscale":[{"backdrop-grayscale":[``,B,H,V]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[B,H,V]}],"backdrop-invert":[{"backdrop-invert":[``,B,H,V]}],"backdrop-opacity":[{"backdrop-opacity":[B,H,V]}],"backdrop-saturate":[{"backdrop-saturate":[B,H,V]}],"backdrop-sepia":[{"backdrop-sepia":[``,B,H,V]}],"border-collapse":[{border:[`collapse`,`separate`]}],"border-spacing":[{"border-spacing":T()}],"border-spacing-x":[{"border-spacing-x":T()}],"border-spacing-y":[{"border-spacing-y":T()}],"table-layout":[{table:[`auto`,`fixed`]}],caption:[{caption:[`top`,`bottom`]}],transition:[{transition:[``,`all`,`colors`,`opacity`,`shadow`,`transform`,`none`,H,V]}],"transition-behavior":[{transition:[`normal`,`discrete`]}],duration:[{duration:[B,`initial`,H,V]}],ease:[{ease:[`linear`,`initial`,v,H,V]}],delay:[{delay:[B,H,V]}],animate:[{animate:[`none`,y,H,V]}],backface:[{backface:[`hidden`,`visible`]}],perspective:[{perspective:[g,H,V]}],"perspective-origin":[{"perspective-origin":S()}],rotate:[{rotate:le()}],"rotate-x":[{"rotate-x":le()}],"rotate-y":[{"rotate-y":le()}],"rotate-z":[{"rotate-z":le()}],scale:[{scale:ue()}],"scale-x":[{"scale-x":ue()}],"scale-y":[{"scale-y":ue()}],"scale-z":[{"scale-z":ue()}],"scale-3d":[`scale-3d`],skew:[{skew:de()}],"skew-x":[{"skew-x":de()}],"skew-y":[{"skew-y":de()}],transform:[{transform:[H,V,``,`none`,`gpu`,`cpu`]}],"transform-origin":[{origin:S()}],"transform-style":[{transform:[`3d`,`flat`]}],translate:[{translate:fe()}],"translate-x":[{"translate-x":fe()}],"translate-y":[{"translate-y":fe()}],"translate-z":[{"translate-z":fe()}],"translate-none":[`translate-none`],accent:[{accent:N()}],appearance:[{appearance:[`none`,`auto`]}],"caret-color":[{caret:N()}],"color-scheme":[{scheme:[`normal`,`dark`,`light`,`light-dark`,`only-dark`,`only-light`]}],cursor:[{cursor:[`auto`,`default`,`pointer`,`wait`,`text`,`move`,`help`,`not-allowed`,`none`,`context-menu`,`progress`,`cell`,`crosshair`,`vertical-text`,`alias`,`copy`,`no-drop`,`grab`,`grabbing`,`all-scroll`,`col-resize`,`row-resize`,`n-resize`,`e-resize`,`s-resize`,`w-resize`,`ne-resize`,`nw-resize`,`se-resize`,`sw-resize`,`ew-resize`,`ns-resize`,`nesw-resize`,`nwse-resize`,`zoom-in`,`zoom-out`,H,V]}],"field-sizing":[{"field-sizing":[`fixed`,`content`]}],"pointer-events":[{"pointer-events":[`auto`,`none`]}],resize:[{resize:[`none`,``,`y`,`x`]}],"scroll-behavior":[{scroll:[`auto`,`smooth`]}],"scroll-m":[{"scroll-m":T()}],"scroll-mx":[{"scroll-mx":T()}],"scroll-my":[{"scroll-my":T()}],"scroll-ms":[{"scroll-ms":T()}],"scroll-me":[{"scroll-me":T()}],"scroll-mbs":[{"scroll-mbs":T()}],"scroll-mbe":[{"scroll-mbe":T()}],"scroll-mt":[{"scroll-mt":T()}],"scroll-mr":[{"scroll-mr":T()}],"scroll-mb":[{"scroll-mb":T()}],"scroll-ml":[{"scroll-ml":T()}],"scroll-p":[{"scroll-p":T()}],"scroll-px":[{"scroll-px":T()}],"scroll-py":[{"scroll-py":T()}],"scroll-ps":[{"scroll-ps":T()}],"scroll-pe":[{"scroll-pe":T()}],"scroll-pbs":[{"scroll-pbs":T()}],"scroll-pbe":[{"scroll-pbe":T()}],"scroll-pt":[{"scroll-pt":T()}],"scroll-pr":[{"scroll-pr":T()}],"scroll-pb":[{"scroll-pb":T()}],"scroll-pl":[{"scroll-pl":T()}],"snap-align":[{snap:[`start`,`end`,`center`,`align-none`]}],"snap-stop":[{snap:[`normal`,`always`]}],"snap-type":[{snap:[`none`,`x`,`y`,`both`]}],"snap-strictness":[{snap:[`mandatory`,`proximity`]}],touch:[{touch:[`auto`,`none`,`manipulation`]}],"touch-x":[{"touch-pan":[`x`,`left`,`right`]}],"touch-y":[{"touch-pan":[`y`,`up`,`down`]}],"touch-pz":[`touch-pinch-zoom`],select:[{select:[`none`,`text`,`all`,`auto`]}],"will-change":[{"will-change":[`auto`,`scroll`,`contents`,`transform`,H,V]}],fill:[{fill:[`none`,...N()]}],"stroke-w":[{stroke:[B,zn,Mn,Nn]}],stroke:[{stroke:[`none`,...N()]}],"forced-color-adjust":[{"forced-color-adjust":[`auto`,`none`]}]},conflictingClassGroups:{overflow:[`overflow-x`,`overflow-y`],overscroll:[`overscroll-x`,`overscroll-y`],inset:[`inset-x`,`inset-y`,`inset-bs`,`inset-be`,`start`,`end`,`top`,`right`,`bottom`,`left`],"inset-x":[`right`,`left`],"inset-y":[`top`,`bottom`],flex:[`basis`,`grow`,`shrink`],gap:[`gap-x`,`gap-y`],p:[`px`,`py`,`ps`,`pe`,`pbs`,`pbe`,`pt`,`pr`,`pb`,`pl`],px:[`pr`,`pl`],py:[`pt`,`pb`],m:[`mx`,`my`,`ms`,`me`,`mbs`,`mbe`,`mt`,`mr`,`mb`,`ml`],mx:[`mr`,`ml`],my:[`mt`,`mb`],size:[`w`,`h`],"font-size":[`leading`],"fvn-normal":[`fvn-ordinal`,`fvn-slashed-zero`,`fvn-figure`,`fvn-spacing`,`fvn-fraction`],"fvn-ordinal":[`fvn-normal`],"fvn-slashed-zero":[`fvn-normal`],"fvn-figure":[`fvn-normal`],"fvn-spacing":[`fvn-normal`],"fvn-fraction":[`fvn-normal`],"line-clamp":[`display`,`overflow`],rounded:[`rounded-s`,`rounded-e`,`rounded-t`,`rounded-r`,`rounded-b`,`rounded-l`,`rounded-ss`,`rounded-se`,`rounded-ee`,`rounded-es`,`rounded-tl`,`rounded-tr`,`rounded-br`,`rounded-bl`],"rounded-s":[`rounded-ss`,`rounded-es`],"rounded-e":[`rounded-se`,`rounded-ee`],"rounded-t":[`rounded-tl`,`rounded-tr`],"rounded-r":[`rounded-tr`,`rounded-br`],"rounded-b":[`rounded-br`,`rounded-bl`],"rounded-l":[`rounded-tl`,`rounded-bl`],"border-spacing":[`border-spacing-x`,`border-spacing-y`],"border-w":[`border-w-x`,`border-w-y`,`border-w-s`,`border-w-e`,`border-w-bs`,`border-w-be`,`border-w-t`,`border-w-r`,`border-w-b`,`border-w-l`],"border-w-x":[`border-w-r`,`border-w-l`],"border-w-y":[`border-w-t`,`border-w-b`],"border-color":[`border-color-x`,`border-color-y`,`border-color-s`,`border-color-e`,`border-color-bs`,`border-color-be`,`border-color-t`,`border-color-r`,`border-color-b`,`border-color-l`],"border-color-x":[`border-color-r`,`border-color-l`],"border-color-y":[`border-color-t`,`border-color-b`],translate:[`translate-x`,`translate-y`,`translate-none`],"translate-none":[`translate`,`translate-x`,`translate-y`,`translate-z`],"scroll-m":[`scroll-mx`,`scroll-my`,`scroll-ms`,`scroll-me`,`scroll-mbs`,`scroll-mbe`,`scroll-mt`,`scroll-mr`,`scroll-mb`,`scroll-ml`],"scroll-mx":[`scroll-mr`,`scroll-ml`],"scroll-my":[`scroll-mt`,`scroll-mb`],"scroll-p":[`scroll-px`,`scroll-py`,`scroll-ps`,`scroll-pe`,`scroll-pbs`,`scroll-pbe`,`scroll-pt`,`scroll-pr`,`scroll-pb`,`scroll-pl`],"scroll-px":[`scroll-pr`,`scroll-pl`],"scroll-py":[`scroll-pt`,`scroll-pb`],touch:[`touch-x`,`touch-y`,`touch-pz`],"touch-x":[`touch`],"touch-y":[`touch`],"touch-pz":[`touch`]},conflictingClassGroupModifiers:{"font-size":[`leading`]},orderSensitiveModifiers:[`*`,`**`,`after`,`backdrop`,`before`,`details-content`,`file`,`first-letter`,`first-line`,`marker`,`placeholder`,`selection`]}});function U(...e){return nr(kt(e))}function rr(e){let t=Math.max(0,Math.floor((Date.now()-e*1e3)/1e3));if(t<60)return`${t}s ago`;let n=Math.floor(t/60);if(n<60)return`${n}m ago`;let r=Math.floor(n/60);if(r<24)return`${r}h ago`;let a=Math.floor(r/24);return a<30?`${a}d ago`:`${Math.floor(a/30)}mo ago`}function ir(e){return new Date(e*1e3).toLocaleString(void 0,{year:`numeric`,month:`short`,day:`numeric`,hour:`2-digit`,minute:`2-digit`,second:`2-digit`})}function ar(e,t){try{let e=JSON.parse(t);if(!e||typeof e!=`object`)return t;for(let t of[`command`,`CommandLine`,`Input`,`query`,`Task`,`Prompt`])if(typeof e[t]==`string`&&e[t].length>0)return e[t];for(let t of[`file_path`,`path`,`TargetFile`,`AbsolutePath`,`SearchPath`,`DirectoryPath`,`Url`,`ImageName`])if(typeof e[t]==`string`&&e[t].length>0)return e[t];for(let t of Object.values(e))if(typeof t==`string`&&t.length>0)return t;return``}catch{return t}}var or=s((e=>{var t=Symbol.for(`react.transitional.element`),n=Symbol.for(`react.fragment`);function r(e,n,r){var a=null;if(r!==void 0&&(a=``+r),n.key!==void 0&&(a=``+n.key),`key`in n)for(var o in r={},n)o!==`key`&&(r[o]=n[o]);else r=n;return n=r.ref,{$$typeof:t,type:e,key:a,ref:n===void 0?null:n,props:r}}e.Fragment=n,e.jsx=r,e.jsxs=r})),W=s(((e,t)=>{t.exports=or()}))(),sr=Mt(`flex flex-col min-h-0 overflow-hidden rounded-sm border bg-[var(--color-surface-1)] border-[var(--color-line-1)]`,{variants:{variant:{default:``,interactive:`hover:border-[var(--color-line-2)] hover:bg-[var(--color-surface-2)] transition-colors cursor-pointer`,flush:`bg-transparent border-[var(--color-line-0)]`}},defaultVariants:{variant:`default`}});function G({className:e,variant:t,...n}){return(0,W.jsx)(`div`,{className:U(sr({variant:t,className:e})),...n})}function K({className:e,...t}){return(0,W.jsx)(`div`,{className:U(`flex items-center justify-between gap-2 px-3 pt-2 pb-1 shrink-0`,e),...t})}function q({className:e,...t}){return(0,W.jsx)(`div`,{className:U(`px-3 py-3 flex-1 min-h-0 overflow-auto`,e),...t})}var cr=Mt(`inline-flex items-center gap-1 rounded-sm px-1.5 py-0.5 text-[10px] font-mono font-medium leading-none tracking-wide uppercase border whitespace-nowrap`,{variants:{variant:{green:`bg-emerald-500/8 text-emerald-300 border-emerald-500/25`,red:`bg-red-500/8 text-red-300 border-red-500/25`,amber:`bg-amber-500/10 text-amber-300 border-amber-500/30`,blue:`bg-sky-500/8 text-sky-300 border-sky-500/25`,gray:`bg-[var(--color-surface-2)] text-[var(--color-fg-3)] border-[var(--color-line-1)]`,purple:`bg-violet-500/8 text-violet-300 border-violet-500/25`,outline:`bg-transparent text-[var(--color-fg-3)] border-[var(--color-line-1)]`}},defaultVariants:{variant:`outline`}});function lr({className:e,variant:t,...n}){return(0,W.jsx)(`span`,{className:U(cr({variant:t,className:e})),...n})}var ur=Mt(`relative inline-flex items-center justify-center gap-1.5 whitespace-nowrap rounded-sm text-xs font-medium tracking-wide transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-[var(--color-brand)] focus-visible:ring-offset-1 focus-visible:ring-offset-[var(--color-surface-0)] disabled:pointer-events-none disabled:opacity-40 cursor-pointer overflow-hidden`,{variants:{variant:{primary:`bg-[var(--color-brand)] text-black hover:bg-[var(--color-brand-hover)]`,secondary:`bg-[var(--color-surface-1)] border border-[var(--color-line-1)] text-[var(--color-fg-1)] hover:border-[var(--color-line-2)] hover:bg-[var(--color-surface-2)]`,ghost:`text-[var(--color-fg-2)] hover:text-[var(--color-fg-0)] hover:bg-[var(--color-surface-2)] border border-transparent`,danger:`bg-red-500/5 border border-red-500/30 text-red-300 hover:border-red-500/60 hover:bg-red-500/10 hover:text-red-200`},size:{sm:`h-6 px-2`,md:`h-8 px-3`,icon:`h-7 w-7 p-0`}},defaultVariants:{variant:`primary`,size:`md`}});function dr(e,t){if(ct())return;let n=e.getBoundingClientRect(),r=Math.hypot(n.width,n.height),a=document.createElement(`span`);a.style.position=`absolute`,a.style.left=`${t.clientX-n.left-r/2}px`,a.style.top=`${t.clientY-n.top-r/2}px`,a.style.width=`${r}px`,a.style.height=`${r}px`,a.style.borderRadius=`50%`,a.style.pointerEvents=`none`,a.style.background=`currentColor`,a.style.opacity=`0.22`,a.style.transform=`scale(0)`,a.style.mixBlendMode=`screen`,e.appendChild(a),Et(a,{scale:[0,1],opacity:[.22,0],duration:540,ease:`outExpo`,onComplete:()=>{a.remove()}})}var J=v.forwardRef(({className:e,variant:t,size:n,onMouseDown:r,onClick:a,...o},s)=>(0,W.jsx)(`button`,{ref:s,className:U(ur({variant:t,size:n,className:e})),onMouseDown:e=>{dr(e.currentTarget,e),r?.(e)},onClick:a,...o}));J.displayName=`Button`;var fr=e=>Math.round(e).toLocaleString(void 0,{useGrouping:!0});function pr(e,t){if(e===`cubic`)return{ease:Fe.out,durationMs:t};if(e===`elastic`)return{ease:We(1.05,.45),durationMs:t};let n=et({stiffness:180,damping:22,mass:1});return{ease:n.fn,durationMs:n.duration}}function mr({value:e,duration:t=320,format:n=fr,curve:r=`spring`,className:a}){let[o,s]=(0,v.useState)(e),c=(0,v.useRef)(e),l=(0,v.useRef)(e),u=(0,v.useRef)(0),d=(0,v.useRef)(null),f=(0,v.useRef)(ct());return(0,v.useEffect)(()=>{if(l.current===e)return;if(f.current){l.current=e,c.current=e,s(e);return}c.current=o,l.current=e,u.current=performance.now(),d.current!==null&&cancelAnimationFrame(d.current);let{ease:n,durationMs:a}=pr(r,t),p=e=>{let t=Math.min(1,(e-u.current)/a),r=n(t);s(c.current+(l.current-c.current)*r),t<1?d.current=requestAnimationFrame(p):d.current=null};return d.current=requestAnimationFrame(p),()=>{d.current!==null&&(cancelAnimationFrame(d.current),d.current=null)}},[e,t,r]),(0,W.jsx)(`span`,{className:U(`tabular-nums`,a),children:n(o)})}function hr({data:e,width:t=80,height:n=24,color:r=`#38bdf8`,threshold:a,maxValue:o}){if(e.length<2)return(0,W.jsx)(`svg`,{width:t,height:n,className:`shrink-0`,children:(0,W.jsx)(`line`,{x1:0,y1:n/2,x2:t,y2:n/2,stroke:`var(--color-line-2)`,strokeWidth:1})});let s=o??Math.max(...e,1),c=t-2,l=n-2,u=e.map((t,n)=>{let r=1+n/(e.length-1)*c,a=1+l-t/s*l;return`${r.toFixed(1)},${a.toFixed(1)}`}),d=a===void 0?null:1+l-Math.min(a,s)/s*l;return(0,W.jsxs)(`svg`,{width:t,height:n,className:`shrink-0`,children:[(0,W.jsx)(`polyline`,{points:u.join(` `),fill:`none`,stroke:r,strokeWidth:1.5,strokeLinejoin:`round`,strokeLinecap:`round`}),d!==null&&(0,W.jsx)(`line`,{x1:1,y1:d,x2:t-1,y2:d,stroke:`var(--color-brand)`,strokeWidth:1,strokeDasharray:`3,2`,opacity:.7})]})}var gr=new Set,_r=0;function vr(){for(let e of gr)e();gr.size>0&&(_r=requestAnimationFrame(vr))}function yr(e){return gr.add(e),gr.size===1&&(_r=requestAnimationFrame(vr)),()=>{gr.delete(e),gr.size===0&&(cancelAnimationFrame(_r),_r=0)}}function br(){return typeof window>`u`||!window.matchMedia?!1:window.matchMedia(`(prefers-reduced-motion: reduce)`).matches}function xr({value:e,samples:t,maxValue:n,width:r=320,height:a=64,windowMs:o=6e4,color:s=`var(--color-brand)`,fillColor:c=`rgba(245, 158, 11, 0.12)`,className:l}){let u=(0,v.useRef)(null),d=(0,v.useRef)(null),f=(0,v.useRef)([]),p=(0,v.useRef)(t??null),m=(0,v.useRef)(e??0),h=(0,v.useRef)(br());return(0,v.useEffect)(()=>{p.current=t??null},[t]),(0,v.useEffect)(()=>{t===void 0&&e!==void 0&&e!==m.current&&(m.current=e,f.current.push({ts:Date.now(),v:e}),f.current.length>600&&f.current.splice(0,f.current.length-600))},[e,t]),(0,v.useEffect)(()=>{let e=()=>{let e=Date.now(),t=e-o,s;if(p.current){let e=p.current;s=[];for(let n of e)n.ts>=t&&s.push(n)}else{let n=f.current;for(;n.length>1&&n[1].ts<t;)n.shift();(n.length===0||n[n.length-1].ts<e-200)&&n.push({ts:e,v:m.current}),s=n.filter(e=>e.ts>=t)}if(s.length<2)u.current&&u.current.setAttribute(`points`,``),d.current&&d.current.setAttribute(`points`,``);else{let e=n??Math.max(1,...s.map(e=>e.v)),c=[];for(let n of s){let s=(n.ts-t)/o*r,l=a-n.v/e*(a-2)-1;c.push(`${s.toFixed(1)},${l.toFixed(1)}`)}let l=c.join(` `);if(u.current&&u.current.setAttribute(`points`,l),d.current){let e=c[0].split(`,`),t=c[c.length-1].split(`,`),n=`${e[0]},${a} ${l} ${t[0]},${a}`;d.current.setAttribute(`points`,n)}}};if(h.current){let t=window.setInterval(e,500);return()=>clearInterval(t)}return yr(e)},[r,a,o,n]),(0,W.jsxs)(`svg`,{width:`100%`,height:a,viewBox:`0 0 ${r} ${a}`,className:U(`block`,l),preserveAspectRatio:`none`,children:[(0,W.jsx)(`polygon`,{ref:d,fill:c,stroke:`none`}),(0,W.jsx)(`polyline`,{ref:u,fill:`none`,stroke:s,strokeWidth:1.5,strokeLinejoin:`round`,strokeLinecap:`round`})]})}var Sr=Mt(`hero-metric relative flex flex-col gap-2 rounded-sm border bg-[var(--color-surface-1)] border-[var(--color-line-1)] px-4 py-3 overflow-hidden`,{variants:{tone:{neutral:`hero-metric--neutral`,amber:`hero-metric--amber`,green:`hero-metric--green`,red:`hero-metric--red`,blue:`hero-metric--blue`,purple:`hero-metric--purple`,gray:`hero-metric--gray`}},defaultVariants:{tone:`neutral`}}),Cr={neutral:`var(--color-fg-1)`,amber:`var(--color-brand)`,green:`#34d399`,red:`#f87171`,blue:`#38bdf8`,purple:`#a78bfa`,gray:`var(--color-fg-3)`},wr={neutral:`rgba(214, 215, 217, 0.10)`,amber:`rgba(245, 158, 11, 0.14)`,green:`rgba(52, 211, 153, 0.14)`,red:`rgba(248, 113, 113, 0.14)`,blue:`rgba(56, 189, 248, 0.14)`,purple:`rgba(167, 139, 250, 0.14)`,gray:`rgba(110, 112, 118, 0.10)`},Tr={neutral:`text-[var(--color-fg-0)]`,amber:`text-amber-300`,green:`text-emerald-300`,red:`text-red-300`,blue:`text-sky-300`,purple:`text-violet-300`,gray:`text-[var(--color-fg-2)]`},Er=1e3,Dr=.35;function Or(e,t,n){let r=Date.now(),a=r-n,o=Math.max(2,Math.floor(n/Er)),s=Array(o).fill(0);for(let n of e){if(t&&!t(n)||n.ts_ms<a||n.ts_ms>r)continue;let e=o-1-Math.floor((r-n.ts_ms)/Er);e>=0&&e<o&&s[e]++}let c=Array(o),l=s[0];for(let e=0;e<o;e++)l=Dr*s[e]+(1-Dr)*l,c[e]={ts:a+(e+1)*Er,v:l};return c}function kr({label:e,value:t,series:n,burstRing:r,filter:a,sparkWindowMs:o=6e4,sub:s,tone:c,format:l,className:u,...d}){let f=c??`neutral`,p=Cr[f]??Cr.neutral,m=wr[f]??wr.neutral,h=Tr[f]??Tr.neutral,g=(0,v.useRef)(null),_=(0,v.useRef)(t);(0,v.useEffect)(()=>{if(_.current===t)return;_.current=t;let e=g.current;e&&Et(e,{"--tick":[0,1],duration:160,ease:`outCubic`,onComplete:()=>{Et(e,{"--tick":[1,0],duration:520,ease:`outElastic(1, 0.6)`,onComplete:e=>{e.style.removeProperty(`--tick`)}})}})},[t]);let y=(0,v.useMemo)(()=>r?Or(r,a,o):null,[r,a,o]),b=y!==null,x=!b&&n&&n.length>=2;return(0,W.jsxs)(`div`,{ref:g,className:U(Sr({tone:c,className:u})),...d,children:[(0,W.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,W.jsx)(`span`,{className:`overline`,children:e}),s?(0,W.jsx)(`span`,{className:`text-[10px] font-mono text-[var(--color-fg-3)] tabular-nums`,children:s}):null]}),(0,W.jsxs)(`div`,{className:`flex items-end justify-between gap-3`,children:[(0,W.jsx)(mr,{value:t,format:l,className:U(`text-[2.4rem] leading-none font-semibold tracking-tight`,h)}),b?(0,W.jsx)(xr,{samples:y,width:108,height:36,windowMs:o,color:p,fillColor:m,className:`shrink-0`}):x?(0,W.jsx)(hr,{data:n,width:96,height:28,color:p}):null]})]})}var Ar=135,jr=405,Mr=jr-Ar,Nr=`#34d399`,Pr=`#f59e0b`,Fr=`#ef4444`;function Ir(e,t,n,r){let a=(r-90)*(Math.PI/180);return{x:e+n*Math.cos(a),y:t+n*Math.sin(a)}}function Lr(e,t,n,r,a){let o=Ir(e,t,n,r),s=Ir(e,t,n,a),c=a-r>180?1:0;return`M ${o.x.toFixed(2)} ${o.y.toFixed(2)} A ${n} ${n} 0 ${c} 1 ${s.x.toFixed(2)} ${s.y.toFixed(2)}`}function Rr(e,t){return Ar+Math.max(0,Math.min(1,e/Math.max(t,1e-9)))*Mr}function zr(e,t,n){return e+(t-e)*n}function Br(e){let t=parseInt(e.slice(1),16);return[t>>16&255,t>>8&255,t&255]}function Vr(e,t,n){let[r,a,o]=Br(e),[s,c,l]=Br(t);return`rgb(${Math.round(zr(r,s,n))},${Math.round(zr(a,c,n))},${Math.round(zr(o,l,n))})`}function Hr(e,t,n){let r=.04;return e<t-r?Nr:e<t+r?Vr(Nr,Pr,(e-(t-r))/(r*2)):e<n-r?Pr:e<n+r?Vr(Pr,Fr,(e-(n-r))/(r*2)):Fr}function Ur(){return typeof window>`u`||!window.matchMedia?!1:window.matchMedia(`(prefers-reduced-motion: reduce)`).matches}var Wr=0;function Gr(){return Wr=Wr+1|0,Wr.toString(36)}function Kr(){if(typeof crypto<`u`&&crypto.getRandomValues){let e=new Uint32Array(1);return crypto.getRandomValues(e),e[0]/4294967296*Math.PI*2}return 0}function qr({value:e,max:t,warnAt:n=.7,critAt:r=.9,marker50:a,marker99:o,label:s,display:c,displayFormat:l,scaleLabels:u,mode:d=`needle`,size:f=180,className:p,revLights:m=!0,revLightCount:h=20}){let g=Math.ceil(d===`needle`&&u!==void 0?f*.2:f*.08),_=-g,y=-g,b=f+g*2,x=f+g*2,S=f/2,C=f/2,w=f*.42,T=Math.max(0,Math.min(1,e/Math.max(t,1e-9))),E=(0,v.useMemo)(()=>Lr(S,C,w,Ar,jr),[S,C,w]),D=(0,v.useMemo)(()=>Lr(S,C,w-8,Ar,jr),[S,C,w]),O=Ar+n*Mr,k=Ar+r*Mr,A=(0,v.useMemo)(()=>Lr(S,C,w,Ar,O),[S,C,w,O]),ee=(0,v.useMemo)(()=>Lr(S,C,w,O,k),[S,C,w,O,k]),j=(0,v.useMemo)(()=>Lr(S,C,w,k,jr),[S,C,w,k]),M=(0,v.useMemo)(()=>Lr(S,C,w-14,300,420),[S,C,w]),te=Ar+T*Mr,ne=(0,v.useMemo)(()=>Lr(S,C,w,Ar,Math.max(Ar+.01,te)),[S,C,w,te]),re=Hr(T,n,r),N=(0,v.useMemo)(()=>Gr(),[]),P=`lgf-${N}`,ie=`lgfn-${N}`,ae=`lgb-${N}`,oe=`lgd-${N}`,F=`lgh-${N}`,I=`lgg-${N}`,L=`lgl-${N}`,se=(0,v.useMemo)(()=>{if(d!==`needle`)return[];let e=[];for(let t=0;t<=10;t++)e.push(Ar+t/10*Mr);return e},[d]),R=(0,v.useMemo)(()=>{if(d!==`needle`)return[];let e=[];for(let t=0;t<=40;t++)t%4!=0&&e.push(Ar+t/40*Mr);return e},[d]),ce=(0,v.useRef)(null),le=(0,v.useRef)(null),ue=(0,v.useRef)(null),de=(0,v.useRef)(null),fe=(0,v.useRef)(null),pe=(0,v.useRef)(null),me=(0,v.useRef)(null),he=(0,v.useRef)(null),ge=(0,v.useRef)([]),_e=(0,v.useRef)(e),ve=(0,v.useRef)(t),ye=(0,v.useRef)(n),be=(0,v.useRef)(r);(0,v.useEffect)(()=>{_e.current=e,ve.current=t,ye.current=n,be.current=r},[e,t,n,r]);let xe=(0,v.useMemo)(()=>{if(!m||d!==`needle`)return[];let e=Math.max(4,h),t=w-11,n=[];for(let r=0;r<e;r++){let a=Ar+(r+.5)/e*Mr;n.push(Ir(S,C,t,a))}return n},[m,h,d,S,C,w]);ge.current.length!==xe.length&&(ge.current.length=xe.length);let Se=S+w-6,Ce=S+f*.04,we=Math.max(2,f*.016),Te=`${Se},${C} ${Ce},${C-we} ${Ce},${C+we}`,Ee=S-f*.04,De=S-w*.24,Oe=Math.max(1.4,f*.012),ke=`${De},${C} ${Ee},${C-Oe} ${Ee},${C+Oe}`,Ae=f*.48,je=f*.17,z=S-Ae/2,Me=C+f*.16,Ne=Me+je*.68;return(0,v.useEffect)(()=>{let e=Ur(),t=0,n=!1,r=performance.now(),a=Kr(),o=Kr(),s=Kr(),c=_e.current,u=0,f=_e.current,p=0,h=_e.current,g=_=>{let v=(_-r)/1e3;r=_;let y=Math.min(.04,Math.max(.001,v)),b=_e.current,x=ve.current,T=ye.current,E=be.current,D=Math.max(x,1e-9),O=b;if(!e&&d===`needle`){let e=Math.max(0,Math.min(1,c/D)),t=_/1e3,n=(D*.004+D*.016*e*e)*(Math.sin(t*8.7+a)*.46+Math.sin(t*14.3+o)*.31+Math.sin(t*23.7+s)*.23);O=Math.max(0,Math.min(x,b+n))}if(e)c=b,f=b,h=b,u=0,p=0;else{let e=y/2;for(let t=0;t<2;t++){let t=-210*(c-O)-22*u;u+=t*e,c+=u*e;let n=-55*(f-c)-13*p;p+=n*e,f+=p*e}let t=1-Math.exp(-y*8);h+=(b-h)*t,Math.abs(h-b)<D*1e-5&&(h=b)}let k=Math.max(0,Math.min(1,c/Math.max(x,1e-9))),A=Ar+k*Mr,ee=Ar+Math.max(0,Math.min(1,f/Math.max(x,1e-9)))*Mr,j=Hr(k,T,E);if(ce.current&&ce.current.setAttribute(`transform`,`rotate(${(A-90).toFixed(3)} ${S} ${C})`),le.current&&le.current.setAttribute(`fill`,j),ue.current&&ue.current.setAttribute(`fill`,j),de.current&&de.current.setAttribute(`stroke`,j),fe.current&&fe.current.setAttribute(`transform`,`rotate(${(ee-90).toFixed(3)} ${S} ${C})`),pe.current&&pe.current.setAttribute(`fill`,j),me.current&&l&&(me.current.textContent=l(h)),he.current&&d===`ring`){let e=Math.max(Ar+.01,A);he.current.setAttribute(`d`,Lr(S,C,w,Ar,e)),he.current.setAttribute(`stroke`,j)}if(m&&d===`needle`){let e=ge.current,t=e.length;if(t>0){let n=1/t;for(let r=0;r<t;r++){let a=e[r];if(!a)continue;let o=(r+.5)/t,s=k-o,c=Math.max(0,Math.min(1,.5+s/n));a.setAttribute(`fill`,Hr(o,T,E)),a.setAttribute(`opacity`,c.toFixed(3))}}}n||(t=requestAnimationFrame(g))};return t=requestAnimationFrame(g),()=>{n=!0,cancelAnimationFrame(t)}},[S,C,w,d,m,l]),(0,W.jsxs)(`div`,{className:U(`flex flex-col items-center justify-center gap-1 min-h-0 min-w-0`,p),children:[(0,W.jsxs)(`svg`,{width:b,height:x,viewBox:`${_} ${y} ${b} ${x}`,preserveAspectRatio:`xMidYMid meet`,className:`block max-w-full max-h-full min-h-0`,children:[(0,W.jsxs)(`defs`,{children:[(0,W.jsxs)(`filter`,{id:P,x:`-40%`,y:`-40%`,width:`180%`,height:`180%`,children:[(0,W.jsx)(`feGaussianBlur`,{stdDeviation:`1.2`,result:`blur`}),(0,W.jsxs)(`feMerge`,{children:[(0,W.jsx)(`feMergeNode`,{in:`blur`}),(0,W.jsx)(`feMergeNode`,{in:`SourceGraphic`})]})]}),(0,W.jsxs)(`filter`,{id:ie,x:`-60%`,y:`-60%`,width:`220%`,height:`220%`,children:[(0,W.jsx)(`feGaussianBlur`,{stdDeviation:`2.2`,result:`nb`}),(0,W.jsxs)(`feMerge`,{children:[(0,W.jsx)(`feMergeNode`,{in:`nb`}),(0,W.jsx)(`feMergeNode`,{in:`SourceGraphic`})]})]}),(0,W.jsxs)(`radialGradient`,{id:ae,cx:`50%`,cy:`32%`,r:`80%`,children:[(0,W.jsx)(`stop`,{offset:`0%`,stopColor:`#4e535d`}),(0,W.jsx)(`stop`,{offset:`55%`,stopColor:`#2a2e36`}),(0,W.jsx)(`stop`,{offset:`100%`,stopColor:`#0b0d11`})]}),(0,W.jsxs)(`radialGradient`,{id:oe,cx:`50%`,cy:`45%`,r:`75%`,children:[(0,W.jsx)(`stop`,{offset:`0%`,stopColor:`#1b1f27`}),(0,W.jsx)(`stop`,{offset:`80%`,stopColor:`#0a0c10`}),(0,W.jsx)(`stop`,{offset:`100%`,stopColor:`#05060a`})]}),(0,W.jsxs)(`radialGradient`,{id:F,cx:`40%`,cy:`30%`,r:`70%`,children:[(0,W.jsx)(`stop`,{offset:`0%`,stopColor:`#f4f5f8`}),(0,W.jsx)(`stop`,{offset:`45%`,stopColor:`#aab1bd`}),(0,W.jsx)(`stop`,{offset:`100%`,stopColor:`#1c1f26`})]}),(0,W.jsxs)(`linearGradient`,{id:I,x1:`50%`,y1:`0%`,x2:`50%`,y2:`100%`,children:[(0,W.jsx)(`stop`,{offset:`0%`,stopColor:`#ffffff`,stopOpacity:`0.22`}),(0,W.jsx)(`stop`,{offset:`100%`,stopColor:`#ffffff`,stopOpacity:`0`})]}),(0,W.jsxs)(`linearGradient`,{id:L,x1:`50%`,y1:`0%`,x2:`50%`,y2:`100%`,children:[(0,W.jsx)(`stop`,{offset:`0%`,stopColor:`#0a0c11`}),(0,W.jsx)(`stop`,{offset:`100%`,stopColor:`#15181f`})]})]}),d===`needle`?(0,W.jsxs)(W.Fragment,{children:[(0,W.jsx)(`circle`,{cx:S,cy:C,r:w+12,fill:`url(#${ae})`,stroke:`#000`,strokeOpacity:.55,strokeWidth:1}),(0,W.jsx)(`circle`,{cx:S,cy:C,r:w+5,fill:`none`,stroke:`#0a0c11`,strokeWidth:1}),(0,W.jsx)(`circle`,{cx:S,cy:C,r:w-2,fill:`url(#${oe})`})]}):null,(0,W.jsx)(`path`,{d:E,fill:`none`,stroke:`var(--color-line-1)`,strokeWidth:d===`ring`?12:3,strokeLinecap:`round`,opacity:d===`ring`?1:.35}),d===`needle`?(0,W.jsx)(`path`,{d:D,fill:`none`,stroke:`var(--color-line-0)`,strokeWidth:1,strokeLinecap:`round`,opacity:.55}):null,d===`needle`?(0,W.jsxs)(W.Fragment,{children:[(0,W.jsx)(`path`,{d:A,fill:`none`,stroke:Nr,strokeWidth:5,strokeLinecap:`round`,opacity:.78}),(0,W.jsx)(`path`,{d:ee,fill:`none`,stroke:Pr,strokeWidth:5,strokeLinecap:`round`,opacity:.82}),(0,W.jsx)(`path`,{d:j,fill:`none`,stroke:Fr,strokeWidth:5,strokeLinecap:`round`,opacity:.9}),R.map((e,t)=>{let n=Ir(S,C,w-4,e),r=Ir(S,C,w+2,e);return(0,W.jsx)(`line`,{x1:n.x,y1:n.y,x2:r.x,y2:r.y,stroke:`var(--color-fg-4)`,strokeWidth:.9,strokeLinecap:`round`,opacity:.7},`mi-${t}`)}),se.map((e,t)=>{let n=Ir(S,C,w-8,e),r=Ir(S,C,w+4,e);return(0,W.jsx)(`line`,{x1:n.x,y1:n.y,x2:r.x,y2:r.y,stroke:`var(--color-fg-2)`,strokeWidth:1.8,strokeLinecap:`round`},`ma-${t}`)}),m?xe.map((e,t)=>(0,W.jsx)(`circle`,{ref:e=>{ge.current[t]=e},cx:e.x,cy:e.y,r:Math.max(1.6,f*.013),fill:Nr,opacity:0,filter:`url(#${P})`},t)):null,a===void 0?null:(0,W.jsx)(Jr,{cx:S,cy:C,r:w,angle:Rr(a,t),emphasis:!0}),o===void 0?null:(0,W.jsx)(Jr,{cx:S,cy:C,r:w,angle:Rr(o,t),emphasis:!0}),u?(0,W.jsxs)(W.Fragment,{children:[(0,W.jsx)(Yr,{cx:S,cy:C,r:w,angle:O,text:u(n),size:f}),(0,W.jsx)(Yr,{cx:S,cy:C,r:w,angle:k,text:u(r),size:f}),(0,W.jsx)(Yr,{cx:S,cy:C,r:w,angle:jr,text:u(1),size:f})]}):null,(0,W.jsx)(`path`,{d:M,fill:`none`,stroke:`url(#${I})`,strokeWidth:f*.14,strokeLinecap:`butt`}),l||c!==void 0?(0,W.jsxs)(W.Fragment,{children:[(0,W.jsx)(`rect`,{x:z,y:Me,width:Ae,height:je,rx:f*.022,ry:f*.022,fill:`url(#${L})`,stroke:`#242a33`,strokeWidth:1}),(0,W.jsx)(`rect`,{x:z+1,y:Me+1,width:Ae-2,height:1,fill:`#ffffff`,opacity:.08})]}):null,(0,W.jsx)(`g`,{ref:fe,opacity:.28,children:(0,W.jsx)(`polygon`,{ref:pe,points:Te,fill:re,filter:`url(#${ie})`})}),(0,W.jsxs)(`g`,{ref:ce,children:[(0,W.jsx)(`polygon`,{ref:le,points:Te,fill:re,stroke:`#05070a`,strokeWidth:.6,filter:`url(#${ie})`}),(0,W.jsx)(`polygon`,{ref:ue,points:ke,fill:re,opacity:.7})]}),(0,W.jsx)(`circle`,{cx:S,cy:C,r:f*.06,fill:`url(#${F})`,stroke:`#06080c`,strokeWidth:1}),(0,W.jsx)(`circle`,{ref:de,cx:S,cy:C,r:f*.036,fill:`#0a0c11`,stroke:re,strokeWidth:1.4}),(0,W.jsx)(`circle`,{cx:S,cy:C,r:f*.012,fill:`#f5f7fb`,opacity:.9})]}):(0,W.jsx)(`path`,{ref:he,d:ne,fill:`none`,stroke:re,strokeWidth:12,strokeLinecap:`round`}),d===`needle`&&(l||c!==void 0)?l?(0,W.jsx)(`text`,{ref:me,x:S,y:Ne,textAnchor:`middle`,dominantBaseline:`middle`,className:`font-mono tabular-nums`,fontSize:f*.1,fontWeight:600,fill:`#e8ecf3`,children:l(e)}):(0,W.jsx)(`text`,{x:S,y:Ne,textAnchor:`middle`,dominantBaseline:`middle`,className:`font-mono tabular-nums`,fontSize:f*.1,fontWeight:600,fill:`#e8ecf3`,children:c}):l?(0,W.jsx)(`text`,{ref:me,x:S,y:C+4,textAnchor:`middle`,className:`font-mono tabular-nums`,fontSize:f*.13,fill:`var(--color-fg-0)`,children:l(e)}):c===void 0?null:(0,W.jsx)(`text`,{x:S,y:C+4,textAnchor:`middle`,className:`font-mono tabular-nums`,fontSize:f*.13,fill:`var(--color-fg-0)`,children:c})]}),s?(0,W.jsx)(`span`,{className:`overline shrink-0 tracking-[0.12em] uppercase`,children:s}):null]})}function Jr({cx:e,cy:t,r:n,angle:r,emphasis:a=!1}){let o=Ir(e,t,n-(a?10:6),r),s=Ir(e,t,n+(a?8:6),r);return(0,W.jsx)(`line`,{x1:o.x,y1:o.y,x2:s.x,y2:s.y,stroke:a?`var(--color-fg-1)`:`var(--color-fg-2)`,strokeWidth:a?2:1.5,strokeLinecap:`round`})}function Yr({cx:e,cy:t,r:n,angle:r,text:a,size:o}){let s=Ir(e,t,n+Math.max(16,o*.1),r),c=r>=135&&r<215?`end`:r>=325?`start`:`middle`;return(0,W.jsx)(`text`,{x:s.x,y:s.y,textAnchor:c,dominantBaseline:`middle`,className:`font-mono tabular-nums`,fontSize:o*.062,fontWeight:600,fill:`var(--color-fg-2)`,stroke:`var(--color-bg-0)`,strokeWidth:3,paintOrder:`stroke`,children:a})}var Xr={containerPaddingY:24,containerPaddingX:24,topToTrendGap:12,scatterHeaderH:18,scatterLegendH:16,scatterInnerGap:8,trendRowH:28,trendRowGap:6,trendTopPad:9,scatterAbsoluteMin:60,scatterAcceptableMin:70,gaugeFootprintFactor:1.36,gaugeAbsoluteMin:84,gaugeAbsoluteMax:240};function Zr(e,t,n=200){let r=Math.max(0,Math.floor(e)),a=Math.max(0,Math.floor(t)),o=Math.max(0,r-Xr.containerPaddingX),s=Math.max(0,a-Xr.containerPaddingY),c=s-(Xr.trendRowH*3+Xr.trendRowGap*2+Xr.trendTopPad+Xr.topToTrendGap),l=c-Xr.scatterHeaderH-Xr.scatterLegendH-Xr.scatterInnerGap>=Xr.scatterAcceptableMin,u=l?c:s,d=u-Xr.scatterHeaderH-Xr.scatterLegendH-Xr.scatterInnerGap,f=d>=Xr.scatterAbsoluteMin,p=d>=Xr.scatterAbsoluteMin&&u>=140,m=Math.floor(u/Xr.gaugeFootprintFactor),h=Math.floor(o*.45/Xr.gaugeFootprintFactor),g=Math.max(Xr.gaugeAbsoluteMin,Math.min(Xr.gaugeAbsoluteMax,n,m,h)),_=Math.ceil(g*Xr.gaugeFootprintFactor+8),v=u-(f?Xr.scatterHeaderH:0)-(p?Xr.scatterLegendH:0)-Xr.scatterInnerGap;return{gaugeSize:g,gaugeColumnMaxWidth:_,scatterMinHeight:Math.max(Xr.scatterAbsoluteMin,Math.min(160,v)),showTrendRows:l,showScatterHeader:f,showLegend:p,variant:s>=480?`wide`:s>=300?`normal`:`compact`}}var Qr={allow:`#34d399`,block:`#ef4444`,ask:`#f59e0b`,log:`#a78bfa`,force:`#38bdf8`,shadow:`#6e7076`};function $r(e){return!Number.isFinite(e)||e<=0?`—`:e<1e3?`${e} ns`:e<1e6?`${(e/1e3).toFixed(1)} µs`:`${(e/1e6).toFixed(2)} ms`}function ei({latency:e,bursts:t,gaugeMaxMs:n=10,windowMs:r=3e4,trendWindowSec:a=60,gaugeSize:o=200,compact:s=!1,className:c}){let l=e?e.p50_ns/1e6:0,u=e?e.p95_ns/1e6:0,d=e?e.p99_ns/1e6:0,f=(0,v.useRef)(null),[p,m]=(0,v.useState)((0,v.useMemo)(()=>Zr(o*2,o*2,o),[o]));(0,v.useEffect)(()=>{let e=f.current;if(!e||typeof ResizeObserver>`u`)return;let t=0,n=0,r=0,a=e=>{let t=Math.round(e.width),a=Math.round(e.height);t===n&&a===r||(n=t,r=a,m(Zr(t,a,o)))};a(e.getBoundingClientRect());let s=new ResizeObserver(e=>{let n=e[0];n&&(t&&cancelAnimationFrame(t),t=requestAnimationFrame(()=>{a(n.contentRect)}))});return s.observe(e),()=>{t&&cancelAnimationFrame(t),s.disconnect()}},[o]);let h=(0,v.useRef)(null),g=(0,v.useRef)([]),_=(0,v.useRef)(0);(0,v.useEffect)(()=>{if(t.length===0)return;let e=g.current,n=_.current,a=n;for(let r of t)r.ts_ms<=n||(e.push({ts:r.ts_ms,durationNs:r.duration_ns,color:Qr[r.decision]??`#6e7076`}),r.ts_ms>a&&(a=r.ts_ms));_.current=a;let o=Date.now()-r*2;for(;e.length&&e[0].ts<o;)e.shift()},[t,r]),(0,v.useEffect)(()=>{let e=h.current;if(!e)return;let t=e.getContext(`2d`);if(!t)return;let a=0,o=0,s=0,c=8e3,l=.25,u=1e3,d=n*1e6,f=Math.log10(u),p=Math.log10(d);return yr(()=>{let n=window.devicePixelRatio||1,m=e.clientWidth,h=e.clientHeight;if(m===0||h===0)return;(m!==o||h!==s||n!==a)&&(e.width=Math.floor(m*n),e.height=Math.floor(h*n),t.setTransform(n,0,0,n,0,0),o=m,s=h,a=n),t.clearRect(0,0,m,h),t.strokeStyle=`rgba(110, 112, 118, 0.18)`,t.lineWidth=1,t.setLineDash([2,4]);let _=[{ns:1e5,label:`100µs`},{ns:1e6,label:`1ms`},{ns:1e7,label:`10ms`}];t.font=`9px ui-monospace, SFMono-Regular, Menlo, monospace`,t.textBaseline=`middle`,t.fillStyle=`rgba(110, 112, 118, 0.7)`;for(let e of _){if(e.ns<u||e.ns>d)continue;let n=h-(Math.log10(e.ns)-f)/(p-f)*h;t.beginPath(),t.moveTo(0,n),t.lineTo(m-28,n),t.stroke(),t.fillText(e.label,m-26,n)}t.setLineDash([]);let v=Date.now(),y=v-r,b=g.current;for(;b.length&&b[0].ts<y;)b.shift();t.globalCompositeOperation=`source-over`;for(let e of b){let n=(e.ts-y)/r*m,a=Math.max(u,Math.min(d,e.durationNs)),o=h-(Math.log10(a)-f)/(p-f)*h,s=v-e.ts,g;if(s<=c)g=1-s/c*(1-l);else{let e=r-c;g=e>0?Math.max(0,l*(1-(s-c)/e)):0}g<=0||(t.globalAlpha=g,t.fillStyle=e.color,t.beginPath(),t.arc(n,o,2.5,0,Math.PI*2),t.fill())}t.globalAlpha=1,t.fillStyle=`rgba(110, 112, 118, 0.55)`,t.font=`9px ui-monospace, SFMono-Regular, Menlo, monospace`,t.textBaseline=`bottom`,t.textAlign=`left`,t.fillText(`← ${Math.round(r/1e3)} s ago`,4,h-2),t.textAlign=`right`,t.fillText(`now →`,m-4,h-2),t.textAlign=`left`})},[r,n]);let y=(0,v.useRef)({p50:[],p95:[],p99:[]});(0,v.useEffect)(()=>{if(!e)return;let t=y.current,n=Date.now(),r=n-a*1e3,o=(e,t)=>{let a=t/1e6;for(e.length===0&&e.push({ts:r,v:a}),e.push({ts:n,v:a});e.length>1&&e[0].ts<r;)e.shift()};o(t.p50,e.p50_ns),o(t.p95,e.p95_ns),o(t.p99,e.p99_ns)},[e,a]);let b=(0,v.useMemo)(()=>{let e=y.current;return{p50:[...e.p50],p95:[...e.p95],p99:[...e.p99]}},[e]);return(0,W.jsxs)(`div`,{ref:f,"data-lt-variant":p.variant,className:U(`flex h-full min-h-0 flex-col gap-3 overflow-hidden rounded-sm border bg-[var(--color-surface-1)] border-[var(--color-line-1)] p-3`,c),children:[(0,W.jsxs)(`div`,{className:U(`grid gap-3 min-h-0 flex-1`,`grid-cols-[auto_1fr]`),children:[(0,W.jsx)(`div`,{className:`flex items-stretch justify-center overflow-hidden min-h-0 min-w-0`,style:{maxWidth:p.gaugeColumnMaxWidth},children:(0,W.jsx)(qr,{value:u,max:n,warnAt:Math.min(.85,.5/n),critAt:Math.min(.92,2/n),marker50:l,marker99:d,displayFormat:e=>$r(e*1e6),scaleLabels:p.gaugeSize>=130?e=>$r(e*n*1e6):void 0,size:p.gaugeSize,label:`p95 latency`})}),(0,W.jsxs)(`div`,{className:`flex flex-col gap-1 min-w-0 min-h-0 flex-1`,children:[p.showScatterHeader?(0,W.jsxs)(`div`,{className:`flex items-center justify-between gap-3 shrink-0 min-w-0`,children:[(0,W.jsx)(`span`,{className:`overline truncate min-w-0`,children:`live trace · 30 s scatter`}),(0,W.jsxs)(`span`,{className:`text-[10px] font-mono text-[var(--color-fg-4)] shrink min-w-0 truncate text-right`,children:[g.current.length,` live · log-Y`]})]}):null,p.showLegend?(0,W.jsx)(`div`,{className:`shrink-0`,children:(0,W.jsx)(ti,{})}):null,(0,W.jsx)(`canvas`,{ref:h,"data-testid":`latency-scatter-canvas`,className:`block w-full flex-1 min-h-0 rounded-sm bg-[var(--color-surface-0)] border border-[var(--color-line-0)]`,style:{minHeight:p.scatterMinHeight}})]})]}),p.showTrendRows?(0,W.jsxs)(`div`,{"data-testid":`latency-trend-rows`,className:`grid grid-cols-1 gap-1.5 pt-2 border-t border-[var(--color-line-0)]`,children:[(0,W.jsx)(ni,{label:`p50 · median`,value:$r(e?.p50_ns??0),color:`#34d399`,fill:`rgba(52, 211, 153, 0.14)`,samples:b.p50,windowMs:a*1e3}),(0,W.jsx)(ni,{label:`p95 · 95th`,value:$r(e?.p95_ns??0),color:`#38bdf8`,fill:`rgba(56, 189, 248, 0.14)`,samples:b.p95,windowMs:a*1e3}),(0,W.jsx)(ni,{label:`p99 · 99th`,value:$r(e?.p99_ns??0),color:`#6366f1`,fill:`rgba(99, 102, 241, 0.14)`,samples:b.p99,windowMs:a*1e3})]}):null]})}function ti(){return(0,W.jsx)(`div`,{className:`flex flex-wrap items-center gap-x-3 gap-y-1 text-[10px] font-mono text-[var(--color-fg-4)]`,children:[{key:`allow`,color:Qr.allow},{key:`ask`,color:Qr.ask},{key:`block`,color:Qr.block},{key:`force`,color:Qr.force},{key:`log`,color:Qr.log},{key:`shadow`,color:Qr.shadow}].map(e=>(0,W.jsxs)(`span`,{className:`inline-flex items-center gap-1`,children:[(0,W.jsx)(`span`,{className:`inline-block h-1.5 w-1.5 rounded-full`,style:{background:e.color}}),(0,W.jsx)(`span`,{className:`uppercase tracking-wide`,children:e.key})]},e.key))})}function ni({label:e,value:t,color:n,fill:r,samples:a,windowMs:o}){return(0,W.jsxs)(`div`,{className:`grid grid-cols-[72px_minmax(0,1fr)_92px] items-center gap-2`,children:[(0,W.jsx)(`span`,{className:`overline text-right truncate min-w-0`,children:e}),(0,W.jsx)(xr,{samples:a,width:1200,height:28,windowMs:o,color:n,fillColor:r,className:`w-full h-7`}),(0,W.jsx)(`span`,{className:`text-[11px] font-mono tabular-nums text-right truncate min-w-0`,style:{color:n},title:t,children:t})]})}function ri({counters:e,className:t,showLegend:n=!0}){let r=[{key:`allow`,label:`Allow`,value:e.allow,color:`#34d399`,textClass:`text-emerald-300`},{key:`ask`,label:`Ask`,value:e.ask,color:`#f59e0b`,textClass:`text-amber-300`},{key:`block`,label:`Block`,value:e.block,color:`#ef4444`,textClass:`text-red-300`},{key:`force`,label:`Force`,value:e.force,color:`#38bdf8`,textClass:`text-sky-300`},{key:`log`,label:`Log`,value:e.log,color:`#a78bfa`,textClass:`text-violet-300`},{key:`shadow`,label:`Shadow`,value:e.shadow,color:`#6e7076`,textClass:`text-[var(--color-fg-3)]`}],a=r.reduce((e,t)=>e+t.value,0),o=(0,v.useRef)(null),s=(0,v.useRef)({});return(0,v.useEffect)(()=>{let e=o.current;if(!e)return;let t=e.querySelectorAll(`[data-seg]`);if(t.length===0)return;let n=ct();t.forEach(e=>{let t=e.dataset.seg,o=r.find(e=>e.key===t);if(!o)return;let c=a===0?0:o.value/a*100,l=s.current[t]??0;if(n||Math.abs(l-c)<.01)e.style.width=`${c}%`;else{let t=c>l?`outExpo`:`outElastic(1.02, 0.4)`;Et(e,{width:[`${l}%`,`${c}%`],duration:480,ease:t})}s.current[t]=c})},[e,a]),(0,W.jsxs)(`div`,{className:U(`flex flex-col gap-2`,t),children:[(0,W.jsx)(`div`,{ref:o,className:`flex h-3 w-full overflow-hidden rounded-sm border border-[var(--color-line-1)] bg-[var(--color-surface-2)]`,children:a===0?(0,W.jsx)(`div`,{className:`w-full bg-[var(--color-surface-3)]`}):r.map(e=>(0,W.jsx)(`div`,{"data-seg":e.key,style:{width:`${a===0?0:e.value/a*100}%`,background:e.color}},e.key))}),n?(0,W.jsx)(`div`,{className:`grid grid-cols-2 gap-x-3 gap-y-1 text-[11px] font-mono`,children:r.map(e=>(0,W.jsxs)(`div`,{className:`flex items-center justify-between gap-2 min-w-0`,children:[(0,W.jsxs)(`span`,{className:`flex items-center gap-1.5 min-w-0`,children:[(0,W.jsx)(`span`,{className:`h-2 w-2 shrink-0 rounded-sm`,style:{background:e.color}}),(0,W.jsx)(`span`,{className:U(`uppercase tracking-wide truncate`,e.textClass),children:e.label})]}),(0,W.jsx)(mr,{value:e.value,className:`shrink-0 tabular-nums text-[var(--color-fg-1)]`})]},e.key))}):null]})}function ii(e){return e<60?`${Math.floor(e)}s`:e<3600?`${Math.floor(e/60)}m ${Math.floor(e%60)}s`:e<86400?`${Math.floor(e/3600)}h ${Math.floor(e%3600/60)}m`:`${Math.floor(e/86400)}d ${Math.floor(e%86400/3600)}h`}function ai(e,t){if(t===void 0||t<=0)return`var(--color-brand)`;let n=e/t;return n>=.9?`#ef4444`:n>=.7?`#f59e0b`:`#34d399`}function oi(e){return e===`#ef4444`?`rgba(239, 68, 68, 0.14)`:e===`#f59e0b`?`rgba(245, 158, 11, 0.14)`:e===`#34d399`?`rgba(52, 211, 153, 0.14)`:e===`#a78bfa`?`rgba(167, 139, 250, 0.14)`:`rgba(245, 158, 11, 0.12)`}function si(e,t){if(e.length===0)return[];let n=Date.now(),r=t/Math.max(1,e.length),a=Array(e.length);for(let t=0;t<e.length;t++)a[t]={ts:n-(e.length-1-t)*r,v:e[t]};return a}function ci({cpuPct:e,cpuSeries:t,cpuLimit:n,memMb:r,memSeries:a,memLimit:o,heapUsedMb:s,heapTotalMb:c,heapSeries:l,uptimeSec:u,className:d}){let f=6e4,p=ai(e,n),m=ai(r,o),h=`#a78bfa`,g=(0,v.useMemo)(()=>si(t,f),[t]),_=(0,v.useMemo)(()=>si(a,f),[a]),y=(0,v.useMemo)(()=>si(l,f),[l]),b=(0,v.useRef)([]);(0,v.useEffect)(()=>{let e=b.current.filter(e=>!!e);if(e.length===0)return;e.forEach(e=>{e.style.opacity=`0`,e.style.transform=`translateY(28px) scale(0.94)`});let t=Et(e,{translateY:[28,0],scale:[.94,1],opacity:[0,1],duration:720,delay:it(140),ease:`outBack(1.25)`,onComplete:e=>{e.style.transform=``}});return()=>t.cancel()},[]);let x=n!==void 0&&n>0&&e>=n*.9,S=o!==void 0&&o>0&&r>=o*.9;return(0,W.jsx)(`div`,{className:U(`rounded-sm border bg-[var(--color-surface-1)] border-[var(--color-line-1)] p-3`,d),children:(0,W.jsxs)(`div`,{className:`grid grid-cols-2 lg:grid-cols-4 gap-3`,children:[(0,W.jsx)(li,{registerRef:e=>b.current[0]=e,label:`CPU`,color:p,fill:oi(p),pulse:x,valueNode:(0,W.jsxs)(`span`,{children:[(0,W.jsx)(mr,{value:e,format:e=>e.toFixed(1),className:`text-[var(--color-fg-0)]`}),(0,W.jsx)(`span`,{className:`text-[var(--color-fg-3)] ml-1.5 text-base`,children:`%`})]}),subText:n?`limit ${n}%`:void 0,samples:g,maxValue:100,windowMs:f}),(0,W.jsx)(li,{registerRef:e=>b.current[1]=e,label:`Memory`,color:m,fill:oi(m),pulse:S,valueNode:(0,W.jsxs)(`span`,{children:[(0,W.jsx)(mr,{value:r,format:e=>e.toFixed(0),className:`text-[var(--color-fg-0)]`}),(0,W.jsx)(`span`,{className:`text-[var(--color-fg-3)] ml-1.5 text-base`,children:`MB`})]}),subText:o?`limit ${o} MB`:void 0,samples:_,maxValue:o?o*1.1:void 0,windowMs:f}),(0,W.jsx)(li,{registerRef:e=>b.current[2]=e,label:`Heap`,color:h,fill:oi(h),valueNode:(0,W.jsxs)(`span`,{children:[(0,W.jsx)(mr,{value:s,format:e=>e.toFixed(0),className:`text-[var(--color-fg-0)]`}),(0,W.jsxs)(`span`,{className:`text-[var(--color-fg-3)] ml-1.5 text-base`,children:[`/ `,c.toFixed(0),` MB`]})]}),subText:c>0?`${(s/c*100).toFixed(0)}% used`:void 0,samples:y,maxValue:c>0?c:void 0,windowMs:f}),(0,W.jsx)(li,{registerRef:e=>b.current[3]=e,label:`Uptime`,color:`var(--color-fg-2)`,fill:`rgba(214, 215, 217, 0.04)`,valueNode:(0,W.jsx)(`span`,{className:`text-[var(--color-fg-0)] tabular-nums`,children:ii(u)}),subText:`since daemon start`})]})})}function li({label:e,valueNode:t,subText:n,color:r,fill:a,samples:o,maxValue:s,windowMs:c,pulse:l,registerRef:u}){let d=(0,v.useRef)(null);return(0,v.useEffect)(()=>{if(!l||!d.current)return;let e=!1,t=null,n=()=>{e||!d.current||(t=Et(d.current,{"--breach":[0,1],duration:420,ease:`outCubic`,onComplete:()=>{e||!d.current||(t=Et(d.current,{"--breach":[1,0],duration:560,ease:`outCubic`,onComplete:()=>{e||n()}}))}}))};return n(),()=>{e=!0,t?.cancel();let n=d.current;n&&n.style.removeProperty(`--breach`)}},[l]),(0,W.jsxs)(`div`,{ref:e=>{d.current=e,u(e)},className:`flex flex-col gap-2 rounded-sm border bg-[var(--color-surface-0)] border-[var(--color-line-1)] px-4 py-3 min-h-[140px] system-pulse__tile`,"data-breach":l?`true`:void 0,children:[(0,W.jsxs)(`div`,{className:`flex items-baseline justify-between`,children:[(0,W.jsx)(`span`,{className:`overline`,children:e}),n?(0,W.jsx)(`span`,{className:`text-[10px] font-mono text-[var(--color-fg-4)] tabular-nums`,children:n}):null]}),(0,W.jsx)(`span`,{className:`text-[1.9rem] leading-none font-semibold tracking-tight font-mono`,style:{color:r},children:t}),o&&o.length>=2?(0,W.jsx)(`div`,{className:`mt-auto`,children:(0,W.jsx)(xr,{samples:o,width:320,height:64,windowMs:c??6e4,color:r,fillColor:a,maxValue:s,className:`w-full`})}):(0,W.jsx)(`div`,{className:`mt-auto h-[64px] flex items-end`,children:(0,W.jsx)(`span`,{className:`text-[10px] font-mono text-[var(--color-fg-4)]`,children:`— no series —`})})]})}var ui=Mt(`relative font-mono text-[11px] overflow-hidden border bg-[var(--color-surface-1)] border-[var(--color-line-1)] rounded-sm`,{variants:{density:{compact:``,roomy:`text-[12px]`}},defaultVariants:{density:`compact`}}),di={allow:`#34d399`,block:`#ef4444`,ask:`#f59e0b`,log:`#a78bfa`,force:`#38bdf8`,shadow:`#6e7076`},fi={allow:`text-emerald-300`,block:`text-red-300`,ask:`text-amber-300`,log:`text-violet-300`,force:`text-sky-300`,shadow:`text-[var(--color-fg-3)]`};function pi(e){let t=new Date(e);return`${String(t.getHours()).padStart(2,`0`)}:${String(t.getMinutes()).padStart(2,`0`)}:${String(t.getSeconds()).padStart(2,`0`)}.${String(t.getMilliseconds()).padStart(3,`0`)}`}function mi(e){return e<1e3?`${e} ns`:e<1e6?`${(e/1e3).toFixed(1)} µs`:e<1e9?`${(e/1e6).toFixed(2)} ms`:`${(e/1e9).toFixed(2)} s`}function hi(e){return e.variant===`raw`?(0,W.jsx)(_i,{...e}):(0,W.jsx)(gi,{...e})}function gi({bursts:e,windowSize:t=60,filterDecision:n,filterClient:r,className:a,density:o,height:s=260}){let[c,l]=(0,v.useState)(!1),u=(0,v.useRef)(null),d=(0,v.useMemo)(()=>{let a=e;n&&(a=a.filter(e=>e.decision===n)),r&&(a=a.filter(e=>e.client===r));let o=a.slice(-t),s=Array(o.length);for(let e=0;e<o.length;e++)s[e]=o[o.length-1-e];return s},[e,n,r,t]);c?u.current===null&&(u.current=d):u.current=null;let f=c&&u.current?u.current:d,p=(0,v.useRef)(null),m=(0,v.useRef)(0);return(0,v.useLayoutEffect)(()=>{if(c)return;let e=f[0];if(!e||e.ts_ms===m.current)return;m.current=e.ts_ms;let t=p.current;t&&(ct()||Et(t,{translateX:[-10,0],opacity:[0,1],duration:220,ease:`outExpo`}))},[f,c]),(0,W.jsxs)(`div`,{className:U(ui({density:o,className:a})),onMouseEnter:()=>l(!0),onMouseLeave:()=>l(!1),children:[(0,W.jsx)(`div`,{className:`overflow-auto`,style:{height:s},children:f.length===0?(0,W.jsx)(`div`,{className:`px-3 py-4 text-[var(--color-fg-4)]`,children:`— waiting for events —`}):f.map(e=>(0,W.jsxs)(`div`,{ref:i===0?p:void 0,className:`telemetry-row grid items-center gap-2 px-3 py-1 border-b border-[var(--color-line-0)] last:border-b-0 hover:bg-[var(--color-surface-2)]`,style:{gridTemplateColumns:`90px 56px 1fr 1fr 80px 90px`,borderLeft:`3px solid ${di[e.decision]??`#666`}`},children:[(0,W.jsx)(`span`,{className:`text-[var(--color-fg-3)] tabular-nums`,children:pi(e.ts_ms)}),(0,W.jsx)(`span`,{className:U(`uppercase tracking-wide font-medium`,fi[e.decision]??`text-[var(--color-fg-2)]`),children:e.decision}),(0,W.jsx)(`span`,{className:`text-[var(--color-fg-1)] truncate`,children:e.tool||`—`}),(0,W.jsx)(`span`,{className:`text-[var(--color-fg-2)] truncate`,children:e.rule_id??`—`}),(0,W.jsx)(`span`,{className:`text-[var(--color-fg-2)] tabular-nums text-right`,children:mi(e.duration_ns)}),(0,W.jsx)(`span`,{className:`text-[var(--color-fg-3)] truncate text-right`,children:e.client})]},e.audit_id??`${e.ts_ms}:${e.tool}`))}),c?(0,W.jsx)(vi,{}):null]})}function _i({lines:e,windowSize:t=300,className:n,density:r,height:a=260}){let[o,s]=(0,v.useState)(!1),c=(0,v.useRef)(null),l=(0,v.useMemo)(()=>{let n=e.slice(-t),r=Array(n.length);for(let e=0;e<n.length;e++)r[e]=n[n.length-1-e];return r},[e,t]);o?c.current===null&&(c.current=l):c.current=null;let u=o&&c.current?c.current:l;return(0,W.jsxs)(`div`,{className:U(ui({density:r,className:n})),onMouseEnter:()=>s(!0),onMouseLeave:()=>s(!1),children:[(0,W.jsx)(`div`,{className:`overflow-auto px-3 py-2 leading-relaxed text-[var(--color-fg-2)] whitespace-pre`,style:{height:a},children:u.length===0?(0,W.jsx)(`span`,{className:`text-[var(--color-fg-4)]`,children:`— empty —`}):u.map((e,t)=>(0,W.jsx)(`div`,{className:`hover:bg-[var(--color-surface-2)]`,children:e},`${t}:${e.slice(0,40)}`))}),o?(0,W.jsx)(vi,{}):null]})}function vi(){return(0,W.jsx)(`span`,{className:`absolute top-1 right-2 text-[10px] uppercase tracking-wider font-mono text-[var(--color-brand)] bg-[var(--color-surface-0)] px-1.5 py-0.5 border border-[var(--color-brand)]/40 rounded-sm`,children:`paused`})}var yi=(...e)=>e.filter((e,t,n)=>!!e&&e.trim()!==``&&n.indexOf(e)===t).join(` `).trim(),bi=e=>e.replace(/([a-z0-9])([A-Z])/g,`$1-$2`).toLowerCase(),xi=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(e,t,n)=>n?n.toUpperCase():t.toLowerCase()),Si=e=>{let t=xi(e);return t.charAt(0).toUpperCase()+t.slice(1)},Ci={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`},wi=e=>{for(let t in e)if(t.startsWith(`aria-`)||t===`role`||t===`title`)return!0;return!1},Ti=(0,v.forwardRef)(({color:e=`currentColor`,size:t=24,strokeWidth:n=2,absoluteStrokeWidth:r,className:a=``,children:o,iconNode:s,...c},l)=>(0,v.createElement)(`svg`,{ref:l,...Ci,width:t,height:t,stroke:e,strokeWidth:r?Number(n)*24/Number(t):n,className:yi(`lucide`,a),...!o&&!wi(c)&&{"aria-hidden":`true`},...c},[...s.map(([e,t])=>(0,v.createElement)(e,t)),...Array.isArray(o)?o:[o]])),Y=(e,t)=>{let n=(0,v.forwardRef)(({className:n,...r},a)=>(0,v.createElement)(Ti,{ref:a,iconNode:t,className:yi(`lucide-${bi(Si(e))}`,`lucide-${e}`,n),...r}));return n.displayName=Si(e),n},Ei=Y(`check`,[[`path`,{d:`M20 6 9 17l-5-5`,key:`1gmf2c`}]]),Di=Y(`download`,[[`path`,{d:`M12 15V3`,key:`m9g1x1`}],[`path`,{d:`M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4`,key:`ih7n3h`}],[`path`,{d:`m7 10 5 5 5-5`,key:`brsn70`}]]),Oi=Y(`grip-horizontal`,[[`circle`,{cx:`12`,cy:`9`,r:`1`,key:`124mty`}],[`circle`,{cx:`19`,cy:`9`,r:`1`,key:`1ruzo2`}],[`circle`,{cx:`5`,cy:`9`,r:`1`,key:`1a8b28`}],[`circle`,{cx:`12`,cy:`15`,r:`1`,key:`1e56xg`}],[`circle`,{cx:`19`,cy:`15`,r:`1`,key:`1a92ep`}],[`circle`,{cx:`5`,cy:`15`,r:`1`,key:`5r1jwy`}]]),ki=Y(`pencil`,[[`path`,{d:`M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z`,key:`1a8usu`}],[`path`,{d:`m15 5 4 4`,key:`1mk7zo`}]]),Ai=Y(`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`}]]),ji=Y(`save`,[[`path`,{d:`M15.2 3a2 2 0 0 1 1.4.6l3.8 3.8a2 2 0 0 1 .6 1.4V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2z`,key:`1c8476`}],[`path`,{d:`M17 21v-7a1 1 0 0 0-1-1H8a1 1 0 0 0-1 1v7`,key:`1ydtos`}],[`path`,{d:`M7 3v4a1 1 0 0 0 1 1h7`,key:`t51u73`}]]),Mi=Y(`trash-2`,[[`path`,{d:`M10 11v6`,key:`nco0om`}],[`path`,{d:`M14 11v6`,key:`outv1u`}],[`path`,{d:`M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6`,key:`miytrc`}],[`path`,{d:`M3 6h18`,key:`d0wm0j`}],[`path`,{d:`M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2`,key:`e791ji`}]]),Ni=Y(`upload`,[[`path`,{d:`M12 3v12`,key:`1x0j5s`}],[`path`,{d:`m17 8-5-5-5 5`,key:`7q97r8`}],[`path`,{d:`M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4`,key:`ih7n3h`}]]),Pi=Y(`x`,[[`path`,{d:`M18 6 6 18`,key:`1bl5f8`}],[`path`,{d:`m6 6 12 12`,key:`d8bk6v`}]]),Fi=[`hero-metrics`,`graph`,`latency-trace`,`throughput`,`decision-mix`,`telemetry-feed`,`system-pulse`,`pending-approvals`,`recent-blocks`],Ii={"hero-metrics":`Hero metrics`,graph:`Graph intelligence`,"latency-trace":`Latency trace`,throughput:`Throughput`,"decision-mix":`Decision mix`,"telemetry-feed":`Telemetry feed`,"system-pulse":`System pulse`,"pending-approvals":`Pending approvals`,"recent-blocks":`Recent blocks`},Li={"hero-metrics":{minW:6,minH:1,defaultW:12,defaultH:1},graph:{minW:4,minH:3,defaultW:8,defaultH:5},"latency-trace":{minW:4,minH:3,defaultW:8,defaultH:4},throughput:{minW:2,minH:2,defaultW:4,defaultH:2},"decision-mix":{minW:2,minH:2,defaultW:4,defaultH:2},"telemetry-feed":{minW:6,minH:3,defaultW:12,defaultH:4},"system-pulse":{minW:4,minH:3,defaultW:12,defaultH:3},"pending-approvals":{minW:3,minH:2,defaultW:6,defaultH:3},"recent-blocks":{minW:3,minH:2,defaultW:6,defaultH:3}};function Ri({panel:e,isEditing:t,children:n,drag:r}){let a=(0,v.useRef)(null),o={gridColumn:`${e.x+1} / span ${e.w}`,gridRow:`${e.y+1} / span ${e.h}`};return(0,W.jsxs)(`div`,{ref:a,className:`grid-panel ${t?`grid-panel--edit`:``}`,style:o,role:t?`region`:void 0,"aria-label":t?Ii[e.id]:void 0,tabIndex:t?0:void 0,onKeyDown:t?t=>r.onPanelKeyDown(t,e.id):void 0,"data-panel-id":e.id,children:[t&&(0,W.jsx)(`button`,{type:`button`,className:`grid-panel__drag-handle`,title:`Drag ${Ii[e.id]} (or Arrow keys)`,"aria-label":`Drag ${Ii[e.id]}`,onPointerDown:t=>{let n=a.current;n&&r.onDragPointerDown(t,e.id,n)},children:(0,W.jsx)(Oi,{size:12,strokeWidth:2})}),(0,W.jsx)(`div`,{className:`grid-panel__content`,"data-reveal":t?void 0:``,children:n}),t&&(0,W.jsx)(`button`,{type:`button`,className:`grid-panel__resize-handle`,title:`Resize ${Ii[e.id]} (or Shift+Arrow keys)`,"aria-label":`Resize ${Ii[e.id]}`,onPointerDown:t=>{let n=a.current;n&&r.onResizePointerDown(t,e.id,n)},children:(0,W.jsxs)(`svg`,{width:`10`,height:`10`,viewBox:`0 0 10 10`,"aria-hidden":!0,children:[(0,W.jsx)(`path`,{d:`M10 0 L10 10 L0 10 Z`,fill:`currentColor`,fillOpacity:`0.4`}),(0,W.jsx)(`path`,{d:`M3 10 L10 3 M6 10 L10 6 M9 10 L10 9`,stroke:`currentColor`,strokeWidth:`0.8`,fill:`none`})]})})]})}var zi=(0,v.memo)(Ri);function Bi(e){let t=getComputedStyle(e),n=e.getBoundingClientRect(),r=parseFloat(t.rowGap||t.gap||`0`)||0,a=r*11;return{cellWidthPx:(n.width-a)/12+r,cellHeightPx:72+r}}function Vi(e){let t=(0,v.useRef)(null),n=(0,v.useRef)(e);n.current=e;let r=(0,v.useCallback)(()=>{let e=t.current;if(e){e.element.style.transform=``,e.element.style.width=``,e.element.style.height=``,e.element.style.zIndex=``,e.element.classList.remove(`grid-panel--dragging`),e.element.classList.remove(`grid-panel--resizing`);try{e.element.releasePointerCapture(e.pointerId)}catch{}t.current=null}},[]);(0,v.useEffect)(()=>{function e(e){let n=t.current;if(!n||e.pointerId!==n.pointerId)return;let r=e.clientX-n.startPointerX,a=e.clientY-n.startPointerY;if(n.mode===`drag`)n.element.style.transform=`translate3d(${r}px, ${a}px, 0)`;else{let e=Li[n.startPanel.id],t=e.minW*n.cellWidthPx-n.cellWidthPx+40,o=e.minH*n.cellHeightPx-n.cellHeightPx+40,s=Math.max(t,n.startRectW+r),c=Math.max(o,n.startRectH+a);n.element.style.width=`${s}px`,n.element.style.height=`${c}px`}}function a(e,t,n){let r=Li[e.startPanel.id];if(e.mode===`drag`){let r=Math.round(t/e.cellWidthPx),a=Math.round(n/e.cellHeightPx),o=e.startPanel.x+r,s=e.startPanel.y+a;return o<0&&(o=0),o+e.startPanel.w>12&&(o=12-e.startPanel.w),s<0&&(s=0),{id:e.id,x:o,y:s,w:e.startPanel.w,h:e.startPanel.h}}let a=Math.round(t/e.cellWidthPx),o=Math.round(n/e.cellHeightPx),s=e.startPanel.w+a,c=e.startPanel.h+o;return s<r.minW&&(s=r.minW),c<r.minH&&(c=r.minH),e.startPanel.x+s>12&&(s=12-e.startPanel.x),{id:e.id,x:e.startPanel.x,y:e.startPanel.y,w:s,h:c}}function o(e){let o=t.current;if(!o||e.pointerId!==o.pointerId)return;let s=a(o,e.clientX-o.startPointerX,e.clientY-o.startPointerY);r(),s.x===o.startPanel.x&&s.y===o.startPanel.y&&s.w===o.startPanel.w&&s.h===o.startPanel.h||n.current.onCommit(s)}function s(e){let n=t.current;!n||e.pointerId!==n.pointerId||r()}function c(e){e.key===`Escape`&&t.current&&r()}function l(){document.visibilityState===`hidden`&&t.current&&r()}return document.addEventListener(`pointermove`,e),document.addEventListener(`pointerup`,o),document.addEventListener(`pointercancel`,s),document.addEventListener(`keydown`,c),document.addEventListener(`visibilitychange`,l),()=>{document.removeEventListener(`pointermove`,e),document.removeEventListener(`pointerup`,o),document.removeEventListener(`pointercancel`,s),document.removeEventListener(`keydown`,c),document.removeEventListener(`visibilitychange`,l),t.current&&r()}},[r]);let a=(0,v.useCallback)((e,r,a,o)=>{if(!n.current.enabled||t.current)return;let s=n.current.getPanel(r),c=n.current.gridRef.current;if(!s||!c)return;e.preventDefault(),e.stopPropagation();let{cellWidthPx:l,cellHeightPx:u}=Bi(c),d=a.getBoundingClientRect();t.current={id:r,mode:o,startPointerX:e.clientX,startPointerY:e.clientY,startPanel:s,element:a,cellWidthPx:l,cellHeightPx:u,pointerId:e.pointerId,startRectW:d.width,startRectH:d.height},a.classList.add(o===`drag`?`grid-panel--dragging`:`grid-panel--resizing`),a.style.zIndex=`10`;try{a.setPointerCapture(e.pointerId)}catch{}},[]);return{onDragPointerDown:(0,v.useCallback)((e,t,n)=>a(e,t,n,`drag`),[a]),onResizePointerDown:(0,v.useCallback)((e,t,n)=>a(e,t,n,`resize`),[a]),onPanelKeyDown:(0,v.useCallback)((e,t)=>{if(!n.current.enabled)return;let r=n.current.getPanel(t);if(!r)return;let a=e.shiftKey,o=0,s=0;switch(e.key){case`ArrowLeft`:o=-1;break;case`ArrowRight`:o=1;break;case`ArrowUp`:s=-1;break;case`ArrowDown`:s=1;break;default:return}e.preventDefault(),e.stopPropagation();let c=Li[t];if(a){let e=r.w+o,a=r.h+s;if(e<c.minW&&(e=c.minW),a<c.minH&&(a=c.minH),r.x+e>12&&(e=12-r.x),e===r.w&&a===r.h)return;n.current.onCommit({id:t,x:r.x,y:r.y,w:e,h:a})}else{let e=r.x+o,a=r.y+s;if(e<0&&(e=0),e+r.w>12&&(e=12-r.w),a<0&&(a=0),e===r.x&&a===r.y)return;n.current.onCommit({id:t,x:e,y:a,w:r.w,h:r.h})}},[]),isGesturing:(0,v.useCallback)(()=>t.current!==null,[])}}function Hi(e,t){return e.x<t.x+t.w&&e.x+e.w>t.x&&e.y<t.y+t.h&&e.y+e.h>t.y}function Ui(e){return{id:e.id,x:e.x,y:e.y,w:e.w,h:e.h}}function Wi(e,t){let n=[Ui(e)],r=t.map(Ui);r.sort((e,t)=>e.y===t.y?e.x-t.x:e.y-t.y);for(let e of r){for(;;){let t=!1;for(let r of n)if(Hi(e,r)){let n=r.y+r.h;n>e.y&&(e.y=n,t=!0)}if(!t)break}n.push(e)}return n}function Gi(e){if(e.length===0)return[];let t=[...e].map(Ui).sort((e,t)=>e.y===t.y?e.x-t.x:e.y-t.y),n=[];for(let e of t){let t=!0;for(;t;){t=!1;for(let r of n)Hi(e,r)&&(e.y=r.y+r.h,t=!0)}n.push(e)}return n}function Ki(e,t,n){let r=e.findIndex(e=>e.id===t);if(r===-1)return{panels:e.map(Ui)};let a=Wi({id:e[r].id,x:n.x,y:n.y,w:n.w,h:n.h},e.filter((e,t)=>t!==r)),o=new Map(a.map(e=>[e.id,e]));return{panels:Gi(e.map(e=>o.get(e.id)).filter(Boolean))}}function qi({panels:e,isEditing:t,renderers:n,onPanelsChange:r}){let a=(0,v.useRef)(null),o=(0,v.useRef)(e);o.current=e;let s=(0,v.useMemo)(()=>{let t=new Map;for(let n of e)t.set(n.id,n);return t},[e]),c=Vi({gridRef:a,getPanel:(0,v.useCallback)(e=>s.get(e),[s]),onCommit:(0,v.useCallback)(e=>{let t=o.current,{panels:n}=Ki(t,e.id,{x:e.x,y:e.y,w:e.w,h:e.h});r(n)},[r]),enabled:t});return(0,W.jsx)(`div`,{ref:a,className:`grid-layout ${t?`grid-layout--editing`:``}`,"aria-live":t?`polite`:void 0,children:e.map(e=>(0,W.jsx)(zi,{panel:e,isEditing:t,drag:c,children:n[e.id]()},e.id))})}function Ji({manager:e,isEditing:t,onToggleEditing:n}){let{config:r,activeLayout:a,canAddUserLayout:o,saveError:s,selectLayout:c,saveAs:l,renameActive:u,deleteLayout:d,resetActive:f,exportConfig:p,importConfig:m}=e,[h,g]=(0,v.useState)(null),[_,y]=(0,v.useState)(!1),[b,x]=(0,v.useState)(``),[S,C]=(0,v.useState)(!1),[w,T]=(0,v.useState)(a.name),[E,D]=(0,v.useState)(!1),[O,k]=(0,v.useState)(!1),A=(0,v.useRef)(null);(0,v.useEffect)(()=>{T(a.name)},[a.name]),(0,v.useEffect)(()=>{s&&g(s)},[s]),(0,v.useEffect)(()=>{if(!h)return;let e=setTimeout(()=>g(null),4e3);return()=>clearTimeout(e)},[h]);function ee(){b.trim()&&(l(b.trim()),x(``),y(!1),g(`Saved "${b.trim()}"`))}function j(){w.trim()&&(u(w.trim()),C(!1),g(`Renamed`))}function M(){let e=a.name;d(a.id),k(!1),g(`Deleted "${e}"`)}function te(){f(),D(!1),g(`Reset to default`)}function ne(){let e=p(),t=new Blob([e],{type:`application/json`}),n=URL.createObjectURL(t),r=new Date().toISOString().slice(0,10),a=document.createElement(`a`);a.href=n,a.download=`ssg-layout-${r}.json`,a.click(),URL.revokeObjectURL(n),g(`Layout exported`)}function re(e){let t=e.target.files?.[0];e.target.value=``,t&&t.text().then(e=>{g(m(e).message)}).catch(()=>g(`Import failed: could not read file`))}return(0,W.jsxs)(`div`,{className:`flex items-center justify-between gap-3 rounded-sm border border-[var(--color-line-1)] bg-[var(--color-surface-1)] px-3 py-2`,children:[(0,W.jsxs)(`div`,{className:`flex items-center gap-3 min-w-0`,children:[(0,W.jsx)(`span`,{className:`overline shrink-0`,children:`layout`}),(0,W.jsxs)(`select`,{value:r.activeLayoutId,onChange:e=>c(e.target.value),className:`bg-[var(--color-surface-2)] border border-[var(--color-line-1)] rounded-sm px-2 py-1 text-[11px] font-mono text-[var(--color-fg-1)] hover:border-[var(--color-line-2)] focus:outline-none focus:ring-1 focus:ring-[var(--color-brand)] cursor-pointer`,"aria-label":`Select layout`,children:[(0,W.jsx)(`optgroup`,{label:`Built-in`,children:r.layouts.filter(e=>e.builtIn).map(e=>(0,W.jsx)(`option`,{value:e.id,children:e.name},e.id))}),r.layouts.some(e=>!e.builtIn)&&(0,W.jsx)(`optgroup`,{label:`Your layouts`,children:r.layouts.filter(e=>!e.builtIn).map(e=>(0,W.jsx)(`option`,{value:e.id,children:e.name},e.id))})]}),a.builtIn&&(0,W.jsx)(`span`,{className:`chip text-[var(--color-fg-3)]`,title:`Built-in preset`,children:`built-in`})]}),(0,W.jsx)(`div`,{className:`flex items-center gap-1.5 shrink-0`,children:t?(0,W.jsxs)(W.Fragment,{children:[(0,W.jsxs)(J,{variant:`secondary`,size:`sm`,onClick:()=>y(!0),disabled:!o,title:o?`Save the current arrangement as a new preset`:`Layout limit reached — delete one first`,children:[(0,W.jsx)(ji,{size:11,strokeWidth:2.25}),`Save as`]}),!a.builtIn&&(0,W.jsxs)(W.Fragment,{children:[(0,W.jsxs)(J,{variant:`ghost`,size:`sm`,onClick:()=>{T(a.name),C(!0)},children:[(0,W.jsx)(ki,{size:11,strokeWidth:2.25}),`Rename`]}),(0,W.jsxs)(J,{variant:`ghost`,size:`sm`,onClick:()=>k(!0),children:[(0,W.jsx)(Mi,{size:11,strokeWidth:2.25}),`Delete`]})]}),(0,W.jsxs)(J,{variant:`ghost`,size:`sm`,onClick:()=>D(!0),title:`Replace the current layout with the Default preset`,children:[(0,W.jsx)(Ai,{size:11,strokeWidth:2.25}),`Reset`]}),(0,W.jsxs)(J,{variant:`ghost`,size:`sm`,onClick:ne,title:`Download current layouts as JSON`,children:[(0,W.jsx)(Di,{size:11,strokeWidth:2.25}),`Export`]}),(0,W.jsxs)(J,{variant:`ghost`,size:`sm`,onClick:()=>A.current?.click(),title:`Load layouts from a JSON file`,children:[(0,W.jsx)(Ni,{size:11,strokeWidth:2.25}),`Import`]}),(0,W.jsx)(`input`,{ref:A,type:`file`,accept:`application/json,.json`,onChange:re,className:`hidden`,"aria-hidden":!0}),(0,W.jsxs)(J,{variant:`primary`,size:`sm`,onClick:()=>n(!1),children:[(0,W.jsx)(Ei,{size:11,strokeWidth:2.5}),`Done`]})]}):(0,W.jsxs)(J,{variant:`secondary`,size:`sm`,onClick:()=>n(!0),children:[(0,W.jsx)(ki,{size:11,strokeWidth:2.25}),`Edit layout`]})}),_&&(0,W.jsx)(Yi,{title:`Save layout as`,value:b,placeholder:`My dashboard`,onChange:x,onConfirm:ee,onCancel:()=>{y(!1),x(``)},confirmLabel:`Save`}),S&&(0,W.jsx)(Yi,{title:`Rename layout`,value:w,placeholder:a.name,onChange:T,onConfirm:j,onCancel:()=>C(!1),confirmLabel:`Rename`}),E&&(0,W.jsx)(Xi,{title:`Reset this layout?`,body:`The current arrangement will be replaced with the Default preset. Saved layouts are not affected.`,confirmLabel:`Reset`,onConfirm:te,onCancel:()=>D(!1),destructive:!1}),O&&(0,W.jsx)(Xi,{title:`Delete "${a.name}"?`,body:`This layout will be removed. You can always recreate it via Save as.`,confirmLabel:`Delete`,onConfirm:M,onCancel:()=>k(!1),destructive:!0}),h&&(0,W.jsx)(`div`,{role:`status`,className:`fixed bottom-5 left-1/2 -translate-x-1/2 z-50 rounded-sm border border-[var(--color-line-2)] bg-[var(--color-surface-3)] px-3 py-2 text-[11px] font-mono text-[var(--color-fg-1)] shadow-lg`,children:h})]})}function Yi({title:e,value:t,placeholder:n,onChange:r,onConfirm:a,onCancel:o,confirmLabel:s}){return(0,W.jsx)(`div`,{role:`dialog`,"aria-modal":!0,"aria-label":e,className:`fixed inset-0 z-50 flex items-center justify-center bg-black/60 backdrop-blur-sm`,onClick:o,children:(0,W.jsxs)(`div`,{onClick:e=>e.stopPropagation(),className:`w-80 rounded-sm border border-[var(--color-line-2)] bg-[var(--color-surface-2)] p-4`,children:[(0,W.jsx)(`div`,{className:`overline mb-2`,children:e}),(0,W.jsx)(`input`,{value:t,onChange:e=>r(e.target.value),placeholder:n,autoFocus:!0,onKeyDown:e=>{e.key===`Enter`&&a(),e.key===`Escape`&&o()},className:`w-full bg-[var(--color-surface-1)] border border-[var(--color-line-1)] rounded-sm px-2 py-1.5 text-[13px] font-mono text-[var(--color-fg-1)] focus:outline-none focus:border-[var(--color-brand)]`}),(0,W.jsxs)(`div`,{className:`mt-3 flex justify-end gap-2`,children:[(0,W.jsxs)(J,{variant:`ghost`,size:`sm`,onClick:o,children:[(0,W.jsx)(Pi,{size:11,strokeWidth:2.25}),`Cancel`]}),(0,W.jsx)(J,{variant:`primary`,size:`sm`,onClick:a,children:s})]})]})})}function Xi({title:e,body:t,confirmLabel:n,destructive:r,onConfirm:a,onCancel:o}){return(0,W.jsx)(`div`,{role:`dialog`,"aria-modal":!0,"aria-label":e,className:`fixed inset-0 z-50 flex items-center justify-center bg-black/60 backdrop-blur-sm`,onClick:o,children:(0,W.jsxs)(`div`,{onClick:e=>e.stopPropagation(),className:`w-96 rounded-sm border border-[var(--color-line-2)] bg-[var(--color-surface-2)] p-4`,children:[(0,W.jsx)(`div`,{className:`overline mb-2`,children:e}),(0,W.jsx)(`p`,{className:`text-[12px] text-[var(--color-fg-2)] leading-relaxed`,children:t}),(0,W.jsxs)(`div`,{className:`mt-4 flex justify-end gap-2`,children:[(0,W.jsx)(J,{variant:`ghost`,size:`sm`,onClick:o,children:`Cancel`}),(0,W.jsx)(J,{variant:r?`danger`:`primary`,size:`sm`,onClick:a,children:n})]})]})})}var Zi={default:`builtin-default`,focusLatency:`builtin-focus-latency`,focusApprovals:`builtin-focus-approvals`,compact:`builtin-compact`},Qi={id:Zi.default,name:`Default`,builtIn:!0,panels:[{id:`hero-metrics`,x:0,y:0,w:12,h:1},{id:`graph`,x:0,y:1,w:8,h:5},{id:`latency-trace`,x:8,y:1,w:4,h:3},{id:`throughput`,x:8,y:4,w:2,h:2},{id:`decision-mix`,x:10,y:4,w:2,h:2},{id:`telemetry-feed`,x:0,y:6,w:12,h:3},{id:`system-pulse`,x:0,y:9,w:12,h:3},{id:`pending-approvals`,x:0,y:12,w:6,h:3},{id:`recent-blocks`,x:6,y:12,w:6,h:3}]},$i={id:Zi.focusLatency,name:`Focus · Latency`,builtIn:!0,panels:[{id:`hero-metrics`,x:0,y:0,w:12,h:1},{id:`latency-trace`,x:0,y:1,w:8,h:5},{id:`graph`,x:8,y:1,w:4,h:5},{id:`throughput`,x:0,y:6,w:6,h:2},{id:`decision-mix`,x:6,y:6,w:6,h:2},{id:`system-pulse`,x:0,y:8,w:12,h:3},{id:`telemetry-feed`,x:0,y:11,w:12,h:3},{id:`pending-approvals`,x:0,y:14,w:6,h:2},{id:`recent-blocks`,x:6,y:14,w:6,h:2}]},ea={id:Zi.focusApprovals,name:`Focus · Approvals`,builtIn:!0,panels:[{id:`pending-approvals`,x:0,y:0,w:8,h:4},{id:`graph`,x:8,y:0,w:4,h:4},{id:`recent-blocks`,x:0,y:4,w:12,h:3},{id:`hero-metrics`,x:0,y:7,w:12,h:1},{id:`latency-trace`,x:0,y:8,w:6,h:3},{id:`telemetry-feed`,x:6,y:8,w:6,h:3},{id:`system-pulse`,x:0,y:11,w:12,h:3},{id:`throughput`,x:0,y:14,w:6,h:2},{id:`decision-mix`,x:6,y:14,w:6,h:2}]},ta={id:Zi.compact,name:`Compact`,builtIn:!0,panels:[{id:`hero-metrics`,x:0,y:0,w:12,h:1},{id:`graph`,x:0,y:1,w:8,h:3},{id:`latency-trace`,x:8,y:1,w:4,h:3},{id:`system-pulse`,x:0,y:4,w:12,h:3},{id:`throughput`,x:0,y:7,w:4,h:2},{id:`decision-mix`,x:4,y:7,w:4,h:2},{id:`telemetry-feed`,x:0,y:9,w:12,h:3},{id:`pending-approvals`,x:0,y:12,w:6,h:2},{id:`recent-blocks`,x:6,y:12,w:6,h:2}]},na=Object.freeze([Qi,$i,ea,ta]);function ra(){return na.map(e=>({...e,panels:e.panels.map(e=>({...e}))}))}function ia(){return{version:1,activeLayoutId:Zi.default,layouts:ra()}}function aa(e){return Object.values(Zi).includes(e)}var oa=new Set(Fi),sa=new Set(na.map(e=>e.id));function ca(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function la(e,t,n,r){if(typeof e!=`number`||!Number.isFinite(e))return r;let a=Math.floor(e);return a<t?t:a>n?n:a}function ua(e,t){let n=(typeof e==`string`?e:``).replace(/[\u0000-\u001F\u007F]/g,``).trim();return n.length===0?t:n.slice(0,40)}function da(e){let t=e.find(e=>e.id===`system-pulse`);if(!t||t.h>=3)return e;let n=3-t.h,r=t.y+t.h;return e.map(e=>e.id===`system-pulse`?{...e,h:3}:e.y>=r?{...e,y:e.y+n}:e)}function fa(e){for(let t=0;t<e.length;t++){let n=e[t];for(let r=t+1;r<e.length;r++){let t=e[r];if(n.x<t.x+t.w&&n.x+n.w>t.x&&n.y<t.y+t.h&&n.y+n.h>t.y)return!0}}return!1}function pa(e){if(!ca(e))return null;let{id:t}=e;if(typeof t!=`string`||!oa.has(t))return null;let n=t,r=Li[n],a=la(e.x,0,11,0),o=la(e.w,r.minW,12,r.defaultW);return{id:n,x:a+o>12?12-o:a,y:la(e.y,0,999,0),w:o,h:la(e.h,r.minH,99,r.defaultH)}}function ma(e,t){if(!ca(e))return{layout:null,droppedPanels:0};let n=typeof e.id==`string`&&e.id.length>0?e.id:null;if(!n)return{layout:null,droppedPanels:0};let r=ua(e.name,t),a=sa.has(n),o=e.panels;if(!Array.isArray(o))return{layout:null,droppedPanels:0};let s=new Set,c=[],l=0;for(let e of o){let t=pa(e);if(!t){l+=1;continue}if(s.has(t.id)){l+=1;continue}s.add(t.id),c.push(t)}return c.length===0?{layout:null,droppedPanels:l}:{layout:{id:n,name:r,builtIn:a,panels:da(c)},droppedPanels:l}}function ha(e){if(!ca(e)||e.version!==1)return{config:ia(),droppedPanels:0,prunedLayouts:0,fellBackToDefault:!0};let t=e.layouts;if(!Array.isArray(t)||t.length===0)return{config:ia(),droppedPanels:0,prunedLayouts:0,fellBackToDefault:!0};let n=[],r=0,a=0,o=0;for(let e of t){let{layout:t,droppedPanels:s}=ma(e,`Layout ${n.length+1}`);if(r+=s,t){if(!t.builtIn){if(a>=12){o+=1;continue}a+=1}n.push(t)}}if(n.length===0)return{config:ia(),droppedPanels:r,prunedLayouts:o,fellBackToDefault:!0};let s=new Set(n.map(e=>e.id));for(let e of na)s.has(e.id)||n.push({...e,panels:e.panels.map(e=>({...e}))});let c=new Map(na.map(e=>[e.id,e])),l=0,u=0;for(let e=0;e<n.length;e++){let t=n[e],r=c.get(t.id);if(!r)continue;if(fa(t.panels)){n[e]={...r,panels:r.panels.map(e=>({...e}))},u+=1;continue}let a=new Set(t.panels.map(e=>e.id)),o=r.panels.filter(e=>!a.has(e.id));if(o.length===0)continue;let s=t.panels.reduce((e,t)=>Math.max(e,t.y+t.h),0);for(let e of o)t.panels.push({id:e.id,x:0,y:s,w:e.w,h:e.h}),s+=e.h,l+=1}let d=e.activeLayoutId;return{config:{version:1,activeLayoutId:typeof d==`string`&&n.some(e=>e.id===d)?d:na[0].id,layouts:n},droppedPanels:r,prunedLayouts:o,fellBackToDefault:!1,backfilledPanels:l,refreshedBuiltins:u}}var ga=`ssg:dashboard-layout:v1`,_a=300;function va(){if(typeof localStorage>`u`)return null;try{let e=`__ssg_probe__`;return localStorage.setItem(e,`1`),localStorage.removeItem(e),localStorage}catch{return null}}var ya;function ba(){return ya===void 0&&(ya=va()),ya}function xa(){let e=ba();if(!e)return{config:ia(),droppedPanels:0,prunedLayouts:0,fellBackToDefault:!1};let t=null;try{t=e.getItem(ga)}catch{t=null}if(t===null)return{config:ia(),droppedPanels:0,prunedLayouts:0,fellBackToDefault:!1};let n=null;try{n=JSON.parse(t)}catch{return{config:ia(),droppedPanels:0,prunedLayouts:0,fellBackToDefault:!0}}return ha(n)}var Sa=null,Ca=null,wa=null;function Ta(e){return wa=e,()=>{wa===e&&(wa=null)}}function Ea(e){wa?wa(e):typeof console<`u`&&console.warn(`[ssg-layout]`,e)}function Da(){if(Ca=null,!Sa)return;let e=ba();if(!e){Sa=null;return}let t=Sa;Sa=null;try{e.setItem(ga,JSON.stringify(t))}catch(e){e instanceof Error&&e.name===`QuotaExceededError`?Ea(`Layout storage full — save skipped`):Ea(`Layout save failed: ${e instanceof Error?e.message:String(e)}`)}}function Oa(e){Sa=e,Ca===null&&(Ca=setTimeout(Da,_a))}function ka(e){Sa=e,Ca!==null&&(clearTimeout(Ca),Ca=null),Da()}function Aa(e){let t=0;for(let n of e.layouts)n.builtIn||(t+=1);return t}function ja(e){return e.map(e=>({...e}))}function Ma(){return`user-`+Math.random().toString(16).slice(2,11)}function Na(){let[e,t]=(0,v.useState)(()=>xa().config),[n,r]=(0,v.useState)(null);(0,v.useEffect)(()=>Ta(e=>r(e)),[]),(0,v.useEffect)(()=>{Oa(e)},[e]);let a=e.layouts.find(t=>t.id===e.activeLayoutId)??e.layouts[0]??ra()[0],o=Aa(e)<12,s=(0,v.useCallback)(e=>{t(t=>t.layouts.some(t=>t.id===e)?{...t,activeLayoutId:e}:t)},[]),c=(0,v.useCallback)(e=>{t(t=>{let n=t.activeLayoutId;return{...t,layouts:t.layouts.map(t=>t.id===n?{...t,panels:ja(e)}:t)}})},[]),l=(0,v.useCallback)(e=>{let n=e.trim();n&&t(e=>{if(Aa(e)>=12)return e;let t=e.layouts.find(t=>t.id===e.activeLayoutId)??e.layouts[0];if(!t)return e;let r={id:Ma(),name:n,builtIn:!1,panels:ja(t.panels)};return{...e,activeLayoutId:r.id,layouts:[...e.layouts,r]}})},[]),u=(0,v.useCallback)(e=>{let n=e.trim();n&&t(e=>({...e,layouts:e.layouts.map(t=>t.id===e.activeLayoutId&&!t.builtIn?{...t,name:n}:t)}))},[]),d=(0,v.useCallback)(e=>{t(t=>{let n=t.layouts.find(t=>t.id===e);if(!n||n.builtIn)return t;let r=t.layouts.filter(t=>t.id!==e),a=t.activeLayoutId===e?r[0]?.id??na[0].id:t.activeLayoutId;return{...t,activeLayoutId:a,layouts:r}})},[]),f=(0,v.useCallback)(()=>{t(e=>{let t=e.layouts.find(t=>t.id===e.activeLayoutId);if(!t)return e;let n=aa(t.id)?na.find(e=>e.id===t.id):na[0];return n?{...e,layouts:e.layouts.map(e=>e.id===t.id?{...e,panels:ja(n.panels)}:e)}:e})},[]),p=(0,v.useCallback)(()=>JSON.stringify(e,null,2),[e]),m=(0,v.useCallback)(e=>{let n;try{n=JSON.parse(e)}catch{return{ok:!1,message:`Import failed: not valid JSON`}}let r=ha(n);if(r.fellBackToDefault)return{ok:!1,message:`Import rejected: schema invalid, no changes applied`};t(r.config),ka(r.config);let a=[`Layout imported`];return r.droppedPanels>0&&a.push(`${r.droppedPanels} unrecognized panel(s) dropped`),r.prunedLayouts>0&&a.push(`${r.prunedLayouts} excess layout(s) pruned`),{ok:!0,message:a.join(` · `)}},[]);return(0,v.useEffect)(()=>{e.layouts.length===0&&t(ia())},[e.layouts.length]),{config:e,activeLayout:a,canAddUserLayout:o,saveError:n,selectLayout:s,updateActivePanels:c,saveAs:l,renameActive:u,deleteLayout:d,resetActive:f,exportConfig:p,importConfig:m}}var Pa=new Set([`compact`,`end`,`stop`,`subagent-stop`,`close`]),Fa=Object.freeze([`session-lifecycle`]);function Ia(e){(0,v.useEffect)(()=>we(Fa),[]);let t=(0,v.useSyncExternalStore)(he,ge),[n,r]=(0,v.useState)(new Map),a=(0,v.useRef)(0);(0,v.useEffect)(()=>{let e=t.lifecycleRing;if(e.length<=a.current)return;let n=e.slice(a.current);a.current=e.length,La(n,r)},[t.lifecycleRing]);let o=(0,v.useRef)(void 0);return(0,v.useEffect)(()=>{!e||e===o.current||(o.current=e,La(e,r))},[e]),{closedAt:n,isBurstActive(e,t){let r=n.get(e);return r===void 0||t>r}}}function La(e,t){let n=e.filter(e=>Pa.has(e.event));n.length!==0&&t(e=>{let t=!1,r=new Map(e);for(let e of n){let n=r.get(e.session_key);(n===void 0||e.ts_ms>n)&&(r.set(e.session_key,e.ts_ms),t=!0)}return t?r:e})}function Ra(e){return`${e.client}:${e.agent_id??`solo`}`}var za=Object.freeze({allow:`#22c55e`,block:`#ef4444`,ask:`#f59e0b`,log:`#60a5fa`,force:`#a855f7`,shadow:`#6b7280`}),Ba=5*6e4,Va=1200,Ha=10*6e4,Ua=1440*60*1e3;function Wa(e,t){if(e.length===0)return t.slice();if(t.length===0)return e.slice();let n=new Set,r=[],a=0,o=0;for(;a<e.length&&o<t.length;){let s=e[a].ts_ms<=t[o].ts_ms?e[a++]:t[o++],c=Ga(s);n.has(c)||(n.add(c),r.push(s))}for(;a<e.length;a++){let t=Ga(e[a]);n.has(t)||(n.add(t),r.push(e[a]))}for(;o<t.length;o++){let e=Ga(t[o]);n.has(e)||(n.add(e),r.push(t[o]))}return r}function Ga(e){return e.audit_id??`${e.ts_ms}:${e.tool}:${e.client}`}function Ka(e,t){if(e.length===0)return t.slice();if(t.length===0)return e.slice();let n=new Set,r=[];for(let a of[...e,...t]){let e=`${a.session_key}:${a.ts_ms}:${a.event}`;n.has(e)||(n.add(e),r.push(a))}return r}function qa(e,t,n,r=200,a=Ha,o=8){let s=new Map,c=new Map;for(let r of e){if(r.ts_ms>n)break;let e=Ra(r);if(!t(e,r.ts_ms))continue;let a=s.get(e);a?a.push(r):s.set(e,[r]);let o=c.get(e);(o===void 0||r.ts_ms>o)&&c.set(e,r.ts_ms)}let l=n-a,u=[];for(let[e,t]of c)t<l&&u.push(e);for(let e of u)s.delete(e),c.delete(e);if(s.size>o){let e=new Set(Array.from(c.entries()).sort((e,t)=>t[1]-e[1]).slice(0,o).map(([e])=>e));for(let t of[...s.keys()])e.has(t)||s.delete(t)}let d=[];for(let e of s.values()){let t=e.length>r?e.slice(-r):e;d.push(...t)}return d.sort((e,t)=>e.ts_ms-t.ts_ms),d}function Ja(e={}){let t=e.windowMs??12e4,n=Oe();ke();let[r,a]=(0,v.useState)(()=>({mode:`live`,playhead_ms:Date.now(),window_ms:t})),[o,s]=(0,v.useState)([]),[c,l]=(0,v.useState)([]),[u,d]=(0,v.useState)(!1),f=(0,v.useRef)(null),p=(0,v.useRef)(null);(0,v.useEffect)(()=>{if(r.mode!==`live`)return;let e=n.length>0?n[n.length-1].ts_ms:Date.now();e!==r.playhead_ms&&a(t=>({...t,playhead_ms:e}))},[r.mode,r.playhead_ms,n]);let m=(0,v.useMemo)(()=>Wa(o,n),[o,n]),{isBurstActive:h}=Ia(c),g=(0,v.useMemo)(()=>qa(m,h,r.playhead_ms),[m,h,r.playhead_ms]),_=m.length>0?m[0].ts_ms:r.playhead_ms,y=m.length>0?m[m.length-1].ts_ms:r.playhead_ms,b=(0,v.useCallback)(async e=>{if(p.current)return;let t=_,n=Math.min(t,(f.current??Date.now())-e);if(n>=t)return;let r=new AbortController;p.current=r,d(!0);try{let e=await fetch(`/api/json/graph/backfill?since_ms=${n}&until_ms=${t}&limit=500`,{signal:r.signal,credentials:`same-origin`});if(!e.ok)throw Error(`backfill ${e.status}`);let a=await e.json();Array.isArray(a.bursts)&&a.bursts.length>0&&s(e=>Wa(e,a.bursts)),Array.isArray(a.lifecycle)&&a.lifecycle.length>0&&l(e=>Ka(e,a.lifecycle)),f.current=n}catch(e){e.name!==`AbortError`&&console.warn(`[graph] backfill failed`,e)}finally{p.current=null,d(!1)}},[_]);(0,v.useEffect)(()=>{r.playhead_ms-_<r.window_ms*.5&&b(Ba)},[r.mode,r.playhead_ms,r.window_ms,_,b]);let x=(0,v.useRef)(!1);(0,v.useEffect)(()=>{x.current||(x.current=!0,b(Ua))},[]),(0,v.useEffect)(()=>()=>{p.current?.abort(),p.current=null},[]);let S=(0,v.useCallback)(e=>{a(t=>e===`live`?{...t,mode:`live`}:{...t,mode:e})},[]),C=(0,v.useCallback)(e=>{a(t=>({...t,mode:t.mode===`live`?`scrubbing`:t.mode,playhead_ms:e}))},[]),w=(0,v.useCallback)(e=>{a(t=>({...t,window_ms:Math.max(1e3,e)}))},[]),T=(0,v.useCallback)(()=>{a(e=>({...e,mode:`live`,playhead_ms:Date.now()}))},[]),E=(0,v.useCallback)(()=>{a(e=>({...e,mode:`live`,playhead_ms:Date.now(),window_ms:Ua})),b(Ua)},[b]);return{snapshot:(0,v.useMemo)(()=>({bursts:g,playback:r,oldest_known_ms:_,newest_known_ms:y,loading_backfill:u}),[g,r,_,y,u]),allBursts:m,setMode:S,setPlayhead:C,setWindow:w,jumpToLive:T,requestBackfill:b,jumpTo24h:E}}var Ya=2.3999632297286535,Xa=28,Za=22,Qa=.4,$a=20,eo=8,to=24,no=2*Math.PI/6e4,ro=.2,X=.82;function io(e,t,n,r=0){let a=new Map;for(let t of e){if(t.exitingAt!=null)continue;let e=a.get(t.session);e?e.push(t):a.set(t.session,[t])}if(a.size===0)return;for(let e of a.values())e.sort((e,t)=>e.ts_ms-t.ts_ms);let o=Math.min(t,n)-to,s=Array.from(a.keys()).sort(),c=s.length,l=0;for(let e of a.values())e.length>l&&(l=e.length);let u=Math.max(1,Math.min(Za,(o-Xa)/Math.max(1,l-1))),d=Xa,f=Xa+u,p=(d*d+f*f-$a*$a)/(2*d*f),m=Math.max(Qa,Math.acos(Math.min(1,Math.max(-1,p))));if(c<=eo)for(let e=0;e<c;e++){let o=s[e];if(o===void 0)continue;let l=a.get(o);if(!l)continue;let d=e*2*Math.PI/c+r;for(let e=0;e<l.length;e++){let r=l[e];if(!r)continue;let a=d+e*m,o=Xa+e*u;r.tx=t+o*Math.cos(a),r.ty=n+o*Math.sin(a)}}else{let e=[];for(let t of a.values())for(let n of t)e.push(n);e.sort((e,t)=>e.ts_ms-t.ts_ms);let s=Math.max(1,Math.min(Za,(o-Xa)/Math.max(1,e.length-1)));for(let a=0;a<e.length;a++){let o=e[a];if(!o)continue;let c=a*Ya+r,l=Xa+a*s;o.tx=t+l*Math.cos(c),o.ty=n+l*Math.sin(c)}}}function ao(e,t){for(let n of e)n.tx==null||n.ty==null||(n.vx=(n.vx+(n.tx-n.x)*ro*t)*X,n.vy=(n.vy+(n.ty-n.y)*ro*t)*X,n.x+=n.vx*t,n.y+=n.vy*t)}var oo=Object.freeze({repulsion:2500,springLength:80,springStiffness:.04,damping:.85,centeringStrength:.005,sessionCohesion:.01,width:800,height:600});function so(e){let t=new Map;for(let n of e){let e=t.get(n.session);e?(e.x+=n.x,e.y+=n.y,e.n+=1):t.set(n.session,{x:n.x,y:n.y,n:1})}for(let e of t.values())e.x/=e.n,e.y/=e.n;return t}function co(e,t,n,r){if(e.length===0)return;let a=new Map;for(let t of e)a.set(t.id,t);let o=so(e),s=n.width/2,c=n.height/2;for(let t of e)t.vx*=n.damping,t.vy*=n.damping;for(let t=0;t<e.length;t++){let a=e[t];if(a)for(let o=t+1;o<e.length;o++){let t=e[o];if(!t)continue;let s=a.x-t.x,c=a.y-t.y,l=s*s+c*c;l<1&&(l=1);let u=n.repulsion/l,d=Math.sqrt(l),f=s/d*u,p=c/d*u;a.vx+=f*r,a.vy+=p*r,t.vx-=f*r,t.vy-=p*r}}for(let e of t){let t=a.get(e.source),o=a.get(e.target);if(!t||!o)continue;let s=o.x-t.x,c=o.y-t.y,l=Math.sqrt(s*s+c*c)||1,u=(l-n.springLength)*n.springStiffness,d=s/l*u,f=c/l*u;t.vx+=d*r,t.vy+=f*r,o.vx-=d*r,o.vy-=f*r}for(let t of e){t.vx+=(s-t.x)*n.centeringStrength*r,t.vy+=(c-t.y)*n.centeringStrength*r;let e=o.get(t.session);e&&(t.vx+=(e.x-t.x)*n.sessionCohesion*r,t.vy+=(e.y-t.y)*n.sessionCohesion*r)}for(let t of e)t.vx>20&&(t.vx=20),t.vx<-20&&(t.vx=-20),t.vy>20&&(t.vy=20),t.vy<-20&&(t.vy=-20),t.x+=t.vx*r,t.y+=t.vy*r,t.x<20?(t.x=20,t.vx=Math.abs(t.vx)*.5):t.x>n.width-20&&(t.x=n.width-20,t.vx=-Math.abs(t.vx)*.5),t.y<20?(t.y=20,t.vy=Math.abs(t.vy)*.5):t.y>n.height-20&&(t.y=n.height-20,t.vy=-Math.abs(t.vy)*.5)}function lo(e,t){let n=[],r=new Map;for(let t of e){let e=r.get(t.session);e?e.push(t):r.set(t.session,[t])}for(let e of r.values()){e.sort((e,t)=>e.ts_ms-t.ts_ms);for(let r=1;r<e.length;r++){let a=e[r-1],o=e[r];!a||!o||o.ts_ms-a.ts_ms<=t&&n.push({source:a.id,target:o.id,kind:`session`})}}return n}function uo(e){let t=e|0;return()=>{t=t+1831565813|0;let e=t;return e=Math.imul(e^e>>>15,e|1),e^=e+Math.imul(e^e>>>7,e|61),((e^e>>>14)>>>0)/4294967296}}var fo={"claude-code":`C`,"claude-code-ide":`C`,cursor:`>`,copilot:`H`,codex:`X`,pi:`P`,gemini:`G`,antigravity:`A`};function po(e){return fo[e.toLowerCase()]??`.`}function mo(e){let t=0;for(let n=0;n<e.length;n++)t=Math.imul(t,31)+e.charCodeAt(n)|0;return(t>>>0)%360}function ho(e,t,n){for(let[r,a]of t){let{x:t,y:o,n:s}=a,c=50+Math.min(s,12)*7,l=mo(r),u=n.get(r),d;u&&Math.abs(u.x-t)<2&&Math.abs(u.y-o)<2&&u.r===c?d=u.grad:(d=e.createRadialGradient(t,o,0,t,o,c),d.addColorStop(0,`hsla(${l},80%,55%,0.10)`),d.addColorStop(1,`hsla(${l},80%,55%,0)`),n.set(r,{grad:d,x:t,y:o,r:c})),e.fillStyle=d,e.beginPath(),e.arc(t,o,c,0,Math.PI*2),e.fill()}for(let e of n.keys())t.has(e)||n.delete(e)}var go={block:{spikes:4,maxR:22},force:{spikes:8,maxR:32}};function _o(e,t,n,r,a,o){let s=go[a];if(!s)return;let{spikes:c,maxR:l}=s,u=l*r,d=Math.max(0,1-r)*.75;if(d<=0)return;let f=za[a]??`#6b7280`;e.save(),e.globalAlpha=d,e.strokeStyle=f,e.lineWidth=1.5,e.translate(t,n),e.rotate(o);let p=u*.28;e.beginPath();for(let t=0;t<c;t++){let n=t/c*Math.PI*2,r=n+Math.PI/c;t===0&&e.moveTo(Math.cos(r)*p,Math.sin(r)*p),e.lineTo(Math.cos(n)*u,Math.sin(n)*u),e.lineTo(Math.cos(r)*p,Math.sin(r)*p)}e.closePath(),e.stroke(),e.restore()}function vo(e,t,n,r,a,o,s){let c=8+o*r,l=Math.max(0,1-r)*s;l<=0||(e.save(),e.globalAlpha=l,e.fillStyle=a,e.beginPath(),e.arc(t,n,c,0,Math.PI*2),e.fill(),e.restore())}var yo=`9px ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace`,bo=`bold 10px ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace`;function xo(e,t,n,r,a,o,s){let c=(r.split(`:`)[0]??r).slice(0,18),l=po(c),u=mo(r),d=za[s]??`#6b7280`;e.save(),e.textAlign=`center`;let f=`[${l}] ${c}`,p=`${a.length>14?a.slice(0,14):a} · ${o}`;e.font=bo;let m=e.measureText(f).width;e.font=yo;let h=e.measureText(p).width,g=Math.max(m,h)+10;e.globalAlpha=.82,e.fillStyle=`hsla(${u},25%,5%,0.92)`,e.fillRect(t-g/2,n-2,g,28),e.globalAlpha=.92,e.fillStyle=`hsla(${u},78%,70%,1)`,e.font=bo,e.fillText(f,t,n+10),e.globalAlpha=.72,e.fillStyle=d,e.font=yo,e.fillText(p,t,n+21),e.restore()}function So(e,t,n,r,a,o,s){let c=r-t,l=a-n;if(Math.sqrt(c*c+l*l)<24)return;let u=Math.atan2(l,c),d=3.5,f=r-Math.cos(u)*9,p=a-Math.sin(u)*9;e.save(),e.globalAlpha=s*.85,e.fillStyle=o,e.translate(f,p),e.rotate(u),e.beginPath(),e.moveTo(0,0),e.lineTo(-6,-d),e.lineTo(-6,d),e.closePath(),e.fill(),e.restore()}var Co=240,wo=Array.from({length:Co},()=>({x:0,y:0,vx:0,vy:0,life:0,decay:.02,color:`#fff`,size:2})),To=0,Eo=0,Do=24;function Oo(e,t,n,r,a=6){let o=Math.max(0,Do-Eo);if(o===0)return;let s=Math.min(a,o);Eo+=s;let c=uo(r);for(let r=0;r<s;r++){let o=To%Co;To++;let s=wo[o];if(!s)continue;let l=r/a*Math.PI*2+c()*.6,u=1.2+c()*2;s.x=e+(c()-.5)*4,s.y=t+(c()-.5)*4,s.vx=Math.cos(l)*u,s.vy=Math.sin(l)*u,s.life=1,s.decay=.016+c()*.014,s.color=n,s.size=1.5+c()*2}}var ko=new Map;function Ao(e){Eo=0,ko.clear();for(let e of wo){if(e.life<=0)continue;e.x+=e.vx,e.y+=e.vy,e.vx*=.93,e.vy*=.93,e.life-=e.decay;let t=Math.max(0,e.life)*.65;if(t<=0)continue;let n=Math.round(t*4)/4,r=e.color,a=ko.get(r);a||(a=[],ko.set(r,a));let o=a.find(e=>e.alpha===n);o||(o={alpha:n,particles:[]},a.push(o)),o.particles.push(e)}for(let[t,n]of ko){e.fillStyle=t;for(let{alpha:t,particles:r}of n){e.globalAlpha=t,e.beginPath();for(let t of r)e.arc(t.x,t.y,Math.max(.1,t.size),0,Math.PI*2);e.fill()}}e.globalAlpha=1}function jo(){return{amplitude:0,startedAt:0,durationMs:0}}function Mo(e,t,n){e.amplitude=t,e.startedAt=performance.now(),e.durationMs=n}function No(e,t,n){if(t.amplitude<=0)return!1;let r=performance.now()-t.startedAt;if(r>=t.durationMs)return!1;let a=t.amplitude*Math.max(0,1-r/t.durationMs);return e.translate((n()-.5)*a*2,(n()-.5)*a*2),!0}var Po=420,Fo=He(1.7),Io=620,Lo=We(1.2,.5),Ro=et({stiffness:90,damping:7,mass:1}),zo=2,Bo=150,Vo=!1,Ho=!1;function Uo(){if(Ho||typeof window>`u`)return;Ho=!0;let e=navigator;typeof e.getBattery==`function`&&e.getBattery().then(e=>{let t=()=>{Vo=!e.charging&&e.level<.2};t(),e.addEventListener(`chargingchange`,t),e.addEventListener(`levelchange`,t)}).catch(()=>{})}function Wo(){return typeof window>`u`?!1:window.matchMedia?.(`(prefers-reduced-motion: reduce)`).matches||navigator.connection?.saveData?!0:Vo}var Go=typeof window<`u`&&new URLSearchParams(window.location.search).get(`fullrate`)===`1`;function Ko(e,t,n,r){let a=new Map;for(let t of e)a.set(t.id,t);let o=new Set,s=[];for(let e=0;e<t.length;e++){let c=t[e],l=c.audit_id??`${c.ts_ms}:${c.tool}:${e}`;o.add(l);let u=a.get(l);if(u)u.burst=c,u.exitingAt=void 0,s.push(u);else{let t=uo(c.ts_ms^e),a=n*.6+(t()-.5)*60,o=r/2+(t()-.5)*40,u=Ra(c);s.push({id:l,burst:c,ts_ms:c.ts_ms,session:u,x:a,y:o,vx:(t()-.5)*2,vy:(t()-.5)*2,age:0,tx:a,ty:o})}}let c=performance.now();for(let t of e)o.has(t.id)||(t.exitingAt??=c,c-t.exitingAt<1200&&s.push(t));return s}function qo(e){let{bursts:t,paused:n,selectedId:r,onSelect:a,burstSeq:o,layout:s=`spiral`,compact:c=!1,onFrameTime:l}=e,u=(0,v.useRef)(l);u.current=l;let d=(0,v.useRef)(null),f=(0,v.useRef)([]),p=(0,v.useRef)([]),m=(0,v.useRef)({...oo}),h=(0,v.useRef)(null),g=(0,v.useRef)(jo()),[_,y]=(0,v.useState)({w:800,h:560}),b=(0,v.useRef)(null),x=(0,v.useRef)(new Map);(0,v.useEffect)(()=>{let e=d.current?.parentElement;if(!e)return;let t=new ResizeObserver(e=>{for(let t of e){let{width:e,height:n}=t.contentRect;y({w:Math.max(40,e),h:Math.max(40,n)})}});return t.observe(e),()=>t.disconnect()},[]),(0,v.useEffect)(()=>{let e=new Map;for(let t of f.current)e.set(t.id,t);if(f.current=Ko(f.current,t,_.w,_.h),s===`spiral`){io(f.current,_.w/2,_.h/2,performance.now()*no);for(let t of f.current)!e.has(t.id)&&t.tx!=null&&t.ty!=null&&(t.x=t.tx,t.y=t.ty)}if(p.current=lo(f.current,12e4),m.current.width=_.w,m.current.height=_.h,!ct())for(let t=0;t<f.current.length;t++){let n=f.current[t];if(!n||e.has(n.id))continue;let r=za[n.burst.decision]??`#6b7280`;Oo(n.x,n.y,r,n.burst.ts_ms^t),n.burst.decision===`block`?Mo(g.current,4,280):n.burst.decision===`force`&&Mo(g.current,6,280)}},[t,_.w,_.h,o,s]),(0,v.useEffect)(()=>{let e=d.current;if(!e)return;let t=e.getContext(`2d`);if(!t)return;Uo();let a=performance.now(),o=0,l=0,v=0,y=.1,S=!1;return yr(()=>{let d=performance.now();if(!Go&&Wo()){if(o^=1,o===1)return}else o!==0&&(o=0);let C=d,w=Math.min(50,C-a);a=C;let T=Math.max(.5,Math.min(2,w/16.67)),E=f.current,D=p.current;if(!n){let e=s===`force`&&E.length<=Bo;s===`force`&&E.length>Bo&&!S&&(S=!0,console.warn(`[graph] force layout exceeded ${Bo} nodes — falling back to spiral to protect frame budget`)),e?co(E,D,m.current,T):(io(E,m.current.width/2,m.current.height/2,C*no),ao(E,T))}for(let e of E)e.age<1&&(e.age=Math.min(1,e.age+w/Po));let O=Math.min(window.devicePixelRatio||1,zo),k=_.w,A=_.h;(e.width!==k*O||e.height!==A*O)&&(e.width=k*O,e.height=A*O,e.style.width=`${k}px`,e.style.height=`${A}px`,t.scale(O,O)),t.fillStyle=`#0a0a0f`,t.fillRect(0,0,k,A);let ee=`${k}x${A}`,j=b.current?.key===ee?b.current.grad:null;j||(j=t.createRadialGradient(k/2,A/2,0,k/2,A/2,Math.max(k,A)/1.2),j.addColorStop(0,`rgba(56, 189, 248, 0.06)`),j.addColorStop(1,`rgba(0, 0, 0, 0)`),b.current={key:ee,grad:j}),t.fillStyle=j,t.fillRect(0,0,k,A);let M=ct();if(t.save(),!M){let e=uo((g.current.startedAt+C)*.01|0);No(t,g.current,e)}if(!c){let e=so(E);if(ho(t,e,x.current),!M){let n=new Map,r=new Map;for(let e of E)e.exitingAt??(r.set(e.session,(r.get(e.session)??0)+1),n.set(e.session,e));for(let[a,o]of e){let e=n.get(a),s=r.get(a)??0;if(!e||s===0)continue;let c=50+Math.min(o.n,12)*7;xo(t,o.x,o.y-c-34,a,e.burst.tool,s,e.burst.decision)}}}let te=e=>e.exitingAt==null?1:Math.max(0,1-(C-e.exitingAt)/Va);M||Ao(t);let ne=new Map;for(let e of E)ne.set(e.id,e);t.lineWidth=2,t.lineCap=`round`,t.lineJoin=`round`;for(let e=0;e<D.length;e++){let n=D[e],r=ne.get(n.source),a=ne.get(n.target);if(!r||!a)continue;let o=za[a.burst.decision]??`#6b7280`,s=Math.min(te(r),te(a));if(s<=0)continue;if(t.globalAlpha=s,t.strokeStyle=o+`aa`,t.beginPath(),t.moveTo(r.x,r.y),t.lineTo(a.x,a.y),t.stroke(),!M){let n=(C/1800+e*.618033)%1,c=r.x+(a.x-r.x)*n,l=r.y+(a.y-r.y)*n;t.save(),t.globalAlpha=s*Math.sin(n*Math.PI)*.9,t.fillStyle=o,t.beginPath(),t.arc(c,l,2.5,0,Math.PI*2),t.fill(),t.restore(),So(t,r.x,r.y,a.x,a.y,o,s)}let c=a.ts_ms-r.ts_ms,l=c<1e3?`${c}ms`:c<6e4?`${(c/1e3).toFixed(1)}s`:`${Math.floor(c/6e4)}m${Math.floor(c%6e4/1e3)}s`,u=(r.x+a.x)/2,d=(r.y+a.y)/2;t.save(),t.globalAlpha=s*.65,t.font=`8px ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace`,t.fillStyle=`#94a3b8`,t.textAlign=`center`,t.textBaseline=`middle`,t.fillText(l,u,d-7),t.restore()}t.globalAlpha=1;let re=new Set,N=new Set;if(n){let e=0;for(let t=E.length-1;t>=0&&e<5;t--){let n=E[t];!n||n.exitingAt!=null||(N.add(n.id),e++)}}else{let e=0,t=0;for(let n=E.length-1;n>=0;n--){let r=E[n];if(!(!r||r.exitingAt!=null)&&(e<3&&(re.add(r.id),e++),t<5&&(N.add(r.id),t++),e>=3&&t>=5))break}}let P=r,ie=h.current;for(let e of E){let n=te(e);if(n<=0)continue;t.globalAlpha=n;let r=Math.min(1,e.age),a=Fo(r),o=(6+2*Math.min(1,e.age))*a,s=za[e.burst.decision]??`#6b7280`;if((e.id===P||e.id===ie)&&(t.beginPath(),t.arc(e.x,e.y,o+6,0,Math.PI*2),t.fillStyle=s+`33`,t.fill()),!M)if(e.burst.decision===`block`||e.burst.decision===`force`){let n=r;_o(t,e.x,e.y,n,e.burst.decision,C*.002)}else e.burst.decision===`allow`?vo(t,e.x,e.y,r,`#22c55e`,14,.3):e.burst.decision===`ask`&&vo(t,e.x,e.y,r,`#f59e0b`,14,.45);if(e.burst.decision===`block`||e.burst.decision===`force`){let n=r*Po;if(n<Io){let r=n/Io,a=o+16*Lo(r),c=Math.max(0,1-r)*.75;t.beginPath(),t.arc(e.x,e.y,a,0,Math.PI*2),t.strokeStyle=s+Math.floor(c*255).toString(16).padStart(2,`0`),t.lineWidth=1.5,t.stroke()}}let c=!M&&re.has(e.id);if(c&&(t.save(),t.shadowColor=s,t.shadowBlur=4),t.beginPath(),t.arc(e.x,e.y,Math.max(.1,o),0,Math.PI*2),t.fillStyle=s,t.fill(),c&&(t.shadowBlur=0,t.restore()),t.strokeStyle=`#00000066`,t.lineWidth=1,t.stroke(),N.has(e.id)){t.font=`9px ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace`,t.textAlign=`center`,t.fillStyle=s+`cc`,t.fillText(po(e.burst.client),e.x,e.y-o-3);let n=e.burst.tool.length>12?e.burst.tool.slice(0,12):e.burst.tool;t.fillStyle=s+`88`,t.fillText(n,e.x,e.y+o+11),t.textAlign=`left`}(e.id===P||e.id===ie)&&(t.font=`11px ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace`,t.fillStyle=`#e0e7ff`,t.fillText(e.burst.tool,e.x+o+6,e.y+3))}if(t.globalAlpha=1,E.length>0&&!n){let e=null;for(let t=E.length-1;t>=0;t--)if(E[t].exitingAt==null){e=E[t];break}if(e){let n=1100,r=C%n/n,a=10+Ro.fn(r)*6,o=Math.max(0,1-r)*.9,s=Math.floor(o*200).toString(16).padStart(2,`0`);t.beginPath(),t.arc(e.x,e.y,a,0,Math.PI*2),t.strokeStyle=`#38bdf8${s}`,t.lineWidth=2,t.stroke()}}t.restore();let ae=performance.now()-d;l=l===0?ae:l*(1-y)+ae*y;let oe=u.current;oe&&C-v>1e3&&(v=C,oe(l))})},[n,r,_.w,_.h,s,c]);function S(e,t){let n=d.current;if(!n)return null;let r=n.getBoundingClientRect(),a=e-r.left,o=t-r.top,s=null,c=200;for(let e of f.current){let t=e.x-a,n=e.y-o,r=t*t+n*n;r<c&&(c=r,s=e.id)}return s}return(0,W.jsxs)(`div`,{className:`relative w-full h-full rounded-sm border border-[var(--color-line-1)] overflow-hidden bg-black`,children:[(0,W.jsx)(`canvas`,{ref:d,className:`block w-full h-full cursor-crosshair`,onMouseMove:e=>{h.current=S(e.clientX,e.clientY)},onMouseLeave:()=>{h.current=null},onClick:e=>{a(S(e.clientX,e.clientY))}}),t.length===0&&(0,W.jsxs)(`div`,{className:`absolute inset-0 flex flex-col items-center justify-center pointer-events-none px-4 text-center`,children:[(0,W.jsx)(`p`,{className:`overline mb-2 text-[var(--color-fg-3)]`,children:`graph · idle`}),(0,W.jsxs)(`p`,{className:`text-[11px] font-mono text-[var(--color-fg-4)] max-w-[260px]`,children:[`Each dot = one tool call an AI agent made.`,(0,W.jsx)(`br`,{}),`Color = the ssg rule decision · line = same agent's sequence.`]})]})]})}var Jo=3e4,Yo=6e4,Xo=5e3;function Zo(e){let t=Date.now(),n=e.length>0?e[e.length-1]:null;if(!n||t-n.ts_ms>Xo||!n)return{idle:!0,client:``,tool:``,ruleId:null,decision:``,evalsPerSec:`0.0`,allowPct:0,agents:0,topRules:[]};let r=e.filter(e=>t-e.ts_ms<=Jo),a=r.filter(e=>e.decision===`allow`).length,o=r.length>0?Math.round(a/r.length*100):0,s=(r.length/(Jo/1e3)).toFixed(1),c=new Set(r.map(e=>`${e.client}:${e.agent_id??`solo`}`)).size,l=e.filter(e=>t-e.ts_ms<=Yo&&e.rule_id),u=new Map;for(let e of l){let t=e.rule_id;t&&u.set(t,(u.get(t)??0)+1)}let d=[...u.entries()].sort((e,t)=>t[1]-e[1]).slice(0,4).map(([e])=>e);return{idle:!1,client:n.client,tool:n.tool,ruleId:n.rule_id,decision:n.decision,evalsPerSec:s,allowPct:o,agents:c,topRules:d}}var Qo={allow:`ALLOW`,block:`BLOCK`,ask:`ASK`,log:`LOG`,force:`FORCE`,shadow:`SHADOW`},$o={allow:`#22c55e`,block:`#ef4444`,ask:`#f59e0b`,log:`#60a5fa`,force:`#a855f7`,shadow:`#6b7280`};function es({className:e}){let t=Oe(),n=ke(),r=(0,v.useRef)(-1),a=(0,v.useRef)(null),o=(0,v.useMemo)(()=>{if(r.current===n&&a.current)return a.current;r.current=n;let e=Zo(t);return a.current=e,e},[t,n]),s=o.decision?$o[o.decision]??`#6b7280`:`#6b7280`,c=o.decision?Qo[o.decision]??o.decision:``,l=o.client?po(o.client):``;return o.idle?(0,W.jsxs)(`div`,{className:U(`pointer-events-none select-none`,`flex items-center justify-center gap-2`,`px-4 py-2 rounded-sm`,`bg-[#0a0a0f]/80 backdrop-blur-sm`,`border border-[var(--color-line-1,#242424)]`,`font-mono text-[11px] text-[var(--color-fg-4,#5a6071)]`,e),children:[(0,W.jsx)(`span`,{className:`status-dot bg-[var(--color-fg-4)] pulse-soft`}),(0,W.jsx)(`span`,{className:`uppercase tracking-wider`,children:`waiting for activity`})]}):(0,W.jsxs)(`div`,{className:U(`pointer-events-none select-none`,`flex flex-col gap-1 px-4 py-2.5 rounded-sm`,`bg-[#0a0a0f]/88 backdrop-blur-sm`,`border border-[var(--color-line-1,#242424)]`,`font-mono min-w-[280px] max-w-[460px]`,e),children:[(0,W.jsxs)(`div`,{className:`flex items-center gap-2 text-[10px] uppercase tracking-widest text-[var(--color-fg-4,#5a6071)]`,children:[(0,W.jsx)(`span`,{className:`status-dot bg-emerald-400 pulse-soft`}),(0,W.jsx)(`span`,{children:`now evaluating`}),(0,W.jsxs)(`span`,{className:`ml-auto tabular-nums`,children:[o.evalsPerSec,`/s · `,o.allowPct,`% allow · `,o.agents,` `,o.agents===1?`agent`:`agents`]})]}),(0,W.jsxs)(`div`,{className:`flex items-center gap-2 text-[14px] text-[var(--color-fg-0,#f5f5f5)] tracking-tight`,children:[(0,W.jsxs)(`span`,{className:`text-[var(--color-fg-3)] text-[11px] tabular-nums`,children:[`[`,l,`]`]}),(0,W.jsx)(`span`,{className:`text-sky-300`,children:o.client}),(0,W.jsx)(`span`,{className:`text-[var(--color-fg-3)]`,children:`·`}),(0,W.jsx)(`span`,{className:`text-white font-semibold`,children:o.tool}),o.ruleId&&(0,W.jsxs)(W.Fragment,{children:[(0,W.jsx)(`span`,{className:`text-[var(--color-fg-3)]`,children:`->`}),(0,W.jsx)(`span`,{className:`text-[var(--color-fg-2)] text-[12px]`,children:o.ruleId})]}),(0,W.jsx)(`span`,{className:`ml-auto text-[13px] font-bold tabular-nums`,style:{color:s},children:c})]}),o.topRules.length>0&&(0,W.jsxs)(`div`,{className:`flex items-center gap-1.5 text-[10px] text-[var(--color-fg-4)]`,children:[(0,W.jsx)(`span`,{className:`uppercase tracking-wider text-[9px]`,children:`rules`}),o.topRules.map(e=>(0,W.jsx)(`span`,{className:`px-1 py-0.5 rounded-sm bg-[var(--color-surface-2,#121212)] text-[var(--color-fg-3)]`,children:e},e))]})]})}function ts(){let e=Oe(),t=ke(),[n,r]=(0,v.useState)(null),{isBurstActive:a}=Ia(),o=(0,v.useMemo)(()=>qa(e,a,Date.now()),[e,a,t]),s=(0,v.useMemo)(()=>{let e=new Map;for(let t of o){let n=`${t.client}:${t.agent_id??`solo`}`,r=e.get(n);r?r.count+=1:e.set(n,{client:t.client,count:1})}return e},[o]),c=(0,v.useMemo)(()=>{let e={allow:0,block:0,ask:0,other:0};for(let t of o)t.decision===`allow`?e.allow++:t.decision===`block`||t.decision===`force`?e.block++:t.decision===`ask`?e.ask++:e.other++;return e},[o]),l=(0,v.useMemo)(()=>{let e=new Set,t=0;for(let n of o)n.rule_id&&(e.add(n.rule_id),t+=1);return{distinct:e.size,matched:t,topRule:e.values().next().value}},[o]);return(0,W.jsxs)(`div`,{className:`flex flex-col h-full min-h-0 rounded-sm border border-[var(--color-line-1)] bg-[var(--color-surface-1)]`,children:[(0,W.jsxs)(`header`,{className:`flex items-center gap-2 px-3 py-1.5 border-b border-[var(--color-line-1)]`,children:[(0,W.jsx)(`span`,{className:`overline text-[var(--color-fg-3)]`,children:`graph · live`}),(0,W.jsxs)(`span`,{className:`flex items-center gap-1 text-[10px] font-mono text-[var(--color-fg-4)]`,children:[(0,W.jsx)(`span`,{className:`status-dot bg-emerald-400 pulse-soft`}),o.length]}),(0,W.jsxs)(`span`,{className:`flex items-center gap-1.5 text-[10px] font-mono`,children:[(0,W.jsx)(`span`,{className:`w-1.5 h-1.5 rounded-full`,style:{background:za.allow}}),(0,W.jsx)(`span`,{className:`text-[var(--color-fg-3)] tabular-nums`,children:c.allow}),(0,W.jsx)(`span`,{className:`w-1.5 h-1.5 rounded-full ml-1`,style:{background:za.block}}),(0,W.jsx)(`span`,{className:`text-[var(--color-fg-3)] tabular-nums`,children:c.block}),(0,W.jsx)(`span`,{className:`w-1.5 h-1.5 rounded-full ml-1`,style:{background:za.ask}}),(0,W.jsx)(`span`,{className:`text-[var(--color-fg-3)] tabular-nums`,children:c.ask})]}),(0,W.jsx)(`span`,{className:`flex-1`}),(0,W.jsxs)(`span`,{className:`chip text-violet-300 border-violet-500/30`,title:`${l.matched} tool calls matched ${l.distinct} ssg ${l.distinct===1?`rule`:`rules`} in active sessions`,children:[l.distinct,` `,l.distinct===1?`rule`:`rules`]}),(0,W.jsxs)(`span`,{className:`chip text-[var(--color-fg-3)] border-[var(--color-line-1)]`,title:s.size===0?`no active agents`:Array.from(s.entries()).map(([e,t])=>`${e}: ${t.count}`).join(`
|
|
10
|
+
`),children:[s.size,` `,s.size===1?`agent`:`agents`]}),(0,W.jsx)(`a`,{href:`/graph`,className:`text-[10px] font-mono uppercase tracking-wider text-sky-300 hover:text-sky-200`,title:`Open full /graph page`,children:`expand ↗`})]}),(0,W.jsxs)(`div`,{className:`flex-1 min-h-0 relative`,children:[(0,W.jsx)(qo,{bursts:o,paused:!1,selectedId:n,onSelect:r,burstSeq:t,layout:`spiral`}),(0,W.jsx)(es,{className:`absolute bottom-2 left-2 z-10 max-w-[calc(100%-1rem)]`})]})]})}var ns=`ssg.sfx.enabled`;function rs(){if(typeof window>`u`)return!1;try{return window.localStorage.getItem(ns)===`true`}catch{return!1}}function is(e){if(!(typeof window>`u`))try{window.localStorage.setItem(ns,String(e))}catch{}}function as(e,t,n,r,a,o,s=`sine`){try{let c=e.createOscillator(),l=e.createGain(),u=a/1e3;c.type=s,c.frequency.setValueAtTime(n,e.currentTime),c.frequency.exponentialRampToValueAtTime(Math.max(1,r),e.currentTime+u),l.gain.setValueAtTime(o,e.currentTime),l.gain.exponentialRampToValueAtTime(.001,e.currentTime+u),c.connect(l),l.connect(t),c.start(e.currentTime),c.stop(e.currentTime+u+.02)}catch{}}function os(){let[e,t]=(0,v.useState)(rs),n=(0,v.useRef)(null),r=(0,v.useRef)(null);return(0,v.useEffect)(()=>{let t=()=>{let t=n.current;t&&(document.hidden?t.suspend().catch(()=>{}):e&&t.resume().catch(()=>{}))};return document.addEventListener(`visibilitychange`,t),()=>document.removeEventListener(`visibilitychange`,t)},[e]),{enabled:e,toggle:(0,v.useCallback)(()=>{t(e=>{let t=!e;if(is(t),t){if(!n.current)try{let e=new AudioContext,t=e.createGain();t.gain.value=.8,t.connect(e.destination),n.current=e,r.current=t}catch{}n.current?.resume().catch(()=>{})}else n.current?.suspend().catch(()=>{});return t})},[]),play:(0,v.useCallback)(t=>{if(!e)return;let a=n.current,o=r.current;if(!(!a||!o||a.state===`suspended`))switch(t){case`block`:as(a,o,110,55,150,.08);break;case`force`:as(a,o,80,40,200,.1),as(a,o,160,80,200,.05,`square`);break;case`milestone`:{as(a,o,660,880,100,.06);let e=a,t=o;setTimeout(()=>{e.state!==`suspended`&&as(e,t,880,1320,100,.05)},115);break}case`record`:as(a,o,880,1320,350,.07);break}},[e])}}function ss(e){return!Number.isFinite(e)||e<=0?`—`:e<1e3?`${e} ns`:e<1e6?`${(e/1e3).toFixed(1)} µs`:`${(e/1e6).toFixed(2)} ms`}async function cs(e,t){await fetch(`/api/decide/${e}?decision=${t}`,{method:`POST`,headers:Ae()})}var ls=e=>!0,us=e=>e.decision===`allow`,ds=e=>e.decision===`block`,fs=e=>e.decision===`ask`,ps=e=>e.decision===`force`,ms=e=>e.decision===`log`;function hs(){let e=new Date;return e.setHours(0,0,0,0),e.getTime()}function gs(){let e=je([`counters-updated`,`activity-updated`,`pending-changed`,`runtime-tick`]),t=De(),n=ke(),r=Oe(),a=os();(0,v.useEffect)(()=>{t&&(t.decision===`block`?a.play(`block`):t.decision===`force`&&a.play(`force`))},[n]);let[o,s]=(0,v.useState)(()=>hs());(0,v.useEffect)(()=>{let e=()=>{if(document.visibilityState!==`visible`)return;let e=hs();s(t=>e===t?t:e)};return document.addEventListener(`visibilitychange`,e),()=>document.removeEventListener(`visibilitychange`,e)},[]);let{data:c}=z(`/api/state/counters?since_ms=${o}`,[e[`counters-updated`],o]),{data:l}=z(`/api/state/runtime`,[e[`runtime-tick`]]),{data:u}=z(`/api/json/limits`,[e[`runtime-tick`]]),{data:d,refetch:f}=z(`/api/json/pending`,[e[`pending-changed`]]),{data:p}=z(`/api/json/blocked`,[e[`activity-updated`]]),m=Na(),[h,g]=(0,v.useState)(!1),_=(0,v.useMemo)(()=>{let e=c?.allow??0,n=c?.block??0,r=c?.ask??0,a=c?.log??0,o=c?.force??0,s=e+n+r+a+o,l=t?.counters.total??0;return t&&l>=s&&t?{allow:t.counters.allow,block:t.counters.block,ask:t.counters.ask,log:t.counters.log,force:t.counters.force,shadow:t.counters.shadow,total:t.counters.total}:{allow:e,block:n,ask:r,log:a,force:o,shadow:0,total:s}},[t,c]),y=(0,v.useMemo)(()=>{if(r.length===0)return 0;let e=Date.now()-1e4;return r.filter(t=>t.ts_ms>=e).length/10},[r]),b=l?.history?.cpu_pct??[],x=l?.history?.memory_rss_mb??[],S=[],C=l?.latency,w=(0,v.useMemo)(()=>({"hero-metrics":()=>(0,W.jsx)(`div`,{className:`grid-bleed rounded-sm border border-[var(--color-line-1)] bg-[var(--color-surface-1)] p-3 h-full`,children:(0,W.jsxs)(`div`,{className:`grid grid-cols-2 sm:grid-cols-3 lg:grid-cols-6 gap-3 h-full`,children:[(0,W.jsx)(kr,{label:`Total`,value:_.total,tone:`amber`,sub:t?ss(t.duration_ns):void 0,burstRing:r,filter:ls}),(0,W.jsx)(kr,{label:`Allow`,value:_.allow,tone:`green`,burstRing:r,filter:us}),(0,W.jsx)(kr,{label:`Block`,value:_.block,tone:`red`,burstRing:r,filter:ds}),(0,W.jsx)(kr,{label:`Ask`,value:_.ask,tone:`amber`,burstRing:r,filter:fs}),(0,W.jsx)(kr,{label:`Force`,value:_.force,tone:`blue`,burstRing:r,filter:ps}),(0,W.jsx)(kr,{label:`Log`,value:_.log,tone:`purple`,burstRing:r,filter:ms})]})}),graph:()=>(0,W.jsx)(ts,{}),"latency-trace":()=>(0,W.jsx)(ei,{latency:C,bursts:r,gaugeMaxMs:10,windowMs:3e4,trendWindowSec:60,gaugeSize:200}),throughput:()=>(0,W.jsxs)(G,{className:`h-full`,children:[(0,W.jsxs)(K,{children:[(0,W.jsx)(`span`,{className:`overline`,children:`throughput · evals/s`}),(0,W.jsxs)(lr,{variant:`blue`,children:[y.toFixed(1),`/s`]})]}),(0,W.jsxs)(q,{children:[(0,W.jsx)(xr,{value:y,width:360,height:96,windowMs:6e4,className:`w-full`}),(0,W.jsx)(`p`,{className:`overline mt-2 text-center`,children:`60-second rolling window`})]})]}),"decision-mix":()=>(0,W.jsxs)(G,{className:`h-full`,children:[(0,W.jsxs)(K,{children:[(0,W.jsx)(`span`,{className:`overline`,children:`decision mix`}),(0,W.jsx)(lr,{variant:`gray`,children:_.total.toLocaleString()})]}),(0,W.jsx)(q,{children:(0,W.jsx)(ri,{counters:{allow:_.allow,block:_.block,ask:_.ask,log:_.log,force:_.force,shadow:_.shadow}})})]}),"telemetry-feed":()=>(0,W.jsxs)(G,{variant:`flush`,className:`h-full flex flex-col`,children:[(0,W.jsxs)(K,{children:[(0,W.jsx)(`span`,{className:`overline`,children:`telemetry · live · newest first`}),(0,W.jsxs)(`span`,{className:`text-[10px] font-mono text-[var(--color-fg-3)]`,children:[`hover to pause · scroll for history · `,r.length,` events buffered`]})]}),(0,W.jsx)(q,{className:`p-0 flex-1 min-h-0`,children:(0,W.jsx)(hi,{variant:`decision`,bursts:r,windowSize:80,height:360,className:`border-0 rounded-none`})})]}),"system-pulse":()=>(0,W.jsx)(ci,{cpuPct:l?.cpu_pct??0,cpuSeries:b,cpuLimit:u?.config.cpuLimitPct,memMb:l?.memory_rss_mb??0,memSeries:x,memLimit:u?.config.memoryLimitMb,heapUsedMb:l?.heap_used_mb??0,heapTotalMb:l?.heap_total_mb??0,heapSeries:S,uptimeSec:(l?.uptime_ms??0)/1e3}),"pending-approvals":()=>(0,W.jsxs)(G,{className:`h-full`,children:[(0,W.jsxs)(K,{children:[(0,W.jsx)(`span`,{className:`overline`,children:`pending approvals`}),(0,W.jsx)(lr,{variant:d&&d.length>0?`amber`:`gray`,children:d?.length??0})]}),(0,W.jsx)(q,{children:d&&d.length>0?(0,W.jsx)(`ul`,{className:`space-y-2`,children:d.slice(0,5).map(e=>(0,W.jsxs)(`li`,{className:`flex items-center justify-between gap-2 border-b border-[var(--color-line-0)] last:border-b-0 py-1.5 text-[12px] font-mono`,children:[(0,W.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,W.jsxs)(`div`,{className:`text-[var(--color-fg-1)] truncate`,children:[e.toolCall.tool,` · `,e.ruleId]}),(0,W.jsx)(`div`,{className:`text-[var(--color-fg-3)] text-[11px] truncate`,children:ar(e.toolCall.tool,JSON.stringify(e.toolCall.input??{}))})]}),(0,W.jsxs)(`div`,{className:`flex gap-1 shrink-0`,children:[(0,W.jsx)(J,{size:`sm`,variant:`primary`,onClick:()=>cs(e.id,`allow`).then(f),children:`allow`}),(0,W.jsx)(J,{size:`sm`,variant:`ghost`,onClick:()=>cs(e.id,`block`).then(f),children:`block`})]})]},e.id))}):(0,W.jsx)(`p`,{className:`text-[11px] font-mono text-[var(--color-fg-4)] py-3 text-center`,children:`— no pending approvals —`})})]}),"recent-blocks":()=>(0,W.jsxs)(G,{className:`h-full`,children:[(0,W.jsxs)(K,{children:[(0,W.jsx)(`span`,{className:`overline`,children:`recent blocks & forces`}),(0,W.jsx)(lr,{variant:p&&p.length>0?`red`:`gray`,children:p?.length??0})]}),(0,W.jsx)(q,{children:p&&p.length>0?(0,W.jsx)(`ul`,{className:`space-y-1.5`,children:p.slice(0,6).map((e,t)=>(0,W.jsxs)(`li`,{className:`flex items-center gap-2 text-[12px] font-mono border-b border-[var(--color-line-0)] last:border-b-0 py-1.5`,children:[(0,W.jsx)(lr,{variant:e.decision===`force`?`amber`:`red`,children:e.decision}),(0,W.jsx)(`span`,{className:`text-[var(--color-fg-1)] truncate flex-1`,children:ar(e.tool,e.input)}),(0,W.jsx)(`span`,{className:`text-[var(--color-fg-3)] truncate text-[11px] max-w-[120px]`,children:e.rule_id??`—`})]},`${e.timestamp}-${t}`))}):(0,W.jsx)(`p`,{className:`text-[11px] font-mono text-[var(--color-fg-4)] py-3 text-center`,children:`— no recent blocks —`})})]})}),[_,t,r,C,y,l,b,x,S,u,d,p,f]),T=Dt({from:`first`,translateY:22,durationMs:640,staggerMs:80,maxStaggerMs:520});return(0,W.jsxs)(`div`,{ref:h?void 0:T,className:`space-y-5`,children:[(0,W.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,W.jsx)(`div`,{className:`flex-1`,children:(0,W.jsx)(Ji,{manager:m,isEditing:h,onToggleEditing:g})}),(0,W.jsx)(`button`,{type:`button`,onClick:a.toggle,className:`chip cursor-pointer hover:border-sky-500/50 hover:text-sky-300 transition-colors shrink-0`,title:a.enabled?`Mute stream sounds`:`Enable stream sounds`,children:a.enabled?`SFX ON`:`SFX OFF`})]}),(0,W.jsx)(qi,{panels:m.activeLayout.panels,isEditing:h,renderers:w,onPanelsChange:m.updateActivePanels})]})}function _s({val:e}){return e==null?(0,W.jsx)(`span`,{className:`text-[var(--color-fg-4)] italic font-mono text-xs`,children:`null`}):typeof e==`boolean`?(0,W.jsx)(`span`,{className:`inline-block font-mono text-[10px] font-medium uppercase tracking-wider px-1.5 py-0.5 rounded-sm border ${e?`bg-emerald-500/8 text-emerald-300 border-emerald-500/25`:`bg-red-500/8 text-red-300 border-red-500/25`}`,children:e.toString()}):typeof e==`number`?(0,W.jsx)(`span`,{className:`font-mono tabular-nums text-violet-300 text-xs`,children:e}):typeof e==`string`?e.length===0?(0,W.jsx)(`span`,{className:`text-[var(--color-fg-4)] italic text-xs font-mono`,children:`empty string`}):e.length>200?(0,W.jsx)(`pre`,{className:`text-[11px] font-mono text-[var(--color-fg-1)] whitespace-pre-wrap break-all bg-[var(--color-surface-0)] border border-[var(--color-line-1)] rounded-sm p-2 max-h-40 overflow-y-auto`,children:e}):(0,W.jsx)(`span`,{className:`font-mono text-xs text-[var(--color-fg-1)] break-all`,children:e}):(0,W.jsx)(`pre`,{className:`text-[11px] font-mono text-[var(--color-fg-1)] whitespace-pre-wrap break-all bg-[var(--color-surface-0)] border border-[var(--color-line-1)] rounded-sm p-2 max-h-40 overflow-y-auto`,children:JSON.stringify(e,null,2)})}function vs({inputJson:e}){let t=[];try{let n=JSON.parse(e);n&&typeof n==`object`&&!Array.isArray(n)&&(t=Object.entries(n))}catch{return(0,W.jsx)(`pre`,{className:`text-[11px] font-mono text-[var(--color-fg-1)] whitespace-pre-wrap break-all bg-[var(--color-surface-0)] border border-[var(--color-line-1)] rounded-sm p-2`,children:e})}return t.length===0?(0,W.jsx)(`span`,{className:`text-[var(--color-fg-4)] text-xs italic font-mono`,children:`no input fields`}):(0,W.jsx)(`div`,{className:`rounded-sm border border-[var(--color-line-1)] overflow-hidden text-xs`,children:t.map(([e,t],n)=>(0,W.jsxs)(`div`,{className:`flex gap-0 ${n>0?`border-t border-[var(--color-line-0)]`:``}`,children:[(0,W.jsx)(`div`,{className:`w-40 shrink-0 px-3 py-2 bg-[var(--color-surface-0)] text-[var(--color-fg-3)] font-mono text-[11px] border-r border-[var(--color-line-0)] select-none`,children:e}),(0,W.jsx)(`div`,{className:`flex-1 min-w-0 px-3 py-2 leading-relaxed`,children:(0,W.jsx)(_s,{val:t})})]},e))})}var ys={allow:`green`,block:`red`,force:`amber`,ask:`blue`,log:`gray`},bs={allow:`border-l-emerald-500/60`,block:`border-l-red-500/60`,force:`border-l-amber-400/60`,ask:`border-l-sky-500/60`,log:`border-l-[var(--color-line-2)]`};function xs(e){return e==null?null:e<1e6?`${(e/1e3).toFixed(0)}µs`:`${(e/1e6).toFixed(1)}ms`}function Ss({label:e,value:t,mono:n,children:r}){return(0,W.jsxs)(`div`,{children:[(0,W.jsx)(`div`,{className:`overline mb-1`,children:e}),r??(0,W.jsx)(`span`,{className:`text-[var(--color-fg-1)] text-xs ${n?`font-mono`:``} break-all`,children:t??`—`})]})}function Cs({text:e}){let[t,n]=(0,v.useState)(!1);return(0,W.jsx)(`button`,{onClick:async t=>{t.stopPropagation();try{await navigator.clipboard.writeText(e),n(!0),setTimeout(()=>n(!1),1500)}catch{}},className:`text-[10px] font-mono uppercase tracking-wider text-[var(--color-fg-3)] hover:text-[var(--color-fg-1)] border border-[var(--color-line-1)] hover:border-[var(--color-line-2)] rounded-sm px-2 py-1 transition-colors cursor-pointer`,children:t?`✓ copied`:`copy json`})}function ws({row:e,defaultExpanded:t=!1}){let[n,r]=(0,v.useState)(t),a=(0,v.useRef)(null),o=(0,v.useRef)(!0),s=ar(e.tool,e.input),c=ys[e.decision]??`gray`,l=bs[e.decision]??`border-l-[var(--color-line-2)]`,u=ir(e.timestamp),d=xs(e.duration_ns);(0,v.useEffect)(()=>{let e=a.current;if(e){if(o.current){o.current=!1,n||(e.style.maxHeight=`0`,e.style.opacity=`0`);return}if(ct()){e.style.maxHeight=n?`none`:`0`,e.style.opacity=n?`1`:`0`;return}if(n){let t=e.scrollHeight;Et(e,{"max-height":[`0px`,`${t}px`],opacity:[0,1],translateY:[-6,0],duration:260,ease:`outCubic`,onComplete:()=>{e.style.maxHeight=`none`}})}else{let t=e.scrollHeight;Et(e,{"max-height":[`${t}px`,`0px`],opacity:[1,0],duration:180,ease:`outCubic`})}}},[n]);let f=(()=>{try{return JSON.stringify(JSON.parse(e.input),null,2)}catch{return e.input}})();return(0,W.jsxs)(`div`,{className:`border border-[var(--color-line-1)] border-l-2 ${l} rounded-sm bg-[var(--color-surface-1)] overflow-hidden transition-colors hover:border-[var(--color-line-2)] hover:border-l-2`,children:[(0,W.jsxs)(`div`,{className:`flex items-center gap-3 px-3 py-2 cursor-pointer select-none group`,onClick:()=>r(e=>!e),role:`button`,"aria-expanded":n,children:[(0,W.jsx)(`svg`,{className:`shrink-0 text-[var(--color-fg-4)] group-hover:text-[var(--color-fg-2)] transition-all ${n?`rotate-90`:``}`,width:`10`,height:`10`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2.5`,strokeLinecap:`round`,strokeLinejoin:`round`,children:(0,W.jsx)(`polyline`,{points:`9 18 15 12 9 6`})}),(0,W.jsx)(`time`,{className:`shrink-0 font-mono text-[11px] text-[var(--color-fg-3)] w-14 tabular-nums`,title:u,dateTime:new Date(e.timestamp*1e3).toISOString(),children:rr(e.timestamp)}),(0,W.jsx)(lr,{variant:c,className:`shrink-0`,children:e.decision}),(0,W.jsx)(`code`,{className:`shrink-0 text-[11px] text-[var(--color-brand)] font-mono`,children:e.tool}),s&&(0,W.jsx)(`span`,{className:`flex-1 min-w-0 text-[11px] text-[var(--color-fg-2)] font-mono truncate`,title:s,children:s}),(0,W.jsx)(`span`,{className:`shrink-0 text-[10px] font-mono text-[var(--color-fg-4)] ml-auto pl-2 uppercase tracking-wider`,title:e.client?`client: ${e.client}`:`client: unidentified`,children:e.client??`—`})]}),(0,W.jsx)(`div`,{ref:a,className:`border-t border-[var(--color-line-0)] overflow-hidden`,style:{maxHeight:n?`none`:`0`,opacity:n?1:0},"aria-hidden":!n,children:n&&(0,W.jsxs)(`div`,{className:`px-3 py-3 space-y-4`,children:[(0,W.jsxs)(`div`,{className:`grid grid-cols-2 sm:grid-cols-3 lg:grid-cols-4 gap-x-6 gap-y-3`,children:[(0,W.jsx)(Ss,{label:`Timestamp`,value:u}),(0,W.jsx)(Ss,{label:`Decision`,children:(0,W.jsx)(lr,{variant:c,children:e.decision})}),(0,W.jsx)(Ss,{label:`Tool`,children:(0,W.jsx)(`code`,{className:`text-xs font-mono text-[var(--color-brand)]`,children:e.tool})}),e.client&&(0,W.jsx)(Ss,{label:`Client`,value:e.client}),e.rule_id&&(0,W.jsx)(Ss,{label:`Rule ID`,children:(0,W.jsx)(`a`,{href:`/rules?highlight=${encodeURIComponent(e.rule_id)}`,className:`text-xs text-[var(--color-brand)] hover:underline font-mono`,onClick:e=>e.stopPropagation(),children:e.rule_id})}),e.source_file&&(0,W.jsx)(Ss,{label:`Source File`,value:e.source_file,mono:!0}),d&&(0,W.jsx)(Ss,{label:`Latency`,value:d,mono:!0}),e.rules_evaluated!=null&&(0,W.jsx)(Ss,{label:`Rules Evaluated`,value:`${e.rules_evaluated}`,mono:!0})]}),(0,W.jsxs)(`div`,{children:[(0,W.jsx)(`div`,{className:`overline mb-2`,children:`Tool Input`}),(0,W.jsx)(vs,{inputJson:e.input})]}),(0,W.jsxs)(`div`,{className:`flex items-center justify-between`,children:[e.rule_id?(0,W.jsx)(`a`,{href:`/rules?highlight=${encodeURIComponent(e.rule_id)}`,className:`text-[10px] font-mono uppercase tracking-wider text-[var(--color-brand)]/70 hover:text-[var(--color-brand)] transition-colors`,onClick:e=>e.stopPropagation(),children:`→ view rule`}):(0,W.jsx)(`span`,{}),(0,W.jsx)(Cs,{text:f})]})]})})]})}function Ts({className:e,children:t,...n}){return(0,W.jsx)(`pre`,{className:U(`bg-[var(--color-surface-0)] border border-[var(--color-line-1)] rounded-sm px-3 py-2 text-[11px] leading-relaxed font-mono text-[var(--color-fg-1)] overflow-x-auto whitespace-pre-wrap break-all`,e),...n,children:t})}var Es={neutral:`text-[var(--color-fg-0)]`,green:`text-emerald-300`,red:`text-red-300`,amber:`text-amber-300`,blue:`text-sky-300`,purple:`text-violet-300`,gray:`text-[var(--color-fg-3)]`},Ds={neutral:`bg-[var(--color-fg-3)]`,green:`bg-emerald-500`,red:`bg-red-500`,amber:`bg-[var(--color-brand)]`,blue:`bg-sky-500`,purple:`bg-violet-500`,gray:`bg-[var(--color-line-2)]`},Os=[{label:`User code`,color:`#451a03`},{label:`Runtime (bun:/node:)`,color:`#172554`},{label:`Native/other`,color:`#1f2937`},{label:`GC/idle`,color:`#450a0a`}];function ks({label:e,value:t,sub:n,tone:r=`neutral`,align:a=`left`,labelPlacement:o=`above`,labelClassName:s,valueClassName:c,subClassName:l}){let u=(0,W.jsx)(`div`,{className:U(o===`above`?`overline mb-1.5`:`mt-1 text-[11px] text-[var(--color-fg-3)]`,s),children:e});return(0,W.jsxs)(W.Fragment,{children:[o===`above`&&u,(0,W.jsx)(`div`,{className:U(`font-mono font-medium tabular-nums`,a===`center`&&`text-center`,Es[r],c),children:t}),o===`below`&&u,n&&(0,W.jsx)(`div`,{className:U(`mt-1 text-[10px] font-mono text-[var(--color-fg-3)]`,a===`center`&&`text-center`,l),children:n})]})}function As({className:e,contentClassName:t,label:n,value:r,sub:a,tone:o,align:s,labelPlacement:c,labelClassName:l,valueClassName:u,subClassName:d,...f}){return(0,W.jsx)(G,{className:e,...f,children:(0,W.jsx)(q,{className:U(`py-3`,s===`center`&&`text-center`,t),children:(0,W.jsx)(ks,{label:n,value:r,sub:a,tone:o,align:s,labelPlacement:c,labelClassName:l,valueClassName:u,subClassName:d})})})}function js({className:e,...t}){return(0,W.jsx)(`div`,{className:U(`rounded-sm border border-[var(--color-line-0)] bg-[var(--color-surface-1)] p-3`,t.align===`center`&&`text-center`,e),children:(0,W.jsx)(ks,{...t})})}function Ms({pct:e,tone:t=`green`,markerPct:n,className:r,barClassName:a,markerTitle:o}){let s=Math.max(0,Math.min(100,e)),c=n===void 0?null:Math.max(0,Math.min(100,n));return(0,W.jsxs)(`div`,{className:U(`relative w-full overflow-hidden rounded-sm bg-[var(--color-surface-3)]`,r),children:[(0,W.jsx)(`div`,{className:U(`h-full rounded-sm transition-all duration-500`,Ds[t],a),style:{width:`${s}%`}}),c!==null&&(0,W.jsx)(`div`,{className:`absolute top-0 h-full w-0.5 bg-[var(--color-brand)]/70`,style:{left:`${c}%`},title:o})]})}function Ns({label:e,value:t,tone:n=`neutral`,breached:r=!1,breachLabel:a=`limit exceeded`,trendData:o,trendColor:s,threshold:c,maxValue:l,footer:u,className:d,valueClassName:f}){return(0,W.jsxs)(G,{className:d,children:[(0,W.jsxs)(K,{className:`py-2`,children:[(0,W.jsx)(`span`,{className:`overline`,children:e}),r&&(0,W.jsx)(`span`,{className:`text-[10px] font-mono uppercase tracking-wider text-red-300`,children:a})]}),(0,W.jsxs)(q,{children:[(0,W.jsxs)(`div`,{className:`flex items-center justify-between gap-3`,children:[(0,W.jsx)(`div`,{className:U(`text-2xl font-mono font-medium tabular-nums`,Es[n],f),children:t}),(o?.length??0)>1&&s&&(0,W.jsx)(hr,{data:o??[],width:80,height:28,color:s,threshold:c,maxValue:l})]}),u]})]})}function Ps({profile:e,children:t}){return(0,W.jsxs)(`div`,{className:`space-y-2`,children:[(0,W.jsxs)(`div`,{className:`flex items-center gap-4 text-[11px] font-mono text-[var(--color-fg-3)]`,children:[(0,W.jsxs)(`span`,{children:[`nodes:`,` `,(0,W.jsx)(`span`,{className:`text-[var(--color-fg-1)]`,children:e.nodes.length})]}),(0,W.jsxs)(`span`,{children:[`duration:`,` `,(0,W.jsxs)(`span`,{className:`text-[var(--color-fg-1)]`,children:[((e.endTime-e.startTime)/1e3).toFixed(0),`ms`]})]}),(0,W.jsxs)(`span`,{children:[`samples:`,` `,(0,W.jsx)(`span`,{className:`text-[var(--color-fg-1)]`,children:e.samples?.length??0})]})]}),(0,W.jsx)(`div`,{className:`flex gap-3 text-[10px] font-mono text-[var(--color-fg-3)]`,children:Os.map(e=>(0,W.jsxs)(`span`,{className:`flex items-center`,children:[(0,W.jsx)(`span`,{className:`mr-1 inline-block h-2.5 w-2.5 rounded-[1px]`,style:{background:e.color}}),e.label]},e.label))}),t]})}function Fs({memory:e,formatValue:t}){return(0,W.jsx)(`div`,{className:`grid grid-cols-4 gap-3`,children:[{label:`RSS`,value:t(e.rss)},{label:`Heap Total`,value:t(e.heapTotal)},{label:`Heap Used`,value:t(e.heapUsed)},{label:`External`,value:t(e.external)}].map(e=>(0,W.jsx)(js,{align:`center`,label:e.label,value:e.value,valueClassName:`text-lg font-medium text-[var(--color-fg-0)]`},e.label))})}var Is=3;function Ls(e){return e===null?`—`:e<1e6?`${(e/1e3).toFixed(0)}µs`:`${(e/1e6).toFixed(1)}ms`}var Rs=[`counters-updated`,`activity-updated`,`pending-changed`,`runtime-tick`,`limits-breach`];function zs({info:e}){let t=e.tier===`pro`||e.tier===`enterprise`,n=e.status===`needs_reauth`,r=e.pct_used??0,a=r>=90?`bg-red-500`:r>=70?`bg-amber-500`:`bg-emerald-500`;return(0,W.jsxs)(G,{className:n?`border-l-2 border-l-amber-500/70`:t?`border-l-2 border-l-emerald-500/70`:`border-l-2 border-l-sky-500/70`,children:[(0,W.jsxs)(K,{children:[(0,W.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,W.jsx)(`span`,{className:`text-xs font-mono uppercase tracking-wider text-[var(--color-fg-3)]`,children:`license`}),(0,W.jsx)(lr,{variant:t?`green`:n?`amber`:`blue`,children:e.tier_label}),e.fleet_enrolled&&(0,W.jsx)(lr,{variant:`gray`,children:`fleet`})]}),e.email&&(0,W.jsx)(`span`,{className:`text-xs text-[var(--color-fg-3)]`,children:e.email})]}),(0,W.jsxs)(q,{className:`space-y-3`,children:[n&&e.detail&&(0,W.jsxs)(`div`,{className:`rounded border border-amber-500/40 bg-amber-500/10 px-3 py-2 text-xs text-amber-200`,children:[e.detail,` — run `,(0,W.jsx)(`code`,{className:`font-mono`,children:`ssg auth login`})]}),(0,W.jsxs)(`div`,{children:[(0,W.jsxs)(`div`,{className:`flex justify-between text-xs text-[var(--color-fg-2)]`,children:[(0,W.jsx)(`span`,{children:`evals today`}),(0,W.jsxs)(`span`,{children:[e.evals_today.toLocaleString(),e.eval_daily_limit!==null&&(0,W.jsxs)(W.Fragment,{children:[(0,W.jsx)(`span`,{className:`text-[var(--color-fg-3)]`,children:` / `}),e.eval_daily_limit.toLocaleString()]}),e.eval_daily_limit===null&&(0,W.jsx)(`span`,{className:`text-[var(--color-fg-3)]`,children:` · unlimited`})]})]}),e.eval_daily_limit!==null&&(0,W.jsx)(`div`,{className:`mt-1 h-1.5 w-full overflow-hidden rounded-full bg-[var(--color-bg-2)]`,children:(0,W.jsx)(`div`,{className:`h-full transition-all ${a}`,style:{width:`${r}%`}})})]}),!t&&(0,W.jsxs)(`a`,{href:e.upgrade_url,target:`_blank`,rel:`noopener noreferrer`,className:`inline-flex items-center gap-1 text-xs text-[var(--color-brand)] hover:underline`,children:[`Upgrade to Pro · $`,e.pricing.pro_monthly_usd,`/mo →`]}),t&&e.retention_days>0&&(0,W.jsxs)(`div`,{className:`text-[10px] text-[var(--color-fg-3)] font-mono uppercase tracking-wider`,children:[`cloud retention: `,e.retention_days,` days`]})]})]})}function Bs(e){return new Date(e*1e3).toLocaleTimeString()}async function Vs(e,t){await fetch(`/api/decide/${e}?decision=${t}`,{method:`POST`,headers:Ae()})}async function Hs(e,t){let n=await fetch(`/api/rules/toggle`,{method:`POST`,headers:{"Content-Type":`application/json`,Accept:`application/json`,...Ae()},body:JSON.stringify({ruleId:e,file:t})});if(!n.ok)throw Error(`Toggle failed: ${n.status}`)}async function Us(e,t){let n=await fetch(`/api/rules/toggle`,{method:`POST`,headers:{"Content-Type":`application/json`,Accept:`application/json`,...Ae()},body:JSON.stringify({ruleId:e,file:t})});if(!n.ok)throw Error(`Toggle failed: ${n.status}`)}async function Ws(e,t){let n=await fetch(`/api/rules/update-decision`,{method:`POST`,headers:{"Content-Type":`application/json`,...Ae()},body:JSON.stringify({ruleId:e,file:t,decision:`ask`})});if(!n.ok)throw Error(`Update decision failed: ${n.status}`)}async function Gs(e,t){let n=await fetch(`/api/rules/update-decision`,{method:`POST`,headers:{"Content-Type":`application/json`,...Ae()},body:JSON.stringify({ruleId:e,file:t,decision:`block`})});if(!n.ok)throw Error(`Update decision failed: ${n.status}`)}function Ks({ruleId:e}){return e?(0,W.jsx)(`a`,{href:`/rules?highlight=${encodeURIComponent(e)}`,className:`text-[var(--color-brand)] hover:underline text-xs font-mono break-all`,title:`Go to rule: ${e}`,children:e}):(0,W.jsx)(`span`,{className:`text-[var(--color-fg-4)]`,children:`—`})}function qs({title:e,right:t}){return(0,W.jsxs)(`div`,{className:`flex items-center justify-between mb-3`,children:[(0,W.jsx)(`h2`,{className:`overline text-[11px]`,children:e}),t]})}function Js({children:e}){return(0,W.jsx)(`div`,{className:`rounded-sm border border-dashed border-[var(--color-line-1)] bg-[var(--color-surface-1)]/50 px-4 py-6 text-center text-[11px] font-mono text-[var(--color-fg-3)]`,children:e})}function Ys({item:e,onDisable:t,onChangeToAsk:n,onUndo:r}){let[a,o]=(0,v.useState)(!1),[s,c]=(0,v.useState)(`idle`),[l,u]=(0,v.useState)(!1),d=ar(e.tool,e.input),f=e.rule_id&&e.source_file,p=e.decision===`force`?`force`:`block`,m=p===`force`?`amber`:`red`,h=async()=>{c(`loading`);try{await n(),c(`done-ask`)}catch{c(`error`)}},g=async()=>{c(`loading`);try{await t(),c(`done-disable`)}catch{c(`error`)}},_=async()=>{u(!0);try{await r(s===`done-disable`?`disable`:`ask`),c(`idle`)}catch{}finally{u(!1)}},y=s===`done-ask`||s===`done-disable`;return(0,W.jsx)(G,{className:`border-l-2 ${y?`border-l-[var(--color-line-1)]`:p===`force`?`border-l-amber-400/60`:`border-l-red-500/60`} ${y?`opacity-60`:``}`,children:(0,W.jsxs)(`div`,{className:`px-3 py-3`,children:[y&&(0,W.jsxs)(`div`,{className:`flex items-center justify-between rounded-sm px-2.5 py-1.5 mb-3 text-[11px] font-mono ${s===`done-ask`?`bg-sky-500/5 border border-sky-500/25 text-sky-300`:`bg-amber-500/5 border border-amber-500/25 text-amber-300`}`,children:[(0,W.jsx)(`span`,{className:`truncate`,children:s===`done-ask`?`✓ rule "${e.rule_id}" → ask · prompts next time`:`✓ rule "${e.rule_id}" disabled · no longer blocks`}),(0,W.jsx)(`button`,{onClick:_,disabled:l,className:`ml-3 shrink-0 px-2 py-0.5 rounded-sm border border-current/40 hover:bg-white/5 transition-colors cursor-pointer disabled:opacity-50 uppercase tracking-wider text-[10px]`,children:l?`…`:`↩ undo`})]}),s===`error`&&(0,W.jsxs)(`div`,{className:`flex items-center justify-between rounded-sm px-2.5 py-1.5 mb-3 text-[11px] font-mono bg-red-500/5 border border-red-500/25 text-red-300`,children:[(0,W.jsx)(`span`,{children:`failed to update rule — check server logs`}),(0,W.jsx)(`button`,{onClick:()=>c(`idle`),className:`ml-3 shrink-0 px-2 py-0.5 rounded-sm border border-current/40 hover:bg-white/5 transition-colors cursor-pointer uppercase tracking-wider text-[10px]`,children:`retry`})]}),(0,W.jsxs)(`div`,{className:`flex items-start justify-between gap-3`,children:[(0,W.jsxs)(`div`,{className:`flex-1 min-w-0`,children:[(0,W.jsxs)(`div`,{className:`flex items-center gap-2 mb-1.5 flex-wrap`,children:[(0,W.jsx)(lr,{variant:y?s===`done-ask`?`blue`:`gray`:m,children:y?s===`done-ask`?`ask`:`disabled`:p}),(0,W.jsx)(`code`,{className:`text-[var(--color-brand)] text-xs font-mono`,children:e.tool}),(0,W.jsx)(`span`,{className:`text-[var(--color-fg-4)] text-xs`,children:`·`}),(0,W.jsx)(`span`,{className:`text-[var(--color-fg-3)] text-[11px] font-mono tabular-nums`,children:Bs(e.timestamp)}),e.repeat_count>1&&(0,W.jsxs)(lr,{variant:`gray`,children:[`×`,e.repeat_count]})]}),(0,W.jsx)(`div`,{className:`text-xs font-mono truncate cursor-pointer hover:text-[var(--color-fg-0)] transition-colors ${y?`text-[var(--color-fg-4)] line-through`:`text-[var(--color-fg-1)]`}`,title:d,onClick:()=>o(e=>!e),children:d})]}),f&&!y&&s!==`error`&&(0,W.jsxs)(`div`,{className:`flex items-center gap-1.5 shrink-0 pt-0.5`,children:[(0,W.jsxs)(`button`,{onClick:h,disabled:s===`loading`,className:`inline-flex items-center gap-1 h-7 px-2.5 rounded-sm text-[11px] font-medium uppercase tracking-wider bg-sky-500/8 text-sky-300 border border-sky-500/25 hover:bg-sky-500/15 hover:border-sky-500/40 transition-colors cursor-pointer disabled:opacity-50 disabled:cursor-not-allowed`,children:[s===`loading`?(0,W.jsx)(`span`,{className:`animate-spin`,children:`⟳`}):(0,W.jsxs)(`svg`,{width:`11`,height:`11`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2.5`,strokeLinecap:`round`,strokeLinejoin:`round`,children:[(0,W.jsx)(`circle`,{cx:`12`,cy:`12`,r:`10`}),(0,W.jsx)(`path`,{d:`M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3`}),(0,W.jsx)(`line`,{x1:`12`,y1:`17`,x2:`12.01`,y2:`17`})]}),`ask instead`]}),(0,W.jsxs)(`button`,{onClick:g,disabled:s===`loading`,className:`inline-flex items-center gap-1 h-7 px-2.5 rounded-sm text-[11px] font-medium uppercase tracking-wider bg-red-500/8 text-red-300 border border-red-500/25 hover:bg-red-500/15 hover:border-red-500/40 transition-colors cursor-pointer disabled:opacity-50 disabled:cursor-not-allowed`,children:[s===`loading`?(0,W.jsx)(`span`,{className:`animate-spin`,children:`⟳`}):(0,W.jsxs)(`svg`,{width:`11`,height:`11`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2.5`,strokeLinecap:`round`,strokeLinejoin:`round`,children:[(0,W.jsx)(`circle`,{cx:`12`,cy:`12`,r:`10`}),(0,W.jsx)(`line`,{x1:`15`,y1:`9`,x2:`9`,y2:`15`}),(0,W.jsx)(`line`,{x1:`9`,y1:`9`,x2:`15`,y2:`15`})]}),`disable rule`]})]})]}),(0,W.jsxs)(`div`,{className:`flex flex-wrap items-center gap-x-4 gap-y-1 mt-2 text-[11px] font-mono`,children:[e.rule_id&&(0,W.jsxs)(`span`,{className:`flex items-center gap-1`,children:[(0,W.jsx)(`span`,{className:`text-[var(--color-fg-4)] uppercase tracking-wider text-[10px]`,children:`rule`}),(0,W.jsx)(Ks,{ruleId:e.rule_id})]}),e.source_file&&(0,W.jsxs)(`span`,{className:`flex items-center gap-1`,children:[(0,W.jsx)(`span`,{className:`text-[var(--color-fg-4)] uppercase tracking-wider text-[10px]`,children:`src`}),(0,W.jsx)(`span`,{className:`text-[var(--color-fg-2)]`,children:e.source_file})]}),e.rules_evaluated!==null&&(0,W.jsxs)(`span`,{className:`flex items-center gap-1`,children:[(0,W.jsx)(`span`,{className:`text-[var(--color-fg-4)] uppercase tracking-wider text-[10px]`,children:`evals`}),(0,W.jsx)(`span`,{className:`text-[var(--color-fg-2)] tabular-nums`,children:e.rules_evaluated})]}),(0,W.jsxs)(`span`,{className:`flex items-center gap-1`,children:[(0,W.jsx)(`span`,{className:`text-[var(--color-fg-4)] uppercase tracking-wider text-[10px]`,children:`latency`}),(0,W.jsx)(`span`,{className:`text-[var(--color-fg-2)] tabular-nums`,children:Ls(e.duration_ns)})]}),(0,W.jsx)(`button`,{onClick:()=>o(e=>!e),className:`text-[var(--color-fg-3)] hover:text-[var(--color-fg-0)] transition-colors ml-auto cursor-pointer uppercase tracking-wider text-[10px]`,children:a?`▾ hide`:`▸ details`})]}),a&&(0,W.jsxs)(`div`,{className:`mt-3 pt-3 border-t border-[var(--color-line-0)]`,children:[(0,W.jsx)(`div`,{className:`overline mb-2`,children:`full input`}),(0,W.jsx)(Ts,{children:(()=>{try{return JSON.stringify(JSON.parse(e.input),null,2)}catch{return e.input}})()})]})]})})}function Xs(){let e=je(Rs),t=[e[`counters-updated`],e[`activity-updated`],e[`pending-changed`]],{data:n}=z(`/api/state/counters`,t),{data:r,refetch:a}=z(`/api/json/pending`,t),{data:o,refetch:s}=z(`/api/json/blocked`,t),{data:c}=z(`/api/state/activity`,t),{data:l}=z(`/api/state/runtime`,[e[`runtime-tick`]]),{data:u}=z(`/api/json/limits`,[e[`limits-breach`]]),{data:d}=z(`/api/json/license`,[e[`activity-updated`]]),[f,p]=(0,v.useState)(!1),m=o?.reduce((e,t)=>e+t.repeat_count,0)??0,h=[{label:`allow`,value:n?.allow??0,tone:`green`},{label:`block`,value:(n?.block??0)+(n?.force??0),tone:`red`},{label:`force`,value:n?.force??0,tone:`amber`},{label:`pending`,value:n?.pending??0,tone:`blue`},{label:`log`,value:n?.log??0,tone:`gray`}];return(0,W.jsxs)(`div`,{ref:Dt({from:`first`}),className:`space-y-8`,children:[(0,W.jsx)(`div`,{className:`grid grid-cols-5 gap-2`,children:h.map(e=>(0,W.jsx)(As,{align:`left`,label:e.label,value:e.value,tone:e.tone,labelPlacement:`above`,contentClassName:`py-3`,valueClassName:`text-2xl font-medium`,"data-reveal":!0},e.label))}),d&&(0,W.jsx)(`div`,{"data-reveal":!0,children:(0,W.jsx)(zs,{info:d})}),l&&(0,W.jsxs)(`div`,{"data-reveal":!0,className:`grid grid-cols-2 gap-2`,children:[(0,W.jsx)(Ns,{label:`cpu`,value:`${l.cpu_pct??`—`}%`,tone:u?.breaches.cpu?`red`:(l.cpu_pct??0)>=60?`amber`:`green`,breached:u?.breaches.cpu??!1,trendData:l.history?.cpu_pct,trendColor:u?.breaches.cpu?`#f87171`:`#34d399`,threshold:u?.config.cpuLimitPct,maxValue:100,className:u?.breaches.cpu?`border-red-500/40`:``,footer:(0,W.jsx)(`a`,{href:`/monitor`,className:`mt-1 block text-[10px] font-mono uppercase tracking-wider text-[var(--color-fg-3)] hover:text-[var(--color-brand)]`,children:`view details →`})}),(0,W.jsx)(Ns,{label:`memory rss`,value:(0,W.jsxs)(W.Fragment,{children:[l.memory_rss_mb??`—`,(0,W.jsx)(`span`,{className:`ml-1 text-sm text-[var(--color-fg-3)]`,children:`MB`})]}),tone:u?.breaches.memory?`red`:`neutral`,breached:u?.breaches.memory??!1,trendData:l.history?.memory_rss_mb,trendColor:u?.breaches.memory?`#f87171`:`#38bdf8`,threshold:u?.config.memoryLimitMb,className:u?.breaches.memory?`border-red-500/40`:``,footer:(0,W.jsx)(`a`,{href:`/monitor`,className:`mt-1 block text-[10px] font-mono uppercase tracking-wider text-[var(--color-fg-3)] hover:text-[var(--color-brand)]`,children:`view details →`})})]}),(0,W.jsxs)(`section`,{"data-reveal":!0,children:[(0,W.jsx)(qs,{title:`pending approvals`}),!r||r.length===0?(0,W.jsx)(Js,{children:`no pending approvals`}):(0,W.jsx)(`div`,{className:`space-y-2`,children:r.map(e=>(0,W.jsxs)(G,{className:`border-l-2 border-l-sky-500/50`,children:[(0,W.jsxs)(K,{children:[(0,W.jsx)(`span`,{className:`text-sm text-[var(--color-fg-0)]`,children:e.ruleMessage}),(0,W.jsxs)(`div`,{className:`flex gap-2`,children:[(0,W.jsx)(J,{size:`sm`,variant:`primary`,onClick:async()=>{await Vs(e.id,`allow`),a()},children:`approve`}),(0,W.jsx)(J,{size:`sm`,variant:`danger`,onClick:async()=>{await Vs(e.id,`block`),a()},children:`deny`})]})]}),(0,W.jsxs)(q,{className:`space-y-2 text-xs`,children:[(0,W.jsxs)(`div`,{className:`flex gap-2 items-center`,children:[(0,W.jsx)(`span`,{className:`overline`,children:`tool`}),(0,W.jsx)(`code`,{className:`text-[var(--color-brand)] font-mono`,children:e.toolCall.tool})]}),e.prompt&&(0,W.jsxs)(`div`,{className:`flex gap-2 items-start`,children:[(0,W.jsx)(`span`,{className:`overline pt-0.5`,children:`prompt`}),(0,W.jsx)(`span`,{className:`text-[var(--color-fg-1)] truncate`,children:e.prompt})]}),(0,W.jsx)(Ts,{children:JSON.stringify(e.toolCall.input,null,2)})]})]},e.id))})]}),o&&o.length>0&&(0,W.jsxs)(`section`,{"data-reveal":!0,children:[(0,W.jsx)(qs,{title:`blocked actions`,right:(0,W.jsxs)(`span`,{className:`text-[11px] font-mono text-[var(--color-fg-3)]`,children:[o.length,` active`,m>o.length?` · ${m} total hits`:``]})}),(0,W.jsx)(`div`,{className:`space-y-2`,children:(f?o:o.slice(0,Is)).map(e=>(0,W.jsx)(Ys,{item:e,onDisable:async()=>{await Hs(e.rule_id,e.source_file),s()},onChangeToAsk:async()=>{await Ws(e.rule_id,e.source_file),s()},onUndo:async t=>{t===`disable`?await Us(e.rule_id,e.source_file):await Gs(e.rule_id,e.source_file),s()}},`${e.decision}:${e.rule_id??`none`}:${e.tool}:${e.timestamp}:${e.input}`))}),o.length>Is&&(0,W.jsx)(`div`,{className:`mt-3 flex justify-center`,children:(0,W.jsx)(J,{size:`sm`,variant:`secondary`,onClick:()=>p(e=>!e),children:f?`↑ show less`:`↓ show ${o.length-Is} more`})})]}),(0,W.jsxs)(`section`,{"data-reveal":!0,children:[(0,W.jsx)(qs,{title:`recent audit log`,right:c&&c.length>0?(0,W.jsx)(`a`,{href:`/audit`,className:`text-[11px] font-mono uppercase tracking-wider text-[var(--color-fg-3)] hover:text-[var(--color-brand)] transition-colors`,children:`view all →`}):void 0}),!c||c.length===0?(0,W.jsx)(Js,{children:`no audit entries yet`}):(0,W.jsx)(`div`,{className:`space-y-1.5`,children:c.slice(0,15).map(e=>(0,W.jsx)(ws,{row:e},e.id))})]})]})}var Zs=[`rules-changed`],Qs=[`block`,`ask`,`log`,`allow`,`force`,`shadow`],$s={block:`text-red-300`,deny:`text-red-300`,ask:`text-sky-300`,allow:`text-emerald-300`,log:`text-[var(--color-fg-3)]`,force:`text-amber-300`,shadow:`text-violet-300`};async function ec(e,t){await fetch(`/api/rules/toggle`,{method:`POST`,headers:{"Content-Type":`application/json`,Accept:`application/json`,...Ae()},body:JSON.stringify({ruleId:e,file:t})})}async function tc(e,t,n){await fetch(`/api/rules/update-decision`,{method:`POST`,headers:{"Content-Type":`application/json`,...Ae()},body:JSON.stringify({ruleId:e,file:t,decision:n})})}function nc({rule:e,file:t,onToggle:n}){let[r,a]=(0,v.useState)(!1),o=(0,v.useRef)(null),s=(0,v.useCallback)(()=>{if(!e.enabled){n();return}a(!0),o.current=setTimeout(()=>a(!1),3e3)},[e.enabled,n]);return(0,v.useEffect)(()=>()=>{o.current&&clearTimeout(o.current)},[]),r?(0,W.jsxs)(`div`,{className:`flex items-center gap-1.5 shrink-0`,children:[(0,W.jsx)(`button`,{onClick:()=>{a(!1),n()},className:`text-[11px] font-mono uppercase tracking-wider bg-red-500/8 border border-red-500/30 text-red-300 hover:bg-red-500/15 rounded-sm px-2 py-0.5 cursor-pointer transition-colors`,children:`disable`}),(0,W.jsx)(`button`,{onClick:()=>a(!1),className:`text-[11px] font-mono uppercase tracking-wider text-[var(--color-fg-3)] hover:text-[var(--color-fg-1)] cursor-pointer`,children:`cancel`})]}):(0,W.jsxs)(`label`,{className:`flex items-center gap-2 cursor-pointer shrink-0`,children:[(0,W.jsx)(`input`,{type:`checkbox`,className:`w-3.5 h-3.5 accent-[var(--color-brand)] cursor-pointer`,checked:e.enabled,onChange:s}),(0,W.jsx)(`span`,{className:`text-[10px] font-mono uppercase tracking-wider ${e.enabled?`text-[var(--color-fg-1)]`:`text-[var(--color-fg-4)]`}`,children:e.enabled?`on`:`off`})]})}function rc(){let[e,t]=(0,v.useState)(null),[n,r]=(0,v.useState)(!1),[a,o]=(0,v.useState)(!1);(0,v.useEffect)(()=>{let e=!1;return(async()=>{try{let n=await fetch(`/api/json/rule-write-enforcement`,{headers:{Accept:`application/json`}});if(!n.ok)return;let r=await n.json();!e&&typeof r.enforced==`boolean`&&t(r.enforced)}catch{}})(),()=>{e=!0}},[]);async function s(e){r(!0);try{let n=await fetch(`/api/json/rule-write-enforcement`,{method:`POST`,headers:{"Content-Type":`application/json`,...Ae()},body:JSON.stringify({enforced:e})});if(n.ok){let e=await n.json();typeof e.enforced==`boolean`&&t(e.enforced)}}finally{r(!1),o(!1)}}if(e===null)return null;let c=!e;return(0,W.jsx)(G,{className:c?`border-amber-500/40 bg-amber-500/5`:`border-[var(--color-line-1)]`,children:(0,W.jsx)(q,{className:`px-3 py-2.5`,children:(0,W.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,W.jsxs)(`div`,{className:`flex-1 min-w-0`,children:[(0,W.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,W.jsx)(`span`,{className:`text-[11px] font-mono uppercase tracking-wider text-[var(--color-fg-1)]`,children:`rule-write protection`}),(0,W.jsx)(`span`,{className:`text-[11px] font-mono uppercase tracking-wider ${c?`text-amber-300`:`text-emerald-300`}`,children:c?`disabled`:`enforced`})]}),(0,W.jsx)(`p`,{className:`text-[11px] text-[var(--color-fg-3)] mt-1 leading-snug`,children:c?`Agents can currently Write/Edit .rules files. Turn this back on when you finish authoring.`:`Agents cannot Write/Edit/MultiEdit any .sigmashake/rules/**/*.rules file. Disable only when curating rulesets.`})]}),(0,W.jsx)(`div`,{className:`shrink-0`,children:a?(0,W.jsxs)(`div`,{className:`flex items-center gap-1.5`,children:[(0,W.jsx)(`button`,{onClick:()=>s(!1),disabled:n,className:`text-[11px] font-mono uppercase tracking-wider bg-amber-500/10 border border-amber-500/40 text-amber-200 hover:bg-amber-500/20 rounded-sm px-2 py-0.5 cursor-pointer transition-colors disabled:opacity-50`,children:`disable`}),(0,W.jsx)(`button`,{onClick:()=>o(!1),disabled:n,className:`text-[11px] font-mono uppercase tracking-wider text-[var(--color-fg-3)] hover:text-[var(--color-fg-1)] cursor-pointer disabled:opacity-50`,children:`cancel`})]}):(0,W.jsx)(`button`,{onClick:()=>{e?o(!0):s(!0)},disabled:n,className:`text-[11px] font-mono uppercase tracking-wider border rounded-sm px-2.5 py-0.5 cursor-pointer transition-colors disabled:opacity-50 ${c?`bg-emerald-500/10 border-emerald-500/40 text-emerald-200 hover:bg-emerald-500/20`:`bg-[var(--color-surface-1)] border-[var(--color-line-1)] text-[var(--color-fg-1)] hover:bg-[var(--color-surface-2)]`}`,children:c?`enable`:`disable`})})]})})})}function ic(){let{data:e,refetch:t}=z(`/api/json/rules`,[je(Zs)[`rules-changed`]]),[n,r]=(0,v.useState)(``),a=new URLSearchParams(window.location.search).get(`highlight`)??``,o=(0,v.useRef)(null);if((0,v.useEffect)(()=>{o.current&&o.current.scrollIntoView({behavior:`smooth`,block:`center`})},[e,a]),!e)return(0,W.jsx)(`p`,{className:`text-[11px] font-mono uppercase tracking-wider text-[var(--color-fg-3)]`,children:`loading rules…`});if(e.rulesets.length===0)return(0,W.jsxs)(`div`,{className:`rounded-sm border border-dashed border-[var(--color-line-1)] bg-[var(--color-surface-1)]/50 p-10 text-center`,children:[(0,W.jsx)(`p`,{className:`text-sm text-[var(--color-fg-2)] mb-2`,children:`No .rules files found.`}),(0,W.jsx)(`a`,{href:`/hub`,className:`text-[11px] font-mono uppercase tracking-wider text-[var(--color-brand)] hover:underline`,children:`→ browse hub to install rulesets`})]});let s=n.toLowerCase(),c=e.rulesets.map(e=>({...e,rules:s?e.rules.filter(e=>e.id.toLowerCase().includes(s)||e.message.toLowerCase().includes(s)):e.rules})).filter(e=>!s||e.rules.length>0),l=e.rulesets.reduce((e,t)=>e+t.rules.length,0),u=e.rulesets.reduce((e,t)=>e+t.rules.filter(e=>e.enabled).length,0);return(0,W.jsxs)(`div`,{className:`space-y-5`,children:[(0,W.jsxs)(`div`,{className:`flex items-center gap-4`,children:[(0,W.jsxs)(`div`,{children:[(0,W.jsx)(`h1`,{className:`overline text-[11px]`,children:`rules`}),(0,W.jsxs)(`div`,{className:`flex items-baseline gap-3 mt-1`,children:[(0,W.jsxs)(`span`,{className:`font-mono text-sm text-[var(--color-fg-0)] tabular-nums`,children:[u,(0,W.jsxs)(`span`,{className:`text-[var(--color-fg-4)]`,children:[`/`,l]}),(0,W.jsx)(`span`,{className:`text-[var(--color-fg-3)] ml-1.5 text-[11px] uppercase tracking-wider`,children:`active`})]}),(0,W.jsx)(`span`,{className:`text-[var(--color-fg-4)]`,children:`·`}),(0,W.jsxs)(`span`,{className:`font-mono text-[11px] text-[var(--color-fg-3)] uppercase tracking-wider`,children:[e.files.length,` file`,e.files.length===1?``:`s`]})]})]}),(0,W.jsx)(`div`,{className:`ml-auto relative`,children:(0,W.jsx)(`input`,{type:`text`,placeholder:`search rules…`,value:n,onChange:e=>r(e.target.value),className:`bg-[var(--color-surface-1)] border border-[var(--color-line-1)] text-[var(--color-fg-1)] text-xs rounded-sm px-2.5 py-1.5 w-56 focus:outline-none focus:border-[var(--color-brand)]/50 placeholder:text-[var(--color-fg-4)] font-mono`})})]}),(0,W.jsx)(rc,{}),c.length===0&&(0,W.jsxs)(`div`,{className:`rounded-sm border border-dashed border-[var(--color-line-1)] px-4 py-6 text-center text-[11px] font-mono text-[var(--color-fg-3)]`,children:[`no rules match "`,n,`"`]}),(0,W.jsx)(`div`,{className:`space-y-3`,children:c.map(e=>{let n=e.rules.some(e=>e.id===a),r=e.rules.filter(e=>e.enabled).length;return(0,W.jsx)(G,{children:(0,W.jsxs)(`details`,{open:n||!s,children:[(0,W.jsxs)(`summary`,{className:`flex items-center gap-2 px-3 py-2 cursor-pointer list-none select-none hover:bg-[var(--color-surface-2)]/70 border-b border-[var(--color-line-0)]`,children:[(0,W.jsxs)(`svg`,{className:`text-[var(--color-fg-3)] shrink-0`,width:`12`,height:`12`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2`,children:[(0,W.jsx)(`path`,{d:`M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z`}),(0,W.jsx)(`polyline`,{points:`14 2 14 8 20 8`})]}),(0,W.jsx)(`code`,{className:`text-xs text-[var(--color-fg-0)] font-mono`,children:e.file}),(0,W.jsxs)(`span`,{className:`ml-auto font-mono text-[11px] text-[var(--color-fg-3)] tabular-nums`,children:[r,(0,W.jsxs)(`span`,{className:`text-[var(--color-fg-4)]`,children:[`/`,e.rules.length]})]})]}),(0,W.jsxs)(q,{className:`py-0`,children:[e.rules.length===0?(0,W.jsx)(`p`,{className:`text-[11px] font-mono text-[var(--color-fg-3)] py-3`,children:`no rules in this file`}):(0,W.jsx)(`div`,{className:`divide-y divide-[var(--color-line-0)]`,children:e.rules.map(n=>{let r=n.id===a;return(0,W.jsxs)(`div`,{ref:r?o:null,className:`py-2.5 flex items-start justify-between gap-4 ${r?`bg-amber-400/8 border-l-2 border-l-amber-400/60 -mx-3 px-3 -my-px`:``}`,children:[(0,W.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,W.jsxs)(`div`,{className:`flex items-center gap-2 mb-1 flex-wrap`,children:[(0,W.jsx)(`select`,{value:n.decision,onChange:async r=>{await tc(n.id,e.file,r.target.value),t()},className:`bg-[var(--color-surface-0)] border border-[var(--color-line-1)] rounded-sm px-1.5 py-0.5 text-[11px] font-mono uppercase tracking-wider cursor-pointer focus:outline-none focus:border-[var(--color-brand)]/50 ${$s[n.decision]??`text-[var(--color-fg-2)]`}`,children:Qs.map(e=>(0,W.jsx)(`option`,{value:e,children:e},e))}),(0,W.jsx)(`code`,{className:`text-xs font-mono text-[var(--color-fg-0)] break-all`,children:n.id})]}),(0,W.jsx)(`p`,{className:`text-xs text-[var(--color-fg-2)] truncate`,children:n.message})]}),(0,W.jsx)(nc,{rule:n,file:e.file,onToggle:async()=>{await ec(n.id,e.file),t()}})]},n.id)})}),e.content&&(0,W.jsxs)(`details`,{className:`mt-3 pb-3`,children:[(0,W.jsx)(`summary`,{className:`overline cursor-pointer hover:text-[var(--color-fg-1)] select-none`,children:`raw source`}),(0,W.jsx)(`pre`,{className:`mt-2 p-3 bg-[var(--color-surface-0)] border border-[var(--color-line-0)] rounded-sm text-[11px] text-[var(--color-fg-2)] overflow-x-auto whitespace-pre-wrap break-words font-mono`,children:e.content})]})]})]})},e.file)})})]})}var ac=[``,`allow`,`block`,`force`,`ask`,`log`],oc=[``,`claude-code`,`gemini`,`antigravity`,`cursor`,`copilot`,`codex`,`pi`,`generic`],sc=50;function cc(){let[e,t]=(0,v.useState)(``),[n,r]=(0,v.useState)(``),[a,o]=(0,v.useState)(``),[s,c]=(0,v.useState)(``),[l,u]=(0,v.useState)(sc),d=je([`activity-updated`]),f=new URLSearchParams;e&&f.set(`decision`,e),n&&f.set(`tool`,n),a&&f.set(`client`,a);let{data:p,loading:m,error:h}=z(`/api/state/activity${f.size?`?`+f:``}`,[d[`activity-updated`],e,n,a]),g=e=>t=>{e(t.target.value),u(sc)},_=(0,v.useMemo)(()=>{if(!p)return[];let e=s.trim().toLowerCase();return e?p.filter(t=>t.tool.toLowerCase().includes(e)||t.decision.toLowerCase().includes(e)||(t.rule_id??``).toLowerCase().includes(e)||(t.client??``).toLowerCase().includes(e)||(t.source_file??``).toLowerCase().includes(e)||t.input.toLowerCase().includes(e)):p},[p,s]),y=_.slice(0,l),b=_.length>l,x=p?.length??0,S=_.length,C=`bg-[var(--color-surface-1)] border border-[var(--color-line-1)] text-[var(--color-fg-1)] text-[11px] font-mono rounded-sm px-2 py-1.5 focus:outline-none focus:border-[var(--color-brand)]/50 cursor-pointer`;return(0,W.jsxs)(`div`,{className:`space-y-4`,children:[(0,W.jsxs)(`div`,{className:`flex flex-col gap-2 sm:flex-row sm:items-start sm:justify-between`,children:[(0,W.jsxs)(`div`,{children:[(0,W.jsx)(`h1`,{className:`overline text-[11px]`,children:`audit log`}),p&&(0,W.jsx)(`p`,{className:`font-mono text-[11px] text-[var(--color-fg-3)] mt-1 tabular-nums`,children:s&&S!==x?`${S}/${x} events match`:`${x} events`})]}),(0,W.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,W.jsx)(`select`,{id:`audit-filter-decision`,value:e,onChange:g(t),className:C,children:ac.map(e=>(0,W.jsx)(`option`,{value:e,children:e||`all decisions`},e))}),(0,W.jsx)(`select`,{id:`audit-filter-client`,value:a,onChange:g(o),className:C,children:oc.map(e=>(0,W.jsx)(`option`,{value:e,children:e||`all clients`},e))}),(0,W.jsx)(`input`,{id:`audit-filter-tool`,type:`text`,placeholder:`filter by tool…`,value:n,onChange:g(r),className:`bg-[var(--color-surface-1)] border border-[var(--color-line-1)] text-[var(--color-fg-1)] text-[11px] font-mono rounded-sm px-2.5 py-1.5 w-36 focus:outline-none focus:border-[var(--color-brand)]/50 placeholder:text-[var(--color-fg-4)]`})]})]}),(0,W.jsxs)(`div`,{className:`relative`,children:[(0,W.jsxs)(`svg`,{className:`absolute left-3 top-1/2 -translate-y-1/2 text-[var(--color-fg-4)] pointer-events-none`,width:`13`,height:`13`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`,children:[(0,W.jsx)(`circle`,{cx:`11`,cy:`11`,r:`8`}),(0,W.jsx)(`line`,{x1:`21`,y1:`21`,x2:`16.65`,y2:`16.65`})]}),(0,W.jsx)(`input`,{id:`audit-search`,type:`text`,placeholder:`search tool, command, path, rule id, input fields…`,value:s,onChange:e=>{c(e.target.value),u(sc)},className:`w-full bg-[var(--color-surface-1)] border border-[var(--color-line-1)] text-[var(--color-fg-1)] text-sm rounded-sm pl-9 pr-10 py-2.5 focus:outline-none focus:border-[var(--color-brand)]/50 placeholder:text-[var(--color-fg-4)] font-mono transition-colors`}),s&&(0,W.jsx)(`button`,{onClick:()=>{c(``),u(sc)},className:`absolute right-3 top-1/2 -translate-y-1/2 text-[var(--color-fg-4)] hover:text-[var(--color-fg-1)] transition-colors cursor-pointer`,title:`Clear search`,children:(0,W.jsxs)(`svg`,{width:`13`,height:`13`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2.5`,strokeLinecap:`round`,strokeLinejoin:`round`,children:[(0,W.jsx)(`line`,{x1:`18`,y1:`6`,x2:`6`,y2:`18`}),(0,W.jsx)(`line`,{x1:`6`,y1:`6`,x2:`18`,y2:`18`})]})})]}),p&&p.length>0&&(0,W.jsxs)(`div`,{className:`flex items-center gap-3 px-3 font-mono text-[10px] uppercase tracking-widest text-[var(--color-fg-4)] select-none`,children:[(0,W.jsx)(`span`,{className:`w-3`}),(0,W.jsx)(`span`,{className:`w-14`,children:`time`}),(0,W.jsx)(`span`,{className:`w-14`,children:`decision`}),(0,W.jsx)(`span`,{className:`w-28`,children:`tool`}),(0,W.jsx)(`span`,{className:`flex-1`,children:`preview`}),(0,W.jsx)(`span`,{children:`client`})]}),h&&(0,W.jsxs)(`p`,{className:`text-sm text-red-300 font-mono`,children:[`failed to load audit log: `,h]}),m&&!p&&(0,W.jsx)(`div`,{className:`space-y-1.5`,children:Array.from({length:10}).map((e,t)=>(0,W.jsx)(`div`,{className:`h-9 bg-[var(--color-surface-1)] rounded-sm border border-[var(--color-line-0)] border-l-2 border-l-[var(--color-line-2)] shimmer`},t))}),!m&&!h&&_.length===0&&(0,W.jsxs)(`div`,{className:`rounded-sm border border-dashed border-[var(--color-line-1)] py-16 flex flex-col items-center justify-center text-center`,children:[(0,W.jsxs)(`svg`,{className:`text-[var(--color-fg-4)] mb-3`,width:`32`,height:`32`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`1.5`,strokeLinecap:`round`,strokeLinejoin:`round`,children:[(0,W.jsx)(`circle`,{cx:`11`,cy:`11`,r:`8`}),(0,W.jsx)(`line`,{x1:`21`,y1:`21`,x2:`16.65`,y2:`16.65`})]}),(0,W.jsx)(`p`,{className:`text-xs font-mono text-[var(--color-fg-3)] uppercase tracking-wider`,children:s?`no events match your search`:`no audit entries yet`}),s&&(0,W.jsx)(`button`,{onClick:()=>c(``),className:`mt-3 text-[11px] font-mono uppercase tracking-wider text-[var(--color-brand)] hover:underline cursor-pointer`,children:`clear search`})]}),y.length>0&&(0,W.jsxs)(W.Fragment,{children:[(0,W.jsx)(`div`,{className:`space-y-1.5`,children:y.map(e=>(0,W.jsx)(ws,{row:e},e.id))}),b&&(0,W.jsxs)(`div`,{className:`flex items-center justify-center gap-4 pt-2`,children:[(0,W.jsxs)(`button`,{onClick:()=>u(e=>e+sc),className:`text-[11px] font-mono uppercase tracking-wider text-[var(--color-fg-2)] hover:text-[var(--color-fg-0)] border border-[var(--color-line-1)] hover:border-[var(--color-line-2)] rounded-sm px-4 py-1.5 transition-colors cursor-pointer`,children:[`show`,` `,Math.min(sc,_.length-l),` more`]}),(0,W.jsxs)(`span`,{className:`text-[11px] font-mono text-[var(--color-fg-4)] tabular-nums`,children:[l,` / `,_.length]})]})]})]})}var lc={allow:`green`,block:`red`,force:`amber`,ask:`blue`,log:`gray`},uc=[`all`,`allow`,`block`,`force`,`log`],dc={allow:`text-emerald-300`,block:`text-red-300`,force:`text-amber-300`,log:`text-[var(--color-fg-3)]`};function fc(e){return new Date(e*1e3).toLocaleString()}function pc(e,t){if(!t)return``;let n=t-e;return n<60?`${n}s`:`${Math.round(n/60)}m`}async function mc(e,t){await fetch(`/api/decide/${e}?decision=${t}`,{method:`POST`,headers:Ae()})}function hc(e){try{let t=JSON.parse(e).input;return t&&typeof t==`object`?ar(``,JSON.stringify(t)):ar(``,e)}catch{return e.slice(0,80)}}function gc(e){try{let t=JSON.parse(e);return t.input===void 0?JSON.stringify(JSON.parse(e),null,2):JSON.stringify(t.input,null,2)}catch{return e}}function _c({label:e,value:t,tone:n}){return(0,W.jsxs)(`div`,{className:`flex items-baseline gap-1.5`,children:[(0,W.jsx)(`span`,{className:`font-mono text-sm tabular-nums ${n??`text-[var(--color-fg-0)]`}`,children:t}),(0,W.jsx)(`span`,{className:`font-mono text-[10px] uppercase tracking-wider text-[var(--color-fg-3)]`,children:e})]})}function vc(){let e=je([`pending-changed`]),{data:t,refetch:n}=z(`/api/json/pending`,[e[`pending-changed`]]),{data:r}=z(`/api/json/approvals`,[e[`pending-changed`]]),[a,o]=(0,v.useState)(`all`),[s,c]=(0,v.useState)(``),[l,u]=(0,v.useState)(new Set),d=Math.floor(Date.now()/1e3),f=(r??[]).filter(e=>e.created_at>=d-86400).length,p=(r??[]).reduce((e,t)=>(e[t.decision]=(e[t.decision]??0)+1,e),{}),m=(r??[]).filter(e=>{if(a!==`all`&&e.decision!==a)return!1;if(s){let t=s.toLowerCase(),n=hc(e.input).toLowerCase();if(!e.tool.toLowerCase().includes(t)&&!e.rule_id.toLowerCase().includes(t)&&!(e.rule_message??``).toLowerCase().includes(t)&&!n.includes(t))return!1}return!0});function h(e){u(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n})}return(0,W.jsxs)(`div`,{className:`space-y-6`,children:[(0,W.jsxs)(`div`,{children:[(0,W.jsx)(`h1`,{className:`overline text-[11px]`,children:`approvals`}),(0,W.jsx)(`p`,{className:`text-xs text-[var(--color-fg-3)] mt-1 font-mono`,children:`approve or deny pending tool calls · review past decisions`})]}),(0,W.jsxs)(`div`,{className:`flex flex-wrap items-center gap-5 px-3 py-2.5 rounded-sm border border-[var(--color-line-0)] bg-[var(--color-surface-1)]/60`,children:[(0,W.jsx)(_c,{label:`pending`,value:t?.length??0,tone:`text-amber-300`}),(0,W.jsx)(`span`,{className:`text-[var(--color-line-2)]`,children:`|`}),[`allow`,`block`,`force`,`log`].map(e=>(0,W.jsx)(_c,{label:e,value:p[e]??0,tone:dc[e]},e)),(0,W.jsx)(`span`,{className:`text-[var(--color-line-2)]`,children:`|`}),(0,W.jsx)(_c,{label:`last 24h`,value:f})]}),t&&t.length>0&&(0,W.jsxs)(`section`,{children:[(0,W.jsx)(`div`,{className:`flex items-center justify-between mb-3`,children:(0,W.jsxs)(`h2`,{className:`overline text-[11px]`,children:[`pending · `,t.length]})}),(0,W.jsx)(`div`,{className:`space-y-2`,children:t.map(e=>(0,W.jsxs)(G,{className:`border-l-2 border-l-amber-400/60`,children:[(0,W.jsxs)(K,{children:[(0,W.jsx)(`span`,{className:`text-sm text-[var(--color-fg-0)]`,children:e.ruleMessage}),(0,W.jsxs)(`div`,{className:`flex gap-2`,children:[(0,W.jsx)(J,{size:`sm`,variant:`primary`,onClick:async()=>{await mc(e.id,`allow`),n()},children:`approve`}),(0,W.jsx)(J,{size:`sm`,variant:`danger`,onClick:async()=>{await mc(e.id,`block`),n()},children:`deny`})]})]}),(0,W.jsxs)(q,{className:`space-y-2 text-xs`,children:[(0,W.jsxs)(`div`,{className:`flex gap-3 flex-wrap items-center`,children:[(0,W.jsx)(`span`,{className:`overline`,children:`tool`}),(0,W.jsx)(`code`,{className:`text-[var(--color-brand)] font-mono`,children:e.toolCall.tool}),(0,W.jsx)(`span`,{className:`overline ml-2`,children:`rule`}),(0,W.jsx)(`span`,{className:`font-mono text-[var(--color-fg-2)]`,children:e.ruleId})]}),e.prompt&&(0,W.jsxs)(`div`,{className:`flex gap-2 items-start`,children:[(0,W.jsx)(`span`,{className:`overline pt-0.5 shrink-0`,children:`why`}),(0,W.jsx)(`span`,{className:`text-[var(--color-fg-1)]`,children:e.prompt})]}),(0,W.jsx)(Ts,{children:JSON.stringify(e.toolCall.input,null,2)})]})]},e.id))})]}),(0,W.jsxs)(`section`,{children:[(0,W.jsxs)(`div`,{className:`flex items-center justify-between mb-3 gap-3 flex-wrap`,children:[(0,W.jsx)(`h2`,{className:`overline text-[11px]`,children:`history`}),(0,W.jsxs)(`div`,{className:`flex items-center gap-2 flex-wrap`,children:[(0,W.jsx)(`div`,{className:`flex gap-0.5 rounded-sm border border-[var(--color-line-1)] p-0.5 bg-[var(--color-surface-1)]`,children:uc.map(e=>(0,W.jsx)(`button`,{onClick:()=>o(e),className:`px-2 py-0.5 rounded-sm text-[11px] font-mono uppercase tracking-wider transition-colors cursor-pointer ${a===e?`bg-[var(--color-brand)]/10 text-[var(--color-brand)] border border-[var(--color-brand)]/30`:`text-[var(--color-fg-3)] hover:text-[var(--color-fg-1)] border border-transparent`}`,children:e},e))}),(0,W.jsx)(`input`,{type:`text`,placeholder:`search tool, rule, command…`,value:s,onChange:e=>c(e.target.value),className:`text-xs font-mono bg-[var(--color-surface-1)] border border-[var(--color-line-1)] rounded-sm px-2.5 py-1 text-[var(--color-fg-1)] placeholder-[var(--color-fg-4)] focus:outline-none focus:border-[var(--color-brand)]/50 w-48`})]})]}),!r||r.length===0?(0,W.jsx)(`div`,{className:`rounded-sm border border-dashed border-[var(--color-line-1)] px-4 py-6 text-center text-[11px] font-mono text-[var(--color-fg-3)]`,children:`no approval history yet`}):m.length===0?(0,W.jsx)(`div`,{className:`rounded-sm border border-dashed border-[var(--color-line-1)] px-4 py-6 text-center text-[11px] font-mono text-[var(--color-fg-3)]`,children:`no results match your filter`}):(0,W.jsx)(G,{children:(0,W.jsx)(`div`,{className:`divide-y divide-[var(--color-line-0)]`,children:m.map(e=>{let t=l.has(e.id),n=hc(e.input),r=pc(e.created_at,e.resolved_at);return(0,W.jsxs)(`div`,{children:[(0,W.jsxs)(`button`,{onClick:()=>h(e.id),className:`w-full text-left px-3 py-2 flex items-center gap-3 hover:bg-[var(--color-surface-2)]/60 transition-colors cursor-pointer`,children:[(0,W.jsx)(`span`,{className:`text-[var(--color-fg-4)] text-[10px] w-2.5 shrink-0`,children:t?`▼`:`▶`}),(0,W.jsx)(`span`,{className:`text-[10px] font-mono text-[var(--color-fg-3)] whitespace-nowrap shrink-0 w-36 tabular-nums`,children:fc(e.resolved_at??e.created_at)}),(0,W.jsx)(`span`,{className:`shrink-0`,children:(0,W.jsx)(lr,{variant:lc[e.decision]??`gray`,children:e.decision})}),(0,W.jsx)(`code`,{className:`text-xs text-[var(--color-brand)] shrink-0 font-mono`,children:e.tool}),(0,W.jsx)(`span`,{className:`text-xs text-[var(--color-fg-2)] truncate flex-1 min-w-0`,children:e.rule_message||e.rule_id||`—`}),n&&(0,W.jsx)(`span`,{className:`text-[11px] text-[var(--color-fg-3)] font-mono truncate max-w-[180px] shrink-0 hidden md:block`,children:n}),r&&(0,W.jsxs)(`span`,{className:`text-[10px] font-mono text-[var(--color-fg-4)] shrink-0`,children:[`Δ`,r]})]}),t&&(0,W.jsxs)(`div`,{className:`px-3 pb-3 pt-1 space-y-2 bg-[var(--color-surface-0)]`,children:[(0,W.jsxs)(`div`,{className:`flex flex-wrap gap-x-4 gap-y-1 text-xs font-mono`,children:[(0,W.jsxs)(`span`,{children:[(0,W.jsx)(`span`,{className:`text-[var(--color-fg-4)] uppercase tracking-wider text-[10px]`,children:`rule`}),` `,(0,W.jsx)(`span`,{className:`text-[var(--color-fg-1)]`,children:e.rule_id||`—`})]}),(0,W.jsxs)(`span`,{children:[(0,W.jsx)(`span`,{className:`text-[var(--color-fg-4)] uppercase tracking-wider text-[10px]`,children:`created`}),` `,(0,W.jsx)(`span`,{className:`text-[var(--color-fg-1)]`,children:fc(e.created_at)})]}),e.resolved_at&&(0,W.jsxs)(`span`,{children:[(0,W.jsx)(`span`,{className:`text-[var(--color-fg-4)] uppercase tracking-wider text-[10px]`,children:`resolved`}),` `,(0,W.jsx)(`span`,{className:`text-[var(--color-fg-1)]`,children:fc(e.resolved_at)})]})]}),e.prompt&&(0,W.jsxs)(`div`,{className:`text-xs flex gap-2 items-start`,children:[(0,W.jsx)(`span`,{className:`overline pt-0.5 shrink-0`,children:`why`}),(0,W.jsx)(`span`,{className:`text-[var(--color-fg-1)]`,children:e.prompt})]}),(0,W.jsx)(Ts,{children:gc(e.input)})]})]},e.id)})})})]})]})}function yc(){let{data:e,refetch:t}=z(`/api/json/inspector-targets`),[n,r]=(0,v.useState)(!1),[a,o]=(0,v.useState)(!1),[s,c]=(0,v.useState)(null),l=(0,v.useRef)(null),u=(0,v.useRef)(1),d=(0,v.useRef)(new Map),f=(0,v.useRef)(new Map),p=(0,v.useCallback)(()=>{let e=l.current;if(l.current=null,e)try{e.close()}catch{}r(!1),o(!1),c(null)},[]),m=(0,v.useCallback)(e=>{l.current&&p(),o(!0),c(null);let t=new WebSocket(`/ws/inspector?target=${encodeURIComponent(e)}`);l.current=t,t.onopen=()=>{r(!0),o(!1),c(null)},t.onclose=()=>{l.current=null,r(!1),o(!1)},t.onerror=()=>{o(!1),c(`Connection failed — is the inspector running with the correct target ID?`)},t.onmessage=e=>{try{let t=JSON.parse(e.data);if(t.id!=null){let e=d.current.get(t.id);e&&(d.current.delete(t.id),e(t.result))}else if(t.method){let e=f.current.get(t.method);if(e)for(let n of e)n(t.params)}}catch{}}},[p]),h=(0,v.useCallback)((e,t)=>new Promise((n,r)=>{let a=l.current;if(!a||a.readyState!==WebSocket.OPEN){r(Error(`Not connected`));return}let o=u.current++;d.current.set(o,e=>n(e)),a.send(JSON.stringify({id:o,method:e,params:t})),setTimeout(()=>{d.current.has(o)&&(d.current.delete(o),r(Error(`Command timed out`)))},1e4)}),[]),g=(0,v.useCallback)((e,t)=>{let n=f.current.get(e);return n||(n=new Set,f.current.set(e,n)),n.add(t),()=>{f.current.get(e)?.delete(t)}},[]),_=(0,v.useRef)(!1);return(0,v.useEffect)(()=>{e?.active&&e?.target&&!n&&!a&&!_.current&&(_.current=!0,m(e.target.id))},[e?.active,e?.target?.id,n,a,m]),(0,v.useEffect)(()=>()=>{p()},[p]),{active:e?.active??!1,bunVersion:e?.version?.[`Bun-Version`]??null,preconfiguredTarget:e?.target??null,connected:n,connecting:a,error:s,connect:m,disconnect:p,sendCommand:h,onEvent:g,refetch:t}}var bc=18,xc=5e-4;function Sc(e,t){return t===`(garbage collector)`||t===`(idle)`?`#450a0a`:e?e.startsWith(`node:`)||e.startsWith(`bun:`)?`#172554`:e.startsWith(`file:`)||e.startsWith(`/`)||e.includes(`.ts`)||e.includes(`.js`)?`#451a03`:`#1f2937`:`#1f2937`}function Cc(e,t){return t===`(garbage collector)`||t===`(idle)`?`#fca5a5`:e?e.startsWith(`node:`)||e.startsWith(`bun:`)?`#93c5fd`:e.startsWith(`file:`)||e.startsWith(`/`)||e.includes(`.ts`)||e.includes(`.js`)?`#fbbf24`:`#6b7280`:`#6b7280`}function wc(e,t){let n=new Map;for(let t of e.nodes)n.set(t.id,t);let r=new Map;function a(e){let t=n.get(e);if(!t)return 0;let o=t.hitCount??0;for(let e of t.children??[])o+=a(e);return r.set(e,o),o}let o=e.nodes[0];if(!o)return[];a(o.id);let s=t??o.id,c=r.get(s)??0;if(c===0)return[];let l=[];function u(e,t,a){let o=n.get(e);if(!o)return;let s=r.get(e)??0,d=s/c;if(d<xc)return;l.push({x:a,width:d,depth:t,node:o,subtreeHits:s});let f=a;for(let e of o.children??[]){let n=(r.get(e)??0)/c;u(e,t+1,f),f+=n}}return u(s,0,0),l}function Tc(e){return e<1e3?`${e}µs`:e<1e6?`${(e/1e3).toFixed(1)}ms`:`${(e/1e6).toFixed(2)}s`}function Ec({profile:e}){let t=(0,v.useRef)(null),[n,r]=(0,v.useState)(800),[a,o]=(0,v.useState)(null),[s,c]=(0,v.useState)(null);(0,v.useEffect)(()=>{let e=t.current;if(!e)return;let n=new ResizeObserver(e=>{let t=e[0]?.contentRect.width;t&&r(t)});return n.observe(e),r(e.clientWidth||800),()=>n.disconnect()},[]);let l=wc(e,a),u=(l.reduce((e,t)=>Math.max(e,t.depth),0)+1)*bc+4,d=e.endTime-e.startTime,f=(0,v.useCallback)(e=>{o(t=>t===e.node.id?null:e.node.id),c(null)},[]);return l.length===0?(0,W.jsx)(`p`,{className:`text-xs text-[#555] py-2`,children:`No samples — profile may be empty.`}):(0,W.jsxs)(`div`,{className:`relative select-none`,children:[a!==null&&(0,W.jsx)(`button`,{onClick:()=>o(null),className:`mb-2 text-xs text-amber-400 hover:underline`,children:`← Reset zoom`}),(0,W.jsx)(`div`,{ref:t,className:`overflow-x-hidden`,children:(0,W.jsx)(`svg`,{width:n,height:u,onMouseLeave:()=>c(null),children:l.map((e,t)=>{let r=e.x*n,o=Math.max(e.width*n,1),s=e.depth*bc+1,l=e.node.callFrame.functionName||`(anonymous)`,u=e.node.callFrame.url,p=a===e.node.id;return(0,W.jsxs)(`g`,{children:[(0,W.jsx)(`rect`,{x:r,y:s,width:o,height:bc-1,fill:p?`#92400e`:Sc(u,l),stroke:`#080808`,strokeWidth:.5,style:{cursor:`pointer`},onClick:()=>f(e),onMouseMove:t=>c({clientX:t.clientX,clientY:t.clientY,rect:e,totalDuration:d})}),o>24&&(0,W.jsx)(`text`,{x:r+2,y:s+bc-5,fontSize:9,fill:Cc(u,l),style:{pointerEvents:`none`,userSelect:`none`},clipPath:`url(#fc-clip-${t})`,children:l}),o>24&&(0,W.jsx)(`clipPath`,{id:`fc-clip-${t}`,children:(0,W.jsx)(`rect`,{x:r,y:s,width:o,height:bc})})]},t)})})}),s&&(0,W.jsxs)(`div`,{className:`fixed z-50 bg-[#111] border border-[#2a2a2a] rounded-lg p-2.5 text-xs shadow-xl pointer-events-none`,style:{left:s.clientX+14,top:s.clientY-8,maxWidth:320},children:[(0,W.jsx)(`div`,{className:`font-mono text-amber-400 truncate font-medium`,children:s.rect.node.callFrame.functionName||`(anonymous)`}),s.rect.node.callFrame.url&&(0,W.jsxs)(`div`,{className:`text-[#666] truncate mt-0.5 text-[10px]`,children:[s.rect.node.callFrame.url,`:`,s.rect.node.callFrame.lineNumber]}),(0,W.jsxs)(`div`,{className:`mt-1.5 space-y-0.5 text-[#aaa]`,children:[(0,W.jsxs)(`div`,{children:[`Samples:`,` `,(0,W.jsx)(`span`,{className:`text-white tabular-nums`,children:s.rect.subtreeHits})]}),(0,W.jsxs)(`div`,{children:[`Time share:`,` `,(0,W.jsxs)(`span`,{className:`text-white tabular-nums`,children:[(s.rect.width*100).toFixed(1),`%`]})]}),d>0&&(0,W.jsxs)(`div`,{children:[`Est. duration:`,` `,(0,W.jsx)(`span`,{className:`text-white tabular-nums`,children:Tc(Math.round(s.rect.width*d))})]})]}),s.rect.node.deoptReason&&(0,W.jsxs)(`div`,{className:`text-red-400 mt-1.5 text-[10px]`,children:[`⚠ `,s.rect.node.deoptReason]}),(0,W.jsx)(`div`,{className:`text-[#555] mt-1.5 text-[10px]`,children:`Click to zoom · click again to reset`})]})]})}function Dc(e){return e<1e6?`${(e/1e3).toFixed(0)}µs`:e<1e9?`${(e/1e6).toFixed(1)}ms`:`${(e/1e9).toFixed(2)}s`}function Oc(e){return new Date(e*1e3).toLocaleString()}var kc={critical:`red`,high:`red`,medium:`amber`,low:`blue`},Ac={critical:`border-l-red-500/70`,high:`border-l-red-500/50`,medium:`border-l-amber-400/60`,low:`border-l-sky-400/50`};function jc(){let{data:e}=z(`/api/json/profile`);if(!e)return(0,W.jsx)(`p`,{className:`text-[11px] font-mono uppercase tracking-wider text-[var(--color-fg-3)]`,children:`loading profile…`});let{diagnosis:t,sessions:n}=e;return!t||t.analyzed_evals===0?(0,W.jsx)(`div`,{className:`rounded-sm border border-dashed border-[var(--color-line-1)] bg-[var(--color-surface-1)]/50 px-4 py-6 text-center`,children:(0,W.jsxs)(`p`,{className:`text-[12px] text-[var(--color-fg-2)] font-mono`,children:[`no eval data yet — run`,` `,(0,W.jsx)(`code`,{className:`text-[var(--color-brand)]`,children:`ssg eval`}),` to start recording`]})}):(0,W.jsxs)(`div`,{className:`space-y-5`,children:[(0,W.jsx)(`div`,{className:`grid grid-cols-2 lg:grid-cols-4 gap-2`,children:[{label:`evals analyzed`,value:String(t.analyzed_evals)},{label:`median (inside)`,value:Dc(t.median_eval_ns)},{label:`p99 (inside)`,value:Dc(t.p99_eval_ns)},{label:`bottleneck`,value:t.bottleneck??`—`}].map(e=>(0,W.jsx)(As,{label:e.label,value:e.value,labelPlacement:`above`,valueClassName:`text-xl font-medium tabular-nums text-[var(--color-fg-0)]`},e.label))}),t.phases.length>0&&(0,W.jsxs)(G,{children:[(0,W.jsx)(K,{children:(0,W.jsx)(`span`,{className:`overline`,children:`phase breakdown`})}),(0,W.jsx)(q,{children:(0,W.jsx)(`div`,{className:`space-y-2`,children:t.phases.filter(e=>e.median_ns>0).map(e=>{let n=e.name===t.bottleneck;return(0,W.jsxs)(`div`,{className:`flex items-center gap-3 text-xs`,children:[(0,W.jsx)(`span`,{className:`w-28 font-mono truncate ${n?`text-[var(--color-brand)] font-medium`:`text-[var(--color-fg-2)]`}`,title:n?`bottleneck`:void 0,children:e.name}),(0,W.jsx)(Ms,{pct:Math.min(e.pct_of_total,100),tone:n?`amber`:`gray`,className:`h-1 flex-1`}),(0,W.jsx)(`span`,{className:`w-16 text-right text-[var(--color-fg-1)] tabular-nums font-mono`,children:Dc(e.median_ns)}),(0,W.jsxs)(`span`,{className:`w-10 text-right text-[var(--color-fg-3)] tabular-nums font-mono`,children:[e.pct_of_total,`%`]}),(0,W.jsxs)(`span`,{className:`w-20 text-right text-[var(--color-fg-4)] tabular-nums font-mono text-[10px]`,children:[`p95 `,Dc(e.p95_ns)]})]},e.name)})})})]}),t.recommendations.length>0&&(0,W.jsxs)(G,{children:[(0,W.jsx)(K,{children:(0,W.jsxs)(`span`,{className:`overline`,children:[`recommendations · `,t.recommendations.length]})}),(0,W.jsx)(q,{className:`space-y-2`,children:t.recommendations.map((e,t)=>(0,W.jsxs)(`div`,{className:`border border-[var(--color-line-1)] bg-[var(--color-surface-0)] rounded-sm px-3 py-2.5 border-l-2 ${Ac[e.severity]??`border-l-[var(--color-line-2)]`}`,children:[(0,W.jsxs)(`div`,{className:`flex items-center gap-2 mb-1.5`,children:[(0,W.jsx)(lr,{variant:kc[e.severity]??`gray`,children:e.severity}),(0,W.jsx)(`span`,{className:`text-[10px] font-mono uppercase tracking-wider text-[var(--color-fg-3)]`,children:e.type})]}),(0,W.jsx)(`p`,{className:`text-sm text-[var(--color-fg-1)] leading-relaxed`,children:e.message}),e.fix_command&&(0,W.jsxs)(`code`,{className:`text-[11px] text-[var(--color-brand)] font-mono mt-1.5 block`,children:[`$ `,e.fix_command]})]},t))})]}),t.anomalies.length>0&&(0,W.jsxs)(G,{children:[(0,W.jsx)(K,{children:(0,W.jsxs)(`span`,{className:`overline`,children:[`anomalies · `,t.anomalies.length]})}),(0,W.jsx)(q,{children:(0,W.jsx)(`div`,{className:`divide-y divide-[var(--color-line-0)]`,children:t.anomalies.map((e,t)=>(0,W.jsxs)(`div`,{className:`py-2 flex items-center gap-4 text-xs font-mono`,children:[(0,W.jsx)(`span`,{className:`w-24 text-[var(--color-brand)] uppercase tracking-wider text-[10px]`,children:e.type}),(0,W.jsxs)(`span`,{className:`w-10 tabular-nums text-[var(--color-fg-1)]`,children:[e.count,`×`]}),(0,W.jsxs)(`span`,{className:`w-20 tabular-nums text-[var(--color-fg-1)]`,children:[e.max_ms,`ms max`]}),(0,W.jsx)(`span`,{className:`text-[var(--color-fg-3)]`,children:e.likely_cause})]},t))})})]}),n.length>0&&(0,W.jsxs)(G,{children:[(0,W.jsxs)(K,{className:`flex items-center justify-between`,children:[(0,W.jsx)(`span`,{className:`overline`,children:`session history`}),(0,W.jsxs)(`span`,{className:`text-[10px] font-mono text-[var(--color-fg-3)] tabular-nums`,children:[n.length,` session`,n.length===1?``:`s`]})]}),(0,W.jsx)(q,{className:`p-0`,children:(0,W.jsx)(`div`,{className:`divide-y divide-[var(--color-line-0)]`,children:[...n].reverse().map((e,t)=>(0,W.jsxs)(`div`,{className:`px-4 py-2.5 flex flex-wrap items-center gap-x-5 gap-y-1 text-xs ${e.is_current?`bg-amber-400/[0.04] border-l-2 border-l-amber-400/60`:``}`,children:[(0,W.jsxs)(`div`,{className:`flex items-center gap-2 w-48 shrink-0`,children:[(0,W.jsx)(`span`,{className:`text-[var(--color-fg-3)] tabular-nums font-mono`,children:Oc(e.start_ts)}),e.is_current&&(0,W.jsx)(lr,{variant:`amber`,children:`current`})]}),(0,W.jsxs)(`span`,{className:`text-[var(--color-fg-2)] tabular-nums font-mono w-20`,children:[e.evals,` eval`,e.evals===1?``:`s`]}),(0,W.jsxs)(`span`,{className:`text-emerald-300 tabular-nums font-mono`,children:[e.allowed,` allow`]}),e.blocked>0&&(0,W.jsxs)(`span`,{className:`text-red-300 tabular-nums font-mono`,children:[e.blocked,` block (`,e.block_rate_pct,`%)`]}),e.asked>0&&(0,W.jsxs)(`span`,{className:`text-sky-300 tabular-nums font-mono`,children:[e.asked,` ask`]}),e.forced>0&&(0,W.jsxs)(`span`,{className:`text-violet-300 tabular-nums font-mono`,children:[e.forced,` force`]}),e.avg_ns>0&&(0,W.jsxs)(`span`,{className:`text-[var(--color-fg-3)] tabular-nums ml-auto font-mono`,children:[`avg `,Dc(e.avg_ns)]}),e.top_rule&&(0,W.jsxs)(`a`,{href:`/rules?highlight=${encodeURIComponent(e.top_rule)}`,className:`text-[var(--color-fg-4)] hover:text-[var(--color-brand)] font-mono truncate max-w-xs transition-colors w-full pl-48`,title:`most blocked rule: ${e.top_rule}`,children:[`top block: `,e.top_rule]})]},t))})})]})]})}var Mc={log:`text-[var(--color-fg-1)]`,info:`text-sky-300`,warn:`text-amber-300`,error:`text-red-300`,debug:`text-[var(--color-fg-3)]`};function Nc(e){return e.value==null?e.description?e.description:`[${e.type}]`:String(e.value)}function Pc(){let e=yc(),[t,n]=(0,v.useState)(!1),[r,a]=(0,v.useState)(null),[o,s]=(0,v.useState)([]),[c,l]=(0,v.useState)(null),[u,d]=(0,v.useState)(!1),f=(0,v.useRef)(null),p=(0,v.useRef)(0);(0,v.useEffect)(()=>{f.current?.scrollIntoView({behavior:`smooth`})},[o]),(0,v.useEffect)(()=>{if(e.connected)return e.sendCommand(`Runtime.enable`).catch(()=>{}),e.onEvent(`Runtime.consoleAPICalled`,e=>{let t=e;s(e=>{let n=[...e,{id:p.current++,type:t.type??`log`,args:t.args??[],timestamp:t.timestamp??Date.now()}];return n.length>500?n.slice(-500):n})})},[e.connected]);let m=(0,v.useCallback)(()=>{e.preconfiguredTarget&&e.connect(e.preconfiguredTarget.id)},[e]),h=(0,v.useCallback)(async()=>{try{await e.sendCommand(`Profiler.enable`),await e.sendCommand(`Profiler.start`),n(!0),a(null)}catch(e){console.error(`Profiler.start failed:`,e)}},[e]),g=(0,v.useCallback)(async()=>{try{let t=await e.sendCommand(`Profiler.stop`);n(!1),a(t.profile)}catch(e){console.error(`Profiler.stop failed:`,e),n(!1)}},[e]),_=(0,v.useCallback)(async()=>{d(!0);try{let t=await e.sendCommand(`Runtime.evaluate`,{expression:`JSON.stringify(process.memoryUsage())`,returnByValue:!0});l(JSON.parse(t.result.value))}catch{}finally{d(!1)}},[e]);function y(e){return e<1024?`${e}B`:e<1024*1024?`${(e/1024).toFixed(1)}KB`:`${(e/1024/1024).toFixed(1)}MB`}let b=e.connected?`connected${e.bunVersion?` · bun v${e.bunVersion}`:``}`:e.connecting?`connecting…`:e.active?`inspector active, connecting…`:`inspector not available`,x=e.connected?`bg-emerald-400`:e.connecting?`bg-amber-400 pulse-soft`:e.active?`bg-sky-400`:`bg-[var(--color-line-2)]`;return(0,W.jsxs)(`div`,{className:`space-y-5`,children:[(0,W.jsxs)(G,{children:[(0,W.jsxs)(K,{className:`flex items-center justify-between`,children:[(0,W.jsx)(`span`,{className:`overline`,children:`runtime inspector`}),(0,W.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,W.jsxs)(`span`,{className:`flex items-center gap-1.5 text-[11px] font-mono text-[var(--color-fg-2)]`,children:[(0,W.jsx)(`span`,{className:`inline-block w-1.5 h-1.5 rounded-full ${x}`}),b]}),e.connected?(0,W.jsx)(J,{variant:`ghost`,size:`sm`,onClick:e.disconnect,children:`disconnect`}):(0,W.jsx)(J,{variant:`ghost`,size:`sm`,onClick:e.preconfiguredTarget?m:e.refetch,disabled:e.connecting,children:e.preconfiguredTarget?`reconnect`:`refresh`})]})]}),e.error&&(0,W.jsx)(q,{children:(0,W.jsx)(`p`,{className:`text-xs text-red-300 font-mono`,children:e.error})})]}),e.connected&&(0,W.jsxs)(W.Fragment,{children:[(0,W.jsxs)(G,{children:[(0,W.jsxs)(K,{className:`flex items-center justify-between`,children:[(0,W.jsx)(`span`,{className:`overline`,children:`cpu profiler`}),(0,W.jsxs)(`div`,{className:`flex items-center gap-2`,children:[t&&(0,W.jsxs)(`span`,{className:`text-[10px] font-mono uppercase tracking-wider text-red-300 flex items-center gap-1.5`,children:[(0,W.jsx)(`span`,{className:`inline-block w-1.5 h-1.5 rounded-full bg-red-400 pulse-soft`}),`recording`]}),t?(0,W.jsx)(J,{variant:`danger`,size:`sm`,onClick:g,children:`stop & render`}):(0,W.jsx)(J,{variant:`primary`,size:`sm`,onClick:h,children:`start recording`})]})]}),(0,W.jsx)(q,{children:r?(0,W.jsx)(Ps,{profile:r,children:(0,W.jsx)(`div`,{className:`bg-[var(--color-surface-0)] border border-[var(--color-line-1)] rounded-sm p-2 overflow-x-hidden`,children:(0,W.jsx)(Ec,{profile:r})})}):(0,W.jsx)(`p`,{className:`text-[11px] font-mono text-[var(--color-fg-3)]`,children:t?`recording… perform actions in ssg, then stop.`:`click start recording, perform actions, then stop.`})})]}),(0,W.jsxs)(G,{children:[(0,W.jsxs)(K,{className:`flex items-center justify-between`,children:[(0,W.jsx)(`span`,{className:`overline`,children:`memory`}),(0,W.jsx)(J,{variant:`ghost`,size:`sm`,onClick:_,disabled:u,children:u?`…`:`refresh`})]}),(0,W.jsx)(q,{children:c?(0,W.jsx)(Fs,{memory:c,formatValue:y}):(0,W.jsx)(`p`,{className:`text-[11px] font-mono text-[var(--color-fg-3)]`,children:`click refresh to fetch process.memoryUsage().`})})]}),(0,W.jsxs)(G,{children:[(0,W.jsxs)(K,{className:`flex items-center justify-between`,children:[(0,W.jsx)(`span`,{className:`overline`,children:`console`}),(0,W.jsx)(J,{variant:`ghost`,size:`sm`,onClick:()=>s([]),children:`clear`})]}),(0,W.jsx)(q,{children:(0,W.jsxs)(`div`,{className:`bg-[var(--color-surface-0)] border border-[var(--color-line-1)] rounded-sm p-2 h-56 overflow-y-auto font-mono text-[11px]`,children:[o.length===0?(0,W.jsx)(`p`,{className:`text-[var(--color-fg-4)]`,children:`console output will appear here…`}):o.map(e=>(0,W.jsxs)(`div`,{className:`py-0.5 border-b border-[var(--color-line-0)] ${Mc[e.type]??`text-[var(--color-fg-1)]`}`,children:[(0,W.jsxs)(`span`,{className:`text-[var(--color-fg-4)] mr-2 uppercase tracking-wider`,children:[`[`,e.type,`]`]}),e.args.map(Nc).join(` `)]},e.id)),(0,W.jsx)(`div`,{ref:f})]})})]})]}),!e.connected&&!e.connecting&&(0,W.jsx)(`div`,{className:`rounded-sm border border-dashed border-[var(--color-line-1)] bg-[var(--color-surface-1)]/50 px-4 py-6 text-center`,children:(0,W.jsx)(`p`,{className:`text-[11px] font-mono text-[var(--color-fg-3)]`,children:e.active?`waiting for inspector connection…`:`inspector auto-starts with ssg serve. profiler, memory, and console appear here once connected.`})})]})}function Fc({active:e,onClick:t,children:n}){return(0,W.jsxs)(`button`,{onClick:t,className:`relative px-3 h-9 text-[11px] font-mono uppercase tracking-wider transition-colors cursor-pointer ${e?`text-[var(--color-fg-0)]`:`text-[var(--color-fg-3)] hover:text-[var(--color-fg-1)]`}`,children:[n,e&&(0,W.jsx)(`span`,{className:`absolute inset-x-2 -bottom-px h-px bg-[var(--color-brand)]`})]})}function Ic(){let[e,t]=(0,v.useState)(`eval`);return(0,W.jsxs)(`div`,{className:`space-y-0`,children:[(0,W.jsxs)(`div`,{className:`flex items-center border-b border-[var(--color-line-0)] mb-5`,children:[(0,W.jsx)(Fc,{active:e===`eval`,onClick:()=>t(`eval`),children:`eval profile`}),(0,W.jsx)(Fc,{active:e===`inspector`,onClick:()=>t(`inspector`),children:`runtime inspector`})]}),e===`eval`?(0,W.jsx)(jc,{}):(0,W.jsx)(Pc,{})]})}function Lc(e){return e>=1e6?`${(e/1e6).toFixed(1)}M`:e>=1e3?`${(e/1e3).toFixed(1)}k`:String(e)}var Rc=[{value:`downloads`,label:`most downloaded`},{value:`newest`,label:`newest`},{value:`rules`,label:`most rules`}],zc=[``,`critical`,`high`,`medium`,`low`],Bc=[``,`deny`,`ask`,`allow`,`log`];function Vc(){return(0,W.jsxs)(`div`,{className:`rounded-sm border border-[var(--color-line-0)] bg-[var(--color-surface-1)] p-4 space-y-3 shimmer`,children:[(0,W.jsx)(`div`,{className:`h-4 bg-[var(--color-surface-3)] rounded-sm w-2/3`}),(0,W.jsx)(`div`,{className:`h-3 bg-[var(--color-surface-2)] rounded-sm w-1/3`}),(0,W.jsxs)(`div`,{className:`flex gap-1.5`,children:[(0,W.jsx)(`div`,{className:`h-5 bg-[var(--color-surface-3)] rounded-sm w-14`}),(0,W.jsx)(`div`,{className:`h-5 bg-[var(--color-surface-3)] rounded-sm w-10`})]}),(0,W.jsx)(`div`,{className:`h-7 bg-[var(--color-surface-3)] rounded-sm`})]})}function Hc({tech:e}){return(0,W.jsx)(`span`,{className:`inline-flex items-center px-1.5 py-0.5 rounded-sm text-[10px] font-mono uppercase tracking-wider border ${{typescript:`bg-sky-500/8 text-sky-300 border-sky-500/25`,ts:`bg-sky-500/8 text-sky-300 border-sky-500/25`,javascript:`bg-amber-500/8 text-amber-300 border-amber-500/25`,js:`bg-amber-500/8 text-amber-300 border-amber-500/25`,python:`bg-emerald-500/8 text-emerald-300 border-emerald-500/25`,rust:`bg-orange-500/8 text-orange-300 border-orange-500/25`,go:`bg-cyan-500/8 text-cyan-300 border-cyan-500/25`,bash:`bg-violet-500/8 text-violet-300 border-violet-500/25`}[e.toLowerCase()]??`bg-[var(--color-surface-2)] text-[var(--color-fg-3)] border-[var(--color-line-1)]`}`,children:e})}function Uc({rs:e,installingId:t,onInstall:n,flashId:r}){let a=t===e.id,o=r===e.id;return(0,W.jsxs)(`div`,{className:`group relative flex flex-col rounded-sm border bg-[var(--color-surface-1)] transition-colors overflow-hidden
|
|
11
11
|
${e.installed?`border-emerald-500/25 hover:border-emerald-500/40`:`border-[var(--color-line-1)] hover:border-[var(--color-line-2)]`}
|
|
12
|
-
${
|
|
12
|
+
${o?`ring-1 ring-emerald-500/40`:``}`,children:[e.installed&&(0,W.jsxs)(`div`,{className:`absolute top-2 right-2 z-10 flex items-center gap-1 px-1.5 py-0.5 rounded-sm bg-emerald-500/10 border border-emerald-500/30 text-emerald-300 text-[10px] font-mono uppercase tracking-wider`,children:[(0,W.jsx)(`svg`,{width:`9`,height:`9`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`3`,children:(0,W.jsx)(`polyline`,{points:`20 6 9 17 4 12`})}),`installed`]}),(0,W.jsxs)(`a`,{href:`/hub/${e.id}`,className:`block p-3 flex-1 min-h-0`,children:[(0,W.jsxs)(`div`,{className:`flex items-start justify-between gap-2 mb-2`,children:[(0,W.jsxs)(`div`,{className:`min-w-0 flex-1 pr-16`,children:[(0,W.jsxs)(`div`,{className:`flex items-center gap-1.5 flex-wrap`,children:[(0,W.jsx)(`span`,{className:`text-sm font-medium text-[var(--color-fg-0)] leading-snug`,children:e.title}),e.tested_versions&&e.tested_versions.length>0&&(0,W.jsx)(`span`,{title:`Certified ruleset`,className:`text-[var(--color-brand)] text-[11px]`,children:`★`})]}),(0,W.jsxs)(`p`,{className:`text-[11px] text-[var(--color-fg-3)] mt-0.5 font-mono`,children:[`@`,e.author]})]}),(0,W.jsxs)(`span`,{className:`text-[10px] font-mono text-[var(--color-fg-4)] shrink-0 mt-0.5`,children:[`v`,e.version]})]}),e.technologies.length>0&&(0,W.jsxs)(`div`,{className:`flex flex-wrap gap-1 mb-3`,children:[e.technologies.slice(0,4).map(e=>(0,W.jsx)(Hc,{tech:e},e)),e.technologies.length>4&&(0,W.jsxs)(`span`,{className:`text-[10px] font-mono text-[var(--color-fg-4)] self-center`,children:[`+`,e.technologies.length-4]})]}),(0,W.jsxs)(`div`,{className:`flex items-center gap-3 text-[11px] font-mono text-[var(--color-fg-3)]`,children:[(0,W.jsxs)(`span`,{className:`flex items-center gap-1`,children:[(0,W.jsxs)(`svg`,{width:`10`,height:`10`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2`,children:[(0,W.jsx)(`path`,{d:`M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z`}),(0,W.jsx)(`polyline`,{points:`14 2 14 8 20 8`})]}),(0,W.jsx)(`span`,{className:`tabular-nums`,children:e.rule_count}),(0,W.jsx)(`span`,{className:`uppercase tracking-wider text-[10px] text-[var(--color-fg-4)]`,children:`rules`})]}),(0,W.jsxs)(`span`,{className:`flex items-center gap-1`,children:[(0,W.jsxs)(`svg`,{width:`10`,height:`10`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2`,children:[(0,W.jsx)(`polyline`,{points:`8 17 12 21 16 17`}),(0,W.jsx)(`line`,{x1:`12`,y1:`12`,x2:`12`,y2:`21`}),(0,W.jsx)(`path`,{d:`M20.88 18.09A5 5 0 0 0 18 9h-1.26A8 8 0 1 0 3 16.29`})]}),(0,W.jsx)(`span`,{className:`tabular-nums`,children:Lc(e.download_count)})]})]})]}),(0,W.jsx)(`div`,{className:`px-3 pb-3 pt-0`,children:e.installed?(0,W.jsxs)(`div`,{className:`flex items-center justify-center gap-1.5 h-7 w-full rounded-sm text-[11px] font-mono uppercase tracking-wider text-emerald-300 bg-emerald-500/5 border border-emerald-500/25`,children:[(0,W.jsx)(`svg`,{width:`11`,height:`11`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2.5`,children:(0,W.jsx)(`polyline`,{points:`20 6 9 17 4 12`})}),`installed`]}):(0,W.jsx)(`button`,{onClick:t=>{t.preventDefault(),t.stopPropagation(),n(e.id)},disabled:a,className:`w-full h-7 rounded-sm text-[11px] font-mono uppercase tracking-wider transition-colors cursor-pointer
|
|
13
13
|
bg-[var(--color-brand)]/8 text-[var(--color-brand)] border border-[var(--color-brand)]/30
|
|
14
14
|
hover:bg-[var(--color-brand)]/15 hover:border-[var(--color-brand)]/50
|
|
15
|
-
disabled:opacity-40 disabled:cursor-not-allowed`,children:
|
|
16
|
-
${
|
|
17
|
-
${
|
|
18
|
-
${c===`installed`?`bg-[var(--color-surface-3)] text-[var(--color-fg-0)]`:`text-[var(--color-fg-3)] hover:text-[var(--color-fg-1)]`}`,children:[`installed`,A>0&&(0,U.jsx)(`span`,{className:`text-[9px] bg-emerald-500/15 text-emerald-300 rounded-sm px-1 py-0.5 font-medium tabular-nums`,children:A})]})]}),(0,U.jsxs)(`div`,{className:`relative flex-1 min-w-[160px]`,children:[(0,U.jsxs)(`svg`,{className:`absolute left-2.5 top-1/2 -translate-y-1/2 text-[var(--color-fg-4)]`,width:`11`,height:`11`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2`,children:[(0,U.jsx)(`circle`,{cx:`11`,cy:`11`,r:`8`}),(0,U.jsx)(`line`,{x1:`21`,y1:`21`,x2:`16.65`,y2:`16.65`})]}),(0,U.jsx)(`input`,{type:`text`,placeholder:`search rulesets…`,value:e,onChange:e=>t(e.target.value),className:`w-full bg-[var(--color-surface-1)] border border-[var(--color-line-1)] text-[var(--color-fg-1)] text-xs rounded-sm pl-8 pr-3 h-8 focus:outline-none focus:border-[var(--color-brand)]/50 placeholder:text-[var(--color-fg-4)] font-mono`})]}),(0,U.jsx)(`select`,{value:n,onChange:e=>r(e.target.value),className:j,children:Fc.map(e=>(0,U.jsx)(`option`,{value:e.value,children:e.label},e.value))}),(0,U.jsxs)(`select`,{value:i,onChange:e=>a(e.target.value),className:j,children:[(0,U.jsx)(`option`,{value:``,children:`any decision`}),Lc.filter(Boolean).map(e=>(0,U.jsx)(`option`,{value:e,children:e},e))]}),(0,U.jsxs)(`select`,{value:o,onChange:e=>s(e.target.value),className:j,children:[(0,U.jsx)(`option`,{value:``,children:`any severity`}),Ic.filter(Boolean).map(e=>(0,U.jsx)(`option`,{value:e,children:e},e))]})]}),g&&u.length===0?(0,U.jsx)(`div`,{className:`grid grid-cols-1 gap-3 sm:grid-cols-2 lg:grid-cols-3`,children:Array.from({length:6}).map((e,t)=>(0,U.jsx)(Rc,{},t))}):k.length===0?(0,U.jsxs)(`div`,{className:`rounded-sm border border-dashed border-[var(--color-line-1)] py-16 flex flex-col items-center justify-center text-center`,children:[(0,U.jsxs)(`svg`,{className:`text-[var(--color-fg-4)] mb-3`,width:`36`,height:`36`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`1.5`,children:[(0,U.jsx)(`circle`,{cx:`11`,cy:`11`,r:`8`}),(0,U.jsx)(`line`,{x1:`21`,y1:`21`,x2:`16.65`,y2:`16.65`})]}),(0,U.jsx)(`p`,{className:`text-xs font-mono text-[var(--color-fg-3)] uppercase tracking-wider`,children:c===`installed`?`no rulesets installed yet — browse and click install`:`no rulesets found${e?` matching "${e}"`:``}`})]}):(0,U.jsxs)(U.Fragment,{children:[(0,U.jsx)(`div`,{className:`grid grid-cols-1 gap-3 sm:grid-cols-2 lg:grid-cols-3`,children:k.map(e=>(0,U.jsx)(Bc,{rs:e,installingId:y,onInstall:O,flashId:x},e.id))}),f&&c===`all`&&(0,U.jsx)(`div`,{className:`flex justify-center pt-2`,children:(0,U.jsx)(`button`,{onClick:E,disabled:g,className:`h-8 px-5 rounded-sm text-[11px] font-mono uppercase tracking-wider text-[var(--color-fg-2)] border border-[var(--color-line-1)] hover:text-[var(--color-fg-0)] hover:border-[var(--color-line-2)] transition-colors cursor-pointer disabled:opacity-40`,children:g?`loading…`:`load more`})})]})]})}var Hc={deny:`red`,block:`red`,ask:`amber`,allow:`green`,log:`gray`,force:`blue`};function Uc({id:e}){let{data:t,error:n}=R(`/api/json/hub/${e}`),[r,i]=(0,_.useState)(!1),[a,o]=(0,_.useState)(!1);if(n)return(0,U.jsxs)(`div`,{className:`text-sm text-red-300 font-mono`,children:[(0,U.jsx)(`p`,{children:n}),(0,U.jsx)(`a`,{href:`/hub`,className:`text-[var(--color-brand)] hover:underline mt-3 block text-[11px] uppercase tracking-wider`,children:`← back to hub`})]});if(!t)return(0,U.jsx)(`p`,{className:`text-[11px] font-mono uppercase tracking-wider text-[var(--color-fg-3)]`,children:`loading ruleset…`});async function s(){o(!0);try{(await fetch(`/api/hub/install`,{method:`POST`,headers:{"Content-Type":`application/json`,...Ae()},body:JSON.stringify({id:e})})).ok&&i(!0)}finally{o(!1)}}return(0,U.jsxs)(`div`,{className:`space-y-5`,children:[(0,U.jsxs)(`div`,{className:`flex items-start justify-between gap-4`,children:[(0,U.jsxs)(`div`,{className:`min-w-0`,children:[(0,U.jsx)(`a`,{href:`/hub`,className:`text-[11px] font-mono uppercase tracking-wider text-[var(--color-fg-3)] hover:text-[var(--color-brand)]`,children:`← hub`}),(0,U.jsx)(`h1`,{className:`text-xl font-medium tracking-tight mt-1.5 text-[var(--color-fg-0)]`,children:t.title}),(0,U.jsxs)(`p`,{className:`text-[11px] font-mono text-[var(--color-fg-3)] mt-1 tabular-nums`,children:[`@`,t.author,` · v`,t.version,` · `,t.rule_count,` rule`,t.rule_count===1?``:`s`]})]}),(0,U.jsx)(J,{variant:r?`secondary`:`primary`,onClick:s,disabled:a||r,children:r?`✓ installed`:a?`installing…`:`install`})]}),t.technologies.length>0&&(0,U.jsx)(`div`,{className:`flex flex-wrap gap-1.5`,children:t.technologies.map(e=>(0,U.jsx)(q,{variant:`blue`,children:e},e))}),t.github_repo&&(0,U.jsxs)(`div`,{className:`flex items-center gap-2 text-[11px] font-mono`,children:[(0,U.jsx)(`span`,{className:`overline`,children:`source`}),(0,U.jsx)(`span`,{className:`text-[var(--color-fg-1)]`,children:t.github_repo})]}),(0,U.jsxs)(W,{children:[(0,U.jsx)(G,{children:(0,U.jsxs)(`span`,{className:`overline`,children:[`rules · `,t.rules.length]})}),(0,U.jsx)(K,{className:`space-y-4`,children:t.rules.map((e,t)=>(0,U.jsxs)(`div`,{className:t>0?`border-t border-[var(--color-line-0)] pt-4`:void 0,children:[(0,U.jsxs)(`div`,{className:`flex items-center gap-2 mb-2 flex-wrap`,children:[(0,U.jsx)(q,{variant:Hc[e.decision]??`gray`,children:e.decision}),(0,U.jsx)(`code`,{className:`text-xs text-[var(--color-brand)] font-mono`,children:e.name}),e.capability&&(0,U.jsx)(q,{variant:`gray`,children:e.capability})]}),(0,U.jsx)(`p`,{className:`text-sm text-[var(--color-fg-1)] mb-2`,children:e.message}),(0,U.jsx)(Ss,{children:e.raw_text})]},e.id))})]})]})}function Wc(){let[e,t]=(0,_.useState)(null),[n,r]=(0,_.useState)(`idle`),[i,a]=(0,_.useState)(``),[o,s]=(0,_.useState)([]),[c,l]=(0,_.useState)(!1);async function u(){l(!0),a(``);try{let e=await fetch(`/api/hub/device-start`,{method:`POST`,headers:{Accept:`application/json`,...Ae()}}),n=await e.json();if(!e.ok){let t=n;t.error===`not_configured`?(r(`not_configured`),s(t.setup_steps??[]),a(t.message??`GitHub OAuth not configured.`)):(a(n.error??`HTTP ${e.status}`),r(`error`));return}t(n),r(`polling`)}catch(e){a(e instanceof Error?e.message:`Failed to start`),r(`error`)}finally{l(!1)}}return(0,_.useEffect)(()=>{if(n!==`polling`||!e)return;let t=setInterval(async()=>{try{let n=await(await fetch(`/api/hub/device-poll?flow=${e.flow_id}`,{headers:{Accept:`application/json`}})).json();n.status===`complete`?(clearInterval(t),r(`done`),a(`connected as @${n.session?.login??`GitHub`} — you can now publish rulesets`)):(n.status===`expired`||n.status===`error`)&&(clearInterval(t),r(`error`),a(n.error??`Authentication failed`))}catch{}},3e3);return()=>clearInterval(t)},[n,e]),(0,U.jsxs)(`div`,{className:`max-w-lg mx-auto space-y-5`,children:[(0,U.jsxs)(`div`,{children:[(0,U.jsxs)(`a`,{href:`/hub`,className:`inline-flex items-center gap-1.5 text-[11px] font-mono uppercase tracking-wider text-[var(--color-fg-3)] hover:text-[var(--color-brand)] transition-colors`,children:[(0,U.jsx)(`svg`,{width:`10`,height:`10`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2`,children:(0,U.jsx)(`polyline`,{points:`15 18 9 12 15 6`})}),`back to hub`]}),(0,U.jsx)(`h1`,{className:`text-xl font-medium tracking-tight mt-2 text-[var(--color-fg-0)]`,children:`Connect GitHub`}),(0,U.jsx)(`p`,{className:`text-[12px] text-[var(--color-fg-3)] mt-1 font-mono`,children:`authenticate with github to publish rulesets to the hub`})]}),n===`not_configured`&&(0,U.jsx)(W,{children:(0,U.jsxs)(K,{className:`space-y-4`,children:[(0,U.jsxs)(`div`,{className:`flex items-start gap-3`,children:[(0,U.jsx)(`span`,{className:`text-amber-300 shrink-0 mt-0.5`,children:(0,U.jsxs)(`svg`,{width:`16`,height:`16`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2`,children:[(0,U.jsx)(`circle`,{cx:`12`,cy:`12`,r:`10`}),(0,U.jsx)(`line`,{x1:`12`,y1:`8`,x2:`12`,y2:`12`}),(0,U.jsx)(`line`,{x1:`12`,y1:`16`,x2:`12.01`,y2:`16`})]})}),(0,U.jsxs)(`div`,{children:[(0,U.jsx)(`p`,{className:`text-sm font-medium text-[var(--color-fg-0)]`,children:`GitHub OAuth not configured`}),(0,U.jsx)(`p`,{className:`text-xs text-[var(--color-fg-2)] mt-1 leading-relaxed`,children:i})]})]}),(0,U.jsxs)(`div`,{className:`border-t border-[var(--color-line-0)] pt-4`,children:[(0,U.jsx)(`div`,{className:`overline mb-3`,children:`setup steps`}),(0,U.jsx)(`ol`,{className:`space-y-2`,children:o.map((e,t)=>(0,U.jsxs)(`li`,{className:`flex items-start gap-2.5 text-xs text-[var(--color-fg-1)]`,children:[(0,U.jsx)(`span`,{className:`shrink-0 w-5 h-5 rounded-sm bg-[var(--color-surface-2)] border border-[var(--color-line-1)] text-[var(--color-fg-3)] text-[10px] font-mono flex items-center justify-center tabular-nums`,children:t+1}),(0,U.jsx)(`span`,{className:`mt-0.5 leading-relaxed`,children:e.replace(/^\d+\.\s+/,``)})]},t))})]}),(0,U.jsxs)(`div`,{className:`bg-[var(--color-surface-0)] border border-[var(--color-line-1)] rounded-sm p-3`,children:[(0,U.jsx)(`div`,{className:`overline mb-1.5`,children:`quick start`}),(0,U.jsx)(`code`,{className:`text-[11px] text-[var(--color-brand)]/90 font-mono`,children:`export SSG_GITHUB_CLIENT_ID=<your-client-id>`}),(0,U.jsxs)(`p`,{className:`text-[11px] font-mono text-[var(--color-fg-3)] mt-1`,children:[`then restart:`,` `,(0,U.jsx)(`code`,{className:`text-[var(--color-fg-1)]`,children:`ssg serve`})]})]}),(0,U.jsx)(`a`,{href:`https://github.com/settings/applications/new`,target:`_blank`,rel:`noreferrer`,className:`inline-flex items-center gap-1.5 text-[11px] font-mono uppercase tracking-wider text-[var(--color-brand)] hover:underline`,children:`create github oauth app →`})]})}),n===`idle`&&(0,U.jsx)(W,{children:(0,U.jsxs)(K,{children:[(0,U.jsx)(`p`,{className:`text-[12px] text-[var(--color-fg-2)] mb-4 leading-relaxed`,children:`This uses GitHub's device authorization flow — no redirect URIs needed. You'll be shown a code to enter at github.com.`}),(0,U.jsx)(J,{onClick:u,disabled:c,variant:`primary`,children:c?`starting…`:`connect with github`})]})}),e&&n===`polling`&&(0,U.jsx)(W,{children:(0,U.jsxs)(K,{className:`space-y-4`,children:[(0,U.jsxs)(`div`,{className:`text-center`,children:[(0,U.jsx)(`div`,{className:`overline mb-2`,children:`open this url in your browser`}),(0,U.jsx)(`a`,{href:e.verification_uri,target:`_blank`,rel:`noreferrer`,className:`text-sm text-[var(--color-brand)] hover:underline font-mono`,children:e.verification_uri})]}),(0,U.jsxs)(`div`,{className:`border border-[var(--color-line-1)] bg-[var(--color-surface-0)] rounded-sm py-5 text-center`,children:[(0,U.jsx)(`div`,{className:`overline mb-3`,children:`enter this code`}),(0,U.jsx)(`div`,{className:`text-4xl font-mono font-bold tracking-[0.3em] text-[var(--color-fg-0)]`,children:e.user_code})]}),(0,U.jsxs)(`p`,{className:`text-[11px] font-mono uppercase tracking-wider text-[var(--color-fg-3)] text-center flex items-center justify-center gap-2`,children:[(0,U.jsx)(`svg`,{className:`animate-spin`,width:`11`,height:`11`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2.5`,children:(0,U.jsx)(`path`,{d:`M21 12a9 9 0 1 1-6.219-8.56`})}),`waiting for github authorization…`]})]})}),n===`done`&&(0,U.jsxs)(`div`,{className:`rounded-sm border border-emerald-500/25 bg-emerald-500/5 p-4 text-sm text-emerald-200 space-y-2`,children:[(0,U.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,U.jsx)(`svg`,{width:`15`,height:`15`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2.5`,children:(0,U.jsx)(`polyline`,{points:`20 6 9 17 4 12`})}),(0,U.jsx)(`span`,{className:`font-mono text-xs`,children:i})]}),(0,U.jsx)(`a`,{href:`/hub/publish`,className:`text-[11px] font-mono uppercase tracking-wider text-[var(--color-brand)] hover:underline block mt-1`,children:`publish a ruleset →`})]}),n===`error`&&i&&(0,U.jsxs)(`div`,{className:`rounded-sm border border-red-500/25 bg-red-500/5 p-4`,children:[(0,U.jsx)(`p`,{className:`text-sm text-red-200 font-mono`,children:i}),(0,U.jsx)(`button`,{onClick:()=>{r(`idle`),a(``)},className:`text-[11px] font-mono text-[var(--color-fg-3)] hover:text-[var(--color-fg-1)] mt-3 cursor-pointer uppercase tracking-wider`,children:`← try again`})]})]})}function Gc(){let[e,t]=(0,_.useState)(``),[n,r]=(0,_.useState)(!1),[i,a]=(0,_.useState)(null);async function o(t){if(t.preventDefault(),e.trim()){r(!0),a(null);try{a(await(await fetch(`/api/hub/publish`,{method:`POST`,headers:{"Content-Type":`application/json`,...Ae()},body:JSON.stringify({repo_url:e.trim()})})).json())}catch(e){a({ok:!1,error:e instanceof Error?e.message:`Unknown error`})}finally{r(!1)}}}return(0,U.jsxs)(`div`,{className:`max-w-md mx-auto space-y-5`,children:[(0,U.jsxs)(`div`,{children:[(0,U.jsx)(`a`,{href:`/hub`,className:`text-[11px] font-mono uppercase tracking-wider text-[var(--color-fg-3)] hover:text-[var(--color-brand)]`,children:`← hub`}),(0,U.jsx)(`h1`,{className:`text-xl font-medium tracking-tight mt-2 text-[var(--color-fg-0)]`,children:`Publish Ruleset`}),(0,U.jsx)(`p`,{className:`text-[12px] text-[var(--color-fg-3)] mt-1 font-mono`,children:`publish a github repository containing .rules files to the hub`})]}),(0,U.jsx)(W,{children:(0,U.jsx)(K,{children:(0,U.jsxs)(`form`,{onSubmit:o,className:`space-y-4`,children:[(0,U.jsxs)(`div`,{children:[(0,U.jsx)(`label`,{className:`block overline mb-1.5`,children:`github repository url`}),(0,U.jsx)(`input`,{type:`url`,placeholder:`https://github.com/owner/repo`,value:e,onChange:e=>t(e.target.value),required:!0,className:`w-full bg-[var(--color-surface-0)] border border-[var(--color-line-1)] text-[var(--color-fg-1)] text-sm rounded-sm px-3 py-2 focus:outline-none focus:border-[var(--color-brand)]/50 placeholder:text-[var(--color-fg-4)] font-mono`})]}),(0,U.jsx)(J,{type:`submit`,variant:`primary`,disabled:n,children:n?`publishing…`:`publish to hub`})]})})}),i&&(0,U.jsx)(`div`,{className:`rounded-sm border px-3 py-2 text-xs font-mono ${i.ok?`border-emerald-500/25 bg-emerald-500/5 text-emerald-300`:`border-red-500/25 bg-red-500/5 text-red-300`}`,children:i.ok?(0,U.jsxs)(U.Fragment,{children:[`✓ published!`,` `,i.id&&(0,U.jsx)(`a`,{href:`/hub/${i.id}`,className:`text-[var(--color-brand)] hover:underline uppercase tracking-wider text-[11px] ml-2`,children:`view ruleset →`})]}):i.error??`publish failed`})]})}function Kc(e){return e===0?`—`:e<1e3?`${e}ns`:e<1e6?`${(e/1e3).toFixed(1)}µs`:`${(e/1e6).toFixed(1)}ms`}function qc(e){let t=Math.floor(e/1e3);if(t<60)return`${t}s`;let n=Math.floor(t/60);return n<60?`${n}m ${t%60}s`:`${Math.floor(n/60)}h ${n%60}m`}function Jc(e){let t=e<1e10?e*1e3:e,n=new Date(t);return`${String(n.getHours()).padStart(2,`0`)}:${String(n.getMinutes()).padStart(2,`0`)}:${String(n.getSeconds()).padStart(2,`0`)}`}function Yc(e){let t=Math.round((Date.now()-e)/1e3);if(t<5)return`just now`;if(t<60)return`${t}s ago`;let n=Math.floor(t/60);return n<60?`${n}m ago`:`${Math.floor(n/60)}h ago`}var Xc={allow:`text-emerald-300`,block:`text-red-300`,force:`text-violet-300`,log:`text-amber-300`,ask:`text-sky-300`,shadow:`text-[var(--color-fg-3)]`},Zc={allow:`✓`,block:`✗`,force:`→`,log:`·`,ask:`?`,shadow:`~`};function Qc({label:e,ns:t,maxNs:n}){let r=n>0?Math.min(100,t/n*100):0;return(0,U.jsxs)(`div`,{className:`flex items-center gap-2 text-xs`,children:[(0,U.jsx)(`span`,{className:`text-[var(--color-fg-3)] w-8 text-right font-mono uppercase tracking-wider text-[10px]`,children:e}),(0,U.jsx)(ks,{pct:r,tone:t<1e5?`green`:t<1e6?`amber`:`red`,className:`h-1 flex-1`}),(0,U.jsx)(`span`,{className:`font-mono text-[var(--color-fg-1)] tabular-nums w-14 text-right`,children:Kc(t)})]})}function $c({value:e,max:t,threshold:n,breached:r}){let i=t>0?Math.min(100,e/t*100):0,a=t>0?Math.min(100,n/t*100):0;return(0,U.jsx)(ks,{pct:i,tone:r?`red`:e/t>=.6?`amber`:`green`,markerPct:a,markerTitle:`limit: ${n}`,className:`h-1`})}function el({limitsData:e,onSaved:t}){let[n,r]=(0,_.useState)(String(e.config.cpuLimitPct)),[i,a]=(0,_.useState)(String(e.config.memoryLimitMb)),[o,s]=(0,_.useState)(e.config.breachAction),[c,l]=(0,_.useState)(!1),[u,d]=(0,_.useState)(null);async function f(){l(!0),d(null);try{let e=await fetch(`/api/json/limits`,{method:`POST`,headers:{"Content-Type":`application/json`,...Ae()},body:JSON.stringify({cpu_limit_pct:parseFloat(n),memory_limit_mb:parseFloat(i),breach_action:o})});e.ok?t():d((await e.json()).error??`save failed`)}catch{d(`network error`)}finally{l(!1)}}let p=`w-full bg-[var(--color-surface-0)] border border-[var(--color-line-1)] rounded-sm px-2 py-1.5 text-[var(--color-fg-1)] font-mono text-xs focus:outline-none focus:border-[var(--color-brand)]/50`;return(0,U.jsxs)(`div`,{className:`space-y-3`,children:[(0,U.jsxs)(`div`,{className:`grid grid-cols-2 gap-3`,children:[(0,U.jsxs)(`div`,{children:[(0,U.jsx)(`label`,{className:`overline block mb-1.5`,children:`cpu limit (%)`}),(0,U.jsx)(`input`,{type:`number`,min:1,max:100,value:n,onChange:e=>r(e.target.value),className:p})]}),(0,U.jsxs)(`div`,{children:[(0,U.jsx)(`label`,{className:`overline block mb-1.5`,children:`memory limit (mb)`}),(0,U.jsx)(`input`,{type:`number`,min:1,value:i,onChange:e=>a(e.target.value),className:p})]})]}),(0,U.jsxs)(`div`,{children:[(0,U.jsx)(`label`,{className:`overline block mb-1.5`,children:`on breach`}),(0,U.jsxs)(`select`,{value:o,onChange:e=>s(e.target.value),className:p,children:[(0,U.jsx)(`option`,{value:`warn`,children:`warn in ui only`}),(0,U.jsx)(`option`,{value:`log`,children:`warn + write to audit log`})]})]}),u&&(0,U.jsx)(`p`,{className:`text-xs text-red-300 font-mono`,children:u}),(0,U.jsx)(J,{onClick:f,disabled:c,variant:`primary`,size:`sm`,children:c?`saving…`:`save limits`})]})}var tl={running:`green`,hibernating:`amber`,exhausted:`red`,stopped:`gray`,idle:`gray`};function nl(e,t){let n=e-t;if(n<=0)return`any moment`;let r=Math.round(n/1e3);if(r<60)return`in ${r}s`;let i=Math.floor(r/60);return i<60?`in ${i}m ${r%60}s`:`in ${Math.floor(i/60)}h ${i%60}m`}function rl({supervisors:e}){let[t,n]=(0,_.useState)(Date.now());return(0,_.useEffect)(()=>{let e=setInterval(()=>n(Date.now()),1e3);return()=>clearInterval(e)},[]),(0,U.jsxs)(W,{children:[(0,U.jsxs)(G,{className:`flex items-center justify-between`,children:[(0,U.jsxs)(`span`,{className:`flex items-center gap-2 overline`,children:[`supervisor health`,e.some(e=>e.state===`hibernating`||e.state===`exhausted`)&&(0,U.jsx)(q,{variant:`amber`,children:`degraded`})]}),(0,U.jsxs)(`span`,{className:`text-[10px] font-mono tabular-nums text-[var(--color-fg-4)]`,children:[e.length,` supervisor`,e.length===1?``:`s`]})]}),(0,U.jsx)(K,{children:e.length===0?(0,U.jsx)(`p`,{className:`text-[11px] font-mono text-[var(--color-fg-4)]`,children:`no supervisors registered yet`}):(0,U.jsx)(`div`,{className:`overflow-x-auto`,children:(0,U.jsxs)(`table`,{className:`w-full text-xs font-mono`,children:[(0,U.jsx)(`thead`,{children:(0,U.jsxs)(`tr`,{className:`text-[10px] uppercase tracking-wider text-[var(--color-fg-4)]`,children:[(0,U.jsx)(`th`,{className:`text-left font-normal pb-1.5`,children:`name`}),(0,U.jsx)(`th`,{className:`text-left font-normal pb-1.5`,children:`kind`}),(0,U.jsx)(`th`,{className:`text-left font-normal pb-1.5`,children:`state`}),(0,U.jsx)(`th`,{className:`text-right font-normal pb-1.5`,children:`restarts`}),(0,U.jsx)(`th`,{className:`text-left font-normal pb-1.5 pl-4`,children:`last restart`}),(0,U.jsx)(`th`,{className:`text-left font-normal pb-1.5 pl-4`,children:`next retry`})]})}),(0,U.jsx)(`tbody`,{children:e.map(e=>(0,U.jsxs)(`tr`,{className:`border-t border-[var(--color-line-0)]`,children:[(0,U.jsx)(`td`,{className:`py-1.5 text-[var(--color-fg-1)]`,children:e.name}),(0,U.jsx)(`td`,{className:`py-1.5 text-[var(--color-fg-3)]`,children:e.kind===`single`?`single`:`tree`}),(0,U.jsx)(`td`,{className:`py-1.5`,children:(0,U.jsx)(q,{variant:tl[e.state],children:e.state})}),(0,U.jsx)(`td`,{className:`py-1.5 text-right tabular-nums text-[var(--color-fg-1)]`,children:e.restarts}),(0,U.jsx)(`td`,{className:`py-1.5 pl-4 tabular-nums text-[var(--color-fg-3)]`,children:e.lastRestartAt>0?Yc(e.lastRestartAt):`—`}),(0,U.jsx)(`td`,{className:`py-1.5 pl-4 tabular-nums text-[var(--color-fg-3)]`,children:e.nextRetryAt>0?(0,U.jsx)(`span`,{title:e.hibernateReason?`reason: ${e.hibernateReason}`:void 0,children:nl(e.nextRetryAt,t)}):`—`})]},e.name))})]})})})]})}function il(){let e=je([`runtime-tick`,`activity-updated`,`limits-breach`,`supervisor-changed`]),t=Oe(),[n,r]=(0,_.useState)(Date.now()),[i,a]=(0,_.useState)(0),[o,s]=(0,_.useState)([]),[c,l]=(0,_.useState)(0),[u,d]=(0,_.useState)(!1),f=(0,_.useRef)(null);(0,_.useEffect)(()=>{let e=setInterval(()=>r(Date.now()),1e3);return()=>clearInterval(e)},[]);let{data:p}=R(`/api/state/runtime`,[e[`runtime-tick`]]),{data:m,refetch:h}=R(`/api/json/limits`,[e[`limits-breach`]]),{data:g}=R(`/api/state/activity-tail?after=${i}&limit=50`,[e[`activity-updated`],e[`runtime-tick`]]),{data:v}=R(`/api/json/supervisors`,[e[`supervisor-changed`],e[`runtime-tick`]]);(0,_.useEffect)(()=>{g&&g.rows.length>0&&(a(e=>Math.max(e,g.maxId)),s(e=>{let t=new Set(e.map(e=>e.id));return[...g.rows.filter(e=>!t.has(e.id)),...e].slice(0,100)}))},[g]),(0,_.useEffect)(()=>{let e=p!==null;f.current===!1&&e&&l(e=>e+1),f.current=e},[p]);let y=p?qc(p.uptime_ms):null,b=p&&p.last_eval_at>0?Yc(p.last_eval_at):null,x=m?.breaches.cpu??!1,S=m?.breaches.memory??!1,C=p?x?`text-red-300`:(p.cpu_pct??0)>=60?`text-amber-300`:`text-emerald-300`:`text-[var(--color-fg-1)]`,w=S?`text-red-300`:`text-[var(--color-fg-1)]`;return(0,U.jsxs)(`div`,{className:`space-y-5`,children:[(0,U.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,U.jsxs)(`div`,{children:[(0,U.jsx)(`h1`,{className:`text-xl font-medium tracking-tight text-[var(--color-fg-0)]`,children:`Daemon Monitor`}),(0,U.jsx)(`p`,{className:`text-[12px] font-mono text-[var(--color-fg-3)] mt-0.5`,children:`live metrics · audit tail · resource limits`})]}),(0,U.jsxs)(`div`,{className:`flex items-center gap-3`,children:[c>0&&(0,U.jsxs)(q,{variant:`amber`,children:[c,` restart`,c===1?``:`s`]}),(0,U.jsx)(`span`,{className:`text-[11px] font-mono tabular-nums text-[var(--color-fg-3)]`,children:Jc(n)})]})]}),(0,U.jsx)(al,{cpuPct:p?.cpu_pct??0,cpuLimit:m?.config.cpuLimitPct,memMb:p?.memory_rss_mb??0,memLimit:m?.config.memoryLimitMb,decisions:p?.decisions,latency:p?.latency,burstBuffer:t,evalsTotal:p?.evals_total??0}),m&&(x||S)&&(0,U.jsxs)(`div`,{className:`rounded-sm border border-red-500/25 bg-red-500/[0.06] border-l-2 border-l-red-500/70 px-3 py-2.5 flex items-start gap-2.5`,children:[(0,U.jsx)(`span`,{className:`text-red-300 shrink-0 mt-0.5`,children:(0,U.jsxs)(`svg`,{width:`14`,height:`14`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2`,children:[(0,U.jsx)(`path`,{d:`M10.29 3.86 1.82 18a2 2 0 0 0 1.71 3h16.94a2 2 0 0 0 1.71-3L13.71 3.86a2 2 0 0 0-3.42 0Z`}),(0,U.jsx)(`line`,{x1:`12`,y1:`9`,x2:`12`,y2:`13`}),(0,U.jsx)(`line`,{x1:`12`,y1:`17`,x2:`12.01`,y2:`17`})]})}),(0,U.jsxs)(`div`,{className:`space-y-0.5 text-xs font-mono`,children:[x&&(0,U.jsxs)(`div`,{className:`text-red-200`,children:[`cpu limit exceeded: `,p?.cpu_pct??`?`,`% >`,` `,m.config.cpuLimitPct,`%`]}),S&&(0,U.jsxs)(`div`,{className:`text-red-200`,children:[`memory limit exceeded: `,p?.memory_rss_mb??`?`,`mb >`,` `,m.config.memoryLimitMb,`mb`]})]})]}),(0,U.jsxs)(W,{children:[(0,U.jsx)(G,{children:(0,U.jsx)(`span`,{className:`overline`,children:`daemon status`})}),(0,U.jsx)(K,{children:p===null?(0,U.jsxs)(`div`,{className:`flex items-center gap-2 text-sm`,children:[(0,U.jsx)(`span`,{className:`inline-block w-1.5 h-1.5 rounded-full bg-red-500 shrink-0`}),(0,U.jsx)(`span`,{className:`text-red-300 font-mono uppercase tracking-wider text-xs`,children:`down`}),(0,U.jsx)(`span`,{className:`text-[var(--color-fg-3)] text-xs font-mono`,children:`— socket not reachable`})]}):(0,U.jsxs)(`div`,{className:`flex items-center gap-5 flex-wrap text-xs font-mono`,children:[(0,U.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,U.jsx)(`span`,{className:`inline-block w-1.5 h-1.5 rounded-full bg-emerald-400 pulse-soft shrink-0`}),(0,U.jsx)(`span`,{className:`text-emerald-300 uppercase tracking-wider`,children:`up`})]}),(0,U.jsxs)(`span`,{className:`text-[var(--color-fg-3)]`,children:[`pid`,` `,(0,U.jsx)(`span`,{className:`text-[var(--color-fg-1)] tabular-nums`,children:p.pid})]}),(0,U.jsxs)(`span`,{className:`text-[var(--color-fg-3)]`,children:[`uptime`,` `,(0,U.jsx)(`span`,{className:`text-[var(--color-fg-1)] tabular-nums`,children:y})]}),(0,U.jsxs)(`span`,{className:`text-[var(--color-fg-3)]`,children:[`mem`,` `,(0,U.jsxs)(`span`,{className:`text-[var(--color-fg-1)] tabular-nums`,children:[p.memory_rss_mb,`MB`]})]}),(0,U.jsxs)(`span`,{className:`text-[var(--color-fg-3)]`,children:[`cpu`,` `,(0,U.jsxs)(`span`,{className:`${C} tabular-nums`,children:[p.cpu_pct,`%`]})]}),(0,U.jsxs)(`span`,{className:`text-[var(--color-fg-3)]`,children:[`last eval`,` `,(0,U.jsx)(`span`,{className:`text-[var(--color-fg-1)] tabular-nums`,children:b??`—`})]})]})})]}),(0,U.jsx)(rl,{supervisors:v?.supervisors??[]}),(0,U.jsxs)(W,{children:[(0,U.jsxs)(G,{className:`flex items-center justify-between`,children:[(0,U.jsxs)(`span`,{className:`flex items-center gap-2 overline`,children:[`system resources`,m&&(x||S)&&(0,U.jsx)(q,{variant:`red`,children:`limit exceeded`})]}),(0,U.jsx)(`button`,{onClick:()=>d(e=>!e),className:`text-[10px] font-mono uppercase tracking-wider text-[var(--color-fg-3)] hover:text-[var(--color-brand)] transition-colors cursor-pointer`,children:u?`hide limits`:`configure limits`})]}),(0,U.jsxs)(K,{children:[p===null?(0,U.jsx)(`p`,{className:`text-[11px] font-mono text-[var(--color-fg-4)]`,children:`no data — daemon not running`}):(0,U.jsxs)(`div`,{className:`space-y-5`,children:[(0,U.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,U.jsxs)(`div`,{className:`flex items-center justify-between text-xs`,children:[(0,U.jsx)(`span`,{className:`overline`,children:`cpu`}),(0,U.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(p.history.cpu_pct.length??0)>1&&(0,U.jsx)(yr,{data:p.history.cpu_pct,width:80,height:20,color:x?`#f87171`:`#34d399`,threshold:m?.config.cpuLimitPct,maxValue:100}),(0,U.jsxs)(`span`,{className:`font-mono font-medium w-12 text-right tabular-nums ${C}`,children:[p.cpu_pct,`%`]})]})]}),(0,U.jsx)($c,{value:p.cpu_pct,max:100,threshold:m?.config.cpuLimitPct??90,breached:x}),m&&(0,U.jsxs)(`div`,{className:`text-[10px] font-mono text-[var(--color-fg-4)]`,children:[`limit: `,m.config.cpuLimitPct,`%`]})]}),(0,U.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,U.jsxs)(`div`,{className:`flex items-center justify-between text-xs`,children:[(0,U.jsx)(`span`,{className:`overline`,children:`memory rss`}),(0,U.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(p.history.memory_rss_mb.length??0)>1&&(0,U.jsx)(yr,{data:p.history.memory_rss_mb,width:80,height:20,color:S?`#f87171`:`#38bdf8`,threshold:m?.config.memoryLimitMb}),(0,U.jsxs)(`span`,{className:`font-mono font-medium w-16 text-right tabular-nums ${w}`,children:[p.memory_rss_mb,`MB`]})]})]}),(0,U.jsx)($c,{value:p.memory_rss_mb,max:Math.max(p.memory_rss_mb*1.5,m?.config.memoryLimitMb??512),threshold:m?.config.memoryLimitMb??512,breached:S}),m&&(0,U.jsxs)(`div`,{className:`text-[10px] font-mono text-[var(--color-fg-4)]`,children:[`limit: `,m.config.memoryLimitMb,`MB`]})]}),(0,U.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,U.jsxs)(`div`,{className:`flex items-center justify-between text-xs`,children:[(0,U.jsx)(`span`,{className:`overline`,children:`heap`}),(0,U.jsxs)(`span`,{className:`font-mono text-[var(--color-fg-1)] tabular-nums`,children:[p.heap_used_mb,`MB / `,p.heap_total_mb,`MB`]})]}),(0,U.jsx)(ks,{pct:p.heap_total_mb>0?Math.min(100,p.heap_used_mb/p.heap_total_mb*100):0,tone:`blue`,className:`h-1`})]})]}),u&&m&&(0,U.jsxs)(`div`,{className:`mt-5 pt-4 border-t border-[var(--color-line-0)]`,children:[(0,U.jsxs)(`p`,{className:`text-[11px] font-mono text-[var(--color-fg-3)] mb-3 leading-relaxed`,children:[`thresholds trigger ui warnings. values are persisted to`,` `,(0,U.jsx)(`code`,{className:`text-[var(--color-fg-1)]`,children:`.sigmashake/config.toml`}),`.`]}),(0,U.jsx)(el,{limitsData:m,onSaved:()=>{h(),d(!1)}})]})]})]}),(0,U.jsxs)(`div`,{className:`grid grid-cols-2 sm:grid-cols-3 lg:grid-cols-6 gap-2`,children:[(0,U.jsx)(Os,{className:`rounded-sm border border-[var(--color-line-1)] bg-[var(--color-surface-1)]`,labelPlacement:`above`,label:`total evals`,value:p?.evals_total??`—`,valueClassName:`text-xl font-medium tabular-nums text-[var(--color-fg-0)]`}),(0,U.jsx)(Os,{className:`rounded-sm border border-[var(--color-line-1)] bg-[var(--color-surface-1)]`,labelPlacement:`above`,label:`allow`,value:p?.decisions.allow??`—`,valueClassName:`text-xl font-medium tabular-nums text-emerald-300`}),(0,U.jsx)(Os,{className:`rounded-sm border border-[var(--color-line-1)] bg-[var(--color-surface-1)]`,labelPlacement:`above`,label:`block`,value:p?.decisions.block??`—`,valueClassName:`text-xl font-medium tabular-nums text-red-300`}),(0,U.jsx)(Os,{className:`rounded-sm border border-[var(--color-line-1)] bg-[var(--color-surface-1)]`,labelPlacement:`above`,label:`force`,value:p?.decisions.force??`—`,valueClassName:`text-xl font-medium tabular-nums text-violet-300`}),(0,U.jsx)(Os,{className:`rounded-sm border border-[var(--color-line-1)] bg-[var(--color-surface-1)]`,labelPlacement:`above`,label:`log`,value:p?.decisions.log??`—`,valueClassName:`text-xl font-medium tabular-nums text-amber-300`}),(0,U.jsx)(Os,{className:`rounded-sm border border-[var(--color-line-1)] bg-[var(--color-surface-1)]`,labelPlacement:`above`,label:`ask`,value:p?.decisions.ask??`—`,valueClassName:`text-xl font-medium tabular-nums text-sky-300`})]}),(0,U.jsxs)(`div`,{className:`grid grid-cols-1 lg:grid-cols-2 gap-4`,children:[(0,U.jsxs)(W,{children:[(0,U.jsxs)(G,{className:`flex items-center justify-between`,children:[(0,U.jsx)(`span`,{className:`overline`,children:`eval latency`}),p&&(0,U.jsxs)(`span`,{className:`text-[10px] font-mono text-[var(--color-fg-3)] tabular-nums`,children:[p.latency.samples,` samples`]})]}),(0,U.jsx)(K,{children:p===null?(0,U.jsx)(`p`,{className:`text-[11px] font-mono text-[var(--color-fg-4)]`,children:`no data`}):(0,U.jsxs)(`div`,{className:`space-y-2`,children:[(0,U.jsx)(Qc,{label:`p50`,ns:p.latency.p50_ns,maxNs:p.latency.max_ns}),(0,U.jsx)(Qc,{label:`p95`,ns:p.latency.p95_ns,maxNs:p.latency.max_ns}),(0,U.jsx)(Qc,{label:`p99`,ns:p.latency.p99_ns,maxNs:p.latency.max_ns}),(0,U.jsx)(Qc,{label:`max`,ns:p.latency.max_ns,maxNs:p.latency.max_ns})]})})]}),(0,U.jsxs)(W,{children:[(0,U.jsx)(G,{children:(0,U.jsx)(`span`,{className:`overline`,children:`engine`})}),(0,U.jsx)(K,{children:p===null?(0,U.jsx)(`p`,{className:`text-[11px] font-mono text-[var(--color-fg-4)]`,children:`no data`}):(0,U.jsx)(`div`,{className:`space-y-1.5 text-xs font-mono`,children:[[`native evals`,p.engine.native_evals],[`ts evals`,p.engine.ts_evals],[`native %`,`${p.engine.native_pct}%`],[`rule reloads`,p.rule_reloads],[`rate limit trips`,p.rate_limit_trips],[`loop guard blocks`,p.loop_guard_blocks],[`connection errors`,p.connection_errors]].map(([e,t])=>(0,U.jsxs)(`div`,{className:`flex justify-between py-0.5 border-b border-[var(--color-line-0)] last:border-0`,children:[(0,U.jsx)(`span`,{className:`text-[var(--color-fg-3)]`,children:e}),(0,U.jsx)(`span`,{className:`text-[var(--color-fg-1)] tabular-nums`,children:t})]},e))})})]})]}),(0,U.jsxs)(W,{children:[(0,U.jsxs)(G,{className:`flex items-center justify-between`,children:[(0,U.jsx)(`span`,{className:`overline`,children:`live event tail`}),(0,U.jsx)(`span`,{className:`text-[10px] font-mono text-[var(--color-fg-4)]`,children:`newest first · auto-updating`})]}),(0,U.jsx)(K,{children:o.length===0?(0,U.jsx)(`div`,{className:`rounded-sm border border-dashed border-[var(--color-line-1)] bg-[var(--color-surface-0)] px-4 py-6 text-center`,children:(0,U.jsx)(`p`,{className:`text-[11px] font-mono text-[var(--color-fg-4)]`,children:`no events yet`})}):(0,U.jsx)(`div`,{className:`font-mono text-[11px] max-h-96 overflow-y-auto divide-y divide-[var(--color-line-0)]`,children:o.map(e=>(0,U.jsxs)(`div`,{className:`flex items-center gap-2 py-1`,children:[(0,U.jsx)(`span`,{className:`text-[var(--color-fg-4)] shrink-0 w-16 tabular-nums`,children:Jc(e.timestamp)}),e.tool===`__daemon`?(0,U.jsxs)(`span`,{className:`text-sky-400`,children:[`daemon`,` `,(()=>{try{let t=JSON.parse(e.input??`{}`);return`${t.event??e.decision}${t.detail?` (${t.detail})`:``}`}catch{return e.decision}})()]}):(0,U.jsxs)(U.Fragment,{children:[(0,U.jsxs)(`span`,{className:`shrink-0 w-16 uppercase tracking-wider text-[10px] ${Xc[e.decision]??`text-[var(--color-fg-3)]`}`,children:[Zc[e.decision]??`·`,` `,e.decision]}),(0,U.jsx)(`span`,{className:`text-[var(--color-fg-1)] shrink-0 w-24 truncate`,children:e.tool}),(0,U.jsx)(`span`,{className:`text-[var(--color-fg-4)] shrink-0 w-14 text-right tabular-nums`,children:Kc(e.duration_ns)}),e.rule_id&&(0,U.jsx)(`a`,{href:`/rules?highlight=${encodeURIComponent(e.rule_id)}`,className:`text-[var(--color-brand)]/80 hover:text-[var(--color-brand)] truncate transition-colors`,title:e.rule_id,children:e.rule_id})]})]},e.id))})})]}),(0,U.jsxs)(W,{children:[(0,U.jsx)(G,{children:(0,U.jsx)(`span`,{className:`overline`,children:`ai agent debug endpoints`})}),(0,U.jsxs)(K,{children:[(0,U.jsx)(`p`,{className:`text-[11px] font-mono text-[var(--color-fg-3)] mb-2.5`,children:`agents can query these endpoints directly for automated triage:`}),(0,U.jsx)(`div`,{className:`space-y-1 font-mono text-[11px]`,children:[[`/api/state/runtime`,`full metrics snapshot (cpu, memory, history, latency)`],[`/api/json/limits`,`resource limits config + breach state`],[`/api/state/activity-tail?after=0&limit=20`,`recent eval events`],[`/api/json/daemon-status`,`status, pid, log tail`],[`/healthz`,`process uptime`]].map(([e,t])=>(0,U.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,U.jsx)(`span`,{className:`text-[var(--color-fg-4)]`,children:`GET`}),(0,U.jsx)(`a`,{href:e,target:`_blank`,rel:`noreferrer`,className:`text-[var(--color-brand)]/80 hover:text-[var(--color-brand)] transition-colors`,children:e}),(0,U.jsxs)(`span`,{className:`text-[var(--color-fg-4)]`,children:[`— `,t]})]},e))})]})]})]})}function al({cpuPct:e,cpuLimit:t,memMb:n,memLimit:r,decisions:i,latency:a,evalsTotal:o,burstBuffer:s}){let c=(0,_.useMemo)(()=>{if(s.length===0)return 0;let e=Date.now()-1e4;return s.filter(t=>t.ts_ms>=e).length/10},[s]);return(a?.p95_ns??0)/1e6,(a?.p50_ns??0)/1e6,(a?.p99_ns??0)/1e6,(0,U.jsxs)(`div`,{className:`grid-bleed rounded-sm border border-[var(--color-line-1)] bg-[var(--color-surface-1)] p-3`,children:[(0,U.jsxs)(`div`,{className:`grid grid-cols-1 lg:grid-cols-12 gap-4`,children:[(0,U.jsxs)(`div`,{className:`lg:col-span-3 flex flex-col items-center gap-2`,children:[(0,U.jsx)(qr,{mode:`ring`,value:e,max:100,warnAt:(t??90)/100*.7,critAt:(t??90)/100,display:`${e.toFixed(1)}%`,label:`cpu`,size:220}),(0,U.jsx)(xr,{value:e,width:260,height:56,windowMs:6e4,color:`#34d399`,fillColor:`rgba(52, 211, 153, 0.14)`,maxValue:100,className:`w-full`})]}),(0,U.jsxs)(`div`,{className:`lg:col-span-3 flex flex-col items-center gap-2`,children:[(0,U.jsx)(qr,{mode:`ring`,value:n,max:r??1024,warnAt:.7,critAt:.9,display:`${n.toFixed(0)} MB`,label:`memory`,size:220}),(0,U.jsx)(xr,{value:n,width:260,height:56,windowMs:6e4,color:`#38bdf8`,fillColor:`rgba(56, 189, 248, 0.14)`,maxValue:r?r*1.1:void 0,className:`w-full`})]}),(0,U.jsx)(`div`,{className:`lg:col-span-6`,children:(0,U.jsx)(ei,{latency:a,bursts:s,gaugeMaxMs:10,windowMs:3e4,trendWindowSec:60,gaugeSize:200})})]}),(0,U.jsxs)(`div`,{className:`mt-4 grid grid-cols-1 lg:grid-cols-2 gap-3`,children:[(0,U.jsx)(kr,{label:`Total Evals`,value:o,tone:`amber`,sub:`${c.toFixed(1)}/s`,burstRing:s}),(0,U.jsxs)(`div`,{className:`flex flex-col gap-2 rounded-sm border bg-[var(--color-surface-1)] border-[var(--color-line-1)] px-4 py-3`,children:[(0,U.jsxs)(`div`,{className:`flex items-baseline justify-between`,children:[(0,U.jsx)(`span`,{className:`overline`,children:`throughput · 60 s`}),(0,U.jsxs)(`span`,{className:`text-[10px] font-mono text-[var(--color-fg-3)] tabular-nums`,children:[c.toFixed(1),`/s`]})]}),(0,U.jsx)(xr,{value:c,width:420,height:56,windowMs:6e4,className:`w-full`})]})]}),i?(0,U.jsx)(`div`,{className:`mt-4 pt-3 border-t border-[var(--color-line-0)]`,children:(0,U.jsx)(ri,{counters:{allow:i.allow,block:i.block,ask:i.ask,log:i.log,force:i.force,shadow:i.shadow}})}):null,(0,U.jsxs)(`div`,{className:`mt-4 pt-3 border-t border-[var(--color-line-0)]`,children:[(0,U.jsxs)(`div`,{className:`flex items-center justify-between mb-2`,children:[(0,U.jsx)(`span`,{className:`overline`,children:`live event stream · newest first`}),(0,U.jsxs)(`span`,{className:`text-[10px] font-mono text-[var(--color-fg-3)]`,children:[s.length,` buffered · hover to pause`]})]}),(0,U.jsx)(hi,{variant:`decision`,bursts:s,windowSize:300,height:260})]})]})}var ol={ok:`green`,warn:`amber`,error:`red`,unknown:`gray`},sl={ok:`OK`,warn:`Warn`,error:`Error`,unknown:`Idle`};function cl({title:e,status:t=`unknown`,statusLabel:n,className:r,children:i}){return(0,U.jsxs)(W,{className:H(`flex flex-col`,r),children:[(0,U.jsxs)(G,{children:[(0,U.jsx)(`span`,{className:`overline text-[var(--color-fg-2)]`,children:e}),(0,U.jsx)(q,{variant:ol[t],children:n??sl[t]})]}),(0,U.jsx)(K,{className:`flex flex-col gap-2 text-[12px]`,children:i})]})}function ll({label:e,value:t,mono:n=!1,tone:r}){return(0,U.jsxs)(`div`,{className:`flex items-baseline justify-between gap-3 border-b border-[var(--color-line-0)] last:border-b-0 py-1`,children:[(0,U.jsx)(`span`,{className:`text-[var(--color-fg-3)] uppercase tracking-wider text-[10px] font-mono`,children:e}),(0,U.jsx)(`span`,{className:H(n?`font-mono`:`font-sans`,`tabular-nums text-right truncate`,r===`good`?`text-emerald-300`:r===`warn`?`text-amber-300`:r===`bad`?`text-red-300`:`text-[var(--color-fg-1)]`),children:t})]})}function ul(e){return e===0?`0 B`:e<1024?`${e} B`:e<1024*1024?`${(e/1024).toFixed(1)} KB`:e<1024*1024*1024?`${(e/(1024*1024)).toFixed(2)} MB`:`${(e/(1024*1024*1024)).toFixed(2)} GB`}function dl(e){return e<1024?`${e}B`:e<1024*1024?`${(e/1024).toFixed(1)}KB`:`${(e/1024/1024).toFixed(1)}MB`}function fl(e){let t=Math.floor(e/1e3);if(t<60)return`${t}s`;let n=Math.floor(t/60);return n<60?`${n}m ${t%60}s`:`${Math.floor(n/60)}h ${n%60}m`}function pl(e){return e?new Date(e*1e3).toLocaleString():`—`}function ml(e){if(!e||e===0)return`never`;let t=Math.round((Date.now()-e)/1e3);if(t<5)return`just now`;if(t<60)return`${t}s ago`;let n=Math.floor(t/60);return n<60?`${n}m ago`:`${Math.floor(n/60)}h ago`}function hl({children:e,className:t}){return(0,U.jsx)(`div`,{className:`overline mb-2.5 ${t??``}`,children:e})}function gl({label:e,value:t,mono:n=!0,accent:r}){return(0,U.jsxs)(`div`,{className:`flex items-baseline justify-between gap-4 py-1.5 border-b border-[var(--color-line-0)] last:border-0`,children:[(0,U.jsx)(`span`,{className:`text-xs text-[var(--color-fg-3)] shrink-0 font-mono`,children:e}),(0,U.jsx)(`span`,{className:`text-xs text-right truncate max-w-[65%] ${n?`font-mono tabular-nums`:``} ${r??`text-[var(--color-fg-1)]`}`,children:t})]})}function _l({ok:e,label:t,badLabel:n}){return e?(0,U.jsx)(q,{variant:`green`,children:t}):(0,U.jsx)(q,{variant:`red`,children:n??t})}function vl({pct:e,total:t,max:n}){let r=e<60?`green`:e<85?`amber`:`red`,i=e>=85?`text-red-300`:e>=60?`text-amber-300`:`text-emerald-300`;return(0,U.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,U.jsxs)(`div`,{className:`flex items-center justify-between text-xs font-mono tabular-nums`,children:[(0,U.jsxs)(`span`,{className:`text-[var(--color-fg-3)]`,children:[t.toLocaleString(),` / `,n.toLocaleString(),` rows`]}),(0,U.jsxs)(`span`,{className:i,children:[e,`%`]})]}),(0,U.jsx)(ks,{pct:e,tone:r,className:`h-1.5`})]})}var yl=3e3,bl={log:`text-[var(--color-fg-1)]`,info:`text-sky-300`,warn:`text-amber-300`,error:`text-red-300`,debug:`text-[var(--color-fg-3)]`};function xl(e){return e.value==null?e.description?e.description:`[${e.type}]`:String(e.value)}function Sl(){let e=gc(),[t,n]=(0,_.useState)(!1),[r,i]=(0,_.useState)(null),[a,o]=(0,_.useState)([]),[s,c]=(0,_.useState)(null),[l,u]=(0,_.useState)(!1),[d,f]=(0,_.useState)(!1),p=(0,_.useRef)(null),m=(0,_.useRef)(0),h=(0,_.useRef)(!0);(0,_.useEffect)(()=>{if(h.current){h.current=!1;return}let e=p.current;if(!e)return;let t=e.parentElement;t&&(t.scrollTop=t.scrollHeight)},[a]),(0,_.useEffect)(()=>{if(e.connected)return e.sendCommand(`Runtime.enable`).catch(()=>{}),e.onEvent(`Runtime.consoleAPICalled`,e=>{let t=e;o(e=>{let n=[...e,{id:m.current++,type:t.type??`log`,args:t.args??[],timestamp:t.timestamp??Date.now()}];return n.length>500?n.slice(-500):n})})},[e.connected]),(0,_.useEffect)(()=>{e.preconfiguredTarget&&!e.connected&&!e.connecting&&e.connect(e.preconfiguredTarget.id)},[e]),(0,_.useEffect)(()=>{!e.connected||d||t||r||(f(!0),(async()=>{try{await e.sendCommand(`Profiler.enable`),await e.sendCommand(`Profiler.start`),n(!0),setTimeout(async()=>{try{let t=await e.sendCommand(`Profiler.stop`);n(!1),i(t.profile)}catch{n(!1)}},yl)}catch{}})(),e.sendCommand(`Runtime.evaluate`,{expression:`JSON.stringify(process.memoryUsage())`,returnByValue:!0}).then(e=>{c(JSON.parse(e.result.value))}).catch(()=>{}))},[e.connected,d,t,r]);let g=(0,_.useCallback)(async()=>{try{await e.sendCommand(`Profiler.enable`),await e.sendCommand(`Profiler.start`),n(!0),i(null)}catch(e){console.error(`Profiler.start failed:`,e)}},[e]),v=(0,_.useCallback)(async()=>{try{let t=await e.sendCommand(`Profiler.stop`);n(!1),i(t.profile)}catch(e){console.error(`Profiler.stop failed:`,e),n(!1)}},[e]),y=(0,_.useCallback)(async()=>{u(!0);try{let t=await e.sendCommand(`Runtime.evaluate`,{expression:`JSON.stringify(process.memoryUsage())`,returnByValue:!0});c(JSON.parse(t.result.value))}catch{}finally{u(!1)}},[e]),b=(0,_.useCallback)(()=>{e.preconfiguredTarget&&e.connect(e.preconfiguredTarget.id)},[e]);return e.active?e.connected?(0,U.jsxs)(`div`,{className:`space-y-5`,children:[(0,U.jsxs)(W,{children:[(0,U.jsxs)(G,{className:`flex items-center justify-between`,children:[(0,U.jsx)(`span`,{className:`overline`,children:`runtime inspector`}),(0,U.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,U.jsxs)(`span`,{className:`flex items-center gap-1.5 text-[11px] font-mono text-[var(--color-fg-2)]`,children:[(0,U.jsx)(`span`,{className:`inline-block w-1.5 h-1.5 rounded-full bg-emerald-400`}),`connected`,e.bunVersion?` · bun v${e.bunVersion}`:``]}),(0,U.jsx)(J,{variant:`ghost`,size:`sm`,onClick:e.disconnect,children:`disconnect`})]})]}),e.error&&(0,U.jsx)(K,{children:(0,U.jsx)(`p`,{className:`text-xs text-red-300 font-mono`,children:e.error})})]}),(0,U.jsxs)(W,{children:[(0,U.jsxs)(G,{className:`flex items-center justify-between`,children:[(0,U.jsx)(`span`,{className:`overline`,children:`cpu profiler`}),(0,U.jsxs)(`div`,{className:`flex items-center gap-2`,children:[t&&(0,U.jsxs)(`span`,{className:`text-[10px] font-mono uppercase tracking-wider text-red-300 flex items-center gap-1.5`,children:[(0,U.jsx)(`span`,{className:`inline-block w-1.5 h-1.5 rounded-full bg-red-400 pulse-soft`}),`recording`]}),t?(0,U.jsx)(J,{variant:`danger`,size:`sm`,onClick:v,children:`stop & render`}):(0,U.jsx)(J,{variant:`primary`,size:`sm`,onClick:g,children:`start recording`})]})]}),(0,U.jsx)(K,{children:r?(0,U.jsx)(js,{profile:r,children:(0,U.jsx)(`div`,{className:`bg-[var(--color-surface-0)] border border-[var(--color-line-1)] rounded-sm p-2 overflow-x-hidden`,children:(0,U.jsx)(Cc,{profile:r})})}):(0,U.jsx)(`p`,{className:`text-[11px] font-mono text-[var(--color-fg-3)]`,children:t?`recording cpu profile (auto-captures ${yl/1e3}s)… perform actions in ssg to generate data.`:`click start recording, or wait for auto-capture on page load.`})})]}),(0,U.jsxs)(W,{children:[(0,U.jsxs)(G,{className:`flex items-center justify-between`,children:[(0,U.jsx)(`span`,{className:`overline`,children:`memory`}),(0,U.jsx)(J,{variant:`ghost`,size:`sm`,onClick:y,disabled:l,children:l?`…`:`refresh`})]}),(0,U.jsx)(K,{children:s?(0,U.jsx)(Ms,{memory:s,formatValue:dl}):(0,U.jsx)(`p`,{className:`text-[11px] font-mono text-[var(--color-fg-3)]`,children:d?`fetching memory metrics…`:`click refresh to fetch process.memoryUsage().`})})]}),(0,U.jsxs)(W,{children:[(0,U.jsxs)(G,{className:`flex items-center justify-between`,children:[(0,U.jsx)(`span`,{className:`overline`,children:`console`}),(0,U.jsx)(J,{variant:`ghost`,size:`sm`,onClick:()=>o([]),children:`clear`})]}),(0,U.jsx)(K,{children:(0,U.jsxs)(`div`,{className:`bg-[var(--color-surface-0)] border border-[var(--color-line-1)] rounded-sm p-2 h-40 overflow-y-auto font-mono text-[11px]`,children:[a.length===0?(0,U.jsx)(`p`,{className:`text-[var(--color-fg-4)]`,children:`console output will appear here…`}):a.map(e=>(0,U.jsxs)(`div`,{className:`py-0.5 border-b border-[var(--color-line-0)] ${bl[e.type]??`text-[var(--color-fg-1)]`}`,children:[(0,U.jsxs)(`span`,{className:`text-[var(--color-fg-4)] mr-2 uppercase tracking-wider`,children:[`[`,e.type,`]`]}),e.args.map(xl).join(` `)]},e.id)),(0,U.jsx)(`div`,{ref:p})]})})]})]}):(0,U.jsxs)(W,{children:[(0,U.jsxs)(G,{className:`flex items-center justify-between`,children:[(0,U.jsx)(`span`,{className:`overline`,children:`runtime inspector`}),(0,U.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,U.jsx)(q,{variant:`amber`,children:e.connecting?`connecting…`:`available`}),!e.connecting&&(0,U.jsx)(J,{variant:`ghost`,size:`sm`,onClick:b,children:`connect`})]})]}),(0,U.jsx)(K,{children:(0,U.jsx)(`p`,{className:`text-[11px] font-mono text-[var(--color-fg-4)]`,children:e.connecting?`establishing websocket connection to bun inspector…`:`inspector is active but not connected. click connect to start profiling.`})})]}):(0,U.jsxs)(W,{children:[(0,U.jsxs)(G,{className:`flex items-center justify-between`,children:[(0,U.jsx)(`span`,{className:`overline`,children:`runtime inspector`}),(0,U.jsx)(q,{variant:`outline`,children:`inactive`})]}),(0,U.jsx)(K,{children:(0,U.jsxs)(`p`,{className:`text-[11px] font-mono text-[var(--color-fg-4)]`,children:[`the bun inspector is not active. restart`,` `,(0,U.jsx)(`code`,{className:`text-[var(--color-brand)]`,children:`ssg serve`}),` to enable it automatically.`]})})]})}function Cl(){let[e,t]=(0,_.useState)(0),{data:n}=R(`/api/json/evald-log`,[e]),r=(0,_.useRef)(null),i=(0,_.useRef)(!0);(0,_.useEffect)(()=>{let e=setInterval(()=>t(e=>e+1),5e3);return()=>clearInterval(e)},[]),(0,_.useEffect)(()=>{if(i.current){i.current=!1;return}let e=r.current;if(!e)return;let t=e.parentElement;t&&(t.scrollTop=t.scrollHeight)},[n?.lines.length]);let a=n?.lines??[];return(0,U.jsxs)(W,{children:[(0,U.jsxs)(G,{className:`flex items-center justify-between`,children:[(0,U.jsx)(`span`,{className:`overline`,children:`daemon log`}),(0,U.jsxs)(`span`,{className:`text-[10px] font-mono text-[var(--color-fg-4)] truncate max-w-[60%]`,children:[n?.path?n.path:`loading…`,` · last 200 lines · 5s refresh`]})]}),(0,U.jsxs)(K,{children:[n?.error&&(0,U.jsx)(`p`,{className:`text-xs text-red-300 font-mono mb-2`,children:n.error}),a.length===0&&!n?.error&&(0,U.jsx)(`div`,{className:`rounded-sm border border-dashed border-[var(--color-line-1)] bg-[var(--color-surface-0)] px-4 py-6 text-center`,children:(0,U.jsxs)(`p`,{className:`text-[11px] font-mono text-[var(--color-fg-4)]`,children:[`no log entries yet. start the daemon with`,` `,(0,U.jsx)(`code`,{className:`text-[var(--color-brand)]`,children:`ssg serve`}),` to generate log output.`]})}),a.length>0&&(0,U.jsxs)(`pre`,{className:`bg-[var(--color-surface-0)] border border-[var(--color-line-1)] rounded-sm p-3 text-[10px] text-[var(--color-fg-2)] overflow-x-auto whitespace-pre-wrap break-all max-h-80 overflow-y-auto font-mono leading-relaxed`,children:[a.join(`
|
|
19
|
-
`),(0,U.jsx)(`div`,{ref:r})]})]})]})}function wl(){let e=je([`runtime-tick`,`rules-changed`]),{data:t,refetch:n}=R(`/api/json/observability`,[e[`runtime-tick`],e[`rules-changed`]]),[r,i]=(0,_.useState)(!1),[a,o]=(0,_.useState)(!1),[s,c]=(0,_.useState)(Date.now()),[l,u]=(0,_.useState)(`idle`),[d,f]=(0,_.useState)(``),[p,m]=(0,_.useState)(`idle`);(0,_.useEffect)(()=>{t&&c(Date.now())},[t]);let h=(0,_.useCallback)(async()=>{u(`loading`);try{let e=await(await fetch(`/api/rules/sync-to-db`,{method:`POST`,headers:Ae()})).json();if(e.ok){u(`done`);let t=(e.pruned_count??0)>0?` (${e.pruned_count} orphan(s) pruned)`:``;f((e.message??`synced ${e.synced} rules`)+t),n()}else u(`error`),f(e.error??`sync failed`)}catch(e){u(`error`),f(String(e))}},[n]),g=(0,_.useCallback)(async()=>{m(`loading`);try{await fetch(`/api/rules/force-reload`,{method:`POST`,headers:Ae()}),m(`done`),n(),setTimeout(()=>m(`idle`),3e3)}catch{m(`idle`)}},[n]),v=t?.db,y=t?.rules,b=t?.audit,x=t?.process,S=t?.flight_recorder,C=y?.drift_detected??!1;return(0,U.jsxs)(`div`,{className:`space-y-5`,children:[(0,U.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,U.jsxs)(`div`,{children:[(0,U.jsx)(`h1`,{className:`text-xl font-medium tracking-tight text-[var(--color-fg-0)]`,children:`Observability`}),(0,U.jsx)(`p`,{className:`text-[12px] font-mono text-[var(--color-fg-3)] mt-0.5`,children:`sqlite health · rule drift · runtime profiler · diagnostics`})]}),(0,U.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,U.jsxs)(`span`,{className:`text-[10px] font-mono text-[var(--color-fg-4)] tabular-nums`,children:[`refreshed `,ml(s)]}),(0,U.jsx)(J,{variant:`ghost`,size:`sm`,onClick:n,children:`refresh`})]})]}),(0,U.jsx)(Tl,{db:v,audit:b,proc:x,flight:S,driftDetected:C}),(0,U.jsxs)(W,{className:C?`border-red-500/30 border-l-2 border-l-red-500/70`:`border-emerald-500/20 border-l-2 border-l-emerald-500/60`,children:[(0,U.jsxs)(G,{className:`flex items-center justify-between`,children:[(0,U.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,U.jsx)(`span`,{className:`overline`,children:`rule drift detector`}),(0,U.jsx)(`span`,{className:`text-[10px] font-mono text-[var(--color-fg-4)]`,children:`— .rules files vs sqlite`}),(0,U.jsx)(`button`,{onClick:()=>o(e=>!e),"aria-expanded":a,"aria-label":`Explain these counts`,title:`Why do these numbers differ?`,className:`text-[10px] font-mono text-[var(--color-fg-4)] hover:text-[var(--color-fg-2)] border border-[var(--color-line-1)] rounded-sm px-1.5 py-0.5 transition-colors cursor-pointer`,children:a?`× close`:`? why these numbers`})]}),y&&(C?(0,U.jsx)(q,{variant:`red`,children:`⚠ drift detected`}):(0,U.jsx)(q,{variant:`green`,children:`✓ in sync`}))]}),(0,U.jsxs)(K,{children:[a&&(0,U.jsxs)(`div`,{className:`mb-4 rounded-sm border border-[var(--color-line-1)] bg-[var(--color-surface-0)] px-3 py-2.5 space-y-2 text-[11px] font-mono leading-relaxed text-[var(--color-fg-3)]`,children:[(0,U.jsxs)(`div`,{className:`text-[var(--color-fg-2)]`,children:[(0,U.jsx)(`code`,{children:`.rules files`}),` and `,(0,U.jsx)(`code`,{children:`db rules`}),` are`,` `,(0,U.jsx)(`span`,{className:`text-amber-300`,children:`not auto-synced`}),`. A mismatch is usually expected:`]}),(0,U.jsxs)(`ul`,{className:`space-y-1 pl-3 list-disc marker:text-[var(--color-fg-4)]`,children:[(0,U.jsxs)(`li`,{children:[(0,U.jsx)(`span`,{className:`text-[var(--color-fg-2)]`,children:`one file can hold many rules`}),` `,`— compare `,(0,U.jsx)(`code`,{children:`db rules`}),` against`,` `,(0,U.jsx)(`code`,{children:`file_rule_count`}),`, not `,(0,U.jsx)(`code`,{children:`file_count`}),`.`]}),(0,U.jsxs)(`li`,{children:[(0,U.jsx)(`span`,{className:`text-[var(--color-fg-2)]`,children:`only in files`}),` `,`means unsynced edits — run`,` `,(0,U.jsx)(`code`,{className:`text-amber-300`,children:`ssg sync`}),` or click`,` `,(0,U.jsx)(`code`,{children:`↑ sync files → db`}),`.`]}),(0,U.jsxs)(`li`,{children:[(0,U.jsx)(`span`,{className:`text-[var(--color-fg-2)]`,children:`only in db`}),` `,`with `,(0,U.jsx)(`code`,{children:`source_file IS NULL`}),` is healthy — hub, fleet, or cloud-synced rules legitimately live only in the db.`]}),(0,U.jsxs)(`li`,{children:[(0,U.jsx)(`span`,{className:`text-[var(--color-fg-2)]`,children:`only in db`}),` `,`with `,(0,U.jsx)(`code`,{children:`source_file`}),` set means an orphan from a deleted file — `,(0,U.jsx)(`code`,{className:`text-amber-300`,children:`ssg sync`}),` `,`prunes it.`]}),(0,U.jsxs)(`li`,{children:[(0,U.jsx)(`span`,{className:`text-[var(--color-fg-2)]`,children:`db rules`}),` `,`includes disabled rows; `,(0,U.jsx)(`code`,{children:`db_enabled_count`}),` `,`excludes them.`]})]}),(0,U.jsxs)(`div`,{className:`pt-1.5 border-t border-[var(--color-line-0)]`,children:[`full reference:`,` `,(0,U.jsx)(`a`,{href:`https://docs.sigmashake.com/rule-storage`,target:`_blank`,rel:`noopener noreferrer`,className:`text-[var(--color-fg-2)] underline decoration-dotted underline-offset-2 hover:text-amber-300 transition-colors`,children:`docs.sigmashake.com/rule-storage ↗`})]})]}),y?(0,U.jsxs)(`div`,{className:`space-y-4`,children:[(0,U.jsx)(`div`,{className:`grid grid-cols-2 sm:grid-cols-4 gap-2`,children:[{label:`.rules files`,value:y.file_count,sub:`${y.file_rule_count} rules total`,tone:`neutral`},{label:`db rules`,value:y.db_rule_count,sub:`${y.db_enabled_count} enabled`,tone:`neutral`},{label:`only in files`,value:y.drift_details.only_in_files.length,tone:y.drift_details.only_in_files.length>0?`amber`:`gray`},{label:`only in db`,value:y.drift_details.only_in_db.length,tone:y.drift_details.only_in_db.length>0?`red`:`gray`}].map(({label:e,value:t,sub:n,tone:r})=>(0,U.jsx)(Os,{className:`rounded-sm border border-[var(--color-line-1)] bg-[var(--color-surface-0)]`,label:e,value:t,sub:n,tone:r,labelPlacement:`above`,subClassName:`text-[var(--color-fg-4)]`,valueClassName:`text-xl font-medium tabular-nums`},e))}),C&&(0,U.jsxs)(`div`,{children:[(0,U.jsxs)(`button`,{onClick:()=>i(e=>!e),className:`text-[10px] font-mono uppercase tracking-wider text-amber-300 hover:text-amber-200 flex items-center gap-1 transition-colors cursor-pointer`,children:[r?`▾`:`▸`,` view drift details`]}),r&&(0,U.jsxs)(`div`,{className:`mt-3 space-y-3`,children:[y.drift_details.only_in_files.length>0&&(0,U.jsxs)(`div`,{children:[(0,U.jsxs)(`div`,{className:`text-[10px] font-mono uppercase tracking-wider text-amber-300/80 mb-1.5`,children:[`in .rules files but not in db — run`,` `,(0,U.jsx)(`code`,{className:`text-amber-300`,children:`ssg sync`})]}),(0,U.jsx)(`div`,{className:`bg-[var(--color-surface-0)] border border-amber-400/20 rounded-sm p-2 space-y-0.5 max-h-40 overflow-y-auto`,children:y.drift_details.only_in_files.map(e=>(0,U.jsxs)(`div`,{className:`font-mono text-[11px] text-amber-200/80`,children:[`+ `,e]},e))})]}),y.drift_details.only_in_db.length>0&&(0,U.jsxs)(`div`,{children:[(0,U.jsx)(`div`,{className:`text-[10px] font-mono uppercase tracking-wider text-red-300/80 mb-1.5`,children:`in db but not in any .rules file — orphaned rules`}),(0,U.jsx)(`div`,{className:`bg-[var(--color-surface-0)] border border-red-400/20 rounded-sm p-2 space-y-0.5 max-h-40 overflow-y-auto`,children:y.drift_details.only_in_db.map(e=>(0,U.jsxs)(`div`,{className:`font-mono text-[11px] text-red-200/80`,children:[`− `,e]},e))})]})]})]}),(0,U.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2 pt-3 border-t border-[var(--color-line-0)]`,children:[(0,U.jsx)(J,{variant:`primary`,size:`sm`,onClick:h,disabled:l===`loading`,children:l===`loading`?`syncing…`:`↑ sync files → db`}),(0,U.jsx)(J,{variant:`ghost`,size:`sm`,onClick:g,disabled:p===`loading`,children:p===`loading`?`…`:p===`done`?`✓ reloaded`:`↻ force reload`}),(0,U.jsx)(`span`,{className:`text-[10px] font-mono text-[var(--color-fg-4)] ml-auto`,children:y.db_rule_count===0?`⚠ db empty — daemon falls back to file-based loading`:`db has ${y.db_rule_count} rules — indexed queries`})]}),l===`done`&&(0,U.jsxs)(`div`,{className:`flex items-center justify-between rounded-sm border border-emerald-500/25 bg-emerald-500/[0.06] px-3 py-2 text-xs font-mono text-emerald-200`,children:[(0,U.jsxs)(`span`,{children:[`✓ `,d]}),(0,U.jsx)(`button`,{onClick:()=>u(`idle`),className:`ml-3 shrink-0 px-2 py-0.5 rounded-sm border border-emerald-500/30 hover:bg-emerald-500/10 transition-colors cursor-pointer uppercase tracking-wider text-[10px]`,children:`dismiss`})]}),l===`error`&&(0,U.jsxs)(`div`,{className:`flex items-center justify-between rounded-sm border border-red-500/25 bg-red-500/[0.06] px-3 py-2 text-xs font-mono text-red-200`,children:[(0,U.jsxs)(`span`,{children:[`✗ `,d]}),(0,U.jsx)(`button`,{onClick:()=>u(`idle`),className:`ml-3 shrink-0 px-2 py-0.5 rounded-sm border border-red-500/30 hover:bg-red-500/10 transition-colors cursor-pointer uppercase tracking-wider text-[10px]`,children:`dismiss`})]}),(0,U.jsxs)(`div`,{className:`flex items-center gap-4 text-[11px] font-mono text-[var(--color-fg-4)] pt-2 border-t border-[var(--color-line-0)]`,children:[(0,U.jsxs)(`span`,{children:[`rules dir:`,` `,(0,U.jsx)(`span`,{className:`text-[var(--color-fg-2)]`,children:y.rules_dir})]}),(0,U.jsxs)(`span`,{className:`ml-auto`,children:[`last reload:`,` `,(0,U.jsx)(`span`,{className:`text-[var(--color-fg-2)]`,children:ml(y.last_reload_at)})]})]})]}):(0,U.jsx)(`p`,{className:`text-[11px] font-mono text-[var(--color-fg-4)]`,children:`loading…`})]})]}),(0,U.jsxs)(`div`,{className:`grid grid-cols-1 lg:grid-cols-2 gap-5`,children:[(0,U.jsxs)(W,{children:[(0,U.jsxs)(G,{className:`flex items-center justify-between`,children:[(0,U.jsx)(`span`,{className:`overline`,children:`sqlite database`}),v&&!v.error&&(0,U.jsxs)(`div`,{className:`flex items-center gap-1.5`,children:[(0,U.jsx)(_l,{ok:v.journal_mode===`wal`,label:`wal`,badLabel:`no wal`}),(0,U.jsx)(_l,{ok:v.synchronous===`NORMAL`,label:`normal`,badLabel:v.synchronous})]})]}),(0,U.jsx)(K,{children:v?v.error?(0,U.jsx)(`div`,{className:`text-xs text-red-300 font-mono bg-red-500/[0.06] border border-red-500/25 rounded-sm p-2`,children:v.error}):(0,U.jsxs)(`div`,{children:[(0,U.jsx)(hl,{children:`storage`}),(0,U.jsx)(gl,{label:`file path`,value:v.path}),(0,U.jsx)(gl,{label:`file size`,value:ul(v.file_size_bytes)}),(0,U.jsx)(gl,{label:`allocated`,value:`${ul(v.allocated_bytes)} (${v.page_count.toLocaleString()} pages × ${v.page_size}B)`}),(0,U.jsx)(hl,{className:`mt-4`,children:`pragma configuration`}),(0,U.jsx)(gl,{label:`journal_mode`,value:v.journal_mode,accent:v.journal_mode===`wal`?`text-emerald-300`:`text-amber-300`}),(0,U.jsx)(gl,{label:`synchronous`,value:v.synchronous,accent:v.synchronous===`NORMAL`?`text-emerald-300`:`text-amber-300`}),(0,U.jsx)(gl,{label:`cache_size`,value:`${v.cache_size_kb.toLocaleString()} KB (${Math.round(v.cache_size_kb/1024)} MB)`}),(0,U.jsx)(gl,{label:`page_size`,value:`${v.page_size.toLocaleString()} B`}),v.wal_checkpoint&&(0,U.jsx)(gl,{label:`wal checkpoint`,value:`log ${v.wal_checkpoint.log}, checkpointed ${v.wal_checkpoint.checkpointed}, busy ${v.wal_checkpoint.busy}`}),(0,U.jsx)(hl,{className:`mt-4`,children:`table row counts`}),v.tables.map(e=>(0,U.jsx)(gl,{label:e.name,value:e.row_count>=0?e.row_count.toLocaleString():`error`,accent:e.row_count<0?`text-red-300`:`text-[var(--color-fg-1)]`},e.name))]}):(0,U.jsx)(`p`,{className:`text-[11px] font-mono text-[var(--color-fg-4)]`,children:`loading…`})})]}),(0,U.jsxs)(`div`,{className:`space-y-5`,children:[(0,U.jsxs)(W,{children:[(0,U.jsx)(G,{children:(0,U.jsx)(`span`,{className:`overline`,children:`audit log capacity`})}),(0,U.jsx)(K,{children:b?(0,U.jsxs)(`div`,{className:`space-y-4`,children:[(0,U.jsx)(vl,{pct:b.utilization_pct,total:b.total_rows,max:b.max_rows}),(0,U.jsxs)(`div`,{children:[(0,U.jsx)(gl,{label:`total rows`,value:b.total_rows.toLocaleString()}),(0,U.jsx)(gl,{label:`rotation limit`,value:b.max_rows.toLocaleString()}),(0,U.jsx)(gl,{label:`utilization`,value:`${b.utilization_pct}%`,accent:b.utilization_pct>=85?`text-red-300`:b.utilization_pct>=60?`text-amber-300`:`text-emerald-300`}),(0,U.jsx)(gl,{label:`oldest entry`,value:pl(b.oldest_timestamp)}),(0,U.jsx)(gl,{label:`newest entry`,value:pl(b.newest_timestamp)})]}),b.utilization_pct>=85&&(0,U.jsx)(`div`,{className:`rounded-sm border border-red-500/25 bg-red-500/[0.06] px-3 py-2 text-[11px] font-mono text-red-200`,children:`⚠ audit log nearing rotation limit. oldest entries will be purged automatically.`})]}):(0,U.jsx)(`p`,{className:`text-[11px] font-mono text-[var(--color-fg-4)]`,children:`loading…`})})]}),(0,U.jsxs)(W,{children:[(0,U.jsx)(G,{children:(0,U.jsx)(`span`,{className:`overline`,children:`process & runtime`})}),(0,U.jsx)(K,{children:x?(0,U.jsxs)(`div`,{children:[(0,U.jsx)(gl,{label:`pid`,value:x.pid}),(0,U.jsx)(gl,{label:`uptime`,value:fl(x.uptime_ms)}),(0,U.jsx)(gl,{label:`memory (rss)`,value:`${x.memory_rss_mb} MB`}),(0,U.jsx)(gl,{label:`bun version`,value:x.bun_version}),(0,U.jsx)(gl,{label:`node compat`,value:x.node_version}),(0,U.jsx)(gl,{label:`platform`,value:`${x.platform} / ${x.arch}`})]}):(0,U.jsx)(`p`,{className:`text-[11px] font-mono text-[var(--color-fg-4)]`,children:`loading…`})})]})]})]}),(0,U.jsxs)(W,{children:[(0,U.jsx)(G,{children:(0,U.jsx)(`span`,{className:`overline`,children:`flight recorder`})}),(0,U.jsx)(K,{children:S?(0,U.jsxs)(`div`,{className:`grid grid-cols-3 gap-4`,children:[(0,U.jsxs)(`div`,{children:[(0,U.jsx)(`div`,{className:`overline mb-1.5`,children:`log file`}),(0,U.jsx)(`div`,{className:`text-xs font-mono text-[var(--color-fg-1)] truncate`,children:`…${S.path.slice(-50)}`})]}),(0,U.jsxs)(`div`,{children:[(0,U.jsx)(`div`,{className:`overline mb-1.5`,children:`file size`}),(0,U.jsx)(`div`,{className:`text-xs font-mono tabular-nums ${S.file_size_bytes===0?`text-[var(--color-fg-4)]`:`text-[var(--color-fg-1)]`}`,children:ul(S.file_size_bytes)})]}),(0,U.jsxs)(`div`,{children:[(0,U.jsx)(`div`,{className:`overline mb-1.5`,children:`approx. entries`}),(0,U.jsx)(`div`,{className:`text-xs font-mono tabular-nums ${S.approx_entries===0?`text-[var(--color-fg-4)]`:`text-[var(--color-fg-1)]`}`,children:S.approx_entries===0?`—`:S.approx_entries.toLocaleString()})]})]}):(0,U.jsx)(`p`,{className:`text-[11px] font-mono text-[var(--color-fg-4)]`,children:`loading…`})})]}),(0,U.jsx)(Sl,{}),(0,U.jsx)(Cl,{}),(0,U.jsxs)(W,{children:[(0,U.jsx)(G,{children:(0,U.jsx)(`span`,{className:`overline`,children:`observability api`})}),(0,U.jsxs)(K,{children:[(0,U.jsx)(`p`,{className:`text-[11px] font-mono text-[var(--color-fg-3)] mb-2.5`,children:`machine-readable endpoints for automated monitoring and ai agent triage:`}),(0,U.jsx)(`div`,{className:`space-y-1 font-mono text-[11px]`,children:[[`/api/json/observability`,`sqlite health, rule drift, process info`],[`/api/state/runtime`,`eval latency, decision counters, memory`],[`/api/state/activity-tail?after=0&limit=20`,`recent eval events (live feed)`],[`/api/json/daemon-status`,`daemon pid, status, log tail`],[`/api/json/evald-log`,`last 200 lines of evald.log (daemon stderr)`],[`/healthz`,`process liveness`],[`/readyz`,`sqlite liveness`]].map(([e,t])=>(0,U.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,U.jsx)(`span`,{className:`text-[var(--color-fg-4)]`,children:`GET`}),(0,U.jsx)(`a`,{href:e,target:`_blank`,rel:`noreferrer`,className:`text-[var(--color-brand)]/80 hover:text-[var(--color-brand)] transition-colors`,children:e}),(0,U.jsxs)(`span`,{className:`text-[var(--color-fg-4)] hidden sm:inline`,children:[`— `,t]})]},e))})]})]})]})}function Tl({db:e,audit:t,proc:n,flight:r,driftDetected:i}){let a=e?e.error?`error`:e.journal_mode===`wal`&&e.synchronous===`NORMAL`?`ok`:`warn`:`unknown`,o=t?t.utilization_pct>=85?`error`:t.utilization_pct>=60?`warn`:`ok`:`unknown`,s=n?n.memory_rss_mb>600?`warn`:`ok`:`unknown`;return(0,U.jsxs)(`div`,{className:`grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-4 gap-4`,children:[(0,U.jsxs)(cl,{title:`sqlite`,status:a,statusLabel:e?.journal_mode?.toUpperCase()??`idle`,children:[(0,U.jsx)(ll,{label:`size`,value:e?(0,U.jsx)(vr,{value:e.file_size_bytes,format:e=>dl(e)}):`—`,mono:!0}),(0,U.jsx)(ll,{label:`journal`,value:e?.journal_mode??`—`,mono:!0}),(0,U.jsx)(ll,{label:`sync`,value:e?.synchronous??`—`,mono:!0}),(0,U.jsx)(ll,{label:`tables`,value:e?.tables.length??0,tone:i?`warn`:`neutral`})]}),(0,U.jsxs)(cl,{title:`audit log`,status:o,statusLabel:t?`${t.utilization_pct}%`:`idle`,children:[(0,U.jsx)(ll,{label:`rows`,value:t?(0,U.jsx)(vr,{value:t.total_rows}):`—`}),(0,U.jsx)(ll,{label:`capacity`,value:t?`${(t.total_rows/Math.max(1,t.max_rows)*100).toFixed(1)}%`:`—`,tone:t&&t.utilization_pct>=85?`bad`:t&&t.utilization_pct>=60?`warn`:`good`}),(0,U.jsx)(ll,{label:`oldest`,value:pl(t?.oldest_timestamp??null),mono:!0}),(0,U.jsx)(ll,{label:`newest`,value:pl(t?.newest_timestamp??null),mono:!0})]}),(0,U.jsxs)(cl,{title:`process`,status:s,statusLabel:n?`pid ${n.pid}`:`idle`,children:[(0,U.jsx)(ll,{label:`uptime`,value:n?fl(n.uptime_ms):`—`,mono:!0}),(0,U.jsx)(ll,{label:`rss`,value:n?(0,U.jsxs)(`span`,{children:[(0,U.jsx)(vr,{value:n.memory_rss_mb,format:e=>e.toFixed(0)}),(0,U.jsx)(`span`,{className:`text-[var(--color-fg-3)] ml-1`,children:`MB`})]}):`—`}),(0,U.jsx)(ll,{label:`bun`,value:n?.bun_version??`—`,mono:!0}),(0,U.jsx)(ll,{label:`platform`,value:n?`${n.platform}/${n.arch}`:`—`,mono:!0})]}),(0,U.jsxs)(cl,{title:`flight recorder`,status:r&&r.file_size_bytes>0?`ok`:`unknown`,statusLabel:r?`${r.approx_entries.toLocaleString()} entries`:`idle`,children:[(0,U.jsx)(ll,{label:`size`,value:r?(0,U.jsx)(vr,{value:r.file_size_bytes,format:e=>dl(e)}):`—`,mono:!0}),(0,U.jsx)(ll,{label:`entries`,value:r?(0,U.jsx)(vr,{value:r.approx_entries}):`—`})]})]})}function El(e){let{sessionKey:t,bursts:n,paused:r,selectedId:i,onSelect:a,burstSeq:o,layout:s,isStale:c,isFadingOut:l,minHeight:u,pinned:d,minimized:f,isFullscreen:p,broadcast:m=!1,onTogglePin:h,onToggleMinimize:g,onToggleFullscreen:v,onFrameTime:y}=e,b=t.indexOf(`:`),x=b>=0?t.slice(0,b):t,S=b>=0?t.slice(b+1):``,C=(0,_.useRef)(null),[w,T]=(0,_.useState)(!0),E=()=>{let e=C.current;if(!e)return;let n=e.querySelector(`canvas`);n instanceof HTMLCanvasElement&&n.toBlob(e=>{if(!e)return;let n=URL.createObjectURL(e),r=document.createElement(`a`),i=t.replace(/[^a-z0-9._-]+/gi,`-`);r.href=n,r.download=`ssg-graph-${i}-${Date.now()}.png`,document.body.appendChild(r),r.click(),r.remove(),URL.revokeObjectURL(n)},`image/png`)};(0,_.useEffect)(()=>{if(p){T(!0);return}let e=C.current;if(!e)return;let t=new IntersectionObserver(e=>{for(let t of e)T(t.isIntersecting)},{threshold:.01});return t.observe(e),()=>t.disconnect()},[p]);let D=n.length>0?n[n.length-1]:null,O=D?za[D.decision]??`#6b7280`:`#6b7280`,k=D?.decision??null,A=D?.tool??null,j=r||!w||f;return(0,U.jsxs)(`div`,{ref:C,className:`flex flex-col shrink-0 rounded-sm border border-[var(--color-line-1)] bg-[var(--color-surface-1)] overflow-hidden transition-opacity duration-1000${p?` flex-1 min-h-0`:``}`,style:{minHeight:f||p?void 0:u,opacity:l?0:1},children:[!m&&(0,U.jsxs)(`header`,{className:`flex items-center justify-between px-3 py-1.5 border-b border-[var(--color-line-1)] bg-black/30 shrink-0 gap-3`,children:[(0,U.jsxs)(`div`,{className:`flex items-center gap-2 text-[11px] font-mono min-w-0`,children:[d&&(0,U.jsx)(`span`,{className:`text-amber-300`,title:`Pinned`,children:`▲`}),(0,U.jsx)(`span`,{className:`text-[var(--color-fg-2)] uppercase tracking-wider`,children:x}),S&&(0,U.jsxs)(U.Fragment,{children:[(0,U.jsx)(`span`,{className:`text-[var(--color-fg-4)]`,children:`·`}),(0,U.jsx)(`span`,{className:`text-[var(--color-fg-3)] truncate`,children:S})]})]}),(0,U.jsxs)(`div`,{className:`flex items-center gap-2 text-[11px] font-mono text-[var(--color-fg-4)]`,children:[A&&(0,U.jsxs)(`span`,{className:`flex items-center gap-1.5 max-w-[180px]`,title:k?`latest: ${A} → ${k}`:`latest: ${A}`,children:[(0,U.jsx)(`span`,{className:`w-1.5 h-1.5 rounded-full shrink-0`,style:{background:O}}),(0,U.jsx)(`span`,{className:`truncate text-[var(--color-fg-2)]`,children:A})]}),(0,U.jsxs)(`span`,{className:`hidden sm:inline`,children:[n.length,`n`]}),c?(0,U.jsxs)(`span`,{className:`flex items-center gap-1.5 text-amber-300`,children:[(0,U.jsx)(`span`,{className:`status-dot bg-amber-400`}),`idle`]}):(0,U.jsxs)(`span`,{className:`flex items-center gap-1.5 text-emerald-300`,children:[(0,U.jsx)(`span`,{className:`status-dot bg-emerald-400 pulse-soft`}),`live`]}),(0,U.jsxs)(`div`,{className:`flex items-center gap-1 ml-1`,children:[(0,U.jsx)(`button`,{type:`button`,onClick:h,className:`px-1.5 py-0.5 rounded border text-[10px] uppercase tracking-wider transition-colors ${d?`border-amber-500/60 text-amber-300`:`border-[var(--color-line-1)] text-[var(--color-fg-3)] hover:text-amber-300 hover:border-amber-500/40`}`,title:d?`Unpin`:`Pin to top`,children:`pin`}),(0,U.jsx)(`button`,{type:`button`,onClick:g,className:`px-1.5 py-0.5 rounded border border-[var(--color-line-1)] text-[10px] text-[var(--color-fg-3)] hover:text-sky-300 hover:border-sky-500/40 transition-colors`,title:f?`Expand`:`Minimize`,children:f?`+`:`–`}),(0,U.jsx)(`button`,{type:`button`,onClick:E,className:`px-1.5 py-0.5 rounded border border-[var(--color-line-1)] text-[10px] text-[var(--color-fg-3)] hover:text-sky-300 hover:border-sky-500/40 transition-colors`,title:`Download PNG snapshot of this panel`,children:`▣`}),(0,U.jsx)(`button`,{type:`button`,onClick:v,className:`px-1.5 py-0.5 rounded border border-[var(--color-line-1)] text-[10px] text-[var(--color-fg-3)] hover:text-sky-300 hover:border-sky-500/40 transition-colors`,title:p?`Exit fullscreen`:`Fullscreen`,children:p?`×`:`⛶`})]})]})]}),!f&&(0,U.jsx)(`div`,{className:`flex-1 min-h-0 relative`,children:(0,U.jsx)(Wo,{bursts:n,paused:j,selectedId:i,onSelect:a,burstSeq:o,layout:s,compact:!0,onFrameTime:y})})]})}function Dl(e){let{playback:t,bursts:n,rangeStart:r,rangeEnd:i,loading:a,onPlayhead:o,onLive:s,onPause:c,onResume:l,on24h:u}=e,d=(0,_.useRef)(null),f=(0,_.useRef)(!1),p=Math.max(1,i-r),m=(t.playhead_ms-r)/p*100,h=Math.max(0,Math.min(100,m)),g=(0,_.useMemo)(()=>{let e=[];for(let t=0;t<200;t++)e.push({allow:0,block:0,ask:0,other:0});for(let t of n){let n=t.ts_ms;if(n<r||n>i)continue;let a=e[Math.floor((n-r)/p*199)];t.decision===`allow`?a.allow++:t.decision===`block`||t.decision===`force`?a.block++:t.decision===`ask`?a.ask++:a.other++}return e},[n,r,i,p]),v=(0,_.useCallback)(e=>{let t=d.current;if(!t)return;let n=t.getBoundingClientRect();o(r+Math.max(0,Math.min(1,(e-n.left)/n.width))*p)},[r,p,o]);(0,_.useEffect)(()=>{let e=e=>{f.current&&v(e.clientX)},t=()=>{f.current=!1};return window.addEventListener(`pointermove`,e),window.addEventListener(`pointerup`,t),()=>{window.removeEventListener(`pointermove`,e),window.removeEventListener(`pointerup`,t)}},[v]);let y=t.mode===`live`;return(0,U.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,U.jsxs)(`div`,{className:`flex items-center gap-2 text-[11px] font-mono uppercase tracking-wider`,children:[(0,U.jsx)(`button`,{onClick:()=>y?c():l(),className:`px-2.5 py-1 rounded-sm border transition-colors cursor-pointer ${y?`border-emerald-500/40 text-emerald-300 hover:bg-emerald-500/10`:`border-amber-500/40 text-amber-300 hover:bg-amber-500/10`}`,title:y?`Pause the live stream`:`Resume updates at this playhead`,children:y?`⏸ pause`:`▶ resume`}),(0,U.jsx)(`button`,{onClick:s,disabled:y,className:`px-2.5 py-1 rounded-sm border transition-colors cursor-pointer ${y?`border-[var(--color-line-1)] text-[var(--color-fg-4)] opacity-50`:`border-sky-500/40 text-sky-300 hover:bg-sky-500/10`}`,title:`Jump to live (now)`,children:`⏭ live`}),(0,U.jsx)(`button`,{onClick:u,className:`px-2.5 py-1 rounded-sm border border-violet-500/40 text-violet-300 hover:bg-violet-500/10 transition-colors cursor-pointer`,title:`Expand to last 24h — window covers now−24h through now. Backfills audit_log so the scrubber shows all recent evals.`,children:`◉ 24h`}),(0,U.jsx)(`div`,{className:`flex-1`}),(0,U.jsx)(`span`,{className:`text-[var(--color-fg-4)]`,children:`mode`}),(0,U.jsx)(`span`,{className:y?`text-emerald-300`:t.mode===`paused`?`text-amber-300`:`text-violet-300`,children:t.mode}),a&&(0,U.jsx)(`span`,{className:`text-[var(--color-fg-4)] animate-pulse`,children:`· backfilling`}),(0,U.jsxs)(`span`,{className:`text-[var(--color-fg-4)]`,children:[`· t=`,Ol(t.playhead_ms)]})]}),(0,U.jsxs)(`div`,{ref:d,className:`relative h-10 w-full rounded-sm border border-[var(--color-line-1)] bg-[var(--color-surface-1)] cursor-pointer overflow-hidden select-none`,onPointerDown:e=>{f.current=!0,e.target.setPointerCapture?.(e.pointerId),v(e.clientX)},children:[(0,U.jsx)(`svg`,{viewBox:`0 0 200 40`,preserveAspectRatio:`none`,className:`absolute inset-0 w-full h-full`,"aria-hidden":!0,children:g.map((e,t)=>{let n=e.allow+e.block+e.ask+e.other;if(n===0)return null;let r=Math.min(32,n*3),i=e.block>0?za.block:e.ask>0?za.ask:za.allow;return(0,U.jsx)(`rect`,{x:t,y:40-r,width:.9,height:r,fill:i,opacity:.7},t)})}),(0,U.jsx)(`div`,{className:`absolute top-0 bottom-0 w-px bg-sky-300 pointer-events-none`,style:{left:`${h}%`},children:(0,U.jsx)(`div`,{className:`absolute -top-0.5 -translate-x-1/2 w-2 h-2 rotate-45 bg-sky-300`})}),y&&(0,U.jsx)(`div`,{className:`absolute top-0 right-0 bottom-0 w-[2px] bg-emerald-400 animate-pulse pointer-events-none`})]}),(0,U.jsxs)(`div`,{className:`flex items-center justify-between text-[10px] font-mono text-[var(--color-fg-4)]`,children:[(0,U.jsx)(`span`,{children:kl(r)}),(0,U.jsxs)(`span`,{className:`uppercase tracking-wider`,children:[Al(t.window_ms),` window`]}),(0,U.jsx)(`span`,{children:kl(i)})]})]})}function Ol(e){let t=Date.now()-e;if(Math.abs(t)<1500)return`live`;let n=Math.round(t/1e3);if(n<60)return`−${n}s`;let r=Math.floor(n/60);return r<60?`−${r}m${n%60}s`:`−${Math.floor(r/60)}h${r%60}m`}function kl(e){return new Date(e).toLocaleTimeString([],{hour:`2-digit`,minute:`2-digit`,second:`2-digit`})}function Al(e){return e<6e4?`${Math.round(e/1e3)}s`:e<36e5?`${Math.round(e/6e4)}m`:`${Math.round(e/36e5)}h`}function jl(e){let{burst:t,onClose:n}=e;if(!t)return(0,U.jsxs)(`div`,{className:`flex flex-col items-center justify-center py-10 text-center`,children:[(0,U.jsx)(`p`,{className:`overline mb-2 text-[var(--color-fg-3)]`,children:`node · none`}),(0,U.jsx)(`p`,{className:`text-[11px] font-mono text-[var(--color-fg-4)]`,children:`click a node to inspect`})]});let r=za[t.decision]??`#6b7280`,i=t.duration_ns/1e6,a=Date.now()-t.ts_ms;return(0,U.jsxs)(`div`,{className:`flex flex-col gap-3 text-[12px] font-mono`,children:[(0,U.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,U.jsx)(`span`,{className:`overline text-[var(--color-fg-3)]`,children:`node · inspect`}),(0,U.jsx)(`button`,{onClick:n,className:`text-[var(--color-fg-4)] hover:text-[var(--color-fg-1)] cursor-pointer`,title:`Close inspector`,children:`✕`})]}),(0,U.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,U.jsx)(`span`,{className:`w-2 h-2 rounded-full`,style:{background:r},"aria-hidden":!0}),(0,U.jsx)(`span`,{className:`uppercase tracking-wider`,style:{color:r},children:t.decision}),(0,U.jsx)(`span`,{className:`text-[var(--color-fg-4)]`,children:`·`}),(0,U.jsx)(`span`,{className:`text-[var(--color-fg-1)]`,children:t.tool})]}),(0,U.jsxs)(`dl`,{className:`grid grid-cols-[auto_1fr] gap-x-3 gap-y-1 text-[11px]`,children:[(0,U.jsx)(`dt`,{className:`text-[var(--color-fg-4)]`,children:`rule`}),(0,U.jsx)(`dd`,{className:`text-[var(--color-fg-2)] break-all`,children:t.rule_id??`—`}),(0,U.jsx)(`dt`,{className:`text-[var(--color-fg-4)]`,children:`client`}),(0,U.jsx)(`dd`,{className:`text-[var(--color-fg-2)]`,children:t.client}),(0,U.jsx)(`dt`,{className:`text-[var(--color-fg-4)]`,children:`agent`}),(0,U.jsx)(`dd`,{className:`text-[var(--color-fg-2)]`,children:t.agent_id?(0,U.jsx)(`span`,{className:`chip text-violet-300 border-violet-500/30`,children:t.agent_id}):(0,U.jsx)(`span`,{className:`text-[var(--color-fg-4)]`,children:`—`})}),(0,U.jsx)(`dt`,{className:`text-[var(--color-fg-4)]`,children:`duration`}),(0,U.jsx)(`dd`,{className:`text-[var(--color-fg-2)]`,children:i<1?`${(i*1e3).toFixed(0)}µs`:`${i.toFixed(2)}ms`}),(0,U.jsx)(`dt`,{className:`text-[var(--color-fg-4)]`,children:`age`}),(0,U.jsx)(`dd`,{className:`text-[var(--color-fg-2)]`,children:Ml(a)}),(0,U.jsx)(`dt`,{className:`text-[var(--color-fg-4)]`,children:`timestamp`}),(0,U.jsx)(`dd`,{className:`text-[var(--color-fg-2)]`,children:new Date(t.ts_ms).toLocaleString()})]}),t.input_preview&&(0,U.jsxs)(`div`,{children:[(0,U.jsx)(`div`,{className:`overline text-[var(--color-fg-3)] mb-1`,children:`input`}),(0,U.jsx)(`pre`,{className:`bg-[var(--color-surface-0)] border border-[var(--color-line-0)] rounded-sm p-2 text-[10px] text-[var(--color-fg-2)] whitespace-pre-wrap break-all max-h-48 overflow-y-auto`,children:t.input_preview})]}),(0,U.jsxs)(`div`,{className:`flex flex-wrap gap-1`,children:[t.audit_id&&(0,U.jsx)(`a`,{href:`/audit?id=${encodeURIComponent(t.audit_id)}`,className:`chip text-[var(--color-fg-3)] border-[var(--color-line-1)] hover:text-[var(--color-fg-1)]`,title:`Open full audit record`,children:`audit ↗`}),t.rule_id&&(0,U.jsx)(`a`,{href:`/rules#${encodeURIComponent(t.rule_id)}`,className:`chip text-[var(--color-fg-3)] border-[var(--color-line-1)] hover:text-[var(--color-fg-1)]`,title:`Jump to rule`,children:`rule ↗`})]})]})}function Ml(e){if(e<1500)return`just now`;let t=Math.floor(e/1e3);if(t<60)return`${t}s ago`;let n=Math.floor(t/60);return n<60?`${n}m${t%60}s ago`:`${Math.floor(n/60)}h${n%60}m ago`}function Nl(e){let t=new Map;for(let n of e){let e=`${n.client}:${n.agent_id??`solo`}`,r=t.get(e);r?(r.count+=1,n.ts_ms>r.newest_ts_ms&&(r.newest_ts_ms=n.ts_ms)):t.set(e,{client:n.client,agent_id:n.agent_id??`solo`,count:1,newest_ts_ms:n.ts_ms})}return Array.from(t.values()).sort((e,t)=>t.newest_ts_ms===e.newest_ts_ms?t.count-e.count:t.newest_ts_ms-e.newest_ts_ms)}function Pl(e){let{bursts:t,allBursts:n}=e,r=n??t,{toolCounts:i,decisionCounts:a,ruleCounts:o,unmatchedCount:s}=(0,_.useMemo)(()=>{let e=new Map,n=new Map,r=new Map,i=0;for(let a of t)if(e.set(a.tool,(e.get(a.tool)??0)+1),n.set(a.decision,(n.get(a.decision)??0)+1),a.rule_id){let e=r.get(a.rule_id);e?(e.count+=1,e.decisions.add(a.decision)):r.set(a.rule_id,{count:1,decisions:new Set([a.decision])})}else i+=1;return{toolCounts:Array.from(e.entries()).sort((e,t)=>t[1]-e[1]),decisionCounts:Array.from(n.entries()),ruleCounts:Array.from(r.entries()).map(([e,t])=>({id:e,count:t.count,decisions:t.decisions})).sort((e,t)=>t.count-e.count),unmatchedCount:i}},[t]),c=(0,_.useMemo)(()=>Nl(r),[r]),l=i[0]?.[1]??0,u=c[0]?.count??0,d=o[0]?.count??0,f=e=>{for(let t of[`block`,`ask`,`force`,`log`,`allow`,`shadow`])if(e.has(t))return za[t];return`#6b7280`};return(0,U.jsxs)(`div`,{className:`flex flex-col gap-3 text-[11px] font-mono`,children:[(0,U.jsx)(`div`,{className:`rounded-sm border border-[var(--color-line-0)] bg-[var(--color-surface-0)] p-2 text-[10px] text-[var(--color-fg-3)] leading-relaxed`,children:`Each dot is one tool call by an AI agent. Color encodes the ssg rule decision; lines link calls from the same agent in time order.`}),(0,U.jsxs)(`div`,{children:[(0,U.jsxs)(`div`,{className:`overline text-[var(--color-fg-3)] mb-1`,children:[`rules · `,o.length,` matched`,s>0&&(0,U.jsxs)(`span`,{className:`ml-2 text-[var(--color-fg-4)] normal-case tracking-normal`,children:[s,` unmatched`]})]}),o.length===0?(0,U.jsx)(`p`,{className:`text-[var(--color-fg-4)]`,children:`no rules matched in window`}):(0,U.jsx)(`ul`,{className:`space-y-0.5`,children:o.slice(0,6).map(e=>{let t=d>0?e.count/d*100:0,n=f(e.decisions);return(0,U.jsxs)(`li`,{className:`grid grid-cols-[1fr_auto] items-center gap-2`,title:`${e.id} — decisions: ${Array.from(e.decisions).join(`, `)}`,children:[(0,U.jsxs)(`div`,{className:`flex items-center gap-2 min-w-0`,children:[(0,U.jsx)(`span`,{className:`w-2 h-2 rounded-full shrink-0`,style:{background:n},"aria-hidden":!0}),(0,U.jsx)(`a`,{href:`/rules#${encodeURIComponent(e.id)}`,className:`truncate text-[var(--color-fg-2)] hover:text-[var(--color-fg-1)]`,children:e.id}),(0,U.jsx)(`div`,{className:`flex-1 h-1 bg-[var(--color-surface-1)] rounded-sm overflow-hidden`,children:(0,U.jsx)(`div`,{className:`h-full`,style:{background:n,width:`${t}%`,opacity:.6}})})]}),(0,U.jsx)(`span`,{className:`tabular-nums text-[var(--color-fg-4)]`,children:e.count})]},e.id)})})]}),(0,U.jsxs)(`div`,{children:[(0,U.jsx)(`div`,{className:`overline text-[var(--color-fg-3)] mb-1`,children:`decisions`}),(0,U.jsx)(`div`,{className:`flex flex-wrap gap-x-3 gap-y-1`,children:[`allow`,`block`,`ask`,`log`,`force`,`shadow`].map(e=>{let t=a.find(([t])=>t===e)?.[1]??0;return(0,U.jsxs)(`div`,{className:`flex items-center gap-1.5`,children:[(0,U.jsx)(`span`,{className:`w-2 h-2 rounded-full shrink-0`,style:{background:za[e]},"aria-hidden":!0}),(0,U.jsx)(`span`,{className:`text-[var(--color-fg-2)] uppercase tracking-wider`,children:e}),(0,U.jsx)(`span`,{className:`text-[var(--color-fg-4)] tabular-nums`,children:t})]},e)})})]}),(0,U.jsxs)(`div`,{children:[(0,U.jsxs)(`div`,{className:`overline text-[var(--color-fg-3)] mb-1`,children:[`agents · `,c.length,` active`,n&&n!==t&&(0,U.jsx)(`span`,{className:`ml-2 text-[var(--color-fg-4)] normal-case tracking-normal`,children:`roster: today`})]}),c.length===0?(0,U.jsx)(`p`,{className:`text-[var(--color-fg-4)]`,children:`no agents in window`}):(0,U.jsx)(`ul`,{className:`space-y-0.5`,children:c.slice(0,8).map(e=>{let t=u>0?e.count/u*100:0,n=`${e.client}:${e.agent_id}`,r=Date.now()-e.newest_ts_ms,i=r<5e3;return(0,U.jsxs)(`li`,{className:`grid grid-cols-[1fr_auto] items-center gap-2`,title:`${n} — last eval ${Math.max(0,Math.round(r/1e3))}s ago`,children:[(0,U.jsxs)(`div`,{className:`flex items-center gap-2 min-w-0`,children:[i?(0,U.jsx)(`span`,{className:`status-dot bg-emerald-400 pulse-soft shrink-0`,"aria-hidden":!0}):(0,U.jsx)(`span`,{className:`w-1.5 h-1.5 rounded-full shrink-0 bg-[var(--color-fg-4)]/40`,"aria-hidden":!0}),(0,U.jsxs)(`span`,{className:`truncate text-[var(--color-fg-2)]`,children:[e.client,(0,U.jsxs)(`span`,{className:`text-[var(--color-fg-4)]`,children:[`:`,e.agent_id]})]}),(0,U.jsx)(`div`,{className:`flex-1 h-1 bg-[var(--color-surface-1)] rounded-sm overflow-hidden`,children:(0,U.jsx)(`div`,{className:`h-full bg-violet-400/60`,style:{width:`${t}%`}})})]}),(0,U.jsx)(`span`,{className:`tabular-nums text-[var(--color-fg-4)]`,children:e.count})]},n)})})]}),(0,U.jsxs)(`div`,{children:[(0,U.jsxs)(`div`,{className:`overline text-[var(--color-fg-3)] mb-1`,children:[`tools · `,t.length,` in window`]}),i.length===0?(0,U.jsx)(`p`,{className:`text-[var(--color-fg-4)]`,children:`no tool activity`}):(0,U.jsx)(`ul`,{className:`space-y-0.5`,children:i.slice(0,8).map(([e,t])=>{let n=l>0?t/l*100:0;return(0,U.jsxs)(`li`,{className:`grid grid-cols-[1fr_auto] items-center gap-2`,children:[(0,U.jsxs)(`div`,{className:`flex items-center gap-2 min-w-0`,children:[(0,U.jsx)(`span`,{className:`truncate text-[var(--color-fg-2)]`,children:e}),(0,U.jsx)(`div`,{className:`flex-1 h-1 bg-[var(--color-surface-1)] rounded-sm overflow-hidden`,children:(0,U.jsx)(`div`,{className:`h-full bg-sky-400/60`,style:{width:`${n}%`}})})]}),(0,U.jsx)(`span`,{className:`tabular-nums text-[var(--color-fg-4)]`,children:t})]},e)})})]})]})}var Fl=[100,500,1e3,5e3,1e4,1e5];function Z(e){return e>=1e5||e>=1e3?`${e/1e3|0}k`:String(e)}function Q(e){let t=Math.floor(e/100),n=Math.floor(t/600),r=Math.floor(t%600/10),i=t%10;return`${String(n).padStart(2,`0`)}:${String(r).padStart(2,`0`)}.${i}`}function Il(e){let t=Math.floor(e/100);return`${Math.floor(t/10)}.${t%10}s`}function Ll({className:e,onMilestone:t,onRecord:n}){let[r,i]=(0,_.useState)(0),[a,o]=(0,_.useState)(0),[s,c]=(0,_.useState)(0),[l,u]=(0,_.useState)(0),[d,f]=(0,_.useState)(0),[p,m]=(0,_.useState)(0),[h,g]=(0,_.useState)(0),[v,y]=(0,_.useState)(``),[b,x]=(0,_.useState)(!1),[S,C]=(0,_.useState)(!1),w=De(),T=ke(),E=Oe(),D=(0,_.useRef)(null),O=(0,_.useRef)(0),k=(0,_.useRef)(0),A=(0,_.useRef)(0),j=(0,_.useRef)(0),M=(0,_.useRef)(new Set);(0,_.useEffect)(()=>{if(pt()){let e=performance.now(),t=e,n=setInterval(()=>{let n=performance.now();i(n-e),o(n-t)},1e3);return te.current=()=>{t=performance.now()},()=>{clearInterval(n),te.current=null}}performance.now();let e=lt({onUpdate:e=>i(e.currentTime)}),t=lt({onUpdate:e=>o(e.currentTime)});return ee.current=()=>{performance.now(),t.seek(0)},()=>{e.cancel(),t.cancel(),ee.current=null}},[]);let ee=(0,_.useRef)(null),te=(0,_.useRef)(null);return(0,_.useEffect)(()=>{if(D.current===null){D.current=T,O.current=T;return}if(T<=O.current)return;let e=T-O.current;O.current=T,f(n=>{let r=n+e,i=Fl.find(e=>e>j.current&&r>=e);return i&&(j.current=i,y(Z(i)),C(!0),t?.(),setTimeout(()=>{y(``),C(!1)},700)),r});let r=Date.now(),i=E.filter(e=>r-e.ts_ms<=6e4);m(new Set(i.map(e=>`${e.client}:${e.agent_id??`solo`}`)).size),w?.rule_id&&M.current.add(w.rule_id),g(M.current.size),w&&(w.decision===`block`?(k.current=0,c(0),ee.current?.(),te.current?.()):(k.current+=e,k.current>A.current&&(A.current=k.current,u(A.current),x(!0),n?.(),setTimeout(()=>x(!1),450)),c(k.current)))},[T,w,E,t,n]),(0,U.jsxs)(`div`,{className:H(`pointer-events-none select-none`,`flex flex-col gap-2 p-3 rounded-md`,`bg-[var(--color-bg-2,#0c0d12)]/85 backdrop-blur-sm`,`border border-[var(--color-border-1,#1c1f26)]`,`shadow-lg shadow-black/40`,`min-w-[180px] font-mono text-[11px]`,`text-[var(--color-fg-2,#9aa1ad)]`,S&&`milestone-ring`,e),"aria-label":`Live engagement counters`,children:[(0,U.jsx)(Rl,{label:`uptime`,children:(0,U.jsx)(`span`,{className:`tabular-nums text-[var(--color-fg-0,#e6e8ed)] text-[15px] tracking-tight`,children:Q(r)})}),(0,U.jsx)(Rl,{label:`evals`,children:(0,U.jsxs)(`span`,{className:`flex items-center gap-1.5`,children:[(0,U.jsx)(vr,{value:d,curve:`spring`,className:`text-[var(--color-fg-0,#e6e8ed)] text-[15px]`}),v&&(0,U.jsxs)(`span`,{className:`text-[10px] text-emerald-400 uppercase tracking-wide`,children:[`+`,v]})]})}),(0,U.jsx)(Rl,{label:`since block`,children:(0,U.jsx)(`span`,{className:`tabular-nums text-emerald-300 text-[15px]`,children:Il(a)})}),(0,U.jsx)(Rl,{label:`streak / best`,children:(0,U.jsxs)(`span`,{className:H(`tabular-nums text-[15px]`,b?`record-beat`:`text-[var(--color-fg-0,#e6e8ed)]`),children:[(0,U.jsx)(vr,{value:s,curve:`spring`}),(0,U.jsx)(`span`,{className:`text-[var(--color-fg-4,#5a6071)] mx-1`,children:`/`}),(0,U.jsx)(vr,{value:l,curve:`elastic`})]})}),(0,U.jsx)(Rl,{label:`agents`,children:(0,U.jsx)(vr,{value:p,curve:`spring`,className:`text-[var(--color-fg-0,#e6e8ed)] text-[15px]`})}),(0,U.jsx)(Rl,{label:`rules`,children:(0,U.jsx)(vr,{value:h,curve:`spring`,className:`text-[var(--color-fg-0,#e6e8ed)] text-[15px]`})})]})}function Rl({label:e,children:t}){return(0,U.jsxs)(`div`,{className:`flex items-baseline justify-between gap-3`,children:[(0,U.jsx)(`span`,{className:`uppercase tracking-wider text-[10px] text-[var(--color-fg-4,#5a6071)]`,children:e}),t]})}var zl=900,Bl=180,Vl=320,Hl=800,Ul=4;function Wl(){let e=De(),t=ke(),[n,r]=(0,_.useState)(null),[i,a]=(0,_.useState)(`idle`),o=(0,_.useRef)([]),s=(0,_.useRef)(-1),c=(0,_.useRef)(0),l=(0,_.useRef)(null);if((0,_.useEffect)(()=>{if(!e||t===s.current||(s.current=t,e.decision!==`block`&&e.decision!==`force`))return;let l=Date.now(),u=o.current,d=u[0];if(d&&l-c.current<Hl){d.extra+=1,d.burst=e,d.seq=t,c.current=l;return}if(u.length>=Ul&&u.shift(),u.push({seq:t,burst:e,extra:0}),c.current=l,i===`idle`&&!n){let e=u.shift()??null;e&&(r(e),a(`in`))}},[t]),(0,_.useEffect)(()=>{if(i===`idle`)return;let e=null;return i===`in`?e=setTimeout(()=>a(`visible`),Bl):i===`visible`?e=setTimeout(()=>a(`out`),zl):i===`out`&&(e=setTimeout(()=>{let e=o.current.shift()??null;e?(r(e),a(`in`)):(r(null),a(`idle`))},Vl)),l.current=e,()=>{e&&clearTimeout(e)}},[i]),!n)return null;let{burst:u,extra:d}=n,f=za[u.decision]??`#ef4444`,p=pt(),m=i===`in`||i===`visible`?1:0,h=p||i===`in`||i===`visible`?0:-8,g=u.rule_id??`rule`,v=u.decision===`block`?`BLOCKED`:`FORCED`,y=d>0?`${u.tool} · +${d} more in this burst`:`${u.tool} · ${u.client}${u.agent_id?`:${u.agent_id}`:``}`;return(0,U.jsx)(`div`,{className:`pointer-events-none fixed top-20 left-1/2 z-40 select-none`,style:{transform:`translateX(-50%) translateY(${h}px) scale(1)`,opacity:m,transition:p?`opacity ${Bl}ms ease-out`:`opacity ${Bl}ms ease-out, transform ${Bl}ms cubic-bezier(0.34, 1.56, 0.64, 1)`},"aria-live":`polite`,"aria-atomic":`true`,children:(0,U.jsxs)(`div`,{className:`flex items-center gap-3 px-5 py-3 rounded-md border bg-black/85 backdrop-blur-sm shadow-2xl`,style:{borderColor:f},children:[(0,U.jsx)(`div`,{className:`w-2.5 h-2.5 rounded-full shrink-0`,style:{background:f,boxShadow:p?`none`:`0 0 16px ${f}`}}),(0,U.jsxs)(`div`,{className:`flex flex-col gap-0.5 min-w-0`,children:[(0,U.jsxs)(`div`,{className:`text-[11px] font-mono uppercase tracking-[0.18em]`,style:{color:f},children:[v,` BY SSG`]}),(0,U.jsx)(`div`,{className:`text-[14px] font-mono text-[var(--color-fg-1)] truncate max-w-[420px]`,children:g}),(0,U.jsx)(`div`,{className:`text-[11px] font-mono text-[var(--color-fg-3)] truncate max-w-[420px]`,children:y})]})]})})}var Gl=1200,Kl=3e4,ql=`graph.panelState.v1`;function Jl(e){let t=new Map;for(let n of e){let e=Ra(n),r=t.get(e);r?r.push(n):t.set(e,[n])}return t}function Yl(){if(typeof window>`u`)return new Map;try{let e=window.localStorage.getItem(ql);if(!e)return new Map;let t=JSON.parse(e);return new Map(Object.entries(t))}catch{return new Map}}function Xl(e){if(!(typeof window>`u`))try{let t={};for(let[n,r]of e)t[n]=r;window.localStorage.setItem(ql,JSON.stringify(t))}catch{}}function Zl(){let e=Ja(),t=ke(),n=De(),r=(0,_.useRef)(new URLSearchParams(window.location.search).get(`layout`)===`force`?`force`:`spiral`),[i,a]=(0,_.useState)(null),o=rs();(0,_.useEffect)(()=>{n&&(n.decision===`block`?o.play(`block`):n.decision===`force`&&o.play(`force`))},[t]);let s=(0,_.useCallback)(()=>o.play(`milestone`),[o]),c=(0,_.useCallback)(()=>o.play(`record`),[o]),[l,u]=(0,_.useState)(!1);(0,_.useEffect)(()=>{let e=e=>{if(e.key===`Escape`&&l){u(!1);return}if(e.key===`b`||e.key===`B`){let t=e.target?.tagName;if(t===`INPUT`||t===`TEXTAREA`)return;u(e=>!e)}};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[l]);let[d,f]=(0,_.useState)(()=>{if(typeof window>`u`)return!1;try{return window.localStorage.getItem(`ssg.sfx.enabled`)===null}catch{return!1}}),p=(0,_.useCallback)(()=>{o.toggle(),f(!1)},[o]),m=(0,_.useRef)(new Map),[h,g]=(0,_.useState)({fps:60,active:0}),v=(0,_.useCallback)((e,t)=>{m.current.set(e,t)},[]);(0,_.useEffect)(()=>{let e=setInterval(()=>{let e=m.current;if(e.size===0){g(e=>e.active===0?e:{fps:60,active:0});return}let t=0;for(let n of e.values())t+=n;let n=t/e.size,r=n>0?Math.min(60,Math.max(1,Math.round(1e3/n))):60;g(t=>t.fps===r&&t.active===e.size?t:{fps:r,active:e.size})},1e3);return()=>clearInterval(e)},[]);let{bursts:y,playback:b,oldest_known_ms:x,newest_known_ms:S,loading_backfill:C}=e.snapshot,w=(0,_.useMemo)(()=>Jl(y),[y]),[T,E]=(0,_.useState)(()=>Yl()),[D,O]=(0,_.useState)(null);(0,_.useEffect)(()=>{Xl(T)},[T]),(0,_.useEffect)(()=>{let e=Date.now(),t=!1,n=new Map(T);for(let r of w.keys())n.has(r)||(n.set(r,{pinned:!1,pinnedAt:0,minimized:!1,firstSeenAt:e}),t=!0);t&&E(n)},[w,T]);let k=(0,_.useRef)(new Map),A=(0,_.useRef)(new Set),j=(0,_.useRef)(new Map),[,M]=(0,_.useState)(0);(0,_.useEffect)(()=>{let e=performance.now(),t=k.current,n=A.current,r=j.current,i=new Set;for(let[e,n]of w)i.add(e),r.set(e,n.slice()),t.delete(e);for(let a of n)if(!i.has(a)&&!t.has(a)){let n=r.get(a)??[],i=n[n.length-1]?.ts_ms??0;t.set(a,{bursts:n,diedAt:e,newestTs:i})}for(let[n,i]of t)e-i.diedAt>=Gl&&(t.delete(n),r.delete(n));if(A.current=i,t.size>0){let n=1/0;for(let e of t.values())n=Math.min(n,e.diedAt+Gl);let r=Math.max(16,n-e+16),i=setTimeout(()=>M(e=>e+1),r);return()=>clearTimeout(i)}},[w]);let ee=(0,_.useCallback)(e=>{E(t=>{let n=new Map(t),r=n.get(e)??{pinned:!1,pinnedAt:0,minimized:!1,firstSeenAt:Date.now()};return n.set(e,{...r,pinned:!r.pinned,pinnedAt:r.pinned?0:Date.now()}),n})},[]),te=(0,_.useCallback)(e=>{E(t=>{let n=new Map(t),r=n.get(e)??{pinned:!1,pinnedAt:0,minimized:!1,firstSeenAt:Date.now()};return n.set(e,{...r,minimized:!r.minimized}),n})},[]),ne=(0,_.useCallback)(e=>{O(t=>t===e?null:e)},[]);(0,_.useEffect)(()=>{if(!D)return;let e=e=>{e.key===`Escape`&&O(null)};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[D]);let N=(0,_.useMemo)(()=>{let e={pinned:!1,pinnedAt:0,minimized:!1,firstSeenAt:Date.now()},t=[];for(let[n,r]of w){let i=r[r.length-1]?.ts_ms??0;t.push({key:n,bursts:r,newestTs:i,fadingOutAt:null,state:T.get(n)??e})}for(let[n,r]of k.current)w.has(n)||t.push({key:n,bursts:r.bursts,newestTs:r.newestTs,fadingOutAt:r.diedAt,state:T.get(n)??e});return t.sort((e,t)=>e.state.pinned===t.state.pinned?e.state.pinned&&t.state.pinned?e.state.pinnedAt-t.state.pinnedAt:e.state.firstSeenAt-t.state.firstSeenAt:e.state.pinned?-1:1),t},[w,T]),P=(0,_.useMemo)(()=>{if(!i)return null;for(let e of y)if((e.audit_id??`${e.ts_ms}:${e.tool}`)===i||i.startsWith(`${e.ts_ms}:${e.tool}`))return e;return null},[y,i]);(0,_.useEffect)(()=>{let e=new Set(N.map(e=>e.key)),t=m.current;for(let n of Array.from(t.keys()))e.has(n)||t.delete(n)},[N]);let re=(0,_.useMemo)(()=>{let e=n?.counters,t=e?.total??0,r=(e?.block??0)+(e?.force??0),i=0;if(y.length>0){let e=0,t=y.slice(-100);for(let n of t)e+=n.duration_ns;i=e/t.length/1e6}return{evals:t,blocks:r,avgMs:i,agents:N.length}},[n,y,N.length]),ie=Math.min(x,b.playhead_ms-b.window_ms),ae=Math.max(S,b.playhead_ms),F=N.length<=1?1:N.length<=4?2:3,I=Math.max(1,Math.ceil(N.length/F)),L=N.length<=1?360:180,oe=D?N.find(e=>e.key===D):null,se=e=>e>=1e4?`${Math.round(e/1e3)}k`:e.toLocaleString();return(0,U.jsxs)(`div`,{className:`grid gap-3 h-[calc(100dvh-4.5rem)] min-h-[560px] ${l?`grid-rows-[auto_minmax(0,1fr)] bg-black`:`grid-rows-[auto_minmax(0,1fr)_auto]`}`,children:[(0,U.jsx)(Wl,{}),(0,U.jsxs)(`header`,{className:`flex items-center justify-between flex-wrap gap-y-2`,children:[(0,U.jsxs)(`div`,{className:`flex items-center gap-3 flex-wrap`,children:[(0,U.jsx)(`h1`,{className:`text-sm font-mono uppercase tracking-wider text-[var(--color-fg-1)]`,children:`graph intelligence`}),!l&&(0,U.jsx)(`span`,{className:`chip text-sky-300 border-sky-500/30`,children:`real-time tool-use`}),b.mode===`live`?(0,U.jsxs)(`span`,{className:`flex items-center gap-1.5 text-[11px] font-mono uppercase tracking-wider text-emerald-300`,children:[(0,U.jsx)(`span`,{className:`status-dot bg-emerald-400 pulse-soft`}),`streaming`]}):(0,U.jsxs)(`span`,{className:`flex items-center gap-1.5 text-[11px] font-mono uppercase tracking-wider text-amber-300`,children:[(0,U.jsx)(`span`,{className:`status-dot bg-amber-400`}),b.mode]}),(0,U.jsxs)(`span`,{className:`hidden sm:flex items-center gap-3 text-[11px] font-mono text-[var(--color-fg-3)] pl-3 border-l border-[var(--color-line-1)]`,children:[(0,U.jsxs)(`span`,{title:`Total evaluations since daemon start`,children:[(0,U.jsx)(`span`,{className:`text-[var(--color-fg-4)]`,children:`↑`}),` `,(0,U.jsx)(`span`,{className:`text-[var(--color-fg-1)]`,children:se(re.evals)}),` `,`evals`]}),(0,U.jsxs)(`span`,{title:`Block + force decisions — dangerous tool calls intercepted by SSG rules`,children:[(0,U.jsx)(`span`,{className:`text-rose-400`,children:`⛔`}),` `,(0,U.jsx)(`span`,{className:`text-[var(--color-fg-1)]`,children:se(re.blocks)}),` `,`blocks`]}),(0,U.jsxs)(`span`,{title:`Mean eval latency over the last 100 bursts`,children:[(0,U.jsx)(`span`,{className:`text-[var(--color-fg-4)]`,children:`⏱`}),` `,(0,U.jsx)(`span`,{className:`text-[var(--color-fg-1)]`,children:re.avgMs<1?`${(re.avgMs*1e3).toFixed(0)}µs`:`${re.avgMs.toFixed(1)}ms`})]}),(0,U.jsxs)(`span`,{title:`Concurrent agent sessions in this window`,children:[(0,U.jsx)(`span`,{className:`text-[var(--color-fg-4)]`,children:`⌥`}),` `,(0,U.jsx)(`span`,{className:`text-[var(--color-fg-1)]`,children:re.agents}),` `,`agent`,re.agents===1?``:`s`]})]})]}),(0,U.jsxs)(`div`,{className:`flex items-center gap-2`,children:[!l&&(0,U.jsxs)(`p`,{className:`text-[11px] font-mono text-[var(--color-fg-4)]`,children:[y.length,`n · window `,Math.round(b.window_ms/1e3),`s`]}),(0,U.jsxs)(`span`,{className:`text-[10px] font-mono text-[var(--color-fg-4)] tabular-nums`,title:`Average frame time across ${h.active} canvas${h.active===1?``:`es`}`,children:[h.fps,`fps · `,h.active,`/`,N.length]}),(0,U.jsx)(`button`,{type:`button`,onClick:()=>u(e=>!e),className:`chip cursor-pointer transition-colors ${l?`border-amber-500/60 text-amber-300`:`hover:border-sky-500/50 hover:text-sky-300`}`,title:l?`Exit broadcast mode (Esc or B)`:`Broadcast mode — hide chrome for streaming (B)`,children:l?`BROADCAST`:`broadcast`}),(0,U.jsx)(`button`,{type:`button`,onClick:p,className:`chip cursor-pointer transition-colors ${d&&!o.enabled?`border-amber-500/60 text-amber-300 animate-pulse`:`hover:border-sky-500/50 hover:text-sky-300`}`,title:o.enabled?`Mute stream sounds`:`Enable stream sounds`,children:o.enabled?`SFX ON`:d?`🔊 enable cues`:`SFX OFF`})]})]}),(0,U.jsxs)(`div`,{className:`grid grid-cols-1 ${l?``:`lg:grid-cols-[1fr_300px]`} gap-3 min-h-0 overflow-hidden`,children:[(0,U.jsx)(`div`,{className:`grid gap-3 min-h-0 min-w-0`,style:{gridTemplateColumns:`repeat(${F}, minmax(0, 1fr))`,gridTemplateRows:`repeat(${I}, minmax(180px, 1fr))`},children:N.length===0?(0,U.jsxs)(`div`,{className:`flex flex-col items-center justify-center rounded-sm border border-[var(--color-line-1)] bg-[var(--color-surface-1)] text-center px-4`,style:{minHeight:240},children:[(0,U.jsx)(`p`,{className:`overline mb-2 text-[var(--color-fg-3)]`,children:`graph · idle`}),(0,U.jsx)(`p`,{className:`text-[11px] font-mono text-[var(--color-fg-4)] max-w-[280px]`,children:`No active sessions in the current window. Each session will render as its own tree as bursts arrive.`})]}):N.map(e=>{let n=e.fadingOutAt!=null||b.playhead_ms-e.newestTs>Kl;return D!=null&&D!==e.key?null:(0,U.jsx)(El,{sessionKey:e.key,bursts:e.bursts,paused:b.mode!==`live`||e.fadingOutAt!=null,selectedId:i,onSelect:a,burstSeq:t,layout:r.current,isStale:n,isFadingOut:e.fadingOutAt!=null,minHeight:L,pinned:e.state.pinned,minimized:e.state.minimized,isFullscreen:!1,broadcast:l,onTogglePin:()=>ee(e.key),onToggleMinimize:()=>te(e.key),onToggleFullscreen:()=>ne(e.key),onFrameTime:t=>v(e.key,t)},e.key)})}),!l&&(0,U.jsxs)(`aside`,{className:`flex flex-col gap-2 min-w-0 min-h-0 overflow-y-auto`,children:[(0,U.jsx)(Zo,{}),(0,U.jsx)(Ll,{onMilestone:s,onRecord:c}),(0,U.jsx)(`section`,{className:`rounded-sm border border-[var(--color-line-1)] bg-[var(--color-surface-1)] p-3`,children:(0,U.jsx)(Pl,{bursts:y,allBursts:e.allBursts})}),(0,U.jsx)(`section`,{className:`rounded-sm border border-[var(--color-line-1)] bg-[var(--color-surface-1)] p-3 min-h-[140px]`,children:(0,U.jsx)(jl,{burst:P,onClose:()=>a(null)})})]})]}),!l&&(0,U.jsx)(`section`,{className:`rounded-sm border border-[var(--color-line-1)] bg-[var(--color-surface-1)] p-3`,children:(0,U.jsx)(Dl,{playback:b,bursts:y,rangeStart:ie,rangeEnd:ae,loading:C,onPlayhead:t=>e.setPlayhead(t),onLive:()=>e.jumpToLive(),onPause:()=>e.setMode(`paused`),onResume:()=>e.setMode(`scrubbing`),on24h:()=>e.jumpTo24h()})}),l&&(0,U.jsxs)(`div`,{className:`pointer-events-none fixed bottom-3 right-4 flex flex-col items-end gap-1 z-30`,children:[(0,U.jsx)(`span`,{className:`text-[11px] font-mono uppercase tracking-[0.18em] text-[var(--color-fg-3)]`,children:`sigmashake gov`}),(0,U.jsx)(`span`,{className:`text-[10px] font-mono text-[var(--color-fg-4)]`,children:`broadcast mode · press B or Esc to exit`})]}),oe&&(0,U.jsx)(`div`,{className:`fixed inset-0 z-50 bg-black/90 backdrop-blur-sm flex flex-col p-6`,children:(0,U.jsx)(El,{sessionKey:oe.key,bursts:oe.bursts,paused:b.mode!==`live`||oe.fadingOutAt!=null,selectedId:i,onSelect:a,burstSeq:t,layout:r.current,isStale:oe.fadingOutAt!=null||b.playhead_ms-oe.newestTs>Kl,isFadingOut:!1,minHeight:0,pinned:oe.state.pinned,minimized:!1,isFullscreen:!0,onTogglePin:()=>ee(oe.key),onToggleMinimize:()=>te(oe.key),onToggleFullscreen:()=>ne(oe.key)},`fs-${oe.key}`)})]})}var Ql=[{id:`rca`,label:`rca`,hint:`pre-computed root cause`},{id:`timeline`,label:`timeline`,hint:`recent frames across traces`},{id:`watch`,label:`watch`,hint:`subscribe to any ssg:// URI`},{id:`state`,label:`state`,hint:`daemon runtime snapshot`},{id:`metrics`,label:`metrics`,hint:`latency + counters`}];function $l(){let[e,t]=(0,_.useState)(`rca`);return(0,U.jsxs)(`div`,{className:`flex flex-col gap-4 min-h-[70vh]`,children:[(0,U.jsxs)(`header`,{className:`flex items-center justify-between`,children:[(0,U.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,U.jsx)(`h1`,{className:`text-sm font-mono uppercase tracking-wider text-[var(--color-fg-1)]`,children:`ai-native debugger`}),(0,U.jsx)(`span`,{className:`chip text-sky-300 border-sky-500/30`,children:`ssg:// unified resolver`}),(0,U.jsx)(eu,{})]}),(0,U.jsx)(`p`,{className:`text-[11px] font-mono text-[var(--color-fg-4)]`,children:`one surface · cli · mcp · dashboard`})]}),(0,U.jsx)(`nav`,{className:`flex items-center gap-1 border-b border-[var(--color-line-1)]`,children:Ql.map(n=>(0,U.jsx)(`button`,{type:`button`,onClick:()=>t(n.id),title:n.hint,className:`px-3 py-1.5 text-[11px] font-mono uppercase tracking-wider border-b-2 transition-colors `+(e===n.id?`border-[var(--color-brand)] text-[var(--color-fg-1)]`:`border-transparent text-[var(--color-fg-4)] hover:text-[var(--color-fg-2)]`),children:n.label},n.id))}),(0,U.jsxs)(`section`,{className:`flex-1 min-h-0`,children:[e===`rca`&&(0,U.jsx)(tu,{}),e===`timeline`&&(0,U.jsx)(ou,{}),e===`watch`&&(0,U.jsx)(mu,{}),e===`state`&&(0,U.jsx)(hu,{uri:`ssg://daemon/state`}),e===`metrics`&&(0,U.jsx)(hu,{uri:`ssg://daemon/metrics`})]})]})}function eu(){let e=je([`debug-frame`])[`debug-frame`]??0;return(0,U.jsxs)(`span`,{className:`flex items-center gap-1.5 text-[11px] font-mono uppercase tracking-wider text-emerald-300`,title:`${e} debug-frame bursts received`,children:[(0,U.jsx)(`span`,{className:`status-dot bg-emerald-400 pulse-soft`}),`live · `,e]})}function tu(){let e=je([`debug-frame`,`activity-updated`]),{data:t,loading:n,error:r,refetch:i}=R(`/api/json/debug?uri=ssg%3A%2F%2Frca%2Fcurrent`,[e[`debug-frame`],e[`activity-updated`]]),a=t?.data?.pack??null;return(0,U.jsxs)(`div`,{className:`grid grid-cols-1 xl:grid-cols-[1fr_340px] gap-4`,children:[(0,U.jsxs)(`article`,{className:`rounded-sm border border-[var(--color-line-1)] bg-[var(--color-surface-1)] p-4 space-y-3`,children:[n&&!t&&(0,U.jsx)(`p`,{className:`text-sm text-[var(--color-fg-4)]`,children:`loading RCA pack…`}),r&&(0,U.jsxs)(`p`,{className:`text-sm text-rose-300`,children:[`rca fetch error: `,r]}),!n&&!a&&(0,U.jsxs)(`div`,{className:`text-sm text-[var(--color-fg-3)] space-y-2`,children:[(0,U.jsx)(`p`,{className:`font-mono`,children:`no current RCA pack`}),(0,U.jsx)(`p`,{className:`text-[11px] text-[var(--color-fg-4)]`,children:`Packs are composed automatically when an eval errors, an ssqa finding arrives, or a daemon-level error fires. Nothing to diagnose yet — you're green.`})]}),a&&(0,U.jsx)(ru,{pack:a})]}),(0,U.jsxs)(`aside`,{className:`rounded-sm border border-[var(--color-line-1)] bg-[var(--color-surface-1)] p-3 text-[11px] font-mono text-[var(--color-fg-4)] space-y-2`,children:[(0,U.jsx)(`p`,{className:`uppercase tracking-wider text-[var(--color-fg-2)]`,children:`how claude sees this`}),(0,U.jsxs)(`pre`,{className:`text-[10px] whitespace-pre-wrap leading-snug`,children:[`ssg debug rca --current --json`,`
|
|
15
|
+
disabled:opacity-40 disabled:cursor-not-allowed`,children:a?(0,W.jsxs)(`span`,{className:`flex items-center justify-center gap-1.5`,children:[(0,W.jsx)(`svg`,{className:`animate-spin`,width:`11`,height:`11`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2.5`,children:(0,W.jsx)(`path`,{d:`M21 12a9 9 0 1 1-6.219-8.56`})}),`installing…`]}):`install`})})]})}function Wc(){let[e,t]=(0,v.useState)(``),[n,r]=(0,v.useState)(`downloads`),[a,o]=(0,v.useState)(``),[s,c]=(0,v.useState)(``),[l,u]=(0,v.useState)(`all`),[d,f]=(0,v.useState)([]),[p,m]=(0,v.useState)(!1),[h,g]=(0,v.useState)(0),[_,y]=(0,v.useState)(!1),[b,x]=(0,v.useState)(null),[S,C]=(0,v.useState)(null),[w,T]=(0,v.useState)(null),E=(0,v.useCallback)((t=0)=>{let r=new URLSearchParams({page:String(t)});return e&&r.set(`search`,e),n&&n!==`downloads`&&r.set(`sort`,n),a&&r.set(`decision`,a),s&&r.set(`severity`,s),r},[e,n,a,s]);(0,v.useEffect)(()=>{let e=!1;return y(!0),g(0),fetch(`/api/json/hub?${E(0)}`).then(e=>e.json()).then(t=>{e||(f(t.data),m(t.has_more),g(0))}).catch(()=>{}).finally(()=>{e||y(!1)}),()=>{e=!0}},[E]);async function D(){let e=h+1;y(!0);try{let t=await fetch(`/api/json/hub?${E(e)}`);if(!t.ok)return;let n=await t.json();f(e=>[...e,...n.data]),m(n.has_more),g(e)}catch{}finally{y(!1)}}async function O(){let e=await fetch(`/api/json/hub?${E(0)}`);if(!e.ok)return;let t=await e.json();f(t.data),m(t.has_more),g(0)}async function k(e){x(e);try{let t=await(await fetch(`/api/hub/install`,{method:`POST`,headers:{"Content-Type":`application/json`,Accept:`application/json`,...Ae()},body:JSON.stringify({id:e})})).json();t.ok?(C(e),setTimeout(()=>C(null),2e3),T({msg:t.already_installed?`${t.message??e} — already installed`:t.message??`installed ${e}`,type:`ok`}),await O()):T({msg:t.error??`install failed`,type:`error`})}catch(e){T({msg:e instanceof Error?e.message:`network error`,type:`error`})}finally{x(null),setTimeout(()=>T(null),5e3)}}let A=l===`installed`?d.filter(e=>e.installed):d,ee=d.filter(e=>e.installed).length,j=`bg-[var(--color-surface-1)] border border-[var(--color-line-1)] text-[var(--color-fg-2)] text-[11px] font-mono rounded-sm px-2.5 h-8 focus:outline-none focus:border-[var(--color-brand)]/50 cursor-pointer`;return(0,W.jsxs)(`div`,{className:`space-y-5`,children:[(0,W.jsxs)(`div`,{className:`flex items-center justify-between gap-3`,children:[(0,W.jsxs)(`div`,{children:[(0,W.jsx)(`h1`,{className:`overline text-[11px]`,children:`hub`}),(0,W.jsx)(`p`,{className:`text-xs text-[var(--color-fg-3)] mt-1 font-mono`,children:`install community rule packs from hub.sigmashake.com`})]}),(0,W.jsxs)(`a`,{href:`/hub/connect`,className:`inline-flex items-center gap-1.5 text-[11px] font-mono uppercase tracking-wider text-[var(--color-fg-2)] hover:text-[var(--color-brand)] transition-colors border border-[var(--color-line-1)] hover:border-[var(--color-brand)]/40 rounded-sm px-3 h-7`,children:[(0,W.jsx)(`svg`,{width:`11`,height:`11`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2`,children:(0,W.jsx)(`path`,{d:`M9 19c-5 1.5-5-2.5-7-3m14 6v-3.87a3.37 3.37 0 0 0-.94-2.61c3.14-.35 6.44-1.54 6.44-7A5.44 5.44 0 0 0 20 4.77 5.07 5.07 0 0 0 19.91 1S18.73.65 16 2.48a13.38 13.38 0 0 0-7 0C6.27.65 5.09 1 5.09 1A5.07 5.07 0 0 0 5 4.77a5.44 5.44 0 0 0-1.5 3.78c0 5.42 3.3 6.61 6.44 7A3.37 3.37 0 0 0 9 18.13V22`})}),`connect github`]})]}),w&&(0,W.jsxs)(`div`,{className:`flex items-center justify-between rounded-sm px-3 py-2 text-[11px] font-mono border
|
|
16
|
+
${w.type===`ok`?`bg-emerald-500/5 border-emerald-500/25 text-emerald-300`:`bg-red-500/5 border-red-500/25 text-red-300`}`,children:[(0,W.jsxs)(`span`,{children:[w.type===`ok`?`✓ `:`✗ `,w.msg]}),(0,W.jsx)(`button`,{onClick:()=>T(null),className:`ml-3 opacity-60 hover:opacity-100 cursor-pointer`,children:`✕`})]}),(0,W.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,W.jsxs)(`div`,{className:`flex items-center bg-[var(--color-surface-1)] border border-[var(--color-line-1)] rounded-sm p-0.5 shrink-0`,children:[(0,W.jsx)(`button`,{onClick:()=>u(`all`),className:`px-3 h-6 rounded-sm text-[11px] font-mono uppercase tracking-wider transition-colors cursor-pointer
|
|
17
|
+
${l===`all`?`bg-[var(--color-surface-3)] text-[var(--color-fg-0)]`:`text-[var(--color-fg-3)] hover:text-[var(--color-fg-1)]`}`,children:`all`}),(0,W.jsxs)(`button`,{onClick:()=>u(`installed`),className:`px-3 h-6 rounded-sm text-[11px] font-mono uppercase tracking-wider transition-colors cursor-pointer flex items-center gap-1.5
|
|
18
|
+
${l===`installed`?`bg-[var(--color-surface-3)] text-[var(--color-fg-0)]`:`text-[var(--color-fg-3)] hover:text-[var(--color-fg-1)]`}`,children:[`installed`,ee>0&&(0,W.jsx)(`span`,{className:`text-[9px] bg-emerald-500/15 text-emerald-300 rounded-sm px-1 py-0.5 font-medium tabular-nums`,children:ee})]})]}),(0,W.jsxs)(`div`,{className:`relative flex-1 min-w-[160px]`,children:[(0,W.jsxs)(`svg`,{className:`absolute left-2.5 top-1/2 -translate-y-1/2 text-[var(--color-fg-4)]`,width:`11`,height:`11`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2`,children:[(0,W.jsx)(`circle`,{cx:`11`,cy:`11`,r:`8`}),(0,W.jsx)(`line`,{x1:`21`,y1:`21`,x2:`16.65`,y2:`16.65`})]}),(0,W.jsx)(`input`,{type:`text`,placeholder:`search rulesets…`,value:e,onChange:e=>t(e.target.value),className:`w-full bg-[var(--color-surface-1)] border border-[var(--color-line-1)] text-[var(--color-fg-1)] text-xs rounded-sm pl-8 pr-3 h-8 focus:outline-none focus:border-[var(--color-brand)]/50 placeholder:text-[var(--color-fg-4)] font-mono`})]}),(0,W.jsx)(`select`,{value:n,onChange:e=>r(e.target.value),className:j,children:Rc.map(e=>(0,W.jsx)(`option`,{value:e.value,children:e.label},e.value))}),(0,W.jsxs)(`select`,{value:a,onChange:e=>o(e.target.value),className:j,children:[(0,W.jsx)(`option`,{value:``,children:`any decision`}),Bc.filter(Boolean).map(e=>(0,W.jsx)(`option`,{value:e,children:e},e))]}),(0,W.jsxs)(`select`,{value:s,onChange:e=>c(e.target.value),className:j,children:[(0,W.jsx)(`option`,{value:``,children:`any severity`}),zc.filter(Boolean).map(e=>(0,W.jsx)(`option`,{value:e,children:e},e))]})]}),_&&d.length===0?(0,W.jsx)(`div`,{className:`grid grid-cols-1 gap-3 sm:grid-cols-2 lg:grid-cols-3`,children:Array.from({length:6}).map((e,t)=>(0,W.jsx)(Vc,{},t))}):A.length===0?(0,W.jsxs)(`div`,{className:`rounded-sm border border-dashed border-[var(--color-line-1)] py-16 flex flex-col items-center justify-center text-center`,children:[(0,W.jsxs)(`svg`,{className:`text-[var(--color-fg-4)] mb-3`,width:`36`,height:`36`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`1.5`,children:[(0,W.jsx)(`circle`,{cx:`11`,cy:`11`,r:`8`}),(0,W.jsx)(`line`,{x1:`21`,y1:`21`,x2:`16.65`,y2:`16.65`})]}),(0,W.jsx)(`p`,{className:`text-xs font-mono text-[var(--color-fg-3)] uppercase tracking-wider`,children:l===`installed`?`no rulesets installed yet — browse and click install`:`no rulesets found${e?` matching "${e}"`:``}`})]}):(0,W.jsxs)(W.Fragment,{children:[(0,W.jsx)(`div`,{className:`grid grid-cols-1 gap-3 sm:grid-cols-2 lg:grid-cols-3`,children:A.map(e=>(0,W.jsx)(Uc,{rs:e,installingId:b,onInstall:k,flashId:S},e.id))}),p&&l===`all`&&(0,W.jsx)(`div`,{className:`flex justify-center pt-2`,children:(0,W.jsx)(`button`,{onClick:D,disabled:_,className:`h-8 px-5 rounded-sm text-[11px] font-mono uppercase tracking-wider text-[var(--color-fg-2)] border border-[var(--color-line-1)] hover:text-[var(--color-fg-0)] hover:border-[var(--color-line-2)] transition-colors cursor-pointer disabled:opacity-40`,children:_?`loading…`:`load more`})})]})]})}var Gc={deny:`red`,block:`red`,ask:`amber`,allow:`green`,log:`gray`,force:`blue`};function Kc({id:e}){let{data:t,error:n}=z(`/api/json/hub/${e}`),[r,a]=(0,v.useState)(!1),[o,s]=(0,v.useState)(!1);if(n)return(0,W.jsxs)(`div`,{className:`text-sm text-red-300 font-mono`,children:[(0,W.jsx)(`p`,{children:n}),(0,W.jsx)(`a`,{href:`/hub`,className:`text-[var(--color-brand)] hover:underline mt-3 block text-[11px] uppercase tracking-wider`,children:`← back to hub`})]});if(!t)return(0,W.jsx)(`p`,{className:`text-[11px] font-mono uppercase tracking-wider text-[var(--color-fg-3)]`,children:`loading ruleset…`});async function c(){s(!0);try{(await fetch(`/api/hub/install`,{method:`POST`,headers:{"Content-Type":`application/json`,...Ae()},body:JSON.stringify({id:e})})).ok&&a(!0)}finally{s(!1)}}return(0,W.jsxs)(`div`,{className:`space-y-5`,children:[(0,W.jsxs)(`div`,{className:`flex items-start justify-between gap-4`,children:[(0,W.jsxs)(`div`,{className:`min-w-0`,children:[(0,W.jsx)(`a`,{href:`/hub`,className:`text-[11px] font-mono uppercase tracking-wider text-[var(--color-fg-3)] hover:text-[var(--color-brand)]`,children:`← hub`}),(0,W.jsx)(`h1`,{className:`text-xl font-medium tracking-tight mt-1.5 text-[var(--color-fg-0)]`,children:t.title}),(0,W.jsxs)(`p`,{className:`text-[11px] font-mono text-[var(--color-fg-3)] mt-1 tabular-nums`,children:[`@`,t.author,` · v`,t.version,` · `,t.rule_count,` rule`,t.rule_count===1?``:`s`]})]}),(0,W.jsx)(J,{variant:r?`secondary`:`primary`,onClick:c,disabled:o||r,children:r?`✓ installed`:o?`installing…`:`install`})]}),t.technologies.length>0&&(0,W.jsx)(`div`,{className:`flex flex-wrap gap-1.5`,children:t.technologies.map(e=>(0,W.jsx)(lr,{variant:`blue`,children:e},e))}),t.github_repo&&(0,W.jsxs)(`div`,{className:`flex items-center gap-2 text-[11px] font-mono`,children:[(0,W.jsx)(`span`,{className:`overline`,children:`source`}),(0,W.jsx)(`span`,{className:`text-[var(--color-fg-1)]`,children:t.github_repo})]}),(0,W.jsxs)(G,{children:[(0,W.jsx)(K,{children:(0,W.jsxs)(`span`,{className:`overline`,children:[`rules · `,t.rules.length]})}),(0,W.jsx)(q,{className:`space-y-4`,children:t.rules.map((e,t)=>(0,W.jsxs)(`div`,{className:t>0?`border-t border-[var(--color-line-0)] pt-4`:void 0,children:[(0,W.jsxs)(`div`,{className:`flex items-center gap-2 mb-2 flex-wrap`,children:[(0,W.jsx)(lr,{variant:Gc[e.decision]??`gray`,children:e.decision}),(0,W.jsx)(`code`,{className:`text-xs text-[var(--color-brand)] font-mono`,children:e.name}),e.capability&&(0,W.jsx)(lr,{variant:`gray`,children:e.capability})]}),(0,W.jsx)(`p`,{className:`text-sm text-[var(--color-fg-1)] mb-2`,children:e.message}),(0,W.jsx)(Ts,{children:e.raw_text})]},e.id))})]})]})}function qc(){let[e,t]=(0,v.useState)(null),[n,r]=(0,v.useState)(`idle`),[a,o]=(0,v.useState)(``),[s,c]=(0,v.useState)([]),[l,u]=(0,v.useState)(!1);async function d(){u(!0),o(``);try{let e=await fetch(`/api/hub/device-start`,{method:`POST`,headers:{Accept:`application/json`,...Ae()}}),n=await e.json();if(!e.ok){let t=n;t.error===`not_configured`?(r(`not_configured`),c(t.setup_steps??[]),o(t.message??`GitHub OAuth not configured.`)):(o(n.error??`HTTP ${e.status}`),r(`error`));return}t(n),r(`polling`)}catch(e){o(e instanceof Error?e.message:`Failed to start`),r(`error`)}finally{u(!1)}}return(0,v.useEffect)(()=>{if(n!==`polling`||!e)return;let t=setInterval(async()=>{try{let n=await(await fetch(`/api/hub/device-poll?flow=${e.flow_id}`,{headers:{Accept:`application/json`}})).json();n.status===`complete`?(clearInterval(t),r(`done`),o(`connected as @${n.session?.login??`GitHub`} — you can now publish rulesets`)):(n.status===`expired`||n.status===`error`)&&(clearInterval(t),r(`error`),o(n.error??`Authentication failed`))}catch{}},3e3);return()=>clearInterval(t)},[n,e]),(0,W.jsxs)(`div`,{className:`max-w-lg mx-auto space-y-5`,children:[(0,W.jsxs)(`div`,{children:[(0,W.jsxs)(`a`,{href:`/hub`,className:`inline-flex items-center gap-1.5 text-[11px] font-mono uppercase tracking-wider text-[var(--color-fg-3)] hover:text-[var(--color-brand)] transition-colors`,children:[(0,W.jsx)(`svg`,{width:`10`,height:`10`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2`,children:(0,W.jsx)(`polyline`,{points:`15 18 9 12 15 6`})}),`back to hub`]}),(0,W.jsx)(`h1`,{className:`text-xl font-medium tracking-tight mt-2 text-[var(--color-fg-0)]`,children:`Connect GitHub`}),(0,W.jsx)(`p`,{className:`text-[12px] text-[var(--color-fg-3)] mt-1 font-mono`,children:`authenticate with github to publish rulesets to the hub`})]}),n===`not_configured`&&(0,W.jsx)(G,{children:(0,W.jsxs)(q,{className:`space-y-4`,children:[(0,W.jsxs)(`div`,{className:`flex items-start gap-3`,children:[(0,W.jsx)(`span`,{className:`text-amber-300 shrink-0 mt-0.5`,children:(0,W.jsxs)(`svg`,{width:`16`,height:`16`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2`,children:[(0,W.jsx)(`circle`,{cx:`12`,cy:`12`,r:`10`}),(0,W.jsx)(`line`,{x1:`12`,y1:`8`,x2:`12`,y2:`12`}),(0,W.jsx)(`line`,{x1:`12`,y1:`16`,x2:`12.01`,y2:`16`})]})}),(0,W.jsxs)(`div`,{children:[(0,W.jsx)(`p`,{className:`text-sm font-medium text-[var(--color-fg-0)]`,children:`GitHub OAuth not configured`}),(0,W.jsx)(`p`,{className:`text-xs text-[var(--color-fg-2)] mt-1 leading-relaxed`,children:a})]})]}),(0,W.jsxs)(`div`,{className:`border-t border-[var(--color-line-0)] pt-4`,children:[(0,W.jsx)(`div`,{className:`overline mb-3`,children:`setup steps`}),(0,W.jsx)(`ol`,{className:`space-y-2`,children:s.map((e,t)=>(0,W.jsxs)(`li`,{className:`flex items-start gap-2.5 text-xs text-[var(--color-fg-1)]`,children:[(0,W.jsx)(`span`,{className:`shrink-0 w-5 h-5 rounded-sm bg-[var(--color-surface-2)] border border-[var(--color-line-1)] text-[var(--color-fg-3)] text-[10px] font-mono flex items-center justify-center tabular-nums`,children:t+1}),(0,W.jsx)(`span`,{className:`mt-0.5 leading-relaxed`,children:e.replace(/^\d+\.\s+/,``)})]},t))})]}),(0,W.jsxs)(`div`,{className:`bg-[var(--color-surface-0)] border border-[var(--color-line-1)] rounded-sm p-3`,children:[(0,W.jsx)(`div`,{className:`overline mb-1.5`,children:`quick start`}),(0,W.jsx)(`code`,{className:`text-[11px] text-[var(--color-brand)]/90 font-mono`,children:`export SSG_GITHUB_CLIENT_ID=<your-client-id>`}),(0,W.jsxs)(`p`,{className:`text-[11px] font-mono text-[var(--color-fg-3)] mt-1`,children:[`then restart:`,` `,(0,W.jsx)(`code`,{className:`text-[var(--color-fg-1)]`,children:`ssg serve`})]})]}),(0,W.jsx)(`a`,{href:`https://github.com/settings/applications/new`,target:`_blank`,rel:`noreferrer`,className:`inline-flex items-center gap-1.5 text-[11px] font-mono uppercase tracking-wider text-[var(--color-brand)] hover:underline`,children:`create github oauth app →`})]})}),n===`idle`&&(0,W.jsx)(G,{children:(0,W.jsxs)(q,{children:[(0,W.jsx)(`p`,{className:`text-[12px] text-[var(--color-fg-2)] mb-4 leading-relaxed`,children:`This uses GitHub's device authorization flow — no redirect URIs needed. You'll be shown a code to enter at github.com.`}),(0,W.jsx)(J,{onClick:d,disabled:l,variant:`primary`,children:l?`starting…`:`connect with github`})]})}),e&&n===`polling`&&(0,W.jsx)(G,{children:(0,W.jsxs)(q,{className:`space-y-4`,children:[(0,W.jsxs)(`div`,{className:`text-center`,children:[(0,W.jsx)(`div`,{className:`overline mb-2`,children:`open this url in your browser`}),(0,W.jsx)(`a`,{href:e.verification_uri,target:`_blank`,rel:`noreferrer`,className:`text-sm text-[var(--color-brand)] hover:underline font-mono`,children:e.verification_uri})]}),(0,W.jsxs)(`div`,{className:`border border-[var(--color-line-1)] bg-[var(--color-surface-0)] rounded-sm py-5 text-center`,children:[(0,W.jsx)(`div`,{className:`overline mb-3`,children:`enter this code`}),(0,W.jsx)(`div`,{className:`text-4xl font-mono font-bold tracking-[0.3em] text-[var(--color-fg-0)]`,children:e.user_code})]}),(0,W.jsxs)(`p`,{className:`text-[11px] font-mono uppercase tracking-wider text-[var(--color-fg-3)] text-center flex items-center justify-center gap-2`,children:[(0,W.jsx)(`svg`,{className:`animate-spin`,width:`11`,height:`11`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2.5`,children:(0,W.jsx)(`path`,{d:`M21 12a9 9 0 1 1-6.219-8.56`})}),`waiting for github authorization…`]})]})}),n===`done`&&(0,W.jsxs)(`div`,{className:`rounded-sm border border-emerald-500/25 bg-emerald-500/5 p-4 text-sm text-emerald-200 space-y-2`,children:[(0,W.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,W.jsx)(`svg`,{width:`15`,height:`15`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2.5`,children:(0,W.jsx)(`polyline`,{points:`20 6 9 17 4 12`})}),(0,W.jsx)(`span`,{className:`font-mono text-xs`,children:a})]}),(0,W.jsx)(`a`,{href:`/hub/publish`,className:`text-[11px] font-mono uppercase tracking-wider text-[var(--color-brand)] hover:underline block mt-1`,children:`publish a ruleset →`})]}),n===`error`&&a&&(0,W.jsxs)(`div`,{className:`rounded-sm border border-red-500/25 bg-red-500/5 p-4`,children:[(0,W.jsx)(`p`,{className:`text-sm text-red-200 font-mono`,children:a}),(0,W.jsx)(`button`,{onClick:()=>{r(`idle`),o(``)},className:`text-[11px] font-mono text-[var(--color-fg-3)] hover:text-[var(--color-fg-1)] mt-3 cursor-pointer uppercase tracking-wider`,children:`← try again`})]})]})}function Jc(){let[e,t]=(0,v.useState)(``),[n,r]=(0,v.useState)(!1),[a,o]=(0,v.useState)(null);async function s(t){if(t.preventDefault(),e.trim()){r(!0),o(null);try{o(await(await fetch(`/api/hub/publish`,{method:`POST`,headers:{"Content-Type":`application/json`,...Ae()},body:JSON.stringify({repo_url:e.trim()})})).json())}catch(e){o({ok:!1,error:e instanceof Error?e.message:`Unknown error`})}finally{r(!1)}}}return(0,W.jsxs)(`div`,{className:`max-w-md mx-auto space-y-5`,children:[(0,W.jsxs)(`div`,{children:[(0,W.jsx)(`a`,{href:`/hub`,className:`text-[11px] font-mono uppercase tracking-wider text-[var(--color-fg-3)] hover:text-[var(--color-brand)]`,children:`← hub`}),(0,W.jsx)(`h1`,{className:`text-xl font-medium tracking-tight mt-2 text-[var(--color-fg-0)]`,children:`Publish Ruleset`}),(0,W.jsx)(`p`,{className:`text-[12px] text-[var(--color-fg-3)] mt-1 font-mono`,children:`publish a github repository containing .rules files to the hub`})]}),(0,W.jsx)(G,{children:(0,W.jsx)(q,{children:(0,W.jsxs)(`form`,{onSubmit:s,className:`space-y-4`,children:[(0,W.jsxs)(`div`,{children:[(0,W.jsx)(`label`,{className:`block overline mb-1.5`,children:`github repository url`}),(0,W.jsx)(`input`,{type:`url`,placeholder:`https://github.com/owner/repo`,value:e,onChange:e=>t(e.target.value),required:!0,className:`w-full bg-[var(--color-surface-0)] border border-[var(--color-line-1)] text-[var(--color-fg-1)] text-sm rounded-sm px-3 py-2 focus:outline-none focus:border-[var(--color-brand)]/50 placeholder:text-[var(--color-fg-4)] font-mono`})]}),(0,W.jsx)(J,{type:`submit`,variant:`primary`,disabled:n,children:n?`publishing…`:`publish to hub`})]})})}),a&&(0,W.jsx)(`div`,{className:`rounded-sm border px-3 py-2 text-xs font-mono ${a.ok?`border-emerald-500/25 bg-emerald-500/5 text-emerald-300`:`border-red-500/25 bg-red-500/5 text-red-300`}`,children:a.ok?(0,W.jsxs)(W.Fragment,{children:[`✓ published!`,` `,a.id&&(0,W.jsx)(`a`,{href:`/hub/${a.id}`,className:`text-[var(--color-brand)] hover:underline uppercase tracking-wider text-[11px] ml-2`,children:`view ruleset →`})]}):a.error??`publish failed`})]})}function Yc(e){return e===0?`—`:e<1e3?`${e}ns`:e<1e6?`${(e/1e3).toFixed(1)}µs`:`${(e/1e6).toFixed(1)}ms`}function Xc(e){let t=Math.floor(e/1e3);if(t<60)return`${t}s`;let n=Math.floor(t/60);return n<60?`${n}m ${t%60}s`:`${Math.floor(n/60)}h ${n%60}m`}function Zc(e){let t=e<1e10?e*1e3:e,n=new Date(t);return`${String(n.getHours()).padStart(2,`0`)}:${String(n.getMinutes()).padStart(2,`0`)}:${String(n.getSeconds()).padStart(2,`0`)}`}function Qc(e){let t=Math.round((Date.now()-e)/1e3);if(t<5)return`just now`;if(t<60)return`${t}s ago`;let n=Math.floor(t/60);return n<60?`${n}m ago`:`${Math.floor(n/60)}h ago`}var $c={allow:`text-emerald-300`,block:`text-red-300`,force:`text-violet-300`,log:`text-amber-300`,ask:`text-sky-300`,shadow:`text-[var(--color-fg-3)]`},el={allow:`✓`,block:`✗`,force:`→`,log:`·`,ask:`?`,shadow:`~`};function tl({label:e,ns:t,maxNs:n}){let r=n>0?Math.min(100,t/n*100):0;return(0,W.jsxs)(`div`,{className:`flex items-center gap-2 text-xs`,children:[(0,W.jsx)(`span`,{className:`text-[var(--color-fg-3)] w-8 text-right font-mono uppercase tracking-wider text-[10px]`,children:e}),(0,W.jsx)(Ms,{pct:r,tone:t<1e5?`green`:t<1e6?`amber`:`red`,className:`h-1 flex-1`}),(0,W.jsx)(`span`,{className:`font-mono text-[var(--color-fg-1)] tabular-nums w-14 text-right`,children:Yc(t)})]})}function nl({value:e,max:t,threshold:n,breached:r}){let a=t>0?Math.min(100,e/t*100):0,o=t>0?Math.min(100,n/t*100):0;return(0,W.jsx)(Ms,{pct:a,tone:r?`red`:e/t>=.6?`amber`:`green`,markerPct:o,markerTitle:`limit: ${n}`,className:`h-1`})}function rl({limitsData:e,onSaved:t}){let[n,r]=(0,v.useState)(String(e.config.cpuLimitPct)),[a,o]=(0,v.useState)(String(e.config.memoryLimitMb)),[s,c]=(0,v.useState)(e.config.breachAction),[l,u]=(0,v.useState)(!1),[d,f]=(0,v.useState)(null);async function p(){u(!0),f(null);try{let e=await fetch(`/api/json/limits`,{method:`POST`,headers:{"Content-Type":`application/json`,...Ae()},body:JSON.stringify({cpu_limit_pct:parseFloat(n),memory_limit_mb:parseFloat(a),breach_action:s})});e.ok?t():f((await e.json()).error??`save failed`)}catch{f(`network error`)}finally{u(!1)}}let m=`w-full bg-[var(--color-surface-0)] border border-[var(--color-line-1)] rounded-sm px-2 py-1.5 text-[var(--color-fg-1)] font-mono text-xs focus:outline-none focus:border-[var(--color-brand)]/50`;return(0,W.jsxs)(`div`,{className:`space-y-3`,children:[(0,W.jsxs)(`div`,{className:`grid grid-cols-2 gap-3`,children:[(0,W.jsxs)(`div`,{children:[(0,W.jsx)(`label`,{className:`overline block mb-1.5`,children:`cpu limit (%)`}),(0,W.jsx)(`input`,{type:`number`,min:1,max:100,value:n,onChange:e=>r(e.target.value),className:m})]}),(0,W.jsxs)(`div`,{children:[(0,W.jsx)(`label`,{className:`overline block mb-1.5`,children:`memory limit (mb)`}),(0,W.jsx)(`input`,{type:`number`,min:1,value:a,onChange:e=>o(e.target.value),className:m})]})]}),(0,W.jsxs)(`div`,{children:[(0,W.jsx)(`label`,{className:`overline block mb-1.5`,children:`on breach`}),(0,W.jsxs)(`select`,{value:s,onChange:e=>c(e.target.value),className:m,children:[(0,W.jsx)(`option`,{value:`warn`,children:`warn in ui only`}),(0,W.jsx)(`option`,{value:`log`,children:`warn + write to audit log`})]})]}),d&&(0,W.jsx)(`p`,{className:`text-xs text-red-300 font-mono`,children:d}),(0,W.jsx)(J,{onClick:p,disabled:l,variant:`primary`,size:`sm`,children:l?`saving…`:`save limits`})]})}var il={running:`green`,hibernating:`amber`,exhausted:`red`,stopped:`gray`,idle:`gray`};function al(e,t){let n=e-t;if(n<=0)return`any moment`;let r=Math.round(n/1e3);if(r<60)return`in ${r}s`;let a=Math.floor(r/60);return a<60?`in ${a}m ${r%60}s`:`in ${Math.floor(a/60)}h ${a%60}m`}function ol({supervisors:e}){let[t,n]=(0,v.useState)(Date.now());return(0,v.useEffect)(()=>{let e=setInterval(()=>n(Date.now()),1e3);return()=>clearInterval(e)},[]),(0,W.jsxs)(G,{children:[(0,W.jsxs)(K,{className:`flex items-center justify-between`,children:[(0,W.jsxs)(`span`,{className:`flex items-center gap-2 overline`,children:[`supervisor health`,e.some(e=>e.state===`hibernating`||e.state===`exhausted`)&&(0,W.jsx)(lr,{variant:`amber`,children:`degraded`})]}),(0,W.jsxs)(`span`,{className:`text-[10px] font-mono tabular-nums text-[var(--color-fg-4)]`,children:[e.length,` supervisor`,e.length===1?``:`s`]})]}),(0,W.jsx)(q,{children:e.length===0?(0,W.jsx)(`p`,{className:`text-[11px] font-mono text-[var(--color-fg-4)]`,children:`no supervisors registered yet`}):(0,W.jsx)(`div`,{className:`overflow-x-auto`,children:(0,W.jsxs)(`table`,{className:`w-full text-xs font-mono`,children:[(0,W.jsx)(`thead`,{children:(0,W.jsxs)(`tr`,{className:`text-[10px] uppercase tracking-wider text-[var(--color-fg-4)]`,children:[(0,W.jsx)(`th`,{className:`text-left font-normal pb-1.5`,children:`name`}),(0,W.jsx)(`th`,{className:`text-left font-normal pb-1.5`,children:`kind`}),(0,W.jsx)(`th`,{className:`text-left font-normal pb-1.5`,children:`state`}),(0,W.jsx)(`th`,{className:`text-right font-normal pb-1.5`,children:`restarts`}),(0,W.jsx)(`th`,{className:`text-left font-normal pb-1.5 pl-4`,children:`last restart`}),(0,W.jsx)(`th`,{className:`text-left font-normal pb-1.5 pl-4`,children:`next retry`})]})}),(0,W.jsx)(`tbody`,{children:e.map(e=>(0,W.jsxs)(`tr`,{className:`border-t border-[var(--color-line-0)]`,children:[(0,W.jsx)(`td`,{className:`py-1.5 text-[var(--color-fg-1)]`,children:e.name}),(0,W.jsx)(`td`,{className:`py-1.5 text-[var(--color-fg-3)]`,children:e.kind===`single`?`single`:`tree`}),(0,W.jsx)(`td`,{className:`py-1.5`,children:(0,W.jsx)(lr,{variant:il[e.state],children:e.state})}),(0,W.jsx)(`td`,{className:`py-1.5 text-right tabular-nums text-[var(--color-fg-1)]`,children:e.restarts}),(0,W.jsx)(`td`,{className:`py-1.5 pl-4 tabular-nums text-[var(--color-fg-3)]`,children:e.lastRestartAt>0?Qc(e.lastRestartAt):`—`}),(0,W.jsx)(`td`,{className:`py-1.5 pl-4 tabular-nums text-[var(--color-fg-3)]`,children:e.nextRetryAt>0?(0,W.jsx)(`span`,{title:e.hibernateReason?`reason: ${e.hibernateReason}`:void 0,children:al(e.nextRetryAt,t)}):`—`})]},e.name))})]})})})]})}function sl(){let e=je([`runtime-tick`,`activity-updated`,`limits-breach`,`supervisor-changed`]),t=Oe(),[n,r]=(0,v.useState)(Date.now()),[a,o]=(0,v.useState)(0),[s,c]=(0,v.useState)([]),[l,u]=(0,v.useState)(0),[d,f]=(0,v.useState)(!1),p=(0,v.useRef)(null);(0,v.useEffect)(()=>{let e=setInterval(()=>r(Date.now()),1e3);return()=>clearInterval(e)},[]);let{data:m}=z(`/api/state/runtime`,[e[`runtime-tick`]]),{data:h,refetch:g}=z(`/api/json/limits`,[e[`limits-breach`]]),{data:_}=z(`/api/state/activity-tail?after=${a}&limit=50`,[e[`activity-updated`]]),{data:y}=z(`/api/json/supervisors`,[e[`supervisor-changed`],e[`runtime-tick`]]);(0,v.useEffect)(()=>{_&&_.rows.length>0&&(o(e=>Math.max(e,_.maxId)),c(e=>{let t=new Set(e.map(e=>e.id));return[..._.rows.filter(e=>!t.has(e.id)),...e].slice(0,100)}))},[_]),(0,v.useEffect)(()=>{let e=m!==null;p.current===!1&&e&&u(e=>e+1),p.current=e},[m]);let b=m?Xc(m.uptime_ms):null,x=m&&m.last_eval_at>0?Qc(m.last_eval_at):null,S=h?.breaches.cpu??!1,C=h?.breaches.memory??!1,w=m?S?`text-red-300`:(m.cpu_pct??0)>=60?`text-amber-300`:`text-emerald-300`:`text-[var(--color-fg-1)]`,T=C?`text-red-300`:`text-[var(--color-fg-1)]`;return(0,W.jsxs)(`div`,{className:`space-y-5`,children:[(0,W.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,W.jsxs)(`div`,{children:[(0,W.jsx)(`h1`,{className:`text-xl font-medium tracking-tight text-[var(--color-fg-0)]`,children:`Daemon Monitor`}),(0,W.jsx)(`p`,{className:`text-[12px] font-mono text-[var(--color-fg-3)] mt-0.5`,children:`live metrics · audit tail · resource limits`})]}),(0,W.jsxs)(`div`,{className:`flex items-center gap-3`,children:[l>0&&(0,W.jsxs)(lr,{variant:`amber`,children:[l,` restart`,l===1?``:`s`]}),(0,W.jsx)(`span`,{className:`text-[11px] font-mono tabular-nums text-[var(--color-fg-3)]`,children:Zc(n)})]})]}),(0,W.jsx)(cl,{cpuPct:m?.cpu_pct??0,cpuLimit:h?.config.cpuLimitPct,memMb:m?.memory_rss_mb??0,memLimit:h?.config.memoryLimitMb,decisions:m?.decisions,latency:m?.latency,burstBuffer:t,evalsTotal:m?.evals_total??0}),h&&(S||C)&&(0,W.jsxs)(`div`,{className:`rounded-sm border border-red-500/25 bg-red-500/[0.06] border-l-2 border-l-red-500/70 px-3 py-2.5 flex items-start gap-2.5`,children:[(0,W.jsx)(`span`,{className:`text-red-300 shrink-0 mt-0.5`,children:(0,W.jsxs)(`svg`,{width:`14`,height:`14`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2`,children:[(0,W.jsx)(`path`,{d:`M10.29 3.86 1.82 18a2 2 0 0 0 1.71 3h16.94a2 2 0 0 0 1.71-3L13.71 3.86a2 2 0 0 0-3.42 0Z`}),(0,W.jsx)(`line`,{x1:`12`,y1:`9`,x2:`12`,y2:`13`}),(0,W.jsx)(`line`,{x1:`12`,y1:`17`,x2:`12.01`,y2:`17`})]})}),(0,W.jsxs)(`div`,{className:`space-y-0.5 text-xs font-mono`,children:[S&&(0,W.jsxs)(`div`,{className:`text-red-200`,children:[`cpu limit exceeded: `,m?.cpu_pct??`?`,`% >`,` `,h.config.cpuLimitPct,`%`]}),C&&(0,W.jsxs)(`div`,{className:`text-red-200`,children:[`memory limit exceeded: `,m?.memory_rss_mb??`?`,`mb >`,` `,h.config.memoryLimitMb,`mb`]})]})]}),(0,W.jsxs)(G,{children:[(0,W.jsx)(K,{children:(0,W.jsx)(`span`,{className:`overline`,children:`daemon status`})}),(0,W.jsx)(q,{children:m===null?(0,W.jsxs)(`div`,{className:`flex items-center gap-2 text-sm`,children:[(0,W.jsx)(`span`,{className:`inline-block w-1.5 h-1.5 rounded-full bg-red-500 shrink-0`}),(0,W.jsx)(`span`,{className:`text-red-300 font-mono uppercase tracking-wider text-xs`,children:`down`}),(0,W.jsx)(`span`,{className:`text-[var(--color-fg-3)] text-xs font-mono`,children:`— socket not reachable`})]}):(0,W.jsxs)(`div`,{className:`flex items-center gap-5 flex-wrap text-xs font-mono`,children:[(0,W.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,W.jsx)(`span`,{className:`inline-block w-1.5 h-1.5 rounded-full bg-emerald-400 pulse-soft shrink-0`}),(0,W.jsx)(`span`,{className:`text-emerald-300 uppercase tracking-wider`,children:`up`})]}),(0,W.jsxs)(`span`,{className:`text-[var(--color-fg-3)]`,children:[`pid`,` `,(0,W.jsx)(`span`,{className:`text-[var(--color-fg-1)] tabular-nums`,children:m.pid})]}),(0,W.jsxs)(`span`,{className:`text-[var(--color-fg-3)]`,children:[`uptime`,` `,(0,W.jsx)(`span`,{className:`text-[var(--color-fg-1)] tabular-nums`,children:b})]}),(0,W.jsxs)(`span`,{className:`text-[var(--color-fg-3)]`,children:[`mem`,` `,(0,W.jsxs)(`span`,{className:`text-[var(--color-fg-1)] tabular-nums`,children:[m.memory_rss_mb,`MB`]})]}),(0,W.jsxs)(`span`,{className:`text-[var(--color-fg-3)]`,children:[`cpu`,` `,(0,W.jsxs)(`span`,{className:`${w} tabular-nums`,children:[m.cpu_pct,`%`]})]}),(0,W.jsxs)(`span`,{className:`text-[var(--color-fg-3)]`,children:[`last eval`,` `,(0,W.jsx)(`span`,{className:`text-[var(--color-fg-1)] tabular-nums`,children:x??`—`})]})]})})]}),(0,W.jsx)(ol,{supervisors:y?.supervisors??[]}),(0,W.jsxs)(G,{children:[(0,W.jsxs)(K,{className:`flex items-center justify-between`,children:[(0,W.jsxs)(`span`,{className:`flex items-center gap-2 overline`,children:[`system resources`,h&&(S||C)&&(0,W.jsx)(lr,{variant:`red`,children:`limit exceeded`})]}),(0,W.jsx)(`button`,{onClick:()=>f(e=>!e),className:`text-[10px] font-mono uppercase tracking-wider text-[var(--color-fg-3)] hover:text-[var(--color-brand)] transition-colors cursor-pointer`,children:d?`hide limits`:`configure limits`})]}),(0,W.jsxs)(q,{children:[m===null?(0,W.jsx)(`p`,{className:`text-[11px] font-mono text-[var(--color-fg-4)]`,children:`no data — daemon not running`}):(0,W.jsxs)(`div`,{className:`space-y-5`,children:[(0,W.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,W.jsxs)(`div`,{className:`flex items-center justify-between text-xs`,children:[(0,W.jsx)(`span`,{className:`overline`,children:`cpu`}),(0,W.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(m.history.cpu_pct.length??0)>1&&(0,W.jsx)(hr,{data:m.history.cpu_pct,width:80,height:20,color:S?`#f87171`:`#34d399`,threshold:h?.config.cpuLimitPct,maxValue:100}),(0,W.jsxs)(`span`,{className:`font-mono font-medium w-12 text-right tabular-nums ${w}`,children:[m.cpu_pct,`%`]})]})]}),(0,W.jsx)(nl,{value:m.cpu_pct,max:100,threshold:h?.config.cpuLimitPct??90,breached:S}),h&&(0,W.jsxs)(`div`,{className:`text-[10px] font-mono text-[var(--color-fg-4)]`,children:[`limit: `,h.config.cpuLimitPct,`%`]})]}),(0,W.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,W.jsxs)(`div`,{className:`flex items-center justify-between text-xs`,children:[(0,W.jsx)(`span`,{className:`overline`,children:`memory rss`}),(0,W.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(m.history.memory_rss_mb.length??0)>1&&(0,W.jsx)(hr,{data:m.history.memory_rss_mb,width:80,height:20,color:C?`#f87171`:`#38bdf8`,threshold:h?.config.memoryLimitMb}),(0,W.jsxs)(`span`,{className:`font-mono font-medium w-16 text-right tabular-nums ${T}`,children:[m.memory_rss_mb,`MB`]})]})]}),(0,W.jsx)(nl,{value:m.memory_rss_mb,max:Math.max(m.memory_rss_mb*1.5,h?.config.memoryLimitMb??512),threshold:h?.config.memoryLimitMb??512,breached:C}),h&&(0,W.jsxs)(`div`,{className:`text-[10px] font-mono text-[var(--color-fg-4)]`,children:[`limit: `,h.config.memoryLimitMb,`MB`]})]}),(0,W.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,W.jsxs)(`div`,{className:`flex items-center justify-between text-xs`,children:[(0,W.jsx)(`span`,{className:`overline`,children:`heap`}),(0,W.jsxs)(`span`,{className:`font-mono text-[var(--color-fg-1)] tabular-nums`,children:[m.heap_used_mb,`MB / `,m.heap_total_mb,`MB`]})]}),(0,W.jsx)(Ms,{pct:m.heap_total_mb>0?Math.min(100,m.heap_used_mb/m.heap_total_mb*100):0,tone:`blue`,className:`h-1`})]})]}),d&&h&&(0,W.jsxs)(`div`,{className:`mt-5 pt-4 border-t border-[var(--color-line-0)]`,children:[(0,W.jsxs)(`p`,{className:`text-[11px] font-mono text-[var(--color-fg-3)] mb-3 leading-relaxed`,children:[`thresholds trigger ui warnings. values are persisted to`,` `,(0,W.jsx)(`code`,{className:`text-[var(--color-fg-1)]`,children:`.sigmashake/config.toml`}),`.`]}),(0,W.jsx)(rl,{limitsData:h,onSaved:()=>{g(),f(!1)}})]})]})]}),(0,W.jsxs)(`div`,{className:`grid grid-cols-2 sm:grid-cols-3 lg:grid-cols-6 gap-2`,children:[(0,W.jsx)(js,{className:`rounded-sm border border-[var(--color-line-1)] bg-[var(--color-surface-1)]`,labelPlacement:`above`,label:`total evals`,value:m?.evals_total??`—`,valueClassName:`text-xl font-medium tabular-nums text-[var(--color-fg-0)]`}),(0,W.jsx)(js,{className:`rounded-sm border border-[var(--color-line-1)] bg-[var(--color-surface-1)]`,labelPlacement:`above`,label:`allow`,value:m?.decisions.allow??`—`,valueClassName:`text-xl font-medium tabular-nums text-emerald-300`}),(0,W.jsx)(js,{className:`rounded-sm border border-[var(--color-line-1)] bg-[var(--color-surface-1)]`,labelPlacement:`above`,label:`block`,value:m?.decisions.block??`—`,valueClassName:`text-xl font-medium tabular-nums text-red-300`}),(0,W.jsx)(js,{className:`rounded-sm border border-[var(--color-line-1)] bg-[var(--color-surface-1)]`,labelPlacement:`above`,label:`force`,value:m?.decisions.force??`—`,valueClassName:`text-xl font-medium tabular-nums text-violet-300`}),(0,W.jsx)(js,{className:`rounded-sm border border-[var(--color-line-1)] bg-[var(--color-surface-1)]`,labelPlacement:`above`,label:`log`,value:m?.decisions.log??`—`,valueClassName:`text-xl font-medium tabular-nums text-amber-300`}),(0,W.jsx)(js,{className:`rounded-sm border border-[var(--color-line-1)] bg-[var(--color-surface-1)]`,labelPlacement:`above`,label:`ask`,value:m?.decisions.ask??`—`,valueClassName:`text-xl font-medium tabular-nums text-sky-300`})]}),(0,W.jsxs)(`div`,{className:`grid grid-cols-1 lg:grid-cols-2 gap-4`,children:[(0,W.jsxs)(G,{children:[(0,W.jsxs)(K,{className:`flex items-center justify-between`,children:[(0,W.jsx)(`span`,{className:`overline`,children:`eval latency`}),m&&(0,W.jsxs)(`span`,{className:`text-[10px] font-mono text-[var(--color-fg-3)] tabular-nums`,children:[m.latency.samples,` samples`]})]}),(0,W.jsx)(q,{children:m===null?(0,W.jsx)(`p`,{className:`text-[11px] font-mono text-[var(--color-fg-4)]`,children:`no data`}):(0,W.jsxs)(`div`,{className:`space-y-2`,children:[(0,W.jsx)(tl,{label:`p50`,ns:m.latency.p50_ns,maxNs:m.latency.max_ns}),(0,W.jsx)(tl,{label:`p95`,ns:m.latency.p95_ns,maxNs:m.latency.max_ns}),(0,W.jsx)(tl,{label:`p99`,ns:m.latency.p99_ns,maxNs:m.latency.max_ns}),(0,W.jsx)(tl,{label:`max`,ns:m.latency.max_ns,maxNs:m.latency.max_ns})]})})]}),(0,W.jsxs)(G,{children:[(0,W.jsx)(K,{children:(0,W.jsx)(`span`,{className:`overline`,children:`engine`})}),(0,W.jsx)(q,{children:m===null?(0,W.jsx)(`p`,{className:`text-[11px] font-mono text-[var(--color-fg-4)]`,children:`no data`}):(0,W.jsx)(`div`,{className:`space-y-1.5 text-xs font-mono`,children:[[`native evals`,m.engine.native_evals],[`ts evals`,m.engine.ts_evals],[`native %`,`${m.engine.native_pct}%`],[`rule reloads`,m.rule_reloads],[`rate limit trips`,m.rate_limit_trips],[`loop guard blocks`,m.loop_guard_blocks],[`connection errors`,m.connection_errors]].map(([e,t])=>(0,W.jsxs)(`div`,{className:`flex justify-between py-0.5 border-b border-[var(--color-line-0)] last:border-0`,children:[(0,W.jsx)(`span`,{className:`text-[var(--color-fg-3)]`,children:e}),(0,W.jsx)(`span`,{className:`text-[var(--color-fg-1)] tabular-nums`,children:t})]},e))})})]})]}),(0,W.jsxs)(G,{children:[(0,W.jsxs)(K,{className:`flex items-center justify-between`,children:[(0,W.jsx)(`span`,{className:`overline`,children:`live event tail`}),(0,W.jsx)(`span`,{className:`text-[10px] font-mono text-[var(--color-fg-4)]`,children:`newest first · auto-updating`})]}),(0,W.jsx)(q,{children:s.length===0?(0,W.jsx)(`div`,{className:`rounded-sm border border-dashed border-[var(--color-line-1)] bg-[var(--color-surface-0)] px-4 py-6 text-center`,children:(0,W.jsx)(`p`,{className:`text-[11px] font-mono text-[var(--color-fg-4)]`,children:`no events yet`})}):(0,W.jsx)(`div`,{className:`font-mono text-[11px] max-h-96 overflow-y-auto divide-y divide-[var(--color-line-0)]`,children:s.map(e=>(0,W.jsxs)(`div`,{className:`flex items-center gap-2 py-1`,children:[(0,W.jsx)(`span`,{className:`text-[var(--color-fg-4)] shrink-0 w-16 tabular-nums`,children:Zc(e.timestamp)}),e.tool===`__daemon`?(0,W.jsxs)(`span`,{className:`text-sky-400`,children:[`daemon`,` `,(()=>{try{let t=JSON.parse(e.input??`{}`);return`${t.event??e.decision}${t.detail?` (${t.detail})`:``}`}catch{return e.decision}})()]}):(0,W.jsxs)(W.Fragment,{children:[(0,W.jsxs)(`span`,{className:`shrink-0 w-16 uppercase tracking-wider text-[10px] ${$c[e.decision]??`text-[var(--color-fg-3)]`}`,children:[el[e.decision]??`·`,` `,e.decision]}),(0,W.jsx)(`span`,{className:`text-[var(--color-fg-1)] shrink-0 w-24 truncate`,children:e.tool}),(0,W.jsx)(`span`,{className:`text-[var(--color-fg-4)] shrink-0 w-14 text-right tabular-nums`,children:Yc(e.duration_ns)}),e.rule_id&&(0,W.jsx)(`a`,{href:`/rules?highlight=${encodeURIComponent(e.rule_id)}`,className:`text-[var(--color-brand)]/80 hover:text-[var(--color-brand)] truncate transition-colors`,title:e.rule_id,children:e.rule_id})]})]},e.id))})})]}),(0,W.jsxs)(G,{children:[(0,W.jsx)(K,{children:(0,W.jsx)(`span`,{className:`overline`,children:`ai agent debug endpoints`})}),(0,W.jsxs)(q,{children:[(0,W.jsx)(`p`,{className:`text-[11px] font-mono text-[var(--color-fg-3)] mb-2.5`,children:`agents can query these endpoints directly for automated triage:`}),(0,W.jsx)(`div`,{className:`space-y-1 font-mono text-[11px]`,children:[[`/api/state/runtime`,`full metrics snapshot (cpu, memory, history, latency)`],[`/api/json/limits`,`resource limits config + breach state`],[`/api/state/activity-tail?after=0&limit=20`,`recent eval events`],[`/api/json/daemon-status`,`status, pid, log tail`],[`/healthz`,`process uptime`]].map(([e,t])=>(0,W.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,W.jsx)(`span`,{className:`text-[var(--color-fg-4)]`,children:`GET`}),(0,W.jsx)(`a`,{href:e,target:`_blank`,rel:`noreferrer`,className:`text-[var(--color-brand)]/80 hover:text-[var(--color-brand)] transition-colors`,children:e}),(0,W.jsxs)(`span`,{className:`text-[var(--color-fg-4)]`,children:[`— `,t]})]},e))})]})]})]})}function cl({cpuPct:e,cpuLimit:t,memMb:n,memLimit:r,decisions:a,latency:o,evalsTotal:s,burstBuffer:c}){let l=(0,v.useMemo)(()=>{if(c.length===0)return 0;let e=Date.now()-1e4;return c.filter(t=>t.ts_ms>=e).length/10},[c]);return(o?.p95_ns??0)/1e6,(o?.p50_ns??0)/1e6,(o?.p99_ns??0)/1e6,(0,W.jsxs)(`div`,{className:`grid-bleed rounded-sm border border-[var(--color-line-1)] bg-[var(--color-surface-1)] p-3`,children:[(0,W.jsxs)(`div`,{className:`grid grid-cols-1 lg:grid-cols-12 gap-4`,children:[(0,W.jsxs)(`div`,{className:`lg:col-span-3 flex flex-col items-center gap-2`,children:[(0,W.jsx)(qr,{mode:`ring`,value:e,max:100,warnAt:(t??90)/100*.7,critAt:(t??90)/100,display:`${e.toFixed(1)}%`,label:`cpu`,size:220}),(0,W.jsx)(xr,{value:e,width:260,height:56,windowMs:6e4,color:`#34d399`,fillColor:`rgba(52, 211, 153, 0.14)`,maxValue:100,className:`w-full`})]}),(0,W.jsxs)(`div`,{className:`lg:col-span-3 flex flex-col items-center gap-2`,children:[(0,W.jsx)(qr,{mode:`ring`,value:n,max:r??1024,warnAt:.7,critAt:.9,display:`${n.toFixed(0)} MB`,label:`memory`,size:220}),(0,W.jsx)(xr,{value:n,width:260,height:56,windowMs:6e4,color:`#38bdf8`,fillColor:`rgba(56, 189, 248, 0.14)`,maxValue:r?r*1.1:void 0,className:`w-full`})]}),(0,W.jsx)(`div`,{className:`lg:col-span-6`,children:(0,W.jsx)(ei,{latency:o,bursts:c,gaugeMaxMs:10,windowMs:3e4,trendWindowSec:60,gaugeSize:200})})]}),(0,W.jsxs)(`div`,{className:`mt-4 grid grid-cols-1 lg:grid-cols-2 gap-3`,children:[(0,W.jsx)(kr,{label:`Total Evals`,value:s,tone:`amber`,sub:`${l.toFixed(1)}/s`,burstRing:c}),(0,W.jsxs)(`div`,{className:`flex flex-col gap-2 rounded-sm border bg-[var(--color-surface-1)] border-[var(--color-line-1)] px-4 py-3`,children:[(0,W.jsxs)(`div`,{className:`flex items-baseline justify-between`,children:[(0,W.jsx)(`span`,{className:`overline`,children:`throughput · 60 s`}),(0,W.jsxs)(`span`,{className:`text-[10px] font-mono text-[var(--color-fg-3)] tabular-nums`,children:[l.toFixed(1),`/s`]})]}),(0,W.jsx)(xr,{value:l,width:420,height:56,windowMs:6e4,className:`w-full`})]})]}),a?(0,W.jsx)(`div`,{className:`mt-4 pt-3 border-t border-[var(--color-line-0)]`,children:(0,W.jsx)(ri,{counters:{allow:a.allow,block:a.block,ask:a.ask,log:a.log,force:a.force,shadow:a.shadow}})}):null,(0,W.jsxs)(`div`,{className:`mt-4 pt-3 border-t border-[var(--color-line-0)]`,children:[(0,W.jsxs)(`div`,{className:`flex items-center justify-between mb-2`,children:[(0,W.jsx)(`span`,{className:`overline`,children:`live event stream · newest first`}),(0,W.jsxs)(`span`,{className:`text-[10px] font-mono text-[var(--color-fg-3)]`,children:[c.length,` buffered · hover to pause`]})]}),(0,W.jsx)(hi,{variant:`decision`,bursts:c,windowSize:300,height:260})]})]})}var ll={ok:`green`,warn:`amber`,error:`red`,unknown:`gray`},ul={ok:`OK`,warn:`Warn`,error:`Error`,unknown:`Idle`};function dl({title:e,status:t=`unknown`,statusLabel:n,className:r,children:a}){return(0,W.jsxs)(G,{className:U(`flex flex-col`,r),children:[(0,W.jsxs)(K,{children:[(0,W.jsx)(`span`,{className:`overline text-[var(--color-fg-2)]`,children:e}),(0,W.jsx)(lr,{variant:ll[t],children:n??ul[t]})]}),(0,W.jsx)(q,{className:`flex flex-col gap-2 text-[12px]`,children:a})]})}function fl({label:e,value:t,mono:n=!1,tone:r}){return(0,W.jsxs)(`div`,{className:`flex items-baseline justify-between gap-3 border-b border-[var(--color-line-0)] last:border-b-0 py-1`,children:[(0,W.jsx)(`span`,{className:`text-[var(--color-fg-3)] uppercase tracking-wider text-[10px] font-mono`,children:e}),(0,W.jsx)(`span`,{className:U(n?`font-mono`:`font-sans`,`tabular-nums text-right truncate`,r===`good`?`text-emerald-300`:r===`warn`?`text-amber-300`:r===`bad`?`text-red-300`:`text-[var(--color-fg-1)]`),children:t})]})}function pl(e){return e===0?`0 B`:e<1024?`${e} B`:e<1024*1024?`${(e/1024).toFixed(1)} KB`:e<1024*1024*1024?`${(e/(1024*1024)).toFixed(2)} MB`:`${(e/(1024*1024*1024)).toFixed(2)} GB`}function ml(e){return e<1024?`${e}B`:e<1024*1024?`${(e/1024).toFixed(1)}KB`:`${(e/1024/1024).toFixed(1)}MB`}function hl(e){let t=Math.floor(e/1e3);if(t<60)return`${t}s`;let n=Math.floor(t/60);return n<60?`${n}m ${t%60}s`:`${Math.floor(n/60)}h ${n%60}m`}function gl(e){return e?new Date(e*1e3).toLocaleString():`—`}function _l(e){if(!e||e===0)return`never`;let t=Math.round((Date.now()-e)/1e3);if(t<5)return`just now`;if(t<60)return`${t}s ago`;let n=Math.floor(t/60);return n<60?`${n}m ago`:`${Math.floor(n/60)}h ago`}function vl({children:e,className:t}){return(0,W.jsx)(`div`,{className:`overline mb-2.5 ${t??``}`,children:e})}function yl({label:e,value:t,mono:n=!0,accent:r}){return(0,W.jsxs)(`div`,{className:`flex items-baseline justify-between gap-4 py-1.5 border-b border-[var(--color-line-0)] last:border-0`,children:[(0,W.jsx)(`span`,{className:`text-xs text-[var(--color-fg-3)] shrink-0 font-mono`,children:e}),(0,W.jsx)(`span`,{className:`text-xs text-right truncate max-w-[65%] ${n?`font-mono tabular-nums`:``} ${r??`text-[var(--color-fg-1)]`}`,children:t})]})}function bl({ok:e,label:t,badLabel:n}){return e?(0,W.jsx)(lr,{variant:`green`,children:t}):(0,W.jsx)(lr,{variant:`red`,children:n??t})}function xl({pct:e,total:t,max:n}){let r=e<60?`green`:e<85?`amber`:`red`,a=e>=85?`text-red-300`:e>=60?`text-amber-300`:`text-emerald-300`;return(0,W.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,W.jsxs)(`div`,{className:`flex items-center justify-between text-xs font-mono tabular-nums`,children:[(0,W.jsxs)(`span`,{className:`text-[var(--color-fg-3)]`,children:[t.toLocaleString(),` / `,n.toLocaleString(),` rows`]}),(0,W.jsxs)(`span`,{className:a,children:[e,`%`]})]}),(0,W.jsx)(Ms,{pct:e,tone:r,className:`h-1.5`})]})}var Sl=3e3,Cl={log:`text-[var(--color-fg-1)]`,info:`text-sky-300`,warn:`text-amber-300`,error:`text-red-300`,debug:`text-[var(--color-fg-3)]`};function wl(e){return e.value==null?e.description?e.description:`[${e.type}]`:String(e.value)}function Tl(){let e=yc(),[t,n]=(0,v.useState)(!1),[r,a]=(0,v.useState)(null),[o,s]=(0,v.useState)([]),[c,l]=(0,v.useState)(null),[u,d]=(0,v.useState)(!1),[f,p]=(0,v.useState)(!1),m=(0,v.useRef)(null),h=(0,v.useRef)(0),g=(0,v.useRef)(!0);(0,v.useEffect)(()=>{if(g.current){g.current=!1;return}let e=m.current;if(!e)return;let t=e.parentElement;t&&(t.scrollTop=t.scrollHeight)},[o]),(0,v.useEffect)(()=>{if(e.connected)return e.sendCommand(`Runtime.enable`).catch(()=>{}),e.onEvent(`Runtime.consoleAPICalled`,e=>{let t=e;s(e=>{let n=[...e,{id:h.current++,type:t.type??`log`,args:t.args??[],timestamp:t.timestamp??Date.now()}];return n.length>500?n.slice(-500):n})})},[e.connected]),(0,v.useEffect)(()=>{e.preconfiguredTarget&&!e.connected&&!e.connecting&&e.connect(e.preconfiguredTarget.id)},[e]),(0,v.useEffect)(()=>{!e.connected||f||t||r||(p(!0),(async()=>{try{await e.sendCommand(`Profiler.enable`),await e.sendCommand(`Profiler.start`),n(!0),setTimeout(async()=>{try{let t=await e.sendCommand(`Profiler.stop`);n(!1),a(t.profile)}catch{n(!1)}},Sl)}catch{}})(),e.sendCommand(`Runtime.evaluate`,{expression:`JSON.stringify(process.memoryUsage())`,returnByValue:!0}).then(e=>{l(JSON.parse(e.result.value))}).catch(()=>{}))},[e.connected,f,t,r]);let _=(0,v.useCallback)(async()=>{try{await e.sendCommand(`Profiler.enable`),await e.sendCommand(`Profiler.start`),n(!0),a(null)}catch(e){console.error(`Profiler.start failed:`,e)}},[e]),y=(0,v.useCallback)(async()=>{try{let t=await e.sendCommand(`Profiler.stop`);n(!1),a(t.profile)}catch(e){console.error(`Profiler.stop failed:`,e),n(!1)}},[e]),b=(0,v.useCallback)(async()=>{d(!0);try{let t=await e.sendCommand(`Runtime.evaluate`,{expression:`JSON.stringify(process.memoryUsage())`,returnByValue:!0});l(JSON.parse(t.result.value))}catch{}finally{d(!1)}},[e]),x=(0,v.useCallback)(()=>{e.preconfiguredTarget&&e.connect(e.preconfiguredTarget.id)},[e]);return e.active?e.connected?(0,W.jsxs)(`div`,{className:`space-y-5`,children:[(0,W.jsxs)(G,{children:[(0,W.jsxs)(K,{className:`flex items-center justify-between`,children:[(0,W.jsx)(`span`,{className:`overline`,children:`runtime inspector`}),(0,W.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,W.jsxs)(`span`,{className:`flex items-center gap-1.5 text-[11px] font-mono text-[var(--color-fg-2)]`,children:[(0,W.jsx)(`span`,{className:`inline-block w-1.5 h-1.5 rounded-full bg-emerald-400`}),`connected`,e.bunVersion?` · bun v${e.bunVersion}`:``]}),(0,W.jsx)(J,{variant:`ghost`,size:`sm`,onClick:e.disconnect,children:`disconnect`})]})]}),e.error&&(0,W.jsx)(q,{children:(0,W.jsx)(`p`,{className:`text-xs text-red-300 font-mono`,children:e.error})})]}),(0,W.jsxs)(G,{children:[(0,W.jsxs)(K,{className:`flex items-center justify-between`,children:[(0,W.jsx)(`span`,{className:`overline`,children:`cpu profiler`}),(0,W.jsxs)(`div`,{className:`flex items-center gap-2`,children:[t&&(0,W.jsxs)(`span`,{className:`text-[10px] font-mono uppercase tracking-wider text-red-300 flex items-center gap-1.5`,children:[(0,W.jsx)(`span`,{className:`inline-block w-1.5 h-1.5 rounded-full bg-red-400 pulse-soft`}),`recording`]}),t?(0,W.jsx)(J,{variant:`danger`,size:`sm`,onClick:y,children:`stop & render`}):(0,W.jsx)(J,{variant:`primary`,size:`sm`,onClick:_,children:`start recording`})]})]}),(0,W.jsx)(q,{children:r?(0,W.jsx)(Ps,{profile:r,children:(0,W.jsx)(`div`,{className:`bg-[var(--color-surface-0)] border border-[var(--color-line-1)] rounded-sm p-2 overflow-x-hidden`,children:(0,W.jsx)(Ec,{profile:r})})}):(0,W.jsx)(`p`,{className:`text-[11px] font-mono text-[var(--color-fg-3)]`,children:t?`recording cpu profile (auto-captures ${Sl/1e3}s)… perform actions in ssg to generate data.`:`click start recording, or wait for auto-capture on page load.`})})]}),(0,W.jsxs)(G,{children:[(0,W.jsxs)(K,{className:`flex items-center justify-between`,children:[(0,W.jsx)(`span`,{className:`overline`,children:`memory`}),(0,W.jsx)(J,{variant:`ghost`,size:`sm`,onClick:b,disabled:u,children:u?`…`:`refresh`})]}),(0,W.jsx)(q,{children:c?(0,W.jsx)(Fs,{memory:c,formatValue:ml}):(0,W.jsx)(`p`,{className:`text-[11px] font-mono text-[var(--color-fg-3)]`,children:f?`fetching memory metrics…`:`click refresh to fetch process.memoryUsage().`})})]}),(0,W.jsxs)(G,{children:[(0,W.jsxs)(K,{className:`flex items-center justify-between`,children:[(0,W.jsx)(`span`,{className:`overline`,children:`console`}),(0,W.jsx)(J,{variant:`ghost`,size:`sm`,onClick:()=>s([]),children:`clear`})]}),(0,W.jsx)(q,{children:(0,W.jsxs)(`div`,{className:`bg-[var(--color-surface-0)] border border-[var(--color-line-1)] rounded-sm p-2 h-40 overflow-y-auto font-mono text-[11px]`,children:[o.length===0?(0,W.jsx)(`p`,{className:`text-[var(--color-fg-4)]`,children:`console output will appear here…`}):o.map(e=>(0,W.jsxs)(`div`,{className:`py-0.5 border-b border-[var(--color-line-0)] ${Cl[e.type]??`text-[var(--color-fg-1)]`}`,children:[(0,W.jsxs)(`span`,{className:`text-[var(--color-fg-4)] mr-2 uppercase tracking-wider`,children:[`[`,e.type,`]`]}),e.args.map(wl).join(` `)]},e.id)),(0,W.jsx)(`div`,{ref:m})]})})]})]}):(0,W.jsxs)(G,{children:[(0,W.jsxs)(K,{className:`flex items-center justify-between`,children:[(0,W.jsx)(`span`,{className:`overline`,children:`runtime inspector`}),(0,W.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,W.jsx)(lr,{variant:`amber`,children:e.connecting?`connecting…`:`available`}),!e.connecting&&(0,W.jsx)(J,{variant:`ghost`,size:`sm`,onClick:x,children:`connect`})]})]}),(0,W.jsx)(q,{children:(0,W.jsx)(`p`,{className:`text-[11px] font-mono text-[var(--color-fg-4)]`,children:e.connecting?`establishing websocket connection to bun inspector…`:`inspector is active but not connected. click connect to start profiling.`})})]}):(0,W.jsxs)(G,{children:[(0,W.jsxs)(K,{className:`flex items-center justify-between`,children:[(0,W.jsx)(`span`,{className:`overline`,children:`runtime inspector`}),(0,W.jsx)(lr,{variant:`outline`,children:`inactive`})]}),(0,W.jsx)(q,{children:(0,W.jsxs)(`p`,{className:`text-[11px] font-mono text-[var(--color-fg-4)]`,children:[`the bun inspector is not active. restart`,` `,(0,W.jsx)(`code`,{className:`text-[var(--color-brand)]`,children:`ssg serve`}),` to enable it automatically.`]})})]})}function El(){let[e,t]=(0,v.useState)(0),{data:n}=z(`/api/json/evald-log`,[e]),r=(0,v.useRef)(null),a=(0,v.useRef)(!0);(0,v.useEffect)(()=>{let e=setInterval(()=>t(e=>e+1),5e3);return()=>clearInterval(e)},[]),(0,v.useEffect)(()=>{if(a.current){a.current=!1;return}let e=r.current;if(!e)return;let t=e.parentElement;t&&(t.scrollTop=t.scrollHeight)},[n?.lines.length]);let o=n?.lines??[];return(0,W.jsxs)(G,{children:[(0,W.jsxs)(K,{className:`flex items-center justify-between`,children:[(0,W.jsx)(`span`,{className:`overline`,children:`daemon log`}),(0,W.jsxs)(`span`,{className:`text-[10px] font-mono text-[var(--color-fg-4)] truncate max-w-[60%]`,children:[n?.path?n.path:`loading…`,` · last 200 lines · 5s refresh`]})]}),(0,W.jsxs)(q,{children:[n?.error&&(0,W.jsx)(`p`,{className:`text-xs text-red-300 font-mono mb-2`,children:n.error}),o.length===0&&!n?.error&&(0,W.jsx)(`div`,{className:`rounded-sm border border-dashed border-[var(--color-line-1)] bg-[var(--color-surface-0)] px-4 py-6 text-center`,children:(0,W.jsxs)(`p`,{className:`text-[11px] font-mono text-[var(--color-fg-4)]`,children:[`no log entries yet. start the daemon with`,` `,(0,W.jsx)(`code`,{className:`text-[var(--color-brand)]`,children:`ssg serve`}),` to generate log output.`]})}),o.length>0&&(0,W.jsxs)(`pre`,{className:`bg-[var(--color-surface-0)] border border-[var(--color-line-1)] rounded-sm p-3 text-[10px] text-[var(--color-fg-2)] overflow-x-auto whitespace-pre-wrap break-all max-h-80 overflow-y-auto font-mono leading-relaxed`,children:[o.join(`
|
|
19
|
+
`),(0,W.jsx)(`div`,{ref:r})]})]})]})}function Dl(){let e=je([`runtime-tick`,`rules-changed`]),{data:t,refetch:n}=z(`/api/json/observability`,[e[`runtime-tick`],e[`rules-changed`]]),[r,a]=(0,v.useState)(!1),[o,s]=(0,v.useState)(!1),[c,l]=(0,v.useState)(Date.now()),[u,d]=(0,v.useState)(`idle`),[f,p]=(0,v.useState)(``),[m,h]=(0,v.useState)(`idle`);(0,v.useEffect)(()=>{t&&l(Date.now())},[t]);let g=(0,v.useCallback)(async()=>{d(`loading`);try{let e=await(await fetch(`/api/rules/sync-to-db`,{method:`POST`,headers:Ae()})).json();if(e.ok){d(`done`);let t=(e.pruned_count??0)>0?` (${e.pruned_count} orphan(s) pruned)`:``;p((e.message??`synced ${e.synced} rules`)+t),n()}else d(`error`),p(e.error??`sync failed`)}catch(e){d(`error`),p(String(e))}},[n]),_=(0,v.useCallback)(async()=>{h(`loading`);try{await fetch(`/api/rules/force-reload`,{method:`POST`,headers:Ae()}),h(`done`),n(),setTimeout(()=>h(`idle`),3e3)}catch{h(`idle`)}},[n]),y=t?.db,b=t?.rules,x=t?.audit,S=t?.process,C=t?.flight_recorder,w=b?.drift_detected??!1;return(0,W.jsxs)(`div`,{className:`space-y-5`,children:[(0,W.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,W.jsxs)(`div`,{children:[(0,W.jsx)(`h1`,{className:`text-xl font-medium tracking-tight text-[var(--color-fg-0)]`,children:`Observability`}),(0,W.jsx)(`p`,{className:`text-[12px] font-mono text-[var(--color-fg-3)] mt-0.5`,children:`sqlite health · rule drift · runtime profiler · diagnostics`})]}),(0,W.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,W.jsxs)(`span`,{className:`text-[10px] font-mono text-[var(--color-fg-4)] tabular-nums`,children:[`refreshed `,_l(c)]}),(0,W.jsx)(J,{variant:`ghost`,size:`sm`,onClick:n,children:`refresh`})]})]}),(0,W.jsx)(Ol,{db:y,audit:x,proc:S,flight:C,driftDetected:w}),(0,W.jsxs)(G,{className:w?`border-red-500/30 border-l-2 border-l-red-500/70`:`border-emerald-500/20 border-l-2 border-l-emerald-500/60`,children:[(0,W.jsxs)(K,{className:`flex items-center justify-between`,children:[(0,W.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,W.jsx)(`span`,{className:`overline`,children:`rule drift detector`}),(0,W.jsx)(`span`,{className:`text-[10px] font-mono text-[var(--color-fg-4)]`,children:`— .rules files vs sqlite`}),(0,W.jsx)(`button`,{onClick:()=>s(e=>!e),"aria-expanded":o,"aria-label":`Explain these counts`,title:`Why do these numbers differ?`,className:`text-[10px] font-mono text-[var(--color-fg-4)] hover:text-[var(--color-fg-2)] border border-[var(--color-line-1)] rounded-sm px-1.5 py-0.5 transition-colors cursor-pointer`,children:o?`× close`:`? why these numbers`})]}),b&&(w?(0,W.jsx)(lr,{variant:`red`,children:`⚠ drift detected`}):(0,W.jsx)(lr,{variant:`green`,children:`✓ in sync`}))]}),(0,W.jsxs)(q,{children:[o&&(0,W.jsxs)(`div`,{className:`mb-4 rounded-sm border border-[var(--color-line-1)] bg-[var(--color-surface-0)] px-3 py-2.5 space-y-2 text-[11px] font-mono leading-relaxed text-[var(--color-fg-3)]`,children:[(0,W.jsxs)(`div`,{className:`text-[var(--color-fg-2)]`,children:[(0,W.jsx)(`code`,{children:`.rules files`}),` and `,(0,W.jsx)(`code`,{children:`db rules`}),` are`,` `,(0,W.jsx)(`span`,{className:`text-amber-300`,children:`not auto-synced`}),`. A mismatch is usually expected:`]}),(0,W.jsxs)(`ul`,{className:`space-y-1 pl-3 list-disc marker:text-[var(--color-fg-4)]`,children:[(0,W.jsxs)(`li`,{children:[(0,W.jsx)(`span`,{className:`text-[var(--color-fg-2)]`,children:`one file can hold many rules`}),` `,`— compare `,(0,W.jsx)(`code`,{children:`db rules`}),` against`,` `,(0,W.jsx)(`code`,{children:`file_rule_count`}),`, not `,(0,W.jsx)(`code`,{children:`file_count`}),`.`]}),(0,W.jsxs)(`li`,{children:[(0,W.jsx)(`span`,{className:`text-[var(--color-fg-2)]`,children:`only in files`}),` `,`means unsynced edits — run`,` `,(0,W.jsx)(`code`,{className:`text-amber-300`,children:`ssg sync`}),` or click`,` `,(0,W.jsx)(`code`,{children:`↑ sync files → db`}),`.`]}),(0,W.jsxs)(`li`,{children:[(0,W.jsx)(`span`,{className:`text-[var(--color-fg-2)]`,children:`only in db`}),` `,`with `,(0,W.jsx)(`code`,{children:`source_file IS NULL`}),` is healthy — hub, fleet, or cloud-synced rules legitimately live only in the db.`]}),(0,W.jsxs)(`li`,{children:[(0,W.jsx)(`span`,{className:`text-[var(--color-fg-2)]`,children:`only in db`}),` `,`with `,(0,W.jsx)(`code`,{children:`source_file`}),` set means an orphan from a deleted file — `,(0,W.jsx)(`code`,{className:`text-amber-300`,children:`ssg sync`}),` `,`prunes it.`]}),(0,W.jsxs)(`li`,{children:[(0,W.jsx)(`span`,{className:`text-[var(--color-fg-2)]`,children:`db rules`}),` `,`includes disabled rows; `,(0,W.jsx)(`code`,{children:`db_enabled_count`}),` `,`excludes them.`]})]}),(0,W.jsxs)(`div`,{className:`pt-1.5 border-t border-[var(--color-line-0)]`,children:[`full reference:`,` `,(0,W.jsx)(`a`,{href:`https://docs.sigmashake.com/rule-storage`,target:`_blank`,rel:`noopener noreferrer`,className:`text-[var(--color-fg-2)] underline decoration-dotted underline-offset-2 hover:text-amber-300 transition-colors`,children:`docs.sigmashake.com/rule-storage ↗`})]})]}),b?(0,W.jsxs)(`div`,{className:`space-y-4`,children:[(0,W.jsx)(`div`,{className:`grid grid-cols-2 sm:grid-cols-4 gap-2`,children:[{label:`.rules files`,value:b.file_count,sub:`${b.file_rule_count} rules total`,tone:`neutral`},{label:`db rules`,value:b.db_rule_count,sub:`${b.db_enabled_count} enabled`,tone:`neutral`},{label:`only in files`,value:b.drift_details.only_in_files.length,tone:b.drift_details.only_in_files.length>0?`amber`:`gray`},{label:`only in db`,value:b.drift_details.only_in_db.length,tone:b.drift_details.only_in_db.length>0?`red`:`gray`}].map(({label:e,value:t,sub:n,tone:r})=>(0,W.jsx)(js,{className:`rounded-sm border border-[var(--color-line-1)] bg-[var(--color-surface-0)]`,label:e,value:t,sub:n,tone:r,labelPlacement:`above`,subClassName:`text-[var(--color-fg-4)]`,valueClassName:`text-xl font-medium tabular-nums`},e))}),w&&(0,W.jsxs)(`div`,{children:[(0,W.jsxs)(`button`,{onClick:()=>a(e=>!e),className:`text-[10px] font-mono uppercase tracking-wider text-amber-300 hover:text-amber-200 flex items-center gap-1 transition-colors cursor-pointer`,children:[r?`▾`:`▸`,` view drift details`]}),r&&(0,W.jsxs)(`div`,{className:`mt-3 space-y-3`,children:[b.drift_details.only_in_files.length>0&&(0,W.jsxs)(`div`,{children:[(0,W.jsxs)(`div`,{className:`text-[10px] font-mono uppercase tracking-wider text-amber-300/80 mb-1.5`,children:[`in .rules files but not in db — run`,` `,(0,W.jsx)(`code`,{className:`text-amber-300`,children:`ssg sync`})]}),(0,W.jsx)(`div`,{className:`bg-[var(--color-surface-0)] border border-amber-400/20 rounded-sm p-2 space-y-0.5 max-h-40 overflow-y-auto`,children:b.drift_details.only_in_files.map(e=>(0,W.jsxs)(`div`,{className:`font-mono text-[11px] text-amber-200/80`,children:[`+ `,e]},e))})]}),b.drift_details.only_in_db.length>0&&(0,W.jsxs)(`div`,{children:[(0,W.jsx)(`div`,{className:`text-[10px] font-mono uppercase tracking-wider text-red-300/80 mb-1.5`,children:`in db but not in any .rules file — orphaned rules`}),(0,W.jsx)(`div`,{className:`bg-[var(--color-surface-0)] border border-red-400/20 rounded-sm p-2 space-y-0.5 max-h-40 overflow-y-auto`,children:b.drift_details.only_in_db.map(e=>(0,W.jsxs)(`div`,{className:`font-mono text-[11px] text-red-200/80`,children:[`− `,e]},e))})]})]})]}),(0,W.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2 pt-3 border-t border-[var(--color-line-0)]`,children:[(0,W.jsx)(J,{variant:`primary`,size:`sm`,onClick:g,disabled:u===`loading`,children:u===`loading`?`syncing…`:`↑ sync files → db`}),(0,W.jsx)(J,{variant:`ghost`,size:`sm`,onClick:_,disabled:m===`loading`,children:m===`loading`?`…`:m===`done`?`✓ reloaded`:`↻ force reload`}),(0,W.jsx)(`span`,{className:`text-[10px] font-mono text-[var(--color-fg-4)] ml-auto`,children:b.db_rule_count===0?`⚠ db empty — daemon falls back to file-based loading`:`db has ${b.db_rule_count} rules — indexed queries`})]}),u===`done`&&(0,W.jsxs)(`div`,{className:`flex items-center justify-between rounded-sm border border-emerald-500/25 bg-emerald-500/[0.06] px-3 py-2 text-xs font-mono text-emerald-200`,children:[(0,W.jsxs)(`span`,{children:[`✓ `,f]}),(0,W.jsx)(`button`,{onClick:()=>d(`idle`),className:`ml-3 shrink-0 px-2 py-0.5 rounded-sm border border-emerald-500/30 hover:bg-emerald-500/10 transition-colors cursor-pointer uppercase tracking-wider text-[10px]`,children:`dismiss`})]}),u===`error`&&(0,W.jsxs)(`div`,{className:`flex items-center justify-between rounded-sm border border-red-500/25 bg-red-500/[0.06] px-3 py-2 text-xs font-mono text-red-200`,children:[(0,W.jsxs)(`span`,{children:[`✗ `,f]}),(0,W.jsx)(`button`,{onClick:()=>d(`idle`),className:`ml-3 shrink-0 px-2 py-0.5 rounded-sm border border-red-500/30 hover:bg-red-500/10 transition-colors cursor-pointer uppercase tracking-wider text-[10px]`,children:`dismiss`})]}),(0,W.jsxs)(`div`,{className:`flex items-center gap-4 text-[11px] font-mono text-[var(--color-fg-4)] pt-2 border-t border-[var(--color-line-0)]`,children:[(0,W.jsxs)(`span`,{children:[`rules dir:`,` `,(0,W.jsx)(`span`,{className:`text-[var(--color-fg-2)]`,children:b.rules_dir})]}),(0,W.jsxs)(`span`,{className:`ml-auto`,children:[`last reload:`,` `,(0,W.jsx)(`span`,{className:`text-[var(--color-fg-2)]`,children:_l(b.last_reload_at)})]})]})]}):(0,W.jsx)(`p`,{className:`text-[11px] font-mono text-[var(--color-fg-4)]`,children:`loading…`})]})]}),(0,W.jsxs)(`div`,{className:`grid grid-cols-1 lg:grid-cols-2 gap-5`,children:[(0,W.jsxs)(G,{children:[(0,W.jsxs)(K,{className:`flex items-center justify-between`,children:[(0,W.jsx)(`span`,{className:`overline`,children:`sqlite database`}),y&&!y.error&&(0,W.jsxs)(`div`,{className:`flex items-center gap-1.5`,children:[(0,W.jsx)(bl,{ok:y.journal_mode===`wal`,label:`wal`,badLabel:`no wal`}),(0,W.jsx)(bl,{ok:y.synchronous===`NORMAL`,label:`normal`,badLabel:y.synchronous})]})]}),(0,W.jsx)(q,{children:y?y.error?(0,W.jsx)(`div`,{className:`text-xs text-red-300 font-mono bg-red-500/[0.06] border border-red-500/25 rounded-sm p-2`,children:y.error}):(0,W.jsxs)(`div`,{children:[(0,W.jsx)(vl,{children:`storage`}),(0,W.jsx)(yl,{label:`file path`,value:y.path}),(0,W.jsx)(yl,{label:`file size`,value:pl(y.file_size_bytes)}),(0,W.jsx)(yl,{label:`allocated`,value:`${pl(y.allocated_bytes)} (${y.page_count.toLocaleString()} pages × ${y.page_size}B)`}),(0,W.jsx)(vl,{className:`mt-4`,children:`pragma configuration`}),(0,W.jsx)(yl,{label:`journal_mode`,value:y.journal_mode,accent:y.journal_mode===`wal`?`text-emerald-300`:`text-amber-300`}),(0,W.jsx)(yl,{label:`synchronous`,value:y.synchronous,accent:y.synchronous===`NORMAL`?`text-emerald-300`:`text-amber-300`}),(0,W.jsx)(yl,{label:`cache_size`,value:`${y.cache_size_kb.toLocaleString()} KB (${Math.round(y.cache_size_kb/1024)} MB)`}),(0,W.jsx)(yl,{label:`page_size`,value:`${y.page_size.toLocaleString()} B`}),y.wal_checkpoint&&(0,W.jsx)(yl,{label:`wal checkpoint`,value:`log ${y.wal_checkpoint.log}, checkpointed ${y.wal_checkpoint.checkpointed}, busy ${y.wal_checkpoint.busy}`}),(0,W.jsx)(vl,{className:`mt-4`,children:`table row counts`}),y.tables.map(e=>(0,W.jsx)(yl,{label:e.name,value:e.row_count>=0?e.row_count.toLocaleString():`error`,accent:e.row_count<0?`text-red-300`:`text-[var(--color-fg-1)]`},e.name))]}):(0,W.jsx)(`p`,{className:`text-[11px] font-mono text-[var(--color-fg-4)]`,children:`loading…`})})]}),(0,W.jsxs)(`div`,{className:`space-y-5`,children:[(0,W.jsxs)(G,{children:[(0,W.jsx)(K,{children:(0,W.jsx)(`span`,{className:`overline`,children:`audit log capacity`})}),(0,W.jsx)(q,{children:x?(0,W.jsxs)(`div`,{className:`space-y-4`,children:[(0,W.jsx)(xl,{pct:x.utilization_pct,total:x.total_rows,max:x.max_rows}),(0,W.jsxs)(`div`,{children:[(0,W.jsx)(yl,{label:`total rows`,value:x.total_rows.toLocaleString()}),(0,W.jsx)(yl,{label:`rotation limit`,value:x.max_rows.toLocaleString()}),(0,W.jsx)(yl,{label:`utilization`,value:`${x.utilization_pct}%`,accent:x.utilization_pct>=85?`text-red-300`:x.utilization_pct>=60?`text-amber-300`:`text-emerald-300`}),(0,W.jsx)(yl,{label:`oldest entry`,value:gl(x.oldest_timestamp)}),(0,W.jsx)(yl,{label:`newest entry`,value:gl(x.newest_timestamp)})]}),x.utilization_pct>=85&&(0,W.jsx)(`div`,{className:`rounded-sm border border-red-500/25 bg-red-500/[0.06] px-3 py-2 text-[11px] font-mono text-red-200`,children:`⚠ audit log nearing rotation limit. oldest entries will be purged automatically.`})]}):(0,W.jsx)(`p`,{className:`text-[11px] font-mono text-[var(--color-fg-4)]`,children:`loading…`})})]}),(0,W.jsxs)(G,{children:[(0,W.jsx)(K,{children:(0,W.jsx)(`span`,{className:`overline`,children:`process & runtime`})}),(0,W.jsx)(q,{children:S?(0,W.jsxs)(`div`,{children:[(0,W.jsx)(yl,{label:`pid`,value:S.pid}),(0,W.jsx)(yl,{label:`uptime`,value:hl(S.uptime_ms)}),(0,W.jsx)(yl,{label:`memory (rss)`,value:`${S.memory_rss_mb} MB`}),(0,W.jsx)(yl,{label:`bun version`,value:S.bun_version}),(0,W.jsx)(yl,{label:`node compat`,value:S.node_version}),(0,W.jsx)(yl,{label:`platform`,value:`${S.platform} / ${S.arch}`})]}):(0,W.jsx)(`p`,{className:`text-[11px] font-mono text-[var(--color-fg-4)]`,children:`loading…`})})]})]})]}),(0,W.jsxs)(G,{children:[(0,W.jsx)(K,{children:(0,W.jsx)(`span`,{className:`overline`,children:`flight recorder`})}),(0,W.jsx)(q,{children:C?(0,W.jsxs)(`div`,{className:`grid grid-cols-3 gap-4`,children:[(0,W.jsxs)(`div`,{children:[(0,W.jsx)(`div`,{className:`overline mb-1.5`,children:`log file`}),(0,W.jsx)(`div`,{className:`text-xs font-mono text-[var(--color-fg-1)] truncate`,children:`…${C.path.slice(-50)}`})]}),(0,W.jsxs)(`div`,{children:[(0,W.jsx)(`div`,{className:`overline mb-1.5`,children:`file size`}),(0,W.jsx)(`div`,{className:`text-xs font-mono tabular-nums ${C.file_size_bytes===0?`text-[var(--color-fg-4)]`:`text-[var(--color-fg-1)]`}`,children:pl(C.file_size_bytes)})]}),(0,W.jsxs)(`div`,{children:[(0,W.jsx)(`div`,{className:`overline mb-1.5`,children:`approx. entries`}),(0,W.jsx)(`div`,{className:`text-xs font-mono tabular-nums ${C.approx_entries===0?`text-[var(--color-fg-4)]`:`text-[var(--color-fg-1)]`}`,children:C.approx_entries===0?`—`:C.approx_entries.toLocaleString()})]})]}):(0,W.jsx)(`p`,{className:`text-[11px] font-mono text-[var(--color-fg-4)]`,children:`loading…`})})]}),(0,W.jsx)(Tl,{}),(0,W.jsx)(El,{}),(0,W.jsxs)(G,{children:[(0,W.jsx)(K,{children:(0,W.jsx)(`span`,{className:`overline`,children:`observability api`})}),(0,W.jsxs)(q,{children:[(0,W.jsx)(`p`,{className:`text-[11px] font-mono text-[var(--color-fg-3)] mb-2.5`,children:`machine-readable endpoints for automated monitoring and ai agent triage:`}),(0,W.jsx)(`div`,{className:`space-y-1 font-mono text-[11px]`,children:[[`/api/json/observability`,`sqlite health, rule drift, process info`],[`/api/state/runtime`,`eval latency, decision counters, memory`],[`/api/state/activity-tail?after=0&limit=20`,`recent eval events (live feed)`],[`/api/json/daemon-status`,`daemon pid, status, log tail`],[`/api/json/evald-log`,`last 200 lines of evald.log (daemon stderr)`],[`/healthz`,`process liveness`],[`/readyz`,`sqlite liveness`]].map(([e,t])=>(0,W.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,W.jsx)(`span`,{className:`text-[var(--color-fg-4)]`,children:`GET`}),(0,W.jsx)(`a`,{href:e,target:`_blank`,rel:`noreferrer`,className:`text-[var(--color-brand)]/80 hover:text-[var(--color-brand)] transition-colors`,children:e}),(0,W.jsxs)(`span`,{className:`text-[var(--color-fg-4)] hidden sm:inline`,children:[`— `,t]})]},e))})]})]})]})}function Ol({db:e,audit:t,proc:n,flight:r,driftDetected:a}){let o=e?e.error?`error`:e.journal_mode===`wal`&&e.synchronous===`NORMAL`?`ok`:`warn`:`unknown`,s=t?t.utilization_pct>=85?`error`:t.utilization_pct>=60?`warn`:`ok`:`unknown`,c=n?n.memory_rss_mb>600?`warn`:`ok`:`unknown`;return(0,W.jsxs)(`div`,{className:`grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-4 gap-4`,children:[(0,W.jsxs)(dl,{title:`sqlite`,status:o,statusLabel:e?.journal_mode?.toUpperCase()??`idle`,children:[(0,W.jsx)(fl,{label:`size`,value:e?(0,W.jsx)(mr,{value:e.file_size_bytes,format:e=>ml(e)}):`—`,mono:!0}),(0,W.jsx)(fl,{label:`journal`,value:e?.journal_mode??`—`,mono:!0}),(0,W.jsx)(fl,{label:`sync`,value:e?.synchronous??`—`,mono:!0}),(0,W.jsx)(fl,{label:`tables`,value:e?.tables.length??0,tone:a?`warn`:`neutral`})]}),(0,W.jsxs)(dl,{title:`audit log`,status:s,statusLabel:t?`${t.utilization_pct}%`:`idle`,children:[(0,W.jsx)(fl,{label:`rows`,value:t?(0,W.jsx)(mr,{value:t.total_rows}):`—`}),(0,W.jsx)(fl,{label:`capacity`,value:t?`${(t.total_rows/Math.max(1,t.max_rows)*100).toFixed(1)}%`:`—`,tone:t&&t.utilization_pct>=85?`bad`:t&&t.utilization_pct>=60?`warn`:`good`}),(0,W.jsx)(fl,{label:`oldest`,value:gl(t?.oldest_timestamp??null),mono:!0}),(0,W.jsx)(fl,{label:`newest`,value:gl(t?.newest_timestamp??null),mono:!0})]}),(0,W.jsxs)(dl,{title:`process`,status:c,statusLabel:n?`pid ${n.pid}`:`idle`,children:[(0,W.jsx)(fl,{label:`uptime`,value:n?hl(n.uptime_ms):`—`,mono:!0}),(0,W.jsx)(fl,{label:`rss`,value:n?(0,W.jsxs)(`span`,{children:[(0,W.jsx)(mr,{value:n.memory_rss_mb,format:e=>e.toFixed(0)}),(0,W.jsx)(`span`,{className:`text-[var(--color-fg-3)] ml-1`,children:`MB`})]}):`—`}),(0,W.jsx)(fl,{label:`bun`,value:n?.bun_version??`—`,mono:!0}),(0,W.jsx)(fl,{label:`platform`,value:n?`${n.platform}/${n.arch}`:`—`,mono:!0})]}),(0,W.jsxs)(dl,{title:`flight recorder`,status:r&&r.file_size_bytes>0?`ok`:`unknown`,statusLabel:r?`${r.approx_entries.toLocaleString()} entries`:`idle`,children:[(0,W.jsx)(fl,{label:`size`,value:r?(0,W.jsx)(mr,{value:r.file_size_bytes,format:e=>ml(e)}):`—`,mono:!0}),(0,W.jsx)(fl,{label:`entries`,value:r?(0,W.jsx)(mr,{value:r.approx_entries}):`—`})]})]})}function kl(e){let{sessionKey:t,bursts:n,paused:r,selectedId:a,onSelect:o,burstSeq:s,layout:c,isStale:l,isFadingOut:u,minHeight:d,pinned:f,minimized:p,isFullscreen:m,broadcast:h=!1,onTogglePin:g,onToggleMinimize:_,onToggleFullscreen:y,onFrameTime:b}=e,x=t.indexOf(`:`),S=x>=0?t.slice(0,x):t,C=x>=0?t.slice(x+1):``,w=(0,v.useRef)(null),[T,E]=(0,v.useState)(!0),D=()=>{let e=w.current;if(!e)return;let n=e.querySelector(`canvas`);n instanceof HTMLCanvasElement&&n.toBlob(e=>{if(!e)return;let n=URL.createObjectURL(e),r=document.createElement(`a`),a=t.replace(/[^a-z0-9._-]+/gi,`-`);r.href=n,r.download=`ssg-graph-${a}-${Date.now()}.png`,document.body.appendChild(r),r.click(),r.remove(),URL.revokeObjectURL(n)},`image/png`)};(0,v.useEffect)(()=>{if(m){E(!0);return}let e=w.current;if(!e)return;let t=new IntersectionObserver(e=>{for(let t of e)E(t.isIntersecting)},{threshold:.01});return t.observe(e),()=>t.disconnect()},[m]);let O=n.length>0?n[n.length-1]:null,k=O?za[O.decision]??`#6b7280`:`#6b7280`,A=O?.decision??null,ee=O?.tool??null,j=r||!T||p;return(0,W.jsxs)(`div`,{ref:w,className:`flex flex-col shrink-0 rounded-sm border border-[var(--color-line-1)] bg-[var(--color-surface-1)] overflow-hidden transition-opacity duration-1000${m?` flex-1 min-h-0`:``}`,style:{minHeight:p||m?void 0:d,opacity:u?0:1},children:[!h&&(0,W.jsxs)(`header`,{className:`flex items-center justify-between px-3 py-1.5 border-b border-[var(--color-line-1)] bg-black/30 shrink-0 gap-3`,children:[(0,W.jsxs)(`div`,{className:`flex items-center gap-2 text-[11px] font-mono min-w-0`,children:[f&&(0,W.jsx)(`span`,{className:`text-amber-300`,title:`Pinned`,children:`▲`}),(0,W.jsx)(`span`,{className:`text-[var(--color-fg-2)] uppercase tracking-wider`,children:S}),C&&(0,W.jsxs)(W.Fragment,{children:[(0,W.jsx)(`span`,{className:`text-[var(--color-fg-4)]`,children:`·`}),(0,W.jsx)(`span`,{className:`text-[var(--color-fg-3)] truncate`,children:C})]})]}),(0,W.jsxs)(`div`,{className:`flex items-center gap-2 text-[11px] font-mono text-[var(--color-fg-4)]`,children:[ee&&(0,W.jsxs)(`span`,{className:`flex items-center gap-1.5 max-w-[180px]`,title:A?`latest: ${ee} → ${A}`:`latest: ${ee}`,children:[(0,W.jsx)(`span`,{className:`w-1.5 h-1.5 rounded-full shrink-0`,style:{background:k}}),(0,W.jsx)(`span`,{className:`truncate text-[var(--color-fg-2)]`,children:ee})]}),(0,W.jsxs)(`span`,{className:`hidden sm:inline`,children:[n.length,`n`]}),l?(0,W.jsxs)(`span`,{className:`flex items-center gap-1.5 text-amber-300`,children:[(0,W.jsx)(`span`,{className:`status-dot bg-amber-400`}),`idle`]}):(0,W.jsxs)(`span`,{className:`flex items-center gap-1.5 text-emerald-300`,children:[(0,W.jsx)(`span`,{className:`status-dot bg-emerald-400 pulse-soft`}),`live`]}),(0,W.jsxs)(`div`,{className:`flex items-center gap-1 ml-1`,children:[(0,W.jsx)(`button`,{type:`button`,onClick:g,className:`px-1.5 py-0.5 rounded border text-[10px] uppercase tracking-wider transition-colors ${f?`border-amber-500/60 text-amber-300`:`border-[var(--color-line-1)] text-[var(--color-fg-3)] hover:text-amber-300 hover:border-amber-500/40`}`,title:f?`Unpin`:`Pin to top`,children:`pin`}),(0,W.jsx)(`button`,{type:`button`,onClick:_,className:`px-1.5 py-0.5 rounded border border-[var(--color-line-1)] text-[10px] text-[var(--color-fg-3)] hover:text-sky-300 hover:border-sky-500/40 transition-colors`,title:p?`Expand`:`Minimize`,children:p?`+`:`–`}),(0,W.jsx)(`button`,{type:`button`,onClick:D,className:`px-1.5 py-0.5 rounded border border-[var(--color-line-1)] text-[10px] text-[var(--color-fg-3)] hover:text-sky-300 hover:border-sky-500/40 transition-colors`,title:`Download PNG snapshot of this panel`,children:`▣`}),(0,W.jsx)(`button`,{type:`button`,onClick:y,className:`px-1.5 py-0.5 rounded border border-[var(--color-line-1)] text-[10px] text-[var(--color-fg-3)] hover:text-sky-300 hover:border-sky-500/40 transition-colors`,title:m?`Exit fullscreen`:`Fullscreen`,children:m?`×`:`⛶`})]})]})]}),!p&&(0,W.jsx)(`div`,{className:`flex-1 min-h-0 relative`,children:(0,W.jsx)(qo,{bursts:n,paused:j,selectedId:a,onSelect:o,burstSeq:s,layout:c,compact:!0,onFrameTime:b})})]})}function Al(e){let{playback:t,bursts:n,rangeStart:r,rangeEnd:a,loading:o,onPlayhead:s,onLive:c,onPause:l,onResume:u,on24h:d}=e,f=(0,v.useRef)(null),p=(0,v.useRef)(!1),m=Math.max(1,a-r),h=(t.playhead_ms-r)/m*100,g=Math.max(0,Math.min(100,h)),_=(0,v.useMemo)(()=>{let e=[];for(let t=0;t<200;t++)e.push({allow:0,block:0,ask:0,other:0});for(let t of n){let n=t.ts_ms;if(n<r||n>a)continue;let o=e[Math.floor((n-r)/m*199)];t.decision===`allow`?o.allow++:t.decision===`block`||t.decision===`force`?o.block++:t.decision===`ask`?o.ask++:o.other++}return e},[n,r,a,m]),y=(0,v.useCallback)(e=>{let t=f.current;if(!t)return;let n=t.getBoundingClientRect();s(r+Math.max(0,Math.min(1,(e-n.left)/n.width))*m)},[r,m,s]);(0,v.useEffect)(()=>{let e=e=>{p.current&&y(e.clientX)},t=()=>{p.current=!1};return window.addEventListener(`pointermove`,e),window.addEventListener(`pointerup`,t),()=>{window.removeEventListener(`pointermove`,e),window.removeEventListener(`pointerup`,t)}},[y]);let b=t.mode===`live`;return(0,W.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,W.jsxs)(`div`,{className:`flex items-center gap-2 text-[11px] font-mono uppercase tracking-wider`,children:[(0,W.jsx)(`button`,{onClick:()=>b?l():u(),className:`px-2.5 py-1 rounded-sm border transition-colors cursor-pointer ${b?`border-emerald-500/40 text-emerald-300 hover:bg-emerald-500/10`:`border-amber-500/40 text-amber-300 hover:bg-amber-500/10`}`,title:b?`Pause the live stream`:`Resume updates at this playhead`,children:b?`⏸ pause`:`▶ resume`}),(0,W.jsx)(`button`,{onClick:c,disabled:b,className:`px-2.5 py-1 rounded-sm border transition-colors cursor-pointer ${b?`border-[var(--color-line-1)] text-[var(--color-fg-4)] opacity-50`:`border-sky-500/40 text-sky-300 hover:bg-sky-500/10`}`,title:`Jump to live (now)`,children:`⏭ live`}),(0,W.jsx)(`button`,{onClick:d,className:`px-2.5 py-1 rounded-sm border border-violet-500/40 text-violet-300 hover:bg-violet-500/10 transition-colors cursor-pointer`,title:`Expand to last 24h — window covers now−24h through now. Backfills audit_log so the scrubber shows all recent evals.`,children:`◉ 24h`}),(0,W.jsx)(`div`,{className:`flex-1`}),(0,W.jsx)(`span`,{className:`text-[var(--color-fg-4)]`,children:`mode`}),(0,W.jsx)(`span`,{className:b?`text-emerald-300`:t.mode===`paused`?`text-amber-300`:`text-violet-300`,children:t.mode}),o&&(0,W.jsx)(`span`,{className:`text-[var(--color-fg-4)] animate-pulse`,children:`· backfilling`}),(0,W.jsxs)(`span`,{className:`text-[var(--color-fg-4)]`,children:[`· t=`,jl(t.playhead_ms)]})]}),(0,W.jsxs)(`div`,{ref:f,className:`relative h-10 w-full rounded-sm border border-[var(--color-line-1)] bg-[var(--color-surface-1)] cursor-pointer overflow-hidden select-none`,onPointerDown:e=>{p.current=!0,e.target.setPointerCapture?.(e.pointerId),y(e.clientX)},children:[(0,W.jsx)(`svg`,{viewBox:`0 0 200 40`,preserveAspectRatio:`none`,className:`absolute inset-0 w-full h-full`,"aria-hidden":!0,children:_.map((e,t)=>{let n=e.allow+e.block+e.ask+e.other;if(n===0)return null;let r=Math.min(32,n*3),a=e.block>0?za.block:e.ask>0?za.ask:za.allow;return(0,W.jsx)(`rect`,{x:t,y:40-r,width:.9,height:r,fill:a,opacity:.7},t)})}),(0,W.jsx)(`div`,{className:`absolute top-0 bottom-0 w-px bg-sky-300 pointer-events-none`,style:{left:`${g}%`},children:(0,W.jsx)(`div`,{className:`absolute -top-0.5 -translate-x-1/2 w-2 h-2 rotate-45 bg-sky-300`})}),b&&(0,W.jsx)(`div`,{className:`absolute top-0 right-0 bottom-0 w-[2px] bg-emerald-400 animate-pulse pointer-events-none`})]}),(0,W.jsxs)(`div`,{className:`flex items-center justify-between text-[10px] font-mono text-[var(--color-fg-4)]`,children:[(0,W.jsx)(`span`,{children:Ml(r)}),(0,W.jsxs)(`span`,{className:`uppercase tracking-wider`,children:[Nl(t.window_ms),` window`]}),(0,W.jsx)(`span`,{children:Ml(a)})]})]})}function jl(e){let t=Date.now()-e;if(Math.abs(t)<1500)return`live`;let n=Math.round(t/1e3);if(n<60)return`−${n}s`;let r=Math.floor(n/60);return r<60?`−${r}m${n%60}s`:`−${Math.floor(r/60)}h${r%60}m`}function Ml(e){return new Date(e).toLocaleTimeString([],{hour:`2-digit`,minute:`2-digit`,second:`2-digit`})}function Nl(e){return e<6e4?`${Math.round(e/1e3)}s`:e<36e5?`${Math.round(e/6e4)}m`:`${Math.round(e/36e5)}h`}function Pl(e){let{burst:t,onClose:n}=e;if(!t)return(0,W.jsxs)(`div`,{className:`flex flex-col items-center justify-center py-10 text-center`,children:[(0,W.jsx)(`p`,{className:`overline mb-2 text-[var(--color-fg-3)]`,children:`node · none`}),(0,W.jsx)(`p`,{className:`text-[11px] font-mono text-[var(--color-fg-4)]`,children:`click a node to inspect`})]});let r=za[t.decision]??`#6b7280`,a=t.duration_ns/1e6,o=Date.now()-t.ts_ms;return(0,W.jsxs)(`div`,{className:`flex flex-col gap-3 text-[12px] font-mono`,children:[(0,W.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,W.jsx)(`span`,{className:`overline text-[var(--color-fg-3)]`,children:`node · inspect`}),(0,W.jsx)(`button`,{onClick:n,className:`text-[var(--color-fg-4)] hover:text-[var(--color-fg-1)] cursor-pointer`,title:`Close inspector`,children:`✕`})]}),(0,W.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,W.jsx)(`span`,{className:`w-2 h-2 rounded-full`,style:{background:r},"aria-hidden":!0}),(0,W.jsx)(`span`,{className:`uppercase tracking-wider`,style:{color:r},children:t.decision}),(0,W.jsx)(`span`,{className:`text-[var(--color-fg-4)]`,children:`·`}),(0,W.jsx)(`span`,{className:`text-[var(--color-fg-1)]`,children:t.tool})]}),(0,W.jsxs)(`dl`,{className:`grid grid-cols-[auto_1fr] gap-x-3 gap-y-1 text-[11px]`,children:[(0,W.jsx)(`dt`,{className:`text-[var(--color-fg-4)]`,children:`rule`}),(0,W.jsx)(`dd`,{className:`text-[var(--color-fg-2)] break-all`,children:t.rule_id??`—`}),(0,W.jsx)(`dt`,{className:`text-[var(--color-fg-4)]`,children:`client`}),(0,W.jsx)(`dd`,{className:`text-[var(--color-fg-2)]`,children:t.client}),(0,W.jsx)(`dt`,{className:`text-[var(--color-fg-4)]`,children:`agent`}),(0,W.jsx)(`dd`,{className:`text-[var(--color-fg-2)]`,children:t.agent_id?(0,W.jsx)(`span`,{className:`chip text-violet-300 border-violet-500/30`,children:t.agent_id}):(0,W.jsx)(`span`,{className:`text-[var(--color-fg-4)]`,children:`—`})}),(0,W.jsx)(`dt`,{className:`text-[var(--color-fg-4)]`,children:`duration`}),(0,W.jsx)(`dd`,{className:`text-[var(--color-fg-2)]`,children:a<1?`${(a*1e3).toFixed(0)}µs`:`${a.toFixed(2)}ms`}),(0,W.jsx)(`dt`,{className:`text-[var(--color-fg-4)]`,children:`age`}),(0,W.jsx)(`dd`,{className:`text-[var(--color-fg-2)]`,children:Fl(o)}),(0,W.jsx)(`dt`,{className:`text-[var(--color-fg-4)]`,children:`timestamp`}),(0,W.jsx)(`dd`,{className:`text-[var(--color-fg-2)]`,children:new Date(t.ts_ms).toLocaleString()})]}),t.input_preview&&(0,W.jsxs)(`div`,{children:[(0,W.jsx)(`div`,{className:`overline text-[var(--color-fg-3)] mb-1`,children:`input`}),(0,W.jsx)(`pre`,{className:`bg-[var(--color-surface-0)] border border-[var(--color-line-0)] rounded-sm p-2 text-[10px] text-[var(--color-fg-2)] whitespace-pre-wrap break-all max-h-48 overflow-y-auto`,children:t.input_preview})]}),(0,W.jsxs)(`div`,{className:`flex flex-wrap gap-1`,children:[t.audit_id&&(0,W.jsx)(`a`,{href:`/audit?id=${encodeURIComponent(t.audit_id)}`,className:`chip text-[var(--color-fg-3)] border-[var(--color-line-1)] hover:text-[var(--color-fg-1)]`,title:`Open full audit record`,children:`audit ↗`}),t.rule_id&&(0,W.jsx)(`a`,{href:`/rules#${encodeURIComponent(t.rule_id)}`,className:`chip text-[var(--color-fg-3)] border-[var(--color-line-1)] hover:text-[var(--color-fg-1)]`,title:`Jump to rule`,children:`rule ↗`})]})]})}function Fl(e){if(e<1500)return`just now`;let t=Math.floor(e/1e3);if(t<60)return`${t}s ago`;let n=Math.floor(t/60);return n<60?`${n}m${t%60}s ago`:`${Math.floor(n/60)}h${n%60}m ago`}function Il(e){let t=new Map;for(let n of e){let e=`${n.client}:${n.agent_id??`solo`}`,r=t.get(e);r?(r.count+=1,n.ts_ms>r.newest_ts_ms&&(r.newest_ts_ms=n.ts_ms)):t.set(e,{client:n.client,agent_id:n.agent_id??`solo`,count:1,newest_ts_ms:n.ts_ms})}return Array.from(t.values()).sort((e,t)=>t.newest_ts_ms===e.newest_ts_ms?t.count-e.count:t.newest_ts_ms-e.newest_ts_ms)}function Z(e){let{bursts:t,allBursts:n}=e,r=n??t,{toolCounts:a,decisionCounts:o,ruleCounts:s,unmatchedCount:c}=(0,v.useMemo)(()=>{let e=new Map,n=new Map,r=new Map,a=0;for(let o of t)if(e.set(o.tool,(e.get(o.tool)??0)+1),n.set(o.decision,(n.get(o.decision)??0)+1),o.rule_id){let e=r.get(o.rule_id);e?(e.count+=1,e.decisions.add(o.decision)):r.set(o.rule_id,{count:1,decisions:new Set([o.decision])})}else a+=1;return{toolCounts:Array.from(e.entries()).sort((e,t)=>t[1]-e[1]),decisionCounts:Array.from(n.entries()),ruleCounts:Array.from(r.entries()).map(([e,t])=>({id:e,count:t.count,decisions:t.decisions})).sort((e,t)=>t.count-e.count),unmatchedCount:a}},[t]),l=(0,v.useMemo)(()=>Il(r),[r]),u=a[0]?.[1]??0,d=l[0]?.count??0,f=s[0]?.count??0,p=e=>{for(let t of[`block`,`ask`,`force`,`log`,`allow`,`shadow`])if(e.has(t))return za[t];return`#6b7280`};return(0,W.jsxs)(`div`,{className:`flex flex-col gap-3 text-[11px] font-mono`,children:[(0,W.jsx)(`div`,{className:`rounded-sm border border-[var(--color-line-0)] bg-[var(--color-surface-0)] p-2 text-[10px] text-[var(--color-fg-3)] leading-relaxed`,children:`Each dot is one tool call by an AI agent. Color encodes the ssg rule decision; lines link calls from the same agent in time order.`}),(0,W.jsxs)(`div`,{children:[(0,W.jsxs)(`div`,{className:`overline text-[var(--color-fg-3)] mb-1`,children:[`rules · `,s.length,` matched`,c>0&&(0,W.jsxs)(`span`,{className:`ml-2 text-[var(--color-fg-4)] normal-case tracking-normal`,children:[c,` unmatched`]})]}),s.length===0?(0,W.jsx)(`p`,{className:`text-[var(--color-fg-4)]`,children:`no rules matched in window`}):(0,W.jsx)(`ul`,{className:`space-y-0.5`,children:s.slice(0,6).map(e=>{let t=f>0?e.count/f*100:0,n=p(e.decisions);return(0,W.jsxs)(`li`,{className:`grid grid-cols-[1fr_auto] items-center gap-2`,title:`${e.id} — decisions: ${Array.from(e.decisions).join(`, `)}`,children:[(0,W.jsxs)(`div`,{className:`flex items-center gap-2 min-w-0`,children:[(0,W.jsx)(`span`,{className:`w-2 h-2 rounded-full shrink-0`,style:{background:n},"aria-hidden":!0}),(0,W.jsx)(`a`,{href:`/rules#${encodeURIComponent(e.id)}`,className:`truncate text-[var(--color-fg-2)] hover:text-[var(--color-fg-1)]`,children:e.id}),(0,W.jsx)(`div`,{className:`flex-1 h-1 bg-[var(--color-surface-1)] rounded-sm overflow-hidden`,children:(0,W.jsx)(`div`,{className:`h-full`,style:{background:n,width:`${t}%`,opacity:.6}})})]}),(0,W.jsx)(`span`,{className:`tabular-nums text-[var(--color-fg-4)]`,children:e.count})]},e.id)})})]}),(0,W.jsxs)(`div`,{children:[(0,W.jsx)(`div`,{className:`overline text-[var(--color-fg-3)] mb-1`,children:`decisions`}),(0,W.jsx)(`div`,{className:`flex flex-wrap gap-x-3 gap-y-1`,children:[`allow`,`block`,`ask`,`log`,`force`,`shadow`].map(e=>{let t=o.find(([t])=>t===e)?.[1]??0;return(0,W.jsxs)(`div`,{className:`flex items-center gap-1.5`,children:[(0,W.jsx)(`span`,{className:`w-2 h-2 rounded-full shrink-0`,style:{background:za[e]},"aria-hidden":!0}),(0,W.jsx)(`span`,{className:`text-[var(--color-fg-2)] uppercase tracking-wider`,children:e}),(0,W.jsx)(`span`,{className:`text-[var(--color-fg-4)] tabular-nums`,children:t})]},e)})})]}),(0,W.jsxs)(`div`,{children:[(0,W.jsxs)(`div`,{className:`overline text-[var(--color-fg-3)] mb-1`,children:[`agents · `,l.length,` active`,n&&n!==t&&(0,W.jsx)(`span`,{className:`ml-2 text-[var(--color-fg-4)] normal-case tracking-normal`,children:`roster: today`})]}),l.length===0?(0,W.jsx)(`p`,{className:`text-[var(--color-fg-4)]`,children:`no agents in window`}):(0,W.jsx)(`ul`,{className:`space-y-0.5`,children:l.slice(0,8).map(e=>{let t=d>0?e.count/d*100:0,n=`${e.client}:${e.agent_id}`,r=Date.now()-e.newest_ts_ms,a=r<5e3;return(0,W.jsxs)(`li`,{className:`grid grid-cols-[1fr_auto] items-center gap-2`,title:`${n} — last eval ${Math.max(0,Math.round(r/1e3))}s ago`,children:[(0,W.jsxs)(`div`,{className:`flex items-center gap-2 min-w-0`,children:[a?(0,W.jsx)(`span`,{className:`status-dot bg-emerald-400 pulse-soft shrink-0`,"aria-hidden":!0}):(0,W.jsx)(`span`,{className:`w-1.5 h-1.5 rounded-full shrink-0 bg-[var(--color-fg-4)]/40`,"aria-hidden":!0}),(0,W.jsxs)(`span`,{className:`truncate text-[var(--color-fg-2)]`,children:[e.client,(0,W.jsxs)(`span`,{className:`text-[var(--color-fg-4)]`,children:[`:`,e.agent_id]})]}),(0,W.jsx)(`div`,{className:`flex-1 h-1 bg-[var(--color-surface-1)] rounded-sm overflow-hidden`,children:(0,W.jsx)(`div`,{className:`h-full bg-violet-400/60`,style:{width:`${t}%`}})})]}),(0,W.jsx)(`span`,{className:`tabular-nums text-[var(--color-fg-4)]`,children:e.count})]},n)})})]}),(0,W.jsxs)(`div`,{children:[(0,W.jsxs)(`div`,{className:`overline text-[var(--color-fg-3)] mb-1`,children:[`tools · `,t.length,` in window`]}),a.length===0?(0,W.jsx)(`p`,{className:`text-[var(--color-fg-4)]`,children:`no tool activity`}):(0,W.jsx)(`ul`,{className:`space-y-0.5`,children:a.slice(0,8).map(([e,t])=>{let n=u>0?t/u*100:0;return(0,W.jsxs)(`li`,{className:`grid grid-cols-[1fr_auto] items-center gap-2`,children:[(0,W.jsxs)(`div`,{className:`flex items-center gap-2 min-w-0`,children:[(0,W.jsx)(`span`,{className:`truncate text-[var(--color-fg-2)]`,children:e}),(0,W.jsx)(`div`,{className:`flex-1 h-1 bg-[var(--color-surface-1)] rounded-sm overflow-hidden`,children:(0,W.jsx)(`div`,{className:`h-full bg-sky-400/60`,style:{width:`${n}%`}})})]}),(0,W.jsx)(`span`,{className:`tabular-nums text-[var(--color-fg-4)]`,children:t})]},e)})})]})]})}var Q=[100,500,1e3,5e3,1e4,1e5];function Ll(e){return e>=1e5||e>=1e3?`${e/1e3|0}k`:String(e)}function Rl(e){let t=Math.floor(e/100),n=Math.floor(t/600),r=Math.floor(t%600/10),a=t%10;return`${String(n).padStart(2,`0`)}:${String(r).padStart(2,`0`)}.${a}`}function zl(e){let t=Math.floor(e/100);return`${Math.floor(t/10)}.${t%10}s`}function Bl({className:e,onMilestone:t,onRecord:n}){let r=(0,v.useRef)(null),a=(0,v.useRef)(null),[o,s]=(0,v.useState)(0),[c,l]=(0,v.useState)(0),[u,d]=(0,v.useState)(0),[f,p]=(0,v.useState)(0),[m,h]=(0,v.useState)(0),[g,_]=(0,v.useState)(``),[y,b]=(0,v.useState)(!1),[x,S]=(0,v.useState)(!1),C=De(),w=ke(),T=Oe(),E=(0,v.useRef)(null),D=(0,v.useRef)(0),O=(0,v.useRef)(0),k=(0,v.useRef)(0),A=(0,v.useRef)(0),ee=(0,v.useRef)(new Set),j=(0,v.useRef)(performance.now());(0,v.useEffect)(()=>{let e=performance.now();if(ct()){let t=setInterval(()=>{let t=performance.now();r.current&&(r.current.textContent=Rl(t-e)),a.current&&(a.current.textContent=zl(t-j.current))},1e3);return()=>clearInterval(t)}return yr(()=>{let t=performance.now();r.current&&(r.current.textContent=Rl(t-e)),a.current&&(a.current.textContent=zl(t-j.current))})},[]);let M=(0,v.useRef)(0);return(0,v.useEffect)(()=>{if(E.current===null){E.current=w,D.current=w;return}if(w<=D.current)return;let e=w-D.current;D.current=w,d(n=>{let r=n+e,a=Q.find(e=>e>A.current&&r>=e);return a&&(A.current=a,_(Ll(a)),S(!0),t?.(),setTimeout(()=>{_(``),S(!1)},700)),r});let r=Date.now();if(r-M.current>=1e3){M.current=r;let e=T.filter(e=>r-e.ts_ms<=6e4);p(new Set(e.map(e=>`${e.client}:${e.agent_id??`solo`}`)).size)}C?.rule_id&&ee.current.add(C.rule_id),h(ee.current.size),C&&(C.decision===`block`?(O.current=0,s(0),j.current=performance.now()):(O.current+=e,O.current>k.current&&(k.current=O.current,l(k.current),b(!0),n?.(),setTimeout(()=>b(!1),450)),s(O.current)))},[w,C,T,t,n]),(0,W.jsxs)(`div`,{className:U(`pointer-events-none select-none`,`flex flex-col gap-2 p-3 rounded-md`,`bg-[var(--color-bg-2,#0c0d12)]/85 backdrop-blur-sm`,`border border-[var(--color-border-1,#1c1f26)]`,`shadow-lg shadow-black/40`,`min-w-[180px] font-mono text-[11px]`,`text-[var(--color-fg-2,#9aa1ad)]`,x&&`milestone-ring`,e),"aria-label":`Live engagement counters`,children:[(0,W.jsx)(Vl,{label:`uptime`,children:(0,W.jsx)(`span`,{ref:r,className:`tabular-nums text-[var(--color-fg-0,#e6e8ed)] text-[15px] tracking-tight`,children:`00:00.0`})}),(0,W.jsx)(Vl,{label:`evals`,children:(0,W.jsxs)(`span`,{className:`flex items-center gap-1.5`,children:[(0,W.jsx)(mr,{value:u,curve:`spring`,className:`text-[var(--color-fg-0,#e6e8ed)] text-[15px]`}),g&&(0,W.jsxs)(`span`,{className:`text-[10px] text-emerald-400 uppercase tracking-wide`,children:[`+`,g]})]})}),(0,W.jsx)(Vl,{label:`since block`,children:(0,W.jsx)(`span`,{ref:a,className:`tabular-nums text-emerald-300 text-[15px]`,children:`0.0s`})}),(0,W.jsx)(Vl,{label:`streak / best`,children:(0,W.jsxs)(`span`,{className:U(`tabular-nums text-[15px]`,y?`record-beat`:`text-[var(--color-fg-0,#e6e8ed)]`),children:[(0,W.jsx)(mr,{value:o,curve:`spring`}),(0,W.jsx)(`span`,{className:`text-[var(--color-fg-4,#5a6071)] mx-1`,children:`/`}),(0,W.jsx)(mr,{value:c,curve:`elastic`})]})}),(0,W.jsx)(Vl,{label:`agents`,children:(0,W.jsx)(mr,{value:f,curve:`spring`,className:`text-[var(--color-fg-0,#e6e8ed)] text-[15px]`})}),(0,W.jsx)(Vl,{label:`rules`,children:(0,W.jsx)(mr,{value:m,curve:`spring`,className:`text-[var(--color-fg-0,#e6e8ed)] text-[15px]`})})]})}function Vl({label:e,children:t}){return(0,W.jsxs)(`div`,{className:`flex items-baseline justify-between gap-3`,children:[(0,W.jsx)(`span`,{className:`uppercase tracking-wider text-[10px] text-[var(--color-fg-4,#5a6071)]`,children:e}),t]})}var Hl=900,Ul=180,Wl=320,Gl=800,Kl=4;function ql(){let e=De(),t=ke(),[n,r]=(0,v.useState)(null),[a,o]=(0,v.useState)(`idle`),s=(0,v.useRef)([]),c=(0,v.useRef)(-1),l=(0,v.useRef)(0),u=(0,v.useRef)(null);if((0,v.useEffect)(()=>{if(!e||t===c.current||(c.current=t,e.decision!==`block`&&e.decision!==`force`))return;let u=Date.now(),d=s.current,f=d[0];if(f&&u-l.current<Gl){f.extra+=1,f.burst=e,f.seq=t,l.current=u;return}if(d.length>=Kl&&d.shift(),d.push({seq:t,burst:e,extra:0}),l.current=u,a===`idle`&&!n){let e=d.shift()??null;e&&(r(e),o(`in`))}},[t]),(0,v.useEffect)(()=>{if(a===`idle`)return;let e=null;return a===`in`?e=setTimeout(()=>o(`visible`),Ul):a===`visible`?e=setTimeout(()=>o(`out`),Hl):a===`out`&&(e=setTimeout(()=>{let e=s.current.shift()??null;e?(r(e),o(`in`)):(r(null),o(`idle`))},Wl)),u.current=e,()=>{e&&clearTimeout(e)}},[a]),!n)return null;let{burst:d,extra:f}=n,p=za[d.decision]??`#ef4444`,m=ct(),h=a===`in`||a===`visible`?1:0,g=m||a===`in`||a===`visible`?0:-8,_=d.rule_id??`rule`,y=d.decision===`block`?`BLOCKED`:`FORCED`,b=f>0?`${d.tool} · +${f} more in this burst`:`${d.tool} · ${d.client}${d.agent_id?`:${d.agent_id}`:``}`;return(0,W.jsx)(`div`,{className:`pointer-events-none fixed top-20 left-1/2 z-40 select-none`,style:{transform:`translateX(-50%) translateY(${g}px) scale(1)`,opacity:h,transition:m?`opacity ${Ul}ms ease-out`:`opacity ${Ul}ms ease-out, transform ${Ul}ms cubic-bezier(0.34, 1.56, 0.64, 1)`},"aria-live":`polite`,"aria-atomic":`true`,children:(0,W.jsxs)(`div`,{className:`flex items-center gap-3 px-5 py-3 rounded-md border bg-black/85 backdrop-blur-sm shadow-2xl`,style:{borderColor:p},children:[(0,W.jsx)(`div`,{className:`w-2.5 h-2.5 rounded-full shrink-0`,style:{background:p,boxShadow:m?`none`:`0 0 16px ${p}`}}),(0,W.jsxs)(`div`,{className:`flex flex-col gap-0.5 min-w-0`,children:[(0,W.jsxs)(`div`,{className:`text-[11px] font-mono uppercase tracking-[0.18em]`,style:{color:p},children:[y,` BY SSG`]}),(0,W.jsx)(`div`,{className:`text-[14px] font-mono text-[var(--color-fg-1)] truncate max-w-[420px]`,children:_}),(0,W.jsx)(`div`,{className:`text-[11px] font-mono text-[var(--color-fg-3)] truncate max-w-[420px]`,children:b})]})]})})}var Jl=1200,Yl=3e4,Xl=`graph.panelState.v1`;function Zl(e,t){let n=new Map;for(let t of e){let e=Ra(t),r=n.get(e);r?r.push(t):n.set(e,[t])}for(let[e,r]of n){let a=t.get(e);a&&a.length===r.length&&a[a.length-1]===r[r.length-1]&&n.set(e,a)}return n}function Ql(){if(typeof window>`u`)return new Map;try{let e=window.localStorage.getItem(Xl);if(!e)return new Map;let t=JSON.parse(e);return new Map(Object.entries(t))}catch{return new Map}}function $l(e){if(!(typeof window>`u`))try{let t={};for(let[n,r]of e)t[n]=r;window.localStorage.setItem(Xl,JSON.stringify(t))}catch{}}function eu(){let e=Ja(),t=ke(),n=De(),r=(0,v.useRef)(new URLSearchParams(window.location.search).get(`layout`)===`force`?`force`:`spiral`),[a,o]=(0,v.useState)(null),s=os();(0,v.useEffect)(()=>{n&&(n.decision===`block`?s.play(`block`):n.decision===`force`&&s.play(`force`))},[t]);let c=(0,v.useCallback)(()=>s.play(`milestone`),[s]),l=(0,v.useCallback)(()=>s.play(`record`),[s]),[u,d]=(0,v.useState)(!1);(0,v.useEffect)(()=>{let e=e=>{if(e.key===`Escape`&&u){d(!1);return}if(e.key===`b`||e.key===`B`){let t=e.target?.tagName;if(t===`INPUT`||t===`TEXTAREA`)return;d(e=>!e)}};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[u]);let[f,p]=(0,v.useState)(()=>{if(typeof window>`u`)return!1;try{return window.localStorage.getItem(`ssg.sfx.enabled`)===null}catch{return!1}}),m=(0,v.useCallback)(()=>{s.toggle(),p(!1)},[s]),h=(0,v.useRef)(new Map),[g,_]=(0,v.useState)({fps:60,active:0}),y=(0,v.useCallback)((e,t)=>{h.current.set(e,t)},[]);(0,v.useEffect)(()=>{let e=setInterval(()=>{let e=h.current;if(e.size===0){_(e=>e.active===0?e:{fps:60,active:0});return}let t=0;for(let n of e.values())t+=n;let n=t/e.size,r=n>0?Math.min(60,Math.max(1,Math.round(1e3/n))):60;_(t=>t.fps===r&&t.active===e.size?t:{fps:r,active:e.size})},1e3);return()=>clearInterval(e)},[]);let{bursts:b,playback:x,oldest_known_ms:S,newest_known_ms:C,loading_backfill:w}=e.snapshot,T=(0,v.useRef)(new Map),E=(0,v.useMemo)(()=>{let e=Zl(b,T.current);return T.current=e,e},[b]),[D,O]=(0,v.useState)(()=>Ql()),[k,A]=(0,v.useState)(null);(0,v.useEffect)(()=>{$l(D)},[D]),(0,v.useEffect)(()=>{let e=Date.now(),t=!1,n=new Map(D);for(let r of E.keys())n.has(r)||(n.set(r,{pinned:!1,pinnedAt:0,minimized:!1,firstSeenAt:e}),t=!0);t&&O(n)},[E,D]);let ee=(0,v.useRef)(new Map),j=(0,v.useRef)(new Set),M=(0,v.useRef)(new Map),[,te]=(0,v.useState)(0);(0,v.useEffect)(()=>{let e=performance.now(),t=ee.current,n=j.current,r=M.current,a=new Set;for(let[e,n]of E)a.add(e),r.set(e,n.slice()),t.delete(e);for(let o of n)if(!a.has(o)&&!t.has(o)){let n=r.get(o)??[],a=n[n.length-1]?.ts_ms??0;t.set(o,{bursts:n,diedAt:e,newestTs:a})}for(let[n,a]of t)e-a.diedAt>=Jl&&(t.delete(n),r.delete(n));if(j.current=a,t.size>0){let n=1/0;for(let e of t.values())n=Math.min(n,e.diedAt+Jl);let r=Math.max(16,n-e+16),a=setTimeout(()=>te(e=>e+1),r);return()=>clearTimeout(a)}},[E]);let ne=(0,v.useCallback)(e=>{O(t=>{let n=new Map(t),r=n.get(e)??{pinned:!1,pinnedAt:0,minimized:!1,firstSeenAt:Date.now()};return n.set(e,{...r,pinned:!r.pinned,pinnedAt:r.pinned?0:Date.now()}),n})},[]),re=(0,v.useCallback)(e=>{O(t=>{let n=new Map(t),r=n.get(e)??{pinned:!1,pinnedAt:0,minimized:!1,firstSeenAt:Date.now()};return n.set(e,{...r,minimized:!r.minimized}),n})},[]),N=(0,v.useCallback)(e=>{A(t=>t===e?null:e)},[]);(0,v.useEffect)(()=>{if(!k)return;let e=e=>{e.key===`Escape`&&A(null)};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[k]);let P=(0,v.useMemo)(()=>{let e={pinned:!1,pinnedAt:0,minimized:!1,firstSeenAt:Date.now()},t=[];for(let[n,r]of E){let a=r[r.length-1]?.ts_ms??0;t.push({key:n,bursts:r,newestTs:a,fadingOutAt:null,state:D.get(n)??e})}for(let[n,r]of ee.current)E.has(n)||t.push({key:n,bursts:r.bursts,newestTs:r.newestTs,fadingOutAt:r.diedAt,state:D.get(n)??e});return t.sort((e,t)=>e.state.pinned===t.state.pinned?e.state.pinned&&t.state.pinned?e.state.pinnedAt-t.state.pinnedAt:e.state.firstSeenAt-t.state.firstSeenAt:e.state.pinned?-1:1),t},[E,D]),ie=(0,v.useMemo)(()=>{if(!a)return null;for(let e of b)if((e.audit_id??`${e.ts_ms}:${e.tool}`)===a||a.startsWith(`${e.ts_ms}:${e.tool}`))return e;return null},[b,a]);(0,v.useEffect)(()=>{let e=new Set(P.map(e=>e.key)),t=h.current;for(let n of Array.from(t.keys()))e.has(n)||t.delete(n)},[P]);let ae=(0,v.useMemo)(()=>{let e=n?.counters,t=e?.total??0,r=(e?.block??0)+(e?.force??0),a=0;if(b.length>0){let e=0,t=b.slice(-100);for(let n of t)e+=n.duration_ns;a=e/t.length/1e6}return{evals:t,blocks:r,avgMs:a,agents:P.length}},[n,b,P.length]),oe=Math.min(S,x.playhead_ms-x.window_ms),F=Math.max(C,x.playhead_ms),I=P.length<=1?1:P.length<=4?2:3,L=Math.max(1,Math.ceil(P.length/I)),se=P.length<=1?360:180,R=k?P.find(e=>e.key===k):null,ce=e=>e>=1e4?`${Math.round(e/1e3)}k`:e.toLocaleString();return(0,W.jsxs)(`div`,{className:`grid gap-3 h-[calc(100dvh-4.5rem)] min-h-[560px] ${u?`grid-rows-[auto_minmax(0,1fr)] bg-black`:`grid-rows-[auto_minmax(0,1fr)_auto]`}`,children:[(0,W.jsx)(ql,{}),(0,W.jsxs)(`header`,{className:`flex items-center justify-between flex-wrap gap-y-2`,children:[(0,W.jsxs)(`div`,{className:`flex items-center gap-3 flex-wrap`,children:[(0,W.jsx)(`h1`,{className:`text-sm font-mono uppercase tracking-wider text-[var(--color-fg-1)]`,children:`graph intelligence`}),!u&&(0,W.jsx)(`span`,{className:`chip text-sky-300 border-sky-500/30`,children:`real-time tool-use`}),x.mode===`live`?(0,W.jsxs)(`span`,{className:`flex items-center gap-1.5 text-[11px] font-mono uppercase tracking-wider text-emerald-300`,children:[(0,W.jsx)(`span`,{className:`status-dot bg-emerald-400 pulse-soft`}),`streaming`]}):(0,W.jsxs)(`span`,{className:`flex items-center gap-1.5 text-[11px] font-mono uppercase tracking-wider text-amber-300`,children:[(0,W.jsx)(`span`,{className:`status-dot bg-amber-400`}),x.mode]}),(0,W.jsxs)(`span`,{className:`hidden sm:flex items-center gap-3 text-[11px] font-mono text-[var(--color-fg-3)] pl-3 border-l border-[var(--color-line-1)]`,children:[(0,W.jsxs)(`span`,{title:`Total evaluations since daemon start`,children:[(0,W.jsx)(`span`,{className:`text-[var(--color-fg-4)]`,children:`↑`}),` `,(0,W.jsx)(`span`,{className:`text-[var(--color-fg-1)]`,children:ce(ae.evals)}),` `,`evals`]}),(0,W.jsxs)(`span`,{title:`Block + force decisions — dangerous tool calls intercepted by SSG rules`,children:[(0,W.jsx)(`span`,{className:`text-rose-400`,children:`⛔`}),` `,(0,W.jsx)(`span`,{className:`text-[var(--color-fg-1)]`,children:ce(ae.blocks)}),` `,`blocks`]}),(0,W.jsxs)(`span`,{title:`Mean eval latency over the last 100 bursts`,children:[(0,W.jsx)(`span`,{className:`text-[var(--color-fg-4)]`,children:`⏱`}),` `,(0,W.jsx)(`span`,{className:`text-[var(--color-fg-1)]`,children:ae.avgMs<1?`${(ae.avgMs*1e3).toFixed(0)}µs`:`${ae.avgMs.toFixed(1)}ms`})]}),(0,W.jsxs)(`span`,{title:`Concurrent agent sessions in this window`,children:[(0,W.jsx)(`span`,{className:`text-[var(--color-fg-4)]`,children:`⌥`}),` `,(0,W.jsx)(`span`,{className:`text-[var(--color-fg-1)]`,children:ae.agents}),` `,`agent`,ae.agents===1?``:`s`]})]})]}),(0,W.jsxs)(`div`,{className:`flex items-center gap-2`,children:[!u&&(0,W.jsxs)(`p`,{className:`text-[11px] font-mono text-[var(--color-fg-4)]`,children:[b.length,`n · window `,Math.round(x.window_ms/1e3),`s`]}),(0,W.jsxs)(`span`,{className:`text-[10px] font-mono text-[var(--color-fg-4)] tabular-nums`,title:`Average frame time across ${g.active} canvas${g.active===1?``:`es`}`,children:[g.fps,`fps · `,g.active,`/`,P.length]}),(0,W.jsx)(`button`,{type:`button`,onClick:()=>d(e=>!e),className:`chip cursor-pointer transition-colors ${u?`border-amber-500/60 text-amber-300`:`hover:border-sky-500/50 hover:text-sky-300`}`,title:u?`Exit broadcast mode (Esc or B)`:`Broadcast mode — hide chrome for streaming (B)`,children:u?`BROADCAST`:`broadcast`}),(0,W.jsx)(`button`,{type:`button`,onClick:m,className:`chip cursor-pointer transition-colors ${f&&!s.enabled?`border-amber-500/60 text-amber-300 animate-pulse`:`hover:border-sky-500/50 hover:text-sky-300`}`,title:s.enabled?`Mute stream sounds`:`Enable stream sounds`,children:s.enabled?`SFX ON`:f?`🔊 enable cues`:`SFX OFF`})]})]}),(0,W.jsxs)(`div`,{className:`grid grid-cols-1 ${u?``:`lg:grid-cols-[1fr_300px]`} gap-3 min-h-0 overflow-hidden`,children:[(0,W.jsx)(`div`,{className:`grid gap-3 min-h-0 min-w-0`,style:{gridTemplateColumns:`repeat(${I}, minmax(0, 1fr))`,gridTemplateRows:`repeat(${L}, minmax(180px, 1fr))`},children:P.length===0?(0,W.jsxs)(`div`,{className:`flex flex-col items-center justify-center rounded-sm border border-[var(--color-line-1)] bg-[var(--color-surface-1)] text-center px-4`,style:{minHeight:240},children:[(0,W.jsx)(`p`,{className:`overline mb-2 text-[var(--color-fg-3)]`,children:`graph · idle`}),(0,W.jsx)(`p`,{className:`text-[11px] font-mono text-[var(--color-fg-4)] max-w-[280px]`,children:`No active sessions in the current window. Each session will render as its own tree as bursts arrive.`})]}):P.map(e=>{let n=e.fadingOutAt!=null||x.playhead_ms-e.newestTs>Yl;return k!=null&&k!==e.key?null:(0,W.jsx)(kl,{sessionKey:e.key,bursts:e.bursts,paused:x.mode!==`live`||e.fadingOutAt!=null,selectedId:a,onSelect:o,burstSeq:t,layout:r.current,isStale:n,isFadingOut:e.fadingOutAt!=null,minHeight:se,pinned:e.state.pinned,minimized:e.state.minimized,isFullscreen:!1,broadcast:u,onTogglePin:()=>ne(e.key),onToggleMinimize:()=>re(e.key),onToggleFullscreen:()=>N(e.key),onFrameTime:t=>y(e.key,t)},e.key)})}),!u&&(0,W.jsxs)(`aside`,{className:`flex flex-col gap-2 min-w-0 min-h-0 overflow-y-auto`,children:[(0,W.jsx)(es,{}),(0,W.jsx)(Bl,{onMilestone:c,onRecord:l}),(0,W.jsx)(`section`,{className:`rounded-sm border border-[var(--color-line-1)] bg-[var(--color-surface-1)] p-3`,children:(0,W.jsx)(Z,{bursts:b,allBursts:e.allBursts})}),(0,W.jsx)(`section`,{className:`rounded-sm border border-[var(--color-line-1)] bg-[var(--color-surface-1)] p-3 min-h-[140px]`,children:(0,W.jsx)(Pl,{burst:ie,onClose:()=>o(null)})})]})]}),!u&&(0,W.jsx)(`section`,{className:`rounded-sm border border-[var(--color-line-1)] bg-[var(--color-surface-1)] p-3`,children:(0,W.jsx)(Al,{playback:x,bursts:b,rangeStart:oe,rangeEnd:F,loading:w,onPlayhead:t=>e.setPlayhead(t),onLive:()=>e.jumpToLive(),onPause:()=>e.setMode(`paused`),onResume:()=>e.setMode(`scrubbing`),on24h:()=>e.jumpTo24h()})}),u&&(0,W.jsxs)(`div`,{className:`pointer-events-none fixed bottom-3 right-4 flex flex-col items-end gap-1 z-30`,children:[(0,W.jsx)(`span`,{className:`text-[11px] font-mono uppercase tracking-[0.18em] text-[var(--color-fg-3)]`,children:`sigmashake gov`}),(0,W.jsx)(`span`,{className:`text-[10px] font-mono text-[var(--color-fg-4)]`,children:`broadcast mode · press B or Esc to exit`})]}),R&&(0,W.jsx)(`div`,{className:`fixed inset-0 z-50 bg-black/90 backdrop-blur-sm flex flex-col p-6`,children:(0,W.jsx)(kl,{sessionKey:R.key,bursts:R.bursts,paused:x.mode!==`live`||R.fadingOutAt!=null,selectedId:a,onSelect:o,burstSeq:t,layout:r.current,isStale:R.fadingOutAt!=null||x.playhead_ms-R.newestTs>Yl,isFadingOut:!1,minHeight:0,pinned:R.state.pinned,minimized:!1,isFullscreen:!0,onTogglePin:()=>ne(R.key),onToggleMinimize:()=>re(R.key),onToggleFullscreen:()=>N(R.key)},`fs-${R.key}`)})]})}var tu=[{id:`rca`,label:`rca`,hint:`pre-computed root cause`},{id:`timeline`,label:`timeline`,hint:`recent frames across traces`},{id:`watch`,label:`watch`,hint:`subscribe to any ssg:// URI`},{id:`state`,label:`state`,hint:`daemon runtime snapshot`},{id:`metrics`,label:`metrics`,hint:`latency + counters`}];function nu(){let[e,t]=(0,v.useState)(`rca`);return(0,W.jsxs)(`div`,{className:`flex flex-col gap-4 min-h-[70vh]`,children:[(0,W.jsxs)(`header`,{className:`flex items-center justify-between`,children:[(0,W.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,W.jsx)(`h1`,{className:`text-sm font-mono uppercase tracking-wider text-[var(--color-fg-1)]`,children:`ai-native debugger`}),(0,W.jsx)(`span`,{className:`chip text-sky-300 border-sky-500/30`,children:`ssg:// unified resolver`}),(0,W.jsx)(ru,{})]}),(0,W.jsx)(`p`,{className:`text-[11px] font-mono text-[var(--color-fg-4)]`,children:`one surface · cli · mcp · dashboard`})]}),(0,W.jsx)(`nav`,{className:`flex items-center gap-1 border-b border-[var(--color-line-1)]`,children:tu.map(n=>(0,W.jsx)(`button`,{type:`button`,onClick:()=>t(n.id),title:n.hint,className:`px-3 py-1.5 text-[11px] font-mono uppercase tracking-wider border-b-2 transition-colors `+(e===n.id?`border-[var(--color-brand)] text-[var(--color-fg-1)]`:`border-transparent text-[var(--color-fg-4)] hover:text-[var(--color-fg-2)]`),children:n.label},n.id))}),(0,W.jsxs)(`section`,{className:`flex-1 min-h-0`,children:[e===`rca`&&(0,W.jsx)(iu,{}),e===`timeline`&&(0,W.jsx)(lu,{}),e===`watch`&&(0,W.jsx)(_u,{}),e===`state`&&(0,W.jsx)(vu,{uri:`ssg://daemon/state`}),e===`metrics`&&(0,W.jsx)(vu,{uri:`ssg://daemon/metrics`})]})]})}function ru(){let e=je([`debug-frame`])[`debug-frame`]??0;return(0,W.jsxs)(`span`,{className:`flex items-center gap-1.5 text-[11px] font-mono uppercase tracking-wider text-emerald-300`,title:`${e} debug-frame bursts received`,children:[(0,W.jsx)(`span`,{className:`status-dot bg-emerald-400 pulse-soft`}),`live · `,e]})}function iu(){let e=je([`debug-frame`,`activity-updated`]),{data:t,loading:n,error:r,refetch:a}=z(`/api/json/debug?uri=ssg%3A%2F%2Frca%2Fcurrent`,[e[`debug-frame`],e[`activity-updated`]]),o=t?.data?.pack??null;return(0,W.jsxs)(`div`,{className:`grid grid-cols-1 xl:grid-cols-[1fr_340px] gap-4`,children:[(0,W.jsxs)(`article`,{className:`rounded-sm border border-[var(--color-line-1)] bg-[var(--color-surface-1)] p-4 space-y-3`,children:[n&&!t&&(0,W.jsx)(`p`,{className:`text-sm text-[var(--color-fg-4)]`,children:`loading RCA pack…`}),r&&(0,W.jsxs)(`p`,{className:`text-sm text-rose-300`,children:[`rca fetch error: `,r]}),!n&&!o&&(0,W.jsxs)(`div`,{className:`text-sm text-[var(--color-fg-3)] space-y-2`,children:[(0,W.jsx)(`p`,{className:`font-mono`,children:`no current RCA pack`}),(0,W.jsx)(`p`,{className:`text-[11px] text-[var(--color-fg-4)]`,children:`Packs are composed automatically when an eval errors, an ssqa finding arrives, or a daemon-level error fires. Nothing to diagnose yet — you're green.`})]}),o&&(0,W.jsx)(ou,{pack:o})]}),(0,W.jsxs)(`aside`,{className:`rounded-sm border border-[var(--color-line-1)] bg-[var(--color-surface-1)] p-3 text-[11px] font-mono text-[var(--color-fg-4)] space-y-2`,children:[(0,W.jsx)(`p`,{className:`uppercase tracking-wider text-[var(--color-fg-2)]`,children:`how claude sees this`}),(0,W.jsxs)(`pre`,{className:`text-[10px] whitespace-pre-wrap leading-snug`,children:[`ssg debug rca --current --json`,`
|
|
20
20
|
`,`# or via MCP:`,`
|
|
21
|
-
`,`ssg_debug_rca(`,`{`,`auto_current:true`,`}`,`)`]}),(0,U.jsx)(`button`,{type:`button`,onClick:i,className:`w-full mt-2 px-2 py-1 border border-[var(--color-line-1)] rounded-sm hover:bg-[var(--color-surface-2)]`,children:`refresh`}),t?.snapshot_hash&&(0,U.jsxs)(`p`,{className:`text-[10px] opacity-60`,children:[`hash `,t.snapshot_hash.slice(0,12),`…`]})]})]})}function nu(e){return e===`critical`?`text-rose-400 border-rose-500/40`:e===`high`?`text-amber-300 border-amber-500/40`:e===`medium`?`text-sky-300 border-sky-500/40`:`text-[var(--color-fg-3)] border-[var(--color-line-1)]`}function ru({pack:e}){return(0,U.jsxs)(U.Fragment,{children:[(0,U.jsxs)(`header`,{className:`flex items-start justify-between gap-4`,children:[(0,U.jsxs)(`div`,{children:[(0,U.jsxs)(`p`,{className:`text-[10px] font-mono uppercase tracking-wider text-[var(--color-fg-4)]`,children:[`rca pack · `,new Date(e.ts_ms).toLocaleTimeString()]}),(0,U.jsx)(`h2`,{className:`text-[15px] font-medium text-[var(--color-fg-1)] mt-1`,children:e.summary}),e.trace_id&&(0,U.jsxs)(`p`,{className:`text-[11px] font-mono text-[var(--color-fg-4)] mt-1`,children:[`trace_id · `,e.trace_id]})]}),(0,U.jsx)(`span`,{className:`chip uppercase text-[10px] tracking-wider `+nu(e.severity),children:e.severity})]}),e.hypothesis&&e.hypothesis.length>0&&(0,U.jsxs)(`section`,{children:[(0,U.jsx)(`h3`,{className:`text-[10px] font-mono uppercase tracking-wider text-[var(--color-fg-3)] mb-2`,children:`hypothesis`}),(0,U.jsx)(`ol`,{className:`space-y-2`,children:e.hypothesis.map((e,t)=>(0,U.jsxs)(`li`,{className:`p-2 rounded-sm bg-[var(--color-surface-2)] border border-[var(--color-line-1)]`,children:[(0,U.jsxs)(`div`,{className:`flex items-center justify-between gap-3`,children:[(0,U.jsx)(`p`,{className:`text-[13px] text-[var(--color-fg-1)]`,children:e.cause}),(0,U.jsxs)(`span`,{className:`text-[10px] font-mono text-[var(--color-fg-4)]`,children:[`conf `,(e.confidence*100).toFixed(0),`%`]})]}),e.evidence.length>0&&(0,U.jsx)(`ul`,{className:`mt-1 pl-3 text-[11px] text-[var(--color-fg-3)] list-disc list-inside space-y-0.5`,children:e.evidence.map((e,t)=>(0,U.jsx)(`li`,{children:e},t))})]},t))})]}),e.suggested_next_actions&&e.suggested_next_actions.length>0&&(0,U.jsxs)(`section`,{children:[(0,U.jsx)(`h3`,{className:`text-[10px] font-mono uppercase tracking-wider text-[var(--color-fg-3)] mb-2`,children:`suggested next actions`}),(0,U.jsx)(`ul`,{className:`space-y-1 text-[13px] text-[var(--color-fg-2)]`,children:e.suggested_next_actions.map((e,t)=>(0,U.jsxs)(`li`,{className:`font-mono text-[12px]`,children:[`→ `,e]},t))})]}),e.state_snapshot&&e.state_snapshot.length>0&&(0,U.jsxs)(`section`,{children:[(0,U.jsx)(`h3`,{className:`text-[10px] font-mono uppercase tracking-wider text-[var(--color-fg-3)] mb-2`,children:`expand`}),(0,U.jsx)(`ul`,{className:`space-y-1 text-[11px] font-mono`,children:e.state_snapshot.map(e=>(0,U.jsxs)(`li`,{className:`text-[var(--color-fg-3)]`,children:[(0,U.jsx)(`code`,{className:`text-sky-300`,children:e.uri}),(0,U.jsxs)(`span`,{className:`opacity-50 ml-2`,children:[e.hash.slice(0,10),`…`]})]},e.uri))})]})]})}var iu=[`hook-ingress`,`parse`,`match`,`ffi-call`,`decide`,`audit`,`respond`],au={"hook-ingress":`#6ea8ff`,parse:`#a78bfa`,match:`#60d394`,"ffi-call":`#f59e0b`,decide:`#f472b6`,audit:`#94a3b8`,respond:`#22d3ee`};function ou(){let{data:e,loading:t,error:n}=R(`/api/json/debug?uri=ssg%3A%2F%2Fframes%2Frecent%3Flimit%3D1024`,[je([`debug-frame`])[`debug-frame`]]),r=e?.data?.frames??[],i=e?.data?.dropped??0,[a,o]=(0,_.useState)(null);return(0,U.jsxs)(`div`,{className:`grid grid-cols-1 xl:grid-cols-[1fr_320px] gap-4`,children:[(0,U.jsxs)(`article`,{className:`rounded-sm border border-[var(--color-line-1)] bg-[var(--color-surface-1)] p-3 space-y-2`,children:[(0,U.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,U.jsxs)(`h3`,{className:`text-[10px] font-mono uppercase tracking-wider text-[var(--color-fg-3)]`,children:[`frames · `,r.length,i>0&&(0,U.jsxs)(`span`,{className:`ml-2 text-amber-300`,children:[`dropped · `,i]})]}),(0,U.jsx)(`span`,{className:`text-[10px] font-mono text-[var(--color-fg-4)]`,children:`ssg://frames/recent`})]}),n&&(0,U.jsxs)(`p`,{className:`text-sm text-rose-300`,children:[`timeline fetch error: `,n]}),t&&r.length===0?(0,U.jsx)(`p`,{className:`text-sm text-[var(--color-fg-4)]`,children:`loading…`}):r.length===0?(0,U.jsx)(su,{}):(0,U.jsxs)(U.Fragment,{children:[(0,U.jsx)(lu,{frames:r,onSelect:o}),(0,U.jsx)(cu,{})]})]}),(0,U.jsxs)(`aside`,{className:`rounded-sm border border-[var(--color-line-1)] bg-[var(--color-surface-1)] p-3 space-y-2 text-[11px] font-mono text-[var(--color-fg-3)]`,children:[(0,U.jsx)(`p`,{className:`uppercase tracking-wider text-[var(--color-fg-2)]`,children:`frame inspector`}),a?(0,U.jsx)(uu,{frame:a}):(0,U.jsx)(`p`,{className:`opacity-60`,children:`click a bar to inspect`})]})]})}function su(){return(0,U.jsxs)(`div`,{className:`text-[12px] text-[var(--color-fg-3)] space-y-1 py-4`,children:[(0,U.jsx)(`p`,{children:`no frames yet`}),(0,U.jsx)(`p`,{className:`text-[11px] text-[var(--color-fg-4)] font-mono`,children:`SSG_DEBUG_ENABLED=1 ssg daemon`}),(0,U.jsx)(`p`,{className:`text-[11px] text-[var(--color-fg-4)]`,children:`then fire an eval — frames stream in live.`})]})}function cu(){return(0,U.jsx)(`div`,{className:`flex flex-wrap gap-3 text-[10px] font-mono text-[var(--color-fg-4)]`,children:iu.map(e=>(0,U.jsxs)(`span`,{className:`flex items-center gap-1`,children:[(0,U.jsx)(`span`,{className:`inline-block w-2 h-2 rounded-sm`,style:{background:au[e]}}),e]},e))})}function lu({frames:e,onSelect:t}){let n=(0,_.useRef)(null),r=(0,_.useRef)([]),[i,a]=(0,_.useState)(-1),{rows:o,tMin:s,tMax:c}=(0,_.useMemo)(()=>{let t=new Map;for(let n of e){let e=t.get(n.trace_id)??[];e.push(n),t.set(n.trace_id,e)}let n=Array.from(t.entries()).map(([e,t])=>({trace_id:e,frames:t.slice().sort((e,t)=>fu(e.ts_start_ns,t.ts_start_ns))}));n.sort((e,t)=>fu(e.frames[0].ts_start_ns,t.frames[0].ts_start_ns));let r=null,i=null;for(let t of e){let e=BigInt(t.ts_start_ns),n=BigInt(t.ts_end_ns);(r===null||e<r)&&(r=e),(i===null||n>i)&&(i=n)}return{rows:n,tMin:r??0n,tMax:i??1n}},[e]);(0,_.useEffect)(()=>{let e=n.current;if(!e)return;let t=window.devicePixelRatio||1,a=e.clientWidth,l=Math.max(120,o.length*22+24);e.width=a*t,e.height=l*t,e.style.height=`${l}px`;let u=e.getContext(`2d`);if(!u)return;u.setTransform(t,0,0,t,0,0),u.clearRect(0,0,a,l),u.strokeStyle=`rgba(255,255,255,0.04)`,u.lineWidth=1;for(let e=1;e<4;e++){let t=e*a/4;u.beginPath(),u.moveTo(t,0),u.lineTo(t,l),u.stroke()}let d=c>s?Number(c-s):1,f=a-110-8;u.font=`10px ui-monospace, monospace`,u.textBaseline=`middle`;let p=[];if(o.forEach((e,t)=>{let n=8+t*22;u.fillStyle=`rgba(255,255,255,0.55)`,u.fillText(e.trace_id.slice(0,10),6,n+18/2);for(let t of e.frames){let e=Number(BigInt(t.ts_start_ns)-s),r=Number(BigInt(t.ts_end_ns)-s),i=110+e/d*f,a=Math.max(2,(r-e)/d*f);u.fillStyle=au[t.stage]??`#888`,u.globalAlpha=t.result===`error`?1:.82,u.fillRect(i,n,a,18),u.globalAlpha=1,t.result===`error`&&(u.strokeStyle=`#f43f5e`,u.lineWidth=1.5,u.strokeRect(i+.5,n+.5,a-1,17)),p.push({x:i,y:n,w:a,h:18,frame:t})}}),r.current=p,i>=0&&i<p.length){let e=p[i];u.strokeStyle=`#fff`,u.lineWidth=1.5,u.strokeRect(e.x+.5,e.y+.5,e.w-1,e.h-1)}},[o,s,c,i]);function l(e){let t=n.current;if(!t)return-1;let i=t.getBoundingClientRect(),a=e.clientX-i.left,o=e.clientY-i.top;for(let e=r.current.length-1;e>=0;e--){let t=r.current[e];if(a>=t.x&&a<=t.x+t.w&&o>=t.y&&o<=t.y+t.h)return e}return-1}return(0,U.jsx)(`canvas`,{ref:n,className:`w-full block cursor-crosshair`,onMouseMove:e=>a(l(e)),onMouseLeave:()=>a(-1),onClick:e=>{let n=l(e);t(n>=0?r.current[n].frame:null)}})}function uu({frame:e}){let t=Number(BigInt(e.ts_end_ns)-BigInt(e.ts_start_ns)),n=t>=1e6?`${(t/1e6).toFixed(2)}ms`:t>=1e3?`${(t/1e3).toFixed(1)}µs`:`${t}ns`;return(0,U.jsxs)(`dl`,{className:`space-y-1`,children:[(0,U.jsxs)(du,{k:`stage`,children:[(0,U.jsx)(`span`,{className:`inline-block w-2 h-2 rounded-sm mr-1 align-middle`,style:{background:au[e.stage]??`#888`}}),e.stage]}),(0,U.jsx)(du,{k:`tool`,children:e.tool}),(0,U.jsx)(du,{k:`result`,children:(0,U.jsx)(`span`,{className:e.result===`error`?`text-rose-300`:e.result===`skip`?`text-[var(--color-fg-4)]`:`text-emerald-300`,children:e.result})}),(0,U.jsx)(du,{k:`dur`,children:n}),e.rule_id&&(0,U.jsx)(du,{k:`rule`,children:e.rule_id}),e.error&&(0,U.jsxs)(U.Fragment,{children:[(0,U.jsx)(du,{k:`err.type`,children:(0,U.jsx)(`span`,{className:`text-rose-300`,children:e.error.type})}),(0,U.jsx)(du,{k:`err.msg`,children:(0,U.jsx)(`span`,{className:`text-rose-200`,children:e.error.message})})]}),e.input_preview&&(0,U.jsx)(du,{k:`input`,children:(0,U.jsx)(`code`,{className:`text-[10px] break-all`,children:e.input_preview})}),(0,U.jsx)(du,{k:`trace`,children:(0,U.jsx)(`code`,{className:`text-[10px]`,children:e.trace_id})}),(0,U.jsx)(du,{k:`frame`,children:(0,U.jsx)(`code`,{className:`text-[10px]`,children:e.frame_id})})]})}function du({k:e,children:t}){return(0,U.jsxs)(`div`,{className:`flex gap-2 text-[11px] leading-tight`,children:[(0,U.jsx)(`dt`,{className:`text-[var(--color-fg-4)] w-16 shrink-0 uppercase tracking-wider`,children:e}),(0,U.jsx)(`dd`,{className:`text-[var(--color-fg-2)] break-all min-w-0`,children:t})]})}function fu(e,t){let n=BigInt(e),r=BigInt(t);return n<r?-1:n>r?1:0}var pu=[`ssg://daemon/state`,`ssg://daemon/metrics`,`ssg://audit/recent?limit=10`,`ssg://frames/recent?limit=32`,`ssg://rules/list`,`ssg://rca/current`,`ssg://native/stats`];function mu(){let[e,t]=(0,_.useState)(`ssg://daemon/state`),[n,r]=(0,_.useState)(`ssg://daemon/state`);return(0,U.jsxs)(`div`,{className:`space-y-3`,children:[(0,U.jsx)(`div`,{className:`flex flex-wrap gap-2`,children:pu.map(e=>(0,U.jsx)(`button`,{type:`button`,onClick:()=>{t(e),r(e)},className:`chip text-[10px] `+(n===e?`border-[var(--color-brand)] text-[var(--color-fg-1)]`:`text-[var(--color-fg-3)]`),children:e},e))}),(0,U.jsxs)(`form`,{className:`flex items-center gap-2`,onSubmit:t=>{t.preventDefault(),r(e)},children:[(0,U.jsx)(`input`,{value:e,onChange:e=>t(e.target.value),placeholder:`ssg://source/path?k=v`,className:`flex-1 px-3 py-1.5 text-[12px] font-mono rounded-sm border border-[var(--color-line-1)] bg-[var(--color-surface-1)] text-[var(--color-fg-1)]`}),(0,U.jsx)(`button`,{type:`submit`,className:`px-3 py-1.5 text-[11px] font-mono uppercase tracking-wider border border-[var(--color-line-1)] rounded-sm hover:bg-[var(--color-surface-2)]`,children:`resolve`})]}),(0,U.jsx)(hu,{uri:n})]})}function hu({uri:e}){let t=je([`debug-frame`,`activity-updated`,`counters-updated`]),{data:n,loading:r,error:i,refetch:a}=R(`/api/json/debug?uri=${encodeURIComponent(e)}`,[t[`debug-frame`],t[`activity-updated`],t[`counters-updated`],e]),o=n?JSON.stringify(n.data,null,2):``;return(0,U.jsxs)(`div`,{className:`rounded-sm border border-[var(--color-line-1)] bg-[var(--color-surface-1)] p-3 space-y-2`,children:[(0,U.jsxs)(`header`,{className:`flex items-center justify-between`,children:[(0,U.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,U.jsx)(`h3`,{className:`text-[10px] font-mono uppercase tracking-wider text-[var(--color-fg-3)]`,children:e}),n?.snapshot_hash&&(0,U.jsxs)(`span`,{className:`text-[10px] font-mono text-[var(--color-fg-4)]`,children:[`hash `,n.snapshot_hash.slice(0,10),`…`]}),n?.stale&&(0,U.jsxs)(`span`,{className:`chip text-amber-300 border-amber-500/40 text-[10px]`,children:[`stale `,n.age_ms?`${Math.round(n.age_ms/1e3)}s`:``]})]}),(0,U.jsx)(`button`,{type:`button`,onClick:a,className:`text-[10px] font-mono uppercase tracking-wider text-[var(--color-fg-3)] hover:text-[var(--color-fg-1)]`,children:`refresh`})]}),r&&!n&&(0,U.jsx)(`p`,{className:`text-sm text-[var(--color-fg-4)]`,children:`resolving…`}),i&&(0,U.jsx)(`p`,{className:`text-sm text-rose-300`,children:i}),o&&(0,U.jsx)(`pre`,{className:`text-[11px] leading-snug font-mono text-[var(--color-fg-2)] overflow-auto max-h-[60vh] whitespace-pre-wrap break-all`,children:o})]})}var gu=`ssg-dashboard-tabs`,_u=2e3,vu=6e3;function yu(){return`tab-${Date.now()}-${Math.random().toString(36).slice(2,7)}`}function bu(){let[e,t]=(0,_.useState)(0),[n,r]=(0,_.useState)(!0),i=(0,_.useRef)(yu()),a=(0,_.useRef)(new Map);return(0,_.useEffect)(()=>{if(typeof BroadcastChannel>`u`)return;let e=new BroadcastChannel(gu);function n(){let e=Date.now();for(let[t,n]of a.current.entries())e-n>vu&&a.current.delete(t);let n=a.current.size;t(n),r([...a.current.keys(),i.current].sort()[0]===i.current)}function o(e){let t=e.data;!t||t.id===i.current||(t.type===`leave`?a.current.delete(t.id):a.current.set(t.id,Date.now()),n())}e.addEventListener(`message`,o),e.postMessage({type:`join`,id:i.current});let s=setInterval(()=>{e.postMessage({type:`heartbeat`,id:i.current}),n()},_u),c=()=>{e.postMessage({type:`leave`,id:i.current})};return window.addEventListener(`beforeunload`,c),()=>{clearInterval(s),e.postMessage({type:`leave`,id:i.current}),e.removeEventListener(`message`,o),e.close(),window.removeEventListener(`beforeunload`,c)}},[]),{otherTabCount:e,isLeader:n}}var xu=b;function Su(){(0,_.useEffect)(()=>we([]),[]);let e=(0,_.useSyncExternalStore)(he,ge),[,t]=(0,_.useState)(0);(0,_.useEffect)(()=>{if(e.connected||e.lastErrorAt===null)return;let n=setInterval(()=>t(e=>e+1),500);return()=>clearInterval(n)},[e.connected,e.lastErrorAt]);let n=Cu(e),r=n===`reconnecting`&&e.lastErrorAt!==null?Math.max(0,Math.ceil((e.lastErrorAt+e.reconnectDelayMs-Date.now())/1e3)):null,i=Math.round(xu/1e3);if(n===`connected`)return(0,U.jsxs)(`div`,{className:`flex items-center gap-1.5 text-[11px] font-mono uppercase tracking-wider text-[var(--color-fg-3)]`,title:`Telemetry Live — SSE connected`,"data-testid":`sse-status-chip`,"data-state":`connected`,children:[(0,U.jsx)(`span`,{className:`status-dot bg-emerald-400`}),(0,U.jsx)(`span`,{className:`hidden sm:inline`,children:`sse · live`})]});let a=n===`reconnecting`,o=a?`border-amber-500/40 bg-amber-500/10 text-amber-200`:`border-red-500/40 bg-red-500/10 text-red-200`,s=a?`bg-amber-400`:`bg-red-400`,c=a?r===null?`reconnecting`:`reconnect · ${r}s`:`offline`,l=`live paused · ${i}s poll`,u=a?`Live stream down — reconnect in ${r??`…`}s (attempt ${e.reconnectAttempts}). Dashboard is polling every ${i}s until SSE recovers.`:`Live stream disconnected. Dashboard is polling every ${i}s — data still updates, just at a coarser cadence.`;return(0,U.jsxs)(`div`,{className:`flex items-center gap-1.5 rounded border px-2 py-0.5 text-[11px] font-mono uppercase tracking-wider ${o}`,title:u,"data-testid":`sse-status-chip`,"data-state":n,role:`status`,"aria-live":`polite`,children:[(0,U.jsx)(`span`,{className:`status-dot ${s} pulse-soft`}),(0,U.jsx)(`span`,{className:`hidden md:inline`,children:l}),(0,U.jsx)(`span`,{className:`md:hidden`,children:c})]})}function Cu(e){return e.connected?`connected`:e.reconnectAttempts>0||e.lastErrorAt!==null?`reconnecting`:`disconnected`}var wu=`ssg:ui:font-scale:v1`,Tu=[{label:`S`,value:.9},{label:`M`,value:1},{label:`L`,value:1.15},{label:`XL`,value:1.3}],Eu=1;function Du(e){if(typeof e!=`number`||!Number.isFinite(e))return Eu;let t=Tu.find(t=>Math.abs(t.value-e)<.001);return t?t.value:Eu}function Ou(){if(typeof localStorage>`u`)return Eu;try{let e=localStorage.getItem(wu);return e===null?Eu:Du(parseFloat(e))}catch{return Eu}}function ku(e){if(!(typeof localStorage>`u`))try{localStorage.setItem(wu,String(e))}catch{}}function Au(e){typeof document>`u`||(document.documentElement.style.setProperty(`--ssg-font-scale`,String(e)),document.documentElement.style.fontSize=`${16*e}px`)}function ju(){let[e,t]=(0,_.useState)(()=>{let e=Ou();return Au(e),e});return(0,_.useEffect)(()=>{Au(e)},[e]),{scale:e,setScale:(0,_.useCallback)(e=>{t(e),ku(e),Au(e)},[])}}function Mu(){let{scale:e,setScale:t}=ju();return(0,U.jsx)(`div`,{role:`radiogroup`,"aria-label":`Font size`,className:`flex items-center gap-0.5 rounded-sm border border-[var(--color-line-1)] bg-[var(--color-surface-1)] p-0.5`,children:Tu.map(n=>{let r=Math.abs(n.value-e)<.001;return(0,U.jsx)(`button`,{role:`radio`,"aria-checked":r,onClick:()=>t(n.value),title:`Font size: ${n.label} (${Math.round(n.value*100)}%)`,className:`px-1.5 py-0.5 text-[10px] font-mono uppercase tracking-wider cursor-pointer transition-colors rounded-sm `+(r?`bg-[var(--color-surface-3)] text-[var(--color-fg-0)]`:`text-[var(--color-fg-3)] hover:text-[var(--color-fg-1)]`),children:n.label},n.label)})})}var Nu=[{path:`/`,label:`dashboard`},{path:`/graph`,label:`graph`},{path:`/rules`,label:`rules`},{path:`/audit`,label:`audit`},{path:`/approvals`,label:`approvals`},{path:`/hub`,label:`hub`},{path:`/profile`,label:`profile`},{path:`/monitor`,label:`monitor`},{path:`/observability`,label:`observability`},{path:`/debug`,label:`debug`}];function Pu(e){let t=Math.max(0,e-Date.now()),n=Math.floor(t/1e3);if(n<60)return`${n}s`;let r=Math.floor(n/60);return r<60?`${r}m ${n%60}s`:`${Math.floor(r/60)}h ${r%60}m`}function Fu(){let{data:e}=R(`/api/json/daemon-status`,[je([`counters-updated`])[`counters-updated`]]),[t,n]=(0,_.useState)(!1),[,r]=(0,_.useState)(0);(0,_.useEffect)(()=>{if(e?.status!==`degraded`||!e.hibernation)return;let t=setInterval(()=>r(e=>e+1),1e3);return()=>clearInterval(t)},[e?.status,e?.hibernation]);let i=e?.status??`starting`,a=i===`running`?`bg-emerald-400`:i===`starting`||i===`degraded`?`bg-amber-400`:`bg-red-400`,o=i===`starting`||i===`degraded`?`pulse-soft`:``,s=i===`degraded`&&e?.hibernation?Pu(e.hibernation.nextRetryAt):null,c=i===`running`?`daemon · online`:i===`starting`?`daemon · booting`:i===`degraded`?`daemon · retry ${s??`…`}`:i===`error`?`daemon · error`:`daemon · offline`;return(0,U.jsxs)(`div`,{className:`relative`,children:[(0,U.jsxs)(`button`,{onClick:()=>n(e=>!e),className:`flex items-center gap-1.5 text-[11px] font-mono uppercase tracking-wider text-[var(--color-fg-3)] hover:text-[var(--color-fg-1)] transition-colors cursor-pointer`,title:i===`running`?`Daemon running`:i===`starting`?`Daemon starting…`:i===`degraded`?`Daemon hibernating — retry in ${s??`…`}`:i===`error`?`Daemon error`:`Daemon stopped`,children:[(0,U.jsx)(`span`,{className:`status-dot ${a} ${o}`}),(0,U.jsx)(`span`,{className:`hidden sm:inline`,children:c})]}),t&&(0,U.jsxs)(`div`,{className:`absolute right-0 top-7 z-50 w-72 bg-[var(--color-surface-1)] border border-[var(--color-line-2)] rounded-sm shadow-xl p-3 text-xs`,children:[(0,U.jsxs)(`div`,{className:`flex items-center justify-between mb-2`,children:[(0,U.jsx)(`span`,{className:`overline`,children:`eval daemon`}),(0,U.jsx)(`button`,{onClick:()=>n(!1),className:`text-[var(--color-fg-4)] hover:text-[var(--color-fg-1)] cursor-pointer`,children:`✕`})]}),(0,U.jsxs)(`div`,{className:`space-y-1 text-[var(--color-fg-2)]`,children:[(0,U.jsxs)(`div`,{className:`font-mono text-[11px]`,children:[`status:`,` `,(0,U.jsx)(`span`,{className:i===`running`?`text-emerald-300`:i===`starting`||i===`degraded`?`text-amber-300`:`text-red-300`,children:i})]}),e?.pid&&(0,U.jsxs)(`div`,{className:`font-mono text-[11px]`,children:[`pid: `,e.pid]}),i===`degraded`&&e?.hibernation&&(0,U.jsxs)(`div`,{className:`mt-2 rounded-sm border border-amber-500/25 bg-amber-500/5 p-2 text-[11px] text-amber-300 space-y-0.5`,children:[(0,U.jsxs)(`div`,{children:[`next retry:`,` `,(0,U.jsx)(`span`,{className:`font-medium`,children:s})]}),(0,U.jsxs)(`div`,{children:[`episode attempt: `,e.hibernation.attempt,e.hibernation.reason?` (${e.hibernation.reason})`:``]}),(0,U.jsx)(`div`,{className:`text-amber-400/70`,children:`Slow-tier supervisor is retrying at long backoff — no manual restart required.`})]})]}),e?.logTail&&e.logTail.length>0&&(0,U.jsxs)(`div`,{className:`mt-3`,children:[(0,U.jsx)(`div`,{className:`overline mb-1`,children:`recent log`}),(0,U.jsx)(`pre`,{className:`bg-[var(--color-surface-0)] border border-[var(--color-line-0)] rounded-sm p-2 text-[10px] text-[var(--color-fg-2)] overflow-x-auto whitespace-pre-wrap break-all max-h-32 overflow-y-auto`,children:e.logTail.join(`
|
|
22
|
-
`)})]})]})]})}function
|
|
21
|
+
`,`ssg_debug_rca(`,`{`,`auto_current:true`,`}`,`)`]}),(0,W.jsx)(`button`,{type:`button`,onClick:a,className:`w-full mt-2 px-2 py-1 border border-[var(--color-line-1)] rounded-sm hover:bg-[var(--color-surface-2)]`,children:`refresh`}),t?.snapshot_hash&&(0,W.jsxs)(`p`,{className:`text-[10px] opacity-60`,children:[`hash `,t.snapshot_hash.slice(0,12),`…`]})]})]})}function au(e){return e===`critical`?`text-rose-400 border-rose-500/40`:e===`high`?`text-amber-300 border-amber-500/40`:e===`medium`?`text-sky-300 border-sky-500/40`:`text-[var(--color-fg-3)] border-[var(--color-line-1)]`}function ou({pack:e}){return(0,W.jsxs)(W.Fragment,{children:[(0,W.jsxs)(`header`,{className:`flex items-start justify-between gap-4`,children:[(0,W.jsxs)(`div`,{children:[(0,W.jsxs)(`p`,{className:`text-[10px] font-mono uppercase tracking-wider text-[var(--color-fg-4)]`,children:[`rca pack · `,new Date(e.ts_ms).toLocaleTimeString()]}),(0,W.jsx)(`h2`,{className:`text-[15px] font-medium text-[var(--color-fg-1)] mt-1`,children:e.summary}),e.trace_id&&(0,W.jsxs)(`p`,{className:`text-[11px] font-mono text-[var(--color-fg-4)] mt-1`,children:[`trace_id · `,e.trace_id]})]}),(0,W.jsx)(`span`,{className:`chip uppercase text-[10px] tracking-wider `+au(e.severity),children:e.severity})]}),e.hypothesis&&e.hypothesis.length>0&&(0,W.jsxs)(`section`,{children:[(0,W.jsx)(`h3`,{className:`text-[10px] font-mono uppercase tracking-wider text-[var(--color-fg-3)] mb-2`,children:`hypothesis`}),(0,W.jsx)(`ol`,{className:`space-y-2`,children:e.hypothesis.map((e,t)=>(0,W.jsxs)(`li`,{className:`p-2 rounded-sm bg-[var(--color-surface-2)] border border-[var(--color-line-1)]`,children:[(0,W.jsxs)(`div`,{className:`flex items-center justify-between gap-3`,children:[(0,W.jsx)(`p`,{className:`text-[13px] text-[var(--color-fg-1)]`,children:e.cause}),(0,W.jsxs)(`span`,{className:`text-[10px] font-mono text-[var(--color-fg-4)]`,children:[`conf `,(e.confidence*100).toFixed(0),`%`]})]}),e.evidence.length>0&&(0,W.jsx)(`ul`,{className:`mt-1 pl-3 text-[11px] text-[var(--color-fg-3)] list-disc list-inside space-y-0.5`,children:e.evidence.map((e,t)=>(0,W.jsx)(`li`,{children:e},t))})]},t))})]}),e.suggested_next_actions&&e.suggested_next_actions.length>0&&(0,W.jsxs)(`section`,{children:[(0,W.jsx)(`h3`,{className:`text-[10px] font-mono uppercase tracking-wider text-[var(--color-fg-3)] mb-2`,children:`suggested next actions`}),(0,W.jsx)(`ul`,{className:`space-y-1 text-[13px] text-[var(--color-fg-2)]`,children:e.suggested_next_actions.map((e,t)=>(0,W.jsxs)(`li`,{className:`font-mono text-[12px]`,children:[`→ `,e]},t))})]}),e.state_snapshot&&e.state_snapshot.length>0&&(0,W.jsxs)(`section`,{children:[(0,W.jsx)(`h3`,{className:`text-[10px] font-mono uppercase tracking-wider text-[var(--color-fg-3)] mb-2`,children:`expand`}),(0,W.jsx)(`ul`,{className:`space-y-1 text-[11px] font-mono`,children:e.state_snapshot.map(e=>(0,W.jsxs)(`li`,{className:`text-[var(--color-fg-3)]`,children:[(0,W.jsx)(`code`,{className:`text-sky-300`,children:e.uri}),(0,W.jsxs)(`span`,{className:`opacity-50 ml-2`,children:[e.hash.slice(0,10),`…`]})]},e.uri))})]})]})}var su=[`hook-ingress`,`parse`,`match`,`ffi-call`,`decide`,`audit`,`respond`],cu={"hook-ingress":`#6ea8ff`,parse:`#a78bfa`,match:`#60d394`,"ffi-call":`#f59e0b`,decide:`#f472b6`,audit:`#94a3b8`,respond:`#22d3ee`};function lu(){let{data:e,loading:t,error:n}=z(`/api/json/debug?uri=ssg%3A%2F%2Fframes%2Frecent%3Flimit%3D1024`,[je([`debug-frame`])[`debug-frame`]]),r=e?.data?.frames??[],a=e?.data?.dropped??0,[o,s]=(0,v.useState)(null);return(0,W.jsxs)(`div`,{className:`grid grid-cols-1 xl:grid-cols-[1fr_320px] gap-4`,children:[(0,W.jsxs)(`article`,{className:`rounded-sm border border-[var(--color-line-1)] bg-[var(--color-surface-1)] p-3 space-y-2`,children:[(0,W.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,W.jsxs)(`h3`,{className:`text-[10px] font-mono uppercase tracking-wider text-[var(--color-fg-3)]`,children:[`frames · `,r.length,a>0&&(0,W.jsxs)(`span`,{className:`ml-2 text-amber-300`,children:[`dropped · `,a]})]}),(0,W.jsx)(`span`,{className:`text-[10px] font-mono text-[var(--color-fg-4)]`,children:`ssg://frames/recent`})]}),n&&(0,W.jsxs)(`p`,{className:`text-sm text-rose-300`,children:[`timeline fetch error: `,n]}),t&&r.length===0?(0,W.jsx)(`p`,{className:`text-sm text-[var(--color-fg-4)]`,children:`loading…`}):r.length===0?(0,W.jsx)(uu,{}):(0,W.jsxs)(W.Fragment,{children:[(0,W.jsx)(fu,{frames:r,onSelect:s}),(0,W.jsx)(du,{})]})]}),(0,W.jsxs)(`aside`,{className:`rounded-sm border border-[var(--color-line-1)] bg-[var(--color-surface-1)] p-3 space-y-2 text-[11px] font-mono text-[var(--color-fg-3)]`,children:[(0,W.jsx)(`p`,{className:`uppercase tracking-wider text-[var(--color-fg-2)]`,children:`frame inspector`}),o?(0,W.jsx)(pu,{frame:o}):(0,W.jsx)(`p`,{className:`opacity-60`,children:`click a bar to inspect`})]})]})}function uu(){return(0,W.jsxs)(`div`,{className:`text-[12px] text-[var(--color-fg-3)] space-y-1 py-4`,children:[(0,W.jsx)(`p`,{children:`no frames yet`}),(0,W.jsx)(`p`,{className:`text-[11px] text-[var(--color-fg-4)] font-mono`,children:`SSG_DEBUG_ENABLED=1 ssg daemon`}),(0,W.jsx)(`p`,{className:`text-[11px] text-[var(--color-fg-4)]`,children:`then fire an eval — frames stream in live.`})]})}function du(){return(0,W.jsx)(`div`,{className:`flex flex-wrap gap-3 text-[10px] font-mono text-[var(--color-fg-4)]`,children:su.map(e=>(0,W.jsxs)(`span`,{className:`flex items-center gap-1`,children:[(0,W.jsx)(`span`,{className:`inline-block w-2 h-2 rounded-sm`,style:{background:cu[e]}}),e]},e))})}function fu({frames:e,onSelect:t}){let n=(0,v.useRef)(null),r=(0,v.useRef)([]),[a,o]=(0,v.useState)(-1),{rows:s,tMin:c,tMax:l}=(0,v.useMemo)(()=>{let t=new Map;for(let n of e){let e=t.get(n.trace_id)??[];e.push(n),t.set(n.trace_id,e)}let n=Array.from(t.entries()).map(([e,t])=>({trace_id:e,frames:t.slice().sort((e,t)=>hu(e.ts_start_ns,t.ts_start_ns))}));n.sort((e,t)=>hu(e.frames[0].ts_start_ns,t.frames[0].ts_start_ns));let r=null,a=null;for(let t of e){let e=BigInt(t.ts_start_ns),n=BigInt(t.ts_end_ns);(r===null||e<r)&&(r=e),(a===null||n>a)&&(a=n)}return{rows:n,tMin:r??0n,tMax:a??1n}},[e]);(0,v.useEffect)(()=>{let e=n.current;if(!e)return;let t=window.devicePixelRatio||1,o=e.clientWidth,u=Math.max(120,s.length*22+24);e.width=o*t,e.height=u*t,e.style.height=`${u}px`;let d=e.getContext(`2d`);if(!d)return;d.setTransform(t,0,0,t,0,0),d.clearRect(0,0,o,u),d.strokeStyle=`rgba(255,255,255,0.04)`,d.lineWidth=1;for(let e=1;e<4;e++){let t=e*o/4;d.beginPath(),d.moveTo(t,0),d.lineTo(t,u),d.stroke()}let f=l>c?Number(l-c):1,p=o-110-8;d.font=`10px ui-monospace, monospace`,d.textBaseline=`middle`;let m=[];if(s.forEach((e,t)=>{let n=8+t*22;d.fillStyle=`rgba(255,255,255,0.55)`,d.fillText(e.trace_id.slice(0,10),6,n+18/2);for(let t of e.frames){let e=Number(BigInt(t.ts_start_ns)-c),r=Number(BigInt(t.ts_end_ns)-c),a=110+e/f*p,o=Math.max(2,(r-e)/f*p);d.fillStyle=cu[t.stage]??`#888`,d.globalAlpha=t.result===`error`?1:.82,d.fillRect(a,n,o,18),d.globalAlpha=1,t.result===`error`&&(d.strokeStyle=`#f43f5e`,d.lineWidth=1.5,d.strokeRect(a+.5,n+.5,o-1,17)),m.push({x:a,y:n,w:o,h:18,frame:t})}}),r.current=m,a>=0&&a<m.length){let e=m[a];d.strokeStyle=`#fff`,d.lineWidth=1.5,d.strokeRect(e.x+.5,e.y+.5,e.w-1,e.h-1)}},[s,c,l,a]);function u(e){let t=n.current;if(!t)return-1;let a=t.getBoundingClientRect(),o=e.clientX-a.left,s=e.clientY-a.top;for(let e=r.current.length-1;e>=0;e--){let t=r.current[e];if(o>=t.x&&o<=t.x+t.w&&s>=t.y&&s<=t.y+t.h)return e}return-1}return(0,W.jsx)(`canvas`,{ref:n,className:`w-full block cursor-crosshair`,onMouseMove:e=>o(u(e)),onMouseLeave:()=>o(-1),onClick:e=>{let n=u(e);t(n>=0?r.current[n].frame:null)}})}function pu({frame:e}){let t=Number(BigInt(e.ts_end_ns)-BigInt(e.ts_start_ns)),n=t>=1e6?`${(t/1e6).toFixed(2)}ms`:t>=1e3?`${(t/1e3).toFixed(1)}µs`:`${t}ns`;return(0,W.jsxs)(`dl`,{className:`space-y-1`,children:[(0,W.jsxs)(mu,{k:`stage`,children:[(0,W.jsx)(`span`,{className:`inline-block w-2 h-2 rounded-sm mr-1 align-middle`,style:{background:cu[e.stage]??`#888`}}),e.stage]}),(0,W.jsx)(mu,{k:`tool`,children:e.tool}),(0,W.jsx)(mu,{k:`result`,children:(0,W.jsx)(`span`,{className:e.result===`error`?`text-rose-300`:e.result===`skip`?`text-[var(--color-fg-4)]`:`text-emerald-300`,children:e.result})}),(0,W.jsx)(mu,{k:`dur`,children:n}),e.rule_id&&(0,W.jsx)(mu,{k:`rule`,children:e.rule_id}),e.error&&(0,W.jsxs)(W.Fragment,{children:[(0,W.jsx)(mu,{k:`err.type`,children:(0,W.jsx)(`span`,{className:`text-rose-300`,children:e.error.type})}),(0,W.jsx)(mu,{k:`err.msg`,children:(0,W.jsx)(`span`,{className:`text-rose-200`,children:e.error.message})})]}),e.input_preview&&(0,W.jsx)(mu,{k:`input`,children:(0,W.jsx)(`code`,{className:`text-[10px] break-all`,children:e.input_preview})}),(0,W.jsx)(mu,{k:`trace`,children:(0,W.jsx)(`code`,{className:`text-[10px]`,children:e.trace_id})}),(0,W.jsx)(mu,{k:`frame`,children:(0,W.jsx)(`code`,{className:`text-[10px]`,children:e.frame_id})})]})}function mu({k:e,children:t}){return(0,W.jsxs)(`div`,{className:`flex gap-2 text-[11px] leading-tight`,children:[(0,W.jsx)(`dt`,{className:`text-[var(--color-fg-4)] w-16 shrink-0 uppercase tracking-wider`,children:e}),(0,W.jsx)(`dd`,{className:`text-[var(--color-fg-2)] break-all min-w-0`,children:t})]})}function hu(e,t){let n=BigInt(e),r=BigInt(t);return n<r?-1:n>r?1:0}var gu=[`ssg://daemon/state`,`ssg://daemon/metrics`,`ssg://audit/recent?limit=10`,`ssg://frames/recent?limit=32`,`ssg://rules/list`,`ssg://rca/current`,`ssg://native/stats`];function _u(){let[e,t]=(0,v.useState)(`ssg://daemon/state`),[n,r]=(0,v.useState)(`ssg://daemon/state`);return(0,W.jsxs)(`div`,{className:`space-y-3`,children:[(0,W.jsx)(`div`,{className:`flex flex-wrap gap-2`,children:gu.map(e=>(0,W.jsx)(`button`,{type:`button`,onClick:()=>{t(e),r(e)},className:`chip text-[10px] `+(n===e?`border-[var(--color-brand)] text-[var(--color-fg-1)]`:`text-[var(--color-fg-3)]`),children:e},e))}),(0,W.jsxs)(`form`,{className:`flex items-center gap-2`,onSubmit:t=>{t.preventDefault(),r(e)},children:[(0,W.jsx)(`input`,{value:e,onChange:e=>t(e.target.value),placeholder:`ssg://source/path?k=v`,className:`flex-1 px-3 py-1.5 text-[12px] font-mono rounded-sm border border-[var(--color-line-1)] bg-[var(--color-surface-1)] text-[var(--color-fg-1)]`}),(0,W.jsx)(`button`,{type:`submit`,className:`px-3 py-1.5 text-[11px] font-mono uppercase tracking-wider border border-[var(--color-line-1)] rounded-sm hover:bg-[var(--color-surface-2)]`,children:`resolve`})]}),(0,W.jsx)(vu,{uri:n})]})}function vu({uri:e}){let t=je([`debug-frame`,`activity-updated`,`counters-updated`]),{data:n,loading:r,error:a,refetch:o}=z(`/api/json/debug?uri=${encodeURIComponent(e)}`,[t[`debug-frame`],t[`activity-updated`],t[`counters-updated`],e]),s=n?JSON.stringify(n.data,null,2):``;return(0,W.jsxs)(`div`,{className:`rounded-sm border border-[var(--color-line-1)] bg-[var(--color-surface-1)] p-3 space-y-2`,children:[(0,W.jsxs)(`header`,{className:`flex items-center justify-between`,children:[(0,W.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,W.jsx)(`h3`,{className:`text-[10px] font-mono uppercase tracking-wider text-[var(--color-fg-3)]`,children:e}),n?.snapshot_hash&&(0,W.jsxs)(`span`,{className:`text-[10px] font-mono text-[var(--color-fg-4)]`,children:[`hash `,n.snapshot_hash.slice(0,10),`…`]}),n?.stale&&(0,W.jsxs)(`span`,{className:`chip text-amber-300 border-amber-500/40 text-[10px]`,children:[`stale `,n.age_ms?`${Math.round(n.age_ms/1e3)}s`:``]})]}),(0,W.jsx)(`button`,{type:`button`,onClick:o,className:`text-[10px] font-mono uppercase tracking-wider text-[var(--color-fg-3)] hover:text-[var(--color-fg-1)]`,children:`refresh`})]}),r&&!n&&(0,W.jsx)(`p`,{className:`text-sm text-[var(--color-fg-4)]`,children:`resolving…`}),a&&(0,W.jsx)(`p`,{className:`text-sm text-rose-300`,children:a}),s&&(0,W.jsx)(`pre`,{className:`text-[11px] leading-snug font-mono text-[var(--color-fg-2)] overflow-auto max-h-[60vh] whitespace-pre-wrap break-all`,children:s})]})}var yu=`ssg-dashboard-tabs`,bu=2e3,xu=6e3;function Su(){return`tab-${Date.now()}-${Math.random().toString(36).slice(2,7)}`}function Cu(){let[e,t]=(0,v.useState)(0),[n,r]=(0,v.useState)(!0),a=(0,v.useRef)(Su()),o=(0,v.useRef)(new Map);return(0,v.useEffect)(()=>{if(typeof BroadcastChannel>`u`)return;let e=new BroadcastChannel(yu);function n(){let e=Date.now();for(let[t,n]of o.current.entries())e-n>xu&&o.current.delete(t);let n=o.current.size;t(n),r([...o.current.keys(),a.current].sort()[0]===a.current)}function s(e){let t=e.data;!t||t.id===a.current||(t.type===`leave`?o.current.delete(t.id):o.current.set(t.id,Date.now()),n())}e.addEventListener(`message`,s),e.postMessage({type:`join`,id:a.current});let c=setInterval(()=>{e.postMessage({type:`heartbeat`,id:a.current}),n()},bu),l=()=>{e.postMessage({type:`leave`,id:a.current})};return window.addEventListener(`beforeunload`,l),()=>{clearInterval(c),e.postMessage({type:`leave`,id:a.current}),e.removeEventListener(`message`,s),e.close(),window.removeEventListener(`beforeunload`,l)}},[]),{otherTabCount:e,isLeader:n}}var wu=x;function Tu(){(0,v.useEffect)(()=>we([]),[]);let e=(0,v.useSyncExternalStore)(he,ge),[,t]=(0,v.useState)(0);(0,v.useEffect)(()=>{if(e.connected||e.lastErrorAt===null)return;let n=setInterval(()=>t(e=>e+1),500);return()=>clearInterval(n)},[e.connected,e.lastErrorAt]);let n=Eu(e),r=n===`reconnecting`&&e.lastErrorAt!==null?Math.max(0,Math.ceil((e.lastErrorAt+e.reconnectDelayMs-Date.now())/1e3)):null,a=Math.round(wu/1e3);if(n===`connected`)return(0,W.jsxs)(`div`,{className:`flex items-center gap-1.5 text-[11px] font-mono uppercase tracking-wider text-[var(--color-fg-3)]`,title:`Telemetry Live — SSE connected`,"data-testid":`sse-status-chip`,"data-state":`connected`,children:[(0,W.jsx)(`span`,{className:`status-dot bg-emerald-400`}),(0,W.jsx)(`span`,{className:`hidden sm:inline`,children:`sse · live`})]});let o=n===`reconnecting`,s=o?`border-amber-500/40 bg-amber-500/10 text-amber-200`:`border-red-500/40 bg-red-500/10 text-red-200`,c=o?`bg-amber-400`:`bg-red-400`,l=o?r===null?`reconnecting`:`reconnect · ${r}s`:`offline`,u=`live paused · ${a}s poll`,d=o?`Live stream down — reconnect in ${r??`…`}s (attempt ${e.reconnectAttempts}). Dashboard is polling every ${a}s until SSE recovers.`:`Live stream disconnected. Dashboard is polling every ${a}s — data still updates, just at a coarser cadence.`;return(0,W.jsxs)(`div`,{className:`flex items-center gap-1.5 rounded border px-2 py-0.5 text-[11px] font-mono uppercase tracking-wider ${s}`,title:d,"data-testid":`sse-status-chip`,"data-state":n,role:`status`,"aria-live":`polite`,children:[(0,W.jsx)(`span`,{className:`status-dot ${c} pulse-soft`}),(0,W.jsx)(`span`,{className:`hidden md:inline`,children:u}),(0,W.jsx)(`span`,{className:`md:hidden`,children:l})]})}function Eu(e){return e.connected?`connected`:e.reconnectAttempts>0||e.lastErrorAt!==null?`reconnecting`:`disconnected`}var Du=`ssg:ui:font-scale:v1`,Ou=[{label:`S`,value:.9},{label:`M`,value:1},{label:`L`,value:1.15},{label:`XL`,value:1.3}],ku=1;function Au(e){if(typeof e!=`number`||!Number.isFinite(e))return ku;let t=Ou.find(t=>Math.abs(t.value-e)<.001);return t?t.value:ku}function ju(){if(typeof localStorage>`u`)return ku;try{let e=localStorage.getItem(Du);return e===null?ku:Au(parseFloat(e))}catch{return ku}}function Mu(e){if(!(typeof localStorage>`u`))try{localStorage.setItem(Du,String(e))}catch{}}function Nu(e){typeof document>`u`||(document.documentElement.style.setProperty(`--ssg-font-scale`,String(e)),document.documentElement.style.fontSize=`${16*e}px`)}function Pu(){let[e,t]=(0,v.useState)(()=>{let e=ju();return Nu(e),e});return(0,v.useEffect)(()=>{Nu(e)},[e]),{scale:e,setScale:(0,v.useCallback)(e=>{t(e),Mu(e),Nu(e)},[])}}function Fu(){let{scale:e,setScale:t}=Pu();return(0,W.jsx)(`div`,{role:`radiogroup`,"aria-label":`Font size`,className:`flex items-center gap-0.5 rounded-sm border border-[var(--color-line-1)] bg-[var(--color-surface-1)] p-0.5`,children:Ou.map(n=>{let r=Math.abs(n.value-e)<.001;return(0,W.jsx)(`button`,{role:`radio`,"aria-checked":r,onClick:()=>t(n.value),title:`Font size: ${n.label} (${Math.round(n.value*100)}%)`,className:`px-1.5 py-0.5 text-[10px] font-mono uppercase tracking-wider cursor-pointer transition-colors rounded-sm `+(r?`bg-[var(--color-surface-3)] text-[var(--color-fg-0)]`:`text-[var(--color-fg-3)] hover:text-[var(--color-fg-1)]`),children:n.label},n.label)})})}var Iu=[{path:`/`,label:`dashboard`},{path:`/graph`,label:`graph`},{path:`/rules`,label:`rules`},{path:`/audit`,label:`audit`},{path:`/approvals`,label:`approvals`},{path:`/hub`,label:`hub`},{path:`/profile`,label:`profile`},{path:`/monitor`,label:`monitor`},{path:`/observability`,label:`observability`},{path:`/debug`,label:`debug`}];function Lu(e){let t=Math.max(0,e-Date.now()),n=Math.floor(t/1e3);if(n<60)return`${n}s`;let r=Math.floor(n/60);return r<60?`${r}m ${n%60}s`:`${Math.floor(r/60)}h ${r%60}m`}function Ru(){let{data:e}=z(`/api/json/daemon-status`,[je([`counters-updated`])[`counters-updated`]]),[t,n]=(0,v.useState)(!1),[,r]=(0,v.useState)(0);(0,v.useEffect)(()=>{if(e?.status!==`degraded`||!e.hibernation)return;let t=setInterval(()=>r(e=>e+1),1e3);return()=>clearInterval(t)},[e?.status,e?.hibernation]);let a=e?.status??`starting`,o=a===`running`?`bg-emerald-400`:a===`starting`||a===`degraded`?`bg-amber-400`:`bg-red-400`,s=a===`starting`||a===`degraded`?`pulse-soft`:``,c=a===`degraded`&&e?.hibernation?Lu(e.hibernation.nextRetryAt):null,l=a===`running`?`daemon · online`:a===`starting`?`daemon · booting`:a===`degraded`?`daemon · retry ${c??`…`}`:a===`error`?`daemon · error`:`daemon · offline`;return(0,W.jsxs)(`div`,{className:`relative`,children:[(0,W.jsxs)(`button`,{onClick:()=>n(e=>!e),className:`flex items-center gap-1.5 text-[11px] font-mono uppercase tracking-wider text-[var(--color-fg-3)] hover:text-[var(--color-fg-1)] transition-colors cursor-pointer`,title:a===`running`?`Daemon running`:a===`starting`?`Daemon starting…`:a===`degraded`?`Daemon hibernating — retry in ${c??`…`}`:a===`error`?`Daemon error`:`Daemon stopped`,children:[(0,W.jsx)(`span`,{className:`status-dot ${o} ${s}`}),(0,W.jsx)(`span`,{className:`hidden sm:inline`,children:l})]}),t&&(0,W.jsxs)(`div`,{className:`absolute right-0 top-7 z-50 w-72 bg-[var(--color-surface-1)] border border-[var(--color-line-2)] rounded-sm shadow-xl p-3 text-xs`,children:[(0,W.jsxs)(`div`,{className:`flex items-center justify-between mb-2`,children:[(0,W.jsx)(`span`,{className:`overline`,children:`eval daemon`}),(0,W.jsx)(`button`,{onClick:()=>n(!1),className:`text-[var(--color-fg-4)] hover:text-[var(--color-fg-1)] cursor-pointer`,children:`✕`})]}),(0,W.jsxs)(`div`,{className:`space-y-1 text-[var(--color-fg-2)]`,children:[(0,W.jsxs)(`div`,{className:`font-mono text-[11px]`,children:[`status:`,` `,(0,W.jsx)(`span`,{className:a===`running`?`text-emerald-300`:a===`starting`||a===`degraded`?`text-amber-300`:`text-red-300`,children:a})]}),e?.pid&&(0,W.jsxs)(`div`,{className:`font-mono text-[11px]`,children:[`pid: `,e.pid]}),a===`degraded`&&e?.hibernation&&(0,W.jsxs)(`div`,{className:`mt-2 rounded-sm border border-amber-500/25 bg-amber-500/5 p-2 text-[11px] text-amber-300 space-y-0.5`,children:[(0,W.jsxs)(`div`,{children:[`next retry:`,` `,(0,W.jsx)(`span`,{className:`font-medium`,children:c})]}),(0,W.jsxs)(`div`,{children:[`episode attempt: `,e.hibernation.attempt,e.hibernation.reason?` (${e.hibernation.reason})`:``]}),(0,W.jsx)(`div`,{className:`text-amber-400/70`,children:`Slow-tier supervisor is retrying at long backoff — no manual restart required.`})]})]}),e?.logTail&&e.logTail.length>0&&(0,W.jsxs)(`div`,{className:`mt-3`,children:[(0,W.jsx)(`div`,{className:`overline mb-1`,children:`recent log`}),(0,W.jsx)(`pre`,{className:`bg-[var(--color-surface-0)] border border-[var(--color-line-0)] rounded-sm p-2 text-[10px] text-[var(--color-fg-2)] overflow-x-auto whitespace-pre-wrap break-all max-h-32 overflow-y-auto`,children:e.logTail.join(`
|
|
22
|
+
`)})]})]})]})}function zu(){let{data:e}=z(`/api/state/activity-degraded`);if(!e?.degraded)return null;let t=e.since?new Date(e.since).toLocaleTimeString():`recently`;return(0,W.jsxs)(`div`,{role:`status`,className:`border-b border-amber-500/40 bg-amber-500/10 px-4 py-1.5 text-[11px] font-mono text-amber-200 text-center`,title:e.reason??`audit-worker degraded`,children:[`audit pipeline degraded since `,t,` — entries may be missing. Run`,` `,(0,W.jsx)(`code`,{className:`text-amber-100`,children:`ssg daemon --status`}),` to inspect.`]})}function Bu(){let{data:e}=z(`/api/json/license`,[je([`counters-updated`])[`counters-updated`]]);return!e||e.tier!==`unlicensed`||e.eval_daily_limit===null||e.evals_today<e.eval_daily_limit?null:(0,W.jsxs)(`div`,{role:`alert`,className:`border-b border-red-500/50 bg-red-500/10 px-4 py-1.5 text-[11px] font-mono text-red-200 text-center`,title:`Free tier daily eval limit reached — rules are being bypassed until quota resets`,children:[`quota exhausted — `,e.evals_today.toLocaleString(),`/`,e.eval_daily_limit.toLocaleString(),` evals used today. BLOCK and ASK rules are being bypassed (fail-open) until daily reset.`,` `,(0,W.jsx)(`a`,{href:e.upgrade_url,target:`_blank`,rel:`noopener noreferrer`,className:`text-red-100 underline hover:text-white`,children:`Upgrade to Pro →`})]})}function Vu(){let{data:e,refetch:t}=z(`/api/json/ask-mode`),[n,r]=(0,v.useState)(!1),a=e?.mode??`tty`;async function o(e){if(!(n||e===a)){r(!0);try{await fetch(`/api/json/ask-mode`,{method:`POST`,headers:{"Content-Type":`application/json`,...Ae()},body:JSON.stringify({mode:e})}),t()}finally{r(!1)}}}let s=a===`tty`;return(0,W.jsxs)(`button`,{onClick:()=>o(s?`dashboard`:`tty`),disabled:n,className:`flex items-center gap-1.5 text-[11px] font-mono uppercase tracking-wider text-[var(--color-fg-3)] hover:text-[var(--color-fg-1)] transition-colors cursor-pointer disabled:opacity-50`,title:s?`ASK decisions prompt in the native IDE/TTY. Click to route to dashboard.`:`ASK decisions queue on /approvals. Click to route to native prompt.`,children:[(0,W.jsx)(`span`,{className:`status-dot ${s?`bg-sky-400`:`bg-violet-400`}`}),(0,W.jsx)(`span`,{className:`hidden sm:inline`,children:s?`ask · native`:`ask · dashboard`})]})}function Hu(){let{data:e}=z(`/api/json/mcp-status`,[je([`activity-updated`])[`activity-updated`]]),t=e?.status??`inactive`;if(t===`inactive`)return null;let n=t===`active`?`bg-sky-400`:`bg-[var(--color-fg-4)]`,r=t===`active`?`mcp · active`:`mcp · idle`;return(0,W.jsxs)(`div`,{className:`flex items-center gap-1.5 text-[11px] font-mono uppercase tracking-wider text-[var(--color-fg-3)]`,title:t===`active`?`MCP server: ${e?.recentCount??0} evals in last 5 min`:`MCP server: ${e?.totalCount??0} total evals`,children:[(0,W.jsx)(`span`,{className:`status-dot ${n}`}),(0,W.jsx)(`span`,{className:`hidden sm:inline`,children:r})]})}function Uu(e){if(e===`/`)return(0,W.jsx)(gs,{});if(e===`/classic`)return(0,W.jsx)(Xs,{});if(e===`/graph`)return(0,W.jsx)(eu,{});if(e===`/debug`)return(0,W.jsx)(nu,{});if(e===`/rules`)return(0,W.jsx)(ic,{});if(e===`/audit`)return(0,W.jsx)(cc,{});if(e===`/approvals`)return(0,W.jsx)(vc,{});if(e===`/profile`)return(0,W.jsx)(Ic,{});if(e===`/hub/connect`)return(0,W.jsx)(qc,{});if(e===`/hub/publish`)return(0,W.jsx)(Jc,{});if(e.startsWith(`/hub/`)){let t=e.slice(5);if(t)return(0,W.jsx)(Kc,{id:t})}return e===`/hub`?(0,W.jsx)(Wc,{}):e===`/monitor`?(0,W.jsx)(sl,{}):e===`/observability`?(0,W.jsx)(Dl,{}):(0,W.jsxs)(`div`,{className:`flex flex-col items-center justify-center py-24 text-[var(--color-fg-3)]`,children:[(0,W.jsx)(`p`,{className:`overline mb-2`,children:`error · 404`}),(0,W.jsx)(`p`,{className:`text-sm`,children:`page not found`}),(0,W.jsx)(`a`,{href:`/`,className:`mt-4 text-[11px] font-mono uppercase tracking-wider text-[var(--color-brand)] hover:underline`,children:`← back to dashboard`})]})}function Wu(e){history.pushState(null,``,e),window.dispatchEvent(new PopStateEvent(`popstate`))}function Gu({count:e}){let[t,n]=(0,v.useState)(!1);return t||e===0?null:(0,W.jsx)(`div`,{className:`border-b border-amber-500/25 bg-amber-500/5 px-4 py-2`,children:(0,W.jsxs)(`div`,{className:`max-w-7xl mx-auto flex items-center gap-3`,children:[(0,W.jsxs)(`svg`,{className:`shrink-0 text-amber-300`,width:`13`,height:`13`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2.5`,strokeLinecap:`round`,strokeLinejoin:`round`,children:[(0,W.jsx)(`path`,{d:`M10.29 3.86 1.82 18a2 2 0 0 0 1.71 3h16.94a2 2 0 0 0 1.71-3L13.71 3.86a2 2 0 0 0-3.42 0z`}),(0,W.jsx)(`line`,{x1:`12`,y1:`9`,x2:`12`,y2:`13`}),(0,W.jsx)(`line`,{x1:`12`,y1:`17`,x2:`12.01`,y2:`17`})]}),(0,W.jsxs)(`p`,{className:`text-[11px] text-amber-200 flex-1 font-mono`,children:[(0,W.jsxs)(`span`,{className:`font-semibold uppercase tracking-wider`,children:[e,` other `,e===1?`tab`:`tabs`,` open.`]}),` `,`Each tab holds a live SSE connection. Browsers limit connections per origin — too many tabs will prevent this page from loading.`,` `,(0,W.jsx)(`span`,{className:`text-amber-400/70`,children:`Close other tabs to restore full live-update functionality.`})]}),(0,W.jsx)(`button`,{onClick:()=>n(!0),className:`text-amber-500/50 hover:text-amber-300 transition-colors shrink-0 cursor-pointer`,title:`Dismiss`,children:(0,W.jsxs)(`svg`,{width:`13`,height:`13`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2.5`,strokeLinecap:`round`,strokeLinejoin:`round`,children:[(0,W.jsx)(`line`,{x1:`18`,y1:`6`,x2:`6`,y2:`18`}),(0,W.jsx)(`line`,{x1:`6`,y1:`6`,x2:`18`,y2:`18`})]})})]})})}function Ku(){let[e,t]=(0,v.useState)(window.location.pathname),{otherTabCount:n}=Cu();(0,v.useEffect)(()=>{let e=()=>t(window.location.pathname);return window.addEventListener(`popstate`,e),()=>window.removeEventListener(`popstate`,e)},[]),(0,v.useEffect)(()=>{let e=e=>{let t=e.target.closest(`a`);if(!t)return;let n=t.getAttribute(`href`);!n||n.startsWith(`http`)||n.startsWith(`//`)||(e.preventDefault(),Wu(n))};return document.addEventListener(`click`,e),()=>document.removeEventListener(`click`,e)},[]);let r=t=>t===`/`?e===`/`:e.startsWith(t);return(0,W.jsxs)(`div`,{className:`min-h-screen bg-[var(--color-surface-0)] text-[var(--color-fg-1)]`,children:[(0,W.jsxs)(`header`,{className:`border-b border-[var(--color-line-1)] sticky top-0 z-50 bg-[var(--color-surface-0)]/95 backdrop-blur`,children:[(0,W.jsxs)(`div`,{className:`max-w-7xl mx-auto px-4 flex items-center h-11 gap-5`,children:[(0,W.jsxs)(`a`,{href:`/`,className:`flex items-baseline gap-0.5 select-none`,title:`SigmaShake Governance`,children:[(0,W.jsx)(`span`,{className:`font-mono text-sm font-semibold text-[var(--color-brand)] tracking-tight`,children:`ssg`}),(0,W.jsx)(`span`,{className:`font-mono text-[11px] text-[var(--color-fg-3)] tracking-tight`,children:`/gov`})]}),(0,W.jsx)(`nav`,{className:`flex items-center`,children:Iu.map(e=>{let t=r(e.path);return(0,W.jsxs)(`a`,{href:e.path,className:`relative px-2.5 py-1 text-[12px] font-mono tracking-wide transition-colors ${t?`text-[var(--color-fg-0)]`:`text-[var(--color-fg-3)] hover:text-[var(--color-fg-1)]`}`,children:[e.label,t&&(0,W.jsx)(`span`,{className:`absolute inset-x-2 -bottom-px h-px bg-[var(--color-brand)]`})]},e.path)})}),(0,W.jsxs)(`div`,{className:`flex items-center gap-4 ml-auto`,children:[n>0&&(0,W.jsxs)(`span`,{className:`chip text-amber-300 border-amber-500/30`,title:`${n} other tab${n===1?``:`s`} open — may cause connection issues`,children:[n+1,` tabs`]}),(0,W.jsx)(Tu,{}),(0,W.jsx)(Vu,{}),(0,W.jsx)(Hu,{}),(0,W.jsx)(Ru,{}),(0,W.jsx)(Fu,{})]})]}),(0,W.jsx)(Gu,{count:n}),(0,W.jsx)(Bu,{}),(0,W.jsx)(zu,{})]}),(0,W.jsx)(`main`,{className:`max-w-7xl mx-auto px-4 py-6`,children:Uu(e)})]})}var qu=document.getElementById(`app-root`);if(!qu)throw Error(`Missing #app-root`);_.createRoot(qu).render((0,W.jsx)(v.StrictMode,{children:(0,W.jsx)(Ku,{})}));
|