ensemble-plugin 0.0.0-stage → 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.
- package/.cursor-plugin/plugin.json +14 -0
- package/.mcp.json +8 -0
- package/LICENSE +21 -0
- package/NOTICE +53 -0
- package/README.md +13 -2
- package/assets/ensemble-bowtie.svg +34 -0
- package/assets/icon.svg +7 -0
- package/assets/logo.svg +8 -0
- package/dist/THIRD-PARTY-NOTICES.txt +1090 -0
- package/dist/ensemble.mjs +71699 -0
- package/dist/web/assets/antigravity-DgAQAdn3.svg +1 -0
- package/dist/web/assets/claude-BizdYttu.svg +1 -0
- package/dist/web/assets/claude-code-B8eqCvAs.svg +1 -0
- package/dist/web/assets/codex-BvkQYgV5.svg +12 -0
- package/dist/web/assets/composer-BWvu9foS.svg +1 -0
- package/dist/web/assets/cormorant-garamond-latin-300-normal-Cw-E_7L1.woff2 +0 -0
- package/dist/web/assets/cormorant-garamond-latin-400-italic-Dc_OZ8oc.woff2 +0 -0
- package/dist/web/assets/cormorant-garamond-latin-400-normal-B-1hWBU7.woff2 +0 -0
- package/dist/web/assets/cormorant-garamond-latin-500-italic-Y14P-dkT.woff2 +0 -0
- package/dist/web/assets/cormorant-garamond-latin-500-normal-BsRWmXhO.woff2 +0 -0
- package/dist/web/assets/cormorant-garamond-latin-600-normal-Co1r35X9.woff2 +0 -0
- package/dist/web/assets/cursor-D2tyRWTE.svg +12 -0
- package/dist/web/assets/deepseek-Cl8NyQEB.svg +1 -0
- package/dist/web/assets/dsh-DNAEj8if.svg +3 -0
- package/dist/web/assets/ensemble-bowtie-C5PHHV-v.svg +34 -0
- package/dist/web/assets/gemini-CGCgtdu_.svg +1 -0
- package/dist/web/assets/glm-efVYFzYJ.svg +1 -0
- package/dist/web/assets/grok-CXGI5ZJ8.svg +1 -0
- package/dist/web/assets/index-GjPJz5g5.js +48 -0
- package/dist/web/assets/index-lM4j_QFj.css +1 -0
- package/dist/web/assets/inter-latin-wght-normal-Dx4kXJAl.woff2 +0 -0
- package/dist/web/assets/jetbrains-mono-latin-wght-normal-B9CIFXIH.woff2 +0 -0
- package/dist/web/assets/kimi-CoXq7FVU.svg +1 -0
- package/dist/web/assets/llama-CBjxA_UR.svg +1 -0
- package/dist/web/assets/minimax-DgXRHG5V.svg +1 -0
- package/dist/web/assets/mistral-B4GaxyUG.svg +1 -0
- package/dist/web/assets/openai-L0iksW7i.svg +1 -0
- package/dist/web/assets/opencode-CdSE0wKU.svg +4 -0
- package/dist/web/assets/pi-DP_DEFhy.svg +6 -0
- package/dist/web/assets/qwen-2yX8JBoZ.svg +1 -0
- package/dist/web/favicon.svg +8 -0
- package/dist/web/index.html +18 -0
- package/dist/web/licenses/CORMORANT-OFL.txt +93 -0
- package/dist/web/licenses/HARNESS-MARKS.md +11 -0
- package/dist/web/licenses/MODEL-MARKS.md +33 -0
- package/dist/web/licenses/THINKING-ORBS-SWIFT-MIT.txt +22 -0
- package/dist/web/licenses/THINKING-ORBS-TS-MIT.txt +21 -0
- package/mcp.json +10 -0
- package/package.json +82 -4
- package/plugin.json +30 -0
- package/skills/ensemble-delegate/SKILL.md +196 -0
- package/skills/ensemble-delegate/scripts/watch.mjs +1170 -0
- package/skills/ensemble-delegate/scripts/watch.rules.example.json +35 -0
|
@@ -0,0 +1,48 @@
|
|
|
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&&j(x,t.startTime-e)}}}var S=!1,C=-1,w=5,T=-1;function E(){return g?!0:!(e.unstable_now()-T<w)}function D(){if(g=!1,S){var t=e.unstable_now();T=t;var i=!0;try{a:{m=!1,h&&(h=!1,v(C),C=-1),p=!0;var a=f;try{b:{for(b(t),d=n(c);d!==null&&!(d.expirationTime>t&&E());){var o=d.callback;if(typeof o==`function`){d.callback=null,f=d.priorityLevel;var s=o(d.expirationTime<=t);if(t=e.unstable_now(),typeof s==`function`){d.callback=s,b(t),i=!0;break b}d===n(c)&&r(c),b(t)}else r(c);d=n(c)}if(d!==null)i=!0;else{var u=n(l);u!==null&&j(x,u.startTime-t),i=!1}}break a}finally{d=null,f=a,p=!1}i=void 0}}finally{i?O():S=!1}}}var O;if(typeof y==`function`)O=function(){y(D)};else if(typeof MessageChannel<`u`){var k=new MessageChannel,A=k.port2;k.port1.onmessage=D,O=function(){A.postMessage(null)}}else O=function(){_(D,0)};function j(t,n){C=_(function(){t(e.unstable_now())},n)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(e){e.callback=null},e.unstable_forceFrameRate=function(e){0>e||125<e?console.error(`forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported`):w=0<e?Math.floor(1e3/e):5},e.unstable_getCurrentPriorityLevel=function(){return f},e.unstable_next=function(e){switch(f){case 1:case 2:case 3:var t=3;break;default:t=f}var n=f;f=t;try{return e()}finally{f=n}},e.unstable_requestPaint=function(){g=!0},e.unstable_runWithPriority=function(e,t){switch(e){case 1:case 2:case 3:case 4:case 5:break;default:e=3}var n=f;f=e;try{return t()}finally{f=n}},e.unstable_scheduleCallback=function(r,i,a){var o=e.unstable_now();switch(typeof a==`object`&&a?(a=a.delay,a=typeof a==`number`&&0<a?o+a:o):a=o,r){case 1:var s=-1;break;case 2:s=250;break;case 5:s=1073741823;break;case 4:s=1e4;break;default:s=5e3}return s=a+s,r={id:u++,callback:i,priorityLevel:r,startTime:a,expirationTime:s,sortIndex:-1},a>o?(r.sortIndex=a,t(l,r),n(c)===null&&r===n(l)&&(h?(v(C),C=-1):h=!0,j(x,a-o))):(r.sortIndex=s,t(c,r),m||p||(m=!0,S||(S=!0,O()))),r},e.unstable_shouldYield=E,e.unstable_wrapCallback=function(e){var t=f;return function(){var n=f;f=t;try{return e.apply(this,arguments)}finally{f=n}}}})),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 k(e){return typeof e==`object`&&!!e&&e.$$typeof===t}function A(e){var t={"=":`=0`,":":`=2`};return`$`+e.replace(/[=:]/g,function(e){return t[e]})}var j=/\/+/g;function ee(e,t){return typeof e==`object`&&e&&e.key!=null?A(``+e.key):t.toString(36)}function te(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 ne(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,ne(c(e._payload),r,i,a,o)}}if(c)return o=o(e),c=a===``?`.`+ee(e,0):a,C(o)?(i=``,c!=null&&(i=c.replace(j,`$&/`)+`/`),ne(o,r,i,``,function(e){return e})):o!=null&&(k(o)&&(o=O(o,i+(o.key==null||e&&e.key===o.key?``:(``+o.key).replace(j,`$&/`)+`/`)+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+ee(a,u),c+=ne(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+ee(a,u++),c+=ne(a,r,i,s,o);else if(s===`object`){if(typeof e.then==`function`)return ne(te(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 re(e,t,n){if(e==null)return e;var r=[],i=0;return ne(e,r,``,``,function(e){return t.call(n,e,i++)}),r}function M(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 N=typeof reportError==`function`?reportError:function(e){if(typeof window==`object`&&typeof window.ErrorEvent==`function`){var t=new window.ErrorEvent(`error`,{bubbles:!0,cancelable:!0,message:typeof e==`object`&&e&&typeof e.message==`string`?String(e.message):String(e),error:e});if(!window.dispatchEvent(t))return}else if(typeof process==`object`&&typeof process.emit==`function`){process.emit(`uncaughtException`,e);return}console.error(e)};function ie(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,N)}catch(e){N(e)}finally{t!==null&&n.types!==null&&(t.types=n.types),T.T=t}}function ae(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 ie(ae.bind(null,e))}var oe={map:re,forEach:function(e,t,n){re(e,function(){t.apply(this,arguments)},n)},count:function(e){var t=0;return re(e,function(){t++}),t},toArray:function(e){return re(e,function(e){return e})||[]},only:function(e){if(!k(e))throw Error(`React.Children.only expected to receive a single React element child.`);return e}};e.Activity=f,e.Children=oe,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=ae,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=k,e.lazy=function(e){return{$$typeof:d,_payload:{_status:-1,_result:e},_init:M}},e.memo=function(e,t){return{$$typeof:u,type:e,compare:t===void 0?null:t}},e.startTransition=ie,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`),k=Symbol.for(`react.transitional.element`),A=Symbol.for(`react.portal`),j=Symbol.for(`react.fragment`),ee=Symbol.for(`react.strict_mode`),te=Symbol.for(`react.profiler`),ne=Symbol.for(`react.consumer`),re=Symbol.for(`react.context`),M=Symbol.for(`react.forward_ref`),N=Symbol.for(`react.suspense`),ie=Symbol.for(`react.suspense_list`),ae=Symbol.for(`react.memo`),oe=Symbol.for(`react.lazy`),se=Symbol.for(`react.activity`),ce=Symbol.for(`react.legacy_hidden`),le=Symbol.for(`react.memo_cache_sentinel`),ue=Symbol.for(`react.view_transition`),de=Symbol.for(`react.recoverable`),fe=Symbol.iterator;function P(e){return typeof e!=`object`||!e?null:(e=fe&&e[fe]||e[`@@iterator`],typeof e==`function`?e:null)}var pe=Symbol.for(`react.client.reference`);function me(e){if(e==null)return null;if(typeof e==`function`)return e.$$typeof===pe?null:e.displayName||e.name||null;if(typeof e==`string`)return e;switch(e){case j:return`Fragment`;case te:return`Profiler`;case ee:return`StrictMode`;case N:return`Suspense`;case ie:return`SuspenseList`;case se:return`Activity`;case ue:return`ViewTransition`}if(typeof e==`object`)switch(e.$$typeof){case A:return`Portal`;case re:return e.displayName||`Context`;case ne:return(e._context.displayName||`Context`)+`.Consumer`;case M:var t=e.render;return e=e.displayName,e||=(e=t.displayName||t.name||``,e===``?`ForwardRef`:`ForwardRef(`+e+`)`),e;case ae:return t=e.displayName||null,t===null?me(e.type)||`Memo`:t;case oe:t=e._payload,e=e._init;try{return me(e(t))}catch{}}return null}var he=Array.isArray,F=r.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,I=a.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,ge={pending:!1,data:null,method:null,action:null},_e=[],ve=-1;function ye(e){return{current:e}}function be(e){0>ve||(e.current=_e[ve],_e[ve]=null,ve--)}function xe(e,t){ve++,_e[ve]=e.current,e.current=t}var Se=ye(null),Ce=ye(null),we=ye(null),Te=ye(null);function Ee(e,t){switch(xe(we,t),xe(Ce,e),xe(Se,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}}be(Se),xe(Se,e)}function De(){be(Se),be(Ce),be(we)}function Oe(e){var t=e.memoizedState;t!==null&&(sh._currentValue=t.memoizedState,xe(Te,e)),t=Se.current;var n=dp(t,e.type);t!==n&&(xe(Ce,e),xe(Se,n))}function ke(e){Ce.current===e&&(be(Se),be(Ce)),Te.current===e&&(be(Te),sh._currentValue=ge)}var Ae,je;function Me(e){if(Ae===void 0)try{throw Error()}catch(e){var t=e.stack.trim().match(/\n( *(at )?)/);Ae=t&&t[1]||``,je=-1<e.stack.indexOf(`
|
|
2
|
+
at`)?` (<anonymous>)`:-1<e.stack.indexOf(`@`)?`@unknown:0:0`:``}return`
|
|
3
|
+
`+Ae+e+je}var Ne=!1;function Pe(e,t){if(!e||Ne)return``;Ne=!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{Ne=!1,Error.prepareStackTrace=n}return(n=e?e.displayName||e.name:``)?Me(n):``}function Fe(e,t){switch(e.tag){case 26:case 27:case 5:return Me(e.type);case 16:return Me(`Lazy`);case 13:return e.child!==t&&t!==null?Me(`Suspense Fallback`):Me(`Suspense`);case 19:return Me(`SuspenseList`);case 0:case 15:return Pe(e.type,!1);case 11:return Pe(e.type.render,!1);case 1:return Pe(e.type,!0);case 31:return Me(`Activity`);case 30:return Me(`ViewTransition`);default:return``}}function Ie(e){try{var t=``,n=null;do t+=Fe(e,n),n=e,e=e.return;while(e);return t}catch(e){return`
|
|
7
|
+
Error generating stack: `+e.message+`
|
|
8
|
+
`+e.stack}}var Le=Object.prototype.hasOwnProperty,L=t.unstable_scheduleCallback,Re=t.unstable_cancelCallback,ze=t.unstable_shouldYield,Be=t.unstable_requestPaint,Ve=t.unstable_now,He=t.unstable_getCurrentPriorityLevel,Ue=t.unstable_ImmediatePriority,We=t.unstable_UserBlockingPriority,Ge=t.unstable_NormalPriority,Ke=t.unstable_LowPriority,qe=t.unstable_IdlePriority,Je=t.log,Ye=t.unstable_setDisableYieldValue,Xe=null,Ze=null;function R(e){if(typeof Je==`function`&&Ye(e),Ze&&typeof Ze.setStrictMode==`function`)try{Ze.setStrictMode(Xe,e)}catch{}}var z=Math.clz32?Math.clz32:et,Qe=Math.log,$e=Math.LN2;function et(e){return e>>>=0,e===0?32:31-(Qe(e)/$e|0)|0}var tt=256,nt=262144,rt=4194304;function it(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 B(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=it(n))):i=it(o):i=it(s)):(r=s&~a,r===0?(o&=s,o===0?n||(n=s&~e,n!==0&&(i=it(n))):i=it(o)):i=it(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 at(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function ot(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-z(n),i=1<<r;t|=e[r],n&=~i}return t}function st(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 ct(){var e=rt;return rt<<=1,!(rt&62914560)&&(rt=4194304),e}function lt(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function ut(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function dt(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-z(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&&ft(e,r,0),a!==0&&i===0&&e.tag!==0&&(e.suspendedLanes|=a&~(o&~t))}function ft(e,t,n){e.pendingLanes|=t,e.suspendedLanes&=~t;var r=31-z(t);e.entangledLanes|=t,e.entanglements[r]=e.entanglements[r]|1073741824|n&261930}function pt(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var r=31-z(n),i=1<<r;i&t|e[r]&t&&(e[r]|=t),n&=~i}}function mt(e,t){var n=t&-t;return n=n&42?1:ht(n),(n&(e.suspendedLanes|t))===0?n:0}function ht(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 gt(e){return e&=-e,2<e?8<e?e&134217727?32:268435456:8:2}function _t(){var e=I.p;return e===0?(e=window.event,e===void 0?32:Ch(e.type)):e}function vt(e,t){var n=I.p;try{return I.p=e,t()}finally{I.p=n}}var yt=Math.random().toString(36).slice(2),bt=`__reactFiber$`+yt,xt=`__reactProps$`+yt,St=`__reactContainer$`+yt,Ct=`__reactEvents$`+yt,wt=`__reactListeners$`+yt,Tt=`__reactHandles$`+yt,Et=`__reactResources$`+yt,Dt=`__reactMarker$`+yt,Ot=`__reactLoad$`+yt;function kt(e){delete e[bt],delete e[xt],delete e[wt],delete e[Tt]}function At(e){var t;if(t=e[bt])return t;for(var n=e.parentNode;n;){if(t=n[St]||n[bt]){if(n=t.alternate,t.child!==null||n!==null&&n.child!==null)for(e=fm(e);e!==null;){if(n=e[bt])return n;e=fm(e)}return t}e=n,n=e.parentNode}return null}function jt(e){if(e=e[bt]||e[St]){var t=e.tag;if(t===5||t===6||t===13||t===31||t===26||t===27||t===3)return e}return null}function Mt(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e.stateNode;throw Error(s(33))}function Nt(e){var t=e[Et];return t||=e[Et]={hoistableStyles:new Map,hoistableScripts:new Map},t}function Pt(e){e[Dt]=!0}function Ft(e){e[Ot]=void 0}var It=new Set,Lt={};function Rt(e,t){zt(e,t),zt(e+`Capture`,t)}function zt(e,t){for(Lt[e]=t,e=0;e<t.length;e++)It.add(t[e])}var Bt=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]*$`),Vt={},Ht={};function Ut(e){return Le.call(Ht,e)?!0:Le.call(Vt,e)?!1:Bt.test(e)?Ht[e]=!0:(Vt[e]=!0,!1)}var V=!1;function Wt(){var e=V;return V=!1,e}function Gt(e,t,n){if(Ut(t)){if(n===null)e.removeAttribute(t);else{switch(typeof n){case`undefined`:case`function`:case`symbol`:e.removeAttribute(t);return;case`boolean`:var r=t.toLowerCase().slice(0,5);if(r!==`data-`&&r!==`aria-`){e.removeAttribute(t);return}}e.setAttribute(t,n)}}}function Kt(e,t,n){if(n===null)e.removeAttribute(t);else{switch(typeof n){case`undefined`:case`function`:case`symbol`:case`boolean`:e.removeAttribute(t);return}e.setAttribute(t,n)}}function qt(e,t,n,r){if(r===null)e.removeAttribute(n);else{switch(typeof r){case`undefined`:case`function`:case`symbol`:case`boolean`:e.removeAttribute(n);return}e.setAttributeNS(t,n,r)}}function Jt(e){switch(typeof e){case`bigint`:case`boolean`:case`number`:case`string`:case`undefined`:return e;case`object`:return e;default:return``}}function H(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()===`input`&&(t===`checkbox`||t===`radio`)}function Yt(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 Xt(e){if(!e._valueTracker){var t=H(e)?`checked`:`value`;e._valueTracker=Yt(e,t,``+e[t])}}function Zt(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r=``;return e&&(r=H(e)?e.checked?`true`:`false`:e.value),e=r,e!==n&&(t.setValue(e),!0)}var Qt=/[\n"\\]/g;function $t(e){return e.replace(Qt,function(e){return`\\`+e.charCodeAt(0).toString(16)+` `})}function en(e,t,n,r,i,a,o,s){e.name=``,o!=null&&typeof o!=`function`&&typeof o!=`symbol`&&typeof o!=`boolean`?e.type=o:e.removeAttribute(`type`),t==null?o!==`submit`&&o!==`reset`||e.removeAttribute(`value`):o===`number`?(t===0&&e.value===``||e.value!=t)&&(e.value=``+Jt(t)):e.value!==``+Jt(t)&&(e.value=``+Jt(t)),t==null?n==null?r!=null&&e.removeAttribute(`value`):nn(e,Jt(n)):o===`number`&&e.value==t?nn(e,Jt(e.value)):nn(e,Jt(t)),i==null&&a!=null&&(e.defaultChecked=!!a),i!=null&&(e.checked=i&&typeof i!=`function`&&typeof i!=`symbol`),s!=null&&typeof s!=`function`&&typeof s!=`symbol`&&typeof s!=`boolean`?e.name=``+Jt(s):e.removeAttribute(`name`)}function tn(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)){Xt(e);return}n=n==null?``:``+Jt(n),t=t==null?n:``+Jt(t),s||t===e.value||(e.value=t),e.defaultValue=t}r??=i,r=typeof r!=`function`&&typeof r!=`symbol`&&!!r,e.checked=s?e.checked:!!r,e.defaultChecked=!!r,o!=null&&typeof o!=`function`&&typeof o!=`symbol`&&typeof o!=`boolean`&&(e.name=o),Xt(e)}function nn(e,t){e.defaultValue!==``+t&&(e.defaultValue=``+t)}function rn(e,t,n,r){if(e=e.options,t){t={};for(var i=0;i<n.length;i++)t[`$`+n[i]]=!0;for(n=0;n<e.length;n++)i=t.hasOwnProperty(`$`+e[n].value),e[n].selected!==i&&(e[n].selected=i),i&&r&&(e[n].defaultSelected=!0)}else{for(n=``+Jt(n),t=null,i=0;i<e.length;i++){if(e[i].value===n){e[i].selected=!0,r&&(e[i].defaultSelected=!0);return}t!==null||e[i].disabled||(t=e[i])}t!==null&&(t.selected=!0)}}function an(e,t,n){t!=null&&(t=``+Jt(t),t!==e.value&&(e.value=t),n==null)?e.defaultValue!==t&&(e.defaultValue=t):e.defaultValue=n==null?``:``+Jt(n)}function on(e,t,n,r){if(t==null){if(r!=null){if(n!=null)throw Error(s(92));if(he(r)){if(1<r.length)throw Error(s(93));r=r[0]}n=r}n??=``,t=n}n=Jt(t),e.defaultValue=n,r=e.textContent,r===n&&r!==``&&r!==null&&(e.value=r),Xt(e)}function sn(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var cn=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 ln(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||cn.has(t)?t===`float`?e.cssFloat=n:e[t]=(``+n).trim():e[t]=n+`px`}function un(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]=``,V=!0);for(var i in t)r=t[i],t.hasOwnProperty(i)&&n[i]!==r&&(ln(e,i,r),V=!0)}else for(var a in t)t.hasOwnProperty(a)&&ln(e,a,t[a])}function dn(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 fn=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`]]),pn=/^[\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 mn(e){return pn.test(``+e)?`javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')`:e}function hn(){}var gn=null;function _n(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var vn=null,yn=null;function bn(e){var t=jt(e);if(t&&(e=t.stateNode)){var n=e[xt]||null;a:switch(e=t.stateNode,t.type){case`input`:if(en(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="`+$t(``+t)+`"][type="radio"]`),t=0;t<n.length;t++){var r=n[t];if(r!==e&&r.form===e.form){var i=r[xt]||null;if(!i)throw Error(s(90));en(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&&Zt(r)}break a;case`textarea`:an(e,n.value,n.defaultValue);break a;case`select`:t=n.value,t!=null&&rn(e,!!n.multiple,t,!1)}}}var xn=!1;function Sn(e,t,n){if(xn)return e(t,n);xn=!0;try{return e(t)}finally{if(xn=!1,(vn!==null||yn!==null)&&(Ld(),vn&&(t=vn,e=yn,yn=vn=null,bn(t),e)))for(t=0;t<e.length;t++)bn(e[t])}}function Cn(e,t){var n=e.stateNode;if(n===null)return null;var r=n[xt]||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 wn=typeof window<`u`&&window.document!==void 0&&window.document.createElement!==void 0,Tn=!1;if(wn)try{var En={};Object.defineProperty(En,"passive",{get:function(){Tn=!0}}),window.addEventListener(`test`,En,En),window.removeEventListener(`test`,En,En)}catch{Tn=!1}var Dn=null,On=null,kn=null;function An(){if(kn)return kn;var e,t=On,n=t.length,r,i=`value`in Dn?Dn.value:Dn.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 kn=i.slice(e,1<r?1-r:void 0)}function jn(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 Mn(){return!0}function Nn(){return!1}function Pn(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)?Mn:Nn,this.isPropagationStopped=Nn,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=Mn)},stopPropagation:function(){var e=this.nativeEvent;e&&(e.stopPropagation?e.stopPropagation():typeof e.cancelBubble!=`unknown`&&(e.cancelBubble=!0),this.isPropagationStopped=Mn)},persist:function(){},isPersistent:Mn}),t}var Fn={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},In=Pn(Fn),Ln=D({},Fn,{view:0,detail:0}),Rn=Pn(Ln),zn,Bn,Vn,Hn=D({},Ln,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:$n,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!==Vn&&(Vn&&e.type===`mousemove`?(zn=e.screenX-Vn.screenX,Bn=e.screenY-Vn.screenY):Bn=zn=0,Vn=e),zn)},movementY:function(e){return`movementY`in e?e.movementY:Bn}}),Un=Pn(Hn),Wn=Pn(D({},Hn,{dataTransfer:0})),Gn=Pn(D({},Ln,{relatedTarget:0})),Kn=Pn(D({},Fn,{animationName:0,elapsedTime:0,pseudoElement:0})),qn=Pn(D({},Fn,{clipboardData:function(e){return`clipboardData`in e?e.clipboardData:window.clipboardData}})),Jn=Pn(D({},Fn,{data:0})),Yn={Esc:`Escape`,Spacebar:` `,Left:`ArrowLeft`,Up:`ArrowUp`,Right:`ArrowRight`,Down:`ArrowDown`,Del:`Delete`,Win:`OS`,Menu:`ContextMenu`,Apps:`ContextMenu`,Scroll:`ScrollLock`,MozPrintableKey:`Unidentified`},Xn={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`},Zn={Alt:`altKey`,Control:`ctrlKey`,Meta:`metaKey`,Shift:`shiftKey`};function Qn(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=Zn[e])?!!t[e]:!1}function $n(){return Qn}var er=Pn(D({},Ln,{key:function(e){if(e.key){var t=Yn[e.key]||e.key;if(t!==`Unidentified`)return t}return e.type===`keypress`?(e=jn(e),e===13?`Enter`:String.fromCharCode(e)):e.type===`keydown`||e.type===`keyup`?Xn[e.keyCode]||`Unidentified`:``},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:$n,charCode:function(e){return e.type===`keypress`?jn(e):0},keyCode:function(e){return e.type===`keydown`||e.type===`keyup`?e.keyCode:0},which:function(e){return e.type===`keypress`?jn(e):e.type===`keydown`||e.type===`keyup`?e.keyCode:0}})),tr=Pn(D({},Hn,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0})),nr=Pn(D({},Fn,{submitter:0})),rr=Pn(D({},Ln,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:$n})),ir=Pn(D({},Fn,{propertyName:0,elapsedTime:0,pseudoElement:0})),ar=Pn(D({},Hn,{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})),or=Pn(D({},Fn,{newState:0,oldState:0,source:0})),sr=[9,13,27,32],cr=wn&&`CompositionEvent`in window,lr=null;wn&&`documentMode`in document&&(lr=document.documentMode);var ur=wn&&`TextEvent`in window&&!lr,dr=wn&&(!cr||lr&&8<lr&&11>=lr),fr=` `,pr=!1;function mr(e,t){switch(e){case`keyup`:return sr.indexOf(t.keyCode)!==-1;case`keydown`:return t.keyCode!==229;case`keypress`:case`mousedown`:case`focusout`:return!0;default:return!1}}function hr(e){return e=e.detail,typeof e==`object`&&`data`in e?e.data:null}var gr=!1;function _r(e,t){switch(e){case`compositionend`:return hr(t);case`keypress`:return t.which===32?(pr=!0,fr):null;case`textInput`:return e=t.data,e===fr&&pr?null:e;default:return null}}function vr(e,t){if(gr)return e===`compositionend`||!cr&&mr(e,t)?(e=An(),kn=On=Dn=null,gr=!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 dr&&t.locale!==`ko`?null:t.data;default:return null}}var yr={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 br(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t===`input`?!!yr[e.type]:t===`textarea`}function xr(e,t,n,r){vn?yn?yn.push(r):yn=[r]:vn=r,t=qf(t,`onChange`),0<t.length&&(n=new In(`onChange`,`change`,null,n,r),e.push({event:n,listeners:t}))}var Sr=null,Cr=null;function wr(e){Bf(e,0)}function Tr(e){if(Zt(Mt(e)))return e}function Er(e,t){if(e===`change`)return t}var Dr=!1;if(wn){var Or;if(wn){var kr=`oninput`in document;if(!kr){var Ar=document.createElement(`div`);Ar.setAttribute(`oninput`,`return;`),kr=typeof Ar.oninput==`function`}Or=kr}else Or=!1;Dr=Or&&(!document.documentMode||9<document.documentMode)}function jr(){Sr&&(Sr.detachEvent(`onpropertychange`,Mr),Cr=Sr=null)}function Mr(e){if(e.propertyName===`value`&&Tr(Cr)){var t=[];xr(t,Cr,e,_n(e)),Sn(wr,t)}}function Nr(e,t,n){e===`focusin`?(jr(),Sr=t,Cr=n,Sr.attachEvent(`onpropertychange`,Mr)):e===`focusout`&&jr()}function Pr(e){if(e===`selectionchange`||e===`keyup`||e===`keydown`)return Tr(Cr)}function Fr(e,t){if(e===`click`)return Tr(t)}function Ir(e,t){if(e===`input`||e===`change`)return Tr(t)}function Lr(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}var Rr=typeof Object.is==`function`?Object.is:Lr;function zr(e,t){if(Rr(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(!Le.call(t,i)||!Rr(e[i],t[i]))return!1}return!0}function Br(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 Vr(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function Hr(e,t){var n=Vr(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=Vr(n)}}function Ur(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?Ur(e,t.parentNode):`contains`in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function Wr(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=Br(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=Br(e.document)}return t}function Gr(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 Kr=wn&&`documentMode`in document&&11>=document.documentMode,qr=null,Jr=null,Yr=null,Xr=!1;function Zr(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;Xr||qr==null||qr!==Br(r)||(r=qr,`selectionStart`in r&&Gr(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}),Yr&&zr(Yr,r)||(Yr=r,r=qf(Jr,`onSelect`),0<r.length&&(t=new In(`onSelect`,`select`,null,t,n),e.push({event:t,listeners:r}),t.target=qr)))}function Qr(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n[`Webkit`+e]=`webkit`+t,n[`Moz`+e]=`moz`+t,n}var $r={animationend:Qr(`Animation`,`AnimationEnd`),animationiteration:Qr(`Animation`,`AnimationIteration`),animationstart:Qr(`Animation`,`AnimationStart`),transitionrun:Qr(`Transition`,`TransitionRun`),transitionstart:Qr(`Transition`,`TransitionStart`),transitioncancel:Qr(`Transition`,`TransitionCancel`),transitionend:Qr(`Transition`,`TransitionEnd`)},ei={},ti={};wn&&(ti=document.createElement(`div`).style,`AnimationEvent`in window||(delete $r.animationend.animation,delete $r.animationiteration.animation,delete $r.animationstart.animation),`TransitionEvent`in window||delete $r.transitionend.transition);function ni(e){if(ei[e])return ei[e];if(!$r[e])return e;var t=$r[e],n;for(n in t)if(t.hasOwnProperty(n)&&n in ti)return ei[e]=t[n];return e}var ri=ni(`animationend`),ii=ni(`animationiteration`),ai=ni(`animationstart`),oi=ni(`transitionrun`),si=ni(`transitionstart`),ci=ni(`transitioncancel`),li=ni(`transitionend`),ui=new Map,di=`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(` `);di.push(`scrollEnd`);function fi(e,t){ui.set(e,t),Rt(t,[e])}var pi=0;function mi(e,t){if(e.name!=null&&e.name!==`auto`)return e.name;if(t.autoName!==null)return t.autoName;e=vd.identifierPrefix;var n=pi++;return e=`_`+e+`t_`+n.toString(32)+`_`,t.autoName=e}function hi(e){if(e==null||typeof e==`string`)return e;var t=null,n=Ed;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 gi(e,t){return e=hi(e),t=hi(t),t==null?e===`auto`?null:e:t===`auto`?null:t}var _i=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)},vi=[],yi=0,bi=0;function xi(){for(var e=yi,t=bi=yi=0;t<e;){var n=vi[t];vi[t++]=null;var r=vi[t];vi[t++]=null;var i=vi[t];vi[t++]=null;var a=vi[t];if(vi[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&&Ti(n,i,a)}}function Si(e,t,n,r){vi[yi++]=e,vi[yi++]=t,vi[yi++]=n,vi[yi++]=r,bi|=r,e.lanes|=r,e=e.alternate,e!==null&&(e.lanes|=r)}function Ci(e,t,n,r){return Si(e,t,n,r),Ei(e)}function wi(e,t){return Si(e,null,null,t),Ei(e)}function Ti(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-z(n),e=a.hiddenUpdates,r=e[i],r===null?e[i]=[t]:r.push(t),t.lane=n|536870912),a):null}function Ei(e){if(50<Dd)throw Dd=0,Od=null,Error(s(185));for(var t=e.return;t!==null;)e=t,t=e.return;return e.tag===3?e.stateNode:null}var Di={};function Oi(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 ki(e,t,n,r){return new Oi(e,t,n,r)}function Ai(e){return e=e.prototype,!(!e||!e.isReactComponent)}function ji(e,t){var n=e.alternate;return n===null?(n=ki(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 Mi(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 Ni(e,t,n,r,i,a){var o=0;if(r=e,typeof r==`function`)Ai(r)&&(o=1);else if(typeof r==`string`)o=qm(e,n,Se.current)?26:e===`html`||e===`head`||e===`body`?27:5;else a:switch(r){case se:return e=ki(31,n,t,i),e.elementType=se,e.lanes=a,e;case j:return Pi(n.children,i,a,t);case ee:o=8,i|=24;break;case te:return e=ki(12,n,t,i|2),e.elementType=te,e.lanes=a,e;case N:return e=ki(13,n,t,i),e.elementType=N,e.lanes=a,e;case ie:return e=ki(19,n,t,i),e.elementType=ie,e.lanes=a,e;case ce:case ue:return e=i|32,e=ki(30,n,t,e),e.elementType=ue,e.lanes=a,e.stateNode={autoName:null,paired:null,clones:null,ref:null},e;default:if(typeof r==`object`&&r)switch(r.$$typeof){case re:o=10;break a;case ne:o=9;break a;case M:o=11;break a;case ae:o=14;break a;case oe:o=16,r=null;break a}o=29,n=Error(s(130,e===null?`null`:typeof e,``)),r=null}return t=ki(o,n,t,i),t.elementType=e,t.type=r,t.lanes=a,t}function Pi(e,t,n,r){return e=ki(7,e,r,t),e.lanes=n,e}function Fi(e,t,n){return e=ki(6,e,null,t),e.lanes=n,e}function Ii(e){var t=ki(18,null,null,0);return t.stateNode=e,t}function Li(e,t,n){return t=ki(4,e.children===null?[]:e.children,e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}var Ri=new WeakMap;function zi(e,t){if(typeof e==`object`&&e){var n=Ri.get(e);return n===void 0?(t={value:e,source:t,stack:Ie(t)},Ri.set(e,t),t):n}return{value:e,source:t,stack:Ie(t)}}var Bi=[],Vi=0,Hi=null,Ui=0,Wi=[],Gi=0,Ki=null,qi=1,Ji=``;function Yi(e,t){Bi[Vi++]=Ui,Bi[Vi++]=Hi,Hi=e,Ui=t}function Xi(e,t,n){Wi[Gi++]=qi,Wi[Gi++]=Ji,Wi[Gi++]=Ki,Ki=e;var r=qi;e=Ji;var i=32-z(r)-1;r&=~(1<<i),n+=1;var a=32-z(t)+i;if(30<a){var o=i-i%5;a=(r&(1<<o)-1).toString(32),r>>=o,i-=o,qi=1<<32-z(t)+i|n<<i|r,Ji=a+e}else qi=1<<a|n<<i|r,Ji=e}function Zi(e){e.return!==null&&(Yi(e,1),Xi(e,1,0))}function Qi(e){for(;e===Hi;)Hi=Bi[--Vi],Bi[Vi]=null,Ui=Bi[--Vi],Bi[Vi]=null;for(;e===Ki;)Ki=Wi[--Gi],Wi[Gi]=null,Ji=Wi[--Gi],Wi[Gi]=null,qi=Wi[--Gi],Wi[Gi]=null}function $i(e,t){Wi[Gi++]=qi,Wi[Gi++]=Ji,Wi[Gi++]=Ki,qi=t.id,Ji=t.overflow,Ki=e}var ea=null,ta=null,U=!1,na=null,ra=!1,ia=Error(s(519));function aa(e){throw da(zi(Error(s(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?`text`:`HTML`,``)),e)),ia}function oa(e){var t=e.stateNode,n=e.type,r=e.memoizedProps;switch(t[bt]=e,t[xt]=r,n){case`dialog`:$(`cancel`,t),$(`close`,t);break;case`iframe`:case`object`:case`embed`:$(`load`,t);break;case`video`:case`audio`:for(n=0;n<Rf.length;n++)$(Rf[n],t);break;case`source`:$(`error`,t);break;case`img`:case`image`:case`link`:$(`error`,t),$(`load`,t);break;case`details`:$(`toggle`,t);break;case`input`:$(`invalid`,t),tn(t,r.value,r.defaultValue,r.checked,r.defaultChecked,r.type,r.name,!0);break;case`select`:$(`invalid`,t);break;case`textarea`:$(`invalid`,t),on(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||$f(t.textContent,n)?(r.popover!=null&&($(`beforetoggle`,t),$(`toggle`,t)),r.onScroll!=null&&$(`scroll`,t),r.onScrollEnd!=null&&$(`scrollend`,t),r.onClick!=null&&(t.onclick=hn),t=!0):t=!1,t||aa(e,!0)}function sa(e){for(ea=e.return;ea;)switch(ea.tag){case 5:case 31:case 13:ra=!1;return;case 27:case 3:ra=!0;return;default:ea=ea.return}}function ca(e){if(e!==ea)return!1;if(!U)return sa(e),U=!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&&ta&&aa(e),sa(e),t===13){if(e=e.memoizedState,e=e===null?null:e.dehydrated,!e)throw Error(s(317));ta=dm(e)}else if(t===31){if(e=e.memoizedState,e=e===null?null:e.dehydrated,!e)throw Error(s(317));ta=dm(e)}else t===27?(t=ta,Sp(e.type)?(e=um,um=null,ta=e):ta=t):ta=ea?lm(e.stateNode.nextSibling):null;return!0}function la(){ta=ea=null,U=!1}function ua(){var e=na;return e!==null&&(ud===null?ud=e:ud.push.apply(ud,e),na=null),e}function da(e){na===null?na=[e]:na.push(e)}var fa=ye(null),pa=null,ma=null;function ha(e,t,n){xe(fa,t._currentValue),t._currentValue=n}function ga(e){e._currentValue=fa.current,be(fa)}function _a(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 va(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),_a(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),_a(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),_a(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 ya(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;Rr(i.pendingProps.value,o.value)||(e===null?e=[c]:e.push(c))}}else if(i===Te.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&&va(t,e,n,r),t.flags|=262144,e!==null}function ba(e){for(e=e.firstContext;e!==null;){if(!Rr(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function xa(e){pa=e,ma=null,e=e.dependencies,e!==null&&(e.firstContext=null)}function Sa(e){return wa(pa,e)}function Ca(e,t){return pa===null&&xa(e),wa(e,t)}function wa(e,t){var n=t._currentValue;if(t={context:t,memoizedValue:n,next:null},ma===null){if(e===null)throw Error(s(308));ma=t,e.dependencies={lanes:0,firstContext:t},e.flags|=524288}else ma=ma.next=t;return n}var Ta=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()})}},Ea=t.unstable_scheduleCallback,W=t.unstable_NormalPriority,Da={$$typeof:re,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function Oa(){return{controller:new Ta,data:new Map,refCount:0}}function ka(e){e.refCount--,e.refCount===0&&Ea(W,function(){e.controller.abort()})}function Aa(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 ja=null;function Ma(e){var t=e.transitionTypes;return e.transitionTypes=null,t}var Na=null,Pa=0,Fa=0,Ia=null;function La(e,t){if(Na===null){var n=Na=[];Pa=0,Fa=Nf(),Ia={status:`pending`,value:void 0,then:function(e){n.push(e)}}}return Pa++,t.then(Ra,Ra),t}function Ra(){if(--Pa===0&&(ja=null,Na!==null)){Ia!==null&&(Ia.status=`fulfilled`);var e=Na;Na=null,Fa=0,Ia=null;for(var t=0;t<e.length;t++)(0,e[t])()}}function za(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 Ba=F.S;F.S=function(e,t){if(pd=Ve(),typeof t==`object`&&t&&typeof t.then==`function`&&La(e,t),ja!==null)for(var n=yf;n!==null;)Aa(n,ja),n=n.next;if(n=e.types,n!==null){for(var r=yf;r!==null;)Aa(r,n),r=r.next;if(Fa!==0){r=ja,r===null&&(r=ja=[]);for(var i=0;i<n.length;i++){var a=n[i];r.indexOf(a)===-1&&r.push(a)}}}Ba!==null&&Ba(e,t)};var Va=ye(null);function Ha(){var e=Va.current;return e===null?Xu.pooledCache:e}function Ua(e,t){t===null?xe(Va,Va.current):xe(Va,t.pool)}function Wa(){var e=Ha();return e===null?null:{parent:Da._currentValue,pool:e}}var Ga=Error(s(460)),Ka=Error(s(474)),qa=Error(s(542)),Ja={then:function(){}};function Ya(e){return e=e.status,e===`fulfilled`||e===`rejected`}function Xa(e,t,n){switch(n=e[n],n===void 0?e.push(t):n!==t&&(t.then(hn,hn),t=n),t.status){case`fulfilled`:return t.value;case`rejected`:throw e=t.reason,eo(e),e===void 0&&!(`reason`in t)?Error(s(600)):e;default:if(typeof t.status==`string`)t.then(hn,hn);else{if(e=Xu,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,eo(e),e}throw Qa=t,Ga}}function Za(e){try{var t=e._init;return t(e._payload)}catch(e){throw typeof e==`object`&&e&&typeof e.then==`function`?(Qa=e,Ga):e}}var Qa=null;function $a(){if(Qa===null)throw Error(s(459));var e=Qa;return Qa=null,e}function eo(e){if(e===Ga||e===qa)throw Error(s(483))}var to=null,no=0;function ro(e){var t=no;return no+=1,to===null&&(to=[]),Xa(to,e,t)}function io(e,t){t=t.props.ref,e.ref=t===void 0?null:t}function ao(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 oo(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=ji(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=Fi(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===j?(e=d(e,t,n.props.children,r,n.key),io(e,n),e):t!==null&&(t.elementType===a||typeof a==`object`&&a&&a.$$typeof===oe&&Za(a)===t.type)?(t=i(t,n.props),io(t,n),t.return=e,t):(t=Ni(n.type,n.key,n.props,null,e.mode,r),io(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=Li(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=Pi(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=Fi(``+t,e.mode,n),t.return=e,t;if(typeof t==`object`&&t){switch(t.$$typeof){case k:return n=Ni(t.type,t.key,t.props,null,e.mode,n),io(n,t),n.return=e,n;case A:return t=Li(t,e.mode,n),t.return=e,t;case oe:return t=Za(t),f(e,t,n)}if(he(t)||P(t))return t=Pi(t,e.mode,n,null),t.return=e,t;if(typeof t.then==`function`)return f(e,ro(t),n);if(t.$$typeof===re)return f(e,Ca(e,t),n);ao(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 k:return n.key===i?l(e,t,n,r):null;case A:return n.key===i?u(e,t,n,r):null;case oe:return n=Za(n),p(e,t,n,r)}if(he(n)||P(n))return i===null?d(e,t,n,r,null):null;if(typeof n.then==`function`)return p(e,t,ro(n),r);if(n.$$typeof===re)return p(e,t,Ca(e,n),r);ao(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 k:return e=e.get(r.key===null?n:r.key)||null,l(t,e,r,i);case A:return e=e.get(r.key===null?n:r.key)||null,u(t,e,r,i);case oe:return r=Za(r),m(e,t,n,r,i)}if(he(r)||P(r))return e=e.get(n)||null,d(t,e,r,i,null);if(typeof r.then==`function`)return m(e,t,n,ro(r),i);if(r.$$typeof===re)return m(e,t,n,Ca(t,r),i);ao(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),U&&Yi(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 U&&Yi(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)}),U&&Yi(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),U&&Yi(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 U&&Yi(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)}),U&&Yi(i,g),u}function _(e,r,a,c){if(typeof a==`object`&&a&&a.type===j&&a.key===null&&a.props.ref===void 0&&(a=a.props.children),typeof a==`object`&&a){switch(a.$$typeof){case k:a:{for(var l=a.key;r!==null;){if(r.key===l){if(l=a.type,l===j){if(r.tag===7){n(e,r.sibling),c=i(r,a.props.children),io(c,a),c.return=e,e=c;break a}}else if(r.elementType===l||typeof l==`object`&&l&&l.$$typeof===oe&&Za(l)===r.type){n(e,r.sibling),c=i(r,a.props),io(c,a),c.return=e,e=c;break a}n(e,r);break}t(e,r),r=r.sibling}a.type===j?(c=Pi(a.props.children,e.mode,c,a.key),io(c,a),c.return=e,e=c):(c=Ni(a.type,a.key,a.props,null,e.mode,c),io(c,a),c.return=e,e=c)}return o(e);case A: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=Li(a,e.mode,c),c.return=e,e=c}return o(e);case oe:return a=Za(a),_(e,r,a,c)}if(he(a))return h(e,r,a,c);if(P(a)){if(l=P(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,ro(a),c);if(a.$$typeof===re)return _(e,r,Ca(e,a),c);ao(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=Fi(a,e.mode,c),c.return=e,e=c),o(e)):n(e,r)}return function(e,t,n,r){try{no=0;var i=_(e,t,n,r);return to=null,i}catch(t){if(t===Ga||t===qa)throw t;var a=ki(29,t,null,e.mode);return a.lanes=r,a.return=e,a}}}var so=oo(!0),co=oo(!1),lo=!1;function uo(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function fo(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 po(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function mo(e,t,n){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,X&2){var i=r.pending;return i===null?t.next=t:(t.next=i.next,i.next=t),r.pending=t,t=Ei(e),Ti(e,null,n),t}return Si(e,r,t,n),Ei(e)}function ho(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,pt(e,n)}}function go(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 _o=!1;function vo(){if(_o){var e=Ia;if(e!==null)throw e}}function yo(e,t,n,r){_o=!1;var i=e.updateQueue;lo=!1;var a=i.firstBaseUpdate,o=i.lastBaseUpdate,s=i.shared.pending;if(s!==null){i.shared.pending=null;var c=s,l=c.next;c.next=null,o===null?a=l:o.next=l,o=c;var u=e.alternate;u!==null&&(u=u.updateQueue,s=u.lastBaseUpdate,s!==o&&(s===null?u.firstBaseUpdate=l:s.next=l,u.lastBaseUpdate=c))}if(a!==null){var d=i.baseState;o=0,u=l=c=null,s=a;do{var f=s.lane&-536870913,p=f!==s.lane;if(p?(Q&f)===f:(r&f)===f){f!==0&&f===Fa&&(_o=!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:lo=!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),id|=o,e.lanes=o,e.memoizedState=d}}function bo(e,t){if(typeof e!=`function`)throw Error(s(191,e));e.call(t)}function G(e,t){var n=e.callbacks;if(n!==null)for(e.callbacks=null,e=0;e<n.length;e++)bo(n[e],t)}var xo=ye(null),So=ye(0);function Co(e,t){e=nd,xe(So,e),xe(xo,t),nd=e|t.baseLanes}function wo(){xe(So,nd),xe(xo,xo.current)}function To(){nd=So.current,be(xo),be(So)}var Eo=ye(null),Do=null;function Oo(e){var t=e.alternate;xe(No,No.current&1),xe(Eo,e),Do===null&&(t===null||xo.current!==null||t.memoizedState!==null)&&(Do=e)}function ko(e){xe(No,No.current),xe(Eo,e),Do===null&&(Do=e)}function Ao(e){e.tag===22?(xe(No,No.current),xe(Eo,e),Do===null&&(Do=e)):jo()}function jo(){xe(No,No.current),xe(Eo,Eo.current)}function Mo(e){be(Eo),Do===e&&(Do=null),be(No)}var No=ye(0);function Po(e,t){xe(Eo,Eo.current),xe(No,t)}function Fo(e){be(No),be(Eo),Do===e&&(Do=null)}function Io(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 Lo=0,K=null,Ro=null,zo=null,Bo=!1,Vo=!1,Ho=!1,Uo=0,Wo=0,Go=null,Ko=0;function qo(){throw Error(s(321))}function Jo(e,t){if(t===null)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!Rr(e[n],t[n]))return!1;return!0}function Yo(e,t,n,r,i,a){return Lo=a,K=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,F.H=e===null||e.memoizedState===null?fc:pc,Ho=!1,a=n(r,i),Ho=!1,Vo&&(a=Zo(t,n,r,i)),Xo(e),a}function Xo(e){F.H=dc;var t=Ro!==null&&Ro.next!==null;if(Lo=0,zo=Ro=K=null,Bo=!1,Wo=0,Go=null,t)throw Error(s(300));e===null||Ac||(e=e.dependencies,e!==null&&ba(e)&&(Ac=!0))}function Zo(e,t,n,r){K=e;var i=0;do{if(Vo&&(Go=null),Wo=0,Vo=!1,25<=i)throw Error(s(301));if(i+=1,zo=Ro=null,e.updateQueue!=null){var a=e.updateQueue;a.lastEffect=null,a.events=null,a.stores=null,a.memoCache!=null&&(a.memoCache.index=0)}F.H=mc,a=t(n,r)}while(Vo);return a}function Qo(){var e=F.H,t=e.useState()[0];return t=typeof t.then==`function`?as(t):t,e=e.useState()[0],(Ro===null?null:Ro.memoizedState)!==e&&(K.flags|=1024),t}function $o(){var e=Uo!==0;return Uo=0,e}function es(e,t,n){t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~n}function ts(e){if(Bo){for(e=e.memoizedState;e!==null;){var t=e.queue;t!==null&&(t.pending=null),e=e.next}Bo=!1}Lo=0,zo=Ro=K=null,Vo=!1,Wo=Uo=0,Go=null}function ns(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return zo===null?K.memoizedState=zo=e:zo=zo.next=e,zo}function rs(){if(Ro===null){var e=K.alternate;e=e===null?null:e.memoizedState}else e=Ro.next;var t=zo===null?K.memoizedState:zo.next;if(t!==null)zo=t,Ro=e;else{if(e===null)throw K.alternate===null?Error(s(467)):Error(s(310));Ro=e,e={memoizedState:Ro.memoizedState,baseState:Ro.baseState,baseQueue:Ro.baseQueue,queue:Ro.queue,next:null},zo===null?K.memoizedState=zo=e:zo=zo.next=e}return zo}function is(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function as(e){var t=Wo;return Wo+=1,Go===null&&(Go=[]),e=Xa(Go,e,t),t=K,(zo===null?t.memoizedState:zo.next)===null&&(t=t.alternate,F.H=t===null||t.memoizedState===null?fc:pc),e}function os(e){if(typeof e==`object`&&e){if(typeof e.then==`function`)return as(e);if(e.$$typeof===de)return;if(e.$$typeof===re)return Sa(e)}throw Error(s(438,String(e)))}function ss(e){var t=null,n=K.updateQueue;if(n!==null&&(t=n.memoCache),t==null){var r=K.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=is(),K.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]=le;return t.index++,n}function cs(e,t){return typeof t==`function`?t(e):t}function ls(e){return us(rs(),Ro,e)}function us(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?(Lo&f)===f:(Q&f)===f){var p=u.revertLane;if(p===0)l!==null&&(l=l.next={lane:0,revertLane:0,gesture:null,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null}),f===Fa&&(d=!0);else if((Lo&p)===p){u=u.next,p===Fa&&(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,K.lanes|=p,id|=p;f=u.action,Ho&&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,K.lanes|=f,id|=f;u=u.next}while(u!==null&&u!==t);if(l===null?o=a:l.next=c,!Rr(a,e.memoizedState)&&(Ac=!0,d&&(n=Ia,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 ds(e){var t=rs(),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);Rr(a,t.memoizedState)||(Ac=!0),t.memoizedState=a,t.baseQueue===null&&(t.baseState=a),n.lastRenderedState=a}return[a,r]}function fs(e,t,n){var r=K,i=rs(),a=U;if(a){if(n===void 0)throw Error(s(407));n=n()}else n=t();var o=!Rr((Ro||i).memoizedState,n);if(o&&(i.memoizedState=n,Ac=!0),i=i.queue,Ls(hs.bind(null,r,i,e),[e]),e=i.getSnapshot!==t||o||zo!==null&&!!(zo.memoizedState.tag&1),Ms(e?9:8,{destroy:void 0},ms.bind(null,r,i,n,t),null),e){if(r.flags|=2048,Xu===null)throw Error(s(349));a||Lo&127||ps(r,t,n)}return n}function ps(e,t,n){e.flags|=16384,e={getSnapshot:t,value:n},t=K.updateQueue,t===null?(t=is(),K.updateQueue=t,t.stores=[e]):(n=t.stores,n===null?t.stores=[e]:n.push(e))}function ms(e,t,n,r){t.value=n,t.getSnapshot=r,gs(t)&&_s(e)}function hs(e,t,n){return n(function(){gs(t)&&_s(e)})}function gs(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!Rr(e,n)}catch{return!0}}function _s(e){var t=wi(e,2);t!==null&&Md(t,e,2)}function vs(e){var t=ns();if(typeof e==`function`){var n=e;if(e=n(),Ho){R(!0);try{n()}finally{R(!1)}}}return t.memoizedState=t.baseState=e,t.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:cs,lastRenderedState:e},t}function ys(e,t,n,r){return e.baseState=n,us(e,Ro,typeof r==`function`?r:cs)}function bs(e,t,n,r,i){if(cc(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)}};F.T===null?a.isTransition=!1:n(!0),r(a),n=t.pending,n===null?(a.next=t.pending=a,xs(t,a)):(a.next=n.next,t.pending=n.next=a)}}function xs(e,t){var n=t.action,r=t.payload,i=e.state;if(t.isTransition){var a=F.T,o={};o.types=a===null?null:a.types,F.T=o;try{var s=n(i,r),c=F.S;c!==null&&c(o,s),Ss(e,t,s)}catch(n){ws(e,t,n)}finally{a!==null&&o.types!==null&&(a.types=o.types),F.T=a}}else try{a=n(i,r),Ss(e,t,a)}catch(n){ws(e,t,n)}}function Ss(e,t,n){typeof n==`object`&&n&&typeof n.then==`function`?n.then(function(n){Cs(e,t,n)},function(n){return ws(e,t,n)}):Cs(e,t,n)}function Cs(e,t,n){t.status=`fulfilled`,t.value=n,Ts(t),e.state=n,t=e.pending,t!==null&&(n=t.next,n===t?e.pending=null:(n=n.next,t.next=n,xs(e,n)))}function ws(e,t,n){var r=e.pending;if(e.pending=null,r!==null){r=r.next;do t.status=`rejected`,t.reason=n,Ts(t),t=t.next;while(t!==r)}e.action=null}function Ts(e){e=e.listeners;for(var t=0;t<e.length;t++)(0,e[t])()}function Es(e,t){return t}function Ds(e,t){if(U){var n=Xu.formState;if(n!==null){a:{var r=K;if(U){if(ta){b:{for(var i=ta,a=ra;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){ta=lm(i.nextSibling),r=i.data===`F!`;break a}}aa(r)}r=!1}r&&(t=n[0])}}return n=ns(),n.memoizedState=n.baseState=t,r={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Es,lastRenderedState:t},n.queue=r,n=ac.bind(null,K,r),r.dispatch=n,r=vs(!1),a=sc.bind(null,K,!1,r.queue),r=ns(),i={state:t,dispatch:null,action:e,pending:null},r.queue=i,n=bs.bind(null,K,i,a,n),i.dispatch=n,r.memoizedState=e,[t,n,!1]}function Os(e){return ks(rs(),Ro,e)}function ks(e,t,n){if(t=us(e,t,Es)[0],e=ls(cs)[0],typeof t==`object`&&t&&typeof t.then==`function`)try{var r=as(t)}catch(e){throw e===Ga?qa:e}else r=t;t=rs();var i=t.queue,a=i.dispatch;return n!==t.memoizedState&&(K.flags|=2048,Ms(9,{destroy:void 0},As.bind(null,i,n),null)),[r,a,e]}function As(e,t){e.action=t}function js(e){var t=rs(),n=Ro;if(n!==null)return ks(t,n,e);rs(),t=t.memoizedState,n=rs();var r=n.queue.dispatch;return n.memoizedState=e,[t,r,!1]}function Ms(e,t,n,r){return e={tag:e,create:n,deps:r,inst:t,next:null},t=K.updateQueue,t===null&&(t=is(),K.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 Ns(){return rs().memoizedState}function Ps(e,t,n,r){var i=ns();K.flags|=e,i.memoizedState=Ms(1|t,{destroy:void 0},n,r===void 0?null:r)}function Fs(e,t,n,r){var i=rs();r=r===void 0?null:r;var a=i.memoizedState.inst;Ro!==null&&r!==null&&Jo(r,Ro.memoizedState.deps)?i.memoizedState=Ms(t,a,n,r):(K.flags|=e,i.memoizedState=Ms(1|t,a,n,r))}function Is(e,t){Ps(8390656,8,e,t)}function Ls(e,t){Fs(2048,8,e,t)}function Rs(e){K.flags|=4;var t=K.updateQueue;if(t===null)t=is(),K.updateQueue=t,t.events=[e];else{var n=t.events;n===null?t.events=[e]:n.push(e)}}function zs(e){var t=rs().memoizedState;return Rs({ref:t,nextImpl:e}),function(){if(X&2)throw Error(s(440));return t.impl.apply(void 0,arguments)}}function Bs(e,t){return Fs(4,2,e,t)}function Vs(e,t){return Fs(4,4,e,t)}function Hs(e,t){if(typeof t==`function`){e=e();var n=t(e);return function(){typeof n==`function`?n():t(null)}}if(t!=null)return e=e(),t.current=e,function(){t.current=null}}function Us(e,t,n){n=n==null?null:n.concat([e]),Fs(4,4,Hs.bind(null,t,e),n)}function Ws(){}function Gs(e,t){var n=rs();t=t===void 0?null:t;var r=n.memoizedState;return t!==null&&Jo(t,r[1])?r[0]:(n.memoizedState=[e,t],e)}function Ks(e,t){var n=rs();t=t===void 0?null:t;var r=n.memoizedState;if(t!==null&&Jo(t,r[1]))return r[0];if(r=e(),Ho){R(!0);try{e()}finally{R(!1)}}return n.memoizedState=[r,t],r}function qs(e,t,n){return n===void 0||Lo&1073741824&&!(Q&261930)?e.memoizedState=t:(e.memoizedState=n,e=Ad(),K.lanes|=e,id|=e,n)}function Js(e,t,n,r){return Rr(n,t)?n:xo.current===null?!(Lo&106)||Lo&1073741824&&!(Q&261930)?(Ac=!0,e.memoizedState=n):(e=Ad(),K.lanes|=e,id|=e,t):(e=qs(e,n,r),Rr(e,t)||(Ac=!0),e)}function Ys(e,t,n,r,i){var a=I.p;I.p=a!==0&&8>a?a:8;var o=F.T,s={};s.types=o===null?null:o.types,F.T=s,sc(e,!1,t,n);try{var c=i(),l=F.S;l!==null&&l(s,c),typeof c==`object`&&c&&typeof c.then==`function`?oc(e,t,za(c,r),kd(e)):oc(e,t,r,kd(e))}catch(n){oc(e,t,{then:function(){},status:`rejected`,reason:n},kd())}finally{I.p=a,o!==null&&s.types!==null&&(o.types=s.types),F.T=o}}function Xs(){}function Zs(e,t,n,r){if(e.tag!==5)throw Error(s(476));var i=Qs(e).queue;Ys(e,i,t,ge,n===null?Xs:function(){return $s(e),n(r)})}function Qs(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:ge,baseState:ge,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:cs,lastRenderedState:ge},next:null};var n={};return t.next={memoizedState:n,baseState:n,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:cs,lastRenderedState:n},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function $s(e){var t=Qs(e);t.next===null&&(t=e.alternate.memoizedState),oc(e,t.next.queue,{},kd())}function ec(){return Sa(sh)}function tc(){return rs().memoizedState}function nc(){return rs().memoizedState}function rc(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var n=kd();e=po(n);var r=mo(t,e,n);r!==null&&(Md(r,t,n),ho(r,t,n)),t={cache:Oa()},e.payload=t;return}t=t.return}}function ic(e,t,n){var r=kd();n={lane:r,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null},cc(e)?lc(t,n):(n=Ci(e,t,n,r),n!==null&&(Md(n,e,r),uc(n,t,r)))}function ac(e,t,n){oc(e,t,n,kd())}function oc(e,t,n,r){var i={lane:r,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null};if(cc(e))lc(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,Rr(s,o))return Si(e,t,i,0),Xu===null&&xi(),!1}catch{}if(n=Ci(e,t,i,r),n!==null)return Md(n,e,r),uc(n,t,r),!0}return!1}function sc(e,t,n,r){if(r={lane:2,revertLane:Nf(),gesture:null,action:r,hasEagerState:!1,eagerState:null,next:null},cc(e)){if(t)throw Error(s(479))}else t=Ci(e,n,r,2),t!==null&&Md(t,e,2)}function cc(e){var t=e.alternate;return e===K||t!==null&&t===K}function lc(e,t){Vo=Bo=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function uc(e,t,n){if(n&4194048){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,pt(e,n)}}var dc={readContext:Sa,use:os,useCallback:qo,useContext:qo,useEffect:qo,useImperativeHandle:qo,useLayoutEffect:qo,useInsertionEffect:qo,useMemo:qo,useReducer:qo,useRef:qo,useState:qo,useDebugValue:qo,useDeferredValue:qo,useTransition:qo,useSyncExternalStore:qo,useId:qo,useHostTransitionStatus:qo,useFormState:qo,useActionState:qo,useOptimistic:qo,useMemoCache:qo,useCacheRefresh:qo,useEffectEvent:qo},fc={readContext:Sa,use:os,useCallback:function(e,t){return ns().memoizedState=[e,t===void 0?null:t],e},useContext:Sa,useEffect:Is,useImperativeHandle:function(e,t,n){n=n==null?null:n.concat([e]),Ps(4194308,4,Hs.bind(null,t,e),n)},useLayoutEffect:function(e,t){return Ps(4194308,4,e,t)},useInsertionEffect:function(e,t){Ps(4,2,e,t)},useMemo:function(e,t){var n=ns();t=t===void 0?null:t;var r=e();if(Ho){R(!0);try{e()}finally{R(!1)}}return n.memoizedState=[r,t],r},useReducer:function(e,t,n){var r=ns();if(n!==void 0){var i=n(t);if(Ho){R(!0);try{n(t)}finally{R(!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=ic.bind(null,K,e),[r.memoizedState,e]},useRef:function(e){var t=ns();return e={current:e},t.memoizedState=e},useState:function(e){e=vs(e);var t=e.queue,n=ac.bind(null,K,t);return t.dispatch=n,[e.memoizedState,n]},useDebugValue:Ws,useDeferredValue:function(e,t){return qs(ns(),e,t)},useTransition:function(){var e=vs(!1);return e=Ys.bind(null,K,e.queue,!0,!1),ns().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,n){var r=K,i=ns();if(U){if(n===void 0)throw Error(s(407));n=n()}else{if(n=t(),Xu===null)throw Error(s(349));Q&127||ps(r,t,n)}i.memoizedState=n;var a={value:n,getSnapshot:t};return i.queue=a,Is(hs.bind(null,r,a,e),[e]),r.flags|=2048,Ms(9,{destroy:void 0},ms.bind(null,r,a,n,t),null),n},useId:function(){var e=ns(),t=Xu.identifierPrefix;if(U){var n=Ji,r=qi;n=(r&~(1<<32-z(r)-1)).toString(32)+n,t=`_`+t+`R_`+n,n=Uo++,0<n&&(t+=`H`+n.toString(32)),t+=`_`}else n=Ko++,t=`_`+t+`r_`+n.toString(32)+`_`;return e.memoizedState=t},useHostTransitionStatus:ec,useFormState:Ds,useActionState:Ds,useOptimistic:function(e){var t=ns();t.memoizedState=t.baseState=e;var n={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return t.queue=n,t=sc.bind(null,K,!0,n),n.dispatch=t,[e,t]},useMemoCache:ss,useCacheRefresh:function(){return ns().memoizedState=rc.bind(null,K)},useEffectEvent:function(e){var t=ns(),n={impl:e};return t.memoizedState=n,function(){if(X&2)throw Error(s(440));return n.impl.apply(void 0,arguments)}}},pc={readContext:Sa,use:os,useCallback:Gs,useContext:Sa,useEffect:Ls,useImperativeHandle:Us,useInsertionEffect:Bs,useLayoutEffect:Vs,useMemo:Ks,useReducer:ls,useRef:Ns,useState:function(){return ls(cs)},useDebugValue:Ws,useDeferredValue:function(e,t){return Js(rs(),Ro.memoizedState,e,t)},useTransition:function(){var e=ls(cs)[0],t=rs().memoizedState;return[typeof e==`boolean`?e:as(e),t]},useSyncExternalStore:fs,useId:tc,useHostTransitionStatus:ec,useFormState:Os,useActionState:Os,useOptimistic:function(e,t){return ys(rs(),Ro,e,t)},useMemoCache:ss,useCacheRefresh:nc,useEffectEvent:zs},mc={readContext:Sa,use:os,useCallback:Gs,useContext:Sa,useEffect:Ls,useImperativeHandle:Us,useInsertionEffect:Bs,useLayoutEffect:Vs,useMemo:Ks,useReducer:ds,useRef:Ns,useState:function(){return ds(cs)},useDebugValue:Ws,useDeferredValue:function(e,t){var n=rs();return Ro===null?qs(n,e,t):Js(n,Ro.memoizedState,e,t)},useTransition:function(){var e=ds(cs)[0],t=rs().memoizedState;return[typeof e==`boolean`?e:as(e),t]},useSyncExternalStore:fs,useId:tc,useHostTransitionStatus:ec,useFormState:js,useActionState:js,useOptimistic:function(e,t){var n=rs();return Ro===null?(n.baseState=e,[e,n.queue.dispatch]):ys(n,Ro,e,t)},useMemoCache:ss,useCacheRefresh:nc,useEffectEvent:zs};function hc(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 gc={enqueueSetState:function(e,t,n){e=e._reactInternals;var r=kd(),i=po(r);i.payload=t,n!=null&&(i.callback=n),t=mo(e,i,r),t!==null&&(Md(t,e,r),ho(t,e,r))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var r=kd(),i=po(r);i.tag=1,i.payload=t,n!=null&&(i.callback=n),t=mo(e,i,r),t!==null&&(Md(t,e,r),ho(t,e,r))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=kd(),r=po(n);r.tag=2,t!=null&&(r.callback=t),t=mo(e,r,n),t!==null&&(Md(t,e,n),ho(t,e,n))}};function _c(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?!zr(n,r)||!zr(i,a):!0}function vc(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&&gc.enqueueReplaceState(t,t.state,null)}function yc(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 bc(e){_i(e)}function xc(e){console.error(e)}function Sc(e){_i(e)}function Cc(e,t){try{var n=e.onUncaughtError;n(t.value,{componentStack:t.stack})}catch(e){setTimeout(function(){throw e})}}function wc(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 Tc(e,t,n){return n=po(n),n.tag=3,n.payload={element:null},n.callback=function(){Cc(e,t)},n}function Ec(e){return e=po(e),e.tag=3,e}function Dc(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(){wc(t,n,r)}}var o=n.stateNode;o!==null&&typeof o.componentDidCatch==`function`&&(e.callback=function(){wc(t,n,r),typeof i!=`function`&&(gd===null?gd=new Set([this]):gd.add(this));var e=r.stack;this.componentDidCatch(r.value,{componentStack:e===null?``:e})})}function Oc(e,t,n,r,i){if(n.flags|=32768,typeof r==`object`&&r&&typeof r.then==`function`){if(t=n.alternate,t!==null&&ya(t,n,i,!0),n=Eo.current,n!==null){switch(n.tag){case 31:case 13:case 19:return Do===null?Wd():n.alternate===null&&rd===0&&(rd=3),n.flags&=-257,n.flags|=65536,n.lanes=i,r===Ja?n.flags|=16384:(t=n.updateQueue,t===null?n.updateQueue=new Set([r]):t.add(r),pf(e,r,i)),!1;case 22:return n.flags|=65536,r===Ja?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)),pf(e,r,i)),!1}throw Error(s(435,n.tag))}return pf(e,r,i),Wd(),!1}if(U)return t=Eo.current,t===null?(r!==ia&&(t=Error(s(423),{cause:r}),da(zi(t,n))),e=e.current.alternate,e.flags|=65536,i&=-i,e.lanes|=i,r=zi(r,n),i=Tc(e.stateNode,r,i),go(e,i),rd!==4&&(rd=2)):(!(t.flags&65536)&&(t.flags|=256),t.flags|=65536,t.lanes=i,r!==ia&&(e=Error(s(422),{cause:r}),da(zi(e,n)))),!1;var a=Error(s(520),{cause:r});if(a=zi(a,n),ld===null?ld=[a]:ld.push(a),rd!==4&&(rd=2),t===null)return!0;r=zi(r,n),n=t;do{switch(n.tag){case 3:return n.flags|=65536,e=i&-i,n.lanes|=e,e=Tc(n.stateNode,r,e),go(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`&&(gd===null||!gd.has(a))))return n.flags|=65536,i&=-i,n.lanes|=i,i=Ec(i),Dc(i,e,n,r),go(n,i),!1;break;case 22:if(n.memoizedState!==null)return n.flags|=65536,!1}n=n.return}while(n!==null);return!1}var kc=Error(s(461)),Ac=!1;function jc(e,t,n,r){t.child=e===null?co(t,null,n,r):so(t,e.child,n,r)}function Mc(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 xa(t),r=Yo(e,t,n,o,a,i),s=$o(),e!==null&&!Ac?(es(e,t,i),il(e,t,i)):(U&&s&&Zi(t),t.flags|=1,jc(e,t,r,i),t.child)}function Nc(e,t,n,r,i){if(e===null){var a=n.type;return typeof a==`function`&&!Ai(a)&&a.defaultProps===void 0&&n.compare===null?(t.tag=15,t.type=a,Pc(e,t,a,r,i)):(e=Ni(n.type,null,r,t,t.mode,i),e.ref=t.ref,e.return=t,t.child=e)}if(a=e.child,!al(e,i)){var o=a.memoizedProps;if(n=n.compare,n=n===null?zr:n,n(o,r)&&e.ref===t.ref)return il(e,t,i)}return t.flags|=1,e=ji(a,r),e.ref=t.ref,e.return=t,t.child=e}function Pc(e,t,n,r,i){if(e!==null){var a=e.memoizedProps;if(zr(a,r)&&e.ref===t.ref){if(Ac=!1,t.pendingProps=r=a,al(e,i))e.flags&131072&&(Ac=!0);else return t.lanes=e.lanes,il(e,t,i)}}return Hc(e,t,n,r,i)}function Fc(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 Lc(e,t,a,n,r)}if(n&536870912)t.memoizedState={baseLanes:0,cachePool:null},e!==null&&Ua(t,a===null?null:a.cachePool),a===null?wo():Co(t,a),Ao(t);else return r=t.lanes=536870912,Lc(e,t,a===null?n:a.baseLanes|n,n,r)}else a===null?(e!==null&&Ua(t,null),wo(),jo()):(Ua(t,a.cachePool),Co(t,a),jo(),t.memoizedState=null);return jc(e,t,i,n),t.child}function Ic(e,t){return e!==null&&e.tag===22||t.stateNode!==null||(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),t.sibling}function Lc(e,t,n,r,i){var a=Ha();return a=a===null?null:{parent:Da._currentValue,pool:a},t.memoizedState={baseLanes:n,cachePool:a},e!==null&&Ua(t,null),wo(),Ao(t),e!==null&&ya(e,t,r,!0),t.childLanes=i,null}function Rc(e,t){return t=Xc({mode:t.mode,children:t.children},e.mode),t.ref=e.ref,e.child=t,t.return=e,t}function zc(e,t,n){return so(t,e.child,null,n),e=Rc(t,t.pendingProps),e.flags|=2,Mo(t),t.memoizedState=null,e}function Bc(e,t,n){var r=t.pendingProps,i=!!(t.flags&128);if(t.flags&=-129,e===null){if(U){if(r.mode===`hidden`)return e=Rc(t,r),t.lanes=536870912,e.memoizedState={baseLanes:0,cachePool:null},Ic(null,e);if(ko(t),(e=ta)?(e=am(e,ra),e=e!==null&&e.data===`&`?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:Ki===null?null:{id:qi,overflow:Ji},retryLane:536870912,hydrationErrors:null},n=Ii(e),n.return=t,t.child=n,ea=t,ta=null)):e=null,e===null)throw aa(t);return t.lanes=536870912,null}return Rc(t,r)}var a=e.memoizedState;if(a!==null){var o=a.dehydrated;if(ko(t),i){if(t.flags&256)t.flags&=-257,t=zc(e,t,n);else if(t.memoizedState!==null)t.child=e.child,t.flags|=128,t=null;else throw Error(s(558))}else if(Ac||ya(e,t,n,!1),i=(n&e.childLanes)!==0,Ac||i){if(xo.current===null){if(r=Xu,r!==null&&(o=mt(r,n),o!==0&&o!==a.retryLane))throw a.retryLane=o,wi(e,o),Md(r,e,o),kc;Wd()}t=zc(e,t,n)}else e=a.treeContext,ta=lm(o.nextSibling),ea=t,U=!0,na=null,ra=!1,e!==null&&$i(t,e),t=Rc(t,r),t.flags|=134221824;return t}return e=ji(e.child,{mode:r.mode,children:r.children}),e.ref=t.ref,t.child=e,e.return=t,e}function Vc(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 Hc(e,t,n,r,i){return xa(t),n=Yo(e,t,n,r,void 0,i),r=$o(),e!==null&&!Ac?(es(e,t,i),il(e,t,i)):(U&&r&&Zi(t),t.flags|=1,jc(e,t,n,i),t.child)}function Uc(e,t,n,r,i,a){return xa(t),t.updateQueue=null,n=Zo(t,r,n,i),Xo(e),r=$o(),e!==null&&!Ac?(es(e,t,a),il(e,t,a)):(U&&r&&Zi(t),t.flags|=1,jc(e,t,n,a),t.child)}function q(e,t,n,r,i){if(xa(t),t.stateNode===null){var a=Di,o=n.contextType;typeof o==`object`&&o&&(a=Sa(o)),a=new n(r,a),t.memoizedState=a.state!==null&&a.state!==void 0?a.state:null,a.updater=gc,t.stateNode=a,a._reactInternals=t,a=t.stateNode,a.props=r,a.state=t.memoizedState,a.refs={},uo(t),o=n.contextType,a.context=typeof o==`object`&&o?Sa(o):Di,a.state=t.memoizedState,o=n.getDerivedStateFromProps,typeof o==`function`&&(hc(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&&gc.enqueueReplaceState(a,a.state,null),yo(t,r,a,i),vo(),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=yc(n,s);a.props=c;var l=a.context,u=n.contextType;o=Di,typeof u==`object`&&u&&(o=Sa(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)&&vc(t,a,r,o),lo=!1;var f=t.memoizedState;a.state=f,yo(t,r,a,i),vo(),l=t.memoizedState,s||f!==l||lo?(typeof d==`function`&&(hc(t,n,d,r),l=t.memoizedState),(c=lo||_c(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,fo(e,t),o=t.memoizedProps,u=yc(n,o),a.props=u,d=t.pendingProps,f=a.context,l=n.contextType,c=Di,typeof l==`object`&&l&&(c=Sa(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)&&vc(t,a,r,c),lo=!1,f=t.memoizedState,a.state=f,yo(t,r,a,i),vo();var p=t.memoizedState;o!==d||f!==p||lo||e!==null&&e.dependencies!==null&&ba(e.dependencies)?(typeof s==`function`&&(hc(t,n,s,r),p=t.memoizedState),(u=lo||_c(t,n,u,r,f,p,c)||e!==null&&e.dependencies!==null&&ba(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,Vc(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=so(t,e.child,null,i),t.child=so(t,null,n,i)):jc(e,t,n,i),t.memoizedState=a.state,e=t.child):e=il(e,t,i),e}function Wc(e,t,n,r){return la(),t.flags|=256,jc(e,t,n,r),t.child}var Gc={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function Kc(e){return{baseLanes:e,cachePool:Wa()}}function qc(e,t,n){return e=e===null?0:e.childLanes&~n,t&&(e|=sd),e}function Jc(e,t,n){var r=t.pendingProps,i=!1,a=!!(t.flags&128),o;if((o=a)||(o=e!==null&&e.memoizedState===null?!1:!!(No.current&2)),o&&(i=!0,t.flags&=-129),o=!!(t.flags&32),t.flags&=-33,e===null){if(U){if(i?Oo(t):jo(),(e=ta)?(e=am(e,ra),e=e!==null&&e.data!==`&`?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:Ki===null?null:{id:qi,overflow:Ji},retryLane:536870912,hydrationErrors:null},n=Ii(e),n.return=t,t.child=n,ea=t,ta=null)):e=null,e===null)throw aa(t);return t.lanes=sm(e)?32:536870912,null}return a=r.children,r=r.fallback,i?(jo(),i=t.mode,a=Xc({mode:`hidden`,children:a},i),r=Pi(r,i,n,null),a.return=t,r.return=t,a.sibling=r,t.child=a,r=t.child,r.memoizedState=Kc(n),r.childLanes=qc(e,o,n),t.memoizedState=Gc,Ic(null,r)):(Oo(t),Yc(t,a))}var s=e.memoizedState;if(s!==null){var c=s.dehydrated;if(c!==null)return Zc(e,t,a,o,r,c,s,n)}return i?(jo(),i=r.fallback,a=t.mode,s=e.child,c=s.sibling,r=ji(s,{mode:`hidden`,children:r.children}),r.subtreeFlags=s.subtreeFlags&1206910976,c===null?(i=Pi(i,a,n,null),i.flags|=2):i=ji(c,i),i.return=t,r.return=t,r.sibling=i,t.child=r,Ic(null,r),r=t.child,i=e.child.memoizedState,i===null?i=Kc(n):(a=i.cachePool,a===null?a=Wa():(s=Da._currentValue,a=a.parent===s?a:{parent:s,pool:s}),i={baseLanes:i.baseLanes|n,cachePool:a}),r.memoizedState=i,r.childLanes=qc(e,o,n),t.memoizedState=Gc,Ic(e.child,r)):(Oo(t),n=e.child,e=n.sibling,n=ji(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 Yc(e,t){return t=Xc({mode:`visible`,children:t},e.mode),t.return=e,e.child=t}function Xc(e,t){return e=ki(22,e,null,t),e.lanes=0,e}function J(e,t,n){return so(t,e.child,null,n),e=Yc(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function Zc(e,t,n,r,i,a,o,c){if(n)return t.flags&256?(Oo(t),t.flags&=-257,J(e,t,c)):t.memoizedState===null?(jo(),a=i.fallback,o=t.mode,i=Xc({mode:`visible`,children:i.children},o),a=Pi(a,o,c,null),a.flags|=2,i.return=t,a.return=t,i.sibling=a,t.child=i,so(t,e.child,null,c),i=t.child,i.memoizedState=Kc(c),i.childLanes=qc(e,r,c),t.memoizedState=Gc,Ic(null,i)):(jo(),t.child=e.child,t.flags|=128,null);if(Oo(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,da({value:i,source:null,stack:null})),J(e,t,c)}if(Ac||ya(e,t,c,!1),r=(c&e.childLanes)!==0,Ac||r){if(xo.current!==null)return J(e,t,c);if(r=Xu,r!==null&&(i=mt(r,c),i!==0&&i!==o.retryLane))throw o.retryLane=i,wi(e,i),Md(r,e,i),kc;return om(a)||Wd(),J(e,t,c)}return om(a)?(t.flags|=192,t.child=e.child,null):(e=o.treeContext,ta=lm(a.nextSibling),ea=t,U=!0,na=null,ra=!1,e!==null&&$i(t,e),t=Yc(t,i.children),t.flags|=134221824,t)}function Qc(e,t,n){e.lanes|=t;var r=e.alternate;r!==null&&(r.lanes|=t),_a(e.return,t,n)}function $c(e){for(var t=null;e!==null;){var n=e.alternate;n!==null&&Io(n)===null&&(t=e),e=e.sibling}return t}function el(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 tl(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 nl(e,t,n){var r=t.pendingProps,i=r.revealOrder,a=r.tail;r=r.children;var o=No.current;if(t.flags&128)return Po(t,o),null;var s=!!(o&2);if(s?(o=o&1|2,t.flags|=128):o&=1,Po(t,o),i===`backwards`&&e!==null?(tl(e),jc(e,t,r,n),tl(e)):jc(e,t,r,n),r=U?Ui:0,!s&&e!==null&&e.flags&128)a:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&Qc(e,n,t);else if(e.tag===19)Qc(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=$c(t.child),n===null?(i=t.child,t.child=null):(i=n.sibling,n.sibling=null,tl(t)),el(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&&Io(e)===null){t.child=i;break}e=i.sibling,i.sibling=n,n=i,i=e}el(t,!0,n,null,a,r);break;case`together`:el(t,!1,null,null,void 0,r);break;case`independent`:t.memoizedState=null;break;default:n=$c(t.child),n===null?(i=t.child,t.child=null):(i=n.sibling,n.sibling=null),el(t,!1,i,n,a,r)}return t.child}function rl(e,t,n){var r=t.pendingProps;return ha(t,t.type,r.value),jc(e,t,r.children,n),t.child}function il(e,t,n){if(e!==null&&(t.dependencies=e.dependencies),id|=t.lanes,(n&t.childLanes)===0){if(e!==null){if(ya(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=ji(e,e.pendingProps),t.child=n,n.return=t;e.sibling!==null;)e=e.sibling,n=n.sibling=ji(e,e.pendingProps),n.return=t;n.sibling=null}return t.child}function al(e,t){return(e.lanes&t)!==0||(e=e.dependencies,!!(e!==null&&ba(e)))}function ol(e,t,n){switch(t.tag){case 3:Ee(t,t.stateNode.containerInfo),ha(t,Da,e.memoizedState.cache),la();break;case 27:case 5:Oe(t);break;case 4:Ee(t,t.stateNode.containerInfo);break;case 10:ha(t,t.type,t.memoizedProps.value);break;case 31:if(t.memoizedState!==null)return t.flags|=128,ko(t),null;break;case 13:var r=t.memoizedState;if(r!==null){if(r.dehydrated!==null)return Oo(t),t.flags|=128,null;r=ya(e,t,n,!1);var i=t.child.childLanes;return r||(n&i)!==0?Jc(e,t,n):(Oo(t),e=il(e,t,n),e===null?null:e.sibling)}Oo(t);break;case 19:if(t.flags&128)return nl(e,t,n);if(i=!!(e.flags&128),r=(n&t.childLanes)!==0,r||=(ya(e,t,n,!1),(n&t.childLanes)!==0),i){if(r)return nl(e,t,n);t.flags|=128}if(i=t.memoizedState,i!==null&&(i.rendering=null,i.tail=null,i.lastEffect=null),Po(t,No.current),r)break;return null;case 22:return t.lanes=0,Fc(e,t,n,t.pendingProps);case 24:ha(t,Da,e.memoizedState.cache)}return il(e,t,n)}function sl(e,t,n){if(e!==null){if(e.memoizedProps!==t.pendingProps)Ac=!0;else{if(!al(e,n)&&!(t.flags&128))return Ac=!1,ol(e,t,n);Ac=!!(e.flags&131072)}}else Ac=!1,U&&t.flags&1048576&&Xi(t,Ui,t.index);switch(t.lanes=0,t.tag){case 16:a:{var r=t.pendingProps;if(e=Za(t.elementType),t.type=e,typeof e==`function`)Ai(e)?(r=yc(e,r),t.tag=1,t=q(null,t,e,r,n)):(t.tag=0,t=Hc(null,t,e,r,n));else{if(e!=null){var i=e.$$typeof;if(i===M){t.tag=11,t=Mc(null,t,e,r,n);break a}if(i===ae){t.tag=14,t=Nc(null,t,e,r,n);break a}if(i===re){t.tag=10,t.type=e,t=rl(null,t,n);break a}}throw t=me(e)||e,Error(s(306,t,``))}}return t;case 0:return Hc(e,t,t.type,t.pendingProps,n);case 1:return r=t.type,i=yc(r,t.pendingProps),q(e,t,r,i,n);case 3:a:{if(Ee(t,t.stateNode.containerInfo),e===null)throw Error(s(387));r=t.pendingProps;var a=t.memoizedState;i=a.element,fo(e,t),yo(t,r,null,n);var o=t.memoizedState;if(r=o.cache,ha(t,Da,r),r!==a.cache&&va(t,[Da],n,!0),vo(),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=Wc(e,t,r,n);break a}if(r!==i){i=zi(Error(s(424)),t),da(i),t=Wc(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(ta=lm(e.firstChild),ea=t,U=!0,na=null,ra=!0,n=co(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|134221824,n=n.sibling}else{if(la(),r===i){t=il(e,t,n);break a}jc(e,t,r,n)}t=t.child}return t;case 26:return Vc(e,t),e===null?(n=Nm(t.type,null,t.pendingProps,null))?t.memoizedState=n:U||(t.stateNode=fp(t.type,t.pendingProps,we.current,t)):t.memoizedState=Nm(t.type,e.memoizedProps,t.pendingProps,e.memoizedState),null;case 27:return Oe(t),e===null&&U&&(r=t.stateNode=hm(t.type,t.pendingProps,we.current),ea=t,ra=!0,i=ta,Sp(t.type)?(um=i,ta=lm(r.firstChild)):ta=i),jc(e,t,t.pendingProps.children,n),Vc(e,t),e===null&&(t.flags|=4194304),t.child;case 5:return e===null&&U&&((i=r=ta)&&(r=rm(r,t.type,t.pendingProps,ra),r===null?i=!1:(t.stateNode=r,ea=t,ta=lm(r.firstChild),ra=!1,i=!0)),i||aa(t)),Oe(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=Yo(e,t,Qo,null,null,n),sh._currentValue=i),Vc(e,t),jc(e,t,r,n),t.child;case 6:return e===null&&U&&((e=n=ta)&&(n=im(n,t.pendingProps,ra),n===null?e=!1:(t.stateNode=n,ea=t,ta=null,e=!0)),e||aa(t)),null;case 13:return Jc(e,t,n);case 4:return Ee(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=so(t,null,r,n):jc(e,t,r,n),t.child;case 11:return Mc(e,t,t.type,t.pendingProps,n);case 7:return r=t.pendingProps,Vc(e,t),jc(e,t,r,n),t.child;case 8:return jc(e,t,t.pendingProps.children,n),t.child;case 12:return jc(e,t,t.pendingProps.children,n),t.child;case 10:return rl(e,t,n);case 9:return i=t.type._context,r=t.pendingProps.children,xa(t),i=Sa(i),r=r(i),t.flags|=1,jc(e,t,r,n),t.child;case 14:return Nc(e,t,t.type,t.pendingProps,n);case 15:return Pc(e,t,t.type,t.pendingProps,n);case 19:return nl(e,t,n);case 31:return Bc(e,t,n);case 22:return Fc(e,t,n,t.pendingProps);case 24:return xa(t),r=Sa(Da),e===null?(i=Ha(),i===null&&(i=Xu,a=Oa(),i.pooledCache=a,a.refCount++,a!==null&&(i.pooledCacheLanes|=n),i=a),t.memoizedState={parent:r,cache:i},uo(t),ha(t,Da,i)):((e.lanes&n)!==0&&(fo(e,t),yo(t,null,null,n),vo()),i=e.memoizedState,a=t.memoizedState,i.parent===r?(r=a.cache,ha(t,Da,r),r!==i.cache&&va(t,[Da],n,!0)):(i={parent:r,cache:r},t.memoizedState=i,t.lanes===0&&(t.memoizedState=t.updateQueue.baseState=i),ha(t,Da,r))),jc(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:U&&Zi(t),e!==null&&e.memoizedProps.name!==r.name?t.flags|=4194816:Vc(e,t),jc(e,t,r.children,n),t.child;case 29:throw t.pendingProps}throw Error(s(156,t.tag))}function cl(e){e.flags|=4}function ll(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(Vd())e.flags|=8192;else throw Qa=Ja,Ka}}else e.flags&=-16777217}function ul(e,t){if(t.type!==`stylesheet`||t.state.loading&4)e.flags&=-16777217;else if(e.flags|=16777216,!Ym(t)){if(Vd())e.flags|=8192;else throw Qa=Ja,Ka}}function dl(e,t){t!==null&&(e.flags|=4),e.flags&16384&&(t=e.tag===22?536870912:ct(),e.lanes|=t,cd|=t)}function fl(e,t){if(!U)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 pl(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 ml(e,t,n){var r=t.pendingProps;switch(Qi(t),t.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return pl(t),null;case 1:return pl(t),null;case 3:return n=t.stateNode,r=null,e!==null&&(r=e.memoizedState.cache),t.memoizedState.cache!==r&&(t.flags|=2048),ga(Da),De(),n.pendingContext&&(n.context=n.pendingContext,n.pendingContext=null),(e===null||e.child===null)&&(ca(t)?cl(t):e===null||e.memoizedState.isDehydrated&&!(t.flags&256)||(t.flags|=1024,ua())),pl(t),null;case 26:var i=t.type,a=t.memoizedState;return e===null?(cl(t),a===null?(pl(t),ll(t,i,null,r,n)):(pl(t),ul(t,a))):a?a===e.memoizedState?(pl(t),t.flags&=-16777217):(cl(t),pl(t),ul(t,a)):(e=e.memoizedProps,e!==r&&cl(t),pl(t),ll(t,i,e,r,n)),null;case 27:if(ke(t),n=we.current,i=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==r&&cl(t);else{if(!r){if(t.stateNode===null)throw Error(s(166));return pl(t),t.subtreeFlags&=-33554433,null}e=Se.current,ca(t)?oa(t,e):(e=hm(i,r,n),t.stateNode=e,cl(t))}return pl(t),t.subtreeFlags&=-33554433,null;case 5:if(ke(t),i=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==r&&cl(t);else{if(!r){if(t.stateNode===null)throw Error(s(166));return pl(t),t.subtreeFlags&=-33554433,null}if(a=Se.current,ca(t))oa(t,a);else{var o=lp(we.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[bt]=t,a[xt]=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&&cl(t)}}return pl(t),t.subtreeFlags&=-33554433,ll(t,t.type,e===null?null:e.memoizedProps,t.pendingProps,n),null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==r&&cl(t);else{if(typeof r!=`string`&&t.stateNode===null)throw Error(s(166));if(e=we.current,ca(t)){if(e=t.stateNode,n=t.memoizedProps,r=null,i=ea,i!==null)switch(i.tag){case 27:case 5:r=i.memoizedProps}e[bt]=t,e=!!(e.nodeValue===n||r!==null&&!0===r.suppressHydrationWarning||$f(e.nodeValue,n)),e||aa(t,!0)}else e=lp(e).createTextNode(r),e[bt]=t,t.stateNode=e}return pl(t),null;case 31:if(n=t.memoizedState,e===null||e.memoizedState!==null){if(r=ca(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[bt]=t}else la(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;pl(t),e=!1}else n=ua(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=n),e=!0;if(!e)return t.flags&256?(Mo(t),t):(Mo(t),null);if(t.flags&128)throw Error(s(558))}return pl(t),null;case 13:if(r=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(i=ca(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[bt]=t}else la(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;pl(t),i=!1}else i=ua(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=i),i=!0;if(!i)return t.flags&256?(Mo(t),t):(Mo(t),null)}return Mo(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),dl(t,t.updateQueue),pl(t),null);case 4:return De(),e===null&&Uf(t.stateNode.containerInfo),t.flags|=67108864,pl(t),null;case 10:return ga(t.type),pl(t),null;case 19:if(Fo(t),r=t.memoizedState,r===null)return pl(t),null;if(i=!!(t.flags&128),a=r.rendering,a===null){if(i)fl(r,!1);else{if(rd!==0||e!==null&&e.flags&128)for(e=t.child;e!==null;){if(a=Io(e),a!==null){for(t.flags|=128,fl(r,!1),e=a.updateQueue,t.updateQueue=e,dl(t,e),t.subtreeFlags=0,e=n,n=t.child;n!==null;)Mi(n,e),n=n.sibling;return Po(t,No.current&1|2),U&&Yi(t,r.treeForkCount),t.child}e=e.sibling}r.tail!==null&&Ve()>md&&(t.flags|=128,i=!0,fl(r,!1),t.lanes=4194304)}}else{if(!i){if(e=Io(a),e!==null){if(t.flags|=128,i=!0,e=e.updateQueue,t.updateQueue=e,dl(t,e),fl(r,!0),r.tail===null&&r.tailMode!==`collapsed`&&r.tailMode!==`visible`&&!a.alternate&&!U)return pl(t),null}else 2*Ve()-r.renderingStartTime>md&&n!==536870912&&(t.flags|=128,i=!0,fl(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=Ve(),e.sibling=null,a=No.current,a=i?a&1|2:a&1,r.tailMode===`visible`||r.tailMode===`collapsed`||!n||U?Po(t,a):(n=a,xe(Eo,t),xe(No,n),Do===null&&(Do=t)),U&&Yi(t,r.treeForkCount),e}return pl(t),null;case 22:case 23:return Mo(t),To(),r=t.memoizedState!==null,e===null?r&&(t.flags|=8192):e.memoizedState!==null!==r&&(t.flags|=8192),r?n&536870912&&!(t.flags&128)&&(pl(t),t.subtreeFlags&6&&(t.flags|=8192)):pl(t),n=t.updateQueue,n!==null&&dl(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&&be(Va),null;case 24:return n=null,e!==null&&(n=e.memoizedState.cache),t.memoizedState.cache!==n&&(t.flags|=2048),ga(Da),pl(t),null;case 25:return null;case 30:return t.flags|=33554432,pl(t),null}throw Error(s(156,t.tag))}function hl(e,t){switch(Qi(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return ga(Da),De(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return ke(t),null;case 31:if(t.memoizedState!==null){if(Mo(t),t.alternate===null)throw Error(s(340));la()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 13:if(Mo(t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(s(340));la()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return Fo(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 De(),null;case 10:return ga(t.type),null;case 22:case 23:return Mo(t),To(),e!==null&&be(Va),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return ga(Da),null;case 25:return null;default:return null}}function gl(e,t){switch(Qi(t),t.tag){case 3:ga(Da),De();break;case 26:case 27:case 5:ke(t);break;case 4:De();break;case 31:t.memoizedState!==null&&Mo(t);break;case 13:Mo(t);break;case 19:Fo(t);break;case 10:ga(t.type);break;case 22:case 23:Mo(t),To(),e!==null&&be(Va);break;case 24:ga(Da)}}function _l(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){ff(t,t.return,e)}}function vl(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){ff(i,c,e)}}}r=r.next}while(r!==a)}}catch(e){ff(t,t.return,e)}}function yl(e){var t=e.updateQueue;if(t!==null){var n=e.stateNode;try{G(t,n)}catch(t){ff(e,e.return,t)}}}function bl(e,t,n){n.props=yc(e.type,e.memoizedProps),n.state=e.memoizedState;try{n.componentWillUnmount()}catch(n){ff(e,t,n)}}function xl(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=mi(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){ff(e,t,n)}}function Sl(e,t){var n=e.ref,r=e.refCleanup;if(n!==null){if(typeof r==`function`)try{r()}catch(n){ff(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){ff(e,t,n)}else n.current=null}}function Cl(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 wl(e){for(var t=e.return;t!==null&&(Dl(t)&&em(e.stateNode,t.stateNode),!El(t));)t=t.return}function Tl(e){for(var t=e.return;t!==null&&(Dl(t)&&tm(e.stateNode,t.stateNode),!El(t));)t=t.return}function El(e){return e.tag===5||e.tag===3||e.tag===27}function Dl(e){return e&&e.tag===7&&e.stateNode!==null}function Ol(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){ff(e,e.return,t)}}function kl(e,t,n){try{var r=e.stateNode;ip(r,e.type,n,t),r[xt]=t}catch(t){ff(e,e.return,t)}}function Al(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&Sp(e.type)||e.tag===4}function jl(e){a:for(;;){for(;e.sibling===null;){if(e.return===null||Al(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 Ml(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=hn)),Cl(e,r),V=!0;else if(i!==4&&(i===27&&(Cl(e,r),r=null,Sp(e.type)&&(n=e.stateNode,t=null)),e=e.child,e!==null))for(Ml(e,t,n,r),e=e.sibling;e!==null;)Ml(e,t,n,r),e=e.sibling}function Nl(e,t,n,r){var i=e.tag;if(i===5||i===6)i=e.stateNode,t?n.insertBefore(i,t):n.appendChild(i),Cl(e,r),V=!0;else if(i!==4&&(i===27&&(Cl(e,r),r=null,Sp(e.type)&&(n=e.stateNode)),e=e.child,e!==null))for(Nl(e,t,n,r),e=e.sibling;e!==null;)Nl(e,t,n,r),e=e.sibling}function Pl(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[bt]=e,t[xt]=n}catch(t){ff(e,e.return,t)}}var Fl=!1,Il=null;function Ll(e){(e.tag===30||e.subtreeFlags&33554432)&&(Fl=!0)}var Rl=null;function zl(){var e=Rl;return Rl=null,e}var Y=0;function Bl(e,t,n,r,i){return Y=0,Vl(e.child,t,n,r,i)}function Vl(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);Fl=!0,Tp(o,Y===0?t:t+`_`+Y,n),Y++}else e.tag===22&&e.memoizedState!==null||e.tag===30&&i||Vl(e.child,t,n,r,i)&&(a=!0);e=e.sibling}return a}function Hl(e,t){for(;e!==null;)e.tag===5?Ep(e.stateNode,e.memoizedProps):e.tag===22&&e.memoizedState!==null||e.tag===30&&t||Hl(e.child,t),e=e.sibling}function Ul(e){if(e.subtreeFlags&18874368)for(e=e.child;e!==null;){if((e.tag!==22||e.memoizedState===null)&&(Ul(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=gi(t.default,t.share),t!==`none`&&(Bl(e,n,t,null,!1)||Hl(e.child,!1))}e=e.sibling}}function Wl(e,t){if(e.tag===30){var n=e.stateNode,r=e.memoizedProps,i=mi(r,n),a=gi(r.default,n.paired?r.share:r.enter);a===`none`?Ul(e):Bl(e,i,a,null,!1)?(Ul(e),n.paired||t||jd(e,r.onEnter)):Hl(e.child,!1)}else if(e.subtreeFlags&33554432)for(e=e.child;e!==null;)Wl(e,t),e=e.sibling;else Ul(e)}function Gl(e){if(Il!==null&&Il.size!==0){var t=Il;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=gi(n.default,n.share);if(a!==`none`&&(Bl(e,r,a,null,!1)?(a=e.stateNode,i.paired=a,a.paired=i,jd(e,n.onShare)):Hl(e.child,!1)),t.delete(r),t.size===0)break}}}Gl(e)}e=e.sibling}}}function Kl(e){if(e.tag===30){var t=e.memoizedProps,n=mi(t,e.stateNode),r=Il===null?void 0:Il.get(n),i=gi(t.default,r===void 0?t.exit:t.share);i!==`none`&&(Bl(e,n,i,null,!1)?r===void 0?jd(e,t.onExit):(i=e.stateNode,r.paired=i,i.paired=r,Il.delete(n),jd(e,t.onShare)):Hl(e.child,!1)),Il!==null&&Gl(e)}else if(e.subtreeFlags&33554432)for(e=e.child;e!==null;)Kl(e),e=e.sibling;else Il!==null&&Gl(e)}function ql(e){for(e=e.child;e!==null;){if(e.tag===30){var t=e.memoizedProps,n=mi(t,e.stateNode);t=gi(t.default,t.update),e.flags&=-5,t!==`none`&&Bl(e,n,t,e.memoizedState=[],!1)}else e.subtreeFlags&33554432&&ql(e);e=e.sibling}}function Jl(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,Hl(e.child,!1))}Jl(e)}e=e.sibling}}function Yl(e){if(e.tag===30)e.stateNode.paired=null,Hl(e.child,!1),Jl(e);else if(e.subtreeFlags&33554432)for(e=e.child;e!==null;)Yl(e),e=e.sibling;else Jl(e)}function Xl(e){for(e=e.child;e!==null;)e.tag===30?Hl(e.child,!1):e.subtreeFlags&33554432&&Xl(e),e=e.sibling}function Zl(e,t,n,r,i,a,o){for(var s=!1;t!==null;){if(t.tag===5){var c=t.stateNode;if(a!==null&&Y<a.length){var l=a[Y],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,Y===0?n:n+`_`+Y,i),s&&e.flags&4||(Rl===null&&(Rl=[]),Rl.push(c,Y===0?r:r+`_`+Y,t.memoizedProps)),Y++}else(t.tag!==22||t.memoizedState===null)&&(t.tag===30&&o?e.flags|=t.flags&32:Zl(e,t.child,n,r,i,a,o)&&(s=!0));t=t.sibling}return s}function Ql(e,t){for(e=e.child;e!==null;){if(e.tag===30){var n=e.memoizedProps,r=e.stateNode,i=mi(n,r),a=gi(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;Y=0,i=Zl(r,s,i,i,a,o,!1),e.flags&4&&i&&(t||jd(e,n.onUpdate))}else e.subtreeFlags&33554432&&Ql(e,t);e=e.sibling}}var $l=!1,eu=!1,tu=!1,nu=!1,ru=typeof WeakSet==`function`?WeakSet:Set,iu=null,au=!1,ou=!1,su=!1,cu=!1;function lu(e,t,n){if(e=e.containerInfo,sp=gh,e=Wr(e),Gr(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,iu=t,t=n?9270:1024;iu!==null;){if(e=iu,n&&(r=e.deletions,r!==null))for(a=0;a<r.length;a++)n&&Kl(r[a]);if(e.alternate===null&&e.flags&2)n&&Ll(e),uu(n);else{if(e.tag===22){if(r=e.alternate,e.memoizedState!==null){r!==null&&r.memoizedState===null&&n&&Kl(r),uu(n);continue}if(r!==null&&r.memoizedState!==null){n&&Ll(e),uu(n);continue}}r=e.child,(e.subtreeFlags&t)!==0&&r!==null?(r.return=e,iu=r):(n&&ql(e),uu(n))}}Il=null}function uu(e){for(;iu!==null;){var t=iu,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=yc(t.type,i);n=a.getSnapshotBeforeUpdate(o,r),a.__reactInternalSnapshotBeforeUpdate=n}catch(e){ff(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=mi(r.memoizedProps,r.stateNode),i=t.memoizedProps,i=gi(i.default,i.update),i!==`none`&&Bl(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,iu=r;break}iu=t.return}}function du(e,t,n){var r=n.flags;switch(n.tag){case 0:case 11:case 15:ju(e,n),r&4&&_l(5,n);break;case 1:if(ju(e,n),r&4){if(e=n.stateNode,t===null)try{e.componentDidMount()}catch(e){ff(n,n.return,e)}else{var i=yc(n.type,t.memoizedProps);t=t.memoizedState;try{e.componentDidUpdate(i,t,e.__reactInternalSnapshotBeforeUpdate)}catch(e){ff(n,n.return,e)}}}r&64&&yl(n),r&512&&xl(n,n.return);break;case 3:if(ju(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{G(e,t)}catch(e){ff(n,n.return,e)}}break;case 27:t===null&&r&4&&Pl(n);case 26:case 5:ju(e,n),t===null&&r&4&&Ol(n),r&512&&xl(n,n.return);break;case 12:ju(e,n);break;case 31:ju(e,n),r&4&&bu(e,n);break;case 13:ju(e,n),r&4&&xu(e,n),r&64&&(e=n.memoizedState,e!==null&&(e=e.dehydrated,e!==null&&(n=gf.bind(null,n),cm(e,n))));break;case 22:if(r=n.memoizedState!==null||$l,!r){var a=t!==null&&t.memoizedState!==null||eu;t=$l,i=eu,$l=r,(eu=a)&&!i?(r=2,n.subtreeFlags&8772&&(r|=1),Nu(e,n,r)):ju(e,n),$l=t,eu=i}break;case 30:ju(e,n),r&512&&xl(n,n.return);break;case 7:r&512&&xl(n,n.return);default:ju(e,n)}}function fu(e,t){for(e=e.child;e!==null;)pu(e,t),e=e.sibling}function pu(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){ff(e,e.return,t)}mu(e,t);break;case 6:try{e.stateNode.nodeValue=t?``:e.memoizedProps,V=!0}catch(t){ff(e,e.return,t)}break;case 18:try{var s=e.stateNode;t?wp(s,!0):wp(e.stateNode,!1)}catch(t){ff(e,e.return,t)}break;case 22:case 23:e.memoizedState===null&&fu(e,t);break;default:fu(e,t)}}function mu(e,t){if(e.subtreeFlags&67108864)for(e=e.child;e!==null;){a:{var n=e,r=t;switch(n.tag){case 4:pu(n,r);break a;case 22:n.memoizedState===null&&mu(n,r);break a;default:mu(n,r)}}e=e.sibling}}function hu(e){var t=e.alternate;t!==null&&(e.alternate=null,hu(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&kt(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 gu=null,_u=!1;function vu(e,t,n){for(n=n.child;n!==null;)yu(e,t,n),n=n.sibling}function yu(e,t,n){if(Ze&&typeof Ze.onCommitFiberUnmount==`function`)try{Ze.onCommitFiberUnmount(Xe,n)}catch{}switch(n.tag){case 26:eu||Sl(n,t),vu(e,t,n),n.memoizedState?n.memoizedState.count--:n.stateNode&&!eu&&(n=n.stateNode,n.parentNode.removeChild(n));break;case 27:eu||Sl(n,t),Tl(n);var r=gu,i=_u;Sp(n.type)&&(gu=n.stateNode,_u=!1),vu(e,t,n),gm(n.stateNode,n.type,n.memoizedProps),gu=r,_u=i;break;case 5:eu||Sl(n,t),Tl(n);case 6:if(n.tag===6&&Tl(n),r=gu,i=_u,gu=null,vu(e,t,n),gu=r,_u=i,gu!==null){if(_u)try{(gu.nodeType===9?gu.body:gu.nodeName===`HTML`?gu.ownerDocument.body:gu).removeChild(n.stateNode),V=!0}catch(e){ff(n,t,e)}else try{gu.removeChild(n.stateNode),V=!0}catch(e){ff(n,t,e)}}break;case 18:gu!==null&&(_u?(e=gu,Cp(e.nodeType===9?e.body:e.nodeName===`HTML`?e.ownerDocument.body:e,n.stateNode),Hh(e)):Cp(gu,n.stateNode));break;case 4:r=gu,i=_u,gu=n.stateNode.containerInfo,_u=!0,vu(e,t,n),gu=r,_u=i;break;case 0:case 11:case 14:case 15:vl(2,n,t),eu||vl(4,n,t),vu(e,t,n);break;case 1:eu||(Sl(n,t),r=n.stateNode,typeof r.componentWillUnmount==`function`&&bl(n,t,r)),vu(e,t,n);break;case 21:vu(e,t,n);break;case 22:eu=(r=eu)||n.memoizedState!==null,vu(e,t,n),eu=r;break;case 30:Sl(n,t),vu(e,t,n);break;case 7:eu||Sl(n,t),vu(e,t,n);break;default:vu(e,t,n)}}function bu(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null))){e=e.dehydrated;try{Hh(e)}catch(e){ff(t,t.return,e)}}}function xu(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){ff(t,t.return,e)}}function Su(e){switch(e.tag){case 31:case 13:case 19:var t=e.stateNode;return t===null&&(t=e.stateNode=new ru),t;case 22:return e=e.stateNode,t=e._retryCache,t===null&&(t=e._retryCache=new ru),t;default:throw Error(s(435,e.tag))}}function Cu(e,t){var n=Su(e);t.forEach(function(t){if(!n.has(t)){n.add(t);var r=_f.bind(null,e,t);t.then(r,r)}})}function wu(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)){gu=l.stateNode,_u=!1;break a}break;case 5:gu=l.stateNode,_u=!1;break a;case 3:case 4:gu=l.stateNode.containerInfo,_u=!0;break a}l=l.return}if(gu===null)throw Error(s(160));yu(o,c,a),gu=null,_u=!1,o=a.alternate,o!==null&&(o.return=null),a.return=null}if(t.subtreeFlags&13886)for(t=t.child;t!==null;)Eu(t,e,n),t=t.sibling}var Tu=null;function Eu(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}wu(t,e,n),Du(e),i&4&&(vl(3,e,e.return),_l(3,e),vl(5,e,e.return));break;case 1:wu(t,e,n),Du(e),i&512&&(eu||r===null||Sl(r,r.return)),i&64&&$l&&(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=Tu,wu(t,e,n),Du(e),i&512&&(eu||r===null||Sl(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($l)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[Dt]||r[bt]||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[bt]=e,Pt(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[bt]=e,Pt(r),t=r}e.stateNode=t}}else $l||Km(a,e.type,e.stateNode)}else e.stateNode=Bm(a,n,e.memoizedProps)}else i===n?n===null&&e.stateNode!==null&&kl(e,e.memoizedProps,r.memoizedProps):(i===null?(t=r.stateNode,t===null||eu||t.parentNode.removeChild(t)):i.count--,n===null?$l||Km(a,e.type,e.stateNode):Bm(a,n,e.memoizedProps))}break;case 27:wu(t,e,n),Du(e),i&512&&(eu||r===null||Sl(r,r.return)),r!==null&&i&4&&kl(e,e.memoizedProps,r.memoizedProps);break;case 5:if(a=tu,tu=!1,wu(t,e,n),tu=a,Du(e),i&512&&(eu||r===null||Sl(r,r.return)),e.flags&32){t=e.stateNode;try{sn(t,``),V=!0}catch(t){ff(e,e.return,t)}}i&4&&e.stateNode!=null&&(t=e.memoizedProps,kl(e,t,r===null?t:r.memoizedProps)),i&1024&&(nu=!0);break;case 6:if(wu(t,e,n),Du(e),i&4){if(e.stateNode===null)throw Error(s(162));t=e.memoizedProps,n=e.stateNode;try{n.nodeValue=t,V=!0}catch(t){ff(e,e.return,t)}}break;case 3:if(V=!1,Wm=null,a=Tu,Tu=bm(t.containerInfo),wu(t,e,n),Tu=a,Du(e),i&4&&r!==null&&r.memoizedState.isDehydrated)try{Hh(t.containerInfo)}catch(t){ff(e,e.return,t)}nu&&(nu=!1,Ou(e)),V=!1;break;case 4:i=tu,tu=$l,r=Wt(),a=Tu,Tu=bm(e.stateNode.containerInfo),wu(t,e,n),Du(e),Tu=a,V&&ou&&(su=!0),V=r,tu=i;break;case 12:wu(t,e,n),Du(e);break;case 31:wu(t,e,n),Du(e),i&4&&(t=e.updateQueue,t!==null&&(e.updateQueue=null,Cu(e,t)));break;case 13:wu(t,e,n),Du(e),e.child.flags&8192&&e.memoizedState!==null!=(r!==null&&r.memoizedState!==null)&&(fd=Ve()),i&4&&(t=e.updateQueue,t!==null&&(e.updateQueue=null,Cu(e,t)));break;case 22:a=e.memoizedState!==null,o=r!==null&&r.memoizedState!==null;var c=$l,l=eu,u=tu;$l=c||a,tu=u||a,eu=l||o,wu(t,e,n),eu=l,tu=u,$l=c,Du(e),i&8192&&(t=e.stateNode,t._visibility=a?t._visibility&-2:t._visibility|1,!a||r===null||o||$l||eu||(t=o||eu,n=$l,r=eu,$l=a||$l,eu=t,Mu(e,2),$l=n,eu=r),!a&&tu||fu(e,a)),i&4&&(t=e.updateQueue,t!==null&&(n=t.retryQueue,n!==null&&(t.retryQueue=null,Cu(e,n))));break;case 19:wu(t,e,n),Du(e),i&4&&(t=e.updateQueue,t!==null&&(e.updateQueue=null,Cu(e,t)));break;case 30:i&512&&(eu||r===null||Sl(r,r.return)),i=Wt(),a=ou,o=(n&335544064)===n,c=e.memoizedProps,ou=o&&gi(c.default,c.update)!==`none`,wu(t,e,n),Du(e),o&&r!==null&&V&&(e.flags|=4),ou=a,V=i;break;case 21:break;case 7:i&512&&(eu||r===null||Sl(r,r.return)),r&&r.stateNode!==null&&(r.stateNode._fragmentFiber=e);default:wu(t,e,n),Du(e)}}function Du(e){var t=e.flags;if(t&2){try{for(var n,r=e.return;r!==null;){if(Al(r)){n=r;break}r=r.return}r=null;for(var i=e.return;i!==null;){if(Dl(i)){var a=i.stateNode;r===null?r=[a]:r.push(a)}if(El(i))break;i=i.return}var o=r;if(n==null)throw Error(s(160));switch(n.tag){case 27:var c=n.stateNode;Nl(e,jl(e),c,o);break;case 5:var l=n.stateNode;n.flags&32&&(sn(l,``),n.flags&=-33),Nl(e,jl(e),l,o);break;case 3:case 4:var u=n.stateNode.containerInfo;Ml(e,jl(e),u,o);break;default:throw Error(s(161))}}catch(t){ff(e,e.return,t)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function Ou(e){if(e.subtreeFlags&1024)for(e=e.child;e!==null;){var t=e;Ou(t),t.tag===5&&t.flags&1024&&(t=t.stateNode,gh=!0,t.reset(),gh=!1),e=e.sibling}}function ku(e,t){if(t.subtreeFlags&9270)for(t=t.child;t!==null;)Au(t,e),t=t.sibling;else Ql(t,!1)}function Au(e,t){var n=e.alternate;if(n===null)Wl(e,!1);else switch(e.tag){case 3:if(cu=au=!1,zl(),ku(t,e),!au&&!su){if(e=Rl,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`})),cu=!0}Rl=null;break;case 5:ku(t,e);break;case 4:r=au,au=!1,ku(t,e),au&&(su=!0),au=r;break;case 22:e.memoizedState===null&&(n.memoizedState===null?ku(t,e):Wl(e,!1));break;case 30:r=au,i=zl(),au=!1,ku(t,e),au&&(e.flags|=4);var a=e.memoizedProps,o=e.stateNode;t=mi(a,o),o=mi(n.memoizedProps,o);var s=gi(a.default,a.update);s===`none`?t=!1:(a=n.memoizedState,n.memoizedState=null,n=e.child,Y=0,t=Zl(e,n,t,o,s,a,!0),Y!==(a===null?0:a.length)&&(e.flags|=32)),e.flags&4&&t?(jd(e,e.memoizedProps.onUpdate),Rl=i):i!==null&&(i.push.apply(i,Rl),Rl=i),au=e.flags&32?!0:r;break;default:ku(t,e)}}function ju(e,t){if(t.subtreeFlags&8772)for(t=t.child;t!==null;)du(e,t.alternate,t),t=t.sibling}function Mu(e,t){for(e=e.child;e!==null;){var n=e,r=t;switch(n.tag){case 0:case 11:case 14:case 15:vl(4,n,n.return),Mu(n,r);break;case 1:Sl(n,n.return);var i=n.stateNode;typeof i.componentWillUnmount==`function`&&bl(n,n.return,i),Mu(n,r);break;case 27:r&2&&gm(n.stateNode,n.type,n.memoizedProps);case 5:Sl(n,n.return),n.tag!==5&&n.tag!==27||Tl(n),Mu(n,r);break;case 6:Tl(n);break;case 26:Sl(n,n.return),i=n.stateNode,n.memoizedState!==null||i===null||eu||i.parentNode.removeChild(i),Mu(n,r);break;case 22:n.memoizedState===null&&Mu(n,r);break;case 30:Sl(n,n.return),Mu(n,r);break;case 7:Sl(n,n.return);default:Mu(n,r)}e=e.sibling}}function Nu(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:Nu(i,a,n),_l(4,a);break;case 1:if(Nu(i,a,n),r=a,i=r.stateNode,typeof i.componentDidMount==`function`)try{i.componentDidMount()}catch(e){ff(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++)bo(l[i],c)}catch(e){ff(r,r.return,e)}}s&&o&64&&yl(a),xl(a,a.return);break;case 27:n&2&&Pl(a);case 5:a.tag!==5&&a.tag!==27||wl(a),Nu(i,a,n),s&&r===null&&o&4&&Ol(a),xl(a,a.return);break;case 6:wl(a);break;case 26:c=a.stateNode,a.memoizedState!==null||c===null||$l||Km(bm(c.ownerDocument),a.type,c),Nu(i,a,n),s&&r===null&&o&4&&Ol(a),xl(a,a.return);break;case 12:Nu(i,a,n);break;case 31:Nu(i,a,n),s&&o&4&&bu(i,a);break;case 13:Nu(i,a,n),s&&o&4&&xu(i,a);break;case 22:a.memoizedState===null&&Nu(i,a,n),xl(a,a.return);break;case 30:Nu(i,a,n),xl(a,a.return);break;case 7:xl(a,a.return);default:Nu(i,a,n)}t=t.sibling}}function Pu(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&&ka(n))}function Fu(e,t){e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&ka(e))}function Iu(e,t,n,r){var i=(n&335544064)===n;if(t.subtreeFlags&(i?10262:10256))for(t=t.child;t!==null;)Lu(e,t,n,r),t=t.sibling;else i&&Xl(t)}function Lu(e,t,n,r){var i=(n&335544064)===n;i&&t.alternate===null&&t.return!==null&&t.return.alternate!==null&&Yl(t);var a=t.flags;switch(t.tag){case 0:case 11:case 15:Iu(e,t,n,r),a&2048&&_l(9,t);break;case 1:Iu(e,t,n,r);break;case 3:Iu(e,t,n,r),i&&cu&&(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&&ka(a)));break;case 12:if(a&2048){Iu(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){ff(t,t.return,e)}}else Iu(e,t,n,r);break;case 31:Iu(e,t,n,r);break;case 13:Iu(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&&Yl(t),o._visibility&2?Iu(e,t,n,r):(o._visibility|=2,Ru(e,t,n,r,!!(t.subtreeFlags&10256)||!1))):(i&&s!==null&&s.memoizedState===null&&Yl(s),o._visibility&2?Iu(e,t,n,r):zu(e,t)),a&2048&&Pu(s,t);break;case 24:Iu(e,t,n,r),a&2048&&Fu(t.alternate,t);break;case 30:i&&(a=t.alternate,a!==null&&(Hl(a.child,!0),Hl(t.child,!0))),Iu(e,t,n,r);break;default:Iu(e,t,n,r)}}function Ru(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:Ru(a,o,s,c,i),_l(8,o);break;case 23:break;case 22:var u=o.stateNode;o.memoizedState===null?(u._visibility|=2,Ru(a,o,s,c,i)):u._visibility&2?Ru(a,o,s,c,i):zu(a,o),i&&l&2048&&Pu(o.alternate,o);break;case 24:Ru(a,o,s,c,i),i&&l&2048&&Fu(o.alternate,o);break;default:Ru(a,o,s,c,i)}t=t.sibling}}function zu(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:zu(n,r),i&2048&&Pu(r.alternate,r);break;case 24:zu(n,r),i&2048&&Fu(r.alternate,r);break;default:zu(n,r)}t=t.sibling}}var Bu=8192;function Vu(e,t,n){if(e.subtreeFlags&Bu)for(e=e.child;e!==null;)Hu(e,t,n),e=e.sibling}function Hu(e,t,n){switch(e.tag){case 26:Vu(e,t,n),e.flags&Bu&&(e.memoizedState===null?(e=e.stateNode,(t&335544128)===t&&Zm(n,e)):Qm(n,Tu,e.memoizedState,e.memoizedProps));break;case 5:Vu(e,t,n),e.flags&Bu&&(e=e.stateNode,(t&335544128)===t&&Zm(n,e));break;case 3:case 4:var r=Tu;Tu=bm(e.stateNode.containerInfo),Vu(e,t,n),Tu=r;break;case 22:e.memoizedState===null&&(r=e.alternate,r!==null&&r.memoizedState!==null?(r=Bu,Bu=16777216,Vu(e,t,n),Bu=r):Vu(e,t,n));break;case 30:if((e.flags&Bu)!==0&&(r=e.memoizedProps.name,r!=null&&r!==`auto`)){var i=e.stateNode;i.paired=null,Il===null&&(Il=new Map),Il.set(r,i)}Vu(e,t,n);break;default:Vu(e,t,n)}}function Uu(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 Wu(e){var t=e.deletions;if(e.flags&16){if(t!==null)for(var n=0;n<t.length;n++){var r=t[n];iu=r,qu(r,e)}Uu(e)}if(e.subtreeFlags&10256)for(e=e.child;e!==null;)Gu(e),e=e.sibling}function Gu(e){switch(e.tag){case 0:case 11:case 15:Wu(e),e.flags&2048&&vl(9,e,e.return);break;case 3:Wu(e);break;case 12:Wu(e);break;case 22:var t=e.stateNode;e.memoizedState!==null&&t._visibility&2&&(e.return===null||e.return.tag!==13)?(t._visibility&=-3,Ku(e)):Wu(e);break;default:Wu(e)}}function Ku(e){var t=e.deletions;if(e.flags&16){if(t!==null)for(var n=0;n<t.length;n++){var r=t[n];iu=r,qu(r,e)}Uu(e)}for(e=e.child;e!==null;){switch(t=e,t.tag){case 0:case 11:case 15:vl(8,t,t.return),Ku(t);break;case 22:n=t.stateNode,n._visibility&2&&(n._visibility&=-3,Ku(t));break;default:Ku(t)}e=e.sibling}}function qu(e,t){for(;iu!==null;){var n=iu;switch(n.tag){case 0:case 11:case 15:vl(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:ka(n.memoizedState.cache)}if(r=n.child,r!==null)r.return=n,iu=r;else a:for(n=e;iu!==null;){r=iu;var i=r.sibling,a=r.return;if(hu(r),r===n){iu=null;break a}if(i!==null){i.return=a,iu=i;break a}iu=a}}}var Ju={getCacheForType:function(e){var t=Sa(Da),n=t.data.get(e);return n===void 0&&(n=e(),t.data.set(e,n)),n},cacheSignal:function(){return Sa(Da).controller.signal}},Yu=typeof WeakMap==`function`?WeakMap:Map,X=0,Xu=null,Z=null,Q=0,Zu=0,Qu=null,$u=!1,ed=!1,td=!1,nd=0,rd=0,id=0,ad=0,od=0,sd=0,cd=0,ld=null,ud=null,dd=!1,fd=0,pd=0,md=1/0,hd=null,gd=null,_d=0,vd=null,yd=null,bd=0,xd=0,Sd=null,Cd=null,wd=null,Td=null,Ed=null,Dd=0,Od=null;function kd(){return X&2&&Q!==0?Q&-Q:F.T===null?_t():Nf()}function Ad(){if(sd===0){if(!(Q&536870912)||U){var e=nt;nt<<=1,!(nt&3932160)&&(nt=262144),sd=e}else sd=536870912}return e=Eo.current,e!==null&&(e.flags|=32),sd}function jd(e,t){if(t!=null){var n=e.stateNode,r=n.ref;r===null&&(r=n.ref=Pp(mi(e.memoizedProps,n))),Td===null&&(Td=[]),Td.push(t.bind(null,r))}}function Md(e,t,n){(e===Xu&&(Zu===2||Zu===9)||e.cancelPendingCommit!==null)&&(zd(e,0),Id(e,Q,sd,!1)),ut(e,n),X&2&&e===Xu||(e===Xu&&(!(X&2)&&(ad|=n),rd===4&&Id(e,Q,sd,!1)),Tf(e))}function Nd(e,t,n){if(X&6)throw Error(s(327));var r=!n&&!(t&127)&&(t&e.expiredLanes)===0||at(e,t),i=r?qd(e,t):Gd(e,t,!0),a=r;do{if(i===0){ed&&!r&&Id(e,t,0,!1);break}if(n=e.current.alternate,a&&!Fd(n))i=Gd(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=ld;var l=c.current.memoizedState.isDehydrated;if(l&&(zd(c,o).flags|=256),o=Gd(c,o,!1),o!==2&&o!==6){if(td&&!l){c.errorRecoveryDisabledLanes|=a,ad|=a,i=4;break a}a=ud,ud=i,a!==null&&(ud===null?ud=a:ud.push.apply(ud,a))}i=o}if(a=!1,i!==2)continue}}if(i===1){zd(e,0),Id(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:Id(r,t,sd,!$u);break a;case 2:ud=null;break;case 3:case 5:break;default:throw Error(s(329))}if((t&62914560)===t&&(i=fd+300-Ve(),10<i)){if(Id(r,t,sd,!$u),B(r,0,!0)!==0)break a;bd=t,r.timeoutHandle=gp(Pd.bind(null,r,n,ud,hd,dd,t,sd,ad,cd,$u,a,`Throttled`,-0,0),i);break a}Pd(r,n,ud,hd,dd,t,sd,ad,cd,$u,a,null,-0,0)}break}}while(1);Tf(e)}function Pd(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:hn},Il=null,Hu(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?fd-Ve():(a&4194048)===a?pd-Ve():0,m=eh(d,m),m!==null)?(bd=a,e.cancelPendingCommit=m(ef.bind(null,e,t,a,n,r,i,o,s,c,l,u,d,null,f,p)),Id(e,a,o,!l)):ef(e,t,a,n,r,i,o,s,c,l,u,d)}function Fd(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(!Rr(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 Id(e,t,n,r){t=ot(e,t),t&=~od,t&=~ad,e.suspendedLanes|=t,e.pingedLanes&=~t,r&&(e.warmLanes|=t),r=e.expirationTimes;for(var i=t;0<i;){var a=31-z(i),o=1<<a;r[a]=-1,i&=~o}n!==0&&ft(e,n,t)}function Ld(){return X&6?!0:(Ef(0,!1),!1)}function Rd(){if(Z!==null){if(Zu===0)var e=Z.return;else e=Z,ma=pa=null,ts(e),to=null,no=0,e=Z;for(;e!==null;)gl(e.alternate,e),e=e.return;Z=null}}function zd(e,t){var n=e.timeoutHandle;return n!==-1&&(e.timeoutHandle=-1,_p(n)),n=e.cancelPendingCommit,n!==null&&(e.cancelPendingCommit=null,n()),bd=0,Rd(),Xu=e,Z=n=ji(e.current,null),Q=t,Zu=0,Qu=null,$u=!1,ed=at(e,t),td=!1,cd=sd=od=ad=id=rd=0,ud=ld=null,dd=!1,nd=ot(e,t),xi(),n}function Bd(e,t){K=null,F.H=dc,t===Ga||t===qa?(t=$a(),Zu=3):t===Ka?(t=$a(),Zu=4):Zu=t===kc?8:typeof t==`object`&&t&&typeof t.then==`function`?6:1,Qu=t,Z===null&&(rd=1,Cc(e,zi(t,e.current)))}function Vd(){var e=Eo.current;return e===null?!0:(Q&4194048)===Q?Do===null:(Q&62914560)===Q||Q&536870912?e===Do:!1}function Hd(){var e=F.H;return F.H=dc,e===null?dc:e}function Ud(){var e=F.A;return F.A=Ju,e}function Wd(){rd=4,$u||(Q&4194048)!==Q&&Eo.current!==null||(ed=!0),!(id&134217727)&&!(ad&134217727)||Xu===null||Id(Xu,Q,sd,!1)}function Gd(e,t,n){var r=X;X|=2;var i=Hd(),a=Ud();(Xu!==e||Q!==t)&&(hd=null,zd(e,t)),t=!1;var o=rd;a:do try{if(Zu!==0&&Z!==null){var s=Z,c=Qu;switch(Zu){case 8:Rd(),o=6;break a;case 3:case 2:case 9:case 6:Eo.current===null&&(t=!0);var l=Zu;if(Zu=0,Qu=null,Zd(e,s,c,l),n&&ed){o=0;break a}break;default:l=Zu,Zu=0,Qu=null,Zd(e,s,c,l)}}Kd(),o=rd;break}catch(t){Bd(e,t)}while(1);return t&&e.shellSuspendCounter++,ma=pa=null,X=r,F.H=i,F.A=a,Z===null&&(Xu=null,Q=0,xi()),o}function Kd(){for(;Z!==null;)Yd(Z)}function qd(e,t){var n=X;X|=2;var r=Hd(),i=Ud();Xu!==e||Q!==t?(hd=null,md=Ve()+500,zd(e,t)):ed=at(e,t);a:do try{if(Zu!==0&&Z!==null){t=Z;var a=Qu;b:switch(Zu){case 1:Zu=0,Qu=null,Zd(e,t,a,1);break;case 2:case 9:if(Ya(a)){Zu=0,Qu=null,Xd(t);break}t=function(){Zu!==2&&Zu!==9||Xu!==e||(Zu=7),Tf(e)},a.then(t,t);break a;case 3:Zu=7;break a;case 4:Zu=5;break a;case 7:Ya(a)?(Zu=0,Qu=null,Xd(t)):(Zu=0,Qu=null,Zd(e,t,a,7));break;case 5:var o=null;switch(Z.tag){case 26:o=Z.memoizedState;case 5:case 27:var c=Z;if(o?Ym(o):c.stateNode.complete){Zu=0,Qu=null;var l=c.sibling;if(l!==null)Z=l;else{var u=c.return;u===null?Z=null:(Z=u,Qd(u))}break b}}Zu=0,Qu=null,Zd(e,t,a,5);break;case 6:Zu=0,Qu=null,Zd(e,t,a,6);break;case 8:Rd(),rd=6;break a;default:throw Error(s(462))}}Jd();break}catch(t){Bd(e,t)}while(1);return ma=pa=null,F.H=r,F.A=i,X=n,Z===null?(Xu=null,Q=0,xi(),rd):0}function Jd(){for(;Z!==null&&!ze();)Yd(Z)}function Yd(e){var t=sl(e.alternate,e,nd);e.memoizedProps=e.pendingProps,t===null?Qd(e):Z=t}function Xd(e){var t=e,n=t.alternate;switch(t.tag){case 15:case 0:t=Uc(n,t,t.pendingProps,t.type,void 0,Q);break;case 11:t=Uc(n,t,t.pendingProps,t.type.render,t.ref,Q);break;case 5:ts(t);var r=t;r===ea&&(U?(sa(r),r.tag===5&&r.stateNode!=null&&(ta=r.stateNode)):(sa(r),U=!0));default:gl(n,t),t=Z=Mi(t,nd),t=sl(n,t,nd)}e.memoizedProps=e.pendingProps,t===null?Qd(e):Z=t}function Zd(e,t,n,r){ma=pa=null,ts(t),to=null,no=0;var i=t.return;try{if(Oc(e,i,t,n,Q)){rd=1,Cc(e,zi(n,e.current)),Z=null;return}}catch(t){if(i!==null)throw Z=i,t;rd=1,Cc(e,zi(n,e.current)),Z=null;return}t.flags&32768?(U||r===1?e=!0:ed||Q&536870912?e=!1:($u=e=!0,(r===2||r===9||r===3||r===6)&&(r=Eo.current,r!==null&&r.tag===13&&(r.flags|=16384))),$d(t,e)):Qd(t)}function Qd(e){var t=e;do{if(t.flags&32768){$d(t,$u);return}e=t.return;var n=ml(t.alternate,t,nd);if(n!==null){Z=n;return}if(t=t.sibling,t!==null){Z=t;return}Z=t=e}while(t!==null);rd===0&&(rd=5)}function $d(e,t){do{var n=hl(e.alternate,e);if(n!==null){n.flags&=32767,Z=n;return}if(n=e.return,n!==null&&(n.flags|=32768,n.subtreeFlags=0,n.deletions=null),!t&&(e=e.sibling,e!==null)){Z=e;return}Z=e=n}while(e!==null);rd=6,Z=null}function ef(e,t,n,r,i,a,o,c,l,u,d,f){e.cancelPendingCommit=null;do lf();while(_d!==0);if(X&6)throw Error(s(327));if(t!==null){if(t===e.current)throw Error(s(177));e===Xu&&(Z=Xu=null,Q=0),yd=t,vd=e,bd=n,Sd=i,Cd=r,tf(e,t,n,o,c,l,f)}}function tf(e,t,n,r,i,a,o){var s=t.lanes|t.childLanes;if(xd=s,s|=bi,dt(e,n,s,r,i,a),Td=null,(n&335544064)===n?(Ed=Ma(e),r=10262):(Ed=null,r=10256),(t.subtreeFlags&r)!==0||(t.flags&r)!==0?(e.callbackNode=null,e.callbackPriority=0,vf(Ge,function(){return uf(),null})):(e.callbackNode=null,e.callbackPriority=0),Fl=!1,r=!!(t.flags&13878),t.subtreeFlags&13878||r){r=F.T,F.T=null,i=I.p,I.p=2,a=X,X|=4;try{lu(e,t,n)}finally{X=a,I.p=i,F.T=r}}_d=1,Fl?wd=Mp(o,e.containerInfo,Ed,af,of,rf,sf,uf,nf,null,null):(af(),of(),sf())}function nf(e){if(_d!==0){var t=vd.onRecoverableError;t(e,{componentStack:null})}}function rf(){_d===3&&(_d=0,Au(yd,vd),_d=4)}function af(){if(_d===1){_d=0;var e=vd,t=yd,n=bd,r=!!(t.flags&13878);if(t.subtreeFlags&13878||r){r=F.T,F.T=null;var i=I.p;I.p=2;var a=X;X|=4;try{ou=su=!1,Eu(t,e,n),n=cp;var o=Wr(e.containerInfo),s=n.focusedElem,c=n.selectionRange;if(o!==s&&s&&s.ownerDocument&&Ur(s.ownerDocument.documentElement,s)){if(c!==null&&Gr(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 _=Hr(s,h),v=Hr(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{X=a,I.p=i,F.T=r}}e.current=t,_d=2}}function of(){if(_d===2){_d=0;var e=vd,t=yd,n=!!(t.flags&8772);if(t.subtreeFlags&8772||n){n=F.T,F.T=null;var r=I.p;I.p=2;var i=X;X|=4;try{du(e,t.alternate,t)}finally{X=i,I.p=r,F.T=n}}_d=3}}function sf(){if(_d===4||_d===3){_d=0;var e=wd;wd=null,Be();var t=vd,n=yd,r=bd,i=Cd,a=(r&335544064)===r?10262:10256;if((n.subtreeFlags&a)!==0||(n.flags&a)!==0?_d=5:(_d=0,yd=vd=null,cf(t,t.pendingLanes)),a=t.pendingLanes,a===0&&(gd=null),gt(r),n=n.stateNode,Ze&&typeof Ze.onCommitFiberRoot==`function`)try{Ze.onCommitFiberRoot(Xe,n,void 0,(n.current.flags&128)==128)}catch{}if(i!==null){n=F.T,a=I.p,I.p=2,F.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{F.T=n,I.p=a}}if(i=Td,o=Ed,Ed=null,i!==null&&(Td=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);bd&3&&lf(),Tf(t),a=t.pendingLanes,r&261930&&a&42?t===Od?Dd++:(Dd=0,Od=t):(Dd=0,Od=null),Ef(0,!1)}}function cf(e,t){(e.pooledCacheLanes&=t)===0&&(t=e.pooledCache,t!=null&&(e.pooledCache=null,ka(t)))}function lf(){return wd!==null&&(wd.skipTransition(),wd=null),af(),of(),sf(),uf()}function uf(){if(_d!==5)return!1;var e=vd,t=xd;xd=0;var n=gt(bd),r=F.T,i=I.p;try{I.p=32>n?32:n,F.T=null,n=Sd,Sd=null;var a=vd,o=bd;if(_d=0,yd=vd=null,bd=0,X&6)throw Error(s(331));var c=X;if(X|=4,Gu(a.current),Lu(a,a.current,o,n),X=c,Ef(0,!1),Ze&&typeof Ze.onPostCommitFiberRoot==`function`)try{Ze.onPostCommitFiberRoot(Xe,a)}catch{}return!0}finally{I.p=i,F.T=r,cf(e,t)}}function df(e,t,n){t=zi(n,t),t=Tc(e.stateNode,t,2),e=mo(e,t,2),e!==null&&(ut(e,2),Tf(e))}function ff(e,t,n){if(e.tag===3)df(e,e,n);else for(;t!==null;){if(t.tag===3){df(t,e,n);break}if(t.tag===1){var r=t.stateNode;if(typeof t.type.getDerivedStateFromError==`function`||typeof r.componentDidCatch==`function`&&(gd===null||!gd.has(r))){e=zi(n,e),n=Ec(2),r=mo(t,n,2),r!==null&&(Dc(n,r,t,e),ut(r,2),Tf(r));break}}t=t.return}}function pf(e,t,n){var r=e.pingCache;if(r===null){r=e.pingCache=new Yu;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)||(td=!0,i.add(n),e=mf.bind(null,e,t,n),t.then(e,e))}function mf(e,t,n){var r=e.pingCache;r!==null&&r.delete(t),e.pingedLanes|=e.suspendedLanes&n,e.warmLanes&=~n,Xu===e&&(Q&n)===n&&(rd===4||rd===3&&(Q&62914560)===Q&&300>Ve()-fd?X&2?od|=n:zd(e,0):od|=n,cd===Q&&(cd=0)),Tf(e)}function hf(e,t){t===0&&(t=ct()),e=wi(e,t),e!==null&&(ut(e,t),Tf(e))}function gf(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),hf(e,n)}function _f(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),hf(e,n)}function vf(e,t){return L(e,t)}var yf=null,bf=null,xf=!1,Sf=!1,Cf=!1,wf=0;function Tf(e){e!==bf&&e.next===null&&(bf===null?yf=bf=e:bf=bf.next=e),Sf=!0,xf||(xf=!0,Mf())}function Ef(e,t){if(!Cf&&Sf){Cf=!0;do for(var n=!1,r=yf;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-z(42|e)+1)-1,a&=i&~(o&~s),a=a&201326741?a&201326741|1:a?a|2:0}a!==0&&(n=!0,jf(r,a))}else a=Q,a=B(r,r===Xu?a:0,r.cancelPendingCommit!==null||r.timeoutHandle!==-1),!(a&3)||at(r,a)||(n=!0,jf(r,a))}r=r.next}while(n);Cf=!1}}function Df(){Of()}function Of(){Sf=xf=!1;var e=0;wf!==0&&hp()&&(e=wf);for(var t=Ve(),n=null,r=yf;r!==null;){var i=r.next,a=kf(r,t);a===0?(r.next=null,n===null?yf=i:n.next=i,i===null&&(bf=n)):(n=r,(e!==0||a&3)&&(Sf=!0)),r=i}_d!==0&&_d!==5||Ef(e,!1),wf!==0&&(wf=0)}function kf(e,t){for(var n=e.suspendedLanes,r=e.pingedLanes,i=e.expirationTimes,a=e.pendingLanes&-62914561;0<a;){var o=31-z(a),s=1<<o,c=i[o];c===-1?((s&n)===0||(s&r)!==0)&&(i[o]=st(s,t)):c<=t&&(e.expiredLanes|=s),a&=~s}if(t=Xu,n=Q,n=B(e,e===t?n:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),r=e.callbackNode,n===0||e===t&&(Zu===2||Zu===9)||e.cancelPendingCommit!==null)return r!==null&&r!==null&&Re(r),e.callbackNode=null,e.callbackPriority=0;if(!(n&3)||at(e,n)){if(t=n&-n,t===e.callbackPriority)return t;switch(r!==null&&Re(r),gt(n)){case 2:case 8:n=We;break;case 32:n=Ge;break;case 268435456:n=qe;break;default:n=Ge}return r=Af.bind(null,e),n=L(n,r),e.callbackPriority=t,e.callbackNode=n,t}return r!==null&&r!==null&&Re(r),e.callbackPriority=2,e.callbackNode=null,2}function Af(e,t){if(_d!==0&&_d!==5)return e.callbackNode=null,e.callbackPriority=0,null;var n=e.callbackNode;if(lf()&&e.callbackNode!==n)return null;var r=Q;return r=B(e,e===Xu?r:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),r===0?null:(Nd(e,r,t),kf(e,Ve()),e.callbackNode!=null&&e.callbackNode===n?Af.bind(null,e):null)}function jf(e,t){if(lf())return null;Nd(e,t,!0)}function Mf(){bp(function(){X&6?L(Ue,Df):Of()})}function Nf(){if(wf===0){var e=Fa;e===0&&(e=tt,tt<<=1,!(tt&261888)&&(tt=256)),wf=e}return wf}function Pf(e){return e==null||typeof e==`symbol`||typeof e==`boolean`?null:typeof e==`function`?e:mn(e)}function Ff(e,t,n,r,i){if(t===`submit`&&n&&n.stateNode===i){var a=Pf((i[xt]||null).action),o=r.submitter;o&&(t=(t=o[xt]||null)?Pf(t.formAction):o.getAttribute(`formAction`),t!==null&&(a=t,o=null));var s=new In(`action`,`action`,null,r,i);e.push({event:s,listeners:[{instance:null,listener:function(){if(r.defaultPrevented){if(wf!==0){var e=new FormData(i,o);Zs(n,{pending:!0,data:e,method:i.method,action:a},null,e)}}else typeof a==`function`&&(s.preventDefault(),e=new FormData(i,o),Zs(n,{pending:!0,data:e,method:i.method,action:a},a,e))},currentTarget:i}]})}}for(var If=0;If<di.length;If++){var Lf=di[If];fi(Lf.toLowerCase(),`on`+(Lf[0].toUpperCase()+Lf.slice(1)))}fi(ri,`onAnimationEnd`),fi(ii,`onAnimationIteration`),fi(ai,`onAnimationStart`),fi(`dblclick`,`onDoubleClick`),fi(`focusin`,`onFocus`),fi(`focusout`,`onBlur`),fi(oi,`onTransitionRun`),fi(si,`onTransitionStart`),fi(ci,`onTransitionCancel`),fi(li,`onTransitionEnd`),zt(`onMouseEnter`,[`mouseout`,`mouseover`]),zt(`onMouseLeave`,[`mouseout`,`mouseover`]),zt(`onPointerEnter`,[`pointerout`,`pointerover`]),zt(`onPointerLeave`,[`pointerout`,`pointerover`]),Rt(`onChange`,`change click focusin focusout input keydown keyup selectionchange`.split(` `)),Rt(`onSelect`,`focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange`.split(` `)),Rt(`onBeforeInput`,[`compositionend`,`keypress`,`textInput`,`paste`]),Rt(`onCompositionEnd`,`compositionend focusout keydown keypress keyup mousedown`.split(` `)),Rt(`onCompositionStart`,`compositionstart focusout keydown keypress keyup mousedown`.split(` `)),Rt(`onCompositionUpdate`,`compositionupdate focusout keydown keypress keyup mousedown`.split(` `));var Rf=`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(` `),zf=new Set(`beforetoggle cancel close invalid load scroll scrollend toggle`.split(` `).concat(Rf));function Bf(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){_i(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){_i(e)}i.currentTarget=null,a=c}}}}function $(e,t){var n=t[Ct];n===void 0&&(n=t[Ct]=new Set);var r=e+`__bubble`;n.has(r)||(Wf(t,e,2,!1),n.add(r))}function Vf(e,t,n){var r=0;t&&(r|=4),Wf(n,e,r,t)}var Hf=`_reactListening`+Math.random().toString(36).slice(2);function Uf(e){if(!e[Hf]){e[Hf]=!0,It.forEach(function(t){t!==`selectionchange`&&(zf.has(t)||Vf(t,!1,e),Vf(t,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[Hf]||(t[Hf]=!0,Vf(`selectionchange`,!1,t))}}function Wf(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,!Tn||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 Gf(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=At(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}Sn(function(){var r=a,i=_n(n),o=[];a:{var s=ui.get(e);if(s!==void 0){var c=In,u=e;switch(e){case`keypress`:if(jn(n)===0)break a;case`keydown`:case`keyup`:c=er;break;case`focusin`:u=`focus`,c=Gn;break;case`focusout`:u=`blur`,c=Gn;break;case`beforeblur`:case`afterblur`:c=Gn;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=Un;break;case`drag`:case`dragend`:case`dragenter`:case`dragexit`:case`dragleave`:case`dragover`:case`dragstart`:case`drop`:c=Wn;break;case`touchcancel`:case`touchend`:case`touchmove`:case`touchstart`:c=rr;break;case ri:case ii:case ai:c=Kn;break;case li:c=ir;break;case`scroll`:case`scrollend`:c=Rn;break;case`wheel`:c=ar;break;case`copy`:case`cut`:case`paste`:c=qn;break;case`gotpointercapture`:case`lostpointercapture`:case`pointercancel`:case`pointerdown`:case`pointermove`:case`pointerout`:case`pointerover`:case`pointerup`:c=tr;break;case`submit`:c=nr;break;case`toggle`:case`beforetoggle`:c=or}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=Cn(m,p),g!=null&&d.push(Kf(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!==gn&&(u=n.relatedTarget||n.fromElement)&&(At(u)||u[St]))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?At(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=Un,g=`onMouseLeave`,p=`onMouseEnter`,m=`mouse`,(e===`pointerout`||e===`pointerover`)&&(d=tr,g=`onPointerLeave`,p=`onPointerEnter`,m=`pointer`),f=s==null?u:Mt(s),h=c==null?u:Mt(c),u=new d(g,m+`leave`,s,n,i),u.target=f,u.relatedTarget=h,g=null,At(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,Jf):null,s!==null&&Yf(o,u,s,d,!1),c!==null&&f!==null&&Yf(o,f,c,d,!0)))}a:{if(s=r?Mt(r):window,c=s.nodeName&&s.nodeName.toLowerCase(),c===`select`||c===`input`&&s.type===`file`)var _=Er;else if(br(s)){if(Dr)_=Ir;else{_=Pr;var v=Nr}}else c=s.nodeName,!c||c.toLowerCase()!==`input`||s.type!==`checkbox`&&s.type!==`radio`?r&&dn(r.elementType)&&(_=Er):_=Fr;if(_&&=_(e,r)){xr(o,_,n,i);break a}v&&v(e,s,r)}switch(v=r?Mt(r):window,e){case`focusin`:(br(v)||v.contentEditable===`true`)&&(qr=v,Jr=r,Yr=null);break;case`focusout`:Yr=Jr=qr=null;break;case`mousedown`:Xr=!0;break;case`contextmenu`:case`mouseup`:case`dragend`:Xr=!1,Zr(o,n,i);break;case`selectionchange`:if(Kr)break;case`keydown`:case`keyup`:Zr(o,n,i)}var y;if(cr)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 gr?mr(e,n)&&(b=`onCompositionEnd`):e===`keydown`&&n.keyCode===229&&(b=`onCompositionStart`);b&&(dr&&n.locale!==`ko`&&(gr||b!==`onCompositionStart`?b===`onCompositionEnd`&&gr&&(y=An()):(Dn=i,On=`value`in Dn?Dn.value:Dn.textContent,gr=!0)),v=qf(r,b),0<v.length&&(b=new Jn(b,e,null,n,i),o.push({event:b,listeners:v}),y?b.data=y:(y=hr(n),y!==null&&(b.data=y)))),(y=ur?_r(e,n):vr(e,n))&&(b=qf(r,`onBeforeInput`),0<b.length&&(v=new Jn(`onBeforeInput`,`beforeinput`,null,n,i),o.push({event:v,listeners:b}),v.data=y)),Ff(o,e,r,n,i)}Bf(o,t)})}function Kf(e,t,n){return{instance:e,listener:t,currentTarget:n}}function qf(e,t){for(var n=t+`Capture`,r=[];e!==null;){var i=e,a=i.stateNode;if(i=i.tag,i!==5&&i!==26&&i!==27||a===null||(i=Cn(e,n),i!=null&&r.unshift(Kf(e,i,a)),i=Cn(e,t),i!=null&&r.push(Kf(e,i,a))),e.tag===3)return r;e=e.return}return[]}function Jf(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5&&e.tag!==27);return e||null}function Yf(e,t,n,r,i){for(var a=t._reactName,o=[];n!==null&&n!==r;){var s=n,c=s.alternate,l=s.stateNode;if(s=s.tag,c!==null&&c===r)break;s!==5&&s!==26&&s!==27||l===null||(c=l,i?(l=Cn(n,a),l!=null&&o.unshift(Kf(n,l,c))):i||(l=Cn(n,a),l!=null&&o.push(Kf(n,l,c)))),n=n.return}o.length!==0&&e.push({event:t,listeners:o})}var Xf=/\r\n?/g,Zf=/\u0000|\uFFFD/g;function Qf(e){return(typeof e==`string`?e:``+e).replace(Xf,`
|
|
9
|
+
`).replace(Zf,``)}function $f(e,t){return t=Qf(t),Qf(e)===t}function ep(e,t,n,r,i,a){switch(n){case`children`:if(typeof r==`string`)t===`body`||t===`textarea`&&r===``||sn(e,r);else if(typeof r==`number`||typeof r==`bigint`)t!==`body`&&sn(e,``+r);else return;break;case`className`:Kt(e,`class`,r);break;case`tabIndex`:Kt(e,`tabindex`,r);break;case`dir`:case`role`:case`viewBox`:case`width`:case`height`:Kt(e,n,r);break;case`style`:un(e,r,a);return;case`data`:if(t!==`object`){Kt(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=mn(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`&&ep(e,t,`name`,i.name,i,null),ep(e,t,`formEncType`,i.formEncType,i,null),ep(e,t,`formMethod`,i.formMethod,i,null),ep(e,t,`formTarget`,i.formTarget,i,null)):(ep(e,t,`encType`,i.encType,i,null),ep(e,t,`method`,i.method,i,null),ep(e,t,`target`,i.target,i,null))),r==null||typeof r==`symbol`||typeof r==`boolean`){e.removeAttribute(n);break}r=mn(r),e.setAttribute(n,r);break;case`onClick`:r!=null&&(e.onclick=hn);return;case`onScroll`:r!=null&&$(`scroll`,e);return;case`onScrollEnd`:r!=null&&$(`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=mn(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`:$(`beforetoggle`,e),$(`toggle`,e),Gt(e,`popover`,r);break;case`xlinkActuate`:qt(e,`http://www.w3.org/1999/xlink`,`xlink:actuate`,r);break;case`xlinkArcrole`:qt(e,`http://www.w3.org/1999/xlink`,`xlink:arcrole`,r);break;case`xlinkRole`:qt(e,`http://www.w3.org/1999/xlink`,`xlink:role`,r);break;case`xlinkShow`:qt(e,`http://www.w3.org/1999/xlink`,`xlink:show`,r);break;case`xlinkTitle`:qt(e,`http://www.w3.org/1999/xlink`,`xlink:title`,r);break;case`xlinkType`:qt(e,`http://www.w3.org/1999/xlink`,`xlink:type`,r);break;case`xmlBase`:qt(e,`http://www.w3.org/XML/1998/namespace`,`xml:base`,r);break;case`xmlLang`:qt(e,`http://www.w3.org/XML/1998/namespace`,`xml:lang`,r);break;case`xmlSpace`:qt(e,`http://www.w3.org/XML/1998/namespace`,`xml:space`,r);break;case`is`:Gt(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=fn.get(n)||n,Gt(e,n,r);else return}V=!0}function tp(e,t,n,r,i,a){switch(n){case`style`:un(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`)sn(e,r);else if(typeof r==`number`||typeof r==`bigint`)sn(e,``+r);else return;break;case`onScroll`:r!=null&&$(`scroll`,e);return;case`onScrollEnd`:r!=null&&$(`scrollend`,e);return;case`onClick`:r!=null&&(e.onclick=hn);return;case`suppressContentEditableWarning`:case`suppressHydrationWarning`:case`innerHTML`:case`ref`:return;case`innerText`:case`textContent`:return;default:if(!Lt.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[xt]||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}V=!0,n in e?e[n]=r:!0===r?e.setAttribute(n,``):Gt(e,n,r)}return}V=!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`:$(`error`,e),$(`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:ep(e,t,a,o,n,null)}}i&&ep(e,t,`srcSet`,n.srcSet,n,null),r&&ep(e,t,`src`,n.src,n,null);return;case`input`:$(`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:ep(e,t,r,d,n,null)}}tn(e,a,c,l,u,o,i,!1);return;case`select`:for(i in $(`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:ep(e,t,i,c,n,null)}t=a,n=o,e.multiple=!!r,t==null?n!=null&&rn(e,!!r,n,!0):rn(e,!!r,t,!1);return;case`textarea`:for(o in $(`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:ep(e,t,o,c,n,null)}on(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:ep(e,t,l,r,n,null)}return;case`dialog`:$(`beforetoggle`,e),$(`toggle`,e),$(`cancel`,e),$(`close`,e);break;case`iframe`:case`object`:$(`load`,e);break;case`video`:case`audio`:for(r=0;r<Rf.length;r++)$(Rf[r],e);break;case`image`:$(`error`,e),$(`load`,e);break;case`details`:$(`toggle`,e);break;case`embed`:case`source`:case`link`:$(`error`,e),$(`load`,e);case`area`:case`base`:case`br`:case`col`:case`hr`:case`keygen`:case`meta`:case`param`:case`track`:case`wbr`:case`menuitem`:for(u in n)if(n.hasOwnProperty(u)&&(r=n[u],r!=null))switch(u){case`children`:case`dangerouslySetInnerHTML`:throw Error(s(137,t));default:ep(e,t,u,r,n,null)}return;default:if(dn(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&&ep(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)||ep(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&&(V=!0),a=m;break;case`name`:m!==f&&(V=!0),i=m;break;case`checked`:m!==f&&(V=!0),u=m;break;case`defaultChecked`:m!==f&&(V=!0),d=m;break;case`value`:m!==f&&(V=!0),o=m;break;case`defaultValue`:m!==f&&(V=!0),c=m;break;case`children`:case`dangerouslySetInnerHTML`:if(m!=null)throw Error(s(137,t));break;default:m!==f&&ep(e,t,p,m,r,f)}}en(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)||ep(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&&(V=!0),p=a;break;case`defaultValue`:a!==l&&(V=!0),c=a;break;case`multiple`:a!==l&&(V=!0),o=a;default:a!==l&&ep(e,t,i,a,r,l)}t=c,n=o,r=m,p==null?!!r!=!!n&&(t==null?rn(e,!!n,n?[]:``,!1):rn(e,!!n,t,!0)):rn(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:ep(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&&(V=!0),p=i;break;case`defaultValue`:i!==a&&(V=!0),m=i;break;case`children`:break;case`dangerouslySetInnerHTML`:if(i!=null)throw Error(s(91));break;default:i!==a&&ep(e,t,o,i,r,a)}an(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:ep(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&&(V=!0),e.selected=p&&typeof p!=`function`&&typeof p!=`symbol`;break;default:ep(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)&&ep(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:ep(e,t,u,p,r,m)}return;default:if(dn(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)&&ep(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||ep(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[bt]=r,n[xt]=t,np(n,e,t),Pt(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[Dt]||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=At(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),kt(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[Dt])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&&ep(e,t,r,null,rp,i)}n.dangerouslySetInnerHTML!=null&&(e.textContent=``),e.onclick===hn&&(e.onclick=null),kt(e)}function _m(e){for(var t=e.attributes;t.length;)e.removeAttributeNode(t[0]);kt(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=I.d;I.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=Ld();return e||t}function Cm(e){var t=jt(e);t!==null&&t.tag===5&&t.type===`form`?$s(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=$t(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),Pt(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="`+$t(t)+`"]`;t===`image`&&n&&n.imageSrcSet?(i+=`[imagesrcset="`+$t(n.imageSrcSet)+`"]`,typeof n.imageSizes==`string`&&(i+=`[imagesizes="`+$t(n.imageSizes)+`"]`)):i+=`[href="`+$t(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[Ot]=!0,o.onload=o.onerror=function(){Ft(o)}),Pt(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="`+$t(r)+`"][href="`+$t(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),Pt(r),n.head.appendChild(r)}}}function Am(e,t,n){xm.S(e,t,n);var r=wm;if(r&&e){var i=Nt(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`);Pt(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=Nt(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`),Pt(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=Nt(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`),Pt(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=we.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=Nt(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=Nt(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=Nt(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="`+$t(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[Ot]){r.loading=1;return}}else t=e.createElement(`link`),t[Ot]=!0,t.onload=t.onerror=Ft.bind(null,t),np(t,`link`,n),Pt(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="`+$t(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~="`+$t(n.href)+`"]`);if(r)return t.instance=r,Pt(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`),Pt(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,Pt(a),a;r=Im(n),(i=vm.get(i))&&Hm(r,i),a=(e.ownerDocument||e).createElement(`link`),Pt(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,Pt(i),i):(r=n,(i=vm.get(a))&&(r=D({},n),Um(r,i)),e=e.ownerDocument||e,i=e.createElement(`script`),Pt(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[Dt]||a[bt]||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,Pt(a);return}a=t.ownerDocument||t,r=Im(r),(i=vm.get(i))&&Hm(r,i),a=a.createElement(`link`),Pt(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:re,Provider:null,Consumer:null,_currentValue:ge,_currentValue2:ge,_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=lt(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=lt(0),this.hiddenUpdates=lt(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=ki(3,null,null,t),e.current=a,a.stateNode=e,t=Oa(),t.refCount++,e.pooledCache=t,t.refCount++,a.memoizedState={element:r,isDehydrated:n,cache:t},uo(a),e}function uh(e){return e?(e=Di,e):Di}function dh(e,t,n,r,i,a){i=uh(i),r.context===null?r.context=i:r.pendingContext=i,r=po(t),r.payload={element:n},a=a===void 0?null:a,a!==null&&(r.callback=a),n=mo(e,r,t),n!==null&&(Md(n,e,t),ho(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=wi(e,67108864);t!==null&&Md(t,e,67108864),ph(e,67108864)}}function hh(e){if(e.tag===13||e.tag===31){var t=kd();t=ht(t);var n=wi(e,t);n!==null&&Md(n,e,t),ph(e,t)}}var gh=!0;function _h(e,t,n,r){var i=F.T;F.T=null;var a=I.p;try{I.p=2,yh(e,t,n,r)}finally{I.p=a,F.T=i}}function vh(e,t,n,r){var i=F.T;F.T=null;var a=I.p;try{I.p=8,yh(e,t,n,r)}finally{I.p=a,F.T=i}}function yh(e,t,n,r){if(gh){var i=bh(r);if(i===null)Gf(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=jt(i);if(a!==null)switch(a.tag){case 3:if(a=a.stateNode,a.current.memoizedState.isDehydrated){var o=it(a.pendingLanes);if(o!==0){var s=a;for(s.pendingLanes|=2,s.entangledLanes|=2;o;){var c=1<<31-z(o);s.entanglements[1]|=c,o&=~c}Tf(a),!(X&6)&&(md=Ve()+500,Ef(0,!1))}}break;case 31:case 13:s=wi(a,2),s!==null&&Md(s,a,2),Ld(),ph(a,2)}if(a=bh(r),a===null&&Gf(e,t,r,xh,n),a===i)break;i=a}i!==null&&r.stopPropagation()}else Gf(e,t,r,null,n)}}function bh(e){return e=_n(e),Sh(e)}var xh=null;function Sh(e){if(xh=null,e=At(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(He()){case Ue:return 2;case We:return 8;case Ge:case Ke:return 32;case qe: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=jt(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=At(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,vt(e.priority,function(){hh(n)});return}}else if(t===31){if(t=d(n),t!==null){e.blockedOn=t,vt(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);gn=r,n.target.dispatchEvent(r),gn=null}else return t=jt(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=jt(n);a!==null&&(e.splice(t,3),t-=3,Zs(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[xt]||null;if(typeof a==`function`)o||Vh(n);else if(o){var s=null;if(a&&a.hasAttribute(`formAction`)){if(i=a,o=a[xt]||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,kd(),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),Ld(),t[St]=null}};function Gh(e){this._internalRoot=e}Gh.prototype.unstable_scheduleHydration=function(e){if(e){var t=_t();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`));I.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:F,reconcilerVersion:`19.3.1`};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<`u`){var Jh=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Jh.isDisabled&&Jh.supportsFiber)try{Xe=Jh.inject(qh),Ze=Jh}catch{}}e.createRoot=function(e,t){if(!c(e))throw Error(s(299));var n=!1,r=``,i=bc,a=xc,o=Sc;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[St]=t.current,Uf(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=o(),d=c();function f(e){return e>=55296&&e<=56319}function p(e){return e>=56320&&e<=57343}function m(e,t){let n=Math.min(e.length,Math.max(0,Math.floor(t)));return n>0&&n<e.length&&f(e.charCodeAt(n-1))&&p(e.charCodeAt(n))&&--n,e.slice(0,n)}function h(e,t){return Math.max(0,Date.parse(t)-Date.parse(e))}function g(e){return e.replace(/\s+/g,` `).trim()}function _(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 v(e,t){return e.length<=t?e:`${m(e,Math.max(0,t-1)).trimEnd()}…`}function y(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 b(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 x(e){return Number.isFinite(e)?e>0&&e<.01?`<$0.01`:`$${e.toFixed(e>=10?1:2)}`:`$0`}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`,k=`ensemble-token`,A={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}},j={kind:`system`,label:`Ensemble`},ee=e=>`question:${e}`,te=v;function ne(e,t=160){let n=e[0];return n?te(n.text.replace(/\s+/g,` `).trim(),t):``}function re(e,t){return t.runId?`${e}:${t.runId}:${t.data.itemId}`:`${e}:${t.data.itemId}`}function M(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 N(e,t){let n=e.idx.items.get(t);return n===void 0?void 0:e.timeline[n]}function ie(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 ae(e,t,n,r){M(e,{...t,status:n,updatedAt:r.at,outcome:r}),e.openQuestions.delete(t.questionId)}function oe(e,t,n,r=()=>!0){if(e.openQuestions.size!==0)for(let i of[...e.openQuestions]){let a=N(e,ee(i));!a||a.status!==`open`?e.openQuestions.delete(i):r(a)&&ae(e,a,`expired`,{at:t,by:j,reason:n})}}function se(e,t){if(!t)return;let n=e.idx.runs.get(t);return n===void 0?void 0:e.runs[n]}function ce(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 le(e,t){let n=e.idx.messages.get(t);return n===void 0?void 0:e.messages[n]}function ue(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 de(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 fe(e){if(e.activeRunId)return se(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 P(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 pe(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=P(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=de(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=fe(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 me(e,t){let n=pe(e);if(e.activityKey===n.key)return;e.activityKey=n.key;let{key:r,...i}=n;e.activity={...i,since:t}}function he(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 F(e){return e===`applied`||e===`failed`||e===`cancelled`}function I(e,t){return F(e.stage)||t.stage!==`failed`&&t.stage!==`cancelled`&&he(t)<=he(e)?e:{...t,history:[...e.history,t].slice(-12)}}function ge(e){return e.stage===`queued`?e.queuedBy===`harness`?`queued_harness`:`queued_ensemble`:e.stage}function _e(e,t){let n=t.data;ie(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=h(a.startedAt,a.endedAt)),M(e,a)}function ve(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=h(i.startedAt,i.endedAt)),t.status!==`failed`&&i.status===`failed`&&(e.counters.failedTools+=1),M(e,i)}function ye(e,t){let n=e.runMarks??={};return n[t]??={}}function be(e,t,n,r,i){t&&n!==void 0&&n.trim()!==``&&(ye(e,t).firstText??={at:r,streamed:i})}function xe(e,t){switch(t.kind){case`message.sent`:{let n=t.data.message;ue(e,n),M(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=le(e,t.data.messageId);if(!n)break;let r=I(n.delivery,t.data.record);if(r!==n.delivery){let i=n.kind===`steer`&&t.runId!==void 0&&se(e,t.runId)?.messageId===n.id,a=i?t.runId:n.runId;ue(e,{...n,delivery:r,runId:a});let o=N(e,`message:${n.id}`);o&&M(e,{...o,runId:a,updatedAt:t.at});let s=se(e,t.runId);s&&!i&&n.kind===`steer`&&t.data.record.stage===`applied`&&ce(e,{...s,steerCount:s.steerCount+1})}break}case`assistant.delta`:{let n=re(`assistant`,t),r=N(e,n);r?M(e,{...r,text:r.text+t.data.text,streaming:!0,updatedAt:t.at,...t.data.phase?{phase:t.data.phase}:{}}):(ie(e,t.at),M(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}:{}})),be(e,t.runId,t.data.text,t.at,!0);break}case`assistant.completed`:{let n=re(`assistant`,t),r=N(e,n),i=t.data.phase??r?.phase;r?M(e,{...r,text:t.data.text??r.text,streaming:!1,updatedAt:t.at,...i?{phase:i}:{}}):t.data.text&&(ie(e,t.at),M(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}:{}})),be(e,t.runId,t.data.text??r?.text,t.at,!1);break}case`reasoning.delta`:{let n=re(`reasoning`,t),r=N(e,n);r?M(e,{...r,text:r.text+t.data.text,streaming:!0,updatedAt:t.at}):(ie(e,t.at),M(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=N(e,re(`reasoning`,t));n&&M(e,{...n,streaming:!1,updatedAt:t.at,...t.data.durationMs===void 0?{}:{durationMs:t.data.durationMs}});break}case`tool.updated`:{let n=N(e,`tool:${t.data.callId}`);n?ve(e,n,t):_e(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=N(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);M(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},M(e,{type:`plan`,id:`plan:${n}`,runId:n,at:N(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;if(n){let r=e.usageByRun[n],i={...r,...t.data.usage};e.usageByRun[n]=i,i.outputTokens!==void 0&&i.outputTokens!==r?.outputTokens&&(ye(e,n).outputAt=t.at)}break}case`diagnostic`:M(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=ee(n.id);if(N(e,r))break;ie(e,t.at),M(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=N(e,ee(n.questionId));if(!r||r.status!==`open`)break;ae(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=le(e,n);r&&ue(e,{...r,sync:{toOrigin:`delivered`,at:t.data.at}})}}}var Se=new Set([`completed`,`failed`,`cancelled`]);function Ce(e,t,n,r){let i=se(e,t.runId);if(!i||Se.has(i.status))return;let a={...i,...r,status:n,endedAt:t.at};ce(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}))}oe(e,t.at,n===`cancelled`?`cancelled`:`run_ended`,e=>!e.runId||e.runId===i.id);let o=i.startedAt?h(i.startedAt,t.at):void 0;M(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 we(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},...typeof n.fast==`boolean`?{fast:n.fast}:{},...n.nativeRef===void 0?{}:{nativeRef:n.nativeRef},...n.capabilities===void 0?{}:{capabilities:n.capabilities},...n.accessEnforcement===void 0?{}:{accessEnforcement:n.accessEnforcement}},n.fast===null&&delete e.meta.fast;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`)&&oe(e,t.at,t.data.status===`lost`?`restarted`:`session_closed`);break;case`run.queued`:{ce(e,t.data.run);let n=le(e,t.data.run.messageId);n&&!n.runId&&ue(e,{...n,runId:t.data.run.id}),e.status===`idle`&&(e.status=`queued`);break}case`run.starting`:{let n=se(e,t.runId);if(n?.status!==`queued`||e.activeRunId)break;ce(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=se(e,t.runId);if(!n||n.status!==`queued`&&n.status!==`starting`||e.activeRunId&&e.activeRunId!==n.id||e.status===`stopped`)break;ce(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,M(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`:Ce(e,t,`completed`,t.data.stopReason?{stopReason:t.data.stopReason}:{});break;case`run.failed`:Ce(e,t,`failed`,{error:t.data.error});break;case`run.cancelled`:Ce(e,t,`cancelled`,{})}}function Te(e){let t=e.access;return t===`read_only`||t===`full`?e:{...e,access:`full`}}function Ee(e){return{meta:Te(e.data.meta),status:`starting`,runs:[],messages:[],timeline:[],activity:{kind:`starting`,since:e.at},activityKey:`starting`,usageByRun:{},runMarks:{},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 De(e){let t=e[0];if(!t||t.kind!==`session.created`)return;let n=Ee(t);for(let t=1;t<e.length;t++){let r=e[t];r&&Oe(n,r)}return n}function Oe(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`:we(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`:xe(e,t)}return me(e,t.at),!0}function ke(){return document.querySelector(`meta[name="${k}"]`)?.getAttribute(`content`)||(new URLSearchParams(location.search).get(`token`)??``)}var Ae=ke(),je=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 Me(e,t,n,r){let i;try{i=await fetch(t,{method:e,headers:{[O]:Ae,...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 je(`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 je(e?.code??`http_error`,e?.message??`HTTP ${i.status}`,i.status,e?.details)}return o}function Ne(e,t){let n={};try{n=e?JSON.parse(e):{}}catch{n={}}let r=n.error;return new je(r?.code??`http_error`,r?.message??`HTTP ${t}`,t)}async function Pe(e,t){let n;try{n=await fetch(e,{method:`GET`,headers:{[O]:Ae},...t?{signal:t}:{}})}catch(e){throw e instanceof DOMException&&e.name===`AbortError`?e:new je(`network`,`Cannot reach the Ensemble service`,0)}let r=await n.text();if(!n.ok)throw Ne(r,n.status);return{text:r,disposition:n.headers?.get(`content-disposition`)??null}}function Fe(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 Ie(e,t){let n=e.replace(/[^\w-]/g,`_`).slice(0,16);return`ensemble-${t.scope}-${n}.md`}var Le=encodeURIComponent,L={version:(e=!1,t)=>Me(`GET`,e?`/api/version?refresh=1`:`/api/version`,void 0,t),updateVersion:(e,t,n)=>Me(`POST`,`/api/version/update`,{target:e,version:t},n),state:e=>Me(`GET`,`/api/state`,void 0,e),harnesses:(e=!1)=>Me(`GET`,`/api/harnesses${e?`?refresh=1`:``}`),setAllowedModels:(e,t,n,r,i)=>{let a={...t===void 0?{}:{allowed:t},...n?{efforts:n}:{},...r===void 0?{}:{userDefaultModel:r},...i===void 0?{}:{fastMode:i}};return Me(`PUT`,`/api/harnesses/${Le(e)}/models`,a)},setConcurrency:e=>Me(`PUT`,`/api/settings/concurrency`,{max:e}),putProfile:(e,t)=>Me(`PUT`,`/api/profiles/${Le(e)}`,t),removeProfile:e=>Me(`DELETE`,`/api/profiles/${Le(e)}`),renameProfile:(e,t)=>Me(`POST`,`/api/profiles/${Le(e)}/rename`,{to:t}),session:(e,t)=>Me(`GET`,`/api/sessions/${Le(e)}`,void 0,t),git:(e,t)=>Me(`GET`,`/api/git?path=${Le(e)}`,void 0,t),events:(e,t)=>Me(`GET`,`/api/sessions/${Le(e)}/events?after=${t}`),send:(e,t)=>Me(`POST`,`/api/sessions/${Le(e)}/messages`,t),answerQuestion:(e,t,n)=>Me(`POST`,`/api/sessions/${Le(e)}/questions/${Le(t)}/answer`,n),declineQuestion:(e,t,n={})=>Me(`POST`,`/api/sessions/${Le(e)}/questions/${Le(t)}/decline`,n),cancel:e=>Me(`POST`,`/api/sessions/${Le(e)}/cancel`,{}),stop:e=>Me(`POST`,`/api/sessions/${Le(e)}/stop`,{}),remove:e=>Me(`DELETE`,`/api/sessions/${Le(e)}`),sessions:(e={},t)=>Me(`GET`,`/api/sessions${e.archived?`?archived=${e.archived}`:``}`,void 0,t),archive:e=>Me(`POST`,`/api/sessions/archive`,{ids:e}),unarchive:(e,t={})=>Me(`POST`,`/api/sessions/unarchive`,{ids:e,...t.exact?{exact:!0}:{}}),retention:e=>Me(`GET`,`/api/retention`,void 0,e),setRetention:e=>Me(`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 Pe(`/api/sessions/${Le(e)}/report?${r.toString()}`,n);return{text:i,filename:Fe(a)??Ie(e,t)}}};function Re(){return`/api/stream?token=${encodeURIComponent(Ae)}`}function ze(e,t){return e.sessions[t]??e.archived[t]}var Be=new Set;function Ve(){let e=new Set;return Be.add(e),{touched:e,stop:()=>{Be.delete(e)}}}var He;function Ue(){He?.stop(),He=Ve()}function We(){let e=He?.touched??new Set;return He?.stop(),He=void 0,e}function Ge(e){for(let t of Be)t.add(e)}function Ke(e,t){let{[t]:n,...r}=e;return r}function qe(e,t,n){return e.archivedLoaded?Object.keys(t).length:e.archivedCount===void 0?void 0:Math.max(0,e.archivedCount+n)}function Je(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(Ge(n),t.archivedAt!==void 0){let i={...e.archived,[n]:t};return r?{sessions:Ke(e.sessions,n),archived:i,archivedCount:qe(e,i,1)}:{archived:i,archivedCount:qe(e,i,0)}}if(r)return{sessions:{...e.sessions,[n]:t}};let o={...e.sessions,[n]:t};if(i){let t=Ke(e.archived,n);return{sessions:o,archived:t,archivedCount:qe(e,t,-1)}}return!e.archivedLoaded&&e.snapshotAt!==void 0&&t.createdAt<e.snapshotAt?{sessions:o,archivedCount:qe(e,e.archived,-1)}:{sessions:o}}function Ye(e,t){if(e.sessions[t])return Ge(t),{sessions:Ke(e.sessions,t)};if(e.archived[t]){Ge(t);let n=Ke(e.archived,t);return{archived:n,archivedCount:qe(e,n,-1)}}return Ge(t),{}}function Xe(e,t){let n=Object.fromEntries(t.sessions.map(e=>[e.id,e]));for(let e of Object.keys(n))Ge(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 Ze(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 R=(e,t,n)=>Number(e)===1?t:n,z=e=>Number(e.n),Qe={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.agy":`Antigravity CLI`,"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.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} 个模型`,"harness.fast":`Fast`,"harness.fastGroup":`{name} 的 Fast 策略`,"harness.fastMode.off":`默认关闭`,"harness.fastMode.on":`默认开启`,"harness.fastMode.disabled":`禁止开启`,"harness.fastNote.off":`默认用标准速度;主 Agent 或角色明确要求 Fast 时,仍可使用。`,"harness.fastNote.on":`支持 Fast 的模型默认用 Fast;明确要求标准速度时,仍按标准速度运行。`,"harness.fastNote.disabled":`一律用标准速度;明确要求 Fast 的委派会被拒绝,不会降级。`,"harness.fastNoModel":`目前读到的模型里没有标明支持 Fast 的,这项策略暂时不会生效。`,"harness.fastModelTip":`这个模型支持 Fast`,"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":`这个级别没有任何约束。`,"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 会话`,"native.agy-session":`Antigravity CLI 会话`,"topbar.settings":`设置`,"settings.title":`设置`,"settings.sections":`设置分区`,"settings.section.executors":`执行端`,"settings.section.profiles":`角色`,"settings.section.general":`通用`,"settings.section.history":`历史`,"settings.section.version":`版本`,"version.running":`当前运行`,"version.development":`源码开发版`,"version.latest":`npm 最新版本`,"version.lastKnown":`上次获取的 npm 版本`,"version.check":`检查更新`,"version.checking":`正在检查更新…`,"version.checked":`最近检查于 {time}`,"version.current":`已是最新版本。`,"version.devCurrent":`当前开发版的版本号与 npm 最新版本一致。`,"version.available":`有新版本可用。`,"version.copiesAvailable":`有本机安装副本可以更新。`,"version.ahead":`当前运行版本领先于 npm 最新版本。`,"version.unknown":`当前运行版本无法与 npm 版本比较。`,"version.restart":`新版已安装,重启本地服务后生效。`,"version.installs":`本机安装`,"version.target.checkout":`源码工作树`,"version.target.codex":`Codex 插件`,"version.target.cursor":`Cursor 插件`,"version.target.global":`npm 全局安装`,"version.update":`更新至 v{version}`,"version.updateTarget":`将{target}更新至 v{version}`,"version.installing":`更新中…`,"version.updating":`正在更新{target}…`,"version.activate.service":`{target}已更新至 v{version}。重启使用这份安装的本地服务后生效。`,"version.activate.codex":`Codex 插件已更新至 v{version}。重新加载 Codex 插件,并重启使用该副本的本地服务后生效。`,"version.activate.cursor":`Cursor 插件已更新至 v{version}。重新载入 Cursor 窗口,并重启使用该副本的本地服务后生效。`,"version.checkoutNote":`更新源码会将干净的官方 main 分支快进到 npm 发布包对应的提交。`,"version.standalone":`这份服务从独立副本启动,请用原安装方式替换为新版。`,"version.unsupported":`当前运行的服务还不支持版本管理。请重启已更新的本地服务。`,"version.error.registry":`暂时无法从 npm 确认最新版本,可以重新检查。`,"version.error.connection":`无法连接本地版本服务,请重试。`,"version.error.changed":`发布版本或本机安装状态已变化,请重新检查。`,"version.error.missing":`找不到这份受管理的安装,请重新检查。`,"version.error.npm":`找不到 npm,请安装 Node.js 自带的 npm 后重试。`,"version.error.permissions":`安装目录暂时无法写入,请检查权限和文件占用后重试。`,"version.error.install":`更新未完成,请检查网络和安装环境后重试。`,"version.error.codex":`Codex 未能刷新已登记的插件,请检查本机 Codex 命令和个人插件市场。`,"version.error.dirty":`源码工作树有本地改动。请先处理这些改动,再更新源码。`,"version.error.branch":`源码更新需要官方 Ensemble 仓库的 main 分支。`,"version.error.revision":`未能取得与 npm 发布版本匹配的源码提交。`,"version.error.diverged":`当前分支无法快进到发布提交,请在仓库中手动处理。`,"version.error.rollback":`文件恢复未完成,旧副本的备份保留在`,"settings.executors.summary":`{ready}/{total} 可用`,"settings.executors.reorder":`调整 {name} 的顺序`,"settings.executors.reorderHint":`拖动排序,或点击选择移动方向`,"settings.executors.moveUp":`上移`,"settings.executors.moveDown":`下移`,"settings.executors.moved":`{name} 已移至第 {position} 位,共 {total} 个执行端`,"settings.profiles.summary":`{ready}/{total} 可用`,"settings.profiles.legacy":`不可用`,"settings.language":`语言 / Language`,"settings.languageNote":`只保存在这个浏览器里,选中即生效。`,"profiles.intro":`给常用配置起名后,主 Agent 可以按名字委派。选「默认」会沿用「{section}」里的模型与 Fast 策略、该模型的默认推理强度和完全访问权限。更改自动保存,所有宿主共用。`,"profiles.standard":`标准`,"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}」没有可用的推理强度。`,"profiles.issue.fast_disabled":`设置中已禁止 {harness} 开启 Fast。`,"profiles.issue.fast_harness":`执行端 {harness} 不支持 Fast。`,"profiles.issue.fast_model":`模型「{model}」不支持 Fast。`,"profiles.issue.fast_unverified":`模型目录尚未确认「{model}」支持 Fast。`,"settings.concurrency":`并发上限`,"settings.concurrencyNote":`同时运行的会话数上限,所有宿主和浏览器共用,改动立即生效。超出的会话排队等候;调低不会中断正在运行的会话。`,"settings.concurrencyLimited":`限制`,"settings.concurrencyUnlimited":`不限制`,"settings.concurrencyValue":`最多同时运行的会话数`,"settings.concurrencyDecrease":`减少`,"settings.concurrencyIncrease":`增加`,"settings.concurrencySource.startup":`由启动服务的程序固定,这里不能修改`,"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":`对话上下文已压缩`,"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":`对话上下文已压缩`,"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":`对话上下文已压缩`,"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.partial":`交接时仍在进行,这是已写下的部分`,"handoff.laterNone":`更新的第 {run} 次运行没有产出`,"handoff.laterNoneYet":`更新的第 {run} 次运行当时还没有产出`,"handoff.earlierFinal":`更早的第 {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.speed":`速度`,"sum.noPlan":`执行端还没有给出计划。`,"sum.noPlanSupport":`这个执行端不提供计划信息。`,"sum.noFiles":`还没有文件变更记录。`,"sum.noFileEvents":`这个执行端不上报结构化的文件变更;通过 shell 修改的文件不会出现在这里。`,"sum.noUsage":`还没有用量数据。`,"sum.noUsageSupport":`这个执行端不提供用量信息。`,"sum.noSpeed":`还没有运行开始,没有可计时的内容。`,"sum.speedStarting":`正在连接执行端,运行开始后开始计时。`,"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":`上下文占用`,"speed.first":`首次响应`,"speed.text":`首字`,"speed.rate":`输出速率`,"speed.latest":`最近一次 · 第 {n} 次运行`,"speed.live":`进行中`,"speed.textWhole":`全文一次给出`,"speed.before":`此前有 {n} 次工具调用或等待`,"speed.tokens":`{tokens} tokens`,"speed.active":`有效 {time}`,"speed.gap.unreported":`执行端没有上报输出 token`,"speed.gap.waiting":`还没有收到输出 token 的上报`,"speed.gap.zero":`上报的输出 token 为 0`,"speed.gap.short":`有效时长不足 0.1 秒,不给速率`,"speed.kind.reasoning":`推理`,"speed.kind.assistant":`文字`,"speed.kind.tool":`工具调用`,"speed.kind.question":`提问`,"speed.tip.first":`从运行开始,到第一次出现推理、文字、工具调用或提问(这次是{kind}):{time}。`,"speed.tip.firstWait":`运行已经开始,还没有出现推理、文字、工具调用或提问。`,"speed.tip.firstNone":`这次运行没有出现推理、文字、工具调用或提问。`,"speed.tip.queued":`排队与启动用了 {time},没有计入。`,"speed.tip.clock":`各执行端标记“运行开始”的时间点不同(有的要等第一条输出到达),所以首次响应不宜在执行端之间直接比较。`,"speed.tip.text":`从运行开始,到第一段文字的第一个增量到达 Ensemble:{time}。`,"speed.tip.textBefore":`其中有 {tools} 次工具调用、{waits} 次等待回答,占 {time}(重叠只算一次)。`,"speed.tip.textSince":`最后一步结束到首字:{time}。`,"speed.tip.textWhole":`执行端没有流式给出文字,而是在运行开始 {time} 后一次给出了全文。这是全文出现的时间,不是首字,所以不记作首字。`,"speed.tip.textWait":`还没有出现文字。`,"speed.tip.textNone":`这次运行没有产生文字。`,"speed.tip.textUnattributed":`时间线里有文字,但旧记录没有标记它属于哪次运行,无法计入首字。`,"speed.tip.rate":`{tokens} tokens ÷ 有效时长 {active} = {rate} tok/s`,"speed.tip.spanEnded":`计时区间:运行开始到运行结束,共 {span}。`,"speed.tip.spanAsOf":`计时区间:运行开始到最近一次输出 token 上报({time}),共 {span};运行没有结束(或没收到结束事件),不含此后的时间。`,"speed.tip.excluded":`已扣除工具调用与等待回答:{time}({tools} 次工具、{waits} 次等待,重叠只算一次)。`,"speed.tip.unbounded":`另有 {n} 个工具没有上报结束时间,没能扣除。`,"speed.tip.whole":`整轮平均(不扣除):{rate} tok/s。`,"speed.tip.reasoning":`其中推理 {tokens} tokens。`,"speed.tip.latency":`有效时长仍含第一个 token 之前的等待与网络往返,所以不等于纯解码速度。`,"speed.tip.source":`token 数由执行端上报,不按文字长度估算。`,"speed.tip.overall":`{runs} 次已结束、有输出 token 上报的运行合计:{tokens} tokens ÷ 有效 {active}。运行之间的空闲不计,进行中的运行不计入。`,"speed.run":`第 {n} 次运行`,"speed.line":`{label}:{value}`,"speed.runs":`各次运行`,"speed.col.run":`运行`,"speed.col.first":`首次响应`,"speed.col.text":`首字`,"speed.overall":`整体`,"speed.moreRuns":`只列出最近 {n} 次运行`,"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.agy_missing":`没有找到 Antigravity CLI(agy)。安装后点击“重新探测”。`,"setup.agy_auth_required":`Antigravity CLI 还没有登录。登录后点击“重新探测”。`,"setup.agy_no_models":`Antigravity CLI 没有向 Ensemble 提供可用的 Gemini 模型。请检查 CLI 当前账号的模型权限。`,"setup.agy_unsupported":`当前 Antigravity CLI 版本没有 Ensemble 需要的 agy acp 接口,请更新后重新探测。`,"setup.agy_probe_failed":`探测 Antigravity CLI 失败`,"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} 个会话`,"rail.moreTip":`右键展开其余会话`,"rail.menu":`会话列表操作`,"rail.menuExpandAll":`展开 {n} 个会话`,"rail.menuExpand":`展开其余 {n} 个会话`,"rail.menuCollapse":e=>Number(e.n)===0?`收起`:`收起(只显示 ${e.n} 个会话)`,"rail.doneExpand":`已展开,共 {n} 个会话`,"rail.doneCollapse":e=>Number(e.n)===0?`已收起`:`已收起,显示 ${e.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.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.chip":`已归档`,"archive.chipTip":`这个会话已归档:不在画布、侧栏与列表里,记录原样保留。`,"archive.banner":`这个会话已于 {time} 归档:不在画布、侧栏与列表里,记录原样保留。取消归档会连同它的下级和仍在归档中的上级一起恢复;给它发送消息也会先取消归档。`,"archive.bannerAuto":`留存策略已于 {time} 自动归档了这个会话:不在画布、侧栏与列表里,记录原样保留。取消归档会连同它的下级和仍在归档中的上级一起恢复;给它发送消息也会先取消归档。`,"archive.unarchiveTip":`取消归档:连同它的下级和仍在归档中的上级一起恢复`,"archive.finished":`归档已完成会话`,"archive.finishedTip":`归档 {n} 个已结束或待命的会话(失败、已中断、已关闭、已失联也算已结束;整棵任务树里没有会话在工作才会归档)`,"archive.busy":`上一个归档操作还在进行`,"archive.nothing":`没有可以归档的会话:整棵任务树里没有会话在工作才能归档`,"archive.blockedWorking":`还有 {n} 个会话在工作,等它们结束后才能归档`,"archive.blockedPending":`还有 {n} 个会话的消息没有被确认,处理完才能归档`,"archive.keptWorking":`;另有 {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.retention":`留存策略`,"history.off":`未开启`,"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.agy":`Antigravity CLI`,"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.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`,"harness.fast":`Fast`,"harness.fastGroup":`Fast policy for {name}`,"harness.fastMode.off":`Default off`,"harness.fastMode.on":`Default on`,"harness.fastMode.disabled":`Disabled`,"harness.fastNote.off":`Runs at standard speed by default; Fast is still available when the main Agent or a role asks for it.`,"harness.fastNote.on":`Models that support Fast use it by default; asking for standard speed explicitly still runs at standard speed.`,"harness.fastNote.disabled":`Always standard speed; a delegation that explicitly asks for Fast is rejected, not downgraded.`,"harness.fastNoModel":`None of the models read so far is marked as supporting Fast, so this policy has no effect for now.`,"harness.fastModelTip":`This model supports Fast`,"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.`,"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`,"native.agy-session":`Antigravity CLI 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.section.version":`Version`,"version.running":`Running`,"version.development":`Development checkout`,"version.latest":`Latest on npm`,"version.lastKnown":`Last known npm release`,"version.check":`Check for updates`,"version.checking":`Checking for updates…`,"version.checked":`Last checked {time}`,"version.current":`You’re up to date.`,"version.devCurrent":`This checkout’s version number matches the latest npm release.`,"version.available":`A new release is available.`,"version.copiesAvailable":`Updates are available for local installations.`,"version.ahead":`The running version is ahead of the latest npm release.`,"version.unknown":`The running version could not be compared with the npm release.`,"version.restart":`The update is installed. Restart the local service to use it.`,"version.installs":`Local installations`,"version.target.checkout":`Source checkout`,"version.target.codex":`Codex plugin`,"version.target.cursor":`Cursor plugin`,"version.target.global":`Global npm package`,"version.update":`Update to v{version}`,"version.updateTarget":`Update {target} to v{version}`,"version.installing":`Updating…`,"version.updating":`Updating {target}…`,"version.activate.service":`{target} was updated to v{version}. Restart the local service that uses this installation to activate it.`,"version.activate.codex":`The Codex plugin was updated to v{version}. Reload the plugin in Codex and restart any local service running from that copy.`,"version.activate.cursor":`The Cursor plugin was updated to v{version}. Reload the Cursor window and restart any local service running from that copy.`,"version.checkoutNote":`Updating a clean main branch of the official repository fast-forwards it to the commit published on npm.`,"version.standalone":`This service started from a standalone copy. Replace it using its original installation method.`,"version.unsupported":`The running service does not support version management. Restart the updated local service.`,"version.error.registry":`Couldn’t confirm the latest version on npm. You can check again.`,"version.error.connection":`Couldn’t reach the local version service. Please try again.`,"version.error.changed":`The release or local installation changed. Check for updates again.`,"version.error.missing":`This managed installation could not be found. Check again.`,"version.error.npm":`npm was not found. Install the npm bundled with Node.js and try again.`,"version.error.permissions":`The installation directory could not be written. Check permissions and open files.`,"version.error.install":`The update did not finish. Check the network and installation, then try again.`,"version.error.codex":`Codex could not refresh the registered plugin. Check the local Codex CLI and personal marketplace.`,"version.error.dirty":`The checkout contains local changes. Resolve them before updating the source.`,"version.error.branch":`Source updates require the main branch of the official Ensemble repository.`,"version.error.revision":`Couldn’t obtain a source revision matching the npm release.`,"version.error.diverged":`The branch cannot fast-forward to the release. Resolve it in the repository.`,"version.error.rollback":`File recovery did not finish. The previous files are backed up at`,"settings.executors.summary":`{ready}/{total} ready`,"settings.executors.reorder":`Reorder {name}`,"settings.executors.reorderHint":`Drag to reorder or click to choose a direction`,"settings.executors.moveUp":`Move up`,"settings.executors.moveDown":`Move down`,"settings.executors.moved":`{name} moved to position {position} of {total}`,"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 configuration a name to use it when delegating. Default follows the model and Fast policy in “{section}”, the model’s default effort, and full access. Changes save automatically for every host.`,"profiles.standard":`Standard`,"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}”.`,"profiles.issue.fast_disabled":`Fast is disabled for {harness} in Settings.`,"profiles.issue.fast_harness":`{harness} does not support Fast.`,"profiles.issue.fast_model":`The model “{model}” does not support Fast.`,"profiles.issue.fast_unverified":`The catalog has not confirmed Fast support for “{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.concurrencySource.startup":`Fixed by the program that started the service; it can't be changed here`,"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 (${z(e)} can be hidden)`,"dock.hideIdleNone":`Hide sessions that aren't working
|
|
16
|
+
Nothing to hide right now`,"dock.showAllTip":e=>`Show all sessions (${z(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=>`${z(e)} ${R(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=>`${z(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)}: ${z(e)} ${R(e.n,`node`,`nodes`)}`,"arrange.unchanged":`{action}: nothing moved`,"scene.zoomOut":`Zoom out`,"scene.fit":`Fit canvas (0)`,"scene.sr":e=>`${z(e)} ${R(e.n,`session`,`sessions`)} on the canvas`,"scene.srHidden":e=>`${z(e)} ${R(e.n,`session`,`sessions`)} shown, ${Number(e.hidden)} not working hidden`,"scene.srHiddenAny":e=>`${z(e)} ${R(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=>`${z(e)} ${R(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=>`${z(e)} ${R(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=>`${z(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 ${z(e)} other running ${R(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=>`${z(e)} ${R(e.n,`session`,`sessions`)}`,"origin.countRunning":e=>`${z(e)} ${R(e.n,`session`,`sessions`)} · ${e.running} running`,"origin.menu":`Main Agent actions`,"origin.menuHide":e=>`Hide related nodes (${z(e)} ${R(e.n,`session`,`sessions`)})`,"origin.menuShow":e=>`Show related nodes (${z(e)} ${R(e.n,`session`,`sessions`)})`,"origin.menuShowAll":e=>`Show all (${z(e)} ${R(e.n,`Main Agent`,`Main Agents`)} with hidden nodes)`,"origin.doneHide":e=>`Hid this Main Agent's related nodes (${z(e)} ${R(e.n,`session`,`sessions`)})`,"origin.doneShow":e=>`Showing this Main Agent's related nodes (${z(e)} ${R(e.n,`session`,`sessions`)})`,"origin.doneShowAll":e=>`Showing the related nodes of all ${z(e)} ${R(e.n,`Main Agent`,`Main Agents`)}`,"origin.expand":`Show related nodes`,"origin.collapsedTip":e=>`Related nodes hidden · ${z(e)} ${R(e.n,`session`,`sessions`)}\nClick or right-click to show`,"origin.collapsedTipRunning":e=>`Related nodes hidden · ${z(e)} ${R(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=>`${z(e)} ${R(e.n,`changed file`,`changed files`)}`,"git.conflicts":e=>`${z(e)} ${R(e.n,`conflict`,`conflicts`)}`,"git.ahead":e=>`${z(e)} ${R(e.n,`commit`,`commits`)} ahead`,"git.behind":e=>`${z(e)} ${R(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=>`${z(e)} Main ${R(e.n,`Agent`,`Agents`)}`,"folder.usedBy":e=>`Used by ${z(e)} Main ${R(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, ${z(e)} ${R(e.n,`session`,`sessions`)}`,"ctx.copyIds":e=>`Copy session ${R(e.n,`ID`,`IDs`)} (${z(e)})`,"ctx.cancelRuns":e=>`Interrupt current ${R(e.n,`run`,`runs`)} (${z(e)})`,"ctx.stopSessions":e=>`Close ${R(e.n,`session`,`sessions`)} (${z(e)})`,"ctx.removeRecords":e=>`Delete ${R(e.n,`record`,`records`)} (${z(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=>R(e.n,`Close this session?`,`Close these ${z(e)} sessions?`),"batch.stopConfirm":e=>`Close ${z(e)} ${R(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 ${R(t,`is`,`are`)} working: the current run is interrupted first, then the session disconnects.`:``}${n>0?` ${n} ${R(n,`other is`,`others are`)} already closed and not affected.`:``}`},"batch.removeTitle":e=>R(e.n,`Delete this session record?`,`Delete these ${z(e)} session records?`),"batch.removeConfirm":e=>`Delete ${z(e)} ${R(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 ${R(t,`session is`,`sessions are`)} still running and won't be deleted — interrupt and close ${R(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=>`${z(e)} ${R(e.n,`entry`,`entries`)}`,"timeline.expandAll":`Expand all steps`,"timeline.collapseAll":`Collapse steps`,"timeline.older":e=>`Show ${z(e)} earlier`,"timeline.jump":`New activity`,"timeline.latest":`Back to latest`,"timeline.empty":`No events yet.`,"work.running":e=>`Working · ${z(e)} ${R(e.n,`step`,`steps`)}`,"work.done":e=>`Ran ${z(e)} ${R(e.n,`step`,`steps`)}`,"work.older":e=>`Show ${z(e)} earlier ${R(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=>`${z(e)} ${R(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":`Chat context summarized`,"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":`Chat context summarized`,"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":`Chat context summarized`,"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":`Chat context summarized`,"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=>`${z(e)} ${R(e.n,`character`,`characters`)}`,"handoff.fromRun":`From run {run} of {runs}`,"handoff.partial":`Still in progress at handover; this is only what had been written`,"handoff.laterNone":`The newer run {run} produced none`,"handoff.laterNoneYet":`The newer run {run} had produced none yet`,"handoff.earlierFinal":`Run {run} had a final answer that was not handed over`,"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=>`${z(e)} ${R(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.speed":`Speed`,"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.`,"sum.noSpeed":`No run has started yet, so there is nothing to time.`,"sum.speedStarting":`Connecting to the harness; timing starts once the run begins.`,"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`,"speed.first":`First response`,"speed.text":`First text`,"speed.rate":`Output speed`,"speed.latest":`Latest · run {n}`,"speed.live":`In progress`,"speed.textWhole":`Sent as one piece`,"speed.before":e=>`${z(e)} tool ${R(e.n,`call or wait`,`calls or waits`)} before it`,"speed.tokens":`{tokens} tokens`,"speed.active":`{time} active`,"speed.gap.unreported":`The harness doesn't report output tokens`,"speed.gap.waiting":`No output-token report yet`,"speed.gap.zero":`Reported output tokens: 0`,"speed.gap.short":`Under 0.1 s of active time, so no speed is given`,"speed.kind.reasoning":`reasoning`,"speed.kind.assistant":`text`,"speed.kind.tool":`a tool call`,"speed.kind.question":`a question`,"speed.tip.first":`From the run starting to the first reasoning, text, tool call or question (here: {kind}): {time}.`,"speed.tip.firstWait":`The run has started, but no reasoning, text, tool call or question has appeared yet.`,"speed.tip.firstNone":`This run produced no reasoning, text, tool call or question.`,"speed.tip.queued":`Queueing and startup took {time}; it isn't counted.`,"speed.tip.clock":`Harnesses mark the run as started at different moments (some wait for the first output), so first-response times aren't directly comparable across harnesses.`,"speed.tip.text":`From the run starting to the first piece of streamed text reaching Ensemble: {time}.`,"speed.tip.textBefore":`That includes {tools} tool calls and {waits} waits for an answer, {time} in total (overlaps counted once).`,"speed.tip.textSince":`From the last step ending to the first text: {time}.`,"speed.tip.textWhole":`The harness didn't stream the text; it handed over the whole text {time} after the run started. That is when the full text appeared, not a first token, so it isn't counted as first text.`,"speed.tip.textWait":`No text has appeared yet.`,"speed.tip.textNone":`This run produced no text.`,"speed.tip.textUnattributed":`The timeline has text, but the older record doesn't mark which run it belongs to, so it can't be timed here.`,"speed.tip.rate":`{tokens} tokens ÷ {active} active = {rate} tok/s`,"speed.tip.spanEnded":`Timed span: run start to run end, {span}.`,"speed.tip.spanAsOf":`Timed span: run start to the latest output-token report ({time}), {span}; the run hasn't ended (or its end wasn't received), so later time isn't included.`,"speed.tip.excluded":`Excluded tool calls and waits for an answer: {time} ({tools} tools, {waits} waits; overlaps counted once).`,"speed.tip.unbounded":e=>`${z(e)} more ${R(e.n,`tool never reported`,`tools never reported`)} an end time, so ${R(e.n,`it was`,`they were`)} not excluded.`,"speed.tip.whole":`Whole-run average (nothing excluded): {rate} tok/s.`,"speed.tip.reasoning":`Of which reasoning: {tokens} tokens.`,"speed.tip.latency":`Active time still includes the wait before the first token and network round trips, so this isn't pure decoding speed.`,"speed.tip.source":`Token counts are reported by the harness, never estimated from text length.`,"speed.tip.overall":`Across {runs} finished runs that reported output tokens: {tokens} tokens ÷ {active} active. Idle time between runs and any run still in progress are left out.`,"speed.run":`Run {n}`,"speed.line":`{label}: {value}`,"speed.runs":`All runs`,"speed.col.run":`Run`,"speed.col.first":`Response`,"speed.col.text":`First text`,"speed.overall":`Overall`,"speed.moreRuns":`Showing the latest {n} runs`,"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.agy_missing":"The Antigravity CLI (`agy`) wasn't found. Install it, then probe again.","setup.agy_auth_required":`The Antigravity CLI isn't signed in. Sign in to it, then probe again.`,"setup.agy_no_models":`Antigravity CLI offered no Gemini models to Ensemble. Check model access for the current CLI account.`,"setup.agy_unsupported":"This Antigravity CLI version doesn't offer the `agy acp` interface Ensemble needs. Update it and probe again.","setup.agy_probe_failed":`Probing the Antigravity CLI 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`,"rail.moreTip":`Right-click to show the rest`,"rail.menu":`Session list actions`,"rail.menuExpandAll":e=>`Show ${z(e)} ${R(e.n,`session`,`sessions`)}`,"rail.menuExpand":e=>`Show the other ${z(e)} ${R(e.n,`session`,`sessions`)}`,"rail.menuCollapse":e=>z(e)===0?`Collapse`:`Collapse (show only ${z(e)} ${R(e.n,`session`,`sessions`)})`,"rail.doneExpand":e=>`Expanded, ${z(e)} ${R(e.n,`session`,`sessions`)} in total`,"rail.doneCollapse":e=>z(e)===0?`Collapsed`:`Collapsed, showing ${z(e)} ${R(e.n,`session`,`sessions`)}`,"view.mode":`View mode`,"view.canvas":`Canvas`,"view.list":`List`,"view.workingOnly":`Working`,"view.activeSubtitle":e=>`${Number(e.running)} running · ${Number(e.total)} working · ${z(e)} ${R(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=>`${z(e)} ${R(e.n,`Main Agent`,`Main Agents`)} · ${Number(e.total)} ${R(e.total,`session`,`sessions`)}`,"view.listEmpty":`No matching sessions here`,"view.filesChanged":e=>`${z(e)} ${R(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 ${z(e)} child ${R(e.n,`session`,`sessions`)})`,"menu.unarchive":`Unarchive`,"menu.exportMd":`Export Markdown`,"menu.exportMdTree":e=>`Export Markdown (with ${z(e)} child ${R(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 (${z(e)} ${R(e.n,`session`,`sessions`)})`,"origin.menuArchivePart":e=>`Archive finished sessions (${z(e)} ${R(e.n,`session`,`sessions`)}; the rest stay)`,"origin.menuArchiveNone":`Archive this whole Main Agent space`,"ctx.archiveSelected":e=>`Archive selected (${z(e)} ${R(e.n,`session`,`sessions`)})`,"export.failed":`Export failed`,"archive.title":`Archived`,"archive.subtitle":e=>`${z(e)} ${R(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.loading":`Loading archived sessions…`,"archive.loadFailed":`Couldn't load archived sessions`,"archive.children":e=>`${z(e)} ${R(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 (${z(e)} more)`,"archive.unarchiveOf":`Unarchive “{title}”`,"archive.exportOf":`Export “{title}”`,"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 ${z(e)} finished or ready ${R(e.n,`session`,`sessions`)} (failed, interrupted, closed and disconnected count as finished; a task tree is archived only when no session in it is still working)`,"archive.busy":`Another archive action is still in progress`,"archive.nothing":`Nothing to archive: a task tree can only be archived when no session in it is still working`,"archive.blockedWorking":e=>`${z(e)} ${R(e.n,`session is`,`sessions are`)} still working; archive once ${R(e.n,`it has`,`they have`)} finished`,"archive.blockedPending":e=>`${z(e)} ${R(e.n,`session has`,`sessions have`)} unconfirmed messages; archive once ${R(e.n,`that is`,`those are`)} settled`,"archive.keptWorking":e=>`; ${z(e)} still working, kept`,"archive.keptPending":e=>`; ${z(e)} with unconfirmed messages, kept`,"archive.keptFollowing":e=>`; ${z(e)} ${R(e.n,`session also follows`,`sessions also follow`)} a session that is not archived, kept`,"archive.done":e=>`Archived ${z(e)} ${R(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 ${z(e)===1?`this session`:`these ${z(e)} sessions`}?`,"archive.confirmBody":e=>{let t=z(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 ${R(n,`session`,`sessions`)} that ${R(n,`goes`,`go`)} with their parents.`:``}${r>0?` ${r} unfinished ${R(r,`session stays`,`sessions stay`)} where ${R(r,`it is`,`they are`)}.`:``}`},"archive.confirmAction":e=>`Archive ${z(e)} ${R(e.n,`session`,`sessions`)}`,"archive.unarchiveFailed":`Unarchive failed`,"archive.unarchived":e=>`Unarchived ${z(e)} ${R(e.n,`session`,`sessions`)}`,"archive.unarchivedCarried":e=>` (${z(e)} came back with it as ${R(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=>`${z(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.retention":`Retention`,"history.off":`Off`,"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 ${z(e)} ${R(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 $e(){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`))||et()===`zh`?`zh`:`en`}function et(){return document.querySelector(`meta[name="ensemble-lang"]`)?.getAttribute(`content`)??null}function tt(e,t){return typeof e==`function`?e(t??{}):t?e.replace(/\{(\w+)\}/g,(e,n)=>n in t?String(t[n]):e):e}function nt(e,t,n){let r=Qe[e][t]??Qe.zh[t];return r===void 0?t:tt(r,n)}function rt(e){return(t,n)=>nt(e,t,n)}var it=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 B(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 at(e,t){return e.createdAt===t.createdAt?e.id<t.id?-1:+(e.id>t.id):e.createdAt<t.createdAt?-1:1}var ot=Object.freeze([]),st=Object.freeze([]);function ct(e,t,n){let r=e.get(t);r?r.push(n):e.set(t,[n])}function lt(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 ot;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(at))r(i.id).forEach((e,r)=>{ct(n,e,i),r===0&&ct(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)??st,childrenOf:e=>a().all.get(e)??st}}function ut(e){return dt(lt(e))}function dt(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 ft(e){let t=lt(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:dt(t),joins:n}}function pt({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 mt(e,t){return t.size===0?new Set:pt(ft(e),t)}function ht(e){let t=ft(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,pt(t,new Set([e])).size);return n}function gt(e,t){return e===`unknown`&&t!==void 0&&/antigravity|\bagy\b/i.test(t.trim())?`antigravity`:e}function _t(e){return gt(e.host,e.hostLabel)===`antigravity`?`Antigravity`:e.hostLabel}function vt(e){return e.sessionRef?.source===`declared`}function yt(e){return e.kind===`agent`&&!e.workspace}function bt(e,t){let n=e.sessionRef;return n?[`${t(`origin.refLabel.${n.kind}`)}: ${n.id}`,...n.source===`declared`?[t(`origin.refDeclaredTip`)]:[]]:[]}function xt(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 yt(e)?`${t(`origin.workspace`)}: ${t(`origin.workspaceUnknownTip`)}`:void 0}var St=Date.now(),Ct=new Set,wt;function Tt(e){return Ct.add(e),wt||=(St=Date.now(),setInterval(()=>{St=Date.now();for(let e of[...Ct])e()},1e3)),()=>{Ct.delete(e),Ct.size===0&&wt&&(clearInterval(wt),wt=void 0)}}function Et(){return(0,l.useSyncExternalStore)(Tt,()=>St)}function Dt(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 Ot(e){return!Number.isFinite(e)||e<0?``:e<1e3?`${Math.max(1,Math.round(e))}ms`:e<1e4?`${(e/1e3).toFixed(1)}s`:y(e)}function kt(e){let t=new Date(e);return Number.isNaN(t.getTime())?``:t.toLocaleTimeString([],{hour12:!1})}function At(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 jt(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 Mt(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 Nt(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 Pt(e,t){return m(e.replace(/^[a-z]+_/i,``),t)}function Ft(e){return e===void 0?void 0:b(e)}function It(e,t=140){let n=g(e);return n.length>t?`${m(n,t-1).trimEnd()}…`:n}var Lt=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 Rt(e){return e.replace(Lt,(...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?``:` `:Rt(n)})}function zt(e){return g(Rt(e))}function Bt(e){let t=e.replace(/[\\/]+$/,``),n=Math.max(t.lastIndexOf(`/`),t.lastIndexOf(`\\`));return n>=0?t.slice(n+1):t}function Vt(e,t){return t(`phase.${e}`)}var Ht={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 Ut(e,t){return t(Ht[e])}function V(e,t){return t(`activity.${e}`)}function Wt(e,t){let{activity:n}=e;switch(e.phase){case`running`:return e.openQuestions?t(`question.waiting`):n.kind===`tool`&&n.tool?`${Ut(n.tool.category,t)} ${It(n.tool.title,80)}`:V(n.kind,t);case`done`:{let n=e.lastAssistantPreview?zt(e.lastAssistantPreview):``;return n?It(n,90):t(`activity.done`)}case`failed`:return e.lastError?It(e.lastError.message,90):t(`activity.failed`);case`ready`:return V(`ready`,t);default:return V(n.kind,t)}}function Gt(e){return e===`running`||e===`starting`||e===`queued`}var Kt={quiet:`attention.quiet`,long_tool:`attention.longTool`,long_run:`attention.longRun`,shared_file:`attention.sharedFile`,undelivered:`attention.undelivered`,question:`attention.question`};function qt(e,t,n){let r=y(t-Date.parse(e.since));switch(e.kind){case`quiet`:case`long_run`:return n(Kt[e.kind],{d:r});case`long_tool`:return n(Kt.long_tool,{d:r,tool:`${Ut(e.tool.category,n)} ${It(e.tool.title,60)}`,started:y(t-Date.parse(e.tool.startedAt))});case`shared_file`:return n(Kt.shared_file,{file:Bt(e.path),n:e.withSessionIds.length,d:r});case`undelivered`:return n(Kt.undelivered,{kind:n(`msg.kind.${e.messageKind}`),d:r,state:n(`delivery.${e.stage}`)});case`question`:return n(Kt.question,{q:ne(e.prompts,100),d:r})}}function Jt(e,t,n){return[n(`attention.title`),...e.map(e=>qt(e,t,n))].join(`
|
|
20
|
+
`)}var H={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},Yt=720;function Xt(e){return e!==void 0&&e.w<Yt}var Zt=.3,Qt=.16,$t=.72,en=.985;function tn(e){return e<640?{top:96,right:20,bottom:56,left:20}:{top:126,right:56,bottom:64,left:56}}function nn(e,t){let n=tn(e);return{w:Math.max(120,e-n.left-n.right),h:Math.max(120,t-n.top-n.bottom)}}function rn(e,t,n=Zt,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,Qt),Math.min(i,a))):Math.min(1,Math.max(n,Math.min(i,Math.max(a,$t))))}function an(e,t,n){let r=Math.max(Qt,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*.985?r:Math.max(Qt,i)}function on(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?rn(e,s,Zt,r):an(e,s,i),l=i===void 0?1:1/en,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 sn(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 cn={cols:1,rows:1,inner:0};function ln(e,t,n){return{kidsOf:e,maxWidth:Math.max(1,Math.floor(t)),cache:new Map,...n?{column:n}:{},sizes:new Map}}function un(e,t){return{...e,kidsOf:t,cache:new Map,sizes:new Map}}function dn(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+dn(e,n);return e.sizes.set(t,r),r}function fn(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 pn(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 mn(e,t){let n;for(let r of e){if(r.cols>t)break;n=r}return n}var hn=e=>Math.floor((e.rows-1)/2);function gn(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+hn(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+hn(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 _n(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:[cn]};else if(e.column?.(t,dn(e,t))){let{cols:t,rows:n}=fn(r.map(t=>_n(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=>_n(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}=gn(t.map(e=>mn(e,r)),r);o.push({cols:e,rows:n,inner:r})}let s=pn(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 vn(e,t,n,r,i,a,o=!1){let s=e.kidsOf(t),c=s.map(t=>mn(_n(e,t).shapes,n)),{spots:l}=o?fn(c):gn(c,n);s.forEach((t,n)=>{let o=l[n];yn(e,t,c[n],r+o.col,i+o.row,a)})}function yn(e,t,n,r,i,a){n.inner===0?a.set(t,{col:r,row:i}):(a.set(t,{col:r,row:i+hn(n)}),vn(e,t,n.inner,r+1,i,a,n.stack===!0))}function bn(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 xn(e,t,n,r,i){let a=e=>{let i=new Map;return vn(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=Dn(new Map(o),i,e.kidsOf,s);if(c.length===0)return{spots:o,moved:!1};let l=new Set(c),u=a(un(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)??[]);On(u,Tn(o,t,e.kidsOf),Math.max(s.col,Cn(n)),wn(n,s.row),s.row)}return Dn(u,i,e.kidsOf,s),{spots:u,moved:!0}}var Sn=(e,t)=>t*4096+e,Cn=e=>e.reduce((e,t)=>Math.max(e,t.col+1),0),wn=(e,t)=>e.length===0?t:Math.round(e.reduce((e,t)=>e+t.row,0)/e.length);function Tn(e,t,n){let r=e.get(t);return En(e,t,n).map(t=>{let n=e.get(t);return{member:t,dc:n.col-r.col,dr:n.row-r.row}})}function En(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 Dn(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=Cn(s);if(t.col>=c)continue;let l=Tn(e,a,n);for(let{member:t}of l)e.delete(t);On(e,l,c,wn(s,r.row),r.row),i.push(a)}return i}function On(e,t,n,r,i){let a=new Set,o=i-1;for(let t of e.values())a.add(Sn(t.col,t.row)),o=Math.max(o,t.row);let s=e=>t.every(({dc:t,dr:r})=>e+r>=i&&!a.has(Sn(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 kn=e=>`origin:${e}`,An=e=>`git:${e}`,jn=e=>`folder:${e}`,Mn=e=>`agent:${e}`,Nn={left:0,right:0};function Pn(e,t){let n=t.visible?e.filter(e=>t.visible.has(e.id)):e,r=lt(n),i=In(n,r),a=[...n].sort(at),{layoutParentOf:o,children:s,roots:c}=Ln(a,i),{columnOf:l,joins:u}=bn({ordered:a.map(e=>e.id),drawn:i,layoutParentOf:o,originKeyOf:e=>r.byId.get(e).origin.key,nodeId:Mn}),d=Rn(e),f=zn(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 Fn(e,t){return t?new Set(e.filter(e=>!t.has(e.id)).map(e=>Mn(e.id))):void 0}function In(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 Ln(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 Rn(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 zn(e,t,n,r,i){let a=new Map,o;for(let s of i??[]){if(r.has(s))continue;o??=t===e?n:lt(e);let i=Bn(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 Bn(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 Vn=32,Hn=24,Un=16;function Wn(e){let t=e?H.agentWCompact:H.agentW,n=e?H.originWCompact:H.originW,r=e?Hn:Vn,i=e?Un:H.rowGap;return{agentW:t,originW:n,gapX:r,gapY:i,pitchX:t+r,pitchY:H.agentH+i}}var Gn=(e,t)=>t*e.pitchX-e.gapX,Kn=(e,t)=>t*e.pitchY-e.gapY,qn={rows:0,cols:0};function Jn(e,t,n,r){let{block:i}=_n(e,t);if(i.length===0)return[{cols:1,rows:1,top:n===`top`,inner:0}];let a=n===`top`?[]:i.map(e=>({cols:e.cols+1,rows:e.rows,top:!1,inner:e.inner})),o=pn([...n===`left`?[]:i.map(e=>({cols:e.cols,rows:e.rows+1,top:!0,inner:e.inner})),...a]);return r&&Yn(e,t,r)?pn(o.map(n=>Xn(e,t,n,r))):o}function Yn(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 Xn(e,t,n,r){let{spots:i,moved:a}=xn(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 Zn(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;let s=n.top?{x:Math.round((Gn(r,n.cols)-r.originW)/2),y:0}:{x:0,y:Math.round((Kn(r,n.rows)-H.originH)/2)};a.set(t,s);for(let[r,s]of xn(e,t,n.top,n.inner,i).spots)a.set(r,o(s));return a}function Qn(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+H.rowGap}:{id:t.id,dx:e.x-t.x,dy:e.y-t.y},a=e,i(o))}};i(t)}var $n=/^[A-Za-z]:(?=[\\/]|$)/,er=/^[\\/]{2}[?.][\\/](?:(UNC)[\\/])?/i;function tr(e){let t=e.trim();if(!t)return``;let n=er.exec(t);if(n){let e=t.slice(n[0].length);n[1]?t=`\\\\${e}`:$n.test(e)&&(t=e)}let r=$n.test(t)||/^[\\/]{2}[^\\/]/.test(t),i=r?t.replaceAll(`\\`,`/`):t,a=``,o=i;if($n.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 nr=e=>e.length-e.replace(/[\\/]+$/,``).length;function rr(e,t){let n=nr(e)-nr(t);return n===0?e<=t?e:t:n<0?e:t}function ir(e){let t=new Map;for(let[n,r]of e){let e=tr(r);if(!e)continue;let i=r.trim(),a=t.get(e);a?(a.path=rr(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 ar(e){return Bt(e)||e}function or(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 sr(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=ir(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 cr(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?jn(a.key):void 0:An(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 lr(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 ur(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+H.originH)/2-H.folderH/2,p={id:jn(u.card.key),kind:`folder`,x:n,y:f,w:H.folderW,h:H.folderH,overhang:Nn,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 dr(e,t){let n=t[0],r=t.at(-1),i=(n.y+n.h/2+r.y+r.h/2)/2-H.gitH/2,a={id:An(e),kind:`git`,x:0,y:i,w:H.gitW,h:H.gitH,overhang:Nn,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 fr(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=lr(o,t.cardOf),u=c===void 0?0:H.gitW+i.gap,d=u+(l.some(e=>e.card)?H.folderW+i.gap:0),{folderNodes:f,below:p,links:m}=ur(l,c,u,d,i.stackGap,r),h=[...f],g=[];if(c!==void 0){let e=dr(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=sn(_);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 pr(e,t,n,r){let i=sr(e,r.git,r.drawFolders);return cr(e,i).map(e=>fr(e,i,t,n,r))}function mr(e,t){let n={nodes:[],edges:[]},{items:r,chipItems:i}=hr(e,n,t);vr(e.model,n);let a=[],o=pr(r.filter(e=>!i.has(e)),n,a,yr(e,t)),s=i.size===0?o:br(r,i,o);return{nodes:n.nodes,edges:n.edges,folders:a,items:r,clusters:s}}function hr(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(_r(e,s,r,t,n));else{let n=gr(e,s,t);a.push(n),o.add(n)}}return{items:a,chipItems:o}}function gr(e,t,n){let{originW:r}=e.dims,i={id:kn(t),kind:`origin`,x:0,y:0,w:r,h:H.originH,overhang:Nn};return n.nodes.push(i),{summary:e.model.byOrigin.get(t),origin:i,nodes:[i],width:r,height:H.originH}}function _r(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:kn(t),kind:`origin`,x:0,y:d-H.originH/2,w:a,h:H.originH,overhang:Nn};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}>${Mn(e.id)}`,from:f.id,to:Mn(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)}Qn(p,f.id,e.tree.kidsOf)}let m=sn(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 vr({ordered:e,drawn:t},n){for(let r of e)for(let e of(t.get(r.id)??[]).slice(1))n.edges.push({id:`${Mn(e)}>${Mn(r.id)}`,from:Mn(e),to:Mn(r.id),phase:r.phase})}function yr({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:H.groupGap}}function br(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 xr=16,Sr=e=>e.reduce((e,t,n)=>e+t+(n>0?qn.rows:0),0);function Cr(e,t,n){let r=0,i=0;return t.forEach((t,a)=>{let o=e[t].members.map(e=>mn(e.shapes,n));for(let e of o)r=Math.max(r,e.cols);i+=(a>0?qn.rows:0)+Sr(o.map(e=>e.rows))}),{cols:r,rows:i}}function wr(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 Tr(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)=>Cr(e,t,s[n])),l=a.reduce((e,t,n)=>e+o[n]+t.cols,0)+(t-1)*qn.cols,u=Math.max(...a.map(e=>e.rows)),d=Math.min(n.w/Gn(r,l),n.h/Kn(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=wr(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,mn(t.shapes,l.budgets[n]))}),{scale:l.scale,strips:i,picks:u}}function Er(e,t,n){let r,i=Math.min(e.length,xr);for(let a=1;a<=i;a++){let i=Tr(e,a,t,n);(!r||i.scale>r.scale*1.01)&&(r=i)}return r}function Dr(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?qn.rows:0,r[a]={x:(i+o-u.lead)*n.pitchX,y:c*n.pitchY},c+=Sr(d.map(e=>e.rows))}),i+=o+s+qn.cols}return r}var Or=40;function kr(e){let{area:t,blocks:n,clusters:r}=e,i=Wn(e.compact),a=new Map(n.map(e=>[e.key,e.originId])),o=new Set(a.values()),s=ln(e.kidsOf,Math.min(Or,Math.floor((t.w/Qt+i.gapX)/i.pitchX)),(e,t)=>t<=5&&!o.has(e)),c=new Map(n.map(({key:t,originId:n})=>{let r=Jn(s,n,`left`,e.joins),i=e.wrapRoots?r.filter(e=>e.cols>=3):[];return[t,i.length?i:r]})),l=r.map(e=>({lead:e.lead,weight:e.weight,members:e.keys.map(e=>({key:e,shapes:c.get(e)}))})),u=Er(l,t,i);if(u)return{scale:u.scale,leadGap:i.pitchX-H.folderW,stackGap:i.gapY+qn.rows*i.pitchY,offsets:Dr(u,l,i),positions:t=>Zn(s,a.get(t),u.picks.get(t),i,e.joins)}}var Ar=12;function jr(e,t,n){if(e.w<=0||e.h<=0)return!1;let r=e.w/e.h/(t.w/t.h);return n>=Ar?r<.7||r>1/.7:r<.55}function Mr(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 Nr=4;function Pr(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 Fr(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?H.groupGap:0)+e.height}),n}function Ir(e,t){let n=t.length,r=t.map(t=>t.reduce((t,n,r)=>t+(r>0?H.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+H.groupGap;s+=a[n]+H.clusterGap}),{offsets:o,width:a.reduce((e,t)=>e+t,0)+(n-1)*H.clusterGap,height:Math.max(...r)}}function Lr(e,t,n,r=!1){let{offsets:i,width:a,height:o}=Ir(e,Fr(e,t));return{columns:t,offsets:i,width:a,height:o,scale:n?r?Math.min(n.w/a,n.h/o):rn({w:a,h:o},n):1}}function Rr(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 zr(e,t){if(e.length===0)return;let n=t?Math.min(e.length,Nr):1,r=Lr(e,1,t);for(let i=2;i<=n;i++){let n=Lr(e,i,t);n.scale>r.scale*1.02&&(r=n)}Rr(e,r.offsets)}function Br(e,t,n){let r=Math.min(e.length,Nr),i=Lr(e,1,t,!0);for(let a=2;a<=r&&i.scale<n;a++){let n=Lr(e,a,t,!0);n.scale>i.scale*1.02&&(i=n)}return i}var Vr=1.6,Hr=(e=1)=>Math.min(Vr,Math.max(Qt,e));function Ur(e,t){let{options:n}=e,{area:r}=n,i=n.grid&&r?r:void 0;return i&&t.clusters.length>0?Wr(e,t,i):(zr(t.clusters,r),{chosen:t,usedGrid:!1,fitAll:!1})}function Wr(e,t,n){let{model:r}=e,i=Hr(e.options.zoom),a=Br(t.clusters,n,i),o=t,s=a.offsets,c=a.scale,l=!1,u=a.scale>=i,d=u&&Mr(n,r.order.length,r.roots,r.children);if(!u||jr({w:a.width,h:a.height},n,r.placedCount)||d){let r=Gr(e,t,{fill:n,classic:a,cap:i,fits:u,wrapRoots:d});r&&(o=r.alt,s=r.lattice.offsets,c=r.real,l=!0)}return Rr(o.clusters,s),{chosen:o,usedGrid:l,fitAll:c<1}}function Gr(e,t,{fill:n,classic:r,cap:i,fits:a,wrapRoots:o}){let s=Kr(e,t,n,o);if(!s)return;let c=mr(e,s);if(!Pr(c.clusters,t.clusters))return;let l=Math.max(...c.clusters.map((e,t)=>s.offsets[t].x+e.width)),u=Math.max(...c.clusters.map((e,t)=>s.offsets[t].y+e.height)),d=Math.min(n.w/l,n.h/u);return(a?d>=i:d>r.scale*1.01)?{alt:c,lattice:s,real:d}:void 0}function Kr(e,t,n,r){let{dims:i,model:a,tree:o}=e,s=new Map(t.items.map(e=>[e.summary.origin.key,e]));return kr({area:n,compact:i.compact,wrapRoots:r,blocks:a.order.map(({key:e})=>({key:e,originId:kn(e)})),kidsOf:o.kidsOf,joins:a.joins,clusters:t.clusters.map(e=>({keys:e.keys,lead:Math.round(e.lead/(H.folderW+i.originGap)),weight:e.keys.reduce((e,t)=>e+s.get(t).nodes.length,0)}))})}function qr(e,t,n,r){let i=e.clusters;if(i.length<2)return!1;let a=new Map;if(i.forEach((e,t)=>e.nodes.forEach(e=>a.set(e.id,t))),e.edges.some(e=>a.get(e.from)!==a.get(e.to)))return!1;let o=i.map(e=>sn(e.nodes)),s=sn(e.nodes),c=(e,r)=>{let i=Math.min(t.w/e,t.h/r);return i>=n*.985?n:i},l=(e,n)=>Math.abs(Math.log(e/n/(t.w/t.h))),u=c(s.w,s.h),d=l(s.w,s.h),f,p=0,m=o.reduce((e,t)=>Math.min(e,t.w),1/0),h=t.w/Math.min(u,n*en),g=Math.min(i.length,Math.floor((h+r.gapX)/(m+r.gapX)));for(let e=1;e<=g;e++){let t=Array(e).fill(0),n=Array(e).fill(0),a=Array(Math.ceil(i.length/e)).fill(0);i.forEach((r,i)=>{let s=i%e,c=Math.floor(i/e);t[s]=Math.max(t[s],r.lead),n[s]=Math.max(n[s],o[i].w-r.lead),a[c]=Math.max(a[c],o[i].h)});let m=n.map((e,n)=>e+t[n]);for(let n of[1,1.5]){let h=Jr(m,r.gapX*n),g=Jr(a,r.gapY*n),_=h.at(-1)+m.at(-1),v=g.at(-1)+a.at(-1),y=c(_,v),b=l(_,v);y<u||y===u&&(b>d||b===d&&n<=p)||(u=y,d=b,p=n,f=i.map((n,r)=>({x:s.x+h[r%e]+t[r%e]-n.lead-o[r].x,y:s.y+g[Math.floor(r/e)]-o[r].y})))}}if(!f)return!1;for(let[e,t]of i.entries()){let n=f[e];for(let e of t.nodes)e.x+=n.x,e.y+=n.y}return!0}function Jr(e,t){let n=0;return e.map(e=>{let r=n;return n+=e+t,r})}function Yr(e,t){let n=Math.floor(e/t),r=Array.from({length:t},(r,i)=>n+Number(i>=t-e%t)),i=Math.floor(e/2),a=r.map((e,n)=>2*(Math.floor(i/t)+Number(n<i%t)));a[t-1]+=e%2;let o=a.every(Boolean)?[r,a]:[r],s=new Map;for(let e of o){let t=[...e].reverse();s.set(e.join(`,`),e),s.set(t.join(`,`),t)}return[...s.values()]}function Xr(e,t,n,r,i){let a=e[0],o=a.w+n.gapX,s=t.length-1,c=[];t.forEach((e,t)=>{let a=i-Kn(n,e),l=s>0?a*(s-t)/s:0;for(let i=0;i<e;i++){let s=Math.sign(2*i+1-e),u=a/2+i*n.pitchY+s*l/2;c.push({x:o+t*r,y:Math.round(u)})}}),c.sort((e,t)=>e.y-t.y||e.x-t.x);let l={x:0,y:Math.round((i-a.h)/2)};return e.map((e,t)=>({...e,...t===0?l:c[t-1]}))}function*Zr(e,t,n){let r=e[0],i=e.length-1,a=r.w+t.gapX,o=Math.min(i,Math.floor((n.w-r.w)/t.pitchX)),s=Math.floor(Math.min(n.h,Kn(t,i))),c=n.w>=n.h?2:1;for(let r=c;r<=o;r++){let o=r>1?Math.floor((n.w-a-t.agentW)/(r-1)):t.pitchX,c=new Set([t.pitchX,o]);for(let n of Yr(i,r)){let r=Kn(t,Math.max(...n));if(r>s)continue;let i=new Set([r,Math.min(r+t.pitchY/2,s),s]);for(let r of i)for(let i of c)yield Xr(e,n,t,i,r)}}}function Qr(e,t,n,r){let i=[];e.forEach((e,n)=>{let r=t[e]-n,a=1;for(let e=i.at(-1);e&&e.sum/e.count>r/a;e=i.at(-1))r+=e.sum,a+=e.count,i.pop();i.push({sum:r,count:a})});let a=0;for(let t of i){let i=Math.max(0,Math.min(r-e.length,t.sum/t.count));for(let r=0;r<t.count;r++,a++)n[e[a]]=i+a}}function*$r(e,t,n,r){let i=e.map(e=>e.id),a=new Map(i.map((e,t)=>[e,t])),o=e.map(()=>[]),s=e.map(()=>[]);for(let{from:e,to:n}of t)o[n].push(e),s[e].push(n);let{depths:c,cyclic:l}=D(i,e=>o[a.get(e)].map(e=>i[e]));if(l.length)return;let u=i.map(e=>c.get(e)),d=Math.max(...u)+1,f=Array.from({length:d},()=>[]);u.forEach((e,t)=>f[e].push(t));let p=Math.max(...f.map(e=>e.length)),m=e[0].w+n.gapX;if(m+(d-1)*n.pitchX-n.gapX>r.w||p*n.pitchY-n.gapY>r.h)return;let h=new Float64Array(e.length),g=new Float64Array(e.length);for(let e of f)e.forEach((t,n)=>{h[t]=(p-e.length)/2+n});let _=()=>e.map((e,t)=>({...e,x:u[t]===0?0:m+(u[t]-1)*n.pitchX,y:Math.round(h[t]*n.pitchY)})),v=e=>{let t=e?s:o;for(let n=0;n<d;n++){let r=f[e?d-1-n:n];for(let e of r){let n=t[e];g[e]=n.length?n.reduce((e,t)=>e+h[t],0)/n.length:h[e]}r.sort((e,t)=>g[e]-g[t]),Qr(r,g,h,p)}};yield _();for(let e=0;e<4;e++)v(e%2==1),yield _()}var ei={packetPeriods:[167,233],speed:44,finePeriod:4.1};function ti(e){return Math.round(e*100)/100}function ni(e){return ti(e).toString()}function ri(e,t){let n=t.x-e.x,r=Math.abs(n)/2,i=n<0?-1:1;return`M${ni(e.x)} ${ni(e.y)}C${ni(e.x+i*r)} ${ni(e.y)} ${ni(t.x-i*r)} ${ni(t.y)} ${ni(t.x)} ${ni(t.y)}`}function ii(e){return(e+2)%4}function ai(e,t){return t===0?e.w:t===2?0:e.w/2}function oi(e,t){return t===0||t===2?e.h/2:t===1?e.h:0}var si={enterSide:24,leaveSide:6,enterStack:16,leaveStack:4,morph:.24};function ci(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 li(e,t,n){let r=ci(t,n,0),i=ci(t,n,2),a=ci(t,n,1),o=ci(t,n,3);if(!Number.isFinite(r+i+a+o))return e===2||e===1||e===3?e:0;if(e===0&&r>=si.leaveSide)return 0;if(e===2&&i>=si.leaveSide)return 2;if(r>=si.enterSide)return 0;if(i>=si.enterSide)return 2;if(e===1&&a>=si.leaveStack)return 1;if(e===3&&o>=si.leaveStack)return 3;if(a>=si.enterStack)return 1;if(o>=si.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 ui=class{x0=0;y0=0;x1=0;y1=0;x2=0;y2=0;x3=0;y3=0};function di(e,t,n,r){let i=ii(n),a=e.x+ai(e,n),o=e.y+oi(e,n),s=t.x+ai(t,i),c=t.y+oi(t,i),l=ci(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 fi(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 pi(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 mi(e){return`M${ni(e.x0)} ${ni(e.y0)}C${ni(e.x1)} ${ni(e.y1)} ${ni(e.x2)} ${ni(e.y2)} ${ni(e.x3)} ${ni(e.y3)}`}function hi(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 gi(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 _i(e){return e*e*(3-2*e)}var vi=`http://www.w3.org/2000/svg`,yi=0,bi=[[0,.15],[.1,1],[.3,1],[.5,1],[.7,1],[.9,1],[1,.2]];function xi(e){let t=(e,t,n)=>{let r=document.createElementNS(vi,`path`);return r.setAttribute(`class`,e),r.setAttribute(`fill`,`none`),n&&r.setAttribute(`style`,n),t.appendChild(r),r},n=`pipe-flow-${yi+=1}`,r=document.createElementNS(vi,`linearGradient`);r.setAttribute(`id`,n),r.setAttribute(`gradientUnits`,`userSpaceOnUse`);for(let[e,t]of bi){let n=document.createElementNS(vi,`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=ei.finePeriod/ei.speed,o=t(`pipe-tube`,e.tube),s=t(`pipe-fine`,e.dots,i),c=[];return ei.packetPeriods.forEach((n,r)=>{let o=`${i}--period:${n};--dur:${(n/ei.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 Si(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 Ci(e,t,n,r,i){let a=e.written,o=ti(t),s=ti(n),c=ti(r),l=ti(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 wi(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 Ti(e){e.tube.remove(),e.fine.remove(),e.gradient.remove();for(let t of e.packets)t.remove()}function Ei(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 Di=(e,t)=>e<=192&&t<=320;function Oi(e,t,n){let r=e[t.from],i=e[t.to];di(r,i,li(-1,r,i),n);let{x0:a,y0:o,x1:s,y1:c,x2:l,y2:u,x3:d,y3:f}=n,p=[{x:a,y:o}],m=a===d||o===f?1:12;for(let e=1;e<m;e++){let t=e/m,n=1-t,r=n*n*n,i=3*n*n*t,h=3*n*t*t,g=t*t*t;p.push({x:r*a+i*s+h*l+g*d,y:r*o+i*c+h*u+g*f})}return p.push({x:d,y:f}),{link:t,points:p,left:Math.min(a,d),right:Math.max(a,d),top:Math.min(o,f),bottom:Math.max(o,f)}}function ki(e,t){if(e.right<=t.left||e.left>=t.right||e.bottom<=t.top||e.top>=t.bottom)return!1;for(let n=1;n<e.points.length;n++){let r=e.points[n-1],i=e.points[n];if(Math.max(r.x,i.x)<=t.left||Math.min(r.x,i.x)>=t.right||Math.max(r.y,i.y)<=t.top||Math.min(r.y,i.y)>=t.bottom)continue;let a=i.x-r.x,o=i.y-r.y;if(a===0||o===0)return!0;let s=(t.left-r.x)/a,c=(t.right-r.x)/a,l=(t.top-r.y)/o,u=(t.bottom-r.y)/o;if(Math.max(0,Math.min(s,c),Math.min(l,u))<Math.min(1,Math.max(s,c),Math.max(l,u)))return!0}return!1}function Ai(e,t,n,r){let i=t.x-e.x,a=t.y-e.y,o=r.x-n.x,s=r.y-n.y,c=i*s-a*o;if(c===0)return!1;let l=n.x-e.x,u=n.y-e.y,d=(l*s-u*o)/c,f=(l*a-u*i)/c;return d>=0&&d<=1&&f>=0&&f<=1}function ji(e,t){if(e.right<t.left||t.right<e.left||e.bottom<t.top||t.bottom<e.top||e.link.from===t.link.from||e.link.to===t.link.to||e.link.from===t.link.to||e.link.to===t.link.from)return!1;for(let n=1;n<e.points.length;n++)for(let r=1;r<t.points.length;r++)if(Ai(e.points[n-1],e.points[n],t.points[r-1],t.points[r]))return!0;return!1}function Mi(e,t,n=1/0){let r=new ui,i=e.map(e=>({left:e.x+1,right:e.x+e.w-1,top:e.y+1,bottom:e.y+e.h-1})),a=t.every(e=>e.from===t[0]?.from),o=[],s=0,c=0,l=0;for(let c of t){let t=Oi(e,c,r);for(let e=0;e<i.length;e++)if(e!==c.from&&e!==c.to&&ki(t,i[e])&&(s++,s>n))return;for(let e=1;e<t.points.length;e++){let n=t.points[e-1],r=t.points[e];l+=Math.hypot(r.x-n.x,r.y-n.y)}a||o.push(t)}for(let e=0;e<o.length;e++)for(let t=e+1;t<o.length;t++)ji(o[e],o[t])&&c++;return{obstructed:s,crossings:c,length:l}}function Ni(e,t){return e.zoom===t.zoom?e.obstructed===t.obstructed?e.crossings===t.crossings?e.distance<t.distance:e.crossings<t.crossings:e.obstructed<t.obstructed:e.zoom>t.zoom}function Pi(e,t){t.sort((e,t)=>e[0]-t[0]);let n=0,r=-1/0;for(let[i,a]of t)if(i<r)r=Math.max(r,a);else{if(n<e&&e<r)break;n=i,r=a}return e<=n||e>=r?[e]:[n,r]}function Fi(e,t,n,r,i){let a=new Map;for(let t of e.edges){if(t.phase===`link`)continue;let e=a.get(t.to);e?e.push(t.from):a.set(t.to,[t.from])}let o=new Map(e.nodes.map(e=>[e.id,e])),s=e=>e.reduce((e,n)=>{let r=o.get(n);return Math.max(e,r.x+r.w+t.gapX)},-1/0);if(![...a].some(([e,t])=>t.length>1&&o.get(e).x<s(t)))return!1;let{order:c}=D([...o.keys()],e=>a.get(e)??[]),l=new Map(e.nodes.map((e,t)=>[e.id,t])),u=Di(e.nodes.length,e.edges.length)?e.edges.map(e=>({from:l.get(e.from),to:l.get(e.to)})):void 0;for(let l of c){let c=a.get(l);if(!c||c.length<2)continue;let d=o.get(l),f=s(c)-d.x;if(f<=0)continue;let p=[d];for(let e=0;e<p.length;e++)for(let t of i(p[e].id))p.push(o.get(t));let m=new Set(p),h=sn(p),g=e.nodes.filter(e=>!m.has(e)),_=sn(g),v=c.reduce((e,t)=>{let n=o.get(t);return e+n.y+n.h/2},0)/c.length,y=Math.round(v-d.h/2-d.y),b=new Set([f]);for(let e of g){let n=e.x+e.w+t.gapX-h.x;n>f&&b.add(n)}let x;for(let i of[...b].sort((e,t)=>e-t)){let a=[];for(let e of g)e.x+e.w+t.gapX<=h.x+i||h.x+h.w+i+t.gapX<=e.x||a.push([e.y-t.gapY-h.y-h.h,e.y+e.h+t.gapY-h.y]);for(let t of Pi(y,a)){let a=Math.max(_.x+_.w,h.x+i+h.w)-Math.min(_.x,h.x+i),o=Math.max(_.y+_.h,h.y+t+h.h)-Math.min(_.y,h.y+t),s=Math.min(n.w/a,n.h/o),c=s>=r*.985?r:s;if(x&&c<x.zoom)continue;let l={dx:i,dy:t,zoom:c,obstructed:0,crossings:0,distance:Math.hypot(i-f,t-y)};if(u){let n=Mi(e.nodes.map(e=>m.has(e)?{...e,x:e.x+i,y:e.y+t}:e),u,x?.zoom===c?x.obstructed:1/0);if(!n)continue;l.obstructed=n.obstructed,l.crossings=n.crossings}(!x||Ni(l,x))&&(x=l)}if(x?.zoom===r&&x.obstructed===0&&x.crossings===0&&i-f>=x.distance)break}for(let e of p)e.x+=x.dx,e.y+=x.dy}for(let t of e.items)Qn(t.nodes,t.origin.id,i);return!0}function Ii(e,t){return e.obstructed===t.obstructed?e.crossings===t.crossings?e.length+1<t.length:e.crossings<t.crossings:e.obstructed<t.obstructed}function Li(e,t,n,r){let i=e[t];return e.every((e,a)=>a===t||i.x+i.w+r.gapX<=e.x||e.x+e.w+r.gapX<=i.x||n+i.h+r.gapY<=e.y||e.y+e.h+r.gapY<=n)}function*Ri(e,t,n,r){let i=e[t],a=n.map(t=>e[t].y+e[t].h/2).sort((e,t)=>e-t),o=a[0],s=a[a.length-1],c=(a[a.length-1>>1]+a[a.length>>1])/2,l=(o+s)/2,u=new Set([i.y]);for(let n of[l,c,l-r.pitchY/2,l+r.pitchY/2]){let a=Math.round(Math.max(o,Math.min(s,n))-i.h/2);!u.has(a)&&Li(e,t,a,r)&&(u.add(a),yield{...i,y:a})}}function zi(e,t,n,r,i){let a=e.nodes,o=sn(a),s=a.map(()=>[]);for(let{from:e,to:n}of t)s[e].push(n);let c=s[0].length===a.length-1&&t.length===a.length-1,l=a,u=Mi(a,t),d=u,f=n=>{let a=sn(n);if(a.w>r.w||a.h>r.h)return;let s=i?e.origin.x-n[0].x:o.x-a.x,c=i?e.origin.y-n[0].y:o.y-a.y;if(i&&(a.x+s<o.x||a.y+c<o.y||a.x+s+a.w>o.x+o.w||a.y+c+a.h>o.y+o.h))return;let f=Mi(n,t,d.obstructed);!f||f.crossings>u.crossings||!Ii(f,d)||(l=n.map(e=>({...e,x:e.x+s,y:e.y+c})),d=f)};if(c)for(let e of Zr(a,n,r))f(e);else for(let e of $r(a,t,n,r))f(e);let p=s.map((e,t)=>({kids:e,i:t})).filter(({kids:e,i:t})=>e.length>=(t===0?3:6)&&(!i||t!==0)).sort((e,t)=>t.kids.length-e.kids.length).slice(0,4);for(let{i:e,kids:t}of p){let r=l;for(let i of Ri(r,e,t,n))f(r.map((t,n)=>n===e?i:t))}return l!==a&&(a.forEach((e,t)=>{e.x=l[t].x,e.y=l[t].y}),!0)}function Bi(e,t,n,r){if(!Di(e.nodes.length,e.edges.length))return;let i=new Map(e.nodes.map((e,t)=>[e.id,t])),a=e.edges.map(e=>({from:i.get(e.from),to:i.get(e.to)})),o=new Set(e.edges.filter(e=>e.phase===`link`).map(e=>e.to)),s=Mi(e.nodes,a);for(let[c,l]of t){if(o.has(c.origin.id))continue;let t=new Set(r(c.origin.id));if(t.size<3)continue;let u=c.nodes.flatMap((e,n)=>t.has(e.id)?[n]:[]),d=i.get(c.origin.id),f=c.origin;for(let t of Ri(c.nodes,0,u,n)){if(t.x<l.x||t.y<l.y||t.x+t.w>l.x+l.w||t.y+t.h>l.y+l.h||!Li(e.nodes,d,t.y,n))continue;let r=Mi(e.nodes.map((e,n)=>n===d?t:e),a,s.obstructed);r&&r.crossings<=s.crossings&&Ii(r,s)&&(s=r,f=t)}f!==c.origin&&(c.origin.x=f.x,c.origin.y=f.y,Qn(c.nodes,c.origin.id,r))}}function Vi(e,t,n,r,i){let a=Wn(r),o=sn(e.nodes),s=Math.min(t.w/o.w,t.h/o.h),c=s*.985>n?n*en:s;if(!(c>0))return!1;let l=new Map,u=new Map,d=new Set;for(let t of e.items)u.set(t,[]),t.nodes.forEach((e,n)=>l.set(e.id,{item:t,index:n}));for(let t of e.edges){if(t.phase===`link`)continue;let e=l.get(t.from),n=l.get(t.to);e&&n&&(e.item===n.item?u.get(e.item).push({from:e.index,to:n.index}):(d.add(e.item),d.add(n.item)))}let f=!1;for(let n of e.items){let r=u.get(n);if(n.nodes.length<4||!Di(n.nodes.length,r.length)||d.has(n))continue;let o=n.nodes.length!==e.nodes.length;zi(n,r,a,o?{w:n.width,h:n.height}:{w:Math.floor(t.w/c+1e-8),h:Math.floor(t.h/c+1e-8)},o)&&(Qn(n.nodes,n.origin.id,i),f=!0)}if(qr(e,t,n,a)&&(f=!0),d.size){let r=new Map([...d].map(e=>[e,sn(e.nodes)]));Fi(e,a,t,n,i)&&(Bi(e,r,a,i),f=!0)}return f}function Hi(e){let{area:t}=e,n=Xt(t);return{compact:n,originGap:n?H.originGapCompact:H.originGap,childGap:n?H.childGapCompact:H.childGap,originW:n?H.originWCompact:H.originW,agentW:n?H.agentWCompact:H.agentW,stagger:n||e.grid&&t?0:H.stagger}}var Ui=(e,t)=>({id:e.id,dx:t.x-e.x,dy:e.h+H.rowGap}),Wi=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=Ui(o,a)),r.push(a),n+=this.heightOf(e)+H.rowGap}),{rootNodes:r,extent:n-H.rowGap}}kidsOf=e=>{if(!this.kidNodes){this.kidNodes=new Map;for(let[e,t]of this.model.children)this.kidNodes.set(Mn(e),t.map(e=>Mn(e.id)));for(let[e,t]of this.model.roots)this.kidNodes.set(kn(e),t.map(e=>Mn(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)*H.rowGap}heightOf(e){let t=this.heights.get(e.id);if(t!==void 0)return t;let n=Math.max(H.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:Mn(t.id),kind:`agent`,x:a+o+m*p+i%2*l,y:r+(f-H.agentH)/2,w:s,h:H.agentH,overhang:Nn};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?Ui(n,a):{id:h.id,dx:a.x-h.x,dy:a.y-h.y},n=a,e.edges.push({id:`${h.id}>${Mn(r.id)}`,from:h.id,to:Mn(r.id),phase:r.phase}),t+=this.heightOf(r)+H.rowGap})}return h}};function Gi(e,t={}){let n=Hi(t),r=Pn(e,t),i={options:t,dims:n,model:r,tree:new Wi(r,n)},{chosen:a,usedGrid:o,fitAll:s}=Ur(i,mr(i)),c=t.rearrange&&t.grid&&t.area&&Vi(a,t.area,Hr(t.zoom),n.compact,i.tree.kidsOf),l=sn(a.nodes),u=c&&t.area?l.w>t.area.w||l.h>t.area.h:s,d=Fn(e,t.visible);return{nodes:a.nodes,edges:a.edges,bounds:l,origins:r.origins,folders:a.folders,...d?.size?{hidden:d}:{},...o?{grid:!0}:{},...u?{fitAll:!0}:{}}}function Ki(e){return e===`ready`||Gt(e)}function qi(e){let t=lt(e),n=e.filter(e=>Ki(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)Ki(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 Ji=new Set;function Yi({sessions:e,rule:t,prev:n,operated:r,now:i,exitMs:a}){if(!t)return{drawn:`all`,linger:new Map,leaving:Ji,held:Ji,wakeAt:void 0};if(!n)return{drawn:t,linger:new Map,leaving:Ji,held:Ji,wakeAt:void 0};let o=lt(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:Ji,held:Ji,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 Xi(e,t,n){let r=new Set;if(t.size===0)return r;for(let e of t)r.add(Mn(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 Zi(e){return e.kind===`origin`?`origin:${e.key}`:e.kind}function Qi(e,t){return e===t?!0:!e||!t||e.kind!==t.kind?!1:e.kind!==`origin`||t.kind===`origin`&&e.key===t.key}function $i(e){return e.kind===`origin`?`origin:${e.key}`:e.kind}function ea(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 ta(e){return e.updatedAt||e.createdAt}function U(e){return e.working>0||e.attention>0}function na(e,t,n){return e[n]===t[n]?e.key<t.key?-1:+(e.key>t.key):e[n]>t[n]?-1:1}function ra(e){if(e.length===0)return[];let t=ut(e),n=new Map;for(let r of e){let e=t.get(r.id)??r.origin.key,i=r.origin.key===e,a=ta(r),o=+!!Gt(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=U(e);return n===U(t)?na(e,t,n?`startedAt`:`latestAt`):n?-1:1}),r}function ia(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 aa(e,t){if(t.kind===`all`)return[...e];if(t.kind===`active`){let t=qi(e).visible;return e.filter(e=>t.has(e.id))}let n=ut(e);return e.filter(e=>(n.get(e.id)??e.origin.key)===t.key)}function oa(e,t){return ut(e).get(t)}function sa(e,t){if(e.hostTitle)return e.hostTitle;if(e.origin.kind===`user`)return t(`origin.user`);let n=_t(e.origin),r=e.origin.sessionRef?.id;return r?`${n} · ${m(r,8)}`:e.workspace?`${n} · ${Bt(e.workspace)}`:n}function ca(e,t,n){let r=At(e.startedAt,t,!0);if(e.hostTitle){let t=[e.workspace?Bt(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(Bt(e.workspace)),i.filter(Boolean).join(` · `)}function la(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 ua(e){return e.running>0?3:e.attention>0?2:+(e.working>0)}function da(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 ua(t)-ua(e)||na(e,t,`latestAt`)}),m=[],h=new Map;for(let e of t)h.set(e.key,sa(e,o));for(let t of p){let n=h.get(t.key)??t.origin.hostLabel,r=a?.get(t.key),i=At(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=ut(n),_=[...c.length>0?n:n.filter(e=>Gt(e.phase)||(e.attention?.length??0)>0)].sort((e,t)=>{let n=+!!Gt(e.phase),r=+!!Gt(t.phase);return n===r?ta(t).localeCompare(ta(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}var fa=/^#\/archived(?:[/?#]|$)/;function pa(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`}}:{kind:`overview`}}function ma(e){return e.kind===`session`?`#/s/${encodeURIComponent(e.id)}`:e.scope?e.scope.kind===`active`?`#/active`:e.scope.kind===`all`?`#/all`:`#/m/${encodeURIComponent(e.scope.key)}`:`#/`}var ha=`ensemble.canvas.hideIdle`,ga=`ensemble.canvas.collapsedOrigins`,_a=`ensemble.workspace.viewMode`,va=`ensemble.rail.collapsed`,ya=`ensemble.workspace.last`;function ba(e){try{return localStorage.getItem(e)??void 0}catch{return}}function xa(e,t){try{localStorage.setItem(e,t)}catch{}}function Sa(){let e=ba(ga);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 Ca(){return ba(`ensemble.workspace.viewMode`)===`list`?`list`:`canvas`}function wa(){return ea(ba(ya))}var Ta=pa(location.hash),Ea=Ta.kind===`overview`&&Ta.scope?Ta.scope:wa(),W=new it({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:Ta,detail:void 0,toasts:[],lang:$e(),settings:{open:!1,section:void 0},confirm:void 0,hideIdle:ba(ha)===`1`,collapsedOrigins:Sa(),viewMode:Ca(),railCollapsed:ba(va)===`1`,switcherOpen:!1,lastWorkspace:Ea,recentOrigins:Ea?.kind===`origin`?[Ea.key]:[]}),Da={lastFocusId:void 0},Oa=0;function ka(e){return e.confirm?`confirm`:e.settings.open?`settings`:e.switcherOpen?`switcher`:void 0}function Aa(e,t,n=4200,r){let i=++Oa;W.set(n=>{let a=ka(n);return{toasts:[...n.toasts.slice(-3),{id:i,tone:e,text:t,...a?{dialog:a}:{},...r?{action:r}:{}}]}}),n>0&&setTimeout(()=>ja(i),n)}function ja(e){W.set(t=>({toasts:t.toasts.filter(t=>t.id!==e)}))}var Ma=new Set([`network`,`internal`,`forbidden`,`not_found`]);function Na(e){let t=W.get().lang;if(e instanceof je){let n=`apiError.${e.code}`,r=nt(t,n);return r===n?e.message:Ma.has(e.code)||!e.message?r:t===`zh`?`${r}(${e.message})`:`${r} (${e.message})`}return _(e)}function Pa(e){let t=document,n=window.matchMedia(`(prefers-reduced-motion: reduce)`).matches;!t.startViewTransition||n?e():t.startViewTransition(()=>(0,u.flushSync)(e))}function Fa(e){if(xa(ya,$i(e)),e.kind!==`origin`)return{lastWorkspace:e};let t=W.get().recentOrigins;return{lastWorkspace:e,recentOrigins:[e.key,...t.filter(t=>t!==e.key)].slice(0,24)}}function Ia(e){let t=ma(e);location.hash!==t&&(e.kind!==`overview`||e.scope||location.hash!==``&&location.hash!==`#`)&&(location.hash=t)}function La(e){let t=W.get().route,n=Fa(e);W.set({...n,switcherOpen:!1}),t.kind===`overview`&&Qi(t.scope,e)||Ia({kind:`overview`,scope:e})}var Ra,za;function Ba(e){let t=za;za=void 0,t&&e.kind===`overview`&&ao(t)}function Va(e,t){return e.kind===t.kind?e.kind===`session`&&t.kind===`session`?e.id===t.id:e.kind===`overview`&&t.kind===`overview`?Qi(e.scope,t.scope):!0:!1}function Ha(){fa.test(location.hash)&&(history.replaceState(history.state,``,ma({kind:`overview`})),ao(`history`))}function Ua(){Ha();let e=pa(location.hash),t=W.get().route;if(Va(e,t)){Ba(e);return}let n=e.kind===`overview`&&e.scope?Fa(e.scope):{},r=()=>{W.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`?Ga(e.id):Ra?.abort(),Ba(e)};e.kind!==t.kind&&(e.kind===`session`||t.kind===`session`)?Pa(r):r()}function Wa(){Ha();let e=()=>Ua();window.addEventListener(`hashchange`,e);let t=W.get().route;return t.kind===`session`&&(W.set({detail:{id:t.id,state:void 0,rev:0,loading:!0}}),Ga(t.id)),()=>window.removeEventListener(`hashchange`,e)}async function Ga(e){Ra?.abort();let t=new AbortController;Ra=t;let n=Ve();try{let r=await L.session(e,t.signal);if(t.signal.aborted)return;let i=De(r.events);if(!i)throw new je(`internal`,`Session has no readable history`,500);let a=W.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)?Je(t,o):{};W.set(t=>({detail:{id:e,state:i,rev:(a.rev??0)+1,loading:!1},...c(t)}));let l=ze(W.get(),e);l&&l.seq>i.seq&&Ka(e,t.signal)}catch(n){if(t.signal.aborted)return;let r=W.get().detail;if(r?.id!==e)return;W.set({detail:{id:e,state:r.state,rev:r.rev,loading:!1,error:n instanceof je&&n.status===404?`not_found`:`failed`}})}finally{n.stop()}}async function Ka(e,t){for(let n=0;n<6;n++){let n=W.get().detail;if(!n?.state||n.id!==e||t?.aborted)return;let r=n.state.seq;try{let n=await L.events(e,r);if(t?.aborted||n.events.length===0||(qa(e,n.events),n.lastSeq<=(W.get().detail?.state?.seq??r)))return}catch{return}}}function qa(e,t){let n=W.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){Ga(e);return}Oe(r,n),i=!0}i&&W.set({detail:{...n,rev:n.rev+1}})}function Ja(e){xa(`ensemble.lang`,e),document.documentElement.lang=e===`zh`?`zh-CN`:`en`,W.set({lang:e})}function Ya(e){xa(ha,e?`1`:`0`),W.set({hideIdle:e})}function Xa(e,t){let n=W.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)}Qa(r)}function Za(){Qa(new Set)}function Qa(e){xa(ga,JSON.stringify([...e].sort())),W.set({collapsedOrigins:e})}function $a(e){xa(_a,e),W.set({viewMode:e})}function eo(e){xa(va,e?`1`:`0`),W.set({railCollapsed:e})}function to(){W.set(e=>({switcherOpen:!0,settings:{...e.settings,open:!1}}))}function no(){W.set({switcherOpen:!1})}function ro(){W.get().switcherOpen?no():to()}function io(e){let t=W.get().recentOrigins;t[0]!==e&&W.set({recentOrigins:[e,...t.filter(t=>t!==e)].slice(0,24)})}function ao(e){W.set(t=>({settings:{open:!0,section:e??t.settings.section},switcherOpen:!1}))}function oo(){W.set(e=>({settings:{...e.settings,open:!1}}))}function so(){let e=W.get().route.kind===`session`;e&&(za=`history`),Ia({kind:`overview`}),e||ao(`history`)}function co(e){W.set(t=>({settings:{...t.settings,section:e}}))}function lo(e){W.set({confirm:e})}function uo(){W.set({confirm:void 0})}async function fo(e,t){let n=await go(()=>L.cancel(e),t.failed);n&&(yo(n.summary),Aa(n.interrupted||n.cancelledQueued>0?`success`:`info`,n.interrupted||n.cancelledQueued>0?t.ok:t.nothing))}async function po(e,t){let n=await go(()=>L.stop(e),t.failed);n&&(yo(n.summary),Aa(`success`,t.ok))}async function mo(e,t){return await go(()=>L.remove(e),t.failed)?(ho(e),Aa(`success`,t.ok),!0):!1}function ho(e){W.set(t=>Ye(t,e))}async function go(e,t){try{return await e()}catch(e){let n=W.get().lang===`zh`?`:`:`: `;Aa(`error`,t?`${t}${n}${Na(e)}`:Na(e),6e3);return}}function _o(e){W.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 vo(e){W.set({profiles:e})}function yo(e){W.set(t=>Je(t,e))}function bo(){return B(W,e=>e.lang)}function G(){let e=bo();return(0,l.useMemo)(()=>rt(e),[e])}var xo=[{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`}],So=[{axis:`horizontal`,icon:`distributeH`,label:`arrange.distributeH`},{axis:`vertical`,icon:`distributeV`,label:`arrange.distributeV`}];function Co(){return typeof navigator<`u`&&/mac|iphone|ipad/i.test(navigator.platform)?`⌘`:`Ctrl+`}var wo=[`top`,`right`,`bottom`,`left`],To=Math.min,Eo=Math.max,Do=Math.round,Oo=Math.floor,ko=e=>({x:e,y:e}),Ao={left:`right`,right:`left`,bottom:`top`,top:`bottom`};function jo(e,t,n){return Eo(e,To(t,n))}function Mo(e,t){return typeof e==`function`?e(t):e}function No(e){return e.split(`-`)[0]}function Po(e){return e.split(`-`)[1]}function Fo(e){return e===`x`?`y`:`x`}function Io(e){return e===`y`?`height`:`width`}function Lo(e){let t=e[0];return t===`t`||t===`b`?`y`:`x`}function K(e){return Fo(Lo(e))}function Ro(e,t,n){n===void 0&&(n=!1);let r=Po(e),i=K(e),a=Io(i),o=i===`x`?r===(n?`end`:`start`)?`right`:`left`:r===`start`?`bottom`:`top`;return t.reference[a]>t.floating[a]&&(o=qo(o)),[o,qo(o)]}function zo(e){let t=qo(e);return[Bo(e),t,Bo(t)]}function Bo(e){return e.includes(`start`)?e.replace(`start`,`end`):e.replace(`end`,`start`)}var Vo=[`left`,`right`],Ho=[`right`,`left`],Uo=[`top`,`bottom`],Wo=[`bottom`,`top`];function Go(e,t,n){switch(e){case`top`:case`bottom`:return n?t?Ho:Vo:t?Vo:Ho;case`left`:case`right`:return t?Uo:Wo;default:return[]}}function Ko(e,t,n,r){let i=Po(e),a=Go(No(e),n===`start`,r);return i&&(a=a.map(e=>e+`-`+i),t&&(a=a.concat(a.map(Bo)))),a}function qo(e){let t=No(e);return Ao[t]+e.slice(t.length)}function Jo(e){return{top:e.top??0,right:e.right??0,bottom:e.bottom??0,left:e.left??0}}function Yo(e){return typeof e==`number`?{top:e,right:e,bottom:e,left:e}:Jo(e)}function Xo(e){let{x:t,y:n,width:r,height:i}=e;return{width:r,height:i,top:n,left:t,right:t+r,bottom:n+i,x:t,y:n}}function Zo(e,t,n){let{reference:r,floating:i}=e,a=Lo(t),o=K(t),s=Io(o),c=No(t),l=a===`y`,u=r.x+r.width/2-i.width/2,d=r.y+r.height/2-i.height/2,f=r[s]/2-i[s]/2,p;switch(c){case`top`:p={x:u,y:r.y-i.height};break;case`bottom`:p={x:u,y:r.y+r.height};break;case`right`:p={x:r.x+r.width,y:d};break;case`left`:p={x:r.x-i.width,y:d};break;default:p={x:r.x,y:r.y}}let m=Po(t);return m&&(p[o]+=f*(m===`end`?1:-1)*(n&&l?-1:1)),p}async function Qo(e,t){t===void 0&&(t={});let{x:n,y:r,platform:i,rects:a,elements:o,strategy:s}=e,{boundary:c=`clippingAncestors`,rootBoundary:l=`viewport`,elementContext:u=`floating`,altBoundary:d=!1,padding:f=0}=Mo(t,e),p=Yo(f),m=o[d?u===`floating`?`reference`:`floating`:u],h=Xo(await i.getClippingRect({element:await(i.isElement==null?void 0:i.isElement(m))??!0?m:m.contextElement||await(i.getDocumentElement==null?void 0:i.getDocumentElement(o.floating)),boundary:c,rootBoundary:l,strategy:s})),g=u===`floating`?{x:n,y:r,width:a.floating.width,height:a.floating.height}:a.reference,_=await(i.getOffsetParent==null?void 0:i.getOffsetParent(o.floating)),v=await(i.isElement==null?void 0:i.isElement(_))&&await(i.getScale==null?void 0:i.getScale(_))||{x:1,y:1},y=Xo(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:o,rect:g,offsetParent:_,strategy:s}):g);return{top:(h.top-y.top+p.top)/v.y,bottom:(y.bottom-h.bottom+p.bottom)/v.y,left:(h.left-y.left+p.left)/v.x,right:(y.right-h.right+p.right)/v.x}}var $o=50,es=async(e,t,n)=>{let{placement:r=`bottom`,strategy:i=`absolute`,middleware:a=[],platform:o}=n,s=o.detectOverflow?o:{...o,detectOverflow:Qo},c=await(o.isRTL==null?void 0:o.isRTL(t)),l=await o.getElementRects({reference:e,floating:t,strategy:i}),{x:u,y:d}=Zo(l,r,c),f=r,p=0,m={};for(let n=0;n<a.length;n++){let h=a[n];if(!h)continue;let{name:g,fn:_}=h,{x:v,y,data:b,reset:x}=await _({x:u,y:d,initialPlacement:r,placement:f,strategy:i,middlewareData:m,rects:l,platform:s,elements:{reference:e,floating:t}});u=v??u,d=y??d,m[g]={...m[g],...b},x&&p<$o&&(p++,typeof x==`object`&&(x.placement&&(f=x.placement),x.rects&&(l=x.rects===!0?await o.getElementRects({reference:e,floating:t,strategy:i}):x.rects),{x:u,y:d}=Zo(l,f,c)),n=-1)}return{x:u,y:d,placement:f,strategy:i,middlewareData:m}},ts=function(e){return e===void 0&&(e={}),{name:`flip`,options:e,async fn(t){var n;let{placement:r,middlewareData:i,rects:a,initialPlacement:o,platform:s,elements:c}=t,{mainAxis:l=!0,crossAxis:u=!0,fallbackPlacements:d,fallbackStrategy:f=`bestFit`,fallbackAxisSideDirection:p=`none`,flipAlignment:m=!0,...h}=Mo(e,t);if((n=i.arrow)!=null&&n.alignmentOffset)return{};let g=No(r),_=Lo(o),v=No(o)===o,y=await(s.isRTL==null?void 0:s.isRTL(c.floating)),b=d||(v||!m?[qo(o)]:zo(o)),x=p!==`none`;!d&&x&&b.push(...Ko(o,m,p,y));let S=[o,...b],C=await s.detectOverflow(t,h),w=[],T=i.flip?.overflows||[];if(l&&w.push(C[g]),u){let e=Ro(r,a,y);w.push(C[e[0]],C[e[1]])}if(T=[...T,{placement:r,overflows:w}],!w.every(e=>e<=0)){let e=(i.flip?.index||0)+1,t=S[e];if(t&&(u!==`alignment`||_===Lo(t)||T.every(e=>Lo(e.placement)!==_||e.overflows[0]>0)))return{data:{index:e,overflows:T},reset:{placement:t}};let n=T.filter(e=>e.overflows[0]<=0).sort((e,t)=>e.overflows[1]-t.overflows[1])[0]?.placement;if(!n)switch(f){case`bestFit`:{let e=T.filter(e=>{if(x){let t=Lo(e.placement);return t===_||t===`y`}return!0}).map(e=>[e.placement,e.overflows.filter(e=>e>0).reduce((e,t)=>e+t,0)]).sort((e,t)=>e[1]-t[1])[0]?.[0];e&&(n=e);break}case`initialPlacement`:n=o}if(r!==n)return{reset:{placement:n}}}return{}}}};function ns(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function rs(e){return wo.some(t=>e[t]>=0)}var is=function(e){return e===void 0&&(e={}),{name:`hide`,options:e,async fn(t){let{rects:n,platform:r}=t,{strategy:i=`referenceHidden`,...a}=Mo(e,t);switch(i){case`referenceHidden`:{let e=ns(await r.detectOverflow(t,{...a,elementContext:`reference`}),n.reference);return{data:{referenceHiddenOffsets:e,referenceHidden:rs(e)}}}case`escaped`:{let e=ns(await r.detectOverflow(t,{...a,altBoundary:!0}),n.floating);return{data:{escapedOffsets:e,escaped:rs(e)}}}default:return{}}}}},as=new Set([`left`,`top`]);async function os(e,t){let{placement:n,platform:r,elements:i}=e,a=await(r.isRTL==null?void 0:r.isRTL(i.floating)),o=No(n),s=Po(n),c=Lo(n)===`y`,l=as.has(o)?-1:1,u=a&&c?-1:1,d=Mo(t,e),{mainAxis:f,crossAxis:p,alignmentAxis:m}=typeof d==`number`?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:d.mainAxis||0,crossAxis:d.crossAxis||0,alignmentAxis:d.alignmentAxis};return s&&typeof m==`number`&&(p=s===`end`?m*-1:m),c?{x:p*u,y:f*l}:{x:f*l,y:p*u}}var ss=function(e){return e===void 0&&(e=0),{name:`offset`,options:e,async fn(t){var n;let{x:r,y:i,placement:a,middlewareData:o}=t,s=await os(t,e);return a===o.offset?.placement&&(n=o.arrow)!=null&&n.alignmentOffset?{}:{x:r+s.x,y:i+s.y,data:{...s,placement:a}}}}},cs=function(e){return e===void 0&&(e={}),{name:`shift`,options:e,async fn(t){let{x:n,y:r,placement:i,platform:a}=t,{mainAxis:o=!0,crossAxis:s=!1,limiter:c={fn:e=>{let{x:t,y:n}=e;return{x:t,y:n}}},...l}=Mo(e,t),u={x:n,y:r},d=await a.detectOverflow(t,l),f=Lo(i),p=Fo(f),m=u[p],h=u[f],g=(e,t)=>jo(t+d[e===`y`?`top`:`left`],t,t-d[e===`y`?`bottom`:`right`]);o&&(m=g(p,m)),s&&(h=g(f,h));let _=c.fn({...t,[p]:m,[f]:h});return{..._,data:{x:_.x-n,y:_.y-r,enabled:{[p]:o,[f]:s}}}}}},ls=function(e){return e===void 0&&(e={}),{name:`size`,options:e,async fn(t){let{placement:n,rects:r,platform:i,elements:a}=t,{apply:o=()=>{},...s}=Mo(e,t),c=await i.detectOverflow(t,s),l=No(n),u=Po(n),d=Lo(n)===`y`,{width:f,height:p}=r.floating,m,h;l===`top`||l===`bottom`?(m=l,h=u===(await(i.isRTL==null?void 0:i.isRTL(a.floating))?`start`:`end`)?`left`:`right`):(h=l,m=u===`end`?`top`:`bottom`);let g=p-c.top-c.bottom,_=f-c.left-c.right,v=To(p-c[m],g),y=To(f-c[h],_),b=t.middlewareData.shift,x=!b,S=v,C=y;b!=null&&b.enabled.x&&(C=_),b!=null&&b.enabled.y&&(S=g),x&&!u&&(d?C=f-2*Eo(c.left,c.right):S=p-2*Eo(c.top,c.bottom)),await o({...t,availableWidth:C,availableHeight:S});let w=await i.getDimensions(a.floating);return f!==w.width||p!==w.height?{reset:{rects:!0}}:{}}}};function us(){return typeof window<`u`}function ds(e){return ms(e)?(e.nodeName||``).toLowerCase():`#document`}function fs(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function ps(e){return((ms(e)?e.ownerDocument:e.document)||window.document)?.documentElement}function ms(e){return us()?e instanceof Node||e instanceof fs(e).Node:!1}function hs(e){return us()?e instanceof Element||e instanceof fs(e).Element:!1}function gs(e){return us()?e instanceof HTMLElement||e instanceof fs(e).HTMLElement:!1}function _s(e){return!us()||typeof ShadowRoot>`u`?!1:e instanceof ShadowRoot||e instanceof fs(e).ShadowRoot}function vs(e){let{overflow:t,overflowX:n,overflowY:r,display:i}=ks(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&i!==`inline`&&i!==`contents`}function ys(e){return/^(table|td|th)$/.test(ds(e))}function bs(e){try{if(e.matches(`:popover-open`))return!0}catch{}try{return e.matches(`:modal`)}catch{return!1}}var xs=/transform|translate|scale|rotate|perspective|filter/,Ss=/paint|layout|strict|content/,Cs=e=>!!e&&e!==`none`,ws;function Ts(e){let t=hs(e)?ks(e):e;return Cs(t.transform)||Cs(t.translate)||Cs(t.scale)||Cs(t.rotate)||Cs(t.perspective)||!Ds()&&(Cs(t.backdropFilter)||Cs(t.filter))||xs.test(t.willChange||``)||Ss.test(t.contain||``)}function Es(e){let t=js(e);for(;gs(t)&&!Os(t);){if(Ts(t))return t;if(bs(t))return null;t=js(t)}return null}function Ds(){return ws??=typeof CSS<`u`&&CSS.supports&&CSS.supports(`-webkit-backdrop-filter`,`none`),ws}function Os(e){return/^(html|body|#document)$/.test(ds(e))}function ks(e){return fs(e).getComputedStyle(e)}function As(e){return hs(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function js(e){if(ds(e)===`html`)return e;let t=e.assignedSlot||e.parentNode||_s(e)&&e.host||ps(e);return _s(t)?t.host:t}function Ms(e){let t=js(e);return Os(t)?(e.ownerDocument||e).body:gs(t)&&vs(t)?t:Ms(t)}function Ns(e,t,n){t===void 0&&(t=[]),n===void 0&&(n=!0);let r=Ms(e),i=r===e.ownerDocument?.body,a=fs(r);if(i){let e=Ps(a);return t.concat(a,a.visualViewport||[],vs(r)?r:[],e&&n?Ns(e):[])}return t.concat(r,Ns(r,[],n))}function Ps(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function Fs(e){let t=ks(e),n=parseFloat(t.width)||0,r=parseFloat(t.height)||0,i=gs(e),a=i?e.offsetWidth:n,o=i?e.offsetHeight:r,s=Do(n)!==a||Do(r)!==o;return s&&(n=a,r=o),{width:n,height:r,$:s}}function Is(e){return hs(e)?e:e.contextElement}function Ls(e){let t=Is(e);if(!gs(t))return ko(1);let n=t.getBoundingClientRect(),{width:r,height:i,$:a}=Fs(t),o=(a?Do(n.width):n.width)/r,s=(a?Do(n.height):n.height)/i;return o&&Number.isFinite(o)||(o=1),s&&Number.isFinite(s)||(s=1),{x:o,y:s}}var Rs=ko(0);function zs(e){let t=fs(e);return!Ds()||!t.visualViewport?Rs:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function Bs(e,t,n){return t===void 0&&(t=!1),!!n&&t&&n===fs(e)}function Vs(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);let i=e.getBoundingClientRect(),a=Is(e),o=ko(1);t&&(r?hs(r)&&(o=Ls(r)):o=Ls(e));let s=Bs(a,n,r)?zs(a):ko(0),c=(i.left+s.x)/o.x,l=(i.top+s.y)/o.y,u=i.width/o.x,d=i.height/o.y;if(a&&r){let e=fs(a),t=hs(r)?fs(r):r,n=e,i=Ps(n);for(;i&&t!==n;){let e=Ls(i),t=i.getBoundingClientRect(),r=ks(i),a=t.left+(i.clientLeft+parseFloat(r.paddingLeft))*e.x,o=t.top+(i.clientTop+parseFloat(r.paddingTop))*e.y;c*=e.x,l*=e.y,u*=e.x,d*=e.y,c+=a,l+=o,n=fs(i),i=Ps(n)}}return Xo({width:u,height:d,x:c,y:l})}function Hs(e,t){let n=As(e).scrollLeft;return t?t.left+n:Vs(ps(e)).left+n}function Us(e,t){let n=e.getBoundingClientRect();return{x:n.left+t.scrollLeft-Hs(e,n),y:n.top+t.scrollTop}}function Ws(e){let{elements:t,rect:n,offsetParent:r,strategy:i}=e,a=i===`fixed`,o=ps(r),s=t?bs(t.floating):!1;if(r===o||s&&a)return n;let c={scrollLeft:0,scrollTop:0},l=ko(1),u=ko(0),d=gs(r);if((d||!a)&&((ds(r)!==`body`||vs(o))&&(c=As(r)),d)){let e=Vs(r);l=Ls(r),u.x=e.x+r.clientLeft,u.y=e.y+r.clientTop}let f=o&&!d&&!a?Us(o,c):ko(0);return{width:n.width*l.x,height:n.height*l.y,x:n.x*l.x-c.scrollLeft*l.x+u.x+f.x,y:n.y*l.y-c.scrollTop*l.y+u.y+f.y}}function Gs(e){return e.getClientRects?Array.from(e.getClientRects()):[]}function Ks(e){let t=As(e),n=e.ownerDocument.body,r=Eo(e.scrollWidth,e.clientWidth,n.scrollWidth,n.clientWidth),i=Eo(e.scrollHeight,e.clientHeight,n.scrollHeight,n.clientHeight),a=-t.scrollLeft+Hs(e),o=-t.scrollTop;return ks(n).direction===`rtl`&&(a+=Eo(e.clientWidth,n.clientWidth)-r),{width:r,height:i,x:a,y:o}}var qs=25;function Js(e,t,n){n===void 0&&(n=`viewport`);let r=n===`layoutViewport`,i=fs(e),a=ps(e),o=i.visualViewport,s=a.clientWidth,c=a.clientHeight,l=0,u=0;if(o){let e=!Ds()||t===`fixed`;r?e||(l=-o.offsetLeft,u=-o.offsetTop):(s=o.width,c=o.height,e&&(l=o.offsetLeft,u=o.offsetTop))}if(Hs(a)<=0){let e=a.ownerDocument,t=e.body,n=getComputedStyle(t),r=e.compatMode===`CSS1Compat`&&parseFloat(n.marginLeft)+parseFloat(n.marginRight)||0,i=Math.abs(a.clientWidth-t.clientWidth-r),o=getComputedStyle(a).scrollbarGutter===`stable both-edges`?i/2:i;o<=qs&&(s-=o)}return{width:s,height:c,x:l,y:u}}function Ys(e,t){let n=Vs(e,!0,t===`fixed`),r=n.top+e.clientTop,i=n.left+e.clientLeft,a=Ls(e);return{width:e.clientWidth*a.x,height:e.clientHeight*a.y,x:i*a.x,y:r*a.y}}function Xs(e,t,n){let r;if(t===`viewport`||t===`layoutViewport`)r=Js(e,n,t);else if(t===`document`)r=Ks(ps(e));else if(hs(t))r=Ys(t,n);else{let n=zs(e);r={x:t.x-n.x,y:t.y-n.y,width:t.width,height:t.height}}return Xo(r)}function Zs(e,t){let n=t.get(e);if(n)return n;let r=Ns(e,[],!1).filter(e=>hs(e)&&ds(e)!==`body`),i=null,a=ks(e).position===`fixed`,o=a?js(e):e;for(;hs(o)&&!Os(o);){let e=ks(o),t=Ts(o),n=i?i.position:a?`fixed`:``;!t&&(n===`fixed`||n===`absolute`&&e.position===`static`)?r=r.filter(e=>e!==o):i=e,o=js(o)}return t.set(e,r),r}function Qs(e){let{element:t,boundary:n,rootBoundary:r,strategy:i}=e,a=[...n===`clippingAncestors`?bs(t)?[]:Zs(t,this._c):[].concat(n),r],o=Xs(t,a[0],i),s=o.top,c=o.right,l=o.bottom,u=o.left;for(let e=1;e<a.length;e++){let n=Xs(t,a[e],i);s=Eo(n.top,s),c=To(n.right,c),l=To(n.bottom,l),u=Eo(n.left,u)}return{width:c-u,height:l-s,x:u,y:s}}function $s(e){let{width:t,height:n}=Fs(e);return{width:t,height:n}}function ec(e,t,n){let r=gs(t),i=ps(t),a=n===`fixed`,o=Vs(e,!0,a,t),s={scrollLeft:0,scrollTop:0},c=ko(0);if((r||!a)&&((ds(t)!==`body`||vs(i))&&(s=As(t)),r)){let e=Vs(t,!0,a,t);c.x=e.x+t.clientLeft,c.y=e.y+t.clientTop}!r&&i&&(c.x=Hs(i));let l=i&&!r&&!a?Us(i,s):ko(0);return{x:o.left+s.scrollLeft-c.x-l.x,y:o.top+s.scrollTop-c.y-l.y,width:o.width,height:o.height}}function tc(e){return ks(e).position===`static`}function nc(e,t){if(!gs(e)||ks(e).position===`fixed`)return null;if(t)return t(e);let n=e.offsetParent;return ps(e)===n&&(n=n.ownerDocument.body),n}function rc(e,t){let n=fs(e);if(bs(e))return n;if(!gs(e)){let t=js(e);for(;t&&!Os(t);){if(hs(t)&&!tc(t))return t;t=js(t)}return n}let r=nc(e,t);for(;r&&ys(r)&&tc(r);)r=nc(r,t);return r&&Os(r)&&tc(r)&&!Ts(r)?n:r||Es(e)||n}var ic=async function(e){let t=this.getOffsetParent||rc,n=this.getDimensions,r=await n(e.floating);return{reference:ec(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function ac(e){return ks(e).direction===`rtl`}var oc={convertOffsetParentRelativeRectToViewportRelativeRect:Ws,getDocumentElement:ps,getClippingRect:Qs,getOffsetParent:rc,getElementRects:ic,getClientRects:Gs,getDimensions:$s,getScale:Ls,isElement:hs,isRTL:ac};function sc(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function cc(e,t,n){let r=null,i,a=ps(e);function o(){var e;clearTimeout(i),(e=r)==null||e.disconnect(),r=null}function s(n,c){n===void 0&&(n=!1),c===void 0&&(c=1),o();let l=e.getBoundingClientRect(),{left:u,top:d,width:f,height:p}=l;if(n||t(),!f||!p)return;let m=Oo(d),h=Oo(a.clientWidth-(u+f)),g=Oo(a.clientHeight-(d+p)),_=Oo(u),v={rootMargin:-m+`px `+-h+`px `+-g+`px `+-_+`px`,threshold:Eo(0,To(1,c))||1},y=!0;function b(t){let n=t[0].intersectionRatio;if(!sc(l,e.getBoundingClientRect()))return s();if(n!==c){if(!y)return s();n?s(!1,n):i=setTimeout(()=>{s(!1,1e-7)},1e3)}y=!1}try{r=new IntersectionObserver(b,{...v,root:a.ownerDocument})}catch{r=new IntersectionObserver(b,v)}r.observe(e)}let c=fs(e),l=()=>s(n);return c.addEventListener(`resize`,l),s(!0),()=>{c.removeEventListener(`resize`,l),o()}}function lc(e,t,n,r){r===void 0&&(r={});let{ancestorScroll:i=!0,ancestorResize:a=!0,elementResize:o=typeof ResizeObserver==`function`,layoutShift:s=typeof IntersectionObserver==`function`,animationFrame:c=!1}=r,l=Is(e),u=i||a?[...l?Ns(l):[],...t?Ns(t):[]]:[];u.forEach(e=>{i&&e.addEventListener(`scroll`,n),a&&e.addEventListener(`resize`,n)});let d=l&&s?cc(l,n,a):null,f=-1,p=null;o&&(p=new ResizeObserver(e=>{let[r]=e;r&&r.target===l&&p&&t&&(p.unobserve(t),cancelAnimationFrame(f),f=requestAnimationFrame(()=>{var e;(e=p)==null||e.observe(t)})),n()}),l&&!c&&p.observe(l),t&&p.observe(t));let m,h=c?Vs(e):null;c&&g();function g(){let t=Vs(e);h&&!sc(h,t)&&n(),h=t,m=requestAnimationFrame(g)}return n(),()=>{var e;u.forEach(e=>{i&&e.removeEventListener(`scroll`,n),a&&e.removeEventListener(`resize`,n)}),d?.(),(e=p)==null||e.disconnect(),p=null,c&&cancelAnimationFrame(m)}}var uc=ss,dc=cs,fc=ts,pc=ls,mc=is,hc=(e,t,n)=>{let r=new Map,i=n??{},a={...oc,...i.platform,_c:r};return es(e,t,{...i,platform:a})},gc=`.ws-topbar,.ws-head,.focus-head,.focus .tabs,.composer,.canvas-scale,.arrange,[data-float-bar]`;function _c(){let e=0,t=0,n=window.innerWidth,r=window.innerHeight,i=window.visualViewport;return i&&i.width>0&&i.height>0&&(e=i.offsetLeft,t=i.offsetTop,n=Math.min(n,i.width),r=Math.min(r,i.height)),{x:e,y:t,width:n,height:r}}function vc(e,t,n){let r=(e,t)=>({x:e,y:t,left:e,top:t,right:e,bottom:t,width:0,height:0}),i=n?.getBoundingClientRect(),a=i&&i.width>0?(e-i.left)/i.width:0,o=i&&i.height>0?(t-i.top)/i.height:0,s=i!==void 0&&i.width>0&&i.height>0;return{...n?{contextElement:n}:{},getBoundingClientRect(){if(n&&s){let e=n.getBoundingClientRect();if(e.width>0&&e.height>0)return r(e.left+a*e.width,e.top+o*e.height)}return r(e,t)}}}function yc(e){return e instanceof Element?e:e.contextElement??null}function bc(e,t){if(e?.closest(`.overlay`))return[];let n=[];for(let r of document.querySelectorAll(gc)){if(e&&r.contains(e))continue;let i=r.getBoundingClientRect();i.width<1||i.height<1||i.bottom<=t.y||i.top>=t.y+t.height||i.right<=t.x||i.left>=t.x+t.width||n.push({left:i.left,right:i.right,top:i.top,bottom:i.bottom})}return n}function xc(e,t,n,r,i){let a=e.y+e.height/2,o=e.y,s=e.y+e.height;for(let e of t)e.right<=n||e.left>=r||((e.top+e.bottom)/2<a?o=Math.max(o,e.bottom):s=Math.min(s,e.top));return s-o<i+32?e:{x:e.x,y:o,width:e.width,height:s-o}}function Sc(e,t){return e.width<1||e.height<1?!1:t.some(t=>e.left>=t.left-.5&&e.right<=t.right+.5&&e.top>=t.top-.5&&e.bottom<=t.bottom+.5)}var Cc=e=>{let t=window.devicePixelRatio||1;return Math.round(e*t)/t};function wc(e){let{reference:t,floating:n,placement:r}=e,i=e.gap??8,a=e.minRoom??96,o=e.flipCrossAxis===!0,s=e.slide===!0,c=yc(t),l=!0,u=0,d=lc(t,n,()=>{let d=++u;if(t instanceof Element&&!t.isConnected){e.onPosition({placement:r,hidden:!0});return}n.style.left=`0px`,n.style.top=`0px`,n.style.maxWidth=``,n.style.maxHeight=``,n.style.minWidth=``;let f=_c(),p=bc(c,f),m=e=>xc(f,p,e.x,e.x+e.rects.floating.width,a),h=e=>({boundary:m(e),rootBoundary:f,padding:16});hc(t,n,{strategy:`fixed`,placement:r,middleware:[uc(i),fc(e=>({...h(e),crossAxis:o,flipAlignment:o})),dc(e=>({...h(e),crossAxis:s})),pc(t=>({...h(t),apply({availableWidth:t,availableHeight:r,rects:i}){if(d!==u)return;let a=Math.max(0,r);i.floating.height>a&&(n.style.maxHeight=`${Math.floor(a)}px`);let o=Math.min(e.maxWidth??1/0,Math.max(0,t));i.floating.width>o&&(n.style.maxWidth=`${Math.floor(o)}px`,n.style.minWidth=`0px`)}})),mc({strategy:`referenceHidden`,rootBoundary:f,padding:-1})]}).then(({x:r,y:i,placement:a,middlewareData:o})=>{if(!l||d!==u)return;n.style.left=`${Cc(r)}px`,n.style.top=`${Cc(i)}px`;let s=(c??t).getBoundingClientRect(),f=o.hide?.referenceHidden===!0||Sc(s,p);e.onPosition({placement:a,hidden:f})}).catch(()=>{if(!l||d!==u)return;let a=t.getBoundingClientRect();n.style.left=`${Math.max(16,a.left)}px`,n.style.top=`${Math.max(16,a.bottom+i)}px`,e.onPosition({placement:r,hidden:!1})})},{animationFrame:e.animationFrame===!0});return()=>{l=!1,d()}}function Tc(e){let[t,n]=e.split(`-`);return`${t===`top`?`bottom`:`top`} ${n===`end`?`right`:`left`}`}function Ec(e,t,n={}){let r=n=>{let r=n.target;r instanceof Node&&(e()?.contains(r)??!1)||t()};return window.addEventListener(`scroll`,r,!0),n.wheel&&window.addEventListener(`wheel`,r,{capture:!0,passive:!0}),()=>{window.removeEventListener(`scroll`,r,!0),n.wheel&&window.removeEventListener(`wheel`,r,!0)}}function Dc(e,t){let n;return{leave(){n===void 0&&(e()?.setAttribute(`data-leaving`,``),n=setTimeout(t,140))},cancel(){clearTimeout(n),n=void 0}}}function Oc(e,t){let n=Math.sin(e*12.9898+t*78.233)*43758.5453;return n-Math.floor(n)}function kc(e){return Array.from({length:e},(e,t)=>{let n=Math.min(2,Math.floor(Oc(t,2.3)*3)),r=-1+.5*Math.min(3,Math.floor(Oc(t,5.9)*4)),i=Oc(t,7.7)<.5?1:-1;return{axis:n,lo:r,hi:r+.5,angle:i*Math.PI/2}})}var Ac=kc(14);function jc(e){let t=Ac.length,n=.42,r=e%(2*t*n+1.2),i=Array(t).fill(0),a=-1;if(r<2*t*n){let e=Math.floor(r/n),o=(r-e*n)/n,s=1-(1-Math.min(1,o/.7))**3;a=e<t?e:2*t-1-e;for(let e=0;e<a;e++)i[e]=1;i[a]=e<t?s:1-s}return Ac.flatMap((e,t)=>{let n=i[t];if(n<=0)return[];let r=e.angle*n;return[{...e,cos:Math.cos(r),sin:Math.sin(r),active:t===a}]})}function Mc(e,t){let[n,r,i]=e,a=!1;for(let{axis:e,lo:o,hi:s,cos:c,sin:l,active:u}of t){let t=e===0?n:e===1?r:i;t<o||t>=s||(u&&(a=!0),e===0?[r,i]=[r*c-i*l,r*l+i*c]:e===1?[n,i]=[n*c+i*l,-n*l+i*c]:[n,r]=[n*c-r*l,n*l+r*c])}return[n,r,i,a]}function Nc(e,t,n){let r=Math.sqrt(e),i=Math.max(2,Math.round(15*r)),a=Math.max(2,Math.round(40*r)),o=[];for(let e=0;e<=i;e++){let t=-Math.PI/2+e/i*Math.PI,n=Math.cos(t),r=Math.sin(t),s=Math.max(1,Math.round(Math.abs(n)*a));for(let e=0;e<s;e++){let t=e/s*2*Math.PI;o.push([n*Math.cos(t),r,n*Math.sin(t)])}}return{speed:n,lattice:o,rBase:.6*t,rDepth:1.7*t,rActive:.3*t}}var Pc=Nc(.088,1.9,1.95),Fc=Nc(.35,1.05,1.82);function Ic(e){return e<42?Pc:Fc}function Lc(e,t){let{lattice:n,rBase:r,rDepth:i,rActive:a}=Ic(e),o=e/2,s=e/2*.82,c=(e/300)**.6,l=.35+.1*Math.sin(t*.9),u=Math.sin(l),d=Math.cos(l),f=Math.sin(t*.55),p=Math.cos(t*.55),m=jc(t),h=[];for(let e of n){let[t,n,l,g]=Mc(e,m),_=t*p+l*f,v=-t*f+l*p,y=n*d-v*u,b=n*u+v*d,x=(b+1)/2;h.push({x:o+_*s,y:o-y*s,z:b,r:Math.max(.3,(r+i*x+(g?a:0))*c),white:.62-.54*x-(g?.14:0)})}return h.sort((e,t)=>e.z-t.z),{dots:h,lines:[]}}var Rc=(e,t)=>{let n=Math.sqrt(Math.PI)*t.r;e.fillRect(t.x-n/2,t.y-n/2,n,n)};function zc(e,t,n,r){let i=Math.round(t*n),a=e.canvas;a.width!==i&&(a.width=i),a.height!==i&&(a.height=i);let o=i/t;e.setTransform(o,0,0,o,0,0),e.clearRect(0,0,t,t),e.fillStyle=getComputedStyle(a).color;for(let t of r)e.globalAlpha=(1-Math.min(1,Math.max(0,t.white)))*(t.a??1),Rc(e,t);e.globalAlpha=1}var Bc;function Vc(){let e=new Map,t=new Set,n=window.matchMedia(`(prefers-reduced-motion: reduce)`),r=window.matchMedia(`(prefers-color-scheme: dark)`),i=()=>window.matchMedia(`(resolution: ${window.devicePixelRatio}dppx)`),a=i(),o;function s(e,n){let r=new Map;for(let i of t){if(n&&i.still)continue;let t=r.get(i.size);if(!t){let a=n?.6:e/1e3*Ic(i.size).speed;t=Lc(i.size,a).dots,r.set(i.size,t)}zc(i.ctx,i.size,window.devicePixelRatio||1,t),i.still=n}}function c(e){s(e,!1),o=requestAnimationFrame(c)}function l(){t.size&&!document.hidden&&!n.matches?o??=requestAnimationFrame(c):(o!==void 0&&cancelAnimationFrame(o),o=void 0,!document.hidden&&n.matches&&s(0,!0))}function u(){for(let e of t)e.still=!1;l()}function d(e){if(n.matches&&e.propertyName===`color`&&e.target instanceof Element){for(let n of t)e.target.contains(n.ctx.canvas)&&(n.still=!1);l()}}function f(){a.removeEventListener(`change`,f),a=i(),a.addEventListener(`change`,f),u()}let p=typeof IntersectionObserver>`u`?void 0:new IntersectionObserver(n=>{for(let r of n){let n=e.get(r.target);n&&(r.isIntersecting?t.add(n):(t.delete(n),n.still=!1))}l()});return document.addEventListener(`visibilitychange`,l),document.addEventListener(`transitionend`,d),document.addEventListener(`transitioncancel`,d),n.addEventListener(`change`,u),r.addEventListener(`change`,u),a.addEventListener(`change`,f),i=>{let o=i.ctx.canvas;return e.set(o,i),p?p.observe(o):t.add(i),l(),()=>{p?.unobserve(o),e.delete(o),t.delete(i),l(),e.size||(p?.disconnect(),document.removeEventListener(`visibilitychange`,l),document.removeEventListener(`transitionend`,d),document.removeEventListener(`transitioncancel`,d),n.removeEventListener(`change`,u),r.removeEventListener(`change`,u),a.removeEventListener(`change`,f),Bc=void 0)}}}function Hc(e,t){let n=e.getContext(`2d`);if(!(!n||t<=0))return Bc??=Vc(),Bc({ctx:n,size:t,still:!1})}var Uc=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})),q=e(((e,t)=>{t.exports=Uc()}))(),Wc=2.2,Gc={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`,terminalWindow:`M3 5h18v14H3z M7 9l3 3-3 3 M13.5 15h3.5`,identityBadge:`M9 5H5v16h14V5h-4 M9 3h6v4H9z M14.2 11.7a2.2 2.2 0 1 1-4.4 0 2.2 2.2 0 0 1 4.4 0z M8.2 18c.4-1.6 1.8-2.5 3.8-2.5s3.4.9 3.8 2.5`,sliders:`M3.5 7.5h4 M11.5 7.5h9 M7.5 5h4v5h-4z M3.5 16.5h10 M17.5 16.5h3 M13.5 14h4v5h-4z`,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`},Kc=`M12 1.62L22.38 12L12 22.38L1.62 12z`,qc=`M9.6 7.9v8.2M9.6 14.7L15.4 11.2`,Jc=[[9.6,7.9],[9.6,16.1],[15.4,11.2]],Yc=3.2;function Xc(e){let t=`git-fork-${(0,l.useId)().replace(/:/g,``)}`;return(0,q.jsxs)(`svg`,{...e,fill:`currentColor`,children:[(0,q.jsxs)(`mask`,{id:t,maskUnits:`userSpaceOnUse`,x:`0`,y:`0`,width:`24`,height:`24`,children:[(0,q.jsx)(`rect`,{width:`24`,height:`24`,fill:`#fff`}),(0,q.jsx)(`path`,{d:qc,fill:`none`,stroke:`#000`,strokeWidth:`1.9`,strokeLinecap:`square`}),Jc.map(([e,t])=>(0,q.jsx)(`rect`,{x:-3.2/2,y:-3.2/2,width:Yc,height:Yc,transform:`translate(${e} ${t}) rotate(45)`,fill:`#000`},`${e}-${t}`))]}),(0,q.jsx)(`path`,{d:Kc,mask:`url(#${t})`})]})}function J({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,q.jsxs)(`svg`,{...a,fill:`currentColor`,children:[(0,q.jsx)(`rect`,{x:`3.8`,y:`10.3`,width:`3.4`,height:`3.4`}),(0,q.jsx)(`rect`,{x:`10.3`,y:`10.3`,width:`3.4`,height:`3.4`}),(0,q.jsx)(`rect`,{x:`16.8`,y:`10.3`,width:`3.4`,height:`3.4`})]}):e===`stop`?(0,q.jsx)(`svg`,{...a,fill:`currentColor`,children:(0,q.jsx)(`rect`,{x:`6.5`,y:`6.5`,width:`11`,height:`11`})}):e===`dot`?(0,q.jsx)(`svg`,{...a,fill:`currentColor`,children:(0,q.jsx)(`rect`,{x:`8`,y:`8`,width:`8`,height:`8`})}):e===`git`?(0,q.jsx)(Xc,{...a}):(0,q.jsx)(`svg`,{...a,fill:`none`,stroke:`currentColor`,strokeWidth:i,strokeLinecap:`square`,strokeLinejoin:`miter`,strokeMiterlimit:Wc,children:(0,q.jsx)(`path`,{d:Gc[e]})})}function Zc({phase:e,size:t=8}){return(0,q.jsx)(`span`,{className:`status-dot`,"data-phase":e,style:{width:t,height:t},"aria-hidden":`true`})}function Qc({icon:e,label:t,size:n=15,tone:r=`default`,className:i,...a}){return(0,q.jsx)(`button`,{type:`button`,className:`icon-btn${i?` ${i}`:``}`,"data-tone":r,"aria-label":t,"data-tip":t,...a,children:(0,q.jsx)(J,{name:e,size:n})})}function $c({children:e,tone:t=`neutral`,icon:n,tip:r,className:i}){return(0,q.jsxs)(`span`,{className:`chip${i?` ${i}`:``}`,"data-tone":t,"data-tip":r,children:[n?(0,q.jsx)(J,{name:n,size:12}):null,e]})}function el({size:e=16}){let t=(0,l.useRef)(null);return(0,l.useEffect)(()=>{if(t.current)return Hc(t.current,e)},[e]),(0,q.jsx)(`canvas`,{ref:t,className:`spinner`,style:{width:e,height:e},"aria-hidden":`true`})}function tl({value:e,label:t,size:n=13}){let r=G(),[i,a]=(0,l.useState)(!1),o=(0,l.useRef)(void 0);return(0,l.useEffect)(()=>()=>clearTimeout(o.current),[]),(0,q.jsx)(`button`,{type:`button`,className:`icon-btn icon-btn--bare`,"aria-label":t,"data-tip":i?r(`common.copied`):t,onClick:t=>{t.stopPropagation(),nl(e).then(e=>{e?(a(!0),clearTimeout(o.current),o.current=setTimeout(()=>a(!1),1400)):Aa(`warn`,r(`common.copyFailed`))})},children:(0,q.jsx)(J,{name:i?`check`:`copy`,size:n})})}async function nl(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}}var rl=340,il=180;function al(){let[e,t]=(0,l.useState)(void 0),n=(0,l.useRef)(null),r=(0,l.useRef)(void 0),i=(0,l.useRef)(void 0),a=(0,l.useRef)(0),o=(0,l.useRef)(null),s=(0,l.useRef)(()=>void 0),c=(0,l.useRef)(null);(0,l.useEffect)(()=>{let e=()=>{clearTimeout(i.current),i.current=void 0},c=()=>{clearTimeout(r.current),e(),o.current=null,t(e=>{e&&(a.current=Date.now())})};s.current=c;let l=n=>{if(!n.getAttribute(`data-tip`))return;e(),o.current=n;let i=()=>{if(!n.isConnected)return;let e=n.getAttribute(`data-tip`);e&&t({text:e,target:n})};clearTimeout(r.current),r.current=Date.now()-a.current<500?void 0:setTimeout(i,260),r.current||i()},u=e=>e instanceof Node&&(n.current?.contains(e)??!1),d=t=>{if(u(t.target)){e();return}let n=t.target?.closest?.(`[data-tip]`);n?n!==o.current&&l(n):o.current&&(t.type!==`pointerover`||i.current===void 0)&&c()},f=t=>{let r=o.current;if(!r)return;let a=t.relatedTarget instanceof Node?t.relatedTarget:null;a&&(r.contains(a)||u(a))?e():n.current?.hasAttribute(`data-scroll`)&&t.target instanceof Node&&r.contains(t.target)?(e(),i.current=setTimeout(c,il)):(i.current===void 0||u(t.target))&&c()},p=e=>{u(e.target)||c()};document.addEventListener(`pointerover`,d),document.addEventListener(`pointerout`,f),document.addEventListener(`focusin`,d),document.addEventListener(`focusout`,c);let m=e=>{e.key===`Escape`&&c()};document.addEventListener(`pointerdown`,p,!0),document.addEventListener(`keydown`,m),window.addEventListener(`blur`,c);let h=new MutationObserver(()=>{let e=o.current;if(!e)return;let n=e.getAttribute(`data-tip`);n?t(e=>e&&e.text!==n?{...e,text:n}:e):c()});return h.observe(document.body,{subtree:!0,attributes:!0,attributeFilter:[`data-tip`]}),()=>{h.disconnect(),clearTimeout(r.current),e(),document.removeEventListener(`pointerover`,d),document.removeEventListener(`pointerout`,f),document.removeEventListener(`focusin`,d),document.removeEventListener(`focusout`,c),document.removeEventListener(`pointerdown`,p,!0),document.removeEventListener(`keydown`,m),window.removeEventListener(`blur`,c)}},[]);let d=e?.target,f=e?.text;return(0,l.useLayoutEffect)(()=>{let e=n.current;if(!d||!e)c.current=null;else return c.current!==d&&(e.removeAttribute(`data-ready`),c.current=d),wc({reference:d,floating:e,placement:`top`,gap:8,maxWidth:rl,minRoom:32,onPosition:({hidden:t})=>{t?s.current():(e.setAttribute(`data-ready`,``),e.scrollHeight>e.clientHeight+1?e.setAttribute(`data-scroll`,``):e.removeAttribute(`data-scroll`))}})},[d,f]),e?(0,u.createPortal)((0,q.jsx)(`div`,{ref:n,className:`tip`,role:`tooltip`,children:e.text}),document.body):null}function ol({engine:e}){let t=G(),{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=Co(),c=(e,r)=>()=>{o(r()?t(`arrange.done`,{action:e,n}):t(`arrange.unchanged`,{action:e}))},u=n>=3;return(0,q.jsxs)(`div`,{className:`arrange`,role:`toolbar`,"aria-label":t(`arrange.label`),children:[(0,q.jsxs)(`span`,{className:`arrange-count`,children:[(0,q.jsx)(`b`,{className:`num`,children:n}),` `,t(`arrange.count`)]}),(0,q.jsx)(`span`,{className:`dock-divider arrange-lead`,"aria-hidden":`true`}),(0,q.jsx)(`div`,{className:`arrange-group`,children:xo.map(({mode:n,icon:r,label:i})=>(0,q.jsx)(Qc,{icon:r,label:t(i),onClick:c(t(i),()=>e.align(n))},n))}),(0,q.jsx)(`span`,{className:`dock-divider`,"aria-hidden":`true`}),(0,q.jsx)(`div`,{className:`arrange-group`,children:So.map(({axis:n,icon:r,label:i})=>(0,q.jsx)(Qc,{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,q.jsx)(`span`,{className:`dock-divider`,"aria-hidden":`true`}),(0,q.jsxs)(`div`,{className:`arrange-group`,children:[(0,q.jsx)(Qc,{icon:`undo`,label:t(`arrange.undo`,{keys:`${s}Z`}),"aria-disabled":!r||void 0,onClick:r?()=>e.undo():void 0}),(0,q.jsx)(Qc,{icon:`redo`,label:t(`arrange.redo`,{keys:`${s}Shift+Z`}),"aria-disabled":!i||void 0,onClick:i?()=>e.redo():void 0})]}),(0,q.jsx)(`span`,{className:`dock-divider`,"aria-hidden":`true`}),(0,q.jsx)(Qc,{icon:`close`,label:t(`arrange.clear`),onClick:()=>e.clearSelection()}),(0,q.jsx)(`span`,{className:`sr-only`,"aria-live":`polite`,children:a})]})}var sl=(e,t)=>at(t,e);function cl(e){let t=lt(e),n=[...e].sort(sl),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 ll(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 ul(e,t){return e?.first===t?.first&&e?.index===t?.index}var dl=new it({nodeId:void 0});function fl(e){return B(dl,t=>t.nodeId===e)}var pl=`/assets/antigravity-DgAQAdn3.svg`,ml={agy:{src:pl,optical:{left:0,top:.0417,width:1,height:.9212,reach:1}},claude:{src:`/assets/claude-code-B8eqCvAs.svg`,optical:{left:0,top:.1875,width:1,height:.625,reach:1}},codex:{src:`/assets/codex-BvkQYgV5.svg`,optical:{left:0,top:0,width:1,height:1,reach:22/24}},cursor:{src:`/assets/cursor-D2tyRWTE.svg`,optical:{left:.0614,top:0,width:.8772,height:1,reach:1}},dsh:{src:`/assets/dsh-DNAEj8if.svg`,optical:{left:.02,top:.14,width:.9668,height:.7263,reach:1}},opencode:{src:`/assets/opencode-CdSE0wKU.svg`,optical:{left:.1,top:0,width:.8,height:1,reach:20/24}},pi:{src:`/assets/pi-DP_DEFhy.svg`,optical:{left:.2066,top:.2066,width:.5868,height:.5868,reach:22/24}}},hl=e=>Object.hasOwn(ml,e),gl={left:.1921,top:.1542,width:.6158,height:.7333,reach:22/24};function _l({harness:e,size:t=40,variant:n=`tile`,simulated:r=!1,tip:i}){let a=hl(e)?ml[e]:void 0,o=n===`glyph`?a?.optical??gl: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,q.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,q.jsx)(`svg`,{width:s,height:s,style:c,viewBox:`0 0 24 24`,fill:`none`,"aria-hidden":`true`,children:(0,q.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,q.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,q.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})}function vl(e){return e.target===e.currentTarget&&!e.ctrlKey&&!e.metaKey&&!e.altKey}function yl(e,t){return n=>{if(!vl(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 bl=new Set([`codex`,`cursor`,`claude`,`pi`,`antigravity`]),xl=12;function Sl({host:e,label:t,size:n=18,fit:r=!1}){let i=gt(e,t);if(i===`antigravity`)return(0,q.jsx)(`img`,{className:`harness-mark`,"data-harness":`antigravity`,src:pl,width:n,height:n,alt:``,"aria-hidden":`true`,draggable:!1});if(bl.has(i))return(0,q.jsx)(_l,{harness:i,size:n,variant:`bare`});let a=r?n*1.2:n;return i===`console`?(0,q.jsx)(J,{name:`user`,size:a}):(0,q.jsx)(J,{name:`terminal`,size:a})}var Cl=(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=G(),f=bo(),p=(0,l.useRef)(null),m=fl(kn(e.key));(0,l.useLayoutEffect)(()=>{let t=p.current;return t?u.register(kn(e.key),t):void 0},[u,e.key]);let h=(0,l.useMemo)(()=>yl(u,kn(e.key)),[u,e.key]),g=e.kind===`user`,_=_t(e),v=g?d(`origin.user`):_,y=gt(e.host,e.hostLabel),b=!g&&!bl.has(y),x=[d(`origin.tipHead`,{host:_}),...bt(e,d),xt(e,d),`${d(`origin.started`)}: ${jt(r,f)}`].filter(Boolean).join(`
|
|
21
|
+
`),S=n>0?d(`origin.countRunning`,{n:t,running:n}):d(`origin.count`,{n:t}),C=n>0?d(`origin.collapsedTipRunning`,{n:c,running:n}):d(`origin.collapsedTip`,{n:c}),w=o?void 0:e.workspace||void 0,T=!o&&yt(e),E=w!==void 0||T,D=e=>(0,q.jsx)(`time`,{className:e,dateTime:r,children:At(r,f,a)});return(0,q.jsxs)(`div`,{ref:p,className:`node origin`,"data-node":!0,"data-node-id":kn(e.key),"data-host":e.host,"data-tip":x,"data-collapsed":s?``:void 0,"data-menu-open":m?``:void 0,tabIndex:0,role:`group`,"aria-label":d(s?`scene.originLabelCollapsed`:`scene.originLabel`,{title:v}),"aria-description":d(`scene.originKeyboard`),onKeyDown:h,children:[(0,q.jsxs)(`header`,{className:`o-head`,children:[(0,q.jsx)(`span`,{className:`a-mark`,children:(0,q.jsx)(Sl,{host:e.host,label:e.hostLabel,size:xl,fit:!0})}),(0,q.jsx)(`span`,{className:`o-label`,children:d(`origin.head`)}),b?(0,q.jsx)(`span`,{className:`a-model`,children:v}):null,s?(0,q.jsxs)(`button`,{type:`button`,className:`o-count o-expand num`,"aria-label":d(`origin.expand`),"aria-description":C,"data-tip":C,onClick:()=>Xa(e.key,!1),children:[(0,q.jsx)(J,{name:`eyeOff`,size:11,strokeWidth:1.9}),n>0?(0,q.jsx)(`i`,{className:`a-run`,"aria-hidden":`true`}):null,t]}):(0,q.jsxs)(`span`,{className:`o-count num`,"data-tip":S,children:[n>0?(0,q.jsx)(`i`,{className:`a-run`,"aria-hidden":`true`}):null,t]})]}),(0,q.jsxs)(`div`,{className:`o-body`,children:[(0,q.jsxs)(`div`,{className:`o-main`,children:[E?(0,q.jsx)(J,{name:`folder`,size:13,className:`o-ico`}):(0,q.jsx)(J,{name:`clock`,size:13,className:`o-ico`}),w?(0,q.jsx)(`span`,{className:`o-text`,children:Bt(w)}):T?(0,q.jsx)(`span`,{className:`o-text o-unknown`,children:d(`origin.workspaceUnknown`)}):D(`o-text num`)]}),E?(0,q.jsx)(`span`,{className:`o-sub`,children:D(`num`)}):null,i?(0,q.jsx)(`span`,{className:`o-title`,"data-tip":`${d(`origin.titleTip`,{host:_})}\n${i}`,children:i}):null]})]})}),wl=.5,Tl=[`pointerdown`,`keydown`,`click`],El=new Set([`left`,`top`,`width`,`height`]),Dl=(e,t)=>Math.abs(e.left-t.left)<.001&&Math.abs(e.top-t.top)<.001&&Math.abs(e.width-t.width)<.001&&Math.abs(e.height-t.height)<.001,Ol=e=>({left:e.left,top:e.top,width:e.width,height:e.height}),kl=(e,t)=>({left:t.left-e.navHost.left,top:t.top-e.navHost.top,width:t.width,height:t.height}),Al=(e,t)=>({left:t.left-e.scrollHost.left,top:t.top-e.scrollHost.top,width:t.width,height:t.height}),jl=(e,t)=>({left:t.left+e.scrollHost.left-e.navHost.left,top:t.top+e.scrollHost.top-e.navHost.top,width:t.width,height:t.height}),Ml=(e,t)=>{let n=e.scroll.top-e.navHost.top;return t.top>=n-wl&&t.top+t.height<=n+e.scroll.height+wl},Nl=(e,t)=>Math.max(Math.abs(e.top-t.top),Math.abs(e.top+e.height-(t.top+t.height)));function Pl(e){return`${e.closest(`.rail-entry`)?.dataset.railOrigin??``}|${e.dataset.railRow??e.dataset.railView??``}`}var Fl=()=>typeof window.matchMedia==`function`&&window.matchMedia(`(prefers-reduced-motion: reduce)`).matches;function Il(e){let t=getComputedStyle(e).transitionDuration.split(`,`)[0]?.trim()??``,n=Number.parseFloat(t);return Number.isFinite(n)?t.endsWith(`ms`)?n:n*1e3:0}var Ll=class{parts;reduced;clock;tracks;laid=new WeakMap;observer;watched=new Set;disposed=!1;navHost;scrollHost;lastInput=-1/0;onInput=()=>{this.lastInput=this.clock()};constructor(e,t=Fl,n=()=>performance.now()){this.parts=e,this.reduced=t,this.clock=n;for(let e of Tl)document.addEventListener(e,this.onInput,{capture:!0,passive:!0});this.navHost=e.trail.parentElement??e.nav,this.scrollHost=e.item.parentElement??e.scroll,this.tracks=[{selector:`.rail-item[data-active]`,slot:void 0,flight:void 0,inScroll:e.item,inNav:e.trail},{selector:`.rail-sibling[data-active]`,slot:void 0,flight:void 0,inScroll:e.sibling,inNav:void 0}],this.observer=typeof ResizeObserver>`u`?void 0:new ResizeObserver(()=>this.sync())}sync(){if(this.disposed)return;let{nav:e,scroll:t}=this.parts,n=this.tracks.map(t=>e.querySelector(t.selector));if(n.some(e=>e)||this.tracks.some(e=>e.slot)){let e={navHost:this.navHost.getBoundingClientRect(),scrollHost:this.scrollHost.getBoundingClientRect(),scroll:t.getBoundingClientRect()};this.tracks.forEach((t,r)=>this.follow(t,n[r]??null,e))}this.watch()}dispose(){this.disposed=!0;for(let e of Tl)document.removeEventListener(e,this.onInput,{capture:!0});for(let e of this.tracks)this.stop(e);this.observer?.disconnect(),this.watched.clear()}watch(){let e=this.observer;if(!e)return;let{nav:t,scroll:n}=this.parts,r=new Set([t,n]);for(let e of[t,n])for(let t of e.children)t.classList.contains(`rail-glide-host`)||r.add(t);for(let t of this.watched)r.has(t)||e.unobserve(t);for(let t of r)this.watched.has(t)||e.observe(t,{box:`border-box`});this.watched=r}follow(e,t,n){if(!t){this.clear(e);return}let r=this.parts.scroll.contains(t);if(!r&&!e.inNav){this.clear(e);return}let i=Ol(t.getBoundingClientRect()),a={key:Pl(t),scroll:r,box:r?Al(n,i):kl(n,i)},o=e.slot;e.slot=a,o&&o.key===a.key&&o.scroll===a.scroll?this.rest(e,n):this.change(e,o,n)}change(e,t,n){let r=e.slot,i=e.flight,a=i?i.el===e.inScroll:t?.scroll===!0,o,s;if(i){let e=Ol(i.el.getBoundingClientRect());s=kl(n,e),a&&(o=Al(n,e))}else t&&(o=t.scroll?t.box:void 0,s=t.scroll?jl(n,t.box):t.box);if(this.stop(e),!s||this.reduced()||this.clock()-this.lastInput>1200){this.rest(e,n);return}let c=r.scroll?jl(n,r.box):r.box;if(r.scroll&&a&&o){if(Nl(o,r.box)>320){this.rest(e,n);return}this.hide(e.inNav),this.place(e.inScroll,r.box),this.glide(e,e.inScroll,o,r.box);return}let l=e.inNav,u=(!a||Ml(n,s))&&(!r.scroll||Ml(n,c));!l||!u||Nl(s,c)>320?this.rest(e,n):(this.hide(e.inScroll),this.place(l,c),this.glide(e,l,s,c,()=>{e.slot?.scroll&&(this.place(e.inScroll,e.slot.box),this.hide(l))}))}rest(e,t){let n=e.slot;if(!n)return;let r=n.scroll?e.inScroll:e.inNav;if(!r)return;let i=e.flight;if(i&&i.el!==r)this.place(i.el,n.scroll?jl(t,n.box):n.box);else{this.place(r,n.box);for(let t of[e.inScroll,e.inNav])t&&t!==r&&t!==i?.el&&this.hide(t)}}clear(e){this.stop(e),e.slot=void 0,this.hide(e.inScroll),this.hide(e.inNav)}place(e,t){let n=this.laid.get(e);n&&Dl(n,t)||(e.style.left=`${t.left}px`,e.style.top=`${t.top}px`,e.style.width=`${t.width}px`,e.style.height=`${t.height}px`,this.laid.set(e,t)),e.hasAttribute(`data-show`)||e.setAttribute(`data-show`,``)}hide(e){e&&(e.hasAttribute(`data-show`)&&e.removeAttribute(`data-show`),this.laid.delete(e))}glide(e,t,n,r,i){if(Dl(n,r)){i?.();return}t.removeAttribute(`data-moving`),this.place(t,n),t.offsetWidth,t.setAttribute(`data-moving`,``),this.place(t,r);let a,o=()=>{t.removeEventListener(`transitionend`,c),a!==void 0&&clearTimeout(a),t.removeAttribute(`data-moving`)},s=()=>{e.flight?.el===t&&(e.flight=void 0,o(),i?.())},c=e=>{e.target===t&&El.has(e.propertyName)&&s()};t.addEventListener(`transitionend`,c),e.flight={el:t,stop:o},a=setTimeout(s,Il(t)+80)}stop(e){let t=e.flight;t&&(e.flight=void 0,t.stop())}};function Rl(){let e={nav:(0,l.useRef)(null),scroll:(0,l.useRef)(null),trail:(0,l.useRef)(null),item:(0,l.useRef)(null),sibling:(0,l.useRef)(null)},t=(0,l.useRef)(void 0);return(0,l.useLayoutEffect)(()=>{let{nav:n,scroll:r,trail:i,item:a,sibling:o}=e;if(!n.current||!r.current||!i.current||!a.current||!o.current)return;let s=new Ll({nav:n.current,scroll:r.current,trail:i.current,item:a.current,sibling:o.current});return t.current=s,()=>{s.dispose(),t.current=void 0}},[]),(0,l.useLayoutEffect)(()=>{t.current?.sync()}),e}function zl(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 Y=(e,t)=>nt(W.get().lang,e,t),Bl=new it({list:{status:`idle`},busy:0});function Vl(){return Bl.get().busy>0}var Hl;function Ul(e={}){let t=W.get();return t.archivedCount===void 0||t.archivedLoaded&&!e.force?Promise.resolve():Hl||(Hl=(async()=>{Ue(),Bl.set({list:{status:`loading`}});try{let{sessions:e}=await L.sessions({archived:`only`}),t=We();W.set(n=>Ze(n,e,t)),Bl.set({list:{status:`idle`}})}catch(e){throw We(),Bl.set({list:{status:`error`,error:Na(e)}}),e}})().finally(()=>{Hl=void 0}),Hl)}var Wl={working:`archive.keptWorking`,pending:`archive.keptPending`},Gl={working:`archive.blockedWorking`,pending:`archive.blockedPending`};function Kl(e,t){return t(Gl[e.reason],{n:e.n})}function ql(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:Y(`archive.noneActive`)}:r.has(`not_found`)?{tone:`warn`,text:Y(`archive.noneMissing`)}:{tone:`info`,text:Y(`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=>Y(Wl[e.reason],{n:e.n})).join(``)+(o>0?Y(`archive.keptFollowing`,{n:o}):``);return{tone:`success`,text:`${Y(`archive.done`,{n})}${s}`}}async function Jl(e,t){if(!(e.length===0||Bl.get().busy>0)){Bl.set(e=>({busy:e.busy+1}));try{let n=await go(()=>L.archive([...e]),Y(`archive.failed`));if(!n)return;let{tone:r,text:i}=ql(n,t),a=n.changed;return Aa(r,i,a.length>0?1e4:6e3,a.length>0?{label:Y(`archive.undo`),run:()=>void Zl(a,{exact:!0})}:void 0),n}finally{Bl.set(e=>({busy:e.busy-1}))}}}function Yl(e){let t=e.changed.length;lo({title:Y(`archive.confirmTitle`,{n:t}),body:Y(`archive.confirmBody`,{n:t,carried:e.carried,kept:e.kept}),confirmLabel:Y(`archive.confirmAction`,{n:t}),onConfirm:async()=>{Vl()?Aa(`info`,Y(`archive.busy`)):await Jl(e.ids,e.blocked)}})}function Xl(e){return Bl.get().busy>0?Promise.resolve(void 0):Zl(e)}async function Zl(e,t={}){if(e.length!==0){Bl.set(e=>({busy:e.busy+1}));try{let n=await go(()=>L.unarchive([...e],t),Y(`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?Y(`archive.unarchivedCarried`,{n:i}):``;Aa(`success`,`${Y(`archive.unarchived`,{n:n.changed.length})}${e}`)}else n.skipped.some(e=>e.reason===`not_found`)?Aa(`warn`,Y(`archive.unarchiveMissing`)):Aa(`info`,Y(`archive.unarchiveNone`));return n}finally{Bl.set(e=>({busy:e.busy-1}))}}}var Ql=new Set;async function $l(e,t){let n=`${e}|${t.scope}|${t.detail}`;if(Ql.has(n))return!1;Ql.add(n);try{let n=await go(()=>L.report(e,{...t,lang:W.get().lang}),Y(`export.failed`));return n?(zl(n.filename,n.text),!0):!1}finally{Ql.delete(n)}}async function eu(e){let t=await L.retention(e);return W.set({retention:t.retention}),t}async function tu(e){let t=await L.setRetention(e);return W.set({retention:t.retention}),t}var nu=`[role="menuitem"]:not([aria-disabled="true"])`,ru=new Set;function iu(){for(let e of[...ru])e(!0)}function au(e){let t=[],n=null;for(let r of e.querySelectorAll(nu)){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 ou(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 su({entries:e,label:t,anchor:n,popupRef:r,container:i,followFrames:a,onClose:o}){let s=(0,l.useRef)(null),c=r??s,d=(0,l.useId)(),f=(0,l.useRef)(o);f.current=o;let p=(0,l.useRef)(n);p.current=n;let m=(0,l.useRef)(a);m.current=a;let h=(0,l.useMemo)(()=>Dc(()=>c.current,()=>f.current(!1)),[c]);(0,l.useEffect)(()=>()=>h.cancel(),[h]),(0,l.useLayoutEffect)(()=>{let e=c.current;if(!e)return;let t=p.current,n=t.kind===`point`,r=t.kind===`button`?t.el:t.context;return wc({reference:t.kind===`button`?t.el:vc(t.x,t.y,t.context),floating:e,placement:n?`bottom-start`:`bottom-end`,gap:n?0:8,flipCrossAxis:n,slide:n,animationFrame:m.current??r?.closest(`.scene-world`)!=null,onPosition:({placement:t,hidden:n})=>{e.style.transformOrigin=Tc(t),e.setAttribute(`data-ready`,``),n&&h.leave()}})},[c,h]),(0,l.useEffect)(()=>{c.current?.querySelector(nu)?.focus();let e=e=>{let t=c.current?.contains(document.activeElement)??!1;f.current(e&&t)};for(let e of[...ru])e(!1);return ru.add(e),()=>{ru.delete(e)}},[]),(0,l.useEffect)(()=>{let e=()=>f.current(!1),t=t=>{if(t.target instanceof Node&&(c.current?.contains(t.target)??!1))return;let n=p.current;n.kind===`button`&&t.target instanceof Node&&n.el.contains(t.target)||e()};document.addEventListener(`pointerdown`,t,!0),window.addEventListener(`blur`,e);let n=Ec(()=>c.current,()=>h.leave(),{wheel:!0});return()=>{document.removeEventListener(`pointerdown`,t,!0),window.removeEventListener(`blur`,e),n()}},[c,h]);let g=e=>{e.disabled||(f.current(!0),e.onSelect())},_=(e,t)=>{(e.key===`Enter`||e.key===` `)&&(e.preventDefault(),g(t))},v=e=>{let t=c.current;if(!t)return;let n=au(t),r=document.activeElement,i=n.findIndex(e=>r!==null&&e.includes(r)),a=i>=0?n[i]?.indexOf(r)??0:0,o=(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(),o(i+1,a);break;case`ArrowUp`:e.preventDefault(),o(i<0?n.length-1:i-1,a);break;case`ArrowLeft`:case`ArrowRight`:{let t=n[i];if(!t||t.length<2)break;e.preventDefault(),t[(a+(e.key===`ArrowRight`?1:-1)+t.length)%t.length]?.focus();break}case`Home`:e.preventDefault(),o(0);break;case`End`:e.preventDefault(),n[n.length-1]?.at(-1)?.focus();break;case`Escape`:e.preventDefault(),e.stopPropagation(),f.current(!0);break;case`Tab`:f.current(!0)}},y=e=>(0,q.jsxs)(`div`,{children:[e.separatorAbove?(0,q.jsx)(`div`,{className:`menu-sep`,role:`separator`}):null,(0,q.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:()=>g(e),onKeyDown:t=>_(t,e),children:[e.icon?(0,q.jsx)(J,{name:e.icon,size:15}):(0,q.jsx)(`span`,{className:`menu-icon-gap`}),(0,q.jsx)(`span`,{children:e.label})]})]},e.id),b=e=>(0,q.jsx)(`div`,{className:`menu-row`,children:e.items.map((e,t)=>{let n=e.disabled&&e.disabledReason?e.disabledReason:e.label;return(0,q.jsxs)(l.Fragment,{children:[t>0&&e.separatorAbove?(0,q.jsx)(`div`,{className:`menu-vsep`,role:`separator`,"aria-orientation":`vertical`}):null,(0,q.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:()=>g(e),onKeyDown:t=>_(t,e),children:e.icon?(0,q.jsx)(J,{name:e.icon,size:15}):(0,q.jsx)(`span`,{children:e.label})})]},e.id)})},e.id),x=e=>`items`in e?b(e):y(e),S=n.kind===`button`?n.el:n.context,C=i??S?.closest(`.overlay`)??document.body;return(0,u.createPortal)((0,q.jsx)(`div`,{ref:c,className:`menu`,role:`menu`,"aria-label":t,onKeyDown:v,onClick:e=>e.stopPropagation(),onContextMenu:e=>e.preventDefault(),children:ou(e).map((e,t)=>{let n=e.heading,r=n?`${d}-${n.id}`:void 0;return(0,q.jsxs)(l.Fragment,{children:[t>0?(0,q.jsx)(`div`,{className:`menu-sep`,role:`separator`}):null,(0,q.jsxs)(`div`,{role:n?`group`:void 0,"aria-labelledby":r,children:[n?(0,q.jsx)(`div`,{className:`menu-label`,id:r,children:n.heading}):null,e.entries.map(x)]})]},n?.id??`plain-${t}`)})}),C)}function cu({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,q.jsxs)(q.Fragment,{children:[(0,q.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,q.jsx)(J,{name:n,size:16})}),o&&c.current?(0,q.jsx)(su,{entries:typeof e==`function`?e():e,label:t,anchor:{kind:`button`,el:c.current},onClose:u}):null]})}function lu(e,t){if(t===null)return;let n=e===`keepDays`?A.retention.maxKeepDays:A.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 uu(e){switch(e.phase){case`done`:case`failed`:case`cancelled`:case`stopped`:case`lost`:case`ready`:return e.messages.pending===0;default:return!1}}function du(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:uu(e),activityMs:Number.isFinite(t)?t:1/0}}function fu(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 pu(e,t){return C(e.node(t)).filter(t=>e.node(t)!==void 0)}function mu(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)||pu(e,i).every(t=>e.node(t)?.archived===!0||n.has(t))&&(n.add(i),t=!0)}return n}function hu(e,t,n){return[t,...T([t],t=>e.childrenOf(t).filter(e=>n.has(e)))]}function gu(e,t){return hu(e,t,mu(e,[t]))}function _u(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=mu(e,n);for(let r of n)hu(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 fu(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:pu(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 vu(e){let t=lt(e),n=new Map(e.map(e=>[e.id,du(e)]));return{tree:{node:e=>n.get(e),childrenOf:e=>t.childrenOf(e).map(e=>e.id),ids:()=>[...t.byId.keys()]},graph:t}}function yu(e){let t=0,n=0;for(let r of e)uu(r)||(r.phase===`starting`||r.phase===`queued`||r.phase===`running`?t+=1:n+=1);if(t>0)return{reason:`working`,n:t};if(n>0)return{reason:`pending`,n}}function bu(e,t){let{tree:n,graph:r}=vu(e);if(!r.byId.has(t))return;let i=gu(n,t).flatMap(e=>{let t=r.byId.get(e);return t?[t]:[]});return{total:i.length,descendants:i.length-1,blocked:yu(i)}}function xu(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 fu(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:yu([...s.values()])}}function Su(e,t){let n=vu(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=gu(r,e).every(e=>{let t=i.byId.get(e);return t!==void 0&&uu(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 xu(e,n,c,_u(r,c).changed,new Set(c))}function Cu(e,t){let n=vu(t),r=e.map(e=>e.id);return xu(e,n,r,_u(n.tree,r).changed,new Set(r))}function wu(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}}function Tu(e){let t=kn(``);return e.startsWith(t)?e.slice(t.length):void 0}function Eu({key:e,sessions:t,collapsed:n,t:r,announce:i,archiveSupported:a=!1}){let o=ht(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:()=>{Xa(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:()=>{Za(),i(r(`origin.doneShowAll`,{n:u.length}))}}),a){let n=Su(aa(t,{kind:`origin`,key:e}),t),i=n.changed.length===0,a=Vl();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?Kl(n.blocked,r):r(`archive.nothing`):r(`archive.busy`),onSelect:()=>Yl(n)})}return l}function Du(e,t){let n=e.model;return n?.label??n?.resolved??n?.requested??t(`model.default`)}function Ou(e,t){if(!e)return;let n=`effort.${e}`,r=t(n);return r===n?e:r}function ku(e,t){let n=`harness.${e}`,r=t(n);return r===n?e:r}function Au(e){return`${location.origin}/#/s/${encodeURIComponent(e)}`}function ju(e){return e.activeRunId!==void 0||e.status===`queued`||e.status===`starting`}function Mu(e){return e.status!==`stopped`}function Nu(e){return!Gt(e.phase)}function Pu(e,t){return Lu(e,t,{includeOpen:!0})}function Fu(e,t){let{count:n,complete:r}=wu(e,e=>ze(W.get(),e)),i=[{id:`export-md`,label:t(`menu.exportMd`),icon:`download`,onSelect:()=>void $l(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 $l(e.id,{scope:`tree`,detail:`brief`})}),i.push({id:`export-md-full`,label:t(`menu.exportMdFull`),icon:`download`,onSelect:()=>void $l(e.id,{scope:`session`,detail:`full`})}),i}function Iu(e,t){let n=Bl.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 Xl([e.id])};let r=bu(Object.values(W.get().sessions),e.id)??bu([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?Kl(i,t):t(`archive.busy`),onSelect:()=>void Jl([e.id])}}function Lu(e,t,n={}){let r=Gt(e.phase),i=ju(e),a=[],o=W.get().archivedCount!==void 0;return n.includeOpen&&a.push({id:`open`,label:t(`menu.open`),icon:`eye`,onSelect:()=>Ia({kind:`session`,id:e.id})}),a.push({id:`copy-link`,label:t(`menu.copyLink`),icon:`link`,onSelect:()=>{nl(Au(e.id)).then(e=>Aa(e?`success`:`warn`,t(e?`common.copied`:`common.copyFailed`),1800))}},{id:`copy-id`,label:t(`menu.copyId`),icon:`copy`,onSelect:()=>{nl(e.id).then(e=>Aa(e?`success`:`warn`,t(e?`common.copied`:`common.copyFailed`),1800))}}),o&&a.push(...Fu(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 fo(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:!Mu(e),disabledReason:t(`menu.stopDisabled`),onSelect:()=>lo({title:t(`confirm.stopTitle`),body:t(r?`confirm.stopBodyActive`:`confirm.stopBody`),confirmLabel:t(`menu.stopSession`),onConfirm:()=>po(e.id,{ok:t(`toast.stopOk`),failed:t(`toast.stopFailed`)})})}),o&&a.push(Iu(e,t)),a.push({id:`remove`,label:t(`menu.remove`),icon:`trash`,danger:!0,disabled:!Nu(e),disabledReason:t(`menu.removeDisabled`),onSelect:()=>lo({title:t(`confirm.removeTitle`),body:t(`confirm.removeBody`,{title:e.title}),confirmLabel:t(`menu.remove`),tone:`danger`,onConfirm:async()=>{await mo(e.id,{ok:t(`toast.removeOk`),failed:t(`toast.removeFailed`)})&&n.afterRemove?.()}})}),a}var Ru=e=>`session:${e}`,zu=`session:`,Bu=e=>e.startsWith(zu)?e.slice(8):void 0;function Vu(e,t){return[...e?.querySelectorAll(`.rail-entry`)??[]].find(e=>e.dataset.railOrigin===t)}function Hu(e,t){return[...e?.querySelectorAll(`[data-rail-row]`)??[]].find(e=>e.dataset.railRow===t)}function Uu(e){return e?.querySelector(`.rail-sibling[aria-current="page"]`)??Hu(e,`entry`)}function Wu(e){let t=[];for(let n of e?.querySelectorAll(`.rail-entry [data-rail-row]`)??[]){let e=n.closest(`.rail-entry`)?.dataset.railOrigin;e!==void 0&&t.push({scope:e,row:n.dataset.railRow})}return t}function Gu(e,t){let n=t.rows.findIndex(e=>e.scope===t.scope&&e.row===t.row),r=n<0?[]:t.rows.slice(n+1),i=n<0?[]:t.rows.slice(0,n).reverse(),a=e=>e.scope===t.scope,o=[...r.filter(a),...i.filter(a),...r.filter(e=>!a(e)),...i.filter(e=>!a(e))];for(let t of o){let n=Hu(Vu(e,t.scope),t.row);if(n)return n}return e?.querySelector(`.rail-item`)??void 0}function Ku(){let e=document.activeElement;return!e||e===document.body||!e.isConnected||e.closest(`.overlay[data-closing]`)!==null}function qu({workspaces:e,sessions:t,sessionsById:n,focusedScope:r,focusedSessionId:i,focusedLimit:a,expanded:o,setExpanded:s}){let c=G(),u=(0,l.useRef)(null),d=(0,l.useRef)(null),[f,p]=(0,l.useState)(void 0),[m,h]=(0,l.useState)(``),g=B(W,e=>e.collapsedOrigins),_=B(W,e=>e.archivedCount!==void 0),v=B(W,e=>e.confirm!==void 0);B(Bl,e=>e.busy>0);let y=(0,l.useRef)(0),b=(0,l.useRef)(void 0);b.current=f;let x=(0,l.useRef)(!1),S=(0,l.useRef)(void 0),C=(0,l.useRef)(void 0),w=(0,l.useRef)(void 0),T=(0,l.useRef)({scope:r,sessionId:i}),E=t=>e.get(t)?.total??0,D=e=>e===r?a:0,O=e=>E(e)>D(e),k=(e,r)=>{if(r===`more`)return{entries:[],label:c(`rail.menu`)};if(r===`entry`)return{entries:Eu({key:e,sessions:t,collapsed:g,t:c,announce:h,archiveSupported:_})??[],label:c(`origin.menu`)};let a=Bu(r),o=a===void 0?void 0:n.get(a);return o?{entries:o.id===i?Lu(o,c,{afterRemove:()=>Ia({kind:`overview`})}):Pu(o,c),label:c(`node.menu`)}:{entries:[],label:c(`node.menu`)}},A=(e,t)=>{if(b.current?.seq===e.seq&&(b.current=void 0,p(void 0),t)){let t=Vu(u.current,e.scope);(Hu(t,e.row)??Uu(t))?.focus({preventScroll:!0})}},j=f?k(f.scope,f.row):void 0,ee=f!==void 0&&O(f.scope),te=f!==void 0&&(ee!==f.toggle||(j?.entries.length??0)>0!==f.subject);(0,l.useLayoutEffect)(()=>{let e=T.current;if(T.current={scope:r,sessionId:i},!f)return;let t=f.scope===e.scope&&f.scope!==r&&!o.has(f.scope),n=Hu(Vu(u.current,f.scope),f.row);if(te||t||!n){let t=e.scope===r&&e.sessionId===i&&(d.current?.contains(document.activeElement)??!1);A(f,t)}}),(0,l.useLayoutEffect)(()=>{let e=S.current;if(S.current=void 0,!e)return;let t=Vu(u.current,e.scope),n=Uu(t);n?.scrollIntoView?.({block:`nearest`});let r=document.activeElement;r?.isConnected&&r!==document.body||(Hu(t,e.row)??n)?.focus({preventScroll:!0})},[o]),(0,l.useEffect)(()=>{let e=C.current;if(!e)return;let t=Vu(u.current,e.scope),n=e.el?.isConnected?e.el:Hu(t,e.row);if(n&&(e.el=n,e.rows=Wu(u.current)),v)return;let r=document.activeElement;Ku()?(C.current=void 0,(n??Gu(u.current,e))?.focus({preventScroll:!0})):r!==e.el&&(C.current=void 0)}),(0,l.useEffect)(()=>{let e=e=>{let t=C.current;if(!t)return;let n=e.target;n instanceof Element&&(n===t.el||n.closest(`[role="dialog"], [role="menu"], .overlay`))||(C.current=void 0)};return document.addEventListener(`pointerdown`,e,!0),document.addEventListener(`focusin`,e,!0),()=>{document.removeEventListener(`pointerdown`,e,!0),document.removeEventListener(`focusin`,e,!0)}},[]);let ne=(e,t,n)=>{let r=x.current||e.button===0&&e.clientX===0&&e.clientY===0;if(x.current=!1,e.defaultPrevented)return;let i=O(t),a=k(t,n).entries.length>0;if(!i&&!a)return;let o=e.currentTarget,s=o.getBoundingClientRect();e.preventDefault(),y.current+=1,C.current=void 0,h(``),p({seq:y.current,scope:t,row:n,toggle:i,subject:a,at:r?{x:s.left+14,y:s.top+14}:{x:e.clientX,y:e.clientY},el:o})},re=(e,t,n,r)=>{S.current=e,s(n=>{let r=new Set(n);return t?r.add(e.scope):r.delete(e.scope),r}),h(t?c(`rail.doneExpand`,{n}):c(`rail.doneCollapse`,{n:r}))},M=(e,t)=>`onSelect`in t?{...t,onSelect:()=>{let n=document.activeElement instanceof HTMLElement&&u.current?.contains(document.activeElement)?document.activeElement:void 0;C.current={scope:e.scope,row:e.row,el:n,rows:Wu(u.current)},t.onSelect()}}:t,N;if(f&&j&&!te){let e=j.entries.map(e=>M(f,e));if(ee){let t=!o.has(f.scope),n=E(f.scope),r=D(f.scope);e.push({id:`rail-list-toggle`,label:t?c(r>0?`rail.menuExpand`:`rail.menuExpandAll`,{n:n-r}):c(`rail.menuCollapse`,{n:r}),icon:t?`chevronDown`:`chevronUp`,separatorAbove:e.length>0||void 0,onSelect:()=>re(f,t,n,r)})}N={entries:e,label:j.label},w.current={seq:f.seq,...N}}else f&&w.current?.seq===f.seq&&(N=w.current);let ie=null;return f&&N&&(ie=(0,q.jsx)(su,{popupRef:d,entries:N.entries,label:N.label,anchor:{kind:`point`,x:f.at.x,y:f.at.y,context:f.el},onClose:e=>A(f,e)},f.seq)),{rail:u,rowHandlers:(e,t)=>({onContextMenu:n=>ne(n,e,t),onKeyDown:e=>{x.current=e.key===`ContextMenu`||e.key===`F10`&&e.shiftKey},onPointerDown:()=>{x.current=!1},"aria-haspopup":`menu`,"data-rail-row":t,"data-menu-open":!te&&f?.scope===e&&f.row===t?``:void 0}),overlay:(0,q.jsxs)(q.Fragment,{children:[ie,(0,q.jsx)(`span`,{className:`sr-only`,"aria-live":`polite`,children:m})]})}}var Ju=5,Yu=6,X=16,Xu=`.canvas-scale, .arrange`;function Z(e,t){(0,l.useLayoutEffect)(()=>{let n=e.current,r=n?.closest(`.app`);if(!t||!n||!r)return;let i=()=>{let e=Number.parseFloat(n.style.getPropertyValue(`--status-lift`))||0,t=n.getBoundingClientRect(),i=r.getBoundingClientRect();if(t.width===0||t.height===0||i.height===0)return;let a=i.bottom-(t.bottom+e),o=[...r.querySelectorAll(Xu)].map(e=>e.getBoundingClientRect()).filter(e=>e.width>0&&e.height>0&&t.left<e.right+X&&t.right+X>e.left),s=a;for(let e=0;e<=o.length;e++){let e=o.find(e=>s<i.bottom-e.top+X&&s+t.height+X>i.bottom-e.bottom);if(!e)break;s=i.bottom-e.top+X}let c=s-a;Math.abs(c-e)<.5||(c>.5?n.style.setProperty(`--status-lift`,`${c}px`):n.style.removeProperty(`--status-lift`))},a=[],o=new ResizeObserver(()=>s()),s=()=>{let e=[n,r,...r.querySelectorAll(Xu)];if(e.length!==a.length||e.some((e,t)=>e!==a[t])){o.disconnect();for(let t of e)o.observe(t);a=e}i()},c=0,l=new MutationObserver(()=>{c===0&&(c=requestAnimationFrame(()=>{c=0,s()}))});return l.observe(r,{childList:!0,subtree:!0}),window.addEventListener(`resize`,s),s(),()=>{window.removeEventListener(`resize`,s),l.disconnect(),o.disconnect(),c!==0&&cancelAnimationFrame(c)}},[e,t])}function Q({variant:e=`floating`}){let t=G(),n=B(W,e=>e.conn),r=(0,l.useRef)(null);return Z(r,e===`floating`&&n!==`live`),n===`live`?null:(0,q.jsx)(`div`,{ref:r,className:`status-notices`,"data-place":e,"aria-live":`polite`,"data-modal-inert":e===`floating`?``:void 0,children:(0,q.jsxs)(`span`,{className:`status-note`,"data-conn":n,children:[(0,q.jsx)(`i`,{"aria-hidden":`true`}),t(`conn.${n}`)]})})}function Zu(e,t,n){let[r,i]=(0,l.useState)({scope:n,memory:void 0}),a=ll(e,t,r.scope===n?r.memory:void 0,Yu);return r.scope===n&&ul(r.memory,a.memory)||i({scope:n,memory:a.memory}),a}function Qu(e,t){let n=[];for(let r of e.sessionIds){let e=t.get(r);e&&n.push(e)}return cl(n).map(({session:e})=>e)}function $u({workspaces:e,sessions:t,currentScope:n,focusedSessionId:r,focusedOriginKey:i,branches:a,expanded:o,setExpanded:s}){let c=G(),u=bo(),[d,f]=(0,l.useState)(!1),p=Co()===`⌘`?`⌘B`:`Ctrl+B`,m=(0,l.useMemo)(()=>e.filter(U),[e]),h=(0,l.useMemo)(()=>e.filter(e=>!U(e)),[e]),g=h.slice(0,Ju),_=h.slice(Ju),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=(0,l.useMemo)(()=>new Map(e.map(e=>[e.key,e])),[e]),w=(0,l.useMemo)(()=>new Map(t.map(e=>[e.id,e])),[t]),T=r?i:void 0,E=qu({workspaces:C,sessions:t,sessionsById:w,focusedScope:T,focusedSessionId:r,focusedLimit:Yu,expanded:o,setExpanded:s}),D=Rl(),O=(0,l.useMemo)(()=>{let e=new Map;for(let t of o){let n=C.get(t);n&&e.set(t,Qu(n,w))}return e},[o,C,w]),k=T===void 0?void 0:C.get(T),A=T===void 0?void 0:O.get(T),j=Zu((0,l.useMemo)(()=>A??(k?Qu(k,w):[]),[A,k,w]),r,T),ee=!r,te=e=>{let t=sa(e,c),i=ee&&n.kind===`origin`&&n.key===e.key,o=T===e.key,s=a?.get(e.key),l=ca(e,u,s),d=O.get(e.key),f=d??(o?j.rows:[]),p=o&&!d?j.hidden:0;return(0,q.jsxs)(`div`,{className:`rail-entry`,"data-rail-origin":e.key,"data-focused-parent":o?``:void 0,children:[(0,q.jsxs)(`button`,{type:`button`,className:`rail-item`,"aria-current":i?`page`:void 0,"data-active":i||o?``:void 0,"data-live":e.running>0?``:void 0,onClick:()=>La({kind:`origin`,key:e.key}),...E.rowHandlers(e.key,`entry`),children:[(0,q.jsx)(`span`,{className:`rail-item-ico`,children:(0,q.jsx)(Sl,{host:e.origin.host,label:e.origin.hostLabel,size:12.5,fit:!0})}),(0,q.jsxs)(`span`,{className:`rail-item-body`,children:[(0,q.jsxs)(`span`,{className:`rail-item-top`,children:[(0,q.jsx)(`span`,{className:`rail-item-title`,children:t}),(0,q.jsxs)(`span`,{className:`rail-item-badges`,children:[e.attention>0?(0,q.jsx)(`span`,{className:`rail-att`,role:`img`,"aria-label":c(`attention.title`),children:(0,q.jsx)(J,{name:`alert`,size:10.5})}):null,e.running>0?(0,q.jsxs)(`span`,{className:`rail-live num`,children:[(0,q.jsx)(`i`,{className:`a-run`,"aria-hidden":`true`}),e.running]}):(0,q.jsx)(`span`,{className:`rail-count num`,children:e.total})]})]}),l?(0,q.jsx)(`span`,{className:`rail-item-sub`,children:l}):null]})]}),f.length>0?(0,q.jsxs)(`div`,{className:`rail-siblings`,role:`group`,"aria-label":c(`rail.siblings`),children:[f.map(t=>{let n=o&&t.id===r;return(0,q.jsxs)(`button`,{type:`button`,className:`rail-sibling`,"aria-current":n?`page`:void 0,"data-active":n?``:void 0,"data-phase":t.phase,onClick:()=>Ia({kind:`session`,id:t.id}),...E.rowHandlers(e.key,Ru(t.id)),children:[(0,q.jsx)(`i`,{className:`rail-sibling-dot`,"data-phase":t.phase,"aria-hidden":`true`}),(0,q.jsx)(`span`,{className:`rail-sibling-title`,children:t.title})]},t.id)}),p>0?(0,q.jsx)(`button`,{type:`button`,className:`rail-sibling rail-sibling--more`,"aria-description":c(`rail.moreTip`),onClick:()=>La({kind:`origin`,key:e.key}),...E.rowHandlers(e.key,`more`),children:c(`rail.moreSessions`,{n:p})}):null]}):null]},e.key)};return(0,q.jsxs)(`aside`,{ref:E.rail,className:`rail-panel`,"aria-label":c(`rail.label`),"data-modal-inert":!0,children:[(0,q.jsxs)(`div`,{className:`rail-brand`,children:[(0,q.jsx)(`button`,{type:`button`,className:`rail-logo`,onClick:()=>La(e[0]?{kind:`origin`,key:e[0].key}:{kind:`all`}),children:`Ensemble`}),(0,q.jsx)(`button`,{type:`button`,className:`rail-ico-btn`,"aria-label":c(`rail.collapse`,{keys:p}),onClick:()=>eo(!0),children:(0,q.jsx)(J,{name:`sidebar`,size:14})})]}),(0,q.jsxs)(`nav`,{ref:D.nav,className:`rail-nav`,children:[(0,q.jsx)(`div`,{className:`rail-glide-host`,"aria-hidden":`true`,children:(0,q.jsx)(`span`,{ref:D.trail,className:`rail-glide`})}),(0,q.jsxs)(`div`,{className:`rail-views`,children:[(0,q.jsxs)(`button`,{type:`button`,className:`rail-item rail-item--view`,"data-rail-view":`active`,"aria-current":ee&&Qi(n,{kind:`active`})?`page`:void 0,"data-active":ee&&Qi(n,{kind:`active`})?``:void 0,onClick:()=>La({kind:`active`}),children:[(0,q.jsx)(`span`,{className:`rail-item-ico`,children:(0,q.jsx)(J,{name:`zap`,size:12.5})}),(0,q.jsx)(`span`,{className:`rail-item-body`,children:(0,q.jsxs)(`span`,{className:`rail-item-top`,children:[(0,q.jsx)(`span`,{className:`rail-item-title`,children:c(`rail.active`)}),(0,q.jsx)(`span`,{className:`rail-item-badges`,children:S>0?(0,q.jsxs)(`span`,{className:`rail-live num`,children:[(0,q.jsx)(`i`,{className:`a-run`,"aria-hidden":`true`}),x]}):(0,q.jsx)(`span`,{className:`rail-count num`,children:x})})]})})]}),(0,q.jsxs)(`button`,{type:`button`,className:`rail-item rail-item--view`,"data-rail-view":`all`,"aria-current":ee&&Qi(n,{kind:`all`})?`page`:void 0,"data-active":ee&&Qi(n,{kind:`all`})?``:void 0,onClick:()=>La({kind:`all`}),children:[(0,q.jsx)(`span`,{className:`rail-item-ico`,children:(0,q.jsx)(J,{name:`layers`,size:12.5})}),(0,q.jsx)(`span`,{className:`rail-item-body`,children:(0,q.jsxs)(`span`,{className:`rail-item-top`,children:[(0,q.jsx)(`span`,{className:`rail-item-title`,children:c(`rail.all`)}),(0,q.jsx)(`span`,{className:`rail-item-badges`,children:(0,q.jsx)(`span`,{className:`rail-count num`,children:t.length})})]})})]})]}),(0,q.jsxs)(`div`,{ref:D.scroll,className:`rail-scroll`,children:[(0,q.jsxs)(`div`,{className:`rail-glide-host`,"aria-hidden":`true`,children:[(0,q.jsx)(`span`,{ref:D.item,className:`rail-glide`}),(0,q.jsx)(`span`,{ref:D.sibling,className:`rail-glide`,"data-kind":`sibling`})]}),e.length===0?(0,q.jsx)(`div`,{className:`rail-empty`,children:c(`rail.empty`)}):(0,q.jsxs)(q.Fragment,{children:[m.length>0?(0,q.jsxs)(`div`,{className:`rail-section`,children:[(0,q.jsx)(`div`,{className:`rail-section-label`,children:c(`rail.sectionActive`)}),m.map(te)]}):null,g.length>0?(0,q.jsxs)(`div`,{className:`rail-section`,children:[(0,q.jsx)(`div`,{className:`rail-section-label`,children:c(`rail.sectionRecent`)}),g.map(te)]}):null,_.length>0?(0,q.jsxs)(`div`,{className:`rail-section`,children:[(0,q.jsxs)(`button`,{type:`button`,className:`rail-section-toggle`,"aria-expanded":b,onClick:()=>f(e=>!e),children:[(0,q.jsx)(J,{name:b?`chevronDown`:`chevronRight`,size:11,strokeWidth:2.2}),(0,q.jsx)(`span`,{children:c(`rail.sectionEarlier`,{n:_.length})})]}),b?_.map(te):null]}):null]})]})]}),(0,q.jsxs)(`footer`,{className:`rail-foot`,children:[(0,q.jsx)(Q,{variant:`inline`}),(0,q.jsx)(`div`,{className:`rail-foot-actions`,children:(0,q.jsx)(`button`,{type:`button`,className:`rail-settings`,"aria-label":c(`topbar.settings`),onClick:()=>ao(),children:(0,q.jsx)(J,{name:`settings`,size:15})})})]}),E.overlay]})}function ed(){let e=G()(`rail.expand`,{keys:Co()===`⌘`?`⌘B`:`Ctrl+B`});return(0,q.jsx)(`button`,{type:`button`,className:`rail-ico-btn rail-expand`,"aria-label":e,"data-modal-inert":!0,onClick:()=>eo(!1),children:(0,q.jsx)(J,{name:`sidebar`,size:14})})}function td({currentScope:e,currentWorkspace:t}){let n=G(),r=Co()===`⌘`?`⌘K`:`Ctrl K`,i=e.kind===`origin`&&t?sa(t,n):e.kind===`active`?n(`rail.active`):n(`rail.all`);return(0,q.jsxs)(`header`,{className:`ws-topbar`,"data-modal-inert":!0,children:[(0,q.jsxs)(`div`,{className:`ws-topbar-left`,children:[(0,q.jsx)(`span`,{className:`ws-topbar-brand`,children:`Ensemble`}),(0,q.jsxs)(`button`,{type:`button`,className:`ws-topbar-switch`,"aria-label":n(`rail.switchTip`,{keys:r}),"data-tip":n(`rail.switchTip`,{keys:r}),onClick:()=>to(),children:[e.kind===`origin`&&t?(0,q.jsx)(Sl,{host:t.origin.host,label:t.origin.hostLabel,size:12.5,fit:!0}):(0,q.jsx)(J,{name:e.kind===`active`?`zap`:`layers`,size:12.5}),(0,q.jsx)(`span`,{className:`ws-topbar-name`,children:i}),(0,q.jsx)(J,{name:`chevronDown`,size:12,className:`ws-topbar-chev`})]})]}),(0,q.jsx)(`div`,{className:`ws-topbar-right`,children:(0,q.jsx)(`button`,{type:`button`,className:`rail-ico-btn`,"aria-label":n(`topbar.settings`),"data-tip":n(`topbar.settings`),onClick:()=>ao(),children:(0,q.jsx)(J,{name:`settings`,size:15})})})]})}function nd({canvas:e,tools:t=!1,notices:n=!0}){return t?(0,q.jsxs)(q.Fragment,{children:[e?(0,q.jsx)(`div`,{className:`arrange-wrap`,"data-modal-inert":!0,children:(0,q.jsx)(ol,{engine:e.engine})}):null,n?(0,q.jsx)(Q,{variant:`floating`}):null]}):n?(0,q.jsx)(Q,{variant:`floating`}):null}var rd=new Set,id,ad=3e3;function od(e){id={id:e,at:Date.now()};for(let t of[...rd])t(e)}function sd(e){return rd.add(e),()=>{rd.delete(e)}}function cd(){let e=id;if(id=void 0,!(!e||Date.now()-e.at>ad))return e.id}var ld=new Set;function ud(){for(let e of[...ld])e()}function dd(e){return ld.add(e),()=>{ld.delete(e)}}function fd(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 pd(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 md(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 hd({scrollTop:e,clientHeight:t,scrollHeight:n},r){return n-e-t<r}function gd(e,t){return{over:e>t,near:e>=Math.floor(t*.9)}}function _d(e,t){return e.trim().length===0?t:e.includes(t)?e:`${t}\n\n${e}`}var vd=new Map;function yd({summary:e}){let t=G(),{id:n}=e,[r,i]=(0,l.useState)(()=>vd.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(vd.get(n)??``),d(void 0),b(void 0)},[n]),(0,l.useEffect)(()=>{r?vd.set(n,r):vd.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=gd(r.length,A.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(``),vd.delete(e),f.current?.focus(),ud();try{yo((await L.send(e,{text:C,mode:x})).summary)}catch(n){let r=`${t(`composer.sendFailed`)}${W.get().lang===`zh`?`:`:`: `}${Na(n)}`;m.current===e?(i(e=>_d(e,a)),d(r)):vd.set(e,_d(vd.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`],k=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())},j=ku(e.harness,t),ee=t(x===`steer`?`composer.placeholder.steer`:x===`follow_up`?`composer.placeholder.followUp`:`composer.placeholder.idle`,{name:j}),te=x===`steer`?e.capabilities.steer.mode:x===`follow_up`?`after_run`:void 0,ne=te?`capMode.${te}`:void 0,re=ne&&te?t(ne)===ne?te:t(ne):void 0,M=A.maxMessageChars.toLocaleString(),N=u??(w.over?t(`composer.tooLong`,{max:M}):void 0);return _?(0,q.jsx)(`div`,{className:`composer`,"data-closed":``,children:(0,q.jsxs)(`div`,{className:`composer-closed`,children:[(0,q.jsx)(J,{name:`lock`,size:14}),(0,q.jsx)(`span`,{children:t(`composer.placeholder.closed`)})]})}):(0,q.jsx)(`div`,{className:`composer`,"data-busy":a?``:void 0,children:(0,q.jsxs)(`div`,{className:`composer-box`,"data-over":w.over?``:void 0,"data-error":u?``:void 0,children:[(0,q.jsx)(`textarea`,{ref:f,value:r,rows:1,placeholder:ee,"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}),N||w.near?(0,q.jsxs)(`div`,{className:`composer-notice`,children:[N?(0,q.jsxs)(`span`,{className:`composer-error`,role:`alert`,children:[(0,q.jsx)(J,{name:`alert`,size:12,strokeWidth:2}),(0,q.jsx)(`span`,{children:N})]}):(0,q.jsx)(`span`,{}),w.near?(0,q.jsxs)(`span`,{className:`composer-count num`,"data-over":w.over?``:void 0,"aria-hidden":`true`,children:[r.length.toLocaleString(),` / `,M]}):null]}):null,(0,q.jsxs)(`div`,{className:`composer-bar`,children:[(0,q.jsx)(`div`,{className:`composer-mode`,children:h&&v?(0,q.jsx)(`div`,{className:`composer-modes`,role:`radiogroup`,"aria-label":t(`composer.mode`),onKeyDown:k,children:O.map(e=>(0,q.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,q.jsxs)(`span`,{className:`composer-mode-label`,"data-tip":t(`composer.noSteer`),children:[(0,q.jsx)(J,{name:`clock`,size:12}),t(`composer.mode.followUp`)]}):(0,q.jsxs)(`span`,{className:`composer-mode-label`,children:[(0,q.jsx)(J,{name:`send`,size:12}),t(`composer.mode.idle`)]})}),re?(0,q.jsx)(`div`,{className:`composer-meta`,children:(0,q.jsxs)(`span`,{className:`cap-note`,"data-kind":`delivery`,children:[(0,q.jsx)(J,{name:`clock`,size:12}),re]})}):null,(0,q.jsxs)(`div`,{className:`composer-actions`,children:[g?(0,q.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),fo(n,{ok:t(`toast.cancelOk`),nothing:t(`toast.cancelNothing`),failed:t(`toast.cancelFailed`)}).finally(()=>c(!1))},children:[s?(0,q.jsx)(el,{size:16}):(0,q.jsx)(J,{name:`stop`,size:13}),(0,q.jsx)(`span`,{className:`composer-stop-label`,children:t(`composer.cancel`)})]}):null,(0,q.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:M}):`${t(`composer.send`)} · Enter`,onClick:()=>void E(),children:a?(0,q.jsx)(el,{size:20}):(0,q.jsx)(J,{name:`arrowUp`,size:18,strokeWidth:2})})]})]})]})})}A.attention;function bd(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 xd(e){return e!==void 0&&Number.isFinite(e)&&e>0?e:void 0}function Sd(e){let t=xd(e.addedLines),n=xd(e.removedLines);return t===void 0&&n===void 0?void 0:{added:t,removed:n}}function Cd(e,t){return e===void 0&&t===void 0?void 0:(e??0)+(t??0)}function wd(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 Td(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 Ed(e){if(e<.001)return`<0.1%`;let t=e*100;return t<10?`${t.toFixed(1)}%`:`${Math.round(t)}%`}function Dd(e){let t=B(W,e=>e.sessions),n=B(W,e=>e.archived),r=B(W,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&&Ul().catch(()=>void 0)},[c]),{parent:s.parent,parents:s.parents,missingParents:s.missingParents,children:s.children}}var Od=.25;function kd(e,t,n,r){if(!(t>0)||e.length===0||n(e.join(``))<=t+.01)return;let i=t-Od;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 Ad({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,q.jsxs)(`section`,{className:`section${a?` ${a}`:``}`,"data-open":o?``:void 0,children:[(0,q.jsxs)(`div`,{className:`section-head`,children:[(0,q.jsxs)(`button`,{type:`button`,className:`section-toggle`,"aria-expanded":o,"aria-controls":c,onClick:()=>s(e=>!e),children:[(0,q.jsx)(J,{name:`chevronRight`,size:13,className:`section-chevron`,strokeWidth:2}),(0,q.jsx)(`span`,{className:`section-title`,children:e}),t===void 0?null:(0,q.jsx)(`span`,{className:`section-count num`,children:t})]}),r?(0,q.jsx)(`span`,{className:`section-action`,children:r}):null]}),o?(0,q.jsx)(`div`,{className:`section-body`,id:c,children:i}):null]})}var jd,Md=[`fontFamily`,`fontSize`,`fontWeight`,`fontStyle`,`fontStretch`,`fontFeatureSettings`,`fontVariationSettings`,`fontVariantNumeric`,`fontKerning`,`fontOpticalSizing`,`letterSpacing`,`wordSpacing`];function Nd(e){jd&&jd.isConnected||(jd=document.createElement(`span`),jd.setAttribute(`aria-hidden`,`true`),jd.style.cssText=`position:fixed;left:-99999px;top:0;visibility:hidden;pointer-events:none;white-space:pre;`,document.body.append(jd));let t=jd;for(let n of Md){let r=e[n];r&&(t.style[n]=r)}return e=>(t.textContent=e,t.getBoundingClientRect().width)}function Pd(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)?kd(a,s,Nd(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 Fd({value:e,className:t}){let{ref:n,chars:r,cut:i}=Pd(e,{kind:`start`}),a=i!==void 0;return(0,q.jsxs)(`span`,{ref:n,className:`path-text${t?` ${t}`:``}`,"data-clipped":a?``:void 0,"data-tip":e,children:[a?(0,q.jsx)(`span`,{className:`fit-hidden`,children:r.slice(0,i).join(``)}):null,(0,q.jsx)(`span`,{className:`path-shown`,children:a?r.slice(i).join(``):e})]})}function Id({value:e,className:t,tail:n=6,tip:r}){let{ref:i,chars:a,cut:o}=Pd(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,q.jsxs)(`span`,{ref:i,className:`mid-text${t?` ${t}`:``}`,"data-clipped":c?``:void 0,"data-tip":r??e,children:[(0,q.jsx)(`span`,{className:`mid-head`,children:a.slice(0,l).join(``)}),c&&l<s?(0,q.jsx)(`span`,{className:`fit-hidden`,children:a.slice(l,s).join(``)}):null,(0,q.jsx)(`span`,{className:`mid-tail`,children:a.slice(s).join(``)})]})}function Ld({label:e,children:t,tip:n}){return(0,q.jsxs)(`div`,{className:`kv`,children:[(0,q.jsx)(`dt`,{"data-tip":n,children:e}),(0,q.jsx)(`dd`,{children:t})]})}function Rd({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,q.jsxs)(`div`,{className:`clamp`,"data-open":a?``:void 0,children:[(0,q.jsx)(`div`,{className:`clamp-body`,ref:u,style:a?void 0:{WebkitLineClamp:t},children:e}),s||a?(0,q.jsx)(`button`,{type:`button`,className:`link-btn`,onClick:()=>o(e=>!e),children:a?r:n}):null]})}var zd=`### Session `;function Bd(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=`${zd}${t.sessionId}`;if(!r.startsWith(i))return;let a=r.charAt(i.length);return a===`:`||a===`
|
|
22
|
+
`?r:void 0}function Vd(e){let t=B(W,e=>e.sessions),n=B(W,e=>e.archived),r=B(W,e=>e.ready),i=B(W,e=>(e.archivedCount??0)>0&&!e.archivedLoaded),a=t[e]??n[e],o=a===void 0&&i;return(0,l.useEffect)(()=>{o&&Ul().catch(()=>void 0)},[o]),{summary:a,state:a?`found`:!r||i?`checking`:`gone`}}function Hd({preview:e,label:t,maxHeight:n=220}){let r=G(),i=e.format===`diff`,a=(0,l.useMemo)(()=>i?e.text.split(`
|
|
23
|
+
`):void 0,[i,e.text]);return(0,q.jsxs)(`div`,{className:`preview`,children:[t||e.text?(0,q.jsxs)(`div`,{className:`preview-head`,children:[(0,q.jsx)(`span`,{children:t}),(0,q.jsx)(tl,{value:e.text,label:r(`preview.copy`),size:12})]}):null,(0,q.jsx)(`pre`,{style:{maxHeight:n},"data-scroll":!0,children:(0,q.jsx)(`code`,{children:a?a.map((e,t)=>(0,q.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,q.jsx)(`div`,{className:`preview-note`,children:e.chars===void 0?r(`preview.truncated`):r(`preview.truncatedChars`,{n:e.chars.toLocaleString()})}):null]})}var Ud={no_runs:`handoff.noRuns`,no_text:`handoff.noText`,no_final:`handoff.noFinal`},Wd=new Set([`queued`,`starting`,`running`]);function Gd(e,t){let n=e.result;if(!n)return;if(!n.found)return{main:t(`handoff.noResult`),notes:[t(Ud[n.reason])]};let r=[t(`handoff.fromRun`,{run:n.runIndex,runs:e.runCount})];return n.inProgress&&r.push(t(`handoff.partial`)),n.latest&&r.push(t(Wd.has(n.latest.status)?`handoff.laterNoneYet`:`handoff.laterNone`,{run:n.latest.runIndex})),n.earlierFinal&&r.push(t(`handoff.earlierFinal`,{run:n.earlierFinal.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 Kd(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 qd(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 Jd({label:e,fact:t}){return(0,q.jsxs)(Ld,{label:e,children:[(0,q.jsx)(`span`,{children:t.main}),t.notes.map(e=>(0,q.jsx)(`span`,{className:`kv-sub`,children:e},e))]})}function Yd({item:e,prompt:t}){let n=G(),r=bo(),{summary:i,state:a}=Vd(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:Gd(u,n)},{key:`files`,label:n(`handoff.files`),fact:Kd(u,n)},{key:`error`,label:n(`handoff.error`),fact:qd(u,n)}].flatMap(e=>e.fact?[{key:e.key,label:e.label,fact:e.fact}]:[]):[],m=o&&u?Bd(t,e):void 0;return(0,q.jsxs)(`li`,{className:`ctx cref`,"data-state":a,children:[(0,q.jsxs)(`div`,{className:`cref-head`,children:[d?(0,q.jsx)(_l,{harness:d,size:16,variant:`bare`}):null,(0,q.jsxs)(`div`,{className:`cref-main`,children:[a===`gone`?(0,q.jsx)(`span`,{className:`cref-title`,children:f}):(0,q.jsx)(`a`,{className:`cref-title`,href:ma({kind:`session`,id:e.sessionId}),"aria-label":n(`handoff.open`,{title:f}),"data-tip":e.sessionId,children:f}),u?(0,q.jsxs)(`div`,{className:`cref-sub`,children:[(0,q.jsx)(`span`,{children:ku(u.harness,n)}),u.model?(0,q.jsx)(`span`,{children:u.model}):null,(0,q.jsxs)(`span`,{className:`cref-phase`,children:[(0,q.jsx)(Zc,{phase:u.phase,size:7}),n(`handoff.phaseAt`,{phase:Vt(u.phase,n)})]}),(0,q.jsx)(`span`,{className:`num`,children:n(`handoff.readAt`,{time:jt(u.at,r)})})]}):null]})]}),a===`gone`?(0,q.jsx)(`p`,{className:`cref-gone`,children:n(`handoff.gone`)}):null,u?null:(0,q.jsx)(`p`,{className:`muted`,children:n(`handoff.noSample`)}),p.length>0||e.note?(0,q.jsxs)(`dl`,{className:`kvs kvs--tight`,children:[p.map(e=>(0,q.jsx)(Jd,{label:e.label,fact:e.fact},e.key)),e.note?(0,q.jsx)(Ld,{label:n(`handoff.note`),children:(0,q.jsx)(`span`,{className:`cref-note`,children:e.note})}):null]}):null,u?(0,q.jsxs)(q.Fragment,{children:[(0,q.jsxs)(`button`,{type:`button`,className:`cref-toggle`,"aria-expanded":o,"aria-controls":c,onClick:()=>s(e=>!e),children:[(0,q.jsx)(J,{name:o?`chevronDown`:`chevronRight`,size:12,strokeWidth:2}),(0,q.jsx)(`span`,{children:n(`handoff.text`)})]}),(0,q.jsx)(`div`,{id:c,hidden:!o,children:o?m===void 0?(0,q.jsx)(`p`,{className:`muted`,children:n(`handoff.textMissing`)}):(0,q.jsx)(Hd,{preview:{text:m,truncated:!1},maxHeight:240}):null})]}):null]})}var Xd=[`recorded`,`handed_off`,`applied`];function Zd(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 Qd(e,t){let n=ge(e),r=e.reason?`(${t(`queue.${e.reason}`)})`:``,i=e.error?`:${e.error.message}`:e.evidence?` · ${e.evidence}`:``;return`${kt(e.at)} ${t(`delivery.${n}`)}${r}${i}`}function $d({message:e}){let t=G(),{delivery:n}=e,r=Zd(n.history),i=ge(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=>Qd(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,q.jsxs)(`div`,{className:`delivery`,"data-stage":`applied`,"data-compact":``,"data-tip":l,children:[(0,q.jsx)(`span`,{className:`dl-done`,"aria-hidden":`true`,children:(0,q.jsx)(J,{name:`check`,size:9,strokeWidth:3})}),(0,q.jsx)(`span`,{className:`dl-status`,"data-tone":`neutral`,children:d})]}):(0,q.jsxs)(`div`,{className:`delivery`,"data-stage":n.stage,"data-queued-by":n.queuedBy,"data-tip":l,children:[(0,q.jsx)(`ol`,{className:`dl-steps`,"aria-label":t(`delivery.label`),children:Xd.map((e,n)=>{let r=c(n);return(0,q.jsxs)(`li`,{"data-state":r,children:[(0,q.jsx)(`span`,{className:`dl-dot`,children:r===`done`?(0,q.jsx)(J,{name:`check`,size:9,strokeWidth:3}):r===`failed`?(0,q.jsx)(J,{name:`close`,size:9,strokeWidth:3}):null}),(0,q.jsx)(`span`,{className:`dl-name`,children:t(`delivery.step.${e}`)})]},e)})}),(0,q.jsx)(`span`,{className:`dl-status`,"data-tone":a?`red`:o?`gray`:s?`amber`:`neutral`,children:d})]})}function ef({stage:e}){return(0,q.jsx)(`span`,{className:`stage-dot`,"data-stage":e,"aria-hidden":`true`})}function tf({message:e}){let t=G();if(e.sync.toOrigin===`not_needed`)return null;let n=e.sync.toOrigin===`delivered`;return(0,q.jsxs)(`span`,{className:`sync-tag`,"data-state":n?`delivered`:`pending`,"data-tip":n?t(`sync.deliveredTip`,{time:e.sync.at?kt(e.sync.at):``}):t(`sync.pendingTip`),children:[(0,q.jsx)(J,{name:n?`check`:`clock`,size:11,strokeWidth:2}),t(n?`sync.delivered`:`sync.pending`)]})}function nf({delta:e}){return(0,q.jsxs)(q.Fragment,{children:[e.added===void 0?null:(0,q.jsxs)(`i`,{"data-sign":`add`,children:[`+`,e.added]}),e.removed===void 0?null:(0,q.jsxs)(`i`,{"data-sign":`del`,children:[`−`,e.removed]})]})}function rf(e){if(e===void 0)return;let t=Date.parse(e);return Number.isFinite(t)?t:void 0}function af(e,t,n){let r=Math.max(e[0],t),i=Math.min(e[1],n);return i>r?[r,i]:void 0}function of(e){let t=[...e].sort((e,t)=>e[0]-t[0]),n=0,r=NaN,i=NaN;for(let[e,a]of t)Number.isNaN(i)||e>i?(Number.isNaN(i)||(n+=i-r),r=e,i=a):a>i&&(i=a);return Number.isNaN(i)?n:n+(i-r)}function sf(e,t,n){let r=n!==void 0&&n>t?n:void 0,i=e=>{e!==void 0&&e>t&&(r===void 0||e<r)&&(r=e)};for(let t of e)t.type===`reasoning`||t.type===`assistant`&&t.text.trim()!==``?i(rf(t.at)):t.type===`tool`&&i(rf(t.startedAt)??rf(t.at));return r}function cf(e,t,n,r){let i={tools:0,waits:0,unbounded:0,spans:[]},a=(e,r,a)=>{let o=r??(a?n:void 0);if(o===void 0)return!1;let s=af([e,o],t,n);return s&&i.spans.push(s),r!==void 0&&r>=t&&r<=n&&(i.lastEnd=Math.max(i.lastEnd??r,r)),!0};for(let t of e)if(t.type===`tool`){let e=rf(t.startedAt);if(e===void 0||e>=n)continue;i.tools+=1,a(e,rf(t.endedAt),t.status===`running`)||(i.unbounded+=1)}else if(t.type===`question`){let o=rf(t.at);if(o===void 0||o>=n)continue;i.waits+=1;let s=sf(e,o,r),c=rf(t.outcome?.at),l=t.status===`answered`||t.status===`declined`||t.outcome?.reason===`timeout`;t.status===`open`?a(o,s,s===void 0):l?a(o,c!==void 0&&s!==void 0?Math.min(c,s):c??s,!1):a(o,s??c,!1)}return i}function lf(e,t,n){let r=[],i=rf(t?.at);i!==void 0&&r.push({at:i,kind:`assistant`});for(let t of e){let e=rf(t.at);e!==void 0&&(t.type===`assistant`?i===void 0&&t.text.trim()!==``&&r.push({at:e,kind:`assistant`}):(t.type===`reasoning`||t.type===`tool`||t.type===`question`)&&r.push({at:e,kind:t.type}))}let a;for(let e of r)(a===void 0||e.at<a.at)&&(a=e);return a?{ms:Math.max(0,a.at-n),kind:a.kind}:void 0}function uf(e,t,n){let r=rf(e.at);if(r===void 0)return;let i={ms:Math.max(0,r-n),streamed:e.streamed};if(!e.streamed)return i;let a=cf(t,n,r,r);return a.tools+a.waits>0&&(i.before={tools:a.tools,waits:a.waits,...a.unbounded>0?{unbounded:a.unbounded}:{},ms:of(a.spans),...a.lastEnd===void 0?{}:{sinceMs:Math.max(0,r-a.lastEnd)}}),i}function df(e,t,n,r,i,a,o){if(e===void 0)return{gap:i?`waiting`:`unreported`};let s=e.outputTokens;if(s===void 0||!Number.isFinite(s))return{gap:i?`waiting`:`unreported`};if(s<=0)return{gap:i?`waiting`:`zero`};let c=r===void 0?a:void 0,l=r??rf(c);if(l===void 0)return{gap:`short`};let u=l-n;if(u<100)return{gap:`short`};let d=cf(t,n,l,o),f=of(d.spans),p=u-f;if(p<100)return{gap:`short`};let m=e.reasoningTokens;return{rate:{perSec:s*1e3/p,outputTokens:s,...m!==void 0&&Number.isFinite(m)?{reasoningTokens:m}:{},activeMs:p,spanMs:u,excludedMs:f,tools:d.tools,waits:d.waits,unbounded:d.unbounded,...f>0?{wholeRunPerSec:s*1e3/u}:{},...c===void 0?{}:{asOf:c}}}}function ff(e,t,n,r){let i=rf(t.startedAt);if(i===void 0)return;let a=e.runMarks?.[t.id],o=t.endedAt===void 0&&e.status===`running`&&e.activeRunId===t.id,s={run:t,live:o},c=rf(t.queuedAt);c!==void 0&&i>=c&&(s.queuedMs=i-c);let l=lf(n,a?.firstText,i);if(l&&(s.first=l),a?.firstText){let e=uf(a.firstText,n,i);e&&(s.text=e)}else!o&&r&&(s.unattributedText=!0);let u=df(e.usageByRun?.[t.id],n,i,rf(t.endedAt),o,a?.outputAt,rf(a?.firstText?.at));return`rate`in u?s.rate=u.rate:s.gap=u.gap,s}function pf(e){let t=new Map,n=!1;for(let r of e.timeline){if(r.runId===void 0){r.type===`assistant`&&r.text.trim()!==``&&(n=!0);continue}if(r.type!==`reasoning`&&r.type!==`assistant`&&r.type!==`tool`&&r.type!==`question`)continue;let e=t.get(r.runId);e?e.push(r):t.set(r.runId,[r])}let r=[];for(let i of[...e.runs].sort((e,t)=>e.index-t.index)){let a=ff(e,i,t.get(i.id)??[],n);a&&r.push(a)}return r}function mf(e){let t=0,n=0,r=0;for(let i of e){let e=i.rate;e&&!i.live&&e.asOf===void 0&&(t+=e.outputTokens,n+=e.activeMs,r+=1)}if(!(r<2||n<100))return{perSec:t*1e3/n,outputTokens:t,activeMs:n,runs:r}}function hf(e){if(!Number.isFinite(e)||e<0)return``;if(e<.05)return`<0.1`;let t=Math.round(e*10)/10;return t<10?t.toFixed(1):b(Math.round(e))}var gf=`tok/s`,_f=`—`,vf={reasoning:`speed.kind.reasoning`,assistant:`speed.kind.assistant`,tool:`speed.kind.tool`,question:`speed.kind.question`},yf={unreported:`speed.gap.unreported`,waiting:`speed.gap.waiting`,zero:`speed.gap.zero`,short:`speed.gap.short`},bf=e=>e<1?`<1ms`:Ot(e);function xf(e,t){let n=[e.first?t(`speed.tip.first`,{time:bf(e.first.ms),kind:t(vf[e.first.kind])}):t(e.live?`speed.tip.firstWait`:`speed.tip.firstNone`)];return e.queuedMs!==void 0&&n.push(t(`speed.tip.queued`,{time:bf(e.queuedMs)})),n.push(t(`speed.tip.clock`)),n.join(`
|
|
26
|
+
`)}function Sf(e,t){let n=e.text;if(!n)return t(e.live?`speed.tip.textWait`:e.unattributedText?`speed.tip.textUnattributed`:`speed.tip.textNone`);if(!n.streamed)return t(`speed.tip.textWhole`,{time:bf(n.ms)});let r=[t(`speed.tip.text`,{time:bf(n.ms)})];if(n.before){let e=n.before.tools-(n.before.unbounded??0);e+n.before.waits>0&&r.push(t(`speed.tip.textBefore`,{tools:e,waits:n.before.waits,time:bf(n.before.ms)})),n.before.unbounded&&r.push(t(`speed.tip.unbounded`,{n:n.before.unbounded})),n.before.sinceMs!==void 0&&r.push(t(`speed.tip.textSince`,{time:bf(n.before.sinceMs)}))}return r.join(`
|
|
27
|
+
`)}function Cf(e,t){let n=e.rate;if(!n)return[t(yf[e.gap??`unreported`]),t(`speed.tip.source`)].join(`
|
|
28
|
+
`);let r=[t(`speed.tip.rate`,{tokens:String(n.outputTokens),active:bf(n.activeMs),rate:hf(n.perSec)}),n.asOf===void 0?t(`speed.tip.spanEnded`,{span:bf(n.spanMs)}):t(`speed.tip.spanAsOf`,{time:kt(n.asOf),span:bf(n.spanMs)})];return n.excludedMs>0&&r.push(t(`speed.tip.excluded`,{time:bf(n.excludedMs),tools:n.tools-n.unbounded,waits:n.waits})),n.unbounded>0&&r.push(t(`speed.tip.unbounded`,{n:n.unbounded})),n.wholeRunPerSec!==void 0&&r.push(t(`speed.tip.whole`,{rate:hf(n.wholeRunPerSec)})),n.reasoningTokens!==void 0&&r.push(t(`speed.tip.reasoning`,{tokens:String(n.reasoningTokens)})),r.push(t(`speed.tip.latency`),t(`speed.tip.source`)),r.join(`
|
|
29
|
+
`)}function wf(e,t){let n=e.rate;return n?[t(`speed.tokens`,{tokens:b(n.outputTokens)}),t(`speed.active`,{time:bf(n.activeMs)})].join(` · `):t(yf[e.gap??`unreported`])}function Tf(e,t){let n=e.live?`${t(`speed.run`,{n:e.run.index})} · ${t(`speed.live`)}`:t(`speed.run`,{n:e.run.index}),r=e.first?bf(e.first.ms):_f,i=e.text?e.text.streamed?bf(e.text.ms):t(`speed.textWhole`):_f,a=e.rate?`${hf(e.rate.perSec)} ${gf} · ${wf(e,t)}`:wf(e,t);return[n,t(`speed.line`,{label:t(`speed.first`),value:r}),t(`speed.line`,{label:t(`speed.text`),value:i}),t(`speed.line`,{label:t(`speed.rate`),value:a})].join(`
|
|
30
|
+
`)}var Ef=()=>(0,q.jsx)(`span`,{className:`speed-nil`,children:_f});function Df({label:e,tip:t,children:n}){return(0,q.jsxs)(`div`,{className:`kv`,tabIndex:0,"data-tip":t,"aria-description":t,children:[(0,q.jsx)(`dt`,{children:e}),(0,q.jsx)(`dd`,{children:n})]})}function Of({id:e,speeds:t,latest:n,t:r}){let i=(0,l.useMemo)(()=>mf(t),[t]),a=i?r(`speed.tip.overall`,{runs:i.runs,tokens:String(i.outputTokens),active:bf(i.activeMs)}):void 0,o=t.slice(-8);return(0,q.jsxs)(q.Fragment,{children:[(0,q.jsxs)(`div`,{className:`speed-runs`,role:`table`,id:e,"aria-label":r(`speed.runs`),children:[(0,q.jsxs)(`div`,{className:`speed-run speed-run--head`,role:`row`,children:[(0,q.jsx)(`span`,{role:`columnheader`,children:r(`speed.col.run`)}),(0,q.jsx)(`span`,{role:`columnheader`,children:r(`speed.col.first`)}),(0,q.jsx)(`span`,{role:`columnheader`,children:r(`speed.col.text`)}),(0,q.jsx)(`span`,{role:`columnheader`,children:gf})]}),o.map(e=>{let t=Tf(e,r);return(0,q.jsxs)(`div`,{className:`speed-run`,role:`row`,tabIndex:0,"data-current":e===n?``:void 0,"data-tip":t,"aria-description":t,children:[(0,q.jsx)(`span`,{role:`cell`,className:`num`,children:e.run.index}),(0,q.jsx)(`span`,{role:`cell`,className:`num`,children:e.first?bf(e.first.ms):(0,q.jsx)(Ef,{})}),(0,q.jsx)(`span`,{role:`cell`,className:`num`,children:e.text?.streamed?bf(e.text.ms):(0,q.jsx)(Ef,{})}),(0,q.jsx)(`span`,{role:`cell`,className:`num`,children:e.rate?hf(e.rate.perSec):(0,q.jsx)(Ef,{})})]},e.run.id)}),i?(0,q.jsxs)(`div`,{className:`speed-run speed-run--total`,role:`row`,tabIndex:0,"data-tip":a,"aria-description":a,children:[(0,q.jsx)(`span`,{role:`rowheader`,children:r(`speed.overall`)}),(0,q.jsx)(`span`,{role:`cell`,className:`num`,children:hf(i.perSec)})]}):null]}),t.length>o.length?(0,q.jsx)(`p`,{className:`speed-more`,children:r(`speed.moreRuns`,{n:o.length})}):null]})}function kf({state:e}){let t=G(),n=(0,l.useMemo)(()=>pf(e),[e,e.seq]),[r,i]=(0,l.useState)(!1),a=(0,l.useId)(),o=n[n.length-1],s=o===void 0&&e.runs.some(e=>e.status===`starting`),c=o?`data`:s?`starting`:`empty`;return(0,q.jsx)(Ad,{title:t(`sum.speed`),defaultOpen:o!==void 0||s,children:o===void 0?(0,q.jsx)(`p`,{className:`muted`,children:t(s?`sum.speedStarting`:`sum.noSpeed`)}):(0,q.jsxs)(q.Fragment,{children:[n.length>=2||o.live?(0,q.jsx)(`p`,{className:`speed-caption`,children:[n.length>=2?t(`speed.latest`,{n:o.run.index}):void 0,o.live?t(`speed.live`):void 0].filter(e=>e!==void 0).join(` · `)}):null,(0,q.jsxs)(`dl`,{className:`kvs kvs--speed`,children:[(0,q.jsx)(Df,{label:t(`speed.first`),tip:xf(o,t),children:o.first?(0,q.jsx)(`span`,{className:`num`,children:bf(o.first.ms)}):(0,q.jsx)(Ef,{})}),(0,q.jsxs)(Df,{label:t(`speed.text`),tip:Sf(o,t),children:[o.text?.streamed?(0,q.jsx)(`span`,{className:`num`,children:bf(o.text.ms)}):(0,q.jsx)(Ef,{}),o.text&&!o.text.streamed?(0,q.jsx)(`span`,{className:`kv-sub`,children:t(`speed.textWhole`)}):null,o.text?.streamed&&o.text.before?(0,q.jsx)(`span`,{className:`kv-sub`,children:t(`speed.before`,{n:o.text.before.tools+o.text.before.waits})}):null]}),(0,q.jsxs)(Df,{label:t(`speed.rate`),tip:Cf(o,t),children:[o.rate?(0,q.jsxs)(`span`,{children:[(0,q.jsx)(`span`,{className:`num`,children:hf(o.rate.perSec)}),(0,q.jsx)(`span`,{className:`speed-unit`,children:gf})]}):(0,q.jsx)(Ef,{}),(0,q.jsx)(`span`,{className:`kv-sub`,children:wf(o,t)})]})]}),n.length>=2?(0,q.jsxs)(q.Fragment,{children:[(0,q.jsxs)(`button`,{type:`button`,className:`speed-toggle`,"aria-expanded":r,"aria-controls":r?a:void 0,onClick:()=>i(e=>!e),children:[(0,q.jsx)(J,{name:`chevronRight`,size:12,className:`speed-chevron`,strokeWidth:2}),(0,q.jsx)(`span`,{children:t(`speed.runs`)}),(0,q.jsx)(`span`,{className:`num`,children:n.length})]}),r?(0,q.jsx)(Of,{id:a,speeds:n,latest:o,t}):null]}):null]})},c)}var Af=96,jf=6,Mf=Af/2,Nf=42,Pf=2*Math.PI*Nf,Ff=2,If=1.6;function Lf(e){return e.role===`input`?e.remainder?`usage.fresh`:`usage.input`:e.role===`output`?e.remainder?`usage.reply`:`usage.output`:`usage.${e.role}`}function Rf({breakdown:e}){let t=G(),[n,r]=(0,l.useState)(),i=Td(e.parts.map(e=>e.share),Pf,{gap:Ff,minArc:If}),a=new Intl.NumberFormat,o=e=>t(`usage.tip`,{label:t(Lf(e)),tokens:a.format(e.tokens),share:Ed(e.share)}),s=e=>({onPointerEnter:()=>r(e),onPointerLeave:()=>r(void 0)});return(0,q.jsxs)(`div`,{className:`usage`,"data-hot":n,children:[(0,q.jsxs)(`div`,{className:`usage-figure`,children:[(0,q.jsx)(`svg`,{className:`usage-ring`,viewBox:`0 0 ${Af} ${Af}`,width:Af,height:Af,"aria-hidden":`true`,style:{"--usage-perimeter":Pf},children:(0,q.jsx)(`g`,{transform:`rotate(-90 ${Mf} ${Mf})`,children:e.parts.map((e,t)=>{let r=i[t];return(0,q.jsx)(`circle`,{className:`usage-seg`,"data-seg":e.role,"data-dim":n!==void 0&&n!==e.role?``:void 0,"data-tip":o(e),cx:Mf,cy:Mf,r:Nf,pathLength:Pf,fill:`none`,strokeWidth:jf,strokeLinecap:`butt`,style:{strokeDasharray:`${r.length} ${Pf-r.length}`,strokeDashoffset:-r.offset},...s(e.role)},e.role)})})}),(0,q.jsxs)(`div`,{className:`usage-total`,"data-tip":t(`usage.totalTip`,{tokens:a.format(e.total)}),children:[(0,q.jsx)(`span`,{className:`usage-total-value`,children:b(e.total)}),(0,q.jsx)(`span`,{className:`usage-total-label`,children:t(`usage.total`)})]})]}),(0,q.jsx)(`ul`,{className:`usage-legend`,children:e.parts.map(e=>(0,q.jsxs)(`li`,{className:`usage-row`,"data-active":n===e.role?``:void 0,"data-tip":o(e),...s(e.role),children:[(0,q.jsx)(`span`,{className:`usage-swatch`,"data-seg":e.role}),(0,q.jsx)(`span`,{className:`usage-label`,children:t(Lf(e))}),(0,q.jsx)(`span`,{className:`usage-value num`,children:b(e.tokens)})]},e.role))})]})}function zf(e){try{let t=new URL(e);return t.protocol===`http:`||t.protocol===`https:`?t.href:void 0}catch{return}}function Bf({item:e,prompt:t}){let n=G();switch(e.kind){case`text`:return(0,q.jsxs)(`li`,{className:`ctx`,children:[(0,q.jsxs)(`div`,{className:`ctx-head`,children:[(0,q.jsx)(J,{name:`list`,size:13}),(0,q.jsx)(`span`,{className:`ctx-title`,children:e.title??n(`ctx.text`)})]}),(0,q.jsx)(Rd,{lines:4,expandLabel:n(`common.expand`),collapseLabel:n(`common.collapse`),children:(0,q.jsx)(`div`,{className:`ctx-text`,children:e.text})})]});case`file`:return(0,q.jsxs)(`li`,{className:`ctx`,children:[(0,q.jsxs)(`div`,{className:`ctx-head`,children:[(0,q.jsx)(J,{name:`file`,size:13}),(0,q.jsx)(`span`,{className:`ctx-path mono`,"data-tip":e.path,children:e.path}),(0,q.jsx)(tl,{value:e.path,label:n(`common.copyPath`),size:12})]}),e.note?(0,q.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,q.jsxs)(`li`,{className:`ctx`,children:[(0,q.jsxs)(`div`,{className:`ctx-head`,children:[(0,q.jsx)(J,{name:`terminal`,size:13}),(0,q.jsxs)(`span`,{className:`ctx-path mono`,"data-tip":e.path,children:[e.path??n(`ctx.snippet`),t?`:${t}`:``]})]}),(0,q.jsx)(Hd,{preview:{text:e.text,truncated:!1},maxHeight:180})]})}case`url`:{let t=zf(e.url);return(0,q.jsx)(`li`,{className:`ctx`,children:(0,q.jsxs)(`div`,{className:`ctx-head`,children:[(0,q.jsx)(J,{name:`link`,size:13}),t?(0,q.jsx)(`a`,{className:`ctx-path`,href:t,target:`_blank`,rel:`noreferrer noopener`,"data-tip":e.url,children:e.title??e.url}):(0,q.jsx)(`span`,{className:`ctx-path`,"data-tip":e.url,children:e.title??e.url})]})})}case`session`:return(0,q.jsx)(Yd,{item:e,prompt:t});default:return null}}function $({state:e,summary:t}){let n=G(),{meta:r}=e,{parent:i,parents:a,missingParents:o}=Dd(t),s=C(t).length>1,c=t.origin,l=c.kind===`user`;return(0,q.jsxs)(`div`,{className:`panel-stack`,children:[(0,q.jsxs)(Ad,{title:n(`task.origin`),defaultOpen:!0,children:[(0,q.jsxs)(`div`,{className:`origin-card`,children:[(0,q.jsx)(`span`,{className:`origin-mark`,children:(0,q.jsx)(Sl,{host:c.host,label:c.hostLabel,size:18})}),(0,q.jsxs)(`div`,{className:`origin-card-text`,children:[(0,q.jsx)(`div`,{className:`origin-card-title`,children:l?n(`origin.user`):n(`origin.dispatchedBy`,{host:_t(c)})}),(0,q.jsx)(`div`,{className:`origin-card-sub`,children:c.sessionRef?(0,q.jsxs)(q.Fragment,{children:[(0,q.jsx)(`span`,{children:n(`origin.refLabel.${c.sessionRef.kind}`)}),(0,q.jsx)(`span`,{className:`mono`,"data-tip":c.sessionRef.id,children:Pt(c.sessionRef.id,12)}),vt(c)?(0,q.jsx)(`span`,{"data-tip":n(`origin.refDeclaredTip`),children:n(`origin.refDeclared`)}):null]}):(0,q.jsx)(`span`,{children:n(l?`origin.console`:`origin.noRefTip`)})}),c.workspace?(0,q.jsxs)(`div`,{className:`origin-card-ws mono`,"data-tip":xt(c,n),children:[(0,q.jsx)(J,{name:`folder`,size:11}),(0,q.jsx)(Fd,{value:c.workspace})]}):yt(c)?(0,q.jsxs)(`div`,{className:`origin-card-ws`,"data-tip":n(`origin.workspaceUnknownTip`),children:[(0,q.jsx)(J,{name:`folder`,size:11}),(0,q.jsx)(`span`,{children:`${n(`origin.workspace`)}: ${n(`origin.workspaceUnknown`)}`})]}):null]})]}),s?a.length>0?(0,q.jsx)(`div`,{className:`parent-links`,role:`group`,"aria-label":n(`task.parentsLabel`,{n:a.length+o.length}),children:a.map(e=>(0,q.jsxs)(`button`,{type:`button`,className:`parent-link`,onClick:()=>Ia({kind:`session`,id:e.id}),children:[(0,q.jsx)(J,{name:`branch`,size:13}),(0,q.jsx)(`span`,{children:n(`task.parent`)}),(0,q.jsx)(`strong`,{children:e.title}),(0,q.jsx)(J,{name:`chevronRight`,size:12})]},e.id))}):null:i?(0,q.jsxs)(`button`,{type:`button`,className:`parent-link`,onClick:()=>Ia({kind:`session`,id:i.id}),children:[(0,q.jsx)(J,{name:`branch`,size:13}),(0,q.jsx)(`span`,{children:n(`task.parent`)}),(0,q.jsx)(`strong`,{children:i.title}),(0,q.jsx)(J,{name:`chevronRight`,size:12})]}):null]}),(0,q.jsx)(Ad,{title:n(`task.brief`),action:(0,q.jsx)(tl,{value:r.task.text,label:n(`task.copy`)}),children:(0,q.jsx)(Rd,{lines:12,expandLabel:n(`common.expand`),collapseLabel:n(`common.collapse`),watch:r.task.text,children:(0,q.jsx)(`div`,{className:`task-text`,children:r.task.text})})}),(0,q.jsx)(Ad,{title:n(`task.context`),count:r.task.context.length,children:r.task.context.length===0?(0,q.jsx)(`p`,{className:`muted`,children:n(`task.noContext`)}):(0,q.jsx)(`ul`,{className:`ctx-list`,children:r.task.context.map((e,t)=>(0,q.jsx)(Bf,{item:e,prompt:r.task.prompt},t))})}),(0,q.jsx)(Ad,{title:n(`task.prompt`),defaultOpen:!1,action:(0,q.jsx)(tl,{value:r.task.prompt,label:n(`task.copyPrompt`)}),children:(0,q.jsx)(Rd,{lines:12,expandLabel:n(`common.expand`),collapseLabel:n(`common.collapse`),watch:r.task.prompt,children:(0,q.jsx)(`div`,{className:`task-text`,children:r.task.prompt})})}),s?o.map(e=>(0,q.jsx)(`p`,{className:`muted`,children:n(`task.parentGoneNamed`,{id:Pt(e,12)})},e)):i===void 0&&t.parentSessionId?(0,q.jsx)(`p`,{className:`muted`,children:n(`task.parentGone`)}):null]})}function Vf({state:e,summary:t}){let n=G(),r=bo(),{meta:i}=e,a=t.accessEnforcement,o=i.model,s=Ou(t.effort,n),c=o?.requested,l=o?.resolved;return(0,q.jsx)(`div`,{className:`panel-stack`,children:(0,q.jsx)(Ad,{title:n(`info.session`),children:(0,q.jsxs)(`dl`,{className:`kvs`,children:[(0,q.jsx)(Ld,{label:n(`info.harness`),children:(0,q.jsxs)(`span`,{className:`inline`,children:[(0,q.jsx)(_l,{harness:t.harness,size:16,variant:`bare`}),ku(t.harness,n),t.runtime===`fixture`?(0,q.jsx)($c,{tone:`violet`,tip:n(`run.simulatedTip`),children:n(`run.simulated`)}):null]})}),(0,q.jsxs)(Ld,{label:n(`info.model`),children:[(0,q.jsxs)(`span`,{className:`inline`,children:[(0,q.jsx)(`span`,{children:Du(t,n)}),t.fast===!0?(0,q.jsx)($c,{tone:`neutral`,children:`Fast`}):null]}),c&&l&&c!==l?(0,q.jsx)(`span`,{className:`kv-sub`,children:n(`info.modelResolved`,{requested:c,resolved:l})}):o?.provider?(0,q.jsx)(`span`,{className:`kv-sub`,children:o.provider}):null]}),(0,q.jsx)(Ld,{label:n(`info.effort`),children:s??(0,q.jsx)(`span`,{className:`muted`,children:n(`info.effortDefault`)})}),(0,q.jsx)(Ld,{label:n(`info.access`),children:(0,q.jsxs)(`span`,{className:`inline inline--nowrap`,children:[(0,q.jsx)(`span`,{children:n(`access.${t.access}`)}),a?(0,q.jsx)($c,{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,q.jsx)(Ld,{label:n(`info.cwd`),children:(0,q.jsxs)(`span`,{className:`inline inline--nowrap`,children:[(0,q.jsx)(Fd,{className:`kv-path`,value:t.cwd}),(0,q.jsx)(tl,{value:t.cwd,label:n(`common.copyPath`),size:12})]})}),t.nativeRef?(0,q.jsx)(Ld,{label:n(`info.native`),tip:n(`info.nativeTip`),children:(0,q.jsxs)(`span`,{className:`inline inline--nowrap`,children:[(0,q.jsx)(`span`,{className:`kv-sub-inline`,children:n(`native.${t.nativeRef.kind}`)}),(0,q.jsx)(Id,{className:`kv-path`,value:t.nativeRef.id,tip:`${n(`native.${t.nativeRef.kind}`)}\n${t.nativeRef.id}`}),(0,q.jsx)(tl,{value:t.nativeRef.id,label:n(`common.copyId`),size:12})]})}):null,(0,q.jsx)(Ld,{label:n(`info.id`),children:(0,q.jsxs)(`span`,{className:`inline inline--nowrap`,children:[(0,q.jsx)(Id,{className:`kv-path`,value:t.id}),(0,q.jsx)(tl,{value:t.id,label:n(`common.copyId`),size:12})]})}),(0,q.jsx)(Ld,{label:n(`info.created`),children:jt(t.createdAt,r)}),(0,q.jsx)(Ld,{label:n(`info.runs`),children:(0,q.jsx)(`span`,{className:`num`,children:t.runCount})})]})})})}function Hf(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=Cd(r?.addedLines,e.addedLines),a=Cd(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 Uf({message:e}){let t=G(),n=e.delivery.stage,r=t(`delivery.${ge(e.delivery)}`);return(0,q.jsx)(`li`,{"data-kind":e.kind,children:(0,q.jsxs)(`button`,{type:`button`,className:`msg-log-head`,"data-tip":t(`msg.locate`),onClick:()=>od(e.id),children:[(0,q.jsx)(`span`,{className:`msg-log-author`,children:e.author.label}),(0,q.jsx)($c,{tone:e.kind===`steer`?`amber`:e.kind===`follow_up`?`blue`:`neutral`,children:t(`msg.kind.${e.kind}`)}),(0,q.jsxs)(`span`,{className:`msg-log-end`,children:[(0,q.jsx)(`time`,{className:`num`,dateTime:e.createdAt,children:kt(e.createdAt)}),(0,q.jsx)(`span`,{className:`msg-log-dot`,role:`img`,"aria-label":r,"data-tip":r,children:(0,q.jsx)(ef,{stage:n})})]})]})})}function Wf({child:e}){let t=G();return(0,q.jsxs)(`button`,{type:`button`,className:`child`,onClick:()=>Ia({kind:`session`,id:e.id}),children:[(0,q.jsx)(_l,{harness:e.harness,size:30}),(0,q.jsxs)(`span`,{className:`child-text`,children:[(0,q.jsx)(`span`,{className:`child-title`,children:e.title}),(0,q.jsxs)(`span`,{className:`child-sub`,children:[(0,q.jsx)(Zc,{phase:e.phase,size:7}),Vt(e.phase,t),e.lastRun?.durationMs===void 0?null:(0,q.jsxs)(`span`,{className:`num`,children:[` · `,Dt(e.lastRun.durationMs)]}),e.archivedAt===void 0?null:(0,q.jsxs)(`span`,{children:[` · `,t(`archive.chip`)]})]})]}),(0,q.jsx)(J,{name:`chevronRight`,size:13})]})}function Gf({items:e}){let t=G(),n=Et();return(0,q.jsx)(Ad,{title:t(`attention.title`),count:e.length,children:(0,q.jsx)(`ul`,{className:`attn-list`,children:e.map(e=>(0,q.jsx)(`li`,{children:qt(e,n,t)},bd(e)))})})}function Kf({state:e,summary:t}){let n=G(),{children:r}=Dd(t),i=(0,l.useMemo)(()=>Hf(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?wd(a):void 0;return(0,q.jsxs)(`div`,{className:`panel-stack`,children:[t.attention?.length?(0,q.jsx)(Gf,{items:t.attention}):null,(0,q.jsx)(Ad,{title:n(`sum.progress`),children:o&&o.entries.length>0?(0,q.jsx)(`ol`,{className:`plan-list plan-list--side`,children:o.entries.map((e,t)=>(0,q.jsxs)(`li`,{"data-status":e.status,children:[(0,q.jsx)(`span`,{className:`plan-mark`,children:e.status===`completed`?(0,q.jsx)(J,{name:`check`,size:10,strokeWidth:3}):null}),(0,q.jsx)(`span`,{children:e.text})]},e.id??t))}):(0,q.jsx)(`p`,{className:`muted`,children:t.capabilities.plan.support===`no`?n(`sum.noPlanSupport`):n(`sum.noPlan`)})}),r.length>0?(0,q.jsx)(Ad,{title:n(`sum.children`),count:r.length,children:(0,q.jsx)(`div`,{className:`children`,children:r.map(e=>(0,q.jsx)(Wf,{child:e},e.id))})}):null,(0,q.jsx)(Ad,{title:n(`sum.messages`),count:s.length,children:(0,q.jsx)(`ul`,{className:`msg-log`,children:s.map(e=>(0,q.jsx)(Uf,{message:e},e.id))})}),(0,q.jsx)(Ad,{title:n(`sum.files`),count:i.length,defaultOpen:i.length>0,children:i.length===0?(0,q.jsx)(`p`,{className:`muted`,children:t.capabilities.fileEvents.support===`no`?n(`sum.noFileEvents`):n(`sum.noFiles`)}):(0,q.jsx)(`ul`,{className:`files`,children:i.map(e=>{let t=Sd(e);return(0,q.jsxs)(`li`,{children:[(0,q.jsx)($c,{tone:e.change===`deleted`?`red`:e.change===`created`?`teal`:`neutral`,children:n(`file.${e.change}`)}),(0,q.jsx)(`span`,{className:`mono file-path`,"data-tip":e.path,children:e.path}),t?(0,q.jsx)(`span`,{className:`num file-stat`,children:(0,q.jsx)(nf,{delta:t})}):null]},e.path)})})}),(0,q.jsx)(Ad,{title:n(`sum.usage`),defaultOpen:a!==void 0,children:a===void 0?(0,q.jsx)(`p`,{className:`muted`,children:t.capabilities.usage.support===`no`?n(`sum.noUsageSupport`):n(`sum.noUsage`)}):(0,q.jsxs)(q.Fragment,{children:[u?(0,q.jsx)(Rf,{breakdown:u}):null,!u||a.costUsd!==void 0||c!==void 0?(0,q.jsxs)(`dl`,{className:`kvs kvs--tight`,children:[!u&&a.inputTokens!==void 0?(0,q.jsx)(Ld,{label:n(`usage.input`),children:(0,q.jsx)(`span`,{className:`num`,children:Ft(a.inputTokens)})}):null,!u&&a.cachedTokens!==void 0?(0,q.jsx)(Ld,{label:n(`usage.cached`),children:(0,q.jsx)(`span`,{className:`num`,children:Ft(a.cachedTokens)})}):null,!u&&a.outputTokens!==void 0?(0,q.jsx)(Ld,{label:n(`usage.output`),children:(0,q.jsx)(`span`,{className:`num`,children:Ft(a.outputTokens)})}):null,!u&&a.reasoningTokens!==void 0?(0,q.jsx)(Ld,{label:n(`usage.reasoning`),children:(0,q.jsx)(`span`,{className:`num`,children:Ft(a.reasoningTokens)})}):null,a.costUsd===void 0?null:(0,q.jsx)(Ld,{label:n(`usage.cost`),children:(0,q.jsx)(`span`,{className:`num`,children:x(a.costUsd)})}),c===void 0?null:(0,q.jsx)(Ld,{label:n(`usage.context`),children:(0,q.jsxs)(`span`,{className:`ctx-meter`,"data-tip":`${Ft(a.contextTokens)} / ${Ft(a.contextWindow)}`,children:[(0,q.jsx)(`span`,{className:`ctx-meter-bar`,children:(0,q.jsx)(`i`,{style:{width:`${Math.round(c*100)}%`},"data-high":c>.85?``:void 0})}),(0,q.jsxs)(`span`,{className:`num`,children:[Math.round(c*100),`%`]})]})})]}):null]})}),(0,q.jsx)(kf,{state:e})]})}var qf=/^\s{0,3}(`{3,}|~{3,})\s*([\w+#.-]*)\s*$/,Jf=/^\s{0,3}(#{1,6})\s+(.*?)\s*#*\s*$/,Yf=/^(\s*)([-*+])\s+(.*)$/,Xf=/^(\s*)(\d{1,9})[.)]\s+(.*)$/,Zf=/^\s{0,3}([-*_])(\s*\1){2,}\s*$/,Qf=/^\s{0,3}>\s?(.*)$/,$f=/^\s*\|?\s*:?-{2,}:?\s*(\|\s*:?-{2,}:?\s*)*\|?\s*$/;function ep(e){let t=0;for(let n of e)if(n===` `)t+=1;else if(n===` `)t+=4;else break;return t}function tp(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 np(e){return rp(e.replace(/\r\n?/g,`
|
|
31
|
+
`).split(`
|
|
32
|
+
`))}function rp(e){let t=[],n=0,r=[],i=()=>{r.length>0&&(t.push({type:`p`,text:r.join(`
|
|
33
|
+
`)}),r=[])};for(;n<e.length;){let a=e[n]??``,o=qf.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(`
|
|
34
|
+
`)});continue}if(a.trim()===``){i(),n++;continue}let s=Jf.exec(a);if(s){i(),t.push({type:`h`,level:(s[1]??`#`).length,text:s[2]??``}),n++;continue}if(Zf.test(a)&&r.length===0){t.push({type:`hr`}),n++;continue}if(Qf.test(a)){i();let r=[];for(;n<e.length&&Qf.test(e[n]??``);)r.push(Qf.exec(e[n]??``)?.[1]??``),n++;t.push({type:`quote`,blocks:rp(r)});continue}let c=e[n+1];if(a.includes(`|`)&&c!==void 0&&$f.test(c)&&c.includes(`-`)){i();let r=tp(a),o=[];for(n+=2;n<e.length&&(e[n]??``).trim()!==``&&(e[n]??``).includes(`|`);)o.push(tp(e[n]??``)),n++;t.push({type:`table`,head:r,rows:o});continue}let l=Yf.exec(a),u=l?null:Xf.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=Yf.exec(t)??Xf.exec(t);if(!i||(i[1]??``).length!==r||!(!Xf.exec(t)||Yf.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&&ep(t)>r&&t.trim()!==``){c.push(``),n++;continue}break}if(ep(t)>r)c.push(t.slice(Math.min(ep(t),r+2))),n++;else break}if(s.push({text:o,children:c.length>0?rp(c):[]}),(e[n]??``).trim()===``&&e[n+1]!==void 0){let t=e[n+1]??``,i=Yf.exec(t)??Xf.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 ip=/(`+)([\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 ap(e){try{let t=new URL(e);return t.protocol===`http:`||t.protocol===`https:`?t.href:void 0}catch{return}}function op(e,t=`i`){let n=[],r=0,i=0;for(let a of e.matchAll(ip)){a.index>r&&n.push(...sp(e.slice(r,a.index),`${t}t${i++}`));let o=`${t}${i++}`;if(a[2]!==void 0)n.push((0,q.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,q.jsx)(`strong`,{children:op(a[3]??a[4]??``,o)},o));else if(a[5]!==void 0||a[6]!==void 0)n.push((0,q.jsx)(`em`,{children:op(a[5]??a[6]??``,o)},o));else if(a[7]!==void 0)n.push((0,q.jsx)(`del`,{children:op(a[7],o)},o));else if(a[8]!==void 0&&a[9]!==void 0){let e=ap(a[9]);n.push(e?(0,q.jsx)(`a`,{href:e,target:`_blank`,rel:`noreferrer noopener`,children:op(a[8],o)},o):(0,q.jsx)(l.Fragment,{children:a[0]},o))}else if(a[10]!==void 0){let e=ap(a[10]);n.push(e?(0,q.jsx)(`a`,{href:e,target:`_blank`,rel:`noreferrer noopener`,children:a[10]},o):(0,q.jsx)(l.Fragment,{children:a[0]},o))}r=a.index+a[0].length}return r<e.length&&n.push(...sp(e.slice(r),`${t}t${i++}`)),n}function sp(e,t){let n=e.split(`
|
|
35
|
+
`),r=[];return n.forEach((e,n)=>{n>0&&r.push((0,q.jsx)(`br`,{},`${t}b${n}`)),e&&r.push((0,q.jsx)(l.Fragment,{children:e},`${t}s${n}`))}),r}function cp({lang:e,text:t}){let n=G(),r=e===`diff`||e===`patch`;return(0,q.jsxs)(`figure`,{className:`md-code`,children:[(0,q.jsxs)(`figcaption`,{children:[(0,q.jsx)(`span`,{className:`mono`,children:e||n(`md.code`)}),(0,q.jsx)(tl,{value:t,label:n(`md.copyCode`)})]}),(0,q.jsx)(`pre`,{children:(0,q.jsx)(`code`,{children:r?t.split(`
|
|
36
|
+
`).map((e,t)=>(0,q.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,`
|
|
37
|
+
`]},t)):t})})]})}function lp(e,t){return e.map((e,n)=>{let r=`${t}${n}`;switch(e.type){case`p`:return(0,q.jsx)(`p`,{children:op(e.text,r)},r);case`h`:{let t=`h${Math.min(6,e.level+2)}`;return(0,q.jsx)(t,{children:op(e.text,r)},r)}case`code`:return(0,q.jsx)(cp,{lang:e.lang,text:e.text},r);case`hr`:return(0,q.jsx)(`hr`,{},r);case`quote`:return(0,q.jsx)(`blockquote`,{children:lp(e.blocks,r)},r);case`list`:{let t=e.ordered?`ol`:`ul`;return(0,q.jsx)(t,{...e.ordered&&e.start!==1?{start:e.start}:{},children:e.items.map((e,t)=>(0,q.jsxs)(`li`,{children:[op(e.text,`${r}.${t}`),e.children.length>0?lp(e.children,`${r}.${t}.`):null]},`${r}.${t}`))},r)}case`table`:return(0,q.jsx)(`div`,{className:`md-table`,children:(0,q.jsxs)(`table`,{children:[(0,q.jsx)(`thead`,{children:(0,q.jsx)(`tr`,{children:e.head.map((e,t)=>(0,q.jsx)(`th`,{children:op(e,`${r}h${t}`)},t))})}),(0,q.jsx)(`tbody`,{children:e.rows.map((t,n)=>(0,q.jsx)(`tr`,{children:e.head.map((e,i)=>(0,q.jsx)(`td`,{children:op(t[i]??``,`${r}r${n}c${i}`)},i))},n))})]})},r)}})}var up=(0,l.memo)(function({text:e,streaming:t=!1}){let n=(0,l.useMemo)(()=>np(e),[e]);return(0,q.jsx)(`div`,{className:`md`,"data-streaming":t?``:void 0,children:lp(n,`m`)})}),dp=e=>(e.options?.length??0)>0;function fp(e){return{picks:[],other:``,otherOn:!dp(e)}}function pp(e){return e.map(fp)}function mp(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 hp(e,t){return dp(e)?e.multiple?{...t,otherOn:!t.otherOn}:{...t,picks:[],otherOn:!0}:t}function gp(e,t,n){return dp(e)?n.trim()===``?{...t,other:n}:e.multiple?{...t,other:n,otherOn:!0}:{picks:[],other:n,otherOn:!0}:{...t,other:n,otherOn:!0}}function _p(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 vp(e,t){return e.length>0&&e.every((e,n)=>{let r=t[n];return r!==void 0&&_p(e,r).length>0})}function yp(e,t){return{answers:e.map((e,n)=>_p(e,t[n]??fp(e)))}}var bp={answered:`question.conflict.answered`,declined:`question.conflict.declined`,expired:`question.conflict.expired`,open:`question.conflict.busy`};function xp(e){let t=e?.status;return typeof t==`string`?bp[t]:void 0}var Sp={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 Cp(e,t){return e.reason===`timeout`&&e.delivery===`handed_off`?t(`question.expiry.timeoutTold`):e.reason?t(Sp[e.reason]):void 0}function wp(e,t){return e.kind===`user`?t(`question.by.user`):e.label}var Tp=new Map;function Ep(e,t){if(e instanceof je&&e.status===409){let n=xp(e.details);if(n)return t(n)}return Na(e)}function Dp({prompt:e,index:t,total:n}){let r=G();return n<=1&&!e.header?null:(0,q.jsxs)(`div`,{className:`q-prompt-head`,children:[n>1?(0,q.jsx)(`span`,{className:`q-index num`,children:r(`question.index`,{i:t+1,n})}):null,e.header?(0,q.jsx)(`span`,{className:`q-header`,children:e.header}):null]})}function Op({multiple:e}){return(0,q.jsx)(`span`,{className:`q-mark`,"data-kind":e?`box`:`radio`,"aria-hidden":`true`,children:e?(0,q.jsx)(J,{name:`check`,size:10,strokeWidth:3}):null})}function kp({prompt:e,index:t,total:n,draft:r,base:i,disabled:a,onEdit:o,onSubmit:s}){let c=G(),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,q.jsxs)(`div`,{className:`q-prompt`,children:[(0,q.jsx)(Dp,{prompt:e,index:t,total:n}),(0,q.jsx)(`p`,{className:`q-text`,id:l,children:e.text}),d.length>0?(0,q.jsxs)(q.Fragment,{children:[(0,q.jsx)(`p`,{className:`q-hint`,children:e.multiple?c(`question.pickAny`):c(`question.pickOne`)}),(0,q.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,q.jsxs)(`label`,{className:`q-opt`,"data-checked":i?``:void 0,children:[(0,q.jsx)(`input`,{type:e.multiple?`checkbox`:`radio`,name:u,checked:i,disabled:a,onChange:()=>o(n=>mp(e,n,t.label))}),(0,q.jsx)(Op,{multiple:e.multiple}),(0,q.jsxs)(`span`,{className:`q-opt-body`,children:[(0,q.jsx)(`span`,{className:`q-opt-label`,children:t.label}),t.description?(0,q.jsx)(`span`,{className:`q-opt-desc`,children:t.description}):null]})]},`${n}:${t.label}`)}),e.custom?(0,q.jsxs)(`div`,{className:`q-opt q-opt--other`,"data-checked":r.otherOn?``:void 0,children:[(0,q.jsxs)(`label`,{className:`q-other-pick`,children:[(0,q.jsx)(`input`,{type:e.multiple?`checkbox`:`radio`,name:u,checked:r.otherOn,disabled:a,onChange:()=>o(t=>hp(e,t))}),(0,q.jsx)(Op,{multiple:e.multiple}),(0,q.jsx)(`span`,{className:`q-opt-label`,children:c(`question.other`)})]}),(0,q.jsx)(`input`,{type:`text`,className:`q-input`,value:r.other,maxLength:A.question.maxAnswerChars,placeholder:c(`question.otherPlaceholder`),"aria-label":c(`question.other`),disabled:a,onClick:()=>{r.otherOn||o(t=>hp(e,t))},onChange:t=>o(n=>gp(e,n,t.target.value)),onKeyDown:e=>f(e,!1)})]}):null]})]}):(0,q.jsx)(`textarea`,{className:`q-input q-input--area`,rows:3,value:r.other,maxLength:A.question.maxAnswerChars,placeholder:c(`question.textPlaceholder`),"aria-labelledby":l,disabled:a,onChange:t=>o(n=>gp(e,n,t.target.value)),onKeyDown:e=>f(e,!0)})]})}function Ap({item:e,sessionId:t,onSettled:n}){let r=G(),i=(0,l.useId)(),{prompts:a,questionId:o}=e,[s,c]=(0,l.useState)(()=>Tp.get(o)??pp(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)(()=>{Tp.set(o,s)},[o,s]);let g=vp(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 L.answerQuestion(t,o,yp(a,s)):await L.declineQuestion(t,o);yo(r.summary),n({status:r.status,outcome:r.outcome})}catch(e){m.current&&p(Ep(e,r))}finally{h.current=!1,m.current&&d(void 0)}}},[s,n,a,o,g,t,r]),y=u!==void 0;return(0,q.jsxs)(q.Fragment,{children:[(0,q.jsx)(`div`,{className:`q-body`,children:a.map((e,t)=>{let n=s[t];return n?(0,q.jsx)(kp,{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,q.jsxs)(`div`,{className:`q-foot`,children:[(0,q.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,q.jsx)(el,{size:16}):(0,q.jsx)(J,{name:`arrowUp`,size:14,strokeWidth:2.2}),r(`question.answer`)]}),(0,q.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,q.jsx)(`div`,{className:`q-status`,"aria-live":`polite`,children:f?(0,q.jsxs)(`span`,{className:`q-error`,role:`alert`,children:[(0,q.jsx)(J,{name:`alert`,size:12,strokeWidth:2}),(0,q.jsx)(`span`,{children:f})]}):u?(0,q.jsxs)(`span`,{className:`q-sending`,children:[(0,q.jsx)(el,{size:16}),(0,q.jsx)(`span`,{children:r(`question.sending`)})]}):null})]})]})}function jp(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=Cp(n,t);return e?{text:e}:void 0}default:return}}function Mp({item:e}){let t=G(),{outcome:n,prompts:r,status:i}=e,a=jp(e,t),o=i===`answered`||i===`declined`?n?.by:void 0;return(0,q.jsxs)(q.Fragment,{children:[(0,q.jsx)(`div`,{className:`q-body`,children:r.map((e,a)=>{let o=i===`answered`?n?.answers?.[a]??[]:[];return(0,q.jsxs)(`div`,{className:`q-prompt`,children:[(0,q.jsx)(Dp,{prompt:e,index:a,total:r.length}),(0,q.jsx)(`div`,{className:`q-text`,children:(0,q.jsx)(Rd,{lines:3,expandLabel:t(`common.expand`),collapseLabel:t(`common.collapse`),watch:e.text,children:e.text})}),o.length>0?(0,q.jsx)(`ul`,{className:`q-picks`,"aria-label":t(`question.answer`),children:o.map((e,t)=>(0,q.jsx)(`li`,{className:`q-pick`,children:e},`${t}:${e}`))}):null]},e.key)})}),n?(0,q.jsxs)(`div`,{className:`q-foot q-foot--resolved`,children:[(0,q.jsxs)(`p`,{className:`q-meta`,children:[o?(0,q.jsx)(`span`,{className:`q-who`,children:wp(o,t)}):null,(0,q.jsx)(`time`,{className:`num`,dateTime:n.at,children:kt(n.at)}),a?(0,q.jsx)(`span`,{className:`q-result`,"data-tip":a.tip,children:a.text}):null]}),i===`declined`&&n.note?(0,q.jsxs)(`p`,{className:`q-note`,children:[(0,q.jsx)(`span`,{className:`q-note-key`,children:t(`question.note`)}),n.note]}):null]}):null]})}var Np=(0,l.memo)(function({item:e,sessionId:t,enter:n}){let r=G(),[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`&&Tp.delete(e.questionId)},[s,e.questionId]),(0,q.jsxs)(`section`,{className:`question`,role:`group`,"aria-label":r(`question.label`),"data-status":s,"data-enter":n?``:void 0,children:[(0,q.jsxs)(`header`,{className:`q-head`,children:[(0,q.jsx)(`span`,{className:`q-title`,children:r(`question.title`)}),(0,q.jsxs)(`span`,{className:`q-state`,"data-status":s,children:[(0,q.jsx)(`i`,{className:`q-pip`,"aria-hidden":`true`}),r(`question.state.${s}`)]}),(0,q.jsx)(`time`,{className:`row-time num`,dateTime:e.at,"data-tip":new Date(e.at).toLocaleString(),children:kt(e.at)})]}),s===`open`?(0,q.jsx)(Ap,{item:o,sessionId:t,onSettled:a}):(0,q.jsx)(Mp,{item:o})]})});function Pp(){return typeof window<`u`&&window.matchMedia?.(`(prefers-reduced-motion: reduce)`).matches===!0}function Fp(e,t){let[n,r]=(0,l.useState)(e);return e&&!n&&r(!0),(0,l.useEffect)(()=>{if(e||!n)return;if(t<=0||Pp()){r(!1);return}let i=window.setTimeout(()=>r(!1),t);return()=>window.clearTimeout(i)},[e,n,t]),{present:e||n,closing:!e&&n}}var Ip={read:`file`,write:`edit`,edit:`edit`,search:`search`,shell:`terminal`,web:`globe`,mcp:`plug`,task:`branch`,plan:`list`,other:`zap`},Lp=240,Rp=200;function zp({since:e}){let t=Et(),n=Date.parse(e);return Number.isFinite(n)?(0,q.jsx)(`span`,{className:`tool-dur num`,children:Ot(Math.max(0,t-n))}):null}var Bp=(0,l.memo)(function({item:e}){let t=G(),[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?Sd(c):void 0;return(0,q.jsxs)(`div`,{className:`tool`,"data-status":e.status,"data-open":n?``:void 0,children:[(0,q.jsxs)(`button`,{type:`button`,className:`tool-head`,"aria-expanded":i?n:void 0,disabled:!i,onClick:()=>r(e=>!e),children:[(0,q.jsx)(`span`,{className:`tool-icon`,children:a?(0,q.jsxs)(q.Fragment,{children:[(0,q.jsx)(el,{size:16}),(0,q.jsx)(`span`,{className:`sr-only`,children:o})]}):(0,q.jsx)(J,{name:Ip[e.category],size:14})}),(0,q.jsx)(`span`,{className:`tool-verb`,children:Ut(e.category,t)}),(0,q.jsxs)(`span`,{className:`tool-title mono`,"data-tip":e.title,children:[s?(0,q.jsx)(`em`,{children:s}):null,e.title]}),(0,q.jsxs)(`span`,{className:`tool-end`,children:[e.files&&e.files.length>1?(0,q.jsx)(`span`,{className:`tool-files num`,"data-tip":e.files.map(e=>e.path).join(`
|
|
38
|
+
`),children:t(`tool.files`,{n:e.files.length})}):u?(0,q.jsx)(`span`,{className:`tool-files num`,"data-tip":c?.path,children:(0,q.jsx)(nf,{delta:u})}):null,a?(0,q.jsx)(zp,{since:e.startedAt}):e.durationMs===void 0?null:(0,q.jsx)(`span`,{className:`tool-dur num`,children:Ot(e.durationMs)}),e.status===`failed`||e.status===`cancelled`||e.status===`unfinished`?(0,q.jsxs)(`span`,{className:`tool-state`,"data-tip":o,children:[(0,q.jsx)(J,{name:e.status===`failed`?`close`:`minus`,size:13,strokeWidth:2.2}),(0,q.jsx)(`span`,{className:`sr-only`,children:o})]}):null,i?(0,q.jsx)(J,{name:`chevronRight`,size:12,className:`tool-chevron`,strokeWidth:2}):(0,q.jsx)(`span`,{className:`tool-chevron-gap`})]})]}),n&&i?(0,q.jsxs)(`div`,{className:`tool-detail`,children:[e.status===`unfinished`?(0,q.jsx)(`div`,{className:`note`,children:t(`tool.unfinishedNote`)}):null,e.input?(0,q.jsx)(Hd,{preview:e.input,label:t(`tool.input`)}):null,e.output?(0,q.jsx)(Hd,{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,q.jsx)(`div`,{className:`note mono`,children:t(`tool.exit`,{code:e.exitCode})}),e.error?(0,q.jsx)(`div`,{className:`note note--red`,children:e.error}):null,e.files?.map(e=>{let n=Sd(e);return(0,q.jsxs)(`div`,{className:`file-change`,children:[(0,q.jsxs)(`div`,{className:`file-change-head`,children:[(0,q.jsx)($c,{tone:e.change===`deleted`?`red`:`neutral`,children:t(`file.${e.change}`)}),(0,q.jsx)(`span`,{className:`mono file-path`,"data-tip":e.path,children:e.path}),n?(0,q.jsx)(`span`,{className:`num file-stat`,children:(0,q.jsx)(nf,{delta:n})}):null]}),e.diff?(0,q.jsx)(Hd,{preview:e.diff,maxHeight:260}):null]},e.path)})]}):null]})}),Vp=(0,l.memo)(function({item:e}){let t=G(),[n,r]=(0,l.useState)(!1),i=e.text.trim().length>0,a=t(`reasoning.note`);return(0,q.jsxs)(`div`,{className:`reasoning`,"data-open":n?``:void 0,"data-streaming":e.streaming?``:void 0,children:[(0,q.jsxs)(`button`,{type:`button`,className:`reasoning-head`,disabled:!i,"aria-expanded":i?n:void 0,"aria-description":a,onClick:()=>r(e=>!e),children:[(0,q.jsx)(`span`,{className:`tool-icon`,children:e.streaming?(0,q.jsx)(el,{size:16}):(0,q.jsx)(J,{name:`sparkle`,size:14})}),(0,q.jsx)(`span`,{className:`tool-verb`,"data-tip":a,children:e.streaming?t(`reasoning.live`):t(`reasoning.done`)}),(0,q.jsxs)(`span`,{className:`tool-end`,children:[e.durationMs===void 0?null:(0,q.jsx)(`span`,{className:`tool-dur num`,children:Ot(e.durationMs)}),i?(0,q.jsx)(J,{name:`chevronRight`,size:12,className:`tool-chevron`,strokeWidth:2}):(0,q.jsx)(`span`,{className:`tool-chevron-gap`})]})]}),n&&i?(0,q.jsx)(`div`,{className:`reasoning-body`,children:(0,q.jsx)(up,{text:e.text,streaming:e.streaming})}):null]})}),Hp=(0,l.memo)(function({items:e,live:t,expandAll:n,enter:r,following:i=!0}){let a=G(),o=(0,l.useId)(),[s,c]=(0,l.useState)(void 0),[u,d]=(0,l.useState)(60),f=(0,l.useMemo)(()=>fd(e),[e]),p=(0,l.useMemo)(()=>pd(f.mix,e=>Ut(e,a)),[f.mix,a]),m=s??(n||t),{present:h,closing:g}=Fp(m,Lp),_=(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,q.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,q.jsx)(Vp,{item:e},e.id):null)}):(0,q.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,q.jsxs)(`button`,{type:`button`,className:`work-head`,"aria-expanded":m,"aria-controls":h?o:void 0,onClick:()=>c(!m),children:[(0,q.jsx)(J,{name:`chevronRight`,size:12,className:`work-chevron`,strokeWidth:2}),(0,q.jsx)(`span`,{className:`work-title`,children:f.running?a(`work.running`,{n:f.tools}):a(`work.done`,{n:f.tools})}),(0,q.jsx)(`span`,{className:`work-mix`,children:p.slice(0,4).map(([e,t])=>`${e} ${t}`).join(` · `)}),f.failed>0?(0,q.jsx)(`span`,{className:`work-failed num`,"data-tip":a(`work.failedTip`),children:a(`work.failed`,{n:f.failed})}):null,(0,q.jsx)(`span`,{className:`spacer`}),f.durationMs!==void 0&&!f.running?(0,q.jsx)(`span`,{className:`work-dur num`,children:Ot(f.durationMs)}):null]}),h?(0,q.jsx)(`div`,{className:`work-panel`,id:o,"data-state":g?`closing`:`open`,children:(0,q.jsxs)(`div`,{className:`work-body`,children:[y>0?(0,q.jsxs)(`button`,{type:`button`,className:`more-btn more-btn--inline`,onClick:()=>d(e=>e+Rp),children:[(0,q.jsx)(J,{name:`chevronUp`,size:11,strokeWidth:2}),a(`work.older`,{n:y})]}):null,b.map(e=>e.type===`tool`?(0,q.jsx)(Bp,{item:e},e.id):(0,q.jsx)(Vp,{item:e},e.id))]})}):null]})});function Up(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 Wp(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`&&Up(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 Gp(e){switch(e.kind){case`assistant`:case`plan`:case`question`:return e.item.at;case`work`:return e.items[0]?.at;default:return}}function Kp({at:e}){return(0,q.jsx)(`time`,{className:`row-time num`,dateTime:e,"data-tip":new Date(e).toLocaleString(),children:kt(e)})}function qp({harness:e,at:t,label:n}){let r=G();return(0,q.jsxs)(`div`,{className:`turn-head`,children:[(0,q.jsx)(_l,{harness:e,size:16,variant:`bare`}),(0,q.jsx)(`span`,{className:`turn-name`,children:ku(e,r)}),n?(0,q.jsx)(`span`,{className:`turn-tag`,children:n}):null,(0,q.jsx)(Kp,{at:t})]})}var Jp=(0,l.memo)(function({item:e,lead:t,enter:n}){let r=G(),i=e.phase===`commentary`;return(0,q.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,q.jsxs)(`span`,{className:`msg-aside`,children:[i?(0,q.jsx)(`span`,{children:r(`msg.commentary`)}):null,(0,q.jsx)(Kp,{at:e.at})]}),(0,q.jsx)(up,{text:e.text,streaming:e.streaming})]})}),Yp=(0,l.memo)(function({item:e,message:t,enter:n}){let r=G();if(!t)return null;let i=t.kind===`task`,a=t.author.kind!==`system`;return(0,q.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,q.jsxs)(`header`,{className:`msg-head`,children:[(0,q.jsx)(`span`,{className:`msg-author`,children:t.author.label}),(0,q.jsx)(`span`,{className:`msg-kind`,"data-kind":t.kind,children:r(`msg.kind.${t.kind}`)}),(0,q.jsx)(Kp,{at:e.at})]}),(0,q.jsx)(`div`,{className:`msg-bubble`,children:(0,q.jsx)(`div`,{className:`msg-text`,children:i?(0,q.jsx)(Rd,{lines:4,expandLabel:r(`common.expand`),collapseLabel:r(`common.collapse`),watch:t.text,children:t.text}):t.text})}),(0,q.jsxs)(`footer`,{className:`msg-foot`,children:[(0,q.jsx)($d,{message:t}),a?(0,q.jsx)(tf,{message:t}):null]})]})}),Xp=(0,l.memo)(function({item:e,enter:t}){let n=G(),r=e.entries.filter(e=>e.status===`completed`).length;return(0,q.jsxs)(`section`,{className:`plan`,"data-enter":t?``:void 0,children:[(0,q.jsxs)(`header`,{className:`plan-head`,children:[(0,q.jsx)(J,{name:`list`,size:14}),(0,q.jsx)(`span`,{children:n(`plan.title`)}),(0,q.jsxs)(`span`,{className:`plan-count num`,children:[r,`/`,e.entries.length]})]}),e.explanation?(0,q.jsx)(`p`,{className:`plan-note`,children:e.explanation}):null,(0,q.jsx)(`ol`,{className:`plan-list`,children:e.entries.map((e,t)=>(0,q.jsxs)(`li`,{"data-status":e.status,children:[(0,q.jsx)(`span`,{className:`plan-mark`,children:e.status===`completed`?(0,q.jsx)(J,{name:`check`,size:10,strokeWidth:3}):e.status===`in_progress`?(0,q.jsx)(el,{size:16}):null}),(0,q.jsx)(`span`,{children:e.text})]},e.id??t))})]})});function Zp(e,t){let n=`code.${e}`,r=t(n);return r===n?void 0:r}var Qp=new Set([`codex.compacted`,`cursor.summary`,`pi.compaction`,`opencode.compaction`]),$p=(0,l.memo)(function({item:e,enter:t}){let n=G(),r=Zp(e.code,n);return e.level===`info`&&Qp.has(e.code)?(0,q.jsx)(`div`,{className:`diag diag--compact`,"data-enter":t?``:void 0,"data-tip":kt(e.at),children:r??e.message}):(0,q.jsxs)(`div`,{className:`diag`,"data-level":e.level,"data-enter":t?``:void 0,children:[(0,q.jsx)(J,{name:e.level===`info`?`info`:`alert`,size:14}),(0,q.jsxs)(`span`,{className:`diag-body`,children:[r?(0,q.jsx)(`strong`,{className:`diag-head`,children:r}):null,(0,q.jsx)(`span`,{className:`diag-text`,"data-tip":e.code,children:e.message})]}),(0,q.jsx)(Kp,{at:e.at})]})}),em=(0,l.memo)(function({item:e,enter:t}){let n=G(),r=e.durationMs===void 0?``:` · ${Ot(e.durationMs)}`;return(0,q.jsxs)(`div`,{className:`run-marker`,"data-phase":e.phase,"data-enter":t?``:void 0,children:[(0,q.jsx)(`span`,{className:`run-line`}),(0,q.jsxs)(`span`,{className:`run-label`,children:[n(`run.marker.${e.phase}`,{n:e.runIndex}),r,e.stopReason&&e.phase!==`completed`?` · ${e.stopReason}`:``]}),(0,q.jsx)(`span`,{className:`run-line`})]})});function tm({summary:e}){let t=G(),n=Et(),{activity:r}=e,i=Nt(e,n),a=r.kind===`tool`?r.tool:void 0,o=(e.openQuestions??0)>0,s=e.phase===`queued`||o;return(0,q.jsxs)(`div`,{className:`live-line`,role:`status`,"data-waiting":s?``:void 0,"data-enter":``,children:[s?(0,q.jsx)(J,{name:`clock`,size:13}):(0,q.jsx)(el,{size:16}),(0,q.jsx)(`span`,{className:`live-text`,children:o?t(`question.waiting`):a?Ut(a.category,t):t(`activity.${r.kind}`)},o?`asking`:r.kind),i===void 0?null:(0,q.jsx)(`span`,{className:`num live-clock`,"aria-hidden":`true`,children:Dt(i)})]})}var nm=400,rm=48,im=18,am=96,om=2500,sm=new WeakMap;function cm(){return window.matchMedia(`(prefers-reduced-motion: reduce)`).matches}function lm(e){window.clearTimeout(sm.get(e)),e.removeAttribute(`data-flash`),e.offsetWidth,e.setAttribute(`data-flash`,``),sm.set(e,window.setTimeout(()=>e.removeAttribute(`data-flash`),om))}function um({state:e,rev:t,summary:n}){let r=G(),i=(0,l.useRef)([]),a=(0,l.useMemo)(()=>Wp(e,i.current),[e,t]);(0,l.useLayoutEffect)(()=>{i.current=a},[a]);let[o,s]=(0,l.useState)(nm),[c,u]=(0,l.useState)(!1),d=(0,l.useRef)(null),f=(0,l.useRef)(null),p=(0,l.useRef)(!0),[m,h]=(0,l.useState)(!1);(0,l.useLayoutEffect)(()=>{let e=d.current;if(!e)return;let t=()=>h(e.clientHeight<am);t();let n=new ResizeObserver(t);return n.observe(e),()=>n.disconnect()},[]);let[g,_]=(0,l.useState)(`none`),v=g===`none`,[y,b]=(0,l.useState)(!1),x=(0,l.useRef)(0),S=n.phase===`running`||n.phase===`starting`,C=S||n.phase===`queued`,w=Math.max(0,a.length-o),T=w>0?a.slice(w):a,E=(0,l.useMemo)(()=>md(a.map(e=>e.kind)),[a]),D=(()=>{for(let e=T.length-1;e>=0;e--)if(T[e]?.kind===`work`)return e;return-1})(),O=(0,l.useMemo)(()=>a.some(e=>e.kind===`work`&&e.items.some(e=>e.type===`tool`)),[a]),k=(0,l.useRef)(void 0),A=(0,l.useRef)(new Set),j=(0,l.useRef)(e.meta.id);if(k.current===void 0||j.current!==e.meta.id)k.current=new Set(a.map(e=>e.key)),A.current=new Set,j.current=e.meta.id;else for(let e of T)k.current.has(e.key)||A.current.add(e.key);(0,l.useLayoutEffect)(()=>{for(let e of a)k.current?.add(e.key)},[a]);let ee=(0,l.useCallback)(e=>{let t=f.current;t&&t.scrollTo({top:t.scrollHeight,behavior:e&&!cm()?`smooth`:`auto`})},[]);(0,l.useLayoutEffect)(()=>{let t=e.timeline.length;p.current?(ee(!1),_(`none`)):t>x.current&&_(`new`),x.current=t},[e,t,a.length,ee]),(0,l.useEffect)(()=>{let e=f.current,t=e?.firstElementChild;if(!e||!t)return;let n=new ResizeObserver(()=>{p.current&&(e.scrollTop=e.scrollHeight)});return n.observe(t),n.observe(e),()=>n.disconnect()},[]);let te=(0,l.useRef)(0),ne=()=>{let e=f.current;if(!e)return;let t=e.scrollTop,n=t<te.current-1;te.current=t,hd(e,rm)?p.current=!0:n&&(p.current=!1);let r=p.current;_(e=>r?`none`:e===`none`?`idle`:e),b(t>2)},re=e=>{let t=f.current;t&&e.deltaY<0&&t.scrollTop>0&&(p.current=!1)};(0,l.useEffect)(()=>dd(()=>{p.current=!0,_(`none`),ee(!1)}),[ee]);let M=(0,l.useRef)(void 0),N=(0,l.useCallback)(e=>{let t=f.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-im;return p.current=!1,_(e=>e===`none`?`idle`:e),t.scrollTo({top:Math.max(0,r),behavior:cm()?`auto`:`smooth`}),lm(n),!0},[]),ie=(0,l.useCallback)(e=>{let t=a.findIndex(t=>t.kind===`message`&&t.message?.id===e);t<0||(t<w?(M.current=e,s(a.length-t)):N(e))},[a,w,N]);(0,l.useLayoutEffect)(()=>{let e=M.current;e&&N(e)&&(M.current=void 0)},[o,N]),(0,l.useEffect)(()=>{let e=cd();return e&&ie(e),sd(e=>{cd(),ie(e)})},[ie]);let ae=g===`none`?null:(0,q.jsxs)(`button`,{type:`button`,className:`jump`,"data-new":g===`new`?``:void 0,"data-inline":m?``:void 0,"aria-label":g===`new`?void 0:r(`timeline.latest`),"data-tip":g===`new`?void 0:r(`timeline.latest`),onClick:()=>{p.current=!0,ee(!0),_(`none`)},children:[(0,q.jsx)(J,{name:`arrowDown`,size:14,strokeWidth:2}),g===`new`?r(`timeline.jump`):null]});return(0,q.jsxs)(`div`,{className:`timeline`,ref:d,"data-scrolled":y?``:void 0,"data-compact":m?``:void 0,children:[(0,q.jsxs)(`div`,{className:`timeline-tools`,children:[a.length>0?(0,q.jsx)(`span`,{className:`timeline-count num`,children:r(`timeline.count`,{n:a.length})}):null,O?(0,q.jsx)(`button`,{type:`button`,className:`link-btn`,onClick:()=>u(e=>!e),children:r(c?`timeline.collapseAll`:`timeline.expandAll`)}):null,m?ae:null]}),(0,q.jsx)(`div`,{className:`timeline-scroll`,ref:f,onScroll:ne,onWheel:re,"data-scroll":!0,children:(0,q.jsxs)(`div`,{className:`timeline-inner`,children:[w>0?(0,q.jsx)(`button`,{type:`button`,className:`more-btn`,onClick:()=>s(e=>e+nm),children:r(`timeline.older`,{n:w})}):null,T.map((e,t)=>{let i=E[w+t]===!0,a=A.current.has(e.key),o=i?Gp(e):void 0,s=e.kind===`assistant`&&e.item.phase===`commentary`?r(`msg.commentary`):void 0;return(0,q.jsxs)(l.Fragment,{children:[o?(0,q.jsx)(qp,{harness:n.harness,at:o,label:s}):null,e.kind===`message`?(0,q.jsx)(Yp,{item:e.item,message:e.message,enter:a}):null,e.kind===`assistant`?(0,q.jsx)(Jp,{item:e.item,lead:i,enter:a}):null,e.kind===`work`?(0,q.jsx)(Hp,{items:e.items,live:S&&t===D&&t>=T.length-2,expandAll:c,enter:a,following:v}):null,e.kind===`plan`?(0,q.jsx)(Xp,{item:e.item,enter:a}):null,e.kind===`diagnostic`?(0,q.jsx)($p,{item:e.item,enter:a}):null,e.kind===`question`?(0,q.jsx)(Np,{item:e.item,sessionId:n.id,enter:a}):null,e.kind===`run`?(0,q.jsx)(em,{item:e.item,enter:a}):null]},e.key)}),C?(0,q.jsx)(tm,{summary:n}):null,a.length===0&&!C?(0,q.jsx)(`div`,{className:`timeline-empty`,children:r(`timeline.empty`)}):null]})}),m?null:ae]})}function dm(e){return e>=1160?`wide`:e>=800?`medium`:`narrow`}function fm(e){let[t,n]=(0,l.useState)(()=>dm(window.innerWidth));return(0,l.useLayoutEffect)(()=>{let t=e.current;if(!t)return;let r=()=>n(dm(t.clientWidth));r();let i=new ResizeObserver(r);return i.observe(t),()=>i.disconnect()},[e]),t}function pm(e){let t=W.get();return t.sessions[e]===void 0&&t.archived[e]!==void 0}function mm(e){if(pm(e)){so();return}let t=oa(Object.values(W.get().sessions),e);t?La({kind:`origin`,key:t}):Ia({kind:`overview`})}function hm({summary:e}){let t=G(),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=B(Bl,e=>e.busy>0),c=t(o?`archive.title`:`focus.back`);return(0,q.jsxs)(`header`,{className:`focus-head`,style:{viewTransitionName:`session-card`},"data-phase":e.phase,children:[(0,q.jsxs)(`div`,{className:`head-top`,children:[(0,q.jsxs)(`button`,{type:`button`,className:`btn btn--ghost btn--back`,onClick:()=>mm(e.id),"data-tip":`${c} · Esc`,children:[(0,q.jsx)(J,{name:`arrowLeft`,size:15,strokeWidth:2}),c]}),(0,q.jsxs)(`span`,{className:`head-origin`,"data-tip":a.sessionRef?[`${_t(a)} · ${a.sessionRef.id}`,...vt(a)?[t(`origin.refDeclaredTip`)]:[]].join(`
|
|
39
|
+
`):_t(a),children:[(0,q.jsx)(Sl,{host:a.host,label:a.hostLabel,size:14}),(0,q.jsx)(`span`,{children:a.kind===`user`?t(`origin.user`):t(`origin.dispatchedBy`,{host:_t(a)})}),a.sessionRef?(0,q.jsx)(`span`,{className:`mono head-origin-ref`,children:m(a.sessionRef.id,10)}):null,vt(a)?(0,q.jsx)(`span`,{className:`head-origin-ref`,children:t(`origin.refDeclared`)}):null]}),(0,q.jsx)(`span`,{className:`spacer`}),o?(0,q.jsxs)(`button`,{type:`button`,className:`btn btn--ghost`,disabled:s,"aria-busy":s||void 0,onClick:()=>void Xl([e.id]),"data-tip":t(`archive.unarchiveTip`),children:[(0,q.jsx)(J,{name:`unarchive`,size:14}),(0,q.jsx)(`span`,{className:`btn-label`,children:t(`menu.unarchive`)})]}):null,(0,q.jsxs)(`button`,{type:`button`,className:`btn btn--ghost`,onClick:()=>void nl(Au(e.id)).then(e=>Aa(e?`success`:`warn`,t(e?`common.copied`:`common.copyFailed`),1800)),"data-tip":t(`menu.copyLink`),children:[(0,q.jsx)(J,{name:`link`,size:14}),(0,q.jsx)(`span`,{className:`btn-label`,children:t(`focus.link`)})]}),i?(0,q.jsxs)(`button`,{type:`button`,className:`btn btn--danger-ghost`,onClick:()=>void fo(e.id,{ok:t(`toast.cancelOk`),nothing:t(`toast.cancelNothing`),failed:t(`toast.cancelFailed`)}),children:[(0,q.jsx)(J,{name:`stop`,size:13}),(0,q.jsx)(`span`,{className:`btn-label`,children:t(`composer.cancel`)})]}):null,(0,q.jsx)(cu,{items:()=>Lu(e,t,{afterRemove:()=>o?so():Ia({kind:`overview`})}),label:t(`node.menu`)})]}),(0,q.jsxs)(`div`,{className:`head-main`,children:[(0,q.jsx)(_l,{harness:e.harness,size:48,simulated:n}),(0,q.jsxs)(`div`,{className:`head-text`,children:[(0,q.jsx)(`h1`,{className:`head-title`,"data-tip":e.title,children:e.title}),(0,q.jsxs)(`div`,{className:`head-chips`,children:[(0,q.jsx)($c,{tone:`neutral`,tip:t(`info.model`),children:Du(e,t)}),r?(0,q.jsx)($c,{tone:`neutral`,tip:t(`info.effort`),children:r}):null,e.fast===!0?(0,q.jsx)($c,{tone:`neutral`,children:`Fast`}):null,o?(0,q.jsx)($c,{tone:`neutral`,tip:t(`archive.chipTip`),children:t(`archive.chip`)}):null]})]})]}),(0,q.jsxs)(`div`,{className:`head-activity`,"data-phase":e.phase,children:[(e.phase===`running`||e.phase===`starting`)&&!e.openQuestions?(0,q.jsx)(el,{size:16}):null,(0,q.jsx)(`span`,{className:`head-activity-text`,children:Wt(e,t)})]})]})}function gm({summary:e}){let t=G(),[n,r]=(0,l.useState)(!1),i=e.lastError;if(!i||e.phase!==`failed`&&e.phase!==`lost`)return null;let a=Zp(i.code,t)??(e.phase===`lost`?t(`phase.lost`):t(`error.title`)),o=!!i.detail&&i.detail!==i.message;return(0,q.jsxs)(`div`,{className:`error-banner`,role:`alert`,"data-phase":e.phase,children:[(0,q.jsx)(`span`,{className:`error-icon`,"aria-hidden":`true`,children:(0,q.jsx)(J,{name:`alert`,size:16})}),(0,q.jsxs)(`div`,{className:`error-body`,children:[(0,q.jsxs)(`div`,{className:`error-line`,children:[(0,q.jsx)(`strong`,{className:`error-title`,children:a}),(0,q.jsx)(`span`,{className:`error-code mono`,children:i.code})]}),(0,q.jsx)(`p`,{className:`error-message`,children:i.message}),i.retryable?(0,q.jsx)(`p`,{className:`error-hint`,children:t(`error.retryable`)}):null,o?(0,q.jsxs)(q.Fragment,{children:[(0,q.jsxs)(`button`,{type:`button`,className:`error-toggle`,"aria-expanded":n,onClick:()=>r(e=>!e),children:[(0,q.jsx)(J,{name:n?`chevronDown`:`chevronRight`,size:12,strokeWidth:2.2}),t(`error.detail`)]}),n?(0,q.jsx)(`pre`,{className:`error-detail mono`,children:i.detail}):null]}):null]})]})}function _m({summary:e,archivedAt:t}){let n=G(),r=At(t,bo(),!0);return(0,q.jsx)(`div`,{className:`banner banner--archived`,role:`status`,children:n(e.archivedBy===`retention`?`archive.bannerAuto`:`archive.banner`,{time:r})})}function vm(){return(0,q.jsxs)(`div`,{className:`skeleton`,"aria-hidden":`true`,children:[(0,q.jsx)(`i`,{style:{width:`42%`}}),(0,q.jsx)(`i`,{style:{width:`86%`}}),(0,q.jsx)(`i`,{style:{width:`74%`}}),(0,q.jsx)(`i`,{style:{width:`58%`}})]})}function ym({reason:e}){let t=G();return(0,q.jsxs)(`div`,{className:`state-card`,role:`alert`,children:[(0,q.jsx)(`span`,{className:`state-icon`,"data-tone":e===`failed`?`red`:`neutral`,children:(0,q.jsx)(J,{name:e===`failed`?`alert`:`search`,size:22})}),(0,q.jsx)(`h2`,{children:t(e===`failed`?`focus.failedTitle`:`focus.notFoundTitle`)}),(0,q.jsx)(`p`,{children:t(e===`failed`?`focus.failedBody`:`focus.notFoundBody`)}),(0,q.jsx)(`div`,{className:`state-actions`,children:(0,q.jsx)(`button`,{type:`button`,className:`btn btn--primary`,onClick:()=>Ia({kind:`overview`}),children:t(`focus.back`)})})]})}function bm({id:e}){let t=G(),n=B(W,t=>t.sessions[e]??t.archived[e]),r=B(W,t=>t.detail?.id===e?t.detail:void 0),i=(0,l.useRef)(null),a=fm(i),[o,s]=(0,l.useState)(`timeline`);(0,l.useEffect)(()=>a===`narrow`?sd(()=>s(`timeline`)):void 0,[a]),(0,l.useEffect)(()=>(Da.lastFocusId=e,()=>{Da.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=W.get();r.settings.open||r.confirm||r.switcherOpen||document.querySelector(`[role="menu"]`)||mm(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,q.jsx)(`div`,{className:`focus`,ref:i,children:(0,q.jsx)(ym,{reason:`not_found`,id:e})});if(!n)return(0,q.jsx)(`div`,{className:`focus`,ref:i,children:(0,q.jsx)(vm,{})});if(!c&&r?.error===`failed`)return(0,q.jsxs)(`div`,{className:`focus`,ref:i,"data-mode":a,children:[(0,q.jsx)(hm,{summary:n}),(0,q.jsx)(`div`,{className:`focus-body`,children:(0,q.jsxs)(`div`,{className:`state-card`,role:`alert`,children:[(0,q.jsx)(`span`,{className:`state-icon`,"data-tone":`red`,children:(0,q.jsx)(J,{name:`alert`,size:22})}),(0,q.jsx)(`h2`,{children:t(`focus.failedTitle`)}),(0,q.jsx)(`p`,{children:t(`focus.failedBody`)}),(0,q.jsx)(`div`,{className:`state-actions`,children:(0,q.jsxs)(`button`,{type:`button`,className:`btn btn--primary`,onClick:()=>void Ga(e),children:[(0,q.jsx)(J,{name:`refresh`,size:14}),t(`common.retry`)]})})]})})]});let u=(0,q.jsxs)(`main`,{className:`focus-main`,children:[(0,q.jsx)(gm,{summary:n}),c?(0,q.jsx)(um,{state:c,rev:r?.rev??0,summary:n}):(0,q.jsx)(vm,{}),(0,q.jsx)(yd,{summary:n})]}),d=c?(0,q.jsxs)(q.Fragment,{children:[(0,q.jsx)($,{state:c,summary:n}),(0,q.jsx)(Vf,{state:c,summary:n})]}):(0,q.jsx)(vm,{}),f=c?(0,q.jsx)(Kf,{state:c,summary:n}):(0,q.jsx)(vm,{});return(0,q.jsxs)(`div`,{className:`focus`,ref:i,"data-mode":a,children:[(0,q.jsx)(hm,{summary:n}),r?.error===`not_found`?(0,q.jsx)(`div`,{className:`banner banner--amber`,children:t(`focus.removedBanner`)}):null,n.archivedAt===void 0?null:(0,q.jsx)(_m,{summary:n,archivedAt:n.archivedAt}),a===`narrow`?(0,q.jsxs)(q.Fragment,{children:[(0,q.jsx)(`div`,{className:`tabs`,role:`tablist`,"aria-label":t(`focus.tabs`),children:[`timeline`,`task`,`summary`,`info`].map(e=>(0,q.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,q.jsxs)(`div`,{className:`focus-body focus-body--narrow`,children:[o===`timeline`?u:null,o===`task`&&c?(0,q.jsx)(`aside`,{className:`rail`,"data-scroll":!0,children:(0,q.jsx)($,{state:c,summary:n})}):null,o===`summary`?(0,q.jsx)(`aside`,{className:`rail`,"data-scroll":!0,children:f}):null,o===`info`&&c?(0,q.jsx)(`aside`,{className:`rail`,"data-scroll":!0,children:(0,q.jsx)(Vf,{state:c,summary:n})}):null]})]}):a===`medium`?(0,q.jsxs)(`div`,{className:`focus-body focus-body--medium`,children:[(0,q.jsxs)(`aside`,{className:`rail rail--left`,"data-scroll":!0,children:[d,f]}),u]}):(0,q.jsxs)(`div`,{className:`focus-body focus-body--wide`,children:[(0,q.jsx)(`aside`,{className:`rail rail--left`,"data-scroll":!0,children:d}),u,(0,q.jsx)(`aside`,{className:`rail rail--right`,"data-scroll":!0,children:f})]})]})}var xm={entries:new Map,pending:!1,tracked:new Set},Sm=class{slots=new Map;listeners=new Set;view=xm;waitTimer;load;busyMs;idleMs;firstWaitMs;now;visible;constructor(e={}){this.load=e.load??(e=>L.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=xm;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 Cm(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 wm(e){return tr(e)}var Tm=(e,t)=>e<t?-1:+(e>t);function Em(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 Dm(e){let t=e.filter(e=>!e.entry.stale),n=new Map;for(let r of t.length>0?t:e){let e=wm(r.entry.git.root);if(!e)continue;let t=n.get(e);(!t||Em(r,t))&&n.set(e,r)}let r=[...n].sort(([e],[t])=>Tm(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 Om(e,t){let n=new Map;for(let r of ir(e)){let i=Dm(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),Em(i.evidence,a.evidence)&&(a.evidence=i.evidence)):n.set(i.worktree,{evidence:i.evidence,origins:[...r.origins]})}return[...n].sort(([e],[t])=>Tm(e,t)).map(([e,{evidence:t,origins:n}])=>({key:e,entry:t.entry,origins:n.sort()}))}function km(e){let t=(0,l.useMemo)(()=>new Sm,[]),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 Am=e=>[...e].sort().join(`|`),jm=new Set;function Mm(e,t,n){let r=t?qi(e):void 0,i=mt(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 Nm=()=>typeof window<`u`&&(window.matchMedia?.(`(prefers-reduced-motion: reduce)`).matches??!1);function Pm(e,t,n,r=jm){let i=(0,l.useMemo)(()=>Mm(e,t,r),[e,t,r]),a=(0,l.useRef)(void 0),[o,s]=(0,l.useState)(0),c=(0,l.useMemo)(()=>Yi({sessions:e,rule:i?.visible,prev:a.current,operated:n,now:Date.now(),exitMs:Nm()?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`?`*`:Am(c.drawn),d=Am(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 Fm(e){try{return e.matches(`:focus-visible`)}catch{return!0}}function Im(e,t){if(!e)return!1;let n=Mn(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)&&Fm(i)}function Lm(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 Rm=e=>Math.round(e);function zm(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 Bm(e,t){let n=new Map;if(e.length<2)return n;let{left:r,right:i,top:a,bottom:o}=zm(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:Rm(e),y:Rm(c)})}return n}function Vm(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}=zm(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:Rm(p),y:e.y}:{x:e.x,y:Rm(p)}),p+=a(e)+f;return n}var Hm=.01,Um=(e,t,n)=>e.x<t.x+t.w+n-Hm&&t.x-n+Hm<e.x+e.w&&e.y<t.y+t.h+n-Hm&&t.y-n+Hm<e.y+e.h,Wm=(e,t)=>Math.max(0,Math.min(t.x-e.w,t.y-e.h));function Gm(e,t,n,r){let i={x:e.x,y:e.y,w:t.w,h:t.h};for(let e of n)if(Um(i,e,r))return!1;return!0}var Km=new Map;function qm(e,t){let n=`${e.x}x${e.y}/${t}`,r=Km.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),Km.set(n,i),i}function Jm(e,t,n,r,i=-1/0,a=6,o=-1/0){let s=Wm(t,r);for(let{i:c,j:l}of qm(r,a)){let a={x:e.x+c*r.x,y:e.y+l*r.y};if(!(a.x<i-Hm||a.y<o-Hm)&&Gm(a,t,n,s))return a}}function Ym(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 Xm=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=Ym([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=>Um(i,e,0))||[...this.reserved].some(([t,n])=>t!==e&&Um(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}}},Zm=1e-9,Qm=(e,t)=>Math.min(1,t.w/e.w,t.h/e.h);function $m(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=Ym(e.scope);if(!l)return;let u=r.x-n.w,d=Wm(n,r),f={x:l.x+l.w+u,y:c},p=Gm(f,n,a,d)?f:{x:o.x+o.w+u,y:c};if(!Gm(p,n,a,d))return;let m=e=>Qm(Ym([o,{x:e.x,y:e.y,w:n.w,h:n.h}])??o,i);return m(p)>m(t)+Zm?p:void 0}var eh=.01,th=1e-6,nh=5e-4,rh=.05,ih=(e,t)=>Math.min(1,t.w/e.w,t.h/e.h),ah=(e,t)=>Math.abs(Math.log(e.w/e.h/(t.w/t.h)));function oh(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+th)+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 sh(e){let{size:t,steps:n,roots:r,block:i,frame:a,obstacles:o,floor:s,area:c,align:l}=e,u=Ym(r),d=Ym(i);if(!u||!d)return;let f=oh(r,t,n,d),p=Wm(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=>Gm(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+th)+1),y=Math.min(0,Math.ceil((a.y-u.y)/n.y-th));for(let e=y;e<v;e++){let t=u.y+e*n.y;if(!(t<s-eh)){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=>ih(Ym([a,C(e)])??a,c),T=w(S),E=w(b);if(T>E+nh)return _(S);if(E>T+nh)return _(b);let D=e=>ah(Ym([...i,C(e)])??C(e),c);return _(D(S)<D(b)-rh?S:b)}var ch=.01,lh=(e,t,n)=>e.x<t.x+t.w+n-ch&&t.x-n+ch<e.x+e.w&&e.y<t.y+t.h+n-ch&&t.y-n+ch<e.y+e.h;function uh(e,t,n,r,i=H.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)lh({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 dh=(e,t)=>({x:t?.x??e.x,y:t?.y??e.y,w:e.w,h:e.h});function fh(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 ph(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 mh(e,t,n){if(t.size===0)return new Map;let r=ph(e,n);for(let e of r)t.has(e)&&r.delete(e);return hh(e,t,r)}function hh(e,t,n,r=H.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||fh(t,c))?i.get(t.anchor.id):void 0,u;if(t.anchor&&l)u=uh(l,t.anchor,t,n.map(e=>dh(e,i.get(e.id))),r);else{let e=n.filter(e=>i.has(e.id)).map(e=>dh(e,i.get(e.id)));if(uh({x:t.x,y:t.y},{dx:0,dy:0},t,e,r).y===t.y)continue;u=uh({x:t.x,y:t.y},{dx:0,dy:0},t,n.map(e=>dh(e,i.get(e.id))),r)}i.set(t.id,u),o.set(t.id,u)}return o}var gh=e=>({x:e.x,y:e.y,w:e.w,h:e.h});function _h(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 vh(e){return{rects:new Map(e.nodes.map(e=>[e.id,gh(e)])),parents:_h(e),grid:e.grid===!0}}function yh(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 bh(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 xh=(e,t,n)=>e>=t-.01?e:e+Math.ceil((t-e)/n-1e-9)*n;function Sh(e,t){if(e.kind!==`agent`)return-1/0;let n=t.familyOf(e.id)?.origin,r=n?t.rects.get(n):void 0;return r?r.x+r.w+Wn(e.w===H.agentWCompact).gapX:-1/0}function Ch(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+H.rowGap))}return r}function wh(e,t){let n=Wn(e.w===H.agentWCompact);return t.grid?{x:n.pitchX,y:n.pitchY}:{x:e.w+n.gapX,y:e.h+H.rowGap}}function Th(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 Eh(e,t,n,r,i,a){let o=Ym(r.cards);if(o)return $m(t,n,{w:e.w,h:e.h},wh(e,i),a,r.obstaclesFor(e),o)}function Dh(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=Ym(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 sh({size:{w:e.w,h:e.h},steps:wh(e,n),roots:a,block:o,frame:s,obstacles:t.obstaclesFor(e),floor:c,area:r,align:u})}function Oh(e,t,n,r){let i=t=>({x:t.x,y:t.y,w:e.w,h:e.h}),a=Math.max(Sh(e,t),Ch(e,t)),o=Dh(e,t,n,r);if(o&&o.x>=a)return i(o);let s={w:e.w,h:e.h},c=wh(e,n),l=e.kind===`agent`?t.familyOf(e.id):void 0,u=t.obstaclesFor(e),d=l?t.blockOf(l.origin):[],f=d.length>0?Math.min(...d.map(e=>e.y)):-1/0,p=e.anchor?t.rects.get(e.anchor.id):void 0,m=p&&e.anchor?{x:p.x+e.anchor.dx,y:p.y+e.anchor.dy}:void 0,h=Th(e,t),g=a=>i((h&&r?Eh(e,h,a,t,n,r):void 0)??a),_=Ym(u);if(m){let r={x:m.x,y:Math.max(m.y,f)};if(n.grid){let n=Gm(r,s,u,Wm(s,c))&&r.x>=a?r:Jm(r,s,u,c,a,6,f);if(n)return g(n);if(l&&(t.parents.get(e.id)??``).includes(`,`))return i(uh({x:Math.max((_?_.x+_.w:e.x)+(c.x-s.w),a),y:f},{dx:0,dy:0},s,u,Wm(s,c)))}else return g(uh({x:xh(r.x,a,c.x),y:r.y},{dx:0,dy:0},s,u,Wm(s,c)))}return i({x:xh(m?.x??_?.x??e.x,a,c.x),y:(_?_.y+_.h:e.y)+H.rowGap})}function kh(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=Ym(o.map(gh)),c=Ym(n.cards);if(!s)return[];let l=(c?.x??s.x)-s.x,u=c?c.y+c.h+H.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 Ah(e,t,n,r,i){if(i===void 0)return!1;let a=Dh(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=Th(e,n);return o!==void 0&&Eh(e,o,t,n,r,i)!==void 0}function jh(e,t,n,r){let i=vh(e);if(!t||yh(e,i,t,n))return{layout:e,memory:i,mode:`full`,added:[]};let a=e.nodes.find(e=>e.kind===`agent`),o=new Xm(e,i.parents,new Map(e.nodes.map(e=>[e.id,e.kind])),a?wh(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=bh(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(!(n.x<Sh(e,o)||!Gm(n,n,[...o.cards,...o.holesFor(e)],0))){if(Ah(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 kh(t,e,o,n))c.add(r)}for(let e of s)c.has(e.id)||(o.put(e.id,Oh(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,gh(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:sn(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 Mh(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 Nh=e=>(e.hidden?.size??0)>0,Ph=e=>e.nodes.map(e=>e.id).sort().join(`
|
|
40
|
+
`);function Fh(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 Ih=(e,t)=>!t||[...e.rects.keys()].some(e=>!t.rects.has(e)),Lh=class{entries=new Map;get size(){return this.entries.size}save(e,t){let n=Ph(e);for(this.entries.delete(n),this.entries.set(n,{memory:t,partial:Nh(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])=>Fh(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=Ph(e),a=this.entries.get(i);if(a){let t=jh(e,a.memory,n,r);if(t.mode===`hold`)return t}let o=new Set(e.nodes.map(e=>e.id)),s=!Nh(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))&&Ih(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=jh(e,t,e=>t.rects.has(e)&&n(e),r);if(i.mode===`hold`)return i}}},Rh=2;function zh(e,t){let n=vh(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 Bh=(e,t)=>e.w===t.w&&e.h===t.h,Vh=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):!Bh(n,r.area)&&zh(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>=Rh?void 0:{at:a.at,area:r,corrections:a.corrections+1}:n.mode===`full`&&t&&zh(e,t)===`resized`?this.flip={at:this.clock(),area:r,corrections:0}:a&&t&&zh(e,t)!==`same`&&(this.flip=void 0)}clear(){this.flip=void 0}},Hh=class{memory;raw;shown;drift=!1;snapshots=new Lh;settling;constructor(e=()=>performance.now()){this.settling=new Vh(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=jh(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=Mh(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 Uh(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 Wh=(...e)=>e.every(Number.isFinite);function Gh(e,t,n){let r=Uh(e,t);if(!Wh(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 Kh(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 qh(e,t,n,r){let i=Uh(e,t);return!Wh(i.x,i.y,i.w,i.h,n.w,n.h)||n.w<=0||n.h<=0?{dx:0,dy:0}:{dx:Kh(i.x,i.w,n.w,r.left,r.right),dy:Kh(i.y,i.h,n.h,r.top,r.bottom)}}var Jh=[`top`,`right`,`bottom`,`left`],Yh=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}=qh(n,this.port.camera,r,tn(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?Gh(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(Jh.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()}}},Xh=[`right`,`bottom`,`left`,`top`],Zh=e=>String(Math.round(e*100)/100),Qh=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`,Xh[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`,`${Zh(t)}px`),r.setProperty(`--port-y`,`${Zh(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 $h(e,t){return t.x=e.tx,t.y=e.ty,t.w=e.w,t.h=e.h,t}function eg(e,t,n,r){e.ports.place(n,ai(t,n),oi(t,n));let i=e.phases[n];(i===void 0||Ei(r)>Ei(i))&&(e.phases[n]=r)}var tg=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 ui;blend=new ui;mount(e){this.groups=e}unmount(){for(let{els:e}of this.edges.values())Ti(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 Qh(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,wi(e.els,r.phase);else{let e=xi(t);wi(e,r.phase);let n=new ui;n.x0=NaN,this.edges.set(r.id,{edge:r,els:e,side:-1,shown:n,from:new ui,morphAt:-1,fromNode:void 0,toNode:void 0})}}for(let[e,t]of[...this.edges])n.has(e)||(Ti(t.els),this.edges.delete(e));this.restack(t)}restack(e){let t=[...this.edges.values()].sort((e,t)=>Ei(e.edge.phase)-Ei(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=li(i.side,$h(o,this.aimFrom),$h(s,this.aimTo)),d=di(o,s,u,this.goal);u!==i.side&&(i.side>=0&&!n?(hi(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)/(si.morph*1e3);e>=1?i.morphAt=-1:(f=gi(i.from,d,_i(e>0?e:0),o,s,this.blend),r=!0)}pi(f,i.shown)||(fi(f,i.shown),Si(i.els,mi(f)),Ci(i.els,f.x0,f.y0,f.x3,f.y3)),c&&eg(c,o,u,a.phase),l&&eg(l,s,ii(u),a.phase)}for(let e of this.nodes.values())e.ports.apply(e.phases);return r}};function ng(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 rg(e){for(let[t,n]of[...e])n.el?n.placed=!1:e.delete(t)}function ig(e,t){for(let[n,r]of[...e])!t.has(n)&&!r.el&&e.delete(n)}function ag(e){e.el&&(e.el.style.translate=`${e.x.toFixed(2)}px ${e.y.toFixed(2)}px`)}function og(e,t){return sn(e.map(e=>{let n=t.get(e.id);return n?{...e,x:n.tx,y:n.ty}:e}))}function sg(e,t,n){return t.has(n.id)?[...e.values()].filter(e=>e.placed&&e.el&&t.has(e.id)):[n]}function cg(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 lg=26,ug=1.6,dg=(e,t,n)=>Math.min(n,Math.max(t,e)),fg=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 on(this.bounds,{w:r,h:i},t?.padding??tn(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=dg(this.target.k*n,Math.min(Zt,Qt),ug),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)-lg*i.x)*t,i.y+=(-170*(n.y-r.y)-lg*i.y)*t,i.k+=(-170*(n.k-r.k)-lg*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}}},pg=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))}},mg=27,hg=.04,gg=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 _g(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)-mg*a.vx)*r,a.vy+=(-240*(a.y-a.ty)-mg*a.vy)*r,a.x+=a.vx*r,a.y+=a.vy*r;Math.abs(a.x-a.tx)<hg&&Math.abs(a.y-a.ty)<hg&&Math.abs(a.vx)<hg&&Math.abs(a.vy)<hg?(a.x=a.tx,a.y=a.ty,a.vx=0,a.vy=0):i=!0,ag(a)}return i}var vg=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=_g(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))}},yg=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=sg(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=dg(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 bg(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 xg(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=ng(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:bg(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,ag(l),r&&l.el&&(l.el.dataset.fresh=``)}}return{keep:s,anchored:c}}var Sg=100,Cg=1e3;function wg(e,t){return new Map(t.map(t=>{let n=e.get(t);return[t,n?{...n}:void 0]}))}var Tg=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<Cg&&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>Sg&&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}},Eg=`ensemble.canvas.positions.v1`,Dg=`ensemble.canvas.positions.v2:`;function Og(e){return!e||e===`all`?Eg:`${Dg}${e}`}function kg(e){try{let t=JSON.parse(localStorage.getItem(Og(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 Ag(e,t){let n=Og(t);try{e.size?localStorage.setItem(n,JSON.stringify(Object.fromEntries(e))):localStorage.removeItem(n)}catch{}}var jg=class{bodies;host;map=kg();key=`all`;history=new Tg;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=kg(e)}forget(){this.history.clear()}save(){Ag(this.map,this.key)}snapshot(e){return wg(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),ag(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,wg(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()}},Mg=class{listeners=new Set;subscribe=e=>(this.listeners.add(e),()=>{this.listeners.delete(e)});notify(){for(let e of[...this.listeners])e()}},Ng=class{state={selected:0,canUndo:!1,canRedo:!1};signal=new Mg;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())}},Pg=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)}}},Fg=class{bodies=new Map;selection=new Pg(()=>this.bodies.values());connections=new tg;rig=new fg({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 jg(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 Yh({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 gg;mounted;layout;status=new Ng;selectionSignal=new Mg;contexts=new pg({bodies:this.bodies,selection:this.selection,dragging:()=>this.input.dragging});input=new yg({bodies:this.bodies,selection:this.selection,camera:this.rig,placements:this.placements,contexts:this.contexts,viewport:()=>this.mounted?.viewport});frames=new vg({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 Mg;held=new Hh;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=ng(this.bodies,e),r=this.connections.register(e,t);return n.el=t,this.selection.sync(e,t),n.placed&&ag(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}),rg(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=ph(e.nodes,r),o=mh(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}=xg(e,{bodies:this.bodies,positions:this.placements.positions,arrivals:o,first:i,reducedMotion:this.motion.reduced});c&&this.placements.save(),ig(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(og(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(sg(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,n){this.fills.get(e)!==t&&(this.fills.set(e,t),n&&this.held.reset(),this.fillSignal.notify())}onNodeContext(e){return this.contexts.add(e)}align(e){return this.placements.arrange(Bm(cg(this.bodies,this.selection),e))}distribute(e){return this.placements.arrange(Vm(cg(this.bodies,this.selection),e))}undo(){return this.placements.undo()}redo(){return this.placements.redo()}resetLayout(e=void 0){let t=this.rig.target.k;this.placements.clear(),this.mounted?.onPositions?.(!1),this.rig.release(t);let n=this.held.reset(),r=e??n??this.layout;r&&this.setLayout(r),this.setFill(this.placements.space,t,!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)}},Ig=[`--aura-ax`,`--aura-ay`,`--aura-bx`,`--aura-by`];function Lg(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 Rg(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 zg(e){let t=Lg(e),n=e=>(Rg(t+Math.imul(e+1,2654435769))%999+1)/1e3;return[n(0),n(1),n(2),n(3)]}function Bg(e){let t={};return zg(e).forEach((e,n)=>{t[Ig[n]]=e.toFixed(3)}),t}var Vg=(...e)=>t=>e.some(e=>t.startsWith(e)),Hg=[[`deepseek`,Vg(`deepseek`)],[`kimi`,Vg(`kimi`,`moonshot`)],[`glm`,e=>/^(chat)?glm/.test(e)||e===`zhipu`],[`minimax`,Vg(`minimax`)],[`qwen`,Vg(`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`,Vg(`gemini`)],[`grok`,Vg(`grok`)],[`mistral`,Vg(`mistral`,`mixtral`,`codestral`,`devstral`,`magistral`)],[`llama`,Vg(`llama`)],[`composer`,e=>e===`composer`]],Ug=e=>e.toLowerCase().split(/[^a-z0-9]+/).filter(Boolean);function Wg(e){if(e)for(let t of[e.resolved,e.label,e.requested]){if(!t)continue;let e=Ug(t);for(let[t,n]of Hg)if(e.some(n))return t}}function Gg(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 Kg={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 qg({family:e,size:t=12}){let n={width:t,height:t,"--mark":`url("${Kg[e].src}")`};return(0,q.jsx)(`span`,{className:`model-mark`,"data-family":e,style:n,"aria-hidden":`true`})}var Jg={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 Yg(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 Xg({family:e,simulated:t=!1,size:n=24,tip:r}){let i={width:n,height:n};if(e&&!t){let{src:t,optical:a}=Kg[e],{box:o,translate:s}=Yg(a,n),c={width:o,height:o,translate:s,"--mark":`url("${t}")`};return(0,q.jsx)(`span`,{className:`model-slot`,"data-tip":r,style:i,"aria-hidden":`true`,children:(0,q.jsx)(`span`,{className:`model-mark`,"data-family":e,style:c})})}let a=t?`simulated`:`unknown`,{icon:o,stroke:s,optical:c}=Jg[a],{box:l,translate:u}=Yg(c,n);return(0,q.jsx)(`span`,{className:`model-slot`,"data-placeholder":a,"data-tip":r,style:i,"aria-hidden":`true`,children:(0,q.jsx)(J,{name:o,size:l,strokeWidth:s,className:`model-glyph`,style:{translate:u}})})}var Zg=13,Qg={done:(0,q.jsx)(`path`,{d:`M3.7 6.2l1.6 1.6 3-3.4`}),failed:(0,q.jsx)(`path`,{d:`M4.3 4.3l3.4 3.4M7.7 4.3L4.3 7.7`}),cancelled:(0,q.jsx)(`path`,{d:`M4.6 4.5v3M7.4 4.5v3`}),stopped:(0,q.jsx)(`path`,{d:`M4.4 6h3.2`}),lost:(0,q.jsx)(`path`,{d:`M6 3.9v2.6M6 8.3v.01`})};function $g({kind:e}){return(0,q.jsxs)(`svg`,{className:`a-glyph`,width:`9`,height:`9`,viewBox:`0 0 12 12`,"aria-hidden":`true`,children:[(0,q.jsx)(`rect`,{width:`12`,height:`12`,fill:`currentColor`}),(0,q.jsx)(`g`,{fill:`none`,stroke:`#262626`,strokeWidth:`1.5`,strokeLinecap:`square`,strokeLinejoin:`miter`,children:Qg[e]})]})}function e_({summary:e,tip:t}){let n=G(),r=Nt(e,Et());return(0,q.jsxs)(`span`,{className:`a-state`,"data-kind":`running`,"data-tip":t,children:[(0,q.jsx)(`i`,{className:`a-run`,"aria-hidden":`true`}),(0,q.jsx)(`span`,{className:`num`,children:r===void 0?Vt(e.phase,n):Dt(r)})]})}function t_({items:e}){let t=G(),n=Jt(e,Et(),t);return(0,q.jsxs)(`span`,{className:`a-flag`,"data-tone":`amber`,"data-tip":n,role:`img`,"aria-label":n,children:[(0,q.jsx)(J,{name:`alert`,size:11}),e.length>1?e.length:null]})}function n_({summary:e}){let t=G(),{phase:n}=e,r=e.runCount>1?t(`node.runs`,{n:e.runCount}):void 0;switch(n){case`running`:return(0,q.jsx)(e_,{summary:e,tip:r});case`done`:{let i=e.lastRun?.durationMs;return(0,q.jsxs)(`span`,{className:`a-state`,"data-kind":`done`,"data-tip":r,children:[(0,q.jsx)($g,{kind:`done`}),(0,q.jsx)(`span`,{className:`num`,children:i===void 0?Vt(n,t):y(i)})]})}case`failed`:case`cancelled`:case`stopped`:case`lost`:return(0,q.jsxs)(`span`,{className:`a-state`,"data-kind":n,"data-tip":r,children:[(0,q.jsx)($g,{kind:n}),(0,q.jsx)(`span`,{children:Vt(n,t)})]});default:return(0,q.jsx)(`span`,{className:`a-state`,"data-kind":n===`ready`?`ready`:`pending`,"data-tip":r,children:(0,q.jsx)(`span`,{children:Vt(n,t)})})}}var r_=(0,l.memo)(function({summary:e,engine:t,morph:n}){let r=G(),i=Mn(e.id),a=(0,l.useRef)(null),[o,s]=(0,l.useState)(!1),c=fl(i);(0,l.useLayoutEffect)(()=>{let n=a.current;return n?t.register(Mn(e.id),n):void 0},[t,e.id]);let u=(0,l.useMemo)(()=>yl(t,i),[t,i]),{phase:d}=e,f=e.runtime===`fixture`,p=e.effort?.trim()||void 0,m=p?Ou(p,r):void 0,h=Gg(Wt(e,r),d),g=Du(e,r),_=Wg(e.model),v=f?r(`run.simulatedTip`):r(`node.modelTip`,{model:g,effort:m??r(`common.none`)})+(e.fast===!0?`
|
|
41
|
+
Fast`:``),y=(0,l.useMemo)(()=>Bg(e.id),[e.id]),b=t=>{t&&(t.style.viewTransitionName=`session-card`),Ia({kind:`session`,id:e.id})};return(0,q.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`&&vl(e)&&(e.preventDefault(),b(a.current))},onClick:e=>{e.target.closest(`a,button,[role='menu']`)||b(a.current)},children:[(0,q.jsx)(`span`,{className:`a-aura`,"aria-hidden":`true`,style:y}),(0,q.jsxs)(`header`,{className:`a-head`,children:[(0,q.jsx)(`span`,{className:`a-mark`,"aria-hidden":`true`,children:(0,q.jsx)(_l,{harness:e.harness,size:Zg,variant:`glyph`})}),(0,q.jsx)(`span`,{className:`o-label`,children:ku(e.harness,r)}),(0,q.jsxs)(`span`,{className:`a-room`,children:[(0,q.jsxs)(`span`,{className:`a-model`,children:[(0,q.jsx)(`span`,{className:`a-model-name`,"data-tip":v,"data-localized":f||g===r(`model.default`)||void 0,children:f?r(`run.simulated`):g}),!f&&p?(0,q.jsx)(`span`,{className:`a-effort`,"data-tip":r(`info.effort`),children:(0,q.jsx)(`span`,{children:p})}):null]}),e.fast===!0?(0,q.jsx)(`span`,{className:`a-effort`,"data-tip":v,children:(0,q.jsx)(`span`,{children:`Fast`})}):null]}),e.attention?.length?(0,q.jsx)(t_,{items:e.attention}):null,e.messages.pending>0?(0,q.jsxs)(`span`,{className:`a-flag`,"data-tone":`blue`,"data-tip":`${r(`node.pending`,{n:e.messages.pending})}\n${r(`node.pendingTip`)}`,children:[(0,q.jsx)(J,{name:`send`,size:11}),e.messages.pending]}):e.counters.interventions>0?(0,q.jsxs)(`span`,{className:`a-flag`,"data-tip":r(`node.interventionsTip`),children:[(0,q.jsx)(J,{name:`hand`,size:11}),e.counters.interventions]}):null,(0,q.jsx)(cu,{items:()=>Pu(e,r),label:r(`node.menu`),className:`a-menu`,glyph:(0,q.jsxs)(`span`,{className:`a-dots`,"aria-hidden":`true`,children:[(0,q.jsx)(`i`,{}),(0,q.jsx)(`i`,{}),(0,q.jsx)(`i`,{})]}),onOpenChange:s})]}),(0,q.jsx)(`div`,{className:`a-inset`,children:(0,q.jsxs)(`div`,{className:`a-row`,"data-han-title":/^\s*\p{Script=Han}/u.test(e.title)||void 0,children:[(0,q.jsx)(Xg,{family:_,simulated:f,tip:v}),(0,q.jsxs)(`div`,{className:`a-text`,children:[(0,q.jsxs)(`div`,{className:`a-line`,children:[(0,q.jsx)(`a`,{className:`a-title`,href:ma({kind:`session`,id:e.id}),"data-tip":e.title,onClick:e=>e.stopPropagation(),children:e.title}),(0,q.jsx)(n_,{summary:e})]}),(0,q.jsx)(`div`,{className:`a-sub`,"data-tip":h,children:(0,q.jsx)(`span`,{children:h},h)})]})]})})]})});function i_({engine:e,zoom:t,moved:n,onReset:r}){let i=G(),a=Math.round(t*100);return(0,q.jsxs)(`div`,{className:`canvas-scale`,role:`group`,"aria-label":i(`dock.zoom`),"data-scene-ui":!0,children:[(0,q.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,q.jsx)(J,{name:`minus`,size:13})}),(0,q.jsxs)(`span`,{className:`scale-value num`,children:[a,`%`]}),(0,q.jsx)(`button`,{type:`button`,className:`scale-btn`,"aria-label":i(`scene.zoomIn`),"data-tip":i(`scene.zoomIn`),onClick:()=>e.zoomBy(1.2),children:(0,q.jsx)(J,{name:`plus`,size:13})}),(0,q.jsx)(`span`,{className:`scale-sep`,"aria-hidden":`true`}),(0,q.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,q.jsx)(J,{name:`fit`,size:13})}),(0,q.jsx)(`button`,{type:`button`,className:`scale-btn`,"aria-label":i(`scene.resetLayout`),"data-tip":i(`scene.resetLayoutTip`),onClick:r??(()=>e.resetLayout()),children:(0,q.jsx)(J,{name:`refresh`,size:13})})]})}var a_={top:`arrowUp`,right:`arrowRight`,bottom:`arrowDown`,left:`arrowLeft`},o_={top:`edgeHint.top`,right:`edgeHint.right`,bottom:`edgeHint.bottom`,left:`edgeHint.left`},s_=4,c_=1600,l_=18,u_=.01,d_=[`--edge-top`,`--edge-x`,`--edge-y`,`--edge-stack`];function f_(e,t,n){let r=e/2,i=16+r,a=t-16-r;if(i>a)return;let o=t/2,s=e=>n.every(t=>e+r<=t.left-16+u_||e-r>=t.right+16-u_);return[o,...n.flatMap(e=>[e.left-16-r,e.right+16+r])].map(e=>Math.min(a,Math.max(i,e))).filter(s).sort((e,t)=>Math.abs(e-o)-Math.abs(t-o))[0]}function p_(e,t,n,r){let i=r;for(let r=0;r<=n.length;r++){let r=t.height-i-e.height,a=n.filter(t=>t.top-16<r+e.height&&t.bottom+16>r);if(a.length===0)return{bottom:i,center:void 0};let o=f_(e.width,t.width,a);if(o!==void 0)return{bottom:i,center:Math.abs(o-t.width/2)<.5?void 0:o};i=t.height-Math.min(...a.map(e=>e.top))+16}return{bottom:i,center:void 0}}function m_(e,t,n,r,i){let a=e.height/2,o=Math.min(t.height-16,...i.filter(e=>e.left-16<n.right&&e.right+16>n.left).map(e=>e.top-16)),s=Math.max(0,r)+16+a,c=o-a,l=t.height/2,u=c<s?s:Math.min(c,Math.max(s,l));return Math.abs(u-l)<.5?void 0:u}function h_(e,t,n){let r=e.ownerDocument,i=[],a=e=>e.flatMap(e=>{i.push(e);let n=e.getBoundingClientRect();if(n.width<=0||n.height<=0)return[];let r={left:n.left-t.left,top:n.top-t.top,right:n.right-t.left,bottom:n.bottom-t.top};return r.right>0&&r.left<t.width&&r.bottom>0&&r.top<t.height?[r]:[]}),o=[...n?.querySelectorAll(`.ws-head`)??[],...r.querySelectorAll(`.ws-topbar`)],s=[...n?.querySelectorAll(`.canvas-scale, .arrange`)??[],...r.querySelectorAll(`.status-notices[data-place="floating"]`)];return{header:Math.max(0,...a(o).map(e=>e.bottom)),blockers:a(s),watch:i}}function g_(e){let t=e.closest(`.scene`),n=t?.querySelector(`.arrange-wrap`)??e.ownerDocument.querySelector(`.dock-wrap`),r=e.getBoundingClientRect(),i;if(n){let t=Number.parseFloat(getComputedStyle(n).rowGap)||0,a=r.bottom-n.getBoundingClientRect().top;i=Math.max(0,a)+t,e.style.setProperty(`--edge-stack`,`${i}px`)}else e.style.removeProperty(`--edge-stack`);let a=[...e.querySelectorAll(`.edge-hint`)];for(let e of a)for(let t of d_)e.style.removeProperty(t);let o=n?[e,n]:[e];if(a.length===0||r.width<=0||r.height<=0)return o;let s=h_(e,r,t);o.push(...s.watch);let c=Number.parseFloat(getComputedStyle(e).getPropertyValue(`--scene-top`))||0;for(let e of a){let t=e.getBoundingClientRect(),n={width:t.width,height:t.height||32},a=e.dataset.edge;if(a===`top`){let t=s.header+16;s.header>0&&t>c&&e.style.setProperty(`--edge-top`,`${t}px`)}else if(a===`bottom`){let t=i??l_,a=p_(n,r,s.blockers,t);a.bottom!==t&&e.style.setProperty(`--edge-stack`,`${a.bottom}px`),a.center!==void 0&&e.style.setProperty(`--edge-x`,`${a.center}px`)}else{let i=m_(n,r,{left:t.left-r.left,right:t.right-r.left},s.header,s.blockers);i!==void 0&&e.style.setProperty(`--edge-y`,`${i}px`)}}return o}function __({engine:e}){let t=G(),n=(0,l.useSyncExternalStore)(e.arrivals.subscribe,e.arrivals.getHints),r=B(W,e=>e.sessions),i=(0,l.useRef)(null),a=(0,l.useRef)(void 0),o=(0,l.useRef)(new Map),[s,c]=(0,l.useState)(``);(0,l.useLayoutEffect)(()=>{let e=i.current;if(!e)return;let t=new ResizeObserver(()=>o()),n=new MutationObserver(()=>o()),r=[],o=()=>{let i=g_(e);if(i.length===r.length&&i.every((e,t)=>e===r[t]))return;r=i,t.disconnect(),n.disconnect();for(let e of i)t.observe(e);let a=e.closest(`.scene`);a&&n.observe(a,{childList:!0});let o=e.closest(`.app`);o&&n.observe(o,{childList:!0});for(let e of i)e.matches(`.arrange-wrap`)?n.observe(e,{childList:!0}):e.matches(`.status-notices`)&&n.observe(e,{attributes:!0,attributeFilter:[`style`]})};return a.current=o,o(),window.addEventListener(`resize`,o),()=>{a.current=void 0,window.removeEventListener(`resize`,o),t.disconnect(),n.disconnect()}},[]),(0,l.useEffect)(()=>{let e=o.current;return()=>{for(let[t,n]of e)clearTimeout(n),t.removeAttribute(`data-landed`);e.clear()}},[]);let u=new Map;for(let e of Object.values(r))u.set(Mn(e.id),e);let d=n.flatMap(e=>{let n=e.ids.flatMap(e=>u.get(e)??[]),r=n[0];if(!r)return[];let i=t(o_[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,s_).map(e=>`${e.title} · ${Vt(e.phase,t)}`);return n.length>s_&&o.push(t(`edgeHint.more`,{n:n.length-s_})),o.push(t(n.length===1?`edgeHint.goOne`:`edgeHint.goNearest`)),[{edge:e.edge,count:n.length,label:a,tip:o.join(`
|
|
42
|
+
`)}]}),f=d.map(e=>`${e.edge}:${e.count>99?`99+`:e.count}`).join(`,`);(0,l.useLayoutEffect)(()=>{a.current?.()},[f]);let p=d.reduce((e,t)=>e+t.count,0),m=(0,l.useRef)(0),h=d.map(e=>e.label).join(`. `);(0,l.useEffect)(()=>{p>m.current?c(h):p===0&&c(``),m.current=p},[p,h]);let g=(t,n)=>{let r=e.arrivals.go(t),a=i.current?.closest(`.scene`),s=r===void 0?void 0:[...a?.querySelectorAll(`[data-node-id]`)??[]].find(e=>e.dataset.nodeId===r);s&&(clearTimeout(o.current.get(s)),s.setAttribute(`data-landed`,``),o.current.set(s,setTimeout(()=>{s.removeAttribute(`data-landed`),o.current.delete(s)},c_)),n.detail===0&&s.focus({preventScroll:!0}))};return(0,q.jsxs)(`div`,{className:`edge-hints`,ref:i,children:[d.map(e=>(0,q.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=>g(e.edge,t),children:[(0,q.jsx)(J,{name:a_[e.edge],size:15}),e.count>1?(0,q.jsx)(`span`,{className:`edge-hint-count num`,"aria-hidden":`true`,children:e.count>99?`99+`:e.count}):null]},e.edge)),(0,q.jsx)(`span`,{className:`sr-only`,"aria-live":`polite`,children:s})]})}var v_={w:456,h:156,originW:156,originH:66,agentW:196,agentH:66};function y_(){let e=G(),t=(v_.h-v_.originH)/2,n={x:v_.originW,y:t+v_.originH/2},r=v_.w-v_.agentW,i={x:r,y:v_.agentH/2},a={x:r,y:v_.h-v_.agentH/2},o=[ri(n,i),ri(n,a)];return(0,q.jsxs)(`div`,{className:`empty`,"data-scene-ui":!0,children:[(0,q.jsxs)(`div`,{className:`ghost`,style:{width:v_.w,height:v_.h},"aria-hidden":`true`,children:[(0,q.jsx)(`svg`,{width:v_.w,height:v_.h,children:o.map((e,t)=>(0,q.jsx)(`path`,{className:`pipe-tube`,"data-phase":`idle`,d:e,fill:`none`},t))}),(0,q.jsxs)(`div`,{className:`ghost-node ghost-origin`,style:{left:0,top:t,width:v_.originW,height:v_.originH},children:[(0,q.jsx)(`span`,{className:`ghost-mark`,children:(0,q.jsx)(_l,{harness:`codex`,size:18,variant:`bare`})}),(0,q.jsxs)(`span`,{className:`ghost-lines`,children:[(0,q.jsx)(`i`,{style:{width:`64%`}}),(0,q.jsx)(`i`,{style:{width:`40%`}})]})]}),[[`cursor`,0],[`pi`,v_.h-v_.agentH]].map(([e,t])=>(0,q.jsxs)(`div`,{className:`ghost-node ghost-agent`,style:{left:r,top:t,width:v_.agentW,height:v_.agentH},children:[(0,q.jsx)(`span`,{className:`ghost-mark`,children:(0,q.jsx)(_l,{harness:e,size:30})}),(0,q.jsxs)(`span`,{className:`ghost-lines`,children:[(0,q.jsx)(`i`,{style:{width:`72%`}}),(0,q.jsx)(`i`,{style:{width:`46%`}})]})]},e))]}),(0,q.jsx)(`h2`,{className:`empty-title`,children:e(`empty.title`)}),(0,q.jsx)(`p`,{className:`empty-sub`,children:e(`empty.sub`)})]})}var b_=14.4,x_=(0,l.memo)(function({folder:e,engine:t}){let n=G(),r=(0,l.useRef)(null),i=jn(e.key);(0,l.useLayoutEffect)(()=>{let e=r.current;return e?t.register(i,e):void 0},[t,i]);let a=(0,l.useMemo)(()=>yl(t,i),[t,i]),o=ar(e.path),s=or(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(`
|
|
43
|
+
`);return(0,q.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,q.jsxs)(`header`,{className:`o-head`,children:[(0,q.jsx)(`span`,{className:`a-mark`,children:(0,q.jsx)(J,{name:`folder`,size:b_})}),(0,q.jsx)(`span`,{className:`o-label`,children:n(`folder.head`)}),c>1?(0,q.jsx)(`span`,{className:`o-count`,"data-tip":n(`folder.usedBy`,{n:c}),children:n(`folder.count`,{n:c})}):null]}),(0,q.jsxs)(`div`,{className:`o-body`,children:[(0,q.jsxs)(`div`,{className:`o-main`,children:[(0,q.jsx)(J,{name:`folder`,size:13,className:`o-ico`}),(0,q.jsx)(`span`,{className:`o-text`,children:o})]}),s?(0,q.jsx)(`span`,{className:`o-sub`,children:(0,q.jsx)(`bdi`,{dir:`ltr`,children:s})}):null]})]})}),S_=[`staged`,`unstaged`,`untracked`,`conflicted`],C_=(0,l.memo)(function({worktree:e,entry:t,engine:n}){let r=G(),i=bo(),a=(0,l.useRef)(null),o=An(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)(()=>yl(n,o),[n,o]),d=Bt(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=jt(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=S_.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} (${At(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(`
|
|
44
|
+
`),C=(e,t)=>`${r(`git.upstream`)}: ${p?.name??``} · ${r(t,{n:e})}`;return(0,q.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,q.jsxs)(`header`,{className:`o-head`,children:[(0,q.jsx)(`span`,{className:`a-mark`,children:(0,q.jsx)(J,{name:`git`,size:12.6})}),(0,q.jsx)(`span`,{className:`o-label`,children:r(`git.head`)}),(0,q.jsx)(`span`,{className:`a-model`,children:d}),p&&(p.ahead>0||p.behind>0)||c?(0,q.jsxs)(`span`,{className:`o-count g-sync num`,children:[p&&p.ahead>0?(0,q.jsxs)(`span`,{className:`g-chip`,"data-tip":C(p.ahead,`git.ahead`),children:[(0,q.jsx)(J,{name:`arrowUp`,size:10,strokeWidth:2.4}),p.ahead]}):null,p&&p.behind>0?(0,q.jsxs)(`span`,{className:`g-chip`,"data-tip":C(p.behind,`git.behind`),children:[(0,q.jsx)(J,{name:`arrowDown`,size:10,strokeWidth:2.4}),p.behind]}):null,c?(0,q.jsx)(`span`,{className:`g-chip g-stale`,"data-tip":r(`git.stale`,{time:y}),children:(0,q.jsx)(J,{name:`clock`,size:11})}):null]}):null]}),(0,q.jsxs)(`div`,{className:`o-body`,children:[(0,q.jsxs)(`div`,{className:`o-main`,children:[(0,q.jsx)(J,{name:`branch`,size:13,className:`o-ico`}),(0,q.jsx)(`span`,{className:`o-text`,children:g})]}),(0,q.jsx)(`span`,{className:`o-sub`,children:f?(0,q.jsxs)(q.Fragment,{children:[(0,q.jsx)(`span`,{className:`g-sha num`,children:h}),f.subject]}):r(`git.noCommits`)}),(0,q.jsx)(`span`,{className:`o-title`,"data-kind":_?`attention`:void 0,children:v})]})]})});function w_({hidden:e,onShowAll:t}){let n=G();return(0,q.jsxs)(`div`,{className:`empty`,"data-idle":!0,"data-scene-ui":!0,children:[(0,q.jsx)(`h2`,{className:`empty-title`,children:n(`idle.title`)}),(0,q.jsx)(`p`,{className:`empty-sub`,children:n(`idle.sub`,{n:e})}),(0,q.jsx)(`div`,{className:`empty-actions`,children:(0,q.jsxs)(`button`,{type:`button`,className:`btn btn--primary`,onClick:t,children:[(0,q.jsx)(J,{name:`eye`,size:15,strokeWidth:2}),n(`idle.showAll`)]})})]})}async function T_(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:Na(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 E_(e){return T_(e,async e=>{let t=await L.cancel(e);return yo(t.summary),t.interrupted||t.cancelledQueued>0?`ok`:`idle`})}function D_(e){return T_(e,async e=>(yo((await L.stop(e)).summary),`ok`))}function O_(e){return T_(e,async e=>(await L.remove(e),ho(e),`ok`))}function k_(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??``;Aa(o,n(`batch.result`,{action:e,ok:r.length,idle:i.length,failed:a.length,reason:s}),a.length>0?6e3:4200)}function A_(e,t){let n=W.get().sessions;return e.flatMap(({id:e})=>{let r=n[e];return r!==void 0&&t(r)?[e]:[]})}function j_({engine:e,count:t,sessions:n,canUndo:r,canRedo:i,t:a,announce:o,archiveSupported:s=!1}){let c=Co(),l=(e,n)=>()=>{o(n()?a(`arrange.done`,{action:e,n:t}):a(`arrange.unchanged`,{action:e}))},u=xo.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=So.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(ju),y=n.filter(Mu),b=n.filter(Nu),x=s?Cu(n,Object.values(W.get().sessions)):void 0,S=x?[{id:`archive`,label:a(`ctx.archiveSelected`,{n:x.changed.length}),icon:`archive`,disabled:x.changed.length===0||Vl(),disabledReason:x.changed.length===0?x.blocked?Kl(x.blocked,a):a(`archive.nothing`):a(`archive.busy`),onSelect:()=>Yl(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:()=>{nl(_.join(`
|
|
45
|
+
`)).then(e=>Aa(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=A_(v,ju);e.length!==0&&E_(e).then(e=>k_(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:()=>lo({title:a(`batch.stopTitle`,{n:y.length}),body:a(`batch.stopBody`,{active:y.filter(e=>Gt(e.phase)).length,skipped:n.length-y.length}),confirmLabel:a(`batch.stopConfirm`,{n:y.length}),onConfirm:async()=>{let e=A_(y,Mu);e.length!==0&&k_(a(`menu.stopSession`),await D_(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:()=>lo({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=A_(b,Nu);e.length!==0&&k_(a(`menu.remove`),await O_(e),a)}})}),g}function M_(e){let t=Mn(``);return e.startsWith(t)?e.slice(t.length):void 0}function N_(e,t){return e.length===t.length&&e.every(e=>t.includes(e))}function P_({engine:e}){let t=G(),n=B(W,e=>e.sessions),r=B(W,e=>e.collapsedOrigins),i=B(W,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=M_(e.nodeId);if(t!==void 0){if(W.get().sessions[t]===void 0)return!1}else{let t=Tu(e.nodeId);if(t===void 0||!ht(Object.values(W.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+14,y:t.top+14}}),!0}),[e]);let g=c?.request.scope===`node`?M_(c.request.nodeId):void 0,_=c?.request.scope===`node`?Tu(c.request.nodeId):void 0,v=(0,l.useMemo)(()=>_===void 0?void 0:ht(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`&&!N_(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 dl.set({nodeId:c.request.nodeId}),()=>dl.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,context:a.el};if(a.scope===`node`&&_!==void 0){let e=Eu({key:_,sessions:Object.values(n),collapsed:r,t,announce:f,archiveSupported:i});e&&(C=(0,q.jsx)(su,{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,q.jsx)(su,{entries:Pu(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=M_(e),i=t===void 0?void 0:n[t];i&&r.push(i)}C=(0,q.jsx)(su,{entries:j_({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,q.jsxs)(q.Fragment,{children:[C,(0,q.jsx)(`span`,{className:`sr-only`,"aria-live":`polite`,children:d})]})}function F_({summary:e}){let t=G(),n=Nt(e,Et());return(0,q.jsxs)(`span`,{className:`slist-state`,"data-kind":`running`,children:[(0,q.jsx)(`i`,{className:`a-run`,"aria-hidden":`true`}),(0,q.jsx)(`span`,{className:`num`,children:n===void 0?Vt(e.phase,t):Dt(n)})]})}function I_({items:e}){let t=G(),n=Jt(e,Et(),t);return(0,q.jsxs)(`span`,{className:`a-flag`,"data-tone":`amber`,"data-tip":n,role:`img`,"aria-label":n,children:[(0,q.jsx)(J,{name:`alert`,size:11}),e.length>1?e.length:null]})}function L_({summary:e}){let t=G(),{phase:n}=e;if(n===`running`)return(0,q.jsx)(F_,{summary:e});if(n===`done`){let r=e.lastRun?.durationMs;return(0,q.jsx)(`span`,{className:`slist-state num`,"data-kind":`done`,children:r===void 0?Vt(n,t):y(r)})}return(0,q.jsx)(`span`,{className:`slist-state`,"data-kind":n,children:Vt(n,t)})}function R_({sessions:e,empty:t}){let n=G(),r=bo(),i=(0,l.useMemo)(()=>cl(e),[e]);return i.length===0?t?(0,q.jsx)(`div`,{className:`slist-empty-wrap`,children:t}):(0,q.jsx)(`div`,{className:`slist-empty`,children:n(`view.listEmpty`)}):(0,q.jsx)(`div`,{className:`slist`,role:`list`,children:i.map(({session:e,depth:t})=>{let i=e.runtime===`fixture`,a=Du(e,n),o=e.effort?.trim()||void 0,s=Wg(e.model),c=Wt(e,n),l=(e.attention?.length??0)>0,u=e.counters.files;return(0,q.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']`)||Ia({kind:`session`,id:e.id})},children:[t>0?(0,q.jsx)(`span`,{className:`slist-branch`,"aria-hidden":`true`}):null,(0,q.jsx)(`div`,{className:`slist-avatar`,children:(0,q.jsx)(Xg,{family:s,simulated:i,size:20})}),(0,q.jsxs)(`div`,{className:`slist-main`,children:[(0,q.jsxs)(`div`,{className:`slist-top`,children:[(0,q.jsx)(`a`,{className:`slist-title`,href:ma({kind:`session`,id:e.id}),onClick:e=>e.stopPropagation(),children:e.title}),l?(0,q.jsx)(I_,{items:e.attention}):null,u>0?(0,q.jsxs)(`span`,{className:`slist-files num`,"data-tip":n(`view.filesChanged`,{n:u}),children:[(0,q.jsx)(J,{name:`file`,size:11}),u]}):null]}),(0,q.jsx)(`div`,{className:`slist-sub`,"data-tip":c,children:c})]}),(0,q.jsxs)(`div`,{className:`slist-spec`,children:[(0,q.jsxs)(`span`,{className:`slist-harness`,children:[(0,q.jsx)(_l,{harness:e.harness,size:11,variant:`bare`}),(0,q.jsx)(`span`,{children:ku(e.harness,n)})]}),(0,q.jsx)(`span`,{className:`slist-model`,"data-tip":a,children:i?n(`run.simulated`):a}),!i&&o?(0,q.jsx)(`span`,{className:`a-effort`,children:(0,q.jsx)(`span`,{children:o})}):null]}),(0,q.jsxs)(`div`,{className:`slist-meta`,children:[(0,q.jsx)(L_,{summary:e}),(0,q.jsx)(`time`,{className:`slist-time num`,dateTime:e.createdAt,children:At(e.createdAt,r,!0)})]}),(0,q.jsx)(`div`,{className:`slist-menu`,children:(0,q.jsx)(cu,{items:()=>Pu(e,n),label:n(`node.menu`),className:`a-menu`,glyph:(0,q.jsxs)(`span`,{className:`a-dots`,"aria-hidden":`true`,children:[(0,q.jsx)(`i`,{}),(0,q.jsx)(`i`,{}),(0,q.jsx)(`i`,{})]})})})]},e.id)})})}var z_=[`staged`,`unstaged`,`untracked`,`conflicted`];function B_({entry:e}){let t=G(),n=bo(),{git:r,stale:i}=e,a=Bt(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=jt(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=z_.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} (${At(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(`
|
|
46
|
+
`);return(0,q.jsxs)(`span`,{className:`ws-ctx-item ws-ctx-git`,"data-stale":i?``:void 0,"data-tip":g,children:[(0,q.jsx)(J,{name:`git`,size:11.5,className:`ws-ctx-git-mark`}),(0,q.jsx)(`span`,{className:`ws-ctx-branch`,children:u}),l?(0,q.jsx)(`span`,{className:`ws-ctx-sha mono`,children:l}):null,(0,q.jsx)(`span`,{className:`ws-ctx-status`,"data-kind":d?`attention`:void 0,children:f}),s&&s.ahead>0?(0,q.jsxs)(`span`,{className:`ws-ctx-sync num`,children:[(0,q.jsx)(J,{name:`arrowUp`,size:9.5,strokeWidth:2.4}),s.ahead]}):null,s&&s.behind>0?(0,q.jsxs)(`span`,{className:`ws-ctx-sync num`,children:[(0,q.jsx)(J,{name:`arrowDown`,size:9.5,strokeWidth:2.4}),s.behind]}):null,i?(0,q.jsx)(J,{name:`clock`,size:11,className:`ws-ctx-stale`}):null]})}function V_({scope:e,workspace:t,git:n,allWorkspaces:r,scopedSessions:i,allSessions:a,variant:o=`overlay`}){let s=G(),c=bo(),u=B(W,e=>e.hideIdle),d=B(W,e=>e.viewMode),f=qi(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=B(W,e=>e.archivedCount!==void 0),_=B(Bl,e=>e.busy>0),v=g&&e.kind!==`active`&&i.length>0,y=(0,l.useMemo)(()=>v?Su(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?Kl(y.blocked,s):s(`archive.nothing`):[s(`archive.finishedTip`,{n:b}),y.kept>0&&y.blocked?Kl(y.blocked,s):void 0].filter(Boolean).join(`
|
|
47
|
+
`),C=()=>{if(e.kind===`origin`&&t){let{origin:e}=t,r=_t(e),i=t.workspace,a=yt(e),o=[t.hostTitle?`${t.hostTitle}`:void 0,s(`origin.tipHead`,{host:r}),...bt(e,s),xt(e,s),`${s(`origin.started`)}: ${jt(t.startedAt,c)}`].filter(Boolean).join(`
|
|
48
|
+
`);return(0,q.jsxs)(`div`,{className:`ws-head-line`,children:[i?(0,q.jsxs)(`span`,{className:`ws-ctx-primary`,"data-tip":o,children:[(0,q.jsx)(J,{name:`folder`,size:13,className:`ws-ctx-ico`}),(0,q.jsx)(`span`,{className:`ws-ctx-folder`,children:Bt(i)})]}):a?(0,q.jsxs)(`span`,{className:`ws-ctx-primary ws-ctx-unknown`,"data-tip":o,children:[(0,q.jsx)(J,{name:`folder`,size:13,className:`ws-ctx-ico`}),(0,q.jsx)(`span`,{children:s(`origin.workspaceUnknown`)})]}):(0,q.jsxs)(`span`,{className:`ws-ctx-primary`,"data-tip":o,children:[(0,q.jsx)(Sl,{host:e.host,label:e.hostLabel,size:13,fit:!0}),(0,q.jsx)(`span`,{className:`ws-ctx-folder`,children:e.kind===`user`?s(`origin.user`):r})]}),n?(0,q.jsxs)(q.Fragment,{children:[(0,q.jsx)(`span`,{className:`ws-ctx-sep`,"aria-hidden":`true`}),(0,q.jsx)(B_,{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,q.jsxs)(`div`,{className:`ws-head-line`,children:[(0,q.jsxs)(`span`,{className:`ws-ctx-primary`,children:[(0,q.jsx)(J,{name:`zap`,size:13,className:`ws-ctx-ico`}),(0,q.jsx)(`span`,{className:`ws-ctx-folder`,children:s(`rail.active`)})]}),(0,q.jsx)(`span`,{className:`ws-ctx-sep`,"aria-hidden":`true`}),(0,q.jsx)(`span`,{className:`ws-ctx-item num`,children:s(`view.activeSubtitle`,{running:e,total:t,n})})]})}return(0,q.jsxs)(`div`,{className:`ws-head-line`,children:[(0,q.jsxs)(`span`,{className:`ws-ctx-primary`,children:[(0,q.jsx)(J,{name:`layers`,size:13,className:`ws-ctx-ico`}),(0,q.jsx)(`span`,{className:`ws-ctx-folder`,children:s(`rail.all`)})]}),(0,q.jsx)(`span`,{className:`ws-ctx-sep`,"aria-hidden":`true`}),(0,q.jsx)(`span`,{className:`ws-ctx-item num`,children:s(`view.allSubtitle`,{n:r.length,total:a.length})})]})},w=e=>{d!==e&&$a(e)};return(0,q.jsxs)(`header`,{className:`ws-head`,"data-mode":o,"data-scene-ui":!0,children:[C(),(0,q.jsxs)(`div`,{className:`ws-head-actions`,children:[p?(0,q.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:()=>Ya(!u),children:[(0,q.jsx)(J,{name:`eyeOff`,size:13}),(0,q.jsx)(`span`,{className:`ws-action-label`,children:s(`view.workingOnly`)}),u&&f>0?(0,q.jsx)(`span`,{className:`ws-filter-count num`,children:f>99?`99+`:f}):null]}):null,y?(0,q.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||Yl(y)},children:[(0,q.jsx)(J,{name:`archive`,size:13}),(0,q.jsx)(`span`,{className:`ws-action-label`,children:s(`archive.finished`)}),b>0?(0,q.jsx)(`span`,{className:`ws-filter-count num`,children:b>99?`99+`:b}):null]}):null,a.length>0?(0,q.jsxs)(`div`,{className:`ws-view-switch`,role:`group`,"aria-label":s(`view.mode`),children:[(0,q.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,q.jsx)(J,{name:`canvas`,size:13}),(0,q.jsx)(`span`,{className:`ws-action-label`,children:s(`view.canvas`)})]}),(0,q.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,q.jsx)(J,{name:`list`,size:13}),(0,q.jsx)(`span`,{className:`ws-action-label`,children:s(`view.list`)})]})]}):null]})]})}function H_(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 U_(e,t){if(!t)return;let n=e.get(t);if(n)return n;let r=tr(t);for(let[t,n]of e)if(tr(t)===r)return n}function W_(){let e=G();return(0,q.jsxs)(`div`,{className:`empty`,"data-idle":``,children:[(0,q.jsx)(`h2`,{className:`empty-title`,children:e(`view.activeEmptyTitle`)}),(0,q.jsx)(`p`,{className:`empty-sub`,children:e(`view.activeEmptySub`)})]})}var G_=new Set;function K_({engine:e,scope:t,workspaces:n,gitState:r,onCamera:i,onPositions:a}={}){let o=G(),s=B(W,e=>e.sessions),c=B(W,e=>e.viewMode),u=B(W,e=>e.hideIdle),d=B(W,e=>e.collapsedOrigins),f=t!==void 0,p=t??{kind:`all`},m=Zi(p),h=f&&c===`list`,g=(0,l.useMemo)(()=>Object.values(s),[s]),_=(0,l.useMemo)(()=>n??ra(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:aa(g,p),[g,p]),b=p.kind!==`active`&&u,x=p.kind===`all`?d:G_,S=H_(y),C=(0,l.useRef)(y);C.current=y;let w=(0,l.useRef)(null),T=Pm(y,b,(0,l.useCallback)(e=>Im(w.current,e),[]),x),[E,D]=(0,l.useState)(void 0),[O,k]=(0,l.useState)(void 0),[A,j]=(0,l.useState)(1),[ee,te]=(0,l.useState)(!1),ne=(0,l.useCallback)((e,t)=>{j(e.k),te(t),i?.(e,t)},[i]);(0,l.useLayoutEffect)(()=>{if(h)return;let e=w.current;if(!e)return;let t=()=>{let t=nn(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 re=E?.w,M=E?.h,N=Xt(E),ie=(0,l.useMemo)(()=>Cm(C.current),[S]),ae=km(r?[]:ie.targets),oe=r??ae,se=p.kind!==`all`,ce=(0,l.useMemo)(()=>p.kind===`origin`?U_(oe.entries,v?.workspace):void 0,[p.kind,oe.entries,v?.workspace]),le=(0,l.useMemo)(()=>Om(ie.workspaceOf,oe.entries),[ie,oe.entries]),ue=(0,l.useMemo)(()=>JSON.stringify(le.map(e=>[e.key,e.origins])),[le]),de=(0,l.useMemo)(()=>{let e=new Map;for(let[t,n]of JSON.parse(ue))for(let r of n)e.set(r,t);return e},[ue]),fe=(0,l.useMemo)(()=>new Map(le.map(e=>[An(e.key),e])),[le]),P=(0,l.useMemo)(()=>e??new Fg,[e]),pe=(0,l.useSyncExternalStore)(P.subscribeFill,()=>P.getFill(m)),me=(0,l.useCallback)((e,t=!1)=>Gi(C.current,{...re!==void 0&&M!==void 0?{area:{w:re,h:M}}:{},git:de,...se?{hideContextNodes:!0}:{},...f?{grid:!0,...e===void 0?{}:{zoom:e}}:{},...t?{rearrange:!0}:{},...T.drawn?{visible:T.drawn}:{},...x.size>0?{collapsed:x}:{}}),[S,re,M,de,se,f,T.key,x]),he=(0,l.useMemo)(()=>me(pe),[me,pe]),F=(0,l.useMemo)(()=>{let e;return()=>{let t=P.getCamera().k,n=e?.zoom===t?e.plan:me(t,!0);P.resetLayout(n),e={zoom:P.getCamera().k,plan:n}}},[P,me]),I=(0,l.useMemo)(()=>ht(y),[y]),ge=(0,l.useMemo)(()=>mt(y,x).size,[y,x]),_e=(0,l.useMemo)(()=>{let e=new Map(ir(ie.workspaceOf).map(e=>[e.key,e.origins]));return he.folders.map(t=>({...t,origins:e.get(t.key)??t.origins}))},[he,ie]);(0,l.useLayoutEffect)(()=>{if(h)return;let e=new Set([...x].map(kn));Lm(w.current,Xi(he,T.leaving,e))},[h,he,T.leavingKey,x]);let ve=(0,l.useRef)(null),ye=(0,l.useRef)(null),be=(0,l.useRef)(null),xe=(0,l.useRef)(a);xe.current=a,(0,l.useLayoutEffect)(()=>{if(h)return;let e=w.current,t=ve.current,n=ye.current,r=be.current;if(e&&t&&n&&r)return P.mount({viewport:e,world:t,pipes:{tube:n,dots:r},onCamera:ne,onPositions:e=>xe.current?.(e),onSelection:k}),()=>P.unmount()},[P,h,ne]),(0,l.useLayoutEffect)(()=>{h||P.switchSpace(m)},[P,m,h]);let Se=(0,l.useRef)(!1);(0,l.useLayoutEffect)(()=>{h?Se.current=!1:E&&(se||Se.current||!oe.pending)&&(Se.current=!0,P.setLayout(he,!1,E))},[P,he,E,oe.pending,se,h]);let Ce=(0,l.useRef)(Da.lastFocusId);(0,l.useEffect)(()=>{let e=setTimeout(()=>{Da.lastFocusId=void 0,Ce.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=W.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`)P.selectAll();else if(t===`z`)e.shiftKey?P.redo():P.undo();else if(t===`y`&&e.ctrlKey)P.redo();else return;e.preventDefault()}else e.key===`/`&&f?(e.preventDefault(),to()):h||(e.key===`Escape`&&!document.querySelector(`[role="menu"]`)?P.clearSelection():e.key===`0`||e.key===`f`?P.fit(!0,f):e.key===`+`||e.key===`=`?P.zoomBy(1.2):(e.key===`-`||e.key===`_`)&&P.zoomBy(1/1.2))}};return document.addEventListener(`keydown`,e),()=>document.removeEventListener(`keydown`,e)},[P,h,f]);let we=(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]),Te=(0,l.useMemo)(()=>{if(!b)return y;let e=qi(y).visible;return y.filter(t=>e.has(t.id))},[y,b]);if(h){let e=g.length===0?(0,q.jsx)(y_,{}):p.kind===`active`&&y.length===0?(0,q.jsx)(W_,{}):b&&Te.length===0&&y.length>0?(0,q.jsx)(w_,{hidden:y.length,onShowAll:()=>Ya(!1)}):void 0;return(0,q.jsxs)(`div`,{className:`list-stage`,children:[(0,q.jsx)(V_,{scope:p,workspace:v,git:ce,allWorkspaces:_,scopedSessions:y,allSessions:g,variant:`flow`}),(0,q.jsx)(`div`,{className:`list-scroll`,children:(0,q.jsx)(R_,{sessions:Te,empty:e})})]},`list`)}let Ee=g.length===0,De=!Ee&&p.kind===`active`&&y.length===0,Oe=!Ee&&!De&&T.drawn?.size===0&&he.origins.length===0;return(0,q.jsxs)(`div`,{className:`scene`,ref:w,"data-empty":Ee?``:void 0,"data-compact":N?``:void 0,"data-scoped":f?``:void 0,"data-grid":he.grid?``:void 0,children:[f?(0,q.jsx)(V_,{scope:p,workspace:v,git:ce,allWorkspaces:_,scopedSessions:y,allSessions:g,variant:`overlay`}):(0,q.jsx)(`div`,{className:`canvas-meta`,"data-scene-ui":!0,children:(0,q.jsx)(`h1`,{children:`Ensemble`})}),(0,q.jsxs)(`div`,{className:`scene-world`,ref:ve,children:[(0,q.jsxs)(`div`,{className:`scene-plates`,children:[(0,q.jsx)(`svg`,{className:`pipes`,width:`1`,height:`1`,"aria-hidden":`true`,children:(0,q.jsx)(`g`,{className:`pipes-tube`,ref:ye})}),he.origins.map(e=>(0,q.jsx)(Cl,{origin:e.origin,count:e.count,running:e.running,startedAt:e.startedAt,hostTitle:e.hostTitle,compact:N,folderNode:e.folder!==void 0||p.kind===`origin`,collapsed:x.has(e.origin.key),hidden:I.get(e.origin.key)??e.count,engine:P},e.origin.key)),_e.map(e=>(0,q.jsx)(x_,{folder:e,engine:P},e.id)),he.nodes.map(e=>{let t=e.kind===`git`?fe.get(e.id):void 0;return t?(0,q.jsx)(C_,{worktree:t.key,entry:t.entry,engine:P},e.id):null}),we.map(e=>(0,q.jsx)(r_,{summary:e,engine:P,morph:e.id===Ce.current},e.id))]}),(0,q.jsx)(`svg`,{className:`pipes`,width:`1`,height:`1`,"aria-hidden":`true`,children:(0,q.jsx)(`g`,{className:`pipes-dots`,ref:be})})]}),Ee?(0,q.jsx)(y_,{}):De?(0,q.jsx)(W_,{}):Oe?(0,q.jsx)(w_,{hidden:y.length,onShowAll:()=>Ya(!1)}):null,(0,q.jsx)(`span`,{className:`sr-only`,"aria-live":`polite`,children:T.hidden>0?o(ge>0?`scene.srHiddenAny`:`scene.srHidden`,{n:y.length-T.hidden,hidden:T.hidden}):o(`scene.sr`,{n:y.length})}),(0,q.jsx)(`span`,{className:`sr-only`,"aria-live":`polite`,children:O===void 0?``:o(`scene.selected`,{n:O})}),(0,q.jsx)(__,{engine:P}),f?(0,q.jsxs)(q.Fragment,{children:[(0,q.jsx)(`div`,{className:`arrange-wrap`,"data-scene-ui":!0,children:(0,q.jsx)(ol,{engine:P})}),!Ee&&!De?(0,q.jsx)(i_,{engine:P,zoom:A,moved:ee,onReset:F}):null]}):null,(0,q.jsx)(P_,{engine:P})]},`canvas`)}var q_=160,J_=`a[href],button:not([disabled]),input:not([disabled]),select:not([disabled]),textarea:not([disabled]),[tabindex]:not([tabindex="-1"])`,Y_=`data-modal-inert`,X_=`.overlay,[data-menu-popup],[role="menu"]`,Z_=0,Q_;function $_(e){e instanceof HTMLElement&&(e.inert=Z_>0&&e.hasAttribute(Y_)&&e.closest(X_)===null)}function ev(e){for(let t of e)if(t.type===`attributes`)$_(t.target);else for(let e of t.addedNodes)if(e instanceof Element){e.hasAttribute(Y_)&&$_(e);for(let t of e.querySelectorAll(`[${Y_}]`))$_(t)}}function tv(){Q_||typeof MutationObserver>`u`||(Q_=new MutationObserver(ev),Q_.observe(document.body,{childList:!0,subtree:!0,attributes:!0,attributeFilter:[Y_]}))}function nv(){if(!Q_)return;let e=Q_.takeRecords();Q_.disconnect(),Q_=void 0,ev(e)}function rv(e){Z_=Math.max(0,Z_+(e?1:-1));for(let e of document.querySelectorAll(`[${Y_}]`))$_(e);Z_>0?tv():nv()}var iv=[];function av(e){e.key!==`Escape`||e.defaultPrevented||e.isComposing||(e.preventDefault(),iv[iv.length-1]?.())}var ov={top:0,right:0,bottom:0,left:0},sv=e=>e>1?Math.round(e):0;function cv(){if(typeof window>`u`)return ov;let e=window.visualViewport;if(!e)return ov;let t=document.documentElement,n=t.clientWidth||window.innerWidth,r=t.clientHeight||window.innerHeight;return{top:sv(e.offsetTop),left:sv(e.offsetLeft),right:sv(n-e.offsetLeft-e.width),bottom:sv(r-e.offsetTop-e.height)}}function lv(e){let t=typeof window>`u`?null:window.visualViewport;return t?(t.addEventListener(`resize`,e),t.addEventListener(`scroll`,e),()=>{t.removeEventListener(`resize`,e),t.removeEventListener(`scroll`,e)}):()=>void 0}function uv({className:e,children:t,...n}){let r=(0,l.useRef)(null),i=(0,l.useRef)(null),[a,o]=(0,l.useState)({top:!1,bottom:!1}),s=(0,l.useCallback)(()=>{let e=r.current;if(!e)return;let t=e.scrollTop>.5,n=e.scrollHeight-e.clientHeight-e.scrollTop>1;o(e=>e.top===t&&e.bottom===n?e:{top:t,bottom:n})},[]);return(0,l.useLayoutEffect)(s),(0,l.useEffect)(()=>{let e=r.current;if(!e||typeof ResizeObserver>`u`)return;let t=new ResizeObserver(s);return t.observe(e),i.current&&t.observe(i.current),()=>t.disconnect()},[s]),(0,q.jsx)(`div`,{...n,ref:r,className:e?`modal-scroll ${e}`:`modal-scroll`,"data-edge-top":a.top?``:void 0,"data-edge-bottom":a.bottom?``:void 0,onScroll:s,children:(0,q.jsx)(`div`,{ref:i,className:`modal-scroll-inner`,children:t})})}function dv({open:e,onClose:t,label:n,width:r,children:i,initialFocus:a}){let{present:o,closing:s}=Fp(e,q_),c=(0,l.useRef)(null),d=(0,l.useRef)(null),f=(0,l.useRef)(null);(0,l.useEffect)(()=>{if(!e)return;iu(),f.current=document.activeElement,rv(!0);let t=d.current;return((a?t?.querySelector(a):null)??t?.querySelector(J_)??t)?.focus({preventScroll:!0}),()=>{rv(!1);let e=f.current;e&&e.isConnected&&e.focus()}},[e,a]),(0,l.useEffect)(()=>{if(!o)return;let e=c.current;if(!e)return;let t=()=>{let t=cv();for(let n of[`top`,`right`,`bottom`,`left`])e.style.setProperty(`--vv-${n}`,`${t[n]}px`)};t(),window.addEventListener(`resize`,t);let n=lv(t);return()=>{window.removeEventListener(`resize`,t),n()}},[o]);let p=(0,l.useRef)(t);p.current=t,(0,l.useEffect)(()=>{if(!e)return;let t=()=>p.current();return iv.push(t),iv.length===1&&document.addEventListener(`keydown`,av),()=>{iv.splice(iv.indexOf(t),1),iv.length===0&&document.removeEventListener(`keydown`,av)}},[e]);let m=(0,l.useCallback)(e=>{if(e.key===`Escape`&&!e.nativeEvent.isComposing){e.stopPropagation(),e.preventDefault(),t();return}if(e.key!==`Tab`)return;let n=d.current;if(!n)return;let r=[...n.querySelectorAll(J_)].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,u.createPortal)((0,q.jsxs)(`div`,{ref:c,className:`overlay`,"data-closing":s?``:void 0,onKeyDown:m,children:[(0,q.jsx)(`div`,{className:`overlay-backdrop`,onClick:t,"aria-hidden":`true`}),(0,q.jsx)(`div`,{ref:d,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 fv(){let e=G(),t=B(W,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),uo()}}};return(0,q.jsx)(dv,{open:t!==void 0,onClose:()=>!r&&uo(),label:a?.title??e(`confirm.label`),width:400,initialFocus:`[data-autofocus]`,children:a?(0,q.jsxs)(`div`,{className:`confirm modal-frame`,children:[(0,q.jsxs)(`div`,{className:`confirm-head modal-head`,children:[(0,q.jsx)(`div`,{className:`confirm-icon`,"data-tone":a.tone??`default`,children:(0,q.jsx)(J,{name:a.tone===`danger`?`trash`:`info`,size:20})}),(0,q.jsx)(`h2`,{className:`confirm-title`,children:a.title})]}),a.body?(0,q.jsx)(uv,{className:`confirm-body`,children:a.body}):null,(0,q.jsxs)(`div`,{className:`confirm-actions modal-foot`,children:[(0,q.jsx)(`button`,{type:`button`,className:`btn btn--ghost`,"data-autofocus":!0,disabled:r,onClick:uo,children:e(`common.cancel`)}),(0,q.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,q.jsx)(el,{size:16}):null,a.confirmLabel]})]})]}):null})}var pv={info:`info`,success:`check`,warn:`alert`,error:`alert`};function mv({id:e,action:t}){return(0,q.jsx)(`button`,{type:`button`,className:`link-btn toast-action`,onClick:()=>{ja(e),t.run()},children:t.label})}var hv=16,gv=`.canvas-scale, .arrange, .composer`,_v=.5,vv=.4;function yv(e,t){let n;for(let r of document.querySelectorAll(gv)){let i=r.getBoundingClientRect();i.width<=0||i.height<=0||i.bottom<=0||i.top>=t||i.right<=e.left||i.left>=e.right||getComputedStyle(r).visibility!==`hidden`&&(n=n===void 0?i.top:Math.min(n,i.top))}return n}function bv(e,t,n){let r=cv(),i=document.documentElement.clientHeight||window.innerHeight,a=hv+r.bottom;if(!t){let t=yv(e.getBoundingClientRect(),i);t!==void 0&&(a=Math.max(a,Math.round(i-t)+hv))}let o=hv+r.right,s=i-r.top-r.bottom,c=i-r.top-hv-a,l=Math.max(0,Math.floor(Math.min(c,s*(t?vv:_v)))),u=`${a}|${o}|${l}`;return u!==n&&(e.style.setProperty(`--toast-bottom`,`${a}px`),e.style.setProperty(`--toast-right`,`${o}px`),e.style.setProperty(`--toast-max`,`${l}px`)),e.scrollHeight>e.clientHeight+1?e.setAttribute(`data-overflow`,``):e.removeAttribute(`data-overflow`),u}function xv(e,t,n){(0,l.useLayoutEffect)(()=>{let r=e.current;if(!r)return;if(t.length===0){r.removeAttribute(`data-overflow`);return}let i=``,a=0,o=()=>{i=bv(r,n,i)},s=()=>{a||=requestAnimationFrame(()=>{a=0,o()})},c=typeof ResizeObserver>`u`?void 0:new ResizeObserver(s),l=()=>{if(c){c.disconnect(),c.observe(r);for(let e of r.children)c.observe(e);for(let e of document.querySelectorAll(gv))c.observe(e)}},u=typeof MutationObserver>`u`?void 0:new MutationObserver(()=>{l(),s()});o(),l(),u?.observe(document.querySelector(`.app`)??document.body,{childList:!0,subtree:!0,attributes:!0,attributeFilter:[`class`,`hidden`,`data-view`,`data-rail`]}),window.addEventListener(`resize`,s);let d=lv(s);return()=>{a&&cancelAnimationFrame(a),c?.disconnect(),u?.disconnect(),window.removeEventListener(`resize`,s),d()}},[e,t,n])}function Sv(){let e=G(),t=B(W,e=>e.toasts),n=B(W,ka),r=n?t.filter(e=>e.dialog===n):[],i=n!==void 0&&r.length===0,a=r.length>0?r:t,o=(0,l.useRef)(null),s=a.at(-1)?.id;return xv(o,a,n!==void 0),(0,l.useLayoutEffect)(()=>{let e=o.current,t=e?.lastElementChild;e&&t instanceof HTMLElement&&e.hasAttribute(`data-overflow`)&&(e.scrollTop=t.offsetHeight>=e.clientHeight?t.offsetTop:e.scrollHeight-e.clientHeight)},[s]),(0,u.createPortal)((0,q.jsx)(`div`,{ref:o,className:`toasts`,"data-background":i?``:void 0,inert:i,role:`region`,"aria-label":e(`toast.region`),children:a.map(t=>(0,q.jsxs)(`div`,{className:`toast`,"data-tone":t.tone,role:t.tone===`error`?`alert`:`status`,children:[(0,q.jsx)(J,{name:pv[t.tone],size:15,strokeWidth:t.tone===`success`?2.2:1.7}),(0,q.jsx)(`span`,{className:`toast-text`,children:t.text}),t.action?(0,q.jsx)(mv,{id:t.id,action:t.action}):null,(0,q.jsx)(`button`,{type:`button`,className:`icon-btn icon-btn--bare`,"aria-label":e(`common.dismiss`),onClick:()=>ja(t.id),children:(0,q.jsx)(J,{name:`close`,size:13,strokeWidth:2})})]},t.id))}),document.body)}function Cv(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`}var wv=[`all`,`workspaces`,`sessions`];function Tv({button:e,filter:t,onPick:n,onGlobal:r,onClose:i}){let a=G(),o=(0,l.useRef)(null),s=(0,l.useRef)(i);s.current=i;let c=(0,l.useMemo)(()=>Dc(()=>o.current,()=>s.current(!1)),[]);(0,l.useLayoutEffect)(()=>{let t=o.current;if(!t)return;let n=!0;return wc({reference:e,floating:t,placement:`bottom-start`,gap:8,onPosition:({hidden:e})=>{if(e)c.leave();else if(t.setAttribute(`data-ready`,``),n){n=!1;let e=document.activeElement;e instanceof HTMLElement&&t.contains(e)&&e.scrollIntoView({block:`nearest`})}}})},[e,c]),(0,l.useEffect)(()=>{let e=o.current;(e?.querySelector(`[aria-checked="true"]`)??e?.querySelector(`[role^="menuitem"]`))?.focus({preventScroll:!0})},[]),(0,l.useEffect)(()=>{let t=t=>{let n=t.target;n instanceof Node&&(o.current?.contains(n)||e.contains(n)||s.current(!1))},n=()=>s.current(!1);document.addEventListener(`pointerdown`,t,!0),window.addEventListener(`blur`,n);let r=Ec(()=>o.current,()=>c.leave());return()=>{document.removeEventListener(`pointerdown`,t,!0),window.removeEventListener(`blur`,n),r(),c.cancel()}},[e,c]);let d=e=>{if(e.nativeEvent.isComposing)return;if(e.key===`Escape`||e.key===`Tab`){e.preventDefault(),e.stopPropagation(),i(!0);return}let t=[...e.currentTarget.querySelectorAll(`[role^="menuitem"]`)];if(t.length===0)return;let n=t.findIndex(e=>e===document.activeElement),r;if(e.key===`ArrowDown`)r=n<0?0:(n+1)%t.length;else if(e.key===`ArrowUp`)r=n<0?t.length-1:(n-1+t.length)%t.length;else if(e.key===`Home`)r=0;else if(e.key===`End`)r=t.length-1;else return;e.preventDefault(),e.stopPropagation(),t[r]?.focus()},f={all:a(`switcher.scopeAll`),workspaces:a(`switcher.scopeWorkspaces`),sessions:a(`switcher.scopeSessions`)};return(0,u.createPortal)((0,q.jsxs)(`div`,{ref:o,className:`switcher-scope-menu`,role:`menu`,onKeyDown:d,children:[wv.map(e=>(0,q.jsxs)(`button`,{type:`button`,role:`menuitemradio`,"aria-checked":t===e,className:`switcher-scope-option`,"data-active":t===e?``:void 0,onClick:()=>n(e),children:[(0,q.jsx)(`span`,{children:f[e]}),t===e?(0,q.jsx)(J,{name:`check`,size:12}):null]},e)),(0,q.jsx)(`div`,{className:`switcher-scope-sep`,role:`separator`}),(0,q.jsx)(`button`,{type:`button`,role:`menuitem`,className:`switcher-scope-option`,onClick:()=>r(`active`),children:(0,q.jsx)(`span`,{children:a(`rail.active`)})}),(0,q.jsx)(`button`,{type:`button`,role:`menuitem`,className:`switcher-scope-option`,onClick:()=>r(`all`),children:(0,q.jsx)(`span`,{children:a(`rail.all`)})})]}),e.closest(`.overlay`)??document.body)}function Ev({workspaces:e,sessions:t,currentScope:n,branches:r}){let i=G(),a=bo(),o=B(W,e=>e.switcherOpen),s=B(W,e=>e.recentOrigins),[c,u]=(0,l.useState)(``),[d,f]=(0,l.useState)(`all`),[p,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),[w,T]=(0,l.useState)(null),E=(0,l.useRef)(!1);E.current=g,(0,l.useEffect)(()=>{_(!1),o&&(u(``),f(`all`),h(!1),y(0),x(Date.now()))},[o]);let D=(0,l.useCallback)(e=>{_(!1),e&&w?.focus()},[w]),O=(0,l.useMemo)(()=>da({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]),k=(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`?O.filter(e=>e.kind===`workspace`):O.filter(e=>e.kind!==`view`);return p?e.filter(e=>e.kind===`workspace`?e.item.working>0||e.item.attention>0:e.kind===`session`?Gt(e.session.phase)||e.session.phase===`ready`||(e.session.attention?.length??0)>0:!1):e},[O,d,p,c,t]);(0,l.useEffect)(()=>{y(0)},[c,d,p]);let A=k.length===0?-1:Math.min(v,k.length-1);(0,l.useEffect)(()=>{!o||A<0||E.current||(S.current?.querySelector(`[data-sw-index="${A}"]`))?.scrollIntoView({block:`nearest`})},[o,A]);let j=e=>{no(),e.kind===`workspace`?La({kind:`origin`,key:e.item.key}):e.kind===`view`?La(e.scope):Ia({kind:`session`,id:e.session.id})},ee=e=>{if(!e.nativeEvent.isComposing){if(e.key===`ArrowDown`)e.preventDefault(),k.length>0&&y(e=>(e+1)%k.length);else if(e.key===`ArrowUp`)e.preventDefault(),k.length>0&&y(e=>(e-1+k.length)%k.length);else if(e.key===`Enter`){e.preventDefault();let t=A>=0?k[A]:void 0;t&&j(t)}}},te=i(d===`workspaces`?`switcher.scopeWorkspaces`:d===`sessions`?`switcher.scopeSessions`:`switcher.scopeAll`),ne=A>=0?k[A]:void 0;return(0,q.jsx)(dv,{open:o,onClose:no,label:i(`switcher.title`),width:620,initialFocus:`.switcher-input`,children:(0,q.jsxs)(`div`,{className:`switcher`,onKeyDown:e=>{e.key===`Escape`&&g&&!e.nativeEvent.isComposing&&(e.stopPropagation(),e.preventDefault(),D(!0))},children:[(0,q.jsxs)(`div`,{className:`switcher-bar`,children:[(0,q.jsxs)(`div`,{className:`switcher-scope-wrap`,children:[(0,q.jsxs)(`button`,{ref:T,type:`button`,className:`switcher-scope`,"aria-haspopup":`menu`,"aria-expanded":g,onClick:()=>_(e=>!e),onKeyDown:e=>{e.key!==`ArrowDown`&&e.key!==`ArrowUp`||g||e.nativeEvent.isComposing||(e.preventDefault(),_(!0))},children:[(0,q.jsx)(`span`,{children:te}),(0,q.jsx)(J,{name:`chevronDown`,size:12,strokeWidth:2})]}),g&&w?(0,q.jsx)(Tv,{button:w,filter:d,onPick:e=>{f(e),_(!1),C.current?.focus()},onGlobal:e=>{no(),La({kind:e})},onClose:D}):null]}),(0,q.jsx)(`input`,{ref:C,type:`text`,className:`switcher-input`,value:c,onChange:e=>u(e.target.value),onKeyDown:ee,placeholder:i(`switcher.placeholder`),"aria-label":i(`switcher.title`),role:`combobox`,"aria-expanded":`true`,"aria-controls":`ensemble-switcher-list`,"aria-activedescendant":ne?`sw-${ne.id}`:void 0,autoComplete:`off`,spellCheck:!1}),(0,q.jsx)(`button`,{type:`button`,className:`switcher-filter-btn`,"aria-label":i(`switcher.activeOnly`),"aria-pressed":p,"data-active":p?``:void 0,"data-tip":i(`switcher.activeOnly`),onClick:()=>h(e=>!e),children:(0,q.jsx)(J,{name:`filterLines`,size:15})})]}),(0,q.jsx)(`div`,{id:`ensemble-switcher-list`,ref:S,className:`switcher-list`,role:`listbox`,"aria-label":i(`switcher.title`),children:k.length===0?(0,q.jsx)(`div`,{className:`switcher-empty`,children:i(`switcher.empty`)}):k.map((e,t)=>{let n=t===A;if(e.kind===`workspace`){let{item:r}=e,o=_t(r.origin),s=r.hostTitle?r.hostTitle:r.origin.kind===`user`?`${i(`origin.user`)} · ${At(r.startedAt,a,!0)}`:r.origin.sessionRef?.id?`${o} · ${m(r.origin.sessionRef.id,8)}`:`${o} · ${At(r.startedAt,a,!0)}`,c=r.workspace?Bt(r.workspace):void 0,l=Cv(r.latestAt,b,a);return(0,q.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:()=>j(e),children:[r.running>0?(0,q.jsx)(`i`,{className:`a-run switcher-live-dot`,"aria-hidden":`true`}):null,(0,q.jsx)(`span`,{className:`switcher-primary`,children:s}),c?(0,q.jsxs)(`span`,{className:`switcher-dir`,children:[(0,q.jsx)(J,{name:`folder`,size:12.5,className:`switcher-dir-ico`}),(0,q.jsx)(`span`,{children:c})]}):null,(0,q.jsx)(`span`,{className:`switcher-age num`,children:l})]},e.id)}if(e.kind===`session`){let{session:r}=e,i=r.cwd?Bt(r.cwd):e.workspaceTitle,o=Cv(r.updatedAt||r.createdAt,b,a),s=Gt(r.phase);return(0,q.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:()=>j(e),children:[s?(0,q.jsx)(`i`,{className:`a-run switcher-live-dot`,"aria-hidden":`true`}):null,(0,q.jsx)(`span`,{className:`switcher-primary`,children:r.title}),i?(0,q.jsxs)(`span`,{className:`switcher-dir`,children:[(0,q.jsx)(J,{name:`folder`,size:12.5,className:`switcher-dir-ico`}),(0,q.jsx)(`span`,{children:i})]}):null,(0,q.jsx)(`span`,{className:`switcher-age num`,children:o})]},e.id)}return null})})]})})}var Dv={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 Ov(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 kv(e,t,n){if(e.altKey||e.ctrlKey||e.metaKey||e.shiftKey||e.nativeEvent.isComposing)return;let r=Object.hasOwn(Dv,e.key)?Dv[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[Ov(r.to,a,t.length,n.wrap??!1)];return o?.focus(),o}var Av=`ensemble.settings.harnessOrder.v1`,jv;function Mv(){if(jv)return[...jv];try{let e=JSON.parse(localStorage.getItem(Av)??`[]`);return Array.isArray(e)?[...new Set(e.filter(e=>typeof e==`string`&&e.length>0))]:[]}catch{return[]}}function Nv(e,t){let n=new Map(e.map(e=>[e.id,e])),r=[];for(let e of t){let t=n.get(e);t&&(r.push(t),n.delete(e))}return[...r,...n.values()]}function Pv(e,t=[]){let n=new Set(e),r=[...n],i=new Set([...Mv(),...t]),a=0,o=Array.from(i,e=>n.has(e)?r[a++]:e);o.push(...r.slice(a));try{localStorage.setItem(Av,JSON.stringify(o)),jv=void 0}catch{jv=[...o]}return o}function Fv(e){return e.defaultModel??e.models.find(e=>e.isDefault)?.id}function Iv(e,t){return e!==void 0&&Object.hasOwn(e,t)?e[t]:void 0}function Lv(e,t){return t?e.filter(e=>t.includes(e)):[...e]}function Rv(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=Lv(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 zv(e){let t=t=>{let n=Rv(t,Iv(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 Bv(e){return e.allowedEfforts!==void 0&&Object.keys(e.allowedEfforts).length>0}function Vv(e,t){return e.models.some(e=>e.id===t)||Iv(e.allowedEfforts,t)!==void 0}function Hv(e){if(e.modelSettingsIssue)return{kind:`blocked`,issue:e.modelSettingsIssue,models:[],defaultModel:void 0};let t=Fv(e),n=zv(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 Uv(e,t){let n=zv(e).find(e=>e.model.id===t);if(n)return n;if(!e.models.some(e=>e.id===t))return Rv({id:t,label:t},Iv(e.allowedEfforts,t))}function Wv(e,t,n){let r=Hv(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||Bv(e);if(i&&o&&(a===void 0||!Vv(e,a)))return{ok:!1,reason:`model_unverified`,allowed:r.models.map(e=>e.id)};let s=n;if(a!==void 0){let t=Uv(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}}}function Gv(e){return e===`codex`}function Kv(e,t){if(!Gv(e.id))return`harness`;let n=e.models.find(e=>e.id===t)?.supportsFast;return n===!0?void 0:n===!1?`model`:`unverified`}function qv(e,t){return Kv(e,t)===void 0}function Jv(e,t,n){let r=t.model??Hv(e).defaultModel,i=Kv(e,r);if(n===!0){if(i===`harness`)return{ok:!1,reason:`fast_unsupported`,why:i,target:r,fastModels:[]};if(e.fastMode===`disabled`)return{ok:!1,reason:`fast_disabled`,target:r};if(i)return{ok:!1,reason:`fast_unsupported`,why:i,target:r,fastModels:Hv(e).models.filter(e=>e.supportsFast===!0).map(e=>e.id)}}return Gv(e.id)?{ok:!0,fast:n??(e.fastMode===`on`&&i===void 0),target:r}:{ok:!0,fast:void 0,target:r}}var Yv={invalid_entry:`harness.modelSettings.invalid_entry`,unreadable_file:`harness.modelSettings.unreadable_file`},Xv={missing:`harness.defaultStale.missing`,not_allowed:`harness.defaultStale.not_allowed`};function Zv(e){let t=e?.fastMode??`off`;return e===void 0?{allowed:null,efforts:{},userDefaultModel:null,fastMode:t}:e.modelSettingsIssue?{allowed:[],efforts:{},userDefaultModel:null,fastMode:t}:{allowed:e.allowedModels??null,efforts:e.allowedEfforts??{},userDefaultModel:e.userDefaultModel??null,fastMode:t}}function Qv(e,t){return{...Zv(e),...t?.sent,...t?.queued}}function $v(e){return e!==void 0&&(e.allowed!==void 0||e.efforts!==void 0||e.userDefaultModel!==void 0)}function ey(e){return $v(e?.sent)||$v(e?.queued)}function ty(e,t){return Qv(e,t).fastMode}function ny(e,t){return Qv(e,t).userDefaultModel}function ry(e,t){return Qv(e,t).allowed}function iy(e,t){return Qv(e,t).efforts}function ay(e,t,n){let r=W.get(),i=r.harnesses.find(t=>t.id===e);if(!i)return;let a=i.models.map(e=>e.id),o=new Set(ry(i,r.pendingModelSettings[e])??a);for(let e of t)n?o.add(e):o.delete(e);cy(e,{allowed:[...new Set([...a,...o])].filter(e=>o.has(e))})}function oy(e,t,n,r){let i=W.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=iy(a,i.pendingModelSettings[e]),c=Iv(s,t),l=new Set(Lv(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));cy(e,{efforts:{...s,[t]:[...u,...d]}})}function sy(e,t){let{harnesses:n,pendingModelSettings:r}=W.get(),i=n.find(t=>t.id===e);if(!i)return;let a=iy(i,r[e]);if(!Object.hasOwn(a,t))return;let{[t]:o,...s}=a;cy(e,{efforts:s})}function cy(e,t){let{pendingModelSettings:n,harnesses:r}=W.get(),i=r.find(t=>t.id===e);if(i?.modelSettingsIssue===`unreadable_file`)return;let a={...t.allowed===void 0?{}:{allowed:t.allowed},...t.efforts===void 0?{}:{efforts:t.efforts},...t.userDefaultModel===void 0?{}:{userDefaultModel:t.userDefaultModel},...t.fastMode===void 0?{}:{fastMode:t.fastMode}};if(Object.keys(a).length===0)return;let o=n[e];if($v(a)){let e={...Qv(i,o),...a};e.allowed!==null&&e.userDefaultModel!==null&&!e.allowed.includes(e.userDefaultModel)&&(a.userDefaultModel=null)}W.set({pendingModelSettings:{...n,[e]:{...o,queued:{...o?.queued,...a}}}}),o===void 0&&fy(e)}function ly(e,t){cy(e,{userDefaultModel:t})}function uy(e,t){cy(e,{fastMode:t})}function dy(e){let{pendingModelSettings:t}=W.get();if(t[e]===void 0)return;let{[e]:n,...r}=t;W.set({pendingModelSettings:r})}async function fy(e){for(;;){let{pendingModelSettings:t,lang:n,harnesses:r}=W.get(),i=t[e]?.queued;if(i===void 0){dy(e);return}W.set({pendingModelSettings:{...t,[e]:{sent:i}}});let a={...Zv(r.find(t=>t.id===e)),...i},o=await go(()=>$v(i)?L.setAllowedModels(e,a.allowed,a.efforts,i.userDefaultModel,i.fastMode):L.setAllowedModels(e,void 0,void 0,void 0,i.fastMode),nt(n,`harness.modelsSaveFailed`));if(o&&_o(o.harness),W.get().pendingModelSettings[e]?.queued===void 0){dy(e);return}}}var py=`[role="radio"][aria-checked="true"]`,my=`[role="radio"]`,hy=new Set([`left`,`top`,`width`,`height`]),gy=(e,t)=>e.left===t.left&&e.top===t.top&&e.width===t.width&&e.height===t.height,_y=e=>({left:e.offsetLeft,top:e.offsetTop,width:e.offsetWidth,height:e.offsetHeight}),vy=()=>typeof window.matchMedia==`function`&&window.matchMedia(`(prefers-reduced-motion: reduce)`).matches,yy=class{mark;group;reduced;clock;observer;watched=new Set;disposed=!1;selected;laid;glidedAt=-1/0;onEnd=e=>{e.target===this.mark&&hy.has(e.propertyName)&&(this.mark.removeAttribute(`data-glide`),this.glidedAt=-1/0)};constructor(e,t,n=vy,r=()=>performance.now()){this.mark=e,this.group=t,this.reduced=n,this.clock=r,this.mark.addEventListener(`transitionend`,this.onEnd),this.observer=typeof ResizeObserver>`u`?void 0:new ResizeObserver(()=>this.sync())}sync(){if(this.disposed)return;let e=this.group.querySelector(py)??void 0,t=this.selected;if(this.selected=e,this.watch(),!e){this.hide();return}let n=_y(e);if(n.width<=0||n.height<=0){this.hide();return}let r=this.laid;r&&gy(r,n)||(r&&t&&t!==e&&!this.reduced()?this.glide(n):r&&t===e&&this.clock()-this.glidedAt<300?(this.glidedAt=this.clock(),this.write(n)):this.snap(n))}dispose(){this.disposed=!0,this.mark.removeEventListener(`transitionend`,this.onEnd),this.observer?.disconnect(),this.watched.clear()}snap(e){this.mark.removeAttribute(`data-glide`),this.glidedAt=-1/0,this.write(e)}glide(e){this.mark.offsetWidth,this.mark.setAttribute(`data-glide`,``),this.glidedAt=this.clock(),this.write(e)}write(e){let t=this.mark.style;t.left=`${e.left}px`,t.top=`${e.top}px`,t.width=`${e.width}px`,t.height=`${e.height}px`,this.laid=e,this.mark.hasAttribute(`data-show`)||this.mark.setAttribute(`data-show`,``)}hide(){this.mark.removeAttribute(`data-glide`),this.mark.removeAttribute(`data-show`),this.glidedAt=-1/0,this.laid=void 0}watch(){let e=this.observer;if(!e)return;let t=new Set([this.group,...this.group.querySelectorAll(my)]);for(let n of this.watched)t.has(n)||e.unobserve(n);for(let n of t)this.watched.has(n)||e.observe(n,{box:`border-box`});this.watched=t}};function by(){let e=(0,l.useRef)(null),t=(0,l.useRef)(void 0);return(0,l.useLayoutEffect)(()=>{let n=e.current,r=n?.parentElement;if(!n||!r)return;let i=new yy(n,r);return t.current=i,()=>{i.dispose(),t.current=void 0}},[]),(0,l.useLayoutEffect)(()=>{t.current?.sync()}),(0,q.jsx)(`span`,{ref:e,className:`segmented-mark`,"aria-hidden":`true`})}var xy=[`off`,`on`,`disabled`],Sy={off:`harness.fastMode.off`,on:`harness.fastMode.on`,disabled:`harness.fastMode.disabled`},Cy={off:`harness.fastNote.off`,on:`harness.fastNote.on`,disabled:`harness.fastNote.disabled`};function wy(e){return e.fastMode!==void 0||e.models.some(e=>e.supportsFast===!0)}function Ty({info:e}){let t=G(),n=B(W,t=>t.pendingModelSettings[e.id]),r=(0,l.useId)(),i=(0,l.useRef)(null);if(!wy(e)||e.modelSettingsIssue===`unreadable_file`)return null;let a=ty(e,n),o=e.models.some(e=>e.supportsFast===!0);return(0,q.jsx)(Ad,{title:t(`harness.fast`),defaultOpen:!0,className:`fast-section`,children:(0,q.jsxs)(`div`,{className:`fast-body`,children:[(0,q.jsxs)(`div`,{ref:i,className:`segmented setting-control fast-control`,role:`radiogroup`,"aria-label":t(`harness.fastGroup`,{name:ku(e.id,t)}),"aria-describedby":r,onKeyDown:e=>{kv(e,[...i.current?.querySelectorAll(`[role="radio"]`)??[]],{axis:`both`,wrap:!0})?.click()},children:[(0,q.jsx)(by,{}),xy.map(n=>(0,q.jsx)(`button`,{type:`button`,role:`radio`,"aria-checked":a===n,tabIndex:a===n?0:-1,"data-active":a===n?``:void 0,onClick:()=>{a!==n&&uy(e.id,n)},children:t(Sy[n])},n))]}),(0,q.jsxs)(`div`,{className:`fast-notes`,id:r,children:[(0,q.jsx)(`p`,{className:`fast-note`,children:t(Cy[a])}),o?null:(0,q.jsx)(`p`,{className:`fast-note`,children:t(`harness.fastNoModel`)})]})]})})}function Ey(e){return e===`needs_setup`?`amber`:e===`unavailable`?`red`:`neutral`}function Dy(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 Oy=8,ky=e=>Wg({resolved:e.id,label:e.label});function Ay({models:e,selection:t,marked:n,children:r}){let i=G(),[a]=(0,l.useState)(()=>new Set(t));if(e.length===0)return(0,q.jsx)(`p`,{className:`muted mcfg-empty`,children:i(`harness.modelNoMatch`)});let o=[...e.filter(e=>a.has(e.id)),...e.filter(e=>!a.has(e.id))];return(0,q.jsx)(`ul`,{className:`mlist`,"data-scroll":!0,"data-marked":n?``:void 0,onKeyDown:e=>{e.target.classList.contains(`mrow-input`)&&kv(e,[...e.currentTarget.querySelectorAll(`.mrow-input`)],{axis:`vertical`})},children:o.map(r)})}function jy({info:e}){let t=G(),n=B(W,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=ry(e,n),p=iy(e,n),m=ny(e,n),h=ey(n)?void 0:e.modelSettingsIssue;if(r.length===0||h===`unreadable_file`)return(0,q.jsx)(Ad,{title:t(`harness.modelsAllowed`),defaultOpen:!0,children:(0,q.jsx)(`p`,{className:`muted`,role:h?`status`:void 0,children:t(h?Yv[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=>ky(e)!==void 0),S=Fv(e),C=Hv({...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,`-`),k=`${d}-default`,A=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}),j=(t,n)=>{A(t.filter(e=>g.has(e)!==n)),s(!n&&m!==null&&t.includes(m)?m:null),ay(e.id,t,n)},ee=t=>{s(null),ly(e.id,t)},te=()=>{s(null),ly(e.id,null)},ne=e=>u(t=>{let n=new Set(t);return n.delete(e)||n.add(e),n}),re=()=>{A(r.map(e=>e.id)),s(m),cy(e.id,{allowed:[]})};return(0,q.jsxs)(Ad,{className:`mcfg-section`,title:t(`harness.modelsAllowed`),count:`${y} / ${r.length}`,defaultOpen:!0,action:(0,q.jsxs)(`span`,{className:`mcfg-bulk`,children:[_?(0,q.jsx)(`button`,{type:`button`,disabled:b===v.length,onClick:()=>j(v.map(e=>e.id),!0),children:t(`harness.selectAll`)}):(0,q.jsx)(`button`,{type:`button`,disabled:f===null,"data-tip":t(`harness.allowAllTip`),onClick:()=>{s(null),cy(e.id,{allowed:null})},children:t(`harness.allowAll`)}),(0,q.jsx)(`button`,{type:`button`,disabled:_?b===0:f?.length===0&&!h,onClick:()=>_?j(v.map(e=>e.id),!1):re(),children:t(`harness.selectNone`)})]}),children:[r.length>Oy?(0,q.jsxs)(`span`,{className:`input-wrap mcfg-filter`,children:[(0,q.jsx)(J,{name:`search`,size:14}),(0,q.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,(0,q.jsx)(Ay,{models:v,selection:f,marked:x,children:n=>{let i=g.has(n.id),a=ky(n),o=n.efforts??[],s=i&&o.length>0,l=Iv(p,n.id),u=s?Lv(o,l):[],f=s&&c.has(n.id),m=`${d}-${r.indexOf(n)}`;return(0,q.jsxs)(`li`,{className:`mitem`,"data-open":f?``:void 0,children:[(0,q.jsxs)(`div`,{className:`mline`,children:[(0,q.jsxs)(`label`,{className:`mrow`,"data-on":i?``:void 0,children:[(0,q.jsx)(`input`,{type:`checkbox`,className:`mrow-input`,checked:i,onChange:e=>j([n.id],e.currentTarget.checked)}),(0,q.jsx)(`span`,{className:`mrow-box`,"aria-hidden":`true`,children:(0,q.jsx)(J,{name:`check`,size:12,strokeWidth:3})}),x?a?(0,q.jsx)(qg,{family:a,size:14}):(0,q.jsx)(J,{name:`sparkle`,size:14,strokeWidth:1.9,className:`model-glyph`}):null,(0,q.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,q.jsx)($c,{tone:`teal`,tip:n.id===T?t(`harness.defaultPicked`):void 0,children:t(`harness.default`)}):T!==void 0&&n.id===S?(0,q.jsx)($c,{tone:`neutral`,tip:t(`harness.defaultOwnTip`),children:t(`harness.defaultOwn`)}):null,n.supportsFast===!0?(0,q.jsx)($c,{tone:`neutral`,tip:n.fastDescription?`${t(`harness.fastModelTip`)}\n${n.fastDescription}`:t(`harness.fastModelTip`),children:t(`harness.fast`)}):null]}),s?(0,q.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:()=>ne(n.id),children:[(0,q.jsx)(`span`,{children:t(`harness.effortShort`)}),(0,q.jsxs)(`span`,{className:`num`,children:[u.length,`/`,o.length]}),(0,q.jsx)(J,{name:`chevronDown`,size:12,strokeWidth:2,className:`mrow-more-chevron`})]}):null,i?(0,q.jsxs)(`label`,{className:`mpick`,"data-tip":t(T===n.id?`harness.defaultPicked`:`harness.defaultPickTip`),children:[(0,q.jsx)(`input`,{type:`radio`,className:`mpick-input`,name:k,checked:T===n.id,"aria-label":t(`harness.defaultPick`,{name:n.label}),onChange:()=>ee(n.id)}),(0,q.jsx)(`span`,{className:`mpick-dot`,"aria-hidden":`true`})]}):(0,q.jsx)(`span`,{className:`mpick`,"data-void":``,"aria-hidden":`true`})]}),f?(0,q.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,q.jsxs)(`label`,{className:`echip`,"data-on":i?``:void 0,"data-last":a?``:void 0,"data-tip":a?t(`harness.effortLast`):void 0,children:[(0,q.jsx)(`input`,{type:`checkbox`,className:`echip-input`,checked:i,"aria-disabled":a||void 0,onChange:t=>{a||oy(e.id,n.id,r,t.currentTarget.checked)}}),(0,q.jsx)(`span`,{className:`echip-text mono`,children:r})]},r)}),l===void 0?null:(0,q.jsx)(`button`,{type:`button`,className:`link-btn`,onClick:()=>sy(e.id,n.id),children:t(`harness.effortUnlimited`)})]}):null]},n.id)}}),C.kind===`empty`||h?(0,q.jsxs)(`div`,{className:`field-note field-note--amber`,role:`status`,children:[(0,q.jsx)(J,{name:`alert`,size:14}),(0,q.jsx)(`span`,{children:t(h?Yv[h]:y>0?`harness.effortsNeeded`:`harness.noneAllowed`)})]}):null,h?null:E?(0,q.jsxs)(`div`,{className:`field-note field-note--amber`,role:`status`,children:[(0,q.jsx)(J,{name:`alert`,size:14}),(0,q.jsxs)(`span`,{children:[t(Xv[E.why],{stale:O(E.id),name:O(w)}),(0,q.jsx)(`button`,{type:`button`,className:`link-btn`,onClick:te,children:t(`harness.defaultRestore`)})]})]}):o===null?T===void 0?D?(0,q.jsx)(`p`,{className:`mcfg-note`,children:t(`harness.defaultSwapped`,{name:O(w)})}):null:(0,q.jsxs)(`p`,{className:`mcfg-note`,children:[t(`harness.defaultUser`,{name:O(T)}),(0,q.jsx)(`button`,{type:`button`,className:`link-btn`,onClick:te,children:t(`harness.defaultRestore`)})]}):(0,q.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 My=[`read_only`,`full`];function Ny({info:e,now:t,open:n,onToggle:r,grip:i}){let a=G(),o=B(W,t=>t.pendingModelSettings[e.id]),s=(0,l.useId)(),c=Dy(e,a),u=e.status===`ready`||e.models.length>0||!!e.modelSettingsIssue||wy(e),d=!!c||u,f=d&&n,p=ry(e,o),m=e.models.length>0&&e.modelSettingsIssue!==`unreadable_file`,h=p===null?e.models.length:e.models.filter(e=>p.includes(e.id)).length,g=(0,q.jsxs)(q.Fragment,{children:[(0,q.jsx)(_l,{harness:e.id,size:40}),(0,q.jsxs)(`span`,{className:`hcard-title`,children:[(0,q.jsxs)(`span`,{className:`hcard-name`,children:[ku(e.id,a),e.runtime===`fixture`?(0,q.jsx)($c,{tone:`violet`,tip:a(`run.simulatedTip`),children:a(`run.simulated`)}):null]}),(0,q.jsxs)(`span`,{className:`hcard-sub`,children:[e.version?(0,q.jsx)(`span`,{className:`mono`,children:e.version}):null,e.account?(0,q.jsx)(`span`,{children:e.account}):null,e.status===`ready`||e.status===`checking`?null:(0,q.jsx)(`span`,{children:a(`harness.checkedAt`,{time:Mt(e.checkedAt,t,a)})}),m?(0,q.jsx)(`span`,{className:`num`,children:a(`harness.allowedSummary`,{n:h,total:e.models.length})}):null]})]}),(0,q.jsxs)($c,{tone:Ey(e.status),children:[(0,q.jsx)(`span`,{className:`status-pip`,"data-status":e.status,"aria-hidden":`true`}),a(`harness.status.${e.status}`)]}),d?(0,q.jsx)(J,{name:`chevronDown`,size:14,strokeWidth:2,className:`hcard-chevron`}):null]});return(0,q.jsxs)(`article`,{className:`hcard`,"data-harness-id":e.id,"data-status":e.status,"data-open":f?``:void 0,children:[(0,q.jsxs)(`div`,{className:`hcard-header-row`,children:[(0,q.jsx)(`h4`,{className:`hcard-head`,children:d?(0,q.jsx)(`button`,{type:`button`,className:`hcard-toggle`,"aria-expanded":f,"aria-controls":f?s:void 0,onClick:r,children:g}):(0,q.jsx)(`span`,{className:`hcard-toggle`,children:g})}),i]}),f?(0,q.jsxs)(`div`,{className:`hcard-panel`,id:s,children:[c?(0,q.jsxs)(`div`,{className:`hcard-setup`,"data-status":e.status,children:[(0,q.jsx)(J,{name:e.status===`needs_setup`?`info`:`alert`,size:14}),(0,q.jsxs)(`div`,{children:[(0,q.jsx)(`p`,{children:c}),e.setup?.command?(0,q.jsxs)(`div`,{className:`cmd`,children:[(0,q.jsx)(`code`,{className:`mono`,children:e.setup.command}),(0,q.jsx)(tl,{value:e.setup.command,label:a(`harness.copyCommand`),size:12})]}):null]})]}):null,u?(0,q.jsxs)(`div`,{className:`hcard-body`,children:[(0,q.jsx)(jy,{info:e}),(0,q.jsx)(Ty,{info:e}),(0,q.jsx)(Ad,{title:a(`harness.access`),defaultOpen:!1,children:(0,q.jsx)(`ul`,{className:`access-list`,children:My.map(t=>{let n=e.access[t];return(0,q.jsxs)(`li`,{children:[(0,q.jsx)(`span`,{className:`access-name`,children:a(`access.${t}`)}),n?(0,q.jsxs)(q.Fragment,{children:[(0,q.jsx)($c,{tone:n.level===`enforced`?`teal`:n.level===`advisory`?`amber`:`neutral`,tip:a(`enforce.tip.${n.level}`),children:a(`enforce.${n.level}`)}),(0,q.jsx)(`span`,{className:`access-mech`,children:n.mechanism})]}):(0,q.jsx)($c,{tone:`neutral`,children:a(`harness.accessUnsupported`)})]},t)})})})]}):null]}):null]})}function Py({name:e,first:t,last:n,onPointerDown:r,onMove:i}){let a=G(),o=(0,l.useRef)(null),[s,c]=(0,l.useState)(!1),u=(0,l.useCallback)(e=>{c(!1),e&&o.current?.focus({preventScroll:!0})},[]),d=a(`settings.executors.reorder`,{name:e});return(0,q.jsxs)(q.Fragment,{children:[(0,q.jsx)(`button`,{type:`button`,className:`hcard-grip`,ref:o,"aria-label":d,"aria-keyshortcuts":`ArrowUp ArrowDown`,"aria-haspopup":`menu`,"aria-expanded":s,"data-tip":s?void 0:a(`settings.executors.reorderHint`),onPointerDown:r,onClick:()=>c(e=>!e),onKeyDown:e=>{e.ctrlKey||e.altKey||e.metaKey||e.shiftKey||e.nativeEvent.isComposing||(e.key===`ArrowUp`||e.key===`ArrowDown`)&&(e.preventDefault(),e.stopPropagation(),i(e.key===`ArrowUp`?-1:1))}}),s&&o.current&&(0,q.jsx)(su,{label:d,anchor:{kind:`button`,el:o.current},onClose:u,entries:[{id:`up`,label:a(`settings.executors.moveUp`),icon:`arrowUp`,disabled:t,onSelect:()=>i(-1)},{id:`down`,label:a(`settings.executors.moveDown`),icon:`arrowDown`,disabled:n,onSelect:()=>i(1)}]})]})}var Fy=`transform 155ms cubic-bezier(.22,1,.36,1)`;function Iy(e,t){let n=Math.min(44,t.height/4);return n?e<t.top+n?-Math.min(1,(t.top+n-e)/n):Math.max(0,Math.min(1,(e-t.bottom+n)/n)):0}function Ly(e){let t=new AbortController,n={capture:!0,signal:t.signal};window.addEventListener(`pointerdown`,()=>t.abort(),{...n,once:!0}),window.addEventListener(`click`,n=>{n.detail!==0&&(n.composedPath().includes(e)&&(n.preventDefault(),n.stopImmediatePropagation()),t.abort())},n)}function Ry(e,t,n){let r=(0,l.useRef)(null),i=(0,l.useRef)(n);(0,l.useLayoutEffect)(()=>{i.current=n},[n]);let a=t.join(`|`);return(0,l.useEffect)(()=>()=>r.current?.(),[a]),(0,l.useCallback)((t,n)=>{let a=e.current;if(!a||r.current||t.button!==0||t.isPrimary===!1)return;let o=t.currentTarget,s=a.closest(`.settings-body`),c=Array.from(a.querySelectorAll(`:scope > .hcard`)),l=c.map(e=>e.dataset.harnessId),d=l.indexOf(n);if(!s||d<0||c.length<2)return;let f=t.pointerId,p=t.clientY,m=c.map(e=>{for(let t of e.getAnimations?.()??[])(t.id===`hcard-drag-move`||t.id===`hcard-key-move`)&&t.cancel();let{top:t,bottom:n,height:r}=e.getBoundingClientRect();return{el:e,top:t,bottom:n,height:r}}),h=m[d],g=s.scrollTop,_=window.matchMedia?.(`(prefers-reduced-motion: reduce)`)?.matches,v=p,y=!1,b=!1,x=0,S=d,C=0;function w(){let e=Math.min(m.at(-1).bottom-h.bottom,Math.max(m[0].top-h.top,v-p+s.scrollTop-g));if(S=d,e>0)for(let t=d+1;t<m.length;t++){let n=m[t];if(h.bottom+e<n.top+n.height/2)break;S=t}else for(let t=d-1;t>=0;t--){let n=m[t];if(h.top+e>n.top+n.height/2)break;S=t}m.forEach((t,n)=>{let r=0;n===d?r=e:n>d&&n<=S?r=-h.height:n<d&&n>=S&&(r=h.height);let i=r?`translateY(${r}px)`:``;t.el.style.transform!==i&&(t.el.style.transform=i)})}function T(e){if(x=0,!y||b)return;let t=Iy(v,s.getBoundingClientRect()),n=s.scrollTop,r=C?Math.min(32,e-C):16;C=e,t&&(s.scrollTop+=Math.sign(t)*Math.ceil(t*t*r*.75)),w(),s.scrollTop!==n&&(x=requestAnimationFrame(T))}function E(){y&&!x&&(x=requestAnimationFrame(T))}function D(e){if(e.pointerId===f){if(v=e.clientY,!y){if(Math.abs(v-p)<4)return;y=!0,a.dataset.sorting=``,h.el.dataset.dragging=``;for(let e of m)e.el.style.transition=e===h||_?`none`:Fy}e.preventDefault(),E()}}function O(e,t=!0){if(b||(b=!0,r.current=null,cancelAnimationFrame(x),window.removeEventListener(`pointermove`,D,!0),window.removeEventListener(`pointerup`,k,!0),window.removeEventListener(`pointercancel`,A,!0),window.removeEventListener(`keydown`,ee,!0),window.removeEventListener(`blur`,j),o.removeEventListener(`lostpointercapture`,A),s.removeEventListener(`scroll`,E),o.hasPointerCapture?.(f)&&o.releasePointerCapture(f),!y))return;e&&w();let c=t&&!_?m.map(e=>e.el.getBoundingClientRect().top):[];for(let e of m)e.el.style.transition=`none`,e.el.style.transform=``;if(delete a.dataset.sorting,delete h.el.dataset.dragging,e&&d!==S){let e=[...l];e.splice(d,1),e.splice(S,0,n),(0,u.flushSync)(()=>i.current(e))}m.forEach((e,t)=>{let n=e.el.getBoundingClientRect().top;e.el.style.transition=``;let r=c[t];r===void 0||!e.el.animate||Math.abs(r-n)<.5||e.el.animate([{transform:`translateY(${r-n}px)`},{transform:`none`}],{id:`hcard-drag-move`,duration:155,easing:`cubic-bezier(.22,1,.36,1)`})}),Ly(o),e&&document.activeElement===document.body&&o.focus({preventScroll:!0})}function k(e){e.pointerId===f&&(v=e.clientY,O(!0))}function A(e){e.pointerId===f&&O(!1)}function j(){O(!1)}function ee(e){e.key===`Escape`&&(e.preventDefault(),e.stopImmediatePropagation(),j())}if(r.current=()=>O(!1,!1),window.addEventListener(`pointermove`,D,{capture:!0,passive:!1}),window.addEventListener(`pointerup`,k,!0),window.addEventListener(`pointercancel`,A,!0),window.addEventListener(`keydown`,ee,!0),window.addEventListener(`blur`,j),o.addEventListener(`lostpointercapture`,A),s.addEventListener(`scroll`,E,{passive:!0}),o.setPointerCapture)try{o.setPointerCapture(f)}catch{}},[e])}function zy(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 By(){let e=G(),[t,n]=(0,l.useState)(!1),r=async()=>{n(!0);let t=await go(()=>L.harnesses(!0),e(`harness.refreshFailed`));n(!1),t&&(W.set({harnesses:t.harnesses}),Aa(`success`,e(`harness.refreshed`),1600))};return(0,q.jsx)(Qc,{icon:`refresh`,label:e(`harness.refresh`),onClick:()=>void r(),disabled:t,className:t?`is-spinning`:void 0})}function Vy(){let e=G(),t=B(W,e=>e.harnesses),n=Et(),r=(0,l.useRef)(null),i=(0,l.useRef)(null),[a,o]=(0,l.useState)(Mv),s=(0,l.useMemo)(()=>Nv(t,a),[t,a]),c=(0,l.useMemo)(()=>s.map(e=>e.id),[s]),[d,f]=(0,l.useState)(``),[p,m]=(0,l.useState)(void 0),h=p??new Set(c.slice(0,1)),g=(0,l.useCallback)(t=>{if(c.length===t.length&&c.every((e,n)=>e===t[n]))return;m(e=>e??new Set(c.slice(0,1))),o(Pv(t,a));let n=i.current;n&&t.includes(n)&&f(e(`settings.executors.moved`,{name:ku(n,e),position:t.indexOf(n)+1,total:t.length}))},[c,a,e]),_=Ry(r,c,g),v=(e,t)=>{let n=c.indexOf(e),a=n+t;if(!r.current||r.current.hasAttribute(`data-sorting`)||n<0||a<0||a>=c.length)return;let o=[...c];o.splice(n,1),o.splice(a,0,e);let s=[...r.current.querySelectorAll(`.hcard`)],l=window.matchMedia?.(`(prefers-reduced-motion: reduce)`)?.matches,d=l?[]:s.map(e=>e.getBoundingClientRect().top);i.current=e,(0,u.flushSync)(()=>g(o)),s.forEach((e,t)=>{if(e.getAnimations?.().filter(e=>e.id===`hcard-key-move`).forEach(e=>e.cancel()),l||!e.animate)return;let n=d[t]-e.getBoundingClientRect().top;n&&e.animate([{translate:`0 ${n}px`},{translate:`0 0`}],{duration:160,easing:`cubic-bezier(.22, 1, .36, 1)`,id:`hcard-key-move`})});let f=s[n]?.querySelector(`.hcard-grip`);f?.focus({preventScroll:!0}),f?.scrollIntoView?.({block:`nearest`})};if(t.length===0)return(0,q.jsx)(`p`,{className:`muted`,children:e(`harness.none`)});let y=e=>{let t=new Set(h);t.delete(e)||t.add(e),m(t)};return(0,q.jsxs)(`div`,{className:`hlist`,ref:r,onKeyDown:e=>{e.target.classList.contains(`hcard-toggle`)&&kv(e,[...e.currentTarget.querySelectorAll(`button.hcard-toggle`)],{axis:`vertical`})},children:[s.map((t,r)=>(0,q.jsx)(Ny,{info:t,now:n,open:h.has(t.id),onToggle:()=>y(t.id),grip:s.length>1&&(0,q.jsx)(Py,{name:ku(t.id,e),first:r===0,last:r===s.length-1,onPointerDown:e=>{i.current=t.id,_(e,t.id)},onMove:e=>v(t.id,e)})},t.id)),(0,q.jsx)(`span`,{className:`sr-only`,"aria-live":`polite`,"aria-atomic":`true`,children:d})]})}function Hy(e){if(e===`unlimited`)return!0;let{min:t,max:n}=A.concurrentRunsSetting;return typeof e==`number`&&Number.isInteger(e)&&e>=t&&e<=n}`${A.concurrentRunsSetting.min}${A.concurrentRunsSetting.max}`;var Uy=A.concurrentRunsSetting.min,Wy=A.concurrentRunsSetting.max;function Gy(e){return e===0?`unlimited`:e}function Ky(e,t,n){let r=qy(e),i=Gy(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:Gy(t.max),source:e.source,stored:e.stored,inherited:i,issue:e.issue,pending:!1,locked:r}}function qy(e){return e.source===`startup`||e.issue===`unreadable_file`}function Jy(e){let t=e.trim();if(!/^\d+$/.test(t))return;let n=Number(t);return Hy(n)?n:void 0}function Yy(e){return Math.min(Wy,Math.max(Uy,e))}function Xy(e,t){return Yy(e+t)}function Zy(e,t){return e===void 0?typeof t==`number`?Yy(t):A.maxConcurrentRuns:Yy(e)}function Qy(e){let{concurrency:t,pendingConcurrency:n}=W.get();t&&!qy(t)&&(W.set({pendingConcurrency:{value:e}}),n===void 0&&$y())}async function $y(){for(;;){let e=W.get().pendingConcurrency;if(e===void 0)return;let t=await go(()=>L.setConcurrency(e.value),nt(W.get().lang,`settings.concurrencySaveFailed`));if(t&&W.set({capacity:t.capacity,concurrency:t.concurrency}),W.get().pendingConcurrency===e){W.set({pendingConcurrency:void 0});return}}}var eb={invalid_value:`settings.concurrencyIssueInvalid`,unreadable_file:`settings.concurrencyIssueUnreadable`};function tb(){let e=G(),t=B(W,e=>e.concurrency),n=B(W,e=>e.capacity),r=B(W,e=>e.pendingConcurrency),i=B(W,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?Ky(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=p===void 0?void 0:Jy(p),b=p!==void 0&&y===void 0,x=i&&n.max>0&&n.occupied>n.max,S=h.issue?e(eb[h.issue],{value:n.max===0?e(`settings.concurrencyUnlimited`):n.max}):h.source===`startup`?e(`settings.concurrencySource.startup`):void 0,C=x||S!==void 0,w=()=>{p!==void 0&&y!==void 0&&(m(void 0),y!==v&&Qy(y))},T=e=>{if(v===void 0)return;let t=Xy(y??v,e);m(void 0),t!==v&&Qy(t)};return(0,q.jsxs)(`div`,{className:`setting-row setting-row--concurrency`,children:[(0,q.jsxs)(`div`,{className:`setting-text`,children:[(0,q.jsx)(`div`,{className:`setting-label`,id:a,children:e(`settings.concurrency`)}),(0,q.jsx)(`p`,{className:`setting-note`,id:o,children:e(`settings.concurrencyNote`)})]}),(0,q.jsxs)(`div`,{className:`concurrency`,children:[(0,q.jsxs)(`div`,{className:`concurrency-line`,children:[(0,q.jsxs)(`div`,{ref:d,className:`segmented setting-control`,role:`radiogroup`,"aria-labelledby":a,"aria-describedby":C?`${o} ${s}`:o,"aria-disabled":h.locked||void 0,onKeyDown:e=>{kv(e,[...d.current?.querySelectorAll(`[role="radio"]`)??[]],{axis:`both`,wrap:!0})?.click()},children:[(0,q.jsx)(by,{}),(0,q.jsx)(`button`,{type:`button`,role:`radio`,"aria-checked":_,tabIndex:_?0:-1,"data-active":_?``:void 0,disabled:h.locked,onClick:()=>{_||Qy(Zy(f.current,h.inherited))},children:e(`settings.concurrencyLimited`)}),(0,q.jsx)(`button`,{type:`button`,role:`radio`,"aria-checked":!_,tabIndex:_?-1:0,"data-active":_?void 0:``,disabled:h.locked,onClick:()=>{_&&Qy(`unlimited`)},children:e(`settings.concurrencyUnlimited`)})]}),v===void 0?null:(0,q.jsxs)(`div`,{className:`concurrency-field`,children:[(0,q.jsx)(`button`,{type:`button`,className:`concurrency-step`,"aria-label":e(`settings.concurrencyDecrease`),"aria-controls":u,disabled:h.locked||v<=Uy,onClick:()=>T(-1),children:(0,q.jsx)(J,{name:`minus`,size:14})}),(0,q.jsx)(`input`,{id:u,className:`concurrency-input`,type:`text`,inputMode:`numeric`,autoComplete:`off`,spellCheck:!1,role:`spinbutton`,"aria-label":e(`settings.concurrencyValue`),"aria-valuemin":Uy,"aria-valuemax":Wy,"aria-valuenow":v,"aria-invalid":b||void 0,"aria-describedby":b?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,q.jsx)(`button`,{type:`button`,className:`concurrency-step`,"aria-label":e(`settings.concurrencyIncrease`),"aria-controls":u,disabled:h.locked||v>=Wy,onClick:()=>T(1),children:(0,q.jsx)(J,{name:`plus`,size:14})})]})]}),b&&v!==void 0?(0,q.jsx)(`p`,{className:`concurrency-meta concurrency-problem`,id:c,role:`alert`,children:e(`settings.concurrencyDraftInvalid`,{min:Uy,max:Wy,current:v})}):null,C?(0,q.jsxs)(`div`,{className:`concurrency-meta`,id:s,children:[x?(0,q.jsx)(`p`,{children:e(`settings.concurrencyOver`)}):null,S?(0,q.jsx)(`p`,{children:S}):null]}):null]})]})}var nb=[{id:`zh`,name:`中文`,tag:`zh-CN`},{id:`en`,name:`English`,tag:`en`}];function rb(e){return nb.find(t=>t.id===e.lang)?.name}function ib(){let e=G(),t=bo(),n=(0,l.useId)(),r=(0,l.useId)(),i=(0,l.useRef)(null);return(0,q.jsxs)(`div`,{className:`setting-list`,children:[(0,q.jsxs)(`div`,{className:`setting-row`,children:[(0,q.jsxs)(`div`,{className:`setting-text`,children:[(0,q.jsx)(`div`,{className:`setting-label`,id:n,children:e(`settings.language`)}),(0,q.jsx)(`p`,{className:`setting-note`,id:r,children:e(`settings.languageNote`)})]}),(0,q.jsx)(`div`,{className:`setting-aside`,children:(0,q.jsxs)(`div`,{ref:i,className:`segmented setting-control`,role:`radiogroup`,"aria-labelledby":n,"aria-describedby":r,onKeyDown:e=>{kv(e,[...i.current?.querySelectorAll(`[role="radio"]`)??[]],{axis:`both`,wrap:!0})?.click()},children:[(0,q.jsx)(by,{}),nb.map(e=>(0,q.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:()=>Ja(e.id),children:e.name},e.id))]})})]}),(0,q.jsx)(tb,{})]})}var ab=200;function ob(e){oo(),Ia({kind:`session`,id:e})}function sb({session:e,depth:t,below:n,busy:r}){let i=G(),a=bo(),o=e.runtime===`fixture`,s=Du(e,i),c=e.effort?.trim()||void 0,l=Wt(e,i),u=e.phase===`done`?e.lastRun?.durationMs:void 0,d=e.archivedAt?At(e.archivedAt,a,!0):``,f=ma({kind:`session`,id:e.id});return(0,q.jsxs)(`div`,{className:`arow`,role:`listitem`,"data-phase":e.phase,"data-depth":t,style:t>0?{"--depth":t}:void 0,onClick:t=>{t.target.closest(`a,button,[role='menu']`)||ob(e.id)},children:[t>0?(0,q.jsx)(`span`,{className:`arow-branch`,"aria-hidden":`true`}):null,(0,q.jsx)(`div`,{className:`arow-avatar`,children:(0,q.jsx)(Xg,{family:Wg(e.model),simulated:o,size:20})}),(0,q.jsxs)(`div`,{className:`arow-main`,children:[(0,q.jsxs)(`div`,{className:`arow-top`,children:[(0,q.jsx)(`a`,{className:`arow-title`,href:f,onClick:e=>{e.stopPropagation(),e.button!==0||e.metaKey||e.ctrlKey||e.shiftKey||e.altKey||oo()},children:e.title}),n.count>0?(0,q.jsx)(`span`,{className:`arow-kids num`,children:n.complete?i(`archive.children`,{n:n.count}):i(`archive.childrenAny`)}):null,e.archivedBy===`retention`?(0,q.jsx)($c,{tone:`neutral`,tip:i(`archive.autoTip`),children:i(`archive.auto`)}):null]}),(0,q.jsx)(`div`,{className:`arow-sub`,"data-tip":l,children:l}),(0,q.jsxs)(`div`,{className:`arow-meta`,children:[(0,q.jsxs)(`span`,{className:`arow-spec`,children:[(0,q.jsxs)(`span`,{className:`arow-harness`,children:[(0,q.jsx)(_l,{harness:e.harness,size:11,variant:`bare`}),(0,q.jsx)(`span`,{children:ku(e.harness,i)})]}),(0,q.jsx)(`span`,{className:`arow-model`,"data-tip":s,children:o?i(`run.simulated`):s}),!o&&c?(0,q.jsx)(`span`,{className:`a-effort`,children:(0,q.jsx)(`span`,{children:c})}):null,e.fast===!0?(0,q.jsx)(`span`,{className:`a-effort`,children:(0,q.jsx)(`span`,{children:`Fast`})}):null]}),(0,q.jsx)(`span`,{className:`arow-state${u===void 0?``:` num`}`,"data-kind":e.phase,children:u===void 0?Vt(e.phase,i):y(u)}),d?(0,q.jsx)(`time`,{className:`arow-time num`,dateTime:e.archivedAt,children:i(`archive.archivedAt`,{time:d})}):null]})]}),(0,q.jsxs)(`div`,{className:`arow-actions`,children:[(0,q.jsx)(Qc,{icon:`unarchive`,size:15,label:i(`archive.unarchiveOf`,{title:e.title}),"data-tip":i(`archive.unarchiveTip`),disabled:r,onClick:()=>void Xl([e.id])}),(0,q.jsx)(cu,{items:()=>Fu(e,i),label:i(`archive.exportOf`,{title:e.title}),glyph:(0,q.jsx)(J,{name:`download`,size:15})})]})]})}function cb(){let e=G(),t=B(W,e=>e.archived),n=B(W,e=>e.archivedLoaded),r=B(Bl,e=>e.list),i=B(Bl,e=>e.busy>0),[a,o]=(0,l.useState)(ab);(0,l.useEffect)(()=>{n||Ul().catch(()=>void 0)},[n]);let s=(0,l.useMemo)(()=>cl(Object.values(t)),[t]),c=s.length>a?s.slice(0,a):s;return!n&&r.status===`error`?(0,q.jsxs)(`div`,{className:`alist-state`,role:`alert`,children:[(0,q.jsx)(`p`,{children:e(`archive.loadFailed`)}),r.error?(0,q.jsx)(`p`,{className:`alist-error`,children:r.error}):null,(0,q.jsxs)(`button`,{type:`button`,className:`btn`,onClick:()=>void Ul({force:!0}).catch(()=>void 0),children:[(0,q.jsx)(J,{name:`refresh`,size:14}),e(`common.retry`)]})]}):n?s.length===0?(0,q.jsx)(`p`,{className:`alist-state`,children:e(`archive.empty`)}):(0,q.jsxs)(`div`,{className:`alist`,children:[(0,q.jsx)(`div`,{className:`alist-rows`,role:`list`,"aria-label":e(`archive.title`),children:c.map(({session:e,depth:n})=>(0,q.jsx)(sb,{session:e,depth:n,below:wu(e,e=>t[e]),busy:i},e.id))}),s.length>c.length?(0,q.jsx)(`div`,{className:`alist-more`,children:(0,q.jsx)(`button`,{type:`button`,className:`btn`,onClick:()=>o(e=>e+ab),children:e(`archive.more`,{n:s.length-c.length})})}):null]}):(0,q.jsxs)(`div`,{className:`alist-state alist-wait`,role:`status`,children:[(0,q.jsx)(el,{size:16}),(0,q.jsx)(`span`,{children:e(`archive.loading`)})]})}function lb(e,t){return e.archivedCount===void 0?void 0:t(`history.summary`,{n:e.archivedCount})}var ub={keepDays:{name:`history.keepDaysName`,lead:`history.keepDaysLead`,note:`history.keepDaysNote`,value:`history.keepDaysValue`,one:`history.unitDay`,many:`history.unitDays`,max:A.retention.maxKeepDays},keepCount:{name:`history.keepCountName`,lead:`history.keepCountLead`,note:`history.keepCountNote`,value:`history.keepCountValue`,one:`history.unitTree`,many:`history.unitTrees`,max:A.retention.maxKeepCount}};function db(e,t){if(!/^\d+$/.test(t))return;let n=Number(t);return lu(e,n)===void 0?n:void 0}function fb(e,t){let n=Object.keys(ub).flatMap(n=>{let r=e[n];if(r===null)return[];let i=ub[n];return[`${t(i.lead)} ${r} ${t(r===1?i.one:i.many)}`]});return n.length>0?n.join(` · `):t(`history.off`)}function pb({field:e,value:t,busy:n,onCommit:r}){let i=G(),a=ub[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:db(e,g)===void 0),v=(g===void 0?t:db(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=db(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,q.jsx)(`div`,{className:`setting-row retention-row`,"data-field":e,"data-on":m?``:void 0,children:(0,q.jsxs)(`div`,{className:`setting-text`,children:[(0,q.jsxs)(`div`,{className:`retention-line`,children:[(0,q.jsxs)(`label`,{className:`retention-toggle`,children:[(0,q.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,q.jsx)(`span`,{className:`retention-box`,"aria-hidden":`true`,children:(0,q.jsx)(J,{name:`check`,size:12,strokeWidth:3})})]}),(0,q.jsx)(`span`,{className:`retention-lead`,children:i(a.lead)}),(0,q.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,q.jsx)(`span`,{className:`retention-unit`,children:i(v)})]}),(0,q.jsx)(`p`,{className:`setting-note`,id:o,children:i(a.note)}),_?(0,q.jsx)(`p`,{className:`retention-problem`,id:s,role:`alert`,children:i(`history.invalid`,{min:1,max:a.max})}):null]})})}function mb(){let e=G(),t=bo(),n=B(W,e=>e.ready),r=B(W,e=>e.archivedCount),i=B(W,e=>e.retention),[a,o]=(0,l.useState)(!1),[s,c]=(0,l.useState)(void 0),[u,d]=(0,l.useState)(!1),[f,p]=(0,l.useState)(void 0),m=(0,l.useId)(),h=r!==void 0;(0,l.useEffect)(()=>{if(!h)return;let e=new AbortController;return eu(e.signal).then(e=>c(e.lastSweep)).catch(t=>{e.signal.aborted||p(Na(t))}),()=>e.abort()},[h]);let g=async(e,t)=>{let n=W.get().retention;if(!n||u)return!1;d(!0),p(void 0);try{let r=await tu({...n,[e]:t});return c(r.lastSweep),!0}catch(e){return p(Na(e)),!1}finally{d(!1)}};return h?(0,q.jsxs)(`div`,{className:`history`,children:[(0,q.jsxs)(`header`,{className:`history-head`,children:[(0,q.jsxs)(`div`,{className:`history-heading`,children:[(0,q.jsx)(`h4`,{className:`history-title`,children:e(`archive.title`)}),(0,q.jsx)(`span`,{className:`history-count num`,children:e(`archive.subtitle`,{n:r})})]}),(0,q.jsxs)(`button`,{type:`button`,className:`history-policy`,"aria-expanded":a,"aria-controls":a?m:void 0,"data-open":a?``:void 0,onClick:()=>o(e=>!e),children:[(0,q.jsx)(`span`,{className:`history-policy-name`,children:e(`history.retention`)}),i?(0,q.jsx)(`span`,{className:`history-policy-state`,children:fb(i,e)}):null,(0,q.jsx)(J,{name:`chevronDown`,size:12,strokeWidth:2,className:`history-policy-chevron`})]})]}),a?(0,q.jsxs)(`div`,{className:`history-panel`,id:m,role:`group`,"aria-label":e(`history.retention`),children:[(0,q.jsx)(`p`,{className:`settings-intro history-intro`,children:e(`history.retentionIntro`)}),(0,q.jsx)(`div`,{className:`setting-list`,"aria-busy":u||void 0,children:i?(0,q.jsxs)(q.Fragment,{children:[(0,q.jsx)(pb,{field:`keepDays`,value:i.keepDays,busy:u,onCommit:e=>g(`keepDays`,e)}),(0,q.jsx)(pb,{field:`keepCount`,value:i.keepCount,busy:u,onCommit:e=>g(`keepCount`,e)})]}):(0,q.jsx)(`div`,{className:`setting-row`,children:(0,q.jsx)(`div`,{className:`setting-text`,children:(0,q.jsx)(`p`,{className:`setting-note history-loading`,children:e(f?`history.retentionUnavailable`:`history.retentionLoading`)})})})}),s?(0,q.jsx)(`p`,{className:`history-sweep num`,children:e(`history.lastSweep`,{time:At(s.at,t,!0),n:s.archived})}):null,f?(0,q.jsx)(`p`,{className:`history-error`,role:`alert`,children:f}):null]}):null,(0,q.jsx)(`p`,{className:`setting-note history-note`,children:e(`archive.note`)}),(0,q.jsx)(cb,{})]}):n?(0,q.jsx)(`div`,{className:`setting-list`,children:(0,q.jsx)(`div`,{className:`setting-row`,children:(0,q.jsxs)(`div`,{className:`setting-text`,children:[(0,q.jsx)(`div`,{className:`setting-label`,children:e(`history.unsupported`)}),(0,q.jsx)(`p`,{className:`setting-note`,children:e(`history.unsupportedNote`)})]})})}):(0,q.jsxs)(`div`,{className:`alist-state alist-wait`,role:`status`,children:[(0,q.jsx)(el,{size:16}),(0,q.jsx)(`span`,{children:e(`boot.connecting`)})]})}function hb(e){return e.trim().toLowerCase()}function gb(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 _b=[`read_only`,`full`];function vb(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:_b.filter(t=>e.access[t])}};let r=Wv(e,t.model,t.effort);if(!r.ok)return{usable:!1,issue:yb(e.id,t,r)};let i=Jv(e,r,t.fast);if(!i.ok)return{usable:!1,issue:bb(e.id,i)};let a=Hv(e),o=a.models,s=r.model??a.defaultModel,c=r.effort??o.find(e=>e.id===s)?.defaultEffort;return{usable:!0,effective:{harness:e.id,access:t.access,enforcement:n.level,...s===void 0?{}:{model:s},...c===void 0?{}:{effort:c},...i.fast?{fast:!0}:{}}}}function yb(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 bb(e,t){let n=t.target===void 0?{}:{model:t.target};return t.reason===`fast_disabled`?{reason:`fast_disabled`,harness:e,...n}:{reason:`fast_unsupported`,harness:e,why:t.why,...t.why===`harness`?{}:n}}function xb(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`}}:vb(t,{harness:e.harness,access:e.access??`full`,...e.model===void 0?{}:{model:e.model},...e.effort===void 0?{}:{effort:e.effort},...e.fast===void 0?{}:{fast:e.fast}})}var Sb=Object.freeze({entries:[]});function Cb(e){return e!==Sb}function wb(e){return{...e.harness===void 0?{}:{harness:e.harness},...e.model===void 0?{}:{model:e.model},...e.effort===void 0?{}:{effort:e.effort},...e.fast===void 0?{}:{fast:e.fast},...e.access===void 0?{}:{access:e.access}}}function Tb(e){let t=wb(e);return t.harness===void 0?void 0:{...t,harness:t.harness}}function Eb(e,t){return e.harness===t.harness&&e.model===t.model&&e.effort===t.effort&&e.fast===t.fast&&e.access===t.access}function Db(e,t){return e.harness===t?wb(e):{harness:t,...e.access===void 0?{}:{access:e.access}}}function Ob(e,t,n){let r=wb(e);if(r.model===n)return r;let{model:i,effort:a,fast:o,...s}=r;return{...s,...n===void 0?{}:{model:n},...a!==void 0&&Pb(t,n).levels.includes(a)?{effort:a}:{},...o!==void 0&&Nb(t,n)?{fast:o}:{}}}function kb(e,t){let{fast:n,...r}=wb(e);return t===void 0?r:{...r,fast:t}}function Ab(e,t){let{effort:n,...r}=wb(e);return t===void 0?r:{...r,effort:t}}function jb(e,t){let{access:n,...r}=wb(e);return t===void 0?r:{...r,access:t}}function Mb(e,t){if(!e)return;let n=Hv(e);return n.models.find(e=>e.id===(t??n.defaultModel))}function Nb(e,t){let n=Mb(e,t);return e!==void 0&&n!==void 0&&qv(e,n.id)}function Pb(e,t){let n=Mb(e,t);return{levels:n?.efforts??[],fallback:n?.defaultEffort}}function Fb(e,t,n){let r=[];t===void 0&&r.push({value:``,label:n(`profiles.pickHarness`),disabled:!0});for(let t of e){let e=ku(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 Ib(e,t,n){let r=e?Hv(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 Lb(e,t,n,r){let{levels:i}=Pb(e,t),a=[{value:``,label:r(`harness.default`)}];for(let e of i)a.push({value:e,label:Ou(e,r)??e});return n!==void 0&&!i.includes(n)&&a.push({value:n,label:Ou(n,r)??n}),a}function Rb(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 zb(e,t){let n=hb(e);return{name:n,problem:gb(n)??(t.includes(n)?`duplicate`:void 0)}}function Bb(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 Vb(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:ku(e.harness,t),status:t(`harness.status.${e.status}`)});case`access_unsupported`:return t(`profiles.issue.access_unsupported`,{harness:ku(e.harness,t),access:t(`access.${e.access}`)});case`settings_unavailable`:return t(`profiles.issue.settings_unavailable`,{harness:ku(e.harness,t),section:n});case`no_models_open`:return t(`profiles.issue.no_models_open`,{harness:ku(e.harness,t),section:n});case`model_not_open`:return t(`profiles.issue.model_not_open`,{harness:ku(e.harness,t),model:e.model});case`model_unverified`:return e.model===void 0?t(`profiles.issue.model_unverified`,{harness:ku(e.harness,t)}):t(`profiles.issue.model_unknown`,{harness:ku(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:Ou(e.effort,t)??``});case`fast_disabled`:return t(`profiles.issue.fast_disabled`,{harness:ku(e.harness,t)});case`fast_unsupported`:return e.why===`harness`?t(`profiles.issue.fast_harness`,{harness:ku(e.harness,t)}):t(e.why===`model`?`profiles.issue.fast_model`:`profiles.issue.fast_unverified`,{model:e.model??t(`model.default`)})}}var Hb=Promise.resolve();function Ub(e,t){let n=Hb.then(async()=>(await go(e,nt(W.get().lang,t)))?.profiles);return Hb=n.catch(()=>void 0),n}function Wb(e,t){return Ub(()=>L.putProfile(e,t),`profiles.saveFailed`)}function Gb(e,t){return Ub(()=>L.putProfile(e,{...t,create:!0}),`profiles.saveFailed`)}function Kb(e,t){return Ub(()=>L.renameProfile(e,t),`profiles.saveFailed`)}function qb(e){return Ub(()=>L.removeProfile(e),`profiles.removeFailed`)}var Jb=[`fontFamily`,`fontSize`,`fontWeight`,`fontStyle`,`fontStretch`,`letterSpacing`,`textTransform`],Yb=.25,Xb={position:`absolute`,top:0,right:`100%`,visibility:`hidden`,whiteSpace:`nowrap`,pointerEvents:`none`};function Zb(e,t){let n=getComputedStyle(e);for(let e of Jb)t.style[e]=n[e];let r=e.clientWidth-(Number.parseFloat(n.paddingLeft)||0)-(Number.parseFloat(n.paddingRight)||0);return r>0&&t.getBoundingClientRect().width>r+Yb}function Qb({field:e,caption:t,roleName:n,value:r,options:i,disabled:a,onPick:o}){let s=G(),c=i.find(e=>e.value===r)?.label,u=(0,l.useRef)(null),d=(0,l.useRef)(null),[f,p]=(0,l.useState)(!1);return(0,l.useLayoutEffect)(()=>{let e=u.current,t=d.current;if(!e||!t){p(!1);return}let n=!0,r=()=>{n&&p(Zb(e,t))};r();let i=new ResizeObserver(r);return i.observe(e),document.fonts?.ready.then(r),()=>{n=!1,i.disconnect()}},[c]),(0,q.jsxs)(`label`,{className:`prof-field`,"data-field":e,children:[(0,q.jsx)(`span`,{className:`prof-cap`,children:t}),(0,q.jsxs)(`span`,{className:`prof-pick`,"data-tip":f?c:void 0,children:[(0,q.jsx)(`select`,{ref:u,value:r,disabled:a,"aria-label":s(`profiles.fieldFor`,{field:t,name:n}),onChange:e=>o(e.currentTarget.value),children:i.map(e=>(0,q.jsx)(`option`,{value:e.value,disabled:e.disabled,children:e.label},e.value))}),c===void 0?null:(0,q.jsx)(`span`,{className:`prof-probe`,ref:d,style:Xb,"aria-hidden":`true`,children:c})]})]})}function $b(e,t){if(!Cb(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=>xb(t,e.harnesses.find(e=>e.id===t.harness)).usable).length;return t(`settings.profiles.summary`,{ready:i,total:n.length})}function ex({entry:e,others:t,harnesses:n,onRemove:r,onClaim:i,onRelease:a,onSaved:o}){let s=G(),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:xb(w,C),{name:E,problem:D}=zb(u,t),O=f?D:void 0,k=e?.name??(u.trim()||s(`profiles.newRole`)),A=O===void 0?T!==void 0&&!T.usable?Vb(T.issue,s):e===void 0?s(`profiles.draftHint`):void 0:Bb(O,E,s),j=(e,n,r)=>{let{name:s,problem:c}=zb(e,t),l=Tb(n);c!==void 0||l===void 0?(r||e.trim()!==``)&&p(!0):y.current||(y.current=!0,i(s),Gb(s,l).then(e=>{y.current=!1,e?o(s,e):a(s)}))},ee=(t,n=!1)=>{if(e===void 0){h(t),j(u,t,n);return}let r=Tb(t);if(r===void 0||Eb(t,S))return;_(t);let i=++v.current;Wb(e.name,r).then(e=>{e&&vo(e),v.current===i&&_(void 0)})},te=()=>{if(e===void 0){j(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),Kb(t,E).then(e=>{e?o(E,e):(a(E),d(t))})},ne=t=>{t.key===`Enter`&&!t.nativeEvent.isComposing?(t.preventDefault(),te()):t.key===`Escape`&&u!==(e?.name??``)&&(t.stopPropagation(),t.preventDefault(),d(e?.name??``),p(!1))},re=Pb(C,S.model).levels,M=Nb(C,S.model),N=T?.usable===!0;return(0,q.jsxs)(`li`,{className:`prof-row`,"data-draft":e===void 0?``:void 0,children:[(0,q.jsxs)(`div`,{className:`prof-id`,children:[(0,q.jsx)(`span`,{className:`status-pip prof-pip`,"data-status":T===void 0?`needs_setup`:N?`ready`:`unavailable`,"aria-hidden":`true`}),T===void 0?null:(0,q.jsx)(`span`,{className:`sr-only`,children:s(N?`harness.status.ready`:`harness.status.unavailable`)}),(0,q.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":A===void 0?void 0:c,autoFocus:e===void 0,autoComplete:`off`,autoCapitalize:`off`,spellCheck:!1,onChange:e=>d(e.target.value),onBlur:te,onKeyDown:ne})]}),(0,q.jsxs)(`div`,{className:`prof-fields`,children:[(0,q.jsx)(Qb,{field:`harness`,caption:s(`info.harness`),roleName:k,value:S.harness??``,options:Fb(n,S.harness,s),disabled:!x,onPick:e=>ee(Db(S,e),!0)}),(0,q.jsx)(Qb,{field:`model`,caption:s(`info.model`),roleName:k,value:S.model??``,options:Ib(C,S.model,s),disabled:!x||C===void 0,onPick:e=>ee(Ob(S,C,e===``?void 0:e))}),(0,q.jsx)(Qb,{field:`effort`,caption:s(`info.effort`),roleName:k,value:S.effort??``,options:Lb(C,S.model,S.effort,s),disabled:!x||C===void 0||re.length===0&&S.effort===void 0,onPick:e=>ee(Ab(S,e===``?void 0:e))}),(0,q.jsx)(Qb,{field:`fast`,caption:s(`harness.fast`),roleName:k,value:S.fast===void 0?``:String(S.fast),options:[{value:``,label:s(`harness.default`)},{value:`false`,label:s(`profiles.standard`)},{value:`true`,label:s(`harness.fast`),disabled:!M||C?.fastMode===`disabled`}],disabled:!x||!M&&S.fast===void 0,onPick:e=>ee(kb(S,e===``?void 0:e===`true`))}),(0,q.jsx)(Qb,{field:`access`,caption:s(`info.access`),roleName:k,value:S.access??``,options:Rb(C,S.access,s),disabled:!x||C===void 0,onPick:e=>ee(jb(S,e===`read_only`||e===`full`?e:void 0))})]}),(0,q.jsx)(Qc,{className:`prof-del`,icon:`trash`,label:e===void 0?s(`profiles.discard`):s(`profiles.delete`,{name:e.name}),onClick:r}),A===void 0?null:(0,q.jsx)(`p`,{className:`prof-msg`,id:c,children:A})]})}function tx(){let e=G(),t=B(W,e=>e.profiles),n=B(W,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(!Cb(t))return(0,q.jsx)(`p`,{className:`muted`,role:`status`,children:e(`profiles.unsupported`)});if(t.unavailable)return(0,q.jsxs)(q.Fragment,{children:[(0,q.jsx)(`p`,{className:`settings-intro`,children:e(`profiles.intro`,{section:e(`settings.section.executors`)})}),(0,q.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),vo(n)}}),g=t=>lo({title:e(`profiles.deleteTitle`,{name:t.name}),body:e(`profiles.deleteBody`),confirmLabel:e(`profiles.deleteConfirm`),tone:`danger`,onConfirm:async()=>{let e=await qb(t.name);e&&(vo(e),s.current?.focus())}});return(0,q.jsxs)(q.Fragment,{children:[(0,q.jsx)(`p`,{className:`settings-intro`,children:e(`profiles.intro`,{section:e(`settings.section.executors`)})}),(0,q.jsxs)(`div`,{className:`prof`,children:[(0,q.jsx)(`div`,{className:`prof-table`,children:f.length===0?(0,q.jsx)(`p`,{className:`muted prof-empty`,children:e(`profiles.empty`)}):(0,q.jsxs)(q.Fragment,{children:[(0,q.jsxs)(`div`,{className:`prof-cols`,"aria-hidden":`true`,children:[(0,q.jsx)(`span`,{children:e(`profiles.col.name`)}),(0,q.jsx)(`span`,{children:e(`info.harness`)}),(0,q.jsx)(`span`,{children:e(`info.model`)}),(0,q.jsx)(`span`,{children:e(`info.effort`)}),(0,q.jsx)(`span`,{children:e(`harness.fast`)}),(0,q.jsx)(`span`,{children:e(`info.access`)})]}),(0,q.jsx)(`ul`,{className:`prof-list`,children:f.map(({id:e,entry:t})=>(0,q.jsx)(ex,{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,q.jsxs)(`div`,{className:`prof-foot`,children:[(0,q.jsxs)(`button`,{ref:s,type:`button`,className:`btn`,disabled:p,onClick:()=>{let e=++o.current;i(t=>[...t,e])},children:[(0,q.jsx)(J,{name:`plus`,size:14}),e(`profiles.add`)]}),p?(0,q.jsx)(`span`,{className:`prof-limit`,role:`status`,children:e(`profiles.limit`,{max:20})}):null]})]})]})}var nx=`/assets/ensemble-bowtie-C5PHHV-v.svg`,rx={checkout:`version.target.checkout`,codex:`version.target.codex`,cursor:`version.target.cursor`,global:`version.target.global`},ix={checkout:`version.activate.service`,global:`version.activate.service`,codex:`version.activate.codex`,cursor:`version.activate.cursor`},ax={registry:`version.error.registry`,release_changed:`version.error.changed`,missing:`version.error.missing`,npm:`version.error.npm`,permissions:`version.error.permissions`,install:`version.error.install`,codex:`version.error.codex`,source_dirty:`version.error.dirty`,source_branch:`version.error.branch`,source_revision:`version.error.revision`,source_diverged:`version.error.diverged`,rollback:`version.error.rollback`};function ox(e){return e.version?`v${e.version}`:void 0}function sx(e){return e.checkFailed?`version.error.registry`:e.relation===`available`?e.copies.some(t=>t.target===e.activeTarget&&t.relation===`current`)?`version.restart`:`version.available`:e.copies.some(e=>e.relation===`available`)?`version.copiesAvailable`:e.relation===`ahead`?`version.ahead`:e.relation===`unknown`?`version.unknown`:e.activeTarget===`checkout`?`version.devCurrent`:`version.current`}function cx(){let e=G(),t=B(W,e=>e.version),n=B(W,e=>e.lang),[r,i]=(0,l.useState)(),[a,o]=(0,l.useState)(null),[s,c]=(0,l.useState)(),u=(0,l.useRef)(null),d=(0,l.useCallback)(async(e,t=!1)=>{let n=u.current?.signal;if(n&&!n.aborted){t||o(`check`);try{let t=await L.version(e,n);n.aborted||(i(t),c(void 0))}catch(e){n.aborted||c(e instanceof je&&e.status===404?`version.unsupported`:`version.error.connection`)}finally{!n.aborted&&!t&&o(null)}}},[]);(0,l.useEffect)(()=>{let e=new AbortController;return u.current=e,d(!1),()=>e.abort()},[d]);let f=r?.job?.phase===`installing`,p=a!==null;(0,l.useEffect)(()=>{if(!f)return;let e=!1,t,n=async()=>{await d(!1,!0),e||(t=setTimeout(()=>void n(),1200))};return t=setTimeout(()=>void n(),1e3),()=>{e=!0,clearTimeout(t)}},[f,d]);let m=async e=>{let t=u.current?.signal;if(!(!t||t.aborted||!r?.latest||p||f)){o(e),c(void 0);try{let n=await L.updateVersion(e,r.latest,t);t.aborted||i(n)}catch(e){t.aborted||(await d(!1,!0),t.aborted||c(e instanceof je&&e.status===409?`version.error.changed`:`version.error.connection`))}finally{t.aborted||o(null)}}},h=r?.running||t,g=r?.job,_=s?e(s):a===`check`||!r?e(`version.checking`):a?e(`version.updating`,{target:e(rx[a])}):e(sx(r));return(0,q.jsxs)(`div`,{className:`version-panel`,children:[(0,q.jsxs)(`div`,{className:`version-brand`,children:[(0,q.jsx)(`img`,{src:nx,alt:``,width:64,height:64}),(0,q.jsxs)(`div`,{children:[(0,q.jsx)(`h4`,{lang:`en`,children:`Ensemble`}),(0,q.jsxs)(`p`,{children:[e(`version.running`),` `,(0,q.jsx)(`strong`,{className:`mono`,children:h?`v${h}`:`—`}),r?.activeTarget===`checkout`?(0,q.jsx)(`span`,{className:`version-source`,children:e(`version.development`)}):null]})]})]}),(0,q.jsxs)(`div`,{className:`version-release`,children:[(0,q.jsxs)(`div`,{children:[(0,q.jsx)(`h4`,{children:e(r?.checkFailed&&r.latest?`version.lastKnown`:`version.latest`)}),(0,q.jsx)(`span`,{className:`mono version-number`,children:r?.latest?`v${r.latest}`:`—`})]}),(0,q.jsxs)(`button`,{type:`button`,className:`btn btn--ghost`,disabled:p||f,onClick:()=>void d(!0),children:[(0,q.jsx)(J,{name:`refresh`,size:14}),e(`version.check`)]})]}),(0,q.jsx)(`p`,{className:`version-status`,role:`status`,children:_}),r?.checkedAt?(0,q.jsx)(`p`,{className:`version-time`,children:e(`version.checked`,{time:jt(r.checkedAt,n)})}):null,r&&r.copies.length>0?(0,q.jsxs)(`section`,{className:`version-installs`,children:[(0,q.jsx)(`h4`,{children:e(`version.installs`)}),(0,q.jsx)(`ul`,{className:`version-list`,children:r.copies.map(t=>(0,q.jsxs)(`li`,{children:[(0,q.jsx)(`span`,{children:e(rx[t.target])}),(0,q.jsxs)(`span`,{className:`version-copy-number mono`,children:[`v`,t.version]}),t.relation===`available`&&!r.checkFailed?(0,q.jsx)(`button`,{type:`button`,className:`btn btn--primary`,disabled:p||f,"aria-label":e(`version.updateTarget`,{target:e(rx[t.target]),version:r.latest??``}),onClick:()=>void m(t.target),children:e(a===t.target||g?.target===t.target&&f?`version.installing`:`version.update`,{version:r.latest??``})}):null]},t.target))})]}):null,r?.copies.some(e=>e.target===`checkout`&&e.relation===`available`)?(0,q.jsx)(`p`,{className:`setting-note`,children:e(`version.checkoutNote`)}):null,r&&!r.activeTarget&&r.relation===`available`?(0,q.jsxs)(`p`,{className:`setting-note`,children:[e(`version.standalone`),` `,(0,q.jsx)(`a`,{href:`https://www.npmjs.com/package/ensemble-plugin`,target:`_blank`,rel:`noreferrer`,children:`npm ↗`})]}):null,g?(0,q.jsxs)(`p`,{className:`version-job`,role:`status`,children:[g.phase===`failed`?e(ax[g.failure??`install`]):g.phase===`installing`?e(`version.updating`,{target:e(rx[g.target])}):e(ix[g.target],{target:e(rx[g.target]),version:g.version}),g.recoveryPath?(0,q.jsxs)(`span`,{className:`mono`,children:[` `,g.recoveryPath]}):null]}):null]})}var lx=[{id:`executors`,labelKey:`settings.section.executors`,icon:`terminalWindow`,summary:zy,Component:Vy,actions:By},{id:`profiles`,labelKey:`settings.section.profiles`,icon:`identityBadge`,summary:$b,Component:tx},{id:`general`,labelKey:`settings.section.general`,icon:`sliders`,summary:rb,Component:ib},{id:`history`,labelKey:`settings.section.history`,icon:`archive`,summary:lb,Component:mb},{id:`version`,labelKey:`settings.section.version`,icon:`info`,summary:ox,Component:cx}];function ux(e,t){e&&t instanceof HTMLElement&&e.contains(t)&&(e.scrollWidth<=e.clientWidth+1&&e.scrollHeight<=e.clientHeight+1||t.scrollIntoView?.({block:`nearest`,inline:`nearest`}))}function dx({section:e,selected:t,ids:n}){let r=G(),i=B(W,t=>e.summary?.(t,rt(t.lang)));return(0,q.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:()=>co(e.id),children:[(0,q.jsx)(J,{name:e.icon,size:20,strokeWidth:1.5}),(0,q.jsxs)(`span`,{className:`settings-tab-text`,children:[(0,q.jsx)(`span`,{className:`settings-tab-label`,children:r(e.labelKey)}),i?(0,q.jsx)(`span`,{className:`settings-tab-sub`,children:i}):null]})]})}function fx({active:e}){let t=(0,l.useRef)(null),[n,r]=(0,l.useState)(!1);return(0,l.useLayoutEffect)(()=>{let e=t.current,n=e?.parentElement;if(!e||!n)return;let r=()=>{let t=n.querySelector(`[role="tab"][aria-selected="true"]`);t&&(e.style.transform=`translate(${t.offsetLeft}px, ${t.offsetTop}px)`,e.style.width=`${t.offsetWidth}px`,e.style.height=`${t.offsetHeight}px`)};if(r(),typeof ResizeObserver>`u`)return;let i=new ResizeObserver(r);i.observe(n);for(let e of n.querySelectorAll(`[role="tab"]`))i.observe(e);return()=>i.disconnect()},[e]),(0,l.useLayoutEffect)(()=>{let e=requestAnimationFrame(()=>r(!0));return()=>cancelAnimationFrame(e)},[]),(0,q.jsx)(`span`,{ref:t,className:`settings-nav-mark`,"data-ready":n?``:void 0,"aria-hidden":`true`})}function px(){let e=G(),{open:t,section:n}=B(W,e=>e.settings),r=(0,l.useId)(),i=(0,l.useRef)(null),[a,o]=(0,l.useState)(!1),s={tab:e=>`${r}-tab-${e}`,panel:`${r}-panel`},c=lx.find(e=>e.id===n)??lx[0];if((0,l.useLayoutEffect)(()=>o(!1),[c?.id,t]),(0,l.useLayoutEffect)(()=>{let e=i.current;ux(e,e?.querySelector(`[role="tab"][aria-selected="true"]`))},[c?.id,t]),!c)return null;let{Component:u,actions:d}=c;return(0,q.jsx)(dv,{open:t,onClose:oo,label:e(`settings.title`),width:920,initialFocus:`[role="tab"][aria-selected="true"]`,children:(0,q.jsx)(`div`,{className:`settings`,"data-section":c.id,children:(0,q.jsxs)(`div`,{className:`settings-frame`,children:[(0,q.jsxs)(`aside`,{className:`settings-side`,children:[(0,q.jsx)(`h2`,{className:`settings-title`,children:e(`settings.title`)}),(0,q.jsxs)(`div`,{ref:i,className:`settings-nav`,role:`tablist`,"aria-label":e(`settings.sections`),onFocus:e=>ux(i.current,e.target),onKeyDown:e=>{kv(e,[...i.current?.querySelectorAll(`[role="tab"]`)??[]],{axis:`both`,wrap:!0})?.click()},children:[(0,q.jsx)(fx,{active:c.id}),lx.map(e=>(0,q.jsx)(dx,{section:e,selected:e===c,ids:s},e.id))]})]}),(0,q.jsxs)(`section`,{className:`settings-main`,"data-scrolled":a?``:void 0,children:[(0,q.jsxs)(`header`,{className:`settings-head`,children:[(0,q.jsx)(`h3`,{className:`settings-head-title`,children:e(c.labelKey)},c.id),(0,q.jsx)(`span`,{className:`spacer`}),d?(0,q.jsx)(d,{}):null,(0,q.jsx)(Qc,{icon:`close`,label:e(`common.close`),onClick:oo})]}),(0,q.jsx)(`div`,{className:`settings-body`,id:s.panel,role:`tabpanel`,"aria-labelledby":s.tab(c.id),"data-scroll":!0,onScroll:e=>o(e.currentTarget.scrollTop>0),children:(0,q.jsx)(u,{})},c.id)]})]})})})}var mx=`ensemble:token-reload-at`,hx=15e3,gx=[`hello`,`snapshot`,`summary`,`events`,`removed`,`harness`,`capacity`,`profiles`,`ping`];function _x(e,t=!0){let n=W.get(),r=Xe(n,e),{sessions:i}=r;W.set({...r,harnesses:e.harnesses,capacity:e.capacity,concurrency:e.concurrency,profiles:e.profiles??Sb,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&&Ga(a.id):e.archivedCount===void 0?W.set({detail:{...a,error:`not_found`}}):Ga(a.id)}else a&&!a.loading&&a.error===`failed`&&Ga(a.id);n.archivedLoaded&&e.archivedCount!==void 0&&Ul({force:!0}).catch(()=>void 0)}function vx(e){switch(e.type){case`snapshot`:_x(e.snapshot);return;case`summary`:yo(e.summary);return;case`events`:qa(e.sessionId,e.events);return;case`removed`:W.set(t=>({...Ye(t,e.sessionId),...t.detail?.id===e.sessionId?{detail:{...t.detail,error:`not_found`}}:{}}));return;case`harness`:_o(e.info);return;case`capacity`:W.set({capacity:e.capacity,concurrency:e.concurrency});return;case`profiles`:vo(e.profiles);return;case`hello`:case`ping`:return}}function yx(e){return e instanceof je&&e.status===403&&e.code===`invalid_token`}function bx(e){try{let e=Number(sessionStorage.getItem(mx)??0);if(Number.isFinite(e)&&Date.now()-e<hx)return!1;sessionStorage.setItem(mx,String(Date.now()))}catch{return!1}return e(),!0}function xx(e={}){let t=e.reload??(()=>location.reload()),n,r=new AbortController,i,a=1e3,o=()=>{r.abort(),clearTimeout(i),n?.close()},s=()=>{o(),bx(t)||W.set({conn:`offline`})},c=()=>{if(r.signal.aborted)return;n?.close();let e=new EventSource(Re());n=e;let t=()=>!r.signal.aborted&&n===e;for(let n of gx)e.addEventListener(n,e=>{if(t())try{vx(JSON.parse(e.data))}catch(e){console.error(`[ensemble] bad stream message`,e)}});e.addEventListener(`open`,()=>{t()&&(a=1e3,W.get().conn!==`live`&&W.set({conn:W.get().ready?`live`:`connecting`}))}),e.addEventListener(`error`,()=>{t()&&(e.readyState===EventSource.CLOSED?(W.set({conn:`offline`}),l()):W.set({conn:`reconnecting`}))})},l=()=>{clearTimeout(i),i=setTimeout(async()=>{let{signal:e}=r;if(!e.aborted)try{if(await L.state(AbortSignal.any([e,AbortSignal.timeout(5e3)])),e.aborted)return;W.set({conn:`reconnecting`}),c()}catch(t){if(e.aborted)return;yx(t)?s():(!(t instanceof je)||t.status===0||t.status>=500)&&(a=Math.min(a*1.6,6e3),l())}},a)};return L.state(r.signal).then(e=>{!r.signal.aborted&&!W.get().ready&&_x(e,!1)}).catch(e=>{!r.signal.aborted&&yx(e)&&s()}),c(),o}function Sx(e,t,n,r){let i=G(),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:sa(o,i)};return}let s=a.current;if(a.current=void 0,!s||s.key!==t.key)return;let c=W.get(),l=ia(void 0,c.lastWorkspace,n);if(La(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?sa(u,i):l.kind===`active`?i(`rail.active`):i(`rail.all`);Aa(`info`,i(`archive.spaceGone`,{name:s.title,target:d}),6e3)},[r,e,t,n,i])}function Cx(e){return typeof window>`u`?()=>{}:(window.addEventListener(`resize`,e),()=>window.removeEventListener(`resize`,e))}var wx=()=>typeof window>`u`||window.innerWidth>=860;function Tx(){return(0,l.useSyncExternalStore)(Cx,wx,()=>!0)}function Ex(){let e=G();return B(W,e=>e.conn)===`offline`?(0,q.jsx)(`div`,{className:`boot boot--offline`,role:`alert`,children:(0,q.jsxs)(`div`,{className:`state-card`,children:[(0,q.jsx)(`span`,{className:`state-icon`,"data-tone":`red`,children:(0,q.jsx)(J,{name:`alert`,size:22})}),(0,q.jsx)(`h2`,{children:e(`boot.offlineTitle`)}),(0,q.jsx)(`p`,{children:e(`boot.offlineBody`)}),(0,q.jsx)(`div`,{className:`state-actions`,children:(0,q.jsxs)(`button`,{type:`button`,className:`btn btn--primary`,onClick:()=>window.location.reload(),children:[(0,q.jsx)(J,{name:`refresh`,size:14}),e(`boot.reload`)]})})]})}):(0,q.jsxs)(`div`,{className:`boot`,role:`status`,children:[(0,q.jsx)(el,{size:20}),(0,q.jsx)(`span`,{children:e(`boot.connecting`)})]})}function Dx(){let e=B(W,e=>e.route),t=B(W,e=>e.ready),n=B(W,e=>e.sessions),r=B(W,e=>e.lastWorkspace),i=B(W,e=>e.railCollapsed),a=bo(),o=Tx(),[s,c]=(0,l.useState)(()=>new Set),u=(0,l.useMemo)(()=>new Fg,[]),d=(0,l.useMemo)(()=>Object.values(n),[n]),f=(0,l.useMemo)(()=>ra(d),[d]),p=e.kind===`session`?e.id:void 0,m=(0,l.useMemo)(()=>p?oa(d,p):void 0,[d,p]),h=(0,l.useMemo)(()=>e.kind===`session`&&m?{kind:`origin`,key:m}:ia(e.kind===`overview`?e.scope:void 0,r,f),[e,m,r,f]),g=(0,l.useMemo)(()=>h.kind===`origin`?f.find(e=>e.key===h.key):void 0,[h,f]);Sx(e,e.kind===`overview`?e.scope??r??h:h,f,t);let _=km((0,l.useMemo)(()=>Cm(d),[d]).targets),v=(0,l.useMemo)(()=>{let e=new Map;if(_.entries.size===0)return e;let t=new Map;for(let[e,n]of _.entries)n.git.branch&&t.set(tr(e),n.git.branch);for(let n of f){if(!n.workspace)continue;let r=_.entries.get(n.workspace)?.git.branch??t.get(tr(n.workspace));r&&e.set(n.key,r)}return e},[_.entries,f]);(0,l.useEffect)(()=>{document.documentElement.lang=a===`zh`?`zh-CN`:`en`},[a]),(0,l.useEffect)(()=>{let e=Wa(),t=xx();return()=>{e(),t()}},[]),(0,l.useEffect)(()=>{h.kind===`origin`&&io(h.key)},[h]),(0,l.useEffect)(()=>{let e=e=>{if(e.isComposing)return;let t=W.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(),ro();else if(!r){if((e.metaKey||e.ctrlKey)&&!e.altKey&&!e.shiftKey&&i===`b`&&o){if(t.settings.open||t.switcherOpen)return;e.preventDefault(),eo(!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=la(f,h,e.key===`]`?1:-1);t&&(e.preventDefault(),La(t))}else if(e.altKey&&!e.metaKey&&!e.ctrlKey&&!e.shiftKey&&(e.key===`ArrowUp`||e.key===`ArrowDown`)){let t=la(f,h,e.key===`ArrowDown`?1:-1);t&&(e.preventDefault(),La(t))}}}};return document.addEventListener(`keydown`,e),()=>document.removeEventListener(`keydown`,e)},[o,f,h]);let y=o&&!i,b=o&&i,x=!o&&e.kind===`overview`;return(0,q.jsxs)(`div`,{className:`app`,"data-view":e.kind,"data-rail":y?`open`:b?`collapsed`:`none`,"data-topbar":x?``:void 0,children:[y?(0,q.jsx)($u,{workspaces:f,sessions:d,currentScope:h,...p?{focusedSessionId:p}:{},...m?{focusedOriginKey:m}:{},branches:v,expanded:s,setExpanded:c}):b?(0,q.jsx)(ed,{}):null,(0,q.jsxs)(`div`,{className:`shell-main`,"data-modal-inert":!0,children:[x?(0,q.jsx)(td,{currentScope:h,...g?{currentWorkspace:g}:{}}):null,(0,q.jsx)(`div`,{className:`stage`,children:t?e.kind===`session`?(0,q.jsx)(bm,{id:e.id},e.id):(0,q.jsx)(K_,{engine:u,scope:h,workspaces:f,gitState:_}):(0,q.jsx)(Ex,{})})]}),y?null:(0,q.jsx)(nd,{tools:!1,notices:!0}),(0,q.jsx)(Ev,{workspaces:f,sessions:d,currentScope:h,branches:v}),(0,q.jsx)(px,{}),(0,q.jsx)(fv,{}),(0,q.jsx)(Sv,{}),(0,q.jsx)(al,{})]})}var Ox=document.getElementById(`root`);if(!Ox)throw Error(`Missing #root`);(0,d.createRoot)(Ox).render((0,q.jsx)(Dx,{}));
|