@openscout/scout 0.2.44 → 0.2.46

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.
@@ -0,0 +1,94 @@
1
+ function Gk(e,l){for(var r=0;r<l.length;r++){const i=l[r];if(typeof i!="string"&&!Array.isArray(i)){for(const o in i)if(o!=="default"&&!(o in e)){const u=Object.getOwnPropertyDescriptor(i,o);u&&Object.defineProperty(e,o,u.get?u:{enumerable:!0,get:()=>i[o]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}(function(){const l=document.createElement("link").relList;if(l&&l.supports&&l.supports("modulepreload"))return;for(const o of document.querySelectorAll('link[rel="modulepreload"]'))i(o);new MutationObserver(o=>{for(const u of o)if(u.type==="childList")for(const d of u.addedNodes)d.tagName==="LINK"&&d.rel==="modulepreload"&&i(d)}).observe(document,{childList:!0,subtree:!0});function r(o){const u={};return o.integrity&&(u.integrity=o.integrity),o.referrerPolicy&&(u.referrerPolicy=o.referrerPolicy),o.crossOrigin==="use-credentials"?u.credentials="include":o.crossOrigin==="anonymous"?u.credentials="omit":u.credentials="same-origin",u}function i(o){if(o.ep)return;o.ep=!0;const u=r(o);fetch(o.href,u)}})();function Uu(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var fm={exports:{}},uo={};var cb;function Yk(){if(cb)return uo;cb=1;var e=Symbol.for("react.transitional.element"),l=Symbol.for("react.fragment");function r(i,o,u){var d=null;if(u!==void 0&&(d=""+u),o.key!==void 0&&(d=""+o.key),"key"in o){u={};for(var f in o)f!=="key"&&(u[f]=o[f])}else u=o;return o=u.ref,{$$typeof:e,type:i,key:d,ref:o!==void 0?o:null,props:u}}return uo.Fragment=l,uo.jsx=r,uo.jsxs=r,uo}var ub;function Qk(){return ub||(ub=1,fm.exports=Yk()),fm.exports}var a=Qk(),mm={exports:{}},at={};var db;function Xk(){if(db)return at;db=1;var e=Symbol.for("react.transitional.element"),l=Symbol.for("react.portal"),r=Symbol.for("react.fragment"),i=Symbol.for("react.strict_mode"),o=Symbol.for("react.profiler"),u=Symbol.for("react.consumer"),d=Symbol.for("react.context"),f=Symbol.for("react.forward_ref"),p=Symbol.for("react.suspense"),h=Symbol.for("react.memo"),y=Symbol.for("react.lazy"),g=Symbol.for("react.activity"),v=Symbol.iterator;function k(B){return B===null||typeof B!="object"?null:(B=v&&B[v]||B["@@iterator"],typeof B=="function"?B:null)}var S={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},A=Object.assign,N={};function R(B,le,M){this.props=B,this.context=le,this.refs=N,this.updater=M||S}R.prototype.isReactComponent={},R.prototype.setState=function(B,le){if(typeof B!="object"&&typeof B!="function"&&B!=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,B,le,"setState")},R.prototype.forceUpdate=function(B){this.updater.enqueueForceUpdate(this,B,"forceUpdate")};function L(){}L.prototype=R.prototype;function H(B,le,M){this.props=B,this.context=le,this.refs=N,this.updater=M||S}var X=H.prototype=new L;X.constructor=H,A(X,R.prototype),X.isPureReactComponent=!0;var V=Array.isArray;function D(){}var I={H:null,A:null,T:null,S:null},F=Object.prototype.hasOwnProperty;function ne(B,le,M){var pe=M.ref;return{$$typeof:e,type:B,key:le,ref:pe!==void 0?pe:null,props:M}}function O(B,le){return ne(B.type,le,B.props)}function P(B){return typeof B=="object"&&B!==null&&B.$$typeof===e}function Q(B){var le={"=":"=0",":":"=2"};return"$"+B.replace(/[=:]/g,function(M){return le[M]})}var oe=/\/+/g;function W(B,le){return typeof B=="object"&&B!==null&&B.key!=null?Q(""+B.key):le.toString(36)}function J(B){switch(B.status){case"fulfilled":return B.value;case"rejected":throw B.reason;default:switch(typeof B.status=="string"?B.then(D,D):(B.status="pending",B.then(function(le){B.status==="pending"&&(B.status="fulfilled",B.value=le)},function(le){B.status==="pending"&&(B.status="rejected",B.reason=le)})),B.status){case"fulfilled":return B.value;case"rejected":throw B.reason}}throw B}function w(B,le,M,pe,ge){var ce=typeof B;(ce==="undefined"||ce==="boolean")&&(B=null);var Re=!1;if(B===null)Re=!0;else switch(ce){case"bigint":case"string":case"number":Re=!0;break;case"object":switch(B.$$typeof){case e:case l:Re=!0;break;case y:return Re=B._init,w(Re(B._payload),le,M,pe,ge)}}if(Re)return ge=ge(B),Re=pe===""?"."+W(B,0):pe,V(ge)?(M="",Re!=null&&(M=Re.replace(oe,"$&/")+"/"),w(ge,le,M,"",function(Ve){return Ve})):ge!=null&&(P(ge)&&(ge=O(ge,M+(ge.key==null||B&&B.key===ge.key?"":(""+ge.key).replace(oe,"$&/")+"/")+Re)),le.push(ge)),1;Re=0;var Se=pe===""?".":pe+":";if(V(B))for(var Ne=0;Ne<B.length;Ne++)pe=B[Ne],ce=Se+W(pe,Ne),Re+=w(pe,le,M,ce,ge);else if(Ne=k(B),typeof Ne=="function")for(B=Ne.call(B),Ne=0;!(pe=B.next()).done;)pe=pe.value,ce=Se+W(pe,Ne++),Re+=w(pe,le,M,ce,ge);else if(ce==="object"){if(typeof B.then=="function")return w(J(B),le,M,pe,ge);throw le=String(B),Error("Objects are not valid as a React child (found: "+(le==="[object Object]"?"object with keys {"+Object.keys(B).join(", ")+"}":le)+"). If you meant to render a collection of children, use an array instead.")}return Re}function Y(B,le,M){if(B==null)return B;var pe=[],ge=0;return w(B,pe,"","",function(ce){return le.call(M,ce,ge++)}),pe}function G(B){if(B._status===-1){var le=B._result;le=le(),le.then(function(M){(B._status===0||B._status===-1)&&(B._status=1,B._result=M)},function(M){(B._status===0||B._status===-1)&&(B._status=2,B._result=M)}),B._status===-1&&(B._status=0,B._result=le)}if(B._status===1)return B._result.default;throw B._result}var ve=typeof reportError=="function"?reportError:function(B){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var le=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof B=="object"&&B!==null&&typeof B.message=="string"?String(B.message):String(B),error:B});if(!window.dispatchEvent(le))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",B);return}console.error(B)},T={map:Y,forEach:function(B,le,M){Y(B,function(){le.apply(this,arguments)},M)},count:function(B){var le=0;return Y(B,function(){le++}),le},toArray:function(B){return Y(B,function(le){return le})||[]},only:function(B){if(!P(B))throw Error("React.Children.only expected to receive a single React element child.");return B}};return at.Activity=g,at.Children=T,at.Component=R,at.Fragment=r,at.Profiler=o,at.PureComponent=H,at.StrictMode=i,at.Suspense=p,at.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=I,at.__COMPILER_RUNTIME={__proto__:null,c:function(B){return I.H.useMemoCache(B)}},at.cache=function(B){return function(){return B.apply(null,arguments)}},at.cacheSignal=function(){return null},at.cloneElement=function(B,le,M){if(B==null)throw Error("The argument must be a React element, but you passed "+B+".");var pe=A({},B.props),ge=B.key;if(le!=null)for(ce in le.key!==void 0&&(ge=""+le.key),le)!F.call(le,ce)||ce==="key"||ce==="__self"||ce==="__source"||ce==="ref"&&le.ref===void 0||(pe[ce]=le[ce]);var ce=arguments.length-2;if(ce===1)pe.children=M;else if(1<ce){for(var Re=Array(ce),Se=0;Se<ce;Se++)Re[Se]=arguments[Se+2];pe.children=Re}return ne(B.type,ge,pe)},at.createContext=function(B){return B={$$typeof:d,_currentValue:B,_currentValue2:B,_threadCount:0,Provider:null,Consumer:null},B.Provider=B,B.Consumer={$$typeof:u,_context:B},B},at.createElement=function(B,le,M){var pe,ge={},ce=null;if(le!=null)for(pe in le.key!==void 0&&(ce=""+le.key),le)F.call(le,pe)&&pe!=="key"&&pe!=="__self"&&pe!=="__source"&&(ge[pe]=le[pe]);var Re=arguments.length-2;if(Re===1)ge.children=M;else if(1<Re){for(var Se=Array(Re),Ne=0;Ne<Re;Ne++)Se[Ne]=arguments[Ne+2];ge.children=Se}if(B&&B.defaultProps)for(pe in Re=B.defaultProps,Re)ge[pe]===void 0&&(ge[pe]=Re[pe]);return ne(B,ce,ge)},at.createRef=function(){return{current:null}},at.forwardRef=function(B){return{$$typeof:f,render:B}},at.isValidElement=P,at.lazy=function(B){return{$$typeof:y,_payload:{_status:-1,_result:B},_init:G}},at.memo=function(B,le){return{$$typeof:h,type:B,compare:le===void 0?null:le}},at.startTransition=function(B){var le=I.T,M={};I.T=M;try{var pe=B(),ge=I.S;ge!==null&&ge(M,pe),typeof pe=="object"&&pe!==null&&typeof pe.then=="function"&&pe.then(D,ve)}catch(ce){ve(ce)}finally{le!==null&&M.types!==null&&(le.types=M.types),I.T=le}},at.unstable_useCacheRefresh=function(){return I.H.useCacheRefresh()},at.use=function(B){return I.H.use(B)},at.useActionState=function(B,le,M){return I.H.useActionState(B,le,M)},at.useCallback=function(B,le){return I.H.useCallback(B,le)},at.useContext=function(B){return I.H.useContext(B)},at.useDebugValue=function(){},at.useDeferredValue=function(B,le){return I.H.useDeferredValue(B,le)},at.useEffect=function(B,le){return I.H.useEffect(B,le)},at.useEffectEvent=function(B){return I.H.useEffectEvent(B)},at.useId=function(){return I.H.useId()},at.useImperativeHandle=function(B,le,M){return I.H.useImperativeHandle(B,le,M)},at.useInsertionEffect=function(B,le){return I.H.useInsertionEffect(B,le)},at.useLayoutEffect=function(B,le){return I.H.useLayoutEffect(B,le)},at.useMemo=function(B,le){return I.H.useMemo(B,le)},at.useOptimistic=function(B,le){return I.H.useOptimistic(B,le)},at.useReducer=function(B,le,M){return I.H.useReducer(B,le,M)},at.useRef=function(B){return I.H.useRef(B)},at.useState=function(B){return I.H.useState(B)},at.useSyncExternalStore=function(B,le,M){return I.H.useSyncExternalStore(B,le,M)},at.useTransition=function(){return I.H.useTransition()},at.version="19.2.3",at}var fb;function wp(){return fb||(fb=1,mm.exports=Xk()),mm.exports}var E=wp();const z=Uu(E),Hu=Gk({__proto__:null,default:z},[E]);var pm={exports:{}},fo={},hm={exports:{}},xm={};var mb;function Kk(){return mb||(mb=1,(function(e){function l(w,Y){var G=w.length;w.push(Y);e:for(;0<G;){var ve=G-1>>>1,T=w[ve];if(0<o(T,Y))w[ve]=Y,w[G]=T,G=ve;else break e}}function r(w){return w.length===0?null:w[0]}function i(w){if(w.length===0)return null;var Y=w[0],G=w.pop();if(G!==Y){w[0]=G;e:for(var ve=0,T=w.length,B=T>>>1;ve<B;){var le=2*(ve+1)-1,M=w[le],pe=le+1,ge=w[pe];if(0>o(M,G))pe<T&&0>o(ge,M)?(w[ve]=ge,w[pe]=G,ve=pe):(w[ve]=M,w[le]=G,ve=le);else if(pe<T&&0>o(ge,G))w[ve]=ge,w[pe]=G,ve=pe;else break e}}return Y}function o(w,Y){var G=w.sortIndex-Y.sortIndex;return G!==0?G:w.id-Y.id}if(e.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var u=performance;e.unstable_now=function(){return u.now()}}else{var d=Date,f=d.now();e.unstable_now=function(){return d.now()-f}}var p=[],h=[],y=1,g=null,v=3,k=!1,S=!1,A=!1,N=!1,R=typeof setTimeout=="function"?setTimeout:null,L=typeof clearTimeout=="function"?clearTimeout:null,H=typeof setImmediate<"u"?setImmediate:null;function X(w){for(var Y=r(h);Y!==null;){if(Y.callback===null)i(h);else if(Y.startTime<=w)i(h),Y.sortIndex=Y.expirationTime,l(p,Y);else break;Y=r(h)}}function V(w){if(A=!1,X(w),!S)if(r(p)!==null)S=!0,D||(D=!0,Q());else{var Y=r(h);Y!==null&&J(V,Y.startTime-w)}}var D=!1,I=-1,F=5,ne=-1;function O(){return N?!0:!(e.unstable_now()-ne<F)}function P(){if(N=!1,D){var w=e.unstable_now();ne=w;var Y=!0;try{e:{S=!1,A&&(A=!1,L(I),I=-1),k=!0;var G=v;try{t:{for(X(w),g=r(p);g!==null&&!(g.expirationTime>w&&O());){var ve=g.callback;if(typeof ve=="function"){g.callback=null,v=g.priorityLevel;var T=ve(g.expirationTime<=w);if(w=e.unstable_now(),typeof T=="function"){g.callback=T,X(w),Y=!0;break t}g===r(p)&&i(p),X(w)}else i(p);g=r(p)}if(g!==null)Y=!0;else{var B=r(h);B!==null&&J(V,B.startTime-w),Y=!1}}break e}finally{g=null,v=G,k=!1}Y=void 0}}finally{Y?Q():D=!1}}}var Q;if(typeof H=="function")Q=function(){H(P)};else if(typeof MessageChannel<"u"){var oe=new MessageChannel,W=oe.port2;oe.port1.onmessage=P,Q=function(){W.postMessage(null)}}else Q=function(){R(P,0)};function J(w,Y){I=R(function(){w(e.unstable_now())},Y)}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(w){w.callback=null},e.unstable_forceFrameRate=function(w){0>w||125<w?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):F=0<w?Math.floor(1e3/w):5},e.unstable_getCurrentPriorityLevel=function(){return v},e.unstable_next=function(w){switch(v){case 1:case 2:case 3:var Y=3;break;default:Y=v}var G=v;v=Y;try{return w()}finally{v=G}},e.unstable_requestPaint=function(){N=!0},e.unstable_runWithPriority=function(w,Y){switch(w){case 1:case 2:case 3:case 4:case 5:break;default:w=3}var G=v;v=w;try{return Y()}finally{v=G}},e.unstable_scheduleCallback=function(w,Y,G){var ve=e.unstable_now();switch(typeof G=="object"&&G!==null?(G=G.delay,G=typeof G=="number"&&0<G?ve+G:ve):G=ve,w){case 1:var T=-1;break;case 2:T=250;break;case 5:T=1073741823;break;case 4:T=1e4;break;default:T=5e3}return T=G+T,w={id:y++,callback:Y,priorityLevel:w,startTime:G,expirationTime:T,sortIndex:-1},G>ve?(w.sortIndex=G,l(h,w),r(p)===null&&w===r(h)&&(A?(L(I),I=-1):A=!0,J(V,G-ve))):(w.sortIndex=T,l(p,w),S||k||(S=!0,D||(D=!0,Q()))),w},e.unstable_shouldYield=O,e.unstable_wrapCallback=function(w){var Y=v;return function(){var G=v;v=Y;try{return w.apply(this,arguments)}finally{v=G}}}})(xm)),xm}var pb;function Zk(){return pb||(pb=1,hm.exports=Kk()),hm.exports}var gm={exports:{}},Rn={};var hb;function Wk(){if(hb)return Rn;hb=1;var e=wp();function l(p){var h="https://react.dev/errors/"+p;if(1<arguments.length){h+="?args[]="+encodeURIComponent(arguments[1]);for(var y=2;y<arguments.length;y++)h+="&args[]="+encodeURIComponent(arguments[y])}return"Minified React error #"+p+"; visit "+h+" 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(l(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 u(p,h,y){var g=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:o,key:g==null?null:""+g,children:p,containerInfo:h,implementation:y}}var d=e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function f(p,h){if(p==="font")return"";if(typeof h=="string")return h==="use-credentials"?h:""}return Rn.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=i,Rn.createPortal=function(p,h){var y=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!h||h.nodeType!==1&&h.nodeType!==9&&h.nodeType!==11)throw Error(l(299));return u(p,h,null,y)},Rn.flushSync=function(p){var h=d.T,y=i.p;try{if(d.T=null,i.p=2,p)return p()}finally{d.T=h,i.p=y,i.d.f()}},Rn.preconnect=function(p,h){typeof p=="string"&&(h?(h=h.crossOrigin,h=typeof h=="string"?h==="use-credentials"?h:"":void 0):h=null,i.d.C(p,h))},Rn.prefetchDNS=function(p){typeof p=="string"&&i.d.D(p)},Rn.preinit=function(p,h){if(typeof p=="string"&&h&&typeof h.as=="string"){var y=h.as,g=f(y,h.crossOrigin),v=typeof h.integrity=="string"?h.integrity:void 0,k=typeof h.fetchPriority=="string"?h.fetchPriority:void 0;y==="style"?i.d.S(p,typeof h.precedence=="string"?h.precedence:void 0,{crossOrigin:g,integrity:v,fetchPriority:k}):y==="script"&&i.d.X(p,{crossOrigin:g,integrity:v,fetchPriority:k,nonce:typeof h.nonce=="string"?h.nonce:void 0})}},Rn.preinitModule=function(p,h){if(typeof p=="string")if(typeof h=="object"&&h!==null){if(h.as==null||h.as==="script"){var y=f(h.as,h.crossOrigin);i.d.M(p,{crossOrigin:y,integrity:typeof h.integrity=="string"?h.integrity:void 0,nonce:typeof h.nonce=="string"?h.nonce:void 0})}}else h==null&&i.d.M(p)},Rn.preload=function(p,h){if(typeof p=="string"&&typeof h=="object"&&h!==null&&typeof h.as=="string"){var y=h.as,g=f(y,h.crossOrigin);i.d.L(p,y,{crossOrigin:g,integrity:typeof h.integrity=="string"?h.integrity:void 0,nonce:typeof h.nonce=="string"?h.nonce:void 0,type:typeof h.type=="string"?h.type:void 0,fetchPriority:typeof h.fetchPriority=="string"?h.fetchPriority:void 0,referrerPolicy:typeof h.referrerPolicy=="string"?h.referrerPolicy:void 0,imageSrcSet:typeof h.imageSrcSet=="string"?h.imageSrcSet:void 0,imageSizes:typeof h.imageSizes=="string"?h.imageSizes:void 0,media:typeof h.media=="string"?h.media:void 0})}},Rn.preloadModule=function(p,h){if(typeof p=="string")if(h){var y=f(h.as,h.crossOrigin);i.d.m(p,{as:typeof h.as=="string"&&h.as!=="script"?h.as:void 0,crossOrigin:y,integrity:typeof h.integrity=="string"?h.integrity:void 0})}else i.d.m(p)},Rn.requestFormReset=function(p){i.d.r(p)},Rn.unstable_batchedUpdates=function(p,h){return p(h)},Rn.useFormState=function(p,h,y){return d.H.useFormState(p,h,y)},Rn.useFormStatus=function(){return d.H.useHostTransitionStatus()},Rn.version="19.2.3",Rn}var xb;function b1(){if(xb)return gm.exports;xb=1;function e(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(l){console.error(l)}}return e(),gm.exports=Wk(),gm.exports}var gb;function Jk(){if(gb)return fo;gb=1;var e=Zk(),l=wp(),r=b1();function i(t){var n="https://react.dev/errors/"+t;if(1<arguments.length){n+="?args[]="+encodeURIComponent(arguments[1]);for(var s=2;s<arguments.length;s++)n+="&args[]="+encodeURIComponent(arguments[s])}return"Minified React error #"+t+"; visit "+n+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function o(t){return!(!t||t.nodeType!==1&&t.nodeType!==9&&t.nodeType!==11)}function u(t){var n=t,s=t;if(t.alternate)for(;n.return;)n=n.return;else{t=n;do n=t,(n.flags&4098)!==0&&(s=n.return),t=n.return;while(t)}return n.tag===3?s:null}function d(t){if(t.tag===13){var n=t.memoizedState;if(n===null&&(t=t.alternate,t!==null&&(n=t.memoizedState)),n!==null)return n.dehydrated}return null}function f(t){if(t.tag===31){var n=t.memoizedState;if(n===null&&(t=t.alternate,t!==null&&(n=t.memoizedState)),n!==null)return n.dehydrated}return null}function p(t){if(u(t)!==t)throw Error(i(188))}function h(t){var n=t.alternate;if(!n){if(n=u(t),n===null)throw Error(i(188));return n!==t?null:t}for(var s=t,c=n;;){var m=s.return;if(m===null)break;var x=m.alternate;if(x===null){if(c=m.return,c!==null){s=c;continue}break}if(m.child===x.child){for(x=m.child;x;){if(x===s)return p(m),t;if(x===c)return p(m),n;x=x.sibling}throw Error(i(188))}if(s.return!==c.return)s=m,c=x;else{for(var j=!1,C=m.child;C;){if(C===s){j=!0,s=m,c=x;break}if(C===c){j=!0,c=m,s=x;break}C=C.sibling}if(!j){for(C=x.child;C;){if(C===s){j=!0,s=x,c=m;break}if(C===c){j=!0,c=x,s=m;break}C=C.sibling}if(!j)throw Error(i(189))}}if(s.alternate!==c)throw Error(i(190))}if(s.tag!==3)throw Error(i(188));return s.stateNode.current===s?t:n}function y(t){var n=t.tag;if(n===5||n===26||n===27||n===6)return t;for(t=t.child;t!==null;){if(n=y(t),n!==null)return n;t=t.sibling}return null}var g=Object.assign,v=Symbol.for("react.element"),k=Symbol.for("react.transitional.element"),S=Symbol.for("react.portal"),A=Symbol.for("react.fragment"),N=Symbol.for("react.strict_mode"),R=Symbol.for("react.profiler"),L=Symbol.for("react.consumer"),H=Symbol.for("react.context"),X=Symbol.for("react.forward_ref"),V=Symbol.for("react.suspense"),D=Symbol.for("react.suspense_list"),I=Symbol.for("react.memo"),F=Symbol.for("react.lazy"),ne=Symbol.for("react.activity"),O=Symbol.for("react.memo_cache_sentinel"),P=Symbol.iterator;function Q(t){return t===null||typeof t!="object"?null:(t=P&&t[P]||t["@@iterator"],typeof t=="function"?t:null)}var oe=Symbol.for("react.client.reference");function W(t){if(t==null)return null;if(typeof t=="function")return t.$$typeof===oe?null:t.displayName||t.name||null;if(typeof t=="string")return t;switch(t){case A:return"Fragment";case R:return"Profiler";case N:return"StrictMode";case V:return"Suspense";case D:return"SuspenseList";case ne:return"Activity"}if(typeof t=="object")switch(t.$$typeof){case S:return"Portal";case H:return t.displayName||"Context";case L:return(t._context.displayName||"Context")+".Consumer";case X:var n=t.render;return t=t.displayName,t||(t=n.displayName||n.name||"",t=t!==""?"ForwardRef("+t+")":"ForwardRef"),t;case I:return n=t.displayName||null,n!==null?n:W(t.type)||"Memo";case F:n=t._payload,t=t._init;try{return W(t(n))}catch{}}return null}var J=Array.isArray,w=l.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,Y=r.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,G={pending:!1,data:null,method:null,action:null},ve=[],T=-1;function B(t){return{current:t}}function le(t){0>T||(t.current=ve[T],ve[T]=null,T--)}function M(t,n){T++,ve[T]=t.current,t.current=n}var pe=B(null),ge=B(null),ce=B(null),Re=B(null);function Se(t,n){switch(M(ce,n),M(ge,t),M(pe,null),n.nodeType){case 9:case 11:t=(t=n.documentElement)&&(t=t.namespaceURI)?zg(t):0;break;default:if(t=n.tagName,n=n.namespaceURI)n=zg(n),t=Og(n,t);else switch(t){case"svg":t=1;break;case"math":t=2;break;default:t=0}}le(pe),M(pe,t)}function Ne(){le(pe),le(ge),le(ce)}function Ve(t){t.memoizedState!==null&&M(Re,t);var n=pe.current,s=Og(n,t.type);n!==s&&(M(ge,t),M(pe,s))}function _e(t){ge.current===t&&(le(pe),le(ge)),Re.current===t&&(le(Re),io._currentValue=G)}var Fe,it;function rt(t){if(Fe===void 0)try{throw Error()}catch(s){var n=s.stack.trim().match(/\n( *(at )?)/);Fe=n&&n[1]||"",it=-1<s.stack.indexOf(`
2
+ at`)?" (<anonymous>)":-1<s.stack.indexOf("@")?"@unknown:0:0":""}return`
3
+ `+Fe+t+it}var ut=!1;function st(t,n){if(!t||ut)return"";ut=!0;var s=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var c={DetermineComponentFrameRoot:function(){try{if(n){var xe=function(){throw Error()};if(Object.defineProperty(xe.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(xe,[])}catch(ie){var re=ie}Reflect.construct(t,[],xe)}else{try{xe.call()}catch(ie){re=ie}t.call(xe.prototype)}}else{try{throw Error()}catch(ie){re=ie}(xe=t())&&typeof xe.catch=="function"&&xe.catch(function(){})}}catch(ie){if(ie&&re&&typeof ie.stack=="string")return[ie.stack,re.stack]}return[null,null]}};c.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var m=Object.getOwnPropertyDescriptor(c.DetermineComponentFrameRoot,"name");m&&m.configurable&&Object.defineProperty(c.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var x=c.DetermineComponentFrameRoot(),j=x[0],C=x[1];if(j&&C){var U=j.split(`
4
+ `),te=C.split(`
5
+ `);for(m=c=0;c<U.length&&!U[c].includes("DetermineComponentFrameRoot");)c++;for(;m<te.length&&!te[m].includes("DetermineComponentFrameRoot");)m++;if(c===U.length||m===te.length)for(c=U.length-1,m=te.length-1;1<=c&&0<=m&&U[c]!==te[m];)m--;for(;1<=c&&0<=m;c--,m--)if(U[c]!==te[m]){if(c!==1||m!==1)do if(c--,m--,0>m||U[c]!==te[m]){var fe=`
6
+ `+U[c].replace(" at new "," at ");return t.displayName&&fe.includes("<anonymous>")&&(fe=fe.replace("<anonymous>",t.displayName)),fe}while(1<=c&&0<=m);break}}}finally{ut=!1,Error.prepareStackTrace=s}return(s=t?t.displayName||t.name:"")?rt(s):""}function vt(t,n){switch(t.tag){case 26:case 27:case 5:return rt(t.type);case 16:return rt("Lazy");case 13:return t.child!==n&&n!==null?rt("Suspense Fallback"):rt("Suspense");case 19:return rt("SuspenseList");case 0:case 15:return st(t.type,!1);case 11:return st(t.type.render,!1);case 1:return st(t.type,!0);case 31:return rt("Activity");default:return""}}function Ke(t){try{var n="",s=null;do n+=vt(t,s),s=t,t=t.return;while(t);return n}catch(c){return`
7
+ Error generating stack: `+c.message+`
8
+ `+c.stack}}var Ye=Object.prototype.hasOwnProperty,et=e.unstable_scheduleCallback,Me=e.unstable_cancelCallback,ot=e.unstable_shouldYield,Ce=e.unstable_requestPaint,nt=e.unstable_now,mt=e.unstable_getCurrentPriorityLevel,ae=e.unstable_ImmediatePriority,be=e.unstable_UserBlockingPriority,we=e.unstable_NormalPriority,ze=e.unstable_LowPriority,We=e.unstable_IdlePriority,Ae=e.log,ue=e.unstable_setDisableYieldValue,Te=null,q=null;function de(t){if(typeof Ae=="function"&&ue(t),q&&typeof q.setStrictMode=="function")try{q.setStrictMode(Te,t)}catch{}}var ke=Math.clz32?Math.clz32:$e,Qe=Math.log,Be=Math.LN2;function $e(t){return t>>>=0,t===0?32:31-(Qe(t)/Be|0)|0}var wt=256,Qt=262144,qt=4194304;function Pt(t){var n=t&42;if(n!==0)return n;switch(t&-t){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 t&261888;case 262144:case 524288:case 1048576:case 2097152:return t&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return t&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return t}}function ht(t,n,s){var c=t.pendingLanes;if(c===0)return 0;var m=0,x=t.suspendedLanes,j=t.pingedLanes;t=t.warmLanes;var C=c&134217727;return C!==0?(c=C&~x,c!==0?m=Pt(c):(j&=C,j!==0?m=Pt(j):s||(s=C&~t,s!==0&&(m=Pt(s))))):(C=c&~x,C!==0?m=Pt(C):j!==0?m=Pt(j):s||(s=c&~t,s!==0&&(m=Pt(s)))),m===0?0:n!==0&&n!==m&&(n&x)===0&&(x=m&-m,s=n&-n,x>=s||x===32&&(s&4194048)!==0)?n:m}function Wt(t,n){return(t.pendingLanes&~(t.suspendedLanes&~t.pingedLanes)&n)===0}function se(t,n){switch(t){case 1:case 2:case 4:case 8:case 64:return n+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 n+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 Ee(){var t=qt;return qt<<=1,(qt&62914560)===0&&(qt=4194304),t}function Oe(t){for(var n=[],s=0;31>s;s++)n.push(t);return n}function tt(t,n){t.pendingLanes|=n,n!==268435456&&(t.suspendedLanes=0,t.pingedLanes=0,t.warmLanes=0)}function Vt(t,n,s,c,m,x){var j=t.pendingLanes;t.pendingLanes=s,t.suspendedLanes=0,t.pingedLanes=0,t.warmLanes=0,t.expiredLanes&=s,t.entangledLanes&=s,t.errorRecoveryDisabledLanes&=s,t.shellSuspendCounter=0;var C=t.entanglements,U=t.expirationTimes,te=t.hiddenUpdates;for(s=j&~s;0<s;){var fe=31-ke(s),xe=1<<fe;C[fe]=0,U[fe]=-1;var re=te[fe];if(re!==null)for(te[fe]=null,fe=0;fe<re.length;fe++){var ie=re[fe];ie!==null&&(ie.lane&=-536870913)}s&=~xe}c!==0&&on(t,c,0),x!==0&&m===0&&t.tag!==0&&(t.suspendedLanes|=x&~(j&~n))}function on(t,n,s){t.pendingLanes|=n,t.suspendedLanes&=~n;var c=31-ke(n);t.entangledLanes|=n,t.entanglements[c]=t.entanglements[c]|1073741824|s&261930}function va(t,n){var s=t.entangledLanes|=n;for(t=t.entanglements;s;){var c=31-ke(s),m=1<<c;m&n|t[c]&n&&(t[c]|=n),s&=~m}}function er(t,n){var s=n&-n;return s=(s&42)!==0?1:ja(s),(s&(t.suspendedLanes|n))!==0?0:s}function ja(t){switch(t){case 2:t=1;break;case 8:t=4;break;case 32:t=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:t=128;break;case 268435456:t=134217728;break;default:t=0}return t}function bn(t){return t&=-t,2<t?8<t?(t&134217727)!==0?32:268435456:8:2}function oi(){var t=Y.p;return t!==0?t:(t=window.event,t===void 0?32:nb(t.type))}function ka(t,n){var s=Y.p;try{return Y.p=t,n()}finally{Y.p=s}}var Un=Math.random().toString(36).slice(2),Yt="__reactFiber$"+Un,cn="__reactProps$"+Un,zt="__reactContainer$"+Un,tr="__reactEvents$"+Un,Ul="__reactListeners$"+Un,Ln="__reactHandles$"+Un,us="__reactResources$"+Un,el="__reactMarker$"+Un;function Hl(t){delete t[Yt],delete t[cn],delete t[tr],delete t[Ul],delete t[Ln]}function gl(t){var n=t[Yt];if(n)return n;for(var s=t.parentNode;s;){if(n=s[zt]||s[Yt]){if(s=n.alternate,n.child!==null||s!==null&&s.child!==null)for(t=Ug(t);t!==null;){if(s=t[Yt])return s;t=Ug(t)}return n}t=s,s=t.parentNode}return null}function Fl(t){if(t=t[Yt]||t[zt]){var n=t.tag;if(n===5||n===6||n===13||n===31||n===26||n===27||n===3)return t}return null}function Dr(t){var n=t.tag;if(n===5||n===26||n===27||n===6)return t.stateNode;throw Error(i(33))}function ql(t){var n=t[us];return n||(n=t[us]={hoistableStyles:new Map,hoistableScripts:new Map}),n}function Ht(t){t[el]=!0}var Na=new Set,wa={};function Vl(t,n){nr(t,n),nr(t+"Capture",n)}function nr(t,n){for(wa[t]=n,t=0;t<n.length;t++)Na.add(n[t])}var Io=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]*$"),ds={},Hn={};function fs(t){return Ye.call(Hn,t)?!0:Ye.call(ds,t)?!1:Io.test(t)?Hn[t]=!0:(ds[t]=!0,!1)}function Sa(t,n,s){if(fs(n))if(s===null)t.removeAttribute(n);else{switch(typeof s){case"undefined":case"function":case"symbol":t.removeAttribute(n);return;case"boolean":var c=n.toLowerCase().slice(0,5);if(c!=="data-"&&c!=="aria-"){t.removeAttribute(n);return}}t.setAttribute(n,""+s)}}function $l(t,n,s){if(s===null)t.removeAttribute(n);else{switch(typeof s){case"undefined":case"function":case"symbol":case"boolean":t.removeAttribute(n);return}t.setAttribute(n,""+s)}}function Fn(t,n,s,c){if(c===null)t.removeAttribute(s);else{switch(typeof c){case"undefined":case"function":case"symbol":case"boolean":t.removeAttribute(s);return}t.setAttributeNS(n,s,""+c)}}function Xt(t){switch(typeof t){case"bigint":case"boolean":case"number":case"string":case"undefined":return t;case"object":return t;default:return""}}function ci(t){var n=t.type;return(t=t.nodeName)&&t.toLowerCase()==="input"&&(n==="checkbox"||n==="radio")}function ui(t,n,s){var c=Object.getOwnPropertyDescriptor(t.constructor.prototype,n);if(!t.hasOwnProperty(n)&&typeof c<"u"&&typeof c.get=="function"&&typeof c.set=="function"){var m=c.get,x=c.set;return Object.defineProperty(t,n,{configurable:!0,get:function(){return m.call(this)},set:function(j){s=""+j,x.call(this,j)}}),Object.defineProperty(t,n,{enumerable:c.enumerable}),{getValue:function(){return s},setValue:function(j){s=""+j},stopTracking:function(){t._valueTracker=null,delete t[n]}}}}function he(t){if(!t._valueTracker){var n=ci(t)?"checked":"value";t._valueTracker=ui(t,n,""+t[n])}}function Le(t){if(!t)return!1;var n=t._valueTracker;if(!n)return!0;var s=n.getValue(),c="";return t&&(c=ci(t)?t.checked?"true":"false":t.value),t=c,t!==s?(n.setValue(t),!0):!1}function $t(t){if(t=t||(typeof document<"u"?document:void 0),typeof t>"u")return null;try{return t.activeElement||t.body}catch{return t.body}}var tl=/[\n"\\]/g;function mn(t){return t.replace(tl,function(n){return"\\"+n.charCodeAt(0).toString(16)+" "})}function _r(t,n,s,c,m,x,j,C){t.name="",j!=null&&typeof j!="function"&&typeof j!="symbol"&&typeof j!="boolean"?t.type=j:t.removeAttribute("type"),n!=null?j==="number"?(n===0&&t.value===""||t.value!=n)&&(t.value=""+Xt(n)):t.value!==""+Xt(n)&&(t.value=""+Xt(n)):j!=="submit"&&j!=="reset"||t.removeAttribute("value"),n!=null?Tn(t,j,Xt(n)):s!=null?Tn(t,j,Xt(s)):c!=null&&t.removeAttribute("value"),m==null&&x!=null&&(t.defaultChecked=!!x),m!=null&&(t.checked=m&&typeof m!="function"&&typeof m!="symbol"),C!=null&&typeof C!="function"&&typeof C!="symbol"&&typeof C!="boolean"?t.name=""+Xt(C):t.removeAttribute("name")}function di(t,n,s,c,m,x,j,C){if(x!=null&&typeof x!="function"&&typeof x!="symbol"&&typeof x!="boolean"&&(t.type=x),n!=null||s!=null){if(!(x!=="submit"&&x!=="reset"||n!=null)){he(t);return}s=s!=null?""+Xt(s):"",n=n!=null?""+Xt(n):s,C||n===t.value||(t.value=n),t.defaultValue=n}c=c??m,c=typeof c!="function"&&typeof c!="symbol"&&!!c,t.checked=C?t.checked:!!c,t.defaultChecked=!!c,j!=null&&typeof j!="function"&&typeof j!="symbol"&&typeof j!="boolean"&&(t.name=j),he(t)}function Tn(t,n,s){n==="number"&&$t(t.ownerDocument)===t||t.defaultValue===""+s||(t.defaultValue=""+s)}function Tl(t,n,s,c){if(t=t.options,n){n={};for(var m=0;m<s.length;m++)n["$"+s[m]]=!0;for(s=0;s<t.length;s++)m=n.hasOwnProperty("$"+t[s].value),t[s].selected!==m&&(t[s].selected=m),m&&c&&(t[s].defaultSelected=!0)}else{for(s=""+Xt(s),n=null,m=0;m<t.length;m++){if(t[m].value===s){t[m].selected=!0,c&&(t[m].defaultSelected=!0);return}n!==null||t[m].disabled||(n=t[m])}n!==null&&(n.selected=!0)}}function Wu(t,n,s){if(n!=null&&(n=""+Xt(n),n!==t.value&&(t.value=n),s==null)){t.defaultValue!==n&&(t.defaultValue=n);return}t.defaultValue=s!=null?""+Xt(s):""}function Po(t,n,s,c){if(n==null){if(c!=null){if(s!=null)throw Error(i(92));if(J(c)){if(1<c.length)throw Error(i(93));c=c[0]}s=c}s==null&&(s=""),n=s}s=Xt(n),t.defaultValue=s,c=t.textContent,c===s&&c!==""&&c!==null&&(t.value=c),he(t)}function lr(t,n){if(n){var s=t.firstChild;if(s&&s===t.lastChild&&s.nodeType===3){s.nodeValue=n;return}}t.textContent=n}var mh=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 Ju(t,n,s){var c=n.indexOf("--")===0;s==null||typeof s=="boolean"||s===""?c?t.setProperty(n,""):n==="float"?t.cssFloat="":t[n]="":c?t.setProperty(n,s):typeof s!="number"||s===0||mh.has(n)?n==="float"?t.cssFloat=s:t[n]=(""+s).trim():t[n]=s+"px"}function Uo(t,n,s){if(n!=null&&typeof n!="object")throw Error(i(62));if(t=t.style,s!=null){for(var c in s)!s.hasOwnProperty(c)||n!=null&&n.hasOwnProperty(c)||(c.indexOf("--")===0?t.setProperty(c,""):c==="float"?t.cssFloat="":t[c]="");for(var m in n)c=n[m],n.hasOwnProperty(m)&&s[m]!==c&&Ju(t,m,c)}else for(var x in n)n.hasOwnProperty(x)&&Ju(t,x,n[x])}function ms(t){if(t.indexOf("-")===-1)return!1;switch(t){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 ed=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"]]),td=/^[\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 fi(t){return td.test(""+t)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":t}function Al(){}var ps=null;function hs(t){return t=t.target||t.srcElement||window,t.correspondingUseElement&&(t=t.correspondingUseElement),t.nodeType===3?t.parentNode:t}var Br=null,Ir=null;function Ho(t){var n=Fl(t);if(n&&(t=n.stateNode)){var s=t[cn]||null;e:switch(t=n.stateNode,n.type){case"input":if(_r(t,s.value,s.defaultValue,s.defaultValue,s.checked,s.defaultChecked,s.type,s.name),n=s.name,s.type==="radio"&&n!=null){for(s=t;s.parentNode;)s=s.parentNode;for(s=s.querySelectorAll('input[name="'+mn(""+n)+'"][type="radio"]'),n=0;n<s.length;n++){var c=s[n];if(c!==t&&c.form===t.form){var m=c[cn]||null;if(!m)throw Error(i(90));_r(c,m.value,m.defaultValue,m.defaultValue,m.checked,m.defaultChecked,m.type,m.name)}}for(n=0;n<s.length;n++)c=s[n],c.form===t.form&&Le(c)}break e;case"textarea":Wu(t,s.value,s.defaultValue);break e;case"select":n=s.value,n!=null&&Tl(t,!!s.multiple,n,!1)}}}var Fo=!1;function xs(t,n,s){if(Fo)return t(n,s);Fo=!0;try{var c=t(n);return c}finally{if(Fo=!1,(Br!==null||Ir!==null)&&(Ic(),Br&&(n=Br,t=Ir,Ir=Br=null,Ho(n),t)))for(n=0;n<t.length;n++)Ho(t[n])}}function rr(t,n){var s=t.stateNode;if(s===null)return null;var c=s[cn]||null;if(c===null)return null;s=c[n];e:switch(n){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(c=!c.disabled)||(t=t.type,c=!(t==="button"||t==="input"||t==="select"||t==="textarea")),t=!c;break e;default:t=!1}if(t)return null;if(s&&typeof s!="function")throw Error(i(231,n,typeof s));return s}var nl=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Ca=!1;if(nl)try{var ar={};Object.defineProperty(ar,"passive",{get:function(){Ca=!0}}),window.addEventListener("test",ar,ar),window.removeEventListener("test",ar,ar)}catch{Ca=!1}var An=null,ir=null,mi=null;function qo(){if(mi)return mi;var t,n=ir,s=n.length,c,m="value"in An?An.value:An.textContent,x=m.length;for(t=0;t<s&&n[t]===m[t];t++);var j=s-t;for(c=1;c<=j&&n[s-c]===m[x-c];c++);return mi=m.slice(t,1<c?1-c:void 0)}function gs(t){var n=t.keyCode;return"charCode"in t?(t=t.charCode,t===0&&n===13&&(t=13)):t=n,t===10&&(t=13),32<=t||t===13?t:0}function yn(){return!0}function Ta(){return!1}function vn(t){function n(s,c,m,x,j){this._reactName=s,this._targetInst=m,this.type=c,this.nativeEvent=x,this.target=j,this.currentTarget=null;for(var C in t)t.hasOwnProperty(C)&&(s=t[C],this[C]=s?s(x):x[C]);return this.isDefaultPrevented=(x.defaultPrevented!=null?x.defaultPrevented:x.returnValue===!1)?yn:Ta,this.isPropagationStopped=Ta,this}return g(n.prototype,{preventDefault:function(){this.defaultPrevented=!0;var s=this.nativeEvent;s&&(s.preventDefault?s.preventDefault():typeof s.returnValue!="unknown"&&(s.returnValue=!1),this.isDefaultPrevented=yn)},stopPropagation:function(){var s=this.nativeEvent;s&&(s.stopPropagation?s.stopPropagation():typeof s.cancelBubble!="unknown"&&(s.cancelBubble=!0),this.isPropagationStopped=yn)},persist:function(){},isPersistent:yn}),n}var sr={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(t){return t.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Pr=vn(sr),Ur=g({},sr,{view:0,detail:0}),Vo=vn(Ur),bs,ys,Aa,pi=g({},Ur,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:js,button:0,buttons:0,relatedTarget:function(t){return t.relatedTarget===void 0?t.fromElement===t.srcElement?t.toElement:t.fromElement:t.relatedTarget},movementX:function(t){return"movementX"in t?t.movementX:(t!==Aa&&(Aa&&t.type==="mousemove"?(bs=t.screenX-Aa.screenX,ys=t.screenY-Aa.screenY):ys=bs=0,Aa=t),bs)},movementY:function(t){return"movementY"in t?t.movementY:ys}}),$o=vn(pi),nd=g({},pi,{dataTransfer:0}),hi=vn(nd),ld=g({},Ur,{relatedTarget:0}),Ea=vn(ld),rd=g({},sr,{animationName:0,elapsedTime:0,pseudoElement:0}),ad=vn(rd),vs=g({},sr,{clipboardData:function(t){return"clipboardData"in t?t.clipboardData:window.clipboardData}}),id=vn(vs),sd=g({},sr,{data:0}),xi=vn(sd),od={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},cd={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"},ud={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function dd(t){var n=this.nativeEvent;return n.getModifierState?n.getModifierState(t):(t=ud[t])?!!n[t]:!1}function js(){return dd}var fd=g({},Ur,{key:function(t){if(t.key){var n=od[t.key]||t.key;if(n!=="Unidentified")return n}return t.type==="keypress"?(t=gs(t),t===13?"Enter":String.fromCharCode(t)):t.type==="keydown"||t.type==="keyup"?cd[t.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:js,charCode:function(t){return t.type==="keypress"?gs(t):0},keyCode:function(t){return t.type==="keydown"||t.type==="keyup"?t.keyCode:0},which:function(t){return t.type==="keypress"?gs(t):t.type==="keydown"||t.type==="keyup"?t.keyCode:0}}),md=vn(fd),pd=g({},pi,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),Go=vn(pd),hd=g({},Ur,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:js}),xd=vn(hd),Yo=g({},sr,{propertyName:0,elapsedTime:0,pseudoElement:0}),gd=vn(Yo),bd=g({},pi,{deltaX:function(t){return"deltaX"in t?t.deltaX:"wheelDeltaX"in t?-t.wheelDeltaX:0},deltaY:function(t){return"deltaY"in t?t.deltaY:"wheelDeltaY"in t?-t.wheelDeltaY:"wheelDelta"in t?-t.wheelDelta:0},deltaZ:0,deltaMode:0}),yd=vn(bd),vd=g({},sr,{newState:0,oldState:0}),jd=vn(vd),ks=[9,13,27,32],pn=nl&&"CompositionEvent"in window,Hr=null;nl&&"documentMode"in document&&(Hr=document.documentMode);var Ns=nl&&"TextEvent"in window&&!Hr,qn=nl&&(!pn||Hr&&8<Hr&&11>=Hr),ws=" ",ll=!1;function or(t,n){switch(t){case"keyup":return ks.indexOf(n.keyCode)!==-1;case"keydown":return n.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Ra(t){return t=t.detail,typeof t=="object"&&"data"in t?t.data:null}var Fr=!1;function kd(t,n){switch(t){case"compositionend":return Ra(n);case"keypress":return n.which!==32?null:(ll=!0,ws);case"textInput":return t=n.data,t===ws&&ll?null:t;default:return null}}function Nd(t,n){if(Fr)return t==="compositionend"||!pn&&or(t,n)?(t=qo(),mi=ir=An=null,Fr=!1,t):null;switch(t){case"paste":return null;case"keypress":if(!(n.ctrlKey||n.altKey||n.metaKey)||n.ctrlKey&&n.altKey){if(n.char&&1<n.char.length)return n.char;if(n.which)return String.fromCharCode(n.which)}return null;case"compositionend":return qn&&n.locale!=="ko"?null:n.data;default:return null}}var wd={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 Qo(t){var n=t&&t.nodeName&&t.nodeName.toLowerCase();return n==="input"?!!wd[t.type]:n==="textarea"}function Xo(t,n,s,c){Br?Ir?Ir.push(c):Ir=[c]:Br=c,n=$c(n,"onChange"),0<n.length&&(s=new Pr("onChange","change",null,s,c),t.push({event:s,listeners:n}))}var Ma=null,za=null;function ph(t){Cg(t,0)}function gi(t){var n=Dr(t);if(Le(n))return t}function Ko(t,n){if(t==="change")return n}var Zo=!1;if(nl){var Ss;if(nl){var Cs="oninput"in document;if(!Cs){var Wo=document.createElement("div");Wo.setAttribute("oninput","return;"),Cs=typeof Wo.oninput=="function"}Ss=Cs}else Ss=!1;Zo=Ss&&(!document.documentMode||9<document.documentMode)}function Jo(){Ma&&(Ma.detachEvent("onpropertychange",ec),za=Ma=null)}function ec(t){if(t.propertyName==="value"&&gi(za)){var n=[];Xo(n,za,t,hs(t)),xs(ph,n)}}function Sd(t,n,s){t==="focusin"?(Jo(),Ma=n,za=s,Ma.attachEvent("onpropertychange",ec)):t==="focusout"&&Jo()}function Cd(t){if(t==="selectionchange"||t==="keyup"||t==="keydown")return gi(za)}function Td(t,n){if(t==="click")return gi(n)}function Ad(t,n){if(t==="input"||t==="change")return gi(n)}function Ed(t,n){return t===n&&(t!==0||1/t===1/n)||t!==t&&n!==n}var Dn=typeof Object.is=="function"?Object.is:Ed;function bi(t,n){if(Dn(t,n))return!0;if(typeof t!="object"||t===null||typeof n!="object"||n===null)return!1;var s=Object.keys(t),c=Object.keys(n);if(s.length!==c.length)return!1;for(c=0;c<s.length;c++){var m=s[c];if(!Ye.call(n,m)||!Dn(t[m],n[m]))return!1}return!0}function tc(t){for(;t&&t.firstChild;)t=t.firstChild;return t}function rl(t,n){var s=tc(t);t=0;for(var c;s;){if(s.nodeType===3){if(c=t+s.textContent.length,t<=n&&c>=n)return{node:s,offset:n-t};t=c}e:{for(;s;){if(s.nextSibling){s=s.nextSibling;break e}s=s.parentNode}s=void 0}s=tc(s)}}function yi(t,n){return t&&n?t===n?!0:t&&t.nodeType===3?!1:n&&n.nodeType===3?yi(t,n.parentNode):"contains"in t?t.contains(n):t.compareDocumentPosition?!!(t.compareDocumentPosition(n)&16):!1:!1}function Ts(t){t=t!=null&&t.ownerDocument!=null&&t.ownerDocument.defaultView!=null?t.ownerDocument.defaultView:window;for(var n=$t(t.document);n instanceof t.HTMLIFrameElement;){try{var s=typeof n.contentWindow.location.href=="string"}catch{s=!1}if(s)t=n.contentWindow;else break;n=$t(t.document)}return n}function vi(t){var n=t&&t.nodeName&&t.nodeName.toLowerCase();return n&&(n==="input"&&(t.type==="text"||t.type==="search"||t.type==="tel"||t.type==="url"||t.type==="password")||n==="textarea"||t.contentEditable==="true")}var Rd=nl&&"documentMode"in document&&11>=document.documentMode,cr=null,As=null,Oa=null,Es=!1;function nc(t,n,s){var c=s.window===s?s.document:s.nodeType===9?s:s.ownerDocument;Es||cr==null||cr!==$t(c)||(c=cr,"selectionStart"in c&&vi(c)?c={start:c.selectionStart,end:c.selectionEnd}:(c=(c.ownerDocument&&c.ownerDocument.defaultView||window).getSelection(),c={anchorNode:c.anchorNode,anchorOffset:c.anchorOffset,focusNode:c.focusNode,focusOffset:c.focusOffset}),Oa&&bi(Oa,c)||(Oa=c,c=$c(As,"onSelect"),0<c.length&&(n=new Pr("onSelect","select",null,n,s),t.push({event:n,listeners:c}),n.target=cr)))}function ur(t,n){var s={};return s[t.toLowerCase()]=n.toLowerCase(),s["Webkit"+t]="webkit"+n,s["Moz"+t]="moz"+n,s}var qr={animationend:ur("Animation","AnimationEnd"),animationiteration:ur("Animation","AnimationIteration"),animationstart:ur("Animation","AnimationStart"),transitionrun:ur("Transition","TransitionRun"),transitionstart:ur("Transition","TransitionStart"),transitioncancel:ur("Transition","TransitionCancel"),transitionend:ur("Transition","TransitionEnd")},La={},lc={};nl&&(lc=document.createElement("div").style,"AnimationEvent"in window||(delete qr.animationend.animation,delete qr.animationiteration.animation,delete qr.animationstart.animation),"TransitionEvent"in window||delete qr.transitionend.transition);function dr(t){if(La[t])return La[t];if(!qr[t])return t;var n=qr[t],s;for(s in n)if(n.hasOwnProperty(s)&&s in lc)return La[t]=n[s];return t}var rc=dr("animationend"),Da=dr("animationiteration"),ac=dr("animationstart"),Md=dr("transitionrun"),ji=dr("transitionstart"),zd=dr("transitioncancel"),_a=dr("transitionend"),ic=new Map,Ba="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(" ");Ba.push("scrollEnd");function al(t,n){ic.set(t,n),Vl(n,[t])}var ki=typeof reportError=="function"?reportError:function(t){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var n=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof t=="object"&&t!==null&&typeof t.message=="string"?String(t.message):String(t),error:t});if(!window.dispatchEvent(n))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",t);return}console.error(t)},Vn=[],fr=0,Ia=0;function Ni(){for(var t=fr,n=Ia=fr=0;n<t;){var s=Vn[n];Vn[n++]=null;var c=Vn[n];Vn[n++]=null;var m=Vn[n];Vn[n++]=null;var x=Vn[n];if(Vn[n++]=null,c!==null&&m!==null){var j=c.pending;j===null?m.next=m:(m.next=j.next,j.next=m),c.pending=m}x!==0&&El(s,m,x)}}function jn(t,n,s,c){Vn[fr++]=t,Vn[fr++]=n,Vn[fr++]=s,Vn[fr++]=c,Ia|=c,t.lanes|=c,t=t.alternate,t!==null&&(t.lanes|=c)}function Rs(t,n,s,c){return jn(t,n,s,c),wi(t)}function mr(t,n){return jn(t,null,null,n),wi(t)}function El(t,n,s){t.lanes|=s;var c=t.alternate;c!==null&&(c.lanes|=s);for(var m=!1,x=t.return;x!==null;)x.childLanes|=s,c=x.alternate,c!==null&&(c.childLanes|=s),x.tag===22&&(t=x.stateNode,t===null||t._visibility&1||(m=!0)),t=x,x=x.return;return t.tag===3?(x=t.stateNode,m&&n!==null&&(m=31-ke(s),t=x.hiddenUpdates,c=t[m],c===null?t[m]=[n]:c.push(n),n.lane=s|536870912),x):null}function wi(t){if(50<Js)throw Js=0,_f=null,Error(i(185));for(var n=t.return;n!==null;)t=n,n=t.return;return t.tag===3?t.stateNode:null}var Vr={};function Od(t,n,s,c){this.tag=t,this.key=s,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=n,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=c,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function _n(t,n,s,c){return new Od(t,n,s,c)}function Pa(t){return t=t.prototype,!(!t||!t.isReactComponent)}function Rl(t,n){var s=t.alternate;return s===null?(s=_n(t.tag,n,t.key,t.mode),s.elementType=t.elementType,s.type=t.type,s.stateNode=t.stateNode,s.alternate=t,t.alternate=s):(s.pendingProps=n,s.type=t.type,s.flags=0,s.subtreeFlags=0,s.deletions=null),s.flags=t.flags&65011712,s.childLanes=t.childLanes,s.lanes=t.lanes,s.child=t.child,s.memoizedProps=t.memoizedProps,s.memoizedState=t.memoizedState,s.updateQueue=t.updateQueue,n=t.dependencies,s.dependencies=n===null?null:{lanes:n.lanes,firstContext:n.firstContext},s.sibling=t.sibling,s.index=t.index,s.ref=t.ref,s.refCleanup=t.refCleanup,s}function sc(t,n){t.flags&=65011714;var s=t.alternate;return s===null?(t.childLanes=0,t.lanes=n,t.child=null,t.subtreeFlags=0,t.memoizedProps=null,t.memoizedState=null,t.updateQueue=null,t.dependencies=null,t.stateNode=null):(t.childLanes=s.childLanes,t.lanes=s.lanes,t.child=s.child,t.subtreeFlags=0,t.deletions=null,t.memoizedProps=s.memoizedProps,t.memoizedState=s.memoizedState,t.updateQueue=s.updateQueue,t.type=s.type,n=s.dependencies,t.dependencies=n===null?null:{lanes:n.lanes,firstContext:n.firstContext}),t}function En(t,n,s,c,m,x){var j=0;if(c=t,typeof t=="function")Pa(t)&&(j=1);else if(typeof t=="string")j=Lk(t,s,pe.current)?26:t==="html"||t==="head"||t==="body"?27:5;else e:switch(t){case ne:return t=_n(31,s,n,m),t.elementType=ne,t.lanes=x,t;case A:return Gl(s.children,m,x,n);case N:j=8,m|=24;break;case R:return t=_n(12,s,n,m|2),t.elementType=R,t.lanes=x,t;case V:return t=_n(13,s,n,m),t.elementType=V,t.lanes=x,t;case D:return t=_n(19,s,n,m),t.elementType=D,t.lanes=x,t;default:if(typeof t=="object"&&t!==null)switch(t.$$typeof){case H:j=10;break e;case L:j=9;break e;case X:j=11;break e;case I:j=14;break e;case F:j=16,c=null;break e}j=29,s=Error(i(130,t===null?"null":typeof t,"")),c=null}return n=_n(j,s,n,m),n.elementType=t,n.type=c,n.lanes=x,n}function Gl(t,n,s,c){return t=_n(7,t,c,n),t.lanes=s,t}function Ml(t,n,s){return t=_n(6,t,null,n),t.lanes=s,t}function oc(t){var n=_n(18,null,null,0);return n.stateNode=t,n}function $r(t,n,s){return n=_n(4,t.children!==null?t.children:[],t.key,n),n.lanes=s,n.stateNode={containerInfo:t.containerInfo,pendingChildren:null,implementation:t.implementation},n}var cc=new WeakMap;function $n(t,n){if(typeof t=="object"&&t!==null){var s=cc.get(t);return s!==void 0?s:(n={value:t,source:n,stack:Ke(n)},cc.set(t,n),n)}return{value:t,source:n,stack:Ke(n)}}var bl=[],zl=0,Ua=null,Ha=0,Gn=[],Bn=0,il=null,yl=1,sl="";function Ol(t,n){bl[zl++]=Ha,bl[zl++]=Ua,Ua=t,Ha=n}function Ms(t,n,s){Gn[Bn++]=yl,Gn[Bn++]=sl,Gn[Bn++]=il,il=t;var c=yl;t=sl;var m=32-ke(c)-1;c&=~(1<<m),s+=1;var x=32-ke(n)+m;if(30<x){var j=m-m%5;x=(c&(1<<j)-1).toString(32),c>>=j,m-=j,yl=1<<32-ke(n)+m|s<<m|c,sl=x+t}else yl=1<<x|s<<m|c,sl=t}function Si(t){t.return!==null&&(Ol(t,1),Ms(t,1,0))}function zs(t){for(;t===Ua;)Ua=bl[--zl],bl[zl]=null,Ha=bl[--zl],bl[zl]=null;for(;t===il;)il=Gn[--Bn],Gn[Bn]=null,sl=Gn[--Bn],Gn[Bn]=null,yl=Gn[--Bn],Gn[Bn]=null}function Os(t,n){Gn[Bn++]=yl,Gn[Bn++]=sl,Gn[Bn++]=il,yl=n.id,sl=n.overflow,il=t}var un=null,qe=null,xt=!1,Yl=null,kn=!1,_=Error(i(519));function Z(t){var n=Error(i(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw Gr($n(n,t)),_}function ye(t){var n=t.stateNode,s=t.type,c=t.memoizedProps;switch(n[Yt]=t,n[cn]=c,s){case"dialog":bt("cancel",n),bt("close",n);break;case"iframe":case"object":case"embed":bt("load",n);break;case"video":case"audio":for(s=0;s<to.length;s++)bt(to[s],n);break;case"source":bt("error",n);break;case"img":case"image":case"link":bt("error",n),bt("load",n);break;case"details":bt("toggle",n);break;case"input":bt("invalid",n),di(n,c.value,c.defaultValue,c.checked,c.defaultChecked,c.type,c.name,!0);break;case"select":bt("invalid",n);break;case"textarea":bt("invalid",n),Po(n,c.value,c.defaultValue,c.children)}s=c.children,typeof s!="string"&&typeof s!="number"&&typeof s!="bigint"||n.textContent===""+s||c.suppressHydrationWarning===!0||Rg(n.textContent,s)?(c.popover!=null&&(bt("beforetoggle",n),bt("toggle",n)),c.onScroll!=null&&bt("scroll",n),c.onScrollEnd!=null&&bt("scrollend",n),c.onClick!=null&&(n.onclick=Al),n=!0):n=!1,n||Z(t,!0)}function _t(t){for(un=t.return;un;)switch(un.tag){case 5:case 31:case 13:kn=!1;return;case 27:case 3:kn=!0;return;default:un=un.return}}function ol(t){if(t!==un)return!1;if(!xt)return _t(t),xt=!0,!1;var n=t.tag,s;if((s=n!==3&&n!==27)&&((s=n===5)&&(s=t.type,s=!(s!=="form"&&s!=="button")||Zf(t.type,t.memoizedProps)),s=!s),s&&qe&&Z(t),_t(t),n===13){if(t=t.memoizedState,t=t!==null?t.dehydrated:null,!t)throw Error(i(317));qe=Pg(t)}else if(n===31){if(t=t.memoizedState,t=t!==null?t.dehydrated:null,!t)throw Error(i(317));qe=Pg(t)}else n===27?(n=qe,ia(t.type)?(t=nm,nm=null,qe=t):qe=n):qe=un?kl(t.stateNode.nextSibling):null;return!0}function vl(){qe=un=null,xt=!1}function pr(){var t=Yl;return t!==null&&(Kn===null?Kn=t:Kn.push.apply(Kn,t),Yl=null),t}function Gr(t){Yl===null?Yl=[t]:Yl.push(t)}var Ld=B(null),Fa=null,hr=null;function Yr(t,n,s){M(Ld,n._currentValue),n._currentValue=s}function xr(t){t._currentValue=Ld.current,le(Ld)}function Dd(t,n,s){for(;t!==null;){var c=t.alternate;if((t.childLanes&n)!==n?(t.childLanes|=n,c!==null&&(c.childLanes|=n)):c!==null&&(c.childLanes&n)!==n&&(c.childLanes|=n),t===s)break;t=t.return}}function _d(t,n,s,c){var m=t.child;for(m!==null&&(m.return=t);m!==null;){var x=m.dependencies;if(x!==null){var j=m.child;x=x.firstContext;e:for(;x!==null;){var C=x;x=m;for(var U=0;U<n.length;U++)if(C.context===n[U]){x.lanes|=s,C=x.alternate,C!==null&&(C.lanes|=s),Dd(x.return,s,t),c||(j=null);break e}x=C.next}}else if(m.tag===18){if(j=m.return,j===null)throw Error(i(341));j.lanes|=s,x=j.alternate,x!==null&&(x.lanes|=s),Dd(j,s,t),j=null}else j=m.child;if(j!==null)j.return=m;else for(j=m;j!==null;){if(j===t){j=null;break}if(m=j.sibling,m!==null){m.return=j.return,j=m;break}j=j.return}m=j}}function Ci(t,n,s,c){t=null;for(var m=n,x=!1;m!==null;){if(!x){if((m.flags&524288)!==0)x=!0;else if((m.flags&262144)!==0)break}if(m.tag===10){var j=m.alternate;if(j===null)throw Error(i(387));if(j=j.memoizedProps,j!==null){var C=m.type;Dn(m.pendingProps.value,j.value)||(t!==null?t.push(C):t=[C])}}else if(m===Re.current){if(j=m.alternate,j===null)throw Error(i(387));j.memoizedState.memoizedState!==m.memoizedState.memoizedState&&(t!==null?t.push(io):t=[io])}m=m.return}t!==null&&_d(n,t,s,c),n.flags|=262144}function uc(t){for(t=t.firstContext;t!==null;){if(!Dn(t.context._currentValue,t.memoizedValue))return!0;t=t.next}return!1}function qa(t){Fa=t,hr=null,t=t.dependencies,t!==null&&(t.firstContext=null)}function Nn(t){return hh(Fa,t)}function dc(t,n){return Fa===null&&qa(t),hh(t,n)}function hh(t,n){var s=n._currentValue;if(n={context:n,memoizedValue:s,next:null},hr===null){if(t===null)throw Error(i(308));hr=n,t.dependencies={lanes:0,firstContext:n},t.flags|=524288}else hr=hr.next=n;return s}var Rj=typeof AbortController<"u"?AbortController:function(){var t=[],n=this.signal={aborted:!1,addEventListener:function(s,c){t.push(c)}};this.abort=function(){n.aborted=!0,t.forEach(function(s){return s()})}},Mj=e.unstable_scheduleCallback,zj=e.unstable_NormalPriority,tn={$$typeof:H,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function Bd(){return{controller:new Rj,data:new Map,refCount:0}}function Ls(t){t.refCount--,t.refCount===0&&Mj(zj,function(){t.controller.abort()})}var Ds=null,Id=0,Ti=0,Ai=null;function Oj(t,n){if(Ds===null){var s=Ds=[];Id=0,Ti=Ff(),Ai={status:"pending",value:void 0,then:function(c){s.push(c)}}}return Id++,n.then(xh,xh),n}function xh(){if(--Id===0&&Ds!==null){Ai!==null&&(Ai.status="fulfilled");var t=Ds;Ds=null,Ti=0,Ai=null;for(var n=0;n<t.length;n++)(0,t[n])()}}function Lj(t,n){var s=[],c={status:"pending",value:null,reason:null,then:function(m){s.push(m)}};return t.then(function(){c.status="fulfilled",c.value=n;for(var m=0;m<s.length;m++)(0,s[m])(n)},function(m){for(c.status="rejected",c.reason=m,m=0;m<s.length;m++)(0,s[m])(void 0)}),c}var gh=w.S;w.S=function(t,n){eg=nt(),typeof n=="object"&&n!==null&&typeof n.then=="function"&&Oj(t,n),gh!==null&&gh(t,n)};var Va=B(null);function Pd(){var t=Va.current;return t!==null?t:Bt.pooledCache}function fc(t,n){n===null?M(Va,Va.current):M(Va,n.pool)}function bh(){var t=Pd();return t===null?null:{parent:tn._currentValue,pool:t}}var Ei=Error(i(460)),Ud=Error(i(474)),mc=Error(i(542)),pc={then:function(){}};function yh(t){return t=t.status,t==="fulfilled"||t==="rejected"}function vh(t,n,s){switch(s=t[s],s===void 0?t.push(n):s!==n&&(n.then(Al,Al),n=s),n.status){case"fulfilled":return n.value;case"rejected":throw t=n.reason,kh(t),t;default:if(typeof n.status=="string")n.then(Al,Al);else{if(t=Bt,t!==null&&100<t.shellSuspendCounter)throw Error(i(482));t=n,t.status="pending",t.then(function(c){if(n.status==="pending"){var m=n;m.status="fulfilled",m.value=c}},function(c){if(n.status==="pending"){var m=n;m.status="rejected",m.reason=c}})}switch(n.status){case"fulfilled":return n.value;case"rejected":throw t=n.reason,kh(t),t}throw Ga=n,Ei}}function $a(t){try{var n=t._init;return n(t._payload)}catch(s){throw s!==null&&typeof s=="object"&&typeof s.then=="function"?(Ga=s,Ei):s}}var Ga=null;function jh(){if(Ga===null)throw Error(i(459));var t=Ga;return Ga=null,t}function kh(t){if(t===Ei||t===mc)throw Error(i(483))}var Ri=null,_s=0;function hc(t){var n=_s;return _s+=1,Ri===null&&(Ri=[]),vh(Ri,t,n)}function Bs(t,n){n=n.props.ref,t.ref=n!==void 0?n:null}function xc(t,n){throw n.$$typeof===v?Error(i(525)):(t=Object.prototype.toString.call(n),Error(i(31,t==="[object Object]"?"object with keys {"+Object.keys(n).join(", ")+"}":t)))}function Nh(t){function n(K,$){if(t){var ee=K.deletions;ee===null?(K.deletions=[$],K.flags|=16):ee.push($)}}function s(K,$){if(!t)return null;for(;$!==null;)n(K,$),$=$.sibling;return null}function c(K){for(var $=new Map;K!==null;)K.key!==null?$.set(K.key,K):$.set(K.index,K),K=K.sibling;return $}function m(K,$){return K=Rl(K,$),K.index=0,K.sibling=null,K}function x(K,$,ee){return K.index=ee,t?(ee=K.alternate,ee!==null?(ee=ee.index,ee<$?(K.flags|=67108866,$):ee):(K.flags|=67108866,$)):(K.flags|=1048576,$)}function j(K){return t&&K.alternate===null&&(K.flags|=67108866),K}function C(K,$,ee,me){return $===null||$.tag!==6?($=Ml(ee,K.mode,me),$.return=K,$):($=m($,ee),$.return=K,$)}function U(K,$,ee,me){var Ge=ee.type;return Ge===A?fe(K,$,ee.props.children,me,ee.key):$!==null&&($.elementType===Ge||typeof Ge=="object"&&Ge!==null&&Ge.$$typeof===F&&$a(Ge)===$.type)?($=m($,ee.props),Bs($,ee),$.return=K,$):($=En(ee.type,ee.key,ee.props,null,K.mode,me),Bs($,ee),$.return=K,$)}function te(K,$,ee,me){return $===null||$.tag!==4||$.stateNode.containerInfo!==ee.containerInfo||$.stateNode.implementation!==ee.implementation?($=$r(ee,K.mode,me),$.return=K,$):($=m($,ee.children||[]),$.return=K,$)}function fe(K,$,ee,me,Ge){return $===null||$.tag!==7?($=Gl(ee,K.mode,me,Ge),$.return=K,$):($=m($,ee),$.return=K,$)}function xe(K,$,ee){if(typeof $=="string"&&$!==""||typeof $=="number"||typeof $=="bigint")return $=Ml(""+$,K.mode,ee),$.return=K,$;if(typeof $=="object"&&$!==null){switch($.$$typeof){case k:return ee=En($.type,$.key,$.props,null,K.mode,ee),Bs(ee,$),ee.return=K,ee;case S:return $=$r($,K.mode,ee),$.return=K,$;case F:return $=$a($),xe(K,$,ee)}if(J($)||Q($))return $=Gl($,K.mode,ee,null),$.return=K,$;if(typeof $.then=="function")return xe(K,hc($),ee);if($.$$typeof===H)return xe(K,dc(K,$),ee);xc(K,$)}return null}function re(K,$,ee,me){var Ge=$!==null?$.key:null;if(typeof ee=="string"&&ee!==""||typeof ee=="number"||typeof ee=="bigint")return Ge!==null?null:C(K,$,""+ee,me);if(typeof ee=="object"&&ee!==null){switch(ee.$$typeof){case k:return ee.key===Ge?U(K,$,ee,me):null;case S:return ee.key===Ge?te(K,$,ee,me):null;case F:return ee=$a(ee),re(K,$,ee,me)}if(J(ee)||Q(ee))return Ge!==null?null:fe(K,$,ee,me,null);if(typeof ee.then=="function")return re(K,$,hc(ee),me);if(ee.$$typeof===H)return re(K,$,dc(K,ee),me);xc(K,ee)}return null}function ie(K,$,ee,me,Ge){if(typeof me=="string"&&me!==""||typeof me=="number"||typeof me=="bigint")return K=K.get(ee)||null,C($,K,""+me,Ge);if(typeof me=="object"&&me!==null){switch(me.$$typeof){case k:return K=K.get(me.key===null?ee:me.key)||null,U($,K,me,Ge);case S:return K=K.get(me.key===null?ee:me.key)||null,te($,K,me,Ge);case F:return me=$a(me),ie(K,$,ee,me,Ge)}if(J(me)||Q(me))return K=K.get(ee)||null,fe($,K,me,Ge,null);if(typeof me.then=="function")return ie(K,$,ee,hc(me),Ge);if(me.$$typeof===H)return ie(K,$,ee,dc($,me),Ge);xc($,me)}return null}function De(K,$,ee,me){for(var Ge=null,St=null,He=$,dt=$=0,kt=null;He!==null&&dt<ee.length;dt++){He.index>dt?(kt=He,He=null):kt=He.sibling;var Ct=re(K,He,ee[dt],me);if(Ct===null){He===null&&(He=kt);break}t&&He&&Ct.alternate===null&&n(K,He),$=x(Ct,$,dt),St===null?Ge=Ct:St.sibling=Ct,St=Ct,He=kt}if(dt===ee.length)return s(K,He),xt&&Ol(K,dt),Ge;if(He===null){for(;dt<ee.length;dt++)He=xe(K,ee[dt],me),He!==null&&($=x(He,$,dt),St===null?Ge=He:St.sibling=He,St=He);return xt&&Ol(K,dt),Ge}for(He=c(He);dt<ee.length;dt++)kt=ie(He,K,dt,ee[dt],me),kt!==null&&(t&&kt.alternate!==null&&He.delete(kt.key===null?dt:kt.key),$=x(kt,$,dt),St===null?Ge=kt:St.sibling=kt,St=kt);return t&&He.forEach(function(da){return n(K,da)}),xt&&Ol(K,dt),Ge}function Ze(K,$,ee,me){if(ee==null)throw Error(i(151));for(var Ge=null,St=null,He=$,dt=$=0,kt=null,Ct=ee.next();He!==null&&!Ct.done;dt++,Ct=ee.next()){He.index>dt?(kt=He,He=null):kt=He.sibling;var da=re(K,He,Ct.value,me);if(da===null){He===null&&(He=kt);break}t&&He&&da.alternate===null&&n(K,He),$=x(da,$,dt),St===null?Ge=da:St.sibling=da,St=da,He=kt}if(Ct.done)return s(K,He),xt&&Ol(K,dt),Ge;if(He===null){for(;!Ct.done;dt++,Ct=ee.next())Ct=xe(K,Ct.value,me),Ct!==null&&($=x(Ct,$,dt),St===null?Ge=Ct:St.sibling=Ct,St=Ct);return xt&&Ol(K,dt),Ge}for(He=c(He);!Ct.done;dt++,Ct=ee.next())Ct=ie(He,K,dt,Ct.value,me),Ct!==null&&(t&&Ct.alternate!==null&&He.delete(Ct.key===null?dt:Ct.key),$=x(Ct,$,dt),St===null?Ge=Ct:St.sibling=Ct,St=Ct);return t&&He.forEach(function($k){return n(K,$k)}),xt&&Ol(K,dt),Ge}function Dt(K,$,ee,me){if(typeof ee=="object"&&ee!==null&&ee.type===A&&ee.key===null&&(ee=ee.props.children),typeof ee=="object"&&ee!==null){switch(ee.$$typeof){case k:e:{for(var Ge=ee.key;$!==null;){if($.key===Ge){if(Ge=ee.type,Ge===A){if($.tag===7){s(K,$.sibling),me=m($,ee.props.children),me.return=K,K=me;break e}}else if($.elementType===Ge||typeof Ge=="object"&&Ge!==null&&Ge.$$typeof===F&&$a(Ge)===$.type){s(K,$.sibling),me=m($,ee.props),Bs(me,ee),me.return=K,K=me;break e}s(K,$);break}else n(K,$);$=$.sibling}ee.type===A?(me=Gl(ee.props.children,K.mode,me,ee.key),me.return=K,K=me):(me=En(ee.type,ee.key,ee.props,null,K.mode,me),Bs(me,ee),me.return=K,K=me)}return j(K);case S:e:{for(Ge=ee.key;$!==null;){if($.key===Ge)if($.tag===4&&$.stateNode.containerInfo===ee.containerInfo&&$.stateNode.implementation===ee.implementation){s(K,$.sibling),me=m($,ee.children||[]),me.return=K,K=me;break e}else{s(K,$);break}else n(K,$);$=$.sibling}me=$r(ee,K.mode,me),me.return=K,K=me}return j(K);case F:return ee=$a(ee),Dt(K,$,ee,me)}if(J(ee))return De(K,$,ee,me);if(Q(ee)){if(Ge=Q(ee),typeof Ge!="function")throw Error(i(150));return ee=Ge.call(ee),Ze(K,$,ee,me)}if(typeof ee.then=="function")return Dt(K,$,hc(ee),me);if(ee.$$typeof===H)return Dt(K,$,dc(K,ee),me);xc(K,ee)}return typeof ee=="string"&&ee!==""||typeof ee=="number"||typeof ee=="bigint"?(ee=""+ee,$!==null&&$.tag===6?(s(K,$.sibling),me=m($,ee),me.return=K,K=me):(s(K,$),me=Ml(ee,K.mode,me),me.return=K,K=me),j(K)):s(K,$)}return function(K,$,ee,me){try{_s=0;var Ge=Dt(K,$,ee,me);return Ri=null,Ge}catch(He){if(He===Ei||He===mc)throw He;var St=_n(29,He,null,K.mode);return St.lanes=me,St.return=K,St}}}var Ya=Nh(!0),wh=Nh(!1),Qr=!1;function Hd(t){t.updateQueue={baseState:t.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Fd(t,n){t=t.updateQueue,n.updateQueue===t&&(n.updateQueue={baseState:t.baseState,firstBaseUpdate:t.firstBaseUpdate,lastBaseUpdate:t.lastBaseUpdate,shared:t.shared,callbacks:null})}function Xr(t){return{lane:t,tag:0,payload:null,callback:null,next:null}}function Kr(t,n,s){var c=t.updateQueue;if(c===null)return null;if(c=c.shared,(At&2)!==0){var m=c.pending;return m===null?n.next=n:(n.next=m.next,m.next=n),c.pending=n,n=wi(t),El(t,null,s),n}return jn(t,c,n,s),wi(t)}function Is(t,n,s){if(n=n.updateQueue,n!==null&&(n=n.shared,(s&4194048)!==0)){var c=n.lanes;c&=t.pendingLanes,s|=c,n.lanes=s,va(t,s)}}function qd(t,n){var s=t.updateQueue,c=t.alternate;if(c!==null&&(c=c.updateQueue,s===c)){var m=null,x=null;if(s=s.firstBaseUpdate,s!==null){do{var j={lane:s.lane,tag:s.tag,payload:s.payload,callback:null,next:null};x===null?m=x=j:x=x.next=j,s=s.next}while(s!==null);x===null?m=x=n:x=x.next=n}else m=x=n;s={baseState:c.baseState,firstBaseUpdate:m,lastBaseUpdate:x,shared:c.shared,callbacks:c.callbacks},t.updateQueue=s;return}t=s.lastBaseUpdate,t===null?s.firstBaseUpdate=n:t.next=n,s.lastBaseUpdate=n}var Vd=!1;function Ps(){if(Vd){var t=Ai;if(t!==null)throw t}}function Us(t,n,s,c){Vd=!1;var m=t.updateQueue;Qr=!1;var x=m.firstBaseUpdate,j=m.lastBaseUpdate,C=m.shared.pending;if(C!==null){m.shared.pending=null;var U=C,te=U.next;U.next=null,j===null?x=te:j.next=te,j=U;var fe=t.alternate;fe!==null&&(fe=fe.updateQueue,C=fe.lastBaseUpdate,C!==j&&(C===null?fe.firstBaseUpdate=te:C.next=te,fe.lastBaseUpdate=U))}if(x!==null){var xe=m.baseState;j=0,fe=te=U=null,C=x;do{var re=C.lane&-536870913,ie=re!==C.lane;if(ie?(jt&re)===re:(c&re)===re){re!==0&&re===Ti&&(Vd=!0),fe!==null&&(fe=fe.next={lane:0,tag:C.tag,payload:C.payload,callback:null,next:null});e:{var De=t,Ze=C;re=n;var Dt=s;switch(Ze.tag){case 1:if(De=Ze.payload,typeof De=="function"){xe=De.call(Dt,xe,re);break e}xe=De;break e;case 3:De.flags=De.flags&-65537|128;case 0:if(De=Ze.payload,re=typeof De=="function"?De.call(Dt,xe,re):De,re==null)break e;xe=g({},xe,re);break e;case 2:Qr=!0}}re=C.callback,re!==null&&(t.flags|=64,ie&&(t.flags|=8192),ie=m.callbacks,ie===null?m.callbacks=[re]:ie.push(re))}else ie={lane:re,tag:C.tag,payload:C.payload,callback:C.callback,next:null},fe===null?(te=fe=ie,U=xe):fe=fe.next=ie,j|=re;if(C=C.next,C===null){if(C=m.shared.pending,C===null)break;ie=C,C=ie.next,ie.next=null,m.lastBaseUpdate=ie,m.shared.pending=null}}while(!0);fe===null&&(U=xe),m.baseState=U,m.firstBaseUpdate=te,m.lastBaseUpdate=fe,x===null&&(m.shared.lanes=0),ta|=j,t.lanes=j,t.memoizedState=xe}}function Sh(t,n){if(typeof t!="function")throw Error(i(191,t));t.call(n)}function Ch(t,n){var s=t.callbacks;if(s!==null)for(t.callbacks=null,t=0;t<s.length;t++)Sh(s[t],n)}var Mi=B(null),gc=B(0);function Th(t,n){t=Sr,M(gc,t),M(Mi,n),Sr=t|n.baseLanes}function $d(){M(gc,Sr),M(Mi,Mi.current)}function Gd(){Sr=gc.current,le(Mi),le(gc)}var cl=B(null),jl=null;function Zr(t){var n=t.alternate;M(Jt,Jt.current&1),M(cl,t),jl===null&&(n===null||Mi.current!==null||n.memoizedState!==null)&&(jl=t)}function Yd(t){M(Jt,Jt.current),M(cl,t),jl===null&&(jl=t)}function Ah(t){t.tag===22?(M(Jt,Jt.current),M(cl,t),jl===null&&(jl=t)):Wr()}function Wr(){M(Jt,Jt.current),M(cl,cl.current)}function ul(t){le(cl),jl===t&&(jl=null),le(Jt)}var Jt=B(0);function bc(t){for(var n=t;n!==null;){if(n.tag===13){var s=n.memoizedState;if(s!==null&&(s=s.dehydrated,s===null||em(s)||tm(s)))return n}else if(n.tag===19&&(n.memoizedProps.revealOrder==="forwards"||n.memoizedProps.revealOrder==="backwards"||n.memoizedProps.revealOrder==="unstable_legacy-backwards"||n.memoizedProps.revealOrder==="together")){if((n.flags&128)!==0)return n}else if(n.child!==null){n.child.return=n,n=n.child;continue}if(n===t)break;for(;n.sibling===null;){if(n.return===null||n.return===t)return null;n=n.return}n.sibling.return=n.return,n=n.sibling}return null}var gr=0,ct=null,Ot=null,nn=null,yc=!1,zi=!1,Qa=!1,vc=0,Hs=0,Oi=null,Dj=0;function Kt(){throw Error(i(321))}function Qd(t,n){if(n===null)return!1;for(var s=0;s<n.length&&s<t.length;s++)if(!Dn(t[s],n[s]))return!1;return!0}function Xd(t,n,s,c,m,x){return gr=x,ct=n,n.memoizedState=null,n.updateQueue=null,n.lanes=0,w.H=t===null||t.memoizedState===null?dx:df,Qa=!1,x=s(c,m),Qa=!1,zi&&(x=Rh(n,s,c,m)),Eh(t),x}function Eh(t){w.H=Vs;var n=Ot!==null&&Ot.next!==null;if(gr=0,nn=Ot=ct=null,yc=!1,Hs=0,Oi=null,n)throw Error(i(300));t===null||ln||(t=t.dependencies,t!==null&&uc(t)&&(ln=!0))}function Rh(t,n,s,c){ct=t;var m=0;do{if(zi&&(Oi=null),Hs=0,zi=!1,25<=m)throw Error(i(301));if(m+=1,nn=Ot=null,t.updateQueue!=null){var x=t.updateQueue;x.lastEffect=null,x.events=null,x.stores=null,x.memoCache!=null&&(x.memoCache.index=0)}w.H=fx,x=n(s,c)}while(zi);return x}function _j(){var t=w.H,n=t.useState()[0];return n=typeof n.then=="function"?Fs(n):n,t=t.useState()[0],(Ot!==null?Ot.memoizedState:null)!==t&&(ct.flags|=1024),n}function Kd(){var t=vc!==0;return vc=0,t}function Zd(t,n,s){n.updateQueue=t.updateQueue,n.flags&=-2053,t.lanes&=~s}function Wd(t){if(yc){for(t=t.memoizedState;t!==null;){var n=t.queue;n!==null&&(n.pending=null),t=t.next}yc=!1}gr=0,nn=Ot=ct=null,zi=!1,Hs=vc=0,Oi=null}function In(){var t={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return nn===null?ct.memoizedState=nn=t:nn=nn.next=t,nn}function en(){if(Ot===null){var t=ct.alternate;t=t!==null?t.memoizedState:null}else t=Ot.next;var n=nn===null?ct.memoizedState:nn.next;if(n!==null)nn=n,Ot=t;else{if(t===null)throw ct.alternate===null?Error(i(467)):Error(i(310));Ot=t,t={memoizedState:Ot.memoizedState,baseState:Ot.baseState,baseQueue:Ot.baseQueue,queue:Ot.queue,next:null},nn===null?ct.memoizedState=nn=t:nn=nn.next=t}return nn}function jc(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function Fs(t){var n=Hs;return Hs+=1,Oi===null&&(Oi=[]),t=vh(Oi,t,n),n=ct,(nn===null?n.memoizedState:nn.next)===null&&(n=n.alternate,w.H=n===null||n.memoizedState===null?dx:df),t}function kc(t){if(t!==null&&typeof t=="object"){if(typeof t.then=="function")return Fs(t);if(t.$$typeof===H)return Nn(t)}throw Error(i(438,String(t)))}function Jd(t){var n=null,s=ct.updateQueue;if(s!==null&&(n=s.memoCache),n==null){var c=ct.alternate;c!==null&&(c=c.updateQueue,c!==null&&(c=c.memoCache,c!=null&&(n={data:c.data.map(function(m){return m.slice()}),index:0})))}if(n==null&&(n={data:[],index:0}),s===null&&(s=jc(),ct.updateQueue=s),s.memoCache=n,s=n.data[n.index],s===void 0)for(s=n.data[n.index]=Array(t),c=0;c<t;c++)s[c]=O;return n.index++,s}function br(t,n){return typeof n=="function"?n(t):n}function Nc(t){var n=en();return ef(n,Ot,t)}function ef(t,n,s){var c=t.queue;if(c===null)throw Error(i(311));c.lastRenderedReducer=s;var m=t.baseQueue,x=c.pending;if(x!==null){if(m!==null){var j=m.next;m.next=x.next,x.next=j}n.baseQueue=m=x,c.pending=null}if(x=t.baseState,m===null)t.memoizedState=x;else{n=m.next;var C=j=null,U=null,te=n,fe=!1;do{var xe=te.lane&-536870913;if(xe!==te.lane?(jt&xe)===xe:(gr&xe)===xe){var re=te.revertLane;if(re===0)U!==null&&(U=U.next={lane:0,revertLane:0,gesture:null,action:te.action,hasEagerState:te.hasEagerState,eagerState:te.eagerState,next:null}),xe===Ti&&(fe=!0);else if((gr&re)===re){te=te.next,re===Ti&&(fe=!0);continue}else xe={lane:0,revertLane:te.revertLane,gesture:null,action:te.action,hasEagerState:te.hasEagerState,eagerState:te.eagerState,next:null},U===null?(C=U=xe,j=x):U=U.next=xe,ct.lanes|=re,ta|=re;xe=te.action,Qa&&s(x,xe),x=te.hasEagerState?te.eagerState:s(x,xe)}else re={lane:xe,revertLane:te.revertLane,gesture:te.gesture,action:te.action,hasEagerState:te.hasEagerState,eagerState:te.eagerState,next:null},U===null?(C=U=re,j=x):U=U.next=re,ct.lanes|=xe,ta|=xe;te=te.next}while(te!==null&&te!==n);if(U===null?j=x:U.next=C,!Dn(x,t.memoizedState)&&(ln=!0,fe&&(s=Ai,s!==null)))throw s;t.memoizedState=x,t.baseState=j,t.baseQueue=U,c.lastRenderedState=x}return m===null&&(c.lanes=0),[t.memoizedState,c.dispatch]}function tf(t){var n=en(),s=n.queue;if(s===null)throw Error(i(311));s.lastRenderedReducer=t;var c=s.dispatch,m=s.pending,x=n.memoizedState;if(m!==null){s.pending=null;var j=m=m.next;do x=t(x,j.action),j=j.next;while(j!==m);Dn(x,n.memoizedState)||(ln=!0),n.memoizedState=x,n.baseQueue===null&&(n.baseState=x),s.lastRenderedState=x}return[x,c]}function Mh(t,n,s){var c=ct,m=en(),x=xt;if(x){if(s===void 0)throw Error(i(407));s=s()}else s=n();var j=!Dn((Ot||m).memoizedState,s);if(j&&(m.memoizedState=s,ln=!0),m=m.queue,rf(Lh.bind(null,c,m,t),[t]),m.getSnapshot!==n||j||nn!==null&&nn.memoizedState.tag&1){if(c.flags|=2048,Li(9,{destroy:void 0},Oh.bind(null,c,m,s,n),null),Bt===null)throw Error(i(349));x||(gr&127)!==0||zh(c,n,s)}return s}function zh(t,n,s){t.flags|=16384,t={getSnapshot:n,value:s},n=ct.updateQueue,n===null?(n=jc(),ct.updateQueue=n,n.stores=[t]):(s=n.stores,s===null?n.stores=[t]:s.push(t))}function Oh(t,n,s,c){n.value=s,n.getSnapshot=c,Dh(n)&&_h(t)}function Lh(t,n,s){return s(function(){Dh(n)&&_h(t)})}function Dh(t){var n=t.getSnapshot;t=t.value;try{var s=n();return!Dn(t,s)}catch{return!0}}function _h(t){var n=mr(t,2);n!==null&&Zn(n,t,2)}function nf(t){var n=In();if(typeof t=="function"){var s=t;if(t=s(),Qa){de(!0);try{s()}finally{de(!1)}}}return n.memoizedState=n.baseState=t,n.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:br,lastRenderedState:t},n}function Bh(t,n,s,c){return t.baseState=s,ef(t,Ot,typeof c=="function"?c:br)}function Bj(t,n,s,c,m){if(Cc(t))throw Error(i(485));if(t=n.action,t!==null){var x={payload:m,action:t,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(j){x.listeners.push(j)}};w.T!==null?s(!0):x.isTransition=!1,c(x),s=n.pending,s===null?(x.next=n.pending=x,Ih(n,x)):(x.next=s.next,n.pending=s.next=x)}}function Ih(t,n){var s=n.action,c=n.payload,m=t.state;if(n.isTransition){var x=w.T,j={};w.T=j;try{var C=s(m,c),U=w.S;U!==null&&U(j,C),Ph(t,n,C)}catch(te){lf(t,n,te)}finally{x!==null&&j.types!==null&&(x.types=j.types),w.T=x}}else try{x=s(m,c),Ph(t,n,x)}catch(te){lf(t,n,te)}}function Ph(t,n,s){s!==null&&typeof s=="object"&&typeof s.then=="function"?s.then(function(c){Uh(t,n,c)},function(c){return lf(t,n,c)}):Uh(t,n,s)}function Uh(t,n,s){n.status="fulfilled",n.value=s,Hh(n),t.state=s,n=t.pending,n!==null&&(s=n.next,s===n?t.pending=null:(s=s.next,n.next=s,Ih(t,s)))}function lf(t,n,s){var c=t.pending;if(t.pending=null,c!==null){c=c.next;do n.status="rejected",n.reason=s,Hh(n),n=n.next;while(n!==c)}t.action=null}function Hh(t){t=t.listeners;for(var n=0;n<t.length;n++)(0,t[n])()}function Fh(t,n){return n}function qh(t,n){if(xt){var s=Bt.formState;if(s!==null){e:{var c=ct;if(xt){if(qe){t:{for(var m=qe,x=kn;m.nodeType!==8;){if(!x){m=null;break t}if(m=kl(m.nextSibling),m===null){m=null;break t}}x=m.data,m=x==="F!"||x==="F"?m:null}if(m){qe=kl(m.nextSibling),c=m.data==="F!";break e}}Z(c)}c=!1}c&&(n=s[0])}}return s=In(),s.memoizedState=s.baseState=n,c={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Fh,lastRenderedState:n},s.queue=c,s=ox.bind(null,ct,c),c.dispatch=s,c=nf(!1),x=uf.bind(null,ct,!1,c.queue),c=In(),m={state:n,dispatch:null,action:t,pending:null},c.queue=m,s=Bj.bind(null,ct,m,x,s),m.dispatch=s,c.memoizedState=t,[n,s,!1]}function Vh(t){var n=en();return $h(n,Ot,t)}function $h(t,n,s){if(n=ef(t,n,Fh)[0],t=Nc(br)[0],typeof n=="object"&&n!==null&&typeof n.then=="function")try{var c=Fs(n)}catch(j){throw j===Ei?mc:j}else c=n;n=en();var m=n.queue,x=m.dispatch;return s!==n.memoizedState&&(ct.flags|=2048,Li(9,{destroy:void 0},Ij.bind(null,m,s),null)),[c,x,t]}function Ij(t,n){t.action=n}function Gh(t){var n=en(),s=Ot;if(s!==null)return $h(n,s,t);en(),n=n.memoizedState,s=en();var c=s.queue.dispatch;return s.memoizedState=t,[n,c,!1]}function Li(t,n,s,c){return t={tag:t,create:s,deps:c,inst:n,next:null},n=ct.updateQueue,n===null&&(n=jc(),ct.updateQueue=n),s=n.lastEffect,s===null?n.lastEffect=t.next=t:(c=s.next,s.next=t,t.next=c,n.lastEffect=t),t}function Yh(){return en().memoizedState}function wc(t,n,s,c){var m=In();ct.flags|=t,m.memoizedState=Li(1|n,{destroy:void 0},s,c===void 0?null:c)}function Sc(t,n,s,c){var m=en();c=c===void 0?null:c;var x=m.memoizedState.inst;Ot!==null&&c!==null&&Qd(c,Ot.memoizedState.deps)?m.memoizedState=Li(n,x,s,c):(ct.flags|=t,m.memoizedState=Li(1|n,x,s,c))}function Qh(t,n){wc(8390656,8,t,n)}function rf(t,n){Sc(2048,8,t,n)}function Pj(t){ct.flags|=4;var n=ct.updateQueue;if(n===null)n=jc(),ct.updateQueue=n,n.events=[t];else{var s=n.events;s===null?n.events=[t]:s.push(t)}}function Xh(t){var n=en().memoizedState;return Pj({ref:n,nextImpl:t}),function(){if((At&2)!==0)throw Error(i(440));return n.impl.apply(void 0,arguments)}}function Kh(t,n){return Sc(4,2,t,n)}function Zh(t,n){return Sc(4,4,t,n)}function Wh(t,n){if(typeof n=="function"){t=t();var s=n(t);return function(){typeof s=="function"?s():n(null)}}if(n!=null)return t=t(),n.current=t,function(){n.current=null}}function Jh(t,n,s){s=s!=null?s.concat([t]):null,Sc(4,4,Wh.bind(null,n,t),s)}function af(){}function ex(t,n){var s=en();n=n===void 0?null:n;var c=s.memoizedState;return n!==null&&Qd(n,c[1])?c[0]:(s.memoizedState=[t,n],t)}function tx(t,n){var s=en();n=n===void 0?null:n;var c=s.memoizedState;if(n!==null&&Qd(n,c[1]))return c[0];if(c=t(),Qa){de(!0);try{t()}finally{de(!1)}}return s.memoizedState=[c,n],c}function sf(t,n,s){return s===void 0||(gr&1073741824)!==0&&(jt&261930)===0?t.memoizedState=n:(t.memoizedState=s,t=ng(),ct.lanes|=t,ta|=t,s)}function nx(t,n,s,c){return Dn(s,n)?s:Mi.current!==null?(t=sf(t,s,c),Dn(t,n)||(ln=!0),t):(gr&42)===0||(gr&1073741824)!==0&&(jt&261930)===0?(ln=!0,t.memoizedState=s):(t=ng(),ct.lanes|=t,ta|=t,n)}function lx(t,n,s,c,m){var x=Y.p;Y.p=x!==0&&8>x?x:8;var j=w.T,C={};w.T=C,uf(t,!1,n,s);try{var U=m(),te=w.S;if(te!==null&&te(C,U),U!==null&&typeof U=="object"&&typeof U.then=="function"){var fe=Lj(U,c);qs(t,n,fe,ml(t))}else qs(t,n,c,ml(t))}catch(xe){qs(t,n,{then:function(){},status:"rejected",reason:xe},ml())}finally{Y.p=x,j!==null&&C.types!==null&&(j.types=C.types),w.T=j}}function Uj(){}function of(t,n,s,c){if(t.tag!==5)throw Error(i(476));var m=rx(t).queue;lx(t,m,n,G,s===null?Uj:function(){return ax(t),s(c)})}function rx(t){var n=t.memoizedState;if(n!==null)return n;n={memoizedState:G,baseState:G,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:br,lastRenderedState:G},next:null};var s={};return n.next={memoizedState:s,baseState:s,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:br,lastRenderedState:s},next:null},t.memoizedState=n,t=t.alternate,t!==null&&(t.memoizedState=n),n}function ax(t){var n=rx(t);n.next===null&&(n=t.alternate.memoizedState),qs(t,n.next.queue,{},ml())}function cf(){return Nn(io)}function ix(){return en().memoizedState}function sx(){return en().memoizedState}function Hj(t){for(var n=t.return;n!==null;){switch(n.tag){case 24:case 3:var s=ml();t=Xr(s);var c=Kr(n,t,s);c!==null&&(Zn(c,n,s),Is(c,n,s)),n={cache:Bd()},t.payload=n;return}n=n.return}}function Fj(t,n,s){var c=ml();s={lane:c,revertLane:0,gesture:null,action:s,hasEagerState:!1,eagerState:null,next:null},Cc(t)?cx(n,s):(s=Rs(t,n,s,c),s!==null&&(Zn(s,t,c),ux(s,n,c)))}function ox(t,n,s){var c=ml();qs(t,n,s,c)}function qs(t,n,s,c){var m={lane:c,revertLane:0,gesture:null,action:s,hasEagerState:!1,eagerState:null,next:null};if(Cc(t))cx(n,m);else{var x=t.alternate;if(t.lanes===0&&(x===null||x.lanes===0)&&(x=n.lastRenderedReducer,x!==null))try{var j=n.lastRenderedState,C=x(j,s);if(m.hasEagerState=!0,m.eagerState=C,Dn(C,j))return jn(t,n,m,0),Bt===null&&Ni(),!1}catch{}if(s=Rs(t,n,m,c),s!==null)return Zn(s,t,c),ux(s,n,c),!0}return!1}function uf(t,n,s,c){if(c={lane:2,revertLane:Ff(),gesture:null,action:c,hasEagerState:!1,eagerState:null,next:null},Cc(t)){if(n)throw Error(i(479))}else n=Rs(t,s,c,2),n!==null&&Zn(n,t,2)}function Cc(t){var n=t.alternate;return t===ct||n!==null&&n===ct}function cx(t,n){zi=yc=!0;var s=t.pending;s===null?n.next=n:(n.next=s.next,s.next=n),t.pending=n}function ux(t,n,s){if((s&4194048)!==0){var c=n.lanes;c&=t.pendingLanes,s|=c,n.lanes=s,va(t,s)}}var Vs={readContext:Nn,use:kc,useCallback:Kt,useContext:Kt,useEffect:Kt,useImperativeHandle:Kt,useLayoutEffect:Kt,useInsertionEffect:Kt,useMemo:Kt,useReducer:Kt,useRef:Kt,useState:Kt,useDebugValue:Kt,useDeferredValue:Kt,useTransition:Kt,useSyncExternalStore:Kt,useId:Kt,useHostTransitionStatus:Kt,useFormState:Kt,useActionState:Kt,useOptimistic:Kt,useMemoCache:Kt,useCacheRefresh:Kt};Vs.useEffectEvent=Kt;var dx={readContext:Nn,use:kc,useCallback:function(t,n){return In().memoizedState=[t,n===void 0?null:n],t},useContext:Nn,useEffect:Qh,useImperativeHandle:function(t,n,s){s=s!=null?s.concat([t]):null,wc(4194308,4,Wh.bind(null,n,t),s)},useLayoutEffect:function(t,n){return wc(4194308,4,t,n)},useInsertionEffect:function(t,n){wc(4,2,t,n)},useMemo:function(t,n){var s=In();n=n===void 0?null:n;var c=t();if(Qa){de(!0);try{t()}finally{de(!1)}}return s.memoizedState=[c,n],c},useReducer:function(t,n,s){var c=In();if(s!==void 0){var m=s(n);if(Qa){de(!0);try{s(n)}finally{de(!1)}}}else m=n;return c.memoizedState=c.baseState=m,t={pending:null,lanes:0,dispatch:null,lastRenderedReducer:t,lastRenderedState:m},c.queue=t,t=t.dispatch=Fj.bind(null,ct,t),[c.memoizedState,t]},useRef:function(t){var n=In();return t={current:t},n.memoizedState=t},useState:function(t){t=nf(t);var n=t.queue,s=ox.bind(null,ct,n);return n.dispatch=s,[t.memoizedState,s]},useDebugValue:af,useDeferredValue:function(t,n){var s=In();return sf(s,t,n)},useTransition:function(){var t=nf(!1);return t=lx.bind(null,ct,t.queue,!0,!1),In().memoizedState=t,[!1,t]},useSyncExternalStore:function(t,n,s){var c=ct,m=In();if(xt){if(s===void 0)throw Error(i(407));s=s()}else{if(s=n(),Bt===null)throw Error(i(349));(jt&127)!==0||zh(c,n,s)}m.memoizedState=s;var x={value:s,getSnapshot:n};return m.queue=x,Qh(Lh.bind(null,c,x,t),[t]),c.flags|=2048,Li(9,{destroy:void 0},Oh.bind(null,c,x,s,n),null),s},useId:function(){var t=In(),n=Bt.identifierPrefix;if(xt){var s=sl,c=yl;s=(c&~(1<<32-ke(c)-1)).toString(32)+s,n="_"+n+"R_"+s,s=vc++,0<s&&(n+="H"+s.toString(32)),n+="_"}else s=Dj++,n="_"+n+"r_"+s.toString(32)+"_";return t.memoizedState=n},useHostTransitionStatus:cf,useFormState:qh,useActionState:qh,useOptimistic:function(t){var n=In();n.memoizedState=n.baseState=t;var s={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return n.queue=s,n=uf.bind(null,ct,!0,s),s.dispatch=n,[t,n]},useMemoCache:Jd,useCacheRefresh:function(){return In().memoizedState=Hj.bind(null,ct)},useEffectEvent:function(t){var n=In(),s={impl:t};return n.memoizedState=s,function(){if((At&2)!==0)throw Error(i(440));return s.impl.apply(void 0,arguments)}}},df={readContext:Nn,use:kc,useCallback:ex,useContext:Nn,useEffect:rf,useImperativeHandle:Jh,useInsertionEffect:Kh,useLayoutEffect:Zh,useMemo:tx,useReducer:Nc,useRef:Yh,useState:function(){return Nc(br)},useDebugValue:af,useDeferredValue:function(t,n){var s=en();return nx(s,Ot.memoizedState,t,n)},useTransition:function(){var t=Nc(br)[0],n=en().memoizedState;return[typeof t=="boolean"?t:Fs(t),n]},useSyncExternalStore:Mh,useId:ix,useHostTransitionStatus:cf,useFormState:Vh,useActionState:Vh,useOptimistic:function(t,n){var s=en();return Bh(s,Ot,t,n)},useMemoCache:Jd,useCacheRefresh:sx};df.useEffectEvent=Xh;var fx={readContext:Nn,use:kc,useCallback:ex,useContext:Nn,useEffect:rf,useImperativeHandle:Jh,useInsertionEffect:Kh,useLayoutEffect:Zh,useMemo:tx,useReducer:tf,useRef:Yh,useState:function(){return tf(br)},useDebugValue:af,useDeferredValue:function(t,n){var s=en();return Ot===null?sf(s,t,n):nx(s,Ot.memoizedState,t,n)},useTransition:function(){var t=tf(br)[0],n=en().memoizedState;return[typeof t=="boolean"?t:Fs(t),n]},useSyncExternalStore:Mh,useId:ix,useHostTransitionStatus:cf,useFormState:Gh,useActionState:Gh,useOptimistic:function(t,n){var s=en();return Ot!==null?Bh(s,Ot,t,n):(s.baseState=t,[t,s.queue.dispatch])},useMemoCache:Jd,useCacheRefresh:sx};fx.useEffectEvent=Xh;function ff(t,n,s,c){n=t.memoizedState,s=s(c,n),s=s==null?n:g({},n,s),t.memoizedState=s,t.lanes===0&&(t.updateQueue.baseState=s)}var mf={enqueueSetState:function(t,n,s){t=t._reactInternals;var c=ml(),m=Xr(c);m.payload=n,s!=null&&(m.callback=s),n=Kr(t,m,c),n!==null&&(Zn(n,t,c),Is(n,t,c))},enqueueReplaceState:function(t,n,s){t=t._reactInternals;var c=ml(),m=Xr(c);m.tag=1,m.payload=n,s!=null&&(m.callback=s),n=Kr(t,m,c),n!==null&&(Zn(n,t,c),Is(n,t,c))},enqueueForceUpdate:function(t,n){t=t._reactInternals;var s=ml(),c=Xr(s);c.tag=2,n!=null&&(c.callback=n),n=Kr(t,c,s),n!==null&&(Zn(n,t,s),Is(n,t,s))}};function mx(t,n,s,c,m,x,j){return t=t.stateNode,typeof t.shouldComponentUpdate=="function"?t.shouldComponentUpdate(c,x,j):n.prototype&&n.prototype.isPureReactComponent?!bi(s,c)||!bi(m,x):!0}function px(t,n,s,c){t=n.state,typeof n.componentWillReceiveProps=="function"&&n.componentWillReceiveProps(s,c),typeof n.UNSAFE_componentWillReceiveProps=="function"&&n.UNSAFE_componentWillReceiveProps(s,c),n.state!==t&&mf.enqueueReplaceState(n,n.state,null)}function Xa(t,n){var s=n;if("ref"in n){s={};for(var c in n)c!=="ref"&&(s[c]=n[c])}if(t=t.defaultProps){s===n&&(s=g({},s));for(var m in t)s[m]===void 0&&(s[m]=t[m])}return s}function hx(t){ki(t)}function xx(t){console.error(t)}function gx(t){ki(t)}function Tc(t,n){try{var s=t.onUncaughtError;s(n.value,{componentStack:n.stack})}catch(c){setTimeout(function(){throw c})}}function bx(t,n,s){try{var c=t.onCaughtError;c(s.value,{componentStack:s.stack,errorBoundary:n.tag===1?n.stateNode:null})}catch(m){setTimeout(function(){throw m})}}function pf(t,n,s){return s=Xr(s),s.tag=3,s.payload={element:null},s.callback=function(){Tc(t,n)},s}function yx(t){return t=Xr(t),t.tag=3,t}function vx(t,n,s,c){var m=s.type.getDerivedStateFromError;if(typeof m=="function"){var x=c.value;t.payload=function(){return m(x)},t.callback=function(){bx(n,s,c)}}var j=s.stateNode;j!==null&&typeof j.componentDidCatch=="function"&&(t.callback=function(){bx(n,s,c),typeof m!="function"&&(na===null?na=new Set([this]):na.add(this));var C=c.stack;this.componentDidCatch(c.value,{componentStack:C!==null?C:""})})}function qj(t,n,s,c,m){if(s.flags|=32768,c!==null&&typeof c=="object"&&typeof c.then=="function"){if(n=s.alternate,n!==null&&Ci(n,s,m,!0),s=cl.current,s!==null){switch(s.tag){case 31:case 13:return jl===null?Pc():s.alternate===null&&Zt===0&&(Zt=3),s.flags&=-257,s.flags|=65536,s.lanes=m,c===pc?s.flags|=16384:(n=s.updateQueue,n===null?s.updateQueue=new Set([c]):n.add(c),Pf(t,c,m)),!1;case 22:return s.flags|=65536,c===pc?s.flags|=16384:(n=s.updateQueue,n===null?(n={transitions:null,markerInstances:null,retryQueue:new Set([c])},s.updateQueue=n):(s=n.retryQueue,s===null?n.retryQueue=new Set([c]):s.add(c)),Pf(t,c,m)),!1}throw Error(i(435,s.tag))}return Pf(t,c,m),Pc(),!1}if(xt)return n=cl.current,n!==null?((n.flags&65536)===0&&(n.flags|=256),n.flags|=65536,n.lanes=m,c!==_&&(t=Error(i(422),{cause:c}),Gr($n(t,s)))):(c!==_&&(n=Error(i(423),{cause:c}),Gr($n(n,s))),t=t.current.alternate,t.flags|=65536,m&=-m,t.lanes|=m,c=$n(c,s),m=pf(t.stateNode,c,m),qd(t,m),Zt!==4&&(Zt=2)),!1;var x=Error(i(520),{cause:c});if(x=$n(x,s),Ws===null?Ws=[x]:Ws.push(x),Zt!==4&&(Zt=2),n===null)return!0;c=$n(c,s),s=n;do{switch(s.tag){case 3:return s.flags|=65536,t=m&-m,s.lanes|=t,t=pf(s.stateNode,c,t),qd(s,t),!1;case 1:if(n=s.type,x=s.stateNode,(s.flags&128)===0&&(typeof n.getDerivedStateFromError=="function"||x!==null&&typeof x.componentDidCatch=="function"&&(na===null||!na.has(x))))return s.flags|=65536,m&=-m,s.lanes|=m,m=yx(m),vx(m,t,s,c),qd(s,m),!1}s=s.return}while(s!==null);return!1}var hf=Error(i(461)),ln=!1;function wn(t,n,s,c){n.child=t===null?wh(n,null,s,c):Ya(n,t.child,s,c)}function jx(t,n,s,c,m){s=s.render;var x=n.ref;if("ref"in c){var j={};for(var C in c)C!=="ref"&&(j[C]=c[C])}else j=c;return qa(n),c=Xd(t,n,s,j,x,m),C=Kd(),t!==null&&!ln?(Zd(t,n,m),yr(t,n,m)):(xt&&C&&Si(n),n.flags|=1,wn(t,n,c,m),n.child)}function kx(t,n,s,c,m){if(t===null){var x=s.type;return typeof x=="function"&&!Pa(x)&&x.defaultProps===void 0&&s.compare===null?(n.tag=15,n.type=x,Nx(t,n,x,c,m)):(t=En(s.type,null,c,n,n.mode,m),t.ref=n.ref,t.return=n,n.child=t)}if(x=t.child,!Nf(t,m)){var j=x.memoizedProps;if(s=s.compare,s=s!==null?s:bi,s(j,c)&&t.ref===n.ref)return yr(t,n,m)}return n.flags|=1,t=Rl(x,c),t.ref=n.ref,t.return=n,n.child=t}function Nx(t,n,s,c,m){if(t!==null){var x=t.memoizedProps;if(bi(x,c)&&t.ref===n.ref)if(ln=!1,n.pendingProps=c=x,Nf(t,m))(t.flags&131072)!==0&&(ln=!0);else return n.lanes=t.lanes,yr(t,n,m)}return xf(t,n,s,c,m)}function wx(t,n,s,c){var m=c.children,x=t!==null?t.memoizedState:null;if(t===null&&n.stateNode===null&&(n.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),c.mode==="hidden"){if((n.flags&128)!==0){if(x=x!==null?x.baseLanes|s:s,t!==null){for(c=n.child=t.child,m=0;c!==null;)m=m|c.lanes|c.childLanes,c=c.sibling;c=m&~x}else c=0,n.child=null;return Sx(t,n,x,s,c)}if((s&536870912)!==0)n.memoizedState={baseLanes:0,cachePool:null},t!==null&&fc(n,x!==null?x.cachePool:null),x!==null?Th(n,x):$d(),Ah(n);else return c=n.lanes=536870912,Sx(t,n,x!==null?x.baseLanes|s:s,s,c)}else x!==null?(fc(n,x.cachePool),Th(n,x),Wr(),n.memoizedState=null):(t!==null&&fc(n,null),$d(),Wr());return wn(t,n,m,s),n.child}function $s(t,n){return t!==null&&t.tag===22||n.stateNode!==null||(n.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),n.sibling}function Sx(t,n,s,c,m){var x=Pd();return x=x===null?null:{parent:tn._currentValue,pool:x},n.memoizedState={baseLanes:s,cachePool:x},t!==null&&fc(n,null),$d(),Ah(n),t!==null&&Ci(t,n,c,!0),n.childLanes=m,null}function Ac(t,n){return n=Rc({mode:n.mode,children:n.children},t.mode),n.ref=t.ref,t.child=n,n.return=t,n}function Cx(t,n,s){return Ya(n,t.child,null,s),t=Ac(n,n.pendingProps),t.flags|=2,ul(n),n.memoizedState=null,t}function Vj(t,n,s){var c=n.pendingProps,m=(n.flags&128)!==0;if(n.flags&=-129,t===null){if(xt){if(c.mode==="hidden")return t=Ac(n,c),n.lanes=536870912,$s(null,t);if(Yd(n),(t=qe)?(t=Ig(t,kn),t=t!==null&&t.data==="&"?t:null,t!==null&&(n.memoizedState={dehydrated:t,treeContext:il!==null?{id:yl,overflow:sl}:null,retryLane:536870912,hydrationErrors:null},s=oc(t),s.return=n,n.child=s,un=n,qe=null)):t=null,t===null)throw Z(n);return n.lanes=536870912,null}return Ac(n,c)}var x=t.memoizedState;if(x!==null){var j=x.dehydrated;if(Yd(n),m)if(n.flags&256)n.flags&=-257,n=Cx(t,n,s);else if(n.memoizedState!==null)n.child=t.child,n.flags|=128,n=null;else throw Error(i(558));else if(ln||Ci(t,n,s,!1),m=(s&t.childLanes)!==0,ln||m){if(c=Bt,c!==null&&(j=er(c,s),j!==0&&j!==x.retryLane))throw x.retryLane=j,mr(t,j),Zn(c,t,j),hf;Pc(),n=Cx(t,n,s)}else t=x.treeContext,qe=kl(j.nextSibling),un=n,xt=!0,Yl=null,kn=!1,t!==null&&Os(n,t),n=Ac(n,c),n.flags|=4096;return n}return t=Rl(t.child,{mode:c.mode,children:c.children}),t.ref=n.ref,n.child=t,t.return=n,t}function Ec(t,n){var s=n.ref;if(s===null)t!==null&&t.ref!==null&&(n.flags|=4194816);else{if(typeof s!="function"&&typeof s!="object")throw Error(i(284));(t===null||t.ref!==s)&&(n.flags|=4194816)}}function xf(t,n,s,c,m){return qa(n),s=Xd(t,n,s,c,void 0,m),c=Kd(),t!==null&&!ln?(Zd(t,n,m),yr(t,n,m)):(xt&&c&&Si(n),n.flags|=1,wn(t,n,s,m),n.child)}function Tx(t,n,s,c,m,x){return qa(n),n.updateQueue=null,s=Rh(n,c,s,m),Eh(t),c=Kd(),t!==null&&!ln?(Zd(t,n,x),yr(t,n,x)):(xt&&c&&Si(n),n.flags|=1,wn(t,n,s,x),n.child)}function Ax(t,n,s,c,m){if(qa(n),n.stateNode===null){var x=Vr,j=s.contextType;typeof j=="object"&&j!==null&&(x=Nn(j)),x=new s(c,x),n.memoizedState=x.state!==null&&x.state!==void 0?x.state:null,x.updater=mf,n.stateNode=x,x._reactInternals=n,x=n.stateNode,x.props=c,x.state=n.memoizedState,x.refs={},Hd(n),j=s.contextType,x.context=typeof j=="object"&&j!==null?Nn(j):Vr,x.state=n.memoizedState,j=s.getDerivedStateFromProps,typeof j=="function"&&(ff(n,s,j,c),x.state=n.memoizedState),typeof s.getDerivedStateFromProps=="function"||typeof x.getSnapshotBeforeUpdate=="function"||typeof x.UNSAFE_componentWillMount!="function"&&typeof x.componentWillMount!="function"||(j=x.state,typeof x.componentWillMount=="function"&&x.componentWillMount(),typeof x.UNSAFE_componentWillMount=="function"&&x.UNSAFE_componentWillMount(),j!==x.state&&mf.enqueueReplaceState(x,x.state,null),Us(n,c,x,m),Ps(),x.state=n.memoizedState),typeof x.componentDidMount=="function"&&(n.flags|=4194308),c=!0}else if(t===null){x=n.stateNode;var C=n.memoizedProps,U=Xa(s,C);x.props=U;var te=x.context,fe=s.contextType;j=Vr,typeof fe=="object"&&fe!==null&&(j=Nn(fe));var xe=s.getDerivedStateFromProps;fe=typeof xe=="function"||typeof x.getSnapshotBeforeUpdate=="function",C=n.pendingProps!==C,fe||typeof x.UNSAFE_componentWillReceiveProps!="function"&&typeof x.componentWillReceiveProps!="function"||(C||te!==j)&&px(n,x,c,j),Qr=!1;var re=n.memoizedState;x.state=re,Us(n,c,x,m),Ps(),te=n.memoizedState,C||re!==te||Qr?(typeof xe=="function"&&(ff(n,s,xe,c),te=n.memoizedState),(U=Qr||mx(n,s,U,c,re,te,j))?(fe||typeof x.UNSAFE_componentWillMount!="function"&&typeof x.componentWillMount!="function"||(typeof x.componentWillMount=="function"&&x.componentWillMount(),typeof x.UNSAFE_componentWillMount=="function"&&x.UNSAFE_componentWillMount()),typeof x.componentDidMount=="function"&&(n.flags|=4194308)):(typeof x.componentDidMount=="function"&&(n.flags|=4194308),n.memoizedProps=c,n.memoizedState=te),x.props=c,x.state=te,x.context=j,c=U):(typeof x.componentDidMount=="function"&&(n.flags|=4194308),c=!1)}else{x=n.stateNode,Fd(t,n),j=n.memoizedProps,fe=Xa(s,j),x.props=fe,xe=n.pendingProps,re=x.context,te=s.contextType,U=Vr,typeof te=="object"&&te!==null&&(U=Nn(te)),C=s.getDerivedStateFromProps,(te=typeof C=="function"||typeof x.getSnapshotBeforeUpdate=="function")||typeof x.UNSAFE_componentWillReceiveProps!="function"&&typeof x.componentWillReceiveProps!="function"||(j!==xe||re!==U)&&px(n,x,c,U),Qr=!1,re=n.memoizedState,x.state=re,Us(n,c,x,m),Ps();var ie=n.memoizedState;j!==xe||re!==ie||Qr||t!==null&&t.dependencies!==null&&uc(t.dependencies)?(typeof C=="function"&&(ff(n,s,C,c),ie=n.memoizedState),(fe=Qr||mx(n,s,fe,c,re,ie,U)||t!==null&&t.dependencies!==null&&uc(t.dependencies))?(te||typeof x.UNSAFE_componentWillUpdate!="function"&&typeof x.componentWillUpdate!="function"||(typeof x.componentWillUpdate=="function"&&x.componentWillUpdate(c,ie,U),typeof x.UNSAFE_componentWillUpdate=="function"&&x.UNSAFE_componentWillUpdate(c,ie,U)),typeof x.componentDidUpdate=="function"&&(n.flags|=4),typeof x.getSnapshotBeforeUpdate=="function"&&(n.flags|=1024)):(typeof x.componentDidUpdate!="function"||j===t.memoizedProps&&re===t.memoizedState||(n.flags|=4),typeof x.getSnapshotBeforeUpdate!="function"||j===t.memoizedProps&&re===t.memoizedState||(n.flags|=1024),n.memoizedProps=c,n.memoizedState=ie),x.props=c,x.state=ie,x.context=U,c=fe):(typeof x.componentDidUpdate!="function"||j===t.memoizedProps&&re===t.memoizedState||(n.flags|=4),typeof x.getSnapshotBeforeUpdate!="function"||j===t.memoizedProps&&re===t.memoizedState||(n.flags|=1024),c=!1)}return x=c,Ec(t,n),c=(n.flags&128)!==0,x||c?(x=n.stateNode,s=c&&typeof s.getDerivedStateFromError!="function"?null:x.render(),n.flags|=1,t!==null&&c?(n.child=Ya(n,t.child,null,m),n.child=Ya(n,null,s,m)):wn(t,n,s,m),n.memoizedState=x.state,t=n.child):t=yr(t,n,m),t}function Ex(t,n,s,c){return vl(),n.flags|=256,wn(t,n,s,c),n.child}var gf={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function bf(t){return{baseLanes:t,cachePool:bh()}}function yf(t,n,s){return t=t!==null?t.childLanes&~s:0,n&&(t|=fl),t}function Rx(t,n,s){var c=n.pendingProps,m=!1,x=(n.flags&128)!==0,j;if((j=x)||(j=t!==null&&t.memoizedState===null?!1:(Jt.current&2)!==0),j&&(m=!0,n.flags&=-129),j=(n.flags&32)!==0,n.flags&=-33,t===null){if(xt){if(m?Zr(n):Wr(),(t=qe)?(t=Ig(t,kn),t=t!==null&&t.data!=="&"?t:null,t!==null&&(n.memoizedState={dehydrated:t,treeContext:il!==null?{id:yl,overflow:sl}:null,retryLane:536870912,hydrationErrors:null},s=oc(t),s.return=n,n.child=s,un=n,qe=null)):t=null,t===null)throw Z(n);return tm(t)?n.lanes=32:n.lanes=536870912,null}var C=c.children;return c=c.fallback,m?(Wr(),m=n.mode,C=Rc({mode:"hidden",children:C},m),c=Gl(c,m,s,null),C.return=n,c.return=n,C.sibling=c,n.child=C,c=n.child,c.memoizedState=bf(s),c.childLanes=yf(t,j,s),n.memoizedState=gf,$s(null,c)):(Zr(n),vf(n,C))}var U=t.memoizedState;if(U!==null&&(C=U.dehydrated,C!==null)){if(x)n.flags&256?(Zr(n),n.flags&=-257,n=jf(t,n,s)):n.memoizedState!==null?(Wr(),n.child=t.child,n.flags|=128,n=null):(Wr(),C=c.fallback,m=n.mode,c=Rc({mode:"visible",children:c.children},m),C=Gl(C,m,s,null),C.flags|=2,c.return=n,C.return=n,c.sibling=C,n.child=c,Ya(n,t.child,null,s),c=n.child,c.memoizedState=bf(s),c.childLanes=yf(t,j,s),n.memoizedState=gf,n=$s(null,c));else if(Zr(n),tm(C)){if(j=C.nextSibling&&C.nextSibling.dataset,j)var te=j.dgst;j=te,c=Error(i(419)),c.stack="",c.digest=j,Gr({value:c,source:null,stack:null}),n=jf(t,n,s)}else if(ln||Ci(t,n,s,!1),j=(s&t.childLanes)!==0,ln||j){if(j=Bt,j!==null&&(c=er(j,s),c!==0&&c!==U.retryLane))throw U.retryLane=c,mr(t,c),Zn(j,t,c),hf;em(C)||Pc(),n=jf(t,n,s)}else em(C)?(n.flags|=192,n.child=t.child,n=null):(t=U.treeContext,qe=kl(C.nextSibling),un=n,xt=!0,Yl=null,kn=!1,t!==null&&Os(n,t),n=vf(n,c.children),n.flags|=4096);return n}return m?(Wr(),C=c.fallback,m=n.mode,U=t.child,te=U.sibling,c=Rl(U,{mode:"hidden",children:c.children}),c.subtreeFlags=U.subtreeFlags&65011712,te!==null?C=Rl(te,C):(C=Gl(C,m,s,null),C.flags|=2),C.return=n,c.return=n,c.sibling=C,n.child=c,$s(null,c),c=n.child,C=t.child.memoizedState,C===null?C=bf(s):(m=C.cachePool,m!==null?(U=tn._currentValue,m=m.parent!==U?{parent:U,pool:U}:m):m=bh(),C={baseLanes:C.baseLanes|s,cachePool:m}),c.memoizedState=C,c.childLanes=yf(t,j,s),n.memoizedState=gf,$s(t.child,c)):(Zr(n),s=t.child,t=s.sibling,s=Rl(s,{mode:"visible",children:c.children}),s.return=n,s.sibling=null,t!==null&&(j=n.deletions,j===null?(n.deletions=[t],n.flags|=16):j.push(t)),n.child=s,n.memoizedState=null,s)}function vf(t,n){return n=Rc({mode:"visible",children:n},t.mode),n.return=t,t.child=n}function Rc(t,n){return t=_n(22,t,null,n),t.lanes=0,t}function jf(t,n,s){return Ya(n,t.child,null,s),t=vf(n,n.pendingProps.children),t.flags|=2,n.memoizedState=null,t}function Mx(t,n,s){t.lanes|=n;var c=t.alternate;c!==null&&(c.lanes|=n),Dd(t.return,n,s)}function kf(t,n,s,c,m,x){var j=t.memoizedState;j===null?t.memoizedState={isBackwards:n,rendering:null,renderingStartTime:0,last:c,tail:s,tailMode:m,treeForkCount:x}:(j.isBackwards=n,j.rendering=null,j.renderingStartTime=0,j.last=c,j.tail=s,j.tailMode=m,j.treeForkCount=x)}function zx(t,n,s){var c=n.pendingProps,m=c.revealOrder,x=c.tail;c=c.children;var j=Jt.current,C=(j&2)!==0;if(C?(j=j&1|2,n.flags|=128):j&=1,M(Jt,j),wn(t,n,c,s),c=xt?Ha:0,!C&&t!==null&&(t.flags&128)!==0)e:for(t=n.child;t!==null;){if(t.tag===13)t.memoizedState!==null&&Mx(t,s,n);else if(t.tag===19)Mx(t,s,n);else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===n)break e;for(;t.sibling===null;){if(t.return===null||t.return===n)break e;t=t.return}t.sibling.return=t.return,t=t.sibling}switch(m){case"forwards":for(s=n.child,m=null;s!==null;)t=s.alternate,t!==null&&bc(t)===null&&(m=s),s=s.sibling;s=m,s===null?(m=n.child,n.child=null):(m=s.sibling,s.sibling=null),kf(n,!1,m,s,x,c);break;case"backwards":case"unstable_legacy-backwards":for(s=null,m=n.child,n.child=null;m!==null;){if(t=m.alternate,t!==null&&bc(t)===null){n.child=m;break}t=m.sibling,m.sibling=s,s=m,m=t}kf(n,!0,s,null,x,c);break;case"together":kf(n,!1,null,null,void 0,c);break;default:n.memoizedState=null}return n.child}function yr(t,n,s){if(t!==null&&(n.dependencies=t.dependencies),ta|=n.lanes,(s&n.childLanes)===0)if(t!==null){if(Ci(t,n,s,!1),(s&n.childLanes)===0)return null}else return null;if(t!==null&&n.child!==t.child)throw Error(i(153));if(n.child!==null){for(t=n.child,s=Rl(t,t.pendingProps),n.child=s,s.return=n;t.sibling!==null;)t=t.sibling,s=s.sibling=Rl(t,t.pendingProps),s.return=n;s.sibling=null}return n.child}function Nf(t,n){return(t.lanes&n)!==0?!0:(t=t.dependencies,!!(t!==null&&uc(t)))}function $j(t,n,s){switch(n.tag){case 3:Se(n,n.stateNode.containerInfo),Yr(n,tn,t.memoizedState.cache),vl();break;case 27:case 5:Ve(n);break;case 4:Se(n,n.stateNode.containerInfo);break;case 10:Yr(n,n.type,n.memoizedProps.value);break;case 31:if(n.memoizedState!==null)return n.flags|=128,Yd(n),null;break;case 13:var c=n.memoizedState;if(c!==null)return c.dehydrated!==null?(Zr(n),n.flags|=128,null):(s&n.child.childLanes)!==0?Rx(t,n,s):(Zr(n),t=yr(t,n,s),t!==null?t.sibling:null);Zr(n);break;case 19:var m=(t.flags&128)!==0;if(c=(s&n.childLanes)!==0,c||(Ci(t,n,s,!1),c=(s&n.childLanes)!==0),m){if(c)return zx(t,n,s);n.flags|=128}if(m=n.memoizedState,m!==null&&(m.rendering=null,m.tail=null,m.lastEffect=null),M(Jt,Jt.current),c)break;return null;case 22:return n.lanes=0,wx(t,n,s,n.pendingProps);case 24:Yr(n,tn,t.memoizedState.cache)}return yr(t,n,s)}function Ox(t,n,s){if(t!==null)if(t.memoizedProps!==n.pendingProps)ln=!0;else{if(!Nf(t,s)&&(n.flags&128)===0)return ln=!1,$j(t,n,s);ln=(t.flags&131072)!==0}else ln=!1,xt&&(n.flags&1048576)!==0&&Ms(n,Ha,n.index);switch(n.lanes=0,n.tag){case 16:e:{var c=n.pendingProps;if(t=$a(n.elementType),n.type=t,typeof t=="function")Pa(t)?(c=Xa(t,c),n.tag=1,n=Ax(null,n,t,c,s)):(n.tag=0,n=xf(null,n,t,c,s));else{if(t!=null){var m=t.$$typeof;if(m===X){n.tag=11,n=jx(null,n,t,c,s);break e}else if(m===I){n.tag=14,n=kx(null,n,t,c,s);break e}}throw n=W(t)||t,Error(i(306,n,""))}}return n;case 0:return xf(t,n,n.type,n.pendingProps,s);case 1:return c=n.type,m=Xa(c,n.pendingProps),Ax(t,n,c,m,s);case 3:e:{if(Se(n,n.stateNode.containerInfo),t===null)throw Error(i(387));c=n.pendingProps;var x=n.memoizedState;m=x.element,Fd(t,n),Us(n,c,null,s);var j=n.memoizedState;if(c=j.cache,Yr(n,tn,c),c!==x.cache&&_d(n,[tn],s,!0),Ps(),c=j.element,x.isDehydrated)if(x={element:c,isDehydrated:!1,cache:j.cache},n.updateQueue.baseState=x,n.memoizedState=x,n.flags&256){n=Ex(t,n,c,s);break e}else if(c!==m){m=$n(Error(i(424)),n),Gr(m),n=Ex(t,n,c,s);break e}else for(t=n.stateNode.containerInfo,t.nodeType===9?t=t.body:t=t.nodeName==="HTML"?t.ownerDocument.body:t,qe=kl(t.firstChild),un=n,xt=!0,Yl=null,kn=!0,s=wh(n,null,c,s),n.child=s;s;)s.flags=s.flags&-3|4096,s=s.sibling;else{if(vl(),c===m){n=yr(t,n,s);break e}wn(t,n,c,s)}n=n.child}return n;case 26:return Ec(t,n),t===null?(s=Vg(n.type,null,n.pendingProps,null))?n.memoizedState=s:xt||(s=n.type,t=n.pendingProps,c=Gc(ce.current).createElement(s),c[Yt]=n,c[cn]=t,Sn(c,s,t),Ht(c),n.stateNode=c):n.memoizedState=Vg(n.type,t.memoizedProps,n.pendingProps,t.memoizedState),null;case 27:return Ve(n),t===null&&xt&&(c=n.stateNode=Hg(n.type,n.pendingProps,ce.current),un=n,kn=!0,m=qe,ia(n.type)?(nm=m,qe=kl(c.firstChild)):qe=m),wn(t,n,n.pendingProps.children,s),Ec(t,n),t===null&&(n.flags|=4194304),n.child;case 5:return t===null&&xt&&((m=c=qe)&&(c=jk(c,n.type,n.pendingProps,kn),c!==null?(n.stateNode=c,un=n,qe=kl(c.firstChild),kn=!1,m=!0):m=!1),m||Z(n)),Ve(n),m=n.type,x=n.pendingProps,j=t!==null?t.memoizedProps:null,c=x.children,Zf(m,x)?c=null:j!==null&&Zf(m,j)&&(n.flags|=32),n.memoizedState!==null&&(m=Xd(t,n,_j,null,null,s),io._currentValue=m),Ec(t,n),wn(t,n,c,s),n.child;case 6:return t===null&&xt&&((t=s=qe)&&(s=kk(s,n.pendingProps,kn),s!==null?(n.stateNode=s,un=n,qe=null,t=!0):t=!1),t||Z(n)),null;case 13:return Rx(t,n,s);case 4:return Se(n,n.stateNode.containerInfo),c=n.pendingProps,t===null?n.child=Ya(n,null,c,s):wn(t,n,c,s),n.child;case 11:return jx(t,n,n.type,n.pendingProps,s);case 7:return wn(t,n,n.pendingProps,s),n.child;case 8:return wn(t,n,n.pendingProps.children,s),n.child;case 12:return wn(t,n,n.pendingProps.children,s),n.child;case 10:return c=n.pendingProps,Yr(n,n.type,c.value),wn(t,n,c.children,s),n.child;case 9:return m=n.type._context,c=n.pendingProps.children,qa(n),m=Nn(m),c=c(m),n.flags|=1,wn(t,n,c,s),n.child;case 14:return kx(t,n,n.type,n.pendingProps,s);case 15:return Nx(t,n,n.type,n.pendingProps,s);case 19:return zx(t,n,s);case 31:return Vj(t,n,s);case 22:return wx(t,n,s,n.pendingProps);case 24:return qa(n),c=Nn(tn),t===null?(m=Pd(),m===null&&(m=Bt,x=Bd(),m.pooledCache=x,x.refCount++,x!==null&&(m.pooledCacheLanes|=s),m=x),n.memoizedState={parent:c,cache:m},Hd(n),Yr(n,tn,m)):((t.lanes&s)!==0&&(Fd(t,n),Us(n,null,null,s),Ps()),m=t.memoizedState,x=n.memoizedState,m.parent!==c?(m={parent:c,cache:c},n.memoizedState=m,n.lanes===0&&(n.memoizedState=n.updateQueue.baseState=m),Yr(n,tn,c)):(c=x.cache,Yr(n,tn,c),c!==m.cache&&_d(n,[tn],s,!0))),wn(t,n,n.pendingProps.children,s),n.child;case 29:throw n.pendingProps}throw Error(i(156,n.tag))}function vr(t){t.flags|=4}function wf(t,n,s,c,m){if((n=(t.mode&32)!==0)&&(n=!1),n){if(t.flags|=16777216,(m&335544128)===m)if(t.stateNode.complete)t.flags|=8192;else if(ig())t.flags|=8192;else throw Ga=pc,Ud}else t.flags&=-16777217}function Lx(t,n){if(n.type!=="stylesheet"||(n.state.loading&4)!==0)t.flags&=-16777217;else if(t.flags|=16777216,!Xg(n))if(ig())t.flags|=8192;else throw Ga=pc,Ud}function Mc(t,n){n!==null&&(t.flags|=4),t.flags&16384&&(n=t.tag!==22?Ee():536870912,t.lanes|=n,Ii|=n)}function Gs(t,n){if(!xt)switch(t.tailMode){case"hidden":n=t.tail;for(var s=null;n!==null;)n.alternate!==null&&(s=n),n=n.sibling;s===null?t.tail=null:s.sibling=null;break;case"collapsed":s=t.tail;for(var c=null;s!==null;)s.alternate!==null&&(c=s),s=s.sibling;c===null?n||t.tail===null?t.tail=null:t.tail.sibling=null:c.sibling=null}}function Ft(t){var n=t.alternate!==null&&t.alternate.child===t.child,s=0,c=0;if(n)for(var m=t.child;m!==null;)s|=m.lanes|m.childLanes,c|=m.subtreeFlags&65011712,c|=m.flags&65011712,m.return=t,m=m.sibling;else for(m=t.child;m!==null;)s|=m.lanes|m.childLanes,c|=m.subtreeFlags,c|=m.flags,m.return=t,m=m.sibling;return t.subtreeFlags|=c,t.childLanes=s,n}function Gj(t,n,s){var c=n.pendingProps;switch(zs(n),n.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Ft(n),null;case 1:return Ft(n),null;case 3:return s=n.stateNode,c=null,t!==null&&(c=t.memoizedState.cache),n.memoizedState.cache!==c&&(n.flags|=2048),xr(tn),Ne(),s.pendingContext&&(s.context=s.pendingContext,s.pendingContext=null),(t===null||t.child===null)&&(ol(n)?vr(n):t===null||t.memoizedState.isDehydrated&&(n.flags&256)===0||(n.flags|=1024,pr())),Ft(n),null;case 26:var m=n.type,x=n.memoizedState;return t===null?(vr(n),x!==null?(Ft(n),Lx(n,x)):(Ft(n),wf(n,m,null,c,s))):x?x!==t.memoizedState?(vr(n),Ft(n),Lx(n,x)):(Ft(n),n.flags&=-16777217):(t=t.memoizedProps,t!==c&&vr(n),Ft(n),wf(n,m,t,c,s)),null;case 27:if(_e(n),s=ce.current,m=n.type,t!==null&&n.stateNode!=null)t.memoizedProps!==c&&vr(n);else{if(!c){if(n.stateNode===null)throw Error(i(166));return Ft(n),null}t=pe.current,ol(n)?ye(n):(t=Hg(m,c,s),n.stateNode=t,vr(n))}return Ft(n),null;case 5:if(_e(n),m=n.type,t!==null&&n.stateNode!=null)t.memoizedProps!==c&&vr(n);else{if(!c){if(n.stateNode===null)throw Error(i(166));return Ft(n),null}if(x=pe.current,ol(n))ye(n);else{var j=Gc(ce.current);switch(x){case 1:x=j.createElementNS("http://www.w3.org/2000/svg",m);break;case 2:x=j.createElementNS("http://www.w3.org/1998/Math/MathML",m);break;default:switch(m){case"svg":x=j.createElementNS("http://www.w3.org/2000/svg",m);break;case"math":x=j.createElementNS("http://www.w3.org/1998/Math/MathML",m);break;case"script":x=j.createElement("div"),x.innerHTML="<script><\/script>",x=x.removeChild(x.firstChild);break;case"select":x=typeof c.is=="string"?j.createElement("select",{is:c.is}):j.createElement("select"),c.multiple?x.multiple=!0:c.size&&(x.size=c.size);break;default:x=typeof c.is=="string"?j.createElement(m,{is:c.is}):j.createElement(m)}}x[Yt]=n,x[cn]=c;e:for(j=n.child;j!==null;){if(j.tag===5||j.tag===6)x.appendChild(j.stateNode);else if(j.tag!==4&&j.tag!==27&&j.child!==null){j.child.return=j,j=j.child;continue}if(j===n)break e;for(;j.sibling===null;){if(j.return===null||j.return===n)break e;j=j.return}j.sibling.return=j.return,j=j.sibling}n.stateNode=x;e:switch(Sn(x,m,c),m){case"button":case"input":case"select":case"textarea":c=!!c.autoFocus;break e;case"img":c=!0;break e;default:c=!1}c&&vr(n)}}return Ft(n),wf(n,n.type,t===null?null:t.memoizedProps,n.pendingProps,s),null;case 6:if(t&&n.stateNode!=null)t.memoizedProps!==c&&vr(n);else{if(typeof c!="string"&&n.stateNode===null)throw Error(i(166));if(t=ce.current,ol(n)){if(t=n.stateNode,s=n.memoizedProps,c=null,m=un,m!==null)switch(m.tag){case 27:case 5:c=m.memoizedProps}t[Yt]=n,t=!!(t.nodeValue===s||c!==null&&c.suppressHydrationWarning===!0||Rg(t.nodeValue,s)),t||Z(n,!0)}else t=Gc(t).createTextNode(c),t[Yt]=n,n.stateNode=t}return Ft(n),null;case 31:if(s=n.memoizedState,t===null||t.memoizedState!==null){if(c=ol(n),s!==null){if(t===null){if(!c)throw Error(i(318));if(t=n.memoizedState,t=t!==null?t.dehydrated:null,!t)throw Error(i(557));t[Yt]=n}else vl(),(n.flags&128)===0&&(n.memoizedState=null),n.flags|=4;Ft(n),t=!1}else s=pr(),t!==null&&t.memoizedState!==null&&(t.memoizedState.hydrationErrors=s),t=!0;if(!t)return n.flags&256?(ul(n),n):(ul(n),null);if((n.flags&128)!==0)throw Error(i(558))}return Ft(n),null;case 13:if(c=n.memoizedState,t===null||t.memoizedState!==null&&t.memoizedState.dehydrated!==null){if(m=ol(n),c!==null&&c.dehydrated!==null){if(t===null){if(!m)throw Error(i(318));if(m=n.memoizedState,m=m!==null?m.dehydrated:null,!m)throw Error(i(317));m[Yt]=n}else vl(),(n.flags&128)===0&&(n.memoizedState=null),n.flags|=4;Ft(n),m=!1}else m=pr(),t!==null&&t.memoizedState!==null&&(t.memoizedState.hydrationErrors=m),m=!0;if(!m)return n.flags&256?(ul(n),n):(ul(n),null)}return ul(n),(n.flags&128)!==0?(n.lanes=s,n):(s=c!==null,t=t!==null&&t.memoizedState!==null,s&&(c=n.child,m=null,c.alternate!==null&&c.alternate.memoizedState!==null&&c.alternate.memoizedState.cachePool!==null&&(m=c.alternate.memoizedState.cachePool.pool),x=null,c.memoizedState!==null&&c.memoizedState.cachePool!==null&&(x=c.memoizedState.cachePool.pool),x!==m&&(c.flags|=2048)),s!==t&&s&&(n.child.flags|=8192),Mc(n,n.updateQueue),Ft(n),null);case 4:return Ne(),t===null&&Gf(n.stateNode.containerInfo),Ft(n),null;case 10:return xr(n.type),Ft(n),null;case 19:if(le(Jt),c=n.memoizedState,c===null)return Ft(n),null;if(m=(n.flags&128)!==0,x=c.rendering,x===null)if(m)Gs(c,!1);else{if(Zt!==0||t!==null&&(t.flags&128)!==0)for(t=n.child;t!==null;){if(x=bc(t),x!==null){for(n.flags|=128,Gs(c,!1),t=x.updateQueue,n.updateQueue=t,Mc(n,t),n.subtreeFlags=0,t=s,s=n.child;s!==null;)sc(s,t),s=s.sibling;return M(Jt,Jt.current&1|2),xt&&Ol(n,c.treeForkCount),n.child}t=t.sibling}c.tail!==null&&nt()>_c&&(n.flags|=128,m=!0,Gs(c,!1),n.lanes=4194304)}else{if(!m)if(t=bc(x),t!==null){if(n.flags|=128,m=!0,t=t.updateQueue,n.updateQueue=t,Mc(n,t),Gs(c,!0),c.tail===null&&c.tailMode==="hidden"&&!x.alternate&&!xt)return Ft(n),null}else 2*nt()-c.renderingStartTime>_c&&s!==536870912&&(n.flags|=128,m=!0,Gs(c,!1),n.lanes=4194304);c.isBackwards?(x.sibling=n.child,n.child=x):(t=c.last,t!==null?t.sibling=x:n.child=x,c.last=x)}return c.tail!==null?(t=c.tail,c.rendering=t,c.tail=t.sibling,c.renderingStartTime=nt(),t.sibling=null,s=Jt.current,M(Jt,m?s&1|2:s&1),xt&&Ol(n,c.treeForkCount),t):(Ft(n),null);case 22:case 23:return ul(n),Gd(),c=n.memoizedState!==null,t!==null?t.memoizedState!==null!==c&&(n.flags|=8192):c&&(n.flags|=8192),c?(s&536870912)!==0&&(n.flags&128)===0&&(Ft(n),n.subtreeFlags&6&&(n.flags|=8192)):Ft(n),s=n.updateQueue,s!==null&&Mc(n,s.retryQueue),s=null,t!==null&&t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(s=t.memoizedState.cachePool.pool),c=null,n.memoizedState!==null&&n.memoizedState.cachePool!==null&&(c=n.memoizedState.cachePool.pool),c!==s&&(n.flags|=2048),t!==null&&le(Va),null;case 24:return s=null,t!==null&&(s=t.memoizedState.cache),n.memoizedState.cache!==s&&(n.flags|=2048),xr(tn),Ft(n),null;case 25:return null;case 30:return null}throw Error(i(156,n.tag))}function Yj(t,n){switch(zs(n),n.tag){case 1:return t=n.flags,t&65536?(n.flags=t&-65537|128,n):null;case 3:return xr(tn),Ne(),t=n.flags,(t&65536)!==0&&(t&128)===0?(n.flags=t&-65537|128,n):null;case 26:case 27:case 5:return _e(n),null;case 31:if(n.memoizedState!==null){if(ul(n),n.alternate===null)throw Error(i(340));vl()}return t=n.flags,t&65536?(n.flags=t&-65537|128,n):null;case 13:if(ul(n),t=n.memoizedState,t!==null&&t.dehydrated!==null){if(n.alternate===null)throw Error(i(340));vl()}return t=n.flags,t&65536?(n.flags=t&-65537|128,n):null;case 19:return le(Jt),null;case 4:return Ne(),null;case 10:return xr(n.type),null;case 22:case 23:return ul(n),Gd(),t!==null&&le(Va),t=n.flags,t&65536?(n.flags=t&-65537|128,n):null;case 24:return xr(tn),null;case 25:return null;default:return null}}function Dx(t,n){switch(zs(n),n.tag){case 3:xr(tn),Ne();break;case 26:case 27:case 5:_e(n);break;case 4:Ne();break;case 31:n.memoizedState!==null&&ul(n);break;case 13:ul(n);break;case 19:le(Jt);break;case 10:xr(n.type);break;case 22:case 23:ul(n),Gd(),t!==null&&le(Va);break;case 24:xr(tn)}}function Ys(t,n){try{var s=n.updateQueue,c=s!==null?s.lastEffect:null;if(c!==null){var m=c.next;s=m;do{if((s.tag&t)===t){c=void 0;var x=s.create,j=s.inst;c=x(),j.destroy=c}s=s.next}while(s!==m)}}catch(C){Mt(n,n.return,C)}}function Jr(t,n,s){try{var c=n.updateQueue,m=c!==null?c.lastEffect:null;if(m!==null){var x=m.next;c=x;do{if((c.tag&t)===t){var j=c.inst,C=j.destroy;if(C!==void 0){j.destroy=void 0,m=n;var U=s,te=C;try{te()}catch(fe){Mt(m,U,fe)}}}c=c.next}while(c!==x)}}catch(fe){Mt(n,n.return,fe)}}function _x(t){var n=t.updateQueue;if(n!==null){var s=t.stateNode;try{Ch(n,s)}catch(c){Mt(t,t.return,c)}}}function Bx(t,n,s){s.props=Xa(t.type,t.memoizedProps),s.state=t.memoizedState;try{s.componentWillUnmount()}catch(c){Mt(t,n,c)}}function Qs(t,n){try{var s=t.ref;if(s!==null){switch(t.tag){case 26:case 27:case 5:var c=t.stateNode;break;case 30:c=t.stateNode;break;default:c=t.stateNode}typeof s=="function"?t.refCleanup=s(c):s.current=c}}catch(m){Mt(t,n,m)}}function Ql(t,n){var s=t.ref,c=t.refCleanup;if(s!==null)if(typeof c=="function")try{c()}catch(m){Mt(t,n,m)}finally{t.refCleanup=null,t=t.alternate,t!=null&&(t.refCleanup=null)}else if(typeof s=="function")try{s(null)}catch(m){Mt(t,n,m)}else s.current=null}function Ix(t){var n=t.type,s=t.memoizedProps,c=t.stateNode;try{e:switch(n){case"button":case"input":case"select":case"textarea":s.autoFocus&&c.focus();break e;case"img":s.src?c.src=s.src:s.srcSet&&(c.srcset=s.srcSet)}}catch(m){Mt(t,t.return,m)}}function Sf(t,n,s){try{var c=t.stateNode;hk(c,t.type,s,n),c[cn]=n}catch(m){Mt(t,t.return,m)}}function Px(t){return t.tag===5||t.tag===3||t.tag===26||t.tag===27&&ia(t.type)||t.tag===4}function Cf(t){e:for(;;){for(;t.sibling===null;){if(t.return===null||Px(t.return))return null;t=t.return}for(t.sibling.return=t.return,t=t.sibling;t.tag!==5&&t.tag!==6&&t.tag!==18;){if(t.tag===27&&ia(t.type)||t.flags&2||t.child===null||t.tag===4)continue e;t.child.return=t,t=t.child}if(!(t.flags&2))return t.stateNode}}function Tf(t,n,s){var c=t.tag;if(c===5||c===6)t=t.stateNode,n?(s.nodeType===9?s.body:s.nodeName==="HTML"?s.ownerDocument.body:s).insertBefore(t,n):(n=s.nodeType===9?s.body:s.nodeName==="HTML"?s.ownerDocument.body:s,n.appendChild(t),s=s._reactRootContainer,s!=null||n.onclick!==null||(n.onclick=Al));else if(c!==4&&(c===27&&ia(t.type)&&(s=t.stateNode,n=null),t=t.child,t!==null))for(Tf(t,n,s),t=t.sibling;t!==null;)Tf(t,n,s),t=t.sibling}function zc(t,n,s){var c=t.tag;if(c===5||c===6)t=t.stateNode,n?s.insertBefore(t,n):s.appendChild(t);else if(c!==4&&(c===27&&ia(t.type)&&(s=t.stateNode),t=t.child,t!==null))for(zc(t,n,s),t=t.sibling;t!==null;)zc(t,n,s),t=t.sibling}function Ux(t){var n=t.stateNode,s=t.memoizedProps;try{for(var c=t.type,m=n.attributes;m.length;)n.removeAttributeNode(m[0]);Sn(n,c,s),n[Yt]=t,n[cn]=s}catch(x){Mt(t,t.return,x)}}var jr=!1,rn=!1,Af=!1,Hx=typeof WeakSet=="function"?WeakSet:Set,hn=null;function Qj(t,n){if(t=t.containerInfo,Xf=Jc,t=Ts(t),vi(t)){if("selectionStart"in t)var s={start:t.selectionStart,end:t.selectionEnd};else e:{s=(s=t.ownerDocument)&&s.defaultView||window;var c=s.getSelection&&s.getSelection();if(c&&c.rangeCount!==0){s=c.anchorNode;var m=c.anchorOffset,x=c.focusNode;c=c.focusOffset;try{s.nodeType,x.nodeType}catch{s=null;break e}var j=0,C=-1,U=-1,te=0,fe=0,xe=t,re=null;t:for(;;){for(var ie;xe!==s||m!==0&&xe.nodeType!==3||(C=j+m),xe!==x||c!==0&&xe.nodeType!==3||(U=j+c),xe.nodeType===3&&(j+=xe.nodeValue.length),(ie=xe.firstChild)!==null;)re=xe,xe=ie;for(;;){if(xe===t)break t;if(re===s&&++te===m&&(C=j),re===x&&++fe===c&&(U=j),(ie=xe.nextSibling)!==null)break;xe=re,re=xe.parentNode}xe=ie}s=C===-1||U===-1?null:{start:C,end:U}}else s=null}s=s||{start:0,end:0}}else s=null;for(Kf={focusedElem:t,selectionRange:s},Jc=!1,hn=n;hn!==null;)if(n=hn,t=n.child,(n.subtreeFlags&1028)!==0&&t!==null)t.return=n,hn=t;else for(;hn!==null;){switch(n=hn,x=n.alternate,t=n.flags,n.tag){case 0:if((t&4)!==0&&(t=n.updateQueue,t=t!==null?t.events:null,t!==null))for(s=0;s<t.length;s++)m=t[s],m.ref.impl=m.nextImpl;break;case 11:case 15:break;case 1:if((t&1024)!==0&&x!==null){t=void 0,s=n,m=x.memoizedProps,x=x.memoizedState,c=s.stateNode;try{var De=Xa(s.type,m);t=c.getSnapshotBeforeUpdate(De,x),c.__reactInternalSnapshotBeforeUpdate=t}catch(Ze){Mt(s,s.return,Ze)}}break;case 3:if((t&1024)!==0){if(t=n.stateNode.containerInfo,s=t.nodeType,s===9)Jf(t);else if(s===1)switch(t.nodeName){case"HEAD":case"HTML":case"BODY":Jf(t);break;default:t.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if((t&1024)!==0)throw Error(i(163))}if(t=n.sibling,t!==null){t.return=n.return,hn=t;break}hn=n.return}}function Fx(t,n,s){var c=s.flags;switch(s.tag){case 0:case 11:case 15:Nr(t,s),c&4&&Ys(5,s);break;case 1:if(Nr(t,s),c&4)if(t=s.stateNode,n===null)try{t.componentDidMount()}catch(j){Mt(s,s.return,j)}else{var m=Xa(s.type,n.memoizedProps);n=n.memoizedState;try{t.componentDidUpdate(m,n,t.__reactInternalSnapshotBeforeUpdate)}catch(j){Mt(s,s.return,j)}}c&64&&_x(s),c&512&&Qs(s,s.return);break;case 3:if(Nr(t,s),c&64&&(t=s.updateQueue,t!==null)){if(n=null,s.child!==null)switch(s.child.tag){case 27:case 5:n=s.child.stateNode;break;case 1:n=s.child.stateNode}try{Ch(t,n)}catch(j){Mt(s,s.return,j)}}break;case 27:n===null&&c&4&&Ux(s);case 26:case 5:Nr(t,s),n===null&&c&4&&Ix(s),c&512&&Qs(s,s.return);break;case 12:Nr(t,s);break;case 31:Nr(t,s),c&4&&$x(t,s);break;case 13:Nr(t,s),c&4&&Gx(t,s),c&64&&(t=s.memoizedState,t!==null&&(t=t.dehydrated,t!==null&&(s=lk.bind(null,s),Nk(t,s))));break;case 22:if(c=s.memoizedState!==null||jr,!c){n=n!==null&&n.memoizedState!==null||rn,m=jr;var x=rn;jr=c,(rn=n)&&!x?wr(t,s,(s.subtreeFlags&8772)!==0):Nr(t,s),jr=m,rn=x}break;case 30:break;default:Nr(t,s)}}function qx(t){var n=t.alternate;n!==null&&(t.alternate=null,qx(n)),t.child=null,t.deletions=null,t.sibling=null,t.tag===5&&(n=t.stateNode,n!==null&&Hl(n)),t.stateNode=null,t.return=null,t.dependencies=null,t.memoizedProps=null,t.memoizedState=null,t.pendingProps=null,t.stateNode=null,t.updateQueue=null}var Gt=null,Yn=!1;function kr(t,n,s){for(s=s.child;s!==null;)Vx(t,n,s),s=s.sibling}function Vx(t,n,s){if(q&&typeof q.onCommitFiberUnmount=="function")try{q.onCommitFiberUnmount(Te,s)}catch{}switch(s.tag){case 26:rn||Ql(s,n),kr(t,n,s),s.memoizedState?s.memoizedState.count--:s.stateNode&&(s=s.stateNode,s.parentNode.removeChild(s));break;case 27:rn||Ql(s,n);var c=Gt,m=Yn;ia(s.type)&&(Gt=s.stateNode,Yn=!1),kr(t,n,s),lo(s.stateNode),Gt=c,Yn=m;break;case 5:rn||Ql(s,n);case 6:if(c=Gt,m=Yn,Gt=null,kr(t,n,s),Gt=c,Yn=m,Gt!==null)if(Yn)try{(Gt.nodeType===9?Gt.body:Gt.nodeName==="HTML"?Gt.ownerDocument.body:Gt).removeChild(s.stateNode)}catch(x){Mt(s,n,x)}else try{Gt.removeChild(s.stateNode)}catch(x){Mt(s,n,x)}break;case 18:Gt!==null&&(Yn?(t=Gt,_g(t.nodeType===9?t.body:t.nodeName==="HTML"?t.ownerDocument.body:t,s.stateNode),Gi(t)):_g(Gt,s.stateNode));break;case 4:c=Gt,m=Yn,Gt=s.stateNode.containerInfo,Yn=!0,kr(t,n,s),Gt=c,Yn=m;break;case 0:case 11:case 14:case 15:Jr(2,s,n),rn||Jr(4,s,n),kr(t,n,s);break;case 1:rn||(Ql(s,n),c=s.stateNode,typeof c.componentWillUnmount=="function"&&Bx(s,n,c)),kr(t,n,s);break;case 21:kr(t,n,s);break;case 22:rn=(c=rn)||s.memoizedState!==null,kr(t,n,s),rn=c;break;default:kr(t,n,s)}}function $x(t,n){if(n.memoizedState===null&&(t=n.alternate,t!==null&&(t=t.memoizedState,t!==null))){t=t.dehydrated;try{Gi(t)}catch(s){Mt(n,n.return,s)}}}function Gx(t,n){if(n.memoizedState===null&&(t=n.alternate,t!==null&&(t=t.memoizedState,t!==null&&(t=t.dehydrated,t!==null))))try{Gi(t)}catch(s){Mt(n,n.return,s)}}function Xj(t){switch(t.tag){case 31:case 13:case 19:var n=t.stateNode;return n===null&&(n=t.stateNode=new Hx),n;case 22:return t=t.stateNode,n=t._retryCache,n===null&&(n=t._retryCache=new Hx),n;default:throw Error(i(435,t.tag))}}function Oc(t,n){var s=Xj(t);n.forEach(function(c){if(!s.has(c)){s.add(c);var m=rk.bind(null,t,c);c.then(m,m)}})}function Qn(t,n){var s=n.deletions;if(s!==null)for(var c=0;c<s.length;c++){var m=s[c],x=t,j=n,C=j;e:for(;C!==null;){switch(C.tag){case 27:if(ia(C.type)){Gt=C.stateNode,Yn=!1;break e}break;case 5:Gt=C.stateNode,Yn=!1;break e;case 3:case 4:Gt=C.stateNode.containerInfo,Yn=!0;break e}C=C.return}if(Gt===null)throw Error(i(160));Vx(x,j,m),Gt=null,Yn=!1,x=m.alternate,x!==null&&(x.return=null),m.return=null}if(n.subtreeFlags&13886)for(n=n.child;n!==null;)Yx(n,t),n=n.sibling}var Ll=null;function Yx(t,n){var s=t.alternate,c=t.flags;switch(t.tag){case 0:case 11:case 14:case 15:Qn(n,t),Xn(t),c&4&&(Jr(3,t,t.return),Ys(3,t),Jr(5,t,t.return));break;case 1:Qn(n,t),Xn(t),c&512&&(rn||s===null||Ql(s,s.return)),c&64&&jr&&(t=t.updateQueue,t!==null&&(c=t.callbacks,c!==null&&(s=t.shared.hiddenCallbacks,t.shared.hiddenCallbacks=s===null?c:s.concat(c))));break;case 26:var m=Ll;if(Qn(n,t),Xn(t),c&512&&(rn||s===null||Ql(s,s.return)),c&4){var x=s!==null?s.memoizedState:null;if(c=t.memoizedState,s===null)if(c===null)if(t.stateNode===null){e:{c=t.type,s=t.memoizedProps,m=m.ownerDocument||m;t:switch(c){case"title":x=m.getElementsByTagName("title")[0],(!x||x[el]||x[Yt]||x.namespaceURI==="http://www.w3.org/2000/svg"||x.hasAttribute("itemprop"))&&(x=m.createElement(c),m.head.insertBefore(x,m.querySelector("head > title"))),Sn(x,c,s),x[Yt]=t,Ht(x),c=x;break e;case"link":var j=Yg("link","href",m).get(c+(s.href||""));if(j){for(var C=0;C<j.length;C++)if(x=j[C],x.getAttribute("href")===(s.href==null||s.href===""?null:s.href)&&x.getAttribute("rel")===(s.rel==null?null:s.rel)&&x.getAttribute("title")===(s.title==null?null:s.title)&&x.getAttribute("crossorigin")===(s.crossOrigin==null?null:s.crossOrigin)){j.splice(C,1);break t}}x=m.createElement(c),Sn(x,c,s),m.head.appendChild(x);break;case"meta":if(j=Yg("meta","content",m).get(c+(s.content||""))){for(C=0;C<j.length;C++)if(x=j[C],x.getAttribute("content")===(s.content==null?null:""+s.content)&&x.getAttribute("name")===(s.name==null?null:s.name)&&x.getAttribute("property")===(s.property==null?null:s.property)&&x.getAttribute("http-equiv")===(s.httpEquiv==null?null:s.httpEquiv)&&x.getAttribute("charset")===(s.charSet==null?null:s.charSet)){j.splice(C,1);break t}}x=m.createElement(c),Sn(x,c,s),m.head.appendChild(x);break;default:throw Error(i(468,c))}x[Yt]=t,Ht(x),c=x}t.stateNode=c}else Qg(m,t.type,t.stateNode);else t.stateNode=Gg(m,c,t.memoizedProps);else x!==c?(x===null?s.stateNode!==null&&(s=s.stateNode,s.parentNode.removeChild(s)):x.count--,c===null?Qg(m,t.type,t.stateNode):Gg(m,c,t.memoizedProps)):c===null&&t.stateNode!==null&&Sf(t,t.memoizedProps,s.memoizedProps)}break;case 27:Qn(n,t),Xn(t),c&512&&(rn||s===null||Ql(s,s.return)),s!==null&&c&4&&Sf(t,t.memoizedProps,s.memoizedProps);break;case 5:if(Qn(n,t),Xn(t),c&512&&(rn||s===null||Ql(s,s.return)),t.flags&32){m=t.stateNode;try{lr(m,"")}catch(De){Mt(t,t.return,De)}}c&4&&t.stateNode!=null&&(m=t.memoizedProps,Sf(t,m,s!==null?s.memoizedProps:m)),c&1024&&(Af=!0);break;case 6:if(Qn(n,t),Xn(t),c&4){if(t.stateNode===null)throw Error(i(162));c=t.memoizedProps,s=t.stateNode;try{s.nodeValue=c}catch(De){Mt(t,t.return,De)}}break;case 3:if(Xc=null,m=Ll,Ll=Yc(n.containerInfo),Qn(n,t),Ll=m,Xn(t),c&4&&s!==null&&s.memoizedState.isDehydrated)try{Gi(n.containerInfo)}catch(De){Mt(t,t.return,De)}Af&&(Af=!1,Qx(t));break;case 4:c=Ll,Ll=Yc(t.stateNode.containerInfo),Qn(n,t),Xn(t),Ll=c;break;case 12:Qn(n,t),Xn(t);break;case 31:Qn(n,t),Xn(t),c&4&&(c=t.updateQueue,c!==null&&(t.updateQueue=null,Oc(t,c)));break;case 13:Qn(n,t),Xn(t),t.child.flags&8192&&t.memoizedState!==null!=(s!==null&&s.memoizedState!==null)&&(Dc=nt()),c&4&&(c=t.updateQueue,c!==null&&(t.updateQueue=null,Oc(t,c)));break;case 22:m=t.memoizedState!==null;var U=s!==null&&s.memoizedState!==null,te=jr,fe=rn;if(jr=te||m,rn=fe||U,Qn(n,t),rn=fe,jr=te,Xn(t),c&8192)e:for(n=t.stateNode,n._visibility=m?n._visibility&-2:n._visibility|1,m&&(s===null||U||jr||rn||Ka(t)),s=null,n=t;;){if(n.tag===5||n.tag===26){if(s===null){U=s=n;try{if(x=U.stateNode,m)j=x.style,typeof j.setProperty=="function"?j.setProperty("display","none","important"):j.display="none";else{C=U.stateNode;var xe=U.memoizedProps.style,re=xe!=null&&xe.hasOwnProperty("display")?xe.display:null;C.style.display=re==null||typeof re=="boolean"?"":(""+re).trim()}}catch(De){Mt(U,U.return,De)}}}else if(n.tag===6){if(s===null){U=n;try{U.stateNode.nodeValue=m?"":U.memoizedProps}catch(De){Mt(U,U.return,De)}}}else if(n.tag===18){if(s===null){U=n;try{var ie=U.stateNode;m?Bg(ie,!0):Bg(U.stateNode,!1)}catch(De){Mt(U,U.return,De)}}}else if((n.tag!==22&&n.tag!==23||n.memoizedState===null||n===t)&&n.child!==null){n.child.return=n,n=n.child;continue}if(n===t)break e;for(;n.sibling===null;){if(n.return===null||n.return===t)break e;s===n&&(s=null),n=n.return}s===n&&(s=null),n.sibling.return=n.return,n=n.sibling}c&4&&(c=t.updateQueue,c!==null&&(s=c.retryQueue,s!==null&&(c.retryQueue=null,Oc(t,s))));break;case 19:Qn(n,t),Xn(t),c&4&&(c=t.updateQueue,c!==null&&(t.updateQueue=null,Oc(t,c)));break;case 30:break;case 21:break;default:Qn(n,t),Xn(t)}}function Xn(t){var n=t.flags;if(n&2){try{for(var s,c=t.return;c!==null;){if(Px(c)){s=c;break}c=c.return}if(s==null)throw Error(i(160));switch(s.tag){case 27:var m=s.stateNode,x=Cf(t);zc(t,x,m);break;case 5:var j=s.stateNode;s.flags&32&&(lr(j,""),s.flags&=-33);var C=Cf(t);zc(t,C,j);break;case 3:case 4:var U=s.stateNode.containerInfo,te=Cf(t);Tf(t,te,U);break;default:throw Error(i(161))}}catch(fe){Mt(t,t.return,fe)}t.flags&=-3}n&4096&&(t.flags&=-4097)}function Qx(t){if(t.subtreeFlags&1024)for(t=t.child;t!==null;){var n=t;Qx(n),n.tag===5&&n.flags&1024&&n.stateNode.reset(),t=t.sibling}}function Nr(t,n){if(n.subtreeFlags&8772)for(n=n.child;n!==null;)Fx(t,n.alternate,n),n=n.sibling}function Ka(t){for(t=t.child;t!==null;){var n=t;switch(n.tag){case 0:case 11:case 14:case 15:Jr(4,n,n.return),Ka(n);break;case 1:Ql(n,n.return);var s=n.stateNode;typeof s.componentWillUnmount=="function"&&Bx(n,n.return,s),Ka(n);break;case 27:lo(n.stateNode);case 26:case 5:Ql(n,n.return),Ka(n);break;case 22:n.memoizedState===null&&Ka(n);break;case 30:Ka(n);break;default:Ka(n)}t=t.sibling}}function wr(t,n,s){for(s=s&&(n.subtreeFlags&8772)!==0,n=n.child;n!==null;){var c=n.alternate,m=t,x=n,j=x.flags;switch(x.tag){case 0:case 11:case 15:wr(m,x,s),Ys(4,x);break;case 1:if(wr(m,x,s),c=x,m=c.stateNode,typeof m.componentDidMount=="function")try{m.componentDidMount()}catch(te){Mt(c,c.return,te)}if(c=x,m=c.updateQueue,m!==null){var C=c.stateNode;try{var U=m.shared.hiddenCallbacks;if(U!==null)for(m.shared.hiddenCallbacks=null,m=0;m<U.length;m++)Sh(U[m],C)}catch(te){Mt(c,c.return,te)}}s&&j&64&&_x(x),Qs(x,x.return);break;case 27:Ux(x);case 26:case 5:wr(m,x,s),s&&c===null&&j&4&&Ix(x),Qs(x,x.return);break;case 12:wr(m,x,s);break;case 31:wr(m,x,s),s&&j&4&&$x(m,x);break;case 13:wr(m,x,s),s&&j&4&&Gx(m,x);break;case 22:x.memoizedState===null&&wr(m,x,s),Qs(x,x.return);break;case 30:break;default:wr(m,x,s)}n=n.sibling}}function Ef(t,n){var s=null;t!==null&&t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(s=t.memoizedState.cachePool.pool),t=null,n.memoizedState!==null&&n.memoizedState.cachePool!==null&&(t=n.memoizedState.cachePool.pool),t!==s&&(t!=null&&t.refCount++,s!=null&&Ls(s))}function Rf(t,n){t=null,n.alternate!==null&&(t=n.alternate.memoizedState.cache),n=n.memoizedState.cache,n!==t&&(n.refCount++,t!=null&&Ls(t))}function Dl(t,n,s,c){if(n.subtreeFlags&10256)for(n=n.child;n!==null;)Xx(t,n,s,c),n=n.sibling}function Xx(t,n,s,c){var m=n.flags;switch(n.tag){case 0:case 11:case 15:Dl(t,n,s,c),m&2048&&Ys(9,n);break;case 1:Dl(t,n,s,c);break;case 3:Dl(t,n,s,c),m&2048&&(t=null,n.alternate!==null&&(t=n.alternate.memoizedState.cache),n=n.memoizedState.cache,n!==t&&(n.refCount++,t!=null&&Ls(t)));break;case 12:if(m&2048){Dl(t,n,s,c),t=n.stateNode;try{var x=n.memoizedProps,j=x.id,C=x.onPostCommit;typeof C=="function"&&C(j,n.alternate===null?"mount":"update",t.passiveEffectDuration,-0)}catch(U){Mt(n,n.return,U)}}else Dl(t,n,s,c);break;case 31:Dl(t,n,s,c);break;case 13:Dl(t,n,s,c);break;case 23:break;case 22:x=n.stateNode,j=n.alternate,n.memoizedState!==null?x._visibility&2?Dl(t,n,s,c):Xs(t,n):x._visibility&2?Dl(t,n,s,c):(x._visibility|=2,Di(t,n,s,c,(n.subtreeFlags&10256)!==0||!1)),m&2048&&Ef(j,n);break;case 24:Dl(t,n,s,c),m&2048&&Rf(n.alternate,n);break;default:Dl(t,n,s,c)}}function Di(t,n,s,c,m){for(m=m&&((n.subtreeFlags&10256)!==0||!1),n=n.child;n!==null;){var x=t,j=n,C=s,U=c,te=j.flags;switch(j.tag){case 0:case 11:case 15:Di(x,j,C,U,m),Ys(8,j);break;case 23:break;case 22:var fe=j.stateNode;j.memoizedState!==null?fe._visibility&2?Di(x,j,C,U,m):Xs(x,j):(fe._visibility|=2,Di(x,j,C,U,m)),m&&te&2048&&Ef(j.alternate,j);break;case 24:Di(x,j,C,U,m),m&&te&2048&&Rf(j.alternate,j);break;default:Di(x,j,C,U,m)}n=n.sibling}}function Xs(t,n){if(n.subtreeFlags&10256)for(n=n.child;n!==null;){var s=t,c=n,m=c.flags;switch(c.tag){case 22:Xs(s,c),m&2048&&Ef(c.alternate,c);break;case 24:Xs(s,c),m&2048&&Rf(c.alternate,c);break;default:Xs(s,c)}n=n.sibling}}var Ks=8192;function _i(t,n,s){if(t.subtreeFlags&Ks)for(t=t.child;t!==null;)Kx(t,n,s),t=t.sibling}function Kx(t,n,s){switch(t.tag){case 26:_i(t,n,s),t.flags&Ks&&t.memoizedState!==null&&Dk(s,Ll,t.memoizedState,t.memoizedProps);break;case 5:_i(t,n,s);break;case 3:case 4:var c=Ll;Ll=Yc(t.stateNode.containerInfo),_i(t,n,s),Ll=c;break;case 22:t.memoizedState===null&&(c=t.alternate,c!==null&&c.memoizedState!==null?(c=Ks,Ks=16777216,_i(t,n,s),Ks=c):_i(t,n,s));break;default:_i(t,n,s)}}function Zx(t){var n=t.alternate;if(n!==null&&(t=n.child,t!==null)){n.child=null;do n=t.sibling,t.sibling=null,t=n;while(t!==null)}}function Zs(t){var n=t.deletions;if((t.flags&16)!==0){if(n!==null)for(var s=0;s<n.length;s++){var c=n[s];hn=c,Jx(c,t)}Zx(t)}if(t.subtreeFlags&10256)for(t=t.child;t!==null;)Wx(t),t=t.sibling}function Wx(t){switch(t.tag){case 0:case 11:case 15:Zs(t),t.flags&2048&&Jr(9,t,t.return);break;case 3:Zs(t);break;case 12:Zs(t);break;case 22:var n=t.stateNode;t.memoizedState!==null&&n._visibility&2&&(t.return===null||t.return.tag!==13)?(n._visibility&=-3,Lc(t)):Zs(t);break;default:Zs(t)}}function Lc(t){var n=t.deletions;if((t.flags&16)!==0){if(n!==null)for(var s=0;s<n.length;s++){var c=n[s];hn=c,Jx(c,t)}Zx(t)}for(t=t.child;t!==null;){switch(n=t,n.tag){case 0:case 11:case 15:Jr(8,n,n.return),Lc(n);break;case 22:s=n.stateNode,s._visibility&2&&(s._visibility&=-3,Lc(n));break;default:Lc(n)}t=t.sibling}}function Jx(t,n){for(;hn!==null;){var s=hn;switch(s.tag){case 0:case 11:case 15:Jr(8,s,n);break;case 23:case 22:if(s.memoizedState!==null&&s.memoizedState.cachePool!==null){var c=s.memoizedState.cachePool.pool;c!=null&&c.refCount++}break;case 24:Ls(s.memoizedState.cache)}if(c=s.child,c!==null)c.return=s,hn=c;else e:for(s=t;hn!==null;){c=hn;var m=c.sibling,x=c.return;if(qx(c),c===s){hn=null;break e}if(m!==null){m.return=x,hn=m;break e}hn=x}}}var Kj={getCacheForType:function(t){var n=Nn(tn),s=n.data.get(t);return s===void 0&&(s=t(),n.data.set(t,s)),s},cacheSignal:function(){return Nn(tn).controller.signal}},Zj=typeof WeakMap=="function"?WeakMap:Map,At=0,Bt=null,gt=null,jt=0,Rt=0,dl=null,ea=!1,Bi=!1,Mf=!1,Sr=0,Zt=0,ta=0,Za=0,zf=0,fl=0,Ii=0,Ws=null,Kn=null,Of=!1,Dc=0,eg=0,_c=1/0,Bc=null,na=null,dn=0,la=null,Pi=null,Cr=0,Lf=0,Df=null,tg=null,Js=0,_f=null;function ml(){return(At&2)!==0&&jt!==0?jt&-jt:w.T!==null?Ff():oi()}function ng(){if(fl===0)if((jt&536870912)===0||xt){var t=Qt;Qt<<=1,(Qt&3932160)===0&&(Qt=262144),fl=t}else fl=536870912;return t=cl.current,t!==null&&(t.flags|=32),fl}function Zn(t,n,s){(t===Bt&&(Rt===2||Rt===9)||t.cancelPendingCommit!==null)&&(Ui(t,0),ra(t,jt,fl,!1)),tt(t,s),((At&2)===0||t!==Bt)&&(t===Bt&&((At&2)===0&&(Za|=s),Zt===4&&ra(t,jt,fl,!1)),Xl(t))}function lg(t,n,s){if((At&6)!==0)throw Error(i(327));var c=!s&&(n&127)===0&&(n&t.expiredLanes)===0||Wt(t,n),m=c?ek(t,n):If(t,n,!0),x=c;do{if(m===0){Bi&&!c&&ra(t,n,0,!1);break}else{if(s=t.current.alternate,x&&!Wj(s)){m=If(t,n,!1),x=!1;continue}if(m===2){if(x=n,t.errorRecoveryDisabledLanes&x)var j=0;else j=t.pendingLanes&-536870913,j=j!==0?j:j&536870912?536870912:0;if(j!==0){n=j;e:{var C=t;m=Ws;var U=C.current.memoizedState.isDehydrated;if(U&&(Ui(C,j).flags|=256),j=If(C,j,!1),j!==2){if(Mf&&!U){C.errorRecoveryDisabledLanes|=x,Za|=x,m=4;break e}x=Kn,Kn=m,x!==null&&(Kn===null?Kn=x:Kn.push.apply(Kn,x))}m=j}if(x=!1,m!==2)continue}}if(m===1){Ui(t,0),ra(t,n,0,!0);break}e:{switch(c=t,x=m,x){case 0:case 1:throw Error(i(345));case 4:if((n&4194048)!==n)break;case 6:ra(c,n,fl,!ea);break e;case 2:Kn=null;break;case 3:case 5:break;default:throw Error(i(329))}if((n&62914560)===n&&(m=Dc+300-nt(),10<m)){if(ra(c,n,fl,!ea),ht(c,0,!0)!==0)break e;Cr=n,c.timeoutHandle=Lg(rg.bind(null,c,s,Kn,Bc,Of,n,fl,Za,Ii,ea,x,"Throttled",-0,0),m);break e}rg(c,s,Kn,Bc,Of,n,fl,Za,Ii,ea,x,null,-0,0)}}break}while(!0);Xl(t)}function rg(t,n,s,c,m,x,j,C,U,te,fe,xe,re,ie){if(t.timeoutHandle=-1,xe=n.subtreeFlags,xe&8192||(xe&16785408)===16785408){xe={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:Al},Kx(n,x,xe);var De=(x&62914560)===x?Dc-nt():(x&4194048)===x?eg-nt():0;if(De=_k(xe,De),De!==null){Cr=x,t.cancelPendingCommit=De(fg.bind(null,t,n,x,s,c,m,j,C,U,fe,xe,null,re,ie)),ra(t,x,j,!te);return}}fg(t,n,x,s,c,m,j,C,U)}function Wj(t){for(var n=t;;){var s=n.tag;if((s===0||s===11||s===15)&&n.flags&16384&&(s=n.updateQueue,s!==null&&(s=s.stores,s!==null)))for(var c=0;c<s.length;c++){var m=s[c],x=m.getSnapshot;m=m.value;try{if(!Dn(x(),m))return!1}catch{return!1}}if(s=n.child,n.subtreeFlags&16384&&s!==null)s.return=n,n=s;else{if(n===t)break;for(;n.sibling===null;){if(n.return===null||n.return===t)return!0;n=n.return}n.sibling.return=n.return,n=n.sibling}}return!0}function ra(t,n,s,c){n&=~zf,n&=~Za,t.suspendedLanes|=n,t.pingedLanes&=~n,c&&(t.warmLanes|=n),c=t.expirationTimes;for(var m=n;0<m;){var x=31-ke(m),j=1<<x;c[x]=-1,m&=~j}s!==0&&on(t,s,n)}function Ic(){return(At&6)===0?(eo(0),!1):!0}function Bf(){if(gt!==null){if(Rt===0)var t=gt.return;else t=gt,hr=Fa=null,Wd(t),Ri=null,_s=0,t=gt;for(;t!==null;)Dx(t.alternate,t),t=t.return;gt=null}}function Ui(t,n){var s=t.timeoutHandle;s!==-1&&(t.timeoutHandle=-1,bk(s)),s=t.cancelPendingCommit,s!==null&&(t.cancelPendingCommit=null,s()),Cr=0,Bf(),Bt=t,gt=s=Rl(t.current,null),jt=n,Rt=0,dl=null,ea=!1,Bi=Wt(t,n),Mf=!1,Ii=fl=zf=Za=ta=Zt=0,Kn=Ws=null,Of=!1,(n&8)!==0&&(n|=n&32);var c=t.entangledLanes;if(c!==0)for(t=t.entanglements,c&=n;0<c;){var m=31-ke(c),x=1<<m;n|=t[m],c&=~x}return Sr=n,Ni(),s}function ag(t,n){ct=null,w.H=Vs,n===Ei||n===mc?(n=jh(),Rt=3):n===Ud?(n=jh(),Rt=4):Rt=n===hf?8:n!==null&&typeof n=="object"&&typeof n.then=="function"?6:1,dl=n,gt===null&&(Zt=1,Tc(t,$n(n,t.current)))}function ig(){var t=cl.current;return t===null?!0:(jt&4194048)===jt?jl===null:(jt&62914560)===jt||(jt&536870912)!==0?t===jl:!1}function sg(){var t=w.H;return w.H=Vs,t===null?Vs:t}function og(){var t=w.A;return w.A=Kj,t}function Pc(){Zt=4,ea||(jt&4194048)!==jt&&cl.current!==null||(Bi=!0),(ta&134217727)===0&&(Za&134217727)===0||Bt===null||ra(Bt,jt,fl,!1)}function If(t,n,s){var c=At;At|=2;var m=sg(),x=og();(Bt!==t||jt!==n)&&(Bc=null,Ui(t,n)),n=!1;var j=Zt;e:do try{if(Rt!==0&&gt!==null){var C=gt,U=dl;switch(Rt){case 8:Bf(),j=6;break e;case 3:case 2:case 9:case 6:cl.current===null&&(n=!0);var te=Rt;if(Rt=0,dl=null,Hi(t,C,U,te),s&&Bi){j=0;break e}break;default:te=Rt,Rt=0,dl=null,Hi(t,C,U,te)}}Jj(),j=Zt;break}catch(fe){ag(t,fe)}while(!0);return n&&t.shellSuspendCounter++,hr=Fa=null,At=c,w.H=m,w.A=x,gt===null&&(Bt=null,jt=0,Ni()),j}function Jj(){for(;gt!==null;)cg(gt)}function ek(t,n){var s=At;At|=2;var c=sg(),m=og();Bt!==t||jt!==n?(Bc=null,_c=nt()+500,Ui(t,n)):Bi=Wt(t,n);e:do try{if(Rt!==0&&gt!==null){n=gt;var x=dl;t:switch(Rt){case 1:Rt=0,dl=null,Hi(t,n,x,1);break;case 2:case 9:if(yh(x)){Rt=0,dl=null,ug(n);break}n=function(){Rt!==2&&Rt!==9||Bt!==t||(Rt=7),Xl(t)},x.then(n,n);break e;case 3:Rt=7;break e;case 4:Rt=5;break e;case 7:yh(x)?(Rt=0,dl=null,ug(n)):(Rt=0,dl=null,Hi(t,n,x,7));break;case 5:var j=null;switch(gt.tag){case 26:j=gt.memoizedState;case 5:case 27:var C=gt;if(j?Xg(j):C.stateNode.complete){Rt=0,dl=null;var U=C.sibling;if(U!==null)gt=U;else{var te=C.return;te!==null?(gt=te,Uc(te)):gt=null}break t}}Rt=0,dl=null,Hi(t,n,x,5);break;case 6:Rt=0,dl=null,Hi(t,n,x,6);break;case 8:Bf(),Zt=6;break e;default:throw Error(i(462))}}tk();break}catch(fe){ag(t,fe)}while(!0);return hr=Fa=null,w.H=c,w.A=m,At=s,gt!==null?0:(Bt=null,jt=0,Ni(),Zt)}function tk(){for(;gt!==null&&!ot();)cg(gt)}function cg(t){var n=Ox(t.alternate,t,Sr);t.memoizedProps=t.pendingProps,n===null?Uc(t):gt=n}function ug(t){var n=t,s=n.alternate;switch(n.tag){case 15:case 0:n=Tx(s,n,n.pendingProps,n.type,void 0,jt);break;case 11:n=Tx(s,n,n.pendingProps,n.type.render,n.ref,jt);break;case 5:Wd(n);default:Dx(s,n),n=gt=sc(n,Sr),n=Ox(s,n,Sr)}t.memoizedProps=t.pendingProps,n===null?Uc(t):gt=n}function Hi(t,n,s,c){hr=Fa=null,Wd(n),Ri=null,_s=0;var m=n.return;try{if(qj(t,m,n,s,jt)){Zt=1,Tc(t,$n(s,t.current)),gt=null;return}}catch(x){if(m!==null)throw gt=m,x;Zt=1,Tc(t,$n(s,t.current)),gt=null;return}n.flags&32768?(xt||c===1?t=!0:Bi||(jt&536870912)!==0?t=!1:(ea=t=!0,(c===2||c===9||c===3||c===6)&&(c=cl.current,c!==null&&c.tag===13&&(c.flags|=16384))),dg(n,t)):Uc(n)}function Uc(t){var n=t;do{if((n.flags&32768)!==0){dg(n,ea);return}t=n.return;var s=Gj(n.alternate,n,Sr);if(s!==null){gt=s;return}if(n=n.sibling,n!==null){gt=n;return}gt=n=t}while(n!==null);Zt===0&&(Zt=5)}function dg(t,n){do{var s=Yj(t.alternate,t);if(s!==null){s.flags&=32767,gt=s;return}if(s=t.return,s!==null&&(s.flags|=32768,s.subtreeFlags=0,s.deletions=null),!n&&(t=t.sibling,t!==null)){gt=t;return}gt=t=s}while(t!==null);Zt=6,gt=null}function fg(t,n,s,c,m,x,j,C,U){t.cancelPendingCommit=null;do Hc();while(dn!==0);if((At&6)!==0)throw Error(i(327));if(n!==null){if(n===t.current)throw Error(i(177));if(x=n.lanes|n.childLanes,x|=Ia,Vt(t,s,x,j,C,U),t===Bt&&(gt=Bt=null,jt=0),Pi=n,la=t,Cr=s,Lf=x,Df=m,tg=c,(n.subtreeFlags&10256)!==0||(n.flags&10256)!==0?(t.callbackNode=null,t.callbackPriority=0,ak(we,function(){return gg(),null})):(t.callbackNode=null,t.callbackPriority=0),c=(n.flags&13878)!==0,(n.subtreeFlags&13878)!==0||c){c=w.T,w.T=null,m=Y.p,Y.p=2,j=At,At|=4;try{Qj(t,n,s)}finally{At=j,Y.p=m,w.T=c}}dn=1,mg(),pg(),hg()}}function mg(){if(dn===1){dn=0;var t=la,n=Pi,s=(n.flags&13878)!==0;if((n.subtreeFlags&13878)!==0||s){s=w.T,w.T=null;var c=Y.p;Y.p=2;var m=At;At|=4;try{Yx(n,t);var x=Kf,j=Ts(t.containerInfo),C=x.focusedElem,U=x.selectionRange;if(j!==C&&C&&C.ownerDocument&&yi(C.ownerDocument.documentElement,C)){if(U!==null&&vi(C)){var te=U.start,fe=U.end;if(fe===void 0&&(fe=te),"selectionStart"in C)C.selectionStart=te,C.selectionEnd=Math.min(fe,C.value.length);else{var xe=C.ownerDocument||document,re=xe&&xe.defaultView||window;if(re.getSelection){var ie=re.getSelection(),De=C.textContent.length,Ze=Math.min(U.start,De),Dt=U.end===void 0?Ze:Math.min(U.end,De);!ie.extend&&Ze>Dt&&(j=Dt,Dt=Ze,Ze=j);var K=rl(C,Ze),$=rl(C,Dt);if(K&&$&&(ie.rangeCount!==1||ie.anchorNode!==K.node||ie.anchorOffset!==K.offset||ie.focusNode!==$.node||ie.focusOffset!==$.offset)){var ee=xe.createRange();ee.setStart(K.node,K.offset),ie.removeAllRanges(),Ze>Dt?(ie.addRange(ee),ie.extend($.node,$.offset)):(ee.setEnd($.node,$.offset),ie.addRange(ee))}}}}for(xe=[],ie=C;ie=ie.parentNode;)ie.nodeType===1&&xe.push({element:ie,left:ie.scrollLeft,top:ie.scrollTop});for(typeof C.focus=="function"&&C.focus(),C=0;C<xe.length;C++){var me=xe[C];me.element.scrollLeft=me.left,me.element.scrollTop=me.top}}Jc=!!Xf,Kf=Xf=null}finally{At=m,Y.p=c,w.T=s}}t.current=n,dn=2}}function pg(){if(dn===2){dn=0;var t=la,n=Pi,s=(n.flags&8772)!==0;if((n.subtreeFlags&8772)!==0||s){s=w.T,w.T=null;var c=Y.p;Y.p=2;var m=At;At|=4;try{Fx(t,n.alternate,n)}finally{At=m,Y.p=c,w.T=s}}dn=3}}function hg(){if(dn===4||dn===3){dn=0,Ce();var t=la,n=Pi,s=Cr,c=tg;(n.subtreeFlags&10256)!==0||(n.flags&10256)!==0?dn=5:(dn=0,Pi=la=null,xg(t,t.pendingLanes));var m=t.pendingLanes;if(m===0&&(na=null),bn(s),n=n.stateNode,q&&typeof q.onCommitFiberRoot=="function")try{q.onCommitFiberRoot(Te,n,void 0,(n.current.flags&128)===128)}catch{}if(c!==null){n=w.T,m=Y.p,Y.p=2,w.T=null;try{for(var x=t.onRecoverableError,j=0;j<c.length;j++){var C=c[j];x(C.value,{componentStack:C.stack})}}finally{w.T=n,Y.p=m}}(Cr&3)!==0&&Hc(),Xl(t),m=t.pendingLanes,(s&261930)!==0&&(m&42)!==0?t===_f?Js++:(Js=0,_f=t):Js=0,eo(0)}}function xg(t,n){(t.pooledCacheLanes&=n)===0&&(n=t.pooledCache,n!=null&&(t.pooledCache=null,Ls(n)))}function Hc(){return mg(),pg(),hg(),gg()}function gg(){if(dn!==5)return!1;var t=la,n=Lf;Lf=0;var s=bn(Cr),c=w.T,m=Y.p;try{Y.p=32>s?32:s,w.T=null,s=Df,Df=null;var x=la,j=Cr;if(dn=0,Pi=la=null,Cr=0,(At&6)!==0)throw Error(i(331));var C=At;if(At|=4,Wx(x.current),Xx(x,x.current,j,s),At=C,eo(0,!1),q&&typeof q.onPostCommitFiberRoot=="function")try{q.onPostCommitFiberRoot(Te,x)}catch{}return!0}finally{Y.p=m,w.T=c,xg(t,n)}}function bg(t,n,s){n=$n(s,n),n=pf(t.stateNode,n,2),t=Kr(t,n,2),t!==null&&(tt(t,2),Xl(t))}function Mt(t,n,s){if(t.tag===3)bg(t,t,s);else for(;n!==null;){if(n.tag===3){bg(n,t,s);break}else if(n.tag===1){var c=n.stateNode;if(typeof n.type.getDerivedStateFromError=="function"||typeof c.componentDidCatch=="function"&&(na===null||!na.has(c))){t=$n(s,t),s=yx(2),c=Kr(n,s,2),c!==null&&(vx(s,c,n,t),tt(c,2),Xl(c));break}}n=n.return}}function Pf(t,n,s){var c=t.pingCache;if(c===null){c=t.pingCache=new Zj;var m=new Set;c.set(n,m)}else m=c.get(n),m===void 0&&(m=new Set,c.set(n,m));m.has(s)||(Mf=!0,m.add(s),t=nk.bind(null,t,n,s),n.then(t,t))}function nk(t,n,s){var c=t.pingCache;c!==null&&c.delete(n),t.pingedLanes|=t.suspendedLanes&s,t.warmLanes&=~s,Bt===t&&(jt&s)===s&&(Zt===4||Zt===3&&(jt&62914560)===jt&&300>nt()-Dc?(At&2)===0&&Ui(t,0):zf|=s,Ii===jt&&(Ii=0)),Xl(t)}function yg(t,n){n===0&&(n=Ee()),t=mr(t,n),t!==null&&(tt(t,n),Xl(t))}function lk(t){var n=t.memoizedState,s=0;n!==null&&(s=n.retryLane),yg(t,s)}function rk(t,n){var s=0;switch(t.tag){case 31:case 13:var c=t.stateNode,m=t.memoizedState;m!==null&&(s=m.retryLane);break;case 19:c=t.stateNode;break;case 22:c=t.stateNode._retryCache;break;default:throw Error(i(314))}c!==null&&c.delete(n),yg(t,s)}function ak(t,n){return et(t,n)}var Fc=null,Fi=null,Uf=!1,qc=!1,Hf=!1,aa=0;function Xl(t){t!==Fi&&t.next===null&&(Fi===null?Fc=Fi=t:Fi=Fi.next=t),qc=!0,Uf||(Uf=!0,sk())}function eo(t,n){if(!Hf&&qc){Hf=!0;do for(var s=!1,c=Fc;c!==null;){if(t!==0){var m=c.pendingLanes;if(m===0)var x=0;else{var j=c.suspendedLanes,C=c.pingedLanes;x=(1<<31-ke(42|t)+1)-1,x&=m&~(j&~C),x=x&201326741?x&201326741|1:x?x|2:0}x!==0&&(s=!0,Ng(c,x))}else x=jt,x=ht(c,c===Bt?x:0,c.cancelPendingCommit!==null||c.timeoutHandle!==-1),(x&3)===0||Wt(c,x)||(s=!0,Ng(c,x));c=c.next}while(s);Hf=!1}}function ik(){vg()}function vg(){qc=Uf=!1;var t=0;aa!==0&&gk()&&(t=aa);for(var n=nt(),s=null,c=Fc;c!==null;){var m=c.next,x=jg(c,n);x===0?(c.next=null,s===null?Fc=m:s.next=m,m===null&&(Fi=s)):(s=c,(t!==0||(x&3)!==0)&&(qc=!0)),c=m}dn!==0&&dn!==5||eo(t),aa!==0&&(aa=0)}function jg(t,n){for(var s=t.suspendedLanes,c=t.pingedLanes,m=t.expirationTimes,x=t.pendingLanes&-62914561;0<x;){var j=31-ke(x),C=1<<j,U=m[j];U===-1?((C&s)===0||(C&c)!==0)&&(m[j]=se(C,n)):U<=n&&(t.expiredLanes|=C),x&=~C}if(n=Bt,s=jt,s=ht(t,t===n?s:0,t.cancelPendingCommit!==null||t.timeoutHandle!==-1),c=t.callbackNode,s===0||t===n&&(Rt===2||Rt===9)||t.cancelPendingCommit!==null)return c!==null&&c!==null&&Me(c),t.callbackNode=null,t.callbackPriority=0;if((s&3)===0||Wt(t,s)){if(n=s&-s,n===t.callbackPriority)return n;switch(c!==null&&Me(c),bn(s)){case 2:case 8:s=be;break;case 32:s=we;break;case 268435456:s=We;break;default:s=we}return c=kg.bind(null,t),s=et(s,c),t.callbackPriority=n,t.callbackNode=s,n}return c!==null&&c!==null&&Me(c),t.callbackPriority=2,t.callbackNode=null,2}function kg(t,n){if(dn!==0&&dn!==5)return t.callbackNode=null,t.callbackPriority=0,null;var s=t.callbackNode;if(Hc()&&t.callbackNode!==s)return null;var c=jt;return c=ht(t,t===Bt?c:0,t.cancelPendingCommit!==null||t.timeoutHandle!==-1),c===0?null:(lg(t,c,n),jg(t,nt()),t.callbackNode!=null&&t.callbackNode===s?kg.bind(null,t):null)}function Ng(t,n){if(Hc())return null;lg(t,n,!0)}function sk(){yk(function(){(At&6)!==0?et(ae,ik):vg()})}function Ff(){if(aa===0){var t=Ti;t===0&&(t=wt,wt<<=1,(wt&261888)===0&&(wt=256)),aa=t}return aa}function wg(t){return t==null||typeof t=="symbol"||typeof t=="boolean"?null:typeof t=="function"?t:fi(""+t)}function Sg(t,n){var s=n.ownerDocument.createElement("input");return s.name=n.name,s.value=n.value,t.id&&s.setAttribute("form",t.id),n.parentNode.insertBefore(s,n),t=new FormData(t),s.parentNode.removeChild(s),t}function ok(t,n,s,c,m){if(n==="submit"&&s&&s.stateNode===m){var x=wg((m[cn]||null).action),j=c.submitter;j&&(n=(n=j[cn]||null)?wg(n.formAction):j.getAttribute("formAction"),n!==null&&(x=n,j=null));var C=new Pr("action","action",null,c,m);t.push({event:C,listeners:[{instance:null,listener:function(){if(c.defaultPrevented){if(aa!==0){var U=j?Sg(m,j):new FormData(m);of(s,{pending:!0,data:U,method:m.method,action:x},null,U)}}else typeof x=="function"&&(C.preventDefault(),U=j?Sg(m,j):new FormData(m),of(s,{pending:!0,data:U,method:m.method,action:x},x,U))},currentTarget:m}]})}}for(var qf=0;qf<Ba.length;qf++){var Vf=Ba[qf],ck=Vf.toLowerCase(),uk=Vf[0].toUpperCase()+Vf.slice(1);al(ck,"on"+uk)}al(rc,"onAnimationEnd"),al(Da,"onAnimationIteration"),al(ac,"onAnimationStart"),al("dblclick","onDoubleClick"),al("focusin","onFocus"),al("focusout","onBlur"),al(Md,"onTransitionRun"),al(ji,"onTransitionStart"),al(zd,"onTransitionCancel"),al(_a,"onTransitionEnd"),nr("onMouseEnter",["mouseout","mouseover"]),nr("onMouseLeave",["mouseout","mouseover"]),nr("onPointerEnter",["pointerout","pointerover"]),nr("onPointerLeave",["pointerout","pointerover"]),Vl("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),Vl("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),Vl("onBeforeInput",["compositionend","keypress","textInput","paste"]),Vl("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),Vl("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),Vl("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var to="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(" "),dk=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(to));function Cg(t,n){n=(n&4)!==0;for(var s=0;s<t.length;s++){var c=t[s],m=c.event;c=c.listeners;e:{var x=void 0;if(n)for(var j=c.length-1;0<=j;j--){var C=c[j],U=C.instance,te=C.currentTarget;if(C=C.listener,U!==x&&m.isPropagationStopped())break e;x=C,m.currentTarget=te;try{x(m)}catch(fe){ki(fe)}m.currentTarget=null,x=U}else for(j=0;j<c.length;j++){if(C=c[j],U=C.instance,te=C.currentTarget,C=C.listener,U!==x&&m.isPropagationStopped())break e;x=C,m.currentTarget=te;try{x(m)}catch(fe){ki(fe)}m.currentTarget=null,x=U}}}}function bt(t,n){var s=n[tr];s===void 0&&(s=n[tr]=new Set);var c=t+"__bubble";s.has(c)||(Tg(n,t,2,!1),s.add(c))}function $f(t,n,s){var c=0;n&&(c|=4),Tg(s,t,c,n)}var Vc="_reactListening"+Math.random().toString(36).slice(2);function Gf(t){if(!t[Vc]){t[Vc]=!0,Na.forEach(function(s){s!=="selectionchange"&&(dk.has(s)||$f(s,!1,t),$f(s,!0,t))});var n=t.nodeType===9?t:t.ownerDocument;n===null||n[Vc]||(n[Vc]=!0,$f("selectionchange",!1,n))}}function Tg(t,n,s,c){switch(nb(n)){case 2:var m=Pk;break;case 8:m=Uk;break;default:m=sm}s=m.bind(null,n,s,t),m=void 0,!Ca||n!=="touchstart"&&n!=="touchmove"&&n!=="wheel"||(m=!0),c?m!==void 0?t.addEventListener(n,s,{capture:!0,passive:m}):t.addEventListener(n,s,!0):m!==void 0?t.addEventListener(n,s,{passive:m}):t.addEventListener(n,s,!1)}function Yf(t,n,s,c,m){var x=c;if((n&1)===0&&(n&2)===0&&c!==null)e:for(;;){if(c===null)return;var j=c.tag;if(j===3||j===4){var C=c.stateNode.containerInfo;if(C===m)break;if(j===4)for(j=c.return;j!==null;){var U=j.tag;if((U===3||U===4)&&j.stateNode.containerInfo===m)return;j=j.return}for(;C!==null;){if(j=gl(C),j===null)return;if(U=j.tag,U===5||U===6||U===26||U===27){c=x=j;continue e}C=C.parentNode}}c=c.return}xs(function(){var te=x,fe=hs(s),xe=[];e:{var re=ic.get(t);if(re!==void 0){var ie=Pr,De=t;switch(t){case"keypress":if(gs(s)===0)break e;case"keydown":case"keyup":ie=md;break;case"focusin":De="focus",ie=Ea;break;case"focusout":De="blur",ie=Ea;break;case"beforeblur":case"afterblur":ie=Ea;break;case"click":if(s.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":ie=$o;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":ie=hi;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":ie=xd;break;case rc:case Da:case ac:ie=ad;break;case _a:ie=gd;break;case"scroll":case"scrollend":ie=Vo;break;case"wheel":ie=yd;break;case"copy":case"cut":case"paste":ie=id;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":ie=Go;break;case"toggle":case"beforetoggle":ie=jd}var Ze=(n&4)!==0,Dt=!Ze&&(t==="scroll"||t==="scrollend"),K=Ze?re!==null?re+"Capture":null:re;Ze=[];for(var $=te,ee;$!==null;){var me=$;if(ee=me.stateNode,me=me.tag,me!==5&&me!==26&&me!==27||ee===null||K===null||(me=rr($,K),me!=null&&Ze.push(no($,me,ee))),Dt)break;$=$.return}0<Ze.length&&(re=new ie(re,De,null,s,fe),xe.push({event:re,listeners:Ze}))}}if((n&7)===0){e:{if(re=t==="mouseover"||t==="pointerover",ie=t==="mouseout"||t==="pointerout",re&&s!==ps&&(De=s.relatedTarget||s.fromElement)&&(gl(De)||De[zt]))break e;if((ie||re)&&(re=fe.window===fe?fe:(re=fe.ownerDocument)?re.defaultView||re.parentWindow:window,ie?(De=s.relatedTarget||s.toElement,ie=te,De=De?gl(De):null,De!==null&&(Dt=u(De),Ze=De.tag,De!==Dt||Ze!==5&&Ze!==27&&Ze!==6)&&(De=null)):(ie=null,De=te),ie!==De)){if(Ze=$o,me="onMouseLeave",K="onMouseEnter",$="mouse",(t==="pointerout"||t==="pointerover")&&(Ze=Go,me="onPointerLeave",K="onPointerEnter",$="pointer"),Dt=ie==null?re:Dr(ie),ee=De==null?re:Dr(De),re=new Ze(me,$+"leave",ie,s,fe),re.target=Dt,re.relatedTarget=ee,me=null,gl(fe)===te&&(Ze=new Ze(K,$+"enter",De,s,fe),Ze.target=ee,Ze.relatedTarget=Dt,me=Ze),Dt=me,ie&&De)t:{for(Ze=fk,K=ie,$=De,ee=0,me=K;me;me=Ze(me))ee++;me=0;for(var Ge=$;Ge;Ge=Ze(Ge))me++;for(;0<ee-me;)K=Ze(K),ee--;for(;0<me-ee;)$=Ze($),me--;for(;ee--;){if(K===$||$!==null&&K===$.alternate){Ze=K;break t}K=Ze(K),$=Ze($)}Ze=null}else Ze=null;ie!==null&&Ag(xe,re,ie,Ze,!1),De!==null&&Dt!==null&&Ag(xe,Dt,De,Ze,!0)}}e:{if(re=te?Dr(te):window,ie=re.nodeName&&re.nodeName.toLowerCase(),ie==="select"||ie==="input"&&re.type==="file")var St=Ko;else if(Qo(re))if(Zo)St=Ad;else{St=Cd;var He=Sd}else ie=re.nodeName,!ie||ie.toLowerCase()!=="input"||re.type!=="checkbox"&&re.type!=="radio"?te&&ms(te.elementType)&&(St=Ko):St=Td;if(St&&(St=St(t,te))){Xo(xe,St,s,fe);break e}He&&He(t,re,te),t==="focusout"&&te&&re.type==="number"&&te.memoizedProps.value!=null&&Tn(re,"number",re.value)}switch(He=te?Dr(te):window,t){case"focusin":(Qo(He)||He.contentEditable==="true")&&(cr=He,As=te,Oa=null);break;case"focusout":Oa=As=cr=null;break;case"mousedown":Es=!0;break;case"contextmenu":case"mouseup":case"dragend":Es=!1,nc(xe,s,fe);break;case"selectionchange":if(Rd)break;case"keydown":case"keyup":nc(xe,s,fe)}var dt;if(pn)e:{switch(t){case"compositionstart":var kt="onCompositionStart";break e;case"compositionend":kt="onCompositionEnd";break e;case"compositionupdate":kt="onCompositionUpdate";break e}kt=void 0}else Fr?or(t,s)&&(kt="onCompositionEnd"):t==="keydown"&&s.keyCode===229&&(kt="onCompositionStart");kt&&(qn&&s.locale!=="ko"&&(Fr||kt!=="onCompositionStart"?kt==="onCompositionEnd"&&Fr&&(dt=qo()):(An=fe,ir="value"in An?An.value:An.textContent,Fr=!0)),He=$c(te,kt),0<He.length&&(kt=new xi(kt,t,null,s,fe),xe.push({event:kt,listeners:He}),dt?kt.data=dt:(dt=Ra(s),dt!==null&&(kt.data=dt)))),(dt=Ns?kd(t,s):Nd(t,s))&&(kt=$c(te,"onBeforeInput"),0<kt.length&&(He=new xi("onBeforeInput","beforeinput",null,s,fe),xe.push({event:He,listeners:kt}),He.data=dt)),ok(xe,t,te,s,fe)}Cg(xe,n)})}function no(t,n,s){return{instance:t,listener:n,currentTarget:s}}function $c(t,n){for(var s=n+"Capture",c=[];t!==null;){var m=t,x=m.stateNode;if(m=m.tag,m!==5&&m!==26&&m!==27||x===null||(m=rr(t,s),m!=null&&c.unshift(no(t,m,x)),m=rr(t,n),m!=null&&c.push(no(t,m,x))),t.tag===3)return c;t=t.return}return[]}function fk(t){if(t===null)return null;do t=t.return;while(t&&t.tag!==5&&t.tag!==27);return t||null}function Ag(t,n,s,c,m){for(var x=n._reactName,j=[];s!==null&&s!==c;){var C=s,U=C.alternate,te=C.stateNode;if(C=C.tag,U!==null&&U===c)break;C!==5&&C!==26&&C!==27||te===null||(U=te,m?(te=rr(s,x),te!=null&&j.unshift(no(s,te,U))):m||(te=rr(s,x),te!=null&&j.push(no(s,te,U)))),s=s.return}j.length!==0&&t.push({event:n,listeners:j})}var mk=/\r\n?/g,pk=/\u0000|\uFFFD/g;function Eg(t){return(typeof t=="string"?t:""+t).replace(mk,`
9
+ `).replace(pk,"")}function Rg(t,n){return n=Eg(n),Eg(t)===n}function Lt(t,n,s,c,m,x){switch(s){case"children":typeof c=="string"?n==="body"||n==="textarea"&&c===""||lr(t,c):(typeof c=="number"||typeof c=="bigint")&&n!=="body"&&lr(t,""+c);break;case"className":$l(t,"class",c);break;case"tabIndex":$l(t,"tabindex",c);break;case"dir":case"role":case"viewBox":case"width":case"height":$l(t,s,c);break;case"style":Uo(t,c,x);break;case"data":if(n!=="object"){$l(t,"data",c);break}case"src":case"href":if(c===""&&(n!=="a"||s!=="href")){t.removeAttribute(s);break}if(c==null||typeof c=="function"||typeof c=="symbol"||typeof c=="boolean"){t.removeAttribute(s);break}c=fi(""+c),t.setAttribute(s,c);break;case"action":case"formAction":if(typeof c=="function"){t.setAttribute(s,"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 x=="function"&&(s==="formAction"?(n!=="input"&&Lt(t,n,"name",m.name,m,null),Lt(t,n,"formEncType",m.formEncType,m,null),Lt(t,n,"formMethod",m.formMethod,m,null),Lt(t,n,"formTarget",m.formTarget,m,null)):(Lt(t,n,"encType",m.encType,m,null),Lt(t,n,"method",m.method,m,null),Lt(t,n,"target",m.target,m,null)));if(c==null||typeof c=="symbol"||typeof c=="boolean"){t.removeAttribute(s);break}c=fi(""+c),t.setAttribute(s,c);break;case"onClick":c!=null&&(t.onclick=Al);break;case"onScroll":c!=null&&bt("scroll",t);break;case"onScrollEnd":c!=null&&bt("scrollend",t);break;case"dangerouslySetInnerHTML":if(c!=null){if(typeof c!="object"||!("__html"in c))throw Error(i(61));if(s=c.__html,s!=null){if(m.children!=null)throw Error(i(60));t.innerHTML=s}}break;case"multiple":t.multiple=c&&typeof c!="function"&&typeof c!="symbol";break;case"muted":t.muted=c&&typeof c!="function"&&typeof c!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(c==null||typeof c=="function"||typeof c=="boolean"||typeof c=="symbol"){t.removeAttribute("xlink:href");break}s=fi(""+c),t.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",s);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":c!=null&&typeof c!="function"&&typeof c!="symbol"?t.setAttribute(s,""+c):t.removeAttribute(s);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":c&&typeof c!="function"&&typeof c!="symbol"?t.setAttribute(s,""):t.removeAttribute(s);break;case"capture":case"download":c===!0?t.setAttribute(s,""):c!==!1&&c!=null&&typeof c!="function"&&typeof c!="symbol"?t.setAttribute(s,c):t.removeAttribute(s);break;case"cols":case"rows":case"size":case"span":c!=null&&typeof c!="function"&&typeof c!="symbol"&&!isNaN(c)&&1<=c?t.setAttribute(s,c):t.removeAttribute(s);break;case"rowSpan":case"start":c==null||typeof c=="function"||typeof c=="symbol"||isNaN(c)?t.removeAttribute(s):t.setAttribute(s,c);break;case"popover":bt("beforetoggle",t),bt("toggle",t),Sa(t,"popover",c);break;case"xlinkActuate":Fn(t,"http://www.w3.org/1999/xlink","xlink:actuate",c);break;case"xlinkArcrole":Fn(t,"http://www.w3.org/1999/xlink","xlink:arcrole",c);break;case"xlinkRole":Fn(t,"http://www.w3.org/1999/xlink","xlink:role",c);break;case"xlinkShow":Fn(t,"http://www.w3.org/1999/xlink","xlink:show",c);break;case"xlinkTitle":Fn(t,"http://www.w3.org/1999/xlink","xlink:title",c);break;case"xlinkType":Fn(t,"http://www.w3.org/1999/xlink","xlink:type",c);break;case"xmlBase":Fn(t,"http://www.w3.org/XML/1998/namespace","xml:base",c);break;case"xmlLang":Fn(t,"http://www.w3.org/XML/1998/namespace","xml:lang",c);break;case"xmlSpace":Fn(t,"http://www.w3.org/XML/1998/namespace","xml:space",c);break;case"is":Sa(t,"is",c);break;case"innerText":case"textContent":break;default:(!(2<s.length)||s[0]!=="o"&&s[0]!=="O"||s[1]!=="n"&&s[1]!=="N")&&(s=ed.get(s)||s,Sa(t,s,c))}}function Qf(t,n,s,c,m,x){switch(s){case"style":Uo(t,c,x);break;case"dangerouslySetInnerHTML":if(c!=null){if(typeof c!="object"||!("__html"in c))throw Error(i(61));if(s=c.__html,s!=null){if(m.children!=null)throw Error(i(60));t.innerHTML=s}}break;case"children":typeof c=="string"?lr(t,c):(typeof c=="number"||typeof c=="bigint")&&lr(t,""+c);break;case"onScroll":c!=null&&bt("scroll",t);break;case"onScrollEnd":c!=null&&bt("scrollend",t);break;case"onClick":c!=null&&(t.onclick=Al);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!wa.hasOwnProperty(s))e:{if(s[0]==="o"&&s[1]==="n"&&(m=s.endsWith("Capture"),n=s.slice(2,m?s.length-7:void 0),x=t[cn]||null,x=x!=null?x[s]:null,typeof x=="function"&&t.removeEventListener(n,x,m),typeof c=="function")){typeof x!="function"&&x!==null&&(s in t?t[s]=null:t.hasAttribute(s)&&t.removeAttribute(s)),t.addEventListener(n,c,m);break e}s in t?t[s]=c:c===!0?t.setAttribute(s,""):Sa(t,s,c)}}}function Sn(t,n,s){switch(n){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":bt("error",t),bt("load",t);var c=!1,m=!1,x;for(x in s)if(s.hasOwnProperty(x)){var j=s[x];if(j!=null)switch(x){case"src":c=!0;break;case"srcSet":m=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(i(137,n));default:Lt(t,n,x,j,s,null)}}m&&Lt(t,n,"srcSet",s.srcSet,s,null),c&&Lt(t,n,"src",s.src,s,null);return;case"input":bt("invalid",t);var C=x=j=m=null,U=null,te=null;for(c in s)if(s.hasOwnProperty(c)){var fe=s[c];if(fe!=null)switch(c){case"name":m=fe;break;case"type":j=fe;break;case"checked":U=fe;break;case"defaultChecked":te=fe;break;case"value":x=fe;break;case"defaultValue":C=fe;break;case"children":case"dangerouslySetInnerHTML":if(fe!=null)throw Error(i(137,n));break;default:Lt(t,n,c,fe,s,null)}}di(t,x,C,U,te,j,m,!1);return;case"select":bt("invalid",t),c=j=x=null;for(m in s)if(s.hasOwnProperty(m)&&(C=s[m],C!=null))switch(m){case"value":x=C;break;case"defaultValue":j=C;break;case"multiple":c=C;default:Lt(t,n,m,C,s,null)}n=x,s=j,t.multiple=!!c,n!=null?Tl(t,!!c,n,!1):s!=null&&Tl(t,!!c,s,!0);return;case"textarea":bt("invalid",t),x=m=c=null;for(j in s)if(s.hasOwnProperty(j)&&(C=s[j],C!=null))switch(j){case"value":c=C;break;case"defaultValue":m=C;break;case"children":x=C;break;case"dangerouslySetInnerHTML":if(C!=null)throw Error(i(91));break;default:Lt(t,n,j,C,s,null)}Po(t,c,m,x);return;case"option":for(U in s)s.hasOwnProperty(U)&&(c=s[U],c!=null)&&(U==="selected"?t.selected=c&&typeof c!="function"&&typeof c!="symbol":Lt(t,n,U,c,s,null));return;case"dialog":bt("beforetoggle",t),bt("toggle",t),bt("cancel",t),bt("close",t);break;case"iframe":case"object":bt("load",t);break;case"video":case"audio":for(c=0;c<to.length;c++)bt(to[c],t);break;case"image":bt("error",t),bt("load",t);break;case"details":bt("toggle",t);break;case"embed":case"source":case"link":bt("error",t),bt("load",t);case"area":case"base":case"br":case"col":case"hr":case"keygen":case"meta":case"param":case"track":case"wbr":case"menuitem":for(te in s)if(s.hasOwnProperty(te)&&(c=s[te],c!=null))switch(te){case"children":case"dangerouslySetInnerHTML":throw Error(i(137,n));default:Lt(t,n,te,c,s,null)}return;default:if(ms(n)){for(fe in s)s.hasOwnProperty(fe)&&(c=s[fe],c!==void 0&&Qf(t,n,fe,c,s,void 0));return}}for(C in s)s.hasOwnProperty(C)&&(c=s[C],c!=null&&Lt(t,n,C,c,s,null))}function hk(t,n,s,c){switch(n){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var m=null,x=null,j=null,C=null,U=null,te=null,fe=null;for(ie in s){var xe=s[ie];if(s.hasOwnProperty(ie)&&xe!=null)switch(ie){case"checked":break;case"value":break;case"defaultValue":U=xe;default:c.hasOwnProperty(ie)||Lt(t,n,ie,null,c,xe)}}for(var re in c){var ie=c[re];if(xe=s[re],c.hasOwnProperty(re)&&(ie!=null||xe!=null))switch(re){case"type":x=ie;break;case"name":m=ie;break;case"checked":te=ie;break;case"defaultChecked":fe=ie;break;case"value":j=ie;break;case"defaultValue":C=ie;break;case"children":case"dangerouslySetInnerHTML":if(ie!=null)throw Error(i(137,n));break;default:ie!==xe&&Lt(t,n,re,ie,c,xe)}}_r(t,j,C,U,te,fe,x,m);return;case"select":ie=j=C=re=null;for(x in s)if(U=s[x],s.hasOwnProperty(x)&&U!=null)switch(x){case"value":break;case"multiple":ie=U;default:c.hasOwnProperty(x)||Lt(t,n,x,null,c,U)}for(m in c)if(x=c[m],U=s[m],c.hasOwnProperty(m)&&(x!=null||U!=null))switch(m){case"value":re=x;break;case"defaultValue":C=x;break;case"multiple":j=x;default:x!==U&&Lt(t,n,m,x,c,U)}n=C,s=j,c=ie,re!=null?Tl(t,!!s,re,!1):!!c!=!!s&&(n!=null?Tl(t,!!s,n,!0):Tl(t,!!s,s?[]:"",!1));return;case"textarea":ie=re=null;for(C in s)if(m=s[C],s.hasOwnProperty(C)&&m!=null&&!c.hasOwnProperty(C))switch(C){case"value":break;case"children":break;default:Lt(t,n,C,null,c,m)}for(j in c)if(m=c[j],x=s[j],c.hasOwnProperty(j)&&(m!=null||x!=null))switch(j){case"value":re=m;break;case"defaultValue":ie=m;break;case"children":break;case"dangerouslySetInnerHTML":if(m!=null)throw Error(i(91));break;default:m!==x&&Lt(t,n,j,m,c,x)}Wu(t,re,ie);return;case"option":for(var De in s)re=s[De],s.hasOwnProperty(De)&&re!=null&&!c.hasOwnProperty(De)&&(De==="selected"?t.selected=!1:Lt(t,n,De,null,c,re));for(U in c)re=c[U],ie=s[U],c.hasOwnProperty(U)&&re!==ie&&(re!=null||ie!=null)&&(U==="selected"?t.selected=re&&typeof re!="function"&&typeof re!="symbol":Lt(t,n,U,re,c,ie));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 Ze in s)re=s[Ze],s.hasOwnProperty(Ze)&&re!=null&&!c.hasOwnProperty(Ze)&&Lt(t,n,Ze,null,c,re);for(te in c)if(re=c[te],ie=s[te],c.hasOwnProperty(te)&&re!==ie&&(re!=null||ie!=null))switch(te){case"children":case"dangerouslySetInnerHTML":if(re!=null)throw Error(i(137,n));break;default:Lt(t,n,te,re,c,ie)}return;default:if(ms(n)){for(var Dt in s)re=s[Dt],s.hasOwnProperty(Dt)&&re!==void 0&&!c.hasOwnProperty(Dt)&&Qf(t,n,Dt,void 0,c,re);for(fe in c)re=c[fe],ie=s[fe],!c.hasOwnProperty(fe)||re===ie||re===void 0&&ie===void 0||Qf(t,n,fe,re,c,ie);return}}for(var K in s)re=s[K],s.hasOwnProperty(K)&&re!=null&&!c.hasOwnProperty(K)&&Lt(t,n,K,null,c,re);for(xe in c)re=c[xe],ie=s[xe],!c.hasOwnProperty(xe)||re===ie||re==null&&ie==null||Lt(t,n,xe,re,c,ie)}function Mg(t){switch(t){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function xk(){if(typeof performance.getEntriesByType=="function"){for(var t=0,n=0,s=performance.getEntriesByType("resource"),c=0;c<s.length;c++){var m=s[c],x=m.transferSize,j=m.initiatorType,C=m.duration;if(x&&C&&Mg(j)){for(j=0,C=m.responseEnd,c+=1;c<s.length;c++){var U=s[c],te=U.startTime;if(te>C)break;var fe=U.transferSize,xe=U.initiatorType;fe&&Mg(xe)&&(U=U.responseEnd,j+=fe*(U<C?1:(C-te)/(U-te)))}if(--c,n+=8*(x+j)/(m.duration/1e3),t++,10<t)break}}if(0<t)return n/t/1e6}return navigator.connection&&(t=navigator.connection.downlink,typeof t=="number")?t:5}var Xf=null,Kf=null;function Gc(t){return t.nodeType===9?t:t.ownerDocument}function zg(t){switch(t){case"http://www.w3.org/2000/svg":return 1;case"http://www.w3.org/1998/Math/MathML":return 2;default:return 0}}function Og(t,n){if(t===0)switch(n){case"svg":return 1;case"math":return 2;default:return 0}return t===1&&n==="foreignObject"?0:t}function Zf(t,n){return t==="textarea"||t==="noscript"||typeof n.children=="string"||typeof n.children=="number"||typeof n.children=="bigint"||typeof n.dangerouslySetInnerHTML=="object"&&n.dangerouslySetInnerHTML!==null&&n.dangerouslySetInnerHTML.__html!=null}var Wf=null;function gk(){var t=window.event;return t&&t.type==="popstate"?t===Wf?!1:(Wf=t,!0):(Wf=null,!1)}var Lg=typeof setTimeout=="function"?setTimeout:void 0,bk=typeof clearTimeout=="function"?clearTimeout:void 0,Dg=typeof Promise=="function"?Promise:void 0,yk=typeof queueMicrotask=="function"?queueMicrotask:typeof Dg<"u"?function(t){return Dg.resolve(null).then(t).catch(vk)}:Lg;function vk(t){setTimeout(function(){throw t})}function ia(t){return t==="head"}function _g(t,n){var s=n,c=0;do{var m=s.nextSibling;if(t.removeChild(s),m&&m.nodeType===8)if(s=m.data,s==="/$"||s==="/&"){if(c===0){t.removeChild(m),Gi(n);return}c--}else if(s==="$"||s==="$?"||s==="$~"||s==="$!"||s==="&")c++;else if(s==="html")lo(t.ownerDocument.documentElement);else if(s==="head"){s=t.ownerDocument.head,lo(s);for(var x=s.firstChild;x;){var j=x.nextSibling,C=x.nodeName;x[el]||C==="SCRIPT"||C==="STYLE"||C==="LINK"&&x.rel.toLowerCase()==="stylesheet"||s.removeChild(x),x=j}}else s==="body"&&lo(t.ownerDocument.body);s=m}while(s);Gi(n)}function Bg(t,n){var s=t;t=0;do{var c=s.nextSibling;if(s.nodeType===1?n?(s._stashedDisplay=s.style.display,s.style.display="none"):(s.style.display=s._stashedDisplay||"",s.getAttribute("style")===""&&s.removeAttribute("style")):s.nodeType===3&&(n?(s._stashedText=s.nodeValue,s.nodeValue=""):s.nodeValue=s._stashedText||""),c&&c.nodeType===8)if(s=c.data,s==="/$"){if(t===0)break;t--}else s!=="$"&&s!=="$?"&&s!=="$~"&&s!=="$!"||t++;s=c}while(s)}function Jf(t){var n=t.firstChild;for(n&&n.nodeType===10&&(n=n.nextSibling);n;){var s=n;switch(n=n.nextSibling,s.nodeName){case"HTML":case"HEAD":case"BODY":Jf(s),Hl(s);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(s.rel.toLowerCase()==="stylesheet")continue}t.removeChild(s)}}function jk(t,n,s,c){for(;t.nodeType===1;){var m=s;if(t.nodeName.toLowerCase()!==n.toLowerCase()){if(!c&&(t.nodeName!=="INPUT"||t.type!=="hidden"))break}else if(c){if(!t[el])switch(n){case"meta":if(!t.hasAttribute("itemprop"))break;return t;case"link":if(x=t.getAttribute("rel"),x==="stylesheet"&&t.hasAttribute("data-precedence"))break;if(x!==m.rel||t.getAttribute("href")!==(m.href==null||m.href===""?null:m.href)||t.getAttribute("crossorigin")!==(m.crossOrigin==null?null:m.crossOrigin)||t.getAttribute("title")!==(m.title==null?null:m.title))break;return t;case"style":if(t.hasAttribute("data-precedence"))break;return t;case"script":if(x=t.getAttribute("src"),(x!==(m.src==null?null:m.src)||t.getAttribute("type")!==(m.type==null?null:m.type)||t.getAttribute("crossorigin")!==(m.crossOrigin==null?null:m.crossOrigin))&&x&&t.hasAttribute("async")&&!t.hasAttribute("itemprop"))break;return t;default:return t}}else if(n==="input"&&t.type==="hidden"){var x=m.name==null?null:""+m.name;if(m.type==="hidden"&&t.getAttribute("name")===x)return t}else return t;if(t=kl(t.nextSibling),t===null)break}return null}function kk(t,n,s){if(n==="")return null;for(;t.nodeType!==3;)if((t.nodeType!==1||t.nodeName!=="INPUT"||t.type!=="hidden")&&!s||(t=kl(t.nextSibling),t===null))return null;return t}function Ig(t,n){for(;t.nodeType!==8;)if((t.nodeType!==1||t.nodeName!=="INPUT"||t.type!=="hidden")&&!n||(t=kl(t.nextSibling),t===null))return null;return t}function em(t){return t.data==="$?"||t.data==="$~"}function tm(t){return t.data==="$!"||t.data==="$?"&&t.ownerDocument.readyState!=="loading"}function Nk(t,n){var s=t.ownerDocument;if(t.data==="$~")t._reactRetry=n;else if(t.data!=="$?"||s.readyState!=="loading")n();else{var c=function(){n(),s.removeEventListener("DOMContentLoaded",c)};s.addEventListener("DOMContentLoaded",c),t._reactRetry=c}}function kl(t){for(;t!=null;t=t.nextSibling){var n=t.nodeType;if(n===1||n===3)break;if(n===8){if(n=t.data,n==="$"||n==="$!"||n==="$?"||n==="$~"||n==="&"||n==="F!"||n==="F")break;if(n==="/$"||n==="/&")return null}}return t}var nm=null;function Pg(t){t=t.nextSibling;for(var n=0;t;){if(t.nodeType===8){var s=t.data;if(s==="/$"||s==="/&"){if(n===0)return kl(t.nextSibling);n--}else s!=="$"&&s!=="$!"&&s!=="$?"&&s!=="$~"&&s!=="&"||n++}t=t.nextSibling}return null}function Ug(t){t=t.previousSibling;for(var n=0;t;){if(t.nodeType===8){var s=t.data;if(s==="$"||s==="$!"||s==="$?"||s==="$~"||s==="&"){if(n===0)return t;n--}else s!=="/$"&&s!=="/&"||n++}t=t.previousSibling}return null}function Hg(t,n,s){switch(n=Gc(s),t){case"html":if(t=n.documentElement,!t)throw Error(i(452));return t;case"head":if(t=n.head,!t)throw Error(i(453));return t;case"body":if(t=n.body,!t)throw Error(i(454));return t;default:throw Error(i(451))}}function lo(t){for(var n=t.attributes;n.length;)t.removeAttributeNode(n[0]);Hl(t)}var Nl=new Map,Fg=new Set;function Yc(t){return typeof t.getRootNode=="function"?t.getRootNode():t.nodeType===9?t:t.ownerDocument}var Tr=Y.d;Y.d={f:wk,r:Sk,D:Ck,C:Tk,L:Ak,m:Ek,X:Mk,S:Rk,M:zk};function wk(){var t=Tr.f(),n=Ic();return t||n}function Sk(t){var n=Fl(t);n!==null&&n.tag===5&&n.type==="form"?ax(n):Tr.r(t)}var qi=typeof document>"u"?null:document;function qg(t,n,s){var c=qi;if(c&&typeof n=="string"&&n){var m=mn(n);m='link[rel="'+t+'"][href="'+m+'"]',typeof s=="string"&&(m+='[crossorigin="'+s+'"]'),Fg.has(m)||(Fg.add(m),t={rel:t,crossOrigin:s,href:n},c.querySelector(m)===null&&(n=c.createElement("link"),Sn(n,"link",t),Ht(n),c.head.appendChild(n)))}}function Ck(t){Tr.D(t),qg("dns-prefetch",t,null)}function Tk(t,n){Tr.C(t,n),qg("preconnect",t,n)}function Ak(t,n,s){Tr.L(t,n,s);var c=qi;if(c&&t&&n){var m='link[rel="preload"][as="'+mn(n)+'"]';n==="image"&&s&&s.imageSrcSet?(m+='[imagesrcset="'+mn(s.imageSrcSet)+'"]',typeof s.imageSizes=="string"&&(m+='[imagesizes="'+mn(s.imageSizes)+'"]')):m+='[href="'+mn(t)+'"]';var x=m;switch(n){case"style":x=Vi(t);break;case"script":x=$i(t)}Nl.has(x)||(t=g({rel:"preload",href:n==="image"&&s&&s.imageSrcSet?void 0:t,as:n},s),Nl.set(x,t),c.querySelector(m)!==null||n==="style"&&c.querySelector(ro(x))||n==="script"&&c.querySelector(ao(x))||(n=c.createElement("link"),Sn(n,"link",t),Ht(n),c.head.appendChild(n)))}}function Ek(t,n){Tr.m(t,n);var s=qi;if(s&&t){var c=n&&typeof n.as=="string"?n.as:"script",m='link[rel="modulepreload"][as="'+mn(c)+'"][href="'+mn(t)+'"]',x=m;switch(c){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":x=$i(t)}if(!Nl.has(x)&&(t=g({rel:"modulepreload",href:t},n),Nl.set(x,t),s.querySelector(m)===null)){switch(c){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(s.querySelector(ao(x)))return}c=s.createElement("link"),Sn(c,"link",t),Ht(c),s.head.appendChild(c)}}}function Rk(t,n,s){Tr.S(t,n,s);var c=qi;if(c&&t){var m=ql(c).hoistableStyles,x=Vi(t);n=n||"default";var j=m.get(x);if(!j){var C={loading:0,preload:null};if(j=c.querySelector(ro(x)))C.loading=5;else{t=g({rel:"stylesheet",href:t,"data-precedence":n},s),(s=Nl.get(x))&&lm(t,s);var U=j=c.createElement("link");Ht(U),Sn(U,"link",t),U._p=new Promise(function(te,fe){U.onload=te,U.onerror=fe}),U.addEventListener("load",function(){C.loading|=1}),U.addEventListener("error",function(){C.loading|=2}),C.loading|=4,Qc(j,n,c)}j={type:"stylesheet",instance:j,count:1,state:C},m.set(x,j)}}}function Mk(t,n){Tr.X(t,n);var s=qi;if(s&&t){var c=ql(s).hoistableScripts,m=$i(t),x=c.get(m);x||(x=s.querySelector(ao(m)),x||(t=g({src:t,async:!0},n),(n=Nl.get(m))&&rm(t,n),x=s.createElement("script"),Ht(x),Sn(x,"link",t),s.head.appendChild(x)),x={type:"script",instance:x,count:1,state:null},c.set(m,x))}}function zk(t,n){Tr.M(t,n);var s=qi;if(s&&t){var c=ql(s).hoistableScripts,m=$i(t),x=c.get(m);x||(x=s.querySelector(ao(m)),x||(t=g({src:t,async:!0,type:"module"},n),(n=Nl.get(m))&&rm(t,n),x=s.createElement("script"),Ht(x),Sn(x,"link",t),s.head.appendChild(x)),x={type:"script",instance:x,count:1,state:null},c.set(m,x))}}function Vg(t,n,s,c){var m=(m=ce.current)?Yc(m):null;if(!m)throw Error(i(446));switch(t){case"meta":case"title":return null;case"style":return typeof s.precedence=="string"&&typeof s.href=="string"?(n=Vi(s.href),s=ql(m).hoistableStyles,c=s.get(n),c||(c={type:"style",instance:null,count:0,state:null},s.set(n,c)),c):{type:"void",instance:null,count:0,state:null};case"link":if(s.rel==="stylesheet"&&typeof s.href=="string"&&typeof s.precedence=="string"){t=Vi(s.href);var x=ql(m).hoistableStyles,j=x.get(t);if(j||(m=m.ownerDocument||m,j={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},x.set(t,j),(x=m.querySelector(ro(t)))&&!x._p&&(j.instance=x,j.state.loading=5),Nl.has(t)||(s={rel:"preload",as:"style",href:s.href,crossOrigin:s.crossOrigin,integrity:s.integrity,media:s.media,hrefLang:s.hrefLang,referrerPolicy:s.referrerPolicy},Nl.set(t,s),x||Ok(m,t,s,j.state))),n&&c===null)throw Error(i(528,""));return j}if(n&&c!==null)throw Error(i(529,""));return null;case"script":return n=s.async,s=s.src,typeof s=="string"&&n&&typeof n!="function"&&typeof n!="symbol"?(n=$i(s),s=ql(m).hoistableScripts,c=s.get(n),c||(c={type:"script",instance:null,count:0,state:null},s.set(n,c)),c):{type:"void",instance:null,count:0,state:null};default:throw Error(i(444,t))}}function Vi(t){return'href="'+mn(t)+'"'}function ro(t){return'link[rel="stylesheet"]['+t+"]"}function $g(t){return g({},t,{"data-precedence":t.precedence,precedence:null})}function Ok(t,n,s,c){t.querySelector('link[rel="preload"][as="style"]['+n+"]")?c.loading=1:(n=t.createElement("link"),c.preload=n,n.addEventListener("load",function(){return c.loading|=1}),n.addEventListener("error",function(){return c.loading|=2}),Sn(n,"link",s),Ht(n),t.head.appendChild(n))}function $i(t){return'[src="'+mn(t)+'"]'}function ao(t){return"script[async]"+t}function Gg(t,n,s){if(n.count++,n.instance===null)switch(n.type){case"style":var c=t.querySelector('style[data-href~="'+mn(s.href)+'"]');if(c)return n.instance=c,Ht(c),c;var m=g({},s,{"data-href":s.href,"data-precedence":s.precedence,href:null,precedence:null});return c=(t.ownerDocument||t).createElement("style"),Ht(c),Sn(c,"style",m),Qc(c,s.precedence,t),n.instance=c;case"stylesheet":m=Vi(s.href);var x=t.querySelector(ro(m));if(x)return n.state.loading|=4,n.instance=x,Ht(x),x;c=$g(s),(m=Nl.get(m))&&lm(c,m),x=(t.ownerDocument||t).createElement("link"),Ht(x);var j=x;return j._p=new Promise(function(C,U){j.onload=C,j.onerror=U}),Sn(x,"link",c),n.state.loading|=4,Qc(x,s.precedence,t),n.instance=x;case"script":return x=$i(s.src),(m=t.querySelector(ao(x)))?(n.instance=m,Ht(m),m):(c=s,(m=Nl.get(x))&&(c=g({},s),rm(c,m)),t=t.ownerDocument||t,m=t.createElement("script"),Ht(m),Sn(m,"link",c),t.head.appendChild(m),n.instance=m);case"void":return null;default:throw Error(i(443,n.type))}else n.type==="stylesheet"&&(n.state.loading&4)===0&&(c=n.instance,n.state.loading|=4,Qc(c,s.precedence,t));return n.instance}function Qc(t,n,s){for(var c=s.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),m=c.length?c[c.length-1]:null,x=m,j=0;j<c.length;j++){var C=c[j];if(C.dataset.precedence===n)x=C;else if(x!==m)break}x?x.parentNode.insertBefore(t,x.nextSibling):(n=s.nodeType===9?s.head:s,n.insertBefore(t,n.firstChild))}function lm(t,n){t.crossOrigin==null&&(t.crossOrigin=n.crossOrigin),t.referrerPolicy==null&&(t.referrerPolicy=n.referrerPolicy),t.title==null&&(t.title=n.title)}function rm(t,n){t.crossOrigin==null&&(t.crossOrigin=n.crossOrigin),t.referrerPolicy==null&&(t.referrerPolicy=n.referrerPolicy),t.integrity==null&&(t.integrity=n.integrity)}var Xc=null;function Yg(t,n,s){if(Xc===null){var c=new Map,m=Xc=new Map;m.set(s,c)}else m=Xc,c=m.get(s),c||(c=new Map,m.set(s,c));if(c.has(t))return c;for(c.set(t,null),s=s.getElementsByTagName(t),m=0;m<s.length;m++){var x=s[m];if(!(x[el]||x[Yt]||t==="link"&&x.getAttribute("rel")==="stylesheet")&&x.namespaceURI!=="http://www.w3.org/2000/svg"){var j=x.getAttribute(n)||"";j=t+j;var C=c.get(j);C?C.push(x):c.set(j,[x])}}return c}function Qg(t,n,s){t=t.ownerDocument||t,t.head.insertBefore(s,n==="title"?t.querySelector("head > title"):null)}function Lk(t,n,s){if(s===1||n.itemProp!=null)return!1;switch(t){case"meta":case"title":return!0;case"style":if(typeof n.precedence!="string"||typeof n.href!="string"||n.href==="")break;return!0;case"link":if(typeof n.rel!="string"||typeof n.href!="string"||n.href===""||n.onLoad||n.onError)break;return n.rel==="stylesheet"?(t=n.disabled,typeof n.precedence=="string"&&t==null):!0;case"script":if(n.async&&typeof n.async!="function"&&typeof n.async!="symbol"&&!n.onLoad&&!n.onError&&n.src&&typeof n.src=="string")return!0}return!1}function Xg(t){return!(t.type==="stylesheet"&&(t.state.loading&3)===0)}function Dk(t,n,s,c){if(s.type==="stylesheet"&&(typeof c.media!="string"||matchMedia(c.media).matches!==!1)&&(s.state.loading&4)===0){if(s.instance===null){var m=Vi(c.href),x=n.querySelector(ro(m));if(x){n=x._p,n!==null&&typeof n=="object"&&typeof n.then=="function"&&(t.count++,t=Kc.bind(t),n.then(t,t)),s.state.loading|=4,s.instance=x,Ht(x);return}x=n.ownerDocument||n,c=$g(c),(m=Nl.get(m))&&lm(c,m),x=x.createElement("link"),Ht(x);var j=x;j._p=new Promise(function(C,U){j.onload=C,j.onerror=U}),Sn(x,"link",c),s.instance=x}t.stylesheets===null&&(t.stylesheets=new Map),t.stylesheets.set(s,n),(n=s.state.preload)&&(s.state.loading&3)===0&&(t.count++,s=Kc.bind(t),n.addEventListener("load",s),n.addEventListener("error",s))}}var am=0;function _k(t,n){return t.stylesheets&&t.count===0&&Wc(t,t.stylesheets),0<t.count||0<t.imgCount?function(s){var c=setTimeout(function(){if(t.stylesheets&&Wc(t,t.stylesheets),t.unsuspend){var x=t.unsuspend;t.unsuspend=null,x()}},6e4+n);0<t.imgBytes&&am===0&&(am=62500*xk());var m=setTimeout(function(){if(t.waitingForImages=!1,t.count===0&&(t.stylesheets&&Wc(t,t.stylesheets),t.unsuspend)){var x=t.unsuspend;t.unsuspend=null,x()}},(t.imgBytes>am?50:800)+n);return t.unsuspend=s,function(){t.unsuspend=null,clearTimeout(c),clearTimeout(m)}}:null}function Kc(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)Wc(this,this.stylesheets);else if(this.unsuspend){var t=this.unsuspend;this.unsuspend=null,t()}}}var Zc=null;function Wc(t,n){t.stylesheets=null,t.unsuspend!==null&&(t.count++,Zc=new Map,n.forEach(Bk,t),Zc=null,Kc.call(t))}function Bk(t,n){if(!(n.state.loading&4)){var s=Zc.get(t);if(s)var c=s.get(null);else{s=new Map,Zc.set(t,s);for(var m=t.querySelectorAll("link[data-precedence],style[data-precedence]"),x=0;x<m.length;x++){var j=m[x];(j.nodeName==="LINK"||j.getAttribute("media")!=="not all")&&(s.set(j.dataset.precedence,j),c=j)}c&&s.set(null,c)}m=n.instance,j=m.getAttribute("data-precedence"),x=s.get(j)||c,x===c&&s.set(null,m),s.set(j,m),this.count++,c=Kc.bind(this),m.addEventListener("load",c),m.addEventListener("error",c),x?x.parentNode.insertBefore(m,x.nextSibling):(t=t.nodeType===9?t.head:t,t.insertBefore(m,t.firstChild)),n.state.loading|=4}}var io={$$typeof:H,Provider:null,Consumer:null,_currentValue:G,_currentValue2:G,_threadCount:0};function Ik(t,n,s,c,m,x,j,C,U){this.tag=1,this.containerInfo=t,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=Oe(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Oe(0),this.hiddenUpdates=Oe(null),this.identifierPrefix=c,this.onUncaughtError=m,this.onCaughtError=x,this.onRecoverableError=j,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=U,this.incompleteTransitions=new Map}function Kg(t,n,s,c,m,x,j,C,U,te,fe,xe){return t=new Ik(t,n,s,j,U,te,fe,xe,C),n=1,x===!0&&(n|=24),x=_n(3,null,null,n),t.current=x,x.stateNode=t,n=Bd(),n.refCount++,t.pooledCache=n,n.refCount++,x.memoizedState={element:c,isDehydrated:s,cache:n},Hd(x),t}function Zg(t){return t?(t=Vr,t):Vr}function Wg(t,n,s,c,m,x){m=Zg(m),c.context===null?c.context=m:c.pendingContext=m,c=Xr(n),c.payload={element:s},x=x===void 0?null:x,x!==null&&(c.callback=x),s=Kr(t,c,n),s!==null&&(Zn(s,t,n),Is(s,t,n))}function Jg(t,n){if(t=t.memoizedState,t!==null&&t.dehydrated!==null){var s=t.retryLane;t.retryLane=s!==0&&s<n?s:n}}function im(t,n){Jg(t,n),(t=t.alternate)&&Jg(t,n)}function eb(t){if(t.tag===13||t.tag===31){var n=mr(t,67108864);n!==null&&Zn(n,t,67108864),im(t,67108864)}}function tb(t){if(t.tag===13||t.tag===31){var n=ml();n=ja(n);var s=mr(t,n);s!==null&&Zn(s,t,n),im(t,n)}}var Jc=!0;function Pk(t,n,s,c){var m=w.T;w.T=null;var x=Y.p;try{Y.p=2,sm(t,n,s,c)}finally{Y.p=x,w.T=m}}function Uk(t,n,s,c){var m=w.T;w.T=null;var x=Y.p;try{Y.p=8,sm(t,n,s,c)}finally{Y.p=x,w.T=m}}function sm(t,n,s,c){if(Jc){var m=om(c);if(m===null)Yf(t,n,c,eu,s),lb(t,c);else if(Fk(m,t,n,s,c))c.stopPropagation();else if(lb(t,c),n&4&&-1<Hk.indexOf(t)){for(;m!==null;){var x=Fl(m);if(x!==null)switch(x.tag){case 3:if(x=x.stateNode,x.current.memoizedState.isDehydrated){var j=Pt(x.pendingLanes);if(j!==0){var C=x;for(C.pendingLanes|=2,C.entangledLanes|=2;j;){var U=1<<31-ke(j);C.entanglements[1]|=U,j&=~U}Xl(x),(At&6)===0&&(_c=nt()+500,eo(0))}}break;case 31:case 13:C=mr(x,2),C!==null&&Zn(C,x,2),Ic(),im(x,2)}if(x=om(c),x===null&&Yf(t,n,c,eu,s),x===m)break;m=x}m!==null&&c.stopPropagation()}else Yf(t,n,c,null,s)}}function om(t){return t=hs(t),cm(t)}var eu=null;function cm(t){if(eu=null,t=gl(t),t!==null){var n=u(t);if(n===null)t=null;else{var s=n.tag;if(s===13){if(t=d(n),t!==null)return t;t=null}else if(s===31){if(t=f(n),t!==null)return t;t=null}else if(s===3){if(n.stateNode.current.memoizedState.isDehydrated)return n.tag===3?n.stateNode.containerInfo:null;t=null}else n!==t&&(t=null)}}return eu=t,null}function nb(t){switch(t){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(mt()){case ae:return 2;case be:return 8;case we:case ze:return 32;case We:return 268435456;default:return 32}default:return 32}}var um=!1,sa=null,oa=null,ca=null,so=new Map,oo=new Map,ua=[],Hk="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 lb(t,n){switch(t){case"focusin":case"focusout":sa=null;break;case"dragenter":case"dragleave":oa=null;break;case"mouseover":case"mouseout":ca=null;break;case"pointerover":case"pointerout":so.delete(n.pointerId);break;case"gotpointercapture":case"lostpointercapture":oo.delete(n.pointerId)}}function co(t,n,s,c,m,x){return t===null||t.nativeEvent!==x?(t={blockedOn:n,domEventName:s,eventSystemFlags:c,nativeEvent:x,targetContainers:[m]},n!==null&&(n=Fl(n),n!==null&&eb(n)),t):(t.eventSystemFlags|=c,n=t.targetContainers,m!==null&&n.indexOf(m)===-1&&n.push(m),t)}function Fk(t,n,s,c,m){switch(n){case"focusin":return sa=co(sa,t,n,s,c,m),!0;case"dragenter":return oa=co(oa,t,n,s,c,m),!0;case"mouseover":return ca=co(ca,t,n,s,c,m),!0;case"pointerover":var x=m.pointerId;return so.set(x,co(so.get(x)||null,t,n,s,c,m)),!0;case"gotpointercapture":return x=m.pointerId,oo.set(x,co(oo.get(x)||null,t,n,s,c,m)),!0}return!1}function rb(t){var n=gl(t.target);if(n!==null){var s=u(n);if(s!==null){if(n=s.tag,n===13){if(n=d(s),n!==null){t.blockedOn=n,ka(t.priority,function(){tb(s)});return}}else if(n===31){if(n=f(s),n!==null){t.blockedOn=n,ka(t.priority,function(){tb(s)});return}}else if(n===3&&s.stateNode.current.memoizedState.isDehydrated){t.blockedOn=s.tag===3?s.stateNode.containerInfo:null;return}}}t.blockedOn=null}function tu(t){if(t.blockedOn!==null)return!1;for(var n=t.targetContainers;0<n.length;){var s=om(t.nativeEvent);if(s===null){s=t.nativeEvent;var c=new s.constructor(s.type,s);ps=c,s.target.dispatchEvent(c),ps=null}else return n=Fl(s),n!==null&&eb(n),t.blockedOn=s,!1;n.shift()}return!0}function ab(t,n,s){tu(t)&&s.delete(n)}function qk(){um=!1,sa!==null&&tu(sa)&&(sa=null),oa!==null&&tu(oa)&&(oa=null),ca!==null&&tu(ca)&&(ca=null),so.forEach(ab),oo.forEach(ab)}function nu(t,n){t.blockedOn===n&&(t.blockedOn=null,um||(um=!0,e.unstable_scheduleCallback(e.unstable_NormalPriority,qk)))}var lu=null;function ib(t){lu!==t&&(lu=t,e.unstable_scheduleCallback(e.unstable_NormalPriority,function(){lu===t&&(lu=null);for(var n=0;n<t.length;n+=3){var s=t[n],c=t[n+1],m=t[n+2];if(typeof c!="function"){if(cm(c||s)===null)continue;break}var x=Fl(s);x!==null&&(t.splice(n,3),n-=3,of(x,{pending:!0,data:m,method:s.method,action:c},c,m))}}))}function Gi(t){function n(U){return nu(U,t)}sa!==null&&nu(sa,t),oa!==null&&nu(oa,t),ca!==null&&nu(ca,t),so.forEach(n),oo.forEach(n);for(var s=0;s<ua.length;s++){var c=ua[s];c.blockedOn===t&&(c.blockedOn=null)}for(;0<ua.length&&(s=ua[0],s.blockedOn===null);)rb(s),s.blockedOn===null&&ua.shift();if(s=(t.ownerDocument||t).$$reactFormReplay,s!=null)for(c=0;c<s.length;c+=3){var m=s[c],x=s[c+1],j=m[cn]||null;if(typeof x=="function")j||ib(s);else if(j){var C=null;if(x&&x.hasAttribute("formAction")){if(m=x,j=x[cn]||null)C=j.formAction;else if(cm(m)!==null)continue}else C=j.action;typeof C=="function"?s[c+1]=C:(s.splice(c,3),c-=3),ib(s)}}}function sb(){function t(x){x.canIntercept&&x.info==="react-transition"&&x.intercept({handler:function(){return new Promise(function(j){return m=j})},focusReset:"manual",scroll:"manual"})}function n(){m!==null&&(m(),m=null),c||setTimeout(s,20)}function s(){if(!c&&!navigation.transition){var x=navigation.currentEntry;x&&x.url!=null&&navigation.navigate(x.url,{state:x.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var c=!1,m=null;return navigation.addEventListener("navigate",t),navigation.addEventListener("navigatesuccess",n),navigation.addEventListener("navigateerror",n),setTimeout(s,100),function(){c=!0,navigation.removeEventListener("navigate",t),navigation.removeEventListener("navigatesuccess",n),navigation.removeEventListener("navigateerror",n),m!==null&&(m(),m=null)}}}function dm(t){this._internalRoot=t}ru.prototype.render=dm.prototype.render=function(t){var n=this._internalRoot;if(n===null)throw Error(i(409));var s=n.current,c=ml();Wg(s,c,t,n,null,null)},ru.prototype.unmount=dm.prototype.unmount=function(){var t=this._internalRoot;if(t!==null){this._internalRoot=null;var n=t.containerInfo;Wg(t.current,2,null,t,null,null),Ic(),n[zt]=null}};function ru(t){this._internalRoot=t}ru.prototype.unstable_scheduleHydration=function(t){if(t){var n=oi();t={blockedOn:null,target:t,priority:n};for(var s=0;s<ua.length&&n!==0&&n<ua[s].priority;s++);ua.splice(s,0,t),s===0&&rb(t)}};var ob=l.version;if(ob!=="19.2.3")throw Error(i(527,ob,"19.2.3"));Y.findDOMNode=function(t){var n=t._reactInternals;if(n===void 0)throw typeof t.render=="function"?Error(i(188)):(t=Object.keys(t).join(","),Error(i(268,t)));return t=h(n),t=t!==null?y(t):null,t=t===null?null:t.stateNode,t};var Vk={bundleType:0,version:"19.2.3",rendererPackageName:"react-dom",currentDispatcherRef:w,reconcilerVersion:"19.2.3"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var au=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!au.isDisabled&&au.supportsFiber)try{Te=au.inject(Vk),q=au}catch{}}return fo.createRoot=function(t,n){if(!o(t))throw Error(i(299));var s=!1,c="",m=hx,x=xx,j=gx;return n!=null&&(n.unstable_strictMode===!0&&(s=!0),n.identifierPrefix!==void 0&&(c=n.identifierPrefix),n.onUncaughtError!==void 0&&(m=n.onUncaughtError),n.onCaughtError!==void 0&&(x=n.onCaughtError),n.onRecoverableError!==void 0&&(j=n.onRecoverableError)),n=Kg(t,1,!1,null,null,s,c,null,m,x,j,sb),t[zt]=n.current,Gf(t),new dm(n)},fo.hydrateRoot=function(t,n,s){if(!o(t))throw Error(i(299));var c=!1,m="",x=hx,j=xx,C=gx,U=null;return s!=null&&(s.unstable_strictMode===!0&&(c=!0),s.identifierPrefix!==void 0&&(m=s.identifierPrefix),s.onUncaughtError!==void 0&&(x=s.onUncaughtError),s.onCaughtError!==void 0&&(j=s.onCaughtError),s.onRecoverableError!==void 0&&(C=s.onRecoverableError),s.formState!==void 0&&(U=s.formState)),n=Kg(t,1,!0,n,s??null,c,m,U,x,j,C,sb),n.context=Zg(null),s=n.current,c=ml(),c=ja(c),m=Xr(c),m.callback=null,Kr(s,m,c),s=c,n.current.lanes=s,tt(n,s),Xl(n),t[zt]=n.current,Gf(t),new ru(n)},fo.version="19.2.3",fo}var bb;function eN(){if(bb)return pm.exports;bb=1;function e(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(l){console.error(l)}}return e(),pm.exports=Jk(),pm.exports}var yb=eN(),y1=b1();const tN=Uu(y1);function wo(){return wo=Object.assign?Object.assign.bind():function(e){for(var l=1;l<arguments.length;l++){var r=arguments[l];for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(e[i]=r[i])}return e},wo.apply(this,arguments)}var ti;(function(e){e.Pop="POP",e.Push="PUSH",e.Replace="REPLACE"})(ti||(ti={}));const vb="popstate";function nN(e){e===void 0&&(e={});function l(i,o){let{pathname:u,search:d,hash:f}=i.location;return Zm("",{pathname:u,search:d,hash:f},o.state&&o.state.usr||null,o.state&&o.state.key||"default")}function r(i,o){return typeof o=="string"?o:v1(o)}return aN(l,r,null,e)}function Wl(e,l){if(e===!1||e===null||typeof e>"u")throw new Error(l)}function lN(e,l){{typeof console<"u"&&console.warn(l);try{throw new Error(l)}catch{}}}function rN(){return Math.random().toString(36).substr(2,8)}function jb(e,l){return{usr:e.state,key:e.key,idx:l}}function Zm(e,l,r,i){return r===void 0&&(r=null),wo({pathname:typeof e=="string"?e:e.pathname,search:"",hash:""},typeof l=="string"?Fu(l):l,{state:r,key:l&&l.key||i||rN()})}function v1(e){let{pathname:l="/",search:r="",hash:i=""}=e;return r&&r!=="?"&&(l+=r.charAt(0)==="?"?r:"?"+r),i&&i!=="#"&&(l+=i.charAt(0)==="#"?i:"#"+i),l}function Fu(e){let l={};if(e){let r=e.indexOf("#");r>=0&&(l.hash=e.substr(r),e=e.substr(0,r));let i=e.indexOf("?");i>=0&&(l.search=e.substr(i),e=e.substr(0,i)),e&&(l.pathname=e)}return l}function aN(e,l,r,i){i===void 0&&(i={});let{window:o=document.defaultView,v5Compat:u=!1}=i,d=o.history,f=ti.Pop,p=null,h=y();h==null&&(h=0,d.replaceState(wo({},d.state,{idx:h}),""));function y(){return(d.state||{idx:null}).idx}function g(){f=ti.Pop;let N=y(),R=N==null?null:N-h;h=N,p&&p({action:f,location:A.location,delta:R})}function v(N,R){f=ti.Push;let L=Zm(A.location,N,R);h=y()+1;let H=jb(L,h),X=A.createHref(L);try{d.pushState(H,"",X)}catch(V){if(V instanceof DOMException&&V.name==="DataCloneError")throw V;o.location.assign(X)}u&&p&&p({action:f,location:A.location,delta:1})}function k(N,R){f=ti.Replace;let L=Zm(A.location,N,R);h=y();let H=jb(L,h),X=A.createHref(L);d.replaceState(H,"",X),u&&p&&p({action:f,location:A.location,delta:0})}function S(N){let R=o.location.origin!=="null"?o.location.origin:o.location.href,L=typeof N=="string"?N:v1(N);return L=L.replace(/ $/,"%20"),Wl(R,"No window.location.(origin|href) available to create URL for href: "+L),new URL(L,R)}let A={get action(){return f},get location(){return e(o,d)},listen(N){if(p)throw new Error("A history only accepts one active listener");return o.addEventListener(vb,g),p=N,()=>{o.removeEventListener(vb,g),p=null}},createHref(N){return l(o,N)},createURL:S,encodeLocation(N){let R=S(N);return{pathname:R.pathname,search:R.search,hash:R.hash}},push:v,replace:k,go(N){return d.go(N)}};return A}var kb;(function(e){e.data="data",e.deferred="deferred",e.redirect="redirect",e.error="error"})(kb||(kb={}));function iN(e,l){if(l==="/")return e;if(!e.toLowerCase().startsWith(l.toLowerCase()))return null;let r=l.endsWith("/")?l.length-1:l.length,i=e.charAt(r);return i&&i!=="/"?null:e.slice(r)||"/"}const sN=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,oN=e=>sN.test(e);function cN(e,l){l===void 0&&(l="/");let{pathname:r,search:i="",hash:o=""}=typeof e=="string"?Fu(e):e,u;if(r)if(oN(r))u=r;else{if(r.includes("//")){let d=r;r=r.replace(/\/\/+/g,"/"),lN(!1,"Pathnames cannot have embedded double slashes - normalizing "+(d+" -> "+r))}r.startsWith("/")?u=Nb(r.substring(1),"/"):u=Nb(r,l)}else u=l;return{pathname:u,search:pN(i),hash:hN(o)}}function Nb(e,l){let r=l.replace(/\/+$/,"").split("/");return e.split("/").forEach(o=>{o===".."?r.length>1&&r.pop():o!=="."&&r.push(o)}),r.length>1?r.join("/"):"/"}function bm(e,l,r,i){return"Cannot include a '"+e+"' character in a manually specified "+("`to."+l+"` field ["+JSON.stringify(i)+"]. Please separate it out to the ")+("`to."+r+"` field. Alternatively you may provide the full path as ")+'a string in <Link to="..."> and the router will parse it for you.'}function uN(e){return e.filter((l,r)=>r===0||l.route.path&&l.route.path.length>0)}function dN(e,l){let r=uN(e);return l?r.map((i,o)=>o===r.length-1?i.pathname:i.pathnameBase):r.map(i=>i.pathnameBase)}function fN(e,l,r,i){i===void 0&&(i=!1);let o;typeof e=="string"?o=Fu(e):(o=wo({},e),Wl(!o.pathname||!o.pathname.includes("?"),bm("?","pathname","search",o)),Wl(!o.pathname||!o.pathname.includes("#"),bm("#","pathname","hash",o)),Wl(!o.search||!o.search.includes("#"),bm("#","search","hash",o)));let u=e===""||o.pathname==="",d=u?"/":o.pathname,f;if(d==null)f=r;else{let g=l.length-1;if(!i&&d.startsWith("..")){let v=d.split("/");for(;v[0]==="..";)v.shift(),g-=1;o.pathname=v.join("/")}f=g>=0?l[g]:"/"}let p=cN(o,f),h=d&&d!=="/"&&d.endsWith("/"),y=(u||d===".")&&r.endsWith("/");return!p.pathname.endsWith("/")&&(h||y)&&(p.pathname+="/"),p}const mN=e=>e.join("/").replace(/\/\/+/g,"/"),pN=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,hN=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e,j1=["post","put","patch","delete"];new Set(j1);const xN=["get",...j1];new Set(xN);function Ru(){return Ru=Object.assign?Object.assign.bind():function(e){for(var l=1;l<arguments.length;l++){var r=arguments[l];for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(e[i]=r[i])}return e},Ru.apply(this,arguments)}const k1=E.createContext(null),Sp=E.createContext(null),Cp=E.createContext(null),Tp=E.createContext({outlet:null,matches:[],isDataRoute:!1});function Ap(){return E.useContext(Cp)!=null}function N1(){return Ap()||Wl(!1),E.useContext(Cp).location}function w1(e){E.useContext(Sp).static||E.useLayoutEffect(e)}function gN(){let{isDataRoute:e}=E.useContext(Tp);return e?kN():bN()}function bN(){Ap()||Wl(!1);let e=E.useContext(k1),{basename:l,future:r,navigator:i}=E.useContext(Sp),{matches:o}=E.useContext(Tp),{pathname:u}=N1(),d=JSON.stringify(dN(o,r.v7_relativeSplatPath)),f=E.useRef(!1);return w1(()=>{f.current=!0}),E.useCallback(function(h,y){if(y===void 0&&(y={}),!f.current)return;if(typeof h=="number"){i.go(h);return}let g=fN(h,JSON.parse(d),u,y.relative==="path");e==null&&l!=="/"&&(g.pathname=g.pathname==="/"?l:mN([l,g.pathname])),(y.replace?i.replace:i.push)(g,y.state,y)},[l,i,d,u,e])}var S1=(function(e){return e.UseBlocker="useBlocker",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate",e})(S1||{}),C1=(function(e){return e.UseBlocker="useBlocker",e.UseLoaderData="useLoaderData",e.UseActionData="useActionData",e.UseRouteError="useRouteError",e.UseNavigation="useNavigation",e.UseRouteLoaderData="useRouteLoaderData",e.UseMatches="useMatches",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate",e.UseRouteId="useRouteId",e})(C1||{});function yN(e){let l=E.useContext(k1);return l||Wl(!1),l}function vN(e){let l=E.useContext(Tp);return l||Wl(!1),l}function jN(e){let l=vN(),r=l.matches[l.matches.length-1];return r.route.id||Wl(!1),r.route.id}function kN(){let{router:e}=yN(S1.UseNavigateStable),l=jN(C1.UseNavigateStable),r=E.useRef(!1);return w1(()=>{r.current=!0}),E.useCallback(function(o,u){u===void 0&&(u={}),r.current&&(typeof o=="number"?e.navigate(o):e.navigate(o,Ru({fromRouteId:l},u)))},[e,l])}function NN(e,l){e?.v7_startTransition,e?.v7_relativeSplatPath}function wN(e){let{basename:l="/",children:r=null,location:i,navigationType:o=ti.Pop,navigator:u,static:d=!1,future:f}=e;Ap()&&Wl(!1);let p=l.replace(/^\/*/,"/"),h=E.useMemo(()=>({basename:p,navigator:u,static:d,future:Ru({v7_relativeSplatPath:!1},f)}),[p,f,u,d]);typeof i=="string"&&(i=Fu(i));let{pathname:y="/",search:g="",hash:v="",state:k=null,key:S="default"}=i,A=E.useMemo(()=>{let N=iN(y,p);return N==null?null:{location:{pathname:N,search:g,hash:v,state:k,key:S},navigationType:o}},[p,y,g,v,k,S,o]);return A==null?null:E.createElement(Sp.Provider,{value:h},E.createElement(Cp.Provider,{children:r,value:A}))}new Promise(()=>{});const SN="6";try{window.__reactRouterVersion=SN}catch{}const CN="startTransition",wb=Hu[CN];function TN(e){let{basename:l,children:r,future:i,window:o}=e,u=E.useRef();u.current==null&&(u.current=nN({window:o,v5Compat:!0}));let d=u.current,[f,p]=E.useState({action:d.action,location:d.location}),{v7_startTransition:h}=i||{},y=E.useCallback(g=>{h&&wb?wb(()=>p(g)):p(g)},[p,h]);return E.useLayoutEffect(()=>d.listen(y),[d,y]),E.useEffect(()=>NN(i),[i]),E.createElement(wN,{basename:l,children:r,location:f.location,navigationType:f.action,navigator:d,future:i})}var Sb;(function(e){e.UseScrollRestoration="useScrollRestoration",e.UseSubmit="useSubmit",e.UseSubmitFetcher="useSubmitFetcher",e.UseFetcher="useFetcher",e.useViewTransitionState="useViewTransitionState"})(Sb||(Sb={}));var Cb;(function(e){e.UseFetcher="useFetcher",e.UseFetchers="useFetchers",e.UseScrollRestoration="useScrollRestoration"})(Cb||(Cb={}));const T1=(...e)=>e.filter((l,r,i)=>!!l&&l.trim()!==""&&i.indexOf(l)===r).join(" ").trim();const AN=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase();const EN=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(l,r,i)=>i?i.toUpperCase():r.toLowerCase());const Tb=e=>{const l=EN(e);return l.charAt(0).toUpperCase()+l.slice(1)};var RN={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"};const MN=e=>{for(const l in e)if(l.startsWith("aria-")||l==="role"||l==="title")return!0;return!1};const zN=E.forwardRef(({color:e="currentColor",size:l=24,strokeWidth:r=2,absoluteStrokeWidth:i,className:o="",children:u,iconNode:d,...f},p)=>E.createElement("svg",{ref:p,...RN,width:l,height:l,stroke:e,strokeWidth:i?Number(r)*24/Number(l):r,className:T1("lucide",o),...!u&&!MN(f)&&{"aria-hidden":"true"},...f},[...d.map(([h,y])=>E.createElement(h,y)),...Array.isArray(u)?u:[u]]));const Ue=(e,l)=>{const r=E.forwardRef(({className:i,...o},u)=>E.createElement(zN,{ref:u,iconNode:l,className:T1(`lucide-${AN(Tb(e))}`,`lucide-${e}`,i),...o}));return r.displayName=Tb(e),r};const ON=[["path",{d:"M22 12h-2.48a2 2 0 0 0-1.93 1.46l-2.35 8.36a.25.25 0 0 1-.48 0L9.24 2.18a.25.25 0 0 0-.48 0l-2.35 8.36A2 2 0 0 1 4.49 12H2",key:"169zse"}]],Wm=Ue("activity",ON);const LN=[["path",{d:"m21 16-4 4-4-4",key:"f6ql7i"}],["path",{d:"M17 20V4",key:"1ejh1v"}],["path",{d:"m3 8 4-4 4 4",key:"11wl7u"}],["path",{d:"M7 4v16",key:"1glfcx"}]],DN=Ue("arrow-up-down",LN);const _N=[["circle",{cx:"12",cy:"12",r:"4",key:"4exip2"}],["path",{d:"M16 8v5a3 3 0 0 0 6 0v-1a10 10 0 1 0-4 8",key:"7n84p3"}]],Ep=Ue("at-sign",_N);const BN=[["path",{d:"M10.268 21a2 2 0 0 0 3.464 0",key:"vwvbt9"}],["path",{d:"M3.262 15.326A1 1 0 0 0 4 17h16a1 1 0 0 0 .74-1.673C19.41 13.956 18 12.499 18 8A6 6 0 0 0 6 8c0 4.499-1.411 5.956-2.738 7.326",key:"11g9vi"}]],IN=Ue("bell",BN);const PN=[["path",{d:"M12 7v14",key:"1akyts"}],["path",{d:"M3 18a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h5a4 4 0 0 1 4 4 4 4 0 0 1 4-4h5a1 1 0 0 1 1 1v13a1 1 0 0 1-1 1h-6a3 3 0 0 0-3 3 3 3 0 0 0-3-3z",key:"ruj8y"}]],A1=Ue("book-open",PN);const UN=[["path",{d:"M12 8V4H8",key:"hb8ula"}],["rect",{width:"16",height:"12",x:"4",y:"8",rx:"2",key:"enze0r"}],["path",{d:"M2 14h2",key:"vft8re"}],["path",{d:"M20 14h2",key:"4cs60a"}],["path",{d:"M15 13v2",key:"1xurst"}],["path",{d:"M9 13v2",key:"rq6x2g"}]],ts=Ue("bot",UN);const HN=[["path",{d:"M8 2v4",key:"1cmpym"}],["path",{d:"M16 2v4",key:"4m81vk"}],["rect",{width:"18",height:"18",x:"3",y:"4",rx:"2",key:"1hopcy"}],["path",{d:"M3 10h18",key:"8toen8"}]],FN=Ue("calendar",HN);const qN=[["path",{d:"M18 6 7 17l-5-5",key:"116fxf"}],["path",{d:"m22 10-7.5 7.5L13 16",key:"ke71qq"}]],Mu=Ue("check-check",qN);const VN=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],So=Ue("check",VN);const $N=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],_l=Ue("chevron-right",$N);const GN=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]],Rp=Ue("circle-alert",GN);const YN=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]],E1=Ue("circle-check",YN);const QN=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]],XN=Ue("circle",QN);const KN=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 6v6l4 2",key:"mmk7yg"}]],as=Ue("clock",KN);const ZN=[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]],Or=Ue("copy",ZN);const WN=[["path",{d:"M20 20v-7a4 4 0 0 0-4-4H4",key:"1nkjon"}],["path",{d:"M9 14 4 9l5-5",key:"102s5s"}]],JN=Ue("corner-up-left",WN);const ew=[["ellipse",{cx:"12",cy:"5",rx:"9",ry:"3",key:"msslwz"}],["path",{d:"M3 5V19A9 3 0 0 0 21 19V5",key:"1wlel7"}],["path",{d:"M3 12A9 3 0 0 0 21 12",key:"mv7ke4"}]],tw=Ue("database",ew);const nw=[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"M10 14 21 3",key:"gplh6r"}],["path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6",key:"a6xqqp"}]],lw=Ue("external-link",nw);const rw=[["path",{d:"M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0",key:"1nclc0"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]],Jm=Ue("eye",rw);const aw=[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M10 12a1 1 0 0 0-1 1v1a1 1 0 0 1-1 1 1 1 0 0 1 1 1v1a1 1 0 0 0 1 1",key:"1oajmo"}],["path",{d:"M14 18a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1 1 1 0 0 1-1-1v-1a1 1 0 0 0-1-1",key:"mpwhp6"}]],Co=Ue("file-braces",aw);const iw=[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]],Mp=Ue("file-text",iw);const sw=[["path",{d:"m6 14 1.5-2.9A2 2 0 0 1 9.24 10H20a2 2 0 0 1 1.94 2.5l-1.54 6a2 2 0 0 1-1.95 1.5H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H18a2 2 0 0 1 2 2v2",key:"usdka0"}]],xa=Ue("folder-open",sw);const ow=[["path",{d:"M10 20a1 1 0 0 0 .553.895l2 1A1 1 0 0 0 14 21v-7a2 2 0 0 1 .517-1.341L21.74 4.67A1 1 0 0 0 21 3H3a1 1 0 0 0-.742 1.67l7.225 7.989A2 2 0 0 1 10 14z",key:"sc7q7i"}]],cw=Ue("funnel",ow);const uw=[["path",{d:"M15 6a9 9 0 0 0-9 9V3",key:"1cii5b"}],["circle",{cx:"18",cy:"6",r:"3",key:"1h7g24"}],["circle",{cx:"6",cy:"18",r:"3",key:"fqmcym"}]],R1=Ue("git-branch",uw);const dw=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20",key:"13o1zl"}],["path",{d:"M2 12h20",key:"9i4pu4"}]],M1=Ue("globe",dw);const fw=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M3 9h18",key:"1pudct"}],["path",{d:"M3 15h18",key:"5xshup"}],["path",{d:"M9 3v18",key:"fh3hqa"}],["path",{d:"M15 3v18",key:"14nvp0"}]],mw=Ue("grid-3x3",fw);const pw=[["path",{d:"M10 16h.01",key:"1bzywj"}],["path",{d:"M2.212 11.577a2 2 0 0 0-.212.896V18a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-5.527a2 2 0 0 0-.212-.896L18.55 5.11A2 2 0 0 0 16.76 4H7.24a2 2 0 0 0-1.79 1.11z",key:"18tbho"}],["path",{d:"M21.946 12.013H2.054",key:"zqlbp7"}],["path",{d:"M6 16h.01",key:"1pmjb7"}]],hw=Ue("hard-drive",pw);const xw=[["line",{x1:"4",x2:"20",y1:"9",y2:"9",key:"4lhtct"}],["line",{x1:"4",x2:"20",y1:"15",y2:"15",key:"vyu0kd"}],["line",{x1:"10",x2:"8",y1:"3",y2:"21",key:"1ggp8o"}],["line",{x1:"16",x2:"14",y1:"3",y2:"21",key:"weycgp"}]],gw=Ue("hash",xw);const bw=[["path",{d:"m15.5 7.5 2.3 2.3a1 1 0 0 0 1.4 0l2.1-2.1a1 1 0 0 0 0-1.4L19 4",key:"g0fldk"}],["path",{d:"m21 2-9.6 9.6",key:"1j0ho8"}],["circle",{cx:"7.5",cy:"15.5",r:"5.5",key:"yqb3hr"}]],z1=Ue("key",bw);const yw=[["path",{d:"M18 5a2 2 0 0 1 2 2v8.526a2 2 0 0 0 .212.897l1.068 2.127a1 1 0 0 1-.9 1.45H3.62a1 1 0 0 1-.9-1.45l1.068-2.127A2 2 0 0 0 4 15.526V7a2 2 0 0 1 2-2z",key:"1pdavp"}],["path",{d:"M20.054 15.987H3.946",key:"14rxg9"}]],vw=Ue("laptop",yw);const jw=[["rect",{width:"7",height:"7",x:"3",y:"3",rx:"1",key:"1g98yp"}],["rect",{width:"7",height:"7",x:"14",y:"3",rx:"1",key:"6d4xhi"}],["rect",{width:"7",height:"7",x:"14",y:"14",rx:"1",key:"nxv5o0"}],["rect",{width:"7",height:"7",x:"3",y:"14",rx:"1",key:"1bb6yr"}]],zp=Ue("layout-grid",jw);const kw=[["path",{d:"M13 5h8",key:"a7qcls"}],["path",{d:"M13 12h8",key:"h98zly"}],["path",{d:"M13 19h8",key:"c3s6r1"}],["path",{d:"m3 17 2 2 4-4",key:"1jhpwq"}],["rect",{x:"3",y:"4",width:"6",height:"6",rx:"1",key:"cif1o7"}]],Nw=Ue("list-todo",kw);const ww=[["path",{d:"M3 5h.01",key:"18ugdj"}],["path",{d:"M3 12h.01",key:"nlz23k"}],["path",{d:"M3 19h.01",key:"noohij"}],["path",{d:"M8 5h13",key:"1pao27"}],["path",{d:"M8 12h13",key:"1za7za"}],["path",{d:"M8 19h13",key:"m83p4d"}]],O1=Ue("list",ww);const Sw=[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]],L1=Ue("loader-circle",Sw);const Cw=[["path",{d:"M22 17a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 21.286V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2z",key:"18887p"}]],Bl=Ue("message-square",Cw);const Tw=[["path",{d:"M12 19v3",key:"npa21l"}],["path",{d:"M19 10v2a7 7 0 0 1-14 0v-2",key:"1vc78b"}],["rect",{x:"9",y:"2",width:"6",height:"13",rx:"3",key:"s6n7sd"}]],Aw=Ue("mic",Tw);const Ew=[["path",{d:"M20.985 12.486a9 9 0 1 1-9.473-9.472c.405-.022.617.46.402.803a6 6 0 0 0 8.268 8.268c.344-.215.825-.004.803.401",key:"kfwtm"}]],D1=Ue("moon",Ew);const Rw=[["rect",{x:"16",y:"16",width:"6",height:"6",rx:"1",key:"4q2zg0"}],["rect",{x:"2",y:"16",width:"6",height:"6",rx:"1",key:"8cvhb9"}],["rect",{x:"9",y:"2",width:"6",height:"6",rx:"1",key:"1egb70"}],["path",{d:"M5 16v-3a1 1 0 0 1 1-1h12a1 1 0 0 1 1 1v3",key:"1jsf9p"}],["path",{d:"M12 12V8",key:"2874zd"}]],_1=Ue("network",Rw);const Mw=[["path",{d:"M12 22a1 1 0 0 1 0-20 10 9 0 0 1 10 9 5 5 0 0 1-5 5h-2.25a1.75 1.75 0 0 0-1.4 2.8l.3.4a1.75 1.75 0 0 1-1.4 2.8z",key:"e79jfc"}],["circle",{cx:"13.5",cy:"6.5",r:".5",fill:"currentColor",key:"1okk4w"}],["circle",{cx:"17.5",cy:"10.5",r:".5",fill:"currentColor",key:"f64h9f"}],["circle",{cx:"6.5",cy:"12.5",r:".5",fill:"currentColor",key:"qy21gx"}],["circle",{cx:"8.5",cy:"7.5",r:".5",fill:"currentColor",key:"fotxhn"}]],zw=Ue("palette",Mw);const Ow=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M9 3v18",key:"fh3hqa"}],["path",{d:"m16 15-3-3 3-3",key:"14y99z"}]],Lw=Ue("panel-left-close",Ow);const Dw=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M9 3v18",key:"fh3hqa"}],["path",{d:"m14 9 3 3-3 3",key:"8010ee"}]],_w=Ue("panel-left-open",Dw);const Bw=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]],Ab=Ue("plus",Bw);const Iw=[["path",{d:"M19.07 4.93A10 10 0 0 0 6.99 3.34",key:"z3du51"}],["path",{d:"M4 6h.01",key:"oypzma"}],["path",{d:"M2.29 9.62A10 10 0 1 0 21.31 8.35",key:"qzzz0"}],["path",{d:"M16.24 7.76A6 6 0 1 0 8.23 16.67",key:"1yjesh"}],["path",{d:"M12 18h.01",key:"mhygvu"}],["path",{d:"M17.99 11.66A6 6 0 0 1 15.77 16.67",key:"1u2y91"}],["circle",{cx:"12",cy:"12",r:"2",key:"1c9p78"}],["path",{d:"m13.41 10.59 5.66-5.66",key:"mhq4k0"}]],Pw=Ue("radar",Iw);const Uw=[["path",{d:"M16.247 7.761a6 6 0 0 1 0 8.478",key:"1fwjs5"}],["path",{d:"M19.075 4.933a10 10 0 0 1 0 14.134",key:"ehdyv1"}],["path",{d:"M4.925 19.067a10 10 0 0 1 0-14.134",key:"1q22gi"}],["path",{d:"M7.753 16.239a6 6 0 0 1 0-8.478",key:"r2q7qm"}],["circle",{cx:"12",cy:"12",r:"2",key:"1c9p78"}]],ep=Ue("radio",Uw);const Hw=[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",key:"v9h5vc"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",key:"3uifl3"}],["path",{d:"M8 16H3v5",key:"1cv678"}]],gn=Ue("refresh-cw",Hw);const Fw=[["path",{d:"M20 18v-2a4 4 0 0 0-4-4H4",key:"5vmcpk"}],["path",{d:"m9 17-5-5 5-5",key:"nvlc11"}]],qw=Ue("reply",Fw);const Vw=[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]],To=Ue("search",Vw);const $w=[["path",{d:"M3.714 3.048a.498.498 0 0 0-.683.627l2.843 7.627a2 2 0 0 1 0 1.396l-2.842 7.627a.498.498 0 0 0 .682.627l18-8.5a.5.5 0 0 0 0-.904z",key:"117uat"}],["path",{d:"M6 12h16",key:"s4cdu5"}]],B1=Ue("send-horizontal",$w);const Gw=[["rect",{width:"20",height:"8",x:"2",y:"2",rx:"2",ry:"2",key:"ngkwjq"}],["rect",{width:"20",height:"8",x:"2",y:"14",rx:"2",ry:"2",key:"iecqi9"}],["line",{x1:"6",x2:"6.01",y1:"6",y2:"6",key:"16zg32"}],["line",{x1:"6",x2:"6.01",y1:"18",y2:"18",key:"nzw8ys"}]],Op=Ue("server",Gw);const Yw=[["path",{d:"M14 17H5",key:"gfn3mx"}],["path",{d:"M19 7h-9",key:"6i9tg"}],["circle",{cx:"17",cy:"17",r:"3",key:"18b49y"}],["circle",{cx:"7",cy:"7",r:"3",key:"dfmy0x"}]],I1=Ue("settings-2",Yw);const Qw=[["path",{d:"M9.671 4.136a2.34 2.34 0 0 1 4.659 0 2.34 2.34 0 0 0 3.319 1.915 2.34 2.34 0 0 1 2.33 4.033 2.34 2.34 0 0 0 0 3.831 2.34 2.34 0 0 1-2.33 4.033 2.34 2.34 0 0 0-3.319 1.915 2.34 2.34 0 0 1-4.659 0 2.34 2.34 0 0 0-3.32-1.915 2.34 2.34 0 0 1-2.33-4.033 2.34 2.34 0 0 0 0-3.831A2.34 2.34 0 0 1 6.35 6.051a2.34 2.34 0 0 0 3.319-1.915",key:"1i5ecw"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]],ni=Ue("settings",Qw);const Xw=[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}]],P1=Ue("shield",Xw);const Kw=[["rect",{width:"14",height:"20",x:"5",y:"2",rx:"2",ry:"2",key:"1yt0o3"}],["path",{d:"M12 18h.01",key:"mhygvu"}]],Zw=Ue("smartphone",Kw);const Ww=[["path",{d:"M11.525 2.295a.53.53 0 0 1 .95 0l2.31 4.679a2.123 2.123 0 0 0 1.595 1.16l5.166.756a.53.53 0 0 1 .294.904l-3.736 3.638a2.123 2.123 0 0 0-.611 1.878l.882 5.14a.53.53 0 0 1-.771.56l-4.618-2.428a2.122 2.122 0 0 0-1.973 0L6.396 21.01a.53.53 0 0 1-.77-.56l.881-5.139a2.122 2.122 0 0 0-.611-1.879L2.16 9.795a.53.53 0 0 1 .294-.906l5.165-.755a2.122 2.122 0 0 0 1.597-1.16z",key:"r04s7s"}]],Eb=Ue("star",Ww);const Jw=[["circle",{cx:"12",cy:"12",r:"4",key:"4exip2"}],["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"M12 20v2",key:"1lh1kg"}],["path",{d:"m4.93 4.93 1.41 1.41",key:"149t6j"}],["path",{d:"m17.66 17.66 1.41 1.41",key:"ptbguv"}],["path",{d:"M2 12h2",key:"1t8f8n"}],["path",{d:"M20 12h2",key:"1q8mjw"}],["path",{d:"m6.34 17.66-1.41 1.41",key:"1m8zz5"}],["path",{d:"m19.07 4.93-1.41 1.41",key:"1shlcs"}]],U1=Ue("sun",Jw);const e2=[["path",{d:"M12.586 2.586A2 2 0 0 0 11.172 2H4a2 2 0 0 0-2 2v7.172a2 2 0 0 0 .586 1.414l8.704 8.704a2.426 2.426 0 0 0 3.42 0l6.58-6.58a2.426 2.426 0 0 0 0-3.42z",key:"vktsd0"}],["circle",{cx:"7.5",cy:"7.5",r:".5",fill:"currentColor",key:"kqv944"}]],t2=Ue("tag",e2);const n2=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["circle",{cx:"12",cy:"12",r:"6",key:"1vlfrh"}],["circle",{cx:"12",cy:"12",r:"2",key:"1c9p78"}]],l2=Ue("target",n2);const r2=[["path",{d:"M12 19h8",key:"baeox8"}],["path",{d:"m4 17 6-6-6-6",key:"1yngyt"}]],yo=Ue("terminal",r2);const a2=[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]],i2=Ue("triangle-alert",a2);const s2=[["rect",{width:"8",height:"8",x:"3",y:"3",rx:"2",key:"by2w9f"}],["path",{d:"M7 11v4a2 2 0 0 0 2 2h4",key:"xkn7yn"}],["rect",{width:"8",height:"8",x:"13",y:"13",rx:"2",key:"1cgmvn"}]],Rb=Ue("workflow",s2);const o2=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],Sl=Ue("x",o2);const c2=[["path",{d:"M4 14a1 1 0 0 1-.78-1.63l9.9-10.2a.5.5 0 0 1 .86.46l-1.92 6.02A1 1 0 0 0 13 10h7a1 1 0 0 1 .78 1.63l-9.9 10.2a.5.5 0 0 1-.86-.46l1.92-6.02A1 1 0 0 0 11 14z",key:"1xq2db"}]],H1=Ue("zap",c2);var ei=(e=>(e[e.Border=-1]="Border",e[e.Data=0]="Data",e[e.Function=1]="Function",e[e.Position=2]="Position",e[e.Timing=3]="Timing",e[e.Alignment=4]="Alignment",e))(ei||{});const u2=[0,1],F1=[1,0],q1=[2,3],V1=[3,2],d2={L:u2,M:F1,Q:q1,H:V1},f2=/^\d*$/,m2=/^[A-Z0-9 $%*+./:-]*$/,ym="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ $%*+-./:",Lp=1,Dp=40,Mb=3,p2=3,iu=40,h2=10,$1=[[-1,7,10,15,20,26,18,20,24,30,18,20,24,26,30,22,24,28,30,28,28,28,28,30,30,26,28,30,30,30,30,30,30,30,30,30,30,30,30,30,30],[-1,10,16,26,18,24,16,18,22,22,26,30,22,22,24,24,28,28,26,26,26,26,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28],[-1,13,22,18,26,18,24,18,22,20,24,28,26,24,20,30,24,28,28,26,30,28,30,30,30,30,28,30,30,30,30,30,30,30,30,30,30,30,30,30,30],[-1,17,28,22,16,22,28,26,26,24,28,24,28,22,24,24,30,28,28,26,28,30,24,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30]],G1=[[-1,1,1,1,1,1,2,2,2,2,4,4,4,4,4,6,6,6,6,7,8,8,9,9,10,12,12,12,13,14,15,16,17,18,19,19,20,21,22,24,25],[-1,1,1,1,2,2,4,4,4,5,5,5,8,9,9,10,10,11,13,14,16,17,17,18,20,21,23,25,26,28,29,31,33,35,37,38,40,43,45,47,49],[-1,1,1,2,2,4,4,6,6,8,8,8,10,12,16,12,17,16,18,21,20,23,23,25,27,29,34,34,35,38,40,43,45,48,51,53,56,59,62,65,68],[-1,1,1,2,4,4,4,5,6,8,8,11,11,16,16,18,16,19,21,25,25,25,34,30,32,35,37,40,42,45,48,51,54,57,60,63,66,70,74,77,81]];class x2{constructor(l,r,i,o){if(this.version=l,this.ecc=r,l<Lp||l>Dp)throw new RangeError("Version value out of range");if(o<-1||o>7)throw new RangeError("Mask value out of range");this.size=l*4+17;const u=Array.from({length:this.size}).fill(!1);for(let f=0;f<this.size;f++)this.modules.push(u.slice()),this.types.push(u.map(()=>0));this.drawFunctionPatterns();const d=this.addEccAndInterleave(i);if(this.drawCodewords(d),o===-1){let f=1e9;for(let p=0;p<8;p++){this.applyMask(p),this.drawFormatBits(p);const h=this.getPenaltyScore();h<f&&(o=p,f=h),this.applyMask(p)}}this.mask=o,this.applyMask(o),this.drawFormatBits(o)}size;mask;modules=[];types=[];getModule(l,r){return l>=0&&l<this.size&&r>=0&&r<this.size&&this.modules[r][l]}drawFunctionPatterns(){for(let i=0;i<this.size;i++)this.setFunctionModule(6,i,i%2===0,ei.Timing),this.setFunctionModule(i,6,i%2===0,ei.Timing);this.drawFinderPattern(3,3),this.drawFinderPattern(this.size-4,3),this.drawFinderPattern(3,this.size-4);const l=this.getAlignmentPatternPositions(),r=l.length;for(let i=0;i<r;i++)for(let o=0;o<r;o++)i===0&&o===0||i===0&&o===r-1||i===r-1&&o===0||this.drawAlignmentPattern(l[i],l[o]);this.drawFormatBits(0),this.drawVersion()}drawFormatBits(l){const r=this.ecc[1]<<3|l;let i=r;for(let u=0;u<10;u++)i=i<<1^(i>>>9)*1335;const o=(r<<10|i)^21522;for(let u=0;u<=5;u++)this.setFunctionModule(8,u,Ar(o,u));this.setFunctionModule(8,7,Ar(o,6)),this.setFunctionModule(8,8,Ar(o,7)),this.setFunctionModule(7,8,Ar(o,8));for(let u=9;u<15;u++)this.setFunctionModule(14-u,8,Ar(o,u));for(let u=0;u<8;u++)this.setFunctionModule(this.size-1-u,8,Ar(o,u));for(let u=8;u<15;u++)this.setFunctionModule(8,this.size-15+u,Ar(o,u));this.setFunctionModule(8,this.size-8,!0)}drawVersion(){if(this.version<7)return;let l=this.version;for(let i=0;i<12;i++)l=l<<1^(l>>>11)*7973;const r=this.version<<12|l;for(let i=0;i<18;i++){const o=Ar(r,i),u=this.size-11+i%3,d=Math.floor(i/3);this.setFunctionModule(u,d,o),this.setFunctionModule(d,u,o)}}drawFinderPattern(l,r){for(let i=-4;i<=4;i++)for(let o=-4;o<=4;o++){const u=Math.max(Math.abs(o),Math.abs(i)),d=l+o,f=r+i;d>=0&&d<this.size&&f>=0&&f<this.size&&this.setFunctionModule(d,f,u!==2&&u!==4,ei.Position)}}drawAlignmentPattern(l,r){for(let i=-2;i<=2;i++)for(let o=-2;o<=2;o++)this.setFunctionModule(l+o,r+i,Math.max(Math.abs(o),Math.abs(i))!==1,ei.Alignment)}setFunctionModule(l,r,i,o=ei.Function){this.modules[r][l]=i,this.types[r][l]=o}addEccAndInterleave(l){const r=this.version,i=this.ecc;if(l.length!==ku(r,i))throw new RangeError("Invalid argument");const o=G1[i[0]][r],u=$1[i[0]][r],d=Math.floor(tp(r)/8),f=o-d%o,p=Math.floor(d/o),h=[],y=S2(u);for(let v=0,k=0;v<o;v++){const S=l.slice(k,k+p-u+(v<f?0:1));k+=S.length;const A=C2(S,y);v<f&&S.push(0),h.push(S.concat(A))}const g=[];for(let v=0;v<h[0].length;v++)h.forEach((k,S)=>{(v!==p-u||S>=f)&&g.push(k[v])});return g}drawCodewords(l){if(l.length!==Math.floor(tp(this.version)/8))throw new RangeError("Invalid argument");let r=0;for(let i=this.size-1;i>=1;i-=2){i===6&&(i=5);for(let o=0;o<this.size;o++)for(let u=0;u<2;u++){const d=i-u,p=(i+1&2)===0?this.size-1-o:o;!this.types[p][d]&&r<l.length*8&&(this.modules[p][d]=Ar(l[r>>>3],7-(r&7)),r++)}}}applyMask(l){if(l<0||l>7)throw new RangeError("Mask value out of range");for(let r=0;r<this.size;r++)for(let i=0;i<this.size;i++){let o;switch(l){case 0:o=(i+r)%2===0;break;case 1:o=r%2===0;break;case 2:o=i%3===0;break;case 3:o=(i+r)%3===0;break;case 4:o=(Math.floor(i/3)+Math.floor(r/2))%2===0;break;case 5:o=i*r%2+i*r%3===0;break;case 6:o=(i*r%2+i*r%3)%2===0;break;case 7:o=((i+r)%2+i*r%3)%2===0;break;default:throw new Error("Unreachable")}!this.types[r][i]&&o&&(this.modules[r][i]=!this.modules[r][i])}}getPenaltyScore(){let l=0;for(let u=0;u<this.size;u++){let d=!1,f=0;const p=[0,0,0,0,0,0,0];for(let h=0;h<this.size;h++)this.modules[u][h]===d?(f++,f===5?l+=Mb:f>5&&l++):(this.finderPenaltyAddHistory(f,p),d||(l+=this.finderPenaltyCountPatterns(p)*iu),d=this.modules[u][h],f=1);l+=this.finderPenaltyTerminateAndCount(d,f,p)*iu}for(let u=0;u<this.size;u++){let d=!1,f=0;const p=[0,0,0,0,0,0,0];for(let h=0;h<this.size;h++)this.modules[h][u]===d?(f++,f===5?l+=Mb:f>5&&l++):(this.finderPenaltyAddHistory(f,p),d||(l+=this.finderPenaltyCountPatterns(p)*iu),d=this.modules[h][u],f=1);l+=this.finderPenaltyTerminateAndCount(d,f,p)*iu}for(let u=0;u<this.size-1;u++)for(let d=0;d<this.size-1;d++){const f=this.modules[u][d];f===this.modules[u][d+1]&&f===this.modules[u+1][d]&&f===this.modules[u+1][d+1]&&(l+=p2)}let r=0;for(const u of this.modules)r=u.reduce((d,f)=>d+(f?1:0),r);const i=this.size*this.size,o=Math.ceil(Math.abs(r*20-i*10)/i)-1;return l+=o*h2,l}getAlignmentPatternPositions(){if(this.version===1)return[];{const l=Math.floor(this.version/7)+2,r=this.version===32?26:Math.ceil((this.version*4+4)/(l*2-2))*2,i=[6];for(let o=this.size-7;i.length<l;o-=r)i.splice(1,0,o);return i}}finderPenaltyCountPatterns(l){const r=l[1],i=r>0&&l[2]===r&&l[3]===r*3&&l[4]===r&&l[5]===r;return(i&&l[0]>=r*4&&l[6]>=r?1:0)+(i&&l[6]>=r*4&&l[0]>=r?1:0)}finderPenaltyTerminateAndCount(l,r,i){return l&&(this.finderPenaltyAddHistory(r,i),r=0),r+=this.size,this.finderPenaltyAddHistory(r,i),this.finderPenaltyCountPatterns(i)}finderPenaltyAddHistory(l,r){r[0]===0&&(l+=this.size),r.pop(),r.unshift(l)}}function Mr(e,l,r){if(l<0||l>31||e>>>l)throw new RangeError("Value out of range");for(let i=l-1;i>=0;i--)r.push(e>>>i&1)}function Ar(e,l){return(e>>>l&1)!==0}class _p{constructor(l,r,i){if(this.mode=l,this.numChars=r,this.bitData=i,r<0)throw new RangeError("Invalid argument");this.bitData=i.slice()}getData(){return this.bitData.slice()}}const g2=[1,10,12,14],b2=[2,9,11,13],y2=[4,8,16,16];function Y1(e,l){return e[Math.floor((l+7)/17)+1]}function Q1(e){const l=[];for(const r of e)Mr(r,8,l);return new _p(y2,e.length,l)}function v2(e){if(!X1(e))throw new RangeError("String contains non-numeric characters");const l=[];for(let r=0;r<e.length;){const i=Math.min(e.length-r,3);Mr(Number.parseInt(e.substring(r,r+i),10),i*3+1,l),r+=i}return new _p(g2,e.length,l)}function j2(e){if(!K1(e))throw new RangeError("String contains unencodable characters in alphanumeric mode");const l=[];let r;for(r=0;r+2<=e.length;r+=2){let i=ym.indexOf(e.charAt(r))*45;i+=ym.indexOf(e.charAt(r+1)),Mr(i,11,l)}return r<e.length&&Mr(ym.indexOf(e.charAt(r)),6,l),new _p(b2,e.length,l)}function k2(e){return e===""?[]:X1(e)?[v2(e)]:K1(e)?[j2(e)]:[Q1(w2(e))]}function X1(e){return f2.test(e)}function K1(e){return m2.test(e)}function N2(e,l){let r=0;for(const i of e){const o=Y1(i.mode,l);if(i.numChars>=1<<o)return Number.POSITIVE_INFINITY;r+=4+o+i.bitData.length}return r}function w2(e){e=encodeURI(e);const l=[];for(let r=0;r<e.length;r++)e.charAt(r)!=="%"?l.push(e.charCodeAt(r)):(l.push(Number.parseInt(e.substring(r+1,r+3),16)),r+=2);return l}function tp(e){if(e<Lp||e>Dp)throw new RangeError("Version number out of range");let l=(16*e+128)*e+64;if(e>=2){const r=Math.floor(e/7)+2;l-=(25*r-10)*r-55,e>=7&&(l-=36)}return l}function ku(e,l){return Math.floor(tp(e)/8)-$1[l[0]][e]*G1[l[0]][e]}function S2(e){if(e<1||e>255)throw new RangeError("Degree out of range");const l=[];for(let i=0;i<e-1;i++)l.push(0);l.push(1);let r=1;for(let i=0;i<e;i++){for(let o=0;o<l.length;o++)l[o]=np(l[o],r),o+1<l.length&&(l[o]^=l[o+1]);r=np(r,2)}return l}function C2(e,l){const r=l.map(i=>0);for(const i of e){const o=i^r.shift();r.push(0),l.forEach((u,d)=>r[d]^=np(u,o))}return r}function np(e,l){if(e>>>8||l>>>8)throw new RangeError("Byte out of range");let r=0;for(let i=7;i>=0;i--)r=r<<1^(r>>>7)*285,r^=(l>>>i&1)*e;return r}function T2(e,l,r=1,i=40,o=-1,u=!0){if(!(Lp<=r&&r<=i&&i<=Dp)||o<-1||o>7)throw new RangeError("Invalid value");let d,f;for(d=r;;d++){const g=ku(d,l)*8,v=N2(e,d);if(v<=g){f=v;break}if(d>=i)throw new RangeError("Data too long")}for(const g of[F1,q1,V1])u&&f<=ku(d,g)*8&&(l=g);const p=[];for(const g of e){Mr(g.mode[0],4,p),Mr(g.numChars,Y1(g.mode,d),p);for(const v of g.getData())p.push(v)}const h=ku(d,l)*8;Mr(0,Math.min(4,h-p.length),p),Mr(0,(8-p.length%8)%8,p);for(let g=236;p.length<h;g^=253)Mr(g,8,p);const y=Array.from({length:Math.ceil(p.length/8)},()=>0);return p.forEach((g,v)=>y[v>>>3]|=g<<7-(v&7)),new x2(d,l,y,o)}function A2(e,l){const{ecc:r="L",boostEcc:i=!1,minVersion:o=1,maxVersion:u=40,maskPattern:d=-1,border:f=1}=l||{},p=typeof e=="string"?k2(e):Array.isArray(e)?[Q1(e)]:void 0;if(!p)throw new Error(`uqr only supports encoding string and binary data, but got: ${typeof e}`);const h=T2(p,d2[r],o,u,d,i),y=E2({version:h.version,maskPattern:h.mask,size:h.size,data:h.modules,types:h.types},f);return l?.invert&&(y.data=y.data.map(g=>g.map(v=>!v))),l?.onEncoded?.(y),y}function E2(e,l=1){if(!l)return e;const{size:r}=e,i=r+l*2;e.size=i,e.data.forEach(u=>{for(let d=0;d<l;d++)u.unshift(!1),u.push(!1)});for(let u=0;u<l;u++)e.data.unshift(Array.from({length:i},d=>!1)),e.data.push(Array.from({length:i},d=>!1));const o=ei.Border;e.types.forEach(u=>{for(let d=0;d<l;d++)u.unshift(o),u.push(o)});for(let u=0;u<l;u++)e.types.unshift(Array.from({length:i},d=>o)),e.types.push(Array.from({length:i},d=>o));return e}function zb(e){return e.replace(/&/g,"&amp;").replace(/"/g,"&quot;").replace(/</g,"&lt;").replace(/>/g,"&gt;")}function R2(e,l={}){const r=A2(e,l),{pixelSize:i=10,whiteColor:o="white",blackColor:u="black"}=l,d=r.size*i,f=r.size*i;let p=`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 ${f} ${d}">`;const h=[];for(let y=0;y<r.size;y++)for(let g=0;g<r.size;g++){const v=g*i,k=y*i;r.data[y][g]&&h.push(`M${v},${k}h${i}v${i}h-${i}z`)}return p+=`<rect fill="${zb(o)}" width="${f}" height="${d}"/>`,p+=`<path fill="${zb(u)}" d="${h.join("")}"/>`,p+="</svg>",p}const an={border:"var(--os-border)",termBg:"var(--os-terminal-bg)",termFg:"var(--os-terminal-fg)",accent:"var(--os-accent)",accentBg:"var(--os-accent-bg)",ink:"var(--os-ink)",muted:"var(--os-muted)"};function Z1({title:e,pathLabel:l,body:r,truncated:i=!1,lineCount:o,missing:u=!1,loading:d=!1,searchQuery:f="",updatedAtLabel:p,minHeight:h=240,maxHeight:y,onRevealPath:g}){const v=E.useMemo(()=>{if(!r)return"";const k=f.trim().toLowerCase();return k?r.split(`
10
+ `).filter(S=>S.toLowerCase().includes(k)).join(`
11
+ `):r},[r,f]);return a.jsxs("div",{className:"border rounded-xl overflow-hidden",style:{borderColor:an.border},children:[a.jsxs("div",{className:"px-4 h-9 border-b flex items-center justify-between gap-4",style:{borderBottomColor:an.border,backgroundColor:"var(--os-surface)"},children:[a.jsxs("div",{className:"flex items-center gap-2 min-w-0 text-[11px] font-mono truncate",style:{color:an.ink},children:[a.jsx("span",{className:"font-semibold uppercase tracking-widest text-[9px] shrink-0",style:{color:an.muted},children:e}),l?a.jsxs(a.Fragment,{children:[a.jsx("span",{style:{color:an.border},children:"·"}),g?a.jsx("button",{type:"button",className:"truncate underline underline-offset-2 decoration-dotted hover:opacity-80 transition-opacity",style:{color:an.muted},onClick:()=>g(l),children:l}):a.jsx("span",{className:"truncate",style:{color:an.muted},children:l})]}):null]}),a.jsxs("div",{className:"flex items-center gap-3 shrink-0 text-[10px] font-mono",style:{color:an.muted},children:[p?a.jsx("span",{children:p}):null,o!=null?a.jsx("span",{children:i?`${o} lines`:`${o} lines`}):null]})]}),d?a.jsx("div",{className:"flex items-center justify-center",style:{minHeight:h,backgroundColor:an.termBg},children:a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsxs("div",{className:"flex gap-1",children:[a.jsx("span",{className:"os-thinking-dot",style:{color:an.accent}}),a.jsx("span",{className:"os-thinking-dot",style:{color:an.accent}}),a.jsx("span",{className:"os-thinking-dot",style:{color:an.accent}})]}),a.jsx("span",{className:"text-[12px]",style:{color:an.muted},children:"Loading…"})]})}):u?a.jsxs("div",{className:"flex flex-col items-center justify-center px-6 text-center",style:{minHeight:h,backgroundColor:an.termBg},children:[a.jsx("div",{className:"w-12 h-12 rounded-full flex items-center justify-center mb-3",style:{backgroundColor:an.accentBg},children:a.jsx(Co,{size:20,style:{color:an.accent}})}),a.jsx("div",{className:"text-[13px] font-medium mb-1",style:{color:an.ink},children:"No log file yet"}),a.jsxs("div",{className:"text-[12px] max-w-xs",style:{color:an.muted},children:[e," has not written a log yet. This will update as soon as output lands."]})]}):a.jsx("pre",{className:"overflow-auto p-4 text-[11px] leading-[1.55] whitespace-pre-wrap break-words",style:{backgroundColor:an.termBg,color:an.termFg,minHeight:h,maxHeight:y??void 0},children:v||(f.trim()?"No lines match the filter.":"(empty log)")})]})}const M2=void 0;function Ao(e){if(e==null)return null;if(e instanceof Date){const r=e.getTime();return Number.isFinite(r)?r:null}if(typeof e=="number")return Number.isFinite(e)?e:null;const l=Date.parse(e);return Number.isFinite(l)?l:null}function Ob(e,l=M2){const r=Ao(e);return r==null?"—":new Intl.DateTimeFormat(l,{dateStyle:"medium",timeStyle:"short"}).format(r)}function z2(e,l){const r=Ao(e),i=Ao(l);if(r==null||i==null)return"—";const o=Math.max(0,i-r);if(o<1e3)return`${o}ms`;const u=Math.floor(o/1e3);if(u<60)return`${u}s`;const d=Math.floor(u/60),f=u%60;if(d<60)return f>0?`${d}m ${f}s`:`${d}m`;const p=Math.floor(d/60),h=d%60;return h>0?`${p}h ${h}m`:`${p}h`}function W1(e){switch(e){case"command":return"Command";case"file_change":return"File change";case"tool_call":return"Tool call";case"subagent":return"Subagent"}}function O2(e){return e?`${e} risk`:"medium risk"}function L2(e){switch(e.type){case"text":return"Text";case"reasoning":return"Reasoning";case"action":return W1(e.action.kind);case"file":return e.name?.trim()||"File";case"error":return"Error";case"question":return e.header?.trim()||"Question"}}function D2(e){switch(e.type){case"text":return e.text.trim()||"No text";case"reasoning":return e.text.trim()||"No reasoning";case"action":switch(e.action.kind){case"command":return e.action.command.trim()||"No command";case"file_change":return e.action.path.trim()||"No path";case"tool_call":return e.action.toolName.trim()||"No tool";case"subagent":return e.action.agentName?.trim()||e.action.agentId.trim()||"Subagent"}case"file":return e.mimeType;case"error":return e.message.trim()||"Unknown error";case"question":return e.question.trim()||"No question"}}function _2(e){return e.type==="reasoning"&&e.status==="completed"}function B2(e,l){const r=Ao(e),i=Ao(l);return r==null&&i==null?0:r==null?1:i==null?-1:r-i}function I2(e){return[...e.turns].sort((l,r)=>{const i=B2(l.startedAt,r.startedAt);return i!==0?i:l.id.localeCompare(r.id)})}function P2(e){return e.currentTurnId?e.turns.find(l=>l.id===e.currentTurnId)??null:null}function U2(e){return[...e.blocks].sort((l,r)=>l.block.index-r.block.index||l.block.id.localeCompare(r.block.id))}function H2(e,l){return{type:"answer",sessionId:e.sessionId,turnId:e.turnId,blockId:e.id,answer:l}}function Lb(e,l,r){return{type:"decide",sessionId:e.sessionId,turnId:e.turnId,blockId:e.id,version:e.approvalVersion,decision:l,reason:r}}function J1(e,l){return{type:"collapse",sessionId:e.sessionId,turnId:e.turnId,blockId:e.id,collapsed:l}}function F2(e,l,r={}){const i=r.collapseCompletedReasoning??!0;return{sessionId:e,id:l.id,turnId:l.turnId,type:l.type,status:l.status,index:l.index,label:L2(l),summary:D2(l),collapsed:i&&_2(l),block:l}}function q2(e,l,r,i={}){const o=U2(e).map(d=>F2(l,d.block,i)),u=e.endedAt?Ob(e.endedAt,i.locale):null;return{sessionId:l,id:e.id,status:e.status,statusLabel:e.status,isCurrent:e.id===r,startedAt:e.startedAt,startedAtLabel:Ob(e.startedAt,i.locale),endedAt:e.endedAt,endedAtLabel:u,durationLabel:z2(e.startedAt,e.endedAt??null),blocks:o}}function Db(e,l={}){const r=P2(e),i=I2(e).map(o=>q2(o,e.session.id,r?.id??e.currentTurnId,l));return{session:e.session,currentTurnId:e.currentTurnId??r?.id??null,turns:i}}function V2(e){return O2(e)}function $2({block:e,onIntent:l,className:r}){if(e.type!=="action")return null;const i=e.block,o=i.action.approval;if(!o)return null;const u=["os-trace-approval-card",r].filter(Boolean).join(" ");return a.jsxs("section",{className:u,"data-trace-approval":!0,children:[a.jsxs("div",{"data-trace-meta":!0,children:[a.jsx("strong",{children:W1(i.action.kind)}),a.jsx("span",{children:V2(o.risk)})]}),o.description?a.jsx("p",{children:o.description}):null,a.jsxs("div",{"data-trace-actions":!0,children:[a.jsx("button",{type:"button",onClick:()=>l?.(Lb({sessionId:e.sessionId,turnId:e.turnId,id:e.id,approvalVersion:o.version},"approve")),children:"Approve"}),a.jsx("button",{type:"button",onClick:()=>l?.(Lb({sessionId:e.sessionId,turnId:e.turnId,id:e.id,approvalVersion:o.version},"deny")),children:"Deny"})]})]})}function G2({block:e,onIntent:l,className:r}){if(e.type!=="reasoning")return null;const i=e.block,o=["os-trace-reasoning-block",e.collapsed?"is-collapsed":"is-expanded",r].filter(Boolean).join(" ");return a.jsxs("section",{className:o,"data-trace-reasoning":!0,children:[a.jsxs("header",{children:[a.jsx("strong",{children:e.label}),a.jsx("button",{type:"button",onClick:()=>l?.(J1(e,!e.collapsed)),children:e.collapsed?"Expand":"Collapse"})]}),e.collapsed?null:a.jsx("p",{children:i.text||e.summary})]})}function Y2(e,l){return e.includes(l)?e.filter(r=>r!==l):[...e,l]}function Q2(e,l){const r=new Set(l),i=e.options.map(o=>o.label).filter(o=>r.has(o));return e.multiSelect?i:i.slice(0,1)}function X2({block:e,onIntent:l,className:r}){if(e.type!=="question")return null;const i=e.block,[o,u]=z.useState([]),d=["os-trace-question-block",r].filter(Boolean).join(" ");z.useEffect(()=>{u([])},[e.id,i.multiSelect]);function f(p){l?.(H2(e,p)),u([])}return a.jsxs("section",{className:d,"data-trace-question":!0,children:[a.jsxs("header",{children:[a.jsx("strong",{children:e.label}),a.jsx("span",{children:i.questionStatus.replaceAll("_"," ")})]}),a.jsx("p",{children:i.question}),a.jsx("div",{"data-trace-options":!0,children:i.options.map(p=>a.jsx("button",{type:"button","aria-pressed":i.multiSelect?o.includes(p.label):void 0,onClick:()=>{if(!i.multiSelect){f([p.label]);return}u(h=>Y2(h,p.label))},children:p.label},p.label))}),i.multiSelect?a.jsxs(a.Fragment,{children:[a.jsx("small",{children:o.length>0?`${o.length} selected`:"Multi-select question"}),a.jsx("button",{type:"button",disabled:o.length===0,onClick:()=>f(Q2(i,o)),children:"Submit selection"})]}):null]})}function ev({block:e,onIntent:l,className:r}){if(e.type!=="action")return null;const i=e.block,o=["os-trace-action-block",i.action.kind,r].filter(Boolean).join(" "),u=i.action;return a.jsxs("section",{className:o,"data-trace-action":!0,children:[a.jsxs("header",{children:[a.jsx("strong",{children:e.label}),a.jsx("span",{children:u.status.replaceAll("_"," ")})]}),a.jsx("p",{children:e.summary}),u.output?a.jsx("pre",{children:u.output}):null,a.jsx("div",{"data-trace-actions":!0,children:a.jsx("button",{type:"button",onClick:()=>l?.(J1(e,!e.collapsed)),children:e.collapsed?"Expand":"Collapse"})}),u.approval?a.jsx($2,{block:e,onIntent:l}):null]})}function K2({block:e,onIntent:l,className:r}){switch(e.type){case"action":return a.jsx(ev,{block:e,onIntent:l,className:r});case"reasoning":return a.jsx(G2,{block:e,onIntent:l,className:r});case"question":return a.jsx(X2,{block:e,onIntent:l,className:r});case"text":return a.jsxs("article",{className:["os-trace-text-block",r].filter(Boolean).join(" "),"data-trace-text":!0,children:[a.jsxs("header",{children:[a.jsx("strong",{children:e.label}),a.jsx("span",{children:e.status.replaceAll("_"," ")})]}),a.jsx("p",{children:e.summary})]});case"file":{const i=e.block;return a.jsxs("article",{className:["os-trace-file-block",r].filter(Boolean).join(" "),"data-trace-file":!0,children:[a.jsxs("header",{children:[a.jsx("strong",{children:e.label}),a.jsx("span",{children:i.mimeType})]}),a.jsx("p",{children:e.summary})]})}case"error":return a.jsxs("article",{className:["os-trace-error-block",r].filter(Boolean).join(" "),"data-trace-error":!0,children:[a.jsxs("header",{children:[a.jsx("strong",{children:e.label}),a.jsx("span",{children:e.status.replaceAll("_"," ")})]}),a.jsx("p",{children:e.summary})]})}return null}function Z2({turn:e,onIntent:l,className:r}){const i=["os-trace-turn",e.isCurrent?"is-current":null,r].filter(Boolean).join(" ");return a.jsxs("section",{className:i,"data-trace-turn":!0,children:[a.jsxs("header",{children:[a.jsxs("strong",{children:["Turn ",e.id]}),a.jsx("span",{children:e.statusLabel}),a.jsx("time",{dateTime:typeof e.startedAt=="string"?e.startedAt:void 0,children:e.startedAtLabel})]}),a.jsx("div",{"data-trace-blocks":!0,children:e.blocks.map(o=>a.jsx(K2,{block:o,onIntent:l},o.id))})]})}function vm(e){return`${e.sessionId}:${e.turnId}:${e.blockId}`}function W2(e,l){const r=e.detail&&e.detail!==e.description?e.detail:"",i=J2(e,r);return{sessionId:e.sessionId,id:e.blockId,turnId:e.turnId,type:"action",status:"streaming",index:0,label:e.title,summary:e.description,collapsed:l,block:{id:e.blockId,turnId:e.turnId,status:"streaming",index:0,type:"action",action:i}}}function J2(e,l){const r={version:e.version,description:e.description,risk:e.risk};switch(e.actionKind){case"command":return{kind:"command",status:e.actionStatus,output:l,command:e.detail??e.description??e.title,approval:r};case"file_change":return{kind:"file_change",status:e.actionStatus,output:l,path:e.detail??e.description??e.title,approval:r};case"tool_call":return{kind:"tool_call",status:e.actionStatus,output:l,toolName:e.detail??e.description??e.title,toolCallId:e.blockId,approval:r};case"subagent":return{kind:"subagent",status:e.actionStatus,output:l,agentId:e.blockId,agentName:e.detail??e.sessionName,prompt:e.description,approval:r}}}function eS({pendingApprovals:e,pairingApprovalPendingId:l,onDecideApproval:r}){const[i,o]=z.useState({});z.useEffect(()=>{if(e.length===0){Object.keys(i).length>0&&o({});return}const p=new Set(e.map(vm));o(h=>{let y=!1;const g={};for(const[v,k]of Object.entries(h))p.has(v)?g[v]=k:y=!0;return y?g:h})},[e]);const u=z.useMemo(()=>{const p=new Map;for(const h of e)p.set(vm(h),h);return p},[e]),d=z.useMemo(()=>{const p=new Map;for(const h of e){const y=p.get(h.sessionId);if(y){y.approvals.push(h);continue}p.set(h.sessionId,{sessionId:h.sessionId,sessionName:h.sessionName,adapterType:h.adapterType,approvals:[h]})}return[...p.values()].sort((h,y)=>h.sessionName.localeCompare(y.sessionName)||h.sessionId.localeCompare(y.sessionId)).map(h=>({...h,approvals:[...h.approvals].sort((y,g)=>y.title.localeCompare(g.title)||y.turnId.localeCompare(g.turnId)||y.blockId.localeCompare(g.blockId))}))},[e]),f=z.useCallback(p=>{if(p.type==="collapse"){const g=`${p.sessionId}:${p.turnId}:${p.blockId}`;o(v=>({...v,[g]:p.collapsed}));return}if(p.type!=="decide")return;const h=`${p.sessionId}:${p.turnId}:${p.blockId}`,y=u.get(h);y&&r(y,p.decision)},[u,r]);return e.length===0?a.jsx("div",{className:"rounded-2xl border px-4 py-4 text-[12px] leading-[1.7] bg-white",style:{borderColor:"rgba(15, 23, 42, 0.08)"},children:"No live approvals are waiting right now. When a session pauses for input, the shared trace surface will appear here."}):a.jsx("div",{className:"flex flex-col gap-4",children:d.map(p=>a.jsxs("section",{className:"rounded-2xl border p-4",style:{backgroundColor:"#f7f8fb",borderColor:"rgba(15, 23, 42, 0.08)"},children:[a.jsxs("div",{className:"flex items-start justify-between gap-4",children:[a.jsxs("div",{className:"min-w-0",children:[a.jsx("div",{className:"text-[13px] font-medium tracking-tight",style:{color:"#1C1C1A"},children:p.sessionName}),a.jsxs("div",{className:"mt-1 text-[11px] font-light",style:{color:"#8A8A86"},children:[p.adapterType," · ",p.sessionId]})]}),a.jsxs("span",{className:"rounded-full border px-2.5 py-1 text-[10px] font-medium whitespace-nowrap",style:{backgroundColor:"#fff7ed",borderColor:"#fed7aa",color:"#c2410c"},children:[p.approvals.length," queued"]})]}),a.jsx("div",{className:"mt-4 flex flex-col gap-3",children:p.approvals.map(h=>{const y=vm(h),g=W2(h,i[y]??!1),v=l===`${y}:approve`||l===`${y}:deny`;return a.jsxs("div",{className:"rounded-2xl border p-3 pairing-trace-approval-card",style:{backgroundColor:"#ffffff",borderColor:"rgba(15, 23, 42, 0.08)",opacity:v?.72:1},"data-busy":v?"true":"false",children:[a.jsxs("div",{className:"mb-3 flex items-start justify-between gap-3",children:[a.jsxs("div",{className:"min-w-0",children:[a.jsx("div",{className:"text-[12px] font-medium tracking-tight",style:{color:"#1C1C1A"},children:h.title}),a.jsx("div",{className:"mt-1 text-[11px] leading-[1.5] font-light",style:{color:"#8A8A86"},children:h.description})]}),a.jsxs("div",{className:"shrink-0 text-right text-[10px] font-mono uppercase tracking-[0.16em]",style:{color:"#8A8A86"},children:[a.jsx("div",{children:h.turnId}),a.jsx("div",{children:h.blockId})]})]}),a.jsx(ev,{block:g,onIntent:f,className:"pairing-trace-action"})]},y)})})]},p.sessionId))})}function _b(e,l){if(typeof e=="function")return e(l);e!=null&&(e.current=l)}function Bp(...e){return l=>{let r=!1;const i=e.map(o=>{const u=_b(o,l);return!r&&typeof u=="function"&&(r=!0),u});if(r)return()=>{for(let o=0;o<i.length;o++){const u=i[o];typeof u=="function"?u():_b(e[o],null)}}}}function ga(...e){return E.useCallback(Bp(...e),e)}var tS=Symbol.for("react.lazy"),zu=Hu[" use ".trim().toString()];function nS(e){return typeof e=="object"&&e!==null&&"then"in e}function tv(e){return e!=null&&typeof e=="object"&&"$$typeof"in e&&e.$$typeof===tS&&"_payload"in e&&nS(e._payload)}function lS(e){const l=rS(e),r=E.forwardRef((i,o)=>{let{children:u,...d}=i;tv(u)&&typeof zu=="function"&&(u=zu(u._payload));const f=E.Children.toArray(u),p=f.find(iS);if(p){const h=p.props.children,y=f.map(g=>g===p?E.Children.count(h)>1?E.Children.only(null):E.isValidElement(h)?h.props.children:null:g);return a.jsx(l,{...d,ref:o,children:E.isValidElement(h)?E.cloneElement(h,void 0,y):null})}return a.jsx(l,{...d,ref:o,children:u})});return r.displayName=`${e}.Slot`,r}var nv=lS("Slot");function rS(e){const l=E.forwardRef((r,i)=>{let{children:o,...u}=r;if(tv(o)&&typeof zu=="function"&&(o=zu(o._payload)),E.isValidElement(o)){const d=oS(o),f=sS(u,o.props);return o.type!==E.Fragment&&(f.ref=i?Bp(i,d):d),E.cloneElement(o,f)}return E.Children.count(o)>1?E.Children.only(null):null});return l.displayName=`${e}.SlotClone`,l}var aS=Symbol("radix.slottable");function iS(e){return E.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===aS}function sS(e,l){const r={...l};for(const i in l){const o=e[i],u=l[i];/^on[A-Z]/.test(i)?o&&u?r[i]=(...f)=>{const p=u(...f);return o(...f),p}:o&&(r[i]=o):i==="style"?r[i]={...o,...u}:i==="className"&&(r[i]=[o,u].filter(Boolean).join(" "))}return{...e,...r}}function oS(e){let l=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,r=l&&"isReactWarning"in l&&l.isReactWarning;return r?e.ref:(l=Object.getOwnPropertyDescriptor(e,"ref")?.get,r=l&&"isReactWarning"in l&&l.isReactWarning,r?e.props.ref:e.props.ref||e.ref)}function lv(e){var l,r,i="";if(typeof e=="string"||typeof e=="number")i+=e;else if(typeof e=="object")if(Array.isArray(e)){var o=e.length;for(l=0;l<o;l++)e[l]&&(r=lv(e[l]))&&(i&&(i+=" "),i+=r)}else for(r in e)e[r]&&(i&&(i+=" "),i+=r);return i}function rv(){for(var e,l,r=0,i="",o=arguments.length;r<o;r++)(e=arguments[r])&&(l=lv(e))&&(i&&(i+=" "),i+=l);return i}const Bb=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,Ib=rv,av=(e,l)=>r=>{var i;if(l?.variants==null)return Ib(e,r?.class,r?.className);const{variants:o,defaultVariants:u}=l,d=Object.keys(o).map(h=>{const y=r?.[h],g=u?.[h];if(y===null)return null;const v=Bb(y)||Bb(g);return o[h][v]}),f=r&&Object.entries(r).reduce((h,y)=>{let[g,v]=y;return v===void 0||(h[g]=v),h},{}),p=l==null||(i=l.compoundVariants)===null||i===void 0?void 0:i.reduce((h,y)=>{let{class:g,className:v,...k}=y;return Object.entries(k).every(S=>{let[A,N]=S;return Array.isArray(N)?N.includes({...u,...f}[A]):{...u,...f}[A]===N})?[...h,g,v]:h},[]);return Ib(e,d,p,r?.class,r?.className)},cS=(e,l)=>{const r=new Array(e.length+l.length);for(let i=0;i<e.length;i++)r[i]=e[i];for(let i=0;i<l.length;i++)r[e.length+i]=l[i];return r},uS=(e,l)=>({classGroupId:e,validator:l}),iv=(e=new Map,l=null,r)=>({nextPart:e,validators:l,classGroupId:r}),Ou="-",Pb=[],dS="arbitrary..",fS=e=>{const l=pS(e),{conflictingClassGroups:r,conflictingClassGroupModifiers:i}=e;return{getClassGroupId:d=>{if(d.startsWith("[")&&d.endsWith("]"))return mS(d);const f=d.split(Ou),p=f[0]===""&&f.length>1?1:0;return sv(f,p,l)},getConflictingClassGroupIds:(d,f)=>{if(f){const p=i[d],h=r[d];return p?h?cS(h,p):p:h||Pb}return r[d]||Pb}}},sv=(e,l,r)=>{if(e.length-l===0)return r.classGroupId;const o=e[l],u=r.nextPart.get(o);if(u){const h=sv(e,l+1,u);if(h)return h}const d=r.validators;if(d===null)return;const f=l===0?e.join(Ou):e.slice(l).join(Ou),p=d.length;for(let h=0;h<p;h++){const y=d[h];if(y.validator(f))return y.classGroupId}},mS=e=>e.slice(1,-1).indexOf(":")===-1?void 0:(()=>{const l=e.slice(1,-1),r=l.indexOf(":"),i=l.slice(0,r);return i?dS+i:void 0})(),pS=e=>{const{theme:l,classGroups:r}=e;return hS(r,l)},hS=(e,l)=>{const r=iv();for(const i in e){const o=e[i];Ip(o,r,i,l)}return r},Ip=(e,l,r,i)=>{const o=e.length;for(let u=0;u<o;u++){const d=e[u];xS(d,l,r,i)}},xS=(e,l,r,i)=>{if(typeof e=="string"){gS(e,l,r);return}if(typeof e=="function"){bS(e,l,r,i);return}yS(e,l,r,i)},gS=(e,l,r)=>{const i=e===""?l:ov(l,e);i.classGroupId=r},bS=(e,l,r,i)=>{if(vS(e)){Ip(e(i),l,r,i);return}l.validators===null&&(l.validators=[]),l.validators.push(uS(r,e))},yS=(e,l,r,i)=>{const o=Object.entries(e),u=o.length;for(let d=0;d<u;d++){const[f,p]=o[d];Ip(p,ov(l,f),r,i)}},ov=(e,l)=>{let r=e;const i=l.split(Ou),o=i.length;for(let u=0;u<o;u++){const d=i[u];let f=r.nextPart.get(d);f||(f=iv(),r.nextPart.set(d,f)),r=f}return r},vS=e=>"isThemeGetter"in e&&e.isThemeGetter===!0,jS=e=>{if(e<1)return{get:()=>{},set:()=>{}};let l=0,r=Object.create(null),i=Object.create(null);const o=(u,d)=>{r[u]=d,l++,l>e&&(l=0,i=r,r=Object.create(null))};return{get(u){let d=r[u];if(d!==void 0)return d;if((d=i[u])!==void 0)return o(u,d),d},set(u,d){u in r?r[u]=d:o(u,d)}}},lp="!",Ub=":",kS=[],Hb=(e,l,r,i,o)=>({modifiers:e,hasImportantModifier:l,baseClassName:r,maybePostfixModifierPosition:i,isExternal:o}),NS=e=>{const{prefix:l,experimentalParseClassName:r}=e;let i=o=>{const u=[];let d=0,f=0,p=0,h;const y=o.length;for(let A=0;A<y;A++){const N=o[A];if(d===0&&f===0){if(N===Ub){u.push(o.slice(p,A)),p=A+1;continue}if(N==="/"){h=A;continue}}N==="["?d++:N==="]"?d--:N==="("?f++:N===")"&&f--}const g=u.length===0?o:o.slice(p);let v=g,k=!1;g.endsWith(lp)?(v=g.slice(0,-1),k=!0):g.startsWith(lp)&&(v=g.slice(1),k=!0);const S=h&&h>p?h-p:void 0;return Hb(u,k,v,S)};if(l){const o=l+Ub,u=i;i=d=>d.startsWith(o)?u(d.slice(o.length)):Hb(kS,!1,d,void 0,!0)}if(r){const o=i;i=u=>r({className:u,parseClassName:o})}return i},wS=e=>{const l=new Map;return e.orderSensitiveModifiers.forEach((r,i)=>{l.set(r,1e6+i)}),r=>{const i=[];let o=[];for(let u=0;u<r.length;u++){const d=r[u],f=d[0]==="[",p=l.has(d);f||p?(o.length>0&&(o.sort(),i.push(...o),o=[]),i.push(d)):o.push(d)}return o.length>0&&(o.sort(),i.push(...o)),i}},SS=e=>({cache:jS(e.cacheSize),parseClassName:NS(e),sortModifiers:wS(e),...fS(e)}),CS=/\s+/,TS=(e,l)=>{const{parseClassName:r,getClassGroupId:i,getConflictingClassGroupIds:o,sortModifiers:u}=l,d=[],f=e.trim().split(CS);let p="";for(let h=f.length-1;h>=0;h-=1){const y=f[h],{isExternal:g,modifiers:v,hasImportantModifier:k,baseClassName:S,maybePostfixModifierPosition:A}=r(y);if(g){p=y+(p.length>0?" "+p:p);continue}let N=!!A,R=i(N?S.substring(0,A):S);if(!R){if(!N){p=y+(p.length>0?" "+p:p);continue}if(R=i(S),!R){p=y+(p.length>0?" "+p:p);continue}N=!1}const L=v.length===0?"":v.length===1?v[0]:u(v).join(":"),H=k?L+lp:L,X=H+R;if(d.indexOf(X)>-1)continue;d.push(X);const V=o(R,N);for(let D=0;D<V.length;++D){const I=V[D];d.push(H+I)}p=y+(p.length>0?" "+p:p)}return p},AS=(...e)=>{let l=0,r,i,o="";for(;l<e.length;)(r=e[l++])&&(i=cv(r))&&(o&&(o+=" "),o+=i);return o},cv=e=>{if(typeof e=="string")return e;let l,r="";for(let i=0;i<e.length;i++)e[i]&&(l=cv(e[i]))&&(r&&(r+=" "),r+=l);return r},ES=(e,...l)=>{let r,i,o,u;const d=p=>{const h=l.reduce((y,g)=>g(y),e());return r=SS(h),i=r.cache.get,o=r.cache.set,u=f,f(p)},f=p=>{const h=i(p);if(h)return h;const y=TS(p,r);return o(p,y),y};return u=d,(...p)=>u(AS(...p))},RS=[],fn=e=>{const l=r=>r[e]||RS;return l.isThemeGetter=!0,l},uv=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,dv=/^\((?:(\w[\w-]*):)?(.+)\)$/i,MS=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,zS=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,OS=/\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$/,LS=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,DS=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,_S=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,fa=e=>MS.test(e),pt=e=>!!e&&!Number.isNaN(Number(e)),ma=e=>!!e&&Number.isInteger(Number(e)),jm=e=>e.endsWith("%")&&pt(e.slice(0,-1)),Er=e=>zS.test(e),fv=()=>!0,BS=e=>OS.test(e)&&!LS.test(e),Pp=()=>!1,IS=e=>DS.test(e),PS=e=>_S.test(e),US=e=>!Ie(e)&&!Pe(e),HS=e=>ba(e,hv,Pp),Ie=e=>uv.test(e),Wa=e=>ba(e,xv,BS),Fb=e=>ba(e,XS,pt),FS=e=>ba(e,bv,fv),qS=e=>ba(e,gv,Pp),qb=e=>ba(e,mv,Pp),VS=e=>ba(e,pv,PS),su=e=>ba(e,yv,IS),Pe=e=>dv.test(e),mo=e=>ai(e,xv),$S=e=>ai(e,gv),Vb=e=>ai(e,mv),GS=e=>ai(e,hv),YS=e=>ai(e,pv),ou=e=>ai(e,yv,!0),QS=e=>ai(e,bv,!0),ba=(e,l,r)=>{const i=uv.exec(e);return i?i[1]?l(i[1]):r(i[2]):!1},ai=(e,l,r=!1)=>{const i=dv.exec(e);return i?i[1]?l(i[1]):r:!1},mv=e=>e==="position"||e==="percentage",pv=e=>e==="image"||e==="url",hv=e=>e==="length"||e==="size"||e==="bg-size",xv=e=>e==="length",XS=e=>e==="number",gv=e=>e==="family-name",bv=e=>e==="number"||e==="weight",yv=e=>e==="shadow",KS=()=>{const e=fn("color"),l=fn("font"),r=fn("text"),i=fn("font-weight"),o=fn("tracking"),u=fn("leading"),d=fn("breakpoint"),f=fn("container"),p=fn("spacing"),h=fn("radius"),y=fn("shadow"),g=fn("inset-shadow"),v=fn("text-shadow"),k=fn("drop-shadow"),S=fn("blur"),A=fn("perspective"),N=fn("aspect"),R=fn("ease"),L=fn("animate"),H=()=>["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"],V=()=>[...X(),Pe,Ie],D=()=>["auto","hidden","clip","visible","scroll"],I=()=>["auto","contain","none"],F=()=>[Pe,Ie,p],ne=()=>[fa,"full","auto",...F()],O=()=>[ma,"none","subgrid",Pe,Ie],P=()=>["auto",{span:["full",ma,Pe,Ie]},ma,Pe,Ie],Q=()=>[ma,"auto",Pe,Ie],oe=()=>["auto","min","max","fr",Pe,Ie],W=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],J=()=>["start","end","center","stretch","center-safe","end-safe"],w=()=>["auto",...F()],Y=()=>[fa,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...F()],G=()=>[fa,"screen","full","dvw","lvw","svw","min","max","fit",...F()],ve=()=>[fa,"screen","full","lh","dvh","lvh","svh","min","max","fit",...F()],T=()=>[e,Pe,Ie],B=()=>[...X(),Vb,qb,{position:[Pe,Ie]}],le=()=>["no-repeat",{repeat:["","x","y","space","round"]}],M=()=>["auto","cover","contain",GS,HS,{size:[Pe,Ie]}],pe=()=>[jm,mo,Wa],ge=()=>["","none","full",h,Pe,Ie],ce=()=>["",pt,mo,Wa],Re=()=>["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"],Ne=()=>[pt,jm,Vb,qb],Ve=()=>["","none",S,Pe,Ie],_e=()=>["none",pt,Pe,Ie],Fe=()=>["none",pt,Pe,Ie],it=()=>[pt,Pe,Ie],rt=()=>[fa,"full",...F()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[Er],breakpoint:[Er],color:[fv],container:[Er],"drop-shadow":[Er],ease:["in","out","in-out"],font:[US],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[Er],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[Er],shadow:[Er],spacing:["px",pt],text:[Er],"text-shadow":[Er],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",fa,Ie,Pe,N]}],container:["container"],columns:[{columns:[pt,Ie,Pe,f]}],"break-after":[{"break-after":H()}],"break-before":[{"break-before":H()}],"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:V()}],overflow:[{overflow:D()}],"overflow-x":[{"overflow-x":D()}],"overflow-y":[{"overflow-y":D()}],overscroll:[{overscroll:I()}],"overscroll-x":[{"overscroll-x":I()}],"overscroll-y":[{"overscroll-y":I()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:ne()}],"inset-x":[{"inset-x":ne()}],"inset-y":[{"inset-y":ne()}],start:[{"inset-s":ne(),start:ne()}],end:[{"inset-e":ne(),end:ne()}],"inset-bs":[{"inset-bs":ne()}],"inset-be":[{"inset-be":ne()}],top:[{top:ne()}],right:[{right:ne()}],bottom:[{bottom:ne()}],left:[{left:ne()}],visibility:["visible","invisible","collapse"],z:[{z:[ma,"auto",Pe,Ie]}],basis:[{basis:[fa,"full","auto",f,...F()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[pt,fa,"auto","initial","none",Ie]}],grow:[{grow:["",pt,Pe,Ie]}],shrink:[{shrink:["",pt,Pe,Ie]}],order:[{order:[ma,"first","last","none",Pe,Ie]}],"grid-cols":[{"grid-cols":O()}],"col-start-end":[{col:P()}],"col-start":[{"col-start":Q()}],"col-end":[{"col-end":Q()}],"grid-rows":[{"grid-rows":O()}],"row-start-end":[{row:P()}],"row-start":[{"row-start":Q()}],"row-end":[{"row-end":Q()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":oe()}],"auto-rows":[{"auto-rows":oe()}],gap:[{gap:F()}],"gap-x":[{"gap-x":F()}],"gap-y":[{"gap-y":F()}],"justify-content":[{justify:[...W(),"normal"]}],"justify-items":[{"justify-items":[...J(),"normal"]}],"justify-self":[{"justify-self":["auto",...J()]}],"align-content":[{content:["normal",...W()]}],"align-items":[{items:[...J(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...J(),{baseline:["","last"]}]}],"place-content":[{"place-content":W()}],"place-items":[{"place-items":[...J(),"baseline"]}],"place-self":[{"place-self":["auto",...J()]}],p:[{p:F()}],px:[{px:F()}],py:[{py:F()}],ps:[{ps:F()}],pe:[{pe:F()}],pbs:[{pbs:F()}],pbe:[{pbe:F()}],pt:[{pt:F()}],pr:[{pr:F()}],pb:[{pb:F()}],pl:[{pl:F()}],m:[{m:w()}],mx:[{mx:w()}],my:[{my:w()}],ms:[{ms:w()}],me:[{me:w()}],mbs:[{mbs:w()}],mbe:[{mbe:w()}],mt:[{mt:w()}],mr:[{mr:w()}],mb:[{mb:w()}],ml:[{ml:w()}],"space-x":[{"space-x":F()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":F()}],"space-y-reverse":["space-y-reverse"],size:[{size:Y()}],"inline-size":[{inline:["auto",...G()]}],"min-inline-size":[{"min-inline":["auto",...G()]}],"max-inline-size":[{"max-inline":["none",...G()]}],"block-size":[{block:["auto",...ve()]}],"min-block-size":[{"min-block":["auto",...ve()]}],"max-block-size":[{"max-block":["none",...ve()]}],w:[{w:[f,"screen",...Y()]}],"min-w":[{"min-w":[f,"screen","none",...Y()]}],"max-w":[{"max-w":[f,"screen","none","prose",{screen:[d]},...Y()]}],h:[{h:["screen","lh",...Y()]}],"min-h":[{"min-h":["screen","lh","none",...Y()]}],"max-h":[{"max-h":["screen","lh",...Y()]}],"font-size":[{text:["base",r,mo,Wa]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[i,QS,FS]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",jm,Ie]}],"font-family":[{font:[$S,qS,l]}],"font-features":[{"font-features":[Ie]}],"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:[o,Pe,Ie]}],"line-clamp":[{"line-clamp":[pt,"none",Pe,Fb]}],leading:[{leading:[u,...F()]}],"list-image":[{"list-image":["none",Pe,Ie]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",Pe,Ie]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:T()}],"text-color":[{text:T()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...Re(),"wavy"]}],"text-decoration-thickness":[{decoration:[pt,"from-font","auto",Pe,Wa]}],"text-decoration-color":[{decoration:T()}],"underline-offset":[{"underline-offset":[pt,"auto",Pe,Ie]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:F()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",Pe,Ie]}],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",Pe,Ie]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:B()}],"bg-repeat":[{bg:le()}],"bg-size":[{bg:M()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},ma,Pe,Ie],radial:["",Pe,Ie],conic:[ma,Pe,Ie]},YS,VS]}],"bg-color":[{bg:T()}],"gradient-from-pos":[{from:pe()}],"gradient-via-pos":[{via:pe()}],"gradient-to-pos":[{to:pe()}],"gradient-from":[{from:T()}],"gradient-via":[{via:T()}],"gradient-to":[{to:T()}],rounded:[{rounded:ge()}],"rounded-s":[{"rounded-s":ge()}],"rounded-e":[{"rounded-e":ge()}],"rounded-t":[{"rounded-t":ge()}],"rounded-r":[{"rounded-r":ge()}],"rounded-b":[{"rounded-b":ge()}],"rounded-l":[{"rounded-l":ge()}],"rounded-ss":[{"rounded-ss":ge()}],"rounded-se":[{"rounded-se":ge()}],"rounded-ee":[{"rounded-ee":ge()}],"rounded-es":[{"rounded-es":ge()}],"rounded-tl":[{"rounded-tl":ge()}],"rounded-tr":[{"rounded-tr":ge()}],"rounded-br":[{"rounded-br":ge()}],"rounded-bl":[{"rounded-bl":ge()}],"border-w":[{border:ce()}],"border-w-x":[{"border-x":ce()}],"border-w-y":[{"border-y":ce()}],"border-w-s":[{"border-s":ce()}],"border-w-e":[{"border-e":ce()}],"border-w-bs":[{"border-bs":ce()}],"border-w-be":[{"border-be":ce()}],"border-w-t":[{"border-t":ce()}],"border-w-r":[{"border-r":ce()}],"border-w-b":[{"border-b":ce()}],"border-w-l":[{"border-l":ce()}],"divide-x":[{"divide-x":ce()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":ce()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...Re(),"hidden","none"]}],"divide-style":[{divide:[...Re(),"hidden","none"]}],"border-color":[{border:T()}],"border-color-x":[{"border-x":T()}],"border-color-y":[{"border-y":T()}],"border-color-s":[{"border-s":T()}],"border-color-e":[{"border-e":T()}],"border-color-bs":[{"border-bs":T()}],"border-color-be":[{"border-be":T()}],"border-color-t":[{"border-t":T()}],"border-color-r":[{"border-r":T()}],"border-color-b":[{"border-b":T()}],"border-color-l":[{"border-l":T()}],"divide-color":[{divide:T()}],"outline-style":[{outline:[...Re(),"none","hidden"]}],"outline-offset":[{"outline-offset":[pt,Pe,Ie]}],"outline-w":[{outline:["",pt,mo,Wa]}],"outline-color":[{outline:T()}],shadow:[{shadow:["","none",y,ou,su]}],"shadow-color":[{shadow:T()}],"inset-shadow":[{"inset-shadow":["none",g,ou,su]}],"inset-shadow-color":[{"inset-shadow":T()}],"ring-w":[{ring:ce()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:T()}],"ring-offset-w":[{"ring-offset":[pt,Wa]}],"ring-offset-color":[{"ring-offset":T()}],"inset-ring-w":[{"inset-ring":ce()}],"inset-ring-color":[{"inset-ring":T()}],"text-shadow":[{"text-shadow":["none",v,ou,su]}],"text-shadow-color":[{"text-shadow":T()}],opacity:[{opacity:[pt,Pe,Ie]}],"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":[pt]}],"mask-image-linear-from-pos":[{"mask-linear-from":Ne()}],"mask-image-linear-to-pos":[{"mask-linear-to":Ne()}],"mask-image-linear-from-color":[{"mask-linear-from":T()}],"mask-image-linear-to-color":[{"mask-linear-to":T()}],"mask-image-t-from-pos":[{"mask-t-from":Ne()}],"mask-image-t-to-pos":[{"mask-t-to":Ne()}],"mask-image-t-from-color":[{"mask-t-from":T()}],"mask-image-t-to-color":[{"mask-t-to":T()}],"mask-image-r-from-pos":[{"mask-r-from":Ne()}],"mask-image-r-to-pos":[{"mask-r-to":Ne()}],"mask-image-r-from-color":[{"mask-r-from":T()}],"mask-image-r-to-color":[{"mask-r-to":T()}],"mask-image-b-from-pos":[{"mask-b-from":Ne()}],"mask-image-b-to-pos":[{"mask-b-to":Ne()}],"mask-image-b-from-color":[{"mask-b-from":T()}],"mask-image-b-to-color":[{"mask-b-to":T()}],"mask-image-l-from-pos":[{"mask-l-from":Ne()}],"mask-image-l-to-pos":[{"mask-l-to":Ne()}],"mask-image-l-from-color":[{"mask-l-from":T()}],"mask-image-l-to-color":[{"mask-l-to":T()}],"mask-image-x-from-pos":[{"mask-x-from":Ne()}],"mask-image-x-to-pos":[{"mask-x-to":Ne()}],"mask-image-x-from-color":[{"mask-x-from":T()}],"mask-image-x-to-color":[{"mask-x-to":T()}],"mask-image-y-from-pos":[{"mask-y-from":Ne()}],"mask-image-y-to-pos":[{"mask-y-to":Ne()}],"mask-image-y-from-color":[{"mask-y-from":T()}],"mask-image-y-to-color":[{"mask-y-to":T()}],"mask-image-radial":[{"mask-radial":[Pe,Ie]}],"mask-image-radial-from-pos":[{"mask-radial-from":Ne()}],"mask-image-radial-to-pos":[{"mask-radial-to":Ne()}],"mask-image-radial-from-color":[{"mask-radial-from":T()}],"mask-image-radial-to-color":[{"mask-radial-to":T()}],"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":[pt]}],"mask-image-conic-from-pos":[{"mask-conic-from":Ne()}],"mask-image-conic-to-pos":[{"mask-conic-to":Ne()}],"mask-image-conic-from-color":[{"mask-conic-from":T()}],"mask-image-conic-to-color":[{"mask-conic-to":T()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:B()}],"mask-repeat":[{mask:le()}],"mask-size":[{mask:M()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",Pe,Ie]}],filter:[{filter:["","none",Pe,Ie]}],blur:[{blur:Ve()}],brightness:[{brightness:[pt,Pe,Ie]}],contrast:[{contrast:[pt,Pe,Ie]}],"drop-shadow":[{"drop-shadow":["","none",k,ou,su]}],"drop-shadow-color":[{"drop-shadow":T()}],grayscale:[{grayscale:["",pt,Pe,Ie]}],"hue-rotate":[{"hue-rotate":[pt,Pe,Ie]}],invert:[{invert:["",pt,Pe,Ie]}],saturate:[{saturate:[pt,Pe,Ie]}],sepia:[{sepia:["",pt,Pe,Ie]}],"backdrop-filter":[{"backdrop-filter":["","none",Pe,Ie]}],"backdrop-blur":[{"backdrop-blur":Ve()}],"backdrop-brightness":[{"backdrop-brightness":[pt,Pe,Ie]}],"backdrop-contrast":[{"backdrop-contrast":[pt,Pe,Ie]}],"backdrop-grayscale":[{"backdrop-grayscale":["",pt,Pe,Ie]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[pt,Pe,Ie]}],"backdrop-invert":[{"backdrop-invert":["",pt,Pe,Ie]}],"backdrop-opacity":[{"backdrop-opacity":[pt,Pe,Ie]}],"backdrop-saturate":[{"backdrop-saturate":[pt,Pe,Ie]}],"backdrop-sepia":[{"backdrop-sepia":["",pt,Pe,Ie]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":F()}],"border-spacing-x":[{"border-spacing-x":F()}],"border-spacing-y":[{"border-spacing-y":F()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",Pe,Ie]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[pt,"initial",Pe,Ie]}],ease:[{ease:["linear","initial",R,Pe,Ie]}],delay:[{delay:[pt,Pe,Ie]}],animate:[{animate:["none",L,Pe,Ie]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[A,Pe,Ie]}],"perspective-origin":[{"perspective-origin":V()}],rotate:[{rotate:_e()}],"rotate-x":[{"rotate-x":_e()}],"rotate-y":[{"rotate-y":_e()}],"rotate-z":[{"rotate-z":_e()}],scale:[{scale:Fe()}],"scale-x":[{"scale-x":Fe()}],"scale-y":[{"scale-y":Fe()}],"scale-z":[{"scale-z":Fe()}],"scale-3d":["scale-3d"],skew:[{skew:it()}],"skew-x":[{"skew-x":it()}],"skew-y":[{"skew-y":it()}],transform:[{transform:[Pe,Ie,"","none","gpu","cpu"]}],"transform-origin":[{origin:V()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:rt()}],"translate-x":[{"translate-x":rt()}],"translate-y":[{"translate-y":rt()}],"translate-z":[{"translate-z":rt()}],"translate-none":["translate-none"],accent:[{accent:T()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:T()}],"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",Pe,Ie]}],"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":F()}],"scroll-mx":[{"scroll-mx":F()}],"scroll-my":[{"scroll-my":F()}],"scroll-ms":[{"scroll-ms":F()}],"scroll-me":[{"scroll-me":F()}],"scroll-mbs":[{"scroll-mbs":F()}],"scroll-mbe":[{"scroll-mbe":F()}],"scroll-mt":[{"scroll-mt":F()}],"scroll-mr":[{"scroll-mr":F()}],"scroll-mb":[{"scroll-mb":F()}],"scroll-ml":[{"scroll-ml":F()}],"scroll-p":[{"scroll-p":F()}],"scroll-px":[{"scroll-px":F()}],"scroll-py":[{"scroll-py":F()}],"scroll-ps":[{"scroll-ps":F()}],"scroll-pe":[{"scroll-pe":F()}],"scroll-pbs":[{"scroll-pbs":F()}],"scroll-pbe":[{"scroll-pbe":F()}],"scroll-pt":[{"scroll-pt":F()}],"scroll-pr":[{"scroll-pr":F()}],"scroll-pb":[{"scroll-pb":F()}],"scroll-pl":[{"scroll-pl":F()}],"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",Pe,Ie]}],fill:[{fill:["none",...T()]}],"stroke-w":[{stroke:[pt,mo,Wa,Fb]}],stroke:[{stroke:["none",...T()]}],"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"]}},ZS=ES(KS);function Cn(...e){return ZS(rv(e))}const WS=av("inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-all disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4 shrink-0 [&_svg]:shrink-0 outline-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive",{variants:{variant:{default:"bg-primary text-primary-foreground hover:bg-primary/90",destructive:"bg-destructive text-white hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/60",outline:"border bg-background shadow-xs hover:bg-accent hover:text-accent-foreground dark:bg-input/30 dark:border-input dark:hover:bg-input/50",secondary:"bg-secondary text-secondary-foreground hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground dark:hover:bg-accent/50",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-9 px-4 py-2 has-[>svg]:px-3",sm:"h-8 rounded-md gap-1.5 px-3 has-[>svg]:px-2.5",lg:"h-10 rounded-md px-6 has-[>svg]:px-4",icon:"size-9","icon-sm":"size-8","icon-lg":"size-10"}},defaultVariants:{variant:"default",size:"default"}});function Tt({className:e,variant:l,size:r,asChild:i=!1,...o}){const u=i?nv:"button";return a.jsx(u,{"data-slot":"button",className:Cn(WS({variant:l,size:r,className:e})),...o})}function zr(e,l,{checkForDefaultPrevented:r=!0}={}){return function(o){if(e?.(o),r===!1||!o.defaultPrevented)return l?.(o)}}function JS(e,l){const r=E.createContext(l),i=u=>{const{children:d,...f}=u,p=E.useMemo(()=>f,Object.values(f));return a.jsx(r.Provider,{value:p,children:d})};i.displayName=e+"Provider";function o(u){const d=E.useContext(r);if(d)return d;if(l!==void 0)return l;throw new Error(`\`${u}\` must be used within \`${e}\``)}return[i,o]}function vv(e,l=[]){let r=[];function i(u,d){const f=E.createContext(d),p=r.length;r=[...r,d];const h=g=>{const{scope:v,children:k,...S}=g,A=v?.[e]?.[p]||f,N=E.useMemo(()=>S,Object.values(S));return a.jsx(A.Provider,{value:N,children:k})};h.displayName=u+"Provider";function y(g,v){const k=v?.[e]?.[p]||f,S=E.useContext(k);if(S)return S;if(d!==void 0)return d;throw new Error(`\`${g}\` must be used within \`${u}\``)}return[h,y]}const o=()=>{const u=r.map(d=>E.createContext(d));return function(f){const p=f?.[e]||u;return E.useMemo(()=>({[`__scope${e}`]:{...f,[e]:p}}),[f,p])}};return o.scopeName=e,[i,eC(o,...l)]}function eC(...e){const l=e[0];if(e.length===1)return l;const r=()=>{const i=e.map(o=>({useScope:o(),scopeName:o.scopeName}));return function(u){const d=i.reduce((f,{useScope:p,scopeName:h})=>{const g=p(u)[`__scope${h}`];return{...f,...g}},{});return E.useMemo(()=>({[`__scope${l.scopeName}`]:d}),[d])}};return r.scopeName=l.scopeName,r}var is=globalThis?.document?E.useLayoutEffect:()=>{},tC=Hu[" useInsertionEffect ".trim().toString()]||is;function jv({prop:e,defaultProp:l,onChange:r=()=>{},caller:i}){const[o,u,d]=nC({defaultProp:l,onChange:r}),f=e!==void 0,p=f?e:o;{const y=E.useRef(e!==void 0);E.useEffect(()=>{const g=y.current;g!==f&&console.warn(`${i} is changing from ${g?"controlled":"uncontrolled"} to ${f?"controlled":"uncontrolled"}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`),y.current=f},[f,i])}const h=E.useCallback(y=>{if(f){const g=lC(y)?y(e):y;g!==e&&d.current?.(g)}else u(y)},[f,e,u,d]);return[p,h]}function nC({defaultProp:e,onChange:l}){const[r,i]=E.useState(e),o=E.useRef(r),u=E.useRef(l);return tC(()=>{u.current=l},[l]),E.useEffect(()=>{o.current!==r&&(u.current?.(r),o.current=r)},[r,o]),[r,i,u]}function lC(e){return typeof e=="function"}function kv(e){const l=rC(e),r=E.forwardRef((i,o)=>{const{children:u,...d}=i,f=E.Children.toArray(u),p=f.find(iC);if(p){const h=p.props.children,y=f.map(g=>g===p?E.Children.count(h)>1?E.Children.only(null):E.isValidElement(h)?h.props.children:null:g);return a.jsx(l,{...d,ref:o,children:E.isValidElement(h)?E.cloneElement(h,void 0,y):null})}return a.jsx(l,{...d,ref:o,children:u})});return r.displayName=`${e}.Slot`,r}function rC(e){const l=E.forwardRef((r,i)=>{const{children:o,...u}=r;if(E.isValidElement(o)){const d=oC(o),f=sC(u,o.props);return o.type!==E.Fragment&&(f.ref=i?Bp(i,d):d),E.cloneElement(o,f)}return E.Children.count(o)>1?E.Children.only(null):null});return l.displayName=`${e}.SlotClone`,l}var aC=Symbol("radix.slottable");function iC(e){return E.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===aC}function sC(e,l){const r={...l};for(const i in l){const o=e[i],u=l[i];/^on[A-Z]/.test(i)?o&&u?r[i]=(...f)=>{const p=u(...f);return o(...f),p}:o&&(r[i]=o):i==="style"?r[i]={...o,...u}:i==="className"&&(r[i]=[o,u].filter(Boolean).join(" "))}return{...e,...r}}function oC(e){let l=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,r=l&&"isReactWarning"in l&&l.isReactWarning;return r?e.ref:(l=Object.getOwnPropertyDescriptor(e,"ref")?.get,r=l&&"isReactWarning"in l&&l.isReactWarning,r?e.props.ref:e.props.ref||e.ref)}var cC=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Cl=cC.reduce((e,l)=>{const r=kv(`Primitive.${l}`),i=E.forwardRef((o,u)=>{const{asChild:d,...f}=o,p=d?r:l;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),a.jsx(p,{...f,ref:u})});return i.displayName=`Primitive.${l}`,{...e,[l]:i}},{});function uC(e,l){e&&y1.flushSync(()=>e.dispatchEvent(l))}function dC(e,l){return E.useReducer((r,i)=>l[r][i]??r,e)}var Oo=e=>{const{present:l,children:r}=e,i=fC(l),o=typeof r=="function"?r({present:i.isPresent}):E.Children.only(r),u=ga(i.ref,mC(o));return typeof r=="function"||i.isPresent?E.cloneElement(o,{ref:u}):null};Oo.displayName="Presence";function fC(e){const[l,r]=E.useState(),i=E.useRef(null),o=E.useRef(e),u=E.useRef("none"),d=e?"mounted":"unmounted",[f,p]=dC(d,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return E.useEffect(()=>{const h=cu(i.current);u.current=f==="mounted"?h:"none"},[f]),is(()=>{const h=i.current,y=o.current;if(y!==e){const v=u.current,k=cu(h);e?p("MOUNT"):k==="none"||h?.display==="none"?p("UNMOUNT"):p(y&&v!==k?"ANIMATION_OUT":"UNMOUNT"),o.current=e}},[e,p]),is(()=>{if(l){let h;const y=l.ownerDocument.defaultView??window,g=k=>{const A=cu(i.current).includes(CSS.escape(k.animationName));if(k.target===l&&A&&(p("ANIMATION_END"),!o.current)){const N=l.style.animationFillMode;l.style.animationFillMode="forwards",h=y.setTimeout(()=>{l.style.animationFillMode==="forwards"&&(l.style.animationFillMode=N)})}},v=k=>{k.target===l&&(u.current=cu(i.current))};return l.addEventListener("animationstart",v),l.addEventListener("animationcancel",g),l.addEventListener("animationend",g),()=>{y.clearTimeout(h),l.removeEventListener("animationstart",v),l.removeEventListener("animationcancel",g),l.removeEventListener("animationend",g)}}else p("ANIMATION_END")},[l,p]),{isPresent:["mounted","unmountSuspended"].includes(f),ref:E.useCallback(h=>{i.current=h?getComputedStyle(h):null,r(h)},[])}}function cu(e){return e?.animationName||"none"}function mC(e){let l=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,r=l&&"isReactWarning"in l&&l.isReactWarning;return r?e.ref:(l=Object.getOwnPropertyDescriptor(e,"ref")?.get,r=l&&"isReactWarning"in l&&l.isReactWarning,r?e.props.ref:e.props.ref||e.ref)}var pC=Hu[" useId ".trim().toString()]||(()=>{}),hC=0;function Nu(e){const[l,r]=E.useState(pC());return is(()=>{r(i=>i??String(hC++))},[e]),e||(l?`radix-${l}`:"")}var qu="Collapsible",[xC]=vv(qu),[gC,Up]=xC(qu),Nv=E.forwardRef((e,l)=>{const{__scopeCollapsible:r,open:i,defaultOpen:o,disabled:u,onOpenChange:d,...f}=e,[p,h]=jv({prop:i,defaultProp:o??!1,onChange:d,caller:qu});return a.jsx(gC,{scope:r,disabled:u,contentId:Nu(),open:p,onOpenToggle:E.useCallback(()=>h(y=>!y),[h]),children:a.jsx(Cl.div,{"data-state":Fp(p),"data-disabled":u?"":void 0,...f,ref:l})})});Nv.displayName=qu;var wv="CollapsibleTrigger",Sv=E.forwardRef((e,l)=>{const{__scopeCollapsible:r,...i}=e,o=Up(wv,r);return a.jsx(Cl.button,{type:"button","aria-controls":o.contentId,"aria-expanded":o.open||!1,"data-state":Fp(o.open),"data-disabled":o.disabled?"":void 0,disabled:o.disabled,...i,ref:l,onClick:zr(e.onClick,o.onOpenToggle)})});Sv.displayName=wv;var Hp="CollapsibleContent",Cv=E.forwardRef((e,l)=>{const{forceMount:r,...i}=e,o=Up(Hp,e.__scopeCollapsible);return a.jsx(Oo,{present:r||o.open,children:({present:u})=>a.jsx(bC,{...i,ref:l,present:u})})});Cv.displayName=Hp;var bC=E.forwardRef((e,l)=>{const{__scopeCollapsible:r,present:i,children:o,...u}=e,d=Up(Hp,r),[f,p]=E.useState(i),h=E.useRef(null),y=ga(l,h),g=E.useRef(0),v=g.current,k=E.useRef(0),S=k.current,A=d.open||f,N=E.useRef(A),R=E.useRef(void 0);return E.useEffect(()=>{const L=requestAnimationFrame(()=>N.current=!1);return()=>cancelAnimationFrame(L)},[]),is(()=>{const L=h.current;if(L){R.current=R.current||{transitionDuration:L.style.transitionDuration,animationName:L.style.animationName},L.style.transitionDuration="0s",L.style.animationName="none";const H=L.getBoundingClientRect();g.current=H.height,k.current=H.width,N.current||(L.style.transitionDuration=R.current.transitionDuration,L.style.animationName=R.current.animationName),p(i)}},[d.open,i]),a.jsx(Cl.div,{"data-state":Fp(d.open),"data-disabled":d.disabled?"":void 0,id:d.contentId,hidden:!A,...u,ref:y,style:{"--radix-collapsible-content-height":v?`${v}px`:void 0,"--radix-collapsible-content-width":S?`${S}px`:void 0,...e.style},children:A&&o})});function Fp(e){return e?"open":"closed"}var yC=Nv;function wu({...e}){return a.jsx(yC,{"data-slot":"collapsible",...e})}function Su({...e}){return a.jsx(Sv,{"data-slot":"collapsible-trigger",...e})}function Cu({...e}){return a.jsx(Cv,{"data-slot":"collapsible-content",...e})}const b={bg:"var(--os-bg)",surface:"var(--os-surface)",border:"var(--os-border)",ink:"var(--os-ink)",muted:"var(--os-muted)",accent:"var(--os-accent)",accentBg:"var(--os-accent-bg)",accentBorder:"var(--os-accent-border)",tagBg:"var(--os-tag-bg)",logoBg:"var(--os-logo-bg)",logoBorder:"var(--os-logo-border)",termBg:"var(--os-terminal-bg)",termFg:"var(--os-terminal-fg)",markBg:"var(--os-mark-bg)",markFg:"var(--os-mark-fg)",radiusXs:"var(--os-radius-xs)",radiusSm:"var(--os-radius-sm)",radiusMd:"var(--os-radius-md)",radiusLg:"var(--os-radius-lg)",radiusXl:"var(--os-radius-xl)",shadowXs:"var(--os-shadow-xs)",shadowSm:"var(--os-shadow-sm)",shadowMd:"var(--os-shadow-md)",shadowLg:"var(--os-shadow-lg)"};function vC({pairingControlPending:e,pairingApprovalPendingId:l,pairingConfigFeedback:r,pairingConfigPending:i,pairingError:o,pairingLoading:u,pairingState:d,onControlPairing:f,onDecideApproval:p,onOpenFeedback:h,onOpenFullLogs:y,onUpdateConfig:g,onRefresh:v,onRevealPath:k}){const[S,A]=E.useState(null),[N,R]=E.useState(""),[L,H]=E.useState(""),[X,V]=E.useState(!1),[D,I]=E.useState(!1),[F,ne]=E.useState(()=>Date.now()),[O,P]=E.useState(!1),[Q,oe]=E.useState(!1),[W,J]=E.useState(!1),w=E.useRef(null),Y=E.useRef(null),G=E.useMemo(()=>{const Me=d?.pairing?.qrValue;return Me?R2(Me,{border:2,ecc:"M",pixelSize:O?12:6,blackColor:"#111111",whiteColor:"#ffffff"}):null},[d?.pairing?.qrValue,O]),ve=d?.pairing?Math.max(0,Math.floor((d.pairing.expiresAt-F)/1e3)):null,T=!!d?.isRunning,B=d?.trustedPeers??[],le=d?.pendingApprovals??[],M=B.find(Me=>Me.fingerprint===d?.connectedPeerFingerprint)??null,pe=d?.status==="paired"&&!!d?.connectedPeerFingerprint,ge=d?.pairing?.relay??d?.relay??null,ce=d?.status==="paired"||d?.status==="connected"||d?.status==="connecting"?{label:"Relay Active",backgroundColor:"#ecfdf3",borderColor:"#bbf7d0",color:"#15803d"}:d?.status==="error"||d?.status==="closed"?{label:"Attention",backgroundColor:"#fff1f2",borderColor:"#fecdd3",color:"#be123c"}:{label:"Ready",backgroundColor:"#eff6ff",borderColor:"#bfdbfe",color:"#1d4ed8"},Re=d?.status==="paired"?{backgroundColor:"#ecfdf3",borderColor:"#bbf7d0",color:"#15803d"}:d?.status==="error"||d?.status==="closed"?{backgroundColor:"#fff1f2",borderColor:"#fecdd3",color:"#be123c"}:{backgroundColor:"#eff6ff",borderColor:"#bfdbfe",color:"#1d4ed8"},Se={backgroundColor:"#ffffff",borderColor:"rgba(15, 23, 42, 0.08)",boxShadow:"0 1px 2px rgba(15, 23, 42, 0.04)"},Ne={backgroundColor:"#f7f8fb",borderColor:"rgba(15, 23, 42, 0.08)"},Ve={backgroundColor:"#fbfbfd",borderColor:"rgba(15, 23, 42, 0.06)"},_e=d?.commandLabel??"scout pair",Fe=pe?"Device Connected":d?.pairing?"Pairing Ready":d?.status==="error"||d?.status==="closed"?d.statusLabel:T?d?.statusLabel??"Running":"Ready to Start",it=o??(pe?`${km(M)} is connected through the pairing relay.`:null)??d?.statusDetail??"Start Pairing to launch a local pairing relay, generate a fresh QR code, and wait for your phone to connect.",rt=[["Expires In",ve!==null?$b(ve):"—"],["Secure Mode",d?.secure?"Yes":"No"],["Active Sessions",`${d?.sessionCount??0}`],["Trusted Peers",`${d?.trustedPeerCount??0}`],["Last Updated",d?.lastUpdatedLabel??"—"]],ut=[["Relay",ge??"Not set"],["Client ID",d?.identityFingerprint??"Not created"],["Room",d?.pairing?.room??"Pending"],["Connected Device",pe?km(M):"None"]],st=a.jsxs(a.Fragment,{children:[a.jsxs("span",{className:"inline-flex items-center gap-2 rounded-full border px-3 py-1 text-[10px] font-medium",style:ce,children:[a.jsx("span",{className:`block h-1.5 w-1.5 rounded-full ${T?"bg-emerald-500":d?.status==="error"?"bg-rose-500":"bg-zinc-400"}`}),ce.label]}),a.jsx("button",{type:"button",onClick:h,className:"text-[12px] font-medium transition-opacity hover:opacity-70",style:{color:b.muted},children:"Feedback"}),a.jsx("button",{type:"button",onClick:()=>{J(!0),window.setTimeout(()=>{w.current?.scrollIntoView({behavior:"smooth",block:"start"})},0)},className:"text-[12px] font-medium transition-opacity hover:opacity-70",style:{color:b.muted},children:"Logs"}),a.jsx("button",{type:"button",onClick:()=>{oe(!0),window.setTimeout(()=>{Y.current?.scrollIntoView({behavior:"smooth",block:"start"})},0)},className:"text-[12px] font-medium transition-opacity hover:opacity-70",style:{color:b.muted},children:"Advanced"})]}),vt=z.useCallback(async(Me,ot)=>{try{await navigator.clipboard.writeText(ot),A(Me),window.setTimeout(()=>{A(Ce=>Ce===Me?null:Ce)},1200)}catch{A(null)}},[]),Ke=z.useCallback(async()=>{try{await g({relay:N,workspaceRoot:L||null}),I(!1),V(!1)}catch{}},[g,N,L]);E.useEffect(()=>{D||(R(d?.configuredRelay??""),H(d?.workspaceRoot??""))},[D,d?.configuredRelay,d?.workspaceRoot]);const Ye=E.useRef(f);E.useEffect(()=>{Ye.current=f},[f]);const et=E.useRef(!1);return E.useEffect(()=>{if(!d?.pairing?.expiresAt)return;et.current=!1,ne(Date.now());const Me=window.setInterval(()=>{const ot=Date.now();ne(ot),!et.current&&ot>=d.pairing.expiresAt&&(et.current=!0,Ye.current("restart"))},1e3);return()=>{window.clearInterval(Me)}},[d?.pairing?.expiresAt]),a.jsx("div",{className:"flex flex-1 overflow-hidden os-fade-in",style:{backgroundColor:b.bg},children:a.jsx("div",{className:"flex-1 overflow-y-auto",children:a.jsx("div",{className:"px-8 py-10",style:{backgroundColor:"#FAFAFA"},children:a.jsxs("div",{className:"mx-auto flex max-w-[980px] flex-col gap-8",children:[a.jsxs("div",{className:"sticky top-0 z-10 -mx-8 flex items-center justify-between gap-6 border-b px-8 py-4 backdrop-blur",style:{borderBottomColor:b.border,backgroundColor:"rgba(250,250,250,0.92)"},children:[a.jsxs("div",{className:"flex items-center gap-3",children:[a.jsx("div",{className:"flex h-8 w-8 items-center justify-center rounded-lg",style:{backgroundColor:"#4f46e5",color:"#ffffff"},children:a.jsx(Wm,{size:15,strokeWidth:1.6})}),a.jsx("div",{className:"text-[18px] font-medium tracking-tight",style:{color:b.ink},children:"Pairing Relay"})]}),a.jsx("div",{className:"flex items-center gap-4",children:st})]}),a.jsxs("div",{className:"grid gap-5 lg:grid-cols-[minmax(0,1.45fr)_320px] items-start",children:[a.jsxs("div",{className:"flex flex-col gap-5",children:[a.jsxs("section",{className:"rounded-[20px] border p-5",style:Se,children:[a.jsxs("div",{className:"flex items-start justify-between gap-4",children:[a.jsxs("div",{children:[a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsxs("span",{className:"inline-flex items-center gap-2 text-[17px] font-medium tracking-tight",style:{color:b.ink},children:[a.jsx(Op,{size:15,style:{color:"#9ca3af"},strokeWidth:1.5}),"Pairing Status"]}),a.jsxs("span",{className:"inline-flex items-center gap-1.5 rounded-md border px-2.5 py-1 text-[11px] font-normal uppercase tracking-wide",style:Re,children:[!T&&(d?.status==="error"||d?.status==="closed")?a.jsx(Rp,{size:13,strokeWidth:1.5}):null,Fe]})]}),a.jsx("p",{className:"mt-3 text-[15px] leading-[1.75] font-light",style:{color:b.muted},children:it}),d?.statusDetail&&(d.status==="error"||d.status==="closed")?a.jsx("div",{className:"mt-4 rounded-2xl border px-4 py-3 text-[12px] leading-[1.7] font-mono whitespace-pre-wrap break-words",style:{backgroundColor:"#fff1f2",borderColor:"#fecdd3",color:"#9f1239"},children:d.statusDetail}):null]}),a.jsxs(Tt,{type:"button",variant:"outline",size:"sm",onClick:v,disabled:e||u,children:[a.jsx(gn,{size:14}),"Refresh"]})]}),a.jsx("div",{className:"mt-5 grid gap-3 sm:grid-cols-2 xl:grid-cols-5",children:rt.map(([Me,ot])=>a.jsxs("div",{className:"rounded-2xl border px-3 py-3",style:Ne,children:[a.jsx("div",{className:"text-[9px] font-mono uppercase tracking-[0.16em]",style:{color:b.muted},children:Me}),a.jsx("div",{className:"mt-2 text-[14px] font-medium tracking-tight",style:{color:b.ink},children:ot})]},Me))})]}),a.jsxs("section",{className:"rounded-[20px] border p-5",style:Se,children:[a.jsxs("div",{className:"flex items-start justify-between gap-4",children:[a.jsxs("div",{children:[a.jsx("div",{className:"text-[15px] font-medium tracking-tight",style:{color:b.ink},children:"Bridge Details"}),a.jsx("div",{className:"mt-1 text-[11px] font-light",style:{color:b.muted},children:"Relay identity, room state, workspace binding, and control actions."})]}),a.jsxs(Tt,{type:"button",variant:"outline",size:"sm",onClick:()=>{oe(!0),window.setTimeout(()=>{Y.current?.scrollIntoView({behavior:"smooth",block:"start"})},0)},children:[a.jsx(ni,{size:14}),"Advanced"]})]}),a.jsxs("div",{className:"mt-4 overflow-hidden rounded-xl border",style:Ve,children:[ut.map(([Me,ot],Ce)=>a.jsxs("div",{className:"grid gap-2 px-3 py-2.5 md:grid-cols-[112px_minmax(0,1fr)] md:items-start",style:Ce===0?void 0:{borderTop:`1px solid ${b.border}`},children:[a.jsxs("div",{className:"text-[9px] font-mono uppercase tracking-[0.16em]",style:{color:b.muted},children:[Me,":"]}),a.jsx("div",{className:"text-[12px] leading-[1.5] break-words",style:{color:b.ink},children:ot})]},Me)),a.jsxs("div",{className:"grid gap-2 px-3 py-2.5 md:grid-cols-[112px_minmax(0,1fr)_auto] md:items-center",style:{borderTop:`1px solid ${b.border}`},children:[a.jsx("div",{className:"text-[9px] font-mono uppercase tracking-[0.16em]",style:{color:b.muted},children:"Workspace:"}),X?a.jsx("input",{type:"text",value:L,onChange:Me=>{H(Me.target.value),I(!0)},placeholder:"/Users/arach/dev/openscout",className:"w-full rounded-lg border px-2.5 py-1.5 text-[12px] bg-transparent outline-none",style:{borderColor:b.border,color:b.ink}}):a.jsx("div",{className:"text-[12px] leading-[1.5] break-words",style:{color:b.ink},children:d?.workspaceRoot||"Not set"}),a.jsx("div",{className:"flex items-center gap-2 md:justify-end",children:X?a.jsxs(a.Fragment,{children:[a.jsx(Tt,{type:"button",size:"sm",onClick:()=>{Ke()},disabled:i,children:"Save"}),a.jsx(Tt,{type:"button",variant:"outline",size:"sm",onClick:()=>{H(d?.workspaceRoot??""),I(!1),V(!1)},disabled:i,children:"Cancel"})]}):a.jsx("button",{type:"button",onClick:()=>{H(d?.workspaceRoot??""),V(!0)},className:"text-[12px] font-medium transition-opacity hover:opacity-70",style:{color:b.muted},children:"[edit]"})})]}),r?a.jsx("div",{className:"px-4 py-3 text-[11px] leading-[1.6]",style:{borderTop:`1px solid ${b.border}`,color:b.ink},children:r}):null]}),a.jsxs("div",{className:"mt-5 flex flex-wrap items-center gap-2",children:[a.jsx(Tt,{type:"button",size:"sm",onClick:()=>f(T?"stop":"start"),disabled:e,children:T?"Stop Pairing":"Start Pairing"}),T?a.jsx(Tt,{type:"button",variant:"outline",size:"sm",onClick:()=>f("restart"),disabled:e,children:"Restart"}):null]})]}),a.jsxs("section",{className:"rounded-[20px] border p-5",style:Se,children:[a.jsxs("div",{className:"flex items-start justify-between gap-4",children:[a.jsxs("div",{children:[a.jsx("div",{className:"text-[15px] font-medium tracking-tight",style:{color:b.ink},children:"Live Trace"}),a.jsx("div",{className:"mt-1 text-[11px] font-light",style:{color:b.muted},children:"Shared trace cards for live approvals on this node."})]}),a.jsxs("span",{className:"rounded-full border px-2.5 py-1 text-[10px] font-medium whitespace-nowrap",style:le.length>0?{backgroundColor:"#fff7ed",borderColor:"#fed7aa",color:"#c2410c"}:{backgroundColor:"#f8fafc",borderColor:"#e2e8f0",color:"#475569"},children:[le.length," queued"]})]}),a.jsx("div",{className:"mt-4",children:a.jsx(eS,{pendingApprovals:le,pairingApprovalPendingId:l,onDecideApproval:p})})]})]}),a.jsx("div",{children:G?a.jsxs("section",{className:"rounded-[20px] border p-5",style:Se,children:[a.jsxs("div",{className:"flex items-center justify-between gap-3",children:[a.jsxs("div",{children:[a.jsx("div",{className:"text-[15px] font-medium tracking-tight",style:{color:b.ink},children:"Scan QR Code"}),a.jsx("div",{className:"mt-1 text-[11px] font-light",style:{color:b.muted},children:"Point Pairing on your phone at this code."})]}),a.jsx("span",{className:"rounded-full border px-2.5 py-1 text-[10px] font-medium whitespace-nowrap",style:{backgroundColor:"#ecfdf3",borderColor:"#bbf7d0",color:"#15803d"},children:"Ready to Pair"})]}),a.jsx("div",{className:"mt-5 rounded-[22px] border p-4",style:{backgroundColor:"#ffffff",borderColor:"rgba(15, 23, 42, 0.08)"},children:a.jsx("div",{"aria-label":"Pairing pairing QR code",className:`mx-auto w-full ${O?"max-w-[480px]":"max-w-[248px]"}`,dangerouslySetInnerHTML:{__html:G}})}),a.jsxs("div",{className:"mt-4 flex items-center justify-between gap-3 text-[11px] leading-[1.65] font-light",style:{color:b.muted},children:[a.jsx("div",{className:"flex items-center gap-2",children:ve===0?a.jsxs(a.Fragment,{children:[a.jsx("span",{style:{color:"#be123c"},children:"Expired"}),a.jsxs(Tt,{type:"button",variant:"outline",size:"sm",onClick:()=>f("restart"),disabled:e||u,className:"flex items-center gap-1",children:[a.jsx(gn,{size:11}),"Refresh"]})]}):a.jsxs(a.Fragment,{children:["Refreshes in ",a.jsx("span",{style:{color:b.ink},children:ve!==null?$b(ve):"—"})]})}),a.jsx(Tt,{type:"button",variant:"outline",size:"sm",onClick:()=>P(Me=>!Me),children:O?"Compact QR":"Larger QR"})]})]}):a.jsxs("section",{className:"rounded-[20px] border bg-[rgba(250,250,250,0.65)] p-5",style:Se,children:[a.jsx("div",{className:"text-[10px] font-mono uppercase tracking-[0.18em] mb-3",style:{color:b.muted},children:"CLI Equivalent"}),a.jsxs("div",{className:"rounded-2xl border px-3 py-3 flex items-center gap-3",style:Ne,children:[a.jsx("code",{className:"min-w-0 flex-1 truncate text-[11px]",style:{color:b.ink},children:_e}),a.jsx(Tt,{type:"button",variant:"outline",size:"icon-sm",onClick:()=>{vt("command",_e)},children:S==="command"?a.jsx(So,{size:14}):a.jsx(Or,{size:14})})]}),a.jsx("div",{className:"mt-4 text-[11px] leading-[1.6] font-light",style:{color:b.muted},children:a.jsxs("div",{className:"inline-flex items-center gap-1.5",children:[a.jsx(z1,{size:13,strokeWidth:1.5}),"Same backend as the command line, with QR rotation and log access."]})})]})})]}),a.jsxs("section",{className:"rounded-[20px] border p-5",style:Se,children:[a.jsxs("div",{className:"flex items-center justify-between gap-3",children:[a.jsxs("div",{children:[a.jsx("div",{className:"text-[15px] font-medium tracking-tight",style:{color:b.ink},children:"Trusted Devices"}),a.jsx("div",{className:"mt-1 text-[11px] font-light",style:{color:b.muted},children:"Saved phone identities that have paired with this bridge."})]}),a.jsxs("span",{className:"rounded-full border px-2.5 py-1 text-[10px] font-medium whitespace-nowrap",style:pe?{backgroundColor:"#ecfdf3",borderColor:"#bbf7d0",color:"#15803d"}:{backgroundColor:"#f8fafc",borderColor:"#e2e8f0",color:"#475569"},children:[B.length," saved"]})]}),B.length>0?a.jsxs("div",{className:"mt-4 overflow-hidden rounded-xl border",style:Ve,children:[a.jsxs("div",{className:"hidden gap-3 px-4 py-2 text-[9px] font-mono uppercase tracking-[0.16em] md:grid md:grid-cols-[minmax(0,1.8fr)_140px_140px_140px]",style:{color:b.muted},children:[a.jsx("div",{children:"Device"}),a.jsx("div",{children:"Status"}),a.jsx("div",{children:"Last Seen"}),a.jsx("div",{children:"Paired"})]}),B.map((Me,ot)=>{const Ce=Me.fingerprint===d?.connectedPeerFingerprint;return a.jsxs("div",{className:"grid gap-3 px-4 py-3 md:grid-cols-[minmax(0,1.8fr)_140px_140px_140px] md:items-center",style:ot===0?void 0:{borderTop:`1px solid ${b.border}`},children:[a.jsxs("div",{className:"min-w-0",children:[a.jsx("div",{className:"text-[13px] font-medium tracking-tight",style:{color:b.ink},children:km(Me)}),a.jsx("div",{className:"mt-1 truncate text-[11px] font-mono",style:{color:b.muted},children:jC(Me.publicKey)})]}),a.jsx("div",{children:a.jsx("span",{className:"inline-flex rounded-full border px-2 py-1 text-[10px] font-medium whitespace-nowrap",style:Ce?{backgroundColor:"#ecfdf3",borderColor:"#bbf7d0",color:"#15803d"}:{backgroundColor:"#f8fafc",borderColor:"#e2e8f0",color:"#475569"},children:Ce?"Connected now":"Trusted"})}),a.jsx("div",{className:"text-[12px]",style:{color:b.ink},children:Me.lastSeenLabel??"Unknown"}),a.jsx("div",{className:"text-[12px]",style:{color:b.ink},children:Me.pairedAtLabel??"Unknown"})]},Me.publicKey)})]}):a.jsx("div",{className:"mt-4 rounded-2xl border px-4 py-4 text-[12px] leading-[1.7]",style:Ne,children:"No trusted devices yet. Start Pairing and scan the QR code from your phone to add one."})]}),a.jsxs("div",{className:`grid gap-5 items-start ${Q?"lg:grid-cols-[minmax(0,1.5fr)_320px]":"lg:grid-cols-1"}`,children:[a.jsx("section",{id:"pairing-live-logs",ref:w,children:a.jsx(wu,{open:W,onOpenChange:J,children:a.jsxs("div",{className:"rounded-[20px] border overflow-hidden",style:Se,children:[a.jsx(Su,{asChild:!0,children:a.jsxs("button",{type:"button",className:"w-full px-5 py-4 border-b flex items-center justify-between gap-3 text-left hover:opacity-95 transition-opacity",style:{borderBottomColor:W?b.border:"transparent",backgroundColor:"#ffffff"},children:[a.jsxs("div",{className:"min-w-0",children:[a.jsxs("div",{className:"inline-flex items-center gap-2 text-[15px] font-medium tracking-tight",style:{color:b.ink},children:[a.jsx(yo,{size:15,style:{color:"#9ca3af"},strokeWidth:1.5}),"Pairing Logs"]}),a.jsx("div",{className:"mt-1 text-[11px] font-light",style:{color:b.muted},children:W?"Live bridge output and runtime diagnostics.":"Hidden by default. Expand only when debugging pairing."})]}),a.jsxs("div",{className:"flex items-center gap-3 shrink-0",children:[d?.logUpdatedAtLabel?a.jsx("span",{className:"text-[10px] font-mono",style:{color:b.muted},children:d.logUpdatedAtLabel}):null,a.jsx(_l,{size:14,className:"transition-transform duration-150",style:{color:b.muted,transform:W?"rotate(90deg)":void 0}})]})]})}),a.jsxs(Cu,{children:[a.jsxs("div",{className:"px-5 pt-4 flex items-center justify-between gap-3",children:[a.jsx("div",{className:"text-[11px] font-light",style:{color:b.muted},children:"Open the full Logs view if you want the broader app and relay log catalog."}),a.jsx(Tt,{type:"button",variant:"outline",size:"sm",onClick:y,children:"Open Full Logs"})]}),a.jsx("div",{className:"px-5 pb-5 pt-4",children:a.jsx(Z1,{title:"Pairing",pathLabel:d?.logPath??null,body:d?.logTail??null,truncated:d?.logTruncated,missing:d?.logMissing,loading:!d,updatedAtLabel:d?.logUpdatedAtLabel,maxHeight:320,minHeight:160,onRevealPath:k})})]})]})})}),Q?a.jsxs("section",{id:"pairing-settings-card",ref:Y,className:"rounded-[20px] border overflow-hidden",style:Se,children:[a.jsxs("div",{className:"px-5 py-4 border-b flex items-center justify-between gap-3",style:{borderBottomColor:b.border},children:[a.jsxs("div",{children:[a.jsxs("div",{className:"inline-flex items-center gap-2 text-[15px] font-medium tracking-tight",style:{color:b.ink},children:[a.jsx(ni,{size:15,style:{color:"#9ca3af"},strokeWidth:1.5}),"Advanced Settings"]}),a.jsx("div",{className:"mt-1 text-[11px] font-light",style:{color:b.muted},children:"You usually do not need these. Pairing can auto-launch a local relay for pairing."})]}),a.jsxs(Tt,{type:"button",variant:"outline",size:"sm",onClick:()=>{vt("config",d?.configPath??"")},disabled:!d?.configPath,children:[S==="config"?a.jsx(So,{size:14}):a.jsx(Or,{size:14}),"Config Path"]})]}),a.jsxs("div",{className:"divide-y",style:{borderColor:b.border},children:[a.jsx("div",{className:"px-5 py-4 space-y-3",children:rt.map(([Me,ot])=>a.jsxs("div",{className:"flex items-center justify-between gap-3 text-[12px]",children:[a.jsx("span",{className:"font-light",style:{color:b.muted},children:Me==="Secure Mode"?a.jsxs("span",{className:"inline-flex items-center gap-1.5",children:[a.jsx(P1,{size:13,strokeWidth:1.5}),Me]}):Me==="Last Updated"?a.jsxs("span",{className:"inline-flex items-center gap-1.5",children:[a.jsx(as,{size:13,strokeWidth:1.5}),Me]}):Me}),a.jsx("span",{className:"text-right break-words font-normal",style:{color:b.ink},children:ot})]},Me))}),a.jsxs("div",{className:"px-5 py-4 space-y-4",children:[a.jsxs("label",{className:"block",children:[a.jsx("div",{className:"text-[10px] font-mono uppercase tracking-[0.18em] mb-2",style:{color:b.muted},children:"Custom Pairing Relay URL"}),a.jsx("input",{type:"text",value:N,onChange:Me=>{R(Me.target.value),I(!0)},placeholder:"Leave blank to auto-select a local relay",className:"w-full rounded-xl border px-3 py-2 text-[13px] bg-transparent outline-none",style:{borderColor:b.border,color:b.ink}})]}),a.jsxs("label",{className:"block",children:[a.jsx("div",{className:"text-[10px] font-mono uppercase tracking-[0.18em] mb-2",style:{color:b.muted},children:"Workspace Root"}),a.jsx("input",{type:"text",value:L,onChange:Me=>{H(Me.target.value),I(!0)},placeholder:"/Users/arach/dev/openscout",className:"w-full rounded-xl border px-3 py-2 text-[13px] bg-transparent outline-none",style:{borderColor:b.border,color:b.ink}})]}),a.jsx("div",{className:"flex flex-wrap items-center gap-2",children:a.jsx(Tt,{type:"button",size:"sm",onClick:()=>{Ke()},disabled:i,children:"Save"})}),r?a.jsx("div",{className:"text-[11px] leading-[1.6]",style:{color:b.ink},children:r}):null]})]})]}):null]})]})})})})}function km(e){return e?e.name??`Device ${e.fingerprint}`:"Unknown device"}function jC(e){return e.length<=16?e:`${e.slice(0,8)}...${e.slice(-8)}`}function kC(e,l,r){return r?{label:"Error",backgroundColor:"#fff1f2",borderColor:"#fecdd3",color:"#be123c"}:l&&!e?{label:"Loading",backgroundColor:"#f8fafc",borderColor:"#e2e8f0",color:"#475569"}:e?.status==="paired"&&e.connectedPeerFingerprint?{label:"Connected",backgroundColor:"#ecfdf3",borderColor:"#bbf7d0",color:"#15803d"}:e?.isRunning&&e?.pairing?{label:"Waiting",backgroundColor:"#eff6ff",borderColor:"#bfdbfe",color:"#1d4ed8"}:(e?.trustedPeerCount??0)>0?{label:`${e.trustedPeerCount} trusted`,backgroundColor:"#f8fafc",borderColor:"#e2e8f0",color:"#475569"}:null}function NC({active:e,surface:l}){return l==="relay"?a.jsx("div",{className:"w-5 h-5 rounded-md flex items-center justify-center text-[9px] font-mono font-bold",style:e?{backgroundColor:b.ink,color:"#fff"}:{backgroundColor:b.surface,color:b.ink,boxShadow:`inset 0 0 0 1px ${b.border}`},children:">_"}):a.jsx("div",{className:"w-5 h-5 rounded-full flex items-center justify-center",style:e?{backgroundColor:b.accentBg,boxShadow:`inset 0 0 0 1px ${b.accentBorder}`}:{backgroundColor:b.tagBg,boxShadow:`inset 0 0 0 1px ${b.border}`},children:a.jsx("span",{className:"block w-1.5 h-1.5 rounded-full",style:{backgroundColor:e?b.accent:b.muted}})})}function $b(e){if(e<60)return`${e}s`;const l=Math.floor(e/60),r=e%60;if(l<60)return r>0?`${l}m ${r}s`:`${l}m`;const i=Math.floor(l/60),o=l%60;return o>0?`${i}h ${o}m`:`${i}h`}function wC(e,l){return e.find(r=>r.participants.some(i=>i.id===l))?.id??null}function qp(e,l){const r=l?e.participants.filter(i=>i.id!==l):e.participants;return r.length>0?r:e.participants}function rp(e,l){return qp(e,l).map(r=>r.title).join(", ")}function ap(e,l){const r=e.sourceKind==="private"?"Private thread":"Targeted relay traffic",i=e.participants.map(u=>u.title).join(" ↔ ");if(!l)return`${r} · ${i}`;const o=qp(e,l).map(u=>u.title).join(", ");return e.latestAuthorName?`${r} · ${o} · Last from ${e.latestAuthorName}`:`${r} · ${i}`}function Tv(e){return e==="project"?"Relay Agent":e==="system"?"System":"Built-in Role"}function SC(e){return e==="active"?"active":"all"}function CC(e){return e==="code"?"code":e==="session"?"session":e==="alpha"?"a-z":"chat"}function Gb(e){return e.threadCount>0||e.reachable||!!(e.lastChatAt||e.lastCodeChangeAt||e.lastSessionAt)}function Yb(e,l){return l==="code"?e.lastCodeChangeAt??0:l==="session"?e.lastSessionAt??0:e.lastChatAt??0}function Qb(e,l,r){if(r==="alpha")return e.title.localeCompare(l.title);const i=Yb(l,r)-Yb(e,r);return i!==0?i:l.threadCount-e.threadCount||e.title.localeCompare(l.title)}function TC(e,l){return l==="chat"&&e.lastChatLabel?`${e.subtitle} · chat ${e.lastChatLabel}`:l==="code"&&e.lastCodeChangeLabel?`${e.subtitle} · code ${e.lastCodeChangeLabel}`:l==="session"&&e.lastSessionLabel?`${e.subtitle} · session ${e.lastSessionLabel}`:e.subtitle}function Mn(e){return e.replace(/\r\n/g,`
12
+ `).trim()}function Xb(e){return e?JSON.stringify({cwd:Mn(e.runtime.cwd),harness:e.runtime.harness,sessionId:Mn(e.runtime.sessionId),systemPrompt:Mn(e.systemPrompt),launchArgsText:Mn(e.toolUse.launchArgsText),capabilitiesText:Mn(e.capabilitiesText)}):""}function Kb(e){return e?JSON.stringify({operatorName:Mn(e.operatorName),onboardingContextRoot:Mn(e.onboardingContextRoot),workspaceRoots:e.workspaceRoots.map(l=>Mn(l)),includeCurrentRepo:e.includeCurrentRepo,defaultHarness:e.defaultHarness,defaultCapabilities:e.defaultCapabilities.map(l=>Mn(l)),sessionPrefix:Mn(e.sessionPrefix),telegram:{enabled:e.telegram.enabled,mode:e.telegram.mode,botToken:Mn(e.telegram.botToken),secretToken:Mn(e.telegram.secretToken),apiBaseUrl:Mn(e.telegram.apiBaseUrl),userName:Mn(e.telegram.userName),defaultConversationId:Mn(e.telegram.defaultConversationId),ownerNodeId:Mn(e.telegram.ownerNodeId)}}):""}function AC(e){return Array.from(new Set(e.split(/[\n,]/g).map(l=>l.trim()).filter(Boolean)))}function Zb(e){return e||null}function ii(e){return e?e.replace(/^\/Users\/[^/]+/,"~").replace(/^\/home\/[^/]+/,"~"):null}function EC(e){return e?e.trim().toLowerCase()!=="operator":!1}function Av(e){return e.state==="working"?e.activeTask??e.statusDetail??e.subtitle:e.statusDetail?`${e.subtitle} · ${e.statusDetail}`:e.subtitle}function Lo(e){return e==="working"?"bg-[var(--os-accent)] os-presence-pulse":e==="available"?"bg-emerald-500":"bg-zinc-400/50"}function RC(e){switch(e){case"replied":return{color:"#059669"};case"working":return{color:"var(--os-accent)"};case"seen":return{color:"var(--os-accent)"};case"delivered":return{color:"#64748b"};default:return{color:"var(--os-muted)"}}}function MC(e){const l=e.trim();return!(!l||l.includes(`
13
+ `)||/```|`|\[[^\]]+\]\([^)]+\)|^>\s|^#{1,6}\s|^\s*[-*+]\s|^\s*\d+\.\s|\|/.test(l))}function Ev(e){return!e.isDirectConversation&&!e.isSystem&&!e.isVoice&&e.messageClass!=="status"&&(!e.normalizedChannel||e.normalizedChannel==="shared")}function Rv(e){return e.isSystem}function Mv(e){return e.isVoice}function zv(e){return!e.isVoice}function Ov(e){return!e.isVoice&&!e.isSystem&&(e.isDirectConversation||e.recipients.length>0||e.messageClass==="status")}function Lv(e){return!e.isDirectConversation&&!e.isSystem&&!e.isVoice&&e.messageClass!=="status"&&e.recipients.length>0}function Ji(e,l){return e.filter(l).length}function Wb(e){if(!e)return[];const l=new Map(e.views.map(i=>[i.id,i])),r=new Map(e.channels.map(i=>[i.id,i]));return[l.get("all-traffic")??{kind:"filter",id:"all-traffic",title:"All Traffic",subtitle:"Every non-voice message across the workspace.",count:Ji(e.messages,zv)},l.get("coordination")??{kind:"filter",id:"coordination",title:"Coordination",subtitle:"Targeted messages, direct threads, and task handoffs.",count:Ji(e.messages,Ov)},l.get("mentions")??{kind:"filter",id:"mentions",title:"Mentions",subtitle:"Focused view over shared-channel targeted messages.",count:Ji(e.messages,Lv)},r.get("system")??{kind:"channel",id:"system",title:"# system",subtitle:"Infrastructure, lifecycle, and broker state events.",count:Ji(e.messages,Rv)},r.get("voice")??{kind:"channel",id:"voice",title:"# voice",subtitle:"Voice-related chat, transcripts, and spoken updates.",count:Ji(e.messages,Mv)}]}function zC(e){return e?[e.channels.find(r=>r.id==="shared")??{kind:"channel",id:"shared",title:"# shared-channel",subtitle:"Broadcast updates and shared context.",count:Ji(e.messages,Ev)}]:[]}function OC(e,l,r,i){return r==="channel"?e.channels.find(o=>o.id===i)??null:r==="filter"?l.find(o=>o.id===i)??null:e.directs.find(o=>o.id===i)??null}function LC(e,l,r){return l==="direct"?e.filter(i=>i.isDirectConversation&&(i.authorId===r||i.recipients.includes(r))):l==="filter"&&r==="all-traffic"?e.filter(zv):l==="filter"&&r==="coordination"?e.filter(Ov):l==="filter"&&r==="mentions"?e.filter(Lv):l==="channel"&&r==="voice"?e.filter(Mv):l==="channel"&&r==="system"?e.filter(Rv):e.filter(Ev)}function Vp(e){return e.replace(/^[@#]\s*/,"")}function Dv(e){return e>1e10?e:e*1e3}function DC(e){return new Intl.DateTimeFormat("en-US",{hour:"numeric",minute:"2-digit"}).format(new Date(Dv(e)))}function _C(e){return new Intl.DateTimeFormat("en-US",{weekday:"short",month:"short",day:"numeric"}).format(new Date(Dv(e))).toUpperCase()}function BC(e){return new Intl.DateTimeFormat([],{hour:"numeric",minute:"2-digit"}).format(e)}function hl(e){const l=["#3b82f6","#14b8a6","#fb923c","#f43f5e","#8b5cf6","#10b981"];let r=0;for(const i of e)r+=i.charCodeAt(0);return l[r%l.length]}function IC(e,l){const r=l?.operatorName?.trim();if(r)return r;const i=e?.operatorId??"operator",o=e?.messages??[];for(let u=o.length-1;u>=0;u-=1){const d=o[u];if(d?.authorId===i&&d.authorName.trim())return d.authorName.trim()}return l?.operatorNameDefault??"Operator"}function Jb(e){const l=e.match(/@[a-z0-9][\w.-]*(?:@[a-z0-9][\w.-]*)?(?:#[a-z0-9][\w.-]*)?/gi)??[];return Array.from(new Set(l.map(r=>r.slice(1))))}function _v(e){return e.trim().toLowerCase()}function PC(e,l){const r=Math.max(0,Math.min(l,e.length));let i=r-1;for(;i>=0&&/[\w.@#-]/.test(e[i]??"");)i-=1;const o=i+1;return e[o]!=="@"||i>=0&&!/[\s([{,]/.test(e[i]??"")?null:{start:o,end:r,query:_v(e.slice(o+1,r))}}function UC(e,l,r){const i=e.mentionToken.replace(/^@/,"").toLowerCase(),o=e.title.toLowerCase(),u=_v(l);let d=0;return e.agentId===r&&(d+=100),u?(i===u?d+=120:i.startsWith(u)?d+=80:o.startsWith(u)?d+=72:e.searchText.includes(u)&&(d+=28),e.state==="working"?d+=8:e.state==="available"&&(d+=4),d):(e.state==="working"?d+=10:e.state==="available"&&(d+=6),d)}function HC(e,l){return e==="direct"?l==="scout"?"dm.scout.primary":`dm.operator.${l}`:e==="channel"&&l==="voice"?"channel.voice":e==="channel"&&l==="system"?"channel.system":"channel.shared"}function Eo(e){const l=e.replace(/[^a-zA-Z0-9]/g,"").toLowerCase();return`m:${l.slice(-7)||l.slice(0,7)||"message"}`}function FC(e){const l=e.replace(/[^a-zA-Z0-9]/g,"").toLowerCase();return l.slice(-4)||l.slice(0,4)||"ref"}function Bv(e){return`message:${e}`}function Nm(e){return`message-${e.replace(/[^a-zA-Z0-9_-]/g,"-")}`}function ip(e,l=88){const r=e.replace(/\s+/g," ").trim();return r.length<=l?r:`${r.slice(0,Math.max(0,l-1)).trimEnd()}…`}function ey(){return{color:b.ink,backgroundColor:b.accentBg,boxShadow:"inset 0 0 0 1px rgba(0,102,255,0.16)"}}function Je(e){return e instanceof Error?e.message:"Action failed."}function Iv(e){return`${e.sessionId}:${e.turnId}:${e.id}`}function qC(e,l){return{...e,turns:e.turns.map(r=>({...r,blocks:r.blocks.map(i=>{const o=l[Iv(i)];return o===void 0?i:{...i,collapsed:o}})}))}}function $p({snapshot:e,onIntent:l,className:r,emptyLabel:i="No trace events yet.",options:o={}}){const[u,d]=z.useState({});z.useEffect(()=>{const y=new Set,g=Db(e,o);for(const v of g.turns)for(const k of v.blocks)y.add(Iv(k));d(v=>{let k=!1;const S={};for(const[A,N]of Object.entries(v))y.has(A)?S[A]=N:k=!0;return k?S:v})},[o,e]);const f=z.useMemo(()=>qC(Db(e,o),u),[u,o,e]),p=z.useCallback(y=>{if(y.type==="collapse"){const g=`${y.sessionId}:${y.turnId}:${y.blockId}`;d(v=>({...v,[g]:y.collapsed}));return}l?.(y)},[l]),h=["os-agent-session-trace",r].filter(Boolean).join(" ");return f.turns.length===0?a.jsx("div",{className:h,"data-trace-empty":!0,children:i}):a.jsx("div",{className:h,"data-trace-timeline":!0,children:f.turns.map(y=>a.jsx(Z2,{turn:y,onIntent:p},y.id))})}function Ro(e){const l=E.useRef(e);return E.useEffect(()=>{l.current=e}),E.useMemo(()=>(...r)=>l.current?.(...r),[])}function VC(e,l=globalThis?.document){const r=Ro(e);E.useEffect(()=>{const i=o=>{o.key==="Escape"&&r(o)};return l.addEventListener("keydown",i,{capture:!0}),()=>l.removeEventListener("keydown",i,{capture:!0})},[r,l])}var $C="DismissableLayer",sp="dismissableLayer.update",GC="dismissableLayer.pointerDownOutside",YC="dismissableLayer.focusOutside",ty,Pv=E.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),Uv=E.forwardRef((e,l)=>{const{disableOutsidePointerEvents:r=!1,onEscapeKeyDown:i,onPointerDownOutside:o,onFocusOutside:u,onInteractOutside:d,onDismiss:f,...p}=e,h=E.useContext(Pv),[y,g]=E.useState(null),v=y?.ownerDocument??globalThis?.document,[,k]=E.useState({}),S=ga(l,I=>g(I)),A=Array.from(h.layers),[N]=[...h.layersWithOutsidePointerEventsDisabled].slice(-1),R=A.indexOf(N),L=y?A.indexOf(y):-1,H=h.layersWithOutsidePointerEventsDisabled.size>0,X=L>=R,V=KC(I=>{const F=I.target,ne=[...h.branches].some(O=>O.contains(F));!X||ne||(o?.(I),d?.(I),I.defaultPrevented||f?.())},v),D=ZC(I=>{const F=I.target;[...h.branches].some(O=>O.contains(F))||(u?.(I),d?.(I),I.defaultPrevented||f?.())},v);return VC(I=>{L===h.layers.size-1&&(i?.(I),!I.defaultPrevented&&f&&(I.preventDefault(),f()))},v),E.useEffect(()=>{if(y)return r&&(h.layersWithOutsidePointerEventsDisabled.size===0&&(ty=v.body.style.pointerEvents,v.body.style.pointerEvents="none"),h.layersWithOutsidePointerEventsDisabled.add(y)),h.layers.add(y),ny(),()=>{r&&h.layersWithOutsidePointerEventsDisabled.size===1&&(v.body.style.pointerEvents=ty)}},[y,v,r,h]),E.useEffect(()=>()=>{y&&(h.layers.delete(y),h.layersWithOutsidePointerEventsDisabled.delete(y),ny())},[y,h]),E.useEffect(()=>{const I=()=>k({});return document.addEventListener(sp,I),()=>document.removeEventListener(sp,I)},[]),a.jsx(Cl.div,{...p,ref:S,style:{pointerEvents:H?X?"auto":"none":void 0,...e.style},onFocusCapture:zr(e.onFocusCapture,D.onFocusCapture),onBlurCapture:zr(e.onBlurCapture,D.onBlurCapture),onPointerDownCapture:zr(e.onPointerDownCapture,V.onPointerDownCapture)})});Uv.displayName=$C;var QC="DismissableLayerBranch",XC=E.forwardRef((e,l)=>{const r=E.useContext(Pv),i=E.useRef(null),o=ga(l,i);return E.useEffect(()=>{const u=i.current;if(u)return r.branches.add(u),()=>{r.branches.delete(u)}},[r.branches]),a.jsx(Cl.div,{...e,ref:o})});XC.displayName=QC;function KC(e,l=globalThis?.document){const r=Ro(e),i=E.useRef(!1),o=E.useRef(()=>{});return E.useEffect(()=>{const u=f=>{if(f.target&&!i.current){let p=function(){Hv(GC,r,h,{discrete:!0})};const h={originalEvent:f};f.pointerType==="touch"?(l.removeEventListener("click",o.current),o.current=p,l.addEventListener("click",o.current,{once:!0})):p()}else l.removeEventListener("click",o.current);i.current=!1},d=window.setTimeout(()=>{l.addEventListener("pointerdown",u)},0);return()=>{window.clearTimeout(d),l.removeEventListener("pointerdown",u),l.removeEventListener("click",o.current)}},[l,r]),{onPointerDownCapture:()=>i.current=!0}}function ZC(e,l=globalThis?.document){const r=Ro(e),i=E.useRef(!1);return E.useEffect(()=>{const o=u=>{u.target&&!i.current&&Hv(YC,r,{originalEvent:u},{discrete:!1})};return l.addEventListener("focusin",o),()=>l.removeEventListener("focusin",o)},[l,r]),{onFocusCapture:()=>i.current=!0,onBlurCapture:()=>i.current=!1}}function ny(){const e=new CustomEvent(sp);document.dispatchEvent(e)}function Hv(e,l,r,{discrete:i}){const o=r.originalEvent.target,u=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:r});l&&o.addEventListener(e,l,{once:!0}),i?uC(o,u):o.dispatchEvent(u)}var wm="focusScope.autoFocusOnMount",Sm="focusScope.autoFocusOnUnmount",ly={bubbles:!1,cancelable:!0},WC="FocusScope",Fv=E.forwardRef((e,l)=>{const{loop:r=!1,trapped:i=!1,onMountAutoFocus:o,onUnmountAutoFocus:u,...d}=e,[f,p]=E.useState(null),h=Ro(o),y=Ro(u),g=E.useRef(null),v=ga(l,A=>p(A)),k=E.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;E.useEffect(()=>{if(i){let A=function(H){if(k.paused||!f)return;const X=H.target;f.contains(X)?g.current=X:ha(g.current,{select:!0})},N=function(H){if(k.paused||!f)return;const X=H.relatedTarget;X!==null&&(f.contains(X)||ha(g.current,{select:!0}))},R=function(H){if(document.activeElement===document.body)for(const V of H)V.removedNodes.length>0&&ha(f)};document.addEventListener("focusin",A),document.addEventListener("focusout",N);const L=new MutationObserver(R);return f&&L.observe(f,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",A),document.removeEventListener("focusout",N),L.disconnect()}}},[i,f,k.paused]),E.useEffect(()=>{if(f){ay.add(k);const A=document.activeElement;if(!f.contains(A)){const R=new CustomEvent(wm,ly);f.addEventListener(wm,h),f.dispatchEvent(R),R.defaultPrevented||(JC(rT(qv(f)),{select:!0}),document.activeElement===A&&ha(f))}return()=>{f.removeEventListener(wm,h),setTimeout(()=>{const R=new CustomEvent(Sm,ly);f.addEventListener(Sm,y),f.dispatchEvent(R),R.defaultPrevented||ha(A??document.body,{select:!0}),f.removeEventListener(Sm,y),ay.remove(k)},0)}}},[f,h,y,k]);const S=E.useCallback(A=>{if(!r&&!i||k.paused)return;const N=A.key==="Tab"&&!A.altKey&&!A.ctrlKey&&!A.metaKey,R=document.activeElement;if(N&&R){const L=A.currentTarget,[H,X]=eT(L);H&&X?!A.shiftKey&&R===X?(A.preventDefault(),r&&ha(H,{select:!0})):A.shiftKey&&R===H&&(A.preventDefault(),r&&ha(X,{select:!0})):R===L&&A.preventDefault()}},[r,i,k.paused]);return a.jsx(Cl.div,{tabIndex:-1,...d,ref:v,onKeyDown:S})});Fv.displayName=WC;function JC(e,{select:l=!1}={}){const r=document.activeElement;for(const i of e)if(ha(i,{select:l}),document.activeElement!==r)return}function eT(e){const l=qv(e),r=ry(l,e),i=ry(l.reverse(),e);return[r,i]}function qv(e){const l=[],r=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:i=>{const o=i.tagName==="INPUT"&&i.type==="hidden";return i.disabled||i.hidden||o?NodeFilter.FILTER_SKIP:i.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;r.nextNode();)l.push(r.currentNode);return l}function ry(e,l){for(const r of e)if(!tT(r,{upTo:l}))return r}function tT(e,{upTo:l}){if(getComputedStyle(e).visibility==="hidden")return!0;for(;e;){if(l!==void 0&&e===l)return!1;if(getComputedStyle(e).display==="none")return!0;e=e.parentElement}return!1}function nT(e){return e instanceof HTMLInputElement&&"select"in e}function ha(e,{select:l=!1}={}){if(e&&e.focus){const r=document.activeElement;e.focus({preventScroll:!0}),e!==r&&nT(e)&&l&&e.select()}}var ay=lT();function lT(){let e=[];return{add(l){const r=e[0];l!==r&&r?.pause(),e=iy(e,l),e.unshift(l)},remove(l){e=iy(e,l),e[0]?.resume()}}}function iy(e,l){const r=[...e],i=r.indexOf(l);return i!==-1&&r.splice(i,1),r}function rT(e){return e.filter(l=>l.tagName!=="A")}var aT="Portal",Vv=E.forwardRef((e,l)=>{const{container:r,...i}=e,[o,u]=E.useState(!1);is(()=>u(!0),[]);const d=r||o&&globalThis?.document?.body;return d?tN.createPortal(a.jsx(Cl.div,{...i,ref:l}),d):null});Vv.displayName=aT;var Cm=0;function iT(){E.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??sy()),document.body.insertAdjacentElement("beforeend",e[1]??sy()),Cm++,()=>{Cm===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(l=>l.remove()),Cm--}},[])}function sy(){const e=document.createElement("span");return e.setAttribute("data-radix-focus-guard",""),e.tabIndex=0,e.style.outline="none",e.style.opacity="0",e.style.position="fixed",e.style.pointerEvents="none",e}var Zl=function(){return Zl=Object.assign||function(l){for(var r,i=1,o=arguments.length;i<o;i++){r=arguments[i];for(var u in r)Object.prototype.hasOwnProperty.call(r,u)&&(l[u]=r[u])}return l},Zl.apply(this,arguments)};function $v(e,l){var r={};for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&l.indexOf(i)<0&&(r[i]=e[i]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var o=0,i=Object.getOwnPropertySymbols(e);o<i.length;o++)l.indexOf(i[o])<0&&Object.prototype.propertyIsEnumerable.call(e,i[o])&&(r[i[o]]=e[i[o]]);return r}function sT(e,l,r){if(r||arguments.length===2)for(var i=0,o=l.length,u;i<o;i++)(u||!(i in l))&&(u||(u=Array.prototype.slice.call(l,0,i)),u[i]=l[i]);return e.concat(u||Array.prototype.slice.call(l))}var Tu="right-scroll-bar-position",Au="width-before-scroll-bar",oT="with-scroll-bars-hidden",cT="--removed-body-scroll-bar-size";function Tm(e,l){return typeof e=="function"?e(l):e&&(e.current=l),e}function uT(e,l){var r=E.useState(function(){return{value:e,callback:l,facade:{get current(){return r.value},set current(i){var o=r.value;o!==i&&(r.value=i,r.callback(i,o))}}}})[0];return r.callback=l,r.facade}var dT=typeof window<"u"?E.useLayoutEffect:E.useEffect,oy=new WeakMap;function fT(e,l){var r=uT(null,function(i){return e.forEach(function(o){return Tm(o,i)})});return dT(function(){var i=oy.get(r);if(i){var o=new Set(i),u=new Set(e),d=r.current;o.forEach(function(f){u.has(f)||Tm(f,null)}),u.forEach(function(f){o.has(f)||Tm(f,d)})}oy.set(r,e)},[e]),r}function mT(e){return e}function pT(e,l){l===void 0&&(l=mT);var r=[],i=!1,o={read:function(){if(i)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return r.length?r[r.length-1]:e},useMedium:function(u){var d=l(u,i);return r.push(d),function(){r=r.filter(function(f){return f!==d})}},assignSyncMedium:function(u){for(i=!0;r.length;){var d=r;r=[],d.forEach(u)}r={push:function(f){return u(f)},filter:function(){return r}}},assignMedium:function(u){i=!0;var d=[];if(r.length){var f=r;r=[],f.forEach(u),d=r}var p=function(){var y=d;d=[],y.forEach(u)},h=function(){return Promise.resolve().then(p)};h(),r={push:function(y){d.push(y),h()},filter:function(y){return d=d.filter(y),r}}}};return o}function hT(e){e===void 0&&(e={});var l=pT(null);return l.options=Zl({async:!0,ssr:!1},e),l}var Gv=function(e){var l=e.sideCar,r=$v(e,["sideCar"]);if(!l)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var i=l.read();if(!i)throw new Error("Sidecar medium not found");return E.createElement(i,Zl({},r))};Gv.isSideCarExport=!0;function xT(e,l){return e.useMedium(l),Gv}var Yv=hT(),Am=function(){},Vu=E.forwardRef(function(e,l){var r=E.useRef(null),i=E.useState({onScrollCapture:Am,onWheelCapture:Am,onTouchMoveCapture:Am}),o=i[0],u=i[1],d=e.forwardProps,f=e.children,p=e.className,h=e.removeScrollBar,y=e.enabled,g=e.shards,v=e.sideCar,k=e.noRelative,S=e.noIsolation,A=e.inert,N=e.allowPinchZoom,R=e.as,L=R===void 0?"div":R,H=e.gapMode,X=$v(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),V=v,D=fT([r,l]),I=Zl(Zl({},X),o);return E.createElement(E.Fragment,null,y&&E.createElement(V,{sideCar:Yv,removeScrollBar:h,shards:g,noRelative:k,noIsolation:S,inert:A,setCallbacks:u,allowPinchZoom:!!N,lockRef:r,gapMode:H}),d?E.cloneElement(E.Children.only(f),Zl(Zl({},I),{ref:D})):E.createElement(L,Zl({},I,{className:p,ref:D}),f))});Vu.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};Vu.classNames={fullWidth:Au,zeroRight:Tu};var gT=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function bT(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var l=gT();return l&&e.setAttribute("nonce",l),e}function yT(e,l){e.styleSheet?e.styleSheet.cssText=l:e.appendChild(document.createTextNode(l))}function vT(e){var l=document.head||document.getElementsByTagName("head")[0];l.appendChild(e)}var jT=function(){var e=0,l=null;return{add:function(r){e==0&&(l=bT())&&(yT(l,r),vT(l)),e++},remove:function(){e--,!e&&l&&(l.parentNode&&l.parentNode.removeChild(l),l=null)}}},kT=function(){var e=jT();return function(l,r){E.useEffect(function(){return e.add(l),function(){e.remove()}},[l&&r])}},Qv=function(){var e=kT(),l=function(r){var i=r.styles,o=r.dynamic;return e(i,o),null};return l},NT={left:0,top:0,right:0,gap:0},Em=function(e){return parseInt(e||"",10)||0},wT=function(e){var l=window.getComputedStyle(document.body),r=l[e==="padding"?"paddingLeft":"marginLeft"],i=l[e==="padding"?"paddingTop":"marginTop"],o=l[e==="padding"?"paddingRight":"marginRight"];return[Em(r),Em(i),Em(o)]},ST=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return NT;var l=wT(e),r=document.documentElement.clientWidth,i=window.innerWidth;return{left:l[0],top:l[1],right:l[2],gap:Math.max(0,i-r+l[2]-l[0])}},CT=Qv(),ns="data-scroll-locked",TT=function(e,l,r,i){var o=e.left,u=e.top,d=e.right,f=e.gap;return r===void 0&&(r="margin"),`
14
+ .`.concat(oT,` {
15
+ overflow: hidden `).concat(i,`;
16
+ padding-right: `).concat(f,"px ").concat(i,`;
17
+ }
18
+ body[`).concat(ns,`] {
19
+ overflow: hidden `).concat(i,`;
20
+ overscroll-behavior: contain;
21
+ `).concat([l&&"position: relative ".concat(i,";"),r==="margin"&&`
22
+ padding-left: `.concat(o,`px;
23
+ padding-top: `).concat(u,`px;
24
+ padding-right: `).concat(d,`px;
25
+ margin-left:0;
26
+ margin-top:0;
27
+ margin-right: `).concat(f,"px ").concat(i,`;
28
+ `),r==="padding"&&"padding-right: ".concat(f,"px ").concat(i,";")].filter(Boolean).join(""),`
29
+ }
30
+
31
+ .`).concat(Tu,` {
32
+ right: `).concat(f,"px ").concat(i,`;
33
+ }
34
+
35
+ .`).concat(Au,` {
36
+ margin-right: `).concat(f,"px ").concat(i,`;
37
+ }
38
+
39
+ .`).concat(Tu," .").concat(Tu,` {
40
+ right: 0 `).concat(i,`;
41
+ }
42
+
43
+ .`).concat(Au," .").concat(Au,` {
44
+ margin-right: 0 `).concat(i,`;
45
+ }
46
+
47
+ body[`).concat(ns,`] {
48
+ `).concat(cT,": ").concat(f,`px;
49
+ }
50
+ `)},cy=function(){var e=parseInt(document.body.getAttribute(ns)||"0",10);return isFinite(e)?e:0},AT=function(){E.useEffect(function(){return document.body.setAttribute(ns,(cy()+1).toString()),function(){var e=cy()-1;e<=0?document.body.removeAttribute(ns):document.body.setAttribute(ns,e.toString())}},[])},ET=function(e){var l=e.noRelative,r=e.noImportant,i=e.gapMode,o=i===void 0?"margin":i;AT();var u=E.useMemo(function(){return ST(o)},[o]);return E.createElement(CT,{styles:TT(u,!l,o,r?"":"!important")})},op=!1;if(typeof window<"u")try{var uu=Object.defineProperty({},"passive",{get:function(){return op=!0,!0}});window.addEventListener("test",uu,uu),window.removeEventListener("test",uu,uu)}catch{op=!1}var Yi=op?{passive:!1}:!1,RT=function(e){return e.tagName==="TEXTAREA"},Xv=function(e,l){if(!(e instanceof Element))return!1;var r=window.getComputedStyle(e);return r[l]!=="hidden"&&!(r.overflowY===r.overflowX&&!RT(e)&&r[l]==="visible")},MT=function(e){return Xv(e,"overflowY")},zT=function(e){return Xv(e,"overflowX")},uy=function(e,l){var r=l.ownerDocument,i=l;do{typeof ShadowRoot<"u"&&i instanceof ShadowRoot&&(i=i.host);var o=Kv(e,i);if(o){var u=Zv(e,i),d=u[1],f=u[2];if(d>f)return!0}i=i.parentNode}while(i&&i!==r.body);return!1},OT=function(e){var l=e.scrollTop,r=e.scrollHeight,i=e.clientHeight;return[l,r,i]},LT=function(e){var l=e.scrollLeft,r=e.scrollWidth,i=e.clientWidth;return[l,r,i]},Kv=function(e,l){return e==="v"?MT(l):zT(l)},Zv=function(e,l){return e==="v"?OT(l):LT(l)},DT=function(e,l){return e==="h"&&l==="rtl"?-1:1},_T=function(e,l,r,i,o){var u=DT(e,window.getComputedStyle(l).direction),d=u*i,f=r.target,p=l.contains(f),h=!1,y=d>0,g=0,v=0;do{if(!f)break;var k=Zv(e,f),S=k[0],A=k[1],N=k[2],R=A-N-u*S;(S||R)&&Kv(e,f)&&(g+=R,v+=S);var L=f.parentNode;f=L&&L.nodeType===Node.DOCUMENT_FRAGMENT_NODE?L.host:L}while(!p&&f!==document.body||p&&(l.contains(f)||l===f));return(y&&Math.abs(g)<1||!y&&Math.abs(v)<1)&&(h=!0),h},du=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},dy=function(e){return[e.deltaX,e.deltaY]},fy=function(e){return e&&"current"in e?e.current:e},BT=function(e,l){return e[0]===l[0]&&e[1]===l[1]},IT=function(e){return`
51
+ .block-interactivity-`.concat(e,` {pointer-events: none;}
52
+ .allow-interactivity-`).concat(e,` {pointer-events: all;}
53
+ `)},PT=0,Qi=[];function UT(e){var l=E.useRef([]),r=E.useRef([0,0]),i=E.useRef(),o=E.useState(PT++)[0],u=E.useState(Qv)[0],d=E.useRef(e);E.useEffect(function(){d.current=e},[e]),E.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(o));var A=sT([e.lockRef.current],(e.shards||[]).map(fy),!0).filter(Boolean);return A.forEach(function(N){return N.classList.add("allow-interactivity-".concat(o))}),function(){document.body.classList.remove("block-interactivity-".concat(o)),A.forEach(function(N){return N.classList.remove("allow-interactivity-".concat(o))})}}},[e.inert,e.lockRef.current,e.shards]);var f=E.useCallback(function(A,N){if("touches"in A&&A.touches.length===2||A.type==="wheel"&&A.ctrlKey)return!d.current.allowPinchZoom;var R=du(A),L=r.current,H="deltaX"in A?A.deltaX:L[0]-R[0],X="deltaY"in A?A.deltaY:L[1]-R[1],V,D=A.target,I=Math.abs(H)>Math.abs(X)?"h":"v";if("touches"in A&&I==="h"&&D.type==="range")return!1;var F=window.getSelection(),ne=F&&F.anchorNode,O=ne?ne===D||ne.contains(D):!1;if(O)return!1;var P=uy(I,D);if(!P)return!0;if(P?V=I:(V=I==="v"?"h":"v",P=uy(I,D)),!P)return!1;if(!i.current&&"changedTouches"in A&&(H||X)&&(i.current=V),!V)return!0;var Q=i.current||V;return _T(Q,N,A,Q==="h"?H:X)},[]),p=E.useCallback(function(A){var N=A;if(!(!Qi.length||Qi[Qi.length-1]!==u)){var R="deltaY"in N?dy(N):du(N),L=l.current.filter(function(V){return V.name===N.type&&(V.target===N.target||N.target===V.shadowParent)&&BT(V.delta,R)})[0];if(L&&L.should){N.cancelable&&N.preventDefault();return}if(!L){var H=(d.current.shards||[]).map(fy).filter(Boolean).filter(function(V){return V.contains(N.target)}),X=H.length>0?f(N,H[0]):!d.current.noIsolation;X&&N.cancelable&&N.preventDefault()}}},[]),h=E.useCallback(function(A,N,R,L){var H={name:A,delta:N,target:R,should:L,shadowParent:HT(R)};l.current.push(H),setTimeout(function(){l.current=l.current.filter(function(X){return X!==H})},1)},[]),y=E.useCallback(function(A){r.current=du(A),i.current=void 0},[]),g=E.useCallback(function(A){h(A.type,dy(A),A.target,f(A,e.lockRef.current))},[]),v=E.useCallback(function(A){h(A.type,du(A),A.target,f(A,e.lockRef.current))},[]);E.useEffect(function(){return Qi.push(u),e.setCallbacks({onScrollCapture:g,onWheelCapture:g,onTouchMoveCapture:v}),document.addEventListener("wheel",p,Yi),document.addEventListener("touchmove",p,Yi),document.addEventListener("touchstart",y,Yi),function(){Qi=Qi.filter(function(A){return A!==u}),document.removeEventListener("wheel",p,Yi),document.removeEventListener("touchmove",p,Yi),document.removeEventListener("touchstart",y,Yi)}},[]);var k=e.removeScrollBar,S=e.inert;return E.createElement(E.Fragment,null,S?E.createElement(u,{styles:IT(o)}):null,k?E.createElement(ET,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function HT(e){for(var l=null;e!==null;)e instanceof ShadowRoot&&(l=e.host,e=e.host),e=e.parentNode;return l}const FT=xT(Yv,UT);var Wv=E.forwardRef(function(e,l){return E.createElement(Vu,Zl({},e,{ref:l,sideCar:FT}))});Wv.classNames=Vu.classNames;var qT=function(e){if(typeof document>"u")return null;var l=Array.isArray(e)?e[0]:e;return l.ownerDocument.body},Xi=new WeakMap,fu=new WeakMap,mu={},Rm=0,Jv=function(e){return e&&(e.host||Jv(e.parentNode))},VT=function(e,l){return l.map(function(r){if(e.contains(r))return r;var i=Jv(r);return i&&e.contains(i)?i:(console.error("aria-hidden",r,"in not contained inside",e,". Doing nothing"),null)}).filter(function(r){return!!r})},$T=function(e,l,r,i){var o=VT(l,Array.isArray(e)?e:[e]);mu[r]||(mu[r]=new WeakMap);var u=mu[r],d=[],f=new Set,p=new Set(o),h=function(g){!g||f.has(g)||(f.add(g),h(g.parentNode))};o.forEach(h);var y=function(g){!g||p.has(g)||Array.prototype.forEach.call(g.children,function(v){if(f.has(v))y(v);else try{var k=v.getAttribute(i),S=k!==null&&k!=="false",A=(Xi.get(v)||0)+1,N=(u.get(v)||0)+1;Xi.set(v,A),u.set(v,N),d.push(v),A===1&&S&&fu.set(v,!0),N===1&&v.setAttribute(r,"true"),S||v.setAttribute(i,"true")}catch(R){console.error("aria-hidden: cannot operate on ",v,R)}})};return y(l),f.clear(),Rm++,function(){d.forEach(function(g){var v=Xi.get(g)-1,k=u.get(g)-1;Xi.set(g,v),u.set(g,k),v||(fu.has(g)||g.removeAttribute(i),fu.delete(g)),k||g.removeAttribute(r)}),Rm--,Rm||(Xi=new WeakMap,Xi=new WeakMap,fu=new WeakMap,mu={})}},GT=function(e,l,r){r===void 0&&(r="data-aria-hidden");var i=Array.from(Array.isArray(e)?e:[e]),o=qT(e);return o?(i.push.apply(i,Array.from(o.querySelectorAll("[aria-live], script"))),$T(i,o,r,"aria-hidden")):function(){return null}},$u="Dialog",[e0]=vv($u),[YT,Pl]=e0($u),t0=e=>{const{__scopeDialog:l,children:r,open:i,defaultOpen:o,onOpenChange:u,modal:d=!0}=e,f=E.useRef(null),p=E.useRef(null),[h,y]=jv({prop:i,defaultProp:o??!1,onChange:u,caller:$u});return a.jsx(YT,{scope:l,triggerRef:f,contentRef:p,contentId:Nu(),titleId:Nu(),descriptionId:Nu(),open:h,onOpenChange:y,onOpenToggle:E.useCallback(()=>y(g=>!g),[y]),modal:d,children:r})};t0.displayName=$u;var n0="DialogTrigger",QT=E.forwardRef((e,l)=>{const{__scopeDialog:r,...i}=e,o=Pl(n0,r),u=ga(l,o.triggerRef);return a.jsx(Cl.button,{type:"button","aria-haspopup":"dialog","aria-expanded":o.open,"aria-controls":o.contentId,"data-state":Qp(o.open),...i,ref:u,onClick:zr(e.onClick,o.onOpenToggle)})});QT.displayName=n0;var Gp="DialogPortal",[XT,l0]=e0(Gp,{forceMount:void 0}),r0=e=>{const{__scopeDialog:l,forceMount:r,children:i,container:o}=e,u=Pl(Gp,l);return a.jsx(XT,{scope:l,forceMount:r,children:E.Children.map(i,d=>a.jsx(Oo,{present:r||u.open,children:a.jsx(Vv,{asChild:!0,container:o,children:d})}))})};r0.displayName=Gp;var Lu="DialogOverlay",a0=E.forwardRef((e,l)=>{const r=l0(Lu,e.__scopeDialog),{forceMount:i=r.forceMount,...o}=e,u=Pl(Lu,e.__scopeDialog);return u.modal?a.jsx(Oo,{present:i||u.open,children:a.jsx(ZT,{...o,ref:l})}):null});a0.displayName=Lu;var KT=kv("DialogOverlay.RemoveScroll"),ZT=E.forwardRef((e,l)=>{const{__scopeDialog:r,...i}=e,o=Pl(Lu,r);return a.jsx(Wv,{as:KT,allowPinchZoom:!0,shards:[o.contentRef],children:a.jsx(Cl.div,{"data-state":Qp(o.open),...i,ref:l,style:{pointerEvents:"auto",...i.style}})})}),li="DialogContent",i0=E.forwardRef((e,l)=>{const r=l0(li,e.__scopeDialog),{forceMount:i=r.forceMount,...o}=e,u=Pl(li,e.__scopeDialog);return a.jsx(Oo,{present:i||u.open,children:u.modal?a.jsx(WT,{...o,ref:l}):a.jsx(JT,{...o,ref:l})})});i0.displayName=li;var WT=E.forwardRef((e,l)=>{const r=Pl(li,e.__scopeDialog),i=E.useRef(null),o=ga(l,r.contentRef,i);return E.useEffect(()=>{const u=i.current;if(u)return GT(u)},[]),a.jsx(s0,{...e,ref:o,trapFocus:r.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:zr(e.onCloseAutoFocus,u=>{u.preventDefault(),r.triggerRef.current?.focus()}),onPointerDownOutside:zr(e.onPointerDownOutside,u=>{const d=u.detail.originalEvent,f=d.button===0&&d.ctrlKey===!0;(d.button===2||f)&&u.preventDefault()}),onFocusOutside:zr(e.onFocusOutside,u=>u.preventDefault())})}),JT=E.forwardRef((e,l)=>{const r=Pl(li,e.__scopeDialog),i=E.useRef(!1),o=E.useRef(!1);return a.jsx(s0,{...e,ref:l,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:u=>{e.onCloseAutoFocus?.(u),u.defaultPrevented||(i.current||r.triggerRef.current?.focus(),u.preventDefault()),i.current=!1,o.current=!1},onInteractOutside:u=>{e.onInteractOutside?.(u),u.defaultPrevented||(i.current=!0,u.detail.originalEvent.type==="pointerdown"&&(o.current=!0));const d=u.target;r.triggerRef.current?.contains(d)&&u.preventDefault(),u.detail.originalEvent.type==="focusin"&&o.current&&u.preventDefault()}})}),s0=E.forwardRef((e,l)=>{const{__scopeDialog:r,trapFocus:i,onOpenAutoFocus:o,onCloseAutoFocus:u,...d}=e,f=Pl(li,r),p=E.useRef(null),h=ga(l,p);return iT(),a.jsxs(a.Fragment,{children:[a.jsx(Fv,{asChild:!0,loop:!0,trapped:i,onMountAutoFocus:o,onUnmountAutoFocus:u,children:a.jsx(Uv,{role:"dialog",id:f.contentId,"aria-describedby":f.descriptionId,"aria-labelledby":f.titleId,"data-state":Qp(f.open),...d,ref:h,onDismiss:()=>f.onOpenChange(!1)})}),a.jsxs(a.Fragment,{children:[a.jsx(eA,{titleId:f.titleId}),a.jsx(nA,{contentRef:p,descriptionId:f.descriptionId})]})]})}),Yp="DialogTitle",o0=E.forwardRef((e,l)=>{const{__scopeDialog:r,...i}=e,o=Pl(Yp,r);return a.jsx(Cl.h2,{id:o.titleId,...i,ref:l})});o0.displayName=Yp;var c0="DialogDescription",u0=E.forwardRef((e,l)=>{const{__scopeDialog:r,...i}=e,o=Pl(c0,r);return a.jsx(Cl.p,{id:o.descriptionId,...i,ref:l})});u0.displayName=c0;var d0="DialogClose",f0=E.forwardRef((e,l)=>{const{__scopeDialog:r,...i}=e,o=Pl(d0,r);return a.jsx(Cl.button,{type:"button",...i,ref:l,onClick:zr(e.onClick,()=>o.onOpenChange(!1))})});f0.displayName=d0;function Qp(e){return e?"open":"closed"}var m0="DialogTitleWarning",[T6,p0]=JS(m0,{contentName:li,titleName:Yp,docsSlug:"dialog"}),eA=({titleId:e})=>{const l=p0(m0),r=`\`${l.contentName}\` requires a \`${l.titleName}\` for the component to be accessible for screen reader users.
54
+
55
+ If you want to hide the \`${l.titleName}\`, you can wrap it with our VisuallyHidden component.
56
+
57
+ For more information, see https://radix-ui.com/primitives/docs/components/${l.docsSlug}`;return E.useEffect(()=>{e&&(document.getElementById(e)||console.error(r))},[r,e]),null},tA="DialogDescriptionWarning",nA=({contentRef:e,descriptionId:l})=>{const i=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${p0(tA).contentName}}.`;return E.useEffect(()=>{const o=e.current?.getAttribute("aria-describedby");l&&o&&(document.getElementById(l)||console.warn(i))},[i,e,l]),null},lA=t0,rA=r0,aA=a0,iA=i0,sA=o0,oA=u0,cA=f0;function h0({...e}){return a.jsx(lA,{"data-slot":"dialog",...e})}function uA({...e}){return a.jsx(rA,{"data-slot":"dialog-portal",...e})}function dA({className:e,...l}){return a.jsx(aA,{"data-slot":"dialog-overlay",className:Cn("data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/50",e),...l})}function x0({className:e,children:l,showCloseButton:r=!0,...i}){return a.jsxs(uA,{"data-slot":"dialog-portal",children:[a.jsx(dA,{}),a.jsxs(iA,{"data-slot":"dialog-content",className:Cn("bg-background data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 fixed top-[50%] left-[50%] z-50 grid w-full max-w-[calc(100%-2rem)] translate-x-[-50%] translate-y-[-50%] gap-4 rounded-lg border p-6 shadow-lg duration-200 sm:max-w-lg",e),...i,children:[l,r&&a.jsxs(cA,{"data-slot":"dialog-close",className:"ring-offset-background focus:ring-ring data-[state=open]:bg-accent data-[state=open]:text-muted-foreground absolute top-4 right-4 rounded-xs opacity-70 transition-opacity hover:opacity-100 focus:ring-2 focus:ring-offset-2 focus:outline-hidden disabled:pointer-events-none [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",children:[a.jsx(Sl,{}),a.jsx("span",{className:"sr-only",children:"Close"})]})]})]})}function g0({className:e,...l}){return a.jsx("div",{"data-slot":"dialog-header",className:Cn("flex flex-col gap-2 text-center sm:text-left",e),...l})}function fA({className:e,...l}){return a.jsx("div",{"data-slot":"dialog-footer",className:Cn("flex flex-col-reverse gap-2 sm:flex-row sm:justify-end",e),...l})}function b0({className:e,...l}){return a.jsx(sA,{"data-slot":"dialog-title",className:Cn("text-lg leading-none font-semibold",e),...l})}function y0({className:e,...l}){return a.jsx(oA,{"data-slot":"dialog-description",className:Cn("text-muted-foreground text-sm",e),...l})}function cp({className:e,type:l,...r}){return a.jsx("input",{type:l,"data-slot":"input",className:Cn("file:text-foreground placeholder:text-muted-foreground selection:bg-primary selection:text-primary-foreground dark:bg-input/30 border-input h-9 w-full min-w-0 rounded-md border bg-transparent px-3 py-1 text-base shadow-xs transition-[color,box-shadow] outline-none file:inline-flex file:h-7 file:border-0 file:bg-transparent file:text-sm file:font-medium disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50 md:text-sm","focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px]","aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive",e),...r})}const my=["⠋","⠙","⠹","⠸","⠼","⠴","⠦","⠧","⠇","⠏"];function xn({className:e,fps:l=12,...r}){const[i,o]=E.useState(0);return E.useEffect(()=>{const u=setInterval(()=>{o(d=>(d+1)%my.length)},1e3/l);return()=>clearInterval(u)},[l]),a.jsx("span",{role:"status","aria-label":"Loading",className:Cn("inline-block font-mono",e),...r,children:my[i]})}function mA({className:e,...l}){return a.jsx("textarea",{"data-slot":"textarea",className:Cn("border-input placeholder:text-muted-foreground focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:bg-input/30 flex field-sizing-content min-h-16 w-full rounded-md border bg-transparent px-3 py-2 text-base shadow-xs transition-[color,box-shadow] outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50 md:text-sm",e),...l})}function up(e){return e==="codex"?"codex":"claude"}function Mm(e,l){const r=e.find(i=>i.root===l?.onboardingContextRoot)??e[0]??null;return{projectPath:r?.root??l?.onboardingContextRoot??"",agentName:"",harness:up(r?.defaultHarness??l?.defaultHarness)}}function pA(e,l){return e.length!==l.length?!1:e.every((r,i)=>{const o=l[i];return r.publicKey===o?.publicKey&&r.fingerprint===o?.fingerprint&&r.name===o?.name&&r.pairedAt===o?.pairedAt&&r.pairedAtLabel===o?.pairedAtLabel&&r.lastSeen===o?.lastSeen&&r.lastSeenLabel===o?.lastSeenLabel})}function hA(e,l){return e.length!==l.length?!1:e.every((r,i)=>{const o=l[i];return r.sessionId===o?.sessionId&&r.turnId===o?.turnId&&r.blockId===o?.blockId&&r.version===o?.version&&r.risk===o?.risk&&r.title===o?.title&&r.description===o?.description&&r.detail===o?.detail&&r.actionKind===o?.actionKind&&r.actionStatus===o?.actionStatus})}function xA(e,l){return e===l?!0:!e||!l?e===l:e.status===l.status&&e.statusLabel===l.statusLabel&&e.statusDetail===l.statusDetail&&e.connectedPeerFingerprint===l.connectedPeerFingerprint&&e.isRunning===l.isRunning&&e.commandLabel===l.commandLabel&&e.configPath===l.configPath&&e.identityPath===l.identityPath&&e.trustedPeersPath===l.trustedPeersPath&&e.logPath===l.logPath&&e.relay===l.relay&&e.configuredRelay===l.configuredRelay&&e.secure===l.secure&&e.workspaceRoot===l.workspaceRoot&&e.sessionCount===l.sessionCount&&e.identityFingerprint===l.identityFingerprint&&e.trustedPeerCount===l.trustedPeerCount&&pA(e.trustedPeers,l.trustedPeers)&&hA(e.pendingApprovals,l.pendingApprovals)&&e.logTail===l.logTail&&e.logUpdatedAtLabel===l.logUpdatedAtLabel&&e.logMissing===l.logMissing&&e.logTruncated===l.logTruncated&&e.pairing?.relay===l.pairing?.relay&&e.pairing?.room===l.pairing?.room&&e.pairing?.publicKey===l.pairing?.publicKey&&e.pairing?.expiresAt===l.pairing?.expiresAt&&e.pairing?.qrValue===l.pairing?.qrValue&&e.pairing?.qrArt===l.pairing?.qrArt}function gA({open:e,selectedInterAgent:l,visibleAgentSession:r,agentSessionPending:i,agentSessionLoading:o,agentSessionFeedback:u,agentSessionCopied:d,agentSessionPeekViewportRef:f,handlePeekAgentSessionScroll:p,handleCopyAgentSessionCommand:h,handleOpenAgentSession:y,handleAgentSessionTraceIntent:g,closeAgentSessionPeek:v,renderLocalPathValue:k,s:S}){return!e||!l?null:a.jsx("div",{className:"fixed inset-0 z-40 flex items-center justify-center p-6",style:{backgroundColor:"rgba(244, 240, 232, 0.72)",backdropFilter:"blur(6px)"},onClick:v,children:a.jsxs("div",{className:"w-full max-w-5xl h-[78vh] border rounded-2xl overflow-hidden flex flex-col",style:{backgroundColor:b.surface,borderColor:b.border,boxShadow:"0 24px 72px rgba(15, 23, 42, 0.16)"},onClick:A=>A.stopPropagation(),children:[a.jsxs("div",{className:"px-4 h-14 border-b flex items-center justify-between gap-3 shrink-0",style:{borderBottomColor:b.border},children:[a.jsxs("div",{className:"min-w-0",children:[a.jsxs("div",{className:"text-[15px] font-semibold tracking-tight truncate",style:S.inkText,children:["Peek · ",l.title]}),a.jsx("div",{className:"text-[11px] truncate mt-0.5",style:S.mutedText,children:i?"Loading live session state for the selected agent.":r?.subtitle??"No live session output available yet."})]}),a.jsxs("div",{className:"flex items-center gap-2 shrink-0",children:[r?.commandLabel?a.jsx("button",{className:"os-toolbar-button flex items-center gap-1 text-[10px] font-medium px-2 py-0.5 rounded",style:{color:b.ink},onClick:h,children:d?"Copied":"Copy Attach"}):null,r?.mode==="debug"?a.jsx("button",{className:"os-toolbar-button flex items-center gap-1 text-[10px] font-medium px-2 py-0.5 rounded",style:{color:b.ink},onClick:y,children:r.debugMode==="tmux"?"Open TMUX":"Open Debug"}):null,a.jsxs("button",{className:"os-toolbar-button flex items-center gap-1 text-[10px] font-medium px-2 py-0.5 rounded",style:{color:b.ink},onClick:v,children:[a.jsx(Sl,{size:12}),"Close"]})]})]}),a.jsxs("div",{className:"px-4 py-2 border-b flex items-center gap-2 flex-wrap text-[10px] shrink-0",style:{borderBottomColor:b.border,color:b.muted},children:[a.jsx("span",{className:"text-[9px] font-mono uppercase px-1.5 py-0.5 rounded",style:r?.mode==="trace"?S.activePill:S.tagBadge,children:i?"Loading":r?.mode==="trace"?"Trace":r?.debugMode==="tmux"?"TMUX":r?.debugMode==="logs"?"Debug":"Unavailable"}),r?.trace?.session.adapterType?a.jsx("span",{className:"text-[9px] font-mono uppercase px-1.5 py-0.5 rounded",style:S.tagBadge,children:r.trace.session.adapterType}):null,r?.harness??l.harness?a.jsx("span",{className:"text-[9px] font-mono uppercase px-1.5 py-0.5 rounded",style:S.tagBadge,children:r?.harness??l.harness}):null,r?.transport??l.transport?a.jsx("span",{className:"text-[9px] font-mono uppercase px-1.5 py-0.5 rounded",style:S.tagBadge,children:r?.transport??l.transport}):null,r?.sessionId??l.sessionId?a.jsx("span",{className:"text-[9px] font-mono px-1.5 py-0.5 rounded",style:S.tagBadge,children:r?.sessionId??l.sessionId}):null,r?.updatedAtLabel?a.jsxs("span",{children:["Updated ",r.updatedAtLabel]}):null,r?.trace?a.jsxs("span",{children:[r.trace.turns.length," turns"]}):null,typeof r?.lineCount=="number"&&r.lineCount>0?a.jsxs("span",{children:[r.lineCount," lines"]}):null,r?.truncated?a.jsx("span",{children:"Tail only"}):null,a.jsx("span",{children:"Refreshing live while open"})]}),a.jsx("div",{className:"flex-1 overflow-hidden",style:{backgroundColor:b.bg},children:o&&!r?a.jsx("div",{className:"px-4 py-8 text-[12px]",style:S.mutedText,children:"Loading live session…"}):r?.mode==="trace"&&r.trace?a.jsx("div",{ref:A=>{f.current=A},onScroll:p,className:"h-full overflow-y-auto px-4 py-4",children:a.jsx($p,{snapshot:r.trace,onIntent:g})}):r?.body?a.jsx("pre",{ref:A=>{f.current=A},onScroll:p,className:"h-full px-4 py-4 text-[11px] leading-[1.58] overflow-x-auto overflow-y-auto whitespace-pre-wrap break-words",style:{color:b.ink,fontFamily:"ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace"},children:r.body}):a.jsx("div",{className:"px-4 py-8 text-[12px] leading-[1.65]",style:S.mutedText,children:i?"Loading live session state.":r?.subtitle??"No session output available yet."})}),a.jsxs("div",{className:"px-4 h-10 border-t flex items-center justify-between gap-3 shrink-0 text-[10px]",style:{borderTopColor:b.border,color:b.muted},children:[a.jsx("div",{className:"truncate min-w-0",children:k(r?.pathLabel??ii(l.cwd??l.projectRoot)??"No stable session path yet.",{className:"text-left underline underline-offset-2 decoration-dotted hover:opacity-80 transition-opacity"})}),u?a.jsx("div",{style:S.inkText,children:u}):null]})]})})}function bA({open:e,setOpen:l,agentableProjects:r,createAgentDraft:i,setCreateAgentDraft:o,createAgentDefaults:u,createAgentSubmitting:d,createAgentFeedback:f,setCreateAgentFeedback:p,handleBrowseCreateAgentProject:h,handleCreateAgent:y,availableAgentHarnesses:g,s:v}){return a.jsx(h0,{open:e,onOpenChange:l,children:a.jsxs(x0,{className:"sm:max-w-xl",children:[a.jsxs(g0,{children:[a.jsx(b0,{children:"New Agent"}),a.jsx(y0,{children:"Pick a project, choose a harness, and start a local relay agent without leaving the homepage."})]}),a.jsxs("div",{className:"space-y-4",children:[a.jsxs("div",{className:"space-y-2",children:[a.jsx("label",{className:"text-[11px] font-mono uppercase tracking-widest",style:v.mutedText,children:"Project"}),a.jsxs("select",{className:"w-full rounded-lg border px-3 py-2.5 text-[13px] outline-none",style:{borderColor:b.border,backgroundColor:b.surface,color:b.ink},value:r.find(k=>k.root===i.projectPath)?.id??"",onChange:k=>{const S=r.find(A=>A.id===k.target.value)??null;S&&(o(A=>({...A,projectPath:S.root,harness:up(S.defaultHarness||A.harness)})),p(null))},children:[a.jsx("option",{value:"",children:"Select a discovered project"}),r.map(k=>a.jsxs("option",{value:k.id,children:[k.title," · ",ii(k.root)??k.root]},k.id))]})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx("label",{className:"text-[11px] font-mono uppercase tracking-widest",style:v.mutedText,children:"Path"}),a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx(cp,{value:i.projectPath,onChange:k=>{o(S=>({...S,projectPath:k.target.value})),p(null)},placeholder:u.projectPath||"/path/to/project",className:"h-10"}),a.jsxs(Tt,{type:"button",variant:"outline",className:"shrink-0",onClick:h,children:[a.jsx(xa,{size:14}),"Browse"]})]})]}),a.jsxs("div",{className:"grid grid-cols-1 gap-4 sm:grid-cols-[1fr_160px]",children:[a.jsxs("div",{className:"space-y-2",children:[a.jsx("label",{className:"text-[11px] font-mono uppercase tracking-widest",style:v.mutedText,children:"Agent Name"}),a.jsx(cp,{value:i.agentName,onChange:k=>{o(S=>({...S,agentName:k.target.value})),p(null)},placeholder:"Optional. Defaults to the project name.",className:"h-10"})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx("label",{className:"text-[11px] font-mono uppercase tracking-widest",style:v.mutedText,children:"Harness"}),a.jsx("select",{className:"w-full rounded-lg border px-3 py-2.5 text-[13px] outline-none",style:{borderColor:b.border,backgroundColor:b.surface,color:b.ink},value:i.harness,onChange:k=>{o(S=>({...S,harness:up(k.target.value)})),p(null)},children:g.map(k=>a.jsx("option",{value:k,children:k},k))})]})]}),a.jsx("div",{className:"rounded-lg border px-3 py-3 text-[12px] leading-[1.6]",style:{borderColor:b.border,backgroundColor:b.surface,color:b.muted},children:"Scout will create the relay-agent config if needed, start the session, then refresh the desktop shell so the new agent appears immediately."}),f?a.jsx("div",{className:"text-[12px] leading-[1.6]",style:{color:"#b91c1c"},children:f}):null]}),a.jsxs(fA,{children:[a.jsx(Tt,{type:"button",variant:"outline",onClick:()=>l(!1),disabled:d,children:"Cancel"}),a.jsx(Tt,{type:"button",onClick:y,disabled:d||!i.projectPath.trim(),children:d?a.jsxs(a.Fragment,{children:[a.jsx(xn,{className:"mr-2"}),"Starting…"]}):a.jsxs(a.Fragment,{children:[a.jsx(ts,{size:14}),"Create Agent"]})})]})]})})}function yA({open:e,handleFeedbackDialogOpenChange:l,feedbackDraft:r,setFeedbackDraft:i,feedbackSubmission:o,feedbackActionPending:u,feedbackBundleLoading:d,feedbackBundle:f,feedbackBundleError:p,feedbackActionMessage:h,handleSubmitFeedbackReport:y,handleRefreshFeedbackBundle:g,handleRepairSetup:v,handleCopyFeedbackBundle:k,s:S}){return a.jsx(h0,{open:e,onOpenChange:l,children:a.jsxs(x0,{className:"sm:max-w-3xl",children:[a.jsxs(g0,{children:[a.jsx(b0,{children:"Feedback"}),a.jsx(y0,{children:"Submit feedback directly, copy a support bundle, inspect the local Scout environment, or repair onboarding and background services without leaving the current screen."})]}),a.jsxs("div",{className:"space-y-4",children:[a.jsxs("div",{className:"space-y-2",children:[a.jsx("div",{className:"text-[12px] font-medium",style:S.inkText,children:"What should we look at?"}),a.jsx(mA,{value:r,onChange:A=>i(A.target.value),placeholder:"Describe the issue, what you expected, and what Scout did instead.",className:"min-h-24 resize-y",disabled:u==="submit"}),o?a.jsxs("div",{className:"text-[11px] leading-[1.5]",style:S.mutedText,children:["Latest submission: ",a.jsx("a",{href:o.adminUrl,target:"_blank",rel:"noreferrer",className:"underline",children:o.key})]}):null]}),a.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[a.jsxs(Tt,{type:"button",onClick:y,disabled:d||u!==null,children:[u==="submit"?a.jsx(xn,{className:"mr-2"}):a.jsx(B1,{size:14}),"Submit Feedback"]}),a.jsxs(Tt,{type:"button",variant:"outline",onClick:g,disabled:d||u!==null,children:[u==="refresh"?a.jsx(xn,{className:"mr-2"}):a.jsx(gn,{size:14}),"Refresh"]}),a.jsxs(Tt,{type:"button",variant:"outline",onClick:v,disabled:d||u!==null,children:[u==="repair"?a.jsx(xn,{className:"mr-2"}):a.jsx(I1,{size:14}),"Repair Setup"]}),a.jsxs(Tt,{type:"button",onClick:k,disabled:d||u!==null||!f?.text,children:[u==="copy"?a.jsx(xn,{className:"mr-2"}):a.jsx(Or,{size:14}),"Copy Support Bundle"]})]}),h?a.jsx("div",{className:"text-[12px] leading-[1.6]",style:S.inkText,children:h}):null,p?a.jsx("div",{className:"text-[12px] leading-[1.6]",style:{color:"#b91c1c"},children:p}):null,a.jsxs("div",{className:"max-h-[60vh] space-y-3 overflow-y-auto pr-1",style:{scrollbarGutter:"stable both-edges"},children:[d&&!f?a.jsxs("div",{className:"flex items-center gap-2 text-[12px]",style:S.mutedText,children:[a.jsx(xn,{className:"text-[14px]"}),"Loading support details…"]}):null,f?a.jsxs(a.Fragment,{children:[a.jsxs("div",{className:"rounded-lg border px-3 py-2.5 text-[11px] leading-[1.6]",style:{borderColor:b.border,backgroundColor:b.surface},children:[a.jsx("span",{className:"font-mono uppercase tracking-widest",style:S.mutedText,children:"Generated"}),a.jsx("div",{className:"mt-1",style:S.inkText,children:f.generatedAtLabel})]}),f.sections.map(A=>a.jsxs("section",{className:"rounded-xl border",style:{borderColor:b.border,backgroundColor:b.surface},children:[a.jsx("div",{className:"border-b px-4 py-3",style:{borderBottomColor:b.border},children:a.jsx("h3",{className:"text-[12px] font-semibold tracking-tight",style:S.inkText,children:A.title})}),a.jsx("div",{className:"divide-y",style:{borderColor:b.border},children:A.entries.map(N=>a.jsxs("div",{className:"grid grid-cols-1 gap-1 px-4 py-3 text-[12px] leading-[1.6] sm:grid-cols-[160px_minmax(0,1fr)] sm:gap-3",children:[a.jsx("div",{className:"font-mono uppercase tracking-widest",style:S.mutedText,children:N.label}),a.jsx("div",{className:"break-words",style:S.inkText,children:N.value})]},`${A.id}-${N.label}`))})]},A.id))]}):null]})]})]})})}function vA({children:e,dark:l,setDark:r,C:i,s:o,productSurface:u,setProductSurface:d,activeView:f,setActiveView:p,desktopFeatures:h,pairingSurfaceBadge:y,openRelayDiagnostics:g,relayStatusTitle:v,relayRuntimeBooting:k,relayStatusDotClassName:S,relayStatusLabel:A,runtime:N,headerAgentCount:R,appReloadPending:L,handleReloadApp:H,handleQuitApp:X,navViews:V,collapsibleViews:D,isCollapsed:I,setIsCollapsed:F,pairingSurfaceProps:ne,isAgentSessionPeekOpen:O,selectedInterAgent:P,visibleAgentSession:Q,agentSessionPending:oe,agentSessionLoading:W,agentSessionFeedback:J,agentSessionCopied:w,agentSessionPeekViewportRef:Y,handlePeekAgentSessionScroll:G,closeAgentSessionPeek:ve,handleCopyAgentSessionCommand:T,handleOpenAgentSession:B,handleAgentSessionTraceIntent:le,renderLocalPathValue:M,isCreateAgentDialogOpen:pe,setIsCreateAgentDialogOpen:ge,agentableProjects:ce,createAgentDraft:Re,setCreateAgentDraft:Se,createAgentDefaults:Ne,createAgentSubmitting:Ve,createAgentFeedback:_e,setCreateAgentFeedback:Fe,handleBrowseCreateAgentProject:it,handleCreateAgent:rt,availableAgentHarnesses:ut,isFeedbackDialogOpen:st,handleFeedbackDialogOpenChange:vt,feedbackDraft:Ke,setFeedbackDraft:Ye,feedbackSubmission:et,feedbackActionPending:Me,feedbackBundleLoading:ot,feedbackBundle:Ce,feedbackBundleError:nt,feedbackActionMessage:mt,handleSubmitFeedbackReport:ae,handleRefreshFeedbackBundle:be,handleRepairSetup:we,handleCopyFeedbackBundle:ze,openFeedbackDialog:We,openKnowledgeBase:Ae,logsAttentionLevel:ue,logsButtonTitle:Te,footerTimeLabel:q}){return a.jsxs("div",{className:`flex flex-col h-screen w-full font-sans overflow-hidden${l?" dark":""}`,style:o.root,children:[a.jsxs("div",{className:"scout-window-bar h-12 border-b flex items-center px-3 shrink-0 z-10 gap-3",style:o.topBar,children:[a.jsxs("div",{className:"flex items-center gap-3",children:[a.jsx("button",{type:"button",className:"w-5 h-5 rounded-md flex items-center justify-center transition-colors hover:bg-[var(--os-hover)]",style:{WebkitAppRegion:"no-drag",color:i.muted},onClick:X,"aria-label":"Quit",title:"Quit",children:a.jsx("svg",{width:"8",height:"8",viewBox:"0 0 8 8",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",children:a.jsx("path",{d:"M1 1l6 6M7 1l-6 6"})})}),a.jsx("div",{className:"flex items-center gap-1.5 ml-2",children:[["relay","Relay",h.relay],["pairing","Pairing",h.pairing]].filter(([,,de])=>de).map(([de,ke])=>{const Qe=u===de,Be=de==="pairing"?y:null;return a.jsxs("button",{type:"button",onClick:()=>d(de),className:"flex items-center gap-2 rounded-lg border px-2.5 py-1 text-[12px] font-semibold tracking-tight transition-colors",style:Qe?{backgroundColor:i.surface,borderColor:i.border,color:i.ink,boxShadow:"0 1px 0 rgba(0,0,0,0.04)"}:{backgroundColor:i.bg,borderColor:i.border,color:i.muted},children:[a.jsx(NC,{surface:de,active:Qe}),a.jsx("span",{children:ke}),Be?a.jsx("span",{className:"rounded-full border px-1.5 py-0.5 text-[9px] font-medium uppercase tracking-[0.08em]",style:{backgroundColor:Be.backgroundColor,borderColor:Be.borderColor,color:Be.color},children:Be.label}):null]},de)})})]}),a.jsx("div",{className:"flex-1 self-stretch min-w-[120px] rounded-md cursor-grab active:cursor-grabbing","aria-hidden":"true"}),a.jsxs("div",{className:"flex items-center gap-5 shrink-0",children:[a.jsxs("div",{className:"flex items-center gap-3 font-mono text-[9px] uppercase tracking-wider",style:o.mutedText,children:[a.jsxs("button",{type:"button",onClick:g,className:"flex items-center gap-1.5 rounded-full border px-2 py-1 transition-opacity hover:opacity-80",style:{borderColor:i.border},title:v,children:["Relay",k?a.jsx(xn,{className:"text-[11px]",style:{color:i.muted},"aria-label":"Syncing relay status"}):a.jsxs(a.Fragment,{children:[a.jsx("div",{className:`w-1.5 h-1.5 rounded-full ${S}`}),a.jsx("span",{className:"font-medium",style:o.inkText,children:A})]})]}),a.jsxs("div",{className:"flex items-center gap-1.5",children:["Agents ",a.jsx("span",{className:"font-medium",style:o.inkText,children:R})]})]}),a.jsxs("div",{className:"flex items-center gap-2",style:o.mutedText,children:[a.jsx("button",{onClick:()=>r(de=>!de),className:"p-1 rounded transition-colors hover:opacity-70",title:l?"Switch to light mode":"Switch to dark mode",children:l?a.jsx(U1,{size:14}):a.jsx(D1,{size:14})}),a.jsx("button",{className:"hover:opacity-70 transition-opacity",onClick:H,title:L?"Reloading…":"Reload app",disabled:L,children:L?a.jsx(xn,{className:"text-[14px]"}):a.jsx(gn,{size:14})})]})]})]}),u==="relay"?a.jsxs(a.Fragment,{children:[a.jsxs("div",{className:"flex flex-1 overflow-hidden os-fade-in",children:[a.jsxs("div",{className:"w-12 border-r flex flex-col items-center py-2 gap-3 shrink-0 z-10",style:o.navBar,children:[a.jsx("div",{className:"flex flex-col gap-1 w-full px-2 mt-2",style:o.mutedText,children:V.map(({id:de,icon:ke,title:Qe,badgeCount:Be})=>a.jsxs("button",{onClick:()=>p(de),title:Qe,className:"relative p-1.5 rounded flex items-center justify-center transition-colors",style:f===de?o.activePill:void 0,children:[ke,Be?a.jsx("span",{className:"absolute -top-1 -right-1 min-w-[16px] h-4 px-1 rounded-full text-[9px] font-mono flex items-center justify-center",style:{backgroundColor:"#f97316",color:"#fff7ed"},children:Be>9?"9+":Be}):null]},de))}),a.jsxs("div",{className:"mt-auto flex flex-col gap-1 items-center w-full px-2",children:[D.has(f)?a.jsx("button",{onClick:()=>F(de=>!de),className:"p-1.5 rounded flex items-center justify-center transition-opacity hover:opacity-70",style:o.mutedText,title:I?"Expand Sidebar":"Collapse Sidebar",children:I?a.jsx(_w,{size:16,strokeWidth:1.5}):a.jsx(Lw,{size:16,strokeWidth:1.5})}):null,h.settings?a.jsx("button",{className:"p-1.5 rounded flex items-center justify-center transition-colors",style:f==="settings"?o.activePill:o.mutedText,title:"Settings",onClick:()=>p("settings"),children:a.jsx(ni,{size:16,strokeWidth:1.5})}):null]})]}),e]}),a.jsx(gA,{open:O,selectedInterAgent:P,visibleAgentSession:Q,agentSessionPending:oe,agentSessionLoading:W,agentSessionFeedback:J,agentSessionCopied:w,agentSessionPeekViewportRef:Y,handlePeekAgentSessionScroll:G,handleCopyAgentSessionCommand:T,handleOpenAgentSession:B,handleAgentSessionTraceIntent:le,closeAgentSessionPeek:ve,renderLocalPathValue:M,s:o})]}):a.jsx(vC,{...ne}),a.jsx(bA,{open:pe,setOpen:ge,agentableProjects:ce,createAgentDraft:Re,setCreateAgentDraft:Se,createAgentDefaults:Ne,createAgentSubmitting:Ve,createAgentFeedback:_e,setCreateAgentFeedback:Fe,handleBrowseCreateAgentProject:it,handleCreateAgent:rt,availableAgentHarnesses:ut,s:o}),a.jsx(yA,{open:st,handleFeedbackDialogOpenChange:vt,feedbackDraft:Ke,setFeedbackDraft:Ye,feedbackSubmission:et,feedbackActionPending:Me,feedbackBundleLoading:ot,feedbackBundle:Ce,feedbackBundleError:nt,feedbackActionMessage:mt,handleSubmitFeedbackReport:ae,handleRefreshFeedbackBundle:be,handleRepairSetup:we,handleCopyFeedbackBundle:ze,s:o}),a.jsxs("div",{className:"h-6 border-t flex items-center justify-between px-3 shrink-0 text-[9px] font-mono uppercase tracking-widest",style:{backgroundColor:i.bg,borderTopColor:i.border,color:i.muted},children:[a.jsx("div",{className:"flex items-center gap-4",children:a.jsxs("button",{type:"button",onClick:()=>{d("relay"),p("overview")},className:"flex items-center gap-1 hover:opacity-70 cursor-pointer transition-opacity",children:[a.jsx(zp,{size:9})," Home"]})}),a.jsxs("div",{className:"flex items-center gap-3",children:[a.jsxs("button",{type:"button",onClick:We,className:"flex items-center gap-1 rounded px-1.5 py-0.5 transition-colors hover:opacity-80",style:st?o.activePill:o.mutedText,title:"Feedback",children:[a.jsx(Bl,{size:9}),a.jsx("span",{children:"Feedback"})]}),a.jsxs("button",{type:"button",onClick:Ae,className:"flex items-center gap-1 rounded px-1.5 py-0.5 transition-colors hover:opacity-80",style:f==="help"?o.activePill:o.mutedText,title:"Help",children:[a.jsx(A1,{size:9}),a.jsx("span",{children:"Help"})]}),a.jsxs("button",{onClick:()=>{d("relay"),p("logs")},className:"flex items-center gap-1 rounded px-1.5 py-0.5 transition-colors hover:opacity-80",style:f==="logs"?o.activePill:o.mutedText,title:Te,children:[a.jsx(Co,{size:9}),a.jsx("span",{children:"Logs"}),ue?a.jsx("span",{className:`block w-1.5 h-1.5 rounded-full ${ue==="error"?"bg-rose-500":"bg-amber-500"}`}):null]}),a.jsx("span",{className:"w-px h-3",style:{backgroundColor:i.border}}),a.jsx("span",{style:o.inkText,children:q})]})]})]})}function jA(e,l){return e==="working"?l.activePill:e==="available"?{backgroundColor:"rgba(34, 197, 94, 0.12)",color:"#166534"}:l.tagBadge}function kA({C:e,s:l,bootLoader:r,homeAgents:i,activity:o,shellError:u,onRefresh:d,onOpenAgent:f,colorForIdentity:p}){const h=z.useMemo(()=>i.slice(0,8),[i]),y=z.useMemo(()=>o.slice(0,18),[o]),g=z.useCallback(async(v,k)=>{if(v.stopPropagation(),!(typeof navigator>"u"||!navigator.clipboard?.writeText))try{await navigator.clipboard.writeText(k)}catch{}},[]);return a.jsx("div",{className:"flex-1 flex overflow-hidden",children:a.jsx("div",{className:"flex-1 overflow-y-auto",children:a.jsxs("div",{className:"w-full px-8 py-8",children:[a.jsxs("div",{className:"flex items-center justify-between mb-8",children:[a.jsxs("div",{children:[a.jsx("h1",{className:"text-[22px] font-semibold tracking-tight",style:l.inkText,children:"Home"}),a.jsx("p",{className:"text-[12px] mt-1 leading-[1.6]",style:l.mutedText,children:"Recent agents and the latest relay activity."})]}),a.jsx("button",{onClick:d,className:"os-btn flex items-center gap-1.5 px-2.5 py-1.5 rounded-lg text-[12px] transition-colors",style:{color:e.muted},title:"Refresh",children:a.jsx(gn,{size:13})})]}),a.jsxs("section",{className:"mb-8",children:[a.jsxs("div",{className:"flex items-center justify-between mb-4",children:[a.jsx("h2",{className:"text-[16px] font-semibold",style:l.inkText,children:"Recent Agents"}),i.length>h.length?a.jsxs("div",{className:"text-[11px]",style:l.mutedText,children:["Top ",h.length," by recent activity"]}):null]}),h.length>0?a.jsx("div",{className:"-mx-2 overflow-x-auto px-2 pb-2",children:a.jsx("div",{className:"flex gap-3 min-w-max",children:h.map(v=>a.jsx("button",{type:"button",onClick:()=>f(v.id),className:"w-[220px] shrink-0 text-left rounded-xl border px-4 py-3 transition-colors hover:opacity-90",style:{borderColor:e.border,backgroundColor:e.surface},children:a.jsxs("div",{className:"flex items-start gap-3",children:[a.jsx("div",{className:"w-10 h-10 rounded-full text-white flex items-center justify-center text-[12px] font-bold shrink-0",style:{backgroundColor:p(v.id)},title:v.title,children:v.title.charAt(0).toUpperCase()}),a.jsxs("div",{className:"min-w-0 flex-1",children:[a.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[a.jsx("div",{className:"text-[13px] font-semibold truncate",style:l.inkText,children:v.title}),a.jsx("span",{className:"text-[9px] font-mono uppercase px-1.5 py-0.5 rounded-full",style:jA(v.state,l),children:v.statusLabel})]}),v.role?a.jsx("div",{className:"text-[11px] mt-1 truncate",style:l.mutedText,children:v.role}):null,v.statusDetail?a.jsx("div",{className:"text-[11px] mt-2 line-clamp-2",style:l.mutedText,children:v.statusDetail}):v.summary?a.jsx("div",{className:"text-[11px] mt-2 line-clamp-2",style:l.mutedText,children:v.summary}):null,v.timestampLabel?a.jsxs("div",{className:"text-[10px] mt-2 uppercase tracking-[0.12em]",style:l.mutedText,children:["Active ",v.timestampLabel]}):null]})]})},v.id))})}):a.jsx("div",{className:"rounded-xl border px-4 py-6 text-[13px]",style:{borderColor:e.border,color:e.muted},children:"No agents are visible yet."})]}),a.jsxs("section",{children:[a.jsx("div",{className:"flex items-center justify-between mb-4",children:a.jsx("h2",{className:"text-[16px] font-semibold",style:l.inkText,children:"Activity Stream"})}),r?a.jsx("div",{className:"min-h-[20rem] flex items-center justify-center rounded-xl border px-6 py-8",style:{borderColor:e.border,backgroundColor:e.surface},children:r}):y.length>0?a.jsx("div",{className:"divide-y rounded-xl border overflow-hidden",style:{borderColor:e.border},children:y.map(v=>a.jsxs("div",{className:"group relative flex items-start gap-4 px-4 py-4",style:{backgroundColor:e.surface},children:[a.jsx("button",{type:"button",className:"relative shrink-0 mt-0.5",onClick:()=>f(v.actorId),title:v.actorName,children:a.jsx("div",{className:"w-9 h-9 rounded-full text-white flex items-center justify-center text-[12px] font-bold",style:{backgroundColor:p(v.actorId)},children:v.actorName.slice(0,1).toUpperCase()})}),a.jsxs("div",{className:"min-w-0 flex-1",children:[a.jsxs("div",{className:"flex items-center gap-2 mb-1 flex-wrap",children:[a.jsx("button",{type:"button",className:"text-[13px] font-semibold transition-opacity hover:opacity-75",style:l.inkText,onClick:()=>f(v.actorId),title:`Open ${v.actorName}`,children:v.actorName}),v.kind==="system"?a.jsx("span",{className:"text-[10px] font-mono px-2 py-0.5 rounded-full",style:l.tagBadge,children:"system"}):v.channel?a.jsxs("span",{className:"text-[10px] font-mono px-2 py-0.5 rounded-full",style:l.tagBadge,children:["#",v.channel]}):null,a.jsx("span",{className:"flex-1"}),a.jsxs("span",{className:"text-[11px] flex items-center gap-1",style:l.mutedText,children:[a.jsx(as,{size:10}),v.timestampLabel]})]}),a.jsx("div",{className:"text-[13px] leading-[1.65]",style:l.mutedText,children:v.detail??v.title})]}),v.detail?a.jsx("div",{className:"absolute right-3 top-3 flex items-center gap-0.5 rounded-lg border p-1 opacity-0 group-hover:opacity-100 transition-opacity",style:{backgroundColor:e.bg,borderColor:e.border},children:a.jsx("button",{onClick:k=>{g(k,v.detail??"")},className:"p-1 rounded hover:opacity-70",style:{color:e.muted},title:"Copy",children:a.jsx(Or,{size:12})})}):null]},v.id))}):a.jsx("div",{className:"py-16 text-center border rounded-xl",style:{borderColor:e.border},children:a.jsx("div",{className:"text-[13px]",style:l.mutedText,children:"Waiting for recent activity..."})})]}),u?a.jsx("div",{className:"mt-6 rounded-xl border px-4 py-3",style:{borderColor:e.border,backgroundColor:e.surface},children:a.jsxs("div",{className:"flex items-center gap-2 text-[12px]",style:l.mutedText,children:[a.jsx(Sl,{size:12}),a.jsx("span",{children:u})]})}):null]})})})}function NA({activeView:e,overviewViewProps:l,inbox:r,activity:i}){return e==="overview"?a.jsx(kA,{...l}):e==="inbox"?a.jsx(a.Fragment,{children:a.jsxs("div",{className:"flex-1 flex flex-col min-w-0",style:r.styles.surface,children:[a.jsxs("div",{className:"border-b shrink-0 px-6 py-5",style:{borderBottomColor:b.border},children:[a.jsx("div",{className:"flex items-start justify-between gap-6",children:a.jsxs("div",{className:"min-w-0",children:[a.jsx("div",{className:"text-[10px] font-mono tracking-widest uppercase mb-2",style:r.styles.mutedText,children:"Inbox"}),a.jsx("h1",{className:"text-[28px] font-semibold tracking-tight",style:r.styles.inkText,children:"Things You Asked Scout To Tell You About"}),a.jsx("p",{className:"text-[13px] mt-2 max-w-3xl leading-[1.65]",style:r.styles.mutedText,children:"Notifications are opt-in. This surface is reserved for approvals, failed asks, and other subscribed updates that are actually worth surfacing."})]})}),a.jsx("div",{className:"grid grid-cols-4 gap-3 mt-5",children:[{label:"Needs You",value:`${r.inboxAlertCount}`,detail:`${r.pendingApprovalsCount} approvals · ${r.inboxFailedTaskCount} failed asks`},{label:"Approvals",value:`${r.pendingApprovalsCount}`,detail:"Inline pairing actions"},{label:"Failures",value:`${r.inboxFailedTaskCount}`,detail:"Failed asks from plans"},{label:"Policy",value:"Opt-in",detail:"Progress and watchlists stay elsewhere"}].map(o=>a.jsxs("div",{className:"rounded-xl border px-4 py-3",style:{borderColor:b.border,backgroundColor:b.bg},children:[a.jsx("div",{className:"text-[9px] font-mono uppercase tracking-widest",style:r.styles.mutedText,children:o.label}),a.jsx("div",{className:"text-[24px] font-semibold mt-2",style:r.styles.inkText,children:o.value}),a.jsx("div",{className:"text-[11px] mt-1",style:r.styles.mutedText,children:o.detail})]},o.label))})]}),a.jsx("div",{className:"flex-1 overflow-y-auto px-6 py-5",children:a.jsxs("div",{className:"grid grid-cols-[minmax(0,1.1fr)_minmax(320px,0.9fr)] gap-4",children:[a.jsxs("section",{className:"border rounded-xl overflow-hidden min-w-0",style:{...r.styles.surface,borderColor:b.border},children:[a.jsxs("div",{className:"px-4 py-3 border-b flex items-center justify-between gap-3",style:{borderBottomColor:b.border},children:[a.jsxs("div",{children:[a.jsx("div",{className:"text-[10px] font-mono tracking-widest uppercase",style:r.styles.mutedText,children:"Needs You"}),a.jsx("div",{className:"text-[11px] mt-1",style:r.styles.mutedText,children:"Approvals and failed asks that are worth interrupting for."})]}),a.jsxs("span",{className:"text-[9px] font-mono uppercase px-1.5 py-0.5 rounded",style:r.inboxAlertCount>0?r.styles.activePill:r.styles.tagBadge,children:[r.inboxAlertCount," items"]})]}),a.jsx("div",{className:"divide-y",style:{borderColor:b.border},children:r.inboxAwaitingYouItems.length>0?r.inboxAwaitingYouItems.map(o=>a.jsx("div",{className:"px-4 py-4",style:{backgroundColor:b.surface},children:a.jsxs("div",{className:"flex items-start justify-between gap-3",children:[a.jsxs("div",{className:"min-w-0",children:[a.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[a.jsx("span",{className:"text-[9px] font-mono uppercase px-1.5 py-0.5 rounded",style:o.tone==="critical"?{backgroundColor:"rgba(248, 113, 113, 0.14)",color:"#b91c1c"}:o.tone==="warning"?{backgroundColor:"rgba(251, 191, 36, 0.16)",color:"#92400e"}:r.styles.activePill,children:o.kind}),a.jsx("span",{className:"text-[9px] font-mono",style:r.styles.mutedText,children:o.meta})]}),a.jsx("div",{className:"text-[13px] font-medium mt-2 leading-[1.5]",style:r.styles.inkText,children:o.title}),a.jsx("div",{className:"text-[11px] mt-1 leading-[1.6]",style:r.styles.mutedText,children:o.summary}),o.detail&&o.detail!==o.summary?a.jsx("div",{className:"mt-2 rounded-lg border px-3 py-2 text-[11px] leading-[1.6]",style:{borderColor:b.border,backgroundColor:b.bg,color:b.muted},children:o.detail}):null]}),a.jsxs("div",{className:"flex flex-col items-end gap-2 shrink-0",children:[a.jsx("button",{type:"button",onClick:o.onAction,className:"text-[10px] font-medium hover:opacity-80",style:{color:b.accent},children:o.actionLabel}),o.onSecondaryAction&&o.secondaryActionLabel?a.jsx("button",{type:"button",onClick:o.onSecondaryAction,className:"text-[10px] font-medium hover:opacity-80",style:r.styles.mutedText,children:o.secondaryActionLabel}):null]})]})},o.id)):a.jsx("div",{className:"px-4 py-10 text-[12px] text-center",style:r.styles.mutedText,children:"Nothing urgent right now."})})]}),a.jsx("div",{className:"space-y-4 min-w-0",children:a.jsxs("section",{className:"border rounded-xl overflow-hidden",style:{...r.styles.surface,borderColor:b.border},children:[a.jsxs("div",{className:"px-4 py-3 border-b",style:{borderBottomColor:b.border},children:[a.jsx("div",{className:"text-[10px] font-mono tracking-widest uppercase",style:r.styles.mutedText,children:"Notes"}),a.jsx("div",{className:"text-[11px] mt-1",style:r.styles.mutedText,children:"This is UI-only for now, backed by existing desktop state instead of durable broker attention events."})]}),a.jsx("div",{className:"px-4 py-4 text-[11px] leading-[1.7]",style:r.styles.mutedText,children:"Inbox is currently limited to approvals and failed asks. Agent progress, stale/problem states, and cleanup flows stay in other parts of Scout."})]})})]})})]})}):e!=="activity"?null:a.jsx(CA,{activity:i})}const py=280,hy=["#6366f1","#f59e0b","#10b981","#ef4444","#8b5cf6","#ec4899","#14b8a6","#f97316","#06b6d4","#84cc16"];function zm(e){let l=0;for(let r=0;r<e.length;r++)l=(l<<5)-l+e.charCodeAt(r)|0;return hy[Math.abs(l)%hy.length]}function wA(e){const l=[];for(const r of e.activityTasks)l.push({id:`task-${r.id}`,kind:"task",sortKey:r.createdAt,actor:r.targetAgentName,avatarLabel:r.targetAgentName.charAt(0).toUpperCase(),avatarColor:zm(r.targetAgentId),eventLabel:r.statusLabel,timestamp:r.ageLabel??r.updatedAtLabel??r.createdAtLabel,body:r.title+(r.statusDetail?`
58
+ ${r.statusDetail}`:"")+(r.replyPreview?`
59
+ ${r.replyPreview}`:""),channel:r.project,data:r});for(const r of e.activityRecentMessages)l.push({id:`msg-${r.id}`,kind:"message",sortKey:r.createdAt,actor:r.authorName,avatarLabel:r.avatarLabel,avatarColor:r.avatarColor,eventLabel:r.messageClass??"message",timestamp:r.timestampLabel,body:r.body,channel:r.normalizedChannel,data:r});for(const r of e.activityFindings)l.push({id:`finding-${r.id}`,kind:"finding",sortKey:Date.now(),actor:r.targetAgentName??"System",avatarLabel:(r.targetAgentName??"S").charAt(0).toUpperCase(),avatarColor:r.severity==="error"?"#ef4444":"#f59e0b",eventLabel:r.severity,timestamp:r.ageLabel??r.updatedAtLabel??"",body:`${r.title}
60
+ ${r.summary}`,channel:null,data:r});for(const r of e.activityEndpoints)l.push({id:`ep-${r.endpoint.id}`,kind:"endpoint",sortKey:Date.now()-1,actor:r.endpoint.agentName,avatarLabel:r.endpoint.agentName.charAt(0).toUpperCase(),avatarColor:zm(r.endpoint.agentId),eventLabel:r.endpoint.stateLabel,timestamp:r.endpoint.lastActiveLabel??"",body:r.endpoint.activeTask??`${r.endpoint.stateLabel} on ${r.machineTitle}`,channel:r.endpoint.project,data:r});for(const r of e.overviewSessions)l.push({id:`session-${r.id}`,kind:"session",sortKey:new Date(r.lastModified).getTime()||0,actor:r.agent,avatarLabel:r.agent.charAt(0).toUpperCase(),avatarColor:zm(r.agent),eventLabel:"session",timestamp:r.lastModified,body:r.title+(r.preview?`
61
+ ${r.preview}`:""),channel:r.project,data:r});return l.sort((r,i)=>i.sortKey-r.sortKey),l}const SA={task:"Task",message:"Message",finding:"Finding",endpoint:"Endpoint",session:"Session"};function CA({activity:e}){const[l,r]=E.useState(null),[i,o]=E.useState(()=>new Set),u=E.useMemo(()=>wA(e),[e.activityTasks,e.activityRecentMessages,e.activityFindings,e.activityEndpoints,e.overviewSessions]),d=E.useMemo(()=>{const g=new Set;for(const v of u)v.channel&&g.add(v.channel);return Array.from(g).sort()},[u]),[f,p]=E.useState(null),h=f?u.filter(g=>g.channel===f):u,y=l?u.find(g=>g.id===l)??null:null;return a.jsxs("div",{className:"flex-1 flex flex-col min-w-0",style:e.styles.surface,children:[a.jsxs("div",{className:"border-b shrink-0 px-6 py-3",style:{borderBottomColor:b.border},children:[a.jsxs("div",{className:"flex items-center justify-between gap-6",children:[a.jsxs("div",{className:"flex items-center gap-4 min-w-0",children:[a.jsx("h1",{className:"text-[18px] font-semibold tracking-tight",style:e.styles.inkText,children:"Activity"}),a.jsx("div",{className:"flex items-center gap-3",children:[{label:"Running",value:e.plansState?.runningTaskCount??0},{label:"Watchlist",value:e.plansState?.findingCount??0},{label:"Agents",value:e.runtime?.agentCount??0}].map(g=>a.jsxs("span",{className:"text-[11px] font-mono",style:e.styles.mutedText,children:[g.label," ",a.jsx("span",{style:e.styles.inkText,children:g.value})]},g.label))})]}),a.jsxs("div",{className:"flex items-center gap-2 shrink-0",children:[a.jsxs("button",{type:"button",onClick:e.onRefresh,className:"os-toolbar-button flex items-center gap-1 text-[10px] font-medium px-2 py-0.5 rounded",style:{color:b.ink},children:[a.jsx(gn,{size:14}),"Refresh"]}),a.jsxs("button",{type:"button",onClick:e.onOpenPlans,className:"os-toolbar-button flex items-center gap-1 text-[10px] font-medium px-2 py-0.5 rounded",style:{color:b.ink},children:[a.jsx(Mp,{size:14}),"Plans"]}),a.jsxs("button",{type:"button",onClick:e.onOpenMessages,className:"os-toolbar-button flex items-center gap-1 text-[10px] font-medium px-2 py-0.5 rounded",style:{color:b.ink},children:[a.jsx(Bl,{size:14}),"Messages"]})]})]}),d.length>0&&a.jsxs("div",{className:"flex items-center gap-1.5 mt-3 overflow-x-auto",children:[a.jsx("button",{type:"button",onClick:()=>p(null),className:"text-[10px] font-medium px-2.5 py-1 rounded-full shrink-0 transition-colors",style:f===null?{backgroundColor:b.accent,color:"#fff"}:{backgroundColor:b.bg,color:b.muted,border:`1px solid ${b.border}`},children:"All"}),d.map(g=>a.jsx("button",{type:"button",onClick:()=>p(f===g?null:g),className:"text-[10px] font-medium px-2.5 py-1 rounded-full shrink-0 transition-colors",style:f===g?{backgroundColor:b.accent,color:"#fff"}:{backgroundColor:b.bg,color:b.muted,border:`1px solid ${b.border}`},children:g},g))]})]}),a.jsxs("div",{className:"flex-1 flex min-h-0",children:[a.jsx("div",{className:"flex-1 overflow-y-auto min-w-0",children:h.length>0?a.jsx("div",{className:"px-5 py-4 space-y-1",children:h.map(g=>{const v=g.id===l,k=i.has(g.id),S=g.body.length>py,A=S&&!k?g.body.slice(0,py)+"...":g.body;return a.jsxs("div",{className:"flex items-start gap-3 rounded-xl px-3 py-3 transition-colors cursor-pointer",style:{backgroundColor:v?b.accentBg:"transparent"},onClick:()=>r(v?null:g.id),role:"button",tabIndex:0,onKeyDown:N=>{(N.key==="Enter"||N.key===" ")&&(N.preventDefault(),r(v?null:g.id))},children:[a.jsx("div",{className:"w-8 h-8 rounded-full text-white flex items-center justify-center text-[11px] font-bold shrink-0 mt-0.5",style:{backgroundColor:g.avatarColor},children:g.avatarLabel}),a.jsxs("div",{className:"flex-1 min-w-0",children:[a.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[a.jsx("span",{className:"text-[13px] font-semibold",style:e.styles.inkText,children:g.actor}),a.jsx("span",{className:"text-[9px] font-mono uppercase px-1.5 py-0.5 rounded",style:g.kind==="task"?v0(e,g.data.status):g.kind==="finding"?j0(g.data.severity):g.kind==="endpoint"?k0(e,g.data.endpoint.state):e.styles.tagBadge,children:g.eventLabel}),a.jsx("span",{className:"text-[10px] font-mono",style:e.styles.mutedText,children:g.timestamp})]}),a.jsx("div",{className:"text-[12px] leading-[1.7] mt-1.5 whitespace-pre-wrap",style:e.styles.inkText,children:A}),S&&a.jsx("button",{type:"button",onClick:N=>{N.stopPropagation(),o(R=>{const L=new Set(R);return L.has(g.id)?L.delete(g.id):L.add(g.id),L})},className:"text-[11px] font-medium mt-1 hover:opacity-80",style:{color:b.accent},children:k?"Show less":"Show more"}),g.channel&&a.jsx("div",{className:"mt-1.5",children:a.jsx("span",{className:"text-[9px] font-mono px-1.5 py-0.5 rounded",style:e.styles.tagBadge,children:g.channel})})]}),a.jsx("div",{className:"shrink-0 mt-1",children:a.jsx(_l,{size:14,style:{color:b.muted,opacity:v?1:.3}})})]},g.id)})}):a.jsx("div",{className:"flex items-center justify-center h-full",children:a.jsx("div",{className:"text-[12px] text-center",style:e.styles.mutedText,children:"No activity yet."})})}),y&&a.jsxs("div",{className:"border-l overflow-y-auto shrink-0",style:{width:360,borderLeftColor:b.border,backgroundColor:b.bg},children:[a.jsxs("div",{className:"px-5 py-3 border-b flex items-center justify-between gap-3",style:{borderBottomColor:b.border},children:[a.jsxs("span",{className:"text-[10px] font-mono uppercase tracking-widest",style:e.styles.mutedText,children:[SA[y.kind]," Details"]}),a.jsx("button",{type:"button",onClick:()=>r(null),className:"shrink-0 hover:opacity-80",style:{color:b.muted},children:a.jsx(Sl,{size:14})})]}),a.jsxs("div",{className:"px-5 py-4",children:[y.kind==="task"&&a.jsx(TA,{task:y.data,activity:e}),y.kind==="message"&&a.jsx(AA,{message:y.data,activity:e}),y.kind==="finding"&&a.jsx(EA,{finding:y.data,activity:e}),y.kind==="endpoint"&&a.jsx(RA,{entry:y.data,activity:e}),y.kind==="session"&&a.jsx(MA,{session:y.data,activity:e})]})]})]})]})}function v0(e,l){switch(l){case"running":return e.styles.activePill;case"failed":return{backgroundColor:"rgba(248, 113, 113, 0.14)",color:"#b91c1c"};case"completed":return{backgroundColor:"rgba(34, 197, 94, 0.12)",color:"#166534"};default:return e.styles.tagBadge}}function j0(e){return e==="error"?{backgroundColor:"rgba(248, 113, 113, 0.14)",color:"#b91c1c"}:{backgroundColor:"rgba(245, 158, 11, 0.14)",color:"#b45309"}}function k0(e,l){switch(l){case"running":return e.styles.activePill;case"waiting":return{backgroundColor:"rgba(245, 158, 11, 0.14)",color:"#b45309"};default:return e.styles.tagBadge}}function Et({label:e,children:l,styles:r}){return a.jsxs("div",{className:"mb-3",children:[a.jsx("div",{className:"text-[9px] font-mono uppercase tracking-widest mb-1",style:r.mutedText,children:e}),a.jsx("div",{className:"text-[12px] leading-[1.6]",style:r.inkText,children:l})]})}function TA({task:e,activity:l}){const{styles:r}=l;return a.jsxs("div",{children:[a.jsx(Et,{label:"Status",styles:r,children:a.jsx("span",{className:"text-[10px] font-mono uppercase px-1.5 py-0.5 rounded",style:v0(l,e.status),children:e.statusLabel})}),a.jsx(Et,{label:"Agent",styles:r,children:e.targetAgentName}),e.project&&a.jsx(Et,{label:"Project",styles:r,children:e.project}),a.jsx(Et,{label:"Created",styles:r,children:e.createdAtLabel}),e.updatedAtLabel&&a.jsx(Et,{label:"Updated",styles:r,children:e.updatedAtLabel}),e.ageLabel&&a.jsx(Et,{label:"Age",styles:r,children:e.ageLabel}),e.body&&e.body!==e.title&&a.jsxs("div",{className:"mt-4",children:[a.jsx("div",{className:"text-[9px] font-mono uppercase tracking-widest mb-1",style:r.mutedText,children:"Full Body"}),a.jsx("div",{className:"text-[11px] leading-[1.65] rounded-lg border px-3 py-2 whitespace-pre-wrap",style:{borderColor:b.border,backgroundColor:b.surface,...r.mutedText},children:e.body})]}),a.jsxs("button",{type:"button",onClick:()=>l.onOpenAgentProfile(e.targetAgentId),className:"mt-5 text-[11px] font-medium hover:opacity-80",style:{color:b.accent},children:["Open ",e.targetAgentName]})]})}function AA({message:e,activity:l}){const{styles:r}=l,i=l.interAgentAgentLookup.get(e.authorId)??null,o=e.recipients.filter(u=>u!==e.authorId);return a.jsxs("div",{children:[e.messageClass&&a.jsx(Et,{label:"Event",styles:r,children:a.jsx("span",{className:"text-[10px] font-mono uppercase px-1.5 py-0.5 rounded",style:e.messageClass==="status"?l.styles.activePill:l.styles.tagBadge,children:e.messageClass})}),a.jsx(Et,{label:"Time",styles:r,children:e.timestampLabel}),a.jsx(Et,{label:"Author",styles:r,children:e.authorName}),o.length>0&&a.jsx(Et,{label:"Recipients",styles:r,children:o.join(", ")}),e.normalizedChannel&&a.jsx(Et,{label:"Channel",styles:r,children:e.normalizedChannel}),a.jsx(Et,{label:"Thread",styles:r,children:a.jsx("span",{className:"font-mono text-[10px]",children:e.conversationId})}),i&&a.jsxs("button",{type:"button",onClick:()=>l.onOpenAgentProfile(i.id),className:"mt-4 text-[11px] font-medium hover:opacity-80",style:{color:b.accent},children:["Open ",i.title??e.authorName]})]})}function EA({finding:e,activity:l}){const{styles:r}=l;return a.jsxs("div",{children:[a.jsx(Et,{label:"Severity",styles:r,children:a.jsx("span",{className:"text-[10px] font-mono uppercase px-1.5 py-0.5 rounded",style:j0(e.severity),children:e.severity})}),a.jsx(Et,{label:"Kind",styles:r,children:e.kind}),e.targetAgentName&&a.jsx(Et,{label:"Agent",styles:r,children:e.targetAgentName}),e.requesterName&&a.jsx(Et,{label:"Requester",styles:r,children:e.requesterName}),e.ageLabel&&a.jsx(Et,{label:"Age",styles:r,children:e.ageLabel}),e.detail&&a.jsxs("div",{className:"mt-4",children:[a.jsx("div",{className:"text-[9px] font-mono uppercase tracking-widest mb-1",style:r.mutedText,children:"Detail"}),a.jsx("div",{className:"text-[11px] leading-[1.65] rounded-lg border px-3 py-2 whitespace-pre-wrap",style:{borderColor:b.border,backgroundColor:b.surface,...r.mutedText},children:e.detail})]}),e.targetAgentId&&a.jsxs("button",{type:"button",onClick:()=>l.onOpenAgentProfile(e.targetAgentId),className:"mt-5 text-[11px] font-medium hover:opacity-80",style:{color:b.accent},children:["Open ",e.targetAgentName]})]})}function RA({entry:e,activity:l}){const{styles:r}=l,i=e.endpoint;return a.jsxs("div",{children:[a.jsx(Et,{label:"State",styles:r,children:a.jsx("span",{className:"text-[10px] font-mono uppercase px-1.5 py-0.5 rounded",style:k0(l,i.state),children:i.stateLabel})}),a.jsx(Et,{label:"Machine",styles:r,children:e.machineTitle}),a.jsx(Et,{label:"Transport",styles:r,children:i.transport??"runtime"}),i.project&&a.jsx(Et,{label:"Project",styles:r,children:i.project}),i.harness&&a.jsx(Et,{label:"Harness",styles:r,children:i.harness}),i.lastActiveLabel&&a.jsx(Et,{label:"Last Active",styles:r,children:i.lastActiveLabel}),a.jsxs("button",{type:"button",onClick:()=>l.onOpenAgentProfile(i.agentId),className:"mt-5 text-[11px] font-medium hover:opacity-80",style:{color:b.accent},children:["Open ",i.agentName]})]})}function MA({session:e,activity:l}){const{styles:r}=l;return a.jsxs("div",{children:[a.jsx(Et,{label:"Project",styles:r,children:e.project}),a.jsx(Et,{label:"Agent",styles:r,children:e.agent}),a.jsx(Et,{label:"Messages",styles:r,children:e.messageCount}),a.jsx(Et,{label:"Created",styles:r,children:l.formatDate(e.createdAt)}),a.jsx(Et,{label:"Last Modified",styles:r,children:l.formatDate(e.lastModified)}),e.model&&a.jsx(Et,{label:"Model",styles:r,children:e.model}),e.tokens!=null&&a.jsx(Et,{label:"Tokens",styles:r,children:e.tokens.toLocaleString()}),e.tags&&e.tags.length>0&&a.jsx(Et,{label:"Tags",styles:r,children:a.jsx("div",{className:"flex flex-wrap gap-1",children:e.tags.map(i=>a.jsx("span",{className:"text-[9px] font-mono px-1.5 py-0.5 rounded",style:l.styles.tagBadge,children:i},i))})}),a.jsx("button",{type:"button",onClick:()=>l.onOpenSessionDetail(e),className:"mt-5 text-[11px] font-medium hover:opacity-80",style:{color:b.accent},children:"Open Session"})]})}function zA(e){return e.isLocal?vw:e.capabilities.includes("broker")?Op:M1}function xy(e,l){switch(e){case"online":return{backgroundColor:"rgba(16, 185, 129, 0.12)",color:"#059669"};case"degraded":return{backgroundColor:"rgba(245, 158, 11, 0.14)",color:"#d97706"};case"offline":return{backgroundColor:l.tagBg,color:l.muted}}}function OA(e,l){switch(e){case"running":return{backgroundColor:"rgba(59, 130, 246, 0.12)",color:"#2563eb"};case"idle":return{backgroundColor:"rgba(16, 185, 129, 0.12)",color:"#059669"};case"waiting":return{backgroundColor:"rgba(245, 158, 11, 0.14)",color:"#d97706"};case"offline":return{backgroundColor:l.tagBg,color:l.muted}}}function LA({machinesState:e,C:l,s:r,isCollapsed:i,sidebarWidth:o,onResizeStart:u,onOpenRelayAgent:d,onRefresh:f,identityColor:p}){const[h,y]=E.useState(e.machines[0]?.id??null);E.useEffect(()=>{if(!e.machines.length){y(null);return}(!h||!e.machines.some(v=>v.id===h))&&y(e.machines[0]?.id??null)},[e.machines,h]);const g=E.useMemo(()=>e.machines.find(v=>v.id===h)??e.machines[0]??null,[e.machines,h]);return a.jsxs("div",{className:"flex-1 flex overflow-hidden",children:[i?null:a.jsxs("div",{style:{width:o,...r.sidebar},className:"relative flex flex-col h-full border-r shrink-0 z-10 overflow-hidden",children:[a.jsx("div",{className:"absolute right-[-3px] top-0 bottom-0 w-1.5 cursor-col-resize hover:bg-indigo-400 z-20 transition-colors",onMouseDown:u}),a.jsxs("div",{className:"px-4 h-14 flex items-center justify-between border-b",style:{borderBottomColor:l.border},children:[a.jsxs("div",{children:[a.jsx("h1",{className:"text-[13px] font-semibold tracking-tight",style:r.inkText,children:"Machines"}),a.jsxs("div",{className:"text-[10px] font-mono mt-0.5",style:r.mutedText,children:[e.onlineCount,"/",e.totalMachines," online"]})]}),a.jsx("button",{className:"p-1.5 rounded transition-opacity hover:opacity-70",style:r.mutedText,onClick:f,children:a.jsx(gn,{size:14})})]}),a.jsx("div",{className:"p-3 border-b grid grid-cols-3 gap-2",style:{borderColor:l.border},children:[{label:"Nodes",value:e.totalMachines,icon:Op},{label:"Live",value:e.onlineCount,icon:Wm},{label:"Warn",value:e.degradedCount,icon:Rb}].map(v=>a.jsxs("div",{className:"text-center p-2 rounded",style:{backgroundColor:l.surface},children:[a.jsx(v.icon,{size:14,className:"mx-auto mb-1",style:r.mutedText}),a.jsx("div",{className:"text-sm font-bold",style:r.inkText,children:v.value}),a.jsx("div",{className:"text-[8px] font-mono uppercase",style:r.mutedText,children:v.label})]},v.label))}),a.jsx("div",{className:"flex-1 overflow-y-auto p-2",children:a.jsx("div",{className:"space-y-1",children:e.machines.map(v=>{const k=zA(v),S=v.id===g?.id;return a.jsx("button",{onClick:()=>y(v.id),className:"os-row w-full text-left p-3 rounded-lg transition-all",style:S?{backgroundColor:l.surface,borderColor:l.border,border:`1px solid ${l.border}`}:void 0,children:a.jsxs("div",{className:"flex items-start gap-3",children:[a.jsx("div",{className:"w-9 h-9 rounded-lg flex items-center justify-center",style:{backgroundColor:l.tagBg},children:a.jsx(k,{size:18,style:v.status==="offline"?r.mutedText:r.inkText})}),a.jsxs("div",{className:"flex-1 min-w-0",children:[a.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[a.jsx("div",{className:"text-[12px] font-medium truncate",style:r.inkText,children:v.title}),a.jsx("span",{className:"text-[9px] font-mono uppercase px-1.5 py-0.5 rounded",style:xy(v.status,l),children:v.statusLabel})]}),a.jsxs("div",{className:"text-[10px] leading-[1.5]",style:r.mutedText,children:[v.endpointCount," endpoints",v.lastSeenLabel?` · seen ${v.lastSeenLabel}`:""]})]})]})},v.id)})})})]}),a.jsxs("div",{className:"flex-1 overflow-y-auto",children:[i&&e.machines.length>0?a.jsx("div",{className:"px-6 py-4 border-b flex items-center gap-2 overflow-x-auto",style:{borderColor:l.border},children:e.machines.map(v=>a.jsx("button",{onClick:()=>y(v.id),className:"os-btn border rounded-lg px-3 py-2 text-[11px] font-medium whitespace-nowrap",style:v.id===g?.id?r.activeItem:{...r.surface,borderColor:l.border,color:l.ink},children:v.title},v.id))}):null,g?a.jsxs("div",{className:"px-8 py-8 space-y-6",children:[a.jsxs("div",{className:"flex items-start justify-between gap-6",children:[a.jsxs("div",{children:[a.jsx("div",{className:"text-[10px] font-mono tracking-widest uppercase mb-3",style:r.mutedText,children:"Node Detail"}),a.jsxs("div",{className:"flex items-center gap-3 mb-2",children:[a.jsx("h1",{className:"text-[26px] font-semibold tracking-tight",style:r.inkText,children:g.title}),a.jsx("span",{className:"text-[10px] font-mono uppercase px-2 py-1 rounded",style:xy(g.status,l),children:g.statusLabel})]}),a.jsxs("div",{className:"text-[13px] leading-[1.7] max-w-2xl",style:r.mutedText,children:[g.statusDetail,g.hostName?` Host: ${g.hostName}.`:"",g.brokerUrl?` Broker: ${g.brokerUrl}.`:""]})]}),a.jsxs("button",{onClick:f,className:"os-btn border px-3 py-2 rounded-lg text-[12px] font-medium shadow-sm flex items-center gap-2",style:{...r.surface,borderColor:l.border,color:l.ink},children:[a.jsx(gn,{size:14}),"Refresh"]})]}),a.jsx("div",{className:"grid grid-cols-4 gap-4",children:[{label:"Reachable",value:g.reachableEndpointCount,icon:Wm},{label:"Running",value:g.workingEndpointCount,icon:Rb},{label:"Projects",value:g.projectCount,icon:M1},{label:"Endpoints",value:g.endpointCount,icon:yo}].map(v=>a.jsxs("div",{className:"border rounded-xl p-4",style:{...r.surface,borderColor:l.border},children:[a.jsxs("div",{className:"flex items-center gap-2 mb-2",style:r.mutedText,children:[a.jsx(v.icon,{size:14}),a.jsx("span",{className:"text-[10px] font-mono uppercase tracking-widest",children:v.label})]}),a.jsx("div",{className:"text-[22px] font-semibold",style:r.inkText,children:v.value})]},v.label))}),a.jsxs("div",{className:"grid grid-cols-[minmax(0,1.2fr)_minmax(320px,0.8fr)] gap-6",children:[a.jsxs("section",{className:"border rounded-xl overflow-hidden",style:{borderColor:l.border},children:[a.jsx("div",{className:"px-4 py-3 border-b flex items-center justify-between",style:{...r.surface,borderBottomColor:l.border},children:a.jsxs("div",{children:[a.jsx("div",{className:"text-[13px] font-semibold",style:r.inkText,children:"Runtime Endpoints"}),a.jsx("div",{className:"text-[10px] font-mono mt-1",style:r.mutedText,children:"Relay agents and sessions attached to this node"})]})}),a.jsx("div",{className:"divide-y",style:{borderColor:l.border},children:g.endpoints.length>0?g.endpoints.map(v=>a.jsxs("div",{className:"px-4 py-4",style:r.surface,children:[a.jsxs("div",{className:"flex items-start justify-between gap-4 mb-3",children:[a.jsxs("div",{className:"flex items-start gap-3 min-w-0",children:[a.jsx("div",{className:"w-8 h-8 rounded-lg text-white flex items-center justify-center text-[11px] font-bold shrink-0",style:{backgroundColor:p(v.agentId)},children:v.agentName.charAt(0).toUpperCase()}),a.jsxs("div",{className:"min-w-0",children:[a.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[a.jsx("div",{className:"text-[13px] font-medium truncate",style:r.inkText,children:v.agentName}),a.jsx("span",{className:"text-[9px] font-mono uppercase px-1.5 py-0.5 rounded",style:OA(v.state,l),children:v.stateLabel})]}),a.jsxs("div",{className:"text-[11px] leading-[1.6]",style:r.mutedText,children:[v.project??"No project root",v.projectRoot?` · ${v.projectRoot}`:""]})]})]}),a.jsxs("button",{onClick:()=>d(v.agentId),className:"text-[11px] font-medium flex items-center gap-1 shrink-0",style:{color:l.accent},children:["Open Relay ",a.jsx(_l,{size:12})]})]}),a.jsxs("div",{className:"grid grid-cols-4 gap-3 text-[11px]",children:[a.jsxs("div",{children:[a.jsx("div",{className:"text-[9px] font-mono uppercase tracking-widest mb-1",style:r.mutedText,children:"Harness"}),a.jsx("div",{style:r.inkText,children:v.harness??"Unknown"})]}),a.jsxs("div",{children:[a.jsx("div",{className:"text-[9px] font-mono uppercase tracking-widest mb-1",style:r.mutedText,children:"Transport"}),a.jsx("div",{style:r.inkText,children:v.transport??"Unknown"})]}),a.jsxs("div",{children:[a.jsx("div",{className:"text-[9px] font-mono uppercase tracking-widest mb-1",style:r.mutedText,children:"Session"}),a.jsx("div",{style:r.inkText,children:v.sessionId??"Not reported"})]}),a.jsxs("div",{children:[a.jsx("div",{className:"text-[9px] font-mono uppercase tracking-widest mb-1",style:r.mutedText,children:"Activity"}),a.jsx("div",{style:r.inkText,children:v.lastActiveLabel??"Not reported"})]})]}),v.activeTask?a.jsx("div",{className:"mt-3 text-[11px] leading-[1.6] border rounded-lg px-3 py-2",style:{borderColor:l.border,color:l.muted,backgroundColor:l.bg},children:v.activeTask}):null]},v.id)):a.jsx("div",{className:"px-4 py-8 text-[12px] text-center",style:{...r.surface,color:l.muted},children:"No registered endpoints on this node yet."})})]}),a.jsxs("div",{className:"space-y-4",children:[a.jsxs("section",{className:"border rounded-xl p-5",style:{...r.surface,borderColor:l.border},children:[a.jsx("div",{className:"text-[10px] font-mono tracking-widest uppercase mb-3",style:r.mutedText,children:"Machine Profile"}),a.jsx("div",{className:"space-y-3 text-[12px]",children:[["Scope",g.advertiseScope??"Not reported"],["Registered",g.registeredAtLabel??"Not reported"],["Seen",g.lastSeenLabel??"Not reported"],["Labels",g.labels.length?g.labels.join(", "):"None"]].map(([v,k])=>a.jsxs("div",{children:[a.jsx("div",{className:"text-[9px] font-mono uppercase tracking-widest mb-1",style:r.mutedText,children:v}),a.jsx("div",{style:r.inkText,children:k})]},v))})]}),a.jsxs("section",{className:"border rounded-xl p-5",style:{...r.surface,borderColor:l.border},children:[a.jsx("div",{className:"text-[10px] font-mono tracking-widest uppercase mb-3",style:r.mutedText,children:"Projects"}),g.projectRoots.length>0?a.jsx("div",{className:"space-y-2",children:g.projectRoots.map(v=>a.jsxs("div",{className:"flex items-center gap-2 text-[12px]",style:r.inkText,children:[a.jsx(hw,{size:12,style:r.mutedText}),a.jsx("span",{className:"truncate",children:v})]},v))}):a.jsx("div",{className:"text-[12px]",style:r.mutedText,children:"No project roots reported for this node yet."})]})]})]})]}):a.jsx("div",{className:"h-full flex items-center justify-center px-8 text-center",children:a.jsxs("div",{children:[a.jsx("div",{className:"text-[15px] font-medium mb-2",style:r.inkText,children:"No machines visible"}),a.jsx("div",{className:"text-[12px]",style:r.mutedText,children:"Start the broker and register a node to inspect servers and workstations here."})]})})]})]})}function DA(e,l){switch(e.status){case"running":return{icon:L1,pill:{backgroundColor:"rgba(59, 130, 246, 0.12)",color:"#2563eb"}};case"completed":return{icon:E1,pill:{backgroundColor:"rgba(16, 185, 129, 0.12)",color:"#059669"}};case"failed":return{icon:Rp,pill:{backgroundColor:"rgba(239, 68, 68, 0.12)",color:"#dc2626"}};case"queued":return{icon:XN,pill:{backgroundColor:l.tagBg,color:l.muted}}}}function _A(e,l){switch(e.status){case"completed":return{backgroundColor:"rgba(16, 185, 129, 0.12)",color:"#059669"};case"in-progress":return{backgroundColor:"rgba(59, 130, 246, 0.12)",color:"#2563eb"};case"awaiting-review":return{backgroundColor:"rgba(245, 158, 11, 0.14)",color:"#d97706"};case"paused":return{backgroundColor:"rgba(148, 163, 184, 0.18)",color:"#475569"};case"draft":return{backgroundColor:l.tagBg,color:l.muted}}}function BA(e,l){return e.severity==="error"?{backgroundColor:"rgba(239, 68, 68, 0.12)",color:"#dc2626"}:{backgroundColor:"rgba(245, 158, 11, 0.14)",color:"#d97706"}}function IA({plansState:e,C:l,s:r,isCollapsed:i,sidebarWidth:o,onResizeStart:u,onOpenRelayAgent:d,onRefresh:f,identityColor:p}){const[h,y]=E.useState("tasks"),[g,v]=E.useState("all"),k=E.useMemo(()=>Array.from(new Set(e.tasks.map(N=>N.targetAgentName))).sort(),[e.tasks]),S=E.useMemo(()=>g==="all"?e.tasks:e.tasks.filter(N=>N.targetAgentName===g),[e.tasks,g]),A=E.useMemo(()=>g==="all"?e.plans:e.plans.filter(N=>N.agent===g||N.agentId===g.toLowerCase()),[e.plans,g]);return a.jsxs("div",{className:"flex-1 flex overflow-hidden",children:[i?null:a.jsxs("div",{style:{width:o,...r.sidebar},className:"relative flex flex-col h-full border-r shrink-0 z-10 overflow-hidden",children:[a.jsx("div",{className:"absolute right-[-3px] top-0 bottom-0 w-1.5 cursor-col-resize hover:bg-indigo-400 z-20 transition-colors",onMouseDown:u}),a.jsxs("div",{className:"px-4 h-14 flex items-center justify-between border-b",style:{borderBottomColor:l.border},children:[a.jsxs("div",{children:[a.jsx("h1",{className:"text-[13px] font-semibold tracking-tight",style:r.inkText,children:"Plans & Tasks"}),a.jsxs("div",{className:"text-[10px] font-mono mt-0.5",style:r.mutedText,children:[e.taskCount," asks · ",e.planCount," plans"]})]}),a.jsx("button",{className:"p-1.5 rounded transition-opacity hover:opacity-70",style:r.mutedText,onClick:f,children:a.jsx(gn,{size:14})})]}),a.jsx("div",{className:"p-3 border-b grid grid-cols-2 gap-2",style:{borderColor:l.border},children:[{label:"Running",value:e.runningTaskCount},{label:"Plans",value:e.planCount},{label:"Findings",value:e.findingCount},{label:"Workspaces",value:e.workspaceCount}].map(N=>a.jsxs("div",{className:"p-2 rounded",style:{backgroundColor:l.surface},children:[a.jsx("div",{className:"text-[8px] font-mono uppercase tracking-widest mb-1",style:r.mutedText,children:N.label}),a.jsx("div",{className:"text-[16px] font-semibold",style:r.inkText,children:N.value})]},N.label))}),a.jsx("div",{className:"px-3 pt-3",children:a.jsx("div",{className:"grid grid-cols-2 gap-2",children:[{mode:"tasks",label:"Tasks",icon:Nw},{mode:"plans",label:"Plans",icon:xa}].map(N=>{const R=N.icon;return a.jsxs("button",{onClick:()=>y(N.mode),className:"border rounded-lg px-3 py-2 text-[11px] font-medium flex items-center gap-2 justify-center",style:h===N.mode?r.activeItem:{...r.surface,borderColor:l.border,color:l.ink},children:[a.jsx(R,{size:12}),N.label]},N.mode)})})}),a.jsxs("div",{className:"flex-1 overflow-y-auto p-2",children:[a.jsx("div",{className:"font-mono text-[9px] tracking-widest uppercase mb-2 px-2",style:r.mutedText,children:"Agents"}),a.jsxs("div",{className:"space-y-1",children:[a.jsx("button",{onClick:()=>v("all"),className:"w-full text-left px-3 py-2 rounded-lg text-[12px] font-medium",style:g==="all"?r.activeItem:r.mutedText,children:"All Agents"}),k.map(N=>a.jsxs("button",{onClick:()=>v(N),className:"w-full text-left px-3 py-2 rounded-lg text-[12px] font-medium flex items-center gap-2",style:g===N?r.activeItem:r.mutedText,children:[a.jsx("div",{className:"w-5 h-5 rounded text-white flex items-center justify-center text-[9px] font-bold",style:{backgroundColor:p(N)},children:N.charAt(0).toUpperCase()}),a.jsx("span",{className:"truncate",children:N})]},N))]})]})]}),a.jsxs("div",{className:"flex-1 overflow-y-auto",children:[i?a.jsx("div",{className:"px-6 py-4 border-b flex items-center gap-2 overflow-x-auto",style:{borderColor:l.border},children:[["tasks","Tasks"],["plans","Plans"]].map(([N,R])=>a.jsx("button",{onClick:()=>y(N),className:"os-btn border rounded-lg px-3 py-2 text-[11px] font-medium whitespace-nowrap",style:h===N?r.activeItem:{...r.surface,borderColor:l.border,color:l.ink},children:R},N))}):null,a.jsxs("div",{className:"px-8 py-8 space-y-6",children:[a.jsxs("div",{className:"flex items-start justify-between gap-6",children:[a.jsxs("div",{children:[a.jsx("div",{className:"text-[10px] font-mono tracking-widest uppercase mb-3",style:r.mutedText,children:"Control Plane Queue"}),a.jsx("h1",{className:"text-[26px] font-semibold tracking-tight mb-2",style:r.inkText,children:h==="tasks"?"Recent Agent Asks":"Workspace Plans"}),a.jsx("div",{className:"text-[13px] leading-[1.7] max-w-2xl",style:r.mutedText,children:h==="tasks"?"These are the operator asks currently flowing through Relay, resolved against live reply and status signals.":"Plan files are loaded from registered agent workspaces under plans/ or .openscout/plans/ so each project can keep its own roadmap."})]}),a.jsxs("button",{onClick:f,className:"os-btn border px-3 py-2 rounded-lg text-[12px] font-medium shadow-sm flex items-center gap-2",style:{...r.surface,borderColor:l.border,color:l.ink},children:[a.jsx(gn,{size:14}),"Refresh"]})]}),a.jsx("div",{className:"grid grid-cols-4 gap-4",children:[{label:"Running",value:e.runningTaskCount,icon:L1},{label:"Completed",value:e.completedTaskCount,icon:E1},{label:"Findings",value:e.findingCount,icon:i2},{label:"Plans",value:e.planCount,icon:l2}].map(N=>a.jsxs("div",{className:"border rounded-xl p-4",style:{...r.surface,borderColor:l.border},children:[a.jsxs("div",{className:"flex items-center gap-2 mb-2",style:r.mutedText,children:[a.jsx(N.icon,{size:14,className:N.label==="Running"?"animate-spin":""}),a.jsx("span",{className:"text-[10px] font-mono uppercase tracking-widest",children:N.label})]}),a.jsx("div",{className:"text-[22px] font-semibold",style:r.inkText,children:N.value})]},N.label))}),h==="tasks"?a.jsxs("div",{className:"space-y-4",children:[e.findings.length>0?a.jsxs("div",{className:"border rounded-xl p-5",style:{...r.surface,borderColor:l.border},children:[a.jsxs("div",{className:"flex items-start justify-between gap-4 mb-4",children:[a.jsxs("div",{children:[a.jsx("div",{className:"text-[10px] font-mono tracking-widest uppercase mb-2",style:r.mutedText,children:"Reconciliation"}),a.jsx("div",{className:"text-[13px] leading-[1.7]",style:r.mutedText,children:"Open expectations that look stale, blocked, or otherwise at risk of being dropped."})]}),a.jsxs("div",{className:"flex items-center gap-2 text-[10px] font-mono shrink-0",children:[a.jsxs("span",{className:"px-1.5 py-0.5 rounded",style:{backgroundColor:"rgba(239, 68, 68, 0.12)",color:"#dc2626"},children:[e.errorCount," errors"]}),a.jsxs("span",{className:"px-1.5 py-0.5 rounded",style:{backgroundColor:"rgba(245, 158, 11, 0.14)",color:"#d97706"},children:[e.warningCount," warnings"]})]})]}),a.jsx("div",{className:"space-y-3",children:e.findings.map(N=>a.jsx("div",{className:"border rounded-lg p-4",style:{borderColor:l.border,backgroundColor:l.bg},children:a.jsxs("div",{className:"flex items-start justify-between gap-4",children:[a.jsxs("div",{className:"min-w-0",children:[a.jsxs("div",{className:"flex items-center gap-2 mb-2 flex-wrap",children:[a.jsx("div",{className:"text-[14px] font-semibold",style:r.inkText,children:N.title}),a.jsx("span",{className:"text-[9px] font-mono uppercase px-1.5 py-0.5 rounded",style:BA(N),children:N.severity})]}),a.jsx("div",{className:"text-[12px] leading-[1.7]",style:r.mutedText,children:N.summary}),N.detail?a.jsx("div",{className:"mt-2 text-[11px] leading-[1.6]",style:r.mutedText,children:N.detail}):null,a.jsxs("div",{className:"mt-3 flex items-center gap-3 text-[10px] flex-wrap",style:r.mutedText,children:[N.requesterName?a.jsx("span",{children:N.requesterName}):null,N.targetAgentName?a.jsx("span",{children:N.targetAgentName}):null,N.ageLabel?a.jsx("span",{children:N.ageLabel}):null,N.updatedAtLabel?a.jsxs("span",{children:["Updated ",N.updatedAtLabel]}):null]})]}),N.targetAgentId?a.jsxs("button",{onClick:()=>d(N.targetAgentId),className:"text-[11px] font-medium flex items-center gap-1 shrink-0",style:{color:l.accent},children:["Open Relay ",a.jsx(_l,{size:12})]}):null]})},N.id))})]}):null,S.length>0?S.map(N=>{const R=DA(N,l),L=R.icon;return a.jsx("div",{className:"border rounded-xl p-5",style:{...r.surface,borderColor:l.border},children:a.jsxs("div",{className:"flex items-start justify-between gap-4",children:[a.jsxs("div",{className:"flex items-start gap-3 min-w-0",children:[a.jsx("div",{className:"mt-0.5",style:{color:R.pill.color},children:a.jsx(L,{size:18,className:N.status==="running"?"animate-spin":""})}),a.jsxs("div",{className:"min-w-0",children:[a.jsxs("div",{className:"flex items-center gap-2 mb-2 flex-wrap",children:[a.jsx("div",{className:"text-[15px] font-semibold",style:r.inkText,children:N.title}),a.jsx("span",{className:"text-[9px] font-mono uppercase px-1.5 py-0.5 rounded",style:R.pill,children:N.statusLabel})]}),a.jsxs("div",{className:"flex items-center gap-3 text-[11px] flex-wrap mb-3",style:r.mutedText,children:[a.jsxs("div",{className:"flex items-center gap-1.5",children:[a.jsx("div",{className:"w-5 h-5 rounded text-white flex items-center justify-center text-[9px] font-bold",style:{backgroundColor:p(N.targetAgentId)},children:N.targetAgentName.charAt(0).toUpperCase()}),a.jsx("span",{children:N.targetAgentName})]}),N.project?a.jsx("span",{className:"font-mono",children:N.project}):null,a.jsxs("span",{className:"flex items-center gap-1",children:[a.jsx(as,{size:10}),N.ageLabel]})]}),a.jsx("div",{className:"text-[12px] leading-[1.7]",style:r.mutedText,children:N.statusDetail}),N.replyPreview?a.jsx("div",{className:"mt-3 border rounded-lg px-3 py-2 text-[12px] leading-[1.7]",style:{borderColor:l.border,backgroundColor:l.bg,color:l.muted},children:N.replyPreview}):null,N.projectRoot?a.jsx("div",{className:"mt-3 text-[10px] font-mono",style:r.mutedText,children:N.projectRoot}):null]})]}),a.jsxs("button",{onClick:()=>d(N.targetAgentId),className:"text-[11px] font-medium flex items-center gap-1 shrink-0",style:{color:l.accent},children:["Open Relay ",a.jsx(_l,{size:12})]})]})},N.id)}):a.jsx("div",{className:"border rounded-xl p-8 text-center",style:{...r.surface,borderColor:l.border,color:l.muted},children:"No task-like asks are visible yet."})]}):a.jsx("div",{className:"grid grid-cols-2 gap-5",children:A.length>0?A.map(N=>a.jsxs("div",{className:"border rounded-xl p-5",style:{...r.surface,borderColor:l.border},children:[a.jsxs("div",{className:"flex items-start justify-between gap-3 mb-3",children:[a.jsxs("div",{children:[a.jsx("div",{className:"text-[15px] font-semibold mb-1",style:r.inkText,children:N.title}),a.jsxs("div",{className:"text-[11px] flex items-center gap-2 flex-wrap",style:r.mutedText,children:[a.jsxs("span",{className:"flex items-center gap-1",children:[a.jsx(R1,{size:10}),N.agentId]}),a.jsx("span",{children:N.workspaceName})]})]}),a.jsx("span",{className:"text-[9px] font-mono uppercase px-1.5 py-0.5 rounded shrink-0",style:_A(N,l),children:N.status})]}),a.jsx("div",{className:"text-[12px] leading-[1.7] mb-4",style:r.mutedText,children:N.summary}),a.jsxs("div",{className:"mb-4",children:[a.jsxs("div",{className:"flex items-center justify-between text-[10px] font-mono uppercase tracking-widest mb-2",style:r.mutedText,children:[a.jsx("span",{children:"Progress"}),a.jsxs("span",{children:[N.stepsCompleted,"/",N.stepsTotal||0]})]}),a.jsx("div",{className:"h-2 rounded-full overflow-hidden",style:{backgroundColor:l.border},children:a.jsx("div",{className:"h-full rounded-full",style:{width:`${N.progressPercent}%`,backgroundColor:l.accent}})})]}),a.jsxs("div",{className:"grid grid-cols-2 gap-3 text-[11px]",children:[a.jsxs("div",{children:[a.jsx("div",{className:"text-[9px] font-mono uppercase tracking-widest mb-1",style:r.mutedText,children:"Updated"}),a.jsx("div",{style:r.inkText,children:N.updatedAtLabel})]}),a.jsxs("div",{children:[a.jsx("div",{className:"text-[9px] font-mono uppercase tracking-widest mb-1",style:r.mutedText,children:"File"}),a.jsx("div",{style:r.inkText,children:N.path})]})]}),N.tags.length>0?a.jsx("div",{className:"mt-4 flex flex-wrap gap-2",children:N.tags.map(R=>a.jsx("span",{className:"text-[9px] font-mono uppercase px-1.5 py-0.5 rounded",style:r.tagBadge,children:R},R))}):null]},`${N.workspacePath}:${N.path}`)):a.jsxs("div",{className:"col-span-2 border rounded-xl p-8 text-center",style:{...r.surface,borderColor:l.border,color:l.muted},children:[a.jsx("div",{className:"text-[14px] font-medium mb-2",style:r.inkText,children:"No plan files found"}),a.jsxs("div",{className:"text-[12px] leading-[1.7]",children:["Add Markdown plans under ",a.jsx("span",{className:"font-mono",children:"plans/"})," or ",a.jsx("span",{className:"font-mono",children:".openscout/plans/"})," in a registered agent workspace and they will appear here."]})]})})]})]})]})}function PA({activeView:e,machinesViewProps:l,plansViewProps:r,search:i}){return e==="machines"?a.jsx(LA,{...l}):e==="plans"?a.jsx(IA,{...r}):e!=="search"?null:a.jsxs(a.Fragment,{children:[!i.isCollapsed&&a.jsxs("div",{style:{width:i.sidebarWidth,...i.styles.sidebar},className:"relative flex flex-col h-full border-r shrink-0 z-10 overflow-hidden",children:[a.jsx("div",{className:"absolute right-[-3px] top-0 bottom-0 w-1.5 cursor-col-resize hover:bg-indigo-400 z-20 transition-colors",onMouseDown:i.onResizeStart}),a.jsx("div",{className:"px-3 py-2.5 flex items-center justify-between border-b",style:{borderBottomColor:b.border},children:a.jsxs("div",{children:[a.jsx("h1",{className:"text-[13px] font-semibold tracking-tight",style:i.styles.inkText,children:"Search"}),a.jsx("div",{className:"text-[10px] font-mono mt-0.5",style:i.styles.mutedText,children:"Full-text search"})]})}),a.jsxs("div",{className:"flex-1 overflow-y-auto py-2",children:[a.jsxs("div",{className:"mb-3 px-1.5",children:[a.jsx("div",{className:"font-mono text-[9px] tracking-widest uppercase mb-1 px-1.5",style:i.styles.mutedText,children:"Scope"}),a.jsxs("div",{className:"flex flex-col gap-px",children:[a.jsxs("button",{className:"flex items-center gap-2 px-1.5 py-1 shadow-sm border rounded text-[12px]",style:i.styles.activeItem,children:[a.jsx(zp,{size:12,style:{color:b.accent}}),a.jsx("span",{className:"font-medium flex-1 truncate text-left",children:"All Sessions"})]}),[["Content Only",a.jsx(Mp,{size:12})],["Tags Only",a.jsx(t2,{size:12})]].map(([o,u])=>a.jsxs("button",{className:"flex items-center gap-2 px-1.5 py-1 rounded text-[12px] hover:opacity-80 transition-opacity",style:i.styles.mutedText,children:[u,a.jsx("span",{className:"font-medium flex-1 truncate text-left",children:o})]},o))]})]}),a.jsxs("div",{className:"mb-3 px-1.5",children:[a.jsx("div",{className:"font-mono text-[9px] tracking-widest uppercase mb-1 px-1.5",style:i.styles.mutedText,children:"Time Range"}),a.jsxs("div",{className:"flex flex-col gap-px",children:[a.jsxs("button",{className:"flex items-center gap-2 px-1.5 py-1 shadow-sm border rounded text-[12px]",style:i.styles.activeItem,children:[a.jsx(FN,{size:12,style:{color:b.accent}}),a.jsx("span",{className:"font-medium flex-1 truncate text-left",children:"All Time"})]}),["Last 7 Days","Last 30 Days"].map(o=>a.jsxs("button",{className:"flex items-center gap-2 px-1.5 py-1 rounded text-[12px] hover:opacity-80 transition-opacity",style:i.styles.mutedText,children:[a.jsx(as,{size:12}),a.jsx("span",{className:"font-medium flex-1 truncate text-left",children:o})]},o))]})]}),a.jsxs("div",{className:"mb-3 px-1.5",children:[a.jsx("div",{className:"font-mono text-[9px] tracking-widest uppercase mb-1 px-1.5",style:i.styles.mutedText,children:"Agents"}),a.jsx("div",{className:"flex flex-col gap-px",children:i.availableAgentNames.map(o=>a.jsxs("label",{className:"flex items-center gap-2 px-1.5 py-1 rounded text-[12px] hover:opacity-80 transition-opacity cursor-pointer",style:i.styles.mutedText,children:[a.jsx("input",{type:"checkbox",defaultChecked:!0,className:"w-3 h-3 rounded"}),a.jsx("div",{className:"w-3 h-3 rounded text-white flex items-center justify-center text-[7px] font-bold",style:{backgroundColor:hl(o)},children:o.charAt(0)}),a.jsx("span",{className:"font-medium flex-1 truncate text-left",children:o})]},o))})]}),a.jsxs("div",{className:"px-1.5",children:[a.jsx("div",{className:"font-mono text-[9px] tracking-widest uppercase mb-1 px-1.5",style:i.styles.mutedText,children:"Quick Filters"}),a.jsx("div",{className:"flex flex-wrap gap-1 px-1.5",children:["code-review","debugging","docs","architecture","performance","testing"].map(o=>a.jsx("button",{className:"text-[9px] font-mono border px-1.5 py-0.5 rounded hover:opacity-70 transition-opacity",style:i.styles.tagBadge,children:o},o))})]})]})]}),a.jsxs("div",{className:"flex-1 flex flex-col relative min-w-0",style:i.styles.surface,children:[a.jsxs("div",{className:"border-b shrink-0 p-4",style:{...i.styles.surface,borderBottomColor:b.border},children:[a.jsxs("div",{className:"flex items-center gap-3 border rounded-lg px-3 py-2 transition-all focus-within:ring-1",style:{backgroundColor:b.bg,borderColor:b.border},children:[a.jsx(To,{size:16,className:"shrink-0",style:i.styles.mutedText}),a.jsx("input",{type:"text",placeholder:"Search across all sessions, messages, and metadata...",value:i.searchQuery,onChange:o=>i.setSearchQuery(o.target.value),className:"flex-1 bg-transparent border-none outline-none text-[13px]",style:{color:b.ink}}),i.searchQuery&&a.jsx("button",{onClick:()=>i.setSearchQuery(""),className:"p-1 hover:opacity-70",style:i.styles.mutedText,children:a.jsx(Sl,{size:14})})]}),a.jsxs("div",{className:"flex items-center justify-between mt-2",children:[a.jsxs("div",{className:"flex items-center gap-2 text-[10px] font-mono",style:i.styles.mutedText,children:[a.jsx("span",{children:"Press"}),a.jsx("kbd",{className:"px-1.5 py-0.5 rounded border text-[10px] font-medium",style:i.styles.kbd,children:"Enter"}),a.jsx("span",{children:"to search"})]}),a.jsx("div",{className:"text-[10px] font-mono",style:i.styles.mutedText,children:i.searchQuery?`${i.filteredSessions.length} results`:`${i.stats.totalSessions} sessions indexed`})]})]}),a.jsx("div",{className:"flex-1 overflow-y-auto",children:i.searchQuery?i.filteredSessions.length===0?a.jsxs("div",{className:"flex flex-col items-center justify-center h-64 text-center",children:[a.jsx("div",{className:"w-16 h-16 rounded-full flex items-center justify-center mb-4",style:{backgroundColor:b.accentBg},children:a.jsx(To,{size:24,style:{color:b.accent}})}),a.jsx("h3",{className:"text-[15px] font-medium mb-1",style:i.styles.inkText,children:"No results found"}),a.jsx("p",{className:"text-[13px] max-w-sm",style:i.styles.mutedText,children:"Try different keywords or adjust your filters"})]}):a.jsx("div",{style:{borderColor:b.border},className:"divide-y",children:i.filteredSessions.map(o=>a.jsxs("div",{className:"px-4 py-4 cursor-pointer transition-opacity hover:opacity-90",style:{borderBottomColor:b.border},onClick:()=>i.onOpenSession(o),children:[a.jsxs("div",{className:"flex items-start justify-between mb-2",children:[a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx("div",{className:"w-5 h-5 rounded text-white flex items-center justify-center text-[9px] font-bold",style:{backgroundColor:hl(o.agent)},children:o.agent.charAt(0)}),a.jsx("span",{className:"text-[13px] font-medium",style:i.styles.inkText,children:o.title})]}),a.jsxs("div",{className:"flex items-center gap-2 shrink-0 ml-2",children:[a.jsx("span",{className:"text-[9px] font-mono border px-1.5 py-0.5 rounded",style:i.styles.tagBadge,children:o.project}),a.jsx("span",{className:"text-[10px] font-mono",style:i.styles.mutedText,children:i.formatDate(o.lastModified)})]})]}),a.jsx("div",{className:"text-[12px] mb-2 pl-7 leading-relaxed",style:i.styles.mutedText,children:o.preview.split(new RegExp(`(${i.searchQuery})`,"gi")).map((u,d)=>u.toLowerCase()===i.searchQuery.toLowerCase()?a.jsx("mark",{className:"px-0.5 rounded",style:{backgroundColor:b.markBg,color:b.markFg},children:u},d):a.jsx("span",{children:u},d))}),a.jsxs("div",{className:"flex items-center gap-3 pl-7",children:[a.jsxs("span",{className:"text-[10px]",style:i.styles.mutedText,children:[o.messageCount," messages"]}),o.tokens?a.jsxs("span",{className:"text-[10px]",style:i.styles.mutedText,children:[(o.tokens/1e3).toFixed(1),"k tokens"]}):null,o.model?a.jsx("span",{className:"text-[9px] font-mono text-indigo-400 bg-indigo-950/30 px-1.5 py-0.5 rounded",children:o.model}):null]}),o.tags&&o.tags.length>0?a.jsx("div",{className:"flex items-center gap-1.5 mt-2 pl-7",children:o.tags.map(u=>a.jsx("span",{className:"text-[9px] font-mono border px-1.5 py-0.5 rounded",style:u.toLowerCase().includes(i.searchQuery.toLowerCase())?{backgroundColor:b.markBg,borderColor:b.border,color:b.markFg}:i.styles.tagBadge,children:u},u))}):null]},o.id))}):a.jsxs("div",{className:"p-6",children:[a.jsx("div",{className:"font-mono text-[9px] tracking-widest uppercase mb-3",style:i.styles.mutedText,children:"Recent Searches"}),a.jsx("div",{className:"flex flex-col gap-2",children:["authentication refactor","database migration","API performance"].map((o,u)=>a.jsxs("button",{onClick:()=>i.setSearchQuery(o),className:"flex items-center gap-2 text-left text-[12px] hover:opacity-70 transition-opacity",style:i.styles.mutedText,children:[a.jsx(as,{size:12}),a.jsx("span",{children:o})]},u))}),a.jsx("div",{className:"font-mono text-[9px] tracking-widest uppercase mb-3 mt-8",style:i.styles.mutedText,children:"Popular Tags"}),a.jsx("div",{className:"flex flex-wrap gap-2",children:["code-review","auth","security","database","migration","api","performance","testing","docs"].map(o=>a.jsxs("button",{onClick:()=>i.setSearchQuery(o),className:"text-[11px] font-mono border px-2 py-1 rounded hover:opacity-70 transition-opacity",style:i.styles.tagBadge,children:["#",o]},o))}),a.jsx("div",{className:"font-mono text-[9px] tracking-widest uppercase mb-3 mt-8",style:i.styles.mutedText,children:"Search Tips"}),a.jsx("div",{className:"text-[12px] space-y-2",style:i.styles.mutedText,children:[["project:openscout-core","Search within a project"],["agent:claude","Filter by agent"],["tag:security","Search by tag"],['"exact phrase"',"Match exact phrase"]].map(([o,u])=>a.jsxs("p",{children:[a.jsx("code",{className:"border rounded px-1 font-mono text-[10px]",style:i.styles.tagBadge,children:o})," -- ",u]},o))})]})}),a.jsxs("div",{className:"h-7 border-t flex items-center justify-between px-4 shrink-0",style:{backgroundColor:b.bg,borderTopColor:b.border},children:[a.jsxs("span",{className:"text-[9px] font-mono",style:i.styles.mutedText,children:["Indexed: ",i.stats.totalSessions," sessions / ",i.stats.totalMessages," messages"]}),a.jsx("span",{className:"text-[9px] font-mono uppercase tracking-widest",style:i.styles.mutedText,children:"Index Ready"})]})]})]})}function UA({styles:e,selectedInterAgent:l,availableAgents:r,isAgentConfigEditing:i,hasEditableAgentConfig:o,agentConfigLoading:u,agentConfigSaving:d,agentConfigRestarting:f,visibleAgentConfig:p,agentConfigFeedback:h,agentCapabilitiesPreview:y,agentRuntimePathRef:g,onOpenAgents:v,onOpenAgentProfile:k,onOpenAgentThread:S,onUpdateAgentConfigDraft:A,renderLocalPathValue:N,interAgentProfileKindLabel:R,onSelectAgent:L}){const H=l?.id??null,X=a.jsxs("section",{className:"border rounded-xl p-3",style:{...e.surface,borderColor:b.border},children:[a.jsxs("div",{className:"flex items-center justify-between gap-3 px-2 pt-2 mb-2",children:[a.jsxs("div",{children:[a.jsx("div",{className:"text-[10px] font-mono tracking-widest uppercase",style:{color:b.accent},children:"Agent List"}),a.jsx("div",{className:"text-[11px] mt-1",style:e.mutedText,children:r.length>0?"Pick the agent you want to configure.":"No agents available yet."})]}),r.length>0?a.jsx("span",{className:"text-[9px] font-mono uppercase px-1.5 py-0.5 rounded shrink-0",style:e.tagBadge,children:r.length}):null]}),a.jsx("div",{className:"flex flex-col gap-1",children:r.length>0?r.map(V=>{const D=V.id===H;return a.jsx("button",{type:"button",className:"rounded-lg border px-3 py-2 text-left transition-opacity hover:opacity-90",style:{borderColor:D?b.accent:b.border,backgroundColor:D?b.surface:b.bg},onClick:()=>L(V.id),children:a.jsxs("div",{className:"flex items-center justify-between gap-3",children:[a.jsxs("div",{className:"min-w-0",children:[a.jsx("div",{className:"text-[12px] font-medium truncate",style:e.inkText,children:V.title}),a.jsxs("div",{className:"text-[10px] mt-0.5 truncate",style:e.mutedText,children:[R(V.profileKind)," · ",V.statusDetail??V.summary??"No status reported."]})]}),a.jsxs("div",{className:"flex items-center gap-2 shrink-0",children:[D?a.jsx("span",{className:"text-[9px] font-mono uppercase px-1.5 py-0.5 rounded",style:e.activePill,children:"Selected"}):null,a.jsx("span",{className:"text-[9px] font-mono uppercase px-1.5 py-0.5 rounded",style:V.state==="working"?e.activePill:e.tagBadge,children:V.statusLabel})]})]})},V.id)}):a.jsx("div",{className:"px-3 py-6 text-[11px] text-center",style:e.mutedText,children:"No agents available yet."})}),a.jsx("div",{className:"mt-3 px-2 pb-2",children:a.jsx("button",{type:"button",className:"os-toolbar-button flex items-center gap-1 text-[10px] font-medium px-2 py-1 rounded",style:{color:b.ink},onClick:v,children:"Open Agents"})})]});return l?a.jsxs("div",{className:"space-y-4 min-w-0",children:[a.jsx("section",{className:"border rounded-xl p-5",style:{...e.surface,borderColor:b.border},children:a.jsxs("div",{className:"flex items-start justify-between gap-4",children:[a.jsxs("div",{className:"min-w-0",children:[a.jsx("div",{className:"text-[10px] font-mono tracking-widest uppercase",style:{color:b.accent},children:"Selected Agent"}),a.jsx("div",{className:"text-[18px] font-semibold tracking-tight mt-1.5",style:e.inkText,children:l.title}),a.jsxs("div",{className:"text-[12px] mt-2 leading-[1.6]",style:e.mutedText,children:[R(l.profileKind)," · ",l.statusDetail??l.summary??"No status reported."]})]}),a.jsxs("div",{className:"flex items-center gap-2 shrink-0",children:[a.jsx("button",{className:"os-toolbar-button flex items-center gap-1 text-[10px] font-medium px-2 py-0.5 rounded",style:{color:b.ink},onClick:()=>S(l.id),children:"Message"}),a.jsx("button",{className:"os-toolbar-button flex items-center gap-1 text-[10px] font-medium px-2 py-0.5 rounded",style:{color:b.ink},onClick:()=>k(l.id),children:"Show in Agents"})]})]})}),a.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-[minmax(0,1.1fr)_minmax(320px,0.9fr)] gap-4",children:[a.jsxs("div",{className:"space-y-4 min-w-0",children:[a.jsxs("section",{className:"border rounded-xl p-5",style:{...e.surface,borderColor:b.border},children:[a.jsx("div",{className:"text-[10px] font-mono tracking-widest uppercase mb-3",style:{color:b.accent},children:"Runtime"}),u?a.jsx("div",{className:"text-[11px]",style:e.mutedText,children:"Loading runtime…"}):i?a.jsxs("div",{className:"space-y-3",children:[a.jsxs("div",{children:[a.jsx("div",{className:"text-[9px] font-mono uppercase tracking-widest mb-1",style:e.mutedText,children:"Path"}),a.jsx("input",{ref:g,value:p?.runtime.cwd??"",onChange:V=>{A(D=>({...D,runtime:{...D.runtime,cwd:V.target.value}}))},readOnly:!o||d||f,className:"w-full rounded-lg border px-3 py-2.5 text-[11px] leading-[1.5] bg-transparent outline-none",style:{borderColor:b.border,color:b.ink}})]}),a.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[a.jsxs("div",{children:[a.jsx("div",{className:"text-[9px] font-mono uppercase tracking-widest mb-1",style:e.mutedText,children:"Harness"}),a.jsx("select",{value:p?.runtime.harness??"",onChange:V=>{A(D=>({...D,runtime:{...D.runtime,harness:V.target.value}}))},disabled:!o||d||f,className:"w-full rounded-lg border px-3 py-2.5 text-[11px] leading-[1.5] bg-transparent outline-none",style:{borderColor:b.border,color:b.ink},children:p?.availableHarnesses.map(V=>a.jsx("option",{value:V,children:V},V))})]}),a.jsxs("div",{children:[a.jsx("div",{className:"text-[9px] font-mono uppercase tracking-widest mb-1",style:e.mutedText,children:"Session"}),a.jsx("input",{value:p?.runtime.sessionId??"",onChange:V=>{A(D=>({...D,runtime:{...D.runtime,sessionId:V.target.value}}))},readOnly:!o||d||f,className:"w-full rounded-lg border px-3 py-2.5 text-[11px] leading-[1.5] bg-transparent outline-none",style:{borderColor:b.border,color:b.ink}})]}),a.jsxs("div",{children:[a.jsx("div",{className:"text-[9px] font-mono uppercase tracking-widest mb-1",style:e.mutedText,children:"Mode"}),a.jsxs("select",{value:p?.runtime.transport==="tmux"?"interactive":"async",onChange:V=>{A(D=>({...D,runtime:{...D.runtime,transport:V.target.value==="interactive"?"tmux":"claude_stream_json"}}))},disabled:!o||d||f,className:"w-full rounded-lg border px-3 py-2.5 text-[11px] leading-[1.5] bg-transparent outline-none",style:{borderColor:b.border,color:b.ink},children:[a.jsx("option",{value:"async",children:"Async"}),a.jsx("option",{value:"interactive",children:"Interactive (PTY)"})]})]})]})]}):a.jsx("dl",{children:[["Path",p?.runtime.cwd??l.projectRoot??l.cwd??"Not reported"],["Harness",p?.runtime.harness??l.harness??"Not reported"],["Session",p?.runtime.sessionId??l.sessionId??"Not reported"],["Mode",(p?.runtime.transport??l.transport)==="tmux"?"Interactive (PTY)":"Async"],["Wake policy",p?.runtime.wakePolicy||l.wakePolicy||"Not reported"],["Live runtime",l.projectRoot??l.cwd??"Not reported"]].map(([V,D])=>a.jsxs("div",{className:"flex flex-col sm:flex-row sm:items-baseline sm:justify-between gap-1 py-2.5 border-b last:border-b-0",style:{borderColor:b.border},children:[a.jsx("dt",{className:"text-[9px] font-mono uppercase tracking-widest shrink-0 sm:w-[7.5rem]",style:e.mutedText,children:V}),a.jsx("dd",{className:"text-[11px] leading-[1.45] break-words min-w-0 text-left sm:text-right sm:max-w-[70%]",children:a.jsx("span",{style:e.inkText,children:V==="Path"||V==="Live runtime"?N(String(D),{className:"text-left sm:text-right underline underline-offset-2 decoration-dotted hover:opacity-80 transition-opacity"}):D})})]},V))})]}),a.jsxs("section",{className:"border rounded-xl p-5",style:{...e.surface,borderColor:b.border},children:[a.jsx("div",{className:"text-[10px] font-mono tracking-widest uppercase mb-3",style:{color:b.accent},children:"Tool Use"}),i?a.jsx("textarea",{value:p?.toolUse.launchArgsText??"",onChange:V=>{A(D=>({...D,toolUse:{...D.toolUse,launchArgsText:V.target.value}}))},readOnly:!o||d||f,className:"w-full min-h-[132px] rounded-lg border px-3 py-3 text-[11px] font-mono leading-[1.5] resize-y bg-transparent outline-none",style:{borderColor:b.border,color:b.ink}}):a.jsx("div",{className:"rounded-lg border px-3 py-3 text-[11px] font-mono leading-[1.55] whitespace-pre-wrap break-words min-h-[88px]",style:{borderColor:b.border,color:b.ink},children:p?HA(p.toolUse.launchArgsText)||"No launch args configured.":"Launch args load on demand when editing this agent."})]}),a.jsxs("section",{className:"border rounded-xl p-5",style:{...e.surface,borderColor:b.border},children:[a.jsx("div",{className:"text-[10px] font-mono tracking-widest uppercase mb-3",style:{color:b.accent},children:"Capabilities"}),i?a.jsx("input",{value:p?.capabilitiesText??"",onChange:V=>{A(D=>({...D,capabilitiesText:V.target.value}))},readOnly:!o||d||f,className:"w-full rounded-lg border px-3 py-2.5 text-[11px] leading-[1.5] bg-transparent outline-none",style:{borderColor:b.border,color:b.ink}}):null,y.length>0?a.jsx("div",{className:"flex flex-wrap gap-1.5 mt-2",children:y.map(V=>a.jsx("span",{className:"text-[9px] font-mono uppercase px-1.5 py-0.5 rounded",style:e.tagBadge,children:V},V))}):a.jsx("div",{className:"text-[11px]",style:e.mutedText,children:"No capabilities configured."}),h?a.jsx("div",{className:"text-[11px] mt-2 leading-[1.5]",style:e.inkText,children:h}):null]})]}),a.jsx("div",{className:"space-y-4 min-w-0",children:X})]})]}):a.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-[minmax(0,0.95fr)_minmax(320px,1.05fr)] gap-4 min-w-0",children:[a.jsxs("section",{className:"border rounded-xl p-5",style:{...e.surface,borderColor:b.border},children:[a.jsx("div",{className:"text-[10px] font-mono tracking-widest uppercase mb-1",style:{color:b.accent},children:"Agent Settings"}),a.jsx("div",{className:"text-[18px] font-semibold tracking-tight",style:e.inkText,children:"Select an agent"}),a.jsx("div",{className:"text-[12px] mt-2 leading-[1.6]",style:e.mutedText,children:"Agent configuration lives here now. Pick an agent from the list to edit its runtime, tools, and capabilities."})]}),a.jsx("div",{className:"space-y-4 min-w-0",children:X})]})}function HA(e){return e.replace(/\r\n/g,`
62
+ `).trim()}function FA({styles:e,showTelegram:l,showVoice:r,visibleAppSettings:i,isAppSettingsEditing:o,appSettingsSaving:u,appSettingsFeedback:d,onUpdateAppSettingsDraft:f,brokerInspector:p,brokerControlPending:h,brokerControlFeedback:y,onBrokerControl:g,relayServiceInspectorRef:v,relayRuntimeBooting:k,relayRuntimeHealthLabel:S,runtime:A,reachableRelayAgentCount:N,voiceCaptureTitle:R,voiceRepliesEnabled:L,onSetVoiceRepliesEnabled:H,renderLocalPathValue:X}){return a.jsx("div",{className:"max-w-3xl space-y-5",children:a.jsxs("div",{className:"space-y-5 min-w-0",children:[l?a.jsxs("section",{className:"border rounded-lg p-4",style:{...e.surface,borderColor:b.border},children:[a.jsxs("div",{className:"flex items-center justify-between gap-3 mb-3",children:[a.jsxs("div",{className:"flex items-center gap-2.5",children:[a.jsx("div",{className:"text-[9px] font-mono uppercase tracking-widest",style:e.mutedText,children:"Telegram Bridge"}),a.jsx("span",{className:"text-[8px] font-mono uppercase tracking-wider px-1 py-px rounded-sm",style:i?.telegram.running?e.activePill:e.tagBadge,children:i?.telegram.running?"Running":i?.telegram.enabled?"Stopped":"Disabled"})]}),a.jsxs("label",{className:"flex items-center gap-2 cursor-pointer",children:[a.jsx("span",{className:"text-[11px]",style:e.mutedText,children:"Enabled"}),a.jsx("input",{type:"checkbox",checked:i?.telegram.enabled??!1,disabled:!o||u,onChange:V=>{f(D=>({...D,telegram:{...D.telegram,enabled:V.target.checked}}))}})]})]}),a.jsxs("div",{className:"space-y-3",children:[a.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[a.jsxs("div",{children:[a.jsx("div",{className:"text-[9px] font-mono uppercase tracking-widest mb-1",style:e.mutedText,children:"Mode"}),o?a.jsxs("select",{value:i?.telegram.mode??"polling",onChange:V=>{f(D=>({...D,telegram:{...D.telegram,mode:V.target.value}}))},disabled:u,className:"w-full rounded-md border px-2.5 py-1.5 text-[12px] bg-transparent outline-none",style:{borderColor:b.border,color:b.ink},children:[a.jsx("option",{value:"polling",children:"polling"}),a.jsx("option",{value:"auto",children:"auto"}),a.jsx("option",{value:"webhook",children:"webhook"})]}):a.jsx("div",{className:"text-[12px] font-medium",style:e.inkText,children:i?.telegram.mode??"polling"})]}),a.jsxs("div",{children:[a.jsx("div",{className:"text-[9px] font-mono uppercase tracking-widest mb-1",style:e.mutedText,children:"Telegram Target"}),o?a.jsx("input",{value:i?.telegram.defaultConversationId??"dm.scout.primary",onChange:V=>{f(D=>({...D,telegram:{...D.telegram,defaultConversationId:V.target.value}}))},readOnly:u,className:"w-full rounded-md border px-2.5 py-1.5 text-[12px] bg-transparent outline-none",style:{borderColor:b.border,color:b.ink}}):a.jsx("div",{className:"text-[13px] font-medium",style:e.inkText,children:i?.telegram.defaultConversationId??"dm.scout.primary"})]})]}),a.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[a.jsxs("div",{children:[a.jsx("div",{className:"text-[9px] font-mono uppercase tracking-widest mb-1",style:e.mutedText,children:"Bot Username"}),o?a.jsx("input",{value:i?.telegram.userName??"",onChange:V=>{f(D=>({...D,telegram:{...D.telegram,userName:V.target.value}}))},readOnly:u,className:"w-full rounded-md border px-2.5 py-1.5 text-[12px] bg-transparent outline-none",style:{borderColor:b.border,color:b.ink}}):a.jsx("div",{className:"text-[12px] font-medium break-words",style:e.inkText,children:i?.telegram.userName||"Not set"})]}),a.jsxs("div",{children:[a.jsx("div",{className:"text-[9px] font-mono uppercase tracking-widest mb-1",style:e.mutedText,children:"Owner Node"}),o?a.jsx("input",{value:i?.telegram.ownerNodeId??"",onChange:V=>{f(D=>({...D,telegram:{...D.telegram,ownerNodeId:V.target.value}}))},readOnly:u,placeholder:"Automatic",className:"w-full rounded-md border px-2.5 py-1.5 text-[12px] bg-transparent outline-none",style:{borderColor:b.border,color:b.ink}}):a.jsx("div",{className:"text-[12px] font-medium break-words",style:e.inkText,children:i?.telegram.ownerNodeId||"Automatic"})]})]}),a.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[a.jsxs("div",{children:[a.jsx("div",{className:"text-[9px] font-mono uppercase tracking-widest mb-1",style:e.mutedText,children:"Bot Token"}),o?a.jsx("input",{type:"password",value:i?.telegram.botToken??"",onChange:V=>{f(D=>({...D,telegram:{...D.telegram,botToken:V.target.value}}))},readOnly:u,placeholder:"Telegram bot token",className:"w-full rounded-md border px-2.5 py-1.5 text-[12px] bg-transparent outline-none",style:{borderColor:b.border,color:b.ink}}):a.jsx("div",{className:"text-[11px]",style:e.inkText,children:i?.telegram.botToken?"Configured":"Not set"})]}),a.jsxs("div",{children:[a.jsx("div",{className:"text-[9px] font-mono uppercase tracking-widest mb-1",style:e.mutedText,children:"Webhook Secret"}),o?a.jsx("input",{type:"password",value:i?.telegram.secretToken??"",onChange:V=>{f(D=>({...D,telegram:{...D.telegram,secretToken:V.target.value}}))},readOnly:u,placeholder:"Optional",className:"w-full rounded-md border px-2.5 py-1.5 text-[12px] bg-transparent outline-none",style:{borderColor:b.border,color:b.ink}}):a.jsx("div",{className:"text-[11px]",style:e.inkText,children:i?.telegram.secretToken?"Configured":"Not set"})]})]}),a.jsxs("div",{children:[a.jsx("div",{className:"text-[9px] font-mono uppercase tracking-widest mb-1",style:e.mutedText,children:"API Base URL"}),o?a.jsx("input",{value:i?.telegram.apiBaseUrl??"",onChange:V=>{f(D=>({...D,telegram:{...D.telegram,apiBaseUrl:V.target.value}}))},readOnly:u,className:"w-full rounded-md border px-2.5 py-1.5 text-[12px] bg-transparent outline-none",style:{borderColor:b.border,color:b.ink}}):a.jsx("div",{className:"text-[12px] font-medium break-words",style:e.inkText,children:i?.telegram.apiBaseUrl||"Default Telegram API"})]}),d?a.jsx("div",{className:"text-[11px] leading-[1.5]",style:e.inkText,children:d}):null]})]}):null,a.jsxs("section",{ref:v,className:"border rounded-lg overflow-hidden",style:{...e.surface,borderColor:b.border},children:[p?a.jsxs(a.Fragment,{children:[a.jsxs("div",{className:"p-4",children:[a.jsxs("div",{className:"flex items-center justify-between gap-3 mb-4",children:[a.jsxs("div",{className:"flex items-center gap-2.5",children:[a.jsx("div",{className:"text-[9px] font-mono uppercase tracking-widest",style:e.mutedText,children:"Relay Service"}),a.jsx("span",{className:"text-[8px] font-mono uppercase tracking-wider px-1 py-px rounded-sm",style:p.reachable?e.activePill:e.tagBadge,children:p.statusLabel})]}),a.jsxs("div",{className:"flex items-center gap-1.5",children:[a.jsx(Tt,{type:"button",variant:p.reachable?"outline":"default",size:"sm",onClick:()=>g(p.reachable?"restart":"start"),disabled:h,children:p.reachable?"Restart":"Start"}),a.jsx(Tt,{type:"button",variant:"outline",size:"sm",onClick:()=>g("stop"),disabled:h||!p.loaded,children:"Stop"})]})]}),a.jsx("div",{className:"text-[11px] mb-4 leading-[1.5]",style:e.mutedText,children:p.statusDetail??"Service status not reported yet."}),a.jsx("div",{className:"grid grid-cols-3 gap-x-4 gap-y-3",children:[["Relay URL",p.url],["Version",p.version??"Not reported"],["Mode",p.mode],["Service Label",p.label],["PID",p.pid??"Not reported"],["Last Restart",p.lastRestartLabel??"Not reported"],["Launch State",p.launchdState??"Not reported"],["Mesh",p.meshId??"Not reported"],["Last Exit",p.lastExitStatus??"Not reported"]].map(([V,D])=>a.jsxs("div",{className:"min-w-0",children:[a.jsx("div",{className:"text-[9px] font-mono uppercase tracking-widest mb-0.5",style:e.mutedText,children:V}),a.jsx("div",{className:"text-[11px] leading-[1.45] break-words",style:e.inkText,children:D})]},V))}),p.processCommand?a.jsxs("div",{className:"mt-3 pt-3 border-t",style:{borderTopColor:b.border},children:[a.jsx("div",{className:"text-[9px] font-mono uppercase tracking-widest mb-0.5",style:e.mutedText,children:"Process"}),a.jsx("div",{className:"text-[10px] font-mono leading-[1.45] break-all",style:e.mutedText,children:p.processCommand})]}):null,y?a.jsx("div",{className:"mt-3 pt-3 border-t text-[11px] leading-[1.45]",style:{borderTopColor:b.border,color:b.ink},children:y}):null]}),a.jsx("div",{className:"border-t",style:{borderTopColor:b.border}})]}):null,a.jsxs("div",{className:"px-4 py-3",style:{backgroundColor:b.bg},children:[a.jsxs("div",{className:"flex items-center gap-2.5 mb-2.5",children:[a.jsx("div",{className:"text-[9px] font-mono uppercase tracking-widest",style:e.mutedText,children:"Runtime"}),a.jsx("span",{className:"text-[8px] font-mono uppercase tracking-wider px-1 py-px rounded-sm",style:k||A?.brokerHealthy?e.activePill:e.tagBadge,children:S})]}),a.jsx("div",{className:"grid grid-cols-4 gap-x-4 gap-y-2.5",children:[["Node ID",k?"Syncing…":A?.nodeId??"Not reported"],["Agents",`${A?.agentCount??0}`],["Conversations",`${A?.conversationCount??0}`],["Flights",`${A?.flightCount??0}`],["Latest Relay",k?"Syncing…":A?.latestRelayLabel??"Not reported"],["Updated",k?"Syncing…":A?.updatedAtLabel??"Not reported"]].map(([V,D])=>a.jsxs("div",{className:"min-w-0",children:[a.jsx("div",{className:"text-[9px] font-mono uppercase tracking-widest mb-0.5",style:e.mutedText,children:V}),a.jsx("div",{className:"text-[11px] leading-[1.45] break-words",style:e.inkText,children:D})]},V))})]})]}),p?a.jsxs("section",{className:"border rounded-lg p-4",style:{...e.surface,borderColor:b.border},children:[a.jsx("div",{className:"text-[9px] font-mono uppercase tracking-widest mb-3",style:e.mutedText,children:"Relay Paths"}),a.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-3",children:[["Support",p.supportDirectory],["Control Home",p.controlHome],["LaunchAgent",p.launchAgentPath],["Stdout Log",p.stdoutLogPath],["Stderr Log",p.stderrLogPath]].map(([V,D])=>a.jsxs("div",{children:[a.jsx("div",{className:"text-[9px] font-mono uppercase tracking-widest mb-0.5",style:e.mutedText,children:V}),a.jsx("div",{className:"text-[10px] font-mono leading-[1.45] truncate",style:e.mutedText,children:X(String(D),{className:"text-left underline underline-offset-2 decoration-dotted hover:opacity-80 transition-opacity"})})]},V))}),p.lastLogLine?a.jsxs("div",{className:"mt-3 pt-3 border-t",style:{borderTopColor:b.border},children:[a.jsx("div",{className:"text-[9px] font-mono uppercase tracking-widest mb-0.5",style:e.mutedText,children:"Last Service Log"}),a.jsx("div",{className:"text-[10px] font-mono leading-[1.45] break-words",style:e.mutedText,children:p.lastLogLine})]}):null]}):null,p&&(p.troubleshooting.length>0||p.feedbackSummary)?a.jsxs("section",{className:"border rounded-lg p-4",style:{...e.surface,borderColor:b.border},children:[a.jsx("div",{className:"text-[9px] font-mono uppercase tracking-widest mb-3",style:e.mutedText,children:"Diagnostics"}),p.troubleshooting.length>0?a.jsx("div",{className:"space-y-2 mb-4",children:p.troubleshooting.map(V=>a.jsx("div",{className:"text-[11px] leading-[1.5]",style:e.inkText,children:V},V))}):null,p.feedbackSummary?a.jsx("div",{className:"rounded-md border px-3 py-3 text-[10px] font-mono leading-[1.55] whitespace-pre-wrap break-words",style:{borderColor:b.border,color:b.ink},children:p.feedbackSummary}):null]}):null,r?a.jsxs("section",{className:"border rounded-lg p-4",style:{...e.surface,borderColor:b.border},children:[a.jsx("div",{className:"text-[9px] font-mono uppercase tracking-widest mb-3",style:e.mutedText,children:"Voice & Delivery"}),a.jsxs("div",{className:"grid grid-cols-3 gap-4",children:[a.jsxs("div",{children:[a.jsx("div",{className:"text-[9px] font-mono uppercase tracking-widest mb-0.5",style:e.mutedText,children:"Capture"}),a.jsx("div",{className:"text-[11px]",style:e.inkText,children:R})]}),a.jsxs("div",{children:[a.jsx("div",{className:"text-[9px] font-mono uppercase tracking-widest mb-0.5",style:e.mutedText,children:"Reachable Directs"}),a.jsx("div",{className:"text-[11px]",style:e.inkText,children:N})]}),a.jsxs("div",{children:[a.jsx("div",{className:"text-[9px] font-mono uppercase tracking-widest mb-0.5",style:e.mutedText,children:"Replies"}),a.jsx("button",{className:"os-toolbar-button text-[10px] font-medium px-2 py-0.5 rounded-md",style:{color:b.ink},onClick:()=>{H(!L)},children:L?"Disable":"Enable"})]})]})]}):null]})})}const qA=av("inline-flex items-center justify-center rounded-md border px-2 py-0.5 text-xs font-medium w-fit whitespace-nowrap shrink-0 [&>svg]:size-3 gap-1 [&>svg]:pointer-events-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive transition-[color,box-shadow] overflow-hidden",{variants:{variant:{default:"border-transparent bg-primary text-primary-foreground [a&]:hover:bg-primary/90",secondary:"border-transparent bg-secondary text-secondary-foreground [a&]:hover:bg-secondary/90",destructive:"border-transparent bg-destructive text-white [a&]:hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/60",outline:"text-foreground [a&]:hover:bg-accent [a&]:hover:text-accent-foreground"}},defaultVariants:{variant:"default"}});function Du({className:e,variant:l,asChild:r=!1,...i}){const o=r?nv:"span";return a.jsx(o,{"data-slot":"badge",className:Cn(qA({variant:l}),e),...i})}function VA({styles:e,selectedWorkspaceProject:l,selectedWorkspaceAgent:r,workspaceExplorerQuery:i,setWorkspaceExplorerQuery:o,workspaceExplorerFilter:u,setWorkspaceExplorerFilter:d,workspaceExplorerViewMode:f,setWorkspaceExplorerViewMode:p,workspaceExplorerItems:h,workspaceExplorerBoundCount:y,workspaceExplorerDiscoveredCount:g,filteredWorkspaceExplorerItems:v,workspaceInventoryLoaded:k,workspaceInventoryLoading:S,canRefreshWorkspaceInventory:A,onboardingCommandPending:N,appSettingsLoading:R,appSettingsSaving:L,appSettingsDirty:H,appSettingsFeedback:X,showDoctorOutput:V,doctorOutput:D,projectRetirementPendingRoot:I,onRefreshWorkspaceDiscovery:F,onLoadWorkspaceInventory:ne,onAddWorkspace:O,onInspectWorkspace:P,onOpenWorkspace:Q,onRetireWorkspace:oe,onOpenAgentProfile:W,onOpenAgentSettings:J,renderLocalPathValue:w}){return a.jsxs("div",{className:"max-w-6xl px-8 py-6 space-y-4",children:[a.jsx("section",{className:"border rounded-xl p-5",style:{...e.surface,borderColor:b.border},children:a.jsxs("div",{className:"flex items-start justify-between gap-4",children:[a.jsxs("div",{className:"min-w-0",children:[a.jsx("div",{className:"text-[10px] font-mono tracking-widest uppercase mb-1",style:{color:b.accent},children:"Workspace Discovery"}),a.jsx("div",{className:"text-[18px] font-semibold tracking-tight",style:e.inkText,children:"Workspace Explorer"}),a.jsx("div",{className:"text-[12px] mt-1 leading-[1.6]",style:e.mutedText,children:"Discover local projects, inspect harness readiness, and jump into the bound agent when one already exists."})]}),a.jsxs("div",{className:"hidden xl:flex items-center gap-2 shrink-0",children:[a.jsxs(Tt,{variant:"outline",size:"sm",className:"gap-2",onClick:F,disabled:!!N||R||L||H,children:[N==="doctor"?a.jsx(xn,{className:"text-[14px]"}):a.jsx(gn,{className:"h-4 w-4"}),N==="doctor"?"Scanning…":"Refresh"]}),a.jsxs(Tt,{size:"sm",className:"gap-2",onClick:O,children:[a.jsx(Ab,{className:"h-4 w-4"}),"Add Workspace"]})]})]})}),a.jsxs("section",{className:"border rounded-xl overflow-hidden",style:{...e.surface,borderColor:b.border},children:[a.jsx("div",{className:"px-6 py-4 border-b",style:{borderColor:b.border,backgroundColor:"color-mix(in srgb, var(--os-bg) 82%, transparent)"},children:a.jsxs("div",{className:"flex flex-col gap-3 xl:flex-row xl:items-center xl:justify-between",children:[a.jsxs("div",{className:"flex flex-1 flex-col gap-3 xl:flex-row xl:items-center",children:[a.jsxs("div",{className:"relative w-full xl:w-80",children:[a.jsx(To,{className:"absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2",style:{color:b.muted}}),a.jsx(cp,{placeholder:"Search workspaces...",value:i,onChange:Y=>o(Y.target.value),className:"pl-9"})]}),a.jsx("div",{className:"flex items-center gap-1 rounded-lg border p-1",style:{borderColor:b.border,backgroundColor:b.bg},children:[["all","All",h.length],["bound","Bound",y],["discovered","Discovered",g]].map(([Y,G,ve])=>{const T=u===Y;return a.jsx("button",{type:"button",className:"rounded-md px-3 py-1.5 text-[12px] font-medium transition-colors",style:{backgroundColor:T?b.surface:"transparent",color:T?b.ink:b.muted,boxShadow:T?b.shadowXs:"none"},onClick:()=>d(Y),children:a.jsxs("span",{className:"flex items-center gap-1.5",children:[Y==="bound"?a.jsx("span",{className:"h-2 w-2 rounded-full bg-emerald-500"}):null,G,a.jsx("span",{style:{color:b.muted},children:ve})]})},Y)})})]}),a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsxs("div",{className:"flex items-center gap-0.5 rounded-lg border p-0.5",style:{borderColor:b.border,backgroundColor:b.bg},children:[a.jsx("button",{type:"button",className:"rounded-md p-1.5 transition-colors",style:{backgroundColor:f==="grid"?b.surface:"transparent",color:f==="grid"?b.ink:b.muted},onClick:()=>p("grid"),title:"Grid view",children:a.jsx(mw,{className:"h-4 w-4"})}),a.jsx("button",{type:"button",className:"rounded-md p-1.5 transition-colors",style:{backgroundColor:f==="list"?b.surface:"transparent",color:f==="list"?b.ink:b.muted},onClick:()=>p("list"),title:"List view",children:a.jsx(O1,{className:"h-4 w-4"})})]}),a.jsxs("div",{className:"xl:hidden flex items-center gap-2",children:[a.jsxs(Tt,{variant:"outline",size:"sm",className:"gap-2",onClick:F,disabled:!!N||R||L||H,children:[N==="doctor"?a.jsx(xn,{className:"text-[14px]"}):a.jsx(gn,{className:"h-4 w-4"}),"Refresh"]}),a.jsxs(Tt,{size:"sm",className:"gap-2",onClick:O,children:[a.jsx(Ab,{className:"h-4 w-4"}),"Add"]})]})]})]})}),a.jsx("div",{className:"p-6",children:k?v.length===0?a.jsxs("div",{className:"flex flex-col items-center justify-center rounded-xl border border-dashed px-6 py-12 text-center",style:{borderColor:b.border},children:[a.jsx(xa,{className:"h-8 w-8 mb-3",style:{color:b.muted,opacity:.5}}),a.jsx("div",{className:"text-[13px] font-medium mb-1",style:e.inkText,children:"No workspaces found"}),a.jsx("div",{className:"text-[11px] mb-4 max-w-md leading-[1.6]",style:e.mutedText,children:i?"Try a different search term or filter.":"Add scan directories in General settings, then refresh to discover workspaces."}),a.jsxs(Tt,{variant:"outline",className:"gap-2",onClick:F,disabled:!!N||R||L||H,children:[N==="doctor"?a.jsx(xn,{className:"text-[14px]"}):a.jsx(gn,{className:"h-4 w-4"}),"Scan Workspaces"]})]}):f==="grid"?a.jsx("div",{className:"grid grid-cols-1 gap-3 md:grid-cols-2 2xl:grid-cols-3",children:v.map(Y=>a.jsx($A,{item:Y,isSelected:l?.id===Y.project.id,onSelect:()=>P(Y.project),onPrimaryAction:()=>Q(Y.project),onSecondaryAction:()=>oe(Y.project),secondaryActionPending:I===Y.project.root},Y.project.id))}):a.jsx(GA,{items:v,selectedWorkspaceId:l?.id??null,onSelectWorkspace:P,onPrimaryAction:Q,onSecondaryAction:oe,projectRetirementPendingRoot:I}):a.jsxs("div",{className:"flex flex-col items-stretch rounded-xl border border-dashed px-6 py-10 text-center",style:{borderColor:b.border},"aria-busy":S,children:[a.jsxs("div",{className:"flex flex-col items-center max-w-lg mx-auto",children:[S?a.jsx(xn,{className:"text-[28px] mb-3",style:{color:b.muted,opacity:.7}}):a.jsx(xa,{className:"h-8 w-8 mb-3",style:{color:b.muted,opacity:.5}}),a.jsx("div",{className:"text-[13px] font-medium mb-1",style:e.inkText,children:S?"Loading workspaces…":"Workspace inventory is not loaded yet"}),a.jsx("div",{className:"text-[11px] mb-5 max-w-md leading-[1.6]",style:e.mutedText,children:"Scan folders and project manifests are read when you load this list. Use General to edit scan roots first if discovery looks empty."}),a.jsxs(Tt,{variant:"default",size:"sm",className:"gap-2",onClick:ne,disabled:S||!A,children:[S?a.jsx(xn,{className:"text-[14px]"}):a.jsx(gn,{className:"h-4 w-4"}),"Load Workspaces"]})]}),S?a.jsx("div",{className:"grid grid-cols-1 gap-3 md:grid-cols-2 2xl:grid-cols-3 mt-8 w-full",children:[0,1,2].map(Y=>a.jsx("div",{className:"h-[88px] rounded-xl border animate-pulse",style:{borderColor:b.border,backgroundColor:"color-mix(in srgb, var(--os-bg) 70%, transparent)"}},`ws-skel-${Y}`))}):null]})})]}),X?a.jsx("div",{className:"text-[11px] leading-[1.5]",style:e.inkText,children:X}):null,V?a.jsxs("div",{className:"space-y-2",children:[a.jsx("div",{className:"text-[9px] font-mono uppercase tracking-widest",style:e.mutedText,children:"Scan Results"}),D]}):null,l?a.jsxs(a.Fragment,{children:[a.jsx("section",{className:"border rounded-xl p-5",style:{...e.surface,borderColor:b.border},children:a.jsxs("div",{className:"flex items-start justify-between gap-4",children:[a.jsxs("div",{className:"min-w-0",children:[a.jsx("div",{className:"text-[10px] font-mono tracking-widest uppercase",style:{color:b.accent},children:"Workspace Details"}),a.jsx("div",{className:"text-[18px] font-semibold tracking-tight mt-1.5",style:e.inkText,children:l.title}),a.jsx("div",{className:"text-[12px] mt-2 leading-[1.6]",style:e.mutedText,children:r?"Bound workspace with an existing agent.":"Discovered workspace. No bound agent is attached yet."})]}),a.jsx("button",{type:"button",className:"os-toolbar-button text-[10px] font-medium px-2 py-1 rounded disabled:opacity-50 shrink-0",style:{color:b.ink},onClick:()=>oe(l),disabled:!!I,children:I===l.root?"Retiring…":"Retire Workspace"})]})}),a.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-[minmax(0,1.1fr)_minmax(320px,0.9fr)] gap-4",children:[a.jsxs("section",{className:"border rounded-xl p-5 min-w-0",style:{...e.surface,borderColor:b.border},children:[a.jsx("div",{className:"text-[10px] font-mono tracking-widest uppercase mb-3",style:{color:b.accent},children:"Workspace Summary"}),a.jsx("div",{className:"grid grid-cols-2 gap-x-4 gap-y-3",children:[["Workspace",l.projectName],["Agent ID",l.definitionId],["Root",l.root],["Source Root",l.sourceRoot],["Relative Path",l.relativePath],["Default Harness",l.defaultHarness],["Registration",l.registrationKind],["Manifest",l.projectConfigPath??"Not created"]].map(([Y,G])=>a.jsxs("div",{className:"min-w-0",children:[a.jsx("div",{className:"text-[9px] font-mono uppercase tracking-widest mb-1",style:e.mutedText,children:Y}),a.jsx("div",{className:"text-[11px] leading-[1.45] break-words",style:e.inkText,children:Y==="Root"||Y==="Source Root"||Y==="Manifest"?w(String(G),{className:"text-left underline underline-offset-2 decoration-dotted hover:opacity-80 transition-opacity"}):G})]},Y))})]}),a.jsxs("div",{className:"space-y-4 min-w-0",children:[r?a.jsxs("section",{className:"border rounded-xl p-5",style:{...e.surface,borderColor:b.border},children:[a.jsx("div",{className:"text-[10px] font-mono tracking-widest uppercase mb-3",style:{color:b.accent},children:"Bound Agent"}),a.jsx("div",{className:"text-[14px] font-medium",style:e.inkText,children:r.title}),a.jsxs("div",{className:"text-[11px] mt-1 leading-[1.6]",style:e.mutedText,children:[r.profileKind," · ",r.statusDetail??r.summary??"No status reported."]}),a.jsxs("div",{className:"flex items-center gap-2 mt-4",children:[a.jsx("button",{type:"button",className:"os-toolbar-button text-[10px] font-medium px-2 py-1 rounded",style:{color:b.ink},onClick:()=>W(r.id),children:"Open Agent"}),a.jsx("button",{type:"button",className:"os-toolbar-button text-[10px] font-medium px-2 py-1 rounded",style:{color:b.ink},onClick:()=>J(r.id),children:"Edit Agent"})]})]}):null,a.jsxs("section",{className:"border rounded-xl p-5",style:{...e.surface,borderColor:b.border},children:[a.jsx("div",{className:"text-[10px] font-mono tracking-widest uppercase mb-3",style:{color:b.accent},children:"Harness Evidence"}),a.jsx("div",{className:"space-y-2",children:l.harnesses.map(Y=>a.jsxs("div",{className:"rounded-lg border px-3 py-3",style:{borderColor:b.border,backgroundColor:b.bg},children:[a.jsxs("div",{className:"flex items-center justify-between gap-3",children:[a.jsx("div",{className:"text-[12px] font-medium",style:e.inkText,children:Y.harness}),a.jsx("span",{className:"text-[9px] font-mono px-1.5 py-0.5 rounded",style:Y.readinessState==="ready"?e.activePill:e.tagBadge,children:Y.source})]}),a.jsx("div",{className:"text-[10px] mt-1 leading-[1.5]",style:e.mutedText,children:Y.detail}),Y.readinessDetail?a.jsx("div",{className:"text-[10px] mt-1 leading-[1.5]",style:e.mutedText,children:Y.readinessDetail}):null]},`${Y.harness}-${Y.source}`))})]})]})]})]}):a.jsxs("section",{className:"border rounded-xl p-5",style:{...e.surface,borderColor:b.border},children:[a.jsx("div",{className:"text-[13px] font-medium mb-1",style:e.inkText,children:"Select a workspace"}),a.jsx("div",{className:"text-[12px] leading-[1.6]",style:e.mutedText,children:"Choose a workspace above to inspect its project details, harness evidence, and any bound agent."})]})]})}const Rr={ink:{color:b.ink},muted:{color:b.muted}};function $A({item:e,isSelected:l,onSelect:r,onPrimaryAction:i,onSecondaryAction:o,secondaryActionPending:u}){const{project:d,isBound:f,primaryHarness:p,pathLabel:h,branchLabel:y,activityLabel:g,statusLabel:v}=e,k=d.title.trim().charAt(0).toUpperCase()||"W",S=f?"border-emerald-500/20 bg-emerald-500/10 text-emerald-700":d.registrationKind==="configured"?"border-amber-500/20 bg-amber-500/10 text-amber-700":"border-border bg-secondary text-secondary-foreground";return a.jsxs("div",{className:Cn("os-card rounded-xl border p-4 cursor-pointer",l?"ring-1 ring-[color:var(--os-accent)]":""),style:{borderColor:l?b.accent:b.border,backgroundColor:b.surface,boxShadow:l?b.shadowSm:void 0},onClick:r,children:[a.jsxs("div",{className:"flex items-start gap-3",children:[a.jsx("div",{className:Cn("flex h-9 w-9 shrink-0 items-center justify-center rounded-lg text-[12px] font-semibold",f?"bg-emerald-500/10 text-emerald-700":"bg-secondary text-secondary-foreground"),children:k}),a.jsxs("div",{className:"min-w-0 flex-1",children:[a.jsx("div",{className:"text-[13px] font-semibold leading-tight tracking-tight",style:Rr.ink,children:d.title}),a.jsx("div",{className:"mt-0.5 truncate text-[10px] font-mono",style:Rr.muted,children:h})]})]}),a.jsxs("div",{className:"mt-3 flex flex-wrap items-center gap-1.5",children:[a.jsx(Du,{variant:"outline",className:"font-mono text-[10px] capitalize",children:p}),a.jsxs(Du,{className:Cn("text-[10px]",S),children:[f?a.jsx(H1,{className:"h-3 w-3"}):null,v]})]}),a.jsxs("div",{className:"mt-3 flex items-center gap-3 text-[10px]",style:Rr.muted,children:[a.jsxs("div",{className:"flex items-center gap-1",children:[a.jsx(R1,{className:"h-3 w-3"}),y]}),a.jsxs("div",{className:"flex items-center gap-1",children:[a.jsx(as,{className:"h-3 w-3"}),g]})]}),a.jsx("div",{className:"mt-3 border-t pt-3",style:{borderColor:b.border},children:a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx(Tt,{variant:f?"outline":"default",size:"sm",className:"flex-1 text-[11px]",onClick:A=>{A.stopPropagation(),i()},children:f?"Open Agent":"Inspect"}),a.jsx(Tt,{variant:"ghost",size:"sm",className:"text-[11px]",onClick:A=>{A.stopPropagation(),o()},disabled:u,children:u?"Retiring…":"Retire"})]})})]})}function GA({items:e,selectedWorkspaceId:l,onSelectWorkspace:r,onPrimaryAction:i,onSecondaryAction:o,projectRetirementPendingRoot:u}){return a.jsx("div",{className:"overflow-hidden rounded-2xl border",style:{borderColor:b.border,backgroundColor:b.surface},children:a.jsxs("table",{className:"w-full",children:[a.jsx("thead",{children:a.jsxs("tr",{style:{backgroundColor:"color-mix(in srgb, var(--os-bg) 82%, transparent)"},children:[a.jsx("th",{className:"px-4 py-3 text-left text-[10px] font-mono uppercase tracking-widest",style:Rr.muted,children:"Workspace"}),a.jsx("th",{className:"px-4 py-3 text-left text-[10px] font-mono uppercase tracking-widest",style:Rr.muted,children:"Harness"}),a.jsx("th",{className:"px-4 py-3 text-left text-[10px] font-mono uppercase tracking-widest",style:Rr.muted,children:"Status"}),a.jsx("th",{className:"px-4 py-3 text-right text-[10px] font-mono uppercase tracking-widest",style:Rr.muted,children:"Actions"})]})}),a.jsx("tbody",{children:e.map(d=>{const f=l===d.project.id;return a.jsxs("tr",{className:"border-t",style:{borderColor:b.border,backgroundColor:f?"color-mix(in srgb, var(--os-surface) 80%, white)":"transparent"},children:[a.jsx("td",{className:"px-4 py-3",children:a.jsxs("button",{type:"button",onClick:()=>r(d.project),className:"flex min-w-0 items-center gap-3 text-left",children:[a.jsx("div",{className:Cn("flex h-8 w-8 shrink-0 items-center justify-center rounded-lg text-xs font-semibold",d.isBound?"bg-emerald-500/10 text-emerald-700":"bg-secondary text-secondary-foreground"),children:d.project.title.trim().charAt(0).toUpperCase()||"W"}),a.jsxs("div",{className:"min-w-0",children:[a.jsx("div",{className:"truncate text-[13px] font-medium",style:Rr.ink,children:d.project.title}),a.jsx("div",{className:"truncate text-[11px]",style:Rr.muted,children:d.pathLabel})]})]})}),a.jsx("td",{className:"px-4 py-3",children:a.jsx(Du,{variant:"outline",className:"font-mono text-[11px] capitalize",children:d.primaryHarness})}),a.jsx("td",{className:"px-4 py-3",children:a.jsxs(Du,{className:Cn("text-[11px]",d.isBound?"border-emerald-500/20 bg-emerald-500/10 text-emerald-700":d.project.registrationKind==="configured"?"border-amber-500/20 bg-amber-500/10 text-amber-700":"border-border bg-secondary text-secondary-foreground"),children:[d.isBound?a.jsx(H1,{className:"h-3 w-3"}):null,d.statusLabel]})}),a.jsx("td",{className:"px-4 py-3",children:a.jsxs("div",{className:"flex items-center justify-end gap-1.5",children:[a.jsx(Tt,{variant:d.isBound?"outline":"default",size:"sm",onClick:()=>i(d.project),children:d.isBound?"Open":"Inspect"}),a.jsx(Tt,{variant:"ghost",size:"icon-sm",onClick:()=>o(d.project),disabled:u===d.project.root,children:a.jsx(I1,{className:"h-4 w-4"})})]})})]},d.project.id)})})]})})}function YA({activeView:e,help:l,settings:r}){if(e==="help")return a.jsx("div",{className:"flex-1 overflow-y-auto",children:a.jsxs("div",{className:"max-w-5xl px-8 py-6",children:[a.jsxs("div",{className:"flex items-start justify-between gap-6 mb-5",children:[a.jsxs("div",{children:[a.jsx("div",{className:"text-[10px] font-mono tracking-widest uppercase mb-1.5",style:{color:b.accent},children:"Help"}),a.jsx("h1",{className:"text-[22px] font-semibold tracking-tight",style:l.styles.inkText,children:"Knowledge Base"}),a.jsx("p",{className:"text-[12px] mt-1.5 max-w-2xl leading-[1.6]",style:l.styles.mutedText,children:"Core Scout terms and the main CLI commands you can use here or in Terminal."})]}),a.jsx("div",{className:"flex items-center gap-2 shrink-0",children:a.jsxs("button",{type:"button",className:"os-toolbar-button flex items-center gap-1 text-[10px] font-medium px-2 py-1 rounded-md",style:{color:b.ink},onClick:l.onOpenGeneralSettings,children:[a.jsx(ni,{size:12}),"General"]})})]}),a.jsxs("div",{className:"space-y-5",children:[a.jsxs("section",{className:"border rounded-xl p-5",style:{...l.styles.surface,borderColor:b.border},children:[a.jsx("div",{className:"flex items-start justify-between gap-4 mb-5",children:a.jsxs("div",{className:"min-w-0",children:[a.jsx("div",{className:"text-[10px] font-mono tracking-widest uppercase",style:{color:b.accent},children:"Vocabulary"}),a.jsx("div",{className:"text-[14px] font-medium mt-1",style:l.styles.inkText,children:"What Scout means by each term"})]})}),a.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[["Project Path","A folder Scout scans recursively to discover repos, project roots, and harness evidence."],["Context Root","The directory where Scout saves `.openscout/project.json` for the current local context."],["Harness","The assistant family a project prefers by default, such as `claude` or `codex`."],["Runtime","The installed local program or persistent session Scout uses to launch a chosen harness."]].map(([u,d])=>a.jsxs("article",{className:"rounded-xl border px-4 py-3.5",style:{borderColor:b.border,backgroundColor:b.bg},children:[a.jsx("div",{className:"text-[10px] font-mono tracking-widest uppercase",style:{color:b.accent},children:u}),a.jsx("div",{className:"text-[12px] mt-2 leading-[1.6]",style:l.styles.inkText,children:d})]},u))})]}),a.jsxs("section",{className:"border rounded-xl p-5",style:{...l.styles.surface,borderColor:b.border},children:[a.jsx("div",{className:"flex items-start justify-between gap-4 mb-5",children:a.jsxs("div",{className:"min-w-0",children:[a.jsx("div",{className:"text-[10px] font-mono tracking-widest uppercase",style:{color:b.accent},children:"CLI Basics"}),a.jsx("div",{className:"text-[14px] font-medium mt-1",style:l.styles.inkText,children:"The same commands the app runs for you"}),a.jsx("div",{className:"text-[12px] mt-1 leading-[1.6] max-w-2xl",style:l.styles.mutedText,children:"Run them from here for guidance, or copy them into your shell when you want the direct Scout workflow."})]})}),a.jsx("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-4",children:[{command:"setup",title:"Setup",detail:"Writes a local `.openscout/project.json` for the chosen context."},{command:"doctor",title:"Doctor",detail:"Checks broker health and whether Scout can discover workspaces from your scan roots."},{command:"runtimes",title:"Runtimes",detail:"Shows whether Claude and Codex are installed, authenticated, and ready."}].map(u=>a.jsxs("article",{className:"rounded-xl border px-4 py-3.5",style:{borderColor:b.border,backgroundColor:b.bg},children:[a.jsx("div",{className:"text-[10px] font-mono tracking-widest uppercase",style:{color:b.accent},children:u.title}),a.jsx("div",{className:"text-[12px] mt-2 leading-[1.6]",style:l.styles.inkText,children:u.detail}),a.jsx("div",{className:"text-[10px] font-mono mt-3 break-all",style:l.styles.mutedText,children:l.buildOnboardingCommandLine(u.command)}),a.jsxs("div",{className:"flex items-center gap-2 mt-3",children:[a.jsxs("button",{type:"button",className:"os-toolbar-button flex items-center gap-1 text-[10px] font-medium px-2 py-1 rounded-md",style:{color:b.ink},onClick:()=>{l.onCopyOnboardingCommand(u.command)},children:[l.onboardingCopiedCommand===u.command?a.jsx(So,{size:12}):a.jsx(Or,{size:12}),"Copy"]}),a.jsxs("button",{type:"button",className:"os-toolbar-button flex items-center gap-1 text-[10px] font-medium px-2 py-1 rounded-md disabled:opacity-50",style:{color:b.ink},onClick:()=>{l.onRunOnboardingCommand(u.command)},disabled:!!l.onboardingCommandPending,children:[a.jsx(yo,{size:12}),"Run"]})]})]},u.command))})]})]})]})});if(e!=="settings")return null;const i=r.profile,o=i.visibleAppSettings;return a.jsxs("div",{className:"flex-1 flex overflow-hidden",style:r.styles.surface,children:[a.jsxs("div",{className:"w-56 border-r flex flex-col shrink-0",style:{backgroundColor:b.bg,borderColor:b.border},children:[a.jsx("div",{className:"px-4 py-3 border-b",style:{borderColor:b.border},children:a.jsx("div",{className:"text-[10px] font-mono tracking-widest uppercase",style:{color:b.accent},children:"Settings"})}),a.jsx("div",{className:"px-2 py-2 flex flex-col gap-0.5 flex-1",children:r.settingsSections.map(u=>{const d=r.settingsSection===u.id;return a.jsxs("button",{onClick:()=>r.onSetSettingsSection(u.id),className:"flex items-center gap-2.5 px-3 py-2 rounded-lg text-left transition-colors",style:d?{backgroundColor:b.surface,borderColor:b.border,color:b.ink,boxShadow:b.shadowXs}:r.styles.mutedText,children:[a.jsx("span",{style:{color:d?b.accent:b.muted},children:u.icon}),a.jsx("span",{className:"text-[12px] font-medium",style:d?r.styles.inkText:void 0,children:u.label}),d?a.jsx(_l,{size:12,className:"ml-auto",style:r.styles.mutedText}):null]},u.id)})}),a.jsx("div",{className:"px-3 py-3 border-t",style:{borderColor:b.border},children:a.jsxs("button",{type:"button",onClick:r.onOpenFeedbackDialog,className:"flex items-center gap-2 px-3 py-2 w-full rounded-lg transition-colors hover:opacity-70",style:r.styles.mutedText,children:[a.jsx(Bl,{size:13,style:{color:b.muted}}),a.jsx("span",{className:"text-[12px] font-medium",children:"Feedback"})]})})]}),a.jsx("div",{className:"flex-1 overflow-y-auto",children:a.jsxs("div",{className:"max-w-6xl px-8 py-6",children:[a.jsxs("div",{className:"flex items-start justify-between gap-6 mb-5",children:[a.jsxs("div",{children:[a.jsx("div",{className:"text-[10px] font-mono tracking-widest uppercase mb-1",style:{color:b.accent},children:"Settings"}),a.jsx("h1",{className:"text-[18px] font-semibold tracking-tight",style:r.styles.inkText,children:r.activeSettingsMeta.label}),a.jsx("p",{className:"text-[11px] mt-1 max-w-2xl leading-[1.6]",style:r.styles.mutedText,children:r.activeSettingsMeta.description})]}),a.jsx("div",{className:"flex items-center gap-2 shrink-0",children:r.headerActions})]}),r.settingsSection==="profile"?a.jsx("div",{className:"max-w-3xl",children:a.jsxs("div",{className:"space-y-5 min-w-0",children:[o?.onboarding?.needed?a.jsxs("section",{className:"border rounded-xl p-5",style:{...r.styles.surface,borderColor:b.border},children:[a.jsxs("div",{className:"flex items-start justify-between gap-3",children:[a.jsxs("div",{className:"min-w-0",children:[a.jsx("div",{className:"text-[10px] font-mono tracking-widest uppercase",style:r.styles.mutedText,children:"Onboarding"}),a.jsx("div",{className:"text-[13px] font-medium mt-1",style:r.styles.inkText,children:o.onboarding.title}),a.jsx("div",{className:"text-[11px] mt-1 leading-[1.5]",style:r.styles.mutedText,children:o.onboarding.detail})]}),a.jsxs("div",{className:"flex items-center gap-2 shrink-0",children:[a.jsxs("button",{type:"button",className:"os-toolbar-button flex items-center gap-1 text-[10px] font-medium px-2 py-1 rounded",style:{color:b.ink},onClick:i.handleRestartOnboarding,children:[a.jsx(gn,{size:12}),"Restart onboarding"]}),a.jsx("span",{className:"text-[9px] font-mono uppercase tracking-wider px-1.5 py-0.5 rounded",style:r.styles.tagBadge,children:`${i.activeOnboardingStepIndex+1}/${i.onboardingWizardSteps.length}`})]})]}),a.jsxs("div",{className:"mt-4 grid grid-cols-1 gap-4 lg:grid-cols-[minmax(0,220px)_minmax(0,1fr)]",children:[a.jsx("div",{className:"space-y-2",children:i.onboardingWizardSteps.map((u,d)=>{const f=i.onboardingWizardStep===u.id,p=d<i.activeOnboardingStepIndex;return a.jsx("button",{type:"button",className:"w-full rounded-lg border px-3 py-2 text-left transition-opacity hover:opacity-90",style:{borderColor:f?b.accent:b.border,backgroundColor:f?b.accentBg:b.surface,color:f?b.accent:b.ink},onClick:()=>i.setOnboardingWizardStep(u.id),children:a.jsxs("div",{className:"flex items-center justify-between gap-3",children:[a.jsxs("div",{className:"min-w-0",children:[a.jsx("div",{className:"text-[10px] font-mono uppercase tracking-widest",children:u.title}),a.jsx("div",{className:"text-[10px] mt-1 leading-[1.5]",style:f?{color:b.accent}:r.styles.mutedText,children:u.detail})]}),a.jsx("span",{className:"text-[9px] font-mono px-1.5 py-0.5 rounded shrink-0",style:p?r.styles.activePill:r.styles.tagBadge,children:p?"done":d+1})]})},u.id)})}),a.jsxs("div",{className:"rounded-xl border p-4",style:{borderColor:b.border,backgroundColor:b.bg},children:[a.jsx("div",{className:"text-[10px] font-mono uppercase tracking-widest",style:{color:b.accent},children:i.activeOnboardingStep.title}),a.jsx("div",{className:"text-[13px] font-medium mt-1",style:r.styles.inkText,children:i.activeOnboardingStep.detail}),a.jsx("div",{className:"text-[11px] mt-2 leading-[1.6]",style:r.styles.mutedText,children:i.activeOnboardingStep.helper}),i.activeOnboardingStep.id==="welcome"?a.jsxs("div",{className:"mt-4 space-y-4",children:[a.jsxs("div",{className:"rounded-lg border px-3 py-3",style:{borderColor:b.border,backgroundColor:b.surface},children:[a.jsx("div",{className:"text-[12px] font-medium",style:r.styles.inkText,children:"Before you start"}),a.jsx("div",{className:"text-[10px] mt-1 leading-[1.5]",style:r.styles.mutedText,children:"Scout discovers workspaces from scan folders, stores local config under a context root, and needs a default harness before it can broker local runs."})]}),a.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-3",children:[["Source roots",(o.workspaceRoots??[]).join(", ")||"None yet"],["Context root",o.onboardingContextRoot||"Not set"],["Default harness",o.defaultHarness??"Not set"],["Operator",o.operatorName||o.operatorNameDefault]].map(([u,d])=>a.jsxs("div",{children:[a.jsx("div",{className:"text-[9px] font-mono uppercase tracking-widest mb-1",style:r.styles.mutedText,children:u}),a.jsx("div",{className:"text-[11px] leading-[1.45]",style:r.styles.inkText,children:d})]},u))})]}):i.activeOnboardingStep.id==="source-roots"?a.jsxs("div",{className:"mt-4 space-y-4",children:[a.jsxs("div",{className:"rounded-lg border px-3 py-3",style:{borderColor:b.border,backgroundColor:b.surface},children:[a.jsx("div",{className:"text-[12px] font-medium",style:r.styles.inkText,children:"Project scan folders"}),a.jsx("div",{className:"text-[10px] mt-1 leading-[1.5]",style:r.styles.mutedText,children:"Scout recursively scans these folders to find repos, manifests, and harness evidence."})]}),a.jsx("div",{className:"space-y-2",children:(o.workspaceRoots??[]).map((u,d)=>a.jsxs("div",{className:"flex items-center gap-1.5",children:[a.jsx("input",{value:u,onChange:f=>i.handleSetSourceRootAt(d,f.target.value),readOnly:!i.isAppSettingsEditing||i.appSettingsSaving,className:"flex-1 rounded-md border px-2.5 py-1.5 text-[12px] leading-[1.5] bg-transparent outline-none font-mono",style:{borderColor:b.border,color:b.ink},placeholder:d===0?"~/dev":"Add another scan folder"}),a.jsx("button",{type:"button",className:"os-toolbar-button text-[10px] font-medium px-2 py-1.5 rounded-md",style:{color:b.ink},onClick:()=>i.handleBrowseForSourceRoot(d),disabled:!i.isAppSettingsEditing||i.appSettingsSaving,children:"Finder"}),a.jsx("button",{type:"button",className:"os-toolbar-button text-[12px] font-medium w-7 h-7 rounded-md disabled:opacity-50",style:{color:b.ink},onClick:()=>i.handleRemoveSourceRootRow(d),disabled:!i.isAppSettingsEditing||i.appSettingsSaving||(o.workspaceRoots??[]).length<=1&&!u,"aria-label":`Remove source root ${d+1}`,children:"-"})]},`onboarding-source-root-${d}`))}),a.jsxs("div",{className:"flex flex-wrap items-center gap-1.5",children:[a.jsxs("button",{type:"button",className:"os-toolbar-button flex items-center gap-1 text-[10px] font-medium px-2 py-1 rounded-md disabled:opacity-50",style:{color:b.ink},onClick:()=>{i.handleBeginGeneralEdit(),i.handleAddSourceRootRow()},disabled:i.appSettingsSaving,children:[a.jsx("span",{className:"text-[12px] leading-none",children:"+"}),"Add path"]}),a.jsx("span",{className:"text-[10px]",style:r.styles.mutedText,children:"or"}),i.sourceRootPathSuggestions.map(u=>a.jsx("button",{type:"button",className:"os-toolbar-button text-[10px] font-mono px-2 py-1 rounded-md disabled:opacity-50",style:{color:b.ink},onClick:()=>{i.handleBeginGeneralEdit(),i.handleAddSourceRootSuggestion(u)},disabled:i.appSettingsSaving,children:u},u))]}),a.jsxs("div",{className:"rounded-lg border px-3 py-3",style:{borderColor:b.border,backgroundColor:b.surface},children:[a.jsx("div",{className:"text-[9px] font-mono uppercase tracking-widest mb-1",style:r.styles.mutedText,children:"Context root"}),i.isAppSettingsEditing?a.jsxs(a.Fragment,{children:[a.jsxs("div",{className:"flex items-center gap-1.5 max-w-md",children:[a.jsx("input",{value:o.onboardingContextRoot??"",onChange:u=>i.handleSetOnboardingContextRoot(u.target.value),readOnly:i.appSettingsSaving,className:"flex-1 rounded-md border px-2.5 py-1.5 text-[12px] leading-[1.5] bg-transparent outline-none font-mono",style:{borderColor:b.border,color:b.ink},placeholder:"Choose where .openscout should live"}),a.jsx("button",{type:"button",className:"os-toolbar-button text-[10px] font-medium px-2 py-1.5 rounded-md",style:{color:b.ink},onClick:i.handleBrowseForOnboardingContextRoot,disabled:i.appSettingsSaving,children:"Finder"})]}),a.jsx("div",{className:"text-[10px] mt-2 leading-[1.5]",style:r.styles.mutedText,children:"Project manifest will be saved here."})]}):a.jsx("div",{className:"text-[11px] leading-[1.45]",style:r.styles.inkText,children:o.onboardingContextRoot||"Not set"})]})]}):i.activeOnboardingStep.id==="harness"?a.jsxs("div",{className:"mt-4 space-y-4",children:[a.jsxs("div",{className:"rounded-lg border px-3 py-3",style:{borderColor:b.border,backgroundColor:b.surface},children:[a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx(z1,{size:14,style:{color:b.accent}}),a.jsx("div",{className:"text-[12px] font-medium",style:r.styles.inkText,children:"Harness vs runtime"})]}),a.jsx("div",{className:"text-[10px] mt-2 leading-[1.5]",style:r.styles.mutedText,children:"The harness is the assistant family (e.g. Claude, Codex). The runtime is the local program that launches it."})]}),a.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-3",children:["claude","codex"].map(u=>{const d=(o.runtimeCatalog??[]).find(p=>p.name===u)??null,f=o.defaultHarness===u;return a.jsx("button",{className:"text-left rounded-lg border px-3 py-3 transition-opacity hover:opacity-90 disabled:opacity-60",style:{borderColor:b.border,backgroundColor:f?b.bg:b.surface},disabled:!i.isAppSettingsEditing||i.appSettingsSaving,onClick:()=>{i.setAppSettingsDraft(p=>p&&{...p,defaultHarness:u}),i.setAppSettingsFeedback(null)},children:a.jsxs("div",{className:"flex items-start justify-between gap-3",children:[a.jsxs("div",{className:"min-w-0",children:[a.jsx("div",{className:"text-[12px] font-medium capitalize",style:r.styles.inkText,children:u}),a.jsx("div",{className:"text-[10px] mt-1 leading-[1.5]",style:r.styles.mutedText,children:u==="claude"?"Use Claude as the default responder for new project agents.":"Use Codex as the default responder for new project agents."}),a.jsxs("div",{className:"text-[10px] mt-2 leading-[1.5]",style:r.styles.mutedText,children:["Runtime: ",d?.label??u," · ",d?.readinessDetail??"Not reported yet."]})]}),a.jsx("span",{className:"text-[9px] font-mono px-1.5 py-0.5 rounded shrink-0",style:f?r.styles.activePill:r.styles.tagBadge,children:f?"selected":"available"})]})},u)})})]}):i.activeOnboardingStep.id==="confirm"?a.jsxs("div",{className:"mt-4 space-y-4",children:[a.jsxs("div",{className:"rounded-lg border px-3 py-3",style:{borderColor:b.border,backgroundColor:b.surface},children:[a.jsx("div",{className:"text-[12px] font-medium",style:r.styles.inkText,children:"Confirm this context"}),a.jsx("div",{className:"text-[10px] mt-1 leading-[1.5]",style:r.styles.mutedText,children:"Review your scan folders and context root before continuing."}),a.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-3 mt-3",children:[["Source roots",(o.workspaceRoots??[]).join(", ")||"None yet"],["Default harness",o.defaultHarness??"Not set"],["Relay context root",o.onboardingContextRoot||"Not set"],["Operator",o.operatorName||o.operatorNameDefault]].map(([u,d])=>a.jsxs("div",{children:[a.jsx("div",{className:"text-[9px] font-mono uppercase tracking-widest mb-1",style:r.styles.mutedText,children:u}),a.jsx("div",{className:"text-[11px] leading-[1.45]",style:r.styles.inkText,children:d})]},u))})]}),a.jsxs("div",{className:"flex flex-wrap gap-2 items-center",children:[i.isAppSettingsEditing?null:a.jsx("button",{className:"os-toolbar-button flex items-center gap-1 text-[10px] font-medium px-2 py-1 rounded",style:{color:b.ink},onClick:i.handleStartAppSettingsEdit,disabled:i.appSettingsLoading||i.appSettingsSaving,children:"Edit Inputs"}),a.jsx("div",{className:"text-[10px] leading-[1.5]",style:r.styles.mutedText,children:i.appSettingsDirty?"Next confirms and saves these choices locally.":"Everything here is already saved locally."})]})]}):i.activeOnboardingStep.id==="setup"?a.jsxs("div",{className:"mt-4 space-y-4",children:[a.jsxs("div",{className:"rounded-lg border px-3 py-3",style:{borderColor:b.border,backgroundColor:b.surface},children:[a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx(Co,{size:14,style:{color:b.accent}}),a.jsx("div",{className:"text-[12px] font-medium",style:r.styles.inkText,children:"Create the local project manifest"})]}),a.jsx("div",{className:"text-[10px] mt-2 leading-[1.5]",style:r.styles.mutedText,children:"Initialize the project manifest at your context root."}),a.jsx("div",{className:"text-[11px] font-mono mt-3 break-all",style:r.styles.inkText,children:i.buildOnboardingCommandLine("setup")}),a.jsxs("div",{className:"text-[10px] mt-2 leading-[1.5]",style:r.styles.mutedText,children:["Project config path:"," ",i.renderLocalPathValue(o.currentProjectConfigPath??(o.onboardingContextRoot?`${o.onboardingContextRoot}/.openscout/project.json`:"Not created yet."),{className:"text-left underline underline-offset-2 decoration-dotted hover:opacity-80 transition-opacity",style:r.styles.mutedText})]})]}),a.jsx("button",{className:"os-toolbar-button flex items-center gap-1 text-[10px] font-medium px-2 py-1 rounded disabled:opacity-50",style:{color:b.ink},onClick:()=>{i.handleRunOnboardingCommand("setup")},disabled:!!i.onboardingCommandPending||i.appSettingsLoading||i.appSettingsDirty,children:i.onboardingCommandPending==="setup"?"Running Setup…":"Run Setup"})]}):i.activeOnboardingStep.id==="doctor"?a.jsxs("div",{className:"mt-4 space-y-4",children:[a.jsxs("div",{className:"rounded-lg border px-3 py-3",style:{borderColor:b.border,backgroundColor:b.surface},children:[a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx(P1,{size:14,style:{color:b.accent}}),a.jsx("div",{className:"text-[12px] font-medium",style:r.styles.inkText,children:"Review the current inventory"})]}),a.jsx("div",{className:"text-[10px] mt-2 leading-[1.5]",style:r.styles.mutedText,children:"Check broker connectivity, source roots, and discovered projects."}),a.jsxs("div",{className:"grid grid-cols-2 gap-3 mt-3",children:[a.jsxs("div",{children:[a.jsx("div",{className:"text-[9px] font-mono uppercase tracking-widest mb-1",style:r.styles.mutedText,children:"Projects"}),a.jsx("div",{className:"text-[12px] font-medium",style:r.styles.inkText,children:o.projectInventory.length})]}),a.jsxs("div",{children:[a.jsx("div",{className:"text-[9px] font-mono uppercase tracking-widest mb-1",style:r.styles.mutedText,children:"Broker"}),a.jsx("div",{className:"text-[12px] font-medium",style:r.styles.inkText,children:o.broker.reachable?"Reachable":"Unavailable"})]})]}),a.jsx("div",{className:"text-[11px] font-mono mt-3 break-all",style:r.styles.inkText,children:"scout doctor"})]}),a.jsx("button",{className:"os-toolbar-button flex items-center gap-1 text-[10px] font-medium px-2 py-1 rounded disabled:opacity-50",style:{color:b.ink},onClick:()=>{i.handleRunOnboardingCommand("doctor")},disabled:!!i.onboardingCommandPending||i.appSettingsLoading||!i.onboardingHasProjectConfig,children:i.onboardingCommandPending==="doctor"?"Running Doctor…":"Run Doctor"})]}):a.jsxs("div",{className:"mt-4 space-y-4",children:[a.jsxs("div",{className:"rounded-lg border px-3 py-3",style:{borderColor:b.border,backgroundColor:b.surface},children:[a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx(yo,{size:14,style:{color:b.accent}}),a.jsx("div",{className:"text-[12px] font-medium",style:r.styles.inkText,children:"Check runtime readiness"})]}),a.jsx("div",{className:"text-[10px] mt-2 leading-[1.5]",style:r.styles.mutedText,children:"Verify each harness runtime is installed and ready."}),a.jsx("div",{className:"grid grid-cols-1 gap-2 mt-3",children:(o.runtimeCatalog??[]).map(u=>a.jsx("div",{className:"rounded-lg border px-3 py-2.5",style:{borderColor:b.border,backgroundColor:b.bg},children:a.jsxs("div",{className:"flex items-start justify-between gap-3",children:[a.jsxs("div",{className:"min-w-0",children:[a.jsx("div",{className:"text-[11px] font-medium",style:r.styles.inkText,children:u.label}),a.jsx("div",{className:"text-[10px] mt-1 leading-[1.4]",style:r.styles.mutedText,children:u.readinessDetail})]}),a.jsx("span",{className:"text-[9px] font-mono px-1.5 py-0.5 rounded shrink-0",style:u.readinessState==="ready"?r.styles.activePill:r.styles.tagBadge,children:u.readinessState})]})},u.name))}),a.jsxs("div",{className:"text-[10px] mt-3 leading-[1.5]",style:r.styles.mutedText,children:["Default harness: ",o.defaultHarness,". ",i.onboardingRuntimeMatch?`${i.onboardingRuntimeMatch.label} currently reports ${i.onboardingRuntimeMatch.readinessState}.`:"No matching runtime is reported yet."]}),a.jsx("div",{className:"text-[11px] font-mono mt-3 break-all",style:r.styles.inkText,children:"scout runtimes"})]}),a.jsx("button",{className:"os-toolbar-button flex items-center gap-1 text-[10px] font-medium px-2 py-1 rounded disabled:opacity-50",style:{color:b.ink},onClick:()=>{i.handleRunOnboardingCommand("runtimes")},disabled:!!i.onboardingCommandPending||i.appSettingsLoading,children:i.onboardingCommandPending==="runtimes"?"Running Runtimes…":"Run Runtimes"})]}),a.jsxs("div",{className:"flex items-center justify-between gap-3 mt-5 pt-4 border-t",style:{borderColor:b.border},children:[a.jsx("button",{className:"os-toolbar-button flex items-center gap-1 text-[10px] font-medium px-2 py-1 rounded disabled:opacity-50",style:{color:b.ink},onClick:()=>i.moveOnboardingWizard(-1),disabled:!i.canGoToPreviousOnboardingStep,children:"Back"}),a.jsxs("button",{className:"os-toolbar-button flex items-center gap-1 text-[10px] font-medium px-2 py-1 rounded disabled:opacity-50",style:{color:b.ink},onClick:i.handleOnboardingContinue,disabled:!i.canGoToNextOnboardingStep||i.appSettingsSaving||i.appSettingsLoading,children:[i.activeOnboardingStep.id==="confirm"?i.appSettingsSaving?"Confirming…":"Confirm":"Next",i.activeOnboardingStep.id==="confirm"?null:a.jsx(_l,{size:12})]})]})]})]}),a.jsxs("div",{className:"rounded-lg border px-3 py-3 mt-4",style:{borderColor:b.border,backgroundColor:b.bg},children:[a.jsx("div",{className:"text-[9px] font-mono uppercase tracking-widest mb-2",style:r.styles.mutedText,children:"CLI Equivalent"}),a.jsx("div",{className:"space-y-1",children:o.onboarding.commands.map(u=>a.jsx("div",{className:"text-[11px] font-mono break-all",style:r.styles.inkText,children:u},u))}),a.jsx("div",{className:"text-[10px] mt-3 leading-[1.5]",style:r.styles.mutedText,children:"Each wizard step runs the corresponding CLI command above."})]}),i.appSettingsFeedback?a.jsx("div",{className:"text-[11px] mt-3 leading-[1.5]",style:r.styles.inkText,children:i.appSettingsFeedback}):null,i.onboardingCommandResult?a.jsxs("div",{className:"rounded-lg border px-3 py-3 mt-4",style:{borderColor:b.border,backgroundColor:b.bg},children:[a.jsxs("div",{className:"flex items-start justify-between gap-3",children:[a.jsxs("div",{className:"min-w-0",children:[a.jsx("div",{className:"text-[9px] font-mono uppercase tracking-widest mb-1",style:r.styles.mutedText,children:"Last Command"}),a.jsx("div",{className:"text-[11px] font-mono break-all",style:r.styles.inkText,children:i.onboardingCommandResult.commandLine}),a.jsxs("div",{className:"text-[10px] mt-1",style:r.styles.mutedText,children:["cwd:"," ",i.renderLocalPathValue(i.onboardingCommandResult.cwd,{className:"text-left underline underline-offset-2 decoration-dotted hover:opacity-80 transition-opacity",style:r.styles.mutedText})]})]}),a.jsxs("span",{className:"text-[9px] font-mono px-1.5 py-0.5 rounded shrink-0",style:i.onboardingCommandResult.exitCode===0?r.styles.activePill:r.styles.tagBadge,children:["exit ",i.onboardingCommandResult.exitCode]})]}),a.jsx("pre",{className:"mt-3 text-[10px] leading-[1.45] whitespace-pre-wrap break-words overflow-x-auto",style:{color:b.ink},children:i.onboardingCommandResult.output})]}):null]}):null,i.appSettingsLoading&&!o?a.jsx("div",{className:"text-[11px]",style:r.styles.mutedText,children:"Loading settings…"}):a.jsxs("div",{className:"space-y-5",children:[a.jsxs("section",{className:"border rounded-lg overflow-hidden",style:{...r.styles.surface,borderColor:b.border},children:[a.jsx("div",{className:"p-4 border-b",style:{borderColor:b.border},children:a.jsxs("div",{className:"flex items-start justify-between gap-3",children:[a.jsxs("div",{children:[a.jsx("div",{className:"text-[10px] font-mono tracking-widest uppercase",style:{color:b.accent},children:"Scout CLI"}),a.jsx("div",{className:"text-[14px] font-medium mt-1",style:r.styles.inkText,children:"Use the same commands here and in Terminal"}),a.jsx("div",{className:"text-[11px] mt-1 leading-[1.6] max-w-2xl",style:r.styles.mutedText,children:"General is for local Scout setup. Workspace discovery lives in Workspace Explorer so this screen can stay fast."})]}),a.jsx("div",{className:"flex items-center gap-2 shrink-0",children:a.jsxs("button",{type:"button",className:"os-toolbar-button flex items-center gap-1 text-[10px] font-medium px-2 py-1 rounded-md",style:{color:b.ink},onClick:i.openKnowledgeBase,children:[a.jsx(A1,{size:12}),"Knowledge Base"]})})]})}),a.jsx("div",{className:"grid grid-cols-1 lg:grid-cols-3 gap-3 p-4",children:[{command:"setup",title:"scout setup",detail:"Create or refresh the local project manifest for this context."},{command:"doctor",title:"scout doctor",detail:"Check broker health, scan roots, and discovery readiness."},{command:"runtimes",title:"scout runtimes",detail:"Verify Claude and Codex runtimes are installed and ready."}].map(u=>a.jsxs("article",{className:"rounded-xl border px-4 py-4",style:{borderColor:b.border,backgroundColor:b.bg},children:[a.jsx("div",{className:"text-[11px] font-mono font-medium",style:{color:b.accent},children:u.title}),a.jsx("div",{className:"text-[11px] mt-2 leading-[1.6]",style:r.styles.mutedText,children:u.detail}),a.jsx("div",{className:"text-[10px] font-mono mt-3 break-all",style:r.styles.inkText,children:i.buildOnboardingCommandLine(u.command)}),a.jsxs("div",{className:"flex items-center gap-2 mt-4",children:[a.jsxs("button",{type:"button",className:"os-toolbar-button flex items-center gap-1 text-[10px] font-medium px-2 py-1 rounded-md disabled:opacity-50",style:{color:b.ink},onClick:()=>{i.handleRunOnboardingCommand(u.command)},disabled:!!i.onboardingCommandPending||i.appSettingsLoading||i.appSettingsSaving||u.command==="doctor"&&i.appSettingsDirty,children:[a.jsx(yo,{size:12}),"Run"]}),a.jsxs("button",{type:"button",className:"os-toolbar-button flex items-center gap-1 text-[10px] font-medium px-2 py-1 rounded-md",style:{color:b.ink},onClick:()=>{i.handleCopyOnboardingCommand(u.command)},children:[i.onboardingCopiedCommand===u.command?a.jsx(So,{size:12}):a.jsx(Or,{size:12}),"Copy"]})]})]},u.command))})]}),a.jsx("section",{className:"border rounded-lg overflow-hidden",style:{...r.styles.surface,borderColor:b.border},children:a.jsxs("div",{className:"divide-y",style:{borderColor:b.border},children:[a.jsxs("div",{className:"p-4 flex flex-col sm:flex-row sm:items-center gap-3",children:[a.jsxs("div",{className:"sm:w-1/3",children:[a.jsx("div",{className:"text-[12px] font-medium",style:r.styles.inkText,children:"Display Name"}),a.jsx("div",{className:"text-[10px] mt-0.5",style:r.styles.mutedText,children:"Used across Scout and Relay."})]}),a.jsx("div",{className:"sm:w-2/3",children:a.jsx("input",{ref:i.settingsOperatorNameRef,value:i.isAppSettingsEditing?o?.operatorName??"":o?.operatorName??o?.operatorNameDefault??"",onChange:u=>{i.setAppSettingsDraft(d=>d&&{...d,operatorName:u.target.value}),i.setAppSettingsFeedback(null)},readOnly:!i.isAppSettingsEditing||i.appSettingsSaving,placeholder:i.appSettings?.operatorNameDefault??"Operator",className:"w-full max-w-md rounded-md border px-2.5 py-1.5 text-[12px] leading-[1.5] bg-transparent outline-none",style:{borderColor:b.border,color:b.ink}})})]}),a.jsxs("div",{className:"p-4 flex flex-col sm:flex-row sm:items-start gap-3",children:[a.jsxs("div",{className:"sm:w-1/3",children:[a.jsx("div",{className:"text-[12px] font-medium",style:r.styles.inkText,children:"Default Harness"}),a.jsx("div",{className:"text-[10px] mt-0.5",style:r.styles.mutedText,children:"Fallback assistant family."})]}),a.jsx("div",{className:"sm:w-2/3",children:a.jsxs("div",{className:"flex flex-wrap items-center gap-1.5",children:[["claude","codex"].map(u=>{const d=o?.defaultHarness===u,f=(o?.runtimeCatalog??[]).find(p=>p.name===u);return a.jsxs("button",{type:"button",className:"rounded-md border px-3 py-1.5 text-[12px] font-medium capitalize transition-colors disabled:opacity-60 flex items-center gap-1.5",style:{borderColor:d?b.accentBorder:b.border,backgroundColor:d?b.accentBg:b.bg,color:d?b.accent:b.ink},disabled:!i.isAppSettingsEditing||i.appSettingsSaving,onClick:()=>{i.setAppSettingsDraft(p=>p&&{...p,defaultHarness:u}),i.setAppSettingsFeedback(null)},children:[u,f?a.jsx("span",{className:"text-[8px] font-mono uppercase tracking-wider px-1 py-px rounded-sm",style:f.readinessState==="ready"?r.styles.activePill:r.styles.tagBadge,children:f.readinessState}):null]},u)}),a.jsx("button",{type:"button",className:"rounded-md border border-dashed w-8 h-8 flex items-center justify-center text-[14px] transition-colors disabled:opacity-40",style:{borderColor:b.border,color:b.muted},disabled:!i.isAppSettingsEditing||i.appSettingsSaving,title:"Add runtime",children:"+"})]})})]}),a.jsxs("div",{className:"p-4 flex flex-col sm:flex-row sm:items-start gap-3",children:[a.jsxs("div",{className:"sm:w-1/3",children:[a.jsx("div",{className:"text-[12px] font-medium",style:r.styles.inkText,children:"Context Root"}),a.jsx("div",{className:"text-[10px] mt-0.5",style:r.styles.mutedText,children:"Where Scout stores workspace config."})]}),a.jsxs("div",{className:"sm:w-2/3",children:[a.jsxs("div",{className:"flex items-center gap-1.5 max-w-md mb-2",children:[a.jsx("input",{value:o?.onboardingContextRoot??"",onChange:u=>i.handleSetOnboardingContextRoot(u.target.value),readOnly:!i.isAppSettingsEditing||i.appSettingsSaving,className:"flex-1 rounded-md border px-2.5 py-1.5 text-[12px] leading-[1.5] bg-transparent outline-none font-mono",style:{borderColor:b.border,color:b.ink},placeholder:"Choose where .openscout should live"}),a.jsx("button",{type:"button",className:"os-toolbar-button text-[10px] font-medium px-2 py-1.5 rounded-md",style:{color:b.ink},onClick:i.handleBrowseForOnboardingContextRoot,disabled:!i.isAppSettingsEditing||i.appSettingsSaving,children:"Finder"})]}),a.jsxs("div",{className:"flex flex-col sm:flex-row sm:items-center gap-2 sm:gap-3",children:[a.jsxs("label",{className:"flex items-center gap-2 cursor-pointer",children:[a.jsx("input",{type:"checkbox",checked:o?.includeCurrentRepo??!0,disabled:!i.isAppSettingsEditing||i.appSettingsSaving,onChange:u=>{i.setAppSettingsDraft(d=>d&&{...d,includeCurrentRepo:u.target.checked}),i.setAppSettingsFeedback(null)}}),a.jsx("span",{className:"text-[10px]",style:r.styles.inkText,children:"Include root in discovery"})]}),o?.currentProjectConfigPath?a.jsxs(a.Fragment,{children:[a.jsx("div",{className:"hidden sm:block w-px h-3",style:{backgroundColor:b.border}}),a.jsx("span",{className:"text-[9px] font-mono truncate",style:r.styles.mutedText,title:o.currentProjectConfigPath,children:i.renderLocalPathValue(o.currentProjectConfigPath,{compact:!0,className:"text-left hover:opacity-80 transition-opacity",style:r.styles.mutedText})})]}):null]})]})]}),a.jsxs("div",{className:"p-4 flex flex-col sm:flex-row sm:items-start gap-3",children:[a.jsxs("div",{className:"sm:w-1/3",children:[a.jsx("div",{className:"text-[12px] font-medium",style:r.styles.inkText,children:"Scan Folders"}),a.jsx("div",{className:"text-[10px] mt-0.5",style:r.styles.mutedText,children:"Parent directories for repos."})]}),a.jsxs("div",{className:"sm:w-2/3",children:[a.jsxs("div",{className:"space-y-1.5",children:[(o?.workspaceRoots??[]).map((u,d)=>a.jsxs("div",{className:"flex items-center gap-1.5 max-w-md",children:[a.jsx("input",{value:u,onChange:f=>i.handleSetSourceRootAt(d,f.target.value),readOnly:!i.isAppSettingsEditing||i.appSettingsSaving,className:"flex-1 rounded-md border px-2.5 py-1.5 text-[12px] leading-[1.5] bg-transparent outline-none font-mono",style:{borderColor:b.border,color:b.ink},placeholder:d===0?"~/dev":"Add another path"}),a.jsx("button",{type:"button",className:"os-toolbar-button text-[10px] font-medium px-2 py-1.5 rounded-md",style:{color:b.ink},onClick:()=>i.handleBrowseForSourceRoot(d),disabled:!i.isAppSettingsEditing||i.appSettingsSaving,children:"Finder"}),a.jsx("button",{type:"button",className:"os-toolbar-button text-[12px] font-medium w-7 h-7 rounded-md disabled:opacity-50",style:{color:b.ink},onClick:()=>i.handleRemoveSourceRootRow(d),disabled:!i.isAppSettingsEditing||i.appSettingsSaving||(o?.workspaceRoots??[]).length<=1&&!u,"aria-label":`Remove project path ${d+1}`,children:"-"})]},`general-source-root-${d}`)),(o?.workspaceRoots?.length??0)===0?a.jsx("div",{className:"rounded-md border border-dashed px-2.5 py-2.5 text-[11px] leading-[1.5] max-w-md",style:{borderColor:b.border,color:b.muted},children:"No scan folders configured. Add one to discover projects."}):null]}),a.jsxs("div",{className:"flex flex-wrap items-center gap-1.5 mt-2",children:[a.jsxs("button",{type:"button",className:"os-toolbar-button flex items-center gap-1 text-[10px] font-medium px-2 py-1 rounded-md disabled:opacity-50",style:{color:b.ink},onClick:()=>{i.handleBeginGeneralEdit(),i.handleAddSourceRootRow()},disabled:i.appSettingsSaving,children:[a.jsx("span",{className:"text-[12px] leading-none",children:"+"}),"Add path"]}),a.jsx("span",{className:"text-[10px]",style:r.styles.mutedText,children:"or"}),i.sourceRootPathSuggestions.map(u=>a.jsx("button",{type:"button",className:"os-toolbar-button text-[10px] font-mono px-2 py-1 rounded-md disabled:opacity-50",style:{color:b.ink},onClick:()=>{i.handleBeginGeneralEdit(),i.handleAddSourceRootSuggestion(u)},disabled:i.appSettingsSaving,children:u},u))]})]})]})]})}),i.appSettingsFeedback?a.jsx("div",{className:"text-[11px] leading-[1.5]",style:r.styles.inkText,children:i.appSettingsFeedback}):null,i.onboardingCommandResult?.command==="doctor"?a.jsxs("div",{className:"space-y-2",children:[a.jsx("div",{className:"text-[9px] font-mono uppercase tracking-widest",style:r.styles.mutedText,children:"Doctor Output"}),i.renderOnboardingCommandShell("doctor",i.buildOnboardingCommandLine("doctor"),i.onboardingCommandPending==="doctor")]}):null]})]})}):r.settingsSection==="agents"?a.jsx(UA,{...r.agentSettingsViewProps}):r.settingsSection==="workspaces"?a.jsx(VA,{...r.workspaceExplorerViewProps}):r.settingsSection==="communication"?a.jsx(FA,{...r.communicationSettingsViewProps}):r.settingsSection==="database"?a.jsxs("div",{className:"space-y-4",children:[a.jsxs("section",{className:"border rounded-xl p-5",style:{...r.database.styles.surface,borderColor:b.border},children:[a.jsx("div",{className:"text-[10px] font-mono tracking-widest uppercase mb-3",style:{color:b.accent},children:"Session Index"}),a.jsx("div",{className:"grid grid-cols-3 gap-3",children:[["Sessions",`${r.database.stats.totalSessions}`],["Messages",`${r.database.stats.totalMessages}`],["Projects",`${r.database.stats.projects}`],["Tokens",`${Math.round(r.database.stats.totalTokens/1e3)}k`],["Runtime Messages",`${r.database.runtime?.messageCount??0}`],["tmux Sessions",`${r.database.runtime?.tmuxSessionCount??0}`]].map(([u,d])=>a.jsxs("div",{className:"rounded-lg border px-3 py-2.5",style:{borderColor:b.border,backgroundColor:b.bg},children:[a.jsx("div",{className:"text-[9px] font-mono uppercase tracking-widest mb-1",style:r.database.styles.mutedText,children:u}),a.jsx("div",{className:"text-[16px] font-semibold",style:r.database.styles.inkText,children:d})]},u))})]}),a.jsxs("section",{className:"border rounded-xl p-5",style:{...r.database.styles.surface,borderColor:b.border},children:[a.jsx("div",{className:"text-[10px] font-mono tracking-widest uppercase mb-3",style:{color:b.accent},children:"Storage"}),a.jsxs("div",{className:"space-y-3",children:[r.database.visibleAppSettings?.controlPlaneSqlitePath?a.jsxs("div",{className:"flex items-center justify-between gap-3",children:[a.jsxs("div",{className:"min-w-0",children:[a.jsx("div",{className:"text-[12px] font-medium",style:r.database.styles.inkText,children:"Control plane database"}),a.jsx("div",{className:"text-[11px] font-mono mt-1 truncate",style:r.database.styles.mutedText,children:r.database.renderLocalPathValue(r.database.visibleAppSettings.controlPlaneSqlitePath,{className:"text-left underline underline-offset-2 decoration-dotted hover:opacity-80 transition-opacity truncate",style:r.database.styles.mutedText})})]}),a.jsx("button",{type:"button",className:"os-toolbar-button text-[11px] font-medium px-3 py-1.5 rounded-lg border shrink-0",style:{color:b.ink,borderColor:b.border},onClick:()=>r.database.onRevealPath(r.database.visibleAppSettings.controlPlaneSqlitePath),children:"Reveal in Finder"})]}):null,r.database.visibleAppSettings?.settingsPath?a.jsxs("div",{className:"flex items-center justify-between gap-3",children:[a.jsxs("div",{className:"min-w-0",children:[a.jsx("div",{className:"text-[12px] font-medium",style:r.database.styles.inkText,children:"Settings"}),a.jsx("div",{className:"text-[11px] font-mono mt-1 truncate",style:r.database.styles.mutedText,children:r.database.renderLocalPathValue(r.database.visibleAppSettings.settingsPath,{className:"text-left underline underline-offset-2 decoration-dotted hover:opacity-80 transition-opacity truncate",style:r.database.styles.mutedText})})]}),a.jsx("button",{type:"button",className:"os-toolbar-button text-[11px] font-medium px-3 py-1.5 rounded-lg border shrink-0",style:{color:b.ink,borderColor:b.border},onClick:()=>r.database.onRevealPath(r.database.visibleAppSettings.settingsPath),children:"Reveal in Finder"})]}):null,r.database.visibleAppSettings?.supportDirectory?a.jsxs("div",{className:"flex items-center justify-between gap-3",children:[a.jsxs("div",{className:"min-w-0",children:[a.jsx("div",{className:"text-[12px] font-medium",style:r.database.styles.inkText,children:"Support directory"}),a.jsx("div",{className:"text-[11px] font-mono mt-1 truncate",style:r.database.styles.mutedText,children:r.database.renderLocalPathValue(r.database.visibleAppSettings.supportDirectory,{className:"text-left underline underline-offset-2 decoration-dotted hover:opacity-80 transition-opacity truncate",style:r.database.styles.mutedText})})]}),a.jsx("button",{type:"button",className:"os-toolbar-button text-[11px] font-medium px-3 py-1.5 rounded-lg border shrink-0",style:{color:b.ink,borderColor:b.border},onClick:()=>r.database.onRevealPath(r.database.visibleAppSettings.supportDirectory),children:"Reveal in Finder"})]}):null]})]})]}):a.jsxs("div",{className:"grid grid-cols-[minmax(0,1.05fr)_minmax(320px,0.85fr)] gap-4",children:[a.jsxs("section",{className:"border rounded-xl p-5",style:{...r.appearance.styles.surface,borderColor:b.border},children:[a.jsx("div",{className:"text-[10px] font-mono tracking-widest uppercase mb-3",style:{color:b.accent},children:"Color Mode"}),a.jsx("div",{className:"flex gap-3 mb-5",children:[{id:"light",label:"Light"},{id:"dark",label:"Dark"}].map(u=>{const d=u.id===(r.appearance.dark?"dark":"light");return a.jsxs("button",{onClick:()=>r.appearance.setDark(u.id==="dark"),className:"flex-1 border rounded-xl px-4 py-4 text-left",style:{borderColor:d?b.accent:b.border,backgroundColor:d?b.bg:b.surface},children:[a.jsxs("div",{className:"flex items-center gap-2 mb-1",style:{color:d?b.accent:b.muted},children:[u.id==="dark"?a.jsx(D1,{size:15}):a.jsx(U1,{size:15}),a.jsx("span",{className:"text-[12px] font-medium",style:d?{color:b.accent}:r.appearance.styles.inkText,children:u.label})]}),a.jsx("div",{className:"text-[11px] leading-[1.5]",style:r.appearance.styles.mutedText,children:u.id==="dark"?"Deep shell contrast for low-light work.":"Warm neutral shell with higher paper-like contrast."})]},u.id)})}),a.jsx("div",{className:"border rounded-xl px-4 py-4",style:{borderColor:b.border,backgroundColor:b.bg},children:a.jsxs("div",{className:"flex items-center justify-between gap-3",children:[a.jsxs("div",{children:[a.jsx("div",{className:"text-[10px] font-mono tracking-widest uppercase mb-1",style:{color:b.accent},children:"Annotations"}),a.jsx("div",{className:"text-[12px] leading-[1.6]",style:r.appearance.styles.mutedText,children:"Show routing and provenance tags in timelines."})]}),a.jsx("button",{onClick:()=>r.appearance.setShowAnnotations(u=>!u),className:"os-toolbar-button text-[11px] font-medium px-2 py-1 rounded",style:{color:b.ink},children:r.appearance.showAnnotations?"Hide annotations":"Show annotations"})]})})]}),a.jsxs("div",{className:"space-y-4 min-w-0",children:[a.jsxs("section",{className:"border rounded-xl p-5",style:{...r.appearance.styles.surface,borderColor:b.border},children:[a.jsx("div",{className:"text-[10px] font-mono tracking-widest uppercase mb-3",style:{color:b.accent},children:"Current Surface"}),a.jsx("div",{className:"grid grid-cols-2 gap-x-4 gap-y-3",children:[["Mode",r.appearance.dark?"Dark":"Light"],["Annotations",r.appearance.showAnnotations?"Visible":"Hidden"],["Sidebar",r.appearance.isCollapsed?"Collapsed":"Expanded"],["Section",r.appearance.activeSettingsLabel]].map(([u,d])=>a.jsxs("div",{children:[a.jsx("div",{className:"text-[9px] font-mono uppercase tracking-widest mb-1",style:r.appearance.styles.mutedText,children:u}),a.jsx("div",{className:"text-[12px]",style:r.appearance.styles.inkText,children:d})]},u))})]}),a.jsxs("section",{className:"border rounded-xl p-5",style:{...r.appearance.styles.surface,borderColor:b.border},children:[a.jsx("div",{className:"text-[10px] font-mono tracking-widest uppercase mb-3",style:{color:b.accent},children:"Coming Soon"}),a.jsx("div",{className:"text-[12px] leading-[1.6]",style:r.appearance.styles.mutedText,children:"Theme, density, and typography controls."})]})]})]})]})})]})}function QA({command:e,commandLine:l,running:r,commandResult:i,visibleAppSettings:o,onboardingCopiedCommand:u,onboardingCommandPending:d,onboardingContextRoot:f,onCopyOnboardingCommand:p,onRunOnboardingCommand:h}){const y=i&&i.exitCode===0,g=i&&i.exitCode!==0;return a.jsxs("div",{className:"space-y-2",children:[y&&(()=>{const v=o?.projectInventory?.length??0,k=o?.broker?.reachable,S=(o?.runtimeCatalog??[]).filter(R=>R.readinessState==="ready").length,A=(o?.runtimeCatalog??[]).length,N=[];return(e==="setup"||e==="doctor")&&(N.push(k?"Broker running":"Broker installed"),v>0&&N.push(`${v} project${v===1?"":"s"} discovered`)),e==="runtimes"&&A>0&&N.push(`${S} of ${A} runtime${A===1?"":"s"} ready`),a.jsxs("div",{className:"rounded-xl border px-4 py-3",style:{backgroundColor:"rgba(34,197,94,0.08)",borderColor:"rgba(34,197,94,0.25)"},children:[a.jsxs("div",{className:"flex items-center gap-2 mb-1.5",children:[a.jsx(Mu,{size:14,style:{color:"#16a34a"}}),a.jsx("span",{className:"text-[12px] font-semibold",style:{color:"#16a34a"},children:"Done"})]}),N.length>0?a.jsx("div",{className:"flex flex-wrap gap-x-4 gap-y-1",children:N.map(R=>a.jsx("span",{className:"text-[11px]",style:{color:"#16a34a",opacity:.85},children:R},R))}):null]})})(),g?a.jsx("div",{className:"rounded-xl border overflow-hidden",style:{backgroundColor:"rgba(239,68,68,0.06)",borderColor:"rgba(239,68,68,0.25)"},children:a.jsxs("div",{className:"flex items-start gap-3 px-4 py-3",children:[a.jsx(Rp,{size:15,className:"shrink-0 mt-0.5",style:{color:"#dc2626"}}),a.jsxs("div",{className:"flex-1 min-w-0",children:[a.jsxs("div",{className:"text-[12px] font-semibold",style:{color:"#dc2626"},children:["Command failed (exit ",i.exitCode,")"]}),a.jsx("div",{className:"text-[11px] mt-1 leading-[1.5]",style:{color:"#dc2626",opacity:.8},children:"Check the output below for details, then try again or run the command in Terminal for more context."})]}),a.jsx("button",{type:"button",className:"shrink-0 text-[11px] font-medium px-3 py-1.5 rounded-lg border transition-opacity hover:opacity-80",style:{borderColor:"rgba(239,68,68,0.35)",color:"#dc2626",backgroundColor:"rgba(239,68,68,0.08)"},onClick:()=>{h(e)},disabled:!!d,children:"Try again"})]})}):null,a.jsxs("div",{className:"rounded-xl border overflow-hidden",style:{borderColor:"rgba(15, 23, 42, 0.12)",backgroundColor:b.termBg},children:[a.jsxs("div",{className:"flex items-center justify-between gap-3 px-3.5 py-2 border-b",style:{borderBottomColor:"rgba(255,255,255,0.06)",backgroundColor:"rgba(255,255,255,0.03)"},children:[a.jsxs("div",{className:"flex items-center gap-2.5 min-w-0",children:[a.jsxs("div",{className:"flex items-center gap-[5px]",children:[a.jsx("span",{className:"w-[7px] h-[7px] rounded-full bg-[#ff5f57]"}),a.jsx("span",{className:"w-[7px] h-[7px] rounded-full bg-[#febc2e]"}),a.jsx("span",{className:"w-[7px] h-[7px] rounded-full bg-[#28c840]"})]}),a.jsx("div",{className:"text-[10px] font-mono uppercase tracking-[0.18em]",style:{color:"rgba(255,255,255,0.38)"},children:"Terminal"})]}),a.jsxs("div",{className:"flex items-center gap-2 shrink-0",children:[r?a.jsx("span",{className:"text-[10px] font-mono px-2 py-1 rounded animate-pulse",style:{backgroundColor:"rgba(45,212,191,0.18)",color:"#99f6e4"},children:"Running…"}):null,a.jsxs("button",{type:"button",className:"inline-flex items-center gap-1 rounded-md border px-2.5 py-1.5 text-[11px] font-medium transition-opacity hover:opacity-85",style:{borderColor:"rgba(255,255,255,0.12)",color:"rgba(255,255,255,0.82)",backgroundColor:"rgba(255,255,255,0.04)"},onClick:()=>{p(e)},children:[u===e?a.jsx(Mu,{size:12}):a.jsx(Or,{size:12}),u===e?"Copied":"Copy"]})]})]}),a.jsx("div",{className:"px-4 py-3",children:a.jsxs("div",{className:"text-[13px] leading-[1.7] font-mono break-all",style:{color:b.termFg},children:[a.jsx("span",{style:{color:"rgba(153,246,228,0.80)"},children:"$"})," ",l]})}),r||i?a.jsxs("div",{className:"border-t px-4 py-3",style:{borderTopColor:"rgba(255,255,255,0.06)",backgroundColor:"rgba(0,0,0,0.08)"},children:[a.jsxs("div",{className:"text-[10px] font-mono mb-2",style:{color:"rgba(255,255,255,0.35)"},children:["cwd: ",i?.cwd??(f||"…")]}),a.jsx("pre",{className:"text-[11px] leading-[1.6] whitespace-pre-wrap break-words overflow-x-auto font-mono",style:{color:g?"rgba(252,165,165,0.85)":b.termFg,maxHeight:"16rem",overflowY:"auto"},children:r?"… waiting for output":i?.output})]}):a.jsx("div",{className:"px-4 py-4 border-t",style:{borderTopColor:"rgba(255,255,255,0.06)"},children:a.jsx("div",{className:"text-[11px] font-mono",style:{color:"rgba(255,255,255,0.35)"},children:"Output will appear here after you run the command."})})]})]})}function XA({activeOnboardingStep:e,visibleAppSettings:l,appSettingsSaving:r,appSettingsLoading:i,appSettingsDirty:o,onboardingCommandPending:u,onboardingHasProjectConfig:d,sourceRootPathSuggestions:f,settingsOperatorNameRef:p,setAppSettingsDraft:h,setAppSettingsFeedback:y,setIsAppSettingsEditing:g,handleAddSourceRootRow:v,handleSetSourceRootAt:k,handleBrowseForSourceRoot:S,handleRemoveSourceRootRow:A,handleSetOnboardingContextRoot:N,handleBrowseForOnboardingContextRoot:R,handleAddSourceRootSuggestion:L,handleRunOnboardingCommand:H,buildOnboardingCommandLine:X,renderOnboardingCommandShell:V,renderLocalPathValue:D,styles:I,availableHarnesses:F}){if(e.id==="welcome")return a.jsxs("div",{className:"space-y-8",children:[a.jsxs("div",{className:"space-y-3",children:[a.jsx("div",{className:"text-[32px] font-bold tracking-tight leading-[1.15]",style:I.inkText,children:"Welcome to Scout"}),a.jsx("div",{className:"text-[15px] leading-[1.7] max-w-2xl",style:I.mutedText,children:"What should we call you?"})]}),a.jsxs("div",{className:"rounded-xl border px-6 py-6",style:{borderColor:b.border,backgroundColor:b.surface},children:[a.jsx("div",{className:"text-[10px] font-mono uppercase tracking-widest mb-4",style:{color:b.accent},children:"Your name"}),a.jsx("input",{ref:p,value:l.operatorName??"",onChange:O=>{h(P=>P&&{...P,operatorName:O.target.value}),y(null),g(!0)},readOnly:r,placeholder:l.operatorNameDefault||"Operator",className:"w-full border-b-2 border-t-0 border-l-0 border-r-0 px-0 py-3 text-[24px] font-semibold leading-[1.3] bg-transparent outline-none transition-colors focus:border-[var(--os-accent)]",style:{borderBottomColor:b.border,color:b.ink}}),a.jsx("div",{className:"text-[12px] mt-4 leading-[1.6]",style:I.mutedText,children:"Prefilled from your machine."})]})]});if(e.id==="source-roots")return a.jsxs("div",{className:"space-y-6",children:[a.jsxs("div",{className:"space-y-3",children:[a.jsx("div",{className:"text-[28px] font-semibold tracking-tight",style:I.inkText,children:"Scan folders and context root"}),a.jsx("div",{className:"text-[15px] leading-[1.7] max-w-2xl",style:I.mutedText,children:"Choose the parent folders Scout should scan for repos, then choose the one directory where this Scout context should live."})]}),a.jsxs("div",{className:"rounded-xl border px-5 py-5",style:{borderColor:b.border,backgroundColor:b.surface},children:[a.jsxs("div",{className:"flex items-center justify-between gap-3 mb-3",children:[a.jsx("div",{className:"text-[11px] font-mono uppercase tracking-widest",style:I.mutedText,children:"Source Roots"}),a.jsxs("button",{type:"button",className:"os-toolbar-button inline-flex items-center gap-1 text-[12px] font-medium px-3 py-1.5 rounded-lg border disabled:opacity-50",style:{color:b.ink,borderColor:b.border},onClick:v,disabled:r,children:[a.jsx("span",{className:"text-[14px] leading-none",children:"+"}),"Add path"]})]}),a.jsx("div",{className:"text-[12px] mb-3 leading-[1.6]",style:I.mutedText,children:"These are scan inputs. Scout looks through the repos underneath them, but listing a folder here does not make it the place where Scout saves this context."}),a.jsxs("div",{className:"space-y-3",children:[(l.workspaceRoots??[]).map((O,P)=>a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx("input",{value:O,onChange:Q=>k(P,Q.target.value),readOnly:r,className:"flex-1 rounded-lg border px-4 py-3 text-[15px] font-mono leading-[1.5] bg-transparent outline-none transition-colors focus:border-[var(--os-accent)]",style:{borderColor:b.border,color:b.ink},placeholder:P===0?"~/dev":"Add another source root"}),a.jsx("button",{type:"button",className:"os-toolbar-button text-[12px] font-medium px-3 py-3 rounded-lg border disabled:opacity-50 shrink-0",style:{color:b.ink,borderColor:b.border},onClick:()=>S(P),disabled:r,children:"Finder"}),a.jsx("button",{type:"button",className:"os-toolbar-button text-[14px] font-medium w-10 h-10 rounded-lg border disabled:opacity-50 shrink-0",style:{color:b.ink,borderColor:b.border},onClick:()=>A(P),disabled:r||(l.workspaceRoots??[]).length<=1&&!O,"aria-label":`Remove source root ${P+1}`,children:"-"})]},`immersive-source-root-${P}`)),(l.workspaceRoots??[]).length===0?a.jsx("div",{className:"rounded-lg border border-dashed px-4 py-4 text-[12px] leading-[1.6]",style:{borderColor:b.border,color:b.muted},children:"No scan folders yet. Add a path above to tell Scout where to look for repos and projects."}):null]}),a.jsxs("div",{className:"mt-5 pt-5 border-t",style:{borderTopColor:b.border},children:[a.jsx("div",{className:"text-[11px] font-mono uppercase tracking-widest mb-3",style:I.mutedText,children:"Relay Context Root"}),a.jsxs("div",{className:"text-[12px] leading-[1.6] mb-3",style:I.mutedText,children:["This is different from the scan folders above. Scout will save this context here by writing ",a.jsx("code",{className:"font-mono text-[11px] px-1.5 py-0.5 rounded",style:{backgroundColor:b.bg},children:".openscout/project.json"})," inside this directory."]}),a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx("input",{value:l.onboardingContextRoot??"",onChange:O=>N(O.target.value),readOnly:r,className:"flex-1 rounded-lg border px-4 py-3 text-[15px] font-mono leading-[1.5] bg-transparent outline-none transition-colors focus:border-[var(--os-accent)]",style:{borderColor:b.border,color:b.ink},placeholder:"Choose where .openscout should live"}),a.jsx("button",{type:"button",className:"os-toolbar-button text-[12px] font-medium px-3 py-3 rounded-lg border disabled:opacity-50 shrink-0",style:{color:b.ink,borderColor:b.border},onClick:R,disabled:r,children:"Finder"})]})]}),a.jsxs("div",{className:"text-[12px] mt-3 leading-[1.6]",style:I.mutedText,children:["Usually something like ",a.jsx("code",{className:"font-mono text-[11px] px-1.5 py-0.5 rounded",style:{backgroundColor:b.bg},children:"~/dev"})," or ",a.jsx("code",{className:"font-mono text-[11px] px-1.5 py-0.5 rounded",style:{backgroundColor:b.bg},children:"~/src"}),"."]}),a.jsx("div",{className:"flex flex-wrap gap-2 mt-4",children:f.map(O=>a.jsx("button",{className:"os-toolbar-button text-[12px] font-mono font-medium px-3 py-1.5 rounded-lg border disabled:opacity-50",style:{color:b.ink,borderColor:b.border},onClick:()=>L(O),disabled:r,children:O},O))})]})]});if(e.id==="harness")return a.jsxs("div",{className:"space-y-6",children:[a.jsxs("div",{className:"space-y-3",children:[a.jsx("div",{className:"text-[28px] font-semibold tracking-tight",style:I.inkText,children:"Default harness"}),a.jsx("div",{className:"text-[15px] leading-[1.7] max-w-2xl",style:I.mutedText,children:"Which assistant should answer new project turns by default?"})]}),a.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:F.map(O=>{const P=(l.runtimeCatalog??[]).find(oe=>oe.name===O)??null,Q=l.defaultHarness===O;return a.jsx("button",{className:"os-card text-left rounded-xl border px-5 py-5 disabled:opacity-60",style:{borderColor:Q?b.accent:b.border,backgroundColor:Q?b.accentBg:b.surface,boxShadow:Q?`0 0 0 1px ${b.accent}`:"none"},disabled:r,onClick:()=>{h(oe=>oe&&{...oe,defaultHarness:O}),y(null)},children:a.jsxs("div",{className:"flex items-start justify-between gap-3",children:[a.jsxs("div",{className:"min-w-0",children:[a.jsx("div",{className:"text-[18px] font-semibold capitalize tracking-tight",style:I.inkText,children:O}),a.jsx("div",{className:"text-[13px] mt-2 leading-[1.6]",style:I.mutedText,children:O==="claude"?"Anthropic Claude Code — agentic coding via local CLI session.":"OpenAI Codex — agentic coding via cloud sandbox."}),a.jsxs("div",{className:"text-[12px] mt-4 leading-[1.6]",style:I.mutedText,children:["Runtime: ",P?.label??O," · ",P?.readinessDetail??"Not reported yet."]})]}),a.jsx("span",{className:"text-[10px] font-mono px-2.5 py-1 rounded-full shrink-0",style:Q?I.activePill:I.tagBadge,children:Q?"selected":"available"})]})},O)})})]});if(e.id==="confirm")return a.jsxs("div",{className:"space-y-6",children:[a.jsxs("div",{className:"space-y-3",children:[a.jsx("div",{className:"text-[28px] font-semibold tracking-tight",style:I.inkText,children:"Confirm this context"}),a.jsx("div",{className:"text-[15px] leading-[1.7] max-w-2xl",style:I.mutedText,children:"Review which folders Scout will scan and where it will save this context before continuing."})]}),a.jsx("div",{className:"rounded-xl border px-5 py-5",style:{borderColor:b.border,backgroundColor:b.surface},children:a.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-5",children:[["Operator",l.operatorName||l.operatorNameDefault],["Source roots",(l.workspaceRoots??[]).join(", ")||"None yet"],["Default harness",l.defaultHarness??"Not set"],["Relay context root",l.onboardingContextRoot||"Not set"]].map(([O,P])=>a.jsxs("div",{className:"rounded-lg px-4 py-3",style:{backgroundColor:b.bg},children:[a.jsx("div",{className:"text-[10px] font-mono uppercase tracking-widest mb-2",style:{color:b.accent},children:O}),a.jsx("div",{className:"text-[15px] font-medium leading-[1.5]",style:I.inkText,children:O==="Relay context root"?D(String(P),{className:"text-left underline underline-offset-2 decoration-dotted hover:opacity-80 transition-opacity"}):P})]},O))})}),o?a.jsx("div",{className:"text-[12px] leading-[1.6]",style:I.mutedText,children:"Unsaved changes."}):null]});if(e.id==="setup"){const O=X("setup"),P=u==="setup",Q=l.currentProjectConfigPath??(l.onboardingContextRoot?`${l.onboardingContextRoot}/.openscout/project.json`:"Not created yet.");return a.jsxs("div",{className:"space-y-6",children:[a.jsxs("div",{className:"space-y-3",children:[a.jsx("div",{className:"text-[28px] font-semibold tracking-tight",style:I.inkText,children:"Setup"}),a.jsx("div",{className:"text-[15px] leading-[1.7] max-w-2xl",style:I.mutedText,children:"Create the local project manifest."})]}),V("setup",O,P),a.jsxs("div",{className:"rounded-xl border px-5 py-5",style:{borderColor:b.border,backgroundColor:b.surface},children:[a.jsx("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-4",children:[["1. Context root",l.onboardingContextRoot||"Not set"],["2. Manifest","Writes `.openscout/project.json` at that root to anchor this context."],["3. Discovery","Uses that context plus scanned folders to build inventory and routing."]].map(([oe,W])=>a.jsxs("div",{className:"rounded-lg border px-4 py-4",style:{borderColor:b.border,backgroundColor:b.bg},children:[a.jsx("div",{className:"text-[11px] font-mono font-medium tracking-wide",style:{color:b.accent},children:oe}),a.jsx("div",{className:"text-[12px] mt-2 leading-[1.6]",style:I.mutedText,children:W})]},oe))}),a.jsx("div",{className:"text-[12px] font-mono mt-5 leading-[1.6] break-all",style:I.mutedText,children:typeof Q=="string"?D(Q,{className:"text-left underline underline-offset-2 decoration-dotted hover:opacity-80 transition-opacity",style:I.mutedText}):Q})]}),a.jsx("button",{className:"os-btn-primary flex items-center gap-2 text-[13px] font-semibold px-5 py-2.5 rounded-lg disabled:opacity-40 transition-all",style:{backgroundColor:b.accent,color:"#fff"},onClick:()=>{H("setup")},disabled:!!u||i||o,children:P?"Running Setup…":"Run Setup"})]})}if(e.id==="doctor"){const O=X("doctor"),P=u==="doctor",Q=l.broker.reachable,oe=l.projectInventory.length,W=[{label:"Broker",value:Q?"Reachable":"Unavailable",ok:Q,fix:Q?null:"Re-run setup to install and start the broker service."},{label:"Projects",value:`${oe} found`,ok:oe>0,fix:oe===0?"Add workspace roots in Settings → General, then refresh Workspaces.":null},{label:"Context root",value:l.currentProjectConfigPath?"Configured":"Missing",ok:!!l.currentProjectConfigPath,fix:l.currentProjectConfigPath?null:"Run setup again from the previous step."}],J=W.some(w=>!w.ok);return a.jsxs("div",{className:"space-y-5",children:[a.jsxs("div",{className:"space-y-1.5",children:[a.jsx("div",{className:"text-[28px] font-semibold tracking-tight",style:I.inkText,children:"Doctor"}),a.jsx("div",{className:"text-[14px] leading-[1.6]",style:I.mutedText,children:"Verify broker health, project discovery, and relay context."})]}),a.jsx("div",{className:"grid grid-cols-3 gap-3",children:W.map(w=>a.jsxs("div",{className:"rounded-xl border px-4 py-3",style:{borderColor:w.ok?"rgba(34,197,94,0.25)":"rgba(239,68,68,0.25)",backgroundColor:w.ok?"rgba(34,197,94,0.05)":"rgba(239,68,68,0.05)"},children:[a.jsxs("div",{className:"flex items-center gap-1.5 mb-1.5",children:[a.jsx("span",{style:{color:w.ok?"#16a34a":"#dc2626",fontSize:13},children:w.ok?"✓":"✗"}),a.jsx("div",{className:"text-[10px] font-mono uppercase tracking-widest",style:{color:w.ok?"#16a34a":"#dc2626"},children:w.label})]}),a.jsx("div",{className:"text-[13px] font-medium",style:I.inkText,children:w.value}),w.fix?a.jsx("div",{className:"text-[11px] mt-1.5 leading-[1.5]",style:{color:"#dc2626",opacity:.8},children:w.fix}):null]},w.label))}),V("doctor",O,P),a.jsx("button",{className:"os-btn-primary flex items-center gap-2 text-[13px] font-semibold px-5 py-2.5 rounded-lg disabled:opacity-40 transition-all",style:{backgroundColor:J?"#dc2626":b.accent,color:"#fff"},onClick:()=>{H("doctor")},disabled:!!u||i||!d,children:P?"Running Doctor…":J?"Run Doctor to diagnose":"Run Doctor"})]})}const ne=X("runtimes");return a.jsxs("div",{className:"space-y-6",children:[a.jsxs("div",{className:"space-y-1.5",children:[a.jsx("div",{className:"text-[28px] font-semibold tracking-tight",style:I.inkText,children:"Runtimes"}),a.jsx("div",{className:"text-[14px] leading-[1.6]",style:I.mutedText,children:"Verify each harness has a working local runtime."})]}),(l.runtimeCatalog??[]).length>0?a.jsx("div",{className:"grid grid-cols-1 gap-2",children:(l.runtimeCatalog??[]).map(O=>{const P=O.readinessState==="ready";return a.jsxs("div",{className:"rounded-xl border px-4 py-3 flex items-start justify-between gap-3",style:{borderColor:P?"rgba(34,197,94,0.25)":"rgba(239,68,68,0.25)",backgroundColor:P?"rgba(34,197,94,0.05)":"rgba(239,68,68,0.05)"},children:[a.jsxs("div",{className:"flex items-start gap-3 min-w-0",children:[a.jsx("span",{className:"mt-0.5 text-[14px]",style:{color:P?"#16a34a":"#dc2626"},children:P?"✓":"✗"}),a.jsxs("div",{className:"min-w-0",children:[a.jsx("div",{className:"text-[13px] font-semibold",style:I.inkText,children:O.label}),a.jsx("div",{className:"text-[11px] mt-0.5 leading-[1.5]",style:P?I.mutedText:{color:"#dc2626",opacity:.85},children:O.readinessDetail}),!P&&O.readinessState==="missing"?a.jsx("div",{className:"text-[10px] font-mono mt-1.5 px-2 py-1 rounded inline-block",style:{backgroundColor:"rgba(239,68,68,0.08)",color:"#dc2626"},children:O.name==="claude"?"brew install claude":O.name==="codex"?"npm install -g @openai/codex":`install ${O.name}`}):null,!P&&O.readinessState==="configured"?a.jsx("div",{className:"text-[10px] font-mono mt-1.5 px-2 py-1 rounded inline-block",style:{backgroundColor:"rgba(239,68,68,0.08)",color:"#dc2626"},children:O.name==="claude"?"claude login":O.name==="codex"?"codex login":`${O.name} login`}):null]})]}),a.jsx("span",{className:"text-[10px] font-mono px-2.5 py-1 rounded-full shrink-0",style:P?I.activePill:{backgroundColor:"rgba(239,68,68,0.12)",color:"#dc2626"},children:O.readinessState})]},O.name)})}):null,V("runtimes",ne,u==="runtimes"),a.jsx("button",{className:"os-btn-primary flex items-center gap-2 text-[13px] font-semibold px-5 py-2.5 rounded-lg disabled:opacity-40 transition-all",style:{backgroundColor:b.accent,color:"#fff"},onClick:()=>{H("runtimes")},disabled:!!u||i,children:u==="runtimes"?"Running Runtimes…":"Run Runtimes"})]})}function KA(e,l){const r={};return(e[e.length-1]===""?[...e,""]:e).join((r.padRight?" ":"")+","+(r.padLeft===!1?"":" ")).trim()}const ZA=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,WA=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,JA={};function gy(e,l){return(JA.jsx?WA:ZA).test(e)}const e3=/[ \t\n\f\r]/g;function t3(e){return typeof e=="object"?e.type==="text"?by(e.value):!1:by(e)}function by(e){return e.replace(e3,"")===""}class Do{constructor(l,r,i){this.normal=r,this.property=l,i&&(this.space=i)}}Do.prototype.normal={};Do.prototype.property={};Do.prototype.space=void 0;function N0(e,l){const r={},i={};for(const o of e)Object.assign(r,o.property),Object.assign(i,o.normal);return new Do(r,i,l)}function dp(e){return e.toLowerCase()}class Jn{constructor(l,r){this.attribute=r,this.property=l}}Jn.prototype.attribute="";Jn.prototype.booleanish=!1;Jn.prototype.boolean=!1;Jn.prototype.commaOrSpaceSeparated=!1;Jn.prototype.commaSeparated=!1;Jn.prototype.defined=!1;Jn.prototype.mustUseProperty=!1;Jn.prototype.number=!1;Jn.prototype.overloadedBoolean=!1;Jn.prototype.property="";Jn.prototype.spaceSeparated=!1;Jn.prototype.space=void 0;let n3=0;const ft=si(),sn=si(),fp=si(),je=si(),Ut=si(),ls=si(),pl=si();function si(){return 2**++n3}const mp=Object.freeze(Object.defineProperty({__proto__:null,boolean:ft,booleanish:sn,commaOrSpaceSeparated:pl,commaSeparated:ls,number:je,overloadedBoolean:fp,spaceSeparated:Ut},Symbol.toStringTag,{value:"Module"})),Om=Object.keys(mp);class Xp extends Jn{constructor(l,r,i,o){let u=-1;if(super(l,r),yy(this,"space",o),typeof i=="number")for(;++u<Om.length;){const d=Om[u];yy(this,Om[u],(i&mp[d])===mp[d])}}}Xp.prototype.defined=!0;function yy(e,l,r){r&&(e[l]=r)}function os(e){const l={},r={};for(const[i,o]of Object.entries(e.properties)){const u=new Xp(i,e.transform(e.attributes||{},i),o,e.space);e.mustUseProperty&&e.mustUseProperty.includes(i)&&(u.mustUseProperty=!0),l[i]=u,r[dp(i)]=i,r[dp(u.attribute)]=i}return new Do(l,r,e.space)}const w0=os({properties:{ariaActiveDescendant:null,ariaAtomic:sn,ariaAutoComplete:null,ariaBusy:sn,ariaChecked:sn,ariaColCount:je,ariaColIndex:je,ariaColSpan:je,ariaControls:Ut,ariaCurrent:null,ariaDescribedBy:Ut,ariaDetails:null,ariaDisabled:sn,ariaDropEffect:Ut,ariaErrorMessage:null,ariaExpanded:sn,ariaFlowTo:Ut,ariaGrabbed:sn,ariaHasPopup:null,ariaHidden:sn,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:Ut,ariaLevel:je,ariaLive:null,ariaModal:sn,ariaMultiLine:sn,ariaMultiSelectable:sn,ariaOrientation:null,ariaOwns:Ut,ariaPlaceholder:null,ariaPosInSet:je,ariaPressed:sn,ariaReadOnly:sn,ariaRelevant:null,ariaRequired:sn,ariaRoleDescription:Ut,ariaRowCount:je,ariaRowIndex:je,ariaRowSpan:je,ariaSelected:sn,ariaSetSize:je,ariaSort:null,ariaValueMax:je,ariaValueMin:je,ariaValueNow:je,ariaValueText:null,role:null},transform(e,l){return l==="role"?l:"aria-"+l.slice(4).toLowerCase()}});function S0(e,l){return l in e?e[l]:l}function C0(e,l){return S0(e,l.toLowerCase())}const l3=os({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:ls,acceptCharset:Ut,accessKey:Ut,action:null,allow:null,allowFullScreen:ft,allowPaymentRequest:ft,allowUserMedia:ft,alt:null,as:null,async:ft,autoCapitalize:null,autoComplete:Ut,autoFocus:ft,autoPlay:ft,blocking:Ut,capture:null,charSet:null,checked:ft,cite:null,className:Ut,cols:je,colSpan:null,content:null,contentEditable:sn,controls:ft,controlsList:Ut,coords:je|ls,crossOrigin:null,data:null,dateTime:null,decoding:null,default:ft,defer:ft,dir:null,dirName:null,disabled:ft,download:fp,draggable:sn,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:ft,formTarget:null,headers:Ut,height:je,hidden:fp,high:je,href:null,hrefLang:null,htmlFor:Ut,httpEquiv:Ut,id:null,imageSizes:null,imageSrcSet:null,inert:ft,inputMode:null,integrity:null,is:null,isMap:ft,itemId:null,itemProp:Ut,itemRef:Ut,itemScope:ft,itemType:Ut,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:ft,low:je,manifest:null,max:null,maxLength:je,media:null,method:null,min:null,minLength:je,multiple:ft,muted:ft,name:null,nonce:null,noModule:ft,noValidate:ft,onAbort:null,onAfterPrint:null,onAuxClick:null,onBeforeMatch:null,onBeforePrint:null,onBeforeToggle:null,onBeforeUnload:null,onBlur:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onContextLost:null,onContextMenu:null,onContextRestored:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnded:null,onError:null,onFocus:null,onFormData:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLanguageChange:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadEnd:null,onLoadStart:null,onMessage:null,onMessageError:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRejectionHandled:null,onReset:null,onResize:null,onScroll:null,onScrollEnd:null,onSecurityPolicyViolation:null,onSeeked:null,onSeeking:null,onSelect:null,onSlotChange:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnhandledRejection:null,onUnload:null,onVolumeChange:null,onWaiting:null,onWheel:null,open:ft,optimum:je,pattern:null,ping:Ut,placeholder:null,playsInline:ft,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:ft,referrerPolicy:null,rel:Ut,required:ft,reversed:ft,rows:je,rowSpan:je,sandbox:Ut,scope:null,scoped:ft,seamless:ft,selected:ft,shadowRootClonable:ft,shadowRootDelegatesFocus:ft,shadowRootMode:null,shape:null,size:je,sizes:null,slot:null,span:je,spellCheck:sn,src:null,srcDoc:null,srcLang:null,srcSet:null,start:je,step:null,style:null,tabIndex:je,target:null,title:null,translate:null,type:null,typeMustMatch:ft,useMap:null,value:sn,width:je,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:Ut,axis:null,background:null,bgColor:null,border:je,borderColor:null,bottomMargin:je,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:ft,declare:ft,event:null,face:null,frame:null,frameBorder:null,hSpace:je,leftMargin:je,link:null,longDesc:null,lowSrc:null,marginHeight:je,marginWidth:je,noResize:ft,noHref:ft,noShade:ft,noWrap:ft,object:null,profile:null,prompt:null,rev:null,rightMargin:je,rules:null,scheme:null,scrolling:sn,standby:null,summary:null,text:null,topMargin:je,valueType:null,version:null,vAlign:null,vLink:null,vSpace:je,allowTransparency:null,autoCorrect:null,autoSave:null,disablePictureInPicture:ft,disableRemotePlayback:ft,prefix:null,property:null,results:je,security:null,unselectable:null},space:"html",transform:C0}),r3=os({attributes:{accentHeight:"accent-height",alignmentBaseline:"alignment-baseline",arabicForm:"arabic-form",baselineShift:"baseline-shift",capHeight:"cap-height",className:"class",clipPath:"clip-path",clipRule:"clip-rule",colorInterpolation:"color-interpolation",colorInterpolationFilters:"color-interpolation-filters",colorProfile:"color-profile",colorRendering:"color-rendering",crossOrigin:"crossorigin",dataType:"datatype",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",hrefLang:"hreflang",horizAdvX:"horiz-adv-x",horizOriginX:"horiz-origin-x",horizOriginY:"horiz-origin-y",imageRendering:"image-rendering",letterSpacing:"letter-spacing",lightingColor:"lighting-color",markerEnd:"marker-end",markerMid:"marker-mid",markerStart:"marker-start",navDown:"nav-down",navDownLeft:"nav-down-left",navDownRight:"nav-down-right",navLeft:"nav-left",navNext:"nav-next",navPrev:"nav-prev",navRight:"nav-right",navUp:"nav-up",navUpLeft:"nav-up-left",navUpRight:"nav-up-right",onAbort:"onabort",onActivate:"onactivate",onAfterPrint:"onafterprint",onBeforePrint:"onbeforeprint",onBegin:"onbegin",onCancel:"oncancel",onCanPlay:"oncanplay",onCanPlayThrough:"oncanplaythrough",onChange:"onchange",onClick:"onclick",onClose:"onclose",onCopy:"oncopy",onCueChange:"oncuechange",onCut:"oncut",onDblClick:"ondblclick",onDrag:"ondrag",onDragEnd:"ondragend",onDragEnter:"ondragenter",onDragExit:"ondragexit",onDragLeave:"ondragleave",onDragOver:"ondragover",onDragStart:"ondragstart",onDrop:"ondrop",onDurationChange:"ondurationchange",onEmptied:"onemptied",onEnd:"onend",onEnded:"onended",onError:"onerror",onFocus:"onfocus",onFocusIn:"onfocusin",onFocusOut:"onfocusout",onHashChange:"onhashchange",onInput:"oninput",onInvalid:"oninvalid",onKeyDown:"onkeydown",onKeyPress:"onkeypress",onKeyUp:"onkeyup",onLoad:"onload",onLoadedData:"onloadeddata",onLoadedMetadata:"onloadedmetadata",onLoadStart:"onloadstart",onMessage:"onmessage",onMouseDown:"onmousedown",onMouseEnter:"onmouseenter",onMouseLeave:"onmouseleave",onMouseMove:"onmousemove",onMouseOut:"onmouseout",onMouseOver:"onmouseover",onMouseUp:"onmouseup",onMouseWheel:"onmousewheel",onOffline:"onoffline",onOnline:"ononline",onPageHide:"onpagehide",onPageShow:"onpageshow",onPaste:"onpaste",onPause:"onpause",onPlay:"onplay",onPlaying:"onplaying",onPopState:"onpopstate",onProgress:"onprogress",onRateChange:"onratechange",onRepeat:"onrepeat",onReset:"onreset",onResize:"onresize",onScroll:"onscroll",onSeeked:"onseeked",onSeeking:"onseeking",onSelect:"onselect",onShow:"onshow",onStalled:"onstalled",onStorage:"onstorage",onSubmit:"onsubmit",onSuspend:"onsuspend",onTimeUpdate:"ontimeupdate",onToggle:"ontoggle",onUnload:"onunload",onVolumeChange:"onvolumechange",onWaiting:"onwaiting",onZoom:"onzoom",overlinePosition:"overline-position",overlineThickness:"overline-thickness",paintOrder:"paint-order",panose1:"panose-1",pointerEvents:"pointer-events",referrerPolicy:"referrerpolicy",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",tabIndex:"tabindex",textAnchor:"text-anchor",textDecoration:"text-decoration",textRendering:"text-rendering",transformOrigin:"transform-origin",typeOf:"typeof",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",xHeight:"x-height",playbackOrder:"playbackorder",timelineBegin:"timelinebegin"},properties:{about:pl,accentHeight:je,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:je,amplitude:je,arabicForm:null,ascent:je,attributeName:null,attributeType:null,azimuth:je,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:je,by:null,calcMode:null,capHeight:je,className:Ut,clip:null,clipPath:null,clipPathUnits:null,clipRule:null,color:null,colorInterpolation:null,colorInterpolationFilters:null,colorProfile:null,colorRendering:null,content:null,contentScriptType:null,contentStyleType:null,crossOrigin:null,cursor:null,cx:null,cy:null,d:null,dataType:null,defaultAction:null,descent:je,diffuseConstant:je,direction:null,display:null,dur:null,divisor:je,dominantBaseline:null,download:ft,dx:null,dy:null,edgeMode:null,editable:null,elevation:je,enableBackground:null,end:null,event:null,exponent:je,externalResourcesRequired:null,fill:null,fillOpacity:je,fillRule:null,filter:null,filterRes:null,filterUnits:null,floodColor:null,floodOpacity:null,focusable:null,focusHighlight:null,fontFamily:null,fontSize:null,fontSizeAdjust:null,fontStretch:null,fontStyle:null,fontVariant:null,fontWeight:null,format:null,fr:null,from:null,fx:null,fy:null,g1:ls,g2:ls,glyphName:ls,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:je,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:je,horizOriginX:je,horizOriginY:je,id:null,ideographic:je,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:je,k:je,k1:je,k2:je,k3:je,k4:je,kernelMatrix:pl,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:je,local:null,markerEnd:null,markerMid:null,markerStart:null,markerHeight:null,markerUnits:null,markerWidth:null,mask:null,maskContentUnits:null,maskUnits:null,mathematical:null,max:null,media:null,mediaCharacterEncoding:null,mediaContentEncodings:null,mediaSize:je,mediaTime:null,method:null,min:null,mode:null,name:null,navDown:null,navDownLeft:null,navDownRight:null,navLeft:null,navNext:null,navPrev:null,navRight:null,navUp:null,navUpLeft:null,navUpRight:null,numOctaves:null,observer:null,offset:null,onAbort:null,onActivate:null,onAfterPrint:null,onBeforePrint:null,onBegin:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnd:null,onEnded:null,onError:null,onFocus:null,onFocusIn:null,onFocusOut:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadStart:null,onMessage:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onMouseWheel:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRepeat:null,onReset:null,onResize:null,onScroll:null,onSeeked:null,onSeeking:null,onSelect:null,onShow:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnload:null,onVolumeChange:null,onWaiting:null,onZoom:null,opacity:null,operator:null,order:null,orient:null,orientation:null,origin:null,overflow:null,overlay:null,overlinePosition:je,overlineThickness:je,paintOrder:null,panose1:null,path:null,pathLength:je,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:Ut,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:je,pointsAtY:je,pointsAtZ:je,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:pl,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:pl,rev:pl,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:pl,requiredFeatures:pl,requiredFonts:pl,requiredFormats:pl,resource:null,restart:null,result:null,rotate:null,rx:null,ry:null,scale:null,seed:null,shapeRendering:null,side:null,slope:null,snapshotTime:null,specularConstant:je,specularExponent:je,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:je,strikethroughThickness:je,string:null,stroke:null,strokeDashArray:pl,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:je,strokeOpacity:je,strokeWidth:null,style:null,surfaceScale:je,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:pl,tabIndex:je,tableValues:null,target:null,targetX:je,targetY:je,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:pl,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:je,underlineThickness:je,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:je,values:null,vAlphabetic:je,vMathematical:je,vectorEffect:null,vHanging:je,vIdeographic:je,version:null,vertAdvY:je,vertOriginX:je,vertOriginY:je,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:je,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:S0}),T0=os({properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null},space:"xlink",transform(e,l){return"xlink:"+l.slice(5).toLowerCase()}}),A0=os({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:C0}),E0=os({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(e,l){return"xml:"+l.slice(3).toLowerCase()}}),a3={classId:"classID",dataType:"datatype",itemId:"itemID",strokeDashArray:"strokeDasharray",strokeDashOffset:"strokeDashoffset",strokeLineCap:"strokeLinecap",strokeLineJoin:"strokeLinejoin",strokeMiterLimit:"strokeMiterlimit",typeOf:"typeof",xLinkActuate:"xlinkActuate",xLinkArcRole:"xlinkArcrole",xLinkHref:"xlinkHref",xLinkRole:"xlinkRole",xLinkShow:"xlinkShow",xLinkTitle:"xlinkTitle",xLinkType:"xlinkType",xmlnsXLink:"xmlnsXlink"},i3=/[A-Z]/g,vy=/-[a-z]/g,s3=/^data[-\w.:]+$/i;function o3(e,l){const r=dp(l);let i=l,o=Jn;if(r in e.normal)return e.property[e.normal[r]];if(r.length>4&&r.slice(0,4)==="data"&&s3.test(l)){if(l.charAt(4)==="-"){const u=l.slice(5).replace(vy,u3);i="data"+u.charAt(0).toUpperCase()+u.slice(1)}else{const u=l.slice(4);if(!vy.test(u)){let d=u.replace(i3,c3);d.charAt(0)!=="-"&&(d="-"+d),l="data"+d}}o=Xp}return new o(i,l)}function c3(e){return"-"+e.toLowerCase()}function u3(e){return e.charAt(1).toUpperCase()}const d3=N0([w0,l3,T0,A0,E0],"html"),Kp=N0([w0,r3,T0,A0,E0],"svg");function f3(e){return e.join(" ").trim()}var Ki={},Lm,jy;function m3(){if(jy)return Lm;jy=1;var e=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,l=/\n/g,r=/^\s*/,i=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,o=/^:\s*/,u=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,d=/^[;\s]*/,f=/^\s+|\s+$/g,p=`
63
+ `,h="/",y="*",g="",v="comment",k="declaration";function S(N,R){if(typeof N!="string")throw new TypeError("First argument must be a string");if(!N)return[];R=R||{};var L=1,H=1;function X(W){var J=W.match(l);J&&(L+=J.length);var w=W.lastIndexOf(p);H=~w?W.length-w:H+W.length}function V(){var W={line:L,column:H};return function(J){return J.position=new D(W),ne(),J}}function D(W){this.start=W,this.end={line:L,column:H},this.source=R.source}D.prototype.content=N;function I(W){var J=new Error(R.source+":"+L+":"+H+": "+W);if(J.reason=W,J.filename=R.source,J.line=L,J.column=H,J.source=N,!R.silent)throw J}function F(W){var J=W.exec(N);if(J){var w=J[0];return X(w),N=N.slice(w.length),J}}function ne(){F(r)}function O(W){var J;for(W=W||[];J=P();)J!==!1&&W.push(J);return W}function P(){var W=V();if(!(h!=N.charAt(0)||y!=N.charAt(1))){for(var J=2;g!=N.charAt(J)&&(y!=N.charAt(J)||h!=N.charAt(J+1));)++J;if(J+=2,g===N.charAt(J-1))return I("End of comment missing");var w=N.slice(2,J-2);return H+=2,X(w),N=N.slice(J),H+=2,W({type:v,comment:w})}}function Q(){var W=V(),J=F(i);if(J){if(P(),!F(o))return I("property missing ':'");var w=F(u),Y=W({type:k,property:A(J[0].replace(e,g)),value:w?A(w[0].replace(e,g)):g});return F(d),Y}}function oe(){var W=[];O(W);for(var J;J=Q();)J!==!1&&(W.push(J),O(W));return W}return ne(),oe()}function A(N){return N?N.replace(f,g):g}return Lm=S,Lm}var ky;function p3(){if(ky)return Ki;ky=1;var e=Ki&&Ki.__importDefault||function(i){return i&&i.__esModule?i:{default:i}};Object.defineProperty(Ki,"__esModule",{value:!0}),Ki.default=r;const l=e(m3());function r(i,o){let u=null;if(!i||typeof i!="string")return u;const d=(0,l.default)(i),f=typeof o=="function";return d.forEach(p=>{if(p.type!=="declaration")return;const{property:h,value:y}=p;f?o(h,y,p):y&&(u=u||{},u[h]=y)}),u}return Ki}var po={},Ny;function h3(){if(Ny)return po;Ny=1,Object.defineProperty(po,"__esModule",{value:!0}),po.camelCase=void 0;var e=/^--[a-zA-Z0-9_-]+$/,l=/-([a-z])/g,r=/^[^-]+$/,i=/^-(webkit|moz|ms|o|khtml)-/,o=/^-(ms)-/,u=function(h){return!h||r.test(h)||e.test(h)},d=function(h,y){return y.toUpperCase()},f=function(h,y){return"".concat(y,"-")},p=function(h,y){return y===void 0&&(y={}),u(h)?h:(h=h.toLowerCase(),y.reactCompat?h=h.replace(o,f):h=h.replace(i,f),h.replace(l,d))};return po.camelCase=p,po}var ho,wy;function x3(){if(wy)return ho;wy=1;var e=ho&&ho.__importDefault||function(o){return o&&o.__esModule?o:{default:o}},l=e(p3()),r=h3();function i(o,u){var d={};return!o||typeof o!="string"||(0,l.default)(o,function(f,p){f&&p&&(d[(0,r.camelCase)(f,u)]=p)}),d}return i.default=i,ho=i,ho}var g3=x3();const b3=Uu(g3),R0=M0("end"),Zp=M0("start");function M0(e){return l;function l(r){const i=r&&r.position&&r.position[e]||{};if(typeof i.line=="number"&&i.line>0&&typeof i.column=="number"&&i.column>0)return{line:i.line,column:i.column,offset:typeof i.offset=="number"&&i.offset>-1?i.offset:void 0}}}function y3(e){const l=Zp(e),r=R0(e);if(l&&r)return{start:l,end:r}}function vo(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?Sy(e.position):"start"in e||"end"in e?Sy(e):"line"in e||"column"in e?pp(e):""}function pp(e){return Cy(e&&e.line)+":"+Cy(e&&e.column)}function Sy(e){return pp(e&&e.start)+"-"+pp(e&&e.end)}function Cy(e){return e&&typeof e=="number"?e:1}class On extends Error{constructor(l,r,i){super(),typeof r=="string"&&(i=r,r=void 0);let o="",u={},d=!1;if(r&&("line"in r&&"column"in r?u={place:r}:"start"in r&&"end"in r?u={place:r}:"type"in r?u={ancestors:[r],place:r.position}:u={...r}),typeof l=="string"?o=l:!u.cause&&l&&(d=!0,o=l.message,u.cause=l),!u.ruleId&&!u.source&&typeof i=="string"){const p=i.indexOf(":");p===-1?u.ruleId=i:(u.source=i.slice(0,p),u.ruleId=i.slice(p+1))}if(!u.place&&u.ancestors&&u.ancestors){const p=u.ancestors[u.ancestors.length-1];p&&(u.place=p.position)}const f=u.place&&"start"in u.place?u.place.start:u.place;this.ancestors=u.ancestors||void 0,this.cause=u.cause||void 0,this.column=f?f.column:void 0,this.fatal=void 0,this.file="",this.message=o,this.line=f?f.line:void 0,this.name=vo(u.place)||"1:1",this.place=u.place||void 0,this.reason=this.message,this.ruleId=u.ruleId||void 0,this.source=u.source||void 0,this.stack=d&&u.cause&&typeof u.cause.stack=="string"?u.cause.stack:"",this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}}On.prototype.file="";On.prototype.name="";On.prototype.reason="";On.prototype.message="";On.prototype.stack="";On.prototype.column=void 0;On.prototype.line=void 0;On.prototype.ancestors=void 0;On.prototype.cause=void 0;On.prototype.fatal=void 0;On.prototype.place=void 0;On.prototype.ruleId=void 0;On.prototype.source=void 0;const Wp={}.hasOwnProperty,v3=new Map,j3=/[A-Z]/g,k3=new Set(["table","tbody","thead","tfoot","tr"]),N3=new Set(["td","th"]),z0="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function w3(e,l){if(!l||l.Fragment===void 0)throw new TypeError("Expected `Fragment` in options");const r=l.filePath||void 0;let i;if(l.development){if(typeof l.jsxDEV!="function")throw new TypeError("Expected `jsxDEV` in options when `development: true`");i=z3(r,l.jsxDEV)}else{if(typeof l.jsx!="function")throw new TypeError("Expected `jsx` in production options");if(typeof l.jsxs!="function")throw new TypeError("Expected `jsxs` in production options");i=M3(r,l.jsx,l.jsxs)}const o={Fragment:l.Fragment,ancestors:[],components:l.components||{},create:i,elementAttributeNameCase:l.elementAttributeNameCase||"react",evaluater:l.createEvaluater?l.createEvaluater():void 0,filePath:r,ignoreInvalidStyle:l.ignoreInvalidStyle||!1,passKeys:l.passKeys!==!1,passNode:l.passNode||!1,schema:l.space==="svg"?Kp:d3,stylePropertyNameCase:l.stylePropertyNameCase||"dom",tableCellAlignToStyle:l.tableCellAlignToStyle!==!1},u=O0(o,e,void 0);return u&&typeof u!="string"?u:o.create(e,o.Fragment,{children:u||void 0},void 0)}function O0(e,l,r){if(l.type==="element")return S3(e,l,r);if(l.type==="mdxFlowExpression"||l.type==="mdxTextExpression")return C3(e,l);if(l.type==="mdxJsxFlowElement"||l.type==="mdxJsxTextElement")return A3(e,l,r);if(l.type==="mdxjsEsm")return T3(e,l);if(l.type==="root")return E3(e,l,r);if(l.type==="text")return R3(e,l)}function S3(e,l,r){const i=e.schema;let o=i;l.tagName.toLowerCase()==="svg"&&i.space==="html"&&(o=Kp,e.schema=o),e.ancestors.push(l);const u=D0(e,l.tagName,!1),d=O3(e,l);let f=eh(e,l);return k3.has(l.tagName)&&(f=f.filter(function(p){return typeof p=="string"?!t3(p):!0})),L0(e,d,u,l),Jp(d,f),e.ancestors.pop(),e.schema=i,e.create(l,u,d,r)}function C3(e,l){if(l.data&&l.data.estree&&e.evaluater){const i=l.data.estree.body[0];return i.type,e.evaluater.evaluateExpression(i.expression)}Mo(e,l.position)}function T3(e,l){if(l.data&&l.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(l.data.estree);Mo(e,l.position)}function A3(e,l,r){const i=e.schema;let o=i;l.name==="svg"&&i.space==="html"&&(o=Kp,e.schema=o),e.ancestors.push(l);const u=l.name===null?e.Fragment:D0(e,l.name,!0),d=L3(e,l),f=eh(e,l);return L0(e,d,u,l),Jp(d,f),e.ancestors.pop(),e.schema=i,e.create(l,u,d,r)}function E3(e,l,r){const i={};return Jp(i,eh(e,l)),e.create(l,e.Fragment,i,r)}function R3(e,l){return l.value}function L0(e,l,r,i){typeof r!="string"&&r!==e.Fragment&&e.passNode&&(l.node=i)}function Jp(e,l){if(l.length>0){const r=l.length>1?l:l[0];r&&(e.children=r)}}function M3(e,l,r){return i;function i(o,u,d,f){const h=Array.isArray(d.children)?r:l;return f?h(u,d,f):h(u,d)}}function z3(e,l){return r;function r(i,o,u,d){const f=Array.isArray(u.children),p=Zp(i);return l(o,u,d,f,{columnNumber:p?p.column-1:void 0,fileName:e,lineNumber:p?p.line:void 0},void 0)}}function O3(e,l){const r={};let i,o;for(o in l.properties)if(o!=="children"&&Wp.call(l.properties,o)){const u=D3(e,o,l.properties[o]);if(u){const[d,f]=u;e.tableCellAlignToStyle&&d==="align"&&typeof f=="string"&&N3.has(l.tagName)?i=f:r[d]=f}}if(i){const u=r.style||(r.style={});u[e.stylePropertyNameCase==="css"?"text-align":"textAlign"]=i}return r}function L3(e,l){const r={};for(const i of l.attributes)if(i.type==="mdxJsxExpressionAttribute")if(i.data&&i.data.estree&&e.evaluater){const u=i.data.estree.body[0];u.type;const d=u.expression;d.type;const f=d.properties[0];f.type,Object.assign(r,e.evaluater.evaluateExpression(f.argument))}else Mo(e,l.position);else{const o=i.name;let u;if(i.value&&typeof i.value=="object")if(i.value.data&&i.value.data.estree&&e.evaluater){const f=i.value.data.estree.body[0];f.type,u=e.evaluater.evaluateExpression(f.expression)}else Mo(e,l.position);else u=i.value===null?!0:i.value;r[o]=u}return r}function eh(e,l){const r=[];let i=-1;const o=e.passKeys?new Map:v3;for(;++i<l.children.length;){const u=l.children[i];let d;if(e.passKeys){const p=u.type==="element"?u.tagName:u.type==="mdxJsxFlowElement"||u.type==="mdxJsxTextElement"?u.name:void 0;if(p){const h=o.get(p)||0;d=p+"-"+h,o.set(p,h+1)}}const f=O0(e,u,d);f!==void 0&&r.push(f)}return r}function D3(e,l,r){const i=o3(e.schema,l);if(!(r==null||typeof r=="number"&&Number.isNaN(r))){if(Array.isArray(r)&&(r=i.commaSeparated?KA(r):f3(r)),i.property==="style"){let o=typeof r=="object"?r:_3(e,String(r));return e.stylePropertyNameCase==="css"&&(o=B3(o)),["style",o]}return[e.elementAttributeNameCase==="react"&&i.space?a3[i.property]||i.property:i.attribute,r]}}function _3(e,l){try{return b3(l,{reactCompat:!0})}catch(r){if(e.ignoreInvalidStyle)return{};const i=r,o=new On("Cannot parse `style` attribute",{ancestors:e.ancestors,cause:i,ruleId:"style",source:"hast-util-to-jsx-runtime"});throw o.file=e.filePath||void 0,o.url=z0+"#cannot-parse-style-attribute",o}}function D0(e,l,r){let i;if(!r)i={type:"Literal",value:l};else if(l.includes(".")){const o=l.split(".");let u=-1,d;for(;++u<o.length;){const f=gy(o[u])?{type:"Identifier",name:o[u]}:{type:"Literal",value:o[u]};d=d?{type:"MemberExpression",object:d,property:f,computed:!!(u&&f.type==="Literal"),optional:!1}:f}i=d}else i=gy(l)&&!/^[a-z]/.test(l)?{type:"Identifier",name:l}:{type:"Literal",value:l};if(i.type==="Literal"){const o=i.value;return Wp.call(e.components,o)?e.components[o]:o}if(e.evaluater)return e.evaluater.evaluateExpression(i);Mo(e)}function Mo(e,l){const r=new On("Cannot handle MDX estrees without `createEvaluater`",{ancestors:e.ancestors,place:l,ruleId:"mdx-estree",source:"hast-util-to-jsx-runtime"});throw r.file=e.filePath||void 0,r.url=z0+"#cannot-handle-mdx-estrees-without-createevaluater",r}function B3(e){const l={};let r;for(r in e)Wp.call(e,r)&&(l[I3(r)]=e[r]);return l}function I3(e){let l=e.replace(j3,P3);return l.slice(0,3)==="ms-"&&(l="-"+l),l}function P3(e){return"-"+e.toLowerCase()}const Dm={action:["form"],cite:["blockquote","del","ins","q"],data:["object"],formAction:["button","input"],href:["a","area","base","link"],icon:["menuitem"],itemId:null,manifest:["html"],ping:["a","area"],poster:["video"],src:["audio","embed","iframe","img","input","script","source","track","video"]},U3={};function th(e,l){const r=U3,i=typeof r.includeImageAlt=="boolean"?r.includeImageAlt:!0,o=typeof r.includeHtml=="boolean"?r.includeHtml:!0;return _0(e,i,o)}function _0(e,l,r){if(H3(e)){if("value"in e)return e.type==="html"&&!r?"":e.value;if(l&&"alt"in e&&e.alt)return e.alt;if("children"in e)return Ty(e.children,l,r)}return Array.isArray(e)?Ty(e,l,r):""}function Ty(e,l,r){const i=[];let o=-1;for(;++o<e.length;)i[o]=_0(e[o],l,r);return i.join("")}function H3(e){return!!(e&&typeof e=="object")}const Ay=document.createElement("i");function nh(e){const l="&"+e+";";Ay.innerHTML=l;const r=Ay.textContent;return r.charCodeAt(r.length-1)===59&&e!=="semi"||r===l?!1:r}function xl(e,l,r,i){const o=e.length;let u=0,d;if(l<0?l=-l>o?0:o+l:l=l>o?o:l,r=r>0?r:0,i.length<1e4)d=Array.from(i),d.unshift(l,r),e.splice(...d);else for(r&&e.splice(l,r);u<i.length;)d=i.slice(u,u+1e4),d.unshift(l,0),e.splice(...d),u+=1e4,l+=1e4}function wl(e,l){return e.length>0?(xl(e,e.length,0,l),e):l}const Ey={}.hasOwnProperty;function B0(e){const l={};let r=-1;for(;++r<e.length;)F3(l,e[r]);return l}function F3(e,l){let r;for(r in l){const o=(Ey.call(e,r)?e[r]:void 0)||(e[r]={}),u=l[r];let d;if(u)for(d in u){Ey.call(o,d)||(o[d]=[]);const f=u[d];q3(o[d],Array.isArray(f)?f:f?[f]:[])}}}function q3(e,l){let r=-1;const i=[];for(;++r<l.length;)(l[r].add==="after"?e:i).push(l[r]);xl(e,0,0,i)}function I0(e,l){const r=Number.parseInt(e,l);return r<9||r===11||r>13&&r<32||r>126&&r<160||r>55295&&r<57344||r>64975&&r<65008||(r&65535)===65535||(r&65535)===65534||r>1114111?"�":String.fromCodePoint(r)}function Il(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const Pn=ya(/[A-Za-z]/),zn=ya(/[\dA-Za-z]/),V3=ya(/[#-'*+\--9=?A-Z^-~]/);function _u(e){return e!==null&&(e<32||e===127)}const hp=ya(/\d/),$3=ya(/[\dA-Fa-f]/),G3=ya(/[!-/:-@[-`{-~]/);function Xe(e){return e!==null&&e<-2}function It(e){return e!==null&&(e<0||e===32)}function yt(e){return e===-2||e===-1||e===32}const Gu=ya(new RegExp("\\p{P}|\\p{S}","u")),ri=ya(/\s/);function ya(e){return l;function l(r){return r!==null&&r>-1&&e.test(String.fromCharCode(r))}}function cs(e){const l=[];let r=-1,i=0,o=0;for(;++r<e.length;){const u=e.charCodeAt(r);let d="";if(u===37&&zn(e.charCodeAt(r+1))&&zn(e.charCodeAt(r+2)))o=2;else if(u<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(u))||(d=String.fromCharCode(u));else if(u>55295&&u<57344){const f=e.charCodeAt(r+1);u<56320&&f>56319&&f<57344?(d=String.fromCharCode(u,f),o=1):d="�"}else d=String.fromCharCode(u);d&&(l.push(e.slice(i,r),encodeURIComponent(d)),i=r+o+1,d=""),o&&(r+=o,o=0)}return l.join("")+e.slice(i)}function Nt(e,l,r,i){const o=i?i-1:Number.POSITIVE_INFINITY;let u=0;return d;function d(p){return yt(p)?(e.enter(r),f(p)):l(p)}function f(p){return yt(p)&&u++<o?(e.consume(p),f):(e.exit(r),l(p))}}const Y3={tokenize:Q3};function Q3(e){const l=e.attempt(this.parser.constructs.contentInitial,i,o);let r;return l;function i(f){if(f===null){e.consume(f);return}return e.enter("lineEnding"),e.consume(f),e.exit("lineEnding"),Nt(e,l,"linePrefix")}function o(f){return e.enter("paragraph"),u(f)}function u(f){const p=e.enter("chunkText",{contentType:"text",previous:r});return r&&(r.next=p),r=p,d(f)}function d(f){if(f===null){e.exit("chunkText"),e.exit("paragraph"),e.consume(f);return}return Xe(f)?(e.consume(f),e.exit("chunkText"),u):(e.consume(f),d)}}const X3={tokenize:K3},Ry={tokenize:Z3};function K3(e){const l=this,r=[];let i=0,o,u,d;return f;function f(H){if(i<r.length){const X=r[i];return l.containerState=X[1],e.attempt(X[0].continuation,p,h)(H)}return h(H)}function p(H){if(i++,l.containerState._closeFlow){l.containerState._closeFlow=void 0,o&&L();const X=l.events.length;let V=X,D;for(;V--;)if(l.events[V][0]==="exit"&&l.events[V][1].type==="chunkFlow"){D=l.events[V][1].end;break}R(i);let I=X;for(;I<l.events.length;)l.events[I][1].end={...D},I++;return xl(l.events,V+1,0,l.events.slice(X)),l.events.length=I,h(H)}return f(H)}function h(H){if(i===r.length){if(!o)return v(H);if(o.currentConstruct&&o.currentConstruct.concrete)return S(H);l.interrupt=!!(o.currentConstruct&&!o._gfmTableDynamicInterruptHack)}return l.containerState={},e.check(Ry,y,g)(H)}function y(H){return o&&L(),R(i),v(H)}function g(H){return l.parser.lazy[l.now().line]=i!==r.length,d=l.now().offset,S(H)}function v(H){return l.containerState={},e.attempt(Ry,k,S)(H)}function k(H){return i++,r.push([l.currentConstruct,l.containerState]),v(H)}function S(H){if(H===null){o&&L(),R(0),e.consume(H);return}return o=o||l.parser.flow(l.now()),e.enter("chunkFlow",{_tokenizer:o,contentType:"flow",previous:u}),A(H)}function A(H){if(H===null){N(e.exit("chunkFlow"),!0),R(0),e.consume(H);return}return Xe(H)?(e.consume(H),N(e.exit("chunkFlow")),i=0,l.interrupt=void 0,f):(e.consume(H),A)}function N(H,X){const V=l.sliceStream(H);if(X&&V.push(null),H.previous=u,u&&(u.next=H),u=H,o.defineSkip(H.start),o.write(V),l.parser.lazy[H.start.line]){let D=o.events.length;for(;D--;)if(o.events[D][1].start.offset<d&&(!o.events[D][1].end||o.events[D][1].end.offset>d))return;const I=l.events.length;let F=I,ne,O;for(;F--;)if(l.events[F][0]==="exit"&&l.events[F][1].type==="chunkFlow"){if(ne){O=l.events[F][1].end;break}ne=!0}for(R(i),D=I;D<l.events.length;)l.events[D][1].end={...O},D++;xl(l.events,F+1,0,l.events.slice(I)),l.events.length=D}}function R(H){let X=r.length;for(;X-- >H;){const V=r[X];l.containerState=V[1],V[0].exit.call(l,e)}r.length=H}function L(){o.write([null]),u=void 0,o=void 0,l.containerState._closeFlow=void 0}}function Z3(e,l,r){return Nt(e,e.attempt(this.parser.constructs.document,l,r),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function ss(e){if(e===null||It(e)||ri(e))return 1;if(Gu(e))return 2}function Yu(e,l,r){const i=[];let o=-1;for(;++o<e.length;){const u=e[o].resolveAll;u&&!i.includes(u)&&(l=u(l,r),i.push(u))}return l}const xp={name:"attention",resolveAll:W3,tokenize:J3};function W3(e,l){let r=-1,i,o,u,d,f,p,h,y;for(;++r<e.length;)if(e[r][0]==="enter"&&e[r][1].type==="attentionSequence"&&e[r][1]._close){for(i=r;i--;)if(e[i][0]==="exit"&&e[i][1].type==="attentionSequence"&&e[i][1]._open&&l.sliceSerialize(e[i][1]).charCodeAt(0)===l.sliceSerialize(e[r][1]).charCodeAt(0)){if((e[i][1]._close||e[r][1]._open)&&(e[r][1].end.offset-e[r][1].start.offset)%3&&!((e[i][1].end.offset-e[i][1].start.offset+e[r][1].end.offset-e[r][1].start.offset)%3))continue;p=e[i][1].end.offset-e[i][1].start.offset>1&&e[r][1].end.offset-e[r][1].start.offset>1?2:1;const g={...e[i][1].end},v={...e[r][1].start};My(g,-p),My(v,p),d={type:p>1?"strongSequence":"emphasisSequence",start:g,end:{...e[i][1].end}},f={type:p>1?"strongSequence":"emphasisSequence",start:{...e[r][1].start},end:v},u={type:p>1?"strongText":"emphasisText",start:{...e[i][1].end},end:{...e[r][1].start}},o={type:p>1?"strong":"emphasis",start:{...d.start},end:{...f.end}},e[i][1].end={...d.start},e[r][1].start={...f.end},h=[],e[i][1].end.offset-e[i][1].start.offset&&(h=wl(h,[["enter",e[i][1],l],["exit",e[i][1],l]])),h=wl(h,[["enter",o,l],["enter",d,l],["exit",d,l],["enter",u,l]]),h=wl(h,Yu(l.parser.constructs.insideSpan.null,e.slice(i+1,r),l)),h=wl(h,[["exit",u,l],["enter",f,l],["exit",f,l],["exit",o,l]]),e[r][1].end.offset-e[r][1].start.offset?(y=2,h=wl(h,[["enter",e[r][1],l],["exit",e[r][1],l]])):y=0,xl(e,i-1,r-i+3,h),r=i+h.length-y-2;break}}for(r=-1;++r<e.length;)e[r][1].type==="attentionSequence"&&(e[r][1].type="data");return e}function J3(e,l){const r=this.parser.constructs.attentionMarkers.null,i=this.previous,o=ss(i);let u;return d;function d(p){return u=p,e.enter("attentionSequence"),f(p)}function f(p){if(p===u)return e.consume(p),f;const h=e.exit("attentionSequence"),y=ss(p),g=!y||y===2&&o||r.includes(p),v=!o||o===2&&y||r.includes(i);return h._open=!!(u===42?g:g&&(o||!v)),h._close=!!(u===42?v:v&&(y||!g)),l(p)}}function My(e,l){e.column+=l,e.offset+=l,e._bufferIndex+=l}const e5={name:"autolink",tokenize:t5};function t5(e,l,r){let i=0;return o;function o(k){return e.enter("autolink"),e.enter("autolinkMarker"),e.consume(k),e.exit("autolinkMarker"),e.enter("autolinkProtocol"),u}function u(k){return Pn(k)?(e.consume(k),d):k===64?r(k):h(k)}function d(k){return k===43||k===45||k===46||zn(k)?(i=1,f(k)):h(k)}function f(k){return k===58?(e.consume(k),i=0,p):(k===43||k===45||k===46||zn(k))&&i++<32?(e.consume(k),f):(i=0,h(k))}function p(k){return k===62?(e.exit("autolinkProtocol"),e.enter("autolinkMarker"),e.consume(k),e.exit("autolinkMarker"),e.exit("autolink"),l):k===null||k===32||k===60||_u(k)?r(k):(e.consume(k),p)}function h(k){return k===64?(e.consume(k),y):V3(k)?(e.consume(k),h):r(k)}function y(k){return zn(k)?g(k):r(k)}function g(k){return k===46?(e.consume(k),i=0,y):k===62?(e.exit("autolinkProtocol").type="autolinkEmail",e.enter("autolinkMarker"),e.consume(k),e.exit("autolinkMarker"),e.exit("autolink"),l):v(k)}function v(k){if((k===45||zn(k))&&i++<63){const S=k===45?v:g;return e.consume(k),S}return r(k)}}const _o={partial:!0,tokenize:n5};function n5(e,l,r){return i;function i(u){return yt(u)?Nt(e,o,"linePrefix")(u):o(u)}function o(u){return u===null||Xe(u)?l(u):r(u)}}const P0={continuation:{tokenize:r5},exit:a5,name:"blockQuote",tokenize:l5};function l5(e,l,r){const i=this;return o;function o(d){if(d===62){const f=i.containerState;return f.open||(e.enter("blockQuote",{_container:!0}),f.open=!0),e.enter("blockQuotePrefix"),e.enter("blockQuoteMarker"),e.consume(d),e.exit("blockQuoteMarker"),u}return r(d)}function u(d){return yt(d)?(e.enter("blockQuotePrefixWhitespace"),e.consume(d),e.exit("blockQuotePrefixWhitespace"),e.exit("blockQuotePrefix"),l):(e.exit("blockQuotePrefix"),l(d))}}function r5(e,l,r){const i=this;return o;function o(d){return yt(d)?Nt(e,u,"linePrefix",i.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(d):u(d)}function u(d){return e.attempt(P0,l,r)(d)}}function a5(e){e.exit("blockQuote")}const U0={name:"characterEscape",tokenize:i5};function i5(e,l,r){return i;function i(u){return e.enter("characterEscape"),e.enter("escapeMarker"),e.consume(u),e.exit("escapeMarker"),o}function o(u){return G3(u)?(e.enter("characterEscapeValue"),e.consume(u),e.exit("characterEscapeValue"),e.exit("characterEscape"),l):r(u)}}const H0={name:"characterReference",tokenize:s5};function s5(e,l,r){const i=this;let o=0,u,d;return f;function f(g){return e.enter("characterReference"),e.enter("characterReferenceMarker"),e.consume(g),e.exit("characterReferenceMarker"),p}function p(g){return g===35?(e.enter("characterReferenceMarkerNumeric"),e.consume(g),e.exit("characterReferenceMarkerNumeric"),h):(e.enter("characterReferenceValue"),u=31,d=zn,y(g))}function h(g){return g===88||g===120?(e.enter("characterReferenceMarkerHexadecimal"),e.consume(g),e.exit("characterReferenceMarkerHexadecimal"),e.enter("characterReferenceValue"),u=6,d=$3,y):(e.enter("characterReferenceValue"),u=7,d=hp,y(g))}function y(g){if(g===59&&o){const v=e.exit("characterReferenceValue");return d===zn&&!nh(i.sliceSerialize(v))?r(g):(e.enter("characterReferenceMarker"),e.consume(g),e.exit("characterReferenceMarker"),e.exit("characterReference"),l)}return d(g)&&o++<u?(e.consume(g),y):r(g)}}const zy={partial:!0,tokenize:c5},Oy={concrete:!0,name:"codeFenced",tokenize:o5};function o5(e,l,r){const i=this,o={partial:!0,tokenize:V};let u=0,d=0,f;return p;function p(D){return h(D)}function h(D){const I=i.events[i.events.length-1];return u=I&&I[1].type==="linePrefix"?I[2].sliceSerialize(I[1],!0).length:0,f=D,e.enter("codeFenced"),e.enter("codeFencedFence"),e.enter("codeFencedFenceSequence"),y(D)}function y(D){return D===f?(d++,e.consume(D),y):d<3?r(D):(e.exit("codeFencedFenceSequence"),yt(D)?Nt(e,g,"whitespace")(D):g(D))}function g(D){return D===null||Xe(D)?(e.exit("codeFencedFence"),i.interrupt?l(D):e.check(zy,A,X)(D)):(e.enter("codeFencedFenceInfo"),e.enter("chunkString",{contentType:"string"}),v(D))}function v(D){return D===null||Xe(D)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),g(D)):yt(D)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),Nt(e,k,"whitespace")(D)):D===96&&D===f?r(D):(e.consume(D),v)}function k(D){return D===null||Xe(D)?g(D):(e.enter("codeFencedFenceMeta"),e.enter("chunkString",{contentType:"string"}),S(D))}function S(D){return D===null||Xe(D)?(e.exit("chunkString"),e.exit("codeFencedFenceMeta"),g(D)):D===96&&D===f?r(D):(e.consume(D),S)}function A(D){return e.attempt(o,X,N)(D)}function N(D){return e.enter("lineEnding"),e.consume(D),e.exit("lineEnding"),R}function R(D){return u>0&&yt(D)?Nt(e,L,"linePrefix",u+1)(D):L(D)}function L(D){return D===null||Xe(D)?e.check(zy,A,X)(D):(e.enter("codeFlowValue"),H(D))}function H(D){return D===null||Xe(D)?(e.exit("codeFlowValue"),L(D)):(e.consume(D),H)}function X(D){return e.exit("codeFenced"),l(D)}function V(D,I,F){let ne=0;return O;function O(J){return D.enter("lineEnding"),D.consume(J),D.exit("lineEnding"),P}function P(J){return D.enter("codeFencedFence"),yt(J)?Nt(D,Q,"linePrefix",i.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(J):Q(J)}function Q(J){return J===f?(D.enter("codeFencedFenceSequence"),oe(J)):F(J)}function oe(J){return J===f?(ne++,D.consume(J),oe):ne>=d?(D.exit("codeFencedFenceSequence"),yt(J)?Nt(D,W,"whitespace")(J):W(J)):F(J)}function W(J){return J===null||Xe(J)?(D.exit("codeFencedFence"),I(J)):F(J)}}}function c5(e,l,r){const i=this;return o;function o(d){return d===null?r(d):(e.enter("lineEnding"),e.consume(d),e.exit("lineEnding"),u)}function u(d){return i.parser.lazy[i.now().line]?r(d):l(d)}}const _m={name:"codeIndented",tokenize:d5},u5={partial:!0,tokenize:f5};function d5(e,l,r){const i=this;return o;function o(h){return e.enter("codeIndented"),Nt(e,u,"linePrefix",5)(h)}function u(h){const y=i.events[i.events.length-1];return y&&y[1].type==="linePrefix"&&y[2].sliceSerialize(y[1],!0).length>=4?d(h):r(h)}function d(h){return h===null?p(h):Xe(h)?e.attempt(u5,d,p)(h):(e.enter("codeFlowValue"),f(h))}function f(h){return h===null||Xe(h)?(e.exit("codeFlowValue"),d(h)):(e.consume(h),f)}function p(h){return e.exit("codeIndented"),l(h)}}function f5(e,l,r){const i=this;return o;function o(d){return i.parser.lazy[i.now().line]?r(d):Xe(d)?(e.enter("lineEnding"),e.consume(d),e.exit("lineEnding"),o):Nt(e,u,"linePrefix",5)(d)}function u(d){const f=i.events[i.events.length-1];return f&&f[1].type==="linePrefix"&&f[2].sliceSerialize(f[1],!0).length>=4?l(d):Xe(d)?o(d):r(d)}}const m5={name:"codeText",previous:h5,resolve:p5,tokenize:x5};function p5(e){let l=e.length-4,r=3,i,o;if((e[r][1].type==="lineEnding"||e[r][1].type==="space")&&(e[l][1].type==="lineEnding"||e[l][1].type==="space")){for(i=r;++i<l;)if(e[i][1].type==="codeTextData"){e[r][1].type="codeTextPadding",e[l][1].type="codeTextPadding",r+=2,l-=2;break}}for(i=r-1,l++;++i<=l;)o===void 0?i!==l&&e[i][1].type!=="lineEnding"&&(o=i):(i===l||e[i][1].type==="lineEnding")&&(e[o][1].type="codeTextData",i!==o+2&&(e[o][1].end=e[i-1][1].end,e.splice(o+2,i-o-2),l-=i-o-2,i=o+2),o=void 0);return e}function h5(e){return e!==96||this.events[this.events.length-1][1].type==="characterEscape"}function x5(e,l,r){let i=0,o,u;return d;function d(g){return e.enter("codeText"),e.enter("codeTextSequence"),f(g)}function f(g){return g===96?(e.consume(g),i++,f):(e.exit("codeTextSequence"),p(g))}function p(g){return g===null?r(g):g===32?(e.enter("space"),e.consume(g),e.exit("space"),p):g===96?(u=e.enter("codeTextSequence"),o=0,y(g)):Xe(g)?(e.enter("lineEnding"),e.consume(g),e.exit("lineEnding"),p):(e.enter("codeTextData"),h(g))}function h(g){return g===null||g===32||g===96||Xe(g)?(e.exit("codeTextData"),p(g)):(e.consume(g),h)}function y(g){return g===96?(e.consume(g),o++,y):o===i?(e.exit("codeTextSequence"),e.exit("codeText"),l(g)):(u.type="codeTextData",h(g))}}class g5{constructor(l){this.left=l?[...l]:[],this.right=[]}get(l){if(l<0||l>=this.left.length+this.right.length)throw new RangeError("Cannot access index `"+l+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return l<this.left.length?this.left[l]:this.right[this.right.length-l+this.left.length-1]}get length(){return this.left.length+this.right.length}shift(){return this.setCursor(0),this.right.pop()}slice(l,r){const i=r??Number.POSITIVE_INFINITY;return i<this.left.length?this.left.slice(l,i):l>this.left.length?this.right.slice(this.right.length-i+this.left.length,this.right.length-l+this.left.length).reverse():this.left.slice(l).concat(this.right.slice(this.right.length-i+this.left.length).reverse())}splice(l,r,i){const o=r||0;this.setCursor(Math.trunc(l));const u=this.right.splice(this.right.length-o,Number.POSITIVE_INFINITY);return i&&xo(this.left,i),u.reverse()}pop(){return this.setCursor(Number.POSITIVE_INFINITY),this.left.pop()}push(l){this.setCursor(Number.POSITIVE_INFINITY),this.left.push(l)}pushMany(l){this.setCursor(Number.POSITIVE_INFINITY),xo(this.left,l)}unshift(l){this.setCursor(0),this.right.push(l)}unshiftMany(l){this.setCursor(0),xo(this.right,l.reverse())}setCursor(l){if(!(l===this.left.length||l>this.left.length&&this.right.length===0||l<0&&this.left.length===0))if(l<this.left.length){const r=this.left.splice(l,Number.POSITIVE_INFINITY);xo(this.right,r.reverse())}else{const r=this.right.splice(this.left.length+this.right.length-l,Number.POSITIVE_INFINITY);xo(this.left,r.reverse())}}}function xo(e,l){let r=0;if(l.length<1e4)e.push(...l);else for(;r<l.length;)e.push(...l.slice(r,r+1e4)),r+=1e4}function F0(e){const l={};let r=-1,i,o,u,d,f,p,h;const y=new g5(e);for(;++r<y.length;){for(;r in l;)r=l[r];if(i=y.get(r),r&&i[1].type==="chunkFlow"&&y.get(r-1)[1].type==="listItemPrefix"&&(p=i[1]._tokenizer.events,u=0,u<p.length&&p[u][1].type==="lineEndingBlank"&&(u+=2),u<p.length&&p[u][1].type==="content"))for(;++u<p.length&&p[u][1].type!=="content";)p[u][1].type==="chunkText"&&(p[u][1]._isInFirstContentOfListItem=!0,u++);if(i[0]==="enter")i[1].contentType&&(Object.assign(l,b5(y,r)),r=l[r],h=!0);else if(i[1]._container){for(u=r,o=void 0;u--;)if(d=y.get(u),d[1].type==="lineEnding"||d[1].type==="lineEndingBlank")d[0]==="enter"&&(o&&(y.get(o)[1].type="lineEndingBlank"),d[1].type="lineEnding",o=u);else if(!(d[1].type==="linePrefix"||d[1].type==="listItemIndent"))break;o&&(i[1].end={...y.get(o)[1].start},f=y.slice(o,r),f.unshift(i),y.splice(o,r-o+1,f))}}return xl(e,0,Number.POSITIVE_INFINITY,y.slice(0)),!h}function b5(e,l){const r=e.get(l)[1],i=e.get(l)[2];let o=l-1;const u=[];let d=r._tokenizer;d||(d=i.parser[r.contentType](r.start),r._contentTypeTextTrailing&&(d._contentTypeTextTrailing=!0));const f=d.events,p=[],h={};let y,g,v=-1,k=r,S=0,A=0;const N=[A];for(;k;){for(;e.get(++o)[1]!==k;);u.push(o),k._tokenizer||(y=i.sliceStream(k),k.next||y.push(null),g&&d.defineSkip(k.start),k._isInFirstContentOfListItem&&(d._gfmTasklistFirstContentOfListItem=!0),d.write(y),k._isInFirstContentOfListItem&&(d._gfmTasklistFirstContentOfListItem=void 0)),g=k,k=k.next}for(k=r;++v<f.length;)f[v][0]==="exit"&&f[v-1][0]==="enter"&&f[v][1].type===f[v-1][1].type&&f[v][1].start.line!==f[v][1].end.line&&(A=v+1,N.push(A),k._tokenizer=void 0,k.previous=void 0,k=k.next);for(d.events=[],k?(k._tokenizer=void 0,k.previous=void 0):N.pop(),v=N.length;v--;){const R=f.slice(N[v],N[v+1]),L=u.pop();p.push([L,L+R.length-1]),e.splice(L,2,R)}for(p.reverse(),v=-1;++v<p.length;)h[S+p[v][0]]=S+p[v][1],S+=p[v][1]-p[v][0]-1;return h}const y5={resolve:j5,tokenize:k5},v5={partial:!0,tokenize:N5};function j5(e){return F0(e),e}function k5(e,l){let r;return i;function i(f){return e.enter("content"),r=e.enter("chunkContent",{contentType:"content"}),o(f)}function o(f){return f===null?u(f):Xe(f)?e.check(v5,d,u)(f):(e.consume(f),o)}function u(f){return e.exit("chunkContent"),e.exit("content"),l(f)}function d(f){return e.consume(f),e.exit("chunkContent"),r.next=e.enter("chunkContent",{contentType:"content",previous:r}),r=r.next,o}}function N5(e,l,r){const i=this;return o;function o(d){return e.exit("chunkContent"),e.enter("lineEnding"),e.consume(d),e.exit("lineEnding"),Nt(e,u,"linePrefix")}function u(d){if(d===null||Xe(d))return r(d);const f=i.events[i.events.length-1];return!i.parser.constructs.disable.null.includes("codeIndented")&&f&&f[1].type==="linePrefix"&&f[2].sliceSerialize(f[1],!0).length>=4?l(d):e.interrupt(i.parser.constructs.flow,r,l)(d)}}function q0(e,l,r,i,o,u,d,f,p){const h=p||Number.POSITIVE_INFINITY;let y=0;return g;function g(R){return R===60?(e.enter(i),e.enter(o),e.enter(u),e.consume(R),e.exit(u),v):R===null||R===32||R===41||_u(R)?r(R):(e.enter(i),e.enter(d),e.enter(f),e.enter("chunkString",{contentType:"string"}),A(R))}function v(R){return R===62?(e.enter(u),e.consume(R),e.exit(u),e.exit(o),e.exit(i),l):(e.enter(f),e.enter("chunkString",{contentType:"string"}),k(R))}function k(R){return R===62?(e.exit("chunkString"),e.exit(f),v(R)):R===null||R===60||Xe(R)?r(R):(e.consume(R),R===92?S:k)}function S(R){return R===60||R===62||R===92?(e.consume(R),k):k(R)}function A(R){return!y&&(R===null||R===41||It(R))?(e.exit("chunkString"),e.exit(f),e.exit(d),e.exit(i),l(R)):y<h&&R===40?(e.consume(R),y++,A):R===41?(e.consume(R),y--,A):R===null||R===32||R===40||_u(R)?r(R):(e.consume(R),R===92?N:A)}function N(R){return R===40||R===41||R===92?(e.consume(R),A):A(R)}}function V0(e,l,r,i,o,u){const d=this;let f=0,p;return h;function h(k){return e.enter(i),e.enter(o),e.consume(k),e.exit(o),e.enter(u),y}function y(k){return f>999||k===null||k===91||k===93&&!p||k===94&&!f&&"_hiddenFootnoteSupport"in d.parser.constructs?r(k):k===93?(e.exit(u),e.enter(o),e.consume(k),e.exit(o),e.exit(i),l):Xe(k)?(e.enter("lineEnding"),e.consume(k),e.exit("lineEnding"),y):(e.enter("chunkString",{contentType:"string"}),g(k))}function g(k){return k===null||k===91||k===93||Xe(k)||f++>999?(e.exit("chunkString"),y(k)):(e.consume(k),p||(p=!yt(k)),k===92?v:g)}function v(k){return k===91||k===92||k===93?(e.consume(k),f++,g):g(k)}}function $0(e,l,r,i,o,u){let d;return f;function f(v){return v===34||v===39||v===40?(e.enter(i),e.enter(o),e.consume(v),e.exit(o),d=v===40?41:v,p):r(v)}function p(v){return v===d?(e.enter(o),e.consume(v),e.exit(o),e.exit(i),l):(e.enter(u),h(v))}function h(v){return v===d?(e.exit(u),p(d)):v===null?r(v):Xe(v)?(e.enter("lineEnding"),e.consume(v),e.exit("lineEnding"),Nt(e,h,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),y(v))}function y(v){return v===d||v===null||Xe(v)?(e.exit("chunkString"),h(v)):(e.consume(v),v===92?g:y)}function g(v){return v===d||v===92?(e.consume(v),y):y(v)}}function jo(e,l){let r;return i;function i(o){return Xe(o)?(e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),r=!0,i):yt(o)?Nt(e,i,r?"linePrefix":"lineSuffix")(o):l(o)}}const w5={name:"definition",tokenize:C5},S5={partial:!0,tokenize:T5};function C5(e,l,r){const i=this;let o;return u;function u(k){return e.enter("definition"),d(k)}function d(k){return V0.call(i,e,f,r,"definitionLabel","definitionLabelMarker","definitionLabelString")(k)}function f(k){return o=Il(i.sliceSerialize(i.events[i.events.length-1][1]).slice(1,-1)),k===58?(e.enter("definitionMarker"),e.consume(k),e.exit("definitionMarker"),p):r(k)}function p(k){return It(k)?jo(e,h)(k):h(k)}function h(k){return q0(e,y,r,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(k)}function y(k){return e.attempt(S5,g,g)(k)}function g(k){return yt(k)?Nt(e,v,"whitespace")(k):v(k)}function v(k){return k===null||Xe(k)?(e.exit("definition"),i.parser.defined.push(o),l(k)):r(k)}}function T5(e,l,r){return i;function i(f){return It(f)?jo(e,o)(f):r(f)}function o(f){return $0(e,u,r,"definitionTitle","definitionTitleMarker","definitionTitleString")(f)}function u(f){return yt(f)?Nt(e,d,"whitespace")(f):d(f)}function d(f){return f===null||Xe(f)?l(f):r(f)}}const A5={name:"hardBreakEscape",tokenize:E5};function E5(e,l,r){return i;function i(u){return e.enter("hardBreakEscape"),e.consume(u),o}function o(u){return Xe(u)?(e.exit("hardBreakEscape"),l(u)):r(u)}}const R5={name:"headingAtx",resolve:M5,tokenize:z5};function M5(e,l){let r=e.length-2,i=3,o,u;return e[i][1].type==="whitespace"&&(i+=2),r-2>i&&e[r][1].type==="whitespace"&&(r-=2),e[r][1].type==="atxHeadingSequence"&&(i===r-1||r-4>i&&e[r-2][1].type==="whitespace")&&(r-=i+1===r?2:4),r>i&&(o={type:"atxHeadingText",start:e[i][1].start,end:e[r][1].end},u={type:"chunkText",start:e[i][1].start,end:e[r][1].end,contentType:"text"},xl(e,i,r-i+1,[["enter",o,l],["enter",u,l],["exit",u,l],["exit",o,l]])),e}function z5(e,l,r){let i=0;return o;function o(y){return e.enter("atxHeading"),u(y)}function u(y){return e.enter("atxHeadingSequence"),d(y)}function d(y){return y===35&&i++<6?(e.consume(y),d):y===null||It(y)?(e.exit("atxHeadingSequence"),f(y)):r(y)}function f(y){return y===35?(e.enter("atxHeadingSequence"),p(y)):y===null||Xe(y)?(e.exit("atxHeading"),l(y)):yt(y)?Nt(e,f,"whitespace")(y):(e.enter("atxHeadingText"),h(y))}function p(y){return y===35?(e.consume(y),p):(e.exit("atxHeadingSequence"),f(y))}function h(y){return y===null||y===35||It(y)?(e.exit("atxHeadingText"),f(y)):(e.consume(y),h)}}const O5=["address","article","aside","base","basefont","blockquote","body","caption","center","col","colgroup","dd","details","dialog","dir","div","dl","dt","fieldset","figcaption","figure","footer","form","frame","frameset","h1","h2","h3","h4","h5","h6","head","header","hr","html","iframe","legend","li","link","main","menu","menuitem","nav","noframes","ol","optgroup","option","p","param","search","section","summary","table","tbody","td","tfoot","th","thead","title","tr","track","ul"],Ly=["pre","script","style","textarea"],L5={concrete:!0,name:"htmlFlow",resolveTo:B5,tokenize:I5},D5={partial:!0,tokenize:U5},_5={partial:!0,tokenize:P5};function B5(e){let l=e.length;for(;l--&&!(e[l][0]==="enter"&&e[l][1].type==="htmlFlow"););return l>1&&e[l-2][1].type==="linePrefix"&&(e[l][1].start=e[l-2][1].start,e[l+1][1].start=e[l-2][1].start,e.splice(l-2,2)),e}function I5(e,l,r){const i=this;let o,u,d,f,p;return h;function h(M){return y(M)}function y(M){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(M),g}function g(M){return M===33?(e.consume(M),v):M===47?(e.consume(M),u=!0,A):M===63?(e.consume(M),o=3,i.interrupt?l:T):Pn(M)?(e.consume(M),d=String.fromCharCode(M),N):r(M)}function v(M){return M===45?(e.consume(M),o=2,k):M===91?(e.consume(M),o=5,f=0,S):Pn(M)?(e.consume(M),o=4,i.interrupt?l:T):r(M)}function k(M){return M===45?(e.consume(M),i.interrupt?l:T):r(M)}function S(M){const pe="CDATA[";return M===pe.charCodeAt(f++)?(e.consume(M),f===pe.length?i.interrupt?l:Q:S):r(M)}function A(M){return Pn(M)?(e.consume(M),d=String.fromCharCode(M),N):r(M)}function N(M){if(M===null||M===47||M===62||It(M)){const pe=M===47,ge=d.toLowerCase();return!pe&&!u&&Ly.includes(ge)?(o=1,i.interrupt?l(M):Q(M)):O5.includes(d.toLowerCase())?(o=6,pe?(e.consume(M),R):i.interrupt?l(M):Q(M)):(o=7,i.interrupt&&!i.parser.lazy[i.now().line]?r(M):u?L(M):H(M))}return M===45||zn(M)?(e.consume(M),d+=String.fromCharCode(M),N):r(M)}function R(M){return M===62?(e.consume(M),i.interrupt?l:Q):r(M)}function L(M){return yt(M)?(e.consume(M),L):O(M)}function H(M){return M===47?(e.consume(M),O):M===58||M===95||Pn(M)?(e.consume(M),X):yt(M)?(e.consume(M),H):O(M)}function X(M){return M===45||M===46||M===58||M===95||zn(M)?(e.consume(M),X):V(M)}function V(M){return M===61?(e.consume(M),D):yt(M)?(e.consume(M),V):H(M)}function D(M){return M===null||M===60||M===61||M===62||M===96?r(M):M===34||M===39?(e.consume(M),p=M,I):yt(M)?(e.consume(M),D):F(M)}function I(M){return M===p?(e.consume(M),p=null,ne):M===null||Xe(M)?r(M):(e.consume(M),I)}function F(M){return M===null||M===34||M===39||M===47||M===60||M===61||M===62||M===96||It(M)?V(M):(e.consume(M),F)}function ne(M){return M===47||M===62||yt(M)?H(M):r(M)}function O(M){return M===62?(e.consume(M),P):r(M)}function P(M){return M===null||Xe(M)?Q(M):yt(M)?(e.consume(M),P):r(M)}function Q(M){return M===45&&o===2?(e.consume(M),w):M===60&&o===1?(e.consume(M),Y):M===62&&o===4?(e.consume(M),B):M===63&&o===3?(e.consume(M),T):M===93&&o===5?(e.consume(M),ve):Xe(M)&&(o===6||o===7)?(e.exit("htmlFlowData"),e.check(D5,le,oe)(M)):M===null||Xe(M)?(e.exit("htmlFlowData"),oe(M)):(e.consume(M),Q)}function oe(M){return e.check(_5,W,le)(M)}function W(M){return e.enter("lineEnding"),e.consume(M),e.exit("lineEnding"),J}function J(M){return M===null||Xe(M)?oe(M):(e.enter("htmlFlowData"),Q(M))}function w(M){return M===45?(e.consume(M),T):Q(M)}function Y(M){return M===47?(e.consume(M),d="",G):Q(M)}function G(M){if(M===62){const pe=d.toLowerCase();return Ly.includes(pe)?(e.consume(M),B):Q(M)}return Pn(M)&&d.length<8?(e.consume(M),d+=String.fromCharCode(M),G):Q(M)}function ve(M){return M===93?(e.consume(M),T):Q(M)}function T(M){return M===62?(e.consume(M),B):M===45&&o===2?(e.consume(M),T):Q(M)}function B(M){return M===null||Xe(M)?(e.exit("htmlFlowData"),le(M)):(e.consume(M),B)}function le(M){return e.exit("htmlFlow"),l(M)}}function P5(e,l,r){const i=this;return o;function o(d){return Xe(d)?(e.enter("lineEnding"),e.consume(d),e.exit("lineEnding"),u):r(d)}function u(d){return i.parser.lazy[i.now().line]?r(d):l(d)}}function U5(e,l,r){return i;function i(o){return e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),e.attempt(_o,l,r)}}const H5={name:"htmlText",tokenize:F5};function F5(e,l,r){const i=this;let o,u,d;return f;function f(T){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(T),p}function p(T){return T===33?(e.consume(T),h):T===47?(e.consume(T),V):T===63?(e.consume(T),H):Pn(T)?(e.consume(T),F):r(T)}function h(T){return T===45?(e.consume(T),y):T===91?(e.consume(T),u=0,S):Pn(T)?(e.consume(T),L):r(T)}function y(T){return T===45?(e.consume(T),k):r(T)}function g(T){return T===null?r(T):T===45?(e.consume(T),v):Xe(T)?(d=g,Y(T)):(e.consume(T),g)}function v(T){return T===45?(e.consume(T),k):g(T)}function k(T){return T===62?w(T):T===45?v(T):g(T)}function S(T){const B="CDATA[";return T===B.charCodeAt(u++)?(e.consume(T),u===B.length?A:S):r(T)}function A(T){return T===null?r(T):T===93?(e.consume(T),N):Xe(T)?(d=A,Y(T)):(e.consume(T),A)}function N(T){return T===93?(e.consume(T),R):A(T)}function R(T){return T===62?w(T):T===93?(e.consume(T),R):A(T)}function L(T){return T===null||T===62?w(T):Xe(T)?(d=L,Y(T)):(e.consume(T),L)}function H(T){return T===null?r(T):T===63?(e.consume(T),X):Xe(T)?(d=H,Y(T)):(e.consume(T),H)}function X(T){return T===62?w(T):H(T)}function V(T){return Pn(T)?(e.consume(T),D):r(T)}function D(T){return T===45||zn(T)?(e.consume(T),D):I(T)}function I(T){return Xe(T)?(d=I,Y(T)):yt(T)?(e.consume(T),I):w(T)}function F(T){return T===45||zn(T)?(e.consume(T),F):T===47||T===62||It(T)?ne(T):r(T)}function ne(T){return T===47?(e.consume(T),w):T===58||T===95||Pn(T)?(e.consume(T),O):Xe(T)?(d=ne,Y(T)):yt(T)?(e.consume(T),ne):w(T)}function O(T){return T===45||T===46||T===58||T===95||zn(T)?(e.consume(T),O):P(T)}function P(T){return T===61?(e.consume(T),Q):Xe(T)?(d=P,Y(T)):yt(T)?(e.consume(T),P):ne(T)}function Q(T){return T===null||T===60||T===61||T===62||T===96?r(T):T===34||T===39?(e.consume(T),o=T,oe):Xe(T)?(d=Q,Y(T)):yt(T)?(e.consume(T),Q):(e.consume(T),W)}function oe(T){return T===o?(e.consume(T),o=void 0,J):T===null?r(T):Xe(T)?(d=oe,Y(T)):(e.consume(T),oe)}function W(T){return T===null||T===34||T===39||T===60||T===61||T===96?r(T):T===47||T===62||It(T)?ne(T):(e.consume(T),W)}function J(T){return T===47||T===62||It(T)?ne(T):r(T)}function w(T){return T===62?(e.consume(T),e.exit("htmlTextData"),e.exit("htmlText"),l):r(T)}function Y(T){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(T),e.exit("lineEnding"),G}function G(T){return yt(T)?Nt(e,ve,"linePrefix",i.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(T):ve(T)}function ve(T){return e.enter("htmlTextData"),d(T)}}const lh={name:"labelEnd",resolveAll:G5,resolveTo:Y5,tokenize:Q5},q5={tokenize:X5},V5={tokenize:K5},$5={tokenize:Z5};function G5(e){let l=-1;const r=[];for(;++l<e.length;){const i=e[l][1];if(r.push(e[l]),i.type==="labelImage"||i.type==="labelLink"||i.type==="labelEnd"){const o=i.type==="labelImage"?4:2;i.type="data",l+=o}}return e.length!==r.length&&xl(e,0,e.length,r),e}function Y5(e,l){let r=e.length,i=0,o,u,d,f;for(;r--;)if(o=e[r][1],u){if(o.type==="link"||o.type==="labelLink"&&o._inactive)break;e[r][0]==="enter"&&o.type==="labelLink"&&(o._inactive=!0)}else if(d){if(e[r][0]==="enter"&&(o.type==="labelImage"||o.type==="labelLink")&&!o._balanced&&(u=r,o.type!=="labelLink")){i=2;break}}else o.type==="labelEnd"&&(d=r);const p={type:e[u][1].type==="labelLink"?"link":"image",start:{...e[u][1].start},end:{...e[e.length-1][1].end}},h={type:"label",start:{...e[u][1].start},end:{...e[d][1].end}},y={type:"labelText",start:{...e[u+i+2][1].end},end:{...e[d-2][1].start}};return f=[["enter",p,l],["enter",h,l]],f=wl(f,e.slice(u+1,u+i+3)),f=wl(f,[["enter",y,l]]),f=wl(f,Yu(l.parser.constructs.insideSpan.null,e.slice(u+i+4,d-3),l)),f=wl(f,[["exit",y,l],e[d-2],e[d-1],["exit",h,l]]),f=wl(f,e.slice(d+1)),f=wl(f,[["exit",p,l]]),xl(e,u,e.length,f),e}function Q5(e,l,r){const i=this;let o=i.events.length,u,d;for(;o--;)if((i.events[o][1].type==="labelImage"||i.events[o][1].type==="labelLink")&&!i.events[o][1]._balanced){u=i.events[o][1];break}return f;function f(v){return u?u._inactive?g(v):(d=i.parser.defined.includes(Il(i.sliceSerialize({start:u.end,end:i.now()}))),e.enter("labelEnd"),e.enter("labelMarker"),e.consume(v),e.exit("labelMarker"),e.exit("labelEnd"),p):r(v)}function p(v){return v===40?e.attempt(q5,y,d?y:g)(v):v===91?e.attempt(V5,y,d?h:g)(v):d?y(v):g(v)}function h(v){return e.attempt($5,y,g)(v)}function y(v){return l(v)}function g(v){return u._balanced=!0,r(v)}}function X5(e,l,r){return i;function i(g){return e.enter("resource"),e.enter("resourceMarker"),e.consume(g),e.exit("resourceMarker"),o}function o(g){return It(g)?jo(e,u)(g):u(g)}function u(g){return g===41?y(g):q0(e,d,f,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(g)}function d(g){return It(g)?jo(e,p)(g):y(g)}function f(g){return r(g)}function p(g){return g===34||g===39||g===40?$0(e,h,r,"resourceTitle","resourceTitleMarker","resourceTitleString")(g):y(g)}function h(g){return It(g)?jo(e,y)(g):y(g)}function y(g){return g===41?(e.enter("resourceMarker"),e.consume(g),e.exit("resourceMarker"),e.exit("resource"),l):r(g)}}function K5(e,l,r){const i=this;return o;function o(f){return V0.call(i,e,u,d,"reference","referenceMarker","referenceString")(f)}function u(f){return i.parser.defined.includes(Il(i.sliceSerialize(i.events[i.events.length-1][1]).slice(1,-1)))?l(f):r(f)}function d(f){return r(f)}}function Z5(e,l,r){return i;function i(u){return e.enter("reference"),e.enter("referenceMarker"),e.consume(u),e.exit("referenceMarker"),o}function o(u){return u===93?(e.enter("referenceMarker"),e.consume(u),e.exit("referenceMarker"),e.exit("reference"),l):r(u)}}const W5={name:"labelStartImage",resolveAll:lh.resolveAll,tokenize:J5};function J5(e,l,r){const i=this;return o;function o(f){return e.enter("labelImage"),e.enter("labelImageMarker"),e.consume(f),e.exit("labelImageMarker"),u}function u(f){return f===91?(e.enter("labelMarker"),e.consume(f),e.exit("labelMarker"),e.exit("labelImage"),d):r(f)}function d(f){return f===94&&"_hiddenFootnoteSupport"in i.parser.constructs?r(f):l(f)}}const e4={name:"labelStartLink",resolveAll:lh.resolveAll,tokenize:t4};function t4(e,l,r){const i=this;return o;function o(d){return e.enter("labelLink"),e.enter("labelMarker"),e.consume(d),e.exit("labelMarker"),e.exit("labelLink"),u}function u(d){return d===94&&"_hiddenFootnoteSupport"in i.parser.constructs?r(d):l(d)}}const Bm={name:"lineEnding",tokenize:n4};function n4(e,l){return r;function r(i){return e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),Nt(e,l,"linePrefix")}}const Eu={name:"thematicBreak",tokenize:l4};function l4(e,l,r){let i=0,o;return u;function u(h){return e.enter("thematicBreak"),d(h)}function d(h){return o=h,f(h)}function f(h){return h===o?(e.enter("thematicBreakSequence"),p(h)):i>=3&&(h===null||Xe(h))?(e.exit("thematicBreak"),l(h)):r(h)}function p(h){return h===o?(e.consume(h),i++,p):(e.exit("thematicBreakSequence"),yt(h)?Nt(e,f,"whitespace")(h):f(h))}}const Wn={continuation:{tokenize:s4},exit:c4,name:"list",tokenize:i4},r4={partial:!0,tokenize:u4},a4={partial:!0,tokenize:o4};function i4(e,l,r){const i=this,o=i.events[i.events.length-1];let u=o&&o[1].type==="linePrefix"?o[2].sliceSerialize(o[1],!0).length:0,d=0;return f;function f(k){const S=i.containerState.type||(k===42||k===43||k===45?"listUnordered":"listOrdered");if(S==="listUnordered"?!i.containerState.marker||k===i.containerState.marker:hp(k)){if(i.containerState.type||(i.containerState.type=S,e.enter(S,{_container:!0})),S==="listUnordered")return e.enter("listItemPrefix"),k===42||k===45?e.check(Eu,r,h)(k):h(k);if(!i.interrupt||k===49)return e.enter("listItemPrefix"),e.enter("listItemValue"),p(k)}return r(k)}function p(k){return hp(k)&&++d<10?(e.consume(k),p):(!i.interrupt||d<2)&&(i.containerState.marker?k===i.containerState.marker:k===41||k===46)?(e.exit("listItemValue"),h(k)):r(k)}function h(k){return e.enter("listItemMarker"),e.consume(k),e.exit("listItemMarker"),i.containerState.marker=i.containerState.marker||k,e.check(_o,i.interrupt?r:y,e.attempt(r4,v,g))}function y(k){return i.containerState.initialBlankLine=!0,u++,v(k)}function g(k){return yt(k)?(e.enter("listItemPrefixWhitespace"),e.consume(k),e.exit("listItemPrefixWhitespace"),v):r(k)}function v(k){return i.containerState.size=u+i.sliceSerialize(e.exit("listItemPrefix"),!0).length,l(k)}}function s4(e,l,r){const i=this;return i.containerState._closeFlow=void 0,e.check(_o,o,u);function o(f){return i.containerState.furtherBlankLines=i.containerState.furtherBlankLines||i.containerState.initialBlankLine,Nt(e,l,"listItemIndent",i.containerState.size+1)(f)}function u(f){return i.containerState.furtherBlankLines||!yt(f)?(i.containerState.furtherBlankLines=void 0,i.containerState.initialBlankLine=void 0,d(f)):(i.containerState.furtherBlankLines=void 0,i.containerState.initialBlankLine=void 0,e.attempt(a4,l,d)(f))}function d(f){return i.containerState._closeFlow=!0,i.interrupt=void 0,Nt(e,e.attempt(Wn,l,r),"linePrefix",i.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(f)}}function o4(e,l,r){const i=this;return Nt(e,o,"listItemIndent",i.containerState.size+1);function o(u){const d=i.events[i.events.length-1];return d&&d[1].type==="listItemIndent"&&d[2].sliceSerialize(d[1],!0).length===i.containerState.size?l(u):r(u)}}function c4(e){e.exit(this.containerState.type)}function u4(e,l,r){const i=this;return Nt(e,o,"listItemPrefixWhitespace",i.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function o(u){const d=i.events[i.events.length-1];return!yt(u)&&d&&d[1].type==="listItemPrefixWhitespace"?l(u):r(u)}}const Dy={name:"setextUnderline",resolveTo:d4,tokenize:f4};function d4(e,l){let r=e.length,i,o,u;for(;r--;)if(e[r][0]==="enter"){if(e[r][1].type==="content"){i=r;break}e[r][1].type==="paragraph"&&(o=r)}else e[r][1].type==="content"&&e.splice(r,1),!u&&e[r][1].type==="definition"&&(u=r);const d={type:"setextHeading",start:{...e[i][1].start},end:{...e[e.length-1][1].end}};return e[o][1].type="setextHeadingText",u?(e.splice(o,0,["enter",d,l]),e.splice(u+1,0,["exit",e[i][1],l]),e[i][1].end={...e[u][1].end}):e[i][1]=d,e.push(["exit",d,l]),e}function f4(e,l,r){const i=this;let o;return u;function u(h){let y=i.events.length,g;for(;y--;)if(i.events[y][1].type!=="lineEnding"&&i.events[y][1].type!=="linePrefix"&&i.events[y][1].type!=="content"){g=i.events[y][1].type==="paragraph";break}return!i.parser.lazy[i.now().line]&&(i.interrupt||g)?(e.enter("setextHeadingLine"),o=h,d(h)):r(h)}function d(h){return e.enter("setextHeadingLineSequence"),f(h)}function f(h){return h===o?(e.consume(h),f):(e.exit("setextHeadingLineSequence"),yt(h)?Nt(e,p,"lineSuffix")(h):p(h))}function p(h){return h===null||Xe(h)?(e.exit("setextHeadingLine"),l(h)):r(h)}}const m4={tokenize:p4};function p4(e){const l=this,r=e.attempt(_o,i,e.attempt(this.parser.constructs.flowInitial,o,Nt(e,e.attempt(this.parser.constructs.flow,o,e.attempt(y5,o)),"linePrefix")));return r;function i(u){if(u===null){e.consume(u);return}return e.enter("lineEndingBlank"),e.consume(u),e.exit("lineEndingBlank"),l.currentConstruct=void 0,r}function o(u){if(u===null){e.consume(u);return}return e.enter("lineEnding"),e.consume(u),e.exit("lineEnding"),l.currentConstruct=void 0,r}}const h4={resolveAll:Y0()},x4=G0("string"),g4=G0("text");function G0(e){return{resolveAll:Y0(e==="text"?b4:void 0),tokenize:l};function l(r){const i=this,o=this.parser.constructs[e],u=r.attempt(o,d,f);return d;function d(y){return h(y)?u(y):f(y)}function f(y){if(y===null){r.consume(y);return}return r.enter("data"),r.consume(y),p}function p(y){return h(y)?(r.exit("data"),u(y)):(r.consume(y),p)}function h(y){if(y===null)return!0;const g=o[y];let v=-1;if(g)for(;++v<g.length;){const k=g[v];if(!k.previous||k.previous.call(i,i.previous))return!0}return!1}}}function Y0(e){return l;function l(r,i){let o=-1,u;for(;++o<=r.length;)u===void 0?r[o]&&r[o][1].type==="data"&&(u=o,o++):(!r[o]||r[o][1].type!=="data")&&(o!==u+2&&(r[u][1].end=r[o-1][1].end,r.splice(u+2,o-u-2),o=u+2),u=void 0);return e?e(r,i):r}}function b4(e,l){let r=0;for(;++r<=e.length;)if((r===e.length||e[r][1].type==="lineEnding")&&e[r-1][1].type==="data"){const i=e[r-1][1],o=l.sliceStream(i);let u=o.length,d=-1,f=0,p;for(;u--;){const h=o[u];if(typeof h=="string"){for(d=h.length;h.charCodeAt(d-1)===32;)f++,d--;if(d)break;d=-1}else if(h===-2)p=!0,f++;else if(h!==-1){u++;break}}if(l._contentTypeTextTrailing&&r===e.length&&(f=0),f){const h={type:r===e.length||p||f<2?"lineSuffix":"hardBreakTrailing",start:{_bufferIndex:u?d:i.start._bufferIndex+d,_index:i.start._index+u,line:i.end.line,column:i.end.column-f,offset:i.end.offset-f},end:{...i.end}};i.end={...h.start},i.start.offset===i.end.offset?Object.assign(i,h):(e.splice(r,0,["enter",h,l],["exit",h,l]),r+=2)}r++}return e}const y4={42:Wn,43:Wn,45:Wn,48:Wn,49:Wn,50:Wn,51:Wn,52:Wn,53:Wn,54:Wn,55:Wn,56:Wn,57:Wn,62:P0},v4={91:w5},j4={[-2]:_m,[-1]:_m,32:_m},k4={35:R5,42:Eu,45:[Dy,Eu],60:L5,61:Dy,95:Eu,96:Oy,126:Oy},N4={38:H0,92:U0},w4={[-5]:Bm,[-4]:Bm,[-3]:Bm,33:W5,38:H0,42:xp,60:[e5,H5],91:e4,92:[A5,U0],93:lh,95:xp,96:m5},S4={null:[xp,h4]},C4={null:[42,95]},T4={null:[]},A4=Object.freeze(Object.defineProperty({__proto__:null,attentionMarkers:C4,contentInitial:v4,disable:T4,document:y4,flow:k4,flowInitial:j4,insideSpan:S4,string:N4,text:w4},Symbol.toStringTag,{value:"Module"}));function E4(e,l,r){let i={_bufferIndex:-1,_index:0,line:r&&r.line||1,column:r&&r.column||1,offset:r&&r.offset||0};const o={},u=[];let d=[],f=[];const p={attempt:I(V),check:I(D),consume:L,enter:H,exit:X,interrupt:I(D,{interrupt:!0})},h={code:null,containerState:{},defineSkip:A,events:[],now:S,parser:e,previous:null,sliceSerialize:v,sliceStream:k,write:g};let y=l.tokenize.call(h,p);return l.resolveAll&&u.push(l),h;function g(P){return d=wl(d,P),N(),d[d.length-1]!==null?[]:(F(l,0),h.events=Yu(u,h.events,h),h.events)}function v(P,Q){return M4(k(P),Q)}function k(P){return R4(d,P)}function S(){const{_bufferIndex:P,_index:Q,line:oe,column:W,offset:J}=i;return{_bufferIndex:P,_index:Q,line:oe,column:W,offset:J}}function A(P){o[P.line]=P.column,O()}function N(){let P;for(;i._index<d.length;){const Q=d[i._index];if(typeof Q=="string")for(P=i._index,i._bufferIndex<0&&(i._bufferIndex=0);i._index===P&&i._bufferIndex<Q.length;)R(Q.charCodeAt(i._bufferIndex));else R(Q)}}function R(P){y=y(P)}function L(P){Xe(P)?(i.line++,i.column=1,i.offset+=P===-3?2:1,O()):P!==-1&&(i.column++,i.offset++),i._bufferIndex<0?i._index++:(i._bufferIndex++,i._bufferIndex===d[i._index].length&&(i._bufferIndex=-1,i._index++)),h.previous=P}function H(P,Q){const oe=Q||{};return oe.type=P,oe.start=S(),h.events.push(["enter",oe,h]),f.push(oe),oe}function X(P){const Q=f.pop();return Q.end=S(),h.events.push(["exit",Q,h]),Q}function V(P,Q){F(P,Q.from)}function D(P,Q){Q.restore()}function I(P,Q){return oe;function oe(W,J,w){let Y,G,ve,T;return Array.isArray(W)?le(W):"tokenize"in W?le([W]):B(W);function B(ce){return Re;function Re(Se){const Ne=Se!==null&&ce[Se],Ve=Se!==null&&ce.null,_e=[...Array.isArray(Ne)?Ne:Ne?[Ne]:[],...Array.isArray(Ve)?Ve:Ve?[Ve]:[]];return le(_e)(Se)}}function le(ce){return Y=ce,G=0,ce.length===0?w:M(ce[G])}function M(ce){return Re;function Re(Se){return T=ne(),ve=ce,ce.partial||(h.currentConstruct=ce),ce.name&&h.parser.constructs.disable.null.includes(ce.name)?ge():ce.tokenize.call(Q?Object.assign(Object.create(h),Q):h,p,pe,ge)(Se)}}function pe(ce){return P(ve,T),J}function ge(ce){return T.restore(),++G<Y.length?M(Y[G]):w}}}function F(P,Q){P.resolveAll&&!u.includes(P)&&u.push(P),P.resolve&&xl(h.events,Q,h.events.length-Q,P.resolve(h.events.slice(Q),h)),P.resolveTo&&(h.events=P.resolveTo(h.events,h))}function ne(){const P=S(),Q=h.previous,oe=h.currentConstruct,W=h.events.length,J=Array.from(f);return{from:W,restore:w};function w(){i=P,h.previous=Q,h.currentConstruct=oe,h.events.length=W,f=J,O()}}function O(){i.line in o&&i.column<2&&(i.column=o[i.line],i.offset+=o[i.line]-1)}}function R4(e,l){const r=l.start._index,i=l.start._bufferIndex,o=l.end._index,u=l.end._bufferIndex;let d;if(r===o)d=[e[r].slice(i,u)];else{if(d=e.slice(r,o),i>-1){const f=d[0];typeof f=="string"?d[0]=f.slice(i):d.shift()}u>0&&d.push(e[o].slice(0,u))}return d}function M4(e,l){let r=-1;const i=[];let o;for(;++r<e.length;){const u=e[r];let d;if(typeof u=="string")d=u;else switch(u){case-5:{d="\r";break}case-4:{d=`
64
+ `;break}case-3:{d=`\r
65
+ `;break}case-2:{d=l?" ":" ";break}case-1:{if(!l&&o)continue;d=" ";break}default:d=String.fromCharCode(u)}o=u===-2,i.push(d)}return i.join("")}function z4(e){const i={constructs:B0([A4,...(e||{}).extensions||[]]),content:o(Y3),defined:[],document:o(X3),flow:o(m4),lazy:{},string:o(x4),text:o(g4)};return i;function o(u){return d;function d(f){return E4(i,u,f)}}}function O4(e){for(;!F0(e););return e}const _y=/[\0\t\n\r]/g;function L4(){let e=1,l="",r=!0,i;return o;function o(u,d,f){const p=[];let h,y,g,v,k;for(u=l+(typeof u=="string"?u.toString():new TextDecoder(d||void 0).decode(u)),g=0,l="",r&&(u.charCodeAt(0)===65279&&g++,r=void 0);g<u.length;){if(_y.lastIndex=g,h=_y.exec(u),v=h&&h.index!==void 0?h.index:u.length,k=u.charCodeAt(v),!h){l=u.slice(g);break}if(k===10&&g===v&&i)p.push(-3),i=void 0;else switch(i&&(p.push(-5),i=void 0),g<v&&(p.push(u.slice(g,v)),e+=v-g),k){case 0:{p.push(65533),e++;break}case 9:{for(y=Math.ceil(e/4)*4,p.push(-2);e++<y;)p.push(-1);break}case 10:{p.push(-4),e=1;break}default:i=!0,e=1}g=v+1}return f&&(i&&p.push(-5),l&&p.push(l),p.push(null)),p}}const D4=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function _4(e){return e.replace(D4,B4)}function B4(e,l,r){if(l)return l;if(r.charCodeAt(0)===35){const o=r.charCodeAt(1),u=o===120||o===88;return I0(r.slice(u?2:1),u?16:10)}return nh(r)||e}const Q0={}.hasOwnProperty;function I4(e,l,r){return l&&typeof l=="object"&&(r=l,l=void 0),P4(r)(O4(z4(r).document().write(L4()(e,l,!0))))}function P4(e){const l={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:u(Ye),autolinkProtocol:ne,autolinkEmail:ne,atxHeading:u(ut),blockQuote:u(Ve),characterEscape:ne,characterReference:ne,codeFenced:u(_e),codeFencedFenceInfo:d,codeFencedFenceMeta:d,codeIndented:u(_e,d),codeText:u(Fe,d),codeTextData:ne,data:ne,codeFlowValue:ne,definition:u(it),definitionDestinationString:d,definitionLabelString:d,definitionTitleString:d,emphasis:u(rt),hardBreakEscape:u(st),hardBreakTrailing:u(st),htmlFlow:u(vt,d),htmlFlowData:ne,htmlText:u(vt,d),htmlTextData:ne,image:u(Ke),label:d,link:u(Ye),listItem:u(Me),listItemValue:v,listOrdered:u(et,g),listUnordered:u(et),paragraph:u(ot),reference:M,referenceString:d,resourceDestinationString:d,resourceTitleString:d,setextHeading:u(ut),strong:u(Ce),thematicBreak:u(mt)},exit:{atxHeading:p(),atxHeadingSequence:V,autolink:p(),autolinkEmail:Ne,autolinkProtocol:Se,blockQuote:p(),characterEscapeValue:O,characterReferenceMarkerHexadecimal:ge,characterReferenceMarkerNumeric:ge,characterReferenceValue:ce,characterReference:Re,codeFenced:p(N),codeFencedFence:A,codeFencedFenceInfo:k,codeFencedFenceMeta:S,codeFlowValue:O,codeIndented:p(R),codeText:p(J),codeTextData:O,data:O,definition:p(),definitionDestinationString:X,definitionLabelString:L,definitionTitleString:H,emphasis:p(),hardBreakEscape:p(Q),hardBreakTrailing:p(Q),htmlFlow:p(oe),htmlFlowData:O,htmlText:p(W),htmlTextData:O,image:p(Y),label:ve,labelText:G,lineEnding:P,link:p(w),listItem:p(),listOrdered:p(),listUnordered:p(),paragraph:p(),referenceString:pe,resourceDestinationString:T,resourceTitleString:B,resource:le,setextHeading:p(F),setextHeadingLineSequence:I,setextHeadingText:D,strong:p(),thematicBreak:p()}};X0(l,(e||{}).mdastExtensions||[]);const r={};return i;function i(ae){let be={type:"root",children:[]};const we={stack:[be],tokenStack:[],config:l,enter:f,exit:h,buffer:d,resume:y,data:r},ze=[];let We=-1;for(;++We<ae.length;)if(ae[We][1].type==="listOrdered"||ae[We][1].type==="listUnordered")if(ae[We][0]==="enter")ze.push(We);else{const Ae=ze.pop();We=o(ae,Ae,We)}for(We=-1;++We<ae.length;){const Ae=l[ae[We][0]];Q0.call(Ae,ae[We][1].type)&&Ae[ae[We][1].type].call(Object.assign({sliceSerialize:ae[We][2].sliceSerialize},we),ae[We][1])}if(we.tokenStack.length>0){const Ae=we.tokenStack[we.tokenStack.length-1];(Ae[1]||By).call(we,void 0,Ae[0])}for(be.position={start:pa(ae.length>0?ae[0][1].start:{line:1,column:1,offset:0}),end:pa(ae.length>0?ae[ae.length-2][1].end:{line:1,column:1,offset:0})},We=-1;++We<l.transforms.length;)be=l.transforms[We](be)||be;return be}function o(ae,be,we){let ze=be-1,We=-1,Ae=!1,ue,Te,q,de;for(;++ze<=we;){const ke=ae[ze];switch(ke[1].type){case"listUnordered":case"listOrdered":case"blockQuote":{ke[0]==="enter"?We++:We--,de=void 0;break}case"lineEndingBlank":{ke[0]==="enter"&&(ue&&!de&&!We&&!q&&(q=ze),de=void 0);break}case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:de=void 0}if(!We&&ke[0]==="enter"&&ke[1].type==="listItemPrefix"||We===-1&&ke[0]==="exit"&&(ke[1].type==="listUnordered"||ke[1].type==="listOrdered")){if(ue){let Qe=ze;for(Te=void 0;Qe--;){const Be=ae[Qe];if(Be[1].type==="lineEnding"||Be[1].type==="lineEndingBlank"){if(Be[0]==="exit")continue;Te&&(ae[Te][1].type="lineEndingBlank",Ae=!0),Be[1].type="lineEnding",Te=Qe}else if(!(Be[1].type==="linePrefix"||Be[1].type==="blockQuotePrefix"||Be[1].type==="blockQuotePrefixWhitespace"||Be[1].type==="blockQuoteMarker"||Be[1].type==="listItemIndent"))break}q&&(!Te||q<Te)&&(ue._spread=!0),ue.end=Object.assign({},Te?ae[Te][1].start:ke[1].end),ae.splice(Te||ze,0,["exit",ue,ke[2]]),ze++,we++}if(ke[1].type==="listItemPrefix"){const Qe={type:"listItem",_spread:!1,start:Object.assign({},ke[1].start),end:void 0};ue=Qe,ae.splice(ze,0,["enter",Qe,ke[2]]),ze++,we++,q=void 0,de=!0}}}return ae[be][1]._spread=Ae,we}function u(ae,be){return we;function we(ze){f.call(this,ae(ze),ze),be&&be.call(this,ze)}}function d(){this.stack.push({type:"fragment",children:[]})}function f(ae,be,we){this.stack[this.stack.length-1].children.push(ae),this.stack.push(ae),this.tokenStack.push([be,we||void 0]),ae.position={start:pa(be.start),end:void 0}}function p(ae){return be;function be(we){ae&&ae.call(this,we),h.call(this,we)}}function h(ae,be){const we=this.stack.pop(),ze=this.tokenStack.pop();if(ze)ze[0].type!==ae.type&&(be?be.call(this,ae,ze[0]):(ze[1]||By).call(this,ae,ze[0]));else throw new Error("Cannot close `"+ae.type+"` ("+vo({start:ae.start,end:ae.end})+"): it’s not open");we.position.end=pa(ae.end)}function y(){return th(this.stack.pop())}function g(){this.data.expectingFirstListItemValue=!0}function v(ae){if(this.data.expectingFirstListItemValue){const be=this.stack[this.stack.length-2];be.start=Number.parseInt(this.sliceSerialize(ae),10),this.data.expectingFirstListItemValue=void 0}}function k(){const ae=this.resume(),be=this.stack[this.stack.length-1];be.lang=ae}function S(){const ae=this.resume(),be=this.stack[this.stack.length-1];be.meta=ae}function A(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function N(){const ae=this.resume(),be=this.stack[this.stack.length-1];be.value=ae.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}function R(){const ae=this.resume(),be=this.stack[this.stack.length-1];be.value=ae.replace(/(\r?\n|\r)$/g,"")}function L(ae){const be=this.resume(),we=this.stack[this.stack.length-1];we.label=be,we.identifier=Il(this.sliceSerialize(ae)).toLowerCase()}function H(){const ae=this.resume(),be=this.stack[this.stack.length-1];be.title=ae}function X(){const ae=this.resume(),be=this.stack[this.stack.length-1];be.url=ae}function V(ae){const be=this.stack[this.stack.length-1];if(!be.depth){const we=this.sliceSerialize(ae).length;be.depth=we}}function D(){this.data.setextHeadingSlurpLineEnding=!0}function I(ae){const be=this.stack[this.stack.length-1];be.depth=this.sliceSerialize(ae).codePointAt(0)===61?1:2}function F(){this.data.setextHeadingSlurpLineEnding=void 0}function ne(ae){const we=this.stack[this.stack.length-1].children;let ze=we[we.length-1];(!ze||ze.type!=="text")&&(ze=nt(),ze.position={start:pa(ae.start),end:void 0},we.push(ze)),this.stack.push(ze)}function O(ae){const be=this.stack.pop();be.value+=this.sliceSerialize(ae),be.position.end=pa(ae.end)}function P(ae){const be=this.stack[this.stack.length-1];if(this.data.atHardBreak){const we=be.children[be.children.length-1];we.position.end=pa(ae.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&l.canContainEols.includes(be.type)&&(ne.call(this,ae),O.call(this,ae))}function Q(){this.data.atHardBreak=!0}function oe(){const ae=this.resume(),be=this.stack[this.stack.length-1];be.value=ae}function W(){const ae=this.resume(),be=this.stack[this.stack.length-1];be.value=ae}function J(){const ae=this.resume(),be=this.stack[this.stack.length-1];be.value=ae}function w(){const ae=this.stack[this.stack.length-1];if(this.data.inReference){const be=this.data.referenceType||"shortcut";ae.type+="Reference",ae.referenceType=be,delete ae.url,delete ae.title}else delete ae.identifier,delete ae.label;this.data.referenceType=void 0}function Y(){const ae=this.stack[this.stack.length-1];if(this.data.inReference){const be=this.data.referenceType||"shortcut";ae.type+="Reference",ae.referenceType=be,delete ae.url,delete ae.title}else delete ae.identifier,delete ae.label;this.data.referenceType=void 0}function G(ae){const be=this.sliceSerialize(ae),we=this.stack[this.stack.length-2];we.label=_4(be),we.identifier=Il(be).toLowerCase()}function ve(){const ae=this.stack[this.stack.length-1],be=this.resume(),we=this.stack[this.stack.length-1];if(this.data.inReference=!0,we.type==="link"){const ze=ae.children;we.children=ze}else we.alt=be}function T(){const ae=this.resume(),be=this.stack[this.stack.length-1];be.url=ae}function B(){const ae=this.resume(),be=this.stack[this.stack.length-1];be.title=ae}function le(){this.data.inReference=void 0}function M(){this.data.referenceType="collapsed"}function pe(ae){const be=this.resume(),we=this.stack[this.stack.length-1];we.label=be,we.identifier=Il(this.sliceSerialize(ae)).toLowerCase(),this.data.referenceType="full"}function ge(ae){this.data.characterReferenceType=ae.type}function ce(ae){const be=this.sliceSerialize(ae),we=this.data.characterReferenceType;let ze;we?(ze=I0(be,we==="characterReferenceMarkerNumeric"?10:16),this.data.characterReferenceType=void 0):ze=nh(be);const We=this.stack[this.stack.length-1];We.value+=ze}function Re(ae){const be=this.stack.pop();be.position.end=pa(ae.end)}function Se(ae){O.call(this,ae);const be=this.stack[this.stack.length-1];be.url=this.sliceSerialize(ae)}function Ne(ae){O.call(this,ae);const be=this.stack[this.stack.length-1];be.url="mailto:"+this.sliceSerialize(ae)}function Ve(){return{type:"blockquote",children:[]}}function _e(){return{type:"code",lang:null,meta:null,value:""}}function Fe(){return{type:"inlineCode",value:""}}function it(){return{type:"definition",identifier:"",label:null,title:null,url:""}}function rt(){return{type:"emphasis",children:[]}}function ut(){return{type:"heading",depth:0,children:[]}}function st(){return{type:"break"}}function vt(){return{type:"html",value:""}}function Ke(){return{type:"image",title:null,url:"",alt:null}}function Ye(){return{type:"link",title:null,url:"",children:[]}}function et(ae){return{type:"list",ordered:ae.type==="listOrdered",start:null,spread:ae._spread,children:[]}}function Me(ae){return{type:"listItem",spread:ae._spread,checked:null,children:[]}}function ot(){return{type:"paragraph",children:[]}}function Ce(){return{type:"strong",children:[]}}function nt(){return{type:"text",value:""}}function mt(){return{type:"thematicBreak"}}}function pa(e){return{line:e.line,column:e.column,offset:e.offset}}function X0(e,l){let r=-1;for(;++r<l.length;){const i=l[r];Array.isArray(i)?X0(e,i):U4(e,i)}}function U4(e,l){let r;for(r in l)if(Q0.call(l,r))switch(r){case"canContainEols":{const i=l[r];i&&e[r].push(...i);break}case"transforms":{const i=l[r];i&&e[r].push(...i);break}case"enter":case"exit":{const i=l[r];i&&Object.assign(e[r],i);break}}}function By(e,l){throw e?new Error("Cannot close `"+e.type+"` ("+vo({start:e.start,end:e.end})+"): a different token (`"+l.type+"`, "+vo({start:l.start,end:l.end})+") is open"):new Error("Cannot close document, a token (`"+l.type+"`, "+vo({start:l.start,end:l.end})+") is still open")}function H4(e){const l=this;l.parser=r;function r(i){return I4(i,{...l.data("settings"),...e,extensions:l.data("micromarkExtensions")||[],mdastExtensions:l.data("fromMarkdownExtensions")||[]})}}function F4(e,l){const r={type:"element",tagName:"blockquote",properties:{},children:e.wrap(e.all(l),!0)};return e.patch(l,r),e.applyData(l,r)}function q4(e,l){const r={type:"element",tagName:"br",properties:{},children:[]};return e.patch(l,r),[e.applyData(l,r),{type:"text",value:`
66
+ `}]}function V4(e,l){const r=l.value?l.value+`
67
+ `:"",i={},o=l.lang?l.lang.split(/\s+/):[];o.length>0&&(i.className=["language-"+o[0]]);let u={type:"element",tagName:"code",properties:i,children:[{type:"text",value:r}]};return l.meta&&(u.data={meta:l.meta}),e.patch(l,u),u=e.applyData(l,u),u={type:"element",tagName:"pre",properties:{},children:[u]},e.patch(l,u),u}function $4(e,l){const r={type:"element",tagName:"del",properties:{},children:e.all(l)};return e.patch(l,r),e.applyData(l,r)}function G4(e,l){const r={type:"element",tagName:"em",properties:{},children:e.all(l)};return e.patch(l,r),e.applyData(l,r)}function Y4(e,l){const r=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",i=String(l.identifier).toUpperCase(),o=cs(i.toLowerCase()),u=e.footnoteOrder.indexOf(i);let d,f=e.footnoteCounts.get(i);f===void 0?(f=0,e.footnoteOrder.push(i),d=e.footnoteOrder.length):d=u+1,f+=1,e.footnoteCounts.set(i,f);const p={type:"element",tagName:"a",properties:{href:"#"+r+"fn-"+o,id:r+"fnref-"+o+(f>1?"-"+f:""),dataFootnoteRef:!0,ariaDescribedBy:["footnote-label"]},children:[{type:"text",value:String(d)}]};e.patch(l,p);const h={type:"element",tagName:"sup",properties:{},children:[p]};return e.patch(l,h),e.applyData(l,h)}function Q4(e,l){const r={type:"element",tagName:"h"+l.depth,properties:{},children:e.all(l)};return e.patch(l,r),e.applyData(l,r)}function X4(e,l){if(e.options.allowDangerousHtml){const r={type:"raw",value:l.value};return e.patch(l,r),e.applyData(l,r)}}function K0(e,l){const r=l.referenceType;let i="]";if(r==="collapsed"?i+="[]":r==="full"&&(i+="["+(l.label||l.identifier)+"]"),l.type==="imageReference")return[{type:"text",value:"!["+l.alt+i}];const o=e.all(l),u=o[0];u&&u.type==="text"?u.value="["+u.value:o.unshift({type:"text",value:"["});const d=o[o.length-1];return d&&d.type==="text"?d.value+=i:o.push({type:"text",value:i}),o}function K4(e,l){const r=String(l.identifier).toUpperCase(),i=e.definitionById.get(r);if(!i)return K0(e,l);const o={src:cs(i.url||""),alt:l.alt};i.title!==null&&i.title!==void 0&&(o.title=i.title);const u={type:"element",tagName:"img",properties:o,children:[]};return e.patch(l,u),e.applyData(l,u)}function Z4(e,l){const r={src:cs(l.url)};l.alt!==null&&l.alt!==void 0&&(r.alt=l.alt),l.title!==null&&l.title!==void 0&&(r.title=l.title);const i={type:"element",tagName:"img",properties:r,children:[]};return e.patch(l,i),e.applyData(l,i)}function W4(e,l){const r={type:"text",value:l.value.replace(/\r?\n|\r/g," ")};e.patch(l,r);const i={type:"element",tagName:"code",properties:{},children:[r]};return e.patch(l,i),e.applyData(l,i)}function J4(e,l){const r=String(l.identifier).toUpperCase(),i=e.definitionById.get(r);if(!i)return K0(e,l);const o={href:cs(i.url||"")};i.title!==null&&i.title!==void 0&&(o.title=i.title);const u={type:"element",tagName:"a",properties:o,children:e.all(l)};return e.patch(l,u),e.applyData(l,u)}function eE(e,l){const r={href:cs(l.url)};l.title!==null&&l.title!==void 0&&(r.title=l.title);const i={type:"element",tagName:"a",properties:r,children:e.all(l)};return e.patch(l,i),e.applyData(l,i)}function tE(e,l,r){const i=e.all(l),o=r?nE(r):Z0(l),u={},d=[];if(typeof l.checked=="boolean"){const y=i[0];let g;y&&y.type==="element"&&y.tagName==="p"?g=y:(g={type:"element",tagName:"p",properties:{},children:[]},i.unshift(g)),g.children.length>0&&g.children.unshift({type:"text",value:" "}),g.children.unshift({type:"element",tagName:"input",properties:{type:"checkbox",checked:l.checked,disabled:!0},children:[]}),u.className=["task-list-item"]}let f=-1;for(;++f<i.length;){const y=i[f];(o||f!==0||y.type!=="element"||y.tagName!=="p")&&d.push({type:"text",value:`
68
+ `}),y.type==="element"&&y.tagName==="p"&&!o?d.push(...y.children):d.push(y)}const p=i[i.length-1];p&&(o||p.type!=="element"||p.tagName!=="p")&&d.push({type:"text",value:`
69
+ `});const h={type:"element",tagName:"li",properties:u,children:d};return e.patch(l,h),e.applyData(l,h)}function nE(e){let l=!1;if(e.type==="list"){l=e.spread||!1;const r=e.children;let i=-1;for(;!l&&++i<r.length;)l=Z0(r[i])}return l}function Z0(e){const l=e.spread;return l??e.children.length>1}function lE(e,l){const r={},i=e.all(l);let o=-1;for(typeof l.start=="number"&&l.start!==1&&(r.start=l.start);++o<i.length;){const d=i[o];if(d.type==="element"&&d.tagName==="li"&&d.properties&&Array.isArray(d.properties.className)&&d.properties.className.includes("task-list-item")){r.className=["contains-task-list"];break}}const u={type:"element",tagName:l.ordered?"ol":"ul",properties:r,children:e.wrap(i,!0)};return e.patch(l,u),e.applyData(l,u)}function rE(e,l){const r={type:"element",tagName:"p",properties:{},children:e.all(l)};return e.patch(l,r),e.applyData(l,r)}function aE(e,l){const r={type:"root",children:e.wrap(e.all(l))};return e.patch(l,r),e.applyData(l,r)}function iE(e,l){const r={type:"element",tagName:"strong",properties:{},children:e.all(l)};return e.patch(l,r),e.applyData(l,r)}function sE(e,l){const r=e.all(l),i=r.shift(),o=[];if(i){const d={type:"element",tagName:"thead",properties:{},children:e.wrap([i],!0)};e.patch(l.children[0],d),o.push(d)}if(r.length>0){const d={type:"element",tagName:"tbody",properties:{},children:e.wrap(r,!0)},f=Zp(l.children[1]),p=R0(l.children[l.children.length-1]);f&&p&&(d.position={start:f,end:p}),o.push(d)}const u={type:"element",tagName:"table",properties:{},children:e.wrap(o,!0)};return e.patch(l,u),e.applyData(l,u)}function oE(e,l,r){const i=r?r.children:void 0,u=(i?i.indexOf(l):1)===0?"th":"td",d=r&&r.type==="table"?r.align:void 0,f=d?d.length:l.children.length;let p=-1;const h=[];for(;++p<f;){const g=l.children[p],v={},k=d?d[p]:void 0;k&&(v.align=k);let S={type:"element",tagName:u,properties:v,children:[]};g&&(S.children=e.all(g),e.patch(g,S),S=e.applyData(g,S)),h.push(S)}const y={type:"element",tagName:"tr",properties:{},children:e.wrap(h,!0)};return e.patch(l,y),e.applyData(l,y)}function cE(e,l){const r={type:"element",tagName:"td",properties:{},children:e.all(l)};return e.patch(l,r),e.applyData(l,r)}const Iy=9,Py=32;function uE(e){const l=String(e),r=/\r?\n|\r/g;let i=r.exec(l),o=0;const u=[];for(;i;)u.push(Uy(l.slice(o,i.index),o>0,!0),i[0]),o=i.index+i[0].length,i=r.exec(l);return u.push(Uy(l.slice(o),o>0,!1)),u.join("")}function Uy(e,l,r){let i=0,o=e.length;if(l){let u=e.codePointAt(i);for(;u===Iy||u===Py;)i++,u=e.codePointAt(i)}if(r){let u=e.codePointAt(o-1);for(;u===Iy||u===Py;)o--,u=e.codePointAt(o-1)}return o>i?e.slice(i,o):""}function dE(e,l){const r={type:"text",value:uE(String(l.value))};return e.patch(l,r),e.applyData(l,r)}function fE(e,l){const r={type:"element",tagName:"hr",properties:{},children:[]};return e.patch(l,r),e.applyData(l,r)}const mE={blockquote:F4,break:q4,code:V4,delete:$4,emphasis:G4,footnoteReference:Y4,heading:Q4,html:X4,imageReference:K4,image:Z4,inlineCode:W4,linkReference:J4,link:eE,listItem:tE,list:lE,paragraph:rE,root:aE,strong:iE,table:sE,tableCell:cE,tableRow:oE,text:dE,thematicBreak:fE,toml:pu,yaml:pu,definition:pu,footnoteDefinition:pu};function pu(){}const W0=-1,Qu=0,ko=1,Bu=2,rh=3,ah=4,ih=5,sh=6,J0=7,ej=8,Hy=typeof self=="object"?self:globalThis,pE=(e,l)=>{const r=(o,u)=>(e.set(u,o),o),i=o=>{if(e.has(o))return e.get(o);const[u,d]=l[o];switch(u){case Qu:case W0:return r(d,o);case ko:{const f=r([],o);for(const p of d)f.push(i(p));return f}case Bu:{const f=r({},o);for(const[p,h]of d)f[i(p)]=i(h);return f}case rh:return r(new Date(d),o);case ah:{const{source:f,flags:p}=d;return r(new RegExp(f,p),o)}case ih:{const f=r(new Map,o);for(const[p,h]of d)f.set(i(p),i(h));return f}case sh:{const f=r(new Set,o);for(const p of d)f.add(i(p));return f}case J0:{const{name:f,message:p}=d;return r(new Hy[f](p),o)}case ej:return r(BigInt(d),o);case"BigInt":return r(Object(BigInt(d)),o);case"ArrayBuffer":return r(new Uint8Array(d).buffer,d);case"DataView":{const{buffer:f}=new Uint8Array(d);return r(new DataView(f),d)}}return r(new Hy[u](d),o)};return i},Fy=e=>pE(new Map,e)(0),Zi="",{toString:hE}={},{keys:xE}=Object,go=e=>{const l=typeof e;if(l!=="object"||!e)return[Qu,l];const r=hE.call(e).slice(8,-1);switch(r){case"Array":return[ko,Zi];case"Object":return[Bu,Zi];case"Date":return[rh,Zi];case"RegExp":return[ah,Zi];case"Map":return[ih,Zi];case"Set":return[sh,Zi];case"DataView":return[ko,r]}return r.includes("Array")?[ko,r]:r.includes("Error")?[J0,r]:[Bu,r]},hu=([e,l])=>e===Qu&&(l==="function"||l==="symbol"),gE=(e,l,r,i)=>{const o=(d,f)=>{const p=i.push(d)-1;return r.set(f,p),p},u=d=>{if(r.has(d))return r.get(d);let[f,p]=go(d);switch(f){case Qu:{let y=d;switch(p){case"bigint":f=ej,y=d.toString();break;case"function":case"symbol":if(e)throw new TypeError("unable to serialize "+p);y=null;break;case"undefined":return o([W0],d)}return o([f,y],d)}case ko:{if(p){let v=d;return p==="DataView"?v=new Uint8Array(d.buffer):p==="ArrayBuffer"&&(v=new Uint8Array(d)),o([p,[...v]],d)}const y=[],g=o([f,y],d);for(const v of d)y.push(u(v));return g}case Bu:{if(p)switch(p){case"BigInt":return o([p,d.toString()],d);case"Boolean":case"Number":case"String":return o([p,d.valueOf()],d)}if(l&&"toJSON"in d)return u(d.toJSON());const y=[],g=o([f,y],d);for(const v of xE(d))(e||!hu(go(d[v])))&&y.push([u(v),u(d[v])]);return g}case rh:return o([f,d.toISOString()],d);case ah:{const{source:y,flags:g}=d;return o([f,{source:y,flags:g}],d)}case ih:{const y=[],g=o([f,y],d);for(const[v,k]of d)(e||!(hu(go(v))||hu(go(k))))&&y.push([u(v),u(k)]);return g}case sh:{const y=[],g=o([f,y],d);for(const v of d)(e||!hu(go(v)))&&y.push(u(v));return g}}const{message:h}=d;return o([f,{name:p,message:h}],d)};return u},qy=(e,{json:l,lossy:r}={})=>{const i=[];return gE(!(l||r),!!l,new Map,i)(e),i},Iu=typeof structuredClone=="function"?(e,l)=>l&&("json"in l||"lossy"in l)?Fy(qy(e,l)):structuredClone(e):(e,l)=>Fy(qy(e,l));function bE(e,l){const r=[{type:"text",value:"↩"}];return l>1&&r.push({type:"element",tagName:"sup",properties:{},children:[{type:"text",value:String(l)}]}),r}function yE(e,l){return"Back to reference "+(e+1)+(l>1?"-"+l:"")}function vE(e){const l=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",r=e.options.footnoteBackContent||bE,i=e.options.footnoteBackLabel||yE,o=e.options.footnoteLabel||"Footnotes",u=e.options.footnoteLabelTagName||"h2",d=e.options.footnoteLabelProperties||{className:["sr-only"]},f=[];let p=-1;for(;++p<e.footnoteOrder.length;){const h=e.footnoteById.get(e.footnoteOrder[p]);if(!h)continue;const y=e.all(h),g=String(h.identifier).toUpperCase(),v=cs(g.toLowerCase());let k=0;const S=[],A=e.footnoteCounts.get(g);for(;A!==void 0&&++k<=A;){S.length>0&&S.push({type:"text",value:" "});let L=typeof r=="string"?r:r(p,k);typeof L=="string"&&(L={type:"text",value:L}),S.push({type:"element",tagName:"a",properties:{href:"#"+l+"fnref-"+v+(k>1?"-"+k:""),dataFootnoteBackref:"",ariaLabel:typeof i=="string"?i:i(p,k),className:["data-footnote-backref"]},children:Array.isArray(L)?L:[L]})}const N=y[y.length-1];if(N&&N.type==="element"&&N.tagName==="p"){const L=N.children[N.children.length-1];L&&L.type==="text"?L.value+=" ":N.children.push({type:"text",value:" "}),N.children.push(...S)}else y.push(...S);const R={type:"element",tagName:"li",properties:{id:l+"fn-"+v},children:e.wrap(y,!0)};e.patch(h,R),f.push(R)}if(f.length!==0)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:u,properties:{...Iu(d),id:"footnote-label"},children:[{type:"text",value:o}]},{type:"text",value:`
70
+ `},{type:"element",tagName:"ol",properties:{},children:e.wrap(f,!0)},{type:"text",value:`
71
+ `}]}}const Xu=(function(e){if(e==null)return wE;if(typeof e=="function")return Ku(e);if(typeof e=="object")return Array.isArray(e)?jE(e):kE(e);if(typeof e=="string")return NE(e);throw new Error("Expected function, string, or object as test")});function jE(e){const l=[];let r=-1;for(;++r<e.length;)l[r]=Xu(e[r]);return Ku(i);function i(...o){let u=-1;for(;++u<l.length;)if(l[u].apply(this,o))return!0;return!1}}function kE(e){const l=e;return Ku(r);function r(i){const o=i;let u;for(u in e)if(o[u]!==l[u])return!1;return!0}}function NE(e){return Ku(l);function l(r){return r&&r.type===e}}function Ku(e){return l;function l(r,i,o){return!!(SE(r)&&e.call(this,r,typeof i=="number"?i:void 0,o||void 0))}}function wE(){return!0}function SE(e){return e!==null&&typeof e=="object"&&"type"in e}const tj=[],CE=!0,gp=!1,TE="skip";function nj(e,l,r,i){let o;typeof l=="function"&&typeof r!="function"?(i=r,r=l):o=l;const u=Xu(o),d=i?-1:1;f(e,void 0,[])();function f(p,h,y){const g=p&&typeof p=="object"?p:{};if(typeof g.type=="string"){const k=typeof g.tagName=="string"?g.tagName:typeof g.name=="string"?g.name:void 0;Object.defineProperty(v,"name",{value:"node ("+(p.type+(k?"<"+k+">":""))+")"})}return v;function v(){let k=tj,S,A,N;if((!l||u(p,h,y[y.length-1]||void 0))&&(k=AE(r(p,y)),k[0]===gp))return k;if("children"in p&&p.children){const R=p;if(R.children&&k[0]!==TE)for(A=(i?R.children.length:-1)+d,N=y.concat(R);A>-1&&A<R.children.length;){const L=R.children[A];if(S=f(L,A,N)(),S[0]===gp)return S;A=typeof S[1]=="number"?S[1]:A+d}}return k}}}function AE(e){return Array.isArray(e)?e:typeof e=="number"?[CE,e]:e==null?tj:[e]}function oh(e,l,r,i){let o,u,d;typeof l=="function"&&typeof r!="function"?(u=void 0,d=l,o=r):(u=l,d=r,o=i),nj(e,u,f,o);function f(p,h){const y=h[h.length-1],g=y?y.children.indexOf(p):void 0;return d(p,g,y)}}const bp={}.hasOwnProperty,EE={};function RE(e,l){const r=l||EE,i=new Map,o=new Map,u=new Map,d={...mE,...r.handlers},f={all:h,applyData:zE,definitionById:i,footnoteById:o,footnoteCounts:u,footnoteOrder:[],handlers:d,one:p,options:r,patch:ME,wrap:LE};return oh(e,function(y){if(y.type==="definition"||y.type==="footnoteDefinition"){const g=y.type==="definition"?i:o,v=String(y.identifier).toUpperCase();g.has(v)||g.set(v,y)}}),f;function p(y,g){const v=y.type,k=f.handlers[v];if(bp.call(f.handlers,v)&&k)return k(f,y,g);if(f.options.passThrough&&f.options.passThrough.includes(v)){if("children"in y){const{children:A,...N}=y,R=Iu(N);return R.children=f.all(y),R}return Iu(y)}return(f.options.unknownHandler||OE)(f,y,g)}function h(y){const g=[];if("children"in y){const v=y.children;let k=-1;for(;++k<v.length;){const S=f.one(v[k],y);if(S){if(k&&v[k-1].type==="break"&&(!Array.isArray(S)&&S.type==="text"&&(S.value=Vy(S.value)),!Array.isArray(S)&&S.type==="element")){const A=S.children[0];A&&A.type==="text"&&(A.value=Vy(A.value))}Array.isArray(S)?g.push(...S):g.push(S)}}}return g}}function ME(e,l){e.position&&(l.position=y3(e))}function zE(e,l){let r=l;if(e&&e.data){const i=e.data.hName,o=e.data.hChildren,u=e.data.hProperties;if(typeof i=="string")if(r.type==="element")r.tagName=i;else{const d="children"in r?r.children:[r];r={type:"element",tagName:i,properties:{},children:d}}r.type==="element"&&u&&Object.assign(r.properties,Iu(u)),"children"in r&&r.children&&o!==null&&o!==void 0&&(r.children=o)}return r}function OE(e,l){const r=l.data||{},i="value"in l&&!(bp.call(r,"hProperties")||bp.call(r,"hChildren"))?{type:"text",value:l.value}:{type:"element",tagName:"div",properties:{},children:e.all(l)};return e.patch(l,i),e.applyData(l,i)}function LE(e,l){const r=[];let i=-1;for(l&&r.push({type:"text",value:`
72
+ `});++i<e.length;)i&&r.push({type:"text",value:`
73
+ `}),r.push(e[i]);return l&&e.length>0&&r.push({type:"text",value:`
74
+ `}),r}function Vy(e){let l=0,r=e.charCodeAt(l);for(;r===9||r===32;)l++,r=e.charCodeAt(l);return e.slice(l)}function $y(e,l){const r=RE(e,l),i=r.one(e,void 0),o=vE(r),u=Array.isArray(i)?{type:"root",children:i}:i||{type:"root",children:[]};return o&&u.children.push({type:"text",value:`
75
+ `},o),u}function DE(e,l){return e&&"run"in e?async function(r,i){const o=$y(r,{file:i,...l});await e.run(o,i)}:function(r,i){return $y(r,{file:i,...e||l})}}function Gy(e){if(e)throw e}var Im,Yy;function _E(){if(Yy)return Im;Yy=1;var e=Object.prototype.hasOwnProperty,l=Object.prototype.toString,r=Object.defineProperty,i=Object.getOwnPropertyDescriptor,o=function(h){return typeof Array.isArray=="function"?Array.isArray(h):l.call(h)==="[object Array]"},u=function(h){if(!h||l.call(h)!=="[object Object]")return!1;var y=e.call(h,"constructor"),g=h.constructor&&h.constructor.prototype&&e.call(h.constructor.prototype,"isPrototypeOf");if(h.constructor&&!y&&!g)return!1;var v;for(v in h);return typeof v>"u"||e.call(h,v)},d=function(h,y){r&&y.name==="__proto__"?r(h,y.name,{enumerable:!0,configurable:!0,value:y.newValue,writable:!0}):h[y.name]=y.newValue},f=function(h,y){if(y==="__proto__")if(e.call(h,y)){if(i)return i(h,y).value}else return;return h[y]};return Im=function p(){var h,y,g,v,k,S,A=arguments[0],N=1,R=arguments.length,L=!1;for(typeof A=="boolean"&&(L=A,A=arguments[1]||{},N=2),(A==null||typeof A!="object"&&typeof A!="function")&&(A={});N<R;++N)if(h=arguments[N],h!=null)for(y in h)g=f(A,y),v=f(h,y),A!==v&&(L&&v&&(u(v)||(k=o(v)))?(k?(k=!1,S=g&&o(g)?g:[]):S=g&&u(g)?g:{},d(A,{name:y,newValue:p(L,S,v)})):typeof v<"u"&&d(A,{name:y,newValue:v}));return A},Im}var BE=_E();const Pm=Uu(BE);function yp(e){if(typeof e!="object"||e===null)return!1;const l=Object.getPrototypeOf(e);return(l===null||l===Object.prototype||Object.getPrototypeOf(l)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)}function IE(){const e=[],l={run:r,use:i};return l;function r(...o){let u=-1;const d=o.pop();if(typeof d!="function")throw new TypeError("Expected function as last argument, not "+d);f(null,...o);function f(p,...h){const y=e[++u];let g=-1;if(p){d(p);return}for(;++g<o.length;)(h[g]===null||h[g]===void 0)&&(h[g]=o[g]);o=h,y?PE(y,f)(...h):d(null,...h)}}function i(o){if(typeof o!="function")throw new TypeError("Expected `middelware` to be a function, not "+o);return e.push(o),l}}function PE(e,l){let r;return i;function i(...d){const f=e.length>d.length;let p;f&&d.push(o);try{p=e.apply(this,d)}catch(h){const y=h;if(f&&r)throw y;return o(y)}f||(p&&p.then&&typeof p.then=="function"?p.then(u,o):p instanceof Error?o(p):u(p))}function o(d,...f){r||(r=!0,l(d,...f))}function u(d){o(null,d)}}const Kl={basename:UE,dirname:HE,extname:FE,join:qE,sep:"/"};function UE(e,l){if(l!==void 0&&typeof l!="string")throw new TypeError('"ext" argument must be a string');Bo(e);let r=0,i=-1,o=e.length,u;if(l===void 0||l.length===0||l.length>e.length){for(;o--;)if(e.codePointAt(o)===47){if(u){r=o+1;break}}else i<0&&(u=!0,i=o+1);return i<0?"":e.slice(r,i)}if(l===e)return"";let d=-1,f=l.length-1;for(;o--;)if(e.codePointAt(o)===47){if(u){r=o+1;break}}else d<0&&(u=!0,d=o+1),f>-1&&(e.codePointAt(o)===l.codePointAt(f--)?f<0&&(i=o):(f=-1,i=d));return r===i?i=d:i<0&&(i=e.length),e.slice(r,i)}function HE(e){if(Bo(e),e.length===0)return".";let l=-1,r=e.length,i;for(;--r;)if(e.codePointAt(r)===47){if(i){l=r;break}}else i||(i=!0);return l<0?e.codePointAt(0)===47?"/":".":l===1&&e.codePointAt(0)===47?"//":e.slice(0,l)}function FE(e){Bo(e);let l=e.length,r=-1,i=0,o=-1,u=0,d;for(;l--;){const f=e.codePointAt(l);if(f===47){if(d){i=l+1;break}continue}r<0&&(d=!0,r=l+1),f===46?o<0?o=l:u!==1&&(u=1):o>-1&&(u=-1)}return o<0||r<0||u===0||u===1&&o===r-1&&o===i+1?"":e.slice(o,r)}function qE(...e){let l=-1,r;for(;++l<e.length;)Bo(e[l]),e[l]&&(r=r===void 0?e[l]:r+"/"+e[l]);return r===void 0?".":VE(r)}function VE(e){Bo(e);const l=e.codePointAt(0)===47;let r=$E(e,!l);return r.length===0&&!l&&(r="."),r.length>0&&e.codePointAt(e.length-1)===47&&(r+="/"),l?"/"+r:r}function $E(e,l){let r="",i=0,o=-1,u=0,d=-1,f,p;for(;++d<=e.length;){if(d<e.length)f=e.codePointAt(d);else{if(f===47)break;f=47}if(f===47){if(!(o===d-1||u===1))if(o!==d-1&&u===2){if(r.length<2||i!==2||r.codePointAt(r.length-1)!==46||r.codePointAt(r.length-2)!==46){if(r.length>2){if(p=r.lastIndexOf("/"),p!==r.length-1){p<0?(r="",i=0):(r=r.slice(0,p),i=r.length-1-r.lastIndexOf("/")),o=d,u=0;continue}}else if(r.length>0){r="",i=0,o=d,u=0;continue}}l&&(r=r.length>0?r+"/..":"..",i=2)}else r.length>0?r+="/"+e.slice(o+1,d):r=e.slice(o+1,d),i=d-o-1;o=d,u=0}else f===46&&u>-1?u++:u=-1}return r}function Bo(e){if(typeof e!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}const GE={cwd:YE};function YE(){return"/"}function vp(e){return!!(e!==null&&typeof e=="object"&&"href"in e&&e.href&&"protocol"in e&&e.protocol&&e.auth===void 0)}function QE(e){if(typeof e=="string")e=new URL(e);else if(!vp(e)){const l=new TypeError('The "path" argument must be of type string or an instance of URL. Received `'+e+"`");throw l.code="ERR_INVALID_ARG_TYPE",l}if(e.protocol!=="file:"){const l=new TypeError("The URL must be of scheme file");throw l.code="ERR_INVALID_URL_SCHEME",l}return XE(e)}function XE(e){if(e.hostname!==""){const i=new TypeError('File URL host must be "localhost" or empty on darwin');throw i.code="ERR_INVALID_FILE_URL_HOST",i}const l=e.pathname;let r=-1;for(;++r<l.length;)if(l.codePointAt(r)===37&&l.codePointAt(r+1)===50){const i=l.codePointAt(r+2);if(i===70||i===102){const o=new TypeError("File URL path must not include encoded / characters");throw o.code="ERR_INVALID_FILE_URL_PATH",o}}return decodeURIComponent(l)}const Um=["history","path","basename","stem","extname","dirname"];class lj{constructor(l){let r;l?vp(l)?r={path:l}:typeof l=="string"||KE(l)?r={value:l}:r=l:r={},this.cwd="cwd"in r?"":GE.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let i=-1;for(;++i<Um.length;){const u=Um[i];u in r&&r[u]!==void 0&&r[u]!==null&&(this[u]=u==="history"?[...r[u]]:r[u])}let o;for(o in r)Um.includes(o)||(this[o]=r[o])}get basename(){return typeof this.path=="string"?Kl.basename(this.path):void 0}set basename(l){Fm(l,"basename"),Hm(l,"basename"),this.path=Kl.join(this.dirname||"",l)}get dirname(){return typeof this.path=="string"?Kl.dirname(this.path):void 0}set dirname(l){Qy(this.basename,"dirname"),this.path=Kl.join(l||"",this.basename)}get extname(){return typeof this.path=="string"?Kl.extname(this.path):void 0}set extname(l){if(Hm(l,"extname"),Qy(this.dirname,"extname"),l){if(l.codePointAt(0)!==46)throw new Error("`extname` must start with `.`");if(l.includes(".",1))throw new Error("`extname` cannot contain multiple dots")}this.path=Kl.join(this.dirname,this.stem+(l||""))}get path(){return this.history[this.history.length-1]}set path(l){vp(l)&&(l=QE(l)),Fm(l,"path"),this.path!==l&&this.history.push(l)}get stem(){return typeof this.path=="string"?Kl.basename(this.path,this.extname):void 0}set stem(l){Fm(l,"stem"),Hm(l,"stem"),this.path=Kl.join(this.dirname||"",l+(this.extname||""))}fail(l,r,i){const o=this.message(l,r,i);throw o.fatal=!0,o}info(l,r,i){const o=this.message(l,r,i);return o.fatal=void 0,o}message(l,r,i){const o=new On(l,r,i);return this.path&&(o.name=this.path+":"+o.name,o.file=this.path),o.fatal=!1,this.messages.push(o),o}toString(l){return this.value===void 0?"":typeof this.value=="string"?this.value:new TextDecoder(l||void 0).decode(this.value)}}function Hm(e,l){if(e&&e.includes(Kl.sep))throw new Error("`"+l+"` cannot be a path: did not expect `"+Kl.sep+"`")}function Fm(e,l){if(!e)throw new Error("`"+l+"` cannot be empty")}function Qy(e,l){if(!e)throw new Error("Setting `"+l+"` requires `path` to be set too")}function KE(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const ZE=(function(e){const i=this.constructor.prototype,o=i[e],u=function(){return o.apply(u,arguments)};return Object.setPrototypeOf(u,i),u}),WE={}.hasOwnProperty;class ch extends ZE{constructor(){super("copy"),this.Compiler=void 0,this.Parser=void 0,this.attachers=[],this.compiler=void 0,this.freezeIndex=-1,this.frozen=void 0,this.namespace={},this.parser=void 0,this.transformers=IE()}copy(){const l=new ch;let r=-1;for(;++r<this.attachers.length;){const i=this.attachers[r];l.use(...i)}return l.data(Pm(!0,{},this.namespace)),l}data(l,r){return typeof l=="string"?arguments.length===2?($m("data",this.frozen),this.namespace[l]=r,this):WE.call(this.namespace,l)&&this.namespace[l]||void 0:l?($m("data",this.frozen),this.namespace=l,this):this.namespace}freeze(){if(this.frozen)return this;const l=this;for(;++this.freezeIndex<this.attachers.length;){const[r,...i]=this.attachers[this.freezeIndex];if(i[0]===!1)continue;i[0]===!0&&(i[0]=void 0);const o=r.call(l,...i);typeof o=="function"&&this.transformers.use(o)}return this.frozen=!0,this.freezeIndex=Number.POSITIVE_INFINITY,this}parse(l){this.freeze();const r=xu(l),i=this.parser||this.Parser;return qm("parse",i),i(String(r),r)}process(l,r){const i=this;return this.freeze(),qm("process",this.parser||this.Parser),Vm("process",this.compiler||this.Compiler),r?o(void 0,r):new Promise(o);function o(u,d){const f=xu(l),p=i.parse(f);i.run(p,f,function(y,g,v){if(y||!g||!v)return h(y);const k=g,S=i.stringify(k,v);tR(S)?v.value=S:v.result=S,h(y,v)});function h(y,g){y||!g?d(y):u?u(g):r(void 0,g)}}}processSync(l){let r=!1,i;return this.freeze(),qm("processSync",this.parser||this.Parser),Vm("processSync",this.compiler||this.Compiler),this.process(l,o),Ky("processSync","process",r),i;function o(u,d){r=!0,Gy(u),i=d}}run(l,r,i){Xy(l),this.freeze();const o=this.transformers;return!i&&typeof r=="function"&&(i=r,r=void 0),i?u(void 0,i):new Promise(u);function u(d,f){const p=xu(r);o.run(l,p,h);function h(y,g,v){const k=g||l;y?f(y):d?d(k):i(void 0,k,v)}}}runSync(l,r){let i=!1,o;return this.run(l,r,u),Ky("runSync","run",i),o;function u(d,f){Gy(d),o=f,i=!0}}stringify(l,r){this.freeze();const i=xu(r),o=this.compiler||this.Compiler;return Vm("stringify",o),Xy(l),o(l,i)}use(l,...r){const i=this.attachers,o=this.namespace;if($m("use",this.frozen),l!=null)if(typeof l=="function")p(l,r);else if(typeof l=="object")Array.isArray(l)?f(l):d(l);else throw new TypeError("Expected usable value, not `"+l+"`");return this;function u(h){if(typeof h=="function")p(h,[]);else if(typeof h=="object")if(Array.isArray(h)){const[y,...g]=h;p(y,g)}else d(h);else throw new TypeError("Expected usable value, not `"+h+"`")}function d(h){if(!("plugins"in h)&&!("settings"in h))throw new Error("Expected usable value but received an empty preset, which is probably a mistake: presets typically come with `plugins` and sometimes with `settings`, but this has neither");f(h.plugins),h.settings&&(o.settings=Pm(!0,o.settings,h.settings))}function f(h){let y=-1;if(h!=null)if(Array.isArray(h))for(;++y<h.length;){const g=h[y];u(g)}else throw new TypeError("Expected a list of plugins, not `"+h+"`")}function p(h,y){let g=-1,v=-1;for(;++g<i.length;)if(i[g][0]===h){v=g;break}if(v===-1)i.push([h,...y]);else if(y.length>0){let[k,...S]=y;const A=i[v][1];yp(A)&&yp(k)&&(k=Pm(!0,A,k)),i[v]=[h,k,...S]}}}}const JE=new ch().freeze();function qm(e,l){if(typeof l!="function")throw new TypeError("Cannot `"+e+"` without `parser`")}function Vm(e,l){if(typeof l!="function")throw new TypeError("Cannot `"+e+"` without `compiler`")}function $m(e,l){if(l)throw new Error("Cannot call `"+e+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function Xy(e){if(!yp(e)||typeof e.type!="string")throw new TypeError("Expected node, got `"+e+"`")}function Ky(e,l,r){if(!r)throw new Error("`"+e+"` finished async. Use `"+l+"` instead")}function xu(e){return eR(e)?e:new lj(e)}function eR(e){return!!(e&&typeof e=="object"&&"message"in e&&"messages"in e)}function tR(e){return typeof e=="string"||nR(e)}function nR(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const lR="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",Zy=[],Wy={allowDangerousHtml:!0},rR=/^(https?|ircs?|mailto|xmpp)$/i,aR=[{from:"astPlugins",id:"remove-buggy-html-in-markdown-parser"},{from:"allowDangerousHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"allowNode",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowElement"},{from:"allowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowedElements"},{from:"className",id:"remove-classname"},{from:"disallowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"disallowedElements"},{from:"escapeHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"includeElementIndex",id:"#remove-includeelementindex"},{from:"includeNodeIndex",id:"change-includenodeindex-to-includeelementindex"},{from:"linkTarget",id:"remove-linktarget"},{from:"plugins",id:"change-plugins-to-remarkplugins",to:"remarkPlugins"},{from:"rawSourcePos",id:"#remove-rawsourcepos"},{from:"renderers",id:"change-renderers-to-components",to:"components"},{from:"source",id:"change-source-to-children",to:"children"},{from:"sourcePos",id:"#remove-sourcepos"},{from:"transformImageUri",id:"#add-urltransform",to:"urlTransform"},{from:"transformLinkUri",id:"#add-urltransform",to:"urlTransform"}];function iR(e){const l=sR(e),r=oR(e);return cR(l.runSync(l.parse(r),r),e)}function sR(e){const l=e.rehypePlugins||Zy,r=e.remarkPlugins||Zy,i=e.remarkRehypeOptions?{...e.remarkRehypeOptions,...Wy}:Wy;return JE().use(H4).use(r).use(DE,i).use(l)}function oR(e){const l=e.children||"",r=new lj;return typeof l=="string"&&(r.value=l),r}function cR(e,l){const r=l.allowedElements,i=l.allowElement,o=l.components,u=l.disallowedElements,d=l.skipHtml,f=l.unwrapDisallowed,p=l.urlTransform||uR;for(const y of aR)Object.hasOwn(l,y.from)&&(""+y.from+(y.to?"use `"+y.to+"` instead":"remove it")+lR+y.id,void 0);return oh(e,h),w3(e,{Fragment:a.Fragment,components:o,ignoreInvalidStyle:!0,jsx:a.jsx,jsxs:a.jsxs,passKeys:!0,passNode:!0});function h(y,g,v){if(y.type==="raw"&&v&&typeof g=="number")return d?v.children.splice(g,1):v.children[g]={type:"text",value:y.value},g;if(y.type==="element"){let k;for(k in Dm)if(Object.hasOwn(Dm,k)&&Object.hasOwn(y.properties,k)){const S=y.properties[k],A=Dm[k];(A===null||A.includes(y.tagName))&&(y.properties[k]=p(String(S||""),k,y))}}if(y.type==="element"){let k=r?!r.includes(y.tagName):u?u.includes(y.tagName):!1;if(!k&&i&&typeof g=="number"&&(k=!i(y,g,v)),k&&v&&typeof g=="number")return f&&y.children?v.children.splice(g,1,...y.children):v.children.splice(g,1),g}}}function uR(e){const l=e.indexOf(":"),r=e.indexOf("?"),i=e.indexOf("#"),o=e.indexOf("/");return l===-1||o!==-1&&l>o||r!==-1&&l>r||i!==-1&&l>i||rR.test(e.slice(0,l))?e:""}function Jy(e,l){const r=String(e);if(typeof l!="string")throw new TypeError("Expected character");let i=0,o=r.indexOf(l);for(;o!==-1;)i++,o=r.indexOf(l,o+l.length);return i}function dR(e){if(typeof e!="string")throw new TypeError("Expected a string");return e.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}function fR(e,l,r){const o=Xu((r||{}).ignore||[]),u=mR(l);let d=-1;for(;++d<u.length;)nj(e,"text",f);function f(h,y){let g=-1,v;for(;++g<y.length;){const k=y[g],S=v?v.children:void 0;if(o(k,S?S.indexOf(k):void 0,v))return;v=k}if(v)return p(h,y)}function p(h,y){const g=y[y.length-1],v=u[d][0],k=u[d][1];let S=0;const N=g.children.indexOf(h);let R=!1,L=[];v.lastIndex=0;let H=v.exec(h.value);for(;H;){const X=H.index,V={index:H.index,input:H.input,stack:[...y,h]};let D=k(...H,V);if(typeof D=="string"&&(D=D.length>0?{type:"text",value:D}:void 0),D===!1?v.lastIndex=X+1:(S!==X&&L.push({type:"text",value:h.value.slice(S,X)}),Array.isArray(D)?L.push(...D):D&&L.push(D),S=X+H[0].length,R=!0),!v.global)break;H=v.exec(h.value)}return R?(S<h.value.length&&L.push({type:"text",value:h.value.slice(S)}),g.children.splice(N,1,...L)):L=[h],N+L.length}}function mR(e){const l=[];if(!Array.isArray(e))throw new TypeError("Expected find and replace tuple or list of tuples");const r=!e[0]||Array.isArray(e[0])?e:[e];let i=-1;for(;++i<r.length;){const o=r[i];l.push([pR(o[0]),hR(o[1])])}return l}function pR(e){return typeof e=="string"?new RegExp(dR(e),"g"):e}function hR(e){return typeof e=="function"?e:function(){return e}}const Gm="phrasing",Ym=["autolink","link","image","label"];function xR(){return{transforms:[NR],enter:{literalAutolink:bR,literalAutolinkEmail:Qm,literalAutolinkHttp:Qm,literalAutolinkWww:Qm},exit:{literalAutolink:kR,literalAutolinkEmail:jR,literalAutolinkHttp:yR,literalAutolinkWww:vR}}}function gR(){return{unsafe:[{character:"@",before:"[+\\-.\\w]",after:"[\\-.\\w]",inConstruct:Gm,notInConstruct:Ym},{character:".",before:"[Ww]",after:"[\\-.\\w]",inConstruct:Gm,notInConstruct:Ym},{character:":",before:"[ps]",after:"\\/",inConstruct:Gm,notInConstruct:Ym}]}}function bR(e){this.enter({type:"link",title:null,url:"",children:[]},e)}function Qm(e){this.config.enter.autolinkProtocol.call(this,e)}function yR(e){this.config.exit.autolinkProtocol.call(this,e)}function vR(e){this.config.exit.data.call(this,e);const l=this.stack[this.stack.length-1];l.type,l.url="http://"+this.sliceSerialize(e)}function jR(e){this.config.exit.autolinkEmail.call(this,e)}function kR(e){this.exit(e)}function NR(e){fR(e,[[/(https?:\/\/|www(?=\.))([-.\w]+)([^ \t\r\n]*)/gi,wR],[new RegExp("(?<=^|\\s|\\p{P}|\\p{S})([-.\\w+]+)@([-\\w]+(?:\\.[-\\w]+)+)","gu"),SR]],{ignore:["link","linkReference"]})}function wR(e,l,r,i,o){let u="";if(!rj(o)||(/^w/i.test(l)&&(r=l+r,l="",u="http://"),!CR(r)))return!1;const d=TR(r+i);if(!d[0])return!1;const f={type:"link",title:null,url:u+l+d[0],children:[{type:"text",value:l+d[0]}]};return d[1]?[f,{type:"text",value:d[1]}]:f}function SR(e,l,r,i){return!rj(i,!0)||/[-\d_]$/.test(r)?!1:{type:"link",title:null,url:"mailto:"+l+"@"+r,children:[{type:"text",value:l+"@"+r}]}}function CR(e){const l=e.split(".");return!(l.length<2||l[l.length-1]&&(/_/.test(l[l.length-1])||!/[a-zA-Z\d]/.test(l[l.length-1]))||l[l.length-2]&&(/_/.test(l[l.length-2])||!/[a-zA-Z\d]/.test(l[l.length-2])))}function TR(e){const l=/[!"&'),.:;<>?\]}]+$/.exec(e);if(!l)return[e,void 0];e=e.slice(0,l.index);let r=l[0],i=r.indexOf(")");const o=Jy(e,"(");let u=Jy(e,")");for(;i!==-1&&o>u;)e+=r.slice(0,i+1),r=r.slice(i+1),i=r.indexOf(")"),u++;return[e,r]}function rj(e,l){const r=e.input.charCodeAt(e.index-1);return(e.index===0||ri(r)||Gu(r))&&(!l||r!==47)}aj.peek=_R;function AR(){this.buffer()}function ER(e){this.enter({type:"footnoteReference",identifier:"",label:""},e)}function RR(){this.buffer()}function MR(e){this.enter({type:"footnoteDefinition",identifier:"",label:"",children:[]},e)}function zR(e){const l=this.resume(),r=this.stack[this.stack.length-1];r.type,r.identifier=Il(this.sliceSerialize(e)).toLowerCase(),r.label=l}function OR(e){this.exit(e)}function LR(e){const l=this.resume(),r=this.stack[this.stack.length-1];r.type,r.identifier=Il(this.sliceSerialize(e)).toLowerCase(),r.label=l}function DR(e){this.exit(e)}function _R(){return"["}function aj(e,l,r,i){const o=r.createTracker(i);let u=o.move("[^");const d=r.enter("footnoteReference"),f=r.enter("reference");return u+=o.move(r.safe(r.associationId(e),{after:"]",before:u})),f(),d(),u+=o.move("]"),u}function BR(){return{enter:{gfmFootnoteCallString:AR,gfmFootnoteCall:ER,gfmFootnoteDefinitionLabelString:RR,gfmFootnoteDefinition:MR},exit:{gfmFootnoteCallString:zR,gfmFootnoteCall:OR,gfmFootnoteDefinitionLabelString:LR,gfmFootnoteDefinition:DR}}}function IR(e){let l=!1;return e&&e.firstLineBlank&&(l=!0),{handlers:{footnoteDefinition:r,footnoteReference:aj},unsafe:[{character:"[",inConstruct:["label","phrasing","reference"]}]};function r(i,o,u,d){const f=u.createTracker(d);let p=f.move("[^");const h=u.enter("footnoteDefinition"),y=u.enter("label");return p+=f.move(u.safe(u.associationId(i),{before:p,after:"]"})),y(),p+=f.move("]:"),i.children&&i.children.length>0&&(f.shift(4),p+=f.move((l?`
76
+ `:" ")+u.indentLines(u.containerFlow(i,f.current()),l?ij:PR))),h(),p}}function PR(e,l,r){return l===0?e:ij(e,l,r)}function ij(e,l,r){return(r?"":" ")+e}const UR=["autolink","destinationLiteral","destinationRaw","reference","titleQuote","titleApostrophe"];sj.peek=$R;function HR(){return{canContainEols:["delete"],enter:{strikethrough:qR},exit:{strikethrough:VR}}}function FR(){return{unsafe:[{character:"~",inConstruct:"phrasing",notInConstruct:UR}],handlers:{delete:sj}}}function qR(e){this.enter({type:"delete",children:[]},e)}function VR(e){this.exit(e)}function sj(e,l,r,i){const o=r.createTracker(i),u=r.enter("strikethrough");let d=o.move("~~");return d+=r.containerPhrasing(e,{...o.current(),before:d,after:"~"}),d+=o.move("~~"),u(),d}function $R(){return"~"}function GR(e){return e.length}function YR(e,l){const r=l||{},i=(r.align||[]).concat(),o=r.stringLength||GR,u=[],d=[],f=[],p=[];let h=0,y=-1;for(;++y<e.length;){const A=[],N=[];let R=-1;for(e[y].length>h&&(h=e[y].length);++R<e[y].length;){const L=QR(e[y][R]);if(r.alignDelimiters!==!1){const H=o(L);N[R]=H,(p[R]===void 0||H>p[R])&&(p[R]=H)}A.push(L)}d[y]=A,f[y]=N}let g=-1;if(typeof i=="object"&&"length"in i)for(;++g<h;)u[g]=e1(i[g]);else{const A=e1(i);for(;++g<h;)u[g]=A}g=-1;const v=[],k=[];for(;++g<h;){const A=u[g];let N="",R="";A===99?(N=":",R=":"):A===108?N=":":A===114&&(R=":");let L=r.alignDelimiters===!1?1:Math.max(1,p[g]-N.length-R.length);const H=N+"-".repeat(L)+R;r.alignDelimiters!==!1&&(L=N.length+L+R.length,L>p[g]&&(p[g]=L),k[g]=L),v[g]=H}d.splice(1,0,v),f.splice(1,0,k),y=-1;const S=[];for(;++y<d.length;){const A=d[y],N=f[y];g=-1;const R=[];for(;++g<h;){const L=A[g]||"";let H="",X="";if(r.alignDelimiters!==!1){const V=p[g]-(N[g]||0),D=u[g];D===114?H=" ".repeat(V):D===99?V%2?(H=" ".repeat(V/2+.5),X=" ".repeat(V/2-.5)):(H=" ".repeat(V/2),X=H):X=" ".repeat(V)}r.delimiterStart!==!1&&!g&&R.push("|"),r.padding!==!1&&!(r.alignDelimiters===!1&&L==="")&&(r.delimiterStart!==!1||g)&&R.push(" "),r.alignDelimiters!==!1&&R.push(H),R.push(L),r.alignDelimiters!==!1&&R.push(X),r.padding!==!1&&R.push(" "),(r.delimiterEnd!==!1||g!==h-1)&&R.push("|")}S.push(r.delimiterEnd===!1?R.join("").replace(/ +$/,""):R.join(""))}return S.join(`
77
+ `)}function QR(e){return e==null?"":String(e)}function e1(e){const l=typeof e=="string"?e.codePointAt(0):0;return l===67||l===99?99:l===76||l===108?108:l===82||l===114?114:0}function XR(e,l,r,i){const o=r.enter("blockquote"),u=r.createTracker(i);u.move("> "),u.shift(2);const d=r.indentLines(r.containerFlow(e,u.current()),KR);return o(),d}function KR(e,l,r){return">"+(r?"":" ")+e}function ZR(e,l){return t1(e,l.inConstruct,!0)&&!t1(e,l.notInConstruct,!1)}function t1(e,l,r){if(typeof l=="string"&&(l=[l]),!l||l.length===0)return r;let i=-1;for(;++i<l.length;)if(e.includes(l[i]))return!0;return!1}function n1(e,l,r,i){let o=-1;for(;++o<r.unsafe.length;)if(r.unsafe[o].character===`
78
+ `&&ZR(r.stack,r.unsafe[o]))return/[ \t]/.test(i.before)?"":" ";return`\\
79
+ `}function WR(e,l){const r=String(e);let i=r.indexOf(l),o=i,u=0,d=0;if(typeof l!="string")throw new TypeError("Expected substring");for(;i!==-1;)i===o?++u>d&&(d=u):u=1,o=i+l.length,i=r.indexOf(l,o);return d}function JR(e,l){return!!(l.options.fences===!1&&e.value&&!e.lang&&/[^ \r\n]/.test(e.value)&&!/^[\t ]*(?:[\r\n]|$)|(?:^|[\r\n])[\t ]*$/.test(e.value))}function eM(e){const l=e.options.fence||"`";if(l!=="`"&&l!=="~")throw new Error("Cannot serialize code with `"+l+"` for `options.fence`, expected `` ` `` or `~`");return l}function tM(e,l,r,i){const o=eM(r),u=e.value||"",d=o==="`"?"GraveAccent":"Tilde";if(JR(e,r)){const g=r.enter("codeIndented"),v=r.indentLines(u,nM);return g(),v}const f=r.createTracker(i),p=o.repeat(Math.max(WR(u,o)+1,3)),h=r.enter("codeFenced");let y=f.move(p);if(e.lang){const g=r.enter(`codeFencedLang${d}`);y+=f.move(r.safe(e.lang,{before:y,after:" ",encode:["`"],...f.current()})),g()}if(e.lang&&e.meta){const g=r.enter(`codeFencedMeta${d}`);y+=f.move(" "),y+=f.move(r.safe(e.meta,{before:y,after:`
80
+ `,encode:["`"],...f.current()})),g()}return y+=f.move(`
81
+ `),u&&(y+=f.move(u+`
82
+ `)),y+=f.move(p),h(),y}function nM(e,l,r){return(r?"":" ")+e}function uh(e){const l=e.options.quote||'"';if(l!=='"'&&l!=="'")throw new Error("Cannot serialize title with `"+l+"` for `options.quote`, expected `\"`, or `'`");return l}function lM(e,l,r,i){const o=uh(r),u=o==='"'?"Quote":"Apostrophe",d=r.enter("definition");let f=r.enter("label");const p=r.createTracker(i);let h=p.move("[");return h+=p.move(r.safe(r.associationId(e),{before:h,after:"]",...p.current()})),h+=p.move("]: "),f(),!e.url||/[\0- \u007F]/.test(e.url)?(f=r.enter("destinationLiteral"),h+=p.move("<"),h+=p.move(r.safe(e.url,{before:h,after:">",...p.current()})),h+=p.move(">")):(f=r.enter("destinationRaw"),h+=p.move(r.safe(e.url,{before:h,after:e.title?" ":`
83
+ `,...p.current()}))),f(),e.title&&(f=r.enter(`title${u}`),h+=p.move(" "+o),h+=p.move(r.safe(e.title,{before:h,after:o,...p.current()})),h+=p.move(o),f()),d(),h}function rM(e){const l=e.options.emphasis||"*";if(l!=="*"&&l!=="_")throw new Error("Cannot serialize emphasis with `"+l+"` for `options.emphasis`, expected `*`, or `_`");return l}function zo(e){return"&#x"+e.toString(16).toUpperCase()+";"}function Pu(e,l,r){const i=ss(e),o=ss(l);return i===void 0?o===void 0?r==="_"?{inside:!0,outside:!0}:{inside:!1,outside:!1}:o===1?{inside:!0,outside:!0}:{inside:!1,outside:!0}:i===1?o===void 0?{inside:!1,outside:!1}:o===1?{inside:!0,outside:!0}:{inside:!1,outside:!1}:o===void 0?{inside:!1,outside:!1}:o===1?{inside:!0,outside:!1}:{inside:!1,outside:!1}}oj.peek=aM;function oj(e,l,r,i){const o=rM(r),u=r.enter("emphasis"),d=r.createTracker(i),f=d.move(o);let p=d.move(r.containerPhrasing(e,{after:o,before:f,...d.current()}));const h=p.charCodeAt(0),y=Pu(i.before.charCodeAt(i.before.length-1),h,o);y.inside&&(p=zo(h)+p.slice(1));const g=p.charCodeAt(p.length-1),v=Pu(i.after.charCodeAt(0),g,o);v.inside&&(p=p.slice(0,-1)+zo(g));const k=d.move(o);return u(),r.attentionEncodeSurroundingInfo={after:v.outside,before:y.outside},f+p+k}function aM(e,l,r){return r.options.emphasis||"*"}function iM(e,l){let r=!1;return oh(e,function(i){if("value"in i&&/\r?\n|\r/.test(i.value)||i.type==="break")return r=!0,gp}),!!((!e.depth||e.depth<3)&&th(e)&&(l.options.setext||r))}function sM(e,l,r,i){const o=Math.max(Math.min(6,e.depth||1),1),u=r.createTracker(i);if(iM(e,r)){const y=r.enter("headingSetext"),g=r.enter("phrasing"),v=r.containerPhrasing(e,{...u.current(),before:`
84
+ `,after:`
85
+ `});return g(),y(),v+`
86
+ `+(o===1?"=":"-").repeat(v.length-(Math.max(v.lastIndexOf("\r"),v.lastIndexOf(`
87
+ `))+1))}const d="#".repeat(o),f=r.enter("headingAtx"),p=r.enter("phrasing");u.move(d+" ");let h=r.containerPhrasing(e,{before:"# ",after:`
88
+ `,...u.current()});return/^[\t ]/.test(h)&&(h=zo(h.charCodeAt(0))+h.slice(1)),h=h?d+" "+h:d,r.options.closeAtx&&(h+=" "+d),p(),f(),h}cj.peek=oM;function cj(e){return e.value||""}function oM(){return"<"}uj.peek=cM;function uj(e,l,r,i){const o=uh(r),u=o==='"'?"Quote":"Apostrophe",d=r.enter("image");let f=r.enter("label");const p=r.createTracker(i);let h=p.move("![");return h+=p.move(r.safe(e.alt,{before:h,after:"]",...p.current()})),h+=p.move("]("),f(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(f=r.enter("destinationLiteral"),h+=p.move("<"),h+=p.move(r.safe(e.url,{before:h,after:">",...p.current()})),h+=p.move(">")):(f=r.enter("destinationRaw"),h+=p.move(r.safe(e.url,{before:h,after:e.title?" ":")",...p.current()}))),f(),e.title&&(f=r.enter(`title${u}`),h+=p.move(" "+o),h+=p.move(r.safe(e.title,{before:h,after:o,...p.current()})),h+=p.move(o),f()),h+=p.move(")"),d(),h}function cM(){return"!"}dj.peek=uM;function dj(e,l,r,i){const o=e.referenceType,u=r.enter("imageReference");let d=r.enter("label");const f=r.createTracker(i);let p=f.move("![");const h=r.safe(e.alt,{before:p,after:"]",...f.current()});p+=f.move(h+"]["),d();const y=r.stack;r.stack=[],d=r.enter("reference");const g=r.safe(r.associationId(e),{before:p,after:"]",...f.current()});return d(),r.stack=y,u(),o==="full"||!h||h!==g?p+=f.move(g+"]"):o==="shortcut"?p=p.slice(0,-1):p+=f.move("]"),p}function uM(){return"!"}fj.peek=dM;function fj(e,l,r){let i=e.value||"",o="`",u=-1;for(;new RegExp("(^|[^`])"+o+"([^`]|$)").test(i);)o+="`";for(/[^ \r\n]/.test(i)&&(/^[ \r\n]/.test(i)&&/[ \r\n]$/.test(i)||/^`|`$/.test(i))&&(i=" "+i+" ");++u<r.unsafe.length;){const d=r.unsafe[u],f=r.compilePattern(d);let p;if(d.atBreak)for(;p=f.exec(i);){let h=p.index;i.charCodeAt(h)===10&&i.charCodeAt(h-1)===13&&h--,i=i.slice(0,h)+" "+i.slice(p.index+1)}}return o+i+o}function dM(){return"`"}function mj(e,l){const r=th(e);return!!(!l.options.resourceLink&&e.url&&!e.title&&e.children&&e.children.length===1&&e.children[0].type==="text"&&(r===e.url||"mailto:"+r===e.url)&&/^[a-z][a-z+.-]+:/i.test(e.url)&&!/[\0- <>\u007F]/.test(e.url))}pj.peek=fM;function pj(e,l,r,i){const o=uh(r),u=o==='"'?"Quote":"Apostrophe",d=r.createTracker(i);let f,p;if(mj(e,r)){const y=r.stack;r.stack=[],f=r.enter("autolink");let g=d.move("<");return g+=d.move(r.containerPhrasing(e,{before:g,after:">",...d.current()})),g+=d.move(">"),f(),r.stack=y,g}f=r.enter("link"),p=r.enter("label");let h=d.move("[");return h+=d.move(r.containerPhrasing(e,{before:h,after:"](",...d.current()})),h+=d.move("]("),p(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(p=r.enter("destinationLiteral"),h+=d.move("<"),h+=d.move(r.safe(e.url,{before:h,after:">",...d.current()})),h+=d.move(">")):(p=r.enter("destinationRaw"),h+=d.move(r.safe(e.url,{before:h,after:e.title?" ":")",...d.current()}))),p(),e.title&&(p=r.enter(`title${u}`),h+=d.move(" "+o),h+=d.move(r.safe(e.title,{before:h,after:o,...d.current()})),h+=d.move(o),p()),h+=d.move(")"),f(),h}function fM(e,l,r){return mj(e,r)?"<":"["}hj.peek=mM;function hj(e,l,r,i){const o=e.referenceType,u=r.enter("linkReference");let d=r.enter("label");const f=r.createTracker(i);let p=f.move("[");const h=r.containerPhrasing(e,{before:p,after:"]",...f.current()});p+=f.move(h+"]["),d();const y=r.stack;r.stack=[],d=r.enter("reference");const g=r.safe(r.associationId(e),{before:p,after:"]",...f.current()});return d(),r.stack=y,u(),o==="full"||!h||h!==g?p+=f.move(g+"]"):o==="shortcut"?p=p.slice(0,-1):p+=f.move("]"),p}function mM(){return"["}function dh(e){const l=e.options.bullet||"*";if(l!=="*"&&l!=="+"&&l!=="-")throw new Error("Cannot serialize items with `"+l+"` for `options.bullet`, expected `*`, `+`, or `-`");return l}function pM(e){const l=dh(e),r=e.options.bulletOther;if(!r)return l==="*"?"-":"*";if(r!=="*"&&r!=="+"&&r!=="-")throw new Error("Cannot serialize items with `"+r+"` for `options.bulletOther`, expected `*`, `+`, or `-`");if(r===l)throw new Error("Expected `bullet` (`"+l+"`) and `bulletOther` (`"+r+"`) to be different");return r}function hM(e){const l=e.options.bulletOrdered||".";if(l!=="."&&l!==")")throw new Error("Cannot serialize items with `"+l+"` for `options.bulletOrdered`, expected `.` or `)`");return l}function xj(e){const l=e.options.rule||"*";if(l!=="*"&&l!=="-"&&l!=="_")throw new Error("Cannot serialize rules with `"+l+"` for `options.rule`, expected `*`, `-`, or `_`");return l}function xM(e,l,r,i){const o=r.enter("list"),u=r.bulletCurrent;let d=e.ordered?hM(r):dh(r);const f=e.ordered?d==="."?")":".":pM(r);let p=l&&r.bulletLastUsed?d===r.bulletLastUsed:!1;if(!e.ordered){const y=e.children?e.children[0]:void 0;if((d==="*"||d==="-")&&y&&(!y.children||!y.children[0])&&r.stack[r.stack.length-1]==="list"&&r.stack[r.stack.length-2]==="listItem"&&r.stack[r.stack.length-3]==="list"&&r.stack[r.stack.length-4]==="listItem"&&r.indexStack[r.indexStack.length-1]===0&&r.indexStack[r.indexStack.length-2]===0&&r.indexStack[r.indexStack.length-3]===0&&(p=!0),xj(r)===d&&y){let g=-1;for(;++g<e.children.length;){const v=e.children[g];if(v&&v.type==="listItem"&&v.children&&v.children[0]&&v.children[0].type==="thematicBreak"){p=!0;break}}}}p&&(d=f),r.bulletCurrent=d;const h=r.containerFlow(e,i);return r.bulletLastUsed=d,r.bulletCurrent=u,o(),h}function gM(e){const l=e.options.listItemIndent||"one";if(l!=="tab"&&l!=="one"&&l!=="mixed")throw new Error("Cannot serialize items with `"+l+"` for `options.listItemIndent`, expected `tab`, `one`, or `mixed`");return l}function bM(e,l,r,i){const o=gM(r);let u=r.bulletCurrent||dh(r);l&&l.type==="list"&&l.ordered&&(u=(typeof l.start=="number"&&l.start>-1?l.start:1)+(r.options.incrementListMarker===!1?0:l.children.indexOf(e))+u);let d=u.length+1;(o==="tab"||o==="mixed"&&(l&&l.type==="list"&&l.spread||e.spread))&&(d=Math.ceil(d/4)*4);const f=r.createTracker(i);f.move(u+" ".repeat(d-u.length)),f.shift(d);const p=r.enter("listItem"),h=r.indentLines(r.containerFlow(e,f.current()),y);return p(),h;function y(g,v,k){return v?(k?"":" ".repeat(d))+g:(k?u:u+" ".repeat(d-u.length))+g}}function yM(e,l,r,i){const o=r.enter("paragraph"),u=r.enter("phrasing"),d=r.containerPhrasing(e,i);return u(),o(),d}const vM=Xu(["break","delete","emphasis","footnote","footnoteReference","image","imageReference","inlineCode","inlineMath","link","linkReference","mdxJsxTextElement","mdxTextExpression","strong","text","textDirective"]);function jM(e,l,r,i){return(e.children.some(function(d){return vM(d)})?r.containerPhrasing:r.containerFlow).call(r,e,i)}function kM(e){const l=e.options.strong||"*";if(l!=="*"&&l!=="_")throw new Error("Cannot serialize strong with `"+l+"` for `options.strong`, expected `*`, or `_`");return l}gj.peek=NM;function gj(e,l,r,i){const o=kM(r),u=r.enter("strong"),d=r.createTracker(i),f=d.move(o+o);let p=d.move(r.containerPhrasing(e,{after:o,before:f,...d.current()}));const h=p.charCodeAt(0),y=Pu(i.before.charCodeAt(i.before.length-1),h,o);y.inside&&(p=zo(h)+p.slice(1));const g=p.charCodeAt(p.length-1),v=Pu(i.after.charCodeAt(0),g,o);v.inside&&(p=p.slice(0,-1)+zo(g));const k=d.move(o+o);return u(),r.attentionEncodeSurroundingInfo={after:v.outside,before:y.outside},f+p+k}function NM(e,l,r){return r.options.strong||"*"}function wM(e,l,r,i){return r.safe(e.value,i)}function SM(e){const l=e.options.ruleRepetition||3;if(l<3)throw new Error("Cannot serialize rules with repetition `"+l+"` for `options.ruleRepetition`, expected `3` or more");return l}function CM(e,l,r){const i=(xj(r)+(r.options.ruleSpaces?" ":"")).repeat(SM(r));return r.options.ruleSpaces?i.slice(0,-1):i}const bj={blockquote:XR,break:n1,code:tM,definition:lM,emphasis:oj,hardBreak:n1,heading:sM,html:cj,image:uj,imageReference:dj,inlineCode:fj,link:pj,linkReference:hj,list:xM,listItem:bM,paragraph:yM,root:jM,strong:gj,text:wM,thematicBreak:CM};function TM(){return{enter:{table:AM,tableData:l1,tableHeader:l1,tableRow:RM},exit:{codeText:MM,table:EM,tableData:Xm,tableHeader:Xm,tableRow:Xm}}}function AM(e){const l=e._align;this.enter({type:"table",align:l.map(function(r){return r==="none"?null:r}),children:[]},e),this.data.inTable=!0}function EM(e){this.exit(e),this.data.inTable=void 0}function RM(e){this.enter({type:"tableRow",children:[]},e)}function Xm(e){this.exit(e)}function l1(e){this.enter({type:"tableCell",children:[]},e)}function MM(e){let l=this.resume();this.data.inTable&&(l=l.replace(/\\([\\|])/g,zM));const r=this.stack[this.stack.length-1];r.type,r.value=l,this.exit(e)}function zM(e,l){return l==="|"?l:e}function OM(e){const l=e||{},r=l.tableCellPadding,i=l.tablePipeAlign,o=l.stringLength,u=r?" ":"|";return{unsafe:[{character:"\r",inConstruct:"tableCell"},{character:`
89
+ `,inConstruct:"tableCell"},{atBreak:!0,character:"|",after:"[ :-]"},{character:"|",inConstruct:"tableCell"},{atBreak:!0,character:":",after:"-"},{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{inlineCode:v,table:d,tableCell:p,tableRow:f}};function d(k,S,A,N){return h(y(k,A,N),k.align)}function f(k,S,A,N){const R=g(k,A,N),L=h([R]);return L.slice(0,L.indexOf(`
90
+ `))}function p(k,S,A,N){const R=A.enter("tableCell"),L=A.enter("phrasing"),H=A.containerPhrasing(k,{...N,before:u,after:u});return L(),R(),H}function h(k,S){return YR(k,{align:S,alignDelimiters:i,padding:r,stringLength:o})}function y(k,S,A){const N=k.children;let R=-1;const L=[],H=S.enter("table");for(;++R<N.length;)L[R]=g(N[R],S,A);return H(),L}function g(k,S,A){const N=k.children;let R=-1;const L=[],H=S.enter("tableRow");for(;++R<N.length;)L[R]=p(N[R],k,S,A);return H(),L}function v(k,S,A){let N=bj.inlineCode(k,S,A);return A.stack.includes("tableCell")&&(N=N.replace(/\|/g,"\\$&")),N}}function LM(){return{exit:{taskListCheckValueChecked:r1,taskListCheckValueUnchecked:r1,paragraph:_M}}}function DM(){return{unsafe:[{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{listItem:BM}}}function r1(e){const l=this.stack[this.stack.length-2];l.type,l.checked=e.type==="taskListCheckValueChecked"}function _M(e){const l=this.stack[this.stack.length-2];if(l&&l.type==="listItem"&&typeof l.checked=="boolean"){const r=this.stack[this.stack.length-1];r.type;const i=r.children[0];if(i&&i.type==="text"){const o=l.children;let u=-1,d;for(;++u<o.length;){const f=o[u];if(f.type==="paragraph"){d=f;break}}d===r&&(i.value=i.value.slice(1),i.value.length===0?r.children.shift():r.position&&i.position&&typeof i.position.start.offset=="number"&&(i.position.start.column++,i.position.start.offset++,r.position.start=Object.assign({},i.position.start)))}}this.exit(e)}function BM(e,l,r,i){const o=e.children[0],u=typeof e.checked=="boolean"&&o&&o.type==="paragraph",d="["+(e.checked?"x":" ")+"] ",f=r.createTracker(i);u&&f.move(d);let p=bj.listItem(e,l,r,{...i,...f.current()});return u&&(p=p.replace(/^(?:[*+-]|\d+\.)([\r\n]| {1,3})/,h)),p;function h(y){return y+d}}function IM(){return[xR(),BR(),HR(),TM(),LM()]}function PM(e){return{extensions:[gR(),IR(e),FR(),OM(e),DM()]}}const UM={tokenize:GM,partial:!0},yj={tokenize:YM,partial:!0},vj={tokenize:QM,partial:!0},jj={tokenize:XM,partial:!0},HM={tokenize:KM,partial:!0},kj={name:"wwwAutolink",tokenize:VM,previous:wj},Nj={name:"protocolAutolink",tokenize:$M,previous:Sj},Lr={name:"emailAutolink",tokenize:qM,previous:Cj},Jl={};function FM(){return{text:Jl}}let Ja=48;for(;Ja<123;)Jl[Ja]=Lr,Ja++,Ja===58?Ja=65:Ja===91&&(Ja=97);Jl[43]=Lr;Jl[45]=Lr;Jl[46]=Lr;Jl[95]=Lr;Jl[72]=[Lr,Nj];Jl[104]=[Lr,Nj];Jl[87]=[Lr,kj];Jl[119]=[Lr,kj];function qM(e,l,r){const i=this;let o,u;return d;function d(g){return!jp(g)||!Cj.call(i,i.previous)||fh(i.events)?r(g):(e.enter("literalAutolink"),e.enter("literalAutolinkEmail"),f(g))}function f(g){return jp(g)?(e.consume(g),f):g===64?(e.consume(g),p):r(g)}function p(g){return g===46?e.check(HM,y,h)(g):g===45||g===95||zn(g)?(u=!0,e.consume(g),p):y(g)}function h(g){return e.consume(g),o=!0,p}function y(g){return u&&o&&Pn(i.previous)?(e.exit("literalAutolinkEmail"),e.exit("literalAutolink"),l(g)):r(g)}}function VM(e,l,r){const i=this;return o;function o(d){return d!==87&&d!==119||!wj.call(i,i.previous)||fh(i.events)?r(d):(e.enter("literalAutolink"),e.enter("literalAutolinkWww"),e.check(UM,e.attempt(yj,e.attempt(vj,u),r),r)(d))}function u(d){return e.exit("literalAutolinkWww"),e.exit("literalAutolink"),l(d)}}function $M(e,l,r){const i=this;let o="",u=!1;return d;function d(g){return(g===72||g===104)&&Sj.call(i,i.previous)&&!fh(i.events)?(e.enter("literalAutolink"),e.enter("literalAutolinkHttp"),o+=String.fromCodePoint(g),e.consume(g),f):r(g)}function f(g){if(Pn(g)&&o.length<5)return o+=String.fromCodePoint(g),e.consume(g),f;if(g===58){const v=o.toLowerCase();if(v==="http"||v==="https")return e.consume(g),p}return r(g)}function p(g){return g===47?(e.consume(g),u?h:(u=!0,p)):r(g)}function h(g){return g===null||_u(g)||It(g)||ri(g)||Gu(g)?r(g):e.attempt(yj,e.attempt(vj,y),r)(g)}function y(g){return e.exit("literalAutolinkHttp"),e.exit("literalAutolink"),l(g)}}function GM(e,l,r){let i=0;return o;function o(d){return(d===87||d===119)&&i<3?(i++,e.consume(d),o):d===46&&i===3?(e.consume(d),u):r(d)}function u(d){return d===null?r(d):l(d)}}function YM(e,l,r){let i,o,u;return d;function d(h){return h===46||h===95?e.check(jj,p,f)(h):h===null||It(h)||ri(h)||h!==45&&Gu(h)?p(h):(u=!0,e.consume(h),d)}function f(h){return h===95?i=!0:(o=i,i=void 0),e.consume(h),d}function p(h){return o||i||!u?r(h):l(h)}}function QM(e,l){let r=0,i=0;return o;function o(d){return d===40?(r++,e.consume(d),o):d===41&&i<r?u(d):d===33||d===34||d===38||d===39||d===41||d===42||d===44||d===46||d===58||d===59||d===60||d===63||d===93||d===95||d===126?e.check(jj,l,u)(d):d===null||It(d)||ri(d)?l(d):(e.consume(d),o)}function u(d){return d===41&&i++,e.consume(d),o}}function XM(e,l,r){return i;function i(f){return f===33||f===34||f===39||f===41||f===42||f===44||f===46||f===58||f===59||f===63||f===95||f===126?(e.consume(f),i):f===38?(e.consume(f),u):f===93?(e.consume(f),o):f===60||f===null||It(f)||ri(f)?l(f):r(f)}function o(f){return f===null||f===40||f===91||It(f)||ri(f)?l(f):i(f)}function u(f){return Pn(f)?d(f):r(f)}function d(f){return f===59?(e.consume(f),i):Pn(f)?(e.consume(f),d):r(f)}}function KM(e,l,r){return i;function i(u){return e.consume(u),o}function o(u){return zn(u)?r(u):l(u)}}function wj(e){return e===null||e===40||e===42||e===95||e===91||e===93||e===126||It(e)}function Sj(e){return!Pn(e)}function Cj(e){return!(e===47||jp(e))}function jp(e){return e===43||e===45||e===46||e===95||zn(e)}function fh(e){let l=e.length,r=!1;for(;l--;){const i=e[l][1];if((i.type==="labelLink"||i.type==="labelImage")&&!i._balanced){r=!0;break}if(i._gfmAutolinkLiteralWalkedInto){r=!1;break}}return e.length>0&&!r&&(e[e.length-1][1]._gfmAutolinkLiteralWalkedInto=!0),r}const ZM={tokenize:az,partial:!0};function WM(){return{document:{91:{name:"gfmFootnoteDefinition",tokenize:nz,continuation:{tokenize:lz},exit:rz}},text:{91:{name:"gfmFootnoteCall",tokenize:tz},93:{name:"gfmPotentialFootnoteCall",add:"after",tokenize:JM,resolveTo:ez}}}}function JM(e,l,r){const i=this;let o=i.events.length;const u=i.parser.gfmFootnotes||(i.parser.gfmFootnotes=[]);let d;for(;o--;){const p=i.events[o][1];if(p.type==="labelImage"){d=p;break}if(p.type==="gfmFootnoteCall"||p.type==="labelLink"||p.type==="label"||p.type==="image"||p.type==="link")break}return f;function f(p){if(!d||!d._balanced)return r(p);const h=Il(i.sliceSerialize({start:d.end,end:i.now()}));return h.codePointAt(0)!==94||!u.includes(h.slice(1))?r(p):(e.enter("gfmFootnoteCallLabelMarker"),e.consume(p),e.exit("gfmFootnoteCallLabelMarker"),l(p))}}function ez(e,l){let r=e.length;for(;r--;)if(e[r][1].type==="labelImage"&&e[r][0]==="enter"){e[r][1];break}e[r+1][1].type="data",e[r+3][1].type="gfmFootnoteCallLabelMarker";const i={type:"gfmFootnoteCall",start:Object.assign({},e[r+3][1].start),end:Object.assign({},e[e.length-1][1].end)},o={type:"gfmFootnoteCallMarker",start:Object.assign({},e[r+3][1].end),end:Object.assign({},e[r+3][1].end)};o.end.column++,o.end.offset++,o.end._bufferIndex++;const u={type:"gfmFootnoteCallString",start:Object.assign({},o.end),end:Object.assign({},e[e.length-1][1].start)},d={type:"chunkString",contentType:"string",start:Object.assign({},u.start),end:Object.assign({},u.end)},f=[e[r+1],e[r+2],["enter",i,l],e[r+3],e[r+4],["enter",o,l],["exit",o,l],["enter",u,l],["enter",d,l],["exit",d,l],["exit",u,l],e[e.length-2],e[e.length-1],["exit",i,l]];return e.splice(r,e.length-r+1,...f),e}function tz(e,l,r){const i=this,o=i.parser.gfmFootnotes||(i.parser.gfmFootnotes=[]);let u=0,d;return f;function f(g){return e.enter("gfmFootnoteCall"),e.enter("gfmFootnoteCallLabelMarker"),e.consume(g),e.exit("gfmFootnoteCallLabelMarker"),p}function p(g){return g!==94?r(g):(e.enter("gfmFootnoteCallMarker"),e.consume(g),e.exit("gfmFootnoteCallMarker"),e.enter("gfmFootnoteCallString"),e.enter("chunkString").contentType="string",h)}function h(g){if(u>999||g===93&&!d||g===null||g===91||It(g))return r(g);if(g===93){e.exit("chunkString");const v=e.exit("gfmFootnoteCallString");return o.includes(Il(i.sliceSerialize(v)))?(e.enter("gfmFootnoteCallLabelMarker"),e.consume(g),e.exit("gfmFootnoteCallLabelMarker"),e.exit("gfmFootnoteCall"),l):r(g)}return It(g)||(d=!0),u++,e.consume(g),g===92?y:h}function y(g){return g===91||g===92||g===93?(e.consume(g),u++,h):h(g)}}function nz(e,l,r){const i=this,o=i.parser.gfmFootnotes||(i.parser.gfmFootnotes=[]);let u,d=0,f;return p;function p(S){return e.enter("gfmFootnoteDefinition")._container=!0,e.enter("gfmFootnoteDefinitionLabel"),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(S),e.exit("gfmFootnoteDefinitionLabelMarker"),h}function h(S){return S===94?(e.enter("gfmFootnoteDefinitionMarker"),e.consume(S),e.exit("gfmFootnoteDefinitionMarker"),e.enter("gfmFootnoteDefinitionLabelString"),e.enter("chunkString").contentType="string",y):r(S)}function y(S){if(d>999||S===93&&!f||S===null||S===91||It(S))return r(S);if(S===93){e.exit("chunkString");const A=e.exit("gfmFootnoteDefinitionLabelString");return u=Il(i.sliceSerialize(A)),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(S),e.exit("gfmFootnoteDefinitionLabelMarker"),e.exit("gfmFootnoteDefinitionLabel"),v}return It(S)||(f=!0),d++,e.consume(S),S===92?g:y}function g(S){return S===91||S===92||S===93?(e.consume(S),d++,y):y(S)}function v(S){return S===58?(e.enter("definitionMarker"),e.consume(S),e.exit("definitionMarker"),o.includes(u)||o.push(u),Nt(e,k,"gfmFootnoteDefinitionWhitespace")):r(S)}function k(S){return l(S)}}function lz(e,l,r){return e.check(_o,l,e.attempt(ZM,l,r))}function rz(e){e.exit("gfmFootnoteDefinition")}function az(e,l,r){const i=this;return Nt(e,o,"gfmFootnoteDefinitionIndent",5);function o(u){const d=i.events[i.events.length-1];return d&&d[1].type==="gfmFootnoteDefinitionIndent"&&d[2].sliceSerialize(d[1],!0).length===4?l(u):r(u)}}function iz(e){let r=(e||{}).singleTilde;const i={name:"strikethrough",tokenize:u,resolveAll:o};return r==null&&(r=!0),{text:{126:i},insideSpan:{null:[i]},attentionMarkers:{null:[126]}};function o(d,f){let p=-1;for(;++p<d.length;)if(d[p][0]==="enter"&&d[p][1].type==="strikethroughSequenceTemporary"&&d[p][1]._close){let h=p;for(;h--;)if(d[h][0]==="exit"&&d[h][1].type==="strikethroughSequenceTemporary"&&d[h][1]._open&&d[p][1].end.offset-d[p][1].start.offset===d[h][1].end.offset-d[h][1].start.offset){d[p][1].type="strikethroughSequence",d[h][1].type="strikethroughSequence";const y={type:"strikethrough",start:Object.assign({},d[h][1].start),end:Object.assign({},d[p][1].end)},g={type:"strikethroughText",start:Object.assign({},d[h][1].end),end:Object.assign({},d[p][1].start)},v=[["enter",y,f],["enter",d[h][1],f],["exit",d[h][1],f],["enter",g,f]],k=f.parser.constructs.insideSpan.null;k&&xl(v,v.length,0,Yu(k,d.slice(h+1,p),f)),xl(v,v.length,0,[["exit",g,f],["enter",d[p][1],f],["exit",d[p][1],f],["exit",y,f]]),xl(d,h-1,p-h+3,v),p=h+v.length-2;break}}for(p=-1;++p<d.length;)d[p][1].type==="strikethroughSequenceTemporary"&&(d[p][1].type="data");return d}function u(d,f,p){const h=this.previous,y=this.events;let g=0;return v;function v(S){return h===126&&y[y.length-1][1].type!=="characterEscape"?p(S):(d.enter("strikethroughSequenceTemporary"),k(S))}function k(S){const A=ss(h);if(S===126)return g>1?p(S):(d.consume(S),g++,k);if(g<2&&!r)return p(S);const N=d.exit("strikethroughSequenceTemporary"),R=ss(S);return N._open=!R||R===2&&!!A,N._close=!A||A===2&&!!R,f(S)}}}class sz{constructor(){this.map=[]}add(l,r,i){oz(this,l,r,i)}consume(l){if(this.map.sort(function(u,d){return u[0]-d[0]}),this.map.length===0)return;let r=this.map.length;const i=[];for(;r>0;)r-=1,i.push(l.slice(this.map[r][0]+this.map[r][1]),this.map[r][2]),l.length=this.map[r][0];i.push(l.slice()),l.length=0;let o=i.pop();for(;o;){for(const u of o)l.push(u);o=i.pop()}this.map.length=0}}function oz(e,l,r,i){let o=0;if(!(r===0&&i.length===0)){for(;o<e.map.length;){if(e.map[o][0]===l){e.map[o][1]+=r,e.map[o][2].push(...i);return}o+=1}e.map.push([l,r,i])}}function cz(e,l){let r=!1;const i=[];for(;l<e.length;){const o=e[l];if(r){if(o[0]==="enter")o[1].type==="tableContent"&&i.push(e[l+1][1].type==="tableDelimiterMarker"?"left":"none");else if(o[1].type==="tableContent"){if(e[l-1][1].type==="tableDelimiterMarker"){const u=i.length-1;i[u]=i[u]==="left"?"center":"right"}}else if(o[1].type==="tableDelimiterRow")break}else o[0]==="enter"&&o[1].type==="tableDelimiterRow"&&(r=!0);l+=1}return i}function uz(){return{flow:{null:{name:"table",tokenize:dz,resolveAll:fz}}}}function dz(e,l,r){const i=this;let o=0,u=0,d;return f;function f(O){let P=i.events.length-1;for(;P>-1;){const W=i.events[P][1].type;if(W==="lineEnding"||W==="linePrefix")P--;else break}const Q=P>-1?i.events[P][1].type:null,oe=Q==="tableHead"||Q==="tableRow"?D:p;return oe===D&&i.parser.lazy[i.now().line]?r(O):oe(O)}function p(O){return e.enter("tableHead"),e.enter("tableRow"),h(O)}function h(O){return O===124||(d=!0,u+=1),y(O)}function y(O){return O===null?r(O):Xe(O)?u>1?(u=0,i.interrupt=!0,e.exit("tableRow"),e.enter("lineEnding"),e.consume(O),e.exit("lineEnding"),k):r(O):yt(O)?Nt(e,y,"whitespace")(O):(u+=1,d&&(d=!1,o+=1),O===124?(e.enter("tableCellDivider"),e.consume(O),e.exit("tableCellDivider"),d=!0,y):(e.enter("data"),g(O)))}function g(O){return O===null||O===124||It(O)?(e.exit("data"),y(O)):(e.consume(O),O===92?v:g)}function v(O){return O===92||O===124?(e.consume(O),g):g(O)}function k(O){return i.interrupt=!1,i.parser.lazy[i.now().line]?r(O):(e.enter("tableDelimiterRow"),d=!1,yt(O)?Nt(e,S,"linePrefix",i.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(O):S(O))}function S(O){return O===45||O===58?N(O):O===124?(d=!0,e.enter("tableCellDivider"),e.consume(O),e.exit("tableCellDivider"),A):V(O)}function A(O){return yt(O)?Nt(e,N,"whitespace")(O):N(O)}function N(O){return O===58?(u+=1,d=!0,e.enter("tableDelimiterMarker"),e.consume(O),e.exit("tableDelimiterMarker"),R):O===45?(u+=1,R(O)):O===null||Xe(O)?X(O):V(O)}function R(O){return O===45?(e.enter("tableDelimiterFiller"),L(O)):V(O)}function L(O){return O===45?(e.consume(O),L):O===58?(d=!0,e.exit("tableDelimiterFiller"),e.enter("tableDelimiterMarker"),e.consume(O),e.exit("tableDelimiterMarker"),H):(e.exit("tableDelimiterFiller"),H(O))}function H(O){return yt(O)?Nt(e,X,"whitespace")(O):X(O)}function X(O){return O===124?S(O):O===null||Xe(O)?!d||o!==u?V(O):(e.exit("tableDelimiterRow"),e.exit("tableHead"),l(O)):V(O)}function V(O){return r(O)}function D(O){return e.enter("tableRow"),I(O)}function I(O){return O===124?(e.enter("tableCellDivider"),e.consume(O),e.exit("tableCellDivider"),I):O===null||Xe(O)?(e.exit("tableRow"),l(O)):yt(O)?Nt(e,I,"whitespace")(O):(e.enter("data"),F(O))}function F(O){return O===null||O===124||It(O)?(e.exit("data"),I(O)):(e.consume(O),O===92?ne:F)}function ne(O){return O===92||O===124?(e.consume(O),F):F(O)}}function fz(e,l){let r=-1,i=!0,o=0,u=[0,0,0,0],d=[0,0,0,0],f=!1,p=0,h,y,g;const v=new sz;for(;++r<e.length;){const k=e[r],S=k[1];k[0]==="enter"?S.type==="tableHead"?(f=!1,p!==0&&(a1(v,l,p,h,y),y=void 0,p=0),h={type:"table",start:Object.assign({},S.start),end:Object.assign({},S.end)},v.add(r,0,[["enter",h,l]])):S.type==="tableRow"||S.type==="tableDelimiterRow"?(i=!0,g=void 0,u=[0,0,0,0],d=[0,r+1,0,0],f&&(f=!1,y={type:"tableBody",start:Object.assign({},S.start),end:Object.assign({},S.end)},v.add(r,0,[["enter",y,l]])),o=S.type==="tableDelimiterRow"?2:y?3:1):o&&(S.type==="data"||S.type==="tableDelimiterMarker"||S.type==="tableDelimiterFiller")?(i=!1,d[2]===0&&(u[1]!==0&&(d[0]=d[1],g=gu(v,l,u,o,void 0,g),u=[0,0,0,0]),d[2]=r)):S.type==="tableCellDivider"&&(i?i=!1:(u[1]!==0&&(d[0]=d[1],g=gu(v,l,u,o,void 0,g)),u=d,d=[u[1],r,0,0])):S.type==="tableHead"?(f=!0,p=r):S.type==="tableRow"||S.type==="tableDelimiterRow"?(p=r,u[1]!==0?(d[0]=d[1],g=gu(v,l,u,o,r,g)):d[1]!==0&&(g=gu(v,l,d,o,r,g)),o=0):o&&(S.type==="data"||S.type==="tableDelimiterMarker"||S.type==="tableDelimiterFiller")&&(d[3]=r)}for(p!==0&&a1(v,l,p,h,y),v.consume(l.events),r=-1;++r<l.events.length;){const k=l.events[r];k[0]==="enter"&&k[1].type==="table"&&(k[1]._align=cz(l.events,r))}return e}function gu(e,l,r,i,o,u){const d=i===1?"tableHeader":i===2?"tableDelimiter":"tableData",f="tableContent";r[0]!==0&&(u.end=Object.assign({},es(l.events,r[0])),e.add(r[0],0,[["exit",u,l]]));const p=es(l.events,r[1]);if(u={type:d,start:Object.assign({},p),end:Object.assign({},p)},e.add(r[1],0,[["enter",u,l]]),r[2]!==0){const h=es(l.events,r[2]),y=es(l.events,r[3]),g={type:f,start:Object.assign({},h),end:Object.assign({},y)};if(e.add(r[2],0,[["enter",g,l]]),i!==2){const v=l.events[r[2]],k=l.events[r[3]];if(v[1].end=Object.assign({},k[1].end),v[1].type="chunkText",v[1].contentType="text",r[3]>r[2]+1){const S=r[2]+1,A=r[3]-r[2]-1;e.add(S,A,[])}}e.add(r[3]+1,0,[["exit",g,l]])}return o!==void 0&&(u.end=Object.assign({},es(l.events,o)),e.add(o,0,[["exit",u,l]]),u=void 0),u}function a1(e,l,r,i,o){const u=[],d=es(l.events,r);o&&(o.end=Object.assign({},d),u.push(["exit",o,l])),i.end=Object.assign({},d),u.push(["exit",i,l]),e.add(r+1,0,u)}function es(e,l){const r=e[l],i=r[0]==="enter"?"start":"end";return r[1][i]}const mz={name:"tasklistCheck",tokenize:hz};function pz(){return{text:{91:mz}}}function hz(e,l,r){const i=this;return o;function o(p){return i.previous!==null||!i._gfmTasklistFirstContentOfListItem?r(p):(e.enter("taskListCheck"),e.enter("taskListCheckMarker"),e.consume(p),e.exit("taskListCheckMarker"),u)}function u(p){return It(p)?(e.enter("taskListCheckValueUnchecked"),e.consume(p),e.exit("taskListCheckValueUnchecked"),d):p===88||p===120?(e.enter("taskListCheckValueChecked"),e.consume(p),e.exit("taskListCheckValueChecked"),d):r(p)}function d(p){return p===93?(e.enter("taskListCheckMarker"),e.consume(p),e.exit("taskListCheckMarker"),e.exit("taskListCheck"),f):r(p)}function f(p){return Xe(p)?l(p):yt(p)?e.check({tokenize:xz},l,r)(p):r(p)}}function xz(e,l,r){return Nt(e,i,"whitespace");function i(o){return o===null?r(o):l(o)}}function gz(e){return B0([FM(),WM(),iz(e),uz(),pz()])}const bz={};function yz(e){const l=this,r=e||bz,i=l.data(),o=i.micromarkExtensions||(i.micromarkExtensions=[]),u=i.fromMarkdownExtensions||(i.fromMarkdownExtensions=[]),d=i.toMarkdownExtensions||(i.toMarkdownExtensions=[]);o.push(gz(r)),u.push(IM()),d.push(PM(r))}function vz({thread:e}){return e.state==="available"?null:e.state==="working"?a.jsx("span",{className:"inline-flex items-center gap-1 shrink-0",style:{color:b.muted},children:a.jsx(Zu,{})}):a.jsxs("span",{className:"inline-flex items-center gap-1.5 text-[9px] font-mono tracking-wide shrink-0",style:{color:b.muted},children:[a.jsx("span",{className:`w-1.5 h-1.5 rounded-full ${Lo(e.state)}`}),a.jsx("span",{children:e.statusLabel})]})}function Zu({className:e=""}){return a.jsxs("span",{className:`inline-flex items-center gap-1 ${e}`,"aria-hidden":"true",children:[a.jsx("span",{className:"os-thinking-dot"}),a.jsx("span",{className:"os-thinking-dot"}),a.jsx("span",{className:"os-thinking-dot"})]})}function No({messages:e,showAnnotations:l,showStatusMessages:r,inkStyle:i,mutedStyle:o,tagStyle:u,annotStyle:d,agentLookup:f,directThreadLookup:p,onOpenAgentProfile:h,onOpenAgentChat:y,onNudgeMessage:g}){const[v,k]=E.useState(null),[S,A]=E.useState(null),[N,R]=E.useState(null),L=[];let H="",X=0;const V=E.useMemo(()=>r?e:e.filter(P=>P.messageClass!=="status"),[e,r]),D=E.useMemo(()=>new Map(V.map(P=>[P.id,P])),[V]),I=E.useMemo(()=>{let P=null;for(const Q of V)Q.isOperator&&Q.isDirectConversation&&Q.receipt&&(P=Q.id);return P},[V]);E.useEffect(()=>{if(!v)return;const P=window.setTimeout(()=>{k(Q=>Q===v?null:Q)},1400);return()=>window.clearTimeout(P)},[v]),E.useEffect(()=>{if(!S)return;const P=window.setTimeout(()=>{A(Q=>Q===S?null:Q)},1400);return()=>window.clearTimeout(P)},[S]),E.useEffect(()=>{if(!N)return;const P=window.setTimeout(()=>{R(Q=>Q===N?null:Q)},2200);return()=>window.clearTimeout(P)},[N]);const F=z.useCallback(async P=>{try{await kp(Eo(P)),k(P)}catch{k(null)}},[]),ne=z.useCallback(P=>{g?.(P),A(P.id)},[g]),O=z.useCallback(P=>{if(typeof document>"u")return;const Q=document.getElementById(Nm(P));Q&&(Q.scrollIntoView({block:"center",behavior:"smooth"}),R(P))},[]);for(;X<V.length;){const P=V[X],Q=EC(P.authorRole)?P.authorRole:null,oe=P.isOperator?null:f.get(P.authorId)??null,W=oe?p.get(oe.id)??null:null;if(P.dayLabel!==H&&(L.push(a.jsxs("div",{className:"flex items-center gap-3 mb-5 mt-2",children:[a.jsx("div",{className:"flex-1 h-px",style:{backgroundColor:b.border}}),a.jsx("div",{className:"px-2 font-mono text-[9px] tracking-widest uppercase shrink-0",style:o,children:P.dayLabel}),a.jsx("div",{className:"flex-1 h-px",style:{backgroundColor:b.border}})]},`day-${P.dayLabel}`)),H=P.dayLabel),P.isSystem||P.messageClass==="status"){L.push(a.jsxs("div",{className:"flex gap-3 mb-3 group rounded-lg px-2 py-2 -mx-2 bg-[var(--os-hover)]",children:[a.jsx("div",{className:"w-6 h-6 rounded-md flex items-center justify-center text-[9px] font-semibold shrink-0 mt-0.5",style:{backgroundColor:P.avatarColor,color:"white",opacity:.85},children:P.avatarLabel}),a.jsxs("div",{className:"flex-1 min-w-0",children:[a.jsx("div",{className:"flex items-baseline justify-between mb-0.5",children:a.jsx("div",{className:"flex items-baseline gap-2",children:oe?a.jsx(s1,{agent:oe,directThread:W,visibleRole:Q,timestampLabel:P.timestampLabel,inkStyle:i,mutedStyle:o,tagStyle:u,onOpenProfile:h,onOpenChat:y}):a.jsxs(a.Fragment,{children:[a.jsx("span",{className:"font-semibold text-[12px]",style:i,children:P.authorName}),a.jsx("span",{className:"text-[9px] font-mono",style:o,children:P.timestampLabel})]})})}),a.jsxs("div",{id:Nm(P.id),className:"group/message relative text-[12px] leading-relaxed rounded-lg px-2 py-1.5 pr-12 -mx-2",style:N===P.id?ey():i,children:[a.jsxs("div",{className:"flex items-center gap-2 px-2 py-1.5 border rounded font-mono text-[10px] w-fit",style:u,children:[a.jsx(xn,{className:"text-[10px]"}),a.jsxs("span",{children:[a.jsx("span",{style:o,children:"TASK //"})," ",P.body]}),a.jsx("span",{className:"ml-2 px-1 rounded",style:{backgroundColor:"rgba(99,102,241,0.12)",color:"var(--os-accent)"},children:"IN PROGRESS"})]}),a.jsx(i1,{message:P,copied:v===P.id,nudged:S===P.id,canNudge:!!(g&&!P.isOperator),mutedStyle:o,onCopyRef:F,onNudge:()=>ne(P)})]})]})]},P.id)),X+=1;continue}const J=[P];let w=X+1;for(;w<V.length&&V[w].authorId===P.authorId&&V[w].dayLabel===P.dayLabel&&!V[w].isSystem&&V[w].messageClass!=="status";)J.push(V[w]),w+=1;const Y=!!oe;L.push(a.jsxs("div",{className:Cn("flex gap-3 mb-4 group rounded-lg px-2 py-2 -mx-2",Y&&"bg-[var(--os-hover)]"),children:[a.jsx("div",{className:"w-6 h-6 rounded-md flex items-center justify-center text-[9px] font-semibold shrink-0 mt-0.5",style:{backgroundColor:P.avatarColor,color:"white",opacity:.85},children:P.avatarLabel}),a.jsxs("div",{className:"flex-1 min-w-0",children:[a.jsxs("div",{className:"flex items-baseline justify-between mb-1",children:[a.jsx("div",{className:"flex items-baseline gap-2",children:oe?a.jsx(s1,{agent:oe,directThread:W,visibleRole:Q,timestampLabel:P.timestampLabel,inkStyle:i,mutedStyle:o,tagStyle:u,onOpenProfile:h,onOpenChat:y}):a.jsxs(a.Fragment,{children:[a.jsx("span",{className:"font-semibold text-[12px]",style:i,children:P.authorName}),Q?a.jsx("span",{className:"text-[9px] font-mono border px-1 py-0.5 rounded",style:u,children:Q}):null,a.jsx("span",{className:"text-[9px] font-mono",style:o,children:P.timestampLabel})]})}),l&&(P.routingSummary||P.provenanceSummary)?a.jsxs("div",{className:"flex items-center gap-1",children:[P.routingSummary?a.jsx("span",{className:"text-[9px] font-mono border px-1 rounded",style:d,children:P.routingSummary}):null,P.provenanceSummary?a.jsx("span",{className:"text-[9px] font-mono border px-1 rounded",style:d,children:P.provenanceSummary}):null]}):null]}),a.jsx("div",{className:"flex flex-col gap-2 mt-0.5",children:J.map(G=>{const ve=G.replyToMessageId?D.get(G.replyToMessageId)??null:null,T=!!(G.receipt&&(!G.isOperator||!G.isDirectConversation||I===G.id)),B=T&&MC(G.body);return a.jsxs("div",{id:Nm(G.id),className:"group/message relative text-[12px] leading-relaxed rounded-lg px-2 py-1.5 pr-12 -mx-2",style:N===G.id?ey():i,children:[G.replyToMessageId?ve?a.jsx(o1,{messageId:G.replyToMessageId,preview:ip(ve.body,64),mutedStyle:o,onJump:()=>O(G.replyToMessageId)}):a.jsx(o1,{messageId:G.replyToMessageId,mutedStyle:o}):null,B&&G.receipt?a.jsxs("div",{className:"flex flex-wrap items-baseline gap-x-2 gap-y-1",children:[a.jsx("span",{className:"min-w-0 max-w-full whitespace-pre-wrap break-words",style:i,children:G.body}),a.jsx(c1,{receipt:G.receipt,mutedStyle:o,inline:!0})]}):a.jsxs(a.Fragment,{children:[a.jsx("div",{className:"flex flex-col gap-2",children:Sz(G.body,i,o,u)}),T&&G.receipt?a.jsx(c1,{receipt:G.receipt,mutedStyle:o}):null]}),l&&(G.routingSummary||G.provenanceSummary||G.provenanceDetail)?a.jsxs("div",{className:"flex flex-wrap items-center gap-1.5 mt-1.5",children:[G.routingSummary?a.jsx("span",{className:"text-[9px] font-mono border px-1 rounded",style:d,children:G.routingSummary}):null,G.provenanceSummary?a.jsx("span",{className:"text-[9px] font-mono border px-1 rounded",style:d,children:G.provenanceSummary}):null,G.provenanceDetail?a.jsx("span",{className:"text-[9px]",style:o,children:G.provenanceDetail}):null]}):null,a.jsx(i1,{message:G,copied:v===G.id,nudged:S===G.id,canNudge:!!(g&&!G.isOperator),mutedStyle:o,onCopyRef:F,onNudge:()=>ne(G)})]},G.id)})})]})]},P.id)),X=w}return a.jsx(a.Fragment,{children:L})}function i1({message:e,copied:l,nudged:r,canNudge:i,mutedStyle:o,onCopyRef:u,onNudge:d}){return a.jsxs("div",{className:"absolute top-1.5 right-2 flex items-center gap-2 opacity-0 pointer-events-none transition-opacity group-hover/message:opacity-100 group-hover/message:pointer-events-auto group-focus-within/message:opacity-100 group-focus-within/message:pointer-events-auto",children:[i?a.jsx("button",{type:"button",onClick:d,className:"text-[9px] font-mono lowercase tracking-wide transition-colors hover:opacity-80",style:r?{color:b.accent}:o,title:`Follow up with ${e.authorName}`,children:r?"drafted":"nudge"}):null,a.jsx("button",{type:"button",onClick:()=>{u(e.id)},className:"text-[9px] font-mono lowercase tracking-wide transition-colors hover:opacity-80",style:l?{color:b.accent}:o,title:Bv(e.id),children:l?"copied":FC(e.id)})]})}function s1({agent:e,directThread:l,visibleRole:r,timestampLabel:i,inkStyle:o,mutedStyle:u,tagStyle:d,onOpenProfile:f,onOpenChat:p}){const h=y=>{if(y.preventDefault(),y.stopPropagation(),y.metaKey||y.ctrlKey){p(e.id);return}f(e.id)};return a.jsxs("div",{className:"relative group/agent inline-flex items-baseline gap-2 min-w-0",children:[a.jsxs("button",{type:"button",onClick:h,className:"inline-flex items-baseline gap-2 min-w-0 text-left hover:opacity-90 transition-opacity",title:"Click for overview. Cmd-click to open direct chat.",children:[a.jsx("span",{className:"font-semibold text-[12px] truncate",style:o,children:e.title}),r?a.jsx("span",{className:"text-[9px] font-mono border px-1 py-0.5 rounded shrink-0",style:d,children:r}):null]}),a.jsx("span",{className:"text-[9px] font-mono shrink-0",style:u,children:i}),a.jsx(kz,{agent:e,directThread:l,mutedStyle:u,onOpenProfile:f,onOpenChat:p})]})}function jz({agent:e,directThread:l=null,variant:r="hero",mutedStyle:i={color:b.muted},borderColor:o=b.bg,actions:u=null}){const d=r==="hover",f=Zb(e.role),p=Zb(e.summary),h=l?.statusDetail??e.statusDetail??p??"Available as a local relay channel.";return a.jsxs(a.Fragment,{children:[a.jsxs("div",{className:"flex items-start gap-3",children:[a.jsxs("div",{className:"relative shrink-0",children:[a.jsx("div",{className:`${d?"w-8 h-8 text-[11px]":"w-10 h-10 text-[13px]"} rounded text-white flex items-center justify-center font-bold ${e.reachable?"":"opacity-40 grayscale"}`,style:{backgroundColor:hl(e.id)},children:e.title.charAt(0).toUpperCase()}),a.jsx("div",{className:`absolute -bottom-0.5 -right-0.5 w-2 h-2 rounded-full ${Lo(e.state)}`,style:{border:`1px solid ${o}`}})]}),a.jsxs("div",{className:"min-w-0 flex-1",children:[a.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[a.jsx("div",{className:d?"text-[12px] font-semibold truncate":"text-[15px] font-semibold tracking-tight",style:{color:b.ink},children:e.title}),a.jsx("span",{className:"text-[9px] font-mono uppercase px-1.5 py-0.5 rounded",style:{backgroundColor:b.tagBg,color:b.muted},children:Tv(e.profileKind)})]}),d?a.jsx("div",{className:"text-[10px] mt-1",style:i,children:h}):a.jsxs(a.Fragment,{children:[f?a.jsx("div",{className:"text-[11px] mt-1",style:{color:b.ink},children:f}):null,p?a.jsx("div",{className:"text-[12px] leading-[1.55] mt-2",style:{color:b.muted},children:p}):null]}),a.jsx("div",{className:`text-[10px] ${d?"mt-2 flex flex-wrap gap-x-3 gap-y-1":"mt-3 flex items-center gap-2 flex-wrap"}`,style:i,children:d?a.jsxs(a.Fragment,{children:[a.jsx("span",{children:e.harness??"runtime"}),a.jsx("span",{children:ii(e.projectRoot??e.cwd)??"no path"}),e.lastChatLabel?a.jsxs("span",{children:["last chat ",e.lastChatLabel]}):null]}):a.jsxs(a.Fragment,{children:[a.jsx("span",{children:e.lastChatLabel?`Last chat ${e.lastChatLabel}`:"No direct chat yet."}),e.lastSessionLabel?a.jsxs(a.Fragment,{children:[a.jsx("span",{className:"w-1 h-1 rounded-full",style:{backgroundColor:b.border}}),a.jsxs("span",{children:["Last session ",e.lastSessionLabel]})]}):null]})})]})]}),u?a.jsx("div",{className:"mt-3 flex items-center gap-2",children:u}):null]})}function Wi({children:e,icon:l,tone:r="neutral",...i}){return a.jsxs(Tt,{type:"button",variant:"outline",size:"sm",className:"h-8 rounded-xl px-3 text-[10px] font-medium shadow-none",style:r==="primary"?{backgroundColor:b.accentBg,borderColor:b.accentBorder,color:b.accent}:{backgroundColor:b.surface,borderColor:b.border,color:b.ink},...i,children:[l,e]})}function kz({agent:e,directThread:l,mutedStyle:r,onOpenProfile:i,onOpenChat:o}){return a.jsx("div",{className:"absolute left-0 top-full z-30 mt-2 w-72 rounded-xl border p-3 shadow-lg opacity-0 pointer-events-none translate-y-1 transition-all duration-150 group-hover/agent:opacity-100 group-hover/agent:pointer-events-auto group-hover/agent:translate-y-0 group-focus-within/agent:opacity-100 group-focus-within/agent:pointer-events-auto group-focus-within/agent:translate-y-0",style:{borderColor:b.border,backgroundColor:b.surface},children:a.jsx(jz,{agent:e,directThread:l,variant:"hover",mutedStyle:r,borderColor:b.surface,actions:a.jsxs(a.Fragment,{children:[a.jsx("button",{type:"button",className:"os-toolbar-button flex items-center gap-1 text-[10px] font-medium px-2 py-1 rounded",style:{color:b.ink},onClick:u=>{u.preventDefault(),u.stopPropagation(),o(e.id)},children:"Message"}),a.jsx("button",{type:"button",className:"os-toolbar-button flex items-center gap-1 text-[10px] font-medium px-2 py-1 rounded",style:{color:b.ink},onClick:u=>{u.preventDefault(),u.stopPropagation(),i(e.id)},children:"Overview"}),a.jsx("span",{className:"ml-auto text-[9px] font-mono",style:r,children:"Cmd-click to DM"})]})})})}function o1({messageId:e,preview:l,mutedStyle:r,onJump:i}){return a.jsxs("div",{className:"mb-1 flex items-center gap-1.5 text-[9px] leading-none min-w-0",style:{...r,opacity:.7},children:[a.jsx(JN,{size:9,className:"shrink-0"}),i?a.jsx("button",{type:"button",onClick:i,className:"hover:underline underline-offset-2 truncate min-w-0",title:Bv(e),children:l||Eo(e)}):a.jsx("span",{className:"font-mono shrink-0",children:Eo(e)})]})}function c1({receipt:e,mutedStyle:l,inline:r=!1}){const i=RC(e.state);return a.jsxs("div",{className:`${r?"":"mt-1.5 "}inline-flex items-center gap-1.5 text-[10px] leading-none shrink-0`,style:{...l,color:i.color},title:e.detail??e.label,children:[a.jsx(Nz,{state:e.state}),a.jsx("span",{className:"font-mono uppercase tracking-[0.14em]",children:e.label}),e.state==="replied"&&e.detail?a.jsx("span",{style:l,children:e.detail}):null]})}function Nz({state:e}){switch(e){case"replied":return a.jsx(qw,{size:11});case"working":return a.jsx(Zu,{className:"text-[var(--os-accent)]"});case"seen":return a.jsx(Mu,{size:11});case"delivered":return a.jsx(Mu,{size:11});default:return a.jsx(So,{size:11})}}function rs({size:e=16,strokeWidth:l=1.35,style:r}){return a.jsx(_1,{size:e,strokeWidth:l,className:"shrink-0",style:r,"aria-hidden":"true"})}function Tj({id:e,active:l,size:r=12}){const i=l?{color:b.accent}:void 0;return e==="voice"?a.jsx(ep,{size:r,className:"os-row-icon shrink-0",style:i}):e==="system"?a.jsx(ni,{size:r,className:"os-row-icon shrink-0",style:i}):e==="mentions"?a.jsx(Ep,{size:r,className:"os-row-icon shrink-0",style:i}):e==="coordination"?a.jsx(Bl,{size:r,className:"os-row-icon shrink-0",style:i}):e==="all-traffic"?a.jsx(Pw,{size:r,className:"os-row-icon shrink-0",style:i}):a.jsx(gw,{size:r,className:"os-row-icon shrink-0",style:i})}function wz({relayState:e,appSettings:l,destinationKind:r,destinationId:i,body:o,replyToMessageId:u,clientMessageId:d}){const f=Date.now(),p=e?.operatorId??"operator",h=IC(e,l),y=r==="direct"?Array.from(new Set([i,...Jb(o)])):Jb(o),g=r==="channel"?i:r==="direct"?null:"shared",v=r==="channel"&&i==="voice",k=r==="channel"&&i==="system";return{id:`pending-${d}`,clientMessageId:d,conversationId:HC(r,i),createdAt:f,replyToMessageId:u,authorId:p,authorName:h,authorRole:null,body:o,timestampLabel:DC(f),dayLabel:_C(f),normalizedChannel:g,recipients:y,isDirectConversation:r==="direct",isSystem:k,isVoice:v,messageClass:k?"system":"agent",routingSummary:y.length>0?`Targets ${y.join(", ")}`:null,provenanceSummary:"via desktop · sending",provenanceDetail:null,isOperator:!0,avatarLabel:h.slice(0,1).toUpperCase()||"A",avatarColor:hl(p),receipt:{state:"sent",label:"Sending…",detail:null}}}function Sz(e,l,r,i){const o={"--os-markdown-ink":String(l.color??b.ink),"--os-markdown-muted":String(r.color??b.muted),"--os-markdown-link":b.accent,"--os-markdown-border":b.border,"--os-markdown-surface":String(i.backgroundColor??b.tagBg),"--os-markdown-inline-border":String(i.borderColor??b.border),"--os-markdown-code-bg":b.termBg,"--os-markdown-code-fg":b.termFg};return a.jsx("div",{className:"os-markdown",style:o,children:a.jsx(iR,{remarkPlugins:[yz],components:{a:({href:u,children:d})=>a.jsx("a",{href:u,target:"_blank",rel:"noreferrer",children:d}),blockquote:({children:u})=>a.jsx("blockquote",{children:u}),code:({className:u,children:d,...f})=>{const p=/language-([\w-]+)/.exec(u??"")?.[1],h=String(d).replace(/\n$/,"");return!p&&!h.includes(`
91
+ `)?a.jsx("code",{className:"os-markdown-inline-code",...f,children:h}):a.jsxs("div",{className:"os-markdown-code-block",children:[a.jsx("div",{className:"os-markdown-code-header",children:a.jsx("span",{children:p??"code"})}),a.jsx("pre",{className:"os-markdown-pre",children:a.jsx("code",{className:u,...f,children:h})})]})},h1:({children:u})=>a.jsx("h1",{children:u}),h2:({children:u})=>a.jsx("h2",{children:u}),h3:({children:u})=>a.jsx("h3",{children:u}),hr:()=>a.jsx("hr",{}),pre:({children:u})=>a.jsx(a.Fragment,{children:u}),table:({children:u})=>a.jsx("div",{className:"os-markdown-table-wrap",children:a.jsx("table",{children:u})})},children:e})})}async function kp(e){if(typeof navigator<"u"&&navigator.clipboard?.writeText){await navigator.clipboard.writeText(e);return}if(typeof document<"u"){const l=document.createElement("textarea");l.value=e,l.setAttribute("readonly","true"),l.style.position="fixed",l.style.opacity="0",document.body.appendChild(l),l.select();const r=document.execCommand("copy");if(document.body.removeChild(l),r)return}throw new Error("Clipboard unavailable.")}function Cz(){return typeof crypto<"u"&&typeof crypto.randomUUID=="function"?`client-${crypto.randomUUID()}`:`client-${Date.now().toString(36)}-${Math.random().toString(36).slice(2,8)}`}function u1({title:e,subtitle:l,layout:r,roster:i}){return r.isCollapsed?null:a.jsxs("div",{style:{width:r.sidebarWidth,...r.styles.sidebar},className:"relative flex flex-col h-full border-r shrink-0 z-10 overflow-hidden",children:[a.jsx("div",{className:"absolute right-[-3px] top-0 bottom-0 w-1.5 cursor-col-resize hover:bg-indigo-400 z-20 transition-colors",onMouseDown:r.onResizeStart}),a.jsxs("div",{className:"px-4 h-14 flex items-center justify-between border-b",style:{borderBottomColor:b.border},children:[a.jsxs("div",{children:[a.jsx("h1",{className:"text-[13px] font-semibold tracking-tight",style:r.styles.inkText,children:e}),a.jsx("div",{className:"text-[10px] font-mono mt-0.5",style:r.styles.mutedText,children:l})]}),a.jsx("button",{className:"p-1.5 rounded transition-opacity hover:opacity-70",style:r.styles.mutedText,onClick:i.onRefresh,children:a.jsx(gn,{size:14})})]}),a.jsx("div",{className:"flex-1 overflow-y-auto py-3",children:a.jsxs("div",{className:"mb-3 px-2",children:[a.jsx("div",{className:"font-mono text-[9px] tracking-widest uppercase mb-1.5 px-2",style:r.styles.mutedText,children:"Roster"}),a.jsxs("div",{className:"flex items-center justify-end gap-2 px-2 mb-2 relative",children:[a.jsxs("div",{className:"relative",children:[a.jsxs("button",{className:"os-toolbar-button flex items-center gap-1 text-[10px] px-2 py-1 rounded",style:{color:b.ink},onClick:()=>i.setAgentRosterMenu(o=>o==="filter"?null:"filter"),title:"Filter roster",children:[a.jsx(cw,{size:11}),a.jsx("span",{style:r.styles.mutedText,children:SC(i.agentRosterFilter)})]}),i.agentRosterMenu==="filter"?a.jsx("div",{className:"absolute right-0 top-full mt-1 w-36 rounded-lg border shadow-sm z-20",style:{backgroundColor:b.surface,borderColor:b.border},children:[["all","All Agents"],["active","Active Only"]].map(([o,u])=>a.jsx("button",{className:"w-full text-left px-3 py-2 text-[11px] transition-opacity hover:opacity-80",style:o===i.agentRosterFilter?r.styles.activeItem:r.styles.inkText,onClick:()=>{i.setAgentRosterFilter(o),i.setAgentRosterMenu(null)},children:u},o))}):null]}),a.jsxs("div",{className:"relative",children:[a.jsxs("button",{className:"os-toolbar-button flex items-center gap-1 text-[10px] px-2 py-1 rounded",style:{color:b.ink},onClick:()=>i.setAgentRosterMenu(o=>o==="sort"?null:"sort"),title:"Sort roster",children:[a.jsx(DN,{size:11}),a.jsx("span",{style:r.styles.mutedText,children:CC(i.agentRosterSort)})]}),i.agentRosterMenu==="sort"?a.jsx("div",{className:"absolute right-0 top-full mt-1 w-36 rounded-lg border shadow-sm z-20",style:{backgroundColor:b.surface,borderColor:b.border},children:[["chat","Recent Chat"],["code","Code Changes"],["session","Dev Sessions"],["alpha","A-Z"]].map(([o,u])=>a.jsx("button",{className:"w-full text-left px-3 py-2 text-[11px] transition-opacity hover:opacity-80",style:o===i.agentRosterSort?r.styles.activeItem:r.styles.inkText,onClick:()=>{i.setAgentRosterSort(o),i.setAgentRosterMenu(null)},children:u},o))}):null]})]}),a.jsx("div",{className:"flex flex-col gap-px",children:i.rosterInterAgentAgents.length>0?i.rosterInterAgentAgents.map(o=>{const u=i.selectedInterAgentId===o.id;return a.jsxs("button",{onClick:()=>i.onSelectInterAgent(o.id),className:"flex items-center gap-2 px-2 py-2 rounded text-[12px] transition-opacity w-full text-left",style:u?r.styles.activeItem:r.styles.mutedText,children:[a.jsxs("div",{className:"relative shrink-0",children:[a.jsx("div",{className:`w-6 h-6 rounded text-white flex items-center justify-center text-[9px] font-bold ${o.reachable?"":"opacity-40 grayscale"}`,style:{backgroundColor:hl(o.id)},children:o.title.charAt(0).toUpperCase()}),a.jsx("div",{className:`absolute -bottom-0.5 -right-0.5 w-1.5 h-1.5 rounded-full ${Lo(o.state)}`,style:{border:`1px solid ${b.bg}`}})]}),a.jsxs("div",{className:"flex-1 min-w-0",children:[a.jsxs("div",{className:"font-medium truncate",style:r.styles.inkText,children:[o.title,(i.rosterAgentTitleCounts.get(o.title)??0)>1&&o.branch?a.jsx("span",{className:"font-normal ml-1 text-[10px]",style:r.styles.mutedText,children:o.branch}):null]}),a.jsx("div",{className:"text-[10px] truncate",style:r.styles.mutedText,children:TC(o,i.agentRosterSort)})]}),a.jsx("span",{className:"text-[9px] font-mono px-1.5 py-0.5 rounded",style:u?r.styles.activePill:r.styles.tagBadge,children:o.threadCount})]},o.id)}):a.jsx("div",{className:"px-3 py-8 text-[12px] text-center",style:r.styles.mutedText,children:"No agents match this view yet."})})]})})]})}function Tz({activeView:e,layout:l,roster:r,agents:i,logs:o,interAgent:u,sessions:d}){if(e==="agents"){const f=r.rosterInterAgentAgents.length===r.interAgentAgents.length?`${r.interAgentAgents.length} agents`:`${r.rosterInterAgentAgents.length} visible · ${r.interAgentAgents.length} total`;return a.jsxs(a.Fragment,{children:[a.jsx(u1,{title:"Agents",subtitle:f,layout:l,roster:r}),a.jsxs("div",{className:"flex-1 flex flex-col relative min-w-0",style:l.styles.surface,children:[a.jsx("div",{className:"border-b px-4 py-3 shrink-0",style:{...l.styles.surface,borderBottomColor:b.border},children:i.selectedInterAgent?a.jsxs("div",{className:"flex items-center justify-between gap-3",children:[a.jsxs("div",{className:"flex items-center gap-3 min-w-0 flex-1",children:[a.jsxs("div",{className:"relative shrink-0",children:[a.jsx("div",{className:`w-9 h-9 rounded-xl text-[13px] text-white flex items-center justify-center font-bold ${i.selectedInterAgent.reachable?"":"opacity-40 grayscale"}`,style:{backgroundColor:hl(i.selectedInterAgent.id)},children:i.selectedInterAgent.title.charAt(0).toUpperCase()}),a.jsx("div",{className:`absolute -bottom-0.5 -right-0.5 w-2.5 h-2.5 rounded-full ${Lo(i.selectedInterAgent.state)}`,style:{border:`1px solid ${b.surface}`}})]}),a.jsxs("div",{className:"min-w-0 flex-1",children:[a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx("div",{className:"text-[15px] font-semibold tracking-tight truncate",style:l.styles.inkText,children:i.selectedInterAgent.title}),a.jsx("span",{className:"text-[9px] font-mono uppercase px-1.5 py-0.5 rounded",style:i.selectedInterAgent.state==="working"?l.styles.activePill:l.styles.tagBadge,children:i.selectedInterAgent.statusLabel})]}),a.jsx("div",{className:"text-[11px] mt-0.5 truncate max-w-2xl",style:l.styles.mutedText,children:i.selectedInterAgent.statusDetail??i.selectedInterAgent.summary??null})]})]}),a.jsxs("div",{className:"flex items-center gap-1.5 shrink-0",children:[a.jsx(Wi,{icon:a.jsx(Bl,{size:13}),tone:i.selectedInterAgentDirectThread?"primary":"neutral",onClick:()=>i.onOpenAgentThread(i.selectedInterAgent.id,{focusComposer:!0}),children:i.selectedInterAgentChatActionLabel}),a.jsx(Wi,{icon:a.jsx(Jm,{size:13}),onClick:i.onPeekAgentSession,children:"Peek"}),a.jsx(Wi,{icon:a.jsx(ni,{size:13}),onClick:()=>i.onOpenAgentSettings(i.selectedInterAgent.id,i.selectedInterAgent.profileKind==="project"),children:i.selectedInterAgent.profileKind==="project"?"Configure":"Settings"})]})]}):a.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[a.jsx(ts,{size:14,style:l.styles.mutedText}),a.jsxs("div",{className:"min-w-0",children:[a.jsx("div",{className:"text-[13px] font-semibold tracking-tight truncate",style:l.styles.inkText,children:"Agents"}),a.jsx("div",{className:"text-[10px] truncate mt-0.5",style:l.styles.mutedText,children:"Select an agent to inspect its operational snapshot and recent threads."})]})]})}),a.jsx("div",{className:"flex-1 overflow-y-auto px-4 py-4",children:i.selectedInterAgent?a.jsxs("div",{className:"flex flex-col gap-4",children:[a.jsxs("section",{className:"border rounded-xl overflow-hidden",style:{...l.styles.surface,borderColor:b.border},children:[a.jsxs("div",{className:"px-4 py-3 border-b flex items-center justify-between gap-3",style:{backgroundColor:b.surface,borderBottomColor:b.border},children:[a.jsx("div",{className:"min-w-0",children:a.jsx("div",{className:"text-[10px] font-mono tracking-widest uppercase",style:{color:b.accent},children:"Live Session"})}),a.jsxs("div",{className:"flex items-center gap-2 shrink-0",children:[i.visibleAgentSession?.commandLabel?a.jsx(Wi,{icon:a.jsx(Or,{size:13}),onClick:i.onCopyAgentSessionCommand,children:i.agentSessionCopied?"Copied":"Copy"}):null,i.visibleAgentSession?.mode==="trace"?a.jsx(Wi,{icon:a.jsx(Jm,{size:13}),onClick:i.onPeekAgentSession,children:"Open Trace"}):null,i.visibleAgentSession?.mode==="debug"?a.jsx(Wi,{icon:a.jsx(xa,{size:13}),onClick:i.onOpenAgentSession,children:i.visibleAgentSession.debugMode==="tmux"?"Open TMUX":"Open Debug"}):null]})]}),a.jsx("div",{className:"px-4 py-4 max-h-[320px] overflow-y-auto",style:{backgroundColor:b.bg},children:i.selectedInterAgentActivityMessages.length>0?a.jsx(No,{messages:i.selectedInterAgentActivityMessages.slice(-8),showAnnotations:!1,showStatusMessages:!1,inkStyle:l.styles.inkText,mutedStyle:l.styles.mutedText,tagStyle:l.styles.tagBadge,annotStyle:l.styles.annotBadge,agentLookup:i.interAgentAgentLookup,directThreadLookup:i.relayDirectLookup,onOpenAgentProfile:i.onOpenAgentProfile,onOpenAgentChat:(p,h)=>i.onOpenAgentThread(p,{draft:h,focusComposer:!0}),onNudgeMessage:i.onNudgeMessage}):a.jsx("div",{className:"text-[11px] leading-[1.6]",style:l.styles.mutedText,children:"No messages yet. Use the broker to send this agent a task."})}),a.jsxs(wu,{open:i.agentSessionLogsExpanded,onOpenChange:i.setAgentSessionLogsExpanded,children:[a.jsx(Su,{asChild:!0,children:a.jsx("button",{className:"w-full px-4 py-2 border-t flex items-center justify-between gap-2 text-[10px] hover:opacity-90 transition-opacity text-left",style:{borderTopColor:b.border,backgroundColor:b.bg,color:b.muted},children:a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx(_l,{size:10,className:"transition-transform duration-150",style:{transform:i.agentSessionLogsExpanded?"rotate(90deg)":void 0}}),a.jsx("span",{className:"font-mono uppercase tracking-wider",children:i.visibleAgentSession?.mode==="trace"?"Trace":"Session"}),a.jsx("span",{className:"text-[9px] font-mono uppercase px-1.5 py-0.5 rounded",style:i.visibleAgentSession?.mode==="trace"?l.styles.activePill:l.styles.tagBadge,children:i.agentSessionPending?"Loading":i.visibleAgentSession?.mode==="trace"?"Trace":i.visibleAgentSession?.debugMode==="tmux"?"TMUX":i.visibleAgentSession?.debugMode==="logs"?"Debug":"Unavailable"}),i.visibleAgentSession?.updatedAtLabel?a.jsxs("span",{children:["Updated ",i.visibleAgentSession.updatedAtLabel]}):null]})})}),a.jsxs(Cu,{children:[a.jsx("div",{style:{backgroundColor:i.visibleAgentSession?.mode==="trace"?b.bg:b.termBg},children:i.agentSessionLoading&&!i.visibleAgentSession?a.jsx("div",{className:"px-4 py-8 text-[11px] font-mono",style:{color:b.termFg},children:"Loading live session…"}):i.visibleAgentSession?.mode==="trace"&&i.visibleAgentSession.trace?a.jsx("div",{ref:p=>{i.agentSessionInlineViewportRef.current=p},onScroll:i.onInlineAgentSessionScroll,className:"max-h-[400px] overflow-y-auto px-4 py-4",children:a.jsx($p,{snapshot:i.visibleAgentSession.trace,onIntent:i.onAgentSessionTraceIntent})}):i.visibleAgentSession?.body?a.jsx("pre",{ref:p=>{i.agentSessionInlineViewportRef.current=p},onScroll:i.onInlineAgentSessionScroll,className:"px-4 py-4 text-[11px] leading-[1.6] overflow-x-auto whitespace-pre-wrap break-words max-h-[400px] overflow-y-auto",style:{color:b.termFg,fontFamily:"ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace"},children:i.visibleAgentSession.body}):a.jsx("div",{className:"px-4 py-8 text-[11px] leading-[1.65] font-mono",style:{color:b.termFg},children:i.agentSessionPending?"Loading live session state.":i.visibleAgentSession?.subtitle??"No session output available yet."})}),a.jsxs("div",{className:"px-4 h-10 border-t flex items-center justify-between gap-3 text-[10px]",style:{borderTopColor:b.border,backgroundColor:b.bg,color:b.muted},children:[a.jsx("div",{className:"truncate min-w-0 font-mono",children:i.renderLocalPathValue(i.visibleAgentSession?.pathLabel??ii(i.selectedInterAgent.cwd??i.selectedInterAgent.projectRoot)??"No stable session path yet.",{className:"text-left underline underline-offset-2 decoration-dotted hover:opacity-80 transition-opacity"})}),i.agentSessionFeedback?a.jsx("div",{className:"shrink-0",style:l.styles.inkText,children:i.agentSessionFeedback}):null]})]})]})]}),a.jsxs("section",{className:"border rounded-xl overflow-hidden",style:{...l.styles.surface,borderColor:b.border},children:[a.jsxs("div",{className:"px-4 py-3 border-b flex items-center justify-between gap-3",style:{borderBottomColor:b.border,backgroundColor:b.surface},children:[a.jsx("div",{className:"min-w-0",children:a.jsx("div",{className:"text-[10px] font-mono tracking-widest uppercase",style:{color:b.accent},children:"Recent Activity"})}),a.jsxs("div",{className:"flex items-center gap-2 shrink-0 flex-wrap justify-end",children:[a.jsxs("span",{className:"text-[9px] font-mono uppercase px-1.5 py-0.5 rounded",style:l.styles.tagBadge,children:[i.selectedInterAgentActivityMessages.length," events"]}),i.selectedInterAgentInboundTasks.length>0?a.jsxs("span",{className:"text-[9px] font-mono uppercase px-1.5 py-0.5 rounded",style:l.styles.activePill,children:[i.selectedInterAgentInboundTasks.length," asks"]}):null,i.selectedInterAgentOutboundFindings.length>0?a.jsxs("span",{className:"text-[9px] font-mono uppercase px-1.5 py-0.5 rounded",style:{backgroundColor:"rgba(248, 113, 113, 0.14)",color:"#b91c1c"},children:[i.selectedInterAgentOutboundFindings.length," waiting"]}):null]})]}),i.selectedInterAgentFindings.length>0?a.jsx("div",{className:"px-4 py-3 border-b flex flex-col gap-2",style:{borderBottomColor:b.border,backgroundColor:b.bg},children:i.selectedInterAgentFindings.slice(0,2).map(p=>a.jsxs("div",{className:"rounded-lg border px-3 py-2",style:{borderColor:p.severity==="error"?"rgba(248, 113, 113, 0.28)":"rgba(245, 158, 11, 0.28)",backgroundColor:p.severity==="error"?"rgba(248, 113, 113, 0.08)":"rgba(245, 158, 11, 0.08)"},children:[a.jsxs("div",{className:"flex items-center justify-between gap-3",children:[a.jsx("div",{className:"text-[11px] font-medium",style:l.styles.inkText,children:p.title}),a.jsx("span",{className:"text-[9px] font-mono uppercase",style:l.styles.mutedText,children:p.ageLabel??p.updatedAtLabel??"Open"})]}),a.jsx("div",{className:"text-[11px] mt-1",style:l.styles.mutedText,children:p.summary})]},p.id))}):null,a.jsxs("div",{className:"px-4 py-4 max-h-[280px] overflow-y-auto",style:{backgroundColor:b.bg},children:[i.selectedInterAgentActivityMessages.length>0?a.jsx(No,{messages:i.agentActivityExpanded?i.selectedInterAgentActivityMessages:i.selectedInterAgentActivityMessages.slice(-5),showAnnotations:!0,showStatusMessages:!0,inkStyle:l.styles.inkText,mutedStyle:l.styles.mutedText,tagStyle:l.styles.tagBadge,annotStyle:l.styles.annotBadge,agentLookup:i.interAgentAgentLookup,directThreadLookup:i.relayDirectLookup,onOpenAgentProfile:i.onOpenAgentProfile,onOpenAgentChat:(p,h)=>i.onOpenAgentThread(p,{draft:h,focusComposer:!0}),onNudgeMessage:i.onNudgeMessage}):a.jsx("div",{className:"text-[11px] leading-[1.6]",style:l.styles.mutedText,children:"No broker-visible activity for this agent yet."}),i.selectedInterAgentActivityMessages.length>5&&!i.agentActivityExpanded?a.jsxs("button",{className:"w-full text-center py-2 text-[11px] font-medium hover:opacity-80 transition-opacity",style:{color:b.accent},onClick:()=>i.setAgentActivityExpanded(!0),children:["Show all ",i.selectedInterAgentActivityMessages.length," events"]}):null]})]}),a.jsx(wu,{open:i.agentThreadsExpanded,onOpenChange:i.setAgentThreadsExpanded,children:a.jsxs("section",{className:"border rounded-xl overflow-hidden",style:{...l.styles.surface,borderColor:b.border},children:[a.jsx(Su,{asChild:!0,children:a.jsx("button",{className:"w-full px-4 py-3 flex items-center justify-between gap-3 hover:opacity-90 transition-opacity text-left",style:{backgroundColor:b.surface},children:a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx(_l,{size:12,className:"transition-transform duration-150",style:{color:b.muted,transform:i.agentThreadsExpanded?"rotate(90deg)":void 0}}),a.jsx("div",{className:"text-[10px] font-mono tracking-widest uppercase",style:{color:b.accent},children:"Open Threads"}),a.jsx("span",{className:"text-[9px] font-mono px-1.5 py-0.5 rounded",style:l.styles.tagBadge,children:i.visibleInterAgentThreads.length+1})]})})}),a.jsx(Cu,{children:a.jsxs("div",{className:"px-4 py-3 border-t flex flex-col gap-3",style:{borderTopColor:b.border},children:[a.jsxs("div",{className:"border rounded-lg px-3 py-3",style:{borderColor:b.border,backgroundColor:b.bg},children:[a.jsxs("div",{className:"flex items-start justify-between gap-3",children:[a.jsxs("div",{className:"min-w-0",children:[a.jsx("div",{className:"text-[13px] font-medium truncate",style:l.styles.inkText,children:"Direct Line"}),a.jsxs("div",{className:"text-[10px] truncate mt-1",style:l.styles.mutedText,children:["You and ",i.selectedInterAgent.title]})]}),a.jsx("span",{className:"text-[10px] font-mono shrink-0",style:l.styles.mutedText,children:i.selectedInterAgentDirectThread?.timestampLabel??i.selectedInterAgent.lastChatLabel??""})]}),a.jsx("div",{className:"text-[12px] leading-[1.55] mt-3",style:l.styles.mutedText,children:i.selectedAgentDirectLinePreview}),a.jsxs("div",{className:"flex items-center justify-between gap-3 mt-3",children:[a.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[a.jsx("span",{className:"text-[9px] font-mono uppercase px-1.5 py-0.5 rounded",style:l.styles.activePill,children:"Direct"}),a.jsx("span",{className:"text-[9px] font-mono uppercase px-1.5 py-0.5 rounded",style:l.styles.tagBadge,children:i.selectedInterAgent.statusLabel})]}),a.jsx("button",{className:"os-toolbar-button flex items-center gap-1 text-[10px] font-medium px-2 py-0.5 rounded shrink-0",style:{color:b.ink},onClick:()=>i.onOpenAgentThread(i.selectedInterAgent.id,{focusComposer:!0}),children:i.selectedInterAgentChatActionLabel})]})]}),i.visibleInterAgentThreads.length>0?a.jsx("div",{className:"flex flex-col gap-3",children:i.visibleInterAgentThreads.map(p=>a.jsxs("div",{className:"border rounded-lg px-3 py-3",style:{borderColor:b.border,backgroundColor:i.selectedInterAgentThreadId===p.id?b.bg:b.surface},children:[a.jsxs("div",{className:"flex items-start justify-between gap-3",children:[a.jsxs("div",{className:"min-w-0",children:[a.jsx("div",{className:"text-[13px] font-medium truncate",style:l.styles.inkText,children:rp(p,i.selectedInterAgent.id)}),a.jsx("div",{className:"text-[10px] truncate mt-1",style:l.styles.mutedText,children:ap(p,i.selectedInterAgent.id)})]}),a.jsx("span",{className:"text-[10px] font-mono shrink-0",style:l.styles.mutedText,children:p.timestampLabel??""})]}),a.jsx("div",{className:"text-[12px] leading-[1.55] mt-3",style:l.styles.mutedText,children:p.preview??"No message preview yet."}),a.jsxs("div",{className:"flex items-center justify-between gap-3 mt-3",children:[a.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[a.jsx("span",{className:"text-[9px] font-mono uppercase px-1.5 py-0.5 rounded",style:p.sourceKind==="private"?l.styles.tagBadge:l.styles.activePill,children:p.sourceKind==="private"?"Private":"Targeted"}),a.jsxs("span",{className:"text-[9px] font-mono px-1.5 py-0.5 rounded",style:l.styles.tagBadge,children:[p.messageCount," msgs"]})]}),a.jsx("button",{className:"os-toolbar-button flex items-center gap-1 text-[10px] font-medium px-2 py-0.5 rounded",style:{color:b.ink},onClick:()=>i.onOpenThreadInTrafficView(p.id),children:"Open"})]})]},p.id))}):a.jsx("div",{className:"flex flex-col items-start gap-3",children:a.jsx("div",{className:"text-[11px] leading-[1.5]",style:l.styles.mutedText,children:"No other active channels for this agent yet."})})]})})]})}),a.jsx(wu,{open:i.agentSnapshotExpanded,onOpenChange:i.setAgentSnapshotExpanded,children:a.jsxs("section",{className:"border rounded-xl overflow-hidden",style:{...l.styles.surface,borderColor:b.border},children:[a.jsx(Su,{asChild:!0,children:a.jsxs("button",{className:"w-full px-4 py-3 flex items-center gap-2 hover:opacity-90 transition-opacity text-left",style:{backgroundColor:b.surface},children:[a.jsx(_l,{size:12,className:"transition-transform duration-150",style:{color:b.muted,transform:i.agentSnapshotExpanded?"rotate(90deg)":void 0}}),a.jsx("div",{className:"text-[10px] font-mono tracking-widest uppercase",style:{color:b.accent},children:"Operational Snapshot"})]})}),a.jsx(Cu,{children:a.jsx("div",{className:"px-4 py-3 border-t",style:{borderTopColor:b.border},children:a.jsx("div",{className:"grid grid-cols-2 gap-x-4 gap-y-3",children:[["Harness",i.visibleAgentConfig?.runtime.harness??i.selectedInterAgent.harness??"Not reported"],["Session",i.visibleAgentConfig?.runtime.sessionId??i.selectedInterAgent.sessionId??"Not reported"],["Transport",i.visibleAgentConfig?.runtime.transport??i.selectedInterAgent.transport??"Not reported"],["Wake Policy",i.visibleAgentConfig?.runtime.wakePolicy||i.selectedInterAgent.wakePolicy||"Not reported"],["Last Chat",i.selectedInterAgent.lastChatLabel??"Not reported"],["Last Dev Session",i.selectedInterAgent.lastSessionLabel??"Not reported"],["Last Code Change",i.selectedInterAgent.lastCodeChangeLabel??"Not reported"]].map(([p,h])=>a.jsxs("div",{className:"min-w-0",children:[a.jsx("div",{className:"text-[9px] font-mono uppercase tracking-widest mb-1",style:l.styles.mutedText,children:p}),a.jsx("div",{className:"text-[11px] leading-[1.45] break-words",style:l.styles.inkText,children:h})]},p))})})})]})})]}):a.jsxs("div",{className:"flex flex-col items-center justify-center h-64 text-center",children:[a.jsx("div",{className:"w-16 h-16 rounded-full flex items-center justify-center mb-4",style:{backgroundColor:b.accentBg},children:a.jsx(ts,{size:24,style:{color:b.accent}})}),a.jsx("h3",{className:"text-[15px] font-medium mb-1",style:l.styles.inkText,children:"No agent selected"}),a.jsx("p",{className:"text-[13px] max-w-sm",style:l.styles.mutedText,children:"Pick an agent from the left rail to inspect its profile, runtime binding, and recent communication."})]})})]})]})}if(e==="logs")return a.jsxs(a.Fragment,{children:[!l.isCollapsed&&a.jsxs("div",{style:{width:l.sidebarWidth,...l.styles.sidebar},className:"relative flex flex-col h-full border-r shrink-0 z-10 overflow-hidden",children:[a.jsx("div",{className:"absolute right-[-3px] top-0 bottom-0 w-1.5 cursor-col-resize hover:bg-indigo-400 z-20 transition-colors",onMouseDown:l.onResizeStart}),a.jsx("div",{className:"px-4 h-14 flex items-center border-b",style:{borderBottomColor:b.border},children:a.jsxs("div",{children:[a.jsx("h1",{className:"text-[13px] font-semibold tracking-tight",style:l.styles.inkText,children:"Logs"}),a.jsxs("div",{className:"text-[10px] font-mono mt-0.5",style:l.styles.mutedText,children:[o.logSources.length," sources"]})]})}),a.jsx("div",{className:"px-3 py-3 border-b",style:{borderBottomColor:b.border},children:a.jsx("input",{type:"text",value:o.logSourceQuery,onChange:f=>o.setLogSourceQuery(f.target.value),placeholder:"Filter sources…",className:"w-full rounded-lg border px-3 py-2 text-[11px] bg-transparent outline-none",style:{borderColor:b.border,color:b.ink}})}),a.jsx("div",{className:"flex-1 overflow-y-auto py-3",children:o.logSources.length===0?a.jsxs("div",{className:"px-4 py-6 text-center",children:[a.jsxs("div",{className:"flex justify-center gap-1 mb-2",children:[a.jsx("span",{className:"os-thinking-dot",style:{color:b.accent}}),a.jsx("span",{className:"os-thinking-dot",style:{color:b.accent}}),a.jsx("span",{className:"os-thinking-dot",style:{color:b.accent}})]}),a.jsx("div",{className:"text-[11px]",style:l.styles.mutedText,children:"Loading sources…"})]}):["runtime","app","agents"].map(f=>{const p=o.filteredLogSources.filter(y=>y.group===f);if(p.length===0)return null;const h=f==="runtime"?"Runtime":f==="app"?"App":"Agents";return a.jsxs("div",{className:"mb-3 px-2",children:[a.jsx("div",{className:"font-mono text-[9px] tracking-widest uppercase mb-1.5 px-2",style:l.styles.mutedText,children:h}),a.jsx("div",{className:"flex flex-col gap-px",children:p.map(y=>{const g=o.selectedLogSourceId===y.id;return a.jsxs("button",{onClick:()=>{o.setSelectedLogSourceId(y.id),o.setLogSearchQuery("")},className:"w-full text-left px-2 py-2 rounded transition-opacity hover:opacity-90",style:g?l.styles.activeItem:l.styles.mutedText,children:[a.jsx("div",{className:"text-[12px] font-medium truncate",style:l.styles.inkText,children:y.title}),a.jsx("div",{className:"text-[10px] truncate mt-0.5",style:l.styles.mutedText,children:y.subtitle})]},y.id)})})]},f)})})]}),a.jsxs("div",{className:"flex-1 flex flex-col relative min-w-0",style:l.styles.surface,children:[a.jsx("div",{className:"border-b flex items-center justify-between px-4 h-14 shrink-0 gap-4",style:{...l.styles.surface,borderBottomColor:b.border},children:a.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[a.jsx(Co,{size:14,style:l.styles.mutedText}),a.jsxs("div",{className:"min-w-0",children:[a.jsx("div",{className:"text-[13px] font-semibold tracking-tight truncate",style:l.styles.inkText,children:o.selectedLogSource?.title??"Logs"}),a.jsx("div",{className:"text-[10px] truncate mt-0.5",style:l.styles.mutedText,children:o.logContent?.updatedAtLabel?`${o.selectedLogSource?.subtitle??"Log tail"} · Updated ${o.logContent.updatedAtLabel}`:o.selectedLogSource?.subtitle??"Relay runtime, app, and relay agent logs."})]})]})}),a.jsxs("div",{className:"border-b px-4 py-3 flex items-center gap-3",style:{borderBottomColor:b.border},children:[a.jsx("input",{type:"text",value:o.logSearchQuery,onChange:f=>o.setLogSearchQuery(f.target.value),placeholder:"Filter visible lines…",className:"flex-1 rounded-lg border px-3 py-2 text-[11px] bg-transparent outline-none",style:{borderColor:b.border,color:b.ink}}),a.jsx("div",{className:"text-[10px] font-mono shrink-0",style:l.styles.mutedText,children:o.logContent?o.logContent.truncated?`Tail ${o.logContent.lineCount} lines`:`${o.logContent.lineCount} lines`:"No file"})]}),a.jsxs("div",{className:"flex-1 overflow-y-auto px-4 py-4",children:[o.selectedLogSource?a.jsx(Z1,{title:o.selectedLogSource.title,pathLabel:o.logContent?.pathLabel??o.selectedLogSource.pathLabel,body:o.logContent?.body??null,truncated:o.logContent?.truncated,lineCount:o.logContent?.lineCount,missing:o.logContent?.missing,loading:o.logsLoading,searchQuery:o.logSearchQuery,updatedAtLabel:o.logContent?.updatedAtLabel,minHeight:360}):a.jsx("div",{className:"flex flex-col items-center justify-center h-64 text-center",children:o.logCatalog?a.jsxs(a.Fragment,{children:[a.jsx("div",{className:"w-16 h-16 rounded-full flex items-center justify-center mb-4",style:{backgroundColor:b.accentBg},children:a.jsx(Co,{size:24,style:{color:b.accent}})}),a.jsx("h3",{className:"text-[15px] font-medium mb-1",style:l.styles.inkText,children:"No log selected"}),a.jsx("p",{className:"text-[13px] max-w-sm",style:l.styles.mutedText,children:"Pick a relay runtime, app, or relay agent source from the left rail."})]}):a.jsxs(a.Fragment,{children:[a.jsxs("div",{className:"flex justify-center gap-1 mb-3",children:[a.jsx("span",{className:"os-thinking-dot",style:{color:b.accent}}),a.jsx("span",{className:"os-thinking-dot",style:{color:b.accent}}),a.jsx("span",{className:"os-thinking-dot",style:{color:b.accent}})]}),a.jsx("p",{className:"text-[13px]",style:l.styles.mutedText,children:"Loading log sources…"})]})}),o.logsFeedback?a.jsx("div",{className:"text-[11px] leading-[1.5] mt-3",style:l.styles.inkText,children:o.logsFeedback}):null]}),a.jsx("div",{className:"h-7 border-t flex items-center justify-between px-4 shrink-0",style:{backgroundColor:b.bg,borderTopColor:b.border},children:a.jsx("span",{className:"text-[9px] font-mono",style:l.styles.mutedText,children:"Canonical relay runtime, app, and relay agent log tails"})})]})]});if(e==="inter-agent"){const f=r.rosterInterAgentAgents.length===r.interAgentAgents.length?r.interAgentStateSubtitle:`${r.rosterInterAgentAgents.length} visible · ${r.interAgentStateSubtitle}`;return a.jsxs(a.Fragment,{children:[a.jsx(u1,{title:r.interAgentStateTitle,subtitle:f,layout:l,roster:r}),a.jsxs("div",{className:"w-[336px] border-r shrink-0 overflow-hidden flex flex-col",style:{...l.styles.surface,borderRightColor:b.border},children:[a.jsxs("div",{className:"px-4 h-14 border-b flex flex-col justify-center",style:{borderBottomColor:b.border},children:[a.jsx("div",{className:"text-[10px] font-mono tracking-widest uppercase",style:l.styles.mutedText,children:"Agent Threads"}),a.jsx("div",{className:"text-[12px] mt-1",style:l.styles.inkText,children:u.selectedInterAgent?`${u.selectedInterAgent.title} · ${u.visibleInterAgentThreads.length} thread${u.visibleInterAgentThreads.length===1?"":"s"}`:"Select an agent"})]}),a.jsx("div",{className:"flex-1 overflow-y-auto",children:u.selectedInterAgent&&u.visibleInterAgentThreads.length>0?a.jsx("div",{className:"divide-y",style:{borderColor:b.border},children:u.visibleInterAgentThreads.map(p=>{const h=u.selectedInterAgentThreadId===p.id;return a.jsxs("button",{onClick:()=>u.setSelectedInterAgentThreadId(p.id),className:"w-full text-left px-4 py-3.5 transition-opacity hover:opacity-90",style:h?{backgroundColor:b.bg}:void 0,children:[a.jsxs("div",{className:"flex items-start justify-between gap-2 mb-1.5",children:[a.jsxs("div",{className:"min-w-0",children:[a.jsx("div",{className:"text-[12px] font-medium truncate",style:l.styles.inkText,children:rp(p,u.selectedInterAgent.id)}),a.jsx("div",{className:"mt-1",children:a.jsx("span",{className:"text-[9px] font-mono uppercase px-1.5 py-0.5 rounded",style:p.sourceKind==="private"?l.styles.tagBadge:l.styles.activePill,children:p.sourceKind==="private"?"Private":"Relay"})})]}),a.jsx("span",{className:"text-[10px] font-mono shrink-0",style:l.styles.mutedText,children:p.timestampLabel??""})]}),a.jsx("div",{className:"text-[10px] mb-1.5 truncate",style:l.styles.mutedText,children:ap(p,u.selectedInterAgent.id)}),a.jsx("div",{className:"text-[12px] leading-[1.45] line-clamp-2",style:l.styles.mutedText,children:p.preview??"No message preview yet."})]},p.id)})}):a.jsx("div",{className:"flex h-full items-center justify-center px-6 text-center",children:a.jsxs("div",{children:[a.jsx("div",{className:"w-14 h-14 rounded-full mx-auto mb-4 flex items-center justify-center",style:{backgroundColor:b.accentBg},children:a.jsx(rs,{size:22,style:{color:b.accent}})}),a.jsx("div",{className:"text-[14px] font-medium mb-1",style:l.styles.inkText,children:"No agent threads"}),a.jsx("div",{className:"text-[12px]",style:l.styles.mutedText,children:u.selectedInterAgent?`No inter-agent traffic for ${u.selectedInterAgent.title} yet.`:"Pick an agent to inspect its thread network."})]})})})]}),a.jsxs("div",{className:"flex-1 flex flex-col relative min-w-0",style:l.styles.surface,children:[a.jsxs("div",{className:"border-b flex items-center justify-between px-4 h-14 shrink-0 gap-4",style:{...l.styles.surface,borderBottomColor:b.border},children:[a.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[a.jsx(rs,{size:14,style:l.styles.mutedText}),a.jsxs("div",{className:"min-w-0",children:[a.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[a.jsx("h2",{className:"text-[13px] font-semibold tracking-tight truncate",style:l.styles.inkText,children:u.interAgentThreadTitle}),u.selectedInterAgentThread?a.jsx("span",{className:"text-[9px] font-mono uppercase px-1.5 py-0.5 rounded shrink-0",style:u.selectedInterAgentThread.sourceKind==="private"?l.styles.tagBadge:l.styles.activePill,children:u.selectedInterAgentThread.sourceKind==="private"?"Private":"Relay"}):null,u.selectedInterAgentThread?a.jsx("span",{className:"text-[9px] font-mono px-1.5 py-0.5 rounded shrink-0",style:l.styles.tagBadge,children:u.selectedInterAgentThread.messageCount}):null]}),a.jsx("div",{className:"text-[10px] truncate mt-0.5",style:l.styles.mutedText,children:u.selectedInterAgentThreadSubtitle})]})]}),a.jsxs("div",{className:"flex items-center gap-2",children:[u.selectedRelayDirectThread?a.jsxs("button",{className:"os-toolbar-button flex items-center gap-1.5 text-[10px] font-medium px-2 py-0.5 rounded",style:{color:b.ink},onClick:()=>u.onOpenAgentProfile(u.selectedRelayDirectThread.id),children:[a.jsx(ts,{size:11}),a.jsx("span",{children:"Agent"})]}):null,a.jsxs("button",{onClick:()=>u.setShowAnnotations(!u.showAnnotations),className:"os-toolbar-button flex items-center gap-1 text-[10px] font-medium px-2 py-0.5 rounded",style:u.showAnnotations?{backgroundColor:b.accentBg,color:b.accent}:{color:b.ink},children:["Annotations ",a.jsx("span",{className:"font-mono uppercase",children:u.showAnnotations?"On":"Off"})]}),u.interAgentMessageTarget?a.jsx("button",{className:"os-toolbar-button flex items-center gap-1 text-[10px] font-medium px-2 py-0.5 rounded",style:{color:b.ink},onClick:()=>u.openAgentDirectMessage(u.interAgentMessageTarget.id),title:`Open direct chat with ${u.interAgentMessageTarget.title}`,children:"Message"}):null,u.interAgentConfigureTarget?a.jsx("button",{className:"os-toolbar-button flex items-center gap-1 text-[10px] font-medium px-2 py-0.5 rounded",style:{color:b.ink},onClick:()=>u.onOpenAgentSettings(u.interAgentConfigureTarget.id,u.interAgentConfigureTarget.profileKind==="project"),title:u.interAgentConfigureTarget.profileKind==="project"?`Configure ${u.interAgentConfigureTarget.title}`:`Open ${u.interAgentConfigureTarget.title} profile`,children:u.interAgentConfigureLabel}):null]})]}),a.jsx("div",{className:"flex-1 overflow-y-auto px-4 py-3 pb-6",children:u.selectedInterAgent?u.selectedInterAgentThread?u.visibleInterAgentMessages.length===0?a.jsxs("div",{className:"flex flex-col items-center justify-center h-64 text-center",children:[a.jsx("div",{className:"w-16 h-16 rounded-full flex items-center justify-center mb-4",style:{backgroundColor:b.accentBg},children:a.jsx(Bl,{size:24,style:{color:b.accent}})}),a.jsx("h3",{className:"text-[15px] font-medium mb-1",style:l.styles.inkText,children:"Thread is quiet"}),a.jsx("p",{className:"text-[13px] max-w-sm",style:l.styles.mutedText,children:"This agent thread exists, but there are no visible messages in it yet."})]}):a.jsx("div",{className:"flex flex-col gap-1",children:a.jsx(No,{messages:u.visibleInterAgentMessages,showAnnotations:u.showAnnotations,showStatusMessages:!1,inkStyle:l.styles.inkText,mutedStyle:l.styles.mutedText,tagStyle:l.styles.tagBadge,annotStyle:l.styles.annotBadge,agentLookup:u.interAgentAgentLookup,directThreadLookup:u.relayDirectLookup,onOpenAgentProfile:u.onOpenAgentProfile,onOpenAgentChat:u.openAgentDirectMessage,onNudgeMessage:u.onNudgeMessage})}):a.jsxs("div",{className:"flex flex-col items-center justify-center h-64 text-center",children:[a.jsx("div",{className:"w-16 h-16 rounded-full flex items-center justify-center mb-4",style:{backgroundColor:b.accentBg},children:a.jsx(Bl,{size:24,style:{color:b.accent}})}),a.jsx("h3",{className:"text-[15px] font-medium mb-1",style:l.styles.inkText,children:"No thread selected"}),a.jsxs("p",{className:"text-[13px] max-w-sm",style:l.styles.mutedText,children:["Pick one of ",u.selectedInterAgent.title,"'s agent threads to read it."]})]}):a.jsxs("div",{className:"flex flex-col items-center justify-center h-64 text-center",children:[a.jsx("div",{className:"w-16 h-16 rounded-full flex items-center justify-center mb-4",style:{backgroundColor:b.accentBg},children:a.jsx(rs,{size:24,style:{color:b.accent}})}),a.jsx("h3",{className:"text-[15px] font-medium mb-1",style:l.styles.inkText,children:"No agent selected"}),a.jsx("p",{className:"text-[13px] max-w-sm",style:l.styles.mutedText,children:"Choose an agent from the left rail to inspect their traffic with other agents."})]})}),a.jsx("div",{className:"h-7 border-t flex items-center px-4 shrink-0",style:{backgroundColor:b.bg,borderTopColor:b.border},children:a.jsx("span",{className:"text-[9px] font-mono",style:l.styles.mutedText,children:"Read-only monitor over inter-agent traffic"})})]})]})}return e!=="sessions"?null:a.jsxs(a.Fragment,{children:[a.jsxs("div",{className:"flex-1 flex flex-col relative min-w-0",style:l.styles.surface,children:[a.jsxs("div",{className:"h-10 border-b flex items-center justify-between px-4 shrink-0",style:{...l.styles.surface,borderBottomColor:b.border},children:[a.jsxs("div",{className:"flex items-center gap-4 min-w-0 flex-1",children:[a.jsxs("div",{className:"min-w-0 shrink-0",children:[a.jsx("div",{className:"text-[13px] font-semibold tracking-tight",style:l.styles.inkText,children:"Sessions"}),a.jsx("div",{className:"text-[10px] font-mono mt-0.5",style:l.styles.mutedText,children:d.searchQuery?`${d.filteredSessions.length} results`:`${d.stats.totalSessions} total`})]}),a.jsxs("div",{className:"flex items-center gap-2 flex-1 min-w-0",children:[a.jsx(To,{size:14,style:l.styles.mutedText}),a.jsx("input",{type:"text",placeholder:"Search sessions by title, content, tags, or agent...",value:d.searchQuery,onChange:f=>d.setSearchQuery(f.target.value),className:"flex-1 bg-transparent border-none outline-none text-[12px]",style:{color:b.ink}}),d.searchQuery?a.jsx("button",{onClick:()=>d.setSearchQuery(""),className:"hover:opacity-70",style:l.styles.mutedText,children:a.jsx(Sl,{size:14})}):null]})]}),a.jsx("div",{className:"flex items-center gap-2 shrink-0",children:a.jsx("button",{className:"p-1.5 rounded transition-opacity hover:opacity-70",style:l.styles.mutedText,onClick:d.onRefresh,children:a.jsx(gn,{size:14})})})]}),a.jsx("div",{className:"flex-1 overflow-y-auto",children:d.loadingSessions?a.jsx("div",{className:"flex items-center justify-center h-64",children:a.jsxs("div",{className:"flex flex-col items-center gap-3",children:[a.jsx(xn,{className:"text-[28px]",style:{color:b.accent}}),a.jsx("span",{className:"text-[13px]",style:l.styles.mutedText,children:"Loading broker workspace…"})]})}):d.filteredSessions.length===0?a.jsxs("div",{className:"flex flex-col items-center justify-center h-64 text-center",children:[a.jsx("div",{className:"w-16 h-16 rounded-full flex items-center justify-center mb-4",style:{backgroundColor:b.accentBg},children:a.jsx(xa,{size:24,style:{color:b.accent}})}),a.jsx("h3",{className:"text-[15px] font-medium mb-1",style:l.styles.inkText,children:"No sessions found"}),a.jsx("p",{className:"text-[13px] max-w-sm",style:l.styles.mutedText,children:d.searchQuery?"Try adjusting your search query":"No conversations are in the broker yet."})]}):a.jsx("div",{className:"divide-y",style:{borderColor:b.border},children:d.filteredSessions.map(f=>a.jsxs("button",{onClick:()=>d.setSelectedSession(f),draggable:!0,onDragStart:()=>{d.setDraggedSessionId(f.id),d.setDraggedPhoneSection(null)},onDragEnd:()=>{d.setDraggedSessionId(null),d.setDraggedPhoneSection(null)},className:"w-full text-left px-4 py-3 transition-opacity hover:opacity-90",style:d.selectedSession?.id===f.id?{backgroundColor:b.bg}:void 0,children:[a.jsxs("div",{className:"flex items-start justify-between mb-1",children:[a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx("div",{className:"w-5 h-5 rounded text-white flex items-center justify-center text-[9px] font-bold",style:{backgroundColor:hl(f.agent)},children:f.agent.charAt(0)}),a.jsx("span",{className:"text-[13px] font-medium line-clamp-1",style:l.styles.inkText,children:f.title}),d.phonePreparationState.favorites.includes(f.id)?a.jsxs("span",{className:"inline-flex items-center gap-1 rounded-full px-1.5 py-0.5 text-[9px] font-medium",style:{backgroundColor:b.accentBg,color:b.accent},children:[a.jsx(Eb,{size:9}),"Fav"]}):null,!d.phonePreparationState.favorites.includes(f.id)&&d.phonePreparationState.quickHits.includes(f.id)?a.jsxs("span",{className:"inline-flex items-center gap-1 rounded-full px-1.5 py-0.5 text-[9px] font-medium",style:{backgroundColor:b.tagBg,color:b.ink},children:[a.jsx(Zw,{size:9}),"My List"]}):null]}),a.jsx("span",{className:"text-[10px] font-mono shrink-0 ml-2",style:l.styles.mutedText,children:d.formatDate(f.lastModified)})]}),a.jsxs("div",{className:"flex items-center gap-2 mb-1.5 pl-7",children:[a.jsx("span",{className:"text-[10px] font-mono",style:l.styles.mutedText,children:f.project}),a.jsx("span",{className:"w-px h-3",style:{backgroundColor:b.border}}),a.jsxs("span",{className:"text-[10px]",style:l.styles.mutedText,children:[f.messageCount," messages"]}),f.tokens?a.jsxs(a.Fragment,{children:[a.jsx("span",{className:"w-px h-3",style:{backgroundColor:b.border}}),a.jsxs("span",{className:"text-[10px]",style:l.styles.mutedText,children:[(f.tokens/1e3).toFixed(1),"k tokens"]})]}):null]}),a.jsx("p",{className:"text-[12px] line-clamp-1 pl-7",style:l.styles.mutedText,children:f.preview}),f.tags&&f.tags.length>0?a.jsxs("div",{className:"flex items-center gap-1.5 mt-2 pl-7",children:[f.tags.slice(0,3).map(p=>a.jsx("span",{className:"text-[9px] font-mono border px-1.5 py-0.5 rounded",style:l.styles.tagBadge,children:p},p)),f.tags.length>3?a.jsxs("span",{className:"text-[9px]",style:l.styles.mutedText,children:["+",f.tags.length-3]}):null]}):null]},f.id))})}),a.jsxs("div",{className:"h-7 border-t flex items-center justify-between px-4 shrink-0",style:{backgroundColor:b.bg,borderTopColor:b.border},children:[a.jsx("span",{className:"text-[9px] font-mono",style:l.styles.mutedText,children:"Drag sessions into My List or click one for quick actions."}),a.jsx("span",{className:"text-[9px] font-mono uppercase tracking-widest",style:l.styles.mutedText,children:"Index Ready"})]})]}),a.jsxs("div",{className:"w-80 border-l shrink-0 overflow-y-auto flex flex-col",style:{...l.styles.surface,borderLeftColor:b.border},children:[a.jsx("div",{className:"px-4 py-3 border-b",style:{borderBottomColor:b.border},children:a.jsxs("div",{className:"flex items-center justify-between gap-3",children:[a.jsxs("div",{className:"min-w-0",children:[a.jsx("div",{className:"text-[10px] font-mono tracking-widest uppercase mb-1",style:l.styles.mutedText,children:"My List"}),a.jsx("div",{className:"text-[12px] font-medium",style:l.styles.inkText,children:"My List first, then browse and search."})]}),a.jsx("button",{type:"button",onClick:d.onClearPhoneQuickHits,disabled:d.phonePreparationSaving||d.phonePreparationState.quickHits.length===0,className:"rounded px-2 py-1 text-[10px] font-medium transition-opacity hover:opacity-80 disabled:cursor-not-allowed disabled:opacity-50",style:{backgroundColor:b.bg,color:b.ink,border:`1px solid ${b.border}`},children:"Clear"})]})}),a.jsx("div",{className:"p-4 flex-1 flex flex-col gap-4",children:d.phonePreparationLoading?a.jsxs("div",{className:"flex items-center gap-2 text-[12px]",style:l.styles.mutedText,children:[a.jsx(xn,{className:"text-[12px]"}),"Loading list…"]}):a.jsxs(a.Fragment,{children:[a.jsxs("div",{className:"rounded-lg border p-3",style:{borderColor:b.border,backgroundColor:b.bg},onDragOver:f=>f.preventDefault(),onDrop:f=>{f.preventDefault(),d.onDropIntoFavorites()},children:[a.jsxs("div",{className:"flex items-center justify-between gap-2 mb-2",children:[a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx(Eb,{size:12,style:{color:b.accent}}),a.jsx("div",{className:"text-[11px] font-semibold",style:l.styles.inkText,children:"Favorites"})]}),a.jsx("div",{className:"text-[10px] font-mono",style:l.styles.mutedText,children:d.favoritePhoneSessions.length})]}),d.favoritePhoneSessions.length===0?a.jsx("div",{className:"rounded border border-dashed px-3 py-4 text-[11px]",style:{borderColor:b.border,color:b.muted},children:"Drop sessions here to keep them pinned in your list."}):a.jsx("div",{className:"flex flex-col gap-2",children:d.favoritePhoneSessions.map(f=>a.jsx("div",{draggable:!0,onDragStart:()=>{d.setDraggedSessionId(f.id),d.setDraggedPhoneSection("favorites")},onDragEnd:()=>{d.setDraggedSessionId(null),d.setDraggedPhoneSection(null)},className:"rounded border px-3 py-2",style:{borderColor:b.border,backgroundColor:b.surface},children:a.jsxs("div",{className:"flex items-start justify-between gap-2",children:[a.jsxs("div",{className:"min-w-0",children:[a.jsx("div",{className:"text-[12px] font-medium line-clamp-1",style:l.styles.inkText,children:f.title}),a.jsxs("div",{className:"text-[10px] mt-1",style:l.styles.mutedText,children:[f.project," · ",d.formatDate(f.lastModified)]})]}),a.jsx("button",{type:"button",onClick:()=>d.onRemoveSessionFromPhoneSection(f.id,"favorites"),className:"text-[10px] hover:opacity-70",style:l.styles.mutedText,children:a.jsx(Sl,{size:12})})]})},`favorite-${f.id}`))})]}),a.jsxs("div",{className:"rounded-lg border p-3",style:{borderColor:b.border,backgroundColor:b.bg},onDragOver:f=>f.preventDefault(),onDrop:f=>{f.preventDefault(),d.onDropIntoQuickHits()},children:[a.jsxs("div",{className:"flex items-center justify-between gap-2 mb-2",children:[a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx(O1,{size:12,style:{color:b.accent}}),a.jsx("div",{className:"text-[11px] font-semibold",style:l.styles.inkText,children:"My List"})]}),a.jsx("div",{className:"text-[10px] font-mono",style:l.styles.mutedText,children:d.quickHitPhoneSessions.length})]}),d.quickHitPhoneSessions.length===0?a.jsx("div",{className:"rounded border border-dashed px-3 py-4 text-[11px]",style:{borderColor:b.border,color:b.muted},children:"Drag sessions here and order them however you want."}):a.jsx("div",{className:"flex flex-col gap-2",children:d.quickHitPhoneSessions.map((f,p)=>a.jsx("div",{draggable:!0,onDragStart:()=>{d.setDraggedSessionId(f.id),d.setDraggedPhoneSection("quickHits")},onDragEnd:()=>{d.setDraggedSessionId(null),d.setDraggedPhoneSection(null)},onDragOver:h=>h.preventDefault(),onDrop:h=>{h.preventDefault(),d.onDropIntoQuickHits(p)},className:"rounded border px-3 py-2",style:{borderColor:b.border,backgroundColor:b.surface},children:a.jsxs("div",{className:"flex items-start justify-between gap-2",children:[a.jsxs("div",{className:"min-w-0",children:[a.jsxs("div",{className:"text-[11px] font-mono mb-1",style:l.styles.mutedText,children:["#",p+1]}),a.jsx("div",{className:"text-[12px] font-medium line-clamp-1",style:l.styles.inkText,children:f.title}),a.jsxs("div",{className:"text-[10px] mt-1",style:l.styles.mutedText,children:[f.project," · ",d.formatDate(f.lastModified)]})]}),a.jsx("button",{type:"button",onClick:()=>d.onRemoveSessionFromPhoneSection(f.id,"quickHits"),className:"text-[10px] hover:opacity-70",style:l.styles.mutedText,children:a.jsx(Sl,{size:12})})]})},`quick-hit-${f.id}`))})]}),d.phonePreparationFeedback?a.jsx("div",{className:"rounded border px-3 py-2 text-[11px]",style:{borderColor:b.border,backgroundColor:b.surface,color:b.ink},children:d.phonePreparationFeedback}):null,a.jsxs("div",{className:"rounded-lg border p-3",style:{borderColor:b.border,backgroundColor:b.bg},children:[a.jsx("div",{className:"text-[10px] font-mono tracking-widest uppercase mb-2",style:l.styles.mutedText,children:"Selected Session"}),d.selectedSession?a.jsxs(a.Fragment,{children:[a.jsxs("div",{className:"flex items-center gap-2 mb-3",children:[a.jsx("div",{className:"w-8 h-8 rounded text-white flex items-center justify-center text-[12px] font-bold",style:{backgroundColor:hl(d.selectedSession.agent)},children:d.selectedSession.agent.charAt(0)}),a.jsxs("div",{className:"min-w-0",children:[a.jsx("div",{className:"text-[12px] font-medium line-clamp-1",style:l.styles.inkText,children:d.selectedSession.title}),a.jsxs("div",{className:"text-[10px]",style:l.styles.mutedText,children:[d.selectedSession.project," · ",d.selectedSession.messageCount," messages"]})]})]}),a.jsx("p",{className:"text-[11px] leading-relaxed mb-3",style:l.styles.mutedText,children:d.selectedSession.preview}),a.jsxs("div",{className:"flex gap-2",children:[a.jsx("button",{type:"button",onClick:()=>d.onAddSessionToPhoneSection(d.selectedSession.id,"favorites"),disabled:d.phonePreparationSaving||d.phonePreparationState.favorites.includes(d.selectedSession.id),className:"flex-1 rounded px-3 py-2 text-[11px] font-medium transition-opacity hover:opacity-80 disabled:cursor-not-allowed disabled:opacity-50",style:{backgroundColor:b.accentBg,color:b.accent},children:d.phonePreparationState.favorites.includes(d.selectedSession.id)?"Pinned":"Add to Favorites"}),a.jsx("button",{type:"button",onClick:()=>d.onAddSessionToPhoneSection(d.selectedSession.id,"quickHits"),disabled:d.phonePreparationSaving||d.phonePreparationState.quickHits.includes(d.selectedSession.id)||d.phonePreparationState.favorites.includes(d.selectedSession.id),className:"flex-1 rounded px-3 py-2 text-[11px] font-medium transition-opacity hover:opacity-80 disabled:cursor-not-allowed disabled:opacity-50",style:{backgroundColor:b.surface,color:b.ink,border:`1px solid ${b.border}`},children:d.phonePreparationState.quickHits.includes(d.selectedSession.id)||d.phonePreparationState.favorites.includes(d.selectedSession.id)?"Already Added":"Add to My List"})]})]}):a.jsx("div",{className:"text-[11px]",style:l.styles.mutedText,children:"Select a session to pin it or add it to My List."})]})]})})]})]})}const bu=[{label:"Connecting relay service"},{label:"Loading agent availability"},{label:"Loading activity history"}];function Az(e){return e===0?420:195+Math.min(e,5)*12}const Ez="11rem",d1="w-[3.25rem]";function Rz({color:e}){const l="0.2 0.2 0.4 0.8;0.2 0.2 0.4 0.8";return a.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 14 32 4",preserveAspectRatio:"none",className:"h-[6px] w-[3.25rem] shrink-0 overflow-visible",style:{color:e},"aria-hidden":!0,children:[a.jsx("path",{opacity:.8,fill:"currentColor",d:"M2 14 V18 H6 V14z",children:a.jsx("animateTransform",{attributeName:"transform",type:"translate",values:"0 0; 24 0; 0 0",dur:"2s",begin:"0s",repeatCount:"indefinite",keySplines:l,calcMode:"spline"})}),a.jsx("path",{opacity:.5,fill:"currentColor",d:"M0 14 V18 H8 V14z",children:a.jsx("animateTransform",{attributeName:"transform",type:"translate",values:"0 0; 24 0; 0 0",dur:"2s",begin:"0.1s",repeatCount:"indefinite",keySplines:l,calcMode:"spline"})}),a.jsx("path",{opacity:.25,fill:"currentColor",d:"M0 14 V18 H8 V14z",children:a.jsx("animateTransform",{attributeName:"transform",type:"translate",values:"0 0; 24 0; 0 0",dur:"2s",begin:"0.2s",repeatCount:"indefinite",keySplines:l,calcMode:"spline"})})]})}function f1({dark:e,C:l,s:r}){const[i,o]=z.useState(0);z.useEffect(()=>{if(i>=bu.length)return;const y=Az(i),g=setTimeout(()=>o(v=>v+1),y);return()=>clearTimeout(g)},[i]);const u=i>=bu.length,d=e?"rgba(241,245,249,0.92)":"rgba(15,23,42,0.82)",f=e?"rgba(255,255,255,0.08)":"rgba(15,23,42,0.06)",p=e?"rgba(255,255,255,0.14)":"rgba(15,23,42,0.08)",h=e?"rgba(255,255,255,0.05)":"rgba(15,23,42,0.035)";return a.jsxs("div",{className:"w-full max-w-[440px] os-fade-up",children:[a.jsxs("div",{className:"flex items-center gap-3 mb-6",children:[a.jsx("img",{src:"/scout-icon.png",alt:"Scout",className:"w-9 h-9 rounded-lg shrink-0",style:{boxShadow:`0 2px 8px ${e?"rgba(0,0,0,0.4)":"rgba(15,23,42,0.08)"}`}}),a.jsxs("div",{className:"min-w-0",children:[a.jsx("div",{className:"text-[15px] font-semibold tracking-tight",style:r.inkText,children:"Scout"}),a.jsx("div",{className:"text-[10px] font-mono uppercase tracking-[0.18em]",style:r.mutedText,children:"Initializing"})]})]}),a.jsx("div",{className:"rounded-lg border overflow-hidden font-mono text-[11px] leading-[1.7] flex flex-col",style:{borderColor:l.border,backgroundColor:l.termBg,color:l.termFg,minHeight:Ez},children:a.jsx("div",{className:"flex flex-col flex-1 px-4 py-3 min-h-0",children:a.jsx("div",{className:"space-y-2 shrink-0",children:bu.map((y,g)=>{const v=g<i,k=g===i-1&&!u;return a.jsxs("div",{className:"os-boot-line flex items-center justify-between gap-3 min-h-[1.9em] rounded-md px-2",style:{backgroundColor:v?e?"rgba(255,255,255,0.04)":"rgba(15,23,42,0.035)":"transparent",opacity:v?1:.38},children:[a.jsx("div",{className:"min-w-0 flex items-center gap-3",children:a.jsx("span",{className:"os-boot-line-text min-w-0 truncate",style:{color:l.termFg,opacity:k?1:v?.72:.45},children:y.label})}),a.jsx("div",{className:"shrink-0 min-w-[1.25rem] flex justify-end",children:v?a.jsx("span",{className:"os-boot-prompt inline-flex h-5 min-w-5 items-center justify-center rounded-full border px-1.5 text-[12px] font-semibold leading-none",style:{color:k?l.accent:d,backgroundColor:k?h:f,borderColor:k?"transparent":p,opacity:k?1:.95},"aria-hidden":!0,children:k?"…":"✓"}):null})]},y.label)})})})}),a.jsxs("div",{className:"relative mt-5 h-5",children:[a.jsxs("div",{className:"os-boot-footer-track absolute inset-x-3 top-0 bottom-0 flex items-center gap-3 min-w-0",style:{opacity:u?0:1,transform:u?"translateY(2px)":"translateY(0)",pointerEvents:u?"none":"auto"},children:[a.jsx("div",{className:`${d1} shrink-0`,"aria-hidden":!0}),a.jsxs("span",{className:"text-[10px] font-mono tabular-nums tracking-tight leading-none",style:r.mutedText,children:[i," of ",bu.length]})]}),a.jsxs("div",{className:"os-boot-footer-track absolute inset-x-3 top-0 bottom-0 flex items-center gap-3 min-w-0",style:{opacity:u?1:0,transform:u?"translateY(0)":"translateY(-2px)",pointerEvents:u?"auto":"none"},children:[a.jsxs("div",{className:`os-boot-footer-lead ${d1} shrink-0 flex items-center justify-center`,"aria-hidden":!0,children:[a.jsx("div",{className:"os-boot-wait-wave-wrap",children:a.jsx(Rz,{color:l.accent})}),a.jsx("div",{className:"os-boot-wait-static-row",children:[.8,.5,.25].map((y,g)=>a.jsx("span",{className:"w-[3px] h-1 rounded-[1px]",style:{backgroundColor:l.accent,opacity:y}},g))})]}),a.jsx("span",{className:"text-[10px] font-mono tracking-tight leading-none truncate",style:r.mutedText,children:"Finishing up"})]})]})]})}const lt={getAppInfo:"scout:get-app-info",getServicesState:"scout:get-services-state",getHomeState:"scout:get-home-state",getMessagesWorkspaceState:"scout:get-messages-workspace-state",getRelayShellPatch:"scout:get-relay-shell-patch",getShellState:"scout:get-shell-state",refreshRelayShellPatch:"scout:refresh-relay-shell-patch",refreshShellState:"scout:refresh-shell-state",getAppSettings:"scout:get-app-settings",refreshSettingsInventory:"scout:refresh-settings-inventory",updateAppSettings:"scout:update-app-settings",retireProject:"scout:retire-project",restoreProject:"scout:restore-project",runOnboardingCommand:"scout:run-onboarding-command",skipOnboarding:"scout:skip-onboarding",restartOnboarding:"scout:restart-onboarding",getAgentConfig:"scout:get-agent-config",updateAgentConfig:"scout:update-agent-config",createAgent:"scout:create-agent",pickDirectory:"scout:pick-directory",reloadApp:"scout:reload-app",quitApp:"scout:quit-app",revealPath:"scout:reveal-path",getPhonePreparation:"scout:get-phone-preparation",updatePhonePreparation:"scout:update-phone-preparation",getPairingState:"scout:get-pairing-state",refreshPairingState:"scout:refresh-pairing-state",controlPairingService:"scout:control-pairing-service",updatePairingConfig:"scout:update-pairing-config",decidePairingApproval:"scout:decide-pairing-approval",answerPairingQuestion:"scout:answer-pairing-question",restartAgent:"scout:restart-agent",sendRelayMessage:"scout:send-relay-message",controlBroker:"scout:control-broker",getKeepAliveState:"scout:get-keep-alive-state",acquireKeepAliveLease:"scout:acquire-keep-alive-lease",releaseKeepAliveLease:"scout:release-keep-alive-lease",getAgentSession:"scout:get-agent-session",answerAgentSessionQuestion:"scout:answer-agent-session-question",openAgentSession:"scout:open-agent-session",toggleVoiceCapture:"scout:toggle-voice-capture",setVoiceRepliesEnabled:"scout:set-voice-replies-enabled",getLogCatalog:"scout:get-log-catalog",getBrokerInspector:"scout:get-broker-inspector",getFeedbackBundle:"scout:get-feedback-bundle",submitFeedbackReport:"scout:submit-feedback-report",readLogSource:"scout:read-log-source"};function Mz(e){return{isDesktop:!0,getAppInfo:()=>e(lt.getAppInfo),getServicesState:()=>e(lt.getServicesState),getHomeState:()=>e(lt.getHomeState),getMessagesWorkspaceState:()=>e(lt.getMessagesWorkspaceState),getRelayShellPatch:()=>e(lt.getRelayShellPatch),getShellState:()=>e(lt.getShellState),refreshRelayShellPatch:()=>e(lt.refreshRelayShellPatch),refreshShellState:()=>e(lt.refreshShellState),getAppSettings:()=>e(lt.getAppSettings),refreshSettingsInventory:()=>e(lt.refreshSettingsInventory),updateAppSettings:l=>e(lt.updateAppSettings,l),retireProject:l=>e(lt.retireProject,l),restoreProject:l=>e(lt.restoreProject,l),runOnboardingCommand:l=>e(lt.runOnboardingCommand,l),skipOnboarding:()=>e(lt.skipOnboarding),restartOnboarding:()=>e(lt.restartOnboarding),getAgentConfig:l=>e(lt.getAgentConfig,l),updateAgentConfig:l=>e(lt.updateAgentConfig,l),createAgent:l=>e(lt.createAgent,l),pickDirectory:()=>e(lt.pickDirectory),reloadApp:()=>e(lt.reloadApp),quitApp:()=>e(lt.quitApp),revealPath:l=>e(lt.revealPath,l),getPhonePreparation:()=>e(lt.getPhonePreparation),updatePhonePreparation:l=>e(lt.updatePhonePreparation,l),getPairingState:()=>e(lt.getPairingState),refreshPairingState:()=>e(lt.refreshPairingState),controlPairingService:l=>e(lt.controlPairingService,l),updatePairingConfig:l=>e(lt.updatePairingConfig,l),decidePairingApproval:l=>e(lt.decidePairingApproval,l),answerPairingQuestion:l=>e(lt.answerPairingQuestion,l),restartAgent:l=>e(lt.restartAgent,l),sendRelayMessage:l=>e(lt.sendRelayMessage,l),controlBroker:l=>e(lt.controlBroker,l),getKeepAliveState:()=>e(lt.getKeepAliveState),acquireKeepAliveLease:l=>e(lt.acquireKeepAliveLease,l),releaseKeepAliveLease:l=>e(lt.releaseKeepAliveLease,l),getAgentSession:l=>e(lt.getAgentSession,l),answerAgentSessionQuestion:l=>e(lt.answerAgentSessionQuestion,l),openAgentSession:l=>e(lt.openAgentSession,l),toggleVoiceCapture:()=>e(lt.toggleVoiceCapture),setVoiceRepliesEnabled:l=>e(lt.setVoiceRepliesEnabled,l),getLogCatalog:()=>e(lt.getLogCatalog),getBrokerInspector:()=>e(lt.getBrokerInspector),getFeedbackBundle:()=>e(lt.getFeedbackBundle),submitFeedbackReport:l=>e(lt.submitFeedbackReport,l),readLogSource:l=>e(lt.readLogSource,l)}}const zz={"scout:get-app-info":{method:"GET",path:"/api/app"},"scout:get-services-state":{method:"GET",path:"/api/services"},"scout:get-home-state":{method:"GET",path:"/api/home"},"scout:get-messages-workspace-state":{method:"GET",path:"/api/messages-workspace"},"scout:get-relay-shell-patch":{method:"GET",path:"/api/relay-shell-patch"},"scout:get-shell-state":{method:"GET",path:"/api/shell-state"},"scout:refresh-relay-shell-patch":{method:"GET",path:"/api/relay-shell-patch/refresh"},"scout:refresh-shell-state":{method:"GET",path:"/api/shell-state/refresh"},"scout:get-app-settings":{method:"GET",path:"/api/app-settings"},"scout:refresh-settings-inventory":{method:"GET",path:"/api/app-settings/refresh"},"scout:update-app-settings":{method:"POST",path:"/api/app-settings"},"scout:retire-project":{method:"POST",path:"/api/retire-project"},"scout:restore-project":{method:"POST",path:"/api/restore-project"},"scout:run-onboarding-command":{method:"POST",path:"/api/onboarding/run"},"scout:skip-onboarding":{method:"POST",path:"/api/onboarding/skip"},"scout:restart-onboarding":{method:"POST",path:"/api/onboarding/restart"},"scout:get-agent-config":{method:"GET",path:e=>`/api/agent-config/${e[0]}`},"scout:update-agent-config":{method:"POST",path:"/api/agent-config"},"scout:create-agent":{method:"POST",path:"/api/agent/create"},"scout:pick-directory":{method:"GET",path:"/api/pick-directory"},"scout:quit-app":{method:"POST",path:"/api/quit"},"scout:reveal-path":{method:"POST",path:"/api/reveal-path"},"scout:get-phone-preparation":{method:"GET",path:"/api/phone-preparation"},"scout:update-phone-preparation":{method:"POST",path:"/api/phone-preparation"},"scout:get-pairing-state":{method:"GET",path:"/api/pairing-state"},"scout:refresh-pairing-state":{method:"GET",path:"/api/pairing-state/refresh"},"scout:control-pairing-service":{method:"POST",path:"/api/pairing/control"},"scout:update-pairing-config":{method:"POST",path:"/api/pairing/config"},"scout:answer-pairing-question":{method:"POST",path:"/api/pairing/question-answer"},"scout:restart-agent":{method:"POST",path:"/api/agent/restart"},"scout:send-relay-message":{method:"POST",path:"/api/relay/send"},"scout:control-broker":{method:"POST",path:"/api/broker/control"},"scout:get-keep-alive-state":{method:"GET",path:"/api/keep-alive"},"scout:acquire-keep-alive-lease":{method:"POST",path:"/api/keep-alive/acquire"},"scout:release-keep-alive-lease":{method:"POST",path:"/api/keep-alive/release"},"scout:get-agent-session":{method:"GET",path:e=>`/api/agent-session/${e[0]}`},"scout:answer-agent-session-question":{method:"POST",path:"/api/agent-session/question-answer"},"scout:open-agent-session":{method:"POST",path:e=>`/api/agent-session/${e[0]}/open`},"scout:toggle-voice-capture":{method:"POST",path:"/api/voice/toggle-capture"},"scout:set-voice-replies-enabled":{method:"POST",path:"/api/voice/replies"},"scout:get-log-catalog":{method:"GET",path:"/api/log-catalog"},"scout:get-broker-inspector":{method:"GET",path:"/api/broker-inspector"},"scout:get-feedback-bundle":{method:"GET",path:"/api/feedback-bundle"},"scout:submit-feedback-report":{method:"POST",path:"/api/feedback-report"},"scout:read-log-source":{method:"POST",path:"/api/log-source"}};function Oz(){return typeof window<"u"&&window.location.origin?window.location.origin:"http://localhost:3200"}async function m1(e,l){const r=await e.text();if(!e.ok){let i=r.trim()||`HTTP ${e.status}`;if(r.length>0)try{const o=JSON.parse(r);typeof o.error=="string"&&o.error.trim()&&(i=o.detail?`${o.error}: ${o.detail}`:o.error)}catch{}throw new Error(`${l} → ${i}`)}if(!r.length)return null;try{return JSON.parse(r)}catch{throw new Error(`${l} → response is not JSON`)}}async function Lz(e,...l){if(e==="scout:reload-app")return typeof window<"u"&&window.location.reload(),!0;const r=zz[e];if(!r)return console.warn(`[web-bridge] unknown channel: ${e}`),null;const i=Oz(),o=typeof r.path=="function"?r.path(l):r.path,u=`${i}${o}`;if(r.method==="GET"){const p=await fetch(u);return m1(p,u)}const d=l[0]!==void 0?l[0]:{},f=await fetch(u,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify(d)});return m1(f,u)}function Dz(){return{...Mz(Lz),isDesktop:!1}}let Km=null;function _z(){return typeof window>"u"?null:window.scoutDesktop?window.scoutDesktop:(Km||(Km=Dz()),Km)}function Bz({activeView:e,selectedMessagesThread:l,selectedRelayKind:r,selectedRelayId:i,selectedInterAgentId:o}){return e==="messages"?l?.kind==="relay"&&r==="direct"?i:null:e==="agents"?o:null}function p1(e){return{runtime:{cwd:e.runtime.cwd,harness:e.runtime.harness,sessionId:e.runtime.sessionId,transport:e.runtime.transport},systemPrompt:e.systemPrompt,toolUse:{launchArgsText:e.toolUse.launchArgsText},capabilitiesText:e.capabilitiesText}}function Iz({activeView:e,scoutDesktop:l,surfaceCaps:r,interAgentState:i,interAgentAgents:o,interAgentThreads:u,relayState:d,selectedMessagesThread:f,selectedMessagesDetailAgentId:p,selectedRelayKind:h,selectedRelayId:y,agentableProjects:g,visibleAppSettings:v,isAppSettingsEditing:k,appSettingsDirty:S,setAppSettings:A,setAppSettingsDraft:N,setActiveView:R,setSettingsSection:L,setSettingsAgentId:H,setShellState:X,setShellError:V,setRelayFeedback:D}){const[I,F]=z.useState(null),[ne,O]=z.useState(null),[P,Q]=z.useState("all"),[oe,W]=z.useState("chat"),[J,w]=z.useState(!1),[Y,G]=z.useState(!1),[ve,T]=z.useState(!1),[B,le]=z.useState(!1),[M,pe]=z.useState(null),[ge,ce]=z.useState(null),[Re,Se]=z.useState(null),[Ne,Ve]=z.useState(!1),[_e,Fe]=z.useState(!1),[it,rt]=z.useState(!1),[ut,st]=z.useState(null),[vt,Ke]=z.useState(null),[Ye,et]=z.useState(!1),[Me,ot]=z.useState(!1),[Ce,nt]=z.useState(()=>Mm(g,v)),[mt,ae]=z.useState(!1),[be,we]=z.useState(null),[ze,We]=z.useState(null),[Ae,ue]=z.useState(!1),[Te,q]=z.useState(null),[de,ke]=z.useState(!1),[Qe,Be]=z.useState(0),[$e,wt]=z.useState(!1),Qt=z.useRef(null),qt=z.useRef(null),Pt=z.useRef(null),ht=z.useRef(!0),Wt=z.useRef(!0),se=z.useMemo(()=>[...o.filter(Le=>P==="all"?!0:Gb(Le))].sort((Le,$t)=>Qb(Le,$t,oe)),[P,oe,o]),Ee=z.useMemo(()=>{const he=new Map;for(const Le of se)he.set(Le.title,(he.get(Le.title)??0)+1);return he},[se]),Oe=z.useMemo(()=>o.find(he=>he.id===I)??null,[o,I]),tt=z.useMemo(()=>u.filter(he=>he.participants.some(Le=>Le.id===I)),[u,I]),Vt=z.useMemo(()=>tt.find(he=>he.id===ne)??null,[ne,tt]),on=z.useMemo(()=>Oe?d?.directs.find(he=>he.id===Oe.id)??null:null,[d,Oe]),va=on?.preview||on?.timestampLabel?"Open Chat":"Start Chat",er=on?.preview||on?.timestampLabel?Av(on):Oe?`${Oe.title} is ready for a direct message.`:"Direct line available.",ja=z.useMemo(()=>Mm(g,v),[g,v]),bn=I&&(Re??ge)?.agentId===I?Re??ge:null,oi=!!(ge?.editable&&bn),ka=z.useCallback(he=>{Se(Le=>Le&&he(Le)),st(null)},[]),Un=z.useMemo(()=>Xb(Re)!==Xb(ge),[Re,ge]),Yt=z.useMemo(()=>{const he=AC(bn?.capabilitiesText??"");return he.length>0?he:Oe?.capabilities??[]},[Oe?.capabilities,bn?.capabilitiesText]),cn=Ye&&Un?"Save + Restart":"Restart Agent",zt=z.useMemo(()=>Bz({activeView:e,selectedMessagesThread:f,selectedRelayKind:h,selectedRelayId:y,selectedInterAgentId:I}),[e,I,f,y,h]),tr=!!(I&&l?.getAgentConfig&&e==="settings"&&Ye),Ul=!!(zt&&l?.getAgentSession&&($e||B)),Ln=ze?.agentId===p||ze?.agentId===I?ze:null,us=Ae&&!Ln;z.useEffect(()=>{if(!i)return;const he=i.agents,Le=he.filter(Tn=>P==="all"?!0:Gb(Tn)).sort((Tn,Tl)=>Qb(Tn,Tl,oe)),$t=e==="agents"||e==="inter-agent"?Le:he;if(!$t.length){F(null),O(null);return}const tl=$t.find(Tn=>Tn.threadCount>0)?.id??$t[0]?.id??null,mn=$t.some(Tn=>Tn.id===I)?I:tl;mn!==I&&F(mn);const _r=i.threads.filter(Tn=>Tn.participants.some(Tl=>Tl.id===mn)),di=_r.some(Tn=>Tn.id===ne)?ne:_r[0]?.id??null;di!==ne&&O(di)},[e,P,oe,i,I,ne]),z.useEffect(()=>{if(!I){ce(null),Se(null),st(null),Ve(!1),w(!1),G(!1),T(!1);return}if(!tr){Ve(!1);return}const he=l;if(!he?.getAgentConfig){Ve(!1);return}let Le=!1;return(async()=>{Ve(!0);try{const tl=await he.getAgentConfig(I);if(Le)return;ce(tl),Se(tl),st(null),(!vt||vt!==I)&&et(!1)}catch(tl){if(Le)return;ce(null),Se(null),st(Je(tl)),et(!1)}finally{Le||Ve(!1)}})(),()=>{Le=!0}},[vt,l,I,tr]),z.useEffect(()=>{if(!zt){We(null),q(null),ke(!1),ue(!1);return}if(!Ul){ue(!1);return}const he=l;if(!he?.getAgentSession){ue(!1);return}let Le=!1;return(async()=>{ue(!0);try{const tl=await he.getAgentSession(zt);if(Le)return;We(tl),q(null)}catch(tl){if(Le)return;We(null),q(Je(tl))}finally{Le||ue(!1)}})(),()=>{Le=!0}},[Qe,zt,l,Ul]),z.useEffect(()=>{q(null),ke(!1)},[zt]),z.useEffect(()=>{e!=="agents"&&e!=="messages"&&wt(!1)},[e]),z.useEffect(()=>{if(!$e)return;const he=Le=>{Le.key==="Escape"&&wt(!1)};return window.addEventListener("keydown",he),()=>window.removeEventListener("keydown",he)},[$e]);const el=z.useCallback(he=>he?he.scrollHeight-he.scrollTop-he.clientHeight<=48:!0,[]),Hl=z.useCallback(he=>{he&&(he.scrollTop=he.scrollHeight)},[]);z.useEffect(()=>{ht.current=!0,Wt.current=!0},[$e,I]),z.useEffect(()=>{if(!zt||!Ul)return;const he=window.setInterval(()=>{Be(Le=>Le+1)},$e?1600:2500);return()=>{window.clearInterval(he)}},[zt,$e,Ul]),z.useEffect(()=>{if(!de)return;const he=window.setTimeout(()=>{ke(!1)},1500);return()=>{window.clearTimeout(he)}},[de]),z.useEffect(()=>{if(e!=="settings"||!vt||I!==vt||Ne)return;const he=Qt.current;if(!he)return;const Le=window.requestAnimationFrame(()=>{if(he.scrollIntoView({block:"center",behavior:"smooth"}),he.focus(),"value"in he&&typeof he.value=="string"){const $t=he.value.length;he.setSelectionRange?.($t,$t)}Ke($t=>$t===vt?null:$t)});return()=>{window.cancelAnimationFrame(Le)}},[e,vt,I,Re,Ne]),z.useEffect(()=>{e!=="agents"||!Ye||(et(!1),Ke(null))},[e,Ye]),z.useEffect(()=>{if(!Ln||Ln.mode!=="trace"&&!Ln.body)return;const he=window.requestAnimationFrame(()=>{ht.current&&Hl(qt.current),$e&&Wt.current&&Hl(Pt.current)});return()=>window.cancelAnimationFrame(he)},[$e,Hl,Ln?.mode,Ln?.agentId,Ln?.body,Ln?.trace,Ln?.trace?.turns.length,Ln?.trace?.currentTurnId,Ln?.updatedAtLabel]);const gl=z.useCallback(he=>{F(he),O(wC(u,he))},[u]),Fl=z.useCallback((he,Le=!1)=>{gl(he),L("agents"),H(he),R("settings"),et(Le),Ke(Le?he:null)},[gl,R,H,L]),Dr=z.useCallback(()=>{et(!1),Ke(null)},[]),ql=z.useCallback(()=>{F(null),O(null),et(!1),Ke(null),st(null)},[]),Ht=z.useCallback(()=>{nt(Mm(g,v)),we(null),ot(!0)},[g,v]),Na=z.useCallback(()=>{(async()=>{try{if(!r?.canPickDirectory||!l?.pickDirectory)return;const he=await l.pickDirectory();if(!he)return;nt(Le=>({...Le,projectPath:he})),we(null)}catch(he){we(Je(he))}})()},[l,r]),wa=z.useCallback(()=>{(async()=>{if(!l?.createAgent){we("Desktop bridge is unavailable.");return}const he=Ce.projectPath.trim();if(!he){we("Choose a project path first.");return}ae(!0),we(null);try{const Le=await l.createAgent({projectPath:he,agentName:Ce.agentName.trim()||null,harness:Ce.harness});if(X(Le.shellState),V(null),D(`Created ${Le.agentId}.`),F(Le.agentId),O(null),R("agents"),ot(!1),l.refreshSettingsInventory)try{const $t=await l.refreshSettingsInventory();A($t),(!k||!S)&&N($t)}catch{}}catch(Le){we(Je(Le))}finally{ae(!1)}})()},[S,Ce,k,l,R,A,N,D,V,X]),Vl=z.useCallback(()=>{R("settings"),L("agents"),I&&H(I),et(!0),I&&Ke(I)},[I,R,H,L]),nr=z.useCallback(()=>{Se(ge),st(null),et(!1)},[ge]),Io=z.useCallback(async()=>{if(!(!I||!bn||!l?.updateAgentConfig)){Fe(!0);try{const he=await l.updateAgentConfig({agentId:I,...p1(bn)});ce(he),Se(he),st("Agent settings saved."),et(!1)}catch(he){st(Je(he))}finally{Fe(!1)}}},[l,I,bn]),ds=z.useCallback(async()=>{if(!(!I||!bn||!l?.restartAgent)){rt(!0);try{let he=bn;Un&&l.updateAgentConfig&&(Fe(!0),he=await l.updateAgentConfig({agentId:I,...p1(bn)}),ce(he),Se(he),Fe(!1));const Le=await l.restartAgent({agentId:I,previousSessionId:Oe?.sessionId??ge?.runtime.sessionId??null});X(Le),V(null),st(`${Oe?.title??"Agent"} restarted.`),et(!1)}catch(he){st(Je(he))}finally{Fe(!1),rt(!1)}}},[ge,Un,l,Oe,I,V,X,bn]),Hn=z.useCallback(()=>{Be(he=>he+1)},[]),fs=z.useCallback(async()=>{if(ze?.mode==="trace"){q(null),wt(!0),Hn();return}if(!(!r?.canOpenNativeSession||!zt||!l?.openAgentSession))try{await l.openAgentSession(zt),q(ze?.debugMode==="tmux"?"Opening tmux session in Terminal.":"Opening session debug output.")}catch(he){q(Je(he))}},[ze?.debugMode,ze?.mode,zt,Hn,l,r]),Sa=z.useCallback(async()=>{if(ze?.commandLabel)try{await kp(ze.commandLabel),ke(!0),q("Attach command copied.")}catch(he){q(Je(he))}},[ze]),$l=z.useCallback(async he=>{if(he.type==="copy"){try{await kp(he.text),q("Copied trace content.")}catch(Le){q(Je(Le))}return}if(!(he.type==="jump"||he.type==="collapse")){if(he.type==="decide"){if(ze?.traceSource!=="pairing_bridge"){q("This session does not expose approval decisions.");return}if(!l?.decidePairingApproval){q("Session approvals are unavailable.");return}try{await l.decidePairingApproval({sessionId:he.sessionId,turnId:he.turnId,blockId:he.blockId,version:he.version,decision:he.decision,reason:he.reason}),q(he.decision==="approve"?"Approval sent.":"Action denied."),Hn()}catch(Le){q(Je(Le))}return}if(ze?.traceSource==="pairing_bridge"){if(!l?.answerPairingQuestion){q("Session answers are unavailable.");return}try{await l.answerPairingQuestion({sessionId:he.sessionId,turnId:he.turnId,blockId:he.blockId,answer:he.answer}),q("Answer sent."),Hn()}catch(Le){q(Je(Le))}return}if(ze?.traceSource==="local_runtime"){if(!zt||!l?.answerAgentSessionQuestion){q("Local session answers are unavailable.");return}try{await l.answerAgentSessionQuestion({agentId:zt,sessionId:he.sessionId,turnId:he.turnId,blockId:he.blockId,answer:he.answer}),q("Answer sent."),Hn()}catch(Le){q(Je(Le))}return}q("Session answers are unavailable.")}},[ze?.traceSource,zt,Hn,l]),Fn=z.useCallback(()=>{q(null),wt(!0),Hn()},[Hn]),Xt=z.useCallback(()=>{wt(!1)},[]),ci=z.useCallback(he=>{ht.current=el(he.currentTarget)},[el]),ui=z.useCallback(he=>{Wt.current=el(he.currentTarget)},[el]);return{selectedInterAgentId:I,selectedInterAgentThreadId:ne,setSelectedInterAgentThreadId:O,agentRosterFilter:P,setAgentRosterFilter:Q,agentRosterSort:oe,setAgentRosterSort:W,agentThreadsExpanded:J,setAgentThreadsExpanded:w,agentSnapshotExpanded:Y,setAgentSnapshotExpanded:G,agentActivityExpanded:ve,setAgentActivityExpanded:T,agentSessionLogsExpanded:B,setAgentSessionLogsExpanded:le,agentRosterMenu:M,setAgentRosterMenu:pe,selectedInterAgent:Oe,rosterInterAgentAgents:se,rosterAgentTitleCounts:Ee,visibleInterAgentThreads:tt,selectedInterAgentDirectThread:on,selectedInterAgentThread:Vt,selectedInterAgentChatActionLabel:va,selectedAgentDirectLinePreview:er,isAgentConfigEditing:Ye,visibleAgentConfig:bn,hasEditableAgentConfig:oi,agentConfigLoading:Ne,agentConfigSaving:_e,agentConfigRestarting:it,agentConfigFeedback:ut,agentCapabilitiesPreview:Yt,agentRuntimePathRef:Qt,updateAgentConfigDraft:ka,agentConfigDirty:Un,agentRestartActionLabel:cn,handleSelectInterAgent:gl,handleOpenAgentSettings:Fl,deactivateAgentConfigEdit:Dr,resetAgentInspector:ql,handleStartAgentConfigEdit:Vl,handleCancelAgentConfigEdit:nr,handleSaveAgentConfig:Io,handleRestartAgent:ds,isCreateAgentDialogOpen:Me,setIsCreateAgentDialogOpen:ot,createAgentDraft:Ce,setCreateAgentDraft:nt,createAgentDefaults:ja,createAgentSubmitting:mt,createAgentFeedback:be,setCreateAgentFeedback:we,handleOpenCreateAgentDialog:Ht,handleBrowseCreateAgentProject:Na,handleCreateAgent:wa,visibleAgentSession:Ln,agentSessionPending:us,agentSessionLoading:Ae,agentSessionFeedback:Te,agentSessionCopied:de,isAgentSessionPeekOpen:$e,closeAgentSessionPeek:Xt,agentSessionInlineViewportRef:qt,handleInlineAgentSessionScroll:ci,agentSessionPeekViewportRef:Pt,handlePeekAgentSessionScroll:ui,handleOpenAgentSession:fs,handleCopyAgentSessionCommand:Sa,handleAgentSessionTraceIntent:$l,handlePeekAgentSession:Fn,refreshAgentSession:Hn}}async function Pz(e){if(typeof navigator<"u"&&navigator.clipboard?.writeText){await navigator.clipboard.writeText(e);return}if(typeof document<"u"){const l=document.createElement("textarea");l.value=e,l.setAttribute("readonly","true"),l.style.position="fixed",l.style.opacity="0",document.body.appendChild(l),l.select();const r=document.execCommand("copy");if(document.body.removeChild(l),r)return}throw new Error("Clipboard unavailable.")}function Uz({activeView:e,settingsSection:l,scoutDesktop:r,surfaceCaps:i,pendingBrokerInspectorFocus:o,setPendingBrokerInspectorFocus:u,relayServiceInspectorRef:d,loadShellState:f,setShellState:p,setShellError:h,applyRestartedOnboardingSettings:y,commitPairingState:g,pairingState:v,setAppSettingsFeedback:k,setRelayFeedback:S,setPairingError:A,setPairingConfigFeedback:N}){const[R,L]=z.useState(null),[H,X]=z.useState(null),[V,D]=z.useState(null),[I,F]=z.useState(null),[ne,O]=z.useState(!1),[P,Q]=z.useState(null),[oe,W]=z.useState(!1),[J,w]=z.useState(null),[Y,G]=z.useState(!1),[ve,T]=z.useState(null),[B,le]=z.useState(""),[M,pe]=z.useState(null),[ge,ce]=z.useState(null),[Re,Se]=z.useState(null),[Ne,Ve]=z.useState(!1),[_e,Fe]=z.useState(null),[it,rt]=z.useState(""),[ut,st]=z.useState(""),[vt,Ke]=z.useState(0),Ye=R?.sources??[],et=z.useMemo(()=>{const ue=ut.trim().toLowerCase();return ue?Ye.filter(Te=>Te.title.toLowerCase().includes(ue)||Te.subtitle.toLowerCase().includes(ue)):Ye},[ut,Ye]),Me=Ye.find(ue=>ue.id===H)??null,ot=z.useCallback(()=>{Ke(ue=>ue+1)},[]),Ce=z.useCallback(()=>{W(!0),Se(null)},[]),nt=z.useCallback(ue=>{W(ue),ue||Se(null)},[]),mt=z.useCallback(async()=>{if(!r?.getBrokerInspector)return F(null),null;try{const ue=await r.getBrokerInspector();return F(ue),ue}catch{return F(null),null}},[r]),ae=z.useCallback(async ue=>{if(!r?.getFeedbackBundle)return T("Feedback diagnostics are unavailable in this build."),null;ue?.showSpinner&&G(!0);try{const Te=await r.getFeedbackBundle();return w(Te),T(null),Te}catch(Te){return T(Je(Te)),null}finally{ue?.showSpinner&&G(!1)}},[r]);z.useEffect(()=>{if(e!=="logs")return;if(!r?.getLogCatalog){L(null),Fe("Logs are unavailable in the current desktop bridge. Restart the app so the latest desktop bridge is loaded.");return}let ue=!1;return(async()=>{try{const q=await r.getLogCatalog();if(ue)return;L(q),X(de=>de&&q.sources.some(ke=>ke.id===de)?de:q.defaultSourceId??q.sources[0]?.id??null),q.sources.length===0&&Fe("No log sources available.")}catch(q){ue||Fe(Je(q))}})(),()=>{ue=!0}},[e,r]),z.useEffect(()=>{if(e!=="logs"||!H)return;if(!r?.readLogSource){D(null);return}let ue=!1;return(!V||V.sourceId!==H)&&Ve(!0),Fe(null),(async()=>{try{const q=await r.readLogSource({sourceId:H,tailLines:500});if(ue)return;D(q),Fe(null)}catch(q){ue||(D(null),Fe(Je(q)))}finally{ue||Ve(!1)}})(),()=>{ue=!0}},[e,vt,r,H]),z.useEffect(()=>{e!=="settings"||l!=="communication"||mt()},[e,vt,mt,l]),z.useEffect(()=>{if(!o||e!=="settings"||l!=="communication")return;const ue=window.setTimeout(()=>{d.current?.scrollIntoView({behavior:"smooth",block:"start"}),u(!1)},40);return()=>{window.clearTimeout(ue)}},[e,o,d,l,I]),z.useEffect(()=>{if(e!=="logs")return;const ue=window.setInterval(()=>{Ke(Te=>Te+1)},2500);return()=>{window.clearInterval(ue)}},[e]),z.useEffect(()=>{oe&&ae({showSpinner:!0})},[oe,ae]);const be=z.useCallback(async ue=>{if(!(!i?.canManageBroker||!r?.controlBroker)){O(!0),Q(null);try{const Te=await r.controlBroker(ue);p(Te),h(null),await mt(),Q(ue==="start"?"Relay started.":ue==="stop"?"Relay stopped.":"Relay restarted.")}catch(Te){Q(Je(Te))}finally{O(!1)}}},[mt,r,h,p,i]),we=z.useCallback(()=>{(async()=>{ce("refresh"),Se(null);try{await ae({showSpinner:!0}),Se("Support details refreshed.")}finally{ce(null)}})()},[ae]),ze=z.useCallback(()=>{(async()=>{if(!J?.text){Se("Support bundle is still loading.");return}ce("copy"),Se(null);try{await Pz(J.text),Se("Support bundle copied.")}catch(ue){Se(Je(ue))}finally{ce(null)}})()},[J?.text]),We=z.useCallback(()=>{(async()=>{if(!r?.submitFeedbackReport){Se("Feedback submission is unavailable in this build.");return}const ue=B.trim();if(!ue){Se("Add a short description before submitting.");return}ce("submit"),Se(null);try{const Te=await r.submitFeedbackReport({message:ue});pe(Te),le(""),Se(`Feedback submitted as ${Te.key}.`)}catch(Te){Se(Je(Te))}finally{ce(null)}})()},[B,r]),Ae=z.useCallback(()=>{(async()=>{const ue=[];ce("repair"),Se(null);try{if(r?.restartOnboarding){const Te=await r.restartOnboarding();y(Te)}else ue.push("Onboarding reset unavailable.");if(k(null),S(null),A(null),N(null),Q(null),Fe(null),i?.canManageBroker&&r?.controlBroker)try{const Te=await r.controlBroker(I?.installed?"restart":"start");p(Te),h(null)}catch(Te){ue.push(`Relay: ${Je(Te)}`)}if(r?.controlPairingService)try{const Te=await r.controlPairingService(v?.isRunning?"restart":"start");g(Te)}catch(Te){ue.push(`Pairing: ${Je(Te)}`)}try{await mt()}catch(Te){ue.push(`Broker diagnostics: ${Je(Te)}`)}if(r?.refreshPairingState)try{const Te=await r.refreshPairingState();g(Te)}catch(Te){ue.push(`Pairing refresh: ${Je(Te)}`)}await f(!1),await ae(),Se(ue.length>0?`Repair finished with notes: ${ue.join(" · ")}`:"Setup repaired. Onboarding was reset and local services were refreshed.")}catch(Te){Se(Je(Te))}finally{ce(null)}})()},[y,I?.installed,g,ae,f,v?.isRunning,mt,r,k,N,A,S,h,p,i]);return{logCatalog:R,logSources:Ye,filteredLogSources:et,selectedLogSourceId:H,setSelectedLogSourceId:X,selectedLogSource:Me,logContent:V,brokerInspector:I,brokerControlPending:ne,brokerControlFeedback:P,isFeedbackDialogOpen:oe,feedbackBundle:J,feedbackBundleLoading:Y,feedbackBundleError:ve,feedbackDraft:B,setFeedbackDraft:le,feedbackSubmission:M,feedbackActionPending:ge,feedbackActionMessage:Re,logsLoading:Ne,logsFeedback:_e,logSearchQuery:it,setLogSearchQuery:rt,logSourceQuery:ut,setLogSourceQuery:st,refreshLogs:ot,refreshBrokerInspector:mt,openFeedbackDialog:Ce,handleFeedbackDialogOpenChange:nt,handleBrokerControl:be,handleRefreshFeedbackBundle:we,handleCopyFeedbackBundle:ze,handleSubmitFeedbackReport:We,handleRepairSetup:Ae}}function Hz({pairingEnabled:e,scoutDesktop:l,setRelayFeedback:r}){const[i,o]=z.useState(null),[u,d]=z.useState(!1),[f,p]=z.useState(null),[h,y]=z.useState(!1),[g,v]=z.useState(!1),[k,S]=z.useState(null),[A,N]=z.useState(null),R=z.useRef(null),L=z.useRef(0);z.useEffect(()=>{R.current=i},[i]),z.useEffect(()=>{e||(o(null),d(!1),p(null),y(!1),v(!1),S(null),N(null))},[e]);const H=z.useCallback(ne=>{o(O=>xA(O,ne)?O:ne)},[]),X=z.useCallback(async(ne,O)=>{if(!e||!ne)return null;const P=++L.current;O?.showLoading&&d(!0);try{const Q=await ne();return L.current!==P||(H(Q),p(null)),Q}catch(Q){if(L.current===P&&p(Je(Q)),O?.throwOnError)throw Q;return null}finally{O?.showLoading&&L.current===P&&d(!1)}},[H,e]);z.useEffect(()=>{if(!e||!l?.getPairingState)return;X(()=>l.getPairingState(),{showLoading:R.current===null});const ne=window.setInterval(()=>{X(()=>l.getPairingState())},5e3);return()=>{window.clearInterval(ne)}},[e,l,X]);const V=z.useCallback(async()=>e?l?.refreshPairingState?X(()=>l.refreshPairingState(),{throwOnError:!0}):X(l?.getPairingState?()=>l.getPairingState():void 0,{throwOnError:!0}):null,[e,l,X]),D=z.useCallback(async ne=>{if(l?.controlPairingService){y(!0);try{const O=await l.controlPairingService(ne);H(O),p(null),r(ne==="start"?"Pairing started.":ne==="stop"?"Pairing stopped.":"Pairing restarted.")}catch(O){p(Je(O))}finally{y(!1)}}},[H,l,r]),I=z.useCallback(async ne=>{if(l?.updatePairingConfig){v(!0),N(null);try{const O=await l.updatePairingConfig(ne);H(O),p(null),N("Pairing settings saved.")}catch(O){const P=Je(O);throw N(P),O}finally{v(!1)}}},[H,l]),F=z.useCallback(async(ne,O)=>{if(!l?.decidePairingApproval)return;const P=`${ne.sessionId}:${ne.turnId}:${ne.blockId}:${O}`;S(P);try{const Q=await l.decidePairingApproval({sessionId:ne.sessionId,turnId:ne.turnId,blockId:ne.blockId,version:ne.version,decision:O});H(Q),p(null),r(O==="approve"?"Approval sent.":"Action denied.")}catch(Q){p(Je(Q))}finally{S(Q=>Q===P?null:Q)}},[H,l,r]);return{pairingState:i,pairingLoading:u,pairingError:f,setPairingError:p,pairingControlPending:h,pairingConfigPending:g,pairingApprovalPendingId:k,pairingConfigFeedback:A,setPairingConfigFeedback:N,pendingApprovals:i?.pendingApprovals??[],commitPairingState:H,refreshPairingState:V,handlePairingControl:D,handleUpdatePairingConfig:I,handleDecidePairingApproval:F}}const h1={favorites:[],quickHits:[],preparedAt:null};function Fz({activeView:e,scoutDesktop:l,sessions:r}){const[i,o]=z.useState(null),[u,d]=z.useState(!1),[f,p]=z.useState(!1),[h,y]=z.useState(null),[g,v]=z.useState(null),[k,S]=z.useState(null),A=z.useRef(null),N=z.useRef(0);z.useEffect(()=>{A.current=i},[i]),z.useEffect(()=>{if(e!=="sessions"||!l?.getPhonePreparation)return;let W=!1;return(async()=>{d(!0);try{const w=await l.getPhonePreparation();if(W)return;o(w),y(null)}catch(w){if(W)return;o(null),y(Je(w))}finally{W||d(!1)}})(),()=>{W=!0}},[e,l]);const R=i??h1,L=z.useMemo(()=>new Map(r.map(W=>[W.id,W])),[r]),H=z.useMemo(()=>[...r].sort((W,J)=>new Date(J.lastModified).getTime()-new Date(W.lastModified).getTime()||J.messageCount-W.messageCount||W.title.localeCompare(J.title)),[r]),X=z.useMemo(()=>R.favorites.map(W=>L.get(W)).filter(W=>!!W),[R.favorites,L]),V=z.useMemo(()=>R.quickHits.filter(W=>!R.favorites.includes(W)).map(W=>L.get(W)).filter(W=>!!W),[R.favorites,R.quickHits,L]),D=z.useCallback(async(W,J)=>{if(!l?.updatePhonePreparation){y("Phone preparation is unavailable in this build.");return}const w=++N.current,Y=A.current;o(W),p(!0);try{const G=await l.updatePhonePreparation(W);if(N.current!==w)return;o(G),J?y(J):J===null&&y(null)}catch(G){if(N.current!==w)return;o(Y),y(Je(G))}finally{N.current===w&&(p(!1),v(null),S(null))}},[l]),I=z.useCallback((W,J)=>{const w=W(A.current??h1);D(w,J)},[D]),F=z.useCallback(()=>{const W=R.favorites.filter(w=>L.has(w)),J=H.map(w=>w.id).filter(w=>!W.includes(w)).slice(0,8);D({favorites:W,quickHits:J,preparedAt:Date.now()},`Prepared ${W.length+J.length} phone picks.`)},[D,R.favorites,H,L]),ne=z.useCallback(()=>{I(W=>({...W,quickHits:[],preparedAt:Date.now()}),"Cleared My List. Favorites stayed pinned.")},[I]),O=z.useCallback((W,J)=>{I(w=>J==="favorites"?{favorites:w.favorites.includes(W)?w.favorites:[...w.favorites,W],quickHits:w.quickHits.filter(Y=>Y!==W),preparedAt:Date.now()}:w.favorites.includes(W)||w.quickHits.includes(W)?{...w,preparedAt:Date.now()}:{...w,quickHits:[...w.quickHits,W],preparedAt:Date.now()},J==="favorites"?"Pinned for phone.":"Added to My List.")},[I]),P=z.useCallback((W,J)=>{I(w=>({favorites:J==="favorites"?w.favorites.filter(Y=>Y!==W):w.favorites,quickHits:J==="quickHits"?w.quickHits.filter(Y=>Y!==W):w.quickHits,preparedAt:Date.now()}),J==="favorites"?"Removed from phone favorites.":"Removed from My List.")},[I]),Q=z.useCallback(()=>{g&&O(g,"favorites")},[g,O]),oe=z.useCallback(W=>{g&&I(J=>{if(J.favorites.includes(g))return{...J,preparedAt:Date.now()};const w=J.quickHits.filter(G=>G!==g),Y=typeof W=="number"?Math.max(0,Math.min(W,w.length)):w.length;return w.splice(Y,0,g),{...J,quickHits:w,preparedAt:Date.now()}},k==="quickHits"?"Reordered My List.":"Added to My List.")},[k,g,I]);return{phonePreparationState:R,phonePreparationLoading:u,phonePreparationSaving:f,phonePreparationFeedback:h,setDraggedSessionId:v,setDraggedPhoneSection:S,favoritePhoneSessions:X,quickHitPhoneSessions:V,handlePreparePhone:F,handleClearPhoneQuickHits:ne,handleDropIntoFavorites:Q,handleDropIntoQuickHits:oe,handleRemoveSessionFromPhoneSection:P,handleAddSessionToPhoneSection:O}}function qz({activeView:e,setActiveView:l,desktopFeatures:r,styles:i,colorTheme:o,sidebarWidth:u,messagesDetailWidth:d,isCollapsed:f,onResizeStart:p,onMessagesDetailResizeStart:h,stats:y,runtime:g,shellState:v,shellError:k,plansState:S,machinesState:A,messagesState:N,interAgentState:R,interAgentAgents:L,interAgentAgentLookup:H,relayDirectLookup:X,homeAgents:V,homeActivity:D,activityRecentMessages:I,activityTasks:F,activityLeadTask:ne,activityFindings:O,activityEndpoints:P,overviewSessions:Q,inboxAlertCount:oe,pendingApprovalsCount:W,inboxFailedTaskCount:J,inboxAwaitingYouItems:w,availableAgentNames:Y,searchQuery:G,setSearchQuery:ve,filteredSessions:T,selectedSession:B,setSelectedSession:le,isLoadingMessagesWorkspace:M,isLoadingShell:pe,showAnnotations:ge,setShowAnnotations:ce,messagesDetailOpen:Re,setMessagesDetailOpen:Se,messagesDetailTab:Ne,setMessagesDetailTab:Ve,formatDate:_e,onRefreshShell:Fe,openAgentProfile:it,openSessionDetail:rt,handleSelectSearchSession:ut,handleToggleVoiceCapture:st,handleSetVoiceRepliesEnabled:vt,selectMessageThread:Ke,renderLocalPathValue:Ye,selectedInterAgentActivityMessages:et,selectedInterAgentInboundTasks:Me,selectedInterAgentOutboundFindings:ot,selectedInterAgentFindings:Ce,interAgentThreadTitle:nt,selectedInterAgentThreadSubtitle:mt,interAgentConfigureTarget:ae,interAgentConfigureLabel:be,interAgentMessageTarget:we,visibleInterAgentMessages:ze,relayVoiceState:We,messagesController:Ae,agentController:ue,diagnosticsController:Te,phonePreparationController:q,overviewBootLoader:de}){const ke={sidebar:i.sidebar,surface:i.surface,inkText:i.inkText,mutedText:i.mutedText,tagBadge:i.tagBadge,activePill:i.activePill},Qe=N??{title:"Messages",subtitle:M||pe?"Loading relay workspace":k??"Broker unavailable",lastUpdatedLabel:g?.updatedAtLabel??null,threads:[]};return{overviewInboxActivityViewProps:{activeView:e,overviewViewProps:{C:o,s:i,bootLoader:de,homeAgents:V,activity:D,shellError:k,onRefresh:Fe,onOpenAgent:it,colorForIdentity:hl},inbox:{isCollapsed:f,sidebarWidth:u,onResizeStart:p,styles:ke,inboxAlertCount:oe,pendingApprovalsCount:W,inboxFailedTaskCount:J,inboxAwaitingYouItems:w},activity:{isCollapsed:f,sidebarWidth:u,onResizeStart:p,styles:ke,plansState:S,machinesState:A,runtime:g,activityLeadTask:ne,activityTasks:F,activityFindings:O,activityEndpoints:P,activityRecentMessages:I,interAgentAgentLookup:H,overviewSessions:Q,formatDate:_e,onRefresh:Fe,onOpenPlans:()=>l("plans"),onOpenMessages:()=>l("messages"),onOpenAgentProfile:it,onOpenSessionDetail:rt}},opsViewsProps:{activeView:e,machinesViewProps:{machinesState:A??{title:"Machines",subtitle:"Broker unavailable",totalMachines:0,onlineCount:0,degradedCount:0,offlineCount:0,lastUpdatedLabel:null,machines:[]},C:o,s:i,isCollapsed:f,sidebarWidth:u,onResizeStart:p,onOpenRelayAgent:Ae.openDirectConversation,onRefresh:Fe,identityColor:hl},plansViewProps:{plansState:S??{title:"Plans",subtitle:"No broker snapshot yet",taskCount:0,runningTaskCount:0,failedTaskCount:0,completedTaskCount:0,findingCount:0,warningCount:0,errorCount:0,planCount:0,workspaceCount:0,lastUpdatedLabel:null,tasks:[],findings:[],plans:[]},C:o,s:i,isCollapsed:f,sidebarWidth:u,onResizeStart:p,onOpenRelayAgent:Ae.openDirectConversation,onRefresh:Fe,identityColor:hl},search:{isCollapsed:f,sidebarWidth:u,onResizeStart:p,styles:{sidebar:i.sidebar,surface:i.surface,inkText:i.inkText,mutedText:i.mutedText,tagBadge:i.tagBadge,activeItem:i.activeItem,kbd:i.kbd},availableAgentNames:Y,searchQuery:G,setSearchQuery:ve,filteredSessions:T,stats:{totalSessions:y.totalSessions,totalMessages:y.totalMessages},formatDate:_e,onOpenSession:ut}},agentViewsProps:{activeView:e,layout:{isCollapsed:f,sidebarWidth:u,onResizeStart:p,styles:{sidebar:i.sidebar,surface:i.surface,inkText:i.inkText,mutedText:i.mutedText,tagBadge:i.tagBadge,activePill:i.activePill,activeItem:i.activeItem,annotBadge:i.annotBadge}},roster:{interAgentStateTitle:R?.title??"Inter-Agent",interAgentStateSubtitle:R?.subtitle??"Agent-to-agent traffic",rosterInterAgentAgents:ue.rosterInterAgentAgents,interAgentAgents:L,selectedInterAgentId:ue.selectedInterAgentId,onSelectInterAgent:ue.handleSelectInterAgent,agentRosterMenu:ue.agentRosterMenu,setAgentRosterMenu:ue.setAgentRosterMenu,agentRosterFilter:ue.agentRosterFilter,setAgentRosterFilter:ue.setAgentRosterFilter,agentRosterSort:ue.agentRosterSort,setAgentRosterSort:ue.setAgentRosterSort,rosterAgentTitleCounts:ue.rosterAgentTitleCounts,onRefresh:Fe},agents:{selectedInterAgent:ue.selectedInterAgent,selectedInterAgentDirectThread:ue.selectedInterAgentDirectThread,selectedInterAgentChatActionLabel:ue.selectedInterAgentChatActionLabel,onOpenAgentThread:Ae.openDirectConversation,onPeekAgentSession:ue.handlePeekAgentSession,onOpenAgentSettings:ue.handleOpenAgentSettings,visibleAgentSession:ue.visibleAgentSession,agentSessionPending:ue.agentSessionPending,agentSessionLoading:ue.agentSessionLoading,agentSessionFeedback:ue.agentSessionFeedback,agentSessionCopied:ue.agentSessionCopied,onCopyAgentSessionCommand:()=>{ue.handleCopyAgentSessionCommand()},onOpenAgentSession:()=>{ue.handleOpenAgentSession()},onAgentSessionTraceIntent:Be=>{ue.handleAgentSessionTraceIntent(Be)},agentSessionLogsExpanded:ue.agentSessionLogsExpanded,setAgentSessionLogsExpanded:ue.setAgentSessionLogsExpanded,agentSessionInlineViewportRef:ue.agentSessionInlineViewportRef,onInlineAgentSessionScroll:ue.handleInlineAgentSessionScroll,renderLocalPathValue:Ye,selectedInterAgentActivityMessages:et,interAgentAgentLookup:H,relayDirectLookup:X,onOpenAgentProfile:it,onNudgeMessage:Ae.nudgeMessage,selectedInterAgentInboundTasks:Me,selectedInterAgentOutboundFindings:ot,selectedInterAgentFindings:Ce,agentActivityExpanded:ue.agentActivityExpanded,setAgentActivityExpanded:ue.setAgentActivityExpanded,agentThreadsExpanded:ue.agentThreadsExpanded,setAgentThreadsExpanded:ue.setAgentThreadsExpanded,visibleInterAgentThreads:ue.visibleInterAgentThreads,selectedInterAgentThreadId:ue.selectedInterAgentThreadId,onOpenThreadInTrafficView:Be=>{ue.setSelectedInterAgentThreadId(Be),l("inter-agent")},selectedAgentDirectLinePreview:ue.selectedAgentDirectLinePreview,agentSnapshotExpanded:ue.agentSnapshotExpanded,setAgentSnapshotExpanded:ue.setAgentSnapshotExpanded,visibleAgentConfig:ue.visibleAgentConfig},logs:{logSources:Te.logSources,filteredLogSources:Te.filteredLogSources,selectedLogSourceId:Te.selectedLogSourceId,setSelectedLogSourceId:Te.setSelectedLogSourceId,selectedLogSource:Te.selectedLogSource,logCatalog:Te.logCatalog,logContent:Te.logContent,logsLoading:Te.logsLoading,logsFeedback:Te.logsFeedback,logSearchQuery:Te.logSearchQuery,setLogSearchQuery:Te.setLogSearchQuery,logSourceQuery:Te.logSourceQuery,setLogSourceQuery:Te.setLogSourceQuery},interAgent:{selectedInterAgent:ue.selectedInterAgent,visibleInterAgentThreads:ue.visibleInterAgentThreads,selectedInterAgentThreadId:ue.selectedInterAgentThreadId,setSelectedInterAgentThreadId:ue.setSelectedInterAgentThreadId,interAgentThreadTitle:nt,selectedInterAgentThread:ue.selectedInterAgentThread,selectedInterAgentThreadSubtitle:mt,selectedRelayDirectThread:Ae.selectedDirectConversation,showAnnotations:ge,setShowAnnotations:ce,interAgentMessageTarget:we,openAgentDirectMessage:Ae.openAgentDirectMessage,interAgentConfigureTarget:ae,onOpenAgentSettings:ue.handleOpenAgentSettings,interAgentConfigureLabel:be,visibleInterAgentMessages:ze,interAgentAgentLookup:H,relayDirectLookup:X,onOpenAgentProfile:it,onNudgeMessage:Ae.nudgeMessage},sessions:{searchQuery:G,setSearchQuery:ve,filteredSessions:T,stats:{totalSessions:y.totalSessions},onRefresh:Fe,loadingSessions:pe&&!v,selectedSession:B,setSelectedSession:le,phonePreparationState:q.phonePreparationState,phonePreparationLoading:q.phonePreparationLoading,phonePreparationSaving:q.phonePreparationSaving,phonePreparationFeedback:q.phonePreparationFeedback,setDraggedSessionId:q.setDraggedSessionId,setDraggedPhoneSection:q.setDraggedPhoneSection,favoritePhoneSessions:q.favoritePhoneSessions,quickHitPhoneSessions:q.quickHitPhoneSessions,formatDate:_e,onClearPhoneQuickHits:q.handleClearPhoneQuickHits,onDropIntoFavorites:q.handleDropIntoFavorites,onDropIntoQuickHits:q.handleDropIntoQuickHits,onRemoveSessionFromPhoneSection:q.handleRemoveSessionFromPhoneSection,onAddSessionToPhoneSection:q.handleAddSessionToPhoneSection}},messagesRelayViewProps:{activeView:e,layout:{sidebarWidth:u,messagesDetailWidth:d,isCollapsed:f,onResizeStart:p,onMessagesDetailResizeStart:h,styles:{sidebar:i.sidebar,surface:i.surface,inkText:i.inkText,mutedText:i.mutedText,tagBadge:i.tagBadge,annotBadge:i.annotBadge,activeItem:i.activeItem,activePill:i.activePill,kbd:i.kbd}},threading:{messagesState:Qe,messageThreads:Ae.messageThreads,selectedMessagesThread:Ae.selectedMessagesThread,onSelectMessageThread:Ke,showAnnotations:ge,setShowAnnotations:ce,onRefresh:Fe,loadingWorkspace:(M||pe)&&!N,selectedMessagesInternalThread:Ae.selectedMessagesInternalThread,selectedMessagesInternalMessages:Ae.selectedMessagesInternalMessages,selectedMessagesInternalTarget:Ae.selectedMessagesInternalTarget,selectedMessagesDetailAgentId:Ae.selectedMessagesDetailAgentId,selectedMessagesDetailAgent:Ae.selectedMessagesDetailAgent,selectedMessagesSessions:Ae.selectedMessagesSessions,selectedSession:B,setSelectedSession:le,formatDate:_e,interAgentAgents:L,interAgentAgentLookup:H,relayDirectLookup:X,openAgentProfile:it,openAgentDirectMessage:Ae.openAgentDirectMessage,onNudgeMessage:Ae.nudgeMessage,messagesDetailOpen:Re,setMessagesDetailOpen:Se,messagesDetailTab:Ne,setMessagesDetailTab:Ve},composer:{selectedRelayKind:Ae.selectedConversationKind,selectedRelayId:Ae.selectedConversationId,relayThreadTitle:Ae.currentConversationTitle,relayThreadSubtitle:Ae.currentConversationSubtitle,relayThreadCount:Ae.currentConversationCount,selectedRelayDirectThread:Ae.selectedDirectConversation,relayVoiceState:We,visibleRelayMessages:Ae.visibleConversationMessages,relayTimelineViewportRef:Ae.timelineViewportRef,onRelayTimelineScroll:Ae.handleConversationTimelineScroll,relayReplyTarget:Ae.replyTarget,setRelayReplyTarget:Ae.setReplyTarget,relayContextReferences:Ae.contextReferences,relayContextMessageIds:Ae.contextMessageIds,setRelayContextMessageIds:Ae.setContextMessageIds,relayComposerRef:Ae.composerRef,relayDraft:Ae.composerDraft,setRelayDraft:Ae.setComposerDraft,relaySending:Ae.composerSending,relayFeedback:Ae.messagesFeedback,relayComposerSelectionStart:Ae.composerSelectionStart,setRelayComposerSelectionStart:Ae.setComposerSelectionStart,mergedRelayMessages:Ae.mergedConversationMessages,relayMentionMenuOpen:Ae.mentionMenuOpen,relayMentionSuggestions:Ae.mentionSuggestions,relayMentionSelectionIndex:Ae.mentionSelectionIndex,setRelayMentionSelectionIndex:Ae.setMentionSelectionIndex,relayMentionDuplicateTitleCounts:Ae.mentionDuplicateTitleCounts,applyRelayMentionSuggestion:Ae.applyMentionSuggestion,onRelaySend:()=>{Ae.sendMessage()},onToggleVoiceCapture:st,onSetVoiceRepliesEnabled:Be=>{vt(Be)}},agentSession:{visibleAgentSession:ue.visibleAgentSession,agentSessionPending:ue.agentSessionPending,agentSessionFeedback:ue.agentSessionFeedback,agentSessionCopied:ue.agentSessionCopied,onCopyAgentSessionCommand:()=>{ue.handleCopyAgentSessionCommand()},onOpenAgentSession:()=>{ue.handleOpenAgentSession()},onAgentSessionTraceIntent:Be=>{ue.handleAgentSessionTraceIntent(Be)},onPeekAgentSession:ue.handlePeekAgentSession,onOpenAgentSettings:ue.handleOpenAgentSettings,desktopVoiceEnabled:r.voice}}}}function Vz({activeView:e,setActiveView:l,settingsSection:r,setSettingsSection:i,settingsAgentId:o,setSettingsAgentId:u,settingsSections:d,activeSettingsMeta:f,desktopFeatures:p,stats:h,runtime:y,relayState:g,relayRuntimeBooting:v,relayRuntimeHealthLabel:k,reachableRelayAgentCount:S,dark:A,setDark:N,showAnnotations:R,setShowAnnotations:L,isCollapsed:H,styles:X,scoutDesktop:V,surfaceCaps:D,interAgentAgents:I,openKnowledgeBase:F,openAgentProfile:ne,openDirectConversation:O,renderOnboardingCommandShell:P,renderLocalPathValue:Q,settingsOperatorNameRef:oe,relayServiceInspectorRef:W,handleSetVoiceRepliesEnabled:J,settingsController:w,diagnosticsController:Y,agentController:G}){const[ve,T]=z.useState(null),[B,le]=z.useState(""),[M,pe]=z.useState("all"),[ge,ce]=z.useState("grid"),Re=z.useMemo(()=>w.agentableProjects.find(Ce=>Ce.id===ve)??null,[ve,w.agentableProjects]),Se=Re,Ne=z.useMemo(()=>Se?I.find(Ce=>Ce.id===Se.id||Ce.id===Se.definitionId)??null:null,[I,Se]),Ve=z.useMemo(()=>w.agentableProjects.map(Ce=>{const nt=I.find(be=>be.id===Ce.id||be.id===Ce.definitionId)??null,mt=!!nt||Ce.registrationKind==="configured",ae=Ce.harnesses[0]?.harness??Ce.defaultHarness;return{project:Ce,linkedAgent:nt,isBound:mt,primaryHarness:ae,pathLabel:ii(Ce.root)??Ce.root,branchLabel:"local",activityLabel:nt?.timestampLabel??"Workspace",statusLabel:mt?"Bound":Ce.registrationKind==="configured"?"Ready":"Discovered"}}),[I,w.agentableProjects]),_e=z.useMemo(()=>{const Ce=B.trim().toLowerCase();return Ve.filter(({project:nt,isBound:mt,primaryHarness:ae})=>(M==="all"?!0:M==="bound"?mt:!mt)?Ce?[nt.title,nt.projectName,nt.root,nt.relativePath,ae].some(we=>we.toLowerCase().includes(Ce)):!0:!1)},[M,Ve,B]),Fe=z.useMemo(()=>Ve.filter(Ce=>Ce.isBound).length,[Ve]),it=z.useMemo(()=>Ve.filter(Ce=>!Ce.isBound).length,[Ve]),rt=z.useMemo(()=>o?I.find(Ce=>Ce.id===o)??null:null,[I,o]),ut=G.selectedInterAgent?.id===o,st=ut?G.selectedInterAgent:rt,vt=z.useCallback(Ce=>{i(Ce),u(null)},[u,i]);z.useEffect(()=>{ve&&(w.agentableProjects.some(Ce=>Ce.id===ve)||T(null))},[ve,w.agentableProjects]);const Ke=z.useCallback(Ce=>{T(Ce.id),G.resetAgentInspector()},[G]),Ye=z.useCallback(Ce=>{if(Ce.registrationKind==="configured"){ne(Ce.id);return}Ke(Ce)},[Ke,ne]),et=z.useCallback(()=>{l("settings"),i("profile"),w.handleBeginGeneralEdit(),w.setAppSettingsFeedback("Add a scan folder below, then go back to Workspaces and refresh to discover workspaces.")},[l,i,w]),Me=z.useCallback(Ce=>{w.handleRetireProject(Ce.root,Ce.title).then(nt=>{!nt||Re?.root!==Ce.root||(T(null),G.resetAgentInspector())})},[G,Re?.root,w]),ot=r==="profile"?a.jsxs(a.Fragment,{children:[w.isAppSettingsEditing?a.jsxs(a.Fragment,{children:[a.jsx("button",{className:"os-toolbar-button flex items-center gap-1 text-[10px] font-medium px-2 py-0.5 rounded disabled:opacity-50",style:{color:b.ink},onClick:()=>w.handleCancelAppSettingsEdit(),disabled:w.appSettingsSaving,children:"Cancel"}),a.jsx("button",{className:"os-toolbar-button flex items-center gap-1 text-[10px] font-medium px-2 py-0.5 rounded disabled:opacity-50",style:{color:b.ink},onClick:()=>{w.handleSaveAppSettings()},disabled:!w.appSettingsDirty||w.appSettingsSaving||w.appSettingsLoading,children:w.appSettingsSaving?"Saving…":"Save General"})]}):a.jsx("button",{className:"os-toolbar-button flex items-center gap-1 text-[10px] font-medium px-2 py-0.5 rounded disabled:opacity-50",style:{color:b.ink},onClick:()=>w.handleStartAppSettingsEdit(),disabled:w.appSettingsLoading||!w.visibleAppSettings,children:"Edit General"}),a.jsxs("button",{className:"os-toolbar-button flex items-center gap-1 text-[10px] font-medium px-2 py-0.5 rounded disabled:opacity-50",style:{color:b.ink},onClick:w.handleRestartOnboarding,disabled:w.appSettingsLoading||!w.visibleAppSettings,children:[a.jsx(gn,{size:12}),"Restart onboarding"]})]}):r==="communication"?w.isAppSettingsEditing?a.jsxs(a.Fragment,{children:[a.jsx("button",{className:"os-toolbar-button flex items-center gap-1 text-[10px] font-medium px-2 py-0.5 rounded disabled:opacity-50",style:{color:b.ink},onClick:()=>w.handleCancelAppSettingsEdit(),disabled:w.appSettingsSaving,children:"Cancel"}),a.jsx("button",{className:"os-toolbar-button flex items-center gap-1 text-[10px] font-medium px-2 py-0.5 rounded disabled:opacity-50",style:{color:b.ink},onClick:()=>{w.handleSaveAppSettings()},disabled:!w.appSettingsDirty||w.appSettingsSaving||w.appSettingsLoading,children:w.appSettingsSaving?"Saving…":p.telegram?"Save Telegram":"Save Communication"})]}):a.jsx("button",{className:"os-toolbar-button flex items-center gap-1 text-[10px] font-medium px-2 py-0.5 rounded disabled:opacity-50",style:{color:b.ink},onClick:()=>w.handleStartAppSettingsEdit(),disabled:w.appSettingsLoading||!w.visibleAppSettings,children:p.telegram?"Edit Telegram":"Edit Communication"}):r==="agents"?a.jsxs(a.Fragment,{children:[a.jsx("button",{className:"os-toolbar-button flex items-center gap-1 text-[10px] font-medium px-2 py-0.5 rounded",style:{color:b.ink},onClick:()=>l("agents"),children:"Open Agents"}),st&&ut&&G.hasEditableAgentConfig?G.isAgentConfigEditing?a.jsxs(a.Fragment,{children:[a.jsx("button",{className:"os-toolbar-button flex items-center gap-1 text-[10px] font-medium px-2 py-0.5 rounded disabled:opacity-50",style:{color:b.ink},onClick:()=>G.handleCancelAgentConfigEdit(),disabled:G.agentConfigSaving||G.agentConfigRestarting,children:"Cancel"}),a.jsx("button",{className:"os-toolbar-button flex items-center gap-1 text-[10px] font-medium px-2 py-0.5 rounded disabled:opacity-50",style:{color:b.ink},onClick:()=>{G.handleSaveAgentConfig()},disabled:!G.agentConfigDirty||G.agentConfigLoading||G.agentConfigSaving||G.agentConfigRestarting,children:G.agentConfigSaving?"Saving…":"Save Changes"})]}):a.jsx("button",{className:"os-toolbar-button flex items-center gap-1 text-[10px] font-medium px-2 py-0.5 rounded disabled:opacity-50",style:{color:b.ink},onClick:()=>G.handleStartAgentConfigEdit(),disabled:!o||G.agentConfigLoading||G.agentConfigRestarting,children:"Edit Agent"}):null,st&&ut&&G.hasEditableAgentConfig?a.jsx("button",{className:"os-toolbar-button flex items-center gap-1 text-[10px] font-medium px-2 py-0.5 rounded disabled:opacity-50",style:{color:b.ink},onClick:()=>{G.handleRestartAgent()},disabled:G.agentConfigLoading||G.agentConfigRestarting||!G.visibleAgentConfig,children:G.agentConfigRestarting?"Restarting…":G.agentRestartActionLabel}):null]}):r==="database"?a.jsx("button",{className:"os-toolbar-button flex items-center gap-1 text-[10px] font-medium px-2 py-0.5 rounded",style:{color:b.ink},onClick:()=>l("sessions"),children:"Browse Sessions"}):null;return{activeView:e,help:{styles:X,buildOnboardingCommandLine:w.buildOnboardingCommandLine,onboardingCopiedCommand:w.onboardingCopiedCommand,onboardingCommandPending:w.onboardingCommandPending,onCopyOnboardingCommand:w.handleCopyOnboardingCommand,onRunOnboardingCommand:w.handleRunOnboardingCommand,onOpenGeneralSettings:()=>{l("settings"),i("profile")}},settings:{styles:X,settingsSection:r,settingsSections:d,activeSettingsMeta:f,onSetSettingsSection:vt,onOpenFeedbackDialog:Y.openFeedbackDialog,headerActions:ot,profile:{styles:X,visibleAppSettings:w.visibleAppSettings,appSettings:w.appSettings,isAppSettingsEditing:w.isAppSettingsEditing,appSettingsSaving:w.appSettingsSaving,appSettingsLoading:w.appSettingsLoading,appSettingsDirty:w.appSettingsDirty,appSettingsFeedback:w.appSettingsFeedback,settingsOperatorNameRef:oe,onboardingWizardStep:w.onboardingWizardStep,setOnboardingWizardStep:w.setOnboardingWizardStep,activeOnboardingStepIndex:w.onboardingWizardIndex,activeOnboardingStep:w.activeOnboardingStep,onboardingWizardSteps:w.onboardingWizardSteps,sourceRootPathSuggestions:w.SOURCE_ROOT_PATH_SUGGESTIONS,onboardingRuntimeMatch:w.onboardingRuntimeMatch,onboardingHasProjectConfig:w.onboardingHasProjectConfig,onboardingCopiedCommand:w.onboardingCopiedCommand,onboardingCommandPending:w.onboardingCommandPending,onboardingCommandResult:w.onboardingCommandResult,canGoToPreviousOnboardingStep:w.canGoToPreviousOnboardingStep,canGoToNextOnboardingStep:w.canGoToNextOnboardingStep,moveOnboardingWizard:w.moveOnboardingWizard,handleOnboardingContinue:w.handleOnboardingContinue,handleRestartOnboarding:w.handleRestartOnboarding,handleStartAppSettingsEdit:w.handleStartAppSettingsEdit,handleBeginGeneralEdit:w.handleBeginGeneralEdit,handleSetSourceRootAt:w.handleSetSourceRootAt,handleBrowseForSourceRoot:w.handleBrowseForSourceRoot,handleRemoveSourceRootRow:w.handleRemoveSourceRootRow,handleAddSourceRootRow:w.handleAddSourceRootRow,handleAddSourceRootSuggestion:w.handleAddSourceRootSuggestion,handleSetOnboardingContextRoot:w.handleSetOnboardingContextRoot,handleBrowseForOnboardingContextRoot:w.handleBrowseForOnboardingContextRoot,setAppSettingsDraft:w.setAppSettingsDraft,setAppSettingsFeedback:w.setAppSettingsFeedback,buildOnboardingCommandLine:w.buildOnboardingCommandLine,handleCopyOnboardingCommand:w.handleCopyOnboardingCommand,handleRunOnboardingCommand:w.handleRunOnboardingCommand,renderOnboardingCommandShell:P,renderLocalPathValue:Q,openKnowledgeBase:F},agentSettingsViewProps:{styles:X,selectedInterAgent:st,availableAgents:G.rosterInterAgentAgents,isAgentConfigEditing:ut?G.isAgentConfigEditing:!1,hasEditableAgentConfig:ut?G.hasEditableAgentConfig:!1,agentConfigLoading:o?!ut||G.agentConfigLoading:!1,agentConfigSaving:ut?G.agentConfigSaving:!1,agentConfigRestarting:ut?G.agentConfigRestarting:!1,visibleAgentConfig:ut?G.visibleAgentConfig:null,agentConfigFeedback:ut?G.agentConfigFeedback:null,agentCapabilitiesPreview:ut?G.agentCapabilitiesPreview:[],agentRuntimePathRef:G.agentRuntimePathRef,onOpenAgents:()=>l("agents"),onOpenAgentProfile:ne,onOpenAgentThread:Ce=>O(Ce,{focusComposer:!0}),onUpdateAgentConfigDraft:G.updateAgentConfigDraft,renderLocalPathValue:Q,interAgentProfileKindLabel:Tv,onSelectAgent:Ce=>{u(Ce),G.handleSelectInterAgent(Ce)}},workspaceExplorerViewProps:{styles:X,selectedWorkspaceProject:Se,selectedWorkspaceAgent:Ne,workspaceExplorerQuery:B,setWorkspaceExplorerQuery:le,workspaceExplorerFilter:M,setWorkspaceExplorerFilter:pe,workspaceExplorerViewMode:ge,setWorkspaceExplorerViewMode:ce,workspaceExplorerItems:Ve,workspaceExplorerBoundCount:Fe,workspaceExplorerDiscoveredCount:it,filteredWorkspaceExplorerItems:_e,workspaceInventoryLoaded:w.workspaceInventoryLoaded,workspaceInventoryLoading:w.workspaceInventoryLoading,canRefreshWorkspaceInventory:w.canRefreshWorkspaceInventory,onboardingCommandPending:w.onboardingCommandPending,appSettingsLoading:w.appSettingsLoading,appSettingsSaving:w.appSettingsSaving,appSettingsDirty:w.appSettingsDirty,appSettingsFeedback:w.appSettingsFeedback,showDoctorOutput:w.showDoctorOutput,doctorOutput:P("doctor",w.buildOnboardingCommandLine("doctor"),w.onboardingCommandPending==="doctor"),projectRetirementPendingRoot:w.projectRetirementPendingRoot,onRefreshWorkspaceDiscovery:()=>{w.handleRunOnboardingCommand("doctor")},onLoadWorkspaceInventory:w.handleLoadWorkspaceInventory,onAddWorkspace:et,onInspectWorkspace:Ke,onOpenWorkspace:Ye,onRetireWorkspace:Me,onOpenAgentProfile:ne,onOpenAgentSettings:Ce=>G.handleOpenAgentSettings(Ce,!0),renderLocalPathValue:Q},communicationSettingsViewProps:{styles:X,showTelegram:p.telegram,showVoice:p.voice,visibleAppSettings:w.visibleAppSettings,isAppSettingsEditing:w.isAppSettingsEditing,appSettingsSaving:w.appSettingsSaving,appSettingsFeedback:w.appSettingsFeedback,onUpdateAppSettingsDraft:w.updateAppSettingsDraft,brokerInspector:Y.brokerInspector,brokerControlPending:Y.brokerControlPending,brokerControlFeedback:Y.brokerControlFeedback,onBrokerControl:Ce=>{Y.handleBrokerControl(Ce)},relayServiceInspectorRef:W,relayRuntimeBooting:v,relayRuntimeHealthLabel:k,runtime:y,reachableRelayAgentCount:S,voiceCaptureTitle:g?.voice.captureTitle??"Not reported",voiceRepliesEnabled:g?.voice.repliesEnabled??!1,onSetVoiceRepliesEnabled:Ce=>{J(Ce)},renderLocalPathValue:Q},database:{styles:X,stats:h,runtime:y,visibleAppSettings:w.visibleAppSettings,renderLocalPathValue:Q,onRevealPath:Ce=>{D?.canRevealPath&&V?.revealPath?.(Ce)}},appearance:{styles:X,dark:A,setDark:N,showAnnotations:R,setShowAnnotations:L,isCollapsed:H,activeSettingsLabel:f.label}}}}const $z=["~/dev","~/src","~/code"],bo=["welcome","source-roots","harness","confirm","setup","doctor","runtimes"];function Gz({activeView:e,settingsSection:l,scoutDesktop:r,shellState:i,surfaceCaps:o,completeOnboardingIntoRelay:u,loadShellState:d}){const[f,p]=z.useState(null),[h,y]=z.useState(null),[g,v]=z.useState(!1),[k,S]=z.useState(!1),[A,N]=z.useState(!1),[R,L]=z.useState(null),[H,X]=z.useState(!1),[V,D]=z.useState(null),[I,F]=z.useState("welcome"),[ne,O]=z.useState(null),[P,Q]=z.useState(null),[oe,W]=z.useState({}),[J,w]=z.useState(null),[Y,G]=z.useState("checking"),ve=H?h??f:f,T=ve?.projectInventory??[],B=ve?.hiddenProjects??[],le=z.useMemo(()=>Kb(h)!==Kb(f),[h,f]),M=!!ve?.workspaceInventoryLoaded,pe=!!(f&&r?.refreshSettingsInventory),ge=!!(ne==="doctor"||oe.doctor||P?.command==="doctor"),ce=ve?.onboardingContextRoot??ve?.workspaceRoots?.[0]??null,Re=!!ve?.currentProjectConfigPath,Se=(ve?.runtimeCatalog??[]).find(se=>se.name===ve?.defaultHarness)??null,Ne=z.useMemo(()=>new Map((ve?.onboarding.steps??[]).map(se=>[se.id,se.complete])),[ve?.onboarding.steps]),Ve=z.useMemo(()=>[{id:"welcome",number:"01",title:"Say hi",detail:"Tell Scout what to call you before the rest of setup begins.",complete:Ne.get("welcome")??!1},{id:"source-roots",number:"02",title:"Choose folders to scan",detail:"Pick the parent folders Scout should scan for repos, then choose where this Scout context should live.",complete:Ne.get("source-roots")??!1},{id:"harness",number:"03",title:"Choose a default harness",detail:"This is the assistant family Scout should prefer when a project does not pin one of its own.",complete:Ne.get("harness")??!1},{id:"confirm",number:"04",title:"Confirm this context",detail:"Review which folders Scout will scan and where it will save this context before moving into the command steps.",complete:Ne.get("confirm")??!1},{id:"setup",number:"05",title:"Run setup",detail:"See how Scout writes `.openscout/project.json` at your chosen context root and uses it as this context anchor.",complete:Ne.get("setup")??!1},{id:"doctor",number:"06",title:"Run doctor",detail:"See how Scout combines broker health, scanned folders, and context manifests into one inventory view.",complete:Ne.get("doctor")??!1},{id:"runtimes",number:"07",title:"Run runtimes",detail:"Check whether Claude or Codex is installed, signed in, and ready for broker-owned sessions.",complete:Ne.get("runtimes")??!1}],[Ne]),_e=Math.max(0,bo.indexOf(I)),Fe=Ve[_e]??Ve[0],it=_e>0,rt=_e<Ve.length-1,ut=Y==="active"&&!!ve?.onboarding,st=Y!=="done",vt=z.useCallback((se,Ee)=>se?{...Ee,operatorName:se.operatorName,onboardingContextRoot:se.onboardingContextRoot,workspaceRoots:se.workspaceRoots,includeCurrentRepo:se.includeCurrentRepo,defaultHarness:se.defaultHarness,defaultTransport:se.defaultTransport,defaultCapabilities:se.defaultCapabilities,sessionPrefix:se.sessionPrefix,telegram:se.telegram}:Ee,[]),Ke=z.useCallback(se=>{p(se),y(se),se.workspaceInventoryLoaded&&S(!1)},[]),Ye=z.useCallback(se=>{p(se),y(Ee=>H?Ee:se),se.workspaceInventoryLoaded&&S(!1)},[H]),et=z.useCallback(se=>{p(se),y(Ee=>H?vt(Ee,se):se),se.workspaceInventoryLoaded&&S(!1)},[H,vt]),Me=z.useCallback(se=>{Ke(se),F("welcome"),Q(null),w(null),X(!0),G("active")},[Ke]),ot=z.useCallback(se=>{const Ee=ce?` --context-root ${ce}`:"",Oe=se==="setup"?(ve?.workspaceRoots??[]).map(tt=>` --source-root ${tt}`).join(""):"";return`scout ${se}${Ee}${Oe}`},[ce,ve?.workspaceRoots]),Ce=z.useCallback(async se=>{if(!r?.getAppSettings)return null;const Ee=se?.preferInventory&&r.refreshSettingsInventory?await r.refreshSettingsInventory():await r.getAppSettings();return Ye(Ee),Ee},[r,Ye]);z.useEffect(()=>{if(!(e==="settings"||e==="help"||Y==="active")||!r?.getAppSettings)return;let Ee=!1;return(async()=>{v(!0);try{const tt=await r.getAppSettings();if(Ee)return;Ke(tt),Y==="active"&&tt.onboarding.needed?(L(null),X(!0),F(Vt=>Vt||"welcome")):(L(null),X(!1)),Y==="active"&&!tt.onboarding.needed&&(u(i),G("done"))}catch(tt){if(Ee)return;p(null),y(null),L(Je(tt)),X(!1),Y!=="done"&&G("done")}finally{Ee||v(!1)}})(),()=>{Ee=!0}},[e,u,Ke,r,i,Y]),z.useEffect(()=>{let se=!1;return r?.getAppSettings?((async()=>{try{const Oe=await r.getAppSettings();if(se)return;p(tt=>tt??Oe),y(tt=>tt??Oe),Oe.onboarding.needed?(L(null),X(!0),F("welcome"),G("active")):G("done")}catch{se||G("done")}})(),()=>{se=!0}):(G("done"),()=>{se=!0})},[r]),z.useEffect(()=>{if(e!=="settings"||l!=="workspaces"||!r?.refreshSettingsInventory||!f||f.workspaceInventoryLoaded||k)return;let se=!1;return(async()=>{S(!0);try{const Oe=await r.refreshSettingsInventory();se||et(Oe)}catch(Oe){se||L(Je(Oe))}finally{se||S(!1)}})(),()=>{se=!0}},[e,f,et,r,l,k]);const nt=z.useCallback(()=>{y(f),L(null),X(!0),f?.onboarding.needed&&F("welcome")},[f]),mt=z.useCallback(()=>{y(f),L(null),X(!1)},[f]),ae=z.useCallback(se=>{y(Ee=>Ee&&se(Ee)),L(null)},[]),be=z.useCallback(async()=>{if(!h||!r?.updateAppSettings)return!1;N(!0);try{const se=await r.updateAppSettings({operatorName:h.operatorName,onboardingContextRoot:h.onboardingContextRoot,workspaceRootsText:h.workspaceRoots.join(`
92
+ `),includeCurrentRepo:h.includeCurrentRepo,defaultHarness:h.defaultHarness,defaultCapabilitiesText:h.defaultCapabilities.join(`
93
+ `),sessionPrefix:h.sessionPrefix,telegram:{enabled:h.telegram.enabled,mode:h.telegram.mode,botToken:h.telegram.botToken,secretToken:h.telegram.secretToken,apiBaseUrl:h.telegram.apiBaseUrl,userName:h.telegram.userName,defaultConversationId:h.telegram.defaultConversationId,ownerNodeId:h.telegram.ownerNodeId}});return Ke(se),L("Settings saved."),X(se.onboarding.needed),G(Ee=>Ee==="active"?se.onboarding.needed?"active":"done":Ee),await d(!1),!0}catch(se){return L(Je(se)),!1}finally{N(!1)}},[h,d,Ke,r]),we=z.useCallback(se=>{F(Ee=>{const Oe=bo.indexOf(Ee);if(Oe<0)return bo[0];const tt=Math.min(bo.length-1,Math.max(0,Oe+se));return bo[tt]})},[]),ze=z.useCallback(async se=>{if(!o?.canProvisionRuntime||!r?.runOnboardingCommand)return L(o&&!o.canProvisionRuntime?"Setup and doctor commands must be run from the Scout CLI (`scout setup`, `scout doctor`) on this host.":null),null;O(se),L(null);try{const Ee=(h??f)?.workspaceRoots??[],Oe=await r.runOnboardingCommand({command:se,contextRoot:(h??f)?.onboardingContextRoot??Ee[0],sourceRoots:se==="setup"?Ee:void 0});if(Q(Oe),W(tt=>({...tt,[se]:Oe})),L(Oe.exitCode!==0?`${se} exited with status ${Oe.exitCode}. Review the output below before continuing.`:null),r.getAppSettings){const tt=(se==="doctor"||se==="setup")&&r.refreshSettingsInventory?await r.refreshSettingsInventory():await r.getAppSettings();Ke(tt),X(tt.onboarding.needed);const Vt=await d(!1);tt.onboarding.needed?se==="runtimes"&&Oe.exitCode===0&&!Vt?.runtime?.brokerReachable?(F("doctor"),L("Relay is still offline. Run doctor again and make sure the broker is reachable before onboarding can finish.")):Oe.exitCode===0&&setTimeout(()=>{we(1)},1800):u(Vt),G(on=>on==="active"?tt.onboarding.needed?"active":"done":on)}return Oe}catch(Ee){return L(Je(Ee)),null}finally{O(null)}},[f,h,u,d,we,r,o]),We=z.useCallback(async(se,Ee)=>{if(!o?.canEditFilesystem)return L("Project retirement is not available in this host. Use the Scout CLI or desktop app."),!1;if(!r?.retireProject)return L("Project retirement is unavailable in this build."),!1;D(se);try{const Oe=await r.retireProject(se);return et(Oe),await d(!1),L(`Retired ${Ee}. It is hidden from discovery until restored.`),!0}catch(Oe){return L(Je(Oe)),!1}finally{D(null)}},[et,d,r,o]),Ae=z.useCallback(async se=>{if(!o?.canEditFilesystem)return L("Project restore is not available in this host. Use the Scout CLI or desktop app."),!1;if(!r?.restoreProject)return L("Project restore is unavailable in this build."),!1;D(se.root);try{const Ee=await r.restoreProject(se.root);return et(Ee),await d(!1),L(`Restored ${se.title}. Scout will discover it again.`),!0}catch(Ee){return L(Je(Ee)),!1}finally{D(null)}},[et,d,r,o]),ue=z.useCallback(()=>{(async()=>{try{if(!r?.restartOnboarding)return;const se=await r.restartOnboarding();Me(se),L("Onboarding restarted.")}catch(se){L(Je(se))}})()},[Me,r]),Te=z.useCallback(se=>{y(Ee=>{const Oe=Ee??f;if(!Oe)return Ee;const tt=Array.from(new Set([...Oe.workspaceRoots,se]));return{...Oe,onboardingContextRoot:Oe.onboardingContextRoot||se,workspaceRoots:tt}}),L("Project paths updated. Save General to persist the change."),X(!0)},[f]),q=z.useCallback(()=>{H||(y(f),L(null),X(!0))},[f,H]),de=z.useCallback((se,Ee)=>{y(Oe=>{const tt=Oe??f;if(!tt)return Oe;const Vt=[...tt.workspaceRoots];for(;Vt.length<=se;)Vt.push("");return Vt[se]=Ee,{...tt,onboardingContextRoot:se===0&&(!tt.onboardingContextRoot||tt.onboardingContextRoot===tt.workspaceRoots[0])?Ee:tt.onboardingContextRoot,workspaceRoots:Vt}}),L(null),X(!0)},[f]),ke=z.useCallback(()=>{y(se=>{const Ee=se??f;return Ee?{...Ee,workspaceRoots:[...Ee.workspaceRoots,""]}:se}),L("Project paths updated. Save General to persist the change."),X(!0)},[f]),Qe=z.useCallback(se=>{y(Ee=>{const Oe=Ee??f;if(!Oe)return Ee;const tt=Oe.workspaceRoots[se]??"",Vt=Oe.workspaceRoots.filter((va,er)=>er!==se),on=se===0&&(!Oe.onboardingContextRoot||Oe.onboardingContextRoot===tt)?Vt[0]??"":Oe.onboardingContextRoot;return{...Oe,onboardingContextRoot:on,workspaceRoots:Vt}}),L("Project paths updated. Save General to persist the change."),X(!0)},[f]),Be=z.useCallback(se=>{(async()=>{try{if(!o?.canPickDirectory||!r?.pickDirectory)return;const Ee=await r.pickDirectory();if(!Ee)return;de(se,Ee),L("Project paths updated. Save General to persist the change.")}catch(Ee){L(Je(Ee))}})()},[de,r,o]),$e=z.useCallback(se=>{y(Ee=>{const Oe=Ee??f;return Oe?{...Oe,onboardingContextRoot:se}:Ee}),L(null),X(!0)},[f]),wt=z.useCallback(()=>{(async()=>{try{if(!o?.canPickDirectory||!r?.pickDirectory)return;const se=await r.pickDirectory();if(!se)return;$e(se)}catch(se){L(Je(se))}})()},[$e,r,o]),Qt=z.useCallback(()=>{(async()=>{try{if(r?.skipOnboarding){const se=await r.skipOnboarding();Ke(se)}G("done"),L(null),X(!1)}catch(se){L(Je(se))}})()},[Ke,r]),qt=z.useCallback(()=>{(async()=>{if(Fe.id!=="confirm"){we(1);return}if(!le){we(1);return}await be()&&we(1)})()},[Fe.id,le,be,we]);z.useEffect(()=>{const se=Fe.id;if(se!=="setup"&&se!=="doctor"&&se!=="runtimes"||ne||oe[se]||!ve||g||se==="doctor"&&!Re)return;const Ee=setTimeout(()=>{ze(se)},600);return()=>clearTimeout(Ee)},[Fe.id,g,ze,oe,ne,Re,ve]);const Pt=z.useCallback(()=>{if(rt){we(1);return}Qt()},[rt,Qt,we]),ht=z.useCallback(async se=>{const Ee=ot(se);await navigator.clipboard.writeText(Ee),w(se),window.setTimeout(()=>{w(Oe=>Oe===se?null:Oe)},1500)},[ot]),Wt=z.useCallback(()=>{r?.refreshSettingsInventory&&(S(!0),r.refreshSettingsInventory().then(se=>{et(se)}).catch(se=>{L(Je(se))}).finally(()=>{S(!1)}))},[et,r]);return{SOURCE_ROOT_PATH_SUGGESTIONS:$z,appSettings:f,setAppSettings:p,appSettingsDraft:h,appSettingsLoading:g,workspaceInventoryLoading:k,appSettingsSaving:A,appSettingsFeedback:R,setAppSettingsFeedback:L,setAppSettingsDraft:y,isAppSettingsEditing:H,onboardingWizardStep:I,setOnboardingWizardStep:F,onboardingCommandPending:ne,onboardingCommandResult:P,onboardingCommandHistory:oe,onboardingCopiedCommand:J,startupOnboardingState:Y,setStartupOnboardingState:G,setIsAppSettingsEditing:X,setOnboardingCommandResult:Q,setOnboardingCopiedCommand:w,visibleAppSettings:ve,agentableProjects:T,hiddenProjects:B,appSettingsDirty:le,projectRetirementPendingRoot:V,workspaceInventoryLoaded:M,canRefreshWorkspaceInventory:pe,showDoctorOutput:ge,onboardingContextRoot:ce,onboardingHasProjectConfig:Re,onboardingRuntimeMatch:Se,onboardingWizardSteps:Ve,onboardingWizardIndex:_e,activeOnboardingStep:Fe,canGoToPreviousOnboardingStep:it,canGoToNextOnboardingStep:rt,startupOnboardingVisible:ut,startupOnboardingBlocking:st,buildOnboardingCommandLine:ot,replaceAppSettings:Ke,syncRefreshedAppSettings:Ye,applyNextAppSettings:et,applyRestartedOnboardingSettings:Me,refreshVisibleAppSettings:Ce,handleStartAppSettingsEdit:nt,handleCancelAppSettingsEdit:mt,updateAppSettingsDraft:ae,handleSaveAppSettings:be,moveOnboardingWizard:we,handleRunOnboardingCommand:ze,handleRetireProject:We,handleRestoreProject:Ae,handleRestartOnboarding:ue,handleAddSourceRootSuggestion:Te,handleBeginGeneralEdit:q,handleSetSourceRootAt:de,handleAddSourceRootRow:ke,handleRemoveSourceRootRow:Qe,handleBrowseForSourceRoot:Be,handleSetOnboardingContextRoot:$e,handleBrowseForOnboardingContextRoot:wt,dismissStartupOnboarding:Qt,handleOnboardingContinue:qt,skipCurrentOnboardingStep:Pt,handleCopyOnboardingCommand:ht,handleLoadWorkspaceInventory:Wt}}function Yz({sidebarWidth:e,messagesDetailWidth:l,isCollapsed:r,onResizeStart:i,onMessagesDetailResizeStart:o,styles:u,messagesState:d,messageThreads:f,selectedMessagesThread:p,onSelectMessageThread:h,showAnnotations:y,setShowAnnotations:g,onRefresh:v,loadingWorkspace:k,selectedMessagesInternalThread:S,selectedMessagesInternalMessages:A,selectedMessagesInternalTarget:N,selectedMessagesDetailAgentId:R,selectedMessagesDetailAgent:L,selectedMessagesSessions:H,selectedSession:X,setSelectedSession:V,formatDate:D,interAgentAgents:I,interAgentAgentLookup:F,relayDirectLookup:ne,openAgentProfile:O,openAgentDirectMessage:P,onNudgeMessage:Q,messagesDetailOpen:oe,setMessagesDetailOpen:W,messagesDetailTab:J,setMessagesDetailTab:w,selectedRelayKind:Y,selectedRelayId:G,relayThreadTitle:ve,relayThreadSubtitle:T,relayThreadCount:B,selectedRelayDirectThread:le,relayVoiceState:M,visibleRelayMessages:pe,relayTimelineViewportRef:ge,onRelayTimelineScroll:ce,relayReplyTarget:Re,setRelayReplyTarget:Se,relayContextReferences:Ne,relayContextMessageIds:Ve,setRelayContextMessageIds:_e,relayComposerRef:Fe,relayDraft:it,setRelayDraft:rt,relaySending:ut,relayFeedback:st,relayComposerSelectionStart:vt,setRelayComposerSelectionStart:Ke,mergedRelayMessages:Ye,relayMentionMenuOpen:et,relayMentionSuggestions:Me,relayMentionSelectionIndex:ot,setRelayMentionSelectionIndex:Ce,relayMentionDuplicateTitleCounts:nt,applyRelayMentionSuggestion:mt,onRelaySend:ae,onToggleVoiceCapture:be,onSetVoiceRepliesEnabled:we,visibleAgentSession:ze,agentSessionPending:We,agentSessionFeedback:Ae,agentSessionCopied:ue,onCopyAgentSessionCommand:Te,onOpenAgentSession:q,onAgentSessionTraceIntent:de,onPeekAgentSession:ke,onOpenAgentSettings:Qe,desktopVoiceEnabled:Be}){return a.jsxs(a.Fragment,{children:[r?null:a.jsx(Qz,{sidebarWidth:e,styles:u,messagesState:d,messageThreads:f,selectedMessagesThread:p,onResizeStart:i,onSelectMessageThread:h}),a.jsx("div",{className:"flex-1 flex flex-col relative min-w-0",style:u.surface,children:p?.kind==="internal"?a.jsx(Xz,{styles:u,selectedMessagesThread:p,selectedMessagesInternalThread:S,selectedMessagesInternalMessages:A,selectedMessagesInternalTarget:N,showAnnotations:y,setShowAnnotations:g,setMessagesDetailOpen:W,messagesDetailOpen:oe,onRefresh:v,interAgentAgentLookup:F,relayDirectLookup:ne,openAgentProfile:O,openAgentDirectMessage:P,onNudgeMessage:Q}):a.jsx(Kz,{styles:u,selectedRelayKind:Y,selectedRelayId:G,relayThreadTitle:ve,relayThreadSubtitle:T,relayThreadCount:B,selectedRelayDirectThread:le,relayVoiceState:M,visibleRelayMessages:pe,relayTimelineViewportRef:ge,onRelayTimelineScroll:ce,relayReplyTarget:Re,setRelayReplyTarget:Se,relayContextReferences:Ne,relayContextMessageIds:Ve,setRelayContextMessageIds:_e,relayComposerRef:Fe,relayDraft:it,setRelayDraft:rt,relaySending:ut,relayFeedback:st,relayComposerSelectionStart:vt,setRelayComposerSelectionStart:Ke,mergedRelayMessages:Ye,relayMentionMenuOpen:et,relayMentionSuggestions:Me,relayMentionSelectionIndex:ot,setRelayMentionSelectionIndex:Ce,relayMentionDuplicateTitleCounts:nt,applyRelayMentionSuggestion:mt,showAnnotations:y,setShowAnnotations:g,setMessagesDetailOpen:W,messagesDetailOpen:oe,onRefresh:v,loadingWorkspace:k,onRelaySend:ae,onToggleVoiceCapture:be,onSetVoiceRepliesEnabled:we,interAgentAgentLookup:F,relayDirectLookup:ne,openAgentProfile:O,openAgentDirectMessage:P,onNudgeMessage:Q,desktopVoiceEnabled:Be})}),oe&&p?a.jsx(Wz,{styles:u,messagesDetailWidth:l,selectedMessagesThread:p,selectedMessagesInternalThread:S,selectedMessagesDetailAgentId:R,selectedMessagesDetailAgent:L,selectedMessagesSessions:H,selectedSession:X,setSelectedSession:V,formatDate:D,interAgentAgents:I,messagesDetailTab:J,setMessagesDetailTab:w,setMessagesDetailOpen:W,onResizeStart:o,openAgentProfile:O,openAgentDirectMessage:P,visibleAgentSession:ze,agentSessionPending:We,agentSessionFeedback:Ae,agentSessionCopied:ue,onCopyAgentSessionCommand:Te,onOpenAgentSession:q,onAgentSessionTraceIntent:de,onPeekAgentSession:ke,onOpenAgentSettings:Qe}):null]})}function Qz({sidebarWidth:e,styles:l,messagesState:r,messageThreads:i,selectedMessagesThread:o,onResizeStart:u,onSelectMessageThread:d}){return a.jsxs("div",{style:{width:e,...l.sidebar},className:"relative flex flex-col h-full border-r shrink-0 z-10 overflow-hidden",children:[a.jsx("div",{className:"absolute right-[-3px] top-0 bottom-0 w-1.5 cursor-col-resize hover:bg-indigo-400 z-20 transition-colors",onMouseDown:u}),a.jsx("div",{className:"px-3 py-2.5 flex items-center justify-between",children:a.jsxs("div",{children:[a.jsx("h1",{className:"text-[13px] font-semibold tracking-tight",style:l.inkText,children:r?.title??"Messages"}),a.jsx("div",{className:"text-[10px] font-mono mt-0.5",style:l.mutedText,children:r?.subtitle??"Broker unavailable"})]})}),a.jsx("div",{className:"flex-1 overflow-y-auto py-2",children:[["inbox","Inbox"],["channels","Channels"],["agents","Agents"],["internal","Internal"]].map(([f,p])=>{const h=i.filter(y=>y.group===f);return h.length===0?null:a.jsxs("div",{className:"mb-3 px-1.5",children:[a.jsx("div",{className:"font-mono text-[9px] tracking-widest uppercase mb-1 px-1.5",style:l.mutedText,children:p}),a.jsx("div",{className:"flex flex-col gap-px",children:h.map(y=>{const g=o?.id===y.id,v=y.kind==="relay"&&y.relayDestinationKind==="direct";return a.jsxs("button",{className:`os-rail-row flex items-center gap-2 px-1.5 py-1 rounded cursor-pointer w-full text-left${g?" os-rail-row-active":""}`,style:g?l.activeItem:l.mutedText,onClick:()=>d(y),children:[y.kind==="internal"?a.jsx("div",{className:"w-4 h-4 shrink-0 flex items-center justify-center",children:a.jsx(rs,{size:12,style:g?{color:b.accent}:l.mutedText})}):v?a.jsxs("div",{className:"relative shrink-0",children:[a.jsx("div",{className:`os-rail-avatar w-4 h-4 rounded text-white flex items-center justify-center font-bold text-[8px] ${y.reachable?"":"opacity-40 grayscale"}`,style:{backgroundColor:hl(y.relayDestinationId??y.id)},children:y.title.charAt(0).toUpperCase()}),y.state?a.jsx("div",{className:`absolute -bottom-0.5 -right-0.5 w-1.5 h-1.5 rounded-full ${Lo(y.state)}`,style:{border:`1px solid ${b.bg}`}}):null]}):a.jsx(Tj,{id:y.relayDestinationId??y.id,active:g}),a.jsxs("div",{className:`flex-1 min-w-0 ${y.reachable?"":"opacity-50"}`,children:[a.jsxs("div",{className:"flex items-center gap-1.5",children:[a.jsx("div",{className:"font-medium text-[12px] truncate",children:Vp(y.title)}),y.state==="working"?a.jsx(Zu,{className:"text-[var(--os-accent)]"}):null]}),a.jsx("div",{className:"text-[10px] truncate",style:l.mutedText,children:y.preview??y.subtitle??""})]}),typeof y.count=="number"&&y.count>0?a.jsx("span",{className:"os-row-count text-[9px] font-mono px-1 rounded",style:g?l.activePill:l.tagBadge,children:y.count}):null]},y.id)})})]},f)})})]})}function Xz({styles:e,selectedMessagesThread:l,selectedMessagesInternalThread:r,selectedMessagesInternalMessages:i,selectedMessagesInternalTarget:o,showAnnotations:u,setShowAnnotations:d,setMessagesDetailOpen:f,messagesDetailOpen:p,onRefresh:h,interAgentAgentLookup:y,relayDirectLookup:g,openAgentProfile:v,openAgentDirectMessage:k,onNudgeMessage:S}){return a.jsxs(a.Fragment,{children:[a.jsxs("div",{className:"border-b flex items-center justify-between px-4 py-2 shrink-0 gap-4",style:{...e.surface,borderBottomColor:b.border},children:[a.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[a.jsx(rs,{size:14,style:e.mutedText}),a.jsxs("div",{className:"min-w-0",children:[a.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[a.jsx("h2",{className:"text-[13px] font-semibold tracking-tight truncate",style:e.inkText,children:r?.title??l.title??"Internal"}),r?a.jsx("span",{className:"text-[9px] font-mono px-1.5 py-0.5 rounded shrink-0",style:e.tagBadge,children:r.messageCount}):null]}),a.jsx("div",{className:"text-[10px] truncate mt-0.5",style:e.mutedText,children:r?.subtitle??l.subtitle??"Agent-to-agent coordination"})]})]}),a.jsxs("div",{className:"flex items-center gap-2",children:[o?a.jsxs("button",{className:"os-toolbar-button flex items-center gap-1.5 text-[10px] font-medium px-2 py-0.5 rounded",style:{color:b.ink},onClick:()=>k(o.id),children:[a.jsx(Bl,{size:11}),a.jsx("span",{children:"Message Agent"})]}):null,a.jsxs("button",{onClick:()=>d(!u),className:"os-toolbar-button flex items-center gap-1 text-[10px] font-medium px-2 py-0.5 rounded",style:u?{backgroundColor:b.accentBg,color:b.accent}:{color:b.ink},children:["Annotations ",a.jsx("span",{className:"font-mono uppercase",children:u?"On":"Off"})]}),a.jsx("button",{className:"os-toolbar-button flex items-center gap-1 text-[10px] font-medium px-2 py-0.5 rounded",style:{color:b.ink},onClick:()=>{h()},children:"Sync"}),a.jsx("button",{className:"os-toolbar-button flex items-center gap-1 text-[10px] font-medium px-2 py-0.5 rounded",style:p?{backgroundColor:b.accentBg,color:b.accent}:{color:b.ink},onClick:()=>f(A=>!A),children:"Details"})]})]}),a.jsx("div",{className:"flex-1 overflow-y-auto px-4 py-3 pb-6",children:i.length===0?a.jsxs("div",{className:"flex flex-col items-center justify-center h-64 text-center",children:[a.jsx("div",{className:"w-16 h-16 rounded-full flex items-center justify-center mb-4",style:{backgroundColor:b.accentBg},children:a.jsx(rs,{size:24,style:{color:b.accent}})}),a.jsx("h3",{className:"text-[15px] font-medium mb-1",style:e.inkText,children:"No internal traffic yet"}),a.jsx("p",{className:"text-[13px] max-w-sm",style:e.mutedText,children:"This thread exists, but no visible agent-to-agent messages have been captured yet."})]}):a.jsx("div",{className:"flex flex-col gap-1",children:a.jsx(No,{messages:i,showAnnotations:u,showStatusMessages:!1,inkStyle:e.inkText,mutedStyle:e.mutedText,tagStyle:e.tagBadge,annotStyle:e.annotBadge,agentLookup:y,directThreadLookup:g,onOpenAgentProfile:v,onOpenAgentChat:k,onNudgeMessage:S})})}),a.jsx("div",{className:"px-4 py-3 shrink-0",style:e.surface,children:a.jsxs("div",{className:"rounded-lg border px-3 py-3",style:{borderColor:b.border,backgroundColor:b.bg},children:[a.jsx("div",{className:"text-[9px] font-mono uppercase tracking-widest",style:e.mutedText,children:"Internal Thread"}),a.jsx("div",{className:"text-[11px] mt-1 leading-[1.6]",style:e.mutedText,children:"Internal coordination is read-only here. Open a direct conversation with an agent if you want to intervene."}),o?a.jsxs("button",{type:"button",onClick:()=>k(o.id),className:"mt-3 os-toolbar-button flex items-center gap-1.5 text-[10px] font-medium px-2 py-1 rounded",style:{color:b.ink},children:[a.jsx(Ep,{size:11}),"Open Direct Message"]}):null]})}),a.jsx("div",{className:"h-7 border-t flex items-center px-4 shrink-0",style:{backgroundColor:b.bg,borderTopColor:b.border},children:a.jsx("span",{className:"text-[9px] font-mono",style:e.mutedText,children:"Read-only internal coordination thread inside Messages"})})]})}function Kz({styles:e,selectedRelayKind:l,selectedRelayId:r,relayThreadTitle:i,relayThreadSubtitle:o,relayThreadCount:u,selectedRelayDirectThread:d,relayVoiceState:f,visibleRelayMessages:p,relayTimelineViewportRef:h,onRelayTimelineScroll:y,relayReplyTarget:g,setRelayReplyTarget:v,relayContextReferences:k,relayContextMessageIds:S,setRelayContextMessageIds:A,relayComposerRef:N,relayDraft:R,setRelayDraft:L,relaySending:H,relayFeedback:X,relayComposerSelectionStart:V,setRelayComposerSelectionStart:D,mergedRelayMessages:I,relayMentionMenuOpen:F,relayMentionSuggestions:ne,relayMentionSelectionIndex:O,setRelayMentionSelectionIndex:P,relayMentionDuplicateTitleCounts:Q,applyRelayMentionSuggestion:oe,showAnnotations:W,setShowAnnotations:J,setMessagesDetailOpen:w,messagesDetailOpen:Y,onRefresh:G,loadingWorkspace:ve,onRelaySend:T,onToggleVoiceCapture:B,onSetVoiceRepliesEnabled:le,interAgentAgentLookup:M,relayDirectLookup:pe,openAgentProfile:ge,openAgentDirectMessage:ce,onNudgeMessage:Re,desktopVoiceEnabled:Se}){const Ne=p.at(-1)?.createdAt??null,[Ve,_e]=z.useState(()=>Date.now());z.useEffect(()=>{if(d?.state!=="working")return;_e(Date.now());const Ye=window.setInterval(()=>{_e(Date.now())},15e3);return()=>window.clearInterval(Ye)},[Ne,d?.activeTask,d?.id,d?.state,d?.statusDetail]);const Fe=d?.state==="working"&&Ne?Math.max(0,Ve-Ne):0,it=Fe>0?Jz(Fe):null,rt=Fe>=9e4,ut=d?.activeTask??d?.statusDetail??o??"Agent is still working.",st=!ve&&p.length===0&&l==="direct",vt=ve?"Loading relay workspace":st?"Waiting for first relay message":"No relay traffic yet",Ke=ve?"Fetching threads, messages, and agent state for this workspace.":st?d?.activeTask??d?.statusDetail??"This direct lane is open. Send a message or wait for the agent to speak first.":"Send a message into this lane to wake an agent or start a broker-backed conversation.";return a.jsxs(a.Fragment,{children:[a.jsxs("div",{className:"border-b flex items-center justify-between px-4 py-2 shrink-0 gap-4",style:{...e.surface,borderBottomColor:b.border},children:[a.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[a.jsx("div",{className:"shrink-0",children:l==="direct"?a.jsx(Ep,{size:14,style:e.mutedText}):a.jsx(Tj,{id:r,active:!1,size:14})}),a.jsxs("div",{className:"min-w-0",children:[a.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[a.jsx("h2",{className:"text-[13px] font-semibold tracking-tight truncate",style:e.inkText,children:i}),u?a.jsx("span",{className:"text-[9px] font-mono px-1.5 py-0.5 rounded shrink-0",style:e.tagBadge,children:u}):null,d?a.jsx(vz,{thread:d}):null]}),o?a.jsx("div",{className:"text-[10px] truncate mt-0.5",style:e.mutedText,children:o}):null]})]}),a.jsxs("div",{className:"flex items-center gap-2",children:[d?a.jsxs("button",{className:"os-toolbar-button flex items-center gap-1.5 text-[10px] font-medium px-2 py-0.5 rounded",style:{color:b.ink},onClick:()=>ge(d.id),children:[a.jsx(ts,{size:11}),a.jsx("span",{children:"Agent"})]}):null,a.jsxs("button",{onClick:()=>J(!W),className:"os-toolbar-button flex items-center gap-1 text-[10px] font-medium px-2 py-0.5 rounded",style:W?{backgroundColor:b.accentBg,color:b.accent}:{color:b.ink},children:["Annotations ",a.jsx("span",{className:"font-mono uppercase",children:W?"On":"Off"})]}),Se?a.jsxs(a.Fragment,{children:[a.jsxs("button",{className:"os-toolbar-button flex items-center gap-1.5 text-[10px] font-medium px-2 py-0.5 rounded",style:f?.isCapturing?{backgroundColor:b.accentBg,color:b.accent}:{color:b.ink},onClick:()=>{B()},title:f?.detail??void 0,children:[f?.captureTitle??"Capture"," ",a.jsx("span",{className:"font-mono uppercase",style:{color:b.accent},children:f?.captureState??"Off"})]}),a.jsxs("button",{className:"os-toolbar-button flex items-center gap-1.5 text-[10px] font-medium px-2 py-0.5 rounded",style:f?.repliesEnabled?{backgroundColor:b.accentBg,color:b.accent}:{color:b.ink},onClick:()=>{le(!(f?.repliesEnabled??!1))},title:f?.detail??void 0,children:["Playback ",a.jsx("span",{className:"font-mono uppercase",style:{color:b.accent},children:f?.speaking?"Speaking":f?.repliesEnabled?"On":"Off"})]})]}):null,a.jsx("button",{className:"os-toolbar-button flex items-center gap-1 text-[10px] font-medium px-2 py-0.5 rounded",style:{color:b.ink},onClick:()=>{G()},children:"Sync"}),a.jsx("button",{className:"os-toolbar-button flex items-center gap-1 text-[10px] font-medium px-2 py-0.5 rounded",style:Y?{backgroundColor:b.accentBg,color:b.accent}:{color:b.ink},onClick:()=>w(Ye=>!Ye),children:"Details"})]})]}),a.jsx("div",{ref:h,className:"flex-1 overflow-y-auto px-4 py-3 pb-6",onScroll:y,children:p.length===0?a.jsxs("div",{className:"flex flex-col items-center justify-center h-64 text-center",children:[a.jsx("div",{className:"w-16 h-16 rounded-full flex items-center justify-center mb-4",style:{backgroundColor:b.accentBg},children:ve||st?a.jsx(xn,{className:"text-[22px]",style:{color:b.accent}}):a.jsx(Bl,{size:24,style:{color:b.accent}})}),a.jsx("h3",{className:"text-[15px] font-medium mb-1",style:e.inkText,children:vt}),a.jsx("p",{className:"text-[13px] max-w-sm",style:e.mutedText,children:Ke})]}):a.jsx("div",{className:"flex flex-col gap-1",children:a.jsx(No,{messages:p,showAnnotations:W,showStatusMessages:l==="channel"&&r==="system",inkStyle:e.inkText,mutedStyle:e.mutedText,tagStyle:e.tagBadge,annotStyle:e.annotBadge,agentLookup:M,directThreadLookup:pe,onOpenAgentProfile:ge,onOpenAgentChat:ce,onNudgeMessage:Re})})}),d?.state==="working"?a.jsx("div",{className:"px-4 pb-1 shrink-0",style:e.surface,children:a.jsx("div",{className:"rounded-xl border px-3 py-2.5 flex items-start justify-between gap-3",style:{borderColor:rt?"rgba(245,158,11,0.32)":b.border,backgroundColor:rt?"rgba(245,158,11,0.08)":b.bg},children:a.jsxs("div",{className:"min-w-0",children:[a.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[a.jsx(Zu,{className:"text-[var(--os-accent)] shrink-0"}),a.jsx("span",{className:"text-[11px] font-medium truncate",style:e.inkText,children:rt?"Still working":"Working"}),it?a.jsx("span",{className:"text-[9px] font-mono px-1.5 py-0.5 rounded shrink-0",style:rt?{color:"#b45309",backgroundColor:"rgba(245,158,11,0.14)"}:e.tagBadge,children:rt?`No update for ${it}`:`${it} ago`}):null]}),a.jsx("div",{className:"text-[10px] mt-1 truncate",style:e.mutedText,children:ut})]})})}):null,a.jsx(Zz,{styles:e,selectedRelayKind:l,selectedRelayId:r,relayVoiceState:f,relayReplyTarget:g,setRelayReplyTarget:v,relayContextReferences:k,relayContextMessageIds:S,setRelayContextMessageIds:A,relayComposerRef:N,relayDraft:R,setRelayDraft:L,relaySending:H,relayComposerSelectionStart:V,setRelayComposerSelectionStart:D,mergedRelayMessages:I,relayMentionMenuOpen:F,relayMentionSuggestions:ne,relayMentionSelectionIndex:O,setRelayMentionSelectionIndex:P,relayMentionDuplicateTitleCounts:Q,applyRelayMentionSuggestion:oe,onRelaySend:T,desktopVoiceEnabled:Se}),a.jsxs("div",{className:"h-7 border-t flex items-center justify-between px-4 shrink-0",style:{backgroundColor:b.bg,borderTopColor:b.border},children:[a.jsxs("div",{className:"flex items-center gap-3 text-[9px] font-mono",style:e.mutedText,children:[a.jsxs("span",{className:"flex items-center gap-1",children:[a.jsx("span",{style:e.inkText,children:"@"})," mention agents"]}),F?a.jsxs(a.Fragment,{children:[a.jsx("span",{className:"w-px h-3",style:{backgroundColor:b.border}}),a.jsx("span",{children:"↑↓ select · ↵ or Tab insert"})]}):null,a.jsx("span",{className:"w-px h-3",style:{backgroundColor:b.border}}),a.jsxs("span",{className:"flex items-center gap-1",children:[a.jsx("kbd",{className:"font-sans px-1 py-0.5 rounded border text-[9px] font-medium leading-none shadow-sm",style:e.kbd,children:"Cmd+Enter"})," send"]}),X?a.jsxs(a.Fragment,{children:[a.jsx("span",{className:"w-px h-3",style:{backgroundColor:b.border}}),a.jsx("span",{children:X})]}):null]}),a.jsx("div",{className:"flex items-center gap-2 text-[9px] font-mono uppercase tracking-widest",style:e.mutedText,children:d?.state==="offline"?a.jsx("span",{children:d.statusLabel}):null})]})]})}function Zz({styles:e,selectedRelayKind:l,selectedRelayId:r,relayVoiceState:i,relayReplyTarget:o,setRelayReplyTarget:u,relayContextReferences:d,relayContextMessageIds:f,setRelayContextMessageIds:p,relayComposerRef:h,relayDraft:y,setRelayDraft:g,relaySending:v,relayComposerSelectionStart:k,setRelayComposerSelectionStart:S,mergedRelayMessages:A,relayMentionMenuOpen:N,relayMentionSuggestions:R,relayMentionSelectionIndex:L,setRelayMentionSelectionIndex:H,relayMentionDuplicateTitleCounts:X,applyRelayMentionSuggestion:V,onRelaySend:D,desktopVoiceEnabled:I}){return a.jsxs("div",{className:"px-4 py-3 shrink-0",style:e.surface,children:[o?a.jsxs("div",{className:"mb-2 flex items-center justify-between gap-3 rounded-lg border px-3 py-2",style:{borderColor:b.border,backgroundColor:b.bg},children:[a.jsxs("div",{className:"min-w-0",children:[a.jsxs("div",{className:"text-[9px] font-mono uppercase tracking-widest",style:e.mutedText,children:["Replying to ",o.authorName," · ",Eo(o.messageId)]}),a.jsx("div",{className:"text-[11px] truncate mt-1",style:e.mutedText,children:o.preview})]}),a.jsx("button",{type:"button",onClick:()=>u(null),className:"shrink-0 rounded p-1 transition-opacity hover:opacity-70",style:e.mutedText,title:"Clear reply context",children:a.jsx(Sl,{size:12})})]}):null,d.length>0?a.jsx("div",{className:"mb-2 space-y-2",children:d.map(F=>a.jsxs("div",{className:"flex items-center justify-between gap-3 rounded-lg border px-3 py-2",style:{borderColor:b.border,backgroundColor:b.bg},children:[a.jsxs("div",{className:"min-w-0",children:[a.jsxs("div",{className:"text-[9px] font-mono uppercase tracking-widest",style:e.mutedText,children:["Context · ",F.authorName," · ",Eo(F.messageId)]}),a.jsx("div",{className:"text-[11px] truncate mt-1",style:e.mutedText,children:F.preview})]}),a.jsx("button",{type:"button",onClick:()=>p(ne=>ne.filter(O=>O!==F.messageId)),className:"shrink-0 rounded p-1 transition-opacity hover:opacity-70",style:e.mutedText,title:"Clear referenced context",children:a.jsx(Sl,{size:12})})]},F.messageId))}):null,a.jsxs("div",{className:"relative",children:[N?a.jsxs("div",{className:"absolute inset-x-0 bottom-full mb-2 rounded-xl border shadow-lg overflow-hidden z-20",style:{backgroundColor:b.surface,borderColor:b.border,boxShadow:b.shadowLg},children:[a.jsx("div",{className:"px-3 py-2 border-b text-[9px] font-mono uppercase tracking-widest",style:{...e.mutedText,borderColor:b.border},children:"Mention an agent"}),a.jsx("div",{className:"max-h-64 overflow-y-auto",children:R.map((F,ne)=>{const O=ne===L,P=t6(F),Q=n6(F),oe=(X.get(F.title)??0)>1,W=oe||!!F.harness||!!Q,J=!!(Q&&Q!==P);return a.jsxs("button",{type:"button",className:"w-full flex items-start justify-between gap-3 px-3 py-2.5 text-left transition-colors",style:{backgroundColor:O?b.bg:"transparent",color:b.ink},onMouseDown:w=>{w.preventDefault(),V(F)},children:[a.jsxs("div",{className:"min-w-0",children:[a.jsxs("div",{className:"flex items-center gap-2 min-w-0 flex-wrap",children:[a.jsx("span",{className:"text-[11px] font-medium truncate",children:F.title}),a.jsx("span",{className:"text-[9px] font-mono px-1.5 py-0.5 rounded",style:e.tagBadge,children:F.statusLabel}),W&&P?a.jsx("span",{className:"text-[9px] font-mono px-1.5 py-0.5 rounded",style:e.tagBadge,children:P}):null,F.harness?a.jsx("span",{className:"text-[9px] font-mono px-1.5 py-0.5 rounded",style:e.tagBadge,children:F.harness}):null,J&&Q?a.jsx("span",{className:"text-[9px] font-mono px-1.5 py-0.5 rounded",style:e.tagBadge,children:Q}):null]}),a.jsxs("div",{className:"text-[10px] mt-1 truncate",style:e.mutedText,children:[F.mentionToken,oe&&F.subtitle?` · ${ii(F.subtitle)??F.subtitle}`:""]})]}),a.jsx("span",{className:"text-[9px] font-mono shrink-0",style:e.mutedText,children:O?"↵":""})]},F.agentId)})})]}):null,a.jsxs("div",{className:"border rounded flex items-center px-2 py-1 transition-all focus-within:ring-1",style:{backgroundColor:b.bg,borderColor:b.border},children:[a.jsx("textarea",{ref:h,className:"flex-1 bg-transparent outline-none resize-none h-[20px] min-h-[20px] max-h-[80px] text-[12px] leading-tight py-0.5",style:{color:b.ink},placeholder:e6(l,r),rows:1,value:y,onChange:F=>{const ne=o6(F.currentTarget.value,A,f);g(ne.body),S(F.currentTarget.selectionStart??ne.body.length),ne.nextReferenceMessageIds!==f&&p(ne.nextReferenceMessageIds)},onClick:F=>S(F.currentTarget.selectionStart??y.length),onKeyUp:F=>S(F.currentTarget.selectionStart??y.length),onSelect:F=>S(F.currentTarget.selectionStart??y.length),onKeyDown:F=>{if(N){if(F.key==="ArrowDown"){F.preventDefault(),H(ne=>R.length===0?0:(ne+1)%R.length);return}if(F.key==="ArrowUp"){F.preventDefault(),H(ne=>R.length===0?0:(ne-1+R.length)%R.length);return}if(F.key==="Enter"&&!F.metaKey&&!F.ctrlKey&&!F.shiftKey||F.key==="Tab"){F.preventDefault();const ne=R[L]??R[0];ne&&V(ne);return}if(F.key==="Escape"){F.preventDefault(),S(y.length);return}}(F.metaKey||F.ctrlKey)&&F.key==="Enter"&&(F.preventDefault(),D())}}),a.jsxs("div",{className:"shrink-0 flex items-center gap-1 ml-2",children:[I?a.jsx("button",{className:"p-1 opacity-50 cursor-default transition-opacity",style:e.mutedText,title:i?.detail??"Voice unavailable on this desktop host",children:a.jsx(Aw,{size:12})}):null,a.jsx("button",{type:"button",className:"shrink-0 flex h-[26px] w-[26px] items-center justify-center rounded-md border transition-opacity hover:opacity-85 disabled:opacity-30 disabled:cursor-not-allowed",style:{borderColor:b.border,backgroundColor:b.surface,color:b.ink},onClick:()=>{D()},disabled:v||!y.trim(),title:"Send","aria-label":"Send message",children:a.jsx(B1,{size:14})})]})]})]})]})}function Wz({styles:e,messagesDetailWidth:l,selectedMessagesThread:r,selectedMessagesInternalThread:i,selectedMessagesDetailAgentId:o,selectedMessagesDetailAgent:u,selectedMessagesSessions:d,selectedSession:f,setSelectedSession:p,formatDate:h,interAgentAgents:y,messagesDetailTab:g,setMessagesDetailTab:v,setMessagesDetailOpen:k,onResizeStart:S,openAgentProfile:A,openAgentDirectMessage:N,visibleAgentSession:R,agentSessionPending:L,agentSessionFeedback:H,agentSessionCopied:X,onCopyAgentSessionCommand:V,onOpenAgentSession:D,onAgentSessionTraceIntent:I,onPeekAgentSession:F,onOpenAgentSettings:ne}){return a.jsxs("div",{className:"relative border-l shrink-0 overflow-y-auto flex flex-col",style:{width:l,...e.surface,borderLeftColor:b.border},children:[a.jsx("div",{className:"absolute left-[-3px] top-0 bottom-0 w-1.5 cursor-col-resize hover:bg-indigo-400 z-20 transition-colors",onMouseDown:S}),a.jsxs("div",{className:"px-4 py-3 border-b",style:{borderBottomColor:b.border},children:[a.jsxs("div",{className:"flex items-start justify-between gap-3",children:[a.jsxs("div",{className:"min-w-0",children:[a.jsx("div",{className:"text-[10px] font-mono tracking-widest uppercase",style:e.mutedText,children:"Thread Details"}),a.jsx("div",{className:"text-[13px] font-semibold mt-1 truncate",style:e.inkText,children:r.kind==="internal"?i?.title??r.title:Vp(r.title)}),a.jsx("div",{className:"text-[10px] mt-1 line-clamp-2",style:e.mutedText,children:r.preview??r.subtitle??"Context for the selected thread."})]}),a.jsxs("button",{type:"button",onClick:()=>k(!1),className:"os-toolbar-button flex items-center gap-1.5 text-[10px] font-medium px-2 py-1 rounded shrink-0",style:{color:b.ink},title:"Hide details",children:[a.jsx(Sl,{size:11}),a.jsx("span",{children:"Hide"})]})]}),a.jsx("div",{className:"flex items-center gap-1 mt-3",children:[["overview","Overview"],["live","Live"],["history","History"]].filter(([O])=>O!=="live"||!!o).map(([O,P])=>a.jsx("button",{type:"button",className:"rounded-md px-2.5 py-1.5 text-[11px] font-medium transition-colors",style:g===O?e.activeItem:e.mutedText,onClick:()=>v(O),children:P},O))})]}),a.jsxs("div",{className:"p-4 flex-1 space-y-4",children:[g==="overview"?a.jsxs(a.Fragment,{children:[u?a.jsxs("section",{className:"rounded-xl border p-3",style:{borderColor:b.border,backgroundColor:b.bg},children:[a.jsxs("div",{className:"flex items-center gap-3",children:[a.jsx("div",{className:"w-10 h-10 rounded-lg text-white flex items-center justify-center text-[13px] font-bold",style:{backgroundColor:hl(u.id)},children:u.title.charAt(0).toUpperCase()}),a.jsxs("div",{className:"min-w-0",children:[a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx("div",{className:"text-[13px] font-semibold truncate",style:e.inkText,children:u.title}),a.jsx("span",{className:"text-[9px] font-mono px-1.5 py-0.5 rounded",style:u.state==="working"?e.activePill:e.tagBadge,children:u.statusLabel})]}),a.jsx("div",{className:"text-[10px] mt-1 line-clamp-2",style:e.mutedText,children:u.summary??u.statusDetail??"No summary yet."})]})]}),a.jsxs("div",{className:"grid grid-cols-2 gap-2 mt-3 text-[10px]",children:[a.jsxs("div",{children:[a.jsx("div",{style:e.mutedText,children:"Harness"}),a.jsx("div",{style:e.inkText,children:u.harness??"Unknown"})]}),a.jsxs("div",{children:[a.jsx("div",{style:e.mutedText,children:"Threads"}),a.jsx("div",{style:e.inkText,children:u.threadCount})]}),a.jsxs("div",{children:[a.jsx("div",{style:e.mutedText,children:"Workspace"}),a.jsx("div",{className:"truncate",style:e.inkText,children:u.projectRoot??u.cwd??"Unbound"})]}),a.jsxs("div",{children:[a.jsx("div",{style:e.mutedText,children:"Last Chat"}),a.jsx("div",{style:e.inkText,children:u.lastChatLabel??"No recent chat"})]})]}),a.jsxs("div",{className:"flex items-center gap-2 mt-3",children:[a.jsxs("button",{type:"button",onClick:()=>N(u.id),className:"os-toolbar-button flex items-center gap-1.5 text-[10px] font-medium px-2 py-1 rounded",style:{color:b.ink},children:[a.jsx(Bl,{size:11}),"Message"]}),a.jsxs("button",{type:"button",onClick:()=>{v("live"),F()},className:"os-toolbar-button flex items-center gap-1.5 text-[10px] font-medium px-2 py-1 rounded",style:{color:b.ink},children:[a.jsx(Jm,{size:11}),"Peek"]}),a.jsxs("button",{type:"button",onClick:()=>ne(u.id,u.profileKind==="project"),className:"os-toolbar-button flex items-center gap-1.5 text-[10px] font-medium px-2 py-1 rounded",style:{color:b.ink},children:[a.jsx(ni,{size:11}),"Settings"]})]})]}):null,r.kind==="internal"&&i?a.jsxs("section",{className:"rounded-xl border p-3",style:{borderColor:b.border,backgroundColor:b.bg},children:[a.jsx("div",{className:"text-[10px] font-mono tracking-widest uppercase",style:e.mutedText,children:"Participants"}),a.jsx("div",{className:"flex flex-col gap-2 mt-3",children:i.participants.map(O=>a.jsxs("div",{className:"flex items-center justify-between gap-2",children:[a.jsxs("div",{className:"min-w-0",children:[a.jsx("div",{className:"text-[12px] font-medium truncate",style:e.inkText,children:O.title}),a.jsx("div",{className:"text-[10px] truncate",style:e.mutedText,children:O.role??O.id})]}),y.some(P=>P.id===O.id)?a.jsx("button",{type:"button",onClick:()=>A(O.id),className:"text-[10px] font-medium hover:opacity-80",style:{color:b.accent},children:"Open"}):null]},O.id))})]}):null]}):null,g==="live"?a.jsxs("section",{className:"rounded-xl border overflow-hidden",style:{borderColor:b.border,backgroundColor:b.bg},children:[a.jsxs("div",{className:"px-3 py-3 border-b flex items-center justify-between gap-2",style:{borderBottomColor:b.border},children:[a.jsxs("div",{children:[a.jsx("div",{className:"text-[10px] font-mono tracking-widest uppercase",style:e.mutedText,children:"Live Session"}),a.jsx("div",{className:"text-[11px] mt-1",style:e.mutedText,children:R?.mode==="trace"?"Turn and block trace for the selected agent.":"Debug session output for the selected agent."})]}),a.jsxs("div",{className:"flex items-center gap-2",children:[R?.commandLabel?a.jsxs("button",{type:"button",onClick:()=>{V()},className:"os-toolbar-button flex items-center gap-1 text-[10px] font-medium px-2 py-1 rounded",style:{color:b.ink},children:[a.jsx(Or,{size:11}),X?"Copied":"Copy"]}):null,o?a.jsxs("button",{type:"button",onClick:()=>{D()},className:"os-toolbar-button flex items-center gap-1 text-[10px] font-medium px-2 py-1 rounded",style:{color:b.ink},children:[a.jsx(lw,{size:11}),R?.mode==="trace"?"Open Trace":"Open"]}):null]})]}),a.jsx("div",{className:"p-3",children:L?a.jsxs("div",{className:"flex items-center gap-2 text-[11px]",style:e.mutedText,children:[a.jsx(xn,{className:"text-[12px]"}),"Loading live session…"]}):R?.mode==="trace"&&R.trace?a.jsx("div",{className:"max-h-[280px] overflow-y-auto",children:a.jsx($p,{snapshot:R.trace,onIntent:I})}):R?.body?a.jsx("pre",{className:"max-h-[280px] overflow-y-auto text-[11px] leading-[1.55] whitespace-pre-wrap break-words font-mono",style:{color:b.termFg,backgroundColor:b.termBg,padding:"12px",borderRadius:b.radiusMd},children:R.body}):a.jsx("div",{className:"text-[11px] leading-[1.6]",style:e.mutedText,children:H??"No live session state is available for this thread yet."})})]}):null,g==="history"?a.jsxs("section",{className:"rounded-xl border p-3",style:{borderColor:b.border,backgroundColor:b.bg},children:[a.jsxs("div",{className:"flex items-center justify-between gap-2",children:[a.jsxs("div",{children:[a.jsx("div",{className:"text-[10px] font-mono tracking-widest uppercase",style:e.mutedText,children:"Recent History"}),a.jsx("div",{className:"text-[11px] mt-1",style:e.mutedText,children:"Recent sessions tied to this thread or agent."})]}),f?a.jsx("span",{className:"text-[9px] font-mono px-1.5 py-0.5 rounded",style:e.tagBadge,children:"selected"}):null]}),a.jsx("div",{className:"mt-3 flex flex-col gap-2",children:d.length>0?d.slice(0,8).map(O=>a.jsx("button",{type:"button",onClick:()=>p(O),className:"w-full rounded-lg border px-3 py-3 text-left transition-opacity hover:opacity-90",style:{borderColor:b.border,backgroundColor:f?.id===O.id?b.surface:b.bg},children:a.jsxs("div",{className:"flex items-start justify-between gap-3",children:[a.jsxs("div",{className:"min-w-0",children:[a.jsx("div",{className:"text-[12px] font-medium truncate",style:e.inkText,children:O.title}),a.jsxs("div",{className:"text-[10px] mt-1",style:e.mutedText,children:[O.project," · ",O.messageCount," messages"]}),a.jsx("div",{className:"text-[10px] mt-2 line-clamp-2",style:e.mutedText,children:O.preview})]}),a.jsx("span",{className:"text-[10px] font-mono shrink-0",style:e.mutedText,children:h(O.lastModified)})]})},O.id)):a.jsx("div",{className:"text-[11px] leading-[1.6]",style:e.mutedText,children:"No recent session history is linked to this thread yet."})})]}):null,f?a.jsxs("section",{className:"rounded-xl border p-3",style:{borderColor:b.border,backgroundColor:b.bg},children:[a.jsx("div",{className:"text-[10px] font-mono tracking-widest uppercase",style:e.mutedText,children:"Selected Session"}),a.jsx("div",{className:"text-[12px] font-medium mt-2",style:e.inkText,children:f.title}),a.jsxs("div",{className:"text-[10px] mt-1",style:e.mutedText,children:[f.project," · ",f.agent]}),a.jsx("div",{className:"text-[11px] mt-2 leading-[1.6]",style:e.mutedText,children:f.preview})]}):null]})]})}function Jz(e){const l=Math.floor(e/6e4);return l>=1?`${l}m`:`${Math.max(1,Math.floor(e/1e3))}s`}function e6(e,l){return e==="direct"?"Message direct thread...":e==="filter"&&l==="coordination"?"Message #shared-channel or @agent...":e==="channel"&&l==="voice"?"Message #voice...":e==="channel"&&l==="system"?"Message #system...":"Message #shared-channel..."}function t6(e){return l6(e.subtitle)??e.workspaceQualifier??null}function n6(e){const l=e.branch?.trim();return l&&l!=="HEAD"?l:e.workspaceQualifier?.trim()||null}function l6(e){if(!e)return null;const l=e.replace(/[\\/]+$/,"");return l?l.split(/[\\/]/).filter(Boolean).at(-1)??null:null}function Aj(){return/\b(?:message:[a-zA-Z0-9._:-]+|m:[a-z0-9]{4,12})\b/gi}function r6(e){return e.replace(/[^a-zA-Z0-9]/g,"").toLowerCase()}function a6(e,l){const r=e.trim().toLowerCase();if(!r)return null;if(r.startsWith("message:")){const u=e.slice(e.indexOf(":")+1).trim();return l.find(d=>d.id===u)??null}if(!r.startsWith("m:"))return null;const i=r.slice(2);if(!i)return null;const o=l.filter(u=>r6(u.id).endsWith(i));return o.length===1?o[0]:null}function i6(e,l){if(l.length===0)return e;const r=new Set(l.map(o=>o.toLowerCase()));return e.replace(Aj(),o=>r.has(o.toLowerCase())?" ":o).split(/\r?\n/g).map(o=>o.replace(/[ \t]{2,}/g," ").trim()).filter((o,u,d)=>o.length>0||u>0&&u<d.length-1).join(`
94
+ `).trim()}function s6(e,l){return e.length!==l.length?!1:e.every((r,i)=>r===l[i])}function o6(e,l,r){const i=e.match(Aj())??[];if(i.length===0)return{body:e,nextReferenceMessageIds:r};const o=[...r],u=[];for(const f of i){const p=a6(f,l);p&&(u.push(f),o.includes(p.id)||o.push(p.id))}return{body:i6(e,u),nextReferenceMessageIds:s6(o,r)?r:o}}function c6({activeView:e,layout:l,threading:r,composer:i,agentSession:o}){return e!=="messages"&&e!=="relay"?null:a.jsx(Yz,{...l,...r,...i,...o})}function u6({activeView:e,scoutDesktop:l,voiceEnabled:r,relayState:i,messagesState:o,interAgentAgents:u,interAgentThreads:d,sessions:f,appSettings:p,setActiveView:h,applyRelayWorkspacePatch:y}){const[g,v]=z.useState("channel"),[k,S]=z.useState("shared"),[A,N]=z.useState(null),[R,L]=z.useState(""),[H,X]=z.useState(!1),[V,D]=z.useState(0),[I,F]=z.useState(0),[ne,O]=z.useState(null),[P,Q]=z.useState(!0),[oe,W]=z.useState(null),[J,w]=z.useState([]),[Y,G]=z.useState([]),[ve,T]=z.useState(0),B=z.useRef(null),le=z.useRef(null),M=o?.threads??[],pe=z.useMemo(()=>M.find(q=>q.id===A)??null,[M,A]),ge=z.useMemo(()=>pe?.interAgentThreadId?d.find(q=>q.id===pe.interAgentThreadId)??null:null,[d,pe]),ce=z.useMemo(()=>{if(!ge)return null;const q=ge.participants.map(ke=>ke.id),de=i?.directs.find(ke=>q.includes(ke.id))?.id??null;return de?u.find(ke=>ke.id===de)??null:null},[u,i,ge]),Re=pe?.kind==="relay"&&g==="direct"?k:ce?.id??null;z.useEffect(()=>{if(!i)return;const q=Wb(i),de=zC(i),ke=[...q.map(Be=>`${Be.kind}:${Be.id}`),...de.map(Be=>`${Be.kind}:${Be.id}`),...i.directs.map(Be=>`${Be.kind}:${Be.id}`)],Qe=`${g}:${k}`;ke.includes(Qe)||(v("channel"),S("shared"))},[i,k,g]),z.useEffect(()=>{const q=B.current;if(!q)return;const de=120;q.style.height="0px";const ke=Math.min(q.scrollHeight,de);q.style.height=`${ke}px`,q.style.overflowY=q.scrollHeight>de?"auto":"hidden"},[R]),z.useEffect(()=>{if(e!=="relay"&&e!=="messages"||ve===0)return;const q=B.current;if(!q)return;const de=window.requestAnimationFrame(()=>{q.focus();const ke=q.value.length;q.setSelectionRange?.(ke,ke)});return()=>{window.cancelAnimationFrame(de)}},[e,ve]),z.useEffect(()=>{oe&&(g!=="direct"||k!==oe.authorId)&&W(null)},[oe,k,g]),z.useEffect(()=>{if(!i?.messages.length)return;const q=new Set(i.messages.map(de=>de.clientMessageId).filter(de=>!!de));q.size&&G(de=>de.filter(ke=>!q.has(ke.clientMessageId)))},[i]);const Se=z.useMemo(()=>Wb(i).filter(q=>r||!(q.kind==="channel"&&q.id==="voice")),[i,r]),Ne=i&&g==="direct"?i.directs.find(q=>q.id===k)??null:null,Ve=i?OC(i,Se,g,k):null,_e=z.useMemo(()=>{const q=i?.messages??[];if(!Y.length)return q;const de=new Set(q.map(Qe=>Qe.clientMessageId).filter(Qe=>!!Qe)),ke=Y.filter(Qe=>!de.has(Qe.clientMessageId)).map(Qe=>Qe.message);return ke.length?[...q,...ke].sort((Qe,Be)=>Qe.createdAt-Be.createdAt||Qe.id.localeCompare(Be.id)):q},[Y,i]),Fe=z.useMemo(()=>LC(_e,g,k),[_e,k,g]),it=z.useMemo(()=>new Map(_e.map(q=>[q.id,q])),[_e]),rt=z.useMemo(()=>J.map(q=>it.get(q)).filter(q=>!!q).map(q=>({messageId:q.id,authorName:q.authorName,preview:ip(q.body,96)})),[J,it]),ut=Vp(Ve?.title??"# shared-channel"),st=Ne?Av(Ne):Ve?.subtitle??null,vt=Ve&&"count"in Ve&&Ve.count>0?Ve.count:null,Ke=Fe.at(-1)??null,Ye=z.useMemo(()=>u.flatMap(q=>{const de=q.selector??q.defaultSelector;return de?[{agentId:q.id,title:q.title,subtitle:q.projectRoot??q.cwd??q.subtitle??null,mentionToken:de,definitionId:q.definitionId,workspaceQualifier:q.workspaceQualifier,branch:q.branch,harness:q.harness,state:q.state,statusLabel:q.statusLabel,searchText:[q.title,q.id,q.definitionId??"",de,q.selector??"",q.defaultSelector??"",q.workspaceQualifier??"",q.branch??"",q.harness??"",q.projectRoot??"",q.cwd??""].join(" ").toLowerCase()}]:[]}).sort((q,de)=>q.title.localeCompare(de.title)),[u]);z.useEffect(()=>{Q(!0);const q=le.current;q&&window.requestAnimationFrame(()=>{q.scrollTo({top:q.scrollHeight,behavior:"auto"})})},[k,g]),z.useEffect(()=>{if(!P)return;const q=le.current;q&&window.requestAnimationFrame(()=>{q.scrollTo({top:q.scrollHeight,behavior:"smooth"})})},[Ke?.body,Ke?.id,Ke?.receipt?.state,Ne?.activeTask,Ne?.state,P]);const et=z.useCallback(q=>{const de=q.currentTarget,ke=de.scrollHeight-de.scrollTop-de.clientHeight;Q(ke<=48)},[]),Me=z.useMemo(()=>PC(R,V),[R,V]),ot=z.useMemo(()=>{if(!Me)return[];const q=g==="direct"?k:null;return Ye.map(de=>({candidate:de,score:UC(de,Me.query,q)})).filter(({score:de})=>de>0).sort((de,ke)=>ke.score-de.score||de.candidate.title.localeCompare(ke.candidate.title)).slice(0,8).map(({candidate:de})=>de)},[Me,Ye,k,g]),Ce=z.useMemo(()=>Ye.reduce((q,de)=>(q.set(de.title,(q.get(de.title)??0)+1),q),new Map),[Ye]),nt=ot.length>0;z.useEffect(()=>{if(!nt){F(0);return}F(q=>Math.min(q,ot.length-1))},[nt,ot.length]);const mt=z.useMemo(()=>{if(!ge)return[];const q=new Set(ge.messageIds);return _e.filter(de=>q.has(de.id))},[_e,ge]),ae=Re?u.find(q=>q.id===Re)??null:null,be=z.useMemo(()=>{if(ae)return f.filter(q=>q.project===ae.id||q.agent===ae.title);if(ge){const q=new Set(ge.participants.map(ke=>ke.id)),de=new Set(ge.participants.map(ke=>ke.title));return f.filter(ke=>q.has(ke.project)||de.has(ke.agent))}return pe?.relayDestinationKind==="channel"&&pe.relayDestinationId?f.filter(q=>q.tags?.includes(pe.relayDestinationId??"")??!1):f.slice(0,8)},[ae,ge,pe,f]),we=z.useCallback((q,de)=>{v(q),S(de),N(o?.threads.find(ke=>ke.relayDestinationKind===q&&ke.relayDestinationId===de)?.id??null),h("messages")},[o,h]),ze=z.useCallback(q=>{if(!Me)return;const de=R.slice(Me.end),ke=de.startsWith(" ")||de.length===0?"":" ",Qe=`${R.slice(0,Me.start)}${q.mentionToken}${ke}${de}`,Be=Me.start+q.mentionToken.length+ke.length;L(Qe),D(Be),F(0),window.requestAnimationFrame(()=>{const $e=B.current;$e&&($e.focus(),$e.setSelectionRange(Be,Be))})},[Me,R]),We=z.useCallback(async()=>{const q=R.trim();if(!q||H||!l?.sendRelayMessage)return;const de=R,ke=oe,Qe=J,Be=Cz(),$e=oe?.messageId??J[0]??null,wt=wz({relayState:i,appSettings:p,destinationKind:g,destinationId:k,body:q,replyToMessageId:$e,clientMessageId:Be});X(!0),O("Sending…"),G(Qt=>[...Qt,{clientMessageId:Be,message:wt}]),L(""),W(null),w([]);try{const Qt=await l.sendRelayMessage({destinationKind:g,destinationId:k,body:q,replyToMessageId:$e,referenceMessageIds:J,clientMessageId:Be});y(Qt),G(qt=>qt.map(Pt=>Pt.clientMessageId===Be?{...Pt,message:{...Pt.message,receipt:Pt.message.receipt?{...Pt.message.receipt,label:"Sent",detail:null}:{state:"sent",label:"Sent",detail:null}}}:Pt)),O("Sent.")}catch(Qt){G(qt=>qt.filter(Pt=>Pt.clientMessageId!==Be)),L(de),W(ke),w(Qe),O(Je(Qt))}finally{X(!1)}},[p,R,H,J,i,oe,l,k,g,y]),Ae=z.useCallback((q,de)=>{we("direct",q),w([]),W(de?.replyToMessage?{messageId:de.replyToMessage.id,authorId:de.replyToMessage.authorId,authorName:de.replyToMessage.authorName,preview:ip(de.replyToMessage.body,96)}:null),typeof de?.draft=="string"&&L(de.draft),de?.focusComposer&&T(ke=>ke+1)},[we]),ue=z.useCallback(q=>{q.isOperator||(Ae(q.authorId,{replyToMessage:q,draft:"Following up on this.",focusComposer:!0}),O(`Drafting a follow-up to ${q.authorName}.`))},[Ae]),Te=z.useCallback((q,de)=>{Ae(q,{draft:de??null,focusComposer:!0})},[Ae]);return{selectedConversationKind:g,setSelectedConversationKind:v,selectedConversationId:k,setSelectedConversationId:S,selectedMessageThreadId:A,setSelectedMessageThreadId:N,selectedMessagesThread:pe,selectedMessagesInternalThread:ge,selectedMessagesInternalTarget:ce,selectedMessagesDetailAgentId:Re,selectedMessagesDetailAgent:ae,selectedMessagesInternalMessages:mt,selectedMessagesSessions:be,composerDraft:R,setComposerDraft:L,composerSending:H,composerSelectionStart:V,setComposerSelectionStart:D,mentionSelectionIndex:I,setMentionSelectionIndex:F,messagesFeedback:ne,setMessagesFeedback:O,replyTarget:oe,setReplyTarget:W,contextMessageIds:J,setContextMessageIds:w,composerRef:B,timelineViewportRef:le,mergedConversationMessages:_e,visibleConversationMessages:Fe,currentConversationTitle:ut,currentConversationSubtitle:st,currentConversationCount:vt,selectedDirectConversation:Ne,contextReferences:rt,mentionMenuOpen:nt,mentionSuggestions:ot,mentionDuplicateTitleCounts:Ce,handleConversationTimelineScroll:et,openConversation:we,applyMentionSuggestion:ze,sendMessage:We,openDirectConversation:Ae,nudgeMessage:ue,openAgentDirectMessage:Te,messageThreads:M}}const d6=["profile","knowledge","agents","workspaces","communication","database","appearance"];function f6(e){return d6.includes(e)}function m6(e,l){const r=l?.agentId?.trim();return e==="agents"&&r?`/settings/agents/${encodeURIComponent(r)}`:`/settings/${e}`}function p6(e){if(e==="/settings"||e==="/settings/")return{section:"profile",agentId:null};if(!e.startsWith("/settings/"))return null;const l=e.slice(10).split("/").filter(Boolean),r=l[0]??"";if(!r)return{section:"profile",agentId:null};if(!f6(r))return null;if(r!=="agents")return l.length===1?{section:r,agentId:null}:null;if(l.length===1)return{section:"agents",agentId:null};if(l.length===2)try{return{section:"agents",agentId:decodeURIComponent(l[1]??"")||null}}catch{return null}return null}const h6=["overview","inbox","activity","machines","plans","sessions","search","messages","relay","inter-agent","agents","logs","settings","help"];function x6(e){return e!==null&&h6.includes(e)}function g6(e){if(e==="/")return"overview";const l=e.slice(1).split("/")[0]??"";return!l||l==="pairing"||l==="settings"?null:x6(l)?l:null}function b6(e,l,r,i){return e==="pairing"?"/pairing":l==="settings"?m6(r,{agentId:i}):l==="overview"?"/":`/${l}`}const y6={enableAll:!1,overview:!0,inbox:!0,relay:!0,pairing:!0,interAgent:!0,agents:!0,settings:!0,logs:!0,activity:!1,machines:!1,plans:!1,sessions:!0,search:!0,phonePreparation:!1,telegram:!1,voice:!1,monitor:!1},x1=["claude","codex"],Ej="scout.desktop.home-cache.v1",v6=250,j6=["hello","node.upserted","actor.registered","agent.registered","agent.endpoint.upserted","conversation.upserted","binding.upserted","message.posted","invocation.requested","flight.updated","delivery.planned","delivery.attempted","delivery.state.changed","collaboration.upserted","collaboration.event.appended","scout.dispatched"];function k6(){if(typeof window>"u")return null;try{const e=window.localStorage.getItem(Ej);return e?JSON.parse(e):null}catch{return null}}function N6(e){if(!(typeof window>"u"))try{window.localStorage.setItem(Ej,JSON.stringify({...e,savedAt:Date.now()}))}catch{}}function yu(e,l,r){const i={label:e,durationMs:Math.round(performance.now()-l),recordedAt:Date.now(),detail:r};return console.info(`[scout] ${e}`,{durationMs:i.durationMs,...r}),i}function vu(e,l){const r={...e};return l&&(r.Total=`${l.totalMs}ms`,l.steps.forEach(i=>{r[i.label]=`${i.durationMs}ms`})),Object.keys(r).length>0?r:void 0}function ju(e){return{runtime:e.runtime,messages:e.messages,sessions:e.sessions,relay:e.relay,interAgent:e.interAgent,performance:e.performance??null}}function w6(e,l){return{...l,planCount:e.planCount,workspaceCount:e.workspaceCount,plans:e.plans,subtitle:`${l.taskCount} asks · ${l.findingCount} findings · ${e.planCount} plans · ${e.workspaceCount} workspaces`}}function S6(){const e=_z(),[l,r]=E.useState(240),[i,o]=E.useState(340),[u,d]=E.useState(!1),[f,p]=E.useState("relay"),[h,y]=E.useState("overview"),[g,v]=E.useState(""),[k,S]=E.useState(null),[A,N]=E.useState(null),[R,L]=E.useState(!0),[H,X]=E.useState("overview"),[V,D]=E.useState(null),[I,F]=E.useState(null),[ne,O]=E.useState(null),[P,Q]=E.useState(null),[oe,W]=E.useState(null),[J,w]=E.useState({services:null,home:null,workspace:null}),[Y,G]=E.useState(!1),[ve,T]=E.useState(!0),[B,le]=E.useState(!1),[M,pe]=E.useState(!1),[ge,ce]=E.useState(null),[Re,Se]=E.useState(!1),[Ne,Ve]=E.useState(!1),[_e,Fe]=E.useState("profile"),[it,rt]=E.useState(null),ut=E.useRef(null),st=E.useRef(null),vt=E.useRef(!1),Ke=gN(),Ye=N1();E.useLayoutEffect(()=>{if(!Ye.pathname.startsWith("/settings"))return;const _=p6(Ye.pathname);if(_){p("relay"),y("settings"),Fe(_.section),rt(_.agentId);return}Ke("/settings/profile",{replace:!0})},[Ye.pathname,Ke]),E.useLayoutEffect(()=>{if(Ye.pathname.startsWith("/settings"))return;if(Ye.pathname==="/pairing"){p("pairing"),y(Z=>Z==="settings"?"overview":Z);return}const _=g6(Ye.pathname);if(_){p("relay"),y(_);return}Ke("/",{replace:!0})},[Ye.pathname,Ke]),E.useEffect(()=>{const _=b6(f,h,_e,it);Ye.pathname!==_&&Ke(_,{replace:!0})},[h,Ye.pathname,Ke,f,it,_e]);const et=z.useCallback(()=>{p("relay"),y("help"),zt(null)},[]),[Me,ot]=E.useState(!1),[Ce,nt]=E.useState(!1),[mt,ae]=E.useState(!1),be=E.useRef(null),we=E.useRef(null),ze=E.useRef(null),We=E.useRef(!1),Ae=E.useRef(!1),ue=E.useRef(!1),Te=E.useRef(!1),q=f==="relay"&&(h==="messages"||h==="relay"),de=q?P?.sessions??oe?.sessions??[]:oe?.sessions??[],ke=oe?.machines??null,Qe=oe?.plans??null,Be=q?P?.messages??oe?.messages??null:oe?.messages??null,$e=q?P?.runtime??oe?.runtime??null:oe?.runtime??null,wt=q?P?.relay??oe?.relay??null:oe?.relay??null,Qt=q?P?.interAgent??oe?.interAgent??null:oe?.interAgent??null,qt=Qt?.agents??[],Pt=Qt?.threads??[],ht=V?.features??oe?.appInfo.features??y6,Wt=V?.capabilities??oe?.appInfo.capabilities;E.useEffect(()=>{ut.current=I},[I]),E.useEffect(()=>{st.current=ne},[ne]);const se=z.useCallback((_,Z)=>{N6({homeState:_,servicesState:Z})},[]),Ee=z.useCallback(async()=>{if(!e?.getServicesState||Ae.current)return null;const _=performance.now();G(!0),Ae.current=!0;try{const Z=await e.getServicesState();return O(Z),se(ut.current,Z),w(ye=>({...ye,services:yu("services-state",_,vu({serviceCount:Z.services.length},Z.performance))})),Z}catch(Z){return ce(Je(Z)),null}finally{Ae.current=!1,G(!1)}},[se,e]),Oe=z.useCallback(async(_=!1)=>{if(!e?.getHomeState)return ce("Desktop bridge is unavailable."),T(!1),null;if(We.current)return null;_&&T(!0);const Z=performance.now();We.current=!0;try{const ye=await e.getHomeState();return F(ye),ce(null),se(ye,st.current),w(_t=>({..._t,home:yu("home-state",Z,vu({agents:ye.agents.length,activity:ye.activity.length},ye.performance))})),ye}catch(ye){return ce(Je(ye)),null}finally{We.current=!1,T(!1)}},[se,e]),tt=z.useCallback(async(_=!1)=>{if(!e?.getMessagesWorkspaceState)return ce("Desktop bridge is unavailable."),le(!1),null;if(ue.current)return null;_&&le(!0),ue.current=!0;const Z=performance.now();try{const ye=await e.getMessagesWorkspaceState();return Q(ye),ce(null),w(_t=>({..._t,workspace:yu("messages-workspace",Z,vu({threads:ye.messages.threads.length,messages:ye.relay.messages.length,agents:ye.interAgent.agents.length,sessions:ye.sessions.length},ye.performance))})),ye}catch(ye){return ce(Je(ye)),null}finally{ue.current=!1,le(!1)}},[e]),Vt=z.useCallback(async(_=!1)=>{if(!e?.getShellState)return ce("Desktop bridge is unavailable."),pe(!1),null;if(Te.current)return null;_&&pe(!0),Te.current=!0;const Z=performance.now();try{const ye=await e.getShellState();return W(ye),ce(null),w(_t=>({..._t,workspace:yu("relay-workspace",Z,vu({messages:ye.relay.messages.length,agents:ye.interAgent.agents.length,sessions:ye.sessions.length},ye.performance))})),ye}catch(ye){return ce(Je(ye)),null}finally{Te.current=!1,pe(!1)}},[e]),on=z.useCallback(_=>{W(Z=>Z&&{...Z,..._,relay:{..._.relay,voice:Z.relay.voice},plans:w6(Z.plans,_.plans)}),Q(Z=>Z&&{...Z,...ju(_),relay:{..._.relay,voice:Z.relay.voice}})},[]);E.useEffect(()=>{if(!e?.getAppInfo)return;let _=!1;return(async()=>{try{const ye=await e.getAppInfo();_||D(ye)}catch{_||D(null)}})(),()=>{_=!0}},[e]),E.useEffect(()=>{if(e?.onOpenKnowledgeBase)return e.onOpenKnowledgeBase(et)},[et,e]);const va=z.useCallback(_=>{const Z=_?.runtime?.brokerReachable??ne?.services.find(ye=>ye.id==="broker")?.reachable??!1;if(p("relay"),Z){y("messages"),nl("channel"),ar("shared"),yn("Relay is running."),zt(null);return}y("settings"),Fe("communication"),ot(!0),zt("Relay is not running yet. Finish onboarding by starting the broker from Communication.")},[ne]),er=Gz({activeView:h,settingsSection:_e,scoutDesktop:e,shellState:oe,surfaceCaps:Wt,completeOnboardingIntoRelay:va,loadShellState:Vt}),{SOURCE_ROOT_PATH_SUGGESTIONS:ja,appSettings:bn,setAppSettings:oi,appSettingsLoading:ka,workspaceInventoryLoading:Un,appSettingsSaving:Yt,appSettingsFeedback:cn,setAppSettingsFeedback:zt,setAppSettingsDraft:tr,isAppSettingsEditing:Ul,onboardingWizardStep:Ln,setOnboardingWizardStep:us,onboardingCommandPending:el,onboardingCommandResult:Hl,onboardingCommandHistory:gl,onboardingCopiedCommand:Fl,startupOnboardingState:Dr,setIsAppSettingsEditing:ql,visibleAppSettings:Ht,agentableProjects:Na,appSettingsDirty:wa,projectRetirementPendingRoot:Vl,workspaceInventoryLoaded:nr,canRefreshWorkspaceInventory:Io,showDoctorOutput:ds,onboardingContextRoot:Hn,onboardingHasProjectConfig:fs,onboardingRuntimeMatch:Sa,onboardingWizardSteps:$l,onboardingWizardIndex:Fn,activeOnboardingStep:Xt,canGoToPreviousOnboardingStep:ci,canGoToNextOnboardingStep:ui,startupOnboardingVisible:he,startupOnboardingBlocking:Le,buildOnboardingCommandLine:$t,applyNextAppSettings:tl,applyRestartedOnboardingSettings:mn,refreshVisibleAppSettings:_r,handleStartAppSettingsEdit:di,handleCancelAppSettingsEdit:Tn,updateAppSettingsDraft:Tl,handleSaveAppSettings:Wu,moveOnboardingWizard:Po,handleRunOnboardingCommand:lr,handleRestoreProject:mh,handleRestartOnboarding:Ju,handleAddSourceRootSuggestion:Uo,handleSetSourceRootAt:ms,handleAddSourceRootRow:ed,handleRemoveSourceRootRow:td,handleBrowseForSourceRoot:fi,handleSetOnboardingContextRoot:Al,handleBrowseForOnboardingContextRoot:ps,dismissStartupOnboarding:hs,handleOnboardingContinue:Br,skipCurrentOnboardingStep:Ir,handleCopyOnboardingCommand:Ho,handleLoadWorkspaceInventory:Fo}=er,xs=u6({activeView:h,scoutDesktop:e,voiceEnabled:ht.voice,relayState:wt,messagesState:Be,interAgentAgents:qt,interAgentThreads:Pt,sessions:de,appSettings:bn,setActiveView:y,applyRelayWorkspacePatch:on}),{selectedConversationKind:rr,setSelectedConversationKind:nl,selectedConversationId:Ca,setSelectedConversationId:ar,selectedMessageThreadId:An,setSelectedMessageThreadId:ir,selectedMessagesThread:mi,selectedMessagesDetailAgentId:qo,messagesFeedback:gs,setMessagesFeedback:yn,mergedConversationMessages:Ta,openConversation:vn,openDirectConversation:sr}=xs,{pairingState:Pr,pairingLoading:Ur,pairingError:Vo,setPairingError:bs,pairingControlPending:ys,pairingConfigPending:Aa,pairingApprovalPendingId:pi,pairingConfigFeedback:$o,setPairingConfigFeedback:nd,pendingApprovals:hi,commitPairingState:ld,refreshPairingState:Ea,handlePairingControl:rd,handleUpdatePairingConfig:ad,handleDecidePairingApproval:vs}=Hz({pairingEnabled:ht.pairing,scoutDesktop:e,setRelayFeedback:yn}),id=kC(Pr,Ur,Vo),sd=Fz({activeView:h,scoutDesktop:e,sessions:de}),xi=Uz({activeView:h,settingsSection:_e,scoutDesktop:e,surfaceCaps:Wt,pendingBrokerInspectorFocus:Me,setPendingBrokerInspectorFocus:ot,relayServiceInspectorRef:ze,loadShellState:Vt,setShellState:W,setShellError:ce,applyRestartedOnboardingSettings:mn,commitPairingState:ld,pairingState:Pr,setAppSettingsFeedback:zt,setRelayFeedback:yn,setPairingError:bs,setPairingConfigFeedback:nd}),{isFeedbackDialogOpen:od,feedbackBundle:cd,feedbackBundleLoading:ud,feedbackBundleError:dd,feedbackDraft:js,setFeedbackDraft:fd,feedbackSubmission:md,feedbackActionPending:pd,feedbackActionMessage:Go,refreshLogs:hd,refreshBrokerInspector:xd,openFeedbackDialog:Yo,handleFeedbackDialogOpenChange:gd,handleRefreshFeedbackBundle:bd,handleCopyFeedbackBundle:yd,handleSubmitFeedbackReport:vd,handleRepairSetup:jd}=xi,ks=Iz({activeView:h,scoutDesktop:e,surfaceCaps:Wt,interAgentState:Qt,interAgentAgents:qt,interAgentThreads:Pt,relayState:wt,selectedMessagesThread:mi,selectedMessagesDetailAgentId:qo,selectedRelayKind:rr,selectedRelayId:Ca,agentableProjects:Na,visibleAppSettings:Ht,isAppSettingsEditing:Ul,appSettingsDirty:wa,setAppSettings:oi,setAppSettingsDraft:tr,setActiveView:y,setSettingsSection:Fe,setSettingsAgentId:rt,setShellState:W,setShellError:ce,setRelayFeedback:yn}),{selectedInterAgentId:pn,selectedInterAgentThreadId:Hr,setSelectedInterAgentThreadId:Ns,selectedInterAgent:qn,visibleInterAgentThreads:ws,selectedInterAgentThread:ll,handleSelectInterAgent:or,deactivateAgentConfigEdit:Ra,isCreateAgentDialogOpen:Fr,setIsCreateAgentDialogOpen:kd,createAgentDraft:Nd,setCreateAgentDraft:wd,createAgentDefaults:Qo,createAgentSubmitting:Xo,createAgentFeedback:Ma,setCreateAgentFeedback:za,handleOpenCreateAgentDialog:ph,handleBrowseCreateAgentProject:gi,handleCreateAgent:Ko,visibleAgentSession:Zo,agentSessionPending:Ss,agentSessionLoading:Cs,agentSessionFeedback:Wo,agentSessionCopied:Jo,isAgentSessionPeekOpen:ec,closeAgentSessionPeek:Sd,agentSessionPeekViewportRef:Cd,handlePeekAgentSessionScroll:Td,handleOpenAgentSession:Ad,handleCopyAgentSessionCommand:Ed,handleAgentSessionTraceIntent:Dn,handlePeekAgentSession:bi,refreshAgentSession:tc}=ks;E.useEffect(()=>{if(!(h!=="settings"||_e!=="agents")){if(!it){Ra();return}pn!==it&&or(it)}},[h,Ra,or,pn,it,_e]);const rl=f==="relay"&&(h==="inbox"||h==="activity"||h==="machines"||h==="plans"||h==="sessions"||h==="search"||h==="inter-agent"||h==="agents"||h==="logs"||h==="settings"&&(_e==="agents"||_e==="communication"||_e==="database")),yi=f==="relay"&&(h==="inbox"||h==="activity"||h==="messages"||h==="relay"||h==="agents"||h==="inter-agent"||h==="sessions"||h==="search"),Ts=z.useCallback(async()=>{if(!Le)try{if(f==="pairing"&&ht.pairing&&(e?.refreshPairingState||e?.getPairingState)){await Ea();return}if(h==="overview"){await Promise.allSettled([Ee(),Oe(!1)]);return}if(yi&&e?.refreshRelayShellPatch){const _=await e.refreshRelayShellPatch();on(_),ce(null);return}if(q){await tt(!1);return}if(rl&&e?.refreshShellState){const _=await e.refreshShellState();W(_),ce(null);return}rl&&await Vt(!1)}catch{}},[h,on,ht.pairing,Oe,tt,Ee,Vt,q,f,Ea,yi,rl,e,Le]);E.useEffect(()=>{if(vt.current||!e)return;vt.current=!0;const _=k6();_?.servicesState&&O(_.servicesState),_?.homeState&&(F(_.homeState),T(!1)),Ee(),Oe(!_?.homeState)},[Oe,Ee,e]),E.useEffect(()=>{if(!(Le||!q||P)){if(oe){Q(ju(oe));return}tt(!0)}},[tt,q,P,oe,Le]),E.useEffect(()=>{Le||!rl||oe||Vt(!0)},[Vt,rl,oe,Le]),E.useEffect(()=>{if(typeof window>"u"||typeof EventSource>"u"||!e)return;let _=null;const Z=new EventSource("/api/events"),ye=()=>{document.visibilityState!=="hidden"&&_===null&&(_=window.setTimeout(()=>{_=null,Ts()},v6))},_t=j6.map(pr=>{const Gr=()=>ye();return Z.addEventListener(pr,Gr),{eventName:pr,handler:Gr}}),ol=()=>ye(),vl=()=>{document.visibilityState==="visible"&&ye()};return window.addEventListener("focus",ol),document.addEventListener("visibilitychange",vl),()=>{_!==null&&window.clearTimeout(_);for(const pr of _t)Z.removeEventListener(pr.eventName,pr.handler);window.removeEventListener("focus",ol),document.removeEventListener("visibilitychange",vl),Z.close()}},[Ts,e]),E.useEffect(()=>{const _=Be?.threads??[];if(_.length===0){An!==null&&ir(null);return}if(An&&_.some(ye=>ye.id===An))return;const Z=_.find(ye=>ye.relayDestinationKind===rr&&ye.relayDestinationId===Ca)??_.find(ye=>ye.interAgentThreadId===Hr)??_[0];Z&&Z.id!==An&&ir(Z.id)},[Be,Ca,rr,Hr,An,ir]),E.useEffect(()=>{An&&(L(!0),X("overview"))},[An]),E.useEffect(()=>{if(h!=="settings"||!Ul)return;const _=we.current;if(!_)return;const Z=window.requestAnimationFrame(()=>{_.focus(),_.select()});return()=>{window.cancelAnimationFrame(Z)}},[h,Ul]);const vi=E.useMemo(()=>{const _=new Map;return de.forEach(Z=>{const ye=_.get(Z.project);!ye||new Date(Z.lastModified)>new Date(ye.lastModified)?_.set(Z.project,{count:(ye?.count||0)+1,lastModified:Z.lastModified}):ye&&_.set(Z.project,{...ye,count:ye.count+1})}),Array.from(_.entries()).map(([Z,ye])=>({name:Z,...ye}))},[de]),Rd=E.useMemo(()=>{let _=de;if(k&&(_=_.filter(Z=>Z.project===k)),g){const Z=g.toLowerCase();_=_.filter(ye=>ye.title.toLowerCase().includes(Z)||ye.preview.toLowerCase().includes(Z)||ye.tags?.some(_t=>_t.toLowerCase().includes(Z))||ye.agent.toLowerCase().includes(Z)||ye.project.toLowerCase().includes(Z))}return _.sort((Z,ye)=>new Date(ye.lastModified).getTime()-new Date(Z.lastModified).getTime())},[de,g,k]),cr=E.useMemo(()=>({totalSessions:de.length,totalMessages:de.reduce((_,Z)=>_+Z.messageCount,0),totalTokens:de.reduce((_,Z)=>_+(Z.tokens||0),0),projects:vi.length}),[de,vi]),As=E.useMemo(()=>Array.from(new Set(de.map(_=>_.agent))).sort(),[de]),Oa=E.useMemo(()=>new Map(qt.map(_=>[_.id,_])),[qt]),Es=E.useMemo(()=>new Map((wt?.directs??[]).map(_=>[_.id,_])),[wt]),nc=E.useMemo(()=>{if(!wt||!ll)return[];const _=new Set(ll.messageIds);return wt.messages.filter(Z=>_.has(Z.id))},[wt,ll]),ur=E.useMemo(()=>{if(!qn)return[];const _=new Set(ws.filter(Z=>Z.sourceKind==="private").flatMap(Z=>Z.messageIds));return Ta.filter(Z=>_.has(Z.id)||Z.authorId===qn.id).slice(-60)},[Ta,qn,ws]),qr=E.useMemo(()=>Qe?.tasks.filter(_=>_.targetAgentId===pn)??[],[Qe,pn]),La=E.useMemo(()=>Qe?.findings.filter(_=>_.targetAgentId===pn||_.requesterId===pn)??[],[Qe,pn]),lc=E.useMemo(()=>La.filter(_=>_.requesterId===pn),[La,pn]),dr=ll?rp(ll,pn):qn?`${qn.title}'s agent threads`:"Inter-Agent",rc=ll?ap(ll,pn):qn?.statusDetail??"Select an agent to inspect private threads between agents.",Da=E.useMemo(()=>{if(ll){const _=qp(ll,pn);if(_.length===1)return qt.find(Z=>Z.id===_[0]?.id)??qn}return qn},[ll,pn,qt,qn]),ac=Da?Da.profileKind==="project"?"Configure":"Profile":null,Md=Da??qn,ji=z.useCallback((_,Z)=>{if(!_)return null;const ye=Z?.compact?ii(_)??_:_;return ye.includes("/")||ye.startsWith("~/")||ye.startsWith(".openscout")?a.jsx("button",{type:"button",className:Z?.className??"text-left underline underline-offset-2 decoration-dotted hover:opacity-80 transition-opacity",style:Z?.style??{color:b.ink},onClick:ol=>{ol.preventDefault(),!(!Wt?.canRevealPath||!e?.revealPath)&&e.revealPath(_).catch(vl=>{zt(Je(vl))})},title:"Open in Finder",children:ye}):a.jsx(a.Fragment,{children:ye})},[e,Wt]),zd=E.useMemo(()=>[...de].sort((_,Z)=>new Date(Z.lastModified).getTime()-new Date(_.lastModified).getTime()).slice(0,5),[de]);E.useEffect(()=>{$e&&O(_=>{if(!_)return _;const Z={..._,updatedAtLabel:$e.updatedAtLabel??_.updatedAtLabel,services:_.services.map(ye=>ye.id==="broker"?{...ye,status:$e.brokerReachable?$e.brokerHealthy?"running":"degraded":"offline",statusLabel:$e.brokerReachable?$e.brokerHealthy?"Running":"Degraded":"Offline",healthy:$e.brokerHealthy,reachable:$e.brokerReachable,detail:$e.brokerLabel,updatedAtLabel:$e.updatedAtLabel??ye.updatedAtLabel,url:$e.brokerUrl,nodeId:$e.nodeId}:ye.id==="helper"?{...ye,status:$e.helperRunning?"running":"offline",statusLabel:$e.helperRunning?"Running":"Offline",healthy:$e.helperRunning,reachable:$e.helperRunning,detail:$e.helperDetail,updatedAtLabel:$e.updatedAtLabel??ye.updatedAtLabel}:ye)};return se(I,Z),Z})},[I,se,$e]),E.useEffect(()=>{if(!wt)return;const _={title:"Home",subtitle:`${wt.directs.length} agents · ${wt.messages.filter(Z=>!Z.isVoice).length} recent updates`,updatedAtLabel:wt.lastUpdatedLabel??$e?.updatedAtLabel??null,agents:wt.directs.slice(0,24).map(Z=>({id:Z.id,title:Z.title,role:null,summary:Z.preview,projectRoot:null,state:Z.state,reachable:Z.reachable,statusLabel:Z.statusLabel,statusDetail:Z.statusDetail,activeTask:Z.activeTask,timestampLabel:Z.timestampLabel})),activity:wt.messages.filter(Z=>!Z.isVoice).sort((Z,ye)=>ye.createdAt-Z.createdAt).slice(0,24).map(Z=>({id:Z.id,kind:Z.isSystem?"system":"message",actorId:Z.authorId,actorName:Z.authorName,title:Z.authorName,detail:Z.body,conversationId:Z.conversationId,channel:Z.normalizedChannel,timestamp:Z.createdAt,timestampLabel:Z.timestampLabel})),recentSessions:[...de].sort((Z,ye)=>new Date(ye.lastModified).getTime()-new Date(Z.lastModified).getTime()).slice(0,6)};F(_),se(_,ne)},[se,wt,$e?.updatedAtLabel,ne,de]);const _a=I?.agents??[],ic=I?.activity??[],Ba=E.useMemo(()=>[...Qe?.tasks??[]].sort((_,Z)=>Z.createdAt-_.createdAt).slice(0,18),[Qe]),al=E.useMemo(()=>[...Qe?.findings??[]].slice(0,10),[Qe]),ki=E.useMemo(()=>(ke?.machines??[]).flatMap(_=>_.endpoints.map(Z=>({machineId:_.id,machineTitle:_.title,machineStatus:_.status,endpoint:Z}))).sort((_,Z)=>{const ye=_t=>{switch(_t){case"running":return 0;case"waiting":return 1;case"idle":return 2;default:return 3}};return ye(_.endpoint.state)-ye(Z.endpoint.state)||_.endpoint.agentName.localeCompare(Z.endpoint.agentName)}).slice(0,14),[ke]),Vn=E.useMemo(()=>[...Ta].filter(_=>!_.isVoice).slice(-18).reverse(),[Ta]),fr=E.useMemo(()=>(Qe?.tasks??[]).filter(_=>_.status==="failed").length,[Qe]),Ia=hi.length+fr,Ni=Ba.find(_=>_.status==="running")??Ba[0]??null,jn=ne?.services.find(_=>_.id==="broker")??null,Rs=_a.filter(_=>_.reachable).length,mr=_a.length>0?_a.length:$e?.agentCount??0,El=!Le&&ve&&!ne&&!I&&!ge,wi=El?"Syncing…":jn?.statusLabel??($e?.brokerReachable?"Running":"Offline"),Vr=El?"Checking relay health.":jn?.detail?`Relay diagnostics · ${jn.detail}`:jn?.reachable||$e?.brokerReachable?"Open Relay diagnostics":"Relay is offline. Open diagnostics.",Od=El?"bg-sky-500 animate-pulse":jn?.status==="running"||$e?.brokerReachable?"bg-emerald-500":jn?.status==="degraded"?"bg-amber-500":"bg-slate-400",_n=El?"Syncing":jn?.healthy||$e?.brokerHealthy?"Healthy":jn?.reachable||$e?.brokerReachable?"Reachable":"Offline",Pa=E.useMemo(()=>ge||wt?.voice.captureState==="error"?"error":El?null:jn&&(!jn.reachable||!jn.healthy)||$e&&(!$e.brokerReachable||!$e.brokerHealthy)?"warning":null,[jn,El,wt?.voice.captureState,$e,ge]),Rl=Pa==="error"?"Logs · attention required":Pa==="warning"?"Logs · check runtime warnings":"Logs",sc=BC(new Date),En=[];ht.overview&&En.push({id:"overview",icon:a.jsx(zp,{size:16,strokeWidth:1.5}),title:"Overview"}),ht.inbox&&En.push({id:"inbox",icon:a.jsx(IN,{size:16,strokeWidth:1.5}),title:"Inbox",badgeCount:Ia>0?Ia:void 0}),ht.relay&&En.push({id:"messages",icon:a.jsx(Bl,{size:16,strokeWidth:1.5}),title:"Messages"}),ht.activity&&En.push({id:"activity",icon:a.jsx(ep,{size:16,strokeWidth:1.5}),title:"Activity Monitor"}),ht.machines&&En.push({id:"machines",icon:a.jsx(_1,{size:16,strokeWidth:1.5}),title:"Machines"}),ht.plans&&En.push({id:"plans",icon:a.jsx(Mp,{size:16,strokeWidth:1.5}),title:"Plans"}),ht.search&&En.push({id:"search",icon:a.jsx(To,{size:16,strokeWidth:1.5}),title:"Search"});const Gl=new Set(En.map(_=>_.id).filter(_=>_!=="overview"));ht.logs&&Gl.add("logs");const Ml=[{id:"profile",label:"General",description:"Local Scout defaults, CLI setup commands, and workspace scanning roots.",icon:a.jsx(xa,{size:15})},{id:"agents",label:"Agents",description:"Select an agent, then edit its runtime, capabilities, and restart controls.",icon:a.jsx(ts,{size:15})},{id:"workspaces",label:"Workspaces",description:"Workspace discovery, repo bindings, and harness readiness.",icon:a.jsx(xa,{size:15})},{id:"communication",label:"Communication",description:"Broker, relay delivery, and live runtime status.",icon:a.jsx(ep,{size:15})}];ht.sessions&&Ml.push({id:"database",label:"Database",description:"Session indexing and storage.",icon:a.jsx(tw,{size:15})}),ht.enableAll&&Ml.push({id:"appearance",label:"Appearance",description:"Visual preferences and display options.",icon:a.jsx(zw,{size:15})});const oc=Ml.find(_=>_.id===_e)??Ml[0];E.useEffect(()=>{if(f!=="relay")return;new Set([...En.map(Z=>Z.id),...ht.relay?["relay","inter-agent","agents"]:[],...ht.sessions?["sessions"]:[],...ht.settings?["settings"]:[],...ht.logs?["logs"]:[]]).has(h)||y(ht.relay?"messages":"overview")},[h,ht.logs,ht.relay,ht.sessions,ht.settings,En,f]),E.useEffect(()=>{Ml.some(_=>_.id===_e)||Fe("profile")},[_e,Ml]);const $r=z.useCallback((_,Z)=>{_.preventDefault(),be.current=Z,document.addEventListener("mousemove",bl),document.addEventListener("mouseup",zl)},[]),cc=z.useCallback(_=>{$r(_,"left-sidebar")},[$r]),$n=z.useCallback(_=>{$r(_,"right-sidebar")},[$r]),bl=z.useCallback(_=>{if(be.current==="left-sidebar"){const Z=_.clientX-48;Z>160&&Z<400&&r(Z);return}if(be.current==="right-sidebar"){const Z=window.innerWidth-_.clientX;Z>280&&Z<520&&o(Z)}},[]),zl=z.useCallback(()=>{be.current=null,document.removeEventListener("mousemove",bl),document.removeEventListener("mouseup",zl)},[bl]);E.useEffect(()=>()=>{document.removeEventListener("mousemove",bl),document.removeEventListener("mouseup",zl)},[bl,zl]);const Ua=async()=>{Se(!0),yn("Refreshing…");try{if(f==="pairing"&&ht.pairing&&(e?.refreshPairingState||e?.getPairingState)){await Ea()&&yn("Pairing refreshed.");return}if(h==="overview")await Promise.all([Ee(),Oe(!I)]);else if(yi&&e?.refreshRelayShellPatch){const _=await e.refreshRelayShellPatch();on(_),ce(null)}else if(q)await tt(!0);else if(rl&&e?.refreshShellState){const _=await e.refreshShellState();W(_),ce(null)}else rl&&await Vt(!0);(h==="settings"||h==="help")&&await _r({preferInventory:h==="settings"&&_e==="workspaces"}),h==="settings"&&_e==="communication"&&await xd(),h==="logs"&&hd(),h==="agents"&&pn&&tc(),yn("Refreshed.")}catch(_){yn(Je(_))}finally{Se(!1)}},Ha=z.useCallback(()=>{if(!(typeof window>"u")){if(Ve(!0),e?.reloadApp){e.reloadApp();return}window.location.reload()}},[e]),Gn=z.useCallback(()=>{p("relay"),y("settings"),Fe("communication"),ot(!0)},[]),Bn=z.useCallback(()=>{(async()=>{try{if(!Wt?.canQuitHost)return;e?.quitApp&&await e.quitApp()}catch(_){zt(Je(_))}})()},[e,Wt]),il=z.useCallback(_=>{or(_),Ra(),L(!0),X("overview"),vn("direct",_)},[Ra,or,vn]),yl=async()=>{if(!e?.toggleVoiceCapture){ce("Desktop bridge is unavailable.");return}try{const _=await e.toggleVoiceCapture();W(_),Q(Z=>Z&&ju(_)),ce(null),yn(_.relay.voice.isCapturing?"Voice capture started.":"Voice capture stopped.")}catch(_){yn(Je(_))}},sl=async _=>{if(!e?.setVoiceRepliesEnabled){ce("Desktop bridge is unavailable.");return}try{const Z=await e.setVoiceRepliesEnabled(_);W(Z),Q(ye=>ye&&ju(Z)),ce(null),yn(_?"Playback enabled.":"Playback disabled.")}catch(Z){yn(Je(Z))}},Ol=_=>{N(_),L(!0),X("history");const Z=Be?.threads.find(ye=>ye.relayDestinationKind==="direct"&&ye.relayDestinationId===_.project)??null;Z&&Os(Z),S(null),y("messages")},Ms=E.useMemo(()=>(Qe?.tasks??[]).filter(_=>_.status==="failed").slice(0,10).map(_=>({id:`task-failed:${_.id}`,kind:"task",tone:"critical",title:_.title,summary:`${_.targetAgentName} reported a failed ask.`,detail:_.statusDetail??_.replyPreview??_.body,meta:[_.project,_.updatedAtLabel,_.ageLabel].filter(Boolean).join(" · ")||_.createdAtLabel,actionLabel:"Open Agent",onAction:()=>il(_.targetAgentId)})),[il,Qe]),Si=E.useMemo(()=>hi.map(_=>({id:`approval:${_.sessionId}:${_.turnId}:${_.blockId}`,kind:"approval",tone:_.risk==="high"?"critical":_.risk==="medium"?"warning":"info",title:_.title,summary:_.description,detail:_.detail,meta:`${_.sessionName} · ${_.risk} risk`,actionLabel:"Open Pairing",onAction:()=>{p("pairing")},onSecondaryAction:()=>{vs(_,"approve")},secondaryActionLabel:"Approve"})),[vs,hi]),zs=E.useMemo(()=>[...Si,...Ms].sort((_,Z)=>{const ye=_t=>_t==="critical"?0:_t==="warning"?1:2;return ye(_.tone)-ye(Z.tone)||_.title.localeCompare(Z.title)}),[Si,Ms]),Os=z.useCallback(_=>{if(ir(_.id),_.kind==="relay"&&_.relayDestinationKind&&_.relayDestinationId){nl(_.relayDestinationKind),ar(_.relayDestinationId);return}if(!_.interAgentThreadId)return;Ns(_.interAgentThreadId);const ye=(Pt.find(_t=>_t.id===_.interAgentThreadId)??null)?.participants.find(_t=>qt.some(ol=>ol.id===_t.id))?.id??null;ye&&(or(ye),Ns(_.interAgentThreadId))},[or,qt,Pt,ar,nl,Ns,ir]),un=_=>{const Z=new Date(_);return`${["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"][Z.getUTCMonth()]} ${Z.getUTCDate()}`},qe={root:{backgroundColor:b.bg,color:b.ink},surface:{backgroundColor:b.surface},border:{borderColor:b.border},topBar:{backgroundColor:b.surface,borderBottomColor:b.border},navBar:{backgroundColor:b.bg,borderRightColor:b.border},sidebar:{backgroundColor:b.bg,borderRightColor:b.border},sectionLabel:{color:b.muted},inkText:{color:b.ink},mutedText:{color:b.muted},tagBadge:{backgroundColor:b.tagBg,borderColor:b.border,color:b.muted},activePill:{backgroundColor:b.accentBg,color:b.accent},activeItem:{backgroundColor:b.surface,borderColor:b.border,color:b.ink},kbd:{backgroundColor:b.surface,borderColor:b.border,color:b.ink},hoverBg:"hover:bg-[var(--os-hover)]",annotBadge:{backgroundColor:b.tagBg,borderColor:b.border,color:b.muted}},xt=(_,Z,ye)=>{const _t=gl[_]??(Hl?.command===_?Hl:null);return a.jsx(QA,{command:_,commandLine:Z,running:ye,commandResult:_t,visibleAppSettings:Ht,onboardingCopiedCommand:Fl,onboardingCommandPending:el,onboardingContextRoot:Hn,onCopyOnboardingCommand:Ho,onRunOnboardingCommand:lr})},Yl=Vz({activeView:h,setActiveView:y,settingsSection:_e,setSettingsSection:Fe,settingsAgentId:it,setSettingsAgentId:rt,settingsSections:Ml,activeSettingsMeta:oc,desktopFeatures:ht,stats:cr,runtime:$e,relayState:wt,relayRuntimeBooting:El,relayRuntimeHealthLabel:_n,reachableRelayAgentCount:Rs,dark:mt,setDark:ae,showAnnotations:Ce,setShowAnnotations:nt,isCollapsed:u,styles:{surface:qe.surface,inkText:qe.inkText,mutedText:qe.mutedText,tagBadge:qe.tagBadge,activePill:qe.activePill},scoutDesktop:e,surfaceCaps:Wt,interAgentAgents:qt,openKnowledgeBase:et,openAgentProfile:il,openDirectConversation:sr,renderOnboardingCommandShell:xt,renderLocalPathValue:ji,settingsOperatorNameRef:we,relayServiceInspectorRef:ze,handleSetVoiceRepliesEnabled:sl,settingsController:er,diagnosticsController:xi,agentController:ks}),kn=qz({activeView:h,setActiveView:y,desktopFeatures:ht,styles:{sidebar:qe.sidebar,surface:qe.surface,inkText:qe.inkText,mutedText:qe.mutedText,tagBadge:qe.tagBadge,activePill:qe.activePill,activeItem:qe.activeItem,annotBadge:qe.annotBadge,kbd:qe.kbd},colorTheme:b,sidebarWidth:l,messagesDetailWidth:i,isCollapsed:u,onResizeStart:cc,onMessagesDetailResizeStart:$n,stats:cr,runtime:$e,shellState:oe,shellError:ge,plansState:Qe,machinesState:ke,messagesState:Be,interAgentState:Qt,interAgentAgents:qt,interAgentAgentLookup:Oa,relayDirectLookup:Es,homeAgents:_a,homeActivity:ic,activityRecentMessages:Vn,activityTasks:Ba,activityLeadTask:Ni,activityFindings:al,activityEndpoints:ki,overviewSessions:zd,inboxAlertCount:Ia,pendingApprovalsCount:hi.length,inboxFailedTaskCount:fr,inboxAwaitingYouItems:zs,availableAgentNames:As,searchQuery:g,setSearchQuery:v,filteredSessions:Rd,selectedSession:A,setSelectedSession:N,isLoadingMessagesWorkspace:B,isLoadingShell:M,showAnnotations:Ce,setShowAnnotations:nt,messagesDetailOpen:R,setMessagesDetailOpen:L,messagesDetailTab:H,setMessagesDetailTab:X,formatDate:un,onRefreshShell:()=>{Ua()},openAgentProfile:il,openSessionDetail:Ol,handleSelectSearchSession:_=>{N(_),y("sessions")},handleToggleVoiceCapture:()=>{yl()},handleSetVoiceRepliesEnabled:_=>{sl(_)},selectMessageThread:Os,renderLocalPathValue:ji,selectedInterAgentActivityMessages:ur,selectedInterAgentInboundTasks:qr,selectedInterAgentOutboundFindings:lc,selectedInterAgentFindings:La,interAgentThreadTitle:dr,selectedInterAgentThreadSubtitle:rc,interAgentConfigureTarget:Da,interAgentConfigureLabel:ac,interAgentMessageTarget:Md,visibleInterAgentMessages:nc,relayVoiceState:wt?.voice,messagesController:xs,agentController:ks,diagnosticsController:xi,phonePreparationController:sd,overviewBootLoader:!Le&&ve&&!I&&!ge?a.jsx(f1,{dark:mt,C:b,s:qe}):null});return Le?a.jsx("div",{className:`min-h-screen w-full font-sans${mt?" dark":""}`,style:{backgroundColor:b.bg,color:b.ink},children:a.jsxs("div",{className:"relative min-h-screen flex items-center justify-center px-6 py-10",children:[a.jsx("div",{className:"absolute top-6 left-6 z-10",children:a.jsxs("button",{type:"button",className:"inline-flex items-center gap-1 rounded-full border px-3 py-1.5 text-[12px] transition-opacity hover:opacity-80",style:{borderColor:b.border,color:b.muted},onClick:Bn,children:[a.jsx(Sl,{size:12}),"Quit"]})}),he&&Ht?a.jsx("div",{className:"w-full max-w-[820px] os-scale-in",children:a.jsxs("div",{className:"rounded-2xl border overflow-hidden",style:{borderColor:b.border,backgroundColor:b.surface,boxShadow:`0 24px 80px ${mt?"rgba(0,0,0,0.4)":"rgba(15,23,42,0.08)"}`},children:[a.jsxs("div",{className:"px-8 pt-8 pb-6 border-b cursor-grab active:cursor-grabbing",style:{borderBottomColor:b.border,WebkitAppRegion:"drag"},children:[a.jsxs("div",{className:"flex items-center justify-between gap-4",children:[a.jsx("div",{className:"text-[11px] font-mono uppercase tracking-[0.22em]",style:qe.mutedText,children:"Scout Setup"}),a.jsx("button",{className:"text-[12px] transition-opacity hover:opacity-70",style:{...qe.mutedText,WebkitAppRegion:"no-drag"},onClick:hs,children:"Skip onboarding"})]}),a.jsx("div",{className:"flex items-center gap-1.5 mt-6",children:$l.map((_,Z)=>{const ye=Z<Fn,_t=Z===Fn;return a.jsx("div",{className:"h-1 flex-1 rounded-full transition-all duration-300",style:{backgroundColor:ye||_t?b.accent:mt?"rgba(255,255,255,0.06)":"rgba(15,23,42,0.06)",opacity:_t?.6:1}},_.id)})}),a.jsxs("div",{className:"flex items-center gap-2 mt-4",children:[a.jsxs("span",{className:"text-[10px] font-mono px-2 py-0.5 rounded-full",style:{backgroundColor:b.accentBg,color:b.accent},children:[Xt.number,"/",$l.length]}),a.jsx("span",{className:"text-[12px] font-medium",style:qe.mutedText,children:Xt.title})]})]}),a.jsxs("div",{className:"px-8 py-8 os-fade-up",children:[a.jsx(XA,{activeOnboardingStep:Xt,visibleAppSettings:Ht,appSettingsSaving:Yt,appSettingsLoading:ka,appSettingsDirty:wa,onboardingCommandPending:el,onboardingHasProjectConfig:fs,sourceRootPathSuggestions:ja,settingsOperatorNameRef:we,setAppSettingsDraft:tr,setAppSettingsFeedback:zt,setIsAppSettingsEditing:ql,handleAddSourceRootRow:ed,handleSetSourceRootAt:ms,handleBrowseForSourceRoot:fi,handleRemoveSourceRootRow:td,handleSetOnboardingContextRoot:Al,handleBrowseForOnboardingContextRoot:ps,handleAddSourceRootSuggestion:Uo,handleRunOnboardingCommand:lr,buildOnboardingCommandLine:$t,renderOnboardingCommandShell:xt,renderLocalPathValue:ji,styles:{inkText:qe.inkText,mutedText:qe.mutedText,activePill:qe.activePill,tagBadge:qe.tagBadge},availableHarnesses:x1}),cn?a.jsx("div",{className:"text-[13px] mt-6 leading-[1.6] os-fade-in",style:qe.inkText,children:cn}):null]},Xt.id),a.jsxs("div",{className:"px-8 py-5 border-t flex items-center justify-between gap-4",style:{borderTopColor:b.border,backgroundColor:b.bg},children:[a.jsx("button",{className:"os-btn flex items-center gap-1 text-[12px] font-medium px-4 py-2.5 rounded-lg border disabled:opacity-40 transition-all",style:{color:b.muted,borderColor:b.border,backgroundColor:"transparent"},onClick:()=>Po(-1),disabled:!ci,children:"Back"}),a.jsxs("div",{className:"text-[11px] font-mono text-center",style:qe.mutedText,children:[Xt.number," of ",$l.length]}),a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx("button",{className:"os-btn flex items-center gap-1 text-[12px] font-medium px-4 py-2.5 rounded-lg transition-all",style:{color:b.muted},onClick:Ir,children:ui?"Skip step":"Finish later"}),a.jsxs("button",{className:"os-btn-primary flex items-center gap-1 text-[12px] font-semibold px-5 py-2.5 rounded-lg disabled:opacity-40 transition-all",style:{backgroundColor:b.accent,color:"#fff"},onClick:Br,disabled:!ui||Yt||ka,children:[Xt.id==="confirm"?Yt?"Confirming…":"Confirm":"Continue",Xt.id==="confirm"?null:a.jsx(_l,{size:12})]})]})]})]})}):a.jsx(f1,{dark:mt,C:b,s:qe})]})}):a.jsxs(a.Fragment,{children:[a.jsx(vA,{dark:mt,setDark:ae,C:b,s:qe,productSurface:f,setProductSurface:p,activeView:h,setActiveView:y,desktopFeatures:ht,pairingSurfaceBadge:id,openRelayDiagnostics:Gn,relayStatusTitle:Vr,relayRuntimeBooting:El,relayStatusDotClassName:Od,relayStatusLabel:wi,runtime:$e,headerAgentCount:mr,appReloadPending:Ne,handleReloadApp:Ha,handleQuitApp:Bn,navViews:En,collapsibleViews:Gl,isCollapsed:u,setIsCollapsed:d,pairingSurfaceProps:{pairingControlPending:ys,pairingConfigFeedback:$o,pairingConfigPending:Aa,pairingError:Vo,pairingLoading:Ur,pairingState:Pr,onControlPairing:rd,onDecideApproval:vs,onOpenFullLogs:()=>{p("relay"),y("logs")},onOpenFeedback:Yo,pairingApprovalPendingId:pi,onUpdateConfig:ad,onRefresh:()=>{Ua()},onRevealPath:_=>{Wt?.canRevealPath&&e?.revealPath?.(_)}},isAgentSessionPeekOpen:ec,selectedInterAgent:qn,visibleAgentSession:Zo,agentSessionPending:Ss,agentSessionLoading:Cs,agentSessionFeedback:Wo,agentSessionCopied:Jo,agentSessionPeekViewportRef:Cd,handlePeekAgentSessionScroll:Td,closeAgentSessionPeek:Sd,handleCopyAgentSessionCommand:()=>{Ed()},handleOpenAgentSession:()=>{Ad()},handleAgentSessionTraceIntent:_=>{Dn(_)},renderLocalPathValue:ji,isCreateAgentDialogOpen:Fr,setIsCreateAgentDialogOpen:kd,agentableProjects:Na,createAgentDraft:Nd,setCreateAgentDraft:wd,createAgentDefaults:Qo,createAgentSubmitting:Xo,createAgentFeedback:Ma,setCreateAgentFeedback:za,handleBrowseCreateAgentProject:gi,handleCreateAgent:Ko,availableAgentHarnesses:x1,isFeedbackDialogOpen:od,handleFeedbackDialogOpenChange:gd,feedbackDraft:js,setFeedbackDraft:fd,feedbackSubmission:md,feedbackActionPending:pd,feedbackBundleLoading:ud,feedbackBundle:cd,feedbackBundleError:dd,feedbackActionMessage:Go,handleSubmitFeedbackReport:()=>{vd()},handleRefreshFeedbackBundle:()=>{bd()},handleRepairSetup:()=>{jd()},handleCopyFeedbackBundle:()=>{yd()},openFeedbackDialog:Yo,openKnowledgeBase:et,logsAttentionLevel:Pa,logsButtonTitle:Rl,footerTimeLabel:sc,children:f==="relay"?a.jsxs(a.Fragment,{children:[a.jsx(NA,{...kn.overviewInboxActivityViewProps}),a.jsx(PA,{...kn.opsViewsProps}),a.jsx(YA,{...Yl}),a.jsx(Tz,{...kn.agentViewsProps}),a.jsx(c6,{...kn.messagesRelayViewProps})]}):null}),a.jsx("div",{className:"pointer-events-none fixed right-4 top-20 z-40",children:a.jsxs("div",{className:"w-[220px] rounded-2xl border px-4 py-3 shadow-[0_18px_48px_rgba(15,23,42,0.12)]",style:{backgroundColor:mt?"rgba(17, 24, 39, 0.9)":"rgba(255,255,255,0.92)",borderColor:b.border,backdropFilter:"blur(10px)"},children:[a.jsxs("div",{className:"flex items-center justify-between gap-3",children:[a.jsx("div",{className:"text-[10px] font-mono uppercase tracking-[0.16em]",style:qe.mutedText,children:"Dev Load Times"}),a.jsx("div",{className:"text-[10px]",style:qe.mutedText,children:"live"})]}),a.jsx("div",{className:"mt-3 space-y-2",children:[{key:"services",title:"Relay health",metric:J.services,loading:Y,idleLabel:"—",idleDetail:"No measurement yet"},{key:"home",title:"Home data",metric:J.home,loading:ve,idleLabel:"—",idleDetail:"No measurement yet"},{key:"workspace",title:"Workspace",metric:J.workspace,loading:q?B:rl&&M,idleLabel:q||rl?"—":"deferred",idleDetail:q||rl?"No measurement yet":"Loads only on workspace-heavy surfaces"}].map(_=>a.jsxs("div",{className:"rounded-xl border px-3 py-2",style:{borderColor:b.border,backgroundColor:mt?"rgba(255,255,255,0.03)":"rgba(15,23,42,0.025)"},children:[a.jsxs("div",{className:"flex items-center justify-between gap-3",children:[a.jsx("div",{className:"text-[11px] font-medium",style:qe.inkText,children:_.title}),a.jsx("div",{className:"text-[11px] font-mono",style:_.loading?{color:b.accent}:qe.inkText,children:_.loading?"loading…":_.metric?`${_.metric.durationMs}ms`:_.idleLabel})]}),a.jsx("div",{className:"mt-1 text-[10px] leading-[1.5]",style:qe.mutedText,children:_.metric?`${_.metric.label} · ${new Date(_.metric.recordedAt).toLocaleTimeString([],{hour:"numeric",minute:"2-digit",second:"2-digit"})}`:_.idleDetail}),_.metric?.detail?a.jsx("div",{className:"mt-2 space-y-1",children:Object.entries(_.metric.detail).slice(0,8).map(([Z,ye])=>a.jsxs("div",{className:"flex items-center justify-between gap-3 text-[10px]",style:qe.mutedText,children:[a.jsx("span",{className:"truncate",children:Z}),a.jsx("span",{className:"font-mono shrink-0",style:qe.inkText,children:String(ye)})]},Z))}):null]},_.key))})]})})]})}const Np=document.getElementById("root");if(!Np)throw new Error("Root element was not found.");const g1=a.jsx(E.StrictMode,{children:a.jsx(TN,{children:a.jsx(S6,{})})}),C6=typeof window<"u"&&Object.prototype.hasOwnProperty.call(window,"__INITIAL_STATE__");C6?yb.hydrateRoot(Np,g1):yb.createRoot(Np).render(g1);