ensemble-plugin 0.1.0 → 0.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,42 +0,0 @@
1
- var e=(e,t)=>()=>(t||(e((t={exports:{}}).exports,t,t.exports),e=null),t.exports);(function(){let e=document.createElement(`link`).relList;if(e&&e.supports&&e.supports(`modulepreload`))return;for(let e of document.querySelectorAll(`link[rel="modulepreload"]`))n(e);new MutationObserver(e=>{for(let t of e)if(t.type===`childList`)for(let e of t.addedNodes)e.tagName===`LINK`&&e.rel===`modulepreload`&&n(e)}).observe(document,{childList:!0,subtree:!0});function t(e){let t={};return e.integrity&&(t.integrity=e.integrity),e.referrerPolicy&&(t.referrerPolicy=e.referrerPolicy),t.credentials=e.crossOrigin===`use-credentials`?`include`:e.crossOrigin===`anonymous`?`omit`:`same-origin`,t}function n(e){if(e.ep)return;e.ep=!0;let n=t(e);fetch(e.href,n)}})();var t=e((e=>{function t(e,t){var n=e.length;e.push(t);a:for(;0<n;){var r=n-1>>>1,a=e[r];if(0<i(a,t))e[r]=t,e[n]=a,n=r;else break a}}function n(e){return e.length===0?null:e[0]}function r(e){if(e.length===0)return null;var t=e[0],n=e.pop();if(n!==t){e[0]=n;a:for(var r=0,a=e.length,o=a>>>1;r<o;){var s=2*(r+1)-1,c=e[s],l=s+1,u=e[l];if(0>i(c,n))l<a&&0>i(u,c)?(e[r]=u,e[l]=n,r=l):(e[r]=c,e[s]=n,r=s);else if(l<a&&0>i(u,n))e[r]=u,e[l]=n,r=l;else break a}}return t}function i(e,t){var n=e.sortIndex-t.sortIndex;return n===0?e.id-t.id:n}if(e.unstable_now=void 0,typeof performance==`object`&&typeof performance.now==`function`){var a=performance;e.unstable_now=function(){return a.now()}}else{var o=Date,s=o.now();e.unstable_now=function(){return o.now()-s}}var c=[],l=[],u=1,d=null,f=3,p=!1,m=!1,h=!1,g=!1,_=typeof setTimeout==`function`?setTimeout:null,v=typeof clearTimeout==`function`?clearTimeout:null,y=typeof setImmediate<`u`?setImmediate:null;function b(e){for(var i=n(l);i!==null;){if(i.callback===null)r(l);else if(i.startTime<=e)r(l),i.sortIndex=i.expirationTime,t(c,i);else break;i=n(l)}}function x(e){if(h=!1,b(e),!m){if(n(c)!==null)m=!0,S||(S=!0,O());else{var t=n(l);t!==null&&te(x,t.startTime-e)}}}var S=!1,C=-1,w=5,T=-1;function E(){return g?!0:!(e.unstable_now()-T<w)}function D(){if(g=!1,S){var t=e.unstable_now();T=t;var i=!0;try{a:{m=!1,h&&(h=!1,v(C),C=-1),p=!0;var a=f;try{b:{for(b(t),d=n(c);d!==null&&!(d.expirationTime>t&&E());){var o=d.callback;if(typeof o==`function`){d.callback=null,f=d.priorityLevel;var s=o(d.expirationTime<=t);if(t=e.unstable_now(),typeof s==`function`){d.callback=s,b(t),i=!0;break b}d===n(c)&&r(c),b(t)}else r(c);d=n(c)}if(d!==null)i=!0;else{var u=n(l);u!==null&&te(x,u.startTime-t),i=!1}}break a}finally{d=null,f=a,p=!1}i=void 0}}finally{i?O():S=!1}}}var O;if(typeof y==`function`)O=function(){y(D)};else if(typeof MessageChannel<`u`){var ee=new MessageChannel,k=ee.port2;ee.port1.onmessage=D,O=function(){k.postMessage(null)}}else O=function(){_(D,0)};function te(t,n){C=_(function(){t(e.unstable_now())},n)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(e){e.callback=null},e.unstable_forceFrameRate=function(e){0>e||125<e?console.error(`forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported`):w=0<e?Math.floor(1e3/e):5},e.unstable_getCurrentPriorityLevel=function(){return f},e.unstable_next=function(e){switch(f){case 1:case 2:case 3:var t=3;break;default:t=f}var n=f;f=t;try{return e()}finally{f=n}},e.unstable_requestPaint=function(){g=!0},e.unstable_runWithPriority=function(e,t){switch(e){case 1:case 2:case 3:case 4:case 5:break;default:e=3}var n=f;f=e;try{return t()}finally{f=n}},e.unstable_scheduleCallback=function(r,i,a){var o=e.unstable_now();switch(typeof a==`object`&&a?(a=a.delay,a=typeof a==`number`&&0<a?o+a:o):a=o,r){case 1:var s=-1;break;case 2:s=250;break;case 5:s=1073741823;break;case 4:s=1e4;break;default:s=5e3}return s=a+s,r={id:u++,callback:i,priorityLevel:r,startTime:a,expirationTime:s,sortIndex:-1},a>o?(r.sortIndex=a,t(l,r),n(c)===null&&r===n(l)&&(h?(v(C),C=-1):h=!0,te(x,a-o))):(r.sortIndex=s,t(c,r),m||p||(m=!0,S||(S=!0,O()))),r},e.unstable_shouldYield=E,e.unstable_wrapCallback=function(e){var t=f;return function(){var n=f;f=t;try{return e.apply(this,arguments)}finally{f=n}}}})),n=e(((e,n)=>{n.exports=t()})),r=e((e=>{var t=Symbol.for(`react.transitional.element`),n=Symbol.for(`react.portal`),r=Symbol.for(`react.fragment`),i=Symbol.for(`react.strict_mode`),a=Symbol.for(`react.profiler`),o=Symbol.for(`react.consumer`),s=Symbol.for(`react.context`),c=Symbol.for(`react.forward_ref`),l=Symbol.for(`react.suspense`),u=Symbol.for(`react.memo`),d=Symbol.for(`react.lazy`),f=Symbol.for(`react.activity`),p=Symbol.for(`react.view_transition`),m=Symbol.iterator;function h(e){return typeof e!=`object`||!e?null:(e=m&&e[m]||e[`@@iterator`],typeof e==`function`?e:null)}var g={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},_=Object.assign,v={};function y(e,t,n){this.props=e,this.context=t,this.refs=v,this.updater=n||g}y.prototype.isReactComponent={},y.prototype.setState=function(e,t){if(typeof e!=`object`&&typeof e!=`function`&&e!=null)throw Error(`takes an object of state variables to update or a function which returns an object of state variables.`);this.updater.enqueueSetState(this,e,t,`setState`)},y.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,`forceUpdate`)};function b(){}b.prototype=y.prototype;function x(e,t,n){this.props=e,this.context=t,this.refs=v,this.updater=n||g}var S=x.prototype=new b;S.constructor=x,_(S,y.prototype),S.isPureReactComponent=!0;var C=Array.isArray;function w(){}var T={H:null,A:null,T:null,S:null},E=Object.prototype.hasOwnProperty;function D(e,n,r){var i=r.ref;return{$$typeof:t,type:e,key:n,ref:i===void 0?null:i,props:r}}function O(e,t){return D(e.type,t,e.props)}function ee(e){return typeof e==`object`&&!!e&&e.$$typeof===t}function k(e){var t={"=":`=0`,":":`=2`};return`$`+e.replace(/[=:]/g,function(e){return t[e]})}var te=/\/+/g;function ne(e,t){return typeof e==`object`&&e&&e.key!=null?k(``+e.key):t.toString(36)}function re(e){switch(e.status){case`fulfilled`:return e.value;case`rejected`:throw e.reason;default:switch(typeof e.status==`string`?e.then(w,w):(e.status=`pending`,e.then(function(t){e.status===`pending`&&(e.status=`fulfilled`,e.value=t)},function(t){e.status===`pending`&&(e.status=`rejected`,e.reason=t)})),e.status){case`fulfilled`:return e.value;case`rejected`:throw e.reason}}throw e}function ie(e,r,i,a,o){var s=typeof e;(s===`undefined`||s===`boolean`)&&(e=null);var c=!1;if(e===null)c=!0;else switch(s){case`bigint`:case`string`:case`number`:c=!0;break;case`object`:switch(e.$$typeof){case t:case n:c=!0;break;case d:return c=e._init,ie(c(e._payload),r,i,a,o)}}if(c)return o=o(e),c=a===``?`.`+ne(e,0):a,C(o)?(i=``,c!=null&&(i=c.replace(te,`$&/`)+`/`),ie(o,r,i,``,function(e){return e})):o!=null&&(ee(o)&&(o=O(o,i+(o.key==null||e&&e.key===o.key?``:(``+o.key).replace(te,`$&/`)+`/`)+c)),r.push(o)),1;c=0;var l=a===``?`.`:a+`:`;if(C(e))for(var u=0;u<e.length;u++)a=e[u],s=l+ne(a,u),c+=ie(a,r,i,s,o);else if(u=h(e),typeof u==`function`)for(e=u.call(e),u=0;!(a=e.next()).done;)a=a.value,s=l+ne(a,u++),c+=ie(a,r,i,s,o);else if(s===`object`){if(typeof e.then==`function`)return ie(re(e),r,i,a,o);throw r=String(e),Error(`Objects are not valid as a React child (found: `+(r===`[object Object]`?`object with keys {`+Object.keys(e).join(`, `)+`}`:r)+`). If you meant to render a collection of children, use an array instead.`)}return c}function ae(e,t,n){if(e==null)return e;var r=[],i=0;return ie(e,r,``,``,function(e){return t.call(n,e,i++)}),r}function oe(e){if(e._status===-1){var t=e._result,n=t();n.then(function(t){(e._status===0||e._status===-1)&&(e._status=1,e._result=t,n.status===void 0&&(n.status=`fulfilled`,n.value=t))},function(t){(e._status===0||e._status===-1)&&(e._status=2,e._result=t,n.status===void 0&&(n.status=`rejected`,n.reason=t))}),e._status===-1&&(e._status=0,e._result=n)}if(e._status===1)return e._result.default;throw e._result}var se=typeof reportError==`function`?reportError:function(e){if(typeof window==`object`&&typeof window.ErrorEvent==`function`){var t=new window.ErrorEvent(`error`,{bubbles:!0,cancelable:!0,message:typeof e==`object`&&e&&typeof e.message==`string`?String(e.message):String(e),error:e});if(!window.dispatchEvent(t))return}else if(typeof process==`object`&&typeof process.emit==`function`){process.emit(`uncaughtException`,e);return}console.error(e)};function ce(e){var t=T.T,n={};n.types=t===null?null:t.types,T.T=n;try{var r=e(),i=T.S;i!==null&&i(n,r),typeof r==`object`&&r&&typeof r.then==`function`&&r.then(w,se)}catch(e){se(e)}finally{t!==null&&n.types!==null&&(t.types=n.types),T.T=t}}function le(e){var t=T.T;if(t!==null){var n=t.types;n===null?t.types=[e]:n.indexOf(e)===-1&&n.push(e)}else ce(le.bind(null,e))}var ue={map:ae,forEach:function(e,t,n){ae(e,function(){t.apply(this,arguments)},n)},count:function(e){var t=0;return ae(e,function(){t++}),t},toArray:function(e){return ae(e,function(e){return e})||[]},only:function(e){if(!ee(e))throw Error(`React.Children.only expected to receive a single React element child.`);return e}};e.Activity=f,e.Children=ue,e.Component=y,e.Fragment=r,e.Profiler=a,e.PureComponent=x,e.StrictMode=i,e.Suspense=l,e.ViewTransition=p,e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=T,e.__COMPILER_RUNTIME={__proto__:null,c:function(e){return T.H.useMemoCache(e)}},e.addTransitionType=le,e.cache=function(e){return function(){return e.apply(null,arguments)}},e.cacheSignal=function(){return null},e.cloneElement=function(e,t,n){if(e==null)throw Error(`The argument must be a React element, but you passed `+e+`.`);var r=_({},e.props),i=e.key;if(t!=null)for(a in t.key!==void 0&&(i=``+t.key),t)!E.call(t,a)||a===`key`||a===`__self`||a===`__source`||a===`ref`&&t.ref===void 0||(r[a]=t[a]);var a=arguments.length-2;if(a===1)r.children=n;else if(1<a){for(var o=Array(a),s=0;s<a;s++)o[s]=arguments[s+2];r.children=o}return D(e.type,i,r)},e.createContext=function(e){return e={$$typeof:s,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null},e.Provider=e,e.Consumer={$$typeof:o,_context:e},e},e.createElement=function(e,t,n){var r,i={},a=null;if(t!=null)for(r in t.key!==void 0&&(a=``+t.key),t)E.call(t,r)&&r!==`key`&&r!==`__self`&&r!==`__source`&&(i[r]=t[r]);var o=arguments.length-2;if(o===1)i.children=n;else if(1<o){for(var s=Array(o),c=0;c<o;c++)s[c]=arguments[c+2];i.children=s}if(e&&e.defaultProps)for(r in o=e.defaultProps,o)i[r]===void 0&&(i[r]=o[r]);return D(e,a,i)},e.createRef=function(){return{current:null}},e.forwardRef=function(e){return{$$typeof:c,render:e}},e.isValidElement=ee,e.lazy=function(e){return{$$typeof:d,_payload:{_status:-1,_result:e},_init:oe}},e.memo=function(e,t){return{$$typeof:u,type:e,compare:t===void 0?null:t}},e.startTransition=ce,e.unstable_useCacheRefresh=function(){return T.H.useCacheRefresh()},e.use=function(e){return T.H.use(e)},e.useActionState=function(e,t,n){return T.H.useActionState(e,t,n)},e.useCallback=function(e,t){return T.H.useCallback(e,t)},e.useContext=function(e){return T.H.useContext(e)},e.useDebugValue=function(){},e.useDeferredValue=function(e,t){return T.H.useDeferredValue(e,t)},e.useEffect=function(e,t){return T.H.useEffect(e,t)},e.useEffectEvent=function(e){return T.H.useEffectEvent(e)},e.useId=function(){return T.H.useId()},e.useImperativeHandle=function(e,t,n){return T.H.useImperativeHandle(e,t,n)},e.useInsertionEffect=function(e,t){return T.H.useInsertionEffect(e,t)},e.useLayoutEffect=function(e,t){return T.H.useLayoutEffect(e,t)},e.useMemo=function(e,t){return T.H.useMemo(e,t)},e.useOptimistic=function(e,t){return T.H.useOptimistic(e,t)},e.useReducer=function(e,t,n){return T.H.useReducer(e,t,n)},e.useRef=function(e){return T.H.useRef(e)},e.useState=function(e){return T.H.useState(e)},e.useSyncExternalStore=function(e,t,n){return T.H.useSyncExternalStore(e,t,n)},e.useTransition=function(){return T.H.useTransition()},e.version=`19.3.1`})),i=e(((e,t)=>{t.exports=r()})),a=e((e=>{var t=i();function n(e){var t=`https://react.dev/errors/`+e;if(1<arguments.length){t+=`?args[]=`+encodeURIComponent(arguments[1]);for(var n=2;n<arguments.length;n++)t+=`&args[]=`+encodeURIComponent(arguments[n])}return`Minified React error #`+e+`; visit `+t+` for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`}function r(){}var a={d:{f:r,r:function(){throw Error(n(522))},D:r,C:r,L:r,m:r,X:r,S:r,M:r},p:0,findDOMNode:null},o=Symbol.for(`react.portal`),s=Symbol.for(`react.recoverable`),c=Symbol.for(`react.optimistic_key`);function l(e,t,n){var r=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:o,key:r==null?null:r===c?c:``+r,children:e,containerInfo:t,implementation:n}}var u=t.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function d(e,t){if(e===`font`)return``;if(typeof t==`string`)return t===`use-credentials`?t:``}e.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=a,e.browser=function(e){return{$$typeof:s,_reason:e}},e.createPortal=function(e,t){var r=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!t||t.nodeType!==1&&t.nodeType!==9&&t.nodeType!==11)throw Error(n(299));return l(e,t,null,r)},e.flushSync=function(e){var t=u.T,n=a.p;try{if(u.T=null,a.p=2,e)return e()}finally{u.T=t,a.p=n,a.d.f()}},e.preconnect=function(e,t){typeof e==`string`&&(t?(t=t.crossOrigin,t=typeof t==`string`?t===`use-credentials`?t:``:void 0):t=null,a.d.C(e,t))},e.prefetchDNS=function(e){typeof e==`string`&&a.d.D(e)},e.preinit=function(e,t){if(typeof e==`string`&&t&&typeof t.as==`string`){var n=t.as,r=d(n,t.crossOrigin),i=typeof t.integrity==`string`?t.integrity:void 0,o=typeof t.fetchPriority==`string`?t.fetchPriority:void 0;n===`style`?a.d.S(e,typeof t.precedence==`string`?t.precedence:void 0,{crossOrigin:r,integrity:i,fetchPriority:o}):n===`script`&&a.d.X(e,{crossOrigin:r,integrity:i,fetchPriority:o,nonce:typeof t.nonce==`string`?t.nonce:void 0})}},e.preinitModule=function(e,t){if(typeof e==`string`){if(typeof t==`object`&&t){if(t.as==null||t.as===`script`){var n=d(t.as,t.crossOrigin);a.d.M(e,{crossOrigin:n,integrity:typeof t.integrity==`string`?t.integrity:void 0,nonce:typeof t.nonce==`string`?t.nonce:void 0,fetchPriority:typeof t.fetchPriority==`string`?t.fetchPriority:void 0})}}else t??a.d.M(e)}},e.preload=function(e,t){if(typeof e==`string`&&typeof t==`object`&&t&&typeof t.as==`string`){var n=t.as,r=d(n,t.crossOrigin);a.d.L(e,n,{crossOrigin:r,integrity:typeof t.integrity==`string`?t.integrity:void 0,nonce:typeof t.nonce==`string`?t.nonce:void 0,type:typeof t.type==`string`?t.type:void 0,fetchPriority:typeof t.fetchPriority==`string`?t.fetchPriority:void 0,referrerPolicy:typeof t.referrerPolicy==`string`?t.referrerPolicy:void 0,imageSrcSet:typeof t.imageSrcSet==`string`?t.imageSrcSet:void 0,imageSizes:typeof t.imageSizes==`string`?t.imageSizes:void 0,media:typeof t.media==`string`?t.media:void 0})}},e.preloadModule=function(e,t){if(typeof e==`string`){if(t){var n=d(t.as,t.crossOrigin);a.d.m(e,{as:typeof t.as==`string`&&t.as!==`script`?t.as:void 0,crossOrigin:n,integrity:typeof t.integrity==`string`?t.integrity:void 0,nonce:typeof t.nonce==`string`?t.nonce:void 0,fetchPriority:typeof t.fetchPriority==`string`?t.fetchPriority:void 0})}else a.d.m(e)}},e.requestFormReset=function(e){a.d.r(e)},e.unstable_batchedUpdates=function(e,t){return e(t)},e.useFormState=function(e,t,n){return u.H.useFormState(e,t,n)},e.useFormStatus=function(){return u.H.useHostTransitionStatus()},e.version=`19.3.1`})),o=e(((e,t)=>{function n(){if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<`u`&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE==`function`)try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(n)}catch(e){console.error(e)}}n(),t.exports=a()})),s=e((e=>{var t=n(),r=i(),a=o();function s(e){var t=`https://react.dev/errors/`+e;if(1<arguments.length){t+=`?args[]=`+encodeURIComponent(arguments[1]);for(var n=2;n<arguments.length;n++)t+=`&args[]=`+encodeURIComponent(arguments[n])}return`Minified React error #`+e+`; visit `+t+` for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`}function c(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function l(e){for(var t=e,n=t;n&&!n.alternate;)t=n,t.flags&4098&&(e=t.return),n=t.return;for(;t.return;)t=t.return;return t.tag===3?e:null}function u(e){if(e.tag===13){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function d(e){if(e.tag===31){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function f(e){if(l(e)!==e)throw Error(s(188))}function p(e){var t=e.alternate;if(!t){if(t=l(e),t===null)throw Error(s(188));return t===e?e:null}for(var n=e,r=t;;){var i=n.return;if(i===null)break;var a=i.alternate;if(a===null){if(r=i.return,r!==null){n=r;continue}break}if(i.child===a.child){for(a=i.child;a;){if(a===n)return f(i),e;if(a===r)return f(i),t;a=a.sibling}throw Error(s(188))}if(n.return!==r.return)n=i,r=a;else{for(var o=!1,c=i.child;c;){if(c===n){o=!0,n=i,r=a;break}if(c===r){o=!0,r=i,n=a;break}c=c.sibling}if(!o){for(c=a.child;c;){if(c===n){o=!0,n=a,r=i;break}if(c===r){o=!0,r=a,n=i;break}c=c.sibling}if(!o)throw Error(s(189))}}if(n.alternate!==r)throw Error(s(190))}if(n.tag!==3)throw Error(s(188));return n.stateNode.current===n?e:t}function m(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e;for(e=e.child;e!==null;){if(t=m(e),t!==null)return t;e=e.sibling}return null}function h(e,t,n,r,i,a){for(;e!==null;){if((e.tag===5||e.tag===27||e.tag===6)&&n(e,r,i,a)||(e.tag!==22||e.memoizedState===null)&&(t||e.tag!==5&&e.tag!==27)&&h(e.child,t,n,r,i,a))return!0;e=e.sibling}return!1}function g(e){for(e=e.return;e!==null;){if(e.tag===3||e.tag===5||e.tag===27)return e;e=e.return}return null}function _(e){var t=!1;for(e=e.return;e!==null&&(e.tag===4&&(t=!0),e.tag!==3&&e.tag!==5&&e.tag!==27);)e=e.return;return t}function v(e){var t=[null,null],n=g(e);return n===null||y(t,e,n.child,{foundSelf:!1}),t}function y(e,t,n,r){for(;n!==null;){if(n===t)r.foundSelf=!0;else if(n.tag===5||n.tag===27||n.tag===6){if(r.foundSelf)return e[1]=n,!0;e[0]=n}else if((n.tag!==22||n.memoizedState===null)&&y(e,t,n.child,r))return!0;n=n.sibling}return!1}function b(e){switch(e.tag){case 5:case 27:case 6:return e.stateNode;case 3:return e.stateNode.containerInfo;default:throw Error(s(559))}}var x=null,S=null;function C(e,t,n){return e===n||e===t&&(x=e,!0)}function w(e,t,n){return e===n?(S=e,!1):e===t&&(S!==null&&(x=e),!0)}function T(e){if(e===null)return null;do e=e===null?null:e.return;while(e&&e.tag!==5&&e.tag!==27&&e.tag!==3);return e||null}function E(e,t,n){for(var r=0,i=e;i;i=n(i))r++;i=0;for(var a=t;a;a=n(a))i++;for(;0<r-i;)e=n(e),r--;for(;0<i-r;)t=n(t),i--;for(;r--;){if(e===t||t!==null&&e===t.alternate)return e;e=n(e),t=n(t)}return null}var D=Object.assign,O=Symbol.for(`react.element`),ee=Symbol.for(`react.transitional.element`),k=Symbol.for(`react.portal`),te=Symbol.for(`react.fragment`),ne=Symbol.for(`react.strict_mode`),re=Symbol.for(`react.profiler`),ie=Symbol.for(`react.consumer`),ae=Symbol.for(`react.context`),oe=Symbol.for(`react.forward_ref`),se=Symbol.for(`react.suspense`),ce=Symbol.for(`react.suspense_list`),le=Symbol.for(`react.memo`),ue=Symbol.for(`react.lazy`),de=Symbol.for(`react.activity`),fe=Symbol.for(`react.legacy_hidden`),pe=Symbol.for(`react.memo_cache_sentinel`),me=Symbol.for(`react.view_transition`),he=Symbol.for(`react.recoverable`),ge=Symbol.iterator;function _e(e){return typeof e!=`object`||!e?null:(e=ge&&e[ge]||e[`@@iterator`],typeof e==`function`?e:null)}var ve=Symbol.for(`react.client.reference`);function ye(e){if(e==null)return null;if(typeof e==`function`)return e.$$typeof===ve?null:e.displayName||e.name||null;if(typeof e==`string`)return e;switch(e){case te:return`Fragment`;case re:return`Profiler`;case ne:return`StrictMode`;case se:return`Suspense`;case ce:return`SuspenseList`;case de:return`Activity`;case me:return`ViewTransition`}if(typeof e==`object`)switch(e.$$typeof){case k:return`Portal`;case ae:return e.displayName||`Context`;case ie:return(e._context.displayName||`Context`)+`.Consumer`;case oe:var t=e.render;return e=e.displayName,e||=(e=t.displayName||t.name||``,e===``?`ForwardRef`:`ForwardRef(`+e+`)`),e;case le:return t=e.displayName||null,t===null?ye(e.type)||`Memo`:t;case ue:t=e._payload,e=e._init;try{return ye(e(t))}catch{}}return null}var be=Array.isArray,A=r.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,j=a.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,xe={pending:!1,data:null,method:null,action:null},Se=[],Ce=-1;function we(e){return{current:e}}function Te(e){0>Ce||(e.current=Se[Ce],Se[Ce]=null,Ce--)}function M(e,t){Ce++,Se[Ce]=e.current,e.current=t}var Ee=we(null),De=we(null),Oe=we(null),ke=we(null);function Ae(e,t){switch(M(Oe,t),M(De,e),M(Ee,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?up(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=up(t),e=dp(t,e);else switch(e){case`svg`:e=1;break;case`math`:e=2;break;default:e=0}}Te(Ee),M(Ee,e)}function je(){Te(Ee),Te(De),Te(Oe)}function Me(e){var t=e.memoizedState;t!==null&&(sh._currentValue=t.memoizedState,M(ke,e)),t=Ee.current;var n=dp(t,e.type);t!==n&&(M(De,e),M(Ee,n))}function Ne(e){De.current===e&&(Te(Ee),Te(De)),ke.current===e&&(Te(ke),sh._currentValue=xe)}var Pe,Fe;function Ie(e){if(Pe===void 0)try{throw Error()}catch(e){var t=e.stack.trim().match(/\n( *(at )?)/);Pe=t&&t[1]||``,Fe=-1<e.stack.indexOf(`
2
- at`)?` (<anonymous>)`:-1<e.stack.indexOf(`@`)?`@unknown:0:0`:``}return`
3
- `+Pe+e+Fe}var Le=!1;function Re(e,t){if(!e||Le)return``;Le=!0;var n=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var r={DetermineComponentFrameRoot:function(){try{if(t){var n=function(){throw Error()};if(Object.defineProperty(n.prototype,"props",{set:function(){throw Error()}}),typeof Reflect==`object`&&Reflect.construct){try{Reflect.construct(n,[])}catch(e){var r=e}Reflect.construct(e,[],n)}else{try{n.call()}catch(e){r=e}n=!1;try{var i=Object.getOwnPropertyDescriptor(e.prototype,`props`);Object.defineProperty(e.prototype,"props",{configurable:!0,set:function(){throw Error()}}),n=!0,new e}finally{n&&(i===void 0?delete e.prototype.props:Object.defineProperty(e.prototype,"props",i))}}}else{try{throw Error()}catch(e){r=e}(n=e())&&typeof n.catch==`function`&&n.catch(function(){})}}catch(e){if(e&&r&&typeof e.stack==`string`)return[e.stack,r.stack]}return[null,null]}};r.DetermineComponentFrameRoot.displayName=`DetermineComponentFrameRoot`;var i=Object.getOwnPropertyDescriptor(r.DetermineComponentFrameRoot,`name`);i&&i.configurable&&Object.defineProperty(r.DetermineComponentFrameRoot,"name",{value:`DetermineComponentFrameRoot`});var a=r.DetermineComponentFrameRoot(),o=a[0],s=a[1];if(o&&s){var c=o.split(`
4
- `),l=s.split(`
5
- `);for(i=r=0;r<c.length&&!c[r].includes(`DetermineComponentFrameRoot`);)r++;for(;i<l.length&&!l[i].includes(`DetermineComponentFrameRoot`);)i++;if(r===c.length||i===l.length)for(r=c.length-1,i=l.length-1;1<=r&&0<=i&&c[r]!==l[i];)i--;for(;1<=r&&0<=i;r--,i--)if(c[r]!==l[i]){if(r!==1||i!==1)do if(r--,i--,0>i||c[r]!==l[i]){var u=`
6
- `+c[r].replace(` at new `,` at `);return e.displayName&&u.includes(`<anonymous>`)&&(u=u.replace(`<anonymous>`,e.displayName)),u}while(1<=r&&0<=i);break}}}finally{Le=!1,Error.prepareStackTrace=n}return(n=e?e.displayName||e.name:``)?Ie(n):``}function ze(e,t){switch(e.tag){case 26:case 27:case 5:return Ie(e.type);case 16:return Ie(`Lazy`);case 13:return e.child!==t&&t!==null?Ie(`Suspense Fallback`):Ie(`Suspense`);case 19:return Ie(`SuspenseList`);case 0:case 15:return Re(e.type,!1);case 11:return Re(e.type.render,!1);case 1:return Re(e.type,!0);case 31:return Ie(`Activity`);case 30:return Ie(`ViewTransition`);default:return``}}function N(e){try{var t=``,n=null;do t+=ze(e,n),n=e,e=e.return;while(e);return t}catch(e){return`
7
- Error generating stack: `+e.message+`
8
- `+e.stack}}var Be=Object.prototype.hasOwnProperty,Ve=t.unstable_scheduleCallback,He=t.unstable_cancelCallback,Ue=t.unstable_shouldYield,We=t.unstable_requestPaint,Ge=t.unstable_now,Ke=t.unstable_getCurrentPriorityLevel,qe=t.unstable_ImmediatePriority,Je=t.unstable_UserBlockingPriority,Ye=t.unstable_NormalPriority,Xe=t.unstable_LowPriority,Ze=t.unstable_IdlePriority,Qe=t.log,$e=t.unstable_setDisableYieldValue,P=null,F=null;function et(e){if(typeof Qe==`function`&&$e(e),F&&typeof F.setStrictMode==`function`)try{F.setStrictMode(P,e)}catch{}}var tt=Math.clz32?Math.clz32:it,nt=Math.log,rt=Math.LN2;function it(e){return e>>>=0,e===0?32:31-(nt(e)/rt|0)|0}var at=256,ot=262144,I=4194304;function st(e){var t=e&42;if(t!==0)return t;switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return e&-e;case 262144:case 524288:case 1048576:case 2097152:return e&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return e&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return e}}function ct(e,t,n){var r=e.pendingLanes;if(r===0)return 0;var i=0,a=e.suspendedLanes,o=e.pingedLanes;e=e.warmLanes;var s=r&134217727;return s===0?(s=r&~a,s===0?o===0?n||(n=r&~e,n!==0&&(i=st(n))):i=st(o):i=st(s)):(r=s&~a,r===0?(o&=s,o===0?n||(n=s&~e,n!==0&&(i=st(n))):i=st(o)):i=st(r)),i===0?0:t!==0&&t!==i&&(t&a)===0&&(a=i&-i,n=t&-t,a>=n||a===32&&n&4194048)?t:i}function lt(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function ut(e,t){t&8&&(t|=t&32);var n=e.entangledLanes;if(n!==0)for(e=e.entanglements,n&=t;0<n;){var r=31-tt(n),i=1<<r;t|=e[r],n&=~i}return t}function dt(e,t){switch(e){case 1:case 2:case 4:case 8:case 64:return t+250;case 16:case 32:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return t+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function ft(){var e=I;return I<<=1,!(I&62914560)&&(I=4194304),e}function pt(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function mt(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function ht(e,t,n,r,i,a){var o=e.pendingLanes;e.pendingLanes=n,e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0,e.expiredLanes&=n,e.entangledLanes&=n,e.errorRecoveryDisabledLanes&=n,e.shellSuspendCounter=0;var s=e.entanglements,c=e.expirationTimes,l=e.hiddenUpdates;for(n=o&~n;0<n;){var u=31-tt(n),d=1<<u;s[u]=0,c[u]=-1;var f=l[u];if(f!==null)for(l[u]=null,u=0;u<f.length;u++){var p=f[u];p!==null&&(p.lane&=-536870913)}n&=~d}r!==0&&gt(e,r,0),a!==0&&i===0&&e.tag!==0&&(e.suspendedLanes|=a&~(o&~t))}function gt(e,t,n){e.pendingLanes|=t,e.suspendedLanes&=~t;var r=31-tt(t);e.entangledLanes|=t,e.entanglements[r]=e.entanglements[r]|1073741824|n&261930}function _t(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var r=31-tt(n),i=1<<r;i&t|e[r]&t&&(e[r]|=t),n&=~i}}function vt(e,t){var n=t&-t;return n=n&42?1:yt(n),(n&(e.suspendedLanes|t))===0?n:0}function yt(e){switch(e){case 2:e=1;break;case 8:e=4;break;case 32:e=16;break;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:e=128;break;case 268435456:e=134217728;break;default:e=0}return e}function bt(e){return e&=-e,2<e?8<e?e&134217727?32:268435456:8:2}function xt(){var e=j.p;return e===0?(e=window.event,e===void 0?32:Ch(e.type)):e}function St(e,t){var n=j.p;try{return j.p=e,t()}finally{j.p=n}}var Ct=Math.random().toString(36).slice(2),wt=`__reactFiber$`+Ct,Tt=`__reactProps$`+Ct,Et=`__reactContainer$`+Ct,Dt=`__reactEvents$`+Ct,Ot=`__reactListeners$`+Ct,kt=`__reactHandles$`+Ct,At=`__reactResources$`+Ct,jt=`__reactMarker$`+Ct,Mt=`__reactLoad$`+Ct;function Nt(e){delete e[wt],delete e[Tt],delete e[Ot],delete e[kt]}function Pt(e){var t;if(t=e[wt])return t;for(var n=e.parentNode;n;){if(t=n[Et]||n[wt]){if(n=t.alternate,t.child!==null||n!==null&&n.child!==null)for(e=fm(e);e!==null;){if(n=e[wt])return n;e=fm(e)}return t}e=n,n=e.parentNode}return null}function Ft(e){if(e=e[wt]||e[Et]){var t=e.tag;if(t===5||t===6||t===13||t===31||t===26||t===27||t===3)return e}return null}function It(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e.stateNode;throw Error(s(33))}function Lt(e){var t=e[At];return t||=e[At]={hoistableStyles:new Map,hoistableScripts:new Map},t}function Rt(e){e[jt]=!0}function zt(e){e[Mt]=void 0}var Bt=new Set,Vt={};function Ht(e,t){Ut(e,t),Ut(e+`Capture`,t)}function Ut(e,t){for(Vt[e]=t,e=0;e<t.length;e++)Bt.add(t[e])}var Wt=RegExp(`^[:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD][:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD\\-.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040]*$`),Gt={},L={};function Kt(e){return Be.call(L,e)?!0:Be.call(Gt,e)?!1:Wt.test(e)?L[e]=!0:(Gt[e]=!0,!1)}var R=!1;function qt(){var e=R;return R=!1,e}function Jt(e,t,n){if(Kt(t)){if(n===null)e.removeAttribute(t);else{switch(typeof n){case`undefined`:case`function`:case`symbol`:e.removeAttribute(t);return;case`boolean`:var r=t.toLowerCase().slice(0,5);if(r!==`data-`&&r!==`aria-`){e.removeAttribute(t);return}}e.setAttribute(t,n)}}}function Yt(e,t,n){if(n===null)e.removeAttribute(t);else{switch(typeof n){case`undefined`:case`function`:case`symbol`:case`boolean`:e.removeAttribute(t);return}e.setAttribute(t,n)}}function Xt(e,t,n,r){if(r===null)e.removeAttribute(n);else{switch(typeof r){case`undefined`:case`function`:case`symbol`:case`boolean`:e.removeAttribute(n);return}e.setAttributeNS(t,n,r)}}function Zt(e){switch(typeof e){case`bigint`:case`boolean`:case`number`:case`string`:case`undefined`:return e;case`object`:return e;default:return``}}function Qt(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()===`input`&&(t===`checkbox`||t===`radio`)}function $t(e,t,n){var r=Object.getOwnPropertyDescriptor(e.constructor.prototype,t);if(!e.hasOwnProperty(t)&&r!==void 0&&typeof r.get==`function`&&typeof r.set==`function`){var i=r.get,a=r.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return i.call(this)},set:function(e){n=``+e,a.call(this,e)}}),Object.defineProperty(e,t,{enumerable:r.enumerable}),{getValue:function(){return n},setValue:function(e){n=``+e},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function en(e){if(!e._valueTracker){var t=Qt(e)?`checked`:`value`;e._valueTracker=$t(e,t,``+e[t])}}function tn(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r=``;return e&&(r=Qt(e)?e.checked?`true`:`false`:e.value),e=r,e!==n&&(t.setValue(e),!0)}var nn=/[\n"\\]/g;function rn(e){return e.replace(nn,function(e){return`\\`+e.charCodeAt(0).toString(16)+` `})}function an(e,t,n,r,i,a,o,s){e.name=``,o!=null&&typeof o!=`function`&&typeof o!=`symbol`&&typeof o!=`boolean`?e.type=o:e.removeAttribute(`type`),t==null?o!==`submit`&&o!==`reset`||e.removeAttribute(`value`):o===`number`?(t===0&&e.value===``||e.value!=t)&&(e.value=``+Zt(t)):e.value!==``+Zt(t)&&(e.value=``+Zt(t)),t==null?n==null?r!=null&&e.removeAttribute(`value`):sn(e,Zt(n)):o===`number`&&e.value==t?sn(e,Zt(e.value)):sn(e,Zt(t)),i==null&&a!=null&&(e.defaultChecked=!!a),i!=null&&(e.checked=i&&typeof i!=`function`&&typeof i!=`symbol`),s!=null&&typeof s!=`function`&&typeof s!=`symbol`&&typeof s!=`boolean`?e.name=``+Zt(s):e.removeAttribute(`name`)}function on(e,t,n,r,i,a,o,s){if(a!=null&&typeof a!=`function`&&typeof a!=`symbol`&&typeof a!=`boolean`&&(e.type=a),t!=null||n!=null){if(!(a!==`submit`&&a!==`reset`||t!=null)){en(e);return}n=n==null?``:``+Zt(n),t=t==null?n:``+Zt(t),s||t===e.value||(e.value=t),e.defaultValue=t}r??=i,r=typeof r!=`function`&&typeof r!=`symbol`&&!!r,e.checked=s?e.checked:!!r,e.defaultChecked=!!r,o!=null&&typeof o!=`function`&&typeof o!=`symbol`&&typeof o!=`boolean`&&(e.name=o),en(e)}function sn(e,t){e.defaultValue!==``+t&&(e.defaultValue=``+t)}function cn(e,t,n,r){if(e=e.options,t){t={};for(var i=0;i<n.length;i++)t[`$`+n[i]]=!0;for(n=0;n<e.length;n++)i=t.hasOwnProperty(`$`+e[n].value),e[n].selected!==i&&(e[n].selected=i),i&&r&&(e[n].defaultSelected=!0)}else{for(n=``+Zt(n),t=null,i=0;i<e.length;i++){if(e[i].value===n){e[i].selected=!0,r&&(e[i].defaultSelected=!0);return}t!==null||e[i].disabled||(t=e[i])}t!==null&&(t.selected=!0)}}function ln(e,t,n){t!=null&&(t=``+Zt(t),t!==e.value&&(e.value=t),n==null)?e.defaultValue!==t&&(e.defaultValue=t):e.defaultValue=n==null?``:``+Zt(n)}function un(e,t,n,r){if(t==null){if(r!=null){if(n!=null)throw Error(s(92));if(be(r)){if(1<r.length)throw Error(s(93));r=r[0]}n=r}n??=``,t=n}n=Zt(t),e.defaultValue=n,r=e.textContent,r===n&&r!==``&&r!==null&&(e.value=r),en(e)}function dn(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var fn=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 pn(e,t,n){var r=t.indexOf(`--`)===0;n==null||typeof n==`boolean`||n===``?r?e.setProperty(t,``):t===`float`?e.cssFloat=``:e[t]=``:r?e.setProperty(t,n):typeof n!=`number`||n===0||fn.has(t)?t===`float`?e.cssFloat=n:e[t]=(``+n).trim():e[t]=n+`px`}function mn(e,t,n){if(t!=null&&typeof t!=`object`)throw Error(s(62));if(e=e.style,n!=null){for(var r in n)!n.hasOwnProperty(r)||t!=null&&t.hasOwnProperty(r)||(r.indexOf(`--`)===0?e.setProperty(r,``):r===`float`?e.cssFloat=``:e[r]=``,R=!0);for(var i in t)r=t[i],t.hasOwnProperty(i)&&n[i]!==r&&(pn(e,i,r),R=!0)}else for(var a in t)t.hasOwnProperty(a)&&pn(e,a,t[a])}function hn(e){if(e.indexOf(`-`)===-1)return!1;switch(e){case`annotation-xml`:case`color-profile`:case`font-face`:case`font-face-src`:case`font-face-uri`:case`font-face-format`:case`font-face-name`:case`missing-glyph`:return!1;default:return!0}}var gn=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`],[`maskType`,`mask-type`],[`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`]]),_n=/^[\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 vn(e){return _n.test(``+e)?`javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')`:e}function yn(){}var bn=null;function xn(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var Sn=null,Cn=null;function wn(e){var t=Ft(e);if(t&&(e=t.stateNode)){var n=e[Tt]||null;a:switch(e=t.stateNode,t.type){case`input`:if(an(e,n.value,n.defaultValue,n.defaultValue,n.checked,n.defaultChecked,n.type,n.name),t=n.name,n.type===`radio`&&t!=null){for(n=e;n.parentNode;)n=n.parentNode;for(n=n.querySelectorAll(`input[name="`+rn(``+t)+`"][type="radio"]`),t=0;t<n.length;t++){var r=n[t];if(r!==e&&r.form===e.form){var i=r[Tt]||null;if(!i)throw Error(s(90));an(r,i.value,i.defaultValue,i.defaultValue,i.checked,i.defaultChecked,i.type,i.name)}}for(t=0;t<n.length;t++)r=n[t],r.form===e.form&&tn(r)}break a;case`textarea`:ln(e,n.value,n.defaultValue);break a;case`select`:t=n.value,t!=null&&cn(e,!!n.multiple,t,!1)}}}var Tn=!1;function En(e,t,n){if(Tn)return e(t,n);Tn=!0;try{return e(t)}finally{if(Tn=!1,(Sn!==null||Cn!==null)&&(zd(),Sn&&(t=Sn,e=Cn,Cn=Sn=null,wn(t),e)))for(t=0;t<e.length;t++)wn(e[t])}}function Dn(e,t){var n=e.stateNode;if(n===null)return null;var r=n[Tt]||null;if(r===null)return null;n=r[t];a:switch(t){case`onClick`:case`onClickCapture`:case`onDoubleClick`:case`onDoubleClickCapture`:case`onMouseDown`:case`onMouseDownCapture`:case`onMouseMove`:case`onMouseMoveCapture`:case`onMouseUp`:case`onMouseUpCapture`:case`onMouseEnter`:(r=!r.disabled)||(e=e.type,r=e!==`button`&&e!==`input`&&e!==`select`&&e!==`textarea`),e=!r;break a;default:e=!1}if(e)return null;if(n&&typeof n!=`function`)throw Error(s(231,t,typeof n));return n}var On=typeof window<`u`&&window.document!==void 0&&window.document.createElement!==void 0,kn=!1;if(On)try{var An={};Object.defineProperty(An,"passive",{get:function(){kn=!0}}),window.addEventListener(`test`,An,An),window.removeEventListener(`test`,An,An)}catch{kn=!1}var jn=null,Mn=null,Nn=null;function Pn(){if(Nn)return Nn;var e,t=Mn,n=t.length,r,i=`value`in jn?jn.value:jn.textContent,a=i.length;for(e=0;e<n&&t[e]===i[e];e++);var o=n-e;for(r=1;r<=o&&t[n-r]===i[a-r];r++);return Nn=i.slice(e,1<r?1-r:void 0)}function Fn(e){var t=e.keyCode;return`charCode`in e?(e=e.charCode,e===0&&t===13&&(e=13)):e=t,e===10&&(e=13),32<=e||e===13?e:0}function In(){return!0}function Ln(){return!1}function Rn(e){function t(t,n,r,i,a){for(var o in this._reactName=t,this._targetInst=r,this.type=n,this.nativeEvent=i,this.target=a,this.currentTarget=null,e)e.hasOwnProperty(o)&&(t=e[o],this[o]=t?t(i):i[o]);return this.isDefaultPrevented=(i.defaultPrevented==null?!1===i.returnValue:i.defaultPrevented)?In:Ln,this.isPropagationStopped=Ln,this}return D(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var e=this.nativeEvent;e&&(e.preventDefault?e.preventDefault():typeof e.returnValue!=`unknown`&&(e.returnValue=!1),this.isDefaultPrevented=In)},stopPropagation:function(){var e=this.nativeEvent;e&&(e.stopPropagation?e.stopPropagation():typeof e.cancelBubble!=`unknown`&&(e.cancelBubble=!0),this.isPropagationStopped=In)},persist:function(){},isPersistent:In}),t}var zn={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Bn=Rn(zn),Vn=D({},zn,{view:0,detail:0}),Hn=Rn(Vn),Un,Wn,Gn,Kn=D({},Vn,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:rr,button:0,buttons:0,relatedTarget:function(e){return e.relatedTarget===void 0?e.fromElement===e.srcElement?e.toElement:e.fromElement:e.relatedTarget},movementX:function(e){return`movementX`in e?e.movementX:(e!==Gn&&(Gn&&e.type===`mousemove`?(Un=e.screenX-Gn.screenX,Wn=e.screenY-Gn.screenY):Wn=Un=0,Gn=e),Un)},movementY:function(e){return`movementY`in e?e.movementY:Wn}}),qn=Rn(Kn),Jn=Rn(D({},Kn,{dataTransfer:0})),Yn=Rn(D({},Vn,{relatedTarget:0})),Xn=Rn(D({},zn,{animationName:0,elapsedTime:0,pseudoElement:0})),Zn=Rn(D({},zn,{clipboardData:function(e){return`clipboardData`in e?e.clipboardData:window.clipboardData}})),Qn=Rn(D({},zn,{data:0})),$n={Esc:`Escape`,Spacebar:` `,Left:`ArrowLeft`,Up:`ArrowUp`,Right:`ArrowRight`,Down:`ArrowDown`,Del:`Delete`,Win:`OS`,Menu:`ContextMenu`,Apps:`ContextMenu`,Scroll:`ScrollLock`,MozPrintableKey:`Unidentified`},er={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`},tr={Alt:`altKey`,Control:`ctrlKey`,Meta:`metaKey`,Shift:`shiftKey`};function nr(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=tr[e])?!!t[e]:!1}function rr(){return nr}var ir=Rn(D({},Vn,{key:function(e){if(e.key){var t=$n[e.key]||e.key;if(t!==`Unidentified`)return t}return e.type===`keypress`?(e=Fn(e),e===13?`Enter`:String.fromCharCode(e)):e.type===`keydown`||e.type===`keyup`?er[e.keyCode]||`Unidentified`:``},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:rr,charCode:function(e){return e.type===`keypress`?Fn(e):0},keyCode:function(e){return e.type===`keydown`||e.type===`keyup`?e.keyCode:0},which:function(e){return e.type===`keypress`?Fn(e):e.type===`keydown`||e.type===`keyup`?e.keyCode:0}})),ar=Rn(D({},Kn,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0})),or=Rn(D({},zn,{submitter:0})),sr=Rn(D({},Vn,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:rr})),cr=Rn(D({},zn,{propertyName:0,elapsedTime:0,pseudoElement:0})),lr=Rn(D({},Kn,{deltaX:function(e){return`deltaX`in e?e.deltaX:`wheelDeltaX`in e?-e.wheelDeltaX:0},deltaY:function(e){return`deltaY`in e?e.deltaY:`wheelDeltaY`in e?-e.wheelDeltaY:`wheelDelta`in e?-e.wheelDelta:0},deltaZ:0,deltaMode:0})),ur=Rn(D({},zn,{newState:0,oldState:0,source:0})),dr=[9,13,27,32],fr=On&&`CompositionEvent`in window,pr=null;On&&`documentMode`in document&&(pr=document.documentMode);var mr=On&&`TextEvent`in window&&!pr,hr=On&&(!fr||pr&&8<pr&&11>=pr),gr=` `,_r=!1;function vr(e,t){switch(e){case`keyup`:return dr.indexOf(t.keyCode)!==-1;case`keydown`:return t.keyCode!==229;case`keypress`:case`mousedown`:case`focusout`:return!0;default:return!1}}function yr(e){return e=e.detail,typeof e==`object`&&`data`in e?e.data:null}var br=!1;function xr(e,t){switch(e){case`compositionend`:return yr(t);case`keypress`:return t.which===32?(_r=!0,gr):null;case`textInput`:return e=t.data,e===gr&&_r?null:e;default:return null}}function Sr(e,t){if(br)return e===`compositionend`||!fr&&vr(e,t)?(e=Pn(),Nn=Mn=jn=null,br=!1,e):null;switch(e){case`paste`:return null;case`keypress`:if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1<t.char.length)return t.char;if(t.which)return String.fromCharCode(t.which)}return null;case`compositionend`:return hr&&t.locale!==`ko`?null:t.data;default:return null}}var Cr={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 wr(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t===`input`?!!Cr[e.type]:t===`textarea`}function Tr(e,t,n,r){Sn?Cn?Cn.push(r):Cn=[r]:Sn=r,t=Jf(t,`onChange`),0<t.length&&(n=new Bn(`onChange`,`change`,null,n,r),e.push({event:n,listeners:t}))}var Er=null,Dr=null;function Or(e){Vf(e,0)}function kr(e){if(tn(It(e)))return e}function Ar(e,t){if(e===`change`)return t}var jr=!1;if(On){var Mr;if(On){var Nr=`oninput`in document;if(!Nr){var Pr=document.createElement(`div`);Pr.setAttribute(`oninput`,`return;`),Nr=typeof Pr.oninput==`function`}Mr=Nr}else Mr=!1;jr=Mr&&(!document.documentMode||9<document.documentMode)}function Fr(){Er&&(Er.detachEvent(`onpropertychange`,Ir),Dr=Er=null)}function Ir(e){if(e.propertyName===`value`&&kr(Dr)){var t=[];Tr(t,Dr,e,xn(e)),En(Or,t)}}function Lr(e,t,n){e===`focusin`?(Fr(),Er=t,Dr=n,Er.attachEvent(`onpropertychange`,Ir)):e===`focusout`&&Fr()}function Rr(e){if(e===`selectionchange`||e===`keyup`||e===`keydown`)return kr(Dr)}function zr(e,t){if(e===`click`)return kr(t)}function Br(e,t){if(e===`input`||e===`change`)return kr(t)}function Vr(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}var Hr=typeof Object.is==`function`?Object.is:Vr;function Ur(e,t){if(Hr(e,t))return!0;if(typeof e!=`object`||!e||typeof t!=`object`||!t)return!1;var n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(r=0;r<n.length;r++){var i=n[r];if(!Be.call(t,i)||!Hr(e[i],t[i]))return!1}return!0}function Wr(e){if(e||=typeof document<`u`?document:void 0,e===void 0)return null;try{return e.activeElement||e.body}catch{return e.body}}function Gr(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function Kr(e,t){var n=Gr(e);e=0;for(var r;n;){if(n.nodeType===3){if(r=e+n.textContent.length,e<=t&&r>=t)return{node:n,offset:t-e};e=r}a:{for(;n;){if(n.nextSibling){n=n.nextSibling;break a}n=n.parentNode}n=void 0}n=Gr(n)}}function qr(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?qr(e,t.parentNode):`contains`in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function Jr(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=Wr(e.document);t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href==`string`}catch{n=!1}if(n)e=t.contentWindow;else break;t=Wr(e.document)}return t}function Yr(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t===`input`&&(e.type===`text`||e.type===`search`||e.type===`tel`||e.type===`url`||e.type===`password`)||t===`textarea`||e.contentEditable===`true`)}var Xr=On&&`documentMode`in document&&11>=document.documentMode,Zr=null,Qr=null,$r=null,ei=!1;function ti(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;ei||Zr==null||Zr!==Wr(r)||(r=Zr,`selectionStart`in r&&Yr(r)?r={start:r.selectionStart,end:r.selectionEnd}:(r=(r.ownerDocument&&r.ownerDocument.defaultView||window).getSelection(),r={anchorNode:r.anchorNode,anchorOffset:r.anchorOffset,focusNode:r.focusNode,focusOffset:r.focusOffset}),$r&&Ur($r,r)||($r=r,r=Jf(Qr,`onSelect`),0<r.length&&(t=new Bn(`onSelect`,`select`,null,t,n),e.push({event:t,listeners:r}),t.target=Zr)))}function ni(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n[`Webkit`+e]=`webkit`+t,n[`Moz`+e]=`moz`+t,n}var ri={animationend:ni(`Animation`,`AnimationEnd`),animationiteration:ni(`Animation`,`AnimationIteration`),animationstart:ni(`Animation`,`AnimationStart`),transitionrun:ni(`Transition`,`TransitionRun`),transitionstart:ni(`Transition`,`TransitionStart`),transitioncancel:ni(`Transition`,`TransitionCancel`),transitionend:ni(`Transition`,`TransitionEnd`)},ii={},ai={};On&&(ai=document.createElement(`div`).style,`AnimationEvent`in window||(delete ri.animationend.animation,delete ri.animationiteration.animation,delete ri.animationstart.animation),`TransitionEvent`in window||delete ri.transitionend.transition);function oi(e){if(ii[e])return ii[e];if(!ri[e])return e;var t=ri[e],n;for(n in t)if(t.hasOwnProperty(n)&&n in ai)return ii[e]=t[n];return e}var si=oi(`animationend`),ci=oi(`animationiteration`),li=oi(`animationstart`),ui=oi(`transitionrun`),di=oi(`transitionstart`),fi=oi(`transitioncancel`),pi=oi(`transitionend`),mi=new Map,hi=`abort auxClick beforeToggle cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error fullscreenChange fullscreenError 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(` `);hi.push(`scrollEnd`);function gi(e,t){mi.set(e,t),Ht(t,[e])}var _i=0;function vi(e,t){if(e.name!=null&&e.name!==`auto`)return e.name;if(t.autoName!==null)return t.autoName;e=bd.identifierPrefix;var n=_i++;return e=`_`+e+`t_`+n.toString(32)+`_`,t.autoName=e}function yi(e){if(e==null||typeof e==`string`)return e;var t=null,n=Od;if(n!==null)for(var r=0;r<n.length;r++){var i=e[n[r]];if(i!=null){if(i===`none`)return`none`;t=t==null?i:t+(` `+i)}}return t??e.default}function bi(e,t){return e=yi(e),t=yi(t),t==null?e===`auto`?null:e:t===`auto`?null:t}var xi=typeof reportError==`function`?reportError:function(e){if(typeof window==`object`&&typeof window.ErrorEvent==`function`){var t=new window.ErrorEvent(`error`,{bubbles:!0,cancelable:!0,message:typeof e==`object`&&e&&typeof e.message==`string`?String(e.message):String(e),error:e});if(!window.dispatchEvent(t))return}else if(typeof process==`object`&&typeof process.emit==`function`){process.emit(`uncaughtException`,e);return}console.error(e)},Si=[],Ci=0,wi=0;function z(){for(var e=Ci,t=wi=Ci=0;t<e;){var n=Si[t];Si[t++]=null;var r=Si[t];Si[t++]=null;var i=Si[t];Si[t++]=null;var a=Si[t];if(Si[t++]=null,r!==null&&i!==null){var o=r.pending;o===null?i.next=i:(i.next=o.next,o.next=i),r.pending=i}a!==0&&Oi(n,i,a)}}function Ti(e,t,n,r){Si[Ci++]=e,Si[Ci++]=t,Si[Ci++]=n,Si[Ci++]=r,wi|=r,e.lanes|=r,e=e.alternate,e!==null&&(e.lanes|=r)}function Ei(e,t,n,r){return Ti(e,t,n,r),ki(e)}function Di(e,t){return Ti(e,null,null,t),ki(e)}function Oi(e,t,n){e.lanes|=n;var r=e.alternate;r!==null&&(r.lanes|=n);for(var i=!1,a=e.return;a!==null;)a.childLanes|=n,r=a.alternate,r!==null&&(r.childLanes|=n),a.tag===22&&(e=a.stateNode,e===null||e._visibility&1||(i=!0)),e=a,a=a.return;return e.tag===3?(a=e.stateNode,i&&t!==null&&(i=31-tt(n),e=a.hiddenUpdates,r=e[i],r===null?e[i]=[t]:r.push(t),t.lane=n|536870912),a):null}function ki(e){if(50<kd)throw kd=0,Ad=null,Error(s(185));for(var t=e.return;t!==null;)e=t,t=e.return;return e.tag===3?e.stateNode:null}var Ai={};function ji(e,t,n,r){this.tag=e,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=r,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Mi(e,t,n,r){return new ji(e,t,n,r)}function Ni(e){return e=e.prototype,!(!e||!e.isReactComponent)}function Pi(e,t){var n=e.alternate;return n===null?(n=Mi(e.tag,t,e.key,e.mode),n.elementType=e.elementType,n.type=e.type,n.stateNode=e.stateNode,n.alternate=e,e.alternate=n):(n.pendingProps=t,n.type=e.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=e.flags&1206910976,n.childLanes=e.childLanes,n.lanes=e.lanes,n.child=e.child,n.memoizedProps=e.memoizedProps,n.memoizedState=e.memoizedState,n.updateQueue=e.updateQueue,t=e.dependencies,n.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},n.sibling=e.sibling,n.index=e.index,n.ref=e.ref,n.refCleanup=e.refCleanup,n}function Fi(e,t){e.flags&=1206910978;var n=e.alternate;return n===null?(e.childLanes=0,e.lanes=t,e.child=null,e.subtreeFlags=0,e.memoizedProps=null,e.memoizedState=null,e.updateQueue=null,e.dependencies=null,e.stateNode=null):(e.childLanes=n.childLanes,e.lanes=n.lanes,e.child=n.child,e.subtreeFlags=0,e.deletions=null,e.memoizedProps=n.memoizedProps,e.memoizedState=n.memoizedState,e.updateQueue=n.updateQueue,e.type=n.type,t=n.dependencies,e.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext}),e}function Ii(e,t,n,r,i,a){var o=0;if(r=e,typeof r==`function`)Ni(r)&&(o=1);else if(typeof r==`string`)o=qm(e,n,Ee.current)?26:e===`html`||e===`head`||e===`body`?27:5;else a:switch(r){case de:return e=Mi(31,n,t,i),e.elementType=de,e.lanes=a,e;case te:return Li(n.children,i,a,t);case ne:o=8,i|=24;break;case re:return e=Mi(12,n,t,i|2),e.elementType=re,e.lanes=a,e;case se:return e=Mi(13,n,t,i),e.elementType=se,e.lanes=a,e;case ce:return e=Mi(19,n,t,i),e.elementType=ce,e.lanes=a,e;case fe:case me:return e=i|32,e=Mi(30,n,t,e),e.elementType=me,e.lanes=a,e.stateNode={autoName:null,paired:null,clones:null,ref:null},e;default:if(typeof r==`object`&&r)switch(r.$$typeof){case ae:o=10;break a;case ie:o=9;break a;case oe:o=11;break a;case le:o=14;break a;case ue:o=16,r=null;break a}o=29,n=Error(s(130,e===null?`null`:typeof e,``)),r=null}return t=Mi(o,n,t,i),t.elementType=e,t.type=r,t.lanes=a,t}function Li(e,t,n,r){return e=Mi(7,e,r,t),e.lanes=n,e}function Ri(e,t,n){return e=Mi(6,e,null,t),e.lanes=n,e}function zi(e){var t=Mi(18,null,null,0);return t.stateNode=e,t}function Bi(e,t,n){return t=Mi(4,e.children===null?[]:e.children,e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}var Vi=new WeakMap;function Hi(e,t){if(typeof e==`object`&&e){var n=Vi.get(e);return n===void 0?(t={value:e,source:t,stack:N(t)},Vi.set(e,t),t):n}return{value:e,source:t,stack:N(t)}}var Ui=[],Wi=0,Gi=null,Ki=0,qi=[],Ji=0,Yi=null,Xi=1,Zi=``;function Qi(e,t){Ui[Wi++]=Ki,Ui[Wi++]=Gi,Gi=e,Ki=t}function $i(e,t,n){qi[Ji++]=Xi,qi[Ji++]=Zi,qi[Ji++]=Yi,Yi=e;var r=Xi;e=Zi;var i=32-tt(r)-1;r&=~(1<<i),n+=1;var a=32-tt(t)+i;if(30<a){var o=i-i%5;a=(r&(1<<o)-1).toString(32),r>>=o,i-=o,Xi=1<<32-tt(t)+i|n<<i|r,Zi=a+e}else Xi=1<<a|n<<i|r,Zi=e}function ea(e){e.return!==null&&(Qi(e,1),$i(e,1,0))}function ta(e){for(;e===Gi;)Gi=Ui[--Wi],Ui[Wi]=null,Ki=Ui[--Wi],Ui[Wi]=null;for(;e===Yi;)Yi=qi[--Ji],qi[Ji]=null,Zi=qi[--Ji],qi[Ji]=null,Xi=qi[--Ji],qi[Ji]=null}function na(e,t){qi[Ji++]=Xi,qi[Ji++]=Zi,qi[Ji++]=Yi,Xi=t.id,Zi=t.overflow,Yi=e}var ra=null,ia=null,B=!1,aa=null,oa=!1,sa=Error(s(519));function ca(e){throw ma(Hi(Error(s(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?`text`:`HTML`,``)),e)),sa}function la(e){var t=e.stateNode,n=e.type,r=e.memoizedProps;switch(t[wt]=e,t[Tt]=r,n){case`dialog`:Q(`cancel`,t),Q(`close`,t);break;case`iframe`:case`object`:case`embed`:Q(`load`,t);break;case`video`:case`audio`:for(n=0;n<zf.length;n++)Q(zf[n],t);break;case`source`:Q(`error`,t);break;case`img`:case`image`:case`link`:Q(`error`,t),Q(`load`,t);break;case`details`:Q(`toggle`,t);break;case`input`:Q(`invalid`,t),on(t,r.value,r.defaultValue,r.checked,r.defaultChecked,r.type,r.name,!0);break;case`select`:Q(`invalid`,t);break;case`textarea`:Q(`invalid`,t),un(t,r.value,r.defaultValue,r.children)}n=r.children,typeof n!=`string`&&typeof n!=`number`&&typeof n!=`bigint`||t.textContent===``+n||!0===r.suppressHydrationWarning||ep(t.textContent,n)?(r.popover!=null&&(Q(`beforetoggle`,t),Q(`toggle`,t)),r.onScroll!=null&&Q(`scroll`,t),r.onScrollEnd!=null&&Q(`scrollend`,t),r.onClick!=null&&(t.onclick=yn),t=!0):t=!1,t||ca(e,!0)}function ua(e){for(ra=e.return;ra;)switch(ra.tag){case 5:case 31:case 13:oa=!1;return;case 27:case 3:oa=!0;return;default:ra=ra.return}}function da(e){if(e!==ra)return!1;if(!B)return ua(e),B=!0,!1;var t=e.tag,n;if((n=t!==3&&t!==27)&&((n=t===5)&&(n=e.type,n=n===`form`||n===`button`||pp(e.type,e.memoizedProps)),n=!n),n&&ia&&ca(e),ua(e),t===13){if(e=e.memoizedState,e=e===null?null:e.dehydrated,!e)throw Error(s(317));ia=dm(e)}else if(t===31){if(e=e.memoizedState,e=e===null?null:e.dehydrated,!e)throw Error(s(317));ia=dm(e)}else t===27?(t=ia,Sp(e.type)?(e=um,um=null,ia=e):ia=t):ia=ra?lm(e.stateNode.nextSibling):null;return!0}function fa(){ia=ra=null,B=!1}function pa(){var e=aa;return e!==null&&(fd===null?fd=e:fd.push.apply(fd,e),aa=null),e}function ma(e){aa===null?aa=[e]:aa.push(e)}var ha=we(null),ga=null,_a=null;function va(e,t,n){M(ha,t._currentValue),t._currentValue=n}function ya(e){e._currentValue=ha.current,Te(ha)}function ba(e,t,n){for(;e!==null;){var r=e.alternate;if((e.childLanes&t)===t?r!==null&&(r.childLanes&t)!==t&&(r.childLanes|=t):(e.childLanes|=t,r!==null&&(r.childLanes|=t)),e===n)break;e=e.return}}function xa(e,t,n,r){var i=e.child;for(i!==null&&(i.return=e);i!==null;){var a=i.dependencies;if(a!==null){var o=i.child;a=a.firstContext;a:for(;a!==null;){var c=a;a=i;for(var l=0;l<t.length;l++)if(c.context===t[l]){a.lanes|=n,c=a.alternate,c!==null&&(c.lanes|=n),ba(a.return,n,e),r||(o=null);break a}a=c.next}}else if(i.tag===18){if(o=i.return,o===null)throw Error(s(341));o.lanes|=n,a=o.alternate,a!==null&&(a.lanes|=n),ba(o,n,e),o=null}else i.tag===13&&i.memoizedState!==null&&i.memoizedState.dehydrated===null?(i.lanes|=n,o=i.alternate,o!==null&&(o.lanes|=n),ba(i.return,n,e),o=i.child,o=o===null?null:o.sibling):o=i.child;if(o!==null)o.return=i;else for(o=i;o!==null;){if(o===e){o=null;break}if(i=o.sibling,i!==null){i.return=o.return,o=i;break}o=o.return}i=o}}function Sa(e,t,n,r){e=null;for(var i=t,a=!1;i!==null;){if(!a){if(i.flags&524288)a=!0;else if(i.flags&262144)break}if(i.tag===10){var o=i.alternate;if(o===null)throw Error(s(387));if(o=o.memoizedProps,o!==null){var c=i.type;Hr(i.pendingProps.value,o.value)||(e===null?e=[c]:e.push(c))}}else if(i===ke.current){if(o=i.alternate,o===null)throw Error(s(387));o.memoizedState.memoizedState!==i.memoizedState.memoizedState&&(e===null?e=[sh]:e.push(sh))}i=i.return}return e!==null&&xa(t,e,n,r),t.flags|=262144,e!==null}function Ca(e){for(e=e.firstContext;e!==null;){if(!Hr(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function wa(e){ga=e,_a=null,e=e.dependencies,e!==null&&(e.firstContext=null)}function Ta(e){return Da(ga,e)}function Ea(e,t){return ga===null&&wa(e),Da(e,t)}function Da(e,t){var n=t._currentValue;if(t={context:t,memoizedValue:n,next:null},_a===null){if(e===null)throw Error(s(308));_a=t,e.dependencies={lanes:0,firstContext:t},e.flags|=524288}else _a=_a.next=t;return n}var Oa=typeof AbortController<`u`?AbortController:function(){var e=[],t=this.signal={aborted:!1,addEventListener:function(t,n){e.push(n)}};this.abort=function(){t.aborted=!0,e.forEach(function(e){return e()})}},ka=t.unstable_scheduleCallback,Aa=t.unstable_NormalPriority,ja={$$typeof:ae,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function Ma(){return{controller:new Oa,data:new Map,refCount:0}}function Na(e){e.refCount--,e.refCount===0&&ka(Aa,function(){e.controller.abort()})}function Pa(e,t){if(e.pendingLanes&4194048){var n=e.transitionTypes;for(n===null&&(n=e.transitionTypes=[]),e=0;e<t.length;e++){var r=t[e];n.indexOf(r)===-1&&n.push(r)}}}var Fa=null;function Ia(e){var t=e.transitionTypes;return e.transitionTypes=null,t}var La=null,Ra=0,za=0,Ba=null;function Va(e,t){if(La===null){var n=La=[];Ra=0,za=Pf(),Ba={status:`pending`,value:void 0,then:function(e){n.push(e)}}}return Ra++,t.then(Ha,Ha),t}function Ha(){if(--Ra===0&&(Fa=null,La!==null)){Ba!==null&&(Ba.status=`fulfilled`);var e=La;La=null,za=0,Ba=null;for(var t=0;t<e.length;t++)(0,e[t])()}}function Ua(e,t){var n=[],r={status:`pending`,value:null,reason:null,then:function(e){n.push(e)}};return e.then(function(){r.status=`fulfilled`,r.value=t;for(var e=0;e<n.length;e++)(0,n[e])(t)},function(e){for(r.status=`rejected`,r.reason=e,e=0;e<n.length;e++)(0,n[e])(void 0)}),r}var Wa=A.S;A.S=function(e,t){if(hd=Ge(),typeof t==`object`&&t&&typeof t.then==`function`&&Va(e,t),Fa!==null)for(var n=bf;n!==null;)Pa(n,Fa),n=n.next;if(n=e.types,n!==null){for(var r=bf;r!==null;)Pa(r,n),r=r.next;if(za!==0){r=Fa,r===null&&(r=Fa=[]);for(var i=0;i<n.length;i++){var a=n[i];r.indexOf(a)===-1&&r.push(a)}}}Wa!==null&&Wa(e,t)};var Ga=we(null);function Ka(){var e=Ga.current;return e===null?$u.pooledCache:e}function qa(e,t){t===null?M(Ga,Ga.current):M(Ga,t.pool)}function Ja(){var e=Ka();return e===null?null:{parent:ja._currentValue,pool:e}}var Ya=Error(s(460)),Xa=Error(s(474)),Za=Error(s(542)),Qa={then:function(){}};function $a(e){return e=e.status,e===`fulfilled`||e===`rejected`}function V(e,t,n){switch(n=e[n],n===void 0?e.push(t):n!==t&&(t.then(yn,yn),t=n),t.status){case`fulfilled`:return t.value;case`rejected`:throw e=t.reason,ro(e),e===void 0&&!(`reason`in t)?Error(s(600)):e;default:if(typeof t.status==`string`)t.then(yn,yn);else{if(e=$u,e!==null&&100<e.shellSuspendCounter)throw Error(s(482));e=t,e.status=`pending`,e.then(function(e){if(t.status===`pending`){var n=t;n.status=`fulfilled`,n.value=e}},function(e){if(t.status===`pending`){var n=t;n.status=`rejected`,n.reason=e}})}switch(t.status){case`fulfilled`:return t.value;case`rejected`:throw e=t.reason,ro(e),e}throw to=t,Ya}}function eo(e){try{var t=e._init;return t(e._payload)}catch(e){throw typeof e==`object`&&e&&typeof e.then==`function`?(to=e,Ya):e}}var to=null;function no(){if(to===null)throw Error(s(459));var e=to;return to=null,e}function ro(e){if(e===Ya||e===Za)throw Error(s(483))}var io=null,ao=0;function oo(e){var t=ao;return ao+=1,io===null&&(io=[]),V(io,e,t)}function so(e,t){t=t.props.ref,e.ref=t===void 0?null:t}function co(e,t){throw t.$$typeof===O?Error(s(525)):(e=Object.prototype.toString.call(t),Error(s(31,e===`[object Object]`?`object with keys {`+Object.keys(t).join(`, `)+`}`:e)))}function lo(e){function t(t,n){if(e){var r=t.deletions;r===null?(t.deletions=[n],t.flags|=16):r.push(n)}}function n(n,r){if(!e)return null;for(;r!==null;)t(n,r),r=r.sibling;return null}function r(e){for(var t=new Map;e!==null;)e.key===null?t.set(e.index,e):t.set(e.key,e),e=e.sibling;return t}function i(e,t){return e=Pi(e,t),e.index=0,e.sibling=null,e}function a(t,n,r){return t.index=r,e?(r=t.alternate,r===null?(t.flags|=134217730,n):(r=r.index,r<n?(t.flags|=2,n):r)):(t.flags|=1048576,n)}function o(t){return e&&t.alternate===null&&(t.flags|=134217730),t}function c(e,t,n,r){return t===null||t.tag!==6?(t=Ri(n,e.mode,r),t.return=e,t):(t=i(t,n),t.return=e,t)}function l(e,t,n,r){var a=n.type;return a===te?(e=d(e,t,n.props.children,r,n.key),so(e,n),e):t!==null&&(t.elementType===a||typeof a==`object`&&a&&a.$$typeof===ue&&eo(a)===t.type)?(t=i(t,n.props),so(t,n),t.return=e,t):(t=Ii(n.type,n.key,n.props,null,e.mode,r),so(t,n),t.return=e,t)}function u(e,t,n,r){return t===null||t.tag!==4||t.stateNode.containerInfo!==n.containerInfo||t.stateNode.implementation!==n.implementation?(t=Bi(n,e.mode,r),t.return=e,t):(t=i(t,n.children||[]),t.return=e,t)}function d(e,t,n,r,a){return t===null||t.tag!==7?(t=Li(n,e.mode,r,a),t.return=e,t):(t=i(t,n),t.return=e,t)}function f(e,t,n){if(typeof t==`string`&&t!==``||typeof t==`number`||typeof t==`bigint`)return t=Ri(``+t,e.mode,n),t.return=e,t;if(typeof t==`object`&&t){switch(t.$$typeof){case ee:return n=Ii(t.type,t.key,t.props,null,e.mode,n),so(n,t),n.return=e,n;case k:return t=Bi(t,e.mode,n),t.return=e,t;case ue:return t=eo(t),f(e,t,n)}if(be(t)||_e(t))return t=Li(t,e.mode,n,null),t.return=e,t;if(typeof t.then==`function`)return f(e,oo(t),n);if(t.$$typeof===ae)return f(e,Ea(e,t),n);co(e,t)}return null}function p(e,t,n,r){var i=t===null?null:t.key;if(typeof n==`string`&&n!==``||typeof n==`number`||typeof n==`bigint`)return i===null?c(e,t,``+n,r):null;if(typeof n==`object`&&n){switch(n.$$typeof){case ee:return n.key===i?l(e,t,n,r):null;case k:return n.key===i?u(e,t,n,r):null;case ue:return n=eo(n),p(e,t,n,r)}if(be(n)||_e(n))return i===null?d(e,t,n,r,null):null;if(typeof n.then==`function`)return p(e,t,oo(n),r);if(n.$$typeof===ae)return p(e,t,Ea(e,n),r);co(e,n)}return null}function m(e,t,n,r,i){if(typeof r==`string`&&r!==``||typeof r==`number`||typeof r==`bigint`)return e=e.get(n)||null,c(t,e,``+r,i);if(typeof r==`object`&&r){switch(r.$$typeof){case ee:return e=e.get(r.key===null?n:r.key)||null,l(t,e,r,i);case k:return e=e.get(r.key===null?n:r.key)||null,u(t,e,r,i);case ue:return r=eo(r),m(e,t,n,r,i)}if(be(r)||_e(r))return e=e.get(n)||null,d(t,e,r,i,null);if(typeof r.then==`function`)return m(e,t,n,oo(r),i);if(r.$$typeof===ae)return m(e,t,n,Ea(t,r),i);co(t,r)}return null}function h(i,o,s,c){for(var l=null,u=null,d=o,h=o=0,g=null;d!==null&&h<s.length;h++){d.index>h?(g=d,d=null):g=d.sibling;var _=p(i,d,s[h],c);if(_===null){d===null&&(d=g);break}e&&d&&_.alternate===null&&t(i,d),o=a(_,o,h),u===null?l=_:u.sibling=_,u=_,d=g}if(h===s.length)return n(i,d),B&&Qi(i,h),l;if(d===null){for(;h<s.length;h++)d=f(i,s[h],c),d!==null&&(o=a(d,o,h),u===null?l=d:u.sibling=d,u=d);return B&&Qi(i,h),l}for(d=r(d);h<s.length;h++)g=m(d,i,h,s[h],c),g!==null&&(e&&(_=g.alternate,_!==null&&d.delete(_.key===null?h:_.key)),o=a(g,o,h),u===null?l=g:u.sibling=g,u=g);return e&&d.forEach(function(e){return t(i,e)}),B&&Qi(i,h),l}function g(i,o,c,l){if(c==null)throw Error(s(151));for(var u=null,d=null,h=o,g=o=0,_=null,v=c.next();h!==null&&!v.done;g++,v=c.next()){h.index>g?(_=h,h=null):_=h.sibling;var y=p(i,h,v.value,l);if(y===null){h===null&&(h=_);break}e&&h&&y.alternate===null&&t(i,h),o=a(y,o,g),d===null?u=y:d.sibling=y,d=y,h=_}if(v.done)return n(i,h),B&&Qi(i,g),u;if(h===null){for(;!v.done;g++,v=c.next())v=f(i,v.value,l),v!==null&&(o=a(v,o,g),d===null?u=v:d.sibling=v,d=v);return B&&Qi(i,g),u}for(h=r(h);!v.done;g++,v=c.next())v=m(h,i,g,v.value,l),v!==null&&(e&&(_=v.alternate,_!==null&&h.delete(_.key===null?g:_.key)),o=a(v,o,g),d===null?u=v:d.sibling=v,d=v);return e&&h.forEach(function(e){return t(i,e)}),B&&Qi(i,g),u}function _(e,r,a,c){if(typeof a==`object`&&a&&a.type===te&&a.key===null&&a.props.ref===void 0&&(a=a.props.children),typeof a==`object`&&a){switch(a.$$typeof){case ee:a:{for(var l=a.key;r!==null;){if(r.key===l){if(l=a.type,l===te){if(r.tag===7){n(e,r.sibling),c=i(r,a.props.children),so(c,a),c.return=e,e=c;break a}}else if(r.elementType===l||typeof l==`object`&&l&&l.$$typeof===ue&&eo(l)===r.type){n(e,r.sibling),c=i(r,a.props),so(c,a),c.return=e,e=c;break a}n(e,r);break}t(e,r),r=r.sibling}a.type===te?(c=Li(a.props.children,e.mode,c,a.key),so(c,a),c.return=e,e=c):(c=Ii(a.type,a.key,a.props,null,e.mode,c),so(c,a),c.return=e,e=c)}return o(e);case k:a:{for(l=a.key;r!==null;){if(r.key===l){if(r.tag===4&&r.stateNode.containerInfo===a.containerInfo&&r.stateNode.implementation===a.implementation){n(e,r.sibling),c=i(r,a.children||[]),c.return=e,e=c;break a}n(e,r);break}t(e,r),r=r.sibling}c=Bi(a,e.mode,c),c.return=e,e=c}return o(e);case ue:return a=eo(a),_(e,r,a,c)}if(be(a))return h(e,r,a,c);if(_e(a)){if(l=_e(a),typeof l!=`function`)throw Error(s(150));return a=l.call(a),g(e,r,a,c)}if(typeof a.then==`function`)return _(e,r,oo(a),c);if(a.$$typeof===ae)return _(e,r,Ea(e,a),c);co(e,a)}return typeof a==`string`&&a!==``||typeof a==`number`||typeof a==`bigint`?(a=``+a,r!==null&&r.tag===6?(n(e,r.sibling),c=i(r,a),c.return=e,e=c):(n(e,r),c=Ri(a,e.mode,c),c.return=e,e=c),o(e)):n(e,r)}return function(e,t,n,r){try{ao=0;var i=_(e,t,n,r);return io=null,i}catch(t){if(t===Ya||t===Za)throw t;var a=Mi(29,t,null,e.mode);return a.lanes=r,a.return=e,a}}}var uo=lo(!0),H=lo(!1),fo=!1;function po(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function mo(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,callbacks:null})}function ho(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function go(e,t,n){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,q&2){var i=r.pending;return i===null?t.next=t:(t.next=i.next,i.next=t),r.pending=t,t=ki(e),Oi(e,null,n),t}return Ti(e,r,t,n),ki(e)}function _o(e,t,n){if(t=t.updateQueue,t!==null&&(t=t.shared,n&4194048)){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,_t(e,n)}}function vo(e,t){var n=e.updateQueue,r=e.alternate;if(r!==null&&(r=r.updateQueue,n===r)){var i=null,a=null;if(n=n.firstBaseUpdate,n!==null){do{var o={lane:n.lane,tag:n.tag,payload:n.payload,callback:null,next:null};a===null?i=a=o:a=a.next=o,n=n.next}while(n!==null);a===null?i=a=t:a=a.next=t}else i=a=t;n={baseState:r.baseState,firstBaseUpdate:i,lastBaseUpdate:a,shared:r.shared,callbacks:r.callbacks},e.updateQueue=n}else e=n.lastBaseUpdate,e===null?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}var yo=!1;function bo(){if(yo){var e=Ba;if(e!==null)throw e}}function xo(e,t,n,r){yo=!1;var i=e.updateQueue;fo=!1;var a=i.firstBaseUpdate,o=i.lastBaseUpdate,s=i.shared.pending;if(s!==null){i.shared.pending=null;var c=s,l=c.next;c.next=null,o===null?a=l:o.next=l,o=c;var u=e.alternate;u!==null&&(u=u.updateQueue,s=u.lastBaseUpdate,s!==o&&(s===null?u.firstBaseUpdate=l:s.next=l,u.lastBaseUpdate=c))}if(a!==null){var d=i.baseState;o=0,u=l=c=null,s=a;do{var f=s.lane&-536870913,p=f!==s.lane;if(p?(Y&f)===f:(r&f)===f){f!==0&&f===za&&(yo=!0),u!==null&&(u=u.next={lane:0,tag:s.tag,payload:s.payload,callback:null,next:null});a:{var m=e,h=s;f=t;var g=n;switch(h.tag){case 1:if(m=h.payload,typeof m==`function`){d=m.call(g,d,f);break a}d=m;break a;case 3:m.flags=m.flags&-65537|128;case 0:if(m=h.payload,f=typeof m==`function`?m.call(g,d,f):m,f==null)break a;d=D({},d,f);break a;case 2:fo=!0}}f=s.callback,f!==null&&(e.flags|=64,p&&(e.flags|=8192),p=i.callbacks,p===null?i.callbacks=[f]:p.push(f))}else p={lane:f,tag:s.tag,payload:s.payload,callback:s.callback,next:null},u===null?(l=u=p,c=d):u=u.next=p,o|=f;if(s=s.next,s===null){if(s=i.shared.pending,s===null)break;p=s,s=p.next,p.next=null,i.lastBaseUpdate=p,i.shared.pending=null}}while(1);u===null&&(c=d),i.baseState=c,i.firstBaseUpdate=l,i.lastBaseUpdate=u,a===null&&(i.shared.lanes=0),od|=o,e.lanes=o,e.memoizedState=d}}function So(e,t){if(typeof e!=`function`)throw Error(s(191,e));e.call(t)}function U(e,t){var n=e.callbacks;if(n!==null)for(e.callbacks=null,e=0;e<n.length;e++)So(n[e],t)}var Co=we(null),wo=we(0);function To(e,t){e=id,M(wo,e),M(Co,t),id=e|t.baseLanes}function Eo(){M(wo,id),M(Co,Co.current)}function Do(){id=wo.current,Te(Co),Te(wo)}var Oo=we(null),ko=null;function Ao(e){var t=e.alternate;M(Fo,Fo.current&1),M(Oo,e),ko===null&&(t===null||Co.current!==null||t.memoizedState!==null)&&(ko=e)}function jo(e){M(Fo,Fo.current),M(Oo,e),ko===null&&(ko=e)}function Mo(e){e.tag===22?(M(Fo,Fo.current),M(Oo,e),ko===null&&(ko=e)):No()}function No(){M(Fo,Fo.current),M(Oo,Oo.current)}function Po(e){Te(Oo),ko===e&&(ko=null),Te(Fo)}var Fo=we(0);function Io(e,t){M(Oo,Oo.current),M(Fo,t)}function Lo(e){Te(Fo),Te(Oo),ko===e&&(ko=null)}function Ro(e){for(var t=e;t!==null;){if(t.tag===13){var n=t.memoizedState;if(n!==null&&(n=n.dehydrated,n===null||om(n)||sm(n)))return t}else if(t.tag===19&&t.memoizedProps.revealOrder!==`independent`){if(t.flags&128)return t}else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}var zo=0,W=null,G=null,Bo=null,Vo=!1,Ho=!1,Uo=!1,Wo=0,Go=0,Ko=null,qo=0;function Jo(){throw Error(s(321))}function Yo(e,t){if(t===null)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!Hr(e[n],t[n]))return!1;return!0}function Xo(e,t,n,r,i,a){return zo=a,W=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,A.H=e===null||e.memoizedState===null?pc:mc,Uo=!1,a=n(r,i),Uo=!1,Ho&&(a=Qo(t,n,r,i)),Zo(e),a}function Zo(e){A.H=fc;var t=G!==null&&G.next!==null;if(zo=0,Bo=G=W=null,Vo=!1,Go=0,Ko=null,t)throw Error(s(300));e===null||jc||(e=e.dependencies,e!==null&&Ca(e)&&(jc=!0))}function Qo(e,t,n,r){W=e;var i=0;do{if(Ho&&(Ko=null),Go=0,Ho=!1,25<=i)throw Error(s(301));if(i+=1,Bo=G=null,e.updateQueue!=null){var a=e.updateQueue;a.lastEffect=null,a.events=null,a.stores=null,a.memoCache!=null&&(a.memoCache.index=0)}A.H=hc,a=t(n,r)}while(Ho);return a}function $o(){var e=A.H,t=e.useState()[0];return t=typeof t.then==`function`?os(t):t,e=e.useState()[0],(G===null?null:G.memoizedState)!==e&&(W.flags|=1024),t}function es(){var e=Wo!==0;return Wo=0,e}function ts(e,t,n){t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~n}function ns(e){if(Vo){for(e=e.memoizedState;e!==null;){var t=e.queue;t!==null&&(t.pending=null),e=e.next}Vo=!1}zo=0,Bo=G=W=null,Ho=!1,Go=Wo=0,Ko=null}function rs(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Bo===null?W.memoizedState=Bo=e:Bo=Bo.next=e,Bo}function is(){if(G===null){var e=W.alternate;e=e===null?null:e.memoizedState}else e=G.next;var t=Bo===null?W.memoizedState:Bo.next;if(t!==null)Bo=t,G=e;else{if(e===null)throw W.alternate===null?Error(s(467)):Error(s(310));G=e,e={memoizedState:G.memoizedState,baseState:G.baseState,baseQueue:G.baseQueue,queue:G.queue,next:null},Bo===null?W.memoizedState=Bo=e:Bo=Bo.next=e}return Bo}function as(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function os(e){var t=Go;return Go+=1,Ko===null&&(Ko=[]),e=V(Ko,e,t),t=W,(Bo===null?t.memoizedState:Bo.next)===null&&(t=t.alternate,A.H=t===null||t.memoizedState===null?pc:mc),e}function ss(e){if(typeof e==`object`&&e){if(typeof e.then==`function`)return os(e);if(e.$$typeof===he)return;if(e.$$typeof===ae)return Ta(e)}throw Error(s(438,String(e)))}function cs(e){var t=null,n=W.updateQueue;if(n!==null&&(t=n.memoCache),t==null){var r=W.alternate;r!==null&&(r=r.updateQueue,r!==null&&(r=r.memoCache,r!=null&&(t={data:r.data.map(function(e){return e.slice()}),index:0})))}if(t??={data:[],index:0},n===null&&(n=as(),W.updateQueue=n),n.memoCache=t,n=t.data[t.index],n===void 0)for(n=t.data[t.index]=Array(e),r=0;r<e;r++)n[r]=pe;return t.index++,n}function ls(e,t){return typeof t==`function`?t(e):t}function us(e){return ds(is(),G,e)}function ds(e,t,n){var r=e.queue;if(r===null)throw Error(s(311));r.lastRenderedReducer=n;var i=e.baseQueue,a=r.pending;if(a!==null){if(i!==null){var o=i.next;i.next=a.next,a.next=o}t.baseQueue=i=a,r.pending=null}if(a=e.baseState,i===null)e.memoizedState=a;else{t=i.next;var c=o=null,l=null,u=t,d=!1;do{var f=u.lane&-536870913;if(f===u.lane?(zo&f)===f:(Y&f)===f){var p=u.revertLane;if(p===0)l!==null&&(l=l.next={lane:0,revertLane:0,gesture:null,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null}),f===za&&(d=!0);else if((zo&p)===p){u=u.next,p===za&&(d=!0);continue}else f={lane:0,revertLane:u.revertLane,gesture:null,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null},l===null?(c=l=f,o=a):l=l.next=f,W.lanes|=p,od|=p;f=u.action,Uo&&n(a,f),a=u.hasEagerState?u.eagerState:n(a,f)}else p={lane:f,revertLane:u.revertLane,gesture:u.gesture,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null},l===null?(c=l=p,o=a):l=l.next=p,W.lanes|=f,od|=f;u=u.next}while(u!==null&&u!==t);if(l===null?o=a:l.next=c,!Hr(a,e.memoizedState)&&(jc=!0,d&&(n=Ba,n!==null)))throw n;e.memoizedState=a,e.baseState=o,e.baseQueue=l,r.lastRenderedState=a}return i===null&&(r.lanes=0),[e.memoizedState,r.dispatch]}function fs(e){var t=is(),n=t.queue;if(n===null)throw Error(s(311));n.lastRenderedReducer=e;var r=n.dispatch,i=n.pending,a=t.memoizedState;if(i!==null){n.pending=null;var o=i=i.next;do a=e(a,o.action),o=o.next;while(o!==i);Hr(a,t.memoizedState)||(jc=!0),t.memoizedState=a,t.baseQueue===null&&(t.baseState=a),n.lastRenderedState=a}return[a,r]}function ps(e,t,n){var r=W,i=is(),a=B;if(a){if(n===void 0)throw Error(s(407));n=n()}else n=t();var o=!Hr((G||i).memoizedState,n);if(o&&(i.memoizedState=n,jc=!0),i=i.queue,Rs(gs.bind(null,r,i,e),[e]),e=i.getSnapshot!==t||o||Bo!==null&&!!(Bo.memoizedState.tag&1),Ns(e?9:8,{destroy:void 0},hs.bind(null,r,i,n,t),null),e){if(r.flags|=2048,$u===null)throw Error(s(349));a||zo&127||ms(r,t,n)}return n}function ms(e,t,n){e.flags|=16384,e={getSnapshot:t,value:n},t=W.updateQueue,t===null?(t=as(),W.updateQueue=t,t.stores=[e]):(n=t.stores,n===null?t.stores=[e]:n.push(e))}function hs(e,t,n,r){t.value=n,t.getSnapshot=r,_s(t)&&vs(e)}function gs(e,t,n){return n(function(){_s(t)&&vs(e)})}function _s(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!Hr(e,n)}catch{return!0}}function vs(e){var t=Di(e,2);t!==null&&Pd(t,e,2)}function ys(e){var t=rs();if(typeof e==`function`){var n=e;if(e=n(),Uo){et(!0);try{n()}finally{et(!1)}}}return t.memoizedState=t.baseState=e,t.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:ls,lastRenderedState:e},t}function bs(e,t,n,r){return e.baseState=n,ds(e,G,typeof r==`function`?r:ls)}function xs(e,t,n,r,i){if(lc(e))throw Error(s(485));if(e=t.action,e!==null){var a={payload:i,action:e,next:null,isTransition:!0,status:`pending`,value:null,reason:null,listeners:[],then:function(e){a.listeners.push(e)}};A.T===null?a.isTransition=!1:n(!0),r(a),n=t.pending,n===null?(a.next=t.pending=a,Ss(t,a)):(a.next=n.next,t.pending=n.next=a)}}function Ss(e,t){var n=t.action,r=t.payload,i=e.state;if(t.isTransition){var a=A.T,o={};o.types=a===null?null:a.types,A.T=o;try{var s=n(i,r),c=A.S;c!==null&&c(o,s),Cs(e,t,s)}catch(n){Ts(e,t,n)}finally{a!==null&&o.types!==null&&(a.types=o.types),A.T=a}}else try{a=n(i,r),Cs(e,t,a)}catch(n){Ts(e,t,n)}}function Cs(e,t,n){typeof n==`object`&&n&&typeof n.then==`function`?n.then(function(n){ws(e,t,n)},function(n){return Ts(e,t,n)}):ws(e,t,n)}function ws(e,t,n){t.status=`fulfilled`,t.value=n,Es(t),e.state=n,t=e.pending,t!==null&&(n=t.next,n===t?e.pending=null:(n=n.next,t.next=n,Ss(e,n)))}function Ts(e,t,n){var r=e.pending;if(e.pending=null,r!==null){r=r.next;do t.status=`rejected`,t.reason=n,Es(t),t=t.next;while(t!==r)}e.action=null}function Es(e){e=e.listeners;for(var t=0;t<e.length;t++)(0,e[t])()}function Ds(e,t){return t}function Os(e,t){if(B){var n=$u.formState;if(n!==null){a:{var r=W;if(B){if(ia){b:{for(var i=ia,a=oa;i.nodeType!==8;)if(!a||(i=lm(i.nextSibling),i===null)){i=null;break b}a=i.data,i=a===`F!`||a===`F`?i:null}if(i){ia=lm(i.nextSibling),r=i.data===`F!`;break a}}ca(r)}r=!1}r&&(t=n[0])}}return n=rs(),n.memoizedState=n.baseState=t,r={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Ds,lastRenderedState:t},n.queue=r,n=oc.bind(null,W,r),r.dispatch=n,r=ys(!1),a=cc.bind(null,W,!1,r.queue),r=rs(),i={state:t,dispatch:null,action:e,pending:null},r.queue=i,n=xs.bind(null,W,i,a,n),i.dispatch=n,r.memoizedState=e,[t,n,!1]}function ks(e){return As(is(),G,e)}function As(e,t,n){if(t=ds(e,t,Ds)[0],e=us(ls)[0],typeof t==`object`&&t&&typeof t.then==`function`)try{var r=os(t)}catch(e){throw e===Ya?Za:e}else r=t;t=is();var i=t.queue,a=i.dispatch;return n!==t.memoizedState&&(W.flags|=2048,Ns(9,{destroy:void 0},js.bind(null,i,n),null)),[r,a,e]}function js(e,t){e.action=t}function Ms(e){var t=is(),n=G;if(n!==null)return As(t,n,e);is(),t=t.memoizedState,n=is();var r=n.queue.dispatch;return n.memoizedState=e,[t,r,!1]}function Ns(e,t,n,r){return e={tag:e,create:n,deps:r,inst:t,next:null},t=W.updateQueue,t===null&&(t=as(),W.updateQueue=t),n=t.lastEffect,n===null?t.lastEffect=e.next=e:(r=n.next,n.next=e,e.next=r,t.lastEffect=e),e}function Ps(){return is().memoizedState}function Fs(e,t,n,r){var i=rs();W.flags|=e,i.memoizedState=Ns(1|t,{destroy:void 0},n,r===void 0?null:r)}function Is(e,t,n,r){var i=is();r=r===void 0?null:r;var a=i.memoizedState.inst;G!==null&&r!==null&&Yo(r,G.memoizedState.deps)?i.memoizedState=Ns(t,a,n,r):(W.flags|=e,i.memoizedState=Ns(1|t,a,n,r))}function Ls(e,t){Fs(8390656,8,e,t)}function Rs(e,t){Is(2048,8,e,t)}function zs(e){W.flags|=4;var t=W.updateQueue;if(t===null)t=as(),W.updateQueue=t,t.events=[e];else{var n=t.events;n===null?t.events=[e]:n.push(e)}}function Bs(e){var t=is().memoizedState;return zs({ref:t,nextImpl:e}),function(){if(q&2)throw Error(s(440));return t.impl.apply(void 0,arguments)}}function Vs(e,t){return Is(4,2,e,t)}function Hs(e,t){return Is(4,4,e,t)}function Us(e,t){if(typeof t==`function`){e=e();var n=t(e);return function(){typeof n==`function`?n():t(null)}}if(t!=null)return e=e(),t.current=e,function(){t.current=null}}function Ws(e,t,n){n=n==null?null:n.concat([e]),Is(4,4,Us.bind(null,t,e),n)}function Gs(){}function Ks(e,t){var n=is();t=t===void 0?null:t;var r=n.memoizedState;return t!==null&&Yo(t,r[1])?r[0]:(n.memoizedState=[e,t],e)}function qs(e,t){var n=is();t=t===void 0?null:t;var r=n.memoizedState;if(t!==null&&Yo(t,r[1]))return r[0];if(r=e(),Uo){et(!0);try{e()}finally{et(!1)}}return n.memoizedState=[r,t],r}function Js(e,t,n){return n===void 0||zo&1073741824&&!(Y&261930)?e.memoizedState=t:(e.memoizedState=n,e=Md(),W.lanes|=e,od|=e,n)}function Ys(e,t,n,r){return Hr(n,t)?n:Co.current===null?!(zo&106)||zo&1073741824&&!(Y&261930)?(jc=!0,e.memoizedState=n):(e=Md(),W.lanes|=e,od|=e,t):(e=Js(e,n,r),Hr(e,t)||(jc=!0),e)}function Xs(e,t,n,r,i){var a=j.p;j.p=a!==0&&8>a?a:8;var o=A.T,s={};s.types=o===null?null:o.types,A.T=s,cc(e,!1,t,n);try{var c=i(),l=A.S;l!==null&&l(s,c),typeof c==`object`&&c&&typeof c.then==`function`?sc(e,t,Ua(c,r),jd(e)):sc(e,t,r,jd(e))}catch(n){sc(e,t,{then:function(){},status:`rejected`,reason:n},jd())}finally{j.p=a,o!==null&&s.types!==null&&(o.types=s.types),A.T=o}}function Zs(){}function Qs(e,t,n,r){if(e.tag!==5)throw Error(s(476));var i=$s(e).queue;Xs(e,i,t,xe,n===null?Zs:function(){return ec(e),n(r)})}function $s(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:xe,baseState:xe,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:ls,lastRenderedState:xe},next:null};var n={};return t.next={memoizedState:n,baseState:n,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:ls,lastRenderedState:n},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function ec(e){var t=$s(e);t.next===null&&(t=e.alternate.memoizedState),sc(e,t.next.queue,{},jd())}function tc(){return Ta(sh)}function nc(){return is().memoizedState}function rc(){return is().memoizedState}function ic(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var n=jd();e=ho(n);var r=go(t,e,n);r!==null&&(Pd(r,t,n),_o(r,t,n)),t={cache:Ma()},e.payload=t;return}t=t.return}}function ac(e,t,n){var r=jd();n={lane:r,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null},lc(e)?uc(t,n):(n=Ei(e,t,n,r),n!==null&&(Pd(n,e,r),dc(n,t,r)))}function oc(e,t,n){sc(e,t,n,jd())}function sc(e,t,n,r){var i={lane:r,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null};if(lc(e))uc(t,i);else{var a=e.alternate;if(e.lanes===0&&(a===null||a.lanes===0)&&(a=t.lastRenderedReducer,a!==null))try{var o=t.lastRenderedState,s=a(o,n);if(i.hasEagerState=!0,i.eagerState=s,Hr(s,o))return Ti(e,t,i,0),$u===null&&z(),!1}catch{}if(n=Ei(e,t,i,r),n!==null)return Pd(n,e,r),dc(n,t,r),!0}return!1}function cc(e,t,n,r){if(r={lane:2,revertLane:Pf(),gesture:null,action:r,hasEagerState:!1,eagerState:null,next:null},lc(e)){if(t)throw Error(s(479))}else t=Ei(e,n,r,2),t!==null&&Pd(t,e,2)}function lc(e){var t=e.alternate;return e===W||t!==null&&t===W}function uc(e,t){Ho=Vo=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function dc(e,t,n){if(n&4194048){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,_t(e,n)}}var fc={readContext:Ta,use:ss,useCallback:Jo,useContext:Jo,useEffect:Jo,useImperativeHandle:Jo,useLayoutEffect:Jo,useInsertionEffect:Jo,useMemo:Jo,useReducer:Jo,useRef:Jo,useState:Jo,useDebugValue:Jo,useDeferredValue:Jo,useTransition:Jo,useSyncExternalStore:Jo,useId:Jo,useHostTransitionStatus:Jo,useFormState:Jo,useActionState:Jo,useOptimistic:Jo,useMemoCache:Jo,useCacheRefresh:Jo,useEffectEvent:Jo},pc={readContext:Ta,use:ss,useCallback:function(e,t){return rs().memoizedState=[e,t===void 0?null:t],e},useContext:Ta,useEffect:Ls,useImperativeHandle:function(e,t,n){n=n==null?null:n.concat([e]),Fs(4194308,4,Us.bind(null,t,e),n)},useLayoutEffect:function(e,t){return Fs(4194308,4,e,t)},useInsertionEffect:function(e,t){Fs(4,2,e,t)},useMemo:function(e,t){var n=rs();t=t===void 0?null:t;var r=e();if(Uo){et(!0);try{e()}finally{et(!1)}}return n.memoizedState=[r,t],r},useReducer:function(e,t,n){var r=rs();if(n!==void 0){var i=n(t);if(Uo){et(!0);try{n(t)}finally{et(!1)}}}else i=t;return r.memoizedState=r.baseState=i,e={pending:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:i},r.queue=e,e=e.dispatch=ac.bind(null,W,e),[r.memoizedState,e]},useRef:function(e){var t=rs();return e={current:e},t.memoizedState=e},useState:function(e){e=ys(e);var t=e.queue,n=oc.bind(null,W,t);return t.dispatch=n,[e.memoizedState,n]},useDebugValue:Gs,useDeferredValue:function(e,t){return Js(rs(),e,t)},useTransition:function(){var e=ys(!1);return e=Xs.bind(null,W,e.queue,!0,!1),rs().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,n){var r=W,i=rs();if(B){if(n===void 0)throw Error(s(407));n=n()}else{if(n=t(),$u===null)throw Error(s(349));Y&127||ms(r,t,n)}i.memoizedState=n;var a={value:n,getSnapshot:t};return i.queue=a,Ls(gs.bind(null,r,a,e),[e]),r.flags|=2048,Ns(9,{destroy:void 0},hs.bind(null,r,a,n,t),null),n},useId:function(){var e=rs(),t=$u.identifierPrefix;if(B){var n=Zi,r=Xi;n=(r&~(1<<32-tt(r)-1)).toString(32)+n,t=`_`+t+`R_`+n,n=Wo++,0<n&&(t+=`H`+n.toString(32)),t+=`_`}else n=qo++,t=`_`+t+`r_`+n.toString(32)+`_`;return e.memoizedState=t},useHostTransitionStatus:tc,useFormState:Os,useActionState:Os,useOptimistic:function(e){var t=rs();t.memoizedState=t.baseState=e;var n={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return t.queue=n,t=cc.bind(null,W,!0,n),n.dispatch=t,[e,t]},useMemoCache:cs,useCacheRefresh:function(){return rs().memoizedState=ic.bind(null,W)},useEffectEvent:function(e){var t=rs(),n={impl:e};return t.memoizedState=n,function(){if(q&2)throw Error(s(440));return n.impl.apply(void 0,arguments)}}},mc={readContext:Ta,use:ss,useCallback:Ks,useContext:Ta,useEffect:Rs,useImperativeHandle:Ws,useInsertionEffect:Vs,useLayoutEffect:Hs,useMemo:qs,useReducer:us,useRef:Ps,useState:function(){return us(ls)},useDebugValue:Gs,useDeferredValue:function(e,t){return Ys(is(),G.memoizedState,e,t)},useTransition:function(){var e=us(ls)[0],t=is().memoizedState;return[typeof e==`boolean`?e:os(e),t]},useSyncExternalStore:ps,useId:nc,useHostTransitionStatus:tc,useFormState:ks,useActionState:ks,useOptimistic:function(e,t){return bs(is(),G,e,t)},useMemoCache:cs,useCacheRefresh:rc,useEffectEvent:Bs},hc={readContext:Ta,use:ss,useCallback:Ks,useContext:Ta,useEffect:Rs,useImperativeHandle:Ws,useInsertionEffect:Vs,useLayoutEffect:Hs,useMemo:qs,useReducer:fs,useRef:Ps,useState:function(){return fs(ls)},useDebugValue:Gs,useDeferredValue:function(e,t){var n=is();return G===null?Js(n,e,t):Ys(n,G.memoizedState,e,t)},useTransition:function(){var e=fs(ls)[0],t=is().memoizedState;return[typeof e==`boolean`?e:os(e),t]},useSyncExternalStore:ps,useId:nc,useHostTransitionStatus:tc,useFormState:Ms,useActionState:Ms,useOptimistic:function(e,t){var n=is();return G===null?(n.baseState=e,[e,n.queue.dispatch]):bs(n,G,e,t)},useMemoCache:cs,useCacheRefresh:rc,useEffectEvent:Bs};function gc(e,t,n,r){t=e.memoizedState,n=n(r,t),n=n==null?t:D({},t,n),e.memoizedState=n,e.lanes===0&&(e.updateQueue.baseState=n)}var _c={enqueueSetState:function(e,t,n){e=e._reactInternals;var r=jd(),i=ho(r);i.payload=t,n!=null&&(i.callback=n),t=go(e,i,r),t!==null&&(Pd(t,e,r),_o(t,e,r))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var r=jd(),i=ho(r);i.tag=1,i.payload=t,n!=null&&(i.callback=n),t=go(e,i,r),t!==null&&(Pd(t,e,r),_o(t,e,r))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=jd(),r=ho(n);r.tag=2,t!=null&&(r.callback=t),t=go(e,r,n),t!==null&&(Pd(t,e,n),_o(t,e,n))}};function vc(e,t,n,r,i,a,o){return e=e.stateNode,typeof e.shouldComponentUpdate==`function`?e.shouldComponentUpdate(r,a,o):t.prototype&&t.prototype.isPureReactComponent?!Ur(n,r)||!Ur(i,a):!0}function yc(e,t,n,r){e=t.state,typeof t.componentWillReceiveProps==`function`&&t.componentWillReceiveProps(n,r),typeof t.UNSAFE_componentWillReceiveProps==`function`&&t.UNSAFE_componentWillReceiveProps(n,r),t.state!==e&&_c.enqueueReplaceState(t,t.state,null)}function bc(e,t){var n=t;if(`ref`in t)for(var r in n={},t)r!==`ref`&&(n[r]=t[r]);if(e=e.defaultProps)for(var i in n===t&&(n=D({},n)),e)n[i]===void 0&&(n[i]=e[i]);return n}function xc(e){xi(e)}function Sc(e){console.error(e)}function Cc(e){xi(e)}function wc(e,t){try{var n=e.onUncaughtError;n(t.value,{componentStack:t.stack})}catch(e){setTimeout(function(){throw e})}}function Tc(e,t,n){try{var r=e.onCaughtError;r(n.value,{componentStack:n.stack,errorBoundary:t.tag===1?t.stateNode:null})}catch(e){setTimeout(function(){throw e})}}function Ec(e,t,n){return n=ho(n),n.tag=3,n.payload={element:null},n.callback=function(){wc(e,t)},n}function Dc(e){return e=ho(e),e.tag=3,e}function Oc(e,t,n,r){var i=n.type.getDerivedStateFromError;if(typeof i==`function`){var a=r.value;e.payload=function(){return i(a)},e.callback=function(){Tc(t,n,r)}}var o=n.stateNode;o!==null&&typeof o.componentDidCatch==`function`&&(e.callback=function(){Tc(t,n,r),typeof i!=`function`&&(vd===null?vd=new Set([this]):vd.add(this));var e=r.stack;this.componentDidCatch(r.value,{componentStack:e===null?``:e})})}function kc(e,t,n,r,i){if(n.flags|=32768,typeof r==`object`&&r&&typeof r.then==`function`){if(t=n.alternate,t!==null&&Sa(t,n,i,!0),n=Oo.current,n!==null){switch(n.tag){case 31:case 13:case 19:return ko===null?Kd():n.alternate===null&&ad===0&&(ad=3),n.flags&=-257,n.flags|=65536,n.lanes=i,r===Qa?n.flags|=16384:(t=n.updateQueue,t===null?n.updateQueue=new Set([r]):t.add(r),mf(e,r,i)),!1;case 22:return n.flags|=65536,r===Qa?n.flags|=16384:(t=n.updateQueue,t===null?(t={transitions:null,markerInstances:null,retryQueue:new Set([r])},n.updateQueue=t):(n=t.retryQueue,n===null?t.retryQueue=new Set([r]):n.add(r)),mf(e,r,i)),!1}throw Error(s(435,n.tag))}return mf(e,r,i),Kd(),!1}if(B)return t=Oo.current,t===null?(r!==sa&&(t=Error(s(423),{cause:r}),ma(Hi(t,n))),e=e.current.alternate,e.flags|=65536,i&=-i,e.lanes|=i,r=Hi(r,n),i=Ec(e.stateNode,r,i),vo(e,i),ad!==4&&(ad=2)):(!(t.flags&65536)&&(t.flags|=256),t.flags|=65536,t.lanes=i,r!==sa&&(e=Error(s(422),{cause:r}),ma(Hi(e,n)))),!1;var a=Error(s(520),{cause:r});if(a=Hi(a,n),dd===null?dd=[a]:dd.push(a),ad!==4&&(ad=2),t===null)return!0;r=Hi(r,n),n=t;do{switch(n.tag){case 3:return n.flags|=65536,e=i&-i,n.lanes|=e,e=Ec(n.stateNode,r,e),vo(n,e),!1;case 1:if(t=n.type,a=n.stateNode,!(n.flags&128)&&(typeof t.getDerivedStateFromError==`function`||a!==null&&typeof a.componentDidCatch==`function`&&(vd===null||!vd.has(a))))return n.flags|=65536,i&=-i,n.lanes|=i,i=Dc(i),Oc(i,e,n,r),vo(n,i),!1;break;case 22:if(n.memoizedState!==null)return n.flags|=65536,!1}n=n.return}while(n!==null);return!1}var Ac=Error(s(461)),jc=!1;function Mc(e,t,n,r){t.child=e===null?H(t,null,n,r):uo(t,e.child,n,r)}function Nc(e,t,n,r,i){n=n.render;var a=t.ref;if(`ref`in r){var o={};for(var s in r)s!==`ref`&&(o[s]=r[s])}else o=r;return wa(t),r=Xo(e,t,n,o,a,i),s=es(),e!==null&&!jc?(ts(e,t,i),sl(e,t,i)):(B&&s&&ea(t),t.flags|=1,Mc(e,t,r,i),t.child)}function Pc(e,t,n,r,i){if(e===null){var a=n.type;return typeof a==`function`&&!Ni(a)&&a.defaultProps===void 0&&n.compare===null?(t.tag=15,t.type=a,Fc(e,t,a,r,i)):(e=Ii(n.type,null,r,t,t.mode,i),e.ref=t.ref,e.return=t,t.child=e)}if(a=e.child,!cl(e,i)){var o=a.memoizedProps;if(n=n.compare,n=n===null?Ur:n,n(o,r)&&e.ref===t.ref)return sl(e,t,i)}return t.flags|=1,e=Pi(a,r),e.ref=t.ref,e.return=t,t.child=e}function Fc(e,t,n,r,i){if(e!==null){var a=e.memoizedProps;if(Ur(a,r)&&e.ref===t.ref){if(jc=!1,t.pendingProps=r=a,cl(e,i))e.flags&131072&&(jc=!0);else return t.lanes=e.lanes,sl(e,t,i)}}return Uc(e,t,n,r,i)}function Ic(e,t,n,r){var i=r.children,a=e===null?null:e.memoizedState;if(e===null&&t.stateNode===null&&(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),r.mode===`hidden`){if(t.flags&128){if(a=a===null?n:a.baseLanes|n,e!==null){for(r=t.child=e.child,i=0;r!==null;)i=i|r.lanes|r.childLanes,r=r.sibling;r=i&~a}else r=0,t.child=null;return Rc(e,t,a,n,r)}if(n&536870912)t.memoizedState={baseLanes:0,cachePool:null},e!==null&&qa(t,a===null?null:a.cachePool),a===null?Eo():To(t,a),Mo(t);else return r=t.lanes=536870912,Rc(e,t,a===null?n:a.baseLanes|n,n,r)}else a===null?(e!==null&&qa(t,null),Eo(),No()):(qa(t,a.cachePool),To(t,a),No(),t.memoizedState=null);return Mc(e,t,i,n),t.child}function Lc(e,t){return e!==null&&e.tag===22||t.stateNode!==null||(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),t.sibling}function Rc(e,t,n,r,i){var a=Ka();return a=a===null?null:{parent:ja._currentValue,pool:a},t.memoizedState={baseLanes:n,cachePool:a},e!==null&&qa(t,null),Eo(),Mo(t),e!==null&&Sa(e,t,r,!0),t.childLanes=i,null}function zc(e,t){return t=Qc({mode:t.mode,children:t.children},e.mode),t.ref=e.ref,e.child=t,t.return=e,t}function Bc(e,t,n){return uo(t,e.child,null,n),e=zc(t,t.pendingProps),e.flags|=2,Po(t),t.memoizedState=null,e}function Vc(e,t,n){var r=t.pendingProps,i=!!(t.flags&128);if(t.flags&=-129,e===null){if(B){if(r.mode===`hidden`)return e=zc(t,r),t.lanes=536870912,e.memoizedState={baseLanes:0,cachePool:null},Lc(null,e);if(jo(t),(e=ia)?(e=am(e,oa),e=e!==null&&e.data===`&`?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:Yi===null?null:{id:Xi,overflow:Zi},retryLane:536870912,hydrationErrors:null},n=zi(e),n.return=t,t.child=n,ra=t,ia=null)):e=null,e===null)throw ca(t);return t.lanes=536870912,null}return zc(t,r)}var a=e.memoizedState;if(a!==null){var o=a.dehydrated;if(jo(t),i){if(t.flags&256)t.flags&=-257,t=Bc(e,t,n);else if(t.memoizedState!==null)t.child=e.child,t.flags|=128,t=null;else throw Error(s(558))}else if(jc||Sa(e,t,n,!1),i=(n&e.childLanes)!==0,jc||i){if(Co.current===null){if(r=$u,r!==null&&(o=vt(r,n),o!==0&&o!==a.retryLane))throw a.retryLane=o,Di(e,o),Pd(r,e,o),Ac;Kd()}t=Bc(e,t,n)}else e=a.treeContext,ia=lm(o.nextSibling),ra=t,B=!0,aa=null,oa=!1,e!==null&&na(t,e),t=zc(t,r),t.flags|=134221824;return t}return e=Pi(e.child,{mode:r.mode,children:r.children}),e.ref=t.ref,t.child=e,e.return=t,e}function Hc(e,t){var n=t.ref;if(n===null)e!==null&&e.ref!==null&&(t.flags|=4194816);else{if(typeof n!=`function`&&typeof n!=`object`)throw Error(s(284));(e===null||e.ref!==n)&&(t.flags|=4194816)}}function Uc(e,t,n,r,i){return wa(t),n=Xo(e,t,n,r,void 0,i),r=es(),e!==null&&!jc?(ts(e,t,i),sl(e,t,i)):(B&&r&&ea(t),t.flags|=1,Mc(e,t,n,i),t.child)}function Wc(e,t,n,r,i,a){return wa(t),t.updateQueue=null,n=Qo(t,r,n,i),Zo(e),r=es(),e!==null&&!jc?(ts(e,t,a),sl(e,t,a)):(B&&r&&ea(t),t.flags|=1,Mc(e,t,n,a),t.child)}function Gc(e,t,n,r,i){if(wa(t),t.stateNode===null){var a=Ai,o=n.contextType;typeof o==`object`&&o&&(a=Ta(o)),a=new n(r,a),t.memoizedState=a.state!==null&&a.state!==void 0?a.state:null,a.updater=_c,t.stateNode=a,a._reactInternals=t,a=t.stateNode,a.props=r,a.state=t.memoizedState,a.refs={},po(t),o=n.contextType,a.context=typeof o==`object`&&o?Ta(o):Ai,a.state=t.memoizedState,o=n.getDerivedStateFromProps,typeof o==`function`&&(gc(t,n,o,r),a.state=t.memoizedState),typeof n.getDerivedStateFromProps==`function`||typeof a.getSnapshotBeforeUpdate==`function`||typeof a.UNSAFE_componentWillMount!=`function`&&typeof a.componentWillMount!=`function`||(o=a.state,typeof a.componentWillMount==`function`&&a.componentWillMount(),typeof a.UNSAFE_componentWillMount==`function`&&a.UNSAFE_componentWillMount(),o!==a.state&&_c.enqueueReplaceState(a,a.state,null),xo(t,r,a,i),bo(),a.state=t.memoizedState),typeof a.componentDidMount==`function`&&(t.flags|=4194308),r=!0}else if(e===null){a=t.stateNode;var s=t.memoizedProps,c=bc(n,s);a.props=c;var l=a.context,u=n.contextType;o=Ai,typeof u==`object`&&u&&(o=Ta(u));var d=n.getDerivedStateFromProps;u=typeof d==`function`||typeof a.getSnapshotBeforeUpdate==`function`,s=t.pendingProps!==s,u||typeof a.UNSAFE_componentWillReceiveProps!=`function`&&typeof a.componentWillReceiveProps!=`function`||(s||l!==o)&&yc(t,a,r,o),fo=!1;var f=t.memoizedState;a.state=f,xo(t,r,a,i),bo(),l=t.memoizedState,s||f!==l||fo?(typeof d==`function`&&(gc(t,n,d,r),l=t.memoizedState),(c=fo||vc(t,n,c,r,f,l,o))?(u||typeof a.UNSAFE_componentWillMount!=`function`&&typeof a.componentWillMount!=`function`||(typeof a.componentWillMount==`function`&&a.componentWillMount(),typeof a.UNSAFE_componentWillMount==`function`&&a.UNSAFE_componentWillMount()),typeof a.componentDidMount==`function`&&(t.flags|=4194308)):(typeof a.componentDidMount==`function`&&(t.flags|=4194308),t.memoizedProps=r,t.memoizedState=l),a.props=r,a.state=l,a.context=o,r=c):(typeof a.componentDidMount==`function`&&(t.flags|=4194308),r=!1)}else{a=t.stateNode,mo(e,t),o=t.memoizedProps,u=bc(n,o),a.props=u,d=t.pendingProps,f=a.context,l=n.contextType,c=Ai,typeof l==`object`&&l&&(c=Ta(l)),s=n.getDerivedStateFromProps,(l=typeof s==`function`||typeof a.getSnapshotBeforeUpdate==`function`)||typeof a.UNSAFE_componentWillReceiveProps!=`function`&&typeof a.componentWillReceiveProps!=`function`||(o!==d||f!==c)&&yc(t,a,r,c),fo=!1,f=t.memoizedState,a.state=f,xo(t,r,a,i),bo();var p=t.memoizedState;o!==d||f!==p||fo||e!==null&&e.dependencies!==null&&Ca(e.dependencies)?(typeof s==`function`&&(gc(t,n,s,r),p=t.memoizedState),(u=fo||vc(t,n,u,r,f,p,c)||e!==null&&e.dependencies!==null&&Ca(e.dependencies))?(l||typeof a.UNSAFE_componentWillUpdate!=`function`&&typeof a.componentWillUpdate!=`function`||(typeof a.componentWillUpdate==`function`&&a.componentWillUpdate(r,p,c),typeof a.UNSAFE_componentWillUpdate==`function`&&a.UNSAFE_componentWillUpdate(r,p,c)),typeof a.componentDidUpdate==`function`&&(t.flags|=4),typeof a.getSnapshotBeforeUpdate==`function`&&(t.flags|=1024)):(typeof a.componentDidUpdate!=`function`||o===e.memoizedProps&&f===e.memoizedState||(t.flags|=4),typeof a.getSnapshotBeforeUpdate!=`function`||o===e.memoizedProps&&f===e.memoizedState||(t.flags|=1024),t.memoizedProps=r,t.memoizedState=p),a.props=r,a.state=p,a.context=c,r=u):(typeof a.componentDidUpdate!=`function`||o===e.memoizedProps&&f===e.memoizedState||(t.flags|=4),typeof a.getSnapshotBeforeUpdate!=`function`||o===e.memoizedProps&&f===e.memoizedState||(t.flags|=1024),r=!1)}return a=r,Hc(e,t),r=!!(t.flags&128),a||r?(a=t.stateNode,n=r&&typeof n.getDerivedStateFromError!=`function`?null:a.render(),t.flags|=1,e!==null&&r?(t.child=uo(t,e.child,null,i),t.child=uo(t,null,n,i)):Mc(e,t,n,i),t.memoizedState=a.state,e=t.child):e=sl(e,t,i),e}function Kc(e,t,n,r){return fa(),t.flags|=256,Mc(e,t,n,r),t.child}var qc={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function Jc(e){return{baseLanes:e,cachePool:Ja()}}function Yc(e,t,n){return e=e===null?0:e.childLanes&~n,t&&(e|=ld),e}function Xc(e,t,n){var r=t.pendingProps,i=!1,a=!!(t.flags&128),o;if((o=a)||(o=e!==null&&e.memoizedState===null?!1:!!(Fo.current&2)),o&&(i=!0,t.flags&=-129),o=!!(t.flags&32),t.flags&=-33,e===null){if(B){if(i?Ao(t):No(),(e=ia)?(e=am(e,oa),e=e!==null&&e.data!==`&`?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:Yi===null?null:{id:Xi,overflow:Zi},retryLane:536870912,hydrationErrors:null},n=zi(e),n.return=t,t.child=n,ra=t,ia=null)):e=null,e===null)throw ca(t);return t.lanes=sm(e)?32:536870912,null}return a=r.children,r=r.fallback,i?(No(),i=t.mode,a=Qc({mode:`hidden`,children:a},i),r=Li(r,i,n,null),a.return=t,r.return=t,a.sibling=r,t.child=a,r=t.child,r.memoizedState=Jc(n),r.childLanes=Yc(e,o,n),t.memoizedState=qc,Lc(null,r)):(Ao(t),Zc(t,a))}var s=e.memoizedState;if(s!==null){var c=s.dehydrated;if(c!==null)return el(e,t,a,o,r,c,s,n)}return i?(No(),i=r.fallback,a=t.mode,s=e.child,c=s.sibling,r=Pi(s,{mode:`hidden`,children:r.children}),r.subtreeFlags=s.subtreeFlags&1206910976,c===null?(i=Li(i,a,n,null),i.flags|=2):i=Pi(c,i),i.return=t,r.return=t,r.sibling=i,t.child=r,Lc(null,r),r=t.child,i=e.child.memoizedState,i===null?i=Jc(n):(a=i.cachePool,a===null?a=Ja():(s=ja._currentValue,a=a.parent===s?a:{parent:s,pool:s}),i={baseLanes:i.baseLanes|n,cachePool:a}),r.memoizedState=i,r.childLanes=Yc(e,o,n),t.memoizedState=qc,Lc(e.child,r)):(Ao(t),n=e.child,e=n.sibling,n=Pi(n,{mode:`visible`,children:r.children}),n.return=t,n.sibling=null,e!==null&&(o=t.deletions,o===null?(t.deletions=[e],t.flags|=16):o.push(e)),t.child=n,t.memoizedState=null,n)}function Zc(e,t){return t=Qc({mode:`visible`,children:t},e.mode),t.return=e,e.child=t}function Qc(e,t){return e=Mi(22,e,null,t),e.lanes=0,e}function $c(e,t,n){return uo(t,e.child,null,n),e=Zc(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function el(e,t,n,r,i,a,o,c){if(n)return t.flags&256?(Ao(t),t.flags&=-257,$c(e,t,c)):t.memoizedState===null?(No(),a=i.fallback,o=t.mode,i=Qc({mode:`visible`,children:i.children},o),a=Li(a,o,c,null),a.flags|=2,i.return=t,a.return=t,i.sibling=a,t.child=i,uo(t,e.child,null,c),i=t.child,i.memoizedState=Jc(c),i.childLanes=Yc(e,r,c),t.memoizedState=qc,Lc(null,i)):(No(),t.child=e.child,t.flags|=128,null);if(Ao(t),sm(a)){if(r=a.nextSibling&&a.nextSibling.dataset,r)var l=r.dgst;return r=l,r!==``&&(i=Error(s(419)),i.stack=``,i.digest=r,ma({value:i,source:null,stack:null})),$c(e,t,c)}if(jc||Sa(e,t,c,!1),r=(c&e.childLanes)!==0,jc||r){if(Co.current!==null)return $c(e,t,c);if(r=$u,r!==null&&(i=vt(r,c),i!==0&&i!==o.retryLane))throw o.retryLane=i,Di(e,i),Pd(r,e,i),Ac;return om(a)||Kd(),$c(e,t,c)}return om(a)?(t.flags|=192,t.child=e.child,null):(e=o.treeContext,ia=lm(a.nextSibling),ra=t,B=!0,aa=null,oa=!1,e!==null&&na(t,e),t=Zc(t,i.children),t.flags|=134221824,t)}function tl(e,t,n){e.lanes|=t;var r=e.alternate;r!==null&&(r.lanes|=t),ba(e.return,t,n)}function nl(e){for(var t=null;e!==null;){var n=e.alternate;n!==null&&Ro(n)===null&&(t=e),e=e.sibling}return t}function rl(e,t,n,r,i,a){var o=e.memoizedState;o===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:r,tail:n,tailMode:i,treeForkCount:a}:(o.isBackwards=t,o.rendering=null,o.renderingStartTime=0,o.last=r,o.tail=n,o.tailMode=i,o.treeForkCount=a)}function il(e){var t=e.child;for(e.child=null;t!==null;){var n=t.sibling;t.sibling=e.child,e.child=t,t=n}}function al(e,t,n){var r=t.pendingProps,i=r.revealOrder,a=r.tail;r=r.children;var o=Fo.current;if(t.flags&128)return Io(t,o),null;var s=!!(o&2);if(s?(o=o&1|2,t.flags|=128):o&=1,Io(t,o),i===`backwards`&&e!==null?(il(e),Mc(e,t,r,n),il(e)):Mc(e,t,r,n),r=B?Ki:0,!s&&e!==null&&e.flags&128)a:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&tl(e,n,t);else if(e.tag===19)tl(e,n,t);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break a;for(;e.sibling===null;){if(e.return===null||e.return===t)break a;e=e.return}e.sibling.return=e.return,e=e.sibling}switch(i){case`backwards`:n=nl(t.child),n===null?(i=t.child,t.child=null):(i=n.sibling,n.sibling=null,il(t)),rl(t,!0,i,null,a,r);break;case`unstable_legacy-backwards`:for(n=null,i=t.child,t.child=null;i!==null;){if(e=i.alternate,e!==null&&Ro(e)===null){t.child=i;break}e=i.sibling,i.sibling=n,n=i,i=e}rl(t,!0,n,null,a,r);break;case`together`:rl(t,!1,null,null,void 0,r);break;case`independent`:t.memoizedState=null;break;default:n=nl(t.child),n===null?(i=t.child,t.child=null):(i=n.sibling,n.sibling=null),rl(t,!1,i,n,a,r)}return t.child}function ol(e,t,n){var r=t.pendingProps;return va(t,t.type,r.value),Mc(e,t,r.children,n),t.child}function sl(e,t,n){if(e!==null&&(t.dependencies=e.dependencies),od|=t.lanes,(n&t.childLanes)===0){if(e!==null){if(Sa(e,t,n,!1),(n&t.childLanes)===0)return null}else return null}if(e!==null&&t.child!==e.child)throw Error(s(153));if(t.child!==null){for(e=t.child,n=Pi(e,e.pendingProps),t.child=n,n.return=t;e.sibling!==null;)e=e.sibling,n=n.sibling=Pi(e,e.pendingProps),n.return=t;n.sibling=null}return t.child}function cl(e,t){return(e.lanes&t)!==0||(e=e.dependencies,!!(e!==null&&Ca(e)))}function ll(e,t,n){switch(t.tag){case 3:Ae(t,t.stateNode.containerInfo),va(t,ja,e.memoizedState.cache),fa();break;case 27:case 5:Me(t);break;case 4:Ae(t,t.stateNode.containerInfo);break;case 10:va(t,t.type,t.memoizedProps.value);break;case 31:if(t.memoizedState!==null)return t.flags|=128,jo(t),null;break;case 13:var r=t.memoizedState;if(r!==null){if(r.dehydrated!==null)return Ao(t),t.flags|=128,null;r=Sa(e,t,n,!1);var i=t.child.childLanes;return r||(n&i)!==0?Xc(e,t,n):(Ao(t),e=sl(e,t,n),e===null?null:e.sibling)}Ao(t);break;case 19:if(t.flags&128)return al(e,t,n);if(i=!!(e.flags&128),r=(n&t.childLanes)!==0,r||=(Sa(e,t,n,!1),(n&t.childLanes)!==0),i){if(r)return al(e,t,n);t.flags|=128}if(i=t.memoizedState,i!==null&&(i.rendering=null,i.tail=null,i.lastEffect=null),Io(t,Fo.current),r)break;return null;case 22:return t.lanes=0,Ic(e,t,n,t.pendingProps);case 24:va(t,ja,e.memoizedState.cache)}return sl(e,t,n)}function ul(e,t,n){if(e!==null){if(e.memoizedProps!==t.pendingProps)jc=!0;else{if(!cl(e,n)&&!(t.flags&128))return jc=!1,ll(e,t,n);jc=!!(e.flags&131072)}}else jc=!1,B&&t.flags&1048576&&$i(t,Ki,t.index);switch(t.lanes=0,t.tag){case 16:a:{var r=t.pendingProps;if(e=eo(t.elementType),t.type=e,typeof e==`function`)Ni(e)?(r=bc(e,r),t.tag=1,t=Gc(null,t,e,r,n)):(t.tag=0,t=Uc(null,t,e,r,n));else{if(e!=null){var i=e.$$typeof;if(i===oe){t.tag=11,t=Nc(null,t,e,r,n);break a}if(i===le){t.tag=14,t=Pc(null,t,e,r,n);break a}if(i===ae){t.tag=10,t.type=e,t=ol(null,t,n);break a}}throw t=ye(e)||e,Error(s(306,t,``))}}return t;case 0:return Uc(e,t,t.type,t.pendingProps,n);case 1:return r=t.type,i=bc(r,t.pendingProps),Gc(e,t,r,i,n);case 3:a:{if(Ae(t,t.stateNode.containerInfo),e===null)throw Error(s(387));r=t.pendingProps;var a=t.memoizedState;i=a.element,mo(e,t),xo(t,r,null,n);var o=t.memoizedState;if(r=o.cache,va(t,ja,r),r!==a.cache&&xa(t,[ja],n,!0),bo(),r=o.element,a.isDehydrated){if(a={element:r,isDehydrated:!1,cache:o.cache},t.updateQueue.baseState=a,t.memoizedState=a,t.flags&256){t=Kc(e,t,r,n);break a}if(r!==i){i=Hi(Error(s(424)),t),ma(i),t=Kc(e,t,r,n);break a}switch(e=t.stateNode.containerInfo,e.nodeType){case 9:e=e.body;break;default:e=e.nodeName===`HTML`?e.ownerDocument.body:e}for(ia=lm(e.firstChild),ra=t,B=!0,aa=null,oa=!0,n=H(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|134221824,n=n.sibling}else{if(fa(),r===i){t=sl(e,t,n);break a}Mc(e,t,r,n)}t=t.child}return t;case 26:return Hc(e,t),e===null?(n=Nm(t.type,null,t.pendingProps,null))?t.memoizedState=n:B||(t.stateNode=fp(t.type,t.pendingProps,Oe.current,t)):t.memoizedState=Nm(t.type,e.memoizedProps,t.pendingProps,e.memoizedState),null;case 27:return Me(t),e===null&&B&&(r=t.stateNode=hm(t.type,t.pendingProps,Oe.current),ra=t,oa=!0,i=ia,Sp(t.type)?(um=i,ia=lm(r.firstChild)):ia=i),Mc(e,t,t.pendingProps.children,n),Hc(e,t),e===null&&(t.flags|=4194304),t.child;case 5:return e===null&&B&&((i=r=ia)&&(r=rm(r,t.type,t.pendingProps,oa),r===null?i=!1:(t.stateNode=r,ra=t,ia=lm(r.firstChild),oa=!1,i=!0)),i||ca(t)),Me(t),i=t.type,a=t.pendingProps,o=e===null?null:e.memoizedProps,r=a.children,pp(i,a)?r=null:o!==null&&pp(i,o)&&(t.flags|=32),t.memoizedState!==null&&(i=Xo(e,t,$o,null,null,n),sh._currentValue=i),Hc(e,t),Mc(e,t,r,n),t.child;case 6:return e===null&&B&&((e=n=ia)&&(n=im(n,t.pendingProps,oa),n===null?e=!1:(t.stateNode=n,ra=t,ia=null,e=!0)),e||ca(t)),null;case 13:return Xc(e,t,n);case 4:return Ae(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=uo(t,null,r,n):Mc(e,t,r,n),t.child;case 11:return Nc(e,t,t.type,t.pendingProps,n);case 7:return r=t.pendingProps,Hc(e,t),Mc(e,t,r,n),t.child;case 8:return Mc(e,t,t.pendingProps.children,n),t.child;case 12:return Mc(e,t,t.pendingProps.children,n),t.child;case 10:return ol(e,t,n);case 9:return i=t.type._context,r=t.pendingProps.children,wa(t),i=Ta(i),r=r(i),t.flags|=1,Mc(e,t,r,n),t.child;case 14:return Pc(e,t,t.type,t.pendingProps,n);case 15:return Fc(e,t,t.type,t.pendingProps,n);case 19:return al(e,t,n);case 31:return Vc(e,t,n);case 22:return Ic(e,t,n,t.pendingProps);case 24:return wa(t),r=Ta(ja),e===null?(i=Ka(),i===null&&(i=$u,a=Ma(),i.pooledCache=a,a.refCount++,a!==null&&(i.pooledCacheLanes|=n),i=a),t.memoizedState={parent:r,cache:i},po(t),va(t,ja,i)):((e.lanes&n)!==0&&(mo(e,t),xo(t,null,null,n),bo()),i=e.memoizedState,a=t.memoizedState,i.parent===r?(r=a.cache,va(t,ja,r),r!==i.cache&&xa(t,[ja],n,!0)):(i={parent:r,cache:r},t.memoizedState=i,t.lanes===0&&(t.memoizedState=t.updateQueue.baseState=i),va(t,ja,r))),Mc(e,t,t.pendingProps.children,n),t.child;case 30:return t.stateNode===null&&(t.stateNode={autoName:null,paired:null,clones:null,ref:null}),r=t.pendingProps,r.name!=null&&r.name!==`auto`?t.flags|=e===null?18882560:18874368:B&&ea(t),e!==null&&e.memoizedProps.name!==r.name?t.flags|=4194816:Hc(e,t),Mc(e,t,r.children,n),t.child;case 29:throw t.pendingProps}throw Error(s(156,t.tag))}function dl(e){e.flags|=4}function fl(e,t,n,r,i){var a;if((a=!!(e.mode&32))&&(a=n===null?Jm(t,r):Jm(t,r)&&(r.src!==n.src||r.srcSet!==n.srcSet)),a){if(e.flags|=16777216,(i&335544128)===i){if(e.stateNode.complete)e.flags|=8192;else if(Ud())e.flags|=8192;else throw to=Qa,Xa}}else e.flags&=-16777217}function pl(e,t){if(t.type!==`stylesheet`||t.state.loading&4)e.flags&=-16777217;else if(e.flags|=16777216,!Ym(t)){if(Ud())e.flags|=8192;else throw to=Qa,Xa}}function ml(e,t){t!==null&&(e.flags|=4),e.flags&16384&&(t=e.tag===22?536870912:ft(),e.lanes|=t,ud|=t)}function hl(e,t){if(!B)switch(e.tailMode){case`visible`:break;case`collapsed`:for(var n=e.tail,r=null;n!==null;)n.alternate!==null&&(r=n),n=n.sibling;r===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:r.sibling=null;break;default:for(t=e.tail,n=null;t!==null;)t.alternate!==null&&(n=t),t=t.sibling;n===null?e.tail=null:n.sibling=null}}function gl(e){var t=e.alternate!==null&&e.alternate.child===e.child,n=0,r=0;if(t)for(var i=e.child;i!==null;)n|=i.lanes|i.childLanes,r|=i.subtreeFlags&1206910976,r|=i.flags&1206910976,i.return=e,i=i.sibling;else for(i=e.child;i!==null;)n|=i.lanes|i.childLanes,r|=i.subtreeFlags,r|=i.flags,i.return=e,i=i.sibling;return e.subtreeFlags|=r,e.childLanes=n,t}function _l(e,t,n){var r=t.pendingProps;switch(ta(t),t.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return gl(t),null;case 1:return gl(t),null;case 3:return n=t.stateNode,r=null,e!==null&&(r=e.memoizedState.cache),t.memoizedState.cache!==r&&(t.flags|=2048),ya(ja),je(),n.pendingContext&&(n.context=n.pendingContext,n.pendingContext=null),(e===null||e.child===null)&&(da(t)?dl(t):e===null||e.memoizedState.isDehydrated&&!(t.flags&256)||(t.flags|=1024,pa())),gl(t),null;case 26:var i=t.type,a=t.memoizedState;return e===null?(dl(t),a===null?(gl(t),fl(t,i,null,r,n)):(gl(t),pl(t,a))):a?a===e.memoizedState?(gl(t),t.flags&=-16777217):(dl(t),gl(t),pl(t,a)):(e=e.memoizedProps,e!==r&&dl(t),gl(t),fl(t,i,e,r,n)),null;case 27:if(Ne(t),n=Oe.current,i=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==r&&dl(t);else{if(!r){if(t.stateNode===null)throw Error(s(166));return gl(t),t.subtreeFlags&=-33554433,null}e=Ee.current,da(t)?la(t,e):(e=hm(i,r,n),t.stateNode=e,dl(t))}return gl(t),t.subtreeFlags&=-33554433,null;case 5:if(Ne(t),i=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==r&&dl(t);else{if(!r){if(t.stateNode===null)throw Error(s(166));return gl(t),t.subtreeFlags&=-33554433,null}if(a=Ee.current,da(t))la(t,a);else{var o=lp(Oe.current);switch(a){case 1:a=o.createElementNS(`http://www.w3.org/2000/svg`,i);break;case 2:a=o.createElementNS(`http://www.w3.org/1998/Math/MathML`,i);break;default:switch(i){case`svg`:a=o.createElementNS(`http://www.w3.org/2000/svg`,i);break;case`math`:a=o.createElementNS(`http://www.w3.org/1998/Math/MathML`,i);break;case`script`:a=o.createElement(`div`),a.innerHTML=`<script><\/script>`,a=a.removeChild(a.firstChild);break;case`select`:a=typeof r.is==`string`?o.createElement(`select`,{is:r.is}):o.createElement(`select`),r.multiple?a.multiple=!0:r.size&&(a.size=r.size);break;default:a=typeof r.is==`string`?o.createElement(i,{is:r.is}):o.createElement(i)}}a[wt]=t,a[Tt]=r;a:for(o=t.child;o!==null;){if(o.tag===5||o.tag===6)a.appendChild(o.stateNode);else if(o.tag!==4&&o.tag!==27&&o.child!==null){o.child.return=o,o=o.child;continue}if(o===t)break a;for(;o.sibling===null;){if(o.return===null||o.return===t)break a;o=o.return}o.sibling.return=o.return,o=o.sibling}t.stateNode=a;a:switch(np(a,i,r),i){case`button`:case`input`:case`select`:case`textarea`:r=!!r.autoFocus;break a;case`img`:r=!0;break a;default:r=!1}r&&dl(t)}}return gl(t),t.subtreeFlags&=-33554433,fl(t,t.type,e===null?null:e.memoizedProps,t.pendingProps,n),null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==r&&dl(t);else{if(typeof r!=`string`&&t.stateNode===null)throw Error(s(166));if(e=Oe.current,da(t)){if(e=t.stateNode,n=t.memoizedProps,r=null,i=ra,i!==null)switch(i.tag){case 27:case 5:r=i.memoizedProps}e[wt]=t,e=!!(e.nodeValue===n||r!==null&&!0===r.suppressHydrationWarning||ep(e.nodeValue,n)),e||ca(t,!0)}else e=lp(e).createTextNode(r),e[wt]=t,t.stateNode=e}return gl(t),null;case 31:if(n=t.memoizedState,e===null||e.memoizedState!==null){if(r=da(t),n!==null){if(e===null){if(!r)throw Error(s(318));if(e=t.memoizedState,e=e===null?null:e.dehydrated,!e)throw Error(s(557));e[wt]=t}else fa(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;gl(t),e=!1}else n=pa(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=n),e=!0;if(!e)return t.flags&256?(Po(t),t):(Po(t),null);if(t.flags&128)throw Error(s(558))}return gl(t),null;case 13:if(r=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(i=da(t),r!==null&&r.dehydrated!==null){if(e===null){if(!i)throw Error(s(318));if(i=t.memoizedState,i=i===null?null:i.dehydrated,!i)throw Error(s(317));i[wt]=t}else fa(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;gl(t),i=!1}else i=pa(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=i),i=!0;if(!i)return t.flags&256?(Po(t),t):(Po(t),null)}return Po(t),t.flags&128?(t.lanes=n,t):(n=r!==null,e=e!==null&&e.memoizedState!==null,n&&(r=t.child,i=null,r.alternate!==null&&r.alternate.memoizedState!==null&&r.alternate.memoizedState.cachePool!==null&&(i=r.alternate.memoizedState.cachePool.pool),a=null,r.memoizedState!==null&&r.memoizedState.cachePool!==null&&(a=r.memoizedState.cachePool.pool),a!==i&&(r.flags|=2048)),n!==e&&n&&(t.child.flags|=8192),ml(t,t.updateQueue),gl(t),null);case 4:return je(),e===null&&Wf(t.stateNode.containerInfo),t.flags|=67108864,gl(t),null;case 10:return ya(t.type),gl(t),null;case 19:if(Lo(t),r=t.memoizedState,r===null)return gl(t),null;if(i=!!(t.flags&128),a=r.rendering,a===null){if(i)hl(r,!1);else{if(ad!==0||e!==null&&e.flags&128)for(e=t.child;e!==null;){if(a=Ro(e),a!==null){for(t.flags|=128,hl(r,!1),e=a.updateQueue,t.updateQueue=e,ml(t,e),t.subtreeFlags=0,e=n,n=t.child;n!==null;)Fi(n,e),n=n.sibling;return Io(t,Fo.current&1|2),B&&Qi(t,r.treeForkCount),t.child}e=e.sibling}r.tail!==null&&Ge()>gd&&(t.flags|=128,i=!0,hl(r,!1),t.lanes=4194304)}}else{if(!i){if(e=Ro(a),e!==null){if(t.flags|=128,i=!0,e=e.updateQueue,t.updateQueue=e,ml(t,e),hl(r,!0),r.tail===null&&r.tailMode!==`collapsed`&&r.tailMode!==`visible`&&!a.alternate&&!B)return gl(t),null}else 2*Ge()-r.renderingStartTime>gd&&n!==536870912&&(t.flags|=128,i=!0,hl(r,!1),t.lanes=4194304)}r.isBackwards?(a.sibling=t.child,t.child=a):(e=r.last,e===null?t.child=a:e.sibling=a,r.last=a)}if(r.tail!==null){e=r.tail;a:{for(n=e;n!==null;){if(n.alternate!==null){n=!1;break a}n=n.sibling}n=!0}return r.rendering=e,r.tail=e.sibling,r.renderingStartTime=Ge(),e.sibling=null,a=Fo.current,a=i?a&1|2:a&1,r.tailMode===`visible`||r.tailMode===`collapsed`||!n||B?Io(t,a):(n=a,M(Oo,t),M(Fo,n),ko===null&&(ko=t)),B&&Qi(t,r.treeForkCount),e}return gl(t),null;case 22:case 23:return Po(t),Do(),r=t.memoizedState!==null,e===null?r&&(t.flags|=8192):e.memoizedState!==null!==r&&(t.flags|=8192),r?n&536870912&&!(t.flags&128)&&(gl(t),t.subtreeFlags&6&&(t.flags|=8192)):gl(t),n=t.updateQueue,n!==null&&ml(t,n.retryQueue),n=null,e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(n=e.memoizedState.cachePool.pool),r=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(r=t.memoizedState.cachePool.pool),r!==n&&(t.flags|=2048),e!==null&&Te(Ga),null;case 24:return n=null,e!==null&&(n=e.memoizedState.cache),t.memoizedState.cache!==n&&(t.flags|=2048),ya(ja),gl(t),null;case 25:return null;case 30:return t.flags|=33554432,gl(t),null}throw Error(s(156,t.tag))}function vl(e,t){switch(ta(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return ya(ja),je(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return Ne(t),null;case 31:if(t.memoizedState!==null){if(Po(t),t.alternate===null)throw Error(s(340));fa()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 13:if(Po(t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(s(340));fa()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return Lo(t),e=t.flags,e&65536?(t.flags=e&-65537|128,e=t.memoizedState,e!==null&&(e.rendering=null,e.tail=null),t.flags|=4,t):null;case 4:return je(),null;case 10:return ya(t.type),null;case 22:case 23:return Po(t),Do(),e!==null&&Te(Ga),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return ya(ja),null;case 25:return null;default:return null}}function yl(e,t){switch(ta(t),t.tag){case 3:ya(ja),je();break;case 26:case 27:case 5:Ne(t);break;case 4:je();break;case 31:t.memoizedState!==null&&Po(t);break;case 13:Po(t);break;case 19:Lo(t);break;case 10:ya(t.type);break;case 22:case 23:Po(t),Do(),e!==null&&Te(Ga);break;case 24:ya(ja)}}function bl(e,t){try{var n=t.updateQueue,r=n===null?null:n.lastEffect;if(r!==null){var i=r.next;n=i;do{if((n.tag&e)===e){r=void 0;var a=n.create,o=n.inst;r=a(),o.destroy=r}n=n.next}while(n!==i)}}catch(e){Z(t,t.return,e)}}function xl(e,t,n){try{var r=t.updateQueue,i=r===null?null:r.lastEffect;if(i!==null){var a=i.next;r=a;do{if((r.tag&e)===e){var o=r.inst,s=o.destroy;if(s!==void 0){o.destroy=void 0,i=t;var c=n,l=s;try{l()}catch(e){Z(i,c,e)}}}r=r.next}while(r!==a)}}catch(e){Z(t,t.return,e)}}function Sl(e){var t=e.updateQueue;if(t!==null){var n=e.stateNode;try{U(t,n)}catch(t){Z(e,e.return,t)}}}function Cl(e,t,n){n.props=bc(e.type,e.memoizedProps),n.state=e.memoizedState;try{n.componentWillUnmount()}catch(n){Z(e,t,n)}}function wl(e,t){try{var n=e.ref;if(n!==null){switch(e.tag){case 26:case 27:case 5:var r=e.stateNode;break;case 30:var i=e.stateNode,a=vi(e.memoizedProps,i);(i.ref===null||i.ref.name!==a)&&(i.ref=Pp(a)),r=i.ref;break;case 7:if(e.stateNode===null){var o=new Fp(e);h(e.child,!1,Qp,o,void 0,void 0),e.stateNode=o}r=e.stateNode;break;default:r=e.stateNode}typeof n==`function`?e.refCleanup=n(r):n.current=r}}catch(n){Z(e,t,n)}}function Tl(e,t){var n=e.ref,r=e.refCleanup;if(n!==null){if(typeof r==`function`)try{r()}catch(n){Z(e,t,n)}finally{e.refCleanup=null,e=e.alternate,e!=null&&(e.refCleanup=null)}else if(typeof n==`function`)try{n(null)}catch(n){Z(e,t,n)}else n.current=null}}function El(e,t){if((e.tag===5||e.tag===27||e.tag===6)&&e.alternate===null&&t!==null)for(var n=0;n<t.length;n++)em(e.stateNode,t[n])}function Dl(e){for(var t=e.return;t!==null&&(Al(t)&&em(e.stateNode,t.stateNode),!kl(t));)t=t.return}function Ol(e){for(var t=e.return;t!==null&&(Al(t)&&tm(e.stateNode,t.stateNode),!kl(t));)t=t.return}function kl(e){return e.tag===5||e.tag===3||e.tag===27}function Al(e){return e&&e.tag===7&&e.stateNode!==null}function jl(e){var t=e.type,n=e.memoizedProps,r=e.stateNode;try{a:switch(t){case`button`:case`input`:case`select`:case`textarea`:n.autoFocus&&r.focus();break a;case`img`:n.src?r.src=n.src:n.srcSet&&(r.srcset=n.srcSet)}}catch(t){Z(e,e.return,t)}}function Ml(e,t,n){try{var r=e.stateNode;ip(r,e.type,n,t),r[Tt]=t}catch(t){Z(e,e.return,t)}}function Nl(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&Sp(e.type)||e.tag===4}function Pl(e){a:for(;;){for(;e.sibling===null;){if(e.return===null||Nl(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.tag===27&&Sp(e.type)||e.flags&2||e.child===null||e.tag===4)continue a;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function Fl(e,t,n,r){var i=e.tag;if(i===5||i===6)i=e.stateNode,t?(n.nodeType===9?n.body:n.nodeName===`HTML`?n.ownerDocument.body:n).insertBefore(i,t):(t=n.nodeType===9?n.body:n.nodeName===`HTML`?n.ownerDocument.body:n,t.appendChild(i),n=n._reactRootContainer,n!=null||t.onclick!==null||(t.onclick=yn)),El(e,r),R=!0;else if(i!==4&&(i===27&&(El(e,r),r=null,Sp(e.type)&&(n=e.stateNode,t=null)),e=e.child,e!==null))for(Fl(e,t,n,r),e=e.sibling;e!==null;)Fl(e,t,n,r),e=e.sibling}function Il(e,t,n,r){var i=e.tag;if(i===5||i===6)i=e.stateNode,t?n.insertBefore(i,t):n.appendChild(i),El(e,r),R=!0;else if(i!==4&&(i===27&&(El(e,r),r=null,Sp(e.type)&&(n=e.stateNode)),e=e.child,e!==null))for(Il(e,t,n,r),e=e.sibling;e!==null;)Il(e,t,n,r),e=e.sibling}function Ll(e){var t=e.stateNode,n=e.memoizedProps;try{for(var r=e.type,i=t.attributes;i.length;)t.removeAttributeNode(i[0]);np(t,r,n),t[wt]=e,t[Tt]=n}catch(t){Z(e,e.return,t)}}var Rl=!1,zl=null;function Bl(e){(e.tag===30||e.subtreeFlags&33554432)&&(Rl=!0)}var Vl=null;function Hl(){var e=Vl;return Vl=null,e}var Ul=0;function Wl(e,t,n,r,i){return Ul=0,Gl(e.child,t,n,r,i)}function Gl(e,t,n,r,i){for(var a=!1;e!==null;){if(e.tag===5){var o=e.stateNode;if(r!==null){var s=Op(o);r.push(s),s.view&&(a=!0)}else a||Op(o).view&&(a=!0);Rl=!0,Tp(o,Ul===0?t:t+`_`+Ul,n),Ul++}else e.tag===22&&e.memoizedState!==null||e.tag===30&&i||Gl(e.child,t,n,r,i)&&(a=!0);e=e.sibling}return a}function Kl(e,t){for(;e!==null;)e.tag===5?Ep(e.stateNode,e.memoizedProps):e.tag===22&&e.memoizedState!==null||e.tag===30&&t||Kl(e.child,t),e=e.sibling}function ql(e){if(e.subtreeFlags&18874368)for(e=e.child;e!==null;){if((e.tag!==22||e.memoizedState===null)&&(ql(e),e.tag===30&&e.flags&18874368&&e.stateNode.paired)){var t=e.memoizedProps;if(t.name==null||t.name===`auto`)throw Error(s(544));var n=t.name;t=bi(t.default,t.share),t!==`none`&&(Wl(e,n,t,null,!1)||Kl(e.child,!1))}e=e.sibling}}function Jl(e,t){if(e.tag===30){var n=e.stateNode,r=e.memoizedProps,i=vi(r,n),a=bi(r.default,n.paired?r.share:r.enter);a===`none`?ql(e):Wl(e,i,a,null,!1)?(ql(e),n.paired||t||Nd(e,r.onEnter)):Kl(e.child,!1)}else if(e.subtreeFlags&33554432)for(e=e.child;e!==null;)Jl(e,t),e=e.sibling;else ql(e)}function Yl(e){if(zl!==null&&zl.size!==0){var t=zl;if(e.subtreeFlags&18874368)for(e=e.child;e!==null;){if(e.tag!==22||e.memoizedState===null){if(e.tag===30&&e.flags&18874368){var n=e.memoizedProps,r=n.name;if(r!=null&&r!==`auto`){var i=t.get(r);if(i!==void 0){var a=bi(n.default,n.share);if(a!==`none`&&(Wl(e,r,a,null,!1)?(a=e.stateNode,i.paired=a,a.paired=i,Nd(e,n.onShare)):Kl(e.child,!1)),t.delete(r),t.size===0)break}}}Yl(e)}e=e.sibling}}}function Xl(e){if(e.tag===30){var t=e.memoizedProps,n=vi(t,e.stateNode),r=zl===null?void 0:zl.get(n),i=bi(t.default,r===void 0?t.exit:t.share);i!==`none`&&(Wl(e,n,i,null,!1)?r===void 0?Nd(e,t.onExit):(i=e.stateNode,r.paired=i,i.paired=r,zl.delete(n),Nd(e,t.onShare)):Kl(e.child,!1)),zl!==null&&Yl(e)}else if(e.subtreeFlags&33554432)for(e=e.child;e!==null;)Xl(e),e=e.sibling;else zl!==null&&Yl(e)}function Zl(e){for(e=e.child;e!==null;){if(e.tag===30){var t=e.memoizedProps,n=vi(t,e.stateNode);t=bi(t.default,t.update),e.flags&=-5,t!==`none`&&Wl(e,n,t,e.memoizedState=[],!1)}else e.subtreeFlags&33554432&&Zl(e);e=e.sibling}}function Ql(e){if(e.subtreeFlags&18874368)for(e=e.child;e!==null;){if(e.tag!==22||e.memoizedState===null){if(e.tag===30&&e.flags&18874368){var t=e.stateNode;t.paired!==null&&(t.paired=null,Kl(e.child,!1))}Ql(e)}e=e.sibling}}function $l(e){if(e.tag===30)e.stateNode.paired=null,Kl(e.child,!1),Ql(e);else if(e.subtreeFlags&33554432)for(e=e.child;e!==null;)$l(e),e=e.sibling;else Ql(e)}function eu(e){for(e=e.child;e!==null;)e.tag===30?Kl(e.child,!1):e.subtreeFlags&33554432&&eu(e),e=e.sibling}function tu(e,t,n,r,i,a,o){for(var s=!1;t!==null;){if(t.tag===5){var c=t.stateNode;if(a!==null&&Ul<a.length){var l=a[Ul],u=Op(c);(l.view||u.view)&&(s=!0);var d;if(d=!(e.flags&4)){if(u.clip)d=!0;else{d=l.rect;var f=u.rect;d=d.y!==f.y||d.x!==f.x||d.height!==f.height||d.width!==f.width}}d&&(e.flags|=4),u.abs?u=!l.abs:(l=l.rect,u=u.rect,u=l.height!==u.height||l.width!==u.width),u&&(e.flags|=32)}else e.flags|=32;e.flags&4&&Tp(c,Ul===0?n:n+`_`+Ul,i),s&&e.flags&4||(Vl===null&&(Vl=[]),Vl.push(c,Ul===0?r:r+`_`+Ul,t.memoizedProps)),Ul++}else(t.tag!==22||t.memoizedState===null)&&(t.tag===30&&o?e.flags|=t.flags&32:tu(e,t.child,n,r,i,a,o)&&(s=!0));t=t.sibling}return s}function nu(e,t){for(e=e.child;e!==null;){if(e.tag===30){var n=e.memoizedProps,r=e.stateNode,i=vi(n,r),a=bi(n.default,n.update);if(t){r=r.clones;var o=r===null?null:r.map(kp)}else o=e.memoizedState,e.memoizedState=null;r=e;var s=e.child;Ul=0,i=tu(r,s,i,i,a,o,!1),e.flags&4&&i&&(t||Nd(e,n.onUpdate))}else e.subtreeFlags&33554432&&nu(e,t);e=e.sibling}}var ru=!1,K=!1,iu=!1,au=!1,ou=typeof WeakSet==`function`?WeakSet:Set,su=null,cu=!1,lu=!1,uu=!1,du=!1;function fu(e,t,n){if(e=e.containerInfo,sp=gh,e=Jr(e),Yr(e)){if(`selectionStart`in e)var r={start:e.selectionStart,end:e.selectionEnd};else a:{r=(r=e.ownerDocument)&&r.defaultView||window;var i=r.getSelection&&r.getSelection();if(i&&i.rangeCount!==0){r=i.anchorNode;var a=i.anchorOffset,o=i.focusNode;i=i.focusOffset;try{r.nodeType,o.nodeType}catch{r=null;break a}var s=0,c=-1,l=-1,u=0,d=0,f=e,p=null;b:for(;;){for(var m;f!==r||a!==0&&f.nodeType!==3||(c=s+a),f!==o||i!==0&&f.nodeType!==3||(l=s+i),f.nodeType===3&&(s+=f.nodeValue.length),(m=f.firstChild)!==null;)p=f,f=m;for(;;){if(f===e)break b;if(p===r&&++u===a&&(c=s),p===o&&++d===i&&(l=s),(m=f.nextSibling)!==null)break;f=p,p=f.parentNode}f=m}r=c===-1||l===-1?null:{start:c,end:l}}else r=null}r||={start:0,end:0}}else r=null;for(cp={focusedElem:e,selectionRange:r},gh=!1,n=(n&335544064)===n,su=t,t=n?9270:1024;su!==null;){if(e=su,n&&(r=e.deletions,r!==null))for(a=0;a<r.length;a++)n&&Xl(r[a]);if(e.alternate===null&&e.flags&2)n&&Bl(e),pu(n);else{if(e.tag===22){if(r=e.alternate,e.memoizedState!==null){r!==null&&r.memoizedState===null&&n&&Xl(r),pu(n);continue}if(r!==null&&r.memoizedState!==null){n&&Bl(e),pu(n);continue}}r=e.child,(e.subtreeFlags&t)!==0&&r!==null?(r.return=e,su=r):(n&&Zl(e),pu(n))}}zl=null}function pu(e){for(;su!==null;){var t=su,n=e,r=t.alternate,i=t.flags;switch(t.tag){case 0:case 11:case 15:break;case 1:if(i&1024&&r!==null){n=void 0,i=r.memoizedProps,r=r.memoizedState;var a=t.stateNode;try{var o=bc(t.type,i);n=a.getSnapshotBeforeUpdate(o,r),a.__reactInternalSnapshotBeforeUpdate=n}catch(e){Z(t,t.return,e)}}break;case 3:if(i&1024){if(r=t.stateNode.containerInfo,n=r.nodeType,n===9)nm(r);else if(n===1)switch(r.nodeName){case`HEAD`:case`HTML`:case`BODY`:nm(r);break;default:r.textContent=``}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;case 30:n&&r!==null&&(n=vi(r.memoizedProps,r.stateNode),i=t.memoizedProps,i=bi(i.default,i.update),i!==`none`&&Wl(r,n,i,r.memoizedState=[],!0));break;default:if(i&1024)throw Error(s(163))}if(r=t.sibling,r!==null){r.return=t.return,su=r;break}su=t.return}}function mu(e,t,n){var r=n.flags;switch(n.tag){case 0:case 11:case 15:Pu(e,n),r&4&&bl(5,n);break;case 1:if(Pu(e,n),r&4){if(e=n.stateNode,t===null)try{e.componentDidMount()}catch(e){Z(n,n.return,e)}else{var i=bc(n.type,t.memoizedProps);t=t.memoizedState;try{e.componentDidUpdate(i,t,e.__reactInternalSnapshotBeforeUpdate)}catch(e){Z(n,n.return,e)}}}r&64&&Sl(n),r&512&&wl(n,n.return);break;case 3:if(Pu(e,n),r&64&&(e=n.updateQueue,e!==null)){if(t=null,n.child!==null)switch(n.child.tag){case 27:case 5:t=n.child.stateNode;break;case 1:t=n.child.stateNode}try{U(e,t)}catch(e){Z(n,n.return,e)}}break;case 27:t===null&&r&4&&Ll(n);case 26:case 5:Pu(e,n),t===null&&r&4&&jl(n),r&512&&wl(n,n.return);break;case 12:Pu(e,n);break;case 31:Pu(e,n),r&4&&Cu(e,n);break;case 13:Pu(e,n),r&4&&wu(e,n),r&64&&(e=n.memoizedState,e!==null&&(e=e.dehydrated,e!==null&&(n=_f.bind(null,n),cm(e,n))));break;case 22:if(r=n.memoizedState!==null||ru,!r){var a=t!==null&&t.memoizedState!==null||K;t=ru,i=K,ru=r,(K=a)&&!i?(r=2,n.subtreeFlags&8772&&(r|=1),Iu(e,n,r)):Pu(e,n),ru=t,K=i}break;case 30:Pu(e,n),r&512&&wl(n,n.return);break;case 7:r&512&&wl(n,n.return);default:Pu(e,n)}}function hu(e,t){for(e=e.child;e!==null;)gu(e,t),e=e.sibling}function gu(e,t){switch(e.tag){case 5:case 26:try{var n=e.stateNode;if(t){var r=n.style;typeof r.setProperty==`function`?r.setProperty(`display`,`none`,`important`):r.display=`none`}else{var i=e.stateNode,a=e.memoizedProps.style,o=a!=null&&a.hasOwnProperty(`display`)?a.display:null;i.style.display=o==null||typeof o==`boolean`?``:(``+o).trim()}}catch(t){Z(e,e.return,t)}_u(e,t);break;case 6:try{e.stateNode.nodeValue=t?``:e.memoizedProps,R=!0}catch(t){Z(e,e.return,t)}break;case 18:try{var s=e.stateNode;t?wp(s,!0):wp(e.stateNode,!1)}catch(t){Z(e,e.return,t)}break;case 22:case 23:e.memoizedState===null&&hu(e,t);break;default:hu(e,t)}}function _u(e,t){if(e.subtreeFlags&67108864)for(e=e.child;e!==null;){a:{var n=e,r=t;switch(n.tag){case 4:gu(n,r);break a;case 22:n.memoizedState===null&&_u(n,r);break a;default:_u(n,r)}}e=e.sibling}}function vu(e){var t=e.alternate;t!==null&&(e.alternate=null,vu(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&Nt(t)),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}var yu=null,bu=!1;function xu(e,t,n){for(n=n.child;n!==null;)Su(e,t,n),n=n.sibling}function Su(e,t,n){if(F&&typeof F.onCommitFiberUnmount==`function`)try{F.onCommitFiberUnmount(P,n)}catch{}switch(n.tag){case 26:K||Tl(n,t),xu(e,t,n),n.memoizedState?n.memoizedState.count--:n.stateNode&&!K&&(n=n.stateNode,n.parentNode.removeChild(n));break;case 27:K||Tl(n,t),Ol(n);var r=yu,i=bu;Sp(n.type)&&(yu=n.stateNode,bu=!1),xu(e,t,n),gm(n.stateNode,n.type,n.memoizedProps),yu=r,bu=i;break;case 5:K||Tl(n,t),Ol(n);case 6:if(n.tag===6&&Ol(n),r=yu,i=bu,yu=null,xu(e,t,n),yu=r,bu=i,yu!==null){if(bu)try{(yu.nodeType===9?yu.body:yu.nodeName===`HTML`?yu.ownerDocument.body:yu).removeChild(n.stateNode),R=!0}catch(e){Z(n,t,e)}else try{yu.removeChild(n.stateNode),R=!0}catch(e){Z(n,t,e)}}break;case 18:yu!==null&&(bu?(e=yu,Cp(e.nodeType===9?e.body:e.nodeName===`HTML`?e.ownerDocument.body:e,n.stateNode),Hh(e)):Cp(yu,n.stateNode));break;case 4:r=yu,i=bu,yu=n.stateNode.containerInfo,bu=!0,xu(e,t,n),yu=r,bu=i;break;case 0:case 11:case 14:case 15:xl(2,n,t),K||xl(4,n,t),xu(e,t,n);break;case 1:K||(Tl(n,t),r=n.stateNode,typeof r.componentWillUnmount==`function`&&Cl(n,t,r)),xu(e,t,n);break;case 21:xu(e,t,n);break;case 22:K=(r=K)||n.memoizedState!==null,xu(e,t,n),K=r;break;case 30:Tl(n,t),xu(e,t,n);break;case 7:K||Tl(n,t),xu(e,t,n);break;default:xu(e,t,n)}}function Cu(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null))){e=e.dehydrated;try{Hh(e)}catch(e){Z(t,t.return,e)}}}function wu(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null&&(e=e.dehydrated,e!==null))))try{Hh(e)}catch(e){Z(t,t.return,e)}}function Tu(e){switch(e.tag){case 31:case 13:case 19:var t=e.stateNode;return t===null&&(t=e.stateNode=new ou),t;case 22:return e=e.stateNode,t=e._retryCache,t===null&&(t=e._retryCache=new ou),t;default:throw Error(s(435,e.tag))}}function Eu(e,t){var n=Tu(e);t.forEach(function(t){if(!n.has(t)){n.add(t);var r=vf.bind(null,e,t);t.then(r,r)}})}function Du(e,t,n){var r=t.deletions;if(r!==null)for(var i=0;i<r.length;i++){var a=r[i],o=e,c=t,l=c;a:for(;l!==null;){switch(l.tag){case 27:if(Sp(l.type)){yu=l.stateNode,bu=!1;break a}break;case 5:yu=l.stateNode,bu=!1;break a;case 3:case 4:yu=l.stateNode.containerInfo,bu=!0;break a}l=l.return}if(yu===null)throw Error(s(160));Su(o,c,a),yu=null,bu=!1,o=a.alternate,o!==null&&(o.return=null),a.return=null}if(t.subtreeFlags&13886)for(t=t.child;t!==null;)ku(t,e,n),t=t.sibling}var Ou=null;function ku(e,t,n){var r=e.alternate,i=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:if(i&4&&(r=e.updateQueue,r=r===null?null:r.events,r!==null))for(var a=0;a<r.length;a++){var o=r[a];o.ref.impl=o.nextImpl}Du(t,e,n),Au(e),i&4&&(xl(3,e,e.return),bl(3,e),xl(5,e,e.return));break;case 1:Du(t,e,n),Au(e),i&512&&(K||r===null||Tl(r,r.return)),i&64&&ru&&(e=e.updateQueue,e!==null&&(t=e.callbacks,t!==null&&(n=e.shared.hiddenCallbacks,e.shared.hiddenCallbacks=n===null?t:n.concat(t))));break;case 26:if(a=Ou,Du(t,e,n),Au(e),i&512&&(K||r===null||Tl(r,r.return)),i&4){if(i=r===null?null:r.memoizedState,n=e.memoizedState,r===null){if(n===null){if(e.stateNode===null){if(ru)e.stateNode=fp(e.type,e.memoizedProps,t.containerInfo,e);else{a:{t=e.type,n=e.memoizedProps,i=a.ownerDocument||a;b:switch(t){case`title`:r=i.getElementsByTagName(`title`)[0],(!r||r[jt]||r[wt]||r.namespaceURI===`http://www.w3.org/2000/svg`||r.hasAttribute(`itemprop`))&&(r=i.createElement(t),i.head.insertBefore(r,i.querySelector(`head > title`))),np(r,t,n),r[wt]=e,Rt(r),t=r;break a;case`link`:if(a=Gm(`link`,`href`,i).get(t+(n.href||``))){for(o=0;o<a.length;o++)if(r=a[o],r.getAttribute(`href`)===(n.href==null||n.href===``?null:n.href)&&r.getAttribute(`rel`)===(n.rel==null?null:n.rel)&&r.getAttribute(`title`)===(n.title==null?null:n.title)&&r.getAttribute(`crossorigin`)===(n.crossOrigin==null?null:n.crossOrigin)){a.splice(o,1);break b}}r=i.createElement(t),np(r,t,n),i.head.appendChild(r);break;case`meta`:if(a=Gm(`meta`,`content`,i).get(t+(n.content||``))){for(o=0;o<a.length;o++)if(r=a[o],r.getAttribute(`content`)===(n.content==null?null:``+n.content)&&r.getAttribute(`name`)===(n.name==null?null:n.name)&&r.getAttribute(`property`)===(n.property==null?null:n.property)&&r.getAttribute(`http-equiv`)===(n.httpEquiv==null?null:n.httpEquiv)&&r.getAttribute(`charset`)===(n.charSet==null?null:n.charSet)){a.splice(o,1);break b}}r=i.createElement(t),np(r,t,n),i.head.appendChild(r);break;default:throw Error(s(468,t))}r[wt]=e,Rt(r),t=r}e.stateNode=t}}else ru||Km(a,e.type,e.stateNode)}else e.stateNode=Bm(a,n,e.memoizedProps)}else i===n?n===null&&e.stateNode!==null&&Ml(e,e.memoizedProps,r.memoizedProps):(i===null?(t=r.stateNode,t===null||K||t.parentNode.removeChild(t)):i.count--,n===null?ru||Km(a,e.type,e.stateNode):Bm(a,n,e.memoizedProps))}break;case 27:Du(t,e,n),Au(e),i&512&&(K||r===null||Tl(r,r.return)),r!==null&&i&4&&Ml(e,e.memoizedProps,r.memoizedProps);break;case 5:if(a=iu,iu=!1,Du(t,e,n),iu=a,Au(e),i&512&&(K||r===null||Tl(r,r.return)),e.flags&32){t=e.stateNode;try{dn(t,``),R=!0}catch(t){Z(e,e.return,t)}}i&4&&e.stateNode!=null&&(t=e.memoizedProps,Ml(e,t,r===null?t:r.memoizedProps)),i&1024&&(au=!0);break;case 6:if(Du(t,e,n),Au(e),i&4){if(e.stateNode===null)throw Error(s(162));t=e.memoizedProps,n=e.stateNode;try{n.nodeValue=t,R=!0}catch(t){Z(e,e.return,t)}}break;case 3:if(R=!1,Wm=null,a=Ou,Ou=bm(t.containerInfo),Du(t,e,n),Ou=a,Au(e),i&4&&r!==null&&r.memoizedState.isDehydrated)try{Hh(t.containerInfo)}catch(t){Z(e,e.return,t)}au&&(au=!1,ju(e)),R=!1;break;case 4:i=iu,iu=ru,r=qt(),a=Ou,Ou=bm(e.stateNode.containerInfo),Du(t,e,n),Au(e),Ou=a,R&&lu&&(uu=!0),R=r,iu=i;break;case 12:Du(t,e,n),Au(e);break;case 31:Du(t,e,n),Au(e),i&4&&(t=e.updateQueue,t!==null&&(e.updateQueue=null,Eu(e,t)));break;case 13:Du(t,e,n),Au(e),e.child.flags&8192&&e.memoizedState!==null!=(r!==null&&r.memoizedState!==null)&&(md=Ge()),i&4&&(t=e.updateQueue,t!==null&&(e.updateQueue=null,Eu(e,t)));break;case 22:a=e.memoizedState!==null,o=r!==null&&r.memoizedState!==null;var c=ru,l=K,u=iu;ru=c||a,iu=u||a,K=l||o,Du(t,e,n),K=l,iu=u,ru=c,Au(e),i&8192&&(t=e.stateNode,t._visibility=a?t._visibility&-2:t._visibility|1,!a||r===null||o||ru||K||(t=o||K,n=ru,r=K,ru=a||ru,K=t,Fu(e,2),ru=n,K=r),!a&&iu||hu(e,a)),i&4&&(t=e.updateQueue,t!==null&&(n=t.retryQueue,n!==null&&(t.retryQueue=null,Eu(e,n))));break;case 19:Du(t,e,n),Au(e),i&4&&(t=e.updateQueue,t!==null&&(e.updateQueue=null,Eu(e,t)));break;case 30:i&512&&(K||r===null||Tl(r,r.return)),i=qt(),a=lu,o=(n&335544064)===n,c=e.memoizedProps,lu=o&&bi(c.default,c.update)!==`none`,Du(t,e,n),Au(e),o&&r!==null&&R&&(e.flags|=4),lu=a,R=i;break;case 21:break;case 7:i&512&&(K||r===null||Tl(r,r.return)),r&&r.stateNode!==null&&(r.stateNode._fragmentFiber=e);default:Du(t,e,n),Au(e)}}function Au(e){var t=e.flags;if(t&2){try{for(var n,r=e.return;r!==null;){if(Nl(r)){n=r;break}r=r.return}r=null;for(var i=e.return;i!==null;){if(Al(i)){var a=i.stateNode;r===null?r=[a]:r.push(a)}if(kl(i))break;i=i.return}var o=r;if(n==null)throw Error(s(160));switch(n.tag){case 27:var c=n.stateNode;Il(e,Pl(e),c,o);break;case 5:var l=n.stateNode;n.flags&32&&(dn(l,``),n.flags&=-33),Il(e,Pl(e),l,o);break;case 3:case 4:var u=n.stateNode.containerInfo;Fl(e,Pl(e),u,o);break;default:throw Error(s(161))}}catch(t){Z(e,e.return,t)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function ju(e){if(e.subtreeFlags&1024)for(e=e.child;e!==null;){var t=e;ju(t),t.tag===5&&t.flags&1024&&(t=t.stateNode,gh=!0,t.reset(),gh=!1),e=e.sibling}}function Mu(e,t){if(t.subtreeFlags&9270)for(t=t.child;t!==null;)Nu(t,e),t=t.sibling;else nu(t,!1)}function Nu(e,t){var n=e.alternate;if(n===null)Jl(e,!1);else switch(e.tag){case 3:if(du=cu=!1,Hl(),Mu(t,e),!cu&&!uu){if(e=Vl,e!==null)for(var r=0;r<e.length;r+=3){n=e[r];var i=e[r+1];Ep(n,e[r+2]),n=n.ownerDocument.documentElement,n!==null&&n.animate({opacity:[0,0],pointerEvents:[`none`,`none`]},{duration:0,fill:`forwards`,pseudoElement:`::view-transition-group(`+i+`)`})}e=t.containerInfo,e=e.nodeType===9?e.documentElement:e.ownerDocument.documentElement,e!==null&&e.style.viewTransitionName===``&&(e.style.viewTransitionName=`none`,e.animate({opacity:[0,0],pointerEvents:[`none`,`none`]},{duration:0,fill:`forwards`,pseudoElement:`::view-transition-group(root)`}),e.animate({width:[0,0],height:[0,0]},{duration:0,fill:`forwards`,pseudoElement:`::view-transition`})),du=!0}Vl=null;break;case 5:Mu(t,e);break;case 4:r=cu,cu=!1,Mu(t,e),cu&&(uu=!0),cu=r;break;case 22:e.memoizedState===null&&(n.memoizedState===null?Mu(t,e):Jl(e,!1));break;case 30:r=cu,i=Hl(),cu=!1,Mu(t,e),cu&&(e.flags|=4);var a=e.memoizedProps,o=e.stateNode;t=vi(a,o),o=vi(n.memoizedProps,o);var s=bi(a.default,a.update);s===`none`?t=!1:(a=n.memoizedState,n.memoizedState=null,n=e.child,Ul=0,t=tu(e,n,t,o,s,a,!0),Ul!==(a===null?0:a.length)&&(e.flags|=32)),e.flags&4&&t?(Nd(e,e.memoizedProps.onUpdate),Vl=i):i!==null&&(i.push.apply(i,Vl),Vl=i),cu=e.flags&32?!0:r;break;default:Mu(t,e)}}function Pu(e,t){if(t.subtreeFlags&8772)for(t=t.child;t!==null;)mu(e,t.alternate,t),t=t.sibling}function Fu(e,t){for(e=e.child;e!==null;){var n=e,r=t;switch(n.tag){case 0:case 11:case 14:case 15:xl(4,n,n.return),Fu(n,r);break;case 1:Tl(n,n.return);var i=n.stateNode;typeof i.componentWillUnmount==`function`&&Cl(n,n.return,i),Fu(n,r);break;case 27:r&2&&gm(n.stateNode,n.type,n.memoizedProps);case 5:Tl(n,n.return),n.tag!==5&&n.tag!==27||Ol(n),Fu(n,r);break;case 6:Ol(n);break;case 26:Tl(n,n.return),i=n.stateNode,n.memoizedState!==null||i===null||K||i.parentNode.removeChild(i),Fu(n,r);break;case 22:n.memoizedState===null&&Fu(n,r);break;case 30:Tl(n,n.return),Fu(n,r);break;case 7:Tl(n,n.return);default:Fu(n,r)}e=e.sibling}}function Iu(e,t,n){for(n=t.subtreeFlags&8772?n:n&-2,t=t.child;t!==null;){var r=t.alternate,i=e,a=t,o=a.flags,s=!!(n&1);switch(a.tag){case 0:case 11:case 15:Iu(i,a,n),bl(4,a);break;case 1:if(Iu(i,a,n),r=a,i=r.stateNode,typeof i.componentDidMount==`function`)try{i.componentDidMount()}catch(e){Z(r,r.return,e)}if(r=a,i=r.updateQueue,i!==null){var c=r.stateNode;try{var l=i.shared.hiddenCallbacks;if(l!==null)for(i.shared.hiddenCallbacks=null,i=0;i<l.length;i++)So(l[i],c)}catch(e){Z(r,r.return,e)}}s&&o&64&&Sl(a),wl(a,a.return);break;case 27:n&2&&Ll(a);case 5:a.tag!==5&&a.tag!==27||Dl(a),Iu(i,a,n),s&&r===null&&o&4&&jl(a),wl(a,a.return);break;case 6:Dl(a);break;case 26:c=a.stateNode,a.memoizedState!==null||c===null||ru||Km(bm(c.ownerDocument),a.type,c),Iu(i,a,n),s&&r===null&&o&4&&jl(a),wl(a,a.return);break;case 12:Iu(i,a,n);break;case 31:Iu(i,a,n),s&&o&4&&Cu(i,a);break;case 13:Iu(i,a,n),s&&o&4&&wu(i,a);break;case 22:a.memoizedState===null&&Iu(i,a,n),wl(a,a.return);break;case 30:Iu(i,a,n),wl(a,a.return);break;case 7:wl(a,a.return);default:Iu(i,a,n)}t=t.sibling}}function Lu(e,t){var n=null;e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(n=e.memoizedState.cachePool.pool),e=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(e=t.memoizedState.cachePool.pool),e!==n&&(e!=null&&e.refCount++,n!=null&&Na(n))}function Ru(e,t){e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&Na(e))}function zu(e,t,n,r){var i=(n&335544064)===n;if(t.subtreeFlags&(i?10262:10256))for(t=t.child;t!==null;)Bu(e,t,n,r),t=t.sibling;else i&&eu(t)}function Bu(e,t,n,r){var i=(n&335544064)===n;i&&t.alternate===null&&t.return!==null&&t.return.alternate!==null&&$l(t);var a=t.flags;switch(t.tag){case 0:case 11:case 15:zu(e,t,n,r),a&2048&&bl(9,t);break;case 1:zu(e,t,n,r);break;case 3:zu(e,t,n,r),i&&du&&(e=e.containerInfo,e=e.nodeType===9?e.body:e.nodeName===`HTML`?e.ownerDocument.body:e,e.style.viewTransitionName===`root`&&(e.style.viewTransitionName=``),e=e.ownerDocument.documentElement,e!==null&&e.style.viewTransitionName===`none`&&(e.style.viewTransitionName=``)),a&2048&&(a=null,t.alternate!==null&&(a=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==a&&(t.refCount++,a!=null&&Na(a)));break;case 12:if(a&2048){zu(e,t,n,r),a=t.stateNode;try{var o=t.memoizedProps,s=o.id,c=o.onPostCommit;typeof c==`function`&&c(s,t.alternate===null?`mount`:`update`,a.passiveEffectDuration,-0)}catch(e){Z(t,t.return,e)}}else zu(e,t,n,r);break;case 31:zu(e,t,n,r);break;case 13:zu(e,t,n,r);break;case 23:break;case 22:o=t.stateNode,s=t.alternate,t.memoizedState===null?(i&&s!==null&&s.memoizedState!==null&&$l(t),o._visibility&2?zu(e,t,n,r):(o._visibility|=2,Vu(e,t,n,r,!!(t.subtreeFlags&10256)||!1))):(i&&s!==null&&s.memoizedState===null&&$l(s),o._visibility&2?zu(e,t,n,r):Hu(e,t)),a&2048&&Lu(s,t);break;case 24:zu(e,t,n,r),a&2048&&Ru(t.alternate,t);break;case 30:i&&(a=t.alternate,a!==null&&(Kl(a.child,!0),Kl(t.child,!0))),zu(e,t,n,r);break;default:zu(e,t,n,r)}}function Vu(e,t,n,r,i){for(i&&=!!(t.subtreeFlags&10256)||!1,t=t.child;t!==null;){var a=e,o=t,s=n,c=r,l=o.flags;switch(o.tag){case 0:case 11:case 15:Vu(a,o,s,c,i),bl(8,o);break;case 23:break;case 22:var u=o.stateNode;o.memoizedState===null?(u._visibility|=2,Vu(a,o,s,c,i)):u._visibility&2?Vu(a,o,s,c,i):Hu(a,o),i&&l&2048&&Lu(o.alternate,o);break;case 24:Vu(a,o,s,c,i),i&&l&2048&&Ru(o.alternate,o);break;default:Vu(a,o,s,c,i)}t=t.sibling}}function Hu(e,t){if(t.subtreeFlags&10256)for(t=t.child;t!==null;){var n=e,r=t,i=r.flags;switch(r.tag){case 22:Hu(n,r),i&2048&&Lu(r.alternate,r);break;case 24:Hu(n,r),i&2048&&Ru(r.alternate,r);break;default:Hu(n,r)}t=t.sibling}}var Uu=8192;function Wu(e,t,n){if(e.subtreeFlags&Uu)for(e=e.child;e!==null;)Gu(e,t,n),e=e.sibling}function Gu(e,t,n){switch(e.tag){case 26:Wu(e,t,n),e.flags&Uu&&(e.memoizedState===null?(e=e.stateNode,(t&335544128)===t&&Zm(n,e)):Qm(n,Ou,e.memoizedState,e.memoizedProps));break;case 5:Wu(e,t,n),e.flags&Uu&&(e=e.stateNode,(t&335544128)===t&&Zm(n,e));break;case 3:case 4:var r=Ou;Ou=bm(e.stateNode.containerInfo),Wu(e,t,n),Ou=r;break;case 22:e.memoizedState===null&&(r=e.alternate,r!==null&&r.memoizedState!==null?(r=Uu,Uu=16777216,Wu(e,t,n),Uu=r):Wu(e,t,n));break;case 30:if((e.flags&Uu)!==0&&(r=e.memoizedProps.name,r!=null&&r!==`auto`)){var i=e.stateNode;i.paired=null,zl===null&&(zl=new Map),zl.set(r,i)}Wu(e,t,n);break;default:Wu(e,t,n)}}function Ku(e){var t=e.alternate;if(t!==null&&(e=t.child,e!==null)){t.child=null;do t=e.sibling,e.sibling=null,e=t;while(e!==null)}}function qu(e){var t=e.deletions;if(e.flags&16){if(t!==null)for(var n=0;n<t.length;n++){var r=t[n];su=r,Xu(r,e)}Ku(e)}if(e.subtreeFlags&10256)for(e=e.child;e!==null;)Ju(e),e=e.sibling}function Ju(e){switch(e.tag){case 0:case 11:case 15:qu(e),e.flags&2048&&xl(9,e,e.return);break;case 3:qu(e);break;case 12:qu(e);break;case 22:var t=e.stateNode;e.memoizedState!==null&&t._visibility&2&&(e.return===null||e.return.tag!==13)?(t._visibility&=-3,Yu(e)):qu(e);break;default:qu(e)}}function Yu(e){var t=e.deletions;if(e.flags&16){if(t!==null)for(var n=0;n<t.length;n++){var r=t[n];su=r,Xu(r,e)}Ku(e)}for(e=e.child;e!==null;){switch(t=e,t.tag){case 0:case 11:case 15:xl(8,t,t.return),Yu(t);break;case 22:n=t.stateNode,n._visibility&2&&(n._visibility&=-3,Yu(t));break;default:Yu(t)}e=e.sibling}}function Xu(e,t){for(;su!==null;){var n=su;switch(n.tag){case 0:case 11:case 15:xl(8,n,t);break;case 23:case 22:if(n.memoizedState!==null&&n.memoizedState.cachePool!==null){var r=n.memoizedState.cachePool.pool;r!=null&&r.refCount++}break;case 24:Na(n.memoizedState.cache)}if(r=n.child,r!==null)r.return=n,su=r;else a:for(n=e;su!==null;){r=su;var i=r.sibling,a=r.return;if(vu(r),r===n){su=null;break a}if(i!==null){i.return=a,su=i;break a}su=a}}}var Zu={getCacheForType:function(e){var t=Ta(ja),n=t.data.get(e);return n===void 0&&(n=e(),t.data.set(e,n)),n},cacheSignal:function(){return Ta(ja).controller.signal}},Qu=typeof WeakMap==`function`?WeakMap:Map,q=0,$u=null,J=null,Y=0,X=0,ed=null,td=!1,nd=!1,rd=!1,id=0,ad=0,od=0,sd=0,cd=0,ld=0,ud=0,dd=null,fd=null,pd=!1,md=0,hd=0,gd=1/0,_d=null,vd=null,yd=0,bd=null,xd=null,Sd=0,Cd=0,wd=null,Td=null,Ed=null,Dd=null,Od=null,kd=0,Ad=null;function jd(){return q&2&&Y!==0?Y&-Y:A.T===null?xt():Pf()}function Md(){if(ld===0){if(!(Y&536870912)||B){var e=ot;ot<<=1,!(ot&3932160)&&(ot=262144),ld=e}else ld=536870912}return e=Oo.current,e!==null&&(e.flags|=32),ld}function Nd(e,t){if(t!=null){var n=e.stateNode,r=n.ref;r===null&&(r=n.ref=Pp(vi(e.memoizedProps,n))),Dd===null&&(Dd=[]),Dd.push(t.bind(null,r))}}function Pd(e,t,n){(e===$u&&(X===2||X===9)||e.cancelPendingCommit!==null)&&(Vd(e,0),Rd(e,Y,ld,!1)),mt(e,n),q&2&&e===$u||(e===$u&&(!(q&2)&&(sd|=n),ad===4&&Rd(e,Y,ld,!1)),Ef(e))}function Fd(e,t,n){if(q&6)throw Error(s(327));var r=!n&&!(t&127)&&(t&e.expiredLanes)===0||lt(e,t),i=r?Yd(e,t):qd(e,t,!0),a=r;do{if(i===0){nd&&!r&&Rd(e,t,0,!1);break}if(n=e.current.alternate,a&&!Ld(n))i=qd(e,t,!1),a=!1;else{if(i===2){if(a=t,e.errorRecoveryDisabledLanes&a)var o=0;else o=e.pendingLanes&-536870913,o=o===0?o&536870912?536870912:0:o;if(o!==0){t=o;a:{var c=e;i=dd;var l=c.current.memoizedState.isDehydrated;if(l&&(Vd(c,o).flags|=256),o=qd(c,o,!1),o!==2&&o!==6){if(rd&&!l){c.errorRecoveryDisabledLanes|=a,sd|=a,i=4;break a}a=fd,fd=i,a!==null&&(fd===null?fd=a:fd.push.apply(fd,a))}i=o}if(a=!1,i!==2)continue}}if(i===1){Vd(e,0),Rd(e,t,0,!0);break}a:{switch(r=e,a=i,a){case 0:case 1:throw Error(s(345));case 4:if((t&4194048)!==t&&(t&62914560)!==t)break;case 6:Rd(r,t,ld,!td);break a;case 2:fd=null;break;case 3:case 5:break;default:throw Error(s(329))}if((t&62914560)===t&&(i=md+300-Ge(),10<i)){if(Rd(r,t,ld,!td),ct(r,0,!0)!==0)break a;Sd=t,r.timeoutHandle=gp(Id.bind(null,r,n,fd,_d,pd,t,ld,sd,ud,td,a,`Throttled`,-0,0),i);break a}Id(r,n,fd,_d,pd,t,ld,sd,ud,td,a,null,-0,0)}break}}while(1);Ef(e)}function Id(e,t,n,r,i,a,o,s,c,l,u,d,f,p){e.timeoutHandle=-1;var m=t.subtreeFlags,h=(a&335544064)===a;d=null,(h||m&8192||(m&16785408)==16785408)&&(d={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:yn},zl=null,Gu(t,a,d),h&&(m=d,h=e.containerInfo,h=(h.nodeType===9?h:h.ownerDocument).__reactViewTransition,h!=null&&(m.count++,m.waitingForViewTransition=!0,m=nh.bind(m),h.finished.then(m,m))),m=(a&62914560)===a?md-Ge():(a&4194048)===a?hd-Ge():0,m=eh(d,m),m!==null)?(Sd=a,e.cancelPendingCommit=m(nf.bind(null,e,t,a,n,r,i,o,s,c,l,u,d,null,f,p)),Rd(e,a,o,!l)):nf(e,t,a,n,r,i,o,s,c,l,u,d)}function Ld(e){for(var t=e;;){var n=t.tag;if((n===0||n===11||n===15)&&t.flags&16384&&(n=t.updateQueue,n!==null&&(n=n.stores,n!==null)))for(var r=0;r<n.length;r++){var i=n[r],a=i.getSnapshot;i=i.value;try{if(!Hr(a(),i))return!1}catch{return!1}}if(n=t.child,t.subtreeFlags&16384&&n!==null)n.return=t,t=n;else{if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return!0;t=t.return}t.sibling.return=t.return,t=t.sibling}}return!0}function Rd(e,t,n,r){t=ut(e,t),t&=~cd,t&=~sd,e.suspendedLanes|=t,e.pingedLanes&=~t,r&&(e.warmLanes|=t),r=e.expirationTimes;for(var i=t;0<i;){var a=31-tt(i),o=1<<a;r[a]=-1,i&=~o}n!==0&&gt(e,n,t)}function zd(){return q&6?!0:(Df(0,!1),!1)}function Bd(){if(J!==null){if(X===0)var e=J.return;else e=J,_a=ga=null,ns(e),io=null,ao=0,e=J;for(;e!==null;)yl(e.alternate,e),e=e.return;J=null}}function Vd(e,t){var n=e.timeoutHandle;return n!==-1&&(e.timeoutHandle=-1,_p(n)),n=e.cancelPendingCommit,n!==null&&(e.cancelPendingCommit=null,n()),Sd=0,Bd(),$u=e,J=n=Pi(e.current,null),Y=t,X=0,ed=null,td=!1,nd=lt(e,t),rd=!1,ud=ld=cd=sd=od=ad=0,fd=dd=null,pd=!1,id=ut(e,t),z(),n}function Hd(e,t){W=null,A.H=fc,t===Ya||t===Za?(t=no(),X=3):t===Xa?(t=no(),X=4):X=t===Ac?8:typeof t==`object`&&t&&typeof t.then==`function`?6:1,ed=t,J===null&&(ad=1,wc(e,Hi(t,e.current)))}function Ud(){var e=Oo.current;return e===null?!0:(Y&4194048)===Y?ko===null:(Y&62914560)===Y||Y&536870912?e===ko:!1}function Wd(){var e=A.H;return A.H=fc,e===null?fc:e}function Gd(){var e=A.A;return A.A=Zu,e}function Kd(){ad=4,td||(Y&4194048)!==Y&&Oo.current!==null||(nd=!0),!(od&134217727)&&!(sd&134217727)||$u===null||Rd($u,Y,ld,!1)}function qd(e,t,n){var r=q;q|=2;var i=Wd(),a=Gd();($u!==e||Y!==t)&&(_d=null,Vd(e,t)),t=!1;var o=ad;a:do try{if(X!==0&&J!==null){var s=J,c=ed;switch(X){case 8:Bd(),o=6;break a;case 3:case 2:case 9:case 6:Oo.current===null&&(t=!0);var l=X;if(X=0,ed=null,$d(e,s,c,l),n&&nd){o=0;break a}break;default:l=X,X=0,ed=null,$d(e,s,c,l)}}Jd(),o=ad;break}catch(t){Hd(e,t)}while(1);return t&&e.shellSuspendCounter++,_a=ga=null,q=r,A.H=i,A.A=a,J===null&&($u=null,Y=0,z()),o}function Jd(){for(;J!==null;)Zd(J)}function Yd(e,t){var n=q;q|=2;var r=Wd(),i=Gd();$u!==e||Y!==t?(_d=null,gd=Ge()+500,Vd(e,t)):nd=lt(e,t);a:do try{if(X!==0&&J!==null){t=J;var a=ed;b:switch(X){case 1:X=0,ed=null,$d(e,t,a,1);break;case 2:case 9:if($a(a)){X=0,ed=null,Qd(t);break}t=function(){X!==2&&X!==9||$u!==e||(X=7),Ef(e)},a.then(t,t);break a;case 3:X=7;break a;case 4:X=5;break a;case 7:$a(a)?(X=0,ed=null,Qd(t)):(X=0,ed=null,$d(e,t,a,7));break;case 5:var o=null;switch(J.tag){case 26:o=J.memoizedState;case 5:case 27:var c=J;if(o?Ym(o):c.stateNode.complete){X=0,ed=null;var l=c.sibling;if(l!==null)J=l;else{var u=c.return;u===null?J=null:(J=u,ef(u))}break b}}X=0,ed=null,$d(e,t,a,5);break;case 6:X=0,ed=null,$d(e,t,a,6);break;case 8:Bd(),ad=6;break a;default:throw Error(s(462))}}Xd();break}catch(t){Hd(e,t)}while(1);return _a=ga=null,A.H=r,A.A=i,q=n,J===null?($u=null,Y=0,z(),ad):0}function Xd(){for(;J!==null&&!Ue();)Zd(J)}function Zd(e){var t=ul(e.alternate,e,id);e.memoizedProps=e.pendingProps,t===null?ef(e):J=t}function Qd(e){var t=e,n=t.alternate;switch(t.tag){case 15:case 0:t=Wc(n,t,t.pendingProps,t.type,void 0,Y);break;case 11:t=Wc(n,t,t.pendingProps,t.type.render,t.ref,Y);break;case 5:ns(t);var r=t;r===ra&&(B?(ua(r),r.tag===5&&r.stateNode!=null&&(ia=r.stateNode)):(ua(r),B=!0));default:yl(n,t),t=J=Fi(t,id),t=ul(n,t,id)}e.memoizedProps=e.pendingProps,t===null?ef(e):J=t}function $d(e,t,n,r){_a=ga=null,ns(t),io=null,ao=0;var i=t.return;try{if(kc(e,i,t,n,Y)){ad=1,wc(e,Hi(n,e.current)),J=null;return}}catch(t){if(i!==null)throw J=i,t;ad=1,wc(e,Hi(n,e.current)),J=null;return}t.flags&32768?(B||r===1?e=!0:nd||Y&536870912?e=!1:(td=e=!0,(r===2||r===9||r===3||r===6)&&(r=Oo.current,r!==null&&r.tag===13&&(r.flags|=16384))),tf(t,e)):ef(t)}function ef(e){var t=e;do{if(t.flags&32768){tf(t,td);return}e=t.return;var n=_l(t.alternate,t,id);if(n!==null){J=n;return}if(t=t.sibling,t!==null){J=t;return}J=t=e}while(t!==null);ad===0&&(ad=5)}function tf(e,t){do{var n=vl(e.alternate,e);if(n!==null){n.flags&=32767,J=n;return}if(n=e.return,n!==null&&(n.flags|=32768,n.subtreeFlags=0,n.deletions=null),!t&&(e=e.sibling,e!==null)){J=e;return}J=e=n}while(e!==null);ad=6,J=null}function nf(e,t,n,r,i,a,o,c,l,u,d,f){e.cancelPendingCommit=null;do df();while(yd!==0);if(q&6)throw Error(s(327));if(t!==null){if(t===e.current)throw Error(s(177));e===$u&&(J=$u=null,Y=0),xd=t,bd=e,Sd=n,wd=i,Td=r,rf(e,t,n,o,c,l,f)}}function rf(e,t,n,r,i,a,o){var s=t.lanes|t.childLanes;if(Cd=s,s|=wi,ht(e,n,s,r,i,a),Dd=null,(n&335544064)===n?(Od=Ia(e),r=10262):(Od=null,r=10256),(t.subtreeFlags&r)!==0||(t.flags&r)!==0?(e.callbackNode=null,e.callbackPriority=0,yf(Ye,function(){return ff(),null})):(e.callbackNode=null,e.callbackPriority=0),Rl=!1,r=!!(t.flags&13878),t.subtreeFlags&13878||r){r=A.T,A.T=null,i=j.p,j.p=2,a=q,q|=4;try{fu(e,t,n)}finally{q=a,j.p=i,A.T=r}}yd=1,Rl?Ed=Mp(o,e.containerInfo,Od,sf,cf,of,lf,ff,af,null,null):(sf(),cf(),lf())}function af(e){if(yd!==0){var t=bd.onRecoverableError;t(e,{componentStack:null})}}function of(){yd===3&&(yd=0,Nu(xd,bd),yd=4)}function sf(){if(yd===1){yd=0;var e=bd,t=xd,n=Sd,r=!!(t.flags&13878);if(t.subtreeFlags&13878||r){r=A.T,A.T=null;var i=j.p;j.p=2;var a=q;q|=4;try{lu=uu=!1,ku(t,e,n),n=cp;var o=Jr(e.containerInfo),s=n.focusedElem,c=n.selectionRange;if(o!==s&&s&&s.ownerDocument&&qr(s.ownerDocument.documentElement,s)){if(c!==null&&Yr(s)){var l=c.start,u=c.end;if(u===void 0&&(u=l),`selectionStart`in s)s.selectionStart=l,s.selectionEnd=Math.min(u,s.value.length);else{var d=s.ownerDocument||document,f=d&&d.defaultView||window;if(f.getSelection){var p=f.getSelection(),m=s.textContent.length,h=Math.min(c.start,m),g=c.end===void 0?h:Math.min(c.end,m);!p.extend&&h>g&&(o=g,g=h,h=o);var _=Kr(s,h),v=Kr(s,g);if(_&&v&&(p.rangeCount!==1||p.anchorNode!==_.node||p.anchorOffset!==_.offset||p.focusNode!==v.node||p.focusOffset!==v.offset)){var y=d.createRange();y.setStart(_.node,_.offset),p.removeAllRanges(),h>g?(p.addRange(y),p.extend(v.node,v.offset)):(y.setEnd(v.node,v.offset),p.addRange(y))}}}}for(d=[],p=s;p=p.parentNode;)p.nodeType===1&&d.push({element:p,left:p.scrollLeft,top:p.scrollTop});for(typeof s.focus==`function`&&s.focus(),s=0;s<d.length;s++){var b=d[s];b.element.scrollLeft=b.left,b.element.scrollTop=b.top}}gh=!!sp,cp=sp=null}finally{q=a,j.p=i,A.T=r}}e.current=t,yd=2}}function cf(){if(yd===2){yd=0;var e=bd,t=xd,n=!!(t.flags&8772);if(t.subtreeFlags&8772||n){n=A.T,A.T=null;var r=j.p;j.p=2;var i=q;q|=4;try{mu(e,t.alternate,t)}finally{q=i,j.p=r,A.T=n}}yd=3}}function lf(){if(yd===4||yd===3){yd=0;var e=Ed;Ed=null,We();var t=bd,n=xd,r=Sd,i=Td,a=(r&335544064)===r?10262:10256;if((n.subtreeFlags&a)!==0||(n.flags&a)!==0?yd=5:(yd=0,xd=bd=null,uf(t,t.pendingLanes)),a=t.pendingLanes,a===0&&(vd=null),bt(r),n=n.stateNode,F&&typeof F.onCommitFiberRoot==`function`)try{F.onCommitFiberRoot(P,n,void 0,(n.current.flags&128)==128)}catch{}if(i!==null){n=A.T,a=j.p,j.p=2,A.T=null;try{for(var o=t.onRecoverableError,s=0;s<i.length;s++){var c=i[s];o(c.value,{componentStack:c.stack})}}finally{A.T=n,j.p=a}}if(i=Dd,o=Od,Od=null,i!==null&&(Dd=null,o===null&&(o=[]),e!==null))for(c=0;c<i.length;c++)n=(0,i[c])(o),n!==void 0&&e.finished.finally(n);Sd&3&&df(),Ef(t),a=t.pendingLanes,r&261930&&a&42?t===Ad?kd++:(kd=0,Ad=t):(kd=0,Ad=null),Df(0,!1)}}function uf(e,t){(e.pooledCacheLanes&=t)===0&&(t=e.pooledCache,t!=null&&(e.pooledCache=null,Na(t)))}function df(){return Ed!==null&&(Ed.skipTransition(),Ed=null),sf(),cf(),lf(),ff()}function ff(){if(yd!==5)return!1;var e=bd,t=Cd;Cd=0;var n=bt(Sd),r=A.T,i=j.p;try{j.p=32>n?32:n,A.T=null,n=wd,wd=null;var a=bd,o=Sd;if(yd=0,xd=bd=null,Sd=0,q&6)throw Error(s(331));var c=q;if(q|=4,Ju(a.current),Bu(a,a.current,o,n),q=c,Df(0,!1),F&&typeof F.onPostCommitFiberRoot==`function`)try{F.onPostCommitFiberRoot(P,a)}catch{}return!0}finally{j.p=i,A.T=r,uf(e,t)}}function pf(e,t,n){t=Hi(n,t),t=Ec(e.stateNode,t,2),e=go(e,t,2),e!==null&&(mt(e,2),Ef(e))}function Z(e,t,n){if(e.tag===3)pf(e,e,n);else for(;t!==null;){if(t.tag===3){pf(t,e,n);break}if(t.tag===1){var r=t.stateNode;if(typeof t.type.getDerivedStateFromError==`function`||typeof r.componentDidCatch==`function`&&(vd===null||!vd.has(r))){e=Hi(n,e),n=Dc(2),r=go(t,n,2),r!==null&&(Oc(n,r,t,e),mt(r,2),Ef(r));break}}t=t.return}}function mf(e,t,n){var r=e.pingCache;if(r===null){r=e.pingCache=new Qu;var i=new Set;r.set(t,i)}else i=r.get(t),i===void 0&&(i=new Set,r.set(t,i));i.has(n)||(rd=!0,i.add(n),e=hf.bind(null,e,t,n),t.then(e,e))}function hf(e,t,n){var r=e.pingCache;r!==null&&r.delete(t),e.pingedLanes|=e.suspendedLanes&n,e.warmLanes&=~n,$u===e&&(Y&n)===n&&(ad===4||ad===3&&(Y&62914560)===Y&&300>Ge()-md?q&2?cd|=n:Vd(e,0):cd|=n,ud===Y&&(ud=0)),Ef(e)}function gf(e,t){t===0&&(t=ft()),e=Di(e,t),e!==null&&(mt(e,t),Ef(e))}function _f(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),gf(e,n)}function vf(e,t){var n=0;switch(e.tag){case 31:case 13:var r=e.stateNode,i=e.memoizedState;i!==null&&(n=i.retryLane);break;case 19:r=e.stateNode;break;case 22:r=e.stateNode._retryCache;break;default:throw Error(s(314))}r!==null&&r.delete(t),gf(e,n)}function yf(e,t){return Ve(e,t)}var bf=null,xf=null,Sf=!1,Cf=!1,wf=!1,Tf=0;function Ef(e){e!==xf&&e.next===null&&(xf===null?bf=xf=e:xf=xf.next=e),Cf=!0,Sf||(Sf=!0,Nf())}function Df(e,t){if(!wf&&Cf){wf=!0;do for(var n=!1,r=bf;r!==null;){if(!t){if(e!==0){var i=r.pendingLanes;if(i===0)var a=0;else{var o=r.suspendedLanes,s=r.pingedLanes;a=(1<<31-tt(42|e)+1)-1,a&=i&~(o&~s),a=a&201326741?a&201326741|1:a?a|2:0}a!==0&&(n=!0,Mf(r,a))}else a=Y,a=ct(r,r===$u?a:0,r.cancelPendingCommit!==null||r.timeoutHandle!==-1),!(a&3)||lt(r,a)||(n=!0,Mf(r,a))}r=r.next}while(n);wf=!1}}function Of(){kf()}function kf(){Cf=Sf=!1;var e=0;Tf!==0&&hp()&&(e=Tf);for(var t=Ge(),n=null,r=bf;r!==null;){var i=r.next,a=Af(r,t);a===0?(r.next=null,n===null?bf=i:n.next=i,i===null&&(xf=n)):(n=r,(e!==0||a&3)&&(Cf=!0)),r=i}yd!==0&&yd!==5||Df(e,!1),Tf!==0&&(Tf=0)}function Af(e,t){for(var n=e.suspendedLanes,r=e.pingedLanes,i=e.expirationTimes,a=e.pendingLanes&-62914561;0<a;){var o=31-tt(a),s=1<<o,c=i[o];c===-1?((s&n)===0||(s&r)!==0)&&(i[o]=dt(s,t)):c<=t&&(e.expiredLanes|=s),a&=~s}if(t=$u,n=Y,n=ct(e,e===t?n:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),r=e.callbackNode,n===0||e===t&&(X===2||X===9)||e.cancelPendingCommit!==null)return r!==null&&r!==null&&He(r),e.callbackNode=null,e.callbackPriority=0;if(!(n&3)||lt(e,n)){if(t=n&-n,t===e.callbackPriority)return t;switch(r!==null&&He(r),bt(n)){case 2:case 8:n=Je;break;case 32:n=Ye;break;case 268435456:n=Ze;break;default:n=Ye}return r=jf.bind(null,e),n=Ve(n,r),e.callbackPriority=t,e.callbackNode=n,t}return r!==null&&r!==null&&He(r),e.callbackPriority=2,e.callbackNode=null,2}function jf(e,t){if(yd!==0&&yd!==5)return e.callbackNode=null,e.callbackPriority=0,null;var n=e.callbackNode;if(df()&&e.callbackNode!==n)return null;var r=Y;return r=ct(e,e===$u?r:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),r===0?null:(Fd(e,r,t),Af(e,Ge()),e.callbackNode!=null&&e.callbackNode===n?jf.bind(null,e):null)}function Mf(e,t){if(df())return null;Fd(e,t,!0)}function Nf(){bp(function(){q&6?Ve(qe,Of):kf()})}function Pf(){if(Tf===0){var e=za;e===0&&(e=at,at<<=1,!(at&261888)&&(at=256)),Tf=e}return Tf}function Ff(e){return e==null||typeof e==`symbol`||typeof e==`boolean`?null:typeof e==`function`?e:vn(e)}function If(e,t,n,r,i){if(t===`submit`&&n&&n.stateNode===i){var a=Ff((i[Tt]||null).action),o=r.submitter;o&&(t=(t=o[Tt]||null)?Ff(t.formAction):o.getAttribute(`formAction`),t!==null&&(a=t,o=null));var s=new Bn(`action`,`action`,null,r,i);e.push({event:s,listeners:[{instance:null,listener:function(){if(r.defaultPrevented){if(Tf!==0){var e=new FormData(i,o);Qs(n,{pending:!0,data:e,method:i.method,action:a},null,e)}}else typeof a==`function`&&(s.preventDefault(),e=new FormData(i,o),Qs(n,{pending:!0,data:e,method:i.method,action:a},a,e))},currentTarget:i}]})}}for(var Lf=0;Lf<hi.length;Lf++){var Rf=hi[Lf];gi(Rf.toLowerCase(),`on`+(Rf[0].toUpperCase()+Rf.slice(1)))}gi(si,`onAnimationEnd`),gi(ci,`onAnimationIteration`),gi(li,`onAnimationStart`),gi(`dblclick`,`onDoubleClick`),gi(`focusin`,`onFocus`),gi(`focusout`,`onBlur`),gi(ui,`onTransitionRun`),gi(di,`onTransitionStart`),gi(fi,`onTransitionCancel`),gi(pi,`onTransitionEnd`),Ut(`onMouseEnter`,[`mouseout`,`mouseover`]),Ut(`onMouseLeave`,[`mouseout`,`mouseover`]),Ut(`onPointerEnter`,[`pointerout`,`pointerover`]),Ut(`onPointerLeave`,[`pointerout`,`pointerover`]),Ht(`onChange`,`change click focusin focusout input keydown keyup selectionchange`.split(` `)),Ht(`onSelect`,`focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange`.split(` `)),Ht(`onBeforeInput`,[`compositionend`,`keypress`,`textInput`,`paste`]),Ht(`onCompositionEnd`,`compositionend focusout keydown keypress keyup mousedown`.split(` `)),Ht(`onCompositionStart`,`compositionstart focusout keydown keypress keyup mousedown`.split(` `)),Ht(`onCompositionUpdate`,`compositionupdate focusout keydown keypress keyup mousedown`.split(` `));var zf=`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(` `),Bf=new Set(`beforetoggle cancel close invalid load scroll scrollend toggle`.split(` `).concat(zf));function Vf(e,t){t=!!(t&4);for(var n=0;n<e.length;n++){var r=e[n],i=r.event;r=r.listeners;a:{var a=void 0;if(t)for(var o=r.length-1;0<=o;o--){var s=r[o],c=s.instance,l=s.currentTarget;if(s=s.listener,c!==a&&i.isPropagationStopped())break a;a=s,i.currentTarget=l;try{a(i)}catch(e){xi(e)}i.currentTarget=null,a=c}else for(o=0;o<r.length;o++){if(s=r[o],c=s.instance,l=s.currentTarget,s=s.listener,c!==a&&i.isPropagationStopped())break a;a=s,i.currentTarget=l;try{a(i)}catch(e){xi(e)}i.currentTarget=null,a=c}}}}function Q(e,t){var n=t[Dt];n===void 0&&(n=t[Dt]=new Set);var r=e+`__bubble`;n.has(r)||(Gf(t,e,2,!1),n.add(r))}function Hf(e,t,n){var r=0;t&&(r|=4),Gf(n,e,r,t)}var Uf=`_reactListening`+Math.random().toString(36).slice(2);function Wf(e){if(!e[Uf]){e[Uf]=!0,Bt.forEach(function(t){t!==`selectionchange`&&(Bf.has(t)||Hf(t,!1,e),Hf(t,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[Uf]||(t[Uf]=!0,Hf(`selectionchange`,!1,t))}}function Gf(e,t,n,r){switch(Ch(t)){case 2:var i=_h;break;case 8:i=vh;break;default:i=yh}n=i.bind(null,t,n,e),i=void 0,!kn||t!==`touchstart`&&t!==`touchmove`&&t!==`wheel`||(i=!0),r?i===void 0?e.addEventListener(t,n,!0):e.addEventListener(t,n,{capture:!0,passive:i}):i===void 0?e.addEventListener(t,n,!1):e.addEventListener(t,n,{passive:i})}function Kf(e,t,n,r,i){var a=r;if(!(t&1)&&!(t&2)&&r!==null)a:for(;;){if(r===null)return;var o=r.tag;if(o===3||o===4){var s=r.stateNode.containerInfo;if(s===i)break;if(o===4)for(o=r.return;o!==null;){var c=o.tag;if((c===3||c===4)&&o.stateNode.containerInfo===i)return;o=o.return}for(;s!==null;){if(o=Pt(s),o===null)return;if(c=o.tag,c===5||c===6||c===26||c===27){r=a=o;continue a}s=s.parentNode}}r=r.return}En(function(){var r=a,i=xn(n),o=[];a:{var s=mi.get(e);if(s!==void 0){var c=Bn,u=e;switch(e){case`keypress`:if(Fn(n)===0)break a;case`keydown`:case`keyup`:c=ir;break;case`focusin`:u=`focus`,c=Yn;break;case`focusout`:u=`blur`,c=Yn;break;case`beforeblur`:case`afterblur`:c=Yn;break;case`click`:if(n.button===2)break a;case`auxclick`:case`dblclick`:case`mousedown`:case`mousemove`:case`mouseup`:case`mouseout`:case`mouseover`:case`contextmenu`:c=qn;break;case`drag`:case`dragend`:case`dragenter`:case`dragexit`:case`dragleave`:case`dragover`:case`dragstart`:case`drop`:c=Jn;break;case`touchcancel`:case`touchend`:case`touchmove`:case`touchstart`:c=sr;break;case si:case ci:case li:c=Xn;break;case pi:c=cr;break;case`scroll`:case`scrollend`:c=Hn;break;case`wheel`:c=lr;break;case`copy`:case`cut`:case`paste`:c=Zn;break;case`gotpointercapture`:case`lostpointercapture`:case`pointercancel`:case`pointerdown`:case`pointermove`:case`pointerout`:case`pointerover`:case`pointerup`:c=ar;break;case`submit`:c=or;break;case`toggle`:case`beforetoggle`:c=ur}var d=!!(t&4),f=!d&&(e===`scroll`||e===`scrollend`),p=d?s===null?null:s+`Capture`:s;d=[];for(var m=r,h;m!==null;){var g=m;if(h=g.stateNode,g=g.tag,g!==5&&g!==26&&g!==27||h===null||p===null||(g=Dn(m,p),g!=null&&d.push(qf(m,g,h))),f)break;m=m.return}0<d.length&&(s=new c(s,u,null,n,i),o.push({event:s,listeners:d}))}}if(!(t&7)){a:{if(c=e===`mouseover`||e===`pointerover`,s=e===`mouseout`||e===`pointerout`,c&&n!==bn&&(u=n.relatedTarget||n.fromElement)&&(Pt(u)||u[Et]))break a;(s||c)&&(u=i.window===i?i:(c=i.ownerDocument)?c.defaultView||c.parentWindow:window,s?(c=n.relatedTarget||n.toElement,s=r,c=c?Pt(c):null,c!==null&&(f=l(c),d=c.tag,c!==f||d!==5&&d!==27&&d!==6)&&(c=null)):(s=null,c=r),s!==c&&(d=qn,g=`onMouseLeave`,p=`onMouseEnter`,m=`mouse`,(e===`pointerout`||e===`pointerover`)&&(d=ar,g=`onPointerLeave`,p=`onPointerEnter`,m=`pointer`),f=s==null?u:It(s),h=c==null?u:It(c),u=new d(g,m+`leave`,s,n,i),u.target=f,u.relatedTarget=h,g=null,Pt(i)===r&&(d=new d(p,m+`enter`,c,n,i),d.target=h,d.relatedTarget=f,g=d),f=g,d=s&&c?E(s,c,Yf):null,s!==null&&Xf(o,u,s,d,!1),c!==null&&f!==null&&Xf(o,f,c,d,!0)))}a:{if(s=r?It(r):window,c=s.nodeName&&s.nodeName.toLowerCase(),c===`select`||c===`input`&&s.type===`file`)var _=Ar;else if(wr(s)){if(jr)_=Br;else{_=Rr;var v=Lr}}else c=s.nodeName,!c||c.toLowerCase()!==`input`||s.type!==`checkbox`&&s.type!==`radio`?r&&hn(r.elementType)&&(_=Ar):_=zr;if(_&&=_(e,r)){Tr(o,_,n,i);break a}v&&v(e,s,r)}switch(v=r?It(r):window,e){case`focusin`:(wr(v)||v.contentEditable===`true`)&&(Zr=v,Qr=r,$r=null);break;case`focusout`:$r=Qr=Zr=null;break;case`mousedown`:ei=!0;break;case`contextmenu`:case`mouseup`:case`dragend`:ei=!1,ti(o,n,i);break;case`selectionchange`:if(Xr)break;case`keydown`:case`keyup`:ti(o,n,i)}var y;if(fr)b:{switch(e){case`compositionstart`:var b=`onCompositionStart`;break b;case`compositionend`:b=`onCompositionEnd`;break b;case`compositionupdate`:b=`onCompositionUpdate`;break b}b=void 0}else br?vr(e,n)&&(b=`onCompositionEnd`):e===`keydown`&&n.keyCode===229&&(b=`onCompositionStart`);b&&(hr&&n.locale!==`ko`&&(br||b!==`onCompositionStart`?b===`onCompositionEnd`&&br&&(y=Pn()):(jn=i,Mn=`value`in jn?jn.value:jn.textContent,br=!0)),v=Jf(r,b),0<v.length&&(b=new Qn(b,e,null,n,i),o.push({event:b,listeners:v}),y?b.data=y:(y=yr(n),y!==null&&(b.data=y)))),(y=mr?xr(e,n):Sr(e,n))&&(b=Jf(r,`onBeforeInput`),0<b.length&&(v=new Qn(`onBeforeInput`,`beforeinput`,null,n,i),o.push({event:v,listeners:b}),v.data=y)),If(o,e,r,n,i)}Vf(o,t)})}function qf(e,t,n){return{instance:e,listener:t,currentTarget:n}}function Jf(e,t){for(var n=t+`Capture`,r=[];e!==null;){var i=e,a=i.stateNode;if(i=i.tag,i!==5&&i!==26&&i!==27||a===null||(i=Dn(e,n),i!=null&&r.unshift(qf(e,i,a)),i=Dn(e,t),i!=null&&r.push(qf(e,i,a))),e.tag===3)return r;e=e.return}return[]}function Yf(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5&&e.tag!==27);return e||null}function Xf(e,t,n,r,i){for(var a=t._reactName,o=[];n!==null&&n!==r;){var s=n,c=s.alternate,l=s.stateNode;if(s=s.tag,c!==null&&c===r)break;s!==5&&s!==26&&s!==27||l===null||(c=l,i?(l=Dn(n,a),l!=null&&o.unshift(qf(n,l,c))):i||(l=Dn(n,a),l!=null&&o.push(qf(n,l,c)))),n=n.return}o.length!==0&&e.push({event:t,listeners:o})}var Zf=/\r\n?/g,Qf=/\u0000|\uFFFD/g;function $f(e){return(typeof e==`string`?e:``+e).replace(Zf,`
9
- `).replace(Qf,``)}function ep(e,t){return t=$f(t),$f(e)===t}function $(e,t,n,r,i,a){switch(n){case`children`:if(typeof r==`string`)t===`body`||t===`textarea`&&r===``||dn(e,r);else if(typeof r==`number`||typeof r==`bigint`)t!==`body`&&dn(e,``+r);else return;break;case`className`:Yt(e,`class`,r);break;case`tabIndex`:Yt(e,`tabindex`,r);break;case`dir`:case`role`:case`viewBox`:case`width`:case`height`:Yt(e,n,r);break;case`style`:mn(e,r,a);return;case`data`:if(t!==`object`){Yt(e,`data`,r);break}case`src`:case`href`:if(r===``&&(t!==`a`||n!==`href`)||r==null||typeof r==`function`||typeof r==`symbol`||typeof r==`boolean`){e.removeAttribute(n);break}r=vn(r),e.setAttribute(n,r);break;case`action`:case`formAction`:if(typeof r==`function`){e.setAttribute(n,`javascript:throw new Error('A React form was unexpectedly submitted. If you called form.submit() manually, consider using form.requestSubmit() instead. If you\\'re trying to use event.stopPropagation() in a submit event handler, consider also calling event.preventDefault().')`);break}if(typeof a==`function`&&(n===`formAction`?(t!==`input`&&$(e,t,`name`,i.name,i,null),$(e,t,`formEncType`,i.formEncType,i,null),$(e,t,`formMethod`,i.formMethod,i,null),$(e,t,`formTarget`,i.formTarget,i,null)):($(e,t,`encType`,i.encType,i,null),$(e,t,`method`,i.method,i,null),$(e,t,`target`,i.target,i,null))),r==null||typeof r==`symbol`||typeof r==`boolean`){e.removeAttribute(n);break}r=vn(r),e.setAttribute(n,r);break;case`onClick`:r!=null&&(e.onclick=yn);return;case`onScroll`:r!=null&&Q(`scroll`,e);return;case`onScrollEnd`:r!=null&&Q(`scrollend`,e);return;case`dangerouslySetInnerHTML`:if(r!=null){if(typeof r!=`object`||!(`__html`in r))throw Error(s(61));if(n=r.__html,n!=null){if(i.children!=null)throw Error(s(60));a?.__html!==n&&(e.innerHTML=n)}}break;case`multiple`:e.multiple=r&&typeof r!=`function`&&typeof r!=`symbol`;break;case`muted`:e.muted=r&&typeof r!=`function`&&typeof r!=`symbol`;break;case`suppressContentEditableWarning`:case`suppressHydrationWarning`:case`defaultValue`:case`defaultChecked`:case`innerHTML`:case`ref`:break;case`autoFocus`:break;case`xlinkHref`:if(r==null||typeof r==`function`||typeof r==`boolean`||typeof r==`symbol`){e.removeAttribute(`xlink:href`);break}n=vn(r),e.setAttributeNS(`http://www.w3.org/1999/xlink`,`xlink:href`,n);break;case`contentEditable`:case`spellCheck`:case`draggable`:case`value`:case`autoReverse`:case`externalResourcesRequired`:case`focusable`:case`preserveAlpha`:r!=null&&typeof r!=`function`&&typeof r!=`symbol`?e.setAttribute(n,r):e.removeAttribute(n);break;case`inert`:case`allowFullScreen`:case`async`:case`autoPlay`:case`controls`:case`credentialless`:case`default`:case`defer`:case`disabled`:case`disablePictureInPicture`:case`disableRemotePlayback`:case`formNoValidate`:case`hidden`:case`loop`:case`noModule`:case`noValidate`:case`open`:case`playsInline`:case`readOnly`:case`required`:case`reversed`:case`scoped`:case`seamless`:case`itemScope`:r&&typeof r!=`function`&&typeof r!=`symbol`?e.setAttribute(n,``):e.removeAttribute(n);break;case`capture`:case`download`:!0===r?e.setAttribute(n,``):!1!==r&&r!=null&&typeof r!=`function`&&typeof r!=`symbol`?e.setAttribute(n,r):e.removeAttribute(n);break;case`cols`:case`rows`:case`size`:case`span`:r!=null&&typeof r!=`function`&&typeof r!=`symbol`&&!isNaN(r)&&1<=r?e.setAttribute(n,r):e.removeAttribute(n);break;case`rowSpan`:case`start`:r==null||typeof r==`function`||typeof r==`symbol`||isNaN(r)?e.removeAttribute(n):e.setAttribute(n,r);break;case`popover`:Q(`beforetoggle`,e),Q(`toggle`,e),Jt(e,`popover`,r);break;case`xlinkActuate`:Xt(e,`http://www.w3.org/1999/xlink`,`xlink:actuate`,r);break;case`xlinkArcrole`:Xt(e,`http://www.w3.org/1999/xlink`,`xlink:arcrole`,r);break;case`xlinkRole`:Xt(e,`http://www.w3.org/1999/xlink`,`xlink:role`,r);break;case`xlinkShow`:Xt(e,`http://www.w3.org/1999/xlink`,`xlink:show`,r);break;case`xlinkTitle`:Xt(e,`http://www.w3.org/1999/xlink`,`xlink:title`,r);break;case`xlinkType`:Xt(e,`http://www.w3.org/1999/xlink`,`xlink:type`,r);break;case`xmlBase`:Xt(e,`http://www.w3.org/XML/1998/namespace`,`xml:base`,r);break;case`xmlLang`:Xt(e,`http://www.w3.org/XML/1998/namespace`,`xml:lang`,r);break;case`xmlSpace`:Xt(e,`http://www.w3.org/XML/1998/namespace`,`xml:space`,r);break;case`is`:Jt(e,`is`,r);break;case`innerText`:case`textContent`:return;default:if(!(2<n.length)||n[0]!==`o`&&n[0]!==`O`||n[1]!==`n`&&n[1]!==`N`)n=gn.get(n)||n,Jt(e,n,r);else return}R=!0}function tp(e,t,n,r,i,a){switch(n){case`style`:mn(e,r,a);return;case`dangerouslySetInnerHTML`:if(r!=null){if(typeof r!=`object`||!(`__html`in r))throw Error(s(61));if(n=r.__html,n!=null){if(i.children!=null)throw Error(s(60));a?.__html!==n&&(e.innerHTML=n)}}break;case`children`:if(typeof r==`string`)dn(e,r);else if(typeof r==`number`||typeof r==`bigint`)dn(e,``+r);else return;break;case`onScroll`:r!=null&&Q(`scroll`,e);return;case`onScrollEnd`:r!=null&&Q(`scrollend`,e);return;case`onClick`:r!=null&&(e.onclick=yn);return;case`suppressContentEditableWarning`:case`suppressHydrationWarning`:case`innerHTML`:case`ref`:return;case`innerText`:case`textContent`:return;default:if(!Vt.hasOwnProperty(n))a:{if(n[0]===`o`&&n[1]===`n`&&(i=n.endsWith(`Capture`),a=n.slice(2,i?n.length-7:void 0),t=e[Tt]||null,t=t==null?null:t[n],typeof t==`function`&&e.removeEventListener(a,t,i),typeof r==`function`)){typeof t!=`function`&&t!==null&&(n in e?e[n]=null:e.hasAttribute(n)&&e.removeAttribute(n)),e.addEventListener(a,r,i);break a}R=!0,n in e?e[n]=r:!0===r?e.setAttribute(n,``):Jt(e,n,r)}return}R=!0}function np(e,t,n){switch(t){case`div`:case`span`:case`svg`:case`path`:case`a`:case`g`:case`p`:case`li`:break;case`img`:Q(`error`,e),Q(`load`,e);var r=!1,i=!1,a;for(a in n)if(n.hasOwnProperty(a)){var o=n[a];if(o!=null)switch(a){case`src`:r=!0;break;case`srcSet`:i=!0;break;case`children`:case`dangerouslySetInnerHTML`:throw Error(s(137,t));default:$(e,t,a,o,n,null)}}i&&$(e,t,`srcSet`,n.srcSet,n,null),r&&$(e,t,`src`,n.src,n,null);return;case`input`:Q(`invalid`,e);var c=a=o=i=null,l=null,u=null;for(r in n)if(n.hasOwnProperty(r)){var d=n[r];if(d!=null)switch(r){case`name`:i=d;break;case`type`:o=d;break;case`checked`:l=d;break;case`defaultChecked`:u=d;break;case`value`:a=d;break;case`defaultValue`:c=d;break;case`children`:case`dangerouslySetInnerHTML`:if(d!=null)throw Error(s(137,t));break;default:$(e,t,r,d,n,null)}}on(e,a,c,l,u,o,i,!1);return;case`select`:for(i in Q(`invalid`,e),r=o=a=null,n)if(n.hasOwnProperty(i)&&(c=n[i],c!=null))switch(i){case`value`:a=c;break;case`defaultValue`:o=c;break;case`multiple`:r=c;default:$(e,t,i,c,n,null)}t=a,n=o,e.multiple=!!r,t==null?n!=null&&cn(e,!!r,n,!0):cn(e,!!r,t,!1);return;case`textarea`:for(o in Q(`invalid`,e),a=i=r=null,n)if(n.hasOwnProperty(o)&&(c=n[o],c!=null))switch(o){case`value`:r=c;break;case`defaultValue`:i=c;break;case`children`:a=c;break;case`dangerouslySetInnerHTML`:if(c!=null)throw Error(s(91));break;default:$(e,t,o,c,n,null)}un(e,r,i,a);return;case`option`:for(l in n)if(n.hasOwnProperty(l)&&(r=n[l],r!=null))switch(l){case`selected`:e.selected=r&&typeof r!=`function`&&typeof r!=`symbol`;break;default:$(e,t,l,r,n,null)}return;case`dialog`:Q(`beforetoggle`,e),Q(`toggle`,e),Q(`cancel`,e),Q(`close`,e);break;case`iframe`:case`object`:Q(`load`,e);break;case`video`:case`audio`:for(r=0;r<zf.length;r++)Q(zf[r],e);break;case`image`:Q(`error`,e),Q(`load`,e);break;case`details`:Q(`toggle`,e);break;case`embed`:case`source`:case`link`:Q(`error`,e),Q(`load`,e);case`area`:case`base`:case`br`:case`col`:case`hr`:case`keygen`:case`meta`:case`param`:case`track`:case`wbr`:case`menuitem`:for(u in n)if(n.hasOwnProperty(u)&&(r=n[u],r!=null))switch(u){case`children`:case`dangerouslySetInnerHTML`:throw Error(s(137,t));default:$(e,t,u,r,n,null)}return;default:if(hn(t)){for(d in n)n.hasOwnProperty(d)&&(r=n[d],r!==void 0&&tp(e,t,d,r,n,void 0));return}}for(c in n)n.hasOwnProperty(c)&&(r=n[c],r!=null&&$(e,t,c,r,n,null))}var rp={};function ip(e,t,n,r){switch(t){case`div`:case`span`:case`svg`:case`path`:case`a`:case`g`:case`p`:case`li`:break;case`input`:var i=null,a=null,o=null,c=null,l=null,u=null,d=null;for(m in n){var f=n[m];if(n.hasOwnProperty(m)&&f!=null)switch(m){case`checked`:break;case`value`:break;case`defaultValue`:l=f;default:r.hasOwnProperty(m)||$(e,t,m,null,r,f)}}for(var p in r){var m=r[p];if(f=n[p],r.hasOwnProperty(p)&&(m!=null||f!=null))switch(p){case`type`:m!==f&&(R=!0),a=m;break;case`name`:m!==f&&(R=!0),i=m;break;case`checked`:m!==f&&(R=!0),u=m;break;case`defaultChecked`:m!==f&&(R=!0),d=m;break;case`value`:m!==f&&(R=!0),o=m;break;case`defaultValue`:m!==f&&(R=!0),c=m;break;case`children`:case`dangerouslySetInnerHTML`:if(m!=null)throw Error(s(137,t));break;default:m!==f&&$(e,t,p,m,r,f)}}an(e,o,c,l,u,d,a,i);return;case`select`:for(a in m=o=c=p=null,n)if(l=n[a],n.hasOwnProperty(a)&&l!=null)switch(a){case`value`:break;case`multiple`:m=l;default:r.hasOwnProperty(a)||$(e,t,a,null,r,l)}for(i in r)if(a=r[i],l=n[i],r.hasOwnProperty(i)&&(a!=null||l!=null))switch(i){case`value`:a!==l&&(R=!0),p=a;break;case`defaultValue`:a!==l&&(R=!0),c=a;break;case`multiple`:a!==l&&(R=!0),o=a;default:a!==l&&$(e,t,i,a,r,l)}t=c,n=o,r=m,p==null?!!r!=!!n&&(t==null?cn(e,!!n,n?[]:``,!1):cn(e,!!n,t,!0)):cn(e,!!n,p,!1);return;case`textarea`:for(c in m=p=null,n)if(i=n[c],n.hasOwnProperty(c)&&i!=null&&!r.hasOwnProperty(c))switch(c){case`value`:break;case`children`:break;default:$(e,t,c,null,r,i)}for(o in r)if(i=r[o],a=n[o],r.hasOwnProperty(o)&&(i!=null||a!=null))switch(o){case`value`:i!==a&&(R=!0),p=i;break;case`defaultValue`:i!==a&&(R=!0),m=i;break;case`children`:break;case`dangerouslySetInnerHTML`:if(i!=null)throw Error(s(91));break;default:i!==a&&$(e,t,o,i,r,a)}ln(e,p,m);return;case`option`:for(var h in n)if(p=n[h],n.hasOwnProperty(h)&&p!=null&&!r.hasOwnProperty(h))switch(h){case`selected`:e.selected=!1;break;default:$(e,t,h,null,r,p)}for(l in r)if(p=r[l],m=n[l],r.hasOwnProperty(l)&&p!==m&&(p!=null||m!=null))switch(l){case`selected`:p!==m&&(R=!0),e.selected=p&&typeof p!=`function`&&typeof p!=`symbol`;break;default:$(e,t,l,p,r,m)}return;case`img`:case`link`:case`area`:case`base`:case`br`:case`col`:case`embed`:case`hr`:case`keygen`:case`meta`:case`param`:case`source`:case`track`:case`wbr`:case`menuitem`:for(var g in n)p=n[g],n.hasOwnProperty(g)&&p!=null&&!r.hasOwnProperty(g)&&$(e,t,g,null,r,p);for(u in r)if(p=r[u],m=n[u],r.hasOwnProperty(u)&&p!==m&&(p!=null||m!=null))switch(u){case`children`:case`dangerouslySetInnerHTML`:if(p!=null)throw Error(s(137,t));break;default:$(e,t,u,p,r,m)}return;default:if(hn(t)){for(var _ in n)p=n[_],n.hasOwnProperty(_)&&p!==void 0&&!r.hasOwnProperty(_)&&tp(e,t,_,void 0,r,p);for(d in r)p=r[d],m=n[d],!r.hasOwnProperty(d)||p===m||p===void 0&&m===void 0||tp(e,t,d,p,r,m);return}}for(var v in n)p=n[v],n.hasOwnProperty(v)&&p!=null&&!r.hasOwnProperty(v)&&$(e,t,v,null,r,p);for(f in r)p=r[f],m=n[f],!r.hasOwnProperty(f)||p===m||p==null&&m==null||$(e,t,f,p,r,m)}function ap(e){switch(e){case`css`:case`script`:case`font`:case`img`:case`image`:case`input`:case`link`:return!0;default:return!1}}function op(){if(typeof performance.getEntriesByType==`function`){for(var e=0,t=0,n=performance.getEntriesByType(`resource`),r=0;r<n.length;r++){var i=n[r],a=i.transferSize,o=i.initiatorType,s=i.duration;if(a&&s&&ap(o)){for(o=0,s=i.responseEnd,r+=1;r<n.length;r++){var c=n[r],l=c.startTime;if(l>s)break;var u=c.transferSize,d=c.initiatorType;u&&ap(d)&&(c=c.responseEnd,o+=u*(c<s?1:(s-l)/(c-l)))}if(--r,t+=8*(a+o)/(i.duration/1e3),e++,10<e)break}}if(0<e)return t/e/1e6}return navigator.connection&&(e=navigator.connection.downlink,typeof e==`number`)?e:5}var sp=null,cp=null;function lp(e){return e.nodeType===9?e:e.ownerDocument}function up(e){switch(e){case`http://www.w3.org/2000/svg`:return 1;case`http://www.w3.org/1998/Math/MathML`:return 2;default:return 0}}function dp(e,t){if(e===0)switch(t){case`svg`:return 1;case`math`:return 2;default:return 0}return e===1&&t===`foreignObject`?0:e}function fp(e,t,n,r){return n=lp(n).createElement(e),n[wt]=r,n[Tt]=t,np(n,e,t),Rt(n),n}function pp(e,t){return e===`textarea`||e===`noscript`||typeof t.children==`string`||typeof t.children==`number`||typeof t.children==`bigint`||typeof t.dangerouslySetInnerHTML==`object`&&t.dangerouslySetInnerHTML!==null&&t.dangerouslySetInnerHTML.__html!=null}var mp=null;function hp(){var e=window.event;return e&&e.type===`popstate`?e!==mp&&(mp=e,!0):(mp=null,!1)}var gp=typeof setTimeout==`function`?setTimeout:void 0,_p=typeof clearTimeout==`function`?clearTimeout:void 0,vp=typeof Promise==`function`?Promise:void 0,yp=typeof requestAnimationFrame==`function`?requestAnimationFrame:gp,bp=typeof queueMicrotask==`function`?queueMicrotask:vp===void 0?gp:function(e){return vp.resolve(null).then(e).catch(xp)};function xp(e){setTimeout(function(){throw e})}function Sp(e){return e===`head`}function Cp(e,t){var n=t,r=0;do{var i=n.nextSibling;if(e.removeChild(n),i&&i.nodeType===8){if(n=i.data,n===`/$`||n===`/&`){if(r===0){e.removeChild(i),Hh(t);return}r--}else if(n===`$`||n===`$?`||n===`$~`||n===`$!`||n===`&`)r++;else if(n===`html`)_m(e.ownerDocument.documentElement);else if(n===`head`){n=e.ownerDocument.head,_m(n);for(var a=n.firstChild;a;){var o=a.nextSibling,s=a.nodeName;a[jt]||s===`SCRIPT`||s===`STYLE`||s===`LINK`&&a.rel.toLowerCase()===`stylesheet`||n.removeChild(a),a=o}}else n===`body`&&_m(e.ownerDocument.body)}n=i}while(n);Hh(t)}function wp(e,t){var n=e;e=0;do{var r=n.nextSibling;if(n.nodeType===1?t?(n._stashedDisplay=n.style.display,n.style.display=`none`):(n.style.display=n._stashedDisplay||``,n.getAttribute(`style`)===``&&n.removeAttribute(`style`)):n.nodeType===3&&(t?(n._stashedText=n.nodeValue,n.nodeValue=``):n.nodeValue=n._stashedText||``),r&&r.nodeType===8){if(n=r.data,n===`/$`){if(e===0)break;e--}else n!==`$`&&n!==`$?`&&n!==`$~`&&n!==`$!`||e++}n=r}while(n)}function Tp(e,t,n){if(t=CSS.escape(t)===t?t:`r-`+btoa(t).replace(/=/g,``),e.style.viewTransitionName=t,n!=null&&(e.style.viewTransitionClass=n),n=getComputedStyle(e),n.display===`inline`){if(t=e.getClientRects(),t.length===1)var r=1;else for(var i=r=0;i<t.length;i++){var a=t[i];0<a.width&&0<a.height&&r++}r===1&&(e=e.style,e.display=t.length===1?`inline-block`:`block`,e.marginTop=`-`+n.paddingTop,e.marginBottom=`-`+n.paddingBottom)}}function Ep(e,t){e=e.style,t=t.style;var n=t==null?null:t.hasOwnProperty(`viewTransitionName`)?t.viewTransitionName:t.hasOwnProperty(`view-transition-name`)?t[`view-transition-name`]:null;e.viewTransitionName=n==null||typeof n==`boolean`?``:(``+n).trim(),n=t==null?null:t.hasOwnProperty(`viewTransitionClass`)?t.viewTransitionClass:t.hasOwnProperty(`view-transition-class`)?t[`view-transition-class`]:null,e.viewTransitionClass=n==null||typeof n==`boolean`?``:(``+n).trim(),e.display===`inline-block`&&(t==null?e.display=e.margin=``:(n=t.display,e.display=n==null||typeof n==`boolean`?``:n,n=t.margin,n==null?(n=t.hasOwnProperty(`marginTop`)?t.marginTop:t[`margin-top`],e.marginTop=n==null||typeof n==`boolean`?``:n,t=t.hasOwnProperty(`marginBottom`)?t.marginBottom:t[`margin-bottom`],e.marginBottom=t==null||typeof t==`boolean`?``:t):e.margin=n))}function Dp(e,t,n){return n=n.ownerDocument.defaultView,{rect:e,abs:t.position===`absolute`||t.position===`fixed`,clip:t.clipPath!==`none`||t.overflow!==`visible`||t.filter!==`none`||t.mask!==`none`||t.mask!==`none`||t.borderRadius!==`0px`,view:0<=e.bottom&&0<=e.right&&e.top<=n.innerHeight&&e.left<=n.innerWidth}}function Op(e){return Dp(e.getBoundingClientRect(),getComputedStyle(e),e)}function kp(e){var t=e.getBoundingClientRect();t=new DOMRect(t.x+2e4,t.y+2e4,t.width,t.height);var n=getComputedStyle(e);return Dp(t,n,e)}function Ap(e){return e.documentElement.clientHeight}function jp(e){this.addEventListener(`load`,e),this.addEventListener(`error`,e)}function Mp(e,t,n,r,i,a,o,s,c){var l=t.nodeType===9?t:t.ownerDocument;try{var u=l.startViewTransition({update:function(){var t=l.defaultView,n=t.navigation&&t.navigation.transition,o=l.fonts.status;r();var s=[];if(o===`loaded`&&(Ap(l),l.fonts.status===`loading`&&s.push(l.fonts.ready)),o=s.length,e!==null)for(var c=e.suspenseyImages,u=0,d=0;d<c.length;d++){var f=c[d];if(!f.complete){var p=f.getBoundingClientRect();if(0<p.bottom&&0<p.right&&p.top<t.innerHeight&&p.left<t.innerWidth){if(u+=Xm(f),u>$m){s.length=o;break}f=new Promise(jp.bind(f)),s.push(f)}}}if(0<s.length)return t=Promise.race([Promise.all(s),new Promise(function(e){return setTimeout(e,500)})]).then(i,i),(n?Promise.allSettled([n.finished,t]):t).then(a,a);if(i(),n)return n.finished.then(a,a);a()},types:n});l.__reactViewTransition=u;var d=[];return u.ready.then(function(){for(var e=l.documentElement.getAnimations({subtree:!0}),t=0;t<e.length;t++){var n=e[t],r=n.effect,i=r.pseudoElement;if(i!=null&&i.startsWith(`::view-transition`)){d.push(n),n=r.getKeyframes();for(var a=i=void 0,s=!0,c=0;c<n.length;c++){var u=n[c],f=u.width;if(i===void 0)i=f;else if(i!==f){s=!1;break}if(f=u.height,a===void 0)a=f;else if(a!==f){s=!1;break}delete u.width,delete u.height,u.transform===`none`&&delete u.transform}s&&i!==void 0&&a!==void 0&&(r.setKeyframes(n),s=getComputedStyle(r.target,r.pseudoElement),s.width!==i||s.height!==a)&&(s=n[0],s.width=i,s.height=a,s=n[n.length-1],s.width=i,s.height=a,r.setKeyframes(n))}}o()},function(e){l.__reactViewTransition===u&&(l.__reactViewTransition=null);try{if(typeof e==`object`&&e)switch(e.name){case`InvalidStateError`:(e.message===`View transition was skipped because document visibility state is hidden.`||e.message===`Skipping view transition because document visibility state has become hidden.`||e.message===`Skipping view transition because viewport size changed.`||e.message===`Transition was aborted because of invalid state`)&&(e=null)}e!==null&&c(e)}finally{r(),i(),o()}}),u.finished.finally(function(){for(var e=0;e<d.length;e++)d[e].cancel();l.__reactViewTransition===u&&(l.__reactViewTransition=null),s()}),u}catch{return r(),i(),o(),null}}function Np(e,t){this._scope=document.documentElement,this._selector=`::view-transition-`+e+`(`+t+`)`}Np.prototype.animate=function(e,t){return t=typeof t==`number`?{duration:t}:D({},t),t.pseudoElement=this._selector,this._scope.animate(e,t)},Np.prototype.getAnimations=function(){for(var e=this._scope,t=this._selector,n=e.getAnimations({subtree:!0}),r=[],i=0;i<n.length;i++){var a=n[i].effect;a!==null&&a.target===e&&a.pseudoElement===t&&r.push(n[i])}return r},Np.prototype.getComputedStyle=function(){return getComputedStyle(this._scope,this._selector)};function Pp(e){return{name:e,group:new Np(`group`,e),imagePair:new Np(`image-pair`,e),old:new Np(`old`,e),new:new Np(`new`,e)}}function Fp(e){this._fragmentFiber=e,this._observers=this._eventListeners=null}Fp.prototype.addEventListener=function(e,t,n){var r=null,i=null;if(!(n!=null&&typeof n!=`boolean`&&(r=n.signal||null,r!==null&&r.aborted))){this._eventListeners===null&&(this._eventListeners=[]);var a=this._eventListeners;if(Bp(a,e,t,n)===-1){var o=this,s=t;n!=null&&typeof n!=`boolean`&&!0===n.once&&(s=function(r){o.removeEventListener(e,t,n),typeof t==`function`?t.call(this,r):t.handleEvent(r)}),r!==null&&(i=o.removeEventListener.bind(o,e,t,n),r.addEventListener(`abort`,i,{once:!0}),i=r.removeEventListener.bind(r,`abort`,i)),r=Rp(n),a.push({type:e,listener:t,optionsOrUseCapture:n,attachedListener:s,cleanup:i}),h(this._fragmentFiber.child,!1,Ip,e,s,r)}this._eventListeners=a}};function Ip(e,t,n,r){return b(e).addEventListener(t,n,r),!1}Fp.prototype.removeEventListener=function(e,t,n){var r=this._eventListeners;if(r!==null&&(t=Bp(r,e,t,n),t!==-1)){var i=r[t];n=i.attachedListener;var a=i.cleanup;i=Rp(i.optionsOrUseCapture),h(this._fragmentFiber.child,!1,Lp,e,n,i),r.splice(t,1),a!==null&&a()}};function Lp(e,t,n,r){return b(e).removeEventListener(t,n,r),!1}function Rp(e){return e!=null&&typeof e!=`boolean`&&(!0===e.once||e.signal instanceof AbortSignal)?{capture:e.capture,passive:e.passive}:e}function zp(e){return e==null?`c=0`:typeof e==`boolean`?`c=`+(e?`1`:`0`):`c=`+(e.capture?`1`:`0`)}function Bp(e,t,n,r){if(e.length===0)return-1;r=zp(r);for(var i=0;i<e.length;i++){var a=e[i];if(a.type===t&&a.listener===n&&zp(a.optionsOrUseCapture)===r)return i}return-1}Fp.prototype.dispatchEvent=function(e){var t=g(this._fragmentFiber);if(t===null)return!0;t=b(t);var n=this._eventListeners;if(n!==null&&0<n.length||!e.bubbles){var r=t.nodeType===9?t.createComment(``):document.createTextNode(``);if(n)for(var i=0;i<n.length;i++){var a=n[i];r.addEventListener(a.type,a.attachedListener,Rp(a.optionsOrUseCapture))}if(t.appendChild(r),e=r.dispatchEvent(e),n)for(i=0;i<n.length;i++)a=n[i],r.removeEventListener(a.type,a.attachedListener,Rp(a.optionsOrUseCapture));return t.removeChild(r),e}return t.dispatchEvent(e)},Fp.prototype.focus=function(e){h(this._fragmentFiber.child,!0,Vp,e,void 0,void 0)};function Vp(e,t){return e.tag!==6&&(e=b(e),pm(e,t))}Fp.prototype.focusLast=function(e){var t=[];h(this._fragmentFiber.child,!0,Hp,t,void 0,void 0);for(var n=t.length-1;0<=n&&!Vp(t[n],e);n--);};function Hp(e,t){return t.push(e),!1}Fp.prototype.blur=function(){var e=g(this._fragmentFiber);e!==null&&(e=b(e),e=lp(e).activeElement,e!==null&&h(this._fragmentFiber.child,!1,Up,e,void 0,void 0))};function Up(e,t){return e.tag!==6&&(e=b(e),e===t||e.contains(t)?(t.blur(),!0):!1)}Fp.prototype.observeUsing=function(e){this._observers===null&&(this._observers=new Set),this._observers.add(e),h(this._fragmentFiber.child,!1,Wp,e,void 0,void 0)};function Wp(e,t){return e.tag===6||(e=b(e),t.observe(e)),!1}Fp.prototype.unobserveUsing=function(e){var t=this._observers;if(t!==null&&t.has(e)){t.delete(e),h(this._fragmentFiber.child,!1,Gp,e,void 0,void 0);for(var n=t=0;n<Kp.length;n++){var r=Kp[n];r.fragmentInstance===this&&r.observer===e?e.unobserve(r.instance):Kp[t++]=r}Kp.length=t}};function Gp(e,t){return e.tag===6||(e=b(e),t.unobserve(e)),!1}var Kp=[],qp=!1;function Jp(e,t,n){Kp.push({fragmentInstance:e,observer:t,instance:n}),qp||(qp=!0,mm(function(){qp=!1;var e=Kp;Kp=[];for(var t=0;t<e.length;t++){var n=e[t];n.observer.unobserve(n.instance)}}))}Fp.prototype.getClientRects=function(){var e=[];return h(this._fragmentFiber.child,!1,Yp,e,void 0,void 0),e};function Yp(e,t){if(e.tag===6){e=e.stateNode;var n=e.ownerDocument.createRange();n.selectNodeContents(e),t.push.apply(t,n.getClientRects())}else e=b(e),t.push.apply(t,e.getClientRects());return!1}Fp.prototype.getRootNode=function(e){var t=g(this._fragmentFiber);return t===null?this:b(t).getRootNode(e)},Fp.prototype.compareDocumentPosition=function(e){var t=g(this._fragmentFiber);if(t===null)return Node.DOCUMENT_POSITION_DISCONNECTED;var n=[];h(this._fragmentFiber.child,!1,Hp,n,void 0,void 0);var r=b(t);if(n.length===0){if(n=r,_(this._fragmentFiber)){a:{for(t=this._fragmentFiber.return;t!==null;){if(t.tag===4){t=t.stateNode.containerInfo;break a}if(t.tag===3||t.tag===5||t.tag===27)break;t=t.return}t=null}t!=null&&(n=t)}t=this._fragmentFiber;var i=r=n.compareDocumentPosition(e);return n===e?i=Node.DOCUMENT_POSITION_CONTAINS:r&Node.DOCUMENT_POSITION_CONTAINED_BY&&(n=v(t)[1],n===null?i=Node.DOCUMENT_POSITION_PRECEDING:(e=b(n).compareDocumentPosition(e),i=e===0||e&Node.DOCUMENT_POSITION_FOLLOWING?Node.DOCUMENT_POSITION_FOLLOWING:Node.DOCUMENT_POSITION_PRECEDING)),i|=Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC}t=b(n[0]),i=b(n[n.length-1]);var a=_(this._fragmentFiber)?t.parentElement:r;if(a==null)return Node.DOCUMENT_POSITION_DISCONNECTED;r=a.compareDocumentPosition(t)&Node.DOCUMENT_POSITION_CONTAINED_BY,a=a.compareDocumentPosition(i)&Node.DOCUMENT_POSITION_CONTAINED_BY;var o=t.compareDocumentPosition(e),s=i.compareDocumentPosition(e),c=o&Node.DOCUMENT_POSITION_CONTAINED_BY||s&Node.DOCUMENT_POSITION_CONTAINED_BY;return s=r&&a&&o&Node.DOCUMENT_POSITION_FOLLOWING&&s&Node.DOCUMENT_POSITION_PRECEDING,t=r&&t===e||a&&i===e||c||s?Node.DOCUMENT_POSITION_CONTAINED_BY:!r&&t===e||!a&&i===e?Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC:o,t&Node.DOCUMENT_POSITION_DISCONNECTED||t&Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC||Xp(t,this._fragmentFiber,n[0],n[n.length-1],e)?t:Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC};function Xp(e,t,n,r,i){var a=Pt(i);if(e&Node.DOCUMENT_POSITION_CONTAINED_BY){if(n=!!a)a:{for(;a!==null;){if(a.tag===7&&(a===t||a.alternate===t)){n=!0;break a}a=a.return}n=!1}return n}if(e&Node.DOCUMENT_POSITION_CONTAINS){if(a===null)return a=i.ownerDocument,i===a||i===a.documentElement||i===a.body;a:{for(a=t,t=g(t);a!==null;){if(!(a.tag!==5&&a.tag!==3&&a.tag!==27||a!==t&&a.alternate!==t)){a=!0;break a}a=a.return}a=!1}return a}return e&Node.DOCUMENT_POSITION_PRECEDING?((t=!!a)&&!(t=a===n)&&(t=E(n,a,T),t===null?t=!1:(h(t,!0,C,a,n),a=x,x=null,t=a!==null)),t):e&Node.DOCUMENT_POSITION_FOLLOWING?((t=!!a)&&!(t=a===r)&&(t=E(r,a,T),t===null?t=!1:(h(t,!0,w,a,r),a=x,S=x=null,t=a!==null)),t):!1}function Zp(e,t){var n=e.ownerDocument.createRange();n.selectNodeContents(e),e=n.getBoundingClientRect(),window.scrollTo(window.scrollX+e.left,t?window.scrollY+e.top:window.scrollY+e.bottom-window.innerHeight)}Fp.prototype.scrollIntoView=function(e){if(typeof e==`object`)throw Error(s(566));var t=[];h(this._fragmentFiber.child,!1,Hp,t,void 0,void 0);var n=!1!==e;if(t.length===0){var r=v(this._fragmentFiber);if(r=n?r[1]||r[0]||g(this._fragmentFiber):r[0]||r[1],r===null)return;if(r.tag===6){e=b(r),Zp(e,n);return}if(r=b(r),r.nodeType!==9){if(r.nodeType===11){n=`host`in r?r.host:null,n!==null&&n.scrollIntoView(e);return}r.scrollIntoView(e)}}for(r=n?t.length-1:0;r!==(n?-1:t.length);){var i=t[r];i.tag===6?(i=b(i),Zp(i,n)):b(i).scrollIntoView(e),r+=n?-1:1}};function Qp(e,t){return e=b(e),$p(e,t),!1}function $p(e,t){e.reactFragments??=new Set,e.reactFragments.add(t)}function em(e,t){var n=t._eventListeners;if(n!==null)for(var r=0;r<n.length;r++){var i=n[r];e.addEventListener(i.type,i.attachedListener,Rp(i.optionsOrUseCapture))}e.nodeType!==3&&(n=t._observers,n!==null&&n.forEach(function(n){for(var r=0,i=0;i<Kp.length;i++){var a=Kp[i];(a.fragmentInstance!==t||a.observer!==n||a.instance!==e)&&(Kp[r++]=a)}Kp.length=r,n.observe(e)}),$p(e,t))}function tm(e,t){var n=t._eventListeners;if(n!==null)for(var r=0;r<n.length;r++){var i=n[r];e.removeEventListener(i.type,i.attachedListener,Rp(i.optionsOrUseCapture))}e.nodeType!==3&&(n=t._observers,n!==null&&n.forEach(function(n){typeof n.rootMargin==`string`?Jp(t,n,e):n.unobserve(e)}),e.reactFragments!=null&&e.reactFragments.delete(t))}function nm(e){var t=e.firstChild;for(t&&t.nodeType===10&&(t=t.nextSibling);t;){var n=t;switch(t=t.nextSibling,n.nodeName){case`HTML`:case`HEAD`:case`BODY`:nm(n),Nt(n);continue;case`SCRIPT`:case`STYLE`:continue;case`LINK`:if(n.rel.toLowerCase()===`stylesheet`)continue}e.removeChild(n)}}function rm(e,t,n,r){for(;e.nodeType===1;){var i=n;if(e.nodeName.toLowerCase()!==t.toLowerCase()){if(!r&&(e.nodeName!==`INPUT`||e.type!==`hidden`))break}else if(!r){if(t===`input`&&e.type===`hidden`){var a=i.name==null?null:``+i.name;if(i.type===`hidden`&&e.getAttribute(`name`)===a)return e}else return e}else if(!e[jt])switch(t){case`meta`:if(!e.hasAttribute(`itemprop`))break;return e;case`link`:if(a=e.getAttribute(`rel`),a===`stylesheet`&&e.hasAttribute(`data-precedence`)||a!==i.rel||e.getAttribute(`href`)!==(i.href==null||i.href===``?null:i.href)||e.getAttribute(`crossorigin`)!==(i.crossOrigin==null?null:i.crossOrigin)||e.getAttribute(`title`)!==(i.title==null?null:i.title))break;return e;case`style`:if(e.hasAttribute(`data-precedence`))break;return e;case`script`:if(a=e.getAttribute(`src`),(a!==(i.src==null?null:i.src)||e.getAttribute(`type`)!==(i.type==null?null:i.type)||e.getAttribute(`crossorigin`)!==(i.crossOrigin==null?null:i.crossOrigin))&&a&&e.hasAttribute(`async`)&&!e.hasAttribute(`itemprop`))break;return e;default:return e}if(e=lm(e.nextSibling),e===null)break}return null}function im(e,t,n){if(t===``)return null;for(;e.nodeType!==3;)if((e.nodeType!==1||e.nodeName!==`INPUT`||e.type!==`hidden`)&&!n||(e=lm(e.nextSibling),e===null))return null;return e}function am(e,t){for(;e.nodeType!==8;)if((e.nodeType!==1||e.nodeName!==`INPUT`||e.type!==`hidden`)&&!t||(e=lm(e.nextSibling),e===null))return null;return e}function om(e){return e.data===`$?`||e.data===`$~`}function sm(e){return e.data===`$!`||e.data===`$?`&&e.ownerDocument.readyState!==`loading`}function cm(e,t){var n=e.ownerDocument;if(e.data===`$~`)e._reactRetry=t;else if(e.data!==`$?`||n.readyState!==`loading`)t();else{var r=function(){t(),n.removeEventListener(`DOMContentLoaded`,r)};n.addEventListener(`DOMContentLoaded`,r),e._reactRetry=r}}function lm(e){for(;e!=null;e=e.nextSibling){var t=e.nodeType;if(t===1||t===3)break;if(t===8){if(t=e.data,t===`$`||t===`$!`||t===`$?`||t===`$~`||t===`&`||t===`F!`||t===`F`)break;if(t===`/$`||t===`/&`)return null}}return e}var um=null;function dm(e){e=e.nextSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n===`/$`||n===`/&`){if(t===0)return lm(e.nextSibling);t--}else n!==`$`&&n!==`$!`&&n!==`$?`&&n!==`$~`&&n!==`&`||t++}e=e.nextSibling}return null}function fm(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n===`$`||n===`$!`||n===`$?`||n===`$~`||n===`&`){if(t===0)return e;t--}else n!==`/$`&&n!==`/&`||t++}e=e.previousSibling}return null}function pm(e,t){function n(){r=!0}if(e.ownerDocument.activeElement===e)return!0;var r=!1;try{e.ownerDocument.addEventListener(`focus`,n,!0),(e.focus||HTMLElement.prototype.focus).call(e,t)}finally{e.ownerDocument.removeEventListener(`focus`,n,!0)}return r}function mm(e){yp(function(){yp(function(t){return e(t)})})}function hm(e,t,n){switch(t=lp(n),e){case`html`:if(e=t.documentElement,!e)throw Error(s(452));return e;case`head`:if(e=t.head,!e)throw Error(s(453));return e;case`body`:if(e=t.body,!e)throw Error(s(454));return e;default:throw Error(s(451))}}function gm(e,t,n){for(var r in n){var i=n[r];n.hasOwnProperty(r)&&i!=null&&$(e,t,r,null,rp,i)}n.dangerouslySetInnerHTML!=null&&(e.textContent=``),e.onclick===yn&&(e.onclick=null),Nt(e)}function _m(e){for(var t=e.attributes;t.length;)e.removeAttributeNode(t[0]);Nt(e)}var vm=new Map,ym=new Set;function bm(e){if(typeof e.getRootNode==`function`){var t=e.getRootNode();if(t.nodeType===9||t.nodeType===11)return t}return e.nodeType===9?e:e.ownerDocument}var xm=j.d;j.d={f:Sm,r:Cm,D:Em,C:Dm,L:Om,m:km,X:jm,S:Am,M:Mm};function Sm(){var e=xm.f(),t=zd();return e||t}function Cm(e){var t=Ft(e);t!==null&&t.tag===5&&t.type===`form`?ec(t):xm.r(e)}var wm=typeof document>`u`?null:document;function Tm(e,t,n){var r=wm;if(r&&typeof t==`string`&&t){var i=rn(t);i=`link[rel="`+e+`"][href="`+i+`"]`,typeof n==`string`&&(i+=`[crossorigin="`+n+`"]`),ym.has(i)||(ym.add(i),e={rel:e,crossOrigin:n,href:t},r.querySelector(i)===null&&(t=r.createElement(`link`),np(t,`link`,e),Rt(t),r.head.appendChild(t)))}}function Em(e){xm.D(e),Tm(`dns-prefetch`,e,null)}function Dm(e,t){xm.C(e,t),Tm(`preconnect`,e,t)}function Om(e,t,n){xm.L(e,t,n);var r=wm;if(r&&e&&t){var i=`link[rel="preload"][as="`+rn(t)+`"]`;t===`image`&&n&&n.imageSrcSet?(i+=`[imagesrcset="`+rn(n.imageSrcSet)+`"]`,typeof n.imageSizes==`string`&&(i+=`[imagesizes="`+rn(n.imageSizes)+`"]`)):i+=`[href="`+rn(e)+`"]`;var a=i;switch(t){case`style`:a=Pm(e);break;case`script`:a=Rm(e)}if(!(vm.has(a)||(e=D({rel:`preload`,href:t===`image`&&n&&n.imageSrcSet?void 0:e,as:t},n),vm.set(a,e),r.querySelector(i)!==null||t===`style`&&r.querySelector(Fm(a))||t===`script`&&r.querySelector(zm(a))))){var o=r.createElement(`link`);np(o,`link`,e),t===`style`&&(o[Mt]=!0,o.onload=o.onerror=function(){zt(o)}),Rt(o),r.head.appendChild(o)}}}function km(e,t){xm.m(e,t);var n=wm;if(n&&e){var r=t&&typeof t.as==`string`?t.as:`script`,i=`link[rel="modulepreload"][as="`+rn(r)+`"][href="`+rn(e)+`"]`,a=i;switch(r){case`audioworklet`:case`paintworklet`:case`serviceworker`:case`sharedworker`:case`worker`:case`script`:a=Rm(e)}if(!vm.has(a)&&(e=D({rel:`modulepreload`,href:e},t),vm.set(a,e),n.querySelector(i)===null)){switch(r){case`audioworklet`:case`paintworklet`:case`serviceworker`:case`sharedworker`:case`worker`:case`script`:if(n.querySelector(zm(a)))return}r=n.createElement(`link`),np(r,`link`,e),Rt(r),n.head.appendChild(r)}}}function Am(e,t,n){xm.S(e,t,n);var r=wm;if(r&&e){var i=Lt(r).hoistableStyles,a=Pm(e);t||=`default`;var o=i.get(a);if(!o){var s={loading:0,preload:null};if(o=r.querySelector(Fm(a)))s.loading=5;else{e=D({rel:`stylesheet`,href:e,"data-precedence":t},n),(n=vm.get(a))&&Hm(e,n);var c=o=r.createElement(`link`);Rt(c),np(c,`link`,e),c._p=new Promise(function(e,t){c.onload=e,c.onerror=t}),c.addEventListener(`load`,function(){s.loading|=1}),c.addEventListener(`error`,function(){s.loading|=2}),s.loading|=4,Vm(o,t,r)}o={type:`stylesheet`,instance:o,count:1,state:s},i.set(a,o)}}}function jm(e,t){xm.X(e,t);var n=wm;if(n&&e){var r=Lt(n).hoistableScripts,i=Rm(e),a=r.get(i);a||(a=n.querySelector(zm(i)),a||(e=D({src:e,async:!0},t),(t=vm.get(i))&&Um(e,t),a=n.createElement(`script`),Rt(a),np(a,`link`,e),n.head.appendChild(a)),a={type:`script`,instance:a,count:1,state:null},r.set(i,a))}}function Mm(e,t){xm.M(e,t);var n=wm;if(n&&e){var r=Lt(n).hoistableScripts,i=Rm(e),a=r.get(i);a||(a=n.querySelector(zm(i)),a||(e=D({src:e,async:!0,type:`module`},t),(t=vm.get(i))&&Um(e,t),a=n.createElement(`script`),Rt(a),np(a,`link`,e),n.head.appendChild(a)),a={type:`script`,instance:a,count:1,state:null},r.set(i,a))}}function Nm(e,t,n,r){var i=(i=Oe.current)?bm(i):null;if(!i)throw Error(s(446));switch(e){case`meta`:case`title`:return null;case`style`:return typeof n.precedence==`string`&&typeof n.href==`string`?(n=Pm(n.href),t=Lt(i).hoistableStyles,r=t.get(n),r||(r={type:`style`,instance:null,count:0,state:null},t.set(n,r)),r):{type:`void`,instance:null,count:0,state:null};case`link`:if(n.rel===`stylesheet`&&typeof n.href==`string`&&typeof n.precedence==`string`){e=Pm(n.href);var a=Lt(i).hoistableStyles,o=a.get(e);if(o||(i=i.ownerDocument||i,o={type:`stylesheet`,instance:null,count:0,state:{loading:0,preload:null}},a.set(e,o),(a=i.querySelector(Fm(e)))?a._p||(o.instance=a,o.state.loading=5):(a=vm.get(e),a||(a={rel:`preload`,as:`style`,href:n.href,crossOrigin:n.crossOrigin,integrity:n.integrity,media:n.media,hrefLang:n.hrefLang,referrerPolicy:n.referrerPolicy},vm.set(e,a)),Lm(i,e,a,o.state))),t&&r===null)throw Error(s(528,``));return o}if(t&&r!==null)throw Error(s(529,``));return null;case`script`:return t=n.async,n=n.src,typeof n==`string`&&t&&typeof t!=`function`&&typeof t!=`symbol`?(n=Rm(n),t=Lt(i).hoistableScripts,r=t.get(n),r||(r={type:`script`,instance:null,count:0,state:null},t.set(n,r)),r):{type:`void`,instance:null,count:0,state:null};default:throw Error(s(444,e))}}function Pm(e){return`href="`+rn(e)+`"`}function Fm(e){return`link[rel="stylesheet"][`+e+`]`}function Im(e){return D({},e,{"data-precedence":e.precedence,precedence:null})}function Lm(e,t,n,r){if(t=e.querySelector(`link[rel="preload"][as="style"][`+t+`]`)){if(!0!==t[Mt]){r.loading=1;return}}else t=e.createElement(`link`),t[Mt]=!0,t.onload=t.onerror=zt.bind(null,t),np(t,`link`,n),Rt(t),e.head.appendChild(t);r.preload=t,t.addEventListener(`load`,function(){return r.loading|=1}),t.addEventListener(`error`,function(){return r.loading|=2})}function Rm(e){return`[src="`+rn(e)+`"]`}function zm(e){return`script[async]`+e}function Bm(e,t,n){if(t.count++,t.instance===null)switch(t.type){case`style`:var r=e.querySelector(`style[data-href~="`+rn(n.href)+`"]`);if(r)return t.instance=r,Rt(r),r;var i=D({},n,{"data-href":n.href,"data-precedence":n.precedence,href:null,precedence:null});return r=(e.ownerDocument||e).createElement(`style`),Rt(r),np(r,`style`,i),Vm(r,n.precedence,e),t.instance=r;case`stylesheet`:i=Pm(n.href);var a=e.querySelector(Fm(i));if(a)return t.state.loading|=4,t.instance=a,Rt(a),a;r=Im(n),(i=vm.get(i))&&Hm(r,i),a=(e.ownerDocument||e).createElement(`link`),Rt(a);var o=a;return o._p=new Promise(function(e,t){o.onload=e,o.onerror=t}),np(a,`link`,r),t.state.loading|=4,Vm(a,n.precedence,e),t.instance=a;case`script`:return a=Rm(n.src),(i=e.querySelector(zm(a)))?(t.instance=i,Rt(i),i):(r=n,(i=vm.get(a))&&(r=D({},n),Um(r,i)),e=e.ownerDocument||e,i=e.createElement(`script`),Rt(i),np(i,`link`,r),e.head.appendChild(i),t.instance=i);case`void`:return null;default:throw Error(s(443,t.type))}else t.type===`stylesheet`&&!(t.state.loading&4)&&(r=t.instance,t.state.loading|=4,Vm(r,n.precedence,e));return t.instance}function Vm(e,t,n){for(var r=n.querySelectorAll(`link[rel="stylesheet"][data-precedence],style[data-precedence]`),i=r.length?r[r.length-1]:null,a=i,o=0;o<r.length;o++){var s=r[o];if(s.dataset.precedence===t)a=s;else if(a!==i)break}a?a.parentNode.insertBefore(e,a.nextSibling):(t=n.nodeType===9?n.head:n,t.insertBefore(e,t.firstChild))}function Hm(e,t){e.crossOrigin??=t.crossOrigin,e.referrerPolicy??=t.referrerPolicy,e.title??=t.title}function Um(e,t){e.crossOrigin??=t.crossOrigin,e.referrerPolicy??=t.referrerPolicy,e.integrity??=t.integrity}var Wm=null;function Gm(e,t,n){if(Wm===null){var r=new Map,i=Wm=new Map;i.set(n,r)}else i=Wm,r=i.get(n),r||(r=new Map,i.set(n,r));if(r.has(e))return r;for(r.set(e,null),n=n.getElementsByTagName(e),i=0;i<n.length;i++){var a=n[i];if(!(a[jt]||a[wt]||e===`link`&&a.getAttribute(`rel`)===`stylesheet`)&&a.namespaceURI!==`http://www.w3.org/2000/svg`){var o=a.getAttribute(t)||``;o=e+o;var s=r.get(o);s?s.push(a):r.set(o,[a])}}return r}function Km(e,t,n){e=e.ownerDocument||e,e.head.insertBefore(n,t===`title`?e.querySelector(`head > title`):null)}function qm(e,t,n){if(n===1||t.itemProp!=null)return!1;switch(e){case`meta`:case`title`:return!0;case`style`:if(typeof t.precedence!=`string`||typeof t.href!=`string`||t.href===``)break;return!0;case`link`:if(typeof t.rel!=`string`||typeof t.href!=`string`||t.href===``||t.onLoad||t.onError)break;switch(t.rel){case`stylesheet`:return e=t.disabled,typeof t.precedence==`string`&&e==null;default:return!0}case`script`:if(t.async&&typeof t.async!=`function`&&typeof t.async!=`symbol`&&!t.onLoad&&!t.onError&&t.src&&typeof t.src==`string`)return!0}return!1}function Jm(e,t){return e===`img`&&t.src!=null&&t.src!==``&&t.onLoad==null&&t.loading!==`lazy`}function Ym(e){return!(e.type===`stylesheet`&&!(e.state.loading&3))}function Xm(e){return(e.width||100)*(e.height||100)*(typeof devicePixelRatio==`number`?devicePixelRatio:1)*.25}function Zm(e,t){typeof t.decode==`function`&&(e.imgCount++,t.complete||(e.imgBytes+=Xm(t),e.suspenseyImages.push(t)),e=rh.bind(e),t.decode().then(e,e))}function Qm(e,t,n,r){if(n.type===`stylesheet`&&(typeof r.media!=`string`||!1!==matchMedia(r.media).matches)&&!(n.state.loading&4)){if(n.instance===null){var i=Pm(r.href),a=t.querySelector(Fm(i));if(a){t=a._p,typeof t==`object`&&t&&typeof t.then==`function`&&(e.count++,e=nh.bind(e),t.then(e,e)),n.state.loading|=4,n.instance=a,Rt(a);return}a=t.ownerDocument||t,r=Im(r),(i=vm.get(i))&&Hm(r,i),a=a.createElement(`link`),Rt(a);var o=a;o._p=new Promise(function(e,t){o.onload=e,o.onerror=t}),np(a,`link`,r),n.instance=a}e.stylesheets===null&&(e.stylesheets=new Map),e.stylesheets.set(n,t),(t=n.state.preload)&&!(n.state.loading&3)&&(e.count++,n=nh.bind(e),t.addEventListener(`load`,n),t.addEventListener(`error`,n))}}var $m=0;function eh(e,t){return e.stylesheets&&e.count===0&&ah(e,e.stylesheets),0<e.count||0<e.imgCount?function(n){var r=setTimeout(function(){if(e.stylesheets&&ah(e,e.stylesheets),e.unsuspend){var t=e.unsuspend;e.unsuspend=null,t()}},6e4+t);0<e.imgBytes&&$m===0&&($m=62500*op());var i=setTimeout(function(){if(e.waitingForImages=!1,e.count===0&&(e.stylesheets&&ah(e,e.stylesheets),e.unsuspend)){var t=e.unsuspend;e.unsuspend=null,t()}},(e.imgBytes>$m?50:800)+t);return e.unsuspend=n,function(){e.unsuspend=null,clearTimeout(r),clearTimeout(i)}}:null}function th(e){if(e.count===0&&(e.imgCount===0||!e.waitingForImages)){if(e.stylesheets)ah(e,e.stylesheets);else if(e.unsuspend){var t=e.unsuspend;e.unsuspend=null,t()}}}function nh(){this.count--,th(this)}function rh(){this.imgCount--,th(this)}var ih=null;function ah(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,ih=new Map,t.forEach(oh,e),ih=null,nh.call(e))}function oh(e,t){if(!(t.state.loading&4)){var n=ih.get(e);if(n)var r=n.get(null);else{n=new Map,ih.set(e,n);for(var i=e.querySelectorAll(`link[data-precedence],style[data-precedence]`),a=0;a<i.length;a++){var o=i[a];(o.nodeName===`LINK`||o.getAttribute(`media`)!==`not all`)&&(n.set(o.dataset.precedence,o),r=o)}r&&n.set(null,r)}i=t.instance,o=i.getAttribute(`data-precedence`),a=n.get(o)||r,a===r&&n.set(null,i),n.set(o,i),this.count++,r=nh.bind(this),i.addEventListener(`load`,r),i.addEventListener(`error`,r),a?a.parentNode.insertBefore(i,a.nextSibling):(e=e.nodeType===9?e.head:e,e.insertBefore(i,e.firstChild)),t.state.loading|=4}}var sh={$$typeof:ae,Provider:null,Consumer:null,_currentValue:xe,_currentValue2:xe,_threadCount:0};function ch(e,t,n,r,i,a,o,s,c){this.tag=1,this.containerInfo=e,this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.next=this.pendingContext=this.context=this.cancelPendingCommit=null,this.callbackPriority=0,this.expirationTimes=pt(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=pt(0),this.hiddenUpdates=pt(null),this.identifierPrefix=r,this.onUncaughtError=i,this.onCaughtError=a,this.onRecoverableError=o,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=c,this.transitionTypes=null,this.incompleteTransitions=new Map}function lh(e,t,n,r,i,a,o,s,c,l,u,d){return e=new ch(e,t,n,o,c,l,u,d,s),t=1,!0===a&&(t|=24),a=Mi(3,null,null,t),e.current=a,a.stateNode=e,t=Ma(),t.refCount++,e.pooledCache=t,t.refCount++,a.memoizedState={element:r,isDehydrated:n,cache:t},po(a),e}function uh(e){return e?(e=Ai,e):Ai}function dh(e,t,n,r,i,a){i=uh(i),r.context===null?r.context=i:r.pendingContext=i,r=ho(t),r.payload={element:n},a=a===void 0?null:a,a!==null&&(r.callback=a),n=go(e,r,t),n!==null&&(Pd(n,e,t),_o(n,e,t))}function fh(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var n=e.retryLane;e.retryLane=n!==0&&n<t?n:t}}function ph(e,t){fh(e,t),(e=e.alternate)&&fh(e,t)}function mh(e){if(e.tag===13||e.tag===31){var t=Di(e,67108864);t!==null&&Pd(t,e,67108864),ph(e,67108864)}}function hh(e){if(e.tag===13||e.tag===31){var t=jd();t=yt(t);var n=Di(e,t);n!==null&&Pd(n,e,t),ph(e,t)}}var gh=!0;function _h(e,t,n,r){var i=A.T;A.T=null;var a=j.p;try{j.p=2,yh(e,t,n,r)}finally{j.p=a,A.T=i}}function vh(e,t,n,r){var i=A.T;A.T=null;var a=j.p;try{j.p=8,yh(e,t,n,r)}finally{j.p=a,A.T=i}}function yh(e,t,n,r){if(gh){var i=bh(r);if(i===null)Kf(e,t,r,xh,n),Mh(e,r);else if(Ph(i,e,t,n,r))r.stopPropagation();else if(Mh(e,r),t&4&&-1<jh.indexOf(e)){for(;i!==null;){var a=Ft(i);if(a!==null)switch(a.tag){case 3:if(a=a.stateNode,a.current.memoizedState.isDehydrated){var o=st(a.pendingLanes);if(o!==0){var s=a;for(s.pendingLanes|=2,s.entangledLanes|=2;o;){var c=1<<31-tt(o);s.entanglements[1]|=c,o&=~c}Ef(a),!(q&6)&&(gd=Ge()+500,Df(0,!1))}}break;case 31:case 13:s=Di(a,2),s!==null&&Pd(s,a,2),zd(),ph(a,2)}if(a=bh(r),a===null&&Kf(e,t,r,xh,n),a===i)break;i=a}i!==null&&r.stopPropagation()}else Kf(e,t,r,null,n)}}function bh(e){return e=xn(e),Sh(e)}var xh=null;function Sh(e){if(xh=null,e=Pt(e),e!==null){var t=l(e);if(t===null)e=null;else{var n=t.tag;if(n===13){if(e=u(t),e!==null)return e;e=null}else if(n===31){if(e=d(t),e!==null)return e;e=null}else if(n===3){if(t.stateNode.current.memoizedState.isDehydrated)return t.tag===3?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null)}}return xh=e,null}function Ch(e){switch(e){case`beforetoggle`:case`cancel`:case`click`:case`close`:case`contextmenu`:case`copy`:case`cut`:case`auxclick`:case`dblclick`:case`dragend`:case`dragstart`:case`drop`:case`focusin`:case`focusout`:case`input`:case`invalid`:case`keydown`:case`keypress`:case`keyup`:case`mousedown`:case`mouseup`:case`paste`:case`pause`:case`play`:case`pointercancel`:case`pointerdown`:case`pointerup`:case`ratechange`:case`reset`:case`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`fullscreenerror`: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`resize`:case`scroll`:case`touchmove`:case`wheel`:case`mouseenter`:case`mouseleave`:case`pointerenter`:case`pointerleave`:return 8;case`message`:switch(Ke()){case qe:return 2;case Je:return 8;case Ye:case Xe:return 32;case Ze:return 268435456;default:return 32}default:return 32}}var wh=!1,Th=null,Eh=null,Dh=null,Oh=new Map,kh=new Map,Ah=[],jh=`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 Mh(e,t){switch(e){case`focusin`:case`focusout`:Th=null;break;case`dragenter`:case`dragleave`:Eh=null;break;case`mouseover`:case`mouseout`:Dh=null;break;case`pointerover`:case`pointerout`:Oh.delete(t.pointerId);break;case`gotpointercapture`:case`lostpointercapture`:kh.delete(t.pointerId)}}function Nh(e,t,n,r,i,a){return e===null||e.nativeEvent!==a?(e={blockedOn:t,domEventName:n,eventSystemFlags:r,nativeEvent:a,targetContainers:[i]},t!==null&&(t=Ft(t),t!==null&&mh(t)),e):(e.eventSystemFlags|=r,t=e.targetContainers,i!==null&&t.indexOf(i)===-1&&t.push(i),e)}function Ph(e,t,n,r,i){switch(t){case`focusin`:return Th=Nh(Th,e,t,n,r,i),!0;case`dragenter`:return Eh=Nh(Eh,e,t,n,r,i),!0;case`mouseover`:return Dh=Nh(Dh,e,t,n,r,i),!0;case`pointerover`:var a=i.pointerId;return Oh.set(a,Nh(Oh.get(a)||null,e,t,n,r,i)),!0;case`gotpointercapture`:return a=i.pointerId,kh.set(a,Nh(kh.get(a)||null,e,t,n,r,i)),!0}return!1}function Fh(e){var t=Pt(e.target);if(t!==null){var n=l(t);if(n!==null){if(t=n.tag,t===13){if(t=u(n),t!==null){e.blockedOn=t,St(e.priority,function(){hh(n)});return}}else if(t===31){if(t=d(n),t!==null){e.blockedOn=t,St(e.priority,function(){hh(n)});return}}else if(t===3&&n.stateNode.current.memoizedState.isDehydrated){e.blockedOn=n.tag===3?n.stateNode.containerInfo:null;return}}}e.blockedOn=null}function Ih(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var n=bh(e.nativeEvent);if(n===null){n=e.nativeEvent;var r=new n.constructor(n.type,n);bn=r,n.target.dispatchEvent(r),bn=null}else return t=Ft(n),t!==null&&mh(t),e.blockedOn=n,!1;t.shift()}return!0}function Lh(e,t,n){Ih(e)&&n.delete(t)}function Rh(){wh=!1,Th!==null&&Ih(Th)&&(Th=null),Eh!==null&&Ih(Eh)&&(Eh=null),Dh!==null&&Ih(Dh)&&(Dh=null),Oh.forEach(Lh),kh.forEach(Lh)}function zh(e,n){e.blockedOn===n&&(e.blockedOn=null,wh||(wh=!0,t.unstable_scheduleCallback(t.unstable_NormalPriority,Rh)))}var Bh=null;function Vh(e){Bh!==e&&(Bh=e,t.unstable_scheduleCallback(t.unstable_NormalPriority,function(){Bh===e&&(Bh=null);for(var t=0;t<e.length;t+=3){var n=e[t],r=e[t+1],i=e[t+2];if(typeof r!=`function`){if(Sh(r||n)===null)continue;break}var a=Ft(n);a!==null&&(e.splice(t,3),t-=3,Qs(a,{pending:!0,data:i,method:n.method,action:r},r,i))}}))}function Hh(e){function t(t){return zh(t,e)}Th!==null&&zh(Th,e),Eh!==null&&zh(Eh,e),Dh!==null&&zh(Dh,e),Oh.forEach(t),kh.forEach(t);for(var n=0;n<Ah.length;n++){var r=Ah[n];r.blockedOn===e&&(r.blockedOn=null)}for(;0<Ah.length&&(n=Ah[0],n.blockedOn===null);)Fh(n),n.blockedOn===null&&Ah.shift();if(n=(e.ownerDocument||e).$$reactFormReplay,n!=null)for(r=0;r<n.length;r+=3){var i=n[r],a=n[r+1],o=i[Tt]||null;if(typeof a==`function`)o||Vh(n);else if(o){var s=null;if(a&&a.hasAttribute(`formAction`)){if(i=a,o=a[Tt]||null)s=o.formAction;else if(Sh(i)!==null)continue}else s=o.action;typeof s==`function`?n[r+1]=s:(n.splice(r,3),r-=3),Vh(n)}}}function Uh(){function e(e){e.canIntercept&&e.info===`react-transition`&&e.intercept({handler:function(){return new Promise(function(e){return i=e})},focusReset:`manual`,scroll:`manual`})}function t(){i!==null&&(i(),i=null),r||setTimeout(n,20)}function n(){if(!r&&!navigation.transition){var e=navigation.currentEntry;e&&e.url!=null&&navigation.navigate(e.url,{state:e.getState(),info:`react-transition`,history:`replace`})}}if(typeof navigation==`object`){var r=!1,i=null;return navigation.addEventListener(`navigate`,e),navigation.addEventListener(`navigatesuccess`,t),navigation.addEventListener(`navigateerror`,t),setTimeout(n,100),function(){r=!0,navigation.removeEventListener(`navigate`,e),navigation.removeEventListener(`navigatesuccess`,t),navigation.removeEventListener(`navigateerror`,t),i!==null&&(i(),i=null)}}}function Wh(e){this._internalRoot=e}Gh.prototype.render=Wh.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(s(409));var n=t.current;dh(n,jd(),e,t,null,null)},Gh.prototype.unmount=Wh.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;dh(e.current,2,null,e,null,null),zd(),t[Et]=null}};function Gh(e){this._internalRoot=e}Gh.prototype.unstable_scheduleHydration=function(e){if(e){var t=xt();e={blockedOn:null,target:e,priority:t};for(var n=0;n<Ah.length&&t!==0&&t<Ah[n].priority;n++);Ah.splice(n,0,e),n===0&&Fh(e)}};var Kh=r.version;if(Kh!==`19.3.1`)throw Error(s(527,Kh,`19.3.1`));j.findDOMNode=function(e){var t=e._reactInternals;if(t===void 0)throw typeof e.render==`function`?Error(s(188)):(e=Object.keys(e).join(`,`),Error(s(268,e)));return e=p(t),e=e===null?null:m(e),e=e===null?null:e.stateNode,e};var qh={bundleType:0,version:`19.3.1`,rendererPackageName:`react-dom`,currentDispatcherRef:A,reconcilerVersion:`19.3.1`};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<`u`){var Jh=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Jh.isDisabled&&Jh.supportsFiber)try{P=Jh.inject(qh),F=Jh}catch{}}e.createRoot=function(e,t){if(!c(e))throw Error(s(299));var n=!1,r=``,i=xc,a=Sc,o=Cc;return t!=null&&(!0===t.unstable_strictMode&&(n=!0),t.identifierPrefix!==void 0&&(r=t.identifierPrefix),t.onUncaughtError!==void 0&&(i=t.onUncaughtError),t.onCaughtError!==void 0&&(a=t.onCaughtError),t.onRecoverableError!==void 0&&(o=t.onRecoverableError)),t=lh(e,1,!1,null,null,n,r,null,i,a,o,Uh),e[Et]=t.current,Wf(e),new Wh(t)}})),c=e(((e,t)=>{function n(){if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<`u`&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE==`function`)try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(n)}catch(e){console.error(e)}}n(),t.exports=s()})),l=i(),u=c();function d(e){return e>=55296&&e<=56319}function f(e){return e>=56320&&e<=57343}function p(e,t){let n=Math.min(e.length,Math.max(0,Math.floor(t)));return n>0&&n<e.length&&d(e.charCodeAt(n-1))&&f(e.charCodeAt(n))&&--n,e.slice(0,n)}function m(e,t){return Math.max(0,Date.parse(t)-Date.parse(e))}function h(e){return e.replace(/\s+/g,` `).trim()}function g(e){if(e instanceof Error)return e.message;if(typeof e==`string`)return e;try{return JSON.stringify(e)??String(e)}catch{return String(e)}}function _(e,t){return e.length<=t?e:`${p(e,Math.max(0,t-1)).trimEnd()}…`}function v(e){if(!Number.isFinite(e)||e<0)return`0s`;let t=Math.floor(e/1e3);if(t<60)return`${t}s`;let n=Math.floor(t/60),r=t%60;return n<60?`${n}m ${String(r).padStart(2,`0`)}s`:`${Math.floor(n/60)}h ${String(n%60).padStart(2,`0`)}m`}function y(e){if(!Number.isFinite(e))return`0`;let t=Math.abs(e);return t>=1e6?`${(e/1e6).toFixed(t>=1e7?0:1)}M`:t>=1e3?`${(e/1e3).toFixed(t>=1e4?0:1)}k`:String(Math.round(e))}function b(e){return Number.isFinite(e)?e>0&&e<.01?`<$0.01`:`$${e.toFixed(e>=10?1:2)}`:`$0`}var x=o();function S(e){return[...new Set(e)]}function C(e){if(!e)return[];let t=e.parentSessionIds;return t&&t.length>0?S(t):e.parentSessionId?[e.parentSessionId]:[]}function w(e){let t=S(e),n=t[0];return n===void 0?{}:t.length>1?{parentSessionId:n,parentSessionIds:t}:{parentSessionId:n}}function T(e,t){let n=new Set(e),r=[...n],i=[];for(let e=0;e<r.length;e++)for(let a of t(r[e]))n.has(a)||(n.add(a),i.push(a),r.push(a));return i}function E(e,t,n){if(e===t)return!0;let r=new Set([t]),i=[t];for(let t=0;t<i.length;t++)for(let a of n(i[t])){if(a===e)return!0;r.has(a)||(r.add(a),i.push(a))}return!1}function D(e,t,n=()=>void 0){let r=new Set(e),i=new Map,a=new Map,o=new Map;for(let s of e){if(a.has(s))continue;let e=0,c=0;for(let i of S(t(s))){if(i===s)continue;if(r.has(i)){c+=1;let e=o.get(i);e?e.push(s):o.set(i,[s]);continue}let t=n(i);t!==void 0&&(e=Math.max(e,t+1))}a.set(s,c),i.set(s,e)}let s=[],c=[...a].filter(([,e])=>e===0).map(([e])=>e);for(let e=0;e<c.length;e++){let t=c[e];s.push(t);for(let e of o.get(t)??[]){i.set(e,Math.max(i.get(e),i.get(t)+1));let n=a.get(e)-1;a.set(e,n),n===0&&c.push(e)}}let l=new Set(s);return{depths:i,order:s,cyclic:[...a.keys()].filter(e=>!l.has(e))}}var O=`x-ensemble-token`,ee=`ensemble-token`,k={maxTaskChars:2e5,maxMessageChars:5e4,maxToolOutputChars:16e3,maxToolInputChars:8e3,maxEventsPerRead:500,maxConcurrentRuns:20,concurrentRunsSetting:{min:1,max:1e3},maxDelegationDepth:2,maxParents:8,contextSession:{maxRefs:10,maxResultChars:4e4,maxFiles:200,maxErrorChars:8e3,maxPromptChars:2e5},duplicateDelegationWindowMs:12e4,sseReplayBuffer:2e3,deltaCoalesceMs:60,idleExitMs:18e5,maxWaitMs:5e4,attention:{quietMs:24e4,longToolMs:6e5,longRunMs:36e5,undeliveredMs:12e4,sharedFileWindowMs:6e5},question:{timeoutMs:36e5,maxPrompts:8,maxTextChars:2e3,maxHeaderChars:120,maxOptions:20,maxLabelChars:200,maxDescriptionChars:400,maxAnswerChars:4e3,maxPicks:20},history:{warmMs:6e5,sweepMs:6e4,eventCacheEntries:8,eventCacheBytes:67108864},maxArchiveIds:2e3,maxReportChars:2e6,retention:{maxKeepDays:3650,maxKeepCount:1e4,sweepMs:36e5}},te={kind:`system`,label:`Ensemble`},ne=e=>`question:${e}`,re=_;function ie(e,t=160){let n=e[0];return n?re(n.text.replace(/\s+/g,` `).trim(),t):``}function ae(e,t){return t.runId?`${e}:${t.runId}:${t.data.itemId}`:`${e}:${t.data.itemId}`}function oe(e,t){let n=e.idx.items.get(t.id);n===void 0?(e.idx.items.set(t.id,e.timeline.length),e.timeline.push(t)):e.timeline[n]=t}function se(e,t){let n=e.idx.items.get(t);return n===void 0?void 0:e.timeline[n]}function ce(e,t){let n=Math.max(0,e.timeline.length-48);for(let r=e.timeline.length-1;r>=n;r--){let n=e.timeline[r];n&&(n.type===`assistant`||n.type===`reasoning`)&&n.streaming&&(e.timeline[r]={...n,streaming:!1,updatedAt:t})}}function le(e,t,n,r){oe(e,{...t,status:n,updatedAt:r.at,outcome:r}),e.openQuestions.delete(t.questionId)}function ue(e,t,n,r=()=>!0){if(e.openQuestions.size!==0)for(let i of[...e.openQuestions]){let a=se(e,ne(i));!a||a.status!==`open`?e.openQuestions.delete(i):r(a)&&le(e,a,`expired`,{at:t,by:te,reason:n})}}function de(e,t){if(!t)return;let n=e.idx.runs.get(t);return n===void 0?void 0:e.runs[n]}function fe(e,t){let n=e.idx.runs.get(t.id);n===void 0?(e.idx.runs.set(t.id,e.runs.length),e.runs.push(t)):e.runs[n]=t}function pe(e,t){let n=e.idx.messages.get(t);return n===void 0?void 0:e.messages[n]}function me(e,t){let n=e.idx.messages.get(t.id);n===void 0?(e.idx.messages.set(t.id,e.messages.length),e.messages.push(t)):e.messages[n]=t}function he(e,t){for(let n=e.timeline.length-1;n>=0;n--){let r=e.timeline[n];if(r&&r.type!==`message`&&r.type!==`diagnostic`)return r.type===`run`||t&&r.runId&&r.runId!==t?void 0:r}}function ge(e){if(e.activeRunId)return de(e,e.activeRunId);let t;for(let n=e.runs.length-1;n>=0;n--){let r=e.runs[n];if(r&&r.status!==`queued`){if(r.status===`cancelled`&&!r.startedAt)t??=r;else return r}}return t}function _e(e){let t=e.activeRunId;for(let n=e.timeline.length-1;n>=0;n--){let r=e.timeline[n];if(r){if(r.type===`run`&&r.phase===`started`)return;if(r.type===`tool`&&r.status===`running`&&(!t||r.runId===t))return r}}}function ve(e){switch(e.status){case`starting`:return{kind:`starting`,key:`starting`};case`queued`:return{kind:`queued`,key:`queued`};case`stopped`:return{kind:`stopped`,key:`stopped`};case`failed`:return{kind:`failed`,key:`failed`};case`lost`:return{kind:`lost`,key:`lost`};case`running`:{let t=e.activeRunId,n=_e(e);if(n)return{kind:`tool`,key:`tool:${n.callId}`,tool:{name:n.name,category:n.category,title:n.title},...t?{runId:t}:{}};let r=he(e,t);return r?.type===`reasoning`&&r.streaming?{kind:`thinking`,key:`thinking:${r.id}`,...t?{runId:t}:{}}:r?.type===`assistant`&&r.streaming?{kind:`writing`,key:`writing:${r.id}`,...t?{runId:t}:{}}:{kind:`working`,key:`working`,...t?{runId:t}:{}}}case`idle`:{let t=ge(e);return t?t.status===`completed`?{kind:`done`,key:`done:${t.id}`,runId:t.id}:t.status===`failed`?{kind:`failed`,key:`failed:${t.id}`,runId:t.id}:t.status===`cancelled`?{kind:`cancelled`,key:`cancelled:${t.id}`,runId:t.id}:{kind:`idle`,key:`idle`}:{kind:`ready`,key:`ready`}}}}function ye(e,t){let n=ve(e);if(e.activityKey===n.key)return;e.activityKey=n.key;let{key:r,...i}=n;e.activity={...i,since:t}}function be(e){switch(e.stage){case`recorded`:return 0;case`queued`:return e.queuedBy===`harness`?3:1;case`handed_off`:return 2;case`applied`:return 4;case`failed`:case`cancelled`:return 99}}function A(e){return e===`applied`||e===`failed`||e===`cancelled`}function j(e,t){return A(e.stage)||t.stage!==`failed`&&t.stage!==`cancelled`&&be(t)<=be(e)?e:{...t,history:[...e.history,t].slice(-12)}}function xe(e){return e.stage===`queued`?e.queuedBy===`harness`?`queued_harness`:`queued_ensemble`:e.stage}function Se(e,t){let n=t.data;ce(e,t.at);let r=n.name??`tool`,i=n.status??`running`,a={type:`tool`,id:`tool:${n.callId}`,...t.runId?{runId:t.runId}:{},at:t.at,updatedAt:t.at,callId:n.callId,name:r,category:n.category??`other`,title:n.title??r,status:i,startedAt:n.startedAt??t.at,...n.input?{input:n.input}:{},...n.output?{output:n.output}:{},...n.error?{error:n.error}:{},...n.exitCode===void 0?{}:{exitCode:n.exitCode},...n.mcp?{mcp:n.mcp}:{}};e.counters.tools+=1,i===`failed`&&(e.counters.failedTools+=1),i!==`running`&&(a.endedAt=n.endedAt??t.at,a.durationMs=m(a.startedAt,a.endedAt)),oe(e,a)}function Ce(e,t,n){let r=n.data,i={...t,updatedAt:n.at,...r.name?{name:r.name}:{},...r.category?{category:r.category}:{},...r.title?{title:r.title}:{},...r.status?{status:r.status}:{},...r.input?{input:r.input}:{},...r.output?{output:r.output}:{},...r.error?{error:r.error}:{},...r.exitCode===void 0?{}:{exitCode:r.exitCode},...r.mcp?{mcp:r.mcp}:{}};i.status!==`running`&&t.status===`running`&&(i.endedAt=r.endedAt??n.at,i.durationMs=m(i.startedAt,i.endedAt)),t.status!==`failed`&&i.status===`failed`&&(e.counters.failedTools+=1),oe(e,i)}function we(e,t){switch(t.kind){case`message.sent`:{let n=t.data.message;me(e,n),oe(e,{type:`message`,id:`message:${n.id}`,...n.runId?{runId:n.runId}:{},at:t.at,updatedAt:t.at,messageId:n.id});break}case`message.delivery`:{let n=pe(e,t.data.messageId);if(!n)break;let r=j(n.delivery,t.data.record);if(r!==n.delivery){let i=n.kind===`steer`&&t.runId!==void 0&&de(e,t.runId)?.messageId===n.id,a=i?t.runId:n.runId;me(e,{...n,delivery:r,runId:a});let o=se(e,`message:${n.id}`);o&&oe(e,{...o,runId:a,updatedAt:t.at});let s=de(e,t.runId);s&&!i&&n.kind===`steer`&&t.data.record.stage===`applied`&&fe(e,{...s,steerCount:s.steerCount+1})}break}case`assistant.delta`:{let n=ae(`assistant`,t),r=se(e,n);r?oe(e,{...r,text:r.text+t.data.text,streaming:!0,updatedAt:t.at,...t.data.phase?{phase:t.data.phase}:{}}):(ce(e,t.at),oe(e,{type:`assistant`,id:n,...t.runId?{runId:t.runId}:{},at:t.at,updatedAt:t.at,text:t.data.text,streaming:!0,...t.data.phase?{phase:t.data.phase}:{}}));break}case`assistant.completed`:{let n=ae(`assistant`,t),r=se(e,n),i=t.data.phase??r?.phase;r?oe(e,{...r,text:t.data.text??r.text,streaming:!1,updatedAt:t.at,...i?{phase:i}:{}}):t.data.text&&(ce(e,t.at),oe(e,{type:`assistant`,id:n,...t.runId?{runId:t.runId}:{},at:t.at,updatedAt:t.at,text:t.data.text,streaming:!1,...i?{phase:i}:{}}));break}case`reasoning.delta`:{let n=ae(`reasoning`,t),r=se(e,n);r?oe(e,{...r,text:r.text+t.data.text,streaming:!0,updatedAt:t.at}):(ce(e,t.at),oe(e,{type:`reasoning`,id:n,...t.runId?{runId:t.runId}:{},at:t.at,updatedAt:t.at,text:t.data.text,streaming:!0}));break}case`reasoning.completed`:{let n=se(e,ae(`reasoning`,t));n&&oe(e,{...n,streaming:!1,updatedAt:t.at,...t.data.durationMs===void 0?{}:{durationMs:t.data.durationMs}});break}case`tool.updated`:{let n=se(e,`tool:${t.data.callId}`);n?Ce(e,n,t):Se(e,t);break}case`file.changed`:{for(let n of t.data.files)e.files.add(n.path);let n=t.data.callId;if(n){let r=se(e,`tool:${n}`);if(r){let n=new Map((r.files??[]).map(e=>[e.path,e]));for(let e of t.data.files)n.set(e.path,e);oe(e,{...r,files:[...n.values()],updatedAt:t.at})}}break}case`plan.updated`:{let n=t.runId??e.activeRunId;if(!n)break;e.plan={runId:n,entries:t.data.entries},oe(e,{type:`plan`,id:`plan:${n}`,runId:n,at:se(e,`plan:${n}`)?.at??t.at,updatedAt:t.at,entries:t.data.entries,...t.data.explanation?{explanation:t.data.explanation}:{}});break}case`usage.updated`:{let n=t.runId??e.activeRunId;n&&(e.usageByRun[n]={...e.usageByRun[n],...t.data.usage});break}case`diagnostic`:oe(e,{type:`diagnostic`,id:`diagnostic:${t.id}`,...t.runId?{runId:t.runId}:{},at:t.at,updatedAt:t.at,level:t.data.level,code:t.data.code,message:t.data.message});break;case`question.asked`:{let{question:n}=t.data,r=ne(n.id);if(se(e,r))break;ce(e,t.at),oe(e,{type:`question`,id:r,...t.runId?{runId:t.runId}:{},at:t.at,updatedAt:t.at,questionId:n.id,prompts:n.prompts,status:`open`}),e.openQuestions.add(n.id);break}case`question.resolved`:{let n=t.data,r=se(e,ne(n.questionId));if(!r||r.status!==`open`)break;le(e,r,n.outcome,{at:t.at,by:n.by,...n.answers?{answers:n.answers}:{},...n.note?{note:n.note}:{},...n.reason?{reason:n.reason}:{},...n.delivery?{delivery:n.delivery}:{}});break}case`notice.created`:break;case`notice.delivered`:for(let n of t.data.messageIds){let r=pe(e,n);r&&me(e,{...r,sync:{toOrigin:`delivered`,at:t.data.at}})}}}var Te=new Set([`completed`,`failed`,`cancelled`]);function M(e,t,n,r){let i=de(e,t.runId);if(!i||Te.has(i.status))return;let a={...i,...r,status:n,endedAt:t.at};fe(e,a);for(let n=0;n<e.timeline.length;n++){let r=e.timeline[n];r&&r.runId===i.id&&((r.type===`assistant`||r.type===`reasoning`)&&r.streaming?e.timeline[n]={...r,streaming:!1,updatedAt:t.at}:r.type===`tool`&&r.status===`running`&&(e.timeline[n]={...r,status:`unfinished`,updatedAt:t.at}))}ue(e,t.at,n===`cancelled`?`cancelled`:`run_ended`,e=>!e.runId||e.runId===i.id);let o=i.startedAt?m(i.startedAt,t.at):void 0;oe(e,{type:`run`,id:`run:${i.id}:${n}`,runId:i.id,at:t.at,updatedAt:t.at,runIndex:i.index,phase:n,...o===void 0?{}:{durationMs:o},...a.stopReason?{stopReason:a.stopReason}:{}}),e.activeRunId===i.id&&(e.activeRunId=void 0),e.activeRunId||e.status!==`running`&&e.status!==`starting`&&e.status!==`queued`||(e.status=e.runs.some(e=>e.status===`queued`)?`queued`:`idle`,delete e.statusReason,e.endedAt=t.at,n===`failed`&&r.error&&(e.lastError=r.error))}function Ee(e,t){switch(t.kind){case`session.updated`:{let n=t.data.patch;e.meta={...e.meta,...n.title===void 0?{}:{title:n.title},...n.model===void 0?{}:{model:{...e.meta.model,...n.model}},...n.effort===void 0?{}:{effort:n.effort},...n.nativeRef===void 0?{}:{nativeRef:n.nativeRef},...n.capabilities===void 0?{}:{capabilities:n.capabilities},...n.accessEnforcement===void 0?{}:{accessEnforcement:n.accessEnforcement}};break}case`session.status`:e.status=t.data.status,t.data.reason===void 0?delete e.statusReason:e.statusReason=t.data.reason,t.data.error&&(e.lastError=t.data.error),(t.data.status===`stopped`||t.data.status===`failed`||t.data.status===`lost`)&&ue(e,t.at,t.data.status===`lost`?`restarted`:`session_closed`);break;case`run.queued`:{fe(e,t.data.run);let n=pe(e,t.data.run.messageId);n&&!n.runId&&me(e,{...n,runId:t.data.run.id}),e.status===`idle`&&(e.status=`queued`);break}case`run.starting`:{let n=de(e,t.runId);if(n?.status!==`queued`||e.activeRunId)break;fe(e,{...n,status:`starting`}),e.activeRunId=n.id,e.status=`starting`,e.endedAt=void 0,t.data.resuming?e.statusReason=`resuming`:delete e.statusReason;break}case`run.started`:{let n=de(e,t.runId);if(!n||n.status!==`queued`&&n.status!==`starting`||e.activeRunId&&e.activeRunId!==n.id||e.status===`stopped`)break;fe(e,{...n,status:`running`,startedAt:t.at,...t.data.nativeTurnId?{nativeTurnId:t.data.nativeTurnId}:{}}),e.activeRunId=n.id,e.status=`running`,delete e.statusReason,e.startedAt??=t.at,e.endedAt=void 0,oe(e,{type:`run`,id:`run:${n.id}:started`,runId:n.id,at:t.at,updatedAt:t.at,runIndex:n.index,phase:`started`});break}case`run.completed`:M(e,t,`completed`,t.data.stopReason?{stopReason:t.data.stopReason}:{});break;case`run.failed`:M(e,t,`failed`,{error:t.data.error});break;case`run.cancelled`:M(e,t,`cancelled`,{})}}function De(e){let t=e.access;return t===`read_only`||t===`full`?e:{...e,access:`full`}}function Oe(e){return{meta:De(e.data.meta),status:`starting`,runs:[],messages:[],timeline:[],activity:{kind:`starting`,since:e.at},activityKey:`starting`,usageByRun:{},plan:void 0,activeRunId:void 0,lastError:void 0,startedAt:void 0,endedAt:void 0,updatedAt:e.at,seq:e.seq,files:new Set,counters:{tools:0,failedTools:0},openQuestions:new Set,idx:{items:new Map,messages:new Map,runs:new Map}}}function ke(e){let t=e[0];if(!t||t.kind!==`session.created`)return;let n=Oe(t);for(let t=1;t<e.length;t++){let r=e[t];r&&Ae(n,r)}return n}function Ae(e,t){if(t.kind===`session.created`||t.seq<=e.seq)return!1;if(e.seq=t.seq,t.kind===`session.relinked`){let{parentSessionId:n,parentSessionIds:r,depth:i}=t.data,{parentSessionId:a,parentSessionIds:o,...s}=e.meta,c=r&&r.length>1?r:n?[n]:[];return e.meta={...s,depth:i,...w(c)},!0}switch(e.updatedAt=t.at,t.kind){case`session.updated`:case`session.status`:case`run.queued`:case`run.starting`:case`run.started`:case`run.completed`:case`run.failed`:case`run.cancelled`:Ee(e,t);break;case`message.sent`:case`message.delivery`:case`assistant.delta`:case`assistant.completed`:case`reasoning.delta`:case`reasoning.completed`:case`tool.updated`:case`file.changed`:case`plan.updated`:case`usage.updated`:case`diagnostic`:case`question.asked`:case`question.resolved`:case`notice.created`:case`notice.delivered`:we(e,t)}return ye(e,t.at),!0}function je(){return document.querySelector(`meta[name="${ee}"]`)?.getAttribute(`content`)||(new URLSearchParams(location.search).get(`token`)??``)}var Me=je(),Ne=class extends Error{code;status;details;constructor(e,t,n,r){super(t),this.code=e,this.status=n,this.details=r,this.name=`ApiError`}};async function Pe(e,t,n,r){let i;try{i=await fetch(t,{method:e,headers:{[O]:Me,...n===void 0?{}:{"content-type":`application/json`}},...n===void 0?{}:{body:JSON.stringify(n)},...r?{signal:r}:{}})}catch(e){throw e instanceof DOMException&&e.name===`AbortError`?e:new Ne(`network`,`Cannot reach the Ensemble service`,0)}let a=await i.text(),o={};if(a)try{o=JSON.parse(a)}catch{o={}}if(!i.ok){let e=o.error;throw new Ne(e?.code??`http_error`,e?.message??`HTTP ${i.status}`,i.status,e?.details)}return o}function Fe(e,t){let n={};try{n=e?JSON.parse(e):{}}catch{n={}}let r=n.error;return new Ne(r?.code??`http_error`,r?.message??`HTTP ${t}`,t)}async function Ie(e,t){let n;try{n=await fetch(e,{method:`GET`,headers:{[O]:Me},...t?{signal:t}:{}})}catch(e){throw e instanceof DOMException&&e.name===`AbortError`?e:new Ne(`network`,`Cannot reach the Ensemble service`,0)}let r=await n.text();if(!n.ok)throw Fe(r,n.status);return{text:r,disposition:n.headers?.get(`content-disposition`)??null}}function Le(e){if(!e)return;let t,n=/filename\*\s*=\s*([^;]+)/i.exec(e)?.[1]?.trim();if(n){let e=/^[\w-]+'[^']*'(.*)$/.exec(n);try{t=decodeURIComponent(e?.[1]??n)}catch{t=void 0}}if(!t){let n=/filename\s*=\s*"((?:[^"\\]|\\.)*)"/i.exec(e)?.[1];t=n===void 0?/filename\s*=\s*([^;"]+)/i.exec(e)?.[1]?.trim():n.replace(/\\(.)/g,`$1`)}return t?.replace(/[\\/:*?"<>|\u0000-\u001f]/g,`_`).replace(/^\.+/,``).trim().slice(0,150)||void 0}function Re(e,t){let n=e.replace(/[^\w-]/g,`_`).slice(0,16);return`ensemble-${t.scope}-${n}.md`}var ze=encodeURIComponent,N={state:e=>Pe(`GET`,`/api/state`,void 0,e),harnesses:(e=!1)=>Pe(`GET`,`/api/harnesses${e?`?refresh=1`:``}`),setAllowedModels:(e,t,n,r)=>Pe(`PUT`,`/api/harnesses/${ze(e)}/models`,{allowed:t,...n?{efforts:n}:{},...r===void 0?{}:{userDefaultModel:r}}),setConcurrency:e=>Pe(`PUT`,`/api/settings/concurrency`,{max:e}),putProfile:(e,t)=>Pe(`PUT`,`/api/profiles/${ze(e)}`,t),removeProfile:e=>Pe(`DELETE`,`/api/profiles/${ze(e)}`),renameProfile:(e,t)=>Pe(`POST`,`/api/profiles/${ze(e)}/rename`,{to:t}),session:(e,t)=>Pe(`GET`,`/api/sessions/${ze(e)}`,void 0,t),git:(e,t)=>Pe(`GET`,`/api/git?path=${ze(e)}`,void 0,t),events:(e,t)=>Pe(`GET`,`/api/sessions/${ze(e)}/events?after=${t}`),send:(e,t)=>Pe(`POST`,`/api/sessions/${ze(e)}/messages`,t),answerQuestion:(e,t,n)=>Pe(`POST`,`/api/sessions/${ze(e)}/questions/${ze(t)}/answer`,n),declineQuestion:(e,t,n={})=>Pe(`POST`,`/api/sessions/${ze(e)}/questions/${ze(t)}/decline`,n),cancel:e=>Pe(`POST`,`/api/sessions/${ze(e)}/cancel`,{}),stop:e=>Pe(`POST`,`/api/sessions/${ze(e)}/stop`,{}),remove:e=>Pe(`DELETE`,`/api/sessions/${ze(e)}`),sessions:(e={},t)=>Pe(`GET`,`/api/sessions${e.archived?`?archived=${e.archived}`:``}`,void 0,t),archive:e=>Pe(`POST`,`/api/sessions/archive`,{ids:e}),unarchive:(e,t={})=>Pe(`POST`,`/api/sessions/unarchive`,{ids:e,...t.exact?{exact:!0}:{}}),retention:e=>Pe(`GET`,`/api/retention`,void 0,e),setRetention:e=>Pe(`PUT`,`/api/retention`,e),report:async(e,t,n)=>{let r=new URLSearchParams({scope:t.scope,detail:t.detail,lang:t.lang}),{text:i,disposition:a}=await Ie(`/api/sessions/${ze(e)}/report?${r.toString()}`,n);return{text:i,filename:Le(a)??Re(e,t)}}};function Be(){return`/api/stream?token=${encodeURIComponent(Me)}`}function Ve(e,t){return e.sessions[t]??e.archived[t]}var He=new Set;function Ue(){let e=new Set;return He.add(e),{touched:e,stop:()=>{He.delete(e)}}}var We;function Ge(){We?.stop(),We=Ue()}function Ke(){let e=We?.touched??new Set;return We?.stop(),We=void 0,e}function qe(e){for(let t of He)t.add(e)}function Je(e,t){let{[t]:n,...r}=e;return r}function Ye(e,t,n){return e.archivedLoaded?Object.keys(t).length:e.archivedCount===void 0?void 0:Math.max(0,e.archivedCount+n)}function Xe(e,t){let{id:n}=t,r=e.sessions[n],i=e.archived[n],a=r??i;if(a&&a.seq>t.seq)return{};if(qe(n),t.archivedAt!==void 0){let i={...e.archived,[n]:t};return r?{sessions:Je(e.sessions,n),archived:i,archivedCount:Ye(e,i,1)}:{archived:i,archivedCount:Ye(e,i,0)}}if(r)return{sessions:{...e.sessions,[n]:t}};let o={...e.sessions,[n]:t};if(i){let t=Je(e.archived,n);return{sessions:o,archived:t,archivedCount:Ye(e,t,-1)}}return!e.archivedLoaded&&e.snapshotAt!==void 0&&t.createdAt<e.snapshotAt?{sessions:o,archivedCount:Ye(e,e.archived,-1)}:{sessions:o}}function Ze(e,t){if(e.sessions[t])return qe(t),{sessions:Je(e.sessions,t)};if(e.archived[t]){qe(t);let n=Je(e.archived,t);return{archived:n,archivedCount:Ye(e,n,-1)}}return qe(t),{}}function Qe(e,t){let n=Object.fromEntries(t.sessions.map(e=>[e.id,e]));for(let e of Object.keys(n))qe(e);return t.archivedCount===void 0?{sessions:n,archived:{},archivedCount:void 0,retention:void 0,snapshotAt:t.serverTime}:{sessions:n,archived:Object.fromEntries(Object.entries(e.archived).filter(([e])=>!(e in n))),archivedCount:t.archivedCount,retention:t.retention,snapshotAt:t.serverTime}}function $e(e,t,n){let r={};for(let i of t){if(n.has(i.id)||e.sessions[i.id])continue;let t=e.archived[i.id];r[i.id]=t&&t.seq>i.seq?t:i}for(let t of n){let n=e.archived[t];n&&(r[t]=n)}return{archived:r,archivedLoaded:!0,archivedCount:Object.keys(r).length}}var P=(e,t,n)=>Number(e)===1?t:n,F=e=>Number(e.n),et={zh:{"boot.connecting":`正在连接 Ensemble 服务…`,"boot.offlineTitle":`连不上 Ensemble 服务`,"boot.offlineBody":`服务可能已经退出,或者访问令牌已失效。让主 Agent 再调用一次 Ensemble,或刷新页面。`,"boot.reload":`刷新页面`,"common.cancel":`取消`,"common.close":`关闭`,"common.collapse":`收起`,"common.expand":`展开`,"common.copied":`已复制`,"common.copyFailed":`复制失败,请手动选择文本`,"common.copyId":`复制 ID`,"common.copyPath":`复制路径`,"common.dismiss":`忽略`,"common.none":`无`,"common.retry":`重试`,"time.justNow":`刚刚`,"time.seconds":`{n} 秒前`,"time.minutes":`{n} 分钟前`,"time.hours":`{n} 小时前`,"time.days":`{n} 天前`,"phase.ready":`待命`,"phase.starting":`连接中`,"phase.queued":`排队中`,"phase.running":`运行中`,"phase.done":`已完成`,"phase.failed":`失败`,"phase.cancelled":`已中断`,"phase.stopped":`已关闭`,"phase.lost":`已失联`,"activity.starting":`正在连接执行端`,"activity.queued":`等待并发名额`,"activity.ready":`待命`,"activity.working":`执行中`,"activity.thinking":`思考中`,"activity.writing":`撰写回复`,"activity.tool":`执行工具`,"activity.idle":`空闲`,"activity.done":`已完成`,"activity.failed":`运行失败`,"activity.cancelled":`已中断`,"activity.stopped":`会话已关闭`,"activity.lost":`与执行端失去联系`,"act.read":`读取`,"act.write":`写入`,"act.search":`搜索`,"act.shell":`运行`,"act.web":`访问`,"act.mcp":`调用`,"act.task":`委派`,"act.plan":`规划`,"act.other":`执行`,"harness.cursor":`Cursor`,"harness.codex":`Codex`,"harness.pi":`Pi`,"harness.claude":`Claude Code`,"harness.opencode":`OpenCode`,"harness.dsh":`DSH`,"harness.fixture":`模拟执行端`,"harness.status.ready":`可用`,"harness.status.needs_setup":`需要设置`,"harness.status.unavailable":`不可用`,"harness.status.checking":`检测中`,"harness.refresh":`重新探测`,"harness.refreshed":`已重新探测`,"harness.refreshFailed":`重新探测失败`,"harness.none":`还没有执行端信息。`,"harness.checkedAt":`{time}检测`,"harness.copyCommand":`复制命令`,"harness.modelsIntro":`只有勾选的模型,主 Agent 才能选用。点已勾选模型最右边的方框,可指定默认模型。更改自动保存,所有宿主共用。`,"harness.modelsAllowed":`允许主 Agent 选用的模型`,"harness.noModels":`没有读取到模型列表。`,"harness.default":`默认`,"harness.allowAll":`全部开放`,"harness.allowAllTip":`允许所有模型,包括以后新增的模型`,"harness.selectAll":`全选`,"harness.selectNone":`全不选`,"harness.modelFilter":`筛选模型`,"harness.modelNoMatch":`没有匹配的模型`,"harness.noneAllowed":`没有勾选任何模型:主 Agent 无法向它委派。`,"harness.defaultSwapped":`默认模型没有勾选;主 Agent 不指定模型时会用「{name}」。`,"harness.defaultPick":`设为默认模型:{name}`,"harness.defaultPickTip":`设为默认模型`,"harness.defaultPicked":`你指定的默认模型`,"harness.defaultOwn":`执行端默认`,"harness.defaultOwnTip":`执行端自己的默认模型。你指定了另一个,现在以你指定的为准。`,"harness.defaultUnnamed":`执行端自己的默认`,"harness.defaultUser":`默认模型由你指定:主 Agent 不指定模型时用「{name}」。`,"harness.defaultRestore":`恢复执行端的默认`,"harness.defaultDropped":`「{dropped}」已取消勾选,不再是你指定的默认模型;主 Agent 不指定模型时现在用「{name}」。`,"harness.defaultDroppedNone":`「{dropped}」已取消勾选,不再是你指定的默认模型。`,"harness.defaultStale.missing":`你指定的默认模型「{stale}」已不可用:执行端不再提供它。主 Agent 不指定模型时现在用「{name}」。`,"harness.defaultStale.not_allowed":`你指定的默认模型「{stale}」没有被开放,所以没有生效。主 Agent 不指定模型时现在用「{name}」。`,"harness.effortShort":`强度`,"harness.effortsToggle":`{name}:推理强度,已允许 {n} / {total}`,"harness.effortsGroup":`{name} 允许主 Agent 选用的推理强度`,"harness.effortLast":`至少保留一档`,"harness.effortUnlimited":`取消档位限制`,"harness.effortsNeeded":`已勾选的模型都还没有可用的推理强度:展开后至少勾选一档。`,"harness.modelsSaveFailed":`没能保存模型设置`,"harness.modelSettings.invalid_entry":`模型名单无效,请重新勾选要开放的模型。`,"harness.modelSettings.unreadable_file":`无法读取模型设置。恢复 settings.json 后重启 Ensemble。`,"harness.access":`访问权限与约束`,"harness.accessUnsupported":`不支持`,"harness.allowedSummary":`已开放 {n} / {total} 个模型`,"model.default":`默认模型`,"effort.minimal":`极低`,"effort.low":`低`,"effort.medium":`中`,"effort.high":`高`,"effort.xhigh":`极高`,"run.simulated":`模拟执行`,"run.simulatedTip":`这是演示/开发用的模拟执行端,页面上的步骤由脚本生成,并非真实 Harness 的运行记录。`,"access.read_only":`只读`,"access.full":`完全访问`,"enforce.enforced":`已强制`,"enforce.advisory":`仅提示词约束`,"enforce.none":`无约束`,"enforce.tip.enforced":`由执行端自身的沙箱或权限机制强制执行。`,"enforce.tip.advisory":`只在提示词里要求执行端遵守,执行端本身并不强制,不能当作安全边界。`,"enforce.tip.none":`这个级别没有任何约束。`,"verify.live":`已实测`,"verify.declared":`仅文档声明`,"verify.none":`未验证`,"verify.tip.live":`已在这台机器上用真实执行端验证过。`,"verify.tip.declared":`根据文档或源码声明,尚未在这台机器上验证。`,"verify.tip.none":`没有验证过。`,"capMode.immediate":`立即交付`,"capMode.turn_boundary":`回合结束处理`,"capMode.immediate_or_follow_up":`中途或运行后`,"capMode.none":`无`,"capMode.queued_by_harness":`由执行端排队`,"capMode.after_run":`运行结束后`,"native.cursor-agent":`Cursor Agent`,"native.codex-thread":`Codex 线程`,"native.pi-session":`Pi 会话`,"native.claude-session":`Claude Code 会话`,"native.opencode-session":`OpenCode 会话`,"native.dsh-session":`DSH 会话`,"topbar.settings":`设置`,"settings.title":`设置`,"settings.sections":`设置分区`,"settings.section.executors":`执行端`,"settings.section.profiles":`角色`,"settings.section.general":`通用`,"settings.section.history":`历史`,"settings.executors.summary":`{ready}/{total} 可用`,"settings.profiles.summary":`{ready}/{total} 可用`,"settings.profiles.legacy":`不可用`,"settings.language":`语言 / Language`,"settings.languageNote":`只保存在这个浏览器里,选中即生效。`,"profiles.intro":`给一组常用配置起个名字,主 Agent 委派时按名字选用。留空的项按默认走:模型用你在「{section}」里指定的默认,推理强度用该模型的默认,访问权限为完全访问。更改自动保存,所有宿主共用。`,"profiles.empty":`还没有角色。添加一个,主 Agent 就能按名字选用它。`,"profiles.unavailable":`无法读取 settings.json,角色暂时不可用。恢复文件后重启 Ensemble。`,"profiles.unsupported":`当前连接的 Ensemble 服务版本较旧,不支持委派角色,所以这里没法添加或修改。更新并重启服务后再来。`,"profiles.add":`添加角色`,"profiles.limit":`最多 {max} 个角色。`,"profiles.col.name":`名称`,"profiles.name":`角色名称`,"profiles.namePlaceholder":`例如 verify`,"profiles.newRole":`新角色`,"profiles.fieldFor":`{field}({name})`,"profiles.pickHarness":`选择执行端`,"profiles.unknown":`未知`,"profiles.delete":`删除角色 {name}`,"profiles.discard":`放弃这个新角色`,"profiles.deleteTitle":`删除角色「{name}」?`,"profiles.deleteBody":`之后主 Agent 再用这个名称委派会被拒绝。已经派出的会话不受影响。`,"profiles.deleteConfirm":`删除`,"profiles.draftHint":`填好名称并选好执行端后自动保存。`,"profiles.saveFailed":`没能保存角色`,"profiles.removeFailed":`没能删除角色`,"profiles.name.empty":`名称不能为空。`,"profiles.name.too_long":`名称最多 {max} 个字符。`,"profiles.name.bad_characters":`名称只能用小写字母、数字、- 和 _,并以字母或数字开头。`,"profiles.name.digits_only":`名称不能全是数字:至少要有一个字母、- 或 _。`,"profiles.name.duplicate":`已经有一个叫「{name}」的角色。`,"profiles.issue.invalid_entry":`settings.json 里这个角色的内容读不出来。重新选一个执行端,或删除这个角色。`,"profiles.issue.invalid_name":`settings.json 里这个角色的名称不合规,主 Agent 引用不到它。改个名称即可。`,"profiles.issue.unknown_harness":`这一版 Ensemble 不认识执行端「{harness}」。换一个执行端,或删除这个角色。`,"profiles.issue.harness_not_ready":`{harness}:{status}。这个角色暂时不能用。`,"profiles.issue.access_unsupported":`{harness} 无法落实访问权限「{access}」。改一下访问权限,或换一个执行端。`,"profiles.issue.settings_unavailable":`模型设置不可用,没法确认 {harness} 开放了哪些模型。见「{section}」。`,"profiles.issue.no_models_open":`{harness} 没有开放任何模型。到「{section}」里勾选,或换一个执行端。`,"profiles.issue.model_not_open":`模型「{model}」在 {harness} 上没有开放。`,"profiles.issue.model_unverified":`{harness} 限制了推理强度,却没法确定它默认用哪个模型。请为这个角色指定模型。`,"profiles.issue.model_unknown":`「{model}」不是 {harness} 报告的模型,而它的推理强度受限,没法确认能不能用。`,"profiles.issue.effort_not_open":`推理强度「{effort}」在模型「{model}」上不被允许。`,"profiles.issue.effort_none":`模型「{model}」没有可用的推理强度。`,"settings.concurrency":`并发上限`,"settings.concurrencyNote":`同时运行的会话数上限,所有宿主和浏览器共用,改动立即生效。超出的会话排队等候;调低不会中断正在运行的会话。`,"settings.concurrencyLimited":`限制`,"settings.concurrencyUnlimited":`不限制`,"settings.concurrencyValue":`最多同时运行的会话数`,"settings.concurrencyDecrease":`减少`,"settings.concurrencyIncrease":`增加`,"settings.concurrencyRestore":`恢复默认({value})`,"settings.concurrencySource.settings":`已在这里指定`,"settings.concurrencySource.env":`未指定,沿用环境变量 ENSEMBLE_MAX_CONCURRENT_RUNS:{value}`,"settings.concurrencySource.default":`未指定,沿用默认:{value}`,"settings.concurrencySource.startup":`由启动服务的程序固定,这里不能修改`,"settings.concurrencyInUse":`占用 {occupied} · 等待 {waiting}`,"settings.concurrencyOver":`占用已超过上限:正在运行的会话不受影响,名额随它们结束逐渐收回。`,"settings.concurrencyIssueInvalid":`文件里的值无效,现在用的是 {value}。在这里重新设置后才会覆盖它。`,"settings.concurrencyIssueUnreadable":`无法读取 settings.json,暂时不能在这里修改;现在用的是 {value}。恢复文件后重启 Ensemble。`,"settings.concurrencyDraftInvalid":`请输入 {min}–{max} 的整数;现在仍是 {current}。`,"settings.concurrencySaveFailed":`没能保存并发上限`,"conn.connecting":`连接中`,"conn.live":`已连接`,"conn.reconnecting":`重新连接中…`,"conn.offline":`连接已断开,重试中`,"scene.zoomIn":`放大`,"scene.zoomOut":`缩小`,"scene.fit":`适应画布(0)`,"scene.sr":`画布上有 {n} 个会话`,"scene.srHidden":`画布上显示 {n} 个会话,另有 {hidden} 个未在工作的已隐藏`,"scene.srHiddenAny":`画布上显示 {n} 个会话,另有 {hidden} 个已隐藏`,"dock.zoom":`画布缩放`,"dock.hideIdle":`隐藏未在工作的会话`,"dock.hideIdleTip":`隐藏未在工作的会话(可收起 {n} 个)`,"dock.hideIdleNone":`隐藏未在工作的会话
10
- 目前没有可收起的`,"dock.showAllTip":`显示全部会话(已隐藏 {n} 个)`,"dock.showAllNone":`显示全部会话
11
- 目前没有被隐藏的会话`,"dock.hideIdleReady":`待命的会话算工作中,不会被收起。`,"dock.hideIdleKept":`有工作中子会话的上级会保留,连线仍是真实父子关系。`,"scene.nodeLabel":`会话:{title}`,"scene.nodeKeyboard":`方向键移动节点,按住 Shift 加速;Shift 加空格选择节点,Enter 打开会话;Shift+F10 或菜单键打开操作菜单。`,"scene.originLabel":`来源:{title}`,"scene.originLabelCollapsed":`来源:{title}(相关节点已隐藏)`,"scene.originKeyboard":`方向键移动来源节点,按住 Shift 加速;Shift 加空格选择节点;Shift+F10 或菜单键打开菜单,可隐藏或显示它的相关节点。`,"scene.selected":`已选择 {n} 个节点`,"scene.resetLayout":`重置节点布局`,"scene.resetLayoutTip":`重新排列全部节点(同时清除手动位置):尽量保持当前缩放,放不下才缩小`,"edgeHint.top":`视口上方`,"edgeHint.right":`视口右侧`,"edgeHint.bottom":`视口下方`,"edgeHint.left":`视口左侧`,"edgeHint.one":`{dir}有新会话:{title}`,"edgeHint.many":`{dir}有 {n} 个新会话,最近的:{title}`,"edgeHint.goOne":`点击平移到那里`,"edgeHint.goNearest":`点击平移到最近的一个`,"edgeHint.more":`另有 {n} 个`,"arrange.label":`对齐与分布`,"arrange.count":`项已选`,"arrange.left":`左对齐`,"arrange.hcenter":`水平居中`,"arrange.right":`右对齐`,"arrange.top":`顶对齐`,"arrange.vmiddle":`垂直居中`,"arrange.bottom":`底对齐`,"arrange.distributeH":`水平等距分布`,"arrange.distributeV":`垂直等距分布`,"arrange.needThree":`{label}(至少选 3 个)`,"arrange.undo":`撤销({keys})`,"arrange.redo":`重做({keys})`,"arrange.clear":`取消选择(Esc)`,"arrange.done":`{action}:{n} 个节点`,"arrange.unchanged":`{action}:位置没有变化`,"empty.title":`还没有被委派出去的会话`,"empty.sub":`委派由主 Agent 通过 Ensemble 的 MCP 工具发起,派出的会话会显示在这里。`,"idle.title":`现在没有正在工作的会话`,"idle.sub":`{n} 个会话已收起`,"idle.showAll":`显示全部会话`,"node.menu":`会话操作`,"node.modelTip":`模型:{model}
12
- 推理强度:{effort}`,"node.pending":`{n} 条消息在途`,"node.pendingTip":`有消息还没有被执行端确认生效,打开会话查看投递状态。`,"node.interventionsTip":`你对这个会话的介入次数`,"node.runs":`运行 {n} 次`,"attention.title":`值得留意`,"attention.quiet":`已 {d} 没有收到任何事件,也没有进行中的工具调用`,"attention.longTool":`已 {d} 没有收到任何事件;进行中的步骤:{tool}(开始于 {started} 前)`,"attention.longRun":`这次运行已持续 {d}`,"attention.sharedFile":`{file} 也被另 {n} 个运行中的会话写过(最近一次在 {d} 前)`,"attention.undelivered":`{kind}消息已等待 {d}:{state}`,"attention.question":`提问待回答:“{q}”(已等待 {d})`,"origin.user":`你(控制台)`,"origin.console":`从网页控制台发起`,"origin.dispatchedBy":`由 {host} 派发`,"origin.noRefTip":`宿主没有提供会话标识,这里不做猜测。`,"origin.tipHead":`发起端:{host}`,"origin.workspace":`工作区`,"origin.started":`首次委派`,"origin.titleTip":`{host} 里这段对话的标题`,"origin.head":`Main Agent`,"origin.count":`{n} 个会话`,"origin.countRunning":`{n} 个会话 · {running} 个运行中`,"origin.menu":`Main Agent 操作`,"origin.menuHide":`隐藏相关节点({n} 个会话)`,"origin.menuShow":`显示相关节点({n} 个会话)`,"origin.menuShowAll":`全部显示({n} 个 Main Agent 的相关节点已隐藏)`,"origin.doneHide":`已隐藏这个 Main Agent 的相关节点({n} 个会话)`,"origin.doneShow":`已显示这个 Main Agent 的相关节点({n} 个会话)`,"origin.doneShowAll":`已显示全部 {n} 个 Main Agent 的相关节点`,"origin.expand":`显示相关节点`,"origin.collapsedTip":`相关节点已隐藏 · {n} 个会话
13
- 点击或右键显示`,"origin.collapsedTipRunning":`相关节点已隐藏 · {n} 个会话 · {running} 个运行中
14
- 点击或右键显示`,"origin.refLabel.session":`会话`,"origin.refLabel.thread":`线程`,"origin.refLabel.conversation":`对话`,"origin.refDeclared":`由 Agent 自报`,"origin.refDeclaredTip":`宿主没有交出会话标识;这个标识是 Agent 通过 conversationId 参数自己报的,Ensemble 无法核对。`,"origin.workspaceUnknown":`未知`,"origin.workspaceUnknownTip":`未知(宿主没有报告工作区,委派时也没有传 cwd)`,"origin.workspaceNote":`{path}({from})`,"origin.workspaceFrom.mcp-roots":`宿主报告`,"origin.workspaceFrom.delegate-cwd":`委派时传入的 cwd`,"origin.workspaceFrom.host-record":`宿主的对话记录`,"git.head":`Git`,"git.label":`Git 仓库:{name}`,"git.keyboard":`方向键移动 Git 节点,按住 Shift 加速;Shift 加空格选择节点。`,"git.detached":`游离 HEAD`,"git.noCommits":`还没有提交`,"git.clean":`工作区干净`,"git.dirty":`{n} 个文件有改动`,"git.conflicts":`{n} 个冲突`,"git.ahead":`领先 {n} 个提交`,"git.behind":`落后 {n} 个提交`,"git.inSync":`与上游一致`,"git.tipHead":`Git 仓库`,"git.root":`目录`,"git.branch":`分支`,"git.upstream":`上游`,"git.commit":`最近提交`,"git.changes":`改动`,"git.remote":`远程`,"git.checked":`读取于`,"git.stale":`最近一次读取失败,显示的是 {time} 的状态`,"git.part.staged":`已暂存 {n}`,"git.part.unstaged":`未暂存 {n}`,"git.part.untracked":`未跟踪 {n}`,"git.part.conflicted":`冲突 {n}`,"folder.head":`文件夹`,"folder.label":`文件夹:{name}`,"folder.keyboard":`方向键移动文件夹节点,按住 Shift 加速;Shift 加空格选择节点。`,"folder.tipHead":`工作目录`,"folder.path":`目录`,"folder.count":`{n} 个 Main Agent`,"folder.usedBy":`{n} 个 Main Agent 使用这个工作目录`,"menu.open":`打开会话`,"menu.copyLink":`复制面板链接`,"menu.copyId":`复制会话 ID`,"menu.cancelRun":`中断当前运行`,"menu.cancelRunDisabled":`当前没有正在进行的运行`,"menu.stopSession":`关闭会话`,"menu.stopDisabled":`会话已经关闭`,"menu.remove":`删除记录`,"menu.removeDisabled":`运行中的会话不能删除,请先中断并关闭。`,"confirm.label":`确认操作`,"confirm.stopTitle":`关闭这个会话?`,"confirm.stopBody":`会话会从执行端断开,之后不能再发送消息;已有记录会保留。`,"confirm.stopBodyActive":`它正在工作:会先中断当前运行,再断开会话;已有记录会保留。`,"confirm.removeTitle":`删除这条会话记录?`,"confirm.removeBody":`「{title}」的全部记录会被永久删除,无法恢复。执行端那边保存的原生会话不受影响。`,"toast.region":`通知`,"toast.cancelOk":`已请求中断`,"toast.cancelNothing":`当前没有可中断的运行`,"toast.cancelFailed":`中断失败`,"toast.stopOk":`会话已关闭`,"toast.stopFailed":`关闭失败`,"toast.removeOk":`记录已删除`,"toast.removeFailed":`删除失败`,"ctx.sessions":`其中 {n} 个会话`,"ctx.copyIds":`复制会话 ID({n} 个)`,"ctx.cancelRuns":`中断当前运行({n} 个)`,"ctx.stopSessions":`关闭会话({n} 个)`,"ctx.removeRecords":`删除记录({n} 个)`,"ctx.cancelNone":`选中的会话里没有正在进行的运行`,"ctx.stopNone":`选中的会话都已经关闭`,"ctx.removeNone":`选中的会话都在运行中,不能删除,请先中断并关闭。`,"ctx.undoNone":`{label}(没有可撤销的位置变动)`,"ctx.redoNone":`{label}(没有可重做的位置变动)`,"batch.stopTitle":`关闭这 {n} 个会话?`,"batch.stopConfirm":`关闭 {n} 个会话`,"batch.stopBody":e=>{let t=Number(e.active),n=Number(e.skipped);return`这些会话会从执行端断开,之后不能再发送消息;已有记录会保留。${t>0?`其中 ${t} 个正在工作:会先中断当前运行,再断开会话。`:``}${n>0?`另有 ${n} 个已经关闭,不受影响。`:``}`},"batch.removeTitle":`删除这 {n} 条会话记录?`,"batch.removeConfirm":`删除 {n} 条记录`,"batch.removeBody":e=>{let t=Number(e.skipped);return`这些会话的全部记录会被永久删除,无法恢复。执行端那边保存的原生会话不受影响。${t>0?`另有 ${t} 个正在运行,不会被删除;请先中断并关闭它们。`:``}`},"batch.result":e=>{let t=Number(e.failed),n=String(e.reason),r=Number(e.ok),i=Number(e.idle),a=[r>0?`${r} 个已完成`:``,i>0?`${i} 个当时已没有可中断的运行`:``,t>0?`${t} 个失败`:``].filter(Boolean);return`${String(e.action)}:${a.join(`,`)}${t>0&&n?`(${n})`:``}`},"focus.back":`全部会话`,"focus.link":`链接`,"focus.notFoundTitle":`找不到这个会话`,"focus.notFoundBody":`它可能已被删除,或者这个服务实例里没有它的记录。`,"focus.failedTitle":`读取会话失败`,"focus.failedBody":`无法从服务读取这个会话的历史,请确认服务仍在运行。`,"focus.removedBanner":`这个会话的记录已被删除,下面显示的是删除前的内容。`,"focus.tabs":`会话视图`,"focus.tab.timeline":`进展`,"focus.tab.task":`任务`,"focus.tab.summary":`概览`,"focus.tab.info":`信息`,"timeline.count":`{n} 条记录`,"timeline.expandAll":`展开全部步骤`,"timeline.collapseAll":`收起步骤`,"timeline.older":`显示更早的 {n} 条`,"timeline.jump":`有新内容`,"timeline.latest":`回到最新`,"timeline.empty":`还没有任何事件。`,"work.running":`正在执行 · {n} 个步骤`,"work.done":`执行了 {n} 个步骤`,"work.older":`显示更早的 {n} 步`,"work.failed":`{n} 失败`,"work.failedTip":`其中有步骤失败了。单个步骤失败不一定意味着整次运行失败。`,"tool.input":`输入`,"tool.output":`输出`,"tool.exit":`退出码 {code}`,"tool.files":`{n} 个文件`,"tool.unfinishedNote":`运行结束时执行端没有上报这个步骤的结束事件,它的结果未知。`,"tool.status.running":`进行中`,"tool.status.completed":`已完成`,"tool.status.failed":`失败`,"tool.status.cancelled":`已取消`,"tool.status.unfinished":`未结束(没有结束事件)`,"file.created":`新建`,"file.modified":`修改`,"file.deleted":`删除`,"file.renamed":`重命名`,"reasoning.live":`正在思考`,"reasoning.done":`思考`,"reasoning.note":`这是执行端提供的推理摘要,不是模型完整的思考过程。`,"msg.commentary":`过程说明`,"msg.locate":`在时间线中定位`,"msg.kind.task":`委派`,"msg.kind.steer":`纠偏`,"msg.kind.follow_up":`继续交代`,"plan.title":`执行端的计划`,"question.title":`提问`,"question.label":`执行端的提问`,"question.waiting":`等待回答`,"question.state.open":`待回答`,"question.state.answered":`已回答`,"question.state.declined":`不回答`,"question.state.expired":`已过期`,"question.index":`{i} / {n}`,"question.pickOne":`选一项`,"question.pickAny":`可多选`,"question.other":`其他`,"question.otherPlaceholder":`写下你自己的回答`,"question.textPlaceholder":`写下你的回答`,"question.answer":`回答`,"question.needAnswer":`每个问题都要有回答,或者选择不回答`,"question.decline":`不回答,让它自行判断`,"question.declineTip":`告知执行端你选择不回答,请它自行做合理假设并继续`,"question.sending":`正在交给执行端…`,"question.by.user":`你`,"question.note":`附言`,"question.delivery.handedOff":`已交给执行端`,"question.delivery.handedOffTip":`执行端已收下这条回复;它是否读到并采纳,Ensemble 无法确认。`,"question.delivery.declinedHandedOff":`已告知执行端自行判断`,"question.expiry.timeout":`时限内无人回答`,"question.expiry.timeoutTold":`时限内无人回答,已告知执行端自行判断并继续`,"question.expiry.withdrawn":`执行端撤回了这个提问`,"question.expiry.run_ended":`所属运行已结束,执行端不再等待`,"question.expiry.cancelled":`所属运行已被取消`,"question.expiry.session_closed":`会话已关闭`,"question.expiry.restarted":`Ensemble 重启,与执行端的连接已断开`,"question.expiry.not_waiting":`执行端已不再等待这个提问,回复没有送达`,"question.conflict.answered":`这个提问刚刚已被回答,页面马上会更新。`,"question.conflict.declined":`这个提问刚刚已被选择不回答,页面马上会更新。`,"question.conflict.expired":`执行端已不再等待这个提问,你的回复没有送达。`,"question.conflict.busy":`另一处正在处理这个提问,请稍候。`,"run.marker.queued":`第 {n} 次运行 · 排队`,"run.marker.started":`第 {n} 次运行开始`,"run.marker.completed":`第 {n} 次运行完成`,"run.marker.failed":`第 {n} 次运行失败`,"run.marker.cancelled":`第 {n} 次运行被中断`,"error.title":`这次运行失败了`,"error.retryable":`这类错误通常可以重试:在下方继续交代,让它接着做。`,"error.detail":`执行端原始信息`,"code.cancel_failed":`中断请求失败`,"code.cancel_unconfirmed":`中断尚未得到执行端确认`,"code.process_exited":`执行端进程已退出`,"code.run_ended":`运行结束前,这条消息没有来得及送达`,"code.service_restarted":`服务重启,运行被中止`,"code.service_stopped":`服务已停止,运行被中止`,"code.model_not_found":`找不到所选模型`,"code.auth_failed":`认证失败`,"code.rate_limited":`触发限流或额度上限`,"code.context_overflow":`上下文超出了模型窗口`,"code.provider_unavailable":`模型服务暂时不可用`,"code.model_error":`模型返回了错误`,"code.sandbox_error":`沙箱拒绝了操作`,"code.policy_blocked":`被策略拦截`,"code.fixture_failure":`模拟的失败场景`,"code.fixture_error":`模拟执行出错`,"code.codex.sandbox_mismatch":`沙箱级别与请求不一致`,"code.codex.default_model_unavailable":`默认模型不可用,已改用其他模型`,"code.codex.warning":`Codex 警告`,"code.codex.config_warning":`Codex 配置警告`,"code.codex.deprecation":`Codex 弃用提示`,"code.codex.guardian_warning":`Codex 安全提示`,"code.codex.compacted":`对话上下文已被压缩`,"code.codex.model_rerouted":`请求被改派到了其他模型`,"code.codex.world_writable":`目录对所有用户可写`,"code.codex.mcp_failed":`MCP 服务启动失败`,"code.codex.unrequested_turn":`出现了 Ensemble 没有发起的回合`,"code.codex.retrying":`Codex 遇到错误,正在重试`,"code.codex.question_unanswered":`执行端提了问题,Ensemble 无法转达`,"code.codex.question_secret":`执行端要一个机密内容,Ensemble 不转交这类提问`,"code.codex.elicitation_cancelled":`执行端的询问已被取消`,"code.codex.unsupported_request":`收到不支持的请求,已拒绝`,"code.pi.auto_retry":`Pi 自动重试`,"code.pi.compaction":`Pi 正在压缩上下文`,"code.pi.compaction_failed":`上下文压缩没有完成`,"code.pi.extension_error":`Pi 扩展出错`,"code.pi.extension_dialog":`Pi 扩展请求了界面交互`,"code.pi.extension_notify":`Pi 扩展通知`,"code.opencode.retry":`OpenCode 遇到错误,正在重试`,"code.opencode.compaction":`OpenCode 正在压缩上下文`,"code.opencode.compaction_failed":`上下文压缩没有完成`,"code.opencode.permission_allowed":`OpenCode 请求了权限,已按完全访问放行`,"code.opencode.permission_rejected":`只读运行里 OpenCode 请求了额外权限,已拒绝`,"code.opencode.question_unanswered":`执行端提了问题,Ensemble 无法转达`,"code.opencode.interrupted":`OpenCode 自己停止了这次运行`,"code.invalid_request":`请求没法按原样执行`,"code.session_not_resumable":`这个会话已经无法恢复`,"code.steer_reverted":`Cursor 没能把消息插入当前回合`,"code.steer_failed":`这条消息没有送达`,"code.cursor.tools":`Cursor 提供给模型的工具`,"code.cursor.access_violation":`只读会话里出现了会改动环境的工具`,"code.cursor.no_stream":`Cursor 没有提供实时步骤`,"code.cursor.expired":`Cursor 的运行已过期`,"code.cursor.summary":`Cursor 正在压缩上下文`,"code.cursor.summary_failed":`上下文压缩没有完成`,"code.cursor.task":`Cursor 子任务进展`,"code.cursor.request":`Cursor 请求编号`,"delivery.label":`投递进度`,"delivery.step.recorded":`已记录`,"delivery.step.handed_off":`已交给执行端`,"delivery.step.applied":`已生效`,"delivery.recorded":`Ensemble 已收到并保存,尚未交给执行端`,"delivery.queued_ensemble":`已排队,由 Ensemble 持有`,"delivery.queued_harness":`已交给执行端,在它的队列里等待`,"delivery.handed_off":`已交给执行端,尚无生效确认`,"delivery.applied":`执行端已确认纳入上下文`,"delivery.failed":`投递失败`,"delivery.cancelled":`已撤回,没有送达`,"queue.run_in_progress":`等待当前运行结束`,"queue.turn_boundary":`等待当前回合边界`,"queue.session_starting":`等待会话连接完成`,"queue.capacity":`等待并发名额`,"sync.pending":`待同步给主 Agent`,"sync.delivered":`已同步给主 Agent`,"sync.pendingTip":`主 Agent 下次调用 Ensemble 工具时会收到这条干预。`,"sync.deliveredTip":`已随工具结果交给主 Agent({time})。`,"composer.label":`给执行端的消息`,"composer.mode":`发送方式`,"composer.mode.steer":`纠偏`,"composer.mode.followUp":`排队`,"composer.mode.idle":`继续交代`,"composer.placeholder.steer":`补充或纠正 {name} 当前的方向…`,"composer.placeholder.followUp":`交代 {name} 在本次运行之后继续做什么…`,"composer.placeholder.idle":`继续向 {name} 交代…`,"composer.placeholder.closed":`会话已关闭`,"composer.send":`发送`,"composer.cancel":`中断`,"composer.cancelTip":`中断当前运行,会话保留`,"composer.sendFailed":`发送失败`,"composer.tooLong":`消息超过 {max} 字符的上限`,"composer.noSteer":`这个执行端不能在运行中纠偏,消息会排到本次运行之后。`,"task.origin":`来源`,"task.brief":`委派原文`,"task.context":`传入的上下文`,"task.prompt":`实际发给执行端的提示`,"task.copy":`复制原文`,"task.copyPrompt":`复制完整提示`,"task.noContext":`发起端没有传入额外上下文。`,"task.parent":`上级会话`,"task.parentGone":`上级会话的记录已不存在。`,"task.parentsLabel":`跟随 {n} 个会话`,"task.parentGoneNamed":`所跟随的会话 {id} 的记录已不存在。`,"ctx.text":`文本`,"ctx.snippet":`代码片段`,"handoff.open":`打开被引用的会话:{title}`,"handoff.gone":`这个会话已不在 Ensemble 里,无法再打开;下面是当时交接出去的内容。`,"handoff.phaseAt":`交接时:{phase}`,"handoff.readAt":`读取于 {time}`,"handoff.result":`结果`,"handoff.files":`改动文件`,"handoff.error":`最后的错误`,"handoff.note":`说明`,"handoff.chars":`{n} 个字符`,"handoff.fromRun":`取自第 {run} 次运行(共 {runs} 次)`,"handoff.laterNone":`更新的第 {run} 次运行没有产出`,"handoff.notFinal":`执行端没有把它标为最终回答`,"handoff.cut":`只交了前 {sent} 个字符(原文共 {n} 个)`,"handoff.noResult":`没有可取的结果`,"handoff.noRuns":`这个会话没有任何运行`,"handoff.noText":`它的运行里没有任何助手文字`,"handoff.noFinal":`它写的文字都被标成过程说明,没有最终回答`,"handoff.pathCount":`{n} 个路径`,"handoff.pathsCut":`只列出前 {sent} 个(共 {n} 个)`,"handoff.filesNone":`没有上报文件改动`,"handoff.errorNone":`没有失败记录`,"handoff.errorIn":`{code},第 {run} 次运行`,"handoff.errorSession":`{code}(会话级)`,"handoff.errorCut":`错误消息被截断`,"handoff.text":`交接的原文`,"handoff.textMissing":`在已保存的提示里找不到这份交接的原文。`,"handoff.noSample":`没有记录当时交接了什么。`,"info.session":`会话`,"info.harness":`执行端`,"info.model":`模型`,"info.modelResolved":`请求 {requested} → 实际 {resolved}`,"info.effort":`推理强度`,"info.effortDefault":`默认`,"info.access":`访问权限`,"info.cwd":`工作目录`,"info.native":`原生会话`,"info.nativeTip":`执行端自己保存的会话标识,服务重启后用它恢复。`,"info.id":`会话 ID`,"info.created":`创建时间`,"info.runs":`运行次数`,"sum.progress":`进度`,"sum.children":`后续会话`,"sum.messages":`消息记录`,"sum.files":`文件变更`,"sum.usage":`用量`,"sum.noPlan":`执行端还没有给出计划。`,"sum.noPlanSupport":`这个执行端不提供计划信息。`,"sum.noFiles":`还没有文件变更记录。`,"sum.noFileEvents":`这个执行端不上报结构化的文件变更;通过 shell 修改的文件不会出现在这里。`,"sum.noUsage":`还没有用量数据。`,"sum.noUsageSupport":`这个执行端不提供用量信息。`,"usage.input":`输入`,"usage.cached":`缓存命中`,"usage.output":`输出`,"usage.reasoning":`推理`,"usage.fresh":`新输入`,"usage.reply":`其余输出`,"usage.total":`总计`,"usage.tip":`{label}
15
- {tokens} tokens · {share}`,"usage.totalTip":`{tokens} tokens(输入 + 输出)`,"usage.cost":`费用`,"usage.context":`上下文占用`,"md.code":`代码`,"md.copyCode":`复制代码`,"preview.copy":`复制`,"preview.truncated":`内容已被截断`,"preview.truncatedChars":`内容已被截断(原文共 {n} 字符)`,"apiError.invalid_request":`请求无效`,"apiError.not_found":`找不到对应的会话或资源`,"apiError.forbidden":`没有访问权限,请刷新页面后重试`,"apiError.conflict":`当前状态下无法执行这个操作`,"apiError.harness_unavailable":`执行端不可用`,"apiError.harness_needs_setup":`执行端还需要设置`,"apiError.access_unsupported":`该执行端不支持所选的访问权限`,"apiError.model_settings_unavailable":`模型设置不可用`,"apiError.model_not_allowed":`该执行端没有开放所选的模型`,"apiError.depth_exceeded":`委派嵌套层数已达上限`,"apiError.session_closed":`会话已关闭,无法再发送消息`,"apiError.session_not_resumable":`会话已失联,且无法恢复原生会话`,"apiError.question_unsupported":`该执行端不接收对提问的回复`,"apiError.internal":`服务内部错误`,"apiError.network":`无法连接到 Ensemble 服务`,"setup.codex_not_found":`没有找到 Codex CLI。安装后点击“重新探测”。`,"setup.codex_login_required":`Codex 还没有登录。请在终端里完成登录后重新探测。`,"setup.codex_no_models":`Codex 没有返回可用模型,请检查账号与网络。`,"setup.codex_probe_failed":`探测 Codex 失败`,"setup.pi_not_found":`没有找到 Pi CLI。安装后点击“重新探测”。`,"setup.pi_no_models":`Pi 没有可用模型:请先配置模型服务商和密钥。`,"setup.pi_probe_failed":`探测 Pi 失败`,"setup.claude_not_found":`没有找到 Claude Code。安装后点击重新探测。`,"setup.claude_login_required":`Claude Code 还没有登录,请先完成登录。`,"setup.claude_probe_failed":`探测 Claude Code 失败`,"setup.claude_unsupported":`当前 Claude Code 版本缺少所需的会话接口,请更新。`,"setup.claude_persistence_disabled":`Claude Code 关闭了会话保存,无法继续同一会话。`,"setup.opencode_not_found":`没有找到 OpenCode。安装后点击“重新探测”。`,"setup.opencode_unsupported":`当前 OpenCode 版本太旧,需要 2.x 及以上。更新后重新探测。`,"setup.opencode_no_models":`OpenCode 没有可用模型:请先用 opencode auth login 连接模型服务商。`,"setup.opencode_probe_failed":`探测 OpenCode 失败`,"setup.dsh_not_found":`没有找到 DSH(DeepSeek Harness)。安装后点击“重新探测”。`,"setup.dsh_unsupported":`当前 DSH 版本没有 Ensemble 需要的 ACP v1 接口,请更新后重新探测。`,"setup.dsh_no_models":`DSH 的 acp 配置里没有可用模型:检查 DSH 主目录下的 profile 后重新探测。`,"setup.dsh_probe_failed":`探测 DSH 失败`,"setup.cursor_sdk_missing":`还没有安装 Cursor SDK(@cursor/sdk)。它带有原生组件、许可证不允许随插件分发,需要你确认后安装。`,"setup.cursor_login_required":`Cursor 还没有凭据:设置环境变量 CURSOR_API_KEY,或运行下面的命令登录。`,"setup.cursor_auth_rejected":`Cursor 拒绝了当前凭据:请重新登录,或换一个新的 API Key。`,"setup.cursor_no_models":`Cursor 没有返回可用模型,请检查账号与订阅。`,"setup.cursor_probe_failed":`探测 Cursor 失败`,"setup.withReason":`{headline}:{reason}`,"setup.probe_failed":`探测执行端时出错`,"rail.label":`工作空间导航`,"rail.active":`全部活跃`,"rail.all":`全部空间`,"rail.sectionActive":`进行中`,"rail.sectionRecent":`最近`,"rail.sectionEarlier":`更早({n})`,"rail.collapse":`收起侧栏({keys})`,"rail.expand":`展开侧栏({keys})`,"rail.switchTip":`快速切换({keys})`,"rail.empty":`还没有委派记录`,"rail.siblings":`当前空间会话`,"rail.moreSessions":`另有 {n} 个会话`,"view.mode":`视图模式`,"view.canvas":`画布`,"view.list":`列表`,"view.workingOnly":`仅工作中`,"view.activeSubtitle":`{running} 个运行中 · {total} 个工作中 · {n} 个 Main Agent`,"view.activeEmptyTitle":`此刻没有正在工作的会话`,"view.activeEmptySub":`可以在左侧切换任意 Main Agent 查看历史;新的委派由主 Agent 通过 Ensemble 的 MCP 工具发起。`,"view.allSubtitle":`{n} 个 Main Agent · {total} 个会话`,"view.listEmpty":`当前没有符合条件的会话`,"view.filesChanged":`{n} 个文件改动`,"switcher.title":`快速切换`,"switcher.placeholder":`搜索 Main Agent 或会话…`,"switcher.scopeAll":`全部`,"switcher.scopeWorkspaces":`Main Agent`,"switcher.scopeSessions":`会话`,"switcher.activeOnly":`仅显示进行中`,"switcher.empty":`没有匹配的工作空间或会话`,"menu.archive":`归档`,"menu.archiveTree":`归档(含 {n} 个下级会话)`,"menu.unarchive":`取消归档`,"menu.exportMd":`导出 Markdown`,"menu.exportMdTree":`导出 Markdown(含 {n} 个下级会话)`,"menu.exportMdTreeAny":`导出 Markdown(含下级会话)`,"menu.exportMdFull":`导出 Markdown(含工具输出)`,"origin.menuArchive":`归档整个 Main Agent 空间({n} 个会话)`,"origin.menuArchivePart":`归档已完成的会话({n} 个,其余保留)`,"origin.menuArchiveNone":`归档整个 Main Agent 空间`,"ctx.archiveSelected":`归档所选({n} 个会话)`,"export.failed":`导出失败`,"archive.title":`已归档`,"archive.subtitle":`{n} 个会话`,"archive.note":`已归档的会话不再出现在画布、侧栏与列表里;记录原样保留,随时可以取消归档或导出。`,"archive.empty":`还没有归档的会话`,"archive.unsupported":`当前运行的服务还不支持归档。`,"archive.loading":`正在读取已归档的会话…`,"archive.loadFailed":`读取已归档的会话失败`,"archive.children":`含 {n} 个下级`,"archive.childrenAny":`含下级会话`,"archive.auto":`自动归档`,"archive.autoTip":`由留存策略自动归档,不是手动归档的。`,"archive.archivedAt":`归档于 {time}`,"archive.more":`显示更多(还有 {n} 个)`,"archive.unarchiveOf":`取消归档「{title}」`,"archive.exportOf":`导出「{title}」`,"archive.retentionLink":`留存策略`,"archive.retentionLinkTip":`在设置的「历史」里设置自动归档`,"archive.chip":`已归档`,"archive.chipTip":`这个会话已归档:不在画布、侧栏与列表里,记录原样保留。`,"archive.banner":`这个会话已于 {time} 归档:不在画布、侧栏与列表里,记录原样保留。取消归档会连同它的下级和仍在归档中的上级一起恢复;给它发送消息也会先取消归档。`,"archive.bannerAuto":`留存策略已于 {time} 自动归档了这个会话:不在画布、侧栏与列表里,记录原样保留。取消归档会连同它的下级和仍在归档中的上级一起恢复;给它发送消息也会先取消归档。`,"archive.unarchiveTip":`取消归档:连同它的下级和仍在归档中的上级一起恢复`,"archive.finished":`归档已完成会话`,"archive.finishedTip":`归档 {n} 个已结束的会话(失败、已中断、已关闭、已失联也算已结束;整棵任务树都结束了才会归档)`,"archive.busy":`上一个归档操作还在进行`,"archive.nothing":`没有可以归档的会话:整棵任务树里的会话都结束了才能归档`,"archive.blockedWorking":`还有 {n} 个会话在工作,等它们结束后才能归档`,"archive.blockedIdle":`还有 {n} 个会话在待命(还开着,不算已结束),关闭后才能归档`,"archive.blockedPending":`还有 {n} 个会话的消息没有被确认,处理完才能归档`,"archive.keptWorking":`;另有 {n} 个会话还在工作,没有归档`,"archive.keptIdle":`;另有 {n} 个会话在待命,没有归档`,"archive.keptPending":`;另有 {n} 个会话的消息没有被确认,没有归档`,"archive.keptFollowing":`;另有 {n} 个会话还跟随着没有归档的会话,没有归档`,"archive.done":`已归档 {n} 个会话`,"archive.undo":`撤销`,"archive.failed":`归档失败`,"archive.noneActive":`没有归档:这些会话还没有全部结束`,"archive.noneMissing":`没有归档:找不到这些会话,可能已被删除`,"archive.noneAlready":`这些会话已经归档过了`,"archive.confirmTitle":`归档这 {n} 个会话?`,"archive.confirmBody":e=>{let t=Number(e.carried),n=Number(e.kept);return`这 ${Number(e.n)} 个会话会移出画布、侧栏与列表;记录原样保留,随时可以在「已归档」里取消归档。${t>0?`其中包含 ${t} 个随上级一起归档的下级会话。`:``}${n>0?`另有 ${n} 个会话还没结束,留在原处。`:``}`},"archive.confirmAction":`归档 {n} 个会话`,"archive.unarchiveFailed":`取消归档失败`,"archive.unarchived":`已取消归档 {n} 个会话`,"archive.unarchivedCarried":`(其中 {n} 个是随它一起恢复的上级或下级)`,"archive.unarchiveMissing":`没有取消归档:找不到这个会话,可能已被删除`,"archive.unarchiveNone":`这些会话本来就没有归档`,"archive.spaceGone":`「{name}」名下的会话都已归档,已切换到「{target}」`,"history.summary":`{n} 个已归档`,"history.unsupported":`当前运行的服务还不支持归档`,"history.unsupportedNote":`服务更新到支持归档的版本后,这里会出现已归档的会话与留存策略。`,"history.sessions":`会话`,"history.sessionsNote":`{n} 个未归档,{m} 个已归档。已归档的会话不再出现在画布、侧栏与列表里;记录原样保留,随时可以取消归档。`,"history.view":`查看已归档`,"history.retention":`留存策略`,"history.retentionIntro":`留存策略只会把会话归档,不会删除任何记录。保存后立刻清扫一次,之后服务定期清扫;任务树里还有会话在工作时,整棵树都不会被归档。两项可以分别开启,都不开启就不会自动归档(默认)。`,"history.retentionLoading":`正在读取留存策略…`,"history.retentionUnavailable":`读取不到留存策略`,"history.lastSweep":`上次清扫:{time},归档了 {n} 个会话`,"history.invalid":`请输入 {min} 到 {max} 之间的整数;这一项还没有保存。`,"history.keepDaysName":`按时间保留`,"history.keepDaysLead":`保留最近`,"history.keepDaysNote":`最后一次活动早于这个天数的已结束任务树会被归档。`,"history.keepDaysValue":`保留的天数`,"history.unitDay":`天`,"history.unitDays":`天`,"history.keepCountName":`按数量保留`,"history.keepCountLead":`最多保留`,"history.keepCountNote":`按最后活动由近到远数,超出这个数量的已结束任务树会被归档;还有会话在工作的任务树也占名额,但不会被归档。`,"history.keepCountValue":`保留的任务树数量`,"history.unitTree":`棵任务树`,"history.unitTrees":`棵任务树`},en:{"boot.connecting":`Connecting to the Ensemble service…`,"boot.offlineTitle":`Can't reach the Ensemble service`,"boot.offlineBody":`The service may have exited, or the access token is no longer valid. Ask the main agent to call Ensemble again, or reload the page.`,"boot.reload":`Reload page`,"common.cancel":`Cancel`,"common.close":`Close`,"common.collapse":`Collapse`,"common.expand":`Expand`,"common.copied":`Copied`,"common.copyFailed":`Copy failed — select the text manually`,"common.copyId":`Copy ID`,"common.copyPath":`Copy path`,"common.dismiss":`Dismiss`,"common.none":`None`,"common.retry":`Retry`,"time.justNow":`just now`,"time.seconds":`{n}s ago`,"time.minutes":`{n}m ago`,"time.hours":`{n}h ago`,"time.days":`{n}d ago`,"phase.ready":`Ready`,"phase.starting":`Connecting`,"phase.queued":`Queued`,"phase.running":`Running`,"phase.done":`Done`,"phase.failed":`Failed`,"phase.cancelled":`Interrupted`,"phase.stopped":`Closed`,"phase.lost":`Disconnected`,"activity.starting":`Connecting to the harness`,"activity.queued":`Waiting for a free slot`,"activity.ready":`Ready`,"activity.working":`Working`,"activity.thinking":`Thinking`,"activity.writing":`Writing a reply`,"activity.tool":`Running a tool`,"activity.idle":`Idle`,"activity.done":`Done`,"activity.failed":`Run failed`,"activity.cancelled":`Interrupted`,"activity.stopped":`Session closed`,"activity.lost":`Lost contact with the harness`,"act.read":`Read`,"act.write":`Write`,"act.search":`Search`,"act.shell":`Run`,"act.web":`Fetch`,"act.mcp":`Call`,"act.task":`Delegate`,"act.plan":`Plan`,"act.other":`Do`,"harness.cursor":`Cursor`,"harness.codex":`Codex`,"harness.pi":`Pi`,"harness.claude":`Claude Code`,"harness.opencode":`OpenCode`,"harness.dsh":`DSH`,"harness.fixture":`Simulated harness`,"harness.status.ready":`Ready`,"harness.status.needs_setup":`Needs setup`,"harness.status.unavailable":`Unavailable`,"harness.status.checking":`Checking`,"harness.refresh":`Probe again`,"harness.refreshed":`Probed again`,"harness.refreshFailed":`Probe failed`,"harness.none":`No harness information yet.`,"harness.checkedAt":`checked {time}`,"harness.copyCommand":`Copy command`,"harness.modelsIntro":`The main Agent can only choose models that are ticked. Click the box at the right end of a ticked model to make it the default. Changes save automatically and apply in every host.`,"harness.modelsAllowed":`Models the main Agent may choose`,"harness.noModels":`No model list was returned.`,"harness.default":`Default`,"harness.allowAll":`Allow all`,"harness.allowAllTip":`Allow all models, including models added later`,"harness.selectAll":`Select all`,"harness.selectNone":`Select none`,"harness.modelFilter":`Filter models`,"harness.modelNoMatch":`No matching models`,"harness.noneAllowed":`No model is ticked: the main Agent can't delegate to this harness.`,"harness.defaultSwapped":`The default model isn't ticked; when the main Agent doesn't name a model, “{name}” is used.`,"harness.defaultPick":`Set as default model: {name}`,"harness.defaultPickTip":`Set as default model`,"harness.defaultPicked":`The default model you chose`,"harness.defaultOwn":`Harness default`,"harness.defaultOwnTip":`The harness's own default model. You chose another one, which takes precedence.`,"harness.defaultUnnamed":`the harness's own default`,"harness.defaultUser":`You chose the default model: when the main Agent doesn't name a model, “{name}” is used.`,"harness.defaultRestore":`Restore the harness default`,"harness.defaultDropped":`“{dropped}” was unticked, so it's no longer the default you chose; when the main Agent doesn't name a model, “{name}” is now used.`,"harness.defaultDroppedNone":`“{dropped}” was unticked, so it's no longer the default you chose.`,"harness.defaultStale.missing":`The default model you chose, “{stale}”, is no longer available: the harness doesn't offer it. When the main Agent doesn't name a model, “{name}” is now used.`,"harness.defaultStale.not_allowed":`The default model you chose, “{stale}”, isn't ticked, so it has no effect. When the main Agent doesn't name a model, “{name}” is now used.`,"harness.effortShort":`Effort`,"harness.effortsToggle":`{name}: reasoning effort, {n} of {total} allowed`,"harness.effortsGroup":`Reasoning efforts the main Agent may use with {name}`,"harness.effortLast":`Keep at least one level`,"harness.effortUnlimited":`Remove effort limit`,"harness.effortsNeeded":`None of the ticked models has a usable reasoning effort yet: expand one and tick at least one level.`,"harness.modelsSaveFailed":`Couldn't save the model settings`,"harness.modelSettings.invalid_entry":`The model list is invalid. Choose the models to allow again.`,"harness.modelSettings.unreadable_file":`Model settings couldn't be read. Restore settings.json and restart Ensemble.`,"harness.access":`Access levels & enforcement`,"harness.accessUnsupported":`Unsupported`,"harness.allowedSummary":`{n} / {total} models open`,"model.default":`Default model`,"effort.minimal":`Minimal`,"effort.low":`Low`,"effort.medium":`Medium`,"effort.high":`High`,"effort.xhigh":`Extra high`,"run.simulated":`Simulated`,"run.simulatedTip":`This is a demo/development stand-in. The steps shown are generated by a script and are not a record of a real harness run.`,"access.read_only":`Read-only`,"access.full":`Full access`,"enforce.enforced":`Enforced`,"enforce.advisory":`Prompt only`,"enforce.none":`Unrestricted`,"enforce.tip.enforced":`Enforced by the harness's own sandbox or permission system.`,"enforce.tip.advisory":`Only requested in the prompt. The harness does not enforce it, so don't treat it as a security boundary.`,"enforce.tip.none":`Nothing restricts this level.`,"verify.live":`Verified live`,"verify.declared":`Docs only`,"verify.none":`Unverified`,"verify.tip.live":`Verified on this machine against the real harness.`,"verify.tip.declared":`Declared by docs or source; not verified on this machine.`,"verify.tip.none":`Never verified.`,"capMode.immediate":`Immediate`,"capMode.turn_boundary":`At turn boundary`,"capMode.immediate_or_follow_up":`Immediate, else queued`,"capMode.none":`None`,"capMode.queued_by_harness":`Queued by harness`,"capMode.after_run":`After the run`,"native.cursor-agent":`Cursor agent`,"native.codex-thread":`Codex thread`,"native.pi-session":`Pi session`,"native.claude-session":`Claude Code session`,"native.opencode-session":`OpenCode session`,"native.dsh-session":`DSH session`,"topbar.settings":`Settings`,"settings.title":`Settings`,"settings.sections":`Settings sections`,"settings.section.executors":`Harnesses`,"settings.section.profiles":`Roles`,"settings.section.general":`General`,"settings.section.history":`History`,"settings.executors.summary":`{ready}/{total} ready`,"settings.profiles.summary":`{ready}/{total} ready`,"settings.profiles.legacy":`Unavailable`,"settings.language":`语言 / Language`,"settings.languageNote":`Saved in this browser only. Applies as soon as you choose.`,"profiles.intro":`Give a set of settings a name, and the main Agent can pick it by name when delegating. Anything left on Default follows the usual rules: the model you chose as default under “{section}”, that model's default effort, and full access. Changes save automatically and apply in every host.`,"profiles.empty":`No roles yet. Add one and the main Agent can pick it by name.`,"profiles.unavailable":`Ensemble couldn't read settings.json, so roles are unavailable. Restore the file and restart Ensemble.`,"profiles.unsupported":`The Ensemble service you're connected to is an older version that doesn't support delegation roles, so roles can't be added or changed here. Update and restart the service, then come back.`,"profiles.add":`Add a role`,"profiles.limit":`At most {max} roles.`,"profiles.col.name":`Name`,"profiles.name":`Role name`,"profiles.namePlaceholder":`e.g. verify`,"profiles.newRole":`New role`,"profiles.fieldFor":`{field} ({name})`,"profiles.pickHarness":`Choose a harness`,"profiles.unknown":`Unknown`,"profiles.delete":`Delete role {name}`,"profiles.discard":`Discard this new role`,"profiles.deleteTitle":`Delete the role “{name}”?`,"profiles.deleteBody":`Delegations that name this role will be refused from now on. Sessions already started aren't affected.`,"profiles.deleteConfirm":`Delete`,"profiles.draftHint":`Saves automatically once it has a valid name and a harness.`,"profiles.saveFailed":`Couldn't save the role`,"profiles.removeFailed":`Couldn't delete the role`,"profiles.name.empty":`The name can't be empty.`,"profiles.name.too_long":`The name can have at most {max} characters.`,"profiles.name.bad_characters":`Use lowercase letters, digits, - and _ only, starting with a letter or digit.`,"profiles.name.digits_only":`The name can't be digits only: add a letter, - or _.`,"profiles.name.duplicate":`A role named “{name}” already exists.`,"profiles.issue.invalid_entry":`This role's entry in settings.json can't be read. Choose a harness again, or delete the role.`,"profiles.issue.invalid_name":`This role's name in settings.json isn't valid, so the main Agent can't refer to it. Give it a new name.`,"profiles.issue.unknown_harness":`This version of Ensemble doesn't know the harness “{harness}”. Choose another harness, or delete the role.`,"profiles.issue.harness_not_ready":`{harness}: {status}. This role can't be used right now.`,"profiles.issue.access_unsupported":`{harness} can't enforce the access level “{access}”. Change the access level or the harness.`,"profiles.issue.settings_unavailable":`Model settings are unavailable, so Ensemble can't tell which models {harness} offers. See “{section}”.`,"profiles.issue.no_models_open":`No model is open for {harness}. Open some under “{section}”, or choose another harness.`,"profiles.issue.model_not_open":`The model “{model}” isn't open for {harness}.`,"profiles.issue.model_unverified":`Reasoning efforts are restricted for {harness}, and Ensemble can't tell which model it uses by default. Choose a model for this role.`,"profiles.issue.model_unknown":`“{model}” isn't a model {harness} reports, and its reasoning efforts are restricted, so Ensemble can't tell whether it can be used.`,"profiles.issue.effort_not_open":`The effort “{effort}” isn't allowed for the model “{model}”.`,"profiles.issue.effort_none":`No reasoning effort is allowed for the model “{model}”.`,"settings.concurrency":`Concurrent runs`,"settings.concurrencyNote":`The most sessions that can run at once, shared by every host and browser. Changes apply immediately. Extra sessions wait in line; lowering the limit never interrupts a running session.`,"settings.concurrencyLimited":`Limit`,"settings.concurrencyUnlimited":`No limit`,"settings.concurrencyValue":`Maximum concurrent sessions`,"settings.concurrencyDecrease":`Decrease`,"settings.concurrencyIncrease":`Increase`,"settings.concurrencyRestore":`Restore default ({value})`,"settings.concurrencySource.settings":`Set here`,"settings.concurrencySource.env":`Not set here; using the ENSEMBLE_MAX_CONCURRENT_RUNS environment variable: {value}`,"settings.concurrencySource.default":`Not set here; using the default: {value}`,"settings.concurrencySource.startup":`Fixed by the program that started the service; it can't be changed here`,"settings.concurrencyInUse":`In use {occupied} · Waiting {waiting}`,"settings.concurrencyOver":`More sessions are running than the limit allows. They keep running; slots are reclaimed as they finish.`,"settings.concurrencyIssueInvalid":`The value in the settings file is invalid; using {value} for now. It is only overwritten when you set it again here.`,"settings.concurrencyIssueUnreadable":`settings.json couldn't be read, so this can't be changed here for now; using {value}. Restore the file and restart Ensemble.`,"settings.concurrencyDraftInvalid":`Enter a whole number from {min} to {max}. It is still {current}.`,"settings.concurrencySaveFailed":`Couldn't save the concurrent runs limit`,"conn.connecting":`Connecting`,"conn.live":`Connected`,"conn.reconnecting":`Reconnecting…`,"conn.offline":`Disconnected, retrying`,"scene.zoomIn":`Zoom in`,"dock.zoom":`Canvas zoom`,"dock.hideIdle":`Hide sessions that aren't working`,"dock.hideIdleTip":e=>`Hide sessions that aren't working (${F(e)} can be hidden)`,"dock.hideIdleNone":`Hide sessions that aren't working
16
- Nothing to hide right now`,"dock.showAllTip":e=>`Show all sessions (${F(e)} hidden)`,"dock.showAllNone":`Show all sessions
17
- Nothing is hidden right now`,"dock.hideIdleReady":`Ready sessions count as working and stay.`,"dock.hideIdleKept":`A session with a working child stays, so every line is a real parent–child relation.`,"scene.nodeLabel":`Session: {title}`,"scene.nodeKeyboard":`Use arrow keys to move, Shift to move faster, Shift+Space to select, Enter to open, and Shift+F10 or the Menu key for actions.`,"scene.originLabel":`Origin: {title}`,"scene.originLabelCollapsed":`Origin: {title} (related nodes hidden)`,"scene.originKeyboard":`Use arrow keys to move, Shift to move faster, and Shift+Space to select. Shift+F10 or the menu key opens a menu to hide or show its related nodes.`,"scene.selected":e=>`${F(e)} ${P(e.n,`node`,`nodes`)} selected`,"scene.resetLayout":`Reset node layout`,"scene.resetLayoutTip":`Rearrange all nodes, clearing any manual positions: keeps the current zoom when everything fits, zooms out only as needed`,"edgeHint.top":`above the view`,"edgeHint.right":`to the right of the view`,"edgeHint.bottom":`below the view`,"edgeHint.left":`to the left of the view`,"edgeHint.one":`New session {dir}: {title}`,"edgeHint.many":e=>`${F(e)} new sessions ${String(e.dir)}, nearest: ${String(e.title)}`,"edgeHint.goOne":`Click to pan there`,"edgeHint.goNearest":`Click to pan to the nearest`,"edgeHint.more":`{n} more`,"arrange.label":`Align and distribute`,"arrange.count":`selected`,"arrange.left":`Align left`,"arrange.hcenter":`Align horizontal centers`,"arrange.right":`Align right`,"arrange.top":`Align top`,"arrange.vmiddle":`Align vertical centers`,"arrange.bottom":`Align bottom`,"arrange.distributeH":`Distribute horizontally`,"arrange.distributeV":`Distribute vertically`,"arrange.needThree":`{label} (select at least 3)`,"arrange.undo":`Undo ({keys})`,"arrange.redo":`Redo ({keys})`,"arrange.clear":`Clear selection (Esc)`,"arrange.done":e=>`${String(e.action)}: ${F(e)} ${P(e.n,`node`,`nodes`)}`,"arrange.unchanged":`{action}: nothing moved`,"scene.zoomOut":`Zoom out`,"scene.fit":`Fit canvas (0)`,"scene.sr":e=>`${F(e)} ${P(e.n,`session`,`sessions`)} on the canvas`,"scene.srHidden":e=>`${F(e)} ${P(e.n,`session`,`sessions`)} shown, ${Number(e.hidden)} not working hidden`,"scene.srHiddenAny":e=>`${F(e)} ${P(e.n,`session`,`sessions`)} shown, ${Number(e.hidden)} hidden`,"empty.title":`Nothing has been delegated yet`,"empty.sub":`Delegations are started by the main Agent through Ensemble's MCP tools. The sessions it starts will show up here.`,"idle.title":`No session is working right now`,"idle.sub":e=>`${F(e)} ${P(e.n,`session is`,`sessions are`)} hidden`,"idle.showAll":`Show all sessions`,"node.menu":`Session actions`,"node.modelTip":`Model: {model}
18
- Effort: {effort}`,"node.pending":e=>`${F(e)} ${P(e.n,`message`,`messages`)} in flight`,"node.pendingTip":`Some messages are not yet confirmed as applied by the harness. Open the session to see their delivery status.`,"node.interventionsTip":`Times you stepped in on this session`,"node.runs":e=>`${F(e)} runs`,"attention.title":`Worth a look`,"attention.quiet":`No events for {d}, and no tool call in progress`,"attention.longTool":`No events for {d}; step in progress: {tool} (started {started} ago)`,"attention.longRun":`This run has been going for {d}`,"attention.sharedFile":e=>`${e.file} was also written by ${F(e)} other running ${P(e.n,`session`,`sessions`)} (latest write ${e.d} ago)`,"attention.undelivered":`{kind} message waiting {d}: {state}`,"attention.question":`Question awaiting an answer: “{q}” (waiting {d})`,"origin.user":`You (console)`,"origin.console":`From the web console`,"origin.dispatchedBy":`Dispatched by {host}`,"origin.noRefTip":`The host did not provide a session id; nothing is guessed here.`,"origin.tipHead":`Origin: {host}`,"origin.workspace":`Workspace`,"origin.started":`First delegated`,"origin.titleTip":`This conversation's title in {host}`,"origin.head":`Main Agent`,"origin.count":e=>`${F(e)} ${P(e.n,`session`,`sessions`)}`,"origin.countRunning":e=>`${F(e)} ${P(e.n,`session`,`sessions`)} · ${e.running} running`,"origin.menu":`Main Agent actions`,"origin.menuHide":e=>`Hide related nodes (${F(e)} ${P(e.n,`session`,`sessions`)})`,"origin.menuShow":e=>`Show related nodes (${F(e)} ${P(e.n,`session`,`sessions`)})`,"origin.menuShowAll":e=>`Show all (${F(e)} ${P(e.n,`Main Agent`,`Main Agents`)} with hidden nodes)`,"origin.doneHide":e=>`Hid this Main Agent's related nodes (${F(e)} ${P(e.n,`session`,`sessions`)})`,"origin.doneShow":e=>`Showing this Main Agent's related nodes (${F(e)} ${P(e.n,`session`,`sessions`)})`,"origin.doneShowAll":e=>`Showing the related nodes of all ${F(e)} ${P(e.n,`Main Agent`,`Main Agents`)}`,"origin.expand":`Show related nodes`,"origin.collapsedTip":e=>`Related nodes hidden · ${F(e)} ${P(e.n,`session`,`sessions`)}\nClick or right-click to show`,"origin.collapsedTipRunning":e=>`Related nodes hidden · ${F(e)} ${P(e.n,`session`,`sessions`)} · ${e.running} running\nClick or right-click to show`,"origin.refLabel.session":`Session`,"origin.refLabel.thread":`Thread`,"origin.refLabel.conversation":`Conversation`,"origin.refDeclared":`Self-reported`,"origin.refDeclaredTip":`The host did not provide a session id; the agent reported this one itself through the conversationId parameter, and Ensemble cannot verify it.`,"origin.workspaceUnknown":`Unknown`,"origin.workspaceUnknownTip":`Unknown (the host reported no workspace and no cwd was passed when delegating)`,"origin.workspaceNote":`{path} ({from})`,"origin.workspaceFrom.mcp-roots":`reported by the host`,"origin.workspaceFrom.delegate-cwd":`cwd passed when delegating`,"origin.workspaceFrom.host-record":`recorded by the host for this conversation`,"git.head":`Git`,"git.label":`Git repository: {name}`,"git.keyboard":`Arrow keys move the Git node, hold Shift to move faster; Shift+Space selects the node.`,"git.detached":`Detached HEAD`,"git.noCommits":`No commits yet`,"git.clean":`Working tree clean`,"git.dirty":e=>`${F(e)} ${P(e.n,`changed file`,`changed files`)}`,"git.conflicts":e=>`${F(e)} ${P(e.n,`conflict`,`conflicts`)}`,"git.ahead":e=>`${F(e)} ${P(e.n,`commit`,`commits`)} ahead`,"git.behind":e=>`${F(e)} ${P(e.n,`commit`,`commits`)} behind`,"git.inSync":`In sync with upstream`,"git.tipHead":`Git repository`,"git.root":`Directory`,"git.branch":`Branch`,"git.upstream":`Upstream`,"git.commit":`Latest commit`,"git.changes":`Changes`,"git.remote":`Remote`,"git.checked":`Read at`,"git.stale":`The last read failed; showing the state from {time}`,"git.part.staged":`{n} staged`,"git.part.unstaged":`{n} unstaged`,"git.part.untracked":`{n} untracked`,"git.part.conflicted":`{n} conflicted`,"folder.head":`Folder`,"folder.label":`Folder: {name}`,"folder.keyboard":`Arrow keys move the Folder node, hold Shift to move faster; Shift+Space selects the node.`,"folder.tipHead":`Working directory`,"folder.path":`Directory`,"folder.count":e=>`${F(e)} Main ${P(e.n,`Agent`,`Agents`)}`,"folder.usedBy":e=>`Used by ${F(e)} Main ${P(e.n,`Agent`,`Agents`)}`,"menu.open":`Open session`,"menu.copyLink":`Copy panel link`,"menu.copyId":`Copy session ID`,"menu.cancelRun":`Interrupt current run`,"menu.cancelRunDisabled":`No run is in progress`,"menu.stopSession":`Close session`,"menu.stopDisabled":`The session is already closed`,"menu.remove":`Delete record`,"menu.removeDisabled":`A running session can't be deleted — interrupt and close it first.`,"confirm.label":`Confirm`,"confirm.stopTitle":`Close this session?`,"confirm.stopBody":`The session disconnects from the harness and can't receive messages any more. Its record is kept.`,"confirm.stopBodyActive":`It is working: the current run is interrupted first, then the session disconnects. Its record is kept.`,"confirm.removeTitle":`Delete this session record?`,"confirm.removeBody":`Everything recorded for “{title}” will be deleted permanently. The native session stored by the harness is not affected.`,"toast.region":`Notifications`,"toast.cancelOk":`Interrupt requested`,"toast.cancelNothing":`Nothing to interrupt right now`,"toast.cancelFailed":`Couldn't interrupt`,"toast.stopOk":`Session closed`,"toast.stopFailed":`Couldn't close the session`,"toast.removeOk":`Record deleted`,"toast.removeFailed":`Couldn't delete the record`,"ctx.sessions":e=>`Of these, ${F(e)} ${P(e.n,`session`,`sessions`)}`,"ctx.copyIds":e=>`Copy session ${P(e.n,`ID`,`IDs`)} (${F(e)})`,"ctx.cancelRuns":e=>`Interrupt current ${P(e.n,`run`,`runs`)} (${F(e)})`,"ctx.stopSessions":e=>`Close ${P(e.n,`session`,`sessions`)} (${F(e)})`,"ctx.removeRecords":e=>`Delete ${P(e.n,`record`,`records`)} (${F(e)})`,"ctx.cancelNone":`None of the selected sessions has a run in progress`,"ctx.stopNone":`All the selected sessions are already closed`,"ctx.removeNone":`All the selected sessions are running and can't be deleted — interrupt and close them first.`,"ctx.undoNone":`{label} (nothing to undo)`,"ctx.redoNone":`{label} (nothing to redo)`,"batch.stopTitle":e=>P(e.n,`Close this session?`,`Close these ${F(e)} sessions?`),"batch.stopConfirm":e=>`Close ${F(e)} ${P(e.n,`session`,`sessions`)}`,"batch.stopBody":e=>{let t=Number(e.active),n=Number(e.skipped);return`These sessions disconnect from their harnesses and can't receive messages any more. Their records are kept.${t>0?` ${t} of them ${P(t,`is`,`are`)} working: the current run is interrupted first, then the session disconnects.`:``}${n>0?` ${n} ${P(n,`other is`,`others are`)} already closed and not affected.`:``}`},"batch.removeTitle":e=>P(e.n,`Delete this session record?`,`Delete these ${F(e)} session records?`),"batch.removeConfirm":e=>`Delete ${F(e)} ${P(e.n,`record`,`records`)}`,"batch.removeBody":e=>{let t=Number(e.skipped);return`Everything recorded for these sessions will be deleted permanently. The native sessions stored by the harnesses are not affected.${t>0?` ${t} other ${P(t,`session is`,`sessions are`)} still running and won't be deleted — interrupt and close ${P(t,`it`,`them`)} first.`:``}`},"batch.result":e=>{let t=Number(e.failed),n=String(e.reason),r=Number(e.ok),i=Number(e.idle),a=[r>0?`${r} done`:``,i>0?`${i} had nothing left to interrupt`:``,t>0?`${t} failed`:``].filter(Boolean);return`${String(e.action)}: ${a.join(`, `)}${t>0&&n?` (${n})`:``}`},"focus.back":`All sessions`,"focus.link":`Link`,"focus.notFoundTitle":`Session not found`,"focus.notFoundBody":`It may have been deleted, or this service instance has no record of it.`,"focus.failedTitle":`Couldn't load the session`,"focus.failedBody":`The session history couldn't be read from the service. Make sure it is still running.`,"focus.removedBanner":`This session's record was deleted. What's shown below is its content from before.`,"focus.tabs":`Session views`,"focus.tab.timeline":`Activity`,"focus.tab.task":`Task`,"focus.tab.summary":`Overview`,"focus.tab.info":`Details`,"timeline.count":e=>`${F(e)} ${P(e.n,`entry`,`entries`)}`,"timeline.expandAll":`Expand all steps`,"timeline.collapseAll":`Collapse steps`,"timeline.older":e=>`Show ${F(e)} earlier`,"timeline.jump":`New activity`,"timeline.latest":`Back to latest`,"timeline.empty":`No events yet.`,"work.running":e=>`Working · ${F(e)} ${P(e.n,`step`,`steps`)}`,"work.done":e=>`Ran ${F(e)} ${P(e.n,`step`,`steps`)}`,"work.older":e=>`Show ${F(e)} earlier ${P(e.n,`step`,`steps`)}`,"work.failed":`{n} failed`,"work.failedTip":`Some steps failed. A failed step doesn't necessarily mean the whole run failed.`,"tool.input":`Input`,"tool.output":`Output`,"tool.exit":`exit {code}`,"tool.files":e=>`${F(e)} ${P(e.n,`file`,`files`)}`,"tool.unfinishedNote":`The harness never reported an end event for this step before the run ended, so its outcome is unknown.`,"tool.status.running":`In progress`,"tool.status.completed":`Completed`,"tool.status.failed":`Failed`,"tool.status.cancelled":`Cancelled`,"tool.status.unfinished":`Unfinished (no end event)`,"file.created":`Created`,"file.modified":`Modified`,"file.deleted":`Deleted`,"file.renamed":`Renamed`,"reasoning.live":`Thinking`,"reasoning.done":`Thought`,"reasoning.note":`This is the reasoning summary the harness exposes, not the model's full train of thought.`,"msg.commentary":`Progress note`,"msg.locate":`Show in timeline`,"msg.kind.task":`Delegation`,"msg.kind.steer":`Steer`,"msg.kind.follow_up":`Follow-up`,"plan.title":`Harness plan`,"question.title":`Question`,"question.label":`Question from the harness`,"question.waiting":`Waiting for an answer`,"question.state.open":`Awaiting an answer`,"question.state.answered":`Answered`,"question.state.declined":`Declined`,"question.state.expired":`Expired`,"question.index":`{i} / {n}`,"question.pickOne":`Pick one`,"question.pickAny":`Pick any`,"question.other":`Other`,"question.otherPlaceholder":`Write your own answer`,"question.textPlaceholder":`Write your answer`,"question.answer":`Answer`,"question.needAnswer":`Every question needs an answer — or choose not to answer`,"question.decline":`Don't answer — let it use its own judgment`,"question.declineTip":`Tell the harness you chose not to answer; it will make a reasonable assumption and continue`,"question.sending":`Handing it to the harness…`,"question.by.user":`You`,"question.note":`Note`,"question.delivery.handedOff":`Handed to the harness`,"question.delivery.handedOffTip":`The harness accepted the reply; Ensemble can't confirm it read and used it.`,"question.delivery.declinedHandedOff":`Harness told to use its own judgment`,"question.expiry.timeout":`Nobody answered in time`,"question.expiry.timeoutTold":`Nobody answered in time; the harness was told to use its own judgment and continue`,"question.expiry.withdrawn":`The harness withdrew the question`,"question.expiry.run_ended":`The run ended, so the harness is no longer waiting`,"question.expiry.cancelled":`The run was cancelled`,"question.expiry.session_closed":`The session was closed`,"question.expiry.restarted":`Ensemble restarted and the connection to the harness was lost`,"question.expiry.not_waiting":`The harness had stopped waiting for this question; the reply was not delivered`,"question.conflict.answered":`This question was just answered — the page will update in a moment.`,"question.conflict.declined":`This question was just declined — the page will update in a moment.`,"question.conflict.expired":`The harness is no longer waiting for this question, so your reply was not delivered.`,"question.conflict.busy":`Someone else is resolving this question — give it a moment.`,"run.marker.queued":`Run {n} · queued`,"run.marker.started":`Run {n} started`,"run.marker.completed":`Run {n} finished`,"run.marker.failed":`Run {n} failed`,"run.marker.cancelled":`Run {n} interrupted`,"error.title":`This run failed`,"error.retryable":`This kind of error can usually be retried — send a follow-up below to let it continue.`,"error.detail":`Original message from the harness`,"code.cancel_failed":`Interrupt request failed`,"code.cancel_unconfirmed":`The harness hasn't confirmed the interrupt`,"code.process_exited":`The harness process exited`,"code.run_ended":`The run ended before this message could be delivered`,"code.service_restarted":`Service restarted; the run was aborted`,"code.service_stopped":`Service stopped; the run was aborted`,"code.model_not_found":`The selected model wasn't found`,"code.auth_failed":`Authentication failed`,"code.rate_limited":`Rate or usage limit hit`,"code.context_overflow":`Context exceeded the model window`,"code.provider_unavailable":`The model provider is temporarily unavailable`,"code.model_error":`The model returned an error`,"code.sandbox_error":`The sandbox refused the operation`,"code.policy_blocked":`Blocked by policy`,"code.fixture_failure":`Simulated failure scenario`,"code.fixture_error":`Simulated run error`,"code.codex.sandbox_mismatch":`Sandbox level differs from the request`,"code.codex.default_model_unavailable":`Default model unavailable; another model is used`,"code.codex.warning":`Codex warning`,"code.codex.config_warning":`Codex config warning`,"code.codex.deprecation":`Codex deprecation notice`,"code.codex.guardian_warning":`Codex safety notice`,"code.codex.compacted":`Conversation context was compacted`,"code.codex.model_rerouted":`The request was rerouted to another model`,"code.codex.world_writable":`Directory is writable by everyone`,"code.codex.mcp_failed":`An MCP server failed to start`,"code.codex.unrequested_turn":`A turn started that Ensemble did not request`,"code.codex.retrying":`Codex hit an error and is retrying`,"code.codex.question_unanswered":`The harness asked a question Ensemble can't relay`,"code.codex.question_secret":`The harness asked for a secret value; Ensemble doesn't relay those`,"code.codex.elicitation_cancelled":`The harness's prompt was cancelled`,"code.codex.unsupported_request":`Unsupported request received and rejected`,"code.pi.auto_retry":`Pi retried automatically`,"code.pi.compaction":`Pi is compacting the context`,"code.pi.compaction_failed":`Context compaction didn't complete`,"code.pi.extension_error":`A Pi extension failed`,"code.pi.extension_dialog":`A Pi extension asked for UI interaction`,"code.pi.extension_notify":`Pi extension notice`,"code.opencode.retry":`OpenCode hit an error and is retrying`,"code.opencode.compaction":`OpenCode is compacting the context`,"code.opencode.compaction_failed":`Context compaction didn't complete`,"code.opencode.permission_allowed":`OpenCode asked for permission; allowed under Full Access`,"code.opencode.permission_rejected":`A read-only run asked OpenCode for more access; refused`,"code.opencode.question_unanswered":`The harness asked a question Ensemble can't relay`,"code.opencode.interrupted":`OpenCode stopped the run on its own`,"code.invalid_request":`The request can't run as written`,"code.session_not_resumable":`This session can no longer be resumed`,"code.steer_reverted":`Cursor couldn't insert the message into the running turn`,"code.steer_failed":`The message wasn't delivered`,"code.cursor.tools":`Tools Cursor offered the model`,"code.cursor.access_violation":`A mutating tool appeared in a read-only session`,"code.cursor.no_stream":`Cursor doesn't stream live steps`,"code.cursor.expired":`The Cursor run expired`,"code.cursor.summary":`Cursor is compacting the context`,"code.cursor.summary_failed":`Context compaction didn't complete`,"code.cursor.task":`Cursor sub-task progress`,"code.cursor.request":`Cursor request id`,"delivery.label":`Delivery progress`,"delivery.step.recorded":`Recorded`,"delivery.step.handed_off":`Handed to harness`,"delivery.step.applied":`Applied`,"delivery.recorded":`Ensemble received and saved it; not handed to the harness yet`,"delivery.queued_ensemble":`Queued, held by Ensemble`,"delivery.queued_harness":`Handed to the harness, waiting in its queue`,"delivery.handed_off":`Handed to the harness; no confirmation that it took effect`,"delivery.applied":`The harness confirmed it was added to the context`,"delivery.failed":`Delivery failed`,"delivery.cancelled":`Withdrawn; it was not delivered`,"queue.run_in_progress":`waiting for the current run to end`,"queue.turn_boundary":`waiting for the current turn boundary`,"queue.session_starting":`waiting for the session to connect`,"queue.capacity":`waiting for a free slot`,"sync.pending":`Not yet shared with main agent`,"sync.delivered":`Shared with main agent`,"sync.pendingTip":`The main agent receives this intervention the next time it calls an Ensemble tool.`,"sync.deliveredTip":`Handed to the main agent with a tool result ({time}).`,"composer.label":`Message to the harness`,"composer.mode":`Send as`,"composer.mode.steer":`Steer`,"composer.mode.followUp":`Queue`,"composer.mode.idle":`Follow up`,"composer.placeholder.steer":`Add or correct {name}'s current direction…`,"composer.placeholder.followUp":`Tell {name} what to do after this run…`,"composer.placeholder.idle":`Continue instructing {name}…`,"composer.placeholder.closed":`Session closed`,"composer.send":`Send`,"composer.cancel":`Interrupt`,"composer.cancelTip":`Interrupt the current run; the session stays`,"composer.sendFailed":`Couldn't send`,"composer.tooLong":`Message exceeds the {max}-character limit`,"composer.noSteer":`This harness can't take a steer mid-run, so the message waits until the run ends.`,"task.origin":`Origin`,"task.brief":`Delegation text`,"task.context":`Context passed in`,"task.prompt":`Prompt actually sent`,"task.copy":`Copy text`,"task.copyPrompt":`Copy full prompt`,"task.noContext":`The origin passed no extra context.`,"task.parent":`Parent session`,"task.parentGone":`The parent session's record no longer exists.`,"task.parentsLabel":`Follows {n} sessions`,"task.parentGoneNamed":`The record of the followed session {id} no longer exists.`,"ctx.text":`Text`,"ctx.snippet":`Snippet`,"handoff.open":`Open the referenced session: {title}`,"handoff.gone":`This session is no longer in Ensemble and can't be opened. Below is what was handed over at the time.`,"handoff.phaseAt":`{phase} at handover`,"handoff.readAt":`Read {time}`,"handoff.result":`Result`,"handoff.files":`Files`,"handoff.error":`Last error`,"handoff.note":`Note`,"handoff.chars":e=>`${F(e)} ${P(e.n,`character`,`characters`)}`,"handoff.fromRun":`From run {run} of {runs}`,"handoff.laterNone":`The newer run {run} produced none`,"handoff.notFinal":`The executor did not mark it as a final answer`,"handoff.cut":`Only the first {sent} of {n} characters were handed over`,"handoff.noResult":`None available`,"handoff.noRuns":`The session had no runs`,"handoff.noText":`Its runs wrote no assistant text`,"handoff.noFinal":`Everything it wrote was marked as progress notes; none as a final answer`,"handoff.pathCount":e=>`${F(e)} ${P(e.n,`path`,`paths`)}`,"handoff.pathsCut":`Only the first {sent} of {n} were listed`,"handoff.filesNone":`No file changes reported`,"handoff.errorNone":`No failure recorded`,"handoff.errorIn":`{code}, run {run}`,"handoff.errorSession":`{code} (session-level)`,"handoff.errorCut":`Message truncated`,"handoff.text":`Handed-over text`,"handoff.textMissing":`The handed-over text can't be found in the saved prompt.`,"handoff.noSample":`There is no record of what was handed over.`,"info.session":`Session`,"info.harness":`Harness`,"info.model":`Model`,"info.modelResolved":`requested {requested} → actual {resolved}`,"info.effort":`Effort`,"info.effortDefault":`Default`,"info.access":`Access`,"info.cwd":`Working directory`,"info.native":`Native session`,"info.nativeTip":`The id the harness keeps for this session; used to resume after a restart.`,"info.id":`Session ID`,"info.created":`Created`,"info.runs":`Runs`,"sum.progress":`Progress`,"sum.children":`Sessions that follow it`,"sum.messages":`Messages`,"sum.files":`File changes`,"sum.usage":`Usage`,"sum.noPlan":`The harness hasn't shared a plan yet.`,"sum.noPlanSupport":`This harness doesn't expose a plan.`,"sum.noFiles":`No file changes recorded yet.`,"sum.noFileEvents":`This harness doesn't report structured file changes; files edited through the shell won't appear here.`,"sum.noUsage":`No usage data yet.`,"sum.noUsageSupport":`This harness doesn't report usage.`,"usage.input":`Input`,"usage.cached":`Cached`,"usage.output":`Output`,"usage.reasoning":`Reasoning`,"usage.fresh":`Fresh input`,"usage.reply":`Other output`,"usage.total":`Total`,"usage.tip":`{label}
19
- {tokens} tokens · {share}`,"usage.totalTip":`{tokens} tokens (input + output)`,"usage.cost":`Cost`,"usage.context":`Context used`,"md.code":`code`,"md.copyCode":`Copy code`,"preview.copy":`Copy`,"preview.truncated":`Content was truncated`,"preview.truncatedChars":`Content was truncated ({n} characters originally)`,"apiError.invalid_request":`Invalid request`,"apiError.not_found":`That session or resource wasn't found`,"apiError.forbidden":`Access denied — reload the page and try again`,"apiError.conflict":`That can't be done in the current state`,"apiError.harness_unavailable":`The harness is unavailable`,"apiError.harness_needs_setup":`The harness still needs setup`,"apiError.access_unsupported":`That harness doesn't support the selected access level`,"apiError.model_settings_unavailable":`Model settings unavailable`,"apiError.model_not_allowed":`That model isn't open for this harness`,"apiError.depth_exceeded":`The delegation nesting limit was reached`,"apiError.session_closed":`The session is closed and can't receive messages`,"apiError.session_not_resumable":`The session was disconnected and its native session can't be resumed`,"apiError.question_unsupported":`That harness can't receive replies to its questions`,"apiError.internal":`Internal service error`,"apiError.network":`Can't reach the Ensemble service`,"setup.codex_not_found":`The Codex CLI wasn't found. Install it, then probe again.`,"setup.codex_login_required":`Codex isn't signed in. Sign in from a terminal, then probe again.`,"setup.codex_no_models":`Codex returned no usable models; check your account and network.`,"setup.codex_probe_failed":`Probing Codex failed`,"setup.pi_not_found":`The Pi CLI wasn't found. Install it, then probe again.`,"setup.pi_no_models":`Pi has no usable model: configure a provider and key first.`,"setup.pi_probe_failed":`Probing Pi failed`,"setup.claude_not_found":`Claude Code was not found. Install it and refresh.`,"setup.claude_login_required":`Claude Code is not signed in. Sign in and refresh.`,"setup.claude_probe_failed":`Claude Code probe failed`,"setup.claude_unsupported":`This Claude Code version lacks the required session interface. Update it and refresh.`,"setup.claude_persistence_disabled":`Claude Code session persistence is disabled, so the same session cannot continue.`,"setup.opencode_not_found":`OpenCode wasn't found. Install it, then probe again.`,"setup.opencode_unsupported":`This OpenCode version is too old: 2.x or newer is required. Update it and probe again.`,"setup.opencode_no_models":"OpenCode has no usable model: connect a provider with `opencode auth login` first.","setup.opencode_probe_failed":`Probing OpenCode failed`,"setup.dsh_not_found":`DSH (DeepSeek Harness) wasn't found. Install it, then probe again.`,"setup.dsh_unsupported":`This DSH version doesn't offer the ACP v1 interface Ensemble needs. Update it and probe again.`,"setup.dsh_no_models":`DSH's acp profile lists no model: check the profile under your DSH home, then probe again.`,"setup.dsh_probe_failed":`Probing DSH failed`,"setup.cursor_sdk_missing":`The Cursor SDK (@cursor/sdk) isn't installed. It ships native components and its license doesn't allow bundling it into the plugin, so it's installed only after you confirm.`,"setup.cursor_login_required":`Cursor has no credentials: set the CURSOR_API_KEY environment variable, or sign in with the command below.`,"setup.cursor_auth_rejected":`Cursor rejected the current credentials: sign in again, or create a new API key.`,"setup.cursor_no_models":`Cursor returned no usable models; check your account and subscription.`,"setup.cursor_probe_failed":`Probing Cursor failed`,"setup.withReason":`{headline}: {reason}`,"setup.probe_failed":`Probing the harness failed`,"rail.label":`Workspace navigation`,"rail.active":`Active now`,"rail.all":`All workspaces`,"rail.sectionActive":`Active`,"rail.sectionRecent":`Recent`,"rail.sectionEarlier":`Earlier ({n})`,"rail.collapse":`Collapse sidebar ({keys})`,"rail.expand":`Expand sidebar ({keys})`,"rail.switchTip":`Quick switch ({keys})`,"rail.empty":`No delegations yet`,"rail.siblings":`Sessions here`,"rail.moreSessions":`{n} more`,"view.mode":`View mode`,"view.canvas":`Canvas`,"view.list":`List`,"view.workingOnly":`Working`,"view.activeSubtitle":e=>`${Number(e.running)} running · ${Number(e.total)} working · ${F(e)} ${P(e.n,`Main Agent`,`Main Agents`)}`,"view.activeEmptyTitle":`No active sessions right now`,"view.activeEmptySub":`Pick any Main Agent from the sidebar to review history. New delegations are started by the main Agent through Ensemble's MCP tools.`,"view.allSubtitle":e=>`${F(e)} ${P(e.n,`Main Agent`,`Main Agents`)} · ${Number(e.total)} ${P(e.total,`session`,`sessions`)}`,"view.listEmpty":`No matching sessions here`,"view.filesChanged":e=>`${F(e)} ${P(e.n,`file`,`files`)} changed`,"switcher.title":`Quick switch`,"switcher.placeholder":`Search Main Agents or sessions…`,"switcher.scopeAll":`All`,"switcher.scopeWorkspaces":`Main Agents`,"switcher.scopeSessions":`Sessions`,"switcher.activeOnly":`Active only`,"switcher.empty":`No matching workspaces or sessions`,"menu.archive":`Archive`,"menu.archiveTree":e=>`Archive (with ${F(e)} child ${P(e.n,`session`,`sessions`)})`,"menu.unarchive":`Unarchive`,"menu.exportMd":`Export Markdown`,"menu.exportMdTree":e=>`Export Markdown (with ${F(e)} child ${P(e.n,`session`,`sessions`)})`,"menu.exportMdTreeAny":`Export Markdown (with child sessions)`,"menu.exportMdFull":`Export Markdown (with tool output)`,"origin.menuArchive":e=>`Archive this whole Main Agent space (${F(e)} ${P(e.n,`session`,`sessions`)})`,"origin.menuArchivePart":e=>`Archive finished sessions (${F(e)} ${P(e.n,`session`,`sessions`)}; the rest stay)`,"origin.menuArchiveNone":`Archive this whole Main Agent space`,"ctx.archiveSelected":e=>`Archive selected (${F(e)} ${P(e.n,`session`,`sessions`)})`,"export.failed":`Export failed`,"archive.title":`Archived`,"archive.subtitle":e=>`${F(e)} ${P(e.n,`session`,`sessions`)}`,"archive.note":`Archived sessions no longer appear on the canvas, sidebar or lists. Their records are kept as they were, and you can unarchive or export them at any time.`,"archive.empty":`No archived sessions yet`,"archive.unsupported":`The running service doesn't support archiving yet.`,"archive.loading":`Loading archived sessions…`,"archive.loadFailed":`Couldn't load archived sessions`,"archive.children":e=>`${F(e)} ${P(e.n,`child`,`children`)}`,"archive.childrenAny":`Has child sessions`,"archive.auto":`Auto-archived`,"archive.autoTip":`Archived automatically by the retention policy, not by hand.`,"archive.archivedAt":`Archived {time}`,"archive.more":e=>`Show more (${F(e)} more)`,"archive.unarchiveOf":`Unarchive “{title}”`,"archive.exportOf":`Export “{title}”`,"archive.retentionLink":`Retention`,"archive.retentionLinkTip":`Set up automatic archiving under Settings → History`,"archive.chip":`Archived`,"archive.chipTip":`This session is archived: it's off the canvas, sidebar and lists, and its record is kept as it was.`,"archive.banner":`Archived {time}: this session is off the canvas, sidebar and lists, and its record is kept as it was. Unarchiving restores it together with its child sessions and any parents that are still archived; sending it a message unarchives it first.`,"archive.bannerAuto":`The retention policy archived this session automatically on {time}: it is off the canvas, sidebar and lists, and its record is kept as it was. Unarchiving restores it together with its child sessions and any parents that are still archived; sending it a message unarchives it first.`,"archive.unarchiveTip":`Unarchive: restores it together with its child sessions and any parents that are still archived`,"archive.finished":`Archive finished sessions`,"archive.finishedTip":e=>`Archive ${F(e)} finished ${P(e.n,`session`,`sessions`)} (failed, interrupted, closed and disconnected count as finished; a task tree is archived only once every session in it has finished)`,"archive.busy":`Another archive action is still in progress`,"archive.nothing":`Nothing to archive: a task tree can only be archived once every session in it has finished`,"archive.blockedWorking":e=>`${F(e)} ${P(e.n,`session is`,`sessions are`)} still working; archive once ${P(e.n,`it has`,`they have`)} finished`,"archive.blockedIdle":e=>`${F(e)} ${P(e.n,`session is`,`sessions are`)} idle but still open (not finished); close ${P(e.n,`it`,`them`)} to archive`,"archive.blockedPending":e=>`${F(e)} ${P(e.n,`session has`,`sessions have`)} unconfirmed messages; archive once ${P(e.n,`that is`,`those are`)} settled`,"archive.keptWorking":e=>`; ${F(e)} still working, kept`,"archive.keptIdle":e=>`; ${F(e)} idle, kept`,"archive.keptPending":e=>`; ${F(e)} with unconfirmed messages, kept`,"archive.keptFollowing":e=>`; ${F(e)} ${P(e.n,`session also follows`,`sessions also follow`)} a session that is not archived, kept`,"archive.done":e=>`Archived ${F(e)} ${P(e.n,`session`,`sessions`)}`,"archive.undo":`Undo`,"archive.failed":`Archive failed`,"archive.noneActive":`Nothing was archived: those sessions haven't all finished`,"archive.noneMissing":`Nothing was archived: those sessions couldn't be found and may have been deleted`,"archive.noneAlready":`Those sessions are already archived`,"archive.confirmTitle":e=>`Archive ${F(e)===1?`this session`:`these ${F(e)} sessions`}?`,"archive.confirmBody":e=>{let t=F(e),n=Number(e.carried),r=Number(e.kept);return`${t===1?`This session moves`:`These ${t} sessions move`} off the canvas, sidebar and lists. Records are kept as they were, and you can unarchive from “Archived” at any time.${n>0?` Includes ${n} child ${P(n,`session`,`sessions`)} that ${P(n,`goes`,`go`)} with their parents.`:``}${r>0?` ${r} unfinished ${P(r,`session stays`,`sessions stay`)} where ${P(r,`it is`,`they are`)}.`:``}`},"archive.confirmAction":e=>`Archive ${F(e)} ${P(e.n,`session`,`sessions`)}`,"archive.unarchiveFailed":`Unarchive failed`,"archive.unarchived":e=>`Unarchived ${F(e)} ${P(e.n,`session`,`sessions`)}`,"archive.unarchivedCarried":e=>` (${F(e)} came back with it as ${P(e.n,`a parent or child`,`parents or children`)})`,"archive.unarchiveMissing":`Nothing was unarchived: that session couldn't be found and may have been deleted`,"archive.unarchiveNone":`Those sessions weren't archived`,"archive.spaceGone":`Every session under “{name}” is archived. Switched to “{target}”.`,"history.summary":e=>`${F(e)} archived`,"history.unsupported":`The running service doesn't support archiving yet`,"history.unsupportedNote":`Once the service is updated to a version that supports archiving, archived sessions and the retention policy appear here.`,"history.sessions":`Sessions`,"history.sessionsNote":e=>`${F(e)} unarchived, ${Number(e.m)} archived. Archived sessions no longer appear on the canvas, sidebar or lists; their records are kept as they were and can be unarchived at any time.`,"history.view":`View archived`,"history.retention":`Retention`,"history.retentionIntro":`A retention policy only archives sessions; it never deletes any record. Saving sweeps once right away, and the service sweeps periodically after that. A task tree with a session still working is never archived. The two limits are independent; with both off, nothing is archived automatically (the default).`,"history.retentionLoading":`Loading the retention policy…`,"history.retentionUnavailable":`Couldn't load the retention policy`,"history.lastSweep":e=>`Last sweep: ${String(e.time)}, archived ${F(e)} ${P(e.n,`session`,`sessions`)}`,"history.invalid":`Enter a whole number from {min} to {max}. This hasn't been saved.`,"history.keepDaysName":`Keep by age`,"history.keepDaysLead":`Keep the last`,"history.keepDaysNote":`Finished task trees whose last activity is older than this are archived.`,"history.keepDaysValue":`Days to keep`,"history.unitDay":`day`,"history.unitDays":`days`,"history.keepCountName":`Keep by count`,"history.keepCountLead":`Keep at most`,"history.keepCountNote":`Task trees are counted from the most recent activity; finished ones beyond this number are archived. A tree with a session still working takes a slot but is never archived.`,"history.keepCountValue":`Number of task trees to keep`,"history.unitTree":`task tree`,"history.unitTrees":`task trees`}};function tt(){try{let e=localStorage.getItem(`ensemble.lang`);if(e===`zh`||e===`en`)return e}catch{}return(navigator.languages?.length?navigator.languages:[navigator.language]).some(e=>e.toLowerCase().startsWith(`zh`))||nt()===`zh`?`zh`:`en`}function nt(){return document.querySelector(`meta[name="ensemble-lang"]`)?.getAttribute(`content`)??null}function rt(e,t){return typeof e==`function`?e(t??{}):t?e.replace(/\{(\w+)\}/g,(e,n)=>n in t?String(t[n]):e):e}function it(e,t,n){let r=et[e][t]??et.zh[t];return r===void 0?t:rt(r,n)}function at(e){return(t,n)=>it(e,t,n)}var ot=class{state;listeners=new Set;constructor(e){this.state=e}get=()=>this.state;set(e){let t=typeof e==`function`?e(this.state):e,n=!1;for(let e of Object.keys(t))if(!Object.is(this.state[e],t[e])){n=!0;break}if(n){this.state={...this.state,...t};for(let e of[...this.listeners])e()}}subscribe=e=>(this.listeners.add(e),()=>this.listeners.delete(e))};function I(e,t){let n=(0,l.useRef)(void 0),r=()=>{let r=e.get();return n.current?.state!==r&&(n.current={state:r,value:t(r)}),n.current.value};return(0,l.useSyncExternalStore)(e.subscribe,r,r)}function st(e,t){return e.createdAt===t.createdAt?e.id<t.id?-1:+(e.id>t.id):e.createdAt<t.createdAt?-1:1}var ct=Object.freeze([]),lt=Object.freeze([]);function ut(e,t,n){let r=e.get(t);r?r.push(n):e.set(t,[n])}function dt(e){let t=new Map(e.map(e=>[e.id,e])),n=new Map,r=e=>{let r=n.get(e);if(r)return r;let i=t.get(e);if(!i)return ct;let a=C(i).filter(e=>t.has(e));return n.set(e,a),a},i,a=()=>{if(i)return i;let t=new Map,n=new Map;for(let i of[...e].sort(st))r(i.id).forEach((e,r)=>{ut(n,e,i),r===0&&ut(t,e,i)});return i={tree:t,all:n},i};return{sessions:e,byId:t,parentsOf:r,firstParentOf:e=>r(e)[0],treeChildrenOf:e=>a().tree.get(e)??lt,childrenOf:e=>a().all.get(e)??lt}}function ft(e){return pt(dt(e))}function pt(e){let t=new Map,n=t=>e.byId.get(t).origin.key;for(let r of e.sessions){if(t.has(r.id))continue;let i=[],a=new Set,o={kind:`root`},s=r.id;for(;s!==void 0;){let n=t.get(s);if(n!==void 0){o={kind:`known`,key:n};break}if(a.has(s)){o={kind:`cycle`,at:i.indexOf(s)};break}a.add(s),i.push(s),s=e.firstParentOf(s)}if(o.kind===`known`)for(let e of i)t.set(e,o.key);else if(o.kind===`root`){let e=n(i[i.length-1]);for(let n of i)t.set(n,e)}else{let{at:e}=o,r=n(i[e]);i.forEach((i,a)=>t.set(i,a>=e?n(i):r))}}return t}function mt(e){let t=dt(e),n=[];for(let e of t.sessions){let r=t.parentsOf(e.id),i=r.length>1?r.filter(t=>t!==e.id):r;i.length>1&&n.push({id:e.id,parents:i})}return{graph:t,keys:pt(t),joins:n}}function ht({graph:e,keys:t,joins:n},r){let i=new Set;for(let[e,n]of t)r.has(n)&&i.add(e);if(i.size===0||n.length===0)return i;let a=t=>e.treeChildrenOf(t).map(e=>e.id);for(let e=!0;e;){e=!1;for(let t of n)if(i.has(t.id)&&!t.parents.every(e=>i.has(e)))for(let n of[t.id,...T([t.id],a)])i.delete(n)&&(e=!0)}return i}function gt(e,t){return t.size===0?new Set:ht(mt(e),t)}function _t(e){let t=mt(e),n=new Map;for(let e of t.keys.values())n.set(e,(n.get(e)??0)+1);if(t.joins.length>0)for(let e of[...n.keys()])n.set(e,ht(t,new Set([e])).size);return n}var vt=Date.now(),yt=new Set,bt;function xt(e){return yt.add(e),bt||=(vt=Date.now(),setInterval(()=>{vt=Date.now();for(let e of[...yt])e()},1e3)),()=>{yt.delete(e),yt.size===0&&bt&&(clearInterval(bt),bt=void 0)}}function St(){return(0,l.useSyncExternalStore)(xt,()=>vt)}function Ct(e){let t=Math.max(0,Math.floor(e/1e3)),n=Math.floor(t/3600),r=Math.floor(t%3600/60),i=t%60,a=String(i).padStart(2,`0`);return n>0?`${n}:${String(r).padStart(2,`0`)}:${a}`:`${r}:${a}`}function wt(e){return!Number.isFinite(e)||e<0?``:e<1e3?`${Math.max(1,Math.round(e))}ms`:e<1e4?`${(e/1e3).toFixed(1)}s`:v(e)}function Tt(e){let t=new Date(e);return Number.isNaN(t.getTime())?``:t.toLocaleTimeString([],{hour12:!1})}function Et(e,t,n=!1){let r=new Date(e);if(Number.isNaN(r.getTime()))return``;let i=r.toLocaleTimeString(`en-GB`,{hour:`2-digit`,minute:`2-digit`,hourCycle:`h23`});if(n){let e=e=>String(e).padStart(2,`0`);return`${r.getFullYear()}-${e(r.getMonth()+1)}-${e(r.getDate())} ${i}`}return t===`zh`?`${r.getFullYear()}年${r.getMonth()+1}月${r.getDate()}日 ${i}`:`${r.toLocaleDateString(`en-US`,{month:`short`,day:`numeric`,year:`numeric`})} ${i}`}function Dt(e,t){let n=new Date(e);return Number.isNaN(n.getTime())?``:n.toLocaleString(t===`zh`?`zh-CN`:`en-US`,{hour12:!1,month:`short`,day:`numeric`,hour:`2-digit`,minute:`2-digit`,second:`2-digit`})}function Ot(e,t,n){let r=Math.max(0,Math.floor((t-Date.parse(e))/1e3));if(r<8)return n(`time.justNow`);if(r<60)return n(`time.seconds`,{n:r});let i=Math.floor(r/60);if(i<60)return n(`time.minutes`,{n:i});let a=Math.floor(i/60);return a<24?n(`time.hours`,{n:a}):n(`time.days`,{n:Math.floor(a/24)})}function kt(e,t){let n=e.lastRun;if(e.activeRunId&&n?.startedAt)return t-Date.parse(n.startedAt);if(n?.durationMs!==void 0)return n.durationMs;if(n?.startedAt&&!n.endedAt)return t-Date.parse(n.startedAt)}function At(e,t){return p(e.replace(/^[a-z]+_/i,``),t)}function jt(e){return e===void 0?void 0:y(e)}function Mt(e,t=140){let n=h(e);return n.length>t?`${p(n,t-1).trimEnd()}…`:n}var Nt=RegExp('(?<fence>(?:`{3,}|~{3,})(?:[\\w+#.-]+(?=\\s|$))?)|(?<tick>`{1,2})(?<code>[^`]+?)\\k<tick>|!?\\[(?<label>[^\\]]*)\\]\\([^)\\s]*(?:\\s+"[^"]*")?\\)|(?<![\\w*/\\\\])\\*\\*(?=\\S)(?<bold>.+?)(?<=\\S)\\*\\*(?![\\w*/\\\\])|(?<![\\w~])~~(?=\\S)(?<strike>.+?)(?<=\\S)~~(?![\\w~])|(?<![\\w*/\\\\])\\*(?=[\\p{L}\\p{N}])(?<italic>[^*]+?)(?<=\\S)\\*(?![\\w*/\\\\])|(?<=^|\\s)(?<hash>#{1,6})(?=\\s)',`gu`);function Pt(e){return e.replace(Nt,(...e)=>{let t=e.at(-1);if(t.code!==void 0)return t.code;let n=t.label??t.bold??t.strike??t.italic;return n===void 0?t.fence===void 0?``:` `:Pt(n)})}function Ft(e){return h(Pt(e))}function It(e){let t=e.replace(/[\\/]+$/,``),n=Math.max(t.lastIndexOf(`/`),t.lastIndexOf(`\\`));return n>=0?t.slice(n+1):t}function Lt(e,t){return t(`phase.${e}`)}var Rt={read:`act.read`,write:`act.write`,edit:`act.write`,search:`act.search`,shell:`act.shell`,web:`act.web`,mcp:`act.mcp`,task:`act.task`,plan:`act.plan`,other:`act.other`};function zt(e,t){return t(Rt[e])}function Bt(e,t){return t(`activity.${e}`)}function Vt(e,t){let{activity:n}=e;switch(e.phase){case`running`:return e.openQuestions?t(`question.waiting`):n.kind===`tool`&&n.tool?`${zt(n.tool.category,t)} ${Mt(n.tool.title,80)}`:Bt(n.kind,t);case`done`:{let n=e.lastAssistantPreview?Ft(e.lastAssistantPreview):``;return n?Mt(n,90):t(`activity.done`)}case`failed`:return e.lastError?Mt(e.lastError.message,90):t(`activity.failed`);case`ready`:return Bt(`ready`,t);default:return Bt(n.kind,t)}}function Ht(e){return e===`running`||e===`starting`||e===`queued`}var Ut={quiet:`attention.quiet`,long_tool:`attention.longTool`,long_run:`attention.longRun`,shared_file:`attention.sharedFile`,undelivered:`attention.undelivered`,question:`attention.question`};function Wt(e,t,n){let r=v(t-Date.parse(e.since));switch(e.kind){case`quiet`:case`long_run`:return n(Ut[e.kind],{d:r});case`long_tool`:return n(Ut.long_tool,{d:r,tool:`${zt(e.tool.category,n)} ${Mt(e.tool.title,60)}`,started:v(t-Date.parse(e.tool.startedAt))});case`shared_file`:return n(Ut.shared_file,{file:It(e.path),n:e.withSessionIds.length,d:r});case`undelivered`:return n(Ut.undelivered,{kind:n(`msg.kind.${e.messageKind}`),d:r,state:n(`delivery.${e.stage}`)});case`question`:return n(Ut.question,{q:ie(e.prompts,100),d:r})}}function Gt(e,t,n){return[n(`attention.title`),...e.map(e=>Wt(e,t,n))].join(`
20
- `)}var L={agentW:248,agentH:112,originW:212,originH:112,gitW:212,gitH:112,folderW:212,folderH:112,agentWCompact:208,originWCompact:150,rowGap:24,stagger:24,originGap:92,childGap:92,originGapCompact:28,childGapCompact:48,groupGap:56,clusterGap:88},Kt=720;function R(e){return e!==void 0&&e.w<Kt}var qt=.3,Jt=.16,Yt=.72,Xt=.985;function Zt(e){return e<640?{top:96,right:20,bottom:56,left:20}:{top:126,right:56,bottom:64,left:56}}function Qt(e,t){let n=Zt(e);return{w:Math.max(120,e-n.left-n.right),h:Math.max(120,t-n.top-n.bottom)}}function $t(e,t,n=qt,r=!1){if(e.w<=0||e.h<=0)return 1;let i=t.w/e.w,a=t.h/e.h;return r?Math.min(1,Math.max(Math.min(n,Jt),Math.min(i,a))):Math.min(1,Math.max(n,Math.min(i,Math.max(a,Yt))))}function en(e,t,n){let r=Math.max(Jt,n);if(e.w<=0||e.h<=0)return r;let i=Math.min(t.w/e.w,t.h/e.h);return i>=r*Xt?r:Math.max(Jt,i)}function tn(e,t,n,r=!1,i){if(e.w<=0||e.h<=0||t.w<=0||t.h<=0)return{x:0,y:0,k:1};let a=Math.max(120,t.w-n.left-n.right),o=Math.max(120,t.h-n.top-n.bottom),s={w:a,h:o},c=i===void 0?$t(e,s,qt,r):en(e,s,i),l=i===void 0?1:1/Xt,u=e.w*c,d=e.h*c;return{x:u<=a*l?n.left+(a-u)/2-e.x*c:n.left-e.x*c,y:d<=o*l?n.top+(o-d)/2-e.y*c:n.top-e.y*c,k:c}}function nn(e){if(e.length===0)return{x:0,y:0,w:0,h:0};let t=1/0,n=1/0,r=-1/0,i=-1/0;for(let a of e)t=Math.min(t,a.x-a.overhang.left),n=Math.min(n,a.y),r=Math.max(r,a.x+a.w+a.overhang.right),i=Math.max(i,a.y+a.h);return{x:t,y:n,w:r-t,h:i-n}}var rn={cols:1,rows:1,inner:0};function an(e,t,n){return{kidsOf:e,maxWidth:Math.max(1,Math.floor(t)),cache:new Map,...n?{column:n}:{},sizes:new Map}}function on(e,t){return{...e,kidsOf:t,cache:new Map,sizes:new Map}}function sn(e,t){let n=e.sizes.get(t);if(n!==void 0)return n;let r=0;for(let n of e.kidsOf(t))r+=1+sn(e,n);return e.sizes.set(t,r),r}function cn(e){let t=0,n=0;return{spots:e.map(e=>{let r={col:0,row:t};return t+=e.rows,n=Math.max(n,e.cols),r}),cols:n,rows:t}}function ln(e){let t=[...e].sort((e,t)=>e.cols-t.cols||e.rows-t.rows),n=[],r=1/0;for(let e of t)e.rows<r&&(n.push(e),r=e.rows);return n}function un(e,t){let n;for(let r of e){if(r.cols>t)break;n=r}return n}var dn=e=>Math.floor((e.rows-1)/2);function fn(e,t){let n=Math.max(t,...e.map(e=>e.cols)),r=new Uint8Array(n*Math.max(1,e.reduce((e,t)=>e+t.rows,0))),i=[],a=0,o=0,s=(e,t,i)=>{if(!e.stack&&r[(i+dn(e))*n+t])return!1;for(let a=i;a<i+e.rows;a++)for(let i=e.stack?t:t+1;i<t+e.cols;i++)if(r[a*n+i])return!1;return!0},c=e=>{for(let t=0;;t++)for(let r=0;r+e.cols<=n;r++)if(s(e,r,t))return{col:r,row:t}};for(let t of e){let e=c(t);i.push(e),t.stack||(r[(e.row+dn(t))*n+e.col]=1);for(let i=e.row;i<e.row+t.rows;i++)for(let a=t.stack?e.col:e.col+1;a<e.col+t.cols;a++)r[i*n+a]=1;a=Math.max(a,e.col+t.cols),o=Math.max(o,e.row+t.rows)}return{spots:i,cols:a,rows:o}}function pn(e,t){let n=e.cache.get(t);if(n)return n;let r=e.kidsOf(t),i;if(r.length===0)i={block:[],shapes:[rn]};else if(e.column?.(t,sn(e,t))){let{cols:t,rows:n}=cn(r.map(t=>pn(e,t).shapes[0])),a=n>1?{cols:t,rows:n,inner:t,stack:!0}:{cols:t,rows:n,inner:t};i={block:[a],shapes:[{...a,cols:t+1}]}}else{let t=r.map(t=>pn(e,t).shapes),n=Math.max(...t.map(e=>e[0].cols)),a=t.reduce((e,t)=>e+t.at(-1).cols,0),o=[];for(let r=n;r<=Math.max(n,Math.min(e.maxWidth,a));r++){let{cols:e,rows:n}=fn(t.map(e=>un(e,r)),r);o.push({cols:e,rows:n,inner:r})}let s=ln(o);i={block:s,shapes:s.map(e=>({cols:e.cols+1,rows:e.rows,inner:e.inner}))}}return e.cache.set(t,i),i}function mn(e,t,n,r,i,a,o=!1){let s=e.kidsOf(t),c=s.map(t=>un(pn(e,t).shapes,n)),{spots:l}=o?cn(c):fn(c,n);s.forEach((t,n)=>{let o=l[n];hn(e,t,c[n],r+o.col,i+o.row,a)})}function hn(e,t,n,r,i,a){n.inner===0?a.set(t,{col:r,row:i}):(a.set(t,{col:r,row:i+dn(n)}),mn(e,t,n.inner,r+1,i,a,n.stack===!0))}function gn(e){let{ordered:t,drawn:n,layoutParentOf:r}=e,i=new Map,a=new Map;if(!t.some(e=>(n.get(e)?.length??0)>1))return{columnOf:i,joins:a};let o=new Map,s=t=>{let n=[],i=t,a;for(;i!==void 0&&(a=o.get(i),a===void 0);)n.push(i),i=r.get(i);a??=e.originKeyOf(n[n.length-1]);for(let e of n)o.set(e,a);return a},c=e=>(n.get(e)??[]).filter(t=>s(t)===s(e));for(let[e,n]of D(t,c).depths)i.set(e,n);for(let n of t){let t=c(n);t.length>1&&a.set(e.nodeId(n),t.map(e.nodeId))}return{columnOf:i,joins:a}}function _n(e,t,n,r,i){let a=e=>{let i=new Map;return mn(e,t,r,+!n,+!!n,i),i},o=a(e);if(!i||i.size===0)return{spots:o,moved:!1};let s={row:+!!n,col:+!n},c=Cn(new Map(o),i,e.kidsOf,s);if(c.length===0)return{spots:o,moved:!1};let l=new Set(c),u=a(on(e,t=>e.kidsOf(t).filter(e=>!l.has(e))));for(let t of c){let n=(i.get(t)??[]).flatMap(e=>u.get(e)??[]);wn(u,xn(o,t,e.kidsOf),Math.max(s.col,yn(n)),bn(n,s.row),s.row)}return Cn(u,i,e.kidsOf,s),{spots:u,moved:!0}}var vn=(e,t)=>t*4096+e,yn=e=>e.reduce((e,t)=>Math.max(e,t.col+1),0),bn=(e,t)=>e.length===0?t:Math.round(e.reduce((e,t)=>e+t.row,0)/e.length);function xn(e,t,n){let r=e.get(t);return Sn(e,t,n).map(t=>{let n=e.get(t);return{member:t,dc:n.col-r.col,dr:n.row-r.row}})}function Sn(e,t,n){let r=[],i=t=>{if(e.has(t)){r.push(t);for(let e of n(t))i(e)}};return i(t),r}function Cn(e,t,n,r){let i=[];for(let[a,o]of t){let t=e.get(a);if(!t)continue;let s=o.flatMap(t=>e.get(t)??[]),c=yn(s);if(t.col>=c)continue;let l=xn(e,a,n);for(let{member:t}of l)e.delete(t);wn(e,l,c,bn(s,r.row),r.row),i.push(a)}return i}function wn(e,t,n,r,i){let a=new Set,o=i-1;for(let t of e.values())a.add(vn(t.col,t.row)),o=Math.max(o,t.row);let s=e=>t.every(({dc:t,dr:r})=>e+r>=i&&!a.has(vn(n+t,e+r))),c=Math.min(...t.map(({dr:e})=>e)),l=o-i+t.length+1,u=(()=>{for(let e=0;e<=l;e++){if(s(r+e))return r+e;if(e>0&&s(r-e))return r-e}return o+1-c})();for(let{member:r,dc:i,dr:a}of t)e.set(r,{col:n+i,row:u+a})}var Tn=e=>`origin:${e}`,En=e=>`git:${e}`,Dn=e=>`folder:${e}`,On=e=>`agent:${e}`,kn={left:0,right:0};function An(e,t){let n=t.visible?e.filter(e=>t.visible.has(e.id)):e,r=dt(n),i=Mn(n,r),a=[...n].sort(st),{layoutParentOf:o,children:s,roots:c}=Nn(a,i),{columnOf:l,joins:u}=gn({ordered:a.map(e=>e.id),drawn:i,layoutParentOf:o,originKeyOf:e=>r.byId.get(e).origin.key,nodeId:On}),d=Pn(e),f=Fn(e,n,r,c,t.collapsed),p=f.map(({key:e})=>d.get(e));return{placedCount:n.length,ordered:a,drawn:i,children:s,roots:c,columnOf:l,joins:u,byOrigin:d,order:f,origins:p}}function jn(e,t){return t?new Set(e.filter(e=>!t.has(e.id)).map(e=>On(e.id))):void 0}function Mn(e,t){let n=t.parentsOf,r=new Map;for(let t of e)r.set(t.id,n(t.id).filter(e=>!E(t.id,e,n)));return r}function Nn(e,t){let n=new Map,r=new Map,i=new Map;for(let a of e){let e=t.get(a.id)?.[0];if(e!==void 0){i.set(a.id,e);let t=n.get(e);t?t.push(a):n.set(e,[a])}else{let e=r.get(a.origin.key);e?e.push(a):r.set(a.origin.key,[a])}}return{layoutParentOf:i,children:n,roots:r}}function Pn(e){let t=new Map,n=new Map,r=new Map;for(let i of e){let e=t.get(i.origin.key)??{origin:i.origin,count:0,running:0,startedAt:i.createdAt};i.origin.workspace&&i.createdAt>=(r.get(i.origin.key)??``)&&(e.origin=i.origin,r.set(i.origin.key,i.createdAt)),e.count+=1,i.phase===`running`&&(e.running+=1),i.createdAt<e.startedAt&&(e.startedAt=i.createdAt);let a=i.origin.hostTitle;a&&i.createdAt>=(n.get(i.origin.key)??``)&&(e.hostTitle=a,n.set(i.origin.key,i.createdAt)),t.set(i.origin.key,e)}return t}function Fn(e,t,n,r,i){let a=new Map,o;for(let s of i??[]){if(r.has(s))continue;o??=t===e?n:dt(e);let i=In(o,s);i!==void 0&&a.set(s,i)}let s=[...r].map(([e,t])=>({key:e,at:t[0].createdAt}));for(let[e,t]of a)s.push({key:e,at:t});return a.size>0&&s.sort((e,t)=>e.at<t.at?-1:+(e.at>t.at)),s}function In(e,t){let n;for(let r of e.sessions)r.origin.key===t&&e.firstParentOf(r.id)===void 0&&(n===void 0||r.createdAt<n)&&(n=r.createdAt);return n}var Ln=32,Rn=24,zn=16;function Bn(e){let t=e?L.agentWCompact:L.agentW,n=e?L.originWCompact:L.originW,r=e?Rn:Ln,i=e?zn:L.rowGap;return{agentW:t,originW:n,gapX:r,gapY:i,pitchX:t+r,pitchY:L.agentH+i}}var Vn=(e,t)=>t*e.pitchX-e.gapX,Hn=(e,t)=>t*e.pitchY-e.gapY,Un={rows:0,cols:0};function Wn(e,t,n,r){let{block:i}=pn(e,t);if(i.length===0)return[{cols:1,rows:1,top:n===`top`,inner:0}];let a=i.map(e=>({cols:e.cols+1,rows:e.rows,top:!1,inner:e.inner})),o=i.map(e=>({cols:e.cols,rows:e.rows+1,top:!0,inner:e.inner})),s=ln(n===`top`?o:n===`left`?a:[...o,...a]);return r&&Gn(e,t,r)?ln(s.map(n=>Kn(e,t,n,r))):s}function Gn(e,t,n){let r=[t];for(let t=r.pop();t!==void 0;t=r.pop()){if(n.has(t))return!0;r.push(...e.kidsOf(t))}return!1}function Kn(e,t,n,r){let{spots:i,moved:a}=_n(e,t,n.top,n.inner,r);if(!a)return n;let o=+!n.top,s=+!!n.top;for(let e of i.values())o=Math.max(o,e.col+1),s=Math.max(s,e.row+1);return{...n,cols:o,rows:s}}function qn(e,t,n,r,i){let a=new Map,o=e=>({x:e.col*r.pitchX,y:e.row*r.pitchY});if(n.inner===0)return a.set(t,{x:0,y:0}),a;a.set(t,n.top?{x:Math.round((Vn(r,n.cols)-r.originW)/2),y:0}:o({col:0,row:dn(n)}));for(let[r,s]of _n(e,t,n.top,n.inner,i).spots)a.set(r,o(s));return a}function Jn(e,t,n){let r=new Map(e.map(e=>[e.id,e])),i=e=>{let t=r.get(e);if(!t)return;let a;for(let o of n(e)){let e=r.get(o);e&&(e.anchor=a?{id:a.id,dx:0,dy:a.h+L.rowGap}:{id:t.id,dx:e.x-t.x,dy:e.y-t.y},a=e,i(o))}};i(t)}var Yn=/^[A-Za-z]:(?=[\\/]|$)/,Xn=/^[\\/]{2}[?.][\\/](?:(UNC)[\\/])?/i;function Zn(e){let t=e.trim();if(!t)return``;let n=Xn.exec(t);if(n){let e=t.slice(n[0].length);n[1]?t=`\\\\${e}`:Yn.test(e)&&(t=e)}let r=Yn.test(t)||/^[\\/]{2}[^\\/]/.test(t),i=r?t.replaceAll(`\\`,`/`):t,a=``,o=i;if(Yn.test(i))a=i.slice(0,2),o=i.slice(2);else if(r){let e=/^\/\/([^/]+)(?:\/([^/]+))?/.exec(i);a=e?e[0]:``,o=i.slice(a.length)}let s=[];for(let e of o.split(`/`))e!==``&&e!==`.`&&(e===`..`?s.pop():s.push(e));let c=a!==``||o.startsWith(`/`),l=`${a}${c?`/`:``}${s.join(`/`)}`;return r?l.toLowerCase():l}var Qn=e=>e.length-e.replace(/[\\/]+$/,``).length;function $n(e,t){let n=Qn(e)-Qn(t);return n===0?e<=t?e:t:n<0?e:t}function er(e){let t=new Map;for(let[n,r]of e){let e=Zn(r);if(!e)continue;let i=r.trim(),a=t.get(e);a?(a.path=$n(a.path,i),a.origins.push(n)):t.set(e,{path:i,origins:[n]})}return[...t].sort(([e],[t])=>e<t?-1:+(e>t)).map(([e,{path:t,origins:n}])=>({key:e,path:t,origins:n.sort()}))}function tr(e){return It(e)||e}function nr(e){let t=e.trim().replace(/[\\/]+$/,``),n=Math.max(t.lastIndexOf(`/`),t.lastIndexOf(`\\`));if(n<0)return``;let r=t.slice(0,n).replace(/[\\/]+$/,``);return r===``?t.slice(0,1):/^[A-Za-z]:$/.test(r)?`${r}${t.charAt(n)}`:r}function rr(e,t,n){let r=new Map;if(n)for(let{summary:t}of e)t.origin.workspace&&r.set(t.origin.key,t.origin.workspace);let i=er(r),a=new Map;for(let e of i)for(let t of e.origins)a.set(t,e);let o=new Map;for(let e of i){let n=new Set(e.origins.map(e=>t?.get(e))),[r]=n;n.size===1&&r!==void 0&&o.set(e.key,r)}return{cardOf:a,worktreeOf:e=>{let n=e.summary.origin.key,r=a.get(n);return r?o.get(r.key):t?.get(n)}}}function ir(e,t){let n=[],r=new Map;for(let i of e){let e=t.worktreeOf(i),a=t.cardOf.get(i.summary.origin.key),o=e===void 0?a?Dn(a.key):void 0:En(e),s=o===void 0?void 0:r.get(o);if(s)s.push(i);else{let e=[i];n.push({root:o,items:e}),o!==void 0&&r.set(o,e)}}return n}function ar(e,t){let n=[],r=new Map;for(let i of e){let e=t.get(i.summary.origin.key),a=e?r.get(e.key):void 0;if(a)a.items.push(i);else{let t={...e?{card:e}:{},items:[i]};n.push(t),e&&r.set(e.key,t)}}return n}function or(e,t,n,r,i,a){let o=[],s=[],c=[],l=0;for(let u of e){for(let e of u.items){for(let t of e.nodes)t.x+=r,t.y+=l;t!==void 0&&(e.summary.worktree=t),l+=e.height+i}let e=u.items[0].origin,d=u.items.at(-1).origin;if(!u.card){s.push(e);continue}let f=(e.y+d.y+L.originH)/2-L.folderH/2,p={id:Dn(u.card.key),kind:`folder`,x:n,y:f,w:L.folderW,h:L.folderH,overhang:kn,anchor:{id:e.id,dx:n-e.x,dy:f-e.y}};o.push(p),s.push(p),a.push({...u.card,id:p.id});for(let e of u.items)e.summary.folder=u.card.key,c.push({id:`${p.id}>${e.origin.id}`,from:p.id,to:e.origin.id,phase:`link`})}return{folderNodes:o,below:s,links:c}}function sr(e,t){let n=t[0],r=t.at(-1),i=(n.y+n.h/2+r.y+r.h/2)/2-L.gitH/2,a={id:En(e),kind:`git`,x:0,y:i,w:L.gitW,h:L.gitH,overhang:kn,anchor:{id:n.id,dx:-n.x,dy:i-n.y}},o=[];for(let e of t)o.push({id:`${a.id}>${e.id}`,from:a.id,to:e.id,phase:`link`});return{card:a,links:o}}function cr(e,t,n,r,i){let{root:a,items:o}=e,s=o[0];if(a===void 0)return{nodes:s.nodes,width:s.width,height:s.height,lead:0,keys:[s.summary.origin.key]};let c=t.worktreeOf(s),l=ar(o,t.cardOf),u=c===void 0?0:L.gitW+i.gap,d=u+(l.some(e=>e.card)?L.folderW+i.gap:0),{folderNodes:f,below:p,links:m}=or(l,c,u,d,i.stackGap,r),h=[...f],g=[];if(c!==void 0){let e=sr(c,p);h.push(e.card),g=e.links}n.nodes.push(...h),n.edges.push(...g,...m);let _=[...o.flatMap(e=>e.nodes),...h],v=nn(_);for(let e of _)e.y-=v.y;return{nodes:_,width:v.x+v.w,height:v.h,lead:d,keys:o.map(e=>e.summary.origin.key)}}function lr(e,t,n,r){let i=rr(e,r.git,r.drawFolders);return ir(e,i).map(e=>cr(e,i,t,n,r))}function ur(e,t){let n={nodes:[],edges:[]},{items:r,chipItems:i}=dr(e,n,t);mr(e.model,n);let a=[],o=lr(r.filter(e=>!i.has(e)),n,a,hr(e,t)),s=i.size===0?o:gr(r,i,o);return{nodes:n.nodes,edges:n.edges,folders:a,items:r,clusters:s}}function dr(e,t,n){let{order:r,roots:i}=e.model,a=[],o=new Set;for(let{key:s}of r){let r=i.get(s);if(r)a.push(pr(e,s,r,t,n));else{let n=fr(e,s,t);a.push(n),o.add(n)}}return{items:a,chipItems:o}}function fr(e,t,n){let{originW:r}=e.dims,i={id:Tn(t),kind:`origin`,x:0,y:0,w:r,h:L.originH,overhang:kn};return n.nodes.push(i),{summary:e.model.byOrigin.get(t),origin:i,nodes:[i],width:r,height:L.originH}}function pr(e,t,n,r,i){let{originW:a}=e.dims,o=r.nodes.length,{rootNodes:s,extent:c}=e.tree.placeRoots(n,r),l=s[0],u=s[s.length-1],d=l&&u?(l.y+(u.y+u.h))/2:c/2,f={id:Tn(t),kind:`origin`,x:0,y:d-L.originH/2,w:a,h:L.originH,overhang:kn};r.nodes.splice(o,0,f),l&&(l.anchor={id:f.id,dx:l.x-f.x,dy:l.y-f.y});for(let e of n)r.edges.push({id:`${f.id}>${On(e.id)}`,from:f.id,to:On(e.id),phase:e.phase});let p=r.nodes.slice(o);if(i){let n=i.positions(t);for(let e of p){let t=n.get(e.id);t&&(e.x=t.x,e.y=t.y)}Jn(p,f.id,e.tree.kidsOf)}let m=nn(p);for(let e of p)e.x-=m.x,e.y-=m.y;return{summary:e.model.byOrigin.get(t),origin:f,nodes:p,width:m.w,height:m.h}}function mr({ordered:e,drawn:t},n){for(let r of e)for(let e of(t.get(r.id)??[]).slice(1))n.edges.push({id:`${On(e)}>${On(r.id)}`,from:On(e),to:On(r.id),phase:r.phase})}function hr({options:e,dims:t},n){let r=!t.compact&&!e.hideContextNodes;return{git:r?e.git:void 0,drawFolders:r,gap:n?n.leadGap:t.originGap,stackGap:n?n.stackGap:L.groupGap}}function gr(e,t,n){let r=new Map(n.map(e=>[e.nodes[0].id,e])),i=[];for(let n of e){if(t.has(n)){i.push({nodes:n.nodes,width:n.width,height:n.height,lead:0,keys:[n.summary.origin.key]});continue}let e=r.get(n.origin.id);e&&i.push(e)}return i}var _r=16,vr=e=>e.reduce((e,t,n)=>e+t+(n>0?Un.rows:0),0);function yr(e,t,n){let r=0,i=0;return t.forEach((t,a)=>{let o=e[t].members.map(e=>un(e.shapes,n));for(let e of o)r=Math.max(r,e.cols);i+=(a>0?Un.rows:0)+vr(o.map(e=>e.rows))}),{cols:r,rows:i}}function br(e,t,n){let r=1/0;for(let i of t)for(let t of e[i].members){let e=t.shapes.find(e=>e.cols>n);e&&(r=Math.min(r,e.cols))}return Number.isFinite(r)?r:void 0}function xr(e,t,n,r){let i=Array.from({length:t},()=>[]),a=Array.from({length:t},()=>0);e.forEach((e,n)=>{let r=0;for(let e=1;e<t;e++)a[e]<a[r]&&(r=e);i[r].push(n),a[r]=a[r]+e.weight});let o=i.map(t=>Math.max(0,...t.map(t=>e[t].lead))),s=i.map(t=>Math.max(...t.flatMap(t=>e[t].members.map(e=>e.shapes[0].cols)))),c;for(;;){let a=i.map((t,n)=>yr(e,t,s[n])),l=a.reduce((e,t,n)=>e+o[n]+t.cols,0)+(t-1)*Un.cols,u=Math.max(...a.map(e=>e.rows)),d=Math.min(n.w/Vn(r,l),n.h/Hn(r,u));(!c||d>c.scale)&&(c={scale:d,budgets:[...s]});let f=0;for(let e=1;e<t;e++)a[e].rows>a[f].rows&&(f=e);let p=br(e,i[f],s[f]);if(p===void 0)break;s[f]=p}let l=c,u=new Map;return i.forEach((t,n)=>{for(let r of t)for(let t of e[r].members)u.set(t.key,un(t.shapes,l.budgets[n]))}),{scale:l.scale,strips:i,picks:u}}function Sr(e,t,n){let r,i=Math.min(e.length,_r);for(let a=1;a<=i;a++){let i=xr(e,a,t,n);(!r||i.scale>r.scale*1.01)&&(r=i)}return r}function Cr(e,t,n){let r=Array.from({length:t.length},()=>({x:0,y:0})),i=0;for(let a of e.strips){let o=Math.max(0,...a.map(e=>t[e].lead)),s=0,c=0;a.forEach((a,l)=>{let u=t[a],d=u.members.map(t=>e.picks.get(t.key));for(let e of d)s=Math.max(s,e.cols);c+=l>0?Un.rows:0,r[a]={x:(i+o-u.lead)*n.pitchX,y:c*n.pitchY},c+=vr(d.map(e=>e.rows))}),i+=o+s+Un.cols}return r}var wr=40,Tr=[`top`,`left`];function Er(e){let{area:t,blocks:n,clusters:r}=e,i=Bn(e.compact),a=new Map(n.map(e=>[e.key,e.originId])),o=new Set(a.values()),s=an(e.kidsOf,Math.min(wr,Math.floor((t.w/Jt+i.gapX)/i.pitchX)),(e,t)=>t<=5&&!o.has(e)),c=n.length===1?[void 0]:Tr,l;for(let a of c){let o=new Map(n.map(t=>[t.key,Wn(s,t.originId,a,e.joins)])),c=r.map(e=>({lead:e.lead,weight:e.weight,members:e.keys.map(e=>({key:e,shapes:o.get(e)}))})),u=Sr(c,t,i);u&&(!l||u.scale>l.plan.scale)&&(l={plan:u,tiles:c})}if(!l)return;let{plan:u,tiles:d}=l;return{scale:u.scale,leadGap:i.pitchX-L.folderW,stackGap:i.gapY+Un.rows*i.pitchY,offsets:Cr(u,d,i),positions:t=>qn(s,a.get(t),u.picks.get(t),i,e.joins)}}var Dr=12;function Or(e,t,n){if(e.w<=0||e.h<=0)return!1;let r=e.w/e.h/(t.w/t.h);return n>=Dr?r<.7||r>1/.7:r<.55}function kr(e,t,n,r){if(t!==1||e.w<e.h)return!1;for(let e of n.values()){let t=0;for(let n of e)r.has(n.id)||(t+=1);if(t>=3)return!0}return!1}var Ar=4;function jr(e,t){return e.length===t.length&&e.every((e,n)=>e.keys.length===t[n].keys.length&&e.keys.every((e,r)=>e===t[n].keys[r]))}function Mr(e,t){let n=Array.from({length:t},()=>[]),r=Array.from({length:t},()=>0);return e.forEach((e,i)=>{let a=0;for(let e=1;e<t;e++)r[e]<r[a]&&(a=e);n[a].push(i),r[a]=r[a]+(n[a].length>1?L.groupGap:0)+e.height}),n}function Nr(e,t){let n=t.length,r=t.map(t=>t.reduce((t,n,r)=>t+(r>0?L.groupGap:0)+e[n].height,0)),i=t.map(t=>Math.max(0,...t.map(t=>e[t].lead))),a=t.map((t,n)=>i[n]+Math.max(0,...t.map(t=>e[t].width-e[t].lead))),o=Array.from({length:e.length},()=>({x:0,y:0})),s=0;return t.forEach((t,n)=>{let r=0;for(let a of t)o[a]={x:s+i[n]-e[a].lead,y:r},r+=e[a].height+L.groupGap;s+=a[n]+L.clusterGap}),{offsets:o,width:a.reduce((e,t)=>e+t,0)+(n-1)*L.clusterGap,height:Math.max(...r)}}function Pr(e,t,n,r=!1){let{offsets:i,width:a,height:o}=Nr(e,Mr(e,t));return{columns:t,offsets:i,width:a,height:o,scale:n?r?Math.min(n.w/a,n.h/o):$t({w:a,h:o},n):1}}function Fr(e,t){e.forEach((e,n)=>{let r=t[n];for(let t of e.nodes)t.x+=r.x,t.y+=r.y})}function Ir(e,t){if(e.length===0)return;let n=t?Math.min(e.length,Ar):1,r=Pr(e,1,t);for(let i=2;i<=n;i++){let n=Pr(e,i,t);n.scale>r.scale*1.02&&(r=n)}Fr(e,r.offsets)}function Lr(e,t,n){let r=Math.min(e.length,Ar),i=Pr(e,1,t,!0);for(let a=2;a<=r&&i.scale<n;a++){let n=Pr(e,a,t,!0);n.scale>i.scale*1.02&&(i=n)}return i}var Rr=1.6;function zr(e,t){let{options:n}=e,{area:r}=n,i=n.grid&&r?r:void 0;return i&&t.clusters.length>0?Br(e,t,i):(Ir(t.clusters,r),{chosen:t,usedGrid:!1,fitAll:!1})}function Br(e,t,n){let{model:r}=e,i=Math.min(Rr,Math.max(Jt,e.options.zoom??1)),a=Lr(t.clusters,n,i),o=t,s=a.offsets,c=a.scale,l=!1,u=a.scale>=i;if(!u||Or({w:a.width,h:a.height},n,r.placedCount)||kr(n,r.order.length,r.roots,r.children)){let r=Vr(e,t,{fill:n,classic:a,cap:i,fits:u});r&&(o=r.alt,s=r.lattice.offsets,c=r.real,l=!0)}return Fr(o.clusters,s),{chosen:o,usedGrid:l,fitAll:c<1}}function Vr(e,t,{fill:n,classic:r,cap:i,fits:a}){let o=Hr(e,t,n);if(!o)return;let s=ur(e,o);if(!jr(s.clusters,t.clusters))return;let c=Math.max(...s.clusters.map((e,t)=>o.offsets[t].x+e.width)),l=Math.max(...s.clusters.map((e,t)=>o.offsets[t].y+e.height)),u=Math.min(n.w/c,n.h/l);return(a?u>=i:u>r.scale*1.01)?{alt:s,lattice:o,real:u}:void 0}function Hr(e,t,n){let{dims:r,model:i,tree:a}=e,o=new Map(t.items.map(e=>[e.summary.origin.key,e]));return Er({area:n,compact:r.compact,blocks:i.order.map(({key:e})=>({key:e,originId:Tn(e)})),kidsOf:a.kidsOf,joins:i.joins,clusters:t.clusters.map(e=>({keys:e.keys,lead:Math.round(e.lead/(L.folderW+r.originGap)),weight:e.keys.reduce((e,t)=>e+o.get(t).nodes.length,0)}))})}function Ur(e){let{area:t}=e,n=R(t);return{compact:n,originGap:n?L.originGapCompact:L.originGap,childGap:n?L.childGapCompact:L.childGap,originW:n?L.originWCompact:L.originW,agentW:n?L.agentWCompact:L.agentW,stagger:n||e.grid&&t?0:L.stagger}}var Wr=(e,t)=>({id:e.id,dx:t.x-e.x,dy:e.h+L.rowGap}),Gr=class{model;dims;heights=new Map;kidNodes;constructor(e,t){this.model=e,this.dims=t}placeRoots(e,t){let n=0,r=[];return e.forEach((e,i)=>{let a=this.place(t,e,0,n,i),o=r[i-1];o&&(a.anchor=Wr(o,a)),r.push(a),n+=this.heightOf(e)+L.rowGap}),{rootNodes:r,extent:n-L.rowGap}}kidsOf=e=>{if(!this.kidNodes){this.kidNodes=new Map;for(let[e,t]of this.model.children)this.kidNodes.set(On(e),t.map(e=>On(e.id)));for(let[e,t]of this.model.roots)this.kidNodes.set(Tn(e),t.map(e=>On(e.id)))}return this.kidNodes.get(e)??[]};stackHeight(e){return e.reduce((e,t)=>e+this.heightOf(t),0)+Math.max(0,e.length-1)*L.rowGap}heightOf(e){let t=this.heights.get(e.id);if(t!==void 0)return t;let n=Math.max(L.agentH,this.stackHeight(this.model.children.get(e.id)??[]));return this.heights.set(e.id,n),n}place(e,t,n,r,i){let{originW:a,originGap:o,agentW:s,childGap:c,stagger:l}=this.dims,{children:u,columnOf:d}=this.model,f=this.heightOf(t),p=s+l+c,m=d.get(t.id)??n,h={id:On(t.id),kind:`agent`,x:a+o+m*p+i%2*l,y:r+(f-L.agentH)/2,w:s,h:L.agentH,overhang:kn};e.nodes.push(h);let g=u.get(t.id)??[];if(g.length>0){let t=r+(f-this.stackHeight(g))/2,n;g.forEach((r,i)=>{let a=this.place(e,r,m+1,t,i);a.anchor=n?Wr(n,a):{id:h.id,dx:a.x-h.x,dy:a.y-h.y},n=a,e.edges.push({id:`${h.id}>${On(r.id)}`,from:h.id,to:On(r.id),phase:r.phase}),t+=this.heightOf(r)+L.rowGap})}return h}};function Kr(e,t={}){let n=Ur(t),r=An(e,t),i={options:t,dims:n,model:r,tree:new Gr(r,n)},{chosen:a,usedGrid:o,fitAll:s}=zr(i,ur(i)),c=jn(e,t.visible);return{nodes:a.nodes,edges:a.edges,bounds:nn(a.nodes),origins:r.origins,folders:a.folders,...c?.size?{hidden:c}:{},...o?{grid:!0}:{},...s?{fitAll:!0}:{}}}function qr(e){return e===`ready`||Ht(e)}function Jr(e){let t=dt(e),n=e.filter(e=>qr(e.phase)).map(e=>e.id),r=new Set(n);for(let e of T(n,t.parentsOf))r.add(e);let i=new Set;for(let e of r)qr(t.byId.get(e).phase)||i.add(e);return{visible:r,context:i,hidden:new Set(e.filter(e=>!r.has(e.id)).map(e=>e.id))}}var Yr=new Set;function Xr({sessions:e,rule:t,prev:n,operated:r,now:i,exitMs:a}){if(!t)return{drawn:`all`,linger:new Map,leaving:Yr,held:Yr,wakeAt:void 0};if(!n)return{drawn:t,linger:new Map,leaving:Yr,held:Yr,wakeAt:void 0};let o=dt(e),s=n.drawn===`all`?o.byId.keys():n.drawn,c=new Set;for(let e of s)o.byId.has(e)&&!t.has(e)&&c.add(e);if(c.size===0)return{drawn:t,linger:new Map,leaving:Yr,held:Yr,wakeAt:void 0};let l=new Map;for(let e of c)for(let t of o.parentsOf(e))c.has(t)&&l.set(t,[...l.get(t)??[],e]);let u=new Map,d=e=>{let t=u.get(e);if(t!==void 0)return t;let i=typeof n.linger.get(e)==`number`;u.set(e,!1);let a=!i&&(r(e)||(l.get(e)??[]).some(d));return u.set(e,a),a},f=new Map;for(let e of c){let t=n.linger.get(e);f.set(e,typeof t==`number`?t:d(e)?`held`:i)}let p=new Map,m=e=>{let t=p.get(e);if(t!==void 0)return t;p.set(e,!1);let n=f.get(e),r=typeof n==`number`&&i-n>=a&&(l.get(e)??[]).every(m);return p.set(e,r),r},h=new Set(t),g=new Set,_=new Set,v;for(let[e,t]of[...f])m(e)?f.delete(e):(h.add(e),t===`held`?_.add(e):(g.add(e),v=Math.min(v??1/0,t+a)));return{drawn:h,linger:f,leaving:g,held:_,wakeAt:v}}function Zr(e,t,n){let r=new Set;if(t.size===0)return r;for(let e of t)r.add(On(e));let i=new Map;for(let t of e.edges)i.set(t.from,[...i.get(t.from)??[],t.to]);let a=new Set;for(let t of[`origin`,`folder`,`git`])for(let o of e.nodes){if(o.kind!==t)continue;let e=i.get(o.id)??[];e.length!==0&&(t===`origin`&&n?.has(o.id)?e.every(e=>r.has(e))&&a.add(o.id):e.every(e=>r.has(e)||a.has(e))&&r.add(o.id))}return r}function Qr(e){return e.kind===`origin`?`origin:${e.key}`:e.kind}function $r(e,t){return e===t?!0:!e||!t||e.kind!==t.kind?!1:e.kind!==`origin`||t.kind===`origin`&&e.key===t.key}function ei(e){return e.kind===`origin`?`origin:${e.key}`:e.kind}function ti(e){if(e){if(e===`active`)return{kind:`active`};if(e===`all`)return{kind:`all`};if(e.startsWith(`origin:`)&&e.length>7)return{kind:`origin`,key:e.slice(7)}}}function ni(e){return e.updatedAt||e.createdAt}function ri(e){if(e.length===0)return[];let t=ft(e),n=new Map;for(let r of e){let e=t.get(r.id)??r.origin.key,i=r.origin.key===e,a=ni(r),o=+!!Ht(r.phase),s=o||r.phase===`ready`?1:0,c=+((r.attention?.length??0)>0),l=+(r.phase===`failed`||r.phase===`lost`),u=n.get(e);if(!u)u={origin:r.origin,originAt:r.createdAt,originHasWs:!!r.origin.workspace&&i,hostTitle:i?r.origin.hostTitle:void 0,hostTitleAt:i&&r.origin.hostTitle?r.createdAt:``,sessionIds:[r.id],running:o,working:s,attention:c,failed:l,startedAt:r.createdAt,latestAt:a},n.set(e,u);else if(u.sessionIds.push(r.id),u.running+=o,u.working+=s,u.attention+=c,u.failed+=l,r.createdAt<u.startedAt&&(u.startedAt=r.createdAt),a>u.latestAt&&(u.latestAt=a),i){let t=!!r.origin.workspace;(u.origin.key!==e||t&&!u.originHasWs||t===u.originHasWs&&r.createdAt>u.originAt)&&(u.origin=r.origin,u.originAt=r.createdAt,u.originHasWs=t),r.origin.hostTitle&&r.createdAt>=u.hostTitleAt&&(u.hostTitle=r.origin.hostTitle,u.hostTitleAt=r.createdAt)}}let r=[];for(let[e,t]of n)r.push({key:e,origin:t.origin,...t.hostTitle?{hostTitle:t.hostTitle}:{},...t.origin.workspace?{workspace:t.origin.workspace}:{},sessionIds:t.sessionIds,total:t.sessionIds.length,running:t.running,working:t.working,attention:t.attention,failed:t.failed,startedAt:t.startedAt,latestAt:t.latestAt});return r.sort((e,t)=>{let n=e=>e.running>0?3:e.attention>0?2:+(e.working>0),r=n(t)-n(e);return r===0?e.latestAt===t.latestAt?e.key<t.key?-1:+(e.key>t.key):e.latestAt>t.latestAt?-1:1:r}),r}function ii(e,t,n){let r=e=>e?e.kind!==`origin`||n.some(t=>t.key===e.key):!1;return r(e)||e&&n.length===0?e:r(t)?t:n.length>0?{kind:`origin`,key:n[0].key}:{kind:`all`}}function ai(e,t){if(t.kind===`all`)return[...e];if(t.kind===`active`){let t=Jr(e).visible;return e.filter(e=>t.has(e.id))}let n=ft(e);return e.filter(e=>(n.get(e.id)??e.origin.key)===t.key)}function oi(e,t){return ft(e).get(t)}function si(e,t){if(e.hostTitle)return e.hostTitle;if(e.origin.kind===`user`)return t(`origin.user`);let n=e.origin.sessionRef?.id;return n?`${e.origin.hostLabel} · ${p(n,8)}`:e.workspace?`${e.origin.hostLabel} · ${It(e.workspace)}`:e.origin.hostLabel}function ci(e,t,n){let r=Et(e.startedAt,t,!0);if(e.hostTitle){let t=[e.workspace?It(e.workspace):void 0,n].filter(Boolean);return t.length>0?t.join(` · `):r}let i=[r];return n?i.push(n):e.origin.sessionRef&&e.workspace&&i.push(It(e.workspace)),i.filter(Boolean).join(` · `)}function li(e,t,n){if(e.length===0)return;if(t.kind!==`origin`){let t=n>0?e[0]:e[e.length-1];return t?{kind:`origin`,key:t.key}:void 0}let r=e.findIndex(e=>e.key===t.key);if(r<0)return{kind:`origin`,key:e[0].key};if(e.length!==1)return{kind:`origin`,key:e[(r+n+e.length)%e.length].key}}function ui(e){let{workspaces:t,sessions:n,currentScope:r,recentOrigins:i,branches:a,t:o}=e,s=e.query.trim().toLowerCase(),c=s?s.split(/\s+/).filter(Boolean):[],l=(...e)=>{if(c.length===0)return!0;let t=e.filter(Boolean).join(` `).toLowerCase();return c.every(e=>t.includes(e))},u=r.kind===`origin`?r.key:void 0,d=new Map,f=0;for(let e of i)e!==u&&!d.has(e)&&d.set(e,f++);let p=[...t].sort((e,t)=>{if(c.length===0){let n=+(e.key===u),r=+(t.key===u);if(n!==r)return n-r;let i=d.get(e.key),a=d.get(t.key);if(i!==void 0||a!==void 0)return i===void 0?1:a===void 0?-1:i-a}return 0}),m=[],h=new Map;for(let e of t)h.set(e.key,si(e,o));for(let t of p){let n=h.get(t.key)??t.origin.hostLabel,r=a?.get(t.key),i=Et(t.startedAt,e.lang??`zh`,!0);l(n,t.origin.hostLabel,t.workspace,r,t.origin.sessionRef?.id,t.key,i)&&m.push({kind:`workspace`,id:`ws:${t.key}`,item:t,recent:d.has(t.key)})}l(`${o(`rail.active`)} active live running`)&&m.push({kind:`view`,id:`view:active`,scope:{kind:`active`}}),l(`${o(`rail.all`)} all overview`)&&m.push({kind:`view`,id:`view:all`,scope:{kind:`all`}});let g=ft(n),_=[...c.length>0?n:n.filter(e=>Ht(e.phase)||(e.attention?.length??0)>0)].sort((e,t)=>{let n=+!!Ht(e.phase),r=+!!Ht(t.phase);return n===r?ni(t).localeCompare(ni(e)):r-n}),v=c.length>0?12:6,y=0;for(let e of _){if(y>=v)break;let t=h.get(g.get(e.id)??e.origin.key);l(e.title,e.id,e.harness,e.model?.label,e.model?.resolved,e.model?.requested,e.cwd,t)&&(m.push({kind:`session`,id:`ses:${e.id}`,session:e,...t?{workspaceTitle:t}:{}}),y+=1)}return m}function di(e){let t=/^#\/s\/([^/?#]+)/.exec(e);if(t?.[1])return{kind:`session`,id:decodeURIComponent(t[1])};let n=/^#\/m\/([^/?#]+)/.exec(e);return n?.[1]?{kind:`overview`,scope:{kind:`origin`,key:decodeURIComponent(n[1])}}:/^#\/active(?:[/?#]|$)/.test(e)?{kind:`overview`,scope:{kind:`active`}}:/^#\/all(?:[/?#]|$)/.test(e)?{kind:`overview`,scope:{kind:`all`}}:/^#\/archived(?:[/?#]|$)/.test(e)?{kind:`archived`}:{kind:`overview`}}function fi(e){return e.kind===`session`?`#/s/${encodeURIComponent(e.id)}`:e.kind===`archived`?`#/archived`:e.scope?e.scope.kind===`active`?`#/active`:e.scope.kind===`all`?`#/all`:`#/m/${encodeURIComponent(e.scope.key)}`:`#/`}var pi=`ensemble.canvas.hideIdle`,mi=`ensemble.canvas.collapsedOrigins`,hi=`ensemble.workspace.viewMode`,gi=`ensemble.rail.collapsed`,_i=`ensemble.workspace.last`;function vi(e){try{return localStorage.getItem(e)??void 0}catch{return}}function yi(e,t){try{localStorage.setItem(e,t)}catch{}}function bi(){let e=vi(mi);if(!e)return new Set;try{let t=JSON.parse(e);return new Set(Array.isArray(t)?t.filter(e=>typeof e==`string`&&e!==``):[])}catch{return new Set}}function xi(){return vi(`ensemble.workspace.viewMode`)===`list`?`list`:`canvas`}function Si(){return ti(vi(_i))}var Ci=di(location.hash),wi=Ci.kind===`overview`&&Ci.scope?Ci.scope:Si(),z=new ot({conn:`connecting`,ready:!1,version:``,sessions:{},archived:{},archivedLoaded:!1,archivedCount:void 0,retention:void 0,snapshotAt:void 0,harnesses:[],profiles:{entries:[]},pendingModelSettings:{},capacity:{occupied:0,max:0,waiting:0},concurrency:void 0,pendingConcurrency:void 0,route:Ci,detail:void 0,toasts:[],lang:tt(),settings:{open:!1,section:void 0},confirm:void 0,hideIdle:vi(pi)===`1`,collapsedOrigins:bi(),viewMode:xi(),railCollapsed:vi(gi)===`1`,switcherOpen:!1,lastWorkspace:wi,recentOrigins:wi?.kind===`origin`?[wi.key]:[]}),Ti={lastFocusId:void 0},Ei=0;function Di(e,t,n=4200,r){let i=++Ei;z.set(n=>({toasts:[...n.toasts.slice(-3),{id:i,tone:e,text:t,...r?{action:r}:{}}]})),n>0&&setTimeout(()=>Oi(i),n)}function Oi(e){z.set(t=>({toasts:t.toasts.filter(t=>t.id!==e)}))}var ki=new Set([`network`,`internal`,`forbidden`,`not_found`]);function Ai(e){let t=z.get().lang;if(e instanceof Ne){let n=`apiError.${e.code}`,r=it(t,n);return r===n?e.message:ki.has(e.code)||!e.message?r:t===`zh`?`${r}(${e.message})`:`${r} (${e.message})`}return g(e)}function ji(e){let t=document,n=window.matchMedia(`(prefers-reduced-motion: reduce)`).matches;!t.startViewTransition||n?e():t.startViewTransition(()=>(0,x.flushSync)(e))}function Mi(e){if(yi(_i,ei(e)),e.kind!==`origin`)return{lastWorkspace:e};let t=z.get().recentOrigins;return{lastWorkspace:e,recentOrigins:[e.key,...t.filter(t=>t!==e.key)].slice(0,24)}}function Ni(e){let t=fi(e);location.hash!==t&&(e.kind!==`overview`||e.scope||location.hash!==``&&location.hash!==`#`)&&(location.hash=t)}function Pi(e){let t=z.get().route,n=Mi(e);z.set({...n,switcherOpen:!1}),t.kind===`overview`&&$r(t.scope,e)||Ni({kind:`overview`,scope:e})}var Fi;function Ii(e,t){return e.kind===t.kind?e.kind===`session`&&t.kind===`session`?e.id===t.id:e.kind===`overview`&&t.kind===`overview`?$r(e.scope,t.scope):!0:!1}function Li(){let e=di(location.hash),t=z.get().route;if(Ii(e,t))return;let n=e.kind===`overview`&&e.scope?Mi(e.scope):{},r=()=>{z.set({...n,route:e,switcherOpen:!1,detail:e.kind===`session`?{id:e.id,state:void 0,rev:0,loading:!0}:void 0}),e.kind===`session`?zi(e.id):Fi?.abort()};e.kind!==t.kind&&(e.kind===`session`||t.kind===`session`)?ji(r):r()}function Ri(){let e=()=>Li();window.addEventListener(`hashchange`,e);let t=z.get().route;return t.kind===`session`&&(z.set({detail:{id:t.id,state:void 0,rev:0,loading:!0}}),zi(t.id)),()=>window.removeEventListener(`hashchange`,e)}async function zi(e){Fi?.abort();let t=new AbortController;Fi=t;let n=Ue();try{let r=await N.session(e,t.signal);if(t.signal.aborted)return;let i=ke(r.events);if(!i)throw new Ne(`internal`,`Session has no readable history`,500);let a=z.get().detail;if(a?.id!==e)return;let o=r.summary,s=n.touched.has(e),c=t=>o?.id===e&&!s&&!(t.sessions[e]&&o.archivedAt===void 0)?Xe(t,o):{};z.set(t=>({detail:{id:e,state:i,rev:(a.rev??0)+1,loading:!1},...c(t)}));let l=Ve(z.get(),e);l&&l.seq>i.seq&&Bi(e,t.signal)}catch(n){if(t.signal.aborted)return;let r=z.get().detail;if(r?.id!==e)return;z.set({detail:{id:e,state:r.state,rev:r.rev,loading:!1,error:n instanceof Ne&&n.status===404?`not_found`:`failed`}})}finally{n.stop()}}async function Bi(e,t){for(let n=0;n<6;n++){let n=z.get().detail;if(!n?.state||n.id!==e||t?.aborted)return;let r=n.state.seq;try{let n=await N.events(e,r);if(t?.aborted||n.events.length===0||(Vi(e,n.events),n.lastSeq<=(z.get().detail?.state?.seq??r)))return}catch{return}}}function Vi(e,t){let n=z.get().detail;if(!n||n.id!==e||!n.state)return;let r=n.state,i=!1;for(let n of t)if(!(n.seq<=r.seq)){if(n.seq!==r.seq+1){zi(e);return}Ae(r,n),i=!0}i&&z.set({detail:{...n,rev:n.rev+1}})}function Hi(e){yi(`ensemble.lang`,e),document.documentElement.lang=e===`zh`?`zh-CN`:`en`,z.set({lang:e})}function Ui(e){yi(pi,e?`1`:`0`),z.set({hideIdle:e})}function Wi(e,t){let n=z.get(),r=new Set(n.collapsedOrigins);t?r.add(e):r.delete(e);let i=n.archivedLoaded||(n.archivedCount??0)===0;if(n.ready&&i){let t=new Set([...Object.values(n.sessions),...Object.values(n.archived)].map(e=>e.origin.key));for(let n of r)n!==e&&!t.has(n)&&r.delete(n)}Ki(r)}function Gi(){Ki(new Set)}function Ki(e){yi(mi,JSON.stringify([...e].sort())),z.set({collapsedOrigins:e})}function qi(e){yi(hi,e),z.set({viewMode:e})}function Ji(e){yi(gi,e?`1`:`0`),z.set({railCollapsed:e})}function Yi(){z.set(e=>({switcherOpen:!0,settings:{...e.settings,open:!1}}))}function Xi(){z.set({switcherOpen:!1})}function Zi(){z.get().switcherOpen?Xi():Yi()}function Qi(e){let t=z.get().recentOrigins;t[0]!==e&&z.set({recentOrigins:[e,...t.filter(t=>t!==e)].slice(0,24)})}function $i(e){z.set(t=>({settings:{open:!0,section:e??t.settings.section},switcherOpen:!1}))}function ea(){z.set(e=>({settings:{...e.settings,open:!1}}))}function ta(e){z.set(t=>({settings:{...t.settings,section:e}}))}function na(e){z.set({confirm:e})}function ra(){z.set({confirm:void 0})}async function ia(e,t){let n=await sa(()=>N.cancel(e),t.failed);n&&(ua(n.summary),Di(n.interrupted||n.cancelledQueued>0?`success`:`info`,n.interrupted||n.cancelledQueued>0?t.ok:t.nothing))}async function B(e,t){let n=await sa(()=>N.stop(e),t.failed);n&&(ua(n.summary),Di(`success`,t.ok))}async function aa(e,t){return await sa(()=>N.remove(e),t.failed)?(oa(e),Di(`success`,t.ok),!0):!1}function oa(e){z.set(t=>Ze(t,e))}async function sa(e,t){try{return await e()}catch(e){let n=z.get().lang===`zh`?`:`:`: `;Di(`error`,t?`${t}${n}${Ai(e)}`:Ai(e),6e3);return}}function ca(e){z.set(t=>{let n=t.harnesses.findIndex(t=>t.id===e.id);if(n<0)return{harnesses:[...t.harnesses,e]};let r=t.harnesses.slice();return r[n]=e,{harnesses:r}})}function la(e){z.set({profiles:e})}function ua(e){z.set(t=>Xe(t,e))}function da(e,t,n=`text/markdown;charset=utf-8`){let r=URL.createObjectURL(new Blob([t],{type:n})),i=document.createElement(`a`);i.href=r,i.download=e,i.rel=`noopener`,i.style.display=`none`,document.body.append(i),i.click(),i.remove(),setTimeout(()=>URL.revokeObjectURL(r),1e3)}var fa=(e,t)=>it(z.get().lang,e,t),pa=new ot({list:{status:`idle`},busy:0});function ma(){return pa.get().busy>0}var ha;function ga(e={}){let t=z.get();return t.archivedCount===void 0||t.archivedLoaded&&!e.force?Promise.resolve():ha||(ha=(async()=>{Ge(),pa.set({list:{status:`loading`}});try{let{sessions:e}=await N.sessions({archived:`only`}),t=Ke();z.set(n=>$e(n,e,t)),pa.set({list:{status:`idle`}})}catch(e){throw Ke(),pa.set({list:{status:`error`,error:Ai(e)}}),e}})().finally(()=>{ha=void 0}),ha)}var _a={working:`archive.keptWorking`,idle:`archive.keptIdle`,pending:`archive.keptPending`},va={working:`archive.blockedWorking`,idle:`archive.blockedIdle`,pending:`archive.blockedPending`};function ya(e,t){return t(va[e.reason],{n:e.n})}function ba(e,t){let n=e.changed.length,r=new Set(e.skipped.map(e=>e.reason)),i=e.skipped.filter(e=>e.reason===`active`).length;if(n===0)return i>0?{tone:`warn`,text:fa(`archive.noneActive`)}:r.has(`not_found`)?{tone:`warn`,text:fa(`archive.noneMissing`)}:{tone:`info`,text:fa(`archive.noneAlready`)};let a=t?[{...t}]:[];if(i>0){let e=a.find(e=>e.reason===`working`);e?e.n+=i:a.push({reason:`working`,n:i})}let o=e.kept?.length??0,s=a.map(e=>fa(_a[e.reason],{n:e.n})).join(``)+(o>0?fa(`archive.keptFollowing`,{n:o}):``);return{tone:`success`,text:`${fa(`archive.done`,{n})}${s}`}}async function xa(e,t){if(!(e.length===0||pa.get().busy>0)){pa.set(e=>({busy:e.busy+1}));try{let n=await sa(()=>N.archive([...e]),fa(`archive.failed`));if(!n)return;let{tone:r,text:i}=ba(n,t),a=n.changed;return Di(r,i,a.length>0?1e4:6e3,a.length>0?{label:fa(`archive.undo`),run:()=>void wa(a,{exact:!0})}:void 0),n}finally{pa.set(e=>({busy:e.busy-1}))}}}function Sa(e){let t=e.changed.length;na({title:fa(`archive.confirmTitle`,{n:t}),body:fa(`archive.confirmBody`,{n:t,carried:e.carried,kept:e.kept}),confirmLabel:fa(`archive.confirmAction`,{n:t}),onConfirm:async()=>{ma()?Di(`info`,fa(`archive.busy`)):await xa(e.ids,e.blocked)}})}function Ca(e){return pa.get().busy>0?Promise.resolve(void 0):wa(e)}async function wa(e,t={}){if(e.length!==0){pa.set(e=>({busy:e.busy+1}));try{let n=await sa(()=>N.unarchive([...e],t),fa(`archive.unarchiveFailed`));if(!n)return;let r=new Set(e),i=n.changed.filter(e=>!r.has(e)).length;if(n.changed.length>0){let e=i>0?fa(`archive.unarchivedCarried`,{n:i}):``;Di(`success`,`${fa(`archive.unarchived`,{n:n.changed.length})}${e}`)}else n.skipped.some(e=>e.reason===`not_found`)?Di(`warn`,fa(`archive.unarchiveMissing`)):Di(`info`,fa(`archive.unarchiveNone`));return n}finally{pa.set(e=>({busy:e.busy-1}))}}}var Ta=new Set;async function Ea(e,t){let n=`${e}|${t.scope}|${t.detail}`;if(Ta.has(n))return!1;Ta.add(n);try{let n=await sa(()=>N.report(e,{...t,lang:z.get().lang}),fa(`export.failed`));return n?(da(n.filename,n.text),!0):!1}finally{Ta.delete(n)}}async function Da(e){let t=await N.retention(e);return z.set({retention:t.retention}),t}async function Oa(e){let t=await N.setRetention(e);return z.set({retention:t.retention}),t}function ka(e,t){if(t===null)return;let n=e===`keepDays`?k.retention.maxKeepDays:k.retention.maxKeepCount;if(typeof t!=`number`||!Number.isFinite(t))return`${e} must be a whole number from 1 to ${n}, or null for no limit.`;if(!Number.isInteger(t))return`${e} must be a whole number, got ${t}.`;if(t<1)return`${e} must be at least 1, got ${t}; use null for no limit.`;if(t>n)return`${e} must be at most ${n}, got ${t}.`}function Aa(e){switch(e.phase){case`done`:case`failed`:case`cancelled`:case`stopped`:case`lost`:return e.messages.pending===0;default:return!1}}function ja(e){let t=Date.parse(e.updatedAt);return{id:e.id,parentSessionId:e.parentSessionId,...e.parentSessionIds?{parentSessionIds:e.parentSessionIds}:{},archived:e.archivedAt!==void 0,finished:Aa(e),activityMs:Number.isFinite(t)?t:1/0}}function Ma(e,t){let n=[],r=new Set,i=[t];for(let t=i.pop();t!==void 0;t=i.pop()){if(r.has(t))continue;r.add(t),n.push(t);let a=e.childrenOf(t);for(let e=a.length-1;e>=0;e--){let t=a[e];t!==void 0&&i.push(t)}}return n}function Na(e,t){return C(e.node(t)).filter(t=>e.node(t)!==void 0)}function Pa(e,t){let n=new Set(t),r=T(t,t=>e.childrenOf(t)).filter(t=>e.node(t)!==void 0);for(let t=!0;t;){t=!1;for(let i of r)n.has(i)||Na(e,i).every(t=>e.node(t)?.archived===!0||n.has(t))&&(n.add(i),t=!0)}return n}function Fa(e,t,n){return[t,...T([t],t=>e.childrenOf(t).filter(e=>n.has(e)))]}function Ia(e,t){return Fa(e,t,Pa(e,[t]))}function La(e,t){let n=[],r=new Map,i=[],a=new Set;for(let o of t){if(a.has(o))continue;a.add(o),n.push(o);let t=e.node(o);t?t.archived?r.set(o,`already`):i.push(o):r.set(o,`not_found`)}let o=new Set,s=new Set;for(let t=!0;t;){t=!1;let n=i.filter(e=>!o.has(e));s=Pa(e,n);for(let r of n)Fa(e,r,s).some(t=>e.node(t)?.finished===!1)&&(o.add(r),t=!0)}let c=[],l=new Set,u=[],d=new Set;for(let t of i)if(!o.has(t))for(let n of Ma(e,t)){let t=e.node(n);!t||t.archived||l.has(n)||(s.has(n)?(l.add(n),c.push(n)):!d.has(n)&&!o.has(n)&&(d.add(n),u.push({id:n,follows:Na(e,n).filter(t=>e.node(t)?.archived!==!0&&!s.has(t))})))}let f=[];for(let e of n){let t=r.get(e)??(o.has(e)?`active`:void 0);t&&f.push({id:e,reason:t})}return{changed:c,skipped:f,...u.length>0?{kept:u}:{}}}function Ra(e){let t=dt(e),n=new Map(e.map(e=>[e.id,ja(e)]));return{tree:{node:e=>n.get(e),childrenOf:e=>t.childrenOf(e).map(e=>e.id),ids:()=>[...t.byId.keys()]},graph:t}}function za(e){let t=0,n=0,r=0;for(let i of e)Aa(i)||(i.phase===`starting`||i.phase===`queued`||i.phase===`running`?t+=1:i.phase===`ready`?n+=1:r+=1);if(t>0)return{reason:`working`,n:t};if(n>0)return{reason:`idle`,n};if(r>0)return{reason:`pending`,n:r}}function Ba(e,t){let{tree:n,graph:r}=Ra(e);if(!r.byId.has(t))return;let i=Ia(n,t).flatMap(e=>{let t=r.byId.get(e);return t?[t]:[]});return{total:i.length,descendants:i.length-1,blocked:za(i)}}function Va(e,t,n,r,i){let a=new Set(r),o=e.filter(e=>!a.has(e.id)),s=new Map;for(let e of o)for(let n of Ma(t.tree,e.id)){let e=t.graph.byId.get(n);e&&s.set(n,e)}return{ids:n,changed:r,kept:o.length,carried:r.filter(e=>!i.has(e)).length,blocked:za([...s.values()])}}function Ha(e,t){let n=Ra(t),{tree:r,graph:i}=n,a=new Set(e.map(e=>e.id)),o=new Map,s=e=>{let t=o.get(e);if(t!==void 0)return t;let n=Ia(r,e).every(e=>{let t=i.byId.get(e);return t!==void 0&&Aa(t)});return o.set(e,n),n},c=e.filter(e=>{if(e.archivedAt!==void 0||!i.byId.has(e.id)||!s(e.id))return!1;let t=i.parentsOf(e.id);return!(t.length>0&&t.every(e=>a.has(e)&&s(e)))}).map(e=>e.id);return Va(e,n,c,La(r,c).changed,new Set(c))}function Ua(e,t){let n=Ra(t),r=e.map(e=>e.id);return Va(e,n,r,La(n.tree,r).changed,new Set(r))}function Wa(e,t){let n=new Set([e.id]),r=[...e.childIds],i=!0,a=0;for(let e=r.shift();e!==void 0;e=r.shift()){if(n.has(e))continue;n.add(e),a+=1;let o=t(e);o?r.push(...o.childIds):i=!1}return{count:a,complete:i}}var Ga=(...e)=>t=>e.some(e=>t.startsWith(e)),Ka=[[`deepseek`,Ga(`deepseek`)],[`kimi`,Ga(`kimi`,`moonshot`)],[`glm`,e=>/^(chat)?glm/.test(e)||e===`zhipu`],[`minimax`,Ga(`minimax`)],[`qwen`,Ga(`qwen`,`qwq`)],[`claude`,e=>e.startsWith(`claude`)||e===`opus`||e===`sonnet`||e===`haiku`],[`openai`,e=>e.startsWith(`gpt`)||e===`chatgpt`||e===`codex`||/^o[1-9]$/.test(e)],[`gemini`,Ga(`gemini`)],[`grok`,Ga(`grok`)],[`mistral`,Ga(`mistral`,`mixtral`,`codestral`,`devstral`,`magistral`)],[`llama`,Ga(`llama`)],[`composer`,e=>e===`composer`]],qa=e=>e.toLowerCase().split(/[^a-z0-9]+/).filter(Boolean);function Ja(e){if(e)for(let t of[e.resolved,e.label,e.requested]){if(!t)continue;let e=qa(t);for(let[t,n]of Ka)if(e.some(n))return t}}var Ya=(e,t)=>st(t,e);function Xa(e){let t=dt(e),n=[...e].sort(Ya),r=n.filter(e=>t.firstParentOf(e.id)===void 0),i=[],a=new Set,o=(e,n)=>{if(!a.has(e.id)){a.add(e.id),i.push({session:e,depth:n});for(let r of t.treeChildrenOf(e.id))o(r,Math.min(n+1,3))}};for(let e of r)o(e,0);for(let e of n)o(e,0);return i}function Za(e,t,n,r){let i=Math.max(1,Math.trunc(r));if(e.length<=i)return{rows:[...e],hidden:0,memory:void 0};let a=e.length-i,o=0;if(n){let t=e.findIndex(e=>e.id===n.first);o=Math.min(Math.max(t>=0?t:n.index,0),a)}let s=t===void 0?-1:e.findIndex(e=>e.id===t);return s>=0&&(s<o?o=s:s>=o+i&&(o=s-i+1)),{rows:e.slice(o,o+i),hidden:e.length-i,memory:o===0?void 0:{first:e[o].id,index:o}}}function Qa(e,t){return e?.first===t?.first&&e?.index===t?.index}function $a(){return I(z,e=>e.lang)}function V(){let e=$a();return(0,l.useMemo)(()=>at(e),[e])}function eo(e,t){let n=e.model;return n?.label??n?.resolved??n?.requested??t(`model.default`)}function to(e,t){if(!e)return;let n=`effort.${e}`,r=t(n);return r===n?e:r}function no(e,t){let n=`harness.${e}`,r=t(n);return r===n?e:r}function ro(e){return`${location.origin}/#/s/${encodeURIComponent(e)}`}var io=`/assets/claude-code-B8eqCvAs.svg`,ao=`/assets/codex-BvkQYgV5.svg`,oo=`/assets/cursor-D2tyRWTE.svg`,so=`/assets/dsh-DNAEj8if.svg`,co=`/assets/opencode-CdSE0wKU.svg`,lo=`/assets/pi-DP_DEFhy.svg`,uo=e((e=>{var t=Symbol.for(`react.transitional.element`),n=Symbol.for(`react.fragment`);function r(e,n,r){var i=null;if(r!==void 0&&(i=``+r),n.key!==void 0&&(i=``+n.key),`key`in n)for(var a in r={},n)a!==`key`&&(r[a]=n[a]);else r=n;return n=r.ref,{$$typeof:t,type:e,key:i,ref:n===void 0?null:n,props:r}}e.Fragment=n,e.jsx=r,e.jsxs=r})),H=e(((e,t)=>{t.exports=uo()}))(),fo={claude:{src:io,optical:{left:0,top:.1875,width:1,height:.625,reach:1}},codex:{src:ao,optical:{left:0,top:0,width:1,height:1,reach:22/24}},cursor:{src:oo,optical:{left:.0614,top:0,width:.8772,height:1,reach:1}},dsh:{src:so,optical:{left:.02,top:.14,width:.9668,height:.7263,reach:1}},opencode:{src:co,optical:{left:.1,top:0,width:.8,height:1,reach:20/24}},pi:{src:lo,optical:{left:.2066,top:.2066,width:.5868,height:.5868,reach:22/24}}},po=e=>Object.hasOwn(fo,e),mo={left:.1921,top:.1542,width:.6158,height:.7333,reach:22/24};function ho({harness:e,size:t=40,variant:n=`tile`,simulated:r=!1,tip:i}){let a=po(e)?fo[e]:void 0,o=n===`glyph`?a?.optical??mo:void 0,s=o?t*o.reach/Math.max(o.width,o.height):n===`tile`?t*.65:t,c=o?{translate:`${-o.left*s}px ${(.5-o.top-o.height/2)*s}px`}:void 0,l=a?(0,H.jsx)(`img`,{className:o?void 0:`harness-mark`,"data-harness":o?void 0:e,src:a.src,width:s,height:s,style:c,alt:``,"aria-hidden":`true`,draggable:!1}):(0,H.jsx)(`svg`,{width:s,height:s,style:c,viewBox:`0 0 24 24`,fill:`none`,"aria-hidden":`true`,children:(0,H.jsx)(`path`,{d:`M9 4.5h6M10 4.5v5.2L5.78 20.5h12.44L14 9.7V4.5`,stroke:`currentColor`,strokeWidth:`1.6`,strokeLinecap:`square`,strokeLinejoin:`miter`})});return n===`bare`?l:o?(0,H.jsx)(`span`,{className:`harness-glyph`,style:{width:t,height:t},"data-harness":e,"data-tip":i,role:i?`img`:void 0,"aria-label":i,children:l}):(0,H.jsx)(`span`,{className:`harness-tile`,style:{width:t,height:t},"data-harness":e,"data-sim":r?``:void 0,"data-tip":i,role:i?`img`:void 0,"aria-label":i,children:l})}var go=2.2,_o={close:`M6.5 6.5l11 11M17.5 6.5l-11 11`,plus:`M12 5.5v13M5.5 12h13`,minus:`M5.5 12h13`,check:`M5.5 12.8l4.2 4.2L18.5 8`,chevronRight:`M9.5 6l6 6-6 6`,chevronDown:`M6 9.5l6 6 6-6`,chevronUp:`M6 14.5l6-6 6 6`,arrowLeft:`M19 12H5.5M11 6l-6 6 6 6`,arrowUp:`M12 19V5.5M6 11.5l6-6 6 6`,arrowDown:`M12 5v13.5M6 12.5l6 6 6-6`,arrowRight:`M5 12h13.5M13 6l6 6-6 6`,alert:`M12 4.2l9 15.6H3L12 4.2zM12 10v4.2M12 17.2v.01`,info:`M12 11v5.5M12 7.5v.01M12 21a9 9 0 1 0 0-18 9 9 0 0 0 0 18z`,terminal:`M5 7.5l4.5 4.5L5 16.5M12.5 17H19`,file:`M7 3.5h6.5L18 8v12.5H7V3.5zM13.5 3.5V8H18`,edit:`M4.5 19.5l.9-4.1L16.2 4.6l3.2 3.2L8.6 18.6l-4.1.9z`,search:`M10.8 17.6a6.8 6.8 0 1 0 0-13.6 6.8 6.8 0 0 0 0 13.6zM16 16l4.5 4.5`,globe:`M12 21a9 9 0 1 0 0-18 9 9 0 0 0 0 18zM3.5 12h17M12 3c2.6 2.4 3.9 5.4 3.9 9s-1.3 6.6-3.9 9c-2.6-2.4-3.9-5.4-3.9-9S9.4 5.4 12 3z`,plug:`M9 3.5v5M15 3.5v5M6.5 8.5h11v8.3h-11zM12 16.8v3.7`,list:`M9.5 6.5h10.5M9.5 12h10.5M9.5 17.5h10.5M4.5 6.5h.01M4.5 12h.01M4.5 17.5h.01`,sparkle:`M12 3.5l1.9 5.6 5.6 1.9-5.6 1.9L12 18.5l-1.9-5.6L4.5 11l5.6-1.9L12 3.5zM19 17.5l.6 1.4 1.4.6-1.4.6-.6 1.4-.6-1.4-1.4-.6 1.4-.6.6-1.4z`,folder:`M3.5 5.5h5.6l2 2.2h9.4v11.8h-17z`,user:`M12 12a4 4 0 1 0 0-8 4 4 0 0 0 0 8zM4.5 20c.6-3.6 3.7-6 7.5-6s6.9 2.4 7.5 6`,link:`M10 7H6.5v10H10M14 7h3.5v10H14M8.5 12h7`,copy:`M9 9h10.5v10.5H9V9zM15 9V5.5H4.5V16H9`,external:`M14 4.5h5.5V10M19.5 4.5L11 13M17.5 14v5.5h-13v-13H10`,refresh:`M19.5 12a7.5 7.5 0 1 1-2.2-5.3M19.5 4.5v4.2h-4.2`,clock:`M12 21a9 9 0 1 0 0-18 9 9 0 0 0 0 18zM12 7v5.2l3.2 1.9`,lock:`M6.5 10.5h11v9h-11v-9zM8.8 10.5V4.8h6.4v5.7`,flask:`M9.5 3.5h5M10.3 3.5v5.6L5.66 20.6h12.68l-4.64-11.5V3.5M8.1 14.5h7.8`,layers:`M12 4l8.5 4.7L12 13.4 3.5 8.7 12 4zM3.5 12.6l8.5 4.7 8.5-4.7M3.5 16.4l8.5 4.7 8.5-4.7`,fit:`M4.5 9.5v-5h5M19.5 9.5v-5h-5M4.5 14.5v5h5M19.5 14.5v5h-5`,trash:`M5 7h14M9.7 7V4.5h4.6V7M7 7l.9 12.5h8.2L17 7M10.5 11v5M13.5 11v5`,bot:`M12 4v2.5M4.5 8.5h15v10h-15zM9.2 13.2v1.2M14.8 13.2v1.2`,branch:`M7 4.5v15M7 15h5V7.5h5M17 5.5h4v4h-4zM7 17.5h4v4H7z`,send:`M4.5 12l15-7.5-4.8 15-3.2-6.2L4.5 12z`,pause:`M8.5 6.5v11M15.5 6.5v11`,play:`M8 5.5l10 6.5-10 6.5v-13z`,hand:`M8 12V6.8a1.4 1.4 0 0 1 2.8 0V11M10.8 10.5V5.3a1.4 1.4 0 0 1 2.8 0v5.2M13.6 10.5V6.7a1.4 1.4 0 0 1 2.8 0V13c0 4-2.4 6.5-5.6 6.5-2.5 0-3.9-1.2-5-3.2L4 13.6a1.4 1.4 0 0 1 2.4-1.4L8 14`,keyboard:`M2.5 7h19v10h-19zM6.5 10.5h.01M10 10.5h.01M14 10.5h.01M17.5 10.5h.01M7.5 14h9`,inbox:`M3.5 13.5l2.74-8h11.52l2.74 8v6h-17zM3.5 13.5h5l1 2h5l1-2h5`,archive:`M3.5 5.5h17v4h-17zM5.5 9.5v10h13v-10M10 13.5h4`,unarchive:`M3.5 5.5h17v4h-17zM5.5 9.5v10h13v-10M12 17.5v-6M9 14.5l3-3 3 3`,download:`M12 4.5v11M7.5 11l4.5 4.5 4.5-4.5M4.5 19.5h15`,zap:`M13 3.5L5.5 13.5h5.5L10.5 20.5l8-10.5H13l0-6.5z`,eye:`M2.8 12S6 5.8 12 5.8 21.2 12 21.2 12 18 18.2 12 18.2 2.8 12 2.8 12zM12 14.6a2.6 2.6 0 1 0 0-5.2 2.6 2.6 0 0 0 0 5.2z`,eyeOff:`M14.82 17.72C13.96 18.02 13.02 18.2 12 18.2C6 18.2 2.8 12 2.8 12C2.8 12 3.75 10.16 5.58 8.48M9.18 6.28C10.04 5.98 10.98 5.8 12 5.8C18 5.8 21.2 12 21.2 12C21.2 12 20.25 13.84 18.42 15.52M4.5 4.5l15 15`,alignLeft:`M4.5 3.5v17M7.5 5.5h12v5h-12zM7.5 13.5H15v5H7.5z`,alignHCenter:`M12 3.5v2M12 10.5v3M12 18.5v2M4.5 5.5h15v5h-15zM7.5 13.5h9v5h-9z`,alignRight:`M19.5 3.5v17M4.5 5.5h12v5h-12zM9 13.5h7.5v5H9z`,alignTop:`M3.5 4.5h17M5.5 7.5h5v12h-5zM13.5 7.5h5V15h-5z`,alignVMiddle:`M3.5 12h2M10.5 12h3M18.5 12h2M5.5 4.5h5v15h-5zM13.5 7.5h5v9h-5z`,alignBottom:`M3.5 19.5h17M5.5 4.5h5v12h-5zM13.5 9h5v7.5h-5z`,distributeH:`M4.5 4v16M19.5 4v16M9.5 7.5h5v9h-5z`,distributeV:`M4 4.5h16M4 19.5h16M7.5 9.5h9v5h-9z`,undo:`M9 6L4.5 10.5 9 15M4.5 10.5h15v10H10`,redo:`M15 6l4.5 4.5L15 15M19.5 10.5h-15v10H14`,sidebar:`M2.5 5.5h19v13h-19zM9 5.5v13`,canvas:`M4 9.5h5v5H4zM15 5h5v5h-5zM15 14h5v5h-5zM9 12h3M12 7.5h3M12 16.5h3M12 7.5v9`,filterLines:`M4 7h16M7 12h10M10 17h4`,settings:`M9.95 6.04L10.44 3.14A9 9 0 0 1 13.56 3.14L14.05 6.04A6.3 6.3 0 0 1 16.13 7.25L18.89 6.21A9 9 0 0 1 20.46 8.92L18.18 10.8A6.3 6.3 0 0 1 18.18 13.2L20.46 15.08A9 9 0 0 1 18.89 17.79L16.13 16.75A6.3 6.3 0 0 1 14.05 17.96L13.56 20.86A9 9 0 0 1 10.44 20.86L9.95 17.96A6.3 6.3 0 0 1 7.87 16.75L5.11 17.79A9 9 0 0 1 3.54 15.08L5.82 13.2A6.3 6.3 0 0 1 5.82 10.8L3.54 8.92A9 9 0 0 1 5.11 6.21L7.87 7.25A6.3 6.3 0 0 1 9.95 6.04zM14.7 12a2.7 2.7 0 1 0-5.4 0 2.7 2.7 0 0 0 5.4 0z`},vo=`M12 1.62L22.38 12L12 22.38L1.62 12z`,yo=`M9.6 7.9v8.2M9.6 14.7L15.4 11.2`,bo=[[9.6,7.9],[9.6,16.1],[15.4,11.2]],xo=3.2;function So(e){let t=`git-fork-${(0,l.useId)().replace(/:/g,``)}`;return(0,H.jsxs)(`svg`,{...e,fill:`currentColor`,children:[(0,H.jsxs)(`mask`,{id:t,maskUnits:`userSpaceOnUse`,x:`0`,y:`0`,width:`24`,height:`24`,children:[(0,H.jsx)(`rect`,{width:`24`,height:`24`,fill:`#fff`}),(0,H.jsx)(`path`,{d:yo,fill:`none`,stroke:`#000`,strokeWidth:`1.9`,strokeLinecap:`square`}),bo.map(([e,t])=>(0,H.jsx)(`rect`,{x:-3.2/2,y:-3.2/2,width:xo,height:xo,transform:`translate(${e} ${t}) rotate(45)`,fill:`#000`},`${e}-${t}`))]}),(0,H.jsx)(`path`,{d:vo,mask:`url(#${t})`})]})}function U({name:e,size:t=16,className:n,style:r,strokeWidth:i=1.7}){let a={width:t,height:t,viewBox:`0 0 24 24`,className:n,style:r,"aria-hidden":!0,focusable:!1};return e===`more`?(0,H.jsxs)(`svg`,{...a,fill:`currentColor`,children:[(0,H.jsx)(`rect`,{x:`3.8`,y:`10.3`,width:`3.4`,height:`3.4`}),(0,H.jsx)(`rect`,{x:`10.3`,y:`10.3`,width:`3.4`,height:`3.4`}),(0,H.jsx)(`rect`,{x:`16.8`,y:`10.3`,width:`3.4`,height:`3.4`})]}):e===`stop`?(0,H.jsx)(`svg`,{...a,fill:`currentColor`,children:(0,H.jsx)(`rect`,{x:`6.5`,y:`6.5`,width:`11`,height:`11`})}):e===`dot`?(0,H.jsx)(`svg`,{...a,fill:`currentColor`,children:(0,H.jsx)(`rect`,{x:`8`,y:`8`,width:`8`,height:`8`})}):e===`git`?(0,H.jsx)(So,{...a}):(0,H.jsx)(`svg`,{...a,fill:`none`,stroke:`currentColor`,strokeWidth:i,strokeLinecap:`square`,strokeLinejoin:`miter`,strokeMiterlimit:go,children:(0,H.jsx)(`path`,{d:_o[e]})})}var Co=6;function wo(e,t,n,r=8){let i=e.x,a=i+t.width>n.width-r;a&&(i=e.x-t.width),i=Math.max(r,Math.min(i,n.width-r-t.width));let o=Math.max(0,n.height-r*2);if(t.height>o)return{left:i,top:r,maxHeight:o,origin:`top ${a?`right`:`left`}`};let s=e.y,c=s+t.height>n.height-r;return c&&(s=e.y-t.height),s=Math.max(r,Math.min(s,n.height-r-t.height)),{left:i,top:s,origin:`${c?`bottom`:`top`} ${a?`right`:`left`}`}}function To(e,t,n,r=8){let i=Math.max(r,Math.min(e.right-t.width,n.width-t.width-r)),a=Math.max(0,n.height-r*2);if(t.height>a)return{left:i,top:r,maxHeight:a,origin:`top right`};let o=e.bottom+Co,s=o+t.height>n.height-r;return{left:i,top:s?Math.max(r,e.top-t.height-Co):o,origin:`${s?`bottom`:`top`} right`}}var Eo=`[role="menuitem"]:not([aria-disabled="true"])`,Do=new Set;function Oo(e){let t=[],n=null;for(let r of e.querySelectorAll(Eo)){let e=r.closest(`.menu-row`),i=t[t.length-1];e&&e===n&&i?i.push(r):t.push([r]),n=e}return t}function ko(e){let t=[];for(let n of e){if(`heading`in n){t.push({heading:n,entries:[]});continue}let e=t[t.length-1];e||(e={heading:void 0,entries:[]},t.push(e)),e.entries.push(n)}return t}function Ao({entries:e,label:t,anchor:n,onClose:r}){let i=(0,l.useRef)(null),[a,o]=(0,l.useState)(void 0),s=(0,l.useId)(),c=(0,l.useRef)(r);c.current=r;let u=(0,l.useRef)(n);u.current=n,(0,l.useLayoutEffect)(()=>{let e=i.current;if(!e)return;let t={width:e.offsetWidth,height:e.offsetHeight},n={width:window.innerWidth,height:window.innerHeight},r=u.current;o(r.kind===`point`?wo(r,t,n):To(r.el.getBoundingClientRect(),t,n))},[]),(0,l.useEffect)(()=>{i.current?.querySelector(Eo)?.focus();let e=()=>c.current(!1);for(let e of[...Do])e();return Do.add(e),()=>{Do.delete(e)}},[]),(0,l.useEffect)(()=>{let e=()=>c.current(!1),t=e=>e instanceof Node&&(i.current?.contains(e)??!1),n=n=>{if(t(n.target))return;let r=u.current;r.kind===`button`&&n.target instanceof Node&&r.el.contains(n.target)||e()},r=n=>{t(n.target)||e()};return document.addEventListener(`pointerdown`,n,!0),window.addEventListener(`resize`,e),window.addEventListener(`scroll`,r,!0),window.addEventListener(`wheel`,r,{capture:!0,passive:!0}),window.addEventListener(`blur`,e),()=>{document.removeEventListener(`pointerdown`,n,!0),window.removeEventListener(`resize`,e),window.removeEventListener(`scroll`,r,!0),window.removeEventListener(`wheel`,r,!0),window.removeEventListener(`blur`,e)}},[]);let d=e=>{e.disabled||(c.current(!0),e.onSelect())},f=(e,t)=>{(e.key===`Enter`||e.key===` `)&&(e.preventDefault(),d(t))},p=e=>{let t=i.current;if(!t)return;let n=Oo(t),r=document.activeElement,a=n.findIndex(e=>r!==null&&e.includes(r)),o=a>=0?n[a]?.indexOf(r)??0:0,s=(e,t=0)=>{let r=n[(e+n.length)%n.length];r?.[Math.min(t,r.length-1)]?.focus()};switch(e.key){case`ArrowDown`:e.preventDefault(),s(a+1,o);break;case`ArrowUp`:e.preventDefault(),s(a<0?n.length-1:a-1,o);break;case`ArrowLeft`:case`ArrowRight`:{let t=n[a];if(!t||t.length<2)break;e.preventDefault(),t[(o+(e.key===`ArrowRight`?1:-1)+t.length)%t.length]?.focus();break}case`Home`:e.preventDefault(),s(0);break;case`End`:e.preventDefault(),n[n.length-1]?.at(-1)?.focus();break;case`Escape`:e.preventDefault(),e.stopPropagation(),c.current(!0);break;case`Tab`:c.current(!1)}},m=e=>(0,H.jsxs)(`div`,{children:[e.separatorAbove?(0,H.jsx)(`div`,{className:`menu-sep`,role:`separator`}):null,(0,H.jsxs)(`div`,{role:`menuitem`,tabIndex:-1,className:`menu-item`,"data-danger":e.danger?``:void 0,"aria-disabled":e.disabled||void 0,"data-tip":e.disabled?e.disabledReason:void 0,onClick:()=>d(e),onKeyDown:t=>f(t,e),children:[e.icon?(0,H.jsx)(U,{name:e.icon,size:15}):(0,H.jsx)(`span`,{className:`menu-icon-gap`}),(0,H.jsx)(`span`,{children:e.label})]})]},e.id),h=e=>(0,H.jsx)(`div`,{className:`menu-row`,children:e.items.map((e,t)=>{let n=e.disabled&&e.disabledReason?e.disabledReason:e.label;return(0,H.jsxs)(l.Fragment,{children:[t>0&&e.separatorAbove?(0,H.jsx)(`div`,{className:`menu-vsep`,role:`separator`,"aria-orientation":`vertical`}):null,(0,H.jsx)(`div`,{role:`menuitem`,tabIndex:-1,className:`menu-item`,"data-compact":``,"data-danger":e.danger?``:void 0,"aria-label":n,"aria-disabled":e.disabled||void 0,"data-tip":n,onClick:()=>d(e),onKeyDown:t=>f(t,e),children:e.icon?(0,H.jsx)(U,{name:e.icon,size:15}):(0,H.jsx)(`span`,{children:e.label})})]},e.id)})},e.id),g=e=>`items`in e?h(e):m(e);return(0,x.createPortal)((0,H.jsx)(`div`,{ref:i,className:`menu`,role:`menu`,"aria-label":t,"data-ready":a?``:void 0,style:{left:a?.left??0,top:a?.top??0,maxHeight:a?.maxHeight,transformOrigin:a?.origin},onKeyDown:p,onClick:e=>e.stopPropagation(),onContextMenu:e=>e.preventDefault(),children:ko(e).map((e,t)=>{let n=e.heading,r=n?`${s}-${n.id}`:void 0;return(0,H.jsxs)(l.Fragment,{children:[t>0?(0,H.jsx)(`div`,{className:`menu-sep`,role:`separator`}):null,(0,H.jsxs)(`div`,{role:n?`group`:void 0,"aria-labelledby":r,children:[n?(0,H.jsx)(`div`,{className:`menu-label`,id:r,children:n.heading}):null,e.entries.map(g)]})]},n?.id??`plain-${t}`)})}),document.body)}function jo({items:e,label:t,icon:n=`more`,glyph:r,className:i,onOpenChange:a}){let[o,s]=(0,l.useState)(!1),c=(0,l.useRef)(null),u=(0,l.useCallback)(e=>{s(!1),a?.(!1),e&&c.current?.focus()},[a]);return(0,H.jsxs)(H.Fragment,{children:[(0,H.jsx)(`button`,{ref:c,type:`button`,className:`icon-btn${i?` ${i}`:``}`,"aria-label":t,"aria-haspopup":`menu`,"aria-expanded":o,"data-tip":o?void 0:t,"data-open":o?``:void 0,onClick:e=>{e.stopPropagation();let t=!o;s(t),a?.(t)},onKeyDown:e=>{e.key===`ArrowDown`&&!o&&(e.preventDefault(),e.stopPropagation(),s(!0),a?.(!0))},children:r??(0,H.jsx)(U,{name:n,size:16})}),o&&c.current?(0,H.jsx)(Ao,{entries:typeof e==`function`?e():e,label:t,anchor:{kind:`button`,el:c.current},onClose:u}):null]})}var Mo={claude:{src:`/assets/claude-BizdYttu.svg`,optical:{left:0,top:0,width:1,height:1,reach:22/24}},composer:{src:`/assets/composer-BWvu9foS.svg`,optical:{left:.0612,top:0,width:.8775,height:1,reach:20/24}},deepseek:{src:`/assets/deepseek-Cl8NyQEB.svg`,optical:{left:0,top:.125,width:1,height:.7358,reach:22/24}},gemini:{src:`/assets/gemini-CGCgtdu_.svg`,optical:{left:.0417,top:.0417,width:.9167,height:.9167,reach:23/24}},glm:{src:`/assets/glm-efVYFzYJ.svg`,optical:{left:0,top:.0833,width:1,height:.8333,reach:21/24}},grok:{src:`/assets/grok-CXGI5ZJ8.svg`,optical:{left:4e-4,top:.0221,width:.9988,height:.9583,reach:1,hang:.14}},kimi:{src:`/assets/kimi-CoXq7FVU.svg`,optical:{left:.125,top:0,width:.8654,height:.8333,reach:23/24}},llama:{src:`/assets/llama-CBjxA_UR.svg`,optical:{left:0,top:.1667,width:1,height:.6667,reach:1}},minimax:{src:`/assets/minimax-DgXRHG5V.svg`,optical:{left:0,top:.0833,width:1,height:.8333,reach:1}},mistral:{src:`/assets/mistral-B4GaxyUG.svg`,optical:{left:0,top:.1417,width:1,height:.7142,reach:21/24}},openai:{src:`/assets/openai-L0iksW7i.svg`,optical:{left:0,top:0,width:1,height:.9912,reach:22/24}},qwen:{src:`/assets/qwen-2yX8JBoZ.svg`,optical:{left:0,top:0,width:.9829,height:1,reach:19/24}}};function No({family:e,size:t=12}){let n={width:t,height:t,"--mark":`url("${Mo[e].src}")`};return(0,H.jsx)(`span`,{className:`model-mark`,"data-family":e,style:n,"aria-hidden":`true`})}var Po={unknown:{icon:`sparkle`,stroke:1.55,optical:{left:.1771,top:.1355,width:.7106,height:.7731,reach:18/24}},simulated:{icon:`flask`,stroke:1.39,optical:{left:.1929,top:.1169,width:.6142,height:.7704,reach:20/24}}};function Fo(e,t){let n=t*e.reach/Math.max(e.width,e.height);return{box:n,translate:`${-(e.left+(e.hang??0))*n}px ${(.5-e.top-e.height/2)*n}px`}}function Io({family:e,simulated:t=!1,size:n=24,tip:r}){let i={width:n,height:n};if(e&&!t){let{src:t,optical:a}=Mo[e],{box:o,translate:s}=Fo(a,n),c={width:o,height:o,translate:s,"--mark":`url("${t}")`};return(0,H.jsx)(`span`,{className:`model-slot`,"data-tip":r,style:i,"aria-hidden":`true`,children:(0,H.jsx)(`span`,{className:`model-mark`,"data-family":e,style:c})})}let a=t?`simulated`:`unknown`,{icon:o,stroke:s,optical:c}=Po[a],{box:l,translate:u}=Fo(c,n);return(0,H.jsx)(`span`,{className:`model-slot`,"data-placeholder":a,"data-tip":r,style:i,"aria-hidden":`true`,children:(0,H.jsx)(U,{name:o,size:l,strokeWidth:s,className:`model-glyph`,style:{translate:u}})})}function Lo({phase:e,size:t=8}){return(0,H.jsx)(`span`,{className:`status-dot`,"data-phase":e,style:{width:t,height:t},"aria-hidden":`true`})}function Ro({icon:e,label:t,size:n=15,tone:r=`default`,className:i,...a}){return(0,H.jsx)(`button`,{type:`button`,className:`icon-btn${i?` ${i}`:``}`,"data-tone":r,"aria-label":t,"data-tip":t,...a,children:(0,H.jsx)(U,{name:e,size:n})})}function zo({children:e,tone:t=`neutral`,icon:n,tip:r,className:i}){return(0,H.jsxs)(`span`,{className:`chip${i?` ${i}`:``}`,"data-tone":t,"data-tip":r,children:[n?(0,H.jsx)(U,{name:n,size:12}):null,e]})}function W({size:e=14}){let t=e-2,n=Math.floor(t/2),r={width:e,height:e,"--spin-band":`${n}px`,"--spin-n":t-n+1};return(0,H.jsx)(`span`,{className:`spinner`,style:r,"aria-hidden":`true`})}function G({value:e,label:t,size:n=13}){let r=V(),[i,a]=(0,l.useState)(!1),o=(0,l.useRef)(void 0);return(0,l.useEffect)(()=>()=>clearTimeout(o.current),[]),(0,H.jsx)(`button`,{type:`button`,className:`icon-btn icon-btn--bare`,"aria-label":t,"data-tip":i?r(`common.copied`):t,onClick:t=>{t.stopPropagation(),Bo(e).then(e=>{e?(a(!0),clearTimeout(o.current),o.current=setTimeout(()=>a(!1),1400)):Di(`warn`,r(`common.copyFailed`))})},children:(0,H.jsx)(U,{name:i?`check`:`copy`,size:n})})}async function Bo(e){try{return await navigator.clipboard.writeText(e),!0}catch{let t=document.createElement(`textarea`);t.value=e,t.setAttribute(`readonly`,``),t.style.cssText=`position:fixed;opacity:0;pointer-events:none`,document.body.appendChild(t),t.select();let n=document.execCommand(`copy`);return t.remove(),n}}function Vo(){let[e,t]=(0,l.useState)(void 0),[n,r]=(0,l.useState)(void 0),i=(0,l.useRef)(null),a=(0,l.useRef)(void 0),o=(0,l.useRef)(0),s=(0,l.useRef)(null);return(0,l.useEffect)(()=>{let e=()=>{clearTimeout(a.current),s.current=null,t(e=>{e&&(o.current=Date.now())}),r(void 0)},n=e=>{if(!e.getAttribute(`data-tip`))return;s.current=e;let n=()=>{if(!e.isConnected)return;let n=e.getAttribute(`data-tip`);if(!n)return;let i=e.getBoundingClientRect();r(void 0),t({text:n,rect:i,side:i.top<64?`bottom`:`top`})};clearTimeout(a.current),a.current=Date.now()-o.current<500?void 0:setTimeout(n,260),a.current||n()},i=t=>{let r=t.target?.closest?.(`[data-tip]`);r?r!==s.current&&n(r):s.current&&e()},c=t=>{let n=t.relatedTarget;s.current&&!(n&&s.current.contains(n))&&e()};document.addEventListener(`pointerover`,i),document.addEventListener(`pointerout`,c),document.addEventListener(`focusin`,i),document.addEventListener(`focusout`,e);let l=t=>{t.key===`Escape`&&e()};document.addEventListener(`pointerdown`,e,!0),document.addEventListener(`scroll`,e,!0),document.addEventListener(`keydown`,l),window.addEventListener(`blur`,e);let u=new MutationObserver(()=>{let n=s.current;if(!n)return;let r=n.getAttribute(`data-tip`);r?t(e=>e&&e.text!==r?{...e,text:r}:e):e()});return u.observe(document.body,{subtree:!0,attributes:!0,attributeFilter:[`data-tip`]}),()=>{u.disconnect(),clearTimeout(a.current),document.removeEventListener(`pointerover`,i),document.removeEventListener(`pointerout`,c),document.removeEventListener(`focusin`,i),document.removeEventListener(`focusout`,e),document.removeEventListener(`pointerdown`,e,!0),document.removeEventListener(`scroll`,e,!0),document.removeEventListener(`keydown`,l),window.removeEventListener(`blur`,e)}},[]),(0,l.useLayoutEffect)(()=>{if(!e||!i.current)return;let t=i.current.getBoundingClientRect(),n=e.rect.left+e.rect.width/2,a=Math.min(Math.max(8,n-t.width/2),window.innerWidth-t.width-8),o=e.side===`top`?e.rect.top-t.height-8:e.rect.bottom+8;r({left:a,top:Math.max(8,o)})},[e]),e?(0,x.createPortal)((0,H.jsx)(`div`,{ref:i,className:`tip`,role:`tooltip`,"data-ready":n?``:void 0,style:{left:n?.left??0,top:n?.top??0},children:e.text}),document.body):null}function Ho(e){return e.activeRunId!==void 0||e.status===`queued`||e.status===`starting`}function Uo(e){return e.status!==`stopped`}function Wo(e){return!Ht(e.phase)}function Go(e,t){return Jo(e,t,{includeOpen:!0})}function Ko(e,t){let{count:n,complete:r}=Wa(e,e=>Ve(z.get(),e)),i=[{id:`export-md`,label:t(`menu.exportMd`),icon:`download`,onSelect:()=>void Ea(e.id,{scope:`session`,detail:`brief`})}];return e.childIds.length>0&&i.push({id:`export-md-tree`,label:r?t(`menu.exportMdTree`,{n}):t(`menu.exportMdTreeAny`),icon:`download`,onSelect:()=>void Ea(e.id,{scope:`tree`,detail:`brief`})}),i.push({id:`export-md-full`,label:t(`menu.exportMdFull`),icon:`download`,onSelect:()=>void Ea(e.id,{scope:`session`,detail:`full`})}),i}function qo(e,t){let n=pa.get().busy>0;if(e.archivedAt!==void 0)return{id:`unarchive`,label:t(`menu.unarchive`),icon:`unarchive`,disabled:n,disabledReason:t(`archive.busy`),onSelect:()=>void Ca([e.id])};let r=Ba(Object.values(z.get().sessions),e.id)??Ba([e],e.id),i=r?.blocked;return{id:`archive`,label:r&&r.descendants>0?t(`menu.archiveTree`,{n:r.descendants}):t(`menu.archive`),icon:`archive`,disabled:n||i!==void 0,disabledReason:i?ya(i,t):t(`archive.busy`),onSelect:()=>void xa([e.id])}}function Jo(e,t,n={}){let r=Ht(e.phase),i=Ho(e),a=[],o=z.get().archivedCount!==void 0;return n.includeOpen&&a.push({id:`open`,label:t(`menu.open`),icon:`eye`,onSelect:()=>Ni({kind:`session`,id:e.id})}),a.push({id:`copy-link`,label:t(`menu.copyLink`),icon:`link`,onSelect:()=>{Bo(ro(e.id)).then(e=>Di(e?`success`:`warn`,t(e?`common.copied`:`common.copyFailed`),1800))}},{id:`copy-id`,label:t(`menu.copyId`),icon:`copy`,onSelect:()=>{Bo(e.id).then(e=>Di(e?`success`:`warn`,t(e?`common.copied`:`common.copyFailed`),1800))}}),o&&a.push(...Ko(e,t).map((e,t)=>t===0?{...e,separatorAbove:!0}:e)),a.push({id:`cancel`,label:t(`menu.cancelRun`),icon:`stop`,separatorAbove:!0,disabled:!i,disabledReason:t(`menu.cancelRunDisabled`),onSelect:()=>void ia(e.id,{ok:t(`toast.cancelOk`),nothing:t(`toast.cancelNothing`),failed:t(`toast.cancelFailed`)})}),a.push({id:`stop`,label:t(`menu.stopSession`),icon:`pause`,disabled:!Uo(e),disabledReason:t(`menu.stopDisabled`),onSelect:()=>na({title:t(`confirm.stopTitle`),body:t(r?`confirm.stopBodyActive`:`confirm.stopBody`),confirmLabel:t(`menu.stopSession`),onConfirm:()=>B(e.id,{ok:t(`toast.stopOk`),failed:t(`toast.stopFailed`)})})}),o&&a.push(qo(e,t)),a.push({id:`remove`,label:t(`menu.remove`),icon:`trash`,danger:!0,disabled:!Wo(e),disabledReason:t(`menu.removeDisabled`),onSelect:()=>na({title:t(`confirm.removeTitle`),body:t(`confirm.removeBody`,{title:e.title}),confirmLabel:t(`menu.remove`),tone:`danger`,onConfirm:async()=>{await aa(e.id,{ok:t(`toast.removeOk`),failed:t(`toast.removeFailed`)})&&n.afterRemove?.()}})}),a}var Yo=200;function Xo({session:e,depth:t,below:n,busy:r}){let i=V(),a=$a(),o=e.runtime===`fixture`,s=eo(e,i),c=e.effort?.trim()||void 0,l=Vt(e,i),u=e.phase===`done`?e.lastRun?.durationMs:void 0,d=e.archivedAt?Et(e.archivedAt,a,!0):``,f=fi({kind:`session`,id:e.id});return(0,H.jsxs)(`div`,{className:`slist-row arow`,role:`listitem`,"data-phase":e.phase,"data-depth":t,style:t>0?{paddingLeft:20+t*22}:void 0,onClick:t=>{t.target.closest(`a,button,[role='menu']`)||Ni({kind:`session`,id:e.id})},children:[t>0?(0,H.jsx)(`span`,{className:`slist-branch`,"aria-hidden":`true`}):null,(0,H.jsx)(`div`,{className:`slist-avatar`,children:(0,H.jsx)(Io,{family:Ja(e.model),simulated:o,size:20})}),(0,H.jsxs)(`div`,{className:`slist-main`,children:[(0,H.jsxs)(`div`,{className:`slist-top`,children:[(0,H.jsx)(`a`,{className:`slist-title`,href:f,onClick:e=>e.stopPropagation(),children:e.title}),n.count>0?(0,H.jsx)(`span`,{className:`slist-files num`,children:n.complete?i(`archive.children`,{n:n.count}):i(`archive.childrenAny`)}):null,e.archivedBy===`retention`?(0,H.jsx)(zo,{tone:`neutral`,tip:i(`archive.autoTip`),children:i(`archive.auto`)}):null]}),(0,H.jsx)(`div`,{className:`slist-sub`,"data-tip":l,children:l})]}),(0,H.jsxs)(`div`,{className:`slist-spec`,children:[(0,H.jsxs)(`span`,{className:`slist-harness`,children:[(0,H.jsx)(ho,{harness:e.harness,size:11,variant:`bare`}),(0,H.jsx)(`span`,{children:no(e.harness,i)})]}),(0,H.jsx)(`span`,{className:`slist-model`,"data-tip":s,children:o?i(`run.simulated`):s}),!o&&c?(0,H.jsx)(`span`,{className:`a-effort`,children:c}):null]}),(0,H.jsxs)(`div`,{className:`slist-meta`,children:[(0,H.jsx)(`span`,{className:`slist-state${u===void 0?``:` num`}`,"data-kind":e.phase,children:u===void 0?Lt(e.phase,i):v(u)}),d?(0,H.jsx)(`time`,{className:`slist-time num`,dateTime:e.archivedAt,children:i(`archive.archivedAt`,{time:d})}):null]}),(0,H.jsxs)(`div`,{className:`arow-actions`,children:[(0,H.jsx)(Ro,{icon:`unarchive`,size:15,label:i(`archive.unarchiveOf`,{title:e.title}),"data-tip":i(`archive.unarchiveTip`),disabled:r,onClick:()=>void Ca([e.id])}),(0,H.jsx)(jo,{items:()=>Ko(e,i),label:i(`archive.exportOf`,{title:e.title}),icon:`download`})]})]})}function Zo(){let e=V(),t=I(z,e=>e.archived),n=I(z,e=>e.archivedLoaded),r=I(z,e=>e.archivedCount),i=I(pa,e=>e.list),a=I(pa,e=>e.busy>0),o=r!==void 0,[s,c]=(0,l.useState)(Yo);(0,l.useEffect)(()=>{o&&!n&&ga().catch(()=>void 0)},[o,n]);let u=(0,l.useMemo)(()=>Xa(Object.values(t)),[t]),d=u.length>s?u.slice(0,s):u,f=o?!n&&i.status===`error`?(0,H.jsxs)(`div`,{className:`slist-empty`,role:`alert`,children:[(0,H.jsx)(`p`,{children:e(`archive.loadFailed`)}),i.error?(0,H.jsx)(`p`,{className:`arow-error`,children:i.error}):null,(0,H.jsxs)(`button`,{type:`button`,className:`btn`,onClick:()=>void ga({force:!0}).catch(()=>void 0),children:[(0,H.jsx)(U,{name:`refresh`,size:14}),e(`common.retry`)]})]}):n?u.length===0?(0,H.jsx)(`div`,{className:`slist-empty`,children:e(`archive.empty`)}):(0,H.jsxs)(`div`,{className:`alist`,children:[(0,H.jsx)(`p`,{className:`alist-note`,children:e(`archive.note`)}),(0,H.jsx)(`div`,{className:`slist`,role:`list`,"aria-label":e(`archive.title`),children:d.map(({session:e,depth:n})=>(0,H.jsx)(Xo,{session:e,depth:n,below:Wa(e,e=>t[e]),busy:a},e.id))}),u.length>d.length?(0,H.jsx)(`div`,{className:`alist-more`,children:(0,H.jsx)(`button`,{type:`button`,className:`btn`,onClick:()=>c(e=>e+Yo),children:e(`archive.more`,{n:u.length-d.length})})}):null]}):(0,H.jsxs)(`div`,{className:`slist-empty arow-loading`,role:`status`,children:[(0,H.jsx)(W,{size:14}),(0,H.jsx)(`span`,{children:e(`archive.loading`)})]}):(0,H.jsx)(`div`,{className:`slist-empty`,children:e(`archive.unsupported`)});return(0,H.jsxs)(`div`,{className:`list-stage archived-stage`,children:[(0,H.jsxs)(`header`,{className:`ws-head`,"data-mode":`flow`,children:[(0,H.jsxs)(`div`,{className:`ws-head-line`,children:[(0,H.jsxs)(`span`,{className:`ws-ctx-primary`,children:[(0,H.jsx)(U,{name:`archive`,size:13,className:`ws-ctx-ico`}),(0,H.jsx)(`span`,{className:`ws-ctx-folder`,children:e(`archive.title`)})]}),o?(0,H.jsxs)(H.Fragment,{children:[(0,H.jsx)(`span`,{className:`ws-ctx-sep`,"aria-hidden":`true`}),(0,H.jsx)(`span`,{className:`ws-ctx-item num`,children:e(`archive.subtitle`,{n:n?u.length:r})})]}):null]}),o?(0,H.jsx)(`div`,{className:`ws-head-actions`,children:(0,H.jsxs)(`button`,{type:`button`,className:`ws-action-btn`,"aria-label":e(`archive.retentionLink`),"data-tip":e(`archive.retentionLinkTip`),onClick:()=>$i(`history`),children:[(0,H.jsx)(U,{name:`clock`,size:13}),(0,H.jsx)(`span`,{className:`ws-action-label`,children:e(`archive.retentionLink`)})]})}):null]}),(0,H.jsx)(`div`,{className:`list-scroll`,children:f})]})}var Qo=[{mode:`left`,icon:`alignLeft`,label:`arrange.left`},{mode:`hcenter`,icon:`alignHCenter`,label:`arrange.hcenter`},{mode:`right`,icon:`alignRight`,label:`arrange.right`},{mode:`top`,icon:`alignTop`,label:`arrange.top`},{mode:`vmiddle`,icon:`alignVMiddle`,label:`arrange.vmiddle`},{mode:`bottom`,icon:`alignBottom`,label:`arrange.bottom`}],$o=[{axis:`horizontal`,icon:`distributeH`,label:`arrange.distributeH`},{axis:`vertical`,icon:`distributeV`,label:`arrange.distributeV`}];function es(){return typeof navigator<`u`&&/mac|iphone|ipad/i.test(navigator.platform)?`⌘`:`Ctrl+`}function ts({engine:e}){let t=V(),{selected:n,canUndo:r,canRedo:i}=(0,l.useSyncExternalStore)(e.subscribe,e.getState),[a,o]=(0,l.useState)(``);if(n<2)return null;let s=es(),c=(e,r)=>()=>{o(r()?t(`arrange.done`,{action:e,n}):t(`arrange.unchanged`,{action:e}))},u=n>=3;return(0,H.jsxs)(`div`,{className:`arrange`,role:`toolbar`,"aria-label":t(`arrange.label`),children:[(0,H.jsxs)(`span`,{className:`arrange-count`,children:[(0,H.jsx)(`b`,{className:`num`,children:n}),` `,t(`arrange.count`)]}),(0,H.jsx)(`span`,{className:`dock-divider arrange-lead`,"aria-hidden":`true`}),(0,H.jsx)(`div`,{className:`arrange-group`,children:Qo.map(({mode:n,icon:r,label:i})=>(0,H.jsx)(Ro,{icon:r,label:t(i),onClick:c(t(i),()=>e.align(n))},n))}),(0,H.jsx)(`span`,{className:`dock-divider`,"aria-hidden":`true`}),(0,H.jsx)(`div`,{className:`arrange-group`,children:$o.map(({axis:n,icon:r,label:i})=>(0,H.jsx)(Ro,{icon:r,label:u?t(i):t(`arrange.needThree`,{label:t(i)}),"aria-disabled":!u||void 0,onClick:u?c(t(i),()=>e.distribute(n)):void 0},n))}),(0,H.jsx)(`span`,{className:`dock-divider`,"aria-hidden":`true`}),(0,H.jsxs)(`div`,{className:`arrange-group`,children:[(0,H.jsx)(Ro,{icon:`undo`,label:t(`arrange.undo`,{keys:`${s}Z`}),"aria-disabled":!r||void 0,onClick:r?()=>e.undo():void 0}),(0,H.jsx)(Ro,{icon:`redo`,label:t(`arrange.redo`,{keys:`${s}Shift+Z`}),"aria-disabled":!i||void 0,onClick:i?()=>e.redo():void 0})]}),(0,H.jsx)(`span`,{className:`dock-divider`,"aria-hidden":`true`}),(0,H.jsx)(Ro,{icon:`close`,label:t(`arrange.clear`),onClick:()=>e.clearSelection()}),(0,H.jsx)(`span`,{className:`sr-only`,"aria-live":`polite`,children:a})]})}var ns=new ot({nodeId:void 0});function rs(e){return I(ns,t=>t.nodeId===e)}function is(e){return e.sessionRef?.source===`declared`}function as(e){return e.kind===`agent`&&!e.workspace}function os(e,t){let n=e.sessionRef;return n?[`${t(`origin.refLabel.${n.kind}`)}: ${n.id}`,...n.source===`declared`?[t(`origin.refDeclaredTip`)]:[]]:[]}function ss(e,t){if(e.workspace){let n=e.workspaceSource?t(`origin.workspaceFrom.${e.workspaceSource}`):void 0;return`${t(`origin.workspace`)}: ${n?t(`origin.workspaceNote`,{path:e.workspace,from:n}):e.workspace}`}return as(e)?`${t(`origin.workspace`)}: ${t(`origin.workspaceUnknownTip`)}`:void 0}function cs(e){return e.target===e.currentTarget&&!e.ctrlKey&&!e.metaKey&&!e.altKey}function ls(e,t){return n=>{if(!cs(n))return;if(n.key===` `&&n.shiftKey){n.preventDefault(),e.toggleSelection(t);return}let r=n.shiftKey?50:10,i={ArrowLeft:[-r,0],ArrowRight:[r,0],ArrowUp:[0,-r],ArrowDown:[0,r]}[n.key];i&&(n.preventDefault(),e.moveNode(t,...i))}}var us=new Set([`codex`,`cursor`,`claude`,`pi`]),ds=12;function fs({host:e,size:t=18,fit:n=!1}){if(us.has(e))return(0,H.jsx)(ho,{harness:e,size:t,variant:`bare`});let r=n?t*1.2:t;return e===`console`?(0,H.jsx)(U,{name:`user`,size:r}):(0,H.jsx)(U,{name:`terminal`,size:r})}var ps=(0,l.memo)(function({origin:e,count:t,running:n,startedAt:r,hostTitle:i,compact:a=!1,folderNode:o=!1,collapsed:s=!1,hidden:c=t,engine:u}){let d=V(),f=$a(),p=(0,l.useRef)(null),m=rs(Tn(e.key));(0,l.useLayoutEffect)(()=>{let t=p.current;return t?u.register(Tn(e.key),t):void 0},[u,e.key]);let h=(0,l.useMemo)(()=>ls(u,Tn(e.key)),[u,e.key]),g=e.kind===`user`,_=g?d(`origin.user`):e.hostLabel,v=!g&&!us.has(e.host),y=[d(`origin.tipHead`,{host:e.hostLabel}),...os(e,d),ss(e,d),`${d(`origin.started`)}: ${Dt(r,f)}`].filter(Boolean).join(`
21
- `),b=n>0?d(`origin.countRunning`,{n:t,running:n}):d(`origin.count`,{n:t}),x=n>0?d(`origin.collapsedTipRunning`,{n:c,running:n}):d(`origin.collapsedTip`,{n:c}),S=o?void 0:e.workspace||void 0,C=!o&&as(e),w=S!==void 0||C,T=e=>(0,H.jsx)(`time`,{className:e,dateTime:r,children:Et(r,f,a)});return(0,H.jsxs)(`div`,{ref:p,className:`node origin`,"data-node":!0,"data-node-id":Tn(e.key),"data-host":e.host,"data-tip":y,"data-collapsed":s?``:void 0,"data-menu-open":m?``:void 0,tabIndex:0,role:`group`,"aria-label":d(s?`scene.originLabelCollapsed`:`scene.originLabel`,{title:_}),"aria-description":d(`scene.originKeyboard`),onKeyDown:h,children:[(0,H.jsxs)(`header`,{className:`o-head`,children:[(0,H.jsx)(`span`,{className:`a-mark`,children:(0,H.jsx)(fs,{host:e.host,size:ds,fit:!0})}),(0,H.jsx)(`span`,{className:`o-label`,children:d(`origin.head`)}),v?(0,H.jsx)(`span`,{className:`a-model`,children:_}):null,s?(0,H.jsxs)(`button`,{type:`button`,className:`o-count o-expand num`,"aria-label":d(`origin.expand`),"aria-description":x,"data-tip":x,onClick:()=>Wi(e.key,!1),children:[(0,H.jsx)(U,{name:`eyeOff`,size:11,strokeWidth:1.9}),n>0?(0,H.jsx)(`i`,{className:`a-run`,"aria-hidden":`true`}):null,t]}):(0,H.jsxs)(`span`,{className:`o-count num`,"data-tip":b,children:[n>0?(0,H.jsx)(`i`,{className:`a-run`,"aria-hidden":`true`}):null,t]})]}),(0,H.jsxs)(`div`,{className:`o-body`,children:[(0,H.jsxs)(`div`,{className:`o-main`,children:[w?(0,H.jsx)(U,{name:`folder`,size:13,className:`o-ico`}):(0,H.jsx)(U,{name:`clock`,size:13,className:`o-ico`}),S?(0,H.jsx)(`span`,{className:`o-text`,children:It(S)}):C?(0,H.jsx)(`span`,{className:`o-text o-unknown`,children:d(`origin.workspaceUnknown`)}):T(`o-text num`)]}),w?(0,H.jsx)(`span`,{className:`o-sub`,children:T(`num`)}):null,i?(0,H.jsx)(`span`,{className:`o-title`,"data-tip":`${d(`origin.titleTip`,{host:e.hostLabel})}\n${i}`,children:i}):null]})]})}),ms=5,hs=6;function gs({variant:e=`floating`}){let t=V(),n=I(z,e=>e.conn);return n===`live`?null:(0,H.jsx)(`div`,{className:`status-notices`,"data-place":e,"aria-live":`polite`,"data-modal-inert":e===`floating`?``:void 0,children:(0,H.jsxs)(`span`,{className:`status-note`,"data-conn":n,children:[(0,H.jsx)(`i`,{"aria-hidden":`true`}),t(`conn.${n}`)]})})}function _s(e,t,n){let[r,i]=(0,l.useState)({scope:n,memory:void 0}),a=Za(e,t,r.scope===n?r.memory:void 0,hs);return r.scope===n&&Qa(r.memory,a.memory)||i({scope:n,memory:a.memory}),a}function vs({workspaces:e,sessions:t,currentScope:n,focusedSessionId:r,focusedOriginKey:i,branches:a,archivedActive:o=!1}){let s=V(),c=$a(),u=I(z,e=>e.archivedCount),[d,f]=(0,l.useState)(!1),p=es()===`⌘`?`⌘B`:`Ctrl+B`,m=(0,l.useMemo)(()=>e.filter(e=>e.working>0||e.attention>0),[e]),h=(0,l.useMemo)(()=>e.filter(e=>e.working===0&&e.attention===0),[e]),g=h.slice(0,ms),_=h.slice(ms),v=i??(n.kind===`origin`?n.key:void 0),y=_.some(e=>e.key===v),b=d||y,x=(0,l.useMemo)(()=>e.reduce((e,t)=>e+t.working,0),[e]),S=(0,l.useMemo)(()=>e.reduce((e,t)=>e+t.running,0),[e]),C=r?i:void 0,w=_s((0,l.useMemo)(()=>C?Xa(ai(t,{kind:`origin`,key:C})).map(e=>e.session):[],[C,t]),r,C),T=!r&&!o,E=e=>{let t=si(e,s),o=T&&n.kind===`origin`&&n.key===e.key,l=!!(r&&i===e.key),u=a?.get(e.key),d=ci(e,c,u),f=l?w.rows:[],p=l?w.hidden:0;return(0,H.jsxs)(`div`,{className:`rail-entry`,"data-focused-parent":l?``:void 0,children:[(0,H.jsxs)(`button`,{type:`button`,className:`rail-item`,"aria-current":o?`page`:void 0,"data-active":o||l?``:void 0,"data-live":e.running>0?``:void 0,onClick:()=>Pi({kind:`origin`,key:e.key}),children:[(0,H.jsxs)(`span`,{className:`rail-item-top`,children:[(0,H.jsx)(`span`,{className:`rail-item-ico`,children:(0,H.jsx)(fs,{host:e.origin.host,size:12.5,fit:!0})}),(0,H.jsx)(`span`,{className:`rail-item-title`,"data-tip":t,children:t}),(0,H.jsxs)(`span`,{className:`rail-item-badges`,children:[e.attention>0?(0,H.jsx)(`span`,{className:`rail-att`,"data-tip":s(`attention.title`),children:(0,H.jsx)(U,{name:`alert`,size:10.5})}):null,e.running>0?(0,H.jsxs)(`span`,{className:`rail-live num`,children:[(0,H.jsx)(`i`,{className:`a-run`,"aria-hidden":`true`}),e.running]}):(0,H.jsx)(`span`,{className:`rail-count num`,children:e.total})]})]}),d?(0,H.jsx)(`span`,{className:`rail-item-sub`,"data-tip":e.workspace?`${e.workspace}${u?` (${u})`:``}`:d,children:d}):null]}),f.length>0?(0,H.jsxs)(`div`,{className:`rail-siblings`,role:`group`,"aria-label":s(`rail.siblings`),children:[f.map(e=>{let t=e.id===r;return(0,H.jsxs)(`button`,{type:`button`,className:`rail-sibling`,"aria-current":t?`page`:void 0,"data-active":t?``:void 0,"data-phase":e.phase,onClick:()=>Ni({kind:`session`,id:e.id}),children:[(0,H.jsx)(`i`,{className:`rail-sibling-dot`,"data-phase":e.phase,"aria-hidden":`true`}),(0,H.jsx)(`span`,{className:`rail-sibling-title`,"data-tip":e.title,children:e.title})]},e.id)}),p>0?(0,H.jsx)(`button`,{type:`button`,className:`rail-sibling rail-sibling--more`,onClick:()=>Pi({kind:`origin`,key:e.key}),children:s(`rail.moreSessions`,{n:p})}):null]}):null]},e.key)};return(0,H.jsxs)(`aside`,{className:`rail-panel`,"aria-label":s(`rail.label`),"data-modal-inert":!0,children:[(0,H.jsxs)(`div`,{className:`rail-brand`,children:[(0,H.jsx)(`button`,{type:`button`,className:`rail-logo`,onClick:()=>Pi(e[0]?{kind:`origin`,key:e[0].key}:{kind:`all`}),children:`Ensemble`}),(0,H.jsx)(`button`,{type:`button`,className:`rail-ico-btn`,"aria-label":s(`rail.collapse`,{keys:p}),"data-tip":s(`rail.collapse`,{keys:p}),onClick:()=>Ji(!0),children:(0,H.jsx)(U,{name:`sidebar`,size:14})})]}),(0,H.jsxs)(`nav`,{className:`rail-nav`,children:[(0,H.jsxs)(`div`,{className:`rail-views`,children:[(0,H.jsx)(`button`,{type:`button`,className:`rail-item rail-item--view`,"aria-current":T&&$r(n,{kind:`active`})?`page`:void 0,"data-active":T&&$r(n,{kind:`active`})?``:void 0,onClick:()=>Pi({kind:`active`}),children:(0,H.jsxs)(`span`,{className:`rail-item-top`,children:[(0,H.jsx)(`span`,{className:`rail-item-ico`,children:(0,H.jsx)(U,{name:`zap`,size:12.5})}),(0,H.jsx)(`span`,{className:`rail-item-title`,children:s(`rail.active`)}),(0,H.jsx)(`span`,{className:`rail-item-badges`,children:S>0?(0,H.jsxs)(`span`,{className:`rail-live num`,children:[(0,H.jsx)(`i`,{className:`a-run`,"aria-hidden":`true`}),x]}):(0,H.jsx)(`span`,{className:`rail-count num`,children:x})})]})}),(0,H.jsx)(`button`,{type:`button`,className:`rail-item rail-item--view`,"aria-current":T&&$r(n,{kind:`all`})?`page`:void 0,"data-active":T&&$r(n,{kind:`all`})?``:void 0,onClick:()=>Pi({kind:`all`}),children:(0,H.jsxs)(`span`,{className:`rail-item-top`,children:[(0,H.jsx)(`span`,{className:`rail-item-ico`,children:(0,H.jsx)(U,{name:`layers`,size:12.5})}),(0,H.jsx)(`span`,{className:`rail-item-title`,children:s(`rail.all`)}),(0,H.jsx)(`span`,{className:`rail-item-badges`,children:(0,H.jsx)(`span`,{className:`rail-count num`,children:t.length})})]})})]}),(0,H.jsx)(`div`,{className:`rail-scroll`,children:e.length===0?(0,H.jsx)(`div`,{className:`rail-empty`,children:s(`rail.empty`)}):(0,H.jsxs)(H.Fragment,{children:[m.length>0?(0,H.jsxs)(`div`,{className:`rail-section`,children:[(0,H.jsx)(`div`,{className:`rail-section-label`,children:s(`rail.sectionActive`)}),m.map(E)]}):null,g.length>0?(0,H.jsxs)(`div`,{className:`rail-section`,children:[(0,H.jsx)(`div`,{className:`rail-section-label`,children:s(`rail.sectionRecent`)}),g.map(E)]}):null,_.length>0?(0,H.jsxs)(`div`,{className:`rail-section`,children:[(0,H.jsxs)(`button`,{type:`button`,className:`rail-section-toggle`,"aria-expanded":b,onClick:()=>f(e=>!e),children:[(0,H.jsx)(U,{name:b?`chevronDown`:`chevronRight`,size:11,strokeWidth:2.2}),(0,H.jsx)(`span`,{children:s(`rail.sectionEarlier`,{n:_.length})})]}),b?_.map(E):null]}):null]})}),u!==void 0&&(u>0||o)?(0,H.jsx)(`div`,{className:`rail-archived`,children:(0,H.jsx)(`button`,{type:`button`,className:`rail-item rail-item--view`,"aria-current":o?`page`:void 0,"data-active":o?``:void 0,onClick:()=>Ni({kind:`archived`}),children:(0,H.jsxs)(`span`,{className:`rail-item-top`,children:[(0,H.jsx)(`span`,{className:`rail-item-ico`,children:(0,H.jsx)(U,{name:`archive`,size:12.5})}),(0,H.jsx)(`span`,{className:`rail-item-title`,children:s(`archive.title`)}),(0,H.jsx)(`span`,{className:`rail-item-badges`,children:(0,H.jsx)(`span`,{className:`rail-count num`,children:u})})]})})}):null]}),(0,H.jsxs)(`footer`,{className:`rail-foot`,children:[(0,H.jsx)(gs,{variant:`inline`}),(0,H.jsx)(`div`,{className:`rail-foot-actions`,children:(0,H.jsx)(`button`,{type:`button`,className:`rail-settings`,"aria-label":s(`topbar.settings`),"data-tip":s(`topbar.settings`),onClick:()=>$i(),children:(0,H.jsx)(U,{name:`settings`,size:15})})})]})]})}function ys(){let e=V()(`rail.expand`,{keys:es()===`⌘`?`⌘B`:`Ctrl+B`});return(0,H.jsx)(`button`,{type:`button`,className:`rail-ico-btn rail-expand`,"aria-label":e,"data-tip":e,"data-modal-inert":!0,onClick:()=>Ji(!1),children:(0,H.jsx)(U,{name:`sidebar`,size:14})})}function bs({currentScope:e,currentWorkspace:t,archived:n=!1}){let r=V(),i=es()===`⌘`?`⌘K`:`Ctrl K`,a=n?r(`archive.title`):e.kind===`origin`&&t?si(t,r):e.kind===`active`?r(`rail.active`):r(`rail.all`);return(0,H.jsxs)(`header`,{className:`ws-topbar`,"data-modal-inert":!0,children:[(0,H.jsxs)(`div`,{className:`ws-topbar-left`,children:[(0,H.jsx)(`span`,{className:`ws-topbar-brand`,children:`Ensemble`}),(0,H.jsxs)(`button`,{type:`button`,className:`ws-topbar-switch`,"aria-label":r(`rail.switchTip`,{keys:i}),"data-tip":r(`rail.switchTip`,{keys:i}),onClick:()=>Yi(),children:[n?(0,H.jsx)(U,{name:`archive`,size:12.5}):e.kind===`origin`&&t?(0,H.jsx)(fs,{host:t.origin.host,size:12.5,fit:!0}):(0,H.jsx)(U,{name:e.kind===`active`?`zap`:`layers`,size:12.5}),(0,H.jsx)(`span`,{className:`ws-topbar-name`,children:a}),(0,H.jsx)(U,{name:`chevronDown`,size:12,className:`ws-topbar-chev`})]})]}),(0,H.jsx)(`div`,{className:`ws-topbar-right`,children:(0,H.jsx)(`button`,{type:`button`,className:`rail-ico-btn`,"aria-label":r(`topbar.settings`),"data-tip":r(`topbar.settings`),onClick:()=>$i(),children:(0,H.jsx)(U,{name:`settings`,size:15})})})]})}function xs({canvas:e,tools:t=!1,notices:n=!0}){return t?(0,H.jsxs)(H.Fragment,{children:[e?(0,H.jsx)(`div`,{className:`arrange-wrap`,"data-modal-inert":!0,children:(0,H.jsx)(ts,{engine:e.engine})}):null,n?(0,H.jsx)(gs,{variant:`floating`}):null]}):n?(0,H.jsx)(gs,{variant:`floating`}):null}var Ss=new Set,Cs,ws=3e3;function Ts(e){Cs={id:e,at:Date.now()};for(let t of[...Ss])t(e)}function Es(e){return Ss.add(e),()=>{Ss.delete(e)}}function Ds(){let e=Cs;if(Cs=void 0,!(!e||Date.now()-e.at>ws))return e.id}var Os=new Set;function ks(){for(let e of[...Os])e()}function As(e){return Os.add(e),()=>{Os.delete(e)}}function js(e){let t=0,n=0,r=!1,i=new Map;for(let a of e)a.type===`tool`?(t+=1,a.status===`failed`&&(n+=1),a.status===`running`&&(r=!0),i.set(a.category,(i.get(a.category)??0)+1)):a.streaming&&(r=!0);let a=e[0],o=e[e.length-1],s=a&&o&&t>0?Date.parse(o.updatedAt)-Date.parse(a.at):NaN;return{tools:t,failed:n,running:r,durationMs:Number.isFinite(s)?Math.max(0,s):void 0,mix:[...i.entries()].sort((e,t)=>t[1]-e[1])}}function Ms(e,t){let n=new Map;for(let[r,i]of e){let e=t(r);n.set(e,(n.get(e)??0)+i)}return[...n.entries()].sort((e,t)=>t[1]-e[1])}function Ns(e){let t=!1;return e.map(e=>{if(e===`message`)return t=!1,!1;if(e===`run`||e===`diagnostic`)return!1;let n=!t;return t=!0,n})}function Ps({scrollTop:e,clientHeight:t,scrollHeight:n},r){return n-e-t<r}function Fs(e,t){return{over:e>t,near:e>=Math.floor(t*.9)}}function Is(e,t){return e.trim().length===0?t:e.includes(t)?e:`${t}\n\n${e}`}var Ls=new Map;function Rs(e){return e===`live`?`ok`:e===`declared`?`amber`:`neutral`}function zs({summary:e}){let t=V(),{id:n}=e,[r,i]=(0,l.useState)(()=>Ls.get(n)??``),[a,o]=(0,l.useState)(!1),[s,c]=(0,l.useState)(!1),[u,d]=(0,l.useState)(void 0),f=(0,l.useRef)(null),p=(0,l.useRef)({}),m=(0,l.useRef)(n),h=e.phase===`running`,g=h||e.status===`queued`||e.status===`starting`,_=e.phase===`stopped`,v=e.capabilities.steer.support!==`no`,[y,b]=(0,l.useState)(void 0),x=h?y??(v?`steer`:`follow_up`):`auto`;(0,l.useEffect)(()=>{m.current=n,i(Ls.get(n)??``),d(void 0),b(void 0)},[n]),(0,l.useEffect)(()=>{r?Ls.set(n,r):Ls.delete(n)},[n,r]);let S=(0,l.useCallback)(()=>{let e=f.current;e&&(e.style.height=`auto`,e.style.height=`${e.scrollHeight}px`)},[]);(0,l.useLayoutEffect)(()=>S(),[r,_,S]),(0,l.useEffect)(()=>{let e=f.current;if(!e)return;let t=e.clientWidth,n=0,r=new ResizeObserver(()=>{e.clientWidth!==t&&(t=e.clientWidth,cancelAnimationFrame(n),n=requestAnimationFrame(S))});return r.observe(e),document.fonts?.ready.then(S),()=>{r.disconnect(),cancelAnimationFrame(n)}},[_,S]);let C=r.trim(),w=Fs(r.length,k.maxMessageChars),T=C.length>0&&!w.over&&!a&&!_,E=(0,l.useCallback)(async()=>{if(!T)return;let e=n,a=r;o(!0),d(void 0),i(``),Ls.delete(e),f.current?.focus(),ks();try{ua((await N.send(e,{text:C,mode:x})).summary)}catch(n){let r=`${t(`composer.sendFailed`)}${z.get().lang===`zh`?`:`:`: `}${Ai(n)}`;m.current===e?(i(e=>Is(e,a)),d(r)):Ls.set(e,Is(Ls.get(e)??``,a))}finally{o(!1)}},[T,n,x,t,r,C]),D=e=>{e.nativeEvent.isComposing||e.keyCode===229||(e.key===`Enter`&&!e.shiftKey?(e.preventDefault(),E()):e.key===`Escape`&&e.currentTarget.blur())},O=v?[`steer`,`follow_up`]:[`follow_up`],ee=e=>{if(O.length<2||![`ArrowLeft`,`ArrowRight`,`ArrowUp`,`ArrowDown`,`Home`,`End`].includes(e.key))return;e.preventDefault();let t=Math.max(0,O.indexOf(x)),n=e.key===`ArrowLeft`||e.key===`ArrowUp`?-1:1,r=e.key===`Home`?0:e.key===`End`?O.length-1:(t+n+O.length)%O.length,i=O[r];i&&(b(i),p.current[i]?.focus())},te=no(e.harness,t),ne=t(x===`steer`?`composer.placeholder.steer`:x===`follow_up`?`composer.placeholder.followUp`:`composer.placeholder.idle`,{name:te}),re=x===`steer`?e.capabilities.steer.verification:void 0,ie=x===`steer`?e.capabilities.steer.mode:x===`follow_up`?`after_run`:void 0,ae=ie?`capMode.${ie}`:void 0,oe=ae&&ie?t(ae)===ae?ie:t(ae):void 0,se=k.maxMessageChars.toLocaleString(),ce=u??(w.over?t(`composer.tooLong`,{max:se}):void 0);return _?(0,H.jsx)(`div`,{className:`composer`,"data-closed":``,children:(0,H.jsxs)(`div`,{className:`composer-closed`,children:[(0,H.jsx)(U,{name:`lock`,size:14}),(0,H.jsx)(`span`,{children:t(`composer.placeholder.closed`)})]})}):(0,H.jsx)(`div`,{className:`composer`,"data-busy":a?``:void 0,children:(0,H.jsxs)(`div`,{className:`composer-box`,"data-over":w.over?``:void 0,"data-error":u?``:void 0,children:[(0,H.jsx)(`textarea`,{ref:f,value:r,rows:1,placeholder:ne,"aria-label":t(`composer.label`),"aria-invalid":w.over||u?!0:void 0,enterKeyHint:`send`,onChange:e=>{i(e.target.value),u&&d(void 0)},onKeyDown:D}),ce||w.near?(0,H.jsxs)(`div`,{className:`composer-notice`,children:[ce?(0,H.jsxs)(`span`,{className:`composer-error`,role:`alert`,children:[(0,H.jsx)(U,{name:`alert`,size:12,strokeWidth:2}),(0,H.jsx)(`span`,{children:ce})]}):(0,H.jsx)(`span`,{}),w.near?(0,H.jsxs)(`span`,{className:`composer-count num`,"data-over":w.over?``:void 0,"aria-hidden":`true`,children:[r.length.toLocaleString(),` / `,se]}):null]}):null,(0,H.jsxs)(`div`,{className:`composer-bar`,children:[(0,H.jsx)(`div`,{className:`composer-mode`,children:h&&v?(0,H.jsx)(`div`,{className:`composer-modes`,role:`radiogroup`,"aria-label":t(`composer.mode`),onKeyDown:ee,children:O.map(e=>(0,H.jsx)(`button`,{ref:t=>{p.current[e]=t},type:`button`,role:`radio`,"aria-checked":x===e,tabIndex:x===e?0:-1,onClick:()=>b(e),children:t(e===`steer`?`composer.mode.steer`:`composer.mode.followUp`)},e))}):h?(0,H.jsxs)(`span`,{className:`composer-mode-label`,"data-tip":t(`composer.noSteer`),children:[(0,H.jsx)(U,{name:`clock`,size:12}),t(`composer.mode.followUp`)]}):(0,H.jsxs)(`span`,{className:`composer-mode-label`,children:[(0,H.jsx)(U,{name:`send`,size:12}),t(`composer.mode.idle`)]})}),re!==void 0||oe?(0,H.jsxs)(`div`,{className:`composer-meta`,children:[re===void 0?null:(0,H.jsxs)(`span`,{className:`cap-note`,"data-tone":Rs(re),"data-tip":t(`verify.tip.${re}`),children:[re===`live`?(0,H.jsx)(U,{name:`check`,size:11,strokeWidth:2.4}):null,t(`verify.${re}`)]}),oe?(0,H.jsxs)(`span`,{className:`cap-note`,"data-kind":`delivery`,children:[(0,H.jsx)(U,{name:`clock`,size:12}),oe]}):null]}):null,(0,H.jsxs)(`div`,{className:`composer-actions`,children:[g?(0,H.jsxs)(`button`,{type:`button`,className:`composer-stop`,disabled:s,"aria-busy":s||void 0,"data-tip":t(`composer.cancelTip`),"aria-label":t(`composer.cancel`),onClick:()=>{c(!0),ia(n,{ok:t(`toast.cancelOk`),nothing:t(`toast.cancelNothing`),failed:t(`toast.cancelFailed`)}).finally(()=>c(!1))},children:[s?(0,H.jsx)(W,{size:12}):(0,H.jsx)(U,{name:`stop`,size:13}),(0,H.jsx)(`span`,{className:`composer-stop-label`,children:t(`composer.cancel`)})]}):null,(0,H.jsx)(`button`,{type:`button`,className:`btn btn--primary send-btn`,disabled:!T,"aria-busy":a||void 0,"aria-label":t(`composer.send`),"data-tip":w.over?t(`composer.tooLong`,{max:se}):`${t(`composer.send`)} · Enter`,onClick:()=>void E(),children:a?(0,H.jsx)(W,{size:14}):(0,H.jsx)(U,{name:`arrowUp`,size:16,strokeWidth:2.2})})]})]})]})})}k.attention;function Bs(e){switch(e.kind){case`quiet`:return`quiet|${e.since}`;case`long_tool`:return`long_tool|${e.tool.callId}|${e.since}`;case`long_run`:return`long_run|${e.runId??e.since}`;case`shared_file`:return`shared_file|${e.path}`;case`undelivered`:return`undelivered|${e.messageId}`;case`question`:return`question|${e.questionId}`}}function Vs(e){return e!==void 0&&Number.isFinite(e)&&e>0?e:void 0}function Hs(e){let t=Vs(e.addedLines),n=Vs(e.removedLines);return t===void 0&&n===void 0?void 0:{added:t,removed:n}}function Us(e,t){return e===void 0&&t===void 0?void 0:(e??0)+(t??0)}function Ws(e){let{inputTokens:t,outputTokens:n}=e;if(t===void 0||n===void 0)return;let r=e.cachedTokens??0,i=e.reasoningTokens??0;if([t,n,r,i].some(e=>!Number.isFinite(e)||e<0)||r>t||i>n)return;let a=t+n;if(!(a<=0))return{total:a,parts:[{role:`cached`,tokens:r,remainder:!1},{role:`input`,tokens:t-r,remainder:r>0},{role:`reasoning`,tokens:i,remainder:!1},{role:`output`,tokens:n-i,remainder:i>0}].filter(e=>e.tokens>0).map(e=>({...e,share:e.tokens/a}))}}function Gs(e,t,n){let r=e.filter(e=>e>0).length;if(r===0)return e.map(()=>({length:0,offset:0}));let i=r>1?n.gap:0,a=t-r*i,o=e.map(e=>e>0?Math.max(e*a,n.minArc):0),s=o.reduce((e,t)=>e+t,0)-a;if(s>0){let e=0;o.forEach((t,n)=>{t>(o[e]??0)&&(e=n)}),o[e]=Math.max((o[e]??0)-s,n.minArc)}let c=0;return o.map(e=>{let t={length:e,offset:c};return e>0&&(c+=e+i),t})}function Ks(e,t){let n=t,r=e-t,i=e/2,a=r-n,o=r-i;return{d:`M${i} ${n} H${r} V${r} H${n} V${n} H${i}`,length:4*a,corners:[0,1,2,3].map(e=>o+e*a),stroke:t}}function qs(e,t,n){let r=e.map(e=>({...e})),i=t.stroke/2,a=r.filter(e=>e.length>0);return a.forEach((e,r)=>{let o=a[r+1];if(!o)return;let s=e.offset+e.length,c=o.offset-s,l=t.corners.find(e=>s<e+i&&o.offset>e-i);if(l===void 0)return;let u=o.offset+o.length,d=[l-i-c,l+i].sort((e,t)=>Math.abs(e-s)-Math.abs(t-s)).find(t=>t-e.offset>=n.minArc&&u-(t+c)>=n.minArc);d!==void 0&&(e.length=d-e.offset,o.offset=d+c,o.length=u-o.offset)}),r}function Js(e,t,n){return qs(Gs(e,t.length,n),t,n)}function Ys(e){if(e<.001)return`<0.1%`;let t=e*100;return t<10?`${t.toFixed(1)}%`:`${Math.round(t)}%`}function Xs(e){let t=I(z,e=>e.sessions),n=I(z,e=>e.archived),r=I(z,e=>(e.archivedCount??0)>0&&!e.archivedLoaded),{parentSessionId:i,parentSessionIds:a,childIds:o}=e,s=(0,l.useMemo)(()=>{let e=C({parentSessionId:i,parentSessionIds:a}),r=e.map(e=>t[e]??n[e]),s=r.flatMap(e=>e?[e]:[]),c=e.filter((e,t)=>r[t]===void 0),l=i===void 0?void 0:t[i]??n[i],u=o.flatMap(e=>{let r=t[e]??n[e];return r?[r]:[]});return{parent:l,parents:s,missingParents:c,children:u,missing:c.length>0||u.length<o.length}},[t,n,i,a,o]),c=s.missing&&r;return(0,l.useEffect)(()=>{c&&ga().catch(()=>void 0)},[c]),{parent:s.parent,parents:s.parents,missingParents:s.missingParents,children:s.children}}var Zs=.25;function Qs(e,t,n,r){if(!(t>0)||e.length===0||n(e.join(``))<=t+.01)return;let i=t-Zs;if(r.kind===`middle`){let t=Math.min(Math.max(r.tail,0),e.length),a=e.length-t;if(a<=0)return;let o=e.slice(e.length-t).join(``),s=t=>n(e.slice(0,t).join(``)+`…`+o)<=i,c=0,l=a-1;for(;c<l;){let e=Math.ceil((c+l)/2);s(e)?c=e:l=e-1}return c}let a=t=>n(`…`+e.slice(t).join(``))<=i,o=1,s=e.length;for(;o<s;){let e=Math.floor((o+s)/2);a(e)?s=e:o=e+1}return o}function $s({title:e,count:t,defaultOpen:n=!0,action:r,children:i,className:a}){let[o,s]=(0,l.useState)(n),c=(0,l.useId)();return(0,H.jsxs)(`section`,{className:`section${a?` ${a}`:``}`,"data-open":o?``:void 0,children:[(0,H.jsxs)(`div`,{className:`section-head`,children:[(0,H.jsxs)(`button`,{type:`button`,className:`section-toggle`,"aria-expanded":o,"aria-controls":c,onClick:()=>s(e=>!e),children:[(0,H.jsx)(U,{name:`chevronRight`,size:13,className:`section-chevron`,strokeWidth:2}),(0,H.jsx)(`span`,{className:`section-title`,children:e}),t===void 0?null:(0,H.jsx)(`span`,{className:`section-count num`,children:t})]}),r?(0,H.jsx)(`span`,{className:`section-action`,children:r}):null]}),o?(0,H.jsx)(`div`,{className:`section-body`,id:c,children:i}):null]})}var ec,tc=[`fontFamily`,`fontSize`,`fontWeight`,`fontStyle`,`fontStretch`,`fontFeatureSettings`,`fontVariationSettings`,`fontVariantNumeric`,`fontKerning`,`fontOpticalSizing`,`letterSpacing`,`wordSpacing`];function nc(e){ec&&ec.isConnected||(ec=document.createElement(`span`),ec.setAttribute(`aria-hidden`,`true`),ec.style.cssText=`position:fixed;left:-99999px;top:0;visibility:hidden;pointer-events:none;white-space:pre;`,document.body.append(ec));let t=ec;for(let n of tc){let r=e[n];r&&(t.style[n]=r)}return e=>(t.textContent=e,t.getBoundingClientRect().width)}function rc(e,t){let n=(0,l.useRef)(null),[r,i]=(0,l.useState)(),a=(0,l.useMemo)(()=>Array.from(e),[e]),o=t.kind===`middle`?t.tail:0;return(0,l.useLayoutEffect)(()=>{let e=n.current;if(!e)return;let r=!1,s=()=>{if(r)return;let n=getComputedStyle(e),s=Number.parseFloat(n.maxWidth),c=Number.isFinite(s)?Qs(a,s,nc(n),t.kind===`middle`?{kind:`middle`,tail:o}:{kind:`start`}):void 0;i(e=>e===c?e:c)};s();let c=new ResizeObserver(s);return c.observe(e.parentElement??e),document.fonts?.ready?.then(s),()=>{r=!0,c.disconnect()}},[a,t.kind,o]),{ref:n,chars:a,cut:r}}function ic({value:e,className:t}){let{ref:n,chars:r,cut:i}=rc(e,{kind:`start`}),a=i!==void 0;return(0,H.jsxs)(`span`,{ref:n,className:`path-text${t?` ${t}`:``}`,"data-clipped":a?``:void 0,"data-tip":e,children:[a?(0,H.jsx)(`span`,{className:`fit-hidden`,children:r.slice(0,i).join(``)}):null,(0,H.jsx)(`span`,{className:`path-shown`,children:a?r.slice(i).join(``):e})]})}function ac({value:e,className:t,tail:n=6,tip:r}){let{ref:i,chars:a,cut:o}=rc(e,{kind:`middle`,tail:n}),s=Math.max(a.length-n,0),c=o!==void 0,l=c?Math.min(o,s):s;return(0,H.jsxs)(`span`,{ref:i,className:`mid-text${t?` ${t}`:``}`,"data-clipped":c?``:void 0,"data-tip":r??e,children:[(0,H.jsx)(`span`,{className:`mid-head`,children:a.slice(0,l).join(``)}),c&&l<s?(0,H.jsx)(`span`,{className:`fit-hidden`,children:a.slice(l,s).join(``)}):null,(0,H.jsx)(`span`,{className:`mid-tail`,children:a.slice(s).join(``)})]})}function oc({label:e,children:t,tip:n}){return(0,H.jsxs)(`div`,{className:`kv`,children:[(0,H.jsx)(`dt`,{"data-tip":n,children:e}),(0,H.jsx)(`dd`,{children:t})]})}function sc({children:e,lines:t=6,expandLabel:n,collapseLabel:r,watch:i}){let[a,o]=(0,l.useState)(!1),[s,c]=(0,l.useState)(!1),u=(0,l.useRef)(null);return(0,l.useLayoutEffect)(()=>{let e=u.current;if(!e||a)return;let t=()=>c(e.scrollHeight-e.clientHeight>2);t();let n=new ResizeObserver(t);return n.observe(e),()=>n.disconnect()},[a,i,t]),(0,H.jsxs)(`div`,{className:`clamp`,"data-open":a?``:void 0,children:[(0,H.jsx)(`div`,{className:`clamp-body`,ref:u,style:a?void 0:{WebkitLineClamp:t},children:e}),s||a?(0,H.jsx)(`button`,{type:`button`,className:`link-btn`,onClick:()=>o(e=>!e),children:a?r:n}):null]})}var cc=`### Session `;function lc(e,t){let n=t.sample?.block;if(!n||!Number.isInteger(n.start)||!Number.isInteger(n.end)||n.start<0||n.end>e.length||n.start>=n.end)return;let r=e.slice(n.start,n.end),i=`${cc}${t.sessionId}`;if(!r.startsWith(i))return;let a=r.charAt(i.length);return a===`:`||a===`
22
- `?r:void 0}function uc(e){let t=I(z,e=>e.sessions),n=I(z,e=>e.archived),r=I(z,e=>e.ready),i=I(z,e=>(e.archivedCount??0)>0&&!e.archivedLoaded),a=t[e]??n[e],o=a===void 0&&i;return(0,l.useEffect)(()=>{o&&ga().catch(()=>void 0)},[o]),{summary:a,state:a?`found`:!r||i?`checking`:`gone`}}function dc({preview:e,label:t,maxHeight:n=220}){let r=V(),i=e.format===`diff`,a=(0,l.useMemo)(()=>i?e.text.split(`
23
- `):void 0,[i,e.text]);return(0,H.jsxs)(`div`,{className:`preview`,children:[t||e.text?(0,H.jsxs)(`div`,{className:`preview-head`,children:[(0,H.jsx)(`span`,{children:t}),(0,H.jsx)(G,{value:e.text,label:r(`preview.copy`),size:12})]}):null,(0,H.jsx)(`pre`,{style:{maxHeight:n},"data-scroll":!0,children:(0,H.jsx)(`code`,{children:a?a.map((e,t)=>(0,H.jsxs)(`span`,{className:`md-diff-line`,"data-kind":e.startsWith(`+`)&&!e.startsWith(`+++`)?`add`:e.startsWith(`-`)&&!e.startsWith(`---`)?`del`:e.startsWith(`@@`)?`hunk`:void 0,children:[e,`
24
- `]},t)):e.text})}),e.truncated?(0,H.jsx)(`div`,{className:`preview-note`,children:e.chars===void 0?r(`preview.truncated`):r(`preview.truncatedChars`,{n:e.chars.toLocaleString()})}):null]})}var fc={no_runs:`handoff.noRuns`,no_text:`handoff.noText`,no_final:`handoff.noFinal`};function pc(e,t){let n=e.result;if(!n)return;if(!n.found)return{main:t(`handoff.noResult`),notes:[t(fc[n.reason])]};let r=[t(`handoff.fromRun`,{run:n.runIndex,runs:e.runCount})];return n.latest&&r.push(t(`handoff.laterNone`,{run:n.latest.runIndex})),n.label===`unlabeled`&&r.push(t(`handoff.notFinal`)),n.sentChars<n.chars&&r.push(t(`handoff.cut`,{sent:n.sentChars,n:n.chars})),{main:t(`handoff.chars`,{n:n.sentChars}),notes:r}}function mc(e,t){let n=e.files;if(n)return n.total===0?{main:t(`handoff.filesNone`),notes:[]}:{main:t(`handoff.pathCount`,{n:n.sent}),notes:n.sent<n.total?[t(`handoff.pathsCut`,{sent:n.sent,n:n.total})]:[]}}function hc(e,t){let n=e.error;if(n)return n.found?{main:n.runIndex===void 0?t(`handoff.errorSession`,{code:n.code}):t(`handoff.errorIn`,{code:n.code,run:n.runIndex}),notes:n.truncated?[t(`handoff.errorCut`)]:[]}:{main:t(`handoff.errorNone`),notes:[]}}function gc({label:e,fact:t}){return(0,H.jsxs)(oc,{label:e,children:[(0,H.jsx)(`span`,{children:t.main}),t.notes.map(e=>(0,H.jsx)(`span`,{className:`kv-sub`,children:e},e))]})}function _c({item:e,prompt:t}){let n=V(),r=$a(),{summary:i,state:a}=uc(e.sessionId),[o,s]=(0,l.useState)(!1),c=(0,l.useId)(),u=e.sample,d=u?.harness??i?.harness,f=(a===`gone`?u?.title:i?.title??u?.title)??e.sessionId,p=u?[{key:`result`,label:n(`handoff.result`),fact:pc(u,n)},{key:`files`,label:n(`handoff.files`),fact:mc(u,n)},{key:`error`,label:n(`handoff.error`),fact:hc(u,n)}].flatMap(e=>e.fact?[{key:e.key,label:e.label,fact:e.fact}]:[]):[],m=o&&u?lc(t,e):void 0;return(0,H.jsxs)(`li`,{className:`ctx cref`,"data-state":a,children:[(0,H.jsxs)(`div`,{className:`cref-head`,children:[d?(0,H.jsx)(ho,{harness:d,size:16,variant:`bare`}):null,(0,H.jsxs)(`div`,{className:`cref-main`,children:[a===`gone`?(0,H.jsx)(`span`,{className:`cref-title`,children:f}):(0,H.jsx)(`a`,{className:`cref-title`,href:fi({kind:`session`,id:e.sessionId}),"aria-label":n(`handoff.open`,{title:f}),"data-tip":e.sessionId,children:f}),u?(0,H.jsxs)(`div`,{className:`cref-sub`,children:[(0,H.jsx)(`span`,{children:no(u.harness,n)}),u.model?(0,H.jsx)(`span`,{children:u.model}):null,(0,H.jsxs)(`span`,{className:`cref-phase`,children:[(0,H.jsx)(Lo,{phase:u.phase,size:7}),n(`handoff.phaseAt`,{phase:Lt(u.phase,n)})]}),(0,H.jsx)(`span`,{className:`num`,children:n(`handoff.readAt`,{time:Dt(u.at,r)})})]}):null]})]}),a===`gone`?(0,H.jsx)(`p`,{className:`cref-gone`,children:n(`handoff.gone`)}):null,u?null:(0,H.jsx)(`p`,{className:`muted`,children:n(`handoff.noSample`)}),p.length>0||e.note?(0,H.jsxs)(`dl`,{className:`kvs kvs--tight`,children:[p.map(e=>(0,H.jsx)(gc,{label:e.label,fact:e.fact},e.key)),e.note?(0,H.jsx)(oc,{label:n(`handoff.note`),children:(0,H.jsx)(`span`,{className:`cref-note`,children:e.note})}):null]}):null,u?(0,H.jsxs)(H.Fragment,{children:[(0,H.jsxs)(`button`,{type:`button`,className:`cref-toggle`,"aria-expanded":o,"aria-controls":c,onClick:()=>s(e=>!e),children:[(0,H.jsx)(U,{name:o?`chevronDown`:`chevronRight`,size:12,strokeWidth:2}),(0,H.jsx)(`span`,{children:n(`handoff.text`)})]}),(0,H.jsx)(`div`,{id:c,hidden:!o,children:o?m===void 0?(0,H.jsx)(`p`,{className:`muted`,children:n(`handoff.textMissing`)}):(0,H.jsx)(dc,{preview:{text:m,truncated:!1},maxHeight:240}):null})]}):null]})}var vc=[`recorded`,`handed_off`,`applied`];function yc(e){let t=0;for(let n of e)n.stage===`handed_off`?t=Math.max(t,1):n.stage===`queued`?t=Math.max(t,+(n.queuedBy===`harness`)):n.stage===`applied`&&(t=2);return t}function bc(e,t){let n=xe(e),r=e.reason?`(${t(`queue.${e.reason}`)})`:``,i=e.error?`:${e.error.message}`:e.evidence?` · ${e.evidence}`:``;return`${Tt(e.at)} ${t(`delivery.${n}`)}${r}${i}`}function xc({message:e}){let t=V(),{delivery:n}=e,r=yc(n.history),i=xe(n),a=n.stage===`failed`,o=n.stage===`cancelled`,s=n.stage===`queued`,c=e=>a||o?e<=r?`done`:e===r+1?a?`failed`:`cancelled`:`todo`:e<r?`done`:e===r?`current`:`todo`,l=n.history.map(e=>bc(e,t)).join(`
25
- `),u=n.reason?t(`queue.${n.reason}`):void 0,d=a&&n.error?`${t(`delivery.failed`)}: ${n.error.message}`:t(`delivery.${i}`)+(s&&u?` · ${u}`:``);return n.stage===`applied`?(0,H.jsxs)(`div`,{className:`delivery`,"data-stage":`applied`,"data-compact":``,"data-tip":l,children:[(0,H.jsx)(`span`,{className:`dl-done`,"aria-hidden":`true`,children:(0,H.jsx)(U,{name:`check`,size:9,strokeWidth:3})}),(0,H.jsx)(`span`,{className:`dl-status`,"data-tone":`neutral`,children:d})]}):(0,H.jsxs)(`div`,{className:`delivery`,"data-stage":n.stage,"data-queued-by":n.queuedBy,"data-tip":l,children:[(0,H.jsx)(`ol`,{className:`dl-steps`,"aria-label":t(`delivery.label`),children:vc.map((e,n)=>{let r=c(n);return(0,H.jsxs)(`li`,{"data-state":r,children:[(0,H.jsx)(`span`,{className:`dl-dot`,children:r===`done`?(0,H.jsx)(U,{name:`check`,size:9,strokeWidth:3}):r===`failed`?(0,H.jsx)(U,{name:`close`,size:9,strokeWidth:3}):null}),(0,H.jsx)(`span`,{className:`dl-name`,children:t(`delivery.step.${e}`)})]},e)})}),(0,H.jsx)(`span`,{className:`dl-status`,"data-tone":a?`red`:o?`gray`:s?`amber`:`neutral`,children:d})]})}function Sc({stage:e}){return(0,H.jsx)(`span`,{className:`stage-dot`,"data-stage":e,"aria-hidden":`true`})}function Cc({message:e}){let t=V();if(e.sync.toOrigin===`not_needed`)return null;let n=e.sync.toOrigin===`delivered`;return(0,H.jsxs)(`span`,{className:`sync-tag`,"data-state":n?`delivered`:`pending`,"data-tip":n?t(`sync.deliveredTip`,{time:e.sync.at?Tt(e.sync.at):``}):t(`sync.pendingTip`),children:[(0,H.jsx)(U,{name:n?`check`:`clock`,size:11,strokeWidth:2}),t(n?`sync.delivered`:`sync.pending`)]})}function wc({delta:e}){return(0,H.jsxs)(H.Fragment,{children:[e.added===void 0?null:(0,H.jsxs)(`i`,{"data-sign":`add`,children:[`+`,e.added]}),e.removed===void 0?null:(0,H.jsxs)(`i`,{"data-sign":`del`,children:[`−`,e.removed]})]})}var Tc=96,Ec=6,Dc=Ks(Tc,Ec),Oc=2,kc=1.6;function Ac(e){return e.role===`input`?e.remainder?`usage.fresh`:`usage.input`:e.role===`output`?e.remainder?`usage.reply`:`usage.output`:`usage.${e.role}`}function jc({breakdown:e}){let t=V(),[n,r]=(0,l.useState)(),i=Js(e.parts.map(e=>e.share),Dc,{gap:Oc,minArc:kc}),a=new Intl.NumberFormat,o=e=>t(`usage.tip`,{label:t(Ac(e)),tokens:a.format(e.tokens),share:Ys(e.share)}),s=e=>({onPointerEnter:()=>r(e),onPointerLeave:()=>r(void 0)});return(0,H.jsxs)(`div`,{className:`usage`,"data-hot":n,children:[(0,H.jsxs)(`div`,{className:`usage-figure`,children:[(0,H.jsx)(`svg`,{className:`usage-ring`,viewBox:`0 0 ${Tc} ${Tc}`,width:Tc,height:Tc,"aria-hidden":`true`,style:{"--usage-perimeter":Dc.length},children:e.parts.map((e,t)=>{let r=i[t];return(0,H.jsx)(`path`,{className:`usage-seg`,"data-seg":e.role,"data-dim":n!==void 0&&n!==e.role?``:void 0,"data-tip":o(e),d:Dc.d,fill:`none`,strokeWidth:Ec,style:{strokeDasharray:`${r.length} ${Dc.length-r.length}`,strokeDashoffset:-r.offset},...s(e.role)},e.role)})}),(0,H.jsxs)(`div`,{className:`usage-total`,"data-tip":t(`usage.totalTip`,{tokens:a.format(e.total)}),children:[(0,H.jsx)(`span`,{className:`usage-total-value`,children:y(e.total)}),(0,H.jsx)(`span`,{className:`usage-total-label`,children:t(`usage.total`)})]})]}),(0,H.jsx)(`ul`,{className:`usage-legend`,children:e.parts.map(e=>(0,H.jsxs)(`li`,{className:`usage-row`,"data-active":n===e.role?``:void 0,"data-tip":o(e),...s(e.role),children:[(0,H.jsx)(`span`,{className:`usage-swatch`,"data-seg":e.role}),(0,H.jsx)(`span`,{className:`usage-label`,children:t(Ac(e))}),(0,H.jsx)(`span`,{className:`usage-value num`,children:y(e.tokens)})]},e.role))})]})}function Mc(e){try{let t=new URL(e);return t.protocol===`http:`||t.protocol===`https:`?t.href:void 0}catch{return}}function Nc({item:e,prompt:t}){let n=V();switch(e.kind){case`text`:return(0,H.jsxs)(`li`,{className:`ctx`,children:[(0,H.jsxs)(`div`,{className:`ctx-head`,children:[(0,H.jsx)(U,{name:`list`,size:13}),(0,H.jsx)(`span`,{className:`ctx-title`,children:e.title??n(`ctx.text`)})]}),(0,H.jsx)(sc,{lines:4,expandLabel:n(`common.expand`),collapseLabel:n(`common.collapse`),children:(0,H.jsx)(`div`,{className:`ctx-text`,children:e.text})})]});case`file`:return(0,H.jsxs)(`li`,{className:`ctx`,children:[(0,H.jsxs)(`div`,{className:`ctx-head`,children:[(0,H.jsx)(U,{name:`file`,size:13}),(0,H.jsx)(`span`,{className:`ctx-path mono`,"data-tip":e.path,children:e.path}),(0,H.jsx)(G,{value:e.path,label:n(`common.copyPath`),size:12})]}),e.note?(0,H.jsx)(`div`,{className:`ctx-note`,children:e.note}):null]});case`snippet`:{let t=e.startLine===void 0?void 0:`${e.startLine}${e.endLine===void 0?``:`–${e.endLine}`}`;return(0,H.jsxs)(`li`,{className:`ctx`,children:[(0,H.jsxs)(`div`,{className:`ctx-head`,children:[(0,H.jsx)(U,{name:`terminal`,size:13}),(0,H.jsxs)(`span`,{className:`ctx-path mono`,"data-tip":e.path,children:[e.path??n(`ctx.snippet`),t?`:${t}`:``]})]}),(0,H.jsx)(dc,{preview:{text:e.text,truncated:!1},maxHeight:180})]})}case`url`:{let t=Mc(e.url);return(0,H.jsx)(`li`,{className:`ctx`,children:(0,H.jsxs)(`div`,{className:`ctx-head`,children:[(0,H.jsx)(U,{name:`link`,size:13}),t?(0,H.jsx)(`a`,{className:`ctx-path`,href:t,target:`_blank`,rel:`noreferrer noopener`,"data-tip":e.url,children:e.title??e.url}):(0,H.jsx)(`span`,{className:`ctx-path`,"data-tip":e.url,children:e.title??e.url})]})})}case`session`:return(0,H.jsx)(_c,{item:e,prompt:t});default:return null}}function Pc({state:e,summary:t}){let n=V(),{meta:r}=e,{parent:i,parents:a,missingParents:o}=Xs(t),s=C(t).length>1,c=t.origin,l=c.kind===`user`;return(0,H.jsxs)(`div`,{className:`panel-stack`,children:[(0,H.jsxs)($s,{title:n(`task.origin`),defaultOpen:!0,children:[(0,H.jsxs)(`div`,{className:`origin-card`,children:[(0,H.jsx)(`span`,{className:`origin-mark`,children:(0,H.jsx)(fs,{host:c.host,size:18})}),(0,H.jsxs)(`div`,{className:`origin-card-text`,children:[(0,H.jsx)(`div`,{className:`origin-card-title`,children:l?n(`origin.user`):n(`origin.dispatchedBy`,{host:c.hostLabel})}),(0,H.jsx)(`div`,{className:`origin-card-sub`,children:c.sessionRef?(0,H.jsxs)(H.Fragment,{children:[(0,H.jsx)(`span`,{children:n(`origin.refLabel.${c.sessionRef.kind}`)}),(0,H.jsx)(`span`,{className:`mono`,"data-tip":c.sessionRef.id,children:At(c.sessionRef.id,12)}),is(c)?(0,H.jsx)(`span`,{"data-tip":n(`origin.refDeclaredTip`),children:n(`origin.refDeclared`)}):null]}):(0,H.jsx)(`span`,{children:n(l?`origin.console`:`origin.noRefTip`)})}),c.workspace?(0,H.jsxs)(`div`,{className:`origin-card-ws mono`,"data-tip":ss(c,n),children:[(0,H.jsx)(U,{name:`folder`,size:11}),(0,H.jsx)(ic,{value:c.workspace})]}):as(c)?(0,H.jsxs)(`div`,{className:`origin-card-ws`,"data-tip":n(`origin.workspaceUnknownTip`),children:[(0,H.jsx)(U,{name:`folder`,size:11}),(0,H.jsx)(`span`,{children:`${n(`origin.workspace`)}: ${n(`origin.workspaceUnknown`)}`})]}):null]})]}),s?a.length>0?(0,H.jsx)(`div`,{className:`parent-links`,role:`group`,"aria-label":n(`task.parentsLabel`,{n:a.length+o.length}),children:a.map(e=>(0,H.jsxs)(`button`,{type:`button`,className:`parent-link`,onClick:()=>Ni({kind:`session`,id:e.id}),children:[(0,H.jsx)(U,{name:`branch`,size:13}),(0,H.jsx)(`span`,{children:n(`task.parent`)}),(0,H.jsx)(`strong`,{children:e.title}),(0,H.jsx)(U,{name:`chevronRight`,size:12})]},e.id))}):null:i?(0,H.jsxs)(`button`,{type:`button`,className:`parent-link`,onClick:()=>Ni({kind:`session`,id:i.id}),children:[(0,H.jsx)(U,{name:`branch`,size:13}),(0,H.jsx)(`span`,{children:n(`task.parent`)}),(0,H.jsx)(`strong`,{children:i.title}),(0,H.jsx)(U,{name:`chevronRight`,size:12})]}):null]}),(0,H.jsx)($s,{title:n(`task.brief`),action:(0,H.jsx)(G,{value:r.task.text,label:n(`task.copy`)}),children:(0,H.jsx)(sc,{lines:12,expandLabel:n(`common.expand`),collapseLabel:n(`common.collapse`),watch:r.task.text,children:(0,H.jsx)(`div`,{className:`task-text`,children:r.task.text})})}),(0,H.jsx)($s,{title:n(`task.context`),count:r.task.context.length,children:r.task.context.length===0?(0,H.jsx)(`p`,{className:`muted`,children:n(`task.noContext`)}):(0,H.jsx)(`ul`,{className:`ctx-list`,children:r.task.context.map((e,t)=>(0,H.jsx)(Nc,{item:e,prompt:r.task.prompt},t))})}),(0,H.jsx)($s,{title:n(`task.prompt`),defaultOpen:!1,action:(0,H.jsx)(G,{value:r.task.prompt,label:n(`task.copyPrompt`)}),children:(0,H.jsx)(sc,{lines:12,expandLabel:n(`common.expand`),collapseLabel:n(`common.collapse`),watch:r.task.prompt,children:(0,H.jsx)(`div`,{className:`task-text`,children:r.task.prompt})})}),s?o.map(e=>(0,H.jsx)(`p`,{className:`muted`,children:n(`task.parentGoneNamed`,{id:At(e,12)})},e)):i===void 0&&t.parentSessionId?(0,H.jsx)(`p`,{className:`muted`,children:n(`task.parentGone`)}):null]})}function Fc({state:e,summary:t}){let n=V(),r=$a(),{meta:i}=e,a=t.accessEnforcement,o=i.model,s=to(t.effort,n),c=o?.requested,l=o?.resolved;return(0,H.jsx)(`div`,{className:`panel-stack`,children:(0,H.jsx)($s,{title:n(`info.session`),children:(0,H.jsxs)(`dl`,{className:`kvs`,children:[(0,H.jsx)(oc,{label:n(`info.harness`),children:(0,H.jsxs)(`span`,{className:`inline`,children:[(0,H.jsx)(ho,{harness:t.harness,size:16,variant:`bare`}),no(t.harness,n),t.runtime===`fixture`?(0,H.jsx)(zo,{tone:`violet`,tip:n(`run.simulatedTip`),children:n(`run.simulated`)}):null]})}),(0,H.jsxs)(oc,{label:n(`info.model`),children:[(0,H.jsx)(`span`,{children:eo(t,n)}),c&&l&&c!==l?(0,H.jsx)(`span`,{className:`kv-sub`,children:n(`info.modelResolved`,{requested:c,resolved:l})}):o?.provider?(0,H.jsx)(`span`,{className:`kv-sub`,children:o.provider}):null]}),(0,H.jsx)(oc,{label:n(`info.effort`),children:s??(0,H.jsx)(`span`,{className:`muted`,children:n(`info.effortDefault`)})}),(0,H.jsx)(oc,{label:n(`info.access`),children:(0,H.jsxs)(`span`,{className:`inline inline--nowrap`,children:[(0,H.jsx)(`span`,{children:n(`access.${t.access}`)}),a?(0,H.jsx)(zo,{tone:a.level===`enforced`?`teal`:a.level===`advisory`?`amber`:`red`,tip:`${n(`enforce.tip.${a.level}`)}\n${a.mechanism}`,children:n(`enforce.${a.level}`)}):null]})}),(0,H.jsx)(oc,{label:n(`info.cwd`),children:(0,H.jsxs)(`span`,{className:`inline inline--nowrap`,children:[(0,H.jsx)(ic,{className:`kv-path`,value:t.cwd}),(0,H.jsx)(G,{value:t.cwd,label:n(`common.copyPath`),size:12})]})}),t.nativeRef?(0,H.jsx)(oc,{label:n(`info.native`),tip:n(`info.nativeTip`),children:(0,H.jsxs)(`span`,{className:`inline inline--nowrap`,children:[(0,H.jsx)(`span`,{className:`kv-sub-inline`,children:n(`native.${t.nativeRef.kind}`)}),(0,H.jsx)(ac,{className:`kv-path`,value:t.nativeRef.id,tip:`${n(`native.${t.nativeRef.kind}`)}\n${t.nativeRef.id}`}),(0,H.jsx)(G,{value:t.nativeRef.id,label:n(`common.copyId`),size:12})]})}):null,(0,H.jsx)(oc,{label:n(`info.id`),children:(0,H.jsxs)(`span`,{className:`inline inline--nowrap`,children:[(0,H.jsx)(ac,{className:`kv-path`,value:t.id}),(0,H.jsx)(G,{value:t.id,label:n(`common.copyId`),size:12})]})}),(0,H.jsx)(oc,{label:n(`info.created`),children:Dt(t.createdAt,r)}),(0,H.jsx)(oc,{label:n(`info.runs`),children:(0,H.jsx)(`span`,{className:`num`,children:t.runCount})})]})})})}function Ic(e){let t=new Map;for(let n of e.timeline)if(n.type===`tool`&&n.files)for(let e of n.files){let r=t.get(e.path),i=Us(r?.addedLines,e.addedLines),a=Us(r?.removedLines,e.removedLines);t.set(e.path,{...e,change:r?.change===`created`&&e.change===`modified`?`created`:e.change,...i===void 0?{}:{addedLines:i},...a===void 0?{}:{removedLines:a},...e.diff?{diff:e.diff}:r?.diff?{diff:r.diff}:{},status:n.status})}return[...t.values()]}function Lc({message:e}){let t=V(),n=e.delivery.stage,r=t(`delivery.${xe(e.delivery)}`);return(0,H.jsx)(`li`,{"data-kind":e.kind,children:(0,H.jsxs)(`button`,{type:`button`,className:`msg-log-head`,"data-tip":t(`msg.locate`),onClick:()=>Ts(e.id),children:[(0,H.jsx)(`span`,{className:`msg-log-author`,children:e.author.label}),(0,H.jsx)(zo,{tone:e.kind===`steer`?`amber`:e.kind===`follow_up`?`blue`:`neutral`,children:t(`msg.kind.${e.kind}`)}),(0,H.jsxs)(`span`,{className:`msg-log-end`,children:[(0,H.jsx)(`time`,{className:`num`,dateTime:e.createdAt,children:Tt(e.createdAt)}),(0,H.jsx)(`span`,{className:`msg-log-dot`,role:`img`,"aria-label":r,"data-tip":r,children:(0,H.jsx)(Sc,{stage:n})})]})]})})}function Rc({child:e}){let t=V();return(0,H.jsxs)(`button`,{type:`button`,className:`child`,onClick:()=>Ni({kind:`session`,id:e.id}),children:[(0,H.jsx)(ho,{harness:e.harness,size:30}),(0,H.jsxs)(`span`,{className:`child-text`,children:[(0,H.jsx)(`span`,{className:`child-title`,children:e.title}),(0,H.jsxs)(`span`,{className:`child-sub`,children:[(0,H.jsx)(Lo,{phase:e.phase,size:7}),Lt(e.phase,t),e.lastRun?.durationMs===void 0?null:(0,H.jsxs)(`span`,{className:`num`,children:[` · `,Ct(e.lastRun.durationMs)]}),e.archivedAt===void 0?null:(0,H.jsxs)(`span`,{children:[` · `,t(`archive.chip`)]})]})]}),(0,H.jsx)(U,{name:`chevronRight`,size:13})]})}function zc({items:e}){let t=V(),n=St();return(0,H.jsx)($s,{title:t(`attention.title`),count:e.length,children:(0,H.jsx)(`ul`,{className:`attn-list`,children:e.map(e=>(0,H.jsx)(`li`,{children:Wt(e,n,t)},Bs(e)))})})}function Bc({state:e,summary:t}){let n=V(),{children:r}=Xs(t),i=(0,l.useMemo)(()=>Ic(e),[e,e.seq]),a=t.usage,o=e.plan,s=e.messages,c=a?.contextTokens!==void 0&&a.contextWindow?Math.min(1,a.contextTokens/a.contextWindow):void 0,u=a?Ws(a):void 0;return(0,H.jsxs)(`div`,{className:`panel-stack`,children:[t.attention?.length?(0,H.jsx)(zc,{items:t.attention}):null,(0,H.jsx)($s,{title:n(`sum.progress`),children:o&&o.entries.length>0?(0,H.jsx)(`ol`,{className:`plan-list plan-list--side`,children:o.entries.map((e,t)=>(0,H.jsxs)(`li`,{"data-status":e.status,children:[(0,H.jsx)(`span`,{className:`plan-mark`,children:e.status===`completed`?(0,H.jsx)(U,{name:`check`,size:10,strokeWidth:3}):null}),(0,H.jsx)(`span`,{children:e.text})]},e.id??t))}):(0,H.jsx)(`p`,{className:`muted`,children:t.capabilities.plan.support===`no`?n(`sum.noPlanSupport`):n(`sum.noPlan`)})}),r.length>0?(0,H.jsx)($s,{title:n(`sum.children`),count:r.length,children:(0,H.jsx)(`div`,{className:`children`,children:r.map(e=>(0,H.jsx)(Rc,{child:e},e.id))})}):null,(0,H.jsx)($s,{title:n(`sum.messages`),count:s.length,children:(0,H.jsx)(`ul`,{className:`msg-log`,children:s.map(e=>(0,H.jsx)(Lc,{message:e},e.id))})}),(0,H.jsx)($s,{title:n(`sum.files`),count:i.length,defaultOpen:i.length>0,children:i.length===0?(0,H.jsx)(`p`,{className:`muted`,children:t.capabilities.fileEvents.support===`no`?n(`sum.noFileEvents`):n(`sum.noFiles`)}):(0,H.jsx)(`ul`,{className:`files`,children:i.map(e=>{let t=Hs(e);return(0,H.jsxs)(`li`,{children:[(0,H.jsx)(zo,{tone:e.change===`deleted`?`red`:e.change===`created`?`teal`:`neutral`,children:n(`file.${e.change}`)}),(0,H.jsx)(`span`,{className:`mono file-path`,"data-tip":e.path,children:e.path}),t?(0,H.jsx)(`span`,{className:`num file-stat`,children:(0,H.jsx)(wc,{delta:t})}):null]},e.path)})})}),(0,H.jsx)($s,{title:n(`sum.usage`),defaultOpen:a!==void 0,children:a===void 0?(0,H.jsx)(`p`,{className:`muted`,children:t.capabilities.usage.support===`no`?n(`sum.noUsageSupport`):n(`sum.noUsage`)}):(0,H.jsxs)(H.Fragment,{children:[u?(0,H.jsx)(jc,{breakdown:u}):null,!u||a.costUsd!==void 0||c!==void 0?(0,H.jsxs)(`dl`,{className:`kvs kvs--tight`,children:[!u&&a.inputTokens!==void 0?(0,H.jsx)(oc,{label:n(`usage.input`),children:(0,H.jsx)(`span`,{className:`num`,children:jt(a.inputTokens)})}):null,!u&&a.cachedTokens!==void 0?(0,H.jsx)(oc,{label:n(`usage.cached`),children:(0,H.jsx)(`span`,{className:`num`,children:jt(a.cachedTokens)})}):null,!u&&a.outputTokens!==void 0?(0,H.jsx)(oc,{label:n(`usage.output`),children:(0,H.jsx)(`span`,{className:`num`,children:jt(a.outputTokens)})}):null,!u&&a.reasoningTokens!==void 0?(0,H.jsx)(oc,{label:n(`usage.reasoning`),children:(0,H.jsx)(`span`,{className:`num`,children:jt(a.reasoningTokens)})}):null,a.costUsd===void 0?null:(0,H.jsx)(oc,{label:n(`usage.cost`),children:(0,H.jsx)(`span`,{className:`num`,children:b(a.costUsd)})}),c===void 0?null:(0,H.jsx)(oc,{label:n(`usage.context`),children:(0,H.jsxs)(`span`,{className:`ctx-meter`,"data-tip":`${jt(a.contextTokens)} / ${jt(a.contextWindow)}`,children:[(0,H.jsx)(`span`,{className:`ctx-meter-bar`,children:(0,H.jsx)(`i`,{style:{width:`${Math.round(c*100)}%`},"data-high":c>.85?``:void 0})}),(0,H.jsxs)(`span`,{className:`num`,children:[Math.round(c*100),`%`]})]})})]}):null]})})]})}var Vc=/^\s{0,3}(`{3,}|~{3,})\s*([\w+#.-]*)\s*$/,Hc=/^\s{0,3}(#{1,6})\s+(.*?)\s*#*\s*$/,Uc=/^(\s*)([-*+])\s+(.*)$/,Wc=/^(\s*)(\d{1,9})[.)]\s+(.*)$/,Gc=/^\s{0,3}([-*_])(\s*\1){2,}\s*$/,Kc=/^\s{0,3}>\s?(.*)$/,qc=/^\s*\|?\s*:?-{2,}:?\s*(\|\s*:?-{2,}:?\s*)*\|?\s*$/;function Jc(e){let t=0;for(let n of e)if(n===` `)t+=1;else if(n===` `)t+=4;else break;return t}function Yc(e){let t=e.trim().replace(/^\|/,``).replace(/\|$/,``),n=[],r=``;for(let e=0;e<t.length;e++){let i=t[e]??``;i===`\\`&&t[e+1]===`|`?(r+=`|`,e++):i===`|`?(n.push(r.trim()),r=``):r+=i}return n.push(r.trim()),n}function Xc(e){return Zc(e.replace(/\r\n?/g,`
26
- `).split(`
27
- `))}function Zc(e){let t=[],n=0,r=[],i=()=>{r.length>0&&(t.push({type:`p`,text:r.join(`
28
- `)}),r=[])};for(;n<e.length;){let a=e[n]??``,o=Vc.exec(a);if(o){i();let r=o[1]??"```",a=[];for(n++;n<e.length&&!RegExp(`^\\s{0,3}${r[0]==="`"?"`":`~`}{${r.length},}\\s*$`).test(e[n]??``);)a.push(e[n]??``),n++;n++,t.push({type:`code`,lang:o[2]??``,text:a.join(`
29
- `)});continue}if(a.trim()===``){i(),n++;continue}let s=Hc.exec(a);if(s){i(),t.push({type:`h`,level:(s[1]??`#`).length,text:s[2]??``}),n++;continue}if(Gc.test(a)&&r.length===0){t.push({type:`hr`}),n++;continue}if(Kc.test(a)){i();let r=[];for(;n<e.length&&Kc.test(e[n]??``);)r.push(Kc.exec(e[n]??``)?.[1]??``),n++;t.push({type:`quote`,blocks:Zc(r)});continue}let c=e[n+1];if(a.includes(`|`)&&c!==void 0&&qc.test(c)&&c.includes(`-`)){i();let r=Yc(a),o=[];for(n+=2;n<e.length&&(e[n]??``).trim()!==``&&(e[n]??``).includes(`|`);)o.push(Yc(e[n]??``)),n++;t.push({type:`table`,head:r,rows:o});continue}let l=Uc.exec(a),u=l?null:Wc.exec(a);if(l||u){i();let r=((l??u)[1]??``).length,a=!!u,o=u?Number(u[2]):1,s=[];for(;n<e.length;){let t=e[n]??``,i=Uc.exec(t)??Wc.exec(t);if(!i||(i[1]??``).length!==r||!(!Wc.exec(t)||Uc.exec(t))!==a)break;let o=i[3]??``,c=[];for(n++;n<e.length;){let t=e[n]??``;if(t.trim()===``){let t=e[n+1];if(t!==void 0&&Jc(t)>r&&t.trim()!==``){c.push(``),n++;continue}break}if(Jc(t)>r)c.push(t.slice(Math.min(Jc(t),r+2))),n++;else break}if(s.push({text:o,children:c.length>0?Zc(c):[]}),(e[n]??``).trim()===``&&e[n+1]!==void 0){let t=e[n+1]??``,i=Uc.exec(t)??Wc.exec(t);i&&(i[1]??``).length===r&&n++}}t.push({type:`list`,ordered:a,start:o,items:s})}else r.push(a),n++}return i(),t}var Qc=/(`+)([\s\S]*?[^`])\1(?!`)|\*\*([^\s*](?:[\s\S]*?[^\s*])?)\*\*|__([^\s_](?:[\s\S]*?[^\s_])?)__|(?<![\w*])\*([^\s*](?:[^*\n]*?[^\s*])?)\*(?![\w*])|(?<![\w_])_([^\s_](?:[^_\n]*?[^\s_])?)_(?![\w_])|~~([^\s~](?:[\s\S]*?[^\s~])?)~~|\[([^\]\n]+)\]\(([^)\s]+)(?:\s+"[^"]*")?\)|(https?:\/\/[^\s<>)\]]+[^\s<>)\].,;:!?'",。;:!?、)】])/g;function $c(e){try{let t=new URL(e);return t.protocol===`http:`||t.protocol===`https:`?t.href:void 0}catch{return}}function el(e,t=`i`){let n=[],r=0,i=0;for(let a of e.matchAll(Qc)){a.index>r&&n.push(...tl(e.slice(r,a.index),`${t}t${i++}`));let o=`${t}${i++}`;if(a[2]!==void 0)n.push((0,H.jsx)(`code`,{children:a[2].trim()===``?a[2]:a[2].replace(/^ (.*) $/,`$1`)},o));else if(a[3]!==void 0||a[4]!==void 0)n.push((0,H.jsx)(`strong`,{children:el(a[3]??a[4]??``,o)},o));else if(a[5]!==void 0||a[6]!==void 0)n.push((0,H.jsx)(`em`,{children:el(a[5]??a[6]??``,o)},o));else if(a[7]!==void 0)n.push((0,H.jsx)(`del`,{children:el(a[7],o)},o));else if(a[8]!==void 0&&a[9]!==void 0){let e=$c(a[9]);n.push(e?(0,H.jsx)(`a`,{href:e,target:`_blank`,rel:`noreferrer noopener`,children:el(a[8],o)},o):(0,H.jsx)(l.Fragment,{children:a[0]},o))}else if(a[10]!==void 0){let e=$c(a[10]);n.push(e?(0,H.jsx)(`a`,{href:e,target:`_blank`,rel:`noreferrer noopener`,children:a[10]},o):(0,H.jsx)(l.Fragment,{children:a[0]},o))}r=a.index+a[0].length}return r<e.length&&n.push(...tl(e.slice(r),`${t}t${i++}`)),n}function tl(e,t){let n=e.split(`
30
- `),r=[];return n.forEach((e,n)=>{n>0&&r.push((0,H.jsx)(`br`,{},`${t}b${n}`)),e&&r.push((0,H.jsx)(l.Fragment,{children:e},`${t}s${n}`))}),r}function nl({lang:e,text:t}){let n=V(),r=e===`diff`||e===`patch`;return(0,H.jsxs)(`figure`,{className:`md-code`,children:[(0,H.jsxs)(`figcaption`,{children:[(0,H.jsx)(`span`,{className:`mono`,children:e||n(`md.code`)}),(0,H.jsx)(G,{value:t,label:n(`md.copyCode`)})]}),(0,H.jsx)(`pre`,{children:(0,H.jsx)(`code`,{children:r?t.split(`
31
- `).map((e,t)=>(0,H.jsxs)(`span`,{className:`md-diff-line`,"data-kind":e.startsWith(`+`)&&!e.startsWith(`+++`)?`add`:e.startsWith(`-`)&&!e.startsWith(`---`)?`del`:e.startsWith(`@@`)?`hunk`:void 0,children:[e,`
32
- `]},t)):t})})]})}function rl(e,t){return e.map((e,n)=>{let r=`${t}${n}`;switch(e.type){case`p`:return(0,H.jsx)(`p`,{children:el(e.text,r)},r);case`h`:{let t=`h${Math.min(6,e.level+2)}`;return(0,H.jsx)(t,{children:el(e.text,r)},r)}case`code`:return(0,H.jsx)(nl,{lang:e.lang,text:e.text},r);case`hr`:return(0,H.jsx)(`hr`,{},r);case`quote`:return(0,H.jsx)(`blockquote`,{children:rl(e.blocks,r)},r);case`list`:{let t=e.ordered?`ol`:`ul`;return(0,H.jsx)(t,{...e.ordered&&e.start!==1?{start:e.start}:{},children:e.items.map((e,t)=>(0,H.jsxs)(`li`,{children:[el(e.text,`${r}.${t}`),e.children.length>0?rl(e.children,`${r}.${t}.`):null]},`${r}.${t}`))},r)}case`table`:return(0,H.jsx)(`div`,{className:`md-table`,children:(0,H.jsxs)(`table`,{children:[(0,H.jsx)(`thead`,{children:(0,H.jsx)(`tr`,{children:e.head.map((e,t)=>(0,H.jsx)(`th`,{children:el(e,`${r}h${t}`)},t))})}),(0,H.jsx)(`tbody`,{children:e.rows.map((t,n)=>(0,H.jsx)(`tr`,{children:e.head.map((e,i)=>(0,H.jsx)(`td`,{children:el(t[i]??``,`${r}r${n}c${i}`)},i))},n))})]})},r)}})}var il=(0,l.memo)(function({text:e,streaming:t=!1}){let n=(0,l.useMemo)(()=>Xc(e),[e]);return(0,H.jsx)(`div`,{className:`md`,"data-streaming":t?``:void 0,children:rl(n,`m`)})}),al=e=>(e.options?.length??0)>0;function ol(e){return{picks:[],other:``,otherOn:!al(e)}}function sl(e){return e.map(ol)}function cl(e,t,n){if(!e.multiple)return{...t,picks:[n],otherOn:!1};let r=t.picks.includes(n)?t.picks.filter(e=>e!==n):[...t.picks,n];return{...t,picks:r}}function ll(e,t){return al(e)?e.multiple?{...t,otherOn:!t.otherOn}:{...t,picks:[],otherOn:!0}:t}function ul(e,t,n){return al(e)?n.trim()===``?{...t,other:n}:e.multiple?{...t,other:n,otherOn:!0}:{picks:[],other:n,otherOn:!0}:{...t,other:n,otherOn:!0}}function dl(e,t){let n=(e.options??[]).map(e=>e.label).filter(e=>t.picks.includes(e)),r=t.otherOn&&e.custom?t.other.trim():``;return r?[...n,r]:n}function fl(e,t){return e.length>0&&e.every((e,n)=>{let r=t[n];return r!==void 0&&dl(e,r).length>0})}function pl(e,t){return{answers:e.map((e,n)=>dl(e,t[n]??ol(e)))}}var ml={answered:`question.conflict.answered`,declined:`question.conflict.declined`,expired:`question.conflict.expired`,open:`question.conflict.busy`};function hl(e){let t=e?.status;return typeof t==`string`?ml[t]:void 0}var gl={timeout:`question.expiry.timeout`,withdrawn:`question.expiry.withdrawn`,run_ended:`question.expiry.run_ended`,cancelled:`question.expiry.cancelled`,session_closed:`question.expiry.session_closed`,restarted:`question.expiry.restarted`,not_waiting:`question.expiry.not_waiting`};function _l(e,t){return e.reason===`timeout`&&e.delivery===`handed_off`?t(`question.expiry.timeoutTold`):e.reason?t(gl[e.reason]):void 0}function vl(e,t){return e.kind===`user`?t(`question.by.user`):e.label}var yl=new Map;function bl(e,t){if(e instanceof Ne&&e.status===409){let n=hl(e.details);if(n)return t(n)}return Ai(e)}function xl({prompt:e,index:t,total:n}){let r=V();return n<=1&&!e.header?null:(0,H.jsxs)(`div`,{className:`q-prompt-head`,children:[n>1?(0,H.jsx)(`span`,{className:`q-index num`,children:r(`question.index`,{i:t+1,n})}):null,e.header?(0,H.jsx)(`span`,{className:`q-header`,children:e.header}):null]})}function Sl({multiple:e}){return(0,H.jsx)(`span`,{className:`q-mark`,"data-kind":e?`box`:`radio`,"aria-hidden":`true`,children:e?(0,H.jsx)(U,{name:`check`,size:10,strokeWidth:3}):null})}function Cl({prompt:e,index:t,total:n,draft:r,base:i,disabled:a,onEdit:o,onSubmit:s}){let c=V(),l=`${i}-t${t}`,u=`${i}-g${t}`,d=e.options??[],f=(e,t)=>{e.nativeEvent.isComposing||e.keyCode===229||(e.key===`Escape`?e.currentTarget.blur():e.key!==`Enter`||e.shiftKey||(!t||e.ctrlKey||e.metaKey)&&(e.preventDefault(),s()))};return(0,H.jsxs)(`div`,{className:`q-prompt`,children:[(0,H.jsx)(xl,{prompt:e,index:t,total:n}),(0,H.jsx)(`p`,{className:`q-text`,id:l,children:e.text}),d.length>0?(0,H.jsxs)(H.Fragment,{children:[(0,H.jsx)(`p`,{className:`q-hint`,children:e.multiple?c(`question.pickAny`):c(`question.pickOne`)}),(0,H.jsxs)(`div`,{className:`q-options`,role:e.multiple?`group`:`radiogroup`,"aria-labelledby":l,children:[d.map((t,n)=>{let i=r.picks.includes(t.label);return(0,H.jsxs)(`label`,{className:`q-opt`,"data-checked":i?``:void 0,children:[(0,H.jsx)(`input`,{type:e.multiple?`checkbox`:`radio`,name:u,checked:i,disabled:a,onChange:()=>o(n=>cl(e,n,t.label))}),(0,H.jsx)(Sl,{multiple:e.multiple}),(0,H.jsxs)(`span`,{className:`q-opt-body`,children:[(0,H.jsx)(`span`,{className:`q-opt-label`,children:t.label}),t.description?(0,H.jsx)(`span`,{className:`q-opt-desc`,children:t.description}):null]})]},`${n}:${t.label}`)}),e.custom?(0,H.jsxs)(`div`,{className:`q-opt q-opt--other`,"data-checked":r.otherOn?``:void 0,children:[(0,H.jsxs)(`label`,{className:`q-other-pick`,children:[(0,H.jsx)(`input`,{type:e.multiple?`checkbox`:`radio`,name:u,checked:r.otherOn,disabled:a,onChange:()=>o(t=>ll(e,t))}),(0,H.jsx)(Sl,{multiple:e.multiple}),(0,H.jsx)(`span`,{className:`q-opt-label`,children:c(`question.other`)})]}),(0,H.jsx)(`input`,{type:`text`,className:`q-input`,value:r.other,maxLength:k.question.maxAnswerChars,placeholder:c(`question.otherPlaceholder`),"aria-label":c(`question.other`),disabled:a,onClick:()=>{r.otherOn||o(t=>ll(e,t))},onChange:t=>o(n=>ul(e,n,t.target.value)),onKeyDown:e=>f(e,!1)})]}):null]})]}):(0,H.jsx)(`textarea`,{className:`q-input q-input--area`,rows:3,value:r.other,maxLength:k.question.maxAnswerChars,placeholder:c(`question.textPlaceholder`),"aria-labelledby":l,disabled:a,onChange:t=>o(n=>ul(e,n,t.target.value)),onKeyDown:e=>f(e,!0)})]})}function wl({item:e,sessionId:t,onSettled:n}){let r=V(),i=(0,l.useId)(),{prompts:a,questionId:o}=e,[s,c]=(0,l.useState)(()=>yl.get(o)??sl(a)),[u,d]=(0,l.useState)(void 0),[f,p]=(0,l.useState)(void 0),m=(0,l.useRef)(!0),h=(0,l.useRef)(!1);(0,l.useEffect)(()=>(m.current=!0,()=>{m.current=!1}),[]),(0,l.useEffect)(()=>{yl.set(o,s)},[o,s]);let g=fl(a,s),_=(0,l.useCallback)((e,t)=>{c(n=>n.map((n,r)=>r===e?t(n):n)),p(void 0)},[]),v=(0,l.useCallback)(async e=>{if(!h.current&&(e!==`answer`||g)){h.current=!0,d(e),p(void 0);try{let r=e===`answer`?await N.answerQuestion(t,o,pl(a,s)):await N.declineQuestion(t,o);ua(r.summary),n({status:r.status,outcome:r.outcome})}catch(e){m.current&&p(bl(e,r))}finally{h.current=!1,m.current&&d(void 0)}}},[s,n,a,o,g,t,r]),y=u!==void 0;return(0,H.jsxs)(H.Fragment,{children:[(0,H.jsx)(`div`,{className:`q-body`,children:a.map((e,t)=>{let n=s[t];return n?(0,H.jsx)(Cl,{prompt:e,index:t,total:a.length,draft:n,base:i,disabled:y,onEdit:e=>_(t,e),onSubmit:()=>void v(`answer`)},e.key):null})}),(0,H.jsxs)(`div`,{className:`q-foot`,children:[(0,H.jsxs)(`button`,{type:`button`,className:`btn btn--primary q-answer-btn`,disabled:!g||y,"aria-busy":u===`answer`||void 0,"data-tip":!g&&!y?r(`question.needAnswer`):void 0,onClick:()=>void v(`answer`),children:[u===`answer`?(0,H.jsx)(W,{size:14}):(0,H.jsx)(U,{name:`arrowUp`,size:14,strokeWidth:2.2}),r(`question.answer`)]}),(0,H.jsx)(`button`,{type:`button`,className:`btn q-decline-btn`,disabled:y,"aria-busy":u===`decline`||void 0,"data-tip":r(`question.declineTip`),onClick:()=>void v(`decline`),children:r(`question.decline`)}),(0,H.jsx)(`div`,{className:`q-status`,"aria-live":`polite`,children:f?(0,H.jsxs)(`span`,{className:`q-error`,role:`alert`,children:[(0,H.jsx)(U,{name:`alert`,size:12,strokeWidth:2}),(0,H.jsx)(`span`,{children:f})]}):u?(0,H.jsxs)(`span`,{className:`q-sending`,children:[(0,H.jsx)(W,{size:12}),(0,H.jsx)(`span`,{children:r(`question.sending`)})]}):null})]})]})}function Tl(e,t){let{outcome:n}=e;if(n)switch(e.status){case`answered`:return n.delivery===`handed_off`?{text:t(`question.delivery.handedOff`),tip:t(`question.delivery.handedOffTip`)}:void 0;case`declined`:return n.delivery===`handed_off`?{text:t(`question.delivery.declinedHandedOff`)}:void 0;case`expired`:{let e=_l(n,t);return e?{text:e}:void 0}default:return}}function El({item:e}){let t=V(),{outcome:n,prompts:r,status:i}=e,a=Tl(e,t),o=i===`answered`||i===`declined`?n?.by:void 0;return(0,H.jsxs)(H.Fragment,{children:[(0,H.jsx)(`div`,{className:`q-body`,children:r.map((e,a)=>{let o=i===`answered`?n?.answers?.[a]??[]:[];return(0,H.jsxs)(`div`,{className:`q-prompt`,children:[(0,H.jsx)(xl,{prompt:e,index:a,total:r.length}),(0,H.jsx)(`div`,{className:`q-text`,children:(0,H.jsx)(sc,{lines:3,expandLabel:t(`common.expand`),collapseLabel:t(`common.collapse`),watch:e.text,children:e.text})}),o.length>0?(0,H.jsx)(`ul`,{className:`q-picks`,"aria-label":t(`question.answer`),children:o.map((e,t)=>(0,H.jsx)(`li`,{className:`q-pick`,children:e},`${t}:${e}`))}):null]},e.key)})}),n?(0,H.jsxs)(`div`,{className:`q-foot q-foot--resolved`,children:[(0,H.jsxs)(`p`,{className:`q-meta`,children:[o?(0,H.jsx)(`span`,{className:`q-who`,children:vl(o,t)}):null,(0,H.jsx)(`time`,{className:`num`,dateTime:n.at,children:Tt(n.at)}),a?(0,H.jsx)(`span`,{className:`q-result`,"data-tip":a.tip,children:a.text}):null]}),i===`declined`&&n.note?(0,H.jsxs)(`p`,{className:`q-note`,children:[(0,H.jsx)(`span`,{className:`q-note-key`,children:t(`question.note`)}),n.note]}):null]}):null]})}var Dl=(0,l.memo)(function({item:e,sessionId:t,enter:n}){let r=V(),[i,a]=(0,l.useState)(void 0),o=e.status===`open`&&i?{...e,status:i.status,outcome:i.outcome}:e,{status:s}=o;return(0,l.useEffect)(()=>{s!==`open`&&yl.delete(e.questionId)},[s,e.questionId]),(0,H.jsxs)(`section`,{className:`question`,role:`group`,"aria-label":r(`question.label`),"data-status":s,"data-enter":n?``:void 0,children:[(0,H.jsxs)(`header`,{className:`q-head`,children:[(0,H.jsx)(`span`,{className:`q-title`,children:r(`question.title`)}),(0,H.jsxs)(`span`,{className:`q-state`,"data-status":s,children:[(0,H.jsx)(`i`,{className:`q-pip`,"aria-hidden":`true`}),r(`question.state.${s}`)]}),(0,H.jsx)(`time`,{className:`row-time num`,dateTime:e.at,"data-tip":new Date(e.at).toLocaleString(),children:Tt(e.at)})]}),s===`open`?(0,H.jsx)(wl,{item:o,sessionId:t,onSettled:a}):(0,H.jsx)(El,{item:o})]})});function Ol(){return typeof window<`u`&&window.matchMedia?.(`(prefers-reduced-motion: reduce)`).matches===!0}function kl(e,t){let[n,r]=(0,l.useState)(e);return e&&!n&&r(!0),(0,l.useEffect)(()=>{if(e||!n)return;if(t<=0||Ol()){r(!1);return}let i=window.setTimeout(()=>r(!1),t);return()=>window.clearTimeout(i)},[e,n,t]),{present:e||n,closing:!e&&n}}var Al={read:`file`,write:`edit`,edit:`edit`,search:`search`,shell:`terminal`,web:`globe`,mcp:`plug`,task:`branch`,plan:`list`,other:`zap`},jl=240,Ml=200;function Nl({since:e}){let t=St(),n=Date.parse(e);return Number.isFinite(n)?(0,H.jsx)(`span`,{className:`tool-dur num`,children:wt(Math.max(0,t-n))}):null}var Pl=(0,l.memo)(function({item:e}){let t=V(),[n,r]=(0,l.useState)(!1),i=!!(e.input||e.output||e.error||e.files?.length||e.exitCode!==void 0),a=e.status===`running`,o=t(`tool.status.${e.status}`),s=e.mcp?.server?`${e.mcp.server}${e.mcp.tool?` · ${e.mcp.tool}`:``}`:void 0,c=e.files?.length===1?e.files[0]:void 0,u=c?Hs(c):void 0;return(0,H.jsxs)(`div`,{className:`tool`,"data-status":e.status,"data-open":n?``:void 0,children:[(0,H.jsxs)(`button`,{type:`button`,className:`tool-head`,"aria-expanded":i?n:void 0,disabled:!i,onClick:()=>r(e=>!e),children:[(0,H.jsx)(`span`,{className:`tool-icon`,children:a?(0,H.jsxs)(H.Fragment,{children:[(0,H.jsx)(W,{size:12}),(0,H.jsx)(`span`,{className:`sr-only`,children:o})]}):(0,H.jsx)(U,{name:Al[e.category],size:14})}),(0,H.jsx)(`span`,{className:`tool-verb`,children:zt(e.category,t)}),(0,H.jsxs)(`span`,{className:`tool-title mono`,"data-tip":e.title,children:[s?(0,H.jsx)(`em`,{children:s}):null,e.title]}),(0,H.jsxs)(`span`,{className:`tool-end`,children:[e.files&&e.files.length>1?(0,H.jsx)(`span`,{className:`tool-files num`,"data-tip":e.files.map(e=>e.path).join(`
33
- `),children:t(`tool.files`,{n:e.files.length})}):u?(0,H.jsx)(`span`,{className:`tool-files num`,"data-tip":c?.path,children:(0,H.jsx)(wc,{delta:u})}):null,a?(0,H.jsx)(Nl,{since:e.startedAt}):e.durationMs===void 0?null:(0,H.jsx)(`span`,{className:`tool-dur num`,children:wt(e.durationMs)}),e.status===`failed`||e.status===`cancelled`||e.status===`unfinished`?(0,H.jsxs)(`span`,{className:`tool-state`,"data-tip":o,children:[(0,H.jsx)(U,{name:e.status===`failed`?`close`:`minus`,size:13,strokeWidth:2.2}),(0,H.jsx)(`span`,{className:`sr-only`,children:o})]}):null,i?(0,H.jsx)(U,{name:`chevronRight`,size:12,className:`tool-chevron`,strokeWidth:2}):(0,H.jsx)(`span`,{className:`tool-chevron-gap`})]})]}),n&&i?(0,H.jsxs)(`div`,{className:`tool-detail`,children:[e.status===`unfinished`?(0,H.jsx)(`div`,{className:`note`,children:t(`tool.unfinishedNote`)}):null,e.input?(0,H.jsx)(dc,{preview:e.input,label:t(`tool.input`)}):null,e.output?(0,H.jsx)(dc,{preview:e.output,label:e.exitCode===void 0?t(`tool.output`):`${t(`tool.output`)} · ${t(`tool.exit`,{code:e.exitCode})}`}):e.exitCode===void 0?null:(0,H.jsx)(`div`,{className:`note mono`,children:t(`tool.exit`,{code:e.exitCode})}),e.error?(0,H.jsx)(`div`,{className:`note note--red`,children:e.error}):null,e.files?.map(e=>{let n=Hs(e);return(0,H.jsxs)(`div`,{className:`file-change`,children:[(0,H.jsxs)(`div`,{className:`file-change-head`,children:[(0,H.jsx)(zo,{tone:e.change===`deleted`?`red`:`neutral`,children:t(`file.${e.change}`)}),(0,H.jsx)(`span`,{className:`mono file-path`,"data-tip":e.path,children:e.path}),n?(0,H.jsx)(`span`,{className:`num file-stat`,children:(0,H.jsx)(wc,{delta:n})}):null]}),e.diff?(0,H.jsx)(dc,{preview:e.diff,maxHeight:260}):null]},e.path)})]}):null]})}),Fl=(0,l.memo)(function({item:e}){let t=V(),[n,r]=(0,l.useState)(!1),i=e.text.trim().length>0,a=t(`reasoning.note`);return(0,H.jsxs)(`div`,{className:`reasoning`,"data-open":n?``:void 0,"data-streaming":e.streaming?``:void 0,children:[(0,H.jsxs)(`button`,{type:`button`,className:`reasoning-head`,disabled:!i,"aria-expanded":i?n:void 0,"aria-description":a,onClick:()=>r(e=>!e),children:[(0,H.jsx)(`span`,{className:`tool-icon`,children:e.streaming?(0,H.jsx)(W,{size:12}):(0,H.jsx)(U,{name:`sparkle`,size:14})}),(0,H.jsx)(`span`,{className:`tool-verb`,"data-tip":a,children:e.streaming?t(`reasoning.live`):t(`reasoning.done`)}),(0,H.jsxs)(`span`,{className:`tool-end`,children:[e.durationMs===void 0?null:(0,H.jsx)(`span`,{className:`tool-dur num`,children:wt(e.durationMs)}),i?(0,H.jsx)(U,{name:`chevronRight`,size:12,className:`tool-chevron`,strokeWidth:2}):(0,H.jsx)(`span`,{className:`tool-chevron-gap`})]})]}),n&&i?(0,H.jsx)(`div`,{className:`reasoning-body`,children:(0,H.jsx)(il,{text:e.text,streaming:e.streaming})}):null]})}),Il=(0,l.memo)(function({items:e,live:t,expandAll:n,enter:r,following:i=!0}){let a=V(),o=(0,l.useId)(),[s,c]=(0,l.useState)(void 0),[u,d]=(0,l.useState)(60),f=(0,l.useMemo)(()=>js(e),[e]),p=(0,l.useMemo)(()=>Ms(f.mix,e=>zt(e,a)),[f.mix,a]),m=s??(n||t),{present:h,closing:g}=kl(m,jl),_=(0,l.useRef)(void 0),v=Math.max(0,e.length-u),y=i||_.current===void 0?v:Math.max(Math.min(_.current,v),v-200),b=y>0?e.slice(y):e;return(0,l.useLayoutEffect)(()=>{_.current=y}),f.tools===0?(0,H.jsx)(`div`,{className:`work work--solo`,"data-live":f.running?``:void 0,"data-enter":r?``:void 0,children:e.map(e=>e.type===`reasoning`?(0,H.jsx)(Fl,{item:e},e.id):null)}):(0,H.jsxs)(`div`,{className:`work`,"data-open":m?``:void 0,"data-live":f.running?``:void 0,"data-failed":f.failed>0?``:void 0,"data-enter":r?``:void 0,children:[(0,H.jsxs)(`button`,{type:`button`,className:`work-head`,"aria-expanded":m,"aria-controls":h?o:void 0,onClick:()=>c(!m),children:[(0,H.jsx)(U,{name:`chevronRight`,size:12,className:`work-chevron`,strokeWidth:2}),(0,H.jsx)(`span`,{className:`work-title`,children:f.running?a(`work.running`,{n:f.tools}):a(`work.done`,{n:f.tools})}),(0,H.jsx)(`span`,{className:`work-mix`,children:p.slice(0,4).map(([e,t])=>`${e} ${t}`).join(` · `)}),f.failed>0?(0,H.jsx)(`span`,{className:`work-failed num`,"data-tip":a(`work.failedTip`),children:a(`work.failed`,{n:f.failed})}):null,(0,H.jsx)(`span`,{className:`spacer`}),f.durationMs!==void 0&&!f.running?(0,H.jsx)(`span`,{className:`work-dur num`,children:wt(f.durationMs)}):null]}),h?(0,H.jsx)(`div`,{className:`work-panel`,id:o,"data-state":g?`closing`:`open`,children:(0,H.jsxs)(`div`,{className:`work-body`,children:[y>0?(0,H.jsxs)(`button`,{type:`button`,className:`more-btn more-btn--inline`,onClick:()=>d(e=>e+Ml),children:[(0,H.jsx)(U,{name:`chevronUp`,size:11,strokeWidth:2}),a(`work.older`,{n:y})]}):null,b.map(e=>e.type===`tool`?(0,H.jsx)(Pl,{item:e},e.id):(0,H.jsx)(Fl,{item:e},e.id))]})}):null]})});function Ll(e,t){if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(e[n]!==t[n])return!1;return!0}function Rl(e,t){let n=[],r=t?new Map(t.map(e=>[e.key,e])):void 0,i,a=()=>{if(i&&i.length>0){let e=`work:${i[0]?.id??n.length}`,t=r?.get(e);n.push(t?.kind===`work`&&Ll(t.items,i)?t:{key:e,kind:`work`,items:i})}i=void 0};for(let t of e.timeline)if(t.type===`tool`||t.type===`reasoning`)(i??=[]).push(t);else switch(a(),t.type){case`message`:{let r=e.idx.messages.get(t.messageId);n.push({key:t.id,kind:`message`,item:t,message:r===void 0?void 0:e.messages[r]});break}case`assistant`:(t.text.trim().length>0||t.streaming)&&n.push({key:t.id,kind:`assistant`,item:t});break;case`plan`:n.push({key:t.id,kind:`plan`,item:t});break;case`diagnostic`:n.push({key:t.id,kind:`diagnostic`,item:t});break;case`question`:n.push({key:t.id,kind:`question`,item:t});break;case`run`:n.push({key:t.id,kind:`run`,item:t})}return a(),n}function zl(e){switch(e.kind){case`assistant`:case`plan`:case`question`:return e.item.at;case`work`:return e.items[0]?.at;default:return}}function Bl({at:e}){return(0,H.jsx)(`time`,{className:`row-time num`,dateTime:e,"data-tip":new Date(e).toLocaleString(),children:Tt(e)})}function Vl({harness:e,at:t,label:n}){let r=V();return(0,H.jsxs)(`div`,{className:`turn-head`,children:[(0,H.jsx)(ho,{harness:e,size:16,variant:`bare`}),(0,H.jsx)(`span`,{className:`turn-name`,children:no(e,r)}),n?(0,H.jsx)(`span`,{className:`turn-tag`,children:n}):null,(0,H.jsx)(Bl,{at:t})]})}var Hl=(0,l.memo)(function({item:e,lead:t,enter:n}){let r=V(),i=e.phase===`commentary`;return(0,H.jsxs)(`article`,{className:`msg msg--assistant`,"data-phase":e.phase,"data-streaming":e.streaming?``:void 0,"data-enter":n?``:void 0,"aria-label":i?r(`msg.commentary`):void 0,children:[t?null:(0,H.jsxs)(`span`,{className:`msg-aside`,children:[i?(0,H.jsx)(`span`,{children:r(`msg.commentary`)}):null,(0,H.jsx)(Bl,{at:e.at})]}),(0,H.jsx)(il,{text:e.text,streaming:e.streaming})]})}),Ul=(0,l.memo)(function({item:e,message:t,enter:n}){let r=V();if(!t)return null;let i=t.kind===`task`,a=t.author.kind!==`system`;return(0,H.jsxs)(`article`,{className:`msg msg--message`,"data-kind":t.kind,"data-author":t.author.kind,"data-message-id":t.id,"data-enter":n?``:void 0,children:[(0,H.jsxs)(`header`,{className:`msg-head`,children:[(0,H.jsx)(`span`,{className:`msg-author`,children:t.author.label}),(0,H.jsx)(`span`,{className:`msg-kind`,"data-kind":t.kind,children:r(`msg.kind.${t.kind}`)}),(0,H.jsx)(Bl,{at:e.at})]}),(0,H.jsx)(`div`,{className:`msg-bubble`,children:(0,H.jsx)(`div`,{className:`msg-text`,children:i?(0,H.jsx)(sc,{lines:4,expandLabel:r(`common.expand`),collapseLabel:r(`common.collapse`),watch:t.text,children:t.text}):t.text})}),(0,H.jsxs)(`footer`,{className:`msg-foot`,children:[(0,H.jsx)(xc,{message:t}),a?(0,H.jsx)(Cc,{message:t}):null]})]})}),Wl=(0,l.memo)(function({item:e,enter:t}){let n=V(),r=e.entries.filter(e=>e.status===`completed`).length;return(0,H.jsxs)(`section`,{className:`plan`,"data-enter":t?``:void 0,children:[(0,H.jsxs)(`header`,{className:`plan-head`,children:[(0,H.jsx)(U,{name:`list`,size:14}),(0,H.jsx)(`span`,{children:n(`plan.title`)}),(0,H.jsxs)(`span`,{className:`plan-count num`,children:[r,`/`,e.entries.length]})]}),e.explanation?(0,H.jsx)(`p`,{className:`plan-note`,children:e.explanation}):null,(0,H.jsx)(`ol`,{className:`plan-list`,children:e.entries.map((e,t)=>(0,H.jsxs)(`li`,{"data-status":e.status,children:[(0,H.jsx)(`span`,{className:`plan-mark`,children:e.status===`completed`?(0,H.jsx)(U,{name:`check`,size:10,strokeWidth:3}):e.status===`in_progress`?(0,H.jsx)(W,{size:10}):null}),(0,H.jsx)(`span`,{children:e.text})]},e.id??t))})]})});function Gl(e,t){let n=`code.${e}`,r=t(n);return r===n?void 0:r}var Kl=(0,l.memo)(function({item:e,enter:t}){let n=V(),r=Gl(e.code,n);return(0,H.jsxs)(`div`,{className:`diag`,"data-level":e.level,"data-enter":t?``:void 0,children:[(0,H.jsx)(U,{name:e.level===`info`?`info`:`alert`,size:14}),(0,H.jsxs)(`span`,{className:`diag-body`,children:[r?(0,H.jsx)(`strong`,{className:`diag-head`,children:r}):null,(0,H.jsx)(`span`,{className:`diag-text`,"data-tip":e.code,children:e.message})]}),(0,H.jsx)(Bl,{at:e.at})]})}),ql=(0,l.memo)(function({item:e,enter:t}){let n=V(),r=e.durationMs===void 0?``:` · ${wt(e.durationMs)}`;return(0,H.jsxs)(`div`,{className:`run-marker`,"data-phase":e.phase,"data-enter":t?``:void 0,children:[(0,H.jsx)(`span`,{className:`run-line`}),(0,H.jsxs)(`span`,{className:`run-label`,children:[n(`run.marker.${e.phase}`,{n:e.runIndex}),r,e.stopReason&&e.phase!==`completed`?` · ${e.stopReason}`:``]}),(0,H.jsx)(`span`,{className:`run-line`})]})});function Jl({summary:e}){let t=V(),n=St(),{activity:r}=e,i=kt(e,n),a=r.kind===`tool`?r.tool:void 0,o=(e.openQuestions??0)>0,s=e.phase===`queued`||o;return(0,H.jsxs)(`div`,{className:`live-line`,role:`status`,"data-waiting":s?``:void 0,"data-enter":``,children:[s?(0,H.jsx)(U,{name:`clock`,size:13}):(0,H.jsx)(W,{size:12}),(0,H.jsx)(`span`,{className:`live-text`,children:o?t(`question.waiting`):a?zt(a.category,t):t(`activity.${r.kind}`)},o?`asking`:r.kind),i===void 0?null:(0,H.jsx)(`span`,{className:`num live-clock`,"aria-hidden":`true`,children:Ct(i)})]})}var Yl=400,Xl=48,Zl=18,Ql=2500,$l=new WeakMap;function eu(){return window.matchMedia(`(prefers-reduced-motion: reduce)`).matches}function tu(e){window.clearTimeout($l.get(e)),e.removeAttribute(`data-flash`),e.offsetWidth,e.setAttribute(`data-flash`,``),$l.set(e,window.setTimeout(()=>e.removeAttribute(`data-flash`),Ql))}function nu({state:e,rev:t,summary:n}){let r=V(),i=(0,l.useRef)([]),a=(0,l.useMemo)(()=>Rl(e,i.current),[e,t]);(0,l.useLayoutEffect)(()=>{i.current=a},[a]);let[o,s]=(0,l.useState)(Yl),[c,u]=(0,l.useState)(!1),d=(0,l.useRef)(null),f=(0,l.useRef)(!0),[p,m]=(0,l.useState)(`none`),h=p===`none`,[g,_]=(0,l.useState)(!1),v=(0,l.useRef)(0),y=n.phase===`running`||n.phase===`starting`,b=y||n.phase===`queued`,x=Math.max(0,a.length-o),S=x>0?a.slice(x):a,C=(0,l.useMemo)(()=>Ns(a.map(e=>e.kind)),[a]),w=(()=>{for(let e=S.length-1;e>=0;e--)if(S[e]?.kind===`work`)return e;return-1})(),T=(0,l.useMemo)(()=>a.some(e=>e.kind===`work`&&e.items.some(e=>e.type===`tool`)),[a]),E=(0,l.useRef)(void 0),D=(0,l.useRef)(new Set),O=(0,l.useRef)(e.meta.id);if(E.current===void 0||O.current!==e.meta.id)E.current=new Set(a.map(e=>e.key)),D.current=new Set,O.current=e.meta.id;else for(let e of S)E.current.has(e.key)||D.current.add(e.key);(0,l.useLayoutEffect)(()=>{for(let e of a)E.current?.add(e.key)},[a]);let ee=(0,l.useCallback)(e=>{let t=d.current;t&&t.scrollTo({top:t.scrollHeight,behavior:e&&!eu()?`smooth`:`auto`})},[]);(0,l.useLayoutEffect)(()=>{let t=e.timeline.length;f.current?(ee(!1),m(`none`)):t>v.current&&m(`new`),v.current=t},[e,t,a.length,ee]),(0,l.useEffect)(()=>{let e=d.current,t=e?.firstElementChild;if(!e||!t)return;let n=new ResizeObserver(()=>{f.current&&(e.scrollTop=e.scrollHeight)});return n.observe(t),n.observe(e),()=>n.disconnect()},[]);let k=(0,l.useRef)(0),te=()=>{let e=d.current;if(!e)return;let t=e.scrollTop,n=t<k.current-1;k.current=t,Ps(e,Xl)?f.current=!0:n&&(f.current=!1);let r=f.current;m(e=>r?`none`:e===`none`?`idle`:e),_(t>2)},ne=e=>{let t=d.current;t&&e.deltaY<0&&t.scrollTop>0&&(f.current=!1)};(0,l.useEffect)(()=>As(()=>{f.current=!0,m(`none`),ee(!1)}),[ee]);let re=(0,l.useRef)(void 0),ie=(0,l.useCallback)(e=>{let t=d.current;if(!t)return!1;let n=[...t.querySelectorAll(`[data-message-id]`)].find(t=>t.dataset.messageId===e);if(!n)return!1;let r=n.getBoundingClientRect().top-t.getBoundingClientRect().top+t.scrollTop-Zl;return f.current=!1,m(e=>e===`none`?`idle`:e),t.scrollTo({top:Math.max(0,r),behavior:eu()?`auto`:`smooth`}),tu(n),!0},[]),ae=(0,l.useCallback)(e=>{let t=a.findIndex(t=>t.kind===`message`&&t.message?.id===e);t<0||(t<x?(re.current=e,s(a.length-t)):ie(e))},[a,x,ie]);return(0,l.useLayoutEffect)(()=>{let e=re.current;e&&ie(e)&&(re.current=void 0)},[o,ie]),(0,l.useEffect)(()=>{let e=Ds();return e&&ae(e),Es(e=>{Ds(),ae(e)})},[ae]),(0,H.jsxs)(`div`,{className:`timeline`,"data-scrolled":g?``:void 0,children:[(0,H.jsxs)(`div`,{className:`timeline-tools`,children:[a.length>0?(0,H.jsx)(`span`,{className:`timeline-count num`,children:r(`timeline.count`,{n:a.length})}):null,T?(0,H.jsx)(`button`,{type:`button`,className:`link-btn`,onClick:()=>u(e=>!e),children:r(c?`timeline.collapseAll`:`timeline.expandAll`)}):null]}),(0,H.jsx)(`div`,{className:`timeline-scroll`,ref:d,onScroll:te,onWheel:ne,"data-scroll":!0,children:(0,H.jsxs)(`div`,{className:`timeline-inner`,children:[x>0?(0,H.jsx)(`button`,{type:`button`,className:`more-btn`,onClick:()=>s(e=>e+Yl),children:r(`timeline.older`,{n:x})}):null,S.map((e,t)=>{let i=C[x+t]===!0,a=D.current.has(e.key),o=i?zl(e):void 0,s=e.kind===`assistant`&&e.item.phase===`commentary`?r(`msg.commentary`):void 0;return(0,H.jsxs)(l.Fragment,{children:[o?(0,H.jsx)(Vl,{harness:n.harness,at:o,label:s}):null,e.kind===`message`?(0,H.jsx)(Ul,{item:e.item,message:e.message,enter:a}):null,e.kind===`assistant`?(0,H.jsx)(Hl,{item:e.item,lead:i,enter:a}):null,e.kind===`work`?(0,H.jsx)(Il,{items:e.items,live:y&&t===w&&t>=S.length-2,expandAll:c,enter:a,following:h}):null,e.kind===`plan`?(0,H.jsx)(Wl,{item:e.item,enter:a}):null,e.kind===`diagnostic`?(0,H.jsx)(Kl,{item:e.item,enter:a}):null,e.kind===`question`?(0,H.jsx)(Dl,{item:e.item,sessionId:n.id,enter:a}):null,e.kind===`run`?(0,H.jsx)(ql,{item:e.item,enter:a}):null]},e.key)}),b?(0,H.jsx)(Jl,{summary:n}):null,a.length===0&&!b?(0,H.jsx)(`div`,{className:`timeline-empty`,children:r(`timeline.empty`)}):null]})}),p===`none`?null:(0,H.jsxs)(`button`,{type:`button`,className:`jump`,"data-new":p===`new`?``:void 0,"aria-label":p===`new`?void 0:r(`timeline.latest`),"data-tip":p===`new`?void 0:r(`timeline.latest`),onClick:()=>{f.current=!0,ee(!0),m(`none`)},children:[(0,H.jsx)(U,{name:`arrowDown`,size:14,strokeWidth:2}),p===`new`?r(`timeline.jump`):null]})]})}function ru(e){return e>=1160?`wide`:e>=800?`medium`:`narrow`}function K(e){let[t,n]=(0,l.useState)(()=>ru(window.innerWidth));return(0,l.useLayoutEffect)(()=>{let t=e.current;if(!t)return;let r=()=>n(ru(t.clientWidth));r();let i=new ResizeObserver(r);return i.observe(t),()=>i.disconnect()},[e]),t}function iu(e){let t=z.get();return t.sessions[e]===void 0&&t.archived[e]!==void 0}function au(e){if(iu(e)){Ni({kind:`archived`});return}let t=oi(Object.values(z.get().sessions),e);t?Pi({kind:`origin`,key:t}):Ni({kind:`overview`})}function ou({summary:e}){let t=V(),n=e.runtime===`fixture`,r=e.effort?.trim()||void 0,i=e.phase===`running`||e.status===`queued`||e.status===`starting`,a=e.origin,o=e.archivedAt!==void 0,s=I(pa,e=>e.busy>0),c=t(o?`archive.title`:`focus.back`);return(0,H.jsxs)(`header`,{className:`focus-head`,style:{viewTransitionName:`session-card`},"data-phase":e.phase,children:[(0,H.jsxs)(`div`,{className:`head-top`,children:[(0,H.jsxs)(`button`,{type:`button`,className:`btn btn--ghost btn--back`,onClick:()=>au(e.id),"data-tip":`${c} · Esc`,children:[(0,H.jsx)(U,{name:`arrowLeft`,size:15,strokeWidth:2}),c]}),(0,H.jsxs)(`span`,{className:`head-origin`,"data-tip":a.sessionRef?[`${a.hostLabel} · ${a.sessionRef.id}`,...is(a)?[t(`origin.refDeclaredTip`)]:[]].join(`
34
- `):a.hostLabel,children:[(0,H.jsx)(fs,{host:a.host,size:14}),(0,H.jsx)(`span`,{children:a.kind===`user`?t(`origin.user`):t(`origin.dispatchedBy`,{host:a.hostLabel})}),a.sessionRef?(0,H.jsx)(`span`,{className:`mono head-origin-ref`,children:p(a.sessionRef.id,10)}):null,is(a)?(0,H.jsx)(`span`,{className:`head-origin-ref`,children:t(`origin.refDeclared`)}):null]}),(0,H.jsx)(`span`,{className:`spacer`}),o?(0,H.jsxs)(`button`,{type:`button`,className:`btn btn--ghost`,disabled:s,"aria-busy":s||void 0,onClick:()=>void Ca([e.id]),"data-tip":t(`archive.unarchiveTip`),children:[(0,H.jsx)(U,{name:`unarchive`,size:14}),(0,H.jsx)(`span`,{className:`btn-label`,children:t(`menu.unarchive`)})]}):null,(0,H.jsxs)(`button`,{type:`button`,className:`btn btn--ghost`,onClick:()=>void Bo(ro(e.id)).then(e=>Di(e?`success`:`warn`,t(e?`common.copied`:`common.copyFailed`),1800)),"data-tip":t(`menu.copyLink`),children:[(0,H.jsx)(U,{name:`link`,size:14}),(0,H.jsx)(`span`,{className:`btn-label`,children:t(`focus.link`)})]}),i?(0,H.jsxs)(`button`,{type:`button`,className:`btn btn--danger-ghost`,onClick:()=>void ia(e.id,{ok:t(`toast.cancelOk`),nothing:t(`toast.cancelNothing`),failed:t(`toast.cancelFailed`)}),children:[(0,H.jsx)(U,{name:`stop`,size:13}),(0,H.jsx)(`span`,{className:`btn-label`,children:t(`composer.cancel`)})]}):null,(0,H.jsx)(jo,{items:()=>Jo(e,t,{afterRemove:()=>Ni({kind:o?`archived`:`overview`})}),label:t(`node.menu`)})]}),(0,H.jsxs)(`div`,{className:`head-main`,children:[(0,H.jsx)(ho,{harness:e.harness,size:48,simulated:n}),(0,H.jsxs)(`div`,{className:`head-text`,children:[(0,H.jsx)(`h1`,{className:`head-title`,"data-tip":e.title,children:e.title}),(0,H.jsxs)(`div`,{className:`head-chips`,children:[(0,H.jsx)(zo,{tone:`neutral`,tip:t(`info.model`),children:eo(e,t)}),r?(0,H.jsx)(zo,{tone:`neutral`,tip:t(`info.effort`),children:r}):null,o?(0,H.jsx)(zo,{tone:`neutral`,tip:t(`archive.chipTip`),children:t(`archive.chip`)}):null]})]})]}),(0,H.jsxs)(`div`,{className:`head-activity`,"data-phase":e.phase,children:[(e.phase===`running`||e.phase===`starting`)&&!e.openQuestions?(0,H.jsx)(W,{size:12}):null,(0,H.jsx)(`span`,{className:`head-activity-text`,children:Vt(e,t)})]})]})}function su({summary:e}){let t=V(),[n,r]=(0,l.useState)(!1),i=e.lastError;if(!i||e.phase!==`failed`&&e.phase!==`lost`)return null;let a=Gl(i.code,t)??(e.phase===`lost`?t(`phase.lost`):t(`error.title`)),o=!!i.detail&&i.detail!==i.message;return(0,H.jsxs)(`div`,{className:`error-banner`,role:`alert`,"data-phase":e.phase,children:[(0,H.jsx)(`span`,{className:`error-icon`,"aria-hidden":`true`,children:(0,H.jsx)(U,{name:`alert`,size:16})}),(0,H.jsxs)(`div`,{className:`error-body`,children:[(0,H.jsxs)(`div`,{className:`error-line`,children:[(0,H.jsx)(`strong`,{className:`error-title`,children:a}),(0,H.jsx)(`span`,{className:`error-code mono`,children:i.code})]}),(0,H.jsx)(`p`,{className:`error-message`,children:i.message}),i.retryable?(0,H.jsx)(`p`,{className:`error-hint`,children:t(`error.retryable`)}):null,o?(0,H.jsxs)(H.Fragment,{children:[(0,H.jsxs)(`button`,{type:`button`,className:`error-toggle`,"aria-expanded":n,onClick:()=>r(e=>!e),children:[(0,H.jsx)(U,{name:n?`chevronDown`:`chevronRight`,size:12,strokeWidth:2.2}),t(`error.detail`)]}),n?(0,H.jsx)(`pre`,{className:`error-detail mono`,children:i.detail}):null]}):null]})]})}function cu({summary:e,archivedAt:t}){let n=V(),r=Et(t,$a(),!0);return(0,H.jsx)(`div`,{className:`banner banner--archived`,role:`status`,children:n(e.archivedBy===`retention`?`archive.bannerAuto`:`archive.banner`,{time:r})})}function lu(){return(0,H.jsxs)(`div`,{className:`skeleton`,"aria-hidden":`true`,children:[(0,H.jsx)(`i`,{style:{width:`42%`}}),(0,H.jsx)(`i`,{style:{width:`86%`}}),(0,H.jsx)(`i`,{style:{width:`74%`}}),(0,H.jsx)(`i`,{style:{width:`58%`}})]})}function uu({reason:e}){let t=V();return(0,H.jsxs)(`div`,{className:`state-card`,role:`alert`,children:[(0,H.jsx)(`span`,{className:`state-icon`,"data-tone":e===`failed`?`red`:`neutral`,children:(0,H.jsx)(U,{name:e===`failed`?`alert`:`search`,size:22})}),(0,H.jsx)(`h2`,{children:t(e===`failed`?`focus.failedTitle`:`focus.notFoundTitle`)}),(0,H.jsx)(`p`,{children:t(e===`failed`?`focus.failedBody`:`focus.notFoundBody`)}),(0,H.jsx)(`div`,{className:`state-actions`,children:(0,H.jsx)(`button`,{type:`button`,className:`btn btn--primary`,onClick:()=>Ni({kind:`overview`}),children:t(`focus.back`)})})]})}function du({id:e}){let t=V(),n=I(z,t=>t.sessions[e]??t.archived[e]),r=I(z,t=>t.detail?.id===e?t.detail:void 0),i=(0,l.useRef)(null),a=K(i),[o,s]=(0,l.useState)(`timeline`);(0,l.useEffect)(()=>a===`narrow`?Es(()=>s(`timeline`)):void 0,[a]),(0,l.useEffect)(()=>(Ti.lastFocusId=e,()=>{Ti.lastFocusId=e}),[e]),(0,l.useEffect)(()=>{let t=t=>{if(t.key!==`Escape`)return;let n=t.target;if(n&&(n.isContentEditable||/^(input|textarea|select)$/i.test(n.tagName)))return;let r=z.get();r.settings.open||r.confirm||r.switcherOpen||document.querySelector(`[role="menu"]`)||au(e)};return document.addEventListener(`keydown`,t),()=>document.removeEventListener(`keydown`,t)},[e]);let c=r?.state;if(!n&&(r?.error===`not_found`||r&&!r.loading&&!c))return(0,H.jsx)(`div`,{className:`focus`,ref:i,children:(0,H.jsx)(uu,{reason:`not_found`,id:e})});if(!n)return(0,H.jsx)(`div`,{className:`focus`,ref:i,children:(0,H.jsx)(lu,{})});if(!c&&r?.error===`failed`)return(0,H.jsxs)(`div`,{className:`focus`,ref:i,"data-mode":a,children:[(0,H.jsx)(ou,{summary:n}),(0,H.jsx)(`div`,{className:`focus-body`,children:(0,H.jsxs)(`div`,{className:`state-card`,role:`alert`,children:[(0,H.jsx)(`span`,{className:`state-icon`,"data-tone":`red`,children:(0,H.jsx)(U,{name:`alert`,size:22})}),(0,H.jsx)(`h2`,{children:t(`focus.failedTitle`)}),(0,H.jsx)(`p`,{children:t(`focus.failedBody`)}),(0,H.jsx)(`div`,{className:`state-actions`,children:(0,H.jsxs)(`button`,{type:`button`,className:`btn btn--primary`,onClick:()=>void zi(e),children:[(0,H.jsx)(U,{name:`refresh`,size:14}),t(`common.retry`)]})})]})})]});let u=(0,H.jsxs)(`main`,{className:`focus-main`,children:[(0,H.jsx)(su,{summary:n}),c?(0,H.jsx)(nu,{state:c,rev:r?.rev??0,summary:n}):(0,H.jsx)(lu,{}),(0,H.jsx)(zs,{summary:n})]}),d=c?(0,H.jsxs)(H.Fragment,{children:[(0,H.jsx)(Pc,{state:c,summary:n}),(0,H.jsx)(Fc,{state:c,summary:n})]}):(0,H.jsx)(lu,{}),f=c?(0,H.jsx)(Bc,{state:c,summary:n}):(0,H.jsx)(lu,{});return(0,H.jsxs)(`div`,{className:`focus`,ref:i,"data-mode":a,children:[(0,H.jsx)(ou,{summary:n}),r?.error===`not_found`?(0,H.jsx)(`div`,{className:`banner banner--amber`,children:t(`focus.removedBanner`)}):null,n.archivedAt===void 0?null:(0,H.jsx)(cu,{summary:n,archivedAt:n.archivedAt}),a===`narrow`?(0,H.jsxs)(H.Fragment,{children:[(0,H.jsx)(`div`,{className:`tabs`,role:`tablist`,"aria-label":t(`focus.tabs`),children:[`timeline`,`task`,`summary`,`info`].map(e=>(0,H.jsx)(`button`,{type:`button`,role:`tab`,"aria-selected":o===e,"data-active":o===e?``:void 0,onClick:()=>s(e),children:t(`focus.tab.${e}`)},e))}),(0,H.jsxs)(`div`,{className:`focus-body focus-body--narrow`,children:[o===`timeline`?u:null,o===`task`&&c?(0,H.jsx)(`aside`,{className:`rail`,"data-scroll":!0,children:(0,H.jsx)(Pc,{state:c,summary:n})}):null,o===`summary`?(0,H.jsx)(`aside`,{className:`rail`,"data-scroll":!0,children:f}):null,o===`info`&&c?(0,H.jsx)(`aside`,{className:`rail`,"data-scroll":!0,children:(0,H.jsx)(Fc,{state:c,summary:n})}):null]})]}):a===`medium`?(0,H.jsxs)(`div`,{className:`focus-body focus-body--medium`,children:[(0,H.jsxs)(`aside`,{className:`rail rail--left`,"data-scroll":!0,children:[d,f]}),u]}):(0,H.jsxs)(`div`,{className:`focus-body focus-body--wide`,children:[(0,H.jsx)(`aside`,{className:`rail rail--left`,"data-scroll":!0,children:d}),u,(0,H.jsx)(`aside`,{className:`rail rail--right`,"data-scroll":!0,children:f})]})]})}var fu={entries:new Map,pending:!1,tracked:new Set},pu=class{slots=new Map;listeners=new Set;view=fu;waitTimer;load;busyMs;idleMs;firstWaitMs;now;visible;constructor(e={}){this.load=e.load??(e=>N.git(e)),this.busyMs=e.busyMs??4e3,this.idleMs=e.idleMs??15e3,this.firstWaitMs=e.firstWaitMs??700,this.now=e.now??Date.now,this.visible=e.visible??(()=>typeof document>`u`||document.visibilityState!==`hidden`)}subscribe=e=>(this.listeners.add(e),()=>{this.listeners.delete(e)});getView=()=>this.view;setTargets(e){let t=new Map;for(let n of e){if(!n.workspace)continue;let e=t.get(n.workspace);t.set(n.workspace,{workspace:n.workspace,busy:n.busy||(e?.busy??!1)})}for(let[e,n]of[...this.slots])t.has(e)||(n.timer&&clearTimeout(n.timer),this.slots.delete(e));let n=[],r=[];for(let[e,i]of t){let t=this.slots.get(e);if(t)t.target.busy!==i.busy&&(t.target=i,r.push(t));else{let t={target:i,entry:void 0,settled:!1,since:this.now(),timer:void 0,inflight:!1,again:!1};this.slots.set(e,t),n.push(t)}}this.publish();for(let e of[...n,...r])this.refresh(e)}resume(){for(let e of this.slots.values())!e.timer&&!e.inflight&&this.refresh(e)}stop(){for(let e of this.slots.values())e.timer&&clearTimeout(e.timer);this.slots.clear(),this.waitTimer&&clearTimeout(this.waitTimer),this.waitTimer=void 0,this.view=fu;for(let e of[...this.listeners])e()}async refresh(e){let t=e.target.workspace;if(this.slots.get(t)!==e)return;if(e.inflight){e.again=!0;return}e.timer&&clearTimeout(e.timer),e.timer=void 0,e.inflight=!0;let n;try{n=await this.load(t)}catch{n=void 0}e.inflight=!1,this.slots.get(t)===e&&(n?.git?e.entry={git:n.git,stale:!1}:n&&(n.reason===`not_repo`||n.reason===`missing`)?e.entry=void 0:e.entry&&!e.entry.stale&&(e.entry={git:e.entry.git,stale:!0}),e.settled=!0,this.publish(),e.again?(e.again=!1,this.refresh(e)):this.visible()&&(e.timer=setTimeout(()=>void this.refresh(e),e.target.busy?this.busyMs:this.idleMs)))}publish(){let e=this.now(),t=new Map,n=new Set,r=!1,i=1/0;for(let[a,o]of this.slots)if(n.add(a),o.entry&&t.set(a,o.entry),!o.settled){let t=this.firstWaitMs-(e-o.since);t>0&&(r=!0,i=Math.min(i,t))}this.view={entries:t,pending:r,tracked:n},this.waitTimer&&clearTimeout(this.waitTimer),this.waitTimer=r?setTimeout(()=>this.publish(),i+1):void 0;for(let e of[...this.listeners])e()}};function mu(e){let t=new Map;for(let n of e){let{key:e,workspace:r}=n.origin;r&&!t.has(e)&&t.set(e,r)}let n=new Map;for(let e of t.values())n.set(e,n.get(e)??!1);for(let r of e){let e=t.get(r.origin.key);e&&r.phase===`running`&&n.set(e,!0)}return{targets:[...n].map(([e,t])=>({workspace:e,busy:t})),workspaceOf:t}}function hu(e){return Zn(e)}var gu=(e,t)=>e<t?-1:+(e>t);function _u(e,t){if(e.entry.stale!==t.entry.stale)return!e.entry.stale;let n=Date.parse(e.entry.git.checkedAt)||0,r=Date.parse(t.entry.git.checkedAt)||0;return n===r?e.workspace<t.workspace:n>r}function vu(e){let t=e.filter(e=>!e.entry.stale),n=new Map;for(let r of t.length>0?t:e){let e=hu(r.entry.git.root);if(!e)continue;let t=n.get(e);(!t||_u(r,t))&&n.set(e,r)}let r=[...n].sort(([e],[t])=>gu(e,t)),[i]=r;return i?r.length===1?{kind:`known`,worktree:i[0],evidence:i[1]}:{kind:`conflict`,candidates:r.map(([,e])=>e)}:{kind:`unknown`}}function yu(e,t){let n=new Map;for(let r of er(e)){let i=vu(r.origins.flatMap(n=>{let r=e.get(n),i=r===void 0?void 0:t.get(r);return r!==void 0&&i?[{workspace:r,entry:i}]:[]}));if(i.kind!==`known`)continue;let a=n.get(i.worktree);a?(a.origins.push(...r.origins),_u(i.evidence,a.evidence)&&(a.evidence=i.evidence)):n.set(i.worktree,{evidence:i.evidence,origins:[...r.origins]})}return[...n].sort(([e],[t])=>gu(e,t)).map(([e,{evidence:t,origins:n}])=>({key:e,entry:t.entry,origins:n.sort()}))}function bu(e){let t=(0,l.useMemo)(()=>new pu,[]),n=JSON.stringify(e.map(e=>[e.workspace,e.busy]));(0,l.useEffect)(()=>t.setTargets(e),[t,n]),(0,l.useEffect)(()=>{let e=()=>{document.visibilityState===`visible`&&t.resume()};return document.addEventListener(`visibilitychange`,e),()=>{document.removeEventListener(`visibilitychange`,e),t.stop()}},[t]);let r=(0,l.useSyncExternalStore)(t.subscribe,t.getView,t.getView),i=e.some(e=>e.workspace&&!r.tracked.has(e.workspace));return(0,l.useMemo)(()=>i&&!r.pending?{...r,pending:!0}:r,[r,i])}var xu=e=>[...e].sort().join(`|`),Su=new Set;function Cu(e,t,n){let r=t?Jr(e):void 0,i=gt(e,n);if(i.size===0)return r?{visible:r.visible,hidden:r.hidden.size}:void 0;let a=new Set(e.filter(e=>!i.has(e.id)&&(!r||r.visible.has(e.id))).map(e=>e.id));return{visible:a,hidden:e.length-a.size}}var wu=()=>typeof window<`u`&&(window.matchMedia?.(`(prefers-reduced-motion: reduce)`).matches??!1);function Tu(e,t,n,r=Su){let i=(0,l.useMemo)(()=>Cu(e,t,r),[e,t,r]),a=(0,l.useRef)(void 0),[o,s]=(0,l.useState)(0),c=(0,l.useMemo)(()=>Xr({sessions:e,rule:i?.visible,prev:a.current,operated:n,now:Date.now(),exitMs:wu()?0:240}),[e,i,n,o]);(0,l.useLayoutEffect)(()=>{a.current={drawn:c.drawn,linger:c.linger};let e=c.held.size>0?250:1/0;if(c.wakeAt!==void 0&&(e=Math.min(e,Math.max(0,c.wakeAt-Date.now()))),!Number.isFinite(e))return;let t=setTimeout(()=>s(e=>e+1),e);return()=>clearTimeout(t)},[c]);let u=c.drawn===`all`?`*`:xu(c.drawn),d=xu(c.leaving);return{drawn:(0,l.useMemo)(()=>c.drawn===`all`?void 0:c.drawn,[u]),leaving:(0,l.useMemo)(()=>c.leaving,[d]),hidden:i?.hidden??0,key:u,leavingKey:d}}function Eu(e){try{return e.matches(`:focus-visible`)}catch{return!0}}function Du(e,t){if(!e)return!1;let n=On(t),r=[...e.querySelectorAll(`[data-node-id]`)].find(e=>e.getAttribute(`data-node-id`)===n);if(!r)return!1;if(r.hasAttribute(`data-dragging`)||r.hasAttribute(`data-menu-open`))return!0;let i=document.activeElement;return i!==null&&r.contains(i)&&Eu(i)}function Ou(e,t){if(e)for(let n of e.querySelectorAll(`[data-node-id]`))n.toggleAttribute(`data-leaving`,t.has(n.getAttribute(`data-node-id`)??``))}var ku=e=>Math.round(e);function Au(e){return{left:Math.min(...e.map(e=>e.x)),right:Math.max(...e.map(e=>e.x+e.w)),top:Math.min(...e.map(e=>e.y)),bottom:Math.max(...e.map(e=>e.y+e.h))}}function ju(e,t){let n=new Map;if(e.length<2)return n;let{left:r,right:i,top:a,bottom:o}=Au(e);for(let s of e){let{x:e,y:c}=s;t===`left`?e=r:t===`hcenter`?e=(r+i)/2-s.w/2:t===`right`?e=i-s.w:c=t===`top`?a:t===`vmiddle`?(a+o)/2-s.h/2:o-s.h,n.set(s.id,{x:ku(e),y:ku(c)})}return n}function Mu(e,t){let n=new Map;if(e.length<3)return n;let r=t===`horizontal`,i=e=>r?e.x:e.y,a=e=>r?e.w:e.h,o=[...e].sort((e,t)=>i(e)+a(e)/2-(i(t)+a(t)/2)||(e.id<t.id?-1:1)),{left:s,right:c,top:l,bottom:u}=Au(e),d=r?s:l,f=((r?c:u)-d-o.reduce((e,t)=>e+a(t),0))/(o.length-1),p=d;for(let e of o)n.set(e.id,r?{x:ku(p),y:e.y}:{x:e.x,y:ku(p)}),p+=a(e)+f;return n}var Nu=.01,Pu=(e,t,n)=>e.x<t.x+t.w+n-Nu&&t.x-n+Nu<e.x+e.w&&e.y<t.y+t.h+n-Nu&&t.y-n+Nu<e.y+e.h,Fu=(e,t)=>Math.max(0,Math.min(t.x-e.w,t.y-e.h));function Iu(e,t,n,r){let i={x:e.x,y:e.y,w:t.w,h:t.h};for(let e of n)if(Pu(i,e,r))return!1;return!0}var Lu=new Map;function Ru(e,t){let n=`${e.x}x${e.y}/${t}`,r=Lu.get(n);if(r)return r;let i=[];for(let e=-t;e<=t;e++)for(let n=-t;n<=t;n++)i.push({i:n,j:e});let a=({i:t,j:n})=>(t*e.x)**2+(n*e.y)**2;return i.sort((e,t)=>a(e)-a(t)||Number(e.j<0)-Number(t.j<0)||Number(e.i<0)-Number(t.i<0)||e.j-t.j||e.i-t.i),Lu.set(n,i),i}function zu(e,t,n,r,i=-1/0,a=6,o=-1/0){let s=Fu(t,r);for(let{i:c,j:l}of Ru(r,a)){let a={x:e.x+c*r.x,y:e.y+l*r.y};if(!(a.x<i-Nu||a.y<o-Nu)&&Iu(a,t,n,s))return a}}function Bu(e){let t;for(let n of e)t=t?{x0:Math.min(t.x0,n.x),y0:Math.min(t.y0,n.y),x1:Math.max(t.x1,n.x+n.w),y1:Math.max(t.y1,n.y+n.h)}:{x0:n.x,y0:n.y,x1:n.x+n.w,y1:n.y+n.h};return t?{x:t.x0,y:t.y0,w:t.x1-t.x0,h:t.y1-t.y0}:void 0}var Vu=class{plan;parents;kinds;rowStep;rects=new Map;cards=[];reserved=new Map;families=new Map;constructor(e,t,n,r){this.plan=e,this.parents=t,this.kinds=n,this.rowStep=r}parentOf(e){return this.parents.get(e)?.split(`,`)[0]}familyOf(e){if(this.families.has(e))return this.families.get(e);let t,n=e;for(let e=0;e<64;e++){let e=this.parentOf(n);if(e===void 0)break;if(this.kinds.get(e)===`origin`){t={root:n,origin:e};break}n=e}return this.families.set(e,t),t}put(e,t){this.rects.set(e,t),this.cards.push(t);let n=this.familyOf(e);if(!n)return;let r=Bu([t,...this.reserved.has(n.root)?[this.reserved.get(n.root)]:[]]);r&&this.reserved.set(n.root,r)}obstaclesFor(e){let t=e.kind===`agent`?this.familyOf(e.id)?.root:void 0,n=[...this.cards];for(let[e,r]of this.reserved)e!==t&&n.push(r);return n.push(...this.holesFor(e)),n}holesFor(e){let t=e.kind===`agent`?this.familyOf(e.id):void 0;return t&&t.root!==e.id?[]:this.holes(t?.root)}holes(e){let t=new Map;for(let n of this.plan.nodes){if(n.kind!==`agent`||!this.rects.has(n.id))continue;let r=this.familyOf(n.id);r&&r.root!==n.id&&r.root!==e&&!(this.parents.get(n.id)??``).includes(`,`)&&t.set(r.root,n.id)}let n=[];for(let[e,r]of t){let t=this.rects.get(r),i={x:t.x,y:t.y+this.rowStep,w:t.w,h:t.h};this.cards.some(e=>Pu(i,e,0))||[...this.reserved].some(([t,n])=>t!==e&&Pu(i,n,0))||n.push(i)}return n}blockOf(e){let t=[];for(let[n,r]of this.rects)this.kinds.get(n)===`agent`&&this.familyOf(n)?.origin===e&&t.push(r);return t}rootsOf(e,t=()=>!0){let n=[];for(let[r,i]of this.rects){if(this.kinds.get(r)!==`agent`||!t(r))continue;let a=this.familyOf(r);a?.root===r&&a.origin===e&&n.push(i)}return n}under(e,t){let n=e;for(let e=0;e<64;e++){let e=this.parentOf(n);if(e===void 0)return!1;if(e===t)return!0;n=e}return!1}stackOf(e){let t=this.parentOf(e.id),n=e.anchor?this.rects.get(e.anchor.id):void 0;if(t===void 0||!e.anchor||!n||this.parentOf(e.anchor.id)!==t)return;let r=[],i=[];for(let[e,n]of this.rects)this.under(e,t)&&(i.push(n),this.parentOf(e)===t&&r.push(n));return{ref:n,siblings:r,scope:i}}},Hu=1e-9,Uu=(e,t)=>Math.min(1,t.w/e.w,t.h/e.h);function Wu(e,t,n,r,i,a,o){if(e.siblings.filter(t=>Math.abs(t.x-e.ref.x)<n.w/2).length<3)return;let s=Math.min(...e.siblings.map(e=>e.x)),c=Math.min(...e.siblings.filter(e=>Math.abs(e.x-s)<n.w/2).map(e=>e.y)),l=Bu(e.scope);if(!l)return;let u=r.x-n.w,d=Fu(n,r),f={x:l.x+l.w+u,y:c},p=Iu(f,n,a,d)?f:{x:o.x+o.w+u,y:c};if(!Iu(p,n,a,d))return;let m=e=>Uu(Bu([o,{x:e.x,y:e.y,w:n.w,h:n.h}])??o,i);return m(p)>m(t)+Hu?p:void 0}var Gu=.01,Ku=1e-6,qu=5e-4,Ju=.05,Yu=(e,t)=>Math.min(1,t.w/e.w,t.h/e.h),Xu=(e,t)=>Math.abs(Math.log(e.w/e.h/(t.w/t.h)));function Zu(e,t,n,r){let i=[];for(let n of e.map(e=>e.x).sort((e,t)=>e-t)){let e=i[i.length-1];(e===void 0||n-e>=t.w/2)&&i.push(n)}let a=i[0],o=Math.max(1,Math.floor((r.x+r.w-a-t.w)/n.x+Ku)+1),s=Array.from({length:o},(e,t)=>a+t*n.x).filter(e=>i.every(n=>Math.abs(n-e)>=t.w/2));return[...i,...s].sort((e,t)=>e-t)}function Qu(e){let{size:t,steps:n,roots:r,block:i,frame:a,obstacles:o,floor:s,area:c,align:l}=e,u=Bu(r),d=Bu(i);if(!u||!d)return;let f=Zu(r,t,n,d),p=Fu(t,n),m=new Map,h=e=>{let n=m.get(e);if(n)return n;let r=o.filter(n=>n.y<e+t.h+p&&n.y+n.h+p>e);return m.set(e,r),r},g=e=>Iu(e,t,h(e.y),p),_=e=>l!==void 0&&Math.abs(l-e.x)<t.w/2&&g({x:l,y:e.y})?{x:l,y:e.y}:e,v=Math.max(1,Math.floor((d.y+d.h-u.y-t.h)/n.y+Ku)+1),y=Math.min(0,Math.ceil((a.y-u.y)/n.y-Ku));for(let e=y;e<v;e++){let t=u.y+e*n.y;if(!(t<s-Gu)){for(let e of f)if(g({x:e,y:t}))return _({x:e,y:t})}}let b=f.map(e=>({x:e,y:u.y+v*n.y})).find(g),x={x:Math.max(f[f.length-1]+n.x,d.x+d.w+n.x-t.w),y:u.y},S=g(x)?x:void 0;if(!b||!S||!c){let e=b??S;return e&&_(e)}let C=e=>({x:e.x,y:e.y,w:t.w,h:t.h}),w=e=>Yu(Bu([a,C(e)])??a,c),T=w(S),E=w(b);if(T>E+qu)return _(S);if(E>T+qu)return _(b);let D=e=>Xu(Bu([...i,C(e)])??C(e),c);return _(D(S)<D(b)-Ju?S:b)}var q=.01,$u=(e,t,n)=>e.x<t.x+t.w+n-q&&t.x-n+q<e.x+e.w&&e.y<t.y+t.h+n-q&&t.y-n+q<e.y+e.h;function J(e,t,n,r,i=L.rowGap){let a=e.x+t.dx,o=e.y+t.dy;if(!Number.isFinite(a)||!Number.isFinite(o))return{x:a,y:o};for(;;){let e=o;for(let t of r)$u({x:a,y:o,w:n.w,h:n.h},t,i)&&(e=Math.max(e,t.y+t.h+i));if(e===o)return{x:a,y:o};o=e}}var Y=(e,t)=>({x:t?.x??e.x,y:t?.y??e.y,w:e.w,h:e.h});function X(e,t){return!e.anchor||Math.abs(e.anchor.dx)>e.w/2||Math.abs(e.x-t.x)<=e.w/2&&e.y>t.y}function ed(e,t){let n=new Set,r=!1;for(let i of e)t(i.id)?r=!0:n.add(i.id);return r?n:new Set}function td(e,t,n){if(t.size===0)return new Map;let r=ed(e,n);for(let e of r)t.has(e)&&r.delete(e);return nd(e,t,r)}function nd(e,t,n,r=L.rowGap){let i=new Map(t),a=new Set(n),o=new Map,s=new Map(e.map(e=>[e.id,e]));for(let t of e){if(!a.has(t.id)||t.kind!==`agent`||i.has(t.id))continue;a.delete(t.id);let n=e.filter(e=>e.id!==t.id&&!a.has(e.id)),c=t.anchor?s.get(t.anchor.id):void 0,l=t.anchor&&(!c||X(t,c))?i.get(t.anchor.id):void 0,u;if(t.anchor&&l)u=J(l,t.anchor,t,n.map(e=>Y(e,i.get(e.id))),r);else{let e=n.filter(e=>i.has(e.id)).map(e=>Y(e,i.get(e.id)));if(J({x:t.x,y:t.y},{dx:0,dy:0},t,e,r).y===t.y)continue;u=J({x:t.x,y:t.y},{dx:0,dy:0},t,n.map(e=>Y(e,i.get(e.id))),r)}i.set(t.id,u),o.set(t.id,u)}return o}var rd=e=>({x:e.x,y:e.y,w:e.w,h:e.h});function id(e){let t=new Map;for(let n of e.edges){if(n.phase===`link`)continue;let e=t.get(n.to);e?e.push(n.from):t.set(n.to,[n.from])}return new Map([...t].map(([e,t])=>[e,t.join(`,`)]))}function ad(e){return{rects:new Map(e.nodes.map(e=>[e.id,rd(e)])),parents:id(e),grid:e.grid===!0}}function od(e,t,n,r){for(let[e,r]of n.rects){let i=t.rects.get(e);if(!i||i.w!==r.w||i.h!==r.h||n.parents.get(e)!==t.parents.get(e))return!0}for(let t of e.nodes)if(!n.rects.has(t.id)&&r(t.id))return!0;return!1}function sd(e,t){let n;for(let r of e.nodes){let e=t.rects.get(r.id);if(!e||r.kind===`git`||r.kind===`folder`)continue;let i=r.x-e.x,a=r.y-e.y;if(!n)n={x:i,y:a};else if(Math.abs(i-n.x)>.01||Math.abs(a-n.y)>.01)return}return n??{x:0,y:0}}var cd=(e,t,n)=>e>=t-.01?e:e+Math.ceil((t-e)/n-1e-9)*n;function ld(e,t){let n=t.familyOf(e.id)?.origin,r=-1/0;for(let i of t.parents.get(e.id)?.split(`,`)??[]){let e=t.rects.get(i);e&&t.familyOf(i)?.origin===n&&(r=Math.max(r,e.x+e.w+L.rowGap))}return r}function ud(e,t){let n=Bn(e.w===L.agentWCompact);return t.grid?{x:n.pitchX,y:n.pitchY}:{x:e.w+n.gapX,y:e.h+L.rowGap}}function dd(e,t){if(!(e.kind!==`agent`||(t.parents.get(e.id)??``).includes(`,`)))return t.familyOf(e.id)?.root===e.id?void 0:t.stackOf(e)}function fd(e,t,n,r,i,a){let o=Bu(r.cards);if(o)return Wu(t,n,{w:e.w,h:e.h},ud(e,i),a,r.obstaclesFor(e),o)}function pd(e,t,n,r){let i=e.kind===`agent`?t.familyOf(e.id):void 0;if(!i||i.root!==e.id||(t.parents.get(e.id)??``).includes(`,`))return;let a=t.rootsOf(i.origin,e=>n.rects.has(e)),o=t.blockOf(i.origin),s=Bu(t.cards);if(!s||a.length===0)return;let c=Math.min(...o.map(e=>e.y)),l=e.anchor?t.rects.get(e.anchor.id):void 0,u=l&&e.anchor?l.x+e.anchor.dx:void 0;return Qu({size:{w:e.w,h:e.h},steps:ud(e,n),roots:a,block:o,frame:s,obstacles:t.obstaclesFor(e),floor:c,area:r,align:u})}function md(e,t,n,r){let i=t=>({x:t.x,y:t.y,w:e.w,h:e.h}),a=pd(e,t,n,r);if(a)return i(a);let o={w:e.w,h:e.h},s=ud(e,n),c=e.kind===`agent`?t.familyOf(e.id):void 0,l=t.obstaclesFor(e),u=c?t.blockOf(c.origin):[],d=u.length>0?Math.min(...u.map(e=>e.y)):-1/0,f=e.anchor?t.rects.get(e.anchor.id):void 0,p=f&&e.anchor?{x:f.x+e.anchor.dx,y:f.y+e.anchor.dy}:void 0,m=dd(e,t),h=a=>i((m&&r?fd(e,m,a,t,n,r):void 0)??a),g=ld(e,t),_=Bu(l);if(p){let r={x:p.x,y:Math.max(p.y,d)};if(n.grid){let n=Iu(r,o,l,Fu(o,s))&&r.x>=g?r:zu(r,o,l,s,g,6,d);if(n)return h(n);if(c&&(t.parents.get(e.id)??``).includes(`,`))return i(J({x:Math.max((_?_.x+_.w:e.x)+(s.x-o.w),g),y:d},{dx:0,dy:0},o,l,Fu(o,s)))}else return h(J({x:cd(r.x,g,s.x),y:r.y},{dx:0,dy:0},o,l,Fu(o,s)))}return i({x:cd(p?.x??_?.x??e.x,g,s.x),y:(_?_.y+_.h:e.y)+L.rowGap})}function hd(e,t,n,r){let i=new Map;for(let e of t.edges)r.has(e.from)&&r.has(e.to)&&(i.set(e.from,[...i.get(e.from)??[],e.to]),i.set(e.to,[...i.get(e.to)??[],e.from]));let a=new Set([e.id]);for(let e of a)for(let t of i.get(e)??[])a.add(t);let o=t.nodes.filter(e=>a.has(e.id)),s=Bu(o.map(rd)),c=Bu(n.cards);if(!s)return[];let l=(c?.x??s.x)-s.x,u=c?c.y+c.h+L.groupGap-s.y:0;for(let e of o)n.put(e.id,{x:e.x+l,y:e.y+u,w:e.w,h:e.h});return o.map(e=>e.id)}function gd(e,t,n,r,i){if(i===void 0)return!1;let a=pd(e,n,r,i);if(a)return Math.abs(a.y-t.y)>.01||Math.abs(a.x-t.x)>=e.w/2;let o=dd(e,n);return o!==void 0&&fd(e,o,t,n,r,i)!==void 0}function _d(e,t,n,r){let i=ad(e);if(!t||od(e,i,t,n))return{layout:e,memory:i,mode:`full`,added:[]};let a=e.nodes.find(e=>e.kind===`agent`),o=new Vu(e,i.parents,new Map(e.nodes.map(e=>[e.id,e.kind])),a?ud(a,t).y:0);for(let n of e.nodes){let e=t.rects.get(n.id);e&&o.put(n.id,e)}let s=e.nodes.filter(e=>!t.rects.has(e.id)),c=new Set,l=sd(e,t);if(l)for(let e of s){let n={x:e.x-l.x,y:e.y-l.y,w:e.w,h:e.h};if(Iu(n,n,[...o.cards,...o.holesFor(e)],0)){if(gd(e,n,o,t,r))break;o.put(e.id,n),c.add(e.id)}}for(let t of s){if(t.kind!==`origin`||c.has(t.id))continue;let n=new Set(s.map(e=>e.id).filter(e=>!c.has(e)));for(let r of hd(t,e,o,n))c.add(r)}for(let e of s)c.has(e.id)||(o.put(e.id,md(e,o,t,r)),c.add(e.id));let u=e.nodes.map(e=>{let t=o.rects.get(e.id);return t&&(t.x!==e.x||t.y!==e.y)?{...e,x:t.x,y:t.y}:e}),d={rects:new Map(u.map(e=>[e.id,rd(e)])),parents:i.parents,grid:t.grid,...t.columns?{columns:t.columns}:{}};if(u.every((t,n)=>t===e.nodes[n]))return{layout:e,memory:d,mode:`hold`,added:s.map(e=>e.id)};let f={...e,nodes:u,bounds:nn(u)};return t.grid?f.grid=!0:(delete f.grid,delete f.fitAll),{layout:f,memory:d,mode:`hold`,added:s.map(e=>e.id)}}function vd(e,t){if(e===t)return!1;let n=e.nodes,r=t.nodes;if(n.length!==r.length)return!0;for(let e=0;e<n.length;e++){let t=n[e],i=r[e];if(t.id!==i.id||t.kind===`agent`&&(t.x!==i.x||t.y!==i.y))return!0}return!1}var yd=e=>(e.hidden?.size??0)>0,bd=e=>e.nodes.map(e=>e.id).sort().join(`
35
- `);function xd(e,t){if(e.rects.size>t.rects.size||e.grid!==t.grid)return!1;for(let[n,r]of e.rects){let i=t.rects.get(n);if(!i||i.x!==r.x||i.y!==r.y||i.w!==r.w||i.h!==r.h||e.parents.get(n)!==t.parents.get(n))return!1}return!0}var Sd=(e,t)=>!t||[...e.rects.keys()].some(e=>!t.rects.has(e)),Cd=class{entries=new Map;get size(){return this.entries.size}save(e,t){let n=bd(e);for(this.entries.delete(n),this.entries.set(n,{memory:t,partial:yd(e)});this.entries.size>8;)this.entries.delete(this.victim())}victim(){let e=[...this.entries],t=e.slice(0,-1),[n]=t.find(([,{memory:t}],n)=>e.slice(n+1).some(([,e])=>xd(t,e.memory)))??t.find(([,e])=>e.partial)??t[0]??e[0];return n}clear(){this.entries.clear()}restore(e,t,n,r){let i=bd(e),a=this.entries.get(i);if(a){let t=_d(e,a.memory,n,r);if(t.mode===`hold`)return t}let o=new Set(e.nodes.map(e=>e.id)),s=!yd(e),c=[...this.entries].map(([e,{memory:t,partial:n}],r)=>({key:e,memory:t,behind:s&&n,recency:r})).filter(({key:e,memory:n})=>e!==i&&[...n.rects.keys()].every(e=>o.has(e))&&Sd(n,t)).sort((e,t)=>Number(e.behind)-Number(t.behind)||t.memory.rects.size-e.memory.rects.size||t.recency-e.recency);for(let{memory:t}of c){let i=_d(e,t,e=>t.rects.has(e)&&n(e),r);if(i.mode===`hold`)return i}}},wd=2;function Td(e,t){let n=ad(e);if(n.rects.size!==t.rects.size)return`changed`;let r=!1;for(let[e,i]of t.rects){let a=n.rects.get(e);if(!a||t.parents.get(e)!==n.parents.get(e))return`changed`;(a.w!==i.w||a.h!==i.h)&&(r=!0)}return r?`resized`:`same`}var Ed=(e,t)=>e.w===t.w&&e.h===t.h,Dd=class{flip;clock;constructor(e){this.clock=e}corrects(e,t,n){let r=this.flip;return!r||!t||!n?!1:this.clock()-r.at>600?(this.flip=void 0,!1):!Ed(n,r.area)&&Td(e,t)===`same`}note(e,t,n,r,i){if(!r){this.flip=void 0;return}let a=this.flip;i&&a?this.flip=a.corrections+1>=wd?void 0:{at:a.at,area:r,corrections:a.corrections+1}:n.mode===`full`&&t&&Td(e,t)===`resized`?this.flip={at:this.clock(),area:r,corrections:0}:a&&t&&Td(e,t)!==`same`&&(this.flip=void 0)}clear(){this.flip=void 0}},Od=class{memory;raw;shown;drift=!1;snapshots=new Cd;settling;constructor(e=()=>performance.now()){this.settling=new Dd(e)}apply(e,t,n){if(e===this.shown)return e;this.raw=e;let r=this.memory,i=this.settling.corrects(e,r,n),a=_d(e,i?void 0:r,t,n);return a.mode===`full`&&!i&&(a=this.snapshots.restore(e,r,t,n)??a),this.settling.note(e,r,a,n,i),this.memory=a.memory,this.shown=a.layout,this.drift=vd(a.layout,e),this.snapshots.save(e,a.memory),a.layout}get drifted(){return this.drift}reset(){return this.memory=void 0,this.shown=void 0,this.drift=!1,this.snapshots.clear(),this.settling.clear(),this.raw}};function kd(e,t){return{x:e.x*t.k+t.x,y:e.y*t.k+t.y,w:e.w*t.k,h:e.h*t.k}}var Ad=(...e)=>e.every(Number.isFinite);function jd(e,t,n){let r=kd(e,t);if(!Ad(r.x,r.y,r.w,r.h,n.w,n.h)||n.w<=0||n.h<=0)return{state:`unknown`};let i=r.x-n.w,a=-(r.x+r.w),o=r.y-n.h,s=-(r.y+r.h),c=Math.max(i,a),l=Math.max(o,s),u=c>-1,d=l>-1;return!u&&!d?{state:`visible`}:{state:`outside`,edge:u&&(!d||c>=l)?i>=a?`right`:`left`:o>=s?`bottom`:`top`,distance:Math.hypot(Math.max(c,0),Math.max(l,0))}}function Md(e,t,n,r,i){let a=n-r-i;return a<=0?(n-t)/2-e:t>a||e<r?r-e:e+t>n-i?n-i-(e+t):0}function Nd(e,t,n,r){let i=kd(e,t);return!Ad(i.x,i.y,i.w,i.h,n.w,n.h)||n.w<=0||n.h<=0?{dx:0,dy:0}:{dx:Md(i.x,i.w,n.w,r.left,r.right),dy:Md(i.y,i.h,n.h,r.top,r.bottom)}}var Pd=[`top`,`right`,`bottom`,`left`],Fd=class{port;pending=new Set;armed=!1;hints=[];signature=``;timer;dirty=!1;listeners=new Set;constructor(e){this.port=e}subscribe=e=>(this.listeners.add(e),()=>{this.listeners.delete(e)});getHints=()=>this.hints;layoutChanged(e,t,n){if(n)return;let r=new Set;for(let t of e)t.kind===`agent`&&r.add(t.id);for(let e of[...this.pending])r.has(e)||this.pending.delete(e);if(this.armed)for(let e of t)r.has(e)&&this.pending.add(e);this.armed=!0,this.evaluate()}touch(){this.pending.size!==0&&(this.timer===void 0?(this.evaluate(),this.timer=setTimeout(()=>{this.timer=void 0,this.dirty&&(this.dirty=!1,this.touch())},64)):this.dirty=!0)}go(e){let t=this.hints.find(t=>t.edge===e)?.ids[0],n=t===void 0?void 0:this.port.box(t),r=this.port.size();if(t===void 0||!n||!(r.w>0&&r.h>0))return;let{dx:i,dy:a}=Nd(n,this.port.camera,r,Zt(r.w));return(i!==0||a!==0)&&this.port.panBy(i,a),this.pending.delete(t),this.evaluate(),t}reset(){clearTimeout(this.timer),this.timer=void 0,this.dirty=!1,this.pending.clear(),this.armed=!1,this.publish([])}evaluate(){let e=this.port.size();if(!(e.w>0&&e.h>0))return;let t=new Map;for(let n of[...this.pending]){let r=this.port.box(n),i=r?jd(r,this.port.camera,e):void 0;if(!i||i.state===`visible`){this.pending.delete(n);continue}if(i.state===`unknown`)continue;let a=t.get(i.edge)??[];a.push({id:n,distance:i.distance}),t.set(i.edge,a)}this.publish(Pd.flatMap(e=>{let n=t.get(e);return n?[{edge:e,ids:n.sort((e,t)=>e.distance-t.distance).map(e=>e.id)}]:[]}))}publish(e){let t=e.map(e=>`${e.edge}:${e.ids.join(`,`)}`).join(`|`);if(t!==this.signature){this.signature=t,this.hints=e;for(let e of[...this.listeners])e()}}},Id={packetPeriods:[167,233],speed:44,finePeriod:4.1};function Ld(e){return Math.round(e*100)/100}function Rd(e){return Ld(e).toString()}function zd(e,t){let n=t.x-e.x,r=Math.abs(n)/2,i=n<0?-1:1;return`M${Rd(e.x)} ${Rd(e.y)}C${Rd(e.x+i*r)} ${Rd(e.y)} ${Rd(t.x-i*r)} ${Rd(t.y)} ${Rd(t.x)} ${Rd(t.y)}`}function Bd(e){return(e+2)%4}function Vd(e,t){return t===0?e.w:t===2?0:e.w/2}function Hd(e,t){return t===0||t===2?e.h/2:t===1?e.h:0}var Ud={enterSide:24,leaveSide:6,enterStack:16,leaveStack:4,morph:.24};function Wd(e,t,n){switch(n){case 0:return t.x-(e.x+e.w);case 2:return e.x-(t.x+t.w);case 1:return t.y-(e.y+e.h);default:return e.y-(t.y+t.h)}}function Gd(e,t,n){let r=Wd(t,n,0),i=Wd(t,n,2),a=Wd(t,n,1),o=Wd(t,n,3);if(!Number.isFinite(r+i+a+o))return e===2||e===1||e===3?e:0;if(e===0&&r>=Ud.leaveSide)return 0;if(e===2&&i>=Ud.leaveSide)return 2;if(r>=Ud.enterSide)return 0;if(i>=Ud.enterSide)return 2;if(e===1&&a>=Ud.leaveStack)return 1;if(e===3&&o>=Ud.leaveStack)return 3;if(a>=Ud.enterStack)return 1;if(o>=Ud.enterStack)return 3;let s=0,c=r;return i>c&&(s=2,c=i),a>c&&(s=1,c=a),o>c&&(s=3,c=o),c>0?s:e===2||e===1||e===3?e:0}var Kd=class{x0=0;y0=0;x1=0;y1=0;x2=0;y2=0;x3=0;y3=0};function qd(e,t,n,r){let i=Bd(n),a=e.x+Vd(e,n),o=e.y+Hd(e,n),s=t.x+Vd(t,i),c=t.y+Hd(t,i),l=Wd(e,t,n),u=l>0?l/2:0,d=n===0?1:n===2?-1:0,f=n===1?1:n===3?-1:0;return r.x0=a,r.y0=o,r.x1=a+d*u,r.y1=o+f*u,r.x2=s-d*u,r.y2=c-f*u,r.x3=s,r.y3=c,r}function Jd(e,t){return t.x0=e.x0,t.y0=e.y0,t.x1=e.x1,t.y1=e.y1,t.x2=e.x2,t.y2=e.y2,t.x3=e.x3,t.y3=e.y3,t}function Yd(e,t){return e.x0===t.x0&&e.y0===t.y0&&e.x1===t.x1&&e.y1===t.y1&&e.x2===t.x2&&e.y2===t.y2&&e.x3===t.x3&&e.y3===t.y3}function Xd(e){return`M${Rd(e.x0)} ${Rd(e.y0)}C${Rd(e.x1)} ${Rd(e.y1)} ${Rd(e.x2)} ${Rd(e.y2)} ${Rd(e.x3)} ${Rd(e.y3)}`}function Zd(e,t,n,r){return r.x0=e.x0-t.x,r.y0=e.y0-t.y,r.x1=e.x1-t.x,r.y1=e.y1-t.y,r.x2=e.x2-n.x,r.y2=e.y2-n.y,r.x3=e.x3-n.x,r.y3=e.y3-n.y,r}function Qd(e,t,n,r,i,a){let o=1-n;return a.x0=(r.x+e.x0)*o+t.x0*n,a.y0=(r.y+e.y0)*o+t.y0*n,a.x1=(r.x+e.x1)*o+t.x1*n,a.y1=(r.y+e.y1)*o+t.y1*n,a.x2=(i.x+e.x2)*o+t.x2*n,a.y2=(i.y+e.y2)*o+t.y2*n,a.x3=(i.x+e.x3)*o+t.x3*n,a.y3=(i.y+e.y3)*o+t.y3*n,a}function $d(e){return e*e*(3-2*e)}var ef=`http://www.w3.org/2000/svg`,tf=0,nf=[[0,.15],[.1,1],[.3,1],[.5,1],[.7,1],[.9,1],[1,.2]];function rf(e){let t=(e,t,n)=>{let r=document.createElementNS(ef,`path`);return r.setAttribute(`class`,e),r.setAttribute(`fill`,`none`),n&&r.setAttribute(`style`,n),t.appendChild(r),r},n=`pipe-flow-${tf+=1}`,r=document.createElementNS(ef,`linearGradient`);r.setAttribute(`id`,n),r.setAttribute(`gradientUnits`,`userSpaceOnUse`);for(let[e,t]of nf){let n=document.createElementNS(ef,`stop`);n.setAttribute(`offset`,String(e)),n.setAttribute(`stop-color`,`#d94632`),n.setAttribute(`stop-opacity`,String(t)),r.appendChild(n)}e.dots.appendChild(r);let i=`--flow:url(#${n});`,a=Id.finePeriod/Id.speed,o=t(`pipe-tube`,e.tube),s=t(`pipe-fine`,e.dots,i),c=[];return Id.packetPeriods.forEach((n,r)=>{let o=`${i}--period:${n};--dur:${(n/Id.speed).toFixed(2)}s;--phase:${(-(r*.83+.4)).toFixed(2)}s;`;c.push(t(`pipe-packet head`,e.dots,o)),c.push(t(`pipe-packet tail`,e.dots,`${o}--lag:${a.toFixed(3)}s;`))}),{tube:o,fine:s,packets:c,gradient:r,written:{tube:``,dots:``,x1:NaN,y1:NaN,x2:NaN,y2:NaN}}}function af(e,t,n=t){let r=e.written;if(r.tube!==t&&(r.tube=t,e.tube.setAttribute(`d`,t)),r.dots!==n){r.dots=n,e.fine.setAttribute(`d`,n);for(let t of e.packets)t.setAttribute(`d`,n)}}function of(e,t,n,r,i){let a=e.written,o=Ld(t),s=Ld(n),c=Ld(r),l=Ld(i);if(o===a.x1&&s===a.y1&&c===a.x2&&l===a.y2)return;a.x1=o,a.y1=s,a.x2=c,a.y2=l;let u=e.gradient;u.setAttribute(`x1`,String(o)),u.setAttribute(`y1`,String(s)),u.setAttribute(`x2`,String(c)),u.setAttribute(`y2`,String(l))}function sf(e,t){e.tube.setAttribute(`data-phase`,t),e.fine.setAttribute(`data-phase`,t);for(let n of e.packets)n.setAttribute(`data-phase`,t)}function cf(e){e.tube.remove(),e.fine.remove(),e.gradient.remove();for(let t of e.packets)t.remove()}function lf(e){switch(e){case`running`:return 4;case`failed`:return 3;case`starting`:case`queued`:return 2;case`done`:return 1;default:return 0}}var uf=[`right`,`bottom`,`left`,`top`],df=e=>String(Math.round(e*100)/100),ff=class{host;dots;px=[NaN,NaN,NaN,NaN];py=[NaN,NaN,NaN,NaN];on=[!1,!1,!1,!1];phase=[``,``,``,``];constructor(e){this.host=e;let t=t=>{let n=e.ownerDocument.createElement(`i`);return n.className=`node-port`,n.setAttribute(`data-side`,uf[t]),n.setAttribute(`aria-hidden`,`true`),e.appendChild(n),n};this.dots=[t(0),t(1),t(2),t(3)]}place(e,t,n){if(this.px[e]===t&&this.py[e]===n)return;this.px[e]=t,this.py[e]=n;let r=this.dots[e].style;r.setProperty(`--port-x`,`${df(t)}px`),r.setProperty(`--port-y`,`${df(n)}px`)}apply(e){this.set(0,e[0]),this.set(1,e[1]),this.set(2,e[2]),this.set(3,e[3])}reset(){this.set(0,void 0),this.set(1,void 0),this.set(2,void 0),this.set(3,void 0)}dispose(){for(let e of this.dots)e.remove()}set(e,t){let n=this.dots[e],r=t!==void 0;r!==this.on[e]&&(this.on[e]=r,r?n.setAttribute(`data-on`,``):n.removeAttribute(`data-on`)),t!==void 0&&t!==this.phase[e]&&(this.phase[e]=t,n.setAttribute(`data-phase`,t))}};function pf(e,t){return t.x=e.tx,t.y=e.ty,t.w=e.w,t.h=e.h,t}function Z(e,t,n,r){e.ports.place(n,Vd(t,n),Hd(t,n));let i=e.phases[n];(i===void 0||lf(r)>lf(i))&&(e.phases[n]=r)}var mf=class{groups;edges=new Map;nodes=new Map;orderKey=``;aimFrom={x:0,y:0,w:0,h:0};aimTo={x:0,y:0,w:0,h:0};goal=new Kd;blend=new Kd;mount(e){this.groups=e}unmount(){for(let{els:e}of this.edges.values())cf(e);this.edges.clear(),this.orderKey=``,this.groups=void 0;for(let{ports:e}of this.nodes.values())e.reset()}register(e,t){let n=this.nodes.get(e);return n?.ports.host!==t&&(n?.ports.dispose(),this.nodes.set(e,{ports:new ff(t),phases:[void 0,void 0,void 0,void 0]}),this.rebind()),()=>{let n=this.nodes.get(e);n?.ports.host===t&&(n.ports.dispose(),this.nodes.delete(e),this.rebind())}}rebind(){for(let e of this.edges.values())e.fromNode=void 0,e.toNode=void 0}sync(e){let t=this.groups;if(!t)return;let n=new Set;for(let r of e){n.add(r.id);let e=this.edges.get(r.id);if(e)e.edge=r,sf(e.els,r.phase);else{let e=rf(t);sf(e,r.phase);let n=new Kd;n.x0=NaN,this.edges.set(r.id,{edge:r,els:e,side:-1,shown:n,from:new Kd,morphAt:-1,fromNode:void 0,toNode:void 0})}}for(let[e,t]of[...this.edges])n.has(e)||(cf(t.els),this.edges.delete(e));this.restack(t)}restack(e){let t=[...this.edges.values()].sort((e,t)=>lf(e.edge.phase)-lf(t.edge.phase)||(e.edge.id<t.edge.id?-1:1)),n=t.map(e=>`${e.edge.id}:${e.edge.phase}`).join(`|`);if(n!==this.orderKey){this.orderKey=n;for(let n of t){e.tube.appendChild(n.els.tube),e.dots.appendChild(n.els.fine);for(let t of n.els.packets)e.dots.appendChild(t)}}}frame(e,t,n){for(let e of this.nodes.values())e.phases.fill(void 0);let r=!1;for(let i of this.edges.values()){let{edge:a}=i,o=e.get(a.from),s=e.get(a.to);if(!o||!s)continue;let c=i.fromNode??=this.nodes.get(a.from),l=i.toNode??=this.nodes.get(a.to),u=Gd(i.side,pf(o,this.aimFrom),pf(s,this.aimTo)),d=qd(o,s,u,this.goal);u!==i.side&&(i.side>=0&&!n?(Zd(i.shown,o,s,i.from),i.morphAt=t):i.morphAt=-1,i.side=u);let f=d;if(i.morphAt>=0){let e=(t-i.morphAt)/(Ud.morph*1e3);e>=1?i.morphAt=-1:(f=Qd(i.from,d,$d(e>0?e:0),o,s,this.blend),r=!0)}Yd(f,i.shown)||(Jd(f,i.shown),af(i.els,Xd(f)),of(i.els,f.x0,f.y0,f.x3,f.y3)),c&&Z(c,o,u,a.phase),l&&Z(l,s,Bd(u),a.phase)}for(let e of this.nodes.values())e.ports.apply(e.phases);return r}};function hf(e,t){let n=e.get(t);if(n)return n;let r={id:t,el:null,x:0,y:0,vx:0,vy:0,tx:0,ty:0,w:0,h:0,placed:!1};return e.set(t,r),r}function gf(e){for(let[t,n]of[...e])n.el?n.placed=!1:e.delete(t)}function _f(e,t){for(let[n,r]of[...e])!t.has(n)&&!r.el&&e.delete(n)}function vf(e){e.el&&(e.el.style.translate=`${e.x.toFixed(2)}px ${e.y.toFixed(2)}px`)}function yf(e,t){return nn(e.map(e=>{let n=t.get(e.id);return n?{...e,x:n.tx,y:n.ty}:e}))}function bf(e,t,n){return t.has(n.id)?[...e.values()].filter(e=>e.placed&&e.el&&t.has(e.id)):[n]}function xf(e,t){return[...e.values()].filter(e=>e.placed&&e.el&&t.has(e.id)).map(e=>({id:e.id,x:e.tx,y:e.ty,w:e.w,h:e.h}))}var Sf=26,Cf=1.6,wf=(e,t,n)=>Math.min(n,Math.max(t,e)),Tf=class{host;camera={x:0,y:0,k:1};target={x:0,y:0,k:1};velocity={x:0,y:0,k:0};bounds={x:0,y:0,w:0,h:0};moved=!1;autoCap;observer;reportedK=1;reportedMoved=!1;spaces=new Map;constructor(e){this.host=e}get userMoved(){return this.moved}setBounds(e){this.bounds=e}claim(){this.moved=!0}release(e){this.moved=!1,this.autoCap=e}fit(e=!0,t=!1){this.moved=!1,this.autoCap=void 0,this.refit(!e,t)}follow(e){this.moved||this.refit(e)}fitTarget(e=!1){let t=this.host.mounted(),n=t?.viewport;if(!n)return{x:0,y:0,k:1};let{clientWidth:r,clientHeight:i}=n,a=e||this.host.wide();return tn(this.bounds,{w:r,h:i},t?.padding??Zt(r),a,this.autoCap)}refit(e,t=!1){Object.assign(this.target,this.fitTarget(t)),this.settle(e)}settle(e){(e||this.host.reducedMotion())&&(Object.assign(this.camera,this.target),this.velocity={x:0,y:0,k:0},this.apply()),this.report(),this.host.wake()}panBy(e,t){this.target.x+=e,this.target.y+=t,this.moved=!0,this.settle(!1)}zoomBy(e){let t=this.host.mounted()?.viewport;t&&this.zoomAround(t.clientWidth/2,t.clientHeight/2,e,!1)}zoomAround(e,t,n,r){let i=wf(this.target.k*n,Math.min(qt,Jt),Cf),a=i/this.target.k;this.target.x=e-(e-this.target.x)*a,this.target.y=t-(t-this.target.y)*a,this.target.k=i,this.moved=!0,this.settle(r)}scrollBy(e,t){this.target.x-=e,this.target.y-=t,this.camera.x=this.target.x,this.camera.y=this.target.y,this.camera.k=this.target.k,this.velocity={x:0,y:0,k:0},this.moved=!0,this.apply(),this.report()}grab(){this.moved=!0,Object.assign(this.target,this.camera),this.velocity={x:0,y:0,k:0}}dragTo(e,t){this.camera.x=e,this.camera.y=t,this.target.x=this.camera.x,this.target.y=this.camera.y,this.target.k=this.camera.k,this.velocity={x:0,y:0,k:0},this.apply(),this.report()}step(e,t){let n=this.camera,r=this.target,i=this.velocity,a=!1;for(let a=0;a<e;a++)i.x+=(-170*(n.x-r.x)-Sf*i.x)*t,i.y+=(-170*(n.y-r.y)-Sf*i.y)*t,i.k+=(-170*(n.k-r.k)-Sf*i.k)*t,n.x+=i.x*t,n.y+=i.y*t,n.k+=i.k*t;return Math.abs(n.x-r.x)<.05&&Math.abs(n.y-r.y)<.05&&Math.abs(n.k-r.k)<4e-4&&Math.abs(i.x)<.05&&Math.abs(i.y)<.05&&Math.abs(i.k)<.001?(n.x=r.x,n.y=r.y,n.k=r.k,i.x=0,i.y=0,i.k=0):a=!0,this.apply(),a}apply(){let e=this.host.mounted();if(!e)return;let{x:t,y:n,k:r}=this.camera;e.world.style.transform=`translate3d(${t.toFixed(2)}px,${n.toFixed(2)}px,0) scale(${r.toFixed(4)})`,this.host.applied()}report(){Math.abs(this.reportedK-this.target.k)<.004&&this.reportedMoved===this.moved||(this.reportedK=this.target.k,this.reportedMoved=this.moved,this.host.mounted()?.onCamera?.(this.target,this.moved))}watch(e){let t=e.clientWidth,n=e.clientHeight;this.observer=new ResizeObserver(()=>{let r=e.clientWidth,i=e.clientHeight,a=(r-t)/2,o=(i-n)/2,s=t>0&&n>0;t=r,n=i,!this.host.framed()||r<=0||i<=0||(this.moved?s&&(a!==0||o!==0)&&(this.camera.x+=a,this.camera.y+=o,this.target.x+=a,this.target.y+=o,this.apply()):this.refit(!1))}),this.observer.observe(e)}detach(){this.host.mounted()?.world.style.removeProperty(`transform`),this.observer?.disconnect(),this.observer=void 0,this.reportedK=1,this.reportedMoved=!1}remember(e){this.spaces.set(e,{camera:{...this.target},userMoved:this.moved,cap:this.autoCap})}recall(e){let t=this.spaces.get(e);this.autoCap=t?.cap,t?.userMoved?(Object.assign(this.camera,t.camera),Object.assign(this.target,t.camera),this.moved=!0):(Object.assign(this.camera,{x:0,y:0,k:1}),Object.assign(this.target,{x:0,y:0,k:1}),this.moved=!1),this.velocity={x:0,y:0,k:0}}},Ef=class{ports;handlers=new Set;keyboard=!1;constructor(e){this.ports=e}add(e){return this.handlers.add(e),()=>{this.handlers.delete(e)}}reset(){this.keyboard=!1}onKey=e=>{this.keyboard=e.key===`ContextMenu`||e.key===`F10`&&e.shiftKey};onMenu=e=>{let t=this.keyboard||e.button===0&&e.clientX===0&&e.clientY===0;if(this.keyboard=!1,e.defaultPrevented||this.handlers.size===0||!t&&e.button===0&&e.ctrlKey||this.ports.dragging())return;let n=(e.target instanceof Element?e.target:void 0)?.closest(`[data-node-id]`)?.dataset.nodeId,r=n===void 0?void 0:this.ports.bodies.get(n);if(!r?.placed||!r.el)return;let i=this.ports.selection.list(),a=i.length>=2&&i.includes(r.id)?`selection`:`node`,o={nodeId:r.id,el:r.el,scope:a,ids:a===`selection`?i:[r.id],point:t?void 0:{x:e.clientX,y:e.clientY}},s=!1;for(let e of[...this.handlers])if(e(o)){s=!0;break}s&&(e.preventDefault(),a===`node`&&i.length>=2&&this.ports.selection.only(r.id))}},Df=27,Of=.04,kf=class{media;matches=!1;get reduced(){return this.matches}attach(){this.media=window.matchMedia(`(prefers-reduced-motion: reduce)`),this.matches=this.media.matches,this.media.addEventListener(`change`,this.onChange)}detach(){this.media?.removeEventListener(`change`,this.onChange)}onChange=()=>{this.matches=this.media?.matches??!1}};function Af(e,t,n,r){let i=!1;for(let a of e.values())if(a.placed){t&&(a.x=a.tx,a.y=a.ty,a.vx=0,a.vy=0);for(let e=0;e<n;e++)a.vx+=(-240*(a.x-a.tx)-Df*a.vx)*r,a.vy+=(-240*(a.y-a.ty)-Df*a.vy)*r,a.x+=a.vx*r,a.y+=a.vy*r;Math.abs(a.x-a.tx)<Of&&Math.abs(a.y-a.ty)<Of&&Math.abs(a.vx)<Of&&Math.abs(a.vy)<Of?(a.x=a.tx,a.y=a.ty,a.vx=0,a.vy=0):i=!0,vf(a)}return i}var jf=class{host;raf=0;last=0;constructor(e){this.host=e}wake(){!this.raf&&this.host.mounted()&&(this.last=performance.now(),this.raf=requestAnimationFrame(this.frame))}cancel(){cancelAnimationFrame(this.raf),this.raf=0}frame=e=>{this.raf=0;let t=Math.min(.05,Math.max(.001,(e-this.last)/1e3));this.last=e;let n=Math.max(1,Math.ceil(t/(1/120))),r=t/n,i=Af(this.host.bodies,this.host.reducedMotion(),n,r);!this.host.holding()&&this.host.stepCamera(n,r)&&(i=!0);let a=this.host.pipes(e);(i||a)&&(this.raf=requestAnimationFrame(this.frame))}},Mf=class{ports;ctrlDown=!1;shiftDown=!1;spaceDown=!1;drag;suppressClick=!1;constructor(e){this.ports=e}get dragging(){return this.drag!==void 0}get holding(){return this.drag?.moved===!0}attach(e){window.addEventListener(`keydown`,this.ports.contexts.onKey,!0),window.addEventListener(`keydown`,this.onModifier),window.addEventListener(`keyup`,this.onModifier),window.addEventListener(`blur`,this.onBlur),window.addEventListener(`pointermove`,this.onPointerMove),window.addEventListener(`pointerup`,this.onPointerUp),window.addEventListener(`pointercancel`,this.onPointerUp),e.addEventListener(`pointerdown`,this.onPointerDown),e.addEventListener(`click`,this.onClickCapture,!0),e.addEventListener(`dragstart`,this.onDragStart),e.addEventListener(`wheel`,this.onWheel,{passive:!1}),e.addEventListener(`contextmenu`,this.ports.contexts.onMenu)}detach(e){window.removeEventListener(`keydown`,this.ports.contexts.onKey,!0),window.removeEventListener(`keydown`,this.onModifier),window.removeEventListener(`keyup`,this.onModifier),window.removeEventListener(`blur`,this.onBlur),window.removeEventListener(`pointermove`,this.onPointerMove),window.removeEventListener(`pointerup`,this.onPointerUp),window.removeEventListener(`pointercancel`,this.onPointerUp),e&&(delete e.dataset.tool,e.removeEventListener(`pointerdown`,this.onPointerDown),e.removeEventListener(`click`,this.onClickCapture,!0),e.removeEventListener(`dragstart`,this.onDragStart),e.removeEventListener(`wheel`,this.onWheel),e.removeEventListener(`contextmenu`,this.ports.contexts.onMenu))}cancel(){this.finishDrag(!0)}reset(){this.drag=void 0,this.ctrlDown=!1,this.shiftDown=!1,this.spaceDown=!1}onModifier=e=>{let t=e.type===`keydown`;if(this.ctrlDown=e.key===`Control`?t:e.ctrlKey,this.shiftDown=e.key===`Shift`?t:e.shiftKey,e.code===`Space`||e.key===` `){if(!t)this.spaceDown=!1;else{let t=(e.target instanceof Element?e.target:void 0)?.closest(`input,textarea,select,button,a,[contenteditable]:not([contenteditable='false']),[role='dialog'],[role='menu']`);e.defaultPrevented||t||e.shiftKey||e.ctrlKey||e.altKey||e.metaKey||(this.spaceDown=!0,e.preventDefault())}}this.updateTool()};onBlur=()=>{this.ctrlDown=!1,this.shiftDown=!1,this.spaceDown=!1,this.updateTool(),this.finishDrag(!0)};updateTool(){let e=this.ports.viewport();e&&(this.shiftDown?e.dataset.tool=`select`:this.ctrlDown||this.spaceDown?e.dataset.tool=`pan`:delete e.dataset.tool)}onPointerDown=e=>{if(this.ports.contexts.reset(),this.drag||e.button!==0&&e.button!==1)return;this.ctrlDown=e.ctrlKey,this.shiftDown=e.shiftKey,this.updateTool();let t=e.target;if(t?.closest(`[data-scene-ui],button,input,textarea,select,[role='menu']`))return;let n=t?.closest(`[data-node-id]`),r=n?this.ports.bodies.get(n.dataset.nodeId??``):void 0;if(e.button===0&&e.shiftKey)this.ports.selection.begin(e.clientX,e.clientY),this.drag={kind:`select`,id:e.pointerId,sx:e.clientX,sy:e.clientY,nodeId:r?.id,moved:!1};else if(e.ctrlKey||this.spaceDown||e.button===1||e.pointerType===`touch`&&!n){if(e.button===1&&(n||t?.closest(`a`)))return;e.button===1&&e.preventDefault(),this.drag={kind:`pan`,id:e.pointerId,sx:e.clientX,sy:e.clientY,cx:this.ports.camera.camera.x,cy:this.ports.camera.camera.y,moved:!1,suppressTap:e.ctrlKey||this.spaceDown}}else if(r&&e.button===0){let t=bf(this.ports.bodies,this.ports.selection,r).map(e=>({body:e,x:e.x,y:e.y}));this.drag={kind:`node`,id:e.pointerId,sx:e.clientX,sy:e.clientY,scale:this.ports.camera.camera.k,primary:r,bodies:t,before:this.ports.placements.snapshot(t.map(e=>e.body.id)),moved:!1}}else!n&&!t?.closest(`a`)&&this.ports.selection.clear()};onPointerMove=e=>{let t=this.drag;if(!t){(this.ctrlDown!==e.ctrlKey||this.shiftDown!==e.shiftKey)&&(this.ctrlDown=e.ctrlKey,this.shiftDown=e.shiftKey,this.updateTool());return}if(t.id!==e.pointerId)return;let n=e.clientX-t.sx,r=e.clientY-t.sy;if(!(!t.moved&&Math.hypot(n,r)<5)){if(!t.moved){t.moved=!0;let n=this.ports.viewport();if(n?.setPointerCapture(e.pointerId),t.kind===`pan`&&n&&(n.dataset.panning=``),t.kind===`select`&&n&&(n.dataset.selecting=``),t.kind===`node`){n&&(n.dataset.moving=``),this.ports.selection.has(t.primary.id)||this.ports.selection.only(t.primary.id);for(let{body:e}of t.bodies)e.el&&(e.el.dataset.dragging=``)}t.kind!==`select`&&this.ports.camera.grab()}t.kind===`select`?this.ports.selection.update(e.clientX,e.clientY):t.kind===`node`?this.ports.placements.place(t.bodies.map(({body:e,x:i,y:a})=>({body:e,position:{x:i+n/t.scale,y:a+r/t.scale}}))):this.ports.camera.dragTo(t.cx+n,t.cy+r)}};onPointerUp=e=>{let t=this.drag;t&&t.id===e.pointerId&&this.finishDrag(e.type===`pointercancel`)};finishDrag(e){let t=this.drag;if(!t)return;if(this.drag=void 0,t.kind===`node`&&t.moved){for(let{body:e}of t.bodies)e.el&&delete e.el.dataset.dragging;this.ports.placements.commit(t.before,t.bodies.map(e=>e.body.id))}t.kind===`select`&&(!e&&!t.moved&&t.nodeId&&this.ports.selection.toggle(t.nodeId),this.ports.selection.finish(e)),!e&&(t.moved||t.kind===`select`&&t.nodeId||t.kind===`pan`&&t.suppressTap)&&this.suppressNextClick();let n=this.ports.viewport();n&&(delete n.dataset.panning,delete n.dataset.selecting,delete n.dataset.moving,n.hasPointerCapture(t.id)&&n.releasePointerCapture(t.id))}suppressNextClick(){this.suppressClick=!0,setTimeout(()=>{this.suppressClick=!1},0)}onClickCapture=e=>{this.suppressClick&&(this.suppressClick=!1,e.preventDefault(),e.stopPropagation())};onDragStart=e=>{e.target?.closest(`[data-node-id]`)&&e.preventDefault()};onWheel=e=>{if(e.target?.closest(`[data-scroll]`))return;let t=this.ports.viewport();if(!t)return;e.preventDefault();let n=e.deltaMode===1?16:e.deltaMode===2?400:1,r=t.getBoundingClientRect();if(e.ctrlKey||e.metaKey){let t=wf(e.deltaY*n,-60,60);this.ports.camera.zoomAround(e.clientX-r.left,e.clientY-r.top,Math.exp(-t*.012),!0);return}let i=e.shiftKey&&e.deltaX===0,a=(i?e.deltaY:e.deltaX)*n,o=(i?0:e.deltaY)*n;this.ports.camera.scrollBy(a,o)}};function Nf(e,t,n){let r=n.find(e=>e.to===t),i=r?e.get(r.from):void 0;return i?.placed?i:void 0}function Pf(e,t){let{bodies:n,positions:r,arrivals:i,first:a,reducedMotion:o}=t,s=new Set,c=!1;for(let t of e.nodes){s.add(t.id);let l=hf(n,t.id);l.w=t.w,l.h=t.h;let u=r.get(t.id),d=!u&&!l.placed?i.get(t.id):void 0;if(d)u=d,r.set(t.id,d),c=!0;else if(!u&&!l.placed&&t.anchor&&t.kind!==`agent`){let e=r.get(t.anchor.id);e&&(u={x:e.x+t.anchor.dx,y:e.y+t.anchor.dy},r.set(t.id,u),c=!0)}if(l.tx=u?.x??t.x,l.ty=u?.y??t.y,!l.placed){let r=u&&!d||a||o?void 0:Nf(n,t.id,e.edges);r?(l.x=r.x+r.w*.4,l.y=r.y+(r.h-t.h)/2):(l.x=l.tx,l.y=l.ty),l.vx=0,l.vy=0,l.placed=!0,vf(l),r&&l.el&&(l.el.dataset.fresh=``)}}return{keep:s,anchored:c}}var Ff=100,If=1e3;function Lf(e,t){return new Map(t.map(t=>{let n=e.get(t);return[t,n?{...n}:void 0]}))}var Rf=class{undoStack=[];redoStack=[];get canUndo(){return this.undoStack.length>0}get canRedo(){return this.redoStack.length>0}clear(){this.undoStack=[],this.redoStack=[]}record(e,t,n){if([...e].every(([e,n])=>{let r=t.get(e);return n===r||n!==void 0&&r!==void 0&&n.x===r.x&&n.y===r.y}))return!1;let r=Date.now(),i=this.undoStack[this.undoStack.length-1];return n&&i?.merge===n&&r-i.at<If&&this.redoStack.length===0?(i.after=t,i.at=r):(this.undoStack.push({before:e,after:t,...n?{merge:n}:{},at:r}),this.undoStack.length>Ff&&this.undoStack.shift()),this.redoStack=[],!0}undo(){let e=this.undoStack.pop();return e&&this.redoStack.push(e),e}redo(){let e=this.redoStack.pop();return e&&this.undoStack.push(e),e}},zf=`ensemble.canvas.positions.v1`,Bf=`ensemble.canvas.positions.v2:`;function Vf(e){return!e||e===`all`?zf:`${Bf}${e}`}function Q(e){try{let t=JSON.parse(localStorage.getItem(Vf(e))??`{}`);return!t||typeof t!=`object`||Array.isArray(t)?new Map:new Map(Object.entries(t).flatMap(([e,t])=>{if(!/^(agent|origin|git|folder):/.test(e)||!t||typeof t!=`object`)return[];let{x:n,y:r}=t;return typeof n==`number`&&Number.isFinite(n)&&Math.abs(n)<1e6&&typeof r==`number`&&Number.isFinite(r)&&Math.abs(r)<1e6?[[e,{x:n,y:r}]]:[]}))}catch{return new Map}}function Hf(e,t){let n=Vf(t);try{e.size?localStorage.setItem(n,JSON.stringify(Object.fromEntries(e))):localStorage.removeItem(n)}catch{}}var Uf=class{bodies;host;map=Q();key=`all`;history=new Rf;constructor(e,t){this.bodies=e,this.host=t}get positions(){return this.map}get space(){return this.key}get count(){return this.map.size}get canUndo(){return this.history.canUndo}get canRedo(){return this.history.canRedo}open(e){this.key=e,this.map=Q(e)}forget(){this.history.clear()}save(){Hf(this.map,this.key)}snapshot(e){return Lf(this.map,e)}commit(e,t,n){this.save(),this.record(e,t,n)}place(e){for(let{body:t,position:n}of e)t.x=t.tx=n.x,t.y=t.ty=n.y,t.vx=t.vy=0,this.map.set(t.id,n),vf(t);this.host.placed()}nudge(e,t,n){let r=e.map(e=>e.id),i=this.snapshot(r);this.place(e.map(e=>({body:e,position:{x:e.x+t,y:e.y+n}}))),this.commit(i,r,`nudge:${[...r].sort().join(`,`)}`)}arrange(e){if(this.host.dragging())return!1;let t=[...e].flatMap(([e,t])=>{let n=this.bodies.get(e);return n?[{id:e,body:n,position:t}]:[]});if(!t.some(({body:e,position:t})=>Math.abs(t.x-e.tx)>.01||Math.abs(t.y-e.ty)>.01))return!1;let n=t.map(({id:e})=>e),r=this.snapshot(n);for(let{id:e,body:n,position:r}of t)n.tx=r.x,n.ty=r.y,this.map.set(e,{...r});return this.host.settled(),this.record(r,n),!0}clear(){let e=[...this.map.keys()],t=this.snapshot(e);this.map.clear(),this.record(t,e),this.save()}undo(){if(this.host.dragging())return!1;let e=this.history.undo();return e?(this.restore(e.before),this.host.historyChanged(),!0):!1}redo(){if(this.host.dragging())return!1;let e=this.history.redo();return e?(this.restore(e.after),this.host.historyChanged(),!0):!1}record(e,t,n){this.history.record(e,Lf(this.map,t),n)&&this.host.historyChanged()}restore(e){for(let[t,n]of e){n?this.map.set(t,{...n}):this.map.delete(t);let e=this.bodies.get(t);if(!e)continue;let r=n??this.host.homeOf(t);r&&(e.tx=r.x,e.ty=r.y)}this.host.settled()}},Wf=class{listeners=new Set;subscribe=e=>(this.listeners.add(e),()=>{this.listeners.delete(e)});notify(){for(let e of[...this.listeners])e()}},Gf=class{state={selected:0,canUndo:!1,canRedo:!1};signal=new Wf;subscribe=this.signal.subscribe;get(){return this.state}patch(e){let t={...this.state,...e};(t.selected!==this.state.selected||t.canUndo!==this.state.canUndo||t.canRedo!==this.state.canRedo)&&(this.state=t,this.signal.notify())}},Kf=class{items;selected=new Set;snapshot=[];viewport;box;start;onChange;constructor(e){this.items=e}mount(e,t){this.viewport=e,this.onChange=t}unmount(){this.onChange=void 0,this.clear(),this.box?.remove(),this.box=void 0,this.viewport=void 0,this.start=void 0}has(e){return this.selected.has(e)}list(){return this.snapshot}sync(e,t){t.toggleAttribute(`data-selected`,this.has(e))}clear(){this.set(new Set)}only(e){this.set(new Set([e]))}replace(e){this.set(new Set(e))}toggle(e){let t=new Set(this.selected);t.has(e)?t.delete(e):t.add(e),this.set(t)}retain(e){this.set(new Set([...this.selected].filter(t=>e.has(t))))}begin(e,t){this.start={x:e,y:t,initial:new Set(this.selected)}}update(e,t){let n=this.viewport,r=this.start;if(!n||!r)return;let i=n.getBoundingClientRect(),a=(e,t,n)=>Math.min(n,Math.max(t,e)),o=a(r.x,i.left,i.left+n.clientWidth),s=a(r.y,i.top,i.top+n.clientHeight),c=a(e,i.left,i.left+n.clientWidth),l=a(t,i.top,i.top+n.clientHeight),u=Math.min(o,c),d=Math.max(o,c),f=Math.min(s,l),p=Math.max(s,l);this.box||(this.box=document.createElement(`div`),this.box.className=`scene-selection`,this.box.setAttribute(`aria-hidden`,`true`),n.appendChild(this.box)),this.box.hidden=!1,Object.assign(this.box.style,{left:`${u-i.left}px`,top:`${f-i.top}px`,width:`${d-u}px`,height:`${p-f}px`});let m=new Set(r.initial);for(let{id:e,el:t}of this.items()){if(!t)continue;let n=t.getBoundingClientRect();n.width>0&&n.height>0&&n.right>=u&&n.left<=d&&n.bottom>=f&&n.top<=p&&m.add(e)}this.set(m)}finish(e=!1){e&&this.start&&this.set(this.start.initial),this.start=void 0,this.box&&(this.box.hidden=!0)}set(e){if(e.size!==this.selected.size||[...e].some(e=>!this.selected.has(e))){this.selected=e,this.snapshot=[...e];for(let{id:e,el:t}of this.items())t&&this.sync(e,t);this.onChange?.(e.size)}}},qf=class{bodies=new Map;selection=new Kf(()=>this.bodies.values());connections=new mf;rig=new Tf({mounted:()=>this.mounted,wide:()=>this.layout?.grid===!0||this.layout?.fitAll===!0,framed:()=>this.hasLayout,reducedMotion:()=>this.motion.reduced,wake:()=>this.frames.wake(),applied:()=>this.arrivals.touch()});placements=new Uf(this.bodies,{dragging:()=>this.input.dragging,homeOf:e=>{let t=this.layout?.nodes.find(t=>t.id===e);return t?{x:t.x,y:t.y}:void 0},placed:()=>this.placed(),settled:()=>this.settled(),historyChanged:()=>this.status.patch({canUndo:this.placements.canUndo,canRedo:this.placements.canRedo})});known=new Set;arrivals=new Fd({camera:this.rig.target,size:()=>({w:this.mounted?.viewport.clientWidth??0,h:this.mounted?.viewport.clientHeight??0}),box:e=>{let t=this.bodies.get(e);return t?.placed?{x:t.tx,y:t.ty,w:t.w,h:t.h}:void 0},panBy:(e,t)=>this.rig.panBy(e,t)});hasLayout=!1;motion=new kf;mounted;layout;status=new Gf;selectionSignal=new Wf;contexts=new Ef({bodies:this.bodies,selection:this.selection,dragging:()=>this.input.dragging});input=new Mf({bodies:this.bodies,selection:this.selection,camera:this.rig,placements:this.placements,contexts:this.contexts,viewport:()=>this.mounted?.viewport});frames=new jf({bodies:this.bodies,mounted:()=>this.mounted!==void 0,reducedMotion:()=>this.motion.reduced,holding:()=>this.input.holding,stepCamera:(e,t)=>this.rig.step(e,t),pipes:e=>this.pipes(e)});fills=new Map;fillSignal=new Wf;held=new Od;mount(e){this.unmount(),this.mounted=e,this.connections.mount(e.pipes),this.motion.attach();let{viewport:t}=e;this.selection.mount(t,t=>{this.status.patch({selected:t}),this.selectionSignal.notify(),e.onSelection?.(t)}),this.input.attach(t),this.rig.watch(t),this.rig.apply(),this.rig.report(),this.layout&&this.setLayout(this.layout,!0),e.onPositions?.(this.placements.count>0)}unmount(){this.input.cancel(),this.frames.cancel(),this.motion.detach(),this.input.detach(this.mounted?.viewport),this.rig.detach(),this.connections.unmount(),this.selection.unmount(),this.arrivals.reset(),this.status.patch({selected:0}),this.contexts.reset(),this.selectionSignal.notify(),this.mounted=void 0,this.hasLayout=!1,this.input.reset()}register(e,t){let n=hf(this.bodies,e),r=this.connections.register(e,t);return n.el=t,this.selection.sync(e,t),n.placed&&vf(n),()=>{r();let n=this.bodies.get(e);n&&n.el===t&&(n.el=null)}}switchSpace(e){e!==this.placements.space&&(this.input.cancel(),this.hasLayout&&this.rig.remember(this.placements.space),this.placements.open(e),this.selection.clear(),this.arrivals.reset(),this.known.clear(),this.held.reset(),this.placements.forget(),this.status.patch({canUndo:!1,canRedo:!1}),gf(this.bodies),this.rig.recall(e),this.hasLayout=!1,this.rig.apply(),this.rig.report(),this.mounted?.onPositions?.(this.placements.count>0))}setLayout(e,t=!1,n){let r=e=>this.known.has(e)||this.bodies.get(e)?.placed===!0;if(e=this.held.apply(e,r,n),this.layout=e,!this.mounted)return;this.mounted.onArrangement?.(this.held.drifted);let i=!this.hasLayout,a=ed(e.nodes,r),o=td(e.nodes,this.placements.positions,r);for(let t of[...e.nodes.map(e=>e.id),...e.hidden??[]])this.known.add(t);let{keep:s,anchored:c}=Pf(e,{bodies:this.bodies,positions:this.placements.positions,arrivals:o,first:i,reducedMotion:this.motion.reduced});c&&this.placements.save(),_f(this.bodies,s),this.selection.retain(s),this.connections.sync(e.edges),this.updateBounds(),this.hasLayout=!0,this.rig.follow(i),this.pipes(performance.now()),this.frames.wake(),this.arrivals.layoutChanged(e.nodes,a,t)}updateBounds(){this.rig.setBounds(yf(this.layout?.nodes??[],this.bodies))}pipes(e){return this.connections.frame(this.bodies,e,this.motion.reduced)}placed(){this.rig.claim(),this.updateBounds(),this.pipes(performance.now())&&this.frames.wake(),this.rig.report(),this.mounted?.onPositions?.(!0)}settled(){this.rig.claim(),this.updateBounds(),this.placements.save(),this.mounted?.onPositions?.(this.placements.count>0),this.rig.report(),this.frames.wake()}moveNode(e,t,n){let r=this.bodies.get(e);r?.placed&&(this.selection.has(e)||this.selection.only(e),this.placements.nudge(bf(this.bodies,this.selection,r),t,n))}toggleSelection(e){this.bodies.get(e)?.placed&&this.selection.toggle(e)}clearSelection(){this.selection.clear()}selectAll(){this.selection.replace([...this.bodies.values()].filter(e=>e.placed&&e.el).map(e=>e.id))}subscribe=this.status.subscribe;getState=()=>this.status.get();getSelectedIds=()=>this.selection.list();subscribeSelection=this.selectionSignal.subscribe;getFill=e=>this.fills.get(e);subscribeFill=this.fillSignal.subscribe;setFill(e,t){this.fills.get(e)!==t&&(this.fills.set(e,t),this.held.reset(),this.fillSignal.notify())}onNodeContext(e){return this.contexts.add(e)}align(e){return this.placements.arrange(ju(xf(this.bodies,this.selection),e))}distribute(e){return this.placements.arrange(Mu(xf(this.bodies,this.selection),e))}undo(){return this.placements.undo()}redo(){return this.placements.redo()}resetLayout(){let e=this.rig.target.k;this.placements.clear(),this.mounted?.onPositions?.(!1),this.rig.release(e);let t=this.held.reset()??this.layout;t&&this.setLayout(t),this.setFill(this.placements.space,e)}getCamera(){return this.rig.target}isUserMoved(){return this.rig.userMoved}fit(e=!0,t=!1){this.rig.fit(e,t)}zoomBy(e){this.rig.zoomBy(e)}},Jf=[`--aura-ax`,`--aura-ay`,`--aura-bx`,`--aura-by`];function Yf(e){let t=2166136261;for(let n=0;n<e.length;n++)t^=e.charCodeAt(n),t=Math.imul(t,16777619);return t>>>0}function Xf(e){let t=e|0;return t^=t>>>16,t=Math.imul(t,2246822507),t^=t>>>13,t=Math.imul(t,3266489909),t^=t>>>16,t>>>0}function Zf(e){let t=Yf(e),n=e=>(Xf(t+Math.imul(e+1,2654435769))%999+1)/1e3;return[n(0),n(1),n(2),n(3)]}function Qf(e){let t={};return Zf(e).forEach((e,n)=>{t[Jf[n]]=e.toFixed(3)}),t}function $f(e,t,n=1200){let[r,i]=(0,l.useState)({text:e,phase:t}),a=(0,l.useRef)(0);return(0,l.useEffect)(()=>{if(r.text===e&&r.phase===t)return;let o=()=>{a.current=performance.now(),i({text:e,phase:t})};if(r.phase!==t){o();return}let s=a.current+n-performance.now();if(s<=0){o();return}let c=window.setTimeout(o,s);return()=>window.clearTimeout(c)},[e,t,r,n]),r.text}var ep=12,$={done:(0,H.jsx)(`path`,{d:`M3.7 6.2l1.6 1.6 3-3.4`}),failed:(0,H.jsx)(`path`,{d:`M4.3 4.3l3.4 3.4M7.7 4.3L4.3 7.7`}),cancelled:(0,H.jsx)(`path`,{d:`M4.6 4.5v3M7.4 4.5v3`}),stopped:(0,H.jsx)(`path`,{d:`M4.4 6h3.2`}),lost:(0,H.jsx)(`path`,{d:`M6 3.9v2.6M6 8.3v.01`})};function tp({kind:e}){return(0,H.jsxs)(`svg`,{className:`a-glyph`,width:`9`,height:`9`,viewBox:`0 0 12 12`,"aria-hidden":`true`,children:[(0,H.jsx)(`rect`,{width:`12`,height:`12`,fill:`currentColor`}),(0,H.jsx)(`g`,{fill:`none`,stroke:`#262626`,strokeWidth:`1.5`,strokeLinecap:`square`,strokeLinejoin:`miter`,children:$[e]})]})}function np({summary:e,tip:t}){let n=V(),r=kt(e,St());return(0,H.jsxs)(`span`,{className:`a-state`,"data-kind":`running`,"data-tip":t,children:[(0,H.jsx)(`i`,{className:`a-run`,"aria-hidden":`true`}),(0,H.jsx)(`span`,{className:`num`,children:r===void 0?Lt(e.phase,n):Ct(r)})]})}function rp({items:e}){let t=V(),n=Gt(e,St(),t);return(0,H.jsxs)(`span`,{className:`a-flag`,"data-tone":`amber`,"data-tip":n,role:`img`,"aria-label":n,children:[(0,H.jsx)(U,{name:`alert`,size:11}),e.length>1?e.length:null]})}function ip({summary:e}){let t=V(),{phase:n}=e,r=e.runCount>1?t(`node.runs`,{n:e.runCount}):void 0;switch(n){case`running`:return(0,H.jsx)(np,{summary:e,tip:r});case`done`:{let i=e.lastRun?.durationMs;return(0,H.jsxs)(`span`,{className:`a-state`,"data-kind":`done`,"data-tip":r,children:[(0,H.jsx)(tp,{kind:`done`}),(0,H.jsx)(`span`,{className:`num`,children:i===void 0?Lt(n,t):v(i)})]})}case`failed`:case`cancelled`:case`stopped`:case`lost`:return(0,H.jsxs)(`span`,{className:`a-state`,"data-kind":n,"data-tip":r,children:[(0,H.jsx)(tp,{kind:n}),(0,H.jsx)(`span`,{children:Lt(n,t)})]});default:return(0,H.jsx)(`span`,{className:`a-state`,"data-kind":n===`ready`?`ready`:`pending`,"data-tip":r,children:(0,H.jsx)(`span`,{children:Lt(n,t)})})}}var ap=(0,l.memo)(function({summary:e,engine:t,morph:n}){let r=V(),i=On(e.id),a=(0,l.useRef)(null),[o,s]=(0,l.useState)(!1),c=rs(i);(0,l.useLayoutEffect)(()=>{let n=a.current;return n?t.register(On(e.id),n):void 0},[t,e.id]);let u=(0,l.useMemo)(()=>ls(t,i),[t,i]),{phase:d}=e,f=e.runtime===`fixture`,p=e.effort?.trim()||void 0,m=p?to(p,r):void 0,h=$f(Vt(e,r),d),g=eo(e,r),_=Ja(e.model),v=f?r(`run.simulatedTip`):r(`node.modelTip`,{model:g,effort:m??r(`common.none`)}),y=(0,l.useMemo)(()=>Qf(e.id),[e.id]),b=t=>{t&&(t.style.viewTransitionName=`session-card`),Ni({kind:`session`,id:e.id})};return(0,H.jsxs)(`div`,{ref:a,className:`node agent`,"data-node":!0,"data-node-id":i,"data-phase":d,"data-attention":e.attention?.length?``:void 0,"data-menu-open":o||c?``:void 0,tabIndex:0,role:`group`,"aria-label":r(`scene.nodeLabel`,{title:e.title}),"aria-description":r(`scene.nodeKeyboard`),style:n?{viewTransitionName:`session-card`}:void 0,onKeyDown:e=>{u(e),e.key===`Enter`&&cs(e)&&(e.preventDefault(),b(a.current))},onClick:e=>{e.target.closest(`a,button,[role='menu']`)||b(a.current)},children:[(0,H.jsx)(`span`,{className:`a-aura`,"aria-hidden":`true`,style:y}),(0,H.jsxs)(`header`,{className:`a-head`,children:[(0,H.jsx)(`span`,{className:`a-mark`,children:(0,H.jsx)(ho,{harness:e.harness,size:ep,variant:`bare`})}),(0,H.jsx)(`span`,{className:`o-label`,children:no(e.harness,r)}),(0,H.jsx)(`span`,{className:`a-room`,children:(0,H.jsxs)(`span`,{className:`a-model`,children:[(0,H.jsx)(`span`,{className:`a-model-name`,"data-tip":v,children:f?r(`run.simulated`):g}),!f&&p?(0,H.jsx)(`span`,{className:`a-effort`,"data-tip":r(`info.effort`),children:p}):null]})}),e.attention?.length?(0,H.jsx)(rp,{items:e.attention}):null,e.messages.pending>0?(0,H.jsxs)(`span`,{className:`a-flag`,"data-tone":`blue`,"data-tip":`${r(`node.pending`,{n:e.messages.pending})}\n${r(`node.pendingTip`)}`,children:[(0,H.jsx)(U,{name:`send`,size:11}),e.messages.pending]}):e.counters.interventions>0?(0,H.jsxs)(`span`,{className:`a-flag`,"data-tip":r(`node.interventionsTip`),children:[(0,H.jsx)(U,{name:`hand`,size:11}),e.counters.interventions]}):null,(0,H.jsx)(jo,{items:()=>Go(e,r),label:r(`node.menu`),className:`a-menu`,glyph:(0,H.jsxs)(`span`,{className:`a-dots`,"aria-hidden":`true`,children:[(0,H.jsx)(`i`,{}),(0,H.jsx)(`i`,{}),(0,H.jsx)(`i`,{})]}),onOpenChange:s})]}),(0,H.jsx)(`div`,{className:`a-inset`,children:(0,H.jsxs)(`div`,{className:`a-row`,children:[(0,H.jsx)(Io,{family:_,simulated:f,tip:v}),(0,H.jsxs)(`div`,{className:`a-text`,children:[(0,H.jsxs)(`div`,{className:`a-line`,children:[(0,H.jsx)(`a`,{className:`a-title`,href:fi({kind:`session`,id:e.id}),"data-tip":e.title,onClick:e=>e.stopPropagation(),children:e.title}),(0,H.jsx)(ip,{summary:e})]}),(0,H.jsx)(`div`,{className:`a-sub`,"data-tip":h,children:(0,H.jsx)(`span`,{children:h},h)})]})]})})]})});function op({engine:e,zoom:t,moved:n,canReset:r}){let i=V(),a=Math.round(t*100);return(0,H.jsxs)(`div`,{className:`canvas-scale`,role:`group`,"aria-label":i(`dock.zoom`),"data-scene-ui":!0,children:[(0,H.jsx)(`button`,{type:`button`,className:`scale-btn`,"aria-label":i(`scene.zoomOut`),"data-tip":i(`scene.zoomOut`),onClick:()=>e.zoomBy(1/1.2),children:(0,H.jsx)(U,{name:`minus`,size:13})}),(0,H.jsxs)(`span`,{className:`scale-value num`,children:[a,`%`]}),(0,H.jsx)(`button`,{type:`button`,className:`scale-btn`,"aria-label":i(`scene.zoomIn`),"data-tip":i(`scene.zoomIn`),onClick:()=>e.zoomBy(1.2),children:(0,H.jsx)(U,{name:`plus`,size:13})}),(0,H.jsx)(`span`,{className:`scale-sep`,"aria-hidden":`true`}),(0,H.jsx)(`button`,{type:`button`,className:`scale-btn`,"aria-label":i(`scene.fit`),"data-tip":i(`scene.fit`),"data-active":n?``:void 0,onClick:()=>e.fit(!0,!0),children:(0,H.jsx)(U,{name:`fit`,size:13})}),r?(0,H.jsx)(`button`,{type:`button`,className:`scale-btn`,"aria-label":i(`scene.resetLayout`),"data-tip":i(`scene.resetLayoutTip`),onClick:()=>e.resetLayout(),children:(0,H.jsx)(U,{name:`refresh`,size:13})}):null]})}var sp={top:`arrowUp`,right:`arrowRight`,bottom:`arrowDown`,left:`arrowLeft`},cp={top:`edgeHint.top`,right:`edgeHint.right`,bottom:`edgeHint.bottom`,left:`edgeHint.left`},lp=4,up=1600;function dp({engine:e}){let t=V(),n=(0,l.useSyncExternalStore)(e.arrivals.subscribe,e.arrivals.getHints),r=I(z,e=>e.sessions),i=(0,l.useRef)(null),a=(0,l.useRef)(new Map),[o,s]=(0,l.useState)(``);(0,l.useLayoutEffect)(()=>{let e=i.current,t=e?.closest(`.scene`)?.querySelector(`.arrange-wrap`)??e?.ownerDocument.querySelector(`.dock-wrap`);if(!e||!t)return;let n=()=>{let n=Number.parseFloat(getComputedStyle(t).rowGap)||0,r=e.getBoundingClientRect().bottom-t.getBoundingClientRect().top;e.style.setProperty(`--edge-stack`,`${Math.max(0,r)+n}px`)};n();let r=new ResizeObserver(n);return r.observe(t),r.observe(e),()=>r.disconnect()},[]),(0,l.useEffect)(()=>{let e=a.current;return()=>{for(let[t,n]of e)clearTimeout(n),t.removeAttribute(`data-landed`);e.clear()}},[]);let c=new Map;for(let e of Object.values(r))c.set(On(e.id),e);let u=n.flatMap(e=>{let n=e.ids.flatMap(e=>c.get(e)??[]),r=n[0];if(!r)return[];let i=t(cp[e.edge]),a=n.length===1?t(`edgeHint.one`,{dir:i,title:r.title}):t(`edgeHint.many`,{dir:i,n:n.length,title:r.title}),o=n.slice(0,lp).map(e=>`${e.title} · ${Lt(e.phase,t)}`);return n.length>lp&&o.push(t(`edgeHint.more`,{n:n.length-lp})),o.push(t(n.length===1?`edgeHint.goOne`:`edgeHint.goNearest`)),[{edge:e.edge,count:n.length,label:a,tip:o.join(`
36
- `)}]}),d=u.reduce((e,t)=>e+t.count,0),f=(0,l.useRef)(0),p=u.map(e=>e.label).join(`. `);(0,l.useEffect)(()=>{d>f.current?s(p):d===0&&s(``),f.current=d},[d,p]);let m=(t,n)=>{let r=e.arrivals.go(t),o=i.current?.closest(`.scene`),s=r===void 0?void 0:[...o?.querySelectorAll(`[data-node-id]`)??[]].find(e=>e.dataset.nodeId===r);s&&(clearTimeout(a.current.get(s)),s.setAttribute(`data-landed`,``),a.current.set(s,setTimeout(()=>{s.removeAttribute(`data-landed`),a.current.delete(s)},up)),n.detail===0&&s.focus({preventScroll:!0}))};return(0,H.jsxs)(`div`,{className:`edge-hints`,ref:i,children:[u.map(e=>(0,H.jsxs)(`button`,{type:`button`,className:`edge-hint`,"data-edge":e.edge,"data-multi":e.count>1?``:void 0,"aria-label":e.label,"aria-description":e.tip,"data-tip":e.tip,onClick:t=>m(e.edge,t),children:[(0,H.jsx)(U,{name:sp[e.edge],size:15}),e.count>1?(0,H.jsx)(`span`,{className:`edge-hint-count num`,"aria-hidden":`true`,children:e.count>99?`99+`:e.count}):null]},e.edge)),(0,H.jsx)(`span`,{className:`sr-only`,"aria-live":`polite`,children:o})]})}var fp={w:456,h:156,originW:156,originH:66,agentW:196,agentH:66};function pp(){let e=V(),t=(fp.h-fp.originH)/2,n={x:fp.originW,y:t+fp.originH/2},r=fp.w-fp.agentW,i={x:r,y:fp.agentH/2},a={x:r,y:fp.h-fp.agentH/2},o=[zd(n,i),zd(n,a)];return(0,H.jsxs)(`div`,{className:`empty`,"data-scene-ui":!0,children:[(0,H.jsxs)(`div`,{className:`ghost`,style:{width:fp.w,height:fp.h},"aria-hidden":`true`,children:[(0,H.jsx)(`svg`,{width:fp.w,height:fp.h,children:o.map((e,t)=>(0,H.jsx)(`path`,{className:`pipe-tube`,"data-phase":`idle`,d:e,fill:`none`},t))}),(0,H.jsxs)(`div`,{className:`ghost-node ghost-origin`,style:{left:0,top:t,width:fp.originW,height:fp.originH},children:[(0,H.jsx)(`span`,{className:`ghost-mark`,children:(0,H.jsx)(ho,{harness:`codex`,size:18,variant:`bare`})}),(0,H.jsxs)(`span`,{className:`ghost-lines`,children:[(0,H.jsx)(`i`,{style:{width:`64%`}}),(0,H.jsx)(`i`,{style:{width:`40%`}})]})]}),[[`cursor`,0],[`pi`,fp.h-fp.agentH]].map(([e,t])=>(0,H.jsxs)(`div`,{className:`ghost-node ghost-agent`,style:{left:r,top:t,width:fp.agentW,height:fp.agentH},children:[(0,H.jsx)(`span`,{className:`ghost-mark`,children:(0,H.jsx)(ho,{harness:e,size:30})}),(0,H.jsxs)(`span`,{className:`ghost-lines`,children:[(0,H.jsx)(`i`,{style:{width:`72%`}}),(0,H.jsx)(`i`,{style:{width:`46%`}})]})]},e))]}),(0,H.jsx)(`h2`,{className:`empty-title`,children:e(`empty.title`)}),(0,H.jsx)(`p`,{className:`empty-sub`,children:e(`empty.sub`)})]})}var mp=14.4,hp=(0,l.memo)(function({folder:e,engine:t}){let n=V(),r=(0,l.useRef)(null),i=Dn(e.key);(0,l.useLayoutEffect)(()=>{let e=r.current;return e?t.register(i,e):void 0},[t,i]);let a=(0,l.useMemo)(()=>ls(t,i),[t,i]),o=tr(e.path),s=nr(e.path),c=e.origins.length,u=[n(`folder.tipHead`),`${n(`folder.path`)}: ${e.path}`,c>1?n(`folder.usedBy`,{n:c}):void 0].filter(Boolean).join(`
37
- `);return(0,H.jsxs)(`div`,{ref:r,className:`node folder`,"data-node":!0,"data-node-id":i,"data-tip":u,tabIndex:0,role:`group`,"aria-label":n(`folder.label`,{name:o}),"aria-description":n(`folder.keyboard`),onKeyDown:a,children:[(0,H.jsxs)(`header`,{className:`o-head`,children:[(0,H.jsx)(`span`,{className:`a-mark`,children:(0,H.jsx)(U,{name:`folder`,size:mp})}),(0,H.jsx)(`span`,{className:`o-label`,children:n(`folder.head`)}),c>1?(0,H.jsx)(`span`,{className:`o-count`,"data-tip":n(`folder.usedBy`,{n:c}),children:n(`folder.count`,{n:c})}):null]}),(0,H.jsxs)(`div`,{className:`o-body`,children:[(0,H.jsxs)(`div`,{className:`o-main`,children:[(0,H.jsx)(U,{name:`folder`,size:13,className:`o-ico`}),(0,H.jsx)(`span`,{className:`o-text`,children:o})]}),s?(0,H.jsx)(`span`,{className:`o-sub`,children:(0,H.jsx)(`bdi`,{dir:`ltr`,children:s})}):null]})]})}),gp=[`staged`,`unstaged`,`untracked`,`conflicted`],_p=(0,l.memo)(function({worktree:e,entry:t,engine:n}){let r=V(),i=$a(),a=(0,l.useRef)(null),o=En(e),{git:s,stale:c}=t;(0,l.useLayoutEffect)(()=>{let e=a.current;return e?n.register(o,e):void 0},[n,o]);let u=(0,l.useMemo)(()=>ls(n,o),[n,o]),d=It(s.root),{head:f,upstream:p,changes:m}=s,h=f?.sha.slice(0,7),g=s.branch??(s.detached?r(`git.detached`):d),_=m.conflicted>0,v=_?r(`git.conflicts`,{n:m.conflicted}):m.files>0?r(`git.dirty`,{n:m.files}):r(`git.clean`),y=Dt(s.checkedAt,i),b=p?[p.name,p.ahead>0?r(`git.ahead`,{n:p.ahead}):void 0,p.behind>0?r(`git.behind`,{n:p.behind}):void 0]:[];p&&p.ahead===0&&p.behind===0&&b.push(r(`git.inSync`));let x=gp.filter(e=>m[e]>0).map(e=>r(`git.part.${e}`,{n:m[e]})),S=[r(`git.tipHead`),`${r(`git.root`)}: ${s.root}`,`${r(`git.branch`)}: ${s.branch??r(`git.detached`)}`,p?`${r(`git.upstream`)}: ${b.filter(Boolean).join(` · `)}`:void 0,f?`${r(`git.commit`)}: ${h} ${f.subject} (${Et(f.committedAt,i)})`:r(`git.noCommits`),`${r(`git.changes`)}: ${x.length>0?x.join(` · `):r(`git.clean`)}`,s.remote?`${r(`git.remote`)}: ${s.remote.name} ${s.remote.url}`:void 0,c?r(`git.stale`,{time:y}):`${r(`git.checked`)}: ${y}`].filter(Boolean).join(`
38
- `),C=(e,t)=>`${r(`git.upstream`)}: ${p?.name??``} · ${r(t,{n:e})}`;return(0,H.jsxs)(`div`,{ref:a,className:`node git`,"data-node":!0,"data-node-id":o,"data-stale":c?``:void 0,"data-tip":S,tabIndex:0,role:`group`,"aria-label":r(`git.label`,{name:d}),"aria-description":r(`git.keyboard`),onKeyDown:u,children:[(0,H.jsxs)(`header`,{className:`o-head`,children:[(0,H.jsx)(`span`,{className:`a-mark`,children:(0,H.jsx)(U,{name:`git`,size:12.6})}),(0,H.jsx)(`span`,{className:`o-label`,children:r(`git.head`)}),(0,H.jsx)(`span`,{className:`a-model`,children:d}),p&&(p.ahead>0||p.behind>0)||c?(0,H.jsxs)(`span`,{className:`o-count g-sync num`,children:[p&&p.ahead>0?(0,H.jsxs)(`span`,{className:`g-chip`,"data-tip":C(p.ahead,`git.ahead`),children:[(0,H.jsx)(U,{name:`arrowUp`,size:10,strokeWidth:2.4}),p.ahead]}):null,p&&p.behind>0?(0,H.jsxs)(`span`,{className:`g-chip`,"data-tip":C(p.behind,`git.behind`),children:[(0,H.jsx)(U,{name:`arrowDown`,size:10,strokeWidth:2.4}),p.behind]}):null,c?(0,H.jsx)(`span`,{className:`g-chip g-stale`,"data-tip":r(`git.stale`,{time:y}),children:(0,H.jsx)(U,{name:`clock`,size:11})}):null]}):null]}),(0,H.jsxs)(`div`,{className:`o-body`,children:[(0,H.jsxs)(`div`,{className:`o-main`,children:[(0,H.jsx)(U,{name:`branch`,size:13,className:`o-ico`}),(0,H.jsx)(`span`,{className:`o-text`,children:g})]}),(0,H.jsx)(`span`,{className:`o-sub`,children:f?(0,H.jsxs)(H.Fragment,{children:[(0,H.jsx)(`span`,{className:`g-sha num`,children:h}),f.subject]}):r(`git.noCommits`)}),(0,H.jsx)(`span`,{className:`o-title`,"data-kind":_?`attention`:void 0,children:v})]})]})});function vp({hidden:e,onShowAll:t}){let n=V();return(0,H.jsxs)(`div`,{className:`empty`,"data-idle":!0,"data-scene-ui":!0,children:[(0,H.jsx)(`h2`,{className:`empty-title`,children:n(`idle.title`)}),(0,H.jsx)(`p`,{className:`empty-sub`,children:n(`idle.sub`,{n:e})}),(0,H.jsx)(`div`,{className:`empty-actions`,children:(0,H.jsxs)(`button`,{type:`button`,className:`btn btn--primary`,onClick:t,children:[(0,H.jsx)(U,{name:`eye`,size:15,strokeWidth:2}),n(`idle.showAll`)]})})]})}function yp(e){let t=Tn(``);return e.startsWith(t)?e.slice(t.length):void 0}function bp({key:e,sessions:t,collapsed:n,t:r,announce:i,archiveSupported:a=!1}){let o=_t(t),s=o.get(e);if(s===void 0)return;let c=n.has(e),l=[{id:`toggle`,label:r(c?`origin.menuShow`:`origin.menuHide`,{n:s}),icon:c?`eye`:`eyeOff`,onSelect:()=>{Wi(e,!c),i(r(c?`origin.doneShow`:`origin.doneHide`,{n:s}))}}],u=[...n].filter(e=>o.has(e));if(u.some(t=>t!==e)&&l.push({id:`show-all`,label:r(`origin.menuShowAll`,{n:u.length}),icon:`eye`,separatorAbove:!0,onSelect:()=>{Gi(),i(r(`origin.doneShowAll`,{n:u.length}))}}),a){let n=Ha(ai(t,{kind:`origin`,key:e}),t),i=n.changed.length===0,a=ma();l.push({id:`archive-space`,label:i?r(`origin.menuArchiveNone`):r(n.kept>0?`origin.menuArchivePart`:`origin.menuArchive`,{n:n.changed.length}),icon:`archive`,separatorAbove:!0,disabled:i||a,disabledReason:i?n.blocked?ya(n.blocked,r):r(`archive.nothing`):r(`archive.busy`),onSelect:()=>Sa(n)})}return l}async function xp(e,t){let n=await Promise.all(e.map(async e=>{try{return{id:e,failed:!1,result:await t(e)}}catch(t){return{id:e,failed:!0,reason:Ai(t)}}})),r={ok:[],idle:[],failed:[]};for(let e of n)e.failed?r.failed.push({id:e.id,reason:e.reason}):e.result===`ok`?r.ok.push(e.id):r.idle.push(e.id);return r}function Sp(e){return xp(e,async e=>{let t=await N.cancel(e);return ua(t.summary),t.interrupted||t.cancelledQueued>0?`ok`:`idle`})}function Cp(e){return xp(e,async e=>(ua((await N.stop(e)).summary),`ok`))}function wp(e){return xp(e,async e=>(await N.remove(e),oa(e),`ok`))}function Tp(e,t,n){let{ok:r,idle:i,failed:a}=t,o=a.length===0?r.length>0?`success`:`info`:r.length+i.length>0?`warn`:`error`,s=a[0]?.reason??``;Di(o,n(`batch.result`,{action:e,ok:r.length,idle:i.length,failed:a.length,reason:s}),a.length>0?6e3:4200)}function Ep(e,t){let n=z.get().sessions;return e.flatMap(({id:e})=>{let r=n[e];return r!==void 0&&t(r)?[e]:[]})}function Dp({engine:e,count:t,sessions:n,canUndo:r,canRedo:i,t:a,announce:o,archiveSupported:s=!1}){let c=es(),l=(e,n)=>()=>{o(n()?a(`arrange.done`,{action:e,n:t}):a(`arrange.unchanged`,{action:e}))},u=Qo.map(({mode:t,icon:n,label:r},i)=>({id:`align-${t}`,label:a(r),icon:n,separatorAbove:i===3,onSelect:l(a(r),()=>e.align(t))})),d=t>=3,f=$o.map(({axis:t,icon:n,label:r})=>({id:`distribute-${t}`,label:a(r),icon:n,disabled:!d,disabledReason:a(`arrange.needThree`,{label:a(r)}),onSelect:l(a(r),()=>e.distribute(t))})),p=a(`arrange.undo`,{keys:`${c}Z`}),m=a(`arrange.redo`,{keys:`${c}Shift+Z`}),h=[{id:`undo`,label:p,icon:`undo`,separatorAbove:!0,disabled:!r,disabledReason:a(`ctx.undoNone`,{label:p}),onSelect:()=>{e.undo()}},{id:`redo`,label:m,icon:`redo`,disabled:!i,disabledReason:a(`ctx.redoNone`,{label:m}),onSelect:()=>{e.redo()}}],g=[{id:`scope`,heading:a(`scene.selected`,{n:t})},{id:`align`,items:u},{id:`distribute`,items:[...f,...h]},{id:`clear`,label:a(`arrange.clear`),icon:`close`,separatorAbove:!0,onSelect:()=>e.clearSelection()}];if(n.length===0)return g;let _=n.map(e=>e.id),v=n.filter(Ho),y=n.filter(Uo),b=n.filter(Wo),x=s?Ua(n,Object.values(z.get().sessions)):void 0,S=x?[{id:`archive`,label:a(`ctx.archiveSelected`,{n:x.changed.length}),icon:`archive`,disabled:x.changed.length===0||ma(),disabledReason:x.changed.length===0?x.blocked?ya(x.blocked,a):a(`archive.nothing`):a(`archive.busy`),onSelect:()=>Sa(x)}]:[];return g.push({id:`sessions`,heading:a(`ctx.sessions`,{n:n.length})},{id:`copy-ids`,label:a(`ctx.copyIds`,{n:_.length}),icon:`copy`,onSelect:()=>{Bo(_.join(`
39
- `)).then(e=>Di(e?`success`:`warn`,a(e?`common.copied`:`common.copyFailed`),1800))}},{id:`cancel`,label:a(`ctx.cancelRuns`,{n:v.length}),icon:`stop`,disabled:v.length===0,disabledReason:a(`ctx.cancelNone`),onSelect:()=>{let e=Ep(v,Ho);e.length!==0&&Sp(e).then(e=>Tp(a(`menu.cancelRun`),e,a))}},{id:`stop`,label:a(`ctx.stopSessions`,{n:y.length}),icon:`pause`,disabled:y.length===0,disabledReason:a(`ctx.stopNone`),onSelect:()=>na({title:a(`batch.stopTitle`,{n:y.length}),body:a(`batch.stopBody`,{active:y.filter(e=>Ht(e.phase)).length,skipped:n.length-y.length}),confirmLabel:a(`batch.stopConfirm`,{n:y.length}),onConfirm:async()=>{let e=Ep(y,Uo);e.length!==0&&Tp(a(`menu.stopSession`),await Cp(e),a)}})},...S,{id:`remove`,label:a(`ctx.removeRecords`,{n:b.length}),icon:`trash`,danger:!0,disabled:b.length===0,disabledReason:a(`ctx.removeNone`),onSelect:()=>na({title:a(`batch.removeTitle`,{n:b.length}),body:a(`batch.removeBody`,{skipped:n.length-b.length}),confirmLabel:a(`batch.removeConfirm`,{n:b.length}),tone:`danger`,onConfirm:async()=>{let e=Ep(b,Wo);e.length!==0&&Tp(a(`menu.remove`),await wp(e),a)}})}),g}var Op=14;function kp(e){let t=On(``);return e.startsWith(t)?e.slice(t.length):void 0}function Ap(e,t){return e.length===t.length&&e.every(e=>t.includes(e))}function jp({engine:e}){let t=V(),n=I(z,e=>e.sessions),r=I(z,e=>e.collapsedOrigins),i=I(z,e=>e.archivedCount!==void 0),a=(0,l.useSyncExternalStore)(e.subscribeSelection,e.getSelectedIds),{canUndo:o,canRedo:s}=(0,l.useSyncExternalStore)(e.subscribe,e.getState),[c,u]=(0,l.useState)(void 0),[d,f]=(0,l.useState)(``),p=(0,l.useRef)(0),m=(0,l.useRef)(void 0);m.current=c;let h=(0,l.useCallback)((e,t)=>{m.current?.seq===e.seq&&(m.current=void 0,u(void 0),t&&e.request.el.isConnected&&e.request.el.focus({preventScroll:!0}))},[]);(0,l.useEffect)(()=>e.onNodeContext(e=>{if(e.scope===`node`){let t=kp(e.nodeId);if(t!==void 0){if(z.get().sessions[t]===void 0)return!1}else{let t=yp(e.nodeId);if(t===void 0||!_t(Object.values(z.get().sessions)).has(t))return!1}}let t=e.el.getBoundingClientRect();return p.current+=1,f(``),u({seq:p.current,request:e,at:e.point??{x:t.left+Op,y:t.top+Op}}),!0}),[e]);let g=c?.request.scope===`node`?kp(c.request.nodeId):void 0,_=c?.request.scope===`node`?yp(c.request.nodeId):void 0,v=(0,l.useMemo)(()=>_===void 0?void 0:_t(Object.values(n)),[_,n]),y=_!==void 0&&v?.has(_)!==!0,b=c?.request.scope===`node`&&_===void 0&&(g===void 0||n[g]===void 0),x=c?.request.scope===`selection`&&!Ap(a,c.request.ids),S=c!==void 0&&!c.request.el.isConnected;(0,l.useEffect)(()=>{c&&(b||y||x||S)&&h(c,!1)},[c,b,y,x,S,h]),(0,l.useEffect)(()=>{if(c?.request.scope===`node`)return ns.set({nodeId:c.request.nodeId}),()=>ns.set({nodeId:void 0})},[c]);let C=null;if(c){let{request:a}=c,l={kind:`point`,x:c.at.x,y:c.at.y};if(a.scope===`node`&&_!==void 0){let e=bp({key:_,sessions:Object.values(n),collapsed:r,t,announce:f,archiveSupported:i});e&&(C=(0,H.jsx)(Ao,{entries:e,label:t(`origin.menu`),anchor:l,onClose:e=>h(c,e)},c.seq))}else if(a.scope===`node`){let e=g===void 0?void 0:n[g];e&&(C=(0,H.jsx)(Ao,{entries:Go(e,t),label:t(`node.menu`),anchor:l,onClose:e=>h(c,e)},c.seq))}else{let r=[];for(let e of a.ids){let t=kp(e),i=t===void 0?void 0:n[t];i&&r.push(i)}C=(0,H.jsx)(Ao,{entries:Dp({engine:e,count:a.ids.length,sessions:r,canUndo:o,canRedo:s,t,announce:f,archiveSupported:i}),label:t(`scene.selected`,{n:a.ids.length}),anchor:l,onClose:e=>h(c,e)},c.seq)}}return(0,H.jsxs)(H.Fragment,{children:[C,(0,H.jsx)(`span`,{className:`sr-only`,"aria-live":`polite`,children:d})]})}function Mp({summary:e}){let t=V(),n=kt(e,St());return(0,H.jsxs)(`span`,{className:`slist-state`,"data-kind":`running`,children:[(0,H.jsx)(`i`,{className:`a-run`,"aria-hidden":`true`}),(0,H.jsx)(`span`,{className:`num`,children:n===void 0?Lt(e.phase,t):Ct(n)})]})}function Np({items:e}){let t=V(),n=Gt(e,St(),t);return(0,H.jsxs)(`span`,{className:`a-flag`,"data-tone":`amber`,"data-tip":n,role:`img`,"aria-label":n,children:[(0,H.jsx)(U,{name:`alert`,size:11}),e.length>1?e.length:null]})}function Pp({summary:e}){let t=V(),{phase:n}=e;if(n===`running`)return(0,H.jsx)(Mp,{summary:e});if(n===`done`){let r=e.lastRun?.durationMs;return(0,H.jsx)(`span`,{className:`slist-state num`,"data-kind":`done`,children:r===void 0?Lt(n,t):v(r)})}return(0,H.jsx)(`span`,{className:`slist-state`,"data-kind":n,children:Lt(n,t)})}function Fp({sessions:e,empty:t}){let n=V(),r=$a(),i=(0,l.useMemo)(()=>Xa(e),[e]);return i.length===0?t?(0,H.jsx)(`div`,{className:`slist-empty-wrap`,children:t}):(0,H.jsx)(`div`,{className:`slist-empty`,children:n(`view.listEmpty`)}):(0,H.jsx)(`div`,{className:`slist`,role:`list`,children:i.map(({session:e,depth:t})=>{let i=e.runtime===`fixture`,a=eo(e,n),o=e.effort?.trim()||void 0,s=Ja(e.model),c=Vt(e,n),l=(e.attention?.length??0)>0,u=e.counters.files;return(0,H.jsxs)(`div`,{className:`slist-row`,role:`listitem`,"data-phase":e.phase,"data-attention":l?``:void 0,"data-depth":t,style:t>0?{paddingLeft:20+t*22}:void 0,onClick:t=>{t.target.closest(`a,button,[role='menu']`)||Ni({kind:`session`,id:e.id})},children:[t>0?(0,H.jsx)(`span`,{className:`slist-branch`,"aria-hidden":`true`}):null,(0,H.jsx)(`div`,{className:`slist-avatar`,children:(0,H.jsx)(Io,{family:s,simulated:i,size:20})}),(0,H.jsxs)(`div`,{className:`slist-main`,children:[(0,H.jsxs)(`div`,{className:`slist-top`,children:[(0,H.jsx)(`a`,{className:`slist-title`,href:fi({kind:`session`,id:e.id}),onClick:e=>e.stopPropagation(),children:e.title}),l?(0,H.jsx)(Np,{items:e.attention}):null,u>0?(0,H.jsxs)(`span`,{className:`slist-files num`,"data-tip":n(`view.filesChanged`,{n:u}),children:[(0,H.jsx)(U,{name:`file`,size:11}),u]}):null]}),(0,H.jsx)(`div`,{className:`slist-sub`,"data-tip":c,children:c})]}),(0,H.jsxs)(`div`,{className:`slist-spec`,children:[(0,H.jsxs)(`span`,{className:`slist-harness`,children:[(0,H.jsx)(ho,{harness:e.harness,size:11,variant:`bare`}),(0,H.jsx)(`span`,{children:no(e.harness,n)})]}),(0,H.jsx)(`span`,{className:`slist-model`,"data-tip":a,children:i?n(`run.simulated`):a}),!i&&o?(0,H.jsx)(`span`,{className:`a-effort`,children:o}):null]}),(0,H.jsxs)(`div`,{className:`slist-meta`,children:[(0,H.jsx)(Pp,{summary:e}),(0,H.jsx)(`time`,{className:`slist-time num`,dateTime:e.createdAt,children:Et(e.createdAt,r,!0)})]}),(0,H.jsx)(`div`,{className:`slist-menu`,children:(0,H.jsx)(jo,{items:()=>Go(e,n),label:n(`node.menu`),className:`a-menu`,glyph:(0,H.jsxs)(`span`,{className:`a-dots`,"aria-hidden":`true`,children:[(0,H.jsx)(`i`,{}),(0,H.jsx)(`i`,{}),(0,H.jsx)(`i`,{})]})})})]},e.id)})})}var Ip=[`staged`,`unstaged`,`untracked`,`conflicted`];function Lp({entry:e}){let t=V(),n=$a(),{git:r,stale:i}=e,a=It(r.root),{head:o,upstream:s,changes:c}=r,l=o?.sha.slice(0,7),u=r.branch??(r.detached?t(`git.detached`):a),d=c.conflicted>0,f=d?t(`git.conflicts`,{n:c.conflicted}):c.files>0?t(`git.dirty`,{n:c.files}):t(`git.clean`),p=Dt(r.checkedAt,n),m=s?[s.name,s.ahead>0?t(`git.ahead`,{n:s.ahead}):void 0,s.behind>0?t(`git.behind`,{n:s.behind}):void 0]:[];s&&s.ahead===0&&s.behind===0&&m.push(t(`git.inSync`));let h=Ip.filter(e=>c[e]>0).map(e=>t(`git.part.${e}`,{n:c[e]})),g=[t(`git.tipHead`),`${t(`git.root`)}: ${r.root}`,`${t(`git.branch`)}: ${r.branch??t(`git.detached`)}`,s?`${t(`git.upstream`)}: ${m.filter(Boolean).join(` · `)}`:void 0,o?`${t(`git.commit`)}: ${l} ${o.subject} (${Et(o.committedAt,n)})`:t(`git.noCommits`),`${t(`git.changes`)}: ${h.length>0?h.join(` · `):t(`git.clean`)}`,r.remote?`${t(`git.remote`)}: ${r.remote.name} ${r.remote.url}`:void 0,i?t(`git.stale`,{time:p}):`${t(`git.checked`)}: ${p}`].filter(Boolean).join(`
40
- `);return(0,H.jsxs)(`span`,{className:`ws-ctx-item ws-ctx-git`,"data-stale":i?``:void 0,"data-tip":g,children:[(0,H.jsx)(U,{name:`git`,size:11.5,className:`ws-ctx-git-mark`}),(0,H.jsx)(`span`,{className:`ws-ctx-branch`,children:u}),l?(0,H.jsx)(`span`,{className:`ws-ctx-sha mono`,children:l}):null,(0,H.jsx)(`span`,{className:`ws-ctx-status`,"data-kind":d?`attention`:void 0,children:f}),s&&s.ahead>0?(0,H.jsxs)(`span`,{className:`ws-ctx-sync num`,children:[(0,H.jsx)(U,{name:`arrowUp`,size:9.5,strokeWidth:2.4}),s.ahead]}):null,s&&s.behind>0?(0,H.jsxs)(`span`,{className:`ws-ctx-sync num`,children:[(0,H.jsx)(U,{name:`arrowDown`,size:9.5,strokeWidth:2.4}),s.behind]}):null,i?(0,H.jsx)(U,{name:`clock`,size:11,className:`ws-ctx-stale`}):null]})}function Rp({scope:e,workspace:t,git:n,allWorkspaces:r,scopedSessions:i,allSessions:a,variant:o=`overlay`}){let s=V(),c=$a(),u=I(z,e=>e.hideIdle),d=I(z,e=>e.viewMode),f=Jr(i).hidden.size,p=e.kind!==`active`&&i.length>0,m=u?f>0?s(`dock.showAllTip`,{n:f}):s(`dock.showAllNone`):f>0?s(`dock.hideIdleTip`,{n:f}):s(`dock.hideIdleNone`),h=f>0?`${m}\n${s(`dock.hideIdleReady`)}\n${s(`dock.hideIdleKept`)}`:m,g=I(z,e=>e.archivedCount!==void 0),_=I(pa,e=>e.busy>0),v=g&&e.kind!==`active`&&i.length>0,y=(0,l.useMemo)(()=>v?Ha(i,a):void 0,[v,i,a]),b=y?.changed.length??0,x=y===void 0||b===0||_,S=y===void 0?``:_?s(`archive.busy`):b===0?y.blocked?ya(y.blocked,s):s(`archive.nothing`):[s(`archive.finishedTip`,{n:b}),y.kept>0&&y.blocked?ya(y.blocked,s):void 0].filter(Boolean).join(`
41
- `),C=()=>{if(e.kind===`origin`&&t){let{origin:e}=t,r=t.workspace,i=as(e),a=[t.hostTitle?`${t.hostTitle}`:void 0,s(`origin.tipHead`,{host:e.hostLabel}),...os(e,s),ss(e,s),`${s(`origin.started`)}: ${Dt(t.startedAt,c)}`].filter(Boolean).join(`
42
- `);return(0,H.jsxs)(`div`,{className:`ws-head-line`,children:[r?(0,H.jsxs)(`span`,{className:`ws-ctx-primary`,"data-tip":a,children:[(0,H.jsx)(U,{name:`folder`,size:13,className:`ws-ctx-ico`}),(0,H.jsx)(`span`,{className:`ws-ctx-folder`,children:It(r)})]}):i?(0,H.jsxs)(`span`,{className:`ws-ctx-primary ws-ctx-unknown`,"data-tip":a,children:[(0,H.jsx)(U,{name:`folder`,size:13,className:`ws-ctx-ico`}),(0,H.jsx)(`span`,{children:s(`origin.workspaceUnknown`)})]}):(0,H.jsxs)(`span`,{className:`ws-ctx-primary`,"data-tip":a,children:[(0,H.jsx)(fs,{host:e.host,size:13,fit:!0}),(0,H.jsx)(`span`,{className:`ws-ctx-folder`,children:e.kind===`user`?s(`origin.user`):e.hostLabel})]}),n?(0,H.jsxs)(H.Fragment,{children:[(0,H.jsx)(`span`,{className:`ws-ctx-sep`,"aria-hidden":`true`}),(0,H.jsx)(Lp,{entry:n})]}):null]})}if(e.kind===`active`){let e=r.reduce((e,t)=>e+t.running,0),t=r.reduce((e,t)=>e+t.working,0),n=r.filter(e=>e.working>0).length;return(0,H.jsxs)(`div`,{className:`ws-head-line`,children:[(0,H.jsxs)(`span`,{className:`ws-ctx-primary`,children:[(0,H.jsx)(U,{name:`zap`,size:13,className:`ws-ctx-ico`}),(0,H.jsx)(`span`,{className:`ws-ctx-folder`,children:s(`rail.active`)})]}),(0,H.jsx)(`span`,{className:`ws-ctx-sep`,"aria-hidden":`true`}),(0,H.jsx)(`span`,{className:`ws-ctx-item num`,children:s(`view.activeSubtitle`,{running:e,total:t,n})})]})}return(0,H.jsxs)(`div`,{className:`ws-head-line`,children:[(0,H.jsxs)(`span`,{className:`ws-ctx-primary`,children:[(0,H.jsx)(U,{name:`layers`,size:13,className:`ws-ctx-ico`}),(0,H.jsx)(`span`,{className:`ws-ctx-folder`,children:s(`rail.all`)})]}),(0,H.jsx)(`span`,{className:`ws-ctx-sep`,"aria-hidden":`true`}),(0,H.jsx)(`span`,{className:`ws-ctx-item num`,children:s(`view.allSubtitle`,{n:r.length,total:a.length})})]})},w=e=>{d!==e&&qi(e)};return(0,H.jsxs)(`header`,{className:`ws-head`,"data-mode":o,"data-scene-ui":!0,children:[C(),(0,H.jsxs)(`div`,{className:`ws-head-actions`,children:[p?(0,H.jsxs)(`button`,{type:`button`,className:`ws-action-btn ws-filter-btn`,"aria-label":s(`dock.hideIdle`),"aria-pressed":u,"aria-description":h,"data-tip":h,"data-active":u?``:void 0,onClick:()=>Ui(!u),children:[(0,H.jsx)(U,{name:`eyeOff`,size:13}),(0,H.jsx)(`span`,{className:`ws-action-label`,children:s(`view.workingOnly`)}),u&&f>0?(0,H.jsx)(`span`,{className:`ws-filter-count num`,children:f>99?`99+`:f}):null]}):null,y?(0,H.jsxs)(`button`,{type:`button`,className:`ws-action-btn ws-archive-btn`,"aria-label":s(`archive.finished`),"aria-disabled":x?`true`:void 0,"aria-description":S,"data-tip":S,onClick:()=>{x||Sa(y)},children:[(0,H.jsx)(U,{name:`archive`,size:13}),(0,H.jsx)(`span`,{className:`ws-action-label`,children:s(`archive.finished`)}),b>0?(0,H.jsx)(`span`,{className:`ws-filter-count num`,children:b>99?`99+`:b}):null]}):null,a.length>0?(0,H.jsxs)(`div`,{className:`ws-view-switch`,role:`group`,"aria-label":s(`view.mode`),children:[(0,H.jsxs)(`button`,{type:`button`,className:`ws-view-btn`,"data-view-mode":`canvas`,"aria-label":s(`view.canvas`),"aria-pressed":d===`canvas`,"data-active":d===`canvas`?``:void 0,onClick:()=>w(`canvas`),children:[(0,H.jsx)(U,{name:`canvas`,size:13}),(0,H.jsx)(`span`,{className:`ws-action-label`,children:s(`view.canvas`)})]}),(0,H.jsxs)(`button`,{type:`button`,className:`ws-view-btn`,"data-view-mode":`list`,"aria-label":s(`view.list`),"aria-pressed":d===`list`,"data-active":d===`list`?``:void 0,onClick:()=>w(`list`),children:[(0,H.jsx)(U,{name:`list`,size:13}),(0,H.jsx)(`span`,{className:`ws-action-label`,children:s(`view.list`)})]})]}):null]})]})}function zp(e){return JSON.stringify(e.map(e=>[e.id,e.origin,e.parentSessionId,e.createdAt,e.phase,...e.parentSessionIds&&e.parentSessionIds.length>1?[e.parentSessionIds]:[]]))}function Bp(e,t){if(!t)return;let n=e.get(t);if(n)return n;let r=Zn(t);for(let[t,n]of e)if(Zn(t)===r)return n}function Vp(){let e=V();return(0,H.jsxs)(`div`,{className:`empty`,"data-idle":``,children:[(0,H.jsx)(`h2`,{className:`empty-title`,children:e(`view.activeEmptyTitle`)}),(0,H.jsx)(`p`,{className:`empty-sub`,children:e(`view.activeEmptySub`)})]})}var Hp=new Set;function Up({engine:e,scope:t,workspaces:n,gitState:r,onCamera:i,onPositions:a}={}){let o=V(),s=I(z,e=>e.sessions),c=I(z,e=>e.viewMode),u=I(z,e=>e.hideIdle),d=I(z,e=>e.collapsedOrigins),f=t!==void 0,p=t??{kind:`all`},m=Qr(p),h=f&&c===`list`,g=(0,l.useMemo)(()=>Object.values(s),[s]),_=(0,l.useMemo)(()=>n??ri(g),[n,g]),v=(0,l.useMemo)(()=>p.kind===`origin`?_.find(e=>e.key===p.key):void 0,[p,_]),y=(0,l.useMemo)(()=>p.kind===`all`?g:ai(g,p),[g,p]),b=p.kind!==`active`&&u,x=p.kind===`all`?d:Hp,S=zp(y),C=(0,l.useRef)(y);C.current=y;let w=(0,l.useRef)(null),T=Tu(y,b,(0,l.useCallback)(e=>Du(w.current,e),[]),x),[E,D]=(0,l.useState)(void 0),[O,ee]=(0,l.useState)(void 0),[k,te]=(0,l.useState)(1),[ne,re]=(0,l.useState)(!1),[ie,ae]=(0,l.useState)(!1),[oe,se]=(0,l.useState)(!1),ce=(0,l.useCallback)((e,t)=>{te(e.k),re(t),i?.(e,t)},[i]),le=(0,l.useCallback)(e=>{ae(e),a?.(e)},[a]);(0,l.useLayoutEffect)(()=>{if(h)return;let e=w.current;if(!e)return;let t=()=>{let t=Qt(e.clientWidth,e.clientHeight),n=Math.round(t.w/16)*16,r=Math.round(t.h/16)*16;D(e=>e&&e.w===n&&e.h===r?e:{w:n,h:r})};t();let n=new ResizeObserver(t);return n.observe(e),()=>n.disconnect()},[h]);let ue=E?.w,de=E?.h,fe=R(E),pe=(0,l.useMemo)(()=>mu(C.current),[S]),me=bu(r?[]:pe.targets),he=r??me,ge=p.kind!==`all`,_e=(0,l.useMemo)(()=>p.kind===`origin`?Bp(he.entries,v?.workspace):void 0,[p.kind,he.entries,v?.workspace]),ve=(0,l.useMemo)(()=>yu(pe.workspaceOf,he.entries),[pe,he.entries]),ye=(0,l.useMemo)(()=>JSON.stringify(ve.map(e=>[e.key,e.origins])),[ve]),be=(0,l.useMemo)(()=>{let e=new Map;for(let[t,n]of JSON.parse(ye))for(let r of n)e.set(r,t);return e},[ye]),A=(0,l.useMemo)(()=>new Map(ve.map(e=>[En(e.key),e])),[ve]),j=(0,l.useMemo)(()=>e??new qf,[e]),xe=(0,l.useSyncExternalStore)(j.subscribeFill,()=>j.getFill(m)),Se=(0,l.useMemo)(()=>Kr(C.current,{...ue!==void 0&&de!==void 0?{area:{w:ue,h:de}}:{},git:be,...ge?{hideContextNodes:!0}:{},...f?{grid:!0,...xe===void 0?{}:{zoom:xe}}:{},...T.drawn?{visible:T.drawn}:{},...x.size>0?{collapsed:x}:{}}),[S,ue,de,be,ge,f,xe,T.key,x]),Ce=(0,l.useMemo)(()=>_t(y),[y]),we=(0,l.useMemo)(()=>gt(y,x).size,[y,x]),Te=(0,l.useMemo)(()=>{let e=new Map(er(pe.workspaceOf).map(e=>[e.key,e.origins]));return Se.folders.map(t=>({...t,origins:e.get(t.key)??t.origins}))},[Se,pe]);(0,l.useLayoutEffect)(()=>{if(h)return;let e=new Set([...x].map(Tn));Ou(w.current,Zr(Se,T.leaving,e))},[h,Se,T.leavingKey,x]);let M=(0,l.useRef)(null),Ee=(0,l.useRef)(null),De=(0,l.useRef)(null);(0,l.useLayoutEffect)(()=>{if(h)return;let e=w.current,t=M.current,n=Ee.current,r=De.current;if(e&&t&&n&&r)return j.mount({viewport:e,world:t,pipes:{tube:n,dots:r},onCamera:ce,onPositions:le,onArrangement:se,onSelection:ee}),()=>j.unmount()},[j,h,ce,le]),(0,l.useLayoutEffect)(()=>{h||j.switchSpace(m)},[j,m,h]);let Oe=(0,l.useRef)(!1);(0,l.useLayoutEffect)(()=>{h?Oe.current=!1:E&&(ge||Oe.current||!he.pending)&&(Oe.current=!0,j.setLayout(Se,!1,E))},[j,Se,E,he.pending,ge,h]);let ke=(0,l.useRef)(Ti.lastFocusId);(0,l.useEffect)(()=>{let e=setTimeout(()=>{Ti.lastFocusId=void 0,ke.current=void 0;for(let e of document.querySelectorAll(`.node`))e.style.removeProperty(`view-transition-name`)},900);return()=>clearTimeout(e)},[]),(0,l.useEffect)(()=>{let e=e=>{let t=e.target;if(t&&(t.isContentEditable||/^(input|textarea|select)$/i.test(t.tagName))||e.altKey)return;let n=z.get();if(!(n.settings.open||n.confirm||n.switcherOpen)){if(e.metaKey||e.ctrlKey){if(h||document.querySelector(`[role="menu"]`))return;let t=e.key.toLowerCase();if(t===`a`)j.selectAll();else if(t===`z`)e.shiftKey?j.redo():j.undo();else if(t===`y`&&e.ctrlKey)j.redo();else return;e.preventDefault()}else e.key===`/`&&f?(e.preventDefault(),Yi()):h||(e.key===`Escape`&&!document.querySelector(`[role="menu"]`)?j.clearSelection():e.key===`0`||e.key===`f`?j.fit(!0,f):e.key===`+`||e.key===`=`?j.zoomBy(1.2):(e.key===`-`||e.key===`_`)&&j.zoomBy(1/1.2))}};return document.addEventListener(`keydown`,e),()=>document.removeEventListener(`keydown`,e)},[j,h,f]);let Ae=(0,l.useMemo)(()=>y.filter(e=>!T.drawn||T.drawn.has(e.id)).sort((e,t)=>e.createdAt<t.createdAt?-1:1),[y,T.key]),je=(0,l.useMemo)(()=>{if(!b)return y;let e=Jr(y).visible;return y.filter(t=>e.has(t.id))},[y,b]);if(h){let e=g.length===0?(0,H.jsx)(pp,{}):p.kind===`active`&&y.length===0?(0,H.jsx)(Vp,{}):b&&je.length===0&&y.length>0?(0,H.jsx)(vp,{hidden:y.length,onShowAll:()=>Ui(!1)}):void 0;return(0,H.jsxs)(`div`,{className:`list-stage`,children:[(0,H.jsx)(Rp,{scope:p,workspace:v,git:_e,allWorkspaces:_,scopedSessions:y,allSessions:g,variant:`flow`}),(0,H.jsx)(`div`,{className:`list-scroll`,children:(0,H.jsx)(Fp,{sessions:je,empty:e})})]},`list`)}let Me=g.length===0,Ne=!Me&&p.kind===`active`&&y.length===0,Pe=!Me&&!Ne&&T.drawn?.size===0&&Se.origins.length===0;return(0,H.jsxs)(`div`,{className:`scene`,ref:w,"data-empty":Me?``:void 0,"data-compact":fe?``:void 0,"data-scoped":f?``:void 0,"data-grid":Se.grid?``:void 0,children:[f?(0,H.jsx)(Rp,{scope:p,workspace:v,git:_e,allWorkspaces:_,scopedSessions:y,allSessions:g,variant:`overlay`}):(0,H.jsx)(`div`,{className:`canvas-meta`,"data-scene-ui":!0,children:(0,H.jsx)(`h1`,{children:`Ensemble`})}),(0,H.jsxs)(`div`,{className:`scene-world`,ref:M,children:[(0,H.jsxs)(`div`,{className:`scene-plates`,children:[(0,H.jsx)(`svg`,{className:`pipes`,width:`1`,height:`1`,"aria-hidden":`true`,children:(0,H.jsx)(`g`,{className:`pipes-tube`,ref:Ee})}),Se.origins.map(e=>(0,H.jsx)(ps,{origin:e.origin,count:e.count,running:e.running,startedAt:e.startedAt,hostTitle:e.hostTitle,compact:fe,folderNode:e.folder!==void 0||p.kind===`origin`,collapsed:x.has(e.origin.key),hidden:Ce.get(e.origin.key)??e.count,engine:j},e.origin.key)),Te.map(e=>(0,H.jsx)(hp,{folder:e,engine:j},e.id)),Se.nodes.map(e=>{let t=e.kind===`git`?A.get(e.id):void 0;return t?(0,H.jsx)(_p,{worktree:t.key,entry:t.entry,engine:j},e.id):null}),Ae.map(e=>(0,H.jsx)(ap,{summary:e,engine:j,morph:e.id===ke.current},e.id))]}),(0,H.jsx)(`svg`,{className:`pipes`,width:`1`,height:`1`,"aria-hidden":`true`,children:(0,H.jsx)(`g`,{className:`pipes-dots`,ref:De})})]}),Me?(0,H.jsx)(pp,{}):Ne?(0,H.jsx)(Vp,{}):Pe?(0,H.jsx)(vp,{hidden:y.length,onShowAll:()=>Ui(!1)}):null,(0,H.jsx)(`span`,{className:`sr-only`,"aria-live":`polite`,children:T.hidden>0?o(we>0?`scene.srHiddenAny`:`scene.srHidden`,{n:y.length-T.hidden,hidden:T.hidden}):o(`scene.sr`,{n:y.length})}),(0,H.jsx)(`span`,{className:`sr-only`,"aria-live":`polite`,children:O===void 0?``:o(`scene.selected`,{n:O})}),(0,H.jsx)(dp,{engine:j}),f?(0,H.jsxs)(H.Fragment,{children:[(0,H.jsx)(`div`,{className:`arrange-wrap`,"data-scene-ui":!0,children:(0,H.jsx)(ts,{engine:j})}),!Me&&!Ne?(0,H.jsx)(op,{engine:j,zoom:k,moved:ne,canReset:ie||oe}):null]}):null,(0,H.jsx)(jp,{engine:j})]},`canvas`)}var Wp=160,Gp=`a[href],button:not([disabled]),input:not([disabled]),select:not([disabled]),textarea:not([disabled]),[tabindex]:not([tabindex="-1"])`,Kp=0;function qp(e){Kp=Math.max(0,Kp+(e?1:-1));let t=Kp>0;for(let e of document.querySelectorAll(`[data-modal-inert]`))e.inert=t}var Jp=[];function Yp(e){e.key!==`Escape`||e.defaultPrevented||e.isComposing||(e.preventDefault(),Jp[Jp.length-1]?.())}function Xp({open:e,onClose:t,label:n,width:r,children:i,initialFocus:a}){let{present:o,closing:s}=kl(e,Wp),c=(0,l.useRef)(null),u=(0,l.useRef)(null);(0,l.useEffect)(()=>{if(!e)return;u.current=document.activeElement,qp(!0);let t=c.current;return((a?t?.querySelector(a):null)??t?.querySelector(Gp)??t)?.focus(),()=>{qp(!1);let e=u.current;e&&e.isConnected&&e.focus()}},[e,a]);let d=(0,l.useRef)(t);d.current=t,(0,l.useEffect)(()=>{if(!e)return;let t=()=>d.current();return Jp.push(t),Jp.length===1&&document.addEventListener(`keydown`,Yp),()=>{Jp.splice(Jp.indexOf(t),1),Jp.length===0&&document.removeEventListener(`keydown`,Yp)}},[e]);let f=(0,l.useCallback)(e=>{if(e.key===`Escape`&&!e.nativeEvent.isComposing){e.stopPropagation(),e.preventDefault(),t();return}if(e.key!==`Tab`)return;let n=c.current;if(!n)return;let r=[...n.querySelectorAll(Gp)].filter(e=>e.offsetParent!==null&&e.tabIndex>=0||e===document.activeElement);if(r.length===0){e.preventDefault();return}let i=r[0],a=r[r.length-1];e.shiftKey&&document.activeElement===i?(e.preventDefault(),a?.focus()):!e.shiftKey&&document.activeElement===a&&(e.preventDefault(),i?.focus())},[t]);return o?(0,x.createPortal)((0,H.jsxs)(`div`,{className:`overlay`,"data-closing":s?``:void 0,onKeyDown:f,children:[(0,H.jsx)(`div`,{className:`overlay-backdrop`,onClick:t,"aria-hidden":`true`}),(0,H.jsx)(`div`,{ref:c,className:`overlay-panel`,role:`dialog`,"aria-modal":`true`,"aria-label":n,tabIndex:-1,style:r?{width:r}:void 0,children:i})]}),document.body):null}function Zp(){let e=V(),t=I(z,e=>e.confirm),n=(0,l.useRef)(void 0),[r,i]=(0,l.useState)(!1);t&&(n.current=t);let a=t??n.current,o=async()=>{if(t&&!r){i(!0);try{await t.onConfirm()}finally{i(!1),ra()}}};return(0,H.jsx)(Xp,{open:t!==void 0,onClose:()=>!r&&ra(),label:a?.title??e(`confirm.label`),width:400,initialFocus:`[data-autofocus]`,children:a?(0,H.jsxs)(`div`,{className:`confirm`,children:[(0,H.jsx)(`div`,{className:`confirm-icon`,"data-tone":a.tone??`default`,children:(0,H.jsx)(U,{name:a.tone===`danger`?`trash`:`info`,size:20})}),(0,H.jsx)(`h2`,{className:`confirm-title`,children:a.title}),a.body?(0,H.jsx)(`p`,{className:`confirm-body`,children:a.body}):null,(0,H.jsxs)(`div`,{className:`confirm-actions`,children:[(0,H.jsx)(`button`,{type:`button`,className:`btn btn--ghost`,"data-autofocus":!0,disabled:r,onClick:ra,children:e(`common.cancel`)}),(0,H.jsxs)(`button`,{type:`button`,className:`btn ${a.tone===`danger`?`btn--danger`:`btn--primary`}`,disabled:r,"aria-busy":r||void 0,onClick:()=>void o(),children:[r?(0,H.jsx)(W,{size:13}):null,a.confirmLabel]})]})]}):null})}var Qp={info:`info`,success:`check`,warn:`alert`,error:`alert`};function $p({id:e,action:t}){return(0,H.jsx)(`button`,{type:`button`,className:`link-btn toast-action`,onClick:()=>{Oi(e),t.run()},children:t.label})}function em(){let e=V(),t=I(z,e=>e.toasts);return(0,H.jsx)(`div`,{className:`toasts`,role:`region`,"aria-label":e(`toast.region`),children:t.map(t=>(0,H.jsxs)(`div`,{className:`toast`,"data-tone":t.tone,role:t.tone===`error`?`alert`:`status`,children:[(0,H.jsx)(U,{name:Qp[t.tone],size:15,strokeWidth:t.tone===`success`?2.2:1.7}),(0,H.jsx)(`span`,{className:`toast-text`,children:t.text}),t.action?(0,H.jsx)($p,{id:t.id,action:t.action}):null,(0,H.jsx)(`button`,{type:`button`,className:`icon-btn icon-btn--bare`,"aria-label":e(`common.dismiss`),onClick:()=>Oi(t.id),children:(0,H.jsx)(U,{name:`close`,size:13,strokeWidth:2})})]},t.id))})}function tm(e,t,n){let r=Date.parse(e);if(Number.isNaN(r))return``;let i=Math.max(0,Math.floor((t-r)/1e3));if(i<60)return n===`zh`?`刚刚`:`now`;let a=Math.floor(i/60);if(a<60)return`${a}m`;let o=Math.floor(a/60);if(o<24)return`${o}h`;let s=Math.floor(o/24);if(s<30)return`${s}d`;let c=Math.floor(s/30);return c<12?`${c}mo`:`${Math.floor(s/365)}y`}function nm({workspaces:e,sessions:t,currentScope:n,branches:r}){let i=V(),a=$a(),o=I(z,e=>e.switcherOpen),s=I(z,e=>e.recentOrigins),[c,u]=(0,l.useState)(``),[d,f]=(0,l.useState)(`all`),[m,h]=(0,l.useState)(!1),[g,_]=(0,l.useState)(!1),[v,y]=(0,l.useState)(0),[b,x]=(0,l.useState)(()=>Date.now()),S=(0,l.useRef)(null),C=(0,l.useRef)(null);(0,l.useEffect)(()=>{o&&(u(``),f(`all`),h(!1),_(!1),y(0),x(Date.now()))},[o]),(0,l.useEffect)(()=>{if(!g)return;let e=e=>{C.current?.contains(e.target)||_(!1)};return document.addEventListener(`pointerdown`,e),()=>document.removeEventListener(`pointerdown`,e)},[g]);let w=(0,l.useMemo)(()=>ui({query:c,workspaces:e,sessions:t,currentScope:n,recentOrigins:s,...r?{branches:r}:{},t:i,lang:a}),[c,e,t,n,s,r,i,a]),T=(0,l.useMemo)(()=>{let e;if(d===`sessions`){let n=c.trim().toLowerCase(),r=n?n.split(/\s+/).filter(Boolean):[];e=[...t].sort((e,t)=>(t.updatedAt||t.createdAt).localeCompare(e.updatedAt||e.createdAt)).filter(e=>{if(r.length===0)return!0;let t=[e.title,e.id,e.harness,e.cwd,e.model?.label,e.model?.resolved].filter(Boolean).join(` `).toLowerCase();return r.every(e=>t.includes(e))}).slice(0,24).map(e=>({kind:`session`,id:`ses:${e.id}`,session:e}))}else e=d===`workspaces`?w.filter(e=>e.kind===`workspace`):w.filter(e=>e.kind!==`view`);return m?e.filter(e=>e.kind===`workspace`?e.item.working>0||e.item.attention>0:e.kind===`session`?Ht(e.session.phase)||e.session.phase===`ready`||(e.session.attention?.length??0)>0:!1):e},[w,d,m,c,t]);(0,l.useEffect)(()=>{y(0)},[c,d,m]);let E=T.length===0?-1:Math.min(v,T.length-1);(0,l.useEffect)(()=>{!o||E<0||(S.current?.querySelector(`[data-sw-index="${E}"]`))?.scrollIntoView({block:`nearest`})},[o,E]);let D=e=>{Xi(),e.kind===`workspace`?Pi({kind:`origin`,key:e.item.key}):e.kind===`view`?Pi(e.scope):Ni({kind:`session`,id:e.session.id})},O=e=>{if(!e.nativeEvent.isComposing){if(e.key===`ArrowDown`)e.preventDefault(),T.length>0&&y(e=>(e+1)%T.length);else if(e.key===`ArrowUp`)e.preventDefault(),T.length>0&&y(e=>(e-1+T.length)%T.length);else if(e.key===`Enter`){e.preventDefault();let t=E>=0?T[E]:void 0;t&&D(t)}}},ee=i(d===`workspaces`?`switcher.scopeWorkspaces`:d===`sessions`?`switcher.scopeSessions`:`switcher.scopeAll`),k=E>=0?T[E]:void 0;return(0,H.jsx)(Xp,{open:o,onClose:Xi,label:i(`switcher.title`),width:620,initialFocus:`.switcher-input`,children:(0,H.jsxs)(`div`,{className:`switcher`,onKeyDown:e=>{e.key===`Escape`&&g&&!e.nativeEvent.isComposing&&(e.stopPropagation(),e.preventDefault(),_(!1))},children:[(0,H.jsxs)(`div`,{className:`switcher-bar`,children:[(0,H.jsxs)(`div`,{className:`switcher-scope-wrap`,ref:C,children:[(0,H.jsxs)(`button`,{type:`button`,className:`switcher-scope`,"aria-haspopup":`menu`,"aria-expanded":g,onClick:()=>_(e=>!e),children:[(0,H.jsx)(`span`,{children:ee}),(0,H.jsx)(U,{name:`chevronDown`,size:12,strokeWidth:2})]}),g?(0,H.jsxs)(`div`,{className:`switcher-scope-menu`,role:`menu`,children:[[[`all`,i(`switcher.scopeAll`)],[`workspaces`,i(`switcher.scopeWorkspaces`)],[`sessions`,i(`switcher.scopeSessions`)]].map(([e,t])=>(0,H.jsxs)(`button`,{type:`button`,role:`menuitemradio`,"aria-checked":d===e,className:`switcher-scope-option`,"data-active":d===e?``:void 0,onClick:()=>{f(e),_(!1)},children:[(0,H.jsx)(`span`,{children:t}),d===e?(0,H.jsx)(U,{name:`check`,size:12}):null]},e)),(0,H.jsx)(`div`,{className:`switcher-scope-sep`,role:`separator`}),(0,H.jsx)(`button`,{type:`button`,role:`menuitem`,className:`switcher-scope-option`,onClick:()=>{Xi(),Pi({kind:`active`})},children:(0,H.jsx)(`span`,{children:i(`rail.active`)})}),(0,H.jsx)(`button`,{type:`button`,role:`menuitem`,className:`switcher-scope-option`,onClick:()=>{Xi(),Pi({kind:`all`})},children:(0,H.jsx)(`span`,{children:i(`rail.all`)})})]}):null]}),(0,H.jsx)(`input`,{type:`text`,className:`switcher-input`,value:c,onChange:e=>u(e.target.value),onKeyDown:O,placeholder:i(`switcher.placeholder`),"aria-label":i(`switcher.title`),role:`combobox`,"aria-expanded":`true`,"aria-controls":`ensemble-switcher-list`,"aria-activedescendant":k?`sw-${k.id}`:void 0,autoComplete:`off`,spellCheck:!1}),(0,H.jsx)(`button`,{type:`button`,className:`switcher-filter-btn`,"aria-label":i(`switcher.activeOnly`),"aria-pressed":m,"data-active":m?``:void 0,"data-tip":i(`switcher.activeOnly`),onClick:()=>h(e=>!e),children:(0,H.jsx)(U,{name:`filterLines`,size:15})})]}),(0,H.jsx)(`div`,{id:`ensemble-switcher-list`,ref:S,className:`switcher-list`,role:`listbox`,"aria-label":i(`switcher.title`),children:T.length===0?(0,H.jsx)(`div`,{className:`switcher-empty`,children:i(`switcher.empty`)}):T.map((e,t)=>{let n=t===E;if(e.kind===`workspace`){let{item:r}=e,o=r.hostTitle?r.hostTitle:r.origin.kind===`user`?`${i(`origin.user`)} · ${Et(r.startedAt,a,!0)}`:r.origin.sessionRef?.id?`${r.origin.hostLabel} · ${p(r.origin.sessionRef.id,8)}`:`${r.origin.hostLabel} · ${Et(r.startedAt,a,!0)}`,s=r.workspace?It(r.workspace):void 0,c=tm(r.latestAt,b,a);return(0,H.jsxs)(`button`,{id:`sw-${e.id}`,type:`button`,role:`option`,"aria-selected":n,"data-active":n?``:void 0,"data-sw-index":t,className:`switcher-item`,onMouseEnter:()=>y(t),onClick:()=>D(e),children:[r.running>0?(0,H.jsx)(`i`,{className:`a-run switcher-live-dot`,"aria-hidden":`true`}):null,(0,H.jsx)(`span`,{className:`switcher-primary`,children:o}),s?(0,H.jsxs)(`span`,{className:`switcher-dir`,children:[(0,H.jsx)(U,{name:`folder`,size:12.5,className:`switcher-dir-ico`}),(0,H.jsx)(`span`,{children:s})]}):null,(0,H.jsx)(`span`,{className:`switcher-age num`,children:c})]},e.id)}if(e.kind===`session`){let{session:r}=e,i=r.cwd?It(r.cwd):e.workspaceTitle,o=tm(r.updatedAt||r.createdAt,b,a),s=Ht(r.phase);return(0,H.jsxs)(`button`,{id:`sw-${e.id}`,type:`button`,role:`option`,"aria-selected":n,"data-active":n?``:void 0,"data-sw-index":t,className:`switcher-item`,onMouseEnter:()=>y(t),onClick:()=>D(e),children:[s?(0,H.jsx)(`i`,{className:`a-run switcher-live-dot`,"aria-hidden":`true`}):null,(0,H.jsx)(`span`,{className:`switcher-primary`,children:r.title}),i?(0,H.jsxs)(`span`,{className:`switcher-dir`,children:[(0,H.jsx)(U,{name:`folder`,size:12.5,className:`switcher-dir-ico`}),(0,H.jsx)(`span`,{children:i})]}):null,(0,H.jsx)(`span`,{className:`switcher-age num`,children:o})]},e.id)}return null})})]})})}var rm={ArrowUp:{axis:`vertical`,to:`prev`},ArrowDown:{axis:`vertical`,to:`next`},ArrowLeft:{axis:`horizontal`,to:`prev`},ArrowRight:{axis:`horizontal`,to:`next`},Home:{axis:`both`,to:`first`},End:{axis:`both`,to:`last`}};function im(e,t,n,r){let i=n-1;return e===`first`?0:e===`last`?i:e===`next`?t<i?t+1:r?0:i:t>0?t-1:r?i:0}function am(e,t,n){if(e.altKey||e.ctrlKey||e.metaKey||e.shiftKey||e.nativeEvent.isComposing)return;let r=Object.hasOwn(rm,e.key)?rm[e.key]:void 0;if(!r||r.axis!==`both`&&n.axis!==`both`&&r.axis!==n.axis)return;let i=e.target,a=t.findIndex(e=>e===i||e.contains(i));if(a<0)return;e.preventDefault();let o=t[im(r.to,a,t.length,n.wrap??!1)];return o?.focus(),o}function om(e){return e.defaultModel??e.models.find(e=>e.isDefault)?.id}function sm(e,t){return e!==void 0&&Object.hasOwn(e,t)?e[t]:void 0}function cm(e,t){return t?e.filter(e=>t.includes(e)):[...e]}function lm(e,t){if(t===void 0)return{model:e,limited:!1,narrowed:!1};let n=e.efforts??[];if(n.length===0){let n=t[0];return n===void 0?void 0:{model:{...e,efforts:[...t],defaultEffort:n},limited:!0,narrowed:!0}}let r=cm(n,t),i=r[0];if(i===void 0)return;let a=e.defaultEffort!==void 0&&r.includes(e.defaultEffort)?e.defaultEffort:i;return{model:{...e,efforts:r,defaultEffort:a},limited:!0,narrowed:r.length<n.length}}function um(e){let t=t=>{let n=lm(t,sm(e.allowedEfforts,t.id));return n?[n]:[]};if(e.allowedModels===void 0)return e.models.flatMap(t);let n=new Set(e.allowedModels);return e.models.length===0?[...n].flatMap(e=>t({id:e,label:e})):e.models.filter(e=>n.has(e.id)).flatMap(t)}function dm(e){return e.allowedEfforts!==void 0&&Object.keys(e.allowedEfforts).length>0}function fm(e,t){return e.models.some(e=>e.id===t)||sm(e.allowedEfforts,t)!==void 0}function pm(e){if(e.modelSettingsIssue)return{kind:`blocked`,issue:e.modelSettingsIssue,models:[],defaultModel:void 0};let t=om(e),n=um(e).map(e=>e.model),r=n[0],i=e.userDefaultModel,a=i!==void 0&&n.some(e=>e.id===i),o=i===void 0||a?{}:{staleDefault:{id:i,why:e.models.some(e=>e.id===i)?`not_allowed`:`missing`}};if(e.allowedModels===void 0){if(!r&&e.models.length>0)return{kind:`empty`,models:[],defaultModel:void 0};if(a)return{kind:`unrestricted`,models:n,defaultModel:i,defaultSource:`user`};let s=t!==void 0&&e.models.some(e=>e.id===t)&&!n.some(e=>e.id===t),c=s?r?.id:t;return{kind:`unrestricted`,models:n,defaultModel:c,defaultSource:c===void 0?void 0:s?`first_open`:`harness`,...o}}if(!r)return{kind:`empty`,models:[],defaultModel:void 0};if(a)return{kind:`restricted`,models:n,defaultModel:i,defaultSource:`user`};let s=t!==void 0&&n.some(e=>e.id===t);return{kind:`restricted`,models:n,defaultModel:s?t:r.id,defaultSource:s?`harness`:`first_open`,...o}}function mm(e,t){let n=um(e).find(e=>e.model.id===t);if(n)return n;if(!e.models.some(e=>e.id===t))return lm({id:t,label:t},sm(e.allowedEfforts,t))}function hm(e,t,n){let r=pm(e);if(r.kind===`blocked`)return{ok:!1,reason:`settings_unavailable`,issue:r.issue};if(r.kind===`empty`)return{ok:!1,reason:`none_allowed`,allowed:[]};let i=r.kind===`unrestricted`;if(!i&&t!==void 0&&!r.models.some(e=>e.id===t))return{ok:!1,reason:`not_allowed`,allowed:r.models.map(e=>e.id)};let a=t??r.defaultModel,o=!i||dm(e);if(i&&o&&(a===void 0||!fm(e,a)))return{ok:!1,reason:`model_unverified`,allowed:r.models.map(e=>e.id)};let s=n;if(a!==void 0){let t=mm(e,a);if(!t)return{ok:!1,reason:`effort_not_allowed`,model:a,allowed:[]};if(t.limited){let e=t.model.efforts??[];if(s!==void 0&&!e.includes(s))return{ok:!1,reason:`effort_not_allowed`,model:a,allowed:e};s??=t.model.defaultEffort}}let c=t===void 0&&r.defaultSource===`user`;return{ok:!0,model:o||c?a:t,...s===void 0?{}:{effort:s}}}var gm={invalid_entry:`harness.modelSettings.invalid_entry`,unreadable_file:`harness.modelSettings.unreadable_file`},_m={missing:`harness.defaultStale.missing`,not_allowed:`harness.defaultStale.not_allowed`};function vm(e,t){return t===void 0?e.modelSettingsIssue?{allowed:[],efforts:{},userDefaultModel:null}:{allowed:e.allowedModels??null,efforts:e.allowedEfforts??{},userDefaultModel:e.userDefaultModel??null}:t}function ym(e,t){return vm(e,t).userDefaultModel}function bm(e,t){return vm(e,t).allowed}function xm(e,t){return vm(e,t).efforts}function Sm(e,t,n){let r=z.get(),i=r.harnesses.find(t=>t.id===e);if(!i)return;let a=i.models.map(e=>e.id),o=new Set(bm(i,r.pendingModelSettings[e])??a);for(let e of t)n?o.add(e):o.delete(e);Tm(e,{allowed:[...new Set([...a,...o])].filter(e=>o.has(e))})}function Cm(e,t,n,r){let i=z.get(),a=i.harnesses.find(t=>t.id===e),o=a?.models.find(e=>e.id===t)?.efforts??[];if(!a||!o.includes(n))return;let s=xm(a,i.pendingModelSettings[e]),c=sm(s,t),l=new Set(cm(o,c));r?l.add(n):l.delete(n);let u=o.filter(e=>l.has(e));if(u.length===0)return;let d=(c??[]).filter(e=>!o.includes(e));Tm(e,{efforts:{...s,[t]:[...u,...d]}})}function wm(e,t){let{harnesses:n,pendingModelSettings:r}=z.get(),i=n.find(t=>t.id===e);if(!i)return;let a=xm(i,r[e]);if(!Object.hasOwn(a,t))return;let{[t]:o,...s}=a;Tm(e,{efforts:s})}function Tm(e,t){let{pendingModelSettings:n,harnesses:r}=z.get(),i=r.find(t=>t.id===e);if(i?.modelSettingsIssue===`unreadable_file`)return;let a=n[e],o={...i?vm(i,a):a??{allowed:null,efforts:{},userDefaultModel:null},...t},s=o.allowed!==null&&o.userDefaultModel!==null&&!o.allowed.includes(o.userDefaultModel);z.set({pendingModelSettings:{...n,[e]:s?{...o,userDefaultModel:null}:o}}),a===void 0&&Dm(e)}function Em(e,t){Tm(e,{userDefaultModel:t})}async function Dm(e){for(;;){let{pendingModelSettings:t,lang:n,harnesses:r}=z.get(),i=t[e];if(i===void 0)return;let a=r.find(t=>t.id===e)?.userDefaultModel??null,o=i.userDefaultModel===a?void 0:i.userDefaultModel,s=await sa(()=>N.setAllowedModels(e,i.allowed,i.efforts,o),it(n,`harness.modelsSaveFailed`));s&&ca(s.harness);let c=z.get().pendingModelSettings;if(c[e]!==i)continue;let{[e]:l,...u}=c;z.set({pendingModelSettings:u});return}}function Om(e){return e===`needs_setup`?`amber`:e===`unavailable`?`red`:`neutral`}function km(e,t){let n=e.setup;if(!n)return;let r=`setup.${n.code}`,i=t(r);return i===r?n.message:/probe_failed$/.test(n.code)&&n.message?t(`setup.withReason`,{headline:i,reason:n.message}):i}var Am=8,jm=e=>Ja({resolved:e.id,label:e.label});function Mm({info:e}){let t=V(),n=I(z,t=>t.pendingModelSettings[e.id]),r=e.models,[i,a]=(0,l.useState)(``),[o,s]=(0,l.useState)(null),[c,u]=(0,l.useState)(new Set),d=(0,l.useId)(),f=bm(e,n),p=xm(e,n),m=ym(e,n),h=n===void 0?e.modelSettingsIssue:void 0;if(r.length===0||h===`unreadable_file`)return(0,H.jsx)($s,{title:t(`harness.modelsAllowed`),defaultOpen:!0,children:(0,H.jsx)(`p`,{className:`muted`,role:h?`status`:void 0,children:t(h?gm[h]:`harness.noModels`)})});let g=new Set(f??r.map(e=>e.id)),_=i.trim().toLowerCase(),v=_?r.filter(e=>e.label.toLowerCase().includes(_)||e.id.toLowerCase().includes(_)):r,y=r.filter(e=>g.has(e.id)).length,b=v.filter(e=>g.has(e.id)).length,x=r.some(e=>jm(e)!==void 0),S=om(e),C=pm({...e,allowedModels:f??void 0,allowedEfforts:p,userDefaultModel:m??void 0,modelSettingsIssue:h}),w=C.defaultModel,T=`defaultSource`in C&&C.defaultSource===`user`?C.defaultModel:void 0,E=`staleDefault`in C?C.staleDefault:void 0,D=T===void 0&&y>0&&S!==void 0&&w!==void 0&&w!==S,O=e=>(r.find(t=>t.id===e)?.label??e??t(`harness.defaultUnnamed`)).replace(/ /g,`\xA0`).replace(/-/g,`-⁠`),ee=`${d}-default`,k=e=>u(t=>{if(!e.some(e=>t.has(e)))return t;let n=new Set(t);for(let t of e)n.delete(t);return n}),te=(t,n)=>{k(t.filter(e=>g.has(e)!==n)),s(!n&&m!==null&&t.includes(m)?m:null),Sm(e.id,t,n)},ne=t=>{s(null),Em(e.id,t)},re=()=>{s(null),Em(e.id,null)},ie=e=>u(t=>{let n=new Set(t);return n.delete(e)||n.add(e),n}),ae=()=>{k(r.map(e=>e.id)),s(m),Tm(e.id,{allowed:[]})};return(0,H.jsxs)($s,{className:`mcfg-section`,title:t(`harness.modelsAllowed`),count:`${y} / ${r.length}`,defaultOpen:!0,action:(0,H.jsxs)(`span`,{className:`mcfg-bulk`,children:[_?(0,H.jsx)(`button`,{type:`button`,disabled:b===v.length,onClick:()=>te(v.map(e=>e.id),!0),children:t(`harness.selectAll`)}):(0,H.jsx)(`button`,{type:`button`,disabled:f===null,"data-tip":t(`harness.allowAllTip`),onClick:()=>{s(null),Tm(e.id,{allowed:null})},children:t(`harness.allowAll`)}),(0,H.jsx)(`button`,{type:`button`,disabled:_?b===0:f?.length===0&&!h,onClick:()=>_?te(v.map(e=>e.id),!1):ae(),children:t(`harness.selectNone`)})]}),children:[r.length>Am?(0,H.jsxs)(`span`,{className:`input-wrap mcfg-filter`,children:[(0,H.jsx)(U,{name:`search`,size:14}),(0,H.jsx)(`input`,{className:`input`,value:i,placeholder:t(`harness.modelFilter`),"aria-label":t(`harness.modelFilter`),spellCheck:!1,onChange:e=>a(e.target.value),onKeyDown:e=>{e.key===`Escape`&&i&&(e.stopPropagation(),e.preventDefault(),a(``))}})]}):null,v.length===0?(0,H.jsx)(`p`,{className:`muted mcfg-empty`,children:t(`harness.modelNoMatch`)}):(0,H.jsx)(`ul`,{className:`mlist`,"data-scroll":!0,"data-marked":x?``:void 0,onKeyDown:e=>{e.target.classList.contains(`mrow-input`)&&am(e,[...e.currentTarget.querySelectorAll(`.mrow-input`)],{axis:`vertical`})},children:v.map(n=>{let i=g.has(n.id),a=jm(n),o=n.efforts??[],s=i&&o.length>0,l=sm(p,n.id),u=s?cm(o,l):[],f=s&&c.has(n.id),m=`${d}-${r.indexOf(n)}`;return(0,H.jsxs)(`li`,{className:`mitem`,"data-open":f?``:void 0,children:[(0,H.jsxs)(`div`,{className:`mline`,children:[(0,H.jsxs)(`label`,{className:`mrow`,"data-on":i?``:void 0,children:[(0,H.jsx)(`input`,{type:`checkbox`,className:`mrow-input`,checked:i,onChange:e=>te([n.id],e.currentTarget.checked)}),(0,H.jsx)(`span`,{className:`mrow-box`,"aria-hidden":`true`,children:(0,H.jsx)(U,{name:`check`,size:12,strokeWidth:3})}),x?a?(0,H.jsx)(No,{family:a,size:14}):(0,H.jsx)(U,{name:`sparkle`,size:14,strokeWidth:1.9,className:`model-glyph`}):null,(0,H.jsx)(`span`,{className:`mrow-name`,"data-tip":n.id===n.label?void 0:`${n.label}\n${n.id}`,children:n.label}),n.id===(T??S)?(0,H.jsx)(zo,{tone:`teal`,tip:n.id===T?t(`harness.defaultPicked`):void 0,children:t(`harness.default`)}):T!==void 0&&n.id===S?(0,H.jsx)(zo,{tone:`neutral`,tip:t(`harness.defaultOwnTip`),children:t(`harness.defaultOwn`)}):null]}),s?(0,H.jsxs)(`button`,{type:`button`,className:`mrow-more`,"data-state":u.length===0?`empty`:l===void 0?void 0:`limited`,"aria-expanded":f,"aria-controls":m,"aria-label":t(`harness.effortsToggle`,{name:n.label,n:u.length,total:o.length}),onClick:()=>ie(n.id),children:[(0,H.jsx)(`span`,{children:t(`harness.effortShort`)}),(0,H.jsxs)(`span`,{className:`num`,children:[u.length,`/`,o.length]}),(0,H.jsx)(U,{name:`chevronDown`,size:12,strokeWidth:2,className:`mrow-more-chevron`})]}):null,i?(0,H.jsxs)(`label`,{className:`mpick`,"data-tip":t(T===n.id?`harness.defaultPicked`:`harness.defaultPickTip`),children:[(0,H.jsx)(`input`,{type:`radio`,className:`mpick-input`,name:ee,checked:T===n.id,"aria-label":t(`harness.defaultPick`,{name:n.label}),onChange:()=>ne(n.id)}),(0,H.jsx)(`span`,{className:`mpick-dot`,"aria-hidden":`true`})]}):(0,H.jsx)(`span`,{className:`mpick`,"data-void":``,"aria-hidden":`true`})]}),f?(0,H.jsxs)(`div`,{className:`mefforts`,id:m,role:`group`,"aria-label":t(`harness.effortsGroup`,{name:n.label}),children:[o.map(r=>{let i=u.includes(r),a=i&&u.length===1;return(0,H.jsxs)(`label`,{className:`echip`,"data-on":i?``:void 0,"data-last":a?``:void 0,"data-tip":a?t(`harness.effortLast`):void 0,children:[(0,H.jsx)(`input`,{type:`checkbox`,className:`echip-input`,checked:i,"aria-disabled":a||void 0,onChange:t=>{a||Cm(e.id,n.id,r,t.currentTarget.checked)}}),(0,H.jsx)(`span`,{className:`echip-text mono`,children:r})]},r)}),l===void 0?null:(0,H.jsx)(`button`,{type:`button`,className:`link-btn`,onClick:()=>wm(e.id,n.id),children:t(`harness.effortUnlimited`)})]}):null]},n.id)})}),C.kind===`empty`||h?(0,H.jsxs)(`div`,{className:`field-note field-note--amber`,role:`status`,children:[(0,H.jsx)(U,{name:`alert`,size:14}),(0,H.jsx)(`span`,{children:t(h?gm[h]:y>0?`harness.effortsNeeded`:`harness.noneAllowed`)})]}):null,h?null:E?(0,H.jsxs)(`div`,{className:`field-note field-note--amber`,role:`status`,children:[(0,H.jsx)(U,{name:`alert`,size:14}),(0,H.jsxs)(`span`,{children:[t(_m[E.why],{stale:O(E.id),name:O(w)}),(0,H.jsx)(`button`,{type:`button`,className:`link-btn`,onClick:re,children:t(`harness.defaultRestore`)})]})]}):o===null?T===void 0?D?(0,H.jsx)(`p`,{className:`mcfg-note`,children:t(`harness.defaultSwapped`,{name:O(w)})}):null:(0,H.jsxs)(`p`,{className:`mcfg-note`,children:[t(`harness.defaultUser`,{name:O(T)}),(0,H.jsx)(`button`,{type:`button`,className:`link-btn`,onClick:re,children:t(`harness.defaultRestore`)})]}):(0,H.jsx)(`p`,{className:`mcfg-note`,role:`status`,children:C.kind===`empty`?t(`harness.defaultDroppedNone`,{dropped:O(o)}):t(`harness.defaultDropped`,{dropped:O(o),name:O(w)})})]})}var Nm=[`read_only`,`full`];function Pm({info:e,now:t,open:n,onToggle:r}){let i=V(),a=I(z,t=>t.pendingModelSettings[e.id]),o=(0,l.useId)(),s=km(e,i),c=e.status===`ready`||e.models.length>0||!!e.modelSettingsIssue,u=!!s||c,d=u&&n,f=bm(e,a),p=e.models.length>0&&e.modelSettingsIssue!==`unreadable_file`,m=f===null?e.models.length:e.models.filter(e=>f.includes(e.id)).length,h=(0,H.jsxs)(H.Fragment,{children:[(0,H.jsx)(ho,{harness:e.id,size:40}),(0,H.jsxs)(`span`,{className:`hcard-title`,children:[(0,H.jsxs)(`span`,{className:`hcard-name`,children:[no(e.id,i),e.runtime===`fixture`?(0,H.jsx)(zo,{tone:`violet`,tip:i(`run.simulatedTip`),children:i(`run.simulated`)}):null]}),(0,H.jsxs)(`span`,{className:`hcard-sub`,children:[e.version?(0,H.jsx)(`span`,{className:`mono`,children:e.version}):null,e.account?(0,H.jsx)(`span`,{children:e.account}):null,e.status===`ready`||e.status===`checking`?null:(0,H.jsx)(`span`,{children:i(`harness.checkedAt`,{time:Ot(e.checkedAt,t,i)})}),p?(0,H.jsx)(`span`,{className:`num`,children:i(`harness.allowedSummary`,{n:m,total:e.models.length})}):null]})]}),(0,H.jsxs)(zo,{tone:Om(e.status),children:[(0,H.jsx)(`span`,{className:`status-pip`,"data-status":e.status,"aria-hidden":`true`}),i(`harness.status.${e.status}`)]}),u?(0,H.jsx)(U,{name:`chevronDown`,size:14,strokeWidth:2,className:`hcard-chevron`}):null]});return(0,H.jsxs)(`article`,{className:`hcard`,"data-status":e.status,"data-open":d?``:void 0,children:[(0,H.jsx)(`h4`,{className:`hcard-head`,children:u?(0,H.jsx)(`button`,{type:`button`,className:`hcard-toggle`,"aria-expanded":d,"aria-controls":d?o:void 0,onClick:r,children:h}):(0,H.jsx)(`span`,{className:`hcard-toggle`,children:h})}),d?(0,H.jsxs)(`div`,{className:`hcard-panel`,id:o,children:[s?(0,H.jsxs)(`div`,{className:`hcard-setup`,"data-status":e.status,children:[(0,H.jsx)(U,{name:e.status===`needs_setup`?`info`:`alert`,size:14}),(0,H.jsxs)(`div`,{children:[(0,H.jsx)(`p`,{children:s}),e.setup?.command?(0,H.jsxs)(`div`,{className:`cmd`,children:[(0,H.jsx)(`code`,{className:`mono`,children:e.setup.command}),(0,H.jsx)(G,{value:e.setup.command,label:i(`harness.copyCommand`),size:12})]}):null]})]}):null,c?(0,H.jsxs)(`div`,{className:`hcard-body`,children:[(0,H.jsx)(Mm,{info:e}),(0,H.jsx)($s,{title:i(`harness.access`),defaultOpen:!1,children:(0,H.jsx)(`ul`,{className:`access-list`,children:Nm.map(t=>{let n=e.access[t];return(0,H.jsxs)(`li`,{children:[(0,H.jsx)(`span`,{className:`access-name`,children:i(`access.${t}`)}),n?(0,H.jsxs)(H.Fragment,{children:[(0,H.jsx)(zo,{tone:n.level===`enforced`?`teal`:n.level===`advisory`?`amber`:`neutral`,tip:i(`enforce.tip.${n.level}`),children:i(`enforce.${n.level}`)}),(0,H.jsx)(`span`,{className:`access-mech`,children:n.mechanism})]}):(0,H.jsx)(zo,{tone:`neutral`,children:i(`harness.accessUnsupported`)})]},t)})})})]}):null]}):null]})}function Fm(e,t){let n=e.harnesses.length;if(n!==0)return t(`settings.executors.summary`,{ready:e.harnesses.filter(e=>e.status===`ready`).length,total:n})}function Im(){let e=V(),[t,n]=(0,l.useState)(!1),r=async()=>{n(!0);let t=await sa(()=>N.harnesses(!0),e(`harness.refreshFailed`));n(!1),t&&(z.set({harnesses:t.harnesses}),Di(`success`,e(`harness.refreshed`),1600))};return(0,H.jsx)(Ro,{icon:`refresh`,label:e(`harness.refresh`),onClick:()=>void r(),disabled:t,className:t?`is-spinning`:void 0})}function Lm(){let e=V(),t=I(z,e=>e.harnesses),n=St(),[r,i]=(0,l.useState)(void 0),a=r??new Set(t.slice(0,1).map(e=>e.id));if(t.length===0)return(0,H.jsx)(`p`,{className:`muted`,children:e(`harness.none`)});let o=e=>{let t=new Set(a);t.delete(e)||t.add(e),i(t)};return(0,H.jsxs)(H.Fragment,{children:[(0,H.jsx)(`p`,{className:`settings-intro`,children:e(`harness.modelsIntro`)}),(0,H.jsx)(`div`,{className:`hlist`,onKeyDown:e=>{e.target.classList.contains(`hcard-toggle`)&&am(e,[...e.currentTarget.querySelectorAll(`button.hcard-toggle`)],{axis:`vertical`})},children:t.map(e=>(0,H.jsx)(Pm,{info:e,now:n,open:a.has(e.id),onToggle:()=>o(e.id)},e.id))})]})}function Rm(e){if(e===`unlimited`)return!0;let{min:t,max:n}=k.concurrentRunsSetting;return typeof e==`number`&&Number.isInteger(e)&&e>=t&&e<=n}`${k.concurrentRunsSetting.min}${k.concurrentRunsSetting.max}`;var zm=k.concurrentRunsSetting.min,Bm=k.concurrentRunsSetting.max;function Vm(e){return e===0?`unlimited`:e}function Hm(e,t,n){let r=Um(e),i=Vm(e.inherited.max);return n!==void 0&&!r?n.value===null?{value:i,source:e.inherited.source,stored:void 0,inherited:i,issue:void 0,pending:!0,locked:r}:{value:n.value,source:`settings`,stored:n.value,inherited:i,issue:void 0,pending:!0,locked:r}:{value:Vm(t.max),source:e.source,stored:e.stored,inherited:i,issue:e.issue,pending:!1,locked:r}}function Um(e){return e.source===`startup`||e.issue===`unreadable_file`}function Wm(e){let t=e.trim();if(!/^\d+$/.test(t))return;let n=Number(t);return Rm(n)?n:void 0}function Gm(e){return Math.min(Bm,Math.max(zm,e))}function Km(e,t){return Gm(e+t)}function qm(e,t){return e===void 0?typeof t==`number`?Gm(t):k.maxConcurrentRuns:Gm(e)}function Jm(e){let{concurrency:t,pendingConcurrency:n}=z.get();t&&!Um(t)&&(z.set({pendingConcurrency:{value:e}}),n===void 0&&Ym())}async function Ym(){for(;;){let e=z.get().pendingConcurrency;if(e===void 0)return;let t=await sa(()=>N.setConcurrency(e.value),it(z.get().lang,`settings.concurrencySaveFailed`));if(t&&z.set({capacity:t.capacity,concurrency:t.concurrency}),z.get().pendingConcurrency===e){z.set({pendingConcurrency:void 0});return}}}var Xm={settings:`settings.concurrencySource.settings`,env:`settings.concurrencySource.env`,default:`settings.concurrencySource.default`,startup:`settings.concurrencySource.startup`},Zm={invalid_value:`settings.concurrencyIssueInvalid`,unreadable_file:`settings.concurrencyIssueUnreadable`};function Qm(){let e=V(),t=I(z,e=>e.concurrency),n=I(z,e=>e.capacity),r=I(z,e=>e.pendingConcurrency),i=I(z,e=>e.conn===`live`),a=(0,l.useId)(),o=(0,l.useId)(),s=(0,l.useId)(),c=(0,l.useId)(),u=(0,l.useId)(),d=(0,l.useRef)(null),f=(0,l.useRef)(void 0),[p,m]=(0,l.useState)(void 0),h=t?Hm(t,n,r):void 0,g=h?.value,_=typeof g==`number`;if((0,l.useEffect)(()=>{typeof g==`number`&&(f.current=g)},[g]),(0,l.useEffect)(()=>{_||m(void 0)},[_]),!h)return null;let v=typeof h.value==`number`?h.value:void 0,y=t=>t===`unlimited`?e(`settings.concurrencyUnlimited`):String(t),b=p===void 0?void 0:Wm(p),x=p!==void 0&&b===void 0,S=!h.locked&&(h.stored!==void 0||h.issue===`invalid_value`),C=i&&n.max>0&&n.occupied>n.max,w=()=>{p!==void 0&&b!==void 0&&(m(void 0),b!==v&&Jm(b))},T=e=>{if(v===void 0)return;let t=Km(b??v,e);m(void 0),t!==v&&Jm(t)};return(0,H.jsxs)(`div`,{className:`setting-row setting-row--concurrency`,children:[(0,H.jsxs)(`div`,{className:`setting-text`,children:[(0,H.jsx)(`div`,{className:`setting-label`,id:a,children:e(`settings.concurrency`)}),(0,H.jsx)(`p`,{className:`setting-note`,id:o,children:e(`settings.concurrencyNote`)})]}),(0,H.jsxs)(`div`,{className:`concurrency`,children:[(0,H.jsxs)(`div`,{className:`concurrency-line`,children:[(0,H.jsxs)(`div`,{ref:d,className:`segmented setting-control`,role:`radiogroup`,"aria-labelledby":a,"aria-describedby":`${o} ${s}`,"aria-disabled":h.locked||void 0,onKeyDown:e=>{am(e,[...d.current?.querySelectorAll(`[role="radio"]`)??[]],{axis:`both`,wrap:!0})?.click()},children:[(0,H.jsx)(`button`,{type:`button`,role:`radio`,"aria-checked":_,tabIndex:_?0:-1,"data-active":_?``:void 0,disabled:h.locked,onClick:()=>{_||Jm(qm(f.current,h.inherited))},children:e(`settings.concurrencyLimited`)}),(0,H.jsx)(`button`,{type:`button`,role:`radio`,"aria-checked":!_,tabIndex:_?-1:0,"data-active":_?void 0:``,disabled:h.locked,onClick:()=>{_&&Jm(`unlimited`)},children:e(`settings.concurrencyUnlimited`)})]}),v===void 0?null:(0,H.jsxs)(`div`,{className:`concurrency-field`,children:[(0,H.jsx)(`button`,{type:`button`,className:`concurrency-step`,"aria-label":e(`settings.concurrencyDecrease`),"aria-controls":u,disabled:h.locked||v<=zm,onClick:()=>T(-1),children:(0,H.jsx)(U,{name:`minus`,size:14})}),(0,H.jsx)(`input`,{id:u,className:`concurrency-input`,type:`text`,inputMode:`numeric`,autoComplete:`off`,spellCheck:!1,role:`spinbutton`,"aria-label":e(`settings.concurrencyValue`),"aria-valuemin":zm,"aria-valuemax":Bm,"aria-valuenow":v,"aria-invalid":x||void 0,"aria-describedby":x?c:void 0,disabled:h.locked,value:p??String(v),onChange:e=>m(e.target.value),onBlur:w,onKeyDown:e=>{e.nativeEvent.isComposing||(e.key===`Enter`?(e.preventDefault(),w()):e.key===`Escape`&&p!==void 0?(e.preventDefault(),e.stopPropagation(),m(void 0)):e.key!==`ArrowUp`&&e.key!==`ArrowDown`||e.altKey||e.ctrlKey||e.metaKey||e.shiftKey||(e.preventDefault(),T(e.key===`ArrowUp`?1:-1)))}}),(0,H.jsx)(`button`,{type:`button`,className:`concurrency-step`,"aria-label":e(`settings.concurrencyIncrease`),"aria-controls":u,disabled:h.locked||v>=Bm,onClick:()=>T(1),children:(0,H.jsx)(U,{name:`plus`,size:14})})]})]}),x&&v!==void 0?(0,H.jsx)(`p`,{className:`concurrency-meta concurrency-problem`,id:c,role:`alert`,children:e(`settings.concurrencyDraftInvalid`,{min:zm,max:Bm,current:v})}):null,(0,H.jsxs)(`div`,{className:`concurrency-meta`,id:s,children:[i?(0,H.jsx)(`p`,{className:`num`,children:e(`settings.concurrencyInUse`,{occupied:n.occupied,waiting:n.waiting})}):null,C?(0,H.jsx)(`p`,{children:e(`settings.concurrencyOver`)}):null,(0,H.jsxs)(`p`,{children:[h.issue?e(Zm[h.issue],{value:y(Vm(n.max))}):e(Xm[h.source],{value:y(h.inherited)}),S?(0,H.jsxs)(H.Fragment,{children:[` `,(0,H.jsx)(`button`,{type:`button`,className:`link-btn`,onClick:()=>Jm(null),children:e(`settings.concurrencyRestore`,{value:y(h.inherited)})})]}):null]})]})]})]})}var $m=[{id:`zh`,name:`中文`,tag:`zh-CN`},{id:`en`,name:`English`,tag:`en`}];function eh(e){return $m.find(t=>t.id===e.lang)?.name}function th(){let e=V(),t=$a(),n=(0,l.useId)(),r=(0,l.useId)(),i=(0,l.useRef)(null);return(0,H.jsxs)(`div`,{className:`setting-list`,children:[(0,H.jsxs)(`div`,{className:`setting-row`,children:[(0,H.jsxs)(`div`,{className:`setting-text`,children:[(0,H.jsx)(`div`,{className:`setting-label`,id:n,children:e(`settings.language`)}),(0,H.jsx)(`p`,{className:`setting-note`,id:r,children:e(`settings.languageNote`)})]}),(0,H.jsx)(`div`,{ref:i,className:`segmented setting-control`,role:`radiogroup`,"aria-labelledby":n,"aria-describedby":r,onKeyDown:e=>{am(e,[...i.current?.querySelectorAll(`[role="radio"]`)??[]],{axis:`both`,wrap:!0})?.click()},children:$m.map(e=>(0,H.jsx)(`button`,{type:`button`,role:`radio`,lang:e.tag,"aria-checked":t===e.id,tabIndex:t===e.id?0:-1,"data-active":t===e.id?``:void 0,onClick:()=>Hi(e.id),children:e.name},e.id))})]}),(0,H.jsx)(Qm,{})]})}function nh(e,t){return e.archivedCount===void 0?void 0:t(`history.summary`,{n:e.archivedCount})}var rh={keepDays:{name:`history.keepDaysName`,lead:`history.keepDaysLead`,note:`history.keepDaysNote`,value:`history.keepDaysValue`,one:`history.unitDay`,many:`history.unitDays`,max:k.retention.maxKeepDays},keepCount:{name:`history.keepCountName`,lead:`history.keepCountLead`,note:`history.keepCountNote`,value:`history.keepCountValue`,one:`history.unitTree`,many:`history.unitTrees`,max:k.retention.maxKeepCount}};function ih(e,t){if(!/^\d+$/.test(t))return;let n=Number(t);return ka(e,n)===void 0?n:void 0}function ah({field:e,value:t,busy:n,onCommit:r}){let i=V(),a=rh[e],o=(0,l.useId)(),s=(0,l.useId)(),c=(0,l.useRef)(null),[u,d]=(0,l.useState)(!1),[f,p]=(0,l.useState)(void 0),m=t!==null||u,h=f??(t===null?``:String(t)),g=f?.trim(),_=g!==void 0&&(g===``?t!==null:ih(e,g)===void 0),v=(g===void 0?t:ih(e,g))===1?a.one:a.many;(0,l.useEffect)(()=>{u&&c.current?.focus()},[u]);let y=()=>{d(!1),p(void 0)},b=async()=>{if(f===void 0||n)return;let i=f.trim();if(i===``){t===null&&y();return}let a=ih(e,i);a!==void 0&&(a===t||await r(a),y())},x=e=>{n||(e?(d(!0),p(``)):(y(),t!==null&&r(null)))};return(0,H.jsx)(`div`,{className:`setting-row retention-row`,"data-field":e,"data-on":m?``:void 0,children:(0,H.jsxs)(`div`,{className:`setting-text`,children:[(0,H.jsxs)(`div`,{className:`retention-line`,children:[(0,H.jsxs)(`label`,{className:`retention-toggle`,children:[(0,H.jsx)(`input`,{type:`checkbox`,className:`retention-input`,checked:m,"aria-label":i(a.name),"aria-describedby":o,"aria-disabled":n||void 0,onChange:e=>x(e.currentTarget.checked)}),(0,H.jsx)(`span`,{className:`retention-box`,"aria-hidden":`true`,children:(0,H.jsx)(U,{name:`check`,size:12,strokeWidth:3})})]}),(0,H.jsx)(`span`,{className:`retention-lead`,children:i(a.lead)}),(0,H.jsx)(`input`,{ref:c,className:`retention-field`,type:`text`,inputMode:`numeric`,autoComplete:`off`,spellCheck:!1,"aria-label":i(a.value),"aria-invalid":_||void 0,"aria-describedby":_?`${o} ${s}`:o,disabled:!m,readOnly:n,placeholder:m?`1–${a.max}`:`—`,value:h,onChange:e=>p(e.target.value),onBlur:()=>void b(),onKeyDown:e=>{e.nativeEvent.isComposing||(e.key===`Enter`?(e.preventDefault(),b()):e.key===`Escape`&&f!==void 0&&(e.preventDefault(),e.stopPropagation(),y()))}}),(0,H.jsx)(`span`,{className:`retention-unit`,children:i(v)})]}),(0,H.jsx)(`p`,{className:`setting-note`,id:o,children:i(a.note)}),_?(0,H.jsx)(`p`,{className:`retention-problem`,id:s,role:`alert`,children:i(`history.invalid`,{min:1,max:a.max})}):null]})})}function oh(){let e=V(),t=$a(),n=I(z,e=>e.archivedCount),r=I(z,e=>e.retention),i=I(z,e=>Object.keys(e.sessions).length),[a,o]=(0,l.useState)(void 0),[s,c]=(0,l.useState)(!1),[u,d]=(0,l.useState)(void 0),f=n!==void 0;(0,l.useEffect)(()=>{if(!f)return;let e=new AbortController;return Da(e.signal).then(e=>o(e.lastSweep)).catch(t=>{e.signal.aborted||d(Ai(t))}),()=>e.abort()},[f]);let p=async(e,t)=>{let n=z.get().retention;if(!n||s)return!1;c(!0),d(void 0);try{let r=await Oa({...n,[e]:t});return o(r.lastSweep),!0}catch(e){return d(Ai(e)),!1}finally{c(!1)}};return f?(0,H.jsxs)(`div`,{className:`history`,children:[(0,H.jsx)(`div`,{className:`setting-list`,children:(0,H.jsxs)(`div`,{className:`setting-row`,children:[(0,H.jsxs)(`div`,{className:`setting-text`,children:[(0,H.jsx)(`div`,{className:`setting-label`,children:e(`history.sessions`)}),(0,H.jsx)(`p`,{className:`setting-note num`,children:e(`history.sessionsNote`,{n:i,m:n})})]}),(0,H.jsxs)(`button`,{type:`button`,className:`btn`,onClick:()=>{ea(),Ni({kind:`archived`})},children:[(0,H.jsx)(U,{name:`archive`,size:14}),e(`history.view`)]})]})}),(0,H.jsx)(`h4`,{className:`history-subhead`,children:e(`history.retention`)}),(0,H.jsx)(`p`,{className:`settings-intro history-intro`,children:e(`history.retentionIntro`)}),(0,H.jsx)(`div`,{className:`setting-list`,"aria-busy":s||void 0,children:r?(0,H.jsxs)(H.Fragment,{children:[(0,H.jsx)(ah,{field:`keepDays`,value:r.keepDays,busy:s,onCommit:e=>p(`keepDays`,e)}),(0,H.jsx)(ah,{field:`keepCount`,value:r.keepCount,busy:s,onCommit:e=>p(`keepCount`,e)})]}):(0,H.jsx)(`div`,{className:`setting-row`,children:(0,H.jsx)(`div`,{className:`setting-text`,children:(0,H.jsx)(`p`,{className:`setting-note history-loading`,children:e(u?`history.retentionUnavailable`:`history.retentionLoading`)})})})}),a?(0,H.jsx)(`p`,{className:`history-sweep num`,children:e(`history.lastSweep`,{time:Et(a.at,t,!0),n:a.archived})}):null,u?(0,H.jsx)(`p`,{className:`history-error`,role:`alert`,children:u}):null]}):(0,H.jsx)(`div`,{className:`setting-list`,children:(0,H.jsx)(`div`,{className:`setting-row`,children:(0,H.jsxs)(`div`,{className:`setting-text`,children:[(0,H.jsx)(`div`,{className:`setting-label`,children:e(`history.unsupported`)}),(0,H.jsx)(`p`,{className:`setting-note`,children:e(`history.unsupportedNote`)})]})})})}function sh(e){return e.trim().toLowerCase()}function ch(e){if(e.length===0)return`empty`;if(e.length>24)return`too_long`;if(!/^[a-z0-9][a-z0-9_-]*$/.test(e))return`bad_characters`;if(/^[0-9]+$/.test(e))return`digits_only`}var lh=[`read_only`,`full`];function uh(e,t){if(!e)return{usable:!1,issue:{reason:`unknown_harness`,harness:t.harness}};if(e.status!==`ready`)return{usable:!1,issue:{reason:`harness_not_ready`,harness:e.id,status:e.status}};let n=e.access[t.access];if(!n)return{usable:!1,issue:{reason:`access_unsupported`,harness:e.id,access:t.access,supported:lh.filter(t=>e.access[t])}};let r=hm(e,t.model,t.effort);if(!r.ok)return{usable:!1,issue:dh(e.id,t,r)};let i=pm(e),a=i.models,o=r.model??i.defaultModel,s=r.effort??a.find(e=>e.id===o)?.defaultEffort;return{usable:!0,effective:{harness:e.id,access:t.access,enforcement:n.level,...o===void 0?{}:{model:o},...s===void 0?{}:{effort:s}}}}function dh(e,t,n){switch(n.reason){case`settings_unavailable`:return{reason:`settings_unavailable`,harness:e,issue:n.issue};case`none_allowed`:return{reason:`no_models_open`,harness:e};case`not_allowed`:return{reason:`model_not_open`,harness:e,model:t.model??``,allowed:n.allowed};case`model_unverified`:return{reason:`model_unverified`,harness:e,...t.model===void 0?{}:{model:t.model},allowed:n.allowed};case`effort_not_allowed`:return{reason:`effort_not_open`,harness:e,model:n.model,...t.effort===void 0?{}:{effort:t.effort},allowed:n.allowed}}}function fh(e,t){return e.invalid===`name`?{usable:!1,issue:{reason:`invalid_name`}}:e.invalid!==void 0||e.harness===void 0?{usable:!1,issue:{reason:`invalid_entry`}}:uh(t,{harness:e.harness,access:e.access??`full`,...e.model===void 0?{}:{model:e.model},...e.effort===void 0?{}:{effort:e.effort}})}var ph=Object.freeze({entries:[]});function mh(e){return e!==ph}function hh(e){return{...e.harness===void 0?{}:{harness:e.harness},...e.model===void 0?{}:{model:e.model},...e.effort===void 0?{}:{effort:e.effort},...e.access===void 0?{}:{access:e.access}}}function gh(e){let t=hh(e);return t.harness===void 0?void 0:{...t,harness:t.harness}}function _h(e,t){return e.harness===t.harness&&e.model===t.model&&e.effort===t.effort&&e.access===t.access}function vh(e,t){return e.harness===t?hh(e):{harness:t,...e.access===void 0?{}:{access:e.access}}}function yh(e,t,n){let r=hh(e);if(r.model===n)return r;let{model:i,effort:a,...o}=r,s={...o,...n===void 0?{}:{model:n}};return a!==void 0&&Sh(t,n).levels.includes(a)?{...s,effort:a}:s}function bh(e,t){let{effort:n,...r}=hh(e);return t===void 0?r:{...r,effort:t}}function xh(e,t){let{access:n,...r}=hh(e);return t===void 0?r:{...r,access:t}}function Sh(e,t){if(!e)return{levels:[],fallback:void 0};let n=pm(e),r=n.models.find(e=>e.id===(t??n.defaultModel));return{levels:r?.efforts??[],fallback:r?.defaultEffort}}function Ch(e,t,n){let r=[];t===void 0&&r.push({value:``,label:n(`profiles.pickHarness`),disabled:!0});for(let t of e){let e=no(t.id,n);r.push({value:t.id,label:t.status===`ready`?e:`${e} · ${n(`harness.status.${t.status}`)}`})}return t!==void 0&&!e.some(e=>e.id===t)&&r.push({value:t,label:`${t} · ${n(`profiles.unknown`)}`}),r}function wh(e,t,n){let r=e?pm(e):void 0,i=r?.models??[],a=r?.defaultModel,o=a===void 0?void 0:i.find(e=>e.id===a)?.label??a,s=[{value:``,label:o===void 0?n(`harness.default`):`${n(`harness.default`)} · ${o}`}];for(let e of i)s.push({value:e.id,label:e.label});return t!==void 0&&!i.some(e=>e.id===t)&&s.push({value:t,label:e?.models.find(e=>e.id===t)?.label??t}),s}function Th(e,t,n,r){let{levels:i}=Sh(e,t),a=[{value:``,label:r(`harness.default`)}];for(let e of i)a.push({value:e,label:to(e,r)??e});return n!==void 0&&!i.includes(n)&&a.push({value:n,label:to(n,r)??n}),a}function Eh(e,t,n){let r=[{value:``,label:n(`harness.default`)}];for(let i of[`read_only`,`full`]){let a=n(`access.${i}`),o=e===void 0||e.access[i]!==null;r.push({value:i,label:o?a:`${a} · ${n(`harness.accessUnsupported`)}`,disabled:!o&&t!==i})}return r}function Dh(e,t){let n=sh(e);return{name:n,problem:ch(n)??(t.includes(n)?`duplicate`:void 0)}}function Oh(e,t,n){switch(e){case`empty`:return n(`profiles.name.empty`);case`too_long`:return n(`profiles.name.too_long`,{max:24});case`bad_characters`:return n(`profiles.name.bad_characters`);case`digits_only`:return n(`profiles.name.digits_only`);case`duplicate`:return n(`profiles.name.duplicate`,{name:t})}}function kh(e,t){let n=t(`settings.section.executors`);switch(e.reason){case`invalid_entry`:return t(`profiles.issue.invalid_entry`);case`invalid_name`:return t(`profiles.issue.invalid_name`);case`unknown_harness`:return t(`profiles.issue.unknown_harness`,{harness:e.harness});case`harness_not_ready`:return t(`profiles.issue.harness_not_ready`,{harness:no(e.harness,t),status:t(`harness.status.${e.status}`)});case`access_unsupported`:return t(`profiles.issue.access_unsupported`,{harness:no(e.harness,t),access:t(`access.${e.access}`)});case`settings_unavailable`:return t(`profiles.issue.settings_unavailable`,{harness:no(e.harness,t),section:n});case`no_models_open`:return t(`profiles.issue.no_models_open`,{harness:no(e.harness,t),section:n});case`model_not_open`:return t(`profiles.issue.model_not_open`,{harness:no(e.harness,t),model:e.model});case`model_unverified`:return e.model===void 0?t(`profiles.issue.model_unverified`,{harness:no(e.harness,t)}):t(`profiles.issue.model_unknown`,{harness:no(e.harness,t),model:e.model});case`effort_not_open`:return e.allowed.length===0?t(`profiles.issue.effort_none`,{model:e.model}):t(`profiles.issue.effort_not_open`,{model:e.model,effort:to(e.effort,t)??``})}}var Ah=Promise.resolve();function jh(e,t){let n=Ah.then(async()=>(await sa(e,it(z.get().lang,t)))?.profiles);return Ah=n.catch(()=>void 0),n}function Mh(e,t){return jh(()=>N.putProfile(e,t),`profiles.saveFailed`)}function Nh(e,t){return jh(()=>N.putProfile(e,{...t,create:!0}),`profiles.saveFailed`)}function Ph(e,t){return jh(()=>N.renameProfile(e,t),`profiles.saveFailed`)}function Fh(e){return jh(()=>N.removeProfile(e),`profiles.removeFailed`)}function Ih(e,t){if(!mh(e.profiles))return t(`settings.profiles.legacy`);let{entries:n,unavailable:r}=e.profiles;if(r||n.length===0)return;let i=n.filter(t=>fh(t,e.harnesses.find(e=>e.id===t.harness)).usable).length;return t(`settings.profiles.summary`,{ready:i,total:n.length})}var Lh=14;function Rh({field:e,caption:t,roleName:n,value:r,options:i,disabled:a,onPick:o}){let s=V(),c=i.find(e=>e.value===r)?.label;return(0,H.jsxs)(`label`,{className:`prof-field`,"data-field":e,children:[(0,H.jsx)(`span`,{className:`prof-cap`,children:t}),(0,H.jsx)(`span`,{className:`prof-pick`,"data-tip":c!==void 0&&c.length>Lh?c:void 0,children:(0,H.jsx)(`select`,{value:r,disabled:a,"aria-label":s(`profiles.fieldFor`,{field:t,name:n}),onChange:e=>o(e.currentTarget.value),children:i.map(e=>(0,H.jsx)(`option`,{value:e.value,disabled:e.disabled,children:e.label},e.value))})})]})}function zh({entry:e,others:t,harnesses:n,onRemove:r,onClaim:i,onRelease:a,onSaved:o}){let s=V(),c=(0,l.useId)(),[u,d]=(0,l.useState)(e?.name??``),[f,p]=(0,l.useState)(!1),[m,h]=(0,l.useState)({}),[g,_]=(0,l.useState)(void 0),v=(0,l.useRef)(0),y=(0,l.useRef)(!1),b=e?.name;(0,l.useEffect)(()=>{b!==void 0&&(d(b),p(!1))},[b]);let x=e===void 0||e.invalid!==`name`,S=e===void 0?m:g??e,C=n.find(e=>e.id===S.harness),w=e===void 0?void 0:g===void 0?e:{name:e.name,...g},T=w===void 0?void 0:fh(w,C),{name:E,problem:D}=Dh(u,t),O=f?D:void 0,ee=e?.name??(u.trim()||s(`profiles.newRole`)),k=O===void 0?T!==void 0&&!T.usable?kh(T.issue,s):e===void 0?s(`profiles.draftHint`):void 0:Oh(O,E,s),te=(e,n,r)=>{let{name:s,problem:c}=Dh(e,t),l=gh(n);c!==void 0||l===void 0?(r||e.trim()!==``)&&p(!0):y.current||(y.current=!0,i(s),Nh(s,l).then(e=>{y.current=!1,e?o(s,e):a(s)}))},ne=(t,n=!1)=>{if(e===void 0){h(t),te(u,t,n);return}let r=gh(t);if(r===void 0||_h(t,S))return;_(t);let i=++v.current;Mh(e.name,r).then(e=>{e&&la(e),v.current===i&&_(void 0)})},re=()=>{if(e===void 0){te(u,m,!1);return}if(u.trim()===``){d(e.name),p(!1);return}if(D!==void 0){p(!0);return}if(d(E),p(!1),E===e.name)return;let t=e.name;i(E),Ph(t,E).then(e=>{e?o(E,e):(a(E),d(t))})},ie=t=>{t.key===`Enter`&&!t.nativeEvent.isComposing?(t.preventDefault(),re()):t.key===`Escape`&&u!==(e?.name??``)&&(t.stopPropagation(),t.preventDefault(),d(e?.name??``),p(!1))},ae=Sh(C,S.model).levels,oe=T?.usable===!0;return(0,H.jsxs)(`li`,{className:`prof-row`,"data-draft":e===void 0?``:void 0,children:[(0,H.jsxs)(`div`,{className:`prof-id`,children:[(0,H.jsx)(`span`,{className:`status-pip prof-pip`,"data-status":T===void 0?`needs_setup`:oe?`ready`:`unavailable`,"aria-hidden":`true`}),T===void 0?null:(0,H.jsx)(`span`,{className:`sr-only`,children:s(oe?`harness.status.ready`:`harness.status.unavailable`)}),(0,H.jsx)(`input`,{className:`prof-name`,value:u,maxLength:64,placeholder:s(`profiles.namePlaceholder`),"aria-label":s(`profiles.name`),"aria-invalid":O!==void 0||void 0,"aria-describedby":k===void 0?void 0:c,autoFocus:e===void 0,autoComplete:`off`,autoCapitalize:`off`,spellCheck:!1,onChange:e=>d(e.target.value),onBlur:re,onKeyDown:ie})]}),(0,H.jsxs)(`div`,{className:`prof-fields`,children:[(0,H.jsx)(Rh,{field:`harness`,caption:s(`info.harness`),roleName:ee,value:S.harness??``,options:Ch(n,S.harness,s),disabled:!x,onPick:e=>ne(vh(S,e),!0)}),(0,H.jsx)(Rh,{field:`model`,caption:s(`info.model`),roleName:ee,value:S.model??``,options:wh(C,S.model,s),disabled:!x||C===void 0,onPick:e=>ne(yh(S,C,e===``?void 0:e))}),(0,H.jsx)(Rh,{field:`effort`,caption:s(`info.effort`),roleName:ee,value:S.effort??``,options:Th(C,S.model,S.effort,s),disabled:!x||C===void 0||ae.length===0&&S.effort===void 0,onPick:e=>ne(bh(S,e===``?void 0:e))}),(0,H.jsx)(Rh,{field:`access`,caption:s(`info.access`),roleName:ee,value:S.access??``,options:Eh(C,S.access,s),disabled:!x||C===void 0,onPick:e=>ne(xh(S,e===`read_only`||e===`full`?e:void 0))})]}),(0,H.jsx)(Ro,{className:`prof-del`,icon:`trash`,label:e===void 0?s(`profiles.discard`):s(`profiles.delete`,{name:e.name}),onClick:r}),k===void 0?null:(0,H.jsx)(`p`,{className:`prof-msg`,id:c,children:k})]})}function Bh(){let e=V(),t=I(z,e=>e.profiles),n=I(z,e=>e.harnesses),[r,i]=(0,l.useState)([]),a=(0,l.useRef)(new Map),o=(0,l.useRef)(0),s=(0,l.useRef)(null),c=e=>{let t=a.current.get(e);return t===void 0&&(t=++o.current,a.current.set(e,t)),t};if(!mh(t))return(0,H.jsx)(`p`,{className:`muted`,role:`status`,children:e(`profiles.unsupported`)});if(t.unavailable)return(0,H.jsxs)(H.Fragment,{children:[(0,H.jsx)(`p`,{className:`settings-intro`,children:e(`profiles.intro`,{section:e(`settings.section.executors`)})}),(0,H.jsx)(`p`,{className:`muted`,role:`status`,children:e(`profiles.unavailable`)})]});let u=t.entries.map(e=>e.name),d=new Set(t.entries.map(e=>c(e.name))),f=[...t.entries.map(e=>({id:c(e.name),entry:e})),...r.filter(e=>!d.has(e)).map(e=>({id:e,entry:void 0}))],p=f.length>=20,m=e=>i(t=>t.filter(t=>t!==e)),h=e=>({onClaim:t=>{a.current.set(t,e)},onRelease:t=>{a.current.get(t)===e&&a.current.delete(t)},onSaved:(t,n)=>{a.current.set(t,e);for(let[n,r]of[...a.current])r===e&&n!==t&&a.current.delete(n);m(e),la(n)}}),g=t=>na({title:e(`profiles.deleteTitle`,{name:t.name}),body:e(`profiles.deleteBody`),confirmLabel:e(`profiles.deleteConfirm`),tone:`danger`,onConfirm:async()=>{let e=await Fh(t.name);e&&(la(e),s.current?.focus())}});return(0,H.jsxs)(H.Fragment,{children:[(0,H.jsx)(`p`,{className:`settings-intro`,children:e(`profiles.intro`,{section:e(`settings.section.executors`)})}),(0,H.jsxs)(`div`,{className:`prof`,children:[(0,H.jsx)(`div`,{className:`prof-table`,children:f.length===0?(0,H.jsx)(`p`,{className:`muted prof-empty`,children:e(`profiles.empty`)}):(0,H.jsxs)(H.Fragment,{children:[(0,H.jsxs)(`div`,{className:`prof-cols`,"aria-hidden":`true`,children:[(0,H.jsx)(`span`,{children:e(`profiles.col.name`)}),(0,H.jsx)(`span`,{children:e(`info.harness`)}),(0,H.jsx)(`span`,{children:e(`info.model`)}),(0,H.jsx)(`span`,{children:e(`info.effort`)}),(0,H.jsx)(`span`,{children:e(`info.access`)})]}),(0,H.jsx)(`ul`,{className:`prof-list`,children:f.map(({id:e,entry:t})=>(0,H.jsx)(zh,{entry:t,others:t===void 0?u:u.filter(e=>e!==t.name),harnesses:n,onRemove:()=>{t===void 0?(m(e),s.current?.focus()):g(t)},...h(e)},e))})]})}),(0,H.jsxs)(`div`,{className:`prof-foot`,children:[(0,H.jsxs)(`button`,{ref:s,type:`button`,className:`btn`,disabled:p,onClick:()=>{let e=++o.current;i(t=>[...t,e])},children:[(0,H.jsx)(U,{name:`plus`,size:14}),e(`profiles.add`)]}),p?(0,H.jsx)(`span`,{className:`prof-limit`,role:`status`,children:e(`profiles.limit`,{max:20})}):null]})]})]})}var Vh=[{id:`executors`,labelKey:`settings.section.executors`,icon:`layers`,summary:Fm,Component:Lm,actions:Im},{id:`profiles`,labelKey:`settings.section.profiles`,icon:`bot`,summary:Ih,Component:Bh},{id:`general`,labelKey:`settings.section.general`,icon:`globe`,summary:eh,Component:th},{id:`history`,labelKey:`settings.section.history`,icon:`clock`,summary:nh,Component:oh}];function Hh({section:e,selected:t,ids:n}){let r=V(),i=I(z,t=>e.summary?.(t,at(t.lang)));return(0,H.jsxs)(`button`,{type:`button`,role:`tab`,id:n.tab(e.id),className:`settings-tab`,"aria-selected":t,"aria-controls":n.panel,tabIndex:t?0:-1,"data-active":t?``:void 0,onClick:()=>ta(e.id),children:[(0,H.jsx)(U,{name:e.icon,size:16}),(0,H.jsxs)(`span`,{className:`settings-tab-text`,children:[(0,H.jsx)(`span`,{className:`settings-tab-label`,children:r(e.labelKey)}),i?(0,H.jsx)(`span`,{className:`settings-tab-sub`,children:i}):null]})]})}function Uh(){let e=V(),{open:t,section:n}=I(z,e=>e.settings),r=(0,l.useId)(),i=(0,l.useRef)(null),a={tab:e=>`${r}-tab-${e}`,panel:`${r}-panel`},o=Vh.find(e=>e.id===n)??Vh[0];if(!o)return null;let{Component:s,actions:c}=o;return(0,H.jsx)(Xp,{open:t,onClose:ea,label:e(`settings.title`),width:920,initialFocus:`[role="tab"][aria-selected="true"]`,children:(0,H.jsx)(`div`,{className:`settings`,"data-section":o.id,children:(0,H.jsxs)(`div`,{className:`settings-frame`,children:[(0,H.jsxs)(`aside`,{className:`settings-side`,children:[(0,H.jsx)(`h2`,{className:`settings-title`,children:e(`settings.title`)}),(0,H.jsx)(`div`,{ref:i,className:`settings-nav`,role:`tablist`,"aria-label":e(`settings.sections`),onKeyDown:e=>{am(e,[...i.current?.querySelectorAll(`[role="tab"]`)??[]],{axis:`both`,wrap:!0})?.click()},children:Vh.map(e=>(0,H.jsx)(Hh,{section:e,selected:e===o,ids:a},e.id))})]}),(0,H.jsxs)(`section`,{className:`settings-main`,children:[(0,H.jsxs)(`header`,{className:`settings-head`,children:[(0,H.jsx)(`h3`,{className:`settings-head-title`,children:e(o.labelKey)}),(0,H.jsx)(`span`,{className:`spacer`}),c?(0,H.jsx)(c,{}):null,(0,H.jsx)(Ro,{icon:`close`,label:e(`common.close`),onClick:ea})]}),(0,H.jsx)(`div`,{className:`settings-body`,id:a.panel,role:`tabpanel`,"aria-labelledby":a.tab(o.id),"data-scroll":!0,children:(0,H.jsx)(s,{})},o.id)]})]})})})}var Wh=`ensemble:token-reload-at`,Gh=15e3,Kh=[`hello`,`snapshot`,`summary`,`events`,`removed`,`harness`,`capacity`,`profiles`,`ping`];function qh(e,t=!0){let n=z.get(),r=Qe(n,e),{sessions:i}=r;z.set({...r,harnesses:e.harnesses,capacity:e.capacity,concurrency:e.concurrency,profiles:e.profiles??ph,version:e.version,ready:!0,...t?{conn:`live`}:{}});let a=n.detail;if(a?.state){let t=i[a.id]??r.archived[a.id];t?t.seq!==a.state.seq&&zi(a.id):e.archivedCount===void 0?z.set({detail:{...a,error:`not_found`}}):zi(a.id)}else a&&!a.loading&&a.error===`failed`&&zi(a.id);n.archivedLoaded&&e.archivedCount!==void 0&&ga({force:!0}).catch(()=>void 0)}function Jh(e){switch(e.type){case`snapshot`:qh(e.snapshot);return;case`summary`:ua(e.summary);return;case`events`:Vi(e.sessionId,e.events);return;case`removed`:z.set(t=>({...Ze(t,e.sessionId),...t.detail?.id===e.sessionId?{detail:{...t.detail,error:`not_found`}}:{}}));return;case`harness`:ca(e.info);return;case`capacity`:z.set({capacity:e.capacity,concurrency:e.concurrency});return;case`profiles`:la(e.profiles);return;case`hello`:case`ping`:return}}function Yh(e){return e instanceof Ne&&e.status===403&&e.code===`invalid_token`}function Xh(e){try{let e=Number(sessionStorage.getItem(Wh)??0);if(Number.isFinite(e)&&Date.now()-e<Gh)return!1;sessionStorage.setItem(Wh,String(Date.now()))}catch{return!1}return e(),!0}function Zh(e={}){let t=e.reload??(()=>location.reload()),n,r=new AbortController,i,a=1e3,o=()=>{r.abort(),clearTimeout(i),n?.close()},s=()=>{o(),Xh(t)||z.set({conn:`offline`})},c=()=>{if(r.signal.aborted)return;n?.close();let e=new EventSource(Be());n=e;let t=()=>!r.signal.aborted&&n===e;for(let n of Kh)e.addEventListener(n,e=>{if(t())try{Jh(JSON.parse(e.data))}catch(e){console.error(`[ensemble] bad stream message`,e)}});e.addEventListener(`open`,()=>{t()&&(a=1e3,z.get().conn!==`live`&&z.set({conn:z.get().ready?`live`:`connecting`}))}),e.addEventListener(`error`,()=>{t()&&(e.readyState===EventSource.CLOSED?(z.set({conn:`offline`}),l()):z.set({conn:`reconnecting`}))})},l=()=>{clearTimeout(i),i=setTimeout(async()=>{let{signal:e}=r;if(!e.aborted)try{if(await N.state(AbortSignal.any([e,AbortSignal.timeout(5e3)])),e.aborted)return;z.set({conn:`reconnecting`}),c()}catch(t){if(e.aborted)return;Yh(t)?s():(!(t instanceof Ne)||t.status===0||t.status>=500)&&(a=Math.min(a*1.6,6e3),l())}},a)};return N.state(r.signal).then(e=>{!r.signal.aborted&&!z.get().ready&&qh(e,!1)}).catch(e=>{!r.signal.aborted&&Yh(e)&&s()}),c(),o}function Qh(e,t,n,r){let i=V(),a=(0,l.useRef)(void 0);(0,l.useEffect)(()=>{if(!r)return;if(e.kind!==`overview`||t.kind!==`origin`){a.current=void 0;return}let o=n.find(e=>e.key===t.key);if(o){a.current={key:o.key,title:si(o,i)};return}let s=a.current;if(a.current=void 0,!s||s.key!==t.key)return;let c=z.get(),l=ii(void 0,c.lastWorkspace,n);if(Pi(l),!Object.values(c.archived).some(e=>e.origin.key===s.key))return;let u=l.kind===`origin`?n.find(e=>e.key===l.key):void 0,d=u?si(u,i):l.kind===`active`?i(`rail.active`):i(`rail.all`);Di(`info`,i(`archive.spaceGone`,{name:s.title,target:d}),6e3)},[r,e,t,n,i])}function $h(e){return typeof window>`u`?()=>{}:(window.addEventListener(`resize`,e),()=>window.removeEventListener(`resize`,e))}var eg=()=>typeof window>`u`||window.innerWidth>=860;function tg(){return(0,l.useSyncExternalStore)($h,eg,()=>!0)}function ng(){let e=V();return I(z,e=>e.conn)===`offline`?(0,H.jsx)(`div`,{className:`boot boot--offline`,role:`alert`,children:(0,H.jsxs)(`div`,{className:`state-card`,children:[(0,H.jsx)(`span`,{className:`state-icon`,"data-tone":`red`,children:(0,H.jsx)(U,{name:`alert`,size:22})}),(0,H.jsx)(`h2`,{children:e(`boot.offlineTitle`)}),(0,H.jsx)(`p`,{children:e(`boot.offlineBody`)}),(0,H.jsx)(`div`,{className:`state-actions`,children:(0,H.jsxs)(`button`,{type:`button`,className:`btn btn--primary`,onClick:()=>window.location.reload(),children:[(0,H.jsx)(U,{name:`refresh`,size:14}),e(`boot.reload`)]})})]})}):(0,H.jsxs)(`div`,{className:`boot`,role:`status`,children:[(0,H.jsx)(`span`,{className:`spinner`,style:{width:18,height:18}}),(0,H.jsx)(`span`,{children:e(`boot.connecting`)})]})}function rg(){let e=I(z,e=>e.route),t=I(z,e=>e.ready),n=I(z,e=>e.sessions),r=I(z,e=>e.lastWorkspace),i=I(z,e=>e.railCollapsed),a=$a(),o=tg(),s=(0,l.useMemo)(()=>new qf,[]),c=(0,l.useMemo)(()=>Object.values(n),[n]),u=(0,l.useMemo)(()=>ri(c),[c]),d=e.kind===`session`?e.id:void 0,f=(0,l.useMemo)(()=>d?oi(c,d):void 0,[c,d]),p=(0,l.useMemo)(()=>e.kind===`session`&&f?{kind:`origin`,key:f}:ii(e.kind===`overview`?e.scope:void 0,r,u),[e,f,r,u]),m=(0,l.useMemo)(()=>p.kind===`origin`?u.find(e=>e.key===p.key):void 0,[p,u]);Qh(e,e.kind===`overview`?e.scope??r??p:p,u,t);let h=bu((0,l.useMemo)(()=>mu(c),[c]).targets),g=(0,l.useMemo)(()=>{let e=new Map;if(h.entries.size===0)return e;let t=new Map;for(let[e,n]of h.entries)n.git.branch&&t.set(Zn(e),n.git.branch);for(let n of u){if(!n.workspace)continue;let r=h.entries.get(n.workspace)?.git.branch??t.get(Zn(n.workspace));r&&e.set(n.key,r)}return e},[h.entries,u]);(0,l.useEffect)(()=>{document.documentElement.lang=a===`zh`?`zh-CN`:`en`},[a]),(0,l.useEffect)(()=>{let e=Ri(),t=Zh();return()=>{e(),t()}},[]),(0,l.useEffect)(()=>{p.kind===`origin`&&Qi(p.key)},[p]),(0,l.useEffect)(()=>{let e=e=>{if(e.isComposing)return;let t=z.get();if(t.confirm)return;let n=e.target,r=!!(n&&(n.isContentEditable||/^(input|textarea|select)$/i.test(n.tagName))),i=e.key.toLowerCase();if((e.metaKey||e.ctrlKey)&&!e.altKey&&!e.shiftKey&&i===`k`)e.preventDefault(),Zi();else if(!r){if((e.metaKey||e.ctrlKey)&&!e.altKey&&!e.shiftKey&&i===`b`&&o){if(t.settings.open||t.switcherOpen)return;e.preventDefault(),Ji(!t.railCollapsed)}else if(!(t.settings.open||t.switcherOpen)&&!document.querySelector(`[role="menu"]`)){if(!e.metaKey&&!e.ctrlKey&&!e.altKey&&(e.key===`[`||e.key===`]`)){let t=li(u,p,e.key===`]`?1:-1);t&&(e.preventDefault(),Pi(t))}else if(e.altKey&&!e.metaKey&&!e.ctrlKey&&!e.shiftKey&&(e.key===`ArrowUp`||e.key===`ArrowDown`)){let t=li(u,p,e.key===`ArrowDown`?1:-1);t&&(e.preventDefault(),Pi(t))}}}};return document.addEventListener(`keydown`,e),()=>document.removeEventListener(`keydown`,e)},[o,u,p]);let _=o&&!i,v=o&&i,y=e.kind===`archived`,b=!o&&(e.kind===`overview`||y);return(0,H.jsxs)(`div`,{className:`app`,"data-view":e.kind,"data-rail":_?`open`:v?`collapsed`:`none`,"data-topbar":b?``:void 0,children:[_?(0,H.jsx)(vs,{workspaces:u,sessions:c,currentScope:p,...d?{focusedSessionId:d}:{},...f?{focusedOriginKey:f}:{},branches:g,archivedActive:y}):v?(0,H.jsx)(ys,{}):null,(0,H.jsxs)(`div`,{className:`shell-main`,"data-modal-inert":!0,children:[b?(0,H.jsx)(bs,{currentScope:p,...m?{currentWorkspace:m}:{},archived:y}):null,(0,H.jsx)(`div`,{className:`stage`,children:t?e.kind===`session`?(0,H.jsx)(du,{id:e.id},e.id):y?(0,H.jsx)(Zo,{}):(0,H.jsx)(Up,{engine:s,scope:p,workspaces:u,gitState:h}):(0,H.jsx)(ng,{})})]}),_?null:(0,H.jsx)(xs,{tools:!1,notices:!0}),(0,H.jsx)(nm,{workspaces:u,sessions:c,currentScope:p,branches:g}),(0,H.jsx)(Uh,{}),(0,H.jsx)(Zp,{}),(0,H.jsx)(em,{}),(0,H.jsx)(Vo,{})]})}var ig=document.getElementById(`root`);if(!ig)throw Error(`Missing #root`);(0,u.createRoot)(ig).render((0,H.jsx)(rg,{}));